From: Andrea Bianco Date: Mon, 9 Sep 2019 17:54:28 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.3.1 X-Git-Tag: 2.3.1 X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=fba75781093ab98a24e16eccb57391c1775d4745;p=motion2.git Built motion from commit (unavailable).|2.3.1 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index dd1bc0f..7f253ba 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.3.0", "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-04T21:15:07.995Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); +define({ "name": "xCALLY Motion API", "version": "2.3.1", "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-09T17:46:49.812Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 47adeca..5072439 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.3.0", "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-04T21:15:07.995Z", "url": "http://apidocjs.com", "version": "0.17.7" } } +{ "name": "xCALLY Motion API", "version": "2.3.1", "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-09T17:46:49.812Z", "url": "http://apidocjs.com", "version": "0.17.7" } } diff --git a/package.json b/package.json index b52bd47..4cd0270 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.3.0", + "version": "2.3.1", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 9b3d35b..a5ad333 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 _0xfdbd=['motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','jscripty','browser','bot','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'];(function(_0x150655,_0x1263db){var _0x376d4a=function(_0x3174af){while(--_0x3174af){_0x150655['push'](_0x150655['shift']());}};_0x376d4a(++_0x1263db);}(_0xfdbd,0xf0));var _0xdfdb=function(_0xdae8e6,_0x34854a){_0xdae8e6=_0xdae8e6-0x0;var _0x24c7a7=_0xfdbd[_0xdae8e6];return _0x24c7a7;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'get':function(_0x47b4ce){return this[_0xdfdb('0x3')](_0xdfdb('0x4'));}},'action':{'type':Sequelize[_0xdfdb('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xdfdb('0x6'),_0xdfdb('0x7'),'motionbar',_0xdfdb('0x8'),'urlForward',_0xdfdb('0x9'),_0xdfdb('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xdfdb('0xb')},'data2':{'type':Sequelize[_0xdfdb('0x5')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0xdfdb('0x5')](0x1000),'comment':_0xdfdb('0xc')},'data4':{'type':Sequelize[_0xdfdb('0x5')](0x1000)},'data5':{'type':Sequelize[_0xdfdb('0x5')](0x1000)},'data6':{'type':Sequelize[_0xdfdb('0x5')]},'data7':{'type':Sequelize[_0xdfdb('0xd')]}}; \ No newline at end of file +var _0xf494=['STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','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)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','sequelize','exports','VIRTUAL','getDataValue','action'];(function(_0x2e4a6c,_0x3e3df7){var _0x47bd95=function(_0x287b2b){while(--_0x287b2b){_0x2e4a6c['push'](_0x2e4a6c['shift']());}};_0x47bd95(++_0x3e3df7);}(_0xf494,0x1c6));var _0x4f49=function(_0xebedaf,_0x20fc45){_0xebedaf=_0xebedaf-0x0;var _0x828eef=_0xf494[_0xebedaf];return _0x828eef;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'get':function(_0x52d22c){return this[_0x4f49('0x3')](_0x4f49('0x4'));}},'action':{'type':Sequelize[_0x4f49('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4f49('0x6'),_0x4f49('0x7'),_0x4f49('0x8'),_0x4f49('0x9'),_0x4f49('0xa'),_0x4f49('0xb'),_0x4f49('0xc')]],'msg':_0x4f49('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x4f49('0xe')},'data2':{'type':Sequelize[_0x4f49('0x5')](0x1000),'comment':_0x4f49('0xf')},'data3':{'type':Sequelize[_0x4f49('0x5')](0x1000),'comment':_0x4f49('0x10')},'data4':{'type':Sequelize[_0x4f49('0x5')](0x1000)},'data5':{'type':Sequelize[_0x4f49('0x5')](0x1000)},'data6':{'type':Sequelize[_0x4f49('0x5')]},'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 9ca8382..9681d27 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 _0x04b9=['ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','set','apply','reject','save','then','destroy','name','send','update','body','Action','find','catch','params','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path'];(function(_0x4999e4,_0x14e1e4){var _0x2699ba=function(_0x3d12f4){while(--_0x3d12f4){_0x4999e4['push'](_0x4999e4['shift']());}};_0x2699ba(++_0x14e1e4);}(_0x04b9,0x17e));var _0x904b=function(_0x2eb0bb,_0x1b2cd7){_0x2eb0bb=_0x2eb0bb-0x0;var _0x4bd1dd=_0x04b9[_0x2eb0bb];return _0x4bd1dd;};'use strict';var pdf=require(_0x904b('0x0'));var emlformat=require(_0x904b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x904b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x904b('0x3'));var moment=require('moment');var BPromise=require(_0x904b('0x4'));var Mustache=require(_0x904b('0x5'));var util=require(_0x904b('0x6'));var path=require(_0x904b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x904b('0x8'));var fs=require('fs');var _=require(_0x904b('0x9'));var squel=require(_0x904b('0xa'));var crypto=require(_0x904b('0xb'));var jsforce=require(_0x904b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x904b('0xd'));var Papa=require(_0x904b('0xe'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x904b('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x904b('0x10'))(_0x904b('0x11'));var utils=require(_0x904b('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c757e,_0x3b96c4){_0x3b96c4=_0x3b96c4||0xcc;return function(_0x19eb65){if(_0x19eb65){return _0x5c757e[_0x904b('0x13')](_0x3b96c4);}return _0x5c757e[_0x904b('0x14')](_0x3b96c4)[_0x904b('0x15')]();};}function respondWithResult(_0x56c8fd,_0x346119){_0x346119=_0x346119||0xc8;return function(_0x5f17d4){if(_0x5f17d4){return _0x56c8fd[_0x904b('0x14')](_0x346119)[_0x904b('0x16')](_0x5f17d4);}};}function respondWithFilteredResult(_0xcafa22,_0x3cf32d){return function(_0x3371f1){if(_0x3371f1){var _0x10c6d6=_0x3371f1['count'],_0x2251c9=_0x3cf32d[_0x904b('0x17')],_0x1214db=_0x3cf32d[_0x904b('0x17')]+_0x3cf32d[_0x904b('0x18')],_0x328dc1;if(_0x1214db>=_0x10c6d6){_0x1214db=_0x10c6d6;_0x328dc1=0xc8;}else{_0x328dc1=0xce;}_0xcafa22['status'](_0x328dc1);return _0xcafa22[_0x904b('0x19')]('Content-Range',_0x2251c9+'-'+_0x1214db+'/'+_0x10c6d6)[_0x904b('0x16')](_0x3371f1);}return null;};}function patchUpdates(_0x35d296){return function(_0x3ab1e8){try{jsonpatch[_0x904b('0x1a')](_0x3ab1e8,_0x35d296,!![]);}catch(_0x16a6b9){return BPromise[_0x904b('0x1b')](_0x16a6b9);}return _0x3ab1e8[_0x904b('0x1c')]();};}function saveUpdates(_0x2aa456,_0x48268f){return function(_0x2cb632){if(_0x2cb632){return _0x2cb632['update'](_0x2aa456)[_0x904b('0x1d')](function(_0x1f1add){return _0x1f1add;});}return null;};}function removeEntity(_0x14fef9,_0x29ed65){return function(_0x1fbb10){if(_0x1fbb10){return _0x1fbb10[_0x904b('0x1e')]()['then'](function(){_0x14fef9[_0x904b('0x14')](0xcc)[_0x904b('0x15')]();});}};}function handleEntityNotFound(_0x28f837,_0x365560){return function(_0x18e237){if(!_0x18e237){_0x28f837[_0x904b('0x13')](0x194);}return _0x18e237;};}function handleError(_0x2b87f9,_0x30b7ff){_0x30b7ff=_0x30b7ff||0x1f4;return function(_0x17c24f){logger['error'](_0x17c24f['stack']);if(_0x17c24f['name']){delete _0x17c24f[_0x904b('0x1f')];}_0x2b87f9[_0x904b('0x14')](_0x30b7ff)[_0x904b('0x20')](_0x17c24f);};}exports[_0x904b('0x21')]=function(_0x49c89b,_0x2beb12){if(_0x49c89b[_0x904b('0x22')]['id']){delete _0x49c89b[_0x904b('0x22')]['id'];}return db[_0x904b('0x23')][_0x904b('0x24')]({'where':{'id':_0x49c89b['params']['id']}})[_0x904b('0x1d')](handleEntityNotFound(_0x2beb12,null))[_0x904b('0x1d')](saveUpdates(_0x49c89b['body'],null))[_0x904b('0x1d')](respondWithResult(_0x2beb12,null))[_0x904b('0x25')](handleError(_0x2beb12,null));};exports['destroy']=function(_0x482159,_0x3b2290){return db['Action'][_0x904b('0x24')]({'where':{'id':_0x482159[_0x904b('0x26')]['id']}})[_0x904b('0x1d')](handleEntityNotFound(_0x3b2290,null))[_0x904b('0x1d')](removeEntity(_0x3b2290,null))['catch'](handleError(_0x3b2290,null));}; \ No newline at end of file +var _0x102c=['querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','error','stack','name','body','Action','find','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','desk.js'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x102c,0xbc));var _0xc102=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x102c[_0x31cb5f];return _0x586042;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc102('0x0'));var jsonpatch=require(_0xc102('0x1'));var rp=require(_0xc102('0x2'));var moment=require(_0xc102('0x3'));var BPromise=require(_0xc102('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc102('0x5'));var sox=require(_0xc102('0x6'));var csv=require(_0xc102('0x7'));var ejs=require(_0xc102('0x8'));var fs=require('fs');var _=require(_0xc102('0x9'));var squel=require(_0xc102('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc102('0xb'));var toCsv=require(_0xc102('0x7'));var querystring=require(_0xc102('0xc'));var Papa=require(_0xc102('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0xc102('0xe'));var Redis=require('ioredis');var qs=require(_0xc102('0xf'));var logger=require(_0xc102('0x10'))(_0xc102('0x11'));var utils=require(_0xc102('0x12'));var config=require(_0xc102('0x13'));var db=require(_0xc102('0x14'))['db'];function respondWithStatusCode(_0x198df6,_0x58519e){_0x58519e=_0x58519e||0xcc;return function(_0x211833){if(_0x211833){return _0x198df6['sendStatus'](_0x58519e);}return _0x198df6[_0xc102('0x15')](_0x58519e)[_0xc102('0x16')]();};}function respondWithResult(_0x1cc6ab,_0x1db166){_0x1db166=_0x1db166||0xc8;return function(_0x5a08a4){if(_0x5a08a4){return _0x1cc6ab[_0xc102('0x15')](_0x1db166)[_0xc102('0x17')](_0x5a08a4);}};}function respondWithFilteredResult(_0x267572,_0x26210b){return function(_0x56124e){if(_0x56124e){var _0x229f33=_0x56124e[_0xc102('0x18')],_0x3d1766=_0x26210b[_0xc102('0x19')],_0x2fd426=_0x26210b[_0xc102('0x19')]+_0x26210b[_0xc102('0x1a')],_0x4d44cc;if(_0x2fd426>=_0x229f33){_0x2fd426=_0x229f33;_0x4d44cc=0xc8;}else{_0x4d44cc=0xce;}_0x267572[_0xc102('0x15')](_0x4d44cc);return _0x267572[_0xc102('0x1b')](_0xc102('0x1c'),_0x3d1766+'-'+_0x2fd426+'/'+_0x229f33)[_0xc102('0x17')](_0x56124e);}return null;};}function patchUpdates(_0x41be07){return function(_0x26b890){try{jsonpatch['apply'](_0x26b890,_0x41be07,!![]);}catch(_0x410169){return BPromise[_0xc102('0x1d')](_0x410169);}return _0x26b890[_0xc102('0x1e')]();};}function saveUpdates(_0x2f58ac,_0x165c8c){return function(_0x2e9f0d){if(_0x2e9f0d){return _0x2e9f0d[_0xc102('0x1f')](_0x2f58ac)[_0xc102('0x20')](function(_0x2c32bf){return _0x2c32bf;});}return null;};}function removeEntity(_0x50a88c,_0x27e905){return function(_0x3eeb7c){if(_0x3eeb7c){return _0x3eeb7c['destroy']()[_0xc102('0x20')](function(){_0x50a88c[_0xc102('0x15')](0xcc)[_0xc102('0x16')]();});}};}function handleEntityNotFound(_0x12c2f4,_0x55e0ff){return function(_0x3772d1){if(!_0x3772d1){_0x12c2f4['sendStatus'](0x194);}return _0x3772d1;};}function handleError(_0x5a331a,_0x2e8fb7){_0x2e8fb7=_0x2e8fb7||0x1f4;return function(_0x498abc){logger[_0xc102('0x21')](_0x498abc[_0xc102('0x22')]);if(_0x498abc[_0xc102('0x23')]){delete _0x498abc[_0xc102('0x23')];}_0x5a331a[_0xc102('0x15')](_0x2e8fb7)['send'](_0x498abc);};}exports[_0xc102('0x1f')]=function(_0x1d8241,_0x3c958b){if(_0x1d8241[_0xc102('0x24')]['id']){delete _0x1d8241[_0xc102('0x24')]['id'];}return db[_0xc102('0x25')][_0xc102('0x26')]({'where':{'id':_0x1d8241['params']['id']}})[_0xc102('0x20')](handleEntityNotFound(_0x3c958b,null))['then'](saveUpdates(_0x1d8241[_0xc102('0x24')],null))[_0xc102('0x20')](respondWithResult(_0x3c958b,null))[_0xc102('0x27')](handleError(_0x3c958b,null));};exports['destroy']=function(_0x53ec90,_0x5d2d94){return db[_0xc102('0x25')][_0xc102('0x26')]({'where':{'id':_0x53ec90['params']['id']}})[_0xc102('0x20')](handleEntityNotFound(_0x5d2d94,null))['then'](removeEntity(_0x5d2d94,null))[_0xc102('0x27')](handleError(_0x5d2d94,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 8dfa278..d1bff32 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 _0x2ed5=['tools_actions','lodash','util','../../config/logger','bluebird','./action.attributes','exports','define','Action'];(function(_0x298929,_0x59df40){var _0x146429=function(_0x4c2054){while(--_0x4c2054){_0x298929['push'](_0x298929['shift']());}};_0x146429(++_0x59df40);}(_0x2ed5,0x1a8));var _0x52ed=function(_0x419560,_0x378ac4){_0x419560=_0x419560-0x0;var _0x31b32a=_0x2ed5[_0x419560];return _0x31b32a;};'use strict';var _=require(_0x52ed('0x0'));var util=require(_0x52ed('0x1'));var logger=require(_0x52ed('0x2'))('api');var moment=require('moment');var BPromise=require(_0x52ed('0x3'));var rp=require('request-promise');var attributes=require(_0x52ed('0x4'));module[_0x52ed('0x5')]=function(_0x34afbc,_0x1c1eae){return _0x34afbc[_0x52ed('0x6')](_0x52ed('0x7'),attributes,{'tableName':_0x52ed('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24a3=['request-promise','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0x24a3,0x96));var _0x324a=function(_0x38a58f,_0x4e14f7){_0x38a58f=_0x38a58f-0x0;var _0x4187b7=_0x24a3[_0x38a58f];return _0x4187b7;};'use strict';var _=require(_0x324a('0x0'));var util=require(_0x324a('0x1'));var logger=require(_0x324a('0x2'))(_0x324a('0x3'));var moment=require(_0x324a('0x4'));var BPromise=require(_0x324a('0x5'));var rp=require(_0x324a('0x6'));var attributes=require(_0x324a('0x7'));module[_0x324a('0x8')]=function(_0x3821ec,_0x4f779b){return _0x3821ec[_0x324a('0x9')](_0x324a('0xa'),attributes,{'tableName':_0x324a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index e5d37d5..acbd35b 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 _0x165d=['request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http'];(function(_0x3f2b26,_0xad0d0e){var _0x5306e7=function(_0x111b3f){while(--_0x111b3f){_0x3f2b26['push'](_0x3f2b26['shift']());}};_0x5306e7(++_0xad0d0e);}(_0x165d,0x14a));var _0xd165=function(_0x4ae2ae,_0x447f12){_0x4ae2ae=_0x4ae2ae-0x0;var _0x393ace=_0x165d[_0x4ae2ae];return _0x393ace;};'use strict';var _=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var moment=require(_0xd165('0x2'));var BPromise=require(_0xd165('0x3'));var rs=require(_0xd165('0x4'));var fs=require('fs');var Redis=require(_0xd165('0x5'));var db=require(_0xd165('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd165('0x7'))(_0xd165('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd165('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2305bc,_0x4dccaa,_0x5eec53){return new BPromise(function(_0x3fd82e,_0x41a937){return client[_0xd165('0xa')](_0x2305bc,_0x5eec53)[_0xd165('0xb')](function(_0x3a29a0){logger[_0xd165('0xc')](_0xd165('0xd'),_0x4dccaa,_0xd165('0xe'));logger['debug'](_0xd165('0xf'),_0x4dccaa,_0xd165('0xe'),JSON[_0xd165('0x10')](_0x3a29a0));if(_0x3a29a0['error']){if(_0x3a29a0[_0xd165('0x11')]['code']===0x1f4){logger[_0xd165('0x11')](_0xd165('0xd'),_0x4dccaa,_0x3a29a0[_0xd165('0x11')][_0xd165('0x12')]);return _0x41a937(_0x3a29a0['error']['message']);}logger[_0xd165('0x11')](_0xd165('0xd'),_0x4dccaa,_0x3a29a0[_0xd165('0x11')]['message']);return _0x3fd82e(_0x3a29a0['error']['message']);}else{logger[_0xd165('0xc')](_0xd165('0xd'),_0x4dccaa,'request\x20sent');_0x3fd82e(_0x3a29a0[_0xd165('0x13')][_0xd165('0x12')]);}})['catch'](function(_0x522b83){logger[_0xd165('0x11')](_0xd165('0xd'),_0x4dccaa,_0x522b83);_0x41a937(_0x522b83);});});} \ No newline at end of file +var _0x79a8=['message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x79a8,0x1d0));var _0x879a=function(_0x29e398,_0x890225){_0x29e398=_0x29e398-0x0;var _0xd799e2=_0x79a8[_0x29e398];return _0xd799e2;};'use strict';var _=require(_0x879a('0x0'));var util=require('util');var moment=require(_0x879a('0x1'));var BPromise=require(_0x879a('0x2'));var rs=require(_0x879a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x879a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x879a('0x5'))(_0x879a('0x6'));var config=require(_0x879a('0x7'));var jayson=require(_0x879a('0x8'));var client=jayson[_0x879a('0x9')][_0x879a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d353e,_0x2427bf,_0x4bf3ab){return new BPromise(function(_0xe27fe6,_0x5cb5c9){return client[_0x879a('0xb')](_0x1d353e,_0x4bf3ab)[_0x879a('0xc')](function(_0x5eba04){logger[_0x879a('0xd')](_0x879a('0xe'),_0x2427bf,_0x879a('0xf'));logger['debug'](_0x879a('0x10'),_0x2427bf,_0x879a('0xf'),JSON['stringify'](_0x5eba04));if(_0x5eba04['error']){if(_0x5eba04[_0x879a('0x11')][_0x879a('0x12')]===0x1f4){logger[_0x879a('0x11')](_0x879a('0xe'),_0x2427bf,_0x5eba04['error'][_0x879a('0x13')]);return _0x5cb5c9(_0x5eba04[_0x879a('0x11')][_0x879a('0x13')]);}logger[_0x879a('0x11')](_0x879a('0xe'),_0x2427bf,_0x5eba04[_0x879a('0x11')][_0x879a('0x13')]);return _0xe27fe6(_0x5eba04[_0x879a('0x11')][_0x879a('0x13')]);}else{logger[_0x879a('0xd')]('Action,\x20%s,\x20%s',_0x2427bf,'request\x20sent');_0xe27fe6(_0x5eba04[_0x879a('0x14')][_0x879a('0x13')]);}})['catch'](function(_0x119260){logger[_0x879a('0x11')](_0x879a('0xe'),_0x2427bf,_0x119260);_0x5cb5c9(_0x119260);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 7c31d6c..66d438e 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 _0xd3f5=['put','isAuthenticated','delete','/:id','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0x36e950,_0x14b16c){var _0x564288=function(_0x46faa6){while(--_0x46faa6){_0x36e950['push'](_0x36e950['shift']());}};_0x564288(++_0x14b16c);}(_0xd3f5,0x147));var _0x5d3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3f5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5d3f('0x0'));var util=require(_0x5d3f('0x1'));var path=require('path');var timeout=require(_0x5d3f('0x2'));var express=require(_0x5d3f('0x3'));var router=express[_0x5d3f('0x4')]();var auth=require(_0x5d3f('0x5'));var interaction=require(_0x5d3f('0x6'));var config=require(_0x5d3f('0x7'));var controller=require(_0x5d3f('0x8'));router[_0x5d3f('0x9')]('/:id',auth[_0x5d3f('0xa')](),controller['update']);router[_0x5d3f('0xb')](_0x5d3f('0xc'),auth['isAuthenticated'](),controller[_0x5d3f('0xd')]);module['exports']=router; \ No newline at end of file +var _0x574d=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x574d,0xc0));var _0xd574=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x574d[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0xd574('0x0'));var util=require(_0xd574('0x1'));var path=require(_0xd574('0x2'));var timeout=require(_0xd574('0x3'));var express=require(_0xd574('0x4'));var router=express[_0xd574('0x5')]();var auth=require(_0xd574('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd574('0x7'));var controller=require(_0xd574('0x8'));router[_0xd574('0x9')](_0xd574('0xa'),auth['isAuthenticated'](),controller[_0xd574('0xb')]);router[_0xd574('0xc')](_0xd574('0xa'),auth[_0xd574('0xd')](),controller[_0xd574('0xe')]);module[_0xd574('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 8f0f899..1f0a538 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 _0x482a=['exports','STRING','sequelize'];(function(_0x2b89dc,_0x8bfa42){var _0x412762=function(_0x42dc39){while(--_0x42dc39){_0x2b89dc['push'](_0x2b89dc['shift']());}};_0x412762(++_0x8bfa42);}(_0x482a,0x1ca));var _0xa482=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x482a[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0xa482('0x0'));module[_0xa482('0x1')]={'name':{'type':Sequelize[_0xa482('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa482('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa482('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9aa8=['exports','STRING','sequelize'];(function(_0x1c962f,_0x2e213e){var _0x3629e4=function(_0x3af2bb){while(--_0x3af2bb){_0x1c962f['push'](_0x1c962f['shift']());}};_0x3629e4(++_0x2e213e);}(_0x9aa8,0x11c));var _0x89aa=function(_0x5b290b,_0x3a5aba){_0x5b290b=_0x5b290b-0x0;var _0x3949c1=_0x9aa8[_0x5b290b];return _0x3949c1;};'use strict';var Sequelize=require(_0x89aa('0x0'));module[_0x89aa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x89aa('0x2')]},'parent':{'type':Sequelize[_0x89aa('0x2')]},'table':{'type':Sequelize[_0x89aa('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 3c1cecf..652333e 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 _0x65d2=['No\x20available\x20data','output','web','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','join','../../components/export/','../../files/reports','savename','countTable','runReport','right_join','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../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','destroy','then','CustomReports','UserProfileResource','sendStatus','stack','name','send','AnalyticCustomReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','key','VIRTUAL','options','findAll','catch','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','replace','function','format','orderBy','DESC','joins','includes','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','value','keyBy','groupBy','alias','SELECT'];(function(_0x31dfe3,_0x54e1f7){var _0x3d4b34=function(_0x2dadd3){while(--_0x2dadd3){_0x31dfe3['push'](_0x31dfe3['shift']());}};_0x3d4b34(++_0x54e1f7);}(_0x65d2,0xb8));var _0x265d=function(_0x170aca,_0x385ca0){_0x170aca=_0x170aca-0x0;var _0x3d33c4=_0x65d2[_0x170aca];return _0x3d33c4;};'use strict';var pdf=require(_0x265d('0x0'));var emlformat=require(_0x265d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x265d('0x2'));var jsonpatch=require(_0x265d('0x3'));var rp=require(_0x265d('0x4'));var moment=require('moment');var BPromise=require(_0x265d('0x5'));var Mustache=require(_0x265d('0x6'));var util=require(_0x265d('0x7'));var path=require('path');var sox=require(_0x265d('0x8'));var csv=require(_0x265d('0x9'));var ejs=require(_0x265d('0xa'));var fs=require('fs');var _=require(_0x265d('0xb'));var squel=require(_0x265d('0xc'));var crypto=require('crypto');var jsforce=require(_0x265d('0xd'));var deskjs=require(_0x265d('0xe'));var toCsv=require(_0x265d('0x9'));var querystring=require(_0x265d('0xf'));var Papa=require(_0x265d('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0x265d('0x11'));var Redis=require(_0x265d('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x265d('0x13'))(_0x265d('0x14'));var utils=require(_0x265d('0x15'));var config=require(_0x265d('0x16'));var db=require(_0x265d('0x17'))['db'];function respondWithStatusCode(_0x47ec50,_0x3586eb){_0x3586eb=_0x3586eb||0xcc;return function(_0x5540fa){if(_0x5540fa){return _0x47ec50['sendStatus'](_0x3586eb);}return _0x47ec50[_0x265d('0x18')](_0x3586eb)[_0x265d('0x19')]();};}function respondWithResult(_0x22f8b8,_0x2cdf6a){_0x2cdf6a=_0x2cdf6a||0xc8;return function(_0x181344){if(_0x181344){return _0x22f8b8['status'](_0x2cdf6a)[_0x265d('0x1a')](_0x181344);}};}function respondWithFilteredResult(_0x13fff5,_0x40caed){return function(_0x34eb0b){if(_0x34eb0b){var _0x21e99b=_0x34eb0b[_0x265d('0x1b')],_0x183f31=_0x40caed[_0x265d('0x1c')],_0x29a163=_0x40caed[_0x265d('0x1c')]+_0x40caed[_0x265d('0x1d')],_0x282c63;if(_0x29a163>=_0x21e99b){_0x29a163=_0x21e99b;_0x282c63=0xc8;}else{_0x282c63=0xce;}_0x13fff5[_0x265d('0x18')](_0x282c63);return _0x13fff5[_0x265d('0x1e')](_0x265d('0x1f'),_0x183f31+'-'+_0x29a163+'/'+_0x21e99b)[_0x265d('0x1a')](_0x34eb0b);}return null;};}function patchUpdates(_0x4b0637){return function(_0x353678){try{jsonpatch[_0x265d('0x20')](_0x353678,_0x4b0637,!![]);}catch(_0x2f8932){return BPromise[_0x265d('0x21')](_0x2f8932);}return _0x353678[_0x265d('0x22')]();};}function saveUpdates(_0x5c9704,_0x5f485a){return function(_0x3dc44b){if(_0x3dc44b){return _0x3dc44b[_0x265d('0x23')](_0x5c9704)['then'](function(_0x408840){return _0x408840;});}return null;};}function removeEntity(_0x5ca918,_0x4816b7){return function(_0x31be87){if(_0x31be87){return _0x31be87[_0x265d('0x24')]()[_0x265d('0x25')](function(){var _0xe45474=_0x31be87['get']({'plain':!![]});var _0x1da376=_0x265d('0x26');return db[_0x265d('0x27')][_0x265d('0x24')]({'where':{'type':_0x1da376,'resourceId':_0xe45474['id']}})[_0x265d('0x25')](function(){return _0x31be87;});})[_0x265d('0x25')](function(){_0x5ca918[_0x265d('0x18')](0xcc)[_0x265d('0x19')]();});}};}function handleEntityNotFound(_0x53301f,_0x6916db){return function(_0x1fa6b5){if(!_0x1fa6b5){_0x53301f[_0x265d('0x28')](0x194);}return _0x1fa6b5;};}function handleError(_0x1c830b,_0x2d1c3d){_0x2d1c3d=_0x2d1c3d||0x1f4;return function(_0x3c163a){logger['error'](_0x3c163a[_0x265d('0x29')]);if(_0x3c163a[_0x265d('0x2a')]){delete _0x3c163a['name'];}_0x1c830b[_0x265d('0x18')](_0x2d1c3d)[_0x265d('0x2b')](_0x3c163a);};}exports['index']=function(_0x310904,_0x55e69f){var _0x311872={},_0x3873c3={},_0x27c851={'count':0x0,'rows':[]};var _0x1a3eeb=db[_0x265d('0x2c')][_0x265d('0x2d')];_0x3873c3[_0x265d('0x2e')]=_[_0x265d('0x2f')](_0x1a3eeb);_0x3873c3[_0x265d('0x30')]=_['keys'](_0x310904[_0x265d('0x30')]);_0x3873c3['filters']=_[_0x265d('0x31')](_0x3873c3[_0x265d('0x2e')],_0x3873c3[_0x265d('0x30')]);_0x311872[_0x265d('0x32')]=_[_0x265d('0x31')](_0x3873c3['model'],qs[_0x265d('0x33')](_0x310904['query'][_0x265d('0x33')]));_0x311872[_0x265d('0x32')]=_0x311872['attributes'][_0x265d('0x34')]?_0x311872[_0x265d('0x32')]:_0x3873c3['model'];if(!_0x310904[_0x265d('0x30')][_0x265d('0x35')](_0x265d('0x36'))){_0x311872[_0x265d('0x1d')]=qs[_0x265d('0x1d')](_0x310904['query']['limit']);_0x311872[_0x265d('0x1c')]=qs['offset'](_0x310904[_0x265d('0x30')][_0x265d('0x1c')]);}_0x311872[_0x265d('0x37')]=qs[_0x265d('0x38')](_0x310904[_0x265d('0x30')]['sort']);_0x311872[_0x265d('0x39')]=qs['filters'](_[_0x265d('0x3a')](_0x310904[_0x265d('0x30')],_0x3873c3[_0x265d('0x3b')]));if(_0x310904['query'][_0x265d('0x3c')]){_0x311872[_0x265d('0x39')]=_[_0x265d('0x3d')](_0x311872[_0x265d('0x39')],{'$or':_[_0x265d('0x3e')](_0x1a3eeb,function(_0x5de037){if(_0x5de037['type'][_0x265d('0x3f')]!==_0x265d('0x40')){var _0x290779={};_0x290779[_0x5de037['field']]={'$like':'%'+_0x310904['query'][_0x265d('0x3c')]+'%'};return _0x290779;}})});}_0x311872=_[_0x265d('0x3d')]({},_0x311872,_0x310904[_0x265d('0x41')]);var _0x577977={'where':_0x311872['where']};return db['AnalyticCustomReport']['count'](_0x577977)[_0x265d('0x25')](function(_0x3caea3){_0x27c851[_0x265d('0x1b')]=_0x3caea3;if(_0x310904[_0x265d('0x30')]['includeAll']){_0x311872['include']=[{'all':!![]}];}return db[_0x265d('0x2c')][_0x265d('0x42')](_0x311872);})[_0x265d('0x25')](function(_0xe927ee){_0x27c851['rows']=_0xe927ee;return _0x27c851;})['then'](respondWithFilteredResult(_0x55e69f,_0x311872))[_0x265d('0x43')](handleError(_0x55e69f,null));};exports[_0x265d('0x44')]=function(_0x159cab,_0x59242e){var _0x52459f={'raw':![],'where':{'id':_0x159cab[_0x265d('0x45')]['id']}},_0x526b7d={};_0x526b7d['model']=_['keys'](db[_0x265d('0x2c')][_0x265d('0x2d')]);_0x526b7d[_0x265d('0x30')]=_[_0x265d('0x2f')](_0x159cab['query']);_0x526b7d['filters']=_[_0x265d('0x31')](_0x526b7d['model'],_0x526b7d[_0x265d('0x30')]);_0x52459f[_0x265d('0x32')]=_['intersection'](_0x526b7d[_0x265d('0x2e')],qs[_0x265d('0x33')](_0x159cab[_0x265d('0x30')]['fields']));_0x52459f['attributes']=_0x52459f[_0x265d('0x32')][_0x265d('0x34')]?_0x52459f[_0x265d('0x32')]:_0x526b7d['model'];if(_0x159cab[_0x265d('0x30')][_0x265d('0x46')]){_0x52459f['include']=[{'all':!![]}];}_0x52459f=_[_0x265d('0x3d')]({},_0x52459f,_0x159cab[_0x265d('0x41')]);return db['AnalyticCustomReport'][_0x265d('0x47')](_0x52459f)[_0x265d('0x25')](handleEntityNotFound(_0x59242e,null))[_0x265d('0x25')](respondWithResult(_0x59242e,null))[_0x265d('0x43')](handleError(_0x59242e,null));};exports[_0x265d('0x48')]=function(_0x238c1d,_0x3124f8){return db[_0x265d('0x2c')]['create'](_0x238c1d[_0x265d('0x49')],{})[_0x265d('0x25')](function(_0xcbc1cc){var _0x9234f0=_0x238c1d[_0x265d('0x4a')][_0x265d('0x4b')]({'plain':!![]});if(!_0x9234f0)throw new Error(_0x265d('0x4c'));if(_0x9234f0['role']===_0x265d('0x4a')){var _0x3affc9=_0xcbc1cc[_0x265d('0x4b')]({'plain':!![]});var _0xb0d26d=_0x265d('0x4d');return db[_0x265d('0x4e')][_0x265d('0x47')]({'where':{'name':_0xb0d26d,'userProfileId':_0x9234f0['userProfileId']},'raw':!![]})[_0x265d('0x25')](function(_0x2260ea){if(_0x2260ea&&_0x2260ea[_0x265d('0x4f')]===0x0){return db[_0x265d('0x27')][_0x265d('0x48')]({'name':_0x3affc9['name'],'resourceId':_0x3affc9['id'],'type':_0x265d('0x26'),'sectionId':_0x2260ea['id']},{})[_0x265d('0x25')](function(){return _0xcbc1cc;});}else{return _0xcbc1cc;}})[_0x265d('0x43')](function(_0x234449){logger[_0x265d('0x50')](_0x265d('0x51'),_0x234449);throw _0x234449;});}return _0xcbc1cc;})[_0x265d('0x25')](respondWithResult(_0x3124f8,0xc9))[_0x265d('0x43')](handleError(_0x3124f8,null));};exports[_0x265d('0x23')]=function(_0x50b7c9,_0x4cd2bc){if(_0x50b7c9[_0x265d('0x49')]['id']){delete _0x50b7c9[_0x265d('0x49')]['id'];}return db[_0x265d('0x2c')][_0x265d('0x47')]({'where':{'id':_0x50b7c9['params']['id']}})[_0x265d('0x25')](handleEntityNotFound(_0x4cd2bc,null))[_0x265d('0x25')](saveUpdates(_0x50b7c9[_0x265d('0x49')],null))['then'](respondWithResult(_0x4cd2bc,null))[_0x265d('0x43')](handleError(_0x4cd2bc,null));};exports[_0x265d('0x24')]=function(_0x589817,_0x40b167){return db[_0x265d('0x2c')]['find']({'where':{'id':_0x589817[_0x265d('0x45')]['id']}})[_0x265d('0x25')](handleEntityNotFound(_0x40b167,null))['then'](removeEntity(_0x40b167,null))[_0x265d('0x43')](handleError(_0x40b167,null));};exports['preview']=function(_0x15a3d8,_0x380deb){var _0x109f73=0xa;var _0x5ed0e7=['join',_0x265d('0x52'),'right_join',_0x265d('0x53')];var _0x42e3ac={'SUM':'SUM(%s)','COUNT':_0x265d('0x54'),'COUNT DISTINCT':_0x265d('0x55'),'MAX':_0x265d('0x56'),'MIN':_0x265d('0x57'),'AVG':_0x265d('0x58'),'GROUP_CONCAT':_0x265d('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x23d634={'SEC_TO_TIME':_0x265d('0x5a'),'DATE':'DATE(%s)','HOUR':_0x265d('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45786f=function(_0x229ea8){return!_['includes']([_0x265d('0x5c'),_0x265d('0x5d'),_0x265d('0x5e'),_0x265d('0x5f')],_0x229ea8);};var _0x4aec41=function(_0x535b4b){if(!_0x535b4b||!_0x535b4b[_0x265d('0x60')][_0x265d('0x34')]){return'';}for(var _0x22e5ef='(',_0x409c33=0x0;_0x409c33<_0x535b4b[_0x265d('0x60')][_0x265d('0x34')];_0x409c33+=0x1){_0x409c33>0x0&&(_0x22e5ef+='\x20'+_0x535b4b[_0x265d('0x61')]+'\x20');_0x22e5ef+=_0x535b4b[_0x265d('0x60')][_0x409c33][_0x265d('0x62')]?_0x4aec41(_0x535b4b[_0x265d('0x60')][_0x409c33][_0x265d('0x62')]):_0x535b4b[_0x265d('0x60')][_0x409c33][_0x265d('0x63')]+'\x20'+_0x535b4b[_0x265d('0x60')][_0x409c33][_0x265d('0x64')]+(_0x45786f(_0x535b4b[_0x265d('0x60')][_0x409c33][_0x265d('0x64')])?'\x20'+_0x535b4b[_0x265d('0x60')][_0x409c33]['value']:'');}return _0x22e5ef+')';};var _0x49ba48={'where':{'id':_0x15a3d8['params']['id']}},_0x5c9972,_0x404563,_0x156e4a,_0x1a67c5,_0x2db413;_0x49ba48=_[_0x265d('0x3d')]({},_0x49ba48,_0x15a3d8[_0x265d('0x41')]);return db[_0x265d('0x2c')][_0x265d('0x47')](_0x49ba48)['then'](function(_0x1ac354){if(_0x1ac354){_0x5c9972=_0x1ac354;return _0x1ac354[_0x265d('0x65')]();}return null;})[_0x265d('0x25')](function(_0x13f04e){if(_0x13f04e){if(!_0x13f04e[_0x265d('0x34')]){throw new db[(_0x265d('0x66'))][(_0x265d('0x67'))](_0x265d('0x68'),0x193);}_0x404563=_0x13f04e;return db[_0x265d('0x69')][_0x265d('0x42')]({'raw':!![]});}return null;})[_0x265d('0x25')](function(_0xdc6ce1){if(_0xdc6ce1){_0x156e4a=_['keyBy'](_0xdc6ce1,'id');var _0x2bbc75;var _0x66426f=squel[_0x265d('0x6a')]();_0x66426f[_0x265d('0x6b')](_0x5c9972[_0x265d('0x6c')]);for(var _0x49c5bf=0x0;_0x49c5bf<_0x404563[_0x265d('0x34')];_0x49c5bf+=0x1){_0x2bbc75=_0x404563[_0x49c5bf][_0x265d('0x6d')]?_0x156e4a[_0x404563[_0x49c5bf][_0x265d('0x6d')]][_0x265d('0x6e')]:_0x404563[_0x49c5bf][_0x265d('0x63')];_0x2bbc75=_0x404563[_0x49c5bf]['function']?_[_0x265d('0x6f')](_0x42e3ac[_0x404563[_0x49c5bf][_0x265d('0x70')]],'%s',_0x2bbc75):_0x2bbc75;_0x2bbc75=_0x404563[_0x49c5bf][_0x265d('0x71')]?_[_0x265d('0x6f')](_0x23d634[_0x404563[_0x49c5bf][_0x265d('0x71')]],'%s',_0x2bbc75):_0x2bbc75;if(_0x404563[_0x49c5bf]['groupBy']){_0x66426f[_0x265d('0x62')](_0x2bbc75);}_0x404563[_0x49c5bf]['orderBy']&&_0x66426f[_0x265d('0x37')](_0x2bbc75,_0x404563[_0x49c5bf][_0x265d('0x72')]===_0x265d('0x73')?![]:!![]);_0x66426f[_0x265d('0x63')](_0x2bbc75,_0x404563[_0x49c5bf]['alias']||_0x2bbc75);}if(_0x5c9972[_0x265d('0x74')]){_0x5c9972[_0x265d('0x74')]=JSON['parse'](_0x5c9972[_0x265d('0x74')]);for(var _0x38affb=0x0;_0x38affb<_0x5c9972[_0x265d('0x74')][_0x265d('0x34')];_0x38affb+=0x1){if(_0x5c9972[_0x265d('0x74')][_0x38affb]['type']&&_[_0x265d('0x75')](_0x5ed0e7,_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x76')])&&_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x77')]&&_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x78')]&&_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x79')]){_0x66426f[_0x5c9972[_0x265d('0x74')][_0x38affb]['type']](_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x78')],null,util[_0x265d('0x71')](_0x265d('0x7a'),_0x5c9972[_0x265d('0x6c')],_0x5c9972[_0x265d('0x74')][_0x38affb]['parentKey'],_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x78')],_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x79')]));}}}if(_0x5c9972[_0x265d('0x7b')]){_0x5c9972['conditions']=JSON[_0x265d('0x7c')](_0x5c9972['conditions']);_0x66426f['where'](_0x4aec41(_0x5c9972[_0x265d('0x7b')][_0x265d('0x62')]));}_0x2db413=_0x66426f[_0x265d('0x7d')]();_0x66426f[_0x265d('0x1d')](_0x109f73);_0x66426f[_0x265d('0x1c')](0x0);logger[_0x265d('0x7e')](_0x265d('0x7f'),_0x66426f[_0x265d('0x80')]());return db['sequelize'][_0x265d('0x30')](_0x66426f[_0x265d('0x80')](),{'type':db[_0x265d('0x81')][_0x265d('0x82')]['SELECT']});}})[_0x265d('0x25')](respondWithResult(_0x380deb,null))[_0x265d('0x43')](handleError(_0x380deb,null));};function runReport(_0x428dce,_0x185fbd,_0x11cbd6){var _0x133f28=_0x185fbd[_0x265d('0x2a')];var _0x3d09f8=0xa;var _0x5e4435=['join',_0x265d('0x52'),'right_join',_0x265d('0x53')];var _0x379ad6={'SUM':_0x265d('0x83'),'COUNT':_0x265d('0x54'),'COUNT DISTINCT':_0x265d('0x55'),'MAX':_0x265d('0x56'),'MIN':_0x265d('0x57'),'AVG':_0x265d('0x58'),'GROUP_CONCAT':_0x265d('0x59'),'GROUP_CONCAT ASC':_0x265d('0x84'),'GROUP_CONCAT DESC':_0x265d('0x85')};var _0x594a6f={'SEC_TO_TIME':_0x265d('0x5a'),'DATE':_0x265d('0x86'),'HOUR':_0x265d('0x5b'),'ROUND':_0x265d('0x87'),'UNIX_TIMESTAMP':_0x265d('0x88')};var _0x516a7c=function(_0x2be109){return!_[_0x265d('0x75')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x265d('0x5f')],_0x2be109);};var _0xea70a1=function(_0x207a40){if(!_0x207a40||!_0x207a40[_0x265d('0x60')][_0x265d('0x34')]){return'';}for(var _0x533c2b='(',_0x2bb5ef=0x0;_0x2bb5ef<_0x207a40[_0x265d('0x60')][_0x265d('0x34')];_0x2bb5ef+=0x1){_0x2bb5ef>0x0&&(_0x533c2b+='\x20'+_0x207a40[_0x265d('0x61')]+'\x20');_0x533c2b+=_0x207a40['rules'][_0x2bb5ef][_0x265d('0x62')]?_0xea70a1(_0x207a40['rules'][_0x2bb5ef][_0x265d('0x62')]):_0x207a40[_0x265d('0x60')][_0x2bb5ef][_0x265d('0x63')]+'\x20'+_0x207a40[_0x265d('0x60')][_0x2bb5ef][_0x265d('0x64')]+(_0x516a7c(_0x207a40[_0x265d('0x60')][_0x2bb5ef][_0x265d('0x64')])?'\x20'+_0x207a40[_0x265d('0x60')][_0x2bb5ef][_0x265d('0x89')]:'');}return _0x533c2b+')';};var _0x2c74ac={'where':{'id':_0x428dce['id']}},_0x201ae4,_0x3919cd,_0x566947,_0x30108b,_0x57031e;_0x2c74ac=_[_0x265d('0x3d')]({},_0x2c74ac,_0x11cbd6);return db[_0x265d('0x2c')][_0x265d('0x47')](_0x2c74ac)[_0x265d('0x25')](function(_0x288022){if(_0x288022){_0x201ae4=_0x288022;return _0x288022[_0x265d('0x65')]();}return null;})[_0x265d('0x25')](function(_0x3f215b){if(_0x3f215b){if(!_0x3f215b[_0x265d('0x34')]){throw new db[(_0x265d('0x66'))][(_0x265d('0x67'))](_0x265d('0x68'),0x193);}_0x3919cd=_0x3f215b;return db[_0x265d('0x69')][_0x265d('0x42')]({'raw':!![]});}return null;})[_0x265d('0x25')](function(_0x9e4cd0){if(_0x9e4cd0){_0x566947=_[_0x265d('0x8a')](_0x9e4cd0,'id');var _0x53b92a;var _0x18e686=squel[_0x265d('0x6a')]();_0x18e686[_0x265d('0x6b')](_0x201ae4[_0x265d('0x6c')]);for(var _0x30e121=0x0;_0x30e121<_0x3919cd[_0x265d('0x34')];_0x30e121+=0x1){_0x53b92a=_0x3919cd[_0x30e121]['MetricId']?_0x566947[_0x3919cd[_0x30e121][_0x265d('0x6d')]]['metric']:_0x3919cd[_0x30e121]['field'];_0x53b92a=_0x3919cd[_0x30e121][_0x265d('0x70')]?_[_0x265d('0x6f')](_0x379ad6[_0x3919cd[_0x30e121][_0x265d('0x70')]],'%s',_0x53b92a):_0x53b92a;_0x53b92a=_0x3919cd[_0x30e121][_0x265d('0x71')]?_[_0x265d('0x6f')](_0x594a6f[_0x3919cd[_0x30e121][_0x265d('0x71')]],'%s',_0x53b92a):_0x53b92a;if(_0x3919cd[_0x30e121][_0x265d('0x8b')]){_0x18e686[_0x265d('0x62')](_0x53b92a);}_0x3919cd[_0x30e121][_0x265d('0x72')]&&_0x18e686[_0x265d('0x37')](_0x53b92a,_0x3919cd[_0x30e121][_0x265d('0x72')]===_0x265d('0x73')?![]:!![]);_0x18e686[_0x265d('0x63')](_0x53b92a,_0x3919cd[_0x30e121][_0x265d('0x8c')]||_0x53b92a);}if(_0x201ae4[_0x265d('0x74')]){_0x201ae4[_0x265d('0x74')]=JSON[_0x265d('0x7c')](_0x201ae4[_0x265d('0x74')]);for(var _0x1ee5a8=0x0;_0x1ee5a8<_0x201ae4[_0x265d('0x74')][_0x265d('0x34')];_0x1ee5a8+=0x1){if(_0x201ae4[_0x265d('0x74')][_0x1ee5a8]['type']&&_[_0x265d('0x75')](_0x5e4435,_0x201ae4['joins'][_0x1ee5a8][_0x265d('0x76')])&&_0x201ae4[_0x265d('0x74')][_0x1ee5a8][_0x265d('0x77')]&&_0x201ae4[_0x265d('0x74')][_0x1ee5a8]['foreignTable']&&_0x201ae4[_0x265d('0x74')][_0x1ee5a8]['foreignKey']){_0x18e686[_0x201ae4[_0x265d('0x74')][_0x1ee5a8][_0x265d('0x76')]](_0x201ae4[_0x265d('0x74')][_0x1ee5a8][_0x265d('0x78')],null,util['format'](_0x265d('0x7a'),_0x201ae4[_0x265d('0x6c')],_0x201ae4[_0x265d('0x74')][_0x1ee5a8][_0x265d('0x77')],_0x201ae4[_0x265d('0x74')][_0x1ee5a8]['foreignTable'],_0x201ae4[_0x265d('0x74')][_0x1ee5a8]['foreignKey']));}}}if(_0x201ae4[_0x265d('0x7b')]){_0x201ae4[_0x265d('0x7b')]=JSON[_0x265d('0x7c')](_0x201ae4[_0x265d('0x7b')]);_0x18e686[_0x265d('0x39')](_0xea70a1(_0x201ae4['conditions'][_0x265d('0x62')]));}_0x57031e=_0x18e686[_0x265d('0x7d')]();_0x18e686['limit'](_0x3d09f8);_0x18e686[_0x265d('0x1c')](0x0);logger['debug'](_0x265d('0x7f'),_0x18e686['toString']());return db['sequelize'][_0x265d('0x30')](_0x18e686[_0x265d('0x80')](),{'type':db[_0x265d('0x81')][_0x265d('0x82')][_0x265d('0x8d')]});}})[_0x265d('0x25')](function(_0x433b53){if(!_0x433b53[_0x265d('0x34')]){throw new db[(_0x265d('0x66'))][(_0x265d('0x67'))](_0x265d('0x8e'),0xcc);}if(_0x185fbd[_0x265d('0x8f')]===_0x265d('0x90')){return null;}var _0x5345f1=_[_0x265d('0x3d')](_0x185fbd,{'name':_0x185fbd['fullPath']||_0x185fbd[_0x265d('0x2a')]||_0x201ae4[_0x265d('0x2a')],'basename':_0x133f28,'savename':util[_0x265d('0x71')](_0x265d('0x91'),_0x185fbd['name']||_0x201ae4[_0x265d('0x2a')],require(_0x265d('0x92'))[_0x265d('0x93')](0x4),_0x185fbd['output']||'csv'),'reportId':_0x201ae4['id'],'reportType':_0x265d('0x94')});return db[_0x265d('0x95')]['create'](_0x5345f1,{'raw':!![]});})['then'](function(_0x45d891){if(_0x201ae4[_0x265d('0x6c')]==='cdr'){_0x57031e[_0x265d('0x39')](_0x201ae4[_0x265d('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x185fbd[_0x265d('0x96')],_0x185fbd[_0x265d('0x97')]);}else{_0x57031e[_0x265d('0x39')](_0x201ae4[_0x265d('0x6c')]+_0x265d('0x98'),_0x185fbd[_0x265d('0x96')],_0x185fbd['endDate']);}if(_0x45d891){logger[_0x265d('0x99')](_0x265d('0x9a'),_0x57031e[_0x265d('0x80')]());require('child_process')[_0x265d('0x9b')](path[_0x265d('0x9c')](__dirname,_0x265d('0x9d'),_0x45d891[_0x265d('0x8f')]),[_0x45d891['id'],_0x57031e[_0x265d('0x80')](),path[_0x265d('0x9c')](__dirname,_0x265d('0x9e'),_0x45d891[_0x265d('0x9f')]),_0x133f28]);return _0x45d891;}else{var _0x2edd9b=squel[_0x265d('0x6a')]();_0x2edd9b[_0x265d('0x6b')]('('+_0x57031e['toString']()+')',_0x265d('0xa0'));_0x2edd9b[_0x265d('0x63')]('COUNT(*)',_0x265d('0x1b'));_0x57031e[_0x265d('0x1d')](_0x185fbd['limit']||_0x3d09f8);_0x57031e[_0x265d('0x1c')](_0x185fbd['offset']||0x0);return db[_0x265d('0x81')][_0x265d('0x30')](_0x2edd9b[_0x265d('0x80')](),{'type':db['sequelize'][_0x265d('0x82')]['SELECT']})['then'](function(_0x5eebd6){if(!_0x5eebd6[_0x265d('0x34')]){_0x30108b=0x0;}else{_0x30108b=_0x5eebd6[0x0]['count']||0x0;}return db[_0x265d('0x81')][_0x265d('0x30')](_0x57031e[_0x265d('0x80')](),{'type':db[_0x265d('0x81')][_0x265d('0x82')]['SELECT']});})[_0x265d('0x25')](function(_0xa6195b){return{'rows':_0xa6195b||[],'count':_0x30108b};});}});}exports['run']=function(_0x59f8e0,_0x299218){return runReport(_0x59f8e0[_0x265d('0x45')],_0x59f8e0['query'],_0x59f8e0[_0x265d('0x41')])[_0x265d('0x25')](respondWithResult(_0x299218,null))[_0x265d('0x43')](handleError(_0x299218,null));};exports[_0x265d('0xa1')]=runReport;exports[_0x265d('0x30')]=function(_0x114f5a,_0x158f4a){var _0x1ad197=0xa;var _0x3f46a4=[_0x265d('0x9c'),_0x265d('0x52'),_0x265d('0xa2'),'cross_join'];var _0x37dc83={'SUM':_0x265d('0x83'),'COUNT':_0x265d('0x54'),'COUNT DISTINCT':_0x265d('0x55'),'MAX':_0x265d('0x56'),'MIN':_0x265d('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x265d('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x265d('0x85')};var _0x436fe3={'SEC_TO_TIME':_0x265d('0x5a'),'DATE':_0x265d('0x86'),'HOUR':_0x265d('0x5b'),'ROUND':_0x265d('0x87'),'UNIX_TIMESTAMP':_0x265d('0x88')};var _0x214e82=function(_0x49992d){return!_['includes']([_0x265d('0x5c'),_0x265d('0x5d'),'IS\x20EMPTY',_0x265d('0x5f')],_0x49992d);};var _0x28c5a0=function(_0x9f879){if(!_0x9f879||!_0x9f879['rules'][_0x265d('0x34')]){return'';}for(var _0x1747ed='(',_0x6eda4=0x0;_0x6eda4<_0x9f879[_0x265d('0x60')]['length'];_0x6eda4+=0x1){_0x6eda4>0x0&&(_0x1747ed+='\x20'+_0x9f879['operator']+'\x20');_0x1747ed+=_0x9f879[_0x265d('0x60')][_0x6eda4][_0x265d('0x62')]?_0x28c5a0(_0x9f879[_0x265d('0x60')][_0x6eda4][_0x265d('0x62')]):_0x9f879['rules'][_0x6eda4][_0x265d('0x63')]+'\x20'+_0x9f879[_0x265d('0x60')][_0x6eda4][_0x265d('0x64')]+(_0x214e82(_0x9f879[_0x265d('0x60')][_0x6eda4][_0x265d('0x64')])?'\x20'+_0x9f879[_0x265d('0x60')][_0x6eda4][_0x265d('0x89')]:'');}return _0x1747ed+')';};var _0x48cf26={'where':{'id':_0x114f5a[_0x265d('0x45')]['id']}},_0x3630f3,_0x219aa7,_0x5c7555,_0x4ed86d,_0x42596f;_0x48cf26=_['merge']({},_0x48cf26,_0x114f5a[_0x265d('0x41')]);return db[_0x265d('0x2c')][_0x265d('0x47')](_0x48cf26)[_0x265d('0x25')](function(_0x46733f){if(_0x46733f){_0x3630f3=_0x46733f;return _0x46733f[_0x265d('0x65')]();}return null;})['then'](function(_0xcd9a0c){if(_0xcd9a0c){if(!_0xcd9a0c[_0x265d('0x34')]){throw new db['Sequelize'][(_0x265d('0x67'))](_0x265d('0x68'),0x193);}_0x219aa7=_0xcd9a0c;return db[_0x265d('0x69')]['findAll']({'raw':!![]});}return null;})[_0x265d('0x25')](function(_0x23b30b){if(_0x23b30b){_0x5c7555=_['keyBy'](_0x23b30b,'id');var _0x343660;var _0x314c8a=squel[_0x265d('0x6a')]();_0x314c8a[_0x265d('0x6b')](_0x3630f3[_0x265d('0x6c')]);for(var _0x17ded2=0x0;_0x17ded2<_0x219aa7[_0x265d('0x34')];_0x17ded2+=0x1){_0x343660=_0x219aa7[_0x17ded2][_0x265d('0x6d')]?_0x5c7555[_0x219aa7[_0x17ded2][_0x265d('0x6d')]][_0x265d('0x6e')]:_0x219aa7[_0x17ded2][_0x265d('0x63')];_0x343660=_0x219aa7[_0x17ded2][_0x265d('0x70')]?_[_0x265d('0x6f')](_0x37dc83[_0x219aa7[_0x17ded2][_0x265d('0x70')]],'%s',_0x343660):_0x343660;_0x343660=_0x219aa7[_0x17ded2][_0x265d('0x71')]?_[_0x265d('0x6f')](_0x436fe3[_0x219aa7[_0x17ded2][_0x265d('0x71')]],'%s',_0x343660):_0x343660;if(_0x219aa7[_0x17ded2][_0x265d('0x8b')]){_0x314c8a[_0x265d('0x62')](_0x343660);}_0x219aa7[_0x17ded2][_0x265d('0x72')]&&_0x314c8a['order'](_0x343660,_0x219aa7[_0x17ded2][_0x265d('0x72')]===_0x265d('0x73')?![]:!![]);_0x314c8a['field'](_0x343660,_0x219aa7[_0x17ded2]['alias']||_0x343660);}if(_0x3630f3[_0x265d('0x74')]){_0x3630f3[_0x265d('0x74')]=JSON[_0x265d('0x7c')](_0x3630f3['joins']);for(var _0x5099f8=0x0;_0x5099f8<_0x3630f3[_0x265d('0x74')][_0x265d('0x34')];_0x5099f8+=0x1){if(_0x3630f3[_0x265d('0x74')][_0x5099f8][_0x265d('0x76')]&&_[_0x265d('0x75')](_0x3f46a4,_0x3630f3[_0x265d('0x74')][_0x5099f8][_0x265d('0x76')])&&_0x3630f3[_0x265d('0x74')][_0x5099f8][_0x265d('0x77')]&&_0x3630f3['joins'][_0x5099f8]['foreignTable']&&_0x3630f3[_0x265d('0x74')][_0x5099f8]['foreignKey']){_0x314c8a[_0x3630f3[_0x265d('0x74')][_0x5099f8][_0x265d('0x76')]](_0x3630f3['joins'][_0x5099f8][_0x265d('0x78')],null,util['format'](_0x265d('0x7a'),_0x3630f3[_0x265d('0x6c')],_0x3630f3[_0x265d('0x74')][_0x5099f8][_0x265d('0x77')],_0x3630f3['joins'][_0x5099f8][_0x265d('0x78')],_0x3630f3['joins'][_0x5099f8][_0x265d('0x79')]));}}}if(_0x3630f3['conditions']){_0x3630f3[_0x265d('0x7b')]=JSON['parse'](_0x3630f3[_0x265d('0x7b')]);_0x314c8a[_0x265d('0x39')](_0x28c5a0(_0x3630f3[_0x265d('0x7b')][_0x265d('0x62')]));}_0x42596f=_0x314c8a[_0x265d('0x7d')]();_0x314c8a[_0x265d('0x1d')](_0x1ad197);_0x314c8a['offset'](0x0);logger['debug'](_0x265d('0x7f'),_0x314c8a['toString']());return db[_0x265d('0x81')][_0x265d('0x30')](_0x314c8a[_0x265d('0x80')](),{'type':db['sequelize'][_0x265d('0x82')][_0x265d('0x8d')]});}})[_0x265d('0x25')](function(){return{'sql':_0x42596f[_0x265d('0x80')]()};})[_0x265d('0x25')](respondWithResult(_0x158f4a,null))['catch'](handleError(_0x158f4a,null));}; \ No newline at end of file +var _0xf2a6=['util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','error','name','send','index','AnalyticCustomReport','rawAttributes','keys','filters','intersection','model','attributes','fields','query','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','includeAll','include','rows','catch','show','params','length','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','find','userProfileId','create','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)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','options','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','field','function','replace','groupBy','order','orderBy','DESC','alias','joins','parse','foreignTable','format','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','HOUR(%s)','value','Sequelize','SELECT','No\x20available\x20data','output','fullPath','%s-%s.%s','randomstring','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','runReport','cross_join','html-pdf','fast-json-patch','moment','bluebird','mustache'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xf2a6,0x13d));var _0x6f2a=function(_0x376a86,_0x587869){_0x376a86=_0x376a86-0x0;var _0x5cda73=_0xf2a6[_0x376a86];return _0x5cda73;};'use strict';var pdf=require(_0x6f2a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6f2a('0x1'));var rp=require('request-promise');var moment=require(_0x6f2a('0x2'));var BPromise=require(_0x6f2a('0x3'));var Mustache=require(_0x6f2a('0x4'));var util=require(_0x6f2a('0x5'));var path=require(_0x6f2a('0x6'));var sox=require(_0x6f2a('0x7'));var csv=require(_0x6f2a('0x8'));var ejs=require(_0x6f2a('0x9'));var fs=require('fs');var _=require(_0x6f2a('0xa'));var squel=require(_0x6f2a('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f2a('0xc'));var deskjs=require(_0x6f2a('0xd'));var toCsv=require(_0x6f2a('0x8'));var querystring=require(_0x6f2a('0xe'));var Papa=require('papaparse');var authService=require(_0x6f2a('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x6f2a('0x10'));var qs=require(_0x6f2a('0x11'));var logger=require(_0x6f2a('0x12'))('api');var utils=require(_0x6f2a('0x13'));var config=require('../../config/environment');var db=require(_0x6f2a('0x14'))['db'];function respondWithStatusCode(_0x398822,_0x1c2665){_0x1c2665=_0x1c2665||0xcc;return function(_0x59df4e){if(_0x59df4e){return _0x398822[_0x6f2a('0x15')](_0x1c2665);}return _0x398822['status'](_0x1c2665)[_0x6f2a('0x16')]();};}function respondWithResult(_0x45eab9,_0x37bed1){_0x37bed1=_0x37bed1||0xc8;return function(_0x421e15){if(_0x421e15){return _0x45eab9[_0x6f2a('0x17')](_0x37bed1)['json'](_0x421e15);}};}function respondWithFilteredResult(_0x18fa0a,_0x414498){return function(_0x27ca04){if(_0x27ca04){var _0x44b317=_0x27ca04[_0x6f2a('0x18')],_0x1057f2=_0x414498[_0x6f2a('0x19')],_0x3dfc44=_0x414498[_0x6f2a('0x19')]+_0x414498[_0x6f2a('0x1a')],_0x276e38;if(_0x3dfc44>=_0x44b317){_0x3dfc44=_0x44b317;_0x276e38=0xc8;}else{_0x276e38=0xce;}_0x18fa0a[_0x6f2a('0x17')](_0x276e38);return _0x18fa0a['set'](_0x6f2a('0x1b'),_0x1057f2+'-'+_0x3dfc44+'/'+_0x44b317)[_0x6f2a('0x1c')](_0x27ca04);}return null;};}function patchUpdates(_0x55d117){return function(_0x1ff155){try{jsonpatch[_0x6f2a('0x1d')](_0x1ff155,_0x55d117,!![]);}catch(_0x43602b){return BPromise[_0x6f2a('0x1e')](_0x43602b);}return _0x1ff155[_0x6f2a('0x1f')]();};}function saveUpdates(_0x152052,_0x3e996b){return function(_0x33554f){if(_0x33554f){return _0x33554f['update'](_0x152052)[_0x6f2a('0x20')](function(_0x20e7ff){return _0x20e7ff;});}return null;};}function removeEntity(_0x1bb113,_0x27f139){return function(_0x1da29f){if(_0x1da29f){return _0x1da29f[_0x6f2a('0x21')]()[_0x6f2a('0x20')](function(){var _0x5278b8=_0x1da29f[_0x6f2a('0x22')]({'plain':!![]});var _0x590c40=_0x6f2a('0x23');return db[_0x6f2a('0x24')][_0x6f2a('0x21')]({'where':{'type':_0x590c40,'resourceId':_0x5278b8['id']}})['then'](function(){return _0x1da29f;});})[_0x6f2a('0x20')](function(){_0x1bb113[_0x6f2a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55c1bc,_0x1dabde){return function(_0x36c0b7){if(!_0x36c0b7){_0x55c1bc[_0x6f2a('0x15')](0x194);}return _0x36c0b7;};}function handleError(_0xf5105e,_0x6b781b){_0x6b781b=_0x6b781b||0x1f4;return function(_0x5efdda){logger[_0x6f2a('0x25')](_0x5efdda['stack']);if(_0x5efdda[_0x6f2a('0x26')]){delete _0x5efdda[_0x6f2a('0x26')];}_0xf5105e['status'](_0x6b781b)[_0x6f2a('0x27')](_0x5efdda);};}exports[_0x6f2a('0x28')]=function(_0x498d7e,_0x4035d8){var _0x1ca729={},_0x28d546={},_0x39a911={'count':0x0,'rows':[]};var _0x347767=db[_0x6f2a('0x29')][_0x6f2a('0x2a')];_0x28d546['model']=_[_0x6f2a('0x2b')](_0x347767);_0x28d546['query']=_[_0x6f2a('0x2b')](_0x498d7e['query']);_0x28d546[_0x6f2a('0x2c')]=_[_0x6f2a('0x2d')](_0x28d546[_0x6f2a('0x2e')],_0x28d546['query']);_0x1ca729[_0x6f2a('0x2f')]=_['intersection'](_0x28d546[_0x6f2a('0x2e')],qs[_0x6f2a('0x30')](_0x498d7e['query'][_0x6f2a('0x30')]));_0x1ca729[_0x6f2a('0x2f')]=_0x1ca729[_0x6f2a('0x2f')]['length']?_0x1ca729['attributes']:_0x28d546['model'];if(!_0x498d7e[_0x6f2a('0x31')]['hasOwnProperty'](_0x6f2a('0x32'))){_0x1ca729[_0x6f2a('0x1a')]=qs['limit'](_0x498d7e[_0x6f2a('0x31')][_0x6f2a('0x1a')]);_0x1ca729[_0x6f2a('0x19')]=qs[_0x6f2a('0x19')](_0x498d7e['query'][_0x6f2a('0x19')]);}_0x1ca729['order']=qs[_0x6f2a('0x33')](_0x498d7e[_0x6f2a('0x31')][_0x6f2a('0x33')]);_0x1ca729[_0x6f2a('0x34')]=qs[_0x6f2a('0x2c')](_[_0x6f2a('0x35')](_0x498d7e[_0x6f2a('0x31')],_0x28d546['filters']));if(_0x498d7e[_0x6f2a('0x31')][_0x6f2a('0x36')]){_0x1ca729[_0x6f2a('0x34')]=_[_0x6f2a('0x37')](_0x1ca729[_0x6f2a('0x34')],{'$or':_[_0x6f2a('0x38')](_0x347767,function(_0x9506ae){if(_0x9506ae[_0x6f2a('0x39')][_0x6f2a('0x3a')]!==_0x6f2a('0x3b')){var _0x33b33b={};_0x33b33b[_0x9506ae['field']]={'$like':'%'+_0x498d7e[_0x6f2a('0x31')][_0x6f2a('0x36')]+'%'};return _0x33b33b;}})});}_0x1ca729=_[_0x6f2a('0x37')]({},_0x1ca729,_0x498d7e['options']);var _0x38b19c={'where':_0x1ca729[_0x6f2a('0x34')]};return db[_0x6f2a('0x29')][_0x6f2a('0x18')](_0x38b19c)[_0x6f2a('0x20')](function(_0x35ce69){_0x39a911[_0x6f2a('0x18')]=_0x35ce69;if(_0x498d7e[_0x6f2a('0x31')][_0x6f2a('0x3c')]){_0x1ca729[_0x6f2a('0x3d')]=[{'all':!![]}];}return db[_0x6f2a('0x29')]['findAll'](_0x1ca729);})[_0x6f2a('0x20')](function(_0xccc1c){_0x39a911[_0x6f2a('0x3e')]=_0xccc1c;return _0x39a911;})['then'](respondWithFilteredResult(_0x4035d8,_0x1ca729))[_0x6f2a('0x3f')](handleError(_0x4035d8,null));};exports[_0x6f2a('0x40')]=function(_0x14f869,_0x26e1ea){var _0x1ef96d={'raw':![],'where':{'id':_0x14f869[_0x6f2a('0x41')]['id']}},_0x2c5fbb={};_0x2c5fbb[_0x6f2a('0x2e')]=_['keys'](db[_0x6f2a('0x29')]['rawAttributes']);_0x2c5fbb['query']=_[_0x6f2a('0x2b')](_0x14f869[_0x6f2a('0x31')]);_0x2c5fbb[_0x6f2a('0x2c')]=_[_0x6f2a('0x2d')](_0x2c5fbb['model'],_0x2c5fbb[_0x6f2a('0x31')]);_0x1ef96d[_0x6f2a('0x2f')]=_[_0x6f2a('0x2d')](_0x2c5fbb[_0x6f2a('0x2e')],qs[_0x6f2a('0x30')](_0x14f869[_0x6f2a('0x31')]['fields']));_0x1ef96d[_0x6f2a('0x2f')]=_0x1ef96d[_0x6f2a('0x2f')][_0x6f2a('0x42')]?_0x1ef96d[_0x6f2a('0x2f')]:_0x2c5fbb[_0x6f2a('0x2e')];if(_0x14f869[_0x6f2a('0x31')]['includeAll']){_0x1ef96d['include']=[{'all':!![]}];}_0x1ef96d=_[_0x6f2a('0x37')]({},_0x1ef96d,_0x14f869['options']);return db[_0x6f2a('0x29')]['find'](_0x1ef96d)[_0x6f2a('0x20')](handleEntityNotFound(_0x26e1ea,null))[_0x6f2a('0x20')](respondWithResult(_0x26e1ea,null))['catch'](handleError(_0x26e1ea,null));};exports['create']=function(_0x552b85,_0x2265af){return db['AnalyticCustomReport']['create'](_0x552b85[_0x6f2a('0x43')],{})[_0x6f2a('0x20')](function(_0x348ed1){var _0x1fc47b=_0x552b85['user'][_0x6f2a('0x22')]({'plain':!![]});if(!_0x1fc47b)throw new Error(_0x6f2a('0x44'));if(_0x1fc47b[_0x6f2a('0x45')]===_0x6f2a('0x46')){var _0x3d8f60=_0x348ed1[_0x6f2a('0x22')]({'plain':!![]});var _0x57a8e7=_0x6f2a('0x47');return db[_0x6f2a('0x48')][_0x6f2a('0x49')]({'where':{'name':_0x57a8e7,'userProfileId':_0x1fc47b[_0x6f2a('0x4a')]},'raw':!![]})[_0x6f2a('0x20')](function(_0x18734e){if(_0x18734e&&_0x18734e['autoAssociation']===0x0){return db[_0x6f2a('0x24')][_0x6f2a('0x4b')]({'name':_0x3d8f60[_0x6f2a('0x26')],'resourceId':_0x3d8f60['id'],'type':'CustomReports','sectionId':_0x18734e['id']},{})['then'](function(){return _0x348ed1;});}else{return _0x348ed1;}})[_0x6f2a('0x3f')](function(_0x2ab63c){logger[_0x6f2a('0x25')](_0x6f2a('0x4c'),_0x2ab63c);throw _0x2ab63c;});}return _0x348ed1;})[_0x6f2a('0x20')](respondWithResult(_0x2265af,0xc9))[_0x6f2a('0x3f')](handleError(_0x2265af,null));};exports[_0x6f2a('0x4d')]=function(_0x68d57c,_0x39f0c4){if(_0x68d57c[_0x6f2a('0x43')]['id']){delete _0x68d57c[_0x6f2a('0x43')]['id'];}return db[_0x6f2a('0x29')][_0x6f2a('0x49')]({'where':{'id':_0x68d57c['params']['id']}})[_0x6f2a('0x20')](handleEntityNotFound(_0x39f0c4,null))['then'](saveUpdates(_0x68d57c[_0x6f2a('0x43')],null))['then'](respondWithResult(_0x39f0c4,null))[_0x6f2a('0x3f')](handleError(_0x39f0c4,null));};exports['destroy']=function(_0x13d759,_0x1c1ad9){return db[_0x6f2a('0x29')]['find']({'where':{'id':_0x13d759[_0x6f2a('0x41')]['id']}})['then'](handleEntityNotFound(_0x1c1ad9,null))[_0x6f2a('0x20')](removeEntity(_0x1c1ad9,null))['catch'](handleError(_0x1c1ad9,null));};exports['preview']=function(_0x2e0078,_0x3a213c){var _0x1a5afb=0xa;var _0x33468e=[_0x6f2a('0x4e'),_0x6f2a('0x4f'),_0x6f2a('0x50'),'cross_join'];var _0x23312c={'SUM':_0x6f2a('0x51'),'COUNT':_0x6f2a('0x52'),'COUNT DISTINCT':_0x6f2a('0x53'),'MAX':_0x6f2a('0x54'),'MIN':_0x6f2a('0x55'),'AVG':_0x6f2a('0x56'),'GROUP_CONCAT':_0x6f2a('0x57'),'GROUP_CONCAT ASC':_0x6f2a('0x58'),'GROUP_CONCAT DESC':_0x6f2a('0x59')};var _0x2c9133={'SEC_TO_TIME':_0x6f2a('0x5a'),'DATE':_0x6f2a('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x6f2a('0x5c'),'UNIX_TIMESTAMP':_0x6f2a('0x5d')};var _0x19da53=function(_0x172e25){return!_[_0x6f2a('0x5e')]([_0x6f2a('0x5f'),_0x6f2a('0x60'),_0x6f2a('0x61'),_0x6f2a('0x62')],_0x172e25);};var _0x566477=function(_0x1ae081){if(!_0x1ae081||!_0x1ae081[_0x6f2a('0x63')][_0x6f2a('0x42')]){return'';}for(var _0x46099e='(',_0x384778=0x0;_0x384778<_0x1ae081[_0x6f2a('0x63')][_0x6f2a('0x42')];_0x384778+=0x1){_0x384778>0x0&&(_0x46099e+='\x20'+_0x1ae081[_0x6f2a('0x64')]+'\x20');_0x46099e+=_0x1ae081[_0x6f2a('0x63')][_0x384778][_0x6f2a('0x65')]?_0x566477(_0x1ae081['rules'][_0x384778][_0x6f2a('0x65')]):_0x1ae081[_0x6f2a('0x63')][_0x384778]['field']+'\x20'+_0x1ae081[_0x6f2a('0x63')][_0x384778][_0x6f2a('0x66')]+(_0x19da53(_0x1ae081[_0x6f2a('0x63')][_0x384778][_0x6f2a('0x66')])?'\x20'+_0x1ae081['rules'][_0x384778]['value']:'');}return _0x46099e+')';};var _0x3097e8={'where':{'id':_0x2e0078[_0x6f2a('0x41')]['id']}},_0x174cc,_0x4eb5ab,_0x3518de,_0x190f60,_0x1d370f;_0x3097e8=_['merge']({},_0x3097e8,_0x2e0078[_0x6f2a('0x67')]);return db[_0x6f2a('0x29')][_0x6f2a('0x49')](_0x3097e8)[_0x6f2a('0x20')](function(_0x24881b){if(_0x24881b){_0x174cc=_0x24881b;return _0x24881b[_0x6f2a('0x68')]();}return null;})[_0x6f2a('0x20')](function(_0x1e8063){if(_0x1e8063){if(!_0x1e8063[_0x6f2a('0x42')]){throw new db['Sequelize'][(_0x6f2a('0x69'))](_0x6f2a('0x6a'),0x193);}_0x4eb5ab=_0x1e8063;return db[_0x6f2a('0x6b')][_0x6f2a('0x6c')]({'raw':!![]});}return null;})[_0x6f2a('0x20')](function(_0x3bde9d){if(_0x3bde9d){_0x3518de=_[_0x6f2a('0x6d')](_0x3bde9d,'id');var _0x2a8d40;var _0x3fe6e3=squel[_0x6f2a('0x6e')]();_0x3fe6e3[_0x6f2a('0x6f')](_0x174cc[_0x6f2a('0x70')]);for(var _0x1f7cd0=0x0;_0x1f7cd0<_0x4eb5ab[_0x6f2a('0x42')];_0x1f7cd0+=0x1){_0x2a8d40=_0x4eb5ab[_0x1f7cd0][_0x6f2a('0x71')]?_0x3518de[_0x4eb5ab[_0x1f7cd0][_0x6f2a('0x71')]][_0x6f2a('0x72')]:_0x4eb5ab[_0x1f7cd0][_0x6f2a('0x73')];_0x2a8d40=_0x4eb5ab[_0x1f7cd0][_0x6f2a('0x74')]?_[_0x6f2a('0x75')](_0x23312c[_0x4eb5ab[_0x1f7cd0][_0x6f2a('0x74')]],'%s',_0x2a8d40):_0x2a8d40;_0x2a8d40=_0x4eb5ab[_0x1f7cd0]['format']?_[_0x6f2a('0x75')](_0x2c9133[_0x4eb5ab[_0x1f7cd0]['format']],'%s',_0x2a8d40):_0x2a8d40;if(_0x4eb5ab[_0x1f7cd0][_0x6f2a('0x76')]){_0x3fe6e3[_0x6f2a('0x65')](_0x2a8d40);}_0x4eb5ab[_0x1f7cd0]['orderBy']&&_0x3fe6e3[_0x6f2a('0x77')](_0x2a8d40,_0x4eb5ab[_0x1f7cd0][_0x6f2a('0x78')]===_0x6f2a('0x79')?![]:!![]);_0x3fe6e3[_0x6f2a('0x73')](_0x2a8d40,_0x4eb5ab[_0x1f7cd0][_0x6f2a('0x7a')]||_0x2a8d40);}if(_0x174cc['joins']){_0x174cc[_0x6f2a('0x7b')]=JSON[_0x6f2a('0x7c')](_0x174cc['joins']);for(var _0x2ec209=0x0;_0x2ec209<_0x174cc['joins'][_0x6f2a('0x42')];_0x2ec209+=0x1){if(_0x174cc[_0x6f2a('0x7b')][_0x2ec209]['type']&&_[_0x6f2a('0x5e')](_0x33468e,_0x174cc[_0x6f2a('0x7b')][_0x2ec209]['type'])&&_0x174cc['joins'][_0x2ec209]['parentKey']&&_0x174cc['joins'][_0x2ec209]['foreignTable']&&_0x174cc[_0x6f2a('0x7b')][_0x2ec209]['foreignKey']){_0x3fe6e3[_0x174cc[_0x6f2a('0x7b')][_0x2ec209][_0x6f2a('0x39')]](_0x174cc['joins'][_0x2ec209][_0x6f2a('0x7d')],null,util[_0x6f2a('0x7e')](_0x6f2a('0x7f'),_0x174cc[_0x6f2a('0x70')],_0x174cc['joins'][_0x2ec209][_0x6f2a('0x80')],_0x174cc[_0x6f2a('0x7b')][_0x2ec209][_0x6f2a('0x7d')],_0x174cc[_0x6f2a('0x7b')][_0x2ec209][_0x6f2a('0x81')]));}}}if(_0x174cc[_0x6f2a('0x82')]){_0x174cc['conditions']=JSON[_0x6f2a('0x7c')](_0x174cc[_0x6f2a('0x82')]);_0x3fe6e3[_0x6f2a('0x34')](_0x566477(_0x174cc['conditions']['group']));}_0x1d370f=_0x3fe6e3[_0x6f2a('0x83')]();_0x3fe6e3[_0x6f2a('0x1a')](_0x1a5afb);_0x3fe6e3[_0x6f2a('0x19')](0x0);logger[_0x6f2a('0x84')](_0x6f2a('0x85'),_0x3fe6e3['toString']());return db[_0x6f2a('0x86')]['query'](_0x3fe6e3[_0x6f2a('0x87')](),{'type':db[_0x6f2a('0x86')][_0x6f2a('0x88')]['SELECT']});}})['then'](respondWithResult(_0x3a213c,null))[_0x6f2a('0x3f')](handleError(_0x3a213c,null));};function runReport(_0x4aac3f,_0x56f910,_0x19bb11){var _0x16adb6=_0x56f910[_0x6f2a('0x26')];var _0x302cc8=0xa;var _0x25c235=[_0x6f2a('0x4e'),_0x6f2a('0x4f'),_0x6f2a('0x50'),'cross_join'];var _0x99e053={'SUM':_0x6f2a('0x51'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6f2a('0x53'),'MAX':'MAX(%s)','MIN':_0x6f2a('0x55'),'AVG':_0x6f2a('0x56'),'GROUP_CONCAT':_0x6f2a('0x57'),'GROUP_CONCAT ASC':_0x6f2a('0x58'),'GROUP_CONCAT DESC':_0x6f2a('0x59')};var _0x5cbbe3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x6f2a('0x5b'),'HOUR':_0x6f2a('0x89'),'ROUND':_0x6f2a('0x5c'),'UNIX_TIMESTAMP':_0x6f2a('0x5d')};var _0x1f4fd8=function(_0x564670){return!_['includes']([_0x6f2a('0x5f'),_0x6f2a('0x60'),_0x6f2a('0x61'),_0x6f2a('0x62')],_0x564670);};var _0x1cf15c=function(_0x25731b){if(!_0x25731b||!_0x25731b[_0x6f2a('0x63')][_0x6f2a('0x42')]){return'';}for(var _0x4e054c='(',_0x3777eb=0x0;_0x3777eb<_0x25731b[_0x6f2a('0x63')][_0x6f2a('0x42')];_0x3777eb+=0x1){_0x3777eb>0x0&&(_0x4e054c+='\x20'+_0x25731b[_0x6f2a('0x64')]+'\x20');_0x4e054c+=_0x25731b[_0x6f2a('0x63')][_0x3777eb][_0x6f2a('0x65')]?_0x1cf15c(_0x25731b[_0x6f2a('0x63')][_0x3777eb][_0x6f2a('0x65')]):_0x25731b['rules'][_0x3777eb]['field']+'\x20'+_0x25731b[_0x6f2a('0x63')][_0x3777eb][_0x6f2a('0x66')]+(_0x1f4fd8(_0x25731b[_0x6f2a('0x63')][_0x3777eb][_0x6f2a('0x66')])?'\x20'+_0x25731b[_0x6f2a('0x63')][_0x3777eb][_0x6f2a('0x8a')]:'');}return _0x4e054c+')';};var _0x4e31bd={'where':{'id':_0x4aac3f['id']}},_0x2550e0,_0x47390b,_0x510bd0,_0x372680,_0x295b8a;_0x4e31bd=_[_0x6f2a('0x37')]({},_0x4e31bd,_0x19bb11);return db['AnalyticCustomReport'][_0x6f2a('0x49')](_0x4e31bd)[_0x6f2a('0x20')](function(_0x49f478){if(_0x49f478){_0x2550e0=_0x49f478;return _0x49f478[_0x6f2a('0x68')]();}return null;})[_0x6f2a('0x20')](function(_0x3d2e9f){if(_0x3d2e9f){if(!_0x3d2e9f[_0x6f2a('0x42')]){throw new db[(_0x6f2a('0x8b'))][(_0x6f2a('0x69'))](_0x6f2a('0x6a'),0x193);}_0x47390b=_0x3d2e9f;return db[_0x6f2a('0x6b')][_0x6f2a('0x6c')]({'raw':!![]});}return null;})['then'](function(_0x198038){if(_0x198038){_0x510bd0=_[_0x6f2a('0x6d')](_0x198038,'id');var _0x3ee180;var _0x53b9c=squel[_0x6f2a('0x6e')]();_0x53b9c['from'](_0x2550e0['table']);for(var _0x41bdb0=0x0;_0x41bdb0<_0x47390b[_0x6f2a('0x42')];_0x41bdb0+=0x1){_0x3ee180=_0x47390b[_0x41bdb0][_0x6f2a('0x71')]?_0x510bd0[_0x47390b[_0x41bdb0]['MetricId']]['metric']:_0x47390b[_0x41bdb0][_0x6f2a('0x73')];_0x3ee180=_0x47390b[_0x41bdb0][_0x6f2a('0x74')]?_[_0x6f2a('0x75')](_0x99e053[_0x47390b[_0x41bdb0][_0x6f2a('0x74')]],'%s',_0x3ee180):_0x3ee180;_0x3ee180=_0x47390b[_0x41bdb0][_0x6f2a('0x7e')]?_[_0x6f2a('0x75')](_0x5cbbe3[_0x47390b[_0x41bdb0]['format']],'%s',_0x3ee180):_0x3ee180;if(_0x47390b[_0x41bdb0][_0x6f2a('0x76')]){_0x53b9c[_0x6f2a('0x65')](_0x3ee180);}_0x47390b[_0x41bdb0]['orderBy']&&_0x53b9c['order'](_0x3ee180,_0x47390b[_0x41bdb0][_0x6f2a('0x78')]===_0x6f2a('0x79')?![]:!![]);_0x53b9c[_0x6f2a('0x73')](_0x3ee180,_0x47390b[_0x41bdb0][_0x6f2a('0x7a')]||_0x3ee180);}if(_0x2550e0['joins']){_0x2550e0[_0x6f2a('0x7b')]=JSON['parse'](_0x2550e0[_0x6f2a('0x7b')]);for(var _0x311bc1=0x0;_0x311bc1<_0x2550e0[_0x6f2a('0x7b')]['length'];_0x311bc1+=0x1){if(_0x2550e0[_0x6f2a('0x7b')][_0x311bc1][_0x6f2a('0x39')]&&_['includes'](_0x25c235,_0x2550e0[_0x6f2a('0x7b')][_0x311bc1][_0x6f2a('0x39')])&&_0x2550e0[_0x6f2a('0x7b')][_0x311bc1][_0x6f2a('0x80')]&&_0x2550e0[_0x6f2a('0x7b')][_0x311bc1][_0x6f2a('0x7d')]&&_0x2550e0['joins'][_0x311bc1][_0x6f2a('0x81')]){_0x53b9c[_0x2550e0[_0x6f2a('0x7b')][_0x311bc1][_0x6f2a('0x39')]](_0x2550e0[_0x6f2a('0x7b')][_0x311bc1][_0x6f2a('0x7d')],null,util[_0x6f2a('0x7e')](_0x6f2a('0x7f'),_0x2550e0[_0x6f2a('0x70')],_0x2550e0[_0x6f2a('0x7b')][_0x311bc1][_0x6f2a('0x80')],_0x2550e0['joins'][_0x311bc1][_0x6f2a('0x7d')],_0x2550e0[_0x6f2a('0x7b')][_0x311bc1][_0x6f2a('0x81')]));}}}if(_0x2550e0[_0x6f2a('0x82')]){_0x2550e0[_0x6f2a('0x82')]=JSON[_0x6f2a('0x7c')](_0x2550e0['conditions']);_0x53b9c[_0x6f2a('0x34')](_0x1cf15c(_0x2550e0['conditions'][_0x6f2a('0x65')]));}_0x295b8a=_0x53b9c[_0x6f2a('0x83')]();_0x53b9c[_0x6f2a('0x1a')](_0x302cc8);_0x53b9c[_0x6f2a('0x19')](0x0);logger['debug'](_0x6f2a('0x85'),_0x53b9c[_0x6f2a('0x87')]());return db['sequelize'][_0x6f2a('0x31')](_0x53b9c[_0x6f2a('0x87')](),{'type':db[_0x6f2a('0x86')]['QueryTypes'][_0x6f2a('0x8c')]});}})[_0x6f2a('0x20')](function(_0xec62e){if(!_0xec62e[_0x6f2a('0x42')]){throw new db[(_0x6f2a('0x8b'))][(_0x6f2a('0x69'))](_0x6f2a('0x8d'),0xcc);}if(_0x56f910[_0x6f2a('0x8e')]==='web'){return null;}var _0x3119b5=_[_0x6f2a('0x37')](_0x56f910,{'name':_0x56f910[_0x6f2a('0x8f')]||_0x56f910[_0x6f2a('0x26')]||_0x2550e0[_0x6f2a('0x26')],'basename':_0x16adb6,'savename':util[_0x6f2a('0x7e')](_0x6f2a('0x90'),_0x56f910[_0x6f2a('0x26')]||_0x2550e0[_0x6f2a('0x26')],require(_0x6f2a('0x91'))['generate'](0x4),_0x56f910[_0x6f2a('0x8e')]||'csv'),'reportId':_0x2550e0['id'],'reportType':_0x6f2a('0x92')});return db[_0x6f2a('0x93')]['create'](_0x3119b5,{'raw':!![]});})[_0x6f2a('0x20')](function(_0x488eba){if(_0x2550e0[_0x6f2a('0x70')]===_0x6f2a('0x94')){_0x295b8a[_0x6f2a('0x34')](_0x2550e0[_0x6f2a('0x70')]+_0x6f2a('0x95'),_0x56f910[_0x6f2a('0x96')],_0x56f910[_0x6f2a('0x97')]);}else{_0x295b8a['where'](_0x2550e0[_0x6f2a('0x70')]+_0x6f2a('0x98'),_0x56f910[_0x6f2a('0x96')],_0x56f910[_0x6f2a('0x97')]);}if(_0x488eba){logger['info'](_0x6f2a('0x99'),_0x295b8a[_0x6f2a('0x87')]());require(_0x6f2a('0x9a'))[_0x6f2a('0x9b')](path[_0x6f2a('0x4e')](__dirname,'../../components/export/',_0x488eba['output']),[_0x488eba['id'],_0x295b8a['toString'](),path[_0x6f2a('0x4e')](__dirname,_0x6f2a('0x9c'),_0x488eba[_0x6f2a('0x9d')]),_0x16adb6]);return _0x488eba;}else{var _0x5862de=squel[_0x6f2a('0x6e')]();_0x5862de['from']('('+_0x295b8a[_0x6f2a('0x87')]()+')',_0x6f2a('0x9e'));_0x5862de[_0x6f2a('0x73')]('COUNT(*)',_0x6f2a('0x18'));_0x295b8a[_0x6f2a('0x1a')](_0x56f910[_0x6f2a('0x1a')]||_0x302cc8);_0x295b8a[_0x6f2a('0x19')](_0x56f910[_0x6f2a('0x19')]||0x0);return db[_0x6f2a('0x86')]['query'](_0x5862de[_0x6f2a('0x87')](),{'type':db[_0x6f2a('0x86')][_0x6f2a('0x88')]['SELECT']})[_0x6f2a('0x20')](function(_0x7e6409){if(!_0x7e6409['length']){_0x372680=0x0;}else{_0x372680=_0x7e6409[0x0][_0x6f2a('0x18')]||0x0;}return db[_0x6f2a('0x86')][_0x6f2a('0x31')](_0x295b8a[_0x6f2a('0x87')](),{'type':db[_0x6f2a('0x86')][_0x6f2a('0x88')][_0x6f2a('0x8c')]});})['then'](function(_0x43bfeb){return{'rows':_0x43bfeb||[],'count':_0x372680};});}});}exports['run']=function(_0x5bb13a,_0x5c4b04){return runReport(_0x5bb13a['params'],_0x5bb13a[_0x6f2a('0x31')],_0x5bb13a[_0x6f2a('0x67')])['then'](respondWithResult(_0x5c4b04,null))['catch'](handleError(_0x5c4b04,null));};exports[_0x6f2a('0x9f')]=runReport;exports[_0x6f2a('0x31')]=function(_0x1879e3,_0x38f7a6){var _0x3c954e=0xa;var _0xac64ab=[_0x6f2a('0x4e'),_0x6f2a('0x4f'),'right_join',_0x6f2a('0xa0')];var _0x360554={'SUM':_0x6f2a('0x51'),'COUNT':_0x6f2a('0x52'),'COUNT DISTINCT':_0x6f2a('0x53'),'MAX':_0x6f2a('0x54'),'MIN':_0x6f2a('0x55'),'AVG':_0x6f2a('0x56'),'GROUP_CONCAT':_0x6f2a('0x57'),'GROUP_CONCAT ASC':_0x6f2a('0x58'),'GROUP_CONCAT DESC':_0x6f2a('0x59')};var _0x23e522={'SEC_TO_TIME':_0x6f2a('0x5a'),'DATE':_0x6f2a('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x6f2a('0x5c'),'UNIX_TIMESTAMP':_0x6f2a('0x5d')};var _0x5d417e=function(_0x1fad8a){return!_[_0x6f2a('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x1fad8a);};var _0x410407=function(_0x24124d){if(!_0x24124d||!_0x24124d[_0x6f2a('0x63')][_0x6f2a('0x42')]){return'';}for(var _0x2cce2a='(',_0x45765a=0x0;_0x45765a<_0x24124d[_0x6f2a('0x63')][_0x6f2a('0x42')];_0x45765a+=0x1){_0x45765a>0x0&&(_0x2cce2a+='\x20'+_0x24124d[_0x6f2a('0x64')]+'\x20');_0x2cce2a+=_0x24124d[_0x6f2a('0x63')][_0x45765a]['group']?_0x410407(_0x24124d['rules'][_0x45765a][_0x6f2a('0x65')]):_0x24124d[_0x6f2a('0x63')][_0x45765a]['field']+'\x20'+_0x24124d[_0x6f2a('0x63')][_0x45765a]['condition']+(_0x5d417e(_0x24124d[_0x6f2a('0x63')][_0x45765a][_0x6f2a('0x66')])?'\x20'+_0x24124d[_0x6f2a('0x63')][_0x45765a][_0x6f2a('0x8a')]:'');}return _0x2cce2a+')';};var _0x4b8480={'where':{'id':_0x1879e3[_0x6f2a('0x41')]['id']}},_0x24ae61,_0x8f7e2d,_0x399ed2,_0x2349eb,_0x78296;_0x4b8480=_[_0x6f2a('0x37')]({},_0x4b8480,_0x1879e3[_0x6f2a('0x67')]);return db[_0x6f2a('0x29')]['find'](_0x4b8480)[_0x6f2a('0x20')](function(_0x4a12b5){if(_0x4a12b5){_0x24ae61=_0x4a12b5;return _0x4a12b5[_0x6f2a('0x68')]();}return null;})['then'](function(_0x10afc3){if(_0x10afc3){if(!_0x10afc3['length']){throw new db[(_0x6f2a('0x8b'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x8f7e2d=_0x10afc3;return db[_0x6f2a('0x6b')][_0x6f2a('0x6c')]({'raw':!![]});}return null;})[_0x6f2a('0x20')](function(_0x536e04){if(_0x536e04){_0x399ed2=_['keyBy'](_0x536e04,'id');var _0x52917a;var _0x3d5a53=squel['select']();_0x3d5a53['from'](_0x24ae61[_0x6f2a('0x70')]);for(var _0x11e13a=0x0;_0x11e13a<_0x8f7e2d[_0x6f2a('0x42')];_0x11e13a+=0x1){_0x52917a=_0x8f7e2d[_0x11e13a][_0x6f2a('0x71')]?_0x399ed2[_0x8f7e2d[_0x11e13a][_0x6f2a('0x71')]][_0x6f2a('0x72')]:_0x8f7e2d[_0x11e13a][_0x6f2a('0x73')];_0x52917a=_0x8f7e2d[_0x11e13a][_0x6f2a('0x74')]?_['replace'](_0x360554[_0x8f7e2d[_0x11e13a][_0x6f2a('0x74')]],'%s',_0x52917a):_0x52917a;_0x52917a=_0x8f7e2d[_0x11e13a][_0x6f2a('0x7e')]?_[_0x6f2a('0x75')](_0x23e522[_0x8f7e2d[_0x11e13a][_0x6f2a('0x7e')]],'%s',_0x52917a):_0x52917a;if(_0x8f7e2d[_0x11e13a][_0x6f2a('0x76')]){_0x3d5a53[_0x6f2a('0x65')](_0x52917a);}_0x8f7e2d[_0x11e13a]['orderBy']&&_0x3d5a53['order'](_0x52917a,_0x8f7e2d[_0x11e13a][_0x6f2a('0x78')]===_0x6f2a('0x79')?![]:!![]);_0x3d5a53[_0x6f2a('0x73')](_0x52917a,_0x8f7e2d[_0x11e13a][_0x6f2a('0x7a')]||_0x52917a);}if(_0x24ae61['joins']){_0x24ae61['joins']=JSON[_0x6f2a('0x7c')](_0x24ae61[_0x6f2a('0x7b')]);for(var _0x1da35b=0x0;_0x1da35b<_0x24ae61[_0x6f2a('0x7b')][_0x6f2a('0x42')];_0x1da35b+=0x1){if(_0x24ae61[_0x6f2a('0x7b')][_0x1da35b]['type']&&_[_0x6f2a('0x5e')](_0xac64ab,_0x24ae61[_0x6f2a('0x7b')][_0x1da35b][_0x6f2a('0x39')])&&_0x24ae61[_0x6f2a('0x7b')][_0x1da35b][_0x6f2a('0x80')]&&_0x24ae61[_0x6f2a('0x7b')][_0x1da35b][_0x6f2a('0x7d')]&&_0x24ae61[_0x6f2a('0x7b')][_0x1da35b][_0x6f2a('0x81')]){_0x3d5a53[_0x24ae61[_0x6f2a('0x7b')][_0x1da35b][_0x6f2a('0x39')]](_0x24ae61[_0x6f2a('0x7b')][_0x1da35b]['foreignTable'],null,util[_0x6f2a('0x7e')](_0x6f2a('0x7f'),_0x24ae61[_0x6f2a('0x70')],_0x24ae61['joins'][_0x1da35b][_0x6f2a('0x80')],_0x24ae61[_0x6f2a('0x7b')][_0x1da35b]['foreignTable'],_0x24ae61[_0x6f2a('0x7b')][_0x1da35b]['foreignKey']));}}}if(_0x24ae61[_0x6f2a('0x82')]){_0x24ae61[_0x6f2a('0x82')]=JSON[_0x6f2a('0x7c')](_0x24ae61['conditions']);_0x3d5a53[_0x6f2a('0x34')](_0x410407(_0x24ae61['conditions'][_0x6f2a('0x65')]));}_0x78296=_0x3d5a53[_0x6f2a('0x83')]();_0x3d5a53['limit'](_0x3c954e);_0x3d5a53[_0x6f2a('0x19')](0x0);logger[_0x6f2a('0x84')](_0x6f2a('0x85'),_0x3d5a53['toString']());return db[_0x6f2a('0x86')][_0x6f2a('0x31')](_0x3d5a53[_0x6f2a('0x87')](),{'type':db['sequelize'][_0x6f2a('0x88')][_0x6f2a('0x8c')]});}})['then'](function(){return{'sql':_0x78296[_0x6f2a('0x87')]()};})[_0x6f2a('0x20')](respondWithResult(_0x38f7a6,null))['catch'](handleError(_0x38f7a6,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 3ea3805..16f14c6 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 _0x86f7=['../../config/logger','api','bluebird','request-promise','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x86f7,0x18f));var _0x786f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x86f7[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x786f('0x0'))(_0x786f('0x1'));var moment=require('moment');var BPromise=require(_0x786f('0x2'));var rp=require(_0x786f('0x3'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x194eca,_0x57fb8c){return _0x194eca[_0x786f('0x4')](_0x786f('0x5'),attributes,{'tableName':_0x786f('0x6'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d26=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise','./analyticCustomReport.attributes'];(function(_0x3d4718,_0x5919fc){var _0x301cad=function(_0x53dcff){while(--_0x53dcff){_0x3d4718['push'](_0x3d4718['shift']());}};_0x301cad(++_0x5919fc);}(_0x7d26,0x9e));var _0x67d2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7d26[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x67d2('0x0'));var util=require(_0x67d2('0x1'));var logger=require('../../config/logger')(_0x67d2('0x2'));var moment=require(_0x67d2('0x3'));var BPromise=require(_0x67d2('0x4'));var rp=require(_0x67d2('0x5'));var attributes=require(_0x67d2('0x6'));module[_0x67d2('0x7')]=function(_0x30a50d,_0x3d71ae){return _0x30a50d[_0x67d2('0x8')](_0x67d2('0x9'),attributes,{'tableName':_0x67d2('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 24cfcdb..e587d26 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 _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(_0x7c9fba,_0x10b015){var _0x5cceed=function(_0x4ae29a){while(--_0x4ae29a){_0x7c9fba['push'](_0x7c9fba['shift']());}};_0x5cceed(++_0x10b015);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xa9e0=['http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\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(_0x2e72ec,_0x46f1f1){var _0x1a5662=function(_0x33f247){while(--_0x33f247){_0x2e72ec['push'](_0x2e72ec['shift']());}};_0x1a5662(++_0x46f1f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 28f6b17..d1bf410 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 _0xfff0=['/:id','show','/:id/preview','preview','isAuthenticated','run','/:id/query','query','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','index'];(function(_0x5b9aa4,_0x1339fa){var _0x50707e=function(_0x74c5dc){while(--_0x74c5dc){_0x5b9aa4['push'](_0x5b9aa4['shift']());}};_0x50707e(++_0x1339fa);}(_0xfff0,0x139));var _0x0fff=function(_0x171a07,_0x3a476c){_0x171a07=_0x171a07-0x0;var _0x59934f=_0xfff0[_0x171a07];return _0x59934f;};'use strict';var multer=require('multer');var util=require(_0x0fff('0x0'));var path=require(_0x0fff('0x1'));var timeout=require(_0x0fff('0x2'));var express=require('express');var router=express[_0x0fff('0x3')]();var auth=require(_0x0fff('0x4'));var interaction=require(_0x0fff('0x5'));var config=require('../../config/environment');var controller=require(_0x0fff('0x6'));router[_0x0fff('0x7')]('/',auth['isAuthenticated'](),controller[_0x0fff('0x8')]);router[_0x0fff('0x7')](_0x0fff('0x9'),auth['isAuthenticated'](),controller[_0x0fff('0xa')]);router['get'](_0x0fff('0xb'),auth['isAuthenticated'](),controller[_0x0fff('0xc')]);router[_0x0fff('0x7')]('/:id/run',auth[_0x0fff('0xd')](),controller[_0x0fff('0xe')]);router[_0x0fff('0x7')](_0x0fff('0xf'),auth[_0x0fff('0xd')](),controller[_0x0fff('0x10')]);router[_0x0fff('0x11')]('/',auth[_0x0fff('0xd')](),controller[_0x0fff('0x12')]);router[_0x0fff('0x13')](_0x0fff('0x9'),auth['isAuthenticated'](),controller[_0x0fff('0x14')]);router['delete'](_0x0fff('0x9'),auth[_0x0fff('0xd')](),controller[_0x0fff('0x15')]);module[_0x0fff('0x16')]=router; \ No newline at end of file +var _0x0424=['put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','preview','run','/:id/query','query','post'];(function(_0x522a77,_0xf8615d){var _0x2a6305=function(_0x44748f){while(--_0x44748f){_0x522a77['push'](_0x522a77['shift']());}};_0x2a6305(++_0xf8615d);}(_0x0424,0x159));var _0x4042=function(_0x8cb724,_0x5e78d5){_0x8cb724=_0x8cb724-0x0;var _0x348d6f=_0x0424[_0x8cb724];return _0x348d6f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4042('0x0'));var timeout=require(_0x4042('0x1'));var express=require(_0x4042('0x2'));var router=express[_0x4042('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4042('0x4'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x4042('0x5')]('/',auth[_0x4042('0x6')](),controller[_0x4042('0x7')]);router[_0x4042('0x5')](_0x4042('0x8'),auth[_0x4042('0x6')](),controller[_0x4042('0x9')]);router['get']('/:id/preview',auth[_0x4042('0x6')](),controller[_0x4042('0xa')]);router[_0x4042('0x5')]('/:id/run',auth[_0x4042('0x6')](),controller[_0x4042('0xb')]);router[_0x4042('0x5')](_0x4042('0xc'),auth[_0x4042('0x6')](),controller[_0x4042('0xd')]);router[_0x4042('0xe')]('/',auth[_0x4042('0x6')](),controller['create']);router[_0x4042('0xf')](_0x4042('0x8'),auth['isAuthenticated'](),controller[_0x4042('0x10')]);router[_0x4042('0x11')](_0x4042('0x8'),auth[_0x4042('0x6')](),controller[_0x4042('0x12')]);module[_0x4042('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 6bbf0fe..ec43360 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 _0xfb61=['exports','STRING','TEXT','sequelize'];(function(_0x3cd331,_0x5e1a8b){var _0x4cdd19=function(_0x5990b2){while(--_0x5990b2){_0x3cd331['push'](_0x3cd331['shift']());}};_0x4cdd19(++_0x5e1a8b);}(_0xfb61,0xeb));var _0x1fb6=function(_0x5c7525,_0x39490f){_0x5c7525=_0x5c7525-0x0;var _0x2e2ec8=_0xfb61[_0x5c7525];return _0x2e2ec8;};'use strict';var Sequelize=require(_0x1fb6('0x0'));module[_0x1fb6('0x1')]={'name':{'type':Sequelize[_0x1fb6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1fb6('0x2')]},'parent':{'type':Sequelize[_0x1fb6('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x1fb6('0x3')]},'joins':{'type':Sequelize[_0x1fb6('0x3')]}}; \ No newline at end of file +var _0x2493=['STRING','TEXT'];(function(_0x3e2924,_0x3b743f){var _0x1dc404=function(_0x5ab8c5){while(--_0x5ab8c5){_0x3e2924['push'](_0x3e2924['shift']());}};_0x1dc404(++_0x3b743f);}(_0x2493,0x1be));var _0x3249=function(_0x2f8316,_0x59c2a2){_0x2f8316=_0x2f8316-0x0;var _0x34368d=_0x2493[_0x2f8316];return _0x34368d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3249('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x3249('0x0')]},'parent':{'type':Sequelize[_0x3249('0x0')]},'table':{'type':Sequelize[_0x3249('0x0')]},'conditions':{'type':Sequelize[_0x3249('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index fa24df1..a378c93 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 _0xed8f=['order','sort','pick','where','merge','type','field','filter','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','alias','joins','parse','parentKey','%s.%s\x20=\x20%s.%s','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','right_join','cross_join','ROUND(%s)','IS\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','from','DESC','No\x20available\x20data','web','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','MAX(%s)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','sendStatus','error','stack','name','send','index','AnalyticDefaultReport','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x53e9d0,_0x42c971){var _0x270f80=function(_0x3d0939){while(--_0x3d0939){_0x53e9d0['push'](_0x53e9d0['shift']());}};_0x270f80(++_0x42c971);}(_0xed8f,0x1ac));var _0xfed8=function(_0x4942db,_0x56a8e6){_0x4942db=_0x4942db-0x0;var _0x4b2946=_0xed8f[_0x4942db];return _0x4b2946;};'use strict';var pdf=require(_0xfed8('0x0'));var emlformat=require(_0xfed8('0x1'));var rimraf=require(_0xfed8('0x2'));var zipdir=require(_0xfed8('0x3'));var jsonpatch=require(_0xfed8('0x4'));var rp=require(_0xfed8('0x5'));var moment=require(_0xfed8('0x6'));var BPromise=require(_0xfed8('0x7'));var Mustache=require('mustache');var util=require(_0xfed8('0x8'));var path=require(_0xfed8('0x9'));var sox=require(_0xfed8('0xa'));var csv=require(_0xfed8('0xb'));var ejs=require(_0xfed8('0xc'));var fs=require('fs');var _=require(_0xfed8('0xd'));var squel=require(_0xfed8('0xe'));var crypto=require(_0xfed8('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xfed8('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfed8('0x11'));var Papa=require(_0xfed8('0x12'));var authService=require(_0xfed8('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xfed8('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0xfed8('0x15'))(_0xfed8('0x16'));var utils=require(_0xfed8('0x17'));var config=require(_0xfed8('0x18'));var db=require(_0xfed8('0x19'))['db'];function respondWithStatusCode(_0x38d78c,_0x1eda8e){_0x1eda8e=_0x1eda8e||0xcc;return function(_0x5131fa){if(_0x5131fa){return _0x38d78c['sendStatus'](_0x1eda8e);}return _0x38d78c[_0xfed8('0x1a')](_0x1eda8e)[_0xfed8('0x1b')]();};}function respondWithResult(_0x5cc940,_0x5addf){_0x5addf=_0x5addf||0xc8;return function(_0x4e2ea5){if(_0x4e2ea5){return _0x5cc940['status'](_0x5addf)[_0xfed8('0x1c')](_0x4e2ea5);}};}function respondWithFilteredResult(_0x3fd269,_0x578155){return function(_0x3c186f){if(_0x3c186f){var _0x26f0e6=_0x3c186f[_0xfed8('0x1d')],_0x47d65b=_0x578155[_0xfed8('0x1e')],_0x5108d8=_0x578155[_0xfed8('0x1e')]+_0x578155[_0xfed8('0x1f')],_0x49976f;if(_0x5108d8>=_0x26f0e6){_0x5108d8=_0x26f0e6;_0x49976f=0xc8;}else{_0x49976f=0xce;}_0x3fd269['status'](_0x49976f);return _0x3fd269[_0xfed8('0x20')](_0xfed8('0x21'),_0x47d65b+'-'+_0x5108d8+'/'+_0x26f0e6)[_0xfed8('0x1c')](_0x3c186f);}return null;};}function patchUpdates(_0x431e96){return function(_0x4c3ede){try{jsonpatch['apply'](_0x4c3ede,_0x431e96,!![]);}catch(_0x4b111f){return BPromise[_0xfed8('0x22')](_0x4b111f);}return _0x4c3ede[_0xfed8('0x23')]();};}function saveUpdates(_0x525507,_0x259748){return function(_0xbaa566){if(_0xbaa566){return _0xbaa566[_0xfed8('0x24')](_0x525507)[_0xfed8('0x25')](function(_0x2dfc56){return _0x2dfc56;});}return null;};}function removeEntity(_0x3b308c,_0x10b5b8){return function(_0x3cf8ea){if(_0x3cf8ea){return _0x3cf8ea[_0xfed8('0x26')]()['then'](function(){var _0x5f05fb=_0x3cf8ea[_0xfed8('0x27')]({'plain':!![]});var _0x2f7213=_0xfed8('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x2f7213,'resourceId':_0x5f05fb['id']}})[_0xfed8('0x25')](function(){return _0x3cf8ea;});})['then'](function(){_0x3b308c[_0xfed8('0x1a')](0xcc)[_0xfed8('0x1b')]();});}};}function handleEntityNotFound(_0x1dbb17,_0x38faf1){return function(_0x20569e){if(!_0x20569e){_0x1dbb17[_0xfed8('0x29')](0x194);}return _0x20569e;};}function handleError(_0x47b70c,_0x1f5ff8){_0x1f5ff8=_0x1f5ff8||0x1f4;return function(_0x1f7f9e){logger[_0xfed8('0x2a')](_0x1f7f9e[_0xfed8('0x2b')]);if(_0x1f7f9e[_0xfed8('0x2c')]){delete _0x1f7f9e['name'];}_0x47b70c[_0xfed8('0x1a')](_0x1f5ff8)[_0xfed8('0x2d')](_0x1f7f9e);};}exports[_0xfed8('0x2e')]=function(_0x55cc0d,_0x155678){var _0x4e6e61={},_0x5b3516={},_0x3780f5={'count':0x0,'rows':[]};var _0x4791e8=db[_0xfed8('0x2f')]['rawAttributes'];_0x5b3516[_0xfed8('0x30')]=_[_0xfed8('0x31')](_0x4791e8);_0x5b3516['query']=_[_0xfed8('0x31')](_0x55cc0d[_0xfed8('0x32')]);_0x5b3516[_0xfed8('0x33')]=_[_0xfed8('0x34')](_0x5b3516[_0xfed8('0x30')],_0x5b3516[_0xfed8('0x32')]);_0x4e6e61['attributes']=_[_0xfed8('0x34')](_0x5b3516[_0xfed8('0x30')],qs[_0xfed8('0x35')](_0x55cc0d['query'][_0xfed8('0x35')]));_0x4e6e61[_0xfed8('0x36')]=_0x4e6e61[_0xfed8('0x36')][_0xfed8('0x37')]?_0x4e6e61[_0xfed8('0x36')]:_0x5b3516[_0xfed8('0x30')];if(!_0x55cc0d[_0xfed8('0x32')][_0xfed8('0x38')](_0xfed8('0x39'))){_0x4e6e61['limit']=qs[_0xfed8('0x1f')](_0x55cc0d['query'][_0xfed8('0x1f')]);_0x4e6e61[_0xfed8('0x1e')]=qs['offset'](_0x55cc0d['query'][_0xfed8('0x1e')]);}_0x4e6e61[_0xfed8('0x3a')]=qs['sort'](_0x55cc0d['query'][_0xfed8('0x3b')]);_0x4e6e61['where']=qs[_0xfed8('0x33')](_[_0xfed8('0x3c')](_0x55cc0d[_0xfed8('0x32')],_0x5b3516[_0xfed8('0x33')]));if(_0x55cc0d['query']['filter']){_0x4e6e61[_0xfed8('0x3d')]=_[_0xfed8('0x3e')](_0x4e6e61['where'],{'$or':_['map'](_0x4791e8,function(_0x92ff8c){if(_0x92ff8c[_0xfed8('0x3f')]['key']!=='VIRTUAL'){var _0x3f3573={};_0x3f3573[_0x92ff8c[_0xfed8('0x40')]]={'$like':'%'+_0x55cc0d[_0xfed8('0x32')][_0xfed8('0x41')]+'%'};return _0x3f3573;}})});}_0x4e6e61=_[_0xfed8('0x3e')]({},_0x4e6e61,_0x55cc0d[_0xfed8('0x42')]);var _0x26f50b={'where':_0x4e6e61['where']};return db[_0xfed8('0x2f')][_0xfed8('0x1d')](_0x26f50b)[_0xfed8('0x25')](function(_0x1f60c8){_0x3780f5[_0xfed8('0x1d')]=_0x1f60c8;if(_0x55cc0d[_0xfed8('0x32')]['includeAll']){_0x4e6e61[_0xfed8('0x43')]=[{'all':!![]}];}return db[_0xfed8('0x2f')][_0xfed8('0x44')](_0x4e6e61);})[_0xfed8('0x25')](function(_0x2f6555){_0x3780f5[_0xfed8('0x45')]=_0x2f6555;return _0x3780f5;})['then'](respondWithFilteredResult(_0x155678,_0x4e6e61))['catch'](handleError(_0x155678,null));};exports[_0xfed8('0x46')]=function(_0xc4a73e,_0x18d70a){var _0x232c3e={'raw':!![],'where':{'id':_0xc4a73e[_0xfed8('0x47')]['id']}},_0x53281e={};_0x53281e[_0xfed8('0x30')]=_[_0xfed8('0x31')](db[_0xfed8('0x2f')][_0xfed8('0x48')]);_0x53281e[_0xfed8('0x32')]=_['keys'](_0xc4a73e[_0xfed8('0x32')]);_0x53281e['filters']=_[_0xfed8('0x34')](_0x53281e['model'],_0x53281e['query']);_0x232c3e[_0xfed8('0x36')]=_['intersection'](_0x53281e['model'],qs[_0xfed8('0x35')](_0xc4a73e[_0xfed8('0x32')]['fields']));_0x232c3e[_0xfed8('0x36')]=_0x232c3e['attributes']['length']?_0x232c3e[_0xfed8('0x36')]:_0x53281e[_0xfed8('0x30')];if(_0xc4a73e[_0xfed8('0x32')][_0xfed8('0x49')]){_0x232c3e['include']=[{'all':!![]}];}_0x232c3e=_[_0xfed8('0x3e')]({},_0x232c3e,_0xc4a73e['options']);return db[_0xfed8('0x2f')][_0xfed8('0x4a')](_0x232c3e)[_0xfed8('0x25')](handleEntityNotFound(_0x18d70a,null))[_0xfed8('0x25')](respondWithResult(_0x18d70a,null))['catch'](handleError(_0x18d70a,null));};exports[_0xfed8('0x4b')]=function(_0x33aa75,_0x25f8ae){return db[_0xfed8('0x2f')][_0xfed8('0x4b')](_0x33aa75[_0xfed8('0x4c')],{})[_0xfed8('0x25')](function(_0x2447a7){var _0xb7c56=_0x33aa75[_0xfed8('0x4d')][_0xfed8('0x27')]({'plain':!![]});if(!_0xb7c56)throw new Error(_0xfed8('0x4e'));if(_0xb7c56['role']===_0xfed8('0x4d')){var _0x48254e=_0x2447a7[_0xfed8('0x27')]({'plain':!![]});var _0x5627e5=_0xfed8('0x4f');return db[_0xfed8('0x50')][_0xfed8('0x4a')]({'where':{'name':_0x5627e5,'userProfileId':_0xb7c56[_0xfed8('0x51')]},'raw':!![]})['then'](function(_0x16e7c9){if(_0x16e7c9&&_0x16e7c9['autoAssociation']===0x0){return db['UserProfileResource'][_0xfed8('0x4b')]({'name':_0x48254e[_0xfed8('0x2c')],'resourceId':_0x48254e['id'],'type':'DefaultReports','sectionId':_0x16e7c9['id']},{})['then'](function(){return _0x2447a7;});}else{return _0x2447a7;}})[_0xfed8('0x52')](function(_0x28d6b3){logger['error'](_0xfed8('0x53'),_0x28d6b3);throw _0x28d6b3;});}return _0x2447a7;})[_0xfed8('0x25')](respondWithResult(_0x25f8ae,0xc9))[_0xfed8('0x52')](handleError(_0x25f8ae,null));};exports['update']=function(_0x46bd0c,_0x210183){if(_0x46bd0c['body']['id']){delete _0x46bd0c[_0xfed8('0x4c')]['id'];}return db[_0xfed8('0x2f')][_0xfed8('0x4a')]({'where':{'id':_0x46bd0c[_0xfed8('0x47')]['id']}})[_0xfed8('0x25')](handleEntityNotFound(_0x210183,null))[_0xfed8('0x25')](saveUpdates(_0x46bd0c[_0xfed8('0x4c')],null))[_0xfed8('0x25')](respondWithResult(_0x210183,null))[_0xfed8('0x52')](handleError(_0x210183,null));};exports[_0xfed8('0x26')]=function(_0x51d379,_0x4bdb90){return db['AnalyticDefaultReport'][_0xfed8('0x4a')]({'where':{'id':_0x51d379[_0xfed8('0x47')]['id']}})[_0xfed8('0x25')](handleEntityNotFound(_0x4bdb90,null))[_0xfed8('0x25')](removeEntity(_0x4bdb90,null))['catch'](handleError(_0x4bdb90,null));};exports[_0xfed8('0x54')]=function(_0x18c2ab,_0x32ab4f){var _0x1b4e52=0xa;var _0x4f672e=[_0xfed8('0x55'),_0xfed8('0x56'),'right_join','cross_join'];var _0x525ed9={'SUM':_0xfed8('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfed8('0x58'),'MAX':'MAX(%s)','MIN':_0xfed8('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfed8('0x5a'),'GROUP_CONCAT ASC':_0xfed8('0x5b'),'GROUP_CONCAT DESC':_0xfed8('0x5c')};var _0x3ae978={'SEC_TO_TIME':_0xfed8('0x5d'),'DATE':_0xfed8('0x5e'),'HOUR':_0xfed8('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xfed8('0x60')};var _0x14cfaf=function(_0x5e0b2d){return!_[_0xfed8('0x61')](['IS\x20NULL',_0xfed8('0x62'),_0xfed8('0x63'),_0xfed8('0x64')],_0x5e0b2d);};var _0x285ca3=function(_0x3e03f3){if(!_0x3e03f3||!_0x3e03f3[_0xfed8('0x65')]['length']){return'';}for(var _0x6c1768='(',_0x37b3c6=0x0;_0x37b3c6<_0x3e03f3['rules'][_0xfed8('0x37')];_0x37b3c6+=0x1){_0x37b3c6>0x0&&(_0x6c1768+='\x20'+_0x3e03f3[_0xfed8('0x66')]+'\x20');_0x6c1768+=_0x3e03f3[_0xfed8('0x65')][_0x37b3c6][_0xfed8('0x67')]?_0x285ca3(_0x3e03f3[_0xfed8('0x65')][_0x37b3c6][_0xfed8('0x67')]):_0x3e03f3[_0xfed8('0x65')][_0x37b3c6][_0xfed8('0x40')]+'\x20'+_0x3e03f3['rules'][_0x37b3c6]['condition']+(_0x14cfaf(_0x3e03f3[_0xfed8('0x65')][_0x37b3c6][_0xfed8('0x68')])?'\x20'+_0x3e03f3['rules'][_0x37b3c6][_0xfed8('0x69')]:'');}return _0x6c1768+')';};var _0x32753a={'where':{'id':_0x18c2ab[_0xfed8('0x47')]['id']}},_0x505cbf,_0x24c140,_0x2bb8ef,_0x3a3087,_0x38b3e8;_0x32753a=_['merge']({},_0x32753a,_0x18c2ab[_0xfed8('0x42')]);return db[_0xfed8('0x2f')][_0xfed8('0x4a')](_0x32753a)[_0xfed8('0x25')](function(_0x51e01b){if(_0x51e01b){_0x505cbf=_0x51e01b;return _0x51e01b[_0xfed8('0x6a')]();}return null;})[_0xfed8('0x25')](function(_0x4efed7){if(_0x4efed7){if(!_0x4efed7[_0xfed8('0x37')]){throw new db[(_0xfed8('0x6b'))][(_0xfed8('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x24c140=_0x4efed7;return db[_0xfed8('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xfed8('0x25')](function(_0x38b56e){if(_0x38b56e){_0x2bb8ef=_[_0xfed8('0x6e')](_0x38b56e,'id');var _0x15c62b;var _0x31665c=squel[_0xfed8('0x6f')]();_0x31665c['from'](_0x505cbf[_0xfed8('0x70')]);for(var _0x85982b=0x0;_0x85982b<_0x24c140['length'];_0x85982b+=0x1){_0x15c62b=_0x24c140[_0x85982b][_0xfed8('0x71')]?_0x2bb8ef[_0x24c140[_0x85982b][_0xfed8('0x71')]][_0xfed8('0x72')]:_0x24c140[_0x85982b][_0xfed8('0x40')];_0x15c62b=_0x24c140[_0x85982b][_0xfed8('0x73')]?_['replace'](_0x525ed9[_0x24c140[_0x85982b][_0xfed8('0x73')]],'%s',_0x15c62b):_0x15c62b;_0x15c62b=_0x24c140[_0x85982b][_0xfed8('0x74')]?_[_0xfed8('0x75')](_0x3ae978[_0x24c140[_0x85982b][_0xfed8('0x74')]],'%s',_0x15c62b):_0x15c62b;if(_0x24c140[_0x85982b][_0xfed8('0x76')]){_0x31665c[_0xfed8('0x67')](_0x15c62b);}_0x24c140[_0x85982b][_0xfed8('0x77')]&&_0x31665c['order'](_0x15c62b,_0x24c140[_0x85982b][_0xfed8('0x77')]==='DESC'?![]:!![]);_0x31665c[_0xfed8('0x40')](_0x15c62b,_0x24c140[_0x85982b][_0xfed8('0x78')]||_0x15c62b);}if(_0x505cbf[_0xfed8('0x79')]){_0x505cbf['joins']=JSON[_0xfed8('0x7a')](_0x505cbf[_0xfed8('0x79')]);for(var _0x4e381c=0x0;_0x4e381c<_0x505cbf[_0xfed8('0x79')][_0xfed8('0x37')];_0x4e381c+=0x1){if(_0x505cbf[_0xfed8('0x79')][_0x4e381c][_0xfed8('0x3f')]&&_[_0xfed8('0x61')](_0x4f672e,_0x505cbf['joins'][_0x4e381c][_0xfed8('0x3f')])&&_0x505cbf[_0xfed8('0x79')][_0x4e381c][_0xfed8('0x7b')]&&_0x505cbf[_0xfed8('0x79')][_0x4e381c]['foreignTable']&&_0x505cbf['joins'][_0x4e381c]['foreignKey']){_0x31665c[_0x505cbf[_0xfed8('0x79')][_0x4e381c][_0xfed8('0x3f')]](_0x505cbf[_0xfed8('0x79')][_0x4e381c]['foreignTable'],null,util[_0xfed8('0x74')](_0xfed8('0x7c'),_0x505cbf['table'],_0x505cbf[_0xfed8('0x79')][_0x4e381c][_0xfed8('0x7b')],_0x505cbf[_0xfed8('0x79')][_0x4e381c][_0xfed8('0x7d')],_0x505cbf[_0xfed8('0x79')][_0x4e381c][_0xfed8('0x7e')]));}}}if(_0x505cbf[_0xfed8('0x7f')]){_0x505cbf['conditions']=JSON['parse'](_0x505cbf[_0xfed8('0x7f')]);_0x31665c[_0xfed8('0x3d')](_0x285ca3(_0x505cbf[_0xfed8('0x7f')][_0xfed8('0x67')]));}_0x38b3e8=_0x31665c[_0xfed8('0x80')]();_0x31665c[_0xfed8('0x1f')](_0x1b4e52);_0x31665c[_0xfed8('0x1e')](0x0);logger[_0xfed8('0x81')](_0xfed8('0x82'),_0x31665c['toString']());return db[_0xfed8('0x83')][_0xfed8('0x32')](_0x31665c[_0xfed8('0x84')](),{'type':db[_0xfed8('0x83')][_0xfed8('0x85')][_0xfed8('0x86')]});}})['then'](respondWithResult(_0x32ab4f,null))[_0xfed8('0x52')](handleError(_0x32ab4f,null));};function runReport(_0x4c062b,_0x4333b9,_0x48a048){var _0x4fab50=_0x4333b9[_0xfed8('0x2c')];var _0x453baf=0xa;var _0x1bc98e=[_0xfed8('0x55'),_0xfed8('0x56'),_0xfed8('0x87'),_0xfed8('0x88')];var _0x2c503d={'SUM':_0xfed8('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfed8('0x58'),'MAX':'MAX(%s)','MIN':_0xfed8('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfed8('0x5a'),'GROUP_CONCAT ASC':_0xfed8('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x39db80={'SEC_TO_TIME':_0xfed8('0x5d'),'DATE':_0xfed8('0x5e'),'HOUR':_0xfed8('0x5f'),'ROUND':_0xfed8('0x89'),'UNIX_TIMESTAMP':_0xfed8('0x60')};var _0x176200=function(_0x3518a4){return!_[_0xfed8('0x61')]([_0xfed8('0x8a'),_0xfed8('0x62'),'IS\x20EMPTY',_0xfed8('0x64')],_0x3518a4);};var _0x3a87c9=function(_0x2b8397){if(!_0x2b8397||!_0x2b8397[_0xfed8('0x65')]['length']){return'';}for(var _0xe9d1e='(',_0x1fe58f=0x0;_0x1fe58f<_0x2b8397[_0xfed8('0x65')][_0xfed8('0x37')];_0x1fe58f+=0x1){_0x1fe58f>0x0&&(_0xe9d1e+='\x20'+_0x2b8397[_0xfed8('0x66')]+'\x20');_0xe9d1e+=_0x2b8397[_0xfed8('0x65')][_0x1fe58f][_0xfed8('0x67')]?_0x3a87c9(_0x2b8397['rules'][_0x1fe58f][_0xfed8('0x67')]):_0x2b8397[_0xfed8('0x65')][_0x1fe58f][_0xfed8('0x40')]+'\x20'+_0x2b8397[_0xfed8('0x65')][_0x1fe58f]['condition']+(_0x176200(_0x2b8397[_0xfed8('0x65')][_0x1fe58f][_0xfed8('0x68')])?'\x20'+_0x2b8397['rules'][_0x1fe58f][_0xfed8('0x69')]:'');}return _0xe9d1e+')';};var _0x22405c={'where':{'id':_0x4c062b['id']}},_0x14e2b5,_0x4c0849,_0x3ee6b0,_0x57515c,_0x206ff4;_0x22405c=_[_0xfed8('0x3e')]({},_0x22405c,_0x48a048);return db[_0xfed8('0x2f')][_0xfed8('0x4a')](_0x22405c)[_0xfed8('0x25')](function(_0x2d119c){if(_0x2d119c){_0x14e2b5=_0x2d119c;return _0x2d119c[_0xfed8('0x6a')]();}return null;})[_0xfed8('0x25')](function(_0x1c6619){if(_0x1c6619){if(!_0x1c6619[_0xfed8('0x37')]){throw new db['Sequelize'][(_0xfed8('0x6c'))](_0xfed8('0x8b'),0x193);}_0x4c0849=_0x1c6619;return db[_0xfed8('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xfed8('0x25')](function(_0x2ba163){if(_0x2ba163){_0x3ee6b0=_[_0xfed8('0x6e')](_0x2ba163,'id');var _0x5e9afe;var _0x3779ca=squel[_0xfed8('0x6f')]();_0x3779ca[_0xfed8('0x8c')](_0x14e2b5[_0xfed8('0x70')]);for(var _0x4164ce=0x0;_0x4164ce<_0x4c0849['length'];_0x4164ce+=0x1){_0x5e9afe=_0x4c0849[_0x4164ce][_0xfed8('0x71')]?_0x3ee6b0[_0x4c0849[_0x4164ce][_0xfed8('0x71')]]['metric']:_0x4c0849[_0x4164ce][_0xfed8('0x40')];_0x5e9afe=_0x4c0849[_0x4164ce][_0xfed8('0x73')]?_[_0xfed8('0x75')](_0x2c503d[_0x4c0849[_0x4164ce][_0xfed8('0x73')]],'%s',_0x5e9afe):_0x5e9afe;_0x5e9afe=_0x4c0849[_0x4164ce][_0xfed8('0x74')]?_[_0xfed8('0x75')](_0x39db80[_0x4c0849[_0x4164ce][_0xfed8('0x74')]],'%s',_0x5e9afe):_0x5e9afe;if(_0x4c0849[_0x4164ce][_0xfed8('0x76')]){_0x3779ca['group'](_0x5e9afe);}_0x4c0849[_0x4164ce][_0xfed8('0x77')]&&_0x3779ca['order'](_0x5e9afe,_0x4c0849[_0x4164ce][_0xfed8('0x77')]===_0xfed8('0x8d')?![]:!![]);_0x3779ca[_0xfed8('0x40')](_0x5e9afe,_0x4c0849[_0x4164ce][_0xfed8('0x78')]||_0x5e9afe);}if(_0x14e2b5[_0xfed8('0x79')]){_0x14e2b5['joins']=JSON[_0xfed8('0x7a')](_0x14e2b5['joins']);for(var _0x2f6610=0x0;_0x2f6610<_0x14e2b5[_0xfed8('0x79')][_0xfed8('0x37')];_0x2f6610+=0x1){if(_0x14e2b5[_0xfed8('0x79')][_0x2f6610][_0xfed8('0x3f')]&&_[_0xfed8('0x61')](_0x1bc98e,_0x14e2b5['joins'][_0x2f6610]['type'])&&_0x14e2b5[_0xfed8('0x79')][_0x2f6610][_0xfed8('0x7b')]&&_0x14e2b5[_0xfed8('0x79')][_0x2f6610][_0xfed8('0x7d')]&&_0x14e2b5[_0xfed8('0x79')][_0x2f6610][_0xfed8('0x7e')]){_0x3779ca[_0x14e2b5['joins'][_0x2f6610][_0xfed8('0x3f')]](_0x14e2b5['joins'][_0x2f6610]['foreignTable'],null,util[_0xfed8('0x74')](_0xfed8('0x7c'),_0x14e2b5[_0xfed8('0x70')],_0x14e2b5[_0xfed8('0x79')][_0x2f6610][_0xfed8('0x7b')],_0x14e2b5['joins'][_0x2f6610][_0xfed8('0x7d')],_0x14e2b5[_0xfed8('0x79')][_0x2f6610][_0xfed8('0x7e')]));}}}if(_0x14e2b5[_0xfed8('0x7f')]){_0x14e2b5[_0xfed8('0x7f')]=JSON[_0xfed8('0x7a')](_0x14e2b5[_0xfed8('0x7f')]);_0x3779ca[_0xfed8('0x3d')](_0x3a87c9(_0x14e2b5['conditions'][_0xfed8('0x67')]));}_0x206ff4=_0x3779ca[_0xfed8('0x80')]();_0x3779ca['limit'](_0x453baf);_0x3779ca[_0xfed8('0x1e')](0x0);logger[_0xfed8('0x81')](_0xfed8('0x82'),_0x3779ca[_0xfed8('0x84')]());return db[_0xfed8('0x83')][_0xfed8('0x32')](_0x3779ca[_0xfed8('0x84')](),{'type':db['sequelize'][_0xfed8('0x85')][_0xfed8('0x86')]});}})[_0xfed8('0x25')](function(_0x391803){if(!_0x391803['length']){throw new db[(_0xfed8('0x6b'))]['ValidationErrorItem'](_0xfed8('0x8e'),0xcc);}if(_0x4333b9['output']===_0xfed8('0x8f')){return null;}var _0x4b627a=_['merge'](_0x4333b9,{'name':_0x4333b9['fullPath']||_0x4333b9[_0xfed8('0x2c')]||_0x14e2b5[_0xfed8('0x2c')],'basename':_0x4fab50,'savename':util['format'](_0xfed8('0x90'),_0x4333b9[_0xfed8('0x2c')]||_0x14e2b5[_0xfed8('0x2c')],require(_0xfed8('0x91'))['generate'](0x4),_0x4333b9['output']||_0xfed8('0x92')),'reportId':_0x14e2b5['id'],'reportType':_0xfed8('0x93')});return db[_0xfed8('0x94')][_0xfed8('0x4b')](_0x4b627a,{'raw':!![]});})[_0xfed8('0x25')](function(_0x4f5dd7){if(_0x14e2b5['table']==='cdr'){_0x206ff4[_0xfed8('0x3d')](_0x14e2b5[_0xfed8('0x70')]+_0xfed8('0x95'),_0x4333b9[_0xfed8('0x96')],_0x4333b9['endDate']);}else{_0x206ff4['where'](_0x14e2b5['table']+_0xfed8('0x97'),_0x4333b9['startDate'],_0x4333b9[_0xfed8('0x98')]);}if(_0x4f5dd7){logger['info']('Run\x20Query:',_0x206ff4[_0xfed8('0x84')]());require('child_process')[_0xfed8('0x99')](path[_0xfed8('0x55')](__dirname,_0xfed8('0x9a'),_0x4f5dd7['output']),[_0x4f5dd7['id'],_0x206ff4['toString'](),path[_0xfed8('0x55')](__dirname,_0xfed8('0x9b'),_0x4f5dd7[_0xfed8('0x9c')]),_0x4fab50]);return _0x4f5dd7;}else{var _0x1ee32e=squel[_0xfed8('0x6f')]();_0x1ee32e['from']('('+_0x206ff4['toString']()+')',_0xfed8('0x9d'));_0x1ee32e[_0xfed8('0x40')](_0xfed8('0x9e'),_0xfed8('0x1d'));_0x206ff4['limit'](_0x4333b9[_0xfed8('0x1f')]||_0x453baf);_0x206ff4[_0xfed8('0x1e')](_0x4333b9['offset']||0x0);return db['sequelize']['query'](_0x1ee32e['toString'](),{'type':db[_0xfed8('0x83')][_0xfed8('0x85')]['SELECT']})['then'](function(_0x4e8af2){if(!_0x4e8af2[_0xfed8('0x37')]){_0x57515c=0x0;}else{_0x57515c=_0x4e8af2[0x0][_0xfed8('0x1d')]||0x0;}return db[_0xfed8('0x83')][_0xfed8('0x32')](_0x206ff4['toString'](),{'type':db[_0xfed8('0x83')]['QueryTypes'][_0xfed8('0x86')]});})[_0xfed8('0x25')](function(_0x4cf255){return{'rows':_0x4cf255||[],'count':_0x57515c};});}});}exports[_0xfed8('0x9f')]=function(_0x247540,_0x181ada){return runReport(_0x247540[_0xfed8('0x47')],_0x247540[_0xfed8('0x32')],_0x247540[_0xfed8('0x42')])[_0xfed8('0x25')](respondWithResult(_0x181ada,null))[_0xfed8('0x52')](handleError(_0x181ada,null));};exports[_0xfed8('0xa0')]=runReport;exports[_0xfed8('0x32')]=function(_0x5380ee,_0xbc2b83){var _0x23f8e9=0xa;var _0x3bafd0=[_0xfed8('0x55'),'left_join','right_join',_0xfed8('0x88')];var _0x527539={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfed8('0x58'),'MAX':_0xfed8('0xa1'),'MIN':_0xfed8('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfed8('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfed8('0x5c')};var _0x4f4a8d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfed8('0x5e'),'HOUR':_0xfed8('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xfed8('0x60')};var _0x5f3721=function(_0x28f459){return!_[_0xfed8('0x61')]([_0xfed8('0x8a'),'IS\x20NOT\x20NULL',_0xfed8('0x63'),_0xfed8('0x64')],_0x28f459);};var _0x1ac2da=function(_0x2131f0){if(!_0x2131f0||!_0x2131f0[_0xfed8('0x65')][_0xfed8('0x37')]){return'';}for(var _0x253bb2='(',_0x425a34=0x0;_0x425a34<_0x2131f0['rules'][_0xfed8('0x37')];_0x425a34+=0x1){_0x425a34>0x0&&(_0x253bb2+='\x20'+_0x2131f0[_0xfed8('0x66')]+'\x20');_0x253bb2+=_0x2131f0['rules'][_0x425a34][_0xfed8('0x67')]?_0x1ac2da(_0x2131f0[_0xfed8('0x65')][_0x425a34][_0xfed8('0x67')]):_0x2131f0['rules'][_0x425a34][_0xfed8('0x40')]+'\x20'+_0x2131f0['rules'][_0x425a34][_0xfed8('0x68')]+(_0x5f3721(_0x2131f0[_0xfed8('0x65')][_0x425a34][_0xfed8('0x68')])?'\x20'+_0x2131f0[_0xfed8('0x65')][_0x425a34][_0xfed8('0x69')]:'');}return _0x253bb2+')';};var _0xf871cd={'where':{'id':_0x5380ee['params']['id']}},_0x2a59cc,_0x2bb937,_0x1ed0f4,_0x42d41d,_0x1ea343;_0xf871cd=_['merge']({},_0xf871cd,_0x5380ee['options']);return db[_0xfed8('0x2f')][_0xfed8('0x4a')](_0xf871cd)[_0xfed8('0x25')](function(_0x33e62e){if(_0x33e62e){_0x2a59cc=_0x33e62e;return _0x33e62e[_0xfed8('0x6a')]();}return null;})[_0xfed8('0x25')](function(_0x73951e){if(_0x73951e){if(!_0x73951e[_0xfed8('0x37')]){throw new db['Sequelize'][(_0xfed8('0x6c'))](_0xfed8('0x8b'),0x193);}_0x2bb937=_0x73951e;return db[_0xfed8('0x6d')][_0xfed8('0x44')]({'raw':!![]});}return null;})['then'](function(_0x40a3bc){if(_0x40a3bc){_0x1ed0f4=_[_0xfed8('0x6e')](_0x40a3bc,'id');var _0x4dfbee;var _0x571277=squel[_0xfed8('0x6f')]();_0x571277[_0xfed8('0x8c')](_0x2a59cc[_0xfed8('0x70')]);for(var _0x53155c=0x0;_0x53155c<_0x2bb937[_0xfed8('0x37')];_0x53155c+=0x1){_0x4dfbee=_0x2bb937[_0x53155c]['MetricId']?_0x1ed0f4[_0x2bb937[_0x53155c]['MetricId']]['metric']:_0x2bb937[_0x53155c][_0xfed8('0x40')];_0x4dfbee=_0x2bb937[_0x53155c]['function']?_['replace'](_0x527539[_0x2bb937[_0x53155c][_0xfed8('0x73')]],'%s',_0x4dfbee):_0x4dfbee;_0x4dfbee=_0x2bb937[_0x53155c][_0xfed8('0x74')]?_[_0xfed8('0x75')](_0x4f4a8d[_0x2bb937[_0x53155c][_0xfed8('0x74')]],'%s',_0x4dfbee):_0x4dfbee;if(_0x2bb937[_0x53155c][_0xfed8('0x76')]){_0x571277['group'](_0x4dfbee);}_0x2bb937[_0x53155c][_0xfed8('0x77')]&&_0x571277[_0xfed8('0x3a')](_0x4dfbee,_0x2bb937[_0x53155c][_0xfed8('0x77')]===_0xfed8('0x8d')?![]:!![]);_0x571277[_0xfed8('0x40')](_0x4dfbee,_0x2bb937[_0x53155c]['alias']||_0x4dfbee);}if(_0x2a59cc[_0xfed8('0x79')]){_0x2a59cc[_0xfed8('0x79')]=JSON[_0xfed8('0x7a')](_0x2a59cc[_0xfed8('0x79')]);for(var _0x345d24=0x0;_0x345d24<_0x2a59cc[_0xfed8('0x79')]['length'];_0x345d24+=0x1){if(_0x2a59cc[_0xfed8('0x79')][_0x345d24][_0xfed8('0x3f')]&&_[_0xfed8('0x61')](_0x3bafd0,_0x2a59cc[_0xfed8('0x79')][_0x345d24][_0xfed8('0x3f')])&&_0x2a59cc[_0xfed8('0x79')][_0x345d24][_0xfed8('0x7b')]&&_0x2a59cc[_0xfed8('0x79')][_0x345d24][_0xfed8('0x7d')]&&_0x2a59cc[_0xfed8('0x79')][_0x345d24][_0xfed8('0x7e')]){_0x571277[_0x2a59cc['joins'][_0x345d24][_0xfed8('0x3f')]](_0x2a59cc[_0xfed8('0x79')][_0x345d24]['foreignTable'],null,util[_0xfed8('0x74')](_0xfed8('0x7c'),_0x2a59cc[_0xfed8('0x70')],_0x2a59cc[_0xfed8('0x79')][_0x345d24]['parentKey'],_0x2a59cc[_0xfed8('0x79')][_0x345d24][_0xfed8('0x7d')],_0x2a59cc[_0xfed8('0x79')][_0x345d24][_0xfed8('0x7e')]));}}}if(_0x2a59cc[_0xfed8('0x7f')]){_0x2a59cc['conditions']=JSON[_0xfed8('0x7a')](_0x2a59cc[_0xfed8('0x7f')]);_0x571277[_0xfed8('0x3d')](_0x1ac2da(_0x2a59cc[_0xfed8('0x7f')][_0xfed8('0x67')]));}_0x1ea343=_0x571277[_0xfed8('0x80')]();_0x571277[_0xfed8('0x1f')](_0x23f8e9);_0x571277[_0xfed8('0x1e')](0x0);logger['debug'](_0xfed8('0x82'),_0x571277[_0xfed8('0x84')]());return db[_0xfed8('0x83')][_0xfed8('0x32')](_0x571277[_0xfed8('0x84')](),{'type':db['sequelize']['QueryTypes'][_0xfed8('0x86')]});}})[_0xfed8('0x25')](function(){return{'sql':_0x1ea343[_0xfed8('0x84')]()};})[_0xfed8('0x25')](respondWithResult(_0xbc2b83,null))[_0xfed8('0x52')](handleError(_0xbc2b83,null));}; \ No newline at end of file +var _0x8ee2=['model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','where','filters','filter','merge','map','type','key','VIRTUAL','options','count','includeAll','findAll','rows','catch','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','select','from','table','MetricId','function','replace','format','orderBy','DESC','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','sequelize','QueryTypes','join','COUNT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','Sequelize','metric','groupBy','alias','debug','toString','SELECT','No\x20available\x20data','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','run','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','rimraf','zip-dir','request-promise','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','update','destroy','get','DefaultReports','UserProfileResource','then','error','stack','name','send','AnalyticDefaultReport','rawAttributes'];(function(_0x35a7c3,_0x95d27c){var _0x7c6316=function(_0x346a2c){while(--_0x346a2c){_0x35a7c3['push'](_0x35a7c3['shift']());}};_0x7c6316(++_0x95d27c);}(_0x8ee2,0x1b0));var _0x28ee=function(_0x591180,_0x41ec6a){_0x591180=_0x591180-0x0;var _0x1e5c47=_0x8ee2[_0x591180];return _0x1e5c47;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x28ee('0x0'));var zipdir=require(_0x28ee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28ee('0x2'));var moment=require('moment');var BPromise=require(_0x28ee('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x28ee('0x4'));var sox=require('sox');var csv=require(_0x28ee('0x5'));var ejs=require(_0x28ee('0x6'));var fs=require('fs');var _=require(_0x28ee('0x7'));var squel=require(_0x28ee('0x8'));var crypto=require(_0x28ee('0x9'));var jsforce=require(_0x28ee('0xa'));var deskjs=require(_0x28ee('0xb'));var toCsv=require(_0x28ee('0x5'));var querystring=require(_0x28ee('0xc'));var Papa=require('papaparse');var authService=require(_0x28ee('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x28ee('0xe'));var qs=require(_0x28ee('0xf'));var logger=require(_0x28ee('0x10'))(_0x28ee('0x11'));var utils=require(_0x28ee('0x12'));var config=require(_0x28ee('0x13'));var db=require(_0x28ee('0x14'))['db'];function respondWithStatusCode(_0x10d1b3,_0x20562e){_0x20562e=_0x20562e||0xcc;return function(_0x50f9f4){if(_0x50f9f4){return _0x10d1b3[_0x28ee('0x15')](_0x20562e);}return _0x10d1b3[_0x28ee('0x16')](_0x20562e)[_0x28ee('0x17')]();};}function respondWithResult(_0x34c445,_0x383e28){_0x383e28=_0x383e28||0xc8;return function(_0x56aa3d){if(_0x56aa3d){return _0x34c445[_0x28ee('0x16')](_0x383e28)['json'](_0x56aa3d);}};}function respondWithFilteredResult(_0x42e792,_0x1ac885){return function(_0x5a4cc5){if(_0x5a4cc5){var _0x1b2f29=_0x5a4cc5['count'],_0x433a73=_0x1ac885[_0x28ee('0x18')],_0x3ecd98=_0x1ac885[_0x28ee('0x18')]+_0x1ac885[_0x28ee('0x19')],_0x30acb1;if(_0x3ecd98>=_0x1b2f29){_0x3ecd98=_0x1b2f29;_0x30acb1=0xc8;}else{_0x30acb1=0xce;}_0x42e792[_0x28ee('0x16')](_0x30acb1);return _0x42e792[_0x28ee('0x1a')](_0x28ee('0x1b'),_0x433a73+'-'+_0x3ecd98+'/'+_0x1b2f29)[_0x28ee('0x1c')](_0x5a4cc5);}return null;};}function patchUpdates(_0x381204){return function(_0x51bd35){try{jsonpatch[_0x28ee('0x1d')](_0x51bd35,_0x381204,!![]);}catch(_0x4c3567){return BPromise['reject'](_0x4c3567);}return _0x51bd35['save']();};}function saveUpdates(_0x4368b5,_0x1c001a){return function(_0x2906f8){if(_0x2906f8){return _0x2906f8[_0x28ee('0x1e')](_0x4368b5)['then'](function(_0x2fdc8b){return _0x2fdc8b;});}return null;};}function removeEntity(_0x1d9feb,_0x17980a){return function(_0x170f66){if(_0x170f66){return _0x170f66[_0x28ee('0x1f')]()['then'](function(){var _0x4932e4=_0x170f66[_0x28ee('0x20')]({'plain':!![]});var _0x1b0efb=_0x28ee('0x21');return db[_0x28ee('0x22')][_0x28ee('0x1f')]({'where':{'type':_0x1b0efb,'resourceId':_0x4932e4['id']}})[_0x28ee('0x23')](function(){return _0x170f66;});})['then'](function(){_0x1d9feb['status'](0xcc)[_0x28ee('0x17')]();});}};}function handleEntityNotFound(_0x4910c4,_0x4a1bc3){return function(_0x30ff4e){if(!_0x30ff4e){_0x4910c4['sendStatus'](0x194);}return _0x30ff4e;};}function handleError(_0x169712,_0x4330a3){_0x4330a3=_0x4330a3||0x1f4;return function(_0x47c001){logger[_0x28ee('0x24')](_0x47c001[_0x28ee('0x25')]);if(_0x47c001[_0x28ee('0x26')]){delete _0x47c001[_0x28ee('0x26')];}_0x169712[_0x28ee('0x16')](_0x4330a3)[_0x28ee('0x27')](_0x47c001);};}exports['index']=function(_0x41c0a0,_0xc1f192){var _0x4ee392={},_0x10c7eb={},_0x270651={'count':0x0,'rows':[]};var _0x517c5a=db[_0x28ee('0x28')][_0x28ee('0x29')];_0x10c7eb[_0x28ee('0x2a')]=_[_0x28ee('0x2b')](_0x517c5a);_0x10c7eb['query']=_[_0x28ee('0x2b')](_0x41c0a0[_0x28ee('0x2c')]);_0x10c7eb['filters']=_[_0x28ee('0x2d')](_0x10c7eb[_0x28ee('0x2a')],_0x10c7eb[_0x28ee('0x2c')]);_0x4ee392['attributes']=_['intersection'](_0x10c7eb['model'],qs[_0x28ee('0x2e')](_0x41c0a0[_0x28ee('0x2c')]['fields']));_0x4ee392[_0x28ee('0x2f')]=_0x4ee392[_0x28ee('0x2f')][_0x28ee('0x30')]?_0x4ee392[_0x28ee('0x2f')]:_0x10c7eb[_0x28ee('0x2a')];if(!_0x41c0a0[_0x28ee('0x2c')][_0x28ee('0x31')]('nolimit')){_0x4ee392['limit']=qs[_0x28ee('0x19')](_0x41c0a0[_0x28ee('0x2c')][_0x28ee('0x19')]);_0x4ee392['offset']=qs[_0x28ee('0x18')](_0x41c0a0[_0x28ee('0x2c')][_0x28ee('0x18')]);}_0x4ee392[_0x28ee('0x32')]=qs['sort'](_0x41c0a0['query']['sort']);_0x4ee392[_0x28ee('0x33')]=qs[_0x28ee('0x34')](_['pick'](_0x41c0a0[_0x28ee('0x2c')],_0x10c7eb['filters']));if(_0x41c0a0[_0x28ee('0x2c')][_0x28ee('0x35')]){_0x4ee392['where']=_[_0x28ee('0x36')](_0x4ee392[_0x28ee('0x33')],{'$or':_[_0x28ee('0x37')](_0x517c5a,function(_0x1c21f5){if(_0x1c21f5[_0x28ee('0x38')][_0x28ee('0x39')]!==_0x28ee('0x3a')){var _0x3ae5dc={};_0x3ae5dc[_0x1c21f5['field']]={'$like':'%'+_0x41c0a0[_0x28ee('0x2c')][_0x28ee('0x35')]+'%'};return _0x3ae5dc;}})});}_0x4ee392=_[_0x28ee('0x36')]({},_0x4ee392,_0x41c0a0[_0x28ee('0x3b')]);var _0x4c2ab2={'where':_0x4ee392[_0x28ee('0x33')]};return db[_0x28ee('0x28')][_0x28ee('0x3c')](_0x4c2ab2)[_0x28ee('0x23')](function(_0x2e8d2b){_0x270651['count']=_0x2e8d2b;if(_0x41c0a0[_0x28ee('0x2c')][_0x28ee('0x3d')]){_0x4ee392['include']=[{'all':!![]}];}return db[_0x28ee('0x28')][_0x28ee('0x3e')](_0x4ee392);})[_0x28ee('0x23')](function(_0x1e249f){_0x270651[_0x28ee('0x3f')]=_0x1e249f;return _0x270651;})[_0x28ee('0x23')](respondWithFilteredResult(_0xc1f192,_0x4ee392))[_0x28ee('0x40')](handleError(_0xc1f192,null));};exports['show']=function(_0x3196b7,_0x27a57e){var _0x12792b={'raw':!![],'where':{'id':_0x3196b7[_0x28ee('0x41')]['id']}},_0x5b023a={};_0x5b023a[_0x28ee('0x2a')]=_['keys'](db[_0x28ee('0x28')][_0x28ee('0x29')]);_0x5b023a[_0x28ee('0x2c')]=_[_0x28ee('0x2b')](_0x3196b7['query']);_0x5b023a[_0x28ee('0x34')]=_['intersection'](_0x5b023a[_0x28ee('0x2a')],_0x5b023a['query']);_0x12792b[_0x28ee('0x2f')]=_[_0x28ee('0x2d')](_0x5b023a[_0x28ee('0x2a')],qs['fields'](_0x3196b7['query'][_0x28ee('0x2e')]));_0x12792b[_0x28ee('0x2f')]=_0x12792b[_0x28ee('0x2f')][_0x28ee('0x30')]?_0x12792b[_0x28ee('0x2f')]:_0x5b023a[_0x28ee('0x2a')];if(_0x3196b7['query'][_0x28ee('0x3d')]){_0x12792b[_0x28ee('0x42')]=[{'all':!![]}];}_0x12792b=_['merge']({},_0x12792b,_0x3196b7[_0x28ee('0x3b')]);return db[_0x28ee('0x28')]['find'](_0x12792b)[_0x28ee('0x23')](handleEntityNotFound(_0x27a57e,null))[_0x28ee('0x23')](respondWithResult(_0x27a57e,null))[_0x28ee('0x40')](handleError(_0x27a57e,null));};exports['create']=function(_0x69673d,_0x2252f8){return db['AnalyticDefaultReport'][_0x28ee('0x43')](_0x69673d[_0x28ee('0x44')],{})[_0x28ee('0x23')](function(_0x179826){var _0x4fa7d9=_0x69673d[_0x28ee('0x45')][_0x28ee('0x20')]({'plain':!![]});if(!_0x4fa7d9)throw new Error(_0x28ee('0x46'));if(_0x4fa7d9[_0x28ee('0x47')]===_0x28ee('0x45')){var _0x14defb=_0x179826[_0x28ee('0x20')]({'plain':!![]});var _0xf7a9d1=_0x28ee('0x48');return db[_0x28ee('0x49')][_0x28ee('0x4a')]({'where':{'name':_0xf7a9d1,'userProfileId':_0x4fa7d9[_0x28ee('0x4b')]},'raw':!![]})[_0x28ee('0x23')](function(_0x4ec1a6){if(_0x4ec1a6&&_0x4ec1a6[_0x28ee('0x4c')]===0x0){return db[_0x28ee('0x22')][_0x28ee('0x43')]({'name':_0x14defb[_0x28ee('0x26')],'resourceId':_0x14defb['id'],'type':_0x28ee('0x21'),'sectionId':_0x4ec1a6['id']},{})[_0x28ee('0x23')](function(){return _0x179826;});}else{return _0x179826;}})[_0x28ee('0x40')](function(_0x206655){logger[_0x28ee('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x206655);throw _0x206655;});}return _0x179826;})[_0x28ee('0x23')](respondWithResult(_0x2252f8,0xc9))[_0x28ee('0x40')](handleError(_0x2252f8,null));};exports[_0x28ee('0x1e')]=function(_0x97591b,_0x134586){if(_0x97591b[_0x28ee('0x44')]['id']){delete _0x97591b[_0x28ee('0x44')]['id'];}return db['AnalyticDefaultReport'][_0x28ee('0x4a')]({'where':{'id':_0x97591b[_0x28ee('0x41')]['id']}})[_0x28ee('0x23')](handleEntityNotFound(_0x134586,null))[_0x28ee('0x23')](saveUpdates(_0x97591b[_0x28ee('0x44')],null))[_0x28ee('0x23')](respondWithResult(_0x134586,null))[_0x28ee('0x40')](handleError(_0x134586,null));};exports[_0x28ee('0x1f')]=function(_0x4fa1e2,_0x4e63f4){return db[_0x28ee('0x28')][_0x28ee('0x4a')]({'where':{'id':_0x4fa1e2[_0x28ee('0x41')]['id']}})[_0x28ee('0x23')](handleEntityNotFound(_0x4e63f4,null))['then'](removeEntity(_0x4e63f4,null))['catch'](handleError(_0x4e63f4,null));};exports[_0x28ee('0x4d')]=function(_0x31150e,_0x1baa4c){var _0x2605e7=0xa;var _0x57b283=['join',_0x28ee('0x4e'),_0x28ee('0x4f'),_0x28ee('0x50')];var _0x1e058b={'SUM':_0x28ee('0x51'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x28ee('0x52'),'MAX':_0x28ee('0x53'),'MIN':_0x28ee('0x54'),'AVG':_0x28ee('0x55'),'GROUP_CONCAT':_0x28ee('0x56'),'GROUP_CONCAT ASC':_0x28ee('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3528a3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x28ee('0x58'),'HOUR':_0x28ee('0x59'),'ROUND':_0x28ee('0x5a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x18607a=function(_0x2040fc){return!_[_0x28ee('0x5b')](['IS\x20NULL',_0x28ee('0x5c'),'IS\x20EMPTY',_0x28ee('0x5d')],_0x2040fc);};var _0xc0d94=function(_0x1aa526){if(!_0x1aa526||!_0x1aa526['rules']['length']){return'';}for(var _0x71ddae='(',_0x5017ae=0x0;_0x5017ae<_0x1aa526[_0x28ee('0x5e')][_0x28ee('0x30')];_0x5017ae+=0x1){_0x5017ae>0x0&&(_0x71ddae+='\x20'+_0x1aa526[_0x28ee('0x5f')]+'\x20');_0x71ddae+=_0x1aa526[_0x28ee('0x5e')][_0x5017ae][_0x28ee('0x60')]?_0xc0d94(_0x1aa526[_0x28ee('0x5e')][_0x5017ae][_0x28ee('0x60')]):_0x1aa526[_0x28ee('0x5e')][_0x5017ae][_0x28ee('0x61')]+'\x20'+_0x1aa526[_0x28ee('0x5e')][_0x5017ae]['condition']+(_0x18607a(_0x1aa526[_0x28ee('0x5e')][_0x5017ae][_0x28ee('0x62')])?'\x20'+_0x1aa526[_0x28ee('0x5e')][_0x5017ae][_0x28ee('0x63')]:'');}return _0x71ddae+')';};var _0x2cb04c={'where':{'id':_0x31150e[_0x28ee('0x41')]['id']}},_0x32bee4,_0x495e2a,_0x4c2e19,_0xb3b9b5,_0x14e999;_0x2cb04c=_[_0x28ee('0x36')]({},_0x2cb04c,_0x31150e['options']);return db[_0x28ee('0x28')][_0x28ee('0x4a')](_0x2cb04c)[_0x28ee('0x23')](function(_0x1ace2e){if(_0x1ace2e){_0x32bee4=_0x1ace2e;return _0x1ace2e[_0x28ee('0x64')]();}return null;})[_0x28ee('0x23')](function(_0x3afb90){if(_0x3afb90){if(!_0x3afb90[_0x28ee('0x30')]){throw new db['Sequelize'][(_0x28ee('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x495e2a=_0x3afb90;return db[_0x28ee('0x66')][_0x28ee('0x3e')]({'raw':!![]});}return null;})[_0x28ee('0x23')](function(_0x341d2f){if(_0x341d2f){_0x4c2e19=_['keyBy'](_0x341d2f,'id');var _0x3cd652;var _0x543307=squel[_0x28ee('0x67')]();_0x543307[_0x28ee('0x68')](_0x32bee4[_0x28ee('0x69')]);for(var _0x5bba8f=0x0;_0x5bba8f<_0x495e2a[_0x28ee('0x30')];_0x5bba8f+=0x1){_0x3cd652=_0x495e2a[_0x5bba8f][_0x28ee('0x6a')]?_0x4c2e19[_0x495e2a[_0x5bba8f][_0x28ee('0x6a')]]['metric']:_0x495e2a[_0x5bba8f][_0x28ee('0x61')];_0x3cd652=_0x495e2a[_0x5bba8f][_0x28ee('0x6b')]?_[_0x28ee('0x6c')](_0x1e058b[_0x495e2a[_0x5bba8f][_0x28ee('0x6b')]],'%s',_0x3cd652):_0x3cd652;_0x3cd652=_0x495e2a[_0x5bba8f]['format']?_[_0x28ee('0x6c')](_0x3528a3[_0x495e2a[_0x5bba8f][_0x28ee('0x6d')]],'%s',_0x3cd652):_0x3cd652;if(_0x495e2a[_0x5bba8f]['groupBy']){_0x543307['group'](_0x3cd652);}_0x495e2a[_0x5bba8f][_0x28ee('0x6e')]&&_0x543307[_0x28ee('0x32')](_0x3cd652,_0x495e2a[_0x5bba8f][_0x28ee('0x6e')]===_0x28ee('0x6f')?![]:!![]);_0x543307[_0x28ee('0x61')](_0x3cd652,_0x495e2a[_0x5bba8f]['alias']||_0x3cd652);}if(_0x32bee4['joins']){_0x32bee4['joins']=JSON[_0x28ee('0x70')](_0x32bee4[_0x28ee('0x71')]);for(var _0x5244e1=0x0;_0x5244e1<_0x32bee4[_0x28ee('0x71')]['length'];_0x5244e1+=0x1){if(_0x32bee4[_0x28ee('0x71')][_0x5244e1][_0x28ee('0x38')]&&_[_0x28ee('0x5b')](_0x57b283,_0x32bee4[_0x28ee('0x71')][_0x5244e1][_0x28ee('0x38')])&&_0x32bee4['joins'][_0x5244e1][_0x28ee('0x72')]&&_0x32bee4[_0x28ee('0x71')][_0x5244e1][_0x28ee('0x73')]&&_0x32bee4[_0x28ee('0x71')][_0x5244e1][_0x28ee('0x74')]){_0x543307[_0x32bee4[_0x28ee('0x71')][_0x5244e1][_0x28ee('0x38')]](_0x32bee4[_0x28ee('0x71')][_0x5244e1][_0x28ee('0x73')],null,util[_0x28ee('0x6d')](_0x28ee('0x75'),_0x32bee4[_0x28ee('0x69')],_0x32bee4[_0x28ee('0x71')][_0x5244e1][_0x28ee('0x72')],_0x32bee4[_0x28ee('0x71')][_0x5244e1][_0x28ee('0x73')],_0x32bee4[_0x28ee('0x71')][_0x5244e1][_0x28ee('0x74')]));}}}if(_0x32bee4[_0x28ee('0x76')]){_0x32bee4[_0x28ee('0x76')]=JSON[_0x28ee('0x70')](_0x32bee4[_0x28ee('0x76')]);_0x543307[_0x28ee('0x33')](_0xc0d94(_0x32bee4[_0x28ee('0x76')][_0x28ee('0x60')]));}_0x14e999=_0x543307[_0x28ee('0x77')]();_0x543307[_0x28ee('0x19')](_0x2605e7);_0x543307[_0x28ee('0x18')](0x0);logger['debug'](_0x28ee('0x78'),_0x543307['toString']());return db[_0x28ee('0x79')]['query'](_0x543307['toString'](),{'type':db[_0x28ee('0x79')][_0x28ee('0x7a')]['SELECT']});}})['then'](respondWithResult(_0x1baa4c,null))[_0x28ee('0x40')](handleError(_0x1baa4c,null));};function runReport(_0x21e2e3,_0x597a13,_0x9c03d6){var _0x4b7530=_0x597a13[_0x28ee('0x26')];var _0x278b77=0xa;var _0x44167a=[_0x28ee('0x7b'),_0x28ee('0x4e'),_0x28ee('0x4f'),'cross_join'];var _0x4573fb={'SUM':_0x28ee('0x51'),'COUNT':_0x28ee('0x7c'),'COUNT DISTINCT':_0x28ee('0x52'),'MAX':'MAX(%s)','MIN':_0x28ee('0x54'),'AVG':_0x28ee('0x55'),'GROUP_CONCAT':_0x28ee('0x56'),'GROUP_CONCAT ASC':_0x28ee('0x57'),'GROUP_CONCAT DESC':_0x28ee('0x7d')};var _0x7cb88c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x28ee('0x58'),'HOUR':_0x28ee('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x8317d8=function(_0x32ff3f){return!_[_0x28ee('0x5b')](['IS\x20NULL',_0x28ee('0x5c'),_0x28ee('0x7e'),_0x28ee('0x5d')],_0x32ff3f);};var _0x5cbb5e=function(_0x1ec472){if(!_0x1ec472||!_0x1ec472['rules']['length']){return'';}for(var _0x7c673='(',_0x103e6a=0x0;_0x103e6a<_0x1ec472[_0x28ee('0x5e')][_0x28ee('0x30')];_0x103e6a+=0x1){_0x103e6a>0x0&&(_0x7c673+='\x20'+_0x1ec472[_0x28ee('0x5f')]+'\x20');_0x7c673+=_0x1ec472['rules'][_0x103e6a][_0x28ee('0x60')]?_0x5cbb5e(_0x1ec472[_0x28ee('0x5e')][_0x103e6a]['group']):_0x1ec472[_0x28ee('0x5e')][_0x103e6a][_0x28ee('0x61')]+'\x20'+_0x1ec472[_0x28ee('0x5e')][_0x103e6a]['condition']+(_0x8317d8(_0x1ec472['rules'][_0x103e6a][_0x28ee('0x62')])?'\x20'+_0x1ec472[_0x28ee('0x5e')][_0x103e6a][_0x28ee('0x63')]:'');}return _0x7c673+')';};var _0x2073a3={'where':{'id':_0x21e2e3['id']}},_0x51000d,_0x3e4a7e,_0x5b111d,_0x4832db,_0x44b9d0;_0x2073a3=_[_0x28ee('0x36')]({},_0x2073a3,_0x9c03d6);return db['AnalyticDefaultReport'][_0x28ee('0x4a')](_0x2073a3)[_0x28ee('0x23')](function(_0x2deba5){if(_0x2deba5){_0x51000d=_0x2deba5;return _0x2deba5[_0x28ee('0x64')]();}return null;})['then'](function(_0x18c192){if(_0x18c192){if(!_0x18c192['length']){throw new db[(_0x28ee('0x7f'))][(_0x28ee('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3e4a7e=_0x18c192;return db[_0x28ee('0x66')]['findAll']({'raw':!![]});}return null;})[_0x28ee('0x23')](function(_0x269f90){if(_0x269f90){_0x5b111d=_['keyBy'](_0x269f90,'id');var _0x2f2598;var _0x30f444=squel[_0x28ee('0x67')]();_0x30f444[_0x28ee('0x68')](_0x51000d['table']);for(var _0x2a91f0=0x0;_0x2a91f0<_0x3e4a7e[_0x28ee('0x30')];_0x2a91f0+=0x1){_0x2f2598=_0x3e4a7e[_0x2a91f0][_0x28ee('0x6a')]?_0x5b111d[_0x3e4a7e[_0x2a91f0]['MetricId']][_0x28ee('0x80')]:_0x3e4a7e[_0x2a91f0][_0x28ee('0x61')];_0x2f2598=_0x3e4a7e[_0x2a91f0][_0x28ee('0x6b')]?_[_0x28ee('0x6c')](_0x4573fb[_0x3e4a7e[_0x2a91f0][_0x28ee('0x6b')]],'%s',_0x2f2598):_0x2f2598;_0x2f2598=_0x3e4a7e[_0x2a91f0][_0x28ee('0x6d')]?_[_0x28ee('0x6c')](_0x7cb88c[_0x3e4a7e[_0x2a91f0][_0x28ee('0x6d')]],'%s',_0x2f2598):_0x2f2598;if(_0x3e4a7e[_0x2a91f0][_0x28ee('0x81')]){_0x30f444[_0x28ee('0x60')](_0x2f2598);}_0x3e4a7e[_0x2a91f0][_0x28ee('0x6e')]&&_0x30f444['order'](_0x2f2598,_0x3e4a7e[_0x2a91f0][_0x28ee('0x6e')]==='DESC'?![]:!![]);_0x30f444['field'](_0x2f2598,_0x3e4a7e[_0x2a91f0][_0x28ee('0x82')]||_0x2f2598);}if(_0x51000d[_0x28ee('0x71')]){_0x51000d[_0x28ee('0x71')]=JSON[_0x28ee('0x70')](_0x51000d['joins']);for(var _0x12ab65=0x0;_0x12ab65<_0x51000d['joins']['length'];_0x12ab65+=0x1){if(_0x51000d[_0x28ee('0x71')][_0x12ab65]['type']&&_[_0x28ee('0x5b')](_0x44167a,_0x51000d[_0x28ee('0x71')][_0x12ab65][_0x28ee('0x38')])&&_0x51000d[_0x28ee('0x71')][_0x12ab65]['parentKey']&&_0x51000d[_0x28ee('0x71')][_0x12ab65][_0x28ee('0x73')]&&_0x51000d['joins'][_0x12ab65][_0x28ee('0x74')]){_0x30f444[_0x51000d[_0x28ee('0x71')][_0x12ab65][_0x28ee('0x38')]](_0x51000d[_0x28ee('0x71')][_0x12ab65][_0x28ee('0x73')],null,util[_0x28ee('0x6d')](_0x28ee('0x75'),_0x51000d[_0x28ee('0x69')],_0x51000d[_0x28ee('0x71')][_0x12ab65][_0x28ee('0x72')],_0x51000d['joins'][_0x12ab65][_0x28ee('0x73')],_0x51000d[_0x28ee('0x71')][_0x12ab65][_0x28ee('0x74')]));}}}if(_0x51000d[_0x28ee('0x76')]){_0x51000d['conditions']=JSON[_0x28ee('0x70')](_0x51000d[_0x28ee('0x76')]);_0x30f444['where'](_0x5cbb5e(_0x51000d[_0x28ee('0x76')][_0x28ee('0x60')]));}_0x44b9d0=_0x30f444['clone']();_0x30f444[_0x28ee('0x19')](_0x278b77);_0x30f444[_0x28ee('0x18')](0x0);logger[_0x28ee('0x83')](_0x28ee('0x78'),_0x30f444[_0x28ee('0x84')]());return db['sequelize']['query'](_0x30f444[_0x28ee('0x84')](),{'type':db[_0x28ee('0x79')]['QueryTypes'][_0x28ee('0x85')]});}})[_0x28ee('0x23')](function(_0x3d20c6){if(!_0x3d20c6['length']){throw new db['Sequelize'][(_0x28ee('0x65'))](_0x28ee('0x86'),0xcc);}if(_0x597a13[_0x28ee('0x87')]==='web'){return null;}var _0x51deda=_['merge'](_0x597a13,{'name':_0x597a13[_0x28ee('0x88')]||_0x597a13[_0x28ee('0x26')]||_0x51000d['name'],'basename':_0x4b7530,'savename':util[_0x28ee('0x6d')](_0x28ee('0x89'),_0x597a13[_0x28ee('0x26')]||_0x51000d[_0x28ee('0x26')],require(_0x28ee('0x8a'))['generate'](0x4),_0x597a13['output']||_0x28ee('0x8b')),'reportId':_0x51000d['id'],'reportType':_0x28ee('0x8c')});return db[_0x28ee('0x8d')][_0x28ee('0x43')](_0x51deda,{'raw':!![]});})['then'](function(_0x21ce48){if(_0x51000d['table']===_0x28ee('0x8e')){_0x44b9d0[_0x28ee('0x33')](_0x51000d[_0x28ee('0x69')]+_0x28ee('0x8f'),_0x597a13[_0x28ee('0x90')],_0x597a13['endDate']);}else{_0x44b9d0[_0x28ee('0x33')](_0x51000d[_0x28ee('0x69')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x597a13['startDate'],_0x597a13[_0x28ee('0x91')]);}if(_0x21ce48){logger[_0x28ee('0x92')](_0x28ee('0x93'),_0x44b9d0[_0x28ee('0x84')]());require(_0x28ee('0x94'))[_0x28ee('0x95')](path[_0x28ee('0x7b')](__dirname,'../../components/export/',_0x21ce48['output']),[_0x21ce48['id'],_0x44b9d0[_0x28ee('0x84')](),path[_0x28ee('0x7b')](__dirname,_0x28ee('0x96'),_0x21ce48[_0x28ee('0x97')]),_0x4b7530]);return _0x21ce48;}else{var _0x2a8b35=squel[_0x28ee('0x67')]();_0x2a8b35[_0x28ee('0x68')]('('+_0x44b9d0['toString']()+')','countTable');_0x2a8b35[_0x28ee('0x61')]('COUNT(*)','count');_0x44b9d0[_0x28ee('0x19')](_0x597a13[_0x28ee('0x19')]||_0x278b77);_0x44b9d0[_0x28ee('0x18')](_0x597a13['offset']||0x0);return db[_0x28ee('0x79')][_0x28ee('0x2c')](_0x2a8b35[_0x28ee('0x84')](),{'type':db['sequelize']['QueryTypes'][_0x28ee('0x85')]})['then'](function(_0x1706cf){if(!_0x1706cf[_0x28ee('0x30')]){_0x4832db=0x0;}else{_0x4832db=_0x1706cf[0x0][_0x28ee('0x3c')]||0x0;}return db['sequelize'][_0x28ee('0x2c')](_0x44b9d0[_0x28ee('0x84')](),{'type':db['sequelize'][_0x28ee('0x7a')][_0x28ee('0x85')]});})[_0x28ee('0x23')](function(_0x359be4){return{'rows':_0x359be4||[],'count':_0x4832db};});}});}exports[_0x28ee('0x98')]=function(_0x23ff19,_0x45d720){return runReport(_0x23ff19[_0x28ee('0x41')],_0x23ff19[_0x28ee('0x2c')],_0x23ff19[_0x28ee('0x3b')])[_0x28ee('0x23')](respondWithResult(_0x45d720,null))[_0x28ee('0x40')](handleError(_0x45d720,null));};exports['runReport']=runReport;exports[_0x28ee('0x2c')]=function(_0x58257d,_0x423917){var _0x46b881=0xa;var _0x347839=[_0x28ee('0x7b'),_0x28ee('0x4e'),_0x28ee('0x4f'),'cross_join'];var _0x5ea9d4={'SUM':_0x28ee('0x51'),'COUNT':_0x28ee('0x7c'),'COUNT DISTINCT':_0x28ee('0x52'),'MAX':_0x28ee('0x53'),'MIN':'MIN(%s)','AVG':_0x28ee('0x55'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x28ee('0x57'),'GROUP_CONCAT DESC':_0x28ee('0x7d')};var _0x43e24d={'SEC_TO_TIME':_0x28ee('0x99'),'DATE':_0x28ee('0x58'),'HOUR':_0x28ee('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x28ee('0x9a')};var _0xe9feeb=function(_0x16355d){return!_[_0x28ee('0x5b')]([_0x28ee('0x9b'),'IS\x20NOT\x20NULL',_0x28ee('0x7e'),_0x28ee('0x5d')],_0x16355d);};var _0x442c81=function(_0x14fa3c){if(!_0x14fa3c||!_0x14fa3c[_0x28ee('0x5e')][_0x28ee('0x30')]){return'';}for(var _0xb80a42='(',_0x4e67a8=0x0;_0x4e67a8<_0x14fa3c['rules']['length'];_0x4e67a8+=0x1){_0x4e67a8>0x0&&(_0xb80a42+='\x20'+_0x14fa3c[_0x28ee('0x5f')]+'\x20');_0xb80a42+=_0x14fa3c[_0x28ee('0x5e')][_0x4e67a8][_0x28ee('0x60')]?_0x442c81(_0x14fa3c['rules'][_0x4e67a8]['group']):_0x14fa3c[_0x28ee('0x5e')][_0x4e67a8][_0x28ee('0x61')]+'\x20'+_0x14fa3c[_0x28ee('0x5e')][_0x4e67a8][_0x28ee('0x62')]+(_0xe9feeb(_0x14fa3c['rules'][_0x4e67a8]['condition'])?'\x20'+_0x14fa3c[_0x28ee('0x5e')][_0x4e67a8][_0x28ee('0x63')]:'');}return _0xb80a42+')';};var _0x28900d={'where':{'id':_0x58257d[_0x28ee('0x41')]['id']}},_0x1728b5,_0x786e7c,_0x28dde7,_0x3dc3c8,_0x31a21c;_0x28900d=_[_0x28ee('0x36')]({},_0x28900d,_0x58257d['options']);return db['AnalyticDefaultReport'][_0x28ee('0x4a')](_0x28900d)[_0x28ee('0x23')](function(_0x2edbc6){if(_0x2edbc6){_0x1728b5=_0x2edbc6;return _0x2edbc6[_0x28ee('0x64')]();}return null;})[_0x28ee('0x23')](function(_0x4386d4){if(_0x4386d4){if(!_0x4386d4[_0x28ee('0x30')]){throw new db[(_0x28ee('0x7f'))][(_0x28ee('0x65'))](_0x28ee('0x9c'),0x193);}_0x786e7c=_0x4386d4;return db[_0x28ee('0x66')][_0x28ee('0x3e')]({'raw':!![]});}return null;})[_0x28ee('0x23')](function(_0x180131){if(_0x180131){_0x28dde7=_[_0x28ee('0x9d')](_0x180131,'id');var _0x4659aa;var _0x24e362=squel[_0x28ee('0x67')]();_0x24e362[_0x28ee('0x68')](_0x1728b5[_0x28ee('0x69')]);for(var _0x432a96=0x0;_0x432a96<_0x786e7c['length'];_0x432a96+=0x1){_0x4659aa=_0x786e7c[_0x432a96][_0x28ee('0x6a')]?_0x28dde7[_0x786e7c[_0x432a96]['MetricId']][_0x28ee('0x80')]:_0x786e7c[_0x432a96][_0x28ee('0x61')];_0x4659aa=_0x786e7c[_0x432a96][_0x28ee('0x6b')]?_[_0x28ee('0x6c')](_0x5ea9d4[_0x786e7c[_0x432a96][_0x28ee('0x6b')]],'%s',_0x4659aa):_0x4659aa;_0x4659aa=_0x786e7c[_0x432a96]['format']?_[_0x28ee('0x6c')](_0x43e24d[_0x786e7c[_0x432a96][_0x28ee('0x6d')]],'%s',_0x4659aa):_0x4659aa;if(_0x786e7c[_0x432a96]['groupBy']){_0x24e362[_0x28ee('0x60')](_0x4659aa);}_0x786e7c[_0x432a96]['orderBy']&&_0x24e362[_0x28ee('0x32')](_0x4659aa,_0x786e7c[_0x432a96][_0x28ee('0x6e')]===_0x28ee('0x6f')?![]:!![]);_0x24e362[_0x28ee('0x61')](_0x4659aa,_0x786e7c[_0x432a96][_0x28ee('0x82')]||_0x4659aa);}if(_0x1728b5[_0x28ee('0x71')]){_0x1728b5[_0x28ee('0x71')]=JSON[_0x28ee('0x70')](_0x1728b5[_0x28ee('0x71')]);for(var _0x30c5e7=0x0;_0x30c5e7<_0x1728b5['joins'][_0x28ee('0x30')];_0x30c5e7+=0x1){if(_0x1728b5['joins'][_0x30c5e7][_0x28ee('0x38')]&&_[_0x28ee('0x5b')](_0x347839,_0x1728b5[_0x28ee('0x71')][_0x30c5e7][_0x28ee('0x38')])&&_0x1728b5[_0x28ee('0x71')][_0x30c5e7][_0x28ee('0x72')]&&_0x1728b5['joins'][_0x30c5e7][_0x28ee('0x73')]&&_0x1728b5[_0x28ee('0x71')][_0x30c5e7][_0x28ee('0x74')]){_0x24e362[_0x1728b5[_0x28ee('0x71')][_0x30c5e7]['type']](_0x1728b5['joins'][_0x30c5e7][_0x28ee('0x73')],null,util[_0x28ee('0x6d')](_0x28ee('0x75'),_0x1728b5[_0x28ee('0x69')],_0x1728b5['joins'][_0x30c5e7][_0x28ee('0x72')],_0x1728b5['joins'][_0x30c5e7]['foreignTable'],_0x1728b5[_0x28ee('0x71')][_0x30c5e7][_0x28ee('0x74')]));}}}if(_0x1728b5['conditions']){_0x1728b5[_0x28ee('0x76')]=JSON['parse'](_0x1728b5['conditions']);_0x24e362[_0x28ee('0x33')](_0x442c81(_0x1728b5['conditions'][_0x28ee('0x60')]));}_0x31a21c=_0x24e362[_0x28ee('0x77')]();_0x24e362['limit'](_0x46b881);_0x24e362[_0x28ee('0x18')](0x0);logger[_0x28ee('0x83')](_0x28ee('0x78'),_0x24e362['toString']());return db[_0x28ee('0x79')]['query'](_0x24e362['toString'](),{'type':db[_0x28ee('0x79')][_0x28ee('0x7a')][_0x28ee('0x85')]});}})[_0x28ee('0x23')](function(){return{'sql':_0x31a21c['toString']()};})[_0x28ee('0x23')](respondWithResult(_0x423917,null))['catch'](handleError(_0x423917,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 3502cb6..d183c0e 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 _0x2aea=['api','moment','request-promise','exports','AnalyticDefaultReport','lodash','util','../../config/logger'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x2aea,0x1d5));var _0xa2ae=function(_0x2179f1,_0x21c653){_0x2179f1=_0x2179f1-0x0;var _0x176ec9=_0x2aea[_0x2179f1];return _0x176ec9;};'use strict';var _=require(_0xa2ae('0x0'));var util=require(_0xa2ae('0x1'));var logger=require(_0xa2ae('0x2'))(_0xa2ae('0x3'));var moment=require(_0xa2ae('0x4'));var BPromise=require('bluebird');var rp=require(_0xa2ae('0x5'));var attributes=require('./analyticDefaultReport.attributes');module[_0xa2ae('0x6')]=function(_0x4def48,_0x2cebb5){return _0x4def48['define'](_0xa2ae('0x7'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d2c=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./analyticDefaultReport.attributes'];(function(_0x5b756c,_0x3621b6){var _0x2e0952=function(_0xca7707){while(--_0xca7707){_0x5b756c['push'](_0x5b756c['shift']());}};_0x2e0952(++_0x3621b6);}(_0x7d2c,0x1b4));var _0xc7d2=function(_0xc380cd,_0x632d9b){_0xc380cd=_0xc380cd-0x0;var _0xdda51d=_0x7d2c[_0xc380cd];return _0xdda51d;};'use strict';var _=require(_0xc7d2('0x0'));var util=require(_0xc7d2('0x1'));var logger=require(_0xc7d2('0x2'))(_0xc7d2('0x3'));var moment=require(_0xc7d2('0x4'));var BPromise=require(_0xc7d2('0x5'));var rp=require(_0xc7d2('0x6'));var attributes=require(_0xc7d2('0x7'));module[_0xc7d2('0x8')]=function(_0x383812,_0x4a6b44){return _0x383812[_0xc7d2('0x9')](_0xc7d2('0xa'),attributes,{'tableName':_0xc7d2('0xb'),'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 20c07fc..b3e7642 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 _0xf4eb=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4801a0,_0x252c24){var _0x338e26=function(_0x1599c2){while(--_0x1599c2){_0x4801a0['push'](_0x4801a0['shift']());}};_0x338e26(++_0x252c24);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3592ff,_0x345afa){_0x3592ff=_0x3592ff-0x0;var _0x37b24c=_0xf4eb[_0x3592ff];return _0x37b24c;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','util'];(function(_0xc5d101,_0x5da5ae){var _0x8dd6e8=function(_0x542d5b){while(--_0x542d5b){_0xc5d101['push'](_0xc5d101['shift']());}};_0x8dd6e8(++_0x5da5ae);}(_0xedd9,0xfc));var _0x9edd=function(_0x51e4b1,_0xe62ec0){_0x51e4b1=_0x51e4b1-0x0;var _0x58f982=_0xedd9[_0x51e4b1];return _0x58f982;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index c21b4ca..13859af 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 _0xd7fe=['exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy'];(function(_0xdba75f,_0x3a2f89){var _0x48519a=function(_0x2ccf9a){while(--_0x2ccf9a){_0xdba75f['push'](_0xdba75f['shift']());}};_0x48519a(++_0x3a2f89);}(_0xd7fe,0x14b));var _0xed7f=function(_0x1a72b5,_0x1507d9){_0x1a72b5=_0x1a72b5-0x0;var _0x269d36=_0xd7fe[_0x1a72b5];return _0x269d36;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xed7f('0x0'));var timeout=require(_0xed7f('0x1'));var express=require(_0xed7f('0x2'));var router=express[_0xed7f('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xed7f('0x4'));var config=require(_0xed7f('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0xed7f('0x6')]('/',auth[_0xed7f('0x7')](),controller['index']);router[_0xed7f('0x6')](_0xed7f('0x8'),auth[_0xed7f('0x7')](),controller[_0xed7f('0x9')]);router[_0xed7f('0x6')](_0xed7f('0xa'),auth[_0xed7f('0x7')](),controller[_0xed7f('0xb')]);router[_0xed7f('0x6')](_0xed7f('0xc'),auth[_0xed7f('0x7')](),controller[_0xed7f('0xd')]);router[_0xed7f('0x6')](_0xed7f('0xe'),auth['isAuthenticated'](),controller[_0xed7f('0xf')]);router[_0xed7f('0x10')]('/',auth['isAuthenticated'](),controller[_0xed7f('0x11')]);router[_0xed7f('0x12')](_0xed7f('0x8'),auth['isAuthenticated'](),controller[_0xed7f('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xed7f('0x14')]);module[_0xed7f('0x15')]=router; \ No newline at end of file +var _0x51aa=['exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','query','post','create','update','delete','destroy'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x51aa,0x161));var _0xa51a=function(_0x19d0b0,_0x2f342c){_0x19d0b0=_0x19d0b0-0x0;var _0x2efdd4=_0x51aa[_0x19d0b0];return _0x2efdd4;};'use strict';var multer=require(_0xa51a('0x0'));var util=require(_0xa51a('0x1'));var path=require('path');var timeout=require(_0xa51a('0x2'));var express=require(_0xa51a('0x3'));var router=express[_0xa51a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa51a('0x5'));var config=require(_0xa51a('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0xa51a('0x7')]('/',auth[_0xa51a('0x8')](),controller[_0xa51a('0x9')]);router['get'](_0xa51a('0xa'),auth[_0xa51a('0x8')](),controller['show']);router[_0xa51a('0x7')](_0xa51a('0xb'),auth[_0xa51a('0x8')](),controller[_0xa51a('0xc')]);router[_0xa51a('0x7')](_0xa51a('0xd'),auth[_0xa51a('0x8')](),controller[_0xa51a('0xe')]);router[_0xa51a('0x7')]('/:id/query',auth[_0xa51a('0x8')](),controller[_0xa51a('0xf')]);router[_0xa51a('0x10')]('/',auth[_0xa51a('0x8')](),controller[_0xa51a('0x11')]);router['put'](_0xa51a('0xa'),auth[_0xa51a('0x8')](),controller[_0xa51a('0x12')]);router[_0xa51a('0x13')](_0xa51a('0xa'),auth[_0xa51a('0x8')](),controller[_0xa51a('0x14')]);module[_0xa51a('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index a8708fd..c4a4425 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 _0x39e2=['INTEGER','UNSIGNED','exports','STRING','ENUM','pdf','xlsx','DATE','manual'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x39e2,0x18e));var _0x239e=function(_0x19c2f5,_0x54f949){_0x19c2f5=_0x19c2f5-0x0;var _0x562004=_0x39e2[_0x19c2f5];return _0x562004;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x239e('0x0')]={'name':{'type':Sequelize[_0x239e('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x239e('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x239e('0x2')]('csv',_0x239e('0x3'),_0x239e('0x4')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x239e('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x239e('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x239e('0x2')](_0x239e('0x6'),'scheduled'),'allowNull':![],'defaultValue':_0x239e('0x6')},'reportId':{'type':Sequelize[_0x239e('0x7')](0xb)[_0x239e('0x8')]},'reportType':{'type':Sequelize[_0x239e('0x1')]}}; \ No newline at end of file +var _0xcff4=['xlsx','DATE','scheduled','INTEGER','UNSIGNED','exports','STRING','ENUM','csv','pdf'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0xcff4,0x163));var _0x4cff=function(_0xdabcd8,_0x7524eb){_0xdabcd8=_0xdabcd8-0x0;var _0x5518b1=_0xcff4[_0xdabcd8];return _0x5518b1;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x4cff('0x0')]={'name':{'type':Sequelize[_0x4cff('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x4cff('0x2')](_0x4cff('0x3'),_0x4cff('0x4'),_0x4cff('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x4cff('0x6')]},'endDate':{'type':Sequelize[_0x4cff('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x4cff('0x2')]('manual',_0x4cff('0x7')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x4cff('0x8')](0xb)[_0x4cff('0x9')]},'reportType':{'type':Sequelize[_0x4cff('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index c182793..da942c2 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 _0x4efb=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','name','params','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','send','index','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','AnalyticExtractedReport','includeAll','rows','catch','show','include','find','create','body','user'];(function(_0xc69e5a,_0x2273b6){var _0x1f8091=function(_0x1f3eaf){while(--_0x1f3eaf){_0xc69e5a['push'](_0xc69e5a['shift']());}};_0x1f8091(++_0x2273b6);}(_0x4efb,0x1da));var _0xb4ef=function(_0x2bc77b,_0x2c6be7){_0x2bc77b=_0x2bc77b-0x0;var _0x21534c=_0x4efb[_0x2bc77b];return _0x21534c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb4ef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb4ef('0x1'));var rp=require(_0xb4ef('0x2'));var moment=require('moment');var BPromise=require(_0xb4ef('0x3'));var Mustache=require(_0xb4ef('0x4'));var util=require('util');var path=require(_0xb4ef('0x5'));var sox=require(_0xb4ef('0x6'));var csv=require(_0xb4ef('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb4ef('0x8'));var crypto=require(_0xb4ef('0x9'));var jsforce=require(_0xb4ef('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb4ef('0x7'));var querystring=require(_0xb4ef('0xb'));var Papa=require(_0xb4ef('0xc'));var authService=require(_0xb4ef('0xd'));var hardwareService=require(_0xb4ef('0xe'));var Redis=require('ioredis');var qs=require(_0xb4ef('0xf'));var logger=require(_0xb4ef('0x10'))(_0xb4ef('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb4ef('0x12'))['db'];function respondWithStatusCode(_0x17f66d,_0x3a40be){_0x3a40be=_0x3a40be||0xcc;return function(_0x3e8b10){if(_0x3e8b10){return _0x17f66d[_0xb4ef('0x13')](_0x3a40be);}return _0x17f66d[_0xb4ef('0x14')](_0x3a40be)[_0xb4ef('0x15')]();};}function respondWithResult(_0x2b186e,_0x165d8e){_0x165d8e=_0x165d8e||0xc8;return function(_0x19077f){if(_0x19077f){return _0x2b186e[_0xb4ef('0x14')](_0x165d8e)[_0xb4ef('0x16')](_0x19077f);}};}function respondWithFilteredResult(_0x3a36c6,_0x16c491){return function(_0x4e7fde){if(_0x4e7fde){var _0x901a2b=_0x4e7fde[_0xb4ef('0x17')],_0x5c1843=_0x16c491['offset'],_0x45d39e=_0x16c491['offset']+_0x16c491['limit'],_0x2a0e94;if(_0x45d39e>=_0x901a2b){_0x45d39e=_0x901a2b;_0x2a0e94=0xc8;}else{_0x2a0e94=0xce;}_0x3a36c6[_0xb4ef('0x14')](_0x2a0e94);return _0x3a36c6[_0xb4ef('0x18')](_0xb4ef('0x19'),_0x5c1843+'-'+_0x45d39e+'/'+_0x901a2b)['json'](_0x4e7fde);}return null;};}function patchUpdates(_0x33a8d4){return function(_0x460d28){try{jsonpatch[_0xb4ef('0x1a')](_0x460d28,_0x33a8d4,!![]);}catch(_0x46d849){return BPromise[_0xb4ef('0x1b')](_0x46d849);}return _0x460d28[_0xb4ef('0x1c')]();};}function saveUpdates(_0x3fafb3,_0x5cf7a7){return function(_0x1c5cde){if(_0x1c5cde){return _0x1c5cde[_0xb4ef('0x1d')](_0x3fafb3)[_0xb4ef('0x1e')](function(_0x581e49){return _0x581e49;});}return null;};}function removeEntity(_0x2b0bb2,_0x728cb6){return function(_0x4a1702){if(_0x4a1702){return _0x4a1702[_0xb4ef('0x1f')]()[_0xb4ef('0x1e')](function(){var _0x338d5f=_0x4a1702[_0xb4ef('0x20')]({'plain':!![]});var _0xd7e8ac=_0xb4ef('0x21');return db[_0xb4ef('0x22')]['destroy']({'where':{'type':_0xd7e8ac,'resourceId':_0x338d5f['id']}})['then'](function(){return _0x4a1702;});})['then'](function(){_0x2b0bb2['status'](0xcc)[_0xb4ef('0x15')]();});}};}function handleEntityNotFound(_0x3cc4e6,_0x3b55e8){return function(_0x320f4a){if(!_0x320f4a){_0x3cc4e6[_0xb4ef('0x13')](0x194);}return _0x320f4a;};}function handleError(_0x32dd08,_0x47e816){_0x47e816=_0x47e816||0x1f4;return function(_0x5d95a7){logger[_0xb4ef('0x23')](_0x5d95a7[_0xb4ef('0x24')]);if(_0x5d95a7['name']){delete _0x5d95a7['name'];}_0x32dd08[_0xb4ef('0x14')](_0x47e816)[_0xb4ef('0x25')](_0x5d95a7);};}exports[_0xb4ef('0x26')]=function(_0x2a5448,_0x95ffe9){var _0x422ba8={},_0x28ba77={},_0x4f76eb={'count':0x0,'rows':[]};var _0x44ae4b=db['AnalyticExtractedReport']['rawAttributes'];_0x28ba77[_0xb4ef('0x27')]=_['keys'](_0x44ae4b);_0x28ba77[_0xb4ef('0x28')]=_[_0xb4ef('0x29')](_0x2a5448[_0xb4ef('0x28')]);_0x28ba77[_0xb4ef('0x2a')]=_[_0xb4ef('0x2b')](_0x28ba77[_0xb4ef('0x27')],_0x28ba77[_0xb4ef('0x28')]);_0x422ba8['attributes']=_['intersection'](_0x28ba77[_0xb4ef('0x27')],qs['fields'](_0x2a5448[_0xb4ef('0x28')][_0xb4ef('0x2c')]));_0x422ba8[_0xb4ef('0x2d')]=_0x422ba8[_0xb4ef('0x2d')][_0xb4ef('0x2e')]?_0x422ba8[_0xb4ef('0x2d')]:_0x28ba77[_0xb4ef('0x27')];if(!_0x2a5448['query'][_0xb4ef('0x2f')](_0xb4ef('0x30'))){_0x422ba8[_0xb4ef('0x31')]=qs[_0xb4ef('0x31')](_0x2a5448['query']['limit']);_0x422ba8[_0xb4ef('0x32')]=qs['offset'](_0x2a5448[_0xb4ef('0x28')][_0xb4ef('0x32')]);}_0x422ba8[_0xb4ef('0x33')]=qs[_0xb4ef('0x34')](_0x2a5448[_0xb4ef('0x28')][_0xb4ef('0x34')]);_0x422ba8[_0xb4ef('0x35')]=qs[_0xb4ef('0x2a')](_[_0xb4ef('0x36')](_0x2a5448[_0xb4ef('0x28')],_0x28ba77[_0xb4ef('0x2a')]));if(_0x2a5448['query'][_0xb4ef('0x37')]){_0x422ba8[_0xb4ef('0x35')]=_['merge'](_0x422ba8['where'],{'$or':_[_0xb4ef('0x38')](_0x44ae4b,function(_0x6b865f){if(_0x6b865f['type'][_0xb4ef('0x39')]!==_0xb4ef('0x3a')){var _0x336f85={};_0x336f85[_0x6b865f[_0xb4ef('0x3b')]]={'$like':'%'+_0x2a5448[_0xb4ef('0x28')][_0xb4ef('0x37')]+'%'};return _0x336f85;}})});}_0x422ba8=_[_0xb4ef('0x3c')]({},_0x422ba8,_0x2a5448[_0xb4ef('0x3d')]);var _0x5914a1={'where':_0x422ba8[_0xb4ef('0x35')]};return db[_0xb4ef('0x3e')][_0xb4ef('0x17')](_0x5914a1)[_0xb4ef('0x1e')](function(_0x41c4a9){_0x4f76eb[_0xb4ef('0x17')]=_0x41c4a9;if(_0x2a5448[_0xb4ef('0x28')][_0xb4ef('0x3f')]){_0x422ba8['include']=[{'all':!![]}];}return db[_0xb4ef('0x3e')]['findAll'](_0x422ba8);})[_0xb4ef('0x1e')](function(_0x510a8d){_0x4f76eb[_0xb4ef('0x40')]=_0x510a8d;return _0x4f76eb;})[_0xb4ef('0x1e')](respondWithFilteredResult(_0x95ffe9,_0x422ba8))[_0xb4ef('0x41')](handleError(_0x95ffe9,null));};exports[_0xb4ef('0x42')]=function(_0x2cc493,_0x3d0998){var _0x79c513={'raw':!![],'where':{'id':_0x2cc493['params']['id']}},_0x597b5f={};_0x597b5f[_0xb4ef('0x27')]=_[_0xb4ef('0x29')](db[_0xb4ef('0x3e')]['rawAttributes']);_0x597b5f[_0xb4ef('0x28')]=_[_0xb4ef('0x29')](_0x2cc493[_0xb4ef('0x28')]);_0x597b5f[_0xb4ef('0x2a')]=_[_0xb4ef('0x2b')](_0x597b5f[_0xb4ef('0x27')],_0x597b5f[_0xb4ef('0x28')]);_0x79c513['attributes']=_[_0xb4ef('0x2b')](_0x597b5f['model'],qs['fields'](_0x2cc493['query']['fields']));_0x79c513[_0xb4ef('0x2d')]=_0x79c513[_0xb4ef('0x2d')]['length']?_0x79c513[_0xb4ef('0x2d')]:_0x597b5f[_0xb4ef('0x27')];if(_0x2cc493['query'][_0xb4ef('0x3f')]){_0x79c513[_0xb4ef('0x43')]=[{'all':!![]}];}_0x79c513=_[_0xb4ef('0x3c')]({},_0x79c513,_0x2cc493[_0xb4ef('0x3d')]);return db[_0xb4ef('0x3e')][_0xb4ef('0x44')](_0x79c513)[_0xb4ef('0x1e')](handleEntityNotFound(_0x3d0998,null))[_0xb4ef('0x1e')](respondWithResult(_0x3d0998,null))[_0xb4ef('0x41')](handleError(_0x3d0998,null));};exports[_0xb4ef('0x45')]=function(_0x704c1d,_0x5b070d){return db[_0xb4ef('0x3e')]['create'](_0x704c1d[_0xb4ef('0x46')],{})[_0xb4ef('0x1e')](function(_0x37bd10){var _0x7f74fe=_0x704c1d[_0xb4ef('0x47')][_0xb4ef('0x20')]({'plain':!![]});if(!_0x7f74fe)throw new Error(_0xb4ef('0x48'));if(_0x7f74fe[_0xb4ef('0x49')]===_0xb4ef('0x47')){var _0x21e409=_0x37bd10[_0xb4ef('0x20')]({'plain':!![]});var _0x4bd5b3=_0xb4ef('0x21');return db['UserProfileSection'][_0xb4ef('0x44')]({'where':{'name':_0x4bd5b3,'userProfileId':_0x7f74fe[_0xb4ef('0x4a')]},'raw':!![]})[_0xb4ef('0x1e')](function(_0x3e7be0){if(_0x3e7be0&&_0x3e7be0['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x21e409[_0xb4ef('0x4b')],'resourceId':_0x21e409['id'],'type':_0x3e7be0[_0xb4ef('0x4b')],'sectionId':_0x3e7be0['id']},{})[_0xb4ef('0x1e')](function(){return _0x37bd10;});}else{return _0x37bd10;}})[_0xb4ef('0x41')](function(_0x250445){logger[_0xb4ef('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x250445);throw _0x250445;});}return _0x37bd10;})[_0xb4ef('0x1e')](respondWithResult(_0x5b070d,0xc9))[_0xb4ef('0x41')](handleError(_0x5b070d,null));};exports['update']=function(_0x2b6cb2,_0x467550){if(_0x2b6cb2[_0xb4ef('0x46')]['id']){delete _0x2b6cb2[_0xb4ef('0x46')]['id'];}return db[_0xb4ef('0x3e')]['find']({'where':{'id':_0x2b6cb2[_0xb4ef('0x4c')]['id']}})['then'](handleEntityNotFound(_0x467550,null))[_0xb4ef('0x1e')](saveUpdates(_0x2b6cb2[_0xb4ef('0x46')],null))[_0xb4ef('0x1e')](respondWithResult(_0x467550,null))[_0xb4ef('0x41')](handleError(_0x467550,null));};exports[_0xb4ef('0x1f')]=function(_0xfe95c4,_0x1da776){return db[_0xb4ef('0x3e')][_0xb4ef('0x44')]({'where':{'id':_0xfe95c4[_0xb4ef('0x4c')]['id']}})[_0xb4ef('0x1e')](handleEntityNotFound(_0x1da776,null))['then'](removeEntity(_0x1da776,null))[_0xb4ef('0x41')](handleError(_0x1da776,null));};exports[_0xb4ef('0x4d')]=function(_0x402291,_0x404238,_0x1f3f2f){return db[_0xb4ef('0x3e')][_0xb4ef('0x44')]({'where':{'id':_0x402291[_0xb4ef('0x4c')]['id']},'attributes':[_0xb4ef('0x4b'),_0xb4ef('0x4e'),_0xb4ef('0x4f'),_0xb4ef('0x50')],'raw':!![]})[_0xb4ef('0x1e')](handleEntityNotFound(_0x404238,null))[_0xb4ef('0x1e')](function(_0x428f43){if(_0x428f43){if(!fs[_0xb4ef('0x51')](path[_0xb4ef('0x52')](config[_0xb4ef('0x53')],_0xb4ef('0x54'),_0x428f43[_0xb4ef('0x4f')]))){throw new db['Sequelize'][(_0xb4ef('0x55'))](_0xb4ef('0x56'));}if(_0x402291['query'][_0xb4ef('0x57')]){return _0x404238['sendStatus'](0xc8);}return _0x404238[_0xb4ef('0x4d')](path[_0xb4ef('0x52')](config[_0xb4ef('0x53')],_0xb4ef('0x54'),_0x428f43[_0xb4ef('0x4f')]),util[_0xb4ef('0x58')](_0xb4ef('0x59'),_0x428f43[_0xb4ef('0x4e')]||_0x428f43[_0xb4ef('0x4b')],_0x428f43['output'][_0xb4ef('0x5a')]()));}})[_0xb4ef('0x41')](handleError(_0x404238,null));}; \ No newline at end of file +var _0xc32c=['get','ExtractedReports','then','error','stack','name','model','keys','query','filters','intersection','attributes','order','sort','where','pick','merge','key','VIRTUAL','field','filter','options','AnalyticExtractedReport','include','catch','show','params','fields','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy'];(function(_0x265694,_0x53b5e2){var _0x31b7d1=function(_0x379e5e){while(--_0x379e5e){_0x265694['push'](_0x265694['shift']());}};_0x31b7d1(++_0x53b5e2);}(_0xc32c,0x1d1));var _0xcc32=function(_0x15497f,_0x15ecb3){_0x15497f=_0x15497f-0x0;var _0x3dff4e=_0xc32c[_0x15497f];return _0x3dff4e;};'use strict';var pdf=require(_0xcc32('0x0'));var emlformat=require(_0xcc32('0x1'));var rimraf=require(_0xcc32('0x2'));var zipdir=require(_0xcc32('0x3'));var jsonpatch=require(_0xcc32('0x4'));var rp=require('request-promise');var moment=require(_0xcc32('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcc32('0x6'));var util=require(_0xcc32('0x7'));var path=require('path');var sox=require(_0xcc32('0x8'));var csv=require(_0xcc32('0x9'));var ejs=require(_0xcc32('0xa'));var fs=require('fs');var _=require(_0xcc32('0xb'));var squel=require(_0xcc32('0xc'));var crypto=require(_0xcc32('0xd'));var jsforce=require(_0xcc32('0xe'));var deskjs=require(_0xcc32('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');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(_0xcc32('0x10'))(_0xcc32('0x11'));var utils=require(_0xcc32('0x12'));var config=require(_0xcc32('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20f311,_0x4651ff){_0x4651ff=_0x4651ff||0xcc;return function(_0x3e0e86){if(_0x3e0e86){return _0x20f311[_0xcc32('0x14')](_0x4651ff);}return _0x20f311[_0xcc32('0x15')](_0x4651ff)[_0xcc32('0x16')]();};}function respondWithResult(_0x23d2f5,_0xc1aa35){_0xc1aa35=_0xc1aa35||0xc8;return function(_0xb2e1e5){if(_0xb2e1e5){return _0x23d2f5[_0xcc32('0x15')](_0xc1aa35)['json'](_0xb2e1e5);}};}function respondWithFilteredResult(_0x2d587b,_0x22ecb2){return function(_0x1a31f3){if(_0x1a31f3){var _0x2886a5=_0x1a31f3[_0xcc32('0x17')],_0x58cee7=_0x22ecb2[_0xcc32('0x18')],_0xb8541=_0x22ecb2['offset']+_0x22ecb2[_0xcc32('0x19')],_0x1174c6;if(_0xb8541>=_0x2886a5){_0xb8541=_0x2886a5;_0x1174c6=0xc8;}else{_0x1174c6=0xce;}_0x2d587b[_0xcc32('0x15')](_0x1174c6);return _0x2d587b[_0xcc32('0x1a')](_0xcc32('0x1b'),_0x58cee7+'-'+_0xb8541+'/'+_0x2886a5)[_0xcc32('0x1c')](_0x1a31f3);}return null;};}function patchUpdates(_0x379ba1){return function(_0x248c0b){try{jsonpatch[_0xcc32('0x1d')](_0x248c0b,_0x379ba1,!![]);}catch(_0x473337){return BPromise[_0xcc32('0x1e')](_0x473337);}return _0x248c0b['save']();};}function saveUpdates(_0x1f368c,_0x991994){return function(_0xaeddec){if(_0xaeddec){return _0xaeddec[_0xcc32('0x1f')](_0x1f368c)['then'](function(_0x525071){return _0x525071;});}return null;};}function removeEntity(_0x2d01bb,_0x3b1d3b){return function(_0xd4746a){if(_0xd4746a){return _0xd4746a[_0xcc32('0x20')]()['then'](function(){var _0x4eaa02=_0xd4746a[_0xcc32('0x21')]({'plain':!![]});var _0x44c51e=_0xcc32('0x22');return db['UserProfileResource'][_0xcc32('0x20')]({'where':{'type':_0x44c51e,'resourceId':_0x4eaa02['id']}})[_0xcc32('0x23')](function(){return _0xd4746a;});})[_0xcc32('0x23')](function(){_0x2d01bb[_0xcc32('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43b802,_0x2885e0){return function(_0xf0d5fb){if(!_0xf0d5fb){_0x43b802[_0xcc32('0x14')](0x194);}return _0xf0d5fb;};}function handleError(_0x3f1d88,_0x536c8a){_0x536c8a=_0x536c8a||0x1f4;return function(_0x477455){logger[_0xcc32('0x24')](_0x477455[_0xcc32('0x25')]);if(_0x477455['name']){delete _0x477455[_0xcc32('0x26')];}_0x3f1d88['status'](_0x536c8a)['send'](_0x477455);};}exports['index']=function(_0x490ca3,_0x49b06c){var _0x59cb0a={},_0x3190fd={},_0x4dd5b8={'count':0x0,'rows':[]};var _0xca91ed=db['AnalyticExtractedReport']['rawAttributes'];_0x3190fd[_0xcc32('0x27')]=_[_0xcc32('0x28')](_0xca91ed);_0x3190fd[_0xcc32('0x29')]=_[_0xcc32('0x28')](_0x490ca3[_0xcc32('0x29')]);_0x3190fd[_0xcc32('0x2a')]=_[_0xcc32('0x2b')](_0x3190fd[_0xcc32('0x27')],_0x3190fd[_0xcc32('0x29')]);_0x59cb0a[_0xcc32('0x2c')]=_[_0xcc32('0x2b')](_0x3190fd[_0xcc32('0x27')],qs['fields'](_0x490ca3[_0xcc32('0x29')]['fields']));_0x59cb0a[_0xcc32('0x2c')]=_0x59cb0a[_0xcc32('0x2c')]['length']?_0x59cb0a['attributes']:_0x3190fd['model'];if(!_0x490ca3[_0xcc32('0x29')]['hasOwnProperty']('nolimit')){_0x59cb0a[_0xcc32('0x19')]=qs[_0xcc32('0x19')](_0x490ca3[_0xcc32('0x29')][_0xcc32('0x19')]);_0x59cb0a['offset']=qs[_0xcc32('0x18')](_0x490ca3[_0xcc32('0x29')][_0xcc32('0x18')]);}_0x59cb0a[_0xcc32('0x2d')]=qs[_0xcc32('0x2e')](_0x490ca3[_0xcc32('0x29')]['sort']);_0x59cb0a[_0xcc32('0x2f')]=qs[_0xcc32('0x2a')](_[_0xcc32('0x30')](_0x490ca3[_0xcc32('0x29')],_0x3190fd['filters']));if(_0x490ca3[_0xcc32('0x29')]['filter']){_0x59cb0a[_0xcc32('0x2f')]=_[_0xcc32('0x31')](_0x59cb0a['where'],{'$or':_['map'](_0xca91ed,function(_0x23c7c0){if(_0x23c7c0['type'][_0xcc32('0x32')]!==_0xcc32('0x33')){var _0x44278d={};_0x44278d[_0x23c7c0[_0xcc32('0x34')]]={'$like':'%'+_0x490ca3[_0xcc32('0x29')][_0xcc32('0x35')]+'%'};return _0x44278d;}})});}_0x59cb0a=_[_0xcc32('0x31')]({},_0x59cb0a,_0x490ca3[_0xcc32('0x36')]);var _0x34a194={'where':_0x59cb0a[_0xcc32('0x2f')]};return db[_0xcc32('0x37')]['count'](_0x34a194)['then'](function(_0x2adf11){_0x4dd5b8[_0xcc32('0x17')]=_0x2adf11;if(_0x490ca3[_0xcc32('0x29')]['includeAll']){_0x59cb0a[_0xcc32('0x38')]=[{'all':!![]}];}return db[_0xcc32('0x37')]['findAll'](_0x59cb0a);})[_0xcc32('0x23')](function(_0x318d40){_0x4dd5b8['rows']=_0x318d40;return _0x4dd5b8;})[_0xcc32('0x23')](respondWithFilteredResult(_0x49b06c,_0x59cb0a))[_0xcc32('0x39')](handleError(_0x49b06c,null));};exports[_0xcc32('0x3a')]=function(_0x1b4ec9,_0x17063a){var _0x4d16c9={'raw':!![],'where':{'id':_0x1b4ec9[_0xcc32('0x3b')]['id']}},_0x1e387e={};_0x1e387e[_0xcc32('0x27')]=_[_0xcc32('0x28')](db['AnalyticExtractedReport']['rawAttributes']);_0x1e387e[_0xcc32('0x29')]=_[_0xcc32('0x28')](_0x1b4ec9[_0xcc32('0x29')]);_0x1e387e[_0xcc32('0x2a')]=_[_0xcc32('0x2b')](_0x1e387e[_0xcc32('0x27')],_0x1e387e['query']);_0x4d16c9[_0xcc32('0x2c')]=_['intersection'](_0x1e387e[_0xcc32('0x27')],qs['fields'](_0x1b4ec9[_0xcc32('0x29')][_0xcc32('0x3c')]));_0x4d16c9['attributes']=_0x4d16c9[_0xcc32('0x2c')][_0xcc32('0x3d')]?_0x4d16c9[_0xcc32('0x2c')]:_0x1e387e['model'];if(_0x1b4ec9[_0xcc32('0x29')]['includeAll']){_0x4d16c9[_0xcc32('0x38')]=[{'all':!![]}];}_0x4d16c9=_[_0xcc32('0x31')]({},_0x4d16c9,_0x1b4ec9['options']);return db[_0xcc32('0x37')]['find'](_0x4d16c9)[_0xcc32('0x23')](handleEntityNotFound(_0x17063a,null))[_0xcc32('0x23')](respondWithResult(_0x17063a,null))[_0xcc32('0x39')](handleError(_0x17063a,null));};exports['create']=function(_0x3e23e5,_0x2f7f83){return db[_0xcc32('0x37')][_0xcc32('0x3e')](_0x3e23e5[_0xcc32('0x3f')],{})['then'](function(_0x6f5a59){var _0x21fd30=_0x3e23e5['user']['get']({'plain':!![]});if(!_0x21fd30)throw new Error(_0xcc32('0x40'));if(_0x21fd30[_0xcc32('0x41')]===_0xcc32('0x42')){var _0x151cd7=_0x6f5a59[_0xcc32('0x21')]({'plain':!![]});var _0x2a3369='ExtractedReports';return db[_0xcc32('0x43')][_0xcc32('0x44')]({'where':{'name':_0x2a3369,'userProfileId':_0x21fd30[_0xcc32('0x45')]},'raw':!![]})[_0xcc32('0x23')](function(_0x5cb78a){if(_0x5cb78a&&_0x5cb78a[_0xcc32('0x46')]===0x0){return db[_0xcc32('0x47')]['create']({'name':_0x151cd7[_0xcc32('0x26')],'resourceId':_0x151cd7['id'],'type':_0x5cb78a[_0xcc32('0x26')],'sectionId':_0x5cb78a['id']},{})[_0xcc32('0x23')](function(){return _0x6f5a59;});}else{return _0x6f5a59;}})['catch'](function(_0x4fb281){logger[_0xcc32('0x24')](_0xcc32('0x48'),_0x4fb281);throw _0x4fb281;});}return _0x6f5a59;})[_0xcc32('0x23')](respondWithResult(_0x2f7f83,0xc9))[_0xcc32('0x39')](handleError(_0x2f7f83,null));};exports[_0xcc32('0x1f')]=function(_0x43e6bb,_0x256636){if(_0x43e6bb[_0xcc32('0x3f')]['id']){delete _0x43e6bb['body']['id'];}return db[_0xcc32('0x37')]['find']({'where':{'id':_0x43e6bb[_0xcc32('0x3b')]['id']}})['then'](handleEntityNotFound(_0x256636,null))[_0xcc32('0x23')](saveUpdates(_0x43e6bb['body'],null))[_0xcc32('0x23')](respondWithResult(_0x256636,null))['catch'](handleError(_0x256636,null));};exports['destroy']=function(_0x1e2783,_0x2f0b44){return db[_0xcc32('0x37')][_0xcc32('0x44')]({'where':{'id':_0x1e2783[_0xcc32('0x3b')]['id']}})[_0xcc32('0x23')](handleEntityNotFound(_0x2f0b44,null))[_0xcc32('0x23')](removeEntity(_0x2f0b44,null))[_0xcc32('0x39')](handleError(_0x2f0b44,null));};exports['download']=function(_0x46fd0d,_0x495f97,_0x44a703){return db[_0xcc32('0x37')][_0xcc32('0x44')]({'where':{'id':_0x46fd0d[_0xcc32('0x3b')]['id']},'attributes':[_0xcc32('0x26'),'basename',_0xcc32('0x49'),_0xcc32('0x4a')],'raw':!![]})[_0xcc32('0x23')](handleEntityNotFound(_0x495f97,null))[_0xcc32('0x23')](function(_0x38142d){if(_0x38142d){if(!fs[_0xcc32('0x4b')](path[_0xcc32('0x4c')](config[_0xcc32('0x4d')],_0xcc32('0x4e'),_0x38142d[_0xcc32('0x49')]))){throw new db[(_0xcc32('0x4f'))][(_0xcc32('0x50'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x46fd0d[_0xcc32('0x29')][_0xcc32('0x51')]){return _0x495f97['sendStatus'](0xc8);}return _0x495f97['download'](path[_0xcc32('0x4c')](config[_0xcc32('0x4d')],_0xcc32('0x4e'),_0x38142d[_0xcc32('0x49')]),util['format']('%s.%s',_0x38142d['basename']||_0x38142d[_0xcc32('0x26')],_0x38142d[_0xcc32('0x4a')][_0xcc32('0x52')]()));}})['catch'](handleError(_0x495f97,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 89c42b4..f2af98e 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 _0x8c51=['util','../../config/logger','api','moment','bluebird','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport'];(function(_0x1c9599,_0x285270){var _0xbe2162=function(_0x3299cc){while(--_0x3299cc){_0x1c9599['push'](_0x1c9599['shift']());}};_0xbe2162(++_0x285270);}(_0x8c51,0x100));var _0x18c5=function(_0x4d6440,_0x362c03){_0x4d6440=_0x4d6440-0x0;var _0x486400=_0x8c51[_0x4d6440];return _0x486400;};'use strict';var _=require('lodash');var util=require(_0x18c5('0x0'));var logger=require(_0x18c5('0x1'))(_0x18c5('0x2'));var moment=require(_0x18c5('0x3'));var BPromise=require(_0x18c5('0x4'));var rp=require('request-promise');var attributes=require(_0x18c5('0x5'));module[_0x18c5('0x6')]=function(_0x1c52e7,_0x375b63){return _0x1c52e7['define'](_0x18c5('0x7'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeea2=['request-promise','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','moment','bluebird'];(function(_0x3776d9,_0x2dbf19){var _0x312918=function(_0x4e0389){while(--_0x4e0389){_0x3776d9['push'](_0x3776d9['shift']());}};_0x312918(++_0x2dbf19);}(_0xeea2,0x192));var _0x2eea=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xeea2[_0x411017];return _0x2adeea;};'use strict';var _=require(_0x2eea('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2eea('0x1'));var BPromise=require(_0x2eea('0x2'));var rp=require(_0x2eea('0x3'));var attributes=require(_0x2eea('0x4'));module[_0x2eea('0x5')]=function(_0x142cbf,_0x26c220){return _0x142cbf[_0x2eea('0x6')](_0x2eea('0x7'),attributes,{'tableName':_0x2eea('0x8'),'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 b2bf003..9ee6715 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 _0xbea6=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x239a1f,_0x304d0d){var _0x89084e=function(_0x469766){while(--_0x469766){_0x239a1f['push'](_0x239a1f['shift']());}};_0x89084e(++_0x304d0d);}(_0xbea6,0x14e));var _0x6bea=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0xbea6[_0x119d5a];return _0x15bff4;};'use strict';var _=require('lodash');var util=require(_0x6bea('0x0'));var moment=require(_0x6bea('0x1'));var BPromise=require(_0x6bea('0x2'));var rs=require(_0x6bea('0x3'));var fs=require('fs');var Redis=require(_0x6bea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6bea('0x5'));var logger=require(_0x6bea('0x6'))(_0x6bea('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6bea('0x8')][_0x6bea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56adea,_0x529631,_0x121e46){return new BPromise(function(_0x1c16db,_0x715371){return client[_0x6bea('0xa')](_0x56adea,_0x121e46)[_0x6bea('0xb')](function(_0x5790d5){logger[_0x6bea('0xc')](_0x6bea('0xd'),_0x529631,'request\x20sent');logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x529631,_0x6bea('0xe'),JSON[_0x6bea('0xf')](_0x5790d5));if(_0x5790d5[_0x6bea('0x10')]){if(_0x5790d5[_0x6bea('0x10')][_0x6bea('0x11')]===0x1f4){logger[_0x6bea('0x10')](_0x6bea('0xd'),_0x529631,_0x5790d5[_0x6bea('0x10')][_0x6bea('0x12')]);return _0x715371(_0x5790d5[_0x6bea('0x10')]['message']);}logger[_0x6bea('0x10')](_0x6bea('0xd'),_0x529631,_0x5790d5[_0x6bea('0x10')]['message']);return _0x1c16db(_0x5790d5[_0x6bea('0x10')]['message']);}else{logger[_0x6bea('0xc')](_0x6bea('0xd'),_0x529631,_0x6bea('0xe'));_0x1c16db(_0x5790d5[_0x6bea('0x13')][_0x6bea('0x12')]);}})[_0x6bea('0x14')](function(_0x48f5b1){logger[_0x6bea('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x529631,_0x48f5b1);_0x715371(_0x48f5b1);});});} \ No newline at end of file +var _0x5dec=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0xdf0132,_0x51bee1){var _0x3518d8=function(_0x423ede){while(--_0x423ede){_0xdf0132['push'](_0xdf0132['shift']());}};_0x3518d8(++_0x51bee1);}(_0x5dec,0x1e9));var _0xc5de=function(_0x4c2cda,_0x5945b0){_0x4c2cda=_0x4c2cda-0x0;var _0x59c47d=_0x5dec[_0x4c2cda];return _0x59c47d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc5de('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5de('0x1'))['db'];var utils=require(_0xc5de('0x2'));var logger=require('../../config/logger')(_0xc5de('0x3'));var config=require(_0xc5de('0x4'));var jayson=require(_0xc5de('0x5'));var client=jayson[_0xc5de('0x6')][_0xc5de('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28ac6a,_0x5269bd,_0x444444){return new BPromise(function(_0xd5635,_0x516b1b){return client[_0xc5de('0x8')](_0x28ac6a,_0x444444)[_0xc5de('0x9')](function(_0x2041e7){logger['info'](_0xc5de('0xa'),_0x5269bd,_0xc5de('0xb'));logger[_0xc5de('0xc')](_0xc5de('0xd'),_0x5269bd,_0xc5de('0xb'),JSON[_0xc5de('0xe')](_0x2041e7));if(_0x2041e7[_0xc5de('0xf')]){if(_0x2041e7[_0xc5de('0xf')]['code']===0x1f4){logger[_0xc5de('0xf')](_0xc5de('0xa'),_0x5269bd,_0x2041e7[_0xc5de('0xf')]['message']);return _0x516b1b(_0x2041e7[_0xc5de('0xf')][_0xc5de('0x10')]);}logger[_0xc5de('0xf')](_0xc5de('0xa'),_0x5269bd,_0x2041e7['error']['message']);return _0xd5635(_0x2041e7[_0xc5de('0xf')]['message']);}else{logger[_0xc5de('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5269bd,_0xc5de('0xb'));_0xd5635(_0x2041e7[_0xc5de('0x12')][_0xc5de('0x10')]);}})[_0xc5de('0x13')](function(_0x37a8d1){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5269bd,_0x37a8d1);_0x516b1b(_0x37a8d1);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 7f4980c..10c2719 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 _0x6b36=['index','/:id/download','download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x10af31,_0x3911e3){var _0x6d5169=function(_0x2d53d4){while(--_0x2d53d4){_0x10af31['push'](_0x10af31['shift']());}};_0x6d5169(++_0x3911e3);}(_0x6b36,0x121));var _0x66b3=function(_0x2ed4e5,_0x38f461){_0x2ed4e5=_0x2ed4e5-0x0;var _0x2fdf6f=_0x6b36[_0x2ed4e5];return _0x2fdf6f;};'use strict';var multer=require('multer');var util=require(_0x66b3('0x0'));var path=require(_0x66b3('0x1'));var timeout=require(_0x66b3('0x2'));var express=require(_0x66b3('0x3'));var router=express[_0x66b3('0x4')]();var auth=require(_0x66b3('0x5'));var interaction=require(_0x66b3('0x6'));var config=require(_0x66b3('0x7'));var controller=require(_0x66b3('0x8'));router[_0x66b3('0x9')]('/',auth[_0x66b3('0xa')](),controller[_0x66b3('0xb')]);router[_0x66b3('0x9')]('/:id',auth[_0x66b3('0xa')](),controller['show']);router[_0x66b3('0x9')](_0x66b3('0xc'),auth[_0x66b3('0xa')](),controller[_0x66b3('0xd')]);router[_0x66b3('0xe')]('/',auth[_0x66b3('0xa')](),controller[_0x66b3('0xf')]);router['put'](_0x66b3('0x10'),auth[_0x66b3('0xa')](),controller['update']);router[_0x66b3('0x11')](_0x66b3('0x10'),auth[_0x66b3('0xa')](),controller[_0x66b3('0x12')]);module[_0x66b3('0x13')]=router; \ No newline at end of file +var _0xc549=['isAuthenticated','index','show','/:id/download','download','post','put','/:id','update','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0xc549,0x82));var _0x9c54=function(_0x28d6cd,_0x31841e){_0x28d6cd=_0x28d6cd-0x0;var _0xb8b5a6=_0xc549[_0x28d6cd];return _0xb8b5a6;};'use strict';var multer=require(_0x9c54('0x0'));var util=require('util');var path=require(_0x9c54('0x1'));var timeout=require(_0x9c54('0x2'));var express=require(_0x9c54('0x3'));var router=express[_0x9c54('0x4')]();var auth=require(_0x9c54('0x5'));var interaction=require(_0x9c54('0x6'));var config=require(_0x9c54('0x7'));var controller=require(_0x9c54('0x8'));router[_0x9c54('0x9')]('/',auth[_0x9c54('0xa')](),controller[_0x9c54('0xb')]);router[_0x9c54('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9c54('0xc')]);router[_0x9c54('0x9')](_0x9c54('0xd'),auth[_0x9c54('0xa')](),controller[_0x9c54('0xe')]);router[_0x9c54('0xf')]('/',auth[_0x9c54('0xa')](),controller['create']);router[_0x9c54('0x10')](_0x9c54('0x11'),auth[_0x9c54('0xa')](),controller[_0x9c54('0x12')]);router['delete']('/:id',auth[_0x9c54('0xa')](),controller[_0x9c54('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index e1cca95..1c10b68 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 _0xc8d0=['BOOLEAN','sequelize','exports','STRING'];(function(_0xe45ed5,_0x405667){var _0x35a415=function(_0x2f4f2f){while(--_0x2f4f2f){_0xe45ed5['push'](_0xe45ed5['shift']());}};_0x35a415(++_0x405667);}(_0xc8d0,0x119));var _0x0c8d=function(_0x327e47,_0x1f69a3){_0x327e47=_0x327e47-0x0;var _0xd2b5cd=_0xc8d0[_0x327e47];return _0xd2b5cd;};'use strict';var Sequelize=require(_0x0c8d('0x0'));module[_0x0c8d('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x0c8d('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x0c8d('0x2')]},'groupBy':{'type':Sequelize[_0x0c8d('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0c8d('0x2')]},'custom':{'type':Sequelize[_0x0c8d('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xfb40=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x625d09,_0x5469a9){var _0x56052a=function(_0x3b862f){while(--_0x3b862f){_0x625d09['push'](_0x625d09['shift']());}};_0x56052a(++_0x5469a9);}(_0xfb40,0xd4));var _0x0fb4=function(_0x5b3e52,_0x373ab7){_0x5b3e52=_0x5b3e52-0x0;var _0x3fc065=_0xfb40[_0x5b3e52];return _0x3fc065;};'use strict';var Sequelize=require(_0x0fb4('0x0'));module[_0x0fb4('0x1')]={'field':{'type':Sequelize[_0x0fb4('0x2')]},'alias':{'type':Sequelize[_0x0fb4('0x3')]},'function':{'type':Sequelize[_0x0fb4('0x3')]},'format':{'type':Sequelize[_0x0fb4('0x3')]},'groupBy':{'type':Sequelize[_0x0fb4('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0fb4('0x3')]},'custom':{'type':Sequelize[_0x0fb4('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 0fbbc18..34677fc 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 _0x52d9=['ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','count','offset','limit','status','set','Content-Range','json','apply','reject','update','destroy','then','end','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','field','filter','includeAll','findAll','rows','catch','show','keys','length','include','options','create','bulkCreate','body','params','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','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'];(function(_0x59d94c,_0x33f979){var _0x4a6d77=function(_0x473b6c){while(--_0x473b6c){_0x59d94c['push'](_0x59d94c['shift']());}};_0x4a6d77(++_0x33f979);}(_0x52d9,0x195));var _0x952d=function(_0x479b99,_0x1e5bec){_0x479b99=_0x479b99-0x0;var _0x1e7eb7=_0x52d9[_0x479b99];return _0x1e7eb7;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x952d('0x0'));var zipdir=require(_0x952d('0x1'));var jsonpatch=require(_0x952d('0x2'));var rp=require(_0x952d('0x3'));var moment=require(_0x952d('0x4'));var BPromise=require(_0x952d('0x5'));var Mustache=require(_0x952d('0x6'));var util=require('util');var path=require(_0x952d('0x7'));var sox=require(_0x952d('0x8'));var csv=require(_0x952d('0x9'));var ejs=require(_0x952d('0xa'));var fs=require('fs');var _=require(_0x952d('0xb'));var squel=require(_0x952d('0xc'));var crypto=require(_0x952d('0xd'));var jsforce=require(_0x952d('0xe'));var deskjs=require(_0x952d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x952d('0x10'));var Papa=require(_0x952d('0x11'));var authService=require(_0x952d('0x12'));var hardwareService=require(_0x952d('0x13'));var Redis=require(_0x952d('0x14'));var qs=require(_0x952d('0x15'));var logger=require(_0x952d('0x16'))('api');var utils=require(_0x952d('0x17'));var config=require('../../config/environment');var db=require(_0x952d('0x18'))['db'];function respondWithStatusCode(_0x59f231,_0x354bac){_0x354bac=_0x354bac||0xcc;return function(_0x489be2){if(_0x489be2){return _0x59f231[_0x952d('0x19')](_0x354bac);}return _0x59f231['status'](_0x354bac)['end']();};}function respondWithResult(_0x25bab1,_0x40e6e3){_0x40e6e3=_0x40e6e3||0xc8;return function(_0x2191b7){if(_0x2191b7){return _0x25bab1['status'](_0x40e6e3)['json'](_0x2191b7);}};}function respondWithFilteredResult(_0x3439b3,_0x47d12f){return function(_0x34c9b3){if(_0x34c9b3){var _0x214da0=_0x34c9b3[_0x952d('0x1a')],_0x48942a=_0x47d12f['offset'],_0x3c793e=_0x47d12f[_0x952d('0x1b')]+_0x47d12f[_0x952d('0x1c')],_0x30f3a3;if(_0x3c793e>=_0x214da0){_0x3c793e=_0x214da0;_0x30f3a3=0xc8;}else{_0x30f3a3=0xce;}_0x3439b3[_0x952d('0x1d')](_0x30f3a3);return _0x3439b3[_0x952d('0x1e')](_0x952d('0x1f'),_0x48942a+'-'+_0x3c793e+'/'+_0x214da0)[_0x952d('0x20')](_0x34c9b3);}return null;};}function patchUpdates(_0x3ada7b){return function(_0x337846){try{jsonpatch[_0x952d('0x21')](_0x337846,_0x3ada7b,!![]);}catch(_0x2d91d8){return BPromise[_0x952d('0x22')](_0x2d91d8);}return _0x337846['save']();};}function saveUpdates(_0xa88884,_0x175515){return function(_0x553e90){if(_0x553e90){return _0x553e90[_0x952d('0x23')](_0xa88884)['then'](function(_0x4a0889){return _0x4a0889;});}return null;};}function removeEntity(_0x10a2fd,_0x35fcae){return function(_0xf0c78b){if(_0xf0c78b){return _0xf0c78b[_0x952d('0x24')]()[_0x952d('0x25')](function(){_0x10a2fd[_0x952d('0x1d')](0xcc)[_0x952d('0x26')]();});}};}function handleEntityNotFound(_0xc01e03,_0x3c1fc4){return function(_0x2c4a99){if(!_0x2c4a99){_0xc01e03[_0x952d('0x19')](0x194);}return _0x2c4a99;};}function handleError(_0x414aa2,_0x563586){_0x563586=_0x563586||0x1f4;return function(_0x5a0991){logger[_0x952d('0x27')](_0x5a0991[_0x952d('0x28')]);if(_0x5a0991[_0x952d('0x29')]){delete _0x5a0991[_0x952d('0x29')];}_0x414aa2[_0x952d('0x1d')](_0x563586)[_0x952d('0x2a')](_0x5a0991);};}exports[_0x952d('0x2b')]=function(_0x34ba25,_0xe67c4e){var _0x1dc976={},_0x18abc2={},_0x47dd8d={'count':0x0,'rows':[]};var _0x54c596=db[_0x952d('0x2c')][_0x952d('0x2d')];_0x18abc2[_0x952d('0x2e')]=_['keys'](_0x54c596);_0x18abc2[_0x952d('0x2f')]=_['keys'](_0x34ba25['query']);_0x18abc2[_0x952d('0x30')]=_[_0x952d('0x31')](_0x18abc2[_0x952d('0x2e')],_0x18abc2[_0x952d('0x2f')]);_0x1dc976['attributes']=_[_0x952d('0x31')](_0x18abc2[_0x952d('0x2e')],qs[_0x952d('0x32')](_0x34ba25['query'][_0x952d('0x32')]));_0x1dc976['attributes']=_0x1dc976[_0x952d('0x33')]['length']?_0x1dc976[_0x952d('0x33')]:_0x18abc2[_0x952d('0x2e')];if(!_0x34ba25[_0x952d('0x2f')]['hasOwnProperty'](_0x952d('0x34'))){_0x1dc976[_0x952d('0x1c')]=qs['limit'](_0x34ba25[_0x952d('0x2f')][_0x952d('0x1c')]);_0x1dc976[_0x952d('0x1b')]=qs[_0x952d('0x1b')](_0x34ba25['query'][_0x952d('0x1b')]);}_0x1dc976[_0x952d('0x35')]=qs[_0x952d('0x36')](_0x34ba25['query'][_0x952d('0x36')]);_0x1dc976[_0x952d('0x37')]=qs[_0x952d('0x30')](_['pick'](_0x34ba25['query'],_0x18abc2[_0x952d('0x30')]));if(_0x34ba25[_0x952d('0x2f')]['filter']){_0x1dc976[_0x952d('0x37')]=_[_0x952d('0x38')](_0x1dc976[_0x952d('0x37')],{'$or':_[_0x952d('0x39')](_0x54c596,function(_0x355694){if(_0x355694[_0x952d('0x3a')][_0x952d('0x3b')]!==_0x952d('0x3c')){var _0x50255b={};_0x50255b[_0x355694[_0x952d('0x3d')]]={'$like':'%'+_0x34ba25[_0x952d('0x2f')][_0x952d('0x3e')]+'%'};return _0x50255b;}})});}_0x1dc976=_[_0x952d('0x38')]({},_0x1dc976,_0x34ba25['options']);var _0xff55b6={'where':_0x1dc976[_0x952d('0x37')]};return db[_0x952d('0x2c')][_0x952d('0x1a')](_0xff55b6)[_0x952d('0x25')](function(_0x4d087a){_0x47dd8d['count']=_0x4d087a;if(_0x34ba25[_0x952d('0x2f')][_0x952d('0x3f')]){_0x1dc976['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x952d('0x40')](_0x1dc976);})['then'](function(_0x2ebd5c){_0x47dd8d[_0x952d('0x41')]=_0x2ebd5c;return _0x47dd8d;})[_0x952d('0x25')](respondWithFilteredResult(_0xe67c4e,_0x1dc976))[_0x952d('0x42')](handleError(_0xe67c4e,null));};exports[_0x952d('0x43')]=function(_0x213608,_0x27e401){var _0x223a6e={'raw':![],'where':{'id':_0x213608['params']['id']}},_0x3eb2ce={};_0x3eb2ce[_0x952d('0x2e')]=_[_0x952d('0x44')](db[_0x952d('0x2c')][_0x952d('0x2d')]);_0x3eb2ce[_0x952d('0x2f')]=_[_0x952d('0x44')](_0x213608[_0x952d('0x2f')]);_0x3eb2ce[_0x952d('0x30')]=_[_0x952d('0x31')](_0x3eb2ce['model'],_0x3eb2ce[_0x952d('0x2f')]);_0x223a6e['attributes']=_[_0x952d('0x31')](_0x3eb2ce[_0x952d('0x2e')],qs['fields'](_0x213608[_0x952d('0x2f')][_0x952d('0x32')]));_0x223a6e[_0x952d('0x33')]=_0x223a6e[_0x952d('0x33')][_0x952d('0x45')]?_0x223a6e[_0x952d('0x33')]:_0x3eb2ce[_0x952d('0x2e')];if(_0x213608[_0x952d('0x2f')][_0x952d('0x3f')]){_0x223a6e[_0x952d('0x46')]=[{'all':!![]}];}_0x223a6e=_[_0x952d('0x38')]({},_0x223a6e,_0x213608[_0x952d('0x47')]);return db[_0x952d('0x2c')]['find'](_0x223a6e)[_0x952d('0x25')](handleEntityNotFound(_0x27e401,null))[_0x952d('0x25')](respondWithResult(_0x27e401,null))[_0x952d('0x42')](handleError(_0x27e401,null));};exports[_0x952d('0x48')]=function(_0x46bb7a,_0x49ab61){return db[_0x952d('0x2c')][_0x952d('0x48')](_0x46bb7a['body'],{})[_0x952d('0x25')](respondWithResult(_0x49ab61,0xc9))[_0x952d('0x42')](handleError(_0x49ab61,null));};exports[_0x952d('0x49')]=function(_0x3a31f7,_0x5c5e27){return db[_0x952d('0x2c')][_0x952d('0x49')](_0x3a31f7[_0x952d('0x4a')],{'raw':![],'individualHooks':!![]})[_0x952d('0x25')](respondWithResult(_0x5c5e27,0xc9))['catch'](handleError(_0x5c5e27,null));};exports[_0x952d('0x23')]=function(_0x16d00b,_0x1ded0c){if(_0x16d00b['body']['id']){delete _0x16d00b['body']['id'];}return db[_0x952d('0x2c')]['find']({'where':{'id':_0x16d00b[_0x952d('0x4b')]['id']}})[_0x952d('0x25')](handleEntityNotFound(_0x1ded0c,null))[_0x952d('0x25')](saveUpdates(_0x16d00b[_0x952d('0x4a')],null))[_0x952d('0x25')](respondWithResult(_0x1ded0c,null))['catch'](handleError(_0x1ded0c,null));};exports[_0x952d('0x24')]=function(_0x3d9dfa,_0x36cce5){return db[_0x952d('0x2c')][_0x952d('0x4c')]({'where':{'id':_0x3d9dfa[_0x952d('0x4b')]['id']}})[_0x952d('0x25')](handleEntityNotFound(_0x36cce5,null))['then'](removeEntity(_0x36cce5,null))[_0x952d('0x42')](handleError(_0x36cce5,null));};exports[_0x952d('0x4d')]=function(_0x48c5ec,_0x2b9b05){return db[_0x952d('0x2c')][_0x952d('0x24')]({'where':{'id':_0x48c5ec[_0x952d('0x2f')][_0x952d('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x952d('0x25')](respondWithResult(_0x2b9b05,0xcc))['catch'](handleError(_0x2b9b05,null));};exports[_0x952d('0x4f')]=function(_0x2a0b5a,_0xdc7615,_0x3d5853){return db[_0x952d('0x50')][_0x952d('0x51')]({'where':{'id':_0x2a0b5a[_0x952d('0x4b')]['id']}})[_0x952d('0x25')](handleEntityNotFound(_0xdc7615,null))[_0x952d('0x25')](function(_0x3af425){if(_0x3af425){return db[_0x952d('0x52')][_0x952d('0x53')](function(_0x3b0869){return db[_0x952d('0x2c')]['destroy']({'where':{'CustomReportId':_0x2a0b5a[_0x952d('0x4b')]['id']},'transaction':_0x3b0869})['then'](function(_0x431ca8){var _0x421232=_[_0x952d('0x39')](_0x2a0b5a['body'],function(_0x5e9cf1){delete _0x5e9cf1['id'];_0x5e9cf1[_0x952d('0x54')]=_0x2a0b5a[_0x952d('0x4b')]['id'];return _0x5e9cf1;});return db[_0x952d('0x2c')][_0x952d('0x49')](_0x421232,{'transaction':_0x3b0869});});})[_0x952d('0x25')](function(){return db[_0x952d('0x2c')][_0x952d('0x40')]({'where':{'CustomReportId':_0x2a0b5a[_0x952d('0x4b')]['id']}});});}})[_0x952d('0x25')](respondWithResult(_0xdc7615,null))[_0x952d('0x42')](handleError(_0xdc7615,null));}; \ No newline at end of file +var _0xfacc=['options','include','findAll','rows','catch','show','find','create','bulkCreate','body','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','html-pdf','rimraf','zip-dir','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','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','destroy','then','error','name','send','index','AnalyticFieldReport','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','merge','map','type','key','field','filter'];(function(_0x4564a1,_0x307647){var _0x3b284f=function(_0x5db9e4){while(--_0x5db9e4){_0x4564a1['push'](_0x4564a1['shift']());}};_0x3b284f(++_0x307647);}(_0xfacc,0xff));var _0xcfac=function(_0x29ecbc,_0x2929d9){_0x29ecbc=_0x29ecbc-0x0;var _0x5709b0=_0xfacc[_0x29ecbc];return _0x5709b0;};'use strict';var pdf=require(_0xcfac('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcfac('0x1'));var zipdir=require(_0xcfac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcfac('0x3'));var moment=require(_0xcfac('0x4'));var BPromise=require(_0xcfac('0x5'));var Mustache=require(_0xcfac('0x6'));var util=require(_0xcfac('0x7'));var path=require(_0xcfac('0x8'));var sox=require(_0xcfac('0x9'));var csv=require(_0xcfac('0xa'));var ejs=require(_0xcfac('0xb'));var fs=require('fs');var _=require(_0xcfac('0xc'));var squel=require(_0xcfac('0xd'));var crypto=require(_0xcfac('0xe'));var jsforce=require(_0xcfac('0xf'));var deskjs=require(_0xcfac('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcfac('0x11'));var Papa=require('papaparse');var authService=require(_0xcfac('0x12'));var hardwareService=require(_0xcfac('0x13'));var Redis=require(_0xcfac('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0xcfac('0x15'))(_0xcfac('0x16'));var utils=require('../../config/utils');var config=require(_0xcfac('0x17'));var db=require(_0xcfac('0x18'))['db'];function respondWithStatusCode(_0x51d684,_0x1573d3){_0x1573d3=_0x1573d3||0xcc;return function(_0x12be65){if(_0x12be65){return _0x51d684[_0xcfac('0x19')](_0x1573d3);}return _0x51d684[_0xcfac('0x1a')](_0x1573d3)[_0xcfac('0x1b')]();};}function respondWithResult(_0x1946e0,_0x4fe93e){_0x4fe93e=_0x4fe93e||0xc8;return function(_0x228fd7){if(_0x228fd7){return _0x1946e0['status'](_0x4fe93e)[_0xcfac('0x1c')](_0x228fd7);}};}function respondWithFilteredResult(_0x12c616,_0x4548ec){return function(_0x55e7c3){if(_0x55e7c3){var _0x10698f=_0x55e7c3[_0xcfac('0x1d')],_0x33e034=_0x4548ec[_0xcfac('0x1e')],_0xd6db9c=_0x4548ec[_0xcfac('0x1e')]+_0x4548ec[_0xcfac('0x1f')],_0x4d96bd;if(_0xd6db9c>=_0x10698f){_0xd6db9c=_0x10698f;_0x4d96bd=0xc8;}else{_0x4d96bd=0xce;}_0x12c616[_0xcfac('0x1a')](_0x4d96bd);return _0x12c616[_0xcfac('0x20')](_0xcfac('0x21'),_0x33e034+'-'+_0xd6db9c+'/'+_0x10698f)['json'](_0x55e7c3);}return null;};}function patchUpdates(_0x37d517){return function(_0x967d51){try{jsonpatch['apply'](_0x967d51,_0x37d517,!![]);}catch(_0x26ff9c){return BPromise[_0xcfac('0x22')](_0x26ff9c);}return _0x967d51['save']();};}function saveUpdates(_0x4416b1,_0x4aec58){return function(_0x500de6){if(_0x500de6){return _0x500de6[_0xcfac('0x23')](_0x4416b1)['then'](function(_0x14e746){return _0x14e746;});}return null;};}function removeEntity(_0x250922,_0x5c6c2e){return function(_0x5044f1){if(_0x5044f1){return _0x5044f1[_0xcfac('0x24')]()[_0xcfac('0x25')](function(){_0x250922[_0xcfac('0x1a')](0xcc)[_0xcfac('0x1b')]();});}};}function handleEntityNotFound(_0x37fdfd,_0x1f793c){return function(_0x532c97){if(!_0x532c97){_0x37fdfd[_0xcfac('0x19')](0x194);}return _0x532c97;};}function handleError(_0x3a20ab,_0x35b4c0){_0x35b4c0=_0x35b4c0||0x1f4;return function(_0x770930){logger[_0xcfac('0x26')](_0x770930['stack']);if(_0x770930['name']){delete _0x770930[_0xcfac('0x27')];}_0x3a20ab[_0xcfac('0x1a')](_0x35b4c0)[_0xcfac('0x28')](_0x770930);};}exports[_0xcfac('0x29')]=function(_0x251962,_0x2e2215){var _0x46d4e3={},_0x2b1d8a={},_0x26acd8={'count':0x0,'rows':[]};var _0x38f37b=db[_0xcfac('0x2a')][_0xcfac('0x2b')];_0x2b1d8a[_0xcfac('0x2c')]=_['keys'](_0x38f37b);_0x2b1d8a[_0xcfac('0x2d')]=_['keys'](_0x251962[_0xcfac('0x2d')]);_0x2b1d8a[_0xcfac('0x2e')]=_[_0xcfac('0x2f')](_0x2b1d8a[_0xcfac('0x2c')],_0x2b1d8a['query']);_0x46d4e3['attributes']=_[_0xcfac('0x2f')](_0x2b1d8a[_0xcfac('0x2c')],qs[_0xcfac('0x30')](_0x251962[_0xcfac('0x2d')]['fields']));_0x46d4e3[_0xcfac('0x31')]=_0x46d4e3[_0xcfac('0x31')][_0xcfac('0x32')]?_0x46d4e3[_0xcfac('0x31')]:_0x2b1d8a[_0xcfac('0x2c')];if(!_0x251962[_0xcfac('0x2d')][_0xcfac('0x33')](_0xcfac('0x34'))){_0x46d4e3[_0xcfac('0x1f')]=qs[_0xcfac('0x1f')](_0x251962['query'][_0xcfac('0x1f')]);_0x46d4e3['offset']=qs[_0xcfac('0x1e')](_0x251962[_0xcfac('0x2d')][_0xcfac('0x1e')]);}_0x46d4e3[_0xcfac('0x35')]=qs['sort'](_0x251962[_0xcfac('0x2d')]['sort']);_0x46d4e3[_0xcfac('0x36')]=qs[_0xcfac('0x2e')](_['pick'](_0x251962[_0xcfac('0x2d')],_0x2b1d8a['filters']));if(_0x251962[_0xcfac('0x2d')]['filter']){_0x46d4e3[_0xcfac('0x36')]=_[_0xcfac('0x37')](_0x46d4e3[_0xcfac('0x36')],{'$or':_[_0xcfac('0x38')](_0x38f37b,function(_0x5a3146){if(_0x5a3146[_0xcfac('0x39')][_0xcfac('0x3a')]!=='VIRTUAL'){var _0x479981={};_0x479981[_0x5a3146[_0xcfac('0x3b')]]={'$like':'%'+_0x251962[_0xcfac('0x2d')][_0xcfac('0x3c')]+'%'};return _0x479981;}})});}_0x46d4e3=_['merge']({},_0x46d4e3,_0x251962[_0xcfac('0x3d')]);var _0x4d25c9={'where':_0x46d4e3[_0xcfac('0x36')]};return db[_0xcfac('0x2a')][_0xcfac('0x1d')](_0x4d25c9)[_0xcfac('0x25')](function(_0x2fc6a2){_0x26acd8[_0xcfac('0x1d')]=_0x2fc6a2;if(_0x251962['query']['includeAll']){_0x46d4e3[_0xcfac('0x3e')]=[{'all':!![]}];}return db[_0xcfac('0x2a')][_0xcfac('0x3f')](_0x46d4e3);})[_0xcfac('0x25')](function(_0x147183){_0x26acd8[_0xcfac('0x40')]=_0x147183;return _0x26acd8;})['then'](respondWithFilteredResult(_0x2e2215,_0x46d4e3))[_0xcfac('0x41')](handleError(_0x2e2215,null));};exports[_0xcfac('0x42')]=function(_0x5b5e9a,_0x4d1539){var _0xc1f2ad={'raw':![],'where':{'id':_0x5b5e9a['params']['id']}},_0x3ca91c={};_0x3ca91c[_0xcfac('0x2c')]=_['keys'](db[_0xcfac('0x2a')][_0xcfac('0x2b')]);_0x3ca91c[_0xcfac('0x2d')]=_['keys'](_0x5b5e9a[_0xcfac('0x2d')]);_0x3ca91c[_0xcfac('0x2e')]=_[_0xcfac('0x2f')](_0x3ca91c[_0xcfac('0x2c')],_0x3ca91c[_0xcfac('0x2d')]);_0xc1f2ad[_0xcfac('0x31')]=_[_0xcfac('0x2f')](_0x3ca91c['model'],qs[_0xcfac('0x30')](_0x5b5e9a[_0xcfac('0x2d')][_0xcfac('0x30')]));_0xc1f2ad[_0xcfac('0x31')]=_0xc1f2ad['attributes']['length']?_0xc1f2ad[_0xcfac('0x31')]:_0x3ca91c[_0xcfac('0x2c')];if(_0x5b5e9a['query']['includeAll']){_0xc1f2ad[_0xcfac('0x3e')]=[{'all':!![]}];}_0xc1f2ad=_[_0xcfac('0x37')]({},_0xc1f2ad,_0x5b5e9a[_0xcfac('0x3d')]);return db['AnalyticFieldReport'][_0xcfac('0x43')](_0xc1f2ad)['then'](handleEntityNotFound(_0x4d1539,null))[_0xcfac('0x25')](respondWithResult(_0x4d1539,null))['catch'](handleError(_0x4d1539,null));};exports[_0xcfac('0x44')]=function(_0x33e86d,_0x4cf306){return db[_0xcfac('0x2a')][_0xcfac('0x44')](_0x33e86d['body'],{})['then'](respondWithResult(_0x4cf306,0xc9))['catch'](handleError(_0x4cf306,null));};exports['bulkCreate']=function(_0x5a0403,_0x16040d){return db[_0xcfac('0x2a')][_0xcfac('0x45')](_0x5a0403[_0xcfac('0x46')],{'raw':![],'individualHooks':!![]})[_0xcfac('0x25')](respondWithResult(_0x16040d,0xc9))[_0xcfac('0x41')](handleError(_0x16040d,null));};exports[_0xcfac('0x23')]=function(_0x5f59fe,_0x30795b){if(_0x5f59fe[_0xcfac('0x46')]['id']){delete _0x5f59fe['body']['id'];}return db[_0xcfac('0x2a')][_0xcfac('0x43')]({'where':{'id':_0x5f59fe[_0xcfac('0x47')]['id']}})[_0xcfac('0x25')](handleEntityNotFound(_0x30795b,null))[_0xcfac('0x25')](saveUpdates(_0x5f59fe[_0xcfac('0x46')],null))[_0xcfac('0x25')](respondWithResult(_0x30795b,null))[_0xcfac('0x41')](handleError(_0x30795b,null));};exports[_0xcfac('0x24')]=function(_0x182445,_0x4f6302){return db[_0xcfac('0x2a')]['find']({'where':{'id':_0x182445[_0xcfac('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f6302,null))[_0xcfac('0x25')](removeEntity(_0x4f6302,null))[_0xcfac('0x41')](handleError(_0x4f6302,null));};exports[_0xcfac('0x48')]=function(_0x33c58b,_0x1116a2){return db[_0xcfac('0x2a')]['destroy']({'where':{'id':_0x33c58b['query'][_0xcfac('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xcfac('0x25')](respondWithResult(_0x1116a2,0xcc))[_0xcfac('0x41')](handleError(_0x1116a2,null));};exports[_0xcfac('0x4a')]=function(_0x1ea612,_0x9d0bf,_0x4005fe){return db[_0xcfac('0x4b')][_0xcfac('0x4c')]({'where':{'id':_0x1ea612['params']['id']}})['then'](handleEntityNotFound(_0x9d0bf,null))[_0xcfac('0x25')](function(_0x4bcc84){if(_0x4bcc84){return db[_0xcfac('0x4d')]['transaction'](function(_0x13bec7){return db[_0xcfac('0x2a')][_0xcfac('0x24')]({'where':{'CustomReportId':_0x1ea612[_0xcfac('0x47')]['id']},'transaction':_0x13bec7})[_0xcfac('0x25')](function(_0x597580){var _0x2fc032=_['map'](_0x1ea612[_0xcfac('0x46')],function(_0x41133f){delete _0x41133f['id'];_0x41133f[_0xcfac('0x4e')]=_0x1ea612[_0xcfac('0x47')]['id'];return _0x41133f;});return db[_0xcfac('0x2a')]['bulkCreate'](_0x2fc032,{'transaction':_0x13bec7});});})[_0xcfac('0x25')](function(){return db[_0xcfac('0x2a')][_0xcfac('0x3f')]({'where':{'CustomReportId':_0x1ea612['params']['id']}});});}})[_0xcfac('0x25')](respondWithResult(_0x9d0bf,null))[_0xcfac('0x41')](handleError(_0x9d0bf,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 6b88150..eb54f0f 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 _0x6ac4=['analytics_report_fields','lodash','../../config/logger','api','moment','request-promise','./analyticFieldReport.attributes','define'];(function(_0x506620,_0x2d4567){var _0x215dcb=function(_0x19649a){while(--_0x19649a){_0x506620['push'](_0x506620['shift']());}};_0x215dcb(++_0x2d4567);}(_0x6ac4,0x71));var _0x46ac=function(_0x43ec85,_0x2ca511){_0x43ec85=_0x43ec85-0x0;var _0x578edb=_0x6ac4[_0x43ec85];return _0x578edb;};'use strict';var _=require(_0x46ac('0x0'));var util=require('util');var logger=require(_0x46ac('0x1'))(_0x46ac('0x2'));var moment=require(_0x46ac('0x3'));var BPromise=require('bluebird');var rp=require(_0x46ac('0x4'));var attributes=require(_0x46ac('0x5'));module['exports']=function(_0x321efe,_0x3e73a1){return _0x321efe[_0x46ac('0x6')]('AnalyticFieldReport',attributes,{'tableName':_0x46ac('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3717=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x396811,_0x38ff0f){var _0x26919f=function(_0x14492d){while(--_0x14492d){_0x396811['push'](_0x396811['shift']());}};_0x26919f(++_0x38ff0f);}(_0x3717,0xcb));var _0x7371=function(_0x29b399,_0x153317){_0x29b399=_0x29b399-0x0;var _0x30f2ce=_0x3717[_0x29b399];return _0x30f2ce;};'use strict';var _=require(_0x7371('0x0'));var util=require(_0x7371('0x1'));var logger=require(_0x7371('0x2'))(_0x7371('0x3'));var moment=require(_0x7371('0x4'));var BPromise=require(_0x7371('0x5'));var rp=require('request-promise');var attributes=require(_0x7371('0x6'));module[_0x7371('0x7')]=function(_0x160204,_0x58fe2f){return _0x160204[_0x7371('0x8')](_0x7371('0x9'),attributes,{'tableName':_0x7371('0xa'),'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 7a94dc2..2950782 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 _0x86b8=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x86b8,0x15d));var _0x886b=function(_0x516922,_0x2a1d73){_0x516922=_0x516922-0x0;var _0x34828f=_0x86b8[_0x516922];return _0x34828f;};'use strict';var _=require(_0x886b('0x0'));var util=require(_0x886b('0x1'));var moment=require(_0x886b('0x2'));var BPromise=require('bluebird');var rs=require(_0x886b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x886b('0x4'))['db'];var utils=require(_0x886b('0x5'));var logger=require(_0x886b('0x6'))('rpc');var config=require(_0x886b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x886b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd9d9ac,_0xe888a0,_0x2f8957){return new BPromise(function(_0xbc2d70,_0x238701){return client[_0x886b('0x9')](_0xd9d9ac,_0x2f8957)[_0x886b('0xa')](function(_0x52344d){logger[_0x886b('0xb')](_0x886b('0xc'),_0xe888a0,_0x886b('0xd'));logger[_0x886b('0xe')](_0x886b('0xf'),_0xe888a0,_0x886b('0xd'),JSON[_0x886b('0x10')](_0x52344d));if(_0x52344d[_0x886b('0x11')]){if(_0x52344d['error'][_0x886b('0x12')]===0x1f4){logger[_0x886b('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0xe888a0,_0x52344d[_0x886b('0x11')][_0x886b('0x13')]);return _0x238701(_0x52344d[_0x886b('0x11')][_0x886b('0x13')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0xe888a0,_0x52344d[_0x886b('0x11')][_0x886b('0x13')]);return _0xbc2d70(_0x52344d[_0x886b('0x11')][_0x886b('0x13')]);}else{logger[_0x886b('0xb')](_0x886b('0xc'),_0xe888a0,_0x886b('0xd'));_0xbc2d70(_0x52344d[_0x886b('0x14')]['message']);}})[_0x886b('0x15')](function(_0x44d81a){logger['error'](_0x886b('0xc'),_0xe888a0,_0x44d81a);_0x238701(_0x44d81a);});});} \ No newline at end of file +var _0x4a80=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x571d24,_0x2124cb){var _0x5368e9=function(_0x191b18){while(--_0x191b18){_0x571d24['push'](_0x571d24['shift']());}};_0x5368e9(++_0x2124cb);}(_0x4a80,0xbe));var _0x04a8=function(_0x834092,_0x429e9c){_0x834092=_0x834092-0x0;var _0x631023=_0x4a80[_0x834092];return _0x631023;};'use strict';var _=require(_0x04a8('0x0'));var util=require('util');var moment=require(_0x04a8('0x1'));var BPromise=require(_0x04a8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04a8('0x3'));var db=require(_0x04a8('0x4'))['db'];var utils=require(_0x04a8('0x5'));var logger=require(_0x04a8('0x6'))(_0x04a8('0x7'));var config=require(_0x04a8('0x8'));var jayson=require(_0x04a8('0x9'));var client=jayson[_0x04a8('0xa')][_0x04a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d4bad,_0x59079a,_0x40de61){return new BPromise(function(_0x103ebc,_0x2ddb2b){return client[_0x04a8('0xc')](_0x1d4bad,_0x40de61)[_0x04a8('0xd')](function(_0x155a50){logger[_0x04a8('0xe')](_0x04a8('0xf'),_0x59079a,_0x04a8('0x10'));logger[_0x04a8('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x59079a,_0x04a8('0x10'),JSON[_0x04a8('0x12')](_0x155a50));if(_0x155a50[_0x04a8('0x13')]){if(_0x155a50['error'][_0x04a8('0x14')]===0x1f4){logger[_0x04a8('0x13')](_0x04a8('0xf'),_0x59079a,_0x155a50[_0x04a8('0x13')][_0x04a8('0x15')]);return _0x2ddb2b(_0x155a50[_0x04a8('0x13')][_0x04a8('0x15')]);}logger['error'](_0x04a8('0xf'),_0x59079a,_0x155a50[_0x04a8('0x13')][_0x04a8('0x15')]);return _0x103ebc(_0x155a50['error']['message']);}else{logger[_0x04a8('0xe')](_0x04a8('0xf'),_0x59079a,'request\x20sent');_0x103ebc(_0x155a50[_0x04a8('0x16')]['message']);}})[_0x04a8('0x17')](function(_0x5dee8a){logger[_0x04a8('0x13')](_0x04a8('0xf'),_0x59079a,_0x5dee8a);_0x2ddb2b(_0x5dee8a);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index ac59aaf..56c77ce 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 _0x5c00=['/create_many','bulkCreate','/:id/create_many','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5c00,0x17e));var _0x05c0=function(_0x28107d,_0x2ec8b3){_0x28107d=_0x28107d-0x0;var _0x2b1cbe=_0x5c00[_0x28107d];return _0x2b1cbe;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var auth=require(_0x05c0('0x4'));var interaction=require(_0x05c0('0x5'));var config=require(_0x05c0('0x6'));var controller=require(_0x05c0('0x7'));router['get']('/',auth[_0x05c0('0x8')](),controller[_0x05c0('0x9')]);router[_0x05c0('0xa')](_0x05c0('0xb'),auth['isAuthenticated'](),controller[_0x05c0('0xc')]);router[_0x05c0('0xd')]('/',auth[_0x05c0('0x8')](),controller['create']);router[_0x05c0('0xd')](_0x05c0('0xe'),auth[_0x05c0('0x8')](),controller[_0x05c0('0xf')]);router[_0x05c0('0xd')](_0x05c0('0x10'),auth['isAuthenticated'](),controller['addFields']);router[_0x05c0('0x11')]('/:id',auth[_0x05c0('0x8')](),controller[_0x05c0('0x12')]);router[_0x05c0('0x13')]('/destroy_many',auth[_0x05c0('0x8')](),controller['bulkDestroy']);router[_0x05c0('0x13')](_0x05c0('0xb'),auth[_0x05c0('0x8')](),controller[_0x05c0('0x14')]);module[_0x05c0('0x15')]=router; \ No newline at end of file +var _0x39cb=['delete','/destroy_many','bulkDestroy','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','/:id','show','create','post','/create_many','addFields','put','update'];(function(_0x3b3cff,_0x304c19){var _0x3b859c=function(_0x5c4e26){while(--_0x5c4e26){_0x3b3cff['push'](_0x3b3cff['shift']());}};_0x3b859c(++_0x304c19);}(_0x39cb,0x1bd));var _0xb39c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x39cb[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require(_0xb39c('0x0'));var path=require(_0xb39c('0x1'));var timeout=require('connect-timeout');var express=require(_0xb39c('0x2'));var router=express[_0xb39c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb39c('0x4'));var config=require(_0xb39c('0x5'));var controller=require(_0xb39c('0x6'));router[_0xb39c('0x7')]('/',auth[_0xb39c('0x8')](),controller['index']);router[_0xb39c('0x7')](_0xb39c('0x9'),auth[_0xb39c('0x8')](),controller[_0xb39c('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb39c('0xb')]);router[_0xb39c('0xc')](_0xb39c('0xd'),auth[_0xb39c('0x8')](),controller['bulkCreate']);router['post']('/:id/create_many',auth[_0xb39c('0x8')](),controller[_0xb39c('0xe')]);router[_0xb39c('0xf')](_0xb39c('0x9'),auth[_0xb39c('0x8')](),controller[_0xb39c('0x10')]);router[_0xb39c('0x11')](_0xb39c('0x12'),auth['isAuthenticated'](),controller[_0xb39c('0x13')]);router[_0xb39c('0x11')](_0xb39c('0x9'),auth['isAuthenticated'](),controller[_0xb39c('0x14')]);module[_0xb39c('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index c3faa7f..750a733 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 _0x1717=['STRING','name','TEXT','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1717,0xfd));var _0x7171=function(_0x30f030,_0xd03b7a){_0x30f030=_0x30f030-0x0;var _0xf7614f=_0x1717[_0x30f030];return _0xf7614f;};'use strict';var Sequelize=require(_0x7171('0x0'));module[_0x7171('0x1')]={'name':{'type':Sequelize[_0x7171('0x2')],'allowNull':![],'unique':_0x7171('0x3')},'table':{'type':Sequelize[_0x7171('0x2')]},'metric':{'type':Sequelize[_0x7171('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1cbc=['STRING','name','exports'];(function(_0x6968e0,_0x3a31f6){var _0x243597=function(_0xb49140){while(--_0xb49140){_0x6968e0['push'](_0x6968e0['shift']());}};_0x243597(++_0x3a31f6);}(_0x1cbc,0x1b2));var _0xc1cb=function(_0x433774,_0x399331){_0x433774=_0x433774-0x0;var _0x34900a=_0x1cbc[_0x433774];return _0x34900a;};'use strict';var Sequelize=require('sequelize');module[_0xc1cb('0x0')]={'name':{'type':Sequelize[_0xc1cb('0x1')],'allowNull':![],'unique':_0xc1cb('0x2')},'table':{'type':Sequelize[_0xc1cb('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xc1cb('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 4a0b415..1988f07 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 _0x790c=['find','catch','create','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','reject','save','then','get','Metrics','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','field','filter','merge','options','includeAll','include','rows','show','params'];(function(_0x38d6f8,_0x36557c){var _0x3d54fd=function(_0x22e4de){while(--_0x22e4de){_0x38d6f8['push'](_0x38d6f8['shift']());}};_0x3d54fd(++_0x36557c);}(_0x790c,0xad));var _0xc790=function(_0x37419b,_0x1848ff){_0x37419b=_0x37419b-0x0;var _0x3752a3=_0x790c[_0x37419b];return _0x3752a3;};'use strict';var pdf=require(_0xc790('0x0'));var emlformat=require(_0xc790('0x1'));var rimraf=require(_0xc790('0x2'));var zipdir=require(_0xc790('0x3'));var jsonpatch=require(_0xc790('0x4'));var rp=require(_0xc790('0x5'));var moment=require(_0xc790('0x6'));var BPromise=require(_0xc790('0x7'));var Mustache=require(_0xc790('0x8'));var util=require(_0xc790('0x9'));var path=require('path');var sox=require(_0xc790('0xa'));var csv=require(_0xc790('0xb'));var ejs=require(_0xc790('0xc'));var fs=require('fs');var _=require(_0xc790('0xd'));var squel=require(_0xc790('0xe'));var crypto=require(_0xc790('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc790('0xb'));var querystring=require(_0xc790('0x10'));var Papa=require('papaparse');var authService=require(_0xc790('0x11'));var hardwareService=require(_0xc790('0x12'));var Redis=require(_0xc790('0x13'));var qs=require(_0xc790('0x14'));var logger=require(_0xc790('0x15'))(_0xc790('0x16'));var utils=require('../../config/utils');var config=require(_0xc790('0x17'));var db=require(_0xc790('0x18'))['db'];function respondWithStatusCode(_0x2b403b,_0x1459e4){_0x1459e4=_0x1459e4||0xcc;return function(_0x21a159){if(_0x21a159){return _0x2b403b[_0xc790('0x19')](_0x1459e4);}return _0x2b403b[_0xc790('0x1a')](_0x1459e4)[_0xc790('0x1b')]();};}function respondWithResult(_0xa38988,_0x563688){_0x563688=_0x563688||0xc8;return function(_0xeddc37){if(_0xeddc37){return _0xa38988[_0xc790('0x1a')](_0x563688)['json'](_0xeddc37);}};}function respondWithFilteredResult(_0xe0611c,_0x4347f5){return function(_0x455928){if(_0x455928){var _0x4fef85=_0x455928[_0xc790('0x1c')],_0x43ce87=_0x4347f5[_0xc790('0x1d')],_0x586912=_0x4347f5[_0xc790('0x1d')]+_0x4347f5[_0xc790('0x1e')],_0x40f243;if(_0x586912>=_0x4fef85){_0x586912=_0x4fef85;_0x40f243=0xc8;}else{_0x40f243=0xce;}_0xe0611c[_0xc790('0x1a')](_0x40f243);return _0xe0611c[_0xc790('0x1f')]('Content-Range',_0x43ce87+'-'+_0x586912+'/'+_0x4fef85)[_0xc790('0x20')](_0x455928);}return null;};}function patchUpdates(_0xaf49cc){return function(_0x3d6948){try{jsonpatch['apply'](_0x3d6948,_0xaf49cc,!![]);}catch(_0x6cced5){return BPromise[_0xc790('0x21')](_0x6cced5);}return _0x3d6948[_0xc790('0x22')]();};}function saveUpdates(_0x5213de,_0xc8a709){return function(_0x5d8107){if(_0x5d8107){return _0x5d8107['update'](_0x5213de)[_0xc790('0x23')](function(_0x1a36b9){return _0x1a36b9;});}return null;};}function removeEntity(_0x101510,_0x1c459a){return function(_0x2da1e3){if(_0x2da1e3){return _0x2da1e3['destroy']()['then'](function(){var _0x92ffdb=_0x2da1e3[_0xc790('0x24')]({'plain':!![]});var _0x5915d9=_0xc790('0x25');return db['UserProfileResource'][_0xc790('0x26')]({'where':{'type':_0x5915d9,'resourceId':_0x92ffdb['id']}})[_0xc790('0x23')](function(){return _0x2da1e3;});})[_0xc790('0x23')](function(){_0x101510[_0xc790('0x1a')](0xcc)[_0xc790('0x1b')]();});}};}function handleEntityNotFound(_0x3bee84,_0x107438){return function(_0x152b79){if(!_0x152b79){_0x3bee84['sendStatus'](0x194);}return _0x152b79;};}function handleError(_0x5cbb3d,_0x2961a4){_0x2961a4=_0x2961a4||0x1f4;return function(_0x107dee){logger[_0xc790('0x27')](_0x107dee[_0xc790('0x28')]);if(_0x107dee[_0xc790('0x29')]){delete _0x107dee[_0xc790('0x29')];}_0x5cbb3d[_0xc790('0x1a')](_0x2961a4)[_0xc790('0x2a')](_0x107dee);};}exports['index']=function(_0x10abdf,_0x350756){var _0x5e928f={},_0x9aa1d8={},_0x31b570={'count':0x0,'rows':[]};var _0x38915c=db[_0xc790('0x2b')][_0xc790('0x2c')];_0x9aa1d8[_0xc790('0x2d')]=_['keys'](_0x38915c);_0x9aa1d8[_0xc790('0x2e')]=_[_0xc790('0x2f')](_0x10abdf['query']);_0x9aa1d8[_0xc790('0x30')]=_[_0xc790('0x31')](_0x9aa1d8[_0xc790('0x2d')],_0x9aa1d8[_0xc790('0x2e')]);_0x5e928f[_0xc790('0x32')]=_[_0xc790('0x31')](_0x9aa1d8[_0xc790('0x2d')],qs['fields'](_0x10abdf[_0xc790('0x2e')][_0xc790('0x33')]));_0x5e928f['attributes']=_0x5e928f[_0xc790('0x32')][_0xc790('0x34')]?_0x5e928f['attributes']:_0x9aa1d8['model'];if(!_0x10abdf[_0xc790('0x2e')][_0xc790('0x35')](_0xc790('0x36'))){_0x5e928f[_0xc790('0x1e')]=qs['limit'](_0x10abdf[_0xc790('0x2e')][_0xc790('0x1e')]);_0x5e928f[_0xc790('0x1d')]=qs['offset'](_0x10abdf[_0xc790('0x2e')][_0xc790('0x1d')]);}_0x5e928f[_0xc790('0x37')]=qs[_0xc790('0x38')](_0x10abdf[_0xc790('0x2e')][_0xc790('0x38')]);_0x5e928f[_0xc790('0x39')]=qs[_0xc790('0x30')](_[_0xc790('0x3a')](_0x10abdf['query'],_0x9aa1d8['filters']));if(_0x10abdf[_0xc790('0x2e')]['filter']){_0x5e928f[_0xc790('0x39')]=_['merge'](_0x5e928f['where'],{'$or':_['map'](_0x38915c,function(_0x327add){if(_0x327add[_0xc790('0x3b')]['key']!==_0xc790('0x3c')){var _0x4ac172={};_0x4ac172[_0x327add[_0xc790('0x3d')]]={'$like':'%'+_0x10abdf[_0xc790('0x2e')][_0xc790('0x3e')]+'%'};return _0x4ac172;}})});}_0x5e928f=_[_0xc790('0x3f')]({},_0x5e928f,_0x10abdf[_0xc790('0x40')]);var _0x1334f1={'where':_0x5e928f[_0xc790('0x39')]};return db['AnalyticMetric'][_0xc790('0x1c')](_0x1334f1)['then'](function(_0x4cf83e){_0x31b570[_0xc790('0x1c')]=_0x4cf83e;if(_0x10abdf[_0xc790('0x2e')][_0xc790('0x41')]){_0x5e928f[_0xc790('0x42')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5e928f);})[_0xc790('0x23')](function(_0x59e198){_0x31b570[_0xc790('0x43')]=_0x59e198;return _0x31b570;})[_0xc790('0x23')](respondWithFilteredResult(_0x350756,_0x5e928f))['catch'](handleError(_0x350756,null));};exports[_0xc790('0x44')]=function(_0x5e7926,_0x212b29){var _0x1fc3eb={'raw':!![],'where':{'id':_0x5e7926[_0xc790('0x45')]['id']}},_0xf3469a={};_0xf3469a['model']=_['keys'](db[_0xc790('0x2b')][_0xc790('0x2c')]);_0xf3469a[_0xc790('0x2e')]=_[_0xc790('0x2f')](_0x5e7926['query']);_0xf3469a[_0xc790('0x30')]=_[_0xc790('0x31')](_0xf3469a[_0xc790('0x2d')],_0xf3469a['query']);_0x1fc3eb[_0xc790('0x32')]=_[_0xc790('0x31')](_0xf3469a[_0xc790('0x2d')],qs['fields'](_0x5e7926[_0xc790('0x2e')][_0xc790('0x33')]));_0x1fc3eb[_0xc790('0x32')]=_0x1fc3eb[_0xc790('0x32')][_0xc790('0x34')]?_0x1fc3eb[_0xc790('0x32')]:_0xf3469a['model'];if(_0x5e7926[_0xc790('0x2e')][_0xc790('0x41')]){_0x1fc3eb[_0xc790('0x42')]=[{'all':!![]}];}_0x1fc3eb=_[_0xc790('0x3f')]({},_0x1fc3eb,_0x5e7926[_0xc790('0x40')]);return db['AnalyticMetric'][_0xc790('0x46')](_0x1fc3eb)[_0xc790('0x23')](handleEntityNotFound(_0x212b29,null))['then'](respondWithResult(_0x212b29,null))[_0xc790('0x47')](handleError(_0x212b29,null));};exports[_0xc790('0x48')]=function(_0x17d2b2,_0x443e3d){return db[_0xc790('0x2b')]['create'](_0x17d2b2['body'],{})['then'](function(_0x462bc3){var _0x6b1946=_0x17d2b2[_0xc790('0x49')][_0xc790('0x24')]({'plain':!![]});if(!_0x6b1946)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6b1946[_0xc790('0x4a')]==='user'){var _0x36907f=_0x462bc3['get']({'plain':!![]});var _0x32ab8f=_0xc790('0x25');return db['UserProfileSection'][_0xc790('0x46')]({'where':{'name':_0x32ab8f,'userProfileId':_0x6b1946[_0xc790('0x4b')]},'raw':!![]})[_0xc790('0x23')](function(_0x546beb){if(_0x546beb&&_0x546beb[_0xc790('0x4c')]===0x0){return db[_0xc790('0x4d')][_0xc790('0x48')]({'name':_0x36907f[_0xc790('0x29')],'resourceId':_0x36907f['id'],'type':_0x546beb[_0xc790('0x29')],'sectionId':_0x546beb['id']},{})[_0xc790('0x23')](function(){return _0x462bc3;});}else{return _0x462bc3;}})[_0xc790('0x47')](function(_0x22c286){logger[_0xc790('0x27')](_0xc790('0x4e'),_0x22c286);throw _0x22c286;});}return _0x462bc3;})[_0xc790('0x23')](respondWithResult(_0x443e3d,0xc9))[_0xc790('0x47')](handleError(_0x443e3d,null));};exports[_0xc790('0x4f')]=function(_0x286083,_0x27df10){if(_0x286083[_0xc790('0x50')]['id']){delete _0x286083['body']['id'];}return db[_0xc790('0x2b')][_0xc790('0x46')]({'where':{'id':_0x286083[_0xc790('0x45')]['id']}})['then'](handleEntityNotFound(_0x27df10,null))['then'](saveUpdates(_0x286083['body'],null))['then'](respondWithResult(_0x27df10,null))[_0xc790('0x47')](handleError(_0x27df10,null));};exports[_0xc790('0x26')]=function(_0x48a752,_0x1e6eeb){return db[_0xc790('0x2b')][_0xc790('0x46')]({'where':{'id':_0x48a752[_0xc790('0x45')]['id']}})[_0xc790('0x23')](handleEntityNotFound(_0x1e6eeb,null))[_0xc790('0x23')](removeEntity(_0x1e6eeb,null))[_0xc790('0x47')](handleError(_0x1e6eeb,null));}; \ No newline at end of file +var _0xabc7=['request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','Metrics','then','error','stack','name','send','index','AnalyticMetric','rawAttributes','keys','query','model','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter','merge','key','field','options','where','include','rows','catch','show','params','fields','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','fast-json-patch'];(function(_0x46b00a,_0x18cd84){var _0xad86f1=function(_0x40da50){while(--_0x40da50){_0x46b00a['push'](_0x46b00a['shift']());}};_0xad86f1(++_0x18cd84);}(_0xabc7,0x139));var _0x7abc=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xabc7[_0x580576];return _0x3f55a0;};'use strict';var pdf=require(_0x7abc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7abc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7abc('0x2'));var rp=require(_0x7abc('0x3'));var moment=require(_0x7abc('0x4'));var BPromise=require(_0x7abc('0x5'));var Mustache=require(_0x7abc('0x6'));var util=require(_0x7abc('0x7'));var path=require(_0x7abc('0x8'));var sox=require('sox');var csv=require(_0x7abc('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7abc('0xa'));var squel=require(_0x7abc('0xb'));var crypto=require(_0x7abc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7abc('0xd'));var toCsv=require(_0x7abc('0x9'));var querystring=require(_0x7abc('0xe'));var Papa=require(_0x7abc('0xf'));var authService=require(_0x7abc('0x10'));var hardwareService=require(_0x7abc('0x11'));var Redis=require(_0x7abc('0x12'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x7abc('0x13'));var utils=require(_0x7abc('0x14'));var config=require('../../config/environment');var db=require(_0x7abc('0x15'))['db'];function respondWithStatusCode(_0x7c374f,_0x54c201){_0x54c201=_0x54c201||0xcc;return function(_0x3c8b07){if(_0x3c8b07){return _0x7c374f[_0x7abc('0x16')](_0x54c201);}return _0x7c374f[_0x7abc('0x17')](_0x54c201)[_0x7abc('0x18')]();};}function respondWithResult(_0xdb951,_0x245793){_0x245793=_0x245793||0xc8;return function(_0x50cfd1){if(_0x50cfd1){return _0xdb951[_0x7abc('0x17')](_0x245793)['json'](_0x50cfd1);}};}function respondWithFilteredResult(_0x18f7d7,_0x1ffea4){return function(_0x2524e9){if(_0x2524e9){var _0x175c0d=_0x2524e9[_0x7abc('0x19')],_0x22180d=_0x1ffea4[_0x7abc('0x1a')],_0x5011d4=_0x1ffea4[_0x7abc('0x1a')]+_0x1ffea4['limit'],_0x1d89c7;if(_0x5011d4>=_0x175c0d){_0x5011d4=_0x175c0d;_0x1d89c7=0xc8;}else{_0x1d89c7=0xce;}_0x18f7d7['status'](_0x1d89c7);return _0x18f7d7[_0x7abc('0x1b')](_0x7abc('0x1c'),_0x22180d+'-'+_0x5011d4+'/'+_0x175c0d)['json'](_0x2524e9);}return null;};}function patchUpdates(_0x468191){return function(_0x2f33f9){try{jsonpatch[_0x7abc('0x1d')](_0x2f33f9,_0x468191,!![]);}catch(_0xf1fcd5){return BPromise[_0x7abc('0x1e')](_0xf1fcd5);}return _0x2f33f9[_0x7abc('0x1f')]();};}function saveUpdates(_0xca55c6,_0x23ac10){return function(_0x388dee){if(_0x388dee){return _0x388dee[_0x7abc('0x20')](_0xca55c6)['then'](function(_0x519603){return _0x519603;});}return null;};}function removeEntity(_0x275013,_0x34eba9){return function(_0x1f29c0){if(_0x1f29c0){return _0x1f29c0[_0x7abc('0x21')]()['then'](function(){var _0x2a76f2=_0x1f29c0[_0x7abc('0x22')]({'plain':!![]});var _0x410ea0=_0x7abc('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x410ea0,'resourceId':_0x2a76f2['id']}})[_0x7abc('0x24')](function(){return _0x1f29c0;});})[_0x7abc('0x24')](function(){_0x275013[_0x7abc('0x17')](0xcc)[_0x7abc('0x18')]();});}};}function handleEntityNotFound(_0x4ba9db,_0x31193b){return function(_0x142451){if(!_0x142451){_0x4ba9db[_0x7abc('0x16')](0x194);}return _0x142451;};}function handleError(_0x4541c6,_0x5e68c6){_0x5e68c6=_0x5e68c6||0x1f4;return function(_0x3c376c){logger[_0x7abc('0x25')](_0x3c376c[_0x7abc('0x26')]);if(_0x3c376c[_0x7abc('0x27')]){delete _0x3c376c[_0x7abc('0x27')];}_0x4541c6[_0x7abc('0x17')](_0x5e68c6)[_0x7abc('0x28')](_0x3c376c);};}exports[_0x7abc('0x29')]=function(_0x2da223,_0x5b973b){var _0xf47d5d={},_0x39ad72={},_0x51d37c={'count':0x0,'rows':[]};var _0x43fe11=db[_0x7abc('0x2a')][_0x7abc('0x2b')];_0x39ad72['model']=_[_0x7abc('0x2c')](_0x43fe11);_0x39ad72[_0x7abc('0x2d')]=_['keys'](_0x2da223[_0x7abc('0x2d')]);_0x39ad72['filters']=_['intersection'](_0x39ad72[_0x7abc('0x2e')],_0x39ad72[_0x7abc('0x2d')]);_0xf47d5d['attributes']=_[_0x7abc('0x2f')](_0x39ad72[_0x7abc('0x2e')],qs['fields'](_0x2da223[_0x7abc('0x2d')]['fields']));_0xf47d5d['attributes']=_0xf47d5d[_0x7abc('0x30')][_0x7abc('0x31')]?_0xf47d5d[_0x7abc('0x30')]:_0x39ad72[_0x7abc('0x2e')];if(!_0x2da223[_0x7abc('0x2d')][_0x7abc('0x32')](_0x7abc('0x33'))){_0xf47d5d[_0x7abc('0x34')]=qs[_0x7abc('0x34')](_0x2da223['query'][_0x7abc('0x34')]);_0xf47d5d[_0x7abc('0x1a')]=qs[_0x7abc('0x1a')](_0x2da223[_0x7abc('0x2d')][_0x7abc('0x1a')]);}_0xf47d5d[_0x7abc('0x35')]=qs[_0x7abc('0x36')](_0x2da223[_0x7abc('0x2d')][_0x7abc('0x36')]);_0xf47d5d['where']=qs['filters'](_[_0x7abc('0x37')](_0x2da223[_0x7abc('0x2d')],_0x39ad72[_0x7abc('0x38')]));if(_0x2da223[_0x7abc('0x2d')][_0x7abc('0x39')]){_0xf47d5d['where']=_[_0x7abc('0x3a')](_0xf47d5d['where'],{'$or':_['map'](_0x43fe11,function(_0x457838){if(_0x457838['type'][_0x7abc('0x3b')]!=='VIRTUAL'){var _0x4b1f4a={};_0x4b1f4a[_0x457838[_0x7abc('0x3c')]]={'$like':'%'+_0x2da223[_0x7abc('0x2d')][_0x7abc('0x39')]+'%'};return _0x4b1f4a;}})});}_0xf47d5d=_[_0x7abc('0x3a')]({},_0xf47d5d,_0x2da223[_0x7abc('0x3d')]);var _0x433edf={'where':_0xf47d5d[_0x7abc('0x3e')]};return db[_0x7abc('0x2a')][_0x7abc('0x19')](_0x433edf)[_0x7abc('0x24')](function(_0x463c8b){_0x51d37c['count']=_0x463c8b;if(_0x2da223[_0x7abc('0x2d')]['includeAll']){_0xf47d5d[_0x7abc('0x3f')]=[{'all':!![]}];}return db[_0x7abc('0x2a')]['findAll'](_0xf47d5d);})[_0x7abc('0x24')](function(_0xad0e1e){_0x51d37c[_0x7abc('0x40')]=_0xad0e1e;return _0x51d37c;})[_0x7abc('0x24')](respondWithFilteredResult(_0x5b973b,_0xf47d5d))[_0x7abc('0x41')](handleError(_0x5b973b,null));};exports[_0x7abc('0x42')]=function(_0x145ec,_0x2a7b71){var _0x320faf={'raw':!![],'where':{'id':_0x145ec[_0x7abc('0x43')]['id']}},_0x3b0c16={};_0x3b0c16[_0x7abc('0x2e')]=_[_0x7abc('0x2c')](db[_0x7abc('0x2a')][_0x7abc('0x2b')]);_0x3b0c16['query']=_['keys'](_0x145ec[_0x7abc('0x2d')]);_0x3b0c16[_0x7abc('0x38')]=_[_0x7abc('0x2f')](_0x3b0c16[_0x7abc('0x2e')],_0x3b0c16[_0x7abc('0x2d')]);_0x320faf[_0x7abc('0x30')]=_[_0x7abc('0x2f')](_0x3b0c16[_0x7abc('0x2e')],qs[_0x7abc('0x44')](_0x145ec[_0x7abc('0x2d')][_0x7abc('0x44')]));_0x320faf['attributes']=_0x320faf['attributes'][_0x7abc('0x31')]?_0x320faf[_0x7abc('0x30')]:_0x3b0c16[_0x7abc('0x2e')];if(_0x145ec[_0x7abc('0x2d')][_0x7abc('0x45')]){_0x320faf[_0x7abc('0x3f')]=[{'all':!![]}];}_0x320faf=_[_0x7abc('0x3a')]({},_0x320faf,_0x145ec[_0x7abc('0x3d')]);return db[_0x7abc('0x2a')][_0x7abc('0x46')](_0x320faf)[_0x7abc('0x24')](handleEntityNotFound(_0x2a7b71,null))[_0x7abc('0x24')](respondWithResult(_0x2a7b71,null))[_0x7abc('0x41')](handleError(_0x2a7b71,null));};exports[_0x7abc('0x47')]=function(_0x58a37f,_0x4cbb71){return db[_0x7abc('0x2a')][_0x7abc('0x47')](_0x58a37f['body'],{})[_0x7abc('0x24')](function(_0x4762d7){var _0x3c919a=_0x58a37f[_0x7abc('0x48')][_0x7abc('0x22')]({'plain':!![]});if(!_0x3c919a)throw new Error(_0x7abc('0x49'));if(_0x3c919a['role']==='user'){var _0x2e6ef0=_0x4762d7[_0x7abc('0x22')]({'plain':!![]});var _0xb3c17d=_0x7abc('0x23');return db['UserProfileSection'][_0x7abc('0x46')]({'where':{'name':_0xb3c17d,'userProfileId':_0x3c919a[_0x7abc('0x4a')]},'raw':!![]})[_0x7abc('0x24')](function(_0x4b1da8){if(_0x4b1da8&&_0x4b1da8[_0x7abc('0x4b')]===0x0){return db[_0x7abc('0x4c')][_0x7abc('0x47')]({'name':_0x2e6ef0[_0x7abc('0x27')],'resourceId':_0x2e6ef0['id'],'type':_0x4b1da8[_0x7abc('0x27')],'sectionId':_0x4b1da8['id']},{})[_0x7abc('0x24')](function(){return _0x4762d7;});}else{return _0x4762d7;}})[_0x7abc('0x41')](function(_0x25376a){logger[_0x7abc('0x25')](_0x7abc('0x4d'),_0x25376a);throw _0x25376a;});}return _0x4762d7;})[_0x7abc('0x24')](respondWithResult(_0x4cbb71,0xc9))[_0x7abc('0x41')](handleError(_0x4cbb71,null));};exports['update']=function(_0x476598,_0x448a14){if(_0x476598[_0x7abc('0x4e')]['id']){delete _0x476598[_0x7abc('0x4e')]['id'];}return db[_0x7abc('0x2a')][_0x7abc('0x46')]({'where':{'id':_0x476598[_0x7abc('0x43')]['id']}})[_0x7abc('0x24')](handleEntityNotFound(_0x448a14,null))[_0x7abc('0x24')](saveUpdates(_0x476598[_0x7abc('0x4e')],null))[_0x7abc('0x24')](respondWithResult(_0x448a14,null))['catch'](handleError(_0x448a14,null));};exports['destroy']=function(_0x471630,_0x50b33a){return db[_0x7abc('0x2a')][_0x7abc('0x46')]({'where':{'id':_0x471630[_0x7abc('0x43')]['id']}})[_0x7abc('0x24')](handleEntityNotFound(_0x50b33a,null))[_0x7abc('0x24')](removeEntity(_0x50b33a,null))[_0x7abc('0x41')](handleError(_0x50b33a,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index d78b598..6f1c7ee 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 _0x2f88=['lodash','util','../../config/logger','api','bluebird','./analyticMetric.attributes','AnalyticMetric'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2f88,0xfc));var _0x82f8=function(_0x242c41,_0x6b609f){_0x242c41=_0x242c41-0x0;var _0x31fd2b=_0x2f88[_0x242c41];return _0x31fd2b;};'use strict';var _=require(_0x82f8('0x0'));var util=require(_0x82f8('0x1'));var logger=require(_0x82f8('0x2'))(_0x82f8('0x3'));var moment=require('moment');var BPromise=require(_0x82f8('0x4'));var rp=require('request-promise');var attributes=require(_0x82f8('0x5'));module['exports']=function(_0x58e9f4,_0x5bf5c2){return _0x58e9f4['define'](_0x82f8('0x6'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ab1=['util','api','moment','request-promise','./analyticMetric.attributes','exports','lodash'];(function(_0xa451c2,_0x28be99){var _0x2776e4=function(_0xc47a35){while(--_0xc47a35){_0xa451c2['push'](_0xa451c2['shift']());}};_0x2776e4(++_0x28be99);}(_0x7ab1,0x1cd));var _0x17ab=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x7ab1[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x17ab('0x0'));var util=require(_0x17ab('0x1'));var logger=require('../../config/logger')(_0x17ab('0x2'));var moment=require(_0x17ab('0x3'));var BPromise=require('bluebird');var rp=require(_0x17ab('0x4'));var attributes=require(_0x17ab('0x5'));module[_0x17ab('0x6')]=function(_0x2d3c09,_0x4221e7){return _0x2d3c09['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index a47752c..1c112d0 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 _0x1f63=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1f63,0x7a));var _0x31f6=function(_0x4e2440,_0x4ec0f9){_0x4e2440=_0x4e2440-0x0;var _0x19cf80=_0x1f63[_0x4e2440];return _0x19cf80;};'use strict';var _=require(_0x31f6('0x0'));var util=require(_0x31f6('0x1'));var moment=require('moment');var BPromise=require(_0x31f6('0x2'));var rs=require(_0x31f6('0x3'));var fs=require('fs');var Redis=require(_0x31f6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x31f6('0x5'));var logger=require(_0x31f6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x31f6('0x7'));var client=jayson[_0x31f6('0x8')][_0x31f6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d857b,_0x80bae8,_0x46a769){return new BPromise(function(_0x213c68,_0x55a2ab){return client['request'](_0x4d857b,_0x46a769)[_0x31f6('0xa')](function(_0x4dba97){logger[_0x31f6('0xb')](_0x31f6('0xc'),_0x80bae8,_0x31f6('0xd'));logger[_0x31f6('0xe')](_0x31f6('0xf'),_0x80bae8,_0x31f6('0xd'),JSON[_0x31f6('0x10')](_0x4dba97));if(_0x4dba97[_0x31f6('0x11')]){if(_0x4dba97['error'][_0x31f6('0x12')]===0x1f4){logger[_0x31f6('0x11')](_0x31f6('0xc'),_0x80bae8,_0x4dba97[_0x31f6('0x11')][_0x31f6('0x13')]);return _0x55a2ab(_0x4dba97[_0x31f6('0x11')][_0x31f6('0x13')]);}logger[_0x31f6('0x11')](_0x31f6('0xc'),_0x80bae8,_0x4dba97['error'][_0x31f6('0x13')]);return _0x213c68(_0x4dba97['error'][_0x31f6('0x13')]);}else{logger['info'](_0x31f6('0xc'),_0x80bae8,_0x31f6('0xd'));_0x213c68(_0x4dba97[_0x31f6('0x14')][_0x31f6('0x13')]);}})[_0x31f6('0x15')](function(_0x5239d0){logger[_0x31f6('0x11')](_0x31f6('0xc'),_0x80bae8,_0x5239d0);_0x55a2ab(_0x5239d0);});});} \ No newline at end of file +var _0xa4fb=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x41d902,_0x29d0b){var _0x360fb1=function(_0x2517ae){while(--_0x2517ae){_0x41d902['push'](_0x41d902['shift']());}};_0x360fb1(++_0x29d0b);}(_0xa4fb,0x150));var _0xba4f=function(_0x3a0863,_0x4cd5ef){_0x3a0863=_0x3a0863-0x0;var _0x85c557=_0xa4fb[_0x3a0863];return _0x85c557;};'use strict';var _=require(_0xba4f('0x0'));var util=require(_0xba4f('0x1'));var moment=require(_0xba4f('0x2'));var BPromise=require(_0xba4f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba4f('0x4'))['db'];var utils=require(_0xba4f('0x5'));var logger=require(_0xba4f('0x6'))('rpc');var config=require(_0xba4f('0x7'));var jayson=require(_0xba4f('0x8'));var client=jayson[_0xba4f('0x9')][_0xba4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x172ff5,_0xbc1848,_0xb2f7ce){return new BPromise(function(_0x1af837,_0x399847){return client[_0xba4f('0xb')](_0x172ff5,_0xb2f7ce)['then'](function(_0x1d0d85){logger['info'](_0xba4f('0xc'),_0xbc1848,_0xba4f('0xd'));logger[_0xba4f('0xe')](_0xba4f('0xf'),_0xbc1848,_0xba4f('0xd'),JSON[_0xba4f('0x10')](_0x1d0d85));if(_0x1d0d85['error']){if(_0x1d0d85[_0xba4f('0x11')][_0xba4f('0x12')]===0x1f4){logger[_0xba4f('0x11')](_0xba4f('0xc'),_0xbc1848,_0x1d0d85[_0xba4f('0x11')][_0xba4f('0x13')]);return _0x399847(_0x1d0d85[_0xba4f('0x11')][_0xba4f('0x13')]);}logger[_0xba4f('0x11')](_0xba4f('0xc'),_0xbc1848,_0x1d0d85['error'][_0xba4f('0x13')]);return _0x1af837(_0x1d0d85[_0xba4f('0x11')][_0xba4f('0x13')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0xbc1848,_0xba4f('0xd'));_0x1af837(_0x1d0d85[_0xba4f('0x14')][_0xba4f('0x13')]);}})[_0xba4f('0x15')](function(_0x218dea){logger[_0xba4f('0x11')](_0xba4f('0xc'),_0xbc1848,_0x218dea);_0x399847(_0x218dea);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 631a876..f44cbdd 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 _0xd7d1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2827b9,_0x4c98fe){var _0x49fd3a=function(_0x35d5a0){while(--_0x35d5a0){_0x2827b9['push'](_0x2827b9['shift']());}};_0x49fd3a(++_0x4c98fe);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0xf5fda4,_0x266ada){_0xf5fda4=_0xf5fda4-0x0;var _0x5c01fd=_0xd7d1[_0xf5fda4];return _0x5c01fd;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var auth=require(_0x1d7d('0x6'));var interaction=require(_0x1d7d('0x7'));var config=require(_0x1d7d('0x8'));var controller=require(_0x1d7d('0x9'));router[_0x1d7d('0xa')]('/',auth[_0x1d7d('0xb')](),controller[_0x1d7d('0xc')]);router['get'](_0x1d7d('0xd'),auth[_0x1d7d('0xb')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xf')]('/',auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0x11')](_0x1d7d('0xd'),auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/:id',auth[_0x1d7d('0xb')](),controller['destroy']);module[_0x1d7d('0x14')]=router; \ No newline at end of file +var _0x5464=['express','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','show','post','create','put','/:id','update','destroy','multer','util','path'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0x5464,0x15d));var _0x4546=function(_0x1badd2,_0x1a0299){_0x1badd2=_0x1badd2-0x0;var _0x1c40de=_0x5464[_0x1badd2];return _0x1c40de;};'use strict';var multer=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var path=require(_0x4546('0x2'));var timeout=require('connect-timeout');var express=require(_0x4546('0x3'));var router=express['Router']();var auth=require(_0x4546('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4546('0x5'));var controller=require(_0x4546('0x6'));router[_0x4546('0x7')]('/',auth[_0x4546('0x8')](),controller['index']);router['get']('/:id',auth[_0x4546('0x8')](),controller[_0x4546('0x9')]);router[_0x4546('0xa')]('/',auth[_0x4546('0x8')](),controller[_0x4546('0xb')]);router[_0x4546('0xc')](_0x4546('0xd'),auth[_0x4546('0x8')](),controller[_0x4546('0xe')]);router['delete'](_0x4546('0xd'),auth[_0x4546('0x8')](),controller[_0x4546('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index a3f6a75..9703a08 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 _0x8774=['TEXT','sequelize','exports'];(function(_0x1e373e,_0x236080){var _0x572e59=function(_0x4e97d9){while(--_0x4e97d9){_0x1e373e['push'](_0x1e373e['shift']());}};_0x572e59(++_0x236080);}(_0x8774,0xd3));var _0x4877=function(_0x3071dc,_0x24ef82){_0x3071dc=_0x3071dc-0x0;var _0x30a33b=_0x8774[_0x3071dc];return _0x30a33b;};'use strict';var Sequelize=require(_0x4877('0x0'));module[_0x4877('0x1')]={'tree':{'type':Sequelize[_0x4877('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0be4=['TEXT','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0be4,0x9f));var _0x40be=function(_0x5720e8,_0x161a6b){_0x5720e8=_0x5720e8-0x0;var _0x49390b=_0x0be4[_0x5720e8];return _0x49390b;};'use strict';var Sequelize=require(_0x40be('0x0'));module['exports']={'tree':{'type':Sequelize[_0x40be('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 50e6a6c..b112aea 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 _0x175e=['includeAll','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','Content-Range','apply','save','update','then','destroy','sendStatus','error','send','index','AnalyticTreeReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','field','options','include','findAll','rows','catch','show','params'];(function(_0x3c28c0,_0x1cb29d){var _0x12cc9f=function(_0x33d0f7){while(--_0x33d0f7){_0x3c28c0['push'](_0x3c28c0['shift']());}};_0x12cc9f(++_0x1cb29d);}(_0x175e,0x19c));var _0xe175=function(_0x38c584,_0xdfcac2){_0x38c584=_0x38c584-0x0;var _0xd8164b=_0x175e[_0x38c584];return _0xd8164b;};'use strict';var pdf=require(_0xe175('0x0'));var emlformat=require(_0xe175('0x1'));var rimraf=require(_0xe175('0x2'));var zipdir=require(_0xe175('0x3'));var jsonpatch=require(_0xe175('0x4'));var rp=require(_0xe175('0x5'));var moment=require(_0xe175('0x6'));var BPromise=require(_0xe175('0x7'));var Mustache=require(_0xe175('0x8'));var util=require('util');var path=require('path');var sox=require(_0xe175('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe175('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe175('0xb'));var deskjs=require(_0xe175('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe175('0xd'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xe175('0xe'));var qs=require(_0xe175('0xf'));var logger=require(_0xe175('0x10'))(_0xe175('0x11'));var utils=require(_0xe175('0x12'));var config=require('../../config/environment');var db=require(_0xe175('0x13'))['db'];function respondWithStatusCode(_0xdeb9f9,_0x1864b8){_0x1864b8=_0x1864b8||0xcc;return function(_0x2c5bbf){if(_0x2c5bbf){return _0xdeb9f9['sendStatus'](_0x1864b8);}return _0xdeb9f9[_0xe175('0x14')](_0x1864b8)[_0xe175('0x15')]();};}function respondWithResult(_0x3f6c83,_0xa70b7d){_0xa70b7d=_0xa70b7d||0xc8;return function(_0x783577){if(_0x783577){return _0x3f6c83[_0xe175('0x14')](_0xa70b7d)[_0xe175('0x16')](_0x783577);}};}function respondWithFilteredResult(_0xc0b218,_0x9c309f){return function(_0x402bf7){if(_0x402bf7){var _0x1d3e8b=_0x402bf7[_0xe175('0x17')],_0xb64e7e=_0x9c309f[_0xe175('0x18')],_0xb67afb=_0x9c309f[_0xe175('0x18')]+_0x9c309f['limit'],_0x110d05;if(_0xb67afb>=_0x1d3e8b){_0xb67afb=_0x1d3e8b;_0x110d05=0xc8;}else{_0x110d05=0xce;}_0xc0b218['status'](_0x110d05);return _0xc0b218['set'](_0xe175('0x19'),_0xb64e7e+'-'+_0xb67afb+'/'+_0x1d3e8b)[_0xe175('0x16')](_0x402bf7);}return null;};}function patchUpdates(_0x175088){return function(_0x4ffee5){try{jsonpatch[_0xe175('0x1a')](_0x4ffee5,_0x175088,!![]);}catch(_0x13e944){return BPromise['reject'](_0x13e944);}return _0x4ffee5[_0xe175('0x1b')]();};}function saveUpdates(_0xf6c4ba,_0x41dc6f){return function(_0xaf8806){if(_0xaf8806){return _0xaf8806[_0xe175('0x1c')](_0xf6c4ba)[_0xe175('0x1d')](function(_0x342fd2){return _0x342fd2;});}return null;};}function removeEntity(_0xc9f3c3,_0x33d490){return function(_0x302322){if(_0x302322){return _0x302322[_0xe175('0x1e')]()[_0xe175('0x1d')](function(){_0xc9f3c3[_0xe175('0x14')](0xcc)[_0xe175('0x15')]();});}};}function handleEntityNotFound(_0x301ba1,_0x390d8a){return function(_0x21cc2a){if(!_0x21cc2a){_0x301ba1[_0xe175('0x1f')](0x194);}return _0x21cc2a;};}function handleError(_0x522948,_0x104bc4){_0x104bc4=_0x104bc4||0x1f4;return function(_0x4b1b66){logger[_0xe175('0x20')](_0x4b1b66['stack']);if(_0x4b1b66['name']){delete _0x4b1b66['name'];}_0x522948[_0xe175('0x14')](_0x104bc4)[_0xe175('0x21')](_0x4b1b66);};}exports[_0xe175('0x22')]=function(_0x18a144,_0x42e208){var _0x2e4a09={},_0x18ad3b={},_0xd099c0={'count':0x0,'rows':[]};var _0x1a759d=db[_0xe175('0x23')][_0xe175('0x24')];_0x18ad3b[_0xe175('0x25')]=_[_0xe175('0x26')](_0x1a759d);_0x18ad3b[_0xe175('0x27')]=_['keys'](_0x18a144[_0xe175('0x27')]);_0x18ad3b['filters']=_[_0xe175('0x28')](_0x18ad3b['model'],_0x18ad3b[_0xe175('0x27')]);_0x2e4a09[_0xe175('0x29')]=_['intersection'](_0x18ad3b['model'],qs[_0xe175('0x2a')](_0x18a144[_0xe175('0x27')][_0xe175('0x2a')]));_0x2e4a09[_0xe175('0x29')]=_0x2e4a09[_0xe175('0x29')][_0xe175('0x2b')]?_0x2e4a09[_0xe175('0x29')]:_0x18ad3b['model'];if(!_0x18a144['query'][_0xe175('0x2c')](_0xe175('0x2d'))){_0x2e4a09['limit']=qs['limit'](_0x18a144[_0xe175('0x27')][_0xe175('0x2e')]);_0x2e4a09[_0xe175('0x18')]=qs[_0xe175('0x18')](_0x18a144['query'][_0xe175('0x18')]);}_0x2e4a09[_0xe175('0x2f')]=qs['sort'](_0x18a144[_0xe175('0x27')][_0xe175('0x30')]);_0x2e4a09[_0xe175('0x31')]=qs[_0xe175('0x32')](_[_0xe175('0x33')](_0x18a144['query'],_0x18ad3b[_0xe175('0x32')]));if(_0x18a144[_0xe175('0x27')][_0xe175('0x34')]){_0x2e4a09[_0xe175('0x31')]=_[_0xe175('0x35')](_0x2e4a09[_0xe175('0x31')],{'$or':_[_0xe175('0x36')](_0x1a759d,function(_0x5621d5){if(_0x5621d5['type']['key']!==_0xe175('0x37')){var _0x46f443={};_0x46f443[_0x5621d5[_0xe175('0x38')]]={'$like':'%'+_0x18a144[_0xe175('0x27')][_0xe175('0x34')]+'%'};return _0x46f443;}})});}_0x2e4a09=_['merge']({},_0x2e4a09,_0x18a144[_0xe175('0x39')]);var _0x1c72c8={'where':_0x2e4a09[_0xe175('0x31')]};return db['AnalyticTreeReport'][_0xe175('0x17')](_0x1c72c8)[_0xe175('0x1d')](function(_0x14980f){_0xd099c0[_0xe175('0x17')]=_0x14980f;if(_0x18a144['query']['includeAll']){_0x2e4a09[_0xe175('0x3a')]=[{'all':!![]}];}return db[_0xe175('0x23')][_0xe175('0x3b')](_0x2e4a09);})[_0xe175('0x1d')](function(_0x3ba741){_0xd099c0[_0xe175('0x3c')]=_0x3ba741;return _0xd099c0;})[_0xe175('0x1d')](respondWithFilteredResult(_0x42e208,_0x2e4a09))[_0xe175('0x3d')](handleError(_0x42e208,null));};exports[_0xe175('0x3e')]=function(_0x35b06d,_0x2af05b){var _0x239f1b={'raw':!![],'where':{'id':_0x35b06d[_0xe175('0x3f')]['id']}},_0xa9f620={};_0xa9f620['model']=_[_0xe175('0x26')](db[_0xe175('0x23')][_0xe175('0x24')]);_0xa9f620[_0xe175('0x27')]=_[_0xe175('0x26')](_0x35b06d['query']);_0xa9f620['filters']=_['intersection'](_0xa9f620[_0xe175('0x25')],_0xa9f620[_0xe175('0x27')]);_0x239f1b[_0xe175('0x29')]=_[_0xe175('0x28')](_0xa9f620[_0xe175('0x25')],qs[_0xe175('0x2a')](_0x35b06d['query'][_0xe175('0x2a')]));_0x239f1b[_0xe175('0x29')]=_0x239f1b['attributes'][_0xe175('0x2b')]?_0x239f1b[_0xe175('0x29')]:_0xa9f620[_0xe175('0x25')];if(_0x35b06d[_0xe175('0x27')][_0xe175('0x40')]){_0x239f1b[_0xe175('0x3a')]=[{'all':!![]}];}_0x239f1b=_['merge']({},_0x239f1b,_0x35b06d[_0xe175('0x39')]);return db[_0xe175('0x23')][_0xe175('0x41')](_0x239f1b)['then'](handleEntityNotFound(_0x2af05b,null))[_0xe175('0x1d')](respondWithResult(_0x2af05b,null))[_0xe175('0x3d')](handleError(_0x2af05b,null));};exports['create']=function(_0x118a7f,_0x3c34f1){return db[_0xe175('0x23')][_0xe175('0x42')](_0x118a7f['body'],{})[_0xe175('0x1d')](respondWithResult(_0x3c34f1,0xc9))[_0xe175('0x3d')](handleError(_0x3c34f1,null));};exports[_0xe175('0x1c')]=function(_0x20e3ed,_0x1bfd93){if(_0x20e3ed[_0xe175('0x43')]['id']){delete _0x20e3ed[_0xe175('0x43')]['id'];}return db['AnalyticTreeReport'][_0xe175('0x41')]({'where':{'id':_0x20e3ed[_0xe175('0x3f')]['id']}})[_0xe175('0x1d')](handleEntityNotFound(_0x1bfd93,null))[_0xe175('0x1d')](saveUpdates(_0x20e3ed[_0xe175('0x43')],null))[_0xe175('0x1d')](respondWithResult(_0x1bfd93,null))[_0xe175('0x3d')](handleError(_0x1bfd93,null));};exports[_0xe175('0x1e')]=function(_0x2491b5,_0x4299ff){return db[_0xe175('0x23')]['find']({'where':{'id':_0x2491b5[_0xe175('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4299ff,null))[_0xe175('0x1d')](removeEntity(_0x4299ff,null))[_0xe175('0x3d')](handleError(_0x4299ff,null));}; \ No newline at end of file +var _0x2f78=['nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','AnalyticTreeReport','count','includeAll','include','rows','catch','show','find','create','body','update','params','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1b74f8,_0x3db06a){var _0x49836c=function(_0x116870){while(--_0x116870){_0x1b74f8['push'](_0x1b74f8['shift']());}};_0x49836c(++_0x3db06a);}(_0x2f78,0xa8));var _0x82f7=function(_0x4394b8,_0x588309){_0x4394b8=_0x4394b8-0x0;var _0x1aa182=_0x2f78[_0x4394b8];return _0x1aa182;};'use strict';var pdf=require(_0x82f7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x82f7('0x1'));var zipdir=require(_0x82f7('0x2'));var jsonpatch=require(_0x82f7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x82f7('0x4'));var Mustache=require(_0x82f7('0x5'));var util=require(_0x82f7('0x6'));var path=require(_0x82f7('0x7'));var sox=require('sox');var csv=require(_0x82f7('0x8'));var ejs=require(_0x82f7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x82f7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x82f7('0xb'));var toCsv=require('to-csv');var querystring=require(_0x82f7('0xc'));var Papa=require(_0x82f7('0xd'));var authService=require(_0x82f7('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x82f7('0xf'));var qs=require(_0x82f7('0x10'));var logger=require('../../config/logger')(_0x82f7('0x11'));var utils=require(_0x82f7('0x12'));var config=require(_0x82f7('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fc8b8,_0x460354){_0x460354=_0x460354||0xcc;return function(_0x596de3){if(_0x596de3){return _0x4fc8b8[_0x82f7('0x14')](_0x460354);}return _0x4fc8b8['status'](_0x460354)['end']();};}function respondWithResult(_0x4e2675,_0x5a8aea){_0x5a8aea=_0x5a8aea||0xc8;return function(_0xa17557){if(_0xa17557){return _0x4e2675[_0x82f7('0x15')](_0x5a8aea)[_0x82f7('0x16')](_0xa17557);}};}function respondWithFilteredResult(_0x3bcdd3,_0x27ba08){return function(_0x5941a6){if(_0x5941a6){var _0x35d10f=_0x5941a6['count'],_0x2c3a46=_0x27ba08[_0x82f7('0x17')],_0x215f4e=_0x27ba08[_0x82f7('0x17')]+_0x27ba08[_0x82f7('0x18')],_0x13a567;if(_0x215f4e>=_0x35d10f){_0x215f4e=_0x35d10f;_0x13a567=0xc8;}else{_0x13a567=0xce;}_0x3bcdd3[_0x82f7('0x15')](_0x13a567);return _0x3bcdd3[_0x82f7('0x19')](_0x82f7('0x1a'),_0x2c3a46+'-'+_0x215f4e+'/'+_0x35d10f)['json'](_0x5941a6);}return null;};}function patchUpdates(_0x124386){return function(_0x3d6ea9){try{jsonpatch[_0x82f7('0x1b')](_0x3d6ea9,_0x124386,!![]);}catch(_0x5ce76f){return BPromise[_0x82f7('0x1c')](_0x5ce76f);}return _0x3d6ea9[_0x82f7('0x1d')]();};}function saveUpdates(_0x250bae,_0x3bf33b){return function(_0x1828ad){if(_0x1828ad){return _0x1828ad['update'](_0x250bae)[_0x82f7('0x1e')](function(_0x538190){return _0x538190;});}return null;};}function removeEntity(_0x3ae6ee,_0x178f0a){return function(_0x58096a){if(_0x58096a){return _0x58096a[_0x82f7('0x1f')]()[_0x82f7('0x1e')](function(){_0x3ae6ee['status'](0xcc)[_0x82f7('0x20')]();});}};}function handleEntityNotFound(_0xaa1a12,_0xda1b67){return function(_0x136434){if(!_0x136434){_0xaa1a12[_0x82f7('0x14')](0x194);}return _0x136434;};}function handleError(_0x5e9d7d,_0x18fc84){_0x18fc84=_0x18fc84||0x1f4;return function(_0x497403){logger[_0x82f7('0x21')](_0x497403[_0x82f7('0x22')]);if(_0x497403['name']){delete _0x497403[_0x82f7('0x23')];}_0x5e9d7d['status'](_0x18fc84)[_0x82f7('0x24')](_0x497403);};}exports[_0x82f7('0x25')]=function(_0x2a982f,_0x2f3202){var _0x446744={},_0x313853={},_0x372861={'count':0x0,'rows':[]};var _0x50cb1d=db['AnalyticTreeReport'][_0x82f7('0x26')];_0x313853[_0x82f7('0x27')]=_['keys'](_0x50cb1d);_0x313853[_0x82f7('0x28')]=_[_0x82f7('0x29')](_0x2a982f[_0x82f7('0x28')]);_0x313853[_0x82f7('0x2a')]=_[_0x82f7('0x2b')](_0x313853[_0x82f7('0x27')],_0x313853[_0x82f7('0x28')]);_0x446744[_0x82f7('0x2c')]=_[_0x82f7('0x2b')](_0x313853[_0x82f7('0x27')],qs[_0x82f7('0x2d')](_0x2a982f[_0x82f7('0x28')][_0x82f7('0x2d')]));_0x446744['attributes']=_0x446744[_0x82f7('0x2c')][_0x82f7('0x2e')]?_0x446744[_0x82f7('0x2c')]:_0x313853[_0x82f7('0x27')];if(!_0x2a982f[_0x82f7('0x28')][_0x82f7('0x2f')](_0x82f7('0x30'))){_0x446744[_0x82f7('0x18')]=qs[_0x82f7('0x18')](_0x2a982f[_0x82f7('0x28')][_0x82f7('0x18')]);_0x446744[_0x82f7('0x17')]=qs['offset'](_0x2a982f['query'][_0x82f7('0x17')]);}_0x446744[_0x82f7('0x31')]=qs[_0x82f7('0x32')](_0x2a982f[_0x82f7('0x28')][_0x82f7('0x32')]);_0x446744[_0x82f7('0x33')]=qs[_0x82f7('0x2a')](_[_0x82f7('0x34')](_0x2a982f[_0x82f7('0x28')],_0x313853[_0x82f7('0x2a')]));if(_0x2a982f[_0x82f7('0x28')][_0x82f7('0x35')]){_0x446744['where']=_[_0x82f7('0x36')](_0x446744[_0x82f7('0x33')],{'$or':_[_0x82f7('0x37')](_0x50cb1d,function(_0x5af342){if(_0x5af342['type'][_0x82f7('0x38')]!==_0x82f7('0x39')){var _0x3e84bf={};_0x3e84bf[_0x5af342[_0x82f7('0x3a')]]={'$like':'%'+_0x2a982f['query']['filter']+'%'};return _0x3e84bf;}})});}_0x446744=_[_0x82f7('0x36')]({},_0x446744,_0x2a982f[_0x82f7('0x3b')]);var _0x51d00c={'where':_0x446744[_0x82f7('0x33')]};return db[_0x82f7('0x3c')][_0x82f7('0x3d')](_0x51d00c)[_0x82f7('0x1e')](function(_0x4febb4){_0x372861[_0x82f7('0x3d')]=_0x4febb4;if(_0x2a982f[_0x82f7('0x28')][_0x82f7('0x3e')]){_0x446744[_0x82f7('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x446744);})[_0x82f7('0x1e')](function(_0x437ae4){_0x372861[_0x82f7('0x40')]=_0x437ae4;return _0x372861;})[_0x82f7('0x1e')](respondWithFilteredResult(_0x2f3202,_0x446744))[_0x82f7('0x41')](handleError(_0x2f3202,null));};exports[_0x82f7('0x42')]=function(_0x5b7c53,_0x13093e){var _0x4deebf={'raw':!![],'where':{'id':_0x5b7c53['params']['id']}},_0x50825f={};_0x50825f[_0x82f7('0x27')]=_[_0x82f7('0x29')](db['AnalyticTreeReport'][_0x82f7('0x26')]);_0x50825f[_0x82f7('0x28')]=_[_0x82f7('0x29')](_0x5b7c53['query']);_0x50825f[_0x82f7('0x2a')]=_[_0x82f7('0x2b')](_0x50825f[_0x82f7('0x27')],_0x50825f[_0x82f7('0x28')]);_0x4deebf[_0x82f7('0x2c')]=_['intersection'](_0x50825f[_0x82f7('0x27')],qs[_0x82f7('0x2d')](_0x5b7c53['query']['fields']));_0x4deebf[_0x82f7('0x2c')]=_0x4deebf[_0x82f7('0x2c')][_0x82f7('0x2e')]?_0x4deebf[_0x82f7('0x2c')]:_0x50825f[_0x82f7('0x27')];if(_0x5b7c53[_0x82f7('0x28')][_0x82f7('0x3e')]){_0x4deebf[_0x82f7('0x3f')]=[{'all':!![]}];}_0x4deebf=_['merge']({},_0x4deebf,_0x5b7c53[_0x82f7('0x3b')]);return db['AnalyticTreeReport'][_0x82f7('0x43')](_0x4deebf)[_0x82f7('0x1e')](handleEntityNotFound(_0x13093e,null))[_0x82f7('0x1e')](respondWithResult(_0x13093e,null))[_0x82f7('0x41')](handleError(_0x13093e,null));};exports[_0x82f7('0x44')]=function(_0x5813b9,_0xf2267b){return db[_0x82f7('0x3c')][_0x82f7('0x44')](_0x5813b9[_0x82f7('0x45')],{})[_0x82f7('0x1e')](respondWithResult(_0xf2267b,0xc9))[_0x82f7('0x41')](handleError(_0xf2267b,null));};exports[_0x82f7('0x46')]=function(_0x5888b3,_0x1701c8){if(_0x5888b3[_0x82f7('0x45')]['id']){delete _0x5888b3[_0x82f7('0x45')]['id'];}return db[_0x82f7('0x3c')]['find']({'where':{'id':_0x5888b3[_0x82f7('0x47')]['id']}})[_0x82f7('0x1e')](handleEntityNotFound(_0x1701c8,null))[_0x82f7('0x1e')](saveUpdates(_0x5888b3[_0x82f7('0x45')],null))[_0x82f7('0x1e')](respondWithResult(_0x1701c8,null))['catch'](handleError(_0x1701c8,null));};exports['destroy']=function(_0x1deafb,_0x4aba8a){return db[_0x82f7('0x3c')][_0x82f7('0x43')]({'where':{'id':_0x1deafb[_0x82f7('0x47')]['id']}})[_0x82f7('0x1e')](handleEntityNotFound(_0x4aba8a,null))[_0x82f7('0x1e')](removeEntity(_0x4aba8a,null))['catch'](handleError(_0x4aba8a,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index d565ed6..61602d7 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 _0xbddd=['util','moment','bluebird','request-promise','define','AnalyticTreeReport','lodash'];(function(_0x19d6dc,_0x3e7b56){var _0x7b5ebf=function(_0x48424a){while(--_0x48424a){_0x19d6dc['push'](_0x19d6dc['shift']());}};_0x7b5ebf(++_0x3e7b56);}(_0xbddd,0x1cd));var _0xdbdd=function(_0x4f0b89,_0x399161){_0x4f0b89=_0x4f0b89-0x0;var _0x1c0c9f=_0xbddd[_0x4f0b89];return _0x1c0c9f;};'use strict';var _=require(_0xdbdd('0x0'));var util=require(_0xdbdd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdbdd('0x2'));var BPromise=require(_0xdbdd('0x3'));var rp=require(_0xdbdd('0x4'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x1742b6,_0x295a07){return _0x1742b6[_0xdbdd('0x5')](_0xdbdd('0x6'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c0c=['request-promise','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','moment','bluebird'];(function(_0x526d87,_0x36a1d3){var _0x58403b=function(_0xc9e5f6){while(--_0xc9e5f6){_0x526d87['push'](_0x526d87['shift']());}};_0x58403b(++_0x36a1d3);}(_0x8c0c,0x7e));var _0xc8c0=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x8c0c[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xc8c0('0x0'));var util=require('util');var logger=require(_0xc8c0('0x1'))('api');var moment=require(_0xc8c0('0x2'));var BPromise=require(_0xc8c0('0x3'));var rp=require(_0xc8c0('0x4'));var attributes=require(_0xc8c0('0x5'));module[_0xc8c0('0x6')]=function(_0x5d3614,_0x113b3d){return _0x5d3614[_0xc8c0('0x7')](_0xc8c0('0x8'),attributes,{'tableName':_0xc8c0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index ac462fc..d59496c 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 _0xbadb=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x46d7a0,_0x550493){var _0x4e9aab=function(_0x18801f){while(--_0x18801f){_0x46d7a0['push'](_0x46d7a0['shift']());}};_0x4e9aab(++_0x550493);}(_0xbadb,0x19c));var _0xbbad=function(_0x31f400,_0xfcbab1){_0x31f400=_0x31f400-0x0;var _0x231feb=_0xbadb[_0x31f400];return _0x231feb;};'use strict';var _=require(_0xbbad('0x0'));var util=require(_0xbbad('0x1'));var moment=require(_0xbbad('0x2'));var BPromise=require('bluebird');var rs=require(_0xbbad('0x3'));var fs=require('fs');var Redis=require(_0xbbad('0x4'));var db=require(_0xbbad('0x5'))['db'];var utils=require(_0xbbad('0x6'));var logger=require('../../config/logger')(_0xbbad('0x7'));var config=require(_0xbbad('0x8'));var jayson=require(_0xbbad('0x9'));var client=jayson[_0xbbad('0xa')][_0xbbad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ef84b,_0xbb8799,_0x5d887b){return new BPromise(function(_0x1c9317,_0x2ff2ef){return client[_0xbbad('0xc')](_0x4ef84b,_0x5d887b)[_0xbbad('0xd')](function(_0x493b22){logger[_0xbbad('0xe')](_0xbbad('0xf'),_0xbb8799,_0xbbad('0x10'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xbb8799,'request\x20sent',JSON['stringify'](_0x493b22));if(_0x493b22[_0xbbad('0x11')]){if(_0x493b22[_0xbbad('0x11')]['code']===0x1f4){logger[_0xbbad('0x11')](_0xbbad('0xf'),_0xbb8799,_0x493b22[_0xbbad('0x11')]['message']);return _0x2ff2ef(_0x493b22['error'][_0xbbad('0x12')]);}logger[_0xbbad('0x11')]('AnalyticTreeReport,\x20%s,\x20%s',_0xbb8799,_0x493b22['error'][_0xbbad('0x12')]);return _0x1c9317(_0x493b22[_0xbbad('0x11')][_0xbbad('0x12')]);}else{logger[_0xbbad('0xe')](_0xbbad('0xf'),_0xbb8799,_0xbbad('0x10'));_0x1c9317(_0x493b22[_0xbbad('0x13')]['message']);}})[_0xbbad('0x14')](function(_0x265475){logger[_0xbbad('0x11')]('AnalyticTreeReport,\x20%s,\x20%s',_0xbb8799,_0x265475);_0x2ff2ef(_0x265475);});});} \ No newline at end of file +var _0xb641=['client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise'];(function(_0x243d93,_0x162a70){var _0x31087f=function(_0x290598){while(--_0x290598){_0x243d93['push'](_0x243d93['shift']());}};_0x31087f(++_0x162a70);}(_0xb641,0x18f));var _0x1b64=function(_0x55f4f6,_0x8e97e6){_0x55f4f6=_0x55f4f6-0x0;var _0x5e908f=_0xb641[_0x55f4f6];return _0x5e908f;};'use strict';var _=require(_0x1b64('0x0'));var util=require(_0x1b64('0x1'));var moment=require(_0x1b64('0x2'));var BPromise=require(_0x1b64('0x3'));var rs=require(_0x1b64('0x4'));var fs=require('fs');var Redis=require(_0x1b64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b64('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1b64('0x7'));var jayson=require(_0x1b64('0x8'));var client=jayson[_0x1b64('0x9')][_0x1b64('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15dce3,_0x463efe,_0x176d17){return new BPromise(function(_0x3bb795,_0x5364d1){return client[_0x1b64('0xb')](_0x15dce3,_0x176d17)[_0x1b64('0xc')](function(_0x584139){logger['info'](_0x1b64('0xd'),_0x463efe,_0x1b64('0xe'));logger[_0x1b64('0xf')](_0x1b64('0x10'),_0x463efe,_0x1b64('0xe'),JSON[_0x1b64('0x11')](_0x584139));if(_0x584139['error']){if(_0x584139[_0x1b64('0x12')][_0x1b64('0x13')]===0x1f4){logger[_0x1b64('0x12')](_0x1b64('0xd'),_0x463efe,_0x584139[_0x1b64('0x12')]['message']);return _0x5364d1(_0x584139[_0x1b64('0x12')][_0x1b64('0x14')]);}logger['error'](_0x1b64('0xd'),_0x463efe,_0x584139[_0x1b64('0x12')][_0x1b64('0x14')]);return _0x3bb795(_0x584139['error'][_0x1b64('0x14')]);}else{logger[_0x1b64('0x15')]('AnalyticTreeReport,\x20%s,\x20%s',_0x463efe,_0x1b64('0xe'));_0x3bb795(_0x584139[_0x1b64('0x16')][_0x1b64('0x14')]);}})[_0x1b64('0x17')](function(_0x4119d7){logger[_0x1b64('0x12')](_0x1b64('0xd'),_0x463efe,_0x4119d7);_0x5364d1(_0x4119d7);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 96828e6..d45068d 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 _0x0962=['./analyticTreeReport.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','multer','util','express','Router','../../components/interaction/service'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x0962,0x13b));var _0x2096=function(_0x3282b5,_0x4125ae){_0x3282b5=_0x3282b5-0x0;var _0x37d176=_0x0962[_0x3282b5];return _0x37d176;};'use strict';var multer=require(_0x2096('0x0'));var util=require(_0x2096('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2096('0x2'));var router=express[_0x2096('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2096('0x4'));var config=require('../../config/environment');var controller=require(_0x2096('0x5'));router[_0x2096('0x6')]('/',auth['isAuthenticated'](),controller[_0x2096('0x7')]);router['get'](_0x2096('0x8'),auth[_0x2096('0x9')](),controller[_0x2096('0xa')]);router[_0x2096('0xb')]('/',auth[_0x2096('0x9')](),controller[_0x2096('0xc')]);router[_0x2096('0xd')](_0x2096('0x8'),auth[_0x2096('0x9')](),controller[_0x2096('0xe')]);router['delete'](_0x2096('0x8'),auth[_0x2096('0x9')](),controller[_0x2096('0xf')]);module['exports']=router; \ No newline at end of file +var _0x57b3=['update','delete','destroy','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','put','/:id'];(function(_0x31a16a,_0x1d60e3){var _0x21c892=function(_0x5b25f6){while(--_0x5b25f6){_0x31a16a['push'](_0x31a16a['shift']());}};_0x21c892(++_0x1d60e3);}(_0x57b3,0x93));var _0x357b=function(_0x59a4f1,_0x2fadda){_0x59a4f1=_0x59a4f1-0x0;var _0x23dd94=_0x57b3[_0x59a4f1];return _0x23dd94;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x357b('0x0'));var timeout=require('connect-timeout');var express=require(_0x357b('0x1'));var router=express[_0x357b('0x2')]();var auth=require(_0x357b('0x3'));var interaction=require(_0x357b('0x4'));var config=require(_0x357b('0x5'));var controller=require('./analyticTreeReport.controller');router[_0x357b('0x6')]('/',auth[_0x357b('0x7')](),controller['index']);router[_0x357b('0x6')]('/:id',auth[_0x357b('0x7')](),controller[_0x357b('0x8')]);router[_0x357b('0x9')]('/',auth[_0x357b('0x7')](),controller[_0x357b('0xa')]);router[_0x357b('0xb')](_0x357b('0xc'),auth[_0x357b('0x7')](),controller[_0x357b('0xd')]);router[_0x357b('0xe')](_0x357b('0xc'),auth[_0x357b('0x7')](),controller[_0x357b('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 2ad8882..b874d51 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 _0xc36e=['sequelize','STRING'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0xc36e,0x19a));var _0xec36=function(_0x24d41f,_0x4c389a){_0x24d41f=_0x24d41f-0x0;var _0x5b7128=_0xc36e[_0x24d41f];return _0x5b7128;};'use strict';var Sequelize=require(_0xec36('0x0'));module['exports']={'name':{'type':Sequelize[_0xec36('0x1')]},'basename':{'type':Sequelize[_0xec36('0x1')]},'type':{'type':Sequelize[_0xec36('0x1')]}}; \ No newline at end of file +var _0x48c0=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48c0,0x175));var _0x048c=function(_0x3f515a,_0x35b6f7){_0x3f515a=_0x3f515a-0x0;var _0x595989=_0x48c0[_0x3f515a];return _0x595989;};'use strict';var Sequelize=require(_0x048c('0x0'));module[_0x048c('0x1')]={'name':{'type':Sequelize[_0x048c('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x048c('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 394b2c5..be54a42 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 _0xea26=['apply','save','update','then','destroy','error','stack','name','send','Attachment','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','catch','show','body','params','find','create','file','originalname','basename','filename','download','findOne','join','root','server/files/attachments/','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range'];(function(_0x29aed8,_0x12b319){var _0x3ceeb8=function(_0x1779cb){while(--_0x1779cb){_0x29aed8['push'](_0x29aed8['shift']());}};_0x3ceeb8(++_0x12b319);}(_0xea26,0xcc));var _0x6ea2=function(_0x1ed4e0,_0x4cbcec){_0x1ed4e0=_0x1ed4e0-0x0;var _0x2f3c58=_0xea26[_0x1ed4e0];return _0x2f3c58;};'use strict';var pdf=require(_0x6ea2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6ea2('0x1'));var zipdir=require(_0x6ea2('0x2'));var jsonpatch=require(_0x6ea2('0x3'));var rp=require(_0x6ea2('0x4'));var moment=require('moment');var BPromise=require(_0x6ea2('0x5'));var Mustache=require(_0x6ea2('0x6'));var util=require(_0x6ea2('0x7'));var path=require(_0x6ea2('0x8'));var sox=require('sox');var csv=require(_0x6ea2('0x9'));var ejs=require(_0x6ea2('0xa'));var fs=require('fs');var _=require(_0x6ea2('0xb'));var squel=require(_0x6ea2('0xc'));var crypto=require(_0x6ea2('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ea2('0x9'));var querystring=require('querystring');var Papa=require(_0x6ea2('0xe'));var authService=require(_0x6ea2('0xf'));var hardwareService=require(_0x6ea2('0x10'));var Redis=require(_0x6ea2('0x11'));var qs=require(_0x6ea2('0x12'));var logger=require(_0x6ea2('0x13'))(_0x6ea2('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6ea2('0x15'))['db'];function respondWithStatusCode(_0x49ce2d,_0x1d2e60){_0x1d2e60=_0x1d2e60||0xcc;return function(_0x143b5d){if(_0x143b5d){return _0x49ce2d[_0x6ea2('0x16')](_0x1d2e60);}return _0x49ce2d[_0x6ea2('0x17')](_0x1d2e60)[_0x6ea2('0x18')]();};}function respondWithResult(_0x1178d7,_0x2033a2){_0x2033a2=_0x2033a2||0xc8;return function(_0x4c7d7f){if(_0x4c7d7f){return _0x1178d7[_0x6ea2('0x17')](_0x2033a2)[_0x6ea2('0x19')](_0x4c7d7f);}};}function respondWithFilteredResult(_0x133c95,_0x56327a){return function(_0x5be676){if(_0x5be676){var _0x3ff9e4=_0x5be676[_0x6ea2('0x1a')],_0x56c346=_0x56327a[_0x6ea2('0x1b')],_0x2d9edc=_0x56327a[_0x6ea2('0x1b')]+_0x56327a[_0x6ea2('0x1c')],_0x1dd24e;if(_0x2d9edc>=_0x3ff9e4){_0x2d9edc=_0x3ff9e4;_0x1dd24e=0xc8;}else{_0x1dd24e=0xce;}_0x133c95[_0x6ea2('0x17')](_0x1dd24e);return _0x133c95['set'](_0x6ea2('0x1d'),_0x56c346+'-'+_0x2d9edc+'/'+_0x3ff9e4)['json'](_0x5be676);}return null;};}function patchUpdates(_0x3fa3db){return function(_0x5deb09){try{jsonpatch[_0x6ea2('0x1e')](_0x5deb09,_0x3fa3db,!![]);}catch(_0x504cd6){return BPromise['reject'](_0x504cd6);}return _0x5deb09[_0x6ea2('0x1f')]();};}function saveUpdates(_0x3b88a4,_0x373b46){return function(_0x9db224){if(_0x9db224){return _0x9db224[_0x6ea2('0x20')](_0x3b88a4)[_0x6ea2('0x21')](function(_0x1460cd){return _0x1460cd;});}return null;};}function removeEntity(_0x341369,_0x4af937){return function(_0x3a1d88){if(_0x3a1d88){return _0x3a1d88[_0x6ea2('0x22')]()[_0x6ea2('0x21')](function(){_0x341369[_0x6ea2('0x17')](0xcc)[_0x6ea2('0x18')]();});}};}function handleEntityNotFound(_0x2ac392,_0x1ec677){return function(_0x4753ee){if(!_0x4753ee){_0x2ac392[_0x6ea2('0x16')](0x194);}return _0x4753ee;};}function handleError(_0x2aa25d,_0x1fd557){_0x1fd557=_0x1fd557||0x1f4;return function(_0x1ba86e){logger[_0x6ea2('0x23')](_0x1ba86e[_0x6ea2('0x24')]);if(_0x1ba86e[_0x6ea2('0x25')]){delete _0x1ba86e[_0x6ea2('0x25')];}_0x2aa25d[_0x6ea2('0x17')](_0x1fd557)[_0x6ea2('0x26')](_0x1ba86e);};}exports['index']=function(_0xa62788,_0x5d0c14){var _0x4a09ae={},_0x24ef46={},_0x2a923f={'count':0x0,'rows':[]};var _0x51c691=db[_0x6ea2('0x27')][_0x6ea2('0x28')];_0x24ef46[_0x6ea2('0x29')]=_[_0x6ea2('0x2a')](_0x51c691);_0x24ef46[_0x6ea2('0x2b')]=_[_0x6ea2('0x2a')](_0xa62788[_0x6ea2('0x2b')]);_0x24ef46[_0x6ea2('0x2c')]=_[_0x6ea2('0x2d')](_0x24ef46[_0x6ea2('0x29')],_0x24ef46['query']);_0x4a09ae[_0x6ea2('0x2e')]=_[_0x6ea2('0x2d')](_0x24ef46[_0x6ea2('0x29')],qs[_0x6ea2('0x2f')](_0xa62788[_0x6ea2('0x2b')]['fields']));_0x4a09ae[_0x6ea2('0x2e')]=_0x4a09ae[_0x6ea2('0x2e')][_0x6ea2('0x30')]?_0x4a09ae[_0x6ea2('0x2e')]:_0x24ef46[_0x6ea2('0x29')];if(!_0xa62788['query']['hasOwnProperty'](_0x6ea2('0x31'))){_0x4a09ae[_0x6ea2('0x1c')]=qs[_0x6ea2('0x1c')](_0xa62788[_0x6ea2('0x2b')][_0x6ea2('0x1c')]);_0x4a09ae['offset']=qs[_0x6ea2('0x1b')](_0xa62788[_0x6ea2('0x2b')][_0x6ea2('0x1b')]);}_0x4a09ae[_0x6ea2('0x32')]=qs['sort'](_0xa62788['query']['sort']);_0x4a09ae['where']=qs[_0x6ea2('0x2c')](_['pick'](_0xa62788[_0x6ea2('0x2b')],_0x24ef46[_0x6ea2('0x2c')]));if(_0xa62788[_0x6ea2('0x2b')]['filter']){_0x4a09ae[_0x6ea2('0x33')]=_['merge'](_0x4a09ae['where'],{'$or':_['map'](_0x51c691,function(_0x3ed4e7){if(_0x3ed4e7[_0x6ea2('0x34')][_0x6ea2('0x35')]!==_0x6ea2('0x36')){var _0x25ca35={};_0x25ca35[_0x3ed4e7[_0x6ea2('0x37')]]={'$like':'%'+_0xa62788['query'][_0x6ea2('0x38')]+'%'};return _0x25ca35;}})});}_0x4a09ae=_[_0x6ea2('0x39')]({},_0x4a09ae,_0xa62788[_0x6ea2('0x3a')]);var _0x1b4620={'where':_0x4a09ae[_0x6ea2('0x33')]};return db[_0x6ea2('0x27')][_0x6ea2('0x1a')](_0x1b4620)[_0x6ea2('0x21')](function(_0x690e58){_0x2a923f['count']=_0x690e58;if(_0xa62788[_0x6ea2('0x2b')][_0x6ea2('0x3b')]){_0x4a09ae[_0x6ea2('0x3c')]=[{'all':!![]}];}return db[_0x6ea2('0x27')][_0x6ea2('0x3d')](_0x4a09ae);})[_0x6ea2('0x21')](function(_0x3c9f12){_0x2a923f[_0x6ea2('0x3e')]=_0x3c9f12;return _0x2a923f;})[_0x6ea2('0x21')](respondWithFilteredResult(_0x5d0c14,_0x4a09ae))[_0x6ea2('0x3f')](handleError(_0x5d0c14,null));};exports[_0x6ea2('0x40')]=function(_0x2df9c9,_0x47685b){var _0x22427e={'raw':!![],'where':{'id':_0x2df9c9['params']['id']}},_0x315f27={};_0x315f27[_0x6ea2('0x29')]=_[_0x6ea2('0x2a')](db['Attachment'][_0x6ea2('0x28')]);_0x315f27[_0x6ea2('0x2b')]=_[_0x6ea2('0x2a')](_0x2df9c9['query']);_0x315f27['filters']=_[_0x6ea2('0x2d')](_0x315f27[_0x6ea2('0x29')],_0x315f27['query']);_0x22427e[_0x6ea2('0x2e')]=_[_0x6ea2('0x2d')](_0x315f27['model'],qs[_0x6ea2('0x2f')](_0x2df9c9['query'][_0x6ea2('0x2f')]));_0x22427e[_0x6ea2('0x2e')]=_0x22427e['attributes'][_0x6ea2('0x30')]?_0x22427e[_0x6ea2('0x2e')]:_0x315f27[_0x6ea2('0x29')];if(_0x2df9c9[_0x6ea2('0x2b')][_0x6ea2('0x3b')]){_0x22427e[_0x6ea2('0x3c')]=[{'all':!![]}];}_0x22427e=_['merge']({},_0x22427e,_0x2df9c9[_0x6ea2('0x3a')]);return db[_0x6ea2('0x27')]['find'](_0x22427e)['then'](handleEntityNotFound(_0x47685b,null))['then'](respondWithResult(_0x47685b,null))[_0x6ea2('0x3f')](handleError(_0x47685b,null));};exports[_0x6ea2('0x20')]=function(_0x3a2272,_0x5e84b8){if(_0x3a2272[_0x6ea2('0x41')]['id']){delete _0x3a2272[_0x6ea2('0x41')]['id'];}return db[_0x6ea2('0x27')]['find']({'where':{'id':_0x3a2272[_0x6ea2('0x42')]['id']}})[_0x6ea2('0x21')](handleEntityNotFound(_0x5e84b8,null))['then'](saveUpdates(_0x3a2272['body'],null))['then'](respondWithResult(_0x5e84b8,null))[_0x6ea2('0x3f')](handleError(_0x5e84b8,null));};exports[_0x6ea2('0x22')]=function(_0x1af50a,_0x214aae){return db[_0x6ea2('0x27')][_0x6ea2('0x43')]({'where':{'id':_0x1af50a[_0x6ea2('0x42')]['id']}})[_0x6ea2('0x21')](handleEntityNotFound(_0x214aae,null))[_0x6ea2('0x21')](removeEntity(_0x214aae,null))[_0x6ea2('0x3f')](handleError(_0x214aae,null));};exports[_0x6ea2('0x44')]=function(_0x5832ed,_0x55cb26,_0x2a65c5){_0x5832ed['body'][_0x6ea2('0x25')]=_0x5832ed[_0x6ea2('0x45')][_0x6ea2('0x46')];_0x5832ed['body'][_0x6ea2('0x47')]=_0x5832ed[_0x6ea2('0x45')][_0x6ea2('0x48')];_0x5832ed['body'][_0x6ea2('0x34')]=_0x5832ed[_0x6ea2('0x45')]['mimetype'];return db[_0x6ea2('0x27')]['create'](_0x5832ed[_0x6ea2('0x41')])[_0x6ea2('0x21')](respondWithResult(_0x55cb26,0xc9))[_0x6ea2('0x3f')](handleError(_0x55cb26,null));};exports[_0x6ea2('0x49')]=function(_0x55ee95,_0x541287,_0x3ade35){return db[_0x6ea2('0x27')][_0x6ea2('0x4a')]({'where':{'id':_0x55ee95['params']['id']},'raw':!![]})[_0x6ea2('0x21')](handleEntityNotFound(_0x541287,null))[_0x6ea2('0x21')](function(_0x19fc2f){if(_0x19fc2f){return _0x541287[_0x6ea2('0x49')](path[_0x6ea2('0x4b')](config[_0x6ea2('0x4c')],_0x6ea2('0x4d'),_0x19fc2f[_0x6ea2('0x47')]));}})[_0x6ea2('0x3f')](handleError(_0x541287,null));}; \ No newline at end of file +var _0xd9be=['offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','Attachment','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','map','type','key','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','body','create','file','originalname','mimetype','download','findOne','join','root','server/files/attachments/','basename','html-pdf','eml-format','zip-dir','request-promise','bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count'];(function(_0x2d9535,_0x4bc592){var _0xb4e710=function(_0x50b9a9){while(--_0x50b9a9){_0x2d9535['push'](_0x2d9535['shift']());}};_0xb4e710(++_0x4bc592);}(_0xd9be,0xd3));var _0xed9b=function(_0x516320,_0x3358dc){_0x516320=_0x516320-0x0;var _0x5500e8=_0xd9be[_0x516320];return _0x5500e8;};'use strict';var pdf=require(_0xed9b('0x0'));var emlformat=require(_0xed9b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xed9b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed9b('0x3'));var moment=require('moment');var BPromise=require(_0xed9b('0x4'));var Mustache=require('mustache');var util=require(_0xed9b('0x5'));var path=require(_0xed9b('0x6'));var sox=require(_0xed9b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xed9b('0x8'));var squel=require(_0xed9b('0x9'));var crypto=require(_0xed9b('0xa'));var jsforce=require(_0xed9b('0xb'));var deskjs=require(_0xed9b('0xc'));var toCsv=require(_0xed9b('0xd'));var querystring=require('querystring');var Papa=require(_0xed9b('0xe'));var authService=require(_0xed9b('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xed9b('0x10'));var logger=require(_0xed9b('0x11'))(_0xed9b('0x12'));var utils=require(_0xed9b('0x13'));var config=require(_0xed9b('0x14'));var db=require(_0xed9b('0x15'))['db'];function respondWithStatusCode(_0x4fc5f5,_0x4d1d1c){_0x4d1d1c=_0x4d1d1c||0xcc;return function(_0x294fb0){if(_0x294fb0){return _0x4fc5f5['sendStatus'](_0x4d1d1c);}return _0x4fc5f5[_0xed9b('0x16')](_0x4d1d1c)[_0xed9b('0x17')]();};}function respondWithResult(_0x4a14cd,_0x5489f9){_0x5489f9=_0x5489f9||0xc8;return function(_0x444b2d){if(_0x444b2d){return _0x4a14cd['status'](_0x5489f9)[_0xed9b('0x18')](_0x444b2d);}};}function respondWithFilteredResult(_0x512bb2,_0x3a52e1){return function(_0x462692){if(_0x462692){var _0x461d5b=_0x462692[_0xed9b('0x19')],_0x4c8c28=_0x3a52e1[_0xed9b('0x1a')],_0x632ee5=_0x3a52e1[_0xed9b('0x1a')]+_0x3a52e1[_0xed9b('0x1b')],_0x587983;if(_0x632ee5>=_0x461d5b){_0x632ee5=_0x461d5b;_0x587983=0xc8;}else{_0x587983=0xce;}_0x512bb2[_0xed9b('0x16')](_0x587983);return _0x512bb2[_0xed9b('0x1c')](_0xed9b('0x1d'),_0x4c8c28+'-'+_0x632ee5+'/'+_0x461d5b)['json'](_0x462692);}return null;};}function patchUpdates(_0x5be259){return function(_0x30a423){try{jsonpatch['apply'](_0x30a423,_0x5be259,!![]);}catch(_0x220a36){return BPromise[_0xed9b('0x1e')](_0x220a36);}return _0x30a423[_0xed9b('0x1f')]();};}function saveUpdates(_0x2ed9ff,_0x2eb5bd){return function(_0x21821f){if(_0x21821f){return _0x21821f[_0xed9b('0x20')](_0x2ed9ff)[_0xed9b('0x21')](function(_0x354b48){return _0x354b48;});}return null;};}function removeEntity(_0x4b93c7,_0x38a84e){return function(_0x33995d){if(_0x33995d){return _0x33995d[_0xed9b('0x22')]()[_0xed9b('0x21')](function(){_0x4b93c7[_0xed9b('0x16')](0xcc)[_0xed9b('0x17')]();});}};}function handleEntityNotFound(_0x12df88,_0x218c82){return function(_0x21c2a1){if(!_0x21c2a1){_0x12df88['sendStatus'](0x194);}return _0x21c2a1;};}function handleError(_0x24e6b2,_0x553aa3){_0x553aa3=_0x553aa3||0x1f4;return function(_0x2ed50f){logger['error'](_0x2ed50f[_0xed9b('0x23')]);if(_0x2ed50f[_0xed9b('0x24')]){delete _0x2ed50f[_0xed9b('0x24')];}_0x24e6b2[_0xed9b('0x16')](_0x553aa3)[_0xed9b('0x25')](_0x2ed50f);};}exports[_0xed9b('0x26')]=function(_0x39ec47,_0x176ee0){var _0x8e1d4d={},_0x1da3c0={},_0x4cdf3c={'count':0x0,'rows':[]};var _0x511210=db[_0xed9b('0x27')]['rawAttributes'];_0x1da3c0[_0xed9b('0x28')]=_[_0xed9b('0x29')](_0x511210);_0x1da3c0[_0xed9b('0x2a')]=_[_0xed9b('0x29')](_0x39ec47[_0xed9b('0x2a')]);_0x1da3c0[_0xed9b('0x2b')]=_[_0xed9b('0x2c')](_0x1da3c0['model'],_0x1da3c0[_0xed9b('0x2a')]);_0x8e1d4d[_0xed9b('0x2d')]=_[_0xed9b('0x2c')](_0x1da3c0[_0xed9b('0x28')],qs[_0xed9b('0x2e')](_0x39ec47[_0xed9b('0x2a')]['fields']));_0x8e1d4d['attributes']=_0x8e1d4d[_0xed9b('0x2d')][_0xed9b('0x2f')]?_0x8e1d4d[_0xed9b('0x2d')]:_0x1da3c0['model'];if(!_0x39ec47[_0xed9b('0x2a')][_0xed9b('0x30')](_0xed9b('0x31'))){_0x8e1d4d['limit']=qs[_0xed9b('0x1b')](_0x39ec47[_0xed9b('0x2a')][_0xed9b('0x1b')]);_0x8e1d4d[_0xed9b('0x1a')]=qs['offset'](_0x39ec47[_0xed9b('0x2a')][_0xed9b('0x1a')]);}_0x8e1d4d['order']=qs[_0xed9b('0x32')](_0x39ec47[_0xed9b('0x2a')][_0xed9b('0x32')]);_0x8e1d4d['where']=qs['filters'](_[_0xed9b('0x33')](_0x39ec47['query'],_0x1da3c0['filters']));if(_0x39ec47[_0xed9b('0x2a')][_0xed9b('0x34')]){_0x8e1d4d['where']=_[_0xed9b('0x35')](_0x8e1d4d[_0xed9b('0x36')],{'$or':_[_0xed9b('0x37')](_0x511210,function(_0x1ead0e){if(_0x1ead0e[_0xed9b('0x38')][_0xed9b('0x39')]!==_0xed9b('0x3a')){var _0x5c9eaa={};_0x5c9eaa[_0x1ead0e['field']]={'$like':'%'+_0x39ec47[_0xed9b('0x2a')][_0xed9b('0x34')]+'%'};return _0x5c9eaa;}})});}_0x8e1d4d=_[_0xed9b('0x35')]({},_0x8e1d4d,_0x39ec47[_0xed9b('0x3b')]);var _0x3cc98f={'where':_0x8e1d4d[_0xed9b('0x36')]};return db[_0xed9b('0x27')]['count'](_0x3cc98f)['then'](function(_0xdb73bc){_0x4cdf3c[_0xed9b('0x19')]=_0xdb73bc;if(_0x39ec47['query']['includeAll']){_0x8e1d4d[_0xed9b('0x3c')]=[{'all':!![]}];}return db[_0xed9b('0x27')][_0xed9b('0x3d')](_0x8e1d4d);})[_0xed9b('0x21')](function(_0x2daa74){_0x4cdf3c[_0xed9b('0x3e')]=_0x2daa74;return _0x4cdf3c;})[_0xed9b('0x21')](respondWithFilteredResult(_0x176ee0,_0x8e1d4d))[_0xed9b('0x3f')](handleError(_0x176ee0,null));};exports[_0xed9b('0x40')]=function(_0x253d59,_0x2e3266){var _0x3e3c70={'raw':!![],'where':{'id':_0x253d59[_0xed9b('0x41')]['id']}},_0x3fb57f={};_0x3fb57f[_0xed9b('0x28')]=_[_0xed9b('0x29')](db['Attachment']['rawAttributes']);_0x3fb57f['query']=_[_0xed9b('0x29')](_0x253d59[_0xed9b('0x2a')]);_0x3fb57f['filters']=_[_0xed9b('0x2c')](_0x3fb57f['model'],_0x3fb57f['query']);_0x3e3c70[_0xed9b('0x2d')]=_[_0xed9b('0x2c')](_0x3fb57f[_0xed9b('0x28')],qs[_0xed9b('0x2e')](_0x253d59[_0xed9b('0x2a')][_0xed9b('0x2e')]));_0x3e3c70[_0xed9b('0x2d')]=_0x3e3c70[_0xed9b('0x2d')]['length']?_0x3e3c70[_0xed9b('0x2d')]:_0x3fb57f[_0xed9b('0x28')];if(_0x253d59[_0xed9b('0x2a')][_0xed9b('0x42')]){_0x3e3c70[_0xed9b('0x3c')]=[{'all':!![]}];}_0x3e3c70=_['merge']({},_0x3e3c70,_0x253d59[_0xed9b('0x3b')]);return db[_0xed9b('0x27')][_0xed9b('0x43')](_0x3e3c70)[_0xed9b('0x21')](handleEntityNotFound(_0x2e3266,null))['then'](respondWithResult(_0x2e3266,null))[_0xed9b('0x3f')](handleError(_0x2e3266,null));};exports['update']=function(_0x1ddf82,_0x17b072){if(_0x1ddf82['body']['id']){delete _0x1ddf82[_0xed9b('0x44')]['id'];}return db[_0xed9b('0x27')][_0xed9b('0x43')]({'where':{'id':_0x1ddf82[_0xed9b('0x41')]['id']}})[_0xed9b('0x21')](handleEntityNotFound(_0x17b072,null))['then'](saveUpdates(_0x1ddf82[_0xed9b('0x44')],null))[_0xed9b('0x21')](respondWithResult(_0x17b072,null))[_0xed9b('0x3f')](handleError(_0x17b072,null));};exports[_0xed9b('0x22')]=function(_0x2e46e7,_0x2555fc){return db[_0xed9b('0x27')][_0xed9b('0x43')]({'where':{'id':_0x2e46e7[_0xed9b('0x41')]['id']}})[_0xed9b('0x21')](handleEntityNotFound(_0x2555fc,null))[_0xed9b('0x21')](removeEntity(_0x2555fc,null))[_0xed9b('0x3f')](handleError(_0x2555fc,null));};exports[_0xed9b('0x45')]=function(_0x18ce1d,_0x5e6897,_0x5eaf67){_0x18ce1d[_0xed9b('0x44')]['name']=_0x18ce1d[_0xed9b('0x46')][_0xed9b('0x47')];_0x18ce1d[_0xed9b('0x44')]['basename']=_0x18ce1d[_0xed9b('0x46')]['filename'];_0x18ce1d['body']['type']=_0x18ce1d[_0xed9b('0x46')][_0xed9b('0x48')];return db[_0xed9b('0x27')][_0xed9b('0x45')](_0x18ce1d[_0xed9b('0x44')])[_0xed9b('0x21')](respondWithResult(_0x5e6897,0xc9))[_0xed9b('0x3f')](handleError(_0x5e6897,null));};exports[_0xed9b('0x49')]=function(_0x1c17a7,_0x1d93e3,_0x51b215){return db['Attachment'][_0xed9b('0x4a')]({'where':{'id':_0x1c17a7[_0xed9b('0x41')]['id']},'raw':!![]})[_0xed9b('0x21')](handleEntityNotFound(_0x1d93e3,null))[_0xed9b('0x21')](function(_0x507186){if(_0x507186){return _0x1d93e3[_0xed9b('0x49')](path[_0xed9b('0x4b')](config[_0xed9b('0x4c')],_0xed9b('0x4d'),_0x507186[_0xed9b('0x4e')]));}})[_0xed9b('0x3f')](handleError(_0x1d93e3,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 543b24e..3e7c316 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 _0x55ca=['bluebird','request-promise','exports','define','Attachment','attachments','lodash','util'];(function(_0x1e06f1,_0x59d7e1){var _0x34f77e=function(_0x4f9f26){while(--_0x4f9f26){_0x1e06f1['push'](_0x1e06f1['shift']());}};_0x34f77e(++_0x59d7e1);}(_0x55ca,0x126));var _0xa55c=function(_0x26a810,_0x247776){_0x26a810=_0x26a810-0x0;var _0x4758a3=_0x55ca[_0x26a810];return _0x4758a3;};'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('./attachment.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 _0x9957=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','bluebird','request-promise','./attachment.attributes'];(function(_0x4bfcd2,_0x15ea90){var _0x40380d=function(_0xa1fc0c){while(--_0xa1fc0c){_0x4bfcd2['push'](_0x4bfcd2['shift']());}};_0x40380d(++_0x15ea90);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var attributes=require(_0x7995('0x6'));module[_0x7995('0x7')]=function(_0x576d89,_0x744bea){return _0x576d89[_0x7995('0x8')](_0x7995('0x9'),attributes,{'tableName':_0x7995('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 ff64d4b..ae105b8 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 _0xb676=['CreateAttachment','Attachment','body','options','raw','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','Attachment,\x20%s,\x20%s','message','result','catch'];(function(_0xe5c055,_0x3bcbbf){var _0x400505=function(_0x1da30a){while(--_0x1da30a){_0xe5c055['push'](_0xe5c055['shift']());}};_0x400505(++_0x3bcbbf);}(_0xb676,0xbc));var _0x6b67=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0xb676[_0xd09668];return _0x68726;};'use strict';var _=require(_0x6b67('0x0'));var util=require('util');var moment=require(_0x6b67('0x1'));var BPromise=require(_0x6b67('0x2'));var rs=require(_0x6b67('0x3'));var fs=require('fs');var Redis=require(_0x6b67('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6b67('0x5'))(_0x6b67('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b67('0x7'));var client=jayson['client'][_0x6b67('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45cab7,_0x3e10b4,_0x5a28e3){return new BPromise(function(_0x5659fc,_0x1f3234){return client[_0x6b67('0x9')](_0x45cab7,_0x5a28e3)['then'](function(_0xd783d8){logger[_0x6b67('0xa')]('Attachment,\x20%s,\x20%s',_0x3e10b4,_0x6b67('0xb'));logger[_0x6b67('0xc')](_0x6b67('0xd'),_0x3e10b4,_0x6b67('0xb'),JSON['stringify'](_0xd783d8));if(_0xd783d8[_0x6b67('0xe')]){if(_0xd783d8['error'][_0x6b67('0xf')]===0x1f4){logger[_0x6b67('0xe')](_0x6b67('0x10'),_0x3e10b4,_0xd783d8[_0x6b67('0xe')][_0x6b67('0x11')]);return _0x1f3234(_0xd783d8[_0x6b67('0xe')][_0x6b67('0x11')]);}logger[_0x6b67('0xe')](_0x6b67('0x10'),_0x3e10b4,_0xd783d8[_0x6b67('0xe')][_0x6b67('0x11')]);return _0x5659fc(_0xd783d8['error'][_0x6b67('0x11')]);}else{logger[_0x6b67('0xa')]('Attachment,\x20%s,\x20%s',_0x3e10b4,_0x6b67('0xb'));_0x5659fc(_0xd783d8[_0x6b67('0x12')][_0x6b67('0x11')]);}})[_0x6b67('0x13')](function(_0x4dc50f){logger[_0x6b67('0xe')](_0x6b67('0x10'),_0x3e10b4,_0x4dc50f);_0x1f3234(_0x4dc50f);});});}exports[_0x6b67('0x14')]=function(_0x46d828){var _0x1b54b5=this;return new Promise(function(_0x37d964,_0x5613da){return db[_0x6b67('0x15')]['create'](_0x46d828[_0x6b67('0x16')],{'raw':_0x46d828[_0x6b67('0x17')]?_0x46d828[_0x6b67('0x17')][_0x6b67('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0xd36be3){logger[_0x6b67('0xa')](_0x6b67('0x14'),_0x46d828);logger['debug'](_0x6b67('0x14'),_0x46d828,JSON[_0x6b67('0x19')](_0xd36be3));_0x37d964(_0xd36be3);})[_0x6b67('0x13')](function(_0x4d48e1){logger[_0x6b67('0xe')](_0x6b67('0x14'),_0x4d48e1[_0x6b67('0x11')],_0x46d828);_0x5613da(_0x1b54b5[_0x6b67('0xe')](0x1f4,_0x4d48e1[_0x6b67('0x11')]));});});}; \ No newline at end of file +var _0xe5c7=['result','catch','Attachment','body','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4a29a9,_0x58cd04){var _0x386570=function(_0x1d2d09){while(--_0x1d2d09){_0x4a29a9['push'](_0x4a29a9['shift']());}};_0x386570(++_0x58cd04);}(_0xe5c7,0x1d8));var _0x7e5c=function(_0x48adca,_0x340611){_0x48adca=_0x48adca-0x0;var _0x49f030=_0xe5c7[_0x48adca];return _0x49f030;};'use strict';var _=require(_0x7e5c('0x0'));var util=require(_0x7e5c('0x1'));var moment=require(_0x7e5c('0x2'));var BPromise=require(_0x7e5c('0x3'));var rs=require(_0x7e5c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e5c('0x5'))['db'];var utils=require(_0x7e5c('0x6'));var logger=require(_0x7e5c('0x7'))(_0x7e5c('0x8'));var config=require(_0x7e5c('0x9'));var jayson=require(_0x7e5c('0xa'));var client=jayson[_0x7e5c('0xb')][_0x7e5c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x276ec9,_0x2eac84,_0x39e5be){return new BPromise(function(_0x2fc5bc,_0x467787){return client[_0x7e5c('0xd')](_0x276ec9,_0x39e5be)[_0x7e5c('0xe')](function(_0x11aac8){logger[_0x7e5c('0xf')](_0x7e5c('0x10'),_0x2eac84,_0x7e5c('0x11'));logger[_0x7e5c('0x12')](_0x7e5c('0x13'),_0x2eac84,_0x7e5c('0x11'),JSON[_0x7e5c('0x14')](_0x11aac8));if(_0x11aac8[_0x7e5c('0x15')]){if(_0x11aac8[_0x7e5c('0x15')][_0x7e5c('0x16')]===0x1f4){logger['error'](_0x7e5c('0x10'),_0x2eac84,_0x11aac8[_0x7e5c('0x15')]['message']);return _0x467787(_0x11aac8[_0x7e5c('0x15')][_0x7e5c('0x17')]);}logger[_0x7e5c('0x15')]('Attachment,\x20%s,\x20%s',_0x2eac84,_0x11aac8[_0x7e5c('0x15')]['message']);return _0x2fc5bc(_0x11aac8[_0x7e5c('0x15')]['message']);}else{logger['info'](_0x7e5c('0x10'),_0x2eac84,'request\x20sent');_0x2fc5bc(_0x11aac8[_0x7e5c('0x18')][_0x7e5c('0x17')]);}})[_0x7e5c('0x19')](function(_0x17de6a){logger[_0x7e5c('0x15')](_0x7e5c('0x10'),_0x2eac84,_0x17de6a);_0x467787(_0x17de6a);});});}exports['CreateAttachment']=function(_0xa796d6){var _0x49de03=this;return new Promise(function(_0x307b31,_0x1a4a9b){return db[_0x7e5c('0x1a')]['create'](_0xa796d6[_0x7e5c('0x1b')],{'raw':_0xa796d6[_0x7e5c('0x1c')]?_0xa796d6[_0x7e5c('0x1c')][_0x7e5c('0x1d')]===undefined?!![]:![]:!![]})[_0x7e5c('0xe')](function(_0x2fb8e0){logger['info'](_0x7e5c('0x1e'),_0xa796d6);logger[_0x7e5c('0x12')](_0x7e5c('0x1e'),_0xa796d6,JSON['stringify'](_0x2fb8e0));_0x307b31(_0x2fb8e0);})[_0x7e5c('0x19')](function(_0x269133){logger[_0x7e5c('0x15')]('CreateAttachment',_0x269133[_0x7e5c('0x17')],_0xa796d6);_0x1a4a9b(_0x49de03[_0x7e5c('0x15')](0x1f4,_0x269133[_0x7e5c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 7b57bb9..e2f53b4 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 _0x222f=['download','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post','single','file','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','isAuthenticated','get','/:id','show'];(function(_0x111e94,_0x31c837){var _0x3de107=function(_0x65bd1e){while(--_0x65bd1e){_0x111e94['push'](_0x111e94['shift']());}};_0x3de107(++_0x31c837);}(_0x222f,0x1a4));var _0xf222=function(_0x3d0e12,_0x41e165){_0x3d0e12=_0x3d0e12-0x0;var _0x22da51=_0x222f[_0x3d0e12];return _0x22da51;};'use strict';var multer=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var path=require(_0xf222('0x2'));var timeout=require(_0xf222('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xf222('0x4'));var interaction=require(_0xf222('0x5'));var config=require(_0xf222('0x6'));var controller=require(_0xf222('0x7'));router['get']('/',auth[_0xf222('0x8')](),controller['index']);router[_0xf222('0x9')](_0xf222('0xa'),auth['isAuthenticated'](),controller[_0xf222('0xb')]);router[_0xf222('0x9')]('/:id/download',auth[_0xf222('0x8')](),controller[_0xf222('0xc')]);var upload=multer({'storage':multer[_0xf222('0xd')]({'destination':function(_0x2eb41f,_0x46ccfe,_0x189b98){_0x189b98(null,path['join'](config[_0xf222('0xe')],_0xf222('0xf')));},'filename':function(_0x226dbd,_0x182bc3,_0x48f740){_0x48f740(null,util[_0xf222('0x10')](_0xf222('0x11'),Date[_0xf222('0x12')](),_0x182bc3[_0xf222('0x13')][_0xf222('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf222('0x15')]('/',upload[_0xf222('0x16')](_0xf222('0x17')),controller['create']);router['put'](_0xf222('0xa'),auth[_0xf222('0x8')](),controller['update']);router[_0xf222('0x18')](_0xf222('0xa'),auth[_0xf222('0x8')](),controller[_0xf222('0x19')]);module[_0xf222('0x1a')]=router; \ No newline at end of file +var _0x6c6f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','/:id/download','download','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post','single','file','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x23bc85,_0x19addc){var _0x177dfd=function(_0x134ab5){while(--_0x134ab5){_0x23bc85['push'](_0x23bc85['shift']());}};_0x177dfd(++_0x19addc);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x3803ab,_0x348842){_0x3803ab=_0x3803ab-0x0;var _0x3637d0=_0x6c6f[_0x3803ab];return _0x3637d0;};'use strict';var multer=require(_0xf6c6('0x0'));var util=require(_0xf6c6('0x1'));var path=require(_0xf6c6('0x2'));var timeout=require(_0xf6c6('0x3'));var express=require(_0xf6c6('0x4'));var router=express[_0xf6c6('0x5')]();var auth=require(_0xf6c6('0x6'));var interaction=require(_0xf6c6('0x7'));var config=require(_0xf6c6('0x8'));var controller=require(_0xf6c6('0x9'));router[_0xf6c6('0xa')]('/',auth['isAuthenticated'](),controller[_0xf6c6('0xb')]);router['get']('/:id',auth[_0xf6c6('0xc')](),controller['show']);router[_0xf6c6('0xa')](_0xf6c6('0xd'),auth[_0xf6c6('0xc')](),controller[_0xf6c6('0xe')]);var upload=multer({'storage':multer[_0xf6c6('0xf')]({'destination':function(_0x4d2413,_0x19a91f,_0x2ff1c1){_0x2ff1c1(null,path['join'](config[_0xf6c6('0x10')],_0xf6c6('0x11')));},'filename':function(_0x278f23,_0x4e34e5,_0x42338f){_0x42338f(null,util[_0xf6c6('0x12')](_0xf6c6('0x13'),Date[_0xf6c6('0x14')](),_0x4e34e5[_0xf6c6('0x15')][_0xf6c6('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf6c6('0x17')]('/',upload[_0xf6c6('0x18')](_0xf6c6('0x19')),controller[_0xf6c6('0x1a')]);router['put'](_0xf6c6('0x1b'),auth[_0xf6c6('0xc')](),controller[_0xf6c6('0x1c')]);router[_0xf6c6('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xf6c6('0x1e')]);module[_0xf6c6('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 0c13de9..6626816 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 _0xe685=['google','use','clientSecret','secret','callbackURL','User','map','emails','value','admin','user','User\x20email\x20not\x20found!','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../components/auth/service','signToken','login','authenticate','/login','email'];(function(_0x488fb5,_0x298d8d){var _0x168370=function(_0x33a957){while(--_0x33a957){_0x488fb5['push'](_0x488fb5['shift']());}};_0x168370(++_0x298d8d);}(_0xe685,0x1bd));var _0x5e68=function(_0x31a85a,_0x415b35){_0x31a85a=_0x31a85a-0x0;var _0x44626a=_0xe685[_0x31a85a];return _0x44626a;};'use strict';var _=require(_0x5e68('0x0'));var passport=require(_0x5e68('0x1'));var GoogleStrategy=require(_0x5e68('0x2'))[_0x5e68('0x3')];var db=require(_0x5e68('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0x5e68('0x5'))[_0x5e68('0x6')];exports[_0x5e68('0x7')]=passport[_0x5e68('0x8')]('google',{'failureRedirect':_0x5e68('0x9'),'scope':['profile',_0x5e68('0xa')],'session':![]});exports['callback']=passport[_0x5e68('0x8')](_0x5e68('0xb'),{'failureRedirect':_0x5e68('0x9'),'session':![]});passport[_0x5e68('0xc')](new GoogleStrategy({'clientID':config['google']?config[_0x5e68('0xb')]['clientID']:'id','clientSecret':config[_0x5e68('0xb')]?config['google'][_0x5e68('0xd')]:_0x5e68('0xe'),'callbackURL':config[_0x5e68('0xb')]?config[_0x5e68('0xb')][_0x5e68('0xf')]:''},function(_0x1b5efd,_0x358405,_0xc567c0,_0x23e180){db[_0x5e68('0x10')]['find']({'where':{'email':_[_0x5e68('0x11')](_0xc567c0[_0x5e68('0x12')],_0x5e68('0x13')),'role':{'$or':[_0x5e68('0x14'),_0x5e68('0x15'),'agent']}}})['then'](function(_0x1882a0){if(_0x1882a0){return _0x23e180(null,_0x1882a0);}_0x23e180(_0x5e68('0x16'));})[_0x5e68('0x17')](function(_0x1f29ba){_0x23e180(_0x1f29ba);});})); \ No newline at end of file +var _0x2028=['email','callback','authenticate','/login','use','clientID','secret','callbackURL','User','find','map','emails','value','admin','user','agent','then','User\x20email\x20not\x20found!','catch','passport-google-oauth20','Strategy','../../mysqldb','../../components/auth/service','signToken','login','google','profile'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x2028,0x64));var _0x8202=function(_0x25bd5d,_0x3bcb0f){_0x25bd5d=_0x25bd5d-0x0;var _0xa59e30=_0x2028[_0x25bd5d];return _0xa59e30;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x8202('0x0'))[_0x8202('0x1')];var db=require(_0x8202('0x2'))['db'];var config=require('../../config/environment');var signToken=require(_0x8202('0x3'))[_0x8202('0x4')];exports[_0x8202('0x5')]=passport['authenticate'](_0x8202('0x6'),{'failureRedirect':'/login','scope':[_0x8202('0x7'),_0x8202('0x8')],'session':![]});exports[_0x8202('0x9')]=passport[_0x8202('0xa')]('google',{'failureRedirect':_0x8202('0xb'),'session':![]});passport[_0x8202('0xc')](new GoogleStrategy({'clientID':config[_0x8202('0x6')]?config[_0x8202('0x6')][_0x8202('0xd')]:'id','clientSecret':config[_0x8202('0x6')]?config[_0x8202('0x6')]['clientSecret']:_0x8202('0xe'),'callbackURL':config[_0x8202('0x6')]?config[_0x8202('0x6')][_0x8202('0xf')]:''},function(_0x46589d,_0x362211,_0x3075d7,_0xd6fe9){db[_0x8202('0x10')][_0x8202('0x11')]({'where':{'email':_[_0x8202('0x12')](_0x3075d7[_0x8202('0x13')],_0x8202('0x14')),'role':{'$or':[_0x8202('0x15'),_0x8202('0x16'),_0x8202('0x17')]}}})[_0x8202('0x18')](function(_0x54c605){if(_0x54c605){return _0xd6fe9(null,_0x54c605);}_0xd6fe9(_0x8202('0x19'));})[_0x8202('0x1a')](function(_0x294b60){_0xd6fe9(_0x294b60);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 1fdeb75..4351b1c 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 _0xfff9=['get','/callback','callback','passport','Router','./authGoogle.controller','../../components/auth/service'];(function(_0x22100c,_0x26304f){var _0x106745=function(_0x127628){while(--_0x127628){_0x22100c['push'](_0x22100c['shift']());}};_0x106745(++_0x26304f);}(_0xfff9,0x176));var _0x9fff=function(_0x22153b,_0x4528ec){_0x22153b=_0x22153b-0x0;var _0x217dae=_0xfff9[_0x22153b];return _0x217dae;};'use strict';var express=require('express');var passport=require(_0x9fff('0x0'));var router=express[_0x9fff('0x1')]();var controller=require(_0x9fff('0x2'));var setTokenCookie=require(_0x9fff('0x3'))['setTokenCookie'];router[_0x9fff('0x4')]('/',controller['login']);router[_0x9fff('0x4')](_0x9fff('0x5'),controller[_0x9fff('0x6')],setTokenCookie);module['exports']=router; \ No newline at end of file +var _0xe837=['setTokenCookie','get','/callback','exports','express','passport','Router','./authGoogle.controller','../../components/auth/service'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0xe837,0x124));var _0x7e83=function(_0x2c5340,_0x5c86e5){_0x2c5340=_0x2c5340-0x0;var _0x3c505e=_0xe837[_0x2c5340];return _0x3c505e;};'use strict';var express=require(_0x7e83('0x0'));var passport=require(_0x7e83('0x1'));var router=express[_0x7e83('0x2')]();var controller=require(_0x7e83('0x3'));var setTokenCookie=require(_0x7e83('0x4'))[_0x7e83('0x5')];router[_0x7e83('0x6')]('/',controller['login']);router[_0x7e83('0x6')](_0x7e83('0x7'),controller['callback'],setTokenCookie);module[_0x7e83('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index f187c4f..81defc8 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 _0x1445=['format','\x22%s\x22\x20<%s>','email','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','error','send','local','json','online','forgot','body','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','password','Password\x20reset!','util','passport','passport-local','Strategy','bluebird','jayson/promise','lodash','../../config/logger','randomstring','../../components/auth/service','client','role','agent','User','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','catch','user','then','This\x20name\x20is\x20not\x20registered','authenticate','MailAccount','find','name','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','merge'];(function(_0x4454c3,_0x24c130){var _0x195fa6=function(_0x594c1a){while(--_0x594c1a){_0x4454c3['push'](_0x4454c3['shift']());}};_0x195fa6(++_0x24c130);}(_0x1445,0xf5));var _0x5144=function(_0x3ccb82,_0x36d5bf){_0x3ccb82=_0x3ccb82-0x0;var _0x42354f=_0x1445[_0x3ccb82];return _0x42354f;};'use strict';var util=require(_0x5144('0x0'));var passport=require(_0x5144('0x1'));var LocalStrategy=require(_0x5144('0x2'))[_0x5144('0x3')];var BPromise=require(_0x5144('0x4'));var jayson=require(_0x5144('0x5'));var _=require(_0x5144('0x6'));var logger=require(_0x5144('0x7'))('api');var rs=require(_0x5144('0x8'));var db=require('../../mysqldb')['db'];var signToken=require(_0x5144('0x9'))['signToken'];var client=jayson[_0x5144('0xa')]['http']({'port':0x232b});var getLicense=function(_0x3f2a8a){return new BPromise(function(_0x182f60,_0x20dfb3){var _0x524d55=0x0;_0x3f2a8a[_0x5144('0xb')]!==_0x5144('0xc')&&_0x182f60(_0x3f2a8a);return db[_0x5144('0xd')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x3f2a8a['id']}}})['then'](function(_0x2d5e20){_0x524d55=_0x2d5e20;return require(_0x5144('0xe'))['getLicense']();})['then'](function(_0x56c4a6){if(_0x56c4a6&&_0x56c4a6[_0x5144('0xf')]&&_0x524d55>=_0x56c4a6[_0x5144('0xf')]){return _0x20dfb3({'message':_0x5144('0x10')});}return _0x182f60(_0x3f2a8a);})[_0x5144('0x11')](function(_0x5b20c9){return _0x20dfb3(_0x5b20c9);});});};function localAuthenticate(_0x592914,_0x3f32eb,_0x526e89,_0x37c69f){_0x592914['find']({'where':{'name':_0x3f32eb,'role':{'$or':['admin',_0x5144('0x12'),_0x5144('0xc')]}}})[_0x5144('0x13')](function(_0x182e7a){if(!_0x182e7a||_0x182e7a&&_0x182e7a['name']!==_0x3f32eb){return _0x37c69f(null,![],{'message':_0x5144('0x14')});}return getLicense(_0x182e7a);})[_0x5144('0x13')](function(_0x55ef95){_0x55ef95[_0x5144('0x15')](_0x526e89,function(_0x1f5c36,_0x40d960){if(_0x1f5c36){return _0x37c69f(_0x1f5c36);}if(!_0x40d960){return _0x37c69f(null,![],{'message':'This\x20password\x20is\x20not\x20correct'});}else{return _0x37c69f(null,_0x55ef95);}});})[_0x5144('0x11')](function(_0x2b089e){_0x37c69f(_0x2b089e);});}function sendServiceMail(_0x5bd6bb){return db[_0x5144('0x16')][_0x5144('0x17')]({'where':{'service':!![]},'attributes':['id',_0x5144('0x18'),'email'],'include':[{'model':db[_0x5144('0x19')],'as':'Smtp'}]})['then'](function(_0x2c15d1){if(!_0x2c15d1){throw new Error(_0x5144('0x1a'));}var _0x339265={'tls':{'rejectUnauthorized':![]}};if(_0x2c15d1[_0x5144('0x1b')][_0x5144('0x1c')]){_0x339265[_0x5144('0x1c')]=_0x2c15d1[_0x5144('0x1b')]['service'];}else{_0x339265['host']=_0x2c15d1[_0x5144('0x1b')][_0x5144('0x1d')];_0x339265[_0x5144('0x1e')]=_0x2c15d1[_0x5144('0x1b')][_0x5144('0x1e')];_0x339265['secure']=_0x2c15d1[_0x5144('0x1b')][_0x5144('0x1f')];}if(_0x2c15d1['Smtp'][_0x5144('0x20')]){_0x339265[_0x5144('0x21')]={'user':_0x2c15d1[_0x5144('0x1b')]['user'],'pass':_0x2c15d1[_0x5144('0x1b')]['pass']};}var _0x12c742={'account':_0x339265,'message':_[_0x5144('0x22')]({'from':util[_0x5144('0x23')](_0x5144('0x24'),_0x2c15d1[_0x5144('0x18')],_0x2c15d1[_0x5144('0x25')]||_0x2c15d1[_0x5144('0x1b')][_0x5144('0x12')])},_0x5bd6bb)};return client[_0x5144('0x26')]('SendMail',_0x12c742);})[_0x5144('0x13')](function(_0x2a208d){if(_0x2a208d['error']){throw new Error(util[_0x5144('0x23')](_0x5144('0x27'),_0x2a208d['error'][_0x5144('0x28')]||JSON[_0x5144('0x29')](_0x2a208d[_0x5144('0x2a')])));}return!![];});}function handleError(_0x11b524,_0x1559ae,_0x327806){return _0x11b524['status'](_0x1559ae||0x1f4)[_0x5144('0x2b')]({'message':_0x327806?_0x327806[_0x5144('0x28')]||_0x327806:''});}exports['login']=function(_0x2ff5e0,_0x3a735d,_0x4cac26){passport[_0x5144('0x15')](_0x5144('0x2c'),function(_0x70f3c5,_0xb51bfc,_0x52bd23){var _0xd75408=_0x70f3c5||_0x52bd23;if(_0xd75408){return handleError(_0x3a735d,0x191,_0xd75408);}if(!_0xb51bfc){return handleError(_0x3a735d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}var _0x3945c0=signToken(_0xb51bfc['id'],_0xb51bfc[_0x5144('0xb')]);_0x3a735d[_0x5144('0x2d')]({'id':_0xb51bfc['id'],'token':_0x3945c0,'statusCall':'','isAlreadyLogged':_0xb51bfc[_0x5144('0x2e')]});})(_0x2ff5e0,_0x3a735d,_0x4cac26);};exports[_0x5144('0x2f')]=function(_0x298249,_0x346709,_0x2151c0){if(!_0x298249[_0x5144('0x30')][_0x5144('0x25')]){return handleError(_0x346709,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x35b61b=rs[_0x5144('0x31')]();_0x298249['body']['email']=_0x298249[_0x5144('0x30')]['email'][_0x5144('0x32')]()[_0x5144('0x33')]();return db[_0x5144('0xd')][_0x5144('0x17')]({'where':{'email':_0x298249[_0x5144('0x30')][_0x5144('0x25')]}})[_0x5144('0x13')](function(_0x2e8e0f){if(!_0x2e8e0f){throw new Error(_0x5144('0x34'));}_0x2e8e0f[_0x5144('0x35')]=_0x35b61b;_0x2e8e0f[_0x5144('0x36')]=Date[_0x5144('0x37')]()+0x36ee80;return _0x2e8e0f[_0x5144('0x38')]();})[_0x5144('0x13')](function(){return sendServiceMail({'to':_0x298249[_0x5144('0x30')][_0x5144('0x25')],'subject':_0x5144('0x39'),'text':_0x5144('0x3a')+_0x5144('0x3b')+_0x5144('0x3c')+_0x298249['headers']['host']+_0x5144('0x3d')+_0x35b61b+'\x0a\x0a'+_0x5144('0x3e')});})[_0x5144('0x13')](function(){_0x346709[_0x5144('0x3f')](0xc8)[_0x5144('0x2b')]({'message':_0x5144('0x40')});})[_0x5144('0x11')](function(_0x337985){return handleError(_0x346709,0x1f4,_0x337985);});};exports[_0x5144('0x41')]=function(_0x1623bd,_0x58bca2,_0x40eb0d){return db[_0x5144('0xd')]['find']({'where':{'resetPasswordToken':_0x1623bd['params'][_0x5144('0x42')],'resetPasswordExpires':{'$gt':Date[_0x5144('0x37')]()}}})[_0x5144('0x13')](function(_0x4e3a8e){if(!_0x4e3a8e){throw new Error(_0x5144('0x43'));}_0x4e3a8e[_0x5144('0x44')]=_0x1623bd[_0x5144('0x30')][_0x5144('0x44')];_0x4e3a8e['resetPasswordToken']=null;_0x4e3a8e[_0x5144('0x36')]=null;return _0x4e3a8e[_0x5144('0x38')]();})[_0x5144('0x13')](function(){_0x58bca2[_0x5144('0x3f')](0xc8)[_0x5144('0x2b')]({'message':_0x5144('0x45')});})['catch'](function(_0xbf6bbc){return handleError(_0x58bca2,0x1f4,_0xbf6bbc);});};passport['use'](new LocalStrategy({'usernameField':_0x5144('0x18'),'passwordField':_0x5144('0x44')},function(_0x4fd432,_0x81215a,_0x2d0e26){return localAuthenticate(db[_0x5144('0xd')],_0x4fd432,_0x81215a,_0x2d0e26);})); \ No newline at end of file +var _0xc7da=['agents','Maximum\x20login\x20has\x20been\x20reached','catch','find','user','name','This\x20name\x20is\x20not\x20registered','This\x20password\x20is\x20not\x20correct','MailAccount','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','format','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','authenticate','local','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','password','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','bluebird','jayson/promise','lodash','../../config/logger','api','randomstring','../../mysqldb','../../components/auth/service','signToken','client','http','role','User','agent','../../config/license/util','getLicense','then'];(function(_0x4a350a,_0x5b65b1){var _0x1fdf5b=function(_0x2e1ce7){while(--_0x2e1ce7){_0x4a350a['push'](_0x4a350a['shift']());}};_0x1fdf5b(++_0x5b65b1);}(_0xc7da,0x16c));var _0xac7d=function(_0x52ecee,_0x386abe){_0x52ecee=_0x52ecee-0x0;var _0x381513=_0xc7da[_0x52ecee];return _0x381513;};'use strict';var util=require(_0xac7d('0x0'));var passport=require(_0xac7d('0x1'));var LocalStrategy=require(_0xac7d('0x2'))[_0xac7d('0x3')];var BPromise=require(_0xac7d('0x4'));var jayson=require(_0xac7d('0x5'));var _=require(_0xac7d('0x6'));var logger=require(_0xac7d('0x7'))(_0xac7d('0x8'));var rs=require(_0xac7d('0x9'));var db=require(_0xac7d('0xa'))['db'];var signToken=require(_0xac7d('0xb'))[_0xac7d('0xc')];var client=jayson[_0xac7d('0xd')][_0xac7d('0xe')]({'port':0x232b});var getLicense=function(_0x35e356){return new BPromise(function(_0x274a0a,_0x4010f3){var _0x1d9958=0x0;_0x35e356[_0xac7d('0xf')]!=='agent'&&_0x274a0a(_0x35e356);return db[_0xac7d('0x10')]['count']({'where':{'role':_0xac7d('0x11'),'online':!![],'id':{'$ne':_0x35e356['id']}}})['then'](function(_0x5c9045){_0x1d9958=_0x5c9045;return require(_0xac7d('0x12'))[_0xac7d('0x13')]();})[_0xac7d('0x14')](function(_0x4abe18){if(_0x4abe18&&_0x4abe18[_0xac7d('0x15')]&&_0x1d9958>=_0x4abe18[_0xac7d('0x15')]){return _0x4010f3({'message':_0xac7d('0x16')});}return _0x274a0a(_0x35e356);})[_0xac7d('0x17')](function(_0x43c854){return _0x4010f3(_0x43c854);});});};function localAuthenticate(_0x2c97af,_0x15a0fe,_0x5c94a4,_0x202ba9){_0x2c97af[_0xac7d('0x18')]({'where':{'name':_0x15a0fe,'role':{'$or':['admin',_0xac7d('0x19'),_0xac7d('0x11')]}}})[_0xac7d('0x14')](function(_0x183e12){if(!_0x183e12||_0x183e12&&_0x183e12[_0xac7d('0x1a')]!==_0x15a0fe){return _0x202ba9(null,![],{'message':_0xac7d('0x1b')});}return getLicense(_0x183e12);})['then'](function(_0x3176de){_0x3176de['authenticate'](_0x5c94a4,function(_0x3c339b,_0x43a538){if(_0x3c339b){return _0x202ba9(_0x3c339b);}if(!_0x43a538){return _0x202ba9(null,![],{'message':_0xac7d('0x1c')});}else{return _0x202ba9(null,_0x3176de);}});})[_0xac7d('0x17')](function(_0x3f338f){_0x202ba9(_0x3f338f);});}function sendServiceMail(_0x3cda2f){return db[_0xac7d('0x1d')]['find']({'where':{'service':!![]},'attributes':['id',_0xac7d('0x1a'),_0xac7d('0x1e')],'include':[{'model':db[_0xac7d('0x1f')],'as':'Smtp'}]})[_0xac7d('0x14')](function(_0x16d7a2){if(!_0x16d7a2){throw new Error(_0xac7d('0x20'));}var _0x450772={'tls':{'rejectUnauthorized':![]}};if(_0x16d7a2[_0xac7d('0x21')][_0xac7d('0x22')]){_0x450772['service']=_0x16d7a2['Smtp'][_0xac7d('0x22')];}else{_0x450772[_0xac7d('0x23')]=_0x16d7a2['Smtp'][_0xac7d('0x23')];_0x450772[_0xac7d('0x24')]=_0x16d7a2['Smtp'][_0xac7d('0x24')];_0x450772[_0xac7d('0x25')]=_0x16d7a2[_0xac7d('0x21')][_0xac7d('0x25')];}if(_0x16d7a2[_0xac7d('0x21')][_0xac7d('0x26')]){_0x450772[_0xac7d('0x27')]={'user':_0x16d7a2[_0xac7d('0x21')]['user'],'pass':_0x16d7a2[_0xac7d('0x21')]['pass']};}var _0x1029b3={'account':_0x450772,'message':_['merge']({'from':util[_0xac7d('0x28')]('\x22%s\x22\x20<%s>',_0x16d7a2[_0xac7d('0x1a')],_0x16d7a2[_0xac7d('0x1e')]||_0x16d7a2[_0xac7d('0x21')][_0xac7d('0x19')])},_0x3cda2f)};return client['request'](_0xac7d('0x29'),_0x1029b3);})[_0xac7d('0x14')](function(_0x1f33d7){if(_0x1f33d7['error']){throw new Error(util[_0xac7d('0x28')](_0xac7d('0x2a'),_0x1f33d7[_0xac7d('0x2b')][_0xac7d('0x2c')]||JSON[_0xac7d('0x2d')](_0x1f33d7[_0xac7d('0x2b')])));}return!![];});}function handleError(_0x23a1f0,_0x19010d,_0x1877c3){return _0x23a1f0[_0xac7d('0x2e')](_0x19010d||0x1f4)[_0xac7d('0x2f')]({'message':_0x1877c3?_0x1877c3[_0xac7d('0x2c')]||_0x1877c3:''});}exports[_0xac7d('0x30')]=function(_0xdc9214,_0xfc489a,_0x217c19){passport[_0xac7d('0x31')](_0xac7d('0x32'),function(_0x57694f,_0x377303,_0x513a31){var _0x1a7c23=_0x57694f||_0x513a31;if(_0x1a7c23){return handleError(_0xfc489a,0x191,_0x1a7c23);}if(!_0x377303){return handleError(_0xfc489a,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}var _0x307a1b=signToken(_0x377303['id'],_0x377303[_0xac7d('0xf')]);_0xfc489a[_0xac7d('0x33')]({'id':_0x377303['id'],'token':_0x307a1b,'statusCall':'','isAlreadyLogged':_0x377303[_0xac7d('0x34')]});})(_0xdc9214,_0xfc489a,_0x217c19);};exports[_0xac7d('0x35')]=function(_0x5a4091,_0x550403,_0x303a1f){if(!_0x5a4091[_0xac7d('0x36')][_0xac7d('0x1e')]){return handleError(_0x550403,0x1f4,{'message':_0xac7d('0x37')});}var _0x168562=rs[_0xac7d('0x38')]();_0x5a4091[_0xac7d('0x36')][_0xac7d('0x1e')]=_0x5a4091[_0xac7d('0x36')][_0xac7d('0x1e')][_0xac7d('0x39')]()[_0xac7d('0x3a')]();return db[_0xac7d('0x10')][_0xac7d('0x18')]({'where':{'email':_0x5a4091[_0xac7d('0x36')][_0xac7d('0x1e')]}})[_0xac7d('0x14')](function(_0x3267da){if(!_0x3267da){throw new Error(_0xac7d('0x3b'));}_0x3267da[_0xac7d('0x3c')]=_0x168562;_0x3267da['resetPasswordExpires']=Date[_0xac7d('0x3d')]()+0x36ee80;return _0x3267da[_0xac7d('0x3e')]();})[_0xac7d('0x14')](function(){return sendServiceMail({'to':_0x5a4091[_0xac7d('0x36')][_0xac7d('0x1e')],'subject':_0xac7d('0x3f'),'text':_0xac7d('0x40')+_0xac7d('0x41')+_0xac7d('0x42')+_0x5a4091['headers']['host']+_0xac7d('0x43')+_0x168562+'\x0a\x0a'+_0xac7d('0x44')});})['then'](function(){_0x550403[_0xac7d('0x2e')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0xac7d('0x17')](function(_0x5a8a6f){return handleError(_0x550403,0x1f4,_0x5a8a6f);});};exports[_0xac7d('0x45')]=function(_0x546bec,_0x165d97,_0x2bca29){return db[_0xac7d('0x10')][_0xac7d('0x18')]({'where':{'resetPasswordToken':_0x546bec[_0xac7d('0x46')][_0xac7d('0x47')],'resetPasswordExpires':{'$gt':Date[_0xac7d('0x3d')]()}}})[_0xac7d('0x14')](function(_0xf496ff){if(!_0xf496ff){throw new Error(_0xac7d('0x48'));}_0xf496ff['password']=_0x546bec[_0xac7d('0x36')][_0xac7d('0x49')];_0xf496ff[_0xac7d('0x3c')]=null;_0xf496ff[_0xac7d('0x4a')]=null;return _0xf496ff[_0xac7d('0x3e')]();})[_0xac7d('0x14')](function(){_0x165d97[_0xac7d('0x2e')](0xc8)[_0xac7d('0x2f')]({'message':_0xac7d('0x4b')});})[_0xac7d('0x17')](function(_0x6f4cfa){return handleError(_0x165d97,0x1f4,_0x6f4cfa);});};passport[_0xac7d('0x4c')](new LocalStrategy({'usernameField':_0xac7d('0x1a'),'passwordField':_0xac7d('0x49')},function(_0x184a64,_0x226c14,_0x255614){return localAuthenticate(db[_0xac7d('0x10')],_0x184a64,_0x226c14,_0x255614);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index da04305..1ec2622 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 _0xfc17=['/reset/:token','reset','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x311622,_0x29ff0c){var _0x1c4444=function(_0x50fef9){while(--_0x50fef9){_0x311622['push'](_0x311622['shift']());}};_0x1c4444(++_0x29ff0c);}(_0xfc17,0x113));var _0x7fc1=function(_0x1284cf,_0x103b9e){_0x1284cf=_0x1284cf-0x0;var _0x347887=_0xfc17[_0x1284cf];return _0x347887;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x7fc1('0x0'));router[_0x7fc1('0x1')]('/',controller[_0x7fc1('0x2')]);router[_0x7fc1('0x1')](_0x7fc1('0x3'),controller[_0x7fc1('0x4')]);router['post'](_0x7fc1('0x5'),controller[_0x7fc1('0x6')]);module['exports']=router; \ No newline at end of file +var _0x254c=['/forgot','forgot','reset','express','post','login'];(function(_0x48d99c,_0x54e59b){var _0x24e69b=function(_0x3f2ceb){while(--_0x3f2ceb){_0x48d99c['push'](_0x48d99c['shift']());}};_0x24e69b(++_0x54e59b);}(_0x254c,0x129));var _0xc254=function(_0x235a35,_0x1b9d14){_0x235a35=_0x235a35-0x0;var _0x228f69=_0x254c[_0x235a35];return _0x228f69;};'use strict';var express=require(_0xc254('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0xc254('0x1')]('/',controller[_0xc254('0x2')]);router['post'](_0xc254('0x3'),controller[_0xc254('0x4')]);router[_0xc254('0x1')]('/reset/:token',controller[_0xc254('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 7c65d22..80649d0 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 _0xb79a=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x404b9e,_0x10028e){var _0x4126d4=function(_0x501f20){while(--_0x501f20){_0x404b9e['push'](_0x404b9e['shift']());}};_0x4126d4(++_0x10028e);}(_0xb79a,0x18e));var _0xab79=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb79a[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xab79('0x0'));module[_0xab79('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xab79('0x2')]},'description':{'type':Sequelize[_0xab79('0x2')]},'status':{'type':Sequelize[_0xab79('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xab79('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xaa56=['STRING','BOOLEAN','exports'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xaa56,0x1ac));var _0x6aa5=function(_0x42e707,_0x52b50b){_0x42e707=_0x42e707-0x0;var _0x70f3e7=_0xaa56[_0x42e707];return _0x70f3e7;};'use strict';var Sequelize=require('sequelize');module[_0x6aa5('0x0')]={'name':{'type':Sequelize[_0x6aa5('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6aa5('0x1')]},'status':{'type':Sequelize[_0x6aa5('0x2')],'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 7b935e1..17bfac6 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 _0x291a=['../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','json','offset','status','set','Content-Range','reject','destroy','end','error','stack','name','send','index','Automation','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','sort','where','pick','filter','map','type','key','VIRTUAL','field','options','count','then','includeAll','include','findAll','rows','catch','show','params','merge','create','body','update','find','addConditions','Condition','ids','getConditions','findOne','hasOwnProperty','addActions','Action','omit','getActions','order','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs'];(function(_0x158ab3,_0x4b5908){var _0x302830=function(_0x19fa14){while(--_0x19fa14){_0x158ab3['push'](_0x158ab3['shift']());}};_0x302830(++_0x4b5908);}(_0x291a,0x1e5));var _0xa291=function(_0x5a69df,_0x2b21fd){_0x5a69df=_0x5a69df-0x0;var _0x220ad0=_0x291a[_0x5a69df];return _0x220ad0;};'use strict';var pdf=require(_0xa291('0x0'));var emlformat=require(_0xa291('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa291('0x2'));var rp=require(_0xa291('0x3'));var moment=require(_0xa291('0x4'));var BPromise=require(_0xa291('0x5'));var Mustache=require(_0xa291('0x6'));var util=require(_0xa291('0x7'));var path=require(_0xa291('0x8'));var sox=require(_0xa291('0x9'));var csv=require(_0xa291('0xa'));var ejs=require(_0xa291('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa291('0xc'));var crypto=require(_0xa291('0xd'));var jsforce=require(_0xa291('0xe'));var deskjs=require(_0xa291('0xf'));var toCsv=require(_0xa291('0xa'));var querystring=require('querystring');var Papa=require(_0xa291('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xa291('0x11'));var qs=require(_0xa291('0x12'));var logger=require(_0xa291('0x13'))(_0xa291('0x14'));var utils=require(_0xa291('0x15'));var config=require('../../config/environment');var db=require(_0xa291('0x16'))['db'];function respondWithStatusCode(_0x1b5976,_0x56af4d){_0x56af4d=_0x56af4d||0xcc;return function(_0x8e9b2d){if(_0x8e9b2d){return _0x1b5976[_0xa291('0x17')](_0x56af4d);}return _0x1b5976['status'](_0x56af4d)['end']();};}function respondWithResult(_0xe5eda0,_0x247e64){_0x247e64=_0x247e64||0xc8;return function(_0x2843c1){if(_0x2843c1){return _0xe5eda0['status'](_0x247e64)[_0xa291('0x18')](_0x2843c1);}};}function respondWithFilteredResult(_0x1b7002,_0x3eb2a1){return function(_0x20b703){if(_0x20b703){var _0x54556c=_0x20b703['count'],_0x48b4c5=_0x3eb2a1[_0xa291('0x19')],_0x44ebe5=_0x3eb2a1['offset']+_0x3eb2a1['limit'],_0x1dc8e7;if(_0x44ebe5>=_0x54556c){_0x44ebe5=_0x54556c;_0x1dc8e7=0xc8;}else{_0x1dc8e7=0xce;}_0x1b7002[_0xa291('0x1a')](_0x1dc8e7);return _0x1b7002[_0xa291('0x1b')](_0xa291('0x1c'),_0x48b4c5+'-'+_0x44ebe5+'/'+_0x54556c)[_0xa291('0x18')](_0x20b703);}return null;};}function patchUpdates(_0x542788){return function(_0xed59ed){try{jsonpatch['apply'](_0xed59ed,_0x542788,!![]);}catch(_0x3f26e4){return BPromise[_0xa291('0x1d')](_0x3f26e4);}return _0xed59ed['save']();};}function saveUpdates(_0x506673,_0x57ba25){return function(_0x58ebb7){if(_0x58ebb7){return _0x58ebb7['update'](_0x506673)['then'](function(_0x2ee670){return _0x2ee670;});}return null;};}function removeEntity(_0x31b906,_0x42c3b9){return function(_0x40546d){if(_0x40546d){return _0x40546d[_0xa291('0x1e')]()['then'](function(){_0x31b906['status'](0xcc)[_0xa291('0x1f')]();});}};}function handleEntityNotFound(_0x2aac61,_0x316630){return function(_0xf7a673){if(!_0xf7a673){_0x2aac61[_0xa291('0x17')](0x194);}return _0xf7a673;};}function handleError(_0x16745e,_0x512c2e){_0x512c2e=_0x512c2e||0x1f4;return function(_0x43f97a){logger[_0xa291('0x20')](_0x43f97a[_0xa291('0x21')]);if(_0x43f97a[_0xa291('0x22')]){delete _0x43f97a['name'];}_0x16745e[_0xa291('0x1a')](_0x512c2e)[_0xa291('0x23')](_0x43f97a);};}exports[_0xa291('0x24')]=function(_0x887983,_0x4c6a08){var _0x41f85c={},_0x422cd6={},_0x38c54b={'count':0x0,'rows':[]};var _0x3ac75d=db[_0xa291('0x25')][_0xa291('0x26')];_0x422cd6[_0xa291('0x27')]=_[_0xa291('0x28')](_0x3ac75d);_0x422cd6[_0xa291('0x29')]=_['keys'](_0x887983[_0xa291('0x29')]);_0x422cd6[_0xa291('0x2a')]=_['intersection'](_0x422cd6[_0xa291('0x27')],_0x422cd6[_0xa291('0x29')]);_0x41f85c[_0xa291('0x2b')]=_[_0xa291('0x2c')](_0x422cd6['model'],qs['fields'](_0x887983[_0xa291('0x29')][_0xa291('0x2d')]));_0x41f85c[_0xa291('0x2b')]=_0x41f85c[_0xa291('0x2b')][_0xa291('0x2e')]?_0x41f85c[_0xa291('0x2b')]:_0x422cd6[_0xa291('0x27')];if(!_0x887983[_0xa291('0x29')]['hasOwnProperty'](_0xa291('0x2f'))){_0x41f85c[_0xa291('0x30')]=qs[_0xa291('0x30')](_0x887983[_0xa291('0x29')]['limit']);_0x41f85c[_0xa291('0x19')]=qs[_0xa291('0x19')](_0x887983[_0xa291('0x29')][_0xa291('0x19')]);}_0x41f85c['order']=qs[_0xa291('0x31')](_0x887983['query'][_0xa291('0x31')]);_0x41f85c[_0xa291('0x32')]=qs['filters'](_[_0xa291('0x33')](_0x887983[_0xa291('0x29')],_0x422cd6[_0xa291('0x2a')]));if(_0x887983[_0xa291('0x29')][_0xa291('0x34')]){_0x41f85c[_0xa291('0x32')]=_['merge'](_0x41f85c[_0xa291('0x32')],{'$or':_[_0xa291('0x35')](_0x3ac75d,function(_0x4d0650){if(_0x4d0650[_0xa291('0x36')][_0xa291('0x37')]!==_0xa291('0x38')){var _0x565a81={};_0x565a81[_0x4d0650[_0xa291('0x39')]]={'$like':'%'+_0x887983['query'][_0xa291('0x34')]+'%'};return _0x565a81;}})});}_0x41f85c=_['merge']({},_0x41f85c,_0x887983[_0xa291('0x3a')]);var _0x3952c0={'where':_0x41f85c[_0xa291('0x32')]};return db[_0xa291('0x25')][_0xa291('0x3b')](_0x3952c0)[_0xa291('0x3c')](function(_0x5e4433){_0x38c54b['count']=_0x5e4433;if(_0x887983['query'][_0xa291('0x3d')]){_0x41f85c[_0xa291('0x3e')]=[{'all':!![]}];}return db[_0xa291('0x25')][_0xa291('0x3f')](_0x41f85c);})[_0xa291('0x3c')](function(_0x358ca6){_0x38c54b[_0xa291('0x40')]=_0x358ca6;return _0x38c54b;})[_0xa291('0x3c')](respondWithFilteredResult(_0x4c6a08,_0x41f85c))[_0xa291('0x41')](handleError(_0x4c6a08,null));};exports[_0xa291('0x42')]=function(_0x56ba1b,_0x44bd66){var _0x6705bc={'raw':![],'where':{'id':_0x56ba1b[_0xa291('0x43')]['id']}},_0x46e58e={};_0x46e58e['model']=_[_0xa291('0x28')](db[_0xa291('0x25')][_0xa291('0x26')]);_0x46e58e['query']=_['keys'](_0x56ba1b['query']);_0x46e58e['filters']=_[_0xa291('0x2c')](_0x46e58e[_0xa291('0x27')],_0x46e58e['query']);_0x6705bc[_0xa291('0x2b')]=_[_0xa291('0x2c')](_0x46e58e[_0xa291('0x27')],qs[_0xa291('0x2d')](_0x56ba1b[_0xa291('0x29')][_0xa291('0x2d')]));_0x6705bc['attributes']=_0x6705bc[_0xa291('0x2b')]['length']?_0x6705bc[_0xa291('0x2b')]:_0x46e58e[_0xa291('0x27')];if(_0x56ba1b[_0xa291('0x29')][_0xa291('0x3d')]){_0x6705bc[_0xa291('0x3e')]=[{'all':!![]}];}_0x6705bc=_[_0xa291('0x44')]({},_0x6705bc,_0x56ba1b[_0xa291('0x3a')]);return db['Automation']['find'](_0x6705bc)[_0xa291('0x3c')](handleEntityNotFound(_0x44bd66,null))[_0xa291('0x3c')](respondWithResult(_0x44bd66,null))['catch'](handleError(_0x44bd66,null));};exports[_0xa291('0x45')]=function(_0x23a219,_0x3584da){return db[_0xa291('0x25')][_0xa291('0x45')](_0x23a219[_0xa291('0x46')],{})[_0xa291('0x3c')](respondWithResult(_0x3584da,0xc9))[_0xa291('0x41')](handleError(_0x3584da,null));};exports[_0xa291('0x47')]=function(_0x3a92af,_0x142493){if(_0x3a92af[_0xa291('0x46')]['id']){delete _0x3a92af[_0xa291('0x46')]['id'];}return db['Automation'][_0xa291('0x48')]({'where':{'id':_0x3a92af['params']['id']}})[_0xa291('0x3c')](handleEntityNotFound(_0x142493,null))[_0xa291('0x3c')](saveUpdates(_0x3a92af[_0xa291('0x46')],null))[_0xa291('0x3c')](respondWithResult(_0x142493,null))[_0xa291('0x41')](handleError(_0x142493,null));};exports[_0xa291('0x1e')]=function(_0x189c7d,_0x560d15){return db['Automation'][_0xa291('0x48')]({'where':{'id':_0x189c7d[_0xa291('0x43')]['id']}})[_0xa291('0x3c')](handleEntityNotFound(_0x560d15,null))[_0xa291('0x3c')](removeEntity(_0x560d15,null))[_0xa291('0x41')](handleError(_0x560d15,null));};exports[_0xa291('0x49')]=function(_0x2941c0,_0x2b75d7,_0x730fef){return db[_0xa291('0x4a')][_0xa291('0x48')]({'where':{'id':_0x2941c0['params']['id']}})[_0xa291('0x3c')](handleEntityNotFound(_0x2b75d7,null))[_0xa291('0x3c')](function(_0x3c11d9){if(_0x3c11d9){return _0x3c11d9[_0xa291('0x49')](_0x2941c0[_0xa291('0x46')][_0xa291('0x4b')],_['omit'](_0x2941c0[_0xa291('0x46')],['ids','id'])||{});}})[_0xa291('0x3c')](respondWithResult(_0x2b75d7,null))[_0xa291('0x41')](handleError(_0x2b75d7,null));};exports[_0xa291('0x4c')]=function(_0x3ea7d6,_0x552f32,_0x25e914){var _0x9055a5={};var _0x2f71e8={};var _0x53cac8;var _0x8bac6f;return db[_0xa291('0x25')][_0xa291('0x4d')]({'where':{'id':_0x3ea7d6[_0xa291('0x43')]['id']}})['then'](handleEntityNotFound(_0x552f32,null))[_0xa291('0x3c')](function(_0x1f9879){if(_0x1f9879){_0x53cac8=_0x1f9879;_0x2f71e8[_0xa291('0x27')]=_['keys'](db[_0xa291('0x4a')]['rawAttributes']);_0x2f71e8[_0xa291('0x29')]=_[_0xa291('0x28')](_0x3ea7d6[_0xa291('0x29')]);_0x2f71e8[_0xa291('0x2a')]=_[_0xa291('0x2c')](_0x2f71e8['model'],_0x2f71e8[_0xa291('0x29')]);_0x9055a5[_0xa291('0x2b')]=_[_0xa291('0x2c')](_0x2f71e8['model'],qs[_0xa291('0x2d')](_0x3ea7d6[_0xa291('0x29')][_0xa291('0x2d')]));_0x9055a5[_0xa291('0x2b')]=_0x9055a5[_0xa291('0x2b')][_0xa291('0x2e')]?_0x9055a5[_0xa291('0x2b')]:_0x2f71e8[_0xa291('0x27')];_0x9055a5['order']=qs[_0xa291('0x31')](_0x3ea7d6[_0xa291('0x29')][_0xa291('0x31')]);_0x9055a5[_0xa291('0x32')]=qs[_0xa291('0x2a')](_[_0xa291('0x33')](_0x3ea7d6[_0xa291('0x29')],_0x2f71e8[_0xa291('0x2a')]));if(_0x3ea7d6[_0xa291('0x29')][_0xa291('0x34')]){_0x9055a5['where']=_[_0xa291('0x44')](_0x9055a5['where'],{'$or':_['map'](_0x9055a5[_0xa291('0x2b')],function(_0x53e8cf){var _0x549427={};_0x549427[_0x53e8cf]={'$like':'%'+_0x3ea7d6['query'][_0xa291('0x34')]+'%'};return _0x549427;})});}_0x9055a5=_[_0xa291('0x44')]({},_0x9055a5,_0x3ea7d6[_0xa291('0x3a')]);return _0x53cac8[_0xa291('0x4c')](_0x9055a5);}})[_0xa291('0x3c')](function(_0x394860){if(_0x394860){_0x8bac6f=_0x394860[_0xa291('0x2e')];if(!_0x3ea7d6['query'][_0xa291('0x4e')](_0xa291('0x2f'))){_0x9055a5[_0xa291('0x30')]=qs[_0xa291('0x30')](_0x3ea7d6['query'][_0xa291('0x30')]);_0x9055a5[_0xa291('0x19')]=qs[_0xa291('0x19')](_0x3ea7d6[_0xa291('0x29')][_0xa291('0x19')]);}return _0x53cac8[_0xa291('0x4c')](_0x9055a5);}})[_0xa291('0x3c')](function(_0x5c5f7d){if(_0x5c5f7d){return _0x5c5f7d?{'count':_0x8bac6f,'rows':_0x5c5f7d}:null;}})[_0xa291('0x3c')](respondWithResult(_0x552f32,null))['catch'](handleError(_0x552f32,null));};exports[_0xa291('0x4f')]=function(_0x254211,_0x56773b,_0x582f73){return db[_0xa291('0x50')][_0xa291('0x48')]({'where':{'id':_0x254211[_0xa291('0x43')]['id']}})[_0xa291('0x3c')](handleEntityNotFound(_0x56773b,null))[_0xa291('0x3c')](function(_0x3926bf){if(_0x3926bf){return _0x3926bf[_0xa291('0x4f')](_0x254211[_0xa291('0x46')]['ids'],_[_0xa291('0x51')](_0x254211[_0xa291('0x46')],[_0xa291('0x4b'),'id'])||{});}})[_0xa291('0x3c')](respondWithResult(_0x56773b,null))[_0xa291('0x41')](handleError(_0x56773b,null));};exports[_0xa291('0x52')]=function(_0x5c9f7a,_0x2168d9,_0x23c2ad){var _0x35420d={};var _0xb8e619={};var _0x46f932;var _0xf74f55;return db['Automation'][_0xa291('0x4d')]({'where':{'id':_0x5c9f7a['params']['id']}})[_0xa291('0x3c')](handleEntityNotFound(_0x2168d9,null))['then'](function(_0x5bbb26){if(_0x5bbb26){_0x46f932=_0x5bbb26;_0xb8e619[_0xa291('0x27')]=_[_0xa291('0x28')](db[_0xa291('0x50')]['rawAttributes']);_0xb8e619[_0xa291('0x29')]=_[_0xa291('0x28')](_0x5c9f7a[_0xa291('0x29')]);_0xb8e619[_0xa291('0x2a')]=_[_0xa291('0x2c')](_0xb8e619[_0xa291('0x27')],_0xb8e619['query']);_0x35420d[_0xa291('0x2b')]=_['intersection'](_0xb8e619[_0xa291('0x27')],qs['fields'](_0x5c9f7a[_0xa291('0x29')][_0xa291('0x2d')]));_0x35420d['attributes']=_0x35420d['attributes'][_0xa291('0x2e')]?_0x35420d[_0xa291('0x2b')]:_0xb8e619['model'];_0x35420d[_0xa291('0x53')]=qs['sort'](_0x5c9f7a[_0xa291('0x29')]['sort']);_0x35420d[_0xa291('0x32')]=qs[_0xa291('0x2a')](_[_0xa291('0x33')](_0x5c9f7a[_0xa291('0x29')],_0xb8e619['filters']));if(_0x5c9f7a[_0xa291('0x29')][_0xa291('0x34')]){_0x35420d[_0xa291('0x32')]=_['merge'](_0x35420d['where'],{'$or':_[_0xa291('0x35')](_0x35420d[_0xa291('0x2b')],function(_0x1b9115){var _0x10fa0e={};_0x10fa0e[_0x1b9115]={'$like':'%'+_0x5c9f7a[_0xa291('0x29')][_0xa291('0x34')]+'%'};return _0x10fa0e;})});}_0x35420d=_[_0xa291('0x44')]({},_0x35420d,_0x5c9f7a[_0xa291('0x3a')]);return _0x46f932[_0xa291('0x52')](_0x35420d);}})[_0xa291('0x3c')](function(_0x19e921){if(_0x19e921){_0xf74f55=_0x19e921[_0xa291('0x2e')];if(!_0x5c9f7a[_0xa291('0x29')][_0xa291('0x4e')](_0xa291('0x2f'))){_0x35420d[_0xa291('0x30')]=qs[_0xa291('0x30')](_0x5c9f7a['query']['limit']);_0x35420d[_0xa291('0x19')]=qs[_0xa291('0x19')](_0x5c9f7a['query'][_0xa291('0x19')]);}return _0x46f932[_0xa291('0x52')](_0x35420d);}})[_0xa291('0x3c')](function(_0x3f44ac){if(_0x3f44ac){return _0x3f44ac?{'count':_0xf74f55,'rows':_0x3f44ac}:null;}})[_0xa291('0x3c')](respondWithResult(_0x2168d9,null))['catch'](handleError(_0x2168d9,null));}; \ No newline at end of file +var _0xfc4b=['where','pick','filter','merge','map','type','key','VIRTUAL','field','options','Automation','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','update','body','addConditions','Condition','ids','omit','hasOwnProperty','getConditions','addActions','Action','getActions','findOne','html-pdf','rimraf','zip-dir','moment','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','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','reject','save','then','sendStatus','error','name','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort'];(function(_0x1fc18b,_0x13d27d){var _0x16a351=function(_0x54a799){while(--_0x54a799){_0x1fc18b['push'](_0x1fc18b['shift']());}};_0x16a351(++_0x13d27d);}(_0xfc4b,0x1b6));var _0xbfc4=function(_0x468510,_0x480a78){_0x468510=_0x468510-0x0;var _0xc9efee=_0xfc4b[_0x468510];return _0xc9efee;};'use strict';var pdf=require(_0xbfc4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbfc4('0x1'));var zipdir=require(_0xbfc4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbfc4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbfc4('0x4'));var path=require(_0xbfc4('0x5'));var sox=require('sox');var csv=require(_0xbfc4('0x6'));var ejs=require(_0xbfc4('0x7'));var fs=require('fs');var _=require(_0xbfc4('0x8'));var squel=require(_0xbfc4('0x9'));var crypto=require(_0xbfc4('0xa'));var jsforce=require(_0xbfc4('0xb'));var deskjs=require(_0xbfc4('0xc'));var toCsv=require(_0xbfc4('0x6'));var querystring=require(_0xbfc4('0xd'));var Papa=require(_0xbfc4('0xe'));var authService=require(_0xbfc4('0xf'));var hardwareService=require(_0xbfc4('0x10'));var Redis=require(_0xbfc4('0x11'));var qs=require(_0xbfc4('0x12'));var logger=require(_0xbfc4('0x13'))(_0xbfc4('0x14'));var utils=require('../../config/utils');var config=require(_0xbfc4('0x15'));var db=require(_0xbfc4('0x16'))['db'];function respondWithStatusCode(_0x4b2c28,_0xbdc291){_0xbdc291=_0xbdc291||0xcc;return function(_0x38f2c8){if(_0x38f2c8){return _0x4b2c28['sendStatus'](_0xbdc291);}return _0x4b2c28[_0xbfc4('0x17')](_0xbdc291)[_0xbfc4('0x18')]();};}function respondWithResult(_0x61bd88,_0x170cd){_0x170cd=_0x170cd||0xc8;return function(_0x178612){if(_0x178612){return _0x61bd88[_0xbfc4('0x17')](_0x170cd)['json'](_0x178612);}};}function respondWithFilteredResult(_0x15c6f9,_0x4771e2){return function(_0x470e6f){if(_0x470e6f){var _0xdb99ac=_0x470e6f[_0xbfc4('0x19')],_0x29d2ed=_0x4771e2[_0xbfc4('0x1a')],_0x14f2b0=_0x4771e2[_0xbfc4('0x1a')]+_0x4771e2[_0xbfc4('0x1b')],_0x183a8b;if(_0x14f2b0>=_0xdb99ac){_0x14f2b0=_0xdb99ac;_0x183a8b=0xc8;}else{_0x183a8b=0xce;}_0x15c6f9['status'](_0x183a8b);return _0x15c6f9[_0xbfc4('0x1c')](_0xbfc4('0x1d'),_0x29d2ed+'-'+_0x14f2b0+'/'+_0xdb99ac)[_0xbfc4('0x1e')](_0x470e6f);}return null;};}function patchUpdates(_0x3394f1){return function(_0x2196fe){try{jsonpatch['apply'](_0x2196fe,_0x3394f1,!![]);}catch(_0x436984){return BPromise[_0xbfc4('0x1f')](_0x436984);}return _0x2196fe[_0xbfc4('0x20')]();};}function saveUpdates(_0x1f35fd,_0x398a0b){return function(_0x194e5f){if(_0x194e5f){return _0x194e5f['update'](_0x1f35fd)[_0xbfc4('0x21')](function(_0x4a4070){return _0x4a4070;});}return null;};}function removeEntity(_0x4c0a12,_0xb0f9ab){return function(_0x39549f){if(_0x39549f){return _0x39549f['destroy']()['then'](function(){_0x4c0a12['status'](0xcc)[_0xbfc4('0x18')]();});}};}function handleEntityNotFound(_0x44ed03,_0x27b3ee){return function(_0x3b5693){if(!_0x3b5693){_0x44ed03[_0xbfc4('0x22')](0x194);}return _0x3b5693;};}function handleError(_0x215155,_0x375918){_0x375918=_0x375918||0x1f4;return function(_0x482b2a){logger[_0xbfc4('0x23')](_0x482b2a['stack']);if(_0x482b2a['name']){delete _0x482b2a[_0xbfc4('0x24')];}_0x215155[_0xbfc4('0x17')](_0x375918)['send'](_0x482b2a);};}exports['index']=function(_0x40706f,_0x2ead5f){var _0x1492a3={},_0x545f6c={},_0x4fefd7={'count':0x0,'rows':[]};var _0x113aa6=db['Automation']['rawAttributes'];_0x545f6c['model']=_[_0xbfc4('0x25')](_0x113aa6);_0x545f6c[_0xbfc4('0x26')]=_['keys'](_0x40706f[_0xbfc4('0x26')]);_0x545f6c[_0xbfc4('0x27')]=_[_0xbfc4('0x28')](_0x545f6c[_0xbfc4('0x29')],_0x545f6c[_0xbfc4('0x26')]);_0x1492a3[_0xbfc4('0x2a')]=_[_0xbfc4('0x28')](_0x545f6c['model'],qs['fields'](_0x40706f[_0xbfc4('0x26')][_0xbfc4('0x2b')]));_0x1492a3[_0xbfc4('0x2a')]=_0x1492a3[_0xbfc4('0x2a')][_0xbfc4('0x2c')]?_0x1492a3['attributes']:_0x545f6c[_0xbfc4('0x29')];if(!_0x40706f[_0xbfc4('0x26')]['hasOwnProperty'](_0xbfc4('0x2d'))){_0x1492a3[_0xbfc4('0x1b')]=qs[_0xbfc4('0x1b')](_0x40706f[_0xbfc4('0x26')][_0xbfc4('0x1b')]);_0x1492a3[_0xbfc4('0x1a')]=qs['offset'](_0x40706f[_0xbfc4('0x26')][_0xbfc4('0x1a')]);}_0x1492a3[_0xbfc4('0x2e')]=qs[_0xbfc4('0x2f')](_0x40706f[_0xbfc4('0x26')][_0xbfc4('0x2f')]);_0x1492a3[_0xbfc4('0x30')]=qs[_0xbfc4('0x27')](_[_0xbfc4('0x31')](_0x40706f[_0xbfc4('0x26')],_0x545f6c[_0xbfc4('0x27')]));if(_0x40706f[_0xbfc4('0x26')][_0xbfc4('0x32')]){_0x1492a3[_0xbfc4('0x30')]=_[_0xbfc4('0x33')](_0x1492a3[_0xbfc4('0x30')],{'$or':_[_0xbfc4('0x34')](_0x113aa6,function(_0x31cd51){if(_0x31cd51[_0xbfc4('0x35')][_0xbfc4('0x36')]!==_0xbfc4('0x37')){var _0x4c972b={};_0x4c972b[_0x31cd51[_0xbfc4('0x38')]]={'$like':'%'+_0x40706f['query'][_0xbfc4('0x32')]+'%'};return _0x4c972b;}})});}_0x1492a3=_[_0xbfc4('0x33')]({},_0x1492a3,_0x40706f[_0xbfc4('0x39')]);var _0x200c88={'where':_0x1492a3[_0xbfc4('0x30')]};return db[_0xbfc4('0x3a')][_0xbfc4('0x19')](_0x200c88)[_0xbfc4('0x21')](function(_0x201414){_0x4fefd7[_0xbfc4('0x19')]=_0x201414;if(_0x40706f[_0xbfc4('0x26')][_0xbfc4('0x3b')]){_0x1492a3[_0xbfc4('0x3c')]=[{'all':!![]}];}return db['Automation'][_0xbfc4('0x3d')](_0x1492a3);})[_0xbfc4('0x21')](function(_0x1c393f){_0x4fefd7[_0xbfc4('0x3e')]=_0x1c393f;return _0x4fefd7;})[_0xbfc4('0x21')](respondWithFilteredResult(_0x2ead5f,_0x1492a3))['catch'](handleError(_0x2ead5f,null));};exports[_0xbfc4('0x3f')]=function(_0x3bf912,_0x593e69){var _0x484b7b={'raw':![],'where':{'id':_0x3bf912[_0xbfc4('0x40')]['id']}},_0x769b1a={};_0x769b1a[_0xbfc4('0x29')]=_[_0xbfc4('0x25')](db[_0xbfc4('0x3a')][_0xbfc4('0x41')]);_0x769b1a[_0xbfc4('0x26')]=_['keys'](_0x3bf912[_0xbfc4('0x26')]);_0x769b1a[_0xbfc4('0x27')]=_[_0xbfc4('0x28')](_0x769b1a[_0xbfc4('0x29')],_0x769b1a[_0xbfc4('0x26')]);_0x484b7b[_0xbfc4('0x2a')]=_['intersection'](_0x769b1a[_0xbfc4('0x29')],qs[_0xbfc4('0x2b')](_0x3bf912[_0xbfc4('0x26')][_0xbfc4('0x2b')]));_0x484b7b[_0xbfc4('0x2a')]=_0x484b7b[_0xbfc4('0x2a')]['length']?_0x484b7b[_0xbfc4('0x2a')]:_0x769b1a['model'];if(_0x3bf912['query']['includeAll']){_0x484b7b['include']=[{'all':!![]}];}_0x484b7b=_[_0xbfc4('0x33')]({},_0x484b7b,_0x3bf912[_0xbfc4('0x39')]);return db[_0xbfc4('0x3a')][_0xbfc4('0x42')](_0x484b7b)[_0xbfc4('0x21')](handleEntityNotFound(_0x593e69,null))[_0xbfc4('0x21')](respondWithResult(_0x593e69,null))[_0xbfc4('0x43')](handleError(_0x593e69,null));};exports[_0xbfc4('0x44')]=function(_0x5866ee,_0xe40347){return db[_0xbfc4('0x3a')][_0xbfc4('0x44')](_0x5866ee['body'],{})[_0xbfc4('0x21')](respondWithResult(_0xe40347,0xc9))[_0xbfc4('0x43')](handleError(_0xe40347,null));};exports[_0xbfc4('0x45')]=function(_0x438236,_0x1fc71b){if(_0x438236[_0xbfc4('0x46')]['id']){delete _0x438236[_0xbfc4('0x46')]['id'];}return db[_0xbfc4('0x3a')]['find']({'where':{'id':_0x438236[_0xbfc4('0x40')]['id']}})[_0xbfc4('0x21')](handleEntityNotFound(_0x1fc71b,null))[_0xbfc4('0x21')](saveUpdates(_0x438236[_0xbfc4('0x46')],null))[_0xbfc4('0x21')](respondWithResult(_0x1fc71b,null))[_0xbfc4('0x43')](handleError(_0x1fc71b,null));};exports['destroy']=function(_0x52f2be,_0x10da8b){return db[_0xbfc4('0x3a')][_0xbfc4('0x42')]({'where':{'id':_0x52f2be[_0xbfc4('0x40')]['id']}})[_0xbfc4('0x21')](handleEntityNotFound(_0x10da8b,null))[_0xbfc4('0x21')](removeEntity(_0x10da8b,null))[_0xbfc4('0x43')](handleError(_0x10da8b,null));};exports[_0xbfc4('0x47')]=function(_0x1df354,_0x523bf9,_0x45b1d2){return db[_0xbfc4('0x48')][_0xbfc4('0x42')]({'where':{'id':_0x1df354[_0xbfc4('0x40')]['id']}})[_0xbfc4('0x21')](handleEntityNotFound(_0x523bf9,null))[_0xbfc4('0x21')](function(_0x17bd2b){if(_0x17bd2b){return _0x17bd2b[_0xbfc4('0x47')](_0x1df354[_0xbfc4('0x46')][_0xbfc4('0x49')],_[_0xbfc4('0x4a')](_0x1df354[_0xbfc4('0x46')],[_0xbfc4('0x49'),'id'])||{});}})['then'](respondWithResult(_0x523bf9,null))[_0xbfc4('0x43')](handleError(_0x523bf9,null));};exports['getConditions']=function(_0x1bd420,_0x3a4530,_0x2d3e18){var _0x14f8a5={};var _0x20260e={};var _0x6bbfec;var _0x1104ae;return db[_0xbfc4('0x3a')]['findOne']({'where':{'id':_0x1bd420[_0xbfc4('0x40')]['id']}})[_0xbfc4('0x21')](handleEntityNotFound(_0x3a4530,null))[_0xbfc4('0x21')](function(_0x11ee5e){if(_0x11ee5e){_0x6bbfec=_0x11ee5e;_0x20260e['model']=_[_0xbfc4('0x25')](db[_0xbfc4('0x48')][_0xbfc4('0x41')]);_0x20260e['query']=_[_0xbfc4('0x25')](_0x1bd420['query']);_0x20260e[_0xbfc4('0x27')]=_[_0xbfc4('0x28')](_0x20260e['model'],_0x20260e[_0xbfc4('0x26')]);_0x14f8a5[_0xbfc4('0x2a')]=_[_0xbfc4('0x28')](_0x20260e['model'],qs[_0xbfc4('0x2b')](_0x1bd420['query'][_0xbfc4('0x2b')]));_0x14f8a5[_0xbfc4('0x2a')]=_0x14f8a5[_0xbfc4('0x2a')][_0xbfc4('0x2c')]?_0x14f8a5[_0xbfc4('0x2a')]:_0x20260e[_0xbfc4('0x29')];_0x14f8a5[_0xbfc4('0x2e')]=qs[_0xbfc4('0x2f')](_0x1bd420['query'][_0xbfc4('0x2f')]);_0x14f8a5[_0xbfc4('0x30')]=qs[_0xbfc4('0x27')](_[_0xbfc4('0x31')](_0x1bd420[_0xbfc4('0x26')],_0x20260e['filters']));if(_0x1bd420['query'][_0xbfc4('0x32')]){_0x14f8a5[_0xbfc4('0x30')]=_[_0xbfc4('0x33')](_0x14f8a5[_0xbfc4('0x30')],{'$or':_['map'](_0x14f8a5[_0xbfc4('0x2a')],function(_0x1f5d9f){var _0x1be179={};_0x1be179[_0x1f5d9f]={'$like':'%'+_0x1bd420['query']['filter']+'%'};return _0x1be179;})});}_0x14f8a5=_[_0xbfc4('0x33')]({},_0x14f8a5,_0x1bd420[_0xbfc4('0x39')]);return _0x6bbfec['getConditions'](_0x14f8a5);}})[_0xbfc4('0x21')](function(_0x3cd464){if(_0x3cd464){_0x1104ae=_0x3cd464[_0xbfc4('0x2c')];if(!_0x1bd420['query'][_0xbfc4('0x4b')](_0xbfc4('0x2d'))){_0x14f8a5[_0xbfc4('0x1b')]=qs['limit'](_0x1bd420[_0xbfc4('0x26')][_0xbfc4('0x1b')]);_0x14f8a5[_0xbfc4('0x1a')]=qs['offset'](_0x1bd420[_0xbfc4('0x26')][_0xbfc4('0x1a')]);}return _0x6bbfec[_0xbfc4('0x4c')](_0x14f8a5);}})[_0xbfc4('0x21')](function(_0x30a3d7){if(_0x30a3d7){return _0x30a3d7?{'count':_0x1104ae,'rows':_0x30a3d7}:null;}})[_0xbfc4('0x21')](respondWithResult(_0x3a4530,null))[_0xbfc4('0x43')](handleError(_0x3a4530,null));};exports[_0xbfc4('0x4d')]=function(_0x57fbdb,_0x566660,_0x1c87d3){return db[_0xbfc4('0x4e')]['find']({'where':{'id':_0x57fbdb[_0xbfc4('0x40')]['id']}})[_0xbfc4('0x21')](handleEntityNotFound(_0x566660,null))['then'](function(_0x1973d7){if(_0x1973d7){return _0x1973d7[_0xbfc4('0x4d')](_0x57fbdb['body'][_0xbfc4('0x49')],_[_0xbfc4('0x4a')](_0x57fbdb['body'],[_0xbfc4('0x49'),'id'])||{});}})[_0xbfc4('0x21')](respondWithResult(_0x566660,null))[_0xbfc4('0x43')](handleError(_0x566660,null));};exports[_0xbfc4('0x4f')]=function(_0x4851b0,_0x521d6a,_0x30e62a){var _0x592187={};var _0x52e5b8={};var _0x394087;var _0x38579f;return db[_0xbfc4('0x3a')][_0xbfc4('0x50')]({'where':{'id':_0x4851b0[_0xbfc4('0x40')]['id']}})[_0xbfc4('0x21')](handleEntityNotFound(_0x521d6a,null))[_0xbfc4('0x21')](function(_0x2210f0){if(_0x2210f0){_0x394087=_0x2210f0;_0x52e5b8['model']=_[_0xbfc4('0x25')](db[_0xbfc4('0x4e')][_0xbfc4('0x41')]);_0x52e5b8['query']=_[_0xbfc4('0x25')](_0x4851b0[_0xbfc4('0x26')]);_0x52e5b8[_0xbfc4('0x27')]=_[_0xbfc4('0x28')](_0x52e5b8['model'],_0x52e5b8['query']);_0x592187[_0xbfc4('0x2a')]=_[_0xbfc4('0x28')](_0x52e5b8[_0xbfc4('0x29')],qs[_0xbfc4('0x2b')](_0x4851b0['query'][_0xbfc4('0x2b')]));_0x592187[_0xbfc4('0x2a')]=_0x592187['attributes'][_0xbfc4('0x2c')]?_0x592187['attributes']:_0x52e5b8[_0xbfc4('0x29')];_0x592187[_0xbfc4('0x2e')]=qs[_0xbfc4('0x2f')](_0x4851b0[_0xbfc4('0x26')]['sort']);_0x592187[_0xbfc4('0x30')]=qs['filters'](_[_0xbfc4('0x31')](_0x4851b0[_0xbfc4('0x26')],_0x52e5b8[_0xbfc4('0x27')]));if(_0x4851b0[_0xbfc4('0x26')]['filter']){_0x592187[_0xbfc4('0x30')]=_[_0xbfc4('0x33')](_0x592187[_0xbfc4('0x30')],{'$or':_[_0xbfc4('0x34')](_0x592187['attributes'],function(_0x46c26f){var _0x94b31b={};_0x94b31b[_0x46c26f]={'$like':'%'+_0x4851b0['query'][_0xbfc4('0x32')]+'%'};return _0x94b31b;})});}_0x592187=_[_0xbfc4('0x33')]({},_0x592187,_0x4851b0[_0xbfc4('0x39')]);return _0x394087['getActions'](_0x592187);}})[_0xbfc4('0x21')](function(_0x58e38c){if(_0x58e38c){_0x38579f=_0x58e38c[_0xbfc4('0x2c')];if(!_0x4851b0[_0xbfc4('0x26')][_0xbfc4('0x4b')](_0xbfc4('0x2d'))){_0x592187[_0xbfc4('0x1b')]=qs['limit'](_0x4851b0[_0xbfc4('0x26')]['limit']);_0x592187[_0xbfc4('0x1a')]=qs[_0xbfc4('0x1a')](_0x4851b0[_0xbfc4('0x26')][_0xbfc4('0x1a')]);}return _0x394087[_0xbfc4('0x4f')](_0x592187);}})[_0xbfc4('0x21')](function(_0x479e7b){if(_0x479e7b){return _0x479e7b?{'count':_0x38579f,'rows':_0x479e7b}:null;}})['then'](respondWithResult(_0x521d6a,null))['catch'](handleError(_0x521d6a,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index e2dc581..86f8ecd 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 _0xe93a=['exports','define','tools_automations','lodash','util','request-promise'];(function(_0x4b4490,_0x4371bb){var _0x4dffdb=function(_0x54dd71){while(--_0x54dd71){_0x4b4490['push'](_0x4b4490['shift']());}};_0x4dffdb(++_0x4371bb);}(_0xe93a,0x1a7));var _0xae93=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xe93a[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xae93('0x0'));var util=require(_0xae93('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xae93('0x2'));var attributes=require('./automation.attributes');module[_0xae93('0x3')]=function(_0x48fef5,_0x4b2548){return _0x48fef5[_0xae93('0x4')]('Automation',attributes,{'tableName':_0xae93('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2542=['tools_automations','lodash','util','../../config/logger','api','bluebird','./automation.attributes','exports','define'];(function(_0x13dade,_0x2a48e7){var _0x52b5b2=function(_0x43298d){while(--_0x43298d){_0x13dade['push'](_0x13dade['shift']());}};_0x52b5b2(++_0x2a48e7);}(_0x2542,0x169));var _0x2254=function(_0x4fcb79,_0x39642d){_0x4fcb79=_0x4fcb79-0x0;var _0x3666a5=_0x2542[_0x4fcb79];return _0x3666a5;};'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'));module[_0x2254('0x6')]=function(_0x27f5c9,_0x456612){return _0x27f5c9[_0x2254('0x7')]('Automation',attributes,{'tableName':_0x2254('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 3422c76..87ec89a 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 _0x0e50=['../../config/environment','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3cc8b9,_0x5c95f9){var _0x44d63f=function(_0x4d1f32){while(--_0x4d1f32){_0x3cc8b9['push'](_0x3cc8b9['shift']());}};_0x44d63f(++_0x5c95f9);}(_0x0e50,0x168));var _0x00e5=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0e50[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x00e5('0x0'));var util=require(_0x00e5('0x1'));var moment=require(_0x00e5('0x2'));var BPromise=require('bluebird');var rs=require(_0x00e5('0x3'));var fs=require('fs');var Redis=require(_0x00e5('0x4'));var db=require(_0x00e5('0x5'))['db'];var utils=require(_0x00e5('0x6'));var logger=require(_0x00e5('0x7'))('rpc');var config=require(_0x00e5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x00e5('0x9')][_0x00e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x255aec,_0x2a4119,_0x40b93e){return new BPromise(function(_0x4c91eb,_0x28750c){return client[_0x00e5('0xb')](_0x255aec,_0x40b93e)[_0x00e5('0xc')](function(_0x2a49cd){logger[_0x00e5('0xd')](_0x00e5('0xe'),_0x2a4119,'request\x20sent');logger[_0x00e5('0xf')](_0x00e5('0x10'),_0x2a4119,'request\x20sent',JSON[_0x00e5('0x11')](_0x2a49cd));if(_0x2a49cd[_0x00e5('0x12')]){if(_0x2a49cd['error']['code']===0x1f4){logger[_0x00e5('0x12')](_0x00e5('0xe'),_0x2a4119,_0x2a49cd[_0x00e5('0x12')]['message']);return _0x28750c(_0x2a49cd[_0x00e5('0x12')][_0x00e5('0x13')]);}logger[_0x00e5('0x12')](_0x00e5('0xe'),_0x2a4119,_0x2a49cd[_0x00e5('0x12')][_0x00e5('0x13')]);return _0x4c91eb(_0x2a49cd[_0x00e5('0x12')]['message']);}else{logger[_0x00e5('0xd')]('Automation,\x20%s,\x20%s',_0x2a4119,_0x00e5('0x14'));_0x4c91eb(_0x2a49cd[_0x00e5('0x15')][_0x00e5('0x13')]);}})[_0x00e5('0x16')](function(_0x2f3c16){logger['error']('Automation,\x20%s,\x20%s',_0x2a4119,_0x2f3c16);_0x28750c(_0x2f3c16);});});} \ No newline at end of file +var _0xf271=['code','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x45423e,_0x4cc862){var _0x3157c1=function(_0x5ddce4){while(--_0x5ddce4){_0x45423e['push'](_0x45423e['shift']());}};_0x3157c1(++_0x4cc862);}(_0xf271,0x10b));var _0x1f27=function(_0x522c30,_0x55d91c){_0x522c30=_0x522c30-0x0;var _0x10f547=_0xf271[_0x522c30];return _0x10f547;};'use strict';var _=require(_0x1f27('0x0'));var util=require('util');var moment=require(_0x1f27('0x1'));var BPromise=require(_0x1f27('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f27('0x3'))['db'];var utils=require(_0x1f27('0x4'));var logger=require(_0x1f27('0x5'))(_0x1f27('0x6'));var config=require(_0x1f27('0x7'));var jayson=require(_0x1f27('0x8'));var client=jayson[_0x1f27('0x9')][_0x1f27('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e397f,_0x408347,_0x376e7b){return new BPromise(function(_0x2690db,_0xf12834){return client[_0x1f27('0xb')](_0x2e397f,_0x376e7b)[_0x1f27('0xc')](function(_0x153ac2){logger[_0x1f27('0xd')](_0x1f27('0xe'),_0x408347,_0x1f27('0xf'));logger['debug'](_0x1f27('0x10'),_0x408347,'request\x20sent',JSON[_0x1f27('0x11')](_0x153ac2));if(_0x153ac2[_0x1f27('0x12')]){if(_0x153ac2[_0x1f27('0x12')][_0x1f27('0x13')]===0x1f4){logger[_0x1f27('0x12')](_0x1f27('0xe'),_0x408347,_0x153ac2[_0x1f27('0x12')]['message']);return _0xf12834(_0x153ac2[_0x1f27('0x12')][_0x1f27('0x14')]);}logger[_0x1f27('0x12')]('Automation,\x20%s,\x20%s',_0x408347,_0x153ac2[_0x1f27('0x12')][_0x1f27('0x14')]);return _0x2690db(_0x153ac2[_0x1f27('0x12')][_0x1f27('0x14')]);}else{logger[_0x1f27('0xd')](_0x1f27('0xe'),_0x408347,_0x1f27('0xf'));_0x2690db(_0x153ac2['result'][_0x1f27('0x14')]);}})[_0x1f27('0x15')](function(_0x3cda5b){logger[_0x1f27('0x12')]('Automation,\x20%s,\x20%s',_0x408347,_0x3cda5b);_0xf12834(_0x3cda5b);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index a779e2a..0bd06e9 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 _0x6afc=['show','getConditions','getActions','create','post','/:id/actions','addActions','put','update','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated'];(function(_0x29389c,_0x30f36){var _0x5d3c7c=function(_0x500c1c){while(--_0x500c1c){_0x29389c['push'](_0x29389c['shift']());}};_0x5d3c7c(++_0x30f36);}(_0x6afc,0x16b));var _0xc6af=function(_0x19ce3c,_0x166ee4){_0x19ce3c=_0x19ce3c-0x0;var _0x16a3e3=_0x6afc[_0x19ce3c];return _0x16a3e3;};'use strict';var multer=require(_0xc6af('0x0'));var util=require('util');var path=require(_0xc6af('0x1'));var timeout=require('connect-timeout');var express=require(_0xc6af('0x2'));var router=express[_0xc6af('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc6af('0x4'));var config=require(_0xc6af('0x5'));var controller=require(_0xc6af('0x6'));router[_0xc6af('0x7')]('/',auth['isAuthenticated'](),controller[_0xc6af('0x8')]);router[_0xc6af('0x7')](_0xc6af('0x9'),auth[_0xc6af('0xa')](),controller[_0xc6af('0xb')]);router[_0xc6af('0x7')]('/:id/conditions',auth[_0xc6af('0xa')](),controller[_0xc6af('0xc')]);router['get']('/:id/actions',auth[_0xc6af('0xa')](),controller[_0xc6af('0xd')]);router['post']('/',auth[_0xc6af('0xa')](),controller[_0xc6af('0xe')]);router[_0xc6af('0xf')]('/:id/conditions',auth[_0xc6af('0xa')](),controller['addConditions']);router[_0xc6af('0xf')](_0xc6af('0x10'),auth[_0xc6af('0xa')](),controller[_0xc6af('0x11')]);router[_0xc6af('0x12')](_0xc6af('0x9'),auth[_0xc6af('0xa')](),controller[_0xc6af('0x13')]);router['delete'](_0xc6af('0x9'),auth[_0xc6af('0xa')](),controller[_0xc6af('0x14')]);module[_0xc6af('0x15')]=router; \ No newline at end of file +var _0xe469=['addActions','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','index','get','/:id','isAuthenticated','/:id/conditions','getConditions','/:id/actions','getActions','create','post'];(function(_0xa658da,_0xba29bc){var _0x275149=function(_0x1d7c80){while(--_0x1d7c80){_0xa658da['push'](_0xa658da['shift']());}};_0x275149(++_0xba29bc);}(_0xe469,0x102));var _0x9e46=function(_0x26ef8b,_0x3aee1b){_0x26ef8b=_0x26ef8b-0x0;var _0x39fd95=_0xe469[_0x26ef8b];return _0x39fd95;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9e46('0x0'));var timeout=require(_0x9e46('0x1'));var express=require(_0x9e46('0x2'));var router=express[_0x9e46('0x3')]();var auth=require(_0x9e46('0x4'));var interaction=require(_0x9e46('0x5'));var config=require(_0x9e46('0x6'));var controller=require(_0x9e46('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9e46('0x8')]);router[_0x9e46('0x9')](_0x9e46('0xa'),auth[_0x9e46('0xb')](),controller['show']);router[_0x9e46('0x9')](_0x9e46('0xc'),auth[_0x9e46('0xb')](),controller[_0x9e46('0xd')]);router[_0x9e46('0x9')](_0x9e46('0xe'),auth[_0x9e46('0xb')](),controller[_0x9e46('0xf')]);router['post']('/',auth[_0x9e46('0xb')](),controller[_0x9e46('0x10')]);router[_0x9e46('0x11')](_0x9e46('0xc'),auth[_0x9e46('0xb')](),controller['addConditions']);router[_0x9e46('0x11')](_0x9e46('0xe'),auth[_0x9e46('0xb')](),controller[_0x9e46('0x12')]);router[_0x9e46('0x13')](_0x9e46('0xa'),auth['isAuthenticated'](),controller[_0x9e46('0x14')]);router[_0x9e46('0x15')](_0x9e46('0xa'),auth[_0x9e46('0xb')](),controller[_0x9e46('0x16')]);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 211c877..c2a14a1 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 _0x9a1e=['always','never','onlyIfOpen','#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','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\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)'];(function(_0x1eb16f,_0x5872db){var _0x64b7=function(_0x4282fd){while(--_0x4282fd){_0x1eb16f['push'](_0x1eb16f['shift']());}};_0x64b7(++_0x5872db);}(_0x9a1e,0xe0));var _0xe9a1=function(_0x299756,_0x4e14c9){_0x299756=_0x299756-0x0;var _0x2818ca=_0x9a1e[_0x299756];return _0x2818ca;};'use strict';var Sequelize=require(_0xe9a1('0x0'));module[_0xe9a1('0x1')]={'name':{'type':Sequelize[_0xe9a1('0x2')],'unique':_0xe9a1('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xe9a1('0x4')]('ivr'),'allowNull':![],'defaultValue':_0xe9a1('0x5')},'description':{'type':Sequelize[_0xe9a1('0x2')]},'active':{'type':Sequelize[_0xe9a1('0x6')],'defaultValue':0x0,'comment':_0xe9a1('0x7')},'limitCalls':{'type':Sequelize[_0xe9a1('0x8')](0x4)[_0xe9a1('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xe9a1('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe9a1('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe9a1('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe9a1('0x8')](0x3)[_0xe9a1('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe9a1('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe9a1('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xe9a1('0x8')](0x3)[_0xe9a1('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe9a1('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe9a1('0x8')](0x5)[_0xe9a1('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe9a1('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe9a1('0x8')](0x3)[_0xe9a1('0x9')],'defaultValue':0x3,'comment':_0xe9a1('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe9a1('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xe9a1('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe9a1('0xf')},'dialTimezone':{'type':Sequelize[_0xe9a1('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe9a1('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xe9a1('0x4')](_0xe9a1('0x10'),_0xe9a1('0x11'),_0xe9a1('0x12')),'defaultValue':_0xe9a1('0x10')},'dialAMDActive':{'type':Sequelize[_0xe9a1('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xe9a1('0x8')](0x9)[_0xe9a1('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe9a1('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xe9a1('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe9a1('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe9a1('0x8')](0x9)[_0xe9a1('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe9a1('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe9a1('0x8')](0x9)[_0xe9a1('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe9a1('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'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['INTEGER'](0x9)[_0xe9a1('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe9a1('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xe9a1('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe9a1('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe9a1('0x8')](0x9)[_0xe9a1('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe9a1('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xe9a1('0x1a'),_0xe9a1('0x1b')),'defaultValue':_0xe9a1('0x1a')},'dialPrefix':{'type':Sequelize[_0xe9a1('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe9a1('0x8')](0x3)[_0xe9a1('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe9a1('0x1c')},'dialCutDigit':{'type':Sequelize[_0xe9a1('0x8')](0x3)[_0xe9a1('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe9a1('0x1d')}}; \ No newline at end of file +var _0xee5a=['STRING','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize'];(function(_0x1c08f6,_0x14c077){var _0xbc156a=function(_0x59df22){while(--_0x59df22){_0x1c08f6['push'](_0x1c08f6['shift']());}};_0xbc156a(++_0x14c077);}(_0xee5a,0xcf));var _0xaee5=function(_0x193c0b,_0x504486){_0x193c0b=_0x193c0b-0x0;var _0x30939a=_0xee5a[_0x193c0b];return _0x30939a;};'use strict';var Sequelize=require(_0xaee5('0x0'));module['exports']={'name':{'type':Sequelize[_0xaee5('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xaee5('0x2')](_0xaee5('0x3')),'allowNull':![],'defaultValue':_0xaee5('0x3')},'description':{'type':Sequelize[_0xaee5('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xaee5('0x4')},'limitCalls':{'type':Sequelize[_0xaee5('0x5')](0x4)[_0xaee5('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xaee5('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xaee5('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xaee5('0x5')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xaee5('0x5')](0x3)[_0xaee5('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaee5('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xaee5('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xaee5('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaee5('0x9')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xaee5('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaee5('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xaee5('0x6')],'defaultValue':0x3,'comment':_0xaee5('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xaee5('0x5')](0x5)[_0xaee5('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaee5('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xaee5('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xaee5('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xaee5('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xaee5('0x2')](_0xaee5('0xe'),_0xaee5('0xf'),'onlyIfOpen'),'defaultValue':_0xaee5('0xe')},'dialAMDActive':{'type':Sequelize[_0xaee5('0x10')],'defaultValue':0x0,'comment':_0xaee5('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xaee5('0x5')](0x9)[_0xaee5('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xaee5('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xaee5('0x5')](0x9)[_0xaee5('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xaee5('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xaee5('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xaee5('0x5')](0x9)[_0xaee5('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xaee5('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xaee5('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xaee5('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xaee5('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xaee5('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xaee5('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xaee5('0x16')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xaee5('0x17'),_0xaee5('0x18')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xaee5('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xaee5('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xaee5('0x5')](0x3)[_0xaee5('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xaee5('0x19')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index b40a6b8..e8e730b 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 _0x0366=['cm_hopper','onlyIfOpen','all','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','index','Campaign','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','getHoppers','findOne','CmHopper','nolimit','CampaignId','filter','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','ContactId','ListId','select','phone','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','CampaignId\x20=\x20?'];(function(_0x486d65,_0x3b7523){var _0x49bd9f=function(_0x37e501){while(--_0x37e501){_0x486d65['push'](_0x486d65['shift']());}};_0x49bd9f(++_0x3b7523);}(_0x0366,0x8b));var _0x6036=function(_0x36f435,_0x331505){_0x36f435=_0x36f435-0x0;var _0xe3eacb=_0x0366[_0x36f435];return _0xe3eacb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6036('0x0'));var rimraf=require(_0x6036('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6036('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6036('0x3'));var Mustache=require('mustache');var util=require(_0x6036('0x4'));var path=require(_0x6036('0x5'));var sox=require('sox');var csv=require(_0x6036('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6036('0x7'));var squel=require('squel');var crypto=require(_0x6036('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x6036('0x9'));var toCsv=require(_0x6036('0x6'));var querystring=require(_0x6036('0xa'));var Papa=require(_0x6036('0xb'));var authService=require(_0x6036('0xc'));var hardwareService=require(_0x6036('0xd'));var Redis=require(_0x6036('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x6036('0xf'))(_0x6036('0x10'));var utils=require(_0x6036('0x11'));var config=require('../../config/environment');var db=require(_0x6036('0x12'))['db'];function respondWithStatusCode(_0x507a53,_0x7bb718){_0x7bb718=_0x7bb718||0xcc;return function(_0x39a839){if(_0x39a839){return _0x507a53['sendStatus'](_0x7bb718);}return _0x507a53[_0x6036('0x13')](_0x7bb718)['end']();};}function respondWithResult(_0x38aa52,_0x895c68){_0x895c68=_0x895c68||0xc8;return function(_0x3ad3e6){if(_0x3ad3e6){return _0x38aa52[_0x6036('0x13')](_0x895c68)[_0x6036('0x14')](_0x3ad3e6);}};}function respondWithFilteredResult(_0x7272f1,_0x47d661){return function(_0x2eaa46){if(_0x2eaa46){var _0x3d499=_0x2eaa46[_0x6036('0x15')],_0x25dd85=_0x47d661['offset'],_0x44d55c=_0x47d661[_0x6036('0x16')]+_0x47d661['limit'],_0x21bc9a;if(_0x44d55c>=_0x3d499){_0x44d55c=_0x3d499;_0x21bc9a=0xc8;}else{_0x21bc9a=0xce;}_0x7272f1[_0x6036('0x13')](_0x21bc9a);return _0x7272f1[_0x6036('0x17')](_0x6036('0x18'),_0x25dd85+'-'+_0x44d55c+'/'+_0x3d499)[_0x6036('0x14')](_0x2eaa46);}return null;};}function patchUpdates(_0x3ee0eb){return function(_0xb750ae){try{jsonpatch[_0x6036('0x19')](_0xb750ae,_0x3ee0eb,!![]);}catch(_0x3decb5){return BPromise[_0x6036('0x1a')](_0x3decb5);}return _0xb750ae[_0x6036('0x1b')]();};}function saveUpdates(_0x52c970,_0x155f94){return function(_0x3b478e){if(_0x3b478e){return _0x3b478e[_0x6036('0x1c')](_0x52c970)[_0x6036('0x1d')](function(_0x12343f){return _0x12343f;});}return null;};}function removeEntity(_0x4894e3,_0x5b03e7){return function(_0x161c03){if(_0x161c03){return _0x161c03[_0x6036('0x1e')]()[_0x6036('0x1d')](function(){var _0x4d6628=_0x161c03[_0x6036('0x1f')]({'plain':!![]});var _0x5141a4='IvrCampaigns';return db[_0x6036('0x20')][_0x6036('0x1e')]({'where':{'type':_0x5141a4,'resourceId':_0x4d6628['id']}})[_0x6036('0x1d')](function(){return _0x161c03;});})['then'](function(){_0x4894e3[_0x6036('0x13')](0xcc)[_0x6036('0x21')]();});}};}function handleEntityNotFound(_0x2e1e8e,_0x18e3a9){return function(_0xc7e79e){if(!_0xc7e79e){_0x2e1e8e[_0x6036('0x22')](0x194);}return _0xc7e79e;};}function handleError(_0x236167,_0x193da3){_0x193da3=_0x193da3||0x1f4;return function(_0x281028){logger[_0x6036('0x23')](_0x281028[_0x6036('0x24')]);if(_0x281028[_0x6036('0x25')]){delete _0x281028[_0x6036('0x25')];}_0x236167[_0x6036('0x13')](_0x193da3)['send'](_0x281028);};}exports[_0x6036('0x26')]=function(_0x59037e,_0x6ae71a){var _0xc9441a={},_0x4e9d0d={},_0x54cff0={'count':0x0,'rows':[]};var _0x4ff2cd=db[_0x6036('0x27')]['rawAttributes'];_0x4e9d0d[_0x6036('0x28')]=_['keys'](_0x4ff2cd);_0x4e9d0d['query']=_['keys'](_0x59037e[_0x6036('0x29')]);_0x4e9d0d[_0x6036('0x2a')]=_[_0x6036('0x2b')](_0x4e9d0d['model'],_0x4e9d0d[_0x6036('0x29')]);_0xc9441a[_0x6036('0x2c')]=_[_0x6036('0x2b')](_0x4e9d0d[_0x6036('0x28')],qs['fields'](_0x59037e['query'][_0x6036('0x2d')]));_0xc9441a[_0x6036('0x2c')]=_0xc9441a[_0x6036('0x2c')][_0x6036('0x2e')]?_0xc9441a[_0x6036('0x2c')]:_0x4e9d0d[_0x6036('0x28')];if(!_0x59037e[_0x6036('0x29')][_0x6036('0x2f')]('nolimit')){_0xc9441a[_0x6036('0x30')]=qs[_0x6036('0x30')](_0x59037e[_0x6036('0x29')]['limit']);_0xc9441a[_0x6036('0x16')]=qs[_0x6036('0x16')](_0x59037e[_0x6036('0x29')][_0x6036('0x16')]);}_0xc9441a[_0x6036('0x31')]=qs[_0x6036('0x32')](_0x59037e[_0x6036('0x29')][_0x6036('0x32')]);_0xc9441a[_0x6036('0x33')]=qs[_0x6036('0x2a')](_[_0x6036('0x34')](_0x59037e[_0x6036('0x29')],_0x4e9d0d[_0x6036('0x2a')]));if(_0x59037e['query']['filter']){_0xc9441a['where']=_['merge'](_0xc9441a[_0x6036('0x33')],{'$or':_[_0x6036('0x35')](_0x4ff2cd,function(_0x1dee8c){if(_0x1dee8c[_0x6036('0x36')][_0x6036('0x37')]!==_0x6036('0x38')){var _0x4e0d5a={};_0x4e0d5a[_0x1dee8c[_0x6036('0x39')]]={'$like':'%'+_0x59037e[_0x6036('0x29')]['filter']+'%'};return _0x4e0d5a;}})});}_0xc9441a=_[_0x6036('0x3a')]({},_0xc9441a,_0x59037e[_0x6036('0x3b')]);var _0x24046b={'where':_0xc9441a[_0x6036('0x33')]};return db[_0x6036('0x27')]['count'](_0x24046b)[_0x6036('0x1d')](function(_0x138087){_0x54cff0['count']=_0x138087;if(_0x59037e[_0x6036('0x29')][_0x6036('0x3c')]){_0xc9441a[_0x6036('0x3d')]=[{'all':!![]}];}return db['Campaign'][_0x6036('0x3e')](_0xc9441a);})[_0x6036('0x1d')](function(_0x4ae34c){_0x54cff0[_0x6036('0x3f')]=_0x4ae34c;return _0x54cff0;})[_0x6036('0x1d')](respondWithFilteredResult(_0x6ae71a,_0xc9441a))[_0x6036('0x40')](handleError(_0x6ae71a,null));};exports[_0x6036('0x41')]=function(_0x523720,_0x4c45b7){var _0x52543c={'raw':![],'where':{'id':_0x523720[_0x6036('0x42')]['id']}},_0xb74ff8={};_0xb74ff8[_0x6036('0x28')]=_['keys'](db[_0x6036('0x27')][_0x6036('0x43')]);_0xb74ff8['query']=_[_0x6036('0x44')](_0x523720['query']);_0xb74ff8['filters']=_[_0x6036('0x2b')](_0xb74ff8[_0x6036('0x28')],_0xb74ff8[_0x6036('0x29')]);_0x52543c[_0x6036('0x2c')]=_[_0x6036('0x2b')](_0xb74ff8[_0x6036('0x28')],qs['fields'](_0x523720[_0x6036('0x29')][_0x6036('0x2d')]));_0x52543c[_0x6036('0x2c')]=_0x52543c[_0x6036('0x2c')]['length']?_0x52543c[_0x6036('0x2c')]:_0xb74ff8[_0x6036('0x28')];if(_0x523720[_0x6036('0x29')][_0x6036('0x3c')]){_0x52543c[_0x6036('0x3d')]=[{'all':!![]}];}_0x52543c=_[_0x6036('0x3a')]({},_0x52543c,_0x523720[_0x6036('0x3b')]);return db[_0x6036('0x27')][_0x6036('0x45')](_0x52543c)[_0x6036('0x1d')](handleEntityNotFound(_0x4c45b7,null))[_0x6036('0x1d')](respondWithResult(_0x4c45b7,null))[_0x6036('0x40')](handleError(_0x4c45b7,null));};exports['create']=function(_0x329080,_0x12c4fd){return db[_0x6036('0x27')][_0x6036('0x46')](_0x329080[_0x6036('0x47')],{})['then'](function(_0x3ee12e){var _0x5c0f7d=_0x329080['user'][_0x6036('0x1f')]({'plain':!![]});if(!_0x5c0f7d)throw new Error(_0x6036('0x48'));if(_0x5c0f7d[_0x6036('0x49')]===_0x6036('0x4a')){var _0x55940a=_0x3ee12e['get']({'plain':!![]});var _0x9e3af6=_0x6036('0x4b');return db[_0x6036('0x4c')]['find']({'where':{'name':_0x9e3af6,'userProfileId':_0x5c0f7d[_0x6036('0x4d')]},'raw':!![]})[_0x6036('0x1d')](function(_0x285c9b){if(_0x285c9b&&_0x285c9b[_0x6036('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x55940a['name'],'resourceId':_0x55940a['id'],'type':_0x285c9b[_0x6036('0x25')],'sectionId':_0x285c9b['id']},{})[_0x6036('0x1d')](function(){return _0x3ee12e;});}else{return _0x3ee12e;}})[_0x6036('0x40')](function(_0x31b68a){logger['error'](_0x6036('0x4f'),_0x31b68a);throw _0x31b68a;});}return _0x3ee12e;})[_0x6036('0x1d')](respondWithResult(_0x12c4fd,0xc9))[_0x6036('0x40')](handleError(_0x12c4fd,null));};exports[_0x6036('0x50')]=function(_0x1ddee9,_0x4fcef7){var _0x1d5981={'raw':![],'where':{'id':_0x1ddee9['params']['id']}},_0x1447df={};_0x1447df['model']=_['keys'](db[_0x6036('0x27')][_0x6036('0x43')]);_0x1d5981[_0x6036('0x2c')]=_[_0x6036('0x2b')](_0x1447df[_0x6036('0x28')],qs['fields'](_0x1ddee9[_0x6036('0x29')][_0x6036('0x2d')]));_0x1d5981[_0x6036('0x2c')]=_0x1d5981[_0x6036('0x2c')]['length']?_0x1d5981[_0x6036('0x2c')]:_0x1447df['model'];if(_0x1ddee9['query']['includeAll']){_0x1d5981[_0x6036('0x3d')]=[{'all':!![]}];}_0x1d5981=_['merge']({},_0x1d5981,_0x1ddee9['options']);return db['Campaign']['find'](_0x1d5981)[_0x6036('0x1d')](handleEntityNotFound(_0x4fcef7,null))[_0x6036('0x1d')](function(_0x22c6e7){if(_0x22c6e7){var _0x414344=_0x22c6e7['get']({'plain':!![]});_0x414344=qs[_0x6036('0x51')](_0x414344,['id','createdAt',_0x6036('0x52')]);_0x1ddee9[_0x6036('0x47')]=_[_0x6036('0x51')](_0x1ddee9[_0x6036('0x47')],['id',_0x6036('0x53'),_0x6036('0x52')]);return db[_0x6036('0x27')][_0x6036('0x46')](_['merge'](_0x414344,_0x1ddee9[_0x6036('0x47')]),{'include':_0x1ddee9['query']['includeAll']?[{'all':!![]}]:undefined})[_0x6036('0x1d')](function(_0x2df761){var _0x47b383=_0x1ddee9[_0x6036('0x4a')][_0x6036('0x1f')]({'plain':!![]});if(!_0x47b383)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47b383[_0x6036('0x49')]===_0x6036('0x4a')){var _0x4d5ff7=_0x2df761[_0x6036('0x1f')]({'plain':!![]});var _0x3b5ac9=_0x6036('0x4b');return db[_0x6036('0x4c')]['find']({'where':{'name':_0x3b5ac9,'userProfileId':_0x47b383[_0x6036('0x4d')]},'raw':!![]})[_0x6036('0x1d')](function(_0x2044ef){if(_0x2044ef&&_0x2044ef[_0x6036('0x4e')]===0x0){return db['UserProfileResource'][_0x6036('0x46')]({'name':_0x4d5ff7[_0x6036('0x25')],'resourceId':_0x4d5ff7['id'],'type':_0x2044ef[_0x6036('0x25')],'sectionId':_0x2044ef['id']},{})['then'](function(){return _0x2df761;});}else{return _0x2df761;}})[_0x6036('0x40')](function(_0x48548a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48548a);throw _0x48548a;});}return _0x2df761;});}})[_0x6036('0x1d')](respondWithResult(_0x4fcef7,0xc9))['catch'](handleError(_0x4fcef7,null));};exports['update']=function(_0x2f7d34,_0x449f45){if(_0x2f7d34[_0x6036('0x47')]['id']){delete _0x2f7d34[_0x6036('0x47')]['id'];}return db[_0x6036('0x27')][_0x6036('0x45')]({'where':{'id':_0x2f7d34[_0x6036('0x42')]['id']}})[_0x6036('0x1d')](handleEntityNotFound(_0x449f45,null))['then'](saveUpdates(_0x2f7d34[_0x6036('0x47')],null))[_0x6036('0x1d')](respondWithResult(_0x449f45,null))[_0x6036('0x40')](handleError(_0x449f45,null));};exports[_0x6036('0x1e')]=function(_0x161229,_0x358124){return db[_0x6036('0x27')]['find']({'where':{'id':_0x161229[_0x6036('0x42')]['id']}})[_0x6036('0x1d')](handleEntityNotFound(_0x358124,null))[_0x6036('0x1d')](removeEntity(_0x358124,null))['catch'](handleError(_0x358124,null));};exports[_0x6036('0x54')]=function(_0xd33830,_0x506731,_0x1b4172){var _0xa0d059={'raw':!![],'where':{}};var _0x7afdb8={};var _0x5d52b8={'count':0x0,'rows':[]};return db[_0x6036('0x27')][_0x6036('0x55')]({'where':{'id':_0xd33830['params']['id']}})[_0x6036('0x1d')](handleEntityNotFound(_0x506731,null))['then'](function(_0x5c22ec){if(_0x5c22ec){_0x7afdb8[_0x6036('0x28')]=_['keys'](db[_0x6036('0x56')][_0x6036('0x43')]);_0x7afdb8[_0x6036('0x29')]=_[_0x6036('0x44')](_0xd33830[_0x6036('0x29')]);_0x7afdb8['filters']=_[_0x6036('0x2b')](_0x7afdb8[_0x6036('0x28')],_0x7afdb8[_0x6036('0x29')]);_0xa0d059['attributes']=_['intersection'](_0x7afdb8['model'],qs['fields'](_0xd33830[_0x6036('0x29')]['fields']));_0xa0d059[_0x6036('0x2c')]=_0xa0d059[_0x6036('0x2c')]['length']?_0xa0d059[_0x6036('0x2c')]:_0x7afdb8[_0x6036('0x28')];if(!_0xd33830['query'][_0x6036('0x2f')](_0x6036('0x57'))){_0xa0d059[_0x6036('0x30')]=qs[_0x6036('0x30')](_0xd33830[_0x6036('0x29')]['limit']);_0xa0d059[_0x6036('0x16')]=qs['offset'](_0xd33830[_0x6036('0x29')][_0x6036('0x16')]);}_0xa0d059[_0x6036('0x31')]=qs['sort'](_0xd33830[_0x6036('0x29')]['sort']);_0xa0d059[_0x6036('0x33')]=qs[_0x6036('0x2a')](_[_0x6036('0x34')](_0xd33830[_0x6036('0x29')],_0x7afdb8['filters']));_0xa0d059[_0x6036('0x33')][_0x6036('0x58')]=_0x5c22ec['id'];if(_0xd33830[_0x6036('0x29')][_0x6036('0x59')]){_0xa0d059['where']=_[_0x6036('0x3a')](_0xa0d059[_0x6036('0x33')],{'$or':_[_0x6036('0x35')](_0xa0d059[_0x6036('0x2c')],function(_0x5c6536){var _0x3f30c5={};_0x3f30c5[_0x5c6536]={'$like':'%'+_0xd33830[_0x6036('0x29')][_0x6036('0x59')]+'%'};return _0x3f30c5;})});}_0xa0d059=_[_0x6036('0x3a')]({},_0xa0d059,_0xd33830[_0x6036('0x3b')]);return db[_0x6036('0x56')]['count']({'where':_0xa0d059[_0x6036('0x33')]})[_0x6036('0x1d')](function(_0x420657){_0x5d52b8[_0x6036('0x15')]=_0x420657;if(_0xd33830[_0x6036('0x29')]['includeAll']){_0xa0d059[_0x6036('0x3d')]=[{'all':!![]}];}return db[_0x6036('0x56')][_0x6036('0x3e')](_0xa0d059);})[_0x6036('0x1d')](function(_0x34f283){_0x5d52b8[_0x6036('0x3f')]=_0x34f283;return _0x5d52b8;});}})[_0x6036('0x1d')](respondWithFilteredResult(_0x506731,_0xa0d059))[_0x6036('0x40')](handleError(_0x506731,null));};exports[_0x6036('0x5a')]=function(_0x2b8cf2,_0x59cb0e,_0x43f170){var _0x2c87ab={'raw':!![],'where':{}};var _0x3bafab={};var _0x5db5b5={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x2b8cf2[_0x6036('0x42')]['id']}})['then'](handleEntityNotFound(_0x59cb0e,null))[_0x6036('0x1d')](function(_0x44b2bb){if(_0x44b2bb){_0x3bafab['model']=_[_0x6036('0x44')](db[_0x6036('0x5b')]['rawAttributes']);_0x3bafab[_0x6036('0x29')]=_[_0x6036('0x44')](_0x2b8cf2[_0x6036('0x29')]);_0x3bafab[_0x6036('0x2a')]=_[_0x6036('0x2b')](_0x3bafab[_0x6036('0x28')],_0x3bafab[_0x6036('0x29')]);_0x2c87ab[_0x6036('0x2c')]=_[_0x6036('0x2b')](_0x3bafab[_0x6036('0x28')],qs[_0x6036('0x2d')](_0x2b8cf2['query'][_0x6036('0x2d')]));_0x2c87ab[_0x6036('0x2c')]=_0x2c87ab[_0x6036('0x2c')][_0x6036('0x2e')]?_0x2c87ab[_0x6036('0x2c')]:_0x3bafab[_0x6036('0x28')];if(!_0x2b8cf2[_0x6036('0x29')][_0x6036('0x2f')](_0x6036('0x57'))){_0x2c87ab[_0x6036('0x30')]=qs[_0x6036('0x30')](_0x2b8cf2[_0x6036('0x29')][_0x6036('0x30')]);_0x2c87ab[_0x6036('0x16')]=qs[_0x6036('0x16')](_0x2b8cf2[_0x6036('0x29')][_0x6036('0x16')]);}_0x2c87ab['order']=qs[_0x6036('0x32')](_0x2b8cf2[_0x6036('0x29')]['sort']);_0x2c87ab[_0x6036('0x33')]=qs[_0x6036('0x2a')](_[_0x6036('0x34')](_0x2b8cf2[_0x6036('0x29')],_0x3bafab[_0x6036('0x2a')]));_0x2c87ab[_0x6036('0x33')][_0x6036('0x58')]=_0x44b2bb['id'];if(_0x2b8cf2['query'][_0x6036('0x59')]){_0x2c87ab[_0x6036('0x33')]=_[_0x6036('0x3a')](_0x2c87ab[_0x6036('0x33')],{'$or':_['map'](_0x2c87ab['attributes'],function(_0x429402){var _0x6f165={};_0x6f165[_0x429402]={'$like':'%'+_0x2b8cf2[_0x6036('0x29')][_0x6036('0x59')]+'%'};return _0x6f165;})});}_0x2c87ab=_[_0x6036('0x3a')]({},_0x2c87ab,_0x2b8cf2[_0x6036('0x3b')]);return db[_0x6036('0x5b')][_0x6036('0x15')]({'where':_0x2c87ab[_0x6036('0x33')]})['then'](function(_0x592fc8){_0x5db5b5[_0x6036('0x15')]=_0x592fc8;if(_0x2b8cf2[_0x6036('0x29')][_0x6036('0x3c')]){_0x2c87ab[_0x6036('0x3d')]=[{'all':!![]}];}return db[_0x6036('0x5b')][_0x6036('0x3e')](_0x2c87ab);})[_0x6036('0x1d')](function(_0x36d09c){_0x5db5b5['rows']=_0x36d09c;return _0x5db5b5;});}})[_0x6036('0x1d')](respondWithFilteredResult(_0x59cb0e,_0x2c87ab))[_0x6036('0x40')](handleError(_0x59cb0e,null));};exports[_0x6036('0x5c')]=function(_0x565a11,_0x47f2ca,_0x49d5ed){var _0x1af9d1={'raw':!![],'where':{}};var _0x5c430b={};var _0x346d79={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x565a11[_0x6036('0x42')]['id']}})[_0x6036('0x1d')](handleEntityNotFound(_0x47f2ca,null))['then'](function(_0x497bd3){if(_0x497bd3){_0x5c430b[_0x6036('0x28')]=_['keys'](db[_0x6036('0x5d')]['rawAttributes']);_0x5c430b[_0x6036('0x29')]=_[_0x6036('0x44')](_0x565a11['query']);_0x5c430b[_0x6036('0x2a')]=_[_0x6036('0x2b')](_0x5c430b['model'],_0x5c430b[_0x6036('0x29')]);_0x1af9d1[_0x6036('0x2c')]=_[_0x6036('0x2b')](_0x5c430b[_0x6036('0x28')],qs[_0x6036('0x2d')](_0x565a11[_0x6036('0x29')][_0x6036('0x2d')]));_0x1af9d1[_0x6036('0x2c')]=_0x1af9d1[_0x6036('0x2c')][_0x6036('0x2e')]?_0x1af9d1[_0x6036('0x2c')]:_0x5c430b['model'];if(!_0x565a11[_0x6036('0x29')][_0x6036('0x2f')](_0x6036('0x57'))){_0x1af9d1[_0x6036('0x30')]=qs[_0x6036('0x30')](_0x565a11[_0x6036('0x29')][_0x6036('0x30')]);_0x1af9d1[_0x6036('0x16')]=qs['offset'](_0x565a11[_0x6036('0x29')][_0x6036('0x16')]);}_0x1af9d1[_0x6036('0x31')]=qs[_0x6036('0x32')](_0x565a11[_0x6036('0x29')][_0x6036('0x32')]);_0x1af9d1['where']=qs[_0x6036('0x2a')](_['pick'](_0x565a11['query'],_0x5c430b['filters']));_0x1af9d1[_0x6036('0x33')][_0x6036('0x58')]=_0x497bd3['id'];if(_0x565a11['query']['filter']){_0x1af9d1['where']=_[_0x6036('0x3a')](_0x1af9d1[_0x6036('0x33')],{'$or':_[_0x6036('0x35')](_0x1af9d1[_0x6036('0x2c')],function(_0x4350ed){var _0xa1f8a1={};_0xa1f8a1[_0x4350ed]={'$like':'%'+_0x565a11[_0x6036('0x29')][_0x6036('0x59')]+'%'};return _0xa1f8a1;})});}_0x1af9d1=_[_0x6036('0x3a')]({},_0x1af9d1,_0x565a11[_0x6036('0x3b')]);return db['CmHopperFinal'][_0x6036('0x15')]({'where':_0x1af9d1[_0x6036('0x33')]})[_0x6036('0x1d')](function(_0x2ff296){_0x346d79[_0x6036('0x15')]=_0x2ff296;if(_0x565a11[_0x6036('0x29')]['includeAll']){_0x1af9d1['include']=[{'all':!![]}];}return db[_0x6036('0x5d')]['findAll'](_0x1af9d1);})[_0x6036('0x1d')](function(_0x256b5c){_0x346d79[_0x6036('0x3f')]=_0x256b5c;return _0x346d79;});}})[_0x6036('0x1d')](respondWithFilteredResult(_0x47f2ca,_0x1af9d1))[_0x6036('0x40')](handleError(_0x47f2ca,null));};exports[_0x6036('0x5e')]=function(_0x56f178,_0x2583ef,_0x5d4ce2){var _0x2a73c5={'raw':!![],'where':{}};var _0x5548ea={};var _0x39591e={'count':0x0,'rows':[]};return db['Campaign'][_0x6036('0x55')]({'where':{'id':_0x56f178[_0x6036('0x42')]['id']}})[_0x6036('0x1d')](handleEntityNotFound(_0x2583ef,null))[_0x6036('0x1d')](function(_0x1ccbdc){if(_0x1ccbdc){_0x5548ea['model']=_[_0x6036('0x44')](db[_0x6036('0x5f')]['rawAttributes']);_0x5548ea[_0x6036('0x29')]=_[_0x6036('0x44')](_0x56f178[_0x6036('0x29')]);_0x5548ea['filters']=_[_0x6036('0x2b')](_0x5548ea[_0x6036('0x28')],_0x5548ea[_0x6036('0x29')]);_0x2a73c5[_0x6036('0x2c')]=_[_0x6036('0x2b')](_0x5548ea['model'],qs[_0x6036('0x2d')](_0x56f178['query']['fields']));_0x2a73c5[_0x6036('0x2c')]=_0x2a73c5[_0x6036('0x2c')]['length']?_0x2a73c5[_0x6036('0x2c')]:_0x5548ea['model'];if(!_0x56f178[_0x6036('0x29')][_0x6036('0x2f')](_0x6036('0x57'))){_0x2a73c5[_0x6036('0x30')]=qs[_0x6036('0x30')](_0x56f178['query']['limit']);_0x2a73c5[_0x6036('0x16')]=qs['offset'](_0x56f178[_0x6036('0x29')][_0x6036('0x16')]);}_0x2a73c5['order']=qs[_0x6036('0x32')](_0x56f178[_0x6036('0x29')][_0x6036('0x32')]);_0x2a73c5['where']=qs[_0x6036('0x2a')](_[_0x6036('0x34')](_0x56f178[_0x6036('0x29')],_0x5548ea[_0x6036('0x2a')]));_0x2a73c5[_0x6036('0x33')]['CampaignId']=_0x1ccbdc['id'];if(_0x56f178[_0x6036('0x29')]['filter']){_0x2a73c5[_0x6036('0x33')]=_[_0x6036('0x3a')](_0x2a73c5[_0x6036('0x33')],{'$or':_['map'](_0x2a73c5['attributes'],function(_0x58e4e3){var _0xcf178e={};_0xcf178e[_0x58e4e3]={'$like':'%'+_0x56f178[_0x6036('0x29')][_0x6036('0x59')]+'%'};return _0xcf178e;})});}_0x2a73c5=_[_0x6036('0x3a')]({},_0x2a73c5,_0x56f178[_0x6036('0x3b')]);return db[_0x6036('0x5f')][_0x6036('0x15')]({'where':_0x2a73c5[_0x6036('0x33')]})[_0x6036('0x1d')](function(_0x2eaac1){_0x39591e[_0x6036('0x15')]=_0x2eaac1;if(_0x56f178[_0x6036('0x29')][_0x6036('0x3c')]){_0x2a73c5[_0x6036('0x3d')]=[{'all':!![]}];}return db[_0x6036('0x5f')]['findAll'](_0x2a73c5);})[_0x6036('0x1d')](function(_0x5f0cd8){_0x39591e['rows']=_0x5f0cd8;return _0x39591e;});}})['then'](respondWithFilteredResult(_0x2583ef,_0x2a73c5))[_0x6036('0x40')](handleError(_0x2583ef,null));};exports[_0x6036('0x60')]=function(_0x46b981,_0x4e3ba3,_0x179c36){var _0x538349={};var _0x3f0809={};var _0x1c8690;var _0x34d837;return db[_0x6036('0x27')][_0x6036('0x55')]({'where':{'id':_0x46b981['params']['id']}})[_0x6036('0x1d')](handleEntityNotFound(_0x4e3ba3,null))['then'](function(_0x5255d0){if(_0x5255d0){_0x1c8690=_0x5255d0;_0x3f0809[_0x6036('0x28')]=_[_0x6036('0x44')](db[_0x6036('0x61')]['rawAttributes']);_0x3f0809[_0x6036('0x29')]=_[_0x6036('0x44')](_0x46b981[_0x6036('0x29')]);_0x3f0809[_0x6036('0x2a')]=_['intersection'](_0x3f0809[_0x6036('0x28')],_0x3f0809[_0x6036('0x29')]);_0x538349['attributes']=_[_0x6036('0x2b')](_0x3f0809[_0x6036('0x28')],qs[_0x6036('0x2d')](_0x46b981['query'][_0x6036('0x2d')]));_0x538349[_0x6036('0x2c')]=_0x538349[_0x6036('0x2c')][_0x6036('0x2e')]?_0x538349[_0x6036('0x2c')]:_0x3f0809['model'];_0x538349['order']=qs['sort'](_0x46b981['query'][_0x6036('0x32')]);_0x538349[_0x6036('0x33')]=qs[_0x6036('0x2a')](_[_0x6036('0x34')](_0x46b981['query'],_0x3f0809[_0x6036('0x2a')]));if(_0x46b981[_0x6036('0x29')][_0x6036('0x59')]){_0x538349[_0x6036('0x33')]=_[_0x6036('0x3a')](_0x538349[_0x6036('0x33')],{'$or':_[_0x6036('0x35')](_0x538349[_0x6036('0x2c')],function(_0x294c1a){var _0x40f019={};_0x40f019[_0x294c1a]={'$like':'%'+_0x46b981[_0x6036('0x29')][_0x6036('0x59')]+'%'};return _0x40f019;})});}_0x538349=_[_0x6036('0x3a')]({},_0x538349,_0x46b981[_0x6036('0x3b')]);return _0x1c8690[_0x6036('0x60')](_0x538349);}})[_0x6036('0x1d')](function(_0x5d194c){if(_0x5d194c){_0x34d837=_0x5d194c[_0x6036('0x2e')];if(!_0x46b981[_0x6036('0x29')][_0x6036('0x2f')]('nolimit')){_0x538349[_0x6036('0x30')]=qs[_0x6036('0x30')](_0x46b981[_0x6036('0x29')]['limit']);_0x538349[_0x6036('0x16')]=qs[_0x6036('0x16')](_0x46b981[_0x6036('0x29')][_0x6036('0x16')]);}return _0x1c8690[_0x6036('0x60')](_0x538349);}})['then'](function(_0x22eb4c){if(_0x22eb4c){return _0x22eb4c?{'count':_0x34d837,'rows':_0x22eb4c}:null;}})[_0x6036('0x1d')](respondWithResult(_0x4e3ba3,null))[_0x6036('0x40')](handleError(_0x4e3ba3,null));};exports[_0x6036('0x62')]=function(_0x528f42,_0x1b4721,_0x403151){var _0x5565f1,_0x238ba3;return db[_0x6036('0x27')][_0x6036('0x45')]({'where':{'id':_0x528f42['params']['id']}})['then'](handleEntityNotFound(_0x1b4721,null))['then'](function(_0x445a0a){if(_0x445a0a){_0x238ba3=_0x445a0a;return _0x445a0a[_0x6036('0x62')](_0x528f42['body'][_0x6036('0x63')],_[_0x6036('0x51')](_0x528f42[_0x6036('0x47')],[_0x6036('0x63'),'id'])||{});}return null;})[_0x6036('0x64')](function(_0x540e47){var _0x3a294b;_0x5565f1=_0x540e47||[];var _0x345acd=[];if(_0x540e47){for(var _0x44efce=0x0;_0x44efce<_0x540e47[_0x6036('0x2e')];_0x44efce+=0x1){var _0x651edc=_0x540e47[_0x44efce][_0x6036('0x1f')]({'plain':!![]});_0x238ba3[_0x6036('0x65')]=_0x528f42[_0x6036('0x47')][_0x6036('0x65')]?_0x528f42[_0x6036('0x47')][_0x6036('0x65')]:_0x238ba3[_0x6036('0x65')];switch(_0x238ba3[_0x6036('0x65')]){case _0x6036('0x66'):_0x3a294b=squel[_0x6036('0x67')]()[_0x6036('0x68')]('cm_hopper')[_0x6036('0x69')](['phone','scheduledAt',_0x6036('0x6a'),_0x6036('0x6b'),'CampaignId','createdAt',_0x6036('0x52')],squel[_0x6036('0x6c')]()[_0x6036('0x39')](_0x6036('0x6d'),_0x6036('0x6d'))[_0x6036('0x39')](_0x6036('0x6e'),_0x6036('0x6f'))['field']('id',_0x6036('0x6a'))[_0x6036('0x39')](_0x651edc[_0x6036('0x70')][_0x6036('0x71')](),_0x6036('0x6b'))[_0x6036('0x39')](_0x528f42['params']['id']['toString'](),'CampaignId')['field']('NOW()',_0x6036('0x53'))[_0x6036('0x39')]('NOW()','updatedAt')[_0x6036('0x72')](_0x6036('0x73'))[_0x6036('0x33')](_0x6036('0x74'))[_0x6036('0x33')](_0x6036('0x75'),_0x651edc[_0x6036('0x70')][_0x6036('0x71')]())['where'](_0x6036('0x76'))[_0x6036('0x33')](_0x6036('0x77'),squel[_0x6036('0x6c')]()[_0x6036('0x39')](_0x6036('0x78'))[_0x6036('0x72')](_0x6036('0x79'))[_0x6036('0x33')](_0x6036('0x7a'),_0x528f42[_0x6036('0x42')]['id'][_0x6036('0x71')]()))[_0x6036('0x33')](_0x6036('0x77'),squel[_0x6036('0x6c')]()[_0x6036('0x39')](_0x6036('0x6d'))[_0x6036('0x72')](_0x6036('0x7b'))[_0x6036('0x33')](_0x6036('0x7a'),_0x528f42[_0x6036('0x42')]['id'][_0x6036('0x71')]())))['toString']();break;case _0x6036('0x7c'):_0x3a294b=squel[_0x6036('0x67')]()[_0x6036('0x68')](_0x6036('0x7b'))[_0x6036('0x69')]([_0x6036('0x6d'),_0x6036('0x6f'),_0x6036('0x6a'),'ListId',_0x6036('0x58'),_0x6036('0x53'),_0x6036('0x52')],squel[_0x6036('0x6c')]()[_0x6036('0x39')](_0x6036('0x6d'),_0x6036('0x6d'))[_0x6036('0x39')](_0x6036('0x6e'),'scheduledAt')['field']('id',_0x6036('0x6a'))['field'](_0x651edc[_0x6036('0x70')]['toString'](),_0x6036('0x6b'))['field'](_0x528f42['params']['id'][_0x6036('0x71')](),_0x6036('0x58'))['field'](_0x6036('0x6e'),_0x6036('0x53'))['field']('NOW()',_0x6036('0x52'))['from']('cm_contacts')['where'](_0x6036('0x74'))[_0x6036('0x33')]('ListId\x20=\x20?',_0x651edc[_0x6036('0x70')][_0x6036('0x71')]())[_0x6036('0x33')]('phone\x20IS\x20NOT\x20NULL')[_0x6036('0x33')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6036('0x6c')]()['field']('phone')['from'](_0x6036('0x7b'))[_0x6036('0x33')](_0x6036('0x7a'),_0x528f42[_0x6036('0x42')]['id'][_0x6036('0x71')]())))[_0x6036('0x71')]();break;default:_0x3a294b=squel[_0x6036('0x67')]()['into'](_0x6036('0x7b'))[_0x6036('0x69')](['phone','scheduledAt',_0x6036('0x6a'),_0x6036('0x6b'),_0x6036('0x58'),'createdAt',_0x6036('0x52')],squel['select']()[_0x6036('0x39')](_0x6036('0x6d'),'phone')[_0x6036('0x39')](_0x6036('0x6e'),_0x6036('0x6f'))[_0x6036('0x39')]('id','ContactId')[_0x6036('0x39')](_0x651edc[_0x6036('0x70')][_0x6036('0x71')](),_0x6036('0x6b'))[_0x6036('0x39')](_0x528f42[_0x6036('0x42')]['id'][_0x6036('0x71')](),_0x6036('0x58'))[_0x6036('0x39')](_0x6036('0x6e'),_0x6036('0x53'))['field']('NOW()',_0x6036('0x52'))[_0x6036('0x72')](_0x6036('0x73'))[_0x6036('0x33')](_0x6036('0x74'))[_0x6036('0x33')](_0x6036('0x75'),_0x651edc[_0x6036('0x70')]['toString']())['where'](_0x6036('0x76')))[_0x6036('0x71')]();}_0x345acd['push'](db['sequelize'][_0x6036('0x29')](_0x3a294b));}return BPromise[_0x6036('0x7d')](_0x345acd);}})[_0x6036('0x1d')](function(){return _0x5565f1;})[_0x6036('0x1d')](respondWithResult(_0x1b4721,null))[_0x6036('0x40')](handleError(_0x1b4721,null));};exports['removeLists']=function(_0x138a79,_0x25008b,_0x5363b7){var _0x16a47f;return db['Campaign']['find']({'where':{'id':_0x138a79[_0x6036('0x42')]['id']}})[_0x6036('0x1d')](handleEntityNotFound(_0x25008b,null))[_0x6036('0x1d')](function(_0x5bb841){if(_0x5bb841){return _0x5bb841['removeLists'](_0x138a79[_0x6036('0x29')][_0x6036('0x63')]);}})[_0x6036('0x1d')](function(_0x4ec5b7){if(_0x4ec5b7){_0x16a47f=_0x4ec5b7;return db[_0x6036('0x56')]['destroy']({'where':{'ListId':_0x138a79[_0x6036('0x29')][_0x6036('0x63')],'CampaignId':_0x138a79[_0x6036('0x42')]['id']}})[_0x6036('0x1d')](function(){return _0x16a47f;});}})[_0x6036('0x1d')](respondWithStatusCode(_0x25008b,null))[_0x6036('0x40')](handleError(_0x25008b,null));};exports[_0x6036('0x7e')]=function(_0x411e47,_0x2044a4,_0x147a12){var _0xf93df4={'raw':!![],'where':{}};var _0x4fafef={};var _0x4c748c={'count':0x0,'rows':[]};return db[_0x6036('0x27')][_0x6036('0x55')]({'where':{'id':_0x411e47[_0x6036('0x42')]['id']}})[_0x6036('0x1d')](handleEntityNotFound(_0x2044a4,null))[_0x6036('0x1d')](function(_0x41fa81){if(_0x41fa81){_0x4fafef[_0x6036('0x28')]=_['keys'](db['CmList'][_0x6036('0x43')]);_0x4fafef[_0x6036('0x29')]=_[_0x6036('0x44')](_0x411e47[_0x6036('0x29')]);_0x4fafef[_0x6036('0x2a')]=_[_0x6036('0x2b')](_0x4fafef[_0x6036('0x28')],_0x4fafef[_0x6036('0x29')]);_0xf93df4[_0x6036('0x2c')]=_[_0x6036('0x2b')](_0x4fafef[_0x6036('0x28')],qs[_0x6036('0x2d')](_0x411e47['query']['fields']));_0xf93df4['attributes']=_0xf93df4[_0x6036('0x2c')][_0x6036('0x2e')]?_0xf93df4[_0x6036('0x2c')]:_0x4fafef[_0x6036('0x28')];if(!_0x411e47[_0x6036('0x29')][_0x6036('0x2f')](_0x6036('0x57'))){_0xf93df4[_0x6036('0x30')]=qs['limit'](_0x411e47['query'][_0x6036('0x30')]);_0xf93df4[_0x6036('0x16')]=qs[_0x6036('0x16')](_0x411e47[_0x6036('0x29')][_0x6036('0x16')]);}_0xf93df4[_0x6036('0x31')]=qs['sort'](_0x411e47[_0x6036('0x29')][_0x6036('0x32')]);_0xf93df4[_0x6036('0x33')]=qs[_0x6036('0x2a')](_[_0x6036('0x34')](_0x411e47[_0x6036('0x29')],_0x4fafef[_0x6036('0x2a')]));_0xf93df4[_0x6036('0x33')]['CampaignId']=_0x41fa81['id'];if(_0x411e47['query'][_0x6036('0x59')]){_0xf93df4[_0x6036('0x33')]=_[_0x6036('0x3a')](_0xf93df4[_0x6036('0x33')],{'$or':_[_0x6036('0x35')](_0xf93df4['attributes'],function(_0x4a3dc7){var _0x48b502={};_0x48b502[_0x4a3dc7]={'$like':'%'+_0x411e47['query']['filter']+'%'};return _0x48b502;})});}_0xf93df4=_[_0x6036('0x3a')]({},_0xf93df4,_0x411e47['options']);return db[_0x6036('0x61')][_0x6036('0x15')]({'where':_0xf93df4[_0x6036('0x33')]})[_0x6036('0x1d')](function(_0x4066b7){_0x4c748c[_0x6036('0x15')]=_0x4066b7;if(_0x411e47[_0x6036('0x29')]['includeAll']){_0xf93df4[_0x6036('0x3d')]=[{'all':!![]}];}return db[_0x6036('0x61')]['findAll'](_0xf93df4);})[_0x6036('0x1d')](function(_0x3fcd12){_0x4c748c[_0x6036('0x3f')]=_0x3fcd12;return _0x4c748c;});}})[_0x6036('0x1d')](respondWithFilteredResult(_0x2044a4,_0xf93df4))['catch'](handleError(_0x2044a4,null));};exports[_0x6036('0x7f')]=function(_0x45198c,_0x175743,_0x292328){var _0x5461b4,_0x28ee32;return db[_0x6036('0x27')][_0x6036('0x45')]({'where':{'id':_0x45198c[_0x6036('0x42')]['id']}})['then'](handleEntityNotFound(_0x175743,null))[_0x6036('0x1d')](function(_0x450214){if(_0x450214){_0x28ee32=_0x450214;return _0x450214['addBlackLists'](_0x45198c['body']['ids'],_[_0x6036('0x51')](_0x45198c[_0x6036('0x47')],[_0x6036('0x63'),'id'])||{});}return null;})[_0x6036('0x64')](function(_0x5c4691){var _0x4fb9e8;_0x5461b4=_0x5c4691||[];var _0xa87d75=[];if(_0x5c4691){for(var _0x5adaf6=0x0;_0x5adaf6<_0x5c4691[_0x6036('0x2e')];_0x5adaf6+=0x1){var _0x2586a4=_0x5c4691[_0x5adaf6][_0x6036('0x1f')]({'plain':!![]});_0x4fb9e8=squel[_0x6036('0x67')]()[_0x6036('0x68')](_0x6036('0x80'))[_0x6036('0x69')](['phone',_0x6036('0x6a'),_0x6036('0x6b'),'CampaignId',_0x6036('0x53'),_0x6036('0x52')],squel[_0x6036('0x6c')]()[_0x6036('0x39')](_0x6036('0x6d'),_0x6036('0x6d'))[_0x6036('0x39')]('id',_0x6036('0x6a'))['field'](_0x2586a4['CmListId']['toString'](),'ListId')[_0x6036('0x39')](_0x45198c[_0x6036('0x42')]['id'][_0x6036('0x71')](),_0x6036('0x58'))['field'](_0x6036('0x6e'),_0x6036('0x53'))[_0x6036('0x39')](_0x6036('0x6e'),_0x6036('0x52'))[_0x6036('0x72')](_0x6036('0x73'))[_0x6036('0x33')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x2586a4[_0x6036('0x70')][_0x6036('0x71')]())[_0x6036('0x33')](_0x6036('0x76')))['toString']();_0xa87d75['push'](db[_0x6036('0x81')]['query'](_0x4fb9e8));}return BPromise['all'](_0xa87d75);}})['then'](function(){return _0x5461b4;})['then'](respondWithResult(_0x175743,null))[_0x6036('0x40')](handleError(_0x175743,null));};exports['removeBlackLists']=function(_0x229d15,_0x1ce562,_0x3f14a0){var _0x19ab69;return db[_0x6036('0x27')][_0x6036('0x45')]({'where':{'id':_0x229d15['params']['id']}})[_0x6036('0x1d')](handleEntityNotFound(_0x1ce562,null))[_0x6036('0x1d')](function(_0x130fbc){if(_0x130fbc){return _0x130fbc[_0x6036('0x82')](_0x229d15[_0x6036('0x29')][_0x6036('0x63')]);}})['then'](function(_0x54411f){if(_0x54411f){_0x19ab69=_0x54411f;return db['CmHopperBlack'][_0x6036('0x1e')]({'where':{'ListId':_0x229d15[_0x6036('0x29')][_0x6036('0x63')],'CampaignId':_0x229d15[_0x6036('0x42')]['id']}})[_0x6036('0x1d')](function(){return _0x19ab69;});}})['then'](respondWithStatusCode(_0x1ce562,null))['catch'](handleError(_0x1ce562,null));}; \ No newline at end of file +var _0x433e=['ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','calleridnum','CampaignId\x20=\x20?','cm_hopper','cm_contacts','phone\x20NOT\x20IN\x20(?)','push','sequelize','getBlackLists','addBlackLists','all','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','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','reject','save','update','then','destroy','IvrCampaigns','UserProfileResource','error','stack','name','send','index','Campaign','rawAttributes','model','query','keys','attributes','fields','length','limit','sort','filters','pick','filter','where','merge','map','key','VIRTUAL','field','options','count','includeAll','include','catch','show','intersection','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','clone','params','updatedAt','omit','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','nolimit','order','CmHopper','rows','getHopperHistories','CmHopperHistory','hasOwnProperty','CampaignId','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','ListId','createdAt','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0x433e,0x112));var _0xe433=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x433e[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe433('0x0'));var zipdir=require(_0xe433('0x1'));var jsonpatch=require(_0xe433('0x2'));var rp=require(_0xe433('0x3'));var moment=require(_0xe433('0x4'));var BPromise=require(_0xe433('0x5'));var Mustache=require(_0xe433('0x6'));var util=require(_0xe433('0x7'));var path=require(_0xe433('0x8'));var sox=require(_0xe433('0x9'));var csv=require(_0xe433('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe433('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe433('0xa'));var querystring=require('querystring');var Papa=require(_0xe433('0xc'));var authService=require(_0xe433('0xd'));var hardwareService=require(_0xe433('0xe'));var Redis=require(_0xe433('0xf'));var qs=require(_0xe433('0x10'));var logger=require(_0xe433('0x11'))(_0xe433('0x12'));var utils=require(_0xe433('0x13'));var config=require(_0xe433('0x14'));var db=require(_0xe433('0x15'))['db'];function respondWithStatusCode(_0x2e4fa3,_0x27faa0){_0x27faa0=_0x27faa0||0xcc;return function(_0x2bdf1f){if(_0x2bdf1f){return _0x2e4fa3[_0xe433('0x16')](_0x27faa0);}return _0x2e4fa3[_0xe433('0x17')](_0x27faa0)[_0xe433('0x18')]();};}function respondWithResult(_0x5048da,_0x206afd){_0x206afd=_0x206afd||0xc8;return function(_0x5d28f3){if(_0x5d28f3){return _0x5048da[_0xe433('0x17')](_0x206afd)[_0xe433('0x19')](_0x5d28f3);}};}function respondWithFilteredResult(_0x3a4478,_0x133225){return function(_0x405372){if(_0x405372){var _0x2ab721=_0x405372['count'],_0x48e44a=_0x133225[_0xe433('0x1a')],_0x12ed6e=_0x133225[_0xe433('0x1a')]+_0x133225['limit'],_0x465c58;if(_0x12ed6e>=_0x2ab721){_0x12ed6e=_0x2ab721;_0x465c58=0xc8;}else{_0x465c58=0xce;}_0x3a4478[_0xe433('0x17')](_0x465c58);return _0x3a4478['set'](_0xe433('0x1b'),_0x48e44a+'-'+_0x12ed6e+'/'+_0x2ab721)['json'](_0x405372);}return null;};}function patchUpdates(_0x388887){return function(_0x2830e2){try{jsonpatch['apply'](_0x2830e2,_0x388887,!![]);}catch(_0x88a02f){return BPromise[_0xe433('0x1c')](_0x88a02f);}return _0x2830e2[_0xe433('0x1d')]();};}function saveUpdates(_0x36af50,_0x3ea559){return function(_0x5064ca){if(_0x5064ca){return _0x5064ca[_0xe433('0x1e')](_0x36af50)[_0xe433('0x1f')](function(_0x26ff09){return _0x26ff09;});}return null;};}function removeEntity(_0x115125,_0x289f93){return function(_0x45c536){if(_0x45c536){return _0x45c536[_0xe433('0x20')]()['then'](function(){var _0x1e6f47=_0x45c536['get']({'plain':!![]});var _0x426a0e=_0xe433('0x21');return db[_0xe433('0x22')][_0xe433('0x20')]({'where':{'type':_0x426a0e,'resourceId':_0x1e6f47['id']}})['then'](function(){return _0x45c536;});})[_0xe433('0x1f')](function(){_0x115125[_0xe433('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x114e01,_0x1a6239){return function(_0xf6ab3){if(!_0xf6ab3){_0x114e01[_0xe433('0x16')](0x194);}return _0xf6ab3;};}function handleError(_0x5d86f0,_0x1b317a){_0x1b317a=_0x1b317a||0x1f4;return function(_0x5e00a6){logger[_0xe433('0x23')](_0x5e00a6[_0xe433('0x24')]);if(_0x5e00a6[_0xe433('0x25')]){delete _0x5e00a6['name'];}_0x5d86f0[_0xe433('0x17')](_0x1b317a)[_0xe433('0x26')](_0x5e00a6);};}exports[_0xe433('0x27')]=function(_0xefd181,_0x2be636){var _0x416f1e={},_0x3fec57={},_0x43f033={'count':0x0,'rows':[]};var _0xe8c4a0=db[_0xe433('0x28')][_0xe433('0x29')];_0x3fec57[_0xe433('0x2a')]=_['keys'](_0xe8c4a0);_0x3fec57[_0xe433('0x2b')]=_[_0xe433('0x2c')](_0xefd181[_0xe433('0x2b')]);_0x3fec57['filters']=_['intersection'](_0x3fec57[_0xe433('0x2a')],_0x3fec57[_0xe433('0x2b')]);_0x416f1e[_0xe433('0x2d')]=_['intersection'](_0x3fec57[_0xe433('0x2a')],qs[_0xe433('0x2e')](_0xefd181[_0xe433('0x2b')]['fields']));_0x416f1e[_0xe433('0x2d')]=_0x416f1e[_0xe433('0x2d')][_0xe433('0x2f')]?_0x416f1e[_0xe433('0x2d')]:_0x3fec57[_0xe433('0x2a')];if(!_0xefd181[_0xe433('0x2b')]['hasOwnProperty']('nolimit')){_0x416f1e[_0xe433('0x30')]=qs[_0xe433('0x30')](_0xefd181[_0xe433('0x2b')][_0xe433('0x30')]);_0x416f1e['offset']=qs[_0xe433('0x1a')](_0xefd181[_0xe433('0x2b')][_0xe433('0x1a')]);}_0x416f1e['order']=qs[_0xe433('0x31')](_0xefd181[_0xe433('0x2b')][_0xe433('0x31')]);_0x416f1e['where']=qs[_0xe433('0x32')](_[_0xe433('0x33')](_0xefd181[_0xe433('0x2b')],_0x3fec57[_0xe433('0x32')]));if(_0xefd181[_0xe433('0x2b')][_0xe433('0x34')]){_0x416f1e[_0xe433('0x35')]=_[_0xe433('0x36')](_0x416f1e[_0xe433('0x35')],{'$or':_[_0xe433('0x37')](_0xe8c4a0,function(_0x4afb15){if(_0x4afb15['type'][_0xe433('0x38')]!==_0xe433('0x39')){var _0x9e54c7={};_0x9e54c7[_0x4afb15[_0xe433('0x3a')]]={'$like':'%'+_0xefd181[_0xe433('0x2b')]['filter']+'%'};return _0x9e54c7;}})});}_0x416f1e=_[_0xe433('0x36')]({},_0x416f1e,_0xefd181[_0xe433('0x3b')]);var _0x16a818={'where':_0x416f1e[_0xe433('0x35')]};return db[_0xe433('0x28')][_0xe433('0x3c')](_0x16a818)['then'](function(_0x2db6e7){_0x43f033[_0xe433('0x3c')]=_0x2db6e7;if(_0xefd181[_0xe433('0x2b')][_0xe433('0x3d')]){_0x416f1e[_0xe433('0x3e')]=[{'all':!![]}];}return db[_0xe433('0x28')]['findAll'](_0x416f1e);})[_0xe433('0x1f')](function(_0x4c85dc){_0x43f033['rows']=_0x4c85dc;return _0x43f033;})[_0xe433('0x1f')](respondWithFilteredResult(_0x2be636,_0x416f1e))[_0xe433('0x3f')](handleError(_0x2be636,null));};exports[_0xe433('0x40')]=function(_0x471dcd,_0x518902){var _0x43c819={'raw':![],'where':{'id':_0x471dcd['params']['id']}},_0x478399={};_0x478399['model']=_['keys'](db[_0xe433('0x28')][_0xe433('0x29')]);_0x478399[_0xe433('0x2b')]=_[_0xe433('0x2c')](_0x471dcd[_0xe433('0x2b')]);_0x478399[_0xe433('0x32')]=_[_0xe433('0x41')](_0x478399[_0xe433('0x2a')],_0x478399[_0xe433('0x2b')]);_0x43c819[_0xe433('0x2d')]=_[_0xe433('0x41')](_0x478399['model'],qs[_0xe433('0x2e')](_0x471dcd[_0xe433('0x2b')][_0xe433('0x2e')]));_0x43c819['attributes']=_0x43c819[_0xe433('0x2d')][_0xe433('0x2f')]?_0x43c819[_0xe433('0x2d')]:_0x478399[_0xe433('0x2a')];if(_0x471dcd['query'][_0xe433('0x3d')]){_0x43c819[_0xe433('0x3e')]=[{'all':!![]}];}_0x43c819=_[_0xe433('0x36')]({},_0x43c819,_0x471dcd[_0xe433('0x3b')]);return db[_0xe433('0x28')][_0xe433('0x42')](_0x43c819)[_0xe433('0x1f')](handleEntityNotFound(_0x518902,null))[_0xe433('0x1f')](respondWithResult(_0x518902,null))['catch'](handleError(_0x518902,null));};exports['create']=function(_0x2a7c44,_0x54fda5){return db[_0xe433('0x28')][_0xe433('0x43')](_0x2a7c44[_0xe433('0x44')],{})[_0xe433('0x1f')](function(_0x2ca560){var _0x4b55f5=_0x2a7c44['user'][_0xe433('0x45')]({'plain':!![]});if(!_0x4b55f5)throw new Error(_0xe433('0x46'));if(_0x4b55f5[_0xe433('0x47')]===_0xe433('0x48')){var _0x2aa28e=_0x2ca560[_0xe433('0x45')]({'plain':!![]});var _0x35f483=_0xe433('0x21');return db[_0xe433('0x49')][_0xe433('0x42')]({'where':{'name':_0x35f483,'userProfileId':_0x4b55f5[_0xe433('0x4a')]},'raw':!![]})[_0xe433('0x1f')](function(_0x5c081b){if(_0x5c081b&&_0x5c081b[_0xe433('0x4b')]===0x0){return db[_0xe433('0x22')][_0xe433('0x43')]({'name':_0x2aa28e[_0xe433('0x25')],'resourceId':_0x2aa28e['id'],'type':_0x5c081b[_0xe433('0x25')],'sectionId':_0x5c081b['id']},{})[_0xe433('0x1f')](function(){return _0x2ca560;});}else{return _0x2ca560;}})[_0xe433('0x3f')](function(_0x4f1e81){logger[_0xe433('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f1e81);throw _0x4f1e81;});}return _0x2ca560;})[_0xe433('0x1f')](respondWithResult(_0x54fda5,0xc9))[_0xe433('0x3f')](handleError(_0x54fda5,null));};exports[_0xe433('0x4c')]=function(_0x529d28,_0x23cfc7){var _0x286d03={'raw':![],'where':{'id':_0x529d28[_0xe433('0x4d')]['id']}},_0x83bc3d={};_0x83bc3d[_0xe433('0x2a')]=_['keys'](db[_0xe433('0x28')][_0xe433('0x29')]);_0x286d03['attributes']=_[_0xe433('0x41')](_0x83bc3d[_0xe433('0x2a')],qs[_0xe433('0x2e')](_0x529d28[_0xe433('0x2b')]['fields']));_0x286d03[_0xe433('0x2d')]=_0x286d03[_0xe433('0x2d')][_0xe433('0x2f')]?_0x286d03[_0xe433('0x2d')]:_0x83bc3d[_0xe433('0x2a')];if(_0x529d28['query'][_0xe433('0x3d')]){_0x286d03[_0xe433('0x3e')]=[{'all':!![]}];}_0x286d03=_[_0xe433('0x36')]({},_0x286d03,_0x529d28['options']);return db['Campaign']['find'](_0x286d03)[_0xe433('0x1f')](handleEntityNotFound(_0x23cfc7,null))[_0xe433('0x1f')](function(_0x2b2600){if(_0x2b2600){var _0x3d7fa=_0x2b2600['get']({'plain':!![]});_0x3d7fa=qs['omit'](_0x3d7fa,['id','createdAt',_0xe433('0x4e')]);_0x529d28[_0xe433('0x44')]=_[_0xe433('0x4f')](_0x529d28[_0xe433('0x44')],['id','createdAt','updatedAt']);return db[_0xe433('0x28')]['create'](_[_0xe433('0x36')](_0x3d7fa,_0x529d28[_0xe433('0x44')]),{'include':_0x529d28[_0xe433('0x2b')]['includeAll']?[{'all':!![]}]:undefined})[_0xe433('0x1f')](function(_0x2155d8){var _0x42b8e5=_0x529d28['user']['get']({'plain':!![]});if(!_0x42b8e5)throw new Error(_0xe433('0x46'));if(_0x42b8e5[_0xe433('0x47')]===_0xe433('0x48')){var _0x4716da=_0x2155d8[_0xe433('0x45')]({'plain':!![]});var _0x3b84c8=_0xe433('0x21');return db[_0xe433('0x49')][_0xe433('0x42')]({'where':{'name':_0x3b84c8,'userProfileId':_0x42b8e5['userProfileId']},'raw':!![]})[_0xe433('0x1f')](function(_0x56b6d5){if(_0x56b6d5&&_0x56b6d5['autoAssociation']===0x0){return db[_0xe433('0x22')][_0xe433('0x43')]({'name':_0x4716da[_0xe433('0x25')],'resourceId':_0x4716da['id'],'type':_0x56b6d5[_0xe433('0x25')],'sectionId':_0x56b6d5['id']},{})['then'](function(){return _0x2155d8;});}else{return _0x2155d8;}})['catch'](function(_0x23e5ac){logger[_0xe433('0x23')](_0xe433('0x50'),_0x23e5ac);throw _0x23e5ac;});}return _0x2155d8;});}})['then'](respondWithResult(_0x23cfc7,0xc9))[_0xe433('0x3f')](handleError(_0x23cfc7,null));};exports[_0xe433('0x1e')]=function(_0x2dc685,_0x33cfff){if(_0x2dc685[_0xe433('0x44')]['id']){delete _0x2dc685[_0xe433('0x44')]['id'];}return db['Campaign'][_0xe433('0x42')]({'where':{'id':_0x2dc685[_0xe433('0x4d')]['id']}})[_0xe433('0x1f')](handleEntityNotFound(_0x33cfff,null))['then'](saveUpdates(_0x2dc685[_0xe433('0x44')],null))[_0xe433('0x1f')](respondWithResult(_0x33cfff,null))[_0xe433('0x3f')](handleError(_0x33cfff,null));};exports[_0xe433('0x20')]=function(_0x189e6d,_0x56cc59){return db[_0xe433('0x28')]['find']({'where':{'id':_0x189e6d[_0xe433('0x4d')]['id']}})['then'](handleEntityNotFound(_0x56cc59,null))[_0xe433('0x1f')](removeEntity(_0x56cc59,null))['catch'](handleError(_0x56cc59,null));};exports[_0xe433('0x51')]=function(_0x47b7a7,_0x3de805,_0x134b21){var _0x484d10={'raw':!![],'where':{}};var _0xfff4c={};var _0x1283f5={'count':0x0,'rows':[]};return db['Campaign'][_0xe433('0x52')]({'where':{'id':_0x47b7a7[_0xe433('0x4d')]['id']}})[_0xe433('0x1f')](handleEntityNotFound(_0x3de805,null))[_0xe433('0x1f')](function(_0x1ced01){if(_0x1ced01){_0xfff4c[_0xe433('0x2a')]=_['keys'](db['CmHopper'][_0xe433('0x29')]);_0xfff4c[_0xe433('0x2b')]=_['keys'](_0x47b7a7['query']);_0xfff4c['filters']=_[_0xe433('0x41')](_0xfff4c[_0xe433('0x2a')],_0xfff4c[_0xe433('0x2b')]);_0x484d10[_0xe433('0x2d')]=_[_0xe433('0x41')](_0xfff4c[_0xe433('0x2a')],qs[_0xe433('0x2e')](_0x47b7a7[_0xe433('0x2b')][_0xe433('0x2e')]));_0x484d10['attributes']=_0x484d10[_0xe433('0x2d')][_0xe433('0x2f')]?_0x484d10[_0xe433('0x2d')]:_0xfff4c[_0xe433('0x2a')];if(!_0x47b7a7['query']['hasOwnProperty'](_0xe433('0x53'))){_0x484d10[_0xe433('0x30')]=qs[_0xe433('0x30')](_0x47b7a7['query']['limit']);_0x484d10[_0xe433('0x1a')]=qs['offset'](_0x47b7a7['query']['offset']);}_0x484d10[_0xe433('0x54')]=qs[_0xe433('0x31')](_0x47b7a7[_0xe433('0x2b')][_0xe433('0x31')]);_0x484d10['where']=qs[_0xe433('0x32')](_[_0xe433('0x33')](_0x47b7a7['query'],_0xfff4c[_0xe433('0x32')]));_0x484d10[_0xe433('0x35')]['CampaignId']=_0x1ced01['id'];if(_0x47b7a7[_0xe433('0x2b')][_0xe433('0x34')]){_0x484d10[_0xe433('0x35')]=_[_0xe433('0x36')](_0x484d10[_0xe433('0x35')],{'$or':_[_0xe433('0x37')](_0x484d10[_0xe433('0x2d')],function(_0x1e18e6){var _0x564945={};_0x564945[_0x1e18e6]={'$like':'%'+_0x47b7a7['query'][_0xe433('0x34')]+'%'};return _0x564945;})});}_0x484d10=_[_0xe433('0x36')]({},_0x484d10,_0x47b7a7[_0xe433('0x3b')]);return db[_0xe433('0x55')]['count']({'where':_0x484d10[_0xe433('0x35')]})[_0xe433('0x1f')](function(_0x2ad4d7){_0x1283f5[_0xe433('0x3c')]=_0x2ad4d7;if(_0x47b7a7['query'][_0xe433('0x3d')]){_0x484d10['include']=[{'all':!![]}];}return db[_0xe433('0x55')]['findAll'](_0x484d10);})[_0xe433('0x1f')](function(_0x530382){_0x1283f5[_0xe433('0x56')]=_0x530382;return _0x1283f5;});}})['then'](respondWithFilteredResult(_0x3de805,_0x484d10))[_0xe433('0x3f')](handleError(_0x3de805,null));};exports[_0xe433('0x57')]=function(_0x1daf1a,_0x45cddf,_0x1eed29){var _0x45aaf2={'raw':!![],'where':{}};var _0x316d07={};var _0x2b49b3={'count':0x0,'rows':[]};return db[_0xe433('0x28')][_0xe433('0x52')]({'where':{'id':_0x1daf1a['params']['id']}})['then'](handleEntityNotFound(_0x45cddf,null))[_0xe433('0x1f')](function(_0x1239f0){if(_0x1239f0){_0x316d07[_0xe433('0x2a')]=_[_0xe433('0x2c')](db[_0xe433('0x58')][_0xe433('0x29')]);_0x316d07[_0xe433('0x2b')]=_[_0xe433('0x2c')](_0x1daf1a[_0xe433('0x2b')]);_0x316d07[_0xe433('0x32')]=_[_0xe433('0x41')](_0x316d07[_0xe433('0x2a')],_0x316d07['query']);_0x45aaf2[_0xe433('0x2d')]=_[_0xe433('0x41')](_0x316d07['model'],qs[_0xe433('0x2e')](_0x1daf1a[_0xe433('0x2b')]['fields']));_0x45aaf2[_0xe433('0x2d')]=_0x45aaf2[_0xe433('0x2d')]['length']?_0x45aaf2[_0xe433('0x2d')]:_0x316d07['model'];if(!_0x1daf1a[_0xe433('0x2b')][_0xe433('0x59')](_0xe433('0x53'))){_0x45aaf2[_0xe433('0x30')]=qs[_0xe433('0x30')](_0x1daf1a[_0xe433('0x2b')][_0xe433('0x30')]);_0x45aaf2[_0xe433('0x1a')]=qs[_0xe433('0x1a')](_0x1daf1a[_0xe433('0x2b')][_0xe433('0x1a')]);}_0x45aaf2[_0xe433('0x54')]=qs[_0xe433('0x31')](_0x1daf1a['query'][_0xe433('0x31')]);_0x45aaf2['where']=qs[_0xe433('0x32')](_['pick'](_0x1daf1a[_0xe433('0x2b')],_0x316d07[_0xe433('0x32')]));_0x45aaf2['where'][_0xe433('0x5a')]=_0x1239f0['id'];if(_0x1daf1a[_0xe433('0x2b')][_0xe433('0x34')]){_0x45aaf2[_0xe433('0x35')]=_[_0xe433('0x36')](_0x45aaf2['where'],{'$or':_[_0xe433('0x37')](_0x45aaf2[_0xe433('0x2d')],function(_0x1a1f7c){var _0x1b772a={};_0x1b772a[_0x1a1f7c]={'$like':'%'+_0x1daf1a[_0xe433('0x2b')][_0xe433('0x34')]+'%'};return _0x1b772a;})});}_0x45aaf2=_['merge']({},_0x45aaf2,_0x1daf1a[_0xe433('0x3b')]);return db['CmHopperHistory'][_0xe433('0x3c')]({'where':_0x45aaf2[_0xe433('0x35')]})[_0xe433('0x1f')](function(_0xaaa6aa){_0x2b49b3[_0xe433('0x3c')]=_0xaaa6aa;if(_0x1daf1a[_0xe433('0x2b')][_0xe433('0x3d')]){_0x45aaf2['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xe433('0x5b')](_0x45aaf2);})[_0xe433('0x1f')](function(_0xd61a0d){_0x2b49b3[_0xe433('0x56')]=_0xd61a0d;return _0x2b49b3;});}})[_0xe433('0x1f')](respondWithFilteredResult(_0x45cddf,_0x45aaf2))['catch'](handleError(_0x45cddf,null));};exports[_0xe433('0x5c')]=function(_0x553aed,_0x2b6bfd,_0x47a4e9){var _0x10efb5={'raw':!![],'where':{}};var _0x46675a={};var _0x205e73={'count':0x0,'rows':[]};return db['Campaign'][_0xe433('0x52')]({'where':{'id':_0x553aed[_0xe433('0x4d')]['id']}})[_0xe433('0x1f')](handleEntityNotFound(_0x2b6bfd,null))[_0xe433('0x1f')](function(_0x15870a){if(_0x15870a){_0x46675a[_0xe433('0x2a')]=_[_0xe433('0x2c')](db[_0xe433('0x5d')]['rawAttributes']);_0x46675a[_0xe433('0x2b')]=_['keys'](_0x553aed[_0xe433('0x2b')]);_0x46675a[_0xe433('0x32')]=_['intersection'](_0x46675a['model'],_0x46675a[_0xe433('0x2b')]);_0x10efb5[_0xe433('0x2d')]=_['intersection'](_0x46675a[_0xe433('0x2a')],qs['fields'](_0x553aed[_0xe433('0x2b')][_0xe433('0x2e')]));_0x10efb5[_0xe433('0x2d')]=_0x10efb5[_0xe433('0x2d')][_0xe433('0x2f')]?_0x10efb5[_0xe433('0x2d')]:_0x46675a['model'];if(!_0x553aed['query'][_0xe433('0x59')](_0xe433('0x53'))){_0x10efb5['limit']=qs[_0xe433('0x30')](_0x553aed[_0xe433('0x2b')][_0xe433('0x30')]);_0x10efb5['offset']=qs[_0xe433('0x1a')](_0x553aed['query'][_0xe433('0x1a')]);}_0x10efb5['order']=qs[_0xe433('0x31')](_0x553aed[_0xe433('0x2b')]['sort']);_0x10efb5[_0xe433('0x35')]=qs[_0xe433('0x32')](_[_0xe433('0x33')](_0x553aed[_0xe433('0x2b')],_0x46675a[_0xe433('0x32')]));_0x10efb5['where'][_0xe433('0x5a')]=_0x15870a['id'];if(_0x553aed['query'][_0xe433('0x34')]){_0x10efb5[_0xe433('0x35')]=_[_0xe433('0x36')](_0x10efb5[_0xe433('0x35')],{'$or':_['map'](_0x10efb5[_0xe433('0x2d')],function(_0x2f7f52){var _0x13c002={};_0x13c002[_0x2f7f52]={'$like':'%'+_0x553aed[_0xe433('0x2b')][_0xe433('0x34')]+'%'};return _0x13c002;})});}_0x10efb5=_[_0xe433('0x36')]({},_0x10efb5,_0x553aed[_0xe433('0x3b')]);return db['CmHopperFinal'][_0xe433('0x3c')]({'where':_0x10efb5[_0xe433('0x35')]})['then'](function(_0x3ba94e){_0x205e73[_0xe433('0x3c')]=_0x3ba94e;if(_0x553aed['query'][_0xe433('0x3d')]){_0x10efb5[_0xe433('0x3e')]=[{'all':!![]}];}return db[_0xe433('0x5d')][_0xe433('0x5b')](_0x10efb5);})[_0xe433('0x1f')](function(_0x537c2a){_0x205e73[_0xe433('0x56')]=_0x537c2a;return _0x205e73;});}})['then'](respondWithFilteredResult(_0x2b6bfd,_0x10efb5))['catch'](handleError(_0x2b6bfd,null));};exports[_0xe433('0x5e')]=function(_0x478fdb,_0xd24d5,_0x744e72){var _0x471e69={'raw':!![],'where':{}};var _0x17e2e2={};var _0x59e689={'count':0x0,'rows':[]};return db[_0xe433('0x28')]['findOne']({'where':{'id':_0x478fdb[_0xe433('0x4d')]['id']}})['then'](handleEntityNotFound(_0xd24d5,null))[_0xe433('0x1f')](function(_0x205dcf){if(_0x205dcf){_0x17e2e2[_0xe433('0x2a')]=_[_0xe433('0x2c')](db['CmHopperBlack'][_0xe433('0x29')]);_0x17e2e2[_0xe433('0x2b')]=_['keys'](_0x478fdb[_0xe433('0x2b')]);_0x17e2e2[_0xe433('0x32')]=_[_0xe433('0x41')](_0x17e2e2['model'],_0x17e2e2['query']);_0x471e69['attributes']=_[_0xe433('0x41')](_0x17e2e2['model'],qs['fields'](_0x478fdb['query'][_0xe433('0x2e')]));_0x471e69[_0xe433('0x2d')]=_0x471e69['attributes'][_0xe433('0x2f')]?_0x471e69[_0xe433('0x2d')]:_0x17e2e2[_0xe433('0x2a')];if(!_0x478fdb[_0xe433('0x2b')][_0xe433('0x59')]('nolimit')){_0x471e69[_0xe433('0x30')]=qs[_0xe433('0x30')](_0x478fdb[_0xe433('0x2b')][_0xe433('0x30')]);_0x471e69['offset']=qs[_0xe433('0x1a')](_0x478fdb['query'][_0xe433('0x1a')]);}_0x471e69[_0xe433('0x54')]=qs[_0xe433('0x31')](_0x478fdb[_0xe433('0x2b')][_0xe433('0x31')]);_0x471e69[_0xe433('0x35')]=qs['filters'](_[_0xe433('0x33')](_0x478fdb[_0xe433('0x2b')],_0x17e2e2[_0xe433('0x32')]));_0x471e69[_0xe433('0x35')]['CampaignId']=_0x205dcf['id'];if(_0x478fdb[_0xe433('0x2b')][_0xe433('0x34')]){_0x471e69[_0xe433('0x35')]=_[_0xe433('0x36')](_0x471e69[_0xe433('0x35')],{'$or':_[_0xe433('0x37')](_0x471e69[_0xe433('0x2d')],function(_0xf1fbaf){var _0xbb46d7={};_0xbb46d7[_0xf1fbaf]={'$like':'%'+_0x478fdb[_0xe433('0x2b')]['filter']+'%'};return _0xbb46d7;})});}_0x471e69=_[_0xe433('0x36')]({},_0x471e69,_0x478fdb['options']);return db[_0xe433('0x5f')][_0xe433('0x3c')]({'where':_0x471e69[_0xe433('0x35')]})['then'](function(_0x59c0d1){_0x59e689[_0xe433('0x3c')]=_0x59c0d1;if(_0x478fdb[_0xe433('0x2b')][_0xe433('0x3d')]){_0x471e69[_0xe433('0x3e')]=[{'all':!![]}];}return db[_0xe433('0x5f')][_0xe433('0x5b')](_0x471e69);})['then'](function(_0x5107b8){_0x59e689['rows']=_0x5107b8;return _0x59e689;});}})['then'](respondWithFilteredResult(_0xd24d5,_0x471e69))[_0xe433('0x3f')](handleError(_0xd24d5,null));};exports[_0xe433('0x60')]=function(_0x4125cf,_0x3639f8,_0x552b04){var _0x489e57={};var _0x5f3ae1={};var _0x194b56;var _0x2f0d3e;return db[_0xe433('0x28')][_0xe433('0x52')]({'where':{'id':_0x4125cf['params']['id']}})[_0xe433('0x1f')](handleEntityNotFound(_0x3639f8,null))[_0xe433('0x1f')](function(_0x1d6c8d){if(_0x1d6c8d){_0x194b56=_0x1d6c8d;_0x5f3ae1[_0xe433('0x2a')]=_[_0xe433('0x2c')](db[_0xe433('0x61')][_0xe433('0x29')]);_0x5f3ae1[_0xe433('0x2b')]=_['keys'](_0x4125cf[_0xe433('0x2b')]);_0x5f3ae1[_0xe433('0x32')]=_[_0xe433('0x41')](_0x5f3ae1[_0xe433('0x2a')],_0x5f3ae1[_0xe433('0x2b')]);_0x489e57['attributes']=_[_0xe433('0x41')](_0x5f3ae1[_0xe433('0x2a')],qs['fields'](_0x4125cf['query'][_0xe433('0x2e')]));_0x489e57['attributes']=_0x489e57[_0xe433('0x2d')]['length']?_0x489e57[_0xe433('0x2d')]:_0x5f3ae1[_0xe433('0x2a')];_0x489e57['order']=qs[_0xe433('0x31')](_0x4125cf[_0xe433('0x2b')]['sort']);_0x489e57[_0xe433('0x35')]=qs['filters'](_['pick'](_0x4125cf[_0xe433('0x2b')],_0x5f3ae1[_0xe433('0x32')]));if(_0x4125cf[_0xe433('0x2b')][_0xe433('0x34')]){_0x489e57[_0xe433('0x35')]=_[_0xe433('0x36')](_0x489e57['where'],{'$or':_[_0xe433('0x37')](_0x489e57['attributes'],function(_0x3a52b3){var _0xa71556={};_0xa71556[_0x3a52b3]={'$like':'%'+_0x4125cf['query'][_0xe433('0x34')]+'%'};return _0xa71556;})});}_0x489e57=_[_0xe433('0x36')]({},_0x489e57,_0x4125cf['options']);return _0x194b56['getLists'](_0x489e57);}})['then'](function(_0x36f7cb){if(_0x36f7cb){_0x2f0d3e=_0x36f7cb[_0xe433('0x2f')];if(!_0x4125cf[_0xe433('0x2b')][_0xe433('0x59')](_0xe433('0x53'))){_0x489e57[_0xe433('0x30')]=qs[_0xe433('0x30')](_0x4125cf[_0xe433('0x2b')]['limit']);_0x489e57[_0xe433('0x1a')]=qs['offset'](_0x4125cf[_0xe433('0x2b')][_0xe433('0x1a')]);}return _0x194b56[_0xe433('0x60')](_0x489e57);}})[_0xe433('0x1f')](function(_0x354589){if(_0x354589){return _0x354589?{'count':_0x2f0d3e,'rows':_0x354589}:null;}})['then'](respondWithResult(_0x3639f8,null))[_0xe433('0x3f')](handleError(_0x3639f8,null));};exports[_0xe433('0x62')]=function(_0x90b79c,_0x50e4b9,_0x2f272a){var _0x467dd6,_0x112fd6;return db[_0xe433('0x28')][_0xe433('0x42')]({'where':{'id':_0x90b79c[_0xe433('0x4d')]['id']}})[_0xe433('0x1f')](handleEntityNotFound(_0x50e4b9,null))['then'](function(_0x43d316){if(_0x43d316){_0x112fd6=_0x43d316;return _0x43d316[_0xe433('0x62')](_0x90b79c[_0xe433('0x44')][_0xe433('0x63')],_[_0xe433('0x4f')](_0x90b79c[_0xe433('0x44')],[_0xe433('0x63'),'id'])||{});}return null;})[_0xe433('0x64')](function(_0x4d76fc){var _0x481498;_0x467dd6=_0x4d76fc||[];var _0x48c58a=[];if(_0x4d76fc){for(var _0x3502ca=0x0;_0x3502ca<_0x4d76fc[_0xe433('0x2f')];_0x3502ca+=0x1){var _0xbf316f=_0x4d76fc[_0x3502ca]['get']({'plain':!![]});_0x112fd6[_0xe433('0x65')]=_0x90b79c[_0xe433('0x44')][_0xe433('0x65')]?_0x90b79c[_0xe433('0x44')]['dialCheckDuplicateType']:_0x112fd6[_0xe433('0x65')];switch(_0x112fd6[_0xe433('0x65')]){case _0xe433('0x66'):_0x481498=squel[_0xe433('0x67')]()[_0xe433('0x68')]('cm_hopper')[_0xe433('0x69')]([_0xe433('0x6a'),'scheduledAt',_0xe433('0x6b'),_0xe433('0x6c'),_0xe433('0x5a'),_0xe433('0x6d'),_0xe433('0x4e')],squel['select']()[_0xe433('0x3a')](_0xe433('0x6a'),'phone')['field'](_0xe433('0x6e'),_0xe433('0x6f'))['field']('id','ContactId')[_0xe433('0x3a')](_0xbf316f[_0xe433('0x70')][_0xe433('0x71')](),'ListId')[_0xe433('0x3a')](_0x90b79c[_0xe433('0x4d')]['id'][_0xe433('0x71')](),'CampaignId')[_0xe433('0x3a')](_0xe433('0x6e'),_0xe433('0x6d'))[_0xe433('0x3a')]('NOW()',_0xe433('0x4e'))[_0xe433('0x72')]('cm_contacts')['where'](_0xe433('0x73'))[_0xe433('0x35')](_0xe433('0x74'),_0xbf316f['CmListId'][_0xe433('0x71')]())['where'](_0xe433('0x75'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xe433('0x76')]()[_0xe433('0x3a')](_0xe433('0x77'))[_0xe433('0x72')]('cm_hopper_final')['where'](_0xe433('0x78'),_0x90b79c[_0xe433('0x4d')]['id'][_0xe433('0x71')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xe433('0x3a')](_0xe433('0x6a'))[_0xe433('0x72')](_0xe433('0x79'))['where'](_0xe433('0x78'),_0x90b79c['params']['id'][_0xe433('0x71')]())))[_0xe433('0x71')]();break;case'onlyIfOpen':_0x481498=squel[_0xe433('0x67')]()[_0xe433('0x68')](_0xe433('0x79'))[_0xe433('0x69')]([_0xe433('0x6a'),'scheduledAt',_0xe433('0x6b'),_0xe433('0x6c'),_0xe433('0x5a'),_0xe433('0x6d'),_0xe433('0x4e')],squel[_0xe433('0x76')]()[_0xe433('0x3a')](_0xe433('0x6a'),_0xe433('0x6a'))[_0xe433('0x3a')](_0xe433('0x6e'),_0xe433('0x6f'))[_0xe433('0x3a')]('id',_0xe433('0x6b'))[_0xe433('0x3a')](_0xbf316f['CmListId'][_0xe433('0x71')](),_0xe433('0x6c'))['field'](_0x90b79c['params']['id'][_0xe433('0x71')](),_0xe433('0x5a'))[_0xe433('0x3a')](_0xe433('0x6e'),_0xe433('0x6d'))['field'](_0xe433('0x6e'),_0xe433('0x4e'))[_0xe433('0x72')](_0xe433('0x7a'))[_0xe433('0x35')]('deletedAt\x20IS\x20NULL')[_0xe433('0x35')](_0xe433('0x74'),_0xbf316f[_0xe433('0x70')][_0xe433('0x71')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe433('0x35')](_0xe433('0x7b'),squel[_0xe433('0x76')]()[_0xe433('0x3a')](_0xe433('0x6a'))['from'](_0xe433('0x79'))['where'](_0xe433('0x78'),_0x90b79c[_0xe433('0x4d')]['id'][_0xe433('0x71')]())))[_0xe433('0x71')]();break;default:_0x481498=squel[_0xe433('0x67')]()[_0xe433('0x68')]('cm_hopper')[_0xe433('0x69')]([_0xe433('0x6a'),_0xe433('0x6f'),'ContactId',_0xe433('0x6c'),_0xe433('0x5a'),_0xe433('0x6d'),_0xe433('0x4e')],squel[_0xe433('0x76')]()['field'](_0xe433('0x6a'),_0xe433('0x6a'))[_0xe433('0x3a')](_0xe433('0x6e'),_0xe433('0x6f'))[_0xe433('0x3a')]('id','ContactId')[_0xe433('0x3a')](_0xbf316f[_0xe433('0x70')]['toString'](),_0xe433('0x6c'))[_0xe433('0x3a')](_0x90b79c[_0xe433('0x4d')]['id']['toString'](),_0xe433('0x5a'))[_0xe433('0x3a')](_0xe433('0x6e'),'createdAt')['field'](_0xe433('0x6e'),_0xe433('0x4e'))['from'](_0xe433('0x7a'))[_0xe433('0x35')](_0xe433('0x73'))[_0xe433('0x35')](_0xe433('0x74'),_0xbf316f[_0xe433('0x70')]['toString']())['where'](_0xe433('0x75')))[_0xe433('0x71')]();}_0x48c58a[_0xe433('0x7c')](db[_0xe433('0x7d')][_0xe433('0x2b')](_0x481498));}return BPromise['all'](_0x48c58a);}})['then'](function(){return _0x467dd6;})[_0xe433('0x1f')](respondWithResult(_0x50e4b9,null))[_0xe433('0x3f')](handleError(_0x50e4b9,null));};exports['removeLists']=function(_0x393632,_0x2be90a,_0x373642){var _0x517ac2;return db[_0xe433('0x28')]['find']({'where':{'id':_0x393632[_0xe433('0x4d')]['id']}})[_0xe433('0x1f')](handleEntityNotFound(_0x2be90a,null))[_0xe433('0x1f')](function(_0x57ce21){if(_0x57ce21){return _0x57ce21['removeLists'](_0x393632[_0xe433('0x2b')][_0xe433('0x63')]);}})[_0xe433('0x1f')](function(_0x11d89d){if(_0x11d89d){_0x517ac2=_0x11d89d;return db[_0xe433('0x55')][_0xe433('0x20')]({'where':{'ListId':_0x393632[_0xe433('0x2b')]['ids'],'CampaignId':_0x393632[_0xe433('0x4d')]['id']}})[_0xe433('0x1f')](function(){return _0x517ac2;});}})[_0xe433('0x1f')](respondWithStatusCode(_0x2be90a,null))['catch'](handleError(_0x2be90a,null));};exports[_0xe433('0x7e')]=function(_0x51a1b0,_0x37097e,_0x3eb57b){var _0x510963={'raw':!![],'where':{}};var _0x26bee2={};var _0x40a99d={'count':0x0,'rows':[]};return db[_0xe433('0x28')][_0xe433('0x52')]({'where':{'id':_0x51a1b0[_0xe433('0x4d')]['id']}})['then'](handleEntityNotFound(_0x37097e,null))[_0xe433('0x1f')](function(_0x48786b){if(_0x48786b){_0x26bee2[_0xe433('0x2a')]=_[_0xe433('0x2c')](db['CmList'][_0xe433('0x29')]);_0x26bee2[_0xe433('0x2b')]=_[_0xe433('0x2c')](_0x51a1b0[_0xe433('0x2b')]);_0x26bee2[_0xe433('0x32')]=_[_0xe433('0x41')](_0x26bee2['model'],_0x26bee2[_0xe433('0x2b')]);_0x510963[_0xe433('0x2d')]=_[_0xe433('0x41')](_0x26bee2[_0xe433('0x2a')],qs[_0xe433('0x2e')](_0x51a1b0[_0xe433('0x2b')]['fields']));_0x510963[_0xe433('0x2d')]=_0x510963[_0xe433('0x2d')][_0xe433('0x2f')]?_0x510963[_0xe433('0x2d')]:_0x26bee2['model'];if(!_0x51a1b0['query'][_0xe433('0x59')](_0xe433('0x53'))){_0x510963[_0xe433('0x30')]=qs[_0xe433('0x30')](_0x51a1b0['query'][_0xe433('0x30')]);_0x510963['offset']=qs[_0xe433('0x1a')](_0x51a1b0['query']['offset']);}_0x510963[_0xe433('0x54')]=qs['sort'](_0x51a1b0['query'][_0xe433('0x31')]);_0x510963[_0xe433('0x35')]=qs['filters'](_[_0xe433('0x33')](_0x51a1b0[_0xe433('0x2b')],_0x26bee2[_0xe433('0x32')]));_0x510963[_0xe433('0x35')][_0xe433('0x5a')]=_0x48786b['id'];if(_0x51a1b0['query']['filter']){_0x510963['where']=_['merge'](_0x510963['where'],{'$or':_['map'](_0x510963[_0xe433('0x2d')],function(_0x544d75){var _0x3b0f55={};_0x3b0f55[_0x544d75]={'$like':'%'+_0x51a1b0['query'][_0xe433('0x34')]+'%'};return _0x3b0f55;})});}_0x510963=_[_0xe433('0x36')]({},_0x510963,_0x51a1b0[_0xe433('0x3b')]);return db[_0xe433('0x61')][_0xe433('0x3c')]({'where':_0x510963[_0xe433('0x35')]})[_0xe433('0x1f')](function(_0x34ab20){_0x40a99d[_0xe433('0x3c')]=_0x34ab20;if(_0x51a1b0[_0xe433('0x2b')][_0xe433('0x3d')]){_0x510963['include']=[{'all':!![]}];}return db[_0xe433('0x61')][_0xe433('0x5b')](_0x510963);})[_0xe433('0x1f')](function(_0x12de9e){_0x40a99d[_0xe433('0x56')]=_0x12de9e;return _0x40a99d;});}})['then'](respondWithFilteredResult(_0x37097e,_0x510963))[_0xe433('0x3f')](handleError(_0x37097e,null));};exports['addBlackLists']=function(_0x5d3f58,_0x246a9d,_0x115513){var _0x588ad0,_0x4214f2;return db[_0xe433('0x28')]['find']({'where':{'id':_0x5d3f58[_0xe433('0x4d')]['id']}})[_0xe433('0x1f')](handleEntityNotFound(_0x246a9d,null))['then'](function(_0xf321b5){if(_0xf321b5){_0x4214f2=_0xf321b5;return _0xf321b5[_0xe433('0x7f')](_0x5d3f58[_0xe433('0x44')]['ids'],_[_0xe433('0x4f')](_0x5d3f58[_0xe433('0x44')],[_0xe433('0x63'),'id'])||{});}return null;})[_0xe433('0x64')](function(_0x593c04){var _0x1da330;_0x588ad0=_0x593c04||[];var _0x5c1338=[];if(_0x593c04){for(var _0x48ac84=0x0;_0x48ac84<_0x593c04[_0xe433('0x2f')];_0x48ac84+=0x1){var _0x366d4e=_0x593c04[_0x48ac84]['get']({'plain':!![]});_0x1da330=squel['insert']()[_0xe433('0x68')]('cm_hopper_black')[_0xe433('0x69')]([_0xe433('0x6a'),'ContactId','ListId',_0xe433('0x5a'),'createdAt',_0xe433('0x4e')],squel[_0xe433('0x76')]()[_0xe433('0x3a')](_0xe433('0x6a'),_0xe433('0x6a'))[_0xe433('0x3a')]('id',_0xe433('0x6b'))['field'](_0x366d4e[_0xe433('0x70')][_0xe433('0x71')](),_0xe433('0x6c'))[_0xe433('0x3a')](_0x5d3f58[_0xe433('0x4d')]['id'][_0xe433('0x71')](),_0xe433('0x5a'))['field'](_0xe433('0x6e'),_0xe433('0x6d'))[_0xe433('0x3a')](_0xe433('0x6e'),'updatedAt')[_0xe433('0x72')](_0xe433('0x7a'))[_0xe433('0x35')]('deletedAt\x20IS\x20NULL')[_0xe433('0x35')](_0xe433('0x74'),_0x366d4e[_0xe433('0x70')][_0xe433('0x71')]())[_0xe433('0x35')](_0xe433('0x75')))['toString']();_0x5c1338[_0xe433('0x7c')](db['sequelize'][_0xe433('0x2b')](_0x1da330));}return BPromise[_0xe433('0x80')](_0x5c1338);}})[_0xe433('0x1f')](function(){return _0x588ad0;})[_0xe433('0x1f')](respondWithResult(_0x246a9d,null))[_0xe433('0x3f')](handleError(_0x246a9d,null));};exports[_0xe433('0x81')]=function(_0x5dfd40,_0x2426d4,_0x3db6f2){var _0x4d60b6;return db[_0xe433('0x28')][_0xe433('0x42')]({'where':{'id':_0x5dfd40[_0xe433('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2426d4,null))[_0xe433('0x1f')](function(_0x33ff30){if(_0x33ff30){return _0x33ff30['removeBlackLists'](_0x5dfd40[_0xe433('0x2b')][_0xe433('0x63')]);}})[_0xe433('0x1f')](function(_0x52bbef){if(_0x52bbef){_0x4d60b6=_0x52bbef;return db[_0xe433('0x5f')]['destroy']({'where':{'ListId':_0x5dfd40[_0xe433('0x2b')]['ids'],'CampaignId':_0x5dfd40[_0xe433('0x4d')]['id']}})['then'](function(){return _0x4d60b6;});}})[_0xe433('0x1f')](respondWithStatusCode(_0x2426d4,null))[_0xe433('0x3f')](handleError(_0x2426d4,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 704c019..f553821 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 _0x2ead=['util','api','moment','request-promise','./campaign.attributes','exports','define','Campaign','campaigns','lodash'];(function(_0x54ccdb,_0x35a0c0){var _0xcfd276=function(_0x509247){while(--_0x509247){_0x54ccdb['push'](_0x54ccdb['shift']());}};_0xcfd276(++_0x35a0c0);}(_0x2ead,0x1d5));var _0xd2ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2ead[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd2ea('0x0'));var util=require(_0xd2ea('0x1'));var logger=require('../../config/logger')(_0xd2ea('0x2'));var moment=require(_0xd2ea('0x3'));var BPromise=require('bluebird');var rp=require(_0xd2ea('0x4'));var attributes=require(_0xd2ea('0x5'));module[_0xd2ea('0x6')]=function(_0x4ff1ae,_0x44c473){return _0x4ff1ae[_0xd2ea('0x7')](_0xd2ea('0x8'),attributes,{'tableName':_0xd2ea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f96=['../../config/logger','api','moment','bluebird','./campaign.attributes','exports','Campaign','lodash','util'];(function(_0x373552,_0x3a69d4){var _0x2400fb=function(_0x2f1a38){while(--_0x2f1a38){_0x373552['push'](_0x373552['shift']());}};_0x2400fb(++_0x3a69d4);}(_0x3f96,0xa0));var _0x63f9=function(_0x49786d,_0x1ee2fc){_0x49786d=_0x49786d-0x0;var _0x232888=_0x3f96[_0x49786d];return _0x232888;};'use strict';var _=require(_0x63f9('0x0'));var util=require(_0x63f9('0x1'));var logger=require(_0x63f9('0x2'))(_0x63f9('0x3'));var moment=require(_0x63f9('0x4'));var BPromise=require(_0x63f9('0x5'));var rp=require('request-promise');var attributes=require(_0x63f9('0x6'));module[_0x63f9('0x7')]=function(_0x195d41,_0x87ba40){return _0x195d41['define'](_0x63f9('0x8'),attributes,{'tableName':'campaigns','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 ebddd02..1cbb472 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 _0x96fe=['then','info','request\x20sent','debug','error','code','Campaign,\x20%s,\x20%s','message','result','catch','options','raw','attributes','limit','include','map','model','GetCampaign','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0x96fe,0x149));var _0xe96f=function(_0x4c3167,_0x30444d){_0x4c3167=_0x4c3167-0x0;var _0xc4ce69=_0x96fe[_0x4c3167];return _0xc4ce69;};'use strict';var _=require(_0xe96f('0x0'));var util=require(_0xe96f('0x1'));var moment=require(_0xe96f('0x2'));var BPromise=require(_0xe96f('0x3'));var rs=require(_0xe96f('0x4'));var fs=require('fs');var Redis=require(_0xe96f('0x5'));var db=require(_0xe96f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe96f('0x7'));var config=require(_0xe96f('0x8'));var jayson=require(_0xe96f('0x9'));var client=jayson[_0xe96f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32956c,_0x11319e,_0x5c20e5){return new BPromise(function(_0x4475bc,_0x1b8e30){return client[_0xe96f('0xb')](_0x32956c,_0x5c20e5)[_0xe96f('0xc')](function(_0xf29fd2){logger[_0xe96f('0xd')]('Campaign,\x20%s,\x20%s',_0x11319e,_0xe96f('0xe'));logger[_0xe96f('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0x11319e,_0xe96f('0xe'),JSON['stringify'](_0xf29fd2));if(_0xf29fd2[_0xe96f('0x10')]){if(_0xf29fd2['error'][_0xe96f('0x11')]===0x1f4){logger['error'](_0xe96f('0x12'),_0x11319e,_0xf29fd2[_0xe96f('0x10')]['message']);return _0x1b8e30(_0xf29fd2[_0xe96f('0x10')][_0xe96f('0x13')]);}logger['error'](_0xe96f('0x12'),_0x11319e,_0xf29fd2[_0xe96f('0x10')][_0xe96f('0x13')]);return _0x4475bc(_0xf29fd2[_0xe96f('0x10')][_0xe96f('0x13')]);}else{logger[_0xe96f('0xd')](_0xe96f('0x12'),_0x11319e,'request\x20sent');_0x4475bc(_0xf29fd2[_0xe96f('0x14')][_0xe96f('0x13')]);}})[_0xe96f('0x15')](function(_0x1593a2){logger[_0xe96f('0x10')]('Campaign,\x20%s,\x20%s',_0x11319e,_0x1593a2);_0x1b8e30(_0x1593a2);});});}exports['GetCampaign']=function(_0x17d907){var _0x54c4fb=this;return new Promise(function(_0x58c93d,_0x5d134f){return db['Campaign']['findAll']({'raw':_0x17d907[_0xe96f('0x16')]?_0x17d907[_0xe96f('0x16')][_0xe96f('0x17')]===undefined?!![]:![]:!![],'where':_0x17d907[_0xe96f('0x16')]?_0x17d907[_0xe96f('0x16')]['where']||null:null,'attributes':_0x17d907['options']?_0x17d907[_0xe96f('0x16')][_0xe96f('0x18')]||null:null,'limit':_0x17d907['options']?_0x17d907[_0xe96f('0x16')][_0xe96f('0x19')]||null:null,'include':_0x17d907[_0xe96f('0x16')]?_0x17d907[_0xe96f('0x16')][_0xe96f('0x1a')]?_[_0xe96f('0x1b')](_0x17d907[_0xe96f('0x16')][_0xe96f('0x1a')],function(_0x55293b){return{'model':db[_0x55293b[_0xe96f('0x1c')]],'as':_0x55293b['as'],'attributes':_0x55293b[_0xe96f('0x18')],'include':_0x55293b[_0xe96f('0x1a')]?_[_0xe96f('0x1b')](_0x55293b[_0xe96f('0x1a')],function(_0x630793){return{'model':db[_0x630793[_0xe96f('0x1c')]],'as':_0x630793['as'],'attributes':_0x630793[_0xe96f('0x18')],'include':_0x630793['include']?_['map'](_0x630793[_0xe96f('0x1a')],function(_0x20d528){return{'model':db[_0x20d528[_0xe96f('0x1c')]],'as':_0x20d528['as'],'attributes':_0x20d528[_0xe96f('0x18')]};}):[]};}):[]};}):[]:[]})[_0xe96f('0xc')](function(_0x255aec){logger[_0xe96f('0xd')](_0xe96f('0x1d'),_0x17d907);logger[_0xe96f('0xf')]('GetCampaign',_0x17d907,JSON[_0xe96f('0x1e')](_0x255aec));_0x58c93d(_0x255aec);})[_0xe96f('0x15')](function(_0x5f46b8){logger[_0xe96f('0x10')]('GetCampaign',_0x5f46b8[_0xe96f('0x13')],_0x17d907);_0x5d134f(_0x54c4fb[_0xe96f('0x10')](0x1f4,_0x5f46b8['message']));});});}; \ No newline at end of file +var _0xfa7d=['http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','Campaign','options','raw','where','attributes','limit','include','map','model','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xfa7d,0x1d7));var _0xdfa7=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xfa7d[_0x298ed3];return _0x5aad28;};'use strict';var _=require('lodash');var util=require(_0xdfa7('0x0'));var moment=require(_0xdfa7('0x1'));var BPromise=require('bluebird');var rs=require(_0xdfa7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdfa7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdfa7('0x4'))(_0xdfa7('0x5'));var config=require(_0xdfa7('0x6'));var jayson=require(_0xdfa7('0x7'));var client=jayson[_0xdfa7('0x8')][_0xdfa7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10edbe,_0x4894fc,_0x2d3225){return new BPromise(function(_0x5d609e,_0x349096){return client[_0xdfa7('0xa')](_0x10edbe,_0x2d3225)[_0xdfa7('0xb')](function(_0x31eae9){logger[_0xdfa7('0xc')](_0xdfa7('0xd'),_0x4894fc,_0xdfa7('0xe'));logger[_0xdfa7('0xf')](_0xdfa7('0x10'),_0x4894fc,_0xdfa7('0xe'),JSON[_0xdfa7('0x11')](_0x31eae9));if(_0x31eae9['error']){if(_0x31eae9[_0xdfa7('0x12')]['code']===0x1f4){logger[_0xdfa7('0x12')](_0xdfa7('0xd'),_0x4894fc,_0x31eae9['error'][_0xdfa7('0x13')]);return _0x349096(_0x31eae9[_0xdfa7('0x12')][_0xdfa7('0x13')]);}logger[_0xdfa7('0x12')](_0xdfa7('0xd'),_0x4894fc,_0x31eae9[_0xdfa7('0x12')][_0xdfa7('0x13')]);return _0x5d609e(_0x31eae9[_0xdfa7('0x12')][_0xdfa7('0x13')]);}else{logger[_0xdfa7('0xc')](_0xdfa7('0xd'),_0x4894fc,_0xdfa7('0xe'));_0x5d609e(_0x31eae9[_0xdfa7('0x14')][_0xdfa7('0x13')]);}})[_0xdfa7('0x15')](function(_0x52eedc){logger[_0xdfa7('0x12')]('Campaign,\x20%s,\x20%s',_0x4894fc,_0x52eedc);_0x349096(_0x52eedc);});});}exports[_0xdfa7('0x16')]=function(_0x22b507){var _0x49cd8b=this;return new Promise(function(_0x1a02e0,_0x4b9a1b){return db[_0xdfa7('0x17')]['findAll']({'raw':_0x22b507[_0xdfa7('0x18')]?_0x22b507[_0xdfa7('0x18')][_0xdfa7('0x19')]===undefined?!![]:![]:!![],'where':_0x22b507[_0xdfa7('0x18')]?_0x22b507[_0xdfa7('0x18')][_0xdfa7('0x1a')]||null:null,'attributes':_0x22b507[_0xdfa7('0x18')]?_0x22b507[_0xdfa7('0x18')][_0xdfa7('0x1b')]||null:null,'limit':_0x22b507[_0xdfa7('0x18')]?_0x22b507[_0xdfa7('0x18')][_0xdfa7('0x1c')]||null:null,'include':_0x22b507[_0xdfa7('0x18')]?_0x22b507[_0xdfa7('0x18')][_0xdfa7('0x1d')]?_[_0xdfa7('0x1e')](_0x22b507[_0xdfa7('0x18')]['include'],function(_0x4442d0){return{'model':db[_0x4442d0[_0xdfa7('0x1f')]],'as':_0x4442d0['as'],'attributes':_0x4442d0[_0xdfa7('0x1b')],'include':_0x4442d0['include']?_[_0xdfa7('0x1e')](_0x4442d0[_0xdfa7('0x1d')],function(_0x374f56){return{'model':db[_0x374f56[_0xdfa7('0x1f')]],'as':_0x374f56['as'],'attributes':_0x374f56[_0xdfa7('0x1b')],'include':_0x374f56[_0xdfa7('0x1d')]?_[_0xdfa7('0x1e')](_0x374f56['include'],function(_0x5098ac){return{'model':db[_0x5098ac[_0xdfa7('0x1f')]],'as':_0x5098ac['as'],'attributes':_0x5098ac['attributes']};}):[]};}):[]};}):[]:[]})[_0xdfa7('0xb')](function(_0x3aeb34){logger[_0xdfa7('0xc')](_0xdfa7('0x16'),_0x22b507);logger['debug']('GetCampaign',_0x22b507,JSON['stringify'](_0x3aeb34));_0x1a02e0(_0x3aeb34);})[_0xdfa7('0x15')](function(_0x321cde){logger[_0xdfa7('0x12')](_0xdfa7('0x16'),_0x321cde['message'],_0x22b507);_0x4b9a1b(_0x49cd8b[_0xdfa7('0x12')](0x1f4,_0x321cde[_0xdfa7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index a459c1a..c2ce980 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 _0x078e=['/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x29aad3,_0x356b40){var _0x4b26bb=function(_0x137abe){while(--_0x137abe){_0x29aad3['push'](_0x29aad3['shift']());}};_0x4b26bb(++_0x356b40);}(_0x078e,0x114));var _0xe078=function(_0x17cb21,_0x414619){_0x17cb21=_0x17cb21-0x0;var _0x361298=_0x078e[_0x17cb21];return _0x361298;};'use strict';var multer=require(_0xe078('0x0'));var util=require(_0xe078('0x1'));var path=require('path');var timeout=require(_0xe078('0x2'));var express=require(_0xe078('0x3'));var router=express['Router']();var auth=require(_0xe078('0x4'));var interaction=require(_0xe078('0x5'));var config=require(_0xe078('0x6'));var controller=require('./campaign.controller');router[_0xe078('0x7')]('/',auth[_0xe078('0x8')](),controller[_0xe078('0x9')]);router[_0xe078('0x7')](_0xe078('0xa'),auth[_0xe078('0x8')](),controller[_0xe078('0xb')]);router['get'](_0xe078('0xc'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xe078('0x7')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xe078('0xd')]);router[_0xe078('0x7')](_0xe078('0xe'),auth['isAuthenticated'](),controller[_0xe078('0xf')]);router[_0xe078('0x7')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xe078('0x10')]);router[_0xe078('0x7')](_0xe078('0x11'),auth[_0xe078('0x8')](),controller[_0xe078('0x12')]);router[_0xe078('0x7')]('/:id/blacklists',auth[_0xe078('0x8')](),controller[_0xe078('0x13')]);router[_0xe078('0x14')]('/',auth[_0xe078('0x8')](),controller['create']);router[_0xe078('0x14')](_0xe078('0x15'),auth[_0xe078('0x8')](),controller[_0xe078('0x16')]);router['post'](_0xe078('0x11'),auth[_0xe078('0x8')](),controller[_0xe078('0x17')]);router[_0xe078('0x14')](_0xe078('0x18'),auth['isAuthenticated'](),controller[_0xe078('0x19')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe078('0x1a')]);router[_0xe078('0x1b')]('/:id',auth[_0xe078('0x8')](),controller[_0xe078('0x1c')]);router[_0xe078('0x1b')](_0xe078('0x11'),auth['isAuthenticated'](),controller[_0xe078('0x1d')]);router['delete'](_0xe078('0x18'),auth[_0xe078('0x8')](),controller[_0xe078('0x1e')]);module[_0xe078('0x1f')]=router; \ No newline at end of file +var _0xddf9=['/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers'];(function(_0x35e44f,_0x1e7bef){var _0x2f6d43=function(_0x5b14ca){while(--_0x5b14ca){_0x35e44f['push'](_0x35e44f['shift']());}};_0x2f6d43(++_0x1e7bef);}(_0xddf9,0x103));var _0x9ddf=function(_0xae1a83,_0x1980d4){_0xae1a83=_0xae1a83-0x0;var _0xdb9da8=_0xddf9[_0xae1a83];return _0xdb9da8;};'use strict';var multer=require('multer');var util=require(_0x9ddf('0x0'));var path=require('path');var timeout=require(_0x9ddf('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x9ddf('0x2'));var interaction=require(_0x9ddf('0x3'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x9ddf('0x4')]('/',auth[_0x9ddf('0x5')](),controller[_0x9ddf('0x6')]);router[_0x9ddf('0x4')](_0x9ddf('0x7'),auth[_0x9ddf('0x5')](),controller[_0x9ddf('0x8')]);router[_0x9ddf('0x4')](_0x9ddf('0x9'),auth[_0x9ddf('0x5')](),controller[_0x9ddf('0xa')]);router[_0x9ddf('0x4')](_0x9ddf('0xb'),auth[_0x9ddf('0x5')](),controller['getHopperHistories']);router[_0x9ddf('0x4')](_0x9ddf('0xc'),auth[_0x9ddf('0x5')](),controller['getHopperFinals']);router[_0x9ddf('0x4')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x9ddf('0xd')]);router[_0x9ddf('0x4')](_0x9ddf('0xe'),auth['isAuthenticated'](),controller[_0x9ddf('0xf')]);router['get'](_0x9ddf('0x10'),auth[_0x9ddf('0x5')](),controller[_0x9ddf('0x11')]);router[_0x9ddf('0x12')]('/',auth['isAuthenticated'](),controller[_0x9ddf('0x13')]);router[_0x9ddf('0x12')]('/:id/clone',auth[_0x9ddf('0x5')](),controller[_0x9ddf('0x14')]);router[_0x9ddf('0x12')](_0x9ddf('0xe'),auth[_0x9ddf('0x5')](),controller[_0x9ddf('0x15')]);router[_0x9ddf('0x12')](_0x9ddf('0x10'),auth['isAuthenticated'](),controller[_0x9ddf('0x16')]);router[_0x9ddf('0x17')](_0x9ddf('0x7'),auth[_0x9ddf('0x5')](),controller[_0x9ddf('0x18')]);router[_0x9ddf('0x19')](_0x9ddf('0x7'),auth[_0x9ddf('0x5')](),controller[_0x9ddf('0x1a')]);router[_0x9ddf('0x19')](_0x9ddf('0xe'),auth[_0x9ddf('0x5')](),controller[_0x9ddf('0x1b')]);router[_0x9ddf('0x19')](_0x9ddf('0x10'),auth[_0x9ddf('0x5')](),controller[_0x9ddf('0x1c')]);module[_0x9ddf('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 6f6ecda..8cd1e32 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 _0x43b1=['TEXT','getDataValue','key','sequelize','exports','STRING'];(function(_0x5662eb,_0x3fe0ec){var _0x4c7709=function(_0x2c053e){while(--_0x2c053e){_0x5662eb['push'](_0x5662eb['shift']());}};_0x4c7709(++_0x3fe0ec);}(_0x43b1,0x6f));var _0x143b=function(_0x5ad1f0,_0x409168){_0x5ad1f0=_0x5ad1f0-0x0;var _0x3734d7=_0x43b1[_0x5ad1f0];return _0x3734d7;};'use strict';var Sequelize=require(_0x143b('0x0'));module[_0x143b('0x1')]={'key':{'type':Sequelize[_0x143b('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x143b('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x143b('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x143b('0x4')](_0x143b('0x5'));}}}; \ No newline at end of file +var _0xdc66=['getDataValue','key','sequelize','exports','TEXT','STRING','VIRTUAL'];(function(_0xfb9aaa,_0x37935d){var _0x103bf7=function(_0x1e9f2a){while(--_0x1e9f2a){_0xfb9aaa['push'](_0xfb9aaa['shift']());}};_0x103bf7(++_0x37935d);}(_0xdc66,0x1c2));var _0x6dc6=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0xdc66[_0x4ed1d4];return _0x28e363;};'use strict';var Sequelize=require(_0x6dc6('0x0'));module[_0x6dc6('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x6dc6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6dc6('0x3')]},'name':{'type':Sequelize[_0x6dc6('0x4')],'get':function(){return this[_0x6dc6('0x5')](_0x6dc6('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 8d29316..7698a11 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 _0xde74=['findAll','rows','catch','params','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','jsforce','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','filter','where','map','type','VIRTUAL','merge','options','CannedAnswer','includeAll','include'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0xde74,0xc4));var _0x4de7=function(_0x19060b,_0x32049c){_0x19060b=_0x19060b-0x0;var _0x2b399c=_0xde74[_0x19060b];return _0x2b399c;};'use strict';var pdf=require(_0x4de7('0x0'));var emlformat=require(_0x4de7('0x1'));var rimraf=require(_0x4de7('0x2'));var zipdir=require(_0x4de7('0x3'));var jsonpatch=require(_0x4de7('0x4'));var rp=require(_0x4de7('0x5'));var moment=require(_0x4de7('0x6'));var BPromise=require(_0x4de7('0x7'));var Mustache=require(_0x4de7('0x8'));var util=require('util');var path=require('path');var sox=require(_0x4de7('0x9'));var csv=require('to-csv');var ejs=require(_0x4de7('0xa'));var fs=require('fs');var _=require(_0x4de7('0xb'));var squel=require(_0x4de7('0xc'));var crypto=require('crypto');var jsforce=require(_0x4de7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4de7('0xe'));var querystring=require(_0x4de7('0xf'));var Papa=require('papaparse');var authService=require(_0x4de7('0x10'));var hardwareService=require(_0x4de7('0x11'));var Redis=require(_0x4de7('0x12'));var qs=require(_0x4de7('0x13'));var logger=require(_0x4de7('0x14'))(_0x4de7('0x15'));var utils=require(_0x4de7('0x16'));var config=require(_0x4de7('0x17'));var db=require(_0x4de7('0x18'))['db'];function respondWithStatusCode(_0x34bbc0,_0x19e5d7){_0x19e5d7=_0x19e5d7||0xcc;return function(_0x42175e){if(_0x42175e){return _0x34bbc0[_0x4de7('0x19')](_0x19e5d7);}return _0x34bbc0[_0x4de7('0x1a')](_0x19e5d7)['end']();};}function respondWithResult(_0x5f21f6,_0x4d276b){_0x4d276b=_0x4d276b||0xc8;return function(_0x2cbb41){if(_0x2cbb41){return _0x5f21f6[_0x4de7('0x1a')](_0x4d276b)['json'](_0x2cbb41);}};}function respondWithFilteredResult(_0x5b1231,_0x2f10b7){return function(_0x4ca59a){if(_0x4ca59a){var _0x5512b3=_0x4ca59a[_0x4de7('0x1b')],_0x4aa013=_0x2f10b7[_0x4de7('0x1c')],_0x10f0fc=_0x2f10b7[_0x4de7('0x1c')]+_0x2f10b7[_0x4de7('0x1d')],_0x566db9;if(_0x10f0fc>=_0x5512b3){_0x10f0fc=_0x5512b3;_0x566db9=0xc8;}else{_0x566db9=0xce;}_0x5b1231[_0x4de7('0x1a')](_0x566db9);return _0x5b1231[_0x4de7('0x1e')](_0x4de7('0x1f'),_0x4aa013+'-'+_0x10f0fc+'/'+_0x5512b3)[_0x4de7('0x20')](_0x4ca59a);}return null;};}function patchUpdates(_0x32e67f){return function(_0x378777){try{jsonpatch[_0x4de7('0x21')](_0x378777,_0x32e67f,!![]);}catch(_0x240187){return BPromise['reject'](_0x240187);}return _0x378777[_0x4de7('0x22')]();};}function saveUpdates(_0x13f75f,_0xdb5c3f){return function(_0x41b76e){if(_0x41b76e){return _0x41b76e[_0x4de7('0x23')](_0x13f75f)[_0x4de7('0x24')](function(_0x1b843f){return _0x1b843f;});}return null;};}function removeEntity(_0x1234ba,_0xdd4f8){return function(_0x579539){if(_0x579539){return _0x579539[_0x4de7('0x25')]()[_0x4de7('0x24')](function(){var _0x3b08d9=_0x579539[_0x4de7('0x26')]({'plain':!![]});var _0x1c5f3d='CannedAnswers';return db[_0x4de7('0x27')][_0x4de7('0x25')]({'where':{'type':_0x1c5f3d,'resourceId':_0x3b08d9['id']}})['then'](function(){return _0x579539;});})[_0x4de7('0x24')](function(){_0x1234ba[_0x4de7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d82f2,_0x52f08d){return function(_0xf1496e){if(!_0xf1496e){_0x5d82f2[_0x4de7('0x19')](0x194);}return _0xf1496e;};}function handleError(_0x16ebcf,_0x8d621e){_0x8d621e=_0x8d621e||0x1f4;return function(_0x3e6c15){logger[_0x4de7('0x28')](_0x3e6c15[_0x4de7('0x29')]);if(_0x3e6c15['name']){delete _0x3e6c15[_0x4de7('0x2a')];}_0x16ebcf[_0x4de7('0x1a')](_0x8d621e)[_0x4de7('0x2b')](_0x3e6c15);};}exports[_0x4de7('0x2c')]=function(_0x258e31,_0x235df3){var _0x5dc9a2={},_0xd5cde7={},_0x234177={'count':0x0,'rows':[]};var _0x3674fc=db['CannedAnswer'][_0x4de7('0x2d')];_0xd5cde7[_0x4de7('0x2e')]=_[_0x4de7('0x2f')](_0x3674fc);_0xd5cde7['query']=_[_0x4de7('0x2f')](_0x258e31['query']);_0xd5cde7[_0x4de7('0x30')]=_[_0x4de7('0x31')](_0xd5cde7[_0x4de7('0x2e')],_0xd5cde7[_0x4de7('0x32')]);_0x5dc9a2[_0x4de7('0x33')]=_[_0x4de7('0x31')](_0xd5cde7[_0x4de7('0x2e')],qs[_0x4de7('0x34')](_0x258e31['query']['fields']));_0x5dc9a2[_0x4de7('0x33')]=_0x5dc9a2[_0x4de7('0x33')][_0x4de7('0x35')]?_0x5dc9a2[_0x4de7('0x33')]:_0xd5cde7[_0x4de7('0x2e')];if(!_0x258e31[_0x4de7('0x32')]['hasOwnProperty'](_0x4de7('0x36'))){_0x5dc9a2[_0x4de7('0x1d')]=qs[_0x4de7('0x1d')](_0x258e31[_0x4de7('0x32')][_0x4de7('0x1d')]);_0x5dc9a2[_0x4de7('0x1c')]=qs[_0x4de7('0x1c')](_0x258e31[_0x4de7('0x32')][_0x4de7('0x1c')]);}_0x5dc9a2[_0x4de7('0x37')]=qs[_0x4de7('0x38')](_0x258e31[_0x4de7('0x32')][_0x4de7('0x38')]);_0x5dc9a2['where']=qs[_0x4de7('0x30')](_[_0x4de7('0x39')](_0x258e31['query'],_0xd5cde7[_0x4de7('0x30')]));if(_0x258e31['query'][_0x4de7('0x3a')]){_0x5dc9a2[_0x4de7('0x3b')]=_['merge'](_0x5dc9a2['where'],{'$or':_[_0x4de7('0x3c')](_0x3674fc,function(_0x517aa6){if(_0x517aa6[_0x4de7('0x3d')]['key']!==_0x4de7('0x3e')){var _0x202c97={};_0x202c97[_0x517aa6['field']]={'$like':'%'+_0x258e31[_0x4de7('0x32')][_0x4de7('0x3a')]+'%'};return _0x202c97;}})});}_0x5dc9a2=_[_0x4de7('0x3f')]({},_0x5dc9a2,_0x258e31[_0x4de7('0x40')]);var _0x5959a1={'where':_0x5dc9a2[_0x4de7('0x3b')]};return db[_0x4de7('0x41')][_0x4de7('0x1b')](_0x5959a1)['then'](function(_0xcb6af2){_0x234177[_0x4de7('0x1b')]=_0xcb6af2;if(_0x258e31['query'][_0x4de7('0x42')]){_0x5dc9a2[_0x4de7('0x43')]=[{'all':!![]}];}return db[_0x4de7('0x41')][_0x4de7('0x44')](_0x5dc9a2);})[_0x4de7('0x24')](function(_0x59902b){_0x234177[_0x4de7('0x45')]=_0x59902b;return _0x234177;})['then'](respondWithFilteredResult(_0x235df3,_0x5dc9a2))[_0x4de7('0x46')](handleError(_0x235df3,null));};exports['show']=function(_0x5362fc,_0x2a8127){var _0x25a986={'raw':!![],'where':{'id':_0x5362fc[_0x4de7('0x47')]['id']}},_0x33b713={};_0x33b713['model']=_['keys'](db[_0x4de7('0x41')][_0x4de7('0x2d')]);_0x33b713[_0x4de7('0x32')]=_['keys'](_0x5362fc[_0x4de7('0x32')]);_0x33b713[_0x4de7('0x30')]=_[_0x4de7('0x31')](_0x33b713[_0x4de7('0x2e')],_0x33b713['query']);_0x25a986['attributes']=_[_0x4de7('0x31')](_0x33b713['model'],qs['fields'](_0x5362fc[_0x4de7('0x32')][_0x4de7('0x34')]));_0x25a986[_0x4de7('0x33')]=_0x25a986[_0x4de7('0x33')][_0x4de7('0x35')]?_0x25a986['attributes']:_0x33b713[_0x4de7('0x2e')];if(_0x5362fc[_0x4de7('0x32')][_0x4de7('0x42')]){_0x25a986[_0x4de7('0x43')]=[{'all':!![]}];}_0x25a986=_[_0x4de7('0x3f')]({},_0x25a986,_0x5362fc[_0x4de7('0x40')]);return db[_0x4de7('0x41')][_0x4de7('0x48')](_0x25a986)['then'](handleEntityNotFound(_0x2a8127,null))[_0x4de7('0x24')](respondWithResult(_0x2a8127,null))[_0x4de7('0x46')](handleError(_0x2a8127,null));};exports[_0x4de7('0x23')]=function(_0xc56898,_0x8afe6){if(_0xc56898[_0x4de7('0x49')]['id']){delete _0xc56898[_0x4de7('0x49')]['id'];}return db[_0x4de7('0x41')][_0x4de7('0x48')]({'where':{'id':_0xc56898['params']['id']}})[_0x4de7('0x24')](handleEntityNotFound(_0x8afe6,null))[_0x4de7('0x24')](saveUpdates(_0xc56898[_0x4de7('0x49')],null))['then'](respondWithResult(_0x8afe6,null))[_0x4de7('0x46')](handleError(_0x8afe6,null));};exports[_0x4de7('0x25')]=function(_0x17612f,_0x321bd3){return db[_0x4de7('0x41')][_0x4de7('0x48')]({'where':{'id':_0x17612f[_0x4de7('0x47')]['id']}})[_0x4de7('0x24')](handleEntityNotFound(_0x321bd3,null))['then'](removeEntity(_0x321bd3,null))[_0x4de7('0x46')](handleError(_0x321bd3,null));};exports[_0x4de7('0x4a')]=function(_0x2d14a9,_0x272613){var _0x63f32c={'key':_0x2d14a9[_0x4de7('0x49')][_0x4de7('0x4b')]};if(_0x2d14a9[_0x4de7('0x49')]['MailAccountId']){_0x63f32c['MailAccountId']=_0x2d14a9[_0x4de7('0x49')][_0x4de7('0x4c')];}else if(_0x2d14a9[_0x4de7('0x49')][_0x4de7('0x4d')]){_0x63f32c[_0x4de7('0x4d')]=_0x2d14a9['body'][_0x4de7('0x4d')];}else if(_0x2d14a9[_0x4de7('0x49')][_0x4de7('0x4e')]){_0x63f32c[_0x4de7('0x4e')]=_0x2d14a9['body'][_0x4de7('0x4e')];}else if(_0x2d14a9[_0x4de7('0x49')]['ChatWebsiteId']){_0x63f32c[_0x4de7('0x4f')]=_0x2d14a9[_0x4de7('0x49')][_0x4de7('0x4f')];}return db[_0x4de7('0x41')][_0x4de7('0x48')]({'where':_0x63f32c})[_0x4de7('0x24')](function(_0x2e2ac3){if(_0x2e2ac3){throw new db[(_0x4de7('0x50'))][(_0x4de7('0x51'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x4de7('0x41')][_0x4de7('0x4a')](_0x2d14a9[_0x4de7('0x49')]);})[_0x4de7('0x24')](function(_0x31f8ca){var _0x4c07e8=_0x2d14a9[_0x4de7('0x52')][_0x4de7('0x26')]({'plain':!![]});if(!_0x4c07e8)throw new Error(_0x4de7('0x53'));if(_0x4c07e8['role']==='user'){var _0x21e7d5=_0x31f8ca[_0x4de7('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x4de7('0x48')]({'where':{'name':_0x4de7('0x54'),'userProfileId':_0x4c07e8[_0x4de7('0x55')]},'raw':!![]})[_0x4de7('0x24')](function(_0x4b969c){if(_0x4b969c&&_0x4b969c[_0x4de7('0x56')]===0x0){return db[_0x4de7('0x27')][_0x4de7('0x4a')]({'name':_0x21e7d5[_0x4de7('0x2a')],'resourceId':_0x21e7d5['id'],'type':_0x4b969c[_0x4de7('0x2a')],'sectionId':_0x4b969c['id']},{})[_0x4de7('0x24')](function(){return _0x31f8ca;});}else{return _0x31f8ca;}})[_0x4de7('0x46')](function(_0x3ba08f){logger['error'](_0x4de7('0x57'),_0x3ba08f);throw _0x3ba08f;});}return _0x31f8ca;})[_0x4de7('0x24')](respondWithResult(_0x272613,0xc9))[_0x4de7('0x46')](handleError(_0x272613,null));}; \ No newline at end of file +var _0xc8e0=['sox','lodash','crypto','desk.js','to-csv','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','CannedAnswer','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x463fb7,_0x489f24){var _0x30b970=function(_0x45606e){while(--_0x45606e){_0x463fb7['push'](_0x463fb7['shift']());}};_0x30b970(++_0x489f24);}(_0xc8e0,0x1b0));var _0x0c8e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc8e0[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x0c8e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0c8e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c8e('0x2'));var rp=require(_0x0c8e('0x3'));var moment=require(_0x0c8e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0c8e('0x5'));var util=require(_0x0c8e('0x6'));var path=require(_0x0c8e('0x7'));var sox=require(_0x0c8e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0c8e('0x9'));var squel=require('squel');var crypto=require(_0x0c8e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0c8e('0xb'));var toCsv=require(_0x0c8e('0xc'));var querystring=require(_0x0c8e('0xd'));var Papa=require('papaparse');var authService=require(_0x0c8e('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x0c8e('0xf'));var qs=require(_0x0c8e('0x10'));var logger=require('../../config/logger')(_0x0c8e('0x11'));var utils=require(_0x0c8e('0x12'));var config=require(_0x0c8e('0x13'));var db=require(_0x0c8e('0x14'))['db'];function respondWithStatusCode(_0x2c582a,_0x42a233){_0x42a233=_0x42a233||0xcc;return function(_0x58bff0){if(_0x58bff0){return _0x2c582a[_0x0c8e('0x15')](_0x42a233);}return _0x2c582a[_0x0c8e('0x16')](_0x42a233)[_0x0c8e('0x17')]();};}function respondWithResult(_0x57ac57,_0x38bf65){_0x38bf65=_0x38bf65||0xc8;return function(_0xf532e7){if(_0xf532e7){return _0x57ac57['status'](_0x38bf65)[_0x0c8e('0x18')](_0xf532e7);}};}function respondWithFilteredResult(_0x2d909f,_0x19db79){return function(_0x5f2339){if(_0x5f2339){var _0x875d5d=_0x5f2339[_0x0c8e('0x19')],_0x3501c2=_0x19db79['offset'],_0x666bd=_0x19db79['offset']+_0x19db79[_0x0c8e('0x1a')],_0x40aece;if(_0x666bd>=_0x875d5d){_0x666bd=_0x875d5d;_0x40aece=0xc8;}else{_0x40aece=0xce;}_0x2d909f['status'](_0x40aece);return _0x2d909f[_0x0c8e('0x1b')](_0x0c8e('0x1c'),_0x3501c2+'-'+_0x666bd+'/'+_0x875d5d)[_0x0c8e('0x18')](_0x5f2339);}return null;};}function patchUpdates(_0x2a78e0){return function(_0x5ccd54){try{jsonpatch['apply'](_0x5ccd54,_0x2a78e0,!![]);}catch(_0x5b7605){return BPromise[_0x0c8e('0x1d')](_0x5b7605);}return _0x5ccd54[_0x0c8e('0x1e')]();};}function saveUpdates(_0x218322,_0x559ef0){return function(_0x3d9ba2){if(_0x3d9ba2){return _0x3d9ba2['update'](_0x218322)[_0x0c8e('0x1f')](function(_0x5cd852){return _0x5cd852;});}return null;};}function removeEntity(_0x231882,_0x211872){return function(_0x5df4db){if(_0x5df4db){return _0x5df4db[_0x0c8e('0x20')]()[_0x0c8e('0x1f')](function(){var _0x3ba9ab=_0x5df4db[_0x0c8e('0x21')]({'plain':!![]});var _0x162b9a='CannedAnswers';return db[_0x0c8e('0x22')][_0x0c8e('0x20')]({'where':{'type':_0x162b9a,'resourceId':_0x3ba9ab['id']}})[_0x0c8e('0x1f')](function(){return _0x5df4db;});})[_0x0c8e('0x1f')](function(){_0x231882[_0x0c8e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56958b,_0x272cc8){return function(_0x183377){if(!_0x183377){_0x56958b[_0x0c8e('0x15')](0x194);}return _0x183377;};}function handleError(_0x3b97cd,_0x57f449){_0x57f449=_0x57f449||0x1f4;return function(_0x497df0){logger[_0x0c8e('0x23')](_0x497df0[_0x0c8e('0x24')]);if(_0x497df0[_0x0c8e('0x25')]){delete _0x497df0['name'];}_0x3b97cd[_0x0c8e('0x16')](_0x57f449)[_0x0c8e('0x26')](_0x497df0);};}exports[_0x0c8e('0x27')]=function(_0x15256e,_0x174a49){var _0x2e364b={},_0x28c994={},_0x1421b9={'count':0x0,'rows':[]};var _0x55556c=db[_0x0c8e('0x28')][_0x0c8e('0x29')];_0x28c994[_0x0c8e('0x2a')]=_[_0x0c8e('0x2b')](_0x55556c);_0x28c994[_0x0c8e('0x2c')]=_[_0x0c8e('0x2b')](_0x15256e[_0x0c8e('0x2c')]);_0x28c994[_0x0c8e('0x2d')]=_[_0x0c8e('0x2e')](_0x28c994[_0x0c8e('0x2a')],_0x28c994[_0x0c8e('0x2c')]);_0x2e364b['attributes']=_['intersection'](_0x28c994[_0x0c8e('0x2a')],qs[_0x0c8e('0x2f')](_0x15256e[_0x0c8e('0x2c')]['fields']));_0x2e364b[_0x0c8e('0x30')]=_0x2e364b[_0x0c8e('0x30')]['length']?_0x2e364b[_0x0c8e('0x30')]:_0x28c994[_0x0c8e('0x2a')];if(!_0x15256e['query'][_0x0c8e('0x31')](_0x0c8e('0x32'))){_0x2e364b[_0x0c8e('0x1a')]=qs[_0x0c8e('0x1a')](_0x15256e[_0x0c8e('0x2c')][_0x0c8e('0x1a')]);_0x2e364b[_0x0c8e('0x33')]=qs[_0x0c8e('0x33')](_0x15256e['query'][_0x0c8e('0x33')]);}_0x2e364b['order']=qs[_0x0c8e('0x34')](_0x15256e[_0x0c8e('0x2c')][_0x0c8e('0x34')]);_0x2e364b[_0x0c8e('0x35')]=qs[_0x0c8e('0x2d')](_[_0x0c8e('0x36')](_0x15256e[_0x0c8e('0x2c')],_0x28c994['filters']));if(_0x15256e[_0x0c8e('0x2c')]['filter']){_0x2e364b[_0x0c8e('0x35')]=_[_0x0c8e('0x37')](_0x2e364b[_0x0c8e('0x35')],{'$or':_[_0x0c8e('0x38')](_0x55556c,function(_0x45d1e6){if(_0x45d1e6[_0x0c8e('0x39')][_0x0c8e('0x3a')]!==_0x0c8e('0x3b')){var _0x580f7b={};_0x580f7b[_0x45d1e6['field']]={'$like':'%'+_0x15256e[_0x0c8e('0x2c')][_0x0c8e('0x3c')]+'%'};return _0x580f7b;}})});}_0x2e364b=_[_0x0c8e('0x37')]({},_0x2e364b,_0x15256e[_0x0c8e('0x3d')]);var _0x1c3b83={'where':_0x2e364b[_0x0c8e('0x35')]};return db[_0x0c8e('0x28')][_0x0c8e('0x19')](_0x1c3b83)[_0x0c8e('0x1f')](function(_0x21be32){_0x1421b9[_0x0c8e('0x19')]=_0x21be32;if(_0x15256e['query'][_0x0c8e('0x3e')]){_0x2e364b[_0x0c8e('0x3f')]=[{'all':!![]}];}return db[_0x0c8e('0x28')][_0x0c8e('0x40')](_0x2e364b);})['then'](function(_0x4c6e8c){_0x1421b9[_0x0c8e('0x41')]=_0x4c6e8c;return _0x1421b9;})['then'](respondWithFilteredResult(_0x174a49,_0x2e364b))[_0x0c8e('0x42')](handleError(_0x174a49,null));};exports[_0x0c8e('0x43')]=function(_0x927b1d,_0x472f6e){var _0x53c4d1={'raw':!![],'where':{'id':_0x927b1d[_0x0c8e('0x44')]['id']}},_0x951e12={};_0x951e12['model']=_[_0x0c8e('0x2b')](db[_0x0c8e('0x28')][_0x0c8e('0x29')]);_0x951e12[_0x0c8e('0x2c')]=_[_0x0c8e('0x2b')](_0x927b1d[_0x0c8e('0x2c')]);_0x951e12[_0x0c8e('0x2d')]=_['intersection'](_0x951e12[_0x0c8e('0x2a')],_0x951e12[_0x0c8e('0x2c')]);_0x53c4d1[_0x0c8e('0x30')]=_['intersection'](_0x951e12['model'],qs['fields'](_0x927b1d[_0x0c8e('0x2c')][_0x0c8e('0x2f')]));_0x53c4d1[_0x0c8e('0x30')]=_0x53c4d1[_0x0c8e('0x30')][_0x0c8e('0x45')]?_0x53c4d1[_0x0c8e('0x30')]:_0x951e12[_0x0c8e('0x2a')];if(_0x927b1d[_0x0c8e('0x2c')]['includeAll']){_0x53c4d1[_0x0c8e('0x3f')]=[{'all':!![]}];}_0x53c4d1=_[_0x0c8e('0x37')]({},_0x53c4d1,_0x927b1d[_0x0c8e('0x3d')]);return db[_0x0c8e('0x28')][_0x0c8e('0x46')](_0x53c4d1)['then'](handleEntityNotFound(_0x472f6e,null))[_0x0c8e('0x1f')](respondWithResult(_0x472f6e,null))[_0x0c8e('0x42')](handleError(_0x472f6e,null));};exports[_0x0c8e('0x47')]=function(_0x262881,_0x4eb41f){if(_0x262881[_0x0c8e('0x48')]['id']){delete _0x262881[_0x0c8e('0x48')]['id'];}return db['CannedAnswer'][_0x0c8e('0x46')]({'where':{'id':_0x262881[_0x0c8e('0x44')]['id']}})[_0x0c8e('0x1f')](handleEntityNotFound(_0x4eb41f,null))['then'](saveUpdates(_0x262881['body'],null))[_0x0c8e('0x1f')](respondWithResult(_0x4eb41f,null))[_0x0c8e('0x42')](handleError(_0x4eb41f,null));};exports[_0x0c8e('0x20')]=function(_0xc5fa56,_0x1f06e4){return db[_0x0c8e('0x28')][_0x0c8e('0x46')]({'where':{'id':_0xc5fa56[_0x0c8e('0x44')]['id']}})[_0x0c8e('0x1f')](handleEntityNotFound(_0x1f06e4,null))['then'](removeEntity(_0x1f06e4,null))[_0x0c8e('0x42')](handleError(_0x1f06e4,null));};exports[_0x0c8e('0x49')]=function(_0x11da01,_0x2eade5){var _0x59e48f={'key':_0x11da01[_0x0c8e('0x48')][_0x0c8e('0x3a')]};if(_0x11da01[_0x0c8e('0x48')][_0x0c8e('0x4a')]){_0x59e48f[_0x0c8e('0x4a')]=_0x11da01[_0x0c8e('0x48')][_0x0c8e('0x4a')];}else if(_0x11da01['body']['SmsAccountId']){_0x59e48f[_0x0c8e('0x4b')]=_0x11da01[_0x0c8e('0x48')]['SmsAccountId'];}else if(_0x11da01['body'][_0x0c8e('0x4c')]){_0x59e48f[_0x0c8e('0x4c')]=_0x11da01['body']['OpenchannelAccountId'];}else if(_0x11da01[_0x0c8e('0x48')][_0x0c8e('0x4d')]){_0x59e48f[_0x0c8e('0x4d')]=_0x11da01[_0x0c8e('0x48')][_0x0c8e('0x4d')];}return db[_0x0c8e('0x28')][_0x0c8e('0x46')]({'where':_0x59e48f})[_0x0c8e('0x1f')](function(_0x4985ae){if(_0x4985ae){throw new db[(_0x0c8e('0x4e'))][(_0x0c8e('0x4f'))](_0x0c8e('0x50'));}return db['CannedAnswer']['create'](_0x11da01['body']);})[_0x0c8e('0x1f')](function(_0x296710){var _0x55148b=_0x11da01['user']['get']({'plain':!![]});if(!_0x55148b)throw new Error(_0x0c8e('0x51'));if(_0x55148b[_0x0c8e('0x52')]===_0x0c8e('0x53')){var _0x3775d2=_0x296710['get']({'plain':!![]});return db[_0x0c8e('0x54')][_0x0c8e('0x46')]({'where':{'name':_0x0c8e('0x55'),'userProfileId':_0x55148b[_0x0c8e('0x56')]},'raw':!![]})[_0x0c8e('0x1f')](function(_0x416fa7){if(_0x416fa7&&_0x416fa7['autoAssociation']===0x0){return db[_0x0c8e('0x22')][_0x0c8e('0x49')]({'name':_0x3775d2[_0x0c8e('0x25')],'resourceId':_0x3775d2['id'],'type':_0x416fa7[_0x0c8e('0x25')],'sectionId':_0x416fa7['id']},{})[_0x0c8e('0x1f')](function(){return _0x296710;});}else{return _0x296710;}})[_0x0c8e('0x42')](function(_0x30bbd7){logger['error'](_0x0c8e('0x57'),_0x30bbd7);throw _0x30bbd7;});}return _0x296710;})[_0x0c8e('0x1f')](respondWithResult(_0x2eade5,0xc9))[_0x0c8e('0x42')](handleError(_0x2eade5,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index d588015..dbf7f6e 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 _0x5b11=['define','tools_canned_answers','../../config/logger','api','request-promise','exports'];(function(_0x3567a3,_0x197da1){var _0x1917ef=function(_0x14fb57){while(--_0x14fb57){_0x3567a3['push'](_0x3567a3['shift']());}};_0x1917ef(++_0x197da1);}(_0x5b11,0xaa));var _0x15b1=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x5b11[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x15b1('0x0'))(_0x15b1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x15b1('0x2'));var attributes=require('./cannedAnswer.attributes');module[_0x15b1('0x3')]=function(_0x7f1f16,_0x4b76db){return _0x7f1f16[_0x15b1('0x4')]('CannedAnswer',attributes,{'tableName':_0x15b1('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03cb=['tools_canned_answers','lodash','util','../../config/logger','bluebird','request-promise','./cannedAnswer.attributes','exports','define'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x03cb,0x145));var _0xb03c=function(_0x5c2af6,_0x8cd224){_0x5c2af6=_0x5c2af6-0x0;var _0x4a9f74=_0x03cb[_0x5c2af6];return _0x4a9f74;};'use strict';var _=require(_0xb03c('0x0'));var util=require(_0xb03c('0x1'));var logger=require(_0xb03c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb03c('0x3'));var rp=require(_0xb03c('0x4'));var attributes=require(_0xb03c('0x5'));module[_0xb03c('0x6')]=function(_0x46b16d,_0x5613c0){return _0x46b16d[_0xb03c('0x7')]('CannedAnswer',attributes,{'tableName':_0xb03c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 21d04fe..b8fcc56 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 _0xf847=['request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CannedAnswer,\x20%s,\x20%s'];(function(_0x1a3d07,_0x105a71){var _0xd0058a=function(_0x213e53){while(--_0x213e53){_0x1a3d07['push'](_0x1a3d07['shift']());}};_0xd0058a(++_0x105a71);}(_0xf847,0xee));var _0x7f84=function(_0x432110,_0x80fd11){_0x432110=_0x432110-0x0;var _0x35ea8b=_0xf847[_0x432110];return _0x35ea8b;};'use strict';var _=require('lodash');var util=require(_0x7f84('0x0'));var moment=require(_0x7f84('0x1'));var BPromise=require(_0x7f84('0x2'));var rs=require(_0x7f84('0x3'));var fs=require('fs');var Redis=require(_0x7f84('0x4'));var db=require(_0x7f84('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f84('0x6'))(_0x7f84('0x7'));var config=require(_0x7f84('0x8'));var jayson=require(_0x7f84('0x9'));var client=jayson[_0x7f84('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bd958,_0x134f61,_0x583bb8){return new BPromise(function(_0x4c4368,_0x298e7e){return client[_0x7f84('0xb')](_0x5bd958,_0x583bb8)[_0x7f84('0xc')](function(_0x490146){logger['info'](_0x7f84('0xd'),_0x134f61,_0x7f84('0xe'));logger['debug']('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x134f61,_0x7f84('0xe'),JSON[_0x7f84('0xf')](_0x490146));if(_0x490146[_0x7f84('0x10')]){if(_0x490146[_0x7f84('0x10')][_0x7f84('0x11')]===0x1f4){logger[_0x7f84('0x10')]('CannedAnswer,\x20%s,\x20%s',_0x134f61,_0x490146[_0x7f84('0x10')]['message']);return _0x298e7e(_0x490146[_0x7f84('0x10')]['message']);}logger[_0x7f84('0x10')]('CannedAnswer,\x20%s,\x20%s',_0x134f61,_0x490146['error']['message']);return _0x4c4368(_0x490146[_0x7f84('0x10')][_0x7f84('0x12')]);}else{logger['info']('CannedAnswer,\x20%s,\x20%s',_0x134f61,_0x7f84('0xe'));_0x4c4368(_0x490146[_0x7f84('0x13')][_0x7f84('0x12')]);}})[_0x7f84('0x14')](function(_0x1db24e){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x134f61,_0x1db24e);_0x298e7e(_0x1db24e);});});} \ No newline at end of file +var _0x9dbb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x424568,_0x5982f4){var _0x9aed1b=function(_0x206086){while(--_0x206086){_0x424568['push'](_0x424568['shift']());}};_0x9aed1b(++_0x5982f4);}(_0x9dbb,0xbe));var _0xb9db=function(_0x3e6ead,_0x61f91a){_0x3e6ead=_0x3e6ead-0x0;var _0x28f590=_0x9dbb[_0x3e6ead];return _0x28f590;};'use strict';var _=require(_0xb9db('0x0'));var util=require(_0xb9db('0x1'));var moment=require(_0xb9db('0x2'));var BPromise=require(_0xb9db('0x3'));var rs=require(_0xb9db('0x4'));var fs=require('fs');var Redis=require(_0xb9db('0x5'));var db=require(_0xb9db('0x6'))['db'];var utils=require(_0xb9db('0x7'));var logger=require('../../config/logger')(_0xb9db('0x8'));var config=require(_0xb9db('0x9'));var jayson=require(_0xb9db('0xa'));var client=jayson[_0xb9db('0xb')][_0xb9db('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c12bd,_0x485349,_0x1ca775){return new BPromise(function(_0x46c767,_0x43f733){return client['request'](_0x4c12bd,_0x1ca775)[_0xb9db('0xd')](function(_0x36c09d){logger[_0xb9db('0xe')](_0xb9db('0xf'),_0x485349,_0xb9db('0x10'));logger[_0xb9db('0x11')](_0xb9db('0x12'),_0x485349,'request\x20sent',JSON['stringify'](_0x36c09d));if(_0x36c09d[_0xb9db('0x13')]){if(_0x36c09d['error'][_0xb9db('0x14')]===0x1f4){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x485349,_0x36c09d['error'][_0xb9db('0x15')]);return _0x43f733(_0x36c09d['error']['message']);}logger[_0xb9db('0x13')](_0xb9db('0xf'),_0x485349,_0x36c09d[_0xb9db('0x13')][_0xb9db('0x15')]);return _0x46c767(_0x36c09d[_0xb9db('0x13')][_0xb9db('0x15')]);}else{logger['info'](_0xb9db('0xf'),_0x485349,'request\x20sent');_0x46c767(_0x36c09d[_0xb9db('0x16')][_0xb9db('0x15')]);}})[_0xb9db('0x17')](function(_0x2bc873){logger[_0xb9db('0x13')](_0xb9db('0xf'),_0x485349,_0x2bc873);_0x43f733(_0x2bc873);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index a2cf989..07d31d4 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 _0xa936=['put','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x581d55,_0x93d237){var _0x5179a7=function(_0xd89b7){while(--_0xd89b7){_0x581d55['push'](_0x581d55['shift']());}};_0x5179a7(++_0x93d237);}(_0xa936,0x99));var _0x6a93=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xa936[_0x5c2e3e];return _0x53f64a;};'use strict';var multer=require('multer');var util=require(_0x6a93('0x0'));var path=require('path');var timeout=require(_0x6a93('0x1'));var express=require(_0x6a93('0x2'));var router=express[_0x6a93('0x3')]();var auth=require(_0x6a93('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6a93('0x5'));router[_0x6a93('0x6')]('/',auth[_0x6a93('0x7')](),controller['index']);router['get'](_0x6a93('0x8'),auth[_0x6a93('0x7')](),controller[_0x6a93('0x9')]);router[_0x6a93('0xa')]('/',auth['isAuthenticated'](),controller[_0x6a93('0xb')]);router[_0x6a93('0xc')](_0x6a93('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6a93('0x8'),auth[_0x6a93('0x7')](),controller[_0x6a93('0xd')]);module[_0x6a93('0xe')]=router; \ No newline at end of file +var _0x3edc=['isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x1263c1,_0x287a24){_0x1263c1=_0x1263c1-0x0;var _0x59639e=_0x3edc[_0x1263c1];return _0x59639e;};'use strict';var multer=require(_0xc3ed('0x0'));var util=require(_0xc3ed('0x1'));var path=require(_0xc3ed('0x2'));var timeout=require(_0xc3ed('0x3'));var express=require(_0xc3ed('0x4'));var router=express[_0xc3ed('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc3ed('0x6'));var config=require(_0xc3ed('0x7'));var controller=require(_0xc3ed('0x8'));router[_0xc3ed('0x9')]('/',auth[_0xc3ed('0xa')](),controller[_0xc3ed('0xb')]);router[_0xc3ed('0x9')](_0xc3ed('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xc3ed('0xd')]('/',auth[_0xc3ed('0xa')](),controller[_0xc3ed('0xe')]);router[_0xc3ed('0xf')](_0xc3ed('0xc'),auth[_0xc3ed('0xa')](),controller[_0xc3ed('0x10')]);router[_0xc3ed('0x11')]('/:id',auth[_0xc3ed('0xa')](),controller[_0xc3ed('0x12')]);module[_0xc3ed('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index be7c16d..dbeca58 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 _0x7821=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0x7821,0x85));var _0x1782=function(_0x1b9cd5,_0x103dc4){_0x1b9cd5=_0x1b9cd5-0x0;var _0x4c74ca=_0x7821[_0x1b9cd5];return _0x4c74ca;};'use strict';var Sequelize=require(_0x1782('0x0'));module[_0x1782('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x1782('0x2')},'clid':{'type':Sequelize[_0x1782('0x3')]},'src':{'type':Sequelize[_0x1782('0x3')]},'dst':{'type':Sequelize[_0x1782('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1782('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x1782('0x3')]},'lastdata':{'type':Sequelize[_0x1782('0x3')]},'duration':{'type':Sequelize[_0x1782('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1782('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1782('0x3')]},'amaflags':{'type':Sequelize[_0x1782('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1782('0x3')]},'userfield':{'type':Sequelize[_0x1782('0x3')]},'uniqueid':{'type':Sequelize[_0x1782('0x3')]},'linkedid':{'type':Sequelize[_0x1782('0x3')]},'sequence':{'type':Sequelize[_0x1782('0x3')]},'peeraccount':{'type':Sequelize[_0x1782('0x3')]},'type':{'type':Sequelize[_0x1782('0x3')]},'tag':{'type':Sequelize[_0x1782('0x3')]}}; \ No newline at end of file +var _0x5afb=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x5afb,0x14e));var _0xb5af=function(_0xe59cff,_0x1a7dbe){_0xe59cff=_0xe59cff-0x0;var _0x26e8c1=_0x5afb[_0xe59cff];return _0x26e8c1;};'use strict';var Sequelize=require(_0xb5af('0x0'));module[_0xb5af('0x1')]={'calldate':{'type':Sequelize[_0xb5af('0x2')],'allowNull':![],'defaultValue':_0xb5af('0x3')},'clid':{'type':Sequelize[_0xb5af('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xb5af('0x4')]},'dcontext':{'type':Sequelize[_0xb5af('0x4')]},'channel':{'type':Sequelize[_0xb5af('0x4')]},'dstchannel':{'type':Sequelize[_0xb5af('0x4')]},'lastapp':{'type':Sequelize[_0xb5af('0x4')]},'lastdata':{'type':Sequelize[_0xb5af('0x4')]},'duration':{'type':Sequelize[_0xb5af('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb5af('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb5af('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb5af('0x4')]},'userfield':{'type':Sequelize[_0xb5af('0x4')]},'uniqueid':{'type':Sequelize[_0xb5af('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xb5af('0x4')]},'peeraccount':{'type':Sequelize[_0xb5af('0x4')]},'type':{'type':Sequelize[_0xb5af('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 61a3b15..24dfad3 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 _0x1152=['../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','save','update','then','destroy','stack','Cdr','rawAttributes','keys','query','filters','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','merge','type','key','VIRTUAL','field','filter','options','include','findAll','rows','catch','params','intersection','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x57c333,_0x27958e){var _0x223a21=function(_0x100cf9){while(--_0x100cf9){_0x57c333['push'](_0x57c333['shift']());}};_0x223a21(++_0x27958e);}(_0x1152,0x194));var _0x2115=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x1152[_0x401676];return _0x4f13fe;};'use strict';var pdf=require(_0x2115('0x0'));var emlformat=require(_0x2115('0x1'));var rimraf=require(_0x2115('0x2'));var zipdir=require(_0x2115('0x3'));var jsonpatch=require(_0x2115('0x4'));var rp=require('request-promise');var moment=require(_0x2115('0x5'));var BPromise=require(_0x2115('0x6'));var Mustache=require(_0x2115('0x7'));var util=require(_0x2115('0x8'));var path=require('path');var sox=require(_0x2115('0x9'));var csv=require(_0x2115('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2115('0xb'));var crypto=require('crypto');var jsforce=require(_0x2115('0xc'));var deskjs=require(_0x2115('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2115('0xe'));var Papa=require(_0x2115('0xf'));var authService=require(_0x2115('0x10'));var hardwareService=require(_0x2115('0x11'));var Redis=require(_0x2115('0x12'));var qs=require(_0x2115('0x13'));var logger=require(_0x2115('0x14'))(_0x2115('0x15'));var utils=require(_0x2115('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39a63a,_0x5c33c2){_0x5c33c2=_0x5c33c2||0xcc;return function(_0x258d11){if(_0x258d11){return _0x39a63a[_0x2115('0x17')](_0x5c33c2);}return _0x39a63a['status'](_0x5c33c2)[_0x2115('0x18')]();};}function respondWithResult(_0x24b8d5,_0x618cca){_0x618cca=_0x618cca||0xc8;return function(_0x355712){if(_0x355712){return _0x24b8d5['status'](_0x618cca)['json'](_0x355712);}};}function respondWithFilteredResult(_0x2cd79a,_0x3fddee){return function(_0x4a39d1){if(_0x4a39d1){var _0xd2f1c2=_0x4a39d1[_0x2115('0x19')],_0x235473=_0x3fddee[_0x2115('0x1a')],_0xa8b86f=_0x3fddee['offset']+_0x3fddee[_0x2115('0x1b')],_0x37d931;if(_0xa8b86f>=_0xd2f1c2){_0xa8b86f=_0xd2f1c2;_0x37d931=0xc8;}else{_0x37d931=0xce;}_0x2cd79a[_0x2115('0x1c')](_0x37d931);return _0x2cd79a[_0x2115('0x1d')](_0x2115('0x1e'),_0x235473+'-'+_0xa8b86f+'/'+_0xd2f1c2)[_0x2115('0x1f')](_0x4a39d1);}return null;};}function patchUpdates(_0x2e5475){return function(_0x573c0e){try{jsonpatch[_0x2115('0x20')](_0x573c0e,_0x2e5475,!![]);}catch(_0x414c5c){return BPromise['reject'](_0x414c5c);}return _0x573c0e[_0x2115('0x21')]();};}function saveUpdates(_0x1db6dc,_0x339e9f){return function(_0x4de039){if(_0x4de039){return _0x4de039[_0x2115('0x22')](_0x1db6dc)[_0x2115('0x23')](function(_0x1f992e){return _0x1f992e;});}return null;};}function removeEntity(_0xc88814,_0x395234){return function(_0x2a3912){if(_0x2a3912){return _0x2a3912[_0x2115('0x24')]()[_0x2115('0x23')](function(){_0xc88814[_0x2115('0x1c')](0xcc)[_0x2115('0x18')]();});}};}function handleEntityNotFound(_0x57ab9f,_0xdd61ab){return function(_0x59c4a9){if(!_0x59c4a9){_0x57ab9f[_0x2115('0x17')](0x194);}return _0x59c4a9;};}function handleError(_0x32ab16,_0x405e16){_0x405e16=_0x405e16||0x1f4;return function(_0x3c9eb8){logger['error'](_0x3c9eb8[_0x2115('0x25')]);if(_0x3c9eb8['name']){delete _0x3c9eb8['name'];}_0x32ab16[_0x2115('0x1c')](_0x405e16)['send'](_0x3c9eb8);};}exports['index']=function(_0x5acbcc,_0x3eda29){var _0x56d268={},_0x4715b0={},_0x379d9b={'count':0x0,'rows':[]};var _0xbe019c=db[_0x2115('0x26')][_0x2115('0x27')];_0x4715b0['model']=_[_0x2115('0x28')](_0xbe019c);_0x4715b0[_0x2115('0x29')]=_[_0x2115('0x28')](_0x5acbcc['query']);_0x4715b0[_0x2115('0x2a')]=_['intersection'](_0x4715b0['model'],_0x4715b0['query']);_0x56d268[_0x2115('0x2b')]=_['intersection'](_0x4715b0['model'],qs[_0x2115('0x2c')](_0x5acbcc[_0x2115('0x29')][_0x2115('0x2c')]));_0x56d268[_0x2115('0x2b')]=_0x56d268[_0x2115('0x2b')][_0x2115('0x2d')]?_0x56d268[_0x2115('0x2b')]:_0x4715b0[_0x2115('0x2e')];if(!_0x5acbcc['query'][_0x2115('0x2f')](_0x2115('0x30'))){_0x56d268['limit']=qs[_0x2115('0x1b')](_0x5acbcc[_0x2115('0x29')][_0x2115('0x1b')]);_0x56d268[_0x2115('0x1a')]=qs['offset'](_0x5acbcc[_0x2115('0x29')][_0x2115('0x1a')]);}_0x56d268[_0x2115('0x31')]=qs[_0x2115('0x32')](_0x5acbcc[_0x2115('0x29')][_0x2115('0x32')]);_0x56d268[_0x2115('0x33')]=qs[_0x2115('0x2a')](_['pick'](_0x5acbcc[_0x2115('0x29')],_0x4715b0['filters']));if(_0x5acbcc[_0x2115('0x29')]['filter']){_0x56d268['where']=_[_0x2115('0x34')](_0x56d268[_0x2115('0x33')],{'$or':_['map'](_0xbe019c,function(_0x4895fa){if(_0x4895fa[_0x2115('0x35')][_0x2115('0x36')]!==_0x2115('0x37')){var _0x7e6a5f={};_0x7e6a5f[_0x4895fa[_0x2115('0x38')]]={'$like':'%'+_0x5acbcc[_0x2115('0x29')][_0x2115('0x39')]+'%'};return _0x7e6a5f;}})});}_0x56d268=_[_0x2115('0x34')]({},_0x56d268,_0x5acbcc[_0x2115('0x3a')]);var _0x51c5a7={'where':_0x56d268[_0x2115('0x33')]};return db[_0x2115('0x26')][_0x2115('0x19')](_0x51c5a7)['then'](function(_0x1b5c18){_0x379d9b[_0x2115('0x19')]=_0x1b5c18;if(_0x5acbcc[_0x2115('0x29')]['includeAll']){_0x56d268[_0x2115('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0x2115('0x3c')](_0x56d268);})[_0x2115('0x23')](function(_0x5a16b8){_0x379d9b[_0x2115('0x3d')]=_0x5a16b8;return _0x379d9b;})[_0x2115('0x23')](respondWithFilteredResult(_0x3eda29,_0x56d268))[_0x2115('0x3e')](handleError(_0x3eda29,null));};exports['show']=function(_0x231691,_0x1752dd){var _0x5c5a56={'raw':!![],'where':{'id':_0x231691[_0x2115('0x3f')]['id']}},_0x49a0ee={};_0x49a0ee['model']=_['keys'](db[_0x2115('0x26')][_0x2115('0x27')]);_0x49a0ee[_0x2115('0x29')]=_[_0x2115('0x28')](_0x231691['query']);_0x49a0ee['filters']=_[_0x2115('0x40')](_0x49a0ee['model'],_0x49a0ee[_0x2115('0x29')]);_0x5c5a56['attributes']=_['intersection'](_0x49a0ee[_0x2115('0x2e')],qs[_0x2115('0x2c')](_0x231691[_0x2115('0x29')][_0x2115('0x2c')]));_0x5c5a56[_0x2115('0x2b')]=_0x5c5a56['attributes'][_0x2115('0x2d')]?_0x5c5a56[_0x2115('0x2b')]:_0x49a0ee[_0x2115('0x2e')];if(_0x231691['query'][_0x2115('0x41')]){_0x5c5a56[_0x2115('0x3b')]=[{'all':!![]}];}_0x5c5a56=_['merge']({},_0x5c5a56,_0x231691[_0x2115('0x3a')]);return db[_0x2115('0x26')][_0x2115('0x42')](_0x5c5a56)[_0x2115('0x23')](handleEntityNotFound(_0x1752dd,null))[_0x2115('0x23')](respondWithResult(_0x1752dd,null))['catch'](handleError(_0x1752dd,null));};exports[_0x2115('0x43')]=function(_0x5d71f9,_0xb62e14){return db[_0x2115('0x26')][_0x2115('0x43')](_0x5d71f9[_0x2115('0x44')],{})[_0x2115('0x23')](respondWithResult(_0xb62e14,0xc9))[_0x2115('0x3e')](handleError(_0xb62e14,null));};exports['update']=function(_0x46e59a,_0x4fc846){if(_0x46e59a[_0x2115('0x44')]['id']){delete _0x46e59a[_0x2115('0x44')]['id'];}return db[_0x2115('0x26')][_0x2115('0x42')]({'where':{'id':_0x46e59a[_0x2115('0x3f')]['id']}})[_0x2115('0x23')](handleEntityNotFound(_0x4fc846,null))[_0x2115('0x23')](saveUpdates(_0x46e59a[_0x2115('0x44')],null))['then'](respondWithResult(_0x4fc846,null))[_0x2115('0x3e')](handleError(_0x4fc846,null));};exports[_0x2115('0x24')]=function(_0x33ec71,_0x48dccf){return db[_0x2115('0x26')][_0x2115('0x42')]({'where':{'id':_0x33ec71[_0x2115('0x3f')]['id']}})[_0x2115('0x23')](handleEntityNotFound(_0x48dccf,null))[_0x2115('0x23')](removeEntity(_0x48dccf,null))[_0x2115('0x3e')](handleError(_0x48dccf,null));};exports['describe']=function(_0x326643,_0x2d81c0){return db[_0x2115('0x26')][_0x2115('0x45')]()[_0x2115('0x23')](respondWithResult(_0x2d81c0,null))['catch'](handleError(_0x2d81c0,null));}; \ No newline at end of file +var _0x865e=['sort','where','pick','filters','filter','merge','map','type','VIRTUAL','field','includeAll','include','catch','show','length','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','Cdr','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','limit','order'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x865e,0xa7));var _0xe865=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x865e[_0x47fd36];return _0x21a0fc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe865('0x0'));var rimraf=require(_0xe865('0x1'));var zipdir=require(_0xe865('0x2'));var jsonpatch=require(_0xe865('0x3'));var rp=require(_0xe865('0x4'));var moment=require(_0xe865('0x5'));var BPromise=require(_0xe865('0x6'));var Mustache=require(_0xe865('0x7'));var util=require(_0xe865('0x8'));var path=require(_0xe865('0x9'));var sox=require(_0xe865('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe865('0xb'));var squel=require(_0xe865('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe865('0xd'));var toCsv=require(_0xe865('0xe'));var querystring=require(_0xe865('0xf'));var Papa=require(_0xe865('0x10'));var authService=require(_0xe865('0x11'));var hardwareService=require(_0xe865('0x12'));var Redis=require(_0xe865('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0xe865('0x14'))(_0xe865('0x15'));var utils=require(_0xe865('0x16'));var config=require(_0xe865('0x17'));var db=require(_0xe865('0x18'))['db'];function respondWithStatusCode(_0x179888,_0x4a22ab){_0x4a22ab=_0x4a22ab||0xcc;return function(_0x929f3e){if(_0x929f3e){return _0x179888[_0xe865('0x19')](_0x4a22ab);}return _0x179888[_0xe865('0x1a')](_0x4a22ab)[_0xe865('0x1b')]();};}function respondWithResult(_0x5db751,_0x4b423f){_0x4b423f=_0x4b423f||0xc8;return function(_0x2ed80a){if(_0x2ed80a){return _0x5db751[_0xe865('0x1a')](_0x4b423f)['json'](_0x2ed80a);}};}function respondWithFilteredResult(_0x3b06ac,_0x49ac6d){return function(_0x59d7aa){if(_0x59d7aa){var _0x23350c=_0x59d7aa[_0xe865('0x1c')],_0x3bfbe5=_0x49ac6d[_0xe865('0x1d')],_0x5c6018=_0x49ac6d[_0xe865('0x1d')]+_0x49ac6d['limit'],_0x383050;if(_0x5c6018>=_0x23350c){_0x5c6018=_0x23350c;_0x383050=0xc8;}else{_0x383050=0xce;}_0x3b06ac[_0xe865('0x1a')](_0x383050);return _0x3b06ac['set'](_0xe865('0x1e'),_0x3bfbe5+'-'+_0x5c6018+'/'+_0x23350c)[_0xe865('0x1f')](_0x59d7aa);}return null;};}function patchUpdates(_0x28ca22){return function(_0x26545b){try{jsonpatch[_0xe865('0x20')](_0x26545b,_0x28ca22,!![]);}catch(_0x4a660e){return BPromise[_0xe865('0x21')](_0x4a660e);}return _0x26545b[_0xe865('0x22')]();};}function saveUpdates(_0x234093,_0x242b40){return function(_0x2290ec){if(_0x2290ec){return _0x2290ec['update'](_0x234093)[_0xe865('0x23')](function(_0x381667){return _0x381667;});}return null;};}function removeEntity(_0x11acf2,_0x16818c){return function(_0x2332b8){if(_0x2332b8){return _0x2332b8[_0xe865('0x24')]()[_0xe865('0x23')](function(){_0x11acf2[_0xe865('0x1a')](0xcc)[_0xe865('0x1b')]();});}};}function handleEntityNotFound(_0x1ce018,_0x3d565d){return function(_0x593d65){if(!_0x593d65){_0x1ce018[_0xe865('0x19')](0x194);}return _0x593d65;};}function handleError(_0x158f00,_0x28c7eb){_0x28c7eb=_0x28c7eb||0x1f4;return function(_0x2791d4){logger['error'](_0x2791d4[_0xe865('0x25')]);if(_0x2791d4[_0xe865('0x26')]){delete _0x2791d4[_0xe865('0x26')];}_0x158f00[_0xe865('0x1a')](_0x28c7eb)[_0xe865('0x27')](_0x2791d4);};}exports[_0xe865('0x28')]=function(_0x5aa508,_0x4dbbfe){var _0x445975={},_0x3d6f9e={},_0x8d0a54={'count':0x0,'rows':[]};var _0x19ce79=db[_0xe865('0x29')][_0xe865('0x2a')];_0x3d6f9e[_0xe865('0x2b')]=_[_0xe865('0x2c')](_0x19ce79);_0x3d6f9e[_0xe865('0x2d')]=_[_0xe865('0x2c')](_0x5aa508[_0xe865('0x2d')]);_0x3d6f9e['filters']=_[_0xe865('0x2e')](_0x3d6f9e['model'],_0x3d6f9e[_0xe865('0x2d')]);_0x445975[_0xe865('0x2f')]=_['intersection'](_0x3d6f9e['model'],qs[_0xe865('0x30')](_0x5aa508[_0xe865('0x2d')][_0xe865('0x30')]));_0x445975[_0xe865('0x2f')]=_0x445975[_0xe865('0x2f')]['length']?_0x445975[_0xe865('0x2f')]:_0x3d6f9e[_0xe865('0x2b')];if(!_0x5aa508['query']['hasOwnProperty'](_0xe865('0x31'))){_0x445975['limit']=qs[_0xe865('0x32')](_0x5aa508[_0xe865('0x2d')][_0xe865('0x32')]);_0x445975[_0xe865('0x1d')]=qs['offset'](_0x5aa508['query'][_0xe865('0x1d')]);}_0x445975[_0xe865('0x33')]=qs[_0xe865('0x34')](_0x5aa508[_0xe865('0x2d')][_0xe865('0x34')]);_0x445975[_0xe865('0x35')]=qs['filters'](_[_0xe865('0x36')](_0x5aa508[_0xe865('0x2d')],_0x3d6f9e[_0xe865('0x37')]));if(_0x5aa508[_0xe865('0x2d')][_0xe865('0x38')]){_0x445975[_0xe865('0x35')]=_[_0xe865('0x39')](_0x445975[_0xe865('0x35')],{'$or':_[_0xe865('0x3a')](_0x19ce79,function(_0x37e3ed){if(_0x37e3ed[_0xe865('0x3b')]['key']!==_0xe865('0x3c')){var _0x34c0be={};_0x34c0be[_0x37e3ed[_0xe865('0x3d')]]={'$like':'%'+_0x5aa508['query'][_0xe865('0x38')]+'%'};return _0x34c0be;}})});}_0x445975=_[_0xe865('0x39')]({},_0x445975,_0x5aa508['options']);var _0x26f0ee={'where':_0x445975['where']};return db[_0xe865('0x29')][_0xe865('0x1c')](_0x26f0ee)[_0xe865('0x23')](function(_0x16d3c1){_0x8d0a54[_0xe865('0x1c')]=_0x16d3c1;if(_0x5aa508[_0xe865('0x2d')][_0xe865('0x3e')]){_0x445975[_0xe865('0x3f')]=[{'all':!![]}];}return db[_0xe865('0x29')]['findAll'](_0x445975);})[_0xe865('0x23')](function(_0x38c247){_0x8d0a54['rows']=_0x38c247;return _0x8d0a54;})[_0xe865('0x23')](respondWithFilteredResult(_0x4dbbfe,_0x445975))[_0xe865('0x40')](handleError(_0x4dbbfe,null));};exports[_0xe865('0x41')]=function(_0x36a69e,_0x13d8bc){var _0x2d39e7={'raw':!![],'where':{'id':_0x36a69e['params']['id']}},_0x9290c0={};_0x9290c0['model']=_[_0xe865('0x2c')](db[_0xe865('0x29')][_0xe865('0x2a')]);_0x9290c0[_0xe865('0x2d')]=_[_0xe865('0x2c')](_0x36a69e[_0xe865('0x2d')]);_0x9290c0[_0xe865('0x37')]=_[_0xe865('0x2e')](_0x9290c0[_0xe865('0x2b')],_0x9290c0['query']);_0x2d39e7[_0xe865('0x2f')]=_['intersection'](_0x9290c0[_0xe865('0x2b')],qs[_0xe865('0x30')](_0x36a69e['query'][_0xe865('0x30')]));_0x2d39e7[_0xe865('0x2f')]=_0x2d39e7[_0xe865('0x2f')][_0xe865('0x42')]?_0x2d39e7['attributes']:_0x9290c0[_0xe865('0x2b')];if(_0x36a69e[_0xe865('0x2d')][_0xe865('0x3e')]){_0x2d39e7[_0xe865('0x3f')]=[{'all':!![]}];}_0x2d39e7=_[_0xe865('0x39')]({},_0x2d39e7,_0x36a69e['options']);return db[_0xe865('0x29')][_0xe865('0x43')](_0x2d39e7)[_0xe865('0x23')](handleEntityNotFound(_0x13d8bc,null))[_0xe865('0x23')](respondWithResult(_0x13d8bc,null))[_0xe865('0x40')](handleError(_0x13d8bc,null));};exports['create']=function(_0x54a472,_0x479183){return db[_0xe865('0x29')][_0xe865('0x44')](_0x54a472['body'],{})['then'](respondWithResult(_0x479183,0xc9))[_0xe865('0x40')](handleError(_0x479183,null));};exports[_0xe865('0x45')]=function(_0x1485f3,_0x5b16e7){if(_0x1485f3[_0xe865('0x46')]['id']){delete _0x1485f3['body']['id'];}return db['Cdr']['find']({'where':{'id':_0x1485f3[_0xe865('0x47')]['id']}})[_0xe865('0x23')](handleEntityNotFound(_0x5b16e7,null))[_0xe865('0x23')](saveUpdates(_0x1485f3[_0xe865('0x46')],null))[_0xe865('0x23')](respondWithResult(_0x5b16e7,null))[_0xe865('0x40')](handleError(_0x5b16e7,null));};exports[_0xe865('0x24')]=function(_0xb05ad9,_0x20992e){return db['Cdr'][_0xe865('0x43')]({'where':{'id':_0xb05ad9[_0xe865('0x47')]['id']}})['then'](handleEntityNotFound(_0x20992e,null))[_0xe865('0x23')](removeEntity(_0x20992e,null))[_0xe865('0x40')](handleError(_0x20992e,null));};exports[_0xe865('0x48')]=function(_0x1550eb,_0x7e37d8){return db[_0xe865('0x29')][_0xe865('0x48')]()['then'](respondWithResult(_0x7e37d8,null))[_0xe865('0x40')](handleError(_0x7e37d8,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 7e94504..6ee2262 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 _0x5b94=['accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger','api','moment','exports','define','Cdr'];(function(_0xf8f75a,_0x543004){var _0x7cccdc=function(_0xb5df66){while(--_0xb5df66){_0xf8f75a['push'](_0xf8f75a['shift']());}};_0x7cccdc(++_0x543004);}(_0x5b94,0x1e2));var _0x45b9=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x5b94[_0x1477ef];return _0x164acd;};'use strict';var _=require(_0x45b9('0x0'));var util=require(_0x45b9('0x1'));var logger=require(_0x45b9('0x2'))(_0x45b9('0x3'));var moment=require(_0x45b9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./cdr.attributes');module[_0x45b9('0x5')]=function(_0x2c286f,_0x2bdef1){return _0x2c286f[_0x45b9('0x6')](_0x45b9('0x7'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x45b9('0x8'),'fields':[_0x45b9('0x8')]},{'name':_0x45b9('0x9'),'fields':[_0x45b9('0x9')]},{'name':_0x45b9('0xa'),'fields':[_0x45b9('0xa')]},{'name':_0x45b9('0xb'),'fields':[_0x45b9('0xb')]},{'name':_0x45b9('0xc'),'fields':[_0x45b9('0xc')]},{'name':_0x45b9('0xd'),'fields':['uniqueid']}],'timestamps':![]});}; \ No newline at end of file +var _0xe9ee=['exports','define','cdr','accountcode','calldate','disposition','dst','src','lodash','util','moment','bluebird','request-promise','./cdr.attributes'];(function(_0x5224cf,_0x35a4d1){var _0x1d8fbd=function(_0x2eb57e){while(--_0x2eb57e){_0x5224cf['push'](_0x5224cf['shift']());}};_0x1d8fbd(++_0x35a4d1);}(_0xe9ee,0xa2));var _0xee9e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9ee[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee9e('0x0'));var util=require(_0xee9e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xee9e('0x2'));var BPromise=require(_0xee9e('0x3'));var rp=require(_0xee9e('0x4'));var attributes=require(_0xee9e('0x5'));module[_0xee9e('0x6')]=function(_0x44b150,_0x23edba){return _0x44b150[_0xee9e('0x7')]('Cdr',attributes,{'tableName':_0xee9e('0x8'),'paranoid':![],'indexes':[{'name':_0xee9e('0x9'),'fields':[_0xee9e('0x9')]},{'name':'calldate','fields':[_0xee9e('0xa')]},{'name':_0xee9e('0xb'),'fields':['disposition']},{'name':_0xee9e('0xc'),'fields':[_0xee9e('0xc')]},{'name':_0xee9e('0xd'),'fields':[_0xee9e('0xd')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 7eeb421..4880e59 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 _0x0ca5=['jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','randomstring','ioredis','../../config/utils','../../config/environment'];(function(_0x18b856,_0x135f51){var _0x1ce433=function(_0x47ef89){while(--_0x47ef89){_0x18b856['push'](_0x18b856['shift']());}};_0x1ce433(++_0x135f51);}(_0x0ca5,0x67));var _0x50ca=function(_0x51edd6,_0x53f5c7){_0x51edd6=_0x51edd6-0x0;var _0x52e4fd=_0x0ca5[_0x51edd6];return _0x52e4fd;};'use strict';var _=require(_0x50ca('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50ca('0x1'));var fs=require('fs');var Redis=require(_0x50ca('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x50ca('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x50ca('0x4'));var jayson=require(_0x50ca('0x5'));var client=jayson[_0x50ca('0x6')][_0x50ca('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cded5,_0x5c54b6,_0xb19f0a){return new BPromise(function(_0x3bf1f7,_0x378dc8){return client[_0x50ca('0x8')](_0x5cded5,_0xb19f0a)['then'](function(_0x3a4f95){logger[_0x50ca('0x9')](_0x50ca('0xa'),_0x5c54b6,_0x50ca('0xb'));logger['debug'](_0x50ca('0xc'),_0x5c54b6,'request\x20sent',JSON[_0x50ca('0xd')](_0x3a4f95));if(_0x3a4f95['error']){if(_0x3a4f95[_0x50ca('0xe')][_0x50ca('0xf')]===0x1f4){logger[_0x50ca('0xe')](_0x50ca('0xa'),_0x5c54b6,_0x3a4f95[_0x50ca('0xe')][_0x50ca('0x10')]);return _0x378dc8(_0x3a4f95[_0x50ca('0xe')][_0x50ca('0x10')]);}logger[_0x50ca('0xe')]('Cdr,\x20%s,\x20%s',_0x5c54b6,_0x3a4f95[_0x50ca('0xe')][_0x50ca('0x10')]);return _0x3bf1f7(_0x3a4f95[_0x50ca('0xe')][_0x50ca('0x10')]);}else{logger['info'](_0x50ca('0xa'),_0x5c54b6,_0x50ca('0xb'));_0x3bf1f7(_0x3a4f95['result'][_0x50ca('0x10')]);}})[_0x50ca('0x11')](function(_0x12d182){logger[_0x50ca('0xe')]('Cdr,\x20%s,\x20%s',_0x5c54b6,_0x12d182);_0x378dc8(_0x12d182);});});} \ No newline at end of file +var _0x3302=['client','http','request','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x3302,0x96));var _0x2330=function(_0xddf202,_0x1890fa){_0xddf202=_0xddf202-0x0;var _0x1a95da=_0x3302[_0xddf202];return _0x1a95da;};'use strict';var _=require('lodash');var util=require(_0x2330('0x0'));var moment=require(_0x2330('0x1'));var BPromise=require(_0x2330('0x2'));var rs=require(_0x2330('0x3'));var fs=require('fs');var Redis=require(_0x2330('0x4'));var db=require(_0x2330('0x5'))['db'];var utils=require(_0x2330('0x6'));var logger=require(_0x2330('0x7'))(_0x2330('0x8'));var config=require(_0x2330('0x9'));var jayson=require(_0x2330('0xa'));var client=jayson[_0x2330('0xb')][_0x2330('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x266800,_0x2c67bd,_0x46aecb){return new BPromise(function(_0x18c148,_0x36c7e){return client[_0x2330('0xd')](_0x266800,_0x46aecb)['then'](function(_0x54812d){logger['info'](_0x2330('0xe'),_0x2c67bd,_0x2330('0xf'));logger['debug'](_0x2330('0x10'),_0x2c67bd,_0x2330('0xf'),JSON[_0x2330('0x11')](_0x54812d));if(_0x54812d['error']){if(_0x54812d[_0x2330('0x12')][_0x2330('0x13')]===0x1f4){logger[_0x2330('0x12')]('Cdr,\x20%s,\x20%s',_0x2c67bd,_0x54812d['error'][_0x2330('0x14')]);return _0x36c7e(_0x54812d[_0x2330('0x12')][_0x2330('0x14')]);}logger[_0x2330('0x12')](_0x2330('0xe'),_0x2c67bd,_0x54812d['error']['message']);return _0x18c148(_0x54812d['error'][_0x2330('0x14')]);}else{logger[_0x2330('0x15')]('Cdr,\x20%s,\x20%s',_0x2c67bd,_0x2330('0xf'));_0x18c148(_0x54812d['result']['message']);}})[_0x2330('0x16')](function(_0x5751ef){logger[_0x2330('0x12')](_0x2330('0xe'),_0x2c67bd,_0x5751ef);_0x36c7e(_0x5751ef);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index be0a698..84c82de 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 _0xe8d6=['./cdr.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x56f8e3,_0x5c7aaf){var _0x24f8ce=function(_0x284efa){while(--_0x284efa){_0x56f8e3['push'](_0x56f8e3['shift']());}};_0x24f8ce(++_0x5c7aaf);}(_0xe8d6,0xb5));var _0x6e8d=function(_0x38fa55,_0x23235d){_0x38fa55=_0x38fa55-0x0;var _0x83cee4=_0xe8d6[_0x38fa55];return _0x83cee4;};'use strict';var multer=require(_0x6e8d('0x0'));var util=require(_0x6e8d('0x1'));var path=require(_0x6e8d('0x2'));var timeout=require(_0x6e8d('0x3'));var express=require(_0x6e8d('0x4'));var router=express[_0x6e8d('0x5')]();var auth=require(_0x6e8d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6e8d('0x7'));var controller=require(_0x6e8d('0x8'));router[_0x6e8d('0x9')]('/',auth[_0x6e8d('0xa')](),controller['index']);router[_0x6e8d('0x9')](_0x6e8d('0xb'),auth[_0x6e8d('0xa')](),controller[_0x6e8d('0xc')]);router['get'](_0x6e8d('0xd'),auth[_0x6e8d('0xa')](),controller[_0x6e8d('0xe')]);router[_0x6e8d('0xf')]('/',auth[_0x6e8d('0xa')](),controller[_0x6e8d('0x10')]);router[_0x6e8d('0x11')](_0x6e8d('0xd'),auth[_0x6e8d('0xa')](),controller[_0x6e8d('0x12')]);router[_0x6e8d('0x13')](_0x6e8d('0xd'),auth[_0x6e8d('0xa')](),controller['destroy']);module[_0x6e8d('0x14')]=router; \ No newline at end of file +var _0xa7f5=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cdr.controller','get','index','/describe','describe','post','isAuthenticated','put','/:id','update','delete'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa7f5,0x12e));var _0x5a7f=function(_0x987238,_0x28b2c3){_0x987238=_0x987238-0x0;var _0x3b7ce3=_0xa7f5[_0x987238];return _0x3b7ce3;};'use strict';var multer=require(_0x5a7f('0x0'));var util=require('util');var path=require(_0x5a7f('0x1'));var timeout=require(_0x5a7f('0x2'));var express=require(_0x5a7f('0x3'));var router=express[_0x5a7f('0x4')]();var auth=require(_0x5a7f('0x5'));var interaction=require(_0x5a7f('0x6'));var config=require('../../config/environment');var controller=require(_0x5a7f('0x7'));router[_0x5a7f('0x8')]('/',auth['isAuthenticated'](),controller[_0x5a7f('0x9')]);router[_0x5a7f('0x8')](_0x5a7f('0xa'),auth['isAuthenticated'](),controller[_0x5a7f('0xb')]);router[_0x5a7f('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5a7f('0xc')]('/',auth[_0x5a7f('0xd')](),controller['create']);router[_0x5a7f('0xe')](_0x5a7f('0xf'),auth[_0x5a7f('0xd')](),controller[_0x5a7f('0x10')]);router[_0x5a7f('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x5a7f('0x12')]);module[_0x5a7f('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 2e7a727..106fee8 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 _0x3e8c=['INTEGER','STRING','noop'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0x3e8c,0xf6));var _0xc3e8=function(_0xbb533,_0x5341a1){_0xbb533=_0xbb533-0x0;var _0x46ec96=_0x3e8c[_0xbb533];return _0x46ec96;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xc3e8('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xc3e8('0x1')],'allowNull':![],'defaultValue':_0xc3e8('0x2')},'appdata':{'type':Sequelize[_0xc3e8('0x1')](0x1000),'defaultValue':''},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc3e8('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x86ec=['*,*,*,*','sequelize','exports','STRING','noop'];(function(_0xe1269d,_0x57b7c3){var _0x261ca1=function(_0x13b234){while(--_0x13b234){_0xe1269d['push'](_0xe1269d['shift']());}};_0x261ca1(++_0x57b7c3);}(_0x86ec,0x11e));var _0xc86e=function(_0x3969a5,_0x2cef4a){_0x3969a5=_0x3969a5-0x0;var _0xed6209=_0x86ec[_0x3969a5];return _0xed6209;};'use strict';var Sequelize=require(_0xc86e('0x0'));module[_0xc86e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc86e('0x2')],'allowNull':![],'defaultValue':_0xc86e('0x3')},'appdata':{'type':Sequelize[_0xc86e('0x2')](0x1000),'defaultValue':''},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc86e('0x2')],'defaultValue':_0xc86e('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 07f9a17..0d6d190 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 _0x8c86=['html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','show','keys','ChatApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','include','merge','options','catch','body','find','params'];(function(_0x3450ee,_0x5c1146){var _0x1b6527=function(_0x330b90){while(--_0x330b90){_0x3450ee['push'](_0x3450ee['shift']());}};_0x1b6527(++_0x5c1146);}(_0x8c86,0x78));var _0x68c8=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8c86[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require(_0x68c8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x68c8('0x1'));var zipdir=require(_0x68c8('0x2'));var jsonpatch=require(_0x68c8('0x3'));var rp=require(_0x68c8('0x4'));var moment=require('moment');var BPromise=require(_0x68c8('0x5'));var Mustache=require(_0x68c8('0x6'));var util=require('util');var path=require(_0x68c8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x68c8('0x8'));var fs=require('fs');var _=require(_0x68c8('0x9'));var squel=require(_0x68c8('0xa'));var crypto=require(_0x68c8('0xb'));var jsforce=require(_0x68c8('0xc'));var deskjs=require(_0x68c8('0xd'));var toCsv=require(_0x68c8('0xe'));var querystring=require(_0x68c8('0xf'));var Papa=require(_0x68c8('0x10'));var authService=require(_0x68c8('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x68c8('0x12'));var qs=require(_0x68c8('0x13'));var logger=require(_0x68c8('0x14'))(_0x68c8('0x15'));var utils=require('../../config/utils');var config=require(_0x68c8('0x16'));var db=require(_0x68c8('0x17'))['db'];function respondWithStatusCode(_0x414da1,_0x3e24ed){_0x3e24ed=_0x3e24ed||0xcc;return function(_0x2e4f93){if(_0x2e4f93){return _0x414da1[_0x68c8('0x18')](_0x3e24ed);}return _0x414da1[_0x68c8('0x19')](_0x3e24ed)[_0x68c8('0x1a')]();};}function respondWithResult(_0x72e49c,_0x2a01cd){_0x2a01cd=_0x2a01cd||0xc8;return function(_0x13b36f){if(_0x13b36f){return _0x72e49c[_0x68c8('0x19')](_0x2a01cd)[_0x68c8('0x1b')](_0x13b36f);}};}function respondWithFilteredResult(_0x11cb30,_0x57f55c){return function(_0x168110){if(_0x168110){var _0x2b9d13=_0x168110[_0x68c8('0x1c')],_0x5122fc=_0x57f55c['offset'],_0x2ab164=_0x57f55c[_0x68c8('0x1d')]+_0x57f55c[_0x68c8('0x1e')],_0x5e19bc;if(_0x2ab164>=_0x2b9d13){_0x2ab164=_0x2b9d13;_0x5e19bc=0xc8;}else{_0x5e19bc=0xce;}_0x11cb30['status'](_0x5e19bc);return _0x11cb30[_0x68c8('0x1f')](_0x68c8('0x20'),_0x5122fc+'-'+_0x2ab164+'/'+_0x2b9d13)[_0x68c8('0x1b')](_0x168110);}return null;};}function patchUpdates(_0x4a6334){return function(_0x23bcc0){try{jsonpatch['apply'](_0x23bcc0,_0x4a6334,!![]);}catch(_0x28bdd1){return BPromise[_0x68c8('0x21')](_0x28bdd1);}return _0x23bcc0[_0x68c8('0x22')]();};}function saveUpdates(_0x22fef9,_0x5bc81b){return function(_0xa98aff){if(_0xa98aff){return _0xa98aff[_0x68c8('0x23')](_0x22fef9)[_0x68c8('0x24')](function(_0xecb45f){return _0xecb45f;});}return null;};}function removeEntity(_0x1247bf,_0x1a3b41){return function(_0xca5b10){if(_0xca5b10){return _0xca5b10[_0x68c8('0x25')]()[_0x68c8('0x24')](function(){_0x1247bf[_0x68c8('0x19')](0xcc)[_0x68c8('0x1a')]();});}};}function handleEntityNotFound(_0x488954,_0x51b3ab){return function(_0x117d22){if(!_0x117d22){_0x488954[_0x68c8('0x18')](0x194);}return _0x117d22;};}function handleError(_0x2889e2,_0x146f3b){_0x146f3b=_0x146f3b||0x1f4;return function(_0x3d74e7){logger[_0x68c8('0x26')](_0x3d74e7[_0x68c8('0x27')]);if(_0x3d74e7['name']){delete _0x3d74e7[_0x68c8('0x28')];}_0x2889e2[_0x68c8('0x19')](_0x146f3b)[_0x68c8('0x29')](_0x3d74e7);};}exports[_0x68c8('0x2a')]=function(_0x1d0610,_0x267015){var _0x5a8638={'raw':!![],'where':{'id':_0x1d0610['params']['id']}},_0x185f7a={};_0x185f7a['model']=_[_0x68c8('0x2b')](db[_0x68c8('0x2c')][_0x68c8('0x2d')]);_0x185f7a[_0x68c8('0x2e')]=_['keys'](_0x1d0610[_0x68c8('0x2e')]);_0x185f7a['filters']=_[_0x68c8('0x2f')](_0x185f7a[_0x68c8('0x30')],_0x185f7a[_0x68c8('0x2e')]);_0x5a8638['attributes']=_['intersection'](_0x185f7a[_0x68c8('0x30')],qs[_0x68c8('0x31')](_0x1d0610[_0x68c8('0x2e')]['fields']));_0x5a8638[_0x68c8('0x32')]=_0x5a8638[_0x68c8('0x32')][_0x68c8('0x33')]?_0x5a8638[_0x68c8('0x32')]:_0x185f7a[_0x68c8('0x30')];if(_0x1d0610[_0x68c8('0x2e')][_0x68c8('0x34')]){_0x5a8638[_0x68c8('0x35')]=[{'all':!![]}];}_0x5a8638=_[_0x68c8('0x36')]({},_0x5a8638,_0x1d0610[_0x68c8('0x37')]);return db[_0x68c8('0x2c')]['find'](_0x5a8638)[_0x68c8('0x24')](handleEntityNotFound(_0x267015,null))[_0x68c8('0x24')](respondWithResult(_0x267015,null))[_0x68c8('0x38')](handleError(_0x267015,null));};exports[_0x68c8('0x23')]=function(_0x6acfeb,_0x3c6e0a){if(_0x6acfeb[_0x68c8('0x39')]['id']){delete _0x6acfeb[_0x68c8('0x39')]['id'];}return db[_0x68c8('0x2c')][_0x68c8('0x3a')]({'where':{'id':_0x6acfeb[_0x68c8('0x3b')]['id']}})[_0x68c8('0x24')](handleEntityNotFound(_0x3c6e0a,null))[_0x68c8('0x24')](saveUpdates(_0x6acfeb[_0x68c8('0x39')],null))[_0x68c8('0x24')](respondWithResult(_0x3c6e0a,null))[_0x68c8('0x38')](handleError(_0x3c6e0a,null));};exports[_0x68c8('0x25')]=function(_0x50b958,_0x2fa71c){return db[_0x68c8('0x2c')]['find']({'where':{'id':_0x50b958[_0x68c8('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2fa71c,null))[_0x68c8('0x24')](removeEntity(_0x2fa71c,null))['catch'](handleError(_0x2fa71c,null));}; \ No newline at end of file +var _0x3d7c=['../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','json','apply','reject','update','destroy','then','end','sendStatus','error','stack','name','params','model','ChatApplication','query','keys','filters','attributes','intersection','fields','length','includeAll','include','options','body','catch','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','squel','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','ioredis'];(function(_0x316090,_0x273fca){var _0x3fd0b5=function(_0x4fdc8b){while(--_0x4fdc8b){_0x316090['push'](_0x316090['shift']());}};_0x3fd0b5(++_0x273fca);}(_0x3d7c,0x181));var _0xc3d7=function(_0x5243a6,_0x36aead){_0x5243a6=_0x5243a6-0x0;var _0x27ff9a=_0x3d7c[_0x5243a6];return _0x27ff9a;};'use strict';var pdf=require(_0xc3d7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc3d7('0x1'));var zipdir=require(_0xc3d7('0x2'));var jsonpatch=require(_0xc3d7('0x3'));var rp=require(_0xc3d7('0x4'));var moment=require(_0xc3d7('0x5'));var BPromise=require(_0xc3d7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc3d7('0x7'));var csv=require(_0xc3d7('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc3d7('0x9'));var crypto=require('crypto');var jsforce=require(_0xc3d7('0xa'));var deskjs=require(_0xc3d7('0xb'));var toCsv=require(_0xc3d7('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xc3d7('0xc'));var hardwareService=require(_0xc3d7('0xd'));var Redis=require(_0xc3d7('0xe'));var qs=require(_0xc3d7('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xc3d7('0x10'));var config=require(_0xc3d7('0x11'));var db=require(_0xc3d7('0x12'))['db'];function respondWithStatusCode(_0x1b9f63,_0x49fee9){_0x49fee9=_0x49fee9||0xcc;return function(_0x2c5543){if(_0x2c5543){return _0x1b9f63['sendStatus'](_0x49fee9);}return _0x1b9f63[_0xc3d7('0x13')](_0x49fee9)['end']();};}function respondWithResult(_0x2db2c4,_0x5ca684){_0x5ca684=_0x5ca684||0xc8;return function(_0x3a6521){if(_0x3a6521){return _0x2db2c4[_0xc3d7('0x13')](_0x5ca684)['json'](_0x3a6521);}};}function respondWithFilteredResult(_0x58f80c,_0x55c057){return function(_0x460e5c){if(_0x460e5c){var _0x349869=_0x460e5c[_0xc3d7('0x14')],_0x316e23=_0x55c057[_0xc3d7('0x15')],_0x106e3b=_0x55c057['offset']+_0x55c057[_0xc3d7('0x16')],_0x1b7996;if(_0x106e3b>=_0x349869){_0x106e3b=_0x349869;_0x1b7996=0xc8;}else{_0x1b7996=0xce;}_0x58f80c['status'](_0x1b7996);return _0x58f80c['set']('Content-Range',_0x316e23+'-'+_0x106e3b+'/'+_0x349869)[_0xc3d7('0x17')](_0x460e5c);}return null;};}function patchUpdates(_0x2b4d4d){return function(_0x2f1d37){try{jsonpatch[_0xc3d7('0x18')](_0x2f1d37,_0x2b4d4d,!![]);}catch(_0x8ee15){return BPromise[_0xc3d7('0x19')](_0x8ee15);}return _0x2f1d37['save']();};}function saveUpdates(_0xbe47a4,_0x956fec){return function(_0x385fc1){if(_0x385fc1){return _0x385fc1[_0xc3d7('0x1a')](_0xbe47a4)['then'](function(_0xaa6411){return _0xaa6411;});}return null;};}function removeEntity(_0x2114a8,_0x217870){return function(_0x267dea){if(_0x267dea){return _0x267dea[_0xc3d7('0x1b')]()[_0xc3d7('0x1c')](function(){_0x2114a8['status'](0xcc)[_0xc3d7('0x1d')]();});}};}function handleEntityNotFound(_0x20ea96,_0x4262d1){return function(_0x418f3b){if(!_0x418f3b){_0x20ea96[_0xc3d7('0x1e')](0x194);}return _0x418f3b;};}function handleError(_0x312370,_0x13d1c8){_0x13d1c8=_0x13d1c8||0x1f4;return function(_0x430516){logger[_0xc3d7('0x1f')](_0x430516[_0xc3d7('0x20')]);if(_0x430516[_0xc3d7('0x21')]){delete _0x430516[_0xc3d7('0x21')];}_0x312370[_0xc3d7('0x13')](_0x13d1c8)['send'](_0x430516);};}exports['show']=function(_0x51460b,_0x4a3343){var _0x2e8382={'raw':!![],'where':{'id':_0x51460b[_0xc3d7('0x22')]['id']}},_0x10e2fb={};_0x10e2fb[_0xc3d7('0x23')]=_['keys'](db[_0xc3d7('0x24')]['rawAttributes']);_0x10e2fb[_0xc3d7('0x25')]=_[_0xc3d7('0x26')](_0x51460b[_0xc3d7('0x25')]);_0x10e2fb[_0xc3d7('0x27')]=_['intersection'](_0x10e2fb[_0xc3d7('0x23')],_0x10e2fb['query']);_0x2e8382[_0xc3d7('0x28')]=_[_0xc3d7('0x29')](_0x10e2fb['model'],qs[_0xc3d7('0x2a')](_0x51460b[_0xc3d7('0x25')][_0xc3d7('0x2a')]));_0x2e8382[_0xc3d7('0x28')]=_0x2e8382['attributes'][_0xc3d7('0x2b')]?_0x2e8382[_0xc3d7('0x28')]:_0x10e2fb[_0xc3d7('0x23')];if(_0x51460b[_0xc3d7('0x25')][_0xc3d7('0x2c')]){_0x2e8382[_0xc3d7('0x2d')]=[{'all':!![]}];}_0x2e8382=_['merge']({},_0x2e8382,_0x51460b[_0xc3d7('0x2e')]);return db[_0xc3d7('0x24')]['find'](_0x2e8382)[_0xc3d7('0x1c')](handleEntityNotFound(_0x4a3343,null))[_0xc3d7('0x1c')](respondWithResult(_0x4a3343,null))['catch'](handleError(_0x4a3343,null));};exports[_0xc3d7('0x1a')]=function(_0x36422b,_0x2bd8ec){if(_0x36422b[_0xc3d7('0x2f')]['id']){delete _0x36422b[_0xc3d7('0x2f')]['id'];}return db[_0xc3d7('0x24')]['find']({'where':{'id':_0x36422b['params']['id']}})[_0xc3d7('0x1c')](handleEntityNotFound(_0x2bd8ec,null))['then'](saveUpdates(_0x36422b[_0xc3d7('0x2f')],null))['then'](respondWithResult(_0x2bd8ec,null))[_0xc3d7('0x30')](handleError(_0x2bd8ec,null));};exports[_0xc3d7('0x1b')]=function(_0x3ad971,_0x1ea5d3){return db[_0xc3d7('0x24')][_0xc3d7('0x31')]({'where':{'id':_0x3ad971[_0xc3d7('0x22')]['id']}})[_0xc3d7('0x1c')](handleEntityNotFound(_0x1ea5d3,null))['then'](removeEntity(_0x1ea5d3,null))[_0xc3d7('0x30')](handleError(_0x1ea5d3,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 77f87b7..28c0059 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 _0xbcf3=['bluebird','request-promise','define','ChatApplication','chat_applications','lodash','util','../../config/logger','api','moment'];(function(_0x582df0,_0x82017b){var _0x410fb7=function(_0x4ef699){while(--_0x4ef699){_0x582df0['push'](_0x582df0['shift']());}};_0x410fb7(++_0x82017b);}(_0xbcf3,0x1e5));var _0x3bcf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcf3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3bcf('0x0'));var util=require(_0x3bcf('0x1'));var logger=require(_0x3bcf('0x2'))(_0x3bcf('0x3'));var moment=require(_0x3bcf('0x4'));var BPromise=require(_0x3bcf('0x5'));var rp=require(_0x3bcf('0x6'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x238c6e,_0x21253c){return _0x238c6e[_0x3bcf('0x7')](_0x3bcf('0x8'),attributes,{'tableName':_0x3bcf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2843=['define','ChatApplication','chat_applications','lodash','util','moment','bluebird','request-promise','./chatApplication.attributes','exports'];(function(_0x583d05,_0x5036cb){var _0x5acd89=function(_0x263604){while(--_0x263604){_0x583d05['push'](_0x583d05['shift']());}};_0x5acd89(++_0x5036cb);}(_0x2843,0x1b1));var _0x3284=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x2843[_0x2d61b2];return _0x12df89;};'use strict';var _=require(_0x3284('0x0'));var util=require(_0x3284('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3284('0x2'));var BPromise=require(_0x3284('0x3'));var rp=require(_0x3284('0x4'));var attributes=require(_0x3284('0x5'));module[_0x3284('0x6')]=function(_0x10aa5a,_0x1dfd9f){return _0x10aa5a[_0x3284('0x7')](_0x3284('0x8'),attributes,{'tableName':_0x3284('0x9'),'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 bd3164e..6613dff 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 _0x7193=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','util'];(function(_0x55c8c2,_0xcd1486){var _0x24d34d=function(_0x7a389){while(--_0x7a389){_0x55c8c2['push'](_0x55c8c2['shift']());}};_0x24d34d(++_0xcd1486);}(_0x7193,0xef));var _0x3719=function(_0x3d542c,_0x2098ae){_0x3d542c=_0x3d542c-0x0;var _0x4946de=_0x7193[_0x3d542c];return _0x4946de;};'use strict';var _=require('lodash');var util=require(_0x3719('0x0'));var moment=require(_0x3719('0x1'));var BPromise=require('bluebird');var rs=require(_0x3719('0x2'));var fs=require('fs');var Redis=require(_0x3719('0x3'));var db=require(_0x3719('0x4'))['db'];var utils=require(_0x3719('0x5'));var logger=require('../../config/logger')(_0x3719('0x6'));var config=require(_0x3719('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3719('0x8')][_0x3719('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25fc06,_0x4dc490,_0x3a07c6){return new BPromise(function(_0x4d968a,_0xa20f52){return client[_0x3719('0xa')](_0x25fc06,_0x3a07c6)[_0x3719('0xb')](function(_0x5b870b){logger[_0x3719('0xc')](_0x3719('0xd'),_0x4dc490,_0x3719('0xe'));logger[_0x3719('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4dc490,'request\x20sent',JSON[_0x3719('0x10')](_0x5b870b));if(_0x5b870b['error']){if(_0x5b870b['error'][_0x3719('0x11')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x4dc490,_0x5b870b[_0x3719('0x12')][_0x3719('0x13')]);return _0xa20f52(_0x5b870b[_0x3719('0x12')][_0x3719('0x13')]);}logger['error'](_0x3719('0xd'),_0x4dc490,_0x5b870b[_0x3719('0x12')][_0x3719('0x13')]);return _0x4d968a(_0x5b870b['error'][_0x3719('0x13')]);}else{logger[_0x3719('0xc')](_0x3719('0xd'),_0x4dc490,_0x3719('0xe'));_0x4d968a(_0x5b870b['result']['message']);}})['catch'](function(_0x7b5ed0){logger[_0x3719('0x12')](_0x3719('0xd'),_0x4dc490,_0x7b5ed0);_0xa20f52(_0x7b5ed0);});});} \ No newline at end of file +var _0x90dc=['ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x5f1696,_0x1fa572){var _0x5630ad=function(_0x56cc90){while(--_0x56cc90){_0x5f1696['push'](_0x5f1696['shift']());}};_0x5630ad(++_0x1fa572);}(_0x90dc,0x69));var _0xc90d=function(_0x174215,_0x13732c){_0x174215=_0x174215-0x0;var _0x254298=_0x90dc[_0x174215];return _0x254298;};'use strict';var _=require(_0xc90d('0x0'));var util=require(_0xc90d('0x1'));var moment=require(_0xc90d('0x2'));var BPromise=require(_0xc90d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc90d('0x4'));var db=require(_0xc90d('0x5'))['db'];var utils=require(_0xc90d('0x6'));var logger=require(_0xc90d('0x7'))(_0xc90d('0x8'));var config=require(_0xc90d('0x9'));var jayson=require(_0xc90d('0xa'));var client=jayson[_0xc90d('0xb')][_0xc90d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa9b290,_0x75411a,_0x279f60){return new BPromise(function(_0x225483,_0x419fae){return client[_0xc90d('0xd')](_0xa9b290,_0x279f60)['then'](function(_0x4a3299){logger[_0xc90d('0xe')](_0xc90d('0xf'),_0x75411a,_0xc90d('0x10'));logger['debug'](_0xc90d('0x11'),_0x75411a,'request\x20sent',JSON[_0xc90d('0x12')](_0x4a3299));if(_0x4a3299[_0xc90d('0x13')]){if(_0x4a3299[_0xc90d('0x13')][_0xc90d('0x14')]===0x1f4){logger[_0xc90d('0x13')](_0xc90d('0xf'),_0x75411a,_0x4a3299[_0xc90d('0x13')][_0xc90d('0x15')]);return _0x419fae(_0x4a3299[_0xc90d('0x13')][_0xc90d('0x15')]);}logger[_0xc90d('0x13')](_0xc90d('0xf'),_0x75411a,_0x4a3299[_0xc90d('0x13')][_0xc90d('0x15')]);return _0x225483(_0x4a3299[_0xc90d('0x13')][_0xc90d('0x15')]);}else{logger[_0xc90d('0xe')](_0xc90d('0xf'),_0x75411a,_0xc90d('0x10'));_0x225483(_0x4a3299[_0xc90d('0x16')][_0xc90d('0x15')]);}})[_0xc90d('0x17')](function(_0x4cecb7){logger[_0xc90d('0x13')](_0xc90d('0xf'),_0x75411a,_0x4cecb7);_0x419fae(_0x4cecb7);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 38ffab2..225b524 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 _0xe4c4=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','path'];(function(_0x3f581f,_0x4ea03c){var _0x1e0d19=function(_0x2b9d8a){while(--_0x2b9d8a){_0x3f581f['push'](_0x3f581f['shift']());}};_0x1e0d19(++_0x4ea03c);}(_0xe4c4,0x11f));var _0x4e4c=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0xe4c4[_0xd0a847];return _0x2536ec;};'use strict';var multer=require('multer');var util=require(_0x4e4c('0x0'));var path=require(_0x4e4c('0x1'));var timeout=require(_0x4e4c('0x2'));var express=require('express');var router=express[_0x4e4c('0x3')]();var auth=require(_0x4e4c('0x4'));var interaction=require(_0x4e4c('0x5'));var config=require(_0x4e4c('0x6'));var controller=require(_0x4e4c('0x7'));router[_0x4e4c('0x8')](_0x4e4c('0x9'),auth[_0x4e4c('0xa')](),controller[_0x4e4c('0xb')]);router[_0x4e4c('0xc')]('/:id',auth[_0x4e4c('0xa')](),controller[_0x4e4c('0xd')]);router[_0x4e4c('0xe')](_0x4e4c('0x9'),auth[_0x4e4c('0xa')](),controller[_0x4e4c('0xf')]);module[_0x4e4c('0x10')]=router; \ No newline at end of file +var _0xb469=['../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0xc6794b,_0x1f03b7){var _0x3111b6=function(_0x3d3f9a){while(--_0x3d3f9a){_0xc6794b['push'](_0xc6794b['shift']());}};_0x3111b6(++_0x1f03b7);}(_0xb469,0x11a));var _0x9b46=function(_0x3fe537,_0x27f880){_0x3fe537=_0x3fe537-0x0;var _0x4d88e9=_0xb469[_0x3fe537];return _0x4d88e9;};'use strict';var multer=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var path=require('path');var timeout=require(_0x9b46('0x2'));var express=require(_0x9b46('0x3'));var router=express[_0x9b46('0x4')]();var auth=require(_0x9b46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9b46('0x6'));var controller=require(_0x9b46('0x7'));router[_0x9b46('0x8')](_0x9b46('0x9'),auth['isAuthenticated'](),controller[_0x9b46('0xa')]);router[_0x9b46('0xb')](_0x9b46('0x9'),auth[_0x9b46('0xc')](),controller[_0x9b46('0xd')]);router['delete']('/:id',auth[_0x9b46('0xc')](),controller[_0x9b46('0xe')]);module[_0x9b46('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 69ab741..9821132 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 _0x6207=['STRING','BOOLEAN','exports'];(function(_0xb2f562,_0x227063){var _0x46ebd6=function(_0x419900){while(--_0x419900){_0xb2f562['push'](_0xb2f562['shift']());}};_0x46ebd6(++_0x227063);}(_0x6207,0x1b5));var _0x7620=function(_0x4bd955,_0x3baae3){_0x4bd955=_0x4bd955-0x0;var _0x451c7f=_0x6207[_0x4bd955];return _0x451c7f;};'use strict';var Sequelize=require('sequelize');module[_0x7620('0x0')]={'name':{'type':Sequelize[_0x7620('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7620('0x1')]},'write':{'type':Sequelize[_0x7620('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x462c=['BOOLEAN','sequelize','exports'];(function(_0x3213b9,_0x41359c){var _0x5a4cfc=function(_0x489d0b){while(--_0x489d0b){_0x3213b9['push'](_0x3213b9['shift']());}};_0x5a4cfc(++_0x41359c);}(_0x462c,0x175));var _0xc462=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x462c[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xc462('0x0'));module[_0xc462('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xc462('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index beff669..84ce020 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 _0xfcc4=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','key','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','find','ids','getMembers','findOne','rawAttributes','removeMembers','addMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','http','then','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','end','count','offset','limit','status','set','Content-Range','apply','save','update','sendStatus','stack','name','index','ChatGroup','model','query'];(function(_0x38f58d,_0x3b3eab){var _0x362ec6=function(_0x10cd48){while(--_0x10cd48){_0x38f58d['push'](_0x38f58d['shift']());}};_0x362ec6(++_0x3b3eab);}(_0xfcc4,0x94));var _0x4fcc=function(_0x1f0679,_0x53d43c){_0x1f0679=_0x1f0679-0x0;var _0x3dc3a4=_0xfcc4[_0x1f0679];return _0x3dc3a4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4fcc('0x0'));var rimraf=require(_0x4fcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4fcc('0x2'));var moment=require(_0x4fcc('0x3'));var BPromise=require(_0x4fcc('0x4'));var Mustache=require(_0x4fcc('0x5'));var util=require(_0x4fcc('0x6'));var path=require(_0x4fcc('0x7'));var sox=require('sox');var csv=require(_0x4fcc('0x8'));var ejs=require(_0x4fcc('0x9'));var fs=require('fs');var _=require(_0x4fcc('0xa'));var squel=require(_0x4fcc('0xb'));var crypto=require(_0x4fcc('0xc'));var jsforce=require(_0x4fcc('0xd'));var deskjs=require(_0x4fcc('0xe'));var toCsv=require(_0x4fcc('0x8'));var querystring=require(_0x4fcc('0xf'));var Papa=require('papaparse');var authService=require(_0x4fcc('0x10'));var hardwareService=require(_0x4fcc('0x11'));var Redis=require(_0x4fcc('0x12'));var qs=require(_0x4fcc('0x13'));var logger=require(_0x4fcc('0x14'))('api');var utils=require(_0x4fcc('0x15'));var config=require(_0x4fcc('0x16'));var db=require(_0x4fcc('0x17'))['db'];config[_0x4fcc('0x18')]=_[_0x4fcc('0x19')](config[_0x4fcc('0x18')],{'host':_0x4fcc('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4fcc('0x18')]));require(_0x4fcc('0x1b'))[_0x4fcc('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x4fcc('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xe31220,_0x3a0954,_0x39f354,_0xf2164b){return new BPromise(function(_0x504942,_0x48485a){var _0x437582=_0xf2164b||client;return _0x437582['request'](_0xe31220,_0x39f354)[_0x4fcc('0x1e')](function(_0x2ec685){logger['info'](_0x4fcc('0x1f'),_0x3a0954,'request\x20sent');logger[_0x4fcc('0x20')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3a0954,_0x4fcc('0x21'),JSON[_0x4fcc('0x22')](_0x2ec685));if(_0x2ec685[_0x4fcc('0x23')]){if(_0x2ec685[_0x4fcc('0x23')][_0x4fcc('0x24')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x3a0954,_0x2ec685[_0x4fcc('0x23')][_0x4fcc('0x25')]);return _0x48485a(_0x2ec685[_0x4fcc('0x23')][_0x4fcc('0x25')]);}logger[_0x4fcc('0x23')](_0x4fcc('0x1f'),_0x3a0954,_0x2ec685['error'][_0x4fcc('0x25')]);return _0x504942(_0x2ec685[_0x4fcc('0x23')][_0x4fcc('0x25')]);}else{logger[_0x4fcc('0x26')](_0x4fcc('0x1f'),_0x3a0954,_0x4fcc('0x21'));_0x504942(_0x2ec685[_0x4fcc('0x27')][_0x4fcc('0x25')]);}})[_0x4fcc('0x28')](function(_0x5e1219){logger[_0x4fcc('0x23')](_0x4fcc('0x1f'),_0x3a0954,_0x5e1219);_0x48485a(_0x5e1219);});});}function respondWithStatusCode(_0x509970,_0x5ca201){_0x5ca201=_0x5ca201||0xcc;return function(_0x40527f){if(_0x40527f){return _0x509970['sendStatus'](_0x5ca201);}return _0x509970['status'](_0x5ca201)[_0x4fcc('0x29')]();};}function respondWithResult(_0x76ee2c,_0x52f689){_0x52f689=_0x52f689||0xc8;return function(_0x56bb91){if(_0x56bb91){return _0x76ee2c['status'](_0x52f689)['json'](_0x56bb91);}};}function respondWithFilteredResult(_0x4000f1,_0x26eb27){return function(_0xce08d1){if(_0xce08d1){var _0x54f1de=_0xce08d1[_0x4fcc('0x2a')],_0xe27501=_0x26eb27[_0x4fcc('0x2b')],_0xcec9f8=_0x26eb27[_0x4fcc('0x2b')]+_0x26eb27[_0x4fcc('0x2c')],_0x4f49fc;if(_0xcec9f8>=_0x54f1de){_0xcec9f8=_0x54f1de;_0x4f49fc=0xc8;}else{_0x4f49fc=0xce;}_0x4000f1[_0x4fcc('0x2d')](_0x4f49fc);return _0x4000f1[_0x4fcc('0x2e')](_0x4fcc('0x2f'),_0xe27501+'-'+_0xcec9f8+'/'+_0x54f1de)['json'](_0xce08d1);}return null;};}function patchUpdates(_0x2475e5){return function(_0x4730b3){try{jsonpatch[_0x4fcc('0x30')](_0x4730b3,_0x2475e5,!![]);}catch(_0x373ec1){return BPromise['reject'](_0x373ec1);}return _0x4730b3[_0x4fcc('0x31')]();};}function saveUpdates(_0x225808,_0x521e6e){return function(_0x1adc32){if(_0x1adc32){return _0x1adc32[_0x4fcc('0x32')](_0x225808)[_0x4fcc('0x1e')](function(_0x39666a){return _0x39666a;});}return null;};}function removeEntity(_0x2ee718,_0x5425c2){return function(_0x341325){if(_0x341325){return _0x341325['destroy']()['then'](function(){_0x2ee718[_0x4fcc('0x2d')](0xcc)[_0x4fcc('0x29')]();});}};}function handleEntityNotFound(_0x35f81a,_0x1e9144){return function(_0x5c0179){if(!_0x5c0179){_0x35f81a[_0x4fcc('0x33')](0x194);}return _0x5c0179;};}function handleError(_0x4609f0,_0x377077){_0x377077=_0x377077||0x1f4;return function(_0x44db88){logger[_0x4fcc('0x23')](_0x44db88[_0x4fcc('0x34')]);if(_0x44db88['name']){delete _0x44db88[_0x4fcc('0x35')];}_0x4609f0[_0x4fcc('0x2d')](_0x377077)['send'](_0x44db88);};}exports[_0x4fcc('0x36')]=function(_0x4654b9,_0x2a07b3){var _0x39cc8e={},_0x577d33={},_0x2d0950={'count':0x0,'rows':[]};var _0x354671=db[_0x4fcc('0x37')]['rawAttributes'];_0x577d33[_0x4fcc('0x38')]=_['keys'](_0x354671);_0x577d33[_0x4fcc('0x39')]=_[_0x4fcc('0x3a')](_0x4654b9['query']);_0x577d33['filters']=_[_0x4fcc('0x3b')](_0x577d33[_0x4fcc('0x38')],_0x577d33[_0x4fcc('0x39')]);_0x39cc8e[_0x4fcc('0x3c')]=_[_0x4fcc('0x3b')](_0x577d33['model'],qs[_0x4fcc('0x3d')](_0x4654b9[_0x4fcc('0x39')][_0x4fcc('0x3d')]));_0x39cc8e['attributes']=_0x39cc8e[_0x4fcc('0x3c')][_0x4fcc('0x3e')]?_0x39cc8e[_0x4fcc('0x3c')]:_0x577d33[_0x4fcc('0x38')];if(!_0x4654b9[_0x4fcc('0x39')][_0x4fcc('0x3f')](_0x4fcc('0x40'))){_0x39cc8e['limit']=qs[_0x4fcc('0x2c')](_0x4654b9[_0x4fcc('0x39')][_0x4fcc('0x2c')]);_0x39cc8e['offset']=qs[_0x4fcc('0x2b')](_0x4654b9['query'][_0x4fcc('0x2b')]);}_0x39cc8e[_0x4fcc('0x41')]=qs[_0x4fcc('0x42')](_0x4654b9[_0x4fcc('0x39')][_0x4fcc('0x42')]);_0x39cc8e[_0x4fcc('0x43')]=qs[_0x4fcc('0x44')](_[_0x4fcc('0x45')](_0x4654b9[_0x4fcc('0x39')],_0x577d33[_0x4fcc('0x44')]));if(_0x4654b9['query'][_0x4fcc('0x46')]){_0x39cc8e[_0x4fcc('0x43')]=_['merge'](_0x39cc8e['where'],{'$or':_[_0x4fcc('0x47')](_0x354671,function(_0x4d8f69){if(_0x4d8f69['type'][_0x4fcc('0x48')]!==_0x4fcc('0x49')){var _0x27ecc6={};_0x27ecc6[_0x4d8f69['field']]={'$like':'%'+_0x4654b9[_0x4fcc('0x39')]['filter']+'%'};return _0x27ecc6;}})});}_0x39cc8e=_[_0x4fcc('0x4a')]({},_0x39cc8e,_0x4654b9['options']);var _0x4bcad9={'where':_0x39cc8e[_0x4fcc('0x43')]};return db[_0x4fcc('0x37')][_0x4fcc('0x2a')](_0x4bcad9)[_0x4fcc('0x1e')](function(_0x135d25){_0x2d0950[_0x4fcc('0x2a')]=_0x135d25;if(_0x4654b9['query'][_0x4fcc('0x4b')]){_0x39cc8e[_0x4fcc('0x4c')]=[{'all':!![]}];}return db[_0x4fcc('0x37')][_0x4fcc('0x4d')](_0x39cc8e);})[_0x4fcc('0x1e')](function(_0x199579){_0x2d0950[_0x4fcc('0x4e')]=_0x199579;return _0x2d0950;})[_0x4fcc('0x1e')](respondWithFilteredResult(_0x2a07b3,_0x39cc8e))[_0x4fcc('0x28')](handleError(_0x2a07b3,null));};exports[_0x4fcc('0x4f')]=function(_0xbe1746,_0x35cd3f){var _0x1dfbbc={'raw':!![],'where':{'id':_0xbe1746[_0x4fcc('0x50')]['id']}},_0x367f7c={};_0x367f7c[_0x4fcc('0x38')]=_['keys'](db[_0x4fcc('0x37')]['rawAttributes']);_0x367f7c['query']=_[_0x4fcc('0x3a')](_0xbe1746['query']);_0x367f7c[_0x4fcc('0x44')]=_['intersection'](_0x367f7c[_0x4fcc('0x38')],_0x367f7c[_0x4fcc('0x39')]);_0x1dfbbc['attributes']=_[_0x4fcc('0x3b')](_0x367f7c[_0x4fcc('0x38')],qs[_0x4fcc('0x3d')](_0xbe1746[_0x4fcc('0x39')][_0x4fcc('0x3d')]));_0x1dfbbc['attributes']=_0x1dfbbc[_0x4fcc('0x3c')][_0x4fcc('0x3e')]?_0x1dfbbc[_0x4fcc('0x3c')]:_0x367f7c['model'];if(_0xbe1746[_0x4fcc('0x39')]['includeAll']){_0x1dfbbc['include']=[{'all':!![]}];}_0x1dfbbc=_[_0x4fcc('0x4a')]({},_0x1dfbbc,_0xbe1746[_0x4fcc('0x51')]);return db[_0x4fcc('0x37')]['find'](_0x1dfbbc)[_0x4fcc('0x1e')](handleEntityNotFound(_0x35cd3f,null))['then'](respondWithResult(_0x35cd3f,null))['catch'](handleError(_0x35cd3f,null));};exports[_0x4fcc('0x52')]=function(_0xecd1cc,_0x339418){return db['ChatGroup'][_0x4fcc('0x52')](_0xecd1cc[_0x4fcc('0x53')],{})[_0x4fcc('0x1e')](respondWithResult(_0x339418,0xc9))[_0x4fcc('0x28')](handleError(_0x339418,null));};exports[_0x4fcc('0x32')]=function(_0x4e0af1,_0xac6d54){if(_0x4e0af1[_0x4fcc('0x53')]['id']){delete _0x4e0af1['body']['id'];}return db[_0x4fcc('0x37')]['find']({'where':{'id':_0x4e0af1[_0x4fcc('0x50')]['id']}})[_0x4fcc('0x1e')](handleEntityNotFound(_0xac6d54,null))[_0x4fcc('0x1e')](saveUpdates(_0x4e0af1['body'],null))['then'](respondWithResult(_0xac6d54,null))[_0x4fcc('0x28')](handleError(_0xac6d54,null));};exports[_0x4fcc('0x54')]=function(_0x4f7989,_0x5dfac8){return db[_0x4fcc('0x37')]['find']({'where':{'id':_0x4f7989['params']['id']}})[_0x4fcc('0x1e')](handleEntityNotFound(_0x5dfac8,null))[_0x4fcc('0x1e')](removeEntity(_0x5dfac8,null))[_0x4fcc('0x28')](handleError(_0x5dfac8,null));};exports[_0x4fcc('0x55')]=function(_0x1848cf,_0x151e7b){return db['ChatGroup']['describe']()[_0x4fcc('0x1e')](respondWithResult(_0x151e7b,null))[_0x4fcc('0x28')](handleError(_0x151e7b,null));};exports[_0x4fcc('0x56')]=function(_0x49f83b,_0x53f099,_0x534a96){return db[_0x4fcc('0x57')][_0x4fcc('0x2a')]({'where':{'ChatGroupId':_0x49f83b[_0x4fcc('0x50')]['id'],'ToId':_0x49f83b[_0x4fcc('0x58')]['id'],'read':![]}})[_0x4fcc('0x1e')](function(_0x5c4cf2){return{'id':_[_0x4fcc('0x59')](_0x49f83b['params']['id']),'count':_0x5c4cf2};})[_0x4fcc('0x1e')](respondWithResult(_0x53f099,null))[_0x4fcc('0x28')](handleError(_0x53f099,null));};exports[_0x4fcc('0x5a')]=function(_0x5e0599,_0xb831c1,_0xd84dc4){return db[_0x4fcc('0x37')][_0x4fcc('0x5b')]({'where':{'id':_0x5e0599['params']['id']}})[_0x4fcc('0x1e')](handleEntityNotFound(_0xb831c1,null))[_0x4fcc('0x1e')](function(_0x534113){if(_0x534113){return _0x534113[_0x4fcc('0x5a')](_0x5e0599[_0x4fcc('0x53')]['ids'],_['omit'](_0x5e0599['body'],[_0x4fcc('0x5c'),'id'])||{});}})['then'](respondWithResult(_0xb831c1,null))[_0x4fcc('0x28')](handleError(_0xb831c1,null));};exports[_0x4fcc('0x5d')]=function(_0x1abf8f,_0x5b5c12,_0xbee5a5){var _0x1922de={};var _0x4383e6={};var _0x18c8dc;var _0x35e80f;return db[_0x4fcc('0x37')][_0x4fcc('0x5e')]({'where':{'id':_0x1abf8f[_0x4fcc('0x50')]['id']}})[_0x4fcc('0x1e')](handleEntityNotFound(_0x5b5c12,null))[_0x4fcc('0x1e')](function(_0x2ea25d){if(_0x2ea25d){_0x18c8dc=_0x2ea25d;_0x4383e6[_0x4fcc('0x38')]=_['keys'](db['User'][_0x4fcc('0x5f')]);_0x4383e6[_0x4fcc('0x39')]=_[_0x4fcc('0x3a')](_0x1abf8f[_0x4fcc('0x39')]);_0x4383e6[_0x4fcc('0x44')]=_[_0x4fcc('0x3b')](_0x4383e6['model'],_0x4383e6['query']);_0x1922de[_0x4fcc('0x3c')]=_[_0x4fcc('0x3b')](_0x4383e6['model'],qs['fields'](_0x1abf8f[_0x4fcc('0x39')]['fields']));_0x1922de[_0x4fcc('0x3c')]=_0x1922de[_0x4fcc('0x3c')][_0x4fcc('0x3e')]?_0x1922de['attributes']:_0x4383e6[_0x4fcc('0x38')];_0x1922de[_0x4fcc('0x41')]=qs[_0x4fcc('0x42')](_0x1abf8f[_0x4fcc('0x39')]['sort']);_0x1922de[_0x4fcc('0x43')]=qs[_0x4fcc('0x44')](_['pick'](_0x1abf8f['query'],_0x4383e6[_0x4fcc('0x44')]));if(_0x1abf8f['query'][_0x4fcc('0x46')]){_0x1922de[_0x4fcc('0x43')]=_[_0x4fcc('0x4a')](_0x1922de['where'],{'$or':_[_0x4fcc('0x47')](_0x1922de[_0x4fcc('0x3c')],function(_0xc458ff){var _0x56bac0={};_0x56bac0[_0xc458ff]={'$like':'%'+_0x1abf8f['query'][_0x4fcc('0x46')]+'%'};return _0x56bac0;})});}_0x1922de=_[_0x4fcc('0x4a')]({},_0x1922de,_0x1abf8f['options']);return _0x18c8dc[_0x4fcc('0x5d')](_0x1922de);}})[_0x4fcc('0x1e')](function(_0x54466e){if(_0x54466e){_0x35e80f=_0x54466e[_0x4fcc('0x3e')];if(!_0x1abf8f['query'][_0x4fcc('0x3f')](_0x4fcc('0x40'))){_0x1922de[_0x4fcc('0x2c')]=qs['limit'](_0x1abf8f[_0x4fcc('0x39')][_0x4fcc('0x2c')]);_0x1922de[_0x4fcc('0x2b')]=qs['offset'](_0x1abf8f[_0x4fcc('0x39')][_0x4fcc('0x2b')]);}return _0x18c8dc['getMembers'](_0x1922de);}})['then'](function(_0x1b46bf){if(_0x1b46bf){return _0x1b46bf?{'count':_0x35e80f,'rows':_0x1b46bf}:null;}})['then'](respondWithResult(_0x5b5c12,null))[_0x4fcc('0x28')](handleError(_0x5b5c12,null));};exports[_0x4fcc('0x60')]=function(_0x3f8d35,_0x4b1fb7,_0x4b626b){var _0x3adcff;return db[_0x4fcc('0x37')][_0x4fcc('0x5b')]({'where':{'id':_0x3f8d35['params']['id']}})['then'](handleEntityNotFound(_0x4b1fb7,null))['then'](function(_0x4eab02){if(_0x4eab02){return _0x4eab02[_0x4fcc('0x60')](_0x3f8d35['query'][_0x4fcc('0x5c')]);}})[_0x4fcc('0x1e')](respondWithStatusCode(_0x4b1fb7,null))[_0x4fcc('0x28')](handleError(_0x4b1fb7,null));};exports[_0x4fcc('0x61')]=function(_0x45fd48,_0x450d83,_0x15e0da){if(_0x45fd48[_0x4fcc('0x53')]['id']){delete _0x45fd48[_0x4fcc('0x53')]['id'];}return db[_0x4fcc('0x37')][_0x4fcc('0x5b')]({'where':{'id':_0x45fd48[_0x4fcc('0x50')]['id']}})[_0x4fcc('0x1e')](handleEntityNotFound(_0x450d83,null))[_0x4fcc('0x1e')](function(_0x3ee20a){if(_0x3ee20a){_0x45fd48[_0x4fcc('0x53')]['ChatGroupId']=_0x3ee20a['id'];return db[_0x4fcc('0x57')][_0x4fcc('0x52')](_0x45fd48[_0x4fcc('0x53')]);}})[_0x4fcc('0x1e')](respondWithResult(_0x450d83,null))['catch'](handleError(_0x450d83,null));};exports[_0x4fcc('0x62')]=function(_0x5cf197,_0x37c1ff,_0xfac24b){var _0x2f8bc7={};var _0x1a9e4f={};var _0x347f33;var _0x4c2dc0;return db[_0x4fcc('0x37')]['findOne']({'where':{'id':_0x5cf197[_0x4fcc('0x50')]['id']}})[_0x4fcc('0x1e')](handleEntityNotFound(_0x37c1ff,null))[_0x4fcc('0x1e')](function(_0x4a275a){if(_0x4a275a){_0x347f33=_0x4a275a;_0x1a9e4f['model']=_[_0x4fcc('0x3a')](db['ChatInternalMessage'][_0x4fcc('0x5f')]);_0x1a9e4f[_0x4fcc('0x39')]=_[_0x4fcc('0x3a')](_0x5cf197['query']);_0x1a9e4f[_0x4fcc('0x44')]=_[_0x4fcc('0x3b')](_0x1a9e4f[_0x4fcc('0x38')],_0x1a9e4f['query']);_0x2f8bc7[_0x4fcc('0x3c')]=_['intersection'](_0x1a9e4f[_0x4fcc('0x38')],qs['fields'](_0x5cf197['query']['fields']));_0x2f8bc7[_0x4fcc('0x3c')]=_0x2f8bc7[_0x4fcc('0x3c')][_0x4fcc('0x3e')]?_0x2f8bc7[_0x4fcc('0x3c')]:_0x1a9e4f[_0x4fcc('0x38')];_0x2f8bc7['order']=qs[_0x4fcc('0x42')](_0x5cf197[_0x4fcc('0x39')][_0x4fcc('0x42')]);_0x2f8bc7[_0x4fcc('0x43')]=qs[_0x4fcc('0x44')](_[_0x4fcc('0x45')](_0x5cf197[_0x4fcc('0x39')],_0x1a9e4f[_0x4fcc('0x44')]));if(_0x5cf197[_0x4fcc('0x39')]['filter']){_0x2f8bc7[_0x4fcc('0x43')]=_[_0x4fcc('0x4a')](_0x2f8bc7[_0x4fcc('0x43')],{'$or':_['map'](_0x2f8bc7[_0x4fcc('0x3c')],function(_0x2a2b84){var _0x451ece={};_0x451ece[_0x2a2b84]={'$like':'%'+_0x5cf197[_0x4fcc('0x39')]['filter']+'%'};return _0x451ece;})});}if(_0x5cf197[_0x4fcc('0x39')][_0x4fcc('0x63')]){var _0x393081=_0x5cf197[_0x4fcc('0x39')][_0x4fcc('0x63')][_0x4fcc('0x64')](',');var _0x152d3e={};_0x152d3e[_0x393081[0x0]]={'$gte':moment(_0x393081[0x1])[_0x4fcc('0x65')](_0x4fcc('0x66'))};_0x2f8bc7[_0x4fcc('0x43')]=_[_0x4fcc('0x4a')](_0x2f8bc7['where'],_0x152d3e);}_0x2f8bc7=_['merge']({},_0x2f8bc7,_0x5cf197['options']);return _0x347f33[_0x4fcc('0x62')](_0x2f8bc7);}})[_0x4fcc('0x1e')](function(_0x2ac715){if(_0x2ac715){_0x4c2dc0=_0x2ac715['length'];if(!_0x5cf197[_0x4fcc('0x39')][_0x4fcc('0x3f')](_0x4fcc('0x40'))){_0x2f8bc7[_0x4fcc('0x2c')]=qs[_0x4fcc('0x2c')](_0x5cf197[_0x4fcc('0x39')][_0x4fcc('0x2c')]);_0x2f8bc7['offset']=qs['offset'](_0x5cf197[_0x4fcc('0x39')][_0x4fcc('0x2b')]);}return _0x347f33[_0x4fcc('0x62')](_0x2f8bc7);}})[_0x4fcc('0x1e')](function(_0x5aa6d8){if(_0x5aa6d8){return _0x5aa6d8?{'count':_0x4c2dc0,'rows':_0x5aa6d8}:null;}})[_0x4fcc('0x1e')](respondWithResult(_0x37c1ff,null))[_0x4fcc('0x28')](handleError(_0x37c1ff,null));}; \ No newline at end of file +var _0x17ee=['split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatGroup.socket','register','jayson/promise','client','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','update','then','destroy','stack','name','send','index','ChatGroup','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','find','create','body','params','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','removeMembers','ChatGroupId','getMessages','findOne','$gte'];(function(_0x161483,_0xc096cd){var _0x2f5235=function(_0x1a50a6){while(--_0x1a50a6){_0x161483['push'](_0x161483['shift']());}};_0x2f5235(++_0xc096cd);}(_0x17ee,0x197));var _0xe17e=function(_0x588186,_0x4de763){_0x588186=_0x588186-0x0;var _0xa0adff=_0x17ee[_0x588186];return _0xa0adff;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe17e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe17e('0x1'));var rp=require(_0xe17e('0x2'));var moment=require(_0xe17e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe17e('0x4'));var util=require(_0xe17e('0x5'));var path=require(_0xe17e('0x6'));var sox=require('sox');var csv=require(_0xe17e('0x7'));var ejs=require(_0xe17e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe17e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe17e('0xa'));var toCsv=require(_0xe17e('0x7'));var querystring=require(_0xe17e('0xb'));var Papa=require('papaparse');var authService=require(_0xe17e('0xc'));var hardwareService=require(_0xe17e('0xd'));var Redis=require(_0xe17e('0xe'));var qs=require(_0xe17e('0xf'));var logger=require('../../config/logger')(_0xe17e('0x10'));var utils=require('../../config/utils');var config=require(_0xe17e('0x11'));var db=require(_0xe17e('0x12'))['db'];config['redis']=_[_0xe17e('0x13')](config[_0xe17e('0x14')],{'host':_0xe17e('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe17e('0x14')]));require(_0xe17e('0x16'))[_0xe17e('0x17')](socket);var jayson=require(_0xe17e('0x18'));var client=jayson[_0xe17e('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ee7ea,_0x27d4f7,_0x43d55f,_0x42cd99){return new BPromise(function(_0x17a0f8,_0x32a19d){var _0x1ad127=_0x42cd99||client;return _0x1ad127[_0xe17e('0x1a')](_0x4ee7ea,_0x43d55f)['then'](function(_0x198511){logger[_0xe17e('0x1b')](_0xe17e('0x1c'),_0x27d4f7,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x27d4f7,_0xe17e('0x1d'),JSON[_0xe17e('0x1e')](_0x198511));if(_0x198511['error']){if(_0x198511[_0xe17e('0x1f')][_0xe17e('0x20')]===0x1f4){logger[_0xe17e('0x1f')](_0xe17e('0x1c'),_0x27d4f7,_0x198511[_0xe17e('0x1f')][_0xe17e('0x21')]);return _0x32a19d(_0x198511[_0xe17e('0x1f')][_0xe17e('0x21')]);}logger[_0xe17e('0x1f')](_0xe17e('0x1c'),_0x27d4f7,_0x198511[_0xe17e('0x1f')]['message']);return _0x17a0f8(_0x198511[_0xe17e('0x1f')][_0xe17e('0x21')]);}else{logger[_0xe17e('0x1b')](_0xe17e('0x1c'),_0x27d4f7,_0xe17e('0x1d'));_0x17a0f8(_0x198511[_0xe17e('0x22')][_0xe17e('0x21')]);}})[_0xe17e('0x23')](function(_0x4228cd){logger['error'](_0xe17e('0x1c'),_0x27d4f7,_0x4228cd);_0x32a19d(_0x4228cd);});});}function respondWithStatusCode(_0x3b5209,_0x4455b8){_0x4455b8=_0x4455b8||0xcc;return function(_0xe33e20){if(_0xe33e20){return _0x3b5209[_0xe17e('0x24')](_0x4455b8);}return _0x3b5209[_0xe17e('0x25')](_0x4455b8)[_0xe17e('0x26')]();};}function respondWithResult(_0x4e0e30,_0xa45ae4){_0xa45ae4=_0xa45ae4||0xc8;return function(_0x1235bf){if(_0x1235bf){return _0x4e0e30[_0xe17e('0x25')](_0xa45ae4)[_0xe17e('0x27')](_0x1235bf);}};}function respondWithFilteredResult(_0xc0edf1,_0xdf508d){return function(_0x349e1f){if(_0x349e1f){var _0x2b37fb=_0x349e1f[_0xe17e('0x28')],_0x5de745=_0xdf508d[_0xe17e('0x29')],_0x42cd55=_0xdf508d[_0xe17e('0x29')]+_0xdf508d['limit'],_0x10ccdb;if(_0x42cd55>=_0x2b37fb){_0x42cd55=_0x2b37fb;_0x10ccdb=0xc8;}else{_0x10ccdb=0xce;}_0xc0edf1[_0xe17e('0x25')](_0x10ccdb);return _0xc0edf1[_0xe17e('0x2a')](_0xe17e('0x2b'),_0x5de745+'-'+_0x42cd55+'/'+_0x2b37fb)['json'](_0x349e1f);}return null;};}function patchUpdates(_0x33d843){return function(_0x54a3bf){try{jsonpatch[_0xe17e('0x2c')](_0x54a3bf,_0x33d843,!![]);}catch(_0x3ea5a6){return BPromise['reject'](_0x3ea5a6);}return _0x54a3bf['save']();};}function saveUpdates(_0x32fb51,_0x3fddf9){return function(_0x4701b8){if(_0x4701b8){return _0x4701b8[_0xe17e('0x2d')](_0x32fb51)[_0xe17e('0x2e')](function(_0x494652){return _0x494652;});}return null;};}function removeEntity(_0x37bb52,_0x595841){return function(_0x5ae3fc){if(_0x5ae3fc){return _0x5ae3fc[_0xe17e('0x2f')]()[_0xe17e('0x2e')](function(){_0x37bb52[_0xe17e('0x25')](0xcc)[_0xe17e('0x26')]();});}};}function handleEntityNotFound(_0x3ab8a9,_0x55f452){return function(_0x52862a){if(!_0x52862a){_0x3ab8a9['sendStatus'](0x194);}return _0x52862a;};}function handleError(_0x4ca118,_0x2c6dc8){_0x2c6dc8=_0x2c6dc8||0x1f4;return function(_0x5028e0){logger['error'](_0x5028e0[_0xe17e('0x30')]);if(_0x5028e0[_0xe17e('0x31')]){delete _0x5028e0[_0xe17e('0x31')];}_0x4ca118[_0xe17e('0x25')](_0x2c6dc8)[_0xe17e('0x32')](_0x5028e0);};}exports[_0xe17e('0x33')]=function(_0x5cfb2c,_0x2d1632){var _0x1dd341={},_0x5c2338={},_0x47c362={'count':0x0,'rows':[]};var _0x1f075c=db[_0xe17e('0x34')][_0xe17e('0x35')];_0x5c2338['model']=_['keys'](_0x1f075c);_0x5c2338[_0xe17e('0x36')]=_[_0xe17e('0x37')](_0x5cfb2c[_0xe17e('0x36')]);_0x5c2338[_0xe17e('0x38')]=_[_0xe17e('0x39')](_0x5c2338[_0xe17e('0x3a')],_0x5c2338[_0xe17e('0x36')]);_0x1dd341['attributes']=_[_0xe17e('0x39')](_0x5c2338[_0xe17e('0x3a')],qs[_0xe17e('0x3b')](_0x5cfb2c[_0xe17e('0x36')]['fields']));_0x1dd341[_0xe17e('0x3c')]=_0x1dd341['attributes'][_0xe17e('0x3d')]?_0x1dd341[_0xe17e('0x3c')]:_0x5c2338[_0xe17e('0x3a')];if(!_0x5cfb2c['query'][_0xe17e('0x3e')](_0xe17e('0x3f'))){_0x1dd341[_0xe17e('0x40')]=qs[_0xe17e('0x40')](_0x5cfb2c['query'][_0xe17e('0x40')]);_0x1dd341[_0xe17e('0x29')]=qs[_0xe17e('0x29')](_0x5cfb2c['query'][_0xe17e('0x29')]);}_0x1dd341[_0xe17e('0x41')]=qs[_0xe17e('0x42')](_0x5cfb2c[_0xe17e('0x36')][_0xe17e('0x42')]);_0x1dd341[_0xe17e('0x43')]=qs[_0xe17e('0x38')](_[_0xe17e('0x44')](_0x5cfb2c[_0xe17e('0x36')],_0x5c2338[_0xe17e('0x38')]));if(_0x5cfb2c[_0xe17e('0x36')][_0xe17e('0x45')]){_0x1dd341['where']=_[_0xe17e('0x46')](_0x1dd341[_0xe17e('0x43')],{'$or':_[_0xe17e('0x47')](_0x1f075c,function(_0x11bcd5){if(_0x11bcd5['type'][_0xe17e('0x48')]!==_0xe17e('0x49')){var _0x1bdbd2={};_0x1bdbd2[_0x11bcd5[_0xe17e('0x4a')]]={'$like':'%'+_0x5cfb2c[_0xe17e('0x36')][_0xe17e('0x45')]+'%'};return _0x1bdbd2;}})});}_0x1dd341=_[_0xe17e('0x46')]({},_0x1dd341,_0x5cfb2c[_0xe17e('0x4b')]);var _0x1f1767={'where':_0x1dd341[_0xe17e('0x43')]};return db[_0xe17e('0x34')][_0xe17e('0x28')](_0x1f1767)[_0xe17e('0x2e')](function(_0x37f218){_0x47c362[_0xe17e('0x28')]=_0x37f218;if(_0x5cfb2c[_0xe17e('0x36')][_0xe17e('0x4c')]){_0x1dd341[_0xe17e('0x4d')]=[{'all':!![]}];}return db[_0xe17e('0x34')][_0xe17e('0x4e')](_0x1dd341);})[_0xe17e('0x2e')](function(_0x5565b6){_0x47c362[_0xe17e('0x4f')]=_0x5565b6;return _0x47c362;})[_0xe17e('0x2e')](respondWithFilteredResult(_0x2d1632,_0x1dd341))[_0xe17e('0x23')](handleError(_0x2d1632,null));};exports[_0xe17e('0x50')]=function(_0x386cc5,_0x6edb43){var _0xec45b5={'raw':!![],'where':{'id':_0x386cc5['params']['id']}},_0x11dc7f={};_0x11dc7f[_0xe17e('0x3a')]=_[_0xe17e('0x37')](db[_0xe17e('0x34')]['rawAttributes']);_0x11dc7f['query']=_[_0xe17e('0x37')](_0x386cc5[_0xe17e('0x36')]);_0x11dc7f[_0xe17e('0x38')]=_[_0xe17e('0x39')](_0x11dc7f[_0xe17e('0x3a')],_0x11dc7f[_0xe17e('0x36')]);_0xec45b5[_0xe17e('0x3c')]=_[_0xe17e('0x39')](_0x11dc7f[_0xe17e('0x3a')],qs[_0xe17e('0x3b')](_0x386cc5[_0xe17e('0x36')]['fields']));_0xec45b5[_0xe17e('0x3c')]=_0xec45b5[_0xe17e('0x3c')][_0xe17e('0x3d')]?_0xec45b5['attributes']:_0x11dc7f[_0xe17e('0x3a')];if(_0x386cc5[_0xe17e('0x36')][_0xe17e('0x4c')]){_0xec45b5[_0xe17e('0x4d')]=[{'all':!![]}];}_0xec45b5=_[_0xe17e('0x46')]({},_0xec45b5,_0x386cc5[_0xe17e('0x4b')]);return db[_0xe17e('0x34')][_0xe17e('0x51')](_0xec45b5)[_0xe17e('0x2e')](handleEntityNotFound(_0x6edb43,null))[_0xe17e('0x2e')](respondWithResult(_0x6edb43,null))[_0xe17e('0x23')](handleError(_0x6edb43,null));};exports['create']=function(_0x36fee1,_0x21b9b3){return db[_0xe17e('0x34')][_0xe17e('0x52')](_0x36fee1[_0xe17e('0x53')],{})[_0xe17e('0x2e')](respondWithResult(_0x21b9b3,0xc9))[_0xe17e('0x23')](handleError(_0x21b9b3,null));};exports[_0xe17e('0x2d')]=function(_0x414a59,_0xe0f296){if(_0x414a59[_0xe17e('0x53')]['id']){delete _0x414a59['body']['id'];}return db[_0xe17e('0x34')][_0xe17e('0x51')]({'where':{'id':_0x414a59['params']['id']}})['then'](handleEntityNotFound(_0xe0f296,null))['then'](saveUpdates(_0x414a59[_0xe17e('0x53')],null))[_0xe17e('0x2e')](respondWithResult(_0xe0f296,null))['catch'](handleError(_0xe0f296,null));};exports['destroy']=function(_0x13bcb5,_0x2d5f1a){return db[_0xe17e('0x34')][_0xe17e('0x51')]({'where':{'id':_0x13bcb5[_0xe17e('0x54')]['id']}})[_0xe17e('0x2e')](handleEntityNotFound(_0x2d5f1a,null))[_0xe17e('0x2e')](removeEntity(_0x2d5f1a,null))[_0xe17e('0x23')](handleError(_0x2d5f1a,null));};exports[_0xe17e('0x55')]=function(_0x16c0e3,_0xc9ed4a){return db['ChatGroup'][_0xe17e('0x55')]()[_0xe17e('0x2e')](respondWithResult(_0xc9ed4a,null))['catch'](handleError(_0xc9ed4a,null));};exports[_0xe17e('0x56')]=function(_0x4dba24,_0x2dbf76,_0x296f4c){return db[_0xe17e('0x57')][_0xe17e('0x28')]({'where':{'ChatGroupId':_0x4dba24[_0xe17e('0x54')]['id'],'ToId':_0x4dba24['user']['id'],'read':![]}})['then'](function(_0x11faf5){return{'id':_[_0xe17e('0x58')](_0x4dba24[_0xe17e('0x54')]['id']),'count':_0x11faf5};})[_0xe17e('0x2e')](respondWithResult(_0x2dbf76,null))['catch'](handleError(_0x2dbf76,null));};exports[_0xe17e('0x59')]=function(_0x23de82,_0x3d8375,_0x924321){return db[_0xe17e('0x34')]['find']({'where':{'id':_0x23de82[_0xe17e('0x54')]['id']}})[_0xe17e('0x2e')](handleEntityNotFound(_0x3d8375,null))['then'](function(_0x3de09d){if(_0x3de09d){return _0x3de09d['addMembers'](_0x23de82[_0xe17e('0x53')][_0xe17e('0x5a')],_[_0xe17e('0x5b')](_0x23de82['body'],[_0xe17e('0x5a'),'id'])||{});}})[_0xe17e('0x2e')](respondWithResult(_0x3d8375,null))['catch'](handleError(_0x3d8375,null));};exports[_0xe17e('0x5c')]=function(_0x26e406,_0xde3131,_0xf000d2){var _0x5da749={};var _0xfd1109={};var _0x1fef1d;var _0x1d314e;return db['ChatGroup']['findOne']({'where':{'id':_0x26e406[_0xe17e('0x54')]['id']}})[_0xe17e('0x2e')](handleEntityNotFound(_0xde3131,null))[_0xe17e('0x2e')](function(_0x4a0672){if(_0x4a0672){_0x1fef1d=_0x4a0672;_0xfd1109[_0xe17e('0x3a')]=_[_0xe17e('0x37')](db['User'][_0xe17e('0x35')]);_0xfd1109[_0xe17e('0x36')]=_['keys'](_0x26e406['query']);_0xfd1109[_0xe17e('0x38')]=_[_0xe17e('0x39')](_0xfd1109[_0xe17e('0x3a')],_0xfd1109[_0xe17e('0x36')]);_0x5da749['attributes']=_[_0xe17e('0x39')](_0xfd1109[_0xe17e('0x3a')],qs[_0xe17e('0x3b')](_0x26e406[_0xe17e('0x36')][_0xe17e('0x3b')]));_0x5da749[_0xe17e('0x3c')]=_0x5da749[_0xe17e('0x3c')][_0xe17e('0x3d')]?_0x5da749[_0xe17e('0x3c')]:_0xfd1109['model'];_0x5da749[_0xe17e('0x41')]=qs[_0xe17e('0x42')](_0x26e406[_0xe17e('0x36')][_0xe17e('0x42')]);_0x5da749[_0xe17e('0x43')]=qs['filters'](_[_0xe17e('0x44')](_0x26e406[_0xe17e('0x36')],_0xfd1109[_0xe17e('0x38')]));if(_0x26e406['query'][_0xe17e('0x45')]){_0x5da749['where']=_['merge'](_0x5da749[_0xe17e('0x43')],{'$or':_['map'](_0x5da749[_0xe17e('0x3c')],function(_0x4f18e5){var _0x5a212f={};_0x5a212f[_0x4f18e5]={'$like':'%'+_0x26e406['query'][_0xe17e('0x45')]+'%'};return _0x5a212f;})});}_0x5da749=_[_0xe17e('0x46')]({},_0x5da749,_0x26e406[_0xe17e('0x4b')]);return _0x1fef1d['getMembers'](_0x5da749);}})['then'](function(_0x556866){if(_0x556866){_0x1d314e=_0x556866['length'];if(!_0x26e406[_0xe17e('0x36')]['hasOwnProperty'](_0xe17e('0x3f'))){_0x5da749[_0xe17e('0x40')]=qs[_0xe17e('0x40')](_0x26e406[_0xe17e('0x36')][_0xe17e('0x40')]);_0x5da749[_0xe17e('0x29')]=qs['offset'](_0x26e406['query'][_0xe17e('0x29')]);}return _0x1fef1d[_0xe17e('0x5c')](_0x5da749);}})[_0xe17e('0x2e')](function(_0x8bf83){if(_0x8bf83){return _0x8bf83?{'count':_0x1d314e,'rows':_0x8bf83}:null;}})['then'](respondWithResult(_0xde3131,null))[_0xe17e('0x23')](handleError(_0xde3131,null));};exports[_0xe17e('0x5d')]=function(_0x309133,_0x547d4b,_0x593a96){var _0x3fc55b;return db[_0xe17e('0x34')]['find']({'where':{'id':_0x309133[_0xe17e('0x54')]['id']}})[_0xe17e('0x2e')](handleEntityNotFound(_0x547d4b,null))[_0xe17e('0x2e')](function(_0x28feb9){if(_0x28feb9){return _0x28feb9[_0xe17e('0x5d')](_0x309133['query'][_0xe17e('0x5a')]);}})[_0xe17e('0x2e')](respondWithStatusCode(_0x547d4b,null))[_0xe17e('0x23')](handleError(_0x547d4b,null));};exports['addMessage']=function(_0xe786db,_0x499339,_0x193b12){if(_0xe786db[_0xe17e('0x53')]['id']){delete _0xe786db[_0xe17e('0x53')]['id'];}return db[_0xe17e('0x34')]['find']({'where':{'id':_0xe786db['params']['id']}})[_0xe17e('0x2e')](handleEntityNotFound(_0x499339,null))['then'](function(_0x1827ad){if(_0x1827ad){_0xe786db['body'][_0xe17e('0x5e')]=_0x1827ad['id'];return db[_0xe17e('0x57')][_0xe17e('0x52')](_0xe786db[_0xe17e('0x53')]);}})[_0xe17e('0x2e')](respondWithResult(_0x499339,null))['catch'](handleError(_0x499339,null));};exports[_0xe17e('0x5f')]=function(_0x771d9e,_0x3a8a1f,_0x52aa0b){var _0x5b14f9={};var _0x4d597e={};var _0x3bda51;var _0x3100bf;return db['ChatGroup'][_0xe17e('0x60')]({'where':{'id':_0x771d9e[_0xe17e('0x54')]['id']}})[_0xe17e('0x2e')](handleEntityNotFound(_0x3a8a1f,null))[_0xe17e('0x2e')](function(_0x39bd36){if(_0x39bd36){_0x3bda51=_0x39bd36;_0x4d597e['model']=_[_0xe17e('0x37')](db[_0xe17e('0x57')][_0xe17e('0x35')]);_0x4d597e[_0xe17e('0x36')]=_[_0xe17e('0x37')](_0x771d9e[_0xe17e('0x36')]);_0x4d597e[_0xe17e('0x38')]=_[_0xe17e('0x39')](_0x4d597e[_0xe17e('0x3a')],_0x4d597e['query']);_0x5b14f9[_0xe17e('0x3c')]=_[_0xe17e('0x39')](_0x4d597e[_0xe17e('0x3a')],qs['fields'](_0x771d9e['query'][_0xe17e('0x3b')]));_0x5b14f9[_0xe17e('0x3c')]=_0x5b14f9[_0xe17e('0x3c')]['length']?_0x5b14f9['attributes']:_0x4d597e['model'];_0x5b14f9[_0xe17e('0x41')]=qs[_0xe17e('0x42')](_0x771d9e[_0xe17e('0x36')][_0xe17e('0x42')]);_0x5b14f9['where']=qs['filters'](_[_0xe17e('0x44')](_0x771d9e['query'],_0x4d597e['filters']));if(_0x771d9e[_0xe17e('0x36')][_0xe17e('0x45')]){_0x5b14f9[_0xe17e('0x43')]=_[_0xe17e('0x46')](_0x5b14f9['where'],{'$or':_[_0xe17e('0x47')](_0x5b14f9['attributes'],function(_0x2acd12){var _0xe36108={};_0xe36108[_0x2acd12]={'$like':'%'+_0x771d9e['query'][_0xe17e('0x45')]+'%'};return _0xe36108;})});}if(_0x771d9e[_0xe17e('0x36')][_0xe17e('0x61')]){var _0x366957=_0x771d9e[_0xe17e('0x36')][_0xe17e('0x61')][_0xe17e('0x62')](',');var _0x507c8a={};_0x507c8a[_0x366957[0x0]]={'$gte':moment(_0x366957[0x1])[_0xe17e('0x63')](_0xe17e('0x64'))};_0x5b14f9[_0xe17e('0x43')]=_[_0xe17e('0x46')](_0x5b14f9[_0xe17e('0x43')],_0x507c8a);}_0x5b14f9=_[_0xe17e('0x46')]({},_0x5b14f9,_0x771d9e[_0xe17e('0x4b')]);return _0x3bda51[_0xe17e('0x5f')](_0x5b14f9);}})[_0xe17e('0x2e')](function(_0x9f1995){if(_0x9f1995){_0x3100bf=_0x9f1995['length'];if(!_0x771d9e['query'][_0xe17e('0x3e')](_0xe17e('0x3f'))){_0x5b14f9[_0xe17e('0x40')]=qs[_0xe17e('0x40')](_0x771d9e[_0xe17e('0x36')][_0xe17e('0x40')]);_0x5b14f9[_0xe17e('0x29')]=qs[_0xe17e('0x29')](_0x771d9e[_0xe17e('0x36')]['offset']);}return _0x3bda51['getMessages'](_0x5b14f9);}})['then'](function(_0x52ded1){if(_0x52ded1){return _0x52ded1?{'count':_0x3100bf,'rows':_0x52ded1}:null;}})[_0xe17e('0x2e')](respondWithResult(_0x3a8a1f,null))['catch'](handleError(_0x3a8a1f,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index b872ce0..5584c7b 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 _0x8f1c=['events','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x8f1c,0x1f4));var _0xc8f1=function(_0x2c9ad0,_0x5986c0){_0x2c9ad0=_0x2c9ad0-0x0;var _0x49f8cb=_0x8f1c[_0x2c9ad0];return _0x49f8cb;};'use strict';var EventEmitter=require(_0xc8f1('0x0'));var ChatGroup=require(_0xc8f1('0x1'))['db'][_0xc8f1('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc8f1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc8f1('0x4'),'afterDestroy':_0xc8f1('0x5')};function emitEvent(_0x57f637){return function(_0x5110f0,_0x2531ee,_0x2c52f6){ChatGroupEvents[_0xc8f1('0x6')](_0x57f637+':'+_0x5110f0['id'],_0x5110f0);ChatGroupEvents['emit'](_0x57f637,_0x5110f0);_0x2c52f6(null);};}for(var e in events){if(events[_0xc8f1('0x7')](e)){var event=events[e];ChatGroup[_0xc8f1('0x8')](e,emitEvent(event));}}module[_0xc8f1('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0xcfe2=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','ChatGroup'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xcfe2,0x1de));var _0x2cfe=function(_0x13bbb7,_0x59da94){_0x13bbb7=_0x13bbb7-0x0;var _0x5875e1=_0xcfe2[_0x13bbb7];return _0x5875e1;};'use strict';var EventEmitter=require(_0x2cfe('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x2cfe('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2cfe('0x2')](0x0);var events={'afterCreate':_0x2cfe('0x3'),'afterUpdate':_0x2cfe('0x4'),'afterDestroy':_0x2cfe('0x5')};function emitEvent(_0x3c0cd2){return function(_0xc86320,_0x31889d,_0x190edb){ChatGroupEvents[_0x2cfe('0x6')](_0x3c0cd2+':'+_0xc86320['id'],_0xc86320);ChatGroupEvents['emit'](_0x3c0cd2,_0xc86320);_0x190edb(null);};}for(var e in events){if(events[_0x2cfe('0x7')](e)){var event=events[e];ChatGroup[_0x2cfe('0x8')](e,emitEvent(event));}}module[_0x2cfe('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 1ff9c1d..daa3a81 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 _0xab7f=['./chatGroup.attributes','define','chat_groups','lodash','util','../../config/logger','api','request-promise'];(function(_0x1d8b60,_0x451e98){var _0x6274d3=function(_0x3e4ac3){while(--_0x3e4ac3){_0x1d8b60['push'](_0x1d8b60['shift']());}};_0x6274d3(++_0x451e98);}(_0xab7f,0x1a3));var _0xfab7=function(_0x1b72c1,_0x248953){_0x1b72c1=_0x1b72c1-0x0;var _0x1f643d=_0xab7f[_0x1b72c1];return _0x1f643d;};'use strict';var _=require(_0xfab7('0x0'));var util=require(_0xfab7('0x1'));var logger=require(_0xfab7('0x2'))(_0xfab7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfab7('0x4'));var attributes=require(_0xfab7('0x5'));module['exports']=function(_0xf10cfa,_0x1db806){return _0xf10cfa[_0xfab7('0x6')]('ChatGroup',attributes,{'tableName':_0xfab7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d63=['chat_groups','lodash','util','../../config/logger','api','bluebird','./chatGroup.attributes','exports','ChatGroup'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x0d63,0x1de));var _0x30d6=function(_0x53276c,_0x6a1efe){_0x53276c=_0x53276c-0x0;var _0x4b2bcb=_0x0d63[_0x53276c];return _0x4b2bcb;};'use strict';var _=require(_0x30d6('0x0'));var util=require(_0x30d6('0x1'));var logger=require(_0x30d6('0x2'))(_0x30d6('0x3'));var moment=require('moment');var BPromise=require(_0x30d6('0x4'));var rp=require('request-promise');var attributes=require(_0x30d6('0x5'));module[_0x30d6('0x6')]=function(_0x1a41ab,_0x5757a1){return _0x1a41ab['define'](_0x30d6('0x7'),attributes,{'tableName':_0x30d6('0x8'),'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 727aada..d9adc75 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 _0xd6d6=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result'];(function(_0x50cc59,_0x2a3906){var _0x228138=function(_0x5daa4e){while(--_0x5daa4e){_0x50cc59['push'](_0x50cc59['shift']());}};_0x228138(++_0x2a3906);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x7f8bba,_0x593131){_0x7f8bba=_0x7f8bba-0x0;var _0xace90=_0xd6d6[_0x7f8bba];return _0xace90;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});config[_0x6d6d('0xc')]=_[_0x6d6d('0xd')](config[_0x6d6d('0xc')],{'host':_0x6d6d('0xe'),'port':0x18eb});var socket=require(_0x6d6d('0xf'))(new Redis(config[_0x6d6d('0xc')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x404c88,_0x1fa46d,_0x23b18a){return new BPromise(function(_0x290dfb,_0xf84314){return client['request'](_0x404c88,_0x23b18a)[_0x6d6d('0x10')](function(_0x158f82){logger['info']('ChatGroup,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));logger[_0x6d6d('0x12')](_0x6d6d('0x13'),_0x1fa46d,_0x6d6d('0x11'),JSON[_0x6d6d('0x14')](_0x158f82));if(_0x158f82[_0x6d6d('0x15')]){if(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x16')]===0x1f4){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);return _0xf84314(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82['error'][_0x6d6d('0x18')]);return _0x290dfb(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));_0x290dfb(_0x158f82[_0x6d6d('0x19')][_0x6d6d('0x18')]);}})[_0x6d6d('0x1a')](function(_0x51fff6){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x51fff6);_0xf84314(_0x51fff6);});});} \ No newline at end of file +var _0xc874=['defaults','localhost','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis'];(function(_0x5040b0,_0x53c900){var _0x32d66e=function(_0x10451b){while(--_0x10451b){_0x5040b0['push'](_0x5040b0['shift']());}};_0x32d66e(++_0x53c900);}(_0xc874,0x154));var _0x4c87=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0xc874[_0x3cb3ca];return _0x214366;};'use strict';var _=require(_0x4c87('0x0'));var util=require('util');var moment=require(_0x4c87('0x1'));var BPromise=require(_0x4c87('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c87('0x3'))['db'];var utils=require(_0x4c87('0x4'));var logger=require(_0x4c87('0x5'))('rpc');var config=require(_0x4c87('0x6'));var jayson=require(_0x4c87('0x7'));var client=jayson['client'][_0x4c87('0x8')]({'port':0x232a});config[_0x4c87('0x9')]=_[_0x4c87('0xa')](config[_0x4c87('0x9')],{'host':_0x4c87('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c87('0x9')]));require('./chatGroup.socket')[_0x4c87('0xc')](socket);function respondWithRpcPromise(_0x42f471,_0x30e64f,_0x1a15a2){return new BPromise(function(_0x46c0bc,_0x548e1a){return client[_0x4c87('0xd')](_0x42f471,_0x1a15a2)[_0x4c87('0xe')](function(_0x527917){logger[_0x4c87('0xf')](_0x4c87('0x10'),_0x30e64f,_0x4c87('0x11'));logger[_0x4c87('0x12')](_0x4c87('0x13'),_0x30e64f,'request\x20sent',JSON['stringify'](_0x527917));if(_0x527917['error']){if(_0x527917[_0x4c87('0x14')][_0x4c87('0x15')]===0x1f4){logger[_0x4c87('0x14')](_0x4c87('0x10'),_0x30e64f,_0x527917[_0x4c87('0x14')][_0x4c87('0x16')]);return _0x548e1a(_0x527917[_0x4c87('0x14')][_0x4c87('0x16')]);}logger['error'](_0x4c87('0x10'),_0x30e64f,_0x527917[_0x4c87('0x14')]['message']);return _0x46c0bc(_0x527917['error'][_0x4c87('0x16')]);}else{logger[_0x4c87('0xf')](_0x4c87('0x10'),_0x30e64f,'request\x20sent');_0x46c0bc(_0x527917[_0x4c87('0x17')]['message']);}})[_0x4c87('0x18')](function(_0x2a6891){logger[_0x4c87('0x14')](_0x4c87('0x10'),_0x30e64f,_0x2a6891);_0x548e1a(_0x2a6891);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 3bdf7c7..465c945 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 _0xc39c=['length','chatGroup:','save','remove','update','emit','removeListener','register'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xc39c,0xd2));var _0xcc39=function(_0x24d4a2,_0x460047){_0x24d4a2=_0x24d4a2-0x0;var _0x482d11=_0xc39c[_0x24d4a2];return _0x482d11;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xcc39('0x0'),_0xcc39('0x1'),_0xcc39('0x2')];function createListener(_0x5d885b,_0x6c204c){return function(_0x29b2e2){_0x6c204c[_0xcc39('0x3')](_0x5d885b,_0x29b2e2);};}function removeListener(_0x5bc333,_0x29c6c2){return function(){ChatGroupEvents[_0xcc39('0x4')](_0x5bc333,_0x29c6c2);};}exports[_0xcc39('0x5')]=function(_0x3118f8){for(var _0x592ad7=0x0,_0x32cf84=events[_0xcc39('0x6')];_0x592ad7<_0x32cf84;_0x592ad7++){var _0x12361a=events[_0x592ad7];var _0x46bb71=createListener(_0xcc39('0x7')+_0x12361a,_0x3118f8);ChatGroupEvents['on'](_0x12361a,_0x46bb71);}}; \ No newline at end of file +var _0x0851=['register','length','./chatGroup.events','save','remove','update','emit','removeListener'];(function(_0x12a62c,_0xc9c41a){var _0x268a58=function(_0x100ca9){while(--_0x100ca9){_0x12a62c['push'](_0x12a62c['shift']());}};_0x268a58(++_0xc9c41a);}(_0x0851,0x8a));var _0x1085=function(_0x5139bb,_0x3fb5f4){_0x5139bb=_0x5139bb-0x0;var _0x306e2a=_0x0851[_0x5139bb];return _0x306e2a;};'use strict';var ChatGroupEvents=require(_0x1085('0x0'));var events=[_0x1085('0x1'),_0x1085('0x2'),_0x1085('0x3')];function createListener(_0x56ce65,_0x2a93c7){return function(_0x28b07e){_0x2a93c7[_0x1085('0x4')](_0x56ce65,_0x28b07e);};}function removeListener(_0x3cbd88,_0x3b40fb){return function(){ChatGroupEvents[_0x1085('0x5')](_0x3cbd88,_0x3b40fb);};}exports[_0x1085('0x6')]=function(_0x1c9e36){for(var _0x152eeb=0x0,_0x1adbec=events[_0x1085('0x7')];_0x152eeb<_0x1adbec;_0x152eeb++){var _0x3352dc=events[_0x152eeb];var _0x546546=createListener('chatGroup:'+_0x3352dc,_0x1c9e36);ChatGroupEvents['on'](_0x3352dc,_0x546546);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 968ef40..c6b5e1b 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 _0xb121=['addMessage','update','delete','removeMembers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers'];(function(_0x2e4b84,_0x19ad5a){var _0x3a0444=function(_0x2a86db){while(--_0x2a86db){_0x2e4b84['push'](_0x2e4b84['shift']());}};_0x3a0444(++_0x19ad5a);}(_0xb121,0xa7));var _0x1b12=function(_0x436974,_0x21f33b){_0x436974=_0x436974-0x0;var _0x410449=_0xb121[_0x436974];return _0x410449;};'use strict';var multer=require(_0x1b12('0x0'));var util=require(_0x1b12('0x1'));var path=require(_0x1b12('0x2'));var timeout=require(_0x1b12('0x3'));var express=require('express');var router=express[_0x1b12('0x4')]();var auth=require(_0x1b12('0x5'));var interaction=require(_0x1b12('0x6'));var config=require(_0x1b12('0x7'));var controller=require('./chatGroup.controller');router[_0x1b12('0x8')]('/',auth[_0x1b12('0x9')](),controller[_0x1b12('0xa')]);router[_0x1b12('0x8')](_0x1b12('0xb'),auth[_0x1b12('0x9')](),controller[_0x1b12('0xc')]);router[_0x1b12('0x8')](_0x1b12('0xd'),auth['isAuthenticated'](),controller[_0x1b12('0xe')]);router[_0x1b12('0x8')]('/:id/unread',auth[_0x1b12('0x9')](),controller[_0x1b12('0xf')]);router[_0x1b12('0x8')](_0x1b12('0x10'),auth[_0x1b12('0x9')](),controller['getMembers']);router[_0x1b12('0x8')](_0x1b12('0x11'),auth[_0x1b12('0x9')](),controller[_0x1b12('0x12')]);router[_0x1b12('0x13')]('/',auth[_0x1b12('0x9')](),controller[_0x1b12('0x14')]);router[_0x1b12('0x13')]('/:id/members',auth[_0x1b12('0x9')](),controller[_0x1b12('0x15')]);router[_0x1b12('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1b12('0x16')]);router['put'](_0x1b12('0xd'),auth[_0x1b12('0x9')](),controller[_0x1b12('0x17')]);router[_0x1b12('0x18')](_0x1b12('0xd'),auth[_0x1b12('0x9')](),controller['destroy']);router[_0x1b12('0x18')](_0x1b12('0x10'),auth['isAuthenticated'](),controller[_0x1b12('0x19')]);module[_0x1b12('0x1a')]=router; \ No newline at end of file +var _0x8e7f=['post','/:id/messages','addMessage','put','update','delete','/:id/members','removeMembers','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','describe','/:id','/:id/unread','getUnread','isAuthenticated','getMessages'];(function(_0x1a87b3,_0x45ba68){var _0x37e84d=function(_0x39f49e){while(--_0x39f49e){_0x1a87b3['push'](_0x1a87b3['shift']());}};_0x37e84d(++_0x45ba68);}(_0x8e7f,0x170));var _0xf8e7=function(_0x16dfb3,_0x1613fc){_0x16dfb3=_0x16dfb3-0x0;var _0x1d8030=_0x8e7f[_0x16dfb3];return _0x1d8030;};'use strict';var multer=require(_0xf8e7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf8e7('0x1'));var express=require(_0xf8e7('0x2'));var router=express[_0xf8e7('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf8e7('0x4'));var config=require(_0xf8e7('0x5'));var controller=require(_0xf8e7('0x6'));router[_0xf8e7('0x7')]('/',auth['isAuthenticated'](),controller[_0xf8e7('0x8')]);router[_0xf8e7('0x7')](_0xf8e7('0x9'),auth['isAuthenticated'](),controller[_0xf8e7('0xa')]);router[_0xf8e7('0x7')](_0xf8e7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf8e7('0x7')](_0xf8e7('0xc'),auth['isAuthenticated'](),controller[_0xf8e7('0xd')]);router[_0xf8e7('0x7')]('/:id/members',auth[_0xf8e7('0xe')](),controller['getMembers']);router[_0xf8e7('0x7')]('/:id/messages',auth[_0xf8e7('0xe')](),controller[_0xf8e7('0xf')]);router['post']('/',auth[_0xf8e7('0xe')](),controller['create']);router[_0xf8e7('0x10')]('/:id/members',auth[_0xf8e7('0xe')](),controller['addMembers']);router[_0xf8e7('0x10')](_0xf8e7('0x11'),auth[_0xf8e7('0xe')](),controller[_0xf8e7('0x12')]);router[_0xf8e7('0x13')](_0xf8e7('0xb'),auth['isAuthenticated'](),controller[_0xf8e7('0x14')]);router[_0xf8e7('0x15')](_0xf8e7('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xf8e7('0x15')](_0xf8e7('0x16'),auth[_0xf8e7('0xe')](),controller[_0xf8e7('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 4b9be4f..0a817f5 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 _0xed3c=['ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','thumb','STRING','DATE','TEXT','long'];(function(_0x32ae99,_0x2c948b){var _0x5b05c1=function(_0x201553){while(--_0x201553){_0x32ae99['push'](_0x32ae99['shift']());}};_0x5b05c1(++_0x2c948b);}(_0xed3c,0x1a6));var _0xced3=function(_0x5d225a,_0x2debe9){_0x5d225a=_0x5d225a-0x0;var _0x1e7761=_0xed3c[_0x5d225a];return _0x1e7761;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'closed':{'type':Sequelize[_0xced3('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xced3('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xced3('0x4'),_0xced3('0x5')),'defaultValue':_0xced3('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xced3('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xced3('0x7')]},'disposition':{'type':Sequelize[_0xced3('0x6')]},'note':{'type':Sequelize[_0xced3('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xced3('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xced3('0x6')]},'customerIp':{'type':Sequelize[_0xced3('0x6')]},'formData':{'type':Sequelize[_0xced3('0x8')](_0xced3('0x9'))},'read1stAt':{'type':Sequelize[_0xced3('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xced3('0xa')]('in',_0xced3('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xced3('0x6')]}}; \ No newline at end of file +var _0x9c00=['long','out','sequelize','exports','ENUM','star','TEXT','STRING','DATE'];(function(_0x44f906,_0x37a445){var _0x3f8b7d=function(_0x140efa){while(--_0x140efa){_0x44f906['push'](_0x44f906['shift']());}};_0x3f8b7d(++_0x37a445);}(_0x9c00,0x1a0));var _0x09c0=function(_0x495f6f,_0x20c392){_0x495f6f=_0x495f6f-0x0;var _0x39bbf3=_0x9c00[_0x495f6f];return _0x39bbf3;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x09c0('0x2')](_0x09c0('0x3'),'thumb'),'defaultValue':_0x09c0('0x3')},'ratingMessage':{'type':Sequelize[_0x09c0('0x4')]},'pathTranscript':{'type':Sequelize[_0x09c0('0x4')]},'mailTranscript':{'type':Sequelize[_0x09c0('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x09c0('0x6')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x09c0('0x5')]},'browserVersion':{'type':Sequelize[_0x09c0('0x5')]},'osName':{'type':Sequelize[_0x09c0('0x5')]},'osVersion':{'type':Sequelize[_0x09c0('0x5')]},'deviceModel':{'type':Sequelize[_0x09c0('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x09c0('0x5')]},'referer':{'type':Sequelize[_0x09c0('0x5')]},'customerIp':{'type':Sequelize[_0x09c0('0x5')]},'formData':{'type':Sequelize[_0x09c0('0x4')](_0x09c0('0x7'))},'read1stAt':{'type':Sequelize[_0x09c0('0x6')]},'lastMsgAt':{'type':Sequelize[_0x09c0('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x09c0('0x2')]('in',_0x09c0('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x09c0('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index a6fe013..70cad06 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 _0xfd67=['err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','lodash','desk.js','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','destroy','end','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','field','options','include','tag','push','Tag','Tags','read','ChatMessage','Messages','direction','createdAt','distinct','ChatInteraction','includeAll','Users','fullname','CmContact','Contact','User','Owner','internal','ChatWebsite','key','color','ThroughTags','findAll','rows','show','find','create','body','params','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Sequelize','ValidationError','Interaction\x20already\x20assigned','closed','closedAt','disposition','AbandonInteraction','originalname','file','filename','mimetype','attachmentDownload','findOne','Unauthorized','Attachment','join','root','server/files/attachments/','basename','close','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatWebsiteId','agentAlias','UserId','System','customer','%s%d','Visitor','ContactId','website_alias','format','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','user','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','nolimit','pick','ChatInteractionId','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','includeAgent','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','attachments','interaction-%s.zip','firstName','1cm','mkdirSync','

Chat\x20Interaction:\x20#%d

','

Date:\x20%s

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','','','existsSync','createReadStream','toFile','interaction-','.pdf'];(function(_0x595187,_0x5ae096){var _0x52b48b=function(_0xe0f5ed){while(--_0xe0f5ed){_0x595187['push'](_0x595187['shift']());}};_0x52b48b(++_0x5ae096);}(_0xfd67,0xce));var _0x7fd6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xfd67[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x7fd6('0x0'));var emlformat=require(_0x7fd6('0x1'));var rimraf=require(_0x7fd6('0x2'));var zipdir=require(_0x7fd6('0x3'));var jsonpatch=require(_0x7fd6('0x4'));var rp=require(_0x7fd6('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7fd6('0x6'));var path=require('path');var sox=require(_0x7fd6('0x7'));var csv=require(_0x7fd6('0x8'));var ejs=require(_0x7fd6('0x9'));var fs=require('fs');var _=require(_0x7fd6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7fd6('0xb'));var toCsv=require(_0x7fd6('0x8'));var querystring=require('querystring');var Papa=require(_0x7fd6('0xc'));var authService=require('../../components/auth/service');var hardwareService=require(_0x7fd6('0xd'));var Redis=require('ioredis');var qs=require(_0x7fd6('0xe'));var logger=require(_0x7fd6('0xf'))('api');var utils=require(_0x7fd6('0x10'));var config=require('../../config/environment');var db=require(_0x7fd6('0x11'))['db'];config[_0x7fd6('0x12')]=_[_0x7fd6('0x13')](config['redis'],{'host':_0x7fd6('0x14'),'port':0x18eb});var socket=require(_0x7fd6('0x15'))(new Redis(config[_0x7fd6('0x12')]));require(_0x7fd6('0x16'))[_0x7fd6('0x17')](socket);var jayson=require(_0x7fd6('0x18'));var client=jayson['client'][_0x7fd6('0x19')]({'port':0x232b});var client9004=jayson[_0x7fd6('0x1a')]['http']({'port':0x232c});function respondWithRpcPromise(_0x202423,_0x53812b,_0x1bc492,_0x444853){return new BPromise(function(_0x37830e,_0x502f0d){var _0x3f2330=_0x444853||client;return _0x3f2330[_0x7fd6('0x1b')](_0x202423,_0x1bc492)[_0x7fd6('0x1c')](function(_0x48bebe){logger[_0x7fd6('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x53812b,_0x7fd6('0x1e'));logger['debug'](_0x7fd6('0x1f'),_0x53812b,'request\x20sent',JSON[_0x7fd6('0x20')](_0x48bebe));if(_0x48bebe['error']){if(_0x48bebe[_0x7fd6('0x21')][_0x7fd6('0x22')]===0x1f4){logger[_0x7fd6('0x21')](_0x7fd6('0x23'),_0x53812b,_0x48bebe['error'][_0x7fd6('0x24')]);return _0x502f0d(_0x48bebe[_0x7fd6('0x21')][_0x7fd6('0x24')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x53812b,_0x48bebe[_0x7fd6('0x21')][_0x7fd6('0x24')]);return _0x37830e(_0x48bebe[_0x7fd6('0x21')]['message']);}else{logger[_0x7fd6('0x1d')](_0x7fd6('0x23'),_0x53812b,'request\x20sent');_0x37830e(_0x48bebe[_0x7fd6('0x25')][_0x7fd6('0x24')]);}})[_0x7fd6('0x26')](function(_0x2c0f3b){logger[_0x7fd6('0x21')](_0x7fd6('0x23'),_0x53812b,_0x2c0f3b);_0x502f0d(_0x2c0f3b);});});}function respondWithStatusCode(_0x5c6b1a,_0x53a9f5){_0x53a9f5=_0x53a9f5||0xcc;return function(_0x33801c){if(_0x33801c){return _0x5c6b1a[_0x7fd6('0x27')](_0x53a9f5);}return _0x5c6b1a[_0x7fd6('0x28')](_0x53a9f5)['end']();};}function respondWithResult(_0x9d28ec,_0x324c3a){_0x324c3a=_0x324c3a||0xc8;return function(_0x210152){if(_0x210152){return _0x9d28ec['status'](_0x324c3a)[_0x7fd6('0x29')](_0x210152);}};}function respondWithFilteredResult(_0x73e18b,_0x3909f2){return function(_0x1834a7){if(_0x1834a7){var _0x3ec80c=_0x1834a7[_0x7fd6('0x2a')],_0x14ebbd=_0x3909f2[_0x7fd6('0x2b')],_0x179477=_0x3909f2[_0x7fd6('0x2b')]+_0x3909f2[_0x7fd6('0x2c')],_0x5dcb1f;if(_0x179477>=_0x3ec80c){_0x179477=_0x3ec80c;_0x5dcb1f=0xc8;}else{_0x5dcb1f=0xce;}_0x73e18b[_0x7fd6('0x28')](_0x5dcb1f);return _0x73e18b[_0x7fd6('0x2d')](_0x7fd6('0x2e'),_0x14ebbd+'-'+_0x179477+'/'+_0x3ec80c)[_0x7fd6('0x29')](_0x1834a7);}return null;};}function patchUpdates(_0x7d8ed6){return function(_0x186f66){try{jsonpatch[_0x7fd6('0x2f')](_0x186f66,_0x7d8ed6,!![]);}catch(_0x2158b5){return BPromise['reject'](_0x2158b5);}return _0x186f66['save']();};}function saveUpdates(_0x27c3d4,_0x342cb0){return function(_0x4c1541){if(_0x4c1541){return _0x4c1541[_0x7fd6('0x30')](_0x27c3d4)[_0x7fd6('0x1c')](function(_0x3dae13){return _0x3dae13;});}return null;};}function removeEntity(_0x4b092d,_0x1ab7c9){return function(_0x56c7cf){if(_0x56c7cf){return _0x56c7cf[_0x7fd6('0x31')]()[_0x7fd6('0x1c')](function(){_0x4b092d['status'](0xcc)[_0x7fd6('0x32')]();});}};}function handleEntityNotFound(_0x271230,_0x372647){return function(_0x595ae2){if(!_0x595ae2){_0x271230[_0x7fd6('0x27')](0x194);}return _0x595ae2;};}function handleError(_0x42c8e9,_0x44d639){_0x44d639=_0x44d639||0x1f4;return function(_0x402b9f){logger[_0x7fd6('0x21')](_0x402b9f['stack']);if(_0x402b9f['name']){delete _0x402b9f[_0x7fd6('0x33')];}_0x42c8e9[_0x7fd6('0x28')](_0x44d639)[_0x7fd6('0x34')](_0x402b9f);};}exports[_0x7fd6('0x35')]=function(_0x861a3e,_0x4e5c5e){var _0x324d52={},_0x22b949={},_0x4a6a77={'count':0x0,'rows':[]};var _0x3bbaa2=db['ChatInteraction'][_0x7fd6('0x36')];_0x22b949['model']=_[_0x7fd6('0x37')](_0x3bbaa2);_0x22b949[_0x7fd6('0x38')]=_[_0x7fd6('0x37')](_0x861a3e[_0x7fd6('0x38')]);_0x22b949[_0x7fd6('0x39')]=_[_0x7fd6('0x3a')](_0x22b949[_0x7fd6('0x3b')],_0x22b949[_0x7fd6('0x38')]);_0x324d52[_0x7fd6('0x3c')]=_[_0x7fd6('0x3a')](_0x22b949[_0x7fd6('0x3b')],qs[_0x7fd6('0x3d')](_0x861a3e[_0x7fd6('0x38')][_0x7fd6('0x3d')]));_0x324d52[_0x7fd6('0x3c')]=_0x324d52[_0x7fd6('0x3c')][_0x7fd6('0x3e')]?_0x324d52[_0x7fd6('0x3c')]:_0x22b949['model'];if(!_0x861a3e[_0x7fd6('0x38')][_0x7fd6('0x3f')]('nolimit')){_0x324d52['limit']=qs[_0x7fd6('0x2c')](_0x861a3e[_0x7fd6('0x38')][_0x7fd6('0x2c')]);_0x324d52[_0x7fd6('0x2b')]=qs[_0x7fd6('0x2b')](_0x861a3e[_0x7fd6('0x38')][_0x7fd6('0x2b')]);}_0x324d52[_0x7fd6('0x40')]=qs['sort'](_0x861a3e[_0x7fd6('0x38')][_0x7fd6('0x41')]);_0x324d52[_0x7fd6('0x42')]=qs['filters'](_['pick'](_0x861a3e[_0x7fd6('0x38')],_0x22b949[_0x7fd6('0x39')]));if(_0x861a3e['query'][_0x7fd6('0x43')]){_0x324d52[_0x7fd6('0x42')]=_[_0x7fd6('0x44')](_0x324d52[_0x7fd6('0x42')],{'$or':_['map'](_0x3bbaa2,function(_0x2c0225){if(_0x2c0225[_0x7fd6('0x45')]['key']!==_0x7fd6('0x46')){var _0x196610={};_0x196610[_0x2c0225[_0x7fd6('0x47')]]={'$like':'%'+_0x861a3e[_0x7fd6('0x38')][_0x7fd6('0x43')]+'%'};return _0x196610;}})});}_0x324d52=_[_0x7fd6('0x44')]({},_0x324d52,_0x861a3e[_0x7fd6('0x48')]);var _0x2de965={'where':_0x324d52[_0x7fd6('0x42')]};_0x2de965[_0x7fd6('0x49')]=[];if(_0x861a3e[_0x7fd6('0x38')][_0x7fd6('0x4a')]){_0x2de965[_0x7fd6('0x49')][_0x7fd6('0x4b')]({'model':db[_0x7fd6('0x4c')],'as':_0x7fd6('0x4d'),'attributes':['id'],'where':{'id':_0x861a3e['query'][_0x7fd6('0x4a')]},'required':!![]});_0x2de965['distinct']=!![];}if(_0x861a3e['query'][_0x7fd6('0x4e')]){_0x2de965['include']['push']({'model':db[_0x7fd6('0x4f')],'as':_0x7fd6('0x50'),'attributes':['id',_0x7fd6('0x51'),_0x7fd6('0x52'),_0x7fd6('0x4e')],'where':{'direction':'in','read':_0x861a3e['query']['read']||![]},'required':!![]});_0x2de965[_0x7fd6('0x53')]=!![];}return db[_0x7fd6('0x54')]['count'](_0x2de965)[_0x7fd6('0x1c')](function(_0x3959c0){_0x4a6a77['count']=_0x3959c0;if(_0x861a3e['query'][_0x7fd6('0x55')]){_0x324d52[_0x7fd6('0x49')]=[{'model':db['User'],'as':_0x7fd6('0x56'),'required':![],'attributes':['id',_0x7fd6('0x33'),_0x7fd6('0x57')]},{'model':db[_0x7fd6('0x58')],'as':_0x7fd6('0x59'),'required':![]},{'model':db[_0x7fd6('0x5a')],'as':_0x7fd6('0x5b'),'attributes':[_0x7fd6('0x33'),'fullname',_0x7fd6('0x5c')],'required':![]},{'model':db[_0x7fd6('0x5d')],'as':'Account','attributes':['name',_0x7fd6('0x5e')],'required':![]},{'model':db[_0x7fd6('0x4f')],'as':_0x7fd6('0x50'),'attributes':['id','direction',_0x7fd6('0x52'),_0x7fd6('0x4e')],'where':{'direction':'in','read':_0x861a3e[_0x7fd6('0x38')][_0x7fd6('0x4e')]||![]},'required':_0x861a3e[_0x7fd6('0x38')][_0x7fd6('0x4e')]||![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x7fd6('0x5f')],'required':_0x861a3e[_0x7fd6('0x38')][_0x7fd6('0x4a')]?!![]:![]},{'model':db['Tag'],'as':_0x7fd6('0x60'),'attributes':['id','name',_0x7fd6('0x5f')],'through':_0x861a3e['query'][_0x7fd6('0x4a')]?{'attributes':[],'where':{'TagId':_0x861a3e[_0x7fd6('0x38')][_0x7fd6('0x4a')]||undefined}}:{},'required':_0x861a3e[_0x7fd6('0x38')][_0x7fd6('0x4a')]?!![]:![]}];}return db[_0x7fd6('0x54')][_0x7fd6('0x61')](_0x324d52);})[_0x7fd6('0x1c')](function(_0x3d02f6){_0x4a6a77[_0x7fd6('0x62')]=_0x3d02f6;return _0x4a6a77;})[_0x7fd6('0x1c')](respondWithFilteredResult(_0x4e5c5e,_0x324d52))['catch'](handleError(_0x4e5c5e,null));};exports[_0x7fd6('0x63')]=function(_0x8b24cb,_0x2f518b){var _0x1e2552={'raw':![],'where':{'id':_0x8b24cb['params']['id']}},_0x54c953={};_0x54c953['model']=_[_0x7fd6('0x37')](db[_0x7fd6('0x54')]['rawAttributes']);_0x54c953[_0x7fd6('0x38')]=_[_0x7fd6('0x37')](_0x8b24cb[_0x7fd6('0x38')]);_0x54c953[_0x7fd6('0x39')]=_[_0x7fd6('0x3a')](_0x54c953[_0x7fd6('0x3b')],_0x54c953['query']);_0x1e2552[_0x7fd6('0x3c')]=_[_0x7fd6('0x3a')](_0x54c953['model'],qs[_0x7fd6('0x3d')](_0x8b24cb[_0x7fd6('0x38')][_0x7fd6('0x3d')]));_0x1e2552[_0x7fd6('0x3c')]=_0x1e2552[_0x7fd6('0x3c')][_0x7fd6('0x3e')]?_0x1e2552['attributes']:_0x54c953[_0x7fd6('0x3b')];if(_0x8b24cb[_0x7fd6('0x38')][_0x7fd6('0x55')]){_0x1e2552['include']=[{'all':!![]}];}_0x1e2552=_[_0x7fd6('0x44')]({},_0x1e2552,_0x8b24cb['options']);return db['ChatInteraction'][_0x7fd6('0x64')](_0x1e2552)[_0x7fd6('0x1c')](handleEntityNotFound(_0x2f518b,null))['then'](respondWithResult(_0x2f518b,null))[_0x7fd6('0x26')](handleError(_0x2f518b,null));};exports[_0x7fd6('0x65')]=function(_0x79a9ac,_0x3ffcb7){return db[_0x7fd6('0x54')]['create'](_0x79a9ac[_0x7fd6('0x66')],{})[_0x7fd6('0x1c')](respondWithResult(_0x3ffcb7,0xc9))[_0x7fd6('0x26')](handleError(_0x3ffcb7,null));};exports[_0x7fd6('0x30')]=function(_0x44a882,_0x8d9740){if(_0x44a882['body']['id']){delete _0x44a882[_0x7fd6('0x66')]['id'];}return db[_0x7fd6('0x54')][_0x7fd6('0x64')]({'where':{'id':_0x44a882[_0x7fd6('0x67')]['id']}})[_0x7fd6('0x1c')](handleEntityNotFound(_0x8d9740,null))[_0x7fd6('0x1c')](saveUpdates(_0x44a882['body'],null))[_0x7fd6('0x1c')](respondWithResult(_0x8d9740,null))[_0x7fd6('0x26')](handleError(_0x8d9740,null));};exports['destroy']=function(_0x3f30f2,_0x29033b){return db[_0x7fd6('0x54')][_0x7fd6('0x64')]({'where':{'id':_0x3f30f2[_0x7fd6('0x67')]['id']}})['then'](handleEntityNotFound(_0x29033b,null))[_0x7fd6('0x1c')](removeEntity(_0x29033b,null))[_0x7fd6('0x26')](handleError(_0x29033b,null));};exports['describe']=function(_0x58e164,_0xea8119){return db[_0x7fd6('0x54')][_0x7fd6('0x68')]()[_0x7fd6('0x1c')](respondWithResult(_0xea8119,null))[_0x7fd6('0x26')](handleError(_0xea8119,null));};exports[_0x7fd6('0x69')]=function(_0x4399f2,_0x2af389){if(_0x4399f2['body']['id']){delete _0x4399f2[_0x7fd6('0x66')]['id'];}return db[_0x7fd6('0x54')]['find']({'where':{'id':_0x4399f2['params']['id']}})[_0x7fd6('0x1c')](handleEntityNotFound(_0x2af389,null))[_0x7fd6('0x1c')](saveUpdates(_0x4399f2[_0x7fd6('0x66')],null))[_0x7fd6('0x1c')](respondWithResult(_0x2af389,null))[_0x7fd6('0x26')](handleError(_0x2af389,null));};exports[_0x7fd6('0x6a')]=function(_0x2cb0fa,_0x471ae0,_0x1707e5){if(_0x2cb0fa[_0x7fd6('0x66')]['id']){delete _0x2cb0fa[_0x7fd6('0x66')]['id'];}return db[_0x7fd6('0x54')][_0x7fd6('0x64')]({'where':{'id':_0x2cb0fa['params']['id']}})[_0x7fd6('0x1c')](function(_0x219ca9){if(!_0x219ca9){logger[_0x7fd6('0x21')](_0x7fd6('0x6b'),_0x7fd6('0x6a'),0x194,_0x7fd6('0x6c'));_0x471ae0[_0x7fd6('0x27')](0x194);}else{if(_0x219ca9['UserId']){throw new db[(_0x7fd6('0x6d'))][(_0x7fd6('0x6e'))](_0x7fd6('0x6f'));}}return _0x219ca9;})['then'](function(_0x17c54c){if(_0x17c54c){return _0x17c54c['update']({'closed':_0x2cb0fa['body'][_0x7fd6('0x70')],'closedAt':_0x2cb0fa[_0x7fd6('0x66')][_0x7fd6('0x71')],'disposition':_0x2cb0fa[_0x7fd6('0x66')][_0x7fd6('0x72')]})['then'](function(_0xe1755b){return _0xe1755b;});}})['then'](function(_0x235666){return respondWithRpcPromise(_0x7fd6('0x73'),_0x7fd6('0x6a'),_0x2cb0fa[_0x7fd6('0x66')],client9004);})[_0x7fd6('0x1c')](respondWithResult(_0x471ae0,null))['catch'](handleError(_0x471ae0,null));};exports['attachmentUpload']=function(_0xbf467,_0x26bbbf,_0x5b5eba){_0xbf467[_0x7fd6('0x66')][_0x7fd6('0x33')]=_0xbf467['file'][_0x7fd6('0x74')];_0xbf467['body']['basename']=_0xbf467[_0x7fd6('0x75')][_0x7fd6('0x76')];_0xbf467[_0x7fd6('0x66')][_0x7fd6('0x45')]=_0xbf467[_0x7fd6('0x75')][_0x7fd6('0x77')];return db['Attachment'][_0x7fd6('0x65')](_0xbf467[_0x7fd6('0x66')])['then'](respondWithResult(_0x26bbbf,0xc9))[_0x7fd6('0x26')](handleError(_0x26bbbf,null));};exports[_0x7fd6('0x78')]=function(_0x228e34,_0x19c4c6,_0x344a01){return db[_0x7fd6('0x54')][_0x7fd6('0x79')]({'where':{'id':_0x228e34[_0x7fd6('0x67')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x19c4c6,null))[_0x7fd6('0x1c')](function(_0x5111a1){if(_0x5111a1){if(_0x5111a1[_0x7fd6('0x70')]){return _0x19c4c6[_0x7fd6('0x28')](0x193)['json']({'status':0x193,'message':_0x7fd6('0x7a')});}return db[_0x7fd6('0x7b')][_0x7fd6('0x79')]({'where':{'id':_0x228e34[_0x7fd6('0x38')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x19c4c6,null));}})[_0x7fd6('0x1c')](function(_0x119f3d){if(_0x119f3d){return _0x19c4c6['download'](path[_0x7fd6('0x7c')](config[_0x7fd6('0x7d')],_0x7fd6('0x7e'),_0x119f3d[_0x7fd6('0x7f')]));}})[_0x7fd6('0x26')](handleError(_0x19c4c6,null));};exports[_0x7fd6('0x80')]=function(_0x31b697,_0xa924f7){var _0x49994f=null;var _0x455a8d=null;var _0x4e1592=null;var _0x3dca20=null;if(_0x31b697[_0x7fd6('0x66')]['id']){delete _0x31b697[_0x7fd6('0x66')]['id'];}if(_0x31b697[_0x7fd6('0x66')]['mailTranscript']){_0x3dca20=path[_0x7fd6('0x7c')](config[_0x7fd6('0x7d')],_0x7fd6('0x81'),util['format'](_0x7fd6('0x82'),Date[_0x7fd6('0x83')]()));_0x31b697[_0x7fd6('0x66')][_0x7fd6('0x84')]=_0x3dca20;}return db['ChatInteraction'][_0x7fd6('0x64')]({'where':{'id':_0x31b697[_0x7fd6('0x67')]['id']},'include':[{'model':db[_0x7fd6('0x4f')],'as':_0x7fd6('0x50'),'include':[{'model':db[_0x7fd6('0x5a')],'as':_0x7fd6('0x5a')}]}]})['then'](handleEntityNotFound(_0xa924f7,null))['then'](saveUpdates(_0x31b697[_0x7fd6('0x66')],null))['then'](function(_0x1a7627){if(_0x1a7627){_0x49994f=_0x1a7627;return db[_0x7fd6('0x5d')][_0x7fd6('0x64')]({'where':{'id':_0x49994f[_0x7fd6('0x85')]}});}})[_0x7fd6('0x1c')](function(_0x33a2e8){if(_0x33a2e8){_0x4e1592=_0x33a2e8;return db[_0x7fd6('0x58')][_0x7fd6('0x64')]({'where':{'id':_0x49994f['ContactId']}});}})[_0x7fd6('0x1c')](function(_0x23df83){if(_0x23df83){_0x455a8d=_0x23df83;if(_0x3dca20){var _0x209d16=null;for(var _0x1f3835=0x1;_0x1f3835<_0x49994f['Messages'][_0x7fd6('0x3e')];++_0x1f3835){_0x209d16=_0x49994f[_0x7fd6('0x50')][_0x1f3835];var _0x154b7f=_0x209d16['UserId']?util['format']('%s%d',_0x4e1592[_0x7fd6('0x86')],_0x209d16[_0x7fd6('0x87')]):_0x7fd6('0x88');var _0x4c1d0d=_0x31b697[_0x7fd6('0x66')][_0x7fd6('0x89')]||util['format'](_0x7fd6('0x8a'),_0x7fd6('0x8b'),_0x209d16[_0x7fd6('0x8c')]);switch(_0x4e1592['agentIdentifier']){case _0x7fd6('0x8d'):_0x154b7f=_0x209d16['UserId']?util[_0x7fd6('0x8e')](_0x7fd6('0x8a'),_0x4e1592['agentAlias'],_0x209d16[_0x7fd6('0x87')]):_0x7fd6('0x88');break;case _0x7fd6('0x8f'):_0x154b7f=_0x209d16['UserId']?_0x209d16['User'][_0x7fd6('0x90')]||_0x209d16[_0x7fd6('0x5a')]['fullname']:_0x7fd6('0x88');break;case _0x7fd6('0x91'):_0x154b7f=_0x209d16[_0x7fd6('0x87')]?_0x209d16[_0x7fd6('0x5a')][_0x7fd6('0x57')]:_0x7fd6('0x88');break;default:_0x154b7f=_0x209d16[_0x7fd6('0x87')]?util[_0x7fd6('0x8e')](_0x7fd6('0x8a'),_0x4e1592[_0x7fd6('0x86')],_0x209d16[_0x7fd6('0x87')]):_0x7fd6('0x88');}var _0x24b955=util[_0x7fd6('0x8e')]('[%s]\x20%s:\x20%s\x0a',moment(_0x209d16[_0x7fd6('0x52')])[_0x7fd6('0x8e')](_0x7fd6('0x92')),_0x209d16['direction']==='in'?_0x4c1d0d:_0x154b7f,_0x209d16[_0x7fd6('0x66')]);if(!_0x209d16[_0x7fd6('0x93')]){fs[_0x7fd6('0x94')](_0x3dca20,_0x24b955);}}return db[_0x7fd6('0x95')][_0x7fd6('0x79')]({'where':{'service':!![]},'include':[{'model':db[_0x7fd6('0x96')],'as':_0x7fd6('0x97'),'raw':!![]}]});}}})[_0x7fd6('0x1c')](function(_0x3a61f8){if(_0x3a61f8&&_0x3a61f8[_0x7fd6('0x97')]&&_0x31b697[_0x7fd6('0x66')]){var _0x2a9a4c={'tls':{'rejectUnauthorized':![]}};if(_0x3a61f8[_0x7fd6('0x97')][_0x7fd6('0x98')]){_0x2a9a4c[_0x7fd6('0x98')]=_0x3a61f8[_0x7fd6('0x97')][_0x7fd6('0x98')];}else{_0x2a9a4c['host']=_0x3a61f8[_0x7fd6('0x97')][_0x7fd6('0x99')];_0x2a9a4c[_0x7fd6('0x9a')]=_0x3a61f8[_0x7fd6('0x97')][_0x7fd6('0x9a')];_0x2a9a4c[_0x7fd6('0x9b')]=_0x3a61f8['Smtp'][_0x7fd6('0x9b')];}if(_0x3a61f8['Smtp'][_0x7fd6('0x9c')]){_0x2a9a4c['auth']={'user':_0x3a61f8[_0x7fd6('0x97')][_0x7fd6('0x9d')],'pass':_0x3a61f8[_0x7fd6('0x97')][_0x7fd6('0x9e')]};}return respondWithRpcPromise(_0x7fd6('0x9f'),_0x7fd6('0xa0'),{'account':_0x2a9a4c,'message':{'from':util[_0x7fd6('0x8e')](_0x7fd6('0xa1'),_0x3a61f8['name'],_0x3a61f8['email']||_0x3a61f8['Smtp']['user']),'to':_0x31b697[_0x7fd6('0x66')][_0x7fd6('0xa2')],'subject':_0x7fd6('0xa3'),'text':util[_0x7fd6('0x8e')](_0x7fd6('0xa4'),_0x31b697[_0x7fd6('0x66')][_0x7fd6('0xa2')]),'attachments':[{'path':_0x3dca20}]}})[_0x7fd6('0x1c')](function(){return _0x49994f;})['catch'](function(_0x26c601){console['error'](_0x26c601);});}else{return _0x49994f;}})['then'](respondWithStatusCode(_0xa924f7,0xc8))[_0x7fd6('0x26')](handleError(_0xa924f7,null));};exports[_0x7fd6('0xa5')]=function(_0x39c462,_0x21eba3,_0x37841b){return db['ChatMessage'][_0x7fd6('0x64')]({'where':{'id':_0x39c462[_0x7fd6('0x67')]['id']}})['then'](handleEntityNotFound(_0x21eba3,null))[_0x7fd6('0x1c')](function(_0x3f5ef0){if(_0x3f5ef0){return _0x3f5ef0[_0x7fd6('0xa5')](_0x39c462[_0x7fd6('0x66')][_0x7fd6('0xa6')],_[_0x7fd6('0xa7')](_0x39c462['body'],[_0x7fd6('0xa6'),'id'])||{});}})[_0x7fd6('0x1c')](respondWithResult(_0x21eba3,null))[_0x7fd6('0x26')](handleError(_0x21eba3,null));};exports['getMessages']=function(_0x4f80db,_0x4cd873,_0x13fb3f){var _0x40899b={'raw':![],'where':{}};var _0x33330b={};var _0x488212={'count':0x0,'rows':[]};return db[_0x7fd6('0x54')][_0x7fd6('0x79')]({'where':{'id':_0x4f80db[_0x7fd6('0x67')]['id']}})[_0x7fd6('0x1c')](handleEntityNotFound(_0x4cd873,null))['then'](function(_0x5a020b){if(_0x5a020b){_0x33330b[_0x7fd6('0x3b')]=_[_0x7fd6('0x37')](db[_0x7fd6('0x4f')][_0x7fd6('0x36')]);_0x33330b[_0x7fd6('0x38')]=_[_0x7fd6('0x37')](_0x4f80db[_0x7fd6('0x38')]);_0x33330b[_0x7fd6('0x39')]=_[_0x7fd6('0x3a')](_0x33330b['model'],_0x33330b[_0x7fd6('0x38')]);_0x40899b[_0x7fd6('0x3c')]=_[_0x7fd6('0x3a')](_0x33330b[_0x7fd6('0x3b')],qs['fields'](_0x4f80db[_0x7fd6('0x38')][_0x7fd6('0x3d')]));_0x40899b[_0x7fd6('0x3c')]=_0x40899b[_0x7fd6('0x3c')][_0x7fd6('0x3e')]?_0x40899b[_0x7fd6('0x3c')]:_0x33330b[_0x7fd6('0x3b')];if(!_0x4f80db[_0x7fd6('0x38')][_0x7fd6('0x3f')](_0x7fd6('0xa8'))){_0x40899b[_0x7fd6('0x2c')]=qs[_0x7fd6('0x2c')](_0x4f80db['query'][_0x7fd6('0x2c')]);_0x40899b['offset']=qs[_0x7fd6('0x2b')](_0x4f80db['query'][_0x7fd6('0x2b')]);}_0x40899b['order']=qs[_0x7fd6('0x41')](_0x4f80db[_0x7fd6('0x38')][_0x7fd6('0x41')]);_0x40899b[_0x7fd6('0x42')]=qs[_0x7fd6('0x39')](_[_0x7fd6('0xa9')](_0x4f80db[_0x7fd6('0x38')],_0x33330b['filters']));_0x40899b[_0x7fd6('0x42')][_0x7fd6('0xaa')]=_0x5a020b['id'];if(_0x4f80db[_0x7fd6('0x38')][_0x7fd6('0x43')]){_0x40899b[_0x7fd6('0x42')]=_[_0x7fd6('0x44')](_0x40899b[_0x7fd6('0x42')],{'$or':_[_0x7fd6('0xab')](_0x40899b[_0x7fd6('0x3c')],function(_0xdc87b2){var _0x4f61a5={};_0x4f61a5[_0xdc87b2]={'$like':'%'+_0x4f80db[_0x7fd6('0x38')]['filter']+'%'};return _0x4f61a5;})});}if(_0x4f80db[_0x7fd6('0x38')]['$gte']){var _0x4a9f4c=_0x4f80db['query'][_0x7fd6('0xac')][_0x7fd6('0xad')](',');var _0x1c4462={};_0x1c4462[_0x4a9f4c[0x0]]={'$gte':moment(_0x4a9f4c[0x1])['format'](_0x7fd6('0xae'))};_0x40899b[_0x7fd6('0x42')]=_['merge'](_0x40899b[_0x7fd6('0x42')],_0x1c4462);}_0x40899b=_[_0x7fd6('0x44')]({},_0x40899b,_0x4f80db[_0x7fd6('0x48')]);return db[_0x7fd6('0x4f')][_0x7fd6('0x2a')]({'where':_0x40899b[_0x7fd6('0x42')]})[_0x7fd6('0x1c')](function(_0x2f95e8){_0x488212['count']=_0x2f95e8;if(_0x4f80db['query']['includeAll']){_0x40899b[_0x7fd6('0x49')]=[{'all':!![]}];}return db['ChatMessage'][_0x7fd6('0x61')](_0x40899b);})[_0x7fd6('0x1c')](function(_0x2b7c28){_0x488212[_0x7fd6('0x62')]=_0x2b7c28;return _0x488212;});}})[_0x7fd6('0x1c')](respondWithFilteredResult(_0x4cd873,_0x40899b))['catch'](handleError(_0x4cd873,null));};exports[_0x7fd6('0xaf')]=function(_0x2a7418,_0x1e1c3d,_0x5ce115){var _0x3509c6={'where':{}},_0x1d7f97={},_0x3cb5ad={'count':0x0,'rows':[]};return db[_0x7fd6('0x54')]['findOne']({'where':{'id':_0x2a7418[_0x7fd6('0x67')]['id']}})[_0x7fd6('0x1c')](handleEntityNotFound(_0x1e1c3d,null))[_0x7fd6('0x1c')](function(_0x12bba4){if(_0x12bba4){_0x1d7f97[_0x7fd6('0x3b')]=_[_0x7fd6('0x37')](db[_0x7fd6('0x4f')][_0x7fd6('0x36')]);_0x1d7f97[_0x7fd6('0x38')]=_[_0x7fd6('0x37')](_0x2a7418[_0x7fd6('0x38')]);_0x1d7f97[_0x7fd6('0x39')]=_[_0x7fd6('0x3a')](_0x1d7f97[_0x7fd6('0x3b')],_0x1d7f97[_0x7fd6('0x38')]);_0x3509c6[_0x7fd6('0x3c')]=_['intersection'](_0x1d7f97[_0x7fd6('0x3b')],qs[_0x7fd6('0x3d')](_0x2a7418[_0x7fd6('0x38')][_0x7fd6('0x3d')]));_0x3509c6[_0x7fd6('0x3c')]=_0x3509c6['attributes']['length']?_0x3509c6[_0x7fd6('0x3c')]:_0x1d7f97[_0x7fd6('0x3b')];if(!_0x2a7418[_0x7fd6('0x38')][_0x7fd6('0x3f')](_0x7fd6('0xa8'))){_0x3509c6[_0x7fd6('0x2c')]=qs[_0x7fd6('0x2c')](_0x2a7418['query'][_0x7fd6('0x2c')]);_0x3509c6[_0x7fd6('0x2b')]=qs[_0x7fd6('0x2b')](_0x2a7418['query'][_0x7fd6('0x2b')]);}_0x3509c6[_0x7fd6('0x40')]=qs[_0x7fd6('0x41')](_0x2a7418[_0x7fd6('0x38')][_0x7fd6('0x41')]);_0x3509c6[_0x7fd6('0x42')]=qs[_0x7fd6('0x39')](_[_0x7fd6('0xa9')](_0x2a7418[_0x7fd6('0x38')],_0x1d7f97['filters']));_0x3509c6[_0x7fd6('0x42')]['ChatInteractionId']=_0x12bba4['id'];if(_0x2a7418[_0x7fd6('0x38')]['filter']){_0x3509c6[_0x7fd6('0x42')]=_['merge'](_0x3509c6[_0x7fd6('0x42')],{'$or':_['map'](_0x3509c6[_0x7fd6('0x3c')],function(_0x338b79){var _0x1bdb03={};_0x1bdb03[_0x338b79]={'$like':'%'+_0x2a7418[_0x7fd6('0x38')]['filter']+'%'};return _0x1bdb03;})});}_0x3509c6[_0x7fd6('0x42')][_0x7fd6('0x93')]=![];if(_0x2a7418[_0x7fd6('0x38')]['id']){_0x3509c6['where']['id']={'$gt':_0x2a7418[_0x7fd6('0x38')]['id']};}_0x3509c6=_[_0x7fd6('0x44')]({},_0x3509c6,_0x2a7418[_0x7fd6('0x48')]);return db[_0x7fd6('0x4f')][_0x7fd6('0x2a')]({'where':_0x3509c6[_0x7fd6('0x42')]})[_0x7fd6('0x1c')](function(_0x1515c7){_0x3cb5ad[_0x7fd6('0x2a')]=_0x1515c7;_0x3509c6[_0x7fd6('0x49')]=[];if(_0x2a7418[_0x7fd6('0x38')][_0x7fd6('0xb0')]){_0x3509c6[_0x7fd6('0x49')][_0x7fd6('0x4b')]({'model':db[_0x7fd6('0x5a')],'as':'User','attributes':['id','fullname',_0x7fd6('0x90')]});}if(_0x2a7418[_0x7fd6('0x38')][_0x7fd6('0x55')]){_0x3509c6['include']=[{'all':!![]}];}return db[_0x7fd6('0x4f')][_0x7fd6('0x61')](_0x3509c6);})[_0x7fd6('0x1c')](function(_0x55dac0){_0x3cb5ad[_0x7fd6('0x62')]=_0x55dac0;return _0x3cb5ad;});}})[_0x7fd6('0x1c')](respondWithFilteredResult(_0x1e1c3d,_0x3509c6))['catch'](handleError(_0x1e1c3d,null));};exports[_0x7fd6('0xb1')]=function(_0x7abe0f,_0x120d5c,_0x589fd7){return db[_0x7fd6('0x54')]['find']({'where':{'id':_0x7abe0f['params']['id']}})[_0x7fd6('0x1c')](handleEntityNotFound(_0x120d5c,null))[_0x7fd6('0x1c')](function(_0x21cac3){if(_0x21cac3){return _0x21cac3[_0x7fd6('0xb2')](_0x7abe0f[_0x7fd6('0x66')][_0x7fd6('0xa6')],_[_0x7fd6('0xa7')](_0x7abe0f[_0x7fd6('0x66')],[_0x7fd6('0xa6'),'id'])||{})[_0x7fd6('0xb3')](function(){return db[_0x7fd6('0x4c')]['findAll']({'attributes':['id',_0x7fd6('0x33'),_0x7fd6('0x5f')],'where':{'id':_0x7abe0f['body'][_0x7fd6('0xa6')]}});})[_0x7fd6('0x1c')](function(_0x245b9e){socket[_0x7fd6('0xb4')](_0x7fd6('0xb5'),{'id':Number(_0x7abe0f[_0x7fd6('0x67')]['id']),'tags':_0x245b9e||[]});return{'id':Number(_0x7abe0f[_0x7fd6('0x67')]['id']),'tags':_0x245b9e||[]};});}})[_0x7fd6('0x1c')](respondWithResult(_0x120d5c,null))[_0x7fd6('0x26')](handleError(_0x120d5c,null));};exports[_0x7fd6('0xb6')]=function(_0x1726fe,_0x158ad0,_0x56a2ee){var _0x377ebb;return db[_0x7fd6('0x54')]['find']({'where':{'id':_0x1726fe[_0x7fd6('0x67')]['id']}})[_0x7fd6('0x1c')](handleEntityNotFound(_0x158ad0,null))[_0x7fd6('0x1c')](function(_0x4b7aed){if(_0x4b7aed){return _0x4b7aed[_0x7fd6('0xb6')](_0x1726fe['query']['ids']);}})['then'](respondWithStatusCode(_0x158ad0,null))[_0x7fd6('0x26')](handleError(_0x158ad0,null));};exports[_0x7fd6('0xb7')]=function(_0x4c54c5,_0x55c864){var _0x46a0c5=moment()[_0x7fd6('0xb8')]()[_0x7fd6('0xb9')]();var _0x5b7e5a=path[_0x7fd6('0x7c')](config[_0x7fd6('0x7d')],_0x7fd6('0xba'),_0x7fd6('0xbb'),_0x7fd6('0xbc'));var _0x540762=path[_0x7fd6('0x7c')](config['root'],_0x7fd6('0xba'),_0x7fd6('0xbb'),_0x7fd6('0xbd'));var _0x386448=path[_0x7fd6('0x7c')](_0x5b7e5a,_0x46a0c5);var _0x333536=util['format'](_0x7fd6('0xbe'),_0x46a0c5);var _0x38aa53=path[_0x7fd6('0x7c')](_0x5b7e5a,_0x333536);var _0x4728be=![];return db[_0x7fd6('0x54')]['find']({'where':{'id':_0x4c54c5[_0x7fd6('0x67')]['id']},'include':[{'model':db[_0x7fd6('0x4f')],'as':_0x7fd6('0x50'),'attributes':['id',_0x7fd6('0x66')],'include':[{'model':db[_0x7fd6('0x5a')],'as':_0x7fd6('0x5a'),'attributes':['id',_0x7fd6('0x57')],'raw':!![]},{'model':db['CmContact'],'as':_0x7fd6('0x59'),'attributes':['id',_0x7fd6('0xbf')],'raw':!![]},{'model':db[_0x7fd6('0x7b')],'as':_0x7fd6('0x7b'),'raw':!![]}]}]})[_0x7fd6('0x1c')](handleEntityNotFound(_0x55c864,null))[_0x7fd6('0x1c')](function(_0x129b5c){if(_0x129b5c){_0x4728be=!![];var _0x5066eb='';var _0x3b0112={'format':'Letter','border':_0x7fd6('0xc0')};fs[_0x7fd6('0xc1')](_0x386448);_0x5066eb+=util[_0x7fd6('0x8e')](_0x7fd6('0xc2'),_0x129b5c['id']);_0x5066eb+=util[_0x7fd6('0x8e')](_0x7fd6('0xc3'),moment()['format'](_0x7fd6('0xc4'))['toString']());_0x5066eb+='
';for(var _0x449811=0x1;_0x449811<_0x129b5c['Messages'][_0x7fd6('0x3e')];_0x449811++){var _0x3c9427=_0x129b5c['Messages'][_0x449811];_0x5066eb+=_0x7fd6('0xc5');_0x5066eb+=util[_0x7fd6('0x8e')]('%s:\x20%s

',_0x3c9427['User']?_0x3c9427[_0x7fd6('0x5a')]['fullname']:_0x3c9427[_0x7fd6('0x59')][_0x7fd6('0xbf')],_0x3c9427['body']);_0x5066eb+=_0x7fd6('0xc6');if(_0x3c9427[_0x7fd6('0x7b')]){var _0x1e6a78=_0x3c9427['Attachment'];var _0x243e27=path[_0x7fd6('0x7c')](_0x540762,_0x1e6a78[_0x7fd6('0x7f')]);if(fs[_0x7fd6('0xc7')](_0x243e27)){fs[_0x7fd6('0xc8')](_0x243e27)['pipe'](fs['createWriteStream'](path[_0x7fd6('0x7c')](_0x386448,_0x1e6a78[_0x7fd6('0x7f')])));}}}return new BPromise(function(_0x293a5d,_0xd1681){pdf[_0x7fd6('0x65')](_0x5066eb,_0x3b0112)[_0x7fd6('0xc9')](path[_0x7fd6('0x7c')](_0x386448,_0x7fd6('0xca')+_0x46a0c5+_0x7fd6('0xcb')),function(_0x4fa5a0,_0x2efa8c){if(_0x4fa5a0)return _0xd1681(_0x4fa5a0);_0x293a5d(_0x2efa8c);});});}})[_0x7fd6('0x1c')](function(){if(_0x4728be){return new BPromise(function(_0x23b390,_0x59dbdb){zipdir(_0x386448,{'saveTo':_0x38aa53},function(_0x36d74e,_0xafb9e1){if(_0x36d74e)return _0x59dbdb(_0x36d74e);return _0x23b390(_0xafb9e1);});});}})[_0x7fd6('0x1c')](function(){if(_0x4728be){return new BPromise(function(_0x372688,_0x48f810){rimraf(_0x386448,function(_0x302bd0){if(_0x302bd0)_0x48f810(_0x302bd0);return _0x372688();});});}})[_0x7fd6('0x1c')](function(){if(_0x4728be){return _0x55c864[_0x7fd6('0xb7')](_0x38aa53,_0x333536,function(_0x2d907d){if(_0x2d907d){console['log'](_0x7fd6('0xcc'),_0x2d907d);}else{fs['unlinkSync'](_0x38aa53);}});}else{return _0x55c864[_0x7fd6('0x27')](0xc8);}})['catch'](handleError(_0x55c864,null));}; \ No newline at end of file +var _0x8881=['key','VIRTUAL','field','filter','merge','options','include','tag','push','Tag','Tags','distinct','read','createdAt','includeAll','User','Users','fullname','Contact','Owner','internal','ChatWebsite','Account','ChatMessage','Messages','direction','color','ThroughTags','findAll','rows','show','ChatInteraction','find','create','body','params','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','ValidationError','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','mimetype','attachmentDownload','findOne','closed','Unauthorized','Attachment','download','join','root','basename','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','ChatWebsiteId','CmContact','ContactId','%s%d','System','Visitor','website_alias','agentAlias','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','SendMail','sendMail','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','hasOwnProperty','pick','ChatInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','getMyMessages','includeAgent','addTags','setTags','ids','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','firstName','Letter','1cm','

Chat\x20Interaction:\x20#%d

','

Date:\x20%s

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

','','createReadStream','pipe','createWriteStream','interaction-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','set','json','apply','reject','save','update','destroy','stack','name','send','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','map','type'];(function(_0x242617,_0x523952){var _0x18f859=function(_0xc29603){while(--_0xc29603){_0x242617['push'](_0x242617['shift']());}};_0x18f859(++_0x523952);}(_0x8881,0x151));var _0x1888=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0x8881[_0x462999];return _0x4b1366;};'use strict';var pdf=require(_0x1888('0x0'));var emlformat=require(_0x1888('0x1'));var rimraf=require(_0x1888('0x2'));var zipdir=require(_0x1888('0x3'));var jsonpatch=require(_0x1888('0x4'));var rp=require('request-promise');var moment=require(_0x1888('0x5'));var BPromise=require(_0x1888('0x6'));var Mustache=require(_0x1888('0x7'));var util=require('util');var path=require(_0x1888('0x8'));var sox=require('sox');var csv=require(_0x1888('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1888('0xa'));var squel=require(_0x1888('0xb'));var crypto=require(_0x1888('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1888('0xd'));var toCsv=require(_0x1888('0x9'));var querystring=require(_0x1888('0xe'));var Papa=require(_0x1888('0xf'));var authService=require(_0x1888('0x10'));var hardwareService=require(_0x1888('0x11'));var Redis=require(_0x1888('0x12'));var qs=require(_0x1888('0x13'));var logger=require('../../config/logger')(_0x1888('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1888('0x15'))['db'];config[_0x1888('0x16')]=_[_0x1888('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1888('0x18'))(new Redis(config[_0x1888('0x16')]));require('./chatInteraction.socket')[_0x1888('0x19')](socket);var jayson=require(_0x1888('0x1a'));var client=jayson[_0x1888('0x1b')][_0x1888('0x1c')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x31e7bf,_0x372246,_0xfb0dee,_0x18aa25){return new BPromise(function(_0x1d7b73,_0x176c8e){var _0x5b8ece=_0x18aa25||client;return _0x5b8ece[_0x1888('0x1d')](_0x31e7bf,_0xfb0dee)[_0x1888('0x1e')](function(_0x23d223){logger[_0x1888('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x372246,_0x1888('0x20'));logger['debug'](_0x1888('0x21'),_0x372246,'request\x20sent',JSON[_0x1888('0x22')](_0x23d223));if(_0x23d223[_0x1888('0x23')]){if(_0x23d223[_0x1888('0x23')][_0x1888('0x24')]===0x1f4){logger[_0x1888('0x23')](_0x1888('0x25'),_0x372246,_0x23d223[_0x1888('0x23')][_0x1888('0x26')]);return _0x176c8e(_0x23d223[_0x1888('0x23')][_0x1888('0x26')]);}logger[_0x1888('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x372246,_0x23d223[_0x1888('0x23')][_0x1888('0x26')]);return _0x1d7b73(_0x23d223[_0x1888('0x23')][_0x1888('0x26')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x372246,_0x1888('0x20'));_0x1d7b73(_0x23d223[_0x1888('0x27')]['message']);}})[_0x1888('0x28')](function(_0x24a061){logger[_0x1888('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x372246,_0x24a061);_0x176c8e(_0x24a061);});});}function respondWithStatusCode(_0x4a2915,_0x43e0bc){_0x43e0bc=_0x43e0bc||0xcc;return function(_0x592943){if(_0x592943){return _0x4a2915[_0x1888('0x29')](_0x43e0bc);}return _0x4a2915[_0x1888('0x2a')](_0x43e0bc)[_0x1888('0x2b')]();};}function respondWithResult(_0x184416,_0x53bf92){_0x53bf92=_0x53bf92||0xc8;return function(_0x1d51b4){if(_0x1d51b4){return _0x184416[_0x1888('0x2a')](_0x53bf92)['json'](_0x1d51b4);}};}function respondWithFilteredResult(_0x4e1101,_0x42f3dc){return function(_0x28b578){if(_0x28b578){var _0x226275=_0x28b578['count'],_0x926354=_0x42f3dc[_0x1888('0x2c')],_0xbce24a=_0x42f3dc[_0x1888('0x2c')]+_0x42f3dc[_0x1888('0x2d')],_0x4656a4;if(_0xbce24a>=_0x226275){_0xbce24a=_0x226275;_0x4656a4=0xc8;}else{_0x4656a4=0xce;}_0x4e1101[_0x1888('0x2a')](_0x4656a4);return _0x4e1101[_0x1888('0x2e')]('Content-Range',_0x926354+'-'+_0xbce24a+'/'+_0x226275)[_0x1888('0x2f')](_0x28b578);}return null;};}function patchUpdates(_0xe7074b){return function(_0x2b3874){try{jsonpatch[_0x1888('0x30')](_0x2b3874,_0xe7074b,!![]);}catch(_0x366bf6){return BPromise[_0x1888('0x31')](_0x366bf6);}return _0x2b3874[_0x1888('0x32')]();};}function saveUpdates(_0x4c6195,_0x292d0f){return function(_0x3c247d){if(_0x3c247d){return _0x3c247d[_0x1888('0x33')](_0x4c6195)['then'](function(_0x3bbd11){return _0x3bbd11;});}return null;};}function removeEntity(_0xd4fc7b,_0x3ff3b4){return function(_0x3a08e9){if(_0x3a08e9){return _0x3a08e9[_0x1888('0x34')]()['then'](function(){_0xd4fc7b['status'](0xcc)[_0x1888('0x2b')]();});}};}function handleEntityNotFound(_0x437ce7,_0x4d711a){return function(_0x25d7bc){if(!_0x25d7bc){_0x437ce7[_0x1888('0x29')](0x194);}return _0x25d7bc;};}function handleError(_0x5b0ec8,_0x25a131){_0x25a131=_0x25a131||0x1f4;return function(_0x1d7488){logger[_0x1888('0x23')](_0x1d7488[_0x1888('0x35')]);if(_0x1d7488['name']){delete _0x1d7488[_0x1888('0x36')];}_0x5b0ec8['status'](_0x25a131)[_0x1888('0x37')](_0x1d7488);};}exports['index']=function(_0x48d20c,_0x366e60){var _0x346a49={},_0x1e8753={},_0x52654d={'count':0x0,'rows':[]};var _0x58d558=db['ChatInteraction'][_0x1888('0x38')];_0x1e8753[_0x1888('0x39')]=_[_0x1888('0x3a')](_0x58d558);_0x1e8753[_0x1888('0x3b')]=_[_0x1888('0x3a')](_0x48d20c[_0x1888('0x3b')]);_0x1e8753[_0x1888('0x3c')]=_['intersection'](_0x1e8753['model'],_0x1e8753[_0x1888('0x3b')]);_0x346a49[_0x1888('0x3d')]=_[_0x1888('0x3e')](_0x1e8753['model'],qs[_0x1888('0x3f')](_0x48d20c[_0x1888('0x3b')][_0x1888('0x3f')]));_0x346a49['attributes']=_0x346a49[_0x1888('0x3d')][_0x1888('0x40')]?_0x346a49[_0x1888('0x3d')]:_0x1e8753[_0x1888('0x39')];if(!_0x48d20c[_0x1888('0x3b')]['hasOwnProperty'](_0x1888('0x41'))){_0x346a49[_0x1888('0x2d')]=qs['limit'](_0x48d20c[_0x1888('0x3b')][_0x1888('0x2d')]);_0x346a49[_0x1888('0x2c')]=qs[_0x1888('0x2c')](_0x48d20c[_0x1888('0x3b')]['offset']);}_0x346a49[_0x1888('0x42')]=qs['sort'](_0x48d20c[_0x1888('0x3b')][_0x1888('0x43')]);_0x346a49[_0x1888('0x44')]=qs['filters'](_['pick'](_0x48d20c['query'],_0x1e8753[_0x1888('0x3c')]));if(_0x48d20c[_0x1888('0x3b')]['filter']){_0x346a49['where']=_['merge'](_0x346a49['where'],{'$or':_[_0x1888('0x45')](_0x58d558,function(_0x4b159f){if(_0x4b159f[_0x1888('0x46')][_0x1888('0x47')]!==_0x1888('0x48')){var _0x2fd11f={};_0x2fd11f[_0x4b159f[_0x1888('0x49')]]={'$like':'%'+_0x48d20c[_0x1888('0x3b')][_0x1888('0x4a')]+'%'};return _0x2fd11f;}})});}_0x346a49=_[_0x1888('0x4b')]({},_0x346a49,_0x48d20c[_0x1888('0x4c')]);var _0x4d7ff8={'where':_0x346a49['where']};_0x4d7ff8[_0x1888('0x4d')]=[];if(_0x48d20c[_0x1888('0x3b')][_0x1888('0x4e')]){_0x4d7ff8['include'][_0x1888('0x4f')]({'model':db[_0x1888('0x50')],'as':_0x1888('0x51'),'attributes':['id'],'where':{'id':_0x48d20c['query'][_0x1888('0x4e')]},'required':!![]});_0x4d7ff8[_0x1888('0x52')]=!![];}if(_0x48d20c['query'][_0x1888('0x53')]){_0x4d7ff8[_0x1888('0x4d')][_0x1888('0x4f')]({'model':db['ChatMessage'],'as':'Messages','attributes':['id','direction',_0x1888('0x54'),_0x1888('0x53')],'where':{'direction':'in','read':_0x48d20c['query']['read']||![]},'required':!![]});_0x4d7ff8[_0x1888('0x52')]=!![];}return db['ChatInteraction']['count'](_0x4d7ff8)[_0x1888('0x1e')](function(_0x20c6c3){_0x52654d['count']=_0x20c6c3;if(_0x48d20c[_0x1888('0x3b')][_0x1888('0x55')]){_0x346a49['include']=[{'model':db[_0x1888('0x56')],'as':_0x1888('0x57'),'required':![],'attributes':['id','name',_0x1888('0x58')]},{'model':db['CmContact'],'as':_0x1888('0x59'),'required':![]},{'model':db[_0x1888('0x56')],'as':_0x1888('0x5a'),'attributes':[_0x1888('0x36'),_0x1888('0x58'),_0x1888('0x5b')],'required':![]},{'model':db[_0x1888('0x5c')],'as':_0x1888('0x5d'),'attributes':[_0x1888('0x36'),_0x1888('0x47')],'required':![]},{'model':db[_0x1888('0x5e')],'as':_0x1888('0x5f'),'attributes':['id',_0x1888('0x60'),_0x1888('0x54'),_0x1888('0x53')],'where':{'direction':'in','read':_0x48d20c[_0x1888('0x3b')][_0x1888('0x53')]||![]},'required':_0x48d20c[_0x1888('0x3b')][_0x1888('0x53')]||![]},{'model':db[_0x1888('0x50')],'as':_0x1888('0x51'),'attributes':['id',_0x1888('0x36'),_0x1888('0x61')],'required':_0x48d20c[_0x1888('0x3b')][_0x1888('0x4e')]?!![]:![]},{'model':db[_0x1888('0x50')],'as':_0x1888('0x62'),'attributes':['id',_0x1888('0x36'),'color'],'through':_0x48d20c[_0x1888('0x3b')][_0x1888('0x4e')]?{'attributes':[],'where':{'TagId':_0x48d20c['query']['tag']||undefined}}:{},'required':_0x48d20c[_0x1888('0x3b')][_0x1888('0x4e')]?!![]:![]}];}return db['ChatInteraction'][_0x1888('0x63')](_0x346a49);})[_0x1888('0x1e')](function(_0xa17fd5){_0x52654d[_0x1888('0x64')]=_0xa17fd5;return _0x52654d;})[_0x1888('0x1e')](respondWithFilteredResult(_0x366e60,_0x346a49))['catch'](handleError(_0x366e60,null));};exports[_0x1888('0x65')]=function(_0x449974,_0x2a4314){var _0x352c56={'raw':![],'where':{'id':_0x449974['params']['id']}},_0x38c0c9={};_0x38c0c9[_0x1888('0x39')]=_[_0x1888('0x3a')](db[_0x1888('0x66')][_0x1888('0x38')]);_0x38c0c9[_0x1888('0x3b')]=_['keys'](_0x449974[_0x1888('0x3b')]);_0x38c0c9[_0x1888('0x3c')]=_[_0x1888('0x3e')](_0x38c0c9[_0x1888('0x39')],_0x38c0c9['query']);_0x352c56[_0x1888('0x3d')]=_[_0x1888('0x3e')](_0x38c0c9[_0x1888('0x39')],qs[_0x1888('0x3f')](_0x449974[_0x1888('0x3b')][_0x1888('0x3f')]));_0x352c56[_0x1888('0x3d')]=_0x352c56[_0x1888('0x3d')][_0x1888('0x40')]?_0x352c56[_0x1888('0x3d')]:_0x38c0c9[_0x1888('0x39')];if(_0x449974[_0x1888('0x3b')][_0x1888('0x55')]){_0x352c56[_0x1888('0x4d')]=[{'all':!![]}];}_0x352c56=_[_0x1888('0x4b')]({},_0x352c56,_0x449974['options']);return db['ChatInteraction'][_0x1888('0x67')](_0x352c56)[_0x1888('0x1e')](handleEntityNotFound(_0x2a4314,null))[_0x1888('0x1e')](respondWithResult(_0x2a4314,null))['catch'](handleError(_0x2a4314,null));};exports['create']=function(_0x5e1a3e,_0x2db466){return db[_0x1888('0x66')][_0x1888('0x68')](_0x5e1a3e[_0x1888('0x69')],{})['then'](respondWithResult(_0x2db466,0xc9))['catch'](handleError(_0x2db466,null));};exports[_0x1888('0x33')]=function(_0xe80552,_0xb0557c){if(_0xe80552[_0x1888('0x69')]['id']){delete _0xe80552[_0x1888('0x69')]['id'];}return db[_0x1888('0x66')][_0x1888('0x67')]({'where':{'id':_0xe80552[_0x1888('0x6a')]['id']}})['then'](handleEntityNotFound(_0xb0557c,null))['then'](saveUpdates(_0xe80552[_0x1888('0x69')],null))[_0x1888('0x1e')](respondWithResult(_0xb0557c,null))['catch'](handleError(_0xb0557c,null));};exports[_0x1888('0x34')]=function(_0x52b7f9,_0x4c852c){return db[_0x1888('0x66')][_0x1888('0x67')]({'where':{'id':_0x52b7f9[_0x1888('0x6a')]['id']}})[_0x1888('0x1e')](handleEntityNotFound(_0x4c852c,null))['then'](removeEntity(_0x4c852c,null))[_0x1888('0x28')](handleError(_0x4c852c,null));};exports[_0x1888('0x6b')]=function(_0x1f863d,_0x15f858){return db[_0x1888('0x66')][_0x1888('0x6b')]()[_0x1888('0x1e')](respondWithResult(_0x15f858,null))[_0x1888('0x28')](handleError(_0x15f858,null));};exports[_0x1888('0x6c')]=function(_0xb37f51,_0x513776){if(_0xb37f51['body']['id']){delete _0xb37f51[_0x1888('0x69')]['id'];}return db[_0x1888('0x66')][_0x1888('0x67')]({'where':{'id':_0xb37f51[_0x1888('0x6a')]['id']}})[_0x1888('0x1e')](handleEntityNotFound(_0x513776,null))[_0x1888('0x1e')](saveUpdates(_0xb37f51[_0x1888('0x69')],null))[_0x1888('0x1e')](respondWithResult(_0x513776,null))[_0x1888('0x28')](handleError(_0x513776,null));};exports[_0x1888('0x6d')]=function(_0x56bb61,_0x12812d,_0x1e5f99){if(_0x56bb61[_0x1888('0x69')]['id']){delete _0x56bb61[_0x1888('0x69')]['id'];}return db['ChatInteraction'][_0x1888('0x67')]({'where':{'id':_0x56bb61['params']['id']}})[_0x1888('0x1e')](function(_0x447b02){if(!_0x447b02){logger[_0x1888('0x23')](_0x1888('0x6e'),_0x1888('0x6d'),0x194,_0x1888('0x6f'));_0x12812d[_0x1888('0x29')](0x194);}else{if(_0x447b02[_0x1888('0x70')]){throw new db['Sequelize'][(_0x1888('0x71'))](_0x1888('0x72'));}}return _0x447b02;})['then'](function(_0x508a13){if(_0x508a13){return _0x508a13[_0x1888('0x33')]({'closed':_0x56bb61[_0x1888('0x69')]['closed'],'closedAt':_0x56bb61['body']['closedAt'],'disposition':_0x56bb61[_0x1888('0x69')][_0x1888('0x73')]})[_0x1888('0x1e')](function(_0x5992f3){return _0x5992f3;});}})[_0x1888('0x1e')](function(_0x4a2680){return respondWithRpcPromise(_0x1888('0x74'),_0x1888('0x6d'),_0x56bb61[_0x1888('0x69')],client9004);})[_0x1888('0x1e')](respondWithResult(_0x12812d,null))['catch'](handleError(_0x12812d,null));};exports[_0x1888('0x75')]=function(_0x2f051c,_0x3dddeb,_0x1926be){_0x2f051c[_0x1888('0x69')][_0x1888('0x36')]=_0x2f051c[_0x1888('0x76')][_0x1888('0x77')];_0x2f051c[_0x1888('0x69')]['basename']=_0x2f051c[_0x1888('0x76')]['filename'];_0x2f051c[_0x1888('0x69')]['type']=_0x2f051c[_0x1888('0x76')][_0x1888('0x78')];return db['Attachment'][_0x1888('0x68')](_0x2f051c[_0x1888('0x69')])[_0x1888('0x1e')](respondWithResult(_0x3dddeb,0xc9))[_0x1888('0x28')](handleError(_0x3dddeb,null));};exports[_0x1888('0x79')]=function(_0x5e5114,_0x3ccc94,_0x3048f6){return db[_0x1888('0x66')][_0x1888('0x7a')]({'where':{'id':_0x5e5114['params']['id']},'raw':!![]})[_0x1888('0x1e')](handleEntityNotFound(_0x3ccc94,null))[_0x1888('0x1e')](function(_0x3b809d){if(_0x3b809d){if(_0x3b809d[_0x1888('0x7b')]){return _0x3ccc94[_0x1888('0x2a')](0x193)[_0x1888('0x2f')]({'status':0x193,'message':_0x1888('0x7c')});}return db[_0x1888('0x7d')][_0x1888('0x7a')]({'where':{'id':_0x5e5114['query']['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x3ccc94,null));}})[_0x1888('0x1e')](function(_0x14c360){if(_0x14c360){return _0x3ccc94[_0x1888('0x7e')](path[_0x1888('0x7f')](config[_0x1888('0x80')],'server/files/attachments/',_0x14c360[_0x1888('0x81')]));}})['catch'](handleError(_0x3ccc94,null));};exports[_0x1888('0x82')]=function(_0x240ebc,_0x57cfcd){var _0x3d0edc=null;var _0xe192e0=null;var _0x7030bc=null;var _0x346c56=null;if(_0x240ebc[_0x1888('0x69')]['id']){delete _0x240ebc[_0x1888('0x69')]['id'];}if(_0x240ebc['body'][_0x1888('0x83')]){_0x346c56=path['join'](config['root'],_0x1888('0x84'),util[_0x1888('0x85')]('transcript-%s.txt',Date[_0x1888('0x86')]()));_0x240ebc[_0x1888('0x69')][_0x1888('0x87')]=_0x346c56;}return db[_0x1888('0x66')]['find']({'where':{'id':_0x240ebc[_0x1888('0x6a')]['id']},'include':[{'model':db[_0x1888('0x5e')],'as':_0x1888('0x5f'),'include':[{'model':db[_0x1888('0x56')],'as':_0x1888('0x56')}]}]})[_0x1888('0x1e')](handleEntityNotFound(_0x57cfcd,null))[_0x1888('0x1e')](saveUpdates(_0x240ebc[_0x1888('0x69')],null))[_0x1888('0x1e')](function(_0xd07cff){if(_0xd07cff){_0x3d0edc=_0xd07cff;return db['ChatWebsite'][_0x1888('0x67')]({'where':{'id':_0x3d0edc[_0x1888('0x88')]}});}})[_0x1888('0x1e')](function(_0x1e895e){if(_0x1e895e){_0x7030bc=_0x1e895e;return db[_0x1888('0x89')][_0x1888('0x67')]({'where':{'id':_0x3d0edc[_0x1888('0x8a')]}});}})[_0x1888('0x1e')](function(_0x5e8d9e){if(_0x5e8d9e){_0xe192e0=_0x5e8d9e;if(_0x346c56){var _0x5a9658=null;for(var _0x114849=0x1;_0x114849<_0x3d0edc[_0x1888('0x5f')][_0x1888('0x40')];++_0x114849){_0x5a9658=_0x3d0edc[_0x1888('0x5f')][_0x114849];var _0x5ac084=_0x5a9658['UserId']?util[_0x1888('0x85')](_0x1888('0x8b'),_0x7030bc['agentAlias'],_0x5a9658[_0x1888('0x70')]):_0x1888('0x8c');var _0x533c71=_0x240ebc[_0x1888('0x69')]['customer']||util[_0x1888('0x85')](_0x1888('0x8b'),_0x1888('0x8d'),_0x5a9658[_0x1888('0x8a')]);switch(_0x7030bc['agentIdentifier']){case _0x1888('0x8e'):_0x5ac084=_0x5a9658['UserId']?util['format']('%s%d',_0x7030bc[_0x1888('0x8f')],_0x5a9658[_0x1888('0x70')]):'System';break;case _0x1888('0x90'):_0x5ac084=_0x5a9658[_0x1888('0x70')]?_0x5a9658[_0x1888('0x56')][_0x1888('0x91')]||_0x5a9658['User'][_0x1888('0x58')]:_0x1888('0x8c');break;case _0x1888('0x92'):_0x5ac084=_0x5a9658[_0x1888('0x70')]?_0x5a9658[_0x1888('0x56')]['fullname']:'System';break;default:_0x5ac084=_0x5a9658['UserId']?util[_0x1888('0x85')]('%s%d',_0x7030bc['agentAlias'],_0x5a9658[_0x1888('0x70')]):_0x1888('0x8c');}var _0x3664d0=util[_0x1888('0x85')](_0x1888('0x93'),moment(_0x5a9658[_0x1888('0x54')])[_0x1888('0x85')](_0x1888('0x94')),_0x5a9658['direction']==='in'?_0x533c71:_0x5ac084,_0x5a9658[_0x1888('0x69')]);if(!_0x5a9658[_0x1888('0x95')]){fs['appendFileSync'](_0x346c56,_0x3664d0);}}return db[_0x1888('0x96')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1888('0x97'),'raw':!![]}]});}}})['then'](function(_0x27a635){if(_0x27a635&&_0x27a635[_0x1888('0x97')]&&_0x240ebc[_0x1888('0x69')]){var _0x96ef64={'tls':{'rejectUnauthorized':![]}};if(_0x27a635[_0x1888('0x97')][_0x1888('0x98')]){_0x96ef64[_0x1888('0x98')]=_0x27a635[_0x1888('0x97')][_0x1888('0x98')];}else{_0x96ef64[_0x1888('0x99')]=_0x27a635['Smtp'][_0x1888('0x99')];_0x96ef64[_0x1888('0x9a')]=_0x27a635[_0x1888('0x97')][_0x1888('0x9a')];_0x96ef64[_0x1888('0x9b')]=_0x27a635[_0x1888('0x97')][_0x1888('0x9b')];}if(_0x27a635[_0x1888('0x97')][_0x1888('0x9c')]){_0x96ef64[_0x1888('0x9d')]={'user':_0x27a635[_0x1888('0x97')][_0x1888('0x9e')],'pass':_0x27a635['Smtp']['pass']};}return respondWithRpcPromise(_0x1888('0x9f'),_0x1888('0xa0'),{'account':_0x96ef64,'message':{'from':util[_0x1888('0x85')]('\x22%s\x22\x20<%s>',_0x27a635[_0x1888('0x36')],_0x27a635[_0x1888('0xa1')]||_0x27a635[_0x1888('0x97')]['user']),'to':_0x240ebc[_0x1888('0x69')]['mailTranscript'],'subject':_0x1888('0xa2'),'text':util[_0x1888('0x85')](_0x1888('0xa3'),_0x240ebc['body']['mailTranscript']),'attachments':[{'path':_0x346c56}]}})[_0x1888('0x1e')](function(){return _0x3d0edc;})['catch'](function(_0x1ff7a9){console[_0x1888('0x23')](_0x1ff7a9);});}else{return _0x3d0edc;}})[_0x1888('0x1e')](respondWithStatusCode(_0x57cfcd,0xc8))[_0x1888('0x28')](handleError(_0x57cfcd,null));};exports[_0x1888('0xa4')]=function(_0x322927,_0x171069,_0x2f2967){return db[_0x1888('0x5e')][_0x1888('0x67')]({'where':{'id':_0x322927[_0x1888('0x6a')]['id']}})[_0x1888('0x1e')](handleEntityNotFound(_0x171069,null))[_0x1888('0x1e')](function(_0x5780b1){if(_0x5780b1){return _0x5780b1['addMessage'](_0x322927[_0x1888('0x69')]['ids'],_[_0x1888('0xa5')](_0x322927[_0x1888('0x69')],['ids','id'])||{});}})['then'](respondWithResult(_0x171069,null))[_0x1888('0x28')](handleError(_0x171069,null));};exports['getMessages']=function(_0x2d22ac,_0x784b27,_0x285a7f){var _0x25252f={'raw':![],'where':{}};var _0x3ca744={};var _0x4c1dea={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x2d22ac[_0x1888('0x6a')]['id']}})[_0x1888('0x1e')](handleEntityNotFound(_0x784b27,null))['then'](function(_0x276add){if(_0x276add){_0x3ca744[_0x1888('0x39')]=_['keys'](db['ChatMessage'][_0x1888('0x38')]);_0x3ca744[_0x1888('0x3b')]=_[_0x1888('0x3a')](_0x2d22ac[_0x1888('0x3b')]);_0x3ca744[_0x1888('0x3c')]=_[_0x1888('0x3e')](_0x3ca744[_0x1888('0x39')],_0x3ca744[_0x1888('0x3b')]);_0x25252f[_0x1888('0x3d')]=_['intersection'](_0x3ca744[_0x1888('0x39')],qs[_0x1888('0x3f')](_0x2d22ac[_0x1888('0x3b')]['fields']));_0x25252f[_0x1888('0x3d')]=_0x25252f[_0x1888('0x3d')][_0x1888('0x40')]?_0x25252f[_0x1888('0x3d')]:_0x3ca744[_0x1888('0x39')];if(!_0x2d22ac['query'][_0x1888('0xa6')](_0x1888('0x41'))){_0x25252f[_0x1888('0x2d')]=qs[_0x1888('0x2d')](_0x2d22ac[_0x1888('0x3b')][_0x1888('0x2d')]);_0x25252f[_0x1888('0x2c')]=qs[_0x1888('0x2c')](_0x2d22ac[_0x1888('0x3b')]['offset']);}_0x25252f[_0x1888('0x42')]=qs['sort'](_0x2d22ac[_0x1888('0x3b')][_0x1888('0x43')]);_0x25252f[_0x1888('0x44')]=qs['filters'](_[_0x1888('0xa7')](_0x2d22ac[_0x1888('0x3b')],_0x3ca744[_0x1888('0x3c')]));_0x25252f[_0x1888('0x44')][_0x1888('0xa8')]=_0x276add['id'];if(_0x2d22ac[_0x1888('0x3b')][_0x1888('0x4a')]){_0x25252f[_0x1888('0x44')]=_[_0x1888('0x4b')](_0x25252f[_0x1888('0x44')],{'$or':_[_0x1888('0x45')](_0x25252f['attributes'],function(_0x2e2f12){var _0x34faf2={};_0x34faf2[_0x2e2f12]={'$like':'%'+_0x2d22ac[_0x1888('0x3b')]['filter']+'%'};return _0x34faf2;})});}if(_0x2d22ac[_0x1888('0x3b')][_0x1888('0xa9')]){var _0x552e21=_0x2d22ac[_0x1888('0x3b')]['$gte'][_0x1888('0xaa')](',');var _0x3aa1e6={};_0x3aa1e6[_0x552e21[0x0]]={'$gte':moment(_0x552e21[0x1])[_0x1888('0x85')](_0x1888('0xab'))};_0x25252f['where']=_['merge'](_0x25252f[_0x1888('0x44')],_0x3aa1e6);}_0x25252f=_[_0x1888('0x4b')]({},_0x25252f,_0x2d22ac[_0x1888('0x4c')]);return db[_0x1888('0x5e')][_0x1888('0xac')]({'where':_0x25252f[_0x1888('0x44')]})[_0x1888('0x1e')](function(_0x413d54){_0x4c1dea[_0x1888('0xac')]=_0x413d54;if(_0x2d22ac[_0x1888('0x3b')][_0x1888('0x55')]){_0x25252f[_0x1888('0x4d')]=[{'all':!![]}];}return db['ChatMessage'][_0x1888('0x63')](_0x25252f);})[_0x1888('0x1e')](function(_0x585b3e){_0x4c1dea[_0x1888('0x64')]=_0x585b3e;return _0x4c1dea;});}})['then'](respondWithFilteredResult(_0x784b27,_0x25252f))[_0x1888('0x28')](handleError(_0x784b27,null));};exports[_0x1888('0xad')]=function(_0x2deeec,_0x5ea4c0,_0xd4aa8c){var _0x242271={'where':{}},_0x44a07b={},_0x28260b={'count':0x0,'rows':[]};return db[_0x1888('0x66')][_0x1888('0x7a')]({'where':{'id':_0x2deeec[_0x1888('0x6a')]['id']}})[_0x1888('0x1e')](handleEntityNotFound(_0x5ea4c0,null))[_0x1888('0x1e')](function(_0x4bcd08){if(_0x4bcd08){_0x44a07b['model']=_[_0x1888('0x3a')](db[_0x1888('0x5e')][_0x1888('0x38')]);_0x44a07b[_0x1888('0x3b')]=_['keys'](_0x2deeec['query']);_0x44a07b[_0x1888('0x3c')]=_[_0x1888('0x3e')](_0x44a07b[_0x1888('0x39')],_0x44a07b[_0x1888('0x3b')]);_0x242271[_0x1888('0x3d')]=_[_0x1888('0x3e')](_0x44a07b['model'],qs[_0x1888('0x3f')](_0x2deeec[_0x1888('0x3b')][_0x1888('0x3f')]));_0x242271[_0x1888('0x3d')]=_0x242271[_0x1888('0x3d')][_0x1888('0x40')]?_0x242271['attributes']:_0x44a07b['model'];if(!_0x2deeec[_0x1888('0x3b')][_0x1888('0xa6')](_0x1888('0x41'))){_0x242271[_0x1888('0x2d')]=qs[_0x1888('0x2d')](_0x2deeec['query'][_0x1888('0x2d')]);_0x242271[_0x1888('0x2c')]=qs[_0x1888('0x2c')](_0x2deeec['query'][_0x1888('0x2c')]);}_0x242271['order']=qs['sort'](_0x2deeec[_0x1888('0x3b')][_0x1888('0x43')]);_0x242271[_0x1888('0x44')]=qs[_0x1888('0x3c')](_[_0x1888('0xa7')](_0x2deeec[_0x1888('0x3b')],_0x44a07b['filters']));_0x242271[_0x1888('0x44')]['ChatInteractionId']=_0x4bcd08['id'];if(_0x2deeec[_0x1888('0x3b')][_0x1888('0x4a')]){_0x242271[_0x1888('0x44')]=_[_0x1888('0x4b')](_0x242271['where'],{'$or':_[_0x1888('0x45')](_0x242271[_0x1888('0x3d')],function(_0x15cb11){var _0x3f4c0b={};_0x3f4c0b[_0x15cb11]={'$like':'%'+_0x2deeec[_0x1888('0x3b')][_0x1888('0x4a')]+'%'};return _0x3f4c0b;})});}_0x242271[_0x1888('0x44')][_0x1888('0x95')]=![];if(_0x2deeec[_0x1888('0x3b')]['id']){_0x242271['where']['id']={'$gt':_0x2deeec['query']['id']};}_0x242271=_[_0x1888('0x4b')]({},_0x242271,_0x2deeec[_0x1888('0x4c')]);return db['ChatMessage'][_0x1888('0xac')]({'where':_0x242271[_0x1888('0x44')]})[_0x1888('0x1e')](function(_0x4a8448){_0x28260b[_0x1888('0xac')]=_0x4a8448;_0x242271['include']=[];if(_0x2deeec[_0x1888('0x3b')][_0x1888('0xae')]){_0x242271[_0x1888('0x4d')][_0x1888('0x4f')]({'model':db[_0x1888('0x56')],'as':_0x1888('0x56'),'attributes':['id',_0x1888('0x58'),_0x1888('0x91')]});}if(_0x2deeec[_0x1888('0x3b')][_0x1888('0x55')]){_0x242271[_0x1888('0x4d')]=[{'all':!![]}];}return db[_0x1888('0x5e')][_0x1888('0x63')](_0x242271);})['then'](function(_0x297456){_0x28260b['rows']=_0x297456;return _0x28260b;});}})[_0x1888('0x1e')](respondWithFilteredResult(_0x5ea4c0,_0x242271))[_0x1888('0x28')](handleError(_0x5ea4c0,null));};exports[_0x1888('0xaf')]=function(_0x1b3831,_0x44c300,_0x401a74){return db[_0x1888('0x66')][_0x1888('0x67')]({'where':{'id':_0x1b3831['params']['id']}})[_0x1888('0x1e')](handleEntityNotFound(_0x44c300,null))['then'](function(_0x44ec8d){if(_0x44ec8d){return _0x44ec8d[_0x1888('0xb0')](_0x1b3831[_0x1888('0x69')]['ids'],_[_0x1888('0xa5')](_0x1b3831[_0x1888('0x69')],[_0x1888('0xb1'),'id'])||{})[_0x1888('0xb2')](function(){return db[_0x1888('0x50')]['findAll']({'attributes':['id',_0x1888('0x36'),_0x1888('0x61')],'where':{'id':_0x1b3831['body'][_0x1888('0xb1')]}});})[_0x1888('0x1e')](function(_0xfb2ddc){socket[_0x1888('0xb3')](_0x1888('0xb4'),{'id':Number(_0x1b3831['params']['id']),'tags':_0xfb2ddc||[]});return{'id':Number(_0x1b3831[_0x1888('0x6a')]['id']),'tags':_0xfb2ddc||[]};});}})[_0x1888('0x1e')](respondWithResult(_0x44c300,null))[_0x1888('0x28')](handleError(_0x44c300,null));};exports[_0x1888('0xb5')]=function(_0x516ce5,_0x2d4f97,_0x1ccd79){var _0x145d09;return db['ChatInteraction'][_0x1888('0x67')]({'where':{'id':_0x516ce5[_0x1888('0x6a')]['id']}})['then'](handleEntityNotFound(_0x2d4f97,null))[_0x1888('0x1e')](function(_0x2eb3f6){if(_0x2eb3f6){return _0x2eb3f6[_0x1888('0xb5')](_0x516ce5[_0x1888('0x3b')][_0x1888('0xb1')]);}})['then'](respondWithStatusCode(_0x2d4f97,null))[_0x1888('0x28')](handleError(_0x2d4f97,null));};exports[_0x1888('0x7e')]=function(_0x5e7492,_0x2037a9){var _0x285c17=moment()[_0x1888('0xb6')]()['toString']();var _0x1b5cfa=path[_0x1888('0x7f')](config['root'],_0x1888('0xb7'),_0x1888('0xb8'),_0x1888('0xb9'));var _0x2142c7=path[_0x1888('0x7f')](config['root'],_0x1888('0xb7'),_0x1888('0xb8'),_0x1888('0xba'));var _0x5bf632=path[_0x1888('0x7f')](_0x1b5cfa,_0x285c17);var _0x6e03ed=util[_0x1888('0x85')]('interaction-%s.zip',_0x285c17);var _0x3041cf=path[_0x1888('0x7f')](_0x1b5cfa,_0x6e03ed);var _0x302b78=![];return db['ChatInteraction']['find']({'where':{'id':_0x5e7492['params']['id']},'include':[{'model':db[_0x1888('0x5e')],'as':_0x1888('0x5f'),'attributes':['id','body'],'include':[{'model':db[_0x1888('0x56')],'as':'User','attributes':['id',_0x1888('0x58')],'raw':!![]},{'model':db['CmContact'],'as':_0x1888('0x59'),'attributes':['id',_0x1888('0xbb')],'raw':!![]},{'model':db[_0x1888('0x7d')],'as':_0x1888('0x7d'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2037a9,null))['then'](function(_0x1df86e){if(_0x1df86e){_0x302b78=!![];var _0x5a72cb='';var _0x1ca77a={'format':_0x1888('0xbc'),'border':_0x1888('0xbd')};fs['mkdirSync'](_0x5bf632);_0x5a72cb+=util[_0x1888('0x85')](_0x1888('0xbe'),_0x1df86e['id']);_0x5a72cb+=util[_0x1888('0x85')](_0x1888('0xbf'),moment()[_0x1888('0x85')](_0x1888('0xc0'))['toString']());_0x5a72cb+=_0x1888('0xc1');for(var _0x483dc=0x1;_0x483dc<_0x1df86e[_0x1888('0x5f')][_0x1888('0x40')];_0x483dc++){var _0xedaf55=_0x1df86e[_0x1888('0x5f')][_0x483dc];_0x5a72cb+='';_0x5a72cb+=util[_0x1888('0x85')](_0x1888('0xc2'),_0xedaf55['User']?_0xedaf55[_0x1888('0x56')][_0x1888('0x58')]:_0xedaf55[_0x1888('0x59')][_0x1888('0xbb')],_0xedaf55['body']);_0x5a72cb+=_0x1888('0xc3');if(_0xedaf55[_0x1888('0x7d')]){var _0x18dda3=_0xedaf55[_0x1888('0x7d')];var _0x4a68f6=path['join'](_0x2142c7,_0x18dda3[_0x1888('0x81')]);if(fs['existsSync'](_0x4a68f6)){fs[_0x1888('0xc4')](_0x4a68f6)[_0x1888('0xc5')](fs[_0x1888('0xc6')](path[_0x1888('0x7f')](_0x5bf632,_0x18dda3[_0x1888('0x81')])));}}}return new BPromise(function(_0x285f4c,_0x57eca7){pdf[_0x1888('0x68')](_0x5a72cb,_0x1ca77a)['toFile'](path[_0x1888('0x7f')](_0x5bf632,_0x1888('0xc7')+_0x285c17+_0x1888('0xc8')),function(_0x1181e6,_0x42f49f){if(_0x1181e6)return _0x57eca7(_0x1181e6);_0x285f4c(_0x42f49f);});});}})[_0x1888('0x1e')](function(){if(_0x302b78){return new BPromise(function(_0x57885a,_0x22e924){zipdir(_0x5bf632,{'saveTo':_0x3041cf},function(_0x3ac816,_0x29029f){if(_0x3ac816)return _0x22e924(_0x3ac816);return _0x57885a(_0x29029f);});});}})[_0x1888('0x1e')](function(){if(_0x302b78){return new BPromise(function(_0x208045,_0xf6bb65){rimraf(_0x5bf632,function(_0x43ac4c){if(_0x43ac4c)_0xf6bb65(_0x43ac4c);return _0x208045();});});}})[_0x1888('0x1e')](function(){if(_0x302b78){return _0x2037a9['download'](_0x3041cf,_0x6e03ed,function(_0x33feeb){if(_0x33feeb){console[_0x1888('0xc9')](_0x1888('0xca'),_0x33feeb);}else{fs[_0x1888('0xcb')](_0x3041cf);}});}else{return _0x2037a9[_0x1888('0x29')](0xc8);}})[_0x1888('0x28')](handleError(_0x2037a9,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index f616712..6b48d81 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 _0x0ea5=['hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x2595a6,_0x48fc45){var _0x460197=function(_0x18f9db){while(--_0x18f9db){_0x2595a6['push'](_0x2595a6['shift']());}};_0x460197(++_0x48fc45);}(_0x0ea5,0x1d2));var _0x50ea=function(_0x104b37,_0xdcc7){_0x104b37=_0x104b37-0x0;var _0x1bf368=_0x0ea5[_0x104b37];return _0x1bf368;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x50ea('0x0'))['db']['ChatInteraction'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x50ea('0x1')](0x0);var events={'afterCreate':_0x50ea('0x2'),'afterUpdate':_0x50ea('0x3'),'afterDestroy':_0x50ea('0x4')};function emitEvent(_0x37cd2b){return function(_0x142cf1,_0x16aa6d,_0x4f5adb){ChatInteractionEvents[_0x50ea('0x5')](_0x37cd2b+':'+_0x142cf1['id'],_0x142cf1);ChatInteractionEvents[_0x50ea('0x5')](_0x37cd2b,_0x142cf1);_0x4f5adb(null);};}for(var e in events){if(events[_0x50ea('0x6')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x50ea('0x7')]=ChatInteractionEvents; \ No newline at end of file +var _0x3920=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners'];(function(_0x3ce0a4,_0x13d49b){var _0x4e8fdc=function(_0xf4b9ab){while(--_0xf4b9ab){_0x3ce0a4['push'](_0x3ce0a4['shift']());}};_0x4e8fdc(++_0x13d49b);}(_0x3920,0x1eb));var _0x0392=function(_0x2ae7c8,_0x168ef7){_0x2ae7c8=_0x2ae7c8-0x0;var _0x47d7cf=_0x3920[_0x2ae7c8];return _0x47d7cf;};'use strict';var EventEmitter=require(_0x0392('0x0'));var ChatInteraction=require(_0x0392('0x1'))['db'][_0x0392('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0392('0x3')](0x0);var events={'afterCreate':_0x0392('0x4'),'afterUpdate':_0x0392('0x5'),'afterDestroy':_0x0392('0x6')};function emitEvent(_0x50041f){return function(_0x5b7496,_0x26dda9,_0x275b20){ChatInteractionEvents[_0x0392('0x7')](_0x50041f+':'+_0x5b7496['id'],_0x5b7496);ChatInteractionEvents[_0x0392('0x7')](_0x50041f,_0x5b7496);_0x275b20(null);};}for(var e in events){if(events[_0x0392('0x8')](e)){var event=events[e];ChatInteraction[_0x0392('0x9')](e,emitEvent(event));}}module[_0x0392('0xa')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index e22fce1..81e7a6e 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 _0xa304=['request-promise','./chatInteraction.attributes','exports','define','chat_interactions','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x4b80eb,_0x392b29){var _0x42ec95=function(_0x36d2ea){while(--_0x36d2ea){_0x4b80eb['push'](_0x4b80eb['shift']());}};_0x42ec95(++_0x392b29);}(_0xa304,0xba));var _0x4a30=function(_0x17e771,_0x55fd17){_0x17e771=_0x17e771-0x0;var _0x1f3a6d=_0xa304[_0x17e771];return _0x1f3a6d;};'use strict';var _=require(_0x4a30('0x0'));var util=require(_0x4a30('0x1'));var logger=require('../../config/logger')(_0x4a30('0x2'));var moment=require(_0x4a30('0x3'));var BPromise=require('bluebird');var rp=require(_0x4a30('0x4'));var attributes=require(_0x4a30('0x5'));module[_0x4a30('0x6')]=function(_0x485015,_0x40a16e){return _0x485015[_0x4a30('0x7')]('ChatInteraction',attributes,{'tableName':_0x4a30('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4a30('0x9')});}; \ No newline at end of file +var _0xb265=['bluebird','request-promise','exports','define','chat_interactions','utf8mb4','util','../../config/logger','api'];(function(_0x44d382,_0x2e724b){var _0xa97b01=function(_0x502173){while(--_0x502173){_0x44d382['push'](_0x44d382['shift']());}};_0xa97b01(++_0x2e724b);}(_0xb265,0x165));var _0x5b26=function(_0x5ef9d2,_0x16db81){_0x5ef9d2=_0x5ef9d2-0x0;var _0x493486=_0xb265[_0x5ef9d2];return _0x493486;};'use strict';var _=require('lodash');var util=require(_0x5b26('0x0'));var logger=require(_0x5b26('0x1'))(_0x5b26('0x2'));var moment=require('moment');var BPromise=require(_0x5b26('0x3'));var rp=require(_0x5b26('0x4'));var attributes=require('./chatInteraction.attributes');module[_0x5b26('0x5')]=function(_0x3ef45a,_0x423210){return _0x3ef45a[_0x5b26('0x6')]('ChatInteraction',attributes,{'tableName':_0x5b26('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5b26('0x8'),'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 f718b0c..d26a0fb 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 _0x7e32=['body','options','raw','where','attributes','catch','AddTagsToChatInteraction','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','UpdateChatInteraction','ChatInteraction'];(function(_0x791e77,_0x1e6be1){var _0x4a58e3=function(_0x33bcd2){while(--_0x33bcd2){_0x791e77['push'](_0x791e77['shift']());}};_0x4a58e3(++_0x1e6be1);}(_0x7e32,0x88));var _0x27e3=function(_0x40d602,_0x42498){_0x40d602=_0x40d602-0x0;var _0x3d4d47=_0x7e32[_0x40d602];return _0x3d4d47;};'use strict';var _=require(_0x27e3('0x0'));var util=require(_0x27e3('0x1'));var moment=require(_0x27e3('0x2'));var BPromise=require(_0x27e3('0x3'));var rs=require(_0x27e3('0x4'));var fs=require('fs');var Redis=require(_0x27e3('0x5'));var db=require(_0x27e3('0x6'))['db'];var utils=require(_0x27e3('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x27e3('0x8'));var jayson=require(_0x27e3('0x9'));var client=jayson[_0x27e3('0xa')][_0x27e3('0xb')]({'port':0x232a});config[_0x27e3('0xc')]=_[_0x27e3('0xd')](config['redis'],{'host':_0x27e3('0xe'),'port':0x18eb});var socket=require(_0x27e3('0xf'))(new Redis(config['redis']));require(_0x27e3('0x10'))[_0x27e3('0x11')](socket);function respondWithRpcPromise(_0x1b072b,_0x2c4003,_0x2919e0){return new BPromise(function(_0x1ff352,_0x3ad15c){return client[_0x27e3('0x12')](_0x1b072b,_0x2919e0)[_0x27e3('0x13')](function(_0x17263b){logger[_0x27e3('0x14')](_0x27e3('0x15'),_0x2c4003,_0x27e3('0x16'));logger[_0x27e3('0x17')](_0x27e3('0x18'),_0x2c4003,_0x27e3('0x16'),JSON[_0x27e3('0x19')](_0x17263b));if(_0x17263b[_0x27e3('0x1a')]){if(_0x17263b[_0x27e3('0x1a')][_0x27e3('0x1b')]===0x1f4){logger[_0x27e3('0x1a')](_0x27e3('0x15'),_0x2c4003,_0x17263b[_0x27e3('0x1a')]['message']);return _0x3ad15c(_0x17263b[_0x27e3('0x1a')]['message']);}logger[_0x27e3('0x1a')](_0x27e3('0x15'),_0x2c4003,_0x17263b[_0x27e3('0x1a')]['message']);return _0x1ff352(_0x17263b['error']['message']);}else{logger[_0x27e3('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2c4003,_0x27e3('0x16'));_0x1ff352(_0x17263b[_0x27e3('0x1c')][_0x27e3('0x1d')]);}})['catch'](function(_0x4051a2){logger[_0x27e3('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x2c4003,_0x4051a2);_0x3ad15c(_0x4051a2);});});}exports[_0x27e3('0x1e')]=function(_0x260bab){var _0x412fc7=this;return new Promise(function(_0x54106a,_0x39f727){return db[_0x27e3('0x1f')]['update'](_0x260bab[_0x27e3('0x20')],{'raw':_0x260bab['options']?_0x260bab[_0x27e3('0x21')][_0x27e3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x260bab[_0x27e3('0x21')]?_0x260bab[_0x27e3('0x21')][_0x27e3('0x23')]||null:null,'attributes':_0x260bab[_0x27e3('0x21')]?_0x260bab['options'][_0x27e3('0x24')]||null:null,'limit':_0x260bab[_0x27e3('0x21')]?_0x260bab['options']['limit']||null:null})[_0x27e3('0x13')](function(_0x387f23){logger[_0x27e3('0x14')](_0x27e3('0x1e'),_0x260bab);logger[_0x27e3('0x17')](_0x27e3('0x1e'),_0x260bab,JSON[_0x27e3('0x19')](_0x387f23));_0x54106a(_0x387f23);})[_0x27e3('0x25')](function(_0x247885){logger[_0x27e3('0x1a')](_0x27e3('0x1e'),_0x247885[_0x27e3('0x1d')],_0x260bab);_0x39f727(_0x412fc7[_0x27e3('0x1a')](0x1f4,_0x247885['message']));});});};exports[_0x27e3('0x26')]=function(_0x34ddc6){return new Promise(function(_0x2f3528,_0x54ca64){return db['ChatInteraction']['find']({'where':_0x34ddc6[_0x27e3('0x21')]?_0x34ddc6[_0x27e3('0x21')]['where']||null:null})['then'](function(_0xa3fa21){if(_0xa3fa21){return _0xa3fa21['addTags'](_0x34ddc6[_0x27e3('0x20')][_0x27e3('0x27')],_[_0x27e3('0x28')](_0x34ddc6['body'],[_0x27e3('0x27'),'id'])||{});}})['spread'](function(_0x1a9432){logger[_0x27e3('0x14')]('AddTags',_0x34ddc6);logger[_0x27e3('0x17')](_0x27e3('0x29'),_0x34ddc6,JSON[_0x27e3('0x19')](_0x1a9432));_0x2f3528(_0x1a9432);})[_0x27e3('0x25')](function(_0x260218){logger[_0x27e3('0x1a')](_0x27e3('0x29'),_0x260218[_0x27e3('0x1d')],_0x34ddc6);_0x54ca64(_this['error'](0x1f4,_0x260218[_0x27e3('0x1d')]));});});}; \ No newline at end of file +var _0x23a8=['error','code','message','result','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','debug','catch','AddTagsToChatInteraction','find','body','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2aa927,_0x1b8901){var _0x4ac3b0=function(_0x5c8012){while(--_0x5c8012){_0x2aa927['push'](_0x2aa927['shift']());}};_0x4ac3b0(++_0x1b8901);}(_0x23a8,0x6a));var _0x823a=function(_0xad4c9a,_0x4e0e47){_0xad4c9a=_0xad4c9a-0x0;var _0x1bb983=_0x23a8[_0xad4c9a];return _0x1bb983;};'use strict';var _=require(_0x823a('0x0'));var util=require(_0x823a('0x1'));var moment=require(_0x823a('0x2'));var BPromise=require(_0x823a('0x3'));var rs=require(_0x823a('0x4'));var fs=require('fs');var Redis=require(_0x823a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x823a('0x6'));var logger=require(_0x823a('0x7'))(_0x823a('0x8'));var config=require('../../config/environment');var jayson=require(_0x823a('0x9'));var client=jayson[_0x823a('0xa')][_0x823a('0xb')]({'port':0x232a});config[_0x823a('0xc')]=_[_0x823a('0xd')](config[_0x823a('0xc')],{'host':_0x823a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x823a('0xc')]));require(_0x823a('0xf'))[_0x823a('0x10')](socket);function respondWithRpcPromise(_0x13d63c,_0x9cd4d,_0x301726){return new BPromise(function(_0xbf0b6c,_0x2ecc40){return client['request'](_0x13d63c,_0x301726)[_0x823a('0x11')](function(_0x503d5d){logger[_0x823a('0x12')](_0x823a('0x13'),_0x9cd4d,_0x823a('0x14'));logger['debug'](_0x823a('0x15'),_0x9cd4d,_0x823a('0x14'),JSON[_0x823a('0x16')](_0x503d5d));if(_0x503d5d[_0x823a('0x17')]){if(_0x503d5d[_0x823a('0x17')][_0x823a('0x18')]===0x1f4){logger[_0x823a('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x9cd4d,_0x503d5d[_0x823a('0x17')][_0x823a('0x19')]);return _0x2ecc40(_0x503d5d[_0x823a('0x17')]['message']);}logger[_0x823a('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x9cd4d,_0x503d5d['error'][_0x823a('0x19')]);return _0xbf0b6c(_0x503d5d[_0x823a('0x17')][_0x823a('0x19')]);}else{logger[_0x823a('0x12')](_0x823a('0x13'),_0x9cd4d,_0x823a('0x14'));_0xbf0b6c(_0x503d5d[_0x823a('0x1a')][_0x823a('0x19')]);}})['catch'](function(_0x7fcef3){logger[_0x823a('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x9cd4d,_0x7fcef3);_0x2ecc40(_0x7fcef3);});});}exports[_0x823a('0x1b')]=function(_0x2cd46c){var _0x3d6786=this;return new Promise(function(_0x2145e1,_0x22d4af){return db[_0x823a('0x1c')][_0x823a('0x1d')](_0x2cd46c['body'],{'raw':_0x2cd46c[_0x823a('0x1e')]?_0x2cd46c['options'][_0x823a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cd46c[_0x823a('0x1e')]?_0x2cd46c['options'][_0x823a('0x20')]||null:null,'attributes':_0x2cd46c['options']?_0x2cd46c[_0x823a('0x1e')][_0x823a('0x21')]||null:null,'limit':_0x2cd46c[_0x823a('0x1e')]?_0x2cd46c[_0x823a('0x1e')][_0x823a('0x22')]||null:null})[_0x823a('0x11')](function(_0x469b66){logger[_0x823a('0x12')](_0x823a('0x1b'),_0x2cd46c);logger[_0x823a('0x23')](_0x823a('0x1b'),_0x2cd46c,JSON['stringify'](_0x469b66));_0x2145e1(_0x469b66);})[_0x823a('0x24')](function(_0x43d932){logger[_0x823a('0x17')](_0x823a('0x1b'),_0x43d932[_0x823a('0x19')],_0x2cd46c);_0x22d4af(_0x3d6786[_0x823a('0x17')](0x1f4,_0x43d932[_0x823a('0x19')]));});});};exports[_0x823a('0x25')]=function(_0x42ba09){return new Promise(function(_0x35de12,_0x4db853){return db[_0x823a('0x1c')][_0x823a('0x26')]({'where':_0x42ba09[_0x823a('0x1e')]?_0x42ba09['options'][_0x823a('0x20')]||null:null})['then'](function(_0x148354){if(_0x148354){return _0x148354['addTags'](_0x42ba09[_0x823a('0x27')][_0x823a('0x28')],_[_0x823a('0x29')](_0x42ba09['body'],[_0x823a('0x28'),'id'])||{});}})['spread'](function(_0x4c7811){logger[_0x823a('0x12')]('AddTags',_0x42ba09);logger[_0x823a('0x23')](_0x823a('0x2a'),_0x42ba09,JSON[_0x823a('0x16')](_0x4c7811));_0x35de12(_0x4c7811);})[_0x823a('0x24')](function(_0x59d5f1){logger[_0x823a('0x17')](_0x823a('0x2a'),_0x59d5f1[_0x823a('0x19')],_0x42ba09);_0x4db853(_this[_0x823a('0x17')](0x1f4,_0x59d5f1[_0x823a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index fcb418f..64b0600 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 _0x9ac5=['removeListener','chatInteraction:','./chatInteraction.events','save','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ac5,0x17c));var _0x59ac=function(_0x39fe65,_0x37f209){_0x39fe65=_0x39fe65-0x0;var _0x32fdc3=_0x9ac5[_0x39fe65];return _0x32fdc3;};'use strict';var ChatInteractionEvents=require(_0x59ac('0x0'));var events=[_0x59ac('0x1'),_0x59ac('0x2'),_0x59ac('0x3')];function createListener(_0x4ada04,_0x299aa5){return function(_0x5918ac){_0x299aa5[_0x59ac('0x4')](_0x4ada04,_0x5918ac);};}function removeListener(_0x4d9c24,_0xdf0ef8){return function(){ChatInteractionEvents[_0x59ac('0x5')](_0x4d9c24,_0xdf0ef8);};}exports['register']=function(_0x2435c1){for(var _0x2b09b3=0x0,_0x565ec6=events['length'];_0x2b09b3<_0x565ec6;_0x2b09b3++){var _0x5d7c26=events[_0x2b09b3];var _0x424e9c=createListener(_0x59ac('0x6')+_0x5d7c26,_0x2435c1);ChatInteractionEvents['on'](_0x5d7c26,_0x424e9c);}}; \ No newline at end of file +var _0xdec5=['emit','removeListener','register','length','./chatInteraction.events','remove','update'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0xdec5,0xeb));var _0x5dec=function(_0x1bd28d,_0x30b6b5){_0x1bd28d=_0x1bd28d-0x0;var _0x1a5e11=_0xdec5[_0x1bd28d];return _0x1a5e11;};'use strict';var ChatInteractionEvents=require(_0x5dec('0x0'));var events=['save',_0x5dec('0x1'),_0x5dec('0x2')];function createListener(_0x4b664d,_0x12ffd7){return function(_0x21afc6){_0x12ffd7[_0x5dec('0x3')](_0x4b664d,_0x21afc6);};}function removeListener(_0x401693,_0x4d89a6){return function(){ChatInteractionEvents[_0x5dec('0x4')](_0x401693,_0x4d89a6);};}exports[_0x5dec('0x5')]=function(_0x277459){for(var _0x5c7092=0x0,_0x190d8c=events[_0x5dec('0x6')];_0x5c7092<_0x190d8c;_0x5c7092++){var _0x288ee7=events[_0x5c7092];var _0xd95738=createListener('chatInteraction:'+_0x288ee7,_0x277459);ChatInteractionEvents['on'](_0x288ee7,_0xd95738);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 0450184..8b52e05 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 _0x9c00=['join','root','format','%s-%s','now','replace','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','express','Router','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','diskStorage'];(function(_0x25d060,_0x418736){var _0x106892=function(_0x4aa250){while(--_0x4aa250){_0x25d060['push'](_0x25d060['shift']());}};_0x106892(++_0x418736);}(_0x9c00,0x1a0));var _0x09c0=function(_0x59166d,_0x415c2d){_0x59166d=_0x59166d-0x0;var _0x2184e1=_0x9c00[_0x59166d];return _0x2184e1;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x09c0('0x4'));var config=require(_0x09c0('0x5'));var controller=require(_0x09c0('0x6'));router[_0x09c0('0x7')]('/',auth[_0x09c0('0x8')](),controller['index']);router['get'](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xa')]);router[_0x09c0('0x7')](_0x09c0('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x09c0('0xc')]);router[_0x09c0('0x7')](_0x09c0('0xd'),auth[_0x09c0('0xe')](),controller[_0x09c0('0xf')]);router[_0x09c0('0x7')](_0x09c0('0x10'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x11')]);router[_0x09c0('0x7')](_0x09c0('0x12'),auth[_0x09c0('0xe')](),controller[_0x09c0('0x13')]);router[_0x09c0('0x7')](_0x09c0('0x14'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x15')]);router[_0x09c0('0x16')]('/',auth[_0x09c0('0x8')](),controller[_0x09c0('0x17')]);var upload=multer({'storage':multer[_0x09c0('0x18')]({'destination':function(_0x254598,_0x152140,_0x45a265){_0x45a265(null,path[_0x09c0('0x19')](config[_0x09c0('0x1a')],'server/files/attachments/'));},'filename':function(_0x590129,_0x558b4f,_0x42030d){_0x42030d(null,util[_0x09c0('0x1b')](_0x09c0('0x1c'),Date[_0x09c0('0x1d')](),_0x558b4f['originalname'][_0x09c0('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x09c0('0x1f')]('file'),controller[_0x09c0('0x20')]);router[_0x09c0('0x16')](_0x09c0('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x09c0('0x21')]);router[_0x09c0('0x16')](_0x09c0('0x22'),auth[_0x09c0('0x8')](),interaction[_0x09c0('0x23')](_0x09c0('0x24'),_0x09c0('0x25')),controller['addTags']);router[_0x09c0('0x26')](_0x09c0('0xb'),auth[_0x09c0('0x8')](),interaction[_0x09c0('0x23')]('chat','chatinteraction:update'),controller[_0x09c0('0x27')]);router[_0x09c0('0x26')](_0x09c0('0x28'),controller[_0x09c0('0x29')]);router['put'](_0x09c0('0x2a'),auth[_0x09c0('0xe')](),controller['abandon']);router[_0x09c0('0x26')](_0x09c0('0x2b'),controller[_0x09c0('0x2c')]);router[_0x09c0('0x2d')](_0x09c0('0xb'),auth[_0x09c0('0x8')](),interaction[_0x09c0('0x23')](_0x09c0('0x24'),_0x09c0('0x2e')),controller[_0x09c0('0x2f')]);router[_0x09c0('0x2d')]('/:id/tags',auth[_0x09c0('0x8')](),controller[_0x09c0('0x30')]);module['exports']=router; \ No newline at end of file +var _0x4b17=['/:id/attachment_upload','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','addTags','chatinteraction:update','update','put','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','exports','multer','path','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post'];(function(_0x449f49,_0x1ae5dd){var _0x3d6197=function(_0xf684e3){while(--_0xf684e3){_0x449f49['push'](_0x449f49['shift']());}};_0x3d6197(++_0x1ae5dd);}(_0x4b17,0x10f));var _0x74b1=function(_0x2ff739,_0x1c8e0f){_0x2ff739=_0x2ff739-0x0;var _0x12dc13=_0x4b17[_0x2ff739];return _0x12dc13;};'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('./chatInteraction.controller');router[_0x74b1('0x5')]('/',auth[_0x74b1('0x6')](),controller[_0x74b1('0x7')]);router[_0x74b1('0x5')](_0x74b1('0x8'),auth[_0x74b1('0x6')](),controller[_0x74b1('0x9')]);router['get'](_0x74b1('0xa'),auth[_0x74b1('0xb')](),controller[_0x74b1('0xc')]);router[_0x74b1('0x5')](_0x74b1('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x74b1('0xe')]);router[_0x74b1('0x5')]('/:id/messages',auth[_0x74b1('0x6')](),controller[_0x74b1('0xf')]);router[_0x74b1('0x5')](_0x74b1('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x74b1('0x11')]);router['get']('/:id/download',auth[_0x74b1('0x6')](),controller[_0x74b1('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);var upload=multer({'storage':multer[_0x74b1('0x13')]({'destination':function(_0x5c12eb,_0x4e289b,_0x2ccba6){_0x2ccba6(null,path[_0x74b1('0x14')](config[_0x74b1('0x15')],_0x74b1('0x16')));},'filename':function(_0x16b147,_0x10138e,_0x528e8c){_0x528e8c(null,util[_0x74b1('0x17')](_0x74b1('0x18'),Date[_0x74b1('0x19')](),_0x10138e[_0x74b1('0x1a')][_0x74b1('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x74b1('0x1c')](_0x74b1('0x1d'),upload['single'](_0x74b1('0x1e')),controller[_0x74b1('0x1f')]);router['post'](_0x74b1('0x20'),auth[_0x74b1('0xb')](),controller[_0x74b1('0x21')]);router[_0x74b1('0x1c')](_0x74b1('0x22'),auth[_0x74b1('0x6')](),interaction[_0x74b1('0x23')](_0x74b1('0x24'),'chatinteraction:addtags'),controller[_0x74b1('0x25')]);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x74b1('0x23')](_0x74b1('0x24'),_0x74b1('0x26')),controller[_0x74b1('0x27')]);router[_0x74b1('0x28')]('/:id/custom_update',controller[_0x74b1('0x29')]);router['put'](_0x74b1('0x2a'),auth[_0x74b1('0xb')](),controller[_0x74b1('0x2b')]);router[_0x74b1('0x28')](_0x74b1('0x2c'),controller[_0x74b1('0x2d')]);router[_0x74b1('0x2e')](_0x74b1('0xa'),auth['isAuthenticated'](),interaction[_0x74b1('0x23')](_0x74b1('0x24'),_0x74b1('0x2f')),controller['destroy']);router[_0x74b1('0x2e')](_0x74b1('0x22'),auth[_0x74b1('0x6')](),controller[_0x74b1('0x30')]);module[_0x74b1('0x31')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 45654a3..b8a90bc 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 _0x8af6=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x1d7bc0,_0x50a455){var _0x15a179=function(_0x378a42){while(--_0x378a42){_0x1d7bc0['push'](_0x1d7bc0['shift']());}};_0x15a179(++_0x50a455);}(_0x8af6,0x76));var _0x68af=function(_0x3943e0,_0x2b26c8){_0x3943e0=_0x3943e0-0x0;var _0x1f7ba2=_0x8af6[_0x3943e0];return _0x1f7ba2;};'use strict';var Sequelize=require(_0x68af('0x0'));module[_0x68af('0x1')]={'body':{'type':Sequelize[_0x68af('0x2')](_0x68af('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x68af('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x68af('0x5')]}}; \ No newline at end of file +var _0xe61c=['medium','BOOLEAN','sequelize','TEXT'];(function(_0x1c801b,_0x43d92d){var _0x23e3e9=function(_0x19b7e0){while(--_0x19b7e0){_0x1c801b['push'](_0x1c801b['shift']());}};_0x23e3e9(++_0x43d92d);}(_0xe61c,0xee));var _0xce61=function(_0x34c553,_0x3e7dfc){_0x34c553=_0x34c553-0x0;var _0x1357d2=_0xe61c[_0x34c553];return _0x1357d2;};'use strict';var Sequelize=require(_0xce61('0x0'));module['exports']={'body':{'type':Sequelize[_0xce61('0x1')](_0xce61('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xce61('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 773a0c4..7ec0123 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 _0x3098=['Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','ChatInternalMessage','rawAttributes','keys','query','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','isEmpty','push','FromId','read','-createdAt','all','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','ioredis','../../config/logger','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','count','offset','limit','set'];(function(_0x4c9211,_0x5c9537){var _0x23e1a1=function(_0x400b9a){while(--_0x400b9a){_0x4c9211['push'](_0x4c9211['shift']());}};_0x23e1a1(++_0x5c9537);}(_0x3098,0x117));var _0x8309=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0x3098[_0x368bba];return _0x409f8f;};'use strict';var pdf=require(_0x8309('0x0'));var emlformat=require(_0x8309('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8309('0x2'));var rp=require(_0x8309('0x3'));var moment=require(_0x8309('0x4'));var BPromise=require(_0x8309('0x5'));var Mustache=require(_0x8309('0x6'));var util=require(_0x8309('0x7'));var path=require(_0x8309('0x8'));var sox=require(_0x8309('0x9'));var csv=require('to-csv');var ejs=require(_0x8309('0xa'));var fs=require('fs');var _=require(_0x8309('0xb'));var squel=require(_0x8309('0xc'));var crypto=require(_0x8309('0xd'));var jsforce=require(_0x8309('0xe'));var deskjs=require(_0x8309('0xf'));var toCsv=require(_0x8309('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x8309('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x8309('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x8309('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8309('0x14'))['db'];config[_0x8309('0x15')]=_[_0x8309('0x16')](config[_0x8309('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x8309('0x17'))(new Redis(config[_0x8309('0x15')]));require(_0x8309('0x18'))[_0x8309('0x19')](socket);function respondWithStatusCode(_0x5f420b,_0x254495){_0x254495=_0x254495||0xcc;return function(_0x1b041e){if(_0x1b041e){return _0x5f420b['sendStatus'](_0x254495);}return _0x5f420b[_0x8309('0x1a')](_0x254495)[_0x8309('0x1b')]();};}function respondWithResult(_0x3b0087,_0x2f8cfe){_0x2f8cfe=_0x2f8cfe||0xc8;return function(_0x47230b){if(_0x47230b){return _0x3b0087[_0x8309('0x1a')](_0x2f8cfe)[_0x8309('0x1c')](_0x47230b);}};}function respondWithFilteredResult(_0xd9b45e,_0x25d920){return function(_0x5982e6){if(_0x5982e6){var _0x441ee3=_0x5982e6[_0x8309('0x1d')],_0x386f08=_0x25d920[_0x8309('0x1e')],_0xdd88f8=_0x25d920[_0x8309('0x1e')]+_0x25d920[_0x8309('0x1f')],_0x471c83;if(_0xdd88f8>=_0x441ee3){_0xdd88f8=_0x441ee3;_0x471c83=0xc8;}else{_0x471c83=0xce;}_0xd9b45e[_0x8309('0x1a')](_0x471c83);return _0xd9b45e[_0x8309('0x20')](_0x8309('0x21'),_0x386f08+'-'+_0xdd88f8+'/'+_0x441ee3)['json'](_0x5982e6);}return null;};}function patchUpdates(_0x590d34){return function(_0x254a54){try{jsonpatch['apply'](_0x254a54,_0x590d34,!![]);}catch(_0x3963b2){return BPromise[_0x8309('0x22')](_0x3963b2);}return _0x254a54[_0x8309('0x23')]();};}function saveUpdates(_0x37b3ac,_0xfa6fd){return function(_0x15c8d3){if(_0x15c8d3){return _0x15c8d3[_0x8309('0x24')](_0x37b3ac)[_0x8309('0x25')](function(_0xdab316){return _0xdab316;});}return null;};}function removeEntity(_0x39add6,_0x2fab61){return function(_0xd2e08){if(_0xd2e08){return _0xd2e08[_0x8309('0x26')]()[_0x8309('0x25')](function(){_0x39add6[_0x8309('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x122fd5,_0x9959cd){return function(_0x5078c2){if(!_0x5078c2){_0x122fd5[_0x8309('0x27')](0x194);}return _0x5078c2;};}function handleError(_0x3c74eb,_0x5eb72a){_0x5eb72a=_0x5eb72a||0x1f4;return function(_0x216db3){logger['error'](_0x216db3[_0x8309('0x28')]);if(_0x216db3[_0x8309('0x29')]){delete _0x216db3[_0x8309('0x29')];}_0x3c74eb[_0x8309('0x1a')](_0x5eb72a)['send'](_0x216db3);};}exports['index']=function(_0x39016a,_0xd891a8){var _0x53edc4={},_0xfe971={},_0x170c48={'count':0x0,'rows':[]};var _0x280f69=db[_0x8309('0x2a')][_0x8309('0x2b')];_0xfe971['model']=_['keys'](_0x280f69);_0xfe971['query']=_[_0x8309('0x2c')](_0x39016a[_0x8309('0x2d')]);_0xfe971[_0x8309('0x2e')]=_['intersection'](_0xfe971[_0x8309('0x2f')],_0xfe971[_0x8309('0x2d')]);_0x53edc4[_0x8309('0x30')]=_['intersection'](_0xfe971[_0x8309('0x2f')],qs[_0x8309('0x31')](_0x39016a[_0x8309('0x2d')][_0x8309('0x31')]));_0x53edc4['attributes']=_0x53edc4[_0x8309('0x30')][_0x8309('0x32')]?_0x53edc4[_0x8309('0x30')]:_0xfe971[_0x8309('0x2f')];if(!_0x39016a[_0x8309('0x2d')]['hasOwnProperty'](_0x8309('0x33'))){_0x53edc4[_0x8309('0x1f')]=qs['limit'](_0x39016a[_0x8309('0x2d')][_0x8309('0x1f')]);_0x53edc4[_0x8309('0x1e')]=qs[_0x8309('0x1e')](_0x39016a[_0x8309('0x2d')]['offset']);}_0x53edc4[_0x8309('0x34')]=qs['sort'](_0x39016a[_0x8309('0x2d')][_0x8309('0x35')]);_0x53edc4[_0x8309('0x36')]=qs[_0x8309('0x2e')](_[_0x8309('0x37')](_0x39016a[_0x8309('0x2d')],_0xfe971[_0x8309('0x2e')]));if(_0x39016a[_0x8309('0x2d')]['filter']){_0x53edc4[_0x8309('0x36')]=_[_0x8309('0x38')](_0x53edc4[_0x8309('0x36')],{'$or':_[_0x8309('0x39')](_0x280f69,function(_0x10ffae){if(_0x10ffae[_0x8309('0x3a')][_0x8309('0x3b')]!==_0x8309('0x3c')){var _0x38317a={};_0x38317a[_0x10ffae['field']]={'$like':'%'+_0x39016a['query'][_0x8309('0x3d')]+'%'};return _0x38317a;}})});}_0x53edc4=_[_0x8309('0x38')]({},_0x53edc4,_0x39016a['options']);var _0x4c8cfd={'where':_0x53edc4[_0x8309('0x36')]};return db[_0x8309('0x2a')][_0x8309('0x1d')](_0x4c8cfd)[_0x8309('0x25')](function(_0x45d141){_0x170c48[_0x8309('0x1d')]=_0x45d141;if(_0x39016a['query'][_0x8309('0x3e')]){_0x53edc4[_0x8309('0x3f')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x8309('0x40')](_0x53edc4);})[_0x8309('0x25')](function(_0x226edf){_0x170c48[_0x8309('0x41')]=_0x226edf;return _0x170c48;})[_0x8309('0x25')](respondWithFilteredResult(_0xd891a8,_0x53edc4))[_0x8309('0x42')](handleError(_0xd891a8,null));};exports[_0x8309('0x43')]=function(_0x4fdcce,_0x5ac921){var _0x44f6ad={'raw':!![],'where':{'id':_0x4fdcce[_0x8309('0x44')]['id']}},_0x20e9c6={};_0x20e9c6[_0x8309('0x2f')]=_[_0x8309('0x2c')](db[_0x8309('0x2a')][_0x8309('0x2b')]);_0x20e9c6[_0x8309('0x2d')]=_[_0x8309('0x2c')](_0x4fdcce[_0x8309('0x2d')]);_0x20e9c6[_0x8309('0x2e')]=_['intersection'](_0x20e9c6[_0x8309('0x2f')],_0x20e9c6['query']);_0x44f6ad[_0x8309('0x30')]=_[_0x8309('0x45')](_0x20e9c6['model'],qs[_0x8309('0x31')](_0x4fdcce[_0x8309('0x2d')]['fields']));_0x44f6ad[_0x8309('0x30')]=_0x44f6ad[_0x8309('0x30')][_0x8309('0x32')]?_0x44f6ad[_0x8309('0x30')]:_0x20e9c6['model'];if(_0x4fdcce['query'][_0x8309('0x3e')]){_0x44f6ad['include']=[{'all':!![]}];}_0x44f6ad=_[_0x8309('0x38')]({},_0x44f6ad,_0x4fdcce[_0x8309('0x46')]);return db['ChatInternalMessage'][_0x8309('0x47')](_0x44f6ad)[_0x8309('0x25')](handleEntityNotFound(_0x5ac921,null))[_0x8309('0x25')](respondWithResult(_0x5ac921,null))[_0x8309('0x42')](handleError(_0x5ac921,null));};exports[_0x8309('0x48')]=function(_0x140a0a,_0x33a62a){return db['ChatInternalMessage'][_0x8309('0x48')](_0x140a0a[_0x8309('0x49')],{})[_0x8309('0x25')](respondWithResult(_0x33a62a,0xc9))[_0x8309('0x42')](handleError(_0x33a62a,null));};exports['update']=function(_0x3e18ec,_0x4503b2){if(_0x3e18ec[_0x8309('0x49')]['id']){delete _0x3e18ec[_0x8309('0x49')]['id'];}return db[_0x8309('0x2a')][_0x8309('0x47')]({'where':{'id':_0x3e18ec['params']['id']}})['then'](handleEntityNotFound(_0x4503b2,null))[_0x8309('0x25')](saveUpdates(_0x3e18ec['body'],null))['then'](respondWithResult(_0x4503b2,null))[_0x8309('0x42')](handleError(_0x4503b2,null));};exports[_0x8309('0x26')]=function(_0x5eac0c,_0x4ca0ff){return db[_0x8309('0x2a')][_0x8309('0x47')]({'where':{'id':_0x5eac0c['params']['id']}})['then'](handleEntityNotFound(_0x4ca0ff,null))[_0x8309('0x25')](removeEntity(_0x4ca0ff,null))[_0x8309('0x42')](handleError(_0x4ca0ff,null));};exports[_0x8309('0x4a')]=function(_0x444a01,_0x2b0ad5){return db['ChatInternalMessage'][_0x8309('0x4a')]()[_0x8309('0x25')](respondWithResult(_0x2b0ad5,null))[_0x8309('0x42')](handleError(_0x2b0ad5,null));};function wrapUser(_0x3ae3ed){return function(_0x5733d0){var _0x31df44=_0x3ae3ed[_0x8309('0x4b')]({'plain':!![]});_0x31df44[_0x8309('0x4c')]=[];if(_0x5733d0){_0x31df44[_0x8309('0x4d')]=_0x5733d0[_0x8309('0x4e')];_0x31df44[_0x8309('0x4f')]=_0x5733d0;}else{_0x31df44[_0x8309('0x4d')]=moment(0x0)[_0x8309('0x50')](_0x8309('0x51'));_0x31df44[_0x8309('0x4f')]={};}return _0x31df44;};}exports['getUsers']=function(_0x455db0,_0x2d944e,_0x30c30c){var _0x47523d=[];return db[_0x8309('0x52')][_0x8309('0x40')]({'where':{'role':[_0x8309('0x53'),_0x8309('0x54'),_0x8309('0x55')]},'attributes':['id',_0x8309('0x56'),'name',_0x8309('0x57'),_0x8309('0x58'),_0x8309('0x59'),_0x8309('0x5a'),_0x8309('0x5b'),_0x8309('0x5c'),_0x8309('0x5d')],'order':qs[_0x8309('0x35')]('-online'),'include':[{'model':db[_0x8309('0x5e')],'as':'VoiceQueues','attributes':['id',_0x8309('0x29'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x30a5d0){if(_0x30a5d0){var _0x528afe=_0x455db0['user']['get']({'plain':!![]});if(!_0x528afe)throw new Error(_0x8309('0x5f'));if(_0x528afe[_0x8309('0x57')]===_0x8309('0x55')){return db['UserProfileSection'][_0x8309('0x47')]({'where':{'name':'Agents','userProfileId':_0x528afe[_0x8309('0x60')]},'raw':!![]})[_0x8309('0x25')](function(_0xe80e3b){if(_0xe80e3b){if(_0xe80e3b[_0x8309('0x61')]===0x0){return db['UserProfileResource'][_0x8309('0x40')]({'where':{'sectionId':_0xe80e3b['id']},'raw':!![]})[_0x8309('0x25')](function(_0x1dce59){var _0x32d593=[];if(_[_0x8309('0x62')](_0x1dce59)){_0x32d593=_[_0x8309('0x3d')](_0x30a5d0,function(_0x46abe4){if(_0x46abe4['role']!==_0x8309('0x53')){return _0x46abe4;}});return _0x32d593;}else{for(var _0x15d354=0x0;_0x15d354<_0x30a5d0[_0x8309('0x32')];_0x15d354++){var _0x5d06e5=_0x30a5d0[_0x15d354];if(_0x5d06e5[_0x8309('0x57')]===_0x8309('0x53')){var _0x3e83f2=_['find'](_0x1dce59,function(_0xf6a0d5){return _0xf6a0d5['resourceId']===_0x5d06e5['id'];});if(_0x3e83f2)_0x32d593[_0x8309('0x63')](_0x5d06e5);}else{_0x32d593[_0x8309('0x63')](_0x5d06e5);}}return _0x32d593;}});}else{return _0x30a5d0;}}else{var _0x2c77a0=_[_0x8309('0x3d')](_0x30a5d0,function(_0x5ccef5){if(_0x5ccef5[_0x8309('0x57')]!=='agent'){return _0x5ccef5;}});return _0x2c77a0;}});}else{return _0x30a5d0;}}})[_0x8309('0x25')](function(_0x36564){var _0x1f85cd=[];if(_0x36564){_0x47523d=_0x36564;for(var _0x81b74e=0x0;_0x81b74e<_0x36564[_0x8309('0x32')];_0x81b74e+=0x1){_0x47523d[_0x81b74e][_0x8309('0x4c')]=[];_0x1f85cd[_0x8309('0x63')](db[_0x8309('0x2a')][_0x8309('0x47')]({'where':{'FromId':[_0x455db0[_0x8309('0x55')]['id'],_0x36564[_0x81b74e]['id']],'ToId':[_0x455db0[_0x8309('0x55')]['id'],_0x36564[_0x81b74e]['id']],'ChatGroupId':null},'attributes':['id',_0x8309('0x4e'),_0x8309('0x64'),'ToId',_0x8309('0x65'),_0x8309('0x49')],'order':qs[_0x8309('0x35')](_0x8309('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x36564[_0x81b74e])));}return BPromise[_0x8309('0x67')](_0x1f85cd);}return[];})[_0x8309('0x25')](function(_0x2943f1){return{'rows':_0x2943f1,'count':_0x2943f1['length']};})[_0x8309('0x25')](respondWithResult(_0x2d944e,null))[_0x8309('0x42')](handleError(_0x2d944e,null));}; \ No newline at end of file +var _0x9515=['includeAll','include','rows','catch','params','intersection','length','find','create','body','update','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','admin','user','fullname','role','userpic','online','allowmessenger','VoiceQueue','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','UserProfileResource','findAll','isEmpty','agent','resourceId','push','ToId','-createdAt','html-pdf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','name','index','ChatInternalMessage','rawAttributes','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','VIRTUAL','field','merge','options','then'];(function(_0x41ce2e,_0x3555ef){var _0x54d438=function(_0x141539){while(--_0x141539){_0x41ce2e['push'](_0x41ce2e['shift']());}};_0x54d438(++_0x3555ef);}(_0x9515,0xe7));var _0x5951=function(_0x2e3233,_0x1c5347){_0x2e3233=_0x2e3233-0x0;var _0x220a5a=_0x9515[_0x2e3233];return _0x220a5a;};'use strict';var pdf=require(_0x5951('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5951('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5951('0x2'));var BPromise=require(_0x5951('0x3'));var Mustache=require(_0x5951('0x4'));var util=require(_0x5951('0x5'));var path=require('path');var sox=require(_0x5951('0x6'));var csv=require(_0x5951('0x7'));var ejs=require(_0x5951('0x8'));var fs=require('fs');var _=require(_0x5951('0x9'));var squel=require(_0x5951('0xa'));var crypto=require(_0x5951('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5951('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x5951('0xd'));var hardwareService=require(_0x5951('0xe'));var Redis=require(_0x5951('0xf'));var qs=require(_0x5951('0x10'));var logger=require('../../config/logger')(_0x5951('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5951('0x12'))['db'];config[_0x5951('0x13')]=_[_0x5951('0x14')](config[_0x5951('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x5951('0x15'))(new Redis(config[_0x5951('0x13')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x2bf379,_0x2df603){_0x2df603=_0x2df603||0xcc;return function(_0x431474){if(_0x431474){return _0x2bf379[_0x5951('0x16')](_0x2df603);}return _0x2bf379[_0x5951('0x17')](_0x2df603)['end']();};}function respondWithResult(_0x16e6cb,_0x210fea){_0x210fea=_0x210fea||0xc8;return function(_0x1207ec){if(_0x1207ec){return _0x16e6cb['status'](_0x210fea)[_0x5951('0x18')](_0x1207ec);}};}function respondWithFilteredResult(_0x35b8b3,_0x23994d){return function(_0x16b76b){if(_0x16b76b){var _0x371fd6=_0x16b76b[_0x5951('0x19')],_0x528c1e=_0x23994d[_0x5951('0x1a')],_0x1c06e1=_0x23994d['offset']+_0x23994d[_0x5951('0x1b')],_0x11c93a;if(_0x1c06e1>=_0x371fd6){_0x1c06e1=_0x371fd6;_0x11c93a=0xc8;}else{_0x11c93a=0xce;}_0x35b8b3[_0x5951('0x17')](_0x11c93a);return _0x35b8b3[_0x5951('0x1c')](_0x5951('0x1d'),_0x528c1e+'-'+_0x1c06e1+'/'+_0x371fd6)['json'](_0x16b76b);}return null;};}function patchUpdates(_0x50d099){return function(_0xf30fe0){try{jsonpatch[_0x5951('0x1e')](_0xf30fe0,_0x50d099,!![]);}catch(_0x284d8a){return BPromise[_0x5951('0x1f')](_0x284d8a);}return _0xf30fe0[_0x5951('0x20')]();};}function saveUpdates(_0x1e8c50,_0x18347d){return function(_0x54fe0e){if(_0x54fe0e){return _0x54fe0e['update'](_0x1e8c50)['then'](function(_0x55e57b){return _0x55e57b;});}return null;};}function removeEntity(_0x4ad96a,_0x5e72f6){return function(_0x1e9f91){if(_0x1e9f91){return _0x1e9f91[_0x5951('0x21')]()['then'](function(){_0x4ad96a[_0x5951('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb81bb8,_0x2bf24e){return function(_0x35d36a){if(!_0x35d36a){_0xb81bb8[_0x5951('0x16')](0x194);}return _0x35d36a;};}function handleError(_0x200682,_0xcf822d){_0xcf822d=_0xcf822d||0x1f4;return function(_0x221bb4){logger['error'](_0x221bb4['stack']);if(_0x221bb4[_0x5951('0x22')]){delete _0x221bb4[_0x5951('0x22')];}_0x200682['status'](_0xcf822d)['send'](_0x221bb4);};}exports[_0x5951('0x23')]=function(_0x3688d7,_0x547cb3){var _0x509d44={},_0xce8388={},_0x21901e={'count':0x0,'rows':[]};var _0x216f61=db[_0x5951('0x24')][_0x5951('0x25')];_0xce8388[_0x5951('0x26')]=_[_0x5951('0x27')](_0x216f61);_0xce8388[_0x5951('0x28')]=_['keys'](_0x3688d7['query']);_0xce8388[_0x5951('0x29')]=_['intersection'](_0xce8388[_0x5951('0x26')],_0xce8388['query']);_0x509d44[_0x5951('0x2a')]=_['intersection'](_0xce8388['model'],qs[_0x5951('0x2b')](_0x3688d7[_0x5951('0x28')][_0x5951('0x2b')]));_0x509d44['attributes']=_0x509d44[_0x5951('0x2a')]['length']?_0x509d44[_0x5951('0x2a')]:_0xce8388['model'];if(!_0x3688d7['query'][_0x5951('0x2c')](_0x5951('0x2d'))){_0x509d44[_0x5951('0x1b')]=qs[_0x5951('0x1b')](_0x3688d7[_0x5951('0x28')][_0x5951('0x1b')]);_0x509d44[_0x5951('0x1a')]=qs[_0x5951('0x1a')](_0x3688d7[_0x5951('0x28')]['offset']);}_0x509d44['order']=qs[_0x5951('0x2e')](_0x3688d7['query'][_0x5951('0x2e')]);_0x509d44[_0x5951('0x2f')]=qs[_0x5951('0x29')](_[_0x5951('0x30')](_0x3688d7[_0x5951('0x28')],_0xce8388[_0x5951('0x29')]));if(_0x3688d7['query'][_0x5951('0x31')]){_0x509d44[_0x5951('0x2f')]=_['merge'](_0x509d44[_0x5951('0x2f')],{'$or':_[_0x5951('0x32')](_0x216f61,function(_0x415641){if(_0x415641[_0x5951('0x33')]['key']!==_0x5951('0x34')){var _0x519717={};_0x519717[_0x415641[_0x5951('0x35')]]={'$like':'%'+_0x3688d7[_0x5951('0x28')][_0x5951('0x31')]+'%'};return _0x519717;}})});}_0x509d44=_[_0x5951('0x36')]({},_0x509d44,_0x3688d7[_0x5951('0x37')]);var _0x3053fa={'where':_0x509d44[_0x5951('0x2f')]};return db[_0x5951('0x24')]['count'](_0x3053fa)[_0x5951('0x38')](function(_0x775eaa){_0x21901e[_0x5951('0x19')]=_0x775eaa;if(_0x3688d7[_0x5951('0x28')][_0x5951('0x39')]){_0x509d44[_0x5951('0x3a')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x509d44);})[_0x5951('0x38')](function(_0x22c36a){_0x21901e[_0x5951('0x3b')]=_0x22c36a;return _0x21901e;})[_0x5951('0x38')](respondWithFilteredResult(_0x547cb3,_0x509d44))[_0x5951('0x3c')](handleError(_0x547cb3,null));};exports['show']=function(_0x4e674d,_0x4ae37b){var _0x5bd7fe={'raw':!![],'where':{'id':_0x4e674d[_0x5951('0x3d')]['id']}},_0x2a5c54={};_0x2a5c54[_0x5951('0x26')]=_[_0x5951('0x27')](db[_0x5951('0x24')][_0x5951('0x25')]);_0x2a5c54['query']=_[_0x5951('0x27')](_0x4e674d[_0x5951('0x28')]);_0x2a5c54[_0x5951('0x29')]=_[_0x5951('0x3e')](_0x2a5c54['model'],_0x2a5c54[_0x5951('0x28')]);_0x5bd7fe[_0x5951('0x2a')]=_['intersection'](_0x2a5c54['model'],qs[_0x5951('0x2b')](_0x4e674d[_0x5951('0x28')][_0x5951('0x2b')]));_0x5bd7fe[_0x5951('0x2a')]=_0x5bd7fe[_0x5951('0x2a')][_0x5951('0x3f')]?_0x5bd7fe['attributes']:_0x2a5c54['model'];if(_0x4e674d[_0x5951('0x28')][_0x5951('0x39')]){_0x5bd7fe[_0x5951('0x3a')]=[{'all':!![]}];}_0x5bd7fe=_[_0x5951('0x36')]({},_0x5bd7fe,_0x4e674d[_0x5951('0x37')]);return db[_0x5951('0x24')][_0x5951('0x40')](_0x5bd7fe)[_0x5951('0x38')](handleEntityNotFound(_0x4ae37b,null))[_0x5951('0x38')](respondWithResult(_0x4ae37b,null))['catch'](handleError(_0x4ae37b,null));};exports[_0x5951('0x41')]=function(_0x1700f8,_0x878223){return db['ChatInternalMessage']['create'](_0x1700f8[_0x5951('0x42')],{})[_0x5951('0x38')](respondWithResult(_0x878223,0xc9))[_0x5951('0x3c')](handleError(_0x878223,null));};exports[_0x5951('0x43')]=function(_0x4b6181,_0x1bd916){if(_0x4b6181[_0x5951('0x42')]['id']){delete _0x4b6181[_0x5951('0x42')]['id'];}return db[_0x5951('0x24')]['find']({'where':{'id':_0x4b6181[_0x5951('0x3d')]['id']}})[_0x5951('0x38')](handleEntityNotFound(_0x1bd916,null))[_0x5951('0x38')](saveUpdates(_0x4b6181[_0x5951('0x42')],null))[_0x5951('0x38')](respondWithResult(_0x1bd916,null))[_0x5951('0x3c')](handleError(_0x1bd916,null));};exports[_0x5951('0x21')]=function(_0x216e59,_0x523b57){return db[_0x5951('0x24')]['find']({'where':{'id':_0x216e59['params']['id']}})['then'](handleEntityNotFound(_0x523b57,null))[_0x5951('0x38')](removeEntity(_0x523b57,null))[_0x5951('0x3c')](handleError(_0x523b57,null));};exports['describe']=function(_0x359a09,_0x17b641){return db[_0x5951('0x24')][_0x5951('0x44')]()['then'](respondWithResult(_0x17b641,null))[_0x5951('0x3c')](handleError(_0x17b641,null));};function wrapUser(_0x39f8c0){return function(_0x2a1e16){var _0xd6769=_0x39f8c0['get']({'plain':!![]});_0xd6769[_0x5951('0x45')]=[];if(_0x2a1e16){_0xd6769[_0x5951('0x46')]=_0x2a1e16[_0x5951('0x47')];_0xd6769[_0x5951('0x48')]=_0x2a1e16;}else{_0xd6769[_0x5951('0x46')]=moment(0x0)[_0x5951('0x49')](_0x5951('0x4a'));_0xd6769[_0x5951('0x48')]={};}return _0xd6769;};}exports[_0x5951('0x4b')]=function(_0x14831d,_0x488644,_0x12c00c){var _0x32875a=[];return db['User']['findAll']({'where':{'role':['agent',_0x5951('0x4c'),_0x5951('0x4d')]},'attributes':['id',_0x5951('0x4e'),_0x5951('0x22'),_0x5951('0x4f'),_0x5951('0x50'),'internal',_0x5951('0x51'),'lastLoginAt',_0x5951('0x52'),'showWebBar'],'order':qs['sort']('-online'),'include':[{'model':db[_0x5951('0x53')],'as':'VoiceQueues','attributes':['id',_0x5951('0x22'),_0x5951('0x33')],'through':{'attributes':[]}}]})[_0x5951('0x38')](function(_0x1274f9){if(_0x1274f9){var _0x4c6887=_0x14831d[_0x5951('0x4d')][_0x5951('0x54')]({'plain':!![]});if(!_0x4c6887)throw new Error(_0x5951('0x55'));if(_0x4c6887[_0x5951('0x4f')]===_0x5951('0x4d')){return db['UserProfileSection'][_0x5951('0x40')]({'where':{'name':_0x5951('0x56'),'userProfileId':_0x4c6887[_0x5951('0x57')]},'raw':!![]})[_0x5951('0x38')](function(_0xb2ff39){if(_0xb2ff39){if(_0xb2ff39['autoAssociation']===0x0){return db[_0x5951('0x58')][_0x5951('0x59')]({'where':{'sectionId':_0xb2ff39['id']},'raw':!![]})[_0x5951('0x38')](function(_0x396910){var _0xd46be6=[];if(_[_0x5951('0x5a')](_0x396910)){_0xd46be6=_[_0x5951('0x31')](_0x1274f9,function(_0xe7aa21){if(_0xe7aa21[_0x5951('0x4f')]!==_0x5951('0x5b')){return _0xe7aa21;}});return _0xd46be6;}else{for(var _0x318227=0x0;_0x318227<_0x1274f9[_0x5951('0x3f')];_0x318227++){var _0x449bd0=_0x1274f9[_0x318227];if(_0x449bd0[_0x5951('0x4f')]===_0x5951('0x5b')){var _0xdbf9e=_[_0x5951('0x40')](_0x396910,function(_0x30a65e){return _0x30a65e[_0x5951('0x5c')]===_0x449bd0['id'];});if(_0xdbf9e)_0xd46be6['push'](_0x449bd0);}else{_0xd46be6['push'](_0x449bd0);}}return _0xd46be6;}});}else{return _0x1274f9;}}else{var _0x4148d9=_[_0x5951('0x31')](_0x1274f9,function(_0x28c942){if(_0x28c942['role']!==_0x5951('0x5b')){return _0x28c942;}});return _0x4148d9;}});}else{return _0x1274f9;}}})[_0x5951('0x38')](function(_0x4d5fc3){var _0x3d9c01=[];if(_0x4d5fc3){_0x32875a=_0x4d5fc3;for(var _0x4f8065=0x0;_0x4f8065<_0x4d5fc3[_0x5951('0x3f')];_0x4f8065+=0x1){_0x32875a[_0x4f8065][_0x5951('0x45')]=[];_0x3d9c01[_0x5951('0x5d')](db[_0x5951('0x24')]['find']({'where':{'FromId':[_0x14831d[_0x5951('0x4d')]['id'],_0x4d5fc3[_0x4f8065]['id']],'ToId':[_0x14831d[_0x5951('0x4d')]['id'],_0x4d5fc3[_0x4f8065]['id']],'ChatGroupId':null},'attributes':['id',_0x5951('0x47'),'FromId',_0x5951('0x5e'),'read','body'],'order':qs[_0x5951('0x2e')](_0x5951('0x5f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5951('0x38')](wrapUser(_0x4d5fc3[_0x4f8065])));}return BPromise['all'](_0x3d9c01);}return[];})[_0x5951('0x38')](function(_0xf0b763){return{'rows':_0xf0b763,'count':_0xf0b763[_0x5951('0x3f')]};})[_0x5951('0x38')](respondWithResult(_0x488644,null))[_0x5951('0x3c')](handleError(_0x488644,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index f319e81..8f97ea2 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 _0xe772=['ChatInternalMessage','setMaxListeners','save','update','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x436989,_0x50b5d7){var _0x3cbba2=function(_0x48bb36){while(--_0x48bb36){_0x436989['push'](_0x436989['shift']());}};_0x3cbba2(++_0x50b5d7);}(_0xe772,0x6e));var _0x2e77=function(_0x1551af,_0x5223c3){_0x1551af=_0x1551af-0x0;var _0xd8eb82=_0xe772[_0x1551af];return _0xd8eb82;};'use strict';var EventEmitter=require(_0x2e77('0x0'));var ChatInternalMessage=require(_0x2e77('0x1'))['db'][_0x2e77('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2e77('0x3')](0x0);var events={'afterCreate':_0x2e77('0x4'),'afterUpdate':_0x2e77('0x5'),'afterDestroy':'remove'};function emitEvent(_0x23e609){return function(_0x4edd05,_0x580a9c,_0xec8849){ChatInternalMessageEvents['emit'](_0x23e609+':'+_0x4edd05['id'],_0x4edd05);ChatInternalMessageEvents['emit'](_0x23e609,_0x4edd05);_0xec8849(null);};}for(var e in events){if(events[_0x2e77('0x6')](e)){var event=events[e];ChatInternalMessage[_0x2e77('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x9740=['remove','hasOwnProperty','events','../../mysqldb','setMaxListeners','update'];(function(_0x585429,_0x2c0b38){var _0x3399c4=function(_0x489ffa){while(--_0x489ffa){_0x585429['push'](_0x585429['shift']());}};_0x3399c4(++_0x2c0b38);}(_0x9740,0xc2));var _0x0974=function(_0x41a270,_0x57574d){_0x41a270=_0x41a270-0x0;var _0x3975aa=_0x9740[_0x41a270];return _0x3975aa;};'use strict';var EventEmitter=require(_0x0974('0x0'));var ChatInternalMessage=require(_0x0974('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0974('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0974('0x3'),'afterDestroy':_0x0974('0x4')};function emitEvent(_0x46b8e9){return function(_0x115d82,_0x538465,_0x337dae){ChatInternalMessageEvents['emit'](_0x46b8e9+':'+_0x115d82['id'],_0x115d82);ChatInternalMessageEvents['emit'](_0x46b8e9,_0x115d82);_0x337dae(null);};}for(var e in events){if(events[_0x0974('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 8e04dbb..affe49b 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 _0x3879=['bluebird','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x3786e6,_0x571868){var _0x23005b=function(_0x145a45){while(--_0x145a45){_0x3786e6['push'](_0x3786e6['shift']());}};_0x23005b(++_0x571868);}(_0x3879,0x1aa));var _0x9387=function(_0x3342cd,_0x17242d){_0x3342cd=_0x3342cd-0x0;var _0xedf311=_0x3879[_0x3342cd];return _0xedf311;};'use strict';var _=require(_0x9387('0x0'));var util=require(_0x9387('0x1'));var logger=require(_0x9387('0x2'))(_0x9387('0x3'));var moment=require('moment');var BPromise=require(_0x9387('0x4'));var rp=require('request-promise');var attributes=require('./chatInternalMessage.attributes');module[_0x9387('0x5')]=function(_0x5ec350,_0x134ddd){return _0x5ec350[_0x9387('0x6')]('ChatInternalMessage',attributes,{'tableName':_0x9387('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9387('0x8'),'collate':_0x9387('0x9')});}; \ No newline at end of file +var _0xd0ca=['request-promise','./chatInternalMessage.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird'];(function(_0x5b5424,_0xb34e70){var _0x1278e5=function(_0x10f0cc){while(--_0x10f0cc){_0x5b5424['push'](_0x5b5424['shift']());}};_0x1278e5(++_0xb34e70);}(_0xd0ca,0xf8));var _0xad0c=function(_0x32fb40,_0x459813){_0x32fb40=_0x32fb40-0x0;var _0x52cef8=_0xd0ca[_0x32fb40];return _0x52cef8;};'use strict';var _=require(_0xad0c('0x0'));var util=require('util');var logger=require(_0xad0c('0x1'))(_0xad0c('0x2'));var moment=require('moment');var BPromise=require(_0xad0c('0x3'));var rp=require(_0xad0c('0x4'));var attributes=require(_0xad0c('0x5'));module[_0xad0c('0x6')]=function(_0x9f7e6b,_0xb22622){return _0x9f7e6b['define']('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xad0c('0x7'),'collate':_0xad0c('0x8')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 773d46c..477d8c5 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 _0xb3d7=['then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatInternalMessage.socket','register'];(function(_0x4cc105,_0x56cb91){var _0x339304=function(_0x3a0e89){while(--_0x3a0e89){_0x4cc105['push'](_0x4cc105['shift']());}};_0x339304(++_0x56cb91);}(_0xb3d7,0x18f));var _0x7b3d=function(_0x75b635,_0x30f371){_0x75b635=_0x75b635-0x0;var _0x1c4a70=_0xb3d7[_0x75b635];return _0x1c4a70;};'use strict';var _=require(_0x7b3d('0x0'));var util=require(_0x7b3d('0x1'));var moment=require(_0x7b3d('0x2'));var BPromise=require(_0x7b3d('0x3'));var rs=require(_0x7b3d('0x4'));var fs=require('fs');var Redis=require(_0x7b3d('0x5'));var db=require(_0x7b3d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b3d('0x7'))(_0x7b3d('0x8'));var config=require(_0x7b3d('0x9'));var jayson=require(_0x7b3d('0xa'));var client=jayson['client'][_0x7b3d('0xb')]({'port':0x232a});config[_0x7b3d('0xc')]=_[_0x7b3d('0xd')](config[_0x7b3d('0xc')],{'host':_0x7b3d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7b3d('0xf'))[_0x7b3d('0x10')](socket);function respondWithRpcPromise(_0x1df523,_0x5e0464,_0x3aed1c){return new BPromise(function(_0x3f372d,_0xfc89d3){return client['request'](_0x1df523,_0x3aed1c)[_0x7b3d('0x11')](function(_0x45a436){logger[_0x7b3d('0x12')](_0x7b3d('0x13'),_0x5e0464,_0x7b3d('0x14'));logger[_0x7b3d('0x15')](_0x7b3d('0x16'),_0x5e0464,_0x7b3d('0x14'),JSON['stringify'](_0x45a436));if(_0x45a436[_0x7b3d('0x17')]){if(_0x45a436[_0x7b3d('0x17')]['code']===0x1f4){logger['error'](_0x7b3d('0x13'),_0x5e0464,_0x45a436['error']['message']);return _0xfc89d3(_0x45a436['error'][_0x7b3d('0x18')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x5e0464,_0x45a436[_0x7b3d('0x17')][_0x7b3d('0x18')]);return _0x3f372d(_0x45a436[_0x7b3d('0x17')][_0x7b3d('0x18')]);}else{logger[_0x7b3d('0x12')](_0x7b3d('0x13'),_0x5e0464,_0x7b3d('0x14'));_0x3f372d(_0x45a436['result']['message']);}})[_0x7b3d('0x19')](function(_0x27d1b4){logger['error'](_0x7b3d('0x13'),_0x5e0464,_0x27d1b4);_0xfc89d3(_0x27d1b4);});});} \ No newline at end of file +var _0xb733=['register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb733,0xab));var _0x3b73=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb733[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x3b73('0x0'));var util=require('util');var moment=require(_0x3b73('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b73('0x2'));var db=require(_0x3b73('0x3'))['db'];var utils=require(_0x3b73('0x4'));var logger=require(_0x3b73('0x5'))(_0x3b73('0x6'));var config=require(_0x3b73('0x7'));var jayson=require(_0x3b73('0x8'));var client=jayson['client'][_0x3b73('0x9')]({'port':0x232a});config[_0x3b73('0xa')]=_[_0x3b73('0xb')](config[_0x3b73('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b73('0xc'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x3b73('0xd')](socket);function respondWithRpcPromise(_0x6b9fda,_0x27114b,_0x3921b6){return new BPromise(function(_0x8c7960,_0x4c29a4){return client[_0x3b73('0xe')](_0x6b9fda,_0x3921b6)[_0x3b73('0xf')](function(_0x3a664f){logger[_0x3b73('0x10')](_0x3b73('0x11'),_0x27114b,_0x3b73('0x12'));logger[_0x3b73('0x13')](_0x3b73('0x14'),_0x27114b,_0x3b73('0x12'),JSON['stringify'](_0x3a664f));if(_0x3a664f[_0x3b73('0x15')]){if(_0x3a664f[_0x3b73('0x15')]['code']===0x1f4){logger[_0x3b73('0x15')](_0x3b73('0x11'),_0x27114b,_0x3a664f[_0x3b73('0x15')][_0x3b73('0x16')]);return _0x4c29a4(_0x3a664f[_0x3b73('0x15')][_0x3b73('0x16')]);}logger['error'](_0x3b73('0x11'),_0x27114b,_0x3a664f[_0x3b73('0x15')][_0x3b73('0x16')]);return _0x8c7960(_0x3a664f[_0x3b73('0x15')][_0x3b73('0x16')]);}else{logger[_0x3b73('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x27114b,_0x3b73('0x12'));_0x8c7960(_0x3a664f['result']['message']);}})['catch'](function(_0x3b0d3c){logger[_0x3b73('0x15')](_0x3b73('0x11'),_0x27114b,_0x3b0d3c);_0x4c29a4(_0x3b0d3c);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 487d175..749ac75 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 _0xfdcc=['length','chatInternalMessage:','remove','emit','removeListener'];(function(_0x4449c3,_0x2330aa){var _0x22128b=function(_0x547890){while(--_0x547890){_0x4449c3['push'](_0x4449c3['shift']());}};_0x22128b(++_0x2330aa);}(_0xfdcc,0xed));var _0xcfdc=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0xfdcc[_0x448f8];return _0xa73126;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0xcfdc('0x0'),'update'];function createListener(_0x9b15d3,_0x307cd3){return function(_0x30df24){_0x307cd3[_0xcfdc('0x1')](_0x9b15d3,_0x30df24);};}function removeListener(_0x3e4bd9,_0x1a5a44){return function(){ChatInternalMessageEvents[_0xcfdc('0x2')](_0x3e4bd9,_0x1a5a44);};}exports['register']=function(_0x456148){for(var _0x3eaac3=0x0,_0x35cd2b=events[_0xcfdc('0x3')];_0x3eaac3<_0x35cd2b;_0x3eaac3++){var _0x1f6a84=events[_0x3eaac3];var _0x4ff7c9=createListener(_0xcfdc('0x4')+_0x1f6a84,_0x456148);ChatInternalMessageEvents['on'](_0x1f6a84,_0x4ff7c9);}}; \ No newline at end of file +var _0x90ee=['register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','removeListener'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x90ee,0xfb));var _0xe90e=function(_0xdeac17,_0x19ad66){_0xdeac17=_0xdeac17-0x0;var _0x33aabd=_0x90ee[_0xdeac17];return _0x33aabd;};'use strict';var ChatInternalMessageEvents=require(_0xe90e('0x0'));var events=['save',_0xe90e('0x1'),_0xe90e('0x2')];function createListener(_0x1b1a02,_0x5b3cca){return function(_0x16c0c1){_0x5b3cca[_0xe90e('0x3')](_0x1b1a02,_0x16c0c1);};}function removeListener(_0x3b448b,_0x47b929){return function(){ChatInternalMessageEvents[_0xe90e('0x4')](_0x3b448b,_0x47b929);};}exports[_0xe90e('0x5')]=function(_0x174931){for(var _0x4c6cfa=0x0,_0x48e119=events[_0xe90e('0x6')];_0x4c6cfa<_0x48e119;_0x4c6cfa++){var _0x26bb74=events[_0x4c6cfa];var _0x41b911=createListener(_0xe90e('0x7')+_0x26bb74,_0x174931);ChatInternalMessageEvents['on'](_0x26bb74,_0x41b911);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 68a138b..679401b 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 _0x4f98=['/:id','show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','describe','/users','getUsers'];(function(_0x503817,_0x3e41e6){var _0x3cdb5b=function(_0x18d283){while(--_0x18d283){_0x503817['push'](_0x503817['shift']());}};_0x3cdb5b(++_0x3e41e6);}(_0x4f98,0x196));var _0x84f9=function(_0x33fcbb,_0x291d0f){_0x33fcbb=_0x33fcbb-0x0;var _0x2efe40=_0x4f98[_0x33fcbb];return _0x2efe40;};'use strict';var multer=require(_0x84f9('0x0'));var util=require(_0x84f9('0x1'));var path=require(_0x84f9('0x2'));var timeout=require(_0x84f9('0x3'));var express=require(_0x84f9('0x4'));var router=express[_0x84f9('0x5')]();var auth=require(_0x84f9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x84f9('0x7'));var controller=require(_0x84f9('0x8'));router[_0x84f9('0x9')]('/',auth[_0x84f9('0xa')](),controller['index']);router[_0x84f9('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x84f9('0xb')]);router[_0x84f9('0x9')](_0x84f9('0xc'),auth[_0x84f9('0xa')](),controller[_0x84f9('0xd')]);router[_0x84f9('0x9')](_0x84f9('0xe'),auth[_0x84f9('0xa')](),controller[_0x84f9('0xf')]);router[_0x84f9('0x10')]('/',auth[_0x84f9('0xa')](),controller[_0x84f9('0x11')]);router['put'](_0x84f9('0xe'),controller[_0x84f9('0x12')]);router[_0x84f9('0x13')](_0x84f9('0xe'),auth[_0x84f9('0xa')](),controller['destroy']);module[_0x84f9('0x14')]=router; \ No newline at end of file +var _0xfb11=['isAuthenticated','describe','/users','getUsers','/:id','show','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','./chatInternalMessage.controller','get','index'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfb11[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x1fb1('0x0'));var util=require('util');var path=require(_0x1fb1('0x1'));var timeout=require(_0x1fb1('0x2'));var express=require('express');var router=express[_0x1fb1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1fb1('0x4'));var config=require('../../config/environment');var controller=require(_0x1fb1('0x5'));router[_0x1fb1('0x6')]('/',auth['isAuthenticated'](),controller[_0x1fb1('0x7')]);router[_0x1fb1('0x6')]('/describe',auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x9')]);router[_0x1fb1('0x6')](_0x1fb1('0xa'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0xb')]);router[_0x1fb1('0x6')](_0x1fb1('0xc'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0xd')]);router['post']('/',auth[_0x1fb1('0x8')](),controller['create']);router[_0x1fb1('0xe')]('/:id',controller[_0x1fb1('0xf')]);router[_0x1fb1('0x10')](_0x1fb1('0xc'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x11')]);module[_0x1fb1('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index d602cfb..ab5a304 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 _0x7f3f=['exports','TEXT','medium','BOOLEAN','out','DATE','sequelize'];(function(_0x1525b6,_0x7c579b){var _0xfae1c9=function(_0x364d21){while(--_0x364d21){_0x1525b6['push'](_0x1525b6['shift']());}};_0xfae1c9(++_0x7c579b);}(_0x7f3f,0x1a3));var _0xf7f3=function(_0x2f6233,_0x90172){_0x2f6233=_0x2f6233-0x0;var _0x1c9c36=_0x7f3f[_0x2f6233];return _0x1c9c36;};'use strict';var Sequelize=require(_0xf7f3('0x0'));module[_0xf7f3('0x1')]={'body':{'type':Sequelize[_0xf7f3('0x2')](_0xf7f3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf7f3('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf7f3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf7f3('0x5')),'defaultValue':_0xf7f3('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf7f3('0x6')]}}; \ No newline at end of file +var _0xaa9f=['medium','BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x4d82d7,_0x14da7f){var _0x860a67=function(_0x3417a6){while(--_0x3417a6){_0x4d82d7['push'](_0x4d82d7['shift']());}};_0x860a67(++_0x14da7f);}(_0xaa9f,0xc2));var _0xfaa9=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xaa9f[_0x3fba9f];return _0x192cf1;};'use strict';var Sequelize=require('sequelize');module[_0xfaa9('0x0')]={'body':{'type':Sequelize[_0xfaa9('0x1')](_0xfaa9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xfaa9('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xfaa9('0x4')]('in',_0xfaa9('0x5')),'defaultValue':_0xfaa9('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfaa9('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index ba4f04d..654235e 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 _0x08af=['../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','destroy','stack','name','send','index','ChatMessage','rawAttributes','keys','query','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','key','VIRTUAL','field','includeAll','findAll','rows','params','include','options','find','create','body','describe','../../config/logger','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteractionId','isNil','read1stAt','interaction','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis'];(function(_0x1ff762,_0x3e2688){var _0x14ff19=function(_0x4fac02){while(--_0x4fac02){_0x1ff762['push'](_0x1ff762['shift']());}};_0x14ff19(++_0x3e2688);}(_0x08af,0x1c2));var _0xf08a=function(_0x45b36c,_0x4efbfe){_0x45b36c=_0x45b36c-0x0;var _0x1dad2f=_0x08af[_0x45b36c];return _0x1dad2f;};'use strict';var pdf=require(_0xf08a('0x0'));var emlformat=require(_0xf08a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf08a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf08a('0x3'));var moment=require(_0xf08a('0x4'));var BPromise=require(_0xf08a('0x5'));var Mustache=require(_0xf08a('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf08a('0x7'));var ejs=require(_0xf08a('0x8'));var fs=require('fs');var _=require(_0xf08a('0x9'));var squel=require(_0xf08a('0xa'));var crypto=require(_0xf08a('0xb'));var jsforce=require(_0xf08a('0xc'));var deskjs=require(_0xf08a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf08a('0xe'));var Papa=require(_0xf08a('0xf'));var authService=require(_0xf08a('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xf08a('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0xf08a('0x12'));var config=require(_0xf08a('0x13'));var db=require(_0xf08a('0x14'))['db'];config[_0xf08a('0x15')]=_[_0xf08a('0x16')](config[_0xf08a('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf08a('0x15')]));require(_0xf08a('0x17'))[_0xf08a('0x18')](socket);var jayson=require(_0xf08a('0x19'));var client=jayson['client'][_0xf08a('0x1a')]({'port':0x232c});var client9002=jayson[_0xf08a('0x1b')][_0xf08a('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x398e34,_0x47e09d,_0x5bad01,_0x2f5c6a){return new BPromise(function(_0x338313,_0x48fa7b){var _0x2d4eb9=_0x2f5c6a||client;return _0x2d4eb9[_0xf08a('0x1c')](_0x398e34,_0x5bad01)[_0xf08a('0x1d')](function(_0x4ea043){logger[_0xf08a('0x1e')](_0xf08a('0x1f'),_0x47e09d,'request\x20sent');logger[_0xf08a('0x20')](_0xf08a('0x21'),_0x47e09d,'request\x20sent',JSON[_0xf08a('0x22')](_0x4ea043));if(_0x4ea043[_0xf08a('0x23')]){if(_0x4ea043[_0xf08a('0x23')]['code']===0x1f4){logger[_0xf08a('0x23')](_0xf08a('0x1f'),_0x47e09d,_0x4ea043[_0xf08a('0x23')][_0xf08a('0x24')]);return _0x48fa7b(_0x4ea043['error']['message']);}logger[_0xf08a('0x23')](_0xf08a('0x1f'),_0x47e09d,_0x4ea043[_0xf08a('0x23')][_0xf08a('0x24')]);return _0x338313(_0x4ea043[_0xf08a('0x23')][_0xf08a('0x24')]);}else{logger[_0xf08a('0x1e')](_0xf08a('0x1f'),_0x47e09d,_0xf08a('0x25'));_0x338313(_0x4ea043['result'][_0xf08a('0x24')]);}})[_0xf08a('0x26')](function(_0x33dc9e){logger['error'](_0xf08a('0x1f'),_0x47e09d,_0x33dc9e);_0x48fa7b(_0x33dc9e);});});}function respondWithStatusCode(_0x4ee7fd,_0x37b8ef){_0x37b8ef=_0x37b8ef||0xcc;return function(_0x539fba){if(_0x539fba){return _0x4ee7fd[_0xf08a('0x27')](_0x37b8ef);}return _0x4ee7fd[_0xf08a('0x28')](_0x37b8ef)[_0xf08a('0x29')]();};}function respondWithResult(_0x5f2363,_0x5de8be){_0x5de8be=_0x5de8be||0xc8;return function(_0x21d92d){if(_0x21d92d){return _0x5f2363['status'](_0x5de8be)[_0xf08a('0x2a')](_0x21d92d);}};}function respondWithFilteredResult(_0x52b8ce,_0x2bcaf0){return function(_0x2e59a3){if(_0x2e59a3){var _0x200bf6=_0x2e59a3[_0xf08a('0x2b')],_0x3f4e13=_0x2bcaf0['offset'],_0x5d0217=_0x2bcaf0[_0xf08a('0x2c')]+_0x2bcaf0[_0xf08a('0x2d')],_0x218057;if(_0x5d0217>=_0x200bf6){_0x5d0217=_0x200bf6;_0x218057=0xc8;}else{_0x218057=0xce;}_0x52b8ce[_0xf08a('0x28')](_0x218057);return _0x52b8ce['set'](_0xf08a('0x2e'),_0x3f4e13+'-'+_0x5d0217+'/'+_0x200bf6)[_0xf08a('0x2a')](_0x2e59a3);}return null;};}function patchUpdates(_0x218224){return function(_0x48c549){try{jsonpatch['apply'](_0x48c549,_0x218224,!![]);}catch(_0x4ceba3){return BPromise[_0xf08a('0x2f')](_0x4ceba3);}return _0x48c549[_0xf08a('0x30')]();};}function saveUpdates(_0x198e6,_0xc9f7b1){return function(_0xaf5948){if(_0xaf5948){return _0xaf5948[_0xf08a('0x31')](_0x198e6)[_0xf08a('0x1d')](function(_0x4dc5bc){return _0x4dc5bc;});}return null;};}function removeEntity(_0x26e3df,_0x3c8420){return function(_0x37f038){if(_0x37f038){return _0x37f038[_0xf08a('0x32')]()[_0xf08a('0x1d')](function(){_0x26e3df[_0xf08a('0x28')](0xcc)[_0xf08a('0x29')]();});}};}function handleEntityNotFound(_0x59bf4f,_0x8db953){return function(_0x4160af){if(!_0x4160af){_0x59bf4f['sendStatus'](0x194);}return _0x4160af;};}function handleError(_0x29a7e5,_0x46f29e){_0x46f29e=_0x46f29e||0x1f4;return function(_0x132495){logger[_0xf08a('0x23')](_0x132495[_0xf08a('0x33')]);if(_0x132495[_0xf08a('0x34')]){delete _0x132495['name'];}_0x29a7e5[_0xf08a('0x28')](_0x46f29e)[_0xf08a('0x35')](_0x132495);};}exports[_0xf08a('0x36')]=function(_0x16e654,_0x2842ec){var _0x770369={},_0xa9ad5c={},_0x294c7f={'count':0x0,'rows':[]};var _0x3404cf=db[_0xf08a('0x37')][_0xf08a('0x38')];_0xa9ad5c['model']=_[_0xf08a('0x39')](_0x3404cf);_0xa9ad5c[_0xf08a('0x3a')]=_['keys'](_0x16e654[_0xf08a('0x3a')]);_0xa9ad5c[_0xf08a('0x3b')]=_['intersection'](_0xa9ad5c['model'],_0xa9ad5c[_0xf08a('0x3a')]);_0x770369[_0xf08a('0x3c')]=_[_0xf08a('0x3d')](_0xa9ad5c['model'],qs[_0xf08a('0x3e')](_0x16e654[_0xf08a('0x3a')][_0xf08a('0x3e')]));_0x770369[_0xf08a('0x3c')]=_0x770369[_0xf08a('0x3c')][_0xf08a('0x3f')]?_0x770369[_0xf08a('0x3c')]:_0xa9ad5c[_0xf08a('0x40')];if(!_0x16e654[_0xf08a('0x3a')][_0xf08a('0x41')](_0xf08a('0x42'))){_0x770369[_0xf08a('0x2d')]=qs[_0xf08a('0x2d')](_0x16e654[_0xf08a('0x3a')][_0xf08a('0x2d')]);_0x770369['offset']=qs[_0xf08a('0x2c')](_0x16e654[_0xf08a('0x3a')]['offset']);}_0x770369[_0xf08a('0x43')]=qs[_0xf08a('0x44')](_0x16e654[_0xf08a('0x3a')][_0xf08a('0x44')]);_0x770369['where']=qs[_0xf08a('0x3b')](_['pick'](_0x16e654[_0xf08a('0x3a')],_0xa9ad5c[_0xf08a('0x3b')]));if(_0x16e654[_0xf08a('0x3a')][_0xf08a('0x45')]){_0x770369[_0xf08a('0x46')]=_[_0xf08a('0x47')](_0x770369['where'],{'$or':_[_0xf08a('0x48')](_0x3404cf,function(_0x5b7d86){if(_0x5b7d86['type'][_0xf08a('0x49')]!==_0xf08a('0x4a')){var _0x5b2ec1={};_0x5b2ec1[_0x5b7d86[_0xf08a('0x4b')]]={'$like':'%'+_0x16e654[_0xf08a('0x3a')][_0xf08a('0x45')]+'%'};return _0x5b2ec1;}})});}_0x770369=_[_0xf08a('0x47')]({},_0x770369,_0x16e654['options']);var _0x5c6784={'where':_0x770369['where']};return db[_0xf08a('0x37')][_0xf08a('0x2b')](_0x5c6784)[_0xf08a('0x1d')](function(_0x26b0bd){_0x294c7f['count']=_0x26b0bd;if(_0x16e654[_0xf08a('0x3a')][_0xf08a('0x4c')]){_0x770369['include']=[{'all':!![]}];}return db[_0xf08a('0x37')][_0xf08a('0x4d')](_0x770369);})[_0xf08a('0x1d')](function(_0x1d5536){_0x294c7f[_0xf08a('0x4e')]=_0x1d5536;return _0x294c7f;})[_0xf08a('0x1d')](respondWithFilteredResult(_0x2842ec,_0x770369))[_0xf08a('0x26')](handleError(_0x2842ec,null));};exports['show']=function(_0x52ceb4,_0x4dda8a){var _0x57be87={'raw':!![],'where':{'id':_0x52ceb4[_0xf08a('0x4f')]['id']}},_0x2b3f0d={};_0x2b3f0d['model']=_['keys'](db[_0xf08a('0x37')][_0xf08a('0x38')]);_0x2b3f0d['query']=_[_0xf08a('0x39')](_0x52ceb4['query']);_0x2b3f0d[_0xf08a('0x3b')]=_[_0xf08a('0x3d')](_0x2b3f0d['model'],_0x2b3f0d[_0xf08a('0x3a')]);_0x57be87['attributes']=_[_0xf08a('0x3d')](_0x2b3f0d[_0xf08a('0x40')],qs[_0xf08a('0x3e')](_0x52ceb4[_0xf08a('0x3a')][_0xf08a('0x3e')]));_0x57be87[_0xf08a('0x3c')]=_0x57be87[_0xf08a('0x3c')][_0xf08a('0x3f')]?_0x57be87[_0xf08a('0x3c')]:_0x2b3f0d['model'];if(_0x52ceb4[_0xf08a('0x3a')][_0xf08a('0x4c')]){_0x57be87[_0xf08a('0x50')]=[{'all':!![]}];}_0x57be87=_[_0xf08a('0x47')]({},_0x57be87,_0x52ceb4[_0xf08a('0x51')]);return db[_0xf08a('0x37')][_0xf08a('0x52')](_0x57be87)[_0xf08a('0x1d')](handleEntityNotFound(_0x4dda8a,null))[_0xf08a('0x1d')](respondWithResult(_0x4dda8a,null))[_0xf08a('0x26')](handleError(_0x4dda8a,null));};exports[_0xf08a('0x53')]=function(_0x57379b,_0x4bf9a1){return db[_0xf08a('0x37')][_0xf08a('0x53')](_0x57379b[_0xf08a('0x54')],{})[_0xf08a('0x1d')](respondWithResult(_0x4bf9a1,0xc9))['catch'](handleError(_0x4bf9a1,null));};exports[_0xf08a('0x31')]=function(_0x9bd3d1,_0x5425ec){if(_0x9bd3d1[_0xf08a('0x54')]['id']){delete _0x9bd3d1[_0xf08a('0x54')]['id'];}return db[_0xf08a('0x37')][_0xf08a('0x52')]({'where':{'id':_0x9bd3d1[_0xf08a('0x4f')]['id']}})[_0xf08a('0x1d')](handleEntityNotFound(_0x5425ec,null))[_0xf08a('0x1d')](saveUpdates(_0x9bd3d1[_0xf08a('0x54')],null))['then'](respondWithResult(_0x5425ec,null))[_0xf08a('0x26')](handleError(_0x5425ec,null));};exports[_0xf08a('0x32')]=function(_0x404ed0,_0x108095){return db['ChatMessage'][_0xf08a('0x52')]({'where':{'id':_0x404ed0[_0xf08a('0x4f')]['id']}})[_0xf08a('0x1d')](handleEntityNotFound(_0x108095,null))[_0xf08a('0x1d')](removeEntity(_0x108095,null))[_0xf08a('0x26')](handleError(_0x108095,null));};exports[_0xf08a('0x55')]=function(_0x337c5f,_0xaad28c){return db[_0xf08a('0x37')][_0xf08a('0x55')]()['then'](respondWithResult(_0xaad28c,null))[_0xf08a('0x26')](handleError(_0xaad28c,null));};var interaction_log=require(_0xf08a('0x56'))('chat-interactions');exports[_0xf08a('0x57')]=function(_0x529bb9,_0x5a9b25,_0x340668){var _0x4e8732={'channel':_0xf08a('0x58')};if(_0x529bb9[_0xf08a('0x54')]['id']){delete _0x529bb9[_0xf08a('0x54')]['id'];}_0x529bb9[_0xf08a('0x54')][_0xf08a('0x59')]=!![];_0x529bb9['body'][_0xf08a('0x5a')]=moment()[_0xf08a('0x5b')](_0xf08a('0x5c'));_0x529bb9['body']['UserId']=_0x529bb9[_0xf08a('0x54')][_0xf08a('0x5d')]||_0x529bb9[_0xf08a('0x5e')]['id'];return db[_0xf08a('0x37')]['find']({'where':{'id':_0x529bb9[_0xf08a('0x4f')]['id'],'UserId':null},'include':[{'model':db[_0xf08a('0x5f')],'as':_0xf08a('0x60')}]})[_0xf08a('0x1d')](handleEntityNotFound(_0x5a9b25,null))[_0xf08a('0x1d')](saveUpdates(_0x529bb9[_0xf08a('0x54')],null))['then'](function(_0x2e872f){if(_0x2e872f){_0x4e8732[_0xf08a('0x24')]=_0x2e872f[_0xf08a('0x61')]({'plain':!![]});return db['ChatInteraction'][_0xf08a('0x52')]({'where':{'id':_0x2e872f[_0xf08a('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x5a9b25,null))[_0xf08a('0x1d')](function(_0x727ae6){if(_0x727ae6){return _0x727ae6['update']({'UserId':_0x529bb9[_0xf08a('0x54')][_0xf08a('0x5d')],'read1stAt':_[_0xf08a('0x63')](_0x727ae6[_0xf08a('0x64')])?moment()[_0xf08a('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf08a('0x1d')](function(_0x13677a){if(_0x13677a){_0x4e8732[_0xf08a('0x65')]=_0x13677a[_0xf08a('0x61')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x529bb9[_0xf08a('0x5e')]['id'],_0x529bb9[_0xf08a('0x5e')][_0xf08a('0x34')],_0x529bb9['user']['role'],_0x4e8732[_0xf08a('0x65')]['id'],_0x529bb9[_0xf08a('0x54')]?JSON[_0xf08a('0x22')](_0x529bb9[_0xf08a('0x54')]):_0xf08a('0x66'));return respondWithRpcPromise(_0xf08a('0x67'),'acceptMessage',_0x4e8732);}return null;})['then'](function(_0x1116b3){if(_0x1116b3){if(_0x529bb9[_0xf08a('0x54')][_0xf08a('0x68')]){_0x4e8732[_0xf08a('0x24')][_0xf08a('0x69')]=util['format'](_0xf08a('0x6a'),_0x529bb9[_0xf08a('0x5e')][_0xf08a('0x34')]);_0x4e8732[_0xf08a('0x24')][_0xf08a('0x6b')]=_0x4e8732[_0xf08a('0x6b')];_0x4e8732['message'][_0xf08a('0x6c')]=_0xf08a('0x57');return respondWithRpcPromise(_0xf08a('0x6d'),_0xf08a('0x6d'),{'event':_0xf08a('0x6e'),'message':_['merge'](_0x4e8732['message'],JSON['parse'](_0x4e8732[_0xf08a('0x65')][_0xf08a('0x6f')]))},client9002)[_0xf08a('0x1d')](function(){return _0x4e8732;});}return _0x4e8732;}return null;})[_0xf08a('0x1d')](respondWithResult(_0x5a9b25,null))[_0xf08a('0x26')](handleError(_0x5a9b25,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xf08a('0x2f')]=function(_0x2ce99b,_0x5cdc6c,_0x57e81a){var _0x253bc5={'agent':{},'channel':_0xf08a('0x58')};if(_0x2ce99b[_0xf08a('0x54')]['id']){delete _0x2ce99b[_0xf08a('0x54')]['id'];}_0x2ce99b[_0xf08a('0x54')][_0xf08a('0x5d')]=_0x2ce99b['body'][_0xf08a('0x5d')]||_0x2ce99b[_0xf08a('0x5e')]['id'];_0x253bc5['agent']['id']=_0x2ce99b[_0xf08a('0x54')][_0xf08a('0x5d')];return db['ChatMessage'][_0xf08a('0x52')]({'where':{'id':_0x2ce99b[_0xf08a('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5cdc6c,null))[_0xf08a('0x1d')](function(_0x4f5b8a){if(_0x4f5b8a){_0x253bc5['message']=_0x4f5b8a['get']({'plain':!![]});return db['ChatInteraction'][_0xf08a('0x52')]({'where':{'id':_0x4f5b8a[_0xf08a('0x62')]}});}return null;})[_0xf08a('0x1d')](handleEntityNotFound(_0x5cdc6c,null))[_0xf08a('0x1d')](function(_0x523e8e){if(_0x523e8e){_0x253bc5[_0xf08a('0x65')]=_0x523e8e[_0xf08a('0x61')]({'plain':!![]});interaction_log[_0xf08a('0x1e')](_0xf08a('0x70'),_0x2ce99b[_0xf08a('0x5e')]['id'],_0x2ce99b[_0xf08a('0x5e')][_0xf08a('0x34')],_0x2ce99b[_0xf08a('0x5e')][_0xf08a('0x71')],_0x253bc5[_0xf08a('0x65')]['id'],_0x2ce99b['body']?JSON[_0xf08a('0x22')](_0x2ce99b['body']):_0xf08a('0x66'));return respondWithRpcPromise(_0xf08a('0x72'),_0xf08a('0x73'),_0x253bc5);}return null;})[_0xf08a('0x1d')](function(_0x5b9d4f){if(_0x5b9d4f){_0x5b9d4f[_0xf08a('0x24')][_0xf08a('0x69')]=util['format'](_0xf08a('0x6a'),_0x2ce99b[_0xf08a('0x5e')][_0xf08a('0x34')]);_0x5b9d4f[_0xf08a('0x24')]['channel']=_0x253bc5[_0xf08a('0x6b')];_0x5b9d4f[_0xf08a('0x24')][_0xf08a('0x6c')]=_0xf08a('0x2f');respondWithRpcPromise(_0xf08a('0x6d'),_0xf08a('0x6d'),{'event':_0xf08a('0x74'),'message':_0x5b9d4f['message']},client9002);return _0x253bc5;}return null;})[_0xf08a('0x1d')](respondWithResult(_0x5cdc6c,null))[_0xf08a('0x26')](handleError(_0x5cdc6c,null));}; \ No newline at end of file +var _0x8e23=['query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','where','filters','merge','map','type','VIRTUAL','field','includeAll','include','findAll','rows','show','params','length','options','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','ChatInteraction','update','isNil','read1stAt','interaction','role','stringify','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','formData','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','destroy','stack','name','send','index','ChatMessage','rawAttributes','model','keys'];(function(_0xf6e75d,_0xc70967){var _0x27514d=function(_0xc2c6dd){while(--_0xc2c6dd){_0xf6e75d['push'](_0xf6e75d['shift']());}};_0x27514d(++_0xc70967);}(_0x8e23,0xae));var _0x38e2=function(_0x3f8102,_0x56150b){_0x3f8102=_0x3f8102-0x0;var _0x2afad0=_0x8e23[_0x3f8102];return _0x2afad0;};'use strict';var pdf=require(_0x38e2('0x0'));var emlformat=require(_0x38e2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x38e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x38e2('0x3'));var moment=require(_0x38e2('0x4'));var BPromise=require(_0x38e2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x38e2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x38e2('0x7'));var fs=require('fs');var _=require(_0x38e2('0x8'));var squel=require(_0x38e2('0x9'));var crypto=require(_0x38e2('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x38e2('0xb'));var toCsv=require(_0x38e2('0xc'));var querystring=require(_0x38e2('0xd'));var Papa=require(_0x38e2('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0x38e2('0xf'));var Redis=require(_0x38e2('0x10'));var qs=require(_0x38e2('0x11'));var logger=require(_0x38e2('0x12'))(_0x38e2('0x13'));var utils=require(_0x38e2('0x14'));var config=require(_0x38e2('0x15'));var db=require('../../mysqldb')['db'];config[_0x38e2('0x16')]=_[_0x38e2('0x17')](config[_0x38e2('0x16')],{'host':_0x38e2('0x18'),'port':0x18eb});var socket=require(_0x38e2('0x19'))(new Redis(config['redis']));require(_0x38e2('0x1a'))['register'](socket);var jayson=require(_0x38e2('0x1b'));var client=jayson[_0x38e2('0x1c')][_0x38e2('0x1d')]({'port':0x232c});var client9002=jayson[_0x38e2('0x1c')][_0x38e2('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1a997f,_0x36459e,_0xc0cd5e,_0x59dc1b){return new BPromise(function(_0x5f1cb9,_0x357146){var _0x62aea6=_0x59dc1b||client;return _0x62aea6[_0x38e2('0x1e')](_0x1a997f,_0xc0cd5e)[_0x38e2('0x1f')](function(_0x2194c8){logger[_0x38e2('0x20')](_0x38e2('0x21'),_0x36459e,'request\x20sent');logger['debug'](_0x38e2('0x22'),_0x36459e,_0x38e2('0x23'),JSON['stringify'](_0x2194c8));if(_0x2194c8[_0x38e2('0x24')]){if(_0x2194c8[_0x38e2('0x24')]['code']===0x1f4){logger[_0x38e2('0x24')]('ChatMessage,\x20%s,\x20%s',_0x36459e,_0x2194c8[_0x38e2('0x24')]['message']);return _0x357146(_0x2194c8[_0x38e2('0x24')]['message']);}logger[_0x38e2('0x24')](_0x38e2('0x21'),_0x36459e,_0x2194c8[_0x38e2('0x24')][_0x38e2('0x25')]);return _0x5f1cb9(_0x2194c8['error'][_0x38e2('0x25')]);}else{logger[_0x38e2('0x20')](_0x38e2('0x21'),_0x36459e,'request\x20sent');_0x5f1cb9(_0x2194c8[_0x38e2('0x26')][_0x38e2('0x25')]);}})[_0x38e2('0x27')](function(_0x4069af){logger['error']('ChatMessage,\x20%s,\x20%s',_0x36459e,_0x4069af);_0x357146(_0x4069af);});});}function respondWithStatusCode(_0x12dba2,_0xa62e22){_0xa62e22=_0xa62e22||0xcc;return function(_0x2afa66){if(_0x2afa66){return _0x12dba2[_0x38e2('0x28')](_0xa62e22);}return _0x12dba2[_0x38e2('0x29')](_0xa62e22)[_0x38e2('0x2a')]();};}function respondWithResult(_0x987445,_0x5cbc7b){_0x5cbc7b=_0x5cbc7b||0xc8;return function(_0xafe9c2){if(_0xafe9c2){return _0x987445[_0x38e2('0x29')](_0x5cbc7b)[_0x38e2('0x2b')](_0xafe9c2);}};}function respondWithFilteredResult(_0x4b09eb,_0x23e627){return function(_0x42b8b2){if(_0x42b8b2){var _0x12c077=_0x42b8b2[_0x38e2('0x2c')],_0x187949=_0x23e627[_0x38e2('0x2d')],_0x46f4c5=_0x23e627[_0x38e2('0x2d')]+_0x23e627['limit'],_0x2f8347;if(_0x46f4c5>=_0x12c077){_0x46f4c5=_0x12c077;_0x2f8347=0xc8;}else{_0x2f8347=0xce;}_0x4b09eb[_0x38e2('0x29')](_0x2f8347);return _0x4b09eb['set'](_0x38e2('0x2e'),_0x187949+'-'+_0x46f4c5+'/'+_0x12c077)[_0x38e2('0x2b')](_0x42b8b2);}return null;};}function patchUpdates(_0xca2d25){return function(_0x92e04f){try{jsonpatch[_0x38e2('0x2f')](_0x92e04f,_0xca2d25,!![]);}catch(_0x540bbb){return BPromise[_0x38e2('0x30')](_0x540bbb);}return _0x92e04f['save']();};}function saveUpdates(_0x20fd71,_0x26274b){return function(_0xa3bd9e){if(_0xa3bd9e){return _0xa3bd9e['update'](_0x20fd71)['then'](function(_0x18719e){return _0x18719e;});}return null;};}function removeEntity(_0x48c643,_0x2e8068){return function(_0x39e229){if(_0x39e229){return _0x39e229[_0x38e2('0x31')]()[_0x38e2('0x1f')](function(){_0x48c643[_0x38e2('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43ee56,_0x3d1f5f){return function(_0x411bea){if(!_0x411bea){_0x43ee56['sendStatus'](0x194);}return _0x411bea;};}function handleError(_0x134b84,_0x28bbc1){_0x28bbc1=_0x28bbc1||0x1f4;return function(_0x47f25f){logger[_0x38e2('0x24')](_0x47f25f[_0x38e2('0x32')]);if(_0x47f25f[_0x38e2('0x33')]){delete _0x47f25f['name'];}_0x134b84['status'](_0x28bbc1)[_0x38e2('0x34')](_0x47f25f);};}exports[_0x38e2('0x35')]=function(_0x39c973,_0x431627){var _0x494b25={},_0x45e185={},_0x499962={'count':0x0,'rows':[]};var _0x3d49ea=db[_0x38e2('0x36')][_0x38e2('0x37')];_0x45e185[_0x38e2('0x38')]=_[_0x38e2('0x39')](_0x3d49ea);_0x45e185[_0x38e2('0x3a')]=_['keys'](_0x39c973[_0x38e2('0x3a')]);_0x45e185['filters']=_['intersection'](_0x45e185[_0x38e2('0x38')],_0x45e185['query']);_0x494b25[_0x38e2('0x3b')]=_[_0x38e2('0x3c')](_0x45e185[_0x38e2('0x38')],qs['fields'](_0x39c973[_0x38e2('0x3a')][_0x38e2('0x3d')]));_0x494b25[_0x38e2('0x3b')]=_0x494b25[_0x38e2('0x3b')]['length']?_0x494b25[_0x38e2('0x3b')]:_0x45e185['model'];if(!_0x39c973[_0x38e2('0x3a')][_0x38e2('0x3e')](_0x38e2('0x3f'))){_0x494b25[_0x38e2('0x40')]=qs['limit'](_0x39c973[_0x38e2('0x3a')][_0x38e2('0x40')]);_0x494b25[_0x38e2('0x2d')]=qs[_0x38e2('0x2d')](_0x39c973[_0x38e2('0x3a')][_0x38e2('0x2d')]);}_0x494b25['order']=qs['sort'](_0x39c973[_0x38e2('0x3a')]['sort']);_0x494b25[_0x38e2('0x41')]=qs[_0x38e2('0x42')](_['pick'](_0x39c973['query'],_0x45e185['filters']));if(_0x39c973['query']['filter']){_0x494b25[_0x38e2('0x41')]=_[_0x38e2('0x43')](_0x494b25[_0x38e2('0x41')],{'$or':_[_0x38e2('0x44')](_0x3d49ea,function(_0x2d2d96){if(_0x2d2d96[_0x38e2('0x45')]['key']!==_0x38e2('0x46')){var _0x9d911b={};_0x9d911b[_0x2d2d96[_0x38e2('0x47')]]={'$like':'%'+_0x39c973[_0x38e2('0x3a')]['filter']+'%'};return _0x9d911b;}})});}_0x494b25=_[_0x38e2('0x43')]({},_0x494b25,_0x39c973['options']);var _0x4c46c8={'where':_0x494b25[_0x38e2('0x41')]};return db[_0x38e2('0x36')][_0x38e2('0x2c')](_0x4c46c8)['then'](function(_0x883ec3){_0x499962[_0x38e2('0x2c')]=_0x883ec3;if(_0x39c973['query'][_0x38e2('0x48')]){_0x494b25[_0x38e2('0x49')]=[{'all':!![]}];}return db[_0x38e2('0x36')][_0x38e2('0x4a')](_0x494b25);})['then'](function(_0x3feb3f){_0x499962[_0x38e2('0x4b')]=_0x3feb3f;return _0x499962;})['then'](respondWithFilteredResult(_0x431627,_0x494b25))[_0x38e2('0x27')](handleError(_0x431627,null));};exports[_0x38e2('0x4c')]=function(_0x3f5e55,_0x553abe){var _0x7fb3fa={'raw':!![],'where':{'id':_0x3f5e55[_0x38e2('0x4d')]['id']}},_0x28b43a={};_0x28b43a[_0x38e2('0x38')]=_[_0x38e2('0x39')](db[_0x38e2('0x36')][_0x38e2('0x37')]);_0x28b43a['query']=_[_0x38e2('0x39')](_0x3f5e55[_0x38e2('0x3a')]);_0x28b43a['filters']=_[_0x38e2('0x3c')](_0x28b43a[_0x38e2('0x38')],_0x28b43a[_0x38e2('0x3a')]);_0x7fb3fa['attributes']=_[_0x38e2('0x3c')](_0x28b43a[_0x38e2('0x38')],qs['fields'](_0x3f5e55[_0x38e2('0x3a')][_0x38e2('0x3d')]));_0x7fb3fa['attributes']=_0x7fb3fa['attributes'][_0x38e2('0x4e')]?_0x7fb3fa['attributes']:_0x28b43a[_0x38e2('0x38')];if(_0x3f5e55[_0x38e2('0x3a')]['includeAll']){_0x7fb3fa['include']=[{'all':!![]}];}_0x7fb3fa=_[_0x38e2('0x43')]({},_0x7fb3fa,_0x3f5e55[_0x38e2('0x4f')]);return db[_0x38e2('0x36')][_0x38e2('0x50')](_0x7fb3fa)[_0x38e2('0x1f')](handleEntityNotFound(_0x553abe,null))[_0x38e2('0x1f')](respondWithResult(_0x553abe,null))[_0x38e2('0x27')](handleError(_0x553abe,null));};exports[_0x38e2('0x51')]=function(_0x4e054e,_0x5cf804){return db[_0x38e2('0x36')]['create'](_0x4e054e[_0x38e2('0x52')],{})[_0x38e2('0x1f')](respondWithResult(_0x5cf804,0xc9))[_0x38e2('0x27')](handleError(_0x5cf804,null));};exports['update']=function(_0x1c0c1f,_0x55354b){if(_0x1c0c1f[_0x38e2('0x52')]['id']){delete _0x1c0c1f[_0x38e2('0x52')]['id'];}return db[_0x38e2('0x36')]['find']({'where':{'id':_0x1c0c1f[_0x38e2('0x4d')]['id']}})[_0x38e2('0x1f')](handleEntityNotFound(_0x55354b,null))['then'](saveUpdates(_0x1c0c1f[_0x38e2('0x52')],null))['then'](respondWithResult(_0x55354b,null))[_0x38e2('0x27')](handleError(_0x55354b,null));};exports[_0x38e2('0x31')]=function(_0x27aa24,_0x2ed1e5){return db[_0x38e2('0x36')]['find']({'where':{'id':_0x27aa24['params']['id']}})[_0x38e2('0x1f')](handleEntityNotFound(_0x2ed1e5,null))[_0x38e2('0x1f')](removeEntity(_0x2ed1e5,null))[_0x38e2('0x27')](handleError(_0x2ed1e5,null));};exports[_0x38e2('0x53')]=function(_0xe3244f,_0x205df1){return db[_0x38e2('0x36')][_0x38e2('0x53')]()[_0x38e2('0x1f')](respondWithResult(_0x205df1,null))[_0x38e2('0x27')](handleError(_0x205df1,null));};var interaction_log=require(_0x38e2('0x12'))(_0x38e2('0x54'));exports[_0x38e2('0x55')]=function(_0x4697da,_0x22489b,_0x2d49fb){var _0x241ffb={'channel':_0x38e2('0x56')};if(_0x4697da['body']['id']){delete _0x4697da[_0x38e2('0x52')]['id'];}_0x4697da[_0x38e2('0x52')][_0x38e2('0x57')]=!![];_0x4697da[_0x38e2('0x52')][_0x38e2('0x58')]=moment()[_0x38e2('0x59')](_0x38e2('0x5a'));_0x4697da['body'][_0x38e2('0x5b')]=_0x4697da['body']['UserId']||_0x4697da[_0x38e2('0x5c')]['id'];return db[_0x38e2('0x36')][_0x38e2('0x50')]({'where':{'id':_0x4697da[_0x38e2('0x4d')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x38e2('0x5d')}]})['then'](handleEntityNotFound(_0x22489b,null))[_0x38e2('0x1f')](saveUpdates(_0x4697da['body'],null))[_0x38e2('0x1f')](function(_0x378ab5){if(_0x378ab5){_0x241ffb['message']=_0x378ab5[_0x38e2('0x5e')]({'plain':!![]});return db[_0x38e2('0x5f')]['find']({'where':{'id':_0x378ab5['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x22489b,null))[_0x38e2('0x1f')](function(_0x296151){if(_0x296151){return _0x296151[_0x38e2('0x60')]({'UserId':_0x4697da[_0x38e2('0x52')][_0x38e2('0x5b')],'read1stAt':_[_0x38e2('0x61')](_0x296151[_0x38e2('0x62')])?moment()['format'](_0x38e2('0x5a')):undefined});}return null;})['then'](function(_0x4a58ad){if(_0x4a58ad){_0x241ffb[_0x38e2('0x63')]=_0x4a58ad['get']({'plain':!![]});interaction_log[_0x38e2('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4697da[_0x38e2('0x5c')]['id'],_0x4697da[_0x38e2('0x5c')][_0x38e2('0x33')],_0x4697da[_0x38e2('0x5c')][_0x38e2('0x64')],_0x241ffb[_0x38e2('0x63')]['id'],_0x4697da[_0x38e2('0x52')]?JSON[_0x38e2('0x65')](_0x4697da['body']):_0x38e2('0x66'));return respondWithRpcPromise(_0x38e2('0x67'),_0x38e2('0x68'),_0x241ffb);}return null;})['then'](function(_0x2c5d49){if(_0x2c5d49){if(_0x4697da['body'][_0x38e2('0x69')]){_0x241ffb[_0x38e2('0x25')][_0x38e2('0x6a')]=util[_0x38e2('0x59')](_0x38e2('0x6b'),_0x4697da[_0x38e2('0x5c')][_0x38e2('0x33')]);_0x241ffb[_0x38e2('0x25')][_0x38e2('0x6c')]=_0x241ffb[_0x38e2('0x6c')];_0x241ffb[_0x38e2('0x25')][_0x38e2('0x6d')]=_0x38e2('0x55');return respondWithRpcPromise(_0x38e2('0x6e'),_0x38e2('0x6e'),{'event':_0x38e2('0x6f'),'message':_[_0x38e2('0x43')](_0x241ffb[_0x38e2('0x25')],JSON['parse'](_0x241ffb[_0x38e2('0x63')][_0x38e2('0x70')]))},client9002)[_0x38e2('0x1f')](function(){return _0x241ffb;});}return _0x241ffb;}return null;})[_0x38e2('0x1f')](respondWithResult(_0x22489b,null))['catch'](handleError(_0x22489b,null));};var interaction_log=require(_0x38e2('0x12'))('chat-interactions');exports[_0x38e2('0x30')]=function(_0x18c5fc,_0x1c47a8,_0x385011){var _0x4155c3={'agent':{},'channel':_0x38e2('0x56')};if(_0x18c5fc[_0x38e2('0x52')]['id']){delete _0x18c5fc[_0x38e2('0x52')]['id'];}_0x18c5fc['body'][_0x38e2('0x5b')]=_0x18c5fc['body']['UserId']||_0x18c5fc[_0x38e2('0x5c')]['id'];_0x4155c3[_0x38e2('0x71')]['id']=_0x18c5fc[_0x38e2('0x52')][_0x38e2('0x5b')];return db[_0x38e2('0x36')][_0x38e2('0x50')]({'where':{'id':_0x18c5fc['params']['id'],'UserId':null}})[_0x38e2('0x1f')](handleEntityNotFound(_0x1c47a8,null))['then'](function(_0x15fd19){if(_0x15fd19){_0x4155c3['message']=_0x15fd19[_0x38e2('0x5e')]({'plain':!![]});return db[_0x38e2('0x5f')]['find']({'where':{'id':_0x15fd19['ChatInteractionId']}});}return null;})[_0x38e2('0x1f')](handleEntityNotFound(_0x1c47a8,null))[_0x38e2('0x1f')](function(_0x3d25d9){if(_0x3d25d9){_0x4155c3['interaction']=_0x3d25d9[_0x38e2('0x5e')]({'plain':!![]});interaction_log[_0x38e2('0x20')](_0x38e2('0x72'),_0x18c5fc[_0x38e2('0x5c')]['id'],_0x18c5fc[_0x38e2('0x5c')][_0x38e2('0x33')],_0x18c5fc[_0x38e2('0x5c')][_0x38e2('0x64')],_0x4155c3[_0x38e2('0x63')]['id'],_0x18c5fc[_0x38e2('0x52')]?JSON[_0x38e2('0x65')](_0x18c5fc[_0x38e2('0x52')]):'null');return respondWithRpcPromise(_0x38e2('0x73'),'rejectMessage',_0x4155c3);}return null;})['then'](function(_0x4f2128){if(_0x4f2128){_0x4f2128[_0x38e2('0x25')][_0x38e2('0x6a')]=util['format'](_0x38e2('0x6b'),_0x18c5fc[_0x38e2('0x5c')]['name']);_0x4f2128[_0x38e2('0x25')][_0x38e2('0x6c')]=_0x4155c3[_0x38e2('0x6c')];_0x4f2128[_0x38e2('0x25')][_0x38e2('0x6d')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x4f2128[_0x38e2('0x25')]},client9002);return _0x4155c3;}return null;})[_0x38e2('0x1f')](respondWithResult(_0x1c47a8,null))['catch'](handleError(_0x1c47a8,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index d7ecbc8..4db77d7 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 _0x2a92=['../../mysqldb','ChatMessage','setMaxListeners','remove','hasOwnProperty','hook','exports','events'];(function(_0x34e342,_0x539ab9){var _0x5d07f3=function(_0x211175){while(--_0x211175){_0x34e342['push'](_0x34e342['shift']());}};_0x5d07f3(++_0x539ab9);}(_0x2a92,0xbf));var _0x22a9=function(_0x20181d,_0x4967f4){_0x20181d=_0x20181d-0x0;var _0x1fc5a2=_0x2a92[_0x20181d];return _0x1fc5a2;};'use strict';var EventEmitter=require(_0x22a9('0x0'));var ChatMessage=require(_0x22a9('0x1'))['db'][_0x22a9('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x22a9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x22a9('0x4')};function emitEvent(_0x123b0f){return function(_0xe40642,_0x3bf3ec,_0x440c13){ChatMessageEvents['emit'](_0x123b0f+':'+_0xe40642['id'],_0xe40642);ChatMessageEvents['emit'](_0x123b0f,_0xe40642);_0x440c13(null);};}for(var e in events){if(events[_0x22a9('0x5')](e)){var event=events[e];ChatMessage[_0x22a9('0x6')](e,emitEvent(event));}}module[_0x22a9('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x851c=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x851c,0x19d));var _0xc851=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x851c[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0xc851('0x0'));var ChatMessage=require(_0xc851('0x1'))['db'][_0xc851('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc851('0x3')](0x0);var events={'afterCreate':_0xc851('0x4'),'afterUpdate':_0xc851('0x5'),'afterDestroy':_0xc851('0x6')};function emitEvent(_0x4ad892){return function(_0x2fddd4,_0x84f5ad,_0x52374b){ChatMessageEvents[_0xc851('0x7')](_0x4ad892+':'+_0x2fddd4['id'],_0x2fddd4);ChatMessageEvents[_0xc851('0x7')](_0x4ad892,_0x2fddd4);_0x52374b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xc851('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 2a57c3b..647a0d8 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 _0xa3f2=['findOne','ChatInteractionId','update','createdAt','body','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./chatMessage.attributes','exports','define','ChatMessage','models','toLowerCase','direction','isNil','UserId','ChatInteraction'];(function(_0x18bb67,_0x5eff3d){var _0x149f9a=function(_0x1b890c){while(--_0x1b890c){_0x18bb67['push'](_0x18bb67['shift']());}};_0x149f9a(++_0x5eff3d);}(_0xa3f2,0x6c));var _0x2a3f=function(_0x3f1305,_0x9ade43){_0x3f1305=_0x3f1305-0x0;var _0x1e79ef=_0xa3f2[_0x3f1305];return _0x1e79ef;};'use strict';var _=require(_0x2a3f('0x0'));var util=require(_0x2a3f('0x1'));var logger=require(_0x2a3f('0x2'))(_0x2a3f('0x3'));var moment=require(_0x2a3f('0x4'));var BPromise=require(_0x2a3f('0x5'));var rp=require(_0x2a3f('0x6'));var attributes=require(_0x2a3f('0x7'));module[_0x2a3f('0x8')]=function(_0x3e455e,_0x57619a){return _0x3e455e[_0x2a3f('0x9')](_0x2a3f('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x552375,_0x575a0f,_0x3adb23){var _0x366efc=_0x3e455e[_0x2a3f('0xb')];var _0x3809ed=_0x552375['get']({'plain':!![]});if(_0x3809ed['direction'][_0x2a3f('0xc')]()==='in'||_0x3809ed[_0x2a3f('0xd')][_0x2a3f('0xc')]()==='out'&&!_0x3809ed['secret']&&!_[_0x2a3f('0xe')](_0x3809ed[_0x2a3f('0xf')])){_0x366efc[_0x2a3f('0x10')][_0x2a3f('0x11')]({'where':{'id':_0x3809ed[_0x2a3f('0x12')]}})['then'](function(_0x3205b9){if(_0x3205b9){_0x3205b9[_0x2a3f('0x13')]({'lastMsgAt':_0x3809ed[_0x2a3f('0x14')],'lastMsgDirection':_0x3809ed['direction'][_0x2a3f('0xc')](),'lastMsgBody':_0x3809ed[_0x2a3f('0x15')]});}})[_0x2a3f('0x16')](function(_0x32dd84){console['error'](_0x32dd84);});}_0x3adb23();}},'charset':_0x2a3f('0x17'),'collate':_0x2a3f('0x18')});}; \ No newline at end of file +var _0x4f34=['then','update','createdAt','body','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./chatMessage.attributes','define','ChatMessage','chat_messages','models','get','direction','toLowerCase','out','ChatInteraction','findOne'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f34,0xae));var _0x44f3=function(_0x8dc508,_0x2e43e0){_0x8dc508=_0x8dc508-0x0;var _0x387733=_0x4f34[_0x8dc508];return _0x387733;};'use strict';var _=require(_0x44f3('0x0'));var util=require(_0x44f3('0x1'));var logger=require(_0x44f3('0x2'))(_0x44f3('0x3'));var moment=require(_0x44f3('0x4'));var BPromise=require(_0x44f3('0x5'));var rp=require(_0x44f3('0x6'));var attributes=require(_0x44f3('0x7'));module['exports']=function(_0x3c5e88,_0x33b6ac){return _0x3c5e88[_0x44f3('0x8')](_0x44f3('0x9'),attributes,{'tableName':_0x44f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xc9527e,_0x5ddf10,_0x3e28f4){var _0x5bcf28=_0x3c5e88[_0x44f3('0xb')];var _0x3df47b=_0xc9527e[_0x44f3('0xc')]({'plain':!![]});if(_0x3df47b[_0x44f3('0xd')][_0x44f3('0xe')]()==='in'||_0x3df47b[_0x44f3('0xd')][_0x44f3('0xe')]()===_0x44f3('0xf')&&!_0x3df47b['secret']&&!_['isNil'](_0x3df47b['UserId'])){_0x5bcf28[_0x44f3('0x10')][_0x44f3('0x11')]({'where':{'id':_0x3df47b['ChatInteractionId']}})[_0x44f3('0x12')](function(_0xd78d84){if(_0xd78d84){_0xd78d84[_0x44f3('0x13')]({'lastMsgAt':_0x3df47b[_0x44f3('0x14')],'lastMsgDirection':_0x3df47b[_0x44f3('0xd')][_0x44f3('0xe')](),'lastMsgBody':_0x3df47b[_0x44f3('0x15')]});}})['catch'](function(_0x125c76){console[_0x44f3('0x16')](_0x125c76);});}_0x3e28f4();}},'charset':'utf8mb4','collate':_0x44f3('0x17')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 99310f6..b15137a 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 _0x941e=['debug','stringify','error','code','message','info','result','CreateChatMessage','ChatMessage','create','body','options','raw','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','socket.io-emitter','register','then','ChatMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x24dfb7,_0x2bf1bf){var _0x525851=function(_0xa8a946){while(--_0xa8a946){_0x24dfb7['push'](_0x24dfb7['shift']());}};_0x525851(++_0x2bf1bf);}(_0x941e,0x151));var _0xe941=function(_0x3c0682,_0x478fe0){_0x3c0682=_0x3c0682-0x0;var _0x4d0300=_0x941e[_0x3c0682];return _0x4d0300;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe941('0x0'));var BPromise=require(_0xe941('0x1'));var rs=require(_0xe941('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe941('0x3'));var logger=require(_0xe941('0x4'))('rpc');var config=require(_0xe941('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe941('0x6')]({'port':0x232a});config[_0xe941('0x7')]=_[_0xe941('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe941('0x9'))(new Redis(config[_0xe941('0x7')]));require('./chatMessage.socket')[_0xe941('0xa')](socket);function respondWithRpcPromise(_0x49d4d7,_0x7d97ba,_0x4bd8be){return new BPromise(function(_0x3aee08,_0x415717){return client['request'](_0x49d4d7,_0x4bd8be)[_0xe941('0xb')](function(_0xd24d34){logger['info'](_0xe941('0xc'),_0x7d97ba,_0xe941('0xd'));logger[_0xe941('0xe')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x7d97ba,_0xe941('0xd'),JSON[_0xe941('0xf')](_0xd24d34));if(_0xd24d34[_0xe941('0x10')]){if(_0xd24d34[_0xe941('0x10')][_0xe941('0x11')]===0x1f4){logger[_0xe941('0x10')](_0xe941('0xc'),_0x7d97ba,_0xd24d34[_0xe941('0x10')][_0xe941('0x12')]);return _0x415717(_0xd24d34[_0xe941('0x10')][_0xe941('0x12')]);}logger[_0xe941('0x10')](_0xe941('0xc'),_0x7d97ba,_0xd24d34[_0xe941('0x10')][_0xe941('0x12')]);return _0x3aee08(_0xd24d34['error'][_0xe941('0x12')]);}else{logger[_0xe941('0x13')]('ChatMessage,\x20%s,\x20%s',_0x7d97ba,'request\x20sent');_0x3aee08(_0xd24d34[_0xe941('0x14')][_0xe941('0x12')]);}})['catch'](function(_0x529dea){logger[_0xe941('0x10')](_0xe941('0xc'),_0x7d97ba,_0x529dea);_0x415717(_0x529dea);});});}exports[_0xe941('0x15')]=function(_0x4fa8e9){var _0x1c436a=this;return new Promise(function(_0xaecb67,_0x2b027b){return db[_0xe941('0x16')][_0xe941('0x17')](_0x4fa8e9[_0xe941('0x18')],{'raw':_0x4fa8e9['options']?_0x4fa8e9[_0xe941('0x19')][_0xe941('0x1a')]===undefined?!![]:![]:!![]})[_0xe941('0xb')](function(_0x4b0893){logger[_0xe941('0x13')](_0xe941('0x15'),_0x4fa8e9);logger[_0xe941('0xe')](_0xe941('0x15'),_0x4fa8e9,JSON['stringify'](_0x4b0893));_0xaecb67(_0x4b0893);})['catch'](function(_0x18c995){logger['error'](_0xe941('0x15'),_0x18c995['message'],_0x4fa8e9);_0x2b027b(_0x1c436a[_0xe941('0x10')](0x1f4,_0x18c995[_0xe941('0x12')]));});});}; \ No newline at end of file +var _0x4369=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','lodash','util'];(function(_0x13b330,_0x297092){var _0x1f666c=function(_0x5ebc84){while(--_0x5ebc84){_0x13b330['push'](_0x13b330['shift']());}};_0x1f666c(++_0x297092);}(_0x4369,0xec));var _0x9436=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0x4369[_0x3acee8];return _0x5046cc;};'use strict';var _=require(_0x9436('0x0'));var util=require(_0x9436('0x1'));var moment=require('moment');var BPromise=require(_0x9436('0x2'));var rs=require(_0x9436('0x3'));var fs=require('fs');var Redis=require(_0x9436('0x4'));var db=require(_0x9436('0x5'))['db'];var utils=require(_0x9436('0x6'));var logger=require(_0x9436('0x7'))(_0x9436('0x8'));var config=require(_0x9436('0x9'));var jayson=require(_0x9436('0xa'));var client=jayson[_0x9436('0xb')][_0x9436('0xc')]({'port':0x232a});config[_0x9436('0xd')]=_['defaults'](config[_0x9436('0xd')],{'host':_0x9436('0xe'),'port':0x18eb});var socket=require(_0x9436('0xf'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x9436('0x10')](socket);function respondWithRpcPromise(_0x3f5a1c,_0x81f35e,_0x29f826){return new BPromise(function(_0x168143,_0x17ce36){return client[_0x9436('0x11')](_0x3f5a1c,_0x29f826)[_0x9436('0x12')](function(_0x1f07d){logger[_0x9436('0x13')](_0x9436('0x14'),_0x81f35e,'request\x20sent');logger[_0x9436('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x81f35e,'request\x20sent',JSON['stringify'](_0x1f07d));if(_0x1f07d[_0x9436('0x16')]){if(_0x1f07d[_0x9436('0x16')][_0x9436('0x17')]===0x1f4){logger[_0x9436('0x16')](_0x9436('0x14'),_0x81f35e,_0x1f07d[_0x9436('0x16')]['message']);return _0x17ce36(_0x1f07d['error'][_0x9436('0x18')]);}logger[_0x9436('0x16')](_0x9436('0x14'),_0x81f35e,_0x1f07d['error'][_0x9436('0x18')]);return _0x168143(_0x1f07d[_0x9436('0x16')][_0x9436('0x18')]);}else{logger[_0x9436('0x13')](_0x9436('0x14'),_0x81f35e,'request\x20sent');_0x168143(_0x1f07d[_0x9436('0x19')][_0x9436('0x18')]);}})[_0x9436('0x1a')](function(_0x2781aa){logger[_0x9436('0x16')](_0x9436('0x14'),_0x81f35e,_0x2781aa);_0x17ce36(_0x2781aa);});});}exports[_0x9436('0x1b')]=function(_0x1da79c){var _0x1ffbcd=this;return new Promise(function(_0x2c6ca3,_0x576f72){return db[_0x9436('0x1c')][_0x9436('0x1d')](_0x1da79c[_0x9436('0x1e')],{'raw':_0x1da79c[_0x9436('0x1f')]?_0x1da79c[_0x9436('0x1f')][_0x9436('0x20')]===undefined?!![]:![]:!![]})[_0x9436('0x12')](function(_0x442a49){logger[_0x9436('0x13')]('CreateChatMessage',_0x1da79c);logger[_0x9436('0x15')](_0x9436('0x1b'),_0x1da79c,JSON[_0x9436('0x21')](_0x442a49));_0x2c6ca3(_0x442a49);})['catch'](function(_0x41fe09){logger[_0x9436('0x16')](_0x9436('0x1b'),_0x41fe09[_0x9436('0x18')],_0x1da79c);_0x576f72(_0x1ffbcd[_0x9436('0x16')](0x1f4,_0x41fe09['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 476b37b..1d5c361 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 _0x55ca=['removeListener','register','./chatMessage.events','save'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x55ca,0x126));var _0xa55c=function(_0x5f3094,_0x33af18){_0x5f3094=_0x5f3094-0x0;var _0x2b452d=_0x55ca[_0x5f3094];return _0x2b452d;};'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 +var _0xedd9=['removeListener','register','length','chatMessage:','save','remove','update','emit'];(function(_0x1ace9c,_0xc832d3){var _0x322cb3=function(_0x5d9983){while(--_0x5d9983){_0x1ace9c['push'](_0x1ace9c['shift']());}};_0x322cb3(++_0xc832d3);}(_0xedd9,0xfc));var _0x9edd=function(_0x5969b1,_0x8cb0d5){_0x5969b1=_0x5969b1-0x0;var _0x1dd7be=_0xedd9[_0x5969b1];return _0x1dd7be;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){ChatMessageEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);ChatMessageEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 97a2e8f..6c85a04 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 _0xafea=['put','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','chat','chatmessage:create','create','update','/:id/accept'];(function(_0xfd2f2c,_0x5e90cf){var _0x4c359e=function(_0x4734ba){while(--_0x4734ba){_0xfd2f2c['push'](_0xfd2f2c['shift']());}};_0x4c359e(++_0x5e90cf);}(_0xafea,0xee));var _0xaafe=function(_0x506e4c,_0x854a7b){_0x506e4c=_0x506e4c-0x0;var _0x10aec1=_0xafea[_0x506e4c];return _0x10aec1;};'use strict';var multer=require(_0xaafe('0x0'));var util=require(_0xaafe('0x1'));var path=require(_0xaafe('0x2'));var timeout=require(_0xaafe('0x3'));var express=require(_0xaafe('0x4'));var router=express[_0xaafe('0x5')]();var auth=require(_0xaafe('0x6'));var interaction=require(_0xaafe('0x7'));var config=require(_0xaafe('0x8'));var controller=require(_0xaafe('0x9'));router[_0xaafe('0xa')]('/',auth[_0xaafe('0xb')](),controller[_0xaafe('0xc')]);router['get'](_0xaafe('0xd'),auth['isAuthenticated'](),controller[_0xaafe('0xe')]);router[_0xaafe('0xa')](_0xaafe('0xf'),auth[_0xaafe('0xb')](),controller[_0xaafe('0x10')]);router[_0xaafe('0x11')]('/',auth[_0xaafe('0xb')](),interaction['tracked'](_0xaafe('0x12'),_0xaafe('0x13')),controller[_0xaafe('0x14')]);router['put']('/:id',controller[_0xaafe('0x15')]);router['put'](_0xaafe('0x16'),auth[_0xaafe('0xb')](),controller['accept']);router[_0xaafe('0x17')](_0xaafe('0x18'),auth[_0xaafe('0xb')](),controller[_0xaafe('0x19')]);router[_0xaafe('0x1a')](_0xaafe('0xf'),auth['isAuthenticated'](),controller[_0xaafe('0x1b')]);module[_0xaafe('0x1c')]=router; \ No newline at end of file +var _0xfc9b=['express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','chat','chatmessage:create','create','put','update','/:id/accept','reject','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc9b,0x74));var _0xbfc9=function(_0x4e1c41,_0x2043ef){_0x4e1c41=_0x4e1c41-0x0;var _0x466bd5=_0xfc9b[_0x4e1c41];return _0x466bd5;};'use strict';var multer=require(_0xbfc9('0x0'));var util=require(_0xbfc9('0x1'));var path=require(_0xbfc9('0x2'));var timeout=require(_0xbfc9('0x3'));var express=require(_0xbfc9('0x4'));var router=express[_0xbfc9('0x5')]();var auth=require(_0xbfc9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbfc9('0x7'));var controller=require('./chatMessage.controller');router[_0xbfc9('0x8')]('/',auth[_0xbfc9('0x9')](),controller['index']);router[_0xbfc9('0x8')](_0xbfc9('0xa'),auth[_0xbfc9('0x9')](),controller[_0xbfc9('0xb')]);router['get'](_0xbfc9('0xc'),auth['isAuthenticated'](),controller[_0xbfc9('0xd')]);router['post']('/',auth[_0xbfc9('0x9')](),interaction['tracked'](_0xbfc9('0xe'),_0xbfc9('0xf')),controller[_0xbfc9('0x10')]);router[_0xbfc9('0x11')](_0xbfc9('0xc'),controller[_0xbfc9('0x12')]);router['put'](_0xbfc9('0x13'),auth[_0xbfc9('0x9')](),controller['accept']);router[_0xbfc9('0x11')]('/:id/reject',auth[_0xbfc9('0x9')](),controller[_0xbfc9('0x14')]);router[_0xbfc9('0x15')](_0xbfc9('0xc'),auth['isAuthenticated'](),controller[_0xbfc9('0x16')]);module[_0xbfc9('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index c96b23d..44b6899 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 _0xe12f=['TEXT','medium','sequelize'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xe12f,0x176));var _0xfe12=function(_0xd1a570,_0x3c09e6){_0xd1a570=_0xd1a570-0x0;var _0x16dae9=_0xe12f[_0xd1a570];return _0x16dae9;};'use strict';var Sequelize=require(_0xfe12('0x0'));module['exports']={'body':{'type':Sequelize[_0xfe12('0x1')](_0xfe12('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x5f02=['medium','sequelize','TEXT'];(function(_0x243fd3,_0x25e8d3){var _0x1575b7=function(_0x44d893){while(--_0x44d893){_0x243fd3['push'](_0x243fd3['shift']());}};_0x1575b7(++_0x25e8d3);}(_0x5f02,0x160));var _0x25f0=function(_0x2c5712,_0x4ae482){_0x2c5712=_0x2c5712-0x0;var _0x512717=_0x5f02[_0x2c5712];return _0x512717;};'use strict';var Sequelize=require(_0x25f0('0x0'));module['exports']={'body':{'type':Sequelize[_0x25f0('0x1')](_0x25f0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 9a3d38f..5eb52a7 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 _0x664e=['type','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','find','catch','create','body','params','describe','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','rawAttributes','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0x664e,0x1cb));var _0xe664=function(_0x2770d6,_0x1bea0f){_0x2770d6=_0x2770d6-0x0;var _0x11b45a=_0x664e[_0x2770d6];return _0x11b45a;};'use strict';var pdf=require(_0xe664('0x0'));var emlformat=require(_0xe664('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe664('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe664('0x3'));var moment=require('moment');var BPromise=require(_0xe664('0x4'));var Mustache=require(_0xe664('0x5'));var util=require('util');var path=require(_0xe664('0x6'));var sox=require(_0xe664('0x7'));var csv=require(_0xe664('0x8'));var ejs=require(_0xe664('0x9'));var fs=require('fs');var _=require(_0xe664('0xa'));var squel=require(_0xe664('0xb'));var crypto=require(_0xe664('0xc'));var jsforce=require(_0xe664('0xd'));var deskjs=require(_0xe664('0xe'));var toCsv=require(_0xe664('0x8'));var querystring=require(_0xe664('0xf'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xe664('0x10'));var Redis=require(_0xe664('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xe664('0x12'))(_0xe664('0x13'));var utils=require(_0xe664('0x14'));var config=require(_0xe664('0x15'));var db=require(_0xe664('0x16'))['db'];function respondWithStatusCode(_0x203689,_0x1aa62e){_0x1aa62e=_0x1aa62e||0xcc;return function(_0x2a4489){if(_0x2a4489){return _0x203689[_0xe664('0x17')](_0x1aa62e);}return _0x203689['status'](_0x1aa62e)[_0xe664('0x18')]();};}function respondWithResult(_0x3dd5f4,_0x2a9ad0){_0x2a9ad0=_0x2a9ad0||0xc8;return function(_0x118997){if(_0x118997){return _0x3dd5f4[_0xe664('0x19')](_0x2a9ad0)[_0xe664('0x1a')](_0x118997);}};}function respondWithFilteredResult(_0x60a988,_0x279af8){return function(_0xa916c8){if(_0xa916c8){var _0x18e5e4=_0xa916c8['count'],_0x17b180=_0x279af8['offset'],_0x541ec2=_0x279af8[_0xe664('0x1b')]+_0x279af8['limit'],_0x5764f1;if(_0x541ec2>=_0x18e5e4){_0x541ec2=_0x18e5e4;_0x5764f1=0xc8;}else{_0x5764f1=0xce;}_0x60a988[_0xe664('0x19')](_0x5764f1);return _0x60a988[_0xe664('0x1c')](_0xe664('0x1d'),_0x17b180+'-'+_0x541ec2+'/'+_0x18e5e4)[_0xe664('0x1a')](_0xa916c8);}return null;};}function patchUpdates(_0x3e293d){return function(_0xc35c54){try{jsonpatch[_0xe664('0x1e')](_0xc35c54,_0x3e293d,!![]);}catch(_0x3ac419){return BPromise[_0xe664('0x1f')](_0x3ac419);}return _0xc35c54['save']();};}function saveUpdates(_0x11eeba,_0x5b8b35){return function(_0x10e7a4){if(_0x10e7a4){return _0x10e7a4[_0xe664('0x20')](_0x11eeba)[_0xe664('0x21')](function(_0xcc740d){return _0xcc740d;});}return null;};}function removeEntity(_0x3a07d6,_0x5b8f4d){return function(_0x572379){if(_0x572379){return _0x572379[_0xe664('0x22')]()[_0xe664('0x21')](function(){_0x3a07d6[_0xe664('0x19')](0xcc)[_0xe664('0x18')]();});}};}function handleEntityNotFound(_0x495af8,_0x1f484e){return function(_0x296e4d){if(!_0x296e4d){_0x495af8[_0xe664('0x17')](0x194);}return _0x296e4d;};}function handleError(_0x20b0bf,_0x2e9079){_0x2e9079=_0x2e9079||0x1f4;return function(_0x254098){logger[_0xe664('0x23')](_0x254098[_0xe664('0x24')]);if(_0x254098[_0xe664('0x25')]){delete _0x254098[_0xe664('0x25')];}_0x20b0bf[_0xe664('0x19')](_0x2e9079)[_0xe664('0x26')](_0x254098);};}exports[_0xe664('0x27')]=function(_0x297c48,_0x237616){var _0x32496f={},_0x5b8145={},_0x32f50e={'count':0x0,'rows':[]};var _0x5ed23a=db[_0xe664('0x28')][_0xe664('0x29')];_0x5b8145['model']=_['keys'](_0x5ed23a);_0x5b8145['query']=_[_0xe664('0x2a')](_0x297c48['query']);_0x5b8145[_0xe664('0x2b')]=_[_0xe664('0x2c')](_0x5b8145['model'],_0x5b8145[_0xe664('0x2d')]);_0x32496f[_0xe664('0x2e')]=_[_0xe664('0x2c')](_0x5b8145[_0xe664('0x2f')],qs[_0xe664('0x30')](_0x297c48['query'][_0xe664('0x30')]));_0x32496f['attributes']=_0x32496f[_0xe664('0x2e')][_0xe664('0x31')]?_0x32496f[_0xe664('0x2e')]:_0x5b8145[_0xe664('0x2f')];if(!_0x297c48[_0xe664('0x2d')][_0xe664('0x32')](_0xe664('0x33'))){_0x32496f[_0xe664('0x34')]=qs[_0xe664('0x34')](_0x297c48[_0xe664('0x2d')][_0xe664('0x34')]);_0x32496f['offset']=qs[_0xe664('0x1b')](_0x297c48['query'][_0xe664('0x1b')]);}_0x32496f[_0xe664('0x35')]=qs[_0xe664('0x36')](_0x297c48[_0xe664('0x2d')][_0xe664('0x36')]);_0x32496f[_0xe664('0x37')]=qs[_0xe664('0x2b')](_[_0xe664('0x38')](_0x297c48['query'],_0x5b8145[_0xe664('0x2b')]));if(_0x297c48[_0xe664('0x2d')]['filter']){_0x32496f['where']=_[_0xe664('0x39')](_0x32496f[_0xe664('0x37')],{'$or':_[_0xe664('0x3a')](_0x5ed23a,function(_0x12b577){if(_0x12b577[_0xe664('0x3b')]['key']!==_0xe664('0x3c')){var _0x4c4c2e={};_0x4c4c2e[_0x12b577[_0xe664('0x3d')]]={'$like':'%'+_0x297c48['query'][_0xe664('0x3e')]+'%'};return _0x4c4c2e;}})});}_0x32496f=_['merge']({},_0x32496f,_0x297c48[_0xe664('0x3f')]);var _0x861707={'where':_0x32496f[_0xe664('0x37')]};return db['ChatOfflineMessage']['count'](_0x861707)[_0xe664('0x21')](function(_0x2a064b){_0x32f50e['count']=_0x2a064b;if(_0x297c48[_0xe664('0x2d')][_0xe664('0x40')]){_0x32496f[_0xe664('0x41')]=[{'all':!![]}];}return db[_0xe664('0x28')][_0xe664('0x42')](_0x32496f);})[_0xe664('0x21')](function(_0x2ec0b9){_0x32f50e[_0xe664('0x43')]=_0x2ec0b9;return _0x32f50e;})['then'](respondWithFilteredResult(_0x237616,_0x32496f))['catch'](handleError(_0x237616,null));};exports['show']=function(_0x29be27,_0x26c0d2){var _0x13e33a={'raw':!![],'where':{'id':_0x29be27['params']['id']}},_0x33f4d4={};_0x33f4d4[_0xe664('0x2f')]=_['keys'](db[_0xe664('0x28')][_0xe664('0x29')]);_0x33f4d4[_0xe664('0x2d')]=_['keys'](_0x29be27['query']);_0x33f4d4[_0xe664('0x2b')]=_[_0xe664('0x2c')](_0x33f4d4['model'],_0x33f4d4['query']);_0x13e33a[_0xe664('0x2e')]=_[_0xe664('0x2c')](_0x33f4d4['model'],qs[_0xe664('0x30')](_0x29be27[_0xe664('0x2d')][_0xe664('0x30')]));_0x13e33a[_0xe664('0x2e')]=_0x13e33a['attributes']['length']?_0x13e33a[_0xe664('0x2e')]:_0x33f4d4[_0xe664('0x2f')];if(_0x29be27[_0xe664('0x2d')][_0xe664('0x40')]){_0x13e33a[_0xe664('0x41')]=[{'all':!![]}];}_0x13e33a=_[_0xe664('0x39')]({},_0x13e33a,_0x29be27[_0xe664('0x3f')]);return db[_0xe664('0x28')][_0xe664('0x44')](_0x13e33a)[_0xe664('0x21')](handleEntityNotFound(_0x26c0d2,null))[_0xe664('0x21')](respondWithResult(_0x26c0d2,null))[_0xe664('0x45')](handleError(_0x26c0d2,null));};exports[_0xe664('0x46')]=function(_0x3fbdcb,_0x2afc88){return db[_0xe664('0x28')][_0xe664('0x46')](_0x3fbdcb['body'],{})[_0xe664('0x21')](respondWithResult(_0x2afc88,0xc9))[_0xe664('0x45')](handleError(_0x2afc88,null));};exports['update']=function(_0x40c23e,_0x578d70){if(_0x40c23e[_0xe664('0x47')]['id']){delete _0x40c23e[_0xe664('0x47')]['id'];}return db[_0xe664('0x28')][_0xe664('0x44')]({'where':{'id':_0x40c23e[_0xe664('0x48')]['id']}})[_0xe664('0x21')](handleEntityNotFound(_0x578d70,null))[_0xe664('0x21')](saveUpdates(_0x40c23e['body'],null))[_0xe664('0x21')](respondWithResult(_0x578d70,null))[_0xe664('0x45')](handleError(_0x578d70,null));};exports[_0xe664('0x22')]=function(_0x3e61c6,_0x2564db){return db[_0xe664('0x28')][_0xe664('0x44')]({'where':{'id':_0x3e61c6[_0xe664('0x48')]['id']}})[_0xe664('0x21')](handleEntityNotFound(_0x2564db,null))['then'](removeEntity(_0x2564db,null))[_0xe664('0x45')](handleError(_0x2564db,null));};exports[_0xe664('0x49')]=function(_0xd5a647,_0x3b10a5){return db[_0xe664('0x28')][_0xe664('0x49')]()[_0xe664('0x21')](respondWithResult(_0x3b10a5,null))[_0xe664('0x45')](handleError(_0x3b10a5,null));}; \ No newline at end of file +var _0x13af=['jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','offset','limit','set','json','reject','save','destroy','status','error','name','index','ChatOfflineMessage','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','key','VIRTUAL','field','options','then','count','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','update','eml-format','request-promise','moment','bluebird','path','sox','to-csv','ejs','crypto'];(function(_0x51f6bb,_0x20ce4c){var _0x4acef1=function(_0x3a0a45){while(--_0x3a0a45){_0x51f6bb['push'](_0x51f6bb['shift']());}};_0x4acef1(++_0x20ce4c);}(_0x13af,0x1b7));var _0xf13a=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x13af[_0x576170];return _0x397c70;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf13a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf13a('0x1'));var moment=require(_0xf13a('0x2'));var BPromise=require(_0xf13a('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf13a('0x4'));var sox=require(_0xf13a('0x5'));var csv=require(_0xf13a('0x6'));var ejs=require(_0xf13a('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf13a('0x8'));var jsforce=require(_0xf13a('0x9'));var deskjs=require(_0xf13a('0xa'));var toCsv=require('to-csv');var querystring=require(_0xf13a('0xb'));var Papa=require(_0xf13a('0xc'));var authService=require('../../components/auth/service');var hardwareService=require(_0xf13a('0xd'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xf13a('0xe'))(_0xf13a('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf13a('0x10'))['db'];function respondWithStatusCode(_0x16ff64,_0x30c670){_0x30c670=_0x30c670||0xcc;return function(_0x1a232f){if(_0x1a232f){return _0x16ff64[_0xf13a('0x11')](_0x30c670);}return _0x16ff64['status'](_0x30c670)[_0xf13a('0x12')]();};}function respondWithResult(_0x23337c,_0x41cfbb){_0x41cfbb=_0x41cfbb||0xc8;return function(_0x4a1d0c){if(_0x4a1d0c){return _0x23337c['status'](_0x41cfbb)['json'](_0x4a1d0c);}};}function respondWithFilteredResult(_0x211ad3,_0x57579d){return function(_0x27379a){if(_0x27379a){var _0x3ab4c4=_0x27379a['count'],_0x212718=_0x57579d[_0xf13a('0x13')],_0x24765d=_0x57579d[_0xf13a('0x13')]+_0x57579d[_0xf13a('0x14')],_0x2e5f47;if(_0x24765d>=_0x3ab4c4){_0x24765d=_0x3ab4c4;_0x2e5f47=0xc8;}else{_0x2e5f47=0xce;}_0x211ad3['status'](_0x2e5f47);return _0x211ad3[_0xf13a('0x15')]('Content-Range',_0x212718+'-'+_0x24765d+'/'+_0x3ab4c4)[_0xf13a('0x16')](_0x27379a);}return null;};}function patchUpdates(_0x2b984f){return function(_0x4231a9){try{jsonpatch['apply'](_0x4231a9,_0x2b984f,!![]);}catch(_0x48df2d){return BPromise[_0xf13a('0x17')](_0x48df2d);}return _0x4231a9[_0xf13a('0x18')]();};}function saveUpdates(_0x273535,_0xeccdb){return function(_0x6292d7){if(_0x6292d7){return _0x6292d7['update'](_0x273535)['then'](function(_0x1c46d2){return _0x1c46d2;});}return null;};}function removeEntity(_0x1d587b,_0x44cac1){return function(_0x5c9086){if(_0x5c9086){return _0x5c9086[_0xf13a('0x19')]()['then'](function(){_0x1d587b[_0xf13a('0x1a')](0xcc)[_0xf13a('0x12')]();});}};}function handleEntityNotFound(_0x37fec3,_0x3fe102){return function(_0x548a22){if(!_0x548a22){_0x37fec3[_0xf13a('0x11')](0x194);}return _0x548a22;};}function handleError(_0xff4a4e,_0x3d873b){_0x3d873b=_0x3d873b||0x1f4;return function(_0x4b0e7d){logger[_0xf13a('0x1b')](_0x4b0e7d['stack']);if(_0x4b0e7d[_0xf13a('0x1c')]){delete _0x4b0e7d[_0xf13a('0x1c')];}_0xff4a4e[_0xf13a('0x1a')](_0x3d873b)['send'](_0x4b0e7d);};}exports[_0xf13a('0x1d')]=function(_0x5ca65b,_0x53d916){var _0x4c1594={},_0xcdea40={},_0x170be9={'count':0x0,'rows':[]};var _0x2d23fd=db[_0xf13a('0x1e')]['rawAttributes'];_0xcdea40[_0xf13a('0x1f')]=_['keys'](_0x2d23fd);_0xcdea40[_0xf13a('0x20')]=_['keys'](_0x5ca65b[_0xf13a('0x20')]);_0xcdea40['filters']=_[_0xf13a('0x21')](_0xcdea40[_0xf13a('0x1f')],_0xcdea40['query']);_0x4c1594[_0xf13a('0x22')]=_['intersection'](_0xcdea40[_0xf13a('0x1f')],qs[_0xf13a('0x23')](_0x5ca65b[_0xf13a('0x20')][_0xf13a('0x23')]));_0x4c1594[_0xf13a('0x22')]=_0x4c1594['attributes'][_0xf13a('0x24')]?_0x4c1594['attributes']:_0xcdea40[_0xf13a('0x1f')];if(!_0x5ca65b[_0xf13a('0x20')][_0xf13a('0x25')](_0xf13a('0x26'))){_0x4c1594['limit']=qs[_0xf13a('0x14')](_0x5ca65b[_0xf13a('0x20')][_0xf13a('0x14')]);_0x4c1594[_0xf13a('0x13')]=qs[_0xf13a('0x13')](_0x5ca65b[_0xf13a('0x20')]['offset']);}_0x4c1594['order']=qs[_0xf13a('0x27')](_0x5ca65b[_0xf13a('0x20')][_0xf13a('0x27')]);_0x4c1594['where']=qs[_0xf13a('0x28')](_[_0xf13a('0x29')](_0x5ca65b['query'],_0xcdea40[_0xf13a('0x28')]));if(_0x5ca65b[_0xf13a('0x20')][_0xf13a('0x2a')]){_0x4c1594[_0xf13a('0x2b')]=_[_0xf13a('0x2c')](_0x4c1594[_0xf13a('0x2b')],{'$or':_[_0xf13a('0x2d')](_0x2d23fd,function(_0x245bb3){if(_0x245bb3['type'][_0xf13a('0x2e')]!==_0xf13a('0x2f')){var _0x4bd691={};_0x4bd691[_0x245bb3[_0xf13a('0x30')]]={'$like':'%'+_0x5ca65b[_0xf13a('0x20')]['filter']+'%'};return _0x4bd691;}})});}_0x4c1594=_[_0xf13a('0x2c')]({},_0x4c1594,_0x5ca65b[_0xf13a('0x31')]);var _0x2986b9={'where':_0x4c1594[_0xf13a('0x2b')]};return db[_0xf13a('0x1e')]['count'](_0x2986b9)[_0xf13a('0x32')](function(_0x3a48b1){_0x170be9[_0xf13a('0x33')]=_0x3a48b1;if(_0x5ca65b['query'][_0xf13a('0x34')]){_0x4c1594[_0xf13a('0x35')]=[{'all':!![]}];}return db[_0xf13a('0x1e')][_0xf13a('0x36')](_0x4c1594);})['then'](function(_0x1d1715){_0x170be9[_0xf13a('0x37')]=_0x1d1715;return _0x170be9;})[_0xf13a('0x32')](respondWithFilteredResult(_0x53d916,_0x4c1594))['catch'](handleError(_0x53d916,null));};exports[_0xf13a('0x38')]=function(_0xc2a841,_0x42652f){var _0x18f32f={'raw':!![],'where':{'id':_0xc2a841[_0xf13a('0x39')]['id']}},_0x30aecf={};_0x30aecf[_0xf13a('0x1f')]=_[_0xf13a('0x3a')](db[_0xf13a('0x1e')]['rawAttributes']);_0x30aecf['query']=_[_0xf13a('0x3a')](_0xc2a841[_0xf13a('0x20')]);_0x30aecf[_0xf13a('0x28')]=_['intersection'](_0x30aecf[_0xf13a('0x1f')],_0x30aecf[_0xf13a('0x20')]);_0x18f32f[_0xf13a('0x22')]=_[_0xf13a('0x21')](_0x30aecf['model'],qs[_0xf13a('0x23')](_0xc2a841[_0xf13a('0x20')][_0xf13a('0x23')]));_0x18f32f['attributes']=_0x18f32f[_0xf13a('0x22')]['length']?_0x18f32f[_0xf13a('0x22')]:_0x30aecf[_0xf13a('0x1f')];if(_0xc2a841[_0xf13a('0x20')][_0xf13a('0x34')]){_0x18f32f[_0xf13a('0x35')]=[{'all':!![]}];}_0x18f32f=_['merge']({},_0x18f32f,_0xc2a841[_0xf13a('0x31')]);return db[_0xf13a('0x1e')][_0xf13a('0x3b')](_0x18f32f)[_0xf13a('0x32')](handleEntityNotFound(_0x42652f,null))[_0xf13a('0x32')](respondWithResult(_0x42652f,null))['catch'](handleError(_0x42652f,null));};exports[_0xf13a('0x3c')]=function(_0x1b9a0d,_0x161dbc){return db['ChatOfflineMessage']['create'](_0x1b9a0d[_0xf13a('0x3d')],{})[_0xf13a('0x32')](respondWithResult(_0x161dbc,0xc9))[_0xf13a('0x3e')](handleError(_0x161dbc,null));};exports[_0xf13a('0x3f')]=function(_0x2c6d06,_0x4afd0c){if(_0x2c6d06[_0xf13a('0x3d')]['id']){delete _0x2c6d06[_0xf13a('0x3d')]['id'];}return db[_0xf13a('0x1e')][_0xf13a('0x3b')]({'where':{'id':_0x2c6d06[_0xf13a('0x39')]['id']}})[_0xf13a('0x32')](handleEntityNotFound(_0x4afd0c,null))[_0xf13a('0x32')](saveUpdates(_0x2c6d06[_0xf13a('0x3d')],null))['then'](respondWithResult(_0x4afd0c,null))[_0xf13a('0x3e')](handleError(_0x4afd0c,null));};exports['destroy']=function(_0x161da6,_0xa0c9f2){return db[_0xf13a('0x1e')]['find']({'where':{'id':_0x161da6[_0xf13a('0x39')]['id']}})[_0xf13a('0x32')](handleEntityNotFound(_0xa0c9f2,null))[_0xf13a('0x32')](removeEntity(_0xa0c9f2,null))[_0xf13a('0x3e')](handleError(_0xa0c9f2,null));};exports['describe']=function(_0x140c88,_0x13e3be){return db['ChatOfflineMessage']['describe']()['then'](respondWithResult(_0x13e3be,null))['catch'](handleError(_0x13e3be,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 08d0833..1789c2c 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 _0x1ccc=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1ccc,0x1a5));var _0xc1cc=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x1ccc[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0xc1cc('0x0'));var util=require(_0xc1cc('0x1'));var logger=require(_0xc1cc('0x2'))(_0xc1cc('0x3'));var moment=require(_0xc1cc('0x4'));var BPromise=require(_0xc1cc('0x5'));var rp=require('request-promise');var attributes=require(_0xc1cc('0x6'));module[_0xc1cc('0x7')]=function(_0xd29c4e,_0x5222a9){return _0xd29c4e[_0xc1cc('0x8')]('ChatOfflineMessage',attributes,{'tableName':_0xc1cc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc1cc('0xa'),'collate':_0xc1cc('0xb')});}; \ No newline at end of file +var _0x18d4=['../../config/logger','api','moment','request-promise','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x473079,_0x4aa14b){var _0x138470=function(_0x4b68af){while(--_0x4b68af){_0x473079['push'](_0x473079['shift']());}};_0x138470(++_0x4aa14b);}(_0x18d4,0x171));var _0x418d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x18d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x418d('0x0'));var util=require('util');var logger=require(_0x418d('0x1'))(_0x418d('0x2'));var moment=require(_0x418d('0x3'));var BPromise=require('bluebird');var rp=require(_0x418d('0x4'));var attributes=require('./chatOfflineMessage.attributes');module[_0x418d('0x5')]=function(_0x5c3914,_0x143c95){return _0x5c3914['define'](_0x418d('0x6'),attributes,{'tableName':_0x418d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x418d('0x8'),'collate':_0x418d('0x9')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 6b31ced..f6a666c 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 _0x14c4=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','then','info','request\x20sent','debug','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch'];(function(_0x5b2c7e,_0x3d22f0){var _0x5ec399=function(_0x1a87ad){while(--_0x1a87ad){_0x5b2c7e['push'](_0x5b2c7e['shift']());}};_0x5ec399(++_0x3d22f0);}(_0x14c4,0x1c8));var _0x414c=function(_0x179b74,_0x5dc97d){_0x179b74=_0x179b74-0x0;var _0x268f76=_0x14c4[_0x179b74];return _0x268f76;};'use strict';var _=require(_0x414c('0x0'));var util=require(_0x414c('0x1'));var moment=require(_0x414c('0x2'));var BPromise=require(_0x414c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x414c('0x4'));var db=require(_0x414c('0x5'))['db'];var utils=require(_0x414c('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x414c('0x7'));var client=jayson['client'][_0x414c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b51d7,_0x4131cc,_0x3b007c){return new BPromise(function(_0x32280d,_0x13f6ed){return client['request'](_0x5b51d7,_0x3b007c)[_0x414c('0x9')](function(_0x148c09){logger[_0x414c('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4131cc,_0x414c('0xb'));logger[_0x414c('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x4131cc,_0x414c('0xb'),JSON['stringify'](_0x148c09));if(_0x148c09[_0x414c('0xd')]){if(_0x148c09[_0x414c('0xd')][_0x414c('0xe')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x4131cc,_0x148c09[_0x414c('0xd')][_0x414c('0xf')]);return _0x13f6ed(_0x148c09[_0x414c('0xd')]['message']);}logger[_0x414c('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4131cc,_0x148c09[_0x414c('0xd')][_0x414c('0xf')]);return _0x32280d(_0x148c09['error'][_0x414c('0xf')]);}else{logger[_0x414c('0xa')](_0x414c('0x10'),_0x4131cc,_0x414c('0xb'));_0x32280d(_0x148c09[_0x414c('0x11')]['message']);}})[_0x414c('0x12')](function(_0x43c329){logger[_0x414c('0xd')](_0x414c('0x10'),_0x4131cc,_0x43c329);_0x13f6ed(_0x43c329);});});} \ No newline at end of file +var _0x6a9c=['jayson/promise','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x404437,_0x2f0ef1){var _0x274d56=function(_0x5c0651){while(--_0x5c0651){_0x404437['push'](_0x404437['shift']());}};_0x274d56(++_0x2f0ef1);}(_0x6a9c,0xd4));var _0xc6a9=function(_0x20c5e6,_0x3c6a2e){_0x20c5e6=_0x20c5e6-0x0;var _0x113d30=_0x6a9c[_0x20c5e6];return _0x113d30;};'use strict';var _=require(_0xc6a9('0x0'));var util=require('util');var moment=require(_0xc6a9('0x1'));var BPromise=require(_0xc6a9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6a9('0x3'));var db=require(_0xc6a9('0x4'))['db'];var utils=require(_0xc6a9('0x5'));var logger=require('../../config/logger')(_0xc6a9('0x6'));var config=require(_0xc6a9('0x7'));var jayson=require(_0xc6a9('0x8'));var client=jayson['client'][_0xc6a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38a84d,_0x19d748,_0x2ba081){return new BPromise(function(_0x25dfae,_0x507bda){return client[_0xc6a9('0xa')](_0x38a84d,_0x2ba081)['then'](function(_0x2a37af){logger['info'](_0xc6a9('0xb'),_0x19d748,_0xc6a9('0xc'));logger[_0xc6a9('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x19d748,_0xc6a9('0xc'),JSON[_0xc6a9('0xe')](_0x2a37af));if(_0x2a37af[_0xc6a9('0xf')]){if(_0x2a37af['error'][_0xc6a9('0x10')]===0x1f4){logger[_0xc6a9('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x19d748,_0x2a37af['error'][_0xc6a9('0x11')]);return _0x507bda(_0x2a37af[_0xc6a9('0xf')][_0xc6a9('0x11')]);}logger[_0xc6a9('0xf')](_0xc6a9('0xb'),_0x19d748,_0x2a37af['error'][_0xc6a9('0x11')]);return _0x25dfae(_0x2a37af[_0xc6a9('0xf')]['message']);}else{logger[_0xc6a9('0x12')](_0xc6a9('0xb'),_0x19d748,_0xc6a9('0xc'));_0x25dfae(_0x2a37af['result'][_0xc6a9('0x11')]);}})[_0xc6a9('0x13')](function(_0x5c595a){logger['error'](_0xc6a9('0xb'),_0x19d748,_0x5c595a);_0x507bda(_0x5c595a);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index fb9bd1a..01bb104 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 _0x0dba=['show','post','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe'];(function(_0x4e1555,_0x5d81fd){var _0x1605e6=function(_0x30edbe){while(--_0x30edbe){_0x4e1555['push'](_0x4e1555['shift']());}};_0x1605e6(++_0x5d81fd);}(_0x0dba,0x136));var _0xa0db=function(_0xc1c0a,_0x32cee7){_0xc1c0a=_0xc1c0a-0x0;var _0xae4d95=_0x0dba[_0xc1c0a];return _0xae4d95;};'use strict';var multer=require(_0xa0db('0x0'));var util=require(_0xa0db('0x1'));var path=require(_0xa0db('0x2'));var timeout=require(_0xa0db('0x3'));var express=require(_0xa0db('0x4'));var router=express[_0xa0db('0x5')]();var auth=require(_0xa0db('0x6'));var interaction=require(_0xa0db('0x7'));var config=require(_0xa0db('0x8'));var controller=require(_0xa0db('0x9'));router[_0xa0db('0xa')]('/',auth[_0xa0db('0xb')](),controller['index']);router['get']('/describe',auth[_0xa0db('0xb')](),controller[_0xa0db('0xc')]);router[_0xa0db('0xa')]('/:id',auth[_0xa0db('0xb')](),controller[_0xa0db('0xd')]);router[_0xa0db('0xe')]('/',auth[_0xa0db('0xb')](),controller['create']);router[_0xa0db('0xf')](_0xa0db('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xa0db('0x11')](_0xa0db('0x10'),auth[_0xa0db('0xb')](),controller[_0xa0db('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb7c8=['Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','exports','util','path','connect-timeout','express'];(function(_0x30599b,_0x40c0e8){var _0x330496=function(_0x202f15){while(--_0x202f15){_0x30599b['push'](_0x30599b['shift']());}};_0x330496(++_0x40c0e8);}(_0xb7c8,0x119));var _0x8b7c=function(_0xd48697,_0x3c4b01){_0xd48697=_0xd48697-0x0;var _0xc7d73d=_0xb7c8[_0xd48697];return _0xc7d73d;};'use strict';var multer=require('multer');var util=require(_0x8b7c('0x0'));var path=require(_0x8b7c('0x1'));var timeout=require(_0x8b7c('0x2'));var express=require(_0x8b7c('0x3'));var router=express[_0x8b7c('0x4')]();var auth=require(_0x8b7c('0x5'));var interaction=require(_0x8b7c('0x6'));var config=require('../../config/environment');var controller=require(_0x8b7c('0x7'));router[_0x8b7c('0x8')]('/',auth[_0x8b7c('0x9')](),controller[_0x8b7c('0xa')]);router[_0x8b7c('0x8')](_0x8b7c('0xb'),auth[_0x8b7c('0x9')](),controller[_0x8b7c('0xc')]);router[_0x8b7c('0x8')](_0x8b7c('0xd'),auth[_0x8b7c('0x9')](),controller[_0x8b7c('0xe')]);router['post']('/',auth[_0x8b7c('0x9')](),controller['create']);router[_0x8b7c('0xf')](_0x8b7c('0xd'),auth['isAuthenticated'](),controller[_0x8b7c('0x10')]);router[_0x8b7c('0x11')](_0x8b7c('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x8b7c('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index ca0e87f..9b93172 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 _0x6a21=['STRING','mouseOver','timeout','INTEGER','exports'];(function(_0x558dc5,_0x38568d){var _0x3ad2c1=function(_0x25c1bd){while(--_0x25c1bd){_0x558dc5['push'](_0x558dc5['shift']());}};_0x3ad2c1(++_0x38568d);}(_0x6a21,0xf9));var _0x16a2=function(_0x2e2b29,_0x134c80){_0x2e2b29=_0x2e2b29-0x0;var _0x3eeb9a=_0x6a21[_0x2e2b29];return _0x3eeb9a;};'use strict';var Sequelize=require('sequelize');module[_0x16a2('0x0')]={'name':{'type':Sequelize[_0x16a2('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x16a2('0x2'),_0x16a2('0x3')),'defaultValue':_0x16a2('0x2')},'selector':{'type':Sequelize[_0x16a2('0x1')]},'timeout':{'type':Sequelize[_0x16a2('0x4')]}}; \ No newline at end of file +var _0x54bb=['mouseOver','timeout','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0x54bb,0xb2));var _0xb54b=function(_0x53468a,_0x286986){_0x53468a=_0x53468a-0x0;var _0x205efd=_0x54bb[_0x53468a];return _0x205efd;};'use strict';var Sequelize=require(_0xb54b('0x0'));module[_0xb54b('0x1')]={'name':{'type':Sequelize[_0xb54b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb54b('0x3')](_0xb54b('0x4'),_0xb54b('0x5')),'defaultValue':_0xb54b('0x4')},'selector':{'type':Sequelize[_0xb54b('0x2')]},'timeout':{'type':Sequelize[_0xb54b('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index d116a11..2431045 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 _0x8d57=['rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8d57,0xfe));var _0x78d5=function(_0x1e6e4e,_0x2b1b09){_0x1e6e4e=_0x1e6e4e-0x0;var _0x3d746b=_0x8d57[_0x1e6e4e];return _0x3d746b;};'use strict';var pdf=require(_0x78d5('0x0'));var emlformat=require(_0x78d5('0x1'));var rimraf=require(_0x78d5('0x2'));var zipdir=require(_0x78d5('0x3'));var jsonpatch=require(_0x78d5('0x4'));var rp=require(_0x78d5('0x5'));var moment=require(_0x78d5('0x6'));var BPromise=require(_0x78d5('0x7'));var Mustache=require(_0x78d5('0x8'));var util=require(_0x78d5('0x9'));var path=require(_0x78d5('0xa'));var sox=require('sox');var csv=require(_0x78d5('0xb'));var ejs=require(_0x78d5('0xc'));var fs=require('fs');var _=require(_0x78d5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x78d5('0xe'));var deskjs=require(_0x78d5('0xf'));var toCsv=require(_0x78d5('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x78d5('0x10'));var hardwareService=require(_0x78d5('0x11'));var Redis=require(_0x78d5('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x78d5('0x13'))(_0x78d5('0x14'));var utils=require(_0x78d5('0x15'));var config=require('../../config/environment');var db=require(_0x78d5('0x16'))['db'];function respondWithStatusCode(_0x14e7bb,_0xdac4e1){_0xdac4e1=_0xdac4e1||0xcc;return function(_0x14e516){if(_0x14e516){return _0x14e7bb[_0x78d5('0x17')](_0xdac4e1);}return _0x14e7bb[_0x78d5('0x18')](_0xdac4e1)[_0x78d5('0x19')]();};}function respondWithResult(_0x26203a,_0x4ce12c){_0x4ce12c=_0x4ce12c||0xc8;return function(_0x1f0501){if(_0x1f0501){return _0x26203a[_0x78d5('0x18')](_0x4ce12c)[_0x78d5('0x1a')](_0x1f0501);}};}function respondWithFilteredResult(_0x235b9b,_0x145846){return function(_0x433577){if(_0x433577){var _0x2256c9=_0x433577[_0x78d5('0x1b')],_0xf7c34f=_0x145846['offset'],_0x2aca4f=_0x145846[_0x78d5('0x1c')]+_0x145846[_0x78d5('0x1d')],_0x5ac1c4;if(_0x2aca4f>=_0x2256c9){_0x2aca4f=_0x2256c9;_0x5ac1c4=0xc8;}else{_0x5ac1c4=0xce;}_0x235b9b[_0x78d5('0x18')](_0x5ac1c4);return _0x235b9b[_0x78d5('0x1e')](_0x78d5('0x1f'),_0xf7c34f+'-'+_0x2aca4f+'/'+_0x2256c9)[_0x78d5('0x1a')](_0x433577);}return null;};}function patchUpdates(_0x15a5bb){return function(_0x4e4599){try{jsonpatch[_0x78d5('0x20')](_0x4e4599,_0x15a5bb,!![]);}catch(_0x36a52c){return BPromise[_0x78d5('0x21')](_0x36a52c);}return _0x4e4599[_0x78d5('0x22')]();};}function saveUpdates(_0x5b2c21,_0x3cb125){return function(_0x2f34ee){if(_0x2f34ee){return _0x2f34ee[_0x78d5('0x23')](_0x5b2c21)[_0x78d5('0x24')](function(_0x37f4c6){return _0x37f4c6;});}return null;};}function removeEntity(_0x1e565e,_0x3dfaa1){return function(_0x49a98b){if(_0x49a98b){return _0x49a98b[_0x78d5('0x25')]()[_0x78d5('0x24')](function(){_0x1e565e['status'](0xcc)[_0x78d5('0x19')]();});}};}function handleEntityNotFound(_0x2f41bc,_0x299af6){return function(_0x3c57a8){if(!_0x3c57a8){_0x2f41bc[_0x78d5('0x17')](0x194);}return _0x3c57a8;};}function handleError(_0x167474,_0x42f0ee){_0x42f0ee=_0x42f0ee||0x1f4;return function(_0x1e13a3){logger[_0x78d5('0x26')](_0x1e13a3['stack']);if(_0x1e13a3['name']){delete _0x1e13a3[_0x78d5('0x27')];}_0x167474['status'](_0x42f0ee)[_0x78d5('0x28')](_0x1e13a3);};}exports[_0x78d5('0x29')]=function(_0x185c4a,_0x35a0d9){var _0x45350a={'raw':!![],'where':{'id':_0x185c4a[_0x78d5('0x2a')]['id']}},_0x2a00d2={};_0x2a00d2[_0x78d5('0x2b')]=_[_0x78d5('0x2c')](db[_0x78d5('0x2d')][_0x78d5('0x2e')]);_0x2a00d2[_0x78d5('0x2f')]=_[_0x78d5('0x2c')](_0x185c4a[_0x78d5('0x2f')]);_0x2a00d2['filters']=_[_0x78d5('0x30')](_0x2a00d2[_0x78d5('0x2b')],_0x2a00d2[_0x78d5('0x2f')]);_0x45350a['attributes']=_['intersection'](_0x2a00d2[_0x78d5('0x2b')],qs[_0x78d5('0x31')](_0x185c4a[_0x78d5('0x2f')][_0x78d5('0x31')]));_0x45350a['attributes']=_0x45350a[_0x78d5('0x32')][_0x78d5('0x33')]?_0x45350a[_0x78d5('0x32')]:_0x2a00d2[_0x78d5('0x2b')];if(_0x185c4a['query'][_0x78d5('0x34')]){_0x45350a[_0x78d5('0x35')]=[{'all':!![]}];}_0x45350a=_[_0x78d5('0x36')]({},_0x45350a,_0x185c4a[_0x78d5('0x37')]);return db[_0x78d5('0x2d')][_0x78d5('0x38')](_0x45350a)['then'](handleEntityNotFound(_0x35a0d9,null))['then'](respondWithResult(_0x35a0d9,null))[_0x78d5('0x39')](handleError(_0x35a0d9,null));};exports[_0x78d5('0x3a')]=function(_0x523bd8,_0x3749ea){return db[_0x78d5('0x2d')][_0x78d5('0x3a')](_0x523bd8[_0x78d5('0x3b')],{})[_0x78d5('0x24')](respondWithResult(_0x3749ea,0xc9))[_0x78d5('0x39')](handleError(_0x3749ea,null));};exports['update']=function(_0x3e68d3,_0x2b57eb){if(_0x3e68d3[_0x78d5('0x3b')]['id']){delete _0x3e68d3['body']['id'];}return db[_0x78d5('0x2d')]['find']({'where':{'id':_0x3e68d3[_0x78d5('0x2a')]['id']}})[_0x78d5('0x24')](handleEntityNotFound(_0x2b57eb,null))[_0x78d5('0x24')](saveUpdates(_0x3e68d3['body'],null))[_0x78d5('0x24')](respondWithResult(_0x2b57eb,null))[_0x78d5('0x39')](handleError(_0x2b57eb,null));};exports[_0x78d5('0x25')]=function(_0x145d47,_0x285bdf){return db[_0x78d5('0x2d')][_0x78d5('0x38')]({'where':{'id':_0x145d47[_0x78d5('0x2a')]['id']}})[_0x78d5('0x24')](handleEntityNotFound(_0x285bdf,null))[_0x78d5('0x24')](removeEntity(_0x285bdf,null))[_0x78d5('0x39')](handleError(_0x285bdf,null));}; \ No newline at end of file +var _0x0a09=['set','Content-Range','apply','reject','then','destroy','error','stack','name','show','params','keys','rawAttributes','query','filters','attributes','intersection','model','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit'];(function(_0x44a70c,_0x549413){var _0x559765=function(_0x381c08){while(--_0x381c08){_0x44a70c['push'](_0x44a70c['shift']());}};_0x559765(++_0x549413);}(_0x0a09,0x1ed));var _0x90a0=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0x0a09[_0x4e6eb2];return _0x4e0c1c;};'use strict';var pdf=require(_0x90a0('0x0'));var emlformat=require(_0x90a0('0x1'));var rimraf=require(_0x90a0('0x2'));var zipdir=require(_0x90a0('0x3'));var jsonpatch=require(_0x90a0('0x4'));var rp=require(_0x90a0('0x5'));var moment=require('moment');var BPromise=require(_0x90a0('0x6'));var Mustache=require('mustache');var util=require(_0x90a0('0x7'));var path=require(_0x90a0('0x8'));var sox=require('sox');var csv=require(_0x90a0('0x9'));var ejs=require(_0x90a0('0xa'));var fs=require('fs');var _=require(_0x90a0('0xb'));var squel=require(_0x90a0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90a0('0xd'));var toCsv=require(_0x90a0('0x9'));var querystring=require(_0x90a0('0xe'));var Papa=require(_0x90a0('0xf'));var authService=require(_0x90a0('0x10'));var hardwareService=require(_0x90a0('0x11'));var Redis=require(_0x90a0('0x12'));var qs=require(_0x90a0('0x13'));var logger=require(_0x90a0('0x14'))('api');var utils=require(_0x90a0('0x15'));var config=require(_0x90a0('0x16'));var db=require(_0x90a0('0x17'))['db'];function respondWithStatusCode(_0x51bf90,_0x80cea2){_0x80cea2=_0x80cea2||0xcc;return function(_0x455c38){if(_0x455c38){return _0x51bf90[_0x90a0('0x18')](_0x80cea2);}return _0x51bf90[_0x90a0('0x19')](_0x80cea2)[_0x90a0('0x1a')]();};}function respondWithResult(_0x1fbb08,_0x5b4741){_0x5b4741=_0x5b4741||0xc8;return function(_0xe05726){if(_0xe05726){return _0x1fbb08[_0x90a0('0x19')](_0x5b4741)['json'](_0xe05726);}};}function respondWithFilteredResult(_0xa990e5,_0x58e9a2){return function(_0x5db5dd){if(_0x5db5dd){var _0x2406f4=_0x5db5dd['count'],_0x235d19=_0x58e9a2[_0x90a0('0x1b')],_0x347666=_0x58e9a2[_0x90a0('0x1b')]+_0x58e9a2[_0x90a0('0x1c')],_0xbfff86;if(_0x347666>=_0x2406f4){_0x347666=_0x2406f4;_0xbfff86=0xc8;}else{_0xbfff86=0xce;}_0xa990e5['status'](_0xbfff86);return _0xa990e5[_0x90a0('0x1d')](_0x90a0('0x1e'),_0x235d19+'-'+_0x347666+'/'+_0x2406f4)['json'](_0x5db5dd);}return null;};}function patchUpdates(_0x1a2264){return function(_0x6f659a){try{jsonpatch[_0x90a0('0x1f')](_0x6f659a,_0x1a2264,!![]);}catch(_0x18125a){return BPromise[_0x90a0('0x20')](_0x18125a);}return _0x6f659a['save']();};}function saveUpdates(_0x3ffb5d,_0x2556a9){return function(_0x444581){if(_0x444581){return _0x444581['update'](_0x3ffb5d)[_0x90a0('0x21')](function(_0x20b918){return _0x20b918;});}return null;};}function removeEntity(_0x35462a,_0xc664e1){return function(_0x16d0bc){if(_0x16d0bc){return _0x16d0bc[_0x90a0('0x22')]()[_0x90a0('0x21')](function(){_0x35462a['status'](0xcc)[_0x90a0('0x1a')]();});}};}function handleEntityNotFound(_0xaff968,_0x68e765){return function(_0x3106eb){if(!_0x3106eb){_0xaff968[_0x90a0('0x18')](0x194);}return _0x3106eb;};}function handleError(_0x1ca192,_0x3b79ee){_0x3b79ee=_0x3b79ee||0x1f4;return function(_0x4e10c5){logger[_0x90a0('0x23')](_0x4e10c5[_0x90a0('0x24')]);if(_0x4e10c5[_0x90a0('0x25')]){delete _0x4e10c5[_0x90a0('0x25')];}_0x1ca192[_0x90a0('0x19')](_0x3b79ee)['send'](_0x4e10c5);};}exports[_0x90a0('0x26')]=function(_0x2d2d66,_0x56b563){var _0x6d57b8={'raw':!![],'where':{'id':_0x2d2d66[_0x90a0('0x27')]['id']}},_0x208763={};_0x208763['model']=_[_0x90a0('0x28')](db['ChatProactiveAction'][_0x90a0('0x29')]);_0x208763[_0x90a0('0x2a')]=_[_0x90a0('0x28')](_0x2d2d66['query']);_0x208763[_0x90a0('0x2b')]=_['intersection'](_0x208763['model'],_0x208763[_0x90a0('0x2a')]);_0x6d57b8[_0x90a0('0x2c')]=_[_0x90a0('0x2d')](_0x208763[_0x90a0('0x2e')],qs[_0x90a0('0x2f')](_0x2d2d66[_0x90a0('0x2a')][_0x90a0('0x2f')]));_0x6d57b8[_0x90a0('0x2c')]=_0x6d57b8['attributes'][_0x90a0('0x30')]?_0x6d57b8[_0x90a0('0x2c')]:_0x208763[_0x90a0('0x2e')];if(_0x2d2d66['query'][_0x90a0('0x31')]){_0x6d57b8[_0x90a0('0x32')]=[{'all':!![]}];}_0x6d57b8=_[_0x90a0('0x33')]({},_0x6d57b8,_0x2d2d66[_0x90a0('0x34')]);return db[_0x90a0('0x35')][_0x90a0('0x36')](_0x6d57b8)[_0x90a0('0x21')](handleEntityNotFound(_0x56b563,null))[_0x90a0('0x21')](respondWithResult(_0x56b563,null))[_0x90a0('0x37')](handleError(_0x56b563,null));};exports['create']=function(_0x45735e,_0x463c74){return db[_0x90a0('0x35')]['create'](_0x45735e['body'],{})[_0x90a0('0x21')](respondWithResult(_0x463c74,0xc9))[_0x90a0('0x37')](handleError(_0x463c74,null));};exports[_0x90a0('0x38')]=function(_0x3a74e0,_0x412461){if(_0x3a74e0[_0x90a0('0x39')]['id']){delete _0x3a74e0[_0x90a0('0x39')]['id'];}return db['ChatProactiveAction'][_0x90a0('0x36')]({'where':{'id':_0x3a74e0[_0x90a0('0x27')]['id']}})[_0x90a0('0x21')](handleEntityNotFound(_0x412461,null))[_0x90a0('0x21')](saveUpdates(_0x3a74e0['body'],null))[_0x90a0('0x21')](respondWithResult(_0x412461,null))['catch'](handleError(_0x412461,null));};exports['destroy']=function(_0xf835ab,_0x454d3c){return db[_0x90a0('0x35')]['find']({'where':{'id':_0xf835ab[_0x90a0('0x27')]['id']}})['then'](handleEntityNotFound(_0x454d3c,null))[_0x90a0('0x21')](removeEntity(_0x454d3c,null))[_0x90a0('0x37')](handleError(_0x454d3c,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index aef0096..8bfd040 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 _0xdb28=['define','ChatProactiveAction','lodash','util','../../config/logger','api','bluebird','request-promise','./chatProactiveAction.attributes','exports'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xdb28,0x106));var _0x8db2=function(_0x5dc476,_0x4ed44c){_0x5dc476=_0x5dc476-0x0;var _0x13fc6c=_0xdb28[_0x5dc476];return _0x13fc6c;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var attributes=require(_0x8db2('0x6'));module[_0x8db2('0x7')]=function(_0x11109e,_0x52bf99){return _0x11109e[_0x8db2('0x8')](_0x8db2('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57ca=['exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','moment','bluebird','request-promise','./chatProactiveAction.attributes'];(function(_0x4ed06c,_0x57c579){var _0x8d80b0=function(_0x3f073a){while(--_0x3f073a){_0x4ed06c['push'](_0x4ed06c['shift']());}};_0x8d80b0(++_0x57c579);}(_0x57ca,0x108));var _0xa57c=function(_0x17fe2e,_0x5ae71a){_0x17fe2e=_0x17fe2e-0x0;var _0x4ee7a6=_0x57ca[_0x17fe2e];return _0x4ee7a6;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var attributes=require(_0xa57c('0x5'));module[_0xa57c('0x6')]=function(_0x48be2d,_0x40ba22){return _0x48be2d[_0xa57c('0x7')](_0xa57c('0x8'),attributes,{'tableName':_0xa57c('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 5e2b13f..0211542 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(_0x2d979f,_0x22fd33){var _0x24d9e3=function(_0x508278){while(--_0x508278){_0x2d979f['push'](_0x2d979f['shift']());}};_0x24d9e3(++_0x22fd33);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','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(_0xb4b30a,_0x243f1a){var _0x3f8406=function(_0x12bb3e){while(--_0x12bb3e){_0xb4b30a['push'](_0xb4b30a['shift']());}};_0x3f8406(++_0x243f1a);}(_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 moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index d1a73b3..0dc4522 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 _0xcae2=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','put','destroy','exports','multer'];(function(_0x3ff6be,_0x54805d){var _0x17ade9=function(_0x309635){while(--_0x309635){_0x3ff6be['push'](_0x3ff6be['shift']());}};_0x17ade9(++_0x54805d);}(_0xcae2,0x143));var _0x2cae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcae2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var path=require(_0x2cae('0x2'));var timeout=require(_0x2cae('0x3'));var express=require(_0x2cae('0x4'));var router=express[_0x2cae('0x5')]();var auth=require(_0x2cae('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2cae('0x7'));var controller=require(_0x2cae('0x8'));router[_0x2cae('0x9')](_0x2cae('0xa'),auth['isAuthenticated'](),controller[_0x2cae('0xb')]);router[_0x2cae('0xc')]('/',auth[_0x2cae('0xd')](),controller[_0x2cae('0xe')]);router[_0x2cae('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2cae('0xa'),auth[_0x2cae('0xd')](),controller[_0x2cae('0x10')]);module[_0x2cae('0x11')]=router; \ No newline at end of file +var _0xc5df=['isAuthenticated','show','post','create','put','update','/:id','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x2b30fe,_0xe92c0a){var _0x2d1e4e=function(_0x43366d){while(--_0x43366d){_0x2b30fe['push'](_0x2b30fe['shift']());}};_0x2d1e4e(++_0xe92c0a);}(_0xc5df,0x80));var _0xfc5d=function(_0x41c80b,_0x5f3a08){_0x41c80b=_0x41c80b-0x0;var _0x57b4e9=_0xc5df[_0x41c80b];return _0x57b4e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfc5d('0x0'));var timeout=require(_0xfc5d('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xfc5d('0x2'));var interaction=require(_0xfc5d('0x3'));var config=require(_0xfc5d('0x4'));var controller=require(_0xfc5d('0x5'));router[_0xfc5d('0x6')]('/:id',auth[_0xfc5d('0x7')](),controller[_0xfc5d('0x8')]);router[_0xfc5d('0x9')]('/',auth[_0xfc5d('0x7')](),controller[_0xfc5d('0xa')]);router[_0xfc5d('0xb')]('/:id',auth[_0xfc5d('0x7')](),controller[_0xfc5d('0xc')]);router['delete'](_0xfc5d('0xd'),auth[_0xfc5d('0x7')](),controller['destroy']);module[_0xfc5d('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 6e9dbcf..2b7129a 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 _0x0776=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x2d83aa,_0x406264){var _0x172112=function(_0x545041){while(--_0x545041){_0x2d83aa['push'](_0x2d83aa['shift']());}};_0x172112(++_0x406264);}(_0x0776,0x1b4));var _0x6077=function(_0x1c6014,_0x3abea8){_0x1c6014=_0x1c6014-0x0;var _0x3be30b=_0x0776[_0x1c6014];return _0x3be30b;};'use strict';var Sequelize=require(_0x6077('0x0'));module[_0x6077('0x1')]={'name':{'type':Sequelize[_0x6077('0x2')],'unique':_0x6077('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6077('0x2')]},'timeout':{'type':Sequelize[_0x6077('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6077('0x5')](_0x6077('0x6'),_0x6077('0x7'),_0x6077('0x8'))}}; \ No newline at end of file +var _0x842d=['rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x21752d,_0x26859f){var _0x4e517e=function(_0x22e56a){while(--_0x22e56a){_0x21752d['push'](_0x21752d['shift']());}};_0x4e517e(++_0x26859f);}(_0x842d,0x88));var _0xd842=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0x842d[_0x4e11d5];return _0x5e4e4c;};'use strict';var Sequelize=require(_0xd842('0x0'));module['exports']={'name':{'type':Sequelize[_0xd842('0x1')],'unique':_0xd842('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd842('0x1')]},'timeout':{'type':Sequelize[_0xd842('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd842('0x4'),_0xd842('0x5'),_0xd842('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 56caea3..aaf5237 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 _0xf759=['code','message','result','catch','sendStatus','status','end','count','offset','set','json','apply','reject','destroy','get','UserProfileResource','then','stack','name','index','ChatQueue','rawAttributes','keys','query','filters','intersection','model','attributes','fields','limit','sort','pick','filter','merge','field','options','where','includeAll','rows','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','length','ChatQueueId','map','User','findAndCountAll','UserId','agent','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','order','addTeams','findAll','ids','Agents','addAgents','penalty','removeTeams','removeAgents','spread','emit','userChatQueue:save','isArray','userChatQueue:remove','getAgents','hasOwnProperty','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','register','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1738c6,_0x58e1ef){var _0x122b75=function(_0x236cd1){while(--_0x236cd1){_0x1738c6['push'](_0x1738c6['shift']());}};_0x122b75(++_0x58e1ef);}(_0xf759,0xd3));var _0x9f75=function(_0x2cbec8,_0x6b7cc4){_0x2cbec8=_0x2cbec8-0x0;var _0x291b0b=_0xf759[_0x2cbec8];return _0x291b0b;};'use strict';var pdf=require(_0x9f75('0x0'));var emlformat=require(_0x9f75('0x1'));var rimraf=require(_0x9f75('0x2'));var zipdir=require(_0x9f75('0x3'));var jsonpatch=require(_0x9f75('0x4'));var rp=require(_0x9f75('0x5'));var moment=require(_0x9f75('0x6'));var BPromise=require(_0x9f75('0x7'));var Mustache=require(_0x9f75('0x8'));var util=require(_0x9f75('0x9'));var path=require(_0x9f75('0xa'));var sox=require(_0x9f75('0xb'));var csv=require(_0x9f75('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9f75('0xd'));var squel=require('squel');var crypto=require(_0x9f75('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9f75('0xc'));var querystring=require(_0x9f75('0xf'));var Papa=require(_0x9f75('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x9f75('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x9f75('0x12'))(_0x9f75('0x13'));var utils=require(_0x9f75('0x14'));var config=require('../../config/environment');var db=require(_0x9f75('0x15'))['db'];config['redis']=_[_0x9f75('0x16')](config['redis'],{'host':_0x9f75('0x17'),'port':0x18eb});var socket=require(_0x9f75('0x18'))(new Redis(config[_0x9f75('0x19')]));require(_0x9f75('0x1a'))[_0x9f75('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9f75('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x20f3bb,_0x47f9b9,_0x54f564,_0x206c0c){return new BPromise(function(_0x324bce,_0x1b6f67){var _0xdf479c=_0x206c0c||client;return _0xdf479c[_0x9f75('0x1d')](_0x20f3bb,_0x54f564)['then'](function(_0x249570){logger[_0x9f75('0x1e')](_0x9f75('0x1f'),_0x47f9b9,_0x9f75('0x20'));logger[_0x9f75('0x21')](_0x9f75('0x22'),_0x47f9b9,_0x9f75('0x20'),JSON[_0x9f75('0x23')](_0x249570));if(_0x249570['error']){if(_0x249570[_0x9f75('0x24')][_0x9f75('0x25')]===0x1f4){logger['error'](_0x9f75('0x1f'),_0x47f9b9,_0x249570[_0x9f75('0x24')][_0x9f75('0x26')]);return _0x1b6f67(_0x249570[_0x9f75('0x24')][_0x9f75('0x26')]);}logger[_0x9f75('0x24')](_0x9f75('0x1f'),_0x47f9b9,_0x249570[_0x9f75('0x24')][_0x9f75('0x26')]);return _0x324bce(_0x249570[_0x9f75('0x24')]['message']);}else{logger[_0x9f75('0x1e')](_0x9f75('0x1f'),_0x47f9b9,_0x9f75('0x20'));_0x324bce(_0x249570[_0x9f75('0x27')]['message']);}})[_0x9f75('0x28')](function(_0x12f55a){logger[_0x9f75('0x24')](_0x9f75('0x1f'),_0x47f9b9,_0x12f55a);_0x1b6f67(_0x12f55a);});});}function respondWithStatusCode(_0x2b723e,_0x5576a6){_0x5576a6=_0x5576a6||0xcc;return function(_0x216b70){if(_0x216b70){return _0x2b723e[_0x9f75('0x29')](_0x5576a6);}return _0x2b723e[_0x9f75('0x2a')](_0x5576a6)[_0x9f75('0x2b')]();};}function respondWithResult(_0x1e8740,_0x8cc140){_0x8cc140=_0x8cc140||0xc8;return function(_0x33cd52){if(_0x33cd52){return _0x1e8740[_0x9f75('0x2a')](_0x8cc140)['json'](_0x33cd52);}};}function respondWithFilteredResult(_0x17f27b,_0x243a82){return function(_0x5da471){if(_0x5da471){var _0x55a816=_0x5da471[_0x9f75('0x2c')],_0x4ece30=_0x243a82['offset'],_0x1846ce=_0x243a82[_0x9f75('0x2d')]+_0x243a82['limit'],_0x8335bc;if(_0x1846ce>=_0x55a816){_0x1846ce=_0x55a816;_0x8335bc=0xc8;}else{_0x8335bc=0xce;}_0x17f27b[_0x9f75('0x2a')](_0x8335bc);return _0x17f27b[_0x9f75('0x2e')]('Content-Range',_0x4ece30+'-'+_0x1846ce+'/'+_0x55a816)[_0x9f75('0x2f')](_0x5da471);}return null;};}function patchUpdates(_0x3ddc90){return function(_0x2a80e1){try{jsonpatch[_0x9f75('0x30')](_0x2a80e1,_0x3ddc90,!![]);}catch(_0x5e00f9){return BPromise[_0x9f75('0x31')](_0x5e00f9);}return _0x2a80e1['save']();};}function saveUpdates(_0x404346,_0x246e15){return function(_0x26b22c){if(_0x26b22c){return _0x26b22c['update'](_0x404346)['then'](function(_0x59c6ef){return _0x59c6ef;});}return null;};}function removeEntity(_0x529c62,_0x5838da){return function(_0x4629ad){if(_0x4629ad){return _0x4629ad[_0x9f75('0x32')]()['then'](function(){var _0x4a1f39=_0x4629ad[_0x9f75('0x33')]({'plain':!![]});var _0x53c2af='ChatQueues';return db[_0x9f75('0x34')][_0x9f75('0x32')]({'where':{'type':_0x53c2af,'resourceId':_0x4a1f39['id']}})[_0x9f75('0x35')](function(){return _0x4629ad;});})[_0x9f75('0x35')](function(){_0x529c62[_0x9f75('0x2a')](0xcc)[_0x9f75('0x2b')]();});}};}function handleEntityNotFound(_0x2aaec6,_0x3d4186){return function(_0x38372b){if(!_0x38372b){_0x2aaec6[_0x9f75('0x29')](0x194);}return _0x38372b;};}function handleError(_0x22875e,_0x153203){_0x153203=_0x153203||0x1f4;return function(_0x565fcc){logger[_0x9f75('0x24')](_0x565fcc[_0x9f75('0x36')]);if(_0x565fcc[_0x9f75('0x37')]){delete _0x565fcc['name'];}_0x22875e[_0x9f75('0x2a')](_0x153203)['send'](_0x565fcc);};}exports[_0x9f75('0x38')]=function(_0x291873,_0x347ec7){var _0x50f34d={},_0x1efa0f={},_0x3da5cd={'count':0x0,'rows':[]};var _0x4a825b=db[_0x9f75('0x39')][_0x9f75('0x3a')];_0x1efa0f['model']=_[_0x9f75('0x3b')](_0x4a825b);_0x1efa0f[_0x9f75('0x3c')]=_[_0x9f75('0x3b')](_0x291873[_0x9f75('0x3c')]);_0x1efa0f[_0x9f75('0x3d')]=_[_0x9f75('0x3e')](_0x1efa0f[_0x9f75('0x3f')],_0x1efa0f[_0x9f75('0x3c')]);_0x50f34d[_0x9f75('0x40')]=_[_0x9f75('0x3e')](_0x1efa0f['model'],qs['fields'](_0x291873[_0x9f75('0x3c')][_0x9f75('0x41')]));_0x50f34d[_0x9f75('0x40')]=_0x50f34d[_0x9f75('0x40')]['length']?_0x50f34d['attributes']:_0x1efa0f['model'];if(!_0x291873['query']['hasOwnProperty']('nolimit')){_0x50f34d[_0x9f75('0x42')]=qs[_0x9f75('0x42')](_0x291873[_0x9f75('0x3c')][_0x9f75('0x42')]);_0x50f34d[_0x9f75('0x2d')]=qs[_0x9f75('0x2d')](_0x291873['query'][_0x9f75('0x2d')]);}_0x50f34d['order']=qs['sort'](_0x291873[_0x9f75('0x3c')][_0x9f75('0x43')]);_0x50f34d['where']=qs[_0x9f75('0x3d')](_[_0x9f75('0x44')](_0x291873[_0x9f75('0x3c')],_0x1efa0f[_0x9f75('0x3d')]));if(_0x291873['query'][_0x9f75('0x45')]){_0x50f34d['where']=_[_0x9f75('0x46')](_0x50f34d['where'],{'$or':_['map'](_0x4a825b,function(_0x3b0e74){if(_0x3b0e74['type']['key']!=='VIRTUAL'){var _0x8f9bc8={};_0x8f9bc8[_0x3b0e74[_0x9f75('0x47')]]={'$like':'%'+_0x291873[_0x9f75('0x3c')][_0x9f75('0x45')]+'%'};return _0x8f9bc8;}})});}_0x50f34d=_[_0x9f75('0x46')]({},_0x50f34d,_0x291873[_0x9f75('0x48')]);var _0x4719a7={'where':_0x50f34d[_0x9f75('0x49')]};return db[_0x9f75('0x39')][_0x9f75('0x2c')](_0x4719a7)['then'](function(_0x4e6247){_0x3da5cd[_0x9f75('0x2c')]=_0x4e6247;if(_0x291873['query'][_0x9f75('0x4a')]){_0x50f34d['include']=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x50f34d);})[_0x9f75('0x35')](function(_0x5b66b8){_0x3da5cd[_0x9f75('0x4b')]=_0x5b66b8;return _0x3da5cd;})[_0x9f75('0x35')](respondWithFilteredResult(_0x347ec7,_0x50f34d))[_0x9f75('0x28')](handleError(_0x347ec7,null));};exports[_0x9f75('0x4c')]=function(_0x4fbf6b,_0xfc1342){var _0x475494={'raw':!![],'where':{'id':_0x4fbf6b[_0x9f75('0x4d')]['id']}},_0x9e62b9={};_0x9e62b9[_0x9f75('0x3f')]=_[_0x9f75('0x3b')](db['ChatQueue'][_0x9f75('0x3a')]);_0x9e62b9['query']=_[_0x9f75('0x3b')](_0x4fbf6b[_0x9f75('0x3c')]);_0x9e62b9['filters']=_[_0x9f75('0x3e')](_0x9e62b9[_0x9f75('0x3f')],_0x9e62b9[_0x9f75('0x3c')]);_0x475494['attributes']=_[_0x9f75('0x3e')](_0x9e62b9[_0x9f75('0x3f')],qs[_0x9f75('0x41')](_0x4fbf6b[_0x9f75('0x3c')][_0x9f75('0x41')]));_0x475494[_0x9f75('0x40')]=_0x475494[_0x9f75('0x40')]['length']?_0x475494['attributes']:_0x9e62b9['model'];if(_0x4fbf6b[_0x9f75('0x3c')][_0x9f75('0x4a')]){_0x475494[_0x9f75('0x4e')]=[{'all':!![]}];}_0x475494=_[_0x9f75('0x46')]({},_0x475494,_0x4fbf6b[_0x9f75('0x48')]);return db['ChatQueue'][_0x9f75('0x4f')](_0x475494)[_0x9f75('0x35')](handleEntityNotFound(_0xfc1342,null))[_0x9f75('0x35')](respondWithResult(_0xfc1342,null))['catch'](handleError(_0xfc1342,null));};exports[_0x9f75('0x50')]=function(_0x2748ef,_0x472440){return db[_0x9f75('0x39')][_0x9f75('0x50')](_0x2748ef[_0x9f75('0x51')],{})[_0x9f75('0x35')](function(_0x117133){var _0x480cc8=_0x2748ef['user'][_0x9f75('0x33')]({'plain':!![]});if(!_0x480cc8)throw new Error(_0x9f75('0x52'));if(_0x480cc8['role']===_0x9f75('0x53')){var _0x77aab1=_0x117133[_0x9f75('0x33')]({'plain':!![]});var _0x18251e='ChatQueues';return db[_0x9f75('0x54')][_0x9f75('0x4f')]({'where':{'name':_0x18251e,'userProfileId':_0x480cc8[_0x9f75('0x55')]},'raw':!![]})[_0x9f75('0x35')](function(_0x352dfc){if(_0x352dfc&&_0x352dfc[_0x9f75('0x56')]===0x0){return db[_0x9f75('0x34')][_0x9f75('0x50')]({'name':_0x77aab1[_0x9f75('0x37')],'resourceId':_0x77aab1['id'],'type':_0x352dfc[_0x9f75('0x37')],'sectionId':_0x352dfc['id']},{})[_0x9f75('0x35')](function(){return _0x117133;});}else{return _0x117133;}})['catch'](function(_0xb12630){logger[_0x9f75('0x24')](_0x9f75('0x57'),_0xb12630);throw _0xb12630;});}return _0x117133;})[_0x9f75('0x35')](respondWithResult(_0x472440,0xc9))[_0x9f75('0x28')](handleError(_0x472440,null));};exports[_0x9f75('0x58')]=function(_0x389d3d,_0x483117){if(_0x389d3d[_0x9f75('0x51')]['id']){delete _0x389d3d[_0x9f75('0x51')]['id'];}return db[_0x9f75('0x39')][_0x9f75('0x4f')]({'where':{'id':_0x389d3d[_0x9f75('0x4d')]['id']}})[_0x9f75('0x35')](handleEntityNotFound(_0x483117,null))[_0x9f75('0x35')](saveUpdates(_0x389d3d[_0x9f75('0x51')],null))[_0x9f75('0x35')](respondWithResult(_0x483117,null))[_0x9f75('0x28')](handleError(_0x483117,null));};exports[_0x9f75('0x32')]=function(_0x588b1d,_0x2299c4){return db[_0x9f75('0x39')]['find']({'where':{'id':_0x588b1d[_0x9f75('0x4d')]['id']}})[_0x9f75('0x35')](handleEntityNotFound(_0x2299c4,null))[_0x9f75('0x35')](removeEntity(_0x2299c4,null))[_0x9f75('0x28')](handleError(_0x2299c4,null));};exports[_0x9f75('0x59')]=function(_0x358d7c,_0x2cafa4){return db[_0x9f75('0x39')]['describe']()['then'](respondWithResult(_0x2cafa4,null))[_0x9f75('0x28')](handleError(_0x2cafa4,null));};exports[_0x9f75('0x5a')]=function(_0x3ce01f,_0x302c9b,_0x5cc273){var _0x294c7f={'raw':!![],'where':{}},_0x1bcbc6={},_0x17e8e1;return db[_0x9f75('0x39')][_0x9f75('0x5b')]({'where':{'id':_0x3ce01f[_0x9f75('0x4d')]['id']}})[_0x9f75('0x35')](handleEntityNotFound(_0x302c9b,null))[_0x9f75('0x35')](function(_0x2b0ff1){if(_0x2b0ff1){_0x17e8e1=_0x2b0ff1['get']({'plain':!![]});_0x1bcbc6['model']=_['keys'](db[_0x9f75('0x5c')][_0x9f75('0x3a')]);_0x1bcbc6[_0x9f75('0x3c')]=_[_0x9f75('0x3b')](_0x3ce01f[_0x9f75('0x3c')]);_0x1bcbc6[_0x9f75('0x3d')]=_[_0x9f75('0x3e')](_0x1bcbc6[_0x9f75('0x3f')],_0x1bcbc6[_0x9f75('0x3c')]);_0x294c7f[_0x9f75('0x40')]=_[_0x9f75('0x3e')](_0x1bcbc6[_0x9f75('0x3f')],qs[_0x9f75('0x41')](_0x3ce01f[_0x9f75('0x3c')][_0x9f75('0x41')]));_0x294c7f['attributes']=_0x294c7f[_0x9f75('0x40')][_0x9f75('0x5d')]?_0x294c7f[_0x9f75('0x40')]:_0x1bcbc6['model'];if(!_0x3ce01f[_0x9f75('0x3c')]['hasOwnProperty']('nolimit')){_0x294c7f[_0x9f75('0x42')]=qs['limit'](_0x3ce01f['query']['limit']);_0x294c7f[_0x9f75('0x2d')]=qs['offset'](_0x3ce01f[_0x9f75('0x3c')]['offset']);}_0x294c7f['order']=qs['sort'](_0x3ce01f[_0x9f75('0x3c')][_0x9f75('0x43')]);_0x294c7f[_0x9f75('0x49')]=qs[_0x9f75('0x3d')](_[_0x9f75('0x44')](_0x3ce01f[_0x9f75('0x3c')],_0x1bcbc6['filters']));_0x294c7f['where'][_0x9f75('0x5e')]=_0x2b0ff1['id'];if(_0x3ce01f[_0x9f75('0x3c')][_0x9f75('0x45')]){_0x294c7f[_0x9f75('0x49')]=_[_0x9f75('0x46')](_0x294c7f[_0x9f75('0x49')],{'$or':_[_0x9f75('0x5f')](_0x294c7f[_0x9f75('0x40')],function(_0x1260a3){var _0x1d95ee={};_0x1d95ee[_0x1260a3]={'$like':'%'+_0x3ce01f[_0x9f75('0x3c')][_0x9f75('0x45')]+'%'};return _0x1d95ee;})});}_0x294c7f=_['merge']({},_0x294c7f,_0x3ce01f[_0x9f75('0x48')]);return db[_0x9f75('0x5c')]['findAll'](_0x294c7f);}})['then'](function(_0x40f3d9){if(_0x40f3d9){return db[_0x9f75('0x60')][_0x9f75('0x61')]({'where':{'id':_[_0x9f75('0x5f')](_0x40f3d9,_0x9f75('0x62')),'role':_0x9f75('0x63')},'attributes':['id',_0x9f75('0x37'),_0x9f75('0x64'),'updatedAt',_0x9f75('0x65')]});}})['then'](function(_0xb4afb4){if(_0xb4afb4){return{'count':_0xb4afb4[_0x9f75('0x2c')],'rows':_[_0x9f75('0x5f')](_0xb4afb4[_0x9f75('0x4b')],function(_0x7cc706){return{'membername':_0x7cc706[_0x9f75('0x37')],'UserId':_0x7cc706['id'],'queue_name':_0x17e8e1['name'],'ChatQueueId':_0x17e8e1['id'],'interface':util['format'](_0x9f75('0x66'),_0x9f75('0x67'),_0x7cc706['name']),'penalty':0x0,'paused':_0x7cc706[_0x9f75('0x64')],'createdAt':_0x7cc706['createdAt'],'updatedAt':_0x7cc706[_0x9f75('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9f75('0x35')](respondWithFilteredResult(_0x302c9b,_0x294c7f))['catch'](handleError(_0x302c9b,null));};exports[_0x9f75('0x69')]=function(_0x233bef,_0x39c274,_0x474339){var _0x5cb2cc={};var _0x2daae9={};var _0x110aa5;var _0x54900e;return db[_0x9f75('0x39')][_0x9f75('0x5b')]({'where':{'id':_0x233bef[_0x9f75('0x4d')]['id']}})[_0x9f75('0x35')](handleEntityNotFound(_0x39c274,null))[_0x9f75('0x35')](function(_0x122677){if(_0x122677){_0x110aa5=_0x122677;_0x2daae9[_0x9f75('0x3f')]=_['keys'](db[_0x9f75('0x6a')]['rawAttributes']);_0x2daae9[_0x9f75('0x3c')]=_['keys'](_0x233bef[_0x9f75('0x3c')]);_0x2daae9['filters']=_[_0x9f75('0x3e')](_0x2daae9['model'],_0x2daae9[_0x9f75('0x3c')]);_0x5cb2cc[_0x9f75('0x40')]=_[_0x9f75('0x3e')](_0x2daae9[_0x9f75('0x3f')],qs['fields'](_0x233bef['query'][_0x9f75('0x41')]));_0x5cb2cc[_0x9f75('0x40')]=_0x5cb2cc['attributes'][_0x9f75('0x5d')]?_0x5cb2cc['attributes']:_0x2daae9[_0x9f75('0x3f')];_0x5cb2cc[_0x9f75('0x6b')]=qs[_0x9f75('0x43')](_0x233bef['query'][_0x9f75('0x43')]);_0x5cb2cc[_0x9f75('0x49')]=qs[_0x9f75('0x3d')](_[_0x9f75('0x44')](_0x233bef[_0x9f75('0x3c')],_0x2daae9[_0x9f75('0x3d')]));if(_0x233bef[_0x9f75('0x3c')][_0x9f75('0x45')]){_0x5cb2cc[_0x9f75('0x49')]=_[_0x9f75('0x46')](_0x5cb2cc[_0x9f75('0x49')],{'$or':_[_0x9f75('0x5f')](_0x5cb2cc[_0x9f75('0x40')],function(_0x87e87e){var _0x14c572={};_0x14c572[_0x87e87e]={'$like':'%'+_0x233bef[_0x9f75('0x3c')][_0x9f75('0x45')]+'%'};return _0x14c572;})});}_0x5cb2cc=_[_0x9f75('0x46')]({},_0x5cb2cc,_0x233bef[_0x9f75('0x48')]);return _0x110aa5[_0x9f75('0x69')](_0x5cb2cc);}})[_0x9f75('0x35')](function(_0x355b21){if(_0x355b21){_0x54900e=_0x355b21[_0x9f75('0x5d')];if(!_0x233bef[_0x9f75('0x3c')]['hasOwnProperty']('nolimit')){_0x5cb2cc[_0x9f75('0x42')]=qs[_0x9f75('0x42')](_0x233bef['query']['limit']);_0x5cb2cc[_0x9f75('0x2d')]=qs[_0x9f75('0x2d')](_0x233bef[_0x9f75('0x3c')][_0x9f75('0x2d')]);}return _0x110aa5[_0x9f75('0x69')](_0x5cb2cc);}})[_0x9f75('0x35')](function(_0x14125c){if(_0x14125c){return _0x14125c?{'count':_0x54900e,'rows':_0x14125c}:null;}})[_0x9f75('0x35')](respondWithResult(_0x39c274,null))[_0x9f75('0x28')](handleError(_0x39c274,null));};exports[_0x9f75('0x6c')]=function(_0x30fbb6,_0x23cd67,_0x2796fb){var _0x2bcfd0=[];var _0x132378;return db[_0x9f75('0x6a')][_0x9f75('0x6d')]({'where':{'id':_0x30fbb6[_0x9f75('0x51')][_0x9f75('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x9f75('0x60')],'as':_0x9f75('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x9f75('0x35')](function(_0x4f786f){if(_0x4f786f){for(var _0xcbb9fb=0x0;_0xcbb9fb<_0x4f786f[_0x9f75('0x5d')];_0xcbb9fb+=0x1){for(var _0x1e1b44=0x0;_0x1e1b44<_0x4f786f[_0xcbb9fb]['Agents'][_0x9f75('0x5d')];_0x1e1b44+=0x1){_0x2bcfd0=_['union'](_0x2bcfd0,[_0x4f786f[_0xcbb9fb][_0x9f75('0x6f')][_0x1e1b44]['id']]);}}return _0x2bcfd0;}})['then'](function(_0x66557){if(_0x66557){return db[_0x9f75('0x39')][_0x9f75('0x4f')]({'where':{'id':_0x30fbb6[_0x9f75('0x4d')]['id']}});}})[_0x9f75('0x35')](function(_0x5a22b0){if(_0x5a22b0){_0x132378=_0x5a22b0;return _0x132378[_0x9f75('0x70')](_0x2bcfd0,{'penalty':_0x30fbb6[_0x9f75('0x51')][_0x9f75('0x71')]});}})['then'](function(_0x40d5a8){if(_0x40d5a8){return _0x132378['addTeams'](_0x30fbb6[_0x9f75('0x51')][_0x9f75('0x6e')]);}})['then'](handleEntityNotFound(_0x23cd67,null))['then'](respondWithStatusCode(_0x23cd67,null))[_0x9f75('0x28')](handleError(_0x23cd67,null));};exports[_0x9f75('0x72')]=function(_0x1ee1ee,_0x4a7631,_0x1dfcae){var _0x123860=[];var _0x5c9a4a;return db[_0x9f75('0x6a')][_0x9f75('0x6d')]({'where':{'id':_0x1ee1ee[_0x9f75('0x3c')][_0x9f75('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9f75('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x9f75('0x35')](function(_0x3962d8){if(_0x3962d8){for(var _0xdc52c0=0x0;_0xdc52c0<_0x3962d8['length'];_0xdc52c0+=0x1){for(var _0x3edceb=0x0;_0x3edceb<_0x3962d8[_0xdc52c0][_0x9f75('0x6f')][_0x9f75('0x5d')];_0x3edceb+=0x1){_0x123860=_['union'](_0x123860,[_0x3962d8[_0xdc52c0][_0x9f75('0x6f')][_0x3edceb]['id']]);}}return _0x123860;}})[_0x9f75('0x35')](function(_0x431d7f){if(_0x431d7f){return db[_0x9f75('0x39')][_0x9f75('0x4f')]({'where':{'id':_0x1ee1ee['params']['id']}});}})[_0x9f75('0x35')](function(_0x2d273c){if(_0x2d273c){_0x5c9a4a=_0x2d273c;return _0x5c9a4a[_0x9f75('0x73')](_0x123860);}})[_0x9f75('0x35')](function(_0x5aab3e){if(_0x5c9a4a){return _0x5c9a4a[_0x9f75('0x72')](_0x1ee1ee[_0x9f75('0x3c')]['ids']);}})[_0x9f75('0x35')](handleEntityNotFound(_0x4a7631,null))[_0x9f75('0x35')](respondWithStatusCode(_0x4a7631,null))['catch'](handleError(_0x4a7631,null));};exports[_0x9f75('0x70')]=function(_0x24df7d,_0x34531e,_0x5cf87a){return db[_0x9f75('0x39')][_0x9f75('0x4f')]({'where':{'id':_0x24df7d[_0x9f75('0x4d')]['id']}})[_0x9f75('0x35')](handleEntityNotFound(_0x34531e,null))[_0x9f75('0x35')](function(_0x242b91){if(_0x242b91){return _0x242b91[_0x9f75('0x70')](_0x24df7d[_0x9f75('0x51')][_0x9f75('0x6e')],_['omit'](_0x24df7d[_0x9f75('0x51')],[_0x9f75('0x6e'),'id'])||{})[_0x9f75('0x74')](function(_0x276d52){for(var _0x41fefc=0x0;_0x41fefc<_0x24df7d[_0x9f75('0x51')][_0x9f75('0x6e')]['length'];_0x41fefc+=0x1){socket[_0x9f75('0x75')](_0x9f75('0x76'),{'UserId':_0x24df7d[_0x9f75('0x51')][_0x9f75('0x6e')][_0x41fefc],'ChatQueueId':_0x24df7d['params']['id']});}return _0x276d52;});}})['then'](respondWithResult(_0x34531e,null))['catch'](handleError(_0x34531e,null));};exports[_0x9f75('0x73')]=function(_0x570a22,_0xcdf54b,_0x1c1207){var _0x30d54e;return db[_0x9f75('0x39')]['find']({'where':{'id':_0x570a22['params']['id']}})[_0x9f75('0x35')](handleEntityNotFound(_0xcdf54b,null))[_0x9f75('0x35')](function(_0x2620c4){if(_0x2620c4){return _0x2620c4[_0x9f75('0x73')](_0x570a22[_0x9f75('0x3c')][_0x9f75('0x6e')])[_0x9f75('0x35')](function(_0x4278e4){if(_[_0x9f75('0x77')](_0x570a22[_0x9f75('0x3c')][_0x9f75('0x6e')])){for(var _0x48b9ea=0x0;_0x48b9ea<_0x570a22[_0x9f75('0x3c')][_0x9f75('0x6e')][_0x9f75('0x5d')];_0x48b9ea+=0x1){socket[_0x9f75('0x75')](_0x9f75('0x78'),{'UserId':_0x570a22[_0x9f75('0x3c')]['ids'][_0x48b9ea],'ChatQueueId':_0x570a22[_0x9f75('0x4d')]['id']});}}else{socket[_0x9f75('0x75')](_0x9f75('0x78'),{'UserId':_0x570a22[_0x9f75('0x3c')][_0x9f75('0x6e')],'ChatQueueId':_0x570a22[_0x9f75('0x4d')]['id']});}});}})[_0x9f75('0x35')](respondWithStatusCode(_0xcdf54b,null))[_0x9f75('0x28')](handleError(_0xcdf54b,null));};exports['getAgents']=function(_0x1311b0,_0x4e8a31,_0x487193){var _0x2d07fb={};var _0x412de1={};var _0x5e7653;var _0x50a6ba;return db[_0x9f75('0x39')][_0x9f75('0x5b')]({'where':{'id':_0x1311b0['params']['id']}})[_0x9f75('0x35')](handleEntityNotFound(_0x4e8a31,null))[_0x9f75('0x35')](function(_0x112249){if(_0x112249){_0x5e7653=_0x112249;_0x412de1['model']=_[_0x9f75('0x3b')](db[_0x9f75('0x60')][_0x9f75('0x3a')]);_0x412de1[_0x9f75('0x3c')]=_[_0x9f75('0x3b')](_0x1311b0[_0x9f75('0x3c')]);_0x412de1[_0x9f75('0x3d')]=_[_0x9f75('0x3e')](_0x412de1[_0x9f75('0x3f')],_0x412de1[_0x9f75('0x3c')]);_0x2d07fb['attributes']=_[_0x9f75('0x3e')](_0x412de1['model'],qs[_0x9f75('0x41')](_0x1311b0[_0x9f75('0x3c')][_0x9f75('0x41')]));_0x2d07fb[_0x9f75('0x40')]=_0x2d07fb[_0x9f75('0x40')][_0x9f75('0x5d')]?_0x2d07fb[_0x9f75('0x40')]:_0x412de1[_0x9f75('0x3f')];_0x2d07fb[_0x9f75('0x6b')]=qs[_0x9f75('0x43')](_0x1311b0[_0x9f75('0x3c')]['sort']);_0x2d07fb[_0x9f75('0x49')]=qs[_0x9f75('0x3d')](_['pick'](_0x1311b0['query'],_0x412de1[_0x9f75('0x3d')]));if(_0x1311b0['query']['filter']){_0x2d07fb[_0x9f75('0x49')]=_[_0x9f75('0x46')](_0x2d07fb[_0x9f75('0x49')],{'$or':_[_0x9f75('0x5f')](_0x2d07fb[_0x9f75('0x40')],function(_0x134275){var _0x21f13a={};_0x21f13a[_0x134275]={'$like':'%'+_0x1311b0['query'][_0x9f75('0x45')]+'%'};return _0x21f13a;})});}_0x2d07fb=_['merge']({},_0x2d07fb,_0x1311b0['options']);return _0x5e7653[_0x9f75('0x79')](_0x2d07fb);}})[_0x9f75('0x35')](function(_0x1a6ed5){if(_0x1a6ed5){_0x50a6ba=_0x1a6ed5[_0x9f75('0x5d')];if(!_0x1311b0[_0x9f75('0x3c')][_0x9f75('0x7a')](_0x9f75('0x7b'))){_0x2d07fb[_0x9f75('0x42')]=qs[_0x9f75('0x42')](_0x1311b0[_0x9f75('0x3c')][_0x9f75('0x42')]);_0x2d07fb[_0x9f75('0x2d')]=qs[_0x9f75('0x2d')](_0x1311b0['query'][_0x9f75('0x2d')]);}return _0x5e7653[_0x9f75('0x79')](_0x2d07fb);}})['then'](function(_0x1218ef){if(_0x1218ef){return _0x1218ef?{'count':_0x50a6ba,'rows':_0x1218ef}:null;}})['then'](respondWithResult(_0x4e8a31,null))[_0x9f75('0x28')](handleError(_0x4e8a31,null));}; \ No newline at end of file +var _0x7119=['send','ChatQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','merge','type','VIRTUAL','field','filter','options','includeAll','findAll','rows','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','UserChatQueue','hasOwnProperty','nolimit','pick','map','User','UserId','updatedAt','createdAt','format','SIP','chatPause','getTeams','findOne','ids','penalty','addTeams','removeTeams','Team','Agents','union','addAgents','omit','spread','emit','userChatQueue:save','removeAgents','isArray','userChatQueue:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name'];(function(_0x37e848,_0x3e0c42){var _0x43ca0d=function(_0x55590a){while(--_0x55590a){_0x37e848['push'](_0x37e848['shift']());}};_0x43ca0d(++_0x3e0c42);}(_0x7119,0xbb));var _0x9711=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x7119[_0x101e7b];return _0x4995c0;};'use strict';var pdf=require(_0x9711('0x0'));var emlformat=require(_0x9711('0x1'));var rimraf=require(_0x9711('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9711('0x3'));var rp=require(_0x9711('0x4'));var moment=require('moment');var BPromise=require(_0x9711('0x5'));var Mustache=require('mustache');var util=require(_0x9711('0x6'));var path=require('path');var sox=require(_0x9711('0x7'));var csv=require('to-csv');var ejs=require(_0x9711('0x8'));var fs=require('fs');var _=require(_0x9711('0x9'));var squel=require(_0x9711('0xa'));var crypto=require(_0x9711('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9711('0xc'));var querystring=require(_0x9711('0xd'));var Papa=require(_0x9711('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0x9711('0xf'));var Redis=require('ioredis');var qs=require(_0x9711('0x10'));var logger=require(_0x9711('0x11'))(_0x9711('0x12'));var utils=require(_0x9711('0x13'));var config=require(_0x9711('0x14'));var db=require('../../mysqldb')['db'];config[_0x9711('0x15')]=_['defaults'](config[_0x9711('0x15')],{'host':_0x9711('0x16'),'port':0x18eb});var socket=require(_0x9711('0x17'))(new Redis(config[_0x9711('0x15')]));require('./chatQueue.socket')[_0x9711('0x18')](socket);var jayson=require(_0x9711('0x19'));var client=jayson[_0x9711('0x1a')][_0x9711('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3ac194,_0x5d0e42,_0x2cec02,_0x456e36){return new BPromise(function(_0x50d1ac,_0x43d03d){var _0x25a6af=_0x456e36||client;return _0x25a6af[_0x9711('0x1c')](_0x3ac194,_0x2cec02)[_0x9711('0x1d')](function(_0xdbb3ef){logger['info']('ChatQueue,\x20%s,\x20%s',_0x5d0e42,'request\x20sent');logger[_0x9711('0x1e')](_0x9711('0x1f'),_0x5d0e42,_0x9711('0x20'),JSON[_0x9711('0x21')](_0xdbb3ef));if(_0xdbb3ef[_0x9711('0x22')]){if(_0xdbb3ef[_0x9711('0x22')][_0x9711('0x23')]===0x1f4){logger[_0x9711('0x22')](_0x9711('0x24'),_0x5d0e42,_0xdbb3ef[_0x9711('0x22')]['message']);return _0x43d03d(_0xdbb3ef['error'][_0x9711('0x25')]);}logger[_0x9711('0x22')](_0x9711('0x24'),_0x5d0e42,_0xdbb3ef['error']['message']);return _0x50d1ac(_0xdbb3ef[_0x9711('0x22')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5d0e42,_0x9711('0x20'));_0x50d1ac(_0xdbb3ef[_0x9711('0x26')][_0x9711('0x25')]);}})[_0x9711('0x27')](function(_0x33d75a){logger['error'](_0x9711('0x24'),_0x5d0e42,_0x33d75a);_0x43d03d(_0x33d75a);});});}function respondWithStatusCode(_0x13b1d9,_0x111203){_0x111203=_0x111203||0xcc;return function(_0x2da1e5){if(_0x2da1e5){return _0x13b1d9[_0x9711('0x28')](_0x111203);}return _0x13b1d9[_0x9711('0x29')](_0x111203)[_0x9711('0x2a')]();};}function respondWithResult(_0x387de6,_0x5f3ce6){_0x5f3ce6=_0x5f3ce6||0xc8;return function(_0x34f022){if(_0x34f022){return _0x387de6[_0x9711('0x29')](_0x5f3ce6)['json'](_0x34f022);}};}function respondWithFilteredResult(_0x5f3f04,_0x3911bf){return function(_0x52f4ec){if(_0x52f4ec){var _0x299fdd=_0x52f4ec[_0x9711('0x2b')],_0x78949d=_0x3911bf[_0x9711('0x2c')],_0x39341e=_0x3911bf['offset']+_0x3911bf[_0x9711('0x2d')],_0x19f097;if(_0x39341e>=_0x299fdd){_0x39341e=_0x299fdd;_0x19f097=0xc8;}else{_0x19f097=0xce;}_0x5f3f04['status'](_0x19f097);return _0x5f3f04[_0x9711('0x2e')](_0x9711('0x2f'),_0x78949d+'-'+_0x39341e+'/'+_0x299fdd)['json'](_0x52f4ec);}return null;};}function patchUpdates(_0x83506){return function(_0x2856b4){try{jsonpatch[_0x9711('0x30')](_0x2856b4,_0x83506,!![]);}catch(_0x1fd307){return BPromise['reject'](_0x1fd307);}return _0x2856b4[_0x9711('0x31')]();};}function saveUpdates(_0x1c8c1c,_0x44e179){return function(_0x2145b3){if(_0x2145b3){return _0x2145b3[_0x9711('0x32')](_0x1c8c1c)[_0x9711('0x1d')](function(_0x489d8d){return _0x489d8d;});}return null;};}function removeEntity(_0x2d61e3,_0x22959b){return function(_0x105b13){if(_0x105b13){return _0x105b13[_0x9711('0x33')]()[_0x9711('0x1d')](function(){var _0xd324cb=_0x105b13[_0x9711('0x34')]({'plain':!![]});var _0x440c38=_0x9711('0x35');return db[_0x9711('0x36')]['destroy']({'where':{'type':_0x440c38,'resourceId':_0xd324cb['id']}})[_0x9711('0x1d')](function(){return _0x105b13;});})[_0x9711('0x1d')](function(){_0x2d61e3[_0x9711('0x29')](0xcc)[_0x9711('0x2a')]();});}};}function handleEntityNotFound(_0x2ed7c1,_0x2270e2){return function(_0x53b6a9){if(!_0x53b6a9){_0x2ed7c1[_0x9711('0x28')](0x194);}return _0x53b6a9;};}function handleError(_0xf48171,_0xfca6d6){_0xfca6d6=_0xfca6d6||0x1f4;return function(_0x427289){logger[_0x9711('0x22')](_0x427289[_0x9711('0x37')]);if(_0x427289[_0x9711('0x38')]){delete _0x427289[_0x9711('0x38')];}_0xf48171[_0x9711('0x29')](_0xfca6d6)[_0x9711('0x39')](_0x427289);};}exports['index']=function(_0x346358,_0xb81738){var _0x3c0f7b={},_0x4b0099={},_0x59fa19={'count':0x0,'rows':[]};var _0x221c15=db[_0x9711('0x3a')][_0x9711('0x3b')];_0x4b0099[_0x9711('0x3c')]=_[_0x9711('0x3d')](_0x221c15);_0x4b0099[_0x9711('0x3e')]=_[_0x9711('0x3d')](_0x346358[_0x9711('0x3e')]);_0x4b0099[_0x9711('0x3f')]=_[_0x9711('0x40')](_0x4b0099[_0x9711('0x3c')],_0x4b0099[_0x9711('0x3e')]);_0x3c0f7b[_0x9711('0x41')]=_[_0x9711('0x40')](_0x4b0099[_0x9711('0x3c')],qs[_0x9711('0x42')](_0x346358[_0x9711('0x3e')][_0x9711('0x42')]));_0x3c0f7b[_0x9711('0x41')]=_0x3c0f7b['attributes'][_0x9711('0x43')]?_0x3c0f7b[_0x9711('0x41')]:_0x4b0099[_0x9711('0x3c')];if(!_0x346358[_0x9711('0x3e')]['hasOwnProperty']('nolimit')){_0x3c0f7b['limit']=qs[_0x9711('0x2d')](_0x346358[_0x9711('0x3e')][_0x9711('0x2d')]);_0x3c0f7b['offset']=qs[_0x9711('0x2c')](_0x346358[_0x9711('0x3e')][_0x9711('0x2c')]);}_0x3c0f7b[_0x9711('0x44')]=qs[_0x9711('0x45')](_0x346358[_0x9711('0x3e')][_0x9711('0x45')]);_0x3c0f7b[_0x9711('0x46')]=qs[_0x9711('0x3f')](_['pick'](_0x346358[_0x9711('0x3e')],_0x4b0099[_0x9711('0x3f')]));if(_0x346358[_0x9711('0x3e')]['filter']){_0x3c0f7b[_0x9711('0x46')]=_[_0x9711('0x47')](_0x3c0f7b[_0x9711('0x46')],{'$or':_['map'](_0x221c15,function(_0x35a77a){if(_0x35a77a[_0x9711('0x48')]['key']!==_0x9711('0x49')){var _0x3234e7={};_0x3234e7[_0x35a77a[_0x9711('0x4a')]]={'$like':'%'+_0x346358[_0x9711('0x3e')][_0x9711('0x4b')]+'%'};return _0x3234e7;}})});}_0x3c0f7b=_['merge']({},_0x3c0f7b,_0x346358[_0x9711('0x4c')]);var _0x541266={'where':_0x3c0f7b[_0x9711('0x46')]};return db[_0x9711('0x3a')][_0x9711('0x2b')](_0x541266)['then'](function(_0x525b7b){_0x59fa19['count']=_0x525b7b;if(_0x346358[_0x9711('0x3e')][_0x9711('0x4d')]){_0x3c0f7b['include']=[{'all':!![]}];}return db[_0x9711('0x3a')][_0x9711('0x4e')](_0x3c0f7b);})[_0x9711('0x1d')](function(_0x5ec410){_0x59fa19[_0x9711('0x4f')]=_0x5ec410;return _0x59fa19;})[_0x9711('0x1d')](respondWithFilteredResult(_0xb81738,_0x3c0f7b))[_0x9711('0x27')](handleError(_0xb81738,null));};exports['show']=function(_0x3574ac,_0x8a9db9){var _0x4bb46e={'raw':!![],'where':{'id':_0x3574ac[_0x9711('0x50')]['id']}},_0x44dc24={};_0x44dc24[_0x9711('0x3c')]=_[_0x9711('0x3d')](db[_0x9711('0x3a')][_0x9711('0x3b')]);_0x44dc24[_0x9711('0x3e')]=_[_0x9711('0x3d')](_0x3574ac[_0x9711('0x3e')]);_0x44dc24[_0x9711('0x3f')]=_[_0x9711('0x40')](_0x44dc24[_0x9711('0x3c')],_0x44dc24[_0x9711('0x3e')]);_0x4bb46e[_0x9711('0x41')]=_[_0x9711('0x40')](_0x44dc24['model'],qs[_0x9711('0x42')](_0x3574ac[_0x9711('0x3e')][_0x9711('0x42')]));_0x4bb46e[_0x9711('0x41')]=_0x4bb46e['attributes'][_0x9711('0x43')]?_0x4bb46e[_0x9711('0x41')]:_0x44dc24[_0x9711('0x3c')];if(_0x3574ac[_0x9711('0x3e')][_0x9711('0x4d')]){_0x4bb46e['include']=[{'all':!![]}];}_0x4bb46e=_[_0x9711('0x47')]({},_0x4bb46e,_0x3574ac[_0x9711('0x4c')]);return db[_0x9711('0x3a')]['find'](_0x4bb46e)[_0x9711('0x1d')](handleEntityNotFound(_0x8a9db9,null))[_0x9711('0x1d')](respondWithResult(_0x8a9db9,null))[_0x9711('0x27')](handleError(_0x8a9db9,null));};exports['create']=function(_0x122a64,_0x3c3bed){return db['ChatQueue'][_0x9711('0x51')](_0x122a64[_0x9711('0x52')],{})[_0x9711('0x1d')](function(_0x1b3813){var _0xb82b57=_0x122a64[_0x9711('0x53')][_0x9711('0x34')]({'plain':!![]});if(!_0xb82b57)throw new Error(_0x9711('0x54'));if(_0xb82b57[_0x9711('0x55')]===_0x9711('0x53')){var _0xf28430=_0x1b3813[_0x9711('0x34')]({'plain':!![]});var _0x177ac2=_0x9711('0x35');return db[_0x9711('0x56')]['find']({'where':{'name':_0x177ac2,'userProfileId':_0xb82b57[_0x9711('0x57')]},'raw':!![]})['then'](function(_0x3d5fd5){if(_0x3d5fd5&&_0x3d5fd5['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xf28430['name'],'resourceId':_0xf28430['id'],'type':_0x3d5fd5[_0x9711('0x38')],'sectionId':_0x3d5fd5['id']},{})['then'](function(){return _0x1b3813;});}else{return _0x1b3813;}})['catch'](function(_0x16518f){logger[_0x9711('0x22')](_0x9711('0x58'),_0x16518f);throw _0x16518f;});}return _0x1b3813;})[_0x9711('0x1d')](respondWithResult(_0x3c3bed,0xc9))[_0x9711('0x27')](handleError(_0x3c3bed,null));};exports[_0x9711('0x32')]=function(_0x1dd978,_0x374713){if(_0x1dd978['body']['id']){delete _0x1dd978[_0x9711('0x52')]['id'];}return db[_0x9711('0x3a')]['find']({'where':{'id':_0x1dd978['params']['id']}})[_0x9711('0x1d')](handleEntityNotFound(_0x374713,null))['then'](saveUpdates(_0x1dd978[_0x9711('0x52')],null))[_0x9711('0x1d')](respondWithResult(_0x374713,null))[_0x9711('0x27')](handleError(_0x374713,null));};exports[_0x9711('0x33')]=function(_0x31a08e,_0x152494){return db[_0x9711('0x3a')][_0x9711('0x59')]({'where':{'id':_0x31a08e[_0x9711('0x50')]['id']}})[_0x9711('0x1d')](handleEntityNotFound(_0x152494,null))[_0x9711('0x1d')](removeEntity(_0x152494,null))[_0x9711('0x27')](handleError(_0x152494,null));};exports[_0x9711('0x5a')]=function(_0x9c0887,_0x1e30ca){return db[_0x9711('0x3a')][_0x9711('0x5a')]()['then'](respondWithResult(_0x1e30ca,null))['catch'](handleError(_0x1e30ca,null));};exports[_0x9711('0x5b')]=function(_0x70fa3,_0x3a34f6,_0x5e471){var _0x514e32={'raw':!![],'where':{}},_0x1b4ff8={},_0xbbee6b;return db['ChatQueue']['findOne']({'where':{'id':_0x70fa3['params']['id']}})['then'](handleEntityNotFound(_0x3a34f6,null))['then'](function(_0x5c215c){if(_0x5c215c){_0xbbee6b=_0x5c215c[_0x9711('0x34')]({'plain':!![]});_0x1b4ff8[_0x9711('0x3c')]=_[_0x9711('0x3d')](db[_0x9711('0x5c')][_0x9711('0x3b')]);_0x1b4ff8['query']=_[_0x9711('0x3d')](_0x70fa3['query']);_0x1b4ff8[_0x9711('0x3f')]=_[_0x9711('0x40')](_0x1b4ff8[_0x9711('0x3c')],_0x1b4ff8['query']);_0x514e32[_0x9711('0x41')]=_['intersection'](_0x1b4ff8[_0x9711('0x3c')],qs[_0x9711('0x42')](_0x70fa3[_0x9711('0x3e')][_0x9711('0x42')]));_0x514e32[_0x9711('0x41')]=_0x514e32[_0x9711('0x41')][_0x9711('0x43')]?_0x514e32[_0x9711('0x41')]:_0x1b4ff8[_0x9711('0x3c')];if(!_0x70fa3[_0x9711('0x3e')][_0x9711('0x5d')](_0x9711('0x5e'))){_0x514e32[_0x9711('0x2d')]=qs[_0x9711('0x2d')](_0x70fa3[_0x9711('0x3e')]['limit']);_0x514e32[_0x9711('0x2c')]=qs[_0x9711('0x2c')](_0x70fa3[_0x9711('0x3e')][_0x9711('0x2c')]);}_0x514e32[_0x9711('0x44')]=qs['sort'](_0x70fa3[_0x9711('0x3e')][_0x9711('0x45')]);_0x514e32['where']=qs['filters'](_[_0x9711('0x5f')](_0x70fa3['query'],_0x1b4ff8[_0x9711('0x3f')]));_0x514e32['where']['ChatQueueId']=_0x5c215c['id'];if(_0x70fa3[_0x9711('0x3e')][_0x9711('0x4b')]){_0x514e32[_0x9711('0x46')]=_[_0x9711('0x47')](_0x514e32['where'],{'$or':_[_0x9711('0x60')](_0x514e32[_0x9711('0x41')],function(_0x556480){var _0xb965a5={};_0xb965a5[_0x556480]={'$like':'%'+_0x70fa3['query'][_0x9711('0x4b')]+'%'};return _0xb965a5;})});}_0x514e32=_[_0x9711('0x47')]({},_0x514e32,_0x70fa3[_0x9711('0x4c')]);return db[_0x9711('0x5c')][_0x9711('0x4e')](_0x514e32);}})[_0x9711('0x1d')](function(_0x20ac12){if(_0x20ac12){return db[_0x9711('0x61')]['findAndCountAll']({'where':{'id':_['map'](_0x20ac12,_0x9711('0x62')),'role':'agent'},'attributes':['id','name','chatPause',_0x9711('0x63'),_0x9711('0x64')]});}})[_0x9711('0x1d')](function(_0x4b38ff){if(_0x4b38ff){return{'count':_0x4b38ff[_0x9711('0x2b')],'rows':_['map'](_0x4b38ff[_0x9711('0x4f')],function(_0x1991e7){return{'membername':_0x1991e7['name'],'UserId':_0x1991e7['id'],'queue_name':_0xbbee6b[_0x9711('0x38')],'ChatQueueId':_0xbbee6b['id'],'interface':util[_0x9711('0x65')]('%s/%s',_0x9711('0x66'),_0x1991e7[_0x9711('0x38')]),'penalty':0x0,'paused':_0x1991e7[_0x9711('0x67')],'createdAt':_0x1991e7[_0x9711('0x64')],'updatedAt':_0x1991e7[_0x9711('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3a34f6,_0x514e32))[_0x9711('0x27')](handleError(_0x3a34f6,null));};exports[_0x9711('0x68')]=function(_0x34184b,_0x3972eb,_0x55aba1){var _0x1d7457={};var _0x1a54d0={};var _0x268d78;var _0x4f1ba4;return db[_0x9711('0x3a')][_0x9711('0x69')]({'where':{'id':_0x34184b[_0x9711('0x50')]['id']}})[_0x9711('0x1d')](handleEntityNotFound(_0x3972eb,null))['then'](function(_0x6d7c95){if(_0x6d7c95){_0x268d78=_0x6d7c95;_0x1a54d0['model']=_[_0x9711('0x3d')](db['Team'][_0x9711('0x3b')]);_0x1a54d0[_0x9711('0x3e')]=_[_0x9711('0x3d')](_0x34184b[_0x9711('0x3e')]);_0x1a54d0[_0x9711('0x3f')]=_[_0x9711('0x40')](_0x1a54d0['model'],_0x1a54d0[_0x9711('0x3e')]);_0x1d7457[_0x9711('0x41')]=_[_0x9711('0x40')](_0x1a54d0[_0x9711('0x3c')],qs[_0x9711('0x42')](_0x34184b[_0x9711('0x3e')]['fields']));_0x1d7457[_0x9711('0x41')]=_0x1d7457['attributes'][_0x9711('0x43')]?_0x1d7457['attributes']:_0x1a54d0[_0x9711('0x3c')];_0x1d7457[_0x9711('0x44')]=qs[_0x9711('0x45')](_0x34184b['query'][_0x9711('0x45')]);_0x1d7457['where']=qs[_0x9711('0x3f')](_['pick'](_0x34184b['query'],_0x1a54d0[_0x9711('0x3f')]));if(_0x34184b['query']['filter']){_0x1d7457[_0x9711('0x46')]=_[_0x9711('0x47')](_0x1d7457[_0x9711('0x46')],{'$or':_[_0x9711('0x60')](_0x1d7457[_0x9711('0x41')],function(_0x17c3b5){var _0x2bc1e4={};_0x2bc1e4[_0x17c3b5]={'$like':'%'+_0x34184b['query']['filter']+'%'};return _0x2bc1e4;})});}_0x1d7457=_[_0x9711('0x47')]({},_0x1d7457,_0x34184b[_0x9711('0x4c')]);return _0x268d78[_0x9711('0x68')](_0x1d7457);}})['then'](function(_0x13d6d9){if(_0x13d6d9){_0x4f1ba4=_0x13d6d9[_0x9711('0x43')];if(!_0x34184b[_0x9711('0x3e')]['hasOwnProperty'](_0x9711('0x5e'))){_0x1d7457[_0x9711('0x2d')]=qs[_0x9711('0x2d')](_0x34184b['query'][_0x9711('0x2d')]);_0x1d7457[_0x9711('0x2c')]=qs[_0x9711('0x2c')](_0x34184b['query'][_0x9711('0x2c')]);}return _0x268d78[_0x9711('0x68')](_0x1d7457);}})[_0x9711('0x1d')](function(_0x3bbf6e){if(_0x3bbf6e){return _0x3bbf6e?{'count':_0x4f1ba4,'rows':_0x3bbf6e}:null;}})[_0x9711('0x1d')](respondWithResult(_0x3972eb,null))[_0x9711('0x27')](handleError(_0x3972eb,null));};exports['addTeams']=function(_0x1b7006,_0x4e714b,_0x505d21){var _0x5ee47c=[];var _0x3dc0b1;return db['Team']['findAll']({'where':{'id':_0x1b7006[_0x9711('0x52')][_0x9711('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x9711('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9711('0x1d')](function(_0x379dca){if(_0x379dca){for(var _0x181fa5=0x0;_0x181fa5<_0x379dca[_0x9711('0x43')];_0x181fa5+=0x1){for(var _0x21fd47=0x0;_0x21fd47<_0x379dca[_0x181fa5]['Agents']['length'];_0x21fd47+=0x1){_0x5ee47c=_['union'](_0x5ee47c,[_0x379dca[_0x181fa5]['Agents'][_0x21fd47]['id']]);}}return _0x5ee47c;}})[_0x9711('0x1d')](function(_0x13a5f4){if(_0x13a5f4){return db[_0x9711('0x3a')][_0x9711('0x59')]({'where':{'id':_0x1b7006[_0x9711('0x50')]['id']}});}})[_0x9711('0x1d')](function(_0x3147b8){if(_0x3147b8){_0x3dc0b1=_0x3147b8;return _0x3dc0b1['addAgents'](_0x5ee47c,{'penalty':_0x1b7006[_0x9711('0x52')][_0x9711('0x6b')]});}})[_0x9711('0x1d')](function(_0x53edcf){if(_0x53edcf){return _0x3dc0b1[_0x9711('0x6c')](_0x1b7006[_0x9711('0x52')][_0x9711('0x6a')]);}})[_0x9711('0x1d')](handleEntityNotFound(_0x4e714b,null))[_0x9711('0x1d')](respondWithStatusCode(_0x4e714b,null))[_0x9711('0x27')](handleError(_0x4e714b,null));};exports[_0x9711('0x6d')]=function(_0x198fc8,_0x5bcf71,_0x572fef){var _0x29ba90=[];var _0x468b80;return db[_0x9711('0x6e')][_0x9711('0x4e')]({'where':{'id':_0x198fc8[_0x9711('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9711('0x61')],'as':_0x9711('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x9711('0x1d')](function(_0x4a3ac0){if(_0x4a3ac0){for(var _0x3e127e=0x0;_0x3e127e<_0x4a3ac0[_0x9711('0x43')];_0x3e127e+=0x1){for(var _0x3c612d=0x0;_0x3c612d<_0x4a3ac0[_0x3e127e]['Agents'][_0x9711('0x43')];_0x3c612d+=0x1){_0x29ba90=_[_0x9711('0x70')](_0x29ba90,[_0x4a3ac0[_0x3e127e]['Agents'][_0x3c612d]['id']]);}}return _0x29ba90;}})[_0x9711('0x1d')](function(_0x842fcd){if(_0x842fcd){return db[_0x9711('0x3a')][_0x9711('0x59')]({'where':{'id':_0x198fc8['params']['id']}});}})['then'](function(_0x513d83){if(_0x513d83){_0x468b80=_0x513d83;return _0x468b80['removeAgents'](_0x29ba90);}})[_0x9711('0x1d')](function(_0x4299a7){if(_0x468b80){return _0x468b80['removeTeams'](_0x198fc8[_0x9711('0x3e')][_0x9711('0x6a')]);}})[_0x9711('0x1d')](handleEntityNotFound(_0x5bcf71,null))['then'](respondWithStatusCode(_0x5bcf71,null))[_0x9711('0x27')](handleError(_0x5bcf71,null));};exports[_0x9711('0x71')]=function(_0x585924,_0x38c843,_0x50a5d8){return db[_0x9711('0x3a')]['find']({'where':{'id':_0x585924['params']['id']}})[_0x9711('0x1d')](handleEntityNotFound(_0x38c843,null))['then'](function(_0x4a9e71){if(_0x4a9e71){return _0x4a9e71[_0x9711('0x71')](_0x585924[_0x9711('0x52')][_0x9711('0x6a')],_[_0x9711('0x72')](_0x585924[_0x9711('0x52')],['ids','id'])||{})[_0x9711('0x73')](function(_0x39bdaf){for(var _0x4403f4=0x0;_0x4403f4<_0x585924[_0x9711('0x52')][_0x9711('0x6a')][_0x9711('0x43')];_0x4403f4+=0x1){socket[_0x9711('0x74')](_0x9711('0x75'),{'UserId':_0x585924[_0x9711('0x52')][_0x9711('0x6a')][_0x4403f4],'ChatQueueId':_0x585924[_0x9711('0x50')]['id']});}return _0x39bdaf;});}})[_0x9711('0x1d')](respondWithResult(_0x38c843,null))[_0x9711('0x27')](handleError(_0x38c843,null));};exports[_0x9711('0x76')]=function(_0x1fbcd3,_0x1a1055,_0x3cc3be){var _0x5400c8;return db[_0x9711('0x3a')]['find']({'where':{'id':_0x1fbcd3['params']['id']}})['then'](handleEntityNotFound(_0x1a1055,null))[_0x9711('0x1d')](function(_0x46371a){if(_0x46371a){return _0x46371a[_0x9711('0x76')](_0x1fbcd3[_0x9711('0x3e')][_0x9711('0x6a')])['then'](function(_0x30aef8){if(_[_0x9711('0x77')](_0x1fbcd3[_0x9711('0x3e')][_0x9711('0x6a')])){for(var _0x38e9ce=0x0;_0x38e9ce<_0x1fbcd3[_0x9711('0x3e')]['ids']['length'];_0x38e9ce+=0x1){socket[_0x9711('0x74')](_0x9711('0x78'),{'UserId':_0x1fbcd3[_0x9711('0x3e')][_0x9711('0x6a')][_0x38e9ce],'ChatQueueId':_0x1fbcd3[_0x9711('0x50')]['id']});}}else{socket['emit'](_0x9711('0x78'),{'UserId':_0x1fbcd3[_0x9711('0x3e')][_0x9711('0x6a')],'ChatQueueId':_0x1fbcd3[_0x9711('0x50')]['id']});}});}})[_0x9711('0x1d')](respondWithStatusCode(_0x1a1055,null))[_0x9711('0x27')](handleError(_0x1a1055,null));};exports[_0x9711('0x79')]=function(_0x440a7d,_0x2682eb,_0x4663ba){var _0x21c25c={};var _0x444e46={};var _0x5ee366;var _0x1c4f2a;return db[_0x9711('0x3a')][_0x9711('0x69')]({'where':{'id':_0x440a7d[_0x9711('0x50')]['id']}})['then'](handleEntityNotFound(_0x2682eb,null))[_0x9711('0x1d')](function(_0x44e6b0){if(_0x44e6b0){_0x5ee366=_0x44e6b0;_0x444e46['model']=_[_0x9711('0x3d')](db['User'][_0x9711('0x3b')]);_0x444e46[_0x9711('0x3e')]=_[_0x9711('0x3d')](_0x440a7d[_0x9711('0x3e')]);_0x444e46[_0x9711('0x3f')]=_[_0x9711('0x40')](_0x444e46[_0x9711('0x3c')],_0x444e46['query']);_0x21c25c[_0x9711('0x41')]=_[_0x9711('0x40')](_0x444e46[_0x9711('0x3c')],qs[_0x9711('0x42')](_0x440a7d[_0x9711('0x3e')][_0x9711('0x42')]));_0x21c25c[_0x9711('0x41')]=_0x21c25c['attributes'][_0x9711('0x43')]?_0x21c25c['attributes']:_0x444e46[_0x9711('0x3c')];_0x21c25c['order']=qs['sort'](_0x440a7d[_0x9711('0x3e')][_0x9711('0x45')]);_0x21c25c['where']=qs[_0x9711('0x3f')](_[_0x9711('0x5f')](_0x440a7d[_0x9711('0x3e')],_0x444e46[_0x9711('0x3f')]));if(_0x440a7d['query']['filter']){_0x21c25c[_0x9711('0x46')]=_['merge'](_0x21c25c[_0x9711('0x46')],{'$or':_[_0x9711('0x60')](_0x21c25c[_0x9711('0x41')],function(_0x2f8770){var _0x2d357c={};_0x2d357c[_0x2f8770]={'$like':'%'+_0x440a7d[_0x9711('0x3e')]['filter']+'%'};return _0x2d357c;})});}_0x21c25c=_['merge']({},_0x21c25c,_0x440a7d[_0x9711('0x4c')]);return _0x5ee366[_0x9711('0x79')](_0x21c25c);}})['then'](function(_0x5a5aba){if(_0x5a5aba){_0x1c4f2a=_0x5a5aba['length'];if(!_0x440a7d[_0x9711('0x3e')][_0x9711('0x5d')](_0x9711('0x5e'))){_0x21c25c['limit']=qs['limit'](_0x440a7d[_0x9711('0x3e')][_0x9711('0x2d')]);_0x21c25c[_0x9711('0x2c')]=qs[_0x9711('0x2c')](_0x440a7d[_0x9711('0x3e')][_0x9711('0x2c')]);}return _0x5ee366['getAgents'](_0x21c25c);}})[_0x9711('0x1d')](function(_0x33a4a8){if(_0x33a4a8){return _0x33a4a8?{'count':_0x1c4f2a,'rows':_0x33a4a8}:null;}})[_0x9711('0x1d')](respondWithResult(_0x2682eb,null))['catch'](handleError(_0x2682eb,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 0ee1a71..a9b25c5 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 _0x52b8=['hook','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x414384,_0x5c7b26){var _0x1a558d=function(_0x2aa64d){while(--_0x2aa64d){_0x414384['push'](_0x414384['shift']());}};_0x1a558d(++_0x5c7b26);}(_0x52b8,0xd3));var _0x852b=function(_0x498120,_0x126601){_0x498120=_0x498120-0x0;var _0x2309bb=_0x52b8[_0x498120];return _0x2309bb;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x852b('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x852b('0x1')](0x0);var events={'afterCreate':_0x852b('0x2'),'afterUpdate':'update','afterDestroy':_0x852b('0x3')};function emitEvent(_0x581541){return function(_0x649e7e,_0x55b989,_0x4fb699){ChatQueueEvents[_0x852b('0x4')](_0x581541+':'+_0x649e7e['id'],_0x649e7e);ChatQueueEvents['emit'](_0x581541,_0x649e7e);_0x4fb699(null);};}for(var e in events){if(events[_0x852b('0x5')](e)){var event=events[e];ChatQueue[_0x852b('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x2697=['../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3ad905,_0x3c3ce0){var _0x2aa3f3=function(_0x20727f){while(--_0x20727f){_0x3ad905['push'](_0x3ad905['shift']());}};_0x2aa3f3(++_0x3c3ce0);}(_0x2697,0x120));var _0x7269=function(_0x5d6e35,_0x4d1ac0){_0x5d6e35=_0x5d6e35-0x0;var _0x5d7ada=_0x2697[_0x5d6e35];return _0x5d7ada;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x7269('0x0'))['db'][_0x7269('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7269('0x2')](0x0);var events={'afterCreate':_0x7269('0x3'),'afterUpdate':_0x7269('0x4'),'afterDestroy':'remove'};function emitEvent(_0x160a89){return function(_0x4a084b,_0x5bc3e4,_0x2b2be8){ChatQueueEvents[_0x7269('0x5')](_0x160a89+':'+_0x4a084b['id'],_0x4a084b);ChatQueueEvents[_0x7269('0x5')](_0x160a89,_0x4a084b);_0x2b2be8(null);};}for(var e in events){if(events[_0x7269('0x6')](e)){var event=events[e];ChatQueue[_0x7269('0x7')](e,emitEvent(event));}}module[_0x7269('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 1e86f13..8f7ecaa 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 _0x9957=['exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','./chatQueue.attributes'];(function(_0x54dd48,_0x2e419f){var _0x5e1f6b=function(_0x37b9a4){while(--_0x37b9a4){_0x54dd48['push'](_0x54dd48['shift']());}};_0x5e1f6b(++_0x2e419f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var attributes=require(_0x7995('0x6'));module[_0x7995('0x7')]=function(_0x576d89,_0x744bea){return _0x576d89[_0x7995('0x8')](_0x7995('0x9'),attributes,{'tableName':_0x7995('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','./chatQueue.attributes','define'];(function(_0x114984,_0x5c9593){var _0x44822b=function(_0x10af37){while(--_0x10af37){_0x114984['push'](_0x114984['shift']());}};_0x44822b(++_0x5c9593);}(_0x5fc3,0xa8));var _0x35fc=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0x5fc3[_0x590851];return _0x3b0115;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var attributes=require(_0x35fc('0x6'));module['exports']=function(_0x2d1404,_0x1d5fec){return _0x2d1404[_0x35fc('0x7')]('ChatQueue',attributes,{'tableName':'chat_queues','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 a74477f..3848801 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 _0x1e56=['ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','catch','then','ShowChatQueue','stringify','lodash','util','moment','bluebird','ioredis','../../config/logger','http','redis','defaults','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x176c71,_0x1d39f9){var _0x1a7943=function(_0x38d91d){while(--_0x38d91d){_0x176c71['push'](_0x176c71['shift']());}};_0x1a7943(++_0x1d39f9);}(_0x1e56,0xed));var _0x61e5=function(_0x1a13be,_0x457f47){_0x1a13be=_0x1a13be-0x0;var _0x3b082f=_0x1e56[_0x1a13be];return _0x3b082f;};'use strict';var _=require(_0x61e5('0x0'));var util=require(_0x61e5('0x1'));var moment=require(_0x61e5('0x2'));var BPromise=require(_0x61e5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61e5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x61e5('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x61e5('0x6')]({'port':0x232a});config[_0x61e5('0x7')]=_[_0x61e5('0x8')](config[_0x61e5('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x61e5('0x7')]));require(_0x61e5('0x9'))[_0x61e5('0xa')](socket);function respondWithRpcPromise(_0x5eff0f,_0x1c3734,_0x4d727b){return new BPromise(function(_0x5322d8,_0x2621f0){return client[_0x61e5('0xb')](_0x5eff0f,_0x4d727b)['then'](function(_0x4849ab){logger[_0x61e5('0xc')](_0x61e5('0xd'),_0x1c3734,_0x61e5('0xe'));logger['debug'](_0x61e5('0xf'),_0x1c3734,'request\x20sent',JSON['stringify'](_0x4849ab));if(_0x4849ab[_0x61e5('0x10')]){if(_0x4849ab[_0x61e5('0x10')][_0x61e5('0x11')]===0x1f4){logger['error'](_0x61e5('0xd'),_0x1c3734,_0x4849ab[_0x61e5('0x10')][_0x61e5('0x12')]);return _0x2621f0(_0x4849ab['error'][_0x61e5('0x12')]);}logger[_0x61e5('0x10')](_0x61e5('0xd'),_0x1c3734,_0x4849ab['error'][_0x61e5('0x12')]);return _0x5322d8(_0x4849ab['error']['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x1c3734,_0x61e5('0xe'));_0x5322d8(_0x4849ab[_0x61e5('0x13')]['message']);}})['catch'](function(_0x116933){logger['error'](_0x61e5('0xd'),_0x1c3734,_0x116933);_0x2621f0(_0x116933);});});}exports[_0x61e5('0x14')]=function(_0x1f76d7){var _0xedf5f5=this;return new Promise(function(_0x4e3d12,_0x2903b2){return db[_0x61e5('0x15')][_0x61e5('0x16')]({'raw':_0x1f76d7[_0x61e5('0x17')]?_0x1f76d7[_0x61e5('0x17')][_0x61e5('0x18')]===undefined?!![]:![]:!![],'where':_0x1f76d7[_0x61e5('0x17')]?_0x1f76d7[_0x61e5('0x17')][_0x61e5('0x19')]||null:null,'attributes':_0x1f76d7['options']?_0x1f76d7[_0x61e5('0x17')][_0x61e5('0x1a')]||null:null,'limit':_0x1f76d7['options']?_0x1f76d7[_0x61e5('0x17')][_0x61e5('0x1b')]||null:null,'include':_0x1f76d7[_0x61e5('0x17')]?_0x1f76d7[_0x61e5('0x17')][_0x61e5('0x1c')]?_['map'](_0x1f76d7['options'][_0x61e5('0x1c')],function(_0x19a950){return{'model':db[_0x19a950['model']],'as':_0x19a950['as'],'attributes':_0x19a950[_0x61e5('0x1a')],'include':_0x19a950[_0x61e5('0x1c')]?_['map'](_0x19a950[_0x61e5('0x1c')],function(_0x4a8590){return{'model':db[_0x4a8590[_0x61e5('0x1d')]],'as':_0x4a8590['as'],'attributes':_0x4a8590['attributes'],'include':_0x4a8590[_0x61e5('0x1c')]?_[_0x61e5('0x1e')](_0x4a8590[_0x61e5('0x1c')],function(_0x3d2dc9){return{'model':db[_0x3d2dc9[_0x61e5('0x1d')]],'as':_0x3d2dc9['as'],'attributes':_0x3d2dc9[_0x61e5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29c9dc){logger[_0x61e5('0xc')](_0x61e5('0x14'),_0x1f76d7);logger[_0x61e5('0x1f')](_0x61e5('0x14'),_0x1f76d7,JSON['stringify'](_0x29c9dc));_0x4e3d12(_0x29c9dc);})[_0x61e5('0x20')](function(_0x12c507){logger[_0x61e5('0x10')](_0x61e5('0x14'),_0x12c507[_0x61e5('0x12')],_0x1f76d7);_0x2903b2(_0xedf5f5[_0x61e5('0x10')](0x1f4,_0x12c507['message']));});});};exports['ShowChatQueue']=function(_0x5ad5a2){var _0x5a2e21=this;return new Promise(function(_0x76fcbf,_0x503964){return db[_0x61e5('0x15')]['find']({'raw':_0x5ad5a2['options']?_0x5ad5a2[_0x61e5('0x17')][_0x61e5('0x18')]===undefined?!![]:![]:!![],'where':_0x5ad5a2[_0x61e5('0x17')]?_0x5ad5a2['options'][_0x61e5('0x19')]||null:null,'attributes':_0x5ad5a2['options']?_0x5ad5a2[_0x61e5('0x17')][_0x61e5('0x1a')]||null:null,'include':_0x5ad5a2['options']?_0x5ad5a2[_0x61e5('0x17')][_0x61e5('0x1c')]?_[_0x61e5('0x1e')](_0x5ad5a2[_0x61e5('0x17')][_0x61e5('0x1c')],function(_0x2f6a3e){return{'model':db[_0x2f6a3e[_0x61e5('0x1d')]],'as':_0x2f6a3e['as'],'attributes':_0x2f6a3e[_0x61e5('0x1a')],'include':_0x2f6a3e['include']?_[_0x61e5('0x1e')](_0x2f6a3e[_0x61e5('0x1c')],function(_0x3bea24){return{'model':db[_0x3bea24[_0x61e5('0x1d')]],'as':_0x3bea24['as'],'attributes':_0x3bea24[_0x61e5('0x1a')],'include':_0x3bea24[_0x61e5('0x1c')]?_[_0x61e5('0x1e')](_0x3bea24[_0x61e5('0x1c')],function(_0x1028fd){return{'model':db[_0x1028fd[_0x61e5('0x1d')]],'as':_0x1028fd['as'],'attributes':_0x1028fd['attributes']};}):[]};}):[]};}):[]:[]})[_0x61e5('0x21')](function(_0x1f3d94){logger[_0x61e5('0xc')](_0x61e5('0x22'),_0x5ad5a2);logger[_0x61e5('0x1f')](_0x61e5('0x22'),_0x5ad5a2,JSON[_0x61e5('0x23')](_0x1f3d94));_0x76fcbf(_0x1f3d94);})['catch'](function(_0x308513){logger['error']('ShowChatQueue',_0x308513[_0x61e5('0x12')],_0x5ad5a2);_0x503964(_0x5a2e21[_0x61e5('0x10')](0x1f4,_0x308513[_0x61e5('0x12')]));});});}; \ No newline at end of file +var _0x49c1=['redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','catch','GetChatQueue','ChatQueue','options','raw','where','include','attributes','map','model','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http'];(function(_0x5d5632,_0x16cf0b){var _0x41b3b0=function(_0x52517d){while(--_0x52517d){_0x5d5632['push'](_0x5d5632['shift']());}};_0x41b3b0(++_0x16cf0b);}(_0x49c1,0xc8));var _0x149c=function(_0x31494d,_0x107fa5){_0x31494d=_0x31494d-0x0;var _0x399a40=_0x49c1[_0x31494d];return _0x399a40;};'use strict';var _=require(_0x149c('0x0'));var util=require(_0x149c('0x1'));var moment=require(_0x149c('0x2'));var BPromise=require(_0x149c('0x3'));var rs=require(_0x149c('0x4'));var fs=require('fs');var Redis=require(_0x149c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x149c('0x6'));var config=require(_0x149c('0x7'));var jayson=require(_0x149c('0x8'));var client=jayson['client'][_0x149c('0x9')]({'port':0x232a});config[_0x149c('0xa')]=_[_0x149c('0xb')](config[_0x149c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x149c('0xc'))(new Redis(config[_0x149c('0xa')]));require('./chatQueue.socket')[_0x149c('0xd')](socket);function respondWithRpcPromise(_0x1497d9,_0x12d78f,_0x4c10e5){return new BPromise(function(_0xaeb4cb,_0x17d5e9){return client[_0x149c('0xe')](_0x1497d9,_0x4c10e5)[_0x149c('0xf')](function(_0xde4051){logger[_0x149c('0x10')]('ChatQueue,\x20%s,\x20%s',_0x12d78f,_0x149c('0x11'));logger[_0x149c('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x12d78f,_0x149c('0x11'),JSON[_0x149c('0x13')](_0xde4051));if(_0xde4051['error']){if(_0xde4051[_0x149c('0x14')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x12d78f,_0xde4051[_0x149c('0x14')][_0x149c('0x15')]);return _0x17d5e9(_0xde4051[_0x149c('0x14')][_0x149c('0x15')]);}logger[_0x149c('0x14')](_0x149c('0x16'),_0x12d78f,_0xde4051[_0x149c('0x14')]['message']);return _0xaeb4cb(_0xde4051['error']['message']);}else{logger[_0x149c('0x10')](_0x149c('0x16'),_0x12d78f,_0x149c('0x11'));_0xaeb4cb(_0xde4051[_0x149c('0x17')]['message']);}})[_0x149c('0x18')](function(_0x27c13c){logger[_0x149c('0x14')](_0x149c('0x16'),_0x12d78f,_0x27c13c);_0x17d5e9(_0x27c13c);});});}exports[_0x149c('0x19')]=function(_0x561a81){var _0x5ed9ab=this;return new Promise(function(_0x28766a,_0x1436ac){return db[_0x149c('0x1a')]['findAll']({'raw':_0x561a81[_0x149c('0x1b')]?_0x561a81[_0x149c('0x1b')][_0x149c('0x1c')]===undefined?!![]:![]:!![],'where':_0x561a81[_0x149c('0x1b')]?_0x561a81[_0x149c('0x1b')][_0x149c('0x1d')]||null:null,'attributes':_0x561a81[_0x149c('0x1b')]?_0x561a81[_0x149c('0x1b')]['attributes']||null:null,'limit':_0x561a81[_0x149c('0x1b')]?_0x561a81[_0x149c('0x1b')]['limit']||null:null,'include':_0x561a81[_0x149c('0x1b')]?_0x561a81[_0x149c('0x1b')]['include']?_['map'](_0x561a81['options'][_0x149c('0x1e')],function(_0x36af53){return{'model':db[_0x36af53['model']],'as':_0x36af53['as'],'attributes':_0x36af53[_0x149c('0x1f')],'include':_0x36af53['include']?_[_0x149c('0x20')](_0x36af53[_0x149c('0x1e')],function(_0x90ad6d){return{'model':db[_0x90ad6d[_0x149c('0x21')]],'as':_0x90ad6d['as'],'attributes':_0x90ad6d[_0x149c('0x1f')],'include':_0x90ad6d['include']?_[_0x149c('0x20')](_0x90ad6d['include'],function(_0x24c989){return{'model':db[_0x24c989[_0x149c('0x21')]],'as':_0x24c989['as'],'attributes':_0x24c989['attributes']};}):[]};}):[]};}):[]:[]})[_0x149c('0xf')](function(_0x141ec5){logger['info'](_0x149c('0x19'),_0x561a81);logger[_0x149c('0x12')](_0x149c('0x19'),_0x561a81,JSON[_0x149c('0x13')](_0x141ec5));_0x28766a(_0x141ec5);})['catch'](function(_0x28d009){logger['error'](_0x149c('0x19'),_0x28d009[_0x149c('0x15')],_0x561a81);_0x1436ac(_0x5ed9ab[_0x149c('0x14')](0x1f4,_0x28d009[_0x149c('0x15')]));});});};exports[_0x149c('0x22')]=function(_0x5e2d48){var _0x1365c6=this;return new Promise(function(_0x4e98bb,_0xce0510){return db[_0x149c('0x1a')]['find']({'raw':_0x5e2d48[_0x149c('0x1b')]?_0x5e2d48[_0x149c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5e2d48[_0x149c('0x1b')]?_0x5e2d48[_0x149c('0x1b')]['where']||null:null,'attributes':_0x5e2d48[_0x149c('0x1b')]?_0x5e2d48[_0x149c('0x1b')]['attributes']||null:null,'include':_0x5e2d48[_0x149c('0x1b')]?_0x5e2d48[_0x149c('0x1b')]['include']?_[_0x149c('0x20')](_0x5e2d48[_0x149c('0x1b')][_0x149c('0x1e')],function(_0x8f1f39){return{'model':db[_0x8f1f39[_0x149c('0x21')]],'as':_0x8f1f39['as'],'attributes':_0x8f1f39['attributes'],'include':_0x8f1f39[_0x149c('0x1e')]?_[_0x149c('0x20')](_0x8f1f39[_0x149c('0x1e')],function(_0x59979c){return{'model':db[_0x59979c[_0x149c('0x21')]],'as':_0x59979c['as'],'attributes':_0x59979c[_0x149c('0x1f')],'include':_0x59979c[_0x149c('0x1e')]?_[_0x149c('0x20')](_0x59979c[_0x149c('0x1e')],function(_0x246275){return{'model':db[_0x246275[_0x149c('0x21')]],'as':_0x246275['as'],'attributes':_0x246275[_0x149c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x149c('0xf')](function(_0x2bae9a){logger[_0x149c('0x10')](_0x149c('0x22'),_0x5e2d48);logger[_0x149c('0x12')](_0x149c('0x22'),_0x5e2d48,JSON[_0x149c('0x13')](_0x2bae9a));_0x4e98bb(_0x2bae9a);})[_0x149c('0x18')](function(_0x261611){logger[_0x149c('0x14')](_0x149c('0x22'),_0x261611[_0x149c('0x15')],_0x5e2d48);_0xce0510(_0x1365c6['error'](0x1f4,_0x261611[_0x149c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 09748f9..f984ead 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(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 d3dd641..bc665dc 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 _0x5428=['index','/describe','getMembers','/:id/teams','getTeams','/:id/users','create','post','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated'];(function(_0x5c6e17,_0x32dcf8){var _0x363d19=function(_0x52c277){while(--_0x52c277){_0x5c6e17['push'](_0x5c6e17['shift']());}};_0x363d19(++_0x32dcf8);}(_0x5428,0xc6));var _0x8542=function(_0x559680,_0x21035f){_0x559680=_0x559680-0x0;var _0x4f4965=_0x5428[_0x559680];return _0x4f4965;};'use strict';var multer=require(_0x8542('0x0'));var util=require(_0x8542('0x1'));var path=require(_0x8542('0x2'));var timeout=require('connect-timeout');var express=require(_0x8542('0x3'));var router=express[_0x8542('0x4')]();var auth=require(_0x8542('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8542('0x6'));var controller=require(_0x8542('0x7'));router[_0x8542('0x8')]('/',auth[_0x8542('0x9')](),controller[_0x8542('0xa')]);router[_0x8542('0x8')](_0x8542('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x8542('0x8')]('/:id',auth[_0x8542('0x9')](),controller['show']);router[_0x8542('0x8')]('/:id/members',auth[_0x8542('0x9')](),controller[_0x8542('0xc')]);router['get'](_0x8542('0xd'),auth[_0x8542('0x9')](),controller[_0x8542('0xe')]);router['get'](_0x8542('0xf'),auth[_0x8542('0x9')](),controller['getAgents']);router['post']('/',auth[_0x8542('0x9')](),controller[_0x8542('0x10')]);router[_0x8542('0x11')](_0x8542('0xd'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x8542('0xf'),auth[_0x8542('0x9')](),controller[_0x8542('0x12')]);router[_0x8542('0x13')]('/:id',auth[_0x8542('0x9')](),controller[_0x8542('0x14')]);router[_0x8542('0x15')](_0x8542('0x16'),auth[_0x8542('0x9')](),controller[_0x8542('0x17')]);router[_0x8542('0x15')](_0x8542('0xd'),auth[_0x8542('0x9')](),controller[_0x8542('0x18')]);router[_0x8542('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0x8542('0x19')]);module['exports']=router; \ No newline at end of file +var _0x7a94=['express','Router','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','util','connect-timeout'];(function(_0x421165,_0x27fa31){var _0x3cf3cc=function(_0xd9c5ee){while(--_0xd9c5ee){_0x421165['push'](_0x421165['shift']());}};_0x3cf3cc(++_0x27fa31);}(_0x7a94,0x177));var _0x47a9=function(_0x3482d4,_0x296dae){_0x3482d4=_0x3482d4-0x0;var _0x50d9ba=_0x7a94[_0x3482d4];return _0x50d9ba;};'use strict';var multer=require('multer');var util=require(_0x47a9('0x0'));var path=require('path');var timeout=require(_0x47a9('0x1'));var express=require(_0x47a9('0x2'));var router=express[_0x47a9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a9('0x4'));var config=require(_0x47a9('0x5'));var controller=require(_0x47a9('0x6'));router[_0x47a9('0x7')]('/',auth[_0x47a9('0x8')](),controller[_0x47a9('0x9')]);router['get'](_0x47a9('0xa'),auth[_0x47a9('0x8')](),controller[_0x47a9('0xb')]);router[_0x47a9('0x7')](_0x47a9('0xc'),auth['isAuthenticated'](),controller[_0x47a9('0xd')]);router['get']('/:id/members',auth[_0x47a9('0x8')](),controller[_0x47a9('0xe')]);router[_0x47a9('0x7')](_0x47a9('0xf'),auth[_0x47a9('0x8')](),controller[_0x47a9('0x10')]);router[_0x47a9('0x7')](_0x47a9('0x11'),auth['isAuthenticated'](),controller[_0x47a9('0x12')]);router[_0x47a9('0x13')]('/',auth['isAuthenticated'](),controller[_0x47a9('0x14')]);router[_0x47a9('0x13')](_0x47a9('0xf'),auth[_0x47a9('0x8')](),controller[_0x47a9('0x15')]);router[_0x47a9('0x13')]('/:id/users',auth[_0x47a9('0x8')](),controller[_0x47a9('0x16')]);router[_0x47a9('0x17')]('/:id',auth[_0x47a9('0x8')](),controller[_0x47a9('0x18')]);router[_0x47a9('0x19')](_0x47a9('0xc'),auth[_0x47a9('0x8')](),controller[_0x47a9('0x1a')]);router['delete'](_0x47a9('0xf'),auth[_0x47a9('0x8')](),controller[_0x47a9('0x1b')]);router[_0x47a9('0x19')](_0x47a9('0x11'),auth['isAuthenticated'](),controller[_0x47a9('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index d139caf..35bc390 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 _0x55db=['sequelize','exports','STRING','DATE','moment'];(function(_0x5d6dfc,_0x43d8d4){var _0x1bfa18=function(_0x2eafcf){while(--_0x2eafcf){_0x5d6dfc['push'](_0x5d6dfc['shift']());}};_0x1bfa18(++_0x43d8d4);}(_0x55db,0xea));var _0xb55d=function(_0x4d8fe4,_0x5c443c){_0x4d8fe4=_0x4d8fe4-0x0;var _0x392229=_0x55db[_0x4d8fe4];return _0x392229;};'use strict';var moment=require(_0xb55d('0x0'));var Sequelize=require(_0xb55d('0x1'));module[_0xb55d('0x2')]={'uniqueid':{'type':Sequelize[_0xb55d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb55d('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb55d('0x4')]},'exitAt':{'type':Sequelize[_0xb55d('0x4')]},'reason':{'type':Sequelize[_0xb55d('0x3')]}}; \ No newline at end of file +var _0x79bf=['exports','STRING','DATE','moment','sequelize'];(function(_0x4705b0,_0x547543){var _0xe16e86=function(_0x1a3c6f){while(--_0x1a3c6f){_0x4705b0['push'](_0x4705b0['shift']());}};_0xe16e86(++_0x547543);}(_0x79bf,0x76));var _0xf79b=function(_0x3e5147,_0x33eef9){_0x3e5147=_0x3e5147-0x0;var _0x18c779=_0x79bf[_0x3e5147];return _0x18c779;};'use strict';var moment=require(_0xf79b('0x0'));var Sequelize=require(_0xf79b('0x1'));module[_0xf79b('0x2')]={'uniqueid':{'type':Sequelize[_0xf79b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf79b('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf79b('0x4')]},'acceptAt':{'type':Sequelize[_0xf79b('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf79b('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 3b6283e..f979a4b 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 _0x3829=['filter','where','map','key','field','merge','options','ChatQueueReport','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','crypto','desk.js','to-csv','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../mysqldb','sendStatus','status','end','offset','limit','set','reject','save','update','then','destroy','error','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort'];(function(_0xc0a106,_0x3db985){var _0x5529c1=function(_0x36a8d9){while(--_0x36a8d9){_0xc0a106['push'](_0xc0a106['shift']());}};_0x5529c1(++_0x3db985);}(_0x3829,0xd4));var _0x9382=function(_0x38e76d,_0x5e0345){_0x38e76d=_0x38e76d-0x0;var _0x4fd6fc=_0x3829[_0x38e76d];return _0x4fd6fc;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9382('0x0'));var jsonpatch=require(_0x9382('0x1'));var rp=require(_0x9382('0x2'));var moment=require(_0x9382('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9382('0x4'));var util=require(_0x9382('0x5'));var path=require(_0x9382('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9382('0x7'));var fs=require('fs');var _=require(_0x9382('0x8'));var squel=require('squel');var crypto=require(_0x9382('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9382('0xa'));var toCsv=require(_0x9382('0xb'));var querystring=require('querystring');var Papa=require(_0x9382('0xc'));var authService=require(_0x9382('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x9382('0xe'));var qs=require(_0x9382('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x9382('0x10'))['db'];function respondWithStatusCode(_0x4b98cb,_0x4d1b57){_0x4d1b57=_0x4d1b57||0xcc;return function(_0x4c391d){if(_0x4c391d){return _0x4b98cb[_0x9382('0x11')](_0x4d1b57);}return _0x4b98cb[_0x9382('0x12')](_0x4d1b57)[_0x9382('0x13')]();};}function respondWithResult(_0x53ede9,_0x2443a4){_0x2443a4=_0x2443a4||0xc8;return function(_0x507c12){if(_0x507c12){return _0x53ede9[_0x9382('0x12')](_0x2443a4)['json'](_0x507c12);}};}function respondWithFilteredResult(_0x35c73b,_0x900540){return function(_0x3c27e2){if(_0x3c27e2){var _0x268399=_0x3c27e2['count'],_0x140037=_0x900540[_0x9382('0x14')],_0x564c13=_0x900540[_0x9382('0x14')]+_0x900540[_0x9382('0x15')],_0x5e95ec;if(_0x564c13>=_0x268399){_0x564c13=_0x268399;_0x5e95ec=0xc8;}else{_0x5e95ec=0xce;}_0x35c73b[_0x9382('0x12')](_0x5e95ec);return _0x35c73b[_0x9382('0x16')]('Content-Range',_0x140037+'-'+_0x564c13+'/'+_0x268399)['json'](_0x3c27e2);}return null;};}function patchUpdates(_0x1e3daa){return function(_0x2750f8){try{jsonpatch['apply'](_0x2750f8,_0x1e3daa,!![]);}catch(_0x5afccb){return BPromise[_0x9382('0x17')](_0x5afccb);}return _0x2750f8[_0x9382('0x18')]();};}function saveUpdates(_0x3d17a4,_0x56d71d){return function(_0x231cab){if(_0x231cab){return _0x231cab[_0x9382('0x19')](_0x3d17a4)[_0x9382('0x1a')](function(_0x6ee850){return _0x6ee850;});}return null;};}function removeEntity(_0x19df9e,_0x3363bc){return function(_0x219429){if(_0x219429){return _0x219429[_0x9382('0x1b')]()[_0x9382('0x1a')](function(){_0x19df9e['status'](0xcc)[_0x9382('0x13')]();});}};}function handleEntityNotFound(_0x279b1f,_0x20826b){return function(_0x3cb2c1){if(!_0x3cb2c1){_0x279b1f[_0x9382('0x11')](0x194);}return _0x3cb2c1;};}function handleError(_0x47d353,_0x4b3d4f){_0x4b3d4f=_0x4b3d4f||0x1f4;return function(_0x1e0832){logger[_0x9382('0x1c')](_0x1e0832['stack']);if(_0x1e0832[_0x9382('0x1d')]){delete _0x1e0832[_0x9382('0x1d')];}_0x47d353[_0x9382('0x12')](_0x4b3d4f)[_0x9382('0x1e')](_0x1e0832);};}exports[_0x9382('0x1f')]=function(_0x449da1,_0x4e8e13){var _0x48cc0d={},_0x168c57={},_0x382011={'count':0x0,'rows':[]};var _0xf27af2=db['ChatQueueReport'][_0x9382('0x20')];_0x168c57[_0x9382('0x21')]=_['keys'](_0xf27af2);_0x168c57['query']=_[_0x9382('0x22')](_0x449da1[_0x9382('0x23')]);_0x168c57[_0x9382('0x24')]=_['intersection'](_0x168c57[_0x9382('0x21')],_0x168c57[_0x9382('0x23')]);_0x48cc0d[_0x9382('0x25')]=_[_0x9382('0x26')](_0x168c57[_0x9382('0x21')],qs['fields'](_0x449da1[_0x9382('0x23')][_0x9382('0x27')]));_0x48cc0d[_0x9382('0x25')]=_0x48cc0d[_0x9382('0x25')][_0x9382('0x28')]?_0x48cc0d['attributes']:_0x168c57[_0x9382('0x21')];if(!_0x449da1[_0x9382('0x23')][_0x9382('0x29')](_0x9382('0x2a'))){_0x48cc0d[_0x9382('0x15')]=qs[_0x9382('0x15')](_0x449da1['query'][_0x9382('0x15')]);_0x48cc0d['offset']=qs[_0x9382('0x14')](_0x449da1[_0x9382('0x23')]['offset']);}_0x48cc0d['order']=qs['sort'](_0x449da1[_0x9382('0x23')][_0x9382('0x2b')]);_0x48cc0d['where']=qs['filters'](_['pick'](_0x449da1[_0x9382('0x23')],_0x168c57[_0x9382('0x24')]));if(_0x449da1[_0x9382('0x23')][_0x9382('0x2c')]){_0x48cc0d[_0x9382('0x2d')]=_['merge'](_0x48cc0d['where'],{'$or':_[_0x9382('0x2e')](_0xf27af2,function(_0x3be1e7){if(_0x3be1e7['type'][_0x9382('0x2f')]!=='VIRTUAL'){var _0x12fd9d={};_0x12fd9d[_0x3be1e7[_0x9382('0x30')]]={'$like':'%'+_0x449da1[_0x9382('0x23')][_0x9382('0x2c')]+'%'};return _0x12fd9d;}})});}_0x48cc0d=_[_0x9382('0x31')]({},_0x48cc0d,_0x449da1[_0x9382('0x32')]);var _0x372e0f={'where':_0x48cc0d[_0x9382('0x2d')]};return db[_0x9382('0x33')][_0x9382('0x34')](_0x372e0f)[_0x9382('0x1a')](function(_0x28cfea){_0x382011[_0x9382('0x34')]=_0x28cfea;if(_0x449da1['query'][_0x9382('0x35')]){_0x48cc0d[_0x9382('0x36')]=[{'all':!![]}];}return db[_0x9382('0x33')][_0x9382('0x37')](_0x48cc0d);})[_0x9382('0x1a')](function(_0xc7c21b){_0x382011[_0x9382('0x38')]=_0xc7c21b;return _0x382011;})[_0x9382('0x1a')](respondWithFilteredResult(_0x4e8e13,_0x48cc0d))['catch'](handleError(_0x4e8e13,null));};exports[_0x9382('0x39')]=function(_0x29d880,_0x2eb65d){var _0x3e2020={'raw':!![],'where':{'id':_0x29d880[_0x9382('0x3a')]['id']}},_0x515f35={};_0x515f35[_0x9382('0x21')]=_['keys'](db[_0x9382('0x33')]['rawAttributes']);_0x515f35[_0x9382('0x23')]=_['keys'](_0x29d880[_0x9382('0x23')]);_0x515f35[_0x9382('0x24')]=_['intersection'](_0x515f35['model'],_0x515f35['query']);_0x3e2020[_0x9382('0x25')]=_['intersection'](_0x515f35[_0x9382('0x21')],qs['fields'](_0x29d880[_0x9382('0x23')][_0x9382('0x27')]));_0x3e2020[_0x9382('0x25')]=_0x3e2020['attributes'][_0x9382('0x28')]?_0x3e2020[_0x9382('0x25')]:_0x515f35[_0x9382('0x21')];if(_0x29d880['query'][_0x9382('0x35')]){_0x3e2020['include']=[{'all':!![]}];}_0x3e2020=_[_0x9382('0x31')]({},_0x3e2020,_0x29d880[_0x9382('0x32')]);return db[_0x9382('0x33')][_0x9382('0x3b')](_0x3e2020)[_0x9382('0x1a')](handleEntityNotFound(_0x2eb65d,null))['then'](respondWithResult(_0x2eb65d,null))[_0x9382('0x3c')](handleError(_0x2eb65d,null));};exports[_0x9382('0x3d')]=function(_0x3c7af9,_0x58517f){return db['ChatQueueReport'][_0x9382('0x3d')](_0x3c7af9['body'],{})[_0x9382('0x1a')](respondWithResult(_0x58517f,0xc9))['catch'](handleError(_0x58517f,null));};exports[_0x9382('0x19')]=function(_0x15d49f,_0x5b5d1a){if(_0x15d49f['body']['id']){delete _0x15d49f[_0x9382('0x3e')]['id'];}return db['ChatQueueReport'][_0x9382('0x3b')]({'where':{'id':_0x15d49f[_0x9382('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5b5d1a,null))[_0x9382('0x1a')](saveUpdates(_0x15d49f[_0x9382('0x3e')],null))[_0x9382('0x1a')](respondWithResult(_0x5b5d1a,null))['catch'](handleError(_0x5b5d1a,null));};exports[_0x9382('0x1b')]=function(_0x47087d,_0x414d6e){return db['ChatQueueReport'][_0x9382('0x3b')]({'where':{'id':_0x47087d[_0x9382('0x3a')]['id']}})[_0x9382('0x1a')](handleEntityNotFound(_0x414d6e,null))[_0x9382('0x1a')](removeEntity(_0x414d6e,null))['catch'](handleError(_0x414d6e,null));};exports[_0x9382('0x3f')]=function(_0x30929a,_0x5e4156){return db[_0x9382('0x33')][_0x9382('0x3f')]()[_0x9382('0x1a')](respondWithResult(_0x5e4156,null))['catch'](handleError(_0x5e4156,null));}; \ No newline at end of file +var _0x9cf9=['length','hasOwnProperty','sort','filter','merge','map','type','key','VIRTUAL','options','where','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','html-pdf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9cf9,0x179));var _0x99cf=function(_0x556a15,_0x350839){_0x556a15=_0x556a15-0x0;var _0x4b731a=_0x9cf9[_0x556a15];return _0x4b731a;};'use strict';var pdf=require(_0x99cf('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x99cf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x99cf('0x2'));var BPromise=require(_0x99cf('0x3'));var Mustache=require(_0x99cf('0x4'));var util=require('util');var path=require(_0x99cf('0x5'));var sox=require(_0x99cf('0x6'));var csv=require(_0x99cf('0x7'));var ejs=require(_0x99cf('0x8'));var fs=require('fs');var _=require(_0x99cf('0x9'));var squel=require('squel');var crypto=require(_0x99cf('0xa'));var jsforce=require(_0x99cf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x99cf('0x7'));var querystring=require('querystring');var Papa=require(_0x99cf('0xc'));var authService=require('../../components/auth/service');var hardwareService=require(_0x99cf('0xd'));var Redis=require(_0x99cf('0xe'));var qs=require(_0x99cf('0xf'));var logger=require(_0x99cf('0x10'))(_0x99cf('0x11'));var utils=require(_0x99cf('0x12'));var config=require('../../config/environment');var db=require(_0x99cf('0x13'))['db'];function respondWithStatusCode(_0x352c12,_0x527ddb){_0x527ddb=_0x527ddb||0xcc;return function(_0x49ddf2){if(_0x49ddf2){return _0x352c12[_0x99cf('0x14')](_0x527ddb);}return _0x352c12[_0x99cf('0x15')](_0x527ddb)[_0x99cf('0x16')]();};}function respondWithResult(_0x438025,_0x1d5523){_0x1d5523=_0x1d5523||0xc8;return function(_0x3f1356){if(_0x3f1356){return _0x438025[_0x99cf('0x15')](_0x1d5523)['json'](_0x3f1356);}};}function respondWithFilteredResult(_0x493869,_0x37b2e8){return function(_0xc54cb5){if(_0xc54cb5){var _0x3297f4=_0xc54cb5[_0x99cf('0x17')],_0x478931=_0x37b2e8[_0x99cf('0x18')],_0x5ac779=_0x37b2e8[_0x99cf('0x18')]+_0x37b2e8[_0x99cf('0x19')],_0x3e2adc;if(_0x5ac779>=_0x3297f4){_0x5ac779=_0x3297f4;_0x3e2adc=0xc8;}else{_0x3e2adc=0xce;}_0x493869[_0x99cf('0x15')](_0x3e2adc);return _0x493869[_0x99cf('0x1a')](_0x99cf('0x1b'),_0x478931+'-'+_0x5ac779+'/'+_0x3297f4)[_0x99cf('0x1c')](_0xc54cb5);}return null;};}function patchUpdates(_0x57ae0a){return function(_0x33d16f){try{jsonpatch[_0x99cf('0x1d')](_0x33d16f,_0x57ae0a,!![]);}catch(_0x4af799){return BPromise[_0x99cf('0x1e')](_0x4af799);}return _0x33d16f[_0x99cf('0x1f')]();};}function saveUpdates(_0x2fffae,_0x2b4157){return function(_0x76fc0d){if(_0x76fc0d){return _0x76fc0d[_0x99cf('0x20')](_0x2fffae)[_0x99cf('0x21')](function(_0x46cc9c){return _0x46cc9c;});}return null;};}function removeEntity(_0x30de77,_0x48e227){return function(_0x327380){if(_0x327380){return _0x327380[_0x99cf('0x22')]()[_0x99cf('0x21')](function(){_0x30de77[_0x99cf('0x15')](0xcc)[_0x99cf('0x16')]();});}};}function handleEntityNotFound(_0x41816c,_0xa86709){return function(_0x508a2a){if(!_0x508a2a){_0x41816c[_0x99cf('0x14')](0x194);}return _0x508a2a;};}function handleError(_0x550bdb,_0x130328){_0x130328=_0x130328||0x1f4;return function(_0xac4b16){logger[_0x99cf('0x23')](_0xac4b16[_0x99cf('0x24')]);if(_0xac4b16[_0x99cf('0x25')]){delete _0xac4b16[_0x99cf('0x25')];}_0x550bdb['status'](_0x130328)[_0x99cf('0x26')](_0xac4b16);};}exports[_0x99cf('0x27')]=function(_0x25a2d5,_0xb56a5c){var _0x4f0e55={},_0x3c19b6={},_0x594d09={'count':0x0,'rows':[]};var _0x4c5a43=db[_0x99cf('0x28')][_0x99cf('0x29')];_0x3c19b6[_0x99cf('0x2a')]=_[_0x99cf('0x2b')](_0x4c5a43);_0x3c19b6['query']=_[_0x99cf('0x2b')](_0x25a2d5[_0x99cf('0x2c')]);_0x3c19b6[_0x99cf('0x2d')]=_[_0x99cf('0x2e')](_0x3c19b6['model'],_0x3c19b6['query']);_0x4f0e55[_0x99cf('0x2f')]=_[_0x99cf('0x2e')](_0x3c19b6[_0x99cf('0x2a')],qs['fields'](_0x25a2d5[_0x99cf('0x2c')][_0x99cf('0x30')]));_0x4f0e55['attributes']=_0x4f0e55[_0x99cf('0x2f')][_0x99cf('0x31')]?_0x4f0e55[_0x99cf('0x2f')]:_0x3c19b6['model'];if(!_0x25a2d5['query'][_0x99cf('0x32')]('nolimit')){_0x4f0e55[_0x99cf('0x19')]=qs[_0x99cf('0x19')](_0x25a2d5[_0x99cf('0x2c')][_0x99cf('0x19')]);_0x4f0e55[_0x99cf('0x18')]=qs[_0x99cf('0x18')](_0x25a2d5[_0x99cf('0x2c')][_0x99cf('0x18')]);}_0x4f0e55['order']=qs[_0x99cf('0x33')](_0x25a2d5['query'][_0x99cf('0x33')]);_0x4f0e55['where']=qs[_0x99cf('0x2d')](_['pick'](_0x25a2d5['query'],_0x3c19b6[_0x99cf('0x2d')]));if(_0x25a2d5[_0x99cf('0x2c')][_0x99cf('0x34')]){_0x4f0e55['where']=_[_0x99cf('0x35')](_0x4f0e55['where'],{'$or':_[_0x99cf('0x36')](_0x4c5a43,function(_0x59c9eb){if(_0x59c9eb[_0x99cf('0x37')][_0x99cf('0x38')]!==_0x99cf('0x39')){var _0x4e4f7b={};_0x4e4f7b[_0x59c9eb['field']]={'$like':'%'+_0x25a2d5[_0x99cf('0x2c')][_0x99cf('0x34')]+'%'};return _0x4e4f7b;}})});}_0x4f0e55=_[_0x99cf('0x35')]({},_0x4f0e55,_0x25a2d5[_0x99cf('0x3a')]);var _0x354b29={'where':_0x4f0e55[_0x99cf('0x3b')]};return db[_0x99cf('0x28')]['count'](_0x354b29)[_0x99cf('0x21')](function(_0x3320f2){_0x594d09[_0x99cf('0x17')]=_0x3320f2;if(_0x25a2d5[_0x99cf('0x2c')]['includeAll']){_0x4f0e55[_0x99cf('0x3c')]=[{'all':!![]}];}return db[_0x99cf('0x28')][_0x99cf('0x3d')](_0x4f0e55);})[_0x99cf('0x21')](function(_0x3a6d93){_0x594d09[_0x99cf('0x3e')]=_0x3a6d93;return _0x594d09;})[_0x99cf('0x21')](respondWithFilteredResult(_0xb56a5c,_0x4f0e55))[_0x99cf('0x3f')](handleError(_0xb56a5c,null));};exports[_0x99cf('0x40')]=function(_0x5473a9,_0x317404){var _0x32153d={'raw':!![],'where':{'id':_0x5473a9[_0x99cf('0x41')]['id']}},_0x1b0209={};_0x1b0209[_0x99cf('0x2a')]=_[_0x99cf('0x2b')](db['ChatQueueReport'][_0x99cf('0x29')]);_0x1b0209[_0x99cf('0x2c')]=_[_0x99cf('0x2b')](_0x5473a9[_0x99cf('0x2c')]);_0x1b0209[_0x99cf('0x2d')]=_[_0x99cf('0x2e')](_0x1b0209[_0x99cf('0x2a')],_0x1b0209['query']);_0x32153d[_0x99cf('0x2f')]=_[_0x99cf('0x2e')](_0x1b0209['model'],qs[_0x99cf('0x30')](_0x5473a9[_0x99cf('0x2c')]['fields']));_0x32153d['attributes']=_0x32153d['attributes']['length']?_0x32153d['attributes']:_0x1b0209[_0x99cf('0x2a')];if(_0x5473a9['query'][_0x99cf('0x42')]){_0x32153d[_0x99cf('0x3c')]=[{'all':!![]}];}_0x32153d=_[_0x99cf('0x35')]({},_0x32153d,_0x5473a9[_0x99cf('0x3a')]);return db[_0x99cf('0x28')][_0x99cf('0x43')](_0x32153d)['then'](handleEntityNotFound(_0x317404,null))['then'](respondWithResult(_0x317404,null))[_0x99cf('0x3f')](handleError(_0x317404,null));};exports[_0x99cf('0x44')]=function(_0x36be9b,_0x349da){return db[_0x99cf('0x28')]['create'](_0x36be9b[_0x99cf('0x45')],{})['then'](respondWithResult(_0x349da,0xc9))[_0x99cf('0x3f')](handleError(_0x349da,null));};exports[_0x99cf('0x20')]=function(_0x125618,_0x1c8415){if(_0x125618[_0x99cf('0x45')]['id']){delete _0x125618[_0x99cf('0x45')]['id'];}return db[_0x99cf('0x28')][_0x99cf('0x43')]({'where':{'id':_0x125618[_0x99cf('0x41')]['id']}})[_0x99cf('0x21')](handleEntityNotFound(_0x1c8415,null))['then'](saveUpdates(_0x125618['body'],null))[_0x99cf('0x21')](respondWithResult(_0x1c8415,null))[_0x99cf('0x3f')](handleError(_0x1c8415,null));};exports[_0x99cf('0x22')]=function(_0x14ca3e,_0x393379){return db[_0x99cf('0x28')][_0x99cf('0x43')]({'where':{'id':_0x14ca3e[_0x99cf('0x41')]['id']}})['then'](handleEntityNotFound(_0x393379,null))[_0x99cf('0x21')](removeEntity(_0x393379,null))[_0x99cf('0x3f')](handleError(_0x393379,null));};exports[_0x99cf('0x46')]=function(_0x2d7545,_0x4e68ad){return db[_0x99cf('0x28')][_0x99cf('0x46')]()[_0x99cf('0x21')](respondWithResult(_0x4e68ad,null))[_0x99cf('0x3f')](handleError(_0x4e68ad,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index e10638a..4c536a2 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(_0x1b0c4e,_0x24f18f){_0x1b0c4e=_0x1b0c4e-0x0;var _0xf01476=_0xe14b[_0x1b0c4e];return _0xf01476;};'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 _0x9957=['ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','./chatQueueReport.attributes','exports','define'];(function(_0x51e2ef,_0x38f607){var _0x84435e=function(_0x44bda2){while(--_0x44bda2){_0x51e2ef['push'](_0x51e2ef['shift']());}};_0x84435e(++_0x38f607);}(_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 logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var attributes=require(_0x7995('0x6'));module[_0x7995('0x7')]=function(_0x576d89,_0x744bea){return _0x576d89[_0x7995('0x8')](_0x7995('0x9'),attributes,{'tableName':_0x7995('0xa'),'paranoid':![],'indexes':[{'name':_0x7995('0xb'),'fields':[_0x7995('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index f960fcd..e2f5408 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 _0x7fbd=['request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','update','where','attributes','limit','UpdateChatQueueReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message'];(function(_0x162d0,_0x43186d){var _0x1f4411=function(_0x530049){while(--_0x530049){_0x162d0['push'](_0x162d0['shift']());}};_0x1f4411(++_0x43186d);}(_0x7fbd,0xe8));var _0xd7fb=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0x7fbd[_0xf91841];return _0x4b9c44;};'use strict';var _=require('lodash');var util=require(_0xd7fb('0x0'));var moment=require(_0xd7fb('0x1'));var BPromise=require(_0xd7fb('0x2'));var rs=require(_0xd7fb('0x3'));var fs=require('fs');var Redis=require(_0xd7fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd7fb('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd7fb('0x6'));var jayson=require(_0xd7fb('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5bd9da,_0xcf3511,_0x5e8e5c){return new BPromise(function(_0x22e61e,_0x45e0b0){return client['request'](_0x5bd9da,_0x5e8e5c)['then'](function(_0x4f3716){logger[_0xd7fb('0x8')]('ChatQueueReport,\x20%s,\x20%s',_0xcf3511,'request\x20sent');logger[_0xd7fb('0x9')](_0xd7fb('0xa'),_0xcf3511,'request\x20sent',JSON[_0xd7fb('0xb')](_0x4f3716));if(_0x4f3716['error']){if(_0x4f3716[_0xd7fb('0xc')][_0xd7fb('0xd')]===0x1f4){logger['error'](_0xd7fb('0xe'),_0xcf3511,_0x4f3716[_0xd7fb('0xc')][_0xd7fb('0xf')]);return _0x45e0b0(_0x4f3716['error'][_0xd7fb('0xf')]);}logger[_0xd7fb('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0xcf3511,_0x4f3716[_0xd7fb('0xc')][_0xd7fb('0xf')]);return _0x22e61e(_0x4f3716[_0xd7fb('0xc')]['message']);}else{logger[_0xd7fb('0x8')](_0xd7fb('0xe'),_0xcf3511,_0xd7fb('0x10'));_0x22e61e(_0x4f3716[_0xd7fb('0x11')][_0xd7fb('0xf')]);}})[_0xd7fb('0x12')](function(_0x2a8f7c){logger[_0xd7fb('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0xcf3511,_0x2a8f7c);_0x45e0b0(_0x2a8f7c);});});}exports[_0xd7fb('0x13')]=function(_0x1c0b78){var _0x4591c4=this;return new Promise(function(_0x30818e,_0x49bc4e){return db[_0xd7fb('0x14')][_0xd7fb('0x15')](_0x1c0b78[_0xd7fb('0x16')],{'raw':_0x1c0b78[_0xd7fb('0x17')]?_0x1c0b78[_0xd7fb('0x17')][_0xd7fb('0x18')]===undefined?!![]:![]:!![]})[_0xd7fb('0x19')](function(_0x532ab1){logger[_0xd7fb('0x8')](_0xd7fb('0x13'),_0x1c0b78);logger[_0xd7fb('0x9')]('CreateChatQueueReport',_0x1c0b78,JSON['stringify'](_0x532ab1));_0x30818e(_0x532ab1);})[_0xd7fb('0x12')](function(_0x22b88b){logger['error'](_0xd7fb('0x13'),_0x22b88b[_0xd7fb('0xf')],_0x1c0b78);_0x49bc4e(_0x4591c4[_0xd7fb('0xc')](0x1f4,_0x22b88b[_0xd7fb('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x34b0ce){var _0x5c6c97=this;return new Promise(function(_0x53237f,_0x40f8cf){return db[_0xd7fb('0x14')][_0xd7fb('0x1a')](_0x34b0ce[_0xd7fb('0x16')],{'raw':_0x34b0ce[_0xd7fb('0x17')]?_0x34b0ce[_0xd7fb('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34b0ce['options']?_0x34b0ce[_0xd7fb('0x17')][_0xd7fb('0x1b')]||null:null,'attributes':_0x34b0ce[_0xd7fb('0x17')]?_0x34b0ce['options'][_0xd7fb('0x1c')]||null:null,'limit':_0x34b0ce[_0xd7fb('0x17')]?_0x34b0ce[_0xd7fb('0x17')][_0xd7fb('0x1d')]||null:null})['then'](function(_0x2d9c99){logger[_0xd7fb('0x8')](_0xd7fb('0x1e'),_0x34b0ce);logger[_0xd7fb('0x9')](_0xd7fb('0x1e'),_0x34b0ce,JSON[_0xd7fb('0xb')](_0x2d9c99));_0x53237f(_0x2d9c99);})['catch'](function(_0x52ba2b){logger['error'](_0xd7fb('0x1e'),_0x52ba2b[_0xd7fb('0xf')],_0x34b0ce);_0x40f8cf(_0x5c6c97[_0xd7fb('0xc')](0x1f4,_0x52ba2b['message']));});});}; \ No newline at end of file +var _0x0fb6=['ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body','options','raw','ChatQueueReport','update','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x20ef7d,_0x331dc2){var _0x26a929=function(_0x2dfeac){while(--_0x2dfeac){_0x20ef7d['push'](_0x20ef7d['shift']());}};_0x26a929(++_0x331dc2);}(_0x0fb6,0x7d));var _0x60fb=function(_0x245a92,_0x1a6eea){_0x245a92=_0x245a92-0x0;var _0x2c6f69=_0x0fb6[_0x245a92];return _0x2c6f69;};'use strict';var _=require(_0x60fb('0x0'));var util=require(_0x60fb('0x1'));var moment=require(_0x60fb('0x2'));var BPromise=require(_0x60fb('0x3'));var rs=require(_0x60fb('0x4'));var fs=require('fs');var Redis=require(_0x60fb('0x5'));var db=require(_0x60fb('0x6'))['db'];var utils=require(_0x60fb('0x7'));var logger=require(_0x60fb('0x8'))(_0x60fb('0x9'));var config=require(_0x60fb('0xa'));var jayson=require(_0x60fb('0xb'));var client=jayson['client'][_0x60fb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x15a6ae,_0x12e6af,_0x4fb7c8){return new BPromise(function(_0x1264e9,_0x38eb67){return client[_0x60fb('0xd')](_0x15a6ae,_0x4fb7c8)['then'](function(_0x20754d){logger[_0x60fb('0xe')](_0x60fb('0xf'),_0x12e6af,_0x60fb('0x10'));logger[_0x60fb('0x11')](_0x60fb('0x12'),_0x12e6af,'request\x20sent',JSON[_0x60fb('0x13')](_0x20754d));if(_0x20754d[_0x60fb('0x14')]){if(_0x20754d['error'][_0x60fb('0x15')]===0x1f4){logger[_0x60fb('0x14')](_0x60fb('0xf'),_0x12e6af,_0x20754d['error']['message']);return _0x38eb67(_0x20754d[_0x60fb('0x14')][_0x60fb('0x16')]);}logger[_0x60fb('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x12e6af,_0x20754d[_0x60fb('0x14')][_0x60fb('0x16')]);return _0x1264e9(_0x20754d[_0x60fb('0x14')]['message']);}else{logger['info'](_0x60fb('0xf'),_0x12e6af,_0x60fb('0x10'));_0x1264e9(_0x20754d[_0x60fb('0x17')]['message']);}})[_0x60fb('0x18')](function(_0x43a990){logger['error'](_0x60fb('0xf'),_0x12e6af,_0x43a990);_0x38eb67(_0x43a990);});});}exports[_0x60fb('0x19')]=function(_0x21790c){var _0x498eb8=this;return new Promise(function(_0x6ef78d,_0x17d3cd){return db['ChatQueueReport'][_0x60fb('0x1a')](_0x21790c[_0x60fb('0x1b')],{'raw':_0x21790c[_0x60fb('0x1c')]?_0x21790c[_0x60fb('0x1c')][_0x60fb('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x56860f){logger[_0x60fb('0xe')](_0x60fb('0x19'),_0x21790c);logger[_0x60fb('0x11')]('CreateChatQueueReport',_0x21790c,JSON[_0x60fb('0x13')](_0x56860f));_0x6ef78d(_0x56860f);})[_0x60fb('0x18')](function(_0x262fba){logger[_0x60fb('0x14')](_0x60fb('0x19'),_0x262fba[_0x60fb('0x16')],_0x21790c);_0x17d3cd(_0x498eb8[_0x60fb('0x14')](0x1f4,_0x262fba[_0x60fb('0x16')]));});});};exports['UpdateChatQueueReport']=function(_0x1ab02a){var _0x2ec59d=this;return new Promise(function(_0x210bbf,_0x4fbbaf){return db[_0x60fb('0x1e')][_0x60fb('0x1f')](_0x1ab02a[_0x60fb('0x1b')],{'raw':_0x1ab02a[_0x60fb('0x1c')]?_0x1ab02a[_0x60fb('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ab02a[_0x60fb('0x1c')]?_0x1ab02a[_0x60fb('0x1c')]['where']||null:null,'attributes':_0x1ab02a[_0x60fb('0x1c')]?_0x1ab02a[_0x60fb('0x1c')][_0x60fb('0x20')]||null:null,'limit':_0x1ab02a[_0x60fb('0x1c')]?_0x1ab02a[_0x60fb('0x1c')][_0x60fb('0x21')]||null:null})['then'](function(_0x2d95f9){logger[_0x60fb('0xe')]('UpdateChatQueueReport',_0x1ab02a);logger[_0x60fb('0x11')]('UpdateChatQueueReport',_0x1ab02a,JSON[_0x60fb('0x13')](_0x2d95f9));_0x210bbf(_0x2d95f9);})[_0x60fb('0x18')](function(_0x5d935c){logger['error'](_0x60fb('0x22'),_0x5d935c[_0x60fb('0x16')],_0x1ab02a);_0x4fbbaf(_0x2ec59d[_0x60fb('0x14')](0x1f4,_0x5d935c[_0x60fb('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 68070dc..5af5d27 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 _0x0738=['create','put','update','delete','destroy','exports','util','express','Router','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x0738,0xea));var _0x8073=function(_0x2e819c,_0x3f99a5){_0x2e819c=_0x2e819c-0x0;var _0x24e271=_0x0738[_0x2e819c];return _0x24e271;};'use strict';var multer=require('multer');var util=require(_0x8073('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8073('0x1'));var router=express[_0x8073('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x8073('0x3'));var config=require(_0x8073('0x4'));var controller=require('./chatQueueReport.controller');router[_0x8073('0x5')]('/',auth['isAuthenticated'](),controller[_0x8073('0x6')]);router[_0x8073('0x5')](_0x8073('0x7'),auth[_0x8073('0x8')](),controller[_0x8073('0x9')]);router[_0x8073('0x5')](_0x8073('0xa'),auth[_0x8073('0x8')](),controller[_0x8073('0xb')]);router[_0x8073('0xc')]('/',auth[_0x8073('0x8')](),controller[_0x8073('0xd')]);router[_0x8073('0xe')](_0x8073('0xa'),auth[_0x8073('0x8')](),controller[_0x8073('0xf')]);router[_0x8073('0x10')](_0x8073('0xa'),auth[_0x8073('0x8')](),controller[_0x8073('0x11')]);module[_0x8073('0x12')]=router; \ No newline at end of file +var _0xb80a=['show','post','/:id','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','isAuthenticated','describe'];(function(_0x4f4d06,_0x39ce44){var _0x2eb417=function(_0xf4939e){while(--_0xf4939e){_0x4f4d06['push'](_0x4f4d06['shift']());}};_0x2eb417(++_0x39ce44);}(_0xb80a,0x72));var _0xab80=function(_0xbadc75,_0x536480){_0xbadc75=_0xbadc75-0x0;var _0x1bbc61=_0xb80a[_0xbadc75];return _0x1bbc61;};'use strict';var multer=require(_0xab80('0x0'));var util=require(_0xab80('0x1'));var path=require('path');var timeout=require(_0xab80('0x2'));var express=require('express');var router=express[_0xab80('0x3')]();var auth=require(_0xab80('0x4'));var interaction=require(_0xab80('0x5'));var config=require(_0xab80('0x6'));var controller=require(_0xab80('0x7'));router[_0xab80('0x8')]('/',auth['isAuthenticated'](),controller[_0xab80('0x9')]);router['get']('/describe',auth[_0xab80('0xa')](),controller[_0xab80('0xb')]);router[_0xab80('0x8')]('/:id',auth[_0xab80('0xa')](),controller[_0xab80('0xc')]);router[_0xab80('0xd')]('/',auth[_0xab80('0xa')](),controller['create']);router['put'](_0xab80('0xe'),auth[_0xab80('0xa')](),controller['update']);router[_0xab80('0xf')](_0xab80('0xe'),auth['isAuthenticated'](),controller[_0xab80('0x10')]);module[_0xab80('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 0b272f2..c432f50 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 _0xb964=['queue','NOW','moment','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xb964,0x1d6));var _0x4b96=function(_0x75f64d,_0x180532){_0x75f64d=_0x75f64d-0x0;var _0x4df0e1=_0xb964[_0x75f64d];return _0x4df0e1;};'use strict';var moment=require(_0x4b96('0x0'));var Sequelize=require(_0x4b96('0x1'));module[_0x4b96('0x2')]={'uniqueid':{'type':Sequelize[_0x4b96('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4b96('0x4')](_0x4b96('0x5'),_0x4b96('0x6'),_0x4b96('0x7')),'allowNull':![],'defaultValue':_0x4b96('0x7')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x4b96('0x8')]}}; \ No newline at end of file +var _0xd72c=['sequelize','exports','STRING','ENUM','queue','DATE','NOW','moment'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xd72c,0x197));var _0xcd72=function(_0x4b1d,_0x119498){_0x4b1d=_0x4b1d-0x0;var _0x174ba0=_0xd72c[_0x4b1d];return _0x174ba0;};'use strict';var moment=require(_0xcd72('0x0'));var Sequelize=require(_0xcd72('0x1'));module[_0xcd72('0x2')]={'uniqueid':{'type':Sequelize[_0xcd72('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xcd72('0x4')]('account','agent',_0xcd72('0x5')),'allowNull':![],'defaultValue':_0xcd72('0x5')},'transferredAt':{'type':Sequelize[_0xcd72('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xcd72('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 76e8d8a..2d1711b 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 _0x6629=['pick','merge','map','key','VIRTUAL','filter','options','include','catch','show','keys','fields','includeAll','create','body','find','destroy','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','ChatTransferReport','rawAttributes','model','query','attributes','intersection','length','hasOwnProperty','nolimit','order','where','filters'];(function(_0x17bc76,_0xff1305){var _0x33f43c=function(_0x458463){while(--_0x458463){_0x17bc76['push'](_0x17bc76['shift']());}};_0x33f43c(++_0xff1305);}(_0x6629,0x1c2));var _0x9662=function(_0x1d6c31,_0x3d4ce0){_0x1d6c31=_0x1d6c31-0x0;var _0x218a70=_0x6629[_0x1d6c31];return _0x218a70;};'use strict';var pdf=require(_0x9662('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9662('0x1'));var jsonpatch=require(_0x9662('0x2'));var rp=require(_0x9662('0x3'));var moment=require(_0x9662('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9662('0x5'));var util=require(_0x9662('0x6'));var path=require(_0x9662('0x7'));var sox=require('sox');var csv=require(_0x9662('0x8'));var ejs=require(_0x9662('0x9'));var fs=require('fs');var _=require(_0x9662('0xa'));var squel=require('squel');var crypto=require(_0x9662('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9662('0xc'));var toCsv=require(_0x9662('0x8'));var querystring=require(_0x9662('0xd'));var Papa=require(_0x9662('0xe'));var authService=require(_0x9662('0xf'));var hardwareService=require(_0x9662('0x10'));var Redis=require(_0x9662('0x11'));var qs=require(_0x9662('0x12'));var logger=require(_0x9662('0x13'))(_0x9662('0x14'));var utils=require(_0x9662('0x15'));var config=require('../../config/environment');var db=require(_0x9662('0x16'))['db'];function respondWithStatusCode(_0x4d7432,_0x14c8b7){_0x14c8b7=_0x14c8b7||0xcc;return function(_0x8db665){if(_0x8db665){return _0x4d7432['sendStatus'](_0x14c8b7);}return _0x4d7432[_0x9662('0x17')](_0x14c8b7)[_0x9662('0x18')]();};}function respondWithResult(_0x406546,_0x47a30f){_0x47a30f=_0x47a30f||0xc8;return function(_0x533fc4){if(_0x533fc4){return _0x406546[_0x9662('0x17')](_0x47a30f)['json'](_0x533fc4);}};}function respondWithFilteredResult(_0x11c880,_0x39e30f){return function(_0x25c17c){if(_0x25c17c){var _0x5a55c5=_0x25c17c[_0x9662('0x19')],_0x4d608d=_0x39e30f['offset'],_0x531ec5=_0x39e30f[_0x9662('0x1a')]+_0x39e30f[_0x9662('0x1b')],_0x1a6606;if(_0x531ec5>=_0x5a55c5){_0x531ec5=_0x5a55c5;_0x1a6606=0xc8;}else{_0x1a6606=0xce;}_0x11c880[_0x9662('0x17')](_0x1a6606);return _0x11c880[_0x9662('0x1c')](_0x9662('0x1d'),_0x4d608d+'-'+_0x531ec5+'/'+_0x5a55c5)[_0x9662('0x1e')](_0x25c17c);}return null;};}function patchUpdates(_0x5beaa5){return function(_0x14335a){try{jsonpatch[_0x9662('0x1f')](_0x14335a,_0x5beaa5,!![]);}catch(_0x4e69af){return BPromise[_0x9662('0x20')](_0x4e69af);}return _0x14335a[_0x9662('0x21')]();};}function saveUpdates(_0x139d1a,_0x7c4209){return function(_0x2e16cf){if(_0x2e16cf){return _0x2e16cf[_0x9662('0x22')](_0x139d1a)[_0x9662('0x23')](function(_0x38862c){return _0x38862c;});}return null;};}function removeEntity(_0xa7ef8a,_0xf2005a){return function(_0x5e4083){if(_0x5e4083){return _0x5e4083['destroy']()[_0x9662('0x23')](function(){_0xa7ef8a[_0x9662('0x17')](0xcc)[_0x9662('0x18')]();});}};}function handleEntityNotFound(_0x12170b,_0x2321d2){return function(_0x3d8d97){if(!_0x3d8d97){_0x12170b[_0x9662('0x24')](0x194);}return _0x3d8d97;};}function handleError(_0x527e6d,_0x4bcff6){_0x4bcff6=_0x4bcff6||0x1f4;return function(_0x132434){logger[_0x9662('0x25')](_0x132434[_0x9662('0x26')]);if(_0x132434[_0x9662('0x27')]){delete _0x132434['name'];}_0x527e6d[_0x9662('0x17')](_0x4bcff6)[_0x9662('0x28')](_0x132434);};}exports[_0x9662('0x29')]=function(_0x3c69ab,_0x3e1af2){var _0x402896={},_0x2930de={},_0x122be7={'count':0x0,'rows':[]};var _0x5f52db=db[_0x9662('0x2a')][_0x9662('0x2b')];_0x2930de[_0x9662('0x2c')]=_['keys'](_0x5f52db);_0x2930de['query']=_['keys'](_0x3c69ab['query']);_0x2930de['filters']=_['intersection'](_0x2930de[_0x9662('0x2c')],_0x2930de[_0x9662('0x2d')]);_0x402896[_0x9662('0x2e')]=_[_0x9662('0x2f')](_0x2930de['model'],qs['fields'](_0x3c69ab[_0x9662('0x2d')]['fields']));_0x402896[_0x9662('0x2e')]=_0x402896[_0x9662('0x2e')][_0x9662('0x30')]?_0x402896[_0x9662('0x2e')]:_0x2930de[_0x9662('0x2c')];if(!_0x3c69ab['query'][_0x9662('0x31')](_0x9662('0x32'))){_0x402896[_0x9662('0x1b')]=qs[_0x9662('0x1b')](_0x3c69ab[_0x9662('0x2d')]['limit']);_0x402896[_0x9662('0x1a')]=qs['offset'](_0x3c69ab[_0x9662('0x2d')][_0x9662('0x1a')]);}_0x402896[_0x9662('0x33')]=qs['sort'](_0x3c69ab['query']['sort']);_0x402896[_0x9662('0x34')]=qs[_0x9662('0x35')](_[_0x9662('0x36')](_0x3c69ab['query'],_0x2930de[_0x9662('0x35')]));if(_0x3c69ab[_0x9662('0x2d')]['filter']){_0x402896[_0x9662('0x34')]=_[_0x9662('0x37')](_0x402896[_0x9662('0x34')],{'$or':_[_0x9662('0x38')](_0x5f52db,function(_0x54caa4){if(_0x54caa4['type'][_0x9662('0x39')]!==_0x9662('0x3a')){var _0xf07a3d={};_0xf07a3d[_0x54caa4['field']]={'$like':'%'+_0x3c69ab[_0x9662('0x2d')][_0x9662('0x3b')]+'%'};return _0xf07a3d;}})});}_0x402896=_[_0x9662('0x37')]({},_0x402896,_0x3c69ab[_0x9662('0x3c')]);var _0x168914={'where':_0x402896[_0x9662('0x34')]};return db[_0x9662('0x2a')]['count'](_0x168914)['then'](function(_0x4ea2f4){_0x122be7[_0x9662('0x19')]=_0x4ea2f4;if(_0x3c69ab['query']['includeAll']){_0x402896[_0x9662('0x3d')]=[{'all':!![]}];}return db[_0x9662('0x2a')]['findAll'](_0x402896);})[_0x9662('0x23')](function(_0x365332){_0x122be7['rows']=_0x365332;return _0x122be7;})['then'](respondWithFilteredResult(_0x3e1af2,_0x402896))[_0x9662('0x3e')](handleError(_0x3e1af2,null));};exports[_0x9662('0x3f')]=function(_0x97ec61,_0x14d16a){var _0x127fed={'raw':!![],'where':{'id':_0x97ec61['params']['id']}},_0x5659f0={};_0x5659f0[_0x9662('0x2c')]=_[_0x9662('0x40')](db[_0x9662('0x2a')]['rawAttributes']);_0x5659f0[_0x9662('0x2d')]=_[_0x9662('0x40')](_0x97ec61[_0x9662('0x2d')]);_0x5659f0[_0x9662('0x35')]=_[_0x9662('0x2f')](_0x5659f0[_0x9662('0x2c')],_0x5659f0[_0x9662('0x2d')]);_0x127fed[_0x9662('0x2e')]=_['intersection'](_0x5659f0['model'],qs[_0x9662('0x41')](_0x97ec61[_0x9662('0x2d')][_0x9662('0x41')]));_0x127fed[_0x9662('0x2e')]=_0x127fed[_0x9662('0x2e')][_0x9662('0x30')]?_0x127fed[_0x9662('0x2e')]:_0x5659f0[_0x9662('0x2c')];if(_0x97ec61[_0x9662('0x2d')][_0x9662('0x42')]){_0x127fed['include']=[{'all':!![]}];}_0x127fed=_['merge']({},_0x127fed,_0x97ec61['options']);return db[_0x9662('0x2a')]['find'](_0x127fed)[_0x9662('0x23')](handleEntityNotFound(_0x14d16a,null))[_0x9662('0x23')](respondWithResult(_0x14d16a,null))[_0x9662('0x3e')](handleError(_0x14d16a,null));};exports[_0x9662('0x43')]=function(_0x432712,_0x2552b7){return db['ChatTransferReport']['create'](_0x432712[_0x9662('0x44')],{})[_0x9662('0x23')](respondWithResult(_0x2552b7,0xc9))[_0x9662('0x3e')](handleError(_0x2552b7,null));};exports[_0x9662('0x22')]=function(_0x279139,_0x2417ab){if(_0x279139['body']['id']){delete _0x279139[_0x9662('0x44')]['id'];}return db[_0x9662('0x2a')][_0x9662('0x45')]({'where':{'id':_0x279139['params']['id']}})[_0x9662('0x23')](handleEntityNotFound(_0x2417ab,null))['then'](saveUpdates(_0x279139['body'],null))[_0x9662('0x23')](respondWithResult(_0x2417ab,null))['catch'](handleError(_0x2417ab,null));};exports[_0x9662('0x46')]=function(_0x4440e5,_0x228744){return db[_0x9662('0x2a')][_0x9662('0x45')]({'where':{'id':_0x4440e5['params']['id']}})[_0x9662('0x23')](handleEntityNotFound(_0x228744,null))[_0x9662('0x23')](removeEntity(_0x228744,null))[_0x9662('0x3e')](handleError(_0x228744,null));};exports[_0x9662('0x47')]=function(_0xe83f20,_0x2c8e42){return db[_0x9662('0x2a')][_0x9662('0x47')]()[_0x9662('0x23')](respondWithResult(_0x2c8e42,null))[_0x9662('0x3e')](handleError(_0x2c8e42,null));}; \ No newline at end of file +var _0x01f0=['ChatTransferReport','includeAll','include','findAll','rows','show','params','fields','length','options','find','create','body','catch','describe','html-pdf','rimraf','request-promise','mustache','util','to-csv','squel','crypto','jsforce','desk.js','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','json','count','offset','limit','status','set','Content-Range','reject','save','update','then','end','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','hasOwnProperty','order','sort','where','filter','merge','map','type','key','VIRTUAL'];(function(_0x1edd93,_0x2e09bb){var _0x1ae697=function(_0x20e402){while(--_0x20e402){_0x1edd93['push'](_0x1edd93['shift']());}};_0x1ae697(++_0x2e09bb);}(_0x01f0,0x93));var _0x001f=function(_0x4b2c0a,_0x5b2b2f){_0x4b2c0a=_0x4b2c0a-0x0;var _0x48f272=_0x01f0[_0x4b2c0a];return _0x48f272;};'use strict';var pdf=require(_0x001f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x001f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x001f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x001f('0x3'));var util=require(_0x001f('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x001f('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x001f('0x6'));var crypto=require(_0x001f('0x7'));var jsforce=require(_0x001f('0x8'));var deskjs=require(_0x001f('0x9'));var toCsv=require(_0x001f('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x001f('0xa'));var Redis=require(_0x001f('0xb'));var qs=require(_0x001f('0xc'));var logger=require(_0x001f('0xd'))(_0x001f('0xe'));var utils=require(_0x001f('0xf'));var config=require('../../config/environment');var db=require(_0x001f('0x10'))['db'];function respondWithStatusCode(_0x3a9b19,_0x407554){_0x407554=_0x407554||0xcc;return function(_0x2bf0ec){if(_0x2bf0ec){return _0x3a9b19[_0x001f('0x11')](_0x407554);}return _0x3a9b19['status'](_0x407554)['end']();};}function respondWithResult(_0x4be9b8,_0x4aa84f){_0x4aa84f=_0x4aa84f||0xc8;return function(_0x2e1977){if(_0x2e1977){return _0x4be9b8['status'](_0x4aa84f)[_0x001f('0x12')](_0x2e1977);}};}function respondWithFilteredResult(_0x31e4cb,_0x104a8c){return function(_0x21bbc2){if(_0x21bbc2){var _0x173b7c=_0x21bbc2[_0x001f('0x13')],_0x5e7198=_0x104a8c['offset'],_0x4a74b2=_0x104a8c[_0x001f('0x14')]+_0x104a8c[_0x001f('0x15')],_0x5abd01;if(_0x4a74b2>=_0x173b7c){_0x4a74b2=_0x173b7c;_0x5abd01=0xc8;}else{_0x5abd01=0xce;}_0x31e4cb[_0x001f('0x16')](_0x5abd01);return _0x31e4cb[_0x001f('0x17')](_0x001f('0x18'),_0x5e7198+'-'+_0x4a74b2+'/'+_0x173b7c)[_0x001f('0x12')](_0x21bbc2);}return null;};}function patchUpdates(_0x3d33f9){return function(_0x5f2ff5){try{jsonpatch['apply'](_0x5f2ff5,_0x3d33f9,!![]);}catch(_0x54adb4){return BPromise[_0x001f('0x19')](_0x54adb4);}return _0x5f2ff5[_0x001f('0x1a')]();};}function saveUpdates(_0xac5336,_0x55ae3d){return function(_0x22c9c9){if(_0x22c9c9){return _0x22c9c9[_0x001f('0x1b')](_0xac5336)[_0x001f('0x1c')](function(_0x124d79){return _0x124d79;});}return null;};}function removeEntity(_0xc9c70b,_0x509371){return function(_0x12df69){if(_0x12df69){return _0x12df69['destroy']()[_0x001f('0x1c')](function(){_0xc9c70b['status'](0xcc)[_0x001f('0x1d')]();});}};}function handleEntityNotFound(_0x4d501d,_0x380963){return function(_0xa70668){if(!_0xa70668){_0x4d501d[_0x001f('0x11')](0x194);}return _0xa70668;};}function handleError(_0x54a66b,_0x39b244){_0x39b244=_0x39b244||0x1f4;return function(_0x2f6e4b){logger['error'](_0x2f6e4b[_0x001f('0x1e')]);if(_0x2f6e4b[_0x001f('0x1f')]){delete _0x2f6e4b[_0x001f('0x1f')];}_0x54a66b['status'](_0x39b244)[_0x001f('0x20')](_0x2f6e4b);};}exports[_0x001f('0x21')]=function(_0x78e0a8,_0x348739){var _0x1234de={},_0x5708ae={},_0x29beeb={'count':0x0,'rows':[]};var _0x8941ea=db['ChatTransferReport'][_0x001f('0x22')];_0x5708ae[_0x001f('0x23')]=_[_0x001f('0x24')](_0x8941ea);_0x5708ae[_0x001f('0x25')]=_[_0x001f('0x24')](_0x78e0a8[_0x001f('0x25')]);_0x5708ae[_0x001f('0x26')]=_[_0x001f('0x27')](_0x5708ae[_0x001f('0x23')],_0x5708ae['query']);_0x1234de[_0x001f('0x28')]=_[_0x001f('0x27')](_0x5708ae[_0x001f('0x23')],qs['fields'](_0x78e0a8[_0x001f('0x25')]['fields']));_0x1234de[_0x001f('0x28')]=_0x1234de['attributes']['length']?_0x1234de[_0x001f('0x28')]:_0x5708ae[_0x001f('0x23')];if(!_0x78e0a8[_0x001f('0x25')][_0x001f('0x29')]('nolimit')){_0x1234de[_0x001f('0x15')]=qs[_0x001f('0x15')](_0x78e0a8[_0x001f('0x25')][_0x001f('0x15')]);_0x1234de[_0x001f('0x14')]=qs[_0x001f('0x14')](_0x78e0a8[_0x001f('0x25')]['offset']);}_0x1234de[_0x001f('0x2a')]=qs[_0x001f('0x2b')](_0x78e0a8[_0x001f('0x25')][_0x001f('0x2b')]);_0x1234de[_0x001f('0x2c')]=qs['filters'](_['pick'](_0x78e0a8['query'],_0x5708ae[_0x001f('0x26')]));if(_0x78e0a8[_0x001f('0x25')][_0x001f('0x2d')]){_0x1234de[_0x001f('0x2c')]=_[_0x001f('0x2e')](_0x1234de[_0x001f('0x2c')],{'$or':_[_0x001f('0x2f')](_0x8941ea,function(_0x260ac2){if(_0x260ac2[_0x001f('0x30')][_0x001f('0x31')]!==_0x001f('0x32')){var _0x20a775={};_0x20a775[_0x260ac2['field']]={'$like':'%'+_0x78e0a8[_0x001f('0x25')][_0x001f('0x2d')]+'%'};return _0x20a775;}})});}_0x1234de=_[_0x001f('0x2e')]({},_0x1234de,_0x78e0a8['options']);var _0x40ba4a={'where':_0x1234de[_0x001f('0x2c')]};return db[_0x001f('0x33')][_0x001f('0x13')](_0x40ba4a)[_0x001f('0x1c')](function(_0x5055f5){_0x29beeb['count']=_0x5055f5;if(_0x78e0a8[_0x001f('0x25')][_0x001f('0x34')]){_0x1234de[_0x001f('0x35')]=[{'all':!![]}];}return db[_0x001f('0x33')][_0x001f('0x36')](_0x1234de);})['then'](function(_0x43d5cc){_0x29beeb[_0x001f('0x37')]=_0x43d5cc;return _0x29beeb;})[_0x001f('0x1c')](respondWithFilteredResult(_0x348739,_0x1234de))['catch'](handleError(_0x348739,null));};exports[_0x001f('0x38')]=function(_0x71df0e,_0x4a8ff1){var _0xefa4da={'raw':!![],'where':{'id':_0x71df0e[_0x001f('0x39')]['id']}},_0x29cc05={};_0x29cc05[_0x001f('0x23')]=_[_0x001f('0x24')](db['ChatTransferReport'][_0x001f('0x22')]);_0x29cc05[_0x001f('0x25')]=_[_0x001f('0x24')](_0x71df0e['query']);_0x29cc05['filters']=_['intersection'](_0x29cc05['model'],_0x29cc05[_0x001f('0x25')]);_0xefa4da['attributes']=_[_0x001f('0x27')](_0x29cc05[_0x001f('0x23')],qs[_0x001f('0x3a')](_0x71df0e['query'][_0x001f('0x3a')]));_0xefa4da['attributes']=_0xefa4da[_0x001f('0x28')][_0x001f('0x3b')]?_0xefa4da['attributes']:_0x29cc05[_0x001f('0x23')];if(_0x71df0e[_0x001f('0x25')]['includeAll']){_0xefa4da[_0x001f('0x35')]=[{'all':!![]}];}_0xefa4da=_[_0x001f('0x2e')]({},_0xefa4da,_0x71df0e[_0x001f('0x3c')]);return db[_0x001f('0x33')][_0x001f('0x3d')](_0xefa4da)[_0x001f('0x1c')](handleEntityNotFound(_0x4a8ff1,null))[_0x001f('0x1c')](respondWithResult(_0x4a8ff1,null))['catch'](handleError(_0x4a8ff1,null));};exports['create']=function(_0x5b57a8,_0x1e9f77){return db[_0x001f('0x33')][_0x001f('0x3e')](_0x5b57a8[_0x001f('0x3f')],{})[_0x001f('0x1c')](respondWithResult(_0x1e9f77,0xc9))[_0x001f('0x40')](handleError(_0x1e9f77,null));};exports['update']=function(_0x1d1e6,_0x40622f){if(_0x1d1e6[_0x001f('0x3f')]['id']){delete _0x1d1e6[_0x001f('0x3f')]['id'];}return db[_0x001f('0x33')][_0x001f('0x3d')]({'where':{'id':_0x1d1e6[_0x001f('0x39')]['id']}})[_0x001f('0x1c')](handleEntityNotFound(_0x40622f,null))[_0x001f('0x1c')](saveUpdates(_0x1d1e6[_0x001f('0x3f')],null))[_0x001f('0x1c')](respondWithResult(_0x40622f,null))[_0x001f('0x40')](handleError(_0x40622f,null));};exports['destroy']=function(_0x41ae0d,_0x4fbedd){return db['ChatTransferReport'][_0x001f('0x3d')]({'where':{'id':_0x41ae0d[_0x001f('0x39')]['id']}})[_0x001f('0x1c')](handleEntityNotFound(_0x4fbedd,null))[_0x001f('0x1c')](removeEntity(_0x4fbedd,null))[_0x001f('0x40')](handleError(_0x4fbedd,null));};exports[_0x001f('0x41')]=function(_0x1c4c10,_0x307c4a){return db[_0x001f('0x33')][_0x001f('0x41')]()[_0x001f('0x1c')](respondWithResult(_0x307c4a,null))['catch'](handleError(_0x307c4a,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 7fbe2f2..4a75b61 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 _0x66b2=['util','../../config/logger','api','moment','bluebird','request-promise','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x396163,_0x948ceb){var _0x14f91c=function(_0x5c8bf3){while(--_0x5c8bf3){_0x396163['push'](_0x396163['shift']());}};_0x14f91c(++_0x948ceb);}(_0x66b2,0x18c));var _0x266b=function(_0x5453a5,_0xd90cd6){_0x5453a5=_0x5453a5-0x0;var _0x18a128=_0x66b2[_0x5453a5];return _0x18a128;};'use strict';var _=require('lodash');var util=require(_0x266b('0x0'));var logger=require(_0x266b('0x1'))(_0x266b('0x2'));var moment=require(_0x266b('0x3'));var BPromise=require(_0x266b('0x4'));var rp=require(_0x266b('0x5'));var attributes=require(_0x266b('0x6'));module[_0x266b('0x7')]=function(_0x887963,_0x345c9c){return _0x887963[_0x266b('0x8')](_0x266b('0x9'),attributes,{'tableName':_0x266b('0xa'),'paranoid':![],'indexes':[{'name':_0x266b('0xb'),'fields':[_0x266b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c7e=['request-promise','define','uniqueid','util','api','moment','bluebird'];(function(_0x2a1140,_0x103c82){var _0x3a595b=function(_0x8936a9){while(--_0x8936a9){_0x2a1140['push'](_0x2a1140['shift']());}};_0x3a595b(++_0x103c82);}(_0x1c7e,0xce));var _0xe1c7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1c7e[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xe1c7('0x0'));var logger=require('../../config/logger')(_0xe1c7('0x1'));var moment=require(_0xe1c7('0x2'));var BPromise=require(_0xe1c7('0x3'));var rp=require(_0xe1c7('0x4'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x2d4f19,_0x48600b){return _0x2d4f19[_0xe1c7('0x5')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xe1c7('0x6'),'fields':[_0xe1c7('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 5b4249d..a0d9d80 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 _0x3dcb=['util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x1d7cb2,_0x300f9d){var _0x51c03e=function(_0x130fd1){while(--_0x130fd1){_0x1d7cb2['push'](_0x1d7cb2['shift']());}};_0x51c03e(++_0x300f9d);}(_0x3dcb,0xe6));var _0xb3dc=function(_0x542030,_0x426b23){_0x542030=_0x542030-0x0;var _0x1855e7=_0x3dcb[_0x542030];return _0x1855e7;};'use strict';var _=require(_0xb3dc('0x0'));var util=require(_0xb3dc('0x1'));var moment=require('moment');var BPromise=require(_0xb3dc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb3dc('0x3'));var db=require(_0xb3dc('0x4'))['db'];var utils=require(_0xb3dc('0x5'));var logger=require('../../config/logger')(_0xb3dc('0x6'));var config=require('../../config/environment');var jayson=require(_0xb3dc('0x7'));var client=jayson[_0xb3dc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e99f4,_0x1e6379,_0x400a85){return new BPromise(function(_0x42e234,_0x2c5388){return client[_0xb3dc('0x9')](_0x4e99f4,_0x400a85)[_0xb3dc('0xa')](function(_0x2f3547){logger[_0xb3dc('0xb')](_0xb3dc('0xc'),_0x1e6379,_0xb3dc('0xd'));logger[_0xb3dc('0xe')](_0xb3dc('0xf'),_0x1e6379,_0xb3dc('0xd'),JSON[_0xb3dc('0x10')](_0x2f3547));if(_0x2f3547[_0xb3dc('0x11')]){if(_0x2f3547[_0xb3dc('0x11')][_0xb3dc('0x12')]===0x1f4){logger[_0xb3dc('0x11')](_0xb3dc('0xc'),_0x1e6379,_0x2f3547[_0xb3dc('0x11')][_0xb3dc('0x13')]);return _0x2c5388(_0x2f3547[_0xb3dc('0x11')][_0xb3dc('0x13')]);}logger[_0xb3dc('0x11')](_0xb3dc('0xc'),_0x1e6379,_0x2f3547['error'][_0xb3dc('0x13')]);return _0x42e234(_0x2f3547[_0xb3dc('0x11')][_0xb3dc('0x13')]);}else{logger[_0xb3dc('0xb')](_0xb3dc('0xc'),_0x1e6379,_0xb3dc('0xd'));_0x42e234(_0x2f3547['result'][_0xb3dc('0x13')]);}})[_0xb3dc('0x14')](function(_0x4a0391){logger[_0xb3dc('0x11')](_0xb3dc('0xc'),_0x1e6379,_0x4a0391);_0x2c5388(_0x4a0391);});});} \ No newline at end of file +var _0x336a=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x38fd54,_0xa841b){var _0x8e82f6=function(_0x3084e6){while(--_0x3084e6){_0x38fd54['push'](_0x38fd54['shift']());}};_0x8e82f6(++_0xa841b);}(_0x336a,0xa3));var _0xa336=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x336a[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xa336('0x0'));var util=require(_0xa336('0x1'));var moment=require(_0xa336('0x2'));var BPromise=require('bluebird');var rs=require(_0xa336('0x3'));var fs=require('fs');var Redis=require(_0xa336('0x4'));var db=require(_0xa336('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa336('0x6'))(_0xa336('0x7'));var config=require(_0xa336('0x8'));var jayson=require(_0xa336('0x9'));var client=jayson[_0xa336('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbec93d,_0x925e4c,_0x1b25de){return new BPromise(function(_0x527ad8,_0x1fdd6e){return client[_0xa336('0xb')](_0xbec93d,_0x1b25de)[_0xa336('0xc')](function(_0x1c7a09){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x925e4c,_0xa336('0xd'));logger[_0xa336('0xe')](_0xa336('0xf'),_0x925e4c,_0xa336('0xd'),JSON[_0xa336('0x10')](_0x1c7a09));if(_0x1c7a09[_0xa336('0x11')]){if(_0x1c7a09[_0xa336('0x11')][_0xa336('0x12')]===0x1f4){logger['error'](_0xa336('0x13'),_0x925e4c,_0x1c7a09[_0xa336('0x11')][_0xa336('0x14')]);return _0x1fdd6e(_0x1c7a09[_0xa336('0x11')]['message']);}logger['error'](_0xa336('0x13'),_0x925e4c,_0x1c7a09[_0xa336('0x11')][_0xa336('0x14')]);return _0x527ad8(_0x1c7a09[_0xa336('0x11')][_0xa336('0x14')]);}else{logger[_0xa336('0x15')](_0xa336('0x13'),_0x925e4c,'request\x20sent');_0x527ad8(_0x1c7a09[_0xa336('0x16')][_0xa336('0x14')]);}})[_0xa336('0x17')](function(_0x4fe949){logger['error'](_0xa336('0x13'),_0x925e4c,_0x4fe949);_0x1fdd6e(_0x4fe949);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 8bcc451..19bb496 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 _0x206b=['destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete'];(function(_0x301fac,_0x3dbf2c){var _0x12b5d0=function(_0x2c1ba3){while(--_0x2c1ba3){_0x301fac['push'](_0x301fac['shift']());}};_0x12b5d0(++_0x3dbf2c);}(_0x206b,0x73));var _0xb206=function(_0x4144ef,_0x3ed22b){_0x4144ef=_0x4144ef-0x0;var _0x3691ba=_0x206b[_0x4144ef];return _0x3691ba;};'use strict';var multer=require(_0xb206('0x0'));var util=require('util');var path=require(_0xb206('0x1'));var timeout=require(_0xb206('0x2'));var express=require(_0xb206('0x3'));var router=express['Router']();var auth=require(_0xb206('0x4'));var interaction=require(_0xb206('0x5'));var config=require(_0xb206('0x6'));var controller=require(_0xb206('0x7'));router[_0xb206('0x8')]('/',auth[_0xb206('0x9')](),controller[_0xb206('0xa')]);router[_0xb206('0x8')](_0xb206('0xb'),auth[_0xb206('0x9')](),controller[_0xb206('0xc')]);router[_0xb206('0x8')](_0xb206('0xd'),auth[_0xb206('0x9')](),controller[_0xb206('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb206('0xf')]);router['put'](_0xb206('0xd'),auth[_0xb206('0x9')](),controller[_0xb206('0x10')]);router[_0xb206('0x11')]('/:id',auth[_0xb206('0x9')](),controller[_0xb206('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6dfb=['multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','show','post','create','put','/:id','destroy','exports'];(function(_0x523671,_0x4657fc){var _0x5b0bdc=function(_0x301007){while(--_0x301007){_0x523671['push'](_0x523671['shift']());}};_0x5b0bdc(++_0x4657fc);}(_0x6dfb,0xc6));var _0xb6df=function(_0x568cc7,_0x3481cc){_0x568cc7=_0x568cc7-0x0;var _0x2d9da3=_0x6dfb[_0x568cc7];return _0x2d9da3;};'use strict';var multer=require(_0xb6df('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb6df('0x1'));var express=require(_0xb6df('0x2'));var router=express[_0xb6df('0x3')]();var auth=require(_0xb6df('0x4'));var interaction=require(_0xb6df('0x5'));var config=require(_0xb6df('0x6'));var controller=require('./chatTransferReport.controller');router[_0xb6df('0x7')]('/',auth['isAuthenticated'](),controller[_0xb6df('0x8')]);router[_0xb6df('0x7')]('/describe',auth[_0xb6df('0x9')](),controller[_0xb6df('0xa')]);router[_0xb6df('0x7')]('/:id',auth[_0xb6df('0x9')](),controller[_0xb6df('0xb')]);router[_0xb6df('0xc')]('/',auth[_0xb6df('0x9')](),controller[_0xb6df('0xd')]);router[_0xb6df('0xe')](_0xb6df('0xf'),auth[_0xb6df('0x9')](),controller['update']);router['delete'](_0xb6df('0xf'),auth[_0xb6df('0x9')](),controller[_0xb6df('0x10')]);module[_0xb6df('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 027c765..f0457b7 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 _0x511b=['Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Note','Skip','star','stringify','input','name','text','getDataValue','onlineForm','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','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','randomstring','exports','STRING','email','#9f946a','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Send'];(function(_0x594821,_0x153b6c){var _0x139112=function(_0x105337){while(--_0x105337){_0x594821['push'](_0x594821['shift']());}};_0x139112(++_0x153b6c);}(_0x511b,0x12e));var _0xb511=function(_0x2b2c79,_0x27ab99){_0x2b2c79=_0x2b2c79-0x0;var _0x4ce337=_0x511b[_0x2b2c79];return _0x4ce337;};'use strict';var Sequelize=require(_0xb511('0x0'));var rs=require(_0xb511('0x1'));module[_0xb511('0x2')]={'name':{'type':Sequelize[_0xb511('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xb511('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xb511('0x4')},'mapKeyOffline':{'type':Sequelize[_0xb511('0x3')],'defaultValue':_0xb511('0x4')},'key':{'type':Sequelize[_0xb511('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb511('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb511('0x3')],'allowNull':![],'defaultValue':_0xb511('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb511('0x3')],'allowNull':![],'defaultValue':_0xb511('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb511('0x3')],'allowNull':![],'defaultValue':_0xb511('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb511('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb511('0x8')](_0xb511('0x9'),_0xb511('0xa')),'defaultValue':_0xb511('0x9')},'header_online':{'type':Sequelize[_0xb511('0x3')],'defaultValue':_0xb511('0xb')},'start_chat_button':{'type':Sequelize[_0xb511('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb511('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xb511('0xd')},'download_transcript':{'type':Sequelize[_0xb511('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb511('0x3')],'defaultValue':_0xb511('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xb511('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb511('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb511('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb511('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xb511('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xb511('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xb511('0x3')],'defaultValue':_0xb511('0xc')},'skipMessageButton':{'type':Sequelize[_0xb511('0x3')],'defaultValue':_0xb511('0x13')},'conditionAgreement':{'type':Sequelize[_0xb511('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingType':{'type':Sequelize[_0xb511('0x8')](_0xb511('0x14'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xb511('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb511('0x10')],'defaultValue':function(){return JSON[_0xb511('0x15')]({'items':[{'type':_0xb511('0x16'),'variable':null,'config':{'placeholder':_0xb511('0x17'),'type':_0xb511('0x18'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xb511('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb511('0x4'),'type':_0xb511('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb511('0x19')](_0xb511('0x1a'))?JSON['parse'](this[_0xb511('0x19')](_0xb511('0x1a'))):{};},'set':function(_0x4ccfdf){return this['setDataValue'](_0xb511('0x1a'),JSON[_0xb511('0x15')](_0x4ccfdf));}},'offlineForm':{'type':Sequelize[_0xb511('0x10')],'defaultValue':function(){return JSON[_0xb511('0x15')]({'items':[{'type':_0xb511('0x16'),'props':{'title':_0xb511('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb511('0x4'),'type':'email'},'variable':null},{'type':_0xb511('0x1b'),'config':{'placeholder':_0xb511('0x1c')},'props':{'title':_0xb511('0x1c'),'helpText':_0xb511('0x1d')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON['parse'](this[_0xb511('0x19')](_0xb511('0x1e'))):{};},'set':function(_0x561d3d){return this[_0xb511('0x1f')](_0xb511('0x1e'),JSON[_0xb511('0x15')](_0x561d3d));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb511('0x20')]();}},'autoclose':{'type':Sequelize[_0xb511('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb511('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb511('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb511('0x3')]},'forwardOffline':{'type':Sequelize[_0xb511('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xb511('0x3')],'defaultValue':_0xb511('0x21')},'waitingMessage':{'type':Sequelize[_0xb511('0x3')],'defaultValue':_0xb511('0x22')},'offlineMessageSubject':{'type':Sequelize[_0xb511('0x3')],'defaultValue':_0xb511('0x23')},'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[_0xb511('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb511('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xb511('0x3')],'defaultValue':_0xb511('0x13')},'sendUnmanaged':{'type':Sequelize[_0xb511('0x3')],'defaultValue':_0xb511('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb511('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xb511('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb511('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb511('0x24');}},'notificationSound':{'type':Sequelize[_0xb511('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb511('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb511('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xb511('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb511('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xb511('0x26')},'verticalAlignment':{'type':Sequelize[_0xb511('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb511('0x3')],'defaultValue':_0xb511('0x27')},'defaultTitle':{'type':Sequelize[_0xb511('0x3')]},'customerAvatar':{'type':Sequelize[_0xb511('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xb511('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb511('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb511('0x3')],'allowNull':![],'defaultValue':_0xb511('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb511('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb511('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb511('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb511('0x3')],'defaultValue':_0xb511('0x29')},'systemAvatar':{'type':Sequelize[_0xb511('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xb511('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0xb511('0xe')],'defaultValue':![],'comment':_0xb511('0x2b'),'set':function(_0x432738){if(!_0x432738)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0xb511('0x2c'),_0x432738);}}}; \ No newline at end of file +var _0x6da6=['squared','Chat','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','thumb','stringify','input','name','text','getDataValue','onlineForm','textarea','Comments','offlineForm','parse','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','#ffffff','BOOLEAN','ENUM','rounded'];(function(_0x836b0a,_0xac6d15){var _0x5e4a2f=function(_0xd33454){while(--_0xd33454){_0x836b0a['push'](_0x836b0a['shift']());}};_0x5e4a2f(++_0xac6d15);}(_0x6da6,0xf3));var _0x66da=function(_0x349c2f,_0x41bd46){_0x349c2f=_0x349c2f-0x0;var _0x5ef6c6=_0x6da6[_0x349c2f];return _0x5ef6c6;};'use strict';var Sequelize=require(_0x66da('0x0'));var rs=require(_0x66da('0x1'));module[_0x66da('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x66da('0x3')],'allowNull':![],'unique':_0x66da('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0x5')},'mapKeyOffline':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0x5')},'key':{'type':Sequelize[_0x66da('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x66da('0x6')},'customerAlias':{'type':Sequelize[_0x66da('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x66da('0x3')],'allowNull':![],'defaultValue':_0x66da('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x66da('0x3')],'allowNull':![],'defaultValue':_0x66da('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x66da('0x3')],'allowNull':![],'defaultValue':_0x66da('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x66da('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x66da('0xa')](_0x66da('0xb'),_0x66da('0xc')),'defaultValue':_0x66da('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x66da('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x66da('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x66da('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x66da('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x66da('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x66da('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x66da('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x66da('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x66da('0x16')},'closingMessageButton':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0x17')},'skipMessageButton':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0x18')},'conditionAgreement':{'type':Sequelize[_0x66da('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x66da('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x66da('0x9')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0x66da('0xa')](_0x66da('0x19'),_0x66da('0x1a')),'defaultValue':_0x66da('0x19')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x66da('0x10')],'defaultValue':function(){return JSON[_0x66da('0x1b')]({'items':[{'type':_0x66da('0x1c'),'variable':null,'config':{'placeholder':_0x66da('0x1d'),'type':_0x66da('0x1e'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x66da('0x5'),'type':_0x66da('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x66da('0x1f')](_0x66da('0x20'))?JSON['parse'](this['getDataValue'](_0x66da('0x20'))):{};},'set':function(_0x2aeda7){return this['setDataValue'](_0x66da('0x20'),JSON['stringify'](_0x2aeda7));}},'offlineForm':{'type':Sequelize[_0x66da('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x66da('0x21'),'config':{'placeholder':_0x66da('0x22')},'props':{'title':_0x66da('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x66da('0x1f')](_0x66da('0x23'))?JSON[_0x66da('0x24')](this[_0x66da('0x1f')]('offlineForm')):{};},'set':function(_0x34d215){return this[_0x66da('0x25')]('offlineForm',JSON[_0x66da('0x1b')](_0x34d215));}},'token':{'type':Sequelize[_0x66da('0x3')],'defaultValue':function(){return rs[_0x66da('0x26')]();}},'autoclose':{'type':Sequelize[_0x66da('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x66da('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x66da('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x66da('0x3')]},'forwardOffline':{'type':Sequelize[_0x66da('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x66da('0x3')]},'waitingTitle':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0x27')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x66da('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x66da('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x66da('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x66da('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0x18')},'sendUnmanaged':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0x17')},'enableCustomerAttachment':{'type':Sequelize[_0x66da('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x66da('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x66da('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x66da('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x66da('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x66da('0x2a');}},'notificationSound':{'type':Sequelize[_0x66da('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x66da('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0x2c')},'verticalAlignment':{'type':Sequelize[_0x66da('0xe')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x66da('0x2d')},'defaultTitle':{'type':Sequelize[_0x66da('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x66da('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x66da('0x3')],'allowNull':![],'defaultValue':_0x66da('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x66da('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x66da('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x66da('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x66da('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x66da('0x3')],'defaultValue':_0x66da('0x2f')},'systemAvatar':{'type':Sequelize[_0x66da('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x66da('0xe')],'comment':_0x66da('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x66da('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xe13ea5){if(!_0xe13ea5)this[_0x66da('0x25')](_0x66da('0x31'),null);this[_0x66da('0x25')](_0x66da('0x32'),_0xe13ea5);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index df871a7..8138e2a 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 _0x736e=['vendor','%s\x20%s\x20%s','type','stringify','threadId','externalUrl','ContactId','interaction','ChatInteraction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','EventManager','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','SendMail','sendMail','email','offlineMessageSubject','addInteraction','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','some','server/files/chat/iframe.js','remote','x-forwarded-for','connection','remoteAddress','replace','alignment','verticalAlignment','sequelize','ChatApplication','bulkCreate','findAndCountAll','getApplications','omit','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','jayson/promise','client','http','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy','end','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','params','removeDispositions','getAnswers','findOne','CannedAnswer','removeAnswers','ids','filename','addAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.png','sitepic','getLicense','isNil','existsSync','join','server/files/images/logos/','download','agentAvatar','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','Applications','List','account','list','applications','orderBy','priority','asc','from','contact','firstName','lastName','customerIp','referer','browser','version','format','%s\x20%s','unknown','device'];(function(_0x53dea4,_0x574a27){var _0xc9140b=function(_0x2e6c5f){while(--_0x2e6c5f){_0x53dea4['push'](_0x53dea4['shift']());}};_0xc9140b(++_0x574a27);}(_0x736e,0x182));var _0xe736=function(_0x7b551c,_0x2296e8){_0x7b551c=_0x7b551c-0x0;var _0x29d219=_0x736e[_0x7b551c];return _0x29d219;};'use strict';var pdf=require(_0xe736('0x0'));var emlformat=require(_0xe736('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe736('0x2'));var jsonpatch=require(_0xe736('0x3'));var rp=require(_0xe736('0x4'));var moment=require(_0xe736('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe736('0x6'));var path=require(_0xe736('0x7'));var sox=require(_0xe736('0x8'));var csv=require('to-csv');var ejs=require(_0xe736('0x9'));var fs=require('fs');var _=require(_0xe736('0xa'));var squel=require(_0xe736('0xb'));var crypto=require(_0xe736('0xc'));var jsforce=require(_0xe736('0xd'));var deskjs=require(_0xe736('0xe'));var toCsv=require(_0xe736('0xf'));var querystring=require(_0xe736('0x10'));var Papa=require(_0xe736('0x11'));var authService=require(_0xe736('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xe736('0x13'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xe736('0x14'));var utils=require(_0xe736('0x15'));var config=require(_0xe736('0x16'));var db=require(_0xe736('0x17'))['db'];config[_0xe736('0x18')]=_[_0xe736('0x19')](config[_0xe736('0x18')],{'host':_0xe736('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe736('0x18')]));require(_0xe736('0x1b'))['register'](socket);var jayson=require(_0xe736('0x1c'));var client=jayson[_0xe736('0x1d')][_0xe736('0x1e')]({'port':0x232c});var client9002=jayson[_0xe736('0x1d')]['http']({'port':0x232a});var client9003=jayson[_0xe736('0x1d')][_0xe736('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x230119,_0x22d062,_0x4ab54e,_0x38f0d9){return new BPromise(function(_0x2ea608,_0x4dc379){var _0x32c825=_0x38f0d9||client;return _0x32c825['request'](_0x230119,_0x4ab54e)['then'](function(_0x3bea4e){logger[_0xe736('0x1f')](_0xe736('0x20'),_0x22d062,_0xe736('0x21'));logger[_0xe736('0x22')](_0xe736('0x23'),_0x22d062,_0xe736('0x21'),JSON['stringify'](_0x3bea4e));if(_0x3bea4e[_0xe736('0x24')]){if(_0x3bea4e['error'][_0xe736('0x25')]===0x1f4){logger['error'](_0xe736('0x20'),_0x22d062,_0x3bea4e['error'][_0xe736('0x26')]);return _0x4dc379(_0x3bea4e[_0xe736('0x24')][_0xe736('0x26')]);}logger[_0xe736('0x24')](_0xe736('0x20'),_0x22d062,_0x3bea4e[_0xe736('0x24')][_0xe736('0x26')]);return _0x2ea608(_0x3bea4e[_0xe736('0x24')]['message']);}else{logger[_0xe736('0x1f')](_0xe736('0x20'),_0x22d062,_0xe736('0x21'));_0x2ea608(_0x3bea4e[_0xe736('0x27')][_0xe736('0x26')]);}})[_0xe736('0x28')](function(_0x4d7c9c){logger[_0xe736('0x24')](_0xe736('0x20'),_0x22d062,_0x4d7c9c);_0x4dc379(_0x4d7c9c);});});}function respondWithStatusCode(_0x14e362,_0x4b19d9){_0x4b19d9=_0x4b19d9||0xcc;return function(_0x6ba426){if(_0x6ba426){return _0x14e362[_0xe736('0x29')](_0x4b19d9);}return _0x14e362[_0xe736('0x2a')](_0x4b19d9)['end']();};}function respondWithResult(_0x21b882,_0x14e760){_0x14e760=_0x14e760||0xc8;return function(_0x56f758){if(_0x56f758){return _0x21b882[_0xe736('0x2a')](_0x14e760)[_0xe736('0x2b')](_0x56f758);}};}function respondWithFilteredResult(_0x5a865f,_0x17783e){return function(_0x53920c){if(_0x53920c){var _0x295cf0=_0x53920c[_0xe736('0x2c')],_0xd59463=_0x17783e[_0xe736('0x2d')],_0x540850=_0x17783e['offset']+_0x17783e['limit'],_0x5e21b4;if(_0x540850>=_0x295cf0){_0x540850=_0x295cf0;_0x5e21b4=0xc8;}else{_0x5e21b4=0xce;}_0x5a865f['status'](_0x5e21b4);return _0x5a865f[_0xe736('0x2e')](_0xe736('0x2f'),_0xd59463+'-'+_0x540850+'/'+_0x295cf0)[_0xe736('0x2b')](_0x53920c);}return null;};}function patchUpdates(_0x5d77d1){return function(_0x1915c7){try{jsonpatch[_0xe736('0x30')](_0x1915c7,_0x5d77d1,!![]);}catch(_0x378c43){return BPromise['reject'](_0x378c43);}return _0x1915c7[_0xe736('0x31')]();};}function saveUpdates(_0x377d8f,_0x482caf){return function(_0x19977d){if(_0x19977d){return _0x19977d[_0xe736('0x32')](_0x377d8f)[_0xe736('0x33')](function(_0x2a9cbe){return _0x2a9cbe;});}return null;};}function removeEntity(_0x34eb82,_0x1cbd0a){return function(_0x1d6cdb){if(_0x1d6cdb){return _0x1d6cdb[_0xe736('0x34')]()[_0xe736('0x33')](function(){var _0x38772c=_0x1d6cdb['get']({'plain':!![]});var _0x48cc05='ChatWebsites';return db['UserProfileResource'][_0xe736('0x34')]({'where':{'type':_0x48cc05,'resourceId':_0x38772c['id']}})[_0xe736('0x33')](function(){return _0x1d6cdb;});})[_0xe736('0x33')](function(){_0x34eb82[_0xe736('0x2a')](0xcc)[_0xe736('0x35')]();});}};}function handleEntityNotFound(_0x2b0f02,_0x43f18f){return function(_0x3a3394){if(!_0x3a3394){_0x2b0f02[_0xe736('0x29')](0x194);}return _0x3a3394;};}function handleError(_0x5b108b,_0x583407){_0x583407=_0x583407||0x1f4;return function(_0xe9114){logger[_0xe736('0x24')](_0xe9114['stack']);if(_0xe9114[_0xe736('0x36')]){delete _0xe9114[_0xe736('0x36')];}_0x5b108b[_0xe736('0x2a')](_0x583407)[_0xe736('0x37')](_0xe9114);};}exports[_0xe736('0x38')]=function(_0x1ef205,_0x1173b3){var _0x4cb4d2={'include':[{'model':db[_0xe736('0x39')],'as':_0xe736('0x3a')}]},_0x5f5247={},_0x44283f={'count':0x0,'rows':[]};var _0x57ceac=db[_0xe736('0x3b')][_0xe736('0x3c')];_0x5f5247['model']=_[_0xe736('0x3d')](_0x57ceac);_0x5f5247[_0xe736('0x3e')]=_['keys'](_0x1ef205[_0xe736('0x3e')]);_0x5f5247[_0xe736('0x3f')]=_[_0xe736('0x40')](_0x5f5247[_0xe736('0x41')],_0x5f5247[_0xe736('0x3e')]);_0x4cb4d2[_0xe736('0x42')]=_[_0xe736('0x40')](_0x5f5247[_0xe736('0x41')],qs[_0xe736('0x43')](_0x1ef205[_0xe736('0x3e')][_0xe736('0x43')]));_0x4cb4d2[_0xe736('0x42')]=_0x4cb4d2[_0xe736('0x42')][_0xe736('0x44')]?_0x4cb4d2[_0xe736('0x42')]:_0x5f5247[_0xe736('0x41')];if(!_0x1ef205['query'][_0xe736('0x45')](_0xe736('0x46'))){_0x4cb4d2[_0xe736('0x47')]=qs[_0xe736('0x47')](_0x1ef205['query'][_0xe736('0x47')]);_0x4cb4d2[_0xe736('0x2d')]=qs[_0xe736('0x2d')](_0x1ef205[_0xe736('0x3e')][_0xe736('0x2d')]);}_0x4cb4d2[_0xe736('0x48')]=qs[_0xe736('0x49')](_0x1ef205['query'][_0xe736('0x49')]);_0x4cb4d2[_0xe736('0x4a')]=qs[_0xe736('0x3f')](_[_0xe736('0x4b')](_0x1ef205[_0xe736('0x3e')],_0x5f5247[_0xe736('0x3f')]));if(_0x1ef205['query'][_0xe736('0x4c')]){_0x4cb4d2['where']=_[_0xe736('0x4d')](_0x4cb4d2['where'],{'$or':_[_0xe736('0x4e')](_0x57ceac,function(_0x7e8449){if(_0x7e8449['type'][_0xe736('0x4f')]!==_0xe736('0x50')){var _0x10a572={};_0x10a572[_0x7e8449[_0xe736('0x51')]]={'$like':'%'+_0x1ef205[_0xe736('0x3e')][_0xe736('0x4c')]+'%'};return _0x10a572;}})});}_0x4cb4d2=_[_0xe736('0x4d')]({},_0x4cb4d2,_0x1ef205[_0xe736('0x52')]);var _0x48856d={'where':_0x4cb4d2[_0xe736('0x4a')]};return db[_0xe736('0x3b')]['count'](_0x48856d)['then'](function(_0x499c53){_0x44283f[_0xe736('0x2c')]=_0x499c53;if(_0x1ef205['query'][_0xe736('0x53')]){_0x4cb4d2[_0xe736('0x54')]=[{'all':!![]}];}return db[_0xe736('0x3b')][_0xe736('0x55')](_0x4cb4d2);})[_0xe736('0x33')](function(_0x595dc3){_0x44283f[_0xe736('0x56')]=_0x595dc3;return _0x44283f;})[_0xe736('0x33')](respondWithFilteredResult(_0x1173b3,_0x4cb4d2))[_0xe736('0x28')](handleError(_0x1173b3,null));};exports[_0xe736('0x57')]=function(_0x503bce,_0xf756aa){var _0x4a7428={'raw':![],'where':{'id':_0x503bce['params']['id']},'include':[{'model':db['Pause'],'as':_0xe736('0x3a')}]},_0x5ce1d1={};_0x5ce1d1[_0xe736('0x41')]=_[_0xe736('0x3d')](db['ChatWebsite'][_0xe736('0x3c')]);_0x5ce1d1[_0xe736('0x3e')]=_[_0xe736('0x3d')](_0x503bce[_0xe736('0x3e')]);_0x5ce1d1[_0xe736('0x3f')]=_['intersection'](_0x5ce1d1[_0xe736('0x41')],_0x5ce1d1['query']);_0x4a7428[_0xe736('0x42')]=_[_0xe736('0x40')](_0x5ce1d1[_0xe736('0x41')],qs[_0xe736('0x43')](_0x503bce[_0xe736('0x3e')][_0xe736('0x43')]));_0x4a7428['attributes']=_0x4a7428['attributes'][_0xe736('0x44')]?_0x4a7428[_0xe736('0x42')]:_0x5ce1d1[_0xe736('0x41')];if(_0x503bce[_0xe736('0x3e')][_0xe736('0x53')]){_0x4a7428[_0xe736('0x54')]=[{'all':!![]}];}_0x4a7428=_[_0xe736('0x4d')]({},_0x4a7428,_0x503bce['options']);return db[_0xe736('0x3b')][_0xe736('0x58')](_0x4a7428)[_0xe736('0x33')](handleEntityNotFound(_0xf756aa,null))[_0xe736('0x33')](respondWithResult(_0xf756aa,null))[_0xe736('0x28')](handleError(_0xf756aa,null));};exports[_0xe736('0x59')]=function(_0x1828d3,_0x5b291b){return db[_0xe736('0x3b')][_0xe736('0x59')](_0x1828d3[_0xe736('0x5a')],{})['then'](function(_0x40a052){var _0xfc0f42=_0x1828d3[_0xe736('0x5b')][_0xe736('0x5c')]({'plain':!![]});if(!_0xfc0f42)throw new Error(_0xe736('0x5d'));if(_0xfc0f42[_0xe736('0x5e')]===_0xe736('0x5b')){var _0xfa2113=_0x40a052[_0xe736('0x5c')]({'plain':!![]});var _0x2cb48d=_0xe736('0x5f');return db[_0xe736('0x60')]['find']({'where':{'name':_0x2cb48d,'userProfileId':_0xfc0f42['userProfileId']},'raw':!![]})[_0xe736('0x33')](function(_0x2720fb){if(_0x2720fb&&_0x2720fb[_0xe736('0x61')]===0x0){return db['UserProfileResource'][_0xe736('0x59')]({'name':_0xfa2113[_0xe736('0x36')],'resourceId':_0xfa2113['id'],'type':_0x2720fb[_0xe736('0x36')],'sectionId':_0x2720fb['id']},{})[_0xe736('0x33')](function(){return _0x40a052;});}else{return _0x40a052;}})[_0xe736('0x28')](function(_0x424c61){logger[_0xe736('0x24')](_0xe736('0x62'),_0x424c61);throw _0x424c61;});}return _0x40a052;})[_0xe736('0x33')](respondWithResult(_0x5b291b,0xc9))[_0xe736('0x28')](handleError(_0x5b291b,null));};exports[_0xe736('0x32')]=function(_0x24291e,_0x3317c6){if(_0x24291e['body']['id']){delete _0x24291e[_0xe736('0x5a')]['id'];}return db[_0xe736('0x3b')]['find']({'where':{'id':_0x24291e['params']['id']},'include':[{'model':db[_0xe736('0x39')],'as':_0xe736('0x3a')}]})[_0xe736('0x33')](handleEntityNotFound(_0x3317c6,null))[_0xe736('0x33')](saveUpdates(_0x24291e[_0xe736('0x5a')],null))[_0xe736('0x33')](function(_0x461aed){if(_0x461aed&&_0x24291e['body'][_0xe736('0x3a')]){return db['Pause'][_0xe736('0x32')](_0x24291e[_0xe736('0x5a')][_0xe736('0x3a')],{'where':{'ChatWebsiteId':_0x461aed['id']}})[_0xe736('0x33')](function(){return _0x461aed;});}return _0x461aed;})[_0xe736('0x33')](respondWithResult(_0x3317c6,null))[_0xe736('0x28')](handleError(_0x3317c6,null));};exports[_0xe736('0x34')]=function(_0x2d6d93,_0x400db2){return db[_0xe736('0x3b')][_0xe736('0x58')]({'where':{'id':_0x2d6d93['params']['id']}})['then'](handleEntityNotFound(_0x400db2,null))[_0xe736('0x33')](removeEntity(_0x400db2,null))['catch'](handleError(_0x400db2,null));};exports[_0xe736('0x63')]=function(_0x3218bf,_0x53f970){return db[_0xe736('0x3b')]['describe']()[_0xe736('0x33')](respondWithResult(_0x53f970,null))[_0xe736('0x28')](handleError(_0x53f970,null));};exports[_0xe736('0x64')]=function(_0x50ebfa,_0x172562,_0x539a36){if(_0x50ebfa[_0xe736('0x5a')]['id']){delete _0x50ebfa[_0xe736('0x5a')]['id'];}return db['ChatWebsite'][_0xe736('0x58')]({'where':{'id':_0x50ebfa['params']['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x172562,null))[_0xe736('0x33')](function(_0x38ab80){if(_0x38ab80){_0x50ebfa[_0xe736('0x5a')][_0xe736('0x65')]=_0x38ab80['id'];return db[_0xe736('0x66')]['create'](_0x50ebfa[_0xe736('0x5a')]);}})[_0xe736('0x33')](respondWithResult(_0x172562,null))[_0xe736('0x28')](handleError(_0x172562,null));};exports[_0xe736('0x67')]=function(_0x110135,_0x301495,_0x2345cf){var _0x5d0514={'raw':![],'where':{}};var _0x2579c2={};var _0x11cd4b={'count':0x0,'rows':[]};return db[_0xe736('0x3b')]['findOne']({'where':{'id':_0x110135[_0xe736('0x68')]['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x301495,null))[_0xe736('0x33')](function(_0x2233aa){if(_0x2233aa){_0x2579c2['model']=_[_0xe736('0x3d')](db[_0xe736('0x66')][_0xe736('0x3c')]);_0x2579c2['query']=_[_0xe736('0x3d')](_0x110135[_0xe736('0x3e')]);_0x2579c2[_0xe736('0x3f')]=_[_0xe736('0x40')](_0x2579c2[_0xe736('0x41')],_0x2579c2[_0xe736('0x3e')]);_0x5d0514[_0xe736('0x42')]=_['intersection'](_0x2579c2['model'],qs[_0xe736('0x43')](_0x110135[_0xe736('0x3e')][_0xe736('0x43')]));_0x5d0514['attributes']=_0x5d0514['attributes']['length']?_0x5d0514[_0xe736('0x42')]:_0x2579c2[_0xe736('0x41')];if(!_0x110135[_0xe736('0x3e')][_0xe736('0x45')]('nolimit')){_0x5d0514[_0xe736('0x47')]=qs[_0xe736('0x47')](_0x110135[_0xe736('0x3e')][_0xe736('0x47')]);_0x5d0514['offset']=qs[_0xe736('0x2d')](_0x110135[_0xe736('0x3e')][_0xe736('0x2d')]);}_0x5d0514['order']=qs[_0xe736('0x49')](_0x110135[_0xe736('0x3e')][_0xe736('0x49')]);_0x5d0514['where']=qs[_0xe736('0x3f')](_[_0xe736('0x4b')](_0x110135[_0xe736('0x3e')],_0x2579c2['filters']));_0x5d0514[_0xe736('0x4a')][_0xe736('0x65')]=_0x2233aa['id'];if(_0x110135[_0xe736('0x3e')]['filter']){_0x5d0514['where']=_[_0xe736('0x4d')](_0x5d0514[_0xe736('0x4a')],{'$or':_[_0xe736('0x4e')](_0x5d0514['attributes'],function(_0x5a0b20){var _0x197379={};_0x197379[_0x5a0b20]={'$like':'%'+_0x110135['query'][_0xe736('0x4c')]+'%'};return _0x197379;})});}_0x5d0514=_[_0xe736('0x4d')]({},_0x5d0514,_0x110135[_0xe736('0x52')]);return db[_0xe736('0x66')][_0xe736('0x2c')]({'where':_0x5d0514['where']})[_0xe736('0x33')](function(_0x2c26ee){_0x11cd4b['count']=_0x2c26ee;if(_0x110135['query'][_0xe736('0x53')]){_0x5d0514[_0xe736('0x54')]=[{'all':!![]}];}return db[_0xe736('0x66')][_0xe736('0x55')](_0x5d0514);})[_0xe736('0x33')](function(_0xb75363){_0x11cd4b[_0xe736('0x56')]=_0xb75363;return _0x11cd4b;});}})[_0xe736('0x33')](respondWithFilteredResult(_0x301495,_0x5d0514))[_0xe736('0x28')](handleError(_0x301495,null));};exports[_0xe736('0x69')]=function(_0x4cb0e4,_0x47f677,_0x2e7851){var _0x1c5a72;return db[_0xe736('0x3b')][_0xe736('0x58')]({'where':{'id':_0x4cb0e4[_0xe736('0x68')]['id']}})['then'](handleEntityNotFound(_0x47f677,null))[_0xe736('0x33')](function(_0x695ff9){if(_0x695ff9){return _0x695ff9[_0xe736('0x69')](_0x4cb0e4[_0xe736('0x3e')]['ids']);}})[_0xe736('0x33')](respondWithStatusCode(_0x47f677,null))[_0xe736('0x28')](handleError(_0x47f677,null));};exports['addAnswer']=function(_0x287dfd,_0x99ad23,_0x42181f){if(_0x287dfd[_0xe736('0x5a')]['id']){delete _0x287dfd['body']['id'];}return db[_0xe736('0x3b')][_0xe736('0x58')]({'where':{'id':_0x287dfd[_0xe736('0x68')]['id']}})['then'](handleEntityNotFound(_0x99ad23,null))[_0xe736('0x33')](function(_0x25dcae){if(_0x25dcae){_0x287dfd['body'][_0xe736('0x65')]=_0x25dcae['id'];return db['CannedAnswer'][_0xe736('0x59')](_0x287dfd[_0xe736('0x5a')]);}})[_0xe736('0x33')](respondWithResult(_0x99ad23,null))[_0xe736('0x28')](handleError(_0x99ad23,null));};exports[_0xe736('0x6a')]=function(_0x3cd72f,_0x4ac180,_0x25d5ab){var _0x39fb04={'raw':![],'where':{}};var _0x4f2d29={};var _0x66b081={'count':0x0,'rows':[]};return db[_0xe736('0x3b')][_0xe736('0x6b')]({'where':{'id':_0x3cd72f[_0xe736('0x68')]['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x4ac180,null))[_0xe736('0x33')](function(_0x1b13a9){if(_0x1b13a9){_0x4f2d29['model']=_[_0xe736('0x3d')](db[_0xe736('0x6c')]['rawAttributes']);_0x4f2d29['query']=_['keys'](_0x3cd72f[_0xe736('0x3e')]);_0x4f2d29['filters']=_['intersection'](_0x4f2d29[_0xe736('0x41')],_0x4f2d29[_0xe736('0x3e')]);_0x39fb04['attributes']=_[_0xe736('0x40')](_0x4f2d29['model'],qs[_0xe736('0x43')](_0x3cd72f[_0xe736('0x3e')][_0xe736('0x43')]));_0x39fb04['attributes']=_0x39fb04[_0xe736('0x42')][_0xe736('0x44')]?_0x39fb04[_0xe736('0x42')]:_0x4f2d29['model'];if(!_0x3cd72f[_0xe736('0x3e')][_0xe736('0x45')](_0xe736('0x46'))){_0x39fb04[_0xe736('0x47')]=qs[_0xe736('0x47')](_0x3cd72f[_0xe736('0x3e')][_0xe736('0x47')]);_0x39fb04['offset']=qs[_0xe736('0x2d')](_0x3cd72f[_0xe736('0x3e')][_0xe736('0x2d')]);}_0x39fb04['order']=qs[_0xe736('0x49')](_0x3cd72f['query'][_0xe736('0x49')]);_0x39fb04[_0xe736('0x4a')]=qs[_0xe736('0x3f')](_[_0xe736('0x4b')](_0x3cd72f['query'],_0x4f2d29['filters']));_0x39fb04[_0xe736('0x4a')][_0xe736('0x65')]=_0x1b13a9['id'];if(_0x3cd72f[_0xe736('0x3e')][_0xe736('0x4c')]){_0x39fb04[_0xe736('0x4a')]=_[_0xe736('0x4d')](_0x39fb04['where'],{'$or':_[_0xe736('0x4e')](_0x39fb04[_0xe736('0x42')],function(_0x4fda78){var _0x28fbfb={};_0x28fbfb[_0x4fda78]={'$like':'%'+_0x3cd72f['query'][_0xe736('0x4c')]+'%'};return _0x28fbfb;})});}_0x39fb04=_[_0xe736('0x4d')]({},_0x39fb04,_0x3cd72f[_0xe736('0x52')]);return db[_0xe736('0x6c')][_0xe736('0x2c')]({'where':_0x39fb04['where']})[_0xe736('0x33')](function(_0x634efc){_0x66b081[_0xe736('0x2c')]=_0x634efc;if(_0x3cd72f['query'][_0xe736('0x53')]){_0x39fb04[_0xe736('0x54')]=[{'all':!![]}];}return db[_0xe736('0x6c')]['findAll'](_0x39fb04);})[_0xe736('0x33')](function(_0x357636){_0x66b081['rows']=_0x357636;return _0x66b081;});}})[_0xe736('0x33')](respondWithFilteredResult(_0x4ac180,_0x39fb04))[_0xe736('0x28')](handleError(_0x4ac180,null));};exports[_0xe736('0x6d')]=function(_0x3ad340,_0xf81ea8,_0x3da782){var _0x4856ab;return db[_0xe736('0x3b')]['find']({'where':{'id':_0x3ad340[_0xe736('0x68')]['id']}})[_0xe736('0x33')](handleEntityNotFound(_0xf81ea8,null))[_0xe736('0x33')](function(_0x11605a){if(_0x11605a){return _0x11605a[_0xe736('0x6d')](_0x3ad340[_0xe736('0x3e')][_0xe736('0x6e')]);}})[_0xe736('0x33')](respondWithStatusCode(_0xf81ea8,null))[_0xe736('0x28')](handleError(_0xf81ea8,null));};exports['addLogo']=function(_0x1805cf,_0x229f6,_0x24219f){_0x1805cf[_0xe736('0x5a')]['sitepic']=_0x1805cf['file'][_0xe736('0x6f')];return db[_0xe736('0x3b')][_0xe736('0x58')]({'where':{'id':_0x1805cf['params']['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x229f6,null))[_0xe736('0x33')](saveUpdates(_0x1805cf[_0xe736('0x5a')],null))['then'](respondWithResult(_0x229f6,null))[_0xe736('0x28')](handleError(_0x229f6,null));};exports[_0xe736('0x70')]=function(_0x121ea8,_0x1e912b,_0x574ab4){_0x121ea8['body']['agentAvatar']=_0x121ea8[_0xe736('0x71')][_0xe736('0x6f')];return db['ChatWebsite'][_0xe736('0x58')]({'where':{'id':_0x121ea8[_0xe736('0x68')]['id']}})['then'](handleEntityNotFound(_0x1e912b,null))['then'](saveUpdates(_0x121ea8[_0xe736('0x5a')],null))[_0xe736('0x33')](respondWithResult(_0x1e912b,null))[_0xe736('0x28')](handleError(_0x1e912b,null));};exports[_0xe736('0x72')]=function(_0x46b45f,_0x837520,_0x3c6b0e){_0x46b45f[_0xe736('0x5a')][_0xe736('0x73')]=_0x46b45f[_0xe736('0x71')][_0xe736('0x6f')];return db['ChatWebsite'][_0xe736('0x58')]({'where':{'id':_0x46b45f[_0xe736('0x68')]['id']}})['then'](handleEntityNotFound(_0x837520,null))[_0xe736('0x33')](saveUpdates(_0x46b45f['body'],null))[_0xe736('0x33')](respondWithResult(_0x837520,null))[_0xe736('0x28')](handleError(_0x837520,null));};exports[_0xe736('0x74')]=function(_0x49912d,_0x445ebd,_0x4dbe9c){_0x49912d[_0xe736('0x5a')]['systemAvatar']=_0x49912d['file'][_0xe736('0x6f')];return db['ChatWebsite'][_0xe736('0x58')]({'where':{'id':_0x49912d[_0xe736('0x68')]['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x445ebd,null))[_0xe736('0x33')](saveUpdates(_0x49912d[_0xe736('0x5a')],null))[_0xe736('0x33')](respondWithResult(_0x445ebd,null))['catch'](handleError(_0x445ebd,null));};exports[_0xe736('0x75')]=function(_0xaceb54,_0x302e7d,_0x2a0bb0){var _0x16f9dd=path['join'](config[_0xe736('0x76')],_0xe736('0x77'));var _0x29e286={'where':{'id':_0xaceb54[_0xe736('0x68')]['id']},'attributes':['id',_0xe736('0x78')],'raw':!![]};var _0xc5ea83=![];return require('../../config/license/util')[_0xe736('0x79')]()[_0xe736('0x33')](function(_0x33aca0){if(_0x33aca0){_0xc5ea83=_0x33aca0['custom'];}})[_0xe736('0x33')](function(){return db[_0xe736('0x3b')][_0xe736('0x58')](_0x29e286);})[_0xe736('0x33')](handleEntityNotFound(_0x302e7d,null))[_0xe736('0x33')](function(_0x225e4c){if(_0x225e4c){if(!_[_0xe736('0x7a')](_0x225e4c['sitepic'])){if(fs[_0xe736('0x7b')](path[_0xe736('0x7c')](config['root'],'server/files/images/logos/',_0x225e4c[_0xe736('0x78')]))&&_0xc5ea83){_0x16f9dd=path[_0xe736('0x7c')](config[_0xe736('0x76')],_0xe736('0x7d'),_0x225e4c[_0xe736('0x78')]);}}return _0x302e7d[_0xe736('0x7e')](_0x16f9dd);}})[_0xe736('0x28')](handleError(_0x302e7d,null));};exports['getAvatar']=function(_0x3a2881,_0x454b0f,_0x5abb73){var _0x58a46a=path[_0xe736('0x7c')](config[_0xe736('0x76')],'server/files/images/avatars/default_avatar.png');var _0x1956bf={'where':{'id':_0x3a2881[_0xe736('0x68')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xe736('0x3b')][_0xe736('0x58')](_0x1956bf)['then'](handleEntityNotFound(_0x454b0f,null))[_0xe736('0x33')](function(_0x532037){if(_0x532037){if(!_[_0xe736('0x7a')](_0x532037[_0xe736('0x7f')])){if(fs[_0xe736('0x7b')](path[_0xe736('0x7c')](config[_0xe736('0x76')],'server/files/images/avatars/',_0x532037[_0xe736('0x7f')]))){_0x58a46a=path[_0xe736('0x7c')](config[_0xe736('0x76')],'server/files/images/avatars/',_0x532037[_0xe736('0x7f')]);}}return _0x454b0f[_0xe736('0x7e')](_0x58a46a);}})[_0xe736('0x28')](handleError(_0x454b0f,null));};exports[_0xe736('0x80')]=function(_0x46329e,_0x1b740e,_0x479c3b){var _0x10373f=path[_0xe736('0x7c')](config[_0xe736('0x76')],_0xe736('0x81'));var _0x221b5={'where':{'id':_0x46329e[_0xe736('0x68')]['id']},'attributes':['id',_0xe736('0x73'),'showCustomerAvatar'],'raw':!![]};return db[_0xe736('0x3b')][_0xe736('0x58')](_0x221b5)['then'](handleEntityNotFound(_0x1b740e,null))[_0xe736('0x33')](function(_0x41f75c){if(_0x41f75c){if(!_[_0xe736('0x7a')](_0x41f75c[_0xe736('0x73')])){if(fs[_0xe736('0x7b')](path[_0xe736('0x7c')](config[_0xe736('0x76')],_0xe736('0x82'),_0x41f75c[_0xe736('0x73')]))&&_0x41f75c[_0xe736('0x83')]){_0x10373f=path['join'](config[_0xe736('0x76')],_0xe736('0x82'),_0x41f75c[_0xe736('0x73')]);}}return _0x1b740e[_0xe736('0x7e')](_0x10373f);}})[_0xe736('0x28')](handleError(_0x1b740e,null));};exports[_0xe736('0x84')]=function(_0x58a8eb,_0x597970,_0xe9483d){var _0x289ad7=path[_0xe736('0x7c')](config[_0xe736('0x76')],_0xe736('0x85'));var _0x54f9e7={'where':{'id':_0x58a8eb[_0xe736('0x68')]['id']},'attributes':['id',_0xe736('0x86')],'raw':!![]};return db[_0xe736('0x3b')][_0xe736('0x58')](_0x54f9e7)['then'](handleEntityNotFound(_0x597970,null))[_0xe736('0x33')](function(_0x21a8b2){if(_0x21a8b2){if(!_['isNil'](_0x21a8b2['systemAvatar'])){if(fs['existsSync'](path[_0xe736('0x7c')](config[_0xe736('0x76')],_0xe736('0x82'),_0x21a8b2['systemAvatar']))){_0x289ad7=path[_0xe736('0x7c')](config[_0xe736('0x76')],'server/files/images/avatars/',_0x21a8b2[_0xe736('0x86')]);}}return _0x597970['download'](_0x289ad7);}})[_0xe736('0x28')](handleError(_0x597970,null));};exports[_0xe736('0x87')]=function(_0x5cd14b,_0x45b50f,_0x299477){var _0x340ce9=require(_0xe736('0x88'));var _0x772dd2=new _0x340ce9();var _0x282caa=_0x772dd2[_0xe736('0x89')](_0x5cd14b[_0xe736('0x8a')][_0xe736('0x8b')])[_0xe736('0x8c')]();var _0x44b30e={'body':_0x5cd14b[_0xe736('0x5a')],'channel':_0xe736('0x8d')};var _0x1309b5=[];var _0x237e71=[];var _0x159b70={};var _0x3bb834=![];return db['CmContact'][_0xe736('0x63')]()[_0xe736('0x33')](function(_0x4573ae){if(!_0x4573ae){throw new db[(_0xe736('0x8e'))]['ValidationError'](_0xe736('0x8f'));}_0x1309b5=_[_0xe736('0x90')](_['keys'](_0x4573ae),[_0xe736('0x91'),_0xe736('0x92')]);_0x237e71=_[_0xe736('0x90')](_[_0xe736('0x3d')](_0x4573ae),[_0xe736('0x91'),_0xe736('0x92'),_0xe736('0x93'),_0xe736('0x94')]);if(_0x5cd14b['body']['id']){delete _0x5cd14b['body']['id'];}if(_['isNil'](_0x5cd14b[_0xe736('0x5a')]['from'])){throw new db[(_0xe736('0x8e'))][(_0xe736('0x95'))](_0xe736('0x96'));}if(_[_0xe736('0x7a')](_0x5cd14b[_0xe736('0x5a')][_0xe736('0x5a')])||_0x5cd14b['body'][_0xe736('0x5a')]===''){throw new db[(_0xe736('0x8e'))]['ValidationError'](_0xe736('0x97'));}if(_[_0xe736('0x7a')](_0x5cd14b['body'][_0xe736('0x98')])){throw new db[(_0xe736('0x8e'))][(_0xe736('0x95'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x237e71);}if(!_['includes'](_0x237e71,_0x5cd14b[_0xe736('0x5a')][_0xe736('0x98')])){throw new db['Sequelize'][(_0xe736('0x95'))](_0xe736('0x99')+_0x237e71);}_0x159b70[_0x5cd14b[_0xe736('0x5a')][_0xe736('0x98')]]=_0x5cd14b[_0xe736('0x5a')]['from'];})[_0xe736('0x33')](function(){return db[_0xe736('0x3b')]['find']({'where':{'id':_0x5cd14b[_0xe736('0x68')]['id']},'include':[{'model':db[_0xe736('0x9a')],'as':'List','include':[{'model':db[_0xe736('0x9b')],'as':_0xe736('0x9c'),'where':_0x159b70,'limit':0x1,'order':[[_0xe736('0x92'),_0xe736('0x9d')]]}]},{'model':db['ChatApplication'],'as':_0xe736('0x9e')}]});})['then'](handleEntityNotFound(_0x45b50f,null))[_0xe736('0x33')](function(_0x1bf1ae){if(_0x1bf1ae&&_0x1bf1ae[_0xe736('0x9f')]){_0x44b30e[_0xe736('0xa0')]=_0x1bf1ae;_0x44b30e['applications']=_0x1bf1ae['Applications'];_0x44b30e[_0xe736('0xa1')]=_0x1bf1ae['List'];_0x44b30e[_0xe736('0xa2')]=_[_0xe736('0xa3')](_0x44b30e[_0xe736('0xa2')],[_0xe736('0xa4')],[_0xe736('0xa5')]);if(_0x44b30e[_0xe736('0xa0')][_0xe736('0x9e')]){delete _0x44b30e[_0xe736('0xa0')][_0xe736('0x9e')];}if(_0x44b30e[_0xe736('0xa0')]['List']&&_0x44b30e[_0xe736('0xa0')]['List'][_0xe736('0x9c')][_0xe736('0x44')]){return _0x44b30e[_0xe736('0xa0')][_0xe736('0x9f')]['Contacts'][0x0];}var _0x1cbb64=_[_0xe736('0x19')](_0x5cd14b[_0xe736('0x5a')],{'firstName':_0x5cd14b[_0xe736('0x5a')][_0xe736('0xa6')],'ListId':_0x1bf1ae[_0xe736('0x94')]});_0x1cbb64[_0x5cd14b['body'][_0xe736('0x98')]]=_0x5cd14b[_0xe736('0x5a')][_0xe736('0xa6')];return db[_0xe736('0x9b')][_0xe736('0x59')](_0x1cbb64,{'fields':_0x1309b5,'raw':!![]});}})[_0xe736('0x33')](handleEntityNotFound(_0x45b50f,null))[_0xe736('0x33')](function(_0xdfceed){_0x44b30e[_0xe736('0xa7')]=_0xdfceed;if(_0xdfceed){var _0x3ba3b1={'ContactId':_0xdfceed['id'],'ChatWebsiteId':_0x5cd14b[_0xe736('0x68')]['id'],'from':(_0xdfceed[_0xe736('0xa8')]||'')+'\x20'+(_0xdfceed[_0xe736('0xa9')]||''),'customerIp':_0x5cd14b[_0xe736('0x5a')][_0xe736('0xaa')],'referer':_0x5cd14b[_0xe736('0x5a')][_0xe736('0xab')],'browserName':_0x282caa[_0xe736('0xac')][_0xe736('0x36')]&&_0x282caa[_0xe736('0xac')][_0xe736('0xad')]?util[_0xe736('0xae')](_0xe736('0xaf'),_0x282caa[_0xe736('0xac')][_0xe736('0x36')],_0x282caa[_0xe736('0xac')][_0xe736('0xad')]):_0xe736('0xb0'),'browserVersion':_0x282caa[_0xe736('0xac')][_0xe736('0xad')]||_0xe736('0xb0'),'osName':util[_0xe736('0xae')](_0xe736('0xaf'),_0x282caa['os'][_0xe736('0x36')],_0x282caa['os']['version']),'osVersion':_0x282caa['os'][_0xe736('0xad')],'deviceModel':_0x282caa[_0xe736('0xb1')][_0xe736('0x41')]&&_0x282caa[_0xe736('0xb1')][_0xe736('0xb2')]?util['format'](_0xe736('0xb3'),_0x282caa['device'][_0xe736('0x41')],_0x282caa[_0xe736('0xb1')]['vendor'],_0x282caa[_0xe736('0xb1')]['type']):null,'deviceVendor':_0x282caa[_0xe736('0xb1')]['vendor'],'deviceType':_0x282caa[_0xe736('0xb1')][_0xe736('0xb4')],'formData':JSON[_0xe736('0xb5')](_0x5cd14b[_0xe736('0x5a')])};var _0x13adcb={'ChatWebsiteId':_0x5cd14b['params']['id'],'closed':![]};if(_0x5cd14b[_0xe736('0x5a')]['threadId']){_0x13adcb['threadId']=_0x5cd14b['body'][_0xe736('0xb6')];return db['ChatInteraction'][_0xe736('0x58')]({'where':_0x13adcb})[_0xe736('0x33')](function(_0x7c9b3c){if(_0x7c9b3c){return[_0x7c9b3c,![]];}_0x3ba3b1[_0xe736('0xb6')]=_0x5cd14b['body'][_0xe736('0xb6')];_0x3ba3b1[_0xe736('0xb7')]=_0x5cd14b[_0xe736('0x5a')][_0xe736('0xb7')];return db['ChatInteraction']['create'](_0x3ba3b1)['then'](function(_0x57e5c3){return[_0x57e5c3,!![]];});});}_0x13adcb[_0xe736('0xb8')]=_0xdfceed['id'];if(_0x5cd14b[_0xe736('0x5a')]['interaction']&&_0x5cd14b[_0xe736('0x5a')][_0xe736('0xb9')]['id']){_0x13adcb['id']=_0x5cd14b['body'][_0xe736('0xb9')]['id'];return db[_0xe736('0xba')][_0xe736('0x58')]({'where':_0x13adcb})[_0xe736('0x33')](function(_0x42a8df){if(_0x42a8df){return[_0x42a8df,![]];}return db[_0xe736('0xba')][_0xe736('0x59')](_0x3ba3b1)['then'](function(_0x31e05f){return[_0x31e05f,!![]];});});}return db[_0xe736('0xba')][_0xe736('0x59')](_0x3ba3b1)['then'](function(_0x399031){return[_0x399031,!![]];});}})[_0xe736('0xbb')](function(_0x4c6188,_0xcbf247){if(_0x4c6188){_0x3bb834=_0xcbf247;if(!_0xcbf247){var _0x5a99f6={'from':(_0x44b30e[_0xe736('0xa7')][_0xe736('0xa8')]||'')+'\x20'+(_0x44b30e[_0xe736('0xa7')]['lastName']||'')};if(_0x5cd14b[_0xe736('0x5a')][_0xe736('0xb6')]&&_0x5cd14b[_0xe736('0x5a')][_0xe736('0xbc')]&&_0x5cd14b[_0xe736('0x5a')][_0xe736('0xb6')]!=_0x5cd14b[_0xe736('0x5a')]['messageId']){_0x5a99f6[_0xe736('0xb6')]=_0x5cd14b[_0xe736('0x5a')][_0xe736('0xbc')];}return _0x4c6188[_0xe736('0x32')](_0x5a99f6);}else{return _0x4c6188;}}})[_0xe736('0x33')](function(_0x5b7b0b){_0x44b30e[_0xe736('0xb9')]=_0x5b7b0b[_0xe736('0x5c')]({'plain':!![]});_0x44b30e['interaction']['created']=_0x3bb834;if(_0x44b30e[_0xe736('0xb9')][_0xe736('0xbd')]){if(_0x44b30e[_0xe736('0xa0')][_0xe736('0xbe')]){_0x44b30e['applications'][_0xe736('0xbf')]({'id':0x0,'priority':_0x44b30e[_0xe736('0xa2')][_0xe736('0x44')]+0x1,'app':_0xe736('0xc0'),'appdata':_0xe736('0xc1'),'interval':_0xe736('0xc2')});}}return db[_0xe736('0xc3')][_0xe736('0x59')]({'body':_0x5cd14b[_0xe736('0x5a')][_0xe736('0x5a')],'ChatWebsiteId':_0x5cd14b[_0xe736('0x68')]['id'],'ChatInteractionId':_0x5b7b0b['id'],'direction':'in','ContactId':_0x44b30e[_0xe736('0xa7')]['id'],'AttachmentId':_0x5cd14b[_0xe736('0x5a')][_0xe736('0xc4')]});})[_0xe736('0x33')](function(_0x5a112b){_0x44b30e[_0xe736('0x26')]=_0x5a112b;if(_0x44b30e[_0xe736('0xb9')][_0xe736('0xc5')]){return db[_0xe736('0xc6')][_0xe736('0x58')]({'attributes':['id',_0xe736('0x36')],'where':{'id':_0x44b30e[_0xe736('0xb9')][_0xe736('0xc5')]}})['then'](function(_0x5cf497){if(_0x5cf497){_0x44b30e[_0xe736('0xa2')][_0xe736('0xc7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5cf497['name']+','+(_0x44b30e['account'][_0xe736('0xc8')]||0xa),'interval':_0xe736('0xc2')});_0x44b30e['forcedOwnership']=!![];}return respondWithRpcPromise('Start','startRouting',_0x44b30e);});}return respondWithRpcPromise('Start','startRouting',_0x44b30e);})[_0xe736('0x33')](function(_0x5cad26){respondWithRpcPromise(_0xe736('0xc9'),_0xe736('0xc9'),{'event':_0xe736('0x87'),'message':_0x5cad26},client9002);return _0x5cad26;})[_0xe736('0x33')](respondWithResult(_0x45b50f,null))[_0xe736('0x28')](handleError(_0x45b50f,null));};exports['offline']=function(_0x4533d9,_0x63df56,_0xf16b72){var _0x451b21,_0x20aecb,_0x6815f4;var _0x2a88bf=[];var _0x45236b=[];var _0x41e813={};return db[_0xe736('0x9b')][_0xe736('0x63')]()['then'](function(_0x18c719){if(!_0x18c719){throw new db[(_0xe736('0x8e'))]['ValidationError'](_0xe736('0x8f'));}_0x45236b=_[_0xe736('0x90')](_['keys'](_0x18c719),[_0xe736('0x91'),'updatedAt']);_0x2a88bf=_['difference'](_[_0xe736('0x3d')](_0x18c719),[_0xe736('0x91'),_0xe736('0x92'),_0xe736('0x93'),'ListId']);if(_0x4533d9[_0xe736('0x5a')]['id']){delete _0x4533d9[_0xe736('0x5a')]['id'];}if(_[_0xe736('0x7a')](_0x4533d9[_0xe736('0x5a')][_0xe736('0xa6')])){throw _0x63df56[_0xe736('0x2a')](0x1f4)[_0xe736('0x37')](new db[(_0xe736('0x8e'))][(_0xe736('0x95'))]('from\x20is\x20mandatory'));}if(_[_0xe736('0x7a')](_0x4533d9[_0xe736('0x5a')]['body'])||_0x4533d9[_0xe736('0x5a')][_0xe736('0x5a')]===''){throw _0x63df56[_0xe736('0x2a')](0x1f4)[_0xe736('0x37')](new db['Sequelize'][(_0xe736('0x95'))](_0xe736('0x97')));}if(_[_0xe736('0x7a')](_0x4533d9['body'][_0xe736('0xca')])){throw _0x63df56[_0xe736('0x2a')](0x1f4)[_0xe736('0x37')](new db[(_0xe736('0x8e'))][(_0xe736('0x95'))](_0xe736('0xcb')+_0x2a88bf));}if(!_['includes'](_0x2a88bf,_0x4533d9['body'][_0xe736('0xca')])){throw _0x63df56[_0xe736('0x2a')](0x1f4)[_0xe736('0x37')](new db['Sequelize']['ValidationError'](_0xe736('0xcc')+_0x2a88bf));}_0x41e813[_0x4533d9['body'][_0xe736('0xca')]]=_0x4533d9[_0xe736('0x5a')][_0xe736('0xa6')];})['then'](function(){return db[_0xe736('0x3b')][_0xe736('0x58')]({'where':{'id':_0x4533d9[_0xe736('0x68')]['id']},'include':[{'model':db['CmList'],'as':_0xe736('0x9f')}]});})[_0xe736('0x33')](handleEntityNotFound(_0x63df56,null))['then'](function(_0x4ef7d2){if(_0x4ef7d2&&_0x4ef7d2[_0xe736('0x9f')]){_0x20aecb=_0x4ef7d2;var _0x5136c0=_['defaults'](_0x4533d9[_0xe736('0x5a')],{'firstName':_0x4533d9[_0xe736('0x5a')][_0xe736('0xa6')],'phone':_0x4533d9['body'][_0xe736('0xa6')],'ListId':_0x4ef7d2[_0xe736('0x94')]});_0x5136c0[_0x4533d9[_0xe736('0x5a')][_0xe736('0xca')]]=_0x4533d9[_0xe736('0x5a')][_0xe736('0xa6')];return db[_0xe736('0x9b')]['findOrCreate']({'where':_0x41e813,'defaults':_0x5136c0});}})[_0xe736('0xbb')](function(_0x658fef){if(_0x658fef){_0x6815f4=_0x658fef;var _0x462554=fs[_0xe736('0xcd')](path[_0xe736('0x7c')](config['root'],_0xe736('0xce')),_0xe736('0xcf'));var _0xc89627=ejs[_0xe736('0xd0')](_0x462554,{'body':_[_0xe736('0xd1')](_0x4533d9[_0xe736('0x5a')][_0xe736('0x5a')]),'bodyTitle':_0x20aecb[_0xe736('0xd2')]});return db['ChatOfflineMessage'][_0xe736('0x59')]({'body':_0xc89627,'ContactId':_0x658fef['id'],'ChatWebsiteId':_0x20aecb['id']});}})[_0xe736('0x33')](function(_0x59dc51){if(_0x59dc51){_0x451b21=_0x59dc51;return db[_0xe736('0xd3')][_0xe736('0x6b')]({'where':{'service':!![]},'include':[{'model':db[_0xe736('0xd4')],'as':_0xe736('0xd5'),'raw':!![]}]});}})[_0xe736('0x33')](function(_0x3e5629){if(_0x3e5629&&_0x3e5629['Smtp']&&_0x20aecb[_0xe736('0xd6')]){var _0x78c165={'tls':{'rejectUnauthorized':![]}};if(_0x3e5629[_0xe736('0xd5')][_0xe736('0xd7')]){_0x78c165[_0xe736('0xd7')]=_0x3e5629[_0xe736('0xd5')]['service'];}else{_0x78c165[_0xe736('0xd8')]=_0x3e5629[_0xe736('0xd5')][_0xe736('0xd8')];_0x78c165[_0xe736('0xd9')]=_0x3e5629[_0xe736('0xd5')][_0xe736('0xd9')];_0x78c165[_0xe736('0xda')]=_0x3e5629['Smtp'][_0xe736('0xda')];}if(_0x3e5629[_0xe736('0xd5')]['authentication']){_0x78c165[_0xe736('0xdb')]={'user':_0x3e5629[_0xe736('0xd5')]['user'],'pass':_0x3e5629['Smtp']['pass']};}return respondWithRpcPromise(_0xe736('0xdc'),_0xe736('0xdd'),{'account':_0x78c165,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x3e5629[_0xe736('0x36')],_0x3e5629[_0xe736('0xde')]||_0x3e5629[_0xe736('0xd5')][_0xe736('0x5b')]),'to':_0x20aecb[_0xe736('0xd6')],'subject':_0x20aecb[_0xe736('0xdf')],'text':_0x451b21[_0xe736('0x5a')]}},client9003)[_0xe736('0x33')](function(){return _0x451b21;})['catch'](function(_0x21d237){console[_0xe736('0x24')](_0x21d237);});}})[_0xe736('0x33')](function(){if(_0x451b21){return _0x451b21;}})['then'](respondWithResult(_0x63df56,null))[_0xe736('0x28')](handleError(_0x63df56,null));};exports[_0xe736('0xe0')]=function(_0x1f2221,_0x485f83,_0x26e2d3){return db[_0xe736('0xba')][_0xe736('0x58')]({'where':{'id':_0x1f2221[_0xe736('0x68')]['id']}})['then'](handleEntityNotFound(_0x485f83,null))[_0xe736('0x33')](function(_0xb0e300){if(_0xb0e300){return _0xb0e300[_0xe736('0xe0')](_0x1f2221[_0xe736('0x5a')][_0xe736('0x6e')],_['omit'](_0x1f2221[_0xe736('0x5a')],[_0xe736('0x6e'),'id'])||{});}})[_0xe736('0x33')](respondWithResult(_0x485f83,null))['catch'](handleError(_0x485f83,null));};exports['getInteractions']=function(_0x15dae8,_0xdffe3e,_0x4fd8ef){var _0x4bf1fb={'raw':![],'where':{}};var _0x2ca24a={};var _0x576e62={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe736('0x6b')]({'where':{'id':_0x15dae8[_0xe736('0x68')]['id']}})[_0xe736('0x33')](handleEntityNotFound(_0xdffe3e,null))[_0xe736('0x33')](function(_0x40a3a0){if(_0x40a3a0){_0x2ca24a[_0xe736('0x41')]=_[_0xe736('0x3d')](db[_0xe736('0xba')][_0xe736('0x3c')]);_0x2ca24a[_0xe736('0x3e')]=_[_0xe736('0x3d')](_0x15dae8[_0xe736('0x3e')]);_0x2ca24a[_0xe736('0x3f')]=_[_0xe736('0x40')](_0x2ca24a[_0xe736('0x41')],_0x2ca24a['query']);_0x4bf1fb['attributes']=_['intersection'](_0x2ca24a[_0xe736('0x41')],qs[_0xe736('0x43')](_0x15dae8[_0xe736('0x3e')][_0xe736('0x43')]));_0x4bf1fb['attributes']=_0x4bf1fb['attributes'][_0xe736('0x44')]?_0x4bf1fb[_0xe736('0x42')]:_0x2ca24a[_0xe736('0x41')];if(!_0x15dae8['query']['hasOwnProperty'](_0xe736('0x46'))){_0x4bf1fb[_0xe736('0x47')]=qs[_0xe736('0x47')](_0x15dae8[_0xe736('0x3e')]['limit']);_0x4bf1fb[_0xe736('0x2d')]=qs['offset'](_0x15dae8[_0xe736('0x3e')][_0xe736('0x2d')]);}_0x4bf1fb[_0xe736('0x48')]=qs[_0xe736('0x49')](_0x15dae8['query']['sort']);_0x4bf1fb['where']=qs[_0xe736('0x3f')](_['pick'](_0x15dae8['query'],_0x2ca24a[_0xe736('0x3f')]));_0x4bf1fb[_0xe736('0x4a')]['ChatWebsiteId']=_0x40a3a0['id'];if(_0x15dae8[_0xe736('0x3e')][_0xe736('0x4c')]){_0x4bf1fb['where']=_[_0xe736('0x4d')](_0x4bf1fb['where'],{'$or':_['map'](_0x4bf1fb[_0xe736('0x42')],function(_0x2501c5){var _0x1e15ca={};_0x1e15ca[_0x2501c5]={'$like':'%'+_0x15dae8[_0xe736('0x3e')][_0xe736('0x4c')]+'%'};return _0x1e15ca;})});}_0x4bf1fb=_['merge']({},_0x4bf1fb,_0x15dae8[_0xe736('0x52')]);return db[_0xe736('0xba')]['count']({'where':_0x4bf1fb[_0xe736('0x4a')]})['then'](function(_0x3b1e3a){_0x576e62[_0xe736('0x2c')]=_0x3b1e3a;if(_0x15dae8[_0xe736('0x3e')][_0xe736('0x53')]){_0x4bf1fb['include']=[{'model':db[_0xe736('0x9b')],'as':'Contact','required':![]},{'model':db[_0xe736('0xc6')],'as':_0xe736('0xe1'),'attributes':[_0xe736('0x36'),_0xe736('0xe2'),_0xe736('0xe3')],'required':![]},{'model':db[_0xe736('0xe4')],'as':_0xe736('0xe5'),'attributes':['id','name',_0xe736('0xe6')],'where':_0x15dae8[_0xe736('0x3e')][_0xe736('0xe7')]?{'id':_0x15dae8[_0xe736('0x3e')][_0xe736('0xe7')]}:undefined,'required':_0x15dae8[_0xe736('0x3e')][_0xe736('0xe7')]?!![]:![]}];}return db[_0xe736('0xba')][_0xe736('0x55')](_0x4bf1fb);})['then'](function(_0x453e31){_0x576e62['rows']=_0x453e31;return _0x576e62;});}})[_0xe736('0x33')](respondWithFilteredResult(_0xdffe3e,_0x4bf1fb))[_0xe736('0x28')](handleError(_0xdffe3e,null));};function iftimePromise(_0x3651ec,_0x219a51){return respondWithRpcPromise(_0xe736('0xe8'),_0xe736('0xe9'),{'command':_0x219a51[_0xe736('0xea')]?util[_0xe736('0xae')]('iftime\x20%s,%s',_0x3651ec[_0xe736('0xeb')],_0x219a51['timezone']):util[_0xe736('0xae')]('iftime\x20%s',_0x3651ec[_0xe736('0xeb')])},client9002)[_0xe736('0x33')](function(_0x2bd561){var _0x10d947=_0x2bd561&&_0x2bd561['indexOf'](_0xe736('0xec'))>=0x0?!![]:![];logger['info'](_0xe736('0xed'),_0x219a51['id'],_0x3651ec['id'],_0x3651ec[_0xe736('0xeb')],_0x10d947?_0xe736('0xee'):_0xe736('0xef'),_0x219a51[_0xe736('0xea')]?_0x219a51['timezone']:_0xe736('0xf0'));return _0x10d947;})[_0xe736('0x28')](function(_0x4ed749){logger[_0xe736('0x24')](_0xe736('0xed'),_0x219a51['id'],_0x3651ec['id'],_0x3651ec['interval'],util[_0xe736('0xf1')](_0x4ed749,{'showHidden':![],'depth':null}),_0x219a51['timezone']?_0x219a51[_0xe736('0xea')]:_0xe736('0xf0'));return![];});}exports['getSnippet']=function(_0x827452,_0x518cee,_0x2aa9a0){var _0x1ce0fe=0x0;var _0x53cf7b=0x0;var _0x53e7e0=![];var _0x2c5ab4;var _0x1999aa;return db[_0xe736('0x3b')][_0xe736('0x58')]({'where':{'id':_0x827452[_0xe736('0x68')]['id']},'include':[{'model':db[_0xe736('0xf2')],'as':_0xe736('0xf2'),'include':[{'model':db[_0xe736('0xf2')],'as':_0xe736('0xf3'),'attributes':['id',_0xe736('0xeb')],'raw':!![]}]}]})[_0xe736('0x33')](handleEntityNotFound(_0x518cee,null))[_0xe736('0x33')](function(_0x1c023d){if(_0x1c023d){_0x2c5ab4=_0x1c023d;return _0x1c023d[_0xe736('0xf4')]({'raw':!![]});}})[_0xe736('0x33')](function(_0x36efe6){if(_0x2c5ab4){if(_0x36efe6){_0x1999aa=_0x36efe6;}}return require(_0xe736('0xf5'))[_0xe736('0x79')]();})[_0xe736('0x33')](function(_0x371c9e){if(_0x371c9e){_0x53cf7b=_0x371c9e[_0xe736('0xf6')];_0x53e7e0=_0x371c9e['custom'];}})[_0xe736('0x33')](function(){return db[_0xe736('0xba')][_0xe736('0x2c')]({'where':{'closed':![]}});})[_0xe736('0x33')](function(_0x512b4d){_0x1ce0fe=_0x512b4d;if(_0x53cf7b&&_0x512b4d>_0x53cf7b){return db[_0xe736('0xf7')][_0xe736('0x6b')]({'where':{'id':0x1}})['then'](function(_0x586c20){if(_0x586c20){_0x586c20[_0xe736('0xf8')](_0xe736('0xf9'));}});}})[_0xe736('0x33')](function(){if(_0x2c5ab4[_0xe736('0xf2')]&&_0x2c5ab4[_0xe736('0xf2')][_0xe736('0xf3')]){var _0x49979c=[];for(var _0x41cedb=0x0;_0x41cedb<_0x2c5ab4[_0xe736('0xf2')][_0xe736('0xf3')][_0xe736('0x44')];_0x41cedb++){var _0x48acbb=_0x2c5ab4[_0xe736('0xf2')][_0xe736('0xf3')][_0x41cedb][_0xe736('0x5c')]({'plain':!![]});_0x49979c['push'](iftimePromise(_0x48acbb,_0x2c5ab4));}return BPromise['all'](_0x49979c)['then'](function(_0x4542d5){return _[_0xe736('0xfa')](_0x4542d5);});}else{return!![];}})['then'](function(_0x538230){var _0x392238=fs['readFileSync'](path[_0xe736('0x7c')](config['root'],_0xe736('0xfb')),_0xe736('0xcf'));var _0x2198ec={'remote':_0x2c5ab4[_0xe736('0xfc')],'query':querystring['stringify'](_[_0xe736('0x4d')](_0x2c5ab4[_0xe736('0x5c')]({'plain':!![]}),{'customerIp':_0x827452[_0xe736('0x8a')][_0xe736('0xfd')]||_0x827452[_0xe736('0x8a')]['x-real-ip']||_0x827452[_0xe736('0xfe')][_0xe736('0xff')]||_0x827452['ip'],'referer':_0x827452[_0xe736('0x8a')][_0xe736('0xab')],'openedInteractions':_0x1ce0fe,'maxInteractions':_0x53cf7b,'virtual':_0x53e7e0['virtual'],'online':_0x538230,'custom':_0x53e7e0}))[_0xe736('0x100')](/'/g,'\x5c\x27')};_0x518cee[_0xe736('0x37')](ejs['render'](Mustache[_0xe736('0xd0')](_0x392238,_0x2198ec),{'proactiveActions':_0x1999aa,'alignment':_0x2c5ab4[_0xe736('0x101')],'verticalAlignment':_0x2c5ab4[_0xe736('0x102')]}));})[_0xe736('0x28')](handleError(_0x518cee,null));};exports['addApplications']=function(_0x22fe23,_0x48b8e4,_0x3797d4){return db[_0xe736('0x3b')][_0xe736('0x6b')]({'where':{'id':_0x22fe23[_0xe736('0x68')]['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x48b8e4,null))[_0xe736('0x33')](function(_0x5e28b1){if(_0x5e28b1){return db[_0xe736('0x103')]['transaction'](function(_0x3e3de3){return db['ChatApplication'][_0xe736('0x34')]({'where':{'ChatWebsiteId':_0x22fe23[_0xe736('0x68')]['id']},'transaction':_0x3e3de3})[_0xe736('0x33')](function(_0x550454){var _0x241cea=_['map'](_0x22fe23[_0xe736('0x5a')],function(_0x384353){_0x384353[_0xe736('0x65')]=_0x22fe23['params']['id'];return _0x384353;});return db[_0xe736('0x104')][_0xe736('0x105')](_0x241cea,{'transaction':_0x3e3de3});});})['then'](function(){return db[_0xe736('0x104')][_0xe736('0x106')]({'where':{'ChatWebsiteId':_0x22fe23['params']['id']},'order':_0xe736('0xa4')});});}})[_0xe736('0x33')](respondWithResult(_0x48b8e4,null))['catch'](handleError(_0x48b8e4,null));};exports[_0xe736('0x107')]=function(_0x1e4d4e,_0x2ef869,_0x319c0b){var _0x49ccec={};var _0x208b5e={};var _0x46894a;var _0x16c5f8;return db['ChatWebsite'][_0xe736('0x6b')]({'where':{'id':_0x1e4d4e[_0xe736('0x68')]['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x2ef869,null))[_0xe736('0x33')](function(_0x4dc899){if(_0x4dc899){_0x46894a=_0x4dc899;_0x208b5e['model']=_[_0xe736('0x3d')](db[_0xe736('0x104')][_0xe736('0x3c')]);_0x208b5e[_0xe736('0x3e')]=_[_0xe736('0x3d')](_0x1e4d4e[_0xe736('0x3e')]);_0x208b5e[_0xe736('0x3f')]=_[_0xe736('0x40')](_0x208b5e[_0xe736('0x41')],_0x208b5e['query']);_0x49ccec['attributes']=_[_0xe736('0x40')](_0x208b5e['model'],qs[_0xe736('0x43')](_0x1e4d4e[_0xe736('0x3e')][_0xe736('0x43')]));_0x49ccec[_0xe736('0x42')]=_0x49ccec[_0xe736('0x42')][_0xe736('0x44')]?_0x49ccec['attributes']:_0x208b5e['model'];_0x49ccec['order']=qs[_0xe736('0x49')](_0x1e4d4e['query'][_0xe736('0x49')]);_0x49ccec[_0xe736('0x4a')]=qs[_0xe736('0x3f')](_[_0xe736('0x4b')](_0x1e4d4e[_0xe736('0x3e')],_0x208b5e[_0xe736('0x3f')]));if(_0x1e4d4e[_0xe736('0x3e')][_0xe736('0x4c')]){_0x49ccec[_0xe736('0x4a')]=_['merge'](_0x49ccec[_0xe736('0x4a')],{'$or':_[_0xe736('0x4e')](_0x49ccec[_0xe736('0x42')],function(_0x2082ad){var _0xaf48e9={};_0xaf48e9[_0x2082ad]={'$like':'%'+_0x1e4d4e[_0xe736('0x3e')][_0xe736('0x4c')]+'%'};return _0xaf48e9;})});}_0x49ccec=_[_0xe736('0x4d')]({},_0x49ccec,_0x1e4d4e[_0xe736('0x52')]);return _0x46894a['getApplications'](_0x49ccec);}})[_0xe736('0x33')](function(_0x58fc40){if(_0x58fc40){_0x16c5f8=_0x58fc40[_0xe736('0x44')];if(!_0x1e4d4e[_0xe736('0x3e')][_0xe736('0x45')]('nolimit')){_0x49ccec['limit']=qs[_0xe736('0x47')](_0x1e4d4e['query'][_0xe736('0x47')]);_0x49ccec['offset']=qs[_0xe736('0x2d')](_0x1e4d4e[_0xe736('0x3e')]['offset']);}return _0x46894a[_0xe736('0x107')](_0x49ccec);}})[_0xe736('0x33')](function(_0x39db4f){if(_0x39db4f){return _0x39db4f?{'count':_0x16c5f8,'rows':_0x39db4f}:null;}})[_0xe736('0x33')](respondWithResult(_0x2ef869,null))['catch'](handleError(_0x2ef869,null));};exports['addProactiveActions']=function(_0x231561,_0x5757df,_0x4fc03f){return db['chatProactiveAction'][_0xe736('0x58')]({'where':{'id':_0x231561[_0xe736('0x68')]['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x5757df,null))['then'](function(_0x1e48f0){if(_0x1e48f0){return _0x1e48f0['addProactiveActions'](_0x231561[_0xe736('0x5a')]['ids'],_[_0xe736('0x108')](_0x231561[_0xe736('0x5a')],[_0xe736('0x6e'),'id'])||{});}})[_0xe736('0x33')](respondWithResult(_0x5757df,null))[_0xe736('0x28')](handleError(_0x5757df,null));};exports[_0xe736('0xf4')]=function(_0x3066a2,_0x306706,_0x1e1d63){var _0x12b28b={};var _0x4f8b67={};var _0x5937cd;var _0x3b63e4;return db['ChatWebsite'][_0xe736('0x6b')]({'where':{'id':_0x3066a2['params']['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x306706,null))[_0xe736('0x33')](function(_0x5cd1dc){if(_0x5cd1dc){_0x5937cd=_0x5cd1dc;_0x4f8b67[_0xe736('0x41')]=_[_0xe736('0x3d')](db[_0xe736('0x109')]['rawAttributes']);_0x4f8b67[_0xe736('0x3e')]=_[_0xe736('0x3d')](_0x3066a2[_0xe736('0x3e')]);_0x4f8b67[_0xe736('0x3f')]=_[_0xe736('0x40')](_0x4f8b67[_0xe736('0x41')],_0x4f8b67[_0xe736('0x3e')]);_0x12b28b[_0xe736('0x42')]=_[_0xe736('0x40')](_0x4f8b67[_0xe736('0x41')],qs[_0xe736('0x43')](_0x3066a2[_0xe736('0x3e')]['fields']));_0x12b28b['attributes']=_0x12b28b[_0xe736('0x42')][_0xe736('0x44')]?_0x12b28b[_0xe736('0x42')]:_0x4f8b67['model'];_0x12b28b[_0xe736('0x48')]=qs[_0xe736('0x49')](_0x3066a2['query']['sort']);_0x12b28b[_0xe736('0x4a')]=qs[_0xe736('0x3f')](_[_0xe736('0x4b')](_0x3066a2[_0xe736('0x3e')],_0x4f8b67[_0xe736('0x3f')]));if(_0x3066a2[_0xe736('0x3e')]['filter']){_0x12b28b[_0xe736('0x4a')]=_[_0xe736('0x4d')](_0x12b28b[_0xe736('0x4a')],{'$or':_[_0xe736('0x4e')](_0x12b28b[_0xe736('0x42')],function(_0x13b5b4){var _0x289955={};_0x289955[_0x13b5b4]={'$like':'%'+_0x3066a2[_0xe736('0x3e')]['filter']+'%'};return _0x289955;})});}_0x12b28b=_[_0xe736('0x4d')]({},_0x12b28b,_0x3066a2[_0xe736('0x52')]);return _0x5937cd[_0xe736('0xf4')](_0x12b28b);}})[_0xe736('0x33')](function(_0x4275dd){if(_0x4275dd){_0x3b63e4=_0x4275dd[_0xe736('0x44')];if(!_0x3066a2[_0xe736('0x3e')]['hasOwnProperty'](_0xe736('0x46'))){_0x12b28b['limit']=qs[_0xe736('0x47')](_0x3066a2[_0xe736('0x3e')]['limit']);_0x12b28b['offset']=qs[_0xe736('0x2d')](_0x3066a2['query'][_0xe736('0x2d')]);}return _0x5937cd['getProactiveActions'](_0x12b28b);}})['then'](function(_0x47d90d){if(_0x47d90d){return _0x47d90d?{'count':_0x3b63e4,'rows':_0x47d90d}:null;}})[_0xe736('0x33')](respondWithResult(_0x306706,null))[_0xe736('0x28')](handleError(_0x306706,null));};exports[_0xe736('0x10a')]=function(_0x28fdbe,_0x4fabbf,_0x2ffa93){var _0x27bbed=_0x28fdbe[_0xe736('0x3e')][_0xe736('0x10b')]===_0xe736('0x10c')?_0xe736('0x10d'):_0xe736('0x10e');return db[_0xe736('0x3b')]['find']({'attributes':['id',_0x27bbed],'where':{'id':_0x28fdbe['params']['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x4fabbf,null))[_0xe736('0x33')](function(_0x34da89){if(_0x34da89){var _0x435d80=_0x34da89[_0x27bbed];var _0x23b6ed=_0x435d80&&_0x435d80['items']?_0x435d80[_0xe736('0x10f')]:[];_0x4fabbf[_0xe736('0x37')]({'fromKey':_['isNil'](_0x435d80['fromKey'])?undefined:_0x435d80[_0xe736('0x110')],'count':_0x23b6ed[_0xe736('0x44')],'rows':_0x23b6ed});}})['catch'](handleError(_0x4fabbf,null));};exports[_0xe736('0x111')]=function(_0x1c49f4,_0x39fd52,_0xc3c7e4){var _0x5f14f2={'raw':!![],'where':{}};var _0x582100={};var _0x2f8a06={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe736('0x6b')]({'where':{'id':_0x1c49f4[_0xe736('0x68')]['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x39fd52,null))[_0xe736('0x33')](function(_0x4be718){if(_0x4be718){_0x582100[_0xe736('0x41')]=_['keys'](db[_0xe736('0x112')][_0xe736('0x3c')]);_0x582100[_0xe736('0x3e')]=_[_0xe736('0x3d')](_0x1c49f4['query']);_0x582100[_0xe736('0x3f')]=_[_0xe736('0x40')](_0x582100[_0xe736('0x41')],_0x582100[_0xe736('0x3e')]);_0x5f14f2[_0xe736('0x42')]=_[_0xe736('0x40')](_0x582100[_0xe736('0x41')],qs['fields'](_0x1c49f4[_0xe736('0x3e')][_0xe736('0x43')]));_0x5f14f2[_0xe736('0x42')]=_0x5f14f2[_0xe736('0x42')][_0xe736('0x44')]?_0x5f14f2[_0xe736('0x42')]:_0x582100[_0xe736('0x41')];if(!_0x1c49f4[_0xe736('0x3e')][_0xe736('0x45')](_0xe736('0x46'))){_0x5f14f2[_0xe736('0x47')]=qs[_0xe736('0x47')](_0x1c49f4['query'][_0xe736('0x47')]);_0x5f14f2[_0xe736('0x2d')]=qs[_0xe736('0x2d')](_0x1c49f4[_0xe736('0x3e')][_0xe736('0x2d')]);}_0x5f14f2[_0xe736('0x48')]=qs['sort'](_0x1c49f4['query'][_0xe736('0x49')]);_0x5f14f2[_0xe736('0x4a')]=qs[_0xe736('0x3f')](_[_0xe736('0x4b')](_0x1c49f4[_0xe736('0x3e')],_0x582100['filters']));_0x5f14f2[_0xe736('0x4a')][_0xe736('0x65')]=_0x4be718['id'];if(_0x1c49f4[_0xe736('0x3e')][_0xe736('0x4c')]){_0x5f14f2[_0xe736('0x4a')]=_[_0xe736('0x4d')](_0x5f14f2[_0xe736('0x4a')],{'$or':_[_0xe736('0x4e')](_0x5f14f2['attributes'],function(_0x39dc2d){var _0x5bea51={};_0x5bea51[_0x39dc2d]={'$like':'%'+_0x1c49f4[_0xe736('0x3e')][_0xe736('0x4c')]+'%'};return _0x5bea51;})});}_0x5f14f2=_[_0xe736('0x4d')]({},_0x5f14f2,_0x1c49f4[_0xe736('0x52')]);return db[_0xe736('0x112')][_0xe736('0x2c')]({'where':_0x5f14f2[_0xe736('0x4a')]})['then'](function(_0x24b2c4){_0x2f8a06[_0xe736('0x2c')]=_0x24b2c4;if(_0x1c49f4[_0xe736('0x3e')][_0xe736('0x53')]){_0x5f14f2['include']=[{'all':!![]}];}return db[_0xe736('0x112')][_0xe736('0x55')](_0x5f14f2);})[_0xe736('0x33')](function(_0x2aca03){_0x2f8a06['rows']=_0x2aca03;return _0x2f8a06;});}})[_0xe736('0x33')](respondWithFilteredResult(_0x39fd52,_0x5f14f2))[_0xe736('0x28')](handleError(_0x39fd52,null));};exports[_0xe736('0x113')]=function(_0x301e73,_0x162ebb,_0x974227){return db[_0xe736('0x3b')]['find']({'where':{'id':_0x301e73[_0xe736('0x68')]['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x162ebb,null))['then'](function(_0x5623f){if(_0x5623f){return _0x5623f['addAgents'](_0x301e73[_0xe736('0x5a')]['ids'],_[_0xe736('0x108')](_0x301e73['body'],[_0xe736('0x6e'),'id'])||{})[_0xe736('0xbb')](function(_0x250c5b){for(var _0x49ef78=0x0;_0x49ef78<_0x301e73[_0xe736('0x5a')]['ids'][_0xe736('0x44')];_0x49ef78+=0x1){socket[_0xe736('0x114')](_0xe736('0x115'),{'UserId':_0x301e73[_0xe736('0x5a')][_0xe736('0x6e')][_0x49ef78],'ChatWebsiteId':_0x301e73[_0xe736('0x68')]['id']});}return _0x250c5b;});}})['then'](respondWithResult(_0x162ebb,null))['catch'](handleError(_0x162ebb,null));};exports['removeAgents']=function(_0x1ff2f0,_0x3ff1b9,_0x29e746){var _0x311333;return db[_0xe736('0x3b')][_0xe736('0x58')]({'where':{'id':_0x1ff2f0[_0xe736('0x68')]['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x3ff1b9,null))['then'](function(_0x2b0dee){if(_0x2b0dee){return _0x2b0dee[_0xe736('0x116')](_0x1ff2f0[_0xe736('0x3e')][_0xe736('0x6e')])[_0xe736('0x33')](function(_0x51cf09){if(_[_0xe736('0x117')](_0x1ff2f0[_0xe736('0x3e')][_0xe736('0x6e')])){for(var _0x2b7df1=0x0;_0x2b7df1<_0x1ff2f0['query'][_0xe736('0x6e')][_0xe736('0x44')];_0x2b7df1+=0x1){socket['emit'](_0xe736('0x118'),{'UserId':_0x1ff2f0['query'][_0xe736('0x6e')][_0x2b7df1],'ChatWebsiteId':_0x1ff2f0['params']['id']});}}else{socket[_0xe736('0x114')](_0xe736('0x118'),{'UserId':_0x1ff2f0[_0xe736('0x3e')][_0xe736('0x6e')],'ChatWebsiteId':_0x1ff2f0[_0xe736('0x68')]['id']});}});}})[_0xe736('0x33')](respondWithStatusCode(_0x3ff1b9,null))[_0xe736('0x28')](handleError(_0x3ff1b9,null));};exports[_0xe736('0x119')]=function(_0x27098e,_0x254dd0,_0x39ba8b){var _0xb8979b={};var _0xc2253f={};var _0x5cb752;var _0x419bdf;return db['ChatWebsite'][_0xe736('0x6b')]({'where':{'id':_0x27098e[_0xe736('0x68')]['id']}})[_0xe736('0x33')](handleEntityNotFound(_0x254dd0,null))[_0xe736('0x33')](function(_0x3972cf){if(_0x3972cf){_0x5cb752=_0x3972cf;_0xc2253f[_0xe736('0x41')]=_[_0xe736('0x3d')](db[_0xe736('0xc6')][_0xe736('0x3c')]);_0xc2253f[_0xe736('0x3e')]=_[_0xe736('0x3d')](_0x27098e['query']);_0xc2253f[_0xe736('0x3f')]=_[_0xe736('0x40')](_0xc2253f[_0xe736('0x41')],_0xc2253f[_0xe736('0x3e')]);_0xb8979b['attributes']=_[_0xe736('0x40')](_0xc2253f[_0xe736('0x41')],qs[_0xe736('0x43')](_0x27098e[_0xe736('0x3e')][_0xe736('0x43')]));_0xb8979b[_0xe736('0x42')]=_0xb8979b[_0xe736('0x42')][_0xe736('0x44')]?_0xb8979b[_0xe736('0x42')]:_0xc2253f[_0xe736('0x41')];_0xb8979b[_0xe736('0x48')]=qs[_0xe736('0x49')](_0x27098e['query']['sort']);_0xb8979b[_0xe736('0x4a')]=qs[_0xe736('0x3f')](_[_0xe736('0x4b')](_0x27098e['query'],_0xc2253f[_0xe736('0x3f')]));if(_0x27098e[_0xe736('0x3e')][_0xe736('0x4c')]){_0xb8979b[_0xe736('0x4a')]=_[_0xe736('0x4d')](_0xb8979b[_0xe736('0x4a')],{'$or':_['map'](_0xb8979b[_0xe736('0x42')],function(_0x5916b3){var _0x55c81b={};_0x55c81b[_0x5916b3]={'$like':'%'+_0x27098e[_0xe736('0x3e')]['filter']+'%'};return _0x55c81b;})});}_0xb8979b=_[_0xe736('0x4d')]({},_0xb8979b,_0x27098e[_0xe736('0x52')]);return _0x5cb752[_0xe736('0x119')](_0xb8979b);}})[_0xe736('0x33')](function(_0x5c5cca){if(_0x5c5cca){_0x419bdf=_0x5c5cca[_0xe736('0x44')];if(!_0x27098e[_0xe736('0x3e')][_0xe736('0x45')](_0xe736('0x46'))){_0xb8979b[_0xe736('0x47')]=qs['limit'](_0x27098e['query']['limit']);_0xb8979b[_0xe736('0x2d')]=qs[_0xe736('0x2d')](_0x27098e[_0xe736('0x3e')][_0xe736('0x2d')]);}return _0x5cb752['getAgents'](_0xb8979b);}})['then'](function(_0x315c49){if(_0x315c49){return _0x315c49?{'count':_0x419bdf,'rows':_0x315c49}:null;}})[_0xe736('0x33')](respondWithResult(_0x254dd0,null))[_0xe736('0x28')](handleError(_0x254dd0,null));}; \ No newline at end of file +var _0x8615=['push','close','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','offline','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','addInteraction','ids','omit','getInteractions','Owner','fullname','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','inspect','No\x20timezone','getSnippet','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.js','utf8','remote','headers','x-forwarded-for','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','addApplications','transaction','ChatApplication','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatWebsite.socket','jayson/promise','http','client','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','name','index','Pause','mandatoryDispositionPause','ChatWebsite','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','include','findAll','rows','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','includeAll','removeDispositions','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','sitepic','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','notify','user-agent-parser','setUA','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','List','account','applications','list','priority','asc','Applications','Contacts','contact','lastName','customerIp','referer','browser','version','unknown','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','firstName','messageId','created','autoclose'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x8615,0x64));var _0x5861=function(_0x1105cd,_0x4799f1){_0x1105cd=_0x1105cd-0x0;var _0x538822=_0x8615[_0x1105cd];return _0x538822;};'use strict';var pdf=require(_0x5861('0x0'));var emlformat=require(_0x5861('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5861('0x2'));var rp=require(_0x5861('0x3'));var moment=require(_0x5861('0x4'));var BPromise=require(_0x5861('0x5'));var Mustache=require(_0x5861('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5861('0x7'));var csv=require('to-csv');var ejs=require(_0x5861('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5861('0x9'));var crypto=require(_0x5861('0xa'));var jsforce=require(_0x5861('0xb'));var deskjs=require(_0x5861('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5861('0xd'));var authService=require(_0x5861('0xe'));var hardwareService=require(_0x5861('0xf'));var Redis=require(_0x5861('0x10'));var qs=require(_0x5861('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5861('0x12'));var config=require(_0x5861('0x13'));var db=require(_0x5861('0x14'))['db'];config['redis']=_[_0x5861('0x15')](config[_0x5861('0x16')],{'host':_0x5861('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5861('0x16')]));require(_0x5861('0x18'))['register'](socket);var jayson=require(_0x5861('0x19'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x5861('0x1a')]({'port':0x232a});var client9003=jayson[_0x5861('0x1b')][_0x5861('0x1a')]({'port':0x232b});function respondWithRpcPromise(_0x44d5ba,_0x5bac53,_0x36fdb1,_0x415443){return new BPromise(function(_0x2e28ae,_0x56dd8e){var _0x5adbac=_0x415443||client;return _0x5adbac[_0x5861('0x1c')](_0x44d5ba,_0x36fdb1)[_0x5861('0x1d')](function(_0x4667cb){logger['info'](_0x5861('0x1e'),_0x5bac53,_0x5861('0x1f'));logger[_0x5861('0x20')](_0x5861('0x21'),_0x5bac53,_0x5861('0x1f'),JSON[_0x5861('0x22')](_0x4667cb));if(_0x4667cb[_0x5861('0x23')]){if(_0x4667cb[_0x5861('0x23')][_0x5861('0x24')]===0x1f4){logger['error'](_0x5861('0x1e'),_0x5bac53,_0x4667cb['error']['message']);return _0x56dd8e(_0x4667cb[_0x5861('0x23')][_0x5861('0x25')]);}logger[_0x5861('0x23')](_0x5861('0x1e'),_0x5bac53,_0x4667cb[_0x5861('0x23')][_0x5861('0x25')]);return _0x2e28ae(_0x4667cb['error'][_0x5861('0x25')]);}else{logger[_0x5861('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x5bac53,_0x5861('0x1f'));_0x2e28ae(_0x4667cb[_0x5861('0x27')][_0x5861('0x25')]);}})[_0x5861('0x28')](function(_0x4ff7ed){logger[_0x5861('0x23')](_0x5861('0x1e'),_0x5bac53,_0x4ff7ed);_0x56dd8e(_0x4ff7ed);});});}function respondWithStatusCode(_0x132898,_0xcba27e){_0xcba27e=_0xcba27e||0xcc;return function(_0x333f00){if(_0x333f00){return _0x132898['sendStatus'](_0xcba27e);}return _0x132898[_0x5861('0x29')](_0xcba27e)[_0x5861('0x2a')]();};}function respondWithResult(_0x65f8db,_0x727f28){_0x727f28=_0x727f28||0xc8;return function(_0x4bbbf9){if(_0x4bbbf9){return _0x65f8db['status'](_0x727f28)[_0x5861('0x2b')](_0x4bbbf9);}};}function respondWithFilteredResult(_0x1c129d,_0x3af601){return function(_0x4d9989){if(_0x4d9989){var _0x375aaa=_0x4d9989['count'],_0xc9c2dd=_0x3af601[_0x5861('0x2c')],_0x1c8c9d=_0x3af601[_0x5861('0x2c')]+_0x3af601[_0x5861('0x2d')],_0xe3c4d;if(_0x1c8c9d>=_0x375aaa){_0x1c8c9d=_0x375aaa;_0xe3c4d=0xc8;}else{_0xe3c4d=0xce;}_0x1c129d['status'](_0xe3c4d);return _0x1c129d['set'](_0x5861('0x2e'),_0xc9c2dd+'-'+_0x1c8c9d+'/'+_0x375aaa)[_0x5861('0x2b')](_0x4d9989);}return null;};}function patchUpdates(_0x298e6b){return function(_0x275f47){try{jsonpatch[_0x5861('0x2f')](_0x275f47,_0x298e6b,!![]);}catch(_0x33b349){return BPromise[_0x5861('0x30')](_0x33b349);}return _0x275f47[_0x5861('0x31')]();};}function saveUpdates(_0xfa8141,_0x2ac7d4){return function(_0x27fafc){if(_0x27fafc){return _0x27fafc[_0x5861('0x32')](_0xfa8141)[_0x5861('0x1d')](function(_0x1486a4){return _0x1486a4;});}return null;};}function removeEntity(_0x145dbb,_0x2f67a9){return function(_0x3030d6){if(_0x3030d6){return _0x3030d6[_0x5861('0x33')]()[_0x5861('0x1d')](function(){var _0x2ae008=_0x3030d6[_0x5861('0x34')]({'plain':!![]});var _0x529a73=_0x5861('0x35');return db[_0x5861('0x36')][_0x5861('0x33')]({'where':{'type':_0x529a73,'resourceId':_0x2ae008['id']}})[_0x5861('0x1d')](function(){return _0x3030d6;});})[_0x5861('0x1d')](function(){_0x145dbb['status'](0xcc)[_0x5861('0x2a')]();});}};}function handleEntityNotFound(_0xa21967,_0x46b44d){return function(_0x416838){if(!_0x416838){_0xa21967[_0x5861('0x37')](0x194);}return _0x416838;};}function handleError(_0x52bfbb,_0x2b33be){_0x2b33be=_0x2b33be||0x1f4;return function(_0x2f4902){logger[_0x5861('0x23')](_0x2f4902['stack']);if(_0x2f4902[_0x5861('0x38')]){delete _0x2f4902[_0x5861('0x38')];}_0x52bfbb[_0x5861('0x29')](_0x2b33be)['send'](_0x2f4902);};}exports[_0x5861('0x39')]=function(_0x4a1aac,_0x55d35c){var _0x20284d={'include':[{'model':db[_0x5861('0x3a')],'as':_0x5861('0x3b')}]},_0x4a39d5={},_0x5c1846={'count':0x0,'rows':[]};var _0x285f9d=db[_0x5861('0x3c')]['rawAttributes'];_0x4a39d5[_0x5861('0x3d')]=_[_0x5861('0x3e')](_0x285f9d);_0x4a39d5[_0x5861('0x3f')]=_[_0x5861('0x3e')](_0x4a1aac[_0x5861('0x3f')]);_0x4a39d5[_0x5861('0x40')]=_[_0x5861('0x41')](_0x4a39d5[_0x5861('0x3d')],_0x4a39d5[_0x5861('0x3f')]);_0x20284d[_0x5861('0x42')]=_['intersection'](_0x4a39d5[_0x5861('0x3d')],qs[_0x5861('0x43')](_0x4a1aac[_0x5861('0x3f')][_0x5861('0x43')]));_0x20284d[_0x5861('0x42')]=_0x20284d['attributes']['length']?_0x20284d[_0x5861('0x42')]:_0x4a39d5[_0x5861('0x3d')];if(!_0x4a1aac[_0x5861('0x3f')][_0x5861('0x44')](_0x5861('0x45'))){_0x20284d[_0x5861('0x2d')]=qs[_0x5861('0x2d')](_0x4a1aac[_0x5861('0x3f')][_0x5861('0x2d')]);_0x20284d['offset']=qs[_0x5861('0x2c')](_0x4a1aac['query']['offset']);}_0x20284d[_0x5861('0x46')]=qs[_0x5861('0x47')](_0x4a1aac[_0x5861('0x3f')][_0x5861('0x47')]);_0x20284d[_0x5861('0x48')]=qs['filters'](_[_0x5861('0x49')](_0x4a1aac[_0x5861('0x3f')],_0x4a39d5[_0x5861('0x40')]));if(_0x4a1aac[_0x5861('0x3f')][_0x5861('0x4a')]){_0x20284d[_0x5861('0x48')]=_[_0x5861('0x4b')](_0x20284d['where'],{'$or':_[_0x5861('0x4c')](_0x285f9d,function(_0x595454){if(_0x595454[_0x5861('0x4d')][_0x5861('0x4e')]!==_0x5861('0x4f')){var _0x338f78={};_0x338f78[_0x595454[_0x5861('0x50')]]={'$like':'%'+_0x4a1aac[_0x5861('0x3f')]['filter']+'%'};return _0x338f78;}})});}_0x20284d=_[_0x5861('0x4b')]({},_0x20284d,_0x4a1aac[_0x5861('0x51')]);var _0xcbde1e={'where':_0x20284d[_0x5861('0x48')]};return db[_0x5861('0x3c')][_0x5861('0x52')](_0xcbde1e)[_0x5861('0x1d')](function(_0x5e85fa){_0x5c1846[_0x5861('0x52')]=_0x5e85fa;if(_0x4a1aac[_0x5861('0x3f')]['includeAll']){_0x20284d[_0x5861('0x53')]=[{'all':!![]}];}return db[_0x5861('0x3c')][_0x5861('0x54')](_0x20284d);})[_0x5861('0x1d')](function(_0x1d9a43){_0x5c1846[_0x5861('0x55')]=_0x1d9a43;return _0x5c1846;})[_0x5861('0x1d')](respondWithFilteredResult(_0x55d35c,_0x20284d))[_0x5861('0x28')](handleError(_0x55d35c,null));};exports[_0x5861('0x56')]=function(_0x4b5a0e,_0x137a8f){var _0x4d01e2={'raw':![],'where':{'id':_0x4b5a0e[_0x5861('0x57')]['id']},'include':[{'model':db[_0x5861('0x3a')],'as':_0x5861('0x3b')}]},_0x39642a={};_0x39642a[_0x5861('0x3d')]=_[_0x5861('0x3e')](db[_0x5861('0x3c')][_0x5861('0x58')]);_0x39642a[_0x5861('0x3f')]=_[_0x5861('0x3e')](_0x4b5a0e[_0x5861('0x3f')]);_0x39642a[_0x5861('0x40')]=_[_0x5861('0x41')](_0x39642a['model'],_0x39642a[_0x5861('0x3f')]);_0x4d01e2[_0x5861('0x42')]=_[_0x5861('0x41')](_0x39642a[_0x5861('0x3d')],qs['fields'](_0x4b5a0e[_0x5861('0x3f')][_0x5861('0x43')]));_0x4d01e2[_0x5861('0x42')]=_0x4d01e2[_0x5861('0x42')][_0x5861('0x59')]?_0x4d01e2['attributes']:_0x39642a[_0x5861('0x3d')];if(_0x4b5a0e[_0x5861('0x3f')]['includeAll']){_0x4d01e2[_0x5861('0x53')]=[{'all':!![]}];}_0x4d01e2=_[_0x5861('0x4b')]({},_0x4d01e2,_0x4b5a0e[_0x5861('0x51')]);return db[_0x5861('0x3c')][_0x5861('0x5a')](_0x4d01e2)[_0x5861('0x1d')](handleEntityNotFound(_0x137a8f,null))['then'](respondWithResult(_0x137a8f,null))['catch'](handleError(_0x137a8f,null));};exports[_0x5861('0x5b')]=function(_0x4cf5aa,_0x10f149){return db[_0x5861('0x3c')][_0x5861('0x5b')](_0x4cf5aa[_0x5861('0x5c')],{})[_0x5861('0x1d')](function(_0x4bf1e6){var _0x3622cb=_0x4cf5aa[_0x5861('0x5d')][_0x5861('0x34')]({'plain':!![]});if(!_0x3622cb)throw new Error(_0x5861('0x5e'));if(_0x3622cb[_0x5861('0x5f')]==='user'){var _0x16ffc1=_0x4bf1e6[_0x5861('0x34')]({'plain':!![]});var _0x25dc2b=_0x5861('0x35');return db['UserProfileSection'][_0x5861('0x5a')]({'where':{'name':_0x25dc2b,'userProfileId':_0x3622cb['userProfileId']},'raw':!![]})[_0x5861('0x1d')](function(_0x3d2e3c){if(_0x3d2e3c&&_0x3d2e3c['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x16ffc1['name'],'resourceId':_0x16ffc1['id'],'type':_0x3d2e3c[_0x5861('0x38')],'sectionId':_0x3d2e3c['id']},{})[_0x5861('0x1d')](function(){return _0x4bf1e6;});}else{return _0x4bf1e6;}})[_0x5861('0x28')](function(_0x4ed815){logger[_0x5861('0x23')](_0x5861('0x60'),_0x4ed815);throw _0x4ed815;});}return _0x4bf1e6;})['then'](respondWithResult(_0x10f149,0xc9))['catch'](handleError(_0x10f149,null));};exports[_0x5861('0x32')]=function(_0x40b01a,_0xe4dee7){if(_0x40b01a['body']['id']){delete _0x40b01a['body']['id'];}return db[_0x5861('0x3c')][_0x5861('0x5a')]({'where':{'id':_0x40b01a[_0x5861('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x5861('0x1d')](handleEntityNotFound(_0xe4dee7,null))[_0x5861('0x1d')](saveUpdates(_0x40b01a[_0x5861('0x5c')],null))[_0x5861('0x1d')](function(_0x1d8699){if(_0x1d8699&&_0x40b01a[_0x5861('0x5c')][_0x5861('0x3b')]){return db[_0x5861('0x3a')][_0x5861('0x32')](_0x40b01a[_0x5861('0x5c')][_0x5861('0x3b')],{'where':{'ChatWebsiteId':_0x1d8699['id']}})[_0x5861('0x1d')](function(){return _0x1d8699;});}return _0x1d8699;})['then'](respondWithResult(_0xe4dee7,null))['catch'](handleError(_0xe4dee7,null));};exports[_0x5861('0x33')]=function(_0x263ce3,_0x4f7ed1){return db[_0x5861('0x3c')]['find']({'where':{'id':_0x263ce3[_0x5861('0x57')]['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x4f7ed1,null))[_0x5861('0x1d')](removeEntity(_0x4f7ed1,null))['catch'](handleError(_0x4f7ed1,null));};exports['describe']=function(_0x571c12,_0x1a83ff){return db[_0x5861('0x3c')][_0x5861('0x61')]()[_0x5861('0x1d')](respondWithResult(_0x1a83ff,null))[_0x5861('0x28')](handleError(_0x1a83ff,null));};exports[_0x5861('0x62')]=function(_0xbfe8cf,_0x1d10ec,_0xec6eca){if(_0xbfe8cf[_0x5861('0x5c')]['id']){delete _0xbfe8cf[_0x5861('0x5c')]['id'];}return db['ChatWebsite'][_0x5861('0x5a')]({'where':{'id':_0xbfe8cf[_0x5861('0x57')]['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x1d10ec,null))[_0x5861('0x1d')](function(_0x245051){if(_0x245051){_0xbfe8cf[_0x5861('0x5c')][_0x5861('0x63')]=_0x245051['id'];return db['Disposition'][_0x5861('0x5b')](_0xbfe8cf[_0x5861('0x5c')]);}})['then'](respondWithResult(_0x1d10ec,null))['catch'](handleError(_0x1d10ec,null));};exports[_0x5861('0x64')]=function(_0x16bace,_0xe9c15,_0x4f6c8){var _0x5485aa={'raw':![],'where':{}};var _0x592a1c={};var _0x2c44ec={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5861('0x65')]({'where':{'id':_0x16bace[_0x5861('0x57')]['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0xe9c15,null))['then'](function(_0x1722df){if(_0x1722df){_0x592a1c['model']=_[_0x5861('0x3e')](db[_0x5861('0x66')][_0x5861('0x58')]);_0x592a1c['query']=_[_0x5861('0x3e')](_0x16bace[_0x5861('0x3f')]);_0x592a1c[_0x5861('0x40')]=_[_0x5861('0x41')](_0x592a1c[_0x5861('0x3d')],_0x592a1c[_0x5861('0x3f')]);_0x5485aa[_0x5861('0x42')]=_[_0x5861('0x41')](_0x592a1c[_0x5861('0x3d')],qs[_0x5861('0x43')](_0x16bace[_0x5861('0x3f')]['fields']));_0x5485aa[_0x5861('0x42')]=_0x5485aa[_0x5861('0x42')][_0x5861('0x59')]?_0x5485aa[_0x5861('0x42')]:_0x592a1c['model'];if(!_0x16bace[_0x5861('0x3f')][_0x5861('0x44')](_0x5861('0x45'))){_0x5485aa[_0x5861('0x2d')]=qs[_0x5861('0x2d')](_0x16bace['query'][_0x5861('0x2d')]);_0x5485aa[_0x5861('0x2c')]=qs[_0x5861('0x2c')](_0x16bace['query']['offset']);}_0x5485aa[_0x5861('0x46')]=qs[_0x5861('0x47')](_0x16bace[_0x5861('0x3f')][_0x5861('0x47')]);_0x5485aa[_0x5861('0x48')]=qs['filters'](_[_0x5861('0x49')](_0x16bace['query'],_0x592a1c[_0x5861('0x40')]));_0x5485aa['where'][_0x5861('0x63')]=_0x1722df['id'];if(_0x16bace['query'][_0x5861('0x4a')]){_0x5485aa[_0x5861('0x48')]=_[_0x5861('0x4b')](_0x5485aa[_0x5861('0x48')],{'$or':_['map'](_0x5485aa['attributes'],function(_0xb7dbd8){var _0x3e6f06={};_0x3e6f06[_0xb7dbd8]={'$like':'%'+_0x16bace['query'][_0x5861('0x4a')]+'%'};return _0x3e6f06;})});}_0x5485aa=_[_0x5861('0x4b')]({},_0x5485aa,_0x16bace[_0x5861('0x51')]);return db[_0x5861('0x66')][_0x5861('0x52')]({'where':_0x5485aa[_0x5861('0x48')]})['then'](function(_0x11c6c7){_0x2c44ec[_0x5861('0x52')]=_0x11c6c7;if(_0x16bace[_0x5861('0x3f')][_0x5861('0x67')]){_0x5485aa[_0x5861('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x5861('0x54')](_0x5485aa);})['then'](function(_0x2adca7){_0x2c44ec[_0x5861('0x55')]=_0x2adca7;return _0x2c44ec;});}})[_0x5861('0x1d')](respondWithFilteredResult(_0xe9c15,_0x5485aa))[_0x5861('0x28')](handleError(_0xe9c15,null));};exports[_0x5861('0x68')]=function(_0x4b43bf,_0x32632c,_0x369dd8){var _0x34ab6a;return db[_0x5861('0x3c')]['find']({'where':{'id':_0x4b43bf[_0x5861('0x57')]['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x32632c,null))[_0x5861('0x1d')](function(_0x22fd22){if(_0x22fd22){return _0x22fd22[_0x5861('0x68')](_0x4b43bf[_0x5861('0x3f')]['ids']);}})[_0x5861('0x1d')](respondWithStatusCode(_0x32632c,null))[_0x5861('0x28')](handleError(_0x32632c,null));};exports['addAnswer']=function(_0xef2b66,_0x5c076e,_0x1935cc){if(_0xef2b66['body']['id']){delete _0xef2b66[_0x5861('0x5c')]['id'];}return db[_0x5861('0x3c')][_0x5861('0x5a')]({'where':{'id':_0xef2b66[_0x5861('0x57')]['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x5c076e,null))[_0x5861('0x1d')](function(_0x3fa0de){if(_0x3fa0de){_0xef2b66['body']['ChatWebsiteId']=_0x3fa0de['id'];return db[_0x5861('0x69')][_0x5861('0x5b')](_0xef2b66[_0x5861('0x5c')]);}})[_0x5861('0x1d')](respondWithResult(_0x5c076e,null))[_0x5861('0x28')](handleError(_0x5c076e,null));};exports[_0x5861('0x6a')]=function(_0x573aaf,_0x219435,_0x5922de){var _0x33b444={'raw':![],'where':{}};var _0x222cba={};var _0x41a5e1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5861('0x65')]({'where':{'id':_0x573aaf[_0x5861('0x57')]['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x219435,null))[_0x5861('0x1d')](function(_0x96e232){if(_0x96e232){_0x222cba[_0x5861('0x3d')]=_[_0x5861('0x3e')](db[_0x5861('0x69')][_0x5861('0x58')]);_0x222cba[_0x5861('0x3f')]=_[_0x5861('0x3e')](_0x573aaf['query']);_0x222cba[_0x5861('0x40')]=_['intersection'](_0x222cba['model'],_0x222cba[_0x5861('0x3f')]);_0x33b444['attributes']=_['intersection'](_0x222cba['model'],qs[_0x5861('0x43')](_0x573aaf['query'][_0x5861('0x43')]));_0x33b444[_0x5861('0x42')]=_0x33b444['attributes'][_0x5861('0x59')]?_0x33b444[_0x5861('0x42')]:_0x222cba[_0x5861('0x3d')];if(!_0x573aaf['query']['hasOwnProperty'](_0x5861('0x45'))){_0x33b444['limit']=qs[_0x5861('0x2d')](_0x573aaf['query']['limit']);_0x33b444[_0x5861('0x2c')]=qs[_0x5861('0x2c')](_0x573aaf[_0x5861('0x3f')][_0x5861('0x2c')]);}_0x33b444[_0x5861('0x46')]=qs['sort'](_0x573aaf['query'][_0x5861('0x47')]);_0x33b444[_0x5861('0x48')]=qs[_0x5861('0x40')](_[_0x5861('0x49')](_0x573aaf[_0x5861('0x3f')],_0x222cba[_0x5861('0x40')]));_0x33b444[_0x5861('0x48')][_0x5861('0x63')]=_0x96e232['id'];if(_0x573aaf[_0x5861('0x3f')][_0x5861('0x4a')]){_0x33b444[_0x5861('0x48')]=_['merge'](_0x33b444[_0x5861('0x48')],{'$or':_[_0x5861('0x4c')](_0x33b444['attributes'],function(_0x373163){var _0x4dcec4={};_0x4dcec4[_0x373163]={'$like':'%'+_0x573aaf[_0x5861('0x3f')]['filter']+'%'};return _0x4dcec4;})});}_0x33b444=_[_0x5861('0x4b')]({},_0x33b444,_0x573aaf['options']);return db[_0x5861('0x69')][_0x5861('0x52')]({'where':_0x33b444[_0x5861('0x48')]})[_0x5861('0x1d')](function(_0x3d3fc2){_0x41a5e1['count']=_0x3d3fc2;if(_0x573aaf[_0x5861('0x3f')][_0x5861('0x67')]){_0x33b444[_0x5861('0x53')]=[{'all':!![]}];}return db[_0x5861('0x69')][_0x5861('0x54')](_0x33b444);})[_0x5861('0x1d')](function(_0xeab04){_0x41a5e1[_0x5861('0x55')]=_0xeab04;return _0x41a5e1;});}})[_0x5861('0x1d')](respondWithFilteredResult(_0x219435,_0x33b444))[_0x5861('0x28')](handleError(_0x219435,null));};exports[_0x5861('0x6b')]=function(_0xf10e6e,_0x5a95aa,_0x45b017){var _0x5cb2c8;return db[_0x5861('0x3c')][_0x5861('0x5a')]({'where':{'id':_0xf10e6e[_0x5861('0x57')]['id']}})['then'](handleEntityNotFound(_0x5a95aa,null))['then'](function(_0x7a87ec){if(_0x7a87ec){return _0x7a87ec[_0x5861('0x6b')](_0xf10e6e['query']['ids']);}})[_0x5861('0x1d')](respondWithStatusCode(_0x5a95aa,null))[_0x5861('0x28')](handleError(_0x5a95aa,null));};exports[_0x5861('0x6c')]=function(_0x505857,_0x47e81d,_0x2884fb){_0x505857[_0x5861('0x5c')]['sitepic']=_0x505857[_0x5861('0x6d')][_0x5861('0x6e')];return db[_0x5861('0x3c')][_0x5861('0x5a')]({'where':{'id':_0x505857[_0x5861('0x57')]['id']}})['then'](handleEntityNotFound(_0x47e81d,null))['then'](saveUpdates(_0x505857['body'],null))[_0x5861('0x1d')](respondWithResult(_0x47e81d,null))[_0x5861('0x28')](handleError(_0x47e81d,null));};exports[_0x5861('0x6f')]=function(_0x147f30,_0x4a32ad,_0x27c910){_0x147f30['body'][_0x5861('0x70')]=_0x147f30[_0x5861('0x6d')][_0x5861('0x6e')];return db[_0x5861('0x3c')][_0x5861('0x5a')]({'where':{'id':_0x147f30['params']['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x4a32ad,null))['then'](saveUpdates(_0x147f30[_0x5861('0x5c')],null))[_0x5861('0x1d')](respondWithResult(_0x4a32ad,null))[_0x5861('0x28')](handleError(_0x4a32ad,null));};exports[_0x5861('0x71')]=function(_0x3fc07e,_0x3f97a5,_0x44fa80){_0x3fc07e[_0x5861('0x5c')][_0x5861('0x72')]=_0x3fc07e[_0x5861('0x6d')][_0x5861('0x6e')];return db[_0x5861('0x3c')][_0x5861('0x5a')]({'where':{'id':_0x3fc07e[_0x5861('0x57')]['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x3f97a5,null))[_0x5861('0x1d')](saveUpdates(_0x3fc07e[_0x5861('0x5c')],null))[_0x5861('0x1d')](respondWithResult(_0x3f97a5,null))[_0x5861('0x28')](handleError(_0x3f97a5,null));};exports[_0x5861('0x73')]=function(_0x1a5808,_0x3c765c,_0x2c9450){_0x1a5808[_0x5861('0x5c')][_0x5861('0x74')]=_0x1a5808[_0x5861('0x6d')]['filename'];return db[_0x5861('0x3c')][_0x5861('0x5a')]({'where':{'id':_0x1a5808[_0x5861('0x57')]['id']}})['then'](handleEntityNotFound(_0x3c765c,null))[_0x5861('0x1d')](saveUpdates(_0x1a5808[_0x5861('0x5c')],null))[_0x5861('0x1d')](respondWithResult(_0x3c765c,null))[_0x5861('0x28')](handleError(_0x3c765c,null));};exports[_0x5861('0x75')]=function(_0x26090c,_0x1ff39c,_0x5dad0d){var _0x5014c1=path[_0x5861('0x76')](config[_0x5861('0x77')],_0x5861('0x78'));var _0x14912d={'where':{'id':_0x26090c[_0x5861('0x57')]['id']},'attributes':['id',_0x5861('0x79')],'raw':!![]};var _0xf71c49=![];return require(_0x5861('0x7a'))[_0x5861('0x7b')]()[_0x5861('0x1d')](function(_0xfe94a8){if(_0xfe94a8){_0xf71c49=_0xfe94a8[_0x5861('0x7c')];}})[_0x5861('0x1d')](function(){return db['ChatWebsite'][_0x5861('0x5a')](_0x14912d);})[_0x5861('0x1d')](handleEntityNotFound(_0x1ff39c,null))[_0x5861('0x1d')](function(_0x2b4565){if(_0x2b4565){if(!_[_0x5861('0x7d')](_0x2b4565[_0x5861('0x79')])){if(fs['existsSync'](path['join'](config[_0x5861('0x77')],_0x5861('0x7e'),_0x2b4565['sitepic']))&&_0xf71c49){_0x5014c1=path[_0x5861('0x76')](config[_0x5861('0x77')],_0x5861('0x7e'),_0x2b4565[_0x5861('0x79')]);}}return _0x1ff39c[_0x5861('0x7f')](_0x5014c1);}})['catch'](handleError(_0x1ff39c,null));};exports['getAvatar']=function(_0x1d3c6b,_0x5833f7,_0x1aa166){var _0x111867=path['join'](config[_0x5861('0x77')],_0x5861('0x80'));var _0x1ebb8d={'where':{'id':_0x1d3c6b[_0x5861('0x57')]['id']},'attributes':['id',_0x5861('0x70')],'raw':!![]};return db[_0x5861('0x3c')]['find'](_0x1ebb8d)[_0x5861('0x1d')](handleEntityNotFound(_0x5833f7,null))[_0x5861('0x1d')](function(_0x6771e0){if(_0x6771e0){if(!_[_0x5861('0x7d')](_0x6771e0[_0x5861('0x70')])){if(fs[_0x5861('0x81')](path[_0x5861('0x76')](config[_0x5861('0x77')],_0x5861('0x82'),_0x6771e0[_0x5861('0x70')]))){_0x111867=path['join'](config[_0x5861('0x77')],_0x5861('0x82'),_0x6771e0[_0x5861('0x70')]);}}return _0x5833f7[_0x5861('0x7f')](_0x111867);}})['catch'](handleError(_0x5833f7,null));};exports[_0x5861('0x83')]=function(_0x2b7104,_0x1e4850,_0x487f78){var _0x250161=path['join'](config[_0x5861('0x77')],'server/files/images/avatars/customer_avatar.png');var _0xc619ac={'where':{'id':_0x2b7104[_0x5861('0x57')]['id']},'attributes':['id',_0x5861('0x72'),_0x5861('0x84')],'raw':!![]};return db[_0x5861('0x3c')][_0x5861('0x5a')](_0xc619ac)['then'](handleEntityNotFound(_0x1e4850,null))['then'](function(_0x195f77){if(_0x195f77){if(!_[_0x5861('0x7d')](_0x195f77['customerAvatar'])){if(fs[_0x5861('0x81')](path[_0x5861('0x76')](config[_0x5861('0x77')],'server/files/images/avatars/',_0x195f77[_0x5861('0x72')]))&&_0x195f77[_0x5861('0x84')]){_0x250161=path[_0x5861('0x76')](config[_0x5861('0x77')],_0x5861('0x82'),_0x195f77[_0x5861('0x72')]);}}return _0x1e4850[_0x5861('0x7f')](_0x250161);}})[_0x5861('0x28')](handleError(_0x1e4850,null));};exports['getSystemAvatar']=function(_0x15b60c,_0x3d0638,_0x3408ac){var _0x4b1814=path[_0x5861('0x76')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x1456a7={'where':{'id':_0x15b60c[_0x5861('0x57')]['id']},'attributes':['id',_0x5861('0x74')],'raw':!![]};return db[_0x5861('0x3c')][_0x5861('0x5a')](_0x1456a7)[_0x5861('0x1d')](handleEntityNotFound(_0x3d0638,null))[_0x5861('0x1d')](function(_0x354782){if(_0x354782){if(!_[_0x5861('0x7d')](_0x354782[_0x5861('0x74')])){if(fs[_0x5861('0x81')](path[_0x5861('0x76')](config[_0x5861('0x77')],_0x5861('0x82'),_0x354782['systemAvatar']))){_0x4b1814=path[_0x5861('0x76')](config[_0x5861('0x77')],_0x5861('0x82'),_0x354782[_0x5861('0x74')]);}}return _0x3d0638['download'](_0x4b1814);}})[_0x5861('0x28')](handleError(_0x3d0638,null));};exports[_0x5861('0x85')]=function(_0x1a51c5,_0x1c901a,_0x5b885b){var _0x9fda4d=require(_0x5861('0x86'));var _0x3e2889=new _0x9fda4d();var _0x4af815=_0x3e2889[_0x5861('0x87')](_0x1a51c5['headers']['user-agent'])[_0x5861('0x88')]();var _0x38b65b={'body':_0x1a51c5['body'],'channel':_0x5861('0x89')};var _0x589ec5=[];var _0x47542a=[];var _0x23192d={};var _0xd49923=![];return db[_0x5861('0x8a')][_0x5861('0x61')]()[_0x5861('0x1d')](function(_0x2defa5){if(!_0x2defa5){throw new db[(_0x5861('0x8b'))][(_0x5861('0x8c'))](_0x5861('0x8d'));}_0x589ec5=_[_0x5861('0x8e')](_[_0x5861('0x3e')](_0x2defa5),['createdAt','updatedAt']);_0x47542a=_[_0x5861('0x8e')](_[_0x5861('0x3e')](_0x2defa5),['createdAt',_0x5861('0x8f'),'CompanyId',_0x5861('0x90')]);if(_0x1a51c5['body']['id']){delete _0x1a51c5[_0x5861('0x5c')]['id'];}if(_[_0x5861('0x7d')](_0x1a51c5[_0x5861('0x5c')][_0x5861('0x91')])){throw new db[(_0x5861('0x8b'))][(_0x5861('0x8c'))](_0x5861('0x92'));}if(_[_0x5861('0x7d')](_0x1a51c5[_0x5861('0x5c')]['body'])||_0x1a51c5[_0x5861('0x5c')]['body']===''){throw new db['Sequelize'][(_0x5861('0x8c'))](_0x5861('0x93'));}if(_[_0x5861('0x7d')](_0x1a51c5[_0x5861('0x5c')][_0x5861('0x94')])){throw new db[(_0x5861('0x8b'))][(_0x5861('0x8c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x47542a);}if(!_[_0x5861('0x95')](_0x47542a,_0x1a51c5[_0x5861('0x5c')][_0x5861('0x94')])){throw new db[(_0x5861('0x8b'))][(_0x5861('0x8c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x47542a);}_0x23192d[_0x1a51c5[_0x5861('0x5c')][_0x5861('0x94')]]=_0x1a51c5[_0x5861('0x5c')]['from'];})[_0x5861('0x1d')](function(){return db[_0x5861('0x3c')][_0x5861('0x5a')]({'where':{'id':_0x1a51c5[_0x5861('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0x5861('0x96'),'include':[{'model':db[_0x5861('0x8a')],'as':'Contacts','where':_0x23192d,'limit':0x1,'order':[[_0x5861('0x8f'),'DESC']]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x5861('0x1d')](handleEntityNotFound(_0x1c901a,null))[_0x5861('0x1d')](function(_0x26cc20){if(_0x26cc20&&_0x26cc20[_0x5861('0x96')]){_0x38b65b[_0x5861('0x97')]=_0x26cc20;_0x38b65b[_0x5861('0x98')]=_0x26cc20['Applications'];_0x38b65b[_0x5861('0x99')]=_0x26cc20[_0x5861('0x96')];_0x38b65b[_0x5861('0x98')]=_['orderBy'](_0x38b65b['applications'],[_0x5861('0x9a')],[_0x5861('0x9b')]);if(_0x38b65b[_0x5861('0x97')]['Applications']){delete _0x38b65b[_0x5861('0x97')][_0x5861('0x9c')];}if(_0x38b65b[_0x5861('0x97')][_0x5861('0x96')]&&_0x38b65b[_0x5861('0x97')][_0x5861('0x96')]['Contacts']['length']){return _0x38b65b[_0x5861('0x97')][_0x5861('0x96')][_0x5861('0x9d')][0x0];}var _0xe66da3=_[_0x5861('0x15')](_0x1a51c5[_0x5861('0x5c')],{'firstName':_0x1a51c5['body'][_0x5861('0x91')],'ListId':_0x26cc20[_0x5861('0x90')]});_0xe66da3[_0x1a51c5['body'][_0x5861('0x94')]]=_0x1a51c5[_0x5861('0x5c')][_0x5861('0x91')];return db[_0x5861('0x8a')][_0x5861('0x5b')](_0xe66da3,{'fields':_0x589ec5,'raw':!![]});}})[_0x5861('0x1d')](handleEntityNotFound(_0x1c901a,null))[_0x5861('0x1d')](function(_0x3d3a51){_0x38b65b[_0x5861('0x9e')]=_0x3d3a51;if(_0x3d3a51){var _0x4e700e={'ContactId':_0x3d3a51['id'],'ChatWebsiteId':_0x1a51c5[_0x5861('0x57')]['id'],'from':(_0x3d3a51['firstName']||'')+'\x20'+(_0x3d3a51[_0x5861('0x9f')]||''),'customerIp':_0x1a51c5[_0x5861('0x5c')][_0x5861('0xa0')],'referer':_0x1a51c5[_0x5861('0x5c')][_0x5861('0xa1')],'browserName':_0x4af815[_0x5861('0xa2')][_0x5861('0x38')]&&_0x4af815[_0x5861('0xa2')][_0x5861('0xa3')]?util['format']('%s\x20%s',_0x4af815[_0x5861('0xa2')][_0x5861('0x38')],_0x4af815[_0x5861('0xa2')][_0x5861('0xa3')]):_0x5861('0xa4'),'browserVersion':_0x4af815[_0x5861('0xa2')][_0x5861('0xa3')]||_0x5861('0xa4'),'osName':util[_0x5861('0xa5')](_0x5861('0xa6'),_0x4af815['os']['name'],_0x4af815['os'][_0x5861('0xa3')]),'osVersion':_0x4af815['os']['version'],'deviceModel':_0x4af815[_0x5861('0xa7')][_0x5861('0x3d')]&&_0x4af815[_0x5861('0xa7')][_0x5861('0xa8')]?util[_0x5861('0xa5')](_0x5861('0xa9'),_0x4af815[_0x5861('0xa7')]['model'],_0x4af815[_0x5861('0xa7')][_0x5861('0xa8')],_0x4af815['device']['type']):null,'deviceVendor':_0x4af815['device']['vendor'],'deviceType':_0x4af815['device'][_0x5861('0x4d')],'formData':JSON['stringify'](_0x1a51c5['body'])};var _0x3477fe={'ChatWebsiteId':_0x1a51c5[_0x5861('0x57')]['id'],'closed':![]};if(_0x1a51c5[_0x5861('0x5c')][_0x5861('0xaa')]){_0x3477fe[_0x5861('0xaa')]=_0x1a51c5[_0x5861('0x5c')][_0x5861('0xaa')];return db[_0x5861('0xab')][_0x5861('0x5a')]({'where':_0x3477fe})[_0x5861('0x1d')](function(_0x1fe251){if(_0x1fe251){return[_0x1fe251,![]];}_0x4e700e[_0x5861('0xaa')]=_0x1a51c5[_0x5861('0x5c')]['threadId'];_0x4e700e[_0x5861('0xac')]=_0x1a51c5[_0x5861('0x5c')]['externalUrl'];return db[_0x5861('0xab')][_0x5861('0x5b')](_0x4e700e)[_0x5861('0x1d')](function(_0xed2783){return[_0xed2783,!![]];});});}_0x3477fe['ContactId']=_0x3d3a51['id'];if(_0x1a51c5[_0x5861('0x5c')][_0x5861('0xad')]&&_0x1a51c5[_0x5861('0x5c')][_0x5861('0xad')]['id']){_0x3477fe['id']=_0x1a51c5[_0x5861('0x5c')][_0x5861('0xad')]['id'];return db[_0x5861('0xab')][_0x5861('0x5a')]({'where':_0x3477fe})['then'](function(_0x3d6086){if(_0x3d6086){return[_0x3d6086,![]];}return db[_0x5861('0xab')][_0x5861('0x5b')](_0x4e700e)[_0x5861('0x1d')](function(_0xc80272){return[_0xc80272,!![]];});});}return db[_0x5861('0xab')][_0x5861('0x5b')](_0x4e700e)['then'](function(_0x28cfe1){return[_0x28cfe1,!![]];});}})[_0x5861('0xae')](function(_0x3b8267,_0x2d9d43){if(_0x3b8267){_0xd49923=_0x2d9d43;if(!_0x2d9d43){var _0x2aadda={'from':(_0x38b65b[_0x5861('0x9e')][_0x5861('0xaf')]||'')+'\x20'+(_0x38b65b[_0x5861('0x9e')][_0x5861('0x9f')]||'')};if(_0x1a51c5[_0x5861('0x5c')][_0x5861('0xaa')]&&_0x1a51c5['body']['messageId']&&_0x1a51c5[_0x5861('0x5c')][_0x5861('0xaa')]!=_0x1a51c5[_0x5861('0x5c')][_0x5861('0xb0')]){_0x2aadda['threadId']=_0x1a51c5[_0x5861('0x5c')][_0x5861('0xb0')];}return _0x3b8267[_0x5861('0x32')](_0x2aadda);}else{return _0x3b8267;}}})[_0x5861('0x1d')](function(_0x3d5dd8){_0x38b65b[_0x5861('0xad')]=_0x3d5dd8[_0x5861('0x34')]({'plain':!![]});_0x38b65b['interaction'][_0x5861('0xb1')]=_0xd49923;if(_0x38b65b[_0x5861('0xad')]['created']){if(_0x38b65b[_0x5861('0x97')][_0x5861('0xb2')]){_0x38b65b['applications'][_0x5861('0xb3')]({'id':0x0,'priority':_0x38b65b[_0x5861('0x98')][_0x5861('0x59')]+0x1,'app':_0x5861('0xb4'),'appdata':'unmanaged','interval':_0x5861('0xb5')});}}return db[_0x5861('0xb6')][_0x5861('0x5b')]({'body':_0x1a51c5[_0x5861('0x5c')][_0x5861('0x5c')],'ChatWebsiteId':_0x1a51c5[_0x5861('0x57')]['id'],'ChatInteractionId':_0x3d5dd8['id'],'direction':'in','ContactId':_0x38b65b[_0x5861('0x9e')]['id'],'AttachmentId':_0x1a51c5[_0x5861('0x5c')][_0x5861('0xb7')]});})[_0x5861('0x1d')](function(_0x1276f8){_0x38b65b[_0x5861('0x25')]=_0x1276f8;if(_0x38b65b['interaction']['UserId']){return db[_0x5861('0xb8')][_0x5861('0x5a')]({'attributes':['id','name'],'where':{'id':_0x38b65b[_0x5861('0xad')][_0x5861('0xb9')]}})[_0x5861('0x1d')](function(_0x3c686f){if(_0x3c686f){_0x38b65b[_0x5861('0x98')][_0x5861('0xba')]({'id':0x0,'priority':0x0,'app':_0x5861('0xbb'),'appdata':_0x3c686f[_0x5861('0x38')]+','+(_0x38b65b[_0x5861('0x97')][_0x5861('0xbc')]||0xa),'interval':'*,*,*,*'});_0x38b65b[_0x5861('0xbd')]=!![];}return respondWithRpcPromise(_0x5861('0xbe'),_0x5861('0xbf'),_0x38b65b);});}return respondWithRpcPromise(_0x5861('0xbe'),_0x5861('0xbf'),_0x38b65b);})[_0x5861('0x1d')](function(_0x417f56){respondWithRpcPromise('EventManager','EventManager',{'event':_0x5861('0x85'),'message':_0x417f56},client9002);return _0x417f56;})[_0x5861('0x1d')](respondWithResult(_0x1c901a,null))[_0x5861('0x28')](handleError(_0x1c901a,null));};exports[_0x5861('0xc0')]=function(_0x32f807,_0x3ca65d,_0x104177){var _0x12b298,_0x4ace2e,_0x280382;var _0x1a4be1=[];var _0x3344a7=[];var _0x273d9c={};return db['CmContact'][_0x5861('0x61')]()[_0x5861('0x1d')](function(_0x274adf){if(!_0x274adf){throw new db['Sequelize']['ValidationError'](_0x5861('0x8d'));}_0x3344a7=_[_0x5861('0x8e')](_[_0x5861('0x3e')](_0x274adf),['createdAt',_0x5861('0x8f')]);_0x1a4be1=_[_0x5861('0x8e')](_[_0x5861('0x3e')](_0x274adf),['createdAt','updatedAt','CompanyId',_0x5861('0x90')]);if(_0x32f807['body']['id']){delete _0x32f807[_0x5861('0x5c')]['id'];}if(_[_0x5861('0x7d')](_0x32f807[_0x5861('0x5c')]['from'])){throw _0x3ca65d[_0x5861('0x29')](0x1f4)[_0x5861('0xc1')](new db['Sequelize'][(_0x5861('0x8c'))](_0x5861('0x92')));}if(_[_0x5861('0x7d')](_0x32f807[_0x5861('0x5c')][_0x5861('0x5c')])||_0x32f807[_0x5861('0x5c')][_0x5861('0x5c')]===''){throw _0x3ca65d['status'](0x1f4)[_0x5861('0xc1')](new db[(_0x5861('0x8b'))][(_0x5861('0x8c'))](_0x5861('0x93')));}if(_[_0x5861('0x7d')](_0x32f807[_0x5861('0x5c')][_0x5861('0xc2')])){throw _0x3ca65d[_0x5861('0x29')](0x1f4)[_0x5861('0xc1')](new db[(_0x5861('0x8b'))][(_0x5861('0x8c'))](_0x5861('0xc3')+_0x1a4be1));}if(!_[_0x5861('0x95')](_0x1a4be1,_0x32f807[_0x5861('0x5c')][_0x5861('0xc2')])){throw _0x3ca65d['status'](0x1f4)['send'](new db[(_0x5861('0x8b'))][(_0x5861('0x8c'))](_0x5861('0xc4')+_0x1a4be1));}_0x273d9c[_0x32f807[_0x5861('0x5c')]['mapKeyOffline']]=_0x32f807[_0x5861('0x5c')][_0x5861('0x91')];})[_0x5861('0x1d')](function(){return db[_0x5861('0x3c')][_0x5861('0x5a')]({'where':{'id':_0x32f807['params']['id']},'include':[{'model':db[_0x5861('0xc5')],'as':_0x5861('0x96')}]});})[_0x5861('0x1d')](handleEntityNotFound(_0x3ca65d,null))[_0x5861('0x1d')](function(_0x297653){if(_0x297653&&_0x297653[_0x5861('0x96')]){_0x4ace2e=_0x297653;var _0x1c61e4=_['defaults'](_0x32f807[_0x5861('0x5c')],{'firstName':_0x32f807['body'][_0x5861('0x91')],'phone':_0x32f807['body'][_0x5861('0x91')],'ListId':_0x297653[_0x5861('0x90')]});_0x1c61e4[_0x32f807[_0x5861('0x5c')]['mapKeyOffline']]=_0x32f807[_0x5861('0x5c')][_0x5861('0x91')];return db['CmContact']['findOrCreate']({'where':_0x273d9c,'defaults':_0x1c61e4});}})[_0x5861('0xae')](function(_0x4cfcb6){if(_0x4cfcb6){_0x280382=_0x4cfcb6;var _0xc42913=fs[_0x5861('0xc6')](path[_0x5861('0x76')](config[_0x5861('0x77')],_0x5861('0xc7')),'utf8');var _0x41d574=ejs[_0x5861('0xc8')](_0xc42913,{'body':_[_0x5861('0xc9')](_0x32f807[_0x5861('0x5c')][_0x5861('0x5c')]),'bodyTitle':_0x4ace2e[_0x5861('0xca')]});return db['ChatOfflineMessage'][_0x5861('0x5b')]({'body':_0x41d574,'ContactId':_0x4cfcb6['id'],'ChatWebsiteId':_0x4ace2e['id']});}})[_0x5861('0x1d')](function(_0x1e1549){if(_0x1e1549){_0x12b298=_0x1e1549;return db[_0x5861('0xcb')][_0x5861('0x65')]({'where':{'service':!![]},'include':[{'model':db[_0x5861('0xcc')],'as':_0x5861('0xcd'),'raw':!![]}]});}})[_0x5861('0x1d')](function(_0x19f0ca){if(_0x19f0ca&&_0x19f0ca[_0x5861('0xcd')]&&_0x4ace2e[_0x5861('0xce')]){var _0x1d8917={'tls':{'rejectUnauthorized':![]}};if(_0x19f0ca[_0x5861('0xcd')]['service']){_0x1d8917[_0x5861('0xcf')]=_0x19f0ca['Smtp']['service'];}else{_0x1d8917[_0x5861('0xd0')]=_0x19f0ca[_0x5861('0xcd')][_0x5861('0xd0')];_0x1d8917[_0x5861('0xd1')]=_0x19f0ca[_0x5861('0xcd')][_0x5861('0xd1')];_0x1d8917[_0x5861('0xd2')]=_0x19f0ca[_0x5861('0xcd')][_0x5861('0xd2')];}if(_0x19f0ca[_0x5861('0xcd')][_0x5861('0xd3')]){_0x1d8917[_0x5861('0xd4')]={'user':_0x19f0ca[_0x5861('0xcd')]['user'],'pass':_0x19f0ca[_0x5861('0xcd')][_0x5861('0xd5')]};}return respondWithRpcPromise(_0x5861('0xd6'),_0x5861('0xd7'),{'account':_0x1d8917,'message':{'from':util['format'](_0x5861('0xd8'),_0x19f0ca['name'],_0x19f0ca[_0x5861('0xd9')]||_0x19f0ca['Smtp']['user']),'to':_0x4ace2e[_0x5861('0xce')],'subject':_0x4ace2e['offlineMessageSubject'],'text':_0x12b298[_0x5861('0x5c')]}},client9003)[_0x5861('0x1d')](function(){return _0x12b298;})[_0x5861('0x28')](function(_0x53e3e2){console[_0x5861('0x23')](_0x53e3e2);});}})[_0x5861('0x1d')](function(){if(_0x12b298){return _0x12b298;}})['then'](respondWithResult(_0x3ca65d,null))[_0x5861('0x28')](handleError(_0x3ca65d,null));};exports[_0x5861('0xda')]=function(_0x25de71,_0x5afa5a,_0x1a8b72){return db[_0x5861('0xab')][_0x5861('0x5a')]({'where':{'id':_0x25de71[_0x5861('0x57')]['id']}})['then'](handleEntityNotFound(_0x5afa5a,null))[_0x5861('0x1d')](function(_0x2c8de4){if(_0x2c8de4){return _0x2c8de4['addInteraction'](_0x25de71[_0x5861('0x5c')][_0x5861('0xdb')],_[_0x5861('0xdc')](_0x25de71['body'],[_0x5861('0xdb'),'id'])||{});}})[_0x5861('0x1d')](respondWithResult(_0x5afa5a,null))[_0x5861('0x28')](handleError(_0x5afa5a,null));};exports[_0x5861('0xdd')]=function(_0x3f2ea9,_0x4c0857,_0x16ab1a){var _0x49c4bc={'raw':![],'where':{}};var _0x1f7da0={};var _0x2c8f0c={'count':0x0,'rows':[]};return db[_0x5861('0x3c')][_0x5861('0x65')]({'where':{'id':_0x3f2ea9[_0x5861('0x57')]['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x4c0857,null))[_0x5861('0x1d')](function(_0x2ac6bd){if(_0x2ac6bd){_0x1f7da0[_0x5861('0x3d')]=_[_0x5861('0x3e')](db[_0x5861('0xab')][_0x5861('0x58')]);_0x1f7da0[_0x5861('0x3f')]=_[_0x5861('0x3e')](_0x3f2ea9[_0x5861('0x3f')]);_0x1f7da0['filters']=_[_0x5861('0x41')](_0x1f7da0[_0x5861('0x3d')],_0x1f7da0[_0x5861('0x3f')]);_0x49c4bc['attributes']=_['intersection'](_0x1f7da0['model'],qs[_0x5861('0x43')](_0x3f2ea9[_0x5861('0x3f')]['fields']));_0x49c4bc[_0x5861('0x42')]=_0x49c4bc[_0x5861('0x42')][_0x5861('0x59')]?_0x49c4bc[_0x5861('0x42')]:_0x1f7da0[_0x5861('0x3d')];if(!_0x3f2ea9[_0x5861('0x3f')][_0x5861('0x44')](_0x5861('0x45'))){_0x49c4bc[_0x5861('0x2d')]=qs[_0x5861('0x2d')](_0x3f2ea9['query'][_0x5861('0x2d')]);_0x49c4bc[_0x5861('0x2c')]=qs[_0x5861('0x2c')](_0x3f2ea9[_0x5861('0x3f')][_0x5861('0x2c')]);}_0x49c4bc[_0x5861('0x46')]=qs['sort'](_0x3f2ea9[_0x5861('0x3f')][_0x5861('0x47')]);_0x49c4bc['where']=qs[_0x5861('0x40')](_['pick'](_0x3f2ea9[_0x5861('0x3f')],_0x1f7da0['filters']));_0x49c4bc[_0x5861('0x48')][_0x5861('0x63')]=_0x2ac6bd['id'];if(_0x3f2ea9[_0x5861('0x3f')][_0x5861('0x4a')]){_0x49c4bc['where']=_[_0x5861('0x4b')](_0x49c4bc[_0x5861('0x48')],{'$or':_[_0x5861('0x4c')](_0x49c4bc['attributes'],function(_0x563e60){var _0x430feb={};_0x430feb[_0x563e60]={'$like':'%'+_0x3f2ea9[_0x5861('0x3f')]['filter']+'%'};return _0x430feb;})});}_0x49c4bc=_['merge']({},_0x49c4bc,_0x3f2ea9[_0x5861('0x51')]);return db[_0x5861('0xab')][_0x5861('0x52')]({'where':_0x49c4bc[_0x5861('0x48')]})['then'](function(_0x5a4c56){_0x2c8f0c['count']=_0x5a4c56;if(_0x3f2ea9[_0x5861('0x3f')][_0x5861('0x67')]){_0x49c4bc['include']=[{'model':db[_0x5861('0x8a')],'as':'Contact','required':![]},{'model':db[_0x5861('0xb8')],'as':_0x5861('0xde'),'attributes':['name',_0x5861('0xdf'),'internal'],'required':![]},{'model':db[_0x5861('0xe0')],'as':_0x5861('0xe1'),'attributes':['id',_0x5861('0x38'),_0x5861('0xe2')],'where':_0x3f2ea9[_0x5861('0x3f')][_0x5861('0xe3')]?{'id':_0x3f2ea9[_0x5861('0x3f')][_0x5861('0xe3')]}:undefined,'required':_0x3f2ea9['query']['tag']?!![]:![]}];}return db[_0x5861('0xab')]['findAll'](_0x49c4bc);})['then'](function(_0x16d57b){_0x2c8f0c[_0x5861('0x55')]=_0x16d57b;return _0x2c8f0c;});}})[_0x5861('0x1d')](respondWithFilteredResult(_0x4c0857,_0x49c4bc))[_0x5861('0x28')](handleError(_0x4c0857,null));};function iftimePromise(_0x39bb73,_0x1a971f){return respondWithRpcPromise(_0x5861('0xe4'),'getSnippet',{'command':_0x1a971f[_0x5861('0xe5')]?util[_0x5861('0xa5')](_0x5861('0xe6'),_0x39bb73[_0x5861('0xe7')],_0x1a971f[_0x5861('0xe5')]):util['format']('iftime\x20%s',_0x39bb73[_0x5861('0xe7')])},client9002)['then'](function(_0x3a4843){var _0x3b5733=_0x3a4843&&_0x3a4843[_0x5861('0xe8')](_0x5861('0xe9'))>=0x0?!![]:![];logger[_0x5861('0x26')](_0x5861('0xea'),_0x1a971f['id'],_0x39bb73['id'],_0x39bb73[_0x5861('0xe7')],_0x3b5733?_0x5861('0xeb'):'OFFLINE',_0x1a971f[_0x5861('0xe5')]?_0x1a971f[_0x5861('0xe5')]:'No\x20timezone');return _0x3b5733;})[_0x5861('0x28')](function(_0x119020){logger['error'](_0x5861('0xea'),_0x1a971f['id'],_0x39bb73['id'],_0x39bb73[_0x5861('0xe7')],util[_0x5861('0xec')](_0x119020,{'showHidden':![],'depth':null}),_0x1a971f[_0x5861('0xe5')]?_0x1a971f[_0x5861('0xe5')]:_0x5861('0xed'));return![];});}exports[_0x5861('0xee')]=function(_0x23b255,_0x10d93f,_0x96a849){var _0x43550e=0x0;var _0x469d46=0x0;var _0x58e56a=![];var _0x4d066d;var _0x46c2e0;return db[_0x5861('0x3c')][_0x5861('0x5a')]({'where':{'id':_0x23b255[_0x5861('0x57')]['id']},'include':[{'model':db[_0x5861('0xef')],'as':_0x5861('0xef'),'include':[{'model':db[_0x5861('0xef')],'as':'Intervals','attributes':['id',_0x5861('0xe7')],'raw':!![]}]}]})[_0x5861('0x1d')](handleEntityNotFound(_0x10d93f,null))['then'](function(_0x242038){if(_0x242038){_0x4d066d=_0x242038;return _0x242038[_0x5861('0xf0')]({'raw':!![]});}})[_0x5861('0x1d')](function(_0x341939){if(_0x4d066d){if(_0x341939){_0x46c2e0=_0x341939;}}return require(_0x5861('0x7a'))['getLicense']();})[_0x5861('0x1d')](function(_0x4f4dce){if(_0x4f4dce){_0x469d46=_0x4f4dce[_0x5861('0xf1')];_0x58e56a=_0x4f4dce[_0x5861('0x7c')];}})[_0x5861('0x1d')](function(){return db[_0x5861('0xab')][_0x5861('0x52')]({'where':{'closed':![]}});})[_0x5861('0x1d')](function(_0x353531){_0x43550e=_0x353531;if(_0x469d46&&_0x353531>_0x469d46){return db[_0x5861('0xf2')][_0x5861('0x65')]({'where':{'id':0x1}})[_0x5861('0x1d')](function(_0x1f7c46){if(_0x1f7c46){_0x1f7c46[_0x5861('0xf3')](_0x5861('0xf4'));}});}})[_0x5861('0x1d')](function(){if(_0x4d066d['Interval']&&_0x4d066d[_0x5861('0xef')][_0x5861('0xf5')]){var _0x44d577=[];for(var _0x3a9edf=0x0;_0x3a9edf<_0x4d066d[_0x5861('0xef')][_0x5861('0xf5')][_0x5861('0x59')];_0x3a9edf++){var _0x5073fa=_0x4d066d[_0x5861('0xef')]['Intervals'][_0x3a9edf][_0x5861('0x34')]({'plain':!![]});_0x44d577['push'](iftimePromise(_0x5073fa,_0x4d066d));}return BPromise[_0x5861('0xf6')](_0x44d577)['then'](function(_0x5d367b){return _[_0x5861('0xf7')](_0x5d367b);});}else{return!![];}})[_0x5861('0x1d')](function(_0x1d1eab){var _0x31abe5=fs[_0x5861('0xc6')](path['join'](config[_0x5861('0x77')],_0x5861('0xf8')),_0x5861('0xf9'));var _0x4966fa={'remote':_0x4d066d[_0x5861('0xfa')],'query':querystring[_0x5861('0x22')](_[_0x5861('0x4b')](_0x4d066d['get']({'plain':!![]}),{'customerIp':_0x23b255[_0x5861('0xfb')][_0x5861('0xfc')]||_0x23b255['headers'][_0x5861('0xfd')]||_0x23b255['connection'][_0x5861('0xfe')]||_0x23b255['ip'],'referer':_0x23b255['headers'][_0x5861('0xa1')],'openedInteractions':_0x43550e,'maxInteractions':_0x469d46,'virtual':_0x58e56a['virtual'],'online':_0x1d1eab,'custom':_0x58e56a}))[_0x5861('0xff')](/'/g,'\x5c\x27')};_0x10d93f[_0x5861('0xc1')](ejs[_0x5861('0xc8')](Mustache[_0x5861('0xc8')](_0x31abe5,_0x4966fa),{'proactiveActions':_0x46c2e0,'alignment':_0x4d066d[_0x5861('0x100')],'verticalAlignment':_0x4d066d[_0x5861('0x101')]}));})['catch'](handleError(_0x10d93f,null));};exports[_0x5861('0x102')]=function(_0x1c2421,_0x3455df,_0x166006){return db[_0x5861('0x3c')][_0x5861('0x65')]({'where':{'id':_0x1c2421[_0x5861('0x57')]['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x3455df,null))[_0x5861('0x1d')](function(_0x3a380f){if(_0x3a380f){return db['sequelize'][_0x5861('0x103')](function(_0xe2aef0){return db[_0x5861('0x104')]['destroy']({'where':{'ChatWebsiteId':_0x1c2421[_0x5861('0x57')]['id']},'transaction':_0xe2aef0})[_0x5861('0x1d')](function(_0x55ff08){var _0x34acb5=_[_0x5861('0x4c')](_0x1c2421[_0x5861('0x5c')],function(_0x5278b7){_0x5278b7[_0x5861('0x63')]=_0x1c2421[_0x5861('0x57')]['id'];return _0x5278b7;});return db[_0x5861('0x104')]['bulkCreate'](_0x34acb5,{'transaction':_0xe2aef0});});})[_0x5861('0x1d')](function(){return db['ChatApplication'][_0x5861('0x105')]({'where':{'ChatWebsiteId':_0x1c2421[_0x5861('0x57')]['id']},'order':_0x5861('0x9a')});});}})['then'](respondWithResult(_0x3455df,null))['catch'](handleError(_0x3455df,null));};exports[_0x5861('0x106')]=function(_0x4fa31a,_0x4461a7,_0x29720e){var _0x3c031e={};var _0x1e822e={};var _0x477414;var _0x4e1202;return db[_0x5861('0x3c')][_0x5861('0x65')]({'where':{'id':_0x4fa31a[_0x5861('0x57')]['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x4461a7,null))[_0x5861('0x1d')](function(_0x5d8728){if(_0x5d8728){_0x477414=_0x5d8728;_0x1e822e[_0x5861('0x3d')]=_['keys'](db[_0x5861('0x104')][_0x5861('0x58')]);_0x1e822e['query']=_[_0x5861('0x3e')](_0x4fa31a['query']);_0x1e822e[_0x5861('0x40')]=_[_0x5861('0x41')](_0x1e822e[_0x5861('0x3d')],_0x1e822e[_0x5861('0x3f')]);_0x3c031e[_0x5861('0x42')]=_['intersection'](_0x1e822e[_0x5861('0x3d')],qs[_0x5861('0x43')](_0x4fa31a['query'][_0x5861('0x43')]));_0x3c031e[_0x5861('0x42')]=_0x3c031e[_0x5861('0x42')][_0x5861('0x59')]?_0x3c031e[_0x5861('0x42')]:_0x1e822e[_0x5861('0x3d')];_0x3c031e[_0x5861('0x46')]=qs['sort'](_0x4fa31a[_0x5861('0x3f')][_0x5861('0x47')]);_0x3c031e[_0x5861('0x48')]=qs[_0x5861('0x40')](_[_0x5861('0x49')](_0x4fa31a['query'],_0x1e822e[_0x5861('0x40')]));if(_0x4fa31a['query'][_0x5861('0x4a')]){_0x3c031e['where']=_['merge'](_0x3c031e[_0x5861('0x48')],{'$or':_[_0x5861('0x4c')](_0x3c031e[_0x5861('0x42')],function(_0x3f4387){var _0xb6ff34={};_0xb6ff34[_0x3f4387]={'$like':'%'+_0x4fa31a[_0x5861('0x3f')][_0x5861('0x4a')]+'%'};return _0xb6ff34;})});}_0x3c031e=_[_0x5861('0x4b')]({},_0x3c031e,_0x4fa31a['options']);return _0x477414['getApplications'](_0x3c031e);}})[_0x5861('0x1d')](function(_0x2ef36c){if(_0x2ef36c){_0x4e1202=_0x2ef36c['length'];if(!_0x4fa31a[_0x5861('0x3f')][_0x5861('0x44')]('nolimit')){_0x3c031e[_0x5861('0x2d')]=qs[_0x5861('0x2d')](_0x4fa31a[_0x5861('0x3f')][_0x5861('0x2d')]);_0x3c031e['offset']=qs[_0x5861('0x2c')](_0x4fa31a[_0x5861('0x3f')][_0x5861('0x2c')]);}return _0x477414[_0x5861('0x106')](_0x3c031e);}})['then'](function(_0x5cac5c){if(_0x5cac5c){return _0x5cac5c?{'count':_0x4e1202,'rows':_0x5cac5c}:null;}})['then'](respondWithResult(_0x4461a7,null))[_0x5861('0x28')](handleError(_0x4461a7,null));};exports[_0x5861('0x107')]=function(_0x5c20b5,_0x459828,_0x32a274){return db['chatProactiveAction']['find']({'where':{'id':_0x5c20b5['params']['id']}})['then'](handleEntityNotFound(_0x459828,null))[_0x5861('0x1d')](function(_0x474a35){if(_0x474a35){return _0x474a35[_0x5861('0x107')](_0x5c20b5[_0x5861('0x5c')][_0x5861('0xdb')],_[_0x5861('0xdc')](_0x5c20b5['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x459828,null))[_0x5861('0x28')](handleError(_0x459828,null));};exports[_0x5861('0xf0')]=function(_0x51b871,_0x3995e8,_0xed2ea4){var _0xae5c36={};var _0x2f65b7={};var _0x138821;var _0x4a176a;return db[_0x5861('0x3c')][_0x5861('0x65')]({'where':{'id':_0x51b871[_0x5861('0x57')]['id']}})['then'](handleEntityNotFound(_0x3995e8,null))[_0x5861('0x1d')](function(_0x41407c){if(_0x41407c){_0x138821=_0x41407c;_0x2f65b7['model']=_['keys'](db[_0x5861('0x108')][_0x5861('0x58')]);_0x2f65b7[_0x5861('0x3f')]=_['keys'](_0x51b871[_0x5861('0x3f')]);_0x2f65b7['filters']=_[_0x5861('0x41')](_0x2f65b7[_0x5861('0x3d')],_0x2f65b7[_0x5861('0x3f')]);_0xae5c36[_0x5861('0x42')]=_['intersection'](_0x2f65b7[_0x5861('0x3d')],qs[_0x5861('0x43')](_0x51b871[_0x5861('0x3f')][_0x5861('0x43')]));_0xae5c36[_0x5861('0x42')]=_0xae5c36[_0x5861('0x42')][_0x5861('0x59')]?_0xae5c36[_0x5861('0x42')]:_0x2f65b7[_0x5861('0x3d')];_0xae5c36[_0x5861('0x46')]=qs['sort'](_0x51b871['query'][_0x5861('0x47')]);_0xae5c36[_0x5861('0x48')]=qs['filters'](_[_0x5861('0x49')](_0x51b871[_0x5861('0x3f')],_0x2f65b7[_0x5861('0x40')]));if(_0x51b871[_0x5861('0x3f')][_0x5861('0x4a')]){_0xae5c36['where']=_[_0x5861('0x4b')](_0xae5c36[_0x5861('0x48')],{'$or':_[_0x5861('0x4c')](_0xae5c36['attributes'],function(_0x419e6b){var _0x1f57c3={};_0x1f57c3[_0x419e6b]={'$like':'%'+_0x51b871['query'][_0x5861('0x4a')]+'%'};return _0x1f57c3;})});}_0xae5c36=_[_0x5861('0x4b')]({},_0xae5c36,_0x51b871[_0x5861('0x51')]);return _0x138821[_0x5861('0xf0')](_0xae5c36);}})['then'](function(_0x3ba86a){if(_0x3ba86a){_0x4a176a=_0x3ba86a[_0x5861('0x59')];if(!_0x51b871[_0x5861('0x3f')][_0x5861('0x44')]('nolimit')){_0xae5c36['limit']=qs[_0x5861('0x2d')](_0x51b871[_0x5861('0x3f')]['limit']);_0xae5c36[_0x5861('0x2c')]=qs[_0x5861('0x2c')](_0x51b871[_0x5861('0x3f')][_0x5861('0x2c')]);}return _0x138821[_0x5861('0xf0')](_0xae5c36);}})[_0x5861('0x1d')](function(_0x25de6d){if(_0x25de6d){return _0x25de6d?{'count':_0x4a176a,'rows':_0x25de6d}:null;}})['then'](respondWithResult(_0x3995e8,null))[_0x5861('0x28')](handleError(_0x3995e8,null));};exports[_0x5861('0x109')]=function(_0x176c28,_0x25cdea,_0x3560c6){var _0x49dad6=_0x176c28[_0x5861('0x3f')][_0x5861('0x10a')]==='false'?_0x5861('0x10b'):_0x5861('0x10c');return db[_0x5861('0x3c')]['find']({'attributes':['id',_0x49dad6],'where':{'id':_0x176c28['params']['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x25cdea,null))[_0x5861('0x1d')](function(_0x237a6f){if(_0x237a6f){var _0x21f2fb=_0x237a6f[_0x49dad6];var _0x1e7ce3=_0x21f2fb&&_0x21f2fb['items']?_0x21f2fb[_0x5861('0x10d')]:[];_0x25cdea[_0x5861('0xc1')]({'fromKey':_[_0x5861('0x7d')](_0x21f2fb[_0x5861('0x10e')])?undefined:_0x21f2fb['fromKey'],'count':_0x1e7ce3[_0x5861('0x59')],'rows':_0x1e7ce3});}})[_0x5861('0x28')](handleError(_0x25cdea,null));};exports['getOfflineMessages']=function(_0x4f8c39,_0x426086,_0x482dd7){var _0x451494={'raw':!![],'where':{}};var _0x24bee0={};var _0x4cfc1a={'count':0x0,'rows':[]};return db[_0x5861('0x3c')]['findOne']({'where':{'id':_0x4f8c39['params']['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x426086,null))[_0x5861('0x1d')](function(_0x1f6e6c){if(_0x1f6e6c){_0x24bee0[_0x5861('0x3d')]=_[_0x5861('0x3e')](db[_0x5861('0x10f')][_0x5861('0x58')]);_0x24bee0[_0x5861('0x3f')]=_[_0x5861('0x3e')](_0x4f8c39[_0x5861('0x3f')]);_0x24bee0[_0x5861('0x40')]=_[_0x5861('0x41')](_0x24bee0[_0x5861('0x3d')],_0x24bee0[_0x5861('0x3f')]);_0x451494[_0x5861('0x42')]=_[_0x5861('0x41')](_0x24bee0['model'],qs['fields'](_0x4f8c39[_0x5861('0x3f')][_0x5861('0x43')]));_0x451494[_0x5861('0x42')]=_0x451494[_0x5861('0x42')][_0x5861('0x59')]?_0x451494[_0x5861('0x42')]:_0x24bee0['model'];if(!_0x4f8c39[_0x5861('0x3f')]['hasOwnProperty'](_0x5861('0x45'))){_0x451494['limit']=qs[_0x5861('0x2d')](_0x4f8c39[_0x5861('0x3f')][_0x5861('0x2d')]);_0x451494[_0x5861('0x2c')]=qs[_0x5861('0x2c')](_0x4f8c39['query']['offset']);}_0x451494[_0x5861('0x46')]=qs[_0x5861('0x47')](_0x4f8c39[_0x5861('0x3f')]['sort']);_0x451494['where']=qs[_0x5861('0x40')](_[_0x5861('0x49')](_0x4f8c39['query'],_0x24bee0[_0x5861('0x40')]));_0x451494[_0x5861('0x48')][_0x5861('0x63')]=_0x1f6e6c['id'];if(_0x4f8c39[_0x5861('0x3f')]['filter']){_0x451494['where']=_[_0x5861('0x4b')](_0x451494[_0x5861('0x48')],{'$or':_['map'](_0x451494['attributes'],function(_0x1df1a0){var _0x5a2de7={};_0x5a2de7[_0x1df1a0]={'$like':'%'+_0x4f8c39[_0x5861('0x3f')][_0x5861('0x4a')]+'%'};return _0x5a2de7;})});}_0x451494=_[_0x5861('0x4b')]({},_0x451494,_0x4f8c39[_0x5861('0x51')]);return db['ChatOfflineMessage'][_0x5861('0x52')]({'where':_0x451494[_0x5861('0x48')]})[_0x5861('0x1d')](function(_0x2b7d1f){_0x4cfc1a['count']=_0x2b7d1f;if(_0x4f8c39[_0x5861('0x3f')][_0x5861('0x67')]){_0x451494['include']=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x5861('0x54')](_0x451494);})[_0x5861('0x1d')](function(_0x1cb8cd){_0x4cfc1a['rows']=_0x1cb8cd;return _0x4cfc1a;});}})[_0x5861('0x1d')](respondWithFilteredResult(_0x426086,_0x451494))['catch'](handleError(_0x426086,null));};exports[_0x5861('0x110')]=function(_0x14c1ac,_0xf4e5d8,_0x14f84a){return db['ChatWebsite'][_0x5861('0x5a')]({'where':{'id':_0x14c1ac['params']['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0xf4e5d8,null))[_0x5861('0x1d')](function(_0x3987a0){if(_0x3987a0){return _0x3987a0[_0x5861('0x110')](_0x14c1ac[_0x5861('0x5c')][_0x5861('0xdb')],_[_0x5861('0xdc')](_0x14c1ac['body'],[_0x5861('0xdb'),'id'])||{})['spread'](function(_0x2b485e){for(var _0x4437ca=0x0;_0x4437ca<_0x14c1ac[_0x5861('0x5c')][_0x5861('0xdb')]['length'];_0x4437ca+=0x1){socket[_0x5861('0x111')](_0x5861('0x112'),{'UserId':_0x14c1ac[_0x5861('0x5c')][_0x5861('0xdb')][_0x4437ca],'ChatWebsiteId':_0x14c1ac['params']['id']});}return _0x2b485e;});}})[_0x5861('0x1d')](respondWithResult(_0xf4e5d8,null))['catch'](handleError(_0xf4e5d8,null));};exports[_0x5861('0x113')]=function(_0x3eb523,_0x2fc9b0,_0xc2ec6e){var _0x4d7bf0;return db[_0x5861('0x3c')][_0x5861('0x5a')]({'where':{'id':_0x3eb523['params']['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x2fc9b0,null))[_0x5861('0x1d')](function(_0x2365c0){if(_0x2365c0){return _0x2365c0['removeAgents'](_0x3eb523['query'][_0x5861('0xdb')])[_0x5861('0x1d')](function(_0x50273b){if(_[_0x5861('0x114')](_0x3eb523[_0x5861('0x3f')][_0x5861('0xdb')])){for(var _0x1af61f=0x0;_0x1af61f<_0x3eb523[_0x5861('0x3f')][_0x5861('0xdb')][_0x5861('0x59')];_0x1af61f+=0x1){socket[_0x5861('0x111')](_0x5861('0x115'),{'UserId':_0x3eb523[_0x5861('0x3f')][_0x5861('0xdb')][_0x1af61f],'ChatWebsiteId':_0x3eb523[_0x5861('0x57')]['id']});}}else{socket['emit'](_0x5861('0x115'),{'UserId':_0x3eb523[_0x5861('0x3f')][_0x5861('0xdb')],'ChatWebsiteId':_0x3eb523[_0x5861('0x57')]['id']});}});}})[_0x5861('0x1d')](respondWithStatusCode(_0x2fc9b0,null))[_0x5861('0x28')](handleError(_0x2fc9b0,null));};exports[_0x5861('0x116')]=function(_0x52b097,_0x345797,_0x189cdc){var _0x119f36={};var _0xc70f34={};var _0x2e7510;var _0x5b18e2;return db[_0x5861('0x3c')]['findOne']({'where':{'id':_0x52b097[_0x5861('0x57')]['id']}})[_0x5861('0x1d')](handleEntityNotFound(_0x345797,null))[_0x5861('0x1d')](function(_0x89f75e){if(_0x89f75e){_0x2e7510=_0x89f75e;_0xc70f34[_0x5861('0x3d')]=_[_0x5861('0x3e')](db['User'][_0x5861('0x58')]);_0xc70f34[_0x5861('0x3f')]=_[_0x5861('0x3e')](_0x52b097[_0x5861('0x3f')]);_0xc70f34[_0x5861('0x40')]=_[_0x5861('0x41')](_0xc70f34[_0x5861('0x3d')],_0xc70f34['query']);_0x119f36[_0x5861('0x42')]=_[_0x5861('0x41')](_0xc70f34[_0x5861('0x3d')],qs[_0x5861('0x43')](_0x52b097[_0x5861('0x3f')]['fields']));_0x119f36['attributes']=_0x119f36[_0x5861('0x42')][_0x5861('0x59')]?_0x119f36[_0x5861('0x42')]:_0xc70f34[_0x5861('0x3d')];_0x119f36[_0x5861('0x46')]=qs[_0x5861('0x47')](_0x52b097[_0x5861('0x3f')][_0x5861('0x47')]);_0x119f36[_0x5861('0x48')]=qs[_0x5861('0x40')](_[_0x5861('0x49')](_0x52b097[_0x5861('0x3f')],_0xc70f34['filters']));if(_0x52b097['query']['filter']){_0x119f36[_0x5861('0x48')]=_['merge'](_0x119f36[_0x5861('0x48')],{'$or':_[_0x5861('0x4c')](_0x119f36[_0x5861('0x42')],function(_0x6b0308){var _0x293559={};_0x293559[_0x6b0308]={'$like':'%'+_0x52b097[_0x5861('0x3f')]['filter']+'%'};return _0x293559;})});}_0x119f36=_[_0x5861('0x4b')]({},_0x119f36,_0x52b097[_0x5861('0x51')]);return _0x2e7510[_0x5861('0x116')](_0x119f36);}})['then'](function(_0xac4342){if(_0xac4342){_0x5b18e2=_0xac4342['length'];if(!_0x52b097['query'][_0x5861('0x44')](_0x5861('0x45'))){_0x119f36[_0x5861('0x2d')]=qs[_0x5861('0x2d')](_0x52b097[_0x5861('0x3f')]['limit']);_0x119f36[_0x5861('0x2c')]=qs[_0x5861('0x2c')](_0x52b097[_0x5861('0x3f')]['offset']);}return _0x2e7510[_0x5861('0x116')](_0x119f36);}})[_0x5861('0x1d')](function(_0xe22c80){if(_0xe22c80){return _0xe22c80?{'count':_0x5b18e2,'rows':_0xe22c80}:null;}})[_0x5861('0x1d')](respondWithResult(_0x345797,null))['catch'](handleError(_0x345797,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 559dc5c..467d4f3 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 _0xbbbd=['hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2ab270,_0x219719){var _0x15aafc=function(_0x25af3c){while(--_0x25af3c){_0x2ab270['push'](_0x2ab270['shift']());}};_0x15aafc(++_0x219719);}(_0xbbbd,0x86));var _0xdbbb=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xbbbd[_0x556bb1];return _0x45455f;};'use strict';var EventEmitter=require(_0xdbbb('0x0'));var ChatWebsite=require(_0xdbbb('0x1'))['db'][_0xdbbb('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xdbbb('0x3')](0x0);var events={'afterCreate':_0xdbbb('0x4'),'afterUpdate':_0xdbbb('0x5'),'afterDestroy':_0xdbbb('0x6')};function emitEvent(_0x3351fb){return function(_0x3b665d,_0x114d3a,_0x1cd8ad){ChatWebsiteEvents[_0xdbbb('0x7')](_0x3351fb+':'+_0x3b665d['id'],_0x3b665d);ChatWebsiteEvents['emit'](_0x3351fb,_0x3b665d);_0x1cd8ad(null);};}for(var e in events){if(events[_0xdbbb('0x8')](e)){var event=events[e];ChatWebsite[_0xdbbb('0x9')](e,emitEvent(event));}}module[_0xdbbb('0xa')]=ChatWebsiteEvents; \ No newline at end of file +var _0x128c=['ChatWebsite','setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x487575,_0x2de8a6){var _0x423867=function(_0x23e54f){while(--_0x23e54f){_0x487575['push'](_0x487575['shift']());}};_0x423867(++_0x2de8a6);}(_0x128c,0x96));var _0xc128=function(_0x35c70c,_0x1f0b01){_0x35c70c=_0x35c70c-0x0;var _0x2b0c72=_0x128c[_0x35c70c];return _0x2b0c72;};'use strict';var EventEmitter=require(_0xc128('0x0'));var ChatWebsite=require(_0xc128('0x1'))['db'][_0xc128('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc128('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc128('0x4')};function emitEvent(_0xb3d173){return function(_0x1afdb0,_0x495b17,_0x2c9c0d){ChatWebsiteEvents[_0xc128('0x5')](_0xb3d173+':'+_0x1afdb0['id'],_0x1afdb0);ChatWebsiteEvents['emit'](_0xb3d173,_0x1afdb0);_0x2c9c0d(null);};}for(var e in events){if(events[_0xc128('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xc128('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 499ad17..4640889 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 _0x0e35=['moment','bluebird','request-promise','./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util','../../config/logger','api'];(function(_0x22a676,_0x4854b3){var _0x1543be=function(_0x348d8f){while(--_0x348d8f){_0x22a676['push'](_0x22a676['shift']());}};_0x1543be(++_0x4854b3);}(_0x0e35,0xc2));var _0x50e3=function(_0x51e3b8,_0x58a5b8){_0x51e3b8=_0x51e3b8-0x0;var _0x16c301=_0x0e35[_0x51e3b8];return _0x16c301;};'use strict';var _=require(_0x50e3('0x0'));var util=require(_0x50e3('0x1'));var logger=require(_0x50e3('0x2'))(_0x50e3('0x3'));var moment=require(_0x50e3('0x4'));var BPromise=require(_0x50e3('0x5'));var rp=require(_0x50e3('0x6'));var attributes=require(_0x50e3('0x7'));module[_0x50e3('0x8')]=function(_0x344554,_0x5a6200){return _0x344554[_0x50e3('0x9')](_0x50e3('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x453b=['moment','bluebird','request-promise','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api'];(function(_0x1acb96,_0x108216){var _0x5da6cf=function(_0x495410){while(--_0x495410){_0x1acb96['push'](_0x1acb96['shift']());}};_0x5da6cf(++_0x108216);}(_0x453b,0x164));var _0xb453=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0x453b[_0x1d9163];return _0xb42197;};'use strict';var _=require(_0xb453('0x0'));var util=require(_0xb453('0x1'));var logger=require(_0xb453('0x2'))(_0xb453('0x3'));var moment=require(_0xb453('0x4'));var BPromise=require(_0xb453('0x5'));var rp=require(_0xb453('0x6'));var attributes=require(_0xb453('0x7'));module[_0xb453('0x8')]=function(_0x1314f4,_0x6ee7a0){return _0x1314f4[_0xb453('0x9')](_0xb453('0xa'),attributes,{'tableName':_0xb453('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 25e8bd9..d386c0d 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 _0x7b1c=['request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7b1c,0x78));var _0xc7b1=function(_0x102493,_0x88cf50){_0x102493=_0x102493-0x0;var _0x58e76d=_0x7b1c[_0x102493];return _0x58e76d;};'use strict';var _=require(_0xc7b1('0x0'));var util=require(_0xc7b1('0x1'));var moment=require(_0xc7b1('0x2'));var BPromise=require(_0xc7b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc7b1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc7b1('0x5'));var logger=require(_0xc7b1('0x6'))(_0xc7b1('0x7'));var config=require('../../config/environment');var jayson=require(_0xc7b1('0x8'));var client=jayson[_0xc7b1('0x9')][_0xc7b1('0xa')]({'port':0x232a});config[_0xc7b1('0xb')]=_['defaults'](config[_0xc7b1('0xb')],{'host':_0xc7b1('0xc'),'port':0x18eb});var socket=require(_0xc7b1('0xd'))(new Redis(config[_0xc7b1('0xb')]));require(_0xc7b1('0xe'))[_0xc7b1('0xf')](socket);function respondWithRpcPromise(_0x15f00a,_0xe11296,_0x18d617){return new BPromise(function(_0x211aa7,_0x5eefcb){return client[_0xc7b1('0x10')](_0x15f00a,_0x18d617)[_0xc7b1('0x11')](function(_0x4a76a9){logger[_0xc7b1('0x12')](_0xc7b1('0x13'),_0xe11296,_0xc7b1('0x14'));logger['debug'](_0xc7b1('0x15'),_0xe11296,_0xc7b1('0x14'),JSON[_0xc7b1('0x16')](_0x4a76a9));if(_0x4a76a9[_0xc7b1('0x17')]){if(_0x4a76a9[_0xc7b1('0x17')][_0xc7b1('0x18')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0xe11296,_0x4a76a9[_0xc7b1('0x17')][_0xc7b1('0x19')]);return _0x5eefcb(_0x4a76a9[_0xc7b1('0x17')]['message']);}logger[_0xc7b1('0x17')](_0xc7b1('0x13'),_0xe11296,_0x4a76a9[_0xc7b1('0x17')][_0xc7b1('0x19')]);return _0x211aa7(_0x4a76a9[_0xc7b1('0x17')][_0xc7b1('0x19')]);}else{logger['info'](_0xc7b1('0x13'),_0xe11296,'request\x20sent');_0x211aa7(_0x4a76a9[_0xc7b1('0x1a')][_0xc7b1('0x19')]);}})[_0xc7b1('0x1b')](function(_0x987aa1){logger[_0xc7b1('0x17')]('ChatWebsite,\x20%s,\x20%s',_0xe11296,_0x987aa1);_0x5eefcb(_0x987aa1);});});} \ No newline at end of file +var _0xf721=['../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf721,0x65));var _0x1f72=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0xf721[_0x5756f8];return _0x3bb749;};'use strict';var _=require(_0x1f72('0x0'));var util=require(_0x1f72('0x1'));var moment=require(_0x1f72('0x2'));var BPromise=require(_0x1f72('0x3'));var rs=require(_0x1f72('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f72('0x5'))['db'];var utils=require(_0x1f72('0x6'));var logger=require(_0x1f72('0x7'))('rpc');var config=require(_0x1f72('0x8'));var jayson=require(_0x1f72('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x1f72('0xa')]=_[_0x1f72('0xb')](config[_0x1f72('0xa')],{'host':_0x1f72('0xc'),'port':0x18eb});var socket=require(_0x1f72('0xd'))(new Redis(config[_0x1f72('0xa')]));require('./chatWebsite.socket')[_0x1f72('0xe')](socket);function respondWithRpcPromise(_0x50ba00,_0x3e0133,_0x4d4237){return new BPromise(function(_0x1f1a19,_0x44a70f){return client[_0x1f72('0xf')](_0x50ba00,_0x4d4237)['then'](function(_0x50b755){logger[_0x1f72('0x10')](_0x1f72('0x11'),_0x3e0133,_0x1f72('0x12'));logger[_0x1f72('0x13')](_0x1f72('0x14'),_0x3e0133,_0x1f72('0x12'),JSON[_0x1f72('0x15')](_0x50b755));if(_0x50b755[_0x1f72('0x16')]){if(_0x50b755[_0x1f72('0x16')][_0x1f72('0x17')]===0x1f4){logger['error'](_0x1f72('0x11'),_0x3e0133,_0x50b755['error'][_0x1f72('0x18')]);return _0x44a70f(_0x50b755[_0x1f72('0x16')][_0x1f72('0x18')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3e0133,_0x50b755[_0x1f72('0x16')][_0x1f72('0x18')]);return _0x1f1a19(_0x50b755[_0x1f72('0x16')][_0x1f72('0x18')]);}else{logger[_0x1f72('0x10')](_0x1f72('0x11'),_0x3e0133,_0x1f72('0x12'));_0x1f1a19(_0x50b755[_0x1f72('0x19')][_0x1f72('0x18')]);}})[_0x1f72('0x1a')](function(_0x481991){logger[_0x1f72('0x16')](_0x1f72('0x11'),_0x3e0133,_0x481991);_0x44a70f(_0x481991);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 7e356e9..508f79f 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 _0xde4b=['remove','update','removeListener','chatWebsite:','save'];(function(_0x4bcb3c,_0x192122){var _0xfe09bb=function(_0xcd8ad2){while(--_0xcd8ad2){_0x4bcb3c['push'](_0x4bcb3c['shift']());}};_0xfe09bb(++_0x192122);}(_0xde4b,0x1a3));var _0xbde4=function(_0x2688dc,_0x2cad45){_0x2688dc=_0x2688dc-0x0;var _0x4e5f02=_0xde4b[_0x2688dc];return _0x4e5f02;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xbde4('0x0'),_0xbde4('0x1'),_0xbde4('0x2')];function createListener(_0x345666,_0x10386f){return function(_0xc58c56){_0x10386f['emit'](_0x345666,_0xc58c56);};}function removeListener(_0x5b153f,_0xa7728d){return function(){ChatWebsiteEvents[_0xbde4('0x3')](_0x5b153f,_0xa7728d);};}exports['register']=function(_0xe05c20){for(var _0x40c4f2=0x0,_0x4802dd=events['length'];_0x40c4f2<_0x4802dd;_0x40c4f2++){var _0x52b2c8=events[_0x40c4f2];var _0x39c435=createListener(_0xbde4('0x4')+_0x52b2c8,_0xe05c20);ChatWebsiteEvents['on'](_0x52b2c8,_0x39c435);}}; \ No newline at end of file +var _0x2e88=['emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x26f4f5,_0x53419e){var _0x91bf0a=function(_0x144da0){while(--_0x144da0){_0x26f4f5['push'](_0x26f4f5['shift']());}};_0x91bf0a(++_0x53419e);}(_0x2e88,0x95));var _0x82e8=function(_0x491cbe,_0x45c8ba){_0x491cbe=_0x491cbe-0x0;var _0x59449d=_0x2e88[_0x491cbe];return _0x59449d;};'use strict';var ChatWebsiteEvents=require(_0x82e8('0x0'));var events=[_0x82e8('0x1'),_0x82e8('0x2'),_0x82e8('0x3')];function createListener(_0x9dd860,_0x46c27f){return function(_0x552153){_0x46c27f[_0x82e8('0x4')](_0x9dd860,_0x552153);};}function removeListener(_0x1d7415,_0x576435){return function(){ChatWebsiteEvents[_0x82e8('0x5')](_0x1d7415,_0x576435);};}exports[_0x82e8('0x6')]=function(_0x4e909a){for(var _0x3162d1=0x0,_0x1e2496=events[_0x82e8('0x7')];_0x3162d1<_0x1e2496;_0x3162d1++){var _0x27df44=events[_0x3162d1];var _0x393c2c=createListener(_0x82e8('0x8')+_0x27df44,_0x4e909a);ChatWebsiteEvents['on'](_0x27df44,_0x393c2c);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index a41aed0..6aedde6 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 _0xd819=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addAnswer','diskStorage','root','server/files/images/logos/','format','now','single','file','addLogo','join','server/files/images/avatars/','%s-%s','originalname','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','/:id/offline','offline','addInteraction','addApplications','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x3d559c,_0x1dd140){var _0x18888a=function(_0x363d3b){while(--_0x363d3b){_0x3d559c['push'](_0x3d559c['shift']());}};_0x18888a(++_0x1dd140);}(_0xd819,0x181));var _0x9d81=function(_0x85edeb,_0x1e63cd){_0x85edeb=_0x85edeb-0x0;var _0x19973b=_0xd819[_0x85edeb];return _0x19973b;};'use strict';var multer=require('multer');var util=require(_0x9d81('0x0'));var path=require(_0x9d81('0x1'));var timeout=require(_0x9d81('0x2'));var express=require(_0x9d81('0x3'));var router=express['Router']();var auth=require(_0x9d81('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9d81('0x5'));var controller=require('./chatWebsite.controller');router[_0x9d81('0x6')]('/',auth[_0x9d81('0x7')](),controller[_0x9d81('0x8')]);router['get'](_0x9d81('0x9'),auth[_0x9d81('0x7')](),controller[_0x9d81('0xa')]);router[_0x9d81('0x6')](_0x9d81('0xb'),auth[_0x9d81('0x7')](),controller[_0x9d81('0xc')]);router[_0x9d81('0x6')](_0x9d81('0xd'),auth[_0x9d81('0x7')](),controller[_0x9d81('0xe')]);router[_0x9d81('0x6')](_0x9d81('0xf'),auth[_0x9d81('0x7')](),controller['getAnswers']);router[_0x9d81('0x6')](_0x9d81('0x10'),controller['getLogo']);router[_0x9d81('0x6')](_0x9d81('0x11'),controller[_0x9d81('0x12')]);router[_0x9d81('0x6')]('/:id/customer_avatar',controller[_0x9d81('0x13')]);router['get'](_0x9d81('0x14'),controller['getSystemAvatar']);router[_0x9d81('0x6')](_0x9d81('0x15'),auth['isAuthenticated'](),controller[_0x9d81('0x16')]);router[_0x9d81('0x6')](_0x9d81('0x17'),controller[_0x9d81('0x18')]);router[_0x9d81('0x6')](_0x9d81('0x19'),auth[_0x9d81('0x7')](),controller[_0x9d81('0x1a')]);router['get'](_0x9d81('0x1b'),auth[_0x9d81('0x7')](),controller[_0x9d81('0x1c')]);router[_0x9d81('0x6')](_0x9d81('0x1d'),controller['getFields']);router['get'](_0x9d81('0x1e'),auth[_0x9d81('0x7')](),controller[_0x9d81('0x1f')]);router[_0x9d81('0x6')](_0x9d81('0x20'),auth[_0x9d81('0x7')](),controller[_0x9d81('0x21')]);router[_0x9d81('0x22')]('/',auth[_0x9d81('0x7')](),controller[_0x9d81('0x23')]);router[_0x9d81('0x22')](_0x9d81('0xd'),auth[_0x9d81('0x7')](),controller['addDisposition']);router[_0x9d81('0x22')](_0x9d81('0xf'),auth[_0x9d81('0x7')](),controller[_0x9d81('0x24')]);var upload=multer({'storage':multer[_0x9d81('0x25')]({'destination':function(_0x12a1e4,_0x3d7be7,_0x25f815){_0x25f815(null,path['join'](config[_0x9d81('0x26')],_0x9d81('0x27')));},'filename':function(_0x288702,_0x220535,_0x49730b){_0x49730b(null,util[_0x9d81('0x28')]('%s-%s',Date[_0x9d81('0x29')](),_0x220535['originalname']));}})});router[_0x9d81('0x22')]('/:id/logo',upload[_0x9d81('0x2a')](_0x9d81('0x2b')),controller[_0x9d81('0x2c')]);var upload=multer({'storage':multer[_0x9d81('0x25')]({'destination':function(_0xb82d79,_0x16a188,_0xff1ed6){_0xff1ed6(null,path[_0x9d81('0x2d')](config[_0x9d81('0x26')],_0x9d81('0x2e')));},'filename':function(_0x2b17d2,_0x259d75,_0x397957){_0x397957(null,util[_0x9d81('0x28')](_0x9d81('0x2f'),Date[_0x9d81('0x29')](),_0x259d75['originalname']));}})});router['post'](_0x9d81('0x11'),upload[_0x9d81('0x2a')](_0x9d81('0x2b')),controller['addAvatar']);var upload=multer({'storage':multer[_0x9d81('0x25')]({'destination':function(_0x6905c0,_0x4aa29d,_0x494696){_0x494696(null,path[_0x9d81('0x2d')](config[_0x9d81('0x26')],_0x9d81('0x2e')));},'filename':function(_0x20e581,_0x418179,_0x34ad39){_0x34ad39(null,util[_0x9d81('0x28')](_0x9d81('0x2f'),Date[_0x9d81('0x29')](),_0x418179[_0x9d81('0x30')]));}})});router[_0x9d81('0x22')](_0x9d81('0x31'),upload[_0x9d81('0x2a')]('file'),controller[_0x9d81('0x32')]);var upload=multer({'storage':multer[_0x9d81('0x25')]({'destination':function(_0x3e4818,_0x1aca28,_0x173ef1){_0x173ef1(null,path['join'](config[_0x9d81('0x26')],_0x9d81('0x2e')));},'filename':function(_0x238f14,_0x16871f,_0x3e6d49){_0x3e6d49(null,util[_0x9d81('0x28')](_0x9d81('0x2f'),Date[_0x9d81('0x29')](),_0x16871f['originalname']));}})});router[_0x9d81('0x22')](_0x9d81('0x14'),upload[_0x9d81('0x2a')]('file'),controller[_0x9d81('0x33')]);router['post'](_0x9d81('0x34'),controller['notify']);router[_0x9d81('0x22')](_0x9d81('0x35'),controller[_0x9d81('0x36')]);router['post'](_0x9d81('0x15'),auth[_0x9d81('0x7')](),controller[_0x9d81('0x37')]);router[_0x9d81('0x22')](_0x9d81('0x19'),auth[_0x9d81('0x7')](),controller[_0x9d81('0x38')]);router[_0x9d81('0x22')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x9d81('0x22')](_0x9d81('0x20'),auth['isAuthenticated'](),controller[_0x9d81('0x39')]);router[_0x9d81('0x3a')](_0x9d81('0xb'),auth['isAuthenticated'](),controller[_0x9d81('0x3b')]);router[_0x9d81('0x3c')](_0x9d81('0xb'),auth[_0x9d81('0x7')](),controller[_0x9d81('0x3d')]);router[_0x9d81('0x3c')](_0x9d81('0xd'),auth[_0x9d81('0x7')](),controller['removeDispositions']);router[_0x9d81('0x3c')]('/:id/canned_answers',auth[_0x9d81('0x7')](),controller[_0x9d81('0x3e')]);router[_0x9d81('0x3c')]('/:id/users',auth['isAuthenticated'](),controller[_0x9d81('0x3f')]);module[_0x9d81('0x40')]=router; \ No newline at end of file +var _0x1115=['put','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','get','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','file','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','/:id/offline','offline','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions','addAgents'];(function(_0x1dc9d9,_0x47321a){var _0xaa3c47=function(_0x53f54b){while(--_0x53f54b){_0x1dc9d9['push'](_0x1dc9d9['shift']());}};_0xaa3c47(++_0x47321a);}(_0x1115,0x1b6));var _0x5111=function(_0x4e3292,_0x4b7dac){_0x4e3292=_0x4e3292-0x0;var _0x2cdb2a=_0x1115[_0x4e3292];return _0x2cdb2a;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var auth=require(_0x5111('0x5'));var interaction=require(_0x5111('0x6'));var config=require(_0x5111('0x7'));var controller=require(_0x5111('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5111('0x9')]);router[_0x5111('0xa')]('/describe',auth[_0x5111('0xb')](),controller[_0x5111('0xc')]);router['get'](_0x5111('0xd'),auth['isAuthenticated'](),controller[_0x5111('0xe')]);router[_0x5111('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5111('0xf')]);router['get'](_0x5111('0x10'),auth['isAuthenticated'](),controller[_0x5111('0x11')]);router[_0x5111('0xa')](_0x5111('0x12'),controller[_0x5111('0x13')]);router[_0x5111('0xa')](_0x5111('0x14'),controller[_0x5111('0x15')]);router[_0x5111('0xa')](_0x5111('0x16'),controller[_0x5111('0x17')]);router[_0x5111('0xa')](_0x5111('0x18'),controller[_0x5111('0x19')]);router[_0x5111('0xa')](_0x5111('0x1a'),auth[_0x5111('0xb')](),controller[_0x5111('0x1b')]);router[_0x5111('0xa')]('/:id/snippet',controller[_0x5111('0x1c')]);router['get']('/:id/applications',auth[_0x5111('0xb')](),controller[_0x5111('0x1d')]);router[_0x5111('0xa')]('/:id/proactive_actions',auth[_0x5111('0xb')](),controller[_0x5111('0x1e')]);router['get'](_0x5111('0x1f'),controller[_0x5111('0x20')]);router[_0x5111('0xa')](_0x5111('0x21'),auth['isAuthenticated'](),controller[_0x5111('0x22')]);router[_0x5111('0xa')](_0x5111('0x23'),auth[_0x5111('0xb')](),controller[_0x5111('0x24')]);router[_0x5111('0x25')]('/',auth[_0x5111('0xb')](),controller[_0x5111('0x26')]);router[_0x5111('0x25')](_0x5111('0x27'),auth['isAuthenticated'](),controller[_0x5111('0x28')]);router[_0x5111('0x25')](_0x5111('0x10'),auth['isAuthenticated'](),controller[_0x5111('0x29')]);var upload=multer({'storage':multer[_0x5111('0x2a')]({'destination':function(_0x2d9446,_0x268070,_0x10a3fe){_0x10a3fe(null,path[_0x5111('0x2b')](config[_0x5111('0x2c')],_0x5111('0x2d')));},'filename':function(_0x382bd0,_0x1a5793,_0x4ffdc3){_0x4ffdc3(null,util[_0x5111('0x2e')](_0x5111('0x2f'),Date[_0x5111('0x30')](),_0x1a5793[_0x5111('0x31')]));}})});router[_0x5111('0x25')](_0x5111('0x12'),upload[_0x5111('0x32')]('file'),controller[_0x5111('0x33')]);var upload=multer({'storage':multer[_0x5111('0x2a')]({'destination':function(_0x25a75a,_0x5efec6,_0xdf9031){_0xdf9031(null,path[_0x5111('0x2b')](config[_0x5111('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x491a4c,_0x20dea1,_0x5165fc){_0x5165fc(null,util[_0x5111('0x2e')]('%s-%s',Date[_0x5111('0x30')](),_0x20dea1['originalname']));}})});router['post']('/:id/avatar',upload[_0x5111('0x32')](_0x5111('0x34')),controller[_0x5111('0x35')]);var upload=multer({'storage':multer[_0x5111('0x2a')]({'destination':function(_0x13fafe,_0x286b83,_0x2aceaa){_0x2aceaa(null,path['join'](config[_0x5111('0x2c')],_0x5111('0x36')));},'filename':function(_0x1c90e6,_0x26a7af,_0x590428){_0x590428(null,util['format'](_0x5111('0x2f'),Date[_0x5111('0x30')](),_0x26a7af[_0x5111('0x31')]));}})});router[_0x5111('0x25')](_0x5111('0x16'),upload[_0x5111('0x32')](_0x5111('0x34')),controller[_0x5111('0x37')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x159cb5,_0x3cd7f8,_0x35d68c){_0x35d68c(null,path['join'](config[_0x5111('0x2c')],_0x5111('0x36')));},'filename':function(_0x2e407e,_0x5b76f8,_0x4ecbc9){_0x4ecbc9(null,util['format'](_0x5111('0x2f'),Date[_0x5111('0x30')](),_0x5b76f8[_0x5111('0x31')]));}})});router[_0x5111('0x25')](_0x5111('0x18'),upload['single'](_0x5111('0x34')),controller[_0x5111('0x38')]);router[_0x5111('0x25')](_0x5111('0x39'),controller['notify']);router[_0x5111('0x25')](_0x5111('0x3a'),controller[_0x5111('0x3b')]);router[_0x5111('0x25')](_0x5111('0x1a'),auth[_0x5111('0xb')](),controller[_0x5111('0x3c')]);router[_0x5111('0x25')](_0x5111('0x3d'),auth[_0x5111('0xb')](),controller[_0x5111('0x3e')]);router[_0x5111('0x25')](_0x5111('0x3f'),auth['isAuthenticated'](),controller[_0x5111('0x40')]);router[_0x5111('0x25')]('/:id/users',auth[_0x5111('0xb')](),controller[_0x5111('0x41')]);router[_0x5111('0x42')](_0x5111('0xd'),auth[_0x5111('0xb')](),controller[_0x5111('0x43')]);router[_0x5111('0x44')]('/:id',auth[_0x5111('0xb')](),controller[_0x5111('0x45')]);router[_0x5111('0x44')](_0x5111('0x27'),auth[_0x5111('0xb')](),controller['removeDispositions']);router['delete'](_0x5111('0x10'),auth[_0x5111('0xb')](),controller['removeAnswers']);router[_0x5111('0x44')](_0x5111('0x23'),auth[_0x5111('0xb')](),controller[_0x5111('0x46')]);module[_0x5111('0x47')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 48eeb1a..acb8882 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 _0xc140=['sequelize','exports','STRING','name'];(function(_0x56a965,_0x53ba3e){var _0x376bed=function(_0x2d67a5){while(--_0x2d67a5){_0x56a965['push'](_0x56a965['shift']());}};_0x376bed(++_0x53ba3e);}(_0xc140,0xfc));var _0x0c14=function(_0x59c683,_0x209444){_0x59c683=_0x59c683-0x0;var _0x47251b=_0xc140[_0x59c683];return _0x47251b;};'use strict';var Sequelize=require(_0x0c14('0x0'));module[_0x0c14('0x1')]={'name':{'type':Sequelize[_0x0c14('0x2')],'unique':_0x0c14('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0c14('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x0c14('0x2')]},'phone':{'type':Sequelize[_0x0c14('0x2')]},'fax':{'type':Sequelize[_0x0c14('0x2')]},'type':{'type':Sequelize[_0x0c14('0x2')]},'street':{'type':Sequelize[_0x0c14('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x0c14('0x2')]},'country':{'type':Sequelize[_0x0c14('0x2')]},'email':{'type':Sequelize[_0x0c14('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0c14('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0c14('0x2')]}}; \ No newline at end of file +var _0xd5d6=['name','sequelize','STRING'];(function(_0x50768d,_0x107eb0){var _0x27ae73=function(_0x398a95){while(--_0x398a95){_0x50768d['push'](_0x50768d['shift']());}};_0x27ae73(++_0x107eb0);}(_0xd5d6,0x14e));var _0x6d5d=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xd5d6[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0x6d5d('0x0'));module['exports']={'name':{'type':Sequelize[_0x6d5d('0x1')],'unique':_0x6d5d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x6d5d('0x1')]},'companyId':{'type':Sequelize[_0x6d5d('0x1')]},'website':{'type':Sequelize[_0x6d5d('0x1')]},'phone':{'type':Sequelize[_0x6d5d('0x1')]},'fax':{'type':Sequelize[_0x6d5d('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x6d5d('0x1')]},'city':{'type':Sequelize[_0x6d5d('0x1')]},'country':{'type':Sequelize[_0x6d5d('0x1')]},'email':{'type':Sequelize[_0x6d5d('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x6d5d('0x1')]},'sStreet':{'type':Sequelize[_0x6d5d('0x1')]},'sPostalCode':{'type':Sequelize[_0x6d5d('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x6d5d('0x1')]},'description':{'type':Sequelize[_0x6d5d('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index a3f5a92..dc924ee 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 _0x60d6=['order','sort','where','pick','filter','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','merge','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','addContacts','omit','ids','getContacts','findOne','length','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','apply','save','update','then','destroy','Companies','sendStatus','error','name','index','CmCompany','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit'];(function(_0x15bc06,_0x215fd0){var _0x561b51=function(_0x26e2c4){while(--_0x26e2c4){_0x15bc06['push'](_0x15bc06['shift']());}};_0x561b51(++_0x215fd0);}(_0x60d6,0x1bc));var _0x660d=function(_0xed43c3,_0x1e1628){_0xed43c3=_0xed43c3-0x0;var _0x422e5a=_0x60d6[_0xed43c3];return _0x422e5a;};'use strict';var pdf=require(_0x660d('0x0'));var emlformat=require(_0x660d('0x1'));var rimraf=require(_0x660d('0x2'));var zipdir=require(_0x660d('0x3'));var jsonpatch=require(_0x660d('0x4'));var rp=require('request-promise');var moment=require(_0x660d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x660d('0x6'));var util=require('util');var path=require(_0x660d('0x7'));var sox=require(_0x660d('0x8'));var csv=require(_0x660d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x660d('0xa'));var squel=require(_0x660d('0xb'));var crypto=require(_0x660d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x660d('0xd'));var toCsv=require(_0x660d('0x9'));var querystring=require('querystring');var Papa=require(_0x660d('0xe'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x660d('0xf'));var logger=require(_0x660d('0x10'))('api');var utils=require(_0x660d('0x11'));var config=require(_0x660d('0x12'));var db=require(_0x660d('0x13'))['db'];function respondWithStatusCode(_0x319b3f,_0x5162dc){_0x5162dc=_0x5162dc||0xcc;return function(_0x5d8616){if(_0x5d8616){return _0x319b3f['sendStatus'](_0x5162dc);}return _0x319b3f[_0x660d('0x14')](_0x5162dc)[_0x660d('0x15')]();};}function respondWithResult(_0x35e807,_0x5dbab8){_0x5dbab8=_0x5dbab8||0xc8;return function(_0x4c9c43){if(_0x4c9c43){return _0x35e807[_0x660d('0x14')](_0x5dbab8)[_0x660d('0x16')](_0x4c9c43);}};}function respondWithFilteredResult(_0x3d8731,_0x124bef){return function(_0x206575){if(_0x206575){var _0x21cd17=_0x206575[_0x660d('0x17')],_0x2b1299=_0x124bef[_0x660d('0x18')],_0x22ac3e=_0x124bef['offset']+_0x124bef['limit'],_0x494375;if(_0x22ac3e>=_0x21cd17){_0x22ac3e=_0x21cd17;_0x494375=0xc8;}else{_0x494375=0xce;}_0x3d8731[_0x660d('0x14')](_0x494375);return _0x3d8731[_0x660d('0x19')]('Content-Range',_0x2b1299+'-'+_0x22ac3e+'/'+_0x21cd17)[_0x660d('0x16')](_0x206575);}return null;};}function patchUpdates(_0x36bbbb){return function(_0x1a27ea){try{jsonpatch[_0x660d('0x1a')](_0x1a27ea,_0x36bbbb,!![]);}catch(_0x364df0){return BPromise['reject'](_0x364df0);}return _0x1a27ea[_0x660d('0x1b')]();};}function saveUpdates(_0x3efc94,_0x549ea9){return function(_0x9221e){if(_0x9221e){return _0x9221e[_0x660d('0x1c')](_0x3efc94)[_0x660d('0x1d')](function(_0x2fbe9d){return _0x2fbe9d;});}return null;};}function removeEntity(_0x437e42,_0x56f964){return function(_0x3fff71){if(_0x3fff71){return _0x3fff71[_0x660d('0x1e')]()[_0x660d('0x1d')](function(){var _0x4524b6=_0x3fff71['get']({'plain':!![]});var _0x509064=_0x660d('0x1f');return db['UserProfileResource'][_0x660d('0x1e')]({'where':{'type':_0x509064,'resourceId':_0x4524b6['id']}})[_0x660d('0x1d')](function(){return _0x3fff71;});})[_0x660d('0x1d')](function(){_0x437e42[_0x660d('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31c012,_0x3d554a){return function(_0x507399){if(!_0x507399){_0x31c012[_0x660d('0x20')](0x194);}return _0x507399;};}function handleError(_0x437c4f,_0x5eec96){_0x5eec96=_0x5eec96||0x1f4;return function(_0xed5fc8){logger[_0x660d('0x21')](_0xed5fc8['stack']);if(_0xed5fc8[_0x660d('0x22')]){delete _0xed5fc8[_0x660d('0x22')];}_0x437c4f['status'](_0x5eec96)['send'](_0xed5fc8);};}exports[_0x660d('0x23')]=function(_0x754824,_0x32e965){var _0x452a2c={},_0x1f12e6={},_0x3dd9eb={'count':0x0,'rows':[]};var _0x34e41d=db[_0x660d('0x24')][_0x660d('0x25')];_0x1f12e6[_0x660d('0x26')]=_[_0x660d('0x27')](_0x34e41d);_0x1f12e6[_0x660d('0x28')]=_[_0x660d('0x27')](_0x754824[_0x660d('0x28')]);_0x1f12e6[_0x660d('0x29')]=_['intersection'](_0x1f12e6['model'],_0x1f12e6[_0x660d('0x28')]);_0x452a2c[_0x660d('0x2a')]=_[_0x660d('0x2b')](_0x1f12e6['model'],qs[_0x660d('0x2c')](_0x754824[_0x660d('0x28')][_0x660d('0x2c')]));_0x452a2c[_0x660d('0x2a')]=_0x452a2c[_0x660d('0x2a')]['length']?_0x452a2c[_0x660d('0x2a')]:_0x1f12e6[_0x660d('0x26')];if(!_0x754824[_0x660d('0x28')][_0x660d('0x2d')](_0x660d('0x2e'))){_0x452a2c['limit']=qs[_0x660d('0x2f')](_0x754824[_0x660d('0x28')]['limit']);_0x452a2c[_0x660d('0x18')]=qs[_0x660d('0x18')](_0x754824['query']['offset']);}_0x452a2c[_0x660d('0x30')]=qs[_0x660d('0x31')](_0x754824[_0x660d('0x28')][_0x660d('0x31')]);_0x452a2c[_0x660d('0x32')]=qs[_0x660d('0x29')](_[_0x660d('0x33')](_0x754824[_0x660d('0x28')],_0x1f12e6[_0x660d('0x29')]));if(_0x754824['query'][_0x660d('0x34')]){_0x452a2c['where']=_['merge'](_0x452a2c[_0x660d('0x32')],{'$or':_[_0x660d('0x35')](_0x34e41d,function(_0x55f01e){if(_0x55f01e[_0x660d('0x36')][_0x660d('0x37')]!==_0x660d('0x38')){var _0x15192d={};_0x15192d[_0x55f01e[_0x660d('0x39')]]={'$like':'%'+_0x754824['query']['filter']+'%'};return _0x15192d;}})});}_0x452a2c=_['merge']({},_0x452a2c,_0x754824['options']);var _0x20834b={'where':_0x452a2c[_0x660d('0x32')]};return db[_0x660d('0x24')][_0x660d('0x17')](_0x20834b)[_0x660d('0x1d')](function(_0x4dbccc){_0x3dd9eb[_0x660d('0x17')]=_0x4dbccc;if(_0x754824['query'][_0x660d('0x3a')]){_0x452a2c[_0x660d('0x3b')]=[{'all':!![]}];}return db[_0x660d('0x24')][_0x660d('0x3c')](_0x452a2c);})['then'](function(_0x41319e){_0x3dd9eb[_0x660d('0x3d')]=_0x41319e;return _0x3dd9eb;})[_0x660d('0x1d')](respondWithFilteredResult(_0x32e965,_0x452a2c))[_0x660d('0x3e')](handleError(_0x32e965,null));};exports[_0x660d('0x3f')]=function(_0xda1325,_0x289eea){var _0x507148={'raw':![],'where':{'id':_0xda1325[_0x660d('0x40')]['id']}},_0x3d5934={};_0x3d5934[_0x660d('0x26')]=_['keys'](db['CmCompany'][_0x660d('0x25')]);_0x3d5934[_0x660d('0x28')]=_[_0x660d('0x27')](_0xda1325['query']);_0x3d5934[_0x660d('0x29')]=_[_0x660d('0x2b')](_0x3d5934[_0x660d('0x26')],_0x3d5934[_0x660d('0x28')]);_0x507148[_0x660d('0x2a')]=_[_0x660d('0x2b')](_0x3d5934['model'],qs[_0x660d('0x2c')](_0xda1325[_0x660d('0x28')][_0x660d('0x2c')]));_0x507148[_0x660d('0x2a')]=_0x507148[_0x660d('0x2a')]['length']?_0x507148[_0x660d('0x2a')]:_0x3d5934[_0x660d('0x26')];if(_0xda1325['query'][_0x660d('0x3a')]){_0x507148[_0x660d('0x3b')]=[{'all':!![]}];}_0x507148=_[_0x660d('0x41')]({},_0x507148,_0xda1325[_0x660d('0x42')]);return db['CmCompany'][_0x660d('0x43')](_0x507148)[_0x660d('0x1d')](handleEntityNotFound(_0x289eea,null))[_0x660d('0x1d')](respondWithResult(_0x289eea,null))[_0x660d('0x3e')](handleError(_0x289eea,null));};exports[_0x660d('0x44')]=function(_0x57db09,_0x4d4be5){return db['CmCompany'][_0x660d('0x44')](_0x57db09[_0x660d('0x45')],{})[_0x660d('0x1d')](function(_0x39633a){var _0x1dc4a8=_0x57db09['user'][_0x660d('0x46')]({'plain':!![]});if(!_0x1dc4a8)throw new Error(_0x660d('0x47'));if(_0x1dc4a8[_0x660d('0x48')]===_0x660d('0x49')){var _0x4e8618=_0x39633a['get']({'plain':!![]});var _0x41d652=_0x660d('0x1f');return db[_0x660d('0x4a')]['find']({'where':{'name':_0x41d652,'userProfileId':_0x1dc4a8['userProfileId']},'raw':!![]})[_0x660d('0x1d')](function(_0x35edeb){if(_0x35edeb&&_0x35edeb[_0x660d('0x4b')]===0x0){return db['UserProfileResource'][_0x660d('0x44')]({'name':_0x4e8618[_0x660d('0x22')],'resourceId':_0x4e8618['id'],'type':_0x35edeb[_0x660d('0x22')],'sectionId':_0x35edeb['id']},{})[_0x660d('0x1d')](function(){return _0x39633a;});}else{return _0x39633a;}})['catch'](function(_0x434500){logger[_0x660d('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x434500);throw _0x434500;});}return _0x39633a;})[_0x660d('0x1d')](respondWithResult(_0x4d4be5,0xc9))[_0x660d('0x3e')](handleError(_0x4d4be5,null));};exports['update']=function(_0x1fca2d,_0x38b84d){if(_0x1fca2d[_0x660d('0x45')]['id']){delete _0x1fca2d['body']['id'];}return db[_0x660d('0x24')][_0x660d('0x43')]({'where':{'id':_0x1fca2d['params']['id']}})[_0x660d('0x1d')](handleEntityNotFound(_0x38b84d,null))[_0x660d('0x1d')](saveUpdates(_0x1fca2d['body'],null))['then'](respondWithResult(_0x38b84d,null))['catch'](handleError(_0x38b84d,null));};exports[_0x660d('0x1e')]=function(_0x2e7912,_0x15f96a){return db[_0x660d('0x24')][_0x660d('0x43')]({'where':{'id':_0x2e7912[_0x660d('0x40')]['id']}})[_0x660d('0x1d')](handleEntityNotFound(_0x15f96a,null))[_0x660d('0x1d')](removeEntity(_0x15f96a,null))[_0x660d('0x3e')](handleError(_0x15f96a,null));};exports[_0x660d('0x4c')]=function(_0x28f7c7,_0x5b5d03,_0x4b95fa){return db['CmContact'][_0x660d('0x43')]({'where':{'id':_0x28f7c7[_0x660d('0x40')]['id']}})[_0x660d('0x1d')](handleEntityNotFound(_0x5b5d03,null))[_0x660d('0x1d')](function(_0x3561a4){if(_0x3561a4){return _0x3561a4['addContacts'](_0x28f7c7[_0x660d('0x45')]['ids'],_[_0x660d('0x4d')](_0x28f7c7[_0x660d('0x45')],[_0x660d('0x4e'),'id'])||{});}})[_0x660d('0x1d')](respondWithResult(_0x5b5d03,null))['catch'](handleError(_0x5b5d03,null));};exports[_0x660d('0x4f')]=function(_0x38615f,_0xb228ae,_0x397db1){var _0x4a29a4={};var _0x1d44ff={};var _0x110a42;var _0x220530;return db['CmCompany'][_0x660d('0x50')]({'where':{'id':_0x38615f['params']['id']}})[_0x660d('0x1d')](handleEntityNotFound(_0xb228ae,null))[_0x660d('0x1d')](function(_0x43b188){if(_0x43b188){_0x110a42=_0x43b188;_0x1d44ff[_0x660d('0x26')]=_[_0x660d('0x27')](db['CmContact']['rawAttributes']);_0x1d44ff[_0x660d('0x28')]=_[_0x660d('0x27')](_0x38615f[_0x660d('0x28')]);_0x1d44ff[_0x660d('0x29')]=_[_0x660d('0x2b')](_0x1d44ff['model'],_0x1d44ff[_0x660d('0x28')]);_0x4a29a4['attributes']=_[_0x660d('0x2b')](_0x1d44ff['model'],qs[_0x660d('0x2c')](_0x38615f[_0x660d('0x28')][_0x660d('0x2c')]));_0x4a29a4[_0x660d('0x2a')]=_0x4a29a4[_0x660d('0x2a')][_0x660d('0x51')]?_0x4a29a4['attributes']:_0x1d44ff[_0x660d('0x26')];_0x4a29a4[_0x660d('0x30')]=qs[_0x660d('0x31')](_0x38615f[_0x660d('0x28')][_0x660d('0x31')]);_0x4a29a4[_0x660d('0x32')]=qs[_0x660d('0x29')](_['pick'](_0x38615f['query'],_0x1d44ff['filters']));if(_0x38615f['query']['filter']){_0x4a29a4['where']=_[_0x660d('0x41')](_0x4a29a4[_0x660d('0x32')],{'$or':_[_0x660d('0x35')](_0x4a29a4[_0x660d('0x2a')],function(_0x15f0f2){var _0x3535c8={};_0x3535c8[_0x15f0f2]={'$like':'%'+_0x38615f[_0x660d('0x28')]['filter']+'%'};return _0x3535c8;})});}_0x4a29a4=_[_0x660d('0x41')]({},_0x4a29a4,_0x38615f[_0x660d('0x42')]);return _0x110a42[_0x660d('0x4f')](_0x4a29a4);}})['then'](function(_0x21c71a){if(_0x21c71a){_0x220530=_0x21c71a[_0x660d('0x51')];if(!_0x38615f[_0x660d('0x28')]['hasOwnProperty'](_0x660d('0x2e'))){_0x4a29a4[_0x660d('0x2f')]=qs[_0x660d('0x2f')](_0x38615f[_0x660d('0x28')][_0x660d('0x2f')]);_0x4a29a4['offset']=qs[_0x660d('0x18')](_0x38615f[_0x660d('0x28')][_0x660d('0x18')]);}return _0x110a42[_0x660d('0x4f')](_0x4a29a4);}})[_0x660d('0x1d')](function(_0x5e73d9){if(_0x5e73d9){return _0x5e73d9?{'count':_0x220530,'rows':_0x5e73d9}:null;}})[_0x660d('0x1d')](respondWithResult(_0xb228ae,null))[_0x660d('0x3e')](handleError(_0xb228ae,null));}; \ No newline at end of file +var _0x7afb=['create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','CmContact','order','getContacts','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','UserProfileResource','destroy','then','error','index','model','keys','query','intersection','fields','attributes','length','sort','where','filters','pick','filter','merge','map','type','key','options','CmCompany','includeAll','include','findAll','catch','params','rawAttributes','find'];(function(_0x9be28f,_0x231334){var _0xa9f52d=function(_0x239dad){while(--_0x239dad){_0x9be28f['push'](_0x9be28f['shift']());}};_0xa9f52d(++_0x231334);}(_0x7afb,0x153));var _0xb7af=function(_0x29ef8f,_0x469128){_0x29ef8f=_0x29ef8f-0x0;var _0x415acc=_0x7afb[_0x29ef8f];return _0x415acc;};'use strict';var pdf=require(_0xb7af('0x0'));var emlformat=require(_0xb7af('0x1'));var rimraf=require(_0xb7af('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb7af('0x3'));var rp=require(_0xb7af('0x4'));var moment=require(_0xb7af('0x5'));var BPromise=require(_0xb7af('0x6'));var Mustache=require('mustache');var util=require(_0xb7af('0x7'));var path=require(_0xb7af('0x8'));var sox=require(_0xb7af('0x9'));var csv=require(_0xb7af('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb7af('0xb'));var squel=require(_0xb7af('0xc'));var crypto=require(_0xb7af('0xd'));var jsforce=require(_0xb7af('0xe'));var deskjs=require(_0xb7af('0xf'));var toCsv=require(_0xb7af('0xa'));var querystring=require(_0xb7af('0x10'));var Papa=require('papaparse');var authService=require(_0xb7af('0x11'));var hardwareService=require(_0xb7af('0x12'));var Redis=require(_0xb7af('0x13'));var qs=require(_0xb7af('0x14'));var logger=require('../../config/logger')(_0xb7af('0x15'));var utils=require(_0xb7af('0x16'));var config=require(_0xb7af('0x17'));var db=require(_0xb7af('0x18'))['db'];function respondWithStatusCode(_0x529ffc,_0x5bafab){_0x5bafab=_0x5bafab||0xcc;return function(_0x307f52){if(_0x307f52){return _0x529ffc[_0xb7af('0x19')](_0x5bafab);}return _0x529ffc[_0xb7af('0x1a')](_0x5bafab)[_0xb7af('0x1b')]();};}function respondWithResult(_0x5ca7b8,_0x3a1e29){_0x3a1e29=_0x3a1e29||0xc8;return function(_0x1ebea2){if(_0x1ebea2){return _0x5ca7b8[_0xb7af('0x1a')](_0x3a1e29)[_0xb7af('0x1c')](_0x1ebea2);}};}function respondWithFilteredResult(_0xd72093,_0x59d3ad){return function(_0xa8b472){if(_0xa8b472){var _0xe5e550=_0xa8b472[_0xb7af('0x1d')],_0x18d344=_0x59d3ad[_0xb7af('0x1e')],_0x3a9ac3=_0x59d3ad['offset']+_0x59d3ad[_0xb7af('0x1f')],_0x594b8b;if(_0x3a9ac3>=_0xe5e550){_0x3a9ac3=_0xe5e550;_0x594b8b=0xc8;}else{_0x594b8b=0xce;}_0xd72093[_0xb7af('0x1a')](_0x594b8b);return _0xd72093['set'](_0xb7af('0x20'),_0x18d344+'-'+_0x3a9ac3+'/'+_0xe5e550)[_0xb7af('0x1c')](_0xa8b472);}return null;};}function patchUpdates(_0x20abbc){return function(_0xa76021){try{jsonpatch[_0xb7af('0x21')](_0xa76021,_0x20abbc,!![]);}catch(_0x5ba306){return BPromise['reject'](_0x5ba306);}return _0xa76021[_0xb7af('0x22')]();};}function saveUpdates(_0x25c9ad,_0x10d4a8){return function(_0x389d22){if(_0x389d22){return _0x389d22[_0xb7af('0x23')](_0x25c9ad)['then'](function(_0x181db2){return _0x181db2;});}return null;};}function removeEntity(_0x1da35f,_0x4ddb99){return function(_0x516b04){if(_0x516b04){return _0x516b04['destroy']()['then'](function(){var _0x6f804=_0x516b04['get']({'plain':!![]});var _0x430fc5='Companies';return db[_0xb7af('0x24')][_0xb7af('0x25')]({'where':{'type':_0x430fc5,'resourceId':_0x6f804['id']}})[_0xb7af('0x26')](function(){return _0x516b04;});})[_0xb7af('0x26')](function(){_0x1da35f['status'](0xcc)[_0xb7af('0x1b')]();});}};}function handleEntityNotFound(_0x36d1bd,_0x3bf09b){return function(_0x96a847){if(!_0x96a847){_0x36d1bd[_0xb7af('0x19')](0x194);}return _0x96a847;};}function handleError(_0x11d974,_0x48a0b1){_0x48a0b1=_0x48a0b1||0x1f4;return function(_0x54a9e3){logger[_0xb7af('0x27')](_0x54a9e3['stack']);if(_0x54a9e3['name']){delete _0x54a9e3['name'];}_0x11d974[_0xb7af('0x1a')](_0x48a0b1)['send'](_0x54a9e3);};}exports[_0xb7af('0x28')]=function(_0x3c3b20,_0x33f2fa){var _0x247246={},_0x2e77fd={},_0x20e27b={'count':0x0,'rows':[]};var _0x562774=db['CmCompany']['rawAttributes'];_0x2e77fd[_0xb7af('0x29')]=_[_0xb7af('0x2a')](_0x562774);_0x2e77fd[_0xb7af('0x2b')]=_[_0xb7af('0x2a')](_0x3c3b20[_0xb7af('0x2b')]);_0x2e77fd['filters']=_[_0xb7af('0x2c')](_0x2e77fd[_0xb7af('0x29')],_0x2e77fd[_0xb7af('0x2b')]);_0x247246['attributes']=_[_0xb7af('0x2c')](_0x2e77fd[_0xb7af('0x29')],qs[_0xb7af('0x2d')](_0x3c3b20[_0xb7af('0x2b')][_0xb7af('0x2d')]));_0x247246[_0xb7af('0x2e')]=_0x247246['attributes'][_0xb7af('0x2f')]?_0x247246['attributes']:_0x2e77fd[_0xb7af('0x29')];if(!_0x3c3b20[_0xb7af('0x2b')]['hasOwnProperty']('nolimit')){_0x247246[_0xb7af('0x1f')]=qs['limit'](_0x3c3b20[_0xb7af('0x2b')][_0xb7af('0x1f')]);_0x247246[_0xb7af('0x1e')]=qs[_0xb7af('0x1e')](_0x3c3b20[_0xb7af('0x2b')][_0xb7af('0x1e')]);}_0x247246['order']=qs['sort'](_0x3c3b20['query'][_0xb7af('0x30')]);_0x247246[_0xb7af('0x31')]=qs[_0xb7af('0x32')](_[_0xb7af('0x33')](_0x3c3b20['query'],_0x2e77fd[_0xb7af('0x32')]));if(_0x3c3b20['query'][_0xb7af('0x34')]){_0x247246['where']=_[_0xb7af('0x35')](_0x247246[_0xb7af('0x31')],{'$or':_[_0xb7af('0x36')](_0x562774,function(_0x21afb7){if(_0x21afb7[_0xb7af('0x37')][_0xb7af('0x38')]!=='VIRTUAL'){var _0x3188bf={};_0x3188bf[_0x21afb7['field']]={'$like':'%'+_0x3c3b20[_0xb7af('0x2b')]['filter']+'%'};return _0x3188bf;}})});}_0x247246=_[_0xb7af('0x35')]({},_0x247246,_0x3c3b20[_0xb7af('0x39')]);var _0x3ab58a={'where':_0x247246[_0xb7af('0x31')]};return db[_0xb7af('0x3a')][_0xb7af('0x1d')](_0x3ab58a)[_0xb7af('0x26')](function(_0x5cfdca){_0x20e27b[_0xb7af('0x1d')]=_0x5cfdca;if(_0x3c3b20[_0xb7af('0x2b')][_0xb7af('0x3b')]){_0x247246[_0xb7af('0x3c')]=[{'all':!![]}];}return db['CmCompany'][_0xb7af('0x3d')](_0x247246);})[_0xb7af('0x26')](function(_0x38af01){_0x20e27b['rows']=_0x38af01;return _0x20e27b;})[_0xb7af('0x26')](respondWithFilteredResult(_0x33f2fa,_0x247246))[_0xb7af('0x3e')](handleError(_0x33f2fa,null));};exports['show']=function(_0x4f2e64,_0x2e58d0){var _0x285f81={'raw':![],'where':{'id':_0x4f2e64[_0xb7af('0x3f')]['id']}},_0x3ebf3f={};_0x3ebf3f['model']=_[_0xb7af('0x2a')](db['CmCompany'][_0xb7af('0x40')]);_0x3ebf3f['query']=_[_0xb7af('0x2a')](_0x4f2e64[_0xb7af('0x2b')]);_0x3ebf3f[_0xb7af('0x32')]=_[_0xb7af('0x2c')](_0x3ebf3f[_0xb7af('0x29')],_0x3ebf3f[_0xb7af('0x2b')]);_0x285f81[_0xb7af('0x2e')]=_[_0xb7af('0x2c')](_0x3ebf3f[_0xb7af('0x29')],qs['fields'](_0x4f2e64[_0xb7af('0x2b')]['fields']));_0x285f81['attributes']=_0x285f81['attributes'][_0xb7af('0x2f')]?_0x285f81[_0xb7af('0x2e')]:_0x3ebf3f['model'];if(_0x4f2e64[_0xb7af('0x2b')]['includeAll']){_0x285f81['include']=[{'all':!![]}];}_0x285f81=_[_0xb7af('0x35')]({},_0x285f81,_0x4f2e64[_0xb7af('0x39')]);return db[_0xb7af('0x3a')][_0xb7af('0x41')](_0x285f81)[_0xb7af('0x26')](handleEntityNotFound(_0x2e58d0,null))['then'](respondWithResult(_0x2e58d0,null))['catch'](handleError(_0x2e58d0,null));};exports[_0xb7af('0x42')]=function(_0x5716d8,_0x1d4629){return db[_0xb7af('0x3a')][_0xb7af('0x42')](_0x5716d8[_0xb7af('0x43')],{})[_0xb7af('0x26')](function(_0x4e4048){var _0x224412=_0x5716d8[_0xb7af('0x44')][_0xb7af('0x45')]({'plain':!![]});if(!_0x224412)throw new Error(_0xb7af('0x46'));if(_0x224412['role']===_0xb7af('0x44')){var _0x3ce8f0=_0x4e4048[_0xb7af('0x45')]({'plain':!![]});var _0x3cbfd0=_0xb7af('0x47');return db[_0xb7af('0x48')][_0xb7af('0x41')]({'where':{'name':_0x3cbfd0,'userProfileId':_0x224412['userProfileId']},'raw':!![]})[_0xb7af('0x26')](function(_0x20e57f){if(_0x20e57f&&_0x20e57f[_0xb7af('0x49')]===0x0){return db['UserProfileResource'][_0xb7af('0x42')]({'name':_0x3ce8f0[_0xb7af('0x4a')],'resourceId':_0x3ce8f0['id'],'type':_0x20e57f[_0xb7af('0x4a')],'sectionId':_0x20e57f['id']},{})[_0xb7af('0x26')](function(){return _0x4e4048;});}else{return _0x4e4048;}})[_0xb7af('0x3e')](function(_0x2232c5){logger[_0xb7af('0x27')](_0xb7af('0x4b'),_0x2232c5);throw _0x2232c5;});}return _0x4e4048;})[_0xb7af('0x26')](respondWithResult(_0x1d4629,0xc9))[_0xb7af('0x3e')](handleError(_0x1d4629,null));};exports['update']=function(_0x5cbf37,_0x5a46ef){if(_0x5cbf37[_0xb7af('0x43')]['id']){delete _0x5cbf37[_0xb7af('0x43')]['id'];}return db[_0xb7af('0x3a')][_0xb7af('0x41')]({'where':{'id':_0x5cbf37['params']['id']}})['then'](handleEntityNotFound(_0x5a46ef,null))[_0xb7af('0x26')](saveUpdates(_0x5cbf37[_0xb7af('0x43')],null))['then'](respondWithResult(_0x5a46ef,null))['catch'](handleError(_0x5a46ef,null));};exports[_0xb7af('0x25')]=function(_0x635f75,_0x4bc8ea){return db[_0xb7af('0x3a')][_0xb7af('0x41')]({'where':{'id':_0x635f75['params']['id']}})[_0xb7af('0x26')](handleEntityNotFound(_0x4bc8ea,null))[_0xb7af('0x26')](removeEntity(_0x4bc8ea,null))[_0xb7af('0x3e')](handleError(_0x4bc8ea,null));};exports[_0xb7af('0x4c')]=function(_0x4da8d9,_0x19f15a,_0x2eecd5){return db['CmContact']['find']({'where':{'id':_0x4da8d9[_0xb7af('0x3f')]['id']}})[_0xb7af('0x26')](handleEntityNotFound(_0x19f15a,null))['then'](function(_0x19bddf){if(_0x19bddf){return _0x19bddf[_0xb7af('0x4c')](_0x4da8d9[_0xb7af('0x43')][_0xb7af('0x4d')],_['omit'](_0x4da8d9[_0xb7af('0x43')],[_0xb7af('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x19f15a,null))['catch'](handleError(_0x19f15a,null));};exports['getContacts']=function(_0x4bb930,_0x5440c5,_0x2712cd){var _0x2f9b68={};var _0x59a8a1={};var _0x280081;var _0x2c1650;return db[_0xb7af('0x3a')]['findOne']({'where':{'id':_0x4bb930['params']['id']}})[_0xb7af('0x26')](handleEntityNotFound(_0x5440c5,null))[_0xb7af('0x26')](function(_0x474c09){if(_0x474c09){_0x280081=_0x474c09;_0x59a8a1[_0xb7af('0x29')]=_[_0xb7af('0x2a')](db[_0xb7af('0x4e')][_0xb7af('0x40')]);_0x59a8a1[_0xb7af('0x2b')]=_['keys'](_0x4bb930['query']);_0x59a8a1['filters']=_[_0xb7af('0x2c')](_0x59a8a1['model'],_0x59a8a1[_0xb7af('0x2b')]);_0x2f9b68['attributes']=_[_0xb7af('0x2c')](_0x59a8a1[_0xb7af('0x29')],qs[_0xb7af('0x2d')](_0x4bb930['query'][_0xb7af('0x2d')]));_0x2f9b68['attributes']=_0x2f9b68[_0xb7af('0x2e')][_0xb7af('0x2f')]?_0x2f9b68[_0xb7af('0x2e')]:_0x59a8a1[_0xb7af('0x29')];_0x2f9b68[_0xb7af('0x4f')]=qs[_0xb7af('0x30')](_0x4bb930['query'][_0xb7af('0x30')]);_0x2f9b68['where']=qs[_0xb7af('0x32')](_['pick'](_0x4bb930[_0xb7af('0x2b')],_0x59a8a1['filters']));if(_0x4bb930[_0xb7af('0x2b')][_0xb7af('0x34')]){_0x2f9b68['where']=_[_0xb7af('0x35')](_0x2f9b68[_0xb7af('0x31')],{'$or':_['map'](_0x2f9b68[_0xb7af('0x2e')],function(_0x2a0d1c){var _0x1d8724={};_0x1d8724[_0x2a0d1c]={'$like':'%'+_0x4bb930['query']['filter']+'%'};return _0x1d8724;})});}_0x2f9b68=_[_0xb7af('0x35')]({},_0x2f9b68,_0x4bb930['options']);return _0x280081[_0xb7af('0x50')](_0x2f9b68);}})['then'](function(_0x50a8bf){if(_0x50a8bf){_0x2c1650=_0x50a8bf[_0xb7af('0x2f')];if(!_0x4bb930[_0xb7af('0x2b')]['hasOwnProperty']('nolimit')){_0x2f9b68[_0xb7af('0x1f')]=qs[_0xb7af('0x1f')](_0x4bb930['query']['limit']);_0x2f9b68[_0xb7af('0x1e')]=qs['offset'](_0x4bb930[_0xb7af('0x2b')]['offset']);}return _0x280081[_0xb7af('0x50')](_0x2f9b68);}})[_0xb7af('0x26')](function(_0x48c86e){if(_0x48c86e){return _0x48c86e?{'count':_0x2c1650,'rows':_0x48c86e}:null;}})[_0xb7af('0x26')](respondWithResult(_0x5440c5,null))['catch'](handleError(_0x5440c5,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index e9b593e..488118b 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 _0x7794=['moment','request-promise','./cmCompany.attributes','cm_companies','util','../../config/logger','api'];(function(_0x3cd5d0,_0x6eab1b){var _0x1f5286=function(_0x616c70){while(--_0x616c70){_0x3cd5d0['push'](_0x3cd5d0['shift']());}};_0x1f5286(++_0x6eab1b);}(_0x7794,0x7b));var _0x4779=function(_0x685774,_0x15ffaf){_0x685774=_0x685774-0x0;var _0x348e41=_0x7794[_0x685774];return _0x348e41;};'use strict';var _=require('lodash');var util=require(_0x4779('0x0'));var logger=require(_0x4779('0x1'))(_0x4779('0x2'));var moment=require(_0x4779('0x3'));var BPromise=require('bluebird');var rp=require(_0x4779('0x4'));var attributes=require(_0x4779('0x5'));module['exports']=function(_0x40e5f9,_0x54dc7f){return _0x40e5f9['define']('CmCompany',attributes,{'tableName':_0x4779('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa588=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x37e886,_0x17d0ad){var _0x57c5cd=function(_0x2692a3){while(--_0x2692a3){_0x37e886['push'](_0x37e886['shift']());}};_0x57c5cd(++_0x17d0ad);}(_0xa588,0xe1));var _0x8a58=function(_0x311fc0,_0x2c64f0){_0x311fc0=_0x311fc0-0x0;var _0xce2976=_0xa588[_0x311fc0];return _0xce2976;};'use strict';var _=require('lodash');var util=require(_0x8a58('0x0'));var logger=require(_0x8a58('0x1'))(_0x8a58('0x2'));var moment=require(_0x8a58('0x3'));var BPromise=require(_0x8a58('0x4'));var rp=require(_0x8a58('0x5'));var attributes=require(_0x8a58('0x6'));module[_0x8a58('0x7')]=function(_0x40b4f0,_0x499c17){return _0x40b4f0[_0x8a58('0x8')](_0x8a58('0x9'),attributes,{'tableName':_0x8a58('0xa'),'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 2e57de5..dd5de10 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 _0x56fa=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x2ddb6d,_0x25d45b){var _0x56c103=function(_0x4f73c4){while(--_0x4f73c4){_0x2ddb6d['push'](_0x2ddb6d['shift']());}};_0x56c103(++_0x25d45b);}(_0x56fa,0xca));var _0xa56f=function(_0x182fa4,_0x4729b1){_0x182fa4=_0x182fa4-0x0;var _0x17c38b=_0x56fa[_0x182fa4];return _0x17c38b;};'use strict';var _=require('lodash');var util=require(_0xa56f('0x0'));var moment=require(_0xa56f('0x1'));var BPromise=require(_0xa56f('0x2'));var rs=require(_0xa56f('0x3'));var fs=require('fs');var Redis=require(_0xa56f('0x4'));var db=require(_0xa56f('0x5'))['db'];var utils=require(_0xa56f('0x6'));var logger=require('../../config/logger')(_0xa56f('0x7'));var config=require(_0xa56f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa56f('0x9')][_0xa56f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c16b5,_0x35b334,_0x17913b){return new BPromise(function(_0x47c1ad,_0xc4971){return client[_0xa56f('0xb')](_0x2c16b5,_0x17913b)[_0xa56f('0xc')](function(_0x54d3de){logger['info'](_0xa56f('0xd'),_0x35b334,_0xa56f('0xe'));logger[_0xa56f('0xf')](_0xa56f('0x10'),_0x35b334,_0xa56f('0xe'),JSON[_0xa56f('0x11')](_0x54d3de));if(_0x54d3de[_0xa56f('0x12')]){if(_0x54d3de['error'][_0xa56f('0x13')]===0x1f4){logger[_0xa56f('0x12')](_0xa56f('0xd'),_0x35b334,_0x54d3de['error']['message']);return _0xc4971(_0x54d3de[_0xa56f('0x12')][_0xa56f('0x14')]);}logger[_0xa56f('0x12')]('CmCompany,\x20%s,\x20%s',_0x35b334,_0x54d3de[_0xa56f('0x12')][_0xa56f('0x14')]);return _0x47c1ad(_0x54d3de[_0xa56f('0x12')][_0xa56f('0x14')]);}else{logger[_0xa56f('0x15')](_0xa56f('0xd'),_0x35b334,'request\x20sent');_0x47c1ad(_0x54d3de['result']['message']);}})[_0xa56f('0x16')](function(_0x2a3f13){logger['error']('CmCompany,\x20%s,\x20%s',_0x35b334,_0x2a3f13);_0xc4971(_0x2a3f13);});});} \ No newline at end of file +var _0x32cb=['info','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message'];(function(_0x293ef4,_0x56d1b2){var _0x4871da=function(_0x2c0cad){while(--_0x2c0cad){_0x293ef4['push'](_0x293ef4['shift']());}};_0x4871da(++_0x56d1b2);}(_0x32cb,0xd2));var _0xb32c=function(_0x2d9d48,_0x1708e5){_0x2d9d48=_0x2d9d48-0x0;var _0x503559=_0x32cb[_0x2d9d48];return _0x503559;};'use strict';var _=require(_0xb32c('0x0'));var util=require(_0xb32c('0x1'));var moment=require('moment');var BPromise=require(_0xb32c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb32c('0x3'))['db'];var utils=require(_0xb32c('0x4'));var logger=require(_0xb32c('0x5'))(_0xb32c('0x6'));var config=require(_0xb32c('0x7'));var jayson=require(_0xb32c('0x8'));var client=jayson[_0xb32c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x350bde,_0x2d74b5,_0x213a7e){return new BPromise(function(_0x541056,_0x554d0f){return client[_0xb32c('0xa')](_0x350bde,_0x213a7e)[_0xb32c('0xb')](function(_0x3287a2){logger['info']('CmCompany,\x20%s,\x20%s',_0x2d74b5,_0xb32c('0xc'));logger[_0xb32c('0xd')](_0xb32c('0xe'),_0x2d74b5,_0xb32c('0xc'),JSON[_0xb32c('0xf')](_0x3287a2));if(_0x3287a2[_0xb32c('0x10')]){if(_0x3287a2[_0xb32c('0x10')][_0xb32c('0x11')]===0x1f4){logger[_0xb32c('0x10')](_0xb32c('0x12'),_0x2d74b5,_0x3287a2[_0xb32c('0x10')][_0xb32c('0x13')]);return _0x554d0f(_0x3287a2[_0xb32c('0x10')][_0xb32c('0x13')]);}logger[_0xb32c('0x10')](_0xb32c('0x12'),_0x2d74b5,_0x3287a2['error'][_0xb32c('0x13')]);return _0x541056(_0x3287a2[_0xb32c('0x10')][_0xb32c('0x13')]);}else{logger[_0xb32c('0x14')](_0xb32c('0x12'),_0x2d74b5,'request\x20sent');_0x541056(_0x3287a2[_0xb32c('0x15')]['message']);}})[_0xb32c('0x16')](function(_0x145a7d){logger[_0xb32c('0x10')](_0xb32c('0x12'),_0x2d74b5,_0x145a7d);_0x554d0f(_0x145a7d);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index c63a64f..00fad35 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 _0x633e=['post','create','/:id/contacts','addContacts','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/:id','show','getContacts'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x633e,0x197));var _0xe633=function(_0x4455e6,_0x484c95){_0x4455e6=_0x4455e6-0x0;var _0x5f2640=_0x633e[_0x4455e6];return _0x5f2640;};'use strict';var multer=require(_0xe633('0x0'));var util=require(_0xe633('0x1'));var path=require(_0xe633('0x2'));var timeout=require('connect-timeout');var express=require(_0xe633('0x3'));var router=express['Router']();var auth=require(_0xe633('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe633('0x5'));var controller=require(_0xe633('0x6'));router['get']('/',auth[_0xe633('0x7')](),controller[_0xe633('0x8')]);router[_0xe633('0x9')](_0xe633('0xa'),auth[_0xe633('0x7')](),controller[_0xe633('0xb')]);router['get']('/:id/contacts',auth[_0xe633('0x7')](),controller[_0xe633('0xc')]);router[_0xe633('0xd')]('/',auth['isAuthenticated'](),controller[_0xe633('0xe')]);router['post'](_0xe633('0xf'),auth[_0xe633('0x7')](),controller[_0xe633('0x10')]);router['put'](_0xe633('0xa'),auth[_0xe633('0x7')](),controller[_0xe633('0x11')]);router[_0xe633('0x12')](_0xe633('0xa'),auth[_0xe633('0x7')](),controller[_0xe633('0x13')]);module[_0xe633('0x14')]=router; \ No newline at end of file +var _0xa89a=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/:id','getContacts','post','create','/:id/contacts','addContacts','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x5d6383,_0x24063e){var _0x466028=function(_0x5e3eb8){while(--_0x5e3eb8){_0x5d6383['push'](_0x5d6383['shift']());}};_0x466028(++_0x24063e);}(_0xa89a,0x1a0));var _0xaa89=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xa89a[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0xaa89('0x0'));var util=require(_0xaa89('0x1'));var path=require(_0xaa89('0x2'));var timeout=require(_0xaa89('0x3'));var express=require(_0xaa89('0x4'));var router=express['Router']();var auth=require(_0xaa89('0x5'));var interaction=require(_0xaa89('0x6'));var config=require(_0xaa89('0x7'));var controller=require(_0xaa89('0x8'));router[_0xaa89('0x9')]('/',auth[_0xaa89('0xa')](),controller['index']);router[_0xaa89('0x9')](_0xaa89('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xaa89('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xaa89('0xc')]);router[_0xaa89('0xd')]('/',auth[_0xaa89('0xa')](),controller[_0xaa89('0xe')]);router[_0xaa89('0xd')](_0xaa89('0xf'),auth[_0xaa89('0xa')](),controller[_0xaa89('0x10')]);router['put']('/:id',auth[_0xaa89('0xa')](),controller[_0xaa89('0x11')]);router[_0xaa89('0x12')]('/:id',auth[_0xaa89('0xa')](),controller[_0xaa89('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 7c62ee8..3148dae 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 _0x4b25=['DATE','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b25,0x1ba));var _0x54b2=function(_0x20f81e,_0x150172){_0x20f81e=_0x20f81e-0x0;var _0x48f65b=_0x4b25[_0x20f81e];return _0x48f65b;};'use strict';var _=require(_0x54b2('0x0'));var Sequelize=require(_0x54b2('0x1'));module[_0x54b2('0x2')]={'firstName':{'type':Sequelize[_0x54b2('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x54b2('0x3')]},'street':{'type':Sequelize[_0x54b2('0x3')]},'postalCode':{'type':Sequelize[_0x54b2('0x3')]},'city':{'type':Sequelize[_0x54b2('0x3')]},'country':{'type':Sequelize[_0x54b2('0x3')]},'dateOfBirth':{'type':Sequelize[_0x54b2('0x3')]},'description':{'type':Sequelize[_0x54b2('0x4')]},'phone':{'type':Sequelize[_0x54b2('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x54b2('0x3')]},'url':{'type':Sequelize[_0x54b2('0x3')]},'facebook':{'type':Sequelize[_0x54b2('0x3')]},'fb_data':{'type':Sequelize[_0x54b2('0x3')]},'twitter':{'type':Sequelize[_0x54b2('0x3')]},'skype':{'type':Sequelize[_0x54b2('0x3')]},'teams':{'type':Sequelize[_0x54b2('0x3')]},'viber':{'type':Sequelize[_0x54b2('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x54b2('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x54b2('0x5')]},'priority':{'type':Sequelize[_0x54b2('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x54b2('0x6')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x5ab1=['lodash','sequelize','exports','STRING','TEXT','INTEGER','DATE','NOW'];(function(_0x557829,_0x215e78){var _0x10067e=function(_0x586d00){while(--_0x586d00){_0x557829['push'](_0x557829['shift']());}};_0x10067e(++_0x215e78);}(_0x5ab1,0x148));var _0x15ab=function(_0x3c2813,_0x1f4f35){_0x3c2813=_0x3c2813-0x0;var _0x51a797=_0x5ab1[_0x3c2813];return _0x51a797;};'use strict';var _=require(_0x15ab('0x0'));var Sequelize=require(_0x15ab('0x1'));module[_0x15ab('0x2')]={'firstName':{'type':Sequelize[_0x15ab('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x15ab('0x3')]},'street':{'type':Sequelize[_0x15ab('0x3')]},'postalCode':{'type':Sequelize[_0x15ab('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x15ab('0x3')]},'description':{'type':Sequelize[_0x15ab('0x4')]},'phone':{'type':Sequelize[_0x15ab('0x3')]},'mobile':{'type':Sequelize[_0x15ab('0x3')]},'fax':{'type':Sequelize[_0x15ab('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x15ab('0x3')]},'twitter':{'type':Sequelize[_0x15ab('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x15ab('0x3')]},'viber':{'type':Sequelize[_0x15ab('0x3')]},'line':{'type':Sequelize[_0x15ab('0x3')]},'wechat':{'type':Sequelize[_0x15ab('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x15ab('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x15ab('0x6')],'defaultValue':Sequelize[_0x15ab('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 6b2ed90..d822160 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 _0x4bcd=['keys','startsWith','cf_','columnName','displayName','alias','hasOwnProperty','body','get','mergeWith','isArray','tags','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','info','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','create','join','bulkCreate','each','duplicates','$or','ListId','findOrCreate','spread','show','params','CmCustomField','omit','map','format','cf_%d','$and','pickBy','isEmpty','cm_contacts','setFields','toParam','sequelize','text','values','getTags','findOne','rawAttributes','setTags','ids','getHoppers','ContactId','getHopperHistories','getHopperFinals','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','phone','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','filename','chmodSync','0777','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','parse','file','meta','import','agent','binding','No\x20firstName\x20column\x20specified','child_process','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','describe','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','where','filter','options','include','tag','push','Tag','Tags','distinct','count','includeAll','name','color','ThroughTags','CmContact','findAll','rows','catch','find'];(function(_0x42a9e0,_0x2348d9){var _0x289c87=function(_0x8649ab){while(--_0x8649ab){_0x42a9e0['push'](_0x42a9e0['shift']());}};_0x289c87(++_0x2348d9);}(_0x4bcd,0x1e0));var _0xd4bc=function(_0x4a25f3,_0x130fbd){_0x4a25f3=_0x4a25f3-0x0;var _0x2164d1=_0x4bcd[_0x4a25f3];return _0x2164d1;};'use strict';var pdf=require(_0xd4bc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd4bc('0x1'));var zipdir=require(_0xd4bc('0x2'));var jsonpatch=require(_0xd4bc('0x3'));var rp=require(_0xd4bc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd4bc('0x5'));var util=require(_0xd4bc('0x6'));var path=require('path');var sox=require(_0xd4bc('0x7'));var csv=require(_0xd4bc('0x8'));var ejs=require(_0xd4bc('0x9'));var fs=require('fs');var _=require(_0xd4bc('0xa'));var squel=require('squel');var crypto=require(_0xd4bc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd4bc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd4bc('0xd'));var Papa=require(_0xd4bc('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xd4bc('0xf'));var Redis=require(_0xd4bc('0x10'));var qs=require(_0xd4bc('0x11'));var logger=require('../../config/logger')(_0xd4bc('0x12'));var utils=require(_0xd4bc('0x13'));var config=require(_0xd4bc('0x14'));var db=require(_0xd4bc('0x15'))['db'];config[_0xd4bc('0x16')]=_[_0xd4bc('0x17')](config['redis'],{'host':_0xd4bc('0x18'),'port':0x18eb});var socket=require(_0xd4bc('0x19'))(new Redis(config['redis']));require(_0xd4bc('0x1a'))['register'](socket);function respondWithStatusCode(_0x2f2364,_0x3f5b40){_0x3f5b40=_0x3f5b40||0xcc;return function(_0x4818b0){if(_0x4818b0){return _0x2f2364[_0xd4bc('0x1b')](_0x3f5b40);}return _0x2f2364[_0xd4bc('0x1c')](_0x3f5b40)[_0xd4bc('0x1d')]();};}function respondWithResult(_0x5c2e61,_0x41c5cc){_0x41c5cc=_0x41c5cc||0xc8;return function(_0x58fc15){if(_0x58fc15){return _0x5c2e61[_0xd4bc('0x1c')](_0x41c5cc)[_0xd4bc('0x1e')](_0x58fc15);}};}function respondWithFilteredResult(_0xc976bb,_0x4275d5){return function(_0x470425){if(_0x470425){var _0x485b89=_0x470425['count'],_0x5956d4=_0x4275d5[_0xd4bc('0x1f')],_0x4257bf=_0x4275d5[_0xd4bc('0x1f')]+_0x4275d5[_0xd4bc('0x20')],_0x2f24c5;if(_0x4257bf>=_0x485b89){_0x4257bf=_0x485b89;_0x2f24c5=0xc8;}else{_0x2f24c5=0xce;}_0xc976bb['status'](_0x2f24c5);return _0xc976bb['set'](_0xd4bc('0x21'),_0x5956d4+'-'+_0x4257bf+'/'+_0x485b89)[_0xd4bc('0x1e')](_0x470425);}return null;};}function patchUpdates(_0x28c7ff){return function(_0x5f14d2){try{jsonpatch[_0xd4bc('0x22')](_0x5f14d2,_0x28c7ff,!![]);}catch(_0xe641a3){return BPromise[_0xd4bc('0x23')](_0xe641a3);}return _0x5f14d2[_0xd4bc('0x24')]();};}function saveUpdates(_0x3ef1c0,_0x3a8e65){return function(_0x3f8197){if(_0x3f8197){return _0x3f8197[_0xd4bc('0x25')](_0x3ef1c0)[_0xd4bc('0x26')](function(_0x360150){return _0x360150;});}return null;};}function removeEntity(_0x55152e,_0x6b031e){return function(_0xbbccc4){if(_0xbbccc4){return _0xbbccc4[_0xd4bc('0x27')]()['then'](function(){_0x55152e[_0xd4bc('0x1c')](0xcc)[_0xd4bc('0x1d')]();});}};}function handleEntityNotFound(_0x2ec12c,_0x2f0b0e){return function(_0x3dd439){if(!_0x3dd439){_0x2ec12c['sendStatus'](0x194);}return _0x3dd439;};}function handleError(_0x21130a,_0x4e2805){_0x4e2805=_0x4e2805||0x1f4;return function(_0x211a02){logger['error'](_0x211a02[_0xd4bc('0x28')]);if(_0x211a02['name']){delete _0x211a02['name'];}_0x21130a[_0xd4bc('0x1c')](_0x4e2805)[_0xd4bc('0x29')](_0x211a02);};}exports[_0xd4bc('0x2a')]=function(_0xe6cdb7,_0x2113f6){var _0x39f696={},_0x184afe={},_0x53bc36={'count':0x0,'rows':[]};return db['CmContact'][_0xd4bc('0x2b')]()[_0xd4bc('0x26')](function(_0x3d80a2){_0x184afe[_0xd4bc('0x2c')]=_['keys'](_0x3d80a2);_0x184afe[_0xd4bc('0x2d')]=_['keys'](_0xe6cdb7[_0xd4bc('0x2d')]);_0x184afe[_0xd4bc('0x2e')]=_[_0xd4bc('0x2f')](_0x184afe[_0xd4bc('0x2c')],_0x184afe[_0xd4bc('0x2d')]);_0x39f696[_0xd4bc('0x30')]=_['intersection'](_0x184afe[_0xd4bc('0x2c')],qs[_0xd4bc('0x31')](_0xe6cdb7['query'][_0xd4bc('0x31')]));_0x39f696[_0xd4bc('0x30')]=_0x39f696[_0xd4bc('0x30')][_0xd4bc('0x32')]?_0x39f696[_0xd4bc('0x30')]:_0x184afe['model'];if(!_0xe6cdb7['query']['hasOwnProperty'](_0xd4bc('0x33'))){_0x39f696[_0xd4bc('0x20')]=qs[_0xd4bc('0x20')](_0xe6cdb7[_0xd4bc('0x2d')][_0xd4bc('0x20')]);_0x39f696[_0xd4bc('0x1f')]=qs['offset'](_0xe6cdb7[_0xd4bc('0x2d')][_0xd4bc('0x1f')]);}_0x39f696[_0xd4bc('0x34')]=qs[_0xd4bc('0x35')](_0xe6cdb7['query'][_0xd4bc('0x35')]);_0x39f696['where']=qs[_0xd4bc('0x2e')](_[_0xd4bc('0x36')](_0xe6cdb7[_0xd4bc('0x2d')],_0x184afe[_0xd4bc('0x2e')]));if(_0xe6cdb7[_0xd4bc('0x2d')]['filter']){_0x39f696['where']=_[_0xd4bc('0x37')](_0x39f696[_0xd4bc('0x38')],{'$or':_['map'](_0x39f696[_0xd4bc('0x30')],function(_0x435a2f){var _0x336ba5={};_0x336ba5[_0x435a2f]={'$like':'%'+_0xe6cdb7[_0xd4bc('0x2d')][_0xd4bc('0x39')]+'%'};return _0x336ba5;})});}_0x39f696=_[_0xd4bc('0x37')]({},_0x39f696,_0xe6cdb7[_0xd4bc('0x3a')]);var _0x37b3ef={'where':_0x39f696['where']};_0x37b3ef[_0xd4bc('0x3b')]=[];if(_0xe6cdb7[_0xd4bc('0x2d')][_0xd4bc('0x3c')]){_0x37b3ef[_0xd4bc('0x3b')][_0xd4bc('0x3d')]({'model':db[_0xd4bc('0x3e')],'as':_0xd4bc('0x3f'),'attributes':['id'],'where':{'id':_0xe6cdb7[_0xd4bc('0x2d')][_0xd4bc('0x3c')]},'required':!![]});_0x37b3ef[_0xd4bc('0x40')]=!![];}return db['CmContact'][_0xd4bc('0x41')](_0x37b3ef)[_0xd4bc('0x26')](function(_0xc01aa7){_0x53bc36['count']=_0xc01aa7;if(_0xe6cdb7[_0xd4bc('0x2d')][_0xd4bc('0x42')]){_0x39f696[_0xd4bc('0x3b')]=[{'model':db['Tag'],'as':_0xd4bc('0x3f'),'attributes':['id',_0xd4bc('0x43'),_0xd4bc('0x44')],'required':_0xe6cdb7['query']['tag']?!![]:![]},{'model':db[_0xd4bc('0x3e')],'as':_0xd4bc('0x45'),'attributes':['id',_0xd4bc('0x43'),'color'],'through':_0xe6cdb7[_0xd4bc('0x2d')][_0xd4bc('0x3c')]?{'attributes':[],'where':{'TagId':_0xe6cdb7[_0xd4bc('0x2d')][_0xd4bc('0x3c')]||undefined}}:{},'required':_0xe6cdb7['query']['tag']?!![]:![]}];}return db[_0xd4bc('0x46')][_0xd4bc('0x47')](_0x39f696);})[_0xd4bc('0x26')](function(_0x3e1af4){_0x53bc36[_0xd4bc('0x48')]=_0x3e1af4;return _0x53bc36;})[_0xd4bc('0x26')](respondWithFilteredResult(_0x2113f6,_0x39f696))[_0xd4bc('0x49')](handleError(_0x2113f6,null));});};exports[_0xd4bc('0x27')]=function(_0x56f542,_0x107d35){return db[_0xd4bc('0x46')][_0xd4bc('0x4a')]({'where':{'id':_0x56f542['params']['id']}})['then'](handleEntityNotFound(_0x107d35,null))[_0xd4bc('0x26')](removeEntity(_0x107d35,null))['catch'](handleError(_0x107d35,null));};exports[_0xd4bc('0x2b')]=function(_0x2ce48c,_0x1c0925){return db['CmContact']['describe']()[_0xd4bc('0x26')](function(_0x149d49){for(var _0x4b4a9a=0x0;_0x4b4a9a=_0x2cc2b1){_0x422b39=_0x2cc2b1;_0x525602=0xc8;}else{_0x525602=0xce;}_0x1fa618[_0xe8e3('0x1f')](_0x525602);return _0x1fa618['set']('Content-Range',_0x575b92+'-'+_0x422b39+'/'+_0x2cc2b1)[_0xe8e3('0x21')](_0x3c0c73);}return null;};}function patchUpdates(_0x4a9a97){return function(_0xf158ec){try{jsonpatch[_0xe8e3('0x23')](_0xf158ec,_0x4a9a97,!![]);}catch(_0x65744e){return BPromise[_0xe8e3('0x24')](_0x65744e);}return _0xf158ec['save']();};}function saveUpdates(_0xeee8de,_0x5982cf){return function(_0x24c4b7){if(_0x24c4b7){return _0x24c4b7[_0xe8e3('0x25')](_0xeee8de)['then'](function(_0x47bbb9){return _0x47bbb9;});}return null;};}function removeEntity(_0x452106,_0x1ddf35){return function(_0x58451f){if(_0x58451f){return _0x58451f[_0xe8e3('0x26')]()['then'](function(){_0x452106['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d199a,_0x8e207b){return function(_0xe3680f){if(!_0xe3680f){_0x1d199a['sendStatus'](0x194);}return _0xe3680f;};}function handleError(_0x2f1319,_0x370e53){_0x370e53=_0x370e53||0x1f4;return function(_0x31de59){logger[_0xe8e3('0x27')](_0x31de59[_0xe8e3('0x28')]);if(_0x31de59[_0xe8e3('0x29')]){delete _0x31de59[_0xe8e3('0x29')];}_0x2f1319[_0xe8e3('0x1f')](_0x370e53)[_0xe8e3('0x2a')](_0x31de59);};}exports[_0xe8e3('0x2b')]=function(_0x4e8d2a,_0x355f1b){var _0x56e355={},_0x37c6df={},_0x416dc6={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0xe8e3('0x2c')](function(_0x2f1744){_0x37c6df[_0xe8e3('0x2d')]=_[_0xe8e3('0x2e')](_0x2f1744);_0x37c6df[_0xe8e3('0x2f')]=_[_0xe8e3('0x2e')](_0x4e8d2a['query']);_0x37c6df[_0xe8e3('0x30')]=_[_0xe8e3('0x31')](_0x37c6df[_0xe8e3('0x2d')],_0x37c6df[_0xe8e3('0x2f')]);_0x56e355['attributes']=_['intersection'](_0x37c6df[_0xe8e3('0x2d')],qs['fields'](_0x4e8d2a[_0xe8e3('0x2f')][_0xe8e3('0x32')]));_0x56e355[_0xe8e3('0x33')]=_0x56e355[_0xe8e3('0x33')][_0xe8e3('0x34')]?_0x56e355[_0xe8e3('0x33')]:_0x37c6df['model'];if(!_0x4e8d2a[_0xe8e3('0x2f')][_0xe8e3('0x35')](_0xe8e3('0x36'))){_0x56e355['limit']=qs[_0xe8e3('0x37')](_0x4e8d2a['query'][_0xe8e3('0x37')]);_0x56e355['offset']=qs[_0xe8e3('0x22')](_0x4e8d2a[_0xe8e3('0x2f')][_0xe8e3('0x22')]);}_0x56e355[_0xe8e3('0x38')]=qs['sort'](_0x4e8d2a[_0xe8e3('0x2f')][_0xe8e3('0x39')]);_0x56e355[_0xe8e3('0x3a')]=qs['filters'](_[_0xe8e3('0x3b')](_0x4e8d2a['query'],_0x37c6df[_0xe8e3('0x30')]));if(_0x4e8d2a['query'][_0xe8e3('0x3c')]){_0x56e355[_0xe8e3('0x3a')]=_[_0xe8e3('0x3d')](_0x56e355[_0xe8e3('0x3a')],{'$or':_[_0xe8e3('0x3e')](_0x56e355[_0xe8e3('0x33')],function(_0x558307){var _0x2eeff6={};_0x2eeff6[_0x558307]={'$like':'%'+_0x4e8d2a[_0xe8e3('0x2f')][_0xe8e3('0x3c')]+'%'};return _0x2eeff6;})});}_0x56e355=_['merge']({},_0x56e355,_0x4e8d2a['options']);var _0x4b74d3={'where':_0x56e355['where']};_0x4b74d3['include']=[];if(_0x4e8d2a[_0xe8e3('0x2f')][_0xe8e3('0x3f')]){_0x4b74d3[_0xe8e3('0x40')][_0xe8e3('0x41')]({'model':db[_0xe8e3('0x42')],'as':_0xe8e3('0x43'),'attributes':['id'],'where':{'id':_0x4e8d2a[_0xe8e3('0x2f')]['tag']},'required':!![]});_0x4b74d3['distinct']=!![];}return db[_0xe8e3('0x44')][_0xe8e3('0x45')](_0x4b74d3)[_0xe8e3('0x2c')](function(_0x73cdaf){_0x416dc6[_0xe8e3('0x45')]=_0x73cdaf;if(_0x4e8d2a[_0xe8e3('0x2f')]['includeAll']){_0x56e355[_0xe8e3('0x40')]=[{'model':db[_0xe8e3('0x42')],'as':_0xe8e3('0x43'),'attributes':['id',_0xe8e3('0x29'),_0xe8e3('0x46')],'required':_0x4e8d2a[_0xe8e3('0x2f')][_0xe8e3('0x3f')]?!![]:![]},{'model':db[_0xe8e3('0x42')],'as':_0xe8e3('0x47'),'attributes':['id',_0xe8e3('0x29'),_0xe8e3('0x46')],'through':_0x4e8d2a[_0xe8e3('0x2f')][_0xe8e3('0x3f')]?{'attributes':[],'where':{'TagId':_0x4e8d2a['query'][_0xe8e3('0x3f')]||undefined}}:{},'required':_0x4e8d2a[_0xe8e3('0x2f')][_0xe8e3('0x3f')]?!![]:![]}];}return db[_0xe8e3('0x44')]['findAll'](_0x56e355);})[_0xe8e3('0x2c')](function(_0x18f5b1){_0x416dc6[_0xe8e3('0x48')]=_0x18f5b1;return _0x416dc6;})[_0xe8e3('0x2c')](respondWithFilteredResult(_0x355f1b,_0x56e355))[_0xe8e3('0x49')](handleError(_0x355f1b,null));});};exports[_0xe8e3('0x26')]=function(_0x107878,_0x4a55ea){return db[_0xe8e3('0x44')][_0xe8e3('0x4a')]({'where':{'id':_0x107878[_0xe8e3('0x4b')]['id']}})[_0xe8e3('0x2c')](handleEntityNotFound(_0x4a55ea,null))['then'](removeEntity(_0x4a55ea,null))[_0xe8e3('0x49')](handleError(_0x4a55ea,null));};exports[_0xe8e3('0x4c')]=function(_0x5c9770,_0x315160){return db[_0xe8e3('0x44')][_0xe8e3('0x4c')]()[_0xe8e3('0x2c')](function(_0x103964){for(var _0x3bd5f8=0x0;_0x3bd5f8{}\s\\|]/g,'-');_0x576acd(null,util['format'](_0x555a('0x22'),path[_0x555a('0x23')](_0x1a4a40['originalname'],path[_0x555a('0x24')](_0x1a4a40[_0x555a('0x20')])),Date[_0x555a('0x25')](),path[_0x555a('0x24')](_0x1a4a40[_0x555a('0x20')])));}})});router[_0x555a('0x17')](_0x555a('0x26'),upload[_0x555a('0x27')]('file'),controller[_0x555a('0x28')]);var upload=multer({'storage':multer[_0x555a('0x29')]({'destination':function(_0x4491a5,_0x2b84a2,_0x10e884){_0x10e884(null,path[_0x555a('0x1d')](config['root'],'server/files/tmp'));},'filename':function(_0x41ecd4,_0x2dab06,_0x40998d){_0x2dab06[_0x555a('0x20')]=_0x2dab06[_0x555a('0x20')][_0x555a('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x40998d(null,util['format']('%s-%s%s',path[_0x555a('0x23')](_0x2dab06[_0x555a('0x20')],path[_0x555a('0x24')](_0x2dab06[_0x555a('0x20')])),Date[_0x555a('0x25')](),path[_0x555a('0x24')](_0x2dab06[_0x555a('0x20')])));}})});router[_0x555a('0x17')](_0x555a('0x2a'),upload[_0x555a('0x27')](_0x555a('0x2b')),controller['upload']);router['post']('/upload/:id',auth[_0x555a('0xa')](),controller[_0x555a('0x2c')]);router['put']('/:id',auth[_0x555a('0xa')](),controller[_0x555a('0x2d')]);router[_0x555a('0x2e')](_0x555a('0xe'),auth['isAuthenticated'](),controller[_0x555a('0x2f')]);module[_0x555a('0x30')]=router; \ No newline at end of file +var _0x3a25=['/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','/create_many','bulkCreate','setTags','diskStorage','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','file','upload','import','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/tags','getTags'];(function(_0xa78dfb,_0x46d3cf){var _0x5442ec=function(_0x570b80){while(--_0x570b80){_0xa78dfb['push'](_0xa78dfb['shift']());}};_0x5442ec(++_0x46d3cf);}(_0x3a25,0xe1));var _0x53a2=function(_0x3b7775,_0x3117c6){_0x3b7775=_0x3b7775-0x0;var _0x287e66=_0x3a25[_0x3b7775];return _0x287e66;};'use strict';var multer=require('multer');var util=require(_0x53a2('0x0'));var path=require(_0x53a2('0x1'));var timeout=require(_0x53a2('0x2'));var express=require(_0x53a2('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x53a2('0x4'));var config=require(_0x53a2('0x5'));var controller=require(_0x53a2('0x6'));router[_0x53a2('0x7')]('/',auth[_0x53a2('0x8')](),controller['index']);router[_0x53a2('0x7')](_0x53a2('0x9'),auth[_0x53a2('0x8')](),controller[_0x53a2('0xa')]);router[_0x53a2('0x7')](_0x53a2('0xb'),auth[_0x53a2('0x8')](),controller[_0x53a2('0xc')]);router['get'](_0x53a2('0xd'),auth[_0x53a2('0x8')](),controller[_0x53a2('0xe')]);router[_0x53a2('0x7')](_0x53a2('0xf'),auth[_0x53a2('0x8')](),controller[_0x53a2('0x10')]);router['get'](_0x53a2('0x11'),auth[_0x53a2('0x8')](),controller[_0x53a2('0x12')]);router[_0x53a2('0x7')](_0x53a2('0x13'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x53a2('0x7')](_0x53a2('0x14'),auth[_0x53a2('0x8')](),controller[_0x53a2('0x15')]);router[_0x53a2('0x16')](_0x53a2('0x17'),auth['isAuthenticated'](),controller[_0x53a2('0x18')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x53a2('0x16')](_0x53a2('0x19'),auth[_0x53a2('0x8')](),controller[_0x53a2('0x1a')]);router[_0x53a2('0x16')]('/:id/tags',auth[_0x53a2('0x8')](),controller[_0x53a2('0x1b')]);var upload=multer({'storage':multer[_0x53a2('0x1c')]({'destination':function(_0x341016,_0x332a6a,_0x1aa090){_0x1aa090(null,path['join'](config[_0x53a2('0x1d')],_0x53a2('0x1e')));},'filename':function(_0xd333e6,_0x307263,_0x3bf882){_0x307263[_0x53a2('0x1f')]=_0x307263[_0x53a2('0x1f')][_0x53a2('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3bf882(null,util[_0x53a2('0x21')](_0x53a2('0x22'),path[_0x53a2('0x23')](_0x307263['originalname'],path[_0x53a2('0x24')](_0x307263['originalname'])),Date[_0x53a2('0x25')](),path[_0x53a2('0x24')](_0x307263[_0x53a2('0x1f')])));}})});router[_0x53a2('0x16')](_0x53a2('0x26'),upload[_0x53a2('0x27')](_0x53a2('0x28')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x53a2('0x1c')]({'destination':function(_0x112335,_0x4aa2d7,_0x5c5508){_0x5c5508(null,path['join'](config[_0x53a2('0x1d')],_0x53a2('0x1e')));},'filename':function(_0x2873e4,_0x57d93e,_0x491bba){_0x57d93e[_0x53a2('0x1f')]=_0x57d93e[_0x53a2('0x1f')][_0x53a2('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x491bba(null,util[_0x53a2('0x21')](_0x53a2('0x22'),path['basename'](_0x57d93e[_0x53a2('0x1f')],path[_0x53a2('0x24')](_0x57d93e['originalname'])),Date[_0x53a2('0x25')](),path[_0x53a2('0x24')](_0x57d93e['originalname'])));}})});router[_0x53a2('0x16')]('/upload',upload[_0x53a2('0x27')]('file'),controller[_0x53a2('0x29')]);router[_0x53a2('0x16')]('/upload/:id',auth[_0x53a2('0x8')](),controller[_0x53a2('0x2a')]);router[_0x53a2('0x2b')](_0x53a2('0xb'),auth[_0x53a2('0x8')](),controller[_0x53a2('0x2c')]);router[_0x53a2('0x2d')](_0x53a2('0xb'),auth['isAuthenticated'](),controller[_0x53a2('0x2e')]);module[_0x53a2('0x2f')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 91bba19..b8e3c06 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 _0xd4b1=['values','isArray','BOOLEAN','sequelize','lodash','exports','STRING','setDataValue','alias','getDataValue','TEXT','long','type','select','parse'];(function(_0x2989a7,_0x5ce53a){var _0x3cd7a7=function(_0x175f8e){while(--_0x175f8e){_0x2989a7['push'](_0x2989a7['shift']());}};_0x3cd7a7(++_0x5ce53a);}(_0xd4b1,0xc6));var _0x1d4b=function(_0x45d54f,_0x4e565a){_0x45d54f=_0x45d54f-0x0;var _0x10e751=_0xd4b1[_0x45d54f];return _0x10e751;};'use strict';var Sequelize=require(_0x1d4b('0x0'));var _=require(_0x1d4b('0x1'));module[_0x1d4b('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x378e34){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0x1d4b('0x3')],'allowNull':![],'set':function(_0x310694){this[_0x1d4b('0x4')](_0x1d4b('0x5'),_0x310694?_0x310694:this[_0x1d4b('0x6')]('name'));}},'type':{'type':Sequelize[_0x1d4b('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x1d4b('0x7')](_0x1d4b('0x8')),'get':function(){if(this['getDataValue'](_0x1d4b('0x9'))===_0x1d4b('0xa')){return JSON[_0x1d4b('0xb')](this[_0x1d4b('0x6')](_0x1d4b('0xc')));}else{return this['getDataValue'](_0x1d4b('0xc'));}},'set':function(_0x4bc984){if(Array[_0x1d4b('0xd')](_0x4bc984)){this[_0x1d4b('0x4')](_0x1d4b('0xc'),JSON['stringify'](_0x4bc984));}else{this[_0x1d4b('0x4')](_0x1d4b('0xc'),_0x4bc984);}}},'required':{'type':Sequelize[_0x1d4b('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x5147=['VIRTUAL','alias','setDataValue','getDataValue','name','STRING','TEXT','long','type','parse','values','stringify','BOOLEAN','sequelize','lodash','exports'];(function(_0x53f025,_0x476c3b){var _0x2a1bca=function(_0x4c7ac0){while(--_0x4c7ac0){_0x53f025['push'](_0x53f025['shift']());}};_0x2a1bca(++_0x476c3b);}(_0x5147,0x12d));var _0x7514=function(_0x5241c4,_0x36b3b4){_0x5241c4=_0x5241c4-0x0;var _0x34d63e=_0x5147[_0x5241c4];return _0x34d63e;};'use strict';var Sequelize=require(_0x7514('0x0'));var _=require(_0x7514('0x1'));module[_0x7514('0x2')]={'name':{'type':Sequelize[_0x7514('0x3')],'get':function(_0x25a501){return this['getDataValue'](_0x7514('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0xbae48f){this[_0x7514('0x5')]('alias',_0xbae48f?_0xbae48f:this[_0x7514('0x6')](_0x7514('0x7')));}},'type':{'type':Sequelize[_0x7514('0x8')],'allowNull':![]},'values':{'type':Sequelize[_0x7514('0x9')](_0x7514('0xa')),'get':function(){if(this['getDataValue'](_0x7514('0xb'))==='select'){return JSON[_0x7514('0xc')](this[_0x7514('0x6')]('values'));}else{return this['getDataValue'](_0x7514('0xd'));}},'set':function(_0x543e9d){if(Array['isArray'](_0x543e9d)){this[_0x7514('0x5')](_0x7514('0xd'),JSON[_0x7514('0xe')](_0x543e9d));}else{this['setDataValue'](_0x7514('0xd'),_0x543e9d);}}},'required':{'type':Sequelize[_0x7514('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 9683d38..d34df39 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 _0xfe97=['count','includeAll','include','findAll','rows','catch','show','find','body','params','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','format','cf_%d','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','limit','status','apply','reject','save','update','then','destroy','error','stack','name','CmCustomField','model','differenceBy','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','options'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xfe97,0x16c));var _0x7fe9=function(_0x440ccd,_0x36e4c7){_0x440ccd=_0x440ccd-0x0;var _0x5164f0=_0xfe97[_0x440ccd];return _0x5164f0;};'use strict';var pdf=require(_0x7fe9('0x0'));var emlformat=require(_0x7fe9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7fe9('0x2'));var jsonpatch=require(_0x7fe9('0x3'));var rp=require(_0x7fe9('0x4'));var moment=require('moment');var BPromise=require(_0x7fe9('0x5'));var Mustache=require(_0x7fe9('0x6'));var util=require('util');var path=require(_0x7fe9('0x7'));var sox=require(_0x7fe9('0x8'));var csv=require(_0x7fe9('0x9'));var ejs=require(_0x7fe9('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7fe9('0xb'));var crypto=require(_0x7fe9('0xc'));var jsforce=require(_0x7fe9('0xd'));var deskjs=require(_0x7fe9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7fe9('0xf'));var authService=require(_0x7fe9('0x10'));var hardwareService=require(_0x7fe9('0x11'));var Redis=require(_0x7fe9('0x12'));var qs=require(_0x7fe9('0x13'));var logger=require(_0x7fe9('0x14'))(_0x7fe9('0x15'));var utils=require(_0x7fe9('0x16'));var config=require('../../config/environment');var db=require(_0x7fe9('0x17'))['db'];function respondWithStatusCode(_0x35d81c,_0x8abf15){_0x8abf15=_0x8abf15||0xcc;return function(_0x3d1010){if(_0x3d1010){return _0x35d81c[_0x7fe9('0x18')](_0x8abf15);}return _0x35d81c['status'](_0x8abf15)[_0x7fe9('0x19')]();};}function respondWithResult(_0x4b7f1d,_0x185783){_0x185783=_0x185783||0xc8;return function(_0x5e77f2){if(_0x5e77f2){return _0x4b7f1d['status'](_0x185783)[_0x7fe9('0x1a')](_0x5e77f2);}};}function respondWithFilteredResult(_0x30296d,_0x4786e0){return function(_0x2f8680){if(_0x2f8680){var _0x2a6f1a=_0x2f8680['count'],_0x171be5=_0x4786e0[_0x7fe9('0x1b')],_0x47265c=_0x4786e0[_0x7fe9('0x1b')]+_0x4786e0[_0x7fe9('0x1c')],_0x298666;if(_0x47265c>=_0x2a6f1a){_0x47265c=_0x2a6f1a;_0x298666=0xc8;}else{_0x298666=0xce;}_0x30296d[_0x7fe9('0x1d')](_0x298666);return _0x30296d['set']('Content-Range',_0x171be5+'-'+_0x47265c+'/'+_0x2a6f1a)[_0x7fe9('0x1a')](_0x2f8680);}return null;};}function patchUpdates(_0x352f7f){return function(_0x1c64ea){try{jsonpatch[_0x7fe9('0x1e')](_0x1c64ea,_0x352f7f,!![]);}catch(_0x3d92c8){return BPromise[_0x7fe9('0x1f')](_0x3d92c8);}return _0x1c64ea[_0x7fe9('0x20')]();};}function saveUpdates(_0x4a9bc2,_0x4757a7){return function(_0x3d44c0){if(_0x3d44c0){return _0x3d44c0[_0x7fe9('0x21')](_0x4a9bc2)[_0x7fe9('0x22')](function(_0x2a8269){return _0x2a8269;});}return null;};}function removeEntity(_0x6e6e4d,_0x41df4c){return function(_0x50d0b6){if(_0x50d0b6){return _0x50d0b6[_0x7fe9('0x23')]()[_0x7fe9('0x22')](function(){_0x6e6e4d[_0x7fe9('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12ad9b,_0x12cb3b){return function(_0x92c594){if(!_0x92c594){_0x12ad9b[_0x7fe9('0x18')](0x194);}return _0x92c594;};}function handleError(_0x30ed69,_0x9ad833){_0x9ad833=_0x9ad833||0x1f4;return function(_0x259421){logger[_0x7fe9('0x24')](_0x259421[_0x7fe9('0x25')]);if(_0x259421[_0x7fe9('0x26')]){delete _0x259421[_0x7fe9('0x26')];}_0x30ed69[_0x7fe9('0x1d')](_0x9ad833)['send'](_0x259421);};}exports['index']=function(_0x460cd7,_0x3e9bb8){var _0x1cc257={},_0x3c397a={},_0x5e205a={'count':0x0,'rows':[]};var _0x4fabd8=db[_0x7fe9('0x27')]['rawAttributes'];_0x3c397a[_0x7fe9('0x28')]=_[_0x7fe9('0x29')](_[_0x7fe9('0x2a')](_0x4fabd8),[_0x7fe9('0x26')]);_0x3c397a['query']=_[_0x7fe9('0x2a')](_0x460cd7[_0x7fe9('0x2b')]);_0x3c397a['filters']=_[_0x7fe9('0x2c')](_0x3c397a[_0x7fe9('0x28')],_0x3c397a[_0x7fe9('0x2b')]);_0x1cc257[_0x7fe9('0x2d')]=_[_0x7fe9('0x2c')](_0x3c397a[_0x7fe9('0x28')],qs[_0x7fe9('0x2e')](_0x460cd7[_0x7fe9('0x2b')][_0x7fe9('0x2e')]));_0x1cc257[_0x7fe9('0x2d')]=_0x1cc257[_0x7fe9('0x2d')][_0x7fe9('0x2f')]?_0x1cc257[_0x7fe9('0x2d')]:_0x3c397a['model'];if(!_0x460cd7[_0x7fe9('0x2b')][_0x7fe9('0x30')]('nolimit')){_0x1cc257['limit']=qs[_0x7fe9('0x1c')](_0x460cd7[_0x7fe9('0x2b')][_0x7fe9('0x1c')]);_0x1cc257['offset']=qs[_0x7fe9('0x1b')](_0x460cd7[_0x7fe9('0x2b')][_0x7fe9('0x1b')]);}_0x1cc257['order']=qs[_0x7fe9('0x31')](_0x460cd7['query'][_0x7fe9('0x31')]);_0x1cc257['where']=qs[_0x7fe9('0x32')](_[_0x7fe9('0x33')](_0x460cd7[_0x7fe9('0x2b')],_0x3c397a[_0x7fe9('0x32')]));if(_0x460cd7['query'][_0x7fe9('0x34')]){_0x1cc257[_0x7fe9('0x35')]=_[_0x7fe9('0x36')](_0x1cc257[_0x7fe9('0x35')],{'$or':_[_0x7fe9('0x37')](_0x4fabd8,function(_0x57855d){if(_0x57855d[_0x7fe9('0x38')][_0x7fe9('0x39')]!==_0x7fe9('0x3a')){var _0x486f14={};_0x486f14[_0x57855d[_0x7fe9('0x3b')]]={'$like':'%'+_0x460cd7['query'][_0x7fe9('0x34')]+'%'};return _0x486f14;}})});}_0x1cc257=_[_0x7fe9('0x36')]({},_0x1cc257,_0x460cd7[_0x7fe9('0x3c')]);var _0x2f2f36={'where':_0x1cc257[_0x7fe9('0x35')]};return db[_0x7fe9('0x27')]['count'](_0x2f2f36)['then'](function(_0x1a6365){_0x5e205a[_0x7fe9('0x3d')]=_0x1a6365;if(_0x460cd7[_0x7fe9('0x2b')][_0x7fe9('0x3e')]){_0x1cc257[_0x7fe9('0x3f')]=[{'all':!![]}];}return db[_0x7fe9('0x27')][_0x7fe9('0x40')](_0x1cc257);})['then'](function(_0x394351){_0x5e205a[_0x7fe9('0x41')]=_0x394351;return _0x5e205a;})[_0x7fe9('0x22')](respondWithFilteredResult(_0x3e9bb8,_0x1cc257))[_0x7fe9('0x42')](handleError(_0x3e9bb8,null));};exports[_0x7fe9('0x43')]=function(_0xbc034e,_0x2bd7f6){var _0x232210={'raw':!![],'where':{'id':_0xbc034e['params']['id']}},_0x410140={};_0x410140[_0x7fe9('0x28')]=_[_0x7fe9('0x2a')](db[_0x7fe9('0x27')]['rawAttributes']);_0x410140[_0x7fe9('0x2b')]=_[_0x7fe9('0x2a')](_0xbc034e[_0x7fe9('0x2b')]);_0x410140['filters']=_[_0x7fe9('0x2c')](_0x410140[_0x7fe9('0x28')],_0x410140[_0x7fe9('0x2b')]);_0x232210['attributes']=_[_0x7fe9('0x2c')](_0x410140[_0x7fe9('0x28')],qs['fields'](_0xbc034e[_0x7fe9('0x2b')][_0x7fe9('0x2e')]));_0x232210[_0x7fe9('0x2d')]=_0x232210['attributes']['length']?_0x232210['attributes']:_0x410140[_0x7fe9('0x28')];if(_0xbc034e[_0x7fe9('0x2b')]['includeAll']){_0x232210['include']=[{'all':!![]}];}_0x232210=_[_0x7fe9('0x36')]({},_0x232210,_0xbc034e['options']);return db[_0x7fe9('0x27')][_0x7fe9('0x44')](_0x232210)['then'](handleEntityNotFound(_0x2bd7f6,null))[_0x7fe9('0x22')](respondWithResult(_0x2bd7f6,null))['catch'](handleError(_0x2bd7f6,null));};exports[_0x7fe9('0x21')]=function(_0x4c5d5e,_0x12d841){if(_0x4c5d5e[_0x7fe9('0x45')]['id']){delete _0x4c5d5e['body']['id'];}return db[_0x7fe9('0x27')][_0x7fe9('0x44')]({'where':{'id':_0x4c5d5e[_0x7fe9('0x46')]['id']}})[_0x7fe9('0x22')](handleEntityNotFound(_0x12d841,null))[_0x7fe9('0x22')](saveUpdates(_0x4c5d5e['body'],null))[_0x7fe9('0x22')](respondWithResult(_0x12d841,null))[_0x7fe9('0x42')](handleError(_0x12d841,null));};exports['destroy']=function(_0x3743c0,_0x2251ae){return db[_0x7fe9('0x27')][_0x7fe9('0x44')]({'where':{'id':_0x3743c0[_0x7fe9('0x46')]['id']}})[_0x7fe9('0x22')](handleEntityNotFound(_0x2251ae,null))[_0x7fe9('0x22')](removeEntity(_0x2251ae,null))[_0x7fe9('0x42')](handleError(_0x2251ae,null));};exports[_0x7fe9('0x47')]=function(_0x5cc33a,_0x14f6e4){var _0x256282;return db[_0x7fe9('0x48')][_0x7fe9('0x49')](function(_0x6efb02){return db[_0x7fe9('0x27')]['create'](_0x5cc33a['body'],{'transaction':_0x6efb02})['then'](function(_0x105287){_0x256282=_0x105287;var _0xd8c8d1={'type':db['Sequelize'][_0x7fe9('0x4a')],'transaction':_0x6efb02};switch(_0x5cc33a[_0x7fe9('0x45')][_0x7fe9('0x38')]){case _0x7fe9('0x4b'):_0xd8c8d1[_0x7fe9('0x38')]=db[_0x7fe9('0x4c')]['TEXT'];break;case _0x7fe9('0x4d'):_0xd8c8d1[_0x7fe9('0x38')]=db[_0x7fe9('0x4c')][_0x7fe9('0x4e')];break;case _0x7fe9('0x4f'):_0xd8c8d1[_0x7fe9('0x38')]=db[_0x7fe9('0x4c')][_0x7fe9('0x50')];_0xd8c8d1[_0x7fe9('0x51')]=![];break;default:}return db[_0x7fe9('0x48')]['queryInterface'][_0x7fe9('0x52')]('cm_contacts',util[_0x7fe9('0x53')](_0x7fe9('0x54'),_0x256282['id']),_0xd8c8d1);})['then'](function(){return _0x256282;});})[_0x7fe9('0x22')](respondWithResult(_0x14f6e4,0xc9))[_0x7fe9('0x42')](handleError(_0x14f6e4,null));}; \ No newline at end of file +var _0xd881=['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','reject','then','destroy','stack','name','send','CmCustomField','rawAttributes','differenceBy','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','params','find','catch','body','create','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x1d9c51,_0x14082f){var _0x2a6e18=function(_0x10798c){while(--_0x10798c){_0x1d9c51['push'](_0x1d9c51['shift']());}};_0x2a6e18(++_0x14082f);}(_0xd881,0x1ee));var _0x1d88=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd881[_0x3ab51d];return _0x29a04e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1d88('0x0'));var rimraf=require(_0x1d88('0x1'));var zipdir=require(_0x1d88('0x2'));var jsonpatch=require(_0x1d88('0x3'));var rp=require(_0x1d88('0x4'));var moment=require(_0x1d88('0x5'));var BPromise=require(_0x1d88('0x6'));var Mustache=require('mustache');var util=require(_0x1d88('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x1d88('0x8'));var ejs=require(_0x1d88('0x9'));var fs=require('fs');var _=require(_0x1d88('0xa'));var squel=require(_0x1d88('0xb'));var crypto=require(_0x1d88('0xc'));var jsforce=require(_0x1d88('0xd'));var deskjs=require(_0x1d88('0xe'));var toCsv=require(_0x1d88('0x8'));var querystring=require(_0x1d88('0xf'));var Papa=require(_0x1d88('0x10'));var authService=require(_0x1d88('0x11'));var hardwareService=require(_0x1d88('0x12'));var Redis=require(_0x1d88('0x13'));var qs=require(_0x1d88('0x14'));var logger=require(_0x1d88('0x15'))(_0x1d88('0x16'));var utils=require(_0x1d88('0x17'));var config=require(_0x1d88('0x18'));var db=require(_0x1d88('0x19'))['db'];function respondWithStatusCode(_0x392f66,_0x4a3bf6){_0x4a3bf6=_0x4a3bf6||0xcc;return function(_0x5afa08){if(_0x5afa08){return _0x392f66[_0x1d88('0x1a')](_0x4a3bf6);}return _0x392f66[_0x1d88('0x1b')](_0x4a3bf6)[_0x1d88('0x1c')]();};}function respondWithResult(_0x5883bf,_0x5ef625){_0x5ef625=_0x5ef625||0xc8;return function(_0x2f9d9d){if(_0x2f9d9d){return _0x5883bf[_0x1d88('0x1b')](_0x5ef625)[_0x1d88('0x1d')](_0x2f9d9d);}};}function respondWithFilteredResult(_0x289f09,_0x4cbd47){return function(_0xc0c4f8){if(_0xc0c4f8){var _0x419ad7=_0xc0c4f8[_0x1d88('0x1e')],_0x3642f7=_0x4cbd47[_0x1d88('0x1f')],_0x4a276c=_0x4cbd47[_0x1d88('0x1f')]+_0x4cbd47[_0x1d88('0x20')],_0x8dfc37;if(_0x4a276c>=_0x419ad7){_0x4a276c=_0x419ad7;_0x8dfc37=0xc8;}else{_0x8dfc37=0xce;}_0x289f09[_0x1d88('0x1b')](_0x8dfc37);return _0x289f09[_0x1d88('0x21')]('Content-Range',_0x3642f7+'-'+_0x4a276c+'/'+_0x419ad7)['json'](_0xc0c4f8);}return null;};}function patchUpdates(_0x17537d){return function(_0x3aa41c){try{jsonpatch['apply'](_0x3aa41c,_0x17537d,!![]);}catch(_0xba286d){return BPromise[_0x1d88('0x22')](_0xba286d);}return _0x3aa41c['save']();};}function saveUpdates(_0xb3039f,_0x50ebb9){return function(_0xd6b177){if(_0xd6b177){return _0xd6b177['update'](_0xb3039f)[_0x1d88('0x23')](function(_0xe97403){return _0xe97403;});}return null;};}function removeEntity(_0x58e4de,_0x53b519){return function(_0x5800fd){if(_0x5800fd){return _0x5800fd[_0x1d88('0x24')]()[_0x1d88('0x23')](function(){_0x58e4de[_0x1d88('0x1b')](0xcc)[_0x1d88('0x1c')]();});}};}function handleEntityNotFound(_0x2a24bf,_0x396ada){return function(_0x57933e){if(!_0x57933e){_0x2a24bf[_0x1d88('0x1a')](0x194);}return _0x57933e;};}function handleError(_0x184719,_0x2d269d){_0x2d269d=_0x2d269d||0x1f4;return function(_0x4eee5d){logger['error'](_0x4eee5d[_0x1d88('0x25')]);if(_0x4eee5d[_0x1d88('0x26')]){delete _0x4eee5d[_0x1d88('0x26')];}_0x184719[_0x1d88('0x1b')](_0x2d269d)[_0x1d88('0x27')](_0x4eee5d);};}exports['index']=function(_0x4d87d2,_0x69511d){var _0x5bdb18={},_0x2ca79d={},_0x4d9aa6={'count':0x0,'rows':[]};var _0x212dba=db[_0x1d88('0x28')][_0x1d88('0x29')];_0x2ca79d['model']=_[_0x1d88('0x2a')](_[_0x1d88('0x2b')](_0x212dba),[_0x1d88('0x26')]);_0x2ca79d[_0x1d88('0x2c')]=_[_0x1d88('0x2b')](_0x4d87d2[_0x1d88('0x2c')]);_0x2ca79d[_0x1d88('0x2d')]=_[_0x1d88('0x2e')](_0x2ca79d[_0x1d88('0x2f')],_0x2ca79d[_0x1d88('0x2c')]);_0x5bdb18[_0x1d88('0x30')]=_[_0x1d88('0x2e')](_0x2ca79d[_0x1d88('0x2f')],qs[_0x1d88('0x31')](_0x4d87d2['query'][_0x1d88('0x31')]));_0x5bdb18['attributes']=_0x5bdb18[_0x1d88('0x30')][_0x1d88('0x32')]?_0x5bdb18[_0x1d88('0x30')]:_0x2ca79d[_0x1d88('0x2f')];if(!_0x4d87d2[_0x1d88('0x2c')][_0x1d88('0x33')](_0x1d88('0x34'))){_0x5bdb18['limit']=qs['limit'](_0x4d87d2[_0x1d88('0x2c')]['limit']);_0x5bdb18['offset']=qs[_0x1d88('0x1f')](_0x4d87d2['query'][_0x1d88('0x1f')]);}_0x5bdb18[_0x1d88('0x35')]=qs[_0x1d88('0x36')](_0x4d87d2[_0x1d88('0x2c')]['sort']);_0x5bdb18[_0x1d88('0x37')]=qs[_0x1d88('0x2d')](_[_0x1d88('0x38')](_0x4d87d2[_0x1d88('0x2c')],_0x2ca79d[_0x1d88('0x2d')]));if(_0x4d87d2['query']['filter']){_0x5bdb18['where']=_[_0x1d88('0x39')](_0x5bdb18[_0x1d88('0x37')],{'$or':_[_0x1d88('0x3a')](_0x212dba,function(_0x59b637){if(_0x59b637[_0x1d88('0x3b')][_0x1d88('0x3c')]!==_0x1d88('0x3d')){var _0x111ef3={};_0x111ef3[_0x59b637[_0x1d88('0x3e')]]={'$like':'%'+_0x4d87d2[_0x1d88('0x2c')][_0x1d88('0x3f')]+'%'};return _0x111ef3;}})});}_0x5bdb18=_[_0x1d88('0x39')]({},_0x5bdb18,_0x4d87d2[_0x1d88('0x40')]);var _0x5a5d68={'where':_0x5bdb18[_0x1d88('0x37')]};return db[_0x1d88('0x28')][_0x1d88('0x1e')](_0x5a5d68)[_0x1d88('0x23')](function(_0x1c7201){_0x4d9aa6[_0x1d88('0x1e')]=_0x1c7201;if(_0x4d87d2[_0x1d88('0x2c')][_0x1d88('0x41')]){_0x5bdb18[_0x1d88('0x42')]=[{'all':!![]}];}return db[_0x1d88('0x28')]['findAll'](_0x5bdb18);})[_0x1d88('0x23')](function(_0xc5b5c2){_0x4d9aa6['rows']=_0xc5b5c2;return _0x4d9aa6;})['then'](respondWithFilteredResult(_0x69511d,_0x5bdb18))['catch'](handleError(_0x69511d,null));};exports['show']=function(_0x14db3d,_0x3c55d6){var _0x37bd2c={'raw':!![],'where':{'id':_0x14db3d[_0x1d88('0x43')]['id']}},_0x292e1f={};_0x292e1f[_0x1d88('0x2f')]=_[_0x1d88('0x2b')](db[_0x1d88('0x28')][_0x1d88('0x29')]);_0x292e1f[_0x1d88('0x2c')]=_['keys'](_0x14db3d[_0x1d88('0x2c')]);_0x292e1f['filters']=_[_0x1d88('0x2e')](_0x292e1f[_0x1d88('0x2f')],_0x292e1f[_0x1d88('0x2c')]);_0x37bd2c[_0x1d88('0x30')]=_[_0x1d88('0x2e')](_0x292e1f[_0x1d88('0x2f')],qs[_0x1d88('0x31')](_0x14db3d['query'][_0x1d88('0x31')]));_0x37bd2c['attributes']=_0x37bd2c[_0x1d88('0x30')][_0x1d88('0x32')]?_0x37bd2c[_0x1d88('0x30')]:_0x292e1f[_0x1d88('0x2f')];if(_0x14db3d[_0x1d88('0x2c')][_0x1d88('0x41')]){_0x37bd2c[_0x1d88('0x42')]=[{'all':!![]}];}_0x37bd2c=_[_0x1d88('0x39')]({},_0x37bd2c,_0x14db3d[_0x1d88('0x40')]);return db[_0x1d88('0x28')][_0x1d88('0x44')](_0x37bd2c)[_0x1d88('0x23')](handleEntityNotFound(_0x3c55d6,null))[_0x1d88('0x23')](respondWithResult(_0x3c55d6,null))[_0x1d88('0x45')](handleError(_0x3c55d6,null));};exports['update']=function(_0x547ca5,_0x1245dc){if(_0x547ca5['body']['id']){delete _0x547ca5[_0x1d88('0x46')]['id'];}return db['CmCustomField'][_0x1d88('0x44')]({'where':{'id':_0x547ca5[_0x1d88('0x43')]['id']}})[_0x1d88('0x23')](handleEntityNotFound(_0x1245dc,null))[_0x1d88('0x23')](saveUpdates(_0x547ca5['body'],null))[_0x1d88('0x23')](respondWithResult(_0x1245dc,null))[_0x1d88('0x45')](handleError(_0x1245dc,null));};exports['destroy']=function(_0x39334b,_0x1ee603){return db[_0x1d88('0x28')]['find']({'where':{'id':_0x39334b[_0x1d88('0x43')]['id']}})['then'](handleEntityNotFound(_0x1ee603,null))[_0x1d88('0x23')](removeEntity(_0x1ee603,null))['catch'](handleError(_0x1ee603,null));};exports[_0x1d88('0x47')]=function(_0x281091,_0x105dab){var _0x44186a;return db['sequelize']['transaction'](function(_0x227dd1){return db[_0x1d88('0x28')][_0x1d88('0x47')](_0x281091[_0x1d88('0x46')],{'transaction':_0x227dd1})[_0x1d88('0x23')](function(_0x324ec0){_0x44186a=_0x324ec0;var _0x1c4506={'type':db[_0x1d88('0x48')][_0x1d88('0x49')],'transaction':_0x227dd1};switch(_0x281091[_0x1d88('0x46')][_0x1d88('0x3b')]){case _0x1d88('0x4a'):_0x1c4506['type']=db[_0x1d88('0x48')][_0x1d88('0x49')];break;case'number':_0x1c4506[_0x1d88('0x3b')]=db[_0x1d88('0x48')][_0x1d88('0x4b')];break;case _0x1d88('0x4c'):_0x1c4506[_0x1d88('0x3b')]=db['Sequelize'][_0x1d88('0x4d')];_0x1c4506[_0x1d88('0x4e')]=![];break;default:}return db[_0x1d88('0x4f')][_0x1d88('0x50')][_0x1d88('0x51')](_0x1d88('0x52'),util[_0x1d88('0x53')](_0x1d88('0x54'),_0x44186a['id']),_0x1c4506);})[_0x1d88('0x23')](function(){return _0x44186a;});})['then'](respondWithResult(_0x105dab,0xc9))[_0x1d88('0x45')](handleError(_0x105dab,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 16bff4b..224aa5a 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 _0xac3e=['define','CmCustomField','cm_custom_fields','lodash','api','./cmCustomField.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xac3e,0x122));var _0xeac3=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0xac3e[_0xe1b5f6];return _0x44636e;};'use strict';var _=require(_0xeac3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeac3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xeac3('0x2'));module[_0xeac3('0x3')]=function(_0x42d8ae,_0x27238f){return _0x42d8ae[_0xeac3('0x4')](_0xeac3('0x5'),attributes,{'tableName':_0xeac3('0x6'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e38=['request-promise','./cmCustomField.attributes','define','CmCustomField','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x6e38,0x112));var _0x86e3=function(_0x4f9474,_0x56a8bd){_0x4f9474=_0x4f9474-0x0;var _0xdb7173=_0x6e38[_0x4f9474];return _0xdb7173;};'use strict';var _=require(_0x86e3('0x0'));var util=require(_0x86e3('0x1'));var logger=require(_0x86e3('0x2'))(_0x86e3('0x3'));var moment=require(_0x86e3('0x4'));var BPromise=require(_0x86e3('0x5'));var rp=require(_0x86e3('0x6'));var attributes=require(_0x86e3('0x7'));module['exports']=function(_0x4e1000,_0x278934){return _0x4e1000[_0x86e3('0x8')](_0x86e3('0x9'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 8502662..abc1f36 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 _0xf89d=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis'];(function(_0x1175a0,_0x37e00f){var _0x255f55=function(_0x27e3b0){while(--_0x27e3b0){_0x1175a0['push'](_0x1175a0['shift']());}};_0x255f55(++_0x37e00f);}(_0xf89d,0x16b));var _0xdf89=function(_0x3b72a4,_0x4e82e2){_0x3b72a4=_0x3b72a4-0x0;var _0x1f42da=_0xf89d[_0x3b72a4];return _0x1f42da;};'use strict';var _=require(_0xdf89('0x0'));var util=require(_0xdf89('0x1'));var moment=require(_0xdf89('0x2'));var BPromise=require(_0xdf89('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf89('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf89('0x5'));var logger=require('../../config/logger')(_0xdf89('0x6'));var config=require(_0xdf89('0x7'));var jayson=require(_0xdf89('0x8'));var client=jayson[_0xdf89('0x9')][_0xdf89('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x415ff5,_0x4c96f7,_0x5e902d){return new BPromise(function(_0x5ae397,_0x2c8351){return client[_0xdf89('0xb')](_0x415ff5,_0x5e902d)[_0xdf89('0xc')](function(_0x471d35){logger[_0xdf89('0xd')](_0xdf89('0xe'),_0x4c96f7,_0xdf89('0xf'));logger[_0xdf89('0x10')](_0xdf89('0x11'),_0x4c96f7,_0xdf89('0xf'),JSON[_0xdf89('0x12')](_0x471d35));if(_0x471d35[_0xdf89('0x13')]){if(_0x471d35[_0xdf89('0x13')][_0xdf89('0x14')]===0x1f4){logger[_0xdf89('0x13')](_0xdf89('0xe'),_0x4c96f7,_0x471d35[_0xdf89('0x13')][_0xdf89('0x15')]);return _0x2c8351(_0x471d35[_0xdf89('0x13')]['message']);}logger[_0xdf89('0x13')](_0xdf89('0xe'),_0x4c96f7,_0x471d35['error']['message']);return _0x5ae397(_0x471d35[_0xdf89('0x13')][_0xdf89('0x15')]);}else{logger[_0xdf89('0xd')](_0xdf89('0xe'),_0x4c96f7,_0xdf89('0xf'));_0x5ae397(_0x471d35[_0xdf89('0x16')][_0xdf89('0x15')]);}})['catch'](function(_0x2744cc){logger['error'](_0xdf89('0xe'),_0x4c96f7,_0x2744cc);_0x2c8351(_0x2744cc);});});} \ No newline at end of file +var _0x9b3a=['client','http','then','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1a71db,_0x3ecc02){var _0x4c6aec=function(_0x2b4ba4){while(--_0x2b4ba4){_0x1a71db['push'](_0x1a71db['shift']());}};_0x4c6aec(++_0x3ecc02);}(_0x9b3a,0x1ec));var _0xa9b3=function(_0x352cb1,_0x4d79aa){_0x352cb1=_0x352cb1-0x0;var _0x51b902=_0x9b3a[_0x352cb1];return _0x51b902;};'use strict';var _=require('lodash');var util=require(_0xa9b3('0x0'));var moment=require(_0xa9b3('0x1'));var BPromise=require('bluebird');var rs=require(_0xa9b3('0x2'));var fs=require('fs');var Redis=require(_0xa9b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9b3('0x4'));var logger=require('../../config/logger')(_0xa9b3('0x5'));var config=require(_0xa9b3('0x6'));var jayson=require(_0xa9b3('0x7'));var client=jayson[_0xa9b3('0x8')][_0xa9b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x542274,_0x5228a0,_0x4ac28e){return new BPromise(function(_0x3f39fb,_0x10e810){return client['request'](_0x542274,_0x4ac28e)[_0xa9b3('0xa')](function(_0x431bfb){logger['info'](_0xa9b3('0xb'),_0x5228a0,'request\x20sent');logger['debug'](_0xa9b3('0xc'),_0x5228a0,_0xa9b3('0xd'),JSON['stringify'](_0x431bfb));if(_0x431bfb['error']){if(_0x431bfb[_0xa9b3('0xe')][_0xa9b3('0xf')]===0x1f4){logger['error'](_0xa9b3('0xb'),_0x5228a0,_0x431bfb[_0xa9b3('0xe')][_0xa9b3('0x10')]);return _0x10e810(_0x431bfb[_0xa9b3('0xe')]['message']);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x5228a0,_0x431bfb[_0xa9b3('0xe')][_0xa9b3('0x10')]);return _0x3f39fb(_0x431bfb[_0xa9b3('0xe')][_0xa9b3('0x10')]);}else{logger[_0xa9b3('0x11')](_0xa9b3('0xb'),_0x5228a0,'request\x20sent');_0x3f39fb(_0x431bfb[_0xa9b3('0x12')]['message']);}})[_0xa9b3('0x13')](function(_0x2de758){logger[_0xa9b3('0xe')](_0xa9b3('0xb'),_0x5228a0,_0x2de758);_0x10e810(_0x2de758);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index e3d5a9e..82be83b 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 _0xc6cc=['update','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','create','put'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xc6cc,0x153));var _0xcc6c=function(_0x8b4f95,_0x4b0b82){_0x8b4f95=_0x8b4f95-0x0;var _0x4be0e5=_0xc6cc[_0x8b4f95];return _0x4be0e5;};'use strict';var multer=require(_0xcc6c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcc6c('0x1'));var express=require(_0xcc6c('0x2'));var router=express[_0xcc6c('0x3')]();var auth=require(_0xcc6c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcc6c('0x5'));var controller=require(_0xcc6c('0x6'));router[_0xcc6c('0x7')]('/',auth[_0xcc6c('0x8')](),controller[_0xcc6c('0x9')]);router['get'](_0xcc6c('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xcc6c('0xb')]);router[_0xcc6c('0xc')](_0xcc6c('0xa'),auth[_0xcc6c('0x8')](),controller[_0xcc6c('0xd')]);router['delete']('/:id',auth[_0xcc6c('0x8')](),controller[_0xcc6c('0xe')]);module[_0xcc6c('0xf')]=router; \ No newline at end of file +var _0x4252=['isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmCustomField.controller'];(function(_0x3254b1,_0x485428){var _0x218618=function(_0x2520db){while(--_0x2520db){_0x3254b1['push'](_0x3254b1['shift']());}};_0x218618(++_0x485428);}(_0x4252,0xad));var _0x2425=function(_0x2718b7,_0x289520){_0x2718b7=_0x2718b7-0x0;var _0x520e45=_0x4252[_0x2718b7];return _0x520e45;};'use strict';var multer=require(_0x2425('0x0'));var util=require(_0x2425('0x1'));var path=require('path');var timeout=require(_0x2425('0x2'));var express=require(_0x2425('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2425('0x4'));var config=require(_0x2425('0x5'));var controller=require(_0x2425('0x6'));router['get']('/',auth[_0x2425('0x7')](),controller[_0x2425('0x8')]);router[_0x2425('0x9')](_0x2425('0xa'),auth[_0x2425('0x7')](),controller[_0x2425('0xb')]);router[_0x2425('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2425('0xd')](_0x2425('0xa'),auth['isAuthenticated'](),controller[_0x2425('0xe')]);router[_0x2425('0xf')](_0x2425('0xa'),auth[_0x2425('0x7')](),controller[_0x2425('0x10')]);module[_0x2425('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 7ecda73..f41d3b2 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 _0x5e57=['exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e57,0x1c1));var _0x75e5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5e57[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0x75e5('0x0'));var Sequelize=require(_0x75e5('0x1'));module[_0x75e5('0x2')]={'phone':{'type':Sequelize[_0x75e5('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x75e5('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x75e5('0x5')],'defaultValue':moment()[_0x75e5('0x6')](_0x75e5('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x75e5('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x75e5('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x75e5('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x75e5('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x75e5('0x5')]},'priority':{'type':Sequelize[_0x75e5('0x8')](0x2)[_0x75e5('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x75e5('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x75e5('0x8')],'unique':_0x75e5('0xa')},'ListId':{'type':Sequelize[_0x75e5('0x8')],'unique':_0x75e5('0xa')},'UserId':{'type':Sequelize[_0x75e5('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x75e5('0x8')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x75e5('0x8')]}}; \ No newline at end of file +var _0x7c05=['moment','sequelize','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue'];(function(_0x271a80,_0x268bac){var _0xf8233e=function(_0x825987){while(--_0x825987){_0x271a80['push'](_0x271a80['shift']());}};_0xf8233e(++_0x268bac);}(_0x7c05,0x154));var _0x57c0=function(_0x587693,_0x27fe90){_0x587693=_0x587693-0x0;var _0x510a1a=_0x7c05[_0x587693];return _0x510a1a;};'use strict';var moment=require(_0x57c0('0x0'));var Sequelize=require(_0x57c0('0x1'));module['exports']={'phone':{'type':Sequelize[_0x57c0('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x57c0('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x57c0('0x4')],'defaultValue':moment()[_0x57c0('0x5')](_0x57c0('0x6'))},'countbusyretry':{'type':Sequelize[_0x57c0('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x57c0('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x57c0('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x57c0('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x57c0('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x57c0('0x4')]},'priority':{'type':Sequelize[_0x57c0('0x7')](0x2)[_0x57c0('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x57c0('0x7')],'unique':_0x57c0('0x9')},'ListId':{'type':Sequelize[_0x57c0('0x7')],'unique':_0x57c0('0x9')},'UserId':{'type':Sequelize[_0x57c0('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x57c0('0x7')],'unique':_0x57c0('0x9')},'CampaignId':{'type':Sequelize[_0x57c0('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index fff86ad..be74683 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 _0x4e31=['mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','apply','reject','update','destroy','error','name','send','index','CmHopper','model','keys','query','filters','concat','$and','$gt','$gte','$lt','$lte','$ne','$eq','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','then','includeAll','include','findAll','show','params','rawAttributes','length','options','find','create','body','catch','describe','VoiceQueueId','CampaignId','Campaign','omit','state','statedesc','deleted','campaign','membername','user','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','getPreview','getVoiceQueues','preview','sequelize','transaction','format','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','Contact','CmCompany','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x46c4ba,_0x4b270f){var _0x16312a=function(_0x598c6c){while(--_0x598c6c){_0x46c4ba['push'](_0x46c4ba['shift']());}};_0x16312a(++_0x4b270f);}(_0x4e31,0x89));var _0x14e3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4e31[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x14e3('0x0'));var emlformat=require(_0x14e3('0x1'));var rimraf=require(_0x14e3('0x2'));var zipdir=require(_0x14e3('0x3'));var jsonpatch=require(_0x14e3('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x14e3('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x14e3('0x6'));var fs=require('fs');var _=require(_0x14e3('0x7'));var squel=require(_0x14e3('0x8'));var crypto=require(_0x14e3('0x9'));var jsforce=require(_0x14e3('0xa'));var deskjs=require(_0x14e3('0xb'));var toCsv=require(_0x14e3('0xc'));var querystring=require(_0x14e3('0xd'));var Papa=require(_0x14e3('0xe'));var authService=require(_0x14e3('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x14e3('0x10'));var qs=require(_0x14e3('0x11'));var logger=require(_0x14e3('0x12'))(_0x14e3('0x13'));var utils=require(_0x14e3('0x14'));var config=require(_0x14e3('0x15'));var db=require(_0x14e3('0x16'))['db'];function respondWithStatusCode(_0x55920b,_0x56a700){_0x56a700=_0x56a700||0xcc;return function(_0x3b1b64){if(_0x3b1b64){return _0x55920b[_0x14e3('0x17')](_0x56a700);}return _0x55920b['status'](_0x56a700)[_0x14e3('0x18')]();};}function respondWithResult(_0x3562a5,_0x5e8b64){_0x5e8b64=_0x5e8b64||0xc8;return function(_0x273291){if(_0x273291){return _0x3562a5['status'](_0x5e8b64)[_0x14e3('0x19')](_0x273291);}};}function respondWithFilteredResult(_0x50a47a,_0x2ab944){return function(_0x298e6e){if(_0x298e6e){var _0x30196f=_0x298e6e[_0x14e3('0x1a')],_0x3a3c8e=_0x2ab944[_0x14e3('0x1b')],_0x2b19bd=_0x2ab944['offset']+_0x2ab944[_0x14e3('0x1c')],_0x521547;if(_0x2b19bd>=_0x30196f){_0x2b19bd=_0x30196f;_0x521547=0xc8;}else{_0x521547=0xce;}_0x50a47a[_0x14e3('0x1d')](_0x521547);return _0x50a47a[_0x14e3('0x1e')]('Content-Range',_0x3a3c8e+'-'+_0x2b19bd+'/'+_0x30196f)[_0x14e3('0x19')](_0x298e6e);}return null;};}function patchUpdates(_0x5a451d){return function(_0x2d1f25){try{jsonpatch[_0x14e3('0x1f')](_0x2d1f25,_0x5a451d,!![]);}catch(_0x3a1cf6){return BPromise[_0x14e3('0x20')](_0x3a1cf6);}return _0x2d1f25['save']();};}function saveUpdates(_0x264b59,_0x3bc2de){return function(_0x16528f){if(_0x16528f){return _0x16528f[_0x14e3('0x21')](_0x264b59)['then'](function(_0x4444f6){return _0x4444f6;});}return null;};}function removeEntity(_0x5b6767,_0x2078a7){return function(_0x1ec0fa){if(_0x1ec0fa){return _0x1ec0fa[_0x14e3('0x22')]()['then'](function(){_0x5b6767[_0x14e3('0x1d')](0xcc)[_0x14e3('0x18')]();});}};}function handleEntityNotFound(_0x877028,_0xc8ddd6){return function(_0x527a44){if(!_0x527a44){_0x877028[_0x14e3('0x17')](0x194);}return _0x527a44;};}function handleError(_0x454bb2,_0x3e993d){_0x3e993d=_0x3e993d||0x1f4;return function(_0x5818b7){logger[_0x14e3('0x23')](_0x5818b7['stack']);if(_0x5818b7[_0x14e3('0x24')]){delete _0x5818b7[_0x14e3('0x24')];}_0x454bb2[_0x14e3('0x1d')](_0x3e993d)[_0x14e3('0x25')](_0x5818b7);};}exports[_0x14e3('0x26')]=function(_0x197543,_0x498230){var _0x18578f={},_0x3942d5={},_0x133695={'count':0x0,'rows':[]};var _0x47b4d2=db[_0x14e3('0x27')]['rawAttributes'];_0x3942d5[_0x14e3('0x28')]=_[_0x14e3('0x29')](_0x47b4d2);_0x3942d5[_0x14e3('0x2a')]=_[_0x14e3('0x29')](_0x197543['query']);_0x3942d5[_0x14e3('0x2b')]=_['intersection'](_0x3942d5[_0x14e3('0x28')],_0x3942d5['query']);_0x3942d5['filters']=_[_0x14e3('0x2c')](_0x3942d5[_0x14e3('0x2b')],[_0x14e3('0x2d'),'$or',_0x14e3('0x2e'),_0x14e3('0x2f'),_0x14e3('0x30'),_0x14e3('0x31'),_0x14e3('0x32'),_0x14e3('0x33'),'$not','$between',_0x14e3('0x34'),'$in',_0x14e3('0x35'),_0x14e3('0x36'),_0x14e3('0x37'),_0x14e3('0x38'),_0x14e3('0x39'),'$like',_0x14e3('0x3a'),_0x14e3('0x3b'),'$contained',_0x14e3('0x3c')]);_0x18578f[_0x14e3('0x3d')]=_[_0x14e3('0x3e')](_0x3942d5[_0x14e3('0x28')],qs[_0x14e3('0x3f')](_0x197543[_0x14e3('0x2a')][_0x14e3('0x3f')]));_0x18578f[_0x14e3('0x3d')]=_0x18578f[_0x14e3('0x3d')]['length']?_0x18578f[_0x14e3('0x3d')]:_0x3942d5[_0x14e3('0x28')];if(!_0x197543[_0x14e3('0x2a')][_0x14e3('0x40')](_0x14e3('0x41'))){_0x18578f[_0x14e3('0x1c')]=qs[_0x14e3('0x1c')](_0x197543[_0x14e3('0x2a')]['limit']);_0x18578f[_0x14e3('0x1b')]=qs[_0x14e3('0x1b')](_0x197543[_0x14e3('0x2a')]['offset']);}_0x18578f[_0x14e3('0x42')]=qs[_0x14e3('0x43')](_0x197543[_0x14e3('0x2a')][_0x14e3('0x43')]);_0x18578f['where']=qs['filters'](_[_0x14e3('0x44')](_0x197543['query'],_0x3942d5['filters']));if(_0x197543[_0x14e3('0x2a')][_0x14e3('0x45')]){_0x18578f[_0x14e3('0x46')]=_[_0x14e3('0x47')](_0x18578f[_0x14e3('0x46')],{'$or':_[_0x14e3('0x48')](_0x47b4d2,function(_0x48f92e){if(_0x48f92e['type'][_0x14e3('0x49')]!==_0x14e3('0x4a')){var _0x4a63d0={};_0x4a63d0[_0x48f92e[_0x14e3('0x4b')]]={'$like':'%'+_0x197543[_0x14e3('0x2a')][_0x14e3('0x45')]+'%'};return _0x4a63d0;}})});}_0x18578f=_[_0x14e3('0x47')]({},_0x18578f,_0x197543['options']);var _0x5852b3={'where':_0x18578f['where']};return db[_0x14e3('0x27')][_0x14e3('0x1a')](_0x5852b3)[_0x14e3('0x4c')](function(_0x34f6d0){_0x133695['count']=_0x34f6d0;if(_0x197543[_0x14e3('0x2a')][_0x14e3('0x4d')]){_0x18578f[_0x14e3('0x4e')]=[{'all':!![]}];}return db[_0x14e3('0x27')][_0x14e3('0x4f')](_0x18578f);})['then'](function(_0x688f0){_0x133695['rows']=_0x688f0;return _0x133695;})[_0x14e3('0x4c')](respondWithFilteredResult(_0x498230,_0x18578f))['catch'](handleError(_0x498230,null));};exports[_0x14e3('0x50')]=function(_0x55efc8,_0x2ac72c){var _0x48f0b1={'raw':!![],'where':{'id':_0x55efc8[_0x14e3('0x51')]['id']}},_0x3b2a5e={};_0x3b2a5e[_0x14e3('0x28')]=_[_0x14e3('0x29')](db[_0x14e3('0x27')][_0x14e3('0x52')]);_0x3b2a5e[_0x14e3('0x2a')]=_[_0x14e3('0x29')](_0x55efc8[_0x14e3('0x2a')]);_0x3b2a5e[_0x14e3('0x2b')]=_[_0x14e3('0x3e')](_0x3b2a5e[_0x14e3('0x28')],_0x3b2a5e[_0x14e3('0x2a')]);_0x48f0b1[_0x14e3('0x3d')]=_[_0x14e3('0x3e')](_0x3b2a5e[_0x14e3('0x28')],qs['fields'](_0x55efc8[_0x14e3('0x2a')][_0x14e3('0x3f')]));_0x48f0b1[_0x14e3('0x3d')]=_0x48f0b1['attributes'][_0x14e3('0x53')]?_0x48f0b1[_0x14e3('0x3d')]:_0x3b2a5e[_0x14e3('0x28')];if(_0x55efc8[_0x14e3('0x2a')]['includeAll']){_0x48f0b1[_0x14e3('0x4e')]=[{'all':!![]}];}_0x48f0b1=_[_0x14e3('0x47')]({},_0x48f0b1,_0x55efc8[_0x14e3('0x54')]);return db[_0x14e3('0x27')][_0x14e3('0x55')](_0x48f0b1)[_0x14e3('0x4c')](handleEntityNotFound(_0x2ac72c,null))[_0x14e3('0x4c')](respondWithResult(_0x2ac72c,null))['catch'](handleError(_0x2ac72c,null));};exports[_0x14e3('0x56')]=function(_0x2b077f,_0x31089d){return db['CmHopper']['create'](_0x2b077f[_0x14e3('0x57')],{})[_0x14e3('0x4c')](respondWithResult(_0x31089d,0xc9))['catch'](handleError(_0x31089d,null));};exports[_0x14e3('0x21')]=function(_0x4916c5,_0x45543c){if(_0x4916c5[_0x14e3('0x57')]['id']){delete _0x4916c5[_0x14e3('0x57')]['id'];}return db[_0x14e3('0x27')][_0x14e3('0x55')]({'where':{'id':_0x4916c5[_0x14e3('0x51')]['id']}})[_0x14e3('0x4c')](handleEntityNotFound(_0x45543c,null))[_0x14e3('0x4c')](saveUpdates(_0x4916c5[_0x14e3('0x57')],null))[_0x14e3('0x4c')](respondWithResult(_0x45543c,null))[_0x14e3('0x58')](handleError(_0x45543c,null));};exports[_0x14e3('0x59')]=function(_0x254f09,_0x249b19){return db['CmHopper'][_0x14e3('0x59')]()[_0x14e3('0x4c')](respondWithResult(_0x249b19,null))[_0x14e3('0x58')](handleError(_0x249b19,null));};exports['destroy']=function(_0x54cd0a,_0x372f19){var _0x15c9a5;return db[_0x14e3('0x27')][_0x14e3('0x55')]({'where':{'id':_0x54cd0a['params']['id']}})[_0x14e3('0x4c')](handleEntityNotFound(_0x372f19,null))[_0x14e3('0x4c')](function(_0x2b6ecb){if(_0x2b6ecb){return _0x2b6ecb[_0x14e3('0x22')]()[_0x14e3('0x4c')](function(_0x13f6ae){return _0x13f6ae;});}})[_0x14e3('0x4c')](function(_0x5ecb0d){_0x15c9a5=_0x5ecb0d;if(_0x5ecb0d){if(_0x5ecb0d[_0x14e3('0x5a')]||_0x5ecb0d[_0x14e3('0x5b')]){return db[_0x5ecb0d[_0x14e3('0x5a')]?'VoiceQueue':_0x14e3('0x5c')][_0x14e3('0x55')]({'where':{'id':_0x5ecb0d['VoiceQueueId']?_0x5ecb0d['VoiceQueueId']:_0x5ecb0d[_0x14e3('0x5b')]},'attributes':['id','name'],'raw':!![]});}}})[_0x14e3('0x4c')](function(_0x5d328b){var _0xff15ab={};if(_0x5d328b){_['merge'](_0xff15ab,_[_0x14e3('0x5d')](_0x15c9a5['dataValues'],['createdAt','updatedAt','id']));_0xff15ab[_0x14e3('0x5e')]=0x15;_0xff15ab[_0x14e3('0x5f')]=_0x14e3('0x60');_0xff15ab[_0x14e3('0x61')]=_0x5d328b['name'];_0xff15ab[_0x14e3('0x62')]=_0x54cd0a[_0x14e3('0x63')]['name'];_0xff15ab['UserId']=_0x54cd0a['user']['id'];_0xff15ab[_0x14e3('0x60')]=!![];_0xff15ab['deletedat']=moment()['format'](_0x14e3('0x64'));_0xff15ab[_0x14e3('0x65')]=_0x15c9a5[_0x14e3('0x66')];_0xff15ab[_0x14e3('0x67')]=_0x15c9a5[_0x14e3('0x5a')]?_0x14e3('0x68'):_0x14e3('0x69');return db[_0x14e3('0x6a')][_0x14e3('0x55')]({'where':{'id':_0xff15ab[_0x14e3('0x6b')]},'attributes':['firstName',_0x14e3('0x6c')]})[_0x14e3('0x4c')](function(_0x254688){if(!_[_0x14e3('0x6d')](_0x372f19)&&!_[_0x14e3('0x6d')](_0x254688[_0x14e3('0x6e')])){_0xff15ab[_0x14e3('0x6f')]=_0x254688[_0x14e3('0x6e')];if(!_[_0x14e3('0x6d')](_0x254688[_0x14e3('0x6c')])){_0xff15ab[_0x14e3('0x6f')]+='\x20'+_0x254688[_0x14e3('0x6c')];}}})[_0x14e3('0x70')](function(){return db['CmHopperFinal'][_0x14e3('0x56')](_0xff15ab);});}})[_0x14e3('0x4c')](function(){return _0x372f19['status'](0xcc)[_0x14e3('0x18')]();})[_0x14e3('0x58')](handleError(_0x372f19,null));};exports[_0x14e3('0x71')]=function(_0x518389,_0x4579a8,_0x4f5781){var _0x5ac72d=[];return db['CmContact'][_0x14e3('0x59')]()[_0x14e3('0x4c')](function(_0x42c5d6){_0x5ac72d=_[_0x14e3('0x29')](_0x42c5d6);return _0x518389[_0x14e3('0x63')][_0x14e3('0x72')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x14e3('0x73')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})['then'](function(_0x5a7b38){if(_0x5a7b38&&_0x5a7b38[_0x14e3('0x53')]){return db[_0x14e3('0x74')][_0x14e3('0x75')](function(_0x5737cf){var _0x260315={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x14e3('0x76')](_0x14e3('0x64'))},'VoiceQueueId':{'$in':_[_0x14e3('0x48')](_0x5a7b38,'id')},'$or':[{'UserId':null},{'UserId':_0x518389[_0x14e3('0x63')]['id']}]};var _0x53d4fd=[];if(_0x518389[_0x14e3('0x57')]['direction']&&_0x518389[_0x14e3('0x57')]['direction']==='prev'){if(!_['isEmpty'](_0x518389[_0x14e3('0x57')][_0x14e3('0x77')])){_0x260315['id']={'$in':_0x518389['body'][_0x14e3('0x77')]};}_0x53d4fd=[[_0x14e3('0x78'),'ASC'],[_0x14e3('0x79'),_0x5a7b38[0x0][_0x14e3('0x7a')]===_0x14e3('0x7b')?_0x14e3('0x7c'):'ASC'],db['sequelize'][_0x14e3('0x7d')](_0x14e3('0x7e')),['id',_0x14e3('0x7c')]];}else{if(!_['isEmpty'](_0x518389[_0x14e3('0x57')]['hopperIds'])){_0x260315['id']={'$notIn':_0x518389['body'][_0x14e3('0x77')]};}_0x53d4fd=[[_0x14e3('0x78'),_0x14e3('0x7c')],[_0x14e3('0x79'),_0x5a7b38[0x0]['dialOrderByScheduledAt']],db[_0x14e3('0x74')][_0x14e3('0x7d')](_0x14e3('0x7f')),['id',_0x14e3('0x7b')]];}return db[_0x14e3('0x27')][_0x14e3('0x80')]({'attributes':['id',_0x14e3('0x81')],'where':_0x260315,'order':_0x53d4fd,'transaction':_0x5737cf,'lock':_0x5737cf['LOCK']['UPDATE'],'include':[{'model':db[_0x14e3('0x6a')],'as':_0x14e3('0x82'),'attributes':_0x5ac72d,'include':[{'model':db[_0x14e3('0x83')],'as':'Company','attributes':['id',_0x14e3('0x24')]}]},{'model':db[_0x14e3('0x84')],'as':_0x14e3('0x85'),'attributes':['id','name']},{'model':db[_0x14e3('0x86')],'as':_0x14e3('0x87'),'attributes':['id','name',_0x14e3('0x88')]}]})['then'](function(_0x1ab71a){if(_0x1ab71a){return _0x1ab71a[_0x14e3('0x21')]({'UserId':_0x518389['user']['id']},{'transaction':_0x5737cf});}});});}})[_0x14e3('0x4c')](handleEntityNotFound(_0x4579a8,null))[_0x14e3('0x4c')](respondWithResult(_0x4579a8,null))[_0x14e3('0x58')](handleError(_0x4579a8,null));};exports[_0x14e3('0x89')]=function(_0x1fdcca,_0x31a1a3,_0x34a6be){return _0x1fdcca[_0x14e3('0x63')][_0x14e3('0x72')]({'where':{'type':_0x14e3('0x8a'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x14e3('0x4c')](function(_0x318317){if(_0x318317&&_0x318317[_0x14e3('0x53')]){return db['CmHopper'][_0x14e3('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x14e3('0x76')](_0x14e3('0x64'))},'VoiceQueueId':{'$in':_[_0x14e3('0x48')](_0x318317,'id')},'$or':[{'UserId':null},{'UserId':_0x1fdcca[_0x14e3('0x63')]['id']}]}});}return 0x0;})[_0x14e3('0x4c')](function(_0x2d7eb7){if(!_[_0x14e3('0x6d')](_0x2d7eb7)&&_[_0x14e3('0x8b')](_0x2d7eb7)){return _0x31a1a3[_0x14e3('0x1d')](0xc8)['json']({'contacts':_0x2d7eb7});}else{logger['error'](_0x14e3('0x8c'),_0x14e3('0x89'),0x194,_0x14e3('0x8d'));_0x31a1a3[_0x14e3('0x17')](0x194);}})[_0x14e3('0x58')](handleError(_0x31a1a3,null));}; \ No newline at end of file +var _0xb5d3=['transaction','format','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','CmCompany','Company','CmList','List','VoiceQueue','dialActive','getOpenContacts','isNumber','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','limit','apply','reject','save','then','error','stack','name','index','CmHopper','rawAttributes','model','keys','query','filters','intersection','$and','$or','$gt','$gte','$lt','$lte','$eq','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','pick','where','merge','map','key','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','deleted','user','UserId','deletedat','phone','campaigntype','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize'];(function(_0x470f62,_0x103ee2){var _0x9c64cb=function(_0x24c759){while(--_0x24c759){_0x470f62['push'](_0x470f62['shift']());}};_0x9c64cb(++_0x103ee2);}(_0xb5d3,0x1a8));var _0x3b5d=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0xb5d3[_0x128450];return _0x4d80ed;};'use strict';var pdf=require(_0x3b5d('0x0'));var emlformat=require(_0x3b5d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3b5d('0x2'));var jsonpatch=require(_0x3b5d('0x3'));var rp=require(_0x3b5d('0x4'));var moment=require('moment');var BPromise=require(_0x3b5d('0x5'));var Mustache=require(_0x3b5d('0x6'));var util=require(_0x3b5d('0x7'));var path=require('path');var sox=require(_0x3b5d('0x8'));var csv=require(_0x3b5d('0x9'));var ejs=require(_0x3b5d('0xa'));var fs=require('fs');var _=require(_0x3b5d('0xb'));var squel=require(_0x3b5d('0xc'));var crypto=require(_0x3b5d('0xd'));var jsforce=require(_0x3b5d('0xe'));var deskjs=require(_0x3b5d('0xf'));var toCsv=require(_0x3b5d('0x9'));var querystring=require('querystring');var Papa=require(_0x3b5d('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(_0x3b5d('0x11'))('api');var utils=require(_0x3b5d('0x12'));var config=require('../../config/environment');var db=require(_0x3b5d('0x13'))['db'];function respondWithStatusCode(_0x57f22f,_0x1ae0b6){_0x1ae0b6=_0x1ae0b6||0xcc;return function(_0x51ee85){if(_0x51ee85){return _0x57f22f[_0x3b5d('0x14')](_0x1ae0b6);}return _0x57f22f[_0x3b5d('0x15')](_0x1ae0b6)[_0x3b5d('0x16')]();};}function respondWithResult(_0x5869d2,_0x31b4a3){_0x31b4a3=_0x31b4a3||0xc8;return function(_0x5512fd){if(_0x5512fd){return _0x5869d2[_0x3b5d('0x15')](_0x31b4a3)[_0x3b5d('0x17')](_0x5512fd);}};}function respondWithFilteredResult(_0xbdadb2,_0x486baa){return function(_0x6904a4){if(_0x6904a4){var _0x365688=_0x6904a4[_0x3b5d('0x18')],_0x10ea4b=_0x486baa['offset'],_0x3ea0f4=_0x486baa['offset']+_0x486baa[_0x3b5d('0x19')],_0x482396;if(_0x3ea0f4>=_0x365688){_0x3ea0f4=_0x365688;_0x482396=0xc8;}else{_0x482396=0xce;}_0xbdadb2['status'](_0x482396);return _0xbdadb2['set']('Content-Range',_0x10ea4b+'-'+_0x3ea0f4+'/'+_0x365688)['json'](_0x6904a4);}return null;};}function patchUpdates(_0x5207cc){return function(_0x44ebc8){try{jsonpatch[_0x3b5d('0x1a')](_0x44ebc8,_0x5207cc,!![]);}catch(_0x2928d6){return BPromise[_0x3b5d('0x1b')](_0x2928d6);}return _0x44ebc8[_0x3b5d('0x1c')]();};}function saveUpdates(_0x4a68d6,_0x136f79){return function(_0x266ca5){if(_0x266ca5){return _0x266ca5['update'](_0x4a68d6)[_0x3b5d('0x1d')](function(_0x51274f){return _0x51274f;});}return null;};}function removeEntity(_0x559ffe,_0xbb0cd6){return function(_0x2c71c7){if(_0x2c71c7){return _0x2c71c7['destroy']()[_0x3b5d('0x1d')](function(){_0x559ffe[_0x3b5d('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28adda,_0x376eb7){return function(_0x539296){if(!_0x539296){_0x28adda[_0x3b5d('0x14')](0x194);}return _0x539296;};}function handleError(_0x16159a,_0x4a4cd7){_0x4a4cd7=_0x4a4cd7||0x1f4;return function(_0x5b6a11){logger[_0x3b5d('0x1e')](_0x5b6a11[_0x3b5d('0x1f')]);if(_0x5b6a11[_0x3b5d('0x20')]){delete _0x5b6a11[_0x3b5d('0x20')];}_0x16159a[_0x3b5d('0x15')](_0x4a4cd7)['send'](_0x5b6a11);};}exports[_0x3b5d('0x21')]=function(_0xb9f5fd,_0x39e1a8){var _0x5047f9={},_0x5df434={},_0x49e799={'count':0x0,'rows':[]};var _0x1b98ae=db[_0x3b5d('0x22')][_0x3b5d('0x23')];_0x5df434[_0x3b5d('0x24')]=_[_0x3b5d('0x25')](_0x1b98ae);_0x5df434[_0x3b5d('0x26')]=_[_0x3b5d('0x25')](_0xb9f5fd[_0x3b5d('0x26')]);_0x5df434[_0x3b5d('0x27')]=_[_0x3b5d('0x28')](_0x5df434[_0x3b5d('0x24')],_0x5df434['query']);_0x5df434[_0x3b5d('0x27')]=_['concat'](_0x5df434[_0x3b5d('0x27')],[_0x3b5d('0x29'),_0x3b5d('0x2a'),_0x3b5d('0x2b'),_0x3b5d('0x2c'),_0x3b5d('0x2d'),_0x3b5d('0x2e'),'$ne',_0x3b5d('0x2f'),'$not','$between',_0x3b5d('0x30'),'$in',_0x3b5d('0x31'),_0x3b5d('0x32'),_0x3b5d('0x33'),_0x3b5d('0x34'),_0x3b5d('0x35'),_0x3b5d('0x32'),'$overlap',_0x3b5d('0x36'),_0x3b5d('0x37'),_0x3b5d('0x38')]);_0x5047f9[_0x3b5d('0x39')]=_[_0x3b5d('0x28')](_0x5df434[_0x3b5d('0x24')],qs[_0x3b5d('0x3a')](_0xb9f5fd[_0x3b5d('0x26')]['fields']));_0x5047f9[_0x3b5d('0x39')]=_0x5047f9[_0x3b5d('0x39')][_0x3b5d('0x3b')]?_0x5047f9['attributes']:_0x5df434[_0x3b5d('0x24')];if(!_0xb9f5fd['query'][_0x3b5d('0x3c')](_0x3b5d('0x3d'))){_0x5047f9[_0x3b5d('0x19')]=qs['limit'](_0xb9f5fd['query'][_0x3b5d('0x19')]);_0x5047f9['offset']=qs[_0x3b5d('0x3e')](_0xb9f5fd[_0x3b5d('0x26')][_0x3b5d('0x3e')]);}_0x5047f9['order']=qs['sort'](_0xb9f5fd[_0x3b5d('0x26')][_0x3b5d('0x3f')]);_0x5047f9['where']=qs[_0x3b5d('0x27')](_[_0x3b5d('0x40')](_0xb9f5fd['query'],_0x5df434[_0x3b5d('0x27')]));if(_0xb9f5fd[_0x3b5d('0x26')]['filter']){_0x5047f9[_0x3b5d('0x41')]=_[_0x3b5d('0x42')](_0x5047f9['where'],{'$or':_[_0x3b5d('0x43')](_0x1b98ae,function(_0x4cf141){if(_0x4cf141['type'][_0x3b5d('0x44')]!==_0x3b5d('0x45')){var _0x2e9114={};_0x2e9114[_0x4cf141['field']]={'$like':'%'+_0xb9f5fd['query']['filter']+'%'};return _0x2e9114;}})});}_0x5047f9=_[_0x3b5d('0x42')]({},_0x5047f9,_0xb9f5fd[_0x3b5d('0x46')]);var _0x32ecc1={'where':_0x5047f9[_0x3b5d('0x41')]};return db[_0x3b5d('0x22')][_0x3b5d('0x18')](_0x32ecc1)[_0x3b5d('0x1d')](function(_0x256ff4){_0x49e799[_0x3b5d('0x18')]=_0x256ff4;if(_0xb9f5fd[_0x3b5d('0x26')][_0x3b5d('0x47')]){_0x5047f9[_0x3b5d('0x48')]=[{'all':!![]}];}return db[_0x3b5d('0x22')][_0x3b5d('0x49')](_0x5047f9);})[_0x3b5d('0x1d')](function(_0x4a322b){_0x49e799['rows']=_0x4a322b;return _0x49e799;})[_0x3b5d('0x1d')](respondWithFilteredResult(_0x39e1a8,_0x5047f9))[_0x3b5d('0x4a')](handleError(_0x39e1a8,null));};exports[_0x3b5d('0x4b')]=function(_0x20137b,_0x2fcdf7){var _0x2f8d60={'raw':!![],'where':{'id':_0x20137b[_0x3b5d('0x4c')]['id']}},_0x536cc9={};_0x536cc9[_0x3b5d('0x24')]=_[_0x3b5d('0x25')](db[_0x3b5d('0x22')][_0x3b5d('0x23')]);_0x536cc9[_0x3b5d('0x26')]=_[_0x3b5d('0x25')](_0x20137b['query']);_0x536cc9[_0x3b5d('0x27')]=_['intersection'](_0x536cc9[_0x3b5d('0x24')],_0x536cc9[_0x3b5d('0x26')]);_0x2f8d60['attributes']=_[_0x3b5d('0x28')](_0x536cc9[_0x3b5d('0x24')],qs['fields'](_0x20137b[_0x3b5d('0x26')]['fields']));_0x2f8d60['attributes']=_0x2f8d60[_0x3b5d('0x39')][_0x3b5d('0x3b')]?_0x2f8d60[_0x3b5d('0x39')]:_0x536cc9[_0x3b5d('0x24')];if(_0x20137b['query'][_0x3b5d('0x47')]){_0x2f8d60[_0x3b5d('0x48')]=[{'all':!![]}];}_0x2f8d60=_[_0x3b5d('0x42')]({},_0x2f8d60,_0x20137b[_0x3b5d('0x46')]);return db[_0x3b5d('0x22')][_0x3b5d('0x4d')](_0x2f8d60)['then'](handleEntityNotFound(_0x2fcdf7,null))[_0x3b5d('0x1d')](respondWithResult(_0x2fcdf7,null))[_0x3b5d('0x4a')](handleError(_0x2fcdf7,null));};exports['create']=function(_0xe221c5,_0x8074bd){return db[_0x3b5d('0x22')][_0x3b5d('0x4e')](_0xe221c5[_0x3b5d('0x4f')],{})[_0x3b5d('0x1d')](respondWithResult(_0x8074bd,0xc9))['catch'](handleError(_0x8074bd,null));};exports[_0x3b5d('0x50')]=function(_0x9af657,_0x16e28e){if(_0x9af657[_0x3b5d('0x4f')]['id']){delete _0x9af657[_0x3b5d('0x4f')]['id'];}return db[_0x3b5d('0x22')][_0x3b5d('0x4d')]({'where':{'id':_0x9af657['params']['id']}})[_0x3b5d('0x1d')](handleEntityNotFound(_0x16e28e,null))['then'](saveUpdates(_0x9af657[_0x3b5d('0x4f')],null))[_0x3b5d('0x1d')](respondWithResult(_0x16e28e,null))[_0x3b5d('0x4a')](handleError(_0x16e28e,null));};exports[_0x3b5d('0x51')]=function(_0x28a71d,_0x4e16c5){return db[_0x3b5d('0x22')][_0x3b5d('0x51')]()['then'](respondWithResult(_0x4e16c5,null))[_0x3b5d('0x4a')](handleError(_0x4e16c5,null));};exports[_0x3b5d('0x52')]=function(_0x12dbe4,_0x19623f){var _0x53a134;return db[_0x3b5d('0x22')][_0x3b5d('0x4d')]({'where':{'id':_0x12dbe4[_0x3b5d('0x4c')]['id']}})[_0x3b5d('0x1d')](handleEntityNotFound(_0x19623f,null))['then'](function(_0x50af6f){if(_0x50af6f){return _0x50af6f[_0x3b5d('0x52')]()[_0x3b5d('0x1d')](function(_0xe8d4c1){return _0xe8d4c1;});}})[_0x3b5d('0x1d')](function(_0x3219d0){_0x53a134=_0x3219d0;if(_0x3219d0){if(_0x3219d0[_0x3b5d('0x53')]||_0x3219d0[_0x3b5d('0x54')]){return db[_0x3219d0['VoiceQueueId']?'VoiceQueue':_0x3b5d('0x55')][_0x3b5d('0x4d')]({'where':{'id':_0x3219d0[_0x3b5d('0x53')]?_0x3219d0[_0x3b5d('0x53')]:_0x3219d0[_0x3b5d('0x54')]},'attributes':['id',_0x3b5d('0x20')],'raw':!![]});}}})[_0x3b5d('0x1d')](function(_0x580a11){var _0xa0aa0a={};if(_0x580a11){_['merge'](_0xa0aa0a,_[_0x3b5d('0x56')](_0x53a134[_0x3b5d('0x57')],[_0x3b5d('0x58'),_0x3b5d('0x59'),'id']));_0xa0aa0a['state']=0x15;_0xa0aa0a['statedesc']=_0x3b5d('0x5a');_0xa0aa0a['campaign']=_0x580a11['name'];_0xa0aa0a['membername']=_0x12dbe4[_0x3b5d('0x5b')][_0x3b5d('0x20')];_0xa0aa0a[_0x3b5d('0x5c')]=_0x12dbe4[_0x3b5d('0x5b')]['id'];_0xa0aa0a['deleted']=!![];_0xa0aa0a[_0x3b5d('0x5d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xa0aa0a['calleridnum']=_0x53a134[_0x3b5d('0x5e')];_0xa0aa0a[_0x3b5d('0x5f')]=_0x53a134['VoiceQueueId']?'queue':'ivr';return db[_0x3b5d('0x60')][_0x3b5d('0x4d')]({'where':{'id':_0xa0aa0a[_0x3b5d('0x61')]},'attributes':[_0x3b5d('0x62'),_0x3b5d('0x63')]})[_0x3b5d('0x1d')](function(_0x5c1376){if(!_[_0x3b5d('0x64')](_0x19623f)&&!_['isNil'](_0x5c1376['firstName'])){_0xa0aa0a[_0x3b5d('0x65')]=_0x5c1376['firstName'];if(!_['isNil'](_0x5c1376[_0x3b5d('0x63')])){_0xa0aa0a['calleridname']+='\x20'+_0x5c1376[_0x3b5d('0x63')];}}})[_0x3b5d('0x66')](function(){return db['CmHopperFinal']['create'](_0xa0aa0a);});}})['then'](function(){return _0x19623f[_0x3b5d('0x15')](0xcc)[_0x3b5d('0x16')]();})[_0x3b5d('0x4a')](handleError(_0x19623f,null));};exports[_0x3b5d('0x67')]=function(_0x169dcd,_0x4620c3,_0x331428){var _0x460bd8=[];return db['CmContact'][_0x3b5d('0x51')]()[_0x3b5d('0x1d')](function(_0x20888a){_0x460bd8=_['keys'](_0x20888a);return _0x169dcd[_0x3b5d('0x5b')][_0x3b5d('0x68')]({'where':{'type':_0x3b5d('0x69'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x3b5d('0x6a')],'raw':!![]});})[_0x3b5d('0x1d')](function(_0x5124e0){if(_0x5124e0&&_0x5124e0[_0x3b5d('0x3b')]){return db[_0x3b5d('0x6b')][_0x3b5d('0x6c')](function(_0x194a4b){var _0x1053a8={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3b5d('0x6d')](_0x3b5d('0x6e'))},'VoiceQueueId':{'$in':_[_0x3b5d('0x43')](_0x5124e0,'id')},'$or':[{'UserId':null},{'UserId':_0x169dcd[_0x3b5d('0x5b')]['id']}]};var _0x21a786=[];if(_0x169dcd[_0x3b5d('0x4f')][_0x3b5d('0x6f')]&&_0x169dcd[_0x3b5d('0x4f')][_0x3b5d('0x6f')]===_0x3b5d('0x70')){if(!_[_0x3b5d('0x71')](_0x169dcd[_0x3b5d('0x4f')][_0x3b5d('0x72')])){_0x1053a8['id']={'$in':_0x169dcd[_0x3b5d('0x4f')]['hopperIds']};}_0x21a786=[[_0x3b5d('0x73'),_0x3b5d('0x74')],[_0x3b5d('0x75'),_0x5124e0[0x0][_0x3b5d('0x6a')]===_0x3b5d('0x74')?'DESC':'ASC'],db[_0x3b5d('0x6b')][_0x3b5d('0x76')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x3b5d('0x77')]];}else{if(!_[_0x3b5d('0x71')](_0x169dcd['body'][_0x3b5d('0x72')])){_0x1053a8['id']={'$notIn':_0x169dcd[_0x3b5d('0x4f')][_0x3b5d('0x72')]};}_0x21a786=[[_0x3b5d('0x73'),_0x3b5d('0x77')],[_0x3b5d('0x75'),_0x5124e0[0x0]['dialOrderByScheduledAt']],db[_0x3b5d('0x6b')][_0x3b5d('0x76')](_0x3b5d('0x78')),['id','ASC']];}return db[_0x3b5d('0x22')][_0x3b5d('0x79')]({'attributes':['id',_0x3b5d('0x7a')],'where':_0x1053a8,'order':_0x21a786,'transaction':_0x194a4b,'lock':_0x194a4b[_0x3b5d('0x7b')][_0x3b5d('0x7c')],'include':[{'model':db[_0x3b5d('0x60')],'as':'Contact','attributes':_0x460bd8,'include':[{'model':db[_0x3b5d('0x7d')],'as':_0x3b5d('0x7e'),'attributes':['id',_0x3b5d('0x20')]}]},{'model':db[_0x3b5d('0x7f')],'as':_0x3b5d('0x80'),'attributes':['id',_0x3b5d('0x20')]},{'model':db[_0x3b5d('0x81')],'as':'Queue','attributes':['id',_0x3b5d('0x20'),_0x3b5d('0x82')]}]})[_0x3b5d('0x1d')](function(_0xaa59db){if(_0xaa59db){return _0xaa59db['update']({'UserId':_0x169dcd[_0x3b5d('0x5b')]['id']},{'transaction':_0x194a4b});}});});}})[_0x3b5d('0x1d')](handleEntityNotFound(_0x4620c3,null))[_0x3b5d('0x1d')](respondWithResult(_0x4620c3,null))['catch'](handleError(_0x4620c3,null));};exports[_0x3b5d('0x83')]=function(_0x3df6d3,_0x2e0305,_0x7e3389){return _0x3df6d3['user'][_0x3b5d('0x68')]({'where':{'type':_0x3b5d('0x69'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x48b1af){if(_0x48b1af&&_0x48b1af['length']){return db[_0x3b5d('0x22')][_0x3b5d('0x18')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3b5d('0x6d')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x48b1af,'id')},'$or':[{'UserId':null},{'UserId':_0x3df6d3[_0x3b5d('0x5b')]['id']}]}});}return 0x0;})['then'](function(_0x33243f){if(!_['isNil'](_0x33243f)&&_[_0x3b5d('0x84')](_0x33243f)){return _0x2e0305[_0x3b5d('0x15')](0xc8)[_0x3b5d('0x17')]({'contacts':_0x33243f});}else{logger[_0x3b5d('0x1e')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x3b5d('0x83'),0x194,'entity\x20not\x20found');_0x2e0305[_0x3b5d('0x14')](0x194);}})[_0x3b5d('0x4a')](handleError(_0x2e0305,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 78c4fce..5865928 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 _0x7a61=['cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./cmHopper.attributes','exports','CmHopper'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x7a61,0x1b6));var _0x17a6=function(_0x526c6e,_0x52769d){_0x526c6e=_0x526c6e-0x0;var _0x1666bf=_0x7a61[_0x526c6e];return _0x1666bf;};'use strict';var _=require(_0x17a6('0x0'));var util=require(_0x17a6('0x1'));var logger=require(_0x17a6('0x2'))(_0x17a6('0x3'));var moment=require(_0x17a6('0x4'));var BPromise=require(_0x17a6('0x5'));var rp=require(_0x17a6('0x6'));var attributes=require(_0x17a6('0x7'));module[_0x17a6('0x8')]=function(_0x6afc3e,_0xb81729){return _0x6afc3e['define'](_0x17a6('0x9'),attributes,{'tableName':_0x17a6('0xa'),'paranoid':![],'indexes':[{'name':_0x17a6('0xb'),'fields':[_0x17a6('0xb')]},{'name':_0x17a6('0xc'),'fields':[_0x17a6('0xc')]},{'name':'priority','fields':[_0x17a6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d0f=['request-promise','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','api'];(function(_0x1081b0,_0x23f3d4){var _0x348aaf=function(_0x3ee37b){while(--_0x3ee37b){_0x1081b0['push'](_0x1081b0['shift']());}};_0x348aaf(++_0x23f3d4);}(_0x8d0f,0xef));var _0xf8d0=function(_0x26a9ea,_0x10ecba){_0x26a9ea=_0x26a9ea-0x0;var _0x3bc99d=_0x8d0f[_0x26a9ea];return _0x3bc99d;};'use strict';var _=require(_0xf8d0('0x0'));var util=require(_0xf8d0('0x1'));var logger=require('../../config/logger')(_0xf8d0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf8d0('0x3'));var attributes=require('./cmHopper.attributes');module[_0xf8d0('0x4')]=function(_0x4a5e63,_0xbeb6ac){return _0x4a5e63[_0xf8d0('0x5')](_0xf8d0('0x6'),attributes,{'tableName':_0xf8d0('0x7'),'paranoid':![],'indexes':[{'name':_0xf8d0('0x8'),'fields':[_0xf8d0('0x8')]},{'name':_0xf8d0('0x9'),'fields':[_0xf8d0('0x9')]},{'name':_0xf8d0('0xa'),'fields':[_0xf8d0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index d951120..a64ce7b 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 _0x88ad=['code','message','info','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowCmHopper','find','then','CreateCmHopper','body','UpdateCmHopper','update','destroy','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','LOCK','UPDATE','CmContact','Contact','keys','length','push','all','MoveContactManagedDialer','CmHopperFinal','create','CountReScheduled','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','UserId','GetContactRecallMe','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0x88ad,0xfd));var _0xd88a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x88ad[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xd88a('0x0'));var util=require(_0xd88a('0x1'));var moment=require(_0xd88a('0x2'));var BPromise=require(_0xd88a('0x3'));var rs=require(_0xd88a('0x4'));var fs=require('fs');var Redis=require(_0xd88a('0x5'));var db=require(_0xd88a('0x6'))['db'];var utils=require(_0xd88a('0x7'));var logger=require(_0xd88a('0x8'))('rpc');var config=require(_0xd88a('0x9'));var jayson=require(_0xd88a('0xa'));var client=jayson[_0xd88a('0xb')][_0xd88a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3997e3,_0x592082,_0x4d80e1){return new BPromise(function(_0x3e8d16,_0xb0f920){return client[_0xd88a('0xd')](_0x3997e3,_0x4d80e1)['then'](function(_0xd6b3d0){logger['info'](_0xd88a('0xe'),_0x592082,_0xd88a('0xf'));logger[_0xd88a('0x10')](_0xd88a('0x11'),_0x592082,_0xd88a('0xf'),JSON['stringify'](_0xd6b3d0));if(_0xd6b3d0[_0xd88a('0x12')]){if(_0xd6b3d0['error'][_0xd88a('0x13')]===0x1f4){logger['error'](_0xd88a('0xe'),_0x592082,_0xd6b3d0['error'][_0xd88a('0x14')]);return _0xb0f920(_0xd6b3d0[_0xd88a('0x12')]['message']);}logger[_0xd88a('0x12')](_0xd88a('0xe'),_0x592082,_0xd6b3d0[_0xd88a('0x12')]['message']);return _0x3e8d16(_0xd6b3d0['error'][_0xd88a('0x14')]);}else{logger[_0xd88a('0x15')](_0xd88a('0xe'),_0x592082,_0xd88a('0xf'));_0x3e8d16(_0xd6b3d0[_0xd88a('0x16')][_0xd88a('0x14')]);}})[_0xd88a('0x17')](function(_0xeba8da){logger[_0xd88a('0x12')](_0xd88a('0xe'),_0x592082,_0xeba8da);_0xb0f920(_0xeba8da);});});}exports[_0xd88a('0x18')]=function(_0x1a0a5c){var _0x2bf986=this;return new Promise(function(_0x34e38f,_0xaf1745){return db[_0xd88a('0x19')][_0xd88a('0x1a')]({'raw':_0x1a0a5c[_0xd88a('0x1b')]?_0x1a0a5c[_0xd88a('0x1b')][_0xd88a('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a0a5c[_0xd88a('0x1b')]?_0x1a0a5c['options'][_0xd88a('0x1d')]||null:null,'attributes':_0x1a0a5c[_0xd88a('0x1b')]?_0x1a0a5c[_0xd88a('0x1b')]['attributes']||null:null,'limit':_0x1a0a5c[_0xd88a('0x1b')]?_0x1a0a5c['options'][_0xd88a('0x1e')]||null:null,'include':_0x1a0a5c[_0xd88a('0x1b')]?_0x1a0a5c[_0xd88a('0x1b')][_0xd88a('0x1f')]?_[_0xd88a('0x20')](_0x1a0a5c[_0xd88a('0x1b')][_0xd88a('0x1f')],function(_0x4c8eac){return{'model':db[_0x4c8eac[_0xd88a('0x21')]],'as':_0x4c8eac['as'],'attributes':_0x4c8eac[_0xd88a('0x22')],'include':_0x4c8eac[_0xd88a('0x1f')]?_['map'](_0x4c8eac[_0xd88a('0x1f')],function(_0x4864b1){return{'model':db[_0x4864b1[_0xd88a('0x21')]],'as':_0x4864b1['as'],'attributes':_0x4864b1[_0xd88a('0x22')],'include':_0x4864b1[_0xd88a('0x1f')]?_[_0xd88a('0x20')](_0x4864b1['include'],function(_0x7140c7){return{'model':db[_0x7140c7[_0xd88a('0x21')]],'as':_0x7140c7['as'],'attributes':_0x7140c7[_0xd88a('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2559d0){logger[_0xd88a('0x15')](_0xd88a('0x18'),_0x1a0a5c);logger['debug'](_0xd88a('0x18'),_0x1a0a5c,JSON[_0xd88a('0x23')](_0x2559d0));_0x34e38f(_0x2559d0);})[_0xd88a('0x17')](function(_0x119497){logger['error'](_0xd88a('0x18'),_0x119497[_0xd88a('0x14')],_0x1a0a5c);_0xaf1745(_0x2bf986[_0xd88a('0x12')](0x1f4,_0x119497[_0xd88a('0x14')]));});});};exports[_0xd88a('0x24')]=function(_0x530236){var _0x205a6b=this;return new Promise(function(_0x11170c,_0x3acaff){return db[_0xd88a('0x19')][_0xd88a('0x25')]({'raw':_0x530236[_0xd88a('0x1b')]?_0x530236['options'][_0xd88a('0x1c')]===undefined?!![]:![]:!![],'where':_0x530236['options']?_0x530236[_0xd88a('0x1b')][_0xd88a('0x1d')]||null:null,'attributes':_0x530236['options']?_0x530236[_0xd88a('0x1b')][_0xd88a('0x22')]||null:null,'include':_0x530236[_0xd88a('0x1b')]?_0x530236[_0xd88a('0x1b')][_0xd88a('0x1f')]?_[_0xd88a('0x20')](_0x530236[_0xd88a('0x1b')][_0xd88a('0x1f')],function(_0x43fa16){return{'model':db[_0x43fa16[_0xd88a('0x21')]],'as':_0x43fa16['as'],'attributes':_0x43fa16[_0xd88a('0x22')],'include':_0x43fa16[_0xd88a('0x1f')]?_[_0xd88a('0x20')](_0x43fa16[_0xd88a('0x1f')],function(_0x3bbb5f){return{'model':db[_0x3bbb5f[_0xd88a('0x21')]],'as':_0x3bbb5f['as'],'attributes':_0x3bbb5f['attributes'],'include':_0x3bbb5f[_0xd88a('0x1f')]?_[_0xd88a('0x20')](_0x3bbb5f[_0xd88a('0x1f')],function(_0x18d12a){return{'model':db[_0x18d12a[_0xd88a('0x21')]],'as':_0x18d12a['as'],'attributes':_0x18d12a[_0xd88a('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd88a('0x26')](function(_0x5570c8){logger[_0xd88a('0x15')](_0xd88a('0x24'),_0x530236);logger[_0xd88a('0x10')]('ShowCmHopper',_0x530236,JSON[_0xd88a('0x23')](_0x5570c8));_0x11170c(_0x5570c8);})[_0xd88a('0x17')](function(_0x59633f){logger['error'](_0xd88a('0x24'),_0x59633f[_0xd88a('0x14')],_0x530236);_0x3acaff(_0x205a6b[_0xd88a('0x12')](0x1f4,_0x59633f['message']));});});};exports[_0xd88a('0x27')]=function(_0x47ccd7){var _0x34f305=this;return new Promise(function(_0x6eaa66,_0x263214){return db[_0xd88a('0x19')]['create'](_0x47ccd7[_0xd88a('0x28')],{'raw':_0x47ccd7[_0xd88a('0x1b')]?_0x47ccd7[_0xd88a('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2f7603){logger[_0xd88a('0x15')](_0xd88a('0x27'),_0x47ccd7);logger[_0xd88a('0x10')](_0xd88a('0x27'),_0x47ccd7,JSON['stringify'](_0x2f7603));_0x6eaa66(_0x2f7603);})[_0xd88a('0x17')](function(_0x139d23){logger[_0xd88a('0x12')]('CreateCmHopper',_0x139d23[_0xd88a('0x14')],_0x47ccd7);_0x263214(_0x34f305[_0xd88a('0x12')](0x1f4,_0x139d23['message']));});});};exports[_0xd88a('0x29')]=function(_0x11d88e){var _0xca1337=this;return new Promise(function(_0x5e9e54,_0x484f35){return db[_0xd88a('0x19')][_0xd88a('0x2a')](_0x11d88e[_0xd88a('0x28')],{'raw':_0x11d88e['options']?_0x11d88e[_0xd88a('0x1b')][_0xd88a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11d88e[_0xd88a('0x1b')]?_0x11d88e[_0xd88a('0x1b')][_0xd88a('0x1d')]||null:null,'attributes':_0x11d88e[_0xd88a('0x1b')]?_0x11d88e[_0xd88a('0x1b')][_0xd88a('0x22')]||null:null,'limit':_0x11d88e[_0xd88a('0x1b')]?_0x11d88e[_0xd88a('0x1b')]['limit']||null:null})[_0xd88a('0x26')](function(_0x5d3649){logger[_0xd88a('0x15')](_0xd88a('0x29'),_0x11d88e);logger[_0xd88a('0x10')]('UpdateCmHopper',_0x11d88e,JSON[_0xd88a('0x23')](_0x5d3649));_0x5e9e54(_0x5d3649);})[_0xd88a('0x17')](function(_0x11c938){logger[_0xd88a('0x12')](_0xd88a('0x29'),_0x11c938[_0xd88a('0x14')],_0x11d88e);_0x484f35(_0xca1337[_0xd88a('0x12')](0x1f4,_0x11c938[_0xd88a('0x14')]));});});};exports['DestroyCmHopper']=function(_0x2f0c05){var _0x573924=this;return new Promise(function(_0x10255f,_0x179acb){return db[_0xd88a('0x19')][_0xd88a('0x2b')]({'where':_0x2f0c05[_0xd88a('0x1b')]?_0x2f0c05['options'][_0xd88a('0x1d')]||null:null})[_0xd88a('0x26')](function(_0x350480){logger[_0xd88a('0x15')](_0xd88a('0x2c'),_0x2f0c05);logger[_0xd88a('0x10')](_0xd88a('0x2c'),_0x2f0c05,JSON[_0xd88a('0x23')](_0x350480));_0x10255f(_0x350480);})[_0xd88a('0x17')](function(_0x5dcd3f){logger['error'](_0xd88a('0x2c'),_0x5dcd3f[_0xd88a('0x14')],_0x2f0c05);_0x179acb(_0x573924['error'](0x1f4,_0x5dcd3f[_0xd88a('0x14')]));});});};exports[_0xd88a('0x2d')]=function(_0x45c0c0){var _0x3eeaab=this;return new Promise(function(_0x3561e9,_0x5d8f79){return db['CmContact'][_0xd88a('0x2e')]()[_0xd88a('0x26')](function(_0x14c543){return db[_0xd88a('0x2f')][_0xd88a('0x30')](function(_0xb70d7f){return db[_0xd88a('0x19')][_0xd88a('0x1a')]({'where':_0x45c0c0['options']?_0x45c0c0[_0xd88a('0x1b')]['where']||null:null,'attributes':_0x45c0c0[_0xd88a('0x1b')]?_0x45c0c0[_0xd88a('0x1b')]['attributes']||null:null,'limit':_0x45c0c0['options']?_0x45c0c0['options'][_0xd88a('0x1e')]||null:null,'order':_0x45c0c0['options']?_0x45c0c0[_0xd88a('0x1b')]['order']||null:null,'transaction':_0xb70d7f,'lock':_0xb70d7f[_0xd88a('0x31')][_0xd88a('0x32')],'include':[{'model':db[_0xd88a('0x33')],'as':_0xd88a('0x34'),'attributes':_[_0xd88a('0x35')](_0x14c543)}]})[_0xd88a('0x26')](function(_0x5dfbf0){var _0x14fc0c=[];for(var _0x116ea8=0x0;_0x116ea8<_0x5dfbf0[_0xd88a('0x36')];_0x116ea8+=0x1){_0x14fc0c[_0xd88a('0x37')](_0x5dfbf0[_0x116ea8][_0xd88a('0x2a')](_0x45c0c0[_0xd88a('0x28')],{'transaction':_0xb70d7f}));}return BPromise[_0xd88a('0x38')](_0x14fc0c);});})[_0xd88a('0x26')](function(_0x104fe7){logger['info'](_0xd88a('0x2d'),_0x45c0c0);logger[_0xd88a('0x10')](_0xd88a('0x2d'),_0x45c0c0,JSON[_0xd88a('0x23')](_0x104fe7));_0x3561e9(_0x104fe7);})[_0xd88a('0x17')](function(_0x3141cc){logger['error'](_0xd88a('0x2d'),_0x3141cc['message'],_0x45c0c0);_0x5d8f79(_0x3eeaab['error'](0x1f4,_0x3141cc[_0xd88a('0x14')]));});});});};exports[_0xd88a('0x39')]=function(_0x296c68){var _0x1f77b1=this;return new Promise(function(_0x3f7636,_0x33f1be){return db[_0xd88a('0x2f')]['transaction'](function(_0x5ab8e8){return db[_0xd88a('0x3a')][_0xd88a('0x3b')](_0x296c68[_0xd88a('0x28')],{'raw':_0x296c68[_0xd88a('0x1b')]?_0x296c68['options'][_0xd88a('0x1c')]===undefined?!![]:![]:!![],'transaction':_0x5ab8e8})[_0xd88a('0x26')](function(){return db[_0xd88a('0x19')][_0xd88a('0x2b')]({'where':_0x296c68[_0xd88a('0x1b')]?_0x296c68['options'][_0xd88a('0x1d')]||null:null,'transaction':_0x5ab8e8});});})[_0xd88a('0x26')](function(_0x3c4a6d){logger['info'](_0xd88a('0x39'),_0x296c68);logger[_0xd88a('0x10')](_0xd88a('0x39'),_0x296c68,JSON[_0xd88a('0x23')](_0x3c4a6d));_0x3f7636(_0x3c4a6d);})[_0xd88a('0x17')](function(_0x17c021){logger[_0xd88a('0x12')](_0xd88a('0x39'),_0x17c021['message'],_0x296c68);_0x33f1be(_0x1f77b1[_0xd88a('0x12')](0x1f4,_0x17c021['message']));});});};exports[_0xd88a('0x3c')]=function(_0x24a0d6){var _0x4f9948=this;return new Promise(function(_0x555083,_0x1f6fd9){return db['CmHopper']['findAll']({'raw':_0x24a0d6[_0xd88a('0x1b')]?_0x24a0d6['options'][_0xd88a('0x1c')]===undefined?!![]:![]:!![],'where':_0x24a0d6[_0xd88a('0x1b')]?_0x24a0d6[_0xd88a('0x1b')][_0xd88a('0x1d')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xd88a('0x2f')]['fn']('IF',db[_0xd88a('0x2f')]['literal'](_0xd88a('0x3d')+util[_0xd88a('0x3e')]('\x22%s\x22',moment()['format'](_0xd88a('0x3f')))+_0xd88a('0x40')))),_0xd88a('0x41')]]})[_0xd88a('0x26')](function(_0x2ed1cb){logger['info'](_0xd88a('0x3c'),_0x24a0d6);logger[_0xd88a('0x10')](_0xd88a('0x3c'),_0x24a0d6,JSON['stringify'](_0x2ed1cb));_0x555083(_0x2ed1cb);})[_0xd88a('0x17')](function(_0x14c8ba){logger['error'](_0xd88a('0x3c'),_0x14c8ba[_0xd88a('0x14')],_0x24a0d6);_0x1f6fd9(_0x4f9948[_0xd88a('0x12')](0x1f4,_0x14c8ba['message']));});});};exports['GetContactRecallMe']=function(_0x2268df){var _0x53cb9c=this;return new Promise(function(_0x30b689,_0x39d5dc){return db[_0xd88a('0x33')][_0xd88a('0x2e')]()[_0xd88a('0x26')](function(_0x366986){return db[_0xd88a('0x2f')]['transaction'](function(_0x473696){return db['CmHopper']['findAll']({'where':_0x2268df[_0xd88a('0x1b')]?_0x2268df[_0xd88a('0x1b')][_0xd88a('0x1d')]||null:null,'attributes':_0x2268df[_0xd88a('0x1b')]?_0x2268df[_0xd88a('0x1b')][_0xd88a('0x22')]||null:null,'limit':0x1,'order':_0x2268df[_0xd88a('0x1b')]?_0x2268df['options']['order']||null:null,'group':db[_0xd88a('0x19')][_0xd88a('0x42')],'transaction':_0x473696,'lock':_0x473696[_0xd88a('0x31')][_0xd88a('0x32')],'include':_0x2268df[_0xd88a('0x1b')]?_0x2268df['options'][_0xd88a('0x1f')]?_[_0xd88a('0x20')](_0x2268df[_0xd88a('0x1b')]['include'],function(_0x2a792b){return{'model':db[_0x2a792b['model']],'as':_0x2a792b['as'],'attributes':_0x2a792b[_0xd88a('0x22')],'include':_0x2a792b[_0xd88a('0x1f')]?_[_0xd88a('0x20')](_0x2a792b[_0xd88a('0x1f')],function(_0xf22f5c){return{'model':db[_0xf22f5c[_0xd88a('0x21')]],'as':_0xf22f5c['as'],'attributes':_0xf22f5c[_0xd88a('0x22')],'include':_0xf22f5c['include']?_['map'](_0xf22f5c['include'],function(_0x2995e8){return{'model':db[_0x2995e8['model']],'as':_0x2995e8['as'],'attributes':_0x2995e8[_0xd88a('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd88a('0x26')](function(_0xe77877){var _0x447b28=[];for(var _0xde9f8b=0x0;_0xde9f8b<_0xe77877[_0xd88a('0x36')];_0xde9f8b+=0x1){_0x447b28['push'](_0xe77877[_0xde9f8b][_0xd88a('0x2a')](_0x2268df[_0xd88a('0x28')],{'transaction':_0x473696}));}return BPromise[_0xd88a('0x38')](_0x447b28);});})[_0xd88a('0x26')](function(_0x50cd5f){logger[_0xd88a('0x15')](_0xd88a('0x43'),_0x2268df);logger['debug'](_0xd88a('0x43'),_0x2268df,JSON['stringify'](_0x50cd5f));_0x30b689(_0x50cd5f);})[_0xd88a('0x17')](function(_0x44d58c){logger[_0xd88a('0x12')]('GetContactRecallMe',_0x44d58c['message'],_0x2268df);_0x39d5dc(_0x53cb9c[_0xd88a('0x12')](0x1f4,_0x44d58c[_0xd88a('0x14')]));});});});}; \ No newline at end of file +var _0x875c=['CmHopper,\x20%s,\x20%s','message','result','catch','CmHopper','findAll','options','raw','where','attributes','limit','include','model','map','info','GetCmHopper','stringify','find','ShowCmHopper','CreateCmHopper','create','body','debug','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','order','UPDATE','CmContact','Contact','keys','push','MoveContactManagedDialer','CmHopperFinal','COUNT','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','LOCK','update','all','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','then','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x875c,0x1ab));var _0xc875=function(_0x32a9b9,_0x535fd1){_0x32a9b9=_0x32a9b9-0x0;var _0x2f53ec=_0x875c[_0x32a9b9];return _0x2f53ec;};'use strict';var _=require('lodash');var util=require(_0xc875('0x0'));var moment=require('moment');var BPromise=require(_0xc875('0x1'));var rs=require(_0xc875('0x2'));var fs=require('fs');var Redis=require(_0xc875('0x3'));var db=require(_0xc875('0x4'))['db'];var utils=require(_0xc875('0x5'));var logger=require(_0xc875('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc875('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6889dd,_0x386e21,_0x50dd4e){return new BPromise(function(_0x358979,_0x2db092){return client[_0xc875('0x8')](_0x6889dd,_0x50dd4e)[_0xc875('0x9')](function(_0x573386){logger['info']('CmHopper,\x20%s,\x20%s',_0x386e21,'request\x20sent');logger['debug'](_0xc875('0xa'),_0x386e21,_0xc875('0xb'),JSON['stringify'](_0x573386));if(_0x573386[_0xc875('0xc')]){if(_0x573386[_0xc875('0xc')][_0xc875('0xd')]===0x1f4){logger[_0xc875('0xc')](_0xc875('0xe'),_0x386e21,_0x573386[_0xc875('0xc')][_0xc875('0xf')]);return _0x2db092(_0x573386[_0xc875('0xc')][_0xc875('0xf')]);}logger[_0xc875('0xc')](_0xc875('0xe'),_0x386e21,_0x573386[_0xc875('0xc')]['message']);return _0x358979(_0x573386[_0xc875('0xc')]['message']);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x386e21,_0xc875('0xb'));_0x358979(_0x573386[_0xc875('0x10')][_0xc875('0xf')]);}})[_0xc875('0x11')](function(_0x4a5ca5){logger[_0xc875('0xc')](_0xc875('0xe'),_0x386e21,_0x4a5ca5);_0x2db092(_0x4a5ca5);});});}exports['GetCmHopper']=function(_0x3a22b4){var _0x54fc78=this;return new Promise(function(_0x3496a7,_0x2aed52){return db[_0xc875('0x12')][_0xc875('0x13')]({'raw':_0x3a22b4[_0xc875('0x14')]?_0x3a22b4[_0xc875('0x14')][_0xc875('0x15')]===undefined?!![]:![]:!![],'where':_0x3a22b4['options']?_0x3a22b4[_0xc875('0x14')][_0xc875('0x16')]||null:null,'attributes':_0x3a22b4['options']?_0x3a22b4[_0xc875('0x14')][_0xc875('0x17')]||null:null,'limit':_0x3a22b4[_0xc875('0x14')]?_0x3a22b4[_0xc875('0x14')][_0xc875('0x18')]||null:null,'include':_0x3a22b4[_0xc875('0x14')]?_0x3a22b4['options'][_0xc875('0x19')]?_['map'](_0x3a22b4[_0xc875('0x14')]['include'],function(_0x37e27c){return{'model':db[_0x37e27c[_0xc875('0x1a')]],'as':_0x37e27c['as'],'attributes':_0x37e27c['attributes'],'include':_0x37e27c[_0xc875('0x19')]?_[_0xc875('0x1b')](_0x37e27c[_0xc875('0x19')],function(_0x340323){return{'model':db[_0x340323[_0xc875('0x1a')]],'as':_0x340323['as'],'attributes':_0x340323['attributes'],'include':_0x340323[_0xc875('0x19')]?_[_0xc875('0x1b')](_0x340323['include'],function(_0x4355f4){return{'model':db[_0x4355f4[_0xc875('0x1a')]],'as':_0x4355f4['as'],'attributes':_0x4355f4[_0xc875('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc875('0x9')](function(_0x549cd9){logger[_0xc875('0x1c')](_0xc875('0x1d'),_0x3a22b4);logger['debug'](_0xc875('0x1d'),_0x3a22b4,JSON[_0xc875('0x1e')](_0x549cd9));_0x3496a7(_0x549cd9);})[_0xc875('0x11')](function(_0x38229b){logger[_0xc875('0xc')](_0xc875('0x1d'),_0x38229b[_0xc875('0xf')],_0x3a22b4);_0x2aed52(_0x54fc78[_0xc875('0xc')](0x1f4,_0x38229b[_0xc875('0xf')]));});});};exports['ShowCmHopper']=function(_0x5aacb2){var _0x94f483=this;return new Promise(function(_0x17bbdf,_0x4016e4){return db['CmHopper'][_0xc875('0x1f')]({'raw':_0x5aacb2[_0xc875('0x14')]?_0x5aacb2[_0xc875('0x14')][_0xc875('0x15')]===undefined?!![]:![]:!![],'where':_0x5aacb2[_0xc875('0x14')]?_0x5aacb2['options']['where']||null:null,'attributes':_0x5aacb2[_0xc875('0x14')]?_0x5aacb2[_0xc875('0x14')][_0xc875('0x17')]||null:null,'include':_0x5aacb2[_0xc875('0x14')]?_0x5aacb2[_0xc875('0x14')][_0xc875('0x19')]?_['map'](_0x5aacb2[_0xc875('0x14')][_0xc875('0x19')],function(_0x13b2a6){return{'model':db[_0x13b2a6[_0xc875('0x1a')]],'as':_0x13b2a6['as'],'attributes':_0x13b2a6[_0xc875('0x17')],'include':_0x13b2a6[_0xc875('0x19')]?_['map'](_0x13b2a6[_0xc875('0x19')],function(_0x1d8f7d){return{'model':db[_0x1d8f7d[_0xc875('0x1a')]],'as':_0x1d8f7d['as'],'attributes':_0x1d8f7d[_0xc875('0x17')],'include':_0x1d8f7d[_0xc875('0x19')]?_[_0xc875('0x1b')](_0x1d8f7d[_0xc875('0x19')],function(_0x398d00){return{'model':db[_0x398d00[_0xc875('0x1a')]],'as':_0x398d00['as'],'attributes':_0x398d00[_0xc875('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc875('0x9')](function(_0x4c582a){logger[_0xc875('0x1c')](_0xc875('0x20'),_0x5aacb2);logger['debug'](_0xc875('0x20'),_0x5aacb2,JSON[_0xc875('0x1e')](_0x4c582a));_0x17bbdf(_0x4c582a);})['catch'](function(_0x233e97){logger['error'](_0xc875('0x20'),_0x233e97[_0xc875('0xf')],_0x5aacb2);_0x4016e4(_0x94f483['error'](0x1f4,_0x233e97[_0xc875('0xf')]));});});};exports[_0xc875('0x21')]=function(_0x3cd809){var _0x4761d2=this;return new Promise(function(_0x3a603a,_0x30c1f2){return db[_0xc875('0x12')][_0xc875('0x22')](_0x3cd809[_0xc875('0x23')],{'raw':_0x3cd809['options']?_0x3cd809[_0xc875('0x14')][_0xc875('0x15')]===undefined?!![]:![]:!![]})[_0xc875('0x9')](function(_0x3d7ab9){logger['info'](_0xc875('0x21'),_0x3cd809);logger[_0xc875('0x24')](_0xc875('0x21'),_0x3cd809,JSON['stringify'](_0x3d7ab9));_0x3a603a(_0x3d7ab9);})[_0xc875('0x11')](function(_0x2252cc){logger['error'](_0xc875('0x21'),_0x2252cc[_0xc875('0xf')],_0x3cd809);_0x30c1f2(_0x4761d2[_0xc875('0xc')](0x1f4,_0x2252cc[_0xc875('0xf')]));});});};exports[_0xc875('0x25')]=function(_0x4d08aa){var _0x4de181=this;return new Promise(function(_0x4bc8b8,_0x3efb2f){return db[_0xc875('0x12')]['update'](_0x4d08aa[_0xc875('0x23')],{'raw':_0x4d08aa[_0xc875('0x14')]?_0x4d08aa['options'][_0xc875('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d08aa[_0xc875('0x14')]?_0x4d08aa[_0xc875('0x14')][_0xc875('0x16')]||null:null,'attributes':_0x4d08aa[_0xc875('0x14')]?_0x4d08aa[_0xc875('0x14')]['attributes']||null:null,'limit':_0x4d08aa[_0xc875('0x14')]?_0x4d08aa[_0xc875('0x14')][_0xc875('0x18')]||null:null})[_0xc875('0x9')](function(_0x27aa60){logger[_0xc875('0x1c')](_0xc875('0x25'),_0x4d08aa);logger[_0xc875('0x24')](_0xc875('0x25'),_0x4d08aa,JSON[_0xc875('0x1e')](_0x27aa60));_0x4bc8b8(_0x27aa60);})[_0xc875('0x11')](function(_0x394299){logger[_0xc875('0xc')]('UpdateCmHopper',_0x394299[_0xc875('0xf')],_0x4d08aa);_0x3efb2f(_0x4de181[_0xc875('0xc')](0x1f4,_0x394299[_0xc875('0xf')]));});});};exports[_0xc875('0x26')]=function(_0x10eaa7){var _0x44c775=this;return new Promise(function(_0x412570,_0x58d1ac){return db[_0xc875('0x12')][_0xc875('0x27')]({'where':_0x10eaa7[_0xc875('0x14')]?_0x10eaa7[_0xc875('0x14')]['where']||null:null})['then'](function(_0x461b02){logger[_0xc875('0x1c')](_0xc875('0x26'),_0x10eaa7);logger[_0xc875('0x24')](_0xc875('0x26'),_0x10eaa7,JSON['stringify'](_0x461b02));_0x412570(_0x461b02);})['catch'](function(_0x5ea5cb){logger[_0xc875('0xc')](_0xc875('0x26'),_0x5ea5cb[_0xc875('0xf')],_0x10eaa7);_0x58d1ac(_0x44c775[_0xc875('0xc')](0x1f4,_0x5ea5cb[_0xc875('0xf')]));});});};exports[_0xc875('0x28')]=function(_0x21869d){var _0xa02c09=this;return new Promise(function(_0xccd432,_0x1efa56){return db['CmContact'][_0xc875('0x29')]()[_0xc875('0x9')](function(_0x213812){return db[_0xc875('0x2a')][_0xc875('0x2b')](function(_0x494c95){return db[_0xc875('0x12')][_0xc875('0x13')]({'where':_0x21869d[_0xc875('0x14')]?_0x21869d[_0xc875('0x14')]['where']||null:null,'attributes':_0x21869d[_0xc875('0x14')]?_0x21869d[_0xc875('0x14')][_0xc875('0x17')]||null:null,'limit':_0x21869d['options']?_0x21869d[_0xc875('0x14')]['limit']||null:null,'order':_0x21869d[_0xc875('0x14')]?_0x21869d[_0xc875('0x14')][_0xc875('0x2c')]||null:null,'transaction':_0x494c95,'lock':_0x494c95['LOCK'][_0xc875('0x2d')],'include':[{'model':db[_0xc875('0x2e')],'as':_0xc875('0x2f'),'attributes':_[_0xc875('0x30')](_0x213812)}]})[_0xc875('0x9')](function(_0x1f8b49){var _0x42ba36=[];for(var _0x6ee8e4=0x0;_0x6ee8e4<_0x1f8b49['length'];_0x6ee8e4+=0x1){_0x42ba36[_0xc875('0x31')](_0x1f8b49[_0x6ee8e4]['update'](_0x21869d['body'],{'transaction':_0x494c95}));}return BPromise['all'](_0x42ba36);});})[_0xc875('0x9')](function(_0x1d3fa4){logger[_0xc875('0x1c')](_0xc875('0x28'),_0x21869d);logger['debug'](_0xc875('0x28'),_0x21869d,JSON[_0xc875('0x1e')](_0x1d3fa4));_0xccd432(_0x1d3fa4);})[_0xc875('0x11')](function(_0x3f642b){logger['error'](_0xc875('0x28'),_0x3f642b['message'],_0x21869d);_0x1efa56(_0xa02c09[_0xc875('0xc')](0x1f4,_0x3f642b[_0xc875('0xf')]));});});});};exports[_0xc875('0x32')]=function(_0x16bac6){var _0x3a67f8=this;return new Promise(function(_0x400a6b,_0xd97af9){return db[_0xc875('0x2a')][_0xc875('0x2b')](function(_0x43d518){return db[_0xc875('0x33')][_0xc875('0x22')](_0x16bac6[_0xc875('0x23')],{'raw':_0x16bac6[_0xc875('0x14')]?_0x16bac6[_0xc875('0x14')][_0xc875('0x15')]===undefined?!![]:![]:!![],'transaction':_0x43d518})[_0xc875('0x9')](function(){return db[_0xc875('0x12')][_0xc875('0x27')]({'where':_0x16bac6[_0xc875('0x14')]?_0x16bac6[_0xc875('0x14')][_0xc875('0x16')]||null:null,'transaction':_0x43d518});});})[_0xc875('0x9')](function(_0x2f47d5){logger['info']('MoveContactManagedDialer',_0x16bac6);logger[_0xc875('0x24')](_0xc875('0x32'),_0x16bac6,JSON[_0xc875('0x1e')](_0x2f47d5));_0x400a6b(_0x2f47d5);})[_0xc875('0x11')](function(_0x24d8d3){logger[_0xc875('0xc')](_0xc875('0x32'),_0x24d8d3['message'],_0x16bac6);_0xd97af9(_0x3a67f8[_0xc875('0xc')](0x1f4,_0x24d8d3[_0xc875('0xf')]));});});};exports['CountReScheduled']=function(_0x148dcd){var _0x3c06c2=this;return new Promise(function(_0x1a19f9,_0x36c520){return db[_0xc875('0x12')]['findAll']({'raw':_0x148dcd[_0xc875('0x14')]?_0x148dcd[_0xc875('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x148dcd[_0xc875('0x14')]?_0x148dcd[_0xc875('0x14')][_0xc875('0x16')]||null:null,'attributes':[[db[_0xc875('0x2a')]['fn'](_0xc875('0x34'),db[_0xc875('0x2a')]['fn']('IF',db['sequelize']['literal']('`scheduledat`\x20>=\x20'+util[_0xc875('0x35')]('\x22%s\x22',moment()[_0xc875('0x35')](_0xc875('0x36')))+_0xc875('0x37')))),_0xc875('0x38')]]})[_0xc875('0x9')](function(_0x405d5a){logger[_0xc875('0x1c')](_0xc875('0x39'),_0x148dcd);logger[_0xc875('0x24')](_0xc875('0x39'),_0x148dcd,JSON['stringify'](_0x405d5a));_0x1a19f9(_0x405d5a);})[_0xc875('0x11')](function(_0x1824ab){logger[_0xc875('0xc')]('CountReScheduled',_0x1824ab['message'],_0x148dcd);_0x36c520(_0x3c06c2['error'](0x1f4,_0x1824ab['message']));});});};exports[_0xc875('0x3a')]=function(_0x2bfe3b){var _0x2b4f56=this;return new Promise(function(_0xb5dcfa,_0x3b69c6){return db['CmContact']['describe']()['then'](function(_0x2e7386){return db[_0xc875('0x2a')]['transaction'](function(_0x5379e7){return db['CmHopper'][_0xc875('0x13')]({'where':_0x2bfe3b['options']?_0x2bfe3b[_0xc875('0x14')]['where']||null:null,'attributes':_0x2bfe3b['options']?_0x2bfe3b['options'][_0xc875('0x17')]||null:null,'limit':0x1,'order':_0x2bfe3b[_0xc875('0x14')]?_0x2bfe3b[_0xc875('0x14')][_0xc875('0x2c')]||null:null,'group':db[_0xc875('0x12')][_0xc875('0x3b')],'transaction':_0x5379e7,'lock':_0x5379e7[_0xc875('0x3c')][_0xc875('0x2d')],'include':_0x2bfe3b['options']?_0x2bfe3b[_0xc875('0x14')][_0xc875('0x19')]?_[_0xc875('0x1b')](_0x2bfe3b[_0xc875('0x14')]['include'],function(_0x2b6c59){return{'model':db[_0x2b6c59['model']],'as':_0x2b6c59['as'],'attributes':_0x2b6c59[_0xc875('0x17')],'include':_0x2b6c59[_0xc875('0x19')]?_[_0xc875('0x1b')](_0x2b6c59[_0xc875('0x19')],function(_0x44ebb3){return{'model':db[_0x44ebb3[_0xc875('0x1a')]],'as':_0x44ebb3['as'],'attributes':_0x44ebb3[_0xc875('0x17')],'include':_0x44ebb3[_0xc875('0x19')]?_[_0xc875('0x1b')](_0x44ebb3[_0xc875('0x19')],function(_0x55e7ee){return{'model':db[_0x55e7ee[_0xc875('0x1a')]],'as':_0x55e7ee['as'],'attributes':_0x55e7ee[_0xc875('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x411c9a){var _0x2e6855=[];for(var _0x41c213=0x0;_0x41c213<_0x411c9a['length'];_0x41c213+=0x1){_0x2e6855['push'](_0x411c9a[_0x41c213][_0xc875('0x3d')](_0x2bfe3b[_0xc875('0x23')],{'transaction':_0x5379e7}));}return BPromise[_0xc875('0x3e')](_0x2e6855);});})['then'](function(_0x5b0351){logger['info']('GetContactRecallMe',_0x2bfe3b);logger['debug'](_0xc875('0x3a'),_0x2bfe3b,JSON[_0xc875('0x1e')](_0x5b0351));_0xb5dcfa(_0x5b0351);})['catch'](function(_0x143638){logger[_0xc875('0xc')]('GetContactRecallMe',_0x143638[_0xc875('0xf')],_0x2bfe3b);_0x3b69c6(_0x2b4f56[_0xc875('0xc')](0x1f4,_0x143638[_0xc875('0xf')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index b8933c8..3066aba 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(_0x56fd8f,_0x1e7ab0){var _0x42c54c=function(_0x214f6f){while(--_0x214f6f){_0x56fd8f['push'](_0x56fd8f['shift']());}};_0x42c54c(++_0x1e7ab0);}(_0x7a54,0x106));var _0x47a5=function(_0x4026c7,_0x102c18){_0x4026c7=_0x4026c7-0x0;var _0x5daecf=_0x7a54[_0x4026c7];return _0x5daecf;};'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(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var 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 a188a46..0efb469 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 _0x5b53=['INTEGER','contactListQueue','exports'];(function(_0xf31b1b,_0x4dd1fe){var _0x3c6a16=function(_0x24e92b){while(--_0x24e92b){_0xf31b1b['push'](_0xf31b1b['shift']());}};_0x3c6a16(++_0x4dd1fe);}(_0x5b53,0x6e));var _0x35b5=function(_0xf1b134,_0xb399dd){_0xf1b134=_0xf1b134-0x0;var _0x139dbb=_0x5b53[_0xf1b134];return _0x139dbb;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x35b5('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x35b5('0x1')],'unique':_0x35b5('0x2')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x35b5('0x1')],'unique':_0x35b5('0x2')}}; \ No newline at end of file +var _0xc6d5=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x4b9806,_0x1517c0){var _0x12f4d4=function(_0x2f0984){while(--_0x2f0984){_0x4b9806['push'](_0x4b9806['shift']());}};_0x12f4d4(++_0x1517c0);}(_0xc6d5,0x1ef));var _0x5c6d=function(_0xc756f0,_0x4531eb){_0xc756f0=_0xc756f0-0x0;var _0x136098=_0xc6d5[_0xc756f0];return _0x136098;};'use strict';var moment=require(_0x5c6d('0x0'));var Sequelize=require(_0x5c6d('0x1'));module[_0x5c6d('0x2')]={'phone':{'type':Sequelize[_0x5c6d('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x5c6d('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x5c6d('0x4')],'unique':_0x5c6d('0x5')},'VoiceQueueId':{'type':Sequelize[_0x5c6d('0x4')],'unique':_0x5c6d('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index fe54755..067f588 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 _0x443b=['../../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','filters','attributes','intersection','length','hasOwnProperty','sort','where','filter','map','VIRTUAL','field','merge','options','includeAll','include','rows','catch','show','params','fields','find','body','destroy','describe','html-pdf','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2d0945,_0x2ec45c){var _0x1c452a=function(_0x24d654){while(--_0x24d654){_0x2d0945['push'](_0x2d0945['shift']());}};_0x1c452a(++_0x2ec45c);}(_0x443b,0x1db));var _0xb443=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x443b[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xb443('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb443('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb443('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb443('0x3'));var Mustache=require(_0xb443('0x4'));var util=require(_0xb443('0x5'));var path=require(_0xb443('0x6'));var sox=require(_0xb443('0x7'));var csv=require('to-csv');var ejs=require(_0xb443('0x8'));var fs=require('fs');var _=require(_0xb443('0x9'));var squel=require(_0xb443('0xa'));var crypto=require('crypto');var jsforce=require(_0xb443('0xb'));var deskjs=require(_0xb443('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb443('0xd'));var Papa=require(_0xb443('0xe'));var authService=require(_0xb443('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xb443('0x10'));var qs=require(_0xb443('0x11'));var logger=require(_0xb443('0x12'))(_0xb443('0x13'));var utils=require(_0xb443('0x14'));var config=require(_0xb443('0x15'));var db=require(_0xb443('0x16'))['db'];function respondWithStatusCode(_0x190d1d,_0x161678){_0x161678=_0x161678||0xcc;return function(_0x301a3e){if(_0x301a3e){return _0x190d1d['sendStatus'](_0x161678);}return _0x190d1d[_0xb443('0x17')](_0x161678)[_0xb443('0x18')]();};}function respondWithResult(_0x45c4f7,_0x25d51d){_0x25d51d=_0x25d51d||0xc8;return function(_0x3ba72e){if(_0x3ba72e){return _0x45c4f7['status'](_0x25d51d)[_0xb443('0x19')](_0x3ba72e);}};}function respondWithFilteredResult(_0x542ad7,_0x106d27){return function(_0x1cacf9){if(_0x1cacf9){var _0x24eb53=_0x1cacf9[_0xb443('0x1a')],_0xa48121=_0x106d27['offset'],_0x4a49aa=_0x106d27[_0xb443('0x1b')]+_0x106d27[_0xb443('0x1c')],_0x121146;if(_0x4a49aa>=_0x24eb53){_0x4a49aa=_0x24eb53;_0x121146=0xc8;}else{_0x121146=0xce;}_0x542ad7[_0xb443('0x17')](_0x121146);return _0x542ad7[_0xb443('0x1d')](_0xb443('0x1e'),_0xa48121+'-'+_0x4a49aa+'/'+_0x24eb53)[_0xb443('0x19')](_0x1cacf9);}return null;};}function patchUpdates(_0x288182){return function(_0x1c78f9){try{jsonpatch[_0xb443('0x1f')](_0x1c78f9,_0x288182,!![]);}catch(_0x3a28a2){return BPromise[_0xb443('0x20')](_0x3a28a2);}return _0x1c78f9[_0xb443('0x21')]();};}function saveUpdates(_0x1214ca,_0x5be8fd){return function(_0xba2a4f){if(_0xba2a4f){return _0xba2a4f[_0xb443('0x22')](_0x1214ca)['then'](function(_0xfcda45){return _0xfcda45;});}return null;};}function removeEntity(_0x11e98a,_0x47fdde){return function(_0x4dc3dc){if(_0x4dc3dc){return _0x4dc3dc['destroy']()[_0xb443('0x23')](function(){_0x11e98a[_0xb443('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ca92d,_0x5d51cd){return function(_0x4eea72){if(!_0x4eea72){_0x4ca92d[_0xb443('0x24')](0x194);}return _0x4eea72;};}function handleError(_0x5dc861,_0x10f1e2){_0x10f1e2=_0x10f1e2||0x1f4;return function(_0x7bfa3f){logger[_0xb443('0x25')](_0x7bfa3f[_0xb443('0x26')]);if(_0x7bfa3f[_0xb443('0x27')]){delete _0x7bfa3f[_0xb443('0x27')];}_0x5dc861['status'](_0x10f1e2)[_0xb443('0x28')](_0x7bfa3f);};}exports[_0xb443('0x29')]=function(_0x300720,_0x3c1103){var _0xdd04b2={},_0x4e634a={},_0x284aca={'count':0x0,'rows':[]};var _0x1cad19=db[_0xb443('0x2a')][_0xb443('0x2b')];_0x4e634a[_0xb443('0x2c')]=_[_0xb443('0x2d')](_0x1cad19);_0x4e634a[_0xb443('0x2e')]=_['keys'](_0x300720[_0xb443('0x2e')]);_0x4e634a[_0xb443('0x2f')]=_['intersection'](_0x4e634a[_0xb443('0x2c')],_0x4e634a[_0xb443('0x2e')]);_0xdd04b2[_0xb443('0x30')]=_[_0xb443('0x31')](_0x4e634a[_0xb443('0x2c')],qs['fields'](_0x300720['query']['fields']));_0xdd04b2[_0xb443('0x30')]=_0xdd04b2[_0xb443('0x30')][_0xb443('0x32')]?_0xdd04b2['attributes']:_0x4e634a[_0xb443('0x2c')];if(!_0x300720['query'][_0xb443('0x33')]('nolimit')){_0xdd04b2['limit']=qs[_0xb443('0x1c')](_0x300720[_0xb443('0x2e')][_0xb443('0x1c')]);_0xdd04b2[_0xb443('0x1b')]=qs[_0xb443('0x1b')](_0x300720[_0xb443('0x2e')][_0xb443('0x1b')]);}_0xdd04b2['order']=qs['sort'](_0x300720[_0xb443('0x2e')][_0xb443('0x34')]);_0xdd04b2[_0xb443('0x35')]=qs[_0xb443('0x2f')](_['pick'](_0x300720['query'],_0x4e634a['filters']));if(_0x300720[_0xb443('0x2e')][_0xb443('0x36')]){_0xdd04b2['where']=_['merge'](_0xdd04b2['where'],{'$or':_[_0xb443('0x37')](_0x1cad19,function(_0x2c459d){if(_0x2c459d['type']['key']!==_0xb443('0x38')){var _0x9c67f0={};_0x9c67f0[_0x2c459d[_0xb443('0x39')]]={'$like':'%'+_0x300720[_0xb443('0x2e')]['filter']+'%'};return _0x9c67f0;}})});}_0xdd04b2=_[_0xb443('0x3a')]({},_0xdd04b2,_0x300720[_0xb443('0x3b')]);var _0x22520f={'where':_0xdd04b2['where']};return db[_0xb443('0x2a')][_0xb443('0x1a')](_0x22520f)[_0xb443('0x23')](function(_0x20bf13){_0x284aca['count']=_0x20bf13;if(_0x300720[_0xb443('0x2e')][_0xb443('0x3c')]){_0xdd04b2[_0xb443('0x3d')]=[{'all':!![]}];}return db[_0xb443('0x2a')]['findAll'](_0xdd04b2);})[_0xb443('0x23')](function(_0x332c81){_0x284aca[_0xb443('0x3e')]=_0x332c81;return _0x284aca;})['then'](respondWithFilteredResult(_0x3c1103,_0xdd04b2))[_0xb443('0x3f')](handleError(_0x3c1103,null));};exports[_0xb443('0x40')]=function(_0xbc5ff1,_0x31a184){var _0x184e23={'raw':!![],'where':{'id':_0xbc5ff1[_0xb443('0x41')]['id']}},_0x3b851f={};_0x3b851f['model']=_['keys'](db['CmHopperBlack'][_0xb443('0x2b')]);_0x3b851f[_0xb443('0x2e')]=_[_0xb443('0x2d')](_0xbc5ff1[_0xb443('0x2e')]);_0x3b851f[_0xb443('0x2f')]=_[_0xb443('0x31')](_0x3b851f[_0xb443('0x2c')],_0x3b851f[_0xb443('0x2e')]);_0x184e23[_0xb443('0x30')]=_[_0xb443('0x31')](_0x3b851f[_0xb443('0x2c')],qs['fields'](_0xbc5ff1['query'][_0xb443('0x42')]));_0x184e23['attributes']=_0x184e23[_0xb443('0x30')][_0xb443('0x32')]?_0x184e23[_0xb443('0x30')]:_0x3b851f[_0xb443('0x2c')];if(_0xbc5ff1[_0xb443('0x2e')][_0xb443('0x3c')]){_0x184e23[_0xb443('0x3d')]=[{'all':!![]}];}_0x184e23=_[_0xb443('0x3a')]({},_0x184e23,_0xbc5ff1[_0xb443('0x3b')]);return db['CmHopperBlack'][_0xb443('0x43')](_0x184e23)[_0xb443('0x23')](handleEntityNotFound(_0x31a184,null))[_0xb443('0x23')](respondWithResult(_0x31a184,null))[_0xb443('0x3f')](handleError(_0x31a184,null));};exports[_0xb443('0x22')]=function(_0x46bf45,_0x2131bf){if(_0x46bf45[_0xb443('0x44')]['id']){delete _0x46bf45[_0xb443('0x44')]['id'];}return db[_0xb443('0x2a')][_0xb443('0x43')]({'where':{'id':_0x46bf45[_0xb443('0x41')]['id']}})['then'](handleEntityNotFound(_0x2131bf,null))[_0xb443('0x23')](saveUpdates(_0x46bf45['body'],null))[_0xb443('0x23')](respondWithResult(_0x2131bf,null))['catch'](handleError(_0x2131bf,null));};exports[_0xb443('0x45')]=function(_0x4f34c0,_0x40b54d){return db[_0xb443('0x2a')][_0xb443('0x43')]({'where':{'id':_0x4f34c0[_0xb443('0x41')]['id']}})['then'](handleEntityNotFound(_0x40b54d,null))['then'](removeEntity(_0x40b54d,null))[_0xb443('0x3f')](handleError(_0x40b54d,null));};exports['describe']=function(_0x4220dc,_0x190906){return db[_0xb443('0x2a')][_0xb443('0x46')]()[_0xb443('0x23')](respondWithResult(_0x190906,null))[_0xb443('0x3f')](handleError(_0x190906,null));}; \ No newline at end of file +var _0x16ea=['Content-Range','reject','save','update','destroy','end','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','limit','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','CmHopperBlack','then','includeAll','include','rows','params','fields','length','find','catch','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set'];(function(_0x8ce0d,_0x45b743){var _0x4627d=function(_0x423c80){while(--_0x423c80){_0x8ce0d['push'](_0x8ce0d['shift']());}};_0x4627d(++_0x45b743);}(_0x16ea,0x70));var _0xa16e=function(_0x35190c,_0x10cc60){_0x35190c=_0x35190c-0x0;var _0x46b857=_0x16ea[_0x35190c];return _0x46b857;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa16e('0x0'));var zipdir=require(_0xa16e('0x1'));var jsonpatch=require(_0xa16e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa16e('0x3'));var Mustache=require(_0xa16e('0x4'));var util=require(_0xa16e('0x5'));var path=require(_0xa16e('0x6'));var sox=require('sox');var csv=require(_0xa16e('0x7'));var ejs=require(_0xa16e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa16e('0x9'));var crypto=require(_0xa16e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa16e('0xb'));var toCsv=require(_0xa16e('0x7'));var querystring=require(_0xa16e('0xc'));var Papa=require('papaparse');var authService=require(_0xa16e('0xd'));var hardwareService=require(_0xa16e('0xe'));var Redis=require('ioredis');var qs=require(_0xa16e('0xf'));var logger=require('../../config/logger')(_0xa16e('0x10'));var utils=require(_0xa16e('0x11'));var config=require(_0xa16e('0x12'));var db=require(_0xa16e('0x13'))['db'];function respondWithStatusCode(_0x582b2a,_0x3869d2){_0x3869d2=_0x3869d2||0xcc;return function(_0x5c7788){if(_0x5c7788){return _0x582b2a[_0xa16e('0x14')](_0x3869d2);}return _0x582b2a[_0xa16e('0x15')](_0x3869d2)['end']();};}function respondWithResult(_0x551ec9,_0x3d6107){_0x3d6107=_0x3d6107||0xc8;return function(_0xd9f9eb){if(_0xd9f9eb){return _0x551ec9[_0xa16e('0x15')](_0x3d6107)[_0xa16e('0x16')](_0xd9f9eb);}};}function respondWithFilteredResult(_0x40a555,_0x5049b3){return function(_0x672b9c){if(_0x672b9c){var _0x339034=_0x672b9c[_0xa16e('0x17')],_0x32d862=_0x5049b3[_0xa16e('0x18')],_0x544ae1=_0x5049b3['offset']+_0x5049b3['limit'],_0x58a01a;if(_0x544ae1>=_0x339034){_0x544ae1=_0x339034;_0x58a01a=0xc8;}else{_0x58a01a=0xce;}_0x40a555['status'](_0x58a01a);return _0x40a555[_0xa16e('0x19')](_0xa16e('0x1a'),_0x32d862+'-'+_0x544ae1+'/'+_0x339034)[_0xa16e('0x16')](_0x672b9c);}return null;};}function patchUpdates(_0x1a8a22){return function(_0x29dab6){try{jsonpatch['apply'](_0x29dab6,_0x1a8a22,!![]);}catch(_0x9aa5fe){return BPromise[_0xa16e('0x1b')](_0x9aa5fe);}return _0x29dab6[_0xa16e('0x1c')]();};}function saveUpdates(_0x2c6442,_0x2cb46a){return function(_0x362414){if(_0x362414){return _0x362414[_0xa16e('0x1d')](_0x2c6442)['then'](function(_0x2b28bb){return _0x2b28bb;});}return null;};}function removeEntity(_0x571006,_0x2d9d07){return function(_0x185be1){if(_0x185be1){return _0x185be1[_0xa16e('0x1e')]()['then'](function(){_0x571006[_0xa16e('0x15')](0xcc)[_0xa16e('0x1f')]();});}};}function handleEntityNotFound(_0x305de6,_0x832521){return function(_0x263560){if(!_0x263560){_0x305de6['sendStatus'](0x194);}return _0x263560;};}function handleError(_0x3d06e8,_0x47e8a8){_0x47e8a8=_0x47e8a8||0x1f4;return function(_0x1fbf14){logger[_0xa16e('0x20')](_0x1fbf14[_0xa16e('0x21')]);if(_0x1fbf14[_0xa16e('0x22')]){delete _0x1fbf14[_0xa16e('0x22')];}_0x3d06e8['status'](_0x47e8a8)[_0xa16e('0x23')](_0x1fbf14);};}exports[_0xa16e('0x24')]=function(_0x10bc67,_0x3d617d){var _0x332c90={},_0x529470={},_0x43e3e9={'count':0x0,'rows':[]};var _0x1c0492=db['CmHopperBlack'][_0xa16e('0x25')];_0x529470[_0xa16e('0x26')]=_['keys'](_0x1c0492);_0x529470['query']=_[_0xa16e('0x27')](_0x10bc67[_0xa16e('0x28')]);_0x529470[_0xa16e('0x29')]=_[_0xa16e('0x2a')](_0x529470[_0xa16e('0x26')],_0x529470[_0xa16e('0x28')]);_0x332c90[_0xa16e('0x2b')]=_[_0xa16e('0x2a')](_0x529470[_0xa16e('0x26')],qs['fields'](_0x10bc67[_0xa16e('0x28')]['fields']));_0x332c90[_0xa16e('0x2b')]=_0x332c90[_0xa16e('0x2b')]['length']?_0x332c90[_0xa16e('0x2b')]:_0x529470[_0xa16e('0x26')];if(!_0x10bc67['query'][_0xa16e('0x2c')](_0xa16e('0x2d'))){_0x332c90[_0xa16e('0x2e')]=qs['limit'](_0x10bc67[_0xa16e('0x28')][_0xa16e('0x2e')]);_0x332c90[_0xa16e('0x18')]=qs[_0xa16e('0x18')](_0x10bc67[_0xa16e('0x28')]['offset']);}_0x332c90['order']=qs[_0xa16e('0x2f')](_0x10bc67[_0xa16e('0x28')][_0xa16e('0x2f')]);_0x332c90[_0xa16e('0x30')]=qs[_0xa16e('0x29')](_['pick'](_0x10bc67[_0xa16e('0x28')],_0x529470[_0xa16e('0x29')]));if(_0x10bc67[_0xa16e('0x28')][_0xa16e('0x31')]){_0x332c90[_0xa16e('0x30')]=_['merge'](_0x332c90[_0xa16e('0x30')],{'$or':_[_0xa16e('0x32')](_0x1c0492,function(_0x4602b7){if(_0x4602b7[_0xa16e('0x33')][_0xa16e('0x34')]!==_0xa16e('0x35')){var _0x67eebd={};_0x67eebd[_0x4602b7[_0xa16e('0x36')]]={'$like':'%'+_0x10bc67[_0xa16e('0x28')][_0xa16e('0x31')]+'%'};return _0x67eebd;}})});}_0x332c90=_[_0xa16e('0x37')]({},_0x332c90,_0x10bc67[_0xa16e('0x38')]);var _0x26bdbd={'where':_0x332c90[_0xa16e('0x30')]};return db[_0xa16e('0x39')][_0xa16e('0x17')](_0x26bdbd)[_0xa16e('0x3a')](function(_0x4fd1bf){_0x43e3e9[_0xa16e('0x17')]=_0x4fd1bf;if(_0x10bc67['query'][_0xa16e('0x3b')]){_0x332c90[_0xa16e('0x3c')]=[{'all':!![]}];}return db[_0xa16e('0x39')]['findAll'](_0x332c90);})['then'](function(_0x4bbdbc){_0x43e3e9[_0xa16e('0x3d')]=_0x4bbdbc;return _0x43e3e9;})['then'](respondWithFilteredResult(_0x3d617d,_0x332c90))['catch'](handleError(_0x3d617d,null));};exports['show']=function(_0x334cb3,_0x551b04){var _0x45bc9f={'raw':!![],'where':{'id':_0x334cb3[_0xa16e('0x3e')]['id']}},_0x18ae56={};_0x18ae56[_0xa16e('0x26')]=_['keys'](db[_0xa16e('0x39')][_0xa16e('0x25')]);_0x18ae56[_0xa16e('0x28')]=_[_0xa16e('0x27')](_0x334cb3['query']);_0x18ae56[_0xa16e('0x29')]=_[_0xa16e('0x2a')](_0x18ae56['model'],_0x18ae56[_0xa16e('0x28')]);_0x45bc9f[_0xa16e('0x2b')]=_[_0xa16e('0x2a')](_0x18ae56[_0xa16e('0x26')],qs['fields'](_0x334cb3[_0xa16e('0x28')][_0xa16e('0x3f')]));_0x45bc9f[_0xa16e('0x2b')]=_0x45bc9f['attributes'][_0xa16e('0x40')]?_0x45bc9f[_0xa16e('0x2b')]:_0x18ae56[_0xa16e('0x26')];if(_0x334cb3[_0xa16e('0x28')][_0xa16e('0x3b')]){_0x45bc9f['include']=[{'all':!![]}];}_0x45bc9f=_[_0xa16e('0x37')]({},_0x45bc9f,_0x334cb3[_0xa16e('0x38')]);return db['CmHopperBlack'][_0xa16e('0x41')](_0x45bc9f)[_0xa16e('0x3a')](handleEntityNotFound(_0x551b04,null))[_0xa16e('0x3a')](respondWithResult(_0x551b04,null))[_0xa16e('0x42')](handleError(_0x551b04,null));};exports['update']=function(_0x1727e9,_0x1c78a2){if(_0x1727e9[_0xa16e('0x43')]['id']){delete _0x1727e9[_0xa16e('0x43')]['id'];}return db['CmHopperBlack'][_0xa16e('0x41')]({'where':{'id':_0x1727e9[_0xa16e('0x3e')]['id']}})[_0xa16e('0x3a')](handleEntityNotFound(_0x1c78a2,null))[_0xa16e('0x3a')](saveUpdates(_0x1727e9[_0xa16e('0x43')],null))[_0xa16e('0x3a')](respondWithResult(_0x1c78a2,null))[_0xa16e('0x42')](handleError(_0x1c78a2,null));};exports[_0xa16e('0x1e')]=function(_0x525e65,_0x29ead1){return db['CmHopperBlack'][_0xa16e('0x41')]({'where':{'id':_0x525e65['params']['id']}})['then'](handleEntityNotFound(_0x29ead1,null))[_0xa16e('0x3a')](removeEntity(_0x29ead1,null))[_0xa16e('0x42')](handleError(_0x29ead1,null));};exports[_0xa16e('0x44')]=function(_0x46abad,_0x5a1083){return db['CmHopperBlack'][_0xa16e('0x44')]()[_0xa16e('0x3a')](respondWithResult(_0x5a1083,null))['catch'](handleError(_0x5a1083,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 3b2c2ed..06af338 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 _0xf00d=['request-promise','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4e4d44,_0x3836ed){var _0x429cf0=function(_0x2f03e3){while(--_0x2f03e3){_0x4e4d44['push'](_0x4e4d44['shift']());}};_0x429cf0(++_0x3836ed);}(_0xf00d,0x10e));var _0xdf00=function(_0x15c987,_0x3afe99){_0x15c987=_0x15c987-0x0;var _0x591b33=_0xf00d[_0x15c987];return _0x591b33;};'use strict';var _=require(_0xdf00('0x0'));var util=require('util');var logger=require(_0xdf00('0x1'))(_0xdf00('0x2'));var moment=require(_0xdf00('0x3'));var BPromise=require(_0xdf00('0x4'));var rp=require(_0xdf00('0x5'));var attributes=require(_0xdf00('0x6'));module[_0xdf00('0x7')]=function(_0x517fb0,_0x28075f){return _0x517fb0[_0xdf00('0x8')](_0xdf00('0x9'),attributes,{'tableName':_0xdf00('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62df=['../../config/logger','api','moment','bluebird','./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','util'];(function(_0xf90100,_0x43ddde){var _0xf42516=function(_0x58221e){while(--_0x58221e){_0xf90100['push'](_0xf90100['shift']());}};_0xf42516(++_0x43ddde);}(_0x62df,0xe4));var _0xf62d=function(_0x5d5742,_0x4bb32c){_0x5d5742=_0x5d5742-0x0;var _0x2928e2=_0x62df[_0x5d5742];return _0x2928e2;};'use strict';var _=require(_0xf62d('0x0'));var util=require(_0xf62d('0x1'));var logger=require(_0xf62d('0x2'))(_0xf62d('0x3'));var moment=require(_0xf62d('0x4'));var BPromise=require(_0xf62d('0x5'));var rp=require('request-promise');var attributes=require(_0xf62d('0x6'));module[_0xf62d('0x7')]=function(_0x346fca,_0x500470){return _0x346fca[_0xf62d('0x8')](_0xf62d('0x9'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index c6609a5..5f3f4de 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 _0xc0e9=['model','attributes','UpdateCmHopperBlack','CmHopperBlack','body','raw','where','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetCmHopperBlack','options','limit','include','map'];(function(_0x204a1d,_0xc5a068){var _0x28090f=function(_0x23848c){while(--_0x23848c){_0x204a1d['push'](_0x204a1d['shift']());}};_0x28090f(++_0xc5a068);}(_0xc0e9,0x99));var _0x9c0e=function(_0x2668a8,_0x26db2a){_0x2668a8=_0x2668a8-0x0;var _0x478339=_0xc0e9[_0x2668a8];return _0x478339;};'use strict';var _=require(_0x9c0e('0x0'));var util=require('util');var moment=require(_0x9c0e('0x1'));var BPromise=require(_0x9c0e('0x2'));var rs=require(_0x9c0e('0x3'));var fs=require('fs');var Redis=require(_0x9c0e('0x4'));var db=require(_0x9c0e('0x5'))['db'];var utils=require(_0x9c0e('0x6'));var logger=require('../../config/logger')(_0x9c0e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9c0e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x524d98,_0x512b24,_0x4fb443){return new BPromise(function(_0x565625,_0x58d32e){return client[_0x9c0e('0x9')](_0x524d98,_0x4fb443)[_0x9c0e('0xa')](function(_0x564d01){logger[_0x9c0e('0xb')](_0x9c0e('0xc'),_0x512b24,'request\x20sent');logger[_0x9c0e('0xd')](_0x9c0e('0xe'),_0x512b24,'request\x20sent',JSON[_0x9c0e('0xf')](_0x564d01));if(_0x564d01['error']){if(_0x564d01[_0x9c0e('0x10')][_0x9c0e('0x11')]===0x1f4){logger[_0x9c0e('0x10')](_0x9c0e('0xc'),_0x512b24,_0x564d01[_0x9c0e('0x10')][_0x9c0e('0x12')]);return _0x58d32e(_0x564d01[_0x9c0e('0x10')][_0x9c0e('0x12')]);}logger[_0x9c0e('0x10')](_0x9c0e('0xc'),_0x512b24,_0x564d01['error'][_0x9c0e('0x12')]);return _0x565625(_0x564d01[_0x9c0e('0x10')][_0x9c0e('0x12')]);}else{logger[_0x9c0e('0xb')](_0x9c0e('0xc'),_0x512b24,_0x9c0e('0x13'));_0x565625(_0x564d01[_0x9c0e('0x14')][_0x9c0e('0x12')]);}})[_0x9c0e('0x15')](function(_0x3ff639){logger[_0x9c0e('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x512b24,_0x3ff639);_0x58d32e(_0x3ff639);});});}exports[_0x9c0e('0x16')]=function(_0x31d0b9){var _0x563d8f=this;return new Promise(function(_0x40f383,_0x19c5b9){return db['CmHopperBlack']['findAll']({'raw':_0x31d0b9[_0x9c0e('0x17')]?_0x31d0b9[_0x9c0e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x31d0b9[_0x9c0e('0x17')]?_0x31d0b9[_0x9c0e('0x17')]['where']||null:null,'attributes':_0x31d0b9['options']?_0x31d0b9[_0x9c0e('0x17')]['attributes']||null:null,'limit':_0x31d0b9['options']?_0x31d0b9[_0x9c0e('0x17')][_0x9c0e('0x18')]||null:null,'include':_0x31d0b9[_0x9c0e('0x17')]?_0x31d0b9[_0x9c0e('0x17')][_0x9c0e('0x19')]?_[_0x9c0e('0x1a')](_0x31d0b9[_0x9c0e('0x17')]['include'],function(_0x51937e){return{'model':db[_0x51937e[_0x9c0e('0x1b')]],'as':_0x51937e['as'],'attributes':_0x51937e[_0x9c0e('0x1c')],'include':_0x51937e[_0x9c0e('0x19')]?_['map'](_0x51937e[_0x9c0e('0x19')],function(_0xef649a){return{'model':db[_0xef649a[_0x9c0e('0x1b')]],'as':_0xef649a['as'],'attributes':_0xef649a[_0x9c0e('0x1c')],'include':_0xef649a[_0x9c0e('0x19')]?_[_0x9c0e('0x1a')](_0xef649a[_0x9c0e('0x19')],function(_0x1bee6d){return{'model':db[_0x1bee6d[_0x9c0e('0x1b')]],'as':_0x1bee6d['as'],'attributes':_0x1bee6d[_0x9c0e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10c87d){logger[_0x9c0e('0xb')]('GetCmHopperBlack',_0x31d0b9);logger[_0x9c0e('0xd')](_0x9c0e('0x16'),_0x31d0b9,JSON[_0x9c0e('0xf')](_0x10c87d));_0x40f383(_0x10c87d);})[_0x9c0e('0x15')](function(_0x3526be){logger['error'](_0x9c0e('0x16'),_0x3526be[_0x9c0e('0x12')],_0x31d0b9);_0x19c5b9(_0x563d8f[_0x9c0e('0x10')](0x1f4,_0x3526be[_0x9c0e('0x12')]));});});};exports[_0x9c0e('0x1d')]=function(_0x2ed82d){var _0x5caab5=this;return new Promise(function(_0x26c45d,_0x23374e){return db[_0x9c0e('0x1e')]['update'](_0x2ed82d[_0x9c0e('0x1f')],{'raw':_0x2ed82d[_0x9c0e('0x17')]?_0x2ed82d['options'][_0x9c0e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ed82d[_0x9c0e('0x17')]?_0x2ed82d['options'][_0x9c0e('0x21')]||null:null,'attributes':_0x2ed82d['options']?_0x2ed82d[_0x9c0e('0x17')][_0x9c0e('0x1c')]||null:null,'limit':_0x2ed82d['options']?_0x2ed82d[_0x9c0e('0x17')]['limit']||null:null})[_0x9c0e('0xa')](function(_0x58788d){logger[_0x9c0e('0xb')](_0x9c0e('0x1d'),_0x2ed82d);logger['debug'](_0x9c0e('0x1d'),_0x2ed82d,JSON[_0x9c0e('0xf')](_0x58788d));_0x26c45d(_0x58788d);})[_0x9c0e('0x15')](function(_0x19543a){logger['error']('UpdateCmHopperBlack',_0x19543a[_0x9c0e('0x12')],_0x2ed82d);_0x23374e(_0x5caab5[_0x9c0e('0x10')](0x1f4,_0x19543a[_0x9c0e('0x12')]));});});};exports[_0x9c0e('0x22')]=function(_0x38902e){var _0x280630=this;return new Promise(function(_0x1b9510,_0x5cb549){return db['CmHopperBlack'][_0x9c0e('0x23')]({'where':_0x38902e[_0x9c0e('0x17')]?_0x38902e[_0x9c0e('0x17')]['where']||null:null})['then'](function(_0x109c16){logger[_0x9c0e('0xb')](_0x9c0e('0x22'),_0x38902e);logger[_0x9c0e('0xd')]('DestroyCmHopperBlack',_0x38902e,JSON[_0x9c0e('0xf')](_0x109c16));_0x1b9510(_0x109c16);})[_0x9c0e('0x15')](function(_0x4ba15f){logger[_0x9c0e('0x10')](_0x9c0e('0x22'),_0x4ba15f[_0x9c0e('0x12')],_0x38902e);_0x5cb549(_0x280630['error'](0x1f4,_0x4ba15f[_0x9c0e('0x12')]));});});}; \ No newline at end of file +var _0x8c48=['http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CmHopperBlack','options','raw','attributes','limit','include','map','model','GetCmHopperBlack','catch','UpdateCmHopperBlack','update','where','DestroyCmHopperBlack','destroy','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x5e547b,_0x5970fc){var _0x13b3ed=function(_0x32638d){while(--_0x32638d){_0x5e547b['push'](_0x5e547b['shift']());}};_0x13b3ed(++_0x5970fc);}(_0x8c48,0x183));var _0x88c4=function(_0x3afe3f,_0x59e19a){_0x3afe3f=_0x3afe3f-0x0;var _0x2d7d0c=_0x8c48[_0x3afe3f];return _0x2d7d0c;};'use strict';var _=require(_0x88c4('0x0'));var util=require(_0x88c4('0x1'));var moment=require(_0x88c4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88c4('0x3'))['db'];var utils=require(_0x88c4('0x4'));var logger=require(_0x88c4('0x5'))(_0x88c4('0x6'));var config=require(_0x88c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x88c4('0x8')][_0x88c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ae4e0,_0x47cf6e,_0x591e2a){return new BPromise(function(_0x134bb3,_0x58fb2c){return client['request'](_0x5ae4e0,_0x591e2a)[_0x88c4('0xa')](function(_0x4eecaf){logger[_0x88c4('0xb')](_0x88c4('0xc'),_0x47cf6e,_0x88c4('0xd'));logger[_0x88c4('0xe')](_0x88c4('0xf'),_0x47cf6e,'request\x20sent',JSON[_0x88c4('0x10')](_0x4eecaf));if(_0x4eecaf[_0x88c4('0x11')]){if(_0x4eecaf[_0x88c4('0x11')][_0x88c4('0x12')]===0x1f4){logger[_0x88c4('0x11')](_0x88c4('0xc'),_0x47cf6e,_0x4eecaf[_0x88c4('0x11')][_0x88c4('0x13')]);return _0x58fb2c(_0x4eecaf[_0x88c4('0x11')][_0x88c4('0x13')]);}logger[_0x88c4('0x11')](_0x88c4('0xc'),_0x47cf6e,_0x4eecaf[_0x88c4('0x11')][_0x88c4('0x13')]);return _0x134bb3(_0x4eecaf[_0x88c4('0x11')][_0x88c4('0x13')]);}else{logger[_0x88c4('0xb')](_0x88c4('0xc'),_0x47cf6e,_0x88c4('0xd'));_0x134bb3(_0x4eecaf[_0x88c4('0x14')][_0x88c4('0x13')]);}})['catch'](function(_0x5445af){logger['error'](_0x88c4('0xc'),_0x47cf6e,_0x5445af);_0x58fb2c(_0x5445af);});});}exports['GetCmHopperBlack']=function(_0x284f7a){var _0x29dc17=this;return new Promise(function(_0x450938,_0x4fee40){return db[_0x88c4('0x15')]['findAll']({'raw':_0x284f7a[_0x88c4('0x16')]?_0x284f7a['options'][_0x88c4('0x17')]===undefined?!![]:![]:!![],'where':_0x284f7a[_0x88c4('0x16')]?_0x284f7a[_0x88c4('0x16')]['where']||null:null,'attributes':_0x284f7a[_0x88c4('0x16')]?_0x284f7a[_0x88c4('0x16')][_0x88c4('0x18')]||null:null,'limit':_0x284f7a[_0x88c4('0x16')]?_0x284f7a[_0x88c4('0x16')][_0x88c4('0x19')]||null:null,'include':_0x284f7a['options']?_0x284f7a[_0x88c4('0x16')][_0x88c4('0x1a')]?_[_0x88c4('0x1b')](_0x284f7a[_0x88c4('0x16')][_0x88c4('0x1a')],function(_0x3b429f){return{'model':db[_0x3b429f['model']],'as':_0x3b429f['as'],'attributes':_0x3b429f['attributes'],'include':_0x3b429f[_0x88c4('0x1a')]?_['map'](_0x3b429f[_0x88c4('0x1a')],function(_0x556e83){return{'model':db[_0x556e83[_0x88c4('0x1c')]],'as':_0x556e83['as'],'attributes':_0x556e83['attributes'],'include':_0x556e83['include']?_[_0x88c4('0x1b')](_0x556e83['include'],function(_0xe8c224){return{'model':db[_0xe8c224['model']],'as':_0xe8c224['as'],'attributes':_0xe8c224[_0x88c4('0x18')]};}):[]};}):[]};}):[]:[]})[_0x88c4('0xa')](function(_0x772406){logger[_0x88c4('0xb')](_0x88c4('0x1d'),_0x284f7a);logger[_0x88c4('0xe')]('GetCmHopperBlack',_0x284f7a,JSON[_0x88c4('0x10')](_0x772406));_0x450938(_0x772406);})[_0x88c4('0x1e')](function(_0x188db6){logger['error']('GetCmHopperBlack',_0x188db6[_0x88c4('0x13')],_0x284f7a);_0x4fee40(_0x29dc17[_0x88c4('0x11')](0x1f4,_0x188db6[_0x88c4('0x13')]));});});};exports[_0x88c4('0x1f')]=function(_0x176d0e){var _0x2ee61b=this;return new Promise(function(_0x41f531,_0x26dfe3){return db['CmHopperBlack'][_0x88c4('0x20')](_0x176d0e['body'],{'raw':_0x176d0e[_0x88c4('0x16')]?_0x176d0e[_0x88c4('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x176d0e[_0x88c4('0x16')]?_0x176d0e[_0x88c4('0x16')][_0x88c4('0x21')]||null:null,'attributes':_0x176d0e['options']?_0x176d0e[_0x88c4('0x16')][_0x88c4('0x18')]||null:null,'limit':_0x176d0e[_0x88c4('0x16')]?_0x176d0e['options'][_0x88c4('0x19')]||null:null})[_0x88c4('0xa')](function(_0x475ebf){logger[_0x88c4('0xb')](_0x88c4('0x1f'),_0x176d0e);logger[_0x88c4('0xe')]('UpdateCmHopperBlack',_0x176d0e,JSON['stringify'](_0x475ebf));_0x41f531(_0x475ebf);})[_0x88c4('0x1e')](function(_0x3135f2){logger[_0x88c4('0x11')](_0x88c4('0x1f'),_0x3135f2[_0x88c4('0x13')],_0x176d0e);_0x26dfe3(_0x2ee61b[_0x88c4('0x11')](0x1f4,_0x3135f2['message']));});});};exports[_0x88c4('0x22')]=function(_0x34cede){var _0x4c9faf=this;return new Promise(function(_0x5ce6dd,_0x45e281){return db[_0x88c4('0x15')][_0x88c4('0x23')]({'where':_0x34cede[_0x88c4('0x16')]?_0x34cede['options'][_0x88c4('0x21')]||null:null})[_0x88c4('0xa')](function(_0x2c9efa){logger['info']('DestroyCmHopperBlack',_0x34cede);logger['debug'](_0x88c4('0x22'),_0x34cede,JSON['stringify'](_0x2c9efa));_0x5ce6dd(_0x2c9efa);})[_0x88c4('0x1e')](function(_0x5e9b6e){logger[_0x88c4('0x11')](_0x88c4('0x22'),_0x5e9b6e[_0x88c4('0x13')],_0x34cede);_0x45e281(_0x4c9faf['error'](0x1f4,_0x5e9b6e['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 5cb31be..7543dcf 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 _0x919d=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id'];(function(_0x439d88,_0x4f6d25){var _0x166de0=function(_0x5bcd96){while(--_0x5bcd96){_0x439d88['push'](_0x439d88['shift']());}};_0x166de0(++_0x4f6d25);}(_0x919d,0x1c0));var _0xd919=function(_0x131998,_0x18b7b6){_0x131998=_0x131998-0x0;var _0x462960=_0x919d[_0x131998];return _0x462960;};'use strict';var multer=require(_0xd919('0x0'));var util=require(_0xd919('0x1'));var path=require(_0xd919('0x2'));var timeout=require(_0xd919('0x3'));var express=require('express');var router=express[_0xd919('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd919('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0xd919('0x6')]('/',auth[_0xd919('0x7')](),controller['index']);router['get'](_0xd919('0x8'),auth[_0xd919('0x7')](),controller[_0xd919('0x9')]);router['get'](_0xd919('0xa'),auth[_0xd919('0x7')](),controller[_0xd919('0xb')]);router[_0xd919('0xc')](_0xd919('0xa'),auth['isAuthenticated'](),controller[_0xd919('0xd')]);router[_0xd919('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xd919('0xf')]);module[_0xd919('0x10')]=router; \ No newline at end of file +var _0x3d9c=['destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','show','put','update','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3d9c,0x134));var _0xc3d9=function(_0x434e49,_0x1e3264){_0x434e49=_0x434e49-0x0;var _0x51e5c5=_0x3d9c[_0x434e49];return _0x51e5c5;};'use strict';var multer=require(_0xc3d9('0x0'));var util=require('util');var path=require(_0xc3d9('0x1'));var timeout=require(_0xc3d9('0x2'));var express=require(_0xc3d9('0x3'));var router=express['Router']();var auth=require(_0xc3d9('0x4'));var interaction=require(_0xc3d9('0x5'));var config=require(_0xc3d9('0x6'));var controller=require(_0xc3d9('0x7'));router[_0xc3d9('0x8')]('/',auth[_0xc3d9('0x9')](),controller[_0xc3d9('0xa')]);router['get'](_0xc3d9('0xb'),auth[_0xc3d9('0x9')](),controller['describe']);router[_0xc3d9('0x8')]('/:id',auth[_0xc3d9('0x9')](),controller[_0xc3d9('0xc')]);router[_0xc3d9('0xd')]('/:id',auth[_0xc3d9('0x9')](),controller[_0xc3d9('0xe')]);router['delete'](_0xc3d9('0xf'),auth[_0xc3d9('0x9')](),controller[_0xc3d9('0x10')]);module[_0xc3d9('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index aa7ba9c..97831fc 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 _0xe542=['BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat'];(function(_0x10ed52,_0x4dcad2){var _0x2f4623=function(_0x4fc455){while(--_0x4fc455){_0x10ed52['push'](_0x10ed52['shift']());}};_0x2f4623(++_0x4dcad2);}(_0xe542,0x16d));var _0x2e54=function(_0x21f2f2,_0x342530){_0x21f2f2=_0x21f2f2-0x0;var _0x58d98d=_0xe542[_0x21f2f2];return _0x58d98d;};'use strict';var Sequelize=require(_0x2e54('0x0'));var moment=require(_0x2e54('0x1'));module[_0x2e54('0x2')]={'state':{'type':Sequelize[_0x2e54('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x2e54('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2e54('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2e54('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2e54('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2e54('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x2e54('0x4')]},'originatecalleridname':{'type':Sequelize[_0x2e54('0x4')]},'calleridnum':{'type':Sequelize[_0x2e54('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2e54('0x5')]},'responsetime':{'type':Sequelize[_0x2e54('0x5')]},'answertime':{'type':Sequelize[_0x2e54('0x5')]},'droptime':{'type':Sequelize[_0x2e54('0x5')]},'endtime':{'type':Sequelize[_0x2e54('0x5')]},'ringtime':{'type':Sequelize[_0x2e54('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2e54('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2e54('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2e54('0x4')]},'campaign':{'type':Sequelize[_0x2e54('0x4')]},'campaigntype':{'type':Sequelize[_0x2e54('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x2e54('0x4')]},'disposition':{'type':Sequelize[_0x2e54('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x200e3b){var _0x4a9838=this[_0x2e54('0x6')](_0x2e54('0x7'));if(_0x4a9838&&_0x200e3b){this[_0x2e54('0x8')](_0x2e54('0x9'),moment(_0x200e3b)[_0x2e54('0xa')](moment(_0x4a9838),_0x2e54('0xb')));}return this[_0x2e54('0x8')](_0x2e54('0xc'),_0x200e3b);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x2e54('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2e54('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2e54('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2e54('0x5')]},'callback':{'type':Sequelize[_0x2e54('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2e54('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2e54('0x5')]},'deleted':{'type':Sequelize[_0x2e54('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2e54('0x5')]},'recallme':{'type':Sequelize[_0x2e54('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2e54('0x5')]}}; \ No newline at end of file +var _0xb388=['DATE','endtime','diff','setDataValue','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb388,0x1df));var _0x8b38=function(_0x375388,_0x592802){_0x375388=_0x375388-0x0;var _0x8f3642=_0xb388[_0x375388];return _0x8f3642;};'use strict';var Sequelize=require(_0x8b38('0x0'));var moment=require(_0x8b38('0x1'));module[_0x8b38('0x2')]={'state':{'type':Sequelize[_0x8b38('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x8b38('0x4')]},'scheduledat':{'type':Sequelize[_0x8b38('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8b38('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x8b38('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8b38('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x8b38('0x5')]},'responsetime':{'type':Sequelize[_0x8b38('0x5')]},'answertime':{'type':Sequelize[_0x8b38('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8b38('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8b38('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8b38('0x4')]},'campaign':{'type':Sequelize[_0x8b38('0x4')]},'campaigntype':{'type':Sequelize[_0x8b38('0x4')]},'membername':{'type':Sequelize[_0x8b38('0x4')]},'reason':{'type':Sequelize[_0x8b38('0x4')]},'disposition':{'type':Sequelize[_0x8b38('0x4')]},'dispositionat':{'type':Sequelize[_0x8b38('0x5')],'set':function(_0x2b1b74){var _0x52ff7e=this['getDataValue'](_0x8b38('0x6'));if(_0x52ff7e&&_0x2b1b74){this['setDataValue']('followuptime',moment(_0x2b1b74)[_0x8b38('0x7')](moment(_0x52ff7e),'seconds'));}return this[_0x8b38('0x8')](_0x8b38('0x9'),_0x2b1b74);}},'amd':{'type':Sequelize[_0x8b38('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8b38('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8b38('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x8b38('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x8b38('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8b38('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x8b38('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8b38('0x5')]},'recallme':{'type':Sequelize[_0x8b38('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8b38('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index a0ee2fa..b6e72c9 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 _0xb688=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','rawAttributes','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','params','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','busyContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','VoiceQueue','insert','cm_hopper','fromQuery','phone','ListId','VoiceQueueId','updatedAt','select','ANY_VALUE(calleridnum)','ContactId','ANY_VALUE(VoiceQueueId)','createdAt','NOW()','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','group','Campaign','into','scheduledAt','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','state\x20=\x204','checkContactHopper','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','name','index','CmHopperFinal','model','keys','query','filters','intersection','attributes'];(function(_0x278b30,_0x5cf8a3){var _0x535b59=function(_0x1795c6){while(--_0x1795c6){_0x278b30['push'](_0x278b30['shift']());}};_0x535b59(++_0x5cf8a3);}(_0xb688,0xcf));var _0x8b68=function(_0x4baef8,_0x5222fb){_0x4baef8=_0x4baef8-0x0;var _0x17b041=_0xb688[_0x4baef8];return _0x17b041;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8b68('0x0'));var rimraf=require(_0x8b68('0x1'));var zipdir=require(_0x8b68('0x2'));var jsonpatch=require(_0x8b68('0x3'));var rp=require(_0x8b68('0x4'));var moment=require(_0x8b68('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8b68('0x6'));var util=require(_0x8b68('0x7'));var path=require(_0x8b68('0x8'));var sox=require(_0x8b68('0x9'));var csv=require('to-csv');var ejs=require(_0x8b68('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0xf'));var querystring=require(_0x8b68('0x10'));var Papa=require(_0x8b68('0x11'));var authService=require(_0x8b68('0x12'));var hardwareService=require(_0x8b68('0x13'));var Redis=require(_0x8b68('0x14'));var qs=require(_0x8b68('0x15'));var logger=require(_0x8b68('0x16'))(_0x8b68('0x17'));var utils=require('../../config/utils');var config=require(_0x8b68('0x18'));var db=require(_0x8b68('0x19'))['db'];function respondWithStatusCode(_0x5e76c,_0x2d8472){_0x2d8472=_0x2d8472||0xcc;return function(_0x1965cf){if(_0x1965cf){return _0x5e76c[_0x8b68('0x1a')](_0x2d8472);}return _0x5e76c[_0x8b68('0x1b')](_0x2d8472)[_0x8b68('0x1c')]();};}function respondWithResult(_0x2686c7,_0x5b4364){_0x5b4364=_0x5b4364||0xc8;return function(_0xb2df35){if(_0xb2df35){return _0x2686c7['status'](_0x5b4364)['json'](_0xb2df35);}};}function respondWithFilteredResult(_0x22f75b,_0x1554d6){return function(_0x27d717){if(_0x27d717){var _0x5d3468=_0x27d717[_0x8b68('0x1d')],_0x5c8d0e=_0x1554d6[_0x8b68('0x1e')],_0x23bd52=_0x1554d6[_0x8b68('0x1e')]+_0x1554d6[_0x8b68('0x1f')],_0x5c1e44;if(_0x23bd52>=_0x5d3468){_0x23bd52=_0x5d3468;_0x5c1e44=0xc8;}else{_0x5c1e44=0xce;}_0x22f75b['status'](_0x5c1e44);return _0x22f75b[_0x8b68('0x20')](_0x8b68('0x21'),_0x5c8d0e+'-'+_0x23bd52+'/'+_0x5d3468)['json'](_0x27d717);}return null;};}function patchUpdates(_0x42b3bd){return function(_0x3c7e5a){try{jsonpatch[_0x8b68('0x22')](_0x3c7e5a,_0x42b3bd,!![]);}catch(_0x17f321){return BPromise[_0x8b68('0x23')](_0x17f321);}return _0x3c7e5a['save']();};}function saveUpdates(_0x7b0b70,_0x4b4b0f){return function(_0x59e9b1){if(_0x59e9b1){return _0x59e9b1[_0x8b68('0x24')](_0x7b0b70)[_0x8b68('0x25')](function(_0x1dbc1d){return _0x1dbc1d;});}return null;};}function removeEntity(_0x5603d4,_0x571adf){return function(_0x23edc1){if(_0x23edc1){return _0x23edc1['destroy']()[_0x8b68('0x25')](function(){_0x5603d4[_0x8b68('0x1b')](0xcc)[_0x8b68('0x1c')]();});}};}function handleEntityNotFound(_0x21ecca,_0x32ddc5){return function(_0x173524){if(!_0x173524){_0x21ecca['sendStatus'](0x194);}return _0x173524;};}function handleError(_0x1a6fe8,_0x46e827){_0x46e827=_0x46e827||0x1f4;return function(_0x4ca77d){logger[_0x8b68('0x26')](_0x4ca77d[_0x8b68('0x27')]);if(_0x4ca77d[_0x8b68('0x28')]){delete _0x4ca77d['name'];}_0x1a6fe8['status'](_0x46e827)['send'](_0x4ca77d);};}exports[_0x8b68('0x29')]=function(_0x448e43,_0x2ba2a3){var _0x583476={},_0x3311c7={},_0x53aaa2={'count':0x0,'rows':[]};var _0x4cf89d=db[_0x8b68('0x2a')]['rawAttributes'];_0x3311c7[_0x8b68('0x2b')]=_[_0x8b68('0x2c')](_0x4cf89d);_0x3311c7['query']=_['keys'](_0x448e43[_0x8b68('0x2d')]);_0x3311c7[_0x8b68('0x2e')]=_[_0x8b68('0x2f')](_0x3311c7[_0x8b68('0x2b')],_0x3311c7[_0x8b68('0x2d')]);_0x583476[_0x8b68('0x30')]=_[_0x8b68('0x2f')](_0x3311c7['model'],qs[_0x8b68('0x31')](_0x448e43['query'][_0x8b68('0x31')]));_0x583476[_0x8b68('0x30')]=_0x583476['attributes'][_0x8b68('0x32')]?_0x583476[_0x8b68('0x30')]:_0x3311c7[_0x8b68('0x2b')];if(!_0x448e43['query']['hasOwnProperty'](_0x8b68('0x33'))){_0x583476[_0x8b68('0x1f')]=qs[_0x8b68('0x1f')](_0x448e43[_0x8b68('0x2d')][_0x8b68('0x1f')]);_0x583476[_0x8b68('0x1e')]=qs[_0x8b68('0x1e')](_0x448e43[_0x8b68('0x2d')][_0x8b68('0x1e')]);}_0x583476[_0x8b68('0x34')]=qs[_0x8b68('0x35')](_0x448e43[_0x8b68('0x2d')][_0x8b68('0x35')]);_0x583476[_0x8b68('0x36')]=qs[_0x8b68('0x2e')](_[_0x8b68('0x37')](_0x448e43[_0x8b68('0x2d')],_0x3311c7[_0x8b68('0x2e')]));if(_0x448e43[_0x8b68('0x2d')][_0x8b68('0x38')]){_0x583476[_0x8b68('0x36')]=_[_0x8b68('0x39')](_0x583476['where'],{'$or':_['map'](_0x4cf89d,function(_0x24026c){if(_0x24026c[_0x8b68('0x3a')][_0x8b68('0x3b')]!==_0x8b68('0x3c')){var _0xf2154f={};_0xf2154f[_0x24026c[_0x8b68('0x3d')]]={'$like':'%'+_0x448e43[_0x8b68('0x2d')][_0x8b68('0x38')]+'%'};return _0xf2154f;}})});}_0x583476=_['merge']({},_0x583476,_0x448e43[_0x8b68('0x3e')]);var _0x2c94d0={'where':_0x583476[_0x8b68('0x36')]};return db[_0x8b68('0x2a')][_0x8b68('0x1d')](_0x2c94d0)[_0x8b68('0x25')](function(_0xff4080){_0x53aaa2[_0x8b68('0x1d')]=_0xff4080;if(_0x448e43['query'][_0x8b68('0x3f')]){_0x583476[_0x8b68('0x40')]=[{'all':!![]}];}return db[_0x8b68('0x2a')][_0x8b68('0x41')](_0x583476);})[_0x8b68('0x25')](function(_0x3b3394){_0x53aaa2[_0x8b68('0x42')]=_0x3b3394;return _0x53aaa2;})['then'](respondWithFilteredResult(_0x2ba2a3,_0x583476))[_0x8b68('0x43')](handleError(_0x2ba2a3,null));};exports[_0x8b68('0x44')]=function(_0x48f159,_0x14ec40){var _0x27a717={'raw':!![],'where':{'id':_0x48f159['params']['id']}},_0x50b2f1={};_0x50b2f1['model']=_['keys'](db[_0x8b68('0x2a')][_0x8b68('0x45')]);_0x50b2f1['query']=_[_0x8b68('0x2c')](_0x48f159['query']);_0x50b2f1[_0x8b68('0x2e')]=_[_0x8b68('0x2f')](_0x50b2f1['model'],_0x50b2f1[_0x8b68('0x2d')]);_0x27a717['attributes']=_['intersection'](_0x50b2f1['model'],qs[_0x8b68('0x31')](_0x48f159[_0x8b68('0x2d')][_0x8b68('0x31')]));_0x27a717[_0x8b68('0x30')]=_0x27a717['attributes'][_0x8b68('0x32')]?_0x27a717['attributes']:_0x50b2f1[_0x8b68('0x2b')];if(_0x48f159[_0x8b68('0x2d')]['includeAll']){_0x27a717[_0x8b68('0x40')]=[{'all':!![]}];}_0x27a717=_[_0x8b68('0x39')]({},_0x27a717,_0x48f159[_0x8b68('0x3e')]);return db[_0x8b68('0x2a')]['find'](_0x27a717)[_0x8b68('0x25')](handleEntityNotFound(_0x14ec40,null))[_0x8b68('0x25')](respondWithResult(_0x14ec40,null))[_0x8b68('0x43')](handleError(_0x14ec40,null));};exports[_0x8b68('0x46')]=function(_0xae2c2a,_0x1362d3){return db[_0x8b68('0x2a')][_0x8b68('0x46')]()[_0x8b68('0x25')](respondWithResult(_0x1362d3,null))[_0x8b68('0x43')](handleError(_0x1362d3,null));};exports[_0x8b68('0x24')]=function(_0x2a2a99,_0x1af430){if(_0x2a2a99[_0x8b68('0x47')][_0x8b68('0x48')]){delete _0x2a2a99[_0x8b68('0x47')]['uniqueid'];}return db[_0x8b68('0x2a')][_0x8b68('0x49')]({'where':{'uniqueid':_0x2a2a99['params']['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x1af430,null))['then'](saveUpdates(_0x2a2a99['body'],null))['then'](respondWithResult(_0x1af430,null))[_0x8b68('0x43')](handleError(_0x1af430,null));};exports[_0x8b68('0x4a')]=function(_0x34047c,_0x6da48b,_0x49e279){return db['CmHopperFinal'][_0x8b68('0x41')]({'raw':![],'where':{'VoiceQueueId':_0x34047c[_0x8b68('0x4b')]['id']},'attributes':[[db[_0x8b68('0x4c')]['fn']('COUNT',db[_0x8b68('0x4c')]['fn']('IF',db[_0x8b68('0x4c')]['literal'](_0x8b68('0x4d')))),_0x8b68('0x4e')],[db['sequelize']['fn'](_0x8b68('0x4f'),db[_0x8b68('0x4c')]['fn']('IF',db['sequelize'][_0x8b68('0x50')](_0x8b68('0x51')))),'noAnswerContacts'],[db['sequelize']['fn']('COUNT',db[_0x8b68('0x4c')]['fn']('IF',db[_0x8b68('0x4c')][_0x8b68('0x50')](_0x8b68('0x52')))),'busyContacts'],[db['sequelize']['fn'](_0x8b68('0x4f'),db[_0x8b68('0x4c')]['fn']('IF',db[_0x8b68('0x4c')]['literal'](_0x8b68('0x53')))),_0x8b68('0x54')],[db[_0x8b68('0x4c')]['fn']('COUNT',db[_0x8b68('0x4c')]['fn']('IF',db['sequelize'][_0x8b68('0x50')](_0x8b68('0x55')))),'dropContacts'],[db[_0x8b68('0x4c')]['fn'](_0x8b68('0x4f'),db[_0x8b68('0x4c')]['fn']('IF',db[_0x8b68('0x4c')][_0x8b68('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x8b68('0x56')],[db[_0x8b68('0x4c')]['fn'](_0x8b68('0x4f'),db[_0x8b68('0x4c')]['fn']('IF',db[_0x8b68('0x4c')][_0x8b68('0x50')](_0x8b68('0x57')))),_0x8b68('0x58')],[db['sequelize']['fn'](_0x8b68('0x4f'),db[_0x8b68('0x4c')]['fn']('IF',db[_0x8b68('0x4c')][_0x8b68('0x50')](_0x8b68('0x59')))),_0x8b68('0x5a')]]})[_0x8b68('0x25')](handleEntityNotFound(_0x6da48b,null))[_0x8b68('0x25')](respondWithResult(_0x6da48b,null))[_0x8b68('0x43')](handleError(_0x6da48b,null));};exports[_0x8b68('0x5b')]=function(_0x368c86,_0x42871e,_0x1019cb){return db[_0x8b68('0x2a')][_0x8b68('0x41')]({'raw':![],'where':{'CampaignId':_0x368c86[_0x8b68('0x4b')]['id']},'attributes':[[db[_0x8b68('0x4c')]['fn'](_0x8b68('0x4f'),db[_0x8b68('0x4c')]['fn']('IF',db[_0x8b68('0x4c')]['literal'](_0x8b68('0x4d')))),'noSuchContacts'],[db['sequelize']['fn'](_0x8b68('0x4f'),db['sequelize']['fn']('IF',db[_0x8b68('0x4c')][_0x8b68('0x50')](_0x8b68('0x51')))),'noAnswerContacts'],[db[_0x8b68('0x4c')]['fn'](_0x8b68('0x4f'),db[_0x8b68('0x4c')]['fn']('IF',db[_0x8b68('0x4c')][_0x8b68('0x50')](_0x8b68('0x52')))),_0x8b68('0x5c')],[db['sequelize']['fn']('COUNT',db[_0x8b68('0x4c')]['fn']('IF',db[_0x8b68('0x4c')][_0x8b68('0x50')](_0x8b68('0x53')))),_0x8b68('0x54')],[db[_0x8b68('0x4c')]['fn'](_0x8b68('0x4f'),db[_0x8b68('0x4c')]['fn']('IF',db[_0x8b68('0x4c')][_0x8b68('0x50')](_0x8b68('0x55')))),_0x8b68('0x5d')],[db[_0x8b68('0x4c')]['fn'](_0x8b68('0x4f'),db[_0x8b68('0x4c')]['fn']('IF',db[_0x8b68('0x4c')][_0x8b68('0x50')](_0x8b68('0x5e')))),'abandonedContacts'],[db['sequelize']['fn'](_0x8b68('0x4f'),db[_0x8b68('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x8b68('0x58')],[db[_0x8b68('0x4c')]['fn'](_0x8b68('0x4f'),db[_0x8b68('0x4c')]['fn']('IF',db[_0x8b68('0x4c')]['literal'](_0x8b68('0x59')))),_0x8b68('0x5a')]]})['then'](handleEntityNotFound(_0x42871e,null))[_0x8b68('0x25')](respondWithResult(_0x42871e,null))['catch'](handleError(_0x42871e,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x5d8cea,_0x2e82f7,_0x2cb665){return db[_0x8b68('0x5f')][_0x8b68('0x49')]({'where':{'id':_0x5d8cea[_0x8b68('0x4b')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x2e82f7,null))[_0x8b68('0x25')](function(_0x34456d){var _0x427752;if(_0x34456d){_0x427752=squel[_0x8b68('0x60')]()['into'](_0x8b68('0x61'))[_0x8b68('0x62')]([_0x8b68('0x63'),'scheduledAt','ContactId',_0x8b68('0x64'),_0x8b68('0x65'),'createdAt',_0x8b68('0x66')],squel[_0x8b68('0x67')]()[_0x8b68('0x3d')](_0x8b68('0x68'),'phone')[_0x8b68('0x3d')]('NOW()','scheduledAt')[_0x8b68('0x3d')]('ANY_VALUE(ContactId)',_0x8b68('0x69'))[_0x8b68('0x3d')]('ANY_VALUE(ListId)',_0x8b68('0x64'))[_0x8b68('0x3d')](_0x8b68('0x6a'),_0x8b68('0x65'))[_0x8b68('0x3d')]('NOW()',_0x8b68('0x6b'))[_0x8b68('0x3d')](_0x8b68('0x6c'),_0x8b68('0x66'))[_0x8b68('0x6d')]('cm_hopper_final')['where'](_0x8b68('0x6e'),_0x5d8cea['params']['id'][_0x8b68('0x6f')]())[_0x8b68('0x36')](_0x8b68('0x70'),_0x5d8cea[_0x8b68('0x47')][_0x8b68('0x71')][_0x8b68('0x6f')]())[_0x8b68('0x36')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8b68('0x36')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x8b68('0x67')]()[_0x8b68('0x3d')](_0x8b68('0x63'))['from'](_0x8b68('0x61'))['where'](_0x8b68('0x6e'),_0x5d8cea['params']['id'][_0x8b68('0x6f')]()))[_0x8b68('0x36')](_0x8b68('0x72'),squel['select']()[_0x8b68('0x3d')](_0x8b68('0x73'))[_0x8b68('0x6d')](_0x8b68('0x74'))[_0x8b68('0x36')](_0x8b68('0x6e'),_0x5d8cea[_0x8b68('0x4b')]['id'][_0x8b68('0x6f')]())[_0x8b68('0x36')]('state\x20=\x204'))[_0x8b68('0x75')](_0x8b68('0x69')))[_0x8b68('0x6f')]();return db[_0x8b68('0x4c')][_0x8b68('0x2d')](_0x427752);}return[];})['then'](respondWithResult(_0x2e82f7,null))[_0x8b68('0x43')](handleError(_0x2e82f7,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x23ecce,_0x2de166,_0x524763){return db[_0x8b68('0x76')][_0x8b68('0x49')]({'where':{'id':_0x23ecce[_0x8b68('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2de166,null))[_0x8b68('0x25')](function(_0x18ee1a){var _0x43a874;if(_0x18ee1a){_0x43a874=squel[_0x8b68('0x60')]()[_0x8b68('0x77')](_0x8b68('0x61'))['fromQuery']([_0x8b68('0x63'),_0x8b68('0x78'),_0x8b68('0x69'),'ListId',_0x8b68('0x79'),_0x8b68('0x6b'),_0x8b68('0x66')],squel[_0x8b68('0x67')]()[_0x8b68('0x3d')](_0x8b68('0x68'),_0x8b68('0x63'))[_0x8b68('0x3d')](_0x8b68('0x6c'),_0x8b68('0x78'))[_0x8b68('0x3d')]('ANY_VALUE(ContactId)','ContactId')[_0x8b68('0x3d')](_0x8b68('0x7a'),_0x8b68('0x64'))[_0x8b68('0x3d')](_0x8b68('0x7b'),'CampaignId')[_0x8b68('0x3d')](_0x8b68('0x6c'),_0x8b68('0x6b'))[_0x8b68('0x3d')]('NOW()','updatedAt')[_0x8b68('0x6d')](_0x8b68('0x74'))[_0x8b68('0x36')](_0x8b68('0x7c'),_0x23ecce[_0x8b68('0x4b')]['id'][_0x8b68('0x6f')]())[_0x8b68('0x36')](_0x8b68('0x70'),_0x23ecce['body'][_0x8b68('0x71')][_0x8b68('0x6f')]())[_0x8b68('0x36')](_0x8b68('0x7d'))[_0x8b68('0x36')](_0x8b68('0x72'),squel['select']()[_0x8b68('0x3d')](_0x8b68('0x63'))[_0x8b68('0x6d')]('cm_hopper')[_0x8b68('0x36')]('CampaignId\x20=\x20?',_0x23ecce[_0x8b68('0x4b')]['id']['toString']()))[_0x8b68('0x36')](_0x8b68('0x72'),squel[_0x8b68('0x67')]()[_0x8b68('0x3d')](_0x8b68('0x73'))[_0x8b68('0x6d')]('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x23ecce[_0x8b68('0x4b')]['id'][_0x8b68('0x6f')]())[_0x8b68('0x36')](_0x8b68('0x7e')))[_0x8b68('0x75')](_0x8b68('0x69')))[_0x8b68('0x6f')]();return db[_0x8b68('0x4c')][_0x8b68('0x2d')](_0x43a874);}return[];})[_0x8b68('0x25')](respondWithResult(_0x2de166,null))[_0x8b68('0x43')](handleError(_0x2de166,null));};exports[_0x8b68('0x7f')]=function(_0x230676,_0x1c5a71,_0x322e3c){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x230676['body'][_0x8b68('0x65')],'CampaignId':_0x230676[_0x8b68('0x47')][_0x8b68('0x79')],'ContactId':_0x230676[_0x8b68('0x47')][_0x8b68('0x69')]}})['then'](handleEntityNotFound(_0x1c5a71,null))[_0x8b68('0x25')](function(_0x5294ba){if(_0x5294ba){return _0x5294ba;}return null;})[_0x8b68('0x25')](respondWithResult(_0x1c5a71,null))['catch'](handleError(_0x1c5a71,null));}; \ No newline at end of file +var _0xe5b5=['dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','createdAt','select','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','toString','calleridnum','cm_hopper_final','ContactId','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','updatedAt','ANY_VALUE(ListId)','state','calleridnum\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','reject','update','then','error','name','index','CmHopperFinal','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','catch','params','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null'];(function(_0x499c1c,_0x37897b){var _0x1fc8bf=function(_0x3b4229){while(--_0x3b4229){_0x499c1c['push'](_0x499c1c['shift']());}};_0x1fc8bf(++_0x37897b);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0xe5b5[_0x13843f];return _0x1063ae;};'use strict';var pdf=require(_0x5e5b('0x0'));var emlformat=require(_0x5e5b('0x1'));var rimraf=require(_0x5e5b('0x2'));var zipdir=require(_0x5e5b('0x3'));var jsonpatch=require(_0x5e5b('0x4'));var rp=require(_0x5e5b('0x5'));var moment=require(_0x5e5b('0x6'));var BPromise=require(_0x5e5b('0x7'));var Mustache=require(_0x5e5b('0x8'));var util=require(_0x5e5b('0x9'));var path=require(_0x5e5b('0xa'));var sox=require(_0x5e5b('0xb'));var csv=require(_0x5e5b('0xc'));var ejs=require(_0x5e5b('0xd'));var fs=require('fs');var _=require(_0x5e5b('0xe'));var squel=require(_0x5e5b('0xf'));var crypto=require(_0x5e5b('0x10'));var jsforce=require(_0x5e5b('0x11'));var deskjs=require(_0x5e5b('0x12'));var toCsv=require(_0x5e5b('0xc'));var querystring=require(_0x5e5b('0x13'));var Papa=require(_0x5e5b('0x14'));var authService=require(_0x5e5b('0x15'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x5e5b('0x16'));var qs=require('../../components/parsers/qs');var logger=require(_0x5e5b('0x17'))(_0x5e5b('0x18'));var utils=require(_0x5e5b('0x19'));var config=require(_0x5e5b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a1424,_0x5ebf65){_0x5ebf65=_0x5ebf65||0xcc;return function(_0x310f71){if(_0x310f71){return _0x4a1424[_0x5e5b('0x1b')](_0x5ebf65);}return _0x4a1424[_0x5e5b('0x1c')](_0x5ebf65)[_0x5e5b('0x1d')]();};}function respondWithResult(_0x13a01e,_0x1e3483){_0x1e3483=_0x1e3483||0xc8;return function(_0x2e331d){if(_0x2e331d){return _0x13a01e['status'](_0x1e3483)[_0x5e5b('0x1e')](_0x2e331d);}};}function respondWithFilteredResult(_0x2e92c3,_0x4ff37b){return function(_0x227417){if(_0x227417){var _0x578c14=_0x227417[_0x5e5b('0x1f')],_0x4e9509=_0x4ff37b['offset'],_0x13a1cb=_0x4ff37b[_0x5e5b('0x20')]+_0x4ff37b['limit'],_0x444435;if(_0x13a1cb>=_0x578c14){_0x13a1cb=_0x578c14;_0x444435=0xc8;}else{_0x444435=0xce;}_0x2e92c3[_0x5e5b('0x1c')](_0x444435);return _0x2e92c3[_0x5e5b('0x21')]('Content-Range',_0x4e9509+'-'+_0x13a1cb+'/'+_0x578c14)[_0x5e5b('0x1e')](_0x227417);}return null;};}function patchUpdates(_0x1560e1){return function(_0x2281c8){try{jsonpatch['apply'](_0x2281c8,_0x1560e1,!![]);}catch(_0x2bf0b7){return BPromise[_0x5e5b('0x22')](_0x2bf0b7);}return _0x2281c8['save']();};}function saveUpdates(_0x2fdc38,_0x1aa0c2){return function(_0x3c488e){if(_0x3c488e){return _0x3c488e[_0x5e5b('0x23')](_0x2fdc38)[_0x5e5b('0x24')](function(_0x33d61b){return _0x33d61b;});}return null;};}function removeEntity(_0x93df5c,_0x37552c){return function(_0x4a78e3){if(_0x4a78e3){return _0x4a78e3['destroy']()[_0x5e5b('0x24')](function(){_0x93df5c[_0x5e5b('0x1c')](0xcc)[_0x5e5b('0x1d')]();});}};}function handleEntityNotFound(_0xe1c268,_0x2e38ed){return function(_0x28cd95){if(!_0x28cd95){_0xe1c268[_0x5e5b('0x1b')](0x194);}return _0x28cd95;};}function handleError(_0x18903e,_0x161599){_0x161599=_0x161599||0x1f4;return function(_0x26bc02){logger[_0x5e5b('0x25')](_0x26bc02['stack']);if(_0x26bc02[_0x5e5b('0x26')]){delete _0x26bc02[_0x5e5b('0x26')];}_0x18903e[_0x5e5b('0x1c')](_0x161599)['send'](_0x26bc02);};}exports[_0x5e5b('0x27')]=function(_0xdb2863,_0x5ee866){var _0x13ff91={},_0x21c74b={},_0x39ce16={'count':0x0,'rows':[]};var _0x36b595=db[_0x5e5b('0x28')][_0x5e5b('0x29')];_0x21c74b[_0x5e5b('0x2a')]=_[_0x5e5b('0x2b')](_0x36b595);_0x21c74b[_0x5e5b('0x2c')]=_[_0x5e5b('0x2b')](_0xdb2863[_0x5e5b('0x2c')]);_0x21c74b[_0x5e5b('0x2d')]=_['intersection'](_0x21c74b['model'],_0x21c74b[_0x5e5b('0x2c')]);_0x13ff91[_0x5e5b('0x2e')]=_[_0x5e5b('0x2f')](_0x21c74b[_0x5e5b('0x2a')],qs[_0x5e5b('0x30')](_0xdb2863['query'][_0x5e5b('0x30')]));_0x13ff91['attributes']=_0x13ff91[_0x5e5b('0x2e')][_0x5e5b('0x31')]?_0x13ff91[_0x5e5b('0x2e')]:_0x21c74b[_0x5e5b('0x2a')];if(!_0xdb2863['query'][_0x5e5b('0x32')](_0x5e5b('0x33'))){_0x13ff91['limit']=qs[_0x5e5b('0x34')](_0xdb2863[_0x5e5b('0x2c')][_0x5e5b('0x34')]);_0x13ff91[_0x5e5b('0x20')]=qs[_0x5e5b('0x20')](_0xdb2863[_0x5e5b('0x2c')][_0x5e5b('0x20')]);}_0x13ff91[_0x5e5b('0x35')]=qs['sort'](_0xdb2863[_0x5e5b('0x2c')][_0x5e5b('0x36')]);_0x13ff91[_0x5e5b('0x37')]=qs[_0x5e5b('0x2d')](_[_0x5e5b('0x38')](_0xdb2863[_0x5e5b('0x2c')],_0x21c74b['filters']));if(_0xdb2863['query'][_0x5e5b('0x39')]){_0x13ff91[_0x5e5b('0x37')]=_[_0x5e5b('0x3a')](_0x13ff91['where'],{'$or':_[_0x5e5b('0x3b')](_0x36b595,function(_0x14bf53){if(_0x14bf53[_0x5e5b('0x3c')][_0x5e5b('0x3d')]!=='VIRTUAL'){var _0x5b3e0d={};_0x5b3e0d[_0x14bf53[_0x5e5b('0x3e')]]={'$like':'%'+_0xdb2863['query']['filter']+'%'};return _0x5b3e0d;}})});}_0x13ff91=_[_0x5e5b('0x3a')]({},_0x13ff91,_0xdb2863[_0x5e5b('0x3f')]);var _0xee3e6f={'where':_0x13ff91['where']};return db[_0x5e5b('0x28')]['count'](_0xee3e6f)['then'](function(_0x261057){_0x39ce16[_0x5e5b('0x1f')]=_0x261057;if(_0xdb2863[_0x5e5b('0x2c')][_0x5e5b('0x40')]){_0x13ff91[_0x5e5b('0x41')]=[{'all':!![]}];}return db[_0x5e5b('0x28')][_0x5e5b('0x42')](_0x13ff91);})[_0x5e5b('0x24')](function(_0x1034fa){_0x39ce16['rows']=_0x1034fa;return _0x39ce16;})[_0x5e5b('0x24')](respondWithFilteredResult(_0x5ee866,_0x13ff91))[_0x5e5b('0x43')](handleError(_0x5ee866,null));};exports['show']=function(_0x204487,_0x4b54b0){var _0x125f95={'raw':!![],'where':{'id':_0x204487[_0x5e5b('0x44')]['id']}},_0x14b152={};_0x14b152[_0x5e5b('0x2a')]=_[_0x5e5b('0x2b')](db[_0x5e5b('0x28')][_0x5e5b('0x29')]);_0x14b152[_0x5e5b('0x2c')]=_[_0x5e5b('0x2b')](_0x204487[_0x5e5b('0x2c')]);_0x14b152[_0x5e5b('0x2d')]=_['intersection'](_0x14b152[_0x5e5b('0x2a')],_0x14b152[_0x5e5b('0x2c')]);_0x125f95[_0x5e5b('0x2e')]=_['intersection'](_0x14b152[_0x5e5b('0x2a')],qs[_0x5e5b('0x30')](_0x204487['query'][_0x5e5b('0x30')]));_0x125f95[_0x5e5b('0x2e')]=_0x125f95['attributes'][_0x5e5b('0x31')]?_0x125f95['attributes']:_0x14b152['model'];if(_0x204487['query'][_0x5e5b('0x40')]){_0x125f95['include']=[{'all':!![]}];}_0x125f95=_[_0x5e5b('0x3a')]({},_0x125f95,_0x204487['options']);return db[_0x5e5b('0x28')][_0x5e5b('0x45')](_0x125f95)[_0x5e5b('0x24')](handleEntityNotFound(_0x4b54b0,null))[_0x5e5b('0x24')](respondWithResult(_0x4b54b0,null))[_0x5e5b('0x43')](handleError(_0x4b54b0,null));};exports[_0x5e5b('0x46')]=function(_0x8b03f2,_0x4e4d03){return db['CmHopperFinal'][_0x5e5b('0x46')]()['then'](respondWithResult(_0x4e4d03,null))['catch'](handleError(_0x4e4d03,null));};exports['update']=function(_0x249922,_0x5d63cc){if(_0x249922[_0x5e5b('0x47')][_0x5e5b('0x48')]){delete _0x249922[_0x5e5b('0x47')][_0x5e5b('0x48')];}return db[_0x5e5b('0x28')][_0x5e5b('0x45')]({'where':{'uniqueid':_0x249922['params']['id']}})[_0x5e5b('0x24')](handleEntityNotFound(_0x5d63cc,null))[_0x5e5b('0x24')](saveUpdates(_0x249922['body'],null))[_0x5e5b('0x24')](respondWithResult(_0x5d63cc,null))['catch'](handleError(_0x5d63cc,null));};exports[_0x5e5b('0x49')]=function(_0x36d8fa,_0x42ebaf,_0x30de85){return db['CmHopperFinal'][_0x5e5b('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x36d8fa[_0x5e5b('0x44')]['id']},'attributes':[[db['sequelize']['fn'](_0x5e5b('0x4a'),db[_0x5e5b('0x4b')]['fn']('IF',db[_0x5e5b('0x4b')][_0x5e5b('0x4c')](_0x5e5b('0x4d')))),_0x5e5b('0x4e')],[db['sequelize']['fn'](_0x5e5b('0x4a'),db[_0x5e5b('0x4b')]['fn']('IF',db['sequelize'][_0x5e5b('0x4c')](_0x5e5b('0x4f')))),_0x5e5b('0x50')],[db['sequelize']['fn'](_0x5e5b('0x4a'),db[_0x5e5b('0x4b')]['fn']('IF',db[_0x5e5b('0x4b')]['literal'](_0x5e5b('0x51')))),_0x5e5b('0x52')],[db[_0x5e5b('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5e5b('0x4b')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x5e5b('0x53')],[db[_0x5e5b('0x4b')]['fn'](_0x5e5b('0x4a'),db['sequelize']['fn']('IF',db[_0x5e5b('0x4b')][_0x5e5b('0x4c')](_0x5e5b('0x54')))),_0x5e5b('0x55')],[db[_0x5e5b('0x4b')]['fn'](_0x5e5b('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x5e5b('0x4c')](_0x5e5b('0x56')))),_0x5e5b('0x57')],[db[_0x5e5b('0x4b')]['fn']('COUNT',db[_0x5e5b('0x4b')]['fn']('IF',db['sequelize'][_0x5e5b('0x4c')](_0x5e5b('0x58')))),_0x5e5b('0x59')],[db[_0x5e5b('0x4b')]['fn'](_0x5e5b('0x4a'),db[_0x5e5b('0x4b')]['fn']('IF',db[_0x5e5b('0x4b')][_0x5e5b('0x4c')]('`state`\x20=\x2019,\x201,\x20null'))),_0x5e5b('0x5a')]]})[_0x5e5b('0x24')](handleEntityNotFound(_0x42ebaf,null))[_0x5e5b('0x24')](respondWithResult(_0x42ebaf,null))[_0x5e5b('0x43')](handleError(_0x42ebaf,null));};exports[_0x5e5b('0x5b')]=function(_0x5543eb,_0x2ccee2,_0x1dc180){return db[_0x5e5b('0x28')][_0x5e5b('0x42')]({'raw':![],'where':{'CampaignId':_0x5543eb[_0x5e5b('0x44')]['id']},'attributes':[[db['sequelize']['fn'](_0x5e5b('0x4a'),db['sequelize']['fn']('IF',db[_0x5e5b('0x4b')]['literal'](_0x5e5b('0x4d')))),_0x5e5b('0x4e')],[db[_0x5e5b('0x4b')]['fn'](_0x5e5b('0x4a'),db[_0x5e5b('0x4b')]['fn']('IF',db[_0x5e5b('0x4b')]['literal'](_0x5e5b('0x4f')))),_0x5e5b('0x50')],[db[_0x5e5b('0x4b')]['fn'](_0x5e5b('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x5e5b('0x4c')](_0x5e5b('0x51')))),'busyContacts'],[db[_0x5e5b('0x4b')]['fn'](_0x5e5b('0x4a'),db[_0x5e5b('0x4b')]['fn']('IF',db[_0x5e5b('0x4b')][_0x5e5b('0x4c')]('`state`\x20=\x208,\x201,\x20null'))),_0x5e5b('0x53')],[db[_0x5e5b('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x5e5b('0x4c')](_0x5e5b('0x54')))),_0x5e5b('0x55')],[db[_0x5e5b('0x4b')]['fn'](_0x5e5b('0x4a'),db['sequelize']['fn']('IF',db[_0x5e5b('0x4b')][_0x5e5b('0x4c')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5e5b('0x57')],[db['sequelize']['fn']('COUNT',db[_0x5e5b('0x4b')]['fn']('IF',db[_0x5e5b('0x4b')][_0x5e5b('0x4c')](_0x5e5b('0x58')))),_0x5e5b('0x59')],[db[_0x5e5b('0x4b')]['fn'](_0x5e5b('0x4a'),db['sequelize']['fn']('IF',db[_0x5e5b('0x4b')][_0x5e5b('0x4c')](_0x5e5b('0x5c')))),_0x5e5b('0x5a')]]})[_0x5e5b('0x24')](handleEntityNotFound(_0x2ccee2,null))[_0x5e5b('0x24')](respondWithResult(_0x2ccee2,null))[_0x5e5b('0x43')](handleError(_0x2ccee2,null));};exports[_0x5e5b('0x5d')]=function(_0x27991a,_0x2a2ea3,_0x26a17f){return db['VoiceQueue'][_0x5e5b('0x45')]({'where':{'id':_0x27991a[_0x5e5b('0x44')]['id']}})[_0x5e5b('0x24')](handleEntityNotFound(_0x2a2ea3,null))[_0x5e5b('0x24')](function(_0xc7171a){var _0x4dcf17;if(_0xc7171a){_0x4dcf17=squel[_0x5e5b('0x5e')]()[_0x5e5b('0x5f')](_0x5e5b('0x60'))[_0x5e5b('0x61')]([_0x5e5b('0x62'),_0x5e5b('0x63'),'ContactId',_0x5e5b('0x64'),_0x5e5b('0x65'),_0x5e5b('0x66'),'updatedAt'],squel[_0x5e5b('0x67')]()[_0x5e5b('0x3e')](_0x5e5b('0x68'),_0x5e5b('0x62'))[_0x5e5b('0x3e')](_0x5e5b('0x69'),_0x5e5b('0x63'))[_0x5e5b('0x3e')](_0x5e5b('0x6a'),'ContactId')[_0x5e5b('0x3e')]('ANY_VALUE(ListId)',_0x5e5b('0x64'))[_0x5e5b('0x3e')]('ANY_VALUE(VoiceQueueId)','VoiceQueueId')[_0x5e5b('0x3e')](_0x5e5b('0x69'),'createdAt')[_0x5e5b('0x3e')]('NOW()','updatedAt')[_0x5e5b('0x6b')]('cm_hopper_final')[_0x5e5b('0x37')](_0x5e5b('0x6c'),_0x27991a[_0x5e5b('0x44')]['id']['toString']())[_0x5e5b('0x37')](_0x5e5b('0x6d'),_0x27991a[_0x5e5b('0x47')]['state'][_0x5e5b('0x6e')]())[_0x5e5b('0x37')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x5e5b('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x5e5b('0x3e')](_0x5e5b('0x62'))[_0x5e5b('0x6b')](_0x5e5b('0x60'))[_0x5e5b('0x37')]('VoiceQueueId\x20=\x20?',_0x27991a[_0x5e5b('0x44')]['id'][_0x5e5b('0x6e')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5e5b('0x67')]()[_0x5e5b('0x3e')](_0x5e5b('0x6f'))[_0x5e5b('0x6b')](_0x5e5b('0x70'))[_0x5e5b('0x37')]('VoiceQueueId\x20=\x20?',_0x27991a[_0x5e5b('0x44')]['id'][_0x5e5b('0x6e')]())[_0x5e5b('0x37')]('state\x20=\x204'))['group'](_0x5e5b('0x71')))[_0x5e5b('0x6e')]();return db[_0x5e5b('0x4b')]['query'](_0x4dcf17);}return[];})[_0x5e5b('0x24')](respondWithResult(_0x2a2ea3,null))[_0x5e5b('0x43')](handleError(_0x2a2ea3,null));};exports[_0x5e5b('0x72')]=function(_0x573cfa,_0x112bf5,_0x40cc5f){return db[_0x5e5b('0x73')]['find']({'where':{'id':_0x573cfa[_0x5e5b('0x44')]['id']}})[_0x5e5b('0x24')](handleEntityNotFound(_0x112bf5,null))[_0x5e5b('0x24')](function(_0x1dc878){var _0x34d3da;if(_0x1dc878){_0x34d3da=squel[_0x5e5b('0x5e')]()['into'](_0x5e5b('0x60'))[_0x5e5b('0x61')](['phone',_0x5e5b('0x63'),'ContactId',_0x5e5b('0x64'),_0x5e5b('0x74'),_0x5e5b('0x66'),_0x5e5b('0x75')],squel[_0x5e5b('0x67')]()['field'](_0x5e5b('0x68'),_0x5e5b('0x62'))[_0x5e5b('0x3e')](_0x5e5b('0x69'),_0x5e5b('0x63'))[_0x5e5b('0x3e')]('ANY_VALUE(ContactId)',_0x5e5b('0x71'))['field'](_0x5e5b('0x76'),_0x5e5b('0x64'))['field']('ANY_VALUE(CampaignId)',_0x5e5b('0x74'))[_0x5e5b('0x3e')](_0x5e5b('0x69'),_0x5e5b('0x66'))[_0x5e5b('0x3e')](_0x5e5b('0x69'),_0x5e5b('0x75'))[_0x5e5b('0x6b')](_0x5e5b('0x70'))[_0x5e5b('0x37')]('CampaignId\x20=\x20?',_0x573cfa[_0x5e5b('0x44')]['id']['toString']())['where']('state\x20=\x20?',_0x573cfa['body'][_0x5e5b('0x77')][_0x5e5b('0x6e')]())[_0x5e5b('0x37')](_0x5e5b('0x78'))[_0x5e5b('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5e5b('0x67')]()[_0x5e5b('0x3e')]('phone')[_0x5e5b('0x6b')](_0x5e5b('0x60'))[_0x5e5b('0x37')](_0x5e5b('0x79'),_0x573cfa[_0x5e5b('0x44')]['id'][_0x5e5b('0x6e')]()))['where'](_0x5e5b('0x7a'),squel['select']()[_0x5e5b('0x3e')]('calleridnum')[_0x5e5b('0x6b')](_0x5e5b('0x70'))[_0x5e5b('0x37')](_0x5e5b('0x79'),_0x573cfa[_0x5e5b('0x44')]['id']['toString']())['where'](_0x5e5b('0x7b')))[_0x5e5b('0x7c')](_0x5e5b('0x71')))['toString']();return db['sequelize'][_0x5e5b('0x2c')](_0x34d3da);}return[];})['then'](respondWithResult(_0x112bf5,null))[_0x5e5b('0x43')](handleError(_0x112bf5,null));};exports[_0x5e5b('0x7d')]=function(_0x3aa393,_0x501c4c,_0x51e1b5){return db[_0x5e5b('0x7e')][_0x5e5b('0x7f')]({'where':{'VoiceQueueId':_0x3aa393[_0x5e5b('0x47')]['VoiceQueueId'],'CampaignId':_0x3aa393[_0x5e5b('0x47')]['CampaignId'],'ContactId':_0x3aa393[_0x5e5b('0x47')]['ContactId']}})[_0x5e5b('0x24')](handleEntityNotFound(_0x501c4c,null))[_0x5e5b('0x24')](function(_0x429290){if(_0x429290){return _0x429290;}return null;})['then'](respondWithResult(_0x501c4c,null))[_0x5e5b('0x43')](handleError(_0x501c4c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 2a90456..897b7d6 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 _0x5fab=['CmHopperFinal','calleridnum','uniqueid','lodash','util','api','moment','bluebird','request-promise','./cmHopperFinal.attributes','exports','define'];(function(_0x289fd4,_0xd34ba6){var _0x3d4a88=function(_0x2a3726){while(--_0x2a3726){_0x289fd4['push'](_0x289fd4['shift']());}};_0x3d4a88(++_0xd34ba6);}(_0x5fab,0x177));var _0xb5fa=function(_0xba0502,_0x2fb75b){_0xba0502=_0xba0502-0x0;var _0x5ed16d=_0x5fab[_0xba0502];return _0x5ed16d;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var attributes=require(_0xb5fa('0x6'));module[_0xb5fa('0x7')]=function(_0x29390a,_0x4341d3){return _0x29390a[_0xb5fa('0x8')](_0xb5fa('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xb5fa('0xa')]},{'name':_0xb5fa('0xb'),'fields':[_0xb5fa('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','./cmHopperFinal.attributes','exports','define','cm_hopper_final'];(function(_0x2c9e76,_0x3cc6ba){var _0x2850f3=function(_0x1ac7fc){while(--_0x1ac7fc){_0x2c9e76['push'](_0x2c9e76['shift']());}};_0x2850f3(++_0x3cc6ba);}(_0x4975,0x86));var _0x5497=function(_0x521a48,_0x331b24){_0x521a48=_0x521a48-0x0;var _0x5883e6=_0x4975[_0x521a48];return _0x5883e6;};'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')]('CmHopperFinal',attributes,{'tableName':_0x5497('0x9'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x5497('0xa')]},{'name':_0x5497('0xb'),'fields':[_0x5497('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 55dab33..1c9dab9 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 _0x2547=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateCmHopperFinal','CmHopperFinal','create','body','options','raw','then','util','moment','bluebird'];(function(_0x3d33c1,_0x3dbc9a){var _0x10f92b=function(_0x18ebb4){while(--_0x18ebb4){_0x3d33c1['push'](_0x3d33c1['shift']());}};_0x10f92b(++_0x3dbc9a);}(_0x2547,0x1cd));var _0x7254=function(_0x172397,_0x5c1e00){_0x172397=_0x172397-0x0;var _0x10af94=_0x2547[_0x172397];return _0x10af94;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var moment=require(_0x7254('0x1'));var BPromise=require(_0x7254('0x2'));var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require(_0x7254('0x4'));var db=require(_0x7254('0x5'))['db'];var utils=require(_0x7254('0x6'));var logger=require(_0x7254('0x7'))('rpc');var config=require(_0x7254('0x8'));var jayson=require(_0x7254('0x9'));var client=jayson[_0x7254('0xa')][_0x7254('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b845f,_0x253b1e,_0x6e3d84){return new BPromise(function(_0x395913,_0x5da1ec){return client[_0x7254('0xc')](_0x4b845f,_0x6e3d84)['then'](function(_0x50925f){logger['info'](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));logger[_0x7254('0xf')](_0x7254('0x10'),_0x253b1e,_0x7254('0xe'),JSON[_0x7254('0x11')](_0x50925f));if(_0x50925f['error']){if(_0x50925f[_0x7254('0x12')]['code']===0x1f4){logger[_0x7254('0x12')]('CmHopperFinal,\x20%s,\x20%s',_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x5da1ec(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x395913(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}else{logger[_0x7254('0x14')](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));_0x395913(_0x50925f['result'][_0x7254('0x13')]);}})[_0x7254('0x15')](function(_0xf47255){logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0xf47255);_0x5da1ec(_0xf47255);});});}exports[_0x7254('0x16')]=function(_0x2737e0){var _0x5dd23b=this;return new Promise(function(_0x1f48f6,_0x2283b7){return db[_0x7254('0x17')][_0x7254('0x18')](_0x2737e0[_0x7254('0x19')],{'raw':_0x2737e0[_0x7254('0x1a')]?_0x2737e0[_0x7254('0x1a')][_0x7254('0x1b')]===undefined?!![]:![]:!![]})[_0x7254('0x1c')](function(_0x3b6cb6){logger[_0x7254('0x14')](_0x7254('0x16'),_0x2737e0);logger[_0x7254('0xf')](_0x7254('0x16'),_0x2737e0,JSON[_0x7254('0x11')](_0x3b6cb6));_0x1f48f6(_0x3b6cb6);})[_0x7254('0x15')](function(_0x2bb2fe){logger[_0x7254('0x12')](_0x7254('0x16'),_0x2bb2fe[_0x7254('0x13')],_0x2737e0);_0x2283b7(_0x5dd23b[_0x7254('0x12')](0x1f4,_0x2bb2fe['message']));});});}; \ No newline at end of file +var _0xcb91=['code','message','catch','CreateCmHopperFinal','CmHopperFinal','create','body','options','raw','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x158630,_0x2d9759){var _0x20f146=function(_0x4e545){while(--_0x4e545){_0x158630['push'](_0x158630['shift']());}};_0x20f146(++_0x2d9759);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5302fb,_0x1a2db3){_0x5302fb=_0x5302fb-0x0;var _0x43e6a4=_0xcb91[_0x5302fb];return _0x43e6a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')](_0x23d3a9[_0x1cb9('0x17')],{'raw':_0x23d3a9[_0x1cb9('0x18')]?_0x23d3a9[_0x1cb9('0x18')][_0x1cb9('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x559bcc){logger[_0x1cb9('0xa')]('CreateCmHopperFinal',_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON['stringify'](_0x559bcc));_0x479d43(_0x559bcc);})['catch'](function(_0x2e3854){logger[_0x1cb9('0x10')](_0x1cb9('0x14'),_0x2e3854[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340[_0x1cb9('0x10')](0x1f4,_0x2e3854[_0x1cb9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index f7777ed..e730a26 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 _0x3e74=['isAuthenticated','index','describe','/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','update','exports','multer','path','connect-timeout','express','../../components/interaction/service','./cmHopperFinal.controller','get'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0x3e74,0x175));var _0x43e7=function(_0x4dea9f,_0x411b2d){_0x4dea9f=_0x4dea9f-0x0;var _0x1240af=_0x3e74[_0x4dea9f];return _0x1240af;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0x6')]('/campaign/countAttributes/:id',auth[_0x43e7('0x7')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x43e7('0xc')](_0x43e7('0xd'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xc')](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0x43e7('0x10'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);router['put']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x12')]);module[_0x43e7('0x13')]=router; \ No newline at end of file +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(_0x14e0ce,_0x503f7a){var _0xa5a36e=function(_0x20fc1f){while(--_0x20fc1f){_0x14e0ce['push'](_0x14e0ce['shift']());}};_0xa5a36e(++_0x503f7a);}(_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 diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index d97ee03..691f661 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 _0x032e=['DATE','BOOLEAN','sequelize','INTEGER','STRING'];(function(_0x152d81,_0x635d04){var _0x3a9166=function(_0x54cd78){while(--_0x54cd78){_0x152d81['push'](_0x152d81['shift']());}};_0x3a9166(++_0x635d04);}(_0x032e,0x124));var _0xe032=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x032e[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require(_0xe032('0x0'));module['exports']={'state':{'type':Sequelize[_0xe032('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xe032('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe032('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe032('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe032('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe032('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xe032('0x2')]},'originatecalleridname':{'type':Sequelize[_0xe032('0x2')]},'calleridnum':{'type':Sequelize[_0xe032('0x2')]},'calleridname':{'type':Sequelize[_0xe032('0x2')]},'starttime':{'type':Sequelize[_0xe032('0x3')]},'responsetime':{'type':Sequelize[_0xe032('0x3')]},'answertime':{'type':Sequelize[_0xe032('0x3')]},'droptime':{'type':Sequelize[_0xe032('0x3')]},'endtime':{'type':Sequelize[_0xe032('0x3')]},'ringtime':{'type':Sequelize[_0xe032('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe032('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe032('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe032('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe032('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe032('0x2')]},'membername':{'type':Sequelize[_0xe032('0x2')]},'reason':{'type':Sequelize[_0xe032('0x2')]},'amd':{'type':Sequelize[_0xe032('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe032('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xe032('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe032('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xe032('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xe032('0x3')]},'edited':{'type':Sequelize[_0xe032('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xe009=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x33a17b,_0x4e04ff){var _0x57e182=function(_0x5a62b7){while(--_0x5a62b7){_0x33a17b['push'](_0x33a17b['shift']());}};_0x57e182(++_0x4e04ff);}(_0xe009,0x122));var _0x9e00=function(_0x371c11,_0x450fa0){_0x371c11=_0x371c11-0x0;var _0x2d5e66=_0xe009[_0x371c11];return _0x2d5e66;};'use strict';var Sequelize=require(_0x9e00('0x0'));module[_0x9e00('0x1')]={'state':{'type':Sequelize[_0x9e00('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9e00('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x9e00('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9e00('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9e00('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9e00('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x9e00('0x3')]},'originatecalleridname':{'type':Sequelize[_0x9e00('0x3')]},'calleridnum':{'type':Sequelize[_0x9e00('0x3')]},'calleridname':{'type':Sequelize[_0x9e00('0x3')]},'starttime':{'type':Sequelize[_0x9e00('0x4')]},'responsetime':{'type':Sequelize[_0x9e00('0x4')]},'answertime':{'type':Sequelize[_0x9e00('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x9e00('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9e00('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9e00('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9e00('0x3')]},'campaign':{'type':Sequelize[_0x9e00('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9e00('0x3')]},'reason':{'type':Sequelize[_0x9e00('0x3')]},'amd':{'type':Sequelize[_0x9e00('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x9e00('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x9e00('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x9e00('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index c467d12..937422a 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 _0xc69e=['body','catch','describe','uniqueid','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','status','sendStatus','error','stack','name','send','index','CmHopperHistory','rawAttributes','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','show','params','length','find','create'];(function(_0x522025,_0x427ad5){var _0x2d5315=function(_0x68cd37){while(--_0x68cd37){_0x522025['push'](_0x522025['shift']());}};_0x2d5315(++_0x427ad5);}(_0xc69e,0xfa));var _0xec69=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc69e[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require(_0xec69('0x0'));var emlformat=require(_0xec69('0x1'));var rimraf=require(_0xec69('0x2'));var zipdir=require(_0xec69('0x3'));var jsonpatch=require(_0xec69('0x4'));var rp=require(_0xec69('0x5'));var moment=require(_0xec69('0x6'));var BPromise=require(_0xec69('0x7'));var Mustache=require(_0xec69('0x8'));var util=require(_0xec69('0x9'));var path=require(_0xec69('0xa'));var sox=require(_0xec69('0xb'));var csv=require('to-csv');var ejs=require(_0xec69('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xec69('0xd'));var crypto=require(_0xec69('0xe'));var jsforce=require(_0xec69('0xf'));var deskjs=require(_0xec69('0x10'));var toCsv=require(_0xec69('0x11'));var querystring=require(_0xec69('0x12'));var Papa=require(_0xec69('0x13'));var authService=require('../../components/auth/service');var hardwareService=require(_0xec69('0x14'));var Redis=require(_0xec69('0x15'));var qs=require(_0xec69('0x16'));var logger=require(_0xec69('0x17'))(_0xec69('0x18'));var utils=require(_0xec69('0x19'));var config=require(_0xec69('0x1a'));var db=require(_0xec69('0x1b'))['db'];function respondWithStatusCode(_0x14e0ff,_0x2403e9){_0x2403e9=_0x2403e9||0xcc;return function(_0x23e2c6){if(_0x23e2c6){return _0x14e0ff['sendStatus'](_0x2403e9);}return _0x14e0ff['status'](_0x2403e9)[_0xec69('0x1c')]();};}function respondWithResult(_0x27a797,_0x25d1b8){_0x25d1b8=_0x25d1b8||0xc8;return function(_0x58dee1){if(_0x58dee1){return _0x27a797['status'](_0x25d1b8)['json'](_0x58dee1);}};}function respondWithFilteredResult(_0x302017,_0x2dddb4){return function(_0x421082){if(_0x421082){var _0x12e6f3=_0x421082[_0xec69('0x1d')],_0x46ad84=_0x2dddb4[_0xec69('0x1e')],_0x303301=_0x2dddb4[_0xec69('0x1e')]+_0x2dddb4['limit'],_0x534dda;if(_0x303301>=_0x12e6f3){_0x303301=_0x12e6f3;_0x534dda=0xc8;}else{_0x534dda=0xce;}_0x302017['status'](_0x534dda);return _0x302017[_0xec69('0x1f')](_0xec69('0x20'),_0x46ad84+'-'+_0x303301+'/'+_0x12e6f3)[_0xec69('0x21')](_0x421082);}return null;};}function patchUpdates(_0x1c6510){return function(_0x515354){try{jsonpatch[_0xec69('0x22')](_0x515354,_0x1c6510,!![]);}catch(_0x35f5f9){return BPromise[_0xec69('0x23')](_0x35f5f9);}return _0x515354[_0xec69('0x24')]();};}function saveUpdates(_0x3c519a,_0x451166){return function(_0x2c582a){if(_0x2c582a){return _0x2c582a[_0xec69('0x25')](_0x3c519a)[_0xec69('0x26')](function(_0x4b2b05){return _0x4b2b05;});}return null;};}function removeEntity(_0x5e8b77,_0x292828){return function(_0x281bf4){if(_0x281bf4){return _0x281bf4[_0xec69('0x27')]()[_0xec69('0x26')](function(){_0x5e8b77[_0xec69('0x28')](0xcc)[_0xec69('0x1c')]();});}};}function handleEntityNotFound(_0x268d5a,_0x2e11c6){return function(_0xcbee33){if(!_0xcbee33){_0x268d5a[_0xec69('0x29')](0x194);}return _0xcbee33;};}function handleError(_0x19cc7d,_0x12b4e2){_0x12b4e2=_0x12b4e2||0x1f4;return function(_0x4b25ec){logger[_0xec69('0x2a')](_0x4b25ec[_0xec69('0x2b')]);if(_0x4b25ec[_0xec69('0x2c')]){delete _0x4b25ec[_0xec69('0x2c')];}_0x19cc7d[_0xec69('0x28')](_0x12b4e2)[_0xec69('0x2d')](_0x4b25ec);};}exports[_0xec69('0x2e')]=function(_0x4c3790,_0x4492){var _0x40b432={},_0x3c96b4={},_0x42df35={'count':0x0,'rows':[]};var _0x29a6af=db[_0xec69('0x2f')][_0xec69('0x30')];_0x3c96b4['model']=_[_0xec69('0x31')](_0x29a6af);_0x3c96b4['query']=_[_0xec69('0x31')](_0x4c3790[_0xec69('0x32')]);_0x3c96b4[_0xec69('0x33')]=_[_0xec69('0x34')](_0x3c96b4['model'],_0x3c96b4[_0xec69('0x32')]);_0x40b432[_0xec69('0x35')]=_[_0xec69('0x34')](_0x3c96b4[_0xec69('0x36')],qs[_0xec69('0x37')](_0x4c3790[_0xec69('0x32')][_0xec69('0x37')]));_0x40b432[_0xec69('0x35')]=_0x40b432[_0xec69('0x35')]['length']?_0x40b432[_0xec69('0x35')]:_0x3c96b4[_0xec69('0x36')];if(!_0x4c3790[_0xec69('0x32')][_0xec69('0x38')](_0xec69('0x39'))){_0x40b432[_0xec69('0x3a')]=qs['limit'](_0x4c3790[_0xec69('0x32')]['limit']);_0x40b432['offset']=qs[_0xec69('0x1e')](_0x4c3790['query'][_0xec69('0x1e')]);}_0x40b432[_0xec69('0x3b')]=qs['sort'](_0x4c3790[_0xec69('0x32')][_0xec69('0x3c')]);_0x40b432['where']=qs[_0xec69('0x33')](_[_0xec69('0x3d')](_0x4c3790['query'],_0x3c96b4[_0xec69('0x33')]));if(_0x4c3790[_0xec69('0x32')]['filter']){_0x40b432[_0xec69('0x3e')]=_[_0xec69('0x3f')](_0x40b432[_0xec69('0x3e')],{'$or':_[_0xec69('0x40')](_0x29a6af,function(_0x143b7a){if(_0x143b7a[_0xec69('0x41')][_0xec69('0x42')]!==_0xec69('0x43')){var _0x5a9cf3={};_0x5a9cf3[_0x143b7a[_0xec69('0x44')]]={'$like':'%'+_0x4c3790[_0xec69('0x32')]['filter']+'%'};return _0x5a9cf3;}})});}_0x40b432=_[_0xec69('0x3f')]({},_0x40b432,_0x4c3790[_0xec69('0x45')]);var _0x51969d={'where':_0x40b432[_0xec69('0x3e')]};return db[_0xec69('0x2f')][_0xec69('0x1d')](_0x51969d)[_0xec69('0x26')](function(_0x46a418){_0x42df35['count']=_0x46a418;if(_0x4c3790[_0xec69('0x32')][_0xec69('0x46')]){_0x40b432[_0xec69('0x47')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x40b432);})[_0xec69('0x26')](function(_0x39e0d8){_0x42df35[_0xec69('0x48')]=_0x39e0d8;return _0x42df35;})[_0xec69('0x26')](respondWithFilteredResult(_0x4492,_0x40b432))['catch'](handleError(_0x4492,null));};exports[_0xec69('0x49')]=function(_0x282875,_0x40d48e){var _0x23d916={'raw':!![],'where':{'id':_0x282875[_0xec69('0x4a')]['id']}},_0x417ed2={};_0x417ed2['model']=_['keys'](db[_0xec69('0x2f')][_0xec69('0x30')]);_0x417ed2['query']=_[_0xec69('0x31')](_0x282875[_0xec69('0x32')]);_0x417ed2[_0xec69('0x33')]=_[_0xec69('0x34')](_0x417ed2[_0xec69('0x36')],_0x417ed2[_0xec69('0x32')]);_0x23d916[_0xec69('0x35')]=_[_0xec69('0x34')](_0x417ed2[_0xec69('0x36')],qs[_0xec69('0x37')](_0x282875[_0xec69('0x32')][_0xec69('0x37')]));_0x23d916[_0xec69('0x35')]=_0x23d916[_0xec69('0x35')][_0xec69('0x4b')]?_0x23d916[_0xec69('0x35')]:_0x417ed2[_0xec69('0x36')];if(_0x282875[_0xec69('0x32')]['includeAll']){_0x23d916[_0xec69('0x47')]=[{'all':!![]}];}_0x23d916=_[_0xec69('0x3f')]({},_0x23d916,_0x282875[_0xec69('0x45')]);return db['CmHopperHistory'][_0xec69('0x4c')](_0x23d916)['then'](handleEntityNotFound(_0x40d48e,null))[_0xec69('0x26')](respondWithResult(_0x40d48e,null))['catch'](handleError(_0x40d48e,null));};exports[_0xec69('0x4d')]=function(_0x42460a,_0x1d72c3){return db['CmHopperHistory'][_0xec69('0x4d')](_0x42460a[_0xec69('0x4e')],{})['then'](respondWithResult(_0x1d72c3,0xc9))[_0xec69('0x4f')](handleError(_0x1d72c3,null));};exports['describe']=function(_0x5883cd,_0x27885d){return db[_0xec69('0x2f')][_0xec69('0x50')]()['then'](respondWithResult(_0x27885d,null))['catch'](handleError(_0x27885d,null));};exports['update']=function(_0x7edb11,_0x1047fa){if(_0x7edb11[_0xec69('0x4e')]['uniqueid']){delete _0x7edb11[_0xec69('0x4e')][_0xec69('0x51')];}return db[_0xec69('0x2f')][_0xec69('0x4c')]({'where':{'uniqueid':_0x7edb11[_0xec69('0x4a')]['id']}})[_0xec69('0x26')](handleEntityNotFound(_0x1047fa,null))['then'](saveUpdates(_0x7edb11[_0xec69('0x4e')],null))['then'](respondWithResult(_0x1047fa,null))['catch'](handleError(_0x1047fa,null));}; \ No newline at end of file +var _0x8c32=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','CmHopperHistory','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','params','rawAttributes','create','body','describe','uniqueid','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel'];(function(_0x371bf6,_0x28d7ce){var _0x16209e=function(_0x3890c5){while(--_0x3890c5){_0x371bf6['push'](_0x371bf6['shift']());}};_0x16209e(++_0x28d7ce);}(_0x8c32,0x89));var _0x28c3=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x8c32[_0x25e7cb];return _0x375d92;};'use strict';var pdf=require(_0x28c3('0x0'));var emlformat=require(_0x28c3('0x1'));var rimraf=require(_0x28c3('0x2'));var zipdir=require(_0x28c3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28c3('0x4'));var moment=require(_0x28c3('0x5'));var BPromise=require(_0x28c3('0x6'));var Mustache=require('mustache');var util=require(_0x28c3('0x7'));var path=require(_0x28c3('0x8'));var sox=require('sox');var csv=require(_0x28c3('0x9'));var ejs=require(_0x28c3('0xa'));var fs=require('fs');var _=require(_0x28c3('0xb'));var squel=require(_0x28c3('0xc'));var crypto=require(_0x28c3('0xd'));var jsforce=require(_0x28c3('0xe'));var deskjs=require(_0x28c3('0xf'));var toCsv=require(_0x28c3('0x9'));var querystring=require(_0x28c3('0x10'));var Papa=require(_0x28c3('0x11'));var authService=require(_0x28c3('0x12'));var hardwareService=require(_0x28c3('0x13'));var Redis=require(_0x28c3('0x14'));var qs=require(_0x28c3('0x15'));var logger=require(_0x28c3('0x16'))(_0x28c3('0x17'));var utils=require('../../config/utils');var config=require(_0x28c3('0x18'));var db=require(_0x28c3('0x19'))['db'];function respondWithStatusCode(_0x58b3af,_0x4ae211){_0x4ae211=_0x4ae211||0xcc;return function(_0x1698c2){if(_0x1698c2){return _0x58b3af[_0x28c3('0x1a')](_0x4ae211);}return _0x58b3af[_0x28c3('0x1b')](_0x4ae211)['end']();};}function respondWithResult(_0x6afc54,_0x7ed0a4){_0x7ed0a4=_0x7ed0a4||0xc8;return function(_0x524b6a){if(_0x524b6a){return _0x6afc54[_0x28c3('0x1b')](_0x7ed0a4)[_0x28c3('0x1c')](_0x524b6a);}};}function respondWithFilteredResult(_0x2d48fe,_0x132b6b){return function(_0x1030f9){if(_0x1030f9){var _0x8904d3=_0x1030f9[_0x28c3('0x1d')],_0x5eb4c8=_0x132b6b[_0x28c3('0x1e')],_0x5a95c9=_0x132b6b['offset']+_0x132b6b[_0x28c3('0x1f')],_0x2fded2;if(_0x5a95c9>=_0x8904d3){_0x5a95c9=_0x8904d3;_0x2fded2=0xc8;}else{_0x2fded2=0xce;}_0x2d48fe[_0x28c3('0x1b')](_0x2fded2);return _0x2d48fe[_0x28c3('0x20')](_0x28c3('0x21'),_0x5eb4c8+'-'+_0x5a95c9+'/'+_0x8904d3)['json'](_0x1030f9);}return null;};}function patchUpdates(_0x4af8d5){return function(_0x383148){try{jsonpatch[_0x28c3('0x22')](_0x383148,_0x4af8d5,!![]);}catch(_0x255625){return BPromise[_0x28c3('0x23')](_0x255625);}return _0x383148[_0x28c3('0x24')]();};}function saveUpdates(_0xbf116a,_0x37cefe){return function(_0x2dc26a){if(_0x2dc26a){return _0x2dc26a[_0x28c3('0x25')](_0xbf116a)['then'](function(_0x8c9f29){return _0x8c9f29;});}return null;};}function removeEntity(_0x179243,_0x2a198d){return function(_0x2559fe){if(_0x2559fe){return _0x2559fe[_0x28c3('0x26')]()[_0x28c3('0x27')](function(){_0x179243[_0x28c3('0x1b')](0xcc)[_0x28c3('0x28')]();});}};}function handleEntityNotFound(_0x1008cf,_0x313778){return function(_0x1176d1){if(!_0x1176d1){_0x1008cf[_0x28c3('0x1a')](0x194);}return _0x1176d1;};}function handleError(_0x4315a4,_0x54c26c){_0x54c26c=_0x54c26c||0x1f4;return function(_0x1088a4){logger[_0x28c3('0x29')](_0x1088a4[_0x28c3('0x2a')]);if(_0x1088a4['name']){delete _0x1088a4[_0x28c3('0x2b')];}_0x4315a4[_0x28c3('0x1b')](_0x54c26c)[_0x28c3('0x2c')](_0x1088a4);};}exports[_0x28c3('0x2d')]=function(_0x357ed5,_0x17cccb){var _0x417378={},_0x324e88={},_0x188285={'count':0x0,'rows':[]};var _0x34b02b=db[_0x28c3('0x2e')]['rawAttributes'];_0x324e88['model']=_[_0x28c3('0x2f')](_0x34b02b);_0x324e88[_0x28c3('0x30')]=_[_0x28c3('0x2f')](_0x357ed5[_0x28c3('0x30')]);_0x324e88[_0x28c3('0x31')]=_[_0x28c3('0x32')](_0x324e88['model'],_0x324e88[_0x28c3('0x30')]);_0x417378[_0x28c3('0x33')]=_['intersection'](_0x324e88[_0x28c3('0x34')],qs[_0x28c3('0x35')](_0x357ed5[_0x28c3('0x30')]['fields']));_0x417378[_0x28c3('0x33')]=_0x417378['attributes'][_0x28c3('0x36')]?_0x417378[_0x28c3('0x33')]:_0x324e88[_0x28c3('0x34')];if(!_0x357ed5[_0x28c3('0x30')][_0x28c3('0x37')](_0x28c3('0x38'))){_0x417378[_0x28c3('0x1f')]=qs['limit'](_0x357ed5['query'][_0x28c3('0x1f')]);_0x417378['offset']=qs[_0x28c3('0x1e')](_0x357ed5[_0x28c3('0x30')]['offset']);}_0x417378[_0x28c3('0x39')]=qs[_0x28c3('0x3a')](_0x357ed5[_0x28c3('0x30')][_0x28c3('0x3a')]);_0x417378[_0x28c3('0x3b')]=qs[_0x28c3('0x31')](_['pick'](_0x357ed5[_0x28c3('0x30')],_0x324e88['filters']));if(_0x357ed5[_0x28c3('0x30')][_0x28c3('0x3c')]){_0x417378[_0x28c3('0x3b')]=_[_0x28c3('0x3d')](_0x417378[_0x28c3('0x3b')],{'$or':_['map'](_0x34b02b,function(_0xbcf38d){if(_0xbcf38d[_0x28c3('0x3e')][_0x28c3('0x3f')]!==_0x28c3('0x40')){var _0x1ebca3={};_0x1ebca3[_0xbcf38d['field']]={'$like':'%'+_0x357ed5[_0x28c3('0x30')][_0x28c3('0x3c')]+'%'};return _0x1ebca3;}})});}_0x417378=_[_0x28c3('0x3d')]({},_0x417378,_0x357ed5[_0x28c3('0x41')]);var _0x439c78={'where':_0x417378[_0x28c3('0x3b')]};return db[_0x28c3('0x2e')][_0x28c3('0x1d')](_0x439c78)[_0x28c3('0x27')](function(_0x44a6ff){_0x188285[_0x28c3('0x1d')]=_0x44a6ff;if(_0x357ed5[_0x28c3('0x30')][_0x28c3('0x42')]){_0x417378[_0x28c3('0x43')]=[{'all':!![]}];}return db[_0x28c3('0x2e')]['findAll'](_0x417378);})['then'](function(_0x5c497e){_0x188285['rows']=_0x5c497e;return _0x188285;})[_0x28c3('0x27')](respondWithFilteredResult(_0x17cccb,_0x417378))[_0x28c3('0x44')](handleError(_0x17cccb,null));};exports['show']=function(_0x2463a9,_0x326bfe){var _0x38592d={'raw':!![],'where':{'id':_0x2463a9[_0x28c3('0x45')]['id']}},_0x3f3c8d={};_0x3f3c8d[_0x28c3('0x34')]=_[_0x28c3('0x2f')](db[_0x28c3('0x2e')][_0x28c3('0x46')]);_0x3f3c8d['query']=_[_0x28c3('0x2f')](_0x2463a9['query']);_0x3f3c8d['filters']=_['intersection'](_0x3f3c8d[_0x28c3('0x34')],_0x3f3c8d['query']);_0x38592d[_0x28c3('0x33')]=_['intersection'](_0x3f3c8d[_0x28c3('0x34')],qs[_0x28c3('0x35')](_0x2463a9[_0x28c3('0x30')][_0x28c3('0x35')]));_0x38592d[_0x28c3('0x33')]=_0x38592d[_0x28c3('0x33')][_0x28c3('0x36')]?_0x38592d[_0x28c3('0x33')]:_0x3f3c8d[_0x28c3('0x34')];if(_0x2463a9['query'][_0x28c3('0x42')]){_0x38592d[_0x28c3('0x43')]=[{'all':!![]}];}_0x38592d=_[_0x28c3('0x3d')]({},_0x38592d,_0x2463a9[_0x28c3('0x41')]);return db['CmHopperHistory']['find'](_0x38592d)['then'](handleEntityNotFound(_0x326bfe,null))['then'](respondWithResult(_0x326bfe,null))[_0x28c3('0x44')](handleError(_0x326bfe,null));};exports[_0x28c3('0x47')]=function(_0xc67352,_0x2c668a){return db[_0x28c3('0x2e')][_0x28c3('0x47')](_0xc67352[_0x28c3('0x48')],{})[_0x28c3('0x27')](respondWithResult(_0x2c668a,0xc9))[_0x28c3('0x44')](handleError(_0x2c668a,null));};exports['describe']=function(_0x3fd231,_0x5d42e4){return db[_0x28c3('0x2e')][_0x28c3('0x49')]()[_0x28c3('0x27')](respondWithResult(_0x5d42e4,null))[_0x28c3('0x44')](handleError(_0x5d42e4,null));};exports[_0x28c3('0x25')]=function(_0x3cf7c9,_0x4a443c){if(_0x3cf7c9[_0x28c3('0x48')]['uniqueid']){delete _0x3cf7c9[_0x28c3('0x48')][_0x28c3('0x4a')];}return db[_0x28c3('0x2e')]['find']({'where':{'uniqueid':_0x3cf7c9[_0x28c3('0x45')]['id']}})[_0x28c3('0x27')](handleEntityNotFound(_0x4a443c,null))[_0x28c3('0x27')](saveUpdates(_0x3cf7c9[_0x28c3('0x48')],null))['then'](respondWithResult(_0x4a443c,null))[_0x28c3('0x44')](handleError(_0x4a443c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 2def054..d7f6a79 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 _0x054f=['bluebird','request-promise','./cmHopperHistory.attributes','define','cm_hopper_history','endtime','uniqueid','util','../../config/logger','moment'];(function(_0x503817,_0x1086d7){var _0x2f79cf=function(_0x18e5ae){while(--_0x18e5ae){_0x503817['push'](_0x503817['shift']());}};_0x2f79cf(++_0x1086d7);}(_0x054f,0x93));var _0xf054=function(_0x1197af,_0x533c33){_0x1197af=_0x1197af-0x0;var _0x5d8f7e=_0x054f[_0x1197af];return _0x5d8f7e;};'use strict';var _=require('lodash');var util=require(_0xf054('0x0'));var logger=require(_0xf054('0x1'))('api');var moment=require(_0xf054('0x2'));var BPromise=require(_0xf054('0x3'));var rp=require(_0xf054('0x4'));var attributes=require(_0xf054('0x5'));module['exports']=function(_0x43495b,_0x426872){return _0x43495b[_0xf054('0x6')]('CmHopperHistory',attributes,{'tableName':_0xf054('0x7'),'paranoid':![],'indexes':[{'name':_0xf054('0x8'),'fields':[_0xf054('0x8')]},{'name':_0xf054('0x9'),'fields':[_0xf054('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbbf0=['endtime','uniqueid','lodash','api','request-promise','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xbbf0,0x84));var _0x0bbf=function(_0x28fc28,_0x5ebe89){_0x28fc28=_0x28fc28-0x0;var _0x2fdd2b=_0xbbf0[_0x28fc28];return _0x2fdd2b;};'use strict';var _=require(_0x0bbf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0bbf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0bbf('0x2'));var attributes=require(_0x0bbf('0x3'));module[_0x0bbf('0x4')]=function(_0x1bc3d6,_0x238cf3){return _0x1bc3d6[_0x0bbf('0x5')](_0x0bbf('0x6'),attributes,{'tableName':_0x0bbf('0x7'),'paranoid':![],'indexes':[{'name':_0x0bbf('0x8'),'fields':[_0x0bbf('0x8')]},{'name':'uniqueid','fields':[_0x0bbf('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 58db3f3..93d4117 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 _0x60e1=['stringify','error','code','message','result','catch','CmHopperHistory','create','body','options','CreateCmHopperHistory','AvgHandleTime','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','debug','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundReCallsDay','findAll','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x60e1,0x14c));var _0x160e=function(_0x41af28,_0x3b4e05){_0x41af28=_0x41af28-0x0;var _0x2e22f9=_0x60e1[_0x41af28];return _0x2e22f9;};'use strict';var _=require(_0x160e('0x0'));var util=require('util');var moment=require(_0x160e('0x1'));var BPromise=require(_0x160e('0x2'));var rs=require(_0x160e('0x3'));var fs=require('fs');var Redis=require(_0x160e('0x4'));var db=require(_0x160e('0x5'))['db'];var utils=require(_0x160e('0x6'));var logger=require(_0x160e('0x7'))(_0x160e('0x8'));var config=require(_0x160e('0x9'));var jayson=require(_0x160e('0xa'));var client=jayson['client'][_0x160e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4da502,_0x3b58ca,_0x195a22){return new BPromise(function(_0xbc9baa,_0x5cc74f){return client[_0x160e('0xc')](_0x4da502,_0x195a22)[_0x160e('0xd')](function(_0x2b90da){logger[_0x160e('0xe')](_0x160e('0xf'),_0x3b58ca,_0x160e('0x10'));logger['debug'](_0x160e('0x11'),_0x3b58ca,_0x160e('0x10'),JSON[_0x160e('0x12')](_0x2b90da));if(_0x2b90da[_0x160e('0x13')]){if(_0x2b90da[_0x160e('0x13')][_0x160e('0x14')]===0x1f4){logger[_0x160e('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x3b58ca,_0x2b90da[_0x160e('0x13')][_0x160e('0x15')]);return _0x5cc74f(_0x2b90da[_0x160e('0x13')][_0x160e('0x15')]);}logger['error'](_0x160e('0xf'),_0x3b58ca,_0x2b90da[_0x160e('0x13')][_0x160e('0x15')]);return _0xbc9baa(_0x2b90da[_0x160e('0x13')]['message']);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x3b58ca,'request\x20sent');_0xbc9baa(_0x2b90da[_0x160e('0x16')][_0x160e('0x15')]);}})[_0x160e('0x17')](function(_0x2a5ec5){logger[_0x160e('0x13')](_0x160e('0xf'),_0x3b58ca,_0x2a5ec5);_0x5cc74f(_0x2a5ec5);});});}exports['CreateCmHopperHistory']=function(_0x37d722){var _0x1edeff=this;return new Promise(function(_0x5c7bde,_0x38561b){return db[_0x160e('0x18')][_0x160e('0x19')](_0x37d722[_0x160e('0x1a')],{'raw':_0x37d722[_0x160e('0x1b')]?_0x37d722[_0x160e('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x160e('0xd')](function(_0x4ca9d4){logger[_0x160e('0xe')](_0x160e('0x1c'),_0x37d722);logger['debug'](_0x160e('0x1c'),_0x37d722,JSON['stringify'](_0x4ca9d4));_0x5c7bde(_0x4ca9d4);})[_0x160e('0x17')](function(_0x4d1047){logger[_0x160e('0x13')]('CreateCmHopperHistory',_0x4d1047[_0x160e('0x15')],_0x37d722);_0x38561b(_0x1edeff[_0x160e('0x13')](0x1f4,_0x4d1047['message']));});});};exports[_0x160e('0x1d')]=function(_0x48aed9){var _0x2aaa6f=this;return new Promise(function(_0x5180bc,_0x228754){return db['CmHopperHistory']['findAll']({'raw':_0x48aed9[_0x160e('0x1b')]?_0x48aed9[_0x160e('0x1b')][_0x160e('0x1e')]===undefined?!![]:![]:!![],'where':_0x48aed9[_0x160e('0x1b')]?_0x48aed9[_0x160e('0x1b')][_0x160e('0x1f')]||null:null,'attributes':[[db[_0x160e('0x20')]['fn'](_0x160e('0x21'),db[_0x160e('0x20')][_0x160e('0x22')]('id')),_0x160e('0x23')],[db[_0x160e('0x20')]['fn']('COUNT',db[_0x160e('0x20')]['fn']('IF',db['sequelize'][_0x160e('0x24')](_0x160e('0x25')))),_0x160e('0x26')],[db[_0x160e('0x20')]['fn'](_0x160e('0x21'),db[_0x160e('0x20')]['fn']('IF',db[_0x160e('0x20')][_0x160e('0x24')](_0x160e('0x27')))),_0x160e('0x28')],[db[_0x160e('0x20')]['fn'](_0x160e('0x21'),db[_0x160e('0x20')]['fn']('IF',db['sequelize'][_0x160e('0x24')](_0x160e('0x29')))),_0x160e('0x2a')],[db['sequelize']['fn'](_0x160e('0x2b'),db[_0x160e('0x20')]['fn']('IF',db[_0x160e('0x20')][_0x160e('0x24')](_0x160e('0x2c')))),_0x160e('0x2d')],[db['sequelize']['fn'](_0x160e('0x2b'),db[_0x160e('0x20')]['fn']('IF',db[_0x160e('0x20')][_0x160e('0x24')](_0x160e('0x2e')))),'predictiveIntervalAvgTalktime']]})[_0x160e('0xd')](function(_0x158efc){logger[_0x160e('0xe')](_0x160e('0x1d'),_0x48aed9);logger[_0x160e('0x2f')](_0x160e('0x1d'),_0x48aed9,JSON[_0x160e('0x12')](_0x158efc));_0x5180bc(_0x158efc);})[_0x160e('0x17')](function(_0x346d8c){logger[_0x160e('0x13')](_0x160e('0x1d'),_0x346d8c[_0x160e('0x15')],_0x48aed9);_0x228754(_0x2aaa6f['error'](0x1f4,_0x346d8c['message']));});});};exports[_0x160e('0x30')]=function(_0xa09cfc){var _0x44d521=this;return new Promise(function(_0x4ec1dd,_0x3b9728){return db[_0x160e('0x18')]['findAll']({'raw':_0xa09cfc[_0x160e('0x1b')]?_0xa09cfc[_0x160e('0x1b')][_0x160e('0x1e')]===undefined?!![]:![]:!![],'where':_0xa09cfc[_0x160e('0x1b')]?_0xa09cfc[_0x160e('0x1b')]['where']||null:null,'attributes':[[_0x160e('0x31'),_0x160e('0x32')],[db[_0x160e('0x20')]['fn'](_0x160e('0x21'),db[_0x160e('0x20')]['fn']('IF',db[_0x160e('0x20')][_0x160e('0x24')](_0x160e('0x33')))),_0x160e('0x34')],[db[_0x160e('0x20')]['fn']('COUNT',db[_0x160e('0x20')]['fn']('IF',db[_0x160e('0x20')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x160e('0x35')],[db[_0x160e('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x160e('0x24')](_0x160e('0x25')))),'outboundAnswerCallsDay'],[db[_0x160e('0x20')]['fn'](_0x160e('0x21'),db[_0x160e('0x20')]['fn']('IF',db['sequelize'][_0x160e('0x24')](_0x160e('0x36')))),_0x160e('0x37')],[db[_0x160e('0x20')]['fn'](_0x160e('0x21'),db[_0x160e('0x20')]['fn']('IF',db['sequelize'][_0x160e('0x24')](_0x160e('0x38')))),_0x160e('0x39')],[db[_0x160e('0x20')]['fn'](_0x160e('0x21'),db['sequelize']['fn']('IF',db[_0x160e('0x20')]['literal'](_0x160e('0x3a')))),'outboundDropCallsDayTimeout'],[db[_0x160e('0x20')]['fn']('COUNT',db[_0x160e('0x20')]['fn']('IF',db[_0x160e('0x20')][_0x160e('0x24')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x160e('0x20')]['fn'](_0x160e('0x21'),db[_0x160e('0x20')]['fn']('IF',db[_0x160e('0x20')][_0x160e('0x24')]('`state`\x20=\x2012,\x201,\x20null'))),_0x160e('0x3b')],[db['sequelize']['fn'](_0x160e('0x21'),db[_0x160e('0x20')]['fn']('IF',db[_0x160e('0x20')][_0x160e('0x24')](_0x160e('0x3c')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0x160e('0x21'),db[_0x160e('0x20')]['fn']('IF',db[_0x160e('0x20')][_0x160e('0x24')](_0x160e('0x3d')))),_0x160e('0x3e')],[db[_0x160e('0x20')]['fn'](_0x160e('0x21'),db[_0x160e('0x20')]['fn']('IF',db[_0x160e('0x20')][_0x160e('0x24')]('`state`\x20=\x2018,\x201,\x20null'))),_0x160e('0x3f')],[db[_0x160e('0x20')]['fn'](_0x160e('0x21'),db[_0x160e('0x20')]['fn']('IF',db['sequelize']['literal'](_0x160e('0x40')))),'outboundAnswerAgiCallsDay'],[db[_0x160e('0x20')]['fn']('COUNT',db[_0x160e('0x20')]['fn']('IF',db[_0x160e('0x20')][_0x160e('0x24')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x160e('0x20')]['fn']('IF',db[_0x160e('0x20')][_0x160e('0x24')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x160e('0x41')]],'group':[_0x160e('0x31')]})['then'](function(_0x397cae){logger['info'](_0x160e('0x30'),_0xa09cfc);logger[_0x160e('0x2f')](_0x160e('0x30'),_0xa09cfc,JSON[_0x160e('0x12')](_0x397cae));_0x4ec1dd(_0x397cae);})[_0x160e('0x17')](function(_0x244cc9){logger[_0x160e('0x13')](_0x160e('0x30'),_0x244cc9[_0x160e('0x15')],_0xa09cfc);_0x3b9728(_0x44d521[_0x160e('0x13')](0x1f4,_0x244cc9['message']));});});};exports['GetCampaignHopperHistory']=function(_0x5e09f9){var _0x37c1f2=this;return new Promise(function(_0xa44bfc,_0x4825fd){return db[_0x160e('0x18')][_0x160e('0x42')]({'raw':_0x5e09f9[_0x160e('0x1b')]?_0x5e09f9[_0x160e('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5e09f9[_0x160e('0x1b')]?_0x5e09f9[_0x160e('0x1b')][_0x160e('0x1f')]||null:null,'attributes':[[_0x160e('0x31'),_0x160e('0x32')],[db[_0x160e('0x20')]['fn']('COUNT',db[_0x160e('0x20')]['col']('id')),_0x160e('0x43')],[db[_0x160e('0x20')]['fn'](_0x160e('0x21'),db[_0x160e('0x20')]['fn']('IF',db[_0x160e('0x20')][_0x160e('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x160e('0x44')]],'group':[_0x160e('0x31')]})[_0x160e('0xd')](function(_0x3466ff){logger['info'](_0x160e('0x45'),_0x5e09f9);logger[_0x160e('0x2f')](_0x160e('0x45'),_0x5e09f9,JSON[_0x160e('0x12')](_0x3466ff));_0xa44bfc(_0x3466ff);})[_0x160e('0x17')](function(_0xb1c459){logger[_0x160e('0x13')](_0x160e('0x45'),_0xb1c459[_0x160e('0x15')],_0x5e09f9);_0x4825fd(_0x37c1f2[_0x160e('0x13')](0x1f4,_0xb1c459[_0x160e('0x15')]));});});}; \ No newline at end of file +var _0x13f6=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreateCmHopperHistory','CmHopperHistory','create','body','raw','catch','AvgHandleTime','findAll','options','sequelize','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','where','col','ivrTotalCallsDays','ivrAnswerCallsDay'];(function(_0x328c44,_0x35b8a3){var _0x2ab1da=function(_0x80eb6b){while(--_0x80eb6b){_0x328c44['push'](_0x328c44['shift']());}};_0x2ab1da(++_0x35b8a3);}(_0x13f6,0x124));var _0x613f=function(_0x1df2f9,_0x2f1041){_0x1df2f9=_0x1df2f9-0x0;var _0x442a58=_0x13f6[_0x1df2f9];return _0x442a58;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5618fa,_0x4b546b,_0x5a84f2){return new BPromise(function(_0x5c93c0,_0x2d5973){return client[_0x613f('0xa')](_0x5618fa,_0x5a84f2)[_0x613f('0xb')](function(_0x35b672){logger['info'](_0x613f('0xc'),_0x4b546b,_0x613f('0xd'));logger[_0x613f('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x4b546b,_0x613f('0xd'),JSON[_0x613f('0xf')](_0x35b672));if(_0x35b672[_0x613f('0x10')]){if(_0x35b672['error'][_0x613f('0x11')]===0x1f4){logger[_0x613f('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x4b546b,_0x35b672['error']['message']);return _0x2d5973(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}logger[_0x613f('0x10')](_0x613f('0xc'),_0x4b546b,_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);return _0x5c93c0(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}else{logger[_0x613f('0x13')](_0x613f('0xc'),_0x4b546b,'request\x20sent');_0x5c93c0(_0x35b672[_0x613f('0x14')]['message']);}})['catch'](function(_0x1bc605){logger[_0x613f('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x4b546b,_0x1bc605);_0x2d5973(_0x1bc605);});});}exports[_0x613f('0x15')]=function(_0x4f9dae){var _0x62ebfe=this;return new Promise(function(_0x1e5a11,_0x431266){return db[_0x613f('0x16')][_0x613f('0x17')](_0x4f9dae[_0x613f('0x18')],{'raw':_0x4f9dae['options']?_0x4f9dae['options'][_0x613f('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x48493c){logger[_0x613f('0x13')](_0x613f('0x15'),_0x4f9dae);logger['debug'](_0x613f('0x15'),_0x4f9dae,JSON[_0x613f('0xf')](_0x48493c));_0x1e5a11(_0x48493c);})[_0x613f('0x1a')](function(_0x48b28a){logger['error'](_0x613f('0x15'),_0x48b28a[_0x613f('0x12')],_0x4f9dae);_0x431266(_0x62ebfe[_0x613f('0x10')](0x1f4,_0x48b28a['message']));});});};exports[_0x613f('0x1b')]=function(_0x33e0c6){var _0x30de90=this;return new Promise(function(_0x1ee050,_0x3013a1){return db['CmHopperHistory'][_0x613f('0x1c')]({'raw':_0x33e0c6[_0x613f('0x1d')]?_0x33e0c6['options'][_0x613f('0x19')]===undefined?!![]:![]:!![],'where':_0x33e0c6[_0x613f('0x1d')]?_0x33e0c6[_0x613f('0x1d')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x613f('0x1e')]['col']('id')),_0x613f('0x1f')],[db[_0x613f('0x1e')]['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db['sequelize'][_0x613f('0x21')](_0x613f('0x22')))),_0x613f('0x23')],[db[_0x613f('0x1e')]['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x24')))),_0x613f('0x25')],[db[_0x613f('0x1e')]['fn']('AVG',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x613f('0x26')],[db['sequelize']['fn'](_0x613f('0x27'),db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x28')))),_0x613f('0x29')]]})['then'](function(_0x1a18ce){logger[_0x613f('0x13')](_0x613f('0x1b'),_0x33e0c6);logger[_0x613f('0xe')](_0x613f('0x1b'),_0x33e0c6,JSON['stringify'](_0x1a18ce));_0x1ee050(_0x1a18ce);})['catch'](function(_0x4eea2c){logger[_0x613f('0x10')](_0x613f('0x1b'),_0x4eea2c[_0x613f('0x12')],_0x33e0c6);_0x3013a1(_0x30de90[_0x613f('0x10')](0x1f4,_0x4eea2c['message']));});});};exports[_0x613f('0x2a')]=function(_0xaedbbd){var _0x4ed25f=this;return new Promise(function(_0x45e6df,_0x550cea){return db[_0x613f('0x16')]['findAll']({'raw':_0xaedbbd[_0x613f('0x1d')]?_0xaedbbd['options'][_0x613f('0x19')]===undefined?!![]:![]:!![],'where':_0xaedbbd[_0x613f('0x1d')]?_0xaedbbd[_0x613f('0x1d')]['where']||null:null,'attributes':[[_0x613f('0x2b'),_0x613f('0x2c')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x2d')))),_0x613f('0x2e')],[db[_0x613f('0x1e')]['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x2f')))),_0x613f('0x30')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db['sequelize']['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x31')))),_0x613f('0x32')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db['sequelize'][_0x613f('0x21')](_0x613f('0x33')))),_0x613f('0x34')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x35')))),_0x613f('0x36')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db['sequelize'][_0x613f('0x21')](_0x613f('0x37')))),_0x613f('0x38')],[db[_0x613f('0x1e')]['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x39')))),_0x613f('0x3a')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')]('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db['sequelize']['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x3b')))),_0x613f('0x3c')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x3d')))),_0x613f('0x3e')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x3f')))),_0x613f('0x40')],[db['sequelize']['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0x613f('0x41')],[db['sequelize']['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0x613f('0x40')],[db[_0x613f('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x42')))),_0x613f('0x43')]],'group':[_0x613f('0x2b')]})[_0x613f('0xb')](function(_0x24d162){logger['info']('GetVoiceQueueHopperHistory',_0xaedbbd);logger[_0x613f('0xe')]('GetVoiceQueueHopperHistory',_0xaedbbd,JSON['stringify'](_0x24d162));_0x45e6df(_0x24d162);})[_0x613f('0x1a')](function(_0x52c2a6){logger[_0x613f('0x10')]('GetVoiceQueueHopperHistory',_0x52c2a6[_0x613f('0x12')],_0xaedbbd);_0x550cea(_0x4ed25f[_0x613f('0x10')](0x1f4,_0x52c2a6[_0x613f('0x12')]));});});};exports[_0x613f('0x44')]=function(_0x11e4a4){var _0x2cb4a1=this;return new Promise(function(_0x346e2c,_0x4a49a1){return db[_0x613f('0x16')]['findAll']({'raw':_0x11e4a4[_0x613f('0x1d')]?_0x11e4a4[_0x613f('0x1d')][_0x613f('0x19')]===undefined?!![]:![]:!![],'where':_0x11e4a4[_0x613f('0x1d')]?_0x11e4a4[_0x613f('0x1d')][_0x613f('0x45')]||null:null,'attributes':[[_0x613f('0x2b'),_0x613f('0x2c')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')][_0x613f('0x46')]('id')),_0x613f('0x47')],[db['sequelize']['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db['sequelize'][_0x613f('0x21')](_0x613f('0x31')))),_0x613f('0x48')]],'group':[_0x613f('0x2b')]})[_0x613f('0xb')](function(_0x46a945){logger[_0x613f('0x13')](_0x613f('0x44'),_0x11e4a4);logger[_0x613f('0xe')](_0x613f('0x44'),_0x11e4a4,JSON[_0x613f('0xf')](_0x46a945));_0x346e2c(_0x46a945);})['catch'](function(_0xbc2c8f){logger[_0x613f('0x10')](_0x613f('0x44'),_0xbc2c8f[_0x613f('0x12')],_0x11e4a4);_0x4a49a1(_0x2cb4a1['error'](0x1f4,_0xbc2c8f[_0x613f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index fb0f356..43bb5a9 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 _0xeff8=['../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','/:id','show','create','put','update','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xeff8,0x186));var _0x8eff=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xeff8[_0x34bf97];return _0x292719;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8eff('0x5'));var config=require(_0x8eff('0x6'));var controller=require(_0x8eff('0x7'));router[_0x8eff('0x8')]('/',auth['isAuthenticated'](),controller[_0x8eff('0x9')]);router[_0x8eff('0x8')](_0x8eff('0xa'),auth[_0x8eff('0xb')](),controller['describe']);router[_0x8eff('0x8')](_0x8eff('0xc'),auth[_0x8eff('0xb')](),controller[_0x8eff('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8eff('0xe')]);router[_0x8eff('0xf')](_0x8eff('0xc'),auth['isAuthenticated'](),controller[_0x8eff('0x10')]);module[_0x8eff('0x11')]=router; \ No newline at end of file +var _0x1134=['../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','isAuthenticated','get','describe','/:id','show','post','put','update','exports','multer','util','connect-timeout','express'];(function(_0x1feaf5,_0x549f51){var _0x253e3a=function(_0x17c727){while(--_0x17c727){_0x1feaf5['push'](_0x1feaf5['shift']());}};_0x253e3a(++_0x549f51);}(_0x1134,0x19c));var _0x4113=function(_0xe28ae4,_0x388c1b){_0xe28ae4=_0xe28ae4-0x0;var _0x110f4a=_0x1134[_0xe28ae4];return _0x110f4a;};'use strict';var multer=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var path=require('path');var timeout=require(_0x4113('0x2'));var express=require(_0x4113('0x3'));var router=express['Router']();var auth=require(_0x4113('0x4'));var interaction=require(_0x4113('0x5'));var config=require('../../config/environment');var controller=require(_0x4113('0x6'));router['get']('/',auth[_0x4113('0x7')](),controller['index']);router[_0x4113('0x8')]('/describe',auth[_0x4113('0x7')](),controller[_0x4113('0x9')]);router[_0x4113('0x8')](_0x4113('0xa'),auth[_0x4113('0x7')](),controller[_0x4113('0xb')]);router[_0x4113('0xc')]('/',auth[_0x4113('0x7')](),controller['create']);router[_0x4113('0xd')](_0x4113('0xa'),auth[_0x4113('0x7')](),controller[_0x4113('0xe')]);module[_0x4113('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 751d176..ce556a7 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 _0xe14b=['sequelize','exports','STRING'];(function(_0x1fbff1,_0x16e51e){var _0x513123=function(_0x416d1c){while(--_0x416d1c){_0x1fbff1['push'](_0x1fbff1['shift']());}};_0x513123(++_0x16e51e);}(_0xe14b,0x93));var _0xbe14=function(_0x4a2939,_0x122ab5){_0x4a2939=_0x4a2939-0x0;var _0x2aef78=_0xe14b[_0x4a2939];return _0x2aef78;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbe14('0x2')]},'dialPrefix':{'type':Sequelize[_0xbe14('0x2')]}}; \ No newline at end of file +var _0xdbf5=['exports','STRING'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x33d5a6,_0x147e39){_0x33d5a6=_0x33d5a6-0x0;var _0x303457=_0xdbf5[_0x33d5a6];return _0x303457;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5dbf('0x1')]},'dialPrefix':{'type':Sequelize[_0x5dbf('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index b9d4595..ce297e0 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 _0x774b=['transaction','CmCustomField','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','sequelize','queryInterface','addColumn','cf_%s','getCustomFields','addAgents','omit','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','update','get','Lists','UserProfileResource','destroy','then','error','stack','name','index','CmList','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','findAll','rows','show','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','ListId','removeDispositions','addContacts','tags','isArray','join','push','each','CmContact','ids','success','message','json','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','getContactsCsv','cf_%d','raw','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','addCustomField'];(function(_0xd73d53,_0x598443){var _0x560148=function(_0x3c8918){while(--_0x3c8918){_0xd73d53['push'](_0xd73d53['shift']());}};_0x560148(++_0x598443);}(_0x774b,0xa1));var _0xb774=function(_0xf7bfa4,_0xfe3587){_0xf7bfa4=_0xf7bfa4-0x0;var _0x2193cc=_0x774b[_0xf7bfa4];return _0x2193cc;};'use strict';var pdf=require(_0xb774('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb774('0x1'));var zipdir=require(_0xb774('0x2'));var jsonpatch=require(_0xb774('0x3'));var rp=require('request-promise');var moment=require(_0xb774('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb774('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb774('0x6'));var fs=require('fs');var _=require(_0xb774('0x7'));var squel=require(_0xb774('0x8'));var crypto=require(_0xb774('0x9'));var jsforce=require(_0xb774('0xa'));var deskjs=require(_0xb774('0xb'));var toCsv=require(_0xb774('0xc'));var querystring=require(_0xb774('0xd'));var Papa=require(_0xb774('0xe'));var authService=require(_0xb774('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xb774('0x10'));var logger=require(_0xb774('0x11'))('api');var utils=require(_0xb774('0x12'));var config=require(_0xb774('0x13'));var db=require(_0xb774('0x14'))['db'];config[_0xb774('0x15')]=_[_0xb774('0x16')](config[_0xb774('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xb774('0x17'))(new Redis(config['redis']));require(_0xb774('0x18'))[_0xb774('0x19')](socket);function respondWithStatusCode(_0x28adf0,_0x1cbbb3){_0x1cbbb3=_0x1cbbb3||0xcc;return function(_0x579dc2){if(_0x579dc2){return _0x28adf0[_0xb774('0x1a')](_0x1cbbb3);}return _0x28adf0[_0xb774('0x1b')](_0x1cbbb3)[_0xb774('0x1c')]();};}function respondWithResult(_0x555be5,_0x1a0346){_0x1a0346=_0x1a0346||0xc8;return function(_0xeed6da){if(_0xeed6da){return _0x555be5[_0xb774('0x1b')](_0x1a0346)['json'](_0xeed6da);}};}function respondWithFilteredResult(_0x2ee92a,_0x4bb878){return function(_0x424035){if(_0x424035){var _0x3d5496=_0x424035[_0xb774('0x1d')],_0x1a7ba3=_0x4bb878[_0xb774('0x1e')],_0x282b8e=_0x4bb878['offset']+_0x4bb878['limit'],_0x291cdf;if(_0x282b8e>=_0x3d5496){_0x282b8e=_0x3d5496;_0x291cdf=0xc8;}else{_0x291cdf=0xce;}_0x2ee92a[_0xb774('0x1b')](_0x291cdf);return _0x2ee92a[_0xb774('0x1f')](_0xb774('0x20'),_0x1a7ba3+'-'+_0x282b8e+'/'+_0x3d5496)['json'](_0x424035);}return null;};}function patchUpdates(_0x48a10b){return function(_0x5ec842){try{jsonpatch[_0xb774('0x21')](_0x5ec842,_0x48a10b,!![]);}catch(_0x2e068a){return BPromise[_0xb774('0x22')](_0x2e068a);}return _0x5ec842['save']();};}function saveUpdates(_0x54cbf9,_0xe5ef2f){return function(_0x543a8b){if(_0x543a8b){return _0x543a8b[_0xb774('0x23')](_0x54cbf9)['then'](function(_0x1b2401){return _0x1b2401;});}return null;};}function removeEntity(_0x42c252,_0x4d0a20){return function(_0x3c7c45){if(_0x3c7c45){return _0x3c7c45['destroy']()['then'](function(){var _0x3707d3=_0x3c7c45[_0xb774('0x24')]({'plain':!![]});var _0x43e2bd=_0xb774('0x25');return db[_0xb774('0x26')][_0xb774('0x27')]({'where':{'type':_0x43e2bd,'resourceId':_0x3707d3['id']}})[_0xb774('0x28')](function(){return _0x3c7c45;});})[_0xb774('0x28')](function(){_0x42c252[_0xb774('0x1b')](0xcc)[_0xb774('0x1c')]();});}};}function handleEntityNotFound(_0x4b2849,_0x54dd43){return function(_0x11a5d6){if(!_0x11a5d6){_0x4b2849[_0xb774('0x1a')](0x194);}return _0x11a5d6;};}function handleError(_0x3029ea,_0x2d6474){_0x2d6474=_0x2d6474||0x1f4;return function(_0x578ba8){logger[_0xb774('0x29')](_0x578ba8[_0xb774('0x2a')]);if(_0x578ba8['name']){delete _0x578ba8[_0xb774('0x2b')];}_0x3029ea[_0xb774('0x1b')](_0x2d6474)['send'](_0x578ba8);};}exports[_0xb774('0x2c')]=function(_0x21d626,_0x3d1251){var _0x25eba3={},_0x3facd3={},_0x432847={'count':0x0,'rows':[]};var _0x530a71=db[_0xb774('0x2d')][_0xb774('0x2e')];_0x3facd3[_0xb774('0x2f')]=_[_0xb774('0x30')](_0x530a71);_0x3facd3[_0xb774('0x31')]=_[_0xb774('0x30')](_0x21d626[_0xb774('0x31')]);_0x3facd3[_0xb774('0x32')]=_['intersection'](_0x3facd3[_0xb774('0x2f')],_0x3facd3['query']);_0x25eba3[_0xb774('0x33')]=_[_0xb774('0x34')](_0x3facd3[_0xb774('0x2f')],qs['fields'](_0x21d626['query'][_0xb774('0x35')]));_0x25eba3[_0xb774('0x33')]=_0x25eba3[_0xb774('0x33')][_0xb774('0x36')]?_0x25eba3[_0xb774('0x33')]:_0x3facd3[_0xb774('0x2f')];if(!_0x21d626[_0xb774('0x31')][_0xb774('0x37')](_0xb774('0x38'))){_0x25eba3['limit']=qs[_0xb774('0x39')](_0x21d626['query']['limit']);_0x25eba3[_0xb774('0x1e')]=qs[_0xb774('0x1e')](_0x21d626['query']['offset']);}_0x25eba3[_0xb774('0x3a')]=qs[_0xb774('0x3b')](_0x21d626['query'][_0xb774('0x3b')]);_0x25eba3[_0xb774('0x3c')]=qs[_0xb774('0x32')](_[_0xb774('0x3d')](_0x21d626[_0xb774('0x31')],_0x3facd3[_0xb774('0x32')]));if(_0x21d626['query'][_0xb774('0x3e')]){_0x25eba3[_0xb774('0x3c')]=_[_0xb774('0x3f')](_0x25eba3[_0xb774('0x3c')],{'$or':_[_0xb774('0x40')](_0x530a71,function(_0x12552e){if(_0x12552e[_0xb774('0x41')]['key']!=='VIRTUAL'){var _0x47ae02={};_0x47ae02[_0x12552e['field']]={'$like':'%'+_0x21d626[_0xb774('0x31')]['filter']+'%'};return _0x47ae02;}})});}_0x25eba3=_[_0xb774('0x3f')]({},_0x25eba3,_0x21d626[_0xb774('0x42')]);var _0x401fac={'where':_0x25eba3['where']};return db[_0xb774('0x2d')][_0xb774('0x1d')](_0x401fac)[_0xb774('0x28')](function(_0x15833c){_0x432847[_0xb774('0x1d')]=_0x15833c;if(_0x21d626[_0xb774('0x31')][_0xb774('0x43')]){_0x25eba3[_0xb774('0x44')]=[{'all':!![]}];}return db[_0xb774('0x2d')][_0xb774('0x45')](_0x25eba3);})[_0xb774('0x28')](function(_0x115fa9){_0x432847[_0xb774('0x46')]=_0x115fa9;return _0x432847;})[_0xb774('0x28')](respondWithFilteredResult(_0x3d1251,_0x25eba3))['catch'](handleError(_0x3d1251,null));};exports[_0xb774('0x47')]=function(_0x553845,_0x3d5538){var _0x2eb293={'raw':![],'where':{'id':_0x553845['params']['id']}},_0x3e5e46={};_0x3e5e46[_0xb774('0x2f')]=_['keys'](db[_0xb774('0x2d')][_0xb774('0x2e')]);_0x3e5e46[_0xb774('0x31')]=_[_0xb774('0x30')](_0x553845['query']);_0x3e5e46[_0xb774('0x32')]=_[_0xb774('0x34')](_0x3e5e46[_0xb774('0x2f')],_0x3e5e46['query']);_0x2eb293[_0xb774('0x33')]=_[_0xb774('0x34')](_0x3e5e46[_0xb774('0x2f')],qs[_0xb774('0x35')](_0x553845[_0xb774('0x31')][_0xb774('0x35')]));_0x2eb293[_0xb774('0x33')]=_0x2eb293[_0xb774('0x33')][_0xb774('0x36')]?_0x2eb293[_0xb774('0x33')]:_0x3e5e46[_0xb774('0x2f')];if(_0x553845[_0xb774('0x31')][_0xb774('0x43')]){_0x2eb293[_0xb774('0x44')]=[{'all':!![]}];}_0x2eb293=_[_0xb774('0x3f')]({},_0x2eb293,_0x553845[_0xb774('0x42')]);return db['CmList']['find'](_0x2eb293)[_0xb774('0x28')](handleEntityNotFound(_0x3d5538,null))[_0xb774('0x28')](respondWithResult(_0x3d5538,null))[_0xb774('0x48')](handleError(_0x3d5538,null));};exports[_0xb774('0x49')]=function(_0x28a0ee,_0x30cf5d){return db[_0xb774('0x2d')][_0xb774('0x49')](_0x28a0ee[_0xb774('0x4a')],{})[_0xb774('0x28')](function(_0x47cf85){var _0x455dfb=_0x28a0ee['user'][_0xb774('0x24')]({'plain':!![]});if(!_0x455dfb)throw new Error(_0xb774('0x4b'));if(_0x455dfb['role']===_0xb774('0x4c')){var _0x270667=_0x47cf85[_0xb774('0x24')]({'plain':!![]});var _0x54dd15=_0xb774('0x25');return db[_0xb774('0x4d')][_0xb774('0x4e')]({'where':{'name':_0x54dd15,'userProfileId':_0x455dfb[_0xb774('0x4f')]},'raw':!![]})[_0xb774('0x28')](function(_0x42ecfd){if(_0x42ecfd&&_0x42ecfd[_0xb774('0x50')]===0x0){return db[_0xb774('0x26')][_0xb774('0x49')]({'name':_0x270667[_0xb774('0x2b')],'resourceId':_0x270667['id'],'type':_0x42ecfd['name'],'sectionId':_0x42ecfd['id']},{})[_0xb774('0x28')](function(){return _0x47cf85;});}else{return _0x47cf85;}})['catch'](function(_0x5b7757){logger['error'](_0xb774('0x51'),_0x5b7757);throw _0x5b7757;});}return _0x47cf85;})['then'](respondWithResult(_0x30cf5d,0xc9))[_0xb774('0x48')](handleError(_0x30cf5d,null));};exports[_0xb774('0x23')]=function(_0x5a5259,_0x2aa7ef){if(_0x5a5259[_0xb774('0x4a')]['id']){delete _0x5a5259['body']['id'];}return db[_0xb774('0x2d')][_0xb774('0x4e')]({'where':{'id':_0x5a5259[_0xb774('0x52')]['id']}})[_0xb774('0x28')](handleEntityNotFound(_0x2aa7ef,null))['then'](saveUpdates(_0x5a5259['body'],null))[_0xb774('0x28')](respondWithResult(_0x2aa7ef,null))[_0xb774('0x48')](handleError(_0x2aa7ef,null));};exports['destroy']=function(_0xa09ac7,_0x57b29c){return db[_0xb774('0x2d')][_0xb774('0x4e')]({'where':{'id':_0xa09ac7[_0xb774('0x52')]['id']}})['then'](handleEntityNotFound(_0x57b29c,null))[_0xb774('0x28')](removeEntity(_0x57b29c,null))['catch'](handleError(_0x57b29c,null));};exports[_0xb774('0x53')]=function(_0x2f1c04,_0x4b4b01){return db[_0xb774('0x2d')][_0xb774('0x53')]()['then'](respondWithResult(_0x4b4b01,null))[_0xb774('0x48')](handleError(_0x4b4b01,null));};exports[_0xb774('0x54')]=function(_0x47f476,_0x235e8e,_0xfc676c){if(_0x47f476[_0xb774('0x4a')]['id']){delete _0x47f476[_0xb774('0x4a')]['id'];}return db[_0xb774('0x2d')][_0xb774('0x4e')]({'where':{'id':_0x47f476[_0xb774('0x52')]['id']}})[_0xb774('0x28')](handleEntityNotFound(_0x235e8e,null))[_0xb774('0x28')](function(_0x276c7e){if(_0x276c7e){_0x47f476[_0xb774('0x4a')]['ListId']=_0x276c7e['id'];return db[_0xb774('0x55')][_0xb774('0x49')](_0x47f476[_0xb774('0x4a')]);}})[_0xb774('0x28')](respondWithResult(_0x235e8e,null))[_0xb774('0x48')](handleError(_0x235e8e,null));};exports[_0xb774('0x56')]=function(_0x396ef3,_0xc2f7f3,_0x4528f9){var _0x359903={'raw':![],'where':{}};var _0x104086={};var _0x21745a={'count':0x0,'rows':[]};return db[_0xb774('0x2d')][_0xb774('0x57')]({'where':{'id':_0x396ef3[_0xb774('0x52')]['id']}})[_0xb774('0x28')](handleEntityNotFound(_0xc2f7f3,null))['then'](function(_0x29d7df){if(_0x29d7df){_0x104086[_0xb774('0x2f')]=_['keys'](db[_0xb774('0x55')][_0xb774('0x2e')]);_0x104086[_0xb774('0x31')]=_[_0xb774('0x30')](_0x396ef3['query']);_0x104086[_0xb774('0x32')]=_['intersection'](_0x104086[_0xb774('0x2f')],_0x104086[_0xb774('0x31')]);_0x359903[_0xb774('0x33')]=_['intersection'](_0x104086[_0xb774('0x2f')],qs['fields'](_0x396ef3[_0xb774('0x31')][_0xb774('0x35')]));_0x359903[_0xb774('0x33')]=_0x359903[_0xb774('0x33')]['length']?_0x359903[_0xb774('0x33')]:_0x104086[_0xb774('0x2f')];if(!_0x396ef3[_0xb774('0x31')][_0xb774('0x37')](_0xb774('0x38'))){_0x359903['limit']=qs[_0xb774('0x39')](_0x396ef3[_0xb774('0x31')]['limit']);_0x359903[_0xb774('0x1e')]=qs[_0xb774('0x1e')](_0x396ef3['query'][_0xb774('0x1e')]);}_0x359903[_0xb774('0x3a')]=qs['sort'](_0x396ef3[_0xb774('0x31')]['sort']);_0x359903[_0xb774('0x3c')]=qs[_0xb774('0x32')](_['pick'](_0x396ef3['query'],_0x104086[_0xb774('0x32')]));_0x359903['where'][_0xb774('0x58')]=_0x29d7df['id'];if(_0x396ef3[_0xb774('0x31')][_0xb774('0x3e')]){_0x359903[_0xb774('0x3c')]=_[_0xb774('0x3f')](_0x359903['where'],{'$or':_[_0xb774('0x40')](_0x359903['attributes'],function(_0x3d4a26){var _0x44239a={};_0x44239a[_0x3d4a26]={'$like':'%'+_0x396ef3['query']['filter']+'%'};return _0x44239a;})});}_0x359903=_[_0xb774('0x3f')]({},_0x359903,_0x396ef3['options']);return db[_0xb774('0x55')]['count']({'where':_0x359903[_0xb774('0x3c')]})[_0xb774('0x28')](function(_0x1edf0c){_0x21745a[_0xb774('0x1d')]=_0x1edf0c;if(_0x396ef3['query'][_0xb774('0x43')]){_0x359903[_0xb774('0x44')]=[{'all':!![]}];}return db[_0xb774('0x55')]['findAll'](_0x359903);})[_0xb774('0x28')](function(_0x2f2850){_0x21745a[_0xb774('0x46')]=_0x2f2850;return _0x21745a;});}})['then'](respondWithFilteredResult(_0xc2f7f3,_0x359903))['catch'](handleError(_0xc2f7f3,null));};exports[_0xb774('0x59')]=function(_0x3c3f60,_0x1a75cf,_0x1a4e88){var _0x5a5af4;return db[_0xb774('0x2d')][_0xb774('0x4e')]({'where':{'id':_0x3c3f60[_0xb774('0x52')]['id']}})[_0xb774('0x28')](handleEntityNotFound(_0x1a75cf,null))[_0xb774('0x28')](function(_0xd6142e){if(_0xd6142e){return _0xd6142e[_0xb774('0x59')](_0x3c3f60[_0xb774('0x31')]['ids']);}})[_0xb774('0x28')](respondWithStatusCode(_0x1a75cf,null))['catch'](handleError(_0x1a75cf,null));};exports[_0xb774('0x5a')]=function(_0x4583f6,_0x1a0353,_0x2f7f42){return db[_0xb774('0x2d')][_0xb774('0x4e')]({'where':{'id':_0x4583f6[_0xb774('0x52')]['id']}})['then'](handleEntityNotFound(_0x1a0353,null))[_0xb774('0x28')](function(_0x2d41d2){if(_0x2d41d2){var _0x2b150c=[];var _0x458358={'success':[],'errors':[]};return db['CmContact'][_0xb774('0x53')]()[_0xb774('0x28')](function(_0x4bb96e){if(_0x4583f6['body'][_0xb774('0x5b')]&&_[_0xb774('0x5c')](_0x4583f6[_0xb774('0x4a')]['tags'])){if(_0x4583f6[_0xb774('0x4a')]['tags'][_0xb774('0x36')]){_0x4583f6['body'][_0xb774('0x5b')]=_0x4583f6['body'][_0xb774('0x5b')][_0xb774('0x5d')](';')+';';}else{_0x4583f6[_0xb774('0x4a')][_0xb774('0x5b')]=null;}}else{_0x4583f6['body']['tags']=null;}if(_0x4583f6[_0xb774('0x4a')]&&_[_0xb774('0x5c')](_0x4583f6['body'])){for(var _0x4f2588=0x0;_0x4f2588<_0x4583f6[_0xb774('0x4a')]['length'];_0x4f2588+=0x1){_0x4583f6[_0xb774('0x4a')][_0x4f2588][_0xb774('0x58')]=_0x4583f6[_0xb774('0x52')]['id'];_0x2b150c[_0xb774('0x5e')](_0x4583f6[_0xb774('0x4a')][_0x4f2588]);}return BPromise[_0xb774('0x5f')](_0x2b150c,function(_0x13ceab){return db[_0xb774('0x60')][_0xb774('0x49')](_['omit'](_0x13ceab,[_0xb774('0x61'),'id'])||{},{'fields':_['keys'](_0x4bb96e),'raw':!![]})[_0xb774('0x28')](function(_0x9b0a24){_0x458358[_0xb774('0x62')]['push'](_0x9b0a24['dataValues']);})[_0xb774('0x48')](function(_0x29c8d7){_0x458358['errors'][_0xb774('0x5e')]({'data':_0x13ceab,'error':_0x29c8d7[_0xb774('0x63')]});});})['then'](function(_0x3ada7d){return _0x458358;})[_0xb774('0x48')](function(_0x4c4e8d){return _0x4c4e8d;});}else{_0x1a0353[_0xb774('0x1b')](0x190)[_0xb774('0x64')]({'message':_0xb774('0x65')});}});}})['then'](respondWithResult(_0x1a0353,null))['catch'](handleError(_0x1a0353,null));};exports[_0xb774('0x66')]=function(_0x2f465f,_0x2dcc0b,_0x28d13e){var _0x1f8504;return db['CmList'][_0xb774('0x4e')]({'where':{'id':_0x2f465f['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0xb774('0x67')}]})[_0xb774('0x28')](handleEntityNotFound(_0x2dcc0b,null))[_0xb774('0x28')](function(_0x5bec19){if(_0x5bec19){_0x1f8504=_0x5bec19;return db[_0xb774('0x60')][_0xb774('0x2e')];}})['then'](function(_0x1fd669){if(_0x1fd669){var _0x517774={};var _0x2da595={};_0x2da595[_0xb774('0x2f')]=_[_0xb774('0x68')](_[_0xb774('0x30')](_0x1fd669),_[_0xb774('0x40')](_0x1f8504[_0xb774('0x67')],function(_0x2c3ace){return util[_0xb774('0x69')]('cf_%d',_0x2c3ace['id']);}));_0x2da595[_0xb774('0x31')]=_['keys'](_0x2f465f[_0xb774('0x31')]);_0x2da595[_0xb774('0x32')]=_[_0xb774('0x34')](_0x2da595[_0xb774('0x2f')],_0x2da595[_0xb774('0x31')]);_0x517774[_0xb774('0x33')]=_['intersection'](_0x2da595[_0xb774('0x2f')],qs[_0xb774('0x35')](_0x2f465f[_0xb774('0x31')]['fields']));_0x517774[_0xb774('0x33')]=_0x517774[_0xb774('0x33')][_0xb774('0x36')]?_0x517774[_0xb774('0x33')]:_0x2da595['model'];if(!_0x2f465f['query'][_0xb774('0x37')](_0xb774('0x38'))){_0x517774[_0xb774('0x39')]=qs[_0xb774('0x39')](_0x2f465f['query'][_0xb774('0x39')]);_0x517774[_0xb774('0x1e')]=qs[_0xb774('0x1e')](_0x2f465f['query'][_0xb774('0x1e')]);}_0x517774[_0xb774('0x3a')]=qs[_0xb774('0x3b')](_0x2f465f[_0xb774('0x31')]['sort']);_0x517774[_0xb774('0x3c')]=qs[_0xb774('0x32')](_['pick'](_0x2f465f[_0xb774('0x31')],_0x2da595[_0xb774('0x32')]));_0x517774['raw']=!![];if(_0x2f465f['query'][_0xb774('0x3e')]){_0x517774['where']=_[_0xb774('0x3f')](_0x517774[_0xb774('0x3c')],{'$or':_[_0xb774('0x40')](_0x517774[_0xb774('0x33')],function(_0x3fc8c5){var _0x1d5a0f={};_0x1d5a0f[_0x3fc8c5]={'$like':'%'+_0x2f465f[_0xb774('0x31')][_0xb774('0x3e')]+'%'};return _0x1d5a0f;})});}_0x517774=_['merge']({},_0x517774,_0x2f465f['options']);return _0x1f8504['getContacts'](_0x517774);}})[_0xb774('0x28')](respondWithResult(_0x2dcc0b,null))['catch'](handleError(_0x2dcc0b,null));};exports[_0xb774('0x6a')]=function(_0x2cfd87,_0x48bb3f,_0x54cfff){var _0x38e14f;return db[_0xb774('0x2d')][_0xb774('0x4e')]({'where':{'id':_0x2cfd87['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0xb774('0x67')}]})[_0xb774('0x28')](handleEntityNotFound(_0x48bb3f,null))['then'](function(_0x3750df){if(_0x3750df){_0x38e14f=_0x3750df;return db['CmContact'][_0xb774('0x2e')];}})[_0xb774('0x28')](function(_0x1640ca){if(_0x1640ca){var _0xe92983={};var _0x32d8e5={};_0x32d8e5[_0xb774('0x2f')]=_[_0xb774('0x68')](_[_0xb774('0x30')](_0x1640ca),_[_0xb774('0x40')](_0x38e14f[_0xb774('0x67')],function(_0x35724f){return util[_0xb774('0x69')](_0xb774('0x6b'),_0x35724f['id']);}));_0x32d8e5['query']=_[_0xb774('0x30')](_0x2cfd87[_0xb774('0x31')]);_0x32d8e5['filters']=_[_0xb774('0x34')](_0x32d8e5[_0xb774('0x2f')],_0x32d8e5['query']);_0xe92983['attributes']=_[_0xb774('0x34')](_0x32d8e5['model'],qs[_0xb774('0x35')](_0x2cfd87[_0xb774('0x31')][_0xb774('0x35')]));_0xe92983[_0xb774('0x33')]=_0xe92983[_0xb774('0x33')][_0xb774('0x36')]?_0xe92983[_0xb774('0x33')]:_0x32d8e5[_0xb774('0x2f')];if(!_0x2cfd87['query'][_0xb774('0x37')]('nolimit')){_0xe92983[_0xb774('0x39')]=qs[_0xb774('0x39')](_0x2cfd87['query'][_0xb774('0x39')]);_0xe92983['offset']=qs['offset'](_0x2cfd87[_0xb774('0x31')][_0xb774('0x1e')]);}_0xe92983['order']=qs['sort'](_0x2cfd87['query']['sort']);_0xe92983[_0xb774('0x3c')]=qs[_0xb774('0x32')](_[_0xb774('0x3d')](_0x2cfd87['query'],_0x32d8e5[_0xb774('0x32')]));_0xe92983[_0xb774('0x6c')]=!![];if(_0x2cfd87['query'][_0xb774('0x3e')]){_0xe92983[_0xb774('0x3c')]=_[_0xb774('0x3f')](_0xe92983[_0xb774('0x3c')],{'$or':_[_0xb774('0x40')](_0xe92983[_0xb774('0x33')],function(_0x203822){var _0x3ae376={};_0x3ae376[_0x203822]={'$like':'%'+_0x2cfd87[_0xb774('0x31')][_0xb774('0x3e')]+'%'};return _0x3ae376;})});}_0xe92983=_['merge']({},_0xe92983,_0x2cfd87[_0xb774('0x42')]);return _0x38e14f[_0xb774('0x66')](_0xe92983);}})[_0xb774('0x28')](function(_0x33146a){if(!_[_0xb774('0x6d')](_0x33146a)){var _0x243d6a=toCsv(_0x33146a);var _0x49c010=Date['now']();fs[_0xb774('0x6e')](util[_0xb774('0x69')](_0xb774('0x6f'),_0x38e14f['id'],_0x49c010),_0x243d6a);_0x48bb3f[_0xb774('0x70')](_0xb774('0x71'),_0xb774('0x72')+util[_0xb774('0x69')]('list_%d_%s.csv',_0x38e14f['id'],_0x49c010));_0x48bb3f['setHeader'](_0xb774('0x73'),_0xb774('0x74'));return _0x48bb3f[_0xb774('0x75')](util[_0xb774('0x69')]('/tmp/list_%d_%s.csv',_0x38e14f['id'],_0x49c010));}else{return _0x48bb3f['sendStatus'](0xcc);}})['catch'](handleError(_0x48bb3f,null));};exports[_0xb774('0x76')]=function(_0x19a1e6,_0x52d8da,_0x5209bb){var _0x2c8561;delete _0x19a1e6[_0xb774('0x4a')]['id'];return db[_0xb774('0x2d')][_0xb774('0x57')]({'where':{'id':_0x19a1e6[_0xb774('0x52')]['id']}})['then'](handleEntityNotFound(_0x52d8da,null))[_0xb774('0x28')](function(_0x1a2462){if(_0x1a2462){return db['sequelize'][_0xb774('0x77')](function(_0x57b3b7){return db[_0xb774('0x78')]['create'](_0x19a1e6[_0xb774('0x4a')],{'transaction':_0x57b3b7})[_0xb774('0x28')](function(_0x25e240){_0x2c8561=_0x25e240;return _0x1a2462[_0xb774('0x79')](_0x25e240,{'transaction':_0x57b3b7});})[_0xb774('0x28')](function(){var _0x2862d4={'type':db[_0xb774('0x7a')][_0xb774('0x7b')],'transaction':_0x57b3b7};switch(_0x19a1e6[_0xb774('0x4a')][_0xb774('0x41')]){case'text':_0x2862d4[_0xb774('0x41')]=db[_0xb774('0x7a')][_0xb774('0x7b')];break;case _0xb774('0x7c'):_0x2862d4[_0xb774('0x41')]=db[_0xb774('0x7a')][_0xb774('0x7d')];break;case _0xb774('0x7e'):_0x2862d4[_0xb774('0x41')]=db[_0xb774('0x7a')]['BOOLEAN'];_0x2862d4['defaultValue']=![];break;default:}return db[_0xb774('0x7f')][_0xb774('0x80')][_0xb774('0x81')]('cm_contacts',util[_0xb774('0x69')](_0xb774('0x82'),_0x2c8561['id']),_0x2862d4);})['then'](function(){return _0x2c8561;});});}})['then'](respondWithResult(_0x52d8da,null))[_0xb774('0x48')](handleError(_0x52d8da,null));};exports[_0xb774('0x83')]=function(_0x3a17a7,_0x2ca972,_0x2eff42){var _0x21f283={};var _0x5b728e={};var _0x2200ea;var _0x40b3bc;return db['CmList']['findOne']({'where':{'id':_0x3a17a7[_0xb774('0x52')]['id']}})['then'](handleEntityNotFound(_0x2ca972,null))['then'](function(_0x1a71ca){if(_0x1a71ca){_0x2200ea=_0x1a71ca;_0x5b728e['model']=_[_0xb774('0x30')](db[_0xb774('0x78')][_0xb774('0x2e')]);_0x5b728e['query']=_[_0xb774('0x30')](_0x3a17a7[_0xb774('0x31')]);_0x5b728e[_0xb774('0x32')]=_['intersection'](_0x5b728e[_0xb774('0x2f')],_0x5b728e['query']);_0x21f283['attributes']=_['intersection'](_0x5b728e[_0xb774('0x2f')],qs[_0xb774('0x35')](_0x3a17a7['query'][_0xb774('0x35')]));_0x21f283[_0xb774('0x33')]=_0x21f283['attributes'][_0xb774('0x36')]?_0x21f283[_0xb774('0x33')]:_0x5b728e[_0xb774('0x2f')];_0x21f283['order']=qs[_0xb774('0x3b')](_0x3a17a7[_0xb774('0x31')][_0xb774('0x3b')]);_0x21f283[_0xb774('0x3c')]=qs[_0xb774('0x32')](_['pick'](_0x3a17a7[_0xb774('0x31')],_0x5b728e[_0xb774('0x32')]));_0x21f283[_0xb774('0x3c')]=_[_0xb774('0x3f')](_0x21f283['where'],{'$or':[{'ListId':_0x1a71ca['id']},{'ListId':null}]});if(_0x3a17a7[_0xb774('0x31')]['filter']){_0x21f283[_0xb774('0x3c')]=_[_0xb774('0x3f')](_0x21f283['where'],{'$or':_[_0xb774('0x40')](_0x21f283[_0xb774('0x33')],function(_0x4fae08){var _0xb8c9d6={};_0xb8c9d6[_0x4fae08]={'$like':'%'+_0x3a17a7[_0xb774('0x31')][_0xb774('0x3e')]+'%'};return _0xb8c9d6;})});}_0x21f283=_[_0xb774('0x3f')]({},_0x21f283,_0x3a17a7[_0xb774('0x42')]);return db[_0xb774('0x78')]['findAndCountAll'](_0x21f283);}})[_0xb774('0x28')](respondWithResult(_0x2ca972,null))[_0xb774('0x48')](handleError(_0x2ca972,null));};exports[_0xb774('0x84')]=function(_0x5bab22,_0x479c1f,_0x5d4562){return db['CmList'][_0xb774('0x4e')]({'where':{'id':_0x5bab22['params']['id']}})[_0xb774('0x28')](handleEntityNotFound(_0x479c1f,null))['then'](function(_0x2355bc){if(_0x2355bc){return _0x2355bc[_0xb774('0x84')](_0x5bab22[_0xb774('0x4a')][_0xb774('0x61')],_[_0xb774('0x85')](_0x5bab22[_0xb774('0x4a')],[_0xb774('0x61'),'id'])||{})['spread'](function(_0x5d0060){for(var _0x51d5a0=0x0;_0x51d5a0<_0x5bab22['body'][_0xb774('0x61')]['length'];_0x51d5a0+=0x1){socket[_0xb774('0x86')](_0xb774('0x87'),{'UserId':_0x5bab22[_0xb774('0x4a')][_0xb774('0x61')][_0x51d5a0],'CmListId':_0x5bab22[_0xb774('0x52')]['id']});}return _0x5d0060;});}})[_0xb774('0x28')](respondWithResult(_0x479c1f,null))[_0xb774('0x48')](handleError(_0x479c1f,null));};exports[_0xb774('0x88')]=function(_0x2b4d91,_0x26c9ad,_0x4509b3){var _0x164bb9;return db['CmList'][_0xb774('0x4e')]({'where':{'id':_0x2b4d91[_0xb774('0x52')]['id']}})[_0xb774('0x28')](handleEntityNotFound(_0x26c9ad,null))[_0xb774('0x28')](function(_0x209a41){if(_0x209a41){return _0x209a41[_0xb774('0x88')](_0x2b4d91[_0xb774('0x31')][_0xb774('0x61')])['then'](function(_0x4f8f46){if(_[_0xb774('0x5c')](_0x2b4d91[_0xb774('0x31')]['ids'])){for(var _0x5def4c=0x0;_0x5def4c<_0x2b4d91[_0xb774('0x31')][_0xb774('0x61')][_0xb774('0x36')];_0x5def4c+=0x1){socket[_0xb774('0x86')](_0xb774('0x89'),{'UserId':_0x2b4d91['query']['ids'][_0x5def4c],'CmListId':_0x2b4d91['params']['id']});}}else{socket[_0xb774('0x86')](_0xb774('0x89'),{'UserId':_0x2b4d91[_0xb774('0x31')][_0xb774('0x61')],'CmListId':_0x2b4d91[_0xb774('0x52')]['id']});}});}})[_0xb774('0x28')](respondWithStatusCode(_0x26c9ad,null))[_0xb774('0x48')](handleError(_0x26c9ad,null));};exports[_0xb774('0x8a')]=function(_0x3cf672,_0x29e4e1,_0x520332){var _0x6b999a={};var _0x4e5954={};var _0x1ae72d;var _0x3198a4;return db[_0xb774('0x2d')][_0xb774('0x57')]({'where':{'id':_0x3cf672[_0xb774('0x52')]['id']}})[_0xb774('0x28')](handleEntityNotFound(_0x29e4e1,null))[_0xb774('0x28')](function(_0x37b4e3){if(_0x37b4e3){_0x1ae72d=_0x37b4e3;_0x4e5954[_0xb774('0x2f')]=_['keys'](db[_0xb774('0x8b')][_0xb774('0x2e')]);_0x4e5954[_0xb774('0x31')]=_[_0xb774('0x30')](_0x3cf672['query']);_0x4e5954['filters']=_[_0xb774('0x34')](_0x4e5954[_0xb774('0x2f')],_0x4e5954[_0xb774('0x31')]);_0x6b999a[_0xb774('0x33')]=_['intersection'](_0x4e5954[_0xb774('0x2f')],qs[_0xb774('0x35')](_0x3cf672[_0xb774('0x31')][_0xb774('0x35')]));_0x6b999a[_0xb774('0x33')]=_0x6b999a[_0xb774('0x33')][_0xb774('0x36')]?_0x6b999a[_0xb774('0x33')]:_0x4e5954[_0xb774('0x2f')];_0x6b999a[_0xb774('0x3a')]=qs['sort'](_0x3cf672['query'][_0xb774('0x3b')]);_0x6b999a['where']=qs['filters'](_[_0xb774('0x3d')](_0x3cf672['query'],_0x4e5954[_0xb774('0x32')]));if(_0x3cf672['query'][_0xb774('0x3e')]){_0x6b999a[_0xb774('0x3c')]=_[_0xb774('0x3f')](_0x6b999a[_0xb774('0x3c')],{'$or':_[_0xb774('0x40')](_0x6b999a[_0xb774('0x33')],function(_0x532040){var _0x3a60aa={};_0x3a60aa[_0x532040]={'$like':'%'+_0x3cf672[_0xb774('0x31')][_0xb774('0x3e')]+'%'};return _0x3a60aa;})});}_0x6b999a=_['merge']({},_0x6b999a,_0x3cf672[_0xb774('0x42')]);return _0x1ae72d['getAgents'](_0x6b999a);}})[_0xb774('0x28')](function(_0x3288fe){if(_0x3288fe){_0x3198a4=_0x3288fe[_0xb774('0x36')];if(!_0x3cf672['query'][_0xb774('0x37')](_0xb774('0x38'))){_0x6b999a['limit']=qs[_0xb774('0x39')](_0x3cf672[_0xb774('0x31')][_0xb774('0x39')]);_0x6b999a[_0xb774('0x1e')]=qs[_0xb774('0x1e')](_0x3cf672[_0xb774('0x31')][_0xb774('0x1e')]);}return _0x1ae72d[_0xb774('0x8a')](_0x6b999a);}})['then'](function(_0x26640d){if(_0x26640d){return _0x26640d?{'count':_0x3198a4,'rows':_0x26640d}:null;}})['then'](respondWithResult(_0x29e4e1,null))['catch'](handleError(_0x29e4e1,null));}; \ No newline at end of file +var _0xee1a=['name','send','CmList','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','options','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','find','describe','ListId','Disposition','getDispositions','order','includeAll','findAll','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContactsCsv','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','findOne','sequelize','addCustomFields','Sequelize','TEXT','text','number','BOOLEAN','defaultValue','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','stack'];(function(_0x120057,_0x1e6b37){var _0x5d7365=function(_0x2e9d9a){while(--_0x2e9d9a){_0x120057['push'](_0x120057['shift']());}};_0x5d7365(++_0x1e6b37);}(_0xee1a,0x16c));var _0xaee1=function(_0x4a2ae5,_0x174a0a){_0x4a2ae5=_0x4a2ae5-0x0;var _0x44422e=_0xee1a[_0x4a2ae5];return _0x44422e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaee1('0x0'));var rimraf=require(_0xaee1('0x1'));var zipdir=require(_0xaee1('0x2'));var jsonpatch=require(_0xaee1('0x3'));var rp=require(_0xaee1('0x4'));var moment=require(_0xaee1('0x5'));var BPromise=require(_0xaee1('0x6'));var Mustache=require(_0xaee1('0x7'));var util=require(_0xaee1('0x8'));var path=require(_0xaee1('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaee1('0xa'));var fs=require('fs');var _=require(_0xaee1('0xb'));var squel=require(_0xaee1('0xc'));var crypto=require('crypto');var jsforce=require(_0xaee1('0xd'));var deskjs=require(_0xaee1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaee1('0xf'));var Papa=require(_0xaee1('0x10'));var authService=require(_0xaee1('0x11'));var hardwareService=require(_0xaee1('0x12'));var Redis=require(_0xaee1('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0xaee1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xaee1('0x15'));var db=require(_0xaee1('0x16'))['db'];config['redis']=_[_0xaee1('0x17')](config[_0xaee1('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xaee1('0x19'))(new Redis(config[_0xaee1('0x18')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x83c3a4,_0xba3421){_0xba3421=_0xba3421||0xcc;return function(_0x5573e2){if(_0x5573e2){return _0x83c3a4[_0xaee1('0x1a')](_0xba3421);}return _0x83c3a4[_0xaee1('0x1b')](_0xba3421)[_0xaee1('0x1c')]();};}function respondWithResult(_0x362363,_0x256757){_0x256757=_0x256757||0xc8;return function(_0x53801e){if(_0x53801e){return _0x362363[_0xaee1('0x1b')](_0x256757)[_0xaee1('0x1d')](_0x53801e);}};}function respondWithFilteredResult(_0x5d3fcf,_0x13e6ec){return function(_0x14a445){if(_0x14a445){var _0x214f16=_0x14a445[_0xaee1('0x1e')],_0x6f8b73=_0x13e6ec[_0xaee1('0x1f')],_0x3366ab=_0x13e6ec[_0xaee1('0x1f')]+_0x13e6ec[_0xaee1('0x20')],_0x10e327;if(_0x3366ab>=_0x214f16){_0x3366ab=_0x214f16;_0x10e327=0xc8;}else{_0x10e327=0xce;}_0x5d3fcf[_0xaee1('0x1b')](_0x10e327);return _0x5d3fcf[_0xaee1('0x21')]('Content-Range',_0x6f8b73+'-'+_0x3366ab+'/'+_0x214f16)[_0xaee1('0x1d')](_0x14a445);}return null;};}function patchUpdates(_0xe92570){return function(_0x57ef87){try{jsonpatch[_0xaee1('0x22')](_0x57ef87,_0xe92570,!![]);}catch(_0x4bf762){return BPromise[_0xaee1('0x23')](_0x4bf762);}return _0x57ef87[_0xaee1('0x24')]();};}function saveUpdates(_0x14bada,_0x4682ce){return function(_0x1f4f3c){if(_0x1f4f3c){return _0x1f4f3c[_0xaee1('0x25')](_0x14bada)[_0xaee1('0x26')](function(_0x40b818){return _0x40b818;});}return null;};}function removeEntity(_0x42528d,_0x228b5a){return function(_0x1062fe){if(_0x1062fe){return _0x1062fe[_0xaee1('0x27')]()['then'](function(){var _0x2487b7=_0x1062fe[_0xaee1('0x28')]({'plain':!![]});var _0x3a57ec=_0xaee1('0x29');return db[_0xaee1('0x2a')][_0xaee1('0x27')]({'where':{'type':_0x3a57ec,'resourceId':_0x2487b7['id']}})[_0xaee1('0x26')](function(){return _0x1062fe;});})[_0xaee1('0x26')](function(){_0x42528d[_0xaee1('0x1b')](0xcc)[_0xaee1('0x1c')]();});}};}function handleEntityNotFound(_0x3bf743,_0x410b26){return function(_0x222cbd){if(!_0x222cbd){_0x3bf743[_0xaee1('0x1a')](0x194);}return _0x222cbd;};}function handleError(_0x43ddac,_0x308c33){_0x308c33=_0x308c33||0x1f4;return function(_0x348e4c){logger['error'](_0x348e4c[_0xaee1('0x2b')]);if(_0x348e4c['name']){delete _0x348e4c[_0xaee1('0x2c')];}_0x43ddac['status'](_0x308c33)[_0xaee1('0x2d')](_0x348e4c);};}exports['index']=function(_0x30eaf1,_0x513fb5){var _0x364c24={},_0x23e05d={},_0xeccf1d={'count':0x0,'rows':[]};var _0x3515fa=db[_0xaee1('0x2e')][_0xaee1('0x2f')];_0x23e05d[_0xaee1('0x30')]=_[_0xaee1('0x31')](_0x3515fa);_0x23e05d[_0xaee1('0x32')]=_[_0xaee1('0x31')](_0x30eaf1[_0xaee1('0x32')]);_0x23e05d[_0xaee1('0x33')]=_[_0xaee1('0x34')](_0x23e05d['model'],_0x23e05d[_0xaee1('0x32')]);_0x364c24[_0xaee1('0x35')]=_[_0xaee1('0x34')](_0x23e05d[_0xaee1('0x30')],qs['fields'](_0x30eaf1[_0xaee1('0x32')][_0xaee1('0x36')]));_0x364c24[_0xaee1('0x35')]=_0x364c24['attributes'][_0xaee1('0x37')]?_0x364c24[_0xaee1('0x35')]:_0x23e05d['model'];if(!_0x30eaf1[_0xaee1('0x32')][_0xaee1('0x38')](_0xaee1('0x39'))){_0x364c24[_0xaee1('0x20')]=qs[_0xaee1('0x20')](_0x30eaf1[_0xaee1('0x32')][_0xaee1('0x20')]);_0x364c24[_0xaee1('0x1f')]=qs[_0xaee1('0x1f')](_0x30eaf1[_0xaee1('0x32')][_0xaee1('0x1f')]);}_0x364c24['order']=qs[_0xaee1('0x3a')](_0x30eaf1[_0xaee1('0x32')]['sort']);_0x364c24[_0xaee1('0x3b')]=qs[_0xaee1('0x33')](_[_0xaee1('0x3c')](_0x30eaf1[_0xaee1('0x32')],_0x23e05d[_0xaee1('0x33')]));if(_0x30eaf1[_0xaee1('0x32')][_0xaee1('0x3d')]){_0x364c24[_0xaee1('0x3b')]=_[_0xaee1('0x3e')](_0x364c24[_0xaee1('0x3b')],{'$or':_[_0xaee1('0x3f')](_0x3515fa,function(_0x1e845c){if(_0x1e845c[_0xaee1('0x40')]['key']!==_0xaee1('0x41')){var _0x5bbc5f={};_0x5bbc5f[_0x1e845c['field']]={'$like':'%'+_0x30eaf1['query'][_0xaee1('0x3d')]+'%'};return _0x5bbc5f;}})});}_0x364c24=_[_0xaee1('0x3e')]({},_0x364c24,_0x30eaf1[_0xaee1('0x42')]);var _0x1b8629={'where':_0x364c24['where']};return db['CmList'][_0xaee1('0x1e')](_0x1b8629)['then'](function(_0x48f88e){_0xeccf1d[_0xaee1('0x1e')]=_0x48f88e;if(_0x30eaf1[_0xaee1('0x32')]['includeAll']){_0x364c24[_0xaee1('0x43')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x364c24);})[_0xaee1('0x26')](function(_0x1538de){_0xeccf1d[_0xaee1('0x44')]=_0x1538de;return _0xeccf1d;})['then'](respondWithFilteredResult(_0x513fb5,_0x364c24))[_0xaee1('0x45')](handleError(_0x513fb5,null));};exports[_0xaee1('0x46')]=function(_0x1cd434,_0x194ddd){var _0x1a106={'raw':![],'where':{'id':_0x1cd434[_0xaee1('0x47')]['id']}},_0x19908d={};_0x19908d[_0xaee1('0x30')]=_['keys'](db[_0xaee1('0x2e')][_0xaee1('0x2f')]);_0x19908d[_0xaee1('0x32')]=_[_0xaee1('0x31')](_0x1cd434[_0xaee1('0x32')]);_0x19908d[_0xaee1('0x33')]=_[_0xaee1('0x34')](_0x19908d['model'],_0x19908d[_0xaee1('0x32')]);_0x1a106[_0xaee1('0x35')]=_[_0xaee1('0x34')](_0x19908d[_0xaee1('0x30')],qs[_0xaee1('0x36')](_0x1cd434[_0xaee1('0x32')][_0xaee1('0x36')]));_0x1a106[_0xaee1('0x35')]=_0x1a106[_0xaee1('0x35')][_0xaee1('0x37')]?_0x1a106[_0xaee1('0x35')]:_0x19908d[_0xaee1('0x30')];if(_0x1cd434[_0xaee1('0x32')]['includeAll']){_0x1a106['include']=[{'all':!![]}];}_0x1a106=_['merge']({},_0x1a106,_0x1cd434[_0xaee1('0x42')]);return db[_0xaee1('0x2e')]['find'](_0x1a106)[_0xaee1('0x26')](handleEntityNotFound(_0x194ddd,null))[_0xaee1('0x26')](respondWithResult(_0x194ddd,null))['catch'](handleError(_0x194ddd,null));};exports[_0xaee1('0x48')]=function(_0x5e9602,_0x123541){return db[_0xaee1('0x2e')][_0xaee1('0x48')](_0x5e9602[_0xaee1('0x49')],{})[_0xaee1('0x26')](function(_0x5a9c09){var _0x5ebeb1=_0x5e9602[_0xaee1('0x4a')][_0xaee1('0x28')]({'plain':!![]});if(!_0x5ebeb1)throw new Error(_0xaee1('0x4b'));if(_0x5ebeb1[_0xaee1('0x4c')]===_0xaee1('0x4a')){var _0x48a04c=_0x5a9c09['get']({'plain':!![]});var _0x17be9d=_0xaee1('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x17be9d,'userProfileId':_0x5ebeb1['userProfileId']},'raw':!![]})['then'](function(_0x59345a){if(_0x59345a&&_0x59345a[_0xaee1('0x4d')]===0x0){return db[_0xaee1('0x2a')][_0xaee1('0x48')]({'name':_0x48a04c[_0xaee1('0x2c')],'resourceId':_0x48a04c['id'],'type':_0x59345a[_0xaee1('0x2c')],'sectionId':_0x59345a['id']},{})[_0xaee1('0x26')](function(){return _0x5a9c09;});}else{return _0x5a9c09;}})[_0xaee1('0x45')](function(_0x58c812){logger[_0xaee1('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58c812);throw _0x58c812;});}return _0x5a9c09;})[_0xaee1('0x26')](respondWithResult(_0x123541,0xc9))[_0xaee1('0x45')](handleError(_0x123541,null));};exports['update']=function(_0x16f8ba,_0x2d74ad){if(_0x16f8ba[_0xaee1('0x49')]['id']){delete _0x16f8ba[_0xaee1('0x49')]['id'];}return db[_0xaee1('0x2e')][_0xaee1('0x4f')]({'where':{'id':_0x16f8ba['params']['id']}})['then'](handleEntityNotFound(_0x2d74ad,null))[_0xaee1('0x26')](saveUpdates(_0x16f8ba[_0xaee1('0x49')],null))[_0xaee1('0x26')](respondWithResult(_0x2d74ad,null))['catch'](handleError(_0x2d74ad,null));};exports[_0xaee1('0x27')]=function(_0x182d88,_0x137c9f){return db['CmList'][_0xaee1('0x4f')]({'where':{'id':_0x182d88[_0xaee1('0x47')]['id']}})['then'](handleEntityNotFound(_0x137c9f,null))[_0xaee1('0x26')](removeEntity(_0x137c9f,null))[_0xaee1('0x45')](handleError(_0x137c9f,null));};exports[_0xaee1('0x50')]=function(_0x4ebffe,_0x41c544){return db[_0xaee1('0x2e')][_0xaee1('0x50')]()[_0xaee1('0x26')](respondWithResult(_0x41c544,null))[_0xaee1('0x45')](handleError(_0x41c544,null));};exports['addDisposition']=function(_0x3a0fa1,_0x1686d1,_0x209735){if(_0x3a0fa1[_0xaee1('0x49')]['id']){delete _0x3a0fa1[_0xaee1('0x49')]['id'];}return db['CmList'][_0xaee1('0x4f')]({'where':{'id':_0x3a0fa1[_0xaee1('0x47')]['id']}})[_0xaee1('0x26')](handleEntityNotFound(_0x1686d1,null))[_0xaee1('0x26')](function(_0x4885e5){if(_0x4885e5){_0x3a0fa1[_0xaee1('0x49')][_0xaee1('0x51')]=_0x4885e5['id'];return db[_0xaee1('0x52')][_0xaee1('0x48')](_0x3a0fa1[_0xaee1('0x49')]);}})[_0xaee1('0x26')](respondWithResult(_0x1686d1,null))[_0xaee1('0x45')](handleError(_0x1686d1,null));};exports[_0xaee1('0x53')]=function(_0x165a48,_0xc68a7f,_0x4169ce){var _0x4ec642={'raw':![],'where':{}};var _0x525bac={};var _0x2b0e67={'count':0x0,'rows':[]};return db[_0xaee1('0x2e')]['findOne']({'where':{'id':_0x165a48[_0xaee1('0x47')]['id']}})['then'](handleEntityNotFound(_0xc68a7f,null))['then'](function(_0x167f82){if(_0x167f82){_0x525bac[_0xaee1('0x30')]=_[_0xaee1('0x31')](db[_0xaee1('0x52')][_0xaee1('0x2f')]);_0x525bac[_0xaee1('0x32')]=_[_0xaee1('0x31')](_0x165a48[_0xaee1('0x32')]);_0x525bac[_0xaee1('0x33')]=_[_0xaee1('0x34')](_0x525bac[_0xaee1('0x30')],_0x525bac[_0xaee1('0x32')]);_0x4ec642[_0xaee1('0x35')]=_['intersection'](_0x525bac[_0xaee1('0x30')],qs[_0xaee1('0x36')](_0x165a48[_0xaee1('0x32')][_0xaee1('0x36')]));_0x4ec642['attributes']=_0x4ec642['attributes'][_0xaee1('0x37')]?_0x4ec642[_0xaee1('0x35')]:_0x525bac['model'];if(!_0x165a48['query'][_0xaee1('0x38')](_0xaee1('0x39'))){_0x4ec642[_0xaee1('0x20')]=qs[_0xaee1('0x20')](_0x165a48[_0xaee1('0x32')]['limit']);_0x4ec642['offset']=qs[_0xaee1('0x1f')](_0x165a48[_0xaee1('0x32')][_0xaee1('0x1f')]);}_0x4ec642[_0xaee1('0x54')]=qs['sort'](_0x165a48['query'][_0xaee1('0x3a')]);_0x4ec642['where']=qs[_0xaee1('0x33')](_[_0xaee1('0x3c')](_0x165a48[_0xaee1('0x32')],_0x525bac['filters']));_0x4ec642['where'][_0xaee1('0x51')]=_0x167f82['id'];if(_0x165a48[_0xaee1('0x32')][_0xaee1('0x3d')]){_0x4ec642[_0xaee1('0x3b')]=_[_0xaee1('0x3e')](_0x4ec642[_0xaee1('0x3b')],{'$or':_[_0xaee1('0x3f')](_0x4ec642['attributes'],function(_0x4deaaf){var _0x4c1a09={};_0x4c1a09[_0x4deaaf]={'$like':'%'+_0x165a48[_0xaee1('0x32')][_0xaee1('0x3d')]+'%'};return _0x4c1a09;})});}_0x4ec642=_[_0xaee1('0x3e')]({},_0x4ec642,_0x165a48[_0xaee1('0x42')]);return db[_0xaee1('0x52')]['count']({'where':_0x4ec642[_0xaee1('0x3b')]})[_0xaee1('0x26')](function(_0x3deb1b){_0x2b0e67[_0xaee1('0x1e')]=_0x3deb1b;if(_0x165a48[_0xaee1('0x32')][_0xaee1('0x55')]){_0x4ec642[_0xaee1('0x43')]=[{'all':!![]}];}return db['Disposition'][_0xaee1('0x56')](_0x4ec642);})[_0xaee1('0x26')](function(_0x3b941d){_0x2b0e67[_0xaee1('0x44')]=_0x3b941d;return _0x2b0e67;});}})[_0xaee1('0x26')](respondWithFilteredResult(_0xc68a7f,_0x4ec642))[_0xaee1('0x45')](handleError(_0xc68a7f,null));};exports[_0xaee1('0x57')]=function(_0x290c3d,_0x186630,_0x576d11){var _0x142a00;return db[_0xaee1('0x2e')]['find']({'where':{'id':_0x290c3d[_0xaee1('0x47')]['id']}})[_0xaee1('0x26')](handleEntityNotFound(_0x186630,null))[_0xaee1('0x26')](function(_0x244050){if(_0x244050){return _0x244050[_0xaee1('0x57')](_0x290c3d[_0xaee1('0x32')][_0xaee1('0x58')]);}})[_0xaee1('0x26')](respondWithStatusCode(_0x186630,null))[_0xaee1('0x45')](handleError(_0x186630,null));};exports[_0xaee1('0x59')]=function(_0x428f1a,_0x7158f3,_0x52eff9){return db[_0xaee1('0x2e')]['find']({'where':{'id':_0x428f1a[_0xaee1('0x47')]['id']}})[_0xaee1('0x26')](handleEntityNotFound(_0x7158f3,null))[_0xaee1('0x26')](function(_0xb708e4){if(_0xb708e4){var _0x1aac57=[];var _0xf11752={'success':[],'errors':[]};return db[_0xaee1('0x5a')][_0xaee1('0x50')]()[_0xaee1('0x26')](function(_0x1cab92){if(_0x428f1a[_0xaee1('0x49')]['tags']&&_['isArray'](_0x428f1a['body']['tags'])){if(_0x428f1a['body']['tags'][_0xaee1('0x37')]){_0x428f1a[_0xaee1('0x49')][_0xaee1('0x5b')]=_0x428f1a['body'][_0xaee1('0x5b')][_0xaee1('0x5c')](';')+';';}else{_0x428f1a[_0xaee1('0x49')][_0xaee1('0x5b')]=null;}}else{_0x428f1a[_0xaee1('0x49')]['tags']=null;}if(_0x428f1a[_0xaee1('0x49')]&&_[_0xaee1('0x5d')](_0x428f1a[_0xaee1('0x49')])){for(var _0x5c8014=0x0;_0x5c8014<_0x428f1a['body'][_0xaee1('0x37')];_0x5c8014+=0x1){_0x428f1a[_0xaee1('0x49')][_0x5c8014]['ListId']=_0x428f1a[_0xaee1('0x47')]['id'];_0x1aac57[_0xaee1('0x5e')](_0x428f1a[_0xaee1('0x49')][_0x5c8014]);}return BPromise[_0xaee1('0x5f')](_0x1aac57,function(_0x28ce49){return db[_0xaee1('0x5a')][_0xaee1('0x48')](_[_0xaee1('0x60')](_0x28ce49,['ids','id'])||{},{'fields':_[_0xaee1('0x31')](_0x1cab92),'raw':!![]})[_0xaee1('0x26')](function(_0xdb834c){_0xf11752[_0xaee1('0x61')]['push'](_0xdb834c[_0xaee1('0x62')]);})[_0xaee1('0x45')](function(_0x3ca226){_0xf11752[_0xaee1('0x63')][_0xaee1('0x5e')]({'data':_0x28ce49,'error':_0x3ca226[_0xaee1('0x64')]});});})[_0xaee1('0x26')](function(_0x8ff40d){return _0xf11752;})[_0xaee1('0x45')](function(_0x1007d8){return _0x1007d8;});}else{_0x7158f3[_0xaee1('0x1b')](0x190)[_0xaee1('0x1d')]({'message':_0xaee1('0x65')});}});}})[_0xaee1('0x26')](respondWithResult(_0x7158f3,null))[_0xaee1('0x45')](handleError(_0x7158f3,null));};exports['getContacts']=function(_0x13ab30,_0x225afc,_0x570851){var _0x11848b;return db[_0xaee1('0x2e')][_0xaee1('0x4f')]({'where':{'id':_0x13ab30[_0xaee1('0x47')]['id']},'include':[{'model':db[_0xaee1('0x66')],'as':'CustomFields'}]})[_0xaee1('0x26')](handleEntityNotFound(_0x225afc,null))[_0xaee1('0x26')](function(_0x5eef3d){if(_0x5eef3d){_0x11848b=_0x5eef3d;return db[_0xaee1('0x5a')][_0xaee1('0x2f')];}})['then'](function(_0x535796){if(_0x535796){var _0x3c2b7b={};var _0x3fee96={};_0x3fee96[_0xaee1('0x30')]=_[_0xaee1('0x67')](_['keys'](_0x535796),_[_0xaee1('0x3f')](_0x11848b[_0xaee1('0x68')],function(_0x5a56e7){return util[_0xaee1('0x69')](_0xaee1('0x6a'),_0x5a56e7['id']);}));_0x3fee96[_0xaee1('0x32')]=_[_0xaee1('0x31')](_0x13ab30[_0xaee1('0x32')]);_0x3fee96[_0xaee1('0x33')]=_[_0xaee1('0x34')](_0x3fee96['model'],_0x3fee96[_0xaee1('0x32')]);_0x3c2b7b['attributes']=_[_0xaee1('0x34')](_0x3fee96[_0xaee1('0x30')],qs[_0xaee1('0x36')](_0x13ab30[_0xaee1('0x32')][_0xaee1('0x36')]));_0x3c2b7b[_0xaee1('0x35')]=_0x3c2b7b[_0xaee1('0x35')][_0xaee1('0x37')]?_0x3c2b7b[_0xaee1('0x35')]:_0x3fee96[_0xaee1('0x30')];if(!_0x13ab30[_0xaee1('0x32')][_0xaee1('0x38')](_0xaee1('0x39'))){_0x3c2b7b[_0xaee1('0x20')]=qs[_0xaee1('0x20')](_0x13ab30[_0xaee1('0x32')][_0xaee1('0x20')]);_0x3c2b7b[_0xaee1('0x1f')]=qs[_0xaee1('0x1f')](_0x13ab30[_0xaee1('0x32')][_0xaee1('0x1f')]);}_0x3c2b7b['order']=qs[_0xaee1('0x3a')](_0x13ab30[_0xaee1('0x32')]['sort']);_0x3c2b7b['where']=qs[_0xaee1('0x33')](_[_0xaee1('0x3c')](_0x13ab30[_0xaee1('0x32')],_0x3fee96['filters']));_0x3c2b7b[_0xaee1('0x6b')]=!![];if(_0x13ab30[_0xaee1('0x32')][_0xaee1('0x3d')]){_0x3c2b7b['where']=_['merge'](_0x3c2b7b[_0xaee1('0x3b')],{'$or':_['map'](_0x3c2b7b[_0xaee1('0x35')],function(_0x255ba2){var _0x50d867={};_0x50d867[_0x255ba2]={'$like':'%'+_0x13ab30[_0xaee1('0x32')][_0xaee1('0x3d')]+'%'};return _0x50d867;})});}_0x3c2b7b=_['merge']({},_0x3c2b7b,_0x13ab30[_0xaee1('0x42')]);return _0x11848b['getContacts'](_0x3c2b7b);}})[_0xaee1('0x26')](respondWithResult(_0x225afc,null))[_0xaee1('0x45')](handleError(_0x225afc,null));};exports[_0xaee1('0x6c')]=function(_0x2567ad,_0x527235,_0x3efc36){var _0x501a6e;return db[_0xaee1('0x2e')][_0xaee1('0x4f')]({'where':{'id':_0x2567ad[_0xaee1('0x47')]['id']},'include':[{'model':db[_0xaee1('0x66')],'as':_0xaee1('0x68')}]})[_0xaee1('0x26')](handleEntityNotFound(_0x527235,null))[_0xaee1('0x26')](function(_0x394b19){if(_0x394b19){_0x501a6e=_0x394b19;return db[_0xaee1('0x5a')][_0xaee1('0x2f')];}})[_0xaee1('0x26')](function(_0x25dd14){if(_0x25dd14){var _0x401eb8={};var _0x302de1={};_0x302de1[_0xaee1('0x30')]=_['concat'](_[_0xaee1('0x31')](_0x25dd14),_['map'](_0x501a6e['CustomFields'],function(_0x4f0d7e){return util['format'](_0xaee1('0x6a'),_0x4f0d7e['id']);}));_0x302de1[_0xaee1('0x32')]=_[_0xaee1('0x31')](_0x2567ad['query']);_0x302de1[_0xaee1('0x33')]=_['intersection'](_0x302de1[_0xaee1('0x30')],_0x302de1['query']);_0x401eb8[_0xaee1('0x35')]=_[_0xaee1('0x34')](_0x302de1[_0xaee1('0x30')],qs[_0xaee1('0x36')](_0x2567ad[_0xaee1('0x32')]['fields']));_0x401eb8['attributes']=_0x401eb8[_0xaee1('0x35')][_0xaee1('0x37')]?_0x401eb8[_0xaee1('0x35')]:_0x302de1['model'];if(!_0x2567ad[_0xaee1('0x32')]['hasOwnProperty'](_0xaee1('0x39'))){_0x401eb8[_0xaee1('0x20')]=qs[_0xaee1('0x20')](_0x2567ad[_0xaee1('0x32')][_0xaee1('0x20')]);_0x401eb8[_0xaee1('0x1f')]=qs[_0xaee1('0x1f')](_0x2567ad[_0xaee1('0x32')]['offset']);}_0x401eb8['order']=qs[_0xaee1('0x3a')](_0x2567ad[_0xaee1('0x32')]['sort']);_0x401eb8['where']=qs[_0xaee1('0x33')](_[_0xaee1('0x3c')](_0x2567ad[_0xaee1('0x32')],_0x302de1[_0xaee1('0x33')]));_0x401eb8[_0xaee1('0x6b')]=!![];if(_0x2567ad[_0xaee1('0x32')][_0xaee1('0x3d')]){_0x401eb8['where']=_[_0xaee1('0x3e')](_0x401eb8[_0xaee1('0x3b')],{'$or':_[_0xaee1('0x3f')](_0x401eb8['attributes'],function(_0x3ec55e){var _0x4408d8={};_0x4408d8[_0x3ec55e]={'$like':'%'+_0x2567ad[_0xaee1('0x32')]['filter']+'%'};return _0x4408d8;})});}_0x401eb8=_[_0xaee1('0x3e')]({},_0x401eb8,_0x2567ad[_0xaee1('0x42')]);return _0x501a6e['getContacts'](_0x401eb8);}})['then'](function(_0xf8d042){if(!_['isEmpty'](_0xf8d042)){var _0x5c4669=toCsv(_0xf8d042);var _0x40bfda=Date[_0xaee1('0x6d')]();fs[_0xaee1('0x6e')](util[_0xaee1('0x69')](_0xaee1('0x6f'),_0x501a6e['id'],_0x40bfda),_0x5c4669);_0x527235[_0xaee1('0x70')](_0xaee1('0x71'),_0xaee1('0x72')+util[_0xaee1('0x69')](_0xaee1('0x73'),_0x501a6e['id'],_0x40bfda));_0x527235[_0xaee1('0x70')](_0xaee1('0x74'),'text/csv');return _0x527235['download'](util[_0xaee1('0x69')](_0xaee1('0x6f'),_0x501a6e['id'],_0x40bfda));}else{return _0x527235[_0xaee1('0x1a')](0xcc);}})['catch'](handleError(_0x527235,null));};exports['addCustomField']=function(_0x50086e,_0x557ddc,_0x3fe910){var _0x20e678;delete _0x50086e[_0xaee1('0x49')]['id'];return db[_0xaee1('0x2e')][_0xaee1('0x75')]({'where':{'id':_0x50086e[_0xaee1('0x47')]['id']}})['then'](handleEntityNotFound(_0x557ddc,null))[_0xaee1('0x26')](function(_0x1e0771){if(_0x1e0771){return db[_0xaee1('0x76')]['transaction'](function(_0x493114){return db[_0xaee1('0x66')][_0xaee1('0x48')](_0x50086e['body'],{'transaction':_0x493114})[_0xaee1('0x26')](function(_0x4f3cbf){_0x20e678=_0x4f3cbf;return _0x1e0771[_0xaee1('0x77')](_0x4f3cbf,{'transaction':_0x493114});})[_0xaee1('0x26')](function(){var _0xdb77c3={'type':db[_0xaee1('0x78')][_0xaee1('0x79')],'transaction':_0x493114};switch(_0x50086e[_0xaee1('0x49')]['type']){case _0xaee1('0x7a'):_0xdb77c3[_0xaee1('0x40')]=db[_0xaee1('0x78')][_0xaee1('0x79')];break;case _0xaee1('0x7b'):_0xdb77c3[_0xaee1('0x40')]=db[_0xaee1('0x78')]['INTEGER'];break;case'switch':_0xdb77c3[_0xaee1('0x40')]=db[_0xaee1('0x78')][_0xaee1('0x7c')];_0xdb77c3[_0xaee1('0x7d')]=![];break;default:}return db['sequelize']['queryInterface']['addColumn'](_0xaee1('0x7e'),util['format'](_0xaee1('0x7f'),_0x20e678['id']),_0xdb77c3);})['then'](function(){return _0x20e678;});});}})[_0xaee1('0x26')](respondWithResult(_0x557ddc,null))['catch'](handleError(_0x557ddc,null));};exports[_0xaee1('0x80')]=function(_0x1c21e5,_0x2329e8,_0x3358f5){var _0x5577f6={};var _0x2e53bf={};var _0x1183a2;var _0x39b5a;return db[_0xaee1('0x2e')]['findOne']({'where':{'id':_0x1c21e5['params']['id']}})['then'](handleEntityNotFound(_0x2329e8,null))[_0xaee1('0x26')](function(_0x193b60){if(_0x193b60){_0x1183a2=_0x193b60;_0x2e53bf[_0xaee1('0x30')]=_[_0xaee1('0x31')](db[_0xaee1('0x66')][_0xaee1('0x2f')]);_0x2e53bf[_0xaee1('0x32')]=_['keys'](_0x1c21e5['query']);_0x2e53bf[_0xaee1('0x33')]=_['intersection'](_0x2e53bf[_0xaee1('0x30')],_0x2e53bf[_0xaee1('0x32')]);_0x5577f6[_0xaee1('0x35')]=_['intersection'](_0x2e53bf[_0xaee1('0x30')],qs[_0xaee1('0x36')](_0x1c21e5[_0xaee1('0x32')]['fields']));_0x5577f6[_0xaee1('0x35')]=_0x5577f6[_0xaee1('0x35')]['length']?_0x5577f6[_0xaee1('0x35')]:_0x2e53bf['model'];_0x5577f6['order']=qs[_0xaee1('0x3a')](_0x1c21e5[_0xaee1('0x32')][_0xaee1('0x3a')]);_0x5577f6[_0xaee1('0x3b')]=qs[_0xaee1('0x33')](_[_0xaee1('0x3c')](_0x1c21e5[_0xaee1('0x32')],_0x2e53bf[_0xaee1('0x33')]));_0x5577f6[_0xaee1('0x3b')]=_['merge'](_0x5577f6['where'],{'$or':[{'ListId':_0x193b60['id']},{'ListId':null}]});if(_0x1c21e5['query'][_0xaee1('0x3d')]){_0x5577f6[_0xaee1('0x3b')]=_['merge'](_0x5577f6[_0xaee1('0x3b')],{'$or':_['map'](_0x5577f6['attributes'],function(_0x4579ae){var _0x515eb6={};_0x515eb6[_0x4579ae]={'$like':'%'+_0x1c21e5[_0xaee1('0x32')]['filter']+'%'};return _0x515eb6;})});}_0x5577f6=_['merge']({},_0x5577f6,_0x1c21e5[_0xaee1('0x42')]);return db[_0xaee1('0x66')][_0xaee1('0x81')](_0x5577f6);}})['then'](respondWithResult(_0x2329e8,null))[_0xaee1('0x45')](handleError(_0x2329e8,null));};exports[_0xaee1('0x82')]=function(_0x56b2a4,_0x344d48,_0x337797){return db[_0xaee1('0x2e')][_0xaee1('0x4f')]({'where':{'id':_0x56b2a4[_0xaee1('0x47')]['id']}})['then'](handleEntityNotFound(_0x344d48,null))['then'](function(_0x596382){if(_0x596382){return _0x596382['addAgents'](_0x56b2a4[_0xaee1('0x49')]['ids'],_['omit'](_0x56b2a4['body'],[_0xaee1('0x58'),'id'])||{})['spread'](function(_0x53a96c){for(var _0x41271d=0x0;_0x41271d<_0x56b2a4[_0xaee1('0x49')][_0xaee1('0x58')][_0xaee1('0x37')];_0x41271d+=0x1){socket[_0xaee1('0x83')](_0xaee1('0x84'),{'UserId':_0x56b2a4[_0xaee1('0x49')][_0xaee1('0x58')][_0x41271d],'CmListId':_0x56b2a4[_0xaee1('0x47')]['id']});}return _0x53a96c;});}})['then'](respondWithResult(_0x344d48,null))[_0xaee1('0x45')](handleError(_0x344d48,null));};exports[_0xaee1('0x85')]=function(_0x2406a0,_0x2a0e21,_0x140bb0){var _0xf69080;return db[_0xaee1('0x2e')]['find']({'where':{'id':_0x2406a0[_0xaee1('0x47')]['id']}})[_0xaee1('0x26')](handleEntityNotFound(_0x2a0e21,null))['then'](function(_0xc7783e){if(_0xc7783e){return _0xc7783e[_0xaee1('0x85')](_0x2406a0[_0xaee1('0x32')][_0xaee1('0x58')])[_0xaee1('0x26')](function(_0x50e0ad){if(_[_0xaee1('0x5d')](_0x2406a0[_0xaee1('0x32')][_0xaee1('0x58')])){for(var _0x408fb6=0x0;_0x408fb6<_0x2406a0['query']['ids'][_0xaee1('0x37')];_0x408fb6+=0x1){socket[_0xaee1('0x83')]('userCmList:remove',{'UserId':_0x2406a0[_0xaee1('0x32')][_0xaee1('0x58')][_0x408fb6],'CmListId':_0x2406a0[_0xaee1('0x47')]['id']});}}else{socket[_0xaee1('0x83')]('userCmList:remove',{'UserId':_0x2406a0[_0xaee1('0x32')][_0xaee1('0x58')],'CmListId':_0x2406a0[_0xaee1('0x47')]['id']});}});}})[_0xaee1('0x26')](respondWithStatusCode(_0x2a0e21,null))[_0xaee1('0x45')](handleError(_0x2a0e21,null));};exports['getAgents']=function(_0x410ba5,_0xd44dd4,_0x477dc9){var _0x487ef9={};var _0x30f620={};var _0x2c5c44;var _0x237249;return db['CmList'][_0xaee1('0x75')]({'where':{'id':_0x410ba5[_0xaee1('0x47')]['id']}})[_0xaee1('0x26')](handleEntityNotFound(_0xd44dd4,null))[_0xaee1('0x26')](function(_0x2ff3f8){if(_0x2ff3f8){_0x2c5c44=_0x2ff3f8;_0x30f620[_0xaee1('0x30')]=_[_0xaee1('0x31')](db[_0xaee1('0x86')][_0xaee1('0x2f')]);_0x30f620[_0xaee1('0x32')]=_[_0xaee1('0x31')](_0x410ba5[_0xaee1('0x32')]);_0x30f620[_0xaee1('0x33')]=_['intersection'](_0x30f620[_0xaee1('0x30')],_0x30f620[_0xaee1('0x32')]);_0x487ef9[_0xaee1('0x35')]=_['intersection'](_0x30f620[_0xaee1('0x30')],qs[_0xaee1('0x36')](_0x410ba5['query'][_0xaee1('0x36')]));_0x487ef9[_0xaee1('0x35')]=_0x487ef9['attributes'][_0xaee1('0x37')]?_0x487ef9[_0xaee1('0x35')]:_0x30f620[_0xaee1('0x30')];_0x487ef9[_0xaee1('0x54')]=qs['sort'](_0x410ba5[_0xaee1('0x32')][_0xaee1('0x3a')]);_0x487ef9[_0xaee1('0x3b')]=qs[_0xaee1('0x33')](_[_0xaee1('0x3c')](_0x410ba5[_0xaee1('0x32')],_0x30f620[_0xaee1('0x33')]));if(_0x410ba5[_0xaee1('0x32')][_0xaee1('0x3d')]){_0x487ef9[_0xaee1('0x3b')]=_[_0xaee1('0x3e')](_0x487ef9[_0xaee1('0x3b')],{'$or':_[_0xaee1('0x3f')](_0x487ef9['attributes'],function(_0x340998){var _0x2f6099={};_0x2f6099[_0x340998]={'$like':'%'+_0x410ba5[_0xaee1('0x32')]['filter']+'%'};return _0x2f6099;})});}_0x487ef9=_[_0xaee1('0x3e')]({},_0x487ef9,_0x410ba5[_0xaee1('0x42')]);return _0x2c5c44[_0xaee1('0x87')](_0x487ef9);}})[_0xaee1('0x26')](function(_0x31aea1){if(_0x31aea1){_0x237249=_0x31aea1[_0xaee1('0x37')];if(!_0x410ba5['query']['hasOwnProperty'](_0xaee1('0x39'))){_0x487ef9[_0xaee1('0x20')]=qs[_0xaee1('0x20')](_0x410ba5[_0xaee1('0x32')][_0xaee1('0x20')]);_0x487ef9[_0xaee1('0x1f')]=qs['offset'](_0x410ba5['query'][_0xaee1('0x1f')]);}return _0x2c5c44[_0xaee1('0x87')](_0x487ef9);}})[_0xaee1('0x26')](function(_0x501159){if(_0x501159){return _0x501159?{'count':_0x237249,'rows':_0x501159}:null;}})[_0xaee1('0x26')](respondWithResult(_0xd44dd4,null))['catch'](handleError(_0xd44dd4,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 85d2613..0db6d99 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 _0x5646=['remove','hasOwnProperty','hook','exports','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x5df299,_0x3b0ca8){var _0x1ef409=function(_0x5cb343){while(--_0x5cb343){_0x5df299['push'](_0x5df299['shift']());}};_0x1ef409(++_0x3b0ca8);}(_0x5646,0x1c4));var _0x6564=function(_0x16a637,_0x5eb627){_0x16a637=_0x16a637-0x0;var _0x25126d=_0x5646[_0x16a637];return _0x25126d;};'use strict';var EventEmitter=require('events');var CmList=require(_0x6564('0x0'))['db'][_0x6564('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x6564('0x2')](0x0);var events={'afterCreate':_0x6564('0x3'),'afterUpdate':'update','afterDestroy':_0x6564('0x4')};function emitEvent(_0x22e3f8){return function(_0x203ea6,_0x303998,_0x350dfa){CmListEvents['emit'](_0x22e3f8+':'+_0x203ea6['id'],_0x203ea6);CmListEvents['emit'](_0x22e3f8,_0x203ea6);_0x350dfa(null);};}for(var e in events){if(events[_0x6564('0x5')](e)){var event=events[e];CmList[_0x6564('0x6')](e,emitEvent(event));}}module[_0x6564('0x7')]=CmListEvents; \ No newline at end of file +var _0xe397=['remove','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe397,0x162));var _0x7e39=function(_0x81dae,_0x4437c9){_0x81dae=_0x81dae-0x0;var _0x2cab87=_0xe397[_0x81dae];return _0x2cab87;};'use strict';var EventEmitter=require(_0x7e39('0x0'));var CmList=require(_0x7e39('0x1'))['db'][_0x7e39('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7e39('0x3')](0x0);var events={'afterCreate':_0x7e39('0x4'),'afterUpdate':_0x7e39('0x5'),'afterDestroy':_0x7e39('0x6')};function emitEvent(_0x28e554){return function(_0x575889,_0x887fcf,_0x30c22a){CmListEvents['emit'](_0x28e554+':'+_0x575889['id'],_0x575889);CmListEvents[_0x7e39('0x7')](_0x28e554,_0x575889);_0x30c22a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x7e39('0x8')](e,emitEvent(event));}}module[_0x7e39('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 1795786..b88bcab 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 _0x95ed=['exports','CmList','cm_lists','lodash','../../config/logger'];(function(_0x3adb96,_0x1f3dfc){var _0x4bfdb4=function(_0x30580a){while(--_0x30580a){_0x3adb96['push'](_0x3adb96['shift']());}};_0x4bfdb4(++_0x1f3dfc);}(_0x95ed,0x19d));var _0xd95e=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x95ed[_0xac151d];return _0x111dba;};'use strict';var _=require(_0xd95e('0x0'));var util=require('util');var logger=require(_0xd95e('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./cmList.attributes');module[_0xd95e('0x2')]=function(_0x24edd0,_0x30928e){return _0x24edd0['define'](_0xd95e('0x3'),attributes,{'tableName':_0xd95e('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd315=['CmList','util','../../config/logger','api','moment','bluebird','./cmList.attributes','exports','define'];(function(_0x3093ee,_0x2e3d20){var _0x48ac52=function(_0xe0cf38){while(--_0xe0cf38){_0x3093ee['push'](_0x3093ee['shift']());}};_0x48ac52(++_0x2e3d20);}(_0xd315,0xc7));var _0x5d31=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd315[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5d31('0x0'));var logger=require(_0x5d31('0x1'))(_0x5d31('0x2'));var moment=require(_0x5d31('0x3'));var BPromise=require(_0x5d31('0x4'));var rp=require('request-promise');var attributes=require(_0x5d31('0x5'));module[_0x5d31('0x6')]=function(_0x178f8b,_0x33b01e){return _0x178f8b[_0x5d31('0x7')](_0x5d31('0x8'),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 c64738a..9279a82 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 _0xcb78=['localhost','socket.io-emitter','request','then','info','request\x20sent','debug','error','code','message','CmList,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults'];(function(_0x4d440a,_0x2b8ecf){var _0x3a965e=function(_0x4f6cee){while(--_0x4f6cee){_0x4d440a['push'](_0x4d440a['shift']());}};_0x3a965e(++_0x2b8ecf);}(_0xcb78,0x69));var _0x8cb7=function(_0x39d289,_0x10b125){_0x39d289=_0x39d289-0x0;var _0x1c2b50=_0xcb78[_0x39d289];return _0x1c2b50;};'use strict';var _=require(_0x8cb7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8cb7('0x1'));var rs=require(_0x8cb7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cb7('0x3'))['db'];var utils=require(_0x8cb7('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x8cb7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8cb7('0x6')][_0x8cb7('0x7')]({'port':0x232a});config[_0x8cb7('0x8')]=_[_0x8cb7('0x9')](config['redis'],{'host':_0x8cb7('0xa'),'port':0x18eb});var socket=require(_0x8cb7('0xb'))(new Redis(config[_0x8cb7('0x8')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x20d8ce,_0x9a146c,_0x3b72e9){return new BPromise(function(_0x5a5326,_0x4c412e){return client[_0x8cb7('0xc')](_0x20d8ce,_0x3b72e9)[_0x8cb7('0xd')](function(_0x14eec8){logger[_0x8cb7('0xe')]('CmList,\x20%s,\x20%s',_0x9a146c,_0x8cb7('0xf'));logger[_0x8cb7('0x10')]('CmList,\x20%s,\x20%s,\x20%s',_0x9a146c,_0x8cb7('0xf'),JSON['stringify'](_0x14eec8));if(_0x14eec8[_0x8cb7('0x11')]){if(_0x14eec8[_0x8cb7('0x11')][_0x8cb7('0x12')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x9a146c,_0x14eec8[_0x8cb7('0x11')][_0x8cb7('0x13')]);return _0x4c412e(_0x14eec8[_0x8cb7('0x11')][_0x8cb7('0x13')]);}logger[_0x8cb7('0x11')](_0x8cb7('0x14'),_0x9a146c,_0x14eec8[_0x8cb7('0x11')][_0x8cb7('0x13')]);return _0x5a5326(_0x14eec8[_0x8cb7('0x11')][_0x8cb7('0x13')]);}else{logger[_0x8cb7('0xe')](_0x8cb7('0x14'),_0x9a146c,_0x8cb7('0xf'));_0x5a5326(_0x14eec8[_0x8cb7('0x15')][_0x8cb7('0x13')]);}})[_0x8cb7('0x16')](function(_0x3864f6){logger[_0x8cb7('0x11')](_0x8cb7('0x14'),_0x9a146c,_0x3864f6);_0x4c412e(_0x3864f6);});});} \ No newline at end of file +var _0xb123=['redis','localhost','./cmList.socket','register','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults'];(function(_0xd26e7f,_0x4136c){var _0x5c0ea2=function(_0x55af1d){while(--_0x55af1d){_0xd26e7f['push'](_0xd26e7f['shift']());}};_0x5c0ea2(++_0x4136c);}(_0xb123,0x90));var _0x3b12=function(_0x7a3247,_0x15cb12){_0x7a3247=_0x7a3247-0x0;var _0x1bfde5=_0xb123[_0x7a3247];return _0x1bfde5;};'use strict';var _=require(_0x3b12('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3b12('0x1'));var rs=require(_0x3b12('0x2'));var fs=require('fs');var Redis=require(_0x3b12('0x3'));var db=require(_0x3b12('0x4'))['db'];var utils=require(_0x3b12('0x5'));var logger=require(_0x3b12('0x6'))('rpc');var config=require(_0x3b12('0x7'));var jayson=require(_0x3b12('0x8'));var client=jayson[_0x3b12('0x9')][_0x3b12('0xa')]({'port':0x232a});config['redis']=_[_0x3b12('0xb')](config[_0x3b12('0xc')],{'host':_0x3b12('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b12('0xc')]));require(_0x3b12('0xe'))[_0x3b12('0xf')](socket);function respondWithRpcPromise(_0x2c515f,_0x3ed48d,_0x275ef5){return new BPromise(function(_0x3c7c2a,_0x19ca15){return client['request'](_0x2c515f,_0x275ef5)[_0x3b12('0x10')](function(_0x2896ad){logger['info'](_0x3b12('0x11'),_0x3ed48d,_0x3b12('0x12'));logger[_0x3b12('0x13')](_0x3b12('0x14'),_0x3ed48d,_0x3b12('0x12'),JSON[_0x3b12('0x15')](_0x2896ad));if(_0x2896ad['error']){if(_0x2896ad[_0x3b12('0x16')]['code']===0x1f4){logger[_0x3b12('0x16')](_0x3b12('0x11'),_0x3ed48d,_0x2896ad[_0x3b12('0x16')][_0x3b12('0x17')]);return _0x19ca15(_0x2896ad[_0x3b12('0x16')]['message']);}logger[_0x3b12('0x16')](_0x3b12('0x11'),_0x3ed48d,_0x2896ad['error']['message']);return _0x3c7c2a(_0x2896ad[_0x3b12('0x16')][_0x3b12('0x17')]);}else{logger[_0x3b12('0x18')](_0x3b12('0x11'),_0x3ed48d,_0x3b12('0x12'));_0x3c7c2a(_0x2896ad[_0x3b12('0x19')][_0x3b12('0x17')]);}})['catch'](function(_0x7ef2c7){logger['error'](_0x3b12('0x11'),_0x3ed48d,_0x7ef2c7);_0x19ca15(_0x7ef2c7);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index e278514..81c513c 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 _0xe948=['remove','update','emit','removeListener','register','save'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0xe948,0x119));var _0x8e94=function(_0x190979,_0x6a602c){_0x190979=_0x190979-0x0;var _0x50a166=_0xe948[_0x190979];return _0x50a166;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x8e94('0x0'),_0x8e94('0x1'),_0x8e94('0x2')];function createListener(_0x3cf0fc,_0x45a079){return function(_0x3cd99f){_0x45a079[_0x8e94('0x3')](_0x3cf0fc,_0x3cd99f);};}function removeListener(_0x1184df,_0x10d779){return function(){CmListEvents[_0x8e94('0x4')](_0x1184df,_0x10d779);};}exports[_0x8e94('0x5')]=function(_0x4c8e04){for(var _0x2782b0=0x0,_0x5d4b69=events['length'];_0x2782b0<_0x5d4b69;_0x2782b0++){var _0x385845=events[_0x2782b0];var _0x1670de=createListener('cmList:'+_0x385845,_0x4c8e04);CmListEvents['on'](_0x385845,_0x1670de);}}; \ No newline at end of file +var _0x11ee=['./cmList.events','save','remove','update','emit','removeListener','register','length','cmList:'];(function(_0x3101a5,_0x4e6168){var _0x436775=function(_0x398078){while(--_0x398078){_0x3101a5['push'](_0x3101a5['shift']());}};_0x436775(++_0x4e6168);}(_0x11ee,0x1dd));var _0xe11e=function(_0xc4376d,_0x2e6841){_0xc4376d=_0xc4376d-0x0;var _0x291524=_0x11ee[_0xc4376d];return _0x291524;};'use strict';var CmListEvents=require(_0xe11e('0x0'));var events=[_0xe11e('0x1'),_0xe11e('0x2'),_0xe11e('0x3')];function createListener(_0x48f911,_0x291e5b){return function(_0x5fcbe7){_0x291e5b[_0xe11e('0x4')](_0x48f911,_0x5fcbe7);};}function removeListener(_0x520e55,_0x10de5e){return function(){CmListEvents[_0xe11e('0x5')](_0x520e55,_0x10de5e);};}exports[_0xe11e('0x6')]=function(_0x198209){for(var _0x5e8a86=0x0,_0x2f46fb=events[_0xe11e('0x7')];_0x5e8a86<_0x2f46fb;_0x5e8a86++){var _0xda3980=events[_0x5e8a86];var _0x586f84=createListener(_0xe11e('0x8')+_0xda3980,_0x198209);CmListEvents['on'](_0xda3980,_0x586f84);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 26c5478..6a5bd28 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 _0xb20f=['removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','isAuthenticated','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','/:id','update','delete','destroy','removeDispositions'];(function(_0x5a2d54,_0x40d07d){var _0x3170d3=function(_0x4aae43){while(--_0x4aae43){_0x5a2d54['push'](_0x5a2d54['shift']());}};_0x3170d3(++_0x40d07d);}(_0xb20f,0x1f0));var _0xfb20=function(_0xff5fc8,_0x27e054){_0xff5fc8=_0xff5fc8-0x0;var _0x1c33cf=_0xb20f[_0xff5fc8];return _0x1c33cf;};'use strict';var multer=require(_0xfb20('0x0'));var util=require('util');var path=require(_0xfb20('0x1'));var timeout=require(_0xfb20('0x2'));var express=require(_0xfb20('0x3'));var router=express[_0xfb20('0x4')]();var auth=require(_0xfb20('0x5'));var interaction=require(_0xfb20('0x6'));var config=require(_0xfb20('0x7'));var controller=require('./cmList.controller');router[_0xfb20('0x8')]('/',auth['isAuthenticated'](),controller[_0xfb20('0x9')]);router[_0xfb20('0x8')](_0xfb20('0xa'),auth['isAuthenticated'](),controller[_0xfb20('0xb')]);router[_0xfb20('0x8')]('/:id',auth[_0xfb20('0xc')](),controller[_0xfb20('0xd')]);router[_0xfb20('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xfb20('0xe')]);router['get'](_0xfb20('0xf'),auth[_0xfb20('0xc')](),controller[_0xfb20('0x10')]);router[_0xfb20('0x8')](_0xfb20('0x11'),auth[_0xfb20('0xc')](),controller[_0xfb20('0x12')]);router[_0xfb20('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xfb20('0x13')]);router['get'](_0xfb20('0x14'),auth[_0xfb20('0xc')](),controller[_0xfb20('0x15')]);router[_0xfb20('0x16')]('/',auth['isAuthenticated'](),controller[_0xfb20('0x17')]);router[_0xfb20('0x16')](_0xfb20('0x18'),auth[_0xfb20('0xc')](),controller[_0xfb20('0x19')]);router[_0xfb20('0x16')]('/:id/contacts',auth[_0xfb20('0xc')](),controller[_0xfb20('0x1a')]);router['post'](_0xfb20('0x1b'),auth['isAuthenticated'](),controller[_0xfb20('0x1c')]);router[_0xfb20('0x16')](_0xfb20('0x14'),auth[_0xfb20('0xc')](),controller[_0xfb20('0x1d')]);router[_0xfb20('0x1e')](_0xfb20('0x1f'),auth[_0xfb20('0xc')](),controller[_0xfb20('0x20')]);router[_0xfb20('0x21')]('/:id',auth[_0xfb20('0xc')](),controller[_0xfb20('0x22')]);router[_0xfb20('0x21')](_0xfb20('0x18'),auth[_0xfb20('0xc')](),controller[_0xfb20('0x23')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xfb20('0x24')]);module[_0xfb20('0x25')]=router; \ No newline at end of file +var _0x8fa2=['get','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/contacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','update','destroy','delete','removeDispositions','removeAgents','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmList.controller','index'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0x8fa2,0x93));var _0x28fa=function(_0x5f152b,_0x1f9248){_0x5f152b=_0x5f152b-0x0;var _0x38440e=_0x8fa2[_0x5f152b];return _0x38440e;};'use strict';var multer=require(_0x28fa('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x28fa('0x1'));var express=require(_0x28fa('0x2'));var router=express[_0x28fa('0x3')]();var auth=require(_0x28fa('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x28fa('0x5'));var controller=require(_0x28fa('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x28fa('0x7')]);router[_0x28fa('0x8')]('/describe',auth[_0x28fa('0x9')](),controller[_0x28fa('0xa')]);router[_0x28fa('0x8')](_0x28fa('0xb'),auth[_0x28fa('0x9')](),controller[_0x28fa('0xc')]);router[_0x28fa('0x8')](_0x28fa('0xd'),auth[_0x28fa('0x9')](),controller['getDispositions']);router[_0x28fa('0x8')](_0x28fa('0xe'),auth['isAuthenticated'](),controller['getContacts']);router[_0x28fa('0x8')](_0x28fa('0xf'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x28fa('0x8')](_0x28fa('0x10'),auth[_0x28fa('0x9')](),controller[_0x28fa('0x11')]);router[_0x28fa('0x8')](_0x28fa('0x12'),auth[_0x28fa('0x9')](),controller[_0x28fa('0x13')]);router[_0x28fa('0x14')]('/',auth[_0x28fa('0x9')](),controller[_0x28fa('0x15')]);router[_0x28fa('0x14')](_0x28fa('0xd'),auth[_0x28fa('0x9')](),controller[_0x28fa('0x16')]);router[_0x28fa('0x14')](_0x28fa('0xe'),auth[_0x28fa('0x9')](),controller[_0x28fa('0x17')]);router[_0x28fa('0x14')](_0x28fa('0x10'),auth[_0x28fa('0x9')](),controller[_0x28fa('0x18')]);router[_0x28fa('0x14')](_0x28fa('0x12'),auth[_0x28fa('0x9')](),controller['addAgents']);router['put'](_0x28fa('0xb'),auth[_0x28fa('0x9')](),controller[_0x28fa('0x19')]);router['delete'](_0x28fa('0xb'),auth[_0x28fa('0x9')](),controller[_0x28fa('0x1a')]);router[_0x28fa('0x1b')](_0x28fa('0xd'),auth['isAuthenticated'](),controller[_0x28fa('0x1c')]);router[_0x28fa('0x1b')](_0x28fa('0x12'),auth[_0x28fa('0x9')](),controller[_0x28fa('0x1d')]);module[_0x28fa('0x1e')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index d7afd75..95f8bec 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 _0xa5cf=['exports','VIRTUAL','getDataValue','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5cf,0xc8));var _0xfa5c=function(_0x246845,_0x2065ae){_0x246845=_0x246845-0x0;var _0x4c8c8c=_0xa5cf[_0x246845];return _0x4c8c8c;};'use strict';var Sequelize=require('sequelize');module[_0xfa5c('0x0')]={'name':{'type':Sequelize[_0xfa5c('0x1')],'get':function(_0x4aedaf){return this[_0xfa5c('0x2')]('field');}},'field':{'type':Sequelize[_0xfa5c('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xfa5c('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0xcfab=['sequelize','VIRTUAL','getDataValue','STRING'];(function(_0x527a6c,_0x15b18d){var _0x4c780d=function(_0xebc03){while(--_0xebc03){_0x527a6c['push'](_0x527a6c['shift']());}};_0x4c780d(++_0x15b18d);}(_0xcfab,0x1e0));var _0xbcfa=function(_0x303588,_0x5f271c){_0x303588=_0x303588-0x0;var _0x4d717e=_0xcfab[_0x303588];return _0x4d717e;};'use strict';var Sequelize=require(_0xbcfa('0x0'));module['exports']={'name':{'type':Sequelize[_0xbcfa('0x1')],'get':function(_0x5d3c5b){return this[_0xbcfa('0x2')]('field');}},'field':{'type':Sequelize[_0xbcfa('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index c28a0e2..f438169 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 _0xfd28=['../../config/license/hardware','../../components/parsers/qs','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','then','destroy','error','stack','name','send','update','Condition','find','params','body','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse'];(function(_0x477c9f,_0x1a9264){var _0x24059a=function(_0x56147f){while(--_0x56147f){_0x477c9f['push'](_0x477c9f['shift']());}};_0x24059a(++_0x1a9264);}(_0xfd28,0x148));var _0x8fd2=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xfd28[_0x3511d3];return _0x5d6321;};'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){if(_0x1f3237['body']['id']){delete _0x1f3237['body']['id'];}return db[_0x8fd2('0x21')][_0x8fd2('0x22')]({'where':{'id':_0x1f3237[_0x8fd2('0x23')]['id']}})['then'](handleEntityNotFound(_0x3f16a3,null))[_0x8fd2('0x1a')](saveUpdates(_0x1f3237[_0x8fd2('0x24')],null))[_0x8fd2('0x1a')](respondWithResult(_0x3f16a3,null))[_0x8fd2('0x25')](handleError(_0x3f16a3,null));};exports[_0x8fd2('0x1b')]=function(_0x4745bf,_0x332ab0){return db['Condition'][_0x8fd2('0x22')]({'where':{'id':_0x4745bf[_0x8fd2('0x23')]['id']}})[_0x8fd2('0x1a')](handleEntityNotFound(_0x332ab0,null))[_0x8fd2('0x1a')](removeEntity(_0x332ab0,null))[_0x8fd2('0x25')](handleError(_0x332ab0,null));}; \ No newline at end of file +var _0x702d=['../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','end','offset','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','body','Condition','find','params','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x702d,0x147));var _0xd702=function(_0x3bc3c2,_0x3fee1d){_0x3bc3c2=_0x3bc3c2-0x0;var _0x3c27af=_0x702d[_0x3bc3c2];return _0x3c27af;};'use strict';var pdf=require(_0xd702('0x0'));var emlformat=require(_0xd702('0x1'));var rimraf=require(_0xd702('0x2'));var zipdir=require(_0xd702('0x3'));var jsonpatch=require(_0xd702('0x4'));var rp=require('request-promise');var moment=require(_0xd702('0x5'));var BPromise=require(_0xd702('0x6'));var Mustache=require(_0xd702('0x7'));var util=require(_0xd702('0x8'));var path=require('path');var sox=require(_0xd702('0x9'));var csv=require('to-csv');var ejs=require(_0xd702('0xa'));var fs=require('fs');var _=require(_0xd702('0xb'));var squel=require(_0xd702('0xc'));var crypto=require('crypto');var jsforce=require(_0xd702('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd702('0xe'));var querystring=require(_0xd702('0xf'));var Papa=require(_0xd702('0x10'));var authService=require(_0xd702('0x11'));var hardwareService=require(_0xd702('0x12'));var Redis=require(_0xd702('0x13'));var qs=require(_0xd702('0x14'));var logger=require(_0xd702('0x15'))(_0xd702('0x16'));var utils=require(_0xd702('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e9439,_0x42e1ad){_0x42e1ad=_0x42e1ad||0xcc;return function(_0x273577){if(_0x273577){return _0x3e9439['sendStatus'](_0x42e1ad);}return _0x3e9439[_0xd702('0x18')](_0x42e1ad)[_0xd702('0x19')]();};}function respondWithResult(_0x1ed8a3,_0x2735db){_0x2735db=_0x2735db||0xc8;return function(_0x3948f8){if(_0x3948f8){return _0x1ed8a3[_0xd702('0x18')](_0x2735db)['json'](_0x3948f8);}};}function respondWithFilteredResult(_0x2f26b9,_0x3ea0ab){return function(_0x5d7978){if(_0x5d7978){var _0x707b9=_0x5d7978['count'],_0x4922f8=_0x3ea0ab[_0xd702('0x1a')],_0x268c66=_0x3ea0ab[_0xd702('0x1a')]+_0x3ea0ab[_0xd702('0x1b')],_0x210c32;if(_0x268c66>=_0x707b9){_0x268c66=_0x707b9;_0x210c32=0xc8;}else{_0x210c32=0xce;}_0x2f26b9['status'](_0x210c32);return _0x2f26b9['set'](_0xd702('0x1c'),_0x4922f8+'-'+_0x268c66+'/'+_0x707b9)['json'](_0x5d7978);}return null;};}function patchUpdates(_0x3fbcec){return function(_0x2a871e){try{jsonpatch[_0xd702('0x1d')](_0x2a871e,_0x3fbcec,!![]);}catch(_0x265b1b){return BPromise[_0xd702('0x1e')](_0x265b1b);}return _0x2a871e[_0xd702('0x1f')]();};}function saveUpdates(_0x612da0,_0x5937f3){return function(_0x4be140){if(_0x4be140){return _0x4be140['update'](_0x612da0)[_0xd702('0x20')](function(_0x109284){return _0x109284;});}return null;};}function removeEntity(_0x5cbff4,_0x211200){return function(_0x5d91fd){if(_0x5d91fd){return _0x5d91fd[_0xd702('0x21')]()['then'](function(){_0x5cbff4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21c00e,_0xeec2e4){return function(_0x459184){if(!_0x459184){_0x21c00e['sendStatus'](0x194);}return _0x459184;};}function handleError(_0x1f0c44,_0x17cd14){_0x17cd14=_0x17cd14||0x1f4;return function(_0x10599a){logger[_0xd702('0x22')](_0x10599a[_0xd702('0x23')]);if(_0x10599a[_0xd702('0x24')]){delete _0x10599a[_0xd702('0x24')];}_0x1f0c44[_0xd702('0x18')](_0x17cd14)[_0xd702('0x25')](_0x10599a);};}exports['update']=function(_0x116b2f,_0x322cb8){if(_0x116b2f[_0xd702('0x26')]['id']){delete _0x116b2f[_0xd702('0x26')]['id'];}return db[_0xd702('0x27')][_0xd702('0x28')]({'where':{'id':_0x116b2f[_0xd702('0x29')]['id']}})[_0xd702('0x20')](handleEntityNotFound(_0x322cb8,null))['then'](saveUpdates(_0x116b2f['body'],null))[_0xd702('0x20')](respondWithResult(_0x322cb8,null))[_0xd702('0x2a')](handleError(_0x322cb8,null));};exports['destroy']=function(_0x45cd22,_0xee8bf1){return db[_0xd702('0x27')][_0xd702('0x28')]({'where':{'id':_0x45cd22['params']['id']}})[_0xd702('0x20')](handleEntityNotFound(_0xee8bf1,null))[_0xd702('0x20')](removeEntity(_0xee8bf1,null))[_0xd702('0x2a')](handleError(_0xee8bf1,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index ae13969..bc48d3d 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 _0xb157=['exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','bluebird','./condition.attributes'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0xb157,0x68));var _0x7b15=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb157[_0x432682];return _0x463d05;};'use strict';var _=require(_0x7b15('0x0'));var util=require(_0x7b15('0x1'));var logger=require(_0x7b15('0x2'))(_0x7b15('0x3'));var moment=require('moment');var BPromise=require(_0x7b15('0x4'));var rp=require('request-promise');var attributes=require(_0x7b15('0x5'));module[_0x7b15('0x6')]=function(_0x16a06d,_0x20412a){return _0x16a06d[_0x7b15('0x7')](_0x7b15('0x8'),attributes,{'tableName':_0x7b15('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa617=['define','Condition','tools_conditions','lodash','util','../../config/logger','bluebird','request-promise','exports'];(function(_0x2aac90,_0x5acbcf){var _0x2d87e8=function(_0x221fda){while(--_0x221fda){_0x2aac90['push'](_0x2aac90['shift']());}};_0x2d87e8(++_0x5acbcf);}(_0xa617,0x12c));var _0x7a61=function(_0x43b190,_0x4a25ae){_0x43b190=_0x43b190-0x0;var _0x2e60d4=_0xa617[_0x43b190];return _0x2e60d4;};'use strict';var _=require(_0x7a61('0x0'));var util=require(_0x7a61('0x1'));var logger=require(_0x7a61('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7a61('0x3'));var rp=require(_0x7a61('0x4'));var attributes=require('./condition.attributes');module[_0x7a61('0x5')]=function(_0x327d1f,_0x127472){return _0x327d1f[_0x7a61('0x6')](_0x7a61('0x7'),attributes,{'tableName':_0x7a61('0x8'),'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 f677acb..c7d9678 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 _0x918d=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','Condition,\x20%s,\x20%s','message','result','catch'];(function(_0x11625f,_0x26d392){var _0x3039a1=function(_0x1532c0){while(--_0x1532c0){_0x11625f['push'](_0x11625f['shift']());}};_0x3039a1(++_0x26d392);}(_0x918d,0x165));var _0xd918=function(_0x327572,_0x2f2565){_0x327572=_0x327572-0x0;var _0x485e48=_0x918d[_0x327572];return _0x485e48;};'use strict';var _=require(_0xd918('0x0'));var util=require(_0xd918('0x1'));var moment=require(_0xd918('0x2'));var BPromise=require(_0xd918('0x3'));var rs=require(_0xd918('0x4'));var fs=require('fs');var Redis=require(_0xd918('0x5'));var db=require(_0xd918('0x6'))['db'];var utils=require(_0xd918('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd918('0x8'));var client=jayson['client'][_0xd918('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x248ddd,_0x27469f,_0x9f8b58){return new BPromise(function(_0x58fb5f,_0x472672){return client['request'](_0x248ddd,_0x9f8b58)[_0xd918('0xa')](function(_0x16e4bb){logger[_0xd918('0xb')]('Condition,\x20%s,\x20%s',_0x27469f,_0xd918('0xc'));logger[_0xd918('0xd')](_0xd918('0xe'),_0x27469f,_0xd918('0xc'),JSON[_0xd918('0xf')](_0x16e4bb));if(_0x16e4bb[_0xd918('0x10')]){if(_0x16e4bb[_0xd918('0x10')]['code']===0x1f4){logger['error'](_0xd918('0x11'),_0x27469f,_0x16e4bb['error'][_0xd918('0x12')]);return _0x472672(_0x16e4bb[_0xd918('0x10')]['message']);}logger['error'](_0xd918('0x11'),_0x27469f,_0x16e4bb[_0xd918('0x10')][_0xd918('0x12')]);return _0x58fb5f(_0x16e4bb['error'][_0xd918('0x12')]);}else{logger[_0xd918('0xb')]('Condition,\x20%s,\x20%s',_0x27469f,_0xd918('0xc'));_0x58fb5f(_0x16e4bb[_0xd918('0x13')][_0xd918('0x12')]);}})[_0xd918('0x14')](function(_0x54164b){logger[_0xd918('0x10')](_0xd918('0x11'),_0x27469f,_0x54164b);_0x472672(_0x54164b);});});} \ No newline at end of file +var _0xc427=['code','message','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x48ae92,_0x26f56f){var _0x73e237=function(_0x1d1fe1){while(--_0x1d1fe1){_0x48ae92['push'](_0x48ae92['shift']());}};_0x73e237(++_0x26f56f);}(_0xc427,0xd3));var _0x7c42=function(_0x20e25a,_0x1de63d){_0x20e25a=_0x20e25a-0x0;var _0x74e40c=_0xc427[_0x20e25a];return _0x74e40c;};'use strict';var _=require(_0x7c42('0x0'));var util=require(_0x7c42('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7c42('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7c42('0x3'));var logger=require(_0x7c42('0x4'))('rpc');var config=require(_0x7c42('0x5'));var jayson=require(_0x7c42('0x6'));var client=jayson[_0x7c42('0x7')][_0x7c42('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ab0e9,_0x1471bd,_0x469dea){return new BPromise(function(_0x442eac,_0x75265a){return client[_0x7c42('0x9')](_0x5ab0e9,_0x469dea)[_0x7c42('0xa')](function(_0x57c5dd){logger[_0x7c42('0xb')](_0x7c42('0xc'),_0x1471bd,'request\x20sent');logger[_0x7c42('0xd')]('Condition,\x20%s,\x20%s,\x20%s',_0x1471bd,_0x7c42('0xe'),JSON[_0x7c42('0xf')](_0x57c5dd));if(_0x57c5dd[_0x7c42('0x10')]){if(_0x57c5dd[_0x7c42('0x10')][_0x7c42('0x11')]===0x1f4){logger[_0x7c42('0x10')](_0x7c42('0xc'),_0x1471bd,_0x57c5dd[_0x7c42('0x10')]['message']);return _0x75265a(_0x57c5dd[_0x7c42('0x10')]['message']);}logger['error'](_0x7c42('0xc'),_0x1471bd,_0x57c5dd['error'][_0x7c42('0x12')]);return _0x442eac(_0x57c5dd[_0x7c42('0x10')][_0x7c42('0x12')]);}else{logger[_0x7c42('0xb')](_0x7c42('0xc'),_0x1471bd,_0x7c42('0xe'));_0x442eac(_0x57c5dd['result'][_0x7c42('0x12')]);}})['catch'](function(_0x3af08d){logger[_0x7c42('0x10')](_0x7c42('0xc'),_0x1471bd,_0x3af08d);_0x75265a(_0x3af08d);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 9692baa..938bcb5 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 _0xd6ee=['../../config/environment','/:id','update','delete','destroy','multer','path','connect-timeout','express','../../components/interaction/service'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xd6ee,0xff));var _0xed6e=function(_0x1c1d94,_0x47ec2a){_0x1c1d94=_0x1c1d94-0x0;var _0x3e0d52=_0xd6ee[_0x1c1d94];return _0x3e0d52;};'use strict';var multer=require(_0xed6e('0x0'));var util=require('util');var path=require(_0xed6e('0x1'));var timeout=require(_0xed6e('0x2'));var express=require(_0xed6e('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xed6e('0x4'));var config=require(_0xed6e('0x5'));var controller=require('./condition.controller');router['put'](_0xed6e('0x6'),auth['isAuthenticated'](),controller[_0xed6e('0x7')]);router[_0xed6e('0x8')](_0xed6e('0x6'),auth['isAuthenticated'](),controller[_0xed6e('0x9')]);module['exports']=router; \ No newline at end of file +var _0x5dd4=['./condition.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xa92559,_0x1d2e45){var _0x502df8=function(_0x3321db){while(--_0x3321db){_0xa92559['push'](_0xa92559['shift']());}};_0x502df8(++_0x1d2e45);}(_0x5dd4,0xbb));var _0x45dd=function(_0x227b64,_0x1c6f72){_0x227b64=_0x227b64-0x0;var _0xc84cb5=_0x5dd4[_0x227b64];return _0xc84cb5;};'use strict';var multer=require(_0x45dd('0x0'));var util=require(_0x45dd('0x1'));var path=require(_0x45dd('0x2'));var timeout=require(_0x45dd('0x3'));var express=require('express');var router=express[_0x45dd('0x4')]();var auth=require(_0x45dd('0x5'));var interaction=require(_0x45dd('0x6'));var config=require(_0x45dd('0x7'));var controller=require(_0x45dd('0x8'));router['put'](_0x45dd('0x9'),auth[_0x45dd('0xa')](),controller[_0x45dd('0xb')]);router[_0x45dd('0xc')](_0x45dd('0x9'),auth[_0x45dd('0xa')](),controller[_0x45dd('0xd')]);module[_0x45dd('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 6b6f5bf..3db3fbd 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 _0xb239=['name','STRING','exports'];(function(_0x187cac,_0x59efae){var _0xe42080=function(_0x36468c){while(--_0x36468c){_0x187cac['push'](_0x187cac['shift']());}};_0xe42080(++_0x59efae);}(_0xb239,0x74));var _0x9b23=function(_0x197916,_0x3fae80){_0x197916=_0x197916-0x0;var _0x252fe3=_0xb239[_0x197916];return _0x252fe3;};'use strict';var Sequelize=require('sequelize');module[_0x9b23('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9b23('0x1')},'description':{'type':Sequelize[_0x9b23('0x2')]}}; \ No newline at end of file +var _0x9412=['name','sequelize','exports','STRING'];(function(_0x206b07,_0x30ee32){var _0x55de27=function(_0x82ff93){while(--_0x82ff93){_0x206b07['push'](_0x206b07['shift']());}};_0x55de27(++_0x30ee32);}(_0x9412,0x99));var _0x2941=function(_0x4f170f,_0x44a928){_0x4f170f=_0x4f170f-0x0;var _0x326563=_0x9412[_0x4f170f];return _0x326563;};'use strict';var Sequelize=require(_0x2941('0x0'));module[_0x2941('0x1')]={'name':{'type':Sequelize[_0x2941('0x2')],'allowNull':![],'unique':_0x2941('0x3')},'description':{'type':Sequelize[_0x2941('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 23798b0..98df2e6 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 _0x7a0e=['limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','options','count','include','findAll','rows','catch','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','destroy','type','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','hasOwnProperty','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','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','end','offset','status','set','apply','reject','save','update','then','UserProfileResource','error','stack','name','Dashboard','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit'];(function(_0x2596bb,_0x585dcb){var _0x3fe38a=function(_0x1667ac){while(--_0x1667ac){_0x2596bb['push'](_0x2596bb['shift']());}};_0x3fe38a(++_0x585dcb);}(_0x7a0e,0xba));var _0xe7a0=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x7a0e[_0x13d07a];return _0x5ee0ee;};'use strict';var pdf=require(_0xe7a0('0x0'));var emlformat=require(_0xe7a0('0x1'));var rimraf=require(_0xe7a0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe7a0('0x3'));var rp=require(_0xe7a0('0x4'));var moment=require(_0xe7a0('0x5'));var BPromise=require(_0xe7a0('0x6'));var Mustache=require('mustache');var util=require(_0xe7a0('0x7'));var path=require(_0xe7a0('0x8'));var sox=require(_0xe7a0('0x9'));var csv=require(_0xe7a0('0xa'));var ejs=require(_0xe7a0('0xb'));var fs=require('fs');var _=require(_0xe7a0('0xc'));var squel=require(_0xe7a0('0xd'));var crypto=require(_0xe7a0('0xe'));var jsforce=require(_0xe7a0('0xf'));var deskjs=require(_0xe7a0('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe7a0('0x11'));var Papa=require(_0xe7a0('0x12'));var authService=require(_0xe7a0('0x13'));var hardwareService=require(_0xe7a0('0x14'));var Redis=require(_0xe7a0('0x15'));var qs=require(_0xe7a0('0x16'));var logger=require(_0xe7a0('0x17'))('api');var utils=require(_0xe7a0('0x18'));var config=require(_0xe7a0('0x19'));var db=require('../../mysqldb')['db'];config[_0xe7a0('0x1a')]=_['defaults'](config[_0xe7a0('0x1a')],{'host':_0xe7a0('0x1b'),'port':0x18eb});var socket=require(_0xe7a0('0x1c'))(new Redis(config[_0xe7a0('0x1a')]));require(_0xe7a0('0x1d'))[_0xe7a0('0x1e')](socket);function respondWithStatusCode(_0x9eee65,_0x16012c){_0x16012c=_0x16012c||0xcc;return function(_0x2c69b5){if(_0x2c69b5){return _0x9eee65[_0xe7a0('0x1f')](_0x16012c);}return _0x9eee65['status'](_0x16012c)[_0xe7a0('0x20')]();};}function respondWithResult(_0x32de8d,_0x5617cd){_0x5617cd=_0x5617cd||0xc8;return function(_0x356081){if(_0x356081){return _0x32de8d['status'](_0x5617cd)['json'](_0x356081);}};}function respondWithFilteredResult(_0x45ef87,_0x30cb91){return function(_0x224cd1){if(_0x224cd1){var _0x7260f9=_0x224cd1['count'],_0x1792e0=_0x30cb91[_0xe7a0('0x21')],_0x35c36f=_0x30cb91[_0xe7a0('0x21')]+_0x30cb91['limit'],_0x11ba11;if(_0x35c36f>=_0x7260f9){_0x35c36f=_0x7260f9;_0x11ba11=0xc8;}else{_0x11ba11=0xce;}_0x45ef87[_0xe7a0('0x22')](_0x11ba11);return _0x45ef87[_0xe7a0('0x23')]('Content-Range',_0x1792e0+'-'+_0x35c36f+'/'+_0x7260f9)['json'](_0x224cd1);}return null;};}function patchUpdates(_0x8b3626){return function(_0x3300d6){try{jsonpatch[_0xe7a0('0x24')](_0x3300d6,_0x8b3626,!![]);}catch(_0x30f26c){return BPromise[_0xe7a0('0x25')](_0x30f26c);}return _0x3300d6[_0xe7a0('0x26')]();};}function saveUpdates(_0x1a79d0,_0x3a294c){return function(_0x5d801b){if(_0x5d801b){return _0x5d801b[_0xe7a0('0x27')](_0x1a79d0)[_0xe7a0('0x28')](function(_0x2419d2){return _0x2419d2;});}return null;};}function removeEntity(_0x369d02,_0x5cb3ab){return function(_0xab95a3){if(_0xab95a3){return _0xab95a3['destroy']()[_0xe7a0('0x28')](function(){var _0x32d85=_0xab95a3['get']({'plain':!![]});var _0x2257e9='CustomDashboards';return db[_0xe7a0('0x29')]['destroy']({'where':{'type':_0x2257e9,'resourceId':_0x32d85['id']}})[_0xe7a0('0x28')](function(){return _0xab95a3;});})['then'](function(){_0x369d02[_0xe7a0('0x22')](0xcc)[_0xe7a0('0x20')]();});}};}function handleEntityNotFound(_0x4e3e86,_0x282236){return function(_0x468e92){if(!_0x468e92){_0x4e3e86[_0xe7a0('0x1f')](0x194);}return _0x468e92;};}function handleError(_0x4e795e,_0x5e960d){_0x5e960d=_0x5e960d||0x1f4;return function(_0x3d9c4e){logger[_0xe7a0('0x2a')](_0x3d9c4e[_0xe7a0('0x2b')]);if(_0x3d9c4e['name']){delete _0x3d9c4e[_0xe7a0('0x2c')];}_0x4e795e[_0xe7a0('0x22')](_0x5e960d)['send'](_0x3d9c4e);};}exports['index']=function(_0x5914d5,_0x2937c9){var _0x1d13f1={},_0x451bd9={},_0x239acc={'count':0x0,'rows':[]};var _0x1fc194=db[_0xe7a0('0x2d')][_0xe7a0('0x2e')];_0x451bd9[_0xe7a0('0x2f')]=_[_0xe7a0('0x30')](_0x1fc194);_0x451bd9[_0xe7a0('0x31')]=_[_0xe7a0('0x30')](_0x5914d5['query']);_0x451bd9[_0xe7a0('0x32')]=_['intersection'](_0x451bd9[_0xe7a0('0x2f')],_0x451bd9['query']);_0x1d13f1[_0xe7a0('0x33')]=_[_0xe7a0('0x34')](_0x451bd9[_0xe7a0('0x2f')],qs[_0xe7a0('0x35')](_0x5914d5[_0xe7a0('0x31')][_0xe7a0('0x35')]));_0x1d13f1[_0xe7a0('0x33')]=_0x1d13f1[_0xe7a0('0x33')][_0xe7a0('0x36')]?_0x1d13f1['attributes']:_0x451bd9['model'];if(!_0x5914d5[_0xe7a0('0x31')]['hasOwnProperty'](_0xe7a0('0x37'))){_0x1d13f1[_0xe7a0('0x38')]=qs['limit'](_0x5914d5[_0xe7a0('0x31')][_0xe7a0('0x38')]);_0x1d13f1[_0xe7a0('0x21')]=qs['offset'](_0x5914d5['query']['offset']);}_0x1d13f1[_0xe7a0('0x39')]=qs[_0xe7a0('0x3a')](_0x5914d5[_0xe7a0('0x31')][_0xe7a0('0x3a')]);_0x1d13f1[_0xe7a0('0x3b')]=qs[_0xe7a0('0x32')](_[_0xe7a0('0x3c')](_0x5914d5[_0xe7a0('0x31')],_0x451bd9[_0xe7a0('0x32')]));if(_0x5914d5[_0xe7a0('0x31')][_0xe7a0('0x3d')]){_0x1d13f1['where']=_[_0xe7a0('0x3e')](_0x1d13f1['where'],{'$or':_[_0xe7a0('0x3f')](_0x1fc194,function(_0x176704){if(_0x176704['type'][_0xe7a0('0x40')]!==_0xe7a0('0x41')){var _0x11b31f={};_0x11b31f[_0x176704['field']]={'$like':'%'+_0x5914d5[_0xe7a0('0x31')][_0xe7a0('0x3d')]+'%'};return _0x11b31f;}})});}_0x1d13f1=_[_0xe7a0('0x3e')]({},_0x1d13f1,_0x5914d5[_0xe7a0('0x42')]);var _0x57b4ae={'where':_0x1d13f1[_0xe7a0('0x3b')]};return db[_0xe7a0('0x2d')][_0xe7a0('0x43')](_0x57b4ae)[_0xe7a0('0x28')](function(_0x54630b){_0x239acc[_0xe7a0('0x43')]=_0x54630b;if(_0x5914d5[_0xe7a0('0x31')]['includeAll']){_0x1d13f1[_0xe7a0('0x44')]=[{'all':!![]}];}return db[_0xe7a0('0x2d')][_0xe7a0('0x45')](_0x1d13f1);})[_0xe7a0('0x28')](function(_0x1813e9){_0x239acc[_0xe7a0('0x46')]=_0x1813e9;return _0x239acc;})[_0xe7a0('0x28')](respondWithFilteredResult(_0x2937c9,_0x1d13f1))[_0xe7a0('0x47')](handleError(_0x2937c9,null));};exports['show']=function(_0x120d2d,_0x22c8c7){var _0x208a07={'raw':![],'where':{'id':_0x120d2d[_0xe7a0('0x48')]['id']}},_0x3aacee={};_0x3aacee['model']=_[_0xe7a0('0x30')](db['Dashboard'][_0xe7a0('0x2e')]);_0x3aacee[_0xe7a0('0x31')]=_[_0xe7a0('0x30')](_0x120d2d[_0xe7a0('0x31')]);_0x3aacee[_0xe7a0('0x32')]=_[_0xe7a0('0x34')](_0x3aacee['model'],_0x3aacee['query']);_0x208a07[_0xe7a0('0x33')]=_['intersection'](_0x3aacee[_0xe7a0('0x2f')],qs[_0xe7a0('0x35')](_0x120d2d[_0xe7a0('0x31')]['fields']));_0x208a07[_0xe7a0('0x33')]=_0x208a07[_0xe7a0('0x33')][_0xe7a0('0x36')]?_0x208a07[_0xe7a0('0x33')]:_0x3aacee[_0xe7a0('0x2f')];if(_0x120d2d['query'][_0xe7a0('0x49')]){_0x208a07[_0xe7a0('0x44')]=[{'all':!![]}];}_0x208a07=_[_0xe7a0('0x3e')]({},_0x208a07,_0x120d2d[_0xe7a0('0x42')]);return db[_0xe7a0('0x2d')][_0xe7a0('0x4a')](_0x208a07)[_0xe7a0('0x28')](handleEntityNotFound(_0x22c8c7,null))[_0xe7a0('0x28')](respondWithResult(_0x22c8c7,null))[_0xe7a0('0x47')](handleError(_0x22c8c7,null));};exports[_0xe7a0('0x4b')]=function(_0xe59316,_0x4384ca){return db[_0xe7a0('0x2d')][_0xe7a0('0x4b')](_0xe59316[_0xe7a0('0x4c')],{})['then'](function(_0xe68e75){var _0xa36884=_0xe59316[_0xe7a0('0x4d')][_0xe7a0('0x4e')]({'plain':!![]});if(!_0xa36884)throw new Error(_0xe7a0('0x4f'));if(_0xa36884['role']===_0xe7a0('0x4d')){var _0x2fa672=_0xe68e75[_0xe7a0('0x4e')]({'plain':!![]});var _0x432031=_0xe7a0('0x50');return db[_0xe7a0('0x51')][_0xe7a0('0x4a')]({'where':{'name':_0x432031,'userProfileId':_0xa36884[_0xe7a0('0x52')]},'raw':!![]})[_0xe7a0('0x28')](function(_0x4d94a9){if(_0x4d94a9&&_0x4d94a9[_0xe7a0('0x53')]===0x0){return db[_0xe7a0('0x29')][_0xe7a0('0x4b')]({'name':_0x2fa672[_0xe7a0('0x2c')],'resourceId':_0x2fa672['id'],'type':_0x4d94a9['name'],'sectionId':_0x4d94a9['id']},{})[_0xe7a0('0x28')](function(){return _0xe68e75;});}else{return _0xe68e75;}})[_0xe7a0('0x47')](function(_0x311eb4){logger[_0xe7a0('0x2a')](_0xe7a0('0x54'),_0x311eb4);throw _0x311eb4;});}return _0xe68e75;})[_0xe7a0('0x28')](respondWithResult(_0x4384ca,0xc9))['catch'](handleError(_0x4384ca,null));};exports[_0xe7a0('0x55')]=function(_0x372fd9,_0x56992b){var _0x23524d={'raw':![],'where':{'id':_0x372fd9[_0xe7a0('0x48')]['id']}},_0xca453={};_0xca453[_0xe7a0('0x2f')]=_['keys'](db[_0xe7a0('0x2d')]['rawAttributes']);_0x23524d['attributes']=_['intersection'](_0xca453[_0xe7a0('0x2f')],qs[_0xe7a0('0x35')](_0x372fd9[_0xe7a0('0x31')][_0xe7a0('0x35')]));_0x23524d['attributes']=_0x23524d[_0xe7a0('0x33')][_0xe7a0('0x36')]?_0x23524d[_0xe7a0('0x33')]:_0xca453[_0xe7a0('0x2f')];if(_0x372fd9[_0xe7a0('0x31')][_0xe7a0('0x49')]){_0x23524d[_0xe7a0('0x44')]=[{'all':!![]}];}_0x23524d=_[_0xe7a0('0x3e')]({},_0x23524d,_0x372fd9[_0xe7a0('0x42')]);return db['Dashboard']['find'](_0x23524d)[_0xe7a0('0x28')](handleEntityNotFound(_0x56992b,null))[_0xe7a0('0x28')](function(_0x5c607a){if(_0x5c607a){var _0x1948e9=_0x5c607a[_0xe7a0('0x4e')]({'plain':!![]});_0x1948e9=qs[_0xe7a0('0x56')](_0x1948e9,['id',_0xe7a0('0x57'),_0xe7a0('0x58')]);_0x372fd9[_0xe7a0('0x4c')]=_[_0xe7a0('0x56')](_0x372fd9[_0xe7a0('0x4c')],['id','createdAt',_0xe7a0('0x58')]);return db[_0xe7a0('0x2d')][_0xe7a0('0x4b')](_['merge'](_0x1948e9,_0x372fd9[_0xe7a0('0x4c')]),{'include':_0x372fd9[_0xe7a0('0x31')][_0xe7a0('0x49')]?[{'all':!![]}]:undefined})[_0xe7a0('0x28')](function(_0x10ddef){var _0x4b54fe=_0x372fd9[_0xe7a0('0x4d')]['get']({'plain':!![]});if(!_0x4b54fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b54fe['role']===_0xe7a0('0x4d')){var _0x91264d=_0x10ddef[_0xe7a0('0x4e')]({'plain':!![]});var _0x37f263=_0xe7a0('0x50');return db['UserProfileSection'][_0xe7a0('0x4a')]({'where':{'name':_0x37f263,'userProfileId':_0x4b54fe[_0xe7a0('0x52')]},'raw':!![]})[_0xe7a0('0x28')](function(_0x7a083b){if(_0x7a083b&&_0x7a083b['autoAssociation']===0x0){return db[_0xe7a0('0x29')][_0xe7a0('0x4b')]({'name':_0x91264d[_0xe7a0('0x2c')],'resourceId':_0x91264d['id'],'type':_0x7a083b[_0xe7a0('0x2c')],'sectionId':_0x7a083b['id']},{})['then'](function(){return _0x10ddef;});}else{return _0x10ddef;}})[_0xe7a0('0x47')](function(_0x4f5a0a){logger[_0xe7a0('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f5a0a);throw _0x4f5a0a;});}return _0x10ddef;});}})[_0xe7a0('0x28')](respondWithResult(_0x56992b,0xc9))[_0xe7a0('0x47')](handleError(_0x56992b,null));};exports[_0xe7a0('0x27')]=function(_0x1a6912,_0x50e7d2){if(_0x1a6912[_0xe7a0('0x4c')]['id']){delete _0x1a6912[_0xe7a0('0x4c')]['id'];}return db[_0xe7a0('0x2d')][_0xe7a0('0x4a')]({'where':{'id':_0x1a6912[_0xe7a0('0x48')]['id']}})[_0xe7a0('0x28')](handleEntityNotFound(_0x50e7d2,null))[_0xe7a0('0x28')](saveUpdates(_0x1a6912['body'],null))['then'](respondWithResult(_0x50e7d2,null))[_0xe7a0('0x47')](handleError(_0x50e7d2,null));};exports[_0xe7a0('0x59')]=function(_0x2765b2,_0x2e99e1){return db[_0xe7a0('0x2d')]['find']({'where':{'id':_0x2765b2['params']['id']}})[_0xe7a0('0x28')](handleEntityNotFound(_0x2e99e1,null))[_0xe7a0('0x28')](removeEntity(_0x2e99e1,null))[_0xe7a0('0x47')](handleError(_0x2e99e1,null));};function widgetAttributes(_0x550581){try{switch(_0x550581[_0xe7a0('0x5a')]){case _0xe7a0('0x5b'):return[{'name':'attrUrl','value':_0x550581[_0xe7a0('0x5c')]||(_0x550581[_0xe7a0('0x5d')]&&_0x550581['attrs'][0x0]?_0x550581[_0xe7a0('0x5d')][0x0][_0xe7a0('0x5e')]:undefined)||'https://'}];case'custom':return[{'name':_0xe7a0('0x5f'),'value':_0x550581[_0xe7a0('0x5f')]||(_0x550581[_0xe7a0('0x5d')]&&_0x550581[_0xe7a0('0x5d')][0x0]?_0x550581[_0xe7a0('0x5d')][0x0][_0xe7a0('0x5e')]:undefined)||''}];case _0xe7a0('0x60'):return[{'name':'attrHourFormat','value':_0x550581[_0xe7a0('0x61')]||(_0x550581[_0xe7a0('0x5d')]&&_0x550581[_0xe7a0('0x5d')][0x0]?_0x550581[_0xe7a0('0x5d')][0x0][_0xe7a0('0x5e')]:undefined)||_0xe7a0('0x62')},{'name':_0xe7a0('0x63'),'value':_0x550581[_0xe7a0('0x63')]||(_0x550581[_0xe7a0('0x5d')]&&_0x550581[_0xe7a0('0x5d')][0x1]?_0x550581['attrs'][0x1][_0xe7a0('0x5e')]:undefined)||_0xe7a0('0x64')},{'name':'attrFontSize','value':_0x550581[_0xe7a0('0x65')]||(_0x550581[_0xe7a0('0x5d')]&&_0x550581['attrs'][0x2]?_0x550581[_0xe7a0('0x5d')][0x2][_0xe7a0('0x5e')]:undefined)||0xc}];case _0xe7a0('0x66'):return[{'name':'attrMetric','value':_0x550581[_0xe7a0('0x67')]||(_0x550581[_0xe7a0('0x5d')]&&_0x550581[_0xe7a0('0x5d')][0x0]?_0x550581['attrs'][0x0]['value']:undefined)||'total'},{'name':_0xe7a0('0x68'),'value':_0x550581[_0xe7a0('0x68')]||(_0x550581[_0xe7a0('0x5d')]&&_0x550581['attrs'][0x1]?_0x550581[_0xe7a0('0x5d')][0x1][_0xe7a0('0x5e')]:undefined)||[]},{'name':'attrFontSize','value':_0x550581[_0xe7a0('0x65')]||(_0x550581[_0xe7a0('0x5d')]&&_0x550581[_0xe7a0('0x5d')][0x2]?_0x550581['attrs'][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0xe7a0('0x69'):return[{'name':_0xe7a0('0x6a'),'value':_0x550581[_0xe7a0('0x6a')]||(_0x550581['attrs']&&_0x550581[_0xe7a0('0x5d')][0x0]?_0x550581[_0xe7a0('0x5d')][0x0][_0xe7a0('0x5e')]:undefined)||_0xe7a0('0x6b')},{'name':_0xe7a0('0x6c'),'value':_0x550581['attrSerie2']||(_0x550581[_0xe7a0('0x5d')]&&_0x550581[_0xe7a0('0x5d')][0x1]?_0x550581[_0xe7a0('0x5d')][0x1][_0xe7a0('0x5e')]:undefined)||null},{'name':'attrSerie3','value':_0x550581[_0xe7a0('0x6d')]||(_0x550581[_0xe7a0('0x5d')]&&_0x550581[_0xe7a0('0x5d')][0x2]?_0x550581[_0xe7a0('0x5d')][0x2][_0xe7a0('0x5e')]:undefined)||null},{'name':_0xe7a0('0x68'),'value':_0x550581[_0xe7a0('0x68')]||(_0x550581[_0xe7a0('0x5d')]&&_0x550581[_0xe7a0('0x5d')][0x3]?_0x550581[_0xe7a0('0x5d')][0x3]['value']:undefined)||[]}];case _0xe7a0('0x6e'):return[{'name':_0xe7a0('0x6f'),'type':_0x550581[_0xe7a0('0x70')]||(_0x550581['attrs']&&_0x550581[_0xe7a0('0x5d')][0x0]?_0x550581['attrs'][0x0][_0xe7a0('0x5a')]:undefined)||null,'value':_0x550581[_0xe7a0('0x6f')]||(_0x550581[_0xe7a0('0x5d')]&&_0x550581[_0xe7a0('0x5d')][0x0]?_0x550581[_0xe7a0('0x5d')][0x0][_0xe7a0('0x5e')]:undefined)||null},{'name':_0xe7a0('0x71'),'value':_0x550581['attrRefresh']||(_0x550581['attrs']&&_0x550581[_0xe7a0('0x5d')][0x1]?_0x550581[_0xe7a0('0x5d')][0x1][_0xe7a0('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x4f2c6a){logger[_0xe7a0('0x2a')]('widgetAttributes:\x20%s',JSON[_0xe7a0('0x72')](_0x4f2c6a));return[];}}exports[_0xe7a0('0x73')]=function(_0x92972e,_0x431ede,_0x25b33a){if(_0x92972e[_0xe7a0('0x4c')]['id']){delete _0x92972e[_0xe7a0('0x4c')]['id'];}return db[_0xe7a0('0x2d')][_0xe7a0('0x4a')]({'where':{'id':_0x92972e[_0xe7a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x431ede,null))[_0xe7a0('0x28')](function(_0x4abcb6){if(_0x4abcb6){_0x92972e[_0xe7a0('0x4c')][_0xe7a0('0x74')]=_0x4abcb6['id'];_0x92972e[_0xe7a0('0x4c')][_0xe7a0('0x5d')]=widgetAttributes(_0x92972e[_0xe7a0('0x4c')]);return db[_0xe7a0('0x75')]['create'](_0x92972e[_0xe7a0('0x4c')]);}})[_0xe7a0('0x28')](respondWithResult(_0x431ede,null))[_0xe7a0('0x47')](handleError(_0x431ede,null));};exports[_0xe7a0('0x76')]=function(_0x1f6292,_0x5e34ef,_0x5b0a5c){var _0xfb56f8={};var _0x323f63={};var _0x383470;var _0x1cd9b6;return db['Dashboard'][_0xe7a0('0x77')]({'where':{'id':_0x1f6292[_0xe7a0('0x48')]['id']}})[_0xe7a0('0x28')](handleEntityNotFound(_0x5e34ef,null))['then'](function(_0x48cce4){if(_0x48cce4){_0x383470=_0x48cce4;_0x323f63[_0xe7a0('0x2f')]=_['keys'](db[_0xe7a0('0x75')][_0xe7a0('0x2e')]);_0x323f63[_0xe7a0('0x31')]=_[_0xe7a0('0x30')](_0x1f6292[_0xe7a0('0x31')]);_0x323f63['filters']=_[_0xe7a0('0x34')](_0x323f63[_0xe7a0('0x2f')],_0x323f63['query']);_0xfb56f8[_0xe7a0('0x33')]=_[_0xe7a0('0x34')](_0x323f63[_0xe7a0('0x2f')],qs[_0xe7a0('0x35')](_0x1f6292['query']['fields']));_0xfb56f8['attributes']=_0xfb56f8['attributes'][_0xe7a0('0x36')]?_0xfb56f8[_0xe7a0('0x33')]:_0x323f63[_0xe7a0('0x2f')];_0xfb56f8['order']=qs[_0xe7a0('0x3a')](_0x1f6292['query'][_0xe7a0('0x3a')]);_0xfb56f8[_0xe7a0('0x3b')]=qs['filters'](_[_0xe7a0('0x3c')](_0x1f6292[_0xe7a0('0x31')],_0x323f63['filters']));if(_0x1f6292[_0xe7a0('0x31')]['filter']){_0xfb56f8['where']=_[_0xe7a0('0x3e')](_0xfb56f8[_0xe7a0('0x3b')],{'$or':_['map'](_0xfb56f8[_0xe7a0('0x33')],function(_0x4b779a){var _0x34d1b8={};_0x34d1b8[_0x4b779a]={'$like':'%'+_0x1f6292['query']['filter']+'%'};return _0x34d1b8;})});}_0xfb56f8=_[_0xe7a0('0x3e')]({},_0xfb56f8,_0x1f6292['options']);return _0x383470[_0xe7a0('0x76')](_0xfb56f8);}})[_0xe7a0('0x28')](function(_0x40362e){if(_0x40362e){_0x1cd9b6=_0x40362e[_0xe7a0('0x36')];if(!_0x1f6292[_0xe7a0('0x31')][_0xe7a0('0x78')](_0xe7a0('0x37'))){_0xfb56f8[_0xe7a0('0x38')]=qs['limit'](_0x1f6292[_0xe7a0('0x31')][_0xe7a0('0x38')]);_0xfb56f8[_0xe7a0('0x21')]=qs[_0xe7a0('0x21')](_0x1f6292[_0xe7a0('0x31')][_0xe7a0('0x21')]);}return _0x383470['getItems'](_0xfb56f8);}})['then'](function(_0x51e8da){if(_0x51e8da){return _0x51e8da?{'count':_0x1cd9b6,'rows':_0x51e8da}:null;}})[_0xe7a0('0x28')](respondWithResult(_0x5e34ef,null))[_0xe7a0('0x47')](handleError(_0x5e34ef,null));}; \ No newline at end of file +var _0x6c21=['rawAttributes','query','keys','filters','attributes','intersection','fields','length','model','nolimit','order','where','filter','merge','key','field','options','count','includeAll','include','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','role','user','userProfileId','type','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','sort','pick','map','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','set','json','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Dashboard'];(function(_0x1bb9a5,_0x4984a5){var _0x2e9160=function(_0x247ae3){while(--_0x247ae3){_0x1bb9a5['push'](_0x1bb9a5['shift']());}};_0x2e9160(++_0x4984a5);}(_0x6c21,0x1b2));var _0x16c2=function(_0x43cd8c,_0x53b715){_0x43cd8c=_0x43cd8c-0x0;var _0x4f879e=_0x6c21[_0x43cd8c];return _0x4f879e;};'use strict';var pdf=require(_0x16c2('0x0'));var emlformat=require(_0x16c2('0x1'));var rimraf=require(_0x16c2('0x2'));var zipdir=require(_0x16c2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16c2('0x4'));var moment=require(_0x16c2('0x5'));var BPromise=require(_0x16c2('0x6'));var Mustache=require(_0x16c2('0x7'));var util=require(_0x16c2('0x8'));var path=require('path');var sox=require(_0x16c2('0x9'));var csv=require(_0x16c2('0xa'));var ejs=require(_0x16c2('0xb'));var fs=require('fs');var _=require(_0x16c2('0xc'));var squel=require(_0x16c2('0xd'));var crypto=require(_0x16c2('0xe'));var jsforce=require(_0x16c2('0xf'));var deskjs=require(_0x16c2('0x10'));var toCsv=require(_0x16c2('0xa'));var querystring=require(_0x16c2('0x11'));var Papa=require(_0x16c2('0x12'));var authService=require(_0x16c2('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x16c2('0x14'));var qs=require(_0x16c2('0x15'));var logger=require('../../config/logger')(_0x16c2('0x16'));var utils=require(_0x16c2('0x17'));var config=require(_0x16c2('0x18'));var db=require('../../mysqldb')['db'];config[_0x16c2('0x19')]=_[_0x16c2('0x1a')](config['redis'],{'host':_0x16c2('0x1b'),'port':0x18eb});var socket=require(_0x16c2('0x1c'))(new Redis(config[_0x16c2('0x19')]));require('./dashboard.socket')[_0x16c2('0x1d')](socket);function respondWithStatusCode(_0xd1de9e,_0x394eac){_0x394eac=_0x394eac||0xcc;return function(_0x49ab49){if(_0x49ab49){return _0xd1de9e[_0x16c2('0x1e')](_0x394eac);}return _0xd1de9e[_0x16c2('0x1f')](_0x394eac)[_0x16c2('0x20')]();};}function respondWithResult(_0x4f5d6b,_0x5e21e4){_0x5e21e4=_0x5e21e4||0xc8;return function(_0x37e54f){if(_0x37e54f){return _0x4f5d6b[_0x16c2('0x1f')](_0x5e21e4)['json'](_0x37e54f);}};}function respondWithFilteredResult(_0x3a7fd1,_0x5808d3){return function(_0x387a17){if(_0x387a17){var _0x1a88e3=_0x387a17['count'],_0x1247ab=_0x5808d3[_0x16c2('0x21')],_0xa796cd=_0x5808d3[_0x16c2('0x21')]+_0x5808d3[_0x16c2('0x22')],_0x3cbfc9;if(_0xa796cd>=_0x1a88e3){_0xa796cd=_0x1a88e3;_0x3cbfc9=0xc8;}else{_0x3cbfc9=0xce;}_0x3a7fd1['status'](_0x3cbfc9);return _0x3a7fd1[_0x16c2('0x23')]('Content-Range',_0x1247ab+'-'+_0xa796cd+'/'+_0x1a88e3)[_0x16c2('0x24')](_0x387a17);}return null;};}function patchUpdates(_0x49b0c7){return function(_0x451360){try{jsonpatch['apply'](_0x451360,_0x49b0c7,!![]);}catch(_0x34180d){return BPromise[_0x16c2('0x25')](_0x34180d);}return _0x451360[_0x16c2('0x26')]();};}function saveUpdates(_0x1ad9b5,_0x5a28a5){return function(_0x1e193e){if(_0x1e193e){return _0x1e193e[_0x16c2('0x27')](_0x1ad9b5)[_0x16c2('0x28')](function(_0x3c3f4c){return _0x3c3f4c;});}return null;};}function removeEntity(_0x157e9f,_0x41b63d){return function(_0x74c44){if(_0x74c44){return _0x74c44[_0x16c2('0x29')]()['then'](function(){var _0x396ab8=_0x74c44[_0x16c2('0x2a')]({'plain':!![]});var _0x3badd9='CustomDashboards';return db[_0x16c2('0x2b')]['destroy']({'where':{'type':_0x3badd9,'resourceId':_0x396ab8['id']}})[_0x16c2('0x28')](function(){return _0x74c44;});})[_0x16c2('0x28')](function(){_0x157e9f['status'](0xcc)[_0x16c2('0x20')]();});}};}function handleEntityNotFound(_0x293e32,_0x30c978){return function(_0x114473){if(!_0x114473){_0x293e32[_0x16c2('0x1e')](0x194);}return _0x114473;};}function handleError(_0x42a430,_0x42a9ad){_0x42a9ad=_0x42a9ad||0x1f4;return function(_0x43a934){logger[_0x16c2('0x2c')](_0x43a934[_0x16c2('0x2d')]);if(_0x43a934[_0x16c2('0x2e')]){delete _0x43a934[_0x16c2('0x2e')];}_0x42a430[_0x16c2('0x1f')](_0x42a9ad)[_0x16c2('0x2f')](_0x43a934);};}exports[_0x16c2('0x30')]=function(_0x50c04e,_0x169493){var _0x319a91={},_0x994370={},_0x493339={'count':0x0,'rows':[]};var _0x45fe74=db[_0x16c2('0x31')][_0x16c2('0x32')];_0x994370['model']=_['keys'](_0x45fe74);_0x994370[_0x16c2('0x33')]=_[_0x16c2('0x34')](_0x50c04e[_0x16c2('0x33')]);_0x994370[_0x16c2('0x35')]=_['intersection'](_0x994370['model'],_0x994370['query']);_0x319a91[_0x16c2('0x36')]=_[_0x16c2('0x37')](_0x994370['model'],qs[_0x16c2('0x38')](_0x50c04e[_0x16c2('0x33')]['fields']));_0x319a91[_0x16c2('0x36')]=_0x319a91[_0x16c2('0x36')][_0x16c2('0x39')]?_0x319a91[_0x16c2('0x36')]:_0x994370[_0x16c2('0x3a')];if(!_0x50c04e['query']['hasOwnProperty'](_0x16c2('0x3b'))){_0x319a91[_0x16c2('0x22')]=qs[_0x16c2('0x22')](_0x50c04e[_0x16c2('0x33')][_0x16c2('0x22')]);_0x319a91[_0x16c2('0x21')]=qs[_0x16c2('0x21')](_0x50c04e[_0x16c2('0x33')]['offset']);}_0x319a91[_0x16c2('0x3c')]=qs['sort'](_0x50c04e[_0x16c2('0x33')]['sort']);_0x319a91[_0x16c2('0x3d')]=qs[_0x16c2('0x35')](_['pick'](_0x50c04e['query'],_0x994370['filters']));if(_0x50c04e['query'][_0x16c2('0x3e')]){_0x319a91['where']=_[_0x16c2('0x3f')](_0x319a91[_0x16c2('0x3d')],{'$or':_['map'](_0x45fe74,function(_0x179201){if(_0x179201['type'][_0x16c2('0x40')]!=='VIRTUAL'){var _0x4ac048={};_0x4ac048[_0x179201[_0x16c2('0x41')]]={'$like':'%'+_0x50c04e[_0x16c2('0x33')][_0x16c2('0x3e')]+'%'};return _0x4ac048;}})});}_0x319a91=_[_0x16c2('0x3f')]({},_0x319a91,_0x50c04e[_0x16c2('0x42')]);var _0x433a6b={'where':_0x319a91[_0x16c2('0x3d')]};return db[_0x16c2('0x31')][_0x16c2('0x43')](_0x433a6b)[_0x16c2('0x28')](function(_0x2e9dec){_0x493339[_0x16c2('0x43')]=_0x2e9dec;if(_0x50c04e[_0x16c2('0x33')][_0x16c2('0x44')]){_0x319a91[_0x16c2('0x45')]=[{'all':!![]}];}return db[_0x16c2('0x31')]['findAll'](_0x319a91);})['then'](function(_0x5177d8){_0x493339[_0x16c2('0x46')]=_0x5177d8;return _0x493339;})[_0x16c2('0x28')](respondWithFilteredResult(_0x169493,_0x319a91))[_0x16c2('0x47')](handleError(_0x169493,null));};exports[_0x16c2('0x48')]=function(_0x3911dc,_0x3ba3a4){var _0x5e327a={'raw':![],'where':{'id':_0x3911dc[_0x16c2('0x49')]['id']}},_0x5f2f5c={};_0x5f2f5c[_0x16c2('0x3a')]=_[_0x16c2('0x34')](db[_0x16c2('0x31')][_0x16c2('0x32')]);_0x5f2f5c['query']=_[_0x16c2('0x34')](_0x3911dc[_0x16c2('0x33')]);_0x5f2f5c['filters']=_[_0x16c2('0x37')](_0x5f2f5c[_0x16c2('0x3a')],_0x5f2f5c[_0x16c2('0x33')]);_0x5e327a[_0x16c2('0x36')]=_[_0x16c2('0x37')](_0x5f2f5c[_0x16c2('0x3a')],qs['fields'](_0x3911dc[_0x16c2('0x33')][_0x16c2('0x38')]));_0x5e327a[_0x16c2('0x36')]=_0x5e327a[_0x16c2('0x36')]['length']?_0x5e327a[_0x16c2('0x36')]:_0x5f2f5c[_0x16c2('0x3a')];if(_0x3911dc[_0x16c2('0x33')][_0x16c2('0x44')]){_0x5e327a[_0x16c2('0x45')]=[{'all':!![]}];}_0x5e327a=_[_0x16c2('0x3f')]({},_0x5e327a,_0x3911dc[_0x16c2('0x42')]);return db['Dashboard'][_0x16c2('0x4a')](_0x5e327a)['then'](handleEntityNotFound(_0x3ba3a4,null))[_0x16c2('0x28')](respondWithResult(_0x3ba3a4,null))[_0x16c2('0x47')](handleError(_0x3ba3a4,null));};exports[_0x16c2('0x4b')]=function(_0x5926bc,_0x1d10d9){return db[_0x16c2('0x31')]['create'](_0x5926bc['body'],{})['then'](function(_0x3e02e3){var _0x36b36f=_0x5926bc['user'][_0x16c2('0x2a')]({'plain':!![]});if(!_0x36b36f)throw new Error(_0x16c2('0x4c'));if(_0x36b36f['role']==='user'){var _0x24f207=_0x3e02e3[_0x16c2('0x2a')]({'plain':!![]});var _0x9f94a5=_0x16c2('0x4d');return db['UserProfileSection'][_0x16c2('0x4a')]({'where':{'name':_0x9f94a5,'userProfileId':_0x36b36f['userProfileId']},'raw':!![]})[_0x16c2('0x28')](function(_0x31e9ab){if(_0x31e9ab&&_0x31e9ab[_0x16c2('0x4e')]===0x0){return db[_0x16c2('0x2b')][_0x16c2('0x4b')]({'name':_0x24f207[_0x16c2('0x2e')],'resourceId':_0x24f207['id'],'type':_0x31e9ab[_0x16c2('0x2e')],'sectionId':_0x31e9ab['id']},{})[_0x16c2('0x28')](function(){return _0x3e02e3;});}else{return _0x3e02e3;}})[_0x16c2('0x47')](function(_0x2be596){logger[_0x16c2('0x2c')](_0x16c2('0x4f'),_0x2be596);throw _0x2be596;});}return _0x3e02e3;})[_0x16c2('0x28')](respondWithResult(_0x1d10d9,0xc9))[_0x16c2('0x47')](handleError(_0x1d10d9,null));};exports[_0x16c2('0x50')]=function(_0xb33fa1,_0x32b2e3){var _0x1ae452={'raw':![],'where':{'id':_0xb33fa1['params']['id']}},_0x4bc599={};_0x4bc599[_0x16c2('0x3a')]=_[_0x16c2('0x34')](db[_0x16c2('0x31')][_0x16c2('0x32')]);_0x1ae452[_0x16c2('0x36')]=_['intersection'](_0x4bc599[_0x16c2('0x3a')],qs[_0x16c2('0x38')](_0xb33fa1[_0x16c2('0x33')]['fields']));_0x1ae452[_0x16c2('0x36')]=_0x1ae452['attributes'][_0x16c2('0x39')]?_0x1ae452[_0x16c2('0x36')]:_0x4bc599[_0x16c2('0x3a')];if(_0xb33fa1['query'][_0x16c2('0x44')]){_0x1ae452[_0x16c2('0x45')]=[{'all':!![]}];}_0x1ae452=_[_0x16c2('0x3f')]({},_0x1ae452,_0xb33fa1['options']);return db['Dashboard'][_0x16c2('0x4a')](_0x1ae452)[_0x16c2('0x28')](handleEntityNotFound(_0x32b2e3,null))[_0x16c2('0x28')](function(_0x3cdfa6){if(_0x3cdfa6){var _0x29c7d8=_0x3cdfa6[_0x16c2('0x2a')]({'plain':!![]});_0x29c7d8=qs[_0x16c2('0x51')](_0x29c7d8,['id','createdAt',_0x16c2('0x52')]);_0xb33fa1[_0x16c2('0x53')]=_[_0x16c2('0x51')](_0xb33fa1[_0x16c2('0x53')],['id',_0x16c2('0x54'),_0x16c2('0x52')]);return db['Dashboard'][_0x16c2('0x4b')](_[_0x16c2('0x3f')](_0x29c7d8,_0xb33fa1[_0x16c2('0x53')]),{'include':_0xb33fa1['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x55979d){var _0x2728e0=_0xb33fa1['user']['get']({'plain':!![]});if(!_0x2728e0)throw new Error(_0x16c2('0x4c'));if(_0x2728e0[_0x16c2('0x55')]===_0x16c2('0x56')){var _0x548e17=_0x55979d[_0x16c2('0x2a')]({'plain':!![]});var _0x38ea1e='CustomDashboards';return db['UserProfileSection'][_0x16c2('0x4a')]({'where':{'name':_0x38ea1e,'userProfileId':_0x2728e0[_0x16c2('0x57')]},'raw':!![]})[_0x16c2('0x28')](function(_0x3f2050){if(_0x3f2050&&_0x3f2050['autoAssociation']===0x0){return db[_0x16c2('0x2b')][_0x16c2('0x4b')]({'name':_0x548e17[_0x16c2('0x2e')],'resourceId':_0x548e17['id'],'type':_0x3f2050[_0x16c2('0x2e')],'sectionId':_0x3f2050['id']},{})[_0x16c2('0x28')](function(){return _0x55979d;});}else{return _0x55979d;}})[_0x16c2('0x47')](function(_0x38d050){logger[_0x16c2('0x2c')](_0x16c2('0x4f'),_0x38d050);throw _0x38d050;});}return _0x55979d;});}})['then'](respondWithResult(_0x32b2e3,0xc9))[_0x16c2('0x47')](handleError(_0x32b2e3,null));};exports[_0x16c2('0x27')]=function(_0x475f3f,_0x3cbc88){if(_0x475f3f[_0x16c2('0x53')]['id']){delete _0x475f3f[_0x16c2('0x53')]['id'];}return db[_0x16c2('0x31')][_0x16c2('0x4a')]({'where':{'id':_0x475f3f['params']['id']}})[_0x16c2('0x28')](handleEntityNotFound(_0x3cbc88,null))[_0x16c2('0x28')](saveUpdates(_0x475f3f[_0x16c2('0x53')],null))[_0x16c2('0x28')](respondWithResult(_0x3cbc88,null))[_0x16c2('0x47')](handleError(_0x3cbc88,null));};exports[_0x16c2('0x29')]=function(_0xb4d2df,_0x220582){return db[_0x16c2('0x31')][_0x16c2('0x4a')]({'where':{'id':_0xb4d2df[_0x16c2('0x49')]['id']}})[_0x16c2('0x28')](handleEntityNotFound(_0x220582,null))[_0x16c2('0x28')](removeEntity(_0x220582,null))[_0x16c2('0x47')](handleError(_0x220582,null));};function widgetAttributes(_0x1e1df6){try{switch(_0x1e1df6[_0x16c2('0x58')]){case'iframe':return[{'name':_0x16c2('0x59'),'value':_0x1e1df6[_0x16c2('0x59')]||(_0x1e1df6[_0x16c2('0x5a')]&&_0x1e1df6[_0x16c2('0x5a')][0x0]?_0x1e1df6[_0x16c2('0x5a')][0x0]['value']:undefined)||_0x16c2('0x5b')}];case _0x16c2('0x5c'):return[{'name':_0x16c2('0x5d'),'value':_0x1e1df6[_0x16c2('0x5d')]||(_0x1e1df6[_0x16c2('0x5a')]&&_0x1e1df6['attrs'][0x0]?_0x1e1df6['attrs'][0x0][_0x16c2('0x5e')]:undefined)||''}];case _0x16c2('0x5f'):return[{'name':_0x16c2('0x60'),'value':_0x1e1df6[_0x16c2('0x60')]||(_0x1e1df6[_0x16c2('0x5a')]&&_0x1e1df6[_0x16c2('0x5a')][0x0]?_0x1e1df6[_0x16c2('0x5a')][0x0][_0x16c2('0x5e')]:undefined)||'HH:mm:ss'},{'name':_0x16c2('0x61'),'value':_0x1e1df6[_0x16c2('0x61')]||(_0x1e1df6[_0x16c2('0x5a')]&&_0x1e1df6['attrs'][0x1]?_0x1e1df6[_0x16c2('0x5a')][0x1][_0x16c2('0x5e')]:undefined)||'0.00'},{'name':_0x16c2('0x62'),'value':_0x1e1df6[_0x16c2('0x62')]||(_0x1e1df6['attrs']&&_0x1e1df6[_0x16c2('0x5a')][0x2]?_0x1e1df6['attrs'][0x2]['value']:undefined)||0xc}];case _0x16c2('0x63'):return[{'name':_0x16c2('0x64'),'value':_0x1e1df6['attrMetric']||(_0x1e1df6['attrs']&&_0x1e1df6[_0x16c2('0x5a')][0x0]?_0x1e1df6[_0x16c2('0x5a')][0x0]['value']:undefined)||_0x16c2('0x65')},{'name':_0x16c2('0x66'),'value':_0x1e1df6[_0x16c2('0x66')]||(_0x1e1df6[_0x16c2('0x5a')]&&_0x1e1df6[_0x16c2('0x5a')][0x1]?_0x1e1df6[_0x16c2('0x5a')][0x1]['value']:undefined)||[]},{'name':_0x16c2('0x62'),'value':_0x1e1df6[_0x16c2('0x62')]||(_0x1e1df6[_0x16c2('0x5a')]&&_0x1e1df6[_0x16c2('0x5a')][0x2]?_0x1e1df6[_0x16c2('0x5a')][0x2][_0x16c2('0x5e')]:undefined)||0x14}];case _0x16c2('0x67'):case _0x16c2('0x68'):return[{'name':_0x16c2('0x69'),'value':_0x1e1df6[_0x16c2('0x69')]||(_0x1e1df6['attrs']&&_0x1e1df6['attrs'][0x0]?_0x1e1df6[_0x16c2('0x5a')][0x0][_0x16c2('0x5e')]:undefined)||_0x16c2('0x65')},{'name':'attrSerie2','value':_0x1e1df6[_0x16c2('0x6a')]||(_0x1e1df6['attrs']&&_0x1e1df6[_0x16c2('0x5a')][0x1]?_0x1e1df6[_0x16c2('0x5a')][0x1][_0x16c2('0x5e')]:undefined)||null},{'name':_0x16c2('0x6b'),'value':_0x1e1df6['attrSerie3']||(_0x1e1df6['attrs']&&_0x1e1df6[_0x16c2('0x5a')][0x2]?_0x1e1df6[_0x16c2('0x5a')][0x2][_0x16c2('0x5e')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1e1df6[_0x16c2('0x66')]||(_0x1e1df6['attrs']&&_0x1e1df6[_0x16c2('0x5a')][0x3]?_0x1e1df6['attrs'][0x3]['value']:undefined)||[]}];case _0x16c2('0x6c'):return[{'name':_0x16c2('0x6d'),'type':_0x1e1df6[_0x16c2('0x6e')]||(_0x1e1df6[_0x16c2('0x5a')]&&_0x1e1df6[_0x16c2('0x5a')][0x0]?_0x1e1df6[_0x16c2('0x5a')][0x0][_0x16c2('0x58')]:undefined)||null,'value':_0x1e1df6['attrReport']||(_0x1e1df6[_0x16c2('0x5a')]&&_0x1e1df6['attrs'][0x0]?_0x1e1df6[_0x16c2('0x5a')][0x0][_0x16c2('0x5e')]:undefined)||null},{'name':'attrRefresh','value':_0x1e1df6[_0x16c2('0x6f')]||(_0x1e1df6[_0x16c2('0x5a')]&&_0x1e1df6['attrs'][0x1]?_0x1e1df6['attrs'][0x1][_0x16c2('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x27ec4f){logger[_0x16c2('0x2c')](_0x16c2('0x70'),JSON['stringify'](_0x27ec4f));return[];}}exports[_0x16c2('0x71')]=function(_0x1241c7,_0x1c4974,_0x42fe45){if(_0x1241c7['body']['id']){delete _0x1241c7['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x1241c7['params']['id']}})[_0x16c2('0x28')](handleEntityNotFound(_0x1c4974,null))['then'](function(_0x299e5f){if(_0x299e5f){_0x1241c7[_0x16c2('0x53')][_0x16c2('0x72')]=_0x299e5f['id'];_0x1241c7[_0x16c2('0x53')][_0x16c2('0x5a')]=widgetAttributes(_0x1241c7[_0x16c2('0x53')]);return db[_0x16c2('0x73')]['create'](_0x1241c7[_0x16c2('0x53')]);}})['then'](respondWithResult(_0x1c4974,null))[_0x16c2('0x47')](handleError(_0x1c4974,null));};exports[_0x16c2('0x74')]=function(_0x3e23e9,_0xaf84ca,_0x5b0566){var _0x210b4a={};var _0x21c058={};var _0x5bfd41;var _0x13f5b8;return db[_0x16c2('0x31')][_0x16c2('0x75')]({'where':{'id':_0x3e23e9[_0x16c2('0x49')]['id']}})[_0x16c2('0x28')](handleEntityNotFound(_0xaf84ca,null))['then'](function(_0x179d33){if(_0x179d33){_0x5bfd41=_0x179d33;_0x21c058[_0x16c2('0x3a')]=_[_0x16c2('0x34')](db[_0x16c2('0x73')][_0x16c2('0x32')]);_0x21c058[_0x16c2('0x33')]=_[_0x16c2('0x34')](_0x3e23e9[_0x16c2('0x33')]);_0x21c058['filters']=_[_0x16c2('0x37')](_0x21c058['model'],_0x21c058[_0x16c2('0x33')]);_0x210b4a[_0x16c2('0x36')]=_[_0x16c2('0x37')](_0x21c058[_0x16c2('0x3a')],qs['fields'](_0x3e23e9[_0x16c2('0x33')]['fields']));_0x210b4a['attributes']=_0x210b4a[_0x16c2('0x36')]['length']?_0x210b4a['attributes']:_0x21c058['model'];_0x210b4a[_0x16c2('0x3c')]=qs[_0x16c2('0x76')](_0x3e23e9['query']['sort']);_0x210b4a['where']=qs['filters'](_[_0x16c2('0x77')](_0x3e23e9[_0x16c2('0x33')],_0x21c058['filters']));if(_0x3e23e9['query'][_0x16c2('0x3e')]){_0x210b4a[_0x16c2('0x3d')]=_[_0x16c2('0x3f')](_0x210b4a['where'],{'$or':_[_0x16c2('0x78')](_0x210b4a['attributes'],function(_0x1c0647){var _0x327324={};_0x327324[_0x1c0647]={'$like':'%'+_0x3e23e9[_0x16c2('0x33')][_0x16c2('0x3e')]+'%'};return _0x327324;})});}_0x210b4a=_[_0x16c2('0x3f')]({},_0x210b4a,_0x3e23e9['options']);return _0x5bfd41[_0x16c2('0x74')](_0x210b4a);}})[_0x16c2('0x28')](function(_0x3319dc){if(_0x3319dc){_0x13f5b8=_0x3319dc['length'];if(!_0x3e23e9[_0x16c2('0x33')]['hasOwnProperty'](_0x16c2('0x3b'))){_0x210b4a[_0x16c2('0x22')]=qs[_0x16c2('0x22')](_0x3e23e9[_0x16c2('0x33')][_0x16c2('0x22')]);_0x210b4a[_0x16c2('0x21')]=qs[_0x16c2('0x21')](_0x3e23e9['query'][_0x16c2('0x21')]);}return _0x5bfd41[_0x16c2('0x74')](_0x210b4a);}})['then'](function(_0xcde239){if(_0xcde239){return _0xcde239?{'count':_0x13f5b8,'rows':_0xcde239}:null;}})[_0x16c2('0x28')](respondWithResult(_0xaf84ca,null))[_0x16c2('0x47')](handleError(_0xaf84ca,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 6369713..d6e01fd 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 _0xa79a=['emit','hook','events','Dashboard','setMaxListeners','save','update'];(function(_0x442259,_0x4d0125){var _0x37be11=function(_0x3b791f){while(--_0x3b791f){_0x442259['push'](_0x442259['shift']());}};_0x37be11(++_0x4d0125);}(_0xa79a,0x12f));var _0xaa79=function(_0x9086fe,_0x1bb32e){_0x9086fe=_0x9086fe-0x0;var _0x983886=_0xa79a[_0x9086fe];return _0x983886;};'use strict';var EventEmitter=require(_0xaa79('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xaa79('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xaa79('0x2')](0x0);var events={'afterCreate':_0xaa79('0x3'),'afterUpdate':_0xaa79('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3b7068){return function(_0x12dd39,_0x29f871,_0x32d450){DashboardEvents[_0xaa79('0x5')](_0x3b7068+':'+_0x12dd39['id'],_0x12dd39);DashboardEvents[_0xaa79('0x5')](_0x3b7068,_0x12dd39);_0x32d450(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xaa79('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0xd00a=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard'];(function(_0x4aae07,_0x105d67){var _0x437754=function(_0x5eba8f){while(--_0x5eba8f){_0x4aae07['push'](_0x4aae07['shift']());}};_0x437754(++_0x105d67);}(_0xd00a,0x1e3));var _0xad00=function(_0x5c238a,_0x283a02){_0x5c238a=_0x5c238a-0x0;var _0x15d1ee=_0xd00a[_0x5c238a];return _0x15d1ee;};'use strict';var EventEmitter=require(_0xad00('0x0'));var Dashboard=require(_0xad00('0x1'))['db'][_0xad00('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xad00('0x3'),'afterUpdate':'update','afterDestroy':_0xad00('0x4')};function emitEvent(_0x44600b){return function(_0xe2ffa9,_0x3306a1,_0x33c62f){DashboardEvents[_0xad00('0x5')](_0x44600b+':'+_0xe2ffa9['id'],_0xe2ffa9);DashboardEvents['emit'](_0x44600b,_0xe2ffa9);_0x33c62f(null);};}for(var e in events){if(events[_0xad00('0x6')](e)){var event=events[e];Dashboard[_0xad00('0x7')](e,emitEvent(event));}}module[_0xad00('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index bb0e22b..957d505 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 _0x67d1=['Dashboard','util','../../config/logger','moment','bluebird','request-promise','./dashboard.attributes','define'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x67d1,0xf1));var _0x167d=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x67d1[_0x25e7cb];return _0x375d92;};'use strict';var _=require('lodash');var util=require(_0x167d('0x0'));var logger=require(_0x167d('0x1'))('api');var moment=require(_0x167d('0x2'));var BPromise=require(_0x167d('0x3'));var rp=require(_0x167d('0x4'));var attributes=require(_0x167d('0x5'));module['exports']=function(_0x3ab690,_0x1d3b56){return _0x3ab690[_0x167d('0x6')](_0x167d('0x7'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8861=['api','moment','bluebird','request-promise','./dashboard.attributes','exports','define','Dashboard','dashboards','../../config/logger'];(function(_0x5b83d1,_0x21c614){var _0x4dbf36=function(_0x20e25a){while(--_0x20e25a){_0x5b83d1['push'](_0x5b83d1['shift']());}};_0x4dbf36(++_0x21c614);}(_0x8861,0x6d));var _0x1886=function(_0x10ecc7,_0x4f6235){_0x10ecc7=_0x10ecc7-0x0;var _0xf9b77a=_0x8861[_0x10ecc7];return _0xf9b77a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1886('0x0'))(_0x1886('0x1'));var moment=require(_0x1886('0x2'));var BPromise=require(_0x1886('0x3'));var rp=require(_0x1886('0x4'));var attributes=require(_0x1886('0x5'));module[_0x1886('0x6')]=function(_0x2673bc,_0x3eec67){return _0x2673bc[_0x1886('0x7')](_0x1886('0x8'),attributes,{'tableName':_0x1886('0x9'),'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 81b5a72..4cc8bcf 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 _0x6c09=['debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x6c09,0x188));var _0x96c0=function(_0x3082e7,_0x374abb){_0x3082e7=_0x3082e7-0x0;var _0x2cb629=_0x6c09[_0x3082e7];return _0x2cb629;};'use strict';var _=require(_0x96c0('0x0'));var util=require(_0x96c0('0x1'));var moment=require(_0x96c0('0x2'));var BPromise=require(_0x96c0('0x3'));var rs=require(_0x96c0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96c0('0x5'))['db'];var utils=require(_0x96c0('0x6'));var logger=require(_0x96c0('0x7'))(_0x96c0('0x8'));var config=require(_0x96c0('0x9'));var jayson=require(_0x96c0('0xa'));var client=jayson[_0x96c0('0xb')][_0x96c0('0xc')]({'port':0x232a});config[_0x96c0('0xd')]=_[_0x96c0('0xe')](config[_0x96c0('0xd')],{'host':_0x96c0('0xf'),'port':0x18eb});var socket=require(_0x96c0('0x10'))(new Redis(config['redis']));require(_0x96c0('0x11'))[_0x96c0('0x12')](socket);function respondWithRpcPromise(_0x2fc89f,_0x5b3f77,_0x25887c){return new BPromise(function(_0x7ddf52,_0x52b00b){return client[_0x96c0('0x13')](_0x2fc89f,_0x25887c)[_0x96c0('0x14')](function(_0x1c9a26){logger[_0x96c0('0x15')](_0x96c0('0x16'),_0x5b3f77,_0x96c0('0x17'));logger[_0x96c0('0x18')](_0x96c0('0x19'),_0x5b3f77,_0x96c0('0x17'),JSON[_0x96c0('0x1a')](_0x1c9a26));if(_0x1c9a26[_0x96c0('0x1b')]){if(_0x1c9a26[_0x96c0('0x1b')][_0x96c0('0x1c')]===0x1f4){logger[_0x96c0('0x1b')]('Dashboard,\x20%s,\x20%s',_0x5b3f77,_0x1c9a26['error'][_0x96c0('0x1d')]);return _0x52b00b(_0x1c9a26[_0x96c0('0x1b')][_0x96c0('0x1d')]);}logger[_0x96c0('0x1b')](_0x96c0('0x16'),_0x5b3f77,_0x1c9a26['error'][_0x96c0('0x1d')]);return _0x7ddf52(_0x1c9a26[_0x96c0('0x1b')][_0x96c0('0x1d')]);}else{logger[_0x96c0('0x15')](_0x96c0('0x16'),_0x5b3f77,_0x96c0('0x17'));_0x7ddf52(_0x1c9a26[_0x96c0('0x1e')]['message']);}})[_0x96c0('0x1f')](function(_0x6e25ed){logger[_0x96c0('0x1b')](_0x96c0('0x16'),_0x5b3f77,_0x6e25ed);_0x52b00b(_0x6e25ed);});});} \ No newline at end of file +var _0xb05e=['debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb05e,0x103));var _0xeb05=function(_0x4d4a1d,_0x42326c){_0x4d4a1d=_0x4d4a1d-0x0;var _0x322338=_0xb05e[_0x4d4a1d];return _0x322338;};'use strict';var _=require(_0xeb05('0x0'));var util=require(_0xeb05('0x1'));var moment=require(_0xeb05('0x2'));var BPromise=require(_0xeb05('0x3'));var rs=require(_0xeb05('0x4'));var fs=require('fs');var Redis=require(_0xeb05('0x5'));var db=require(_0xeb05('0x6'))['db'];var utils=require(_0xeb05('0x7'));var logger=require('../../config/logger')(_0xeb05('0x8'));var config=require(_0xeb05('0x9'));var jayson=require(_0xeb05('0xa'));var client=jayson['client'][_0xeb05('0xb')]({'port':0x232a});config[_0xeb05('0xc')]=_[_0xeb05('0xd')](config[_0xeb05('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb05('0xc')]));require(_0xeb05('0xe'))[_0xeb05('0xf')](socket);function respondWithRpcPromise(_0x3d8ad7,_0x1e2dd1,_0x4e9f3f){return new BPromise(function(_0x3d6883,_0x2a1571){return client[_0xeb05('0x10')](_0x3d8ad7,_0x4e9f3f)[_0xeb05('0x11')](function(_0xa13d0e){logger[_0xeb05('0x12')](_0xeb05('0x13'),_0x1e2dd1,_0xeb05('0x14'));logger[_0xeb05('0x15')](_0xeb05('0x16'),_0x1e2dd1,_0xeb05('0x14'),JSON[_0xeb05('0x17')](_0xa13d0e));if(_0xa13d0e[_0xeb05('0x18')]){if(_0xa13d0e[_0xeb05('0x18')][_0xeb05('0x19')]===0x1f4){logger[_0xeb05('0x18')](_0xeb05('0x13'),_0x1e2dd1,_0xa13d0e[_0xeb05('0x18')]['message']);return _0x2a1571(_0xa13d0e[_0xeb05('0x18')][_0xeb05('0x1a')]);}logger[_0xeb05('0x18')](_0xeb05('0x13'),_0x1e2dd1,_0xa13d0e[_0xeb05('0x18')]['message']);return _0x3d6883(_0xa13d0e[_0xeb05('0x18')][_0xeb05('0x1a')]);}else{logger[_0xeb05('0x12')](_0xeb05('0x13'),_0x1e2dd1,_0xeb05('0x14'));_0x3d6883(_0xa13d0e['result'][_0xeb05('0x1a')]);}})[_0xeb05('0x1b')](function(_0x546689){logger['error']('Dashboard,\x20%s,\x20%s',_0x1e2dd1,_0x546689);_0x2a1571(_0x546689);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 9c438db..6f3bdb4 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 _0x87f3=['remove','emit','removeListener','register','dashboard:','./dashboard.events','save'];(function(_0x44e843,_0x18e958){var _0x4f0a2d=function(_0xd7cb2){while(--_0xd7cb2){_0x44e843['push'](_0x44e843['shift']());}};_0x4f0a2d(++_0x18e958);}(_0x87f3,0x1ef));var _0x387f=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0x87f3[_0x326e79];return _0x37eb89;};'use strict';var DashboardEvents=require(_0x387f('0x0'));var events=[_0x387f('0x1'),_0x387f('0x2'),'update'];function createListener(_0x232146,_0x4c8432){return function(_0x34687d){_0x4c8432[_0x387f('0x3')](_0x232146,_0x34687d);};}function removeListener(_0x5ee176,_0x32dc23){return function(){DashboardEvents[_0x387f('0x4')](_0x5ee176,_0x32dc23);};}exports[_0x387f('0x5')]=function(_0x2b2480){for(var _0x1846c2=0x0,_0x2a8d3e=events['length'];_0x1846c2<_0x2a8d3e;_0x1846c2++){var _0x88dfc4=events[_0x1846c2];var _0x383f08=createListener(_0x387f('0x6')+_0x88dfc4,_0x2b2480);DashboardEvents['on'](_0x88dfc4,_0x383f08);}}; \ No newline at end of file +var _0x30f6=['dashboard:','./dashboard.events','save','remove','update','emit','register','length'];(function(_0xd2a8f3,_0x2bb7dd){var _0x39baca=function(_0x57266d){while(--_0x57266d){_0xd2a8f3['push'](_0xd2a8f3['shift']());}};_0x39baca(++_0x2bb7dd);}(_0x30f6,0x1d1));var _0x630f=function(_0x70588,_0x2e21dd){_0x70588=_0x70588-0x0;var _0x1981d8=_0x30f6[_0x70588];return _0x1981d8;};'use strict';var DashboardEvents=require(_0x630f('0x0'));var events=[_0x630f('0x1'),_0x630f('0x2'),_0x630f('0x3')];function createListener(_0x2bec2b,_0x54f8bc){return function(_0x16dbe8){_0x54f8bc[_0x630f('0x4')](_0x2bec2b,_0x16dbe8);};}function removeListener(_0x16053a,_0x260da9){return function(){DashboardEvents['removeListener'](_0x16053a,_0x260da9);};}exports[_0x630f('0x5')]=function(_0x3861ef){for(var _0x1a01f1=0x0,_0x4aaa52=events[_0x630f('0x6')];_0x1a01f1<_0x4aaa52;_0x1a01f1++){var _0x4c24ee=events[_0x1a01f1];var _0x2ea4f3=createListener(_0x630f('0x7')+_0x4c24ee,_0x3861ef);DashboardEvents['on'](_0x4c24ee,_0x2ea4f3);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 04ab767..7966f1b 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 _0xe039=['delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','/:id/items','create','post','addItem','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe039,0x157));var _0x9e03=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xe039[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require('multer');var util=require(_0x9e03('0x0'));var path=require(_0x9e03('0x1'));var timeout=require(_0x9e03('0x2'));var express=require(_0x9e03('0x3'));var router=express['Router']();var auth=require(_0x9e03('0x4'));var interaction=require(_0x9e03('0x5'));var config=require(_0x9e03('0x6'));var controller=require(_0x9e03('0x7'));router[_0x9e03('0x8')]('/',auth[_0x9e03('0x9')](),controller[_0x9e03('0xa')]);router[_0x9e03('0x8')](_0x9e03('0xb'),auth[_0x9e03('0x9')](),controller['show']);router[_0x9e03('0x8')](_0x9e03('0xc'),auth[_0x9e03('0x9')](),controller['getItems']);router['post']('/',auth['isAuthenticated'](),controller[_0x9e03('0xd')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0x9e03('0xe')](_0x9e03('0xc'),auth[_0x9e03('0x9')](),controller[_0x9e03('0xf')]);router['put'](_0x9e03('0xb'),auth['isAuthenticated'](),controller[_0x9e03('0x10')]);router[_0x9e03('0x11')](_0x9e03('0xb'),auth['isAuthenticated'](),controller[_0x9e03('0x12')]);module[_0x9e03('0x13')]=router; \ No newline at end of file +var _0xd471=['delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','/:id'];(function(_0x4ad186,_0x1c6dd8){var _0x515919=function(_0x136db4){while(--_0x136db4){_0x4ad186['push'](_0x4ad186['shift']());}};_0x515919(++_0x1c6dd8);}(_0xd471,0x135));var _0x1d47=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd471[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0x1d47('0x0'));var util=require(_0x1d47('0x1'));var path=require(_0x1d47('0x2'));var timeout=require(_0x1d47('0x3'));var express=require(_0x1d47('0x4'));var router=express[_0x1d47('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x1d47('0x6'));var config=require(_0x1d47('0x7'));var controller=require(_0x1d47('0x8'));router[_0x1d47('0x9')]('/',auth[_0x1d47('0xa')](),controller[_0x1d47('0xb')]);router[_0x1d47('0x9')]('/:id',auth[_0x1d47('0xa')](),controller['show']);router[_0x1d47('0x9')](_0x1d47('0xc'),auth[_0x1d47('0xa')](),controller[_0x1d47('0xd')]);router[_0x1d47('0xe')]('/',auth['isAuthenticated'](),controller[_0x1d47('0xf')]);router[_0x1d47('0xe')](_0x1d47('0x10'),auth[_0x1d47('0xa')](),controller[_0x1d47('0x11')]);router[_0x1d47('0xe')](_0x1d47('0xc'),auth[_0x1d47('0xa')](),controller[_0x1d47('0x12')]);router[_0x1d47('0x13')](_0x1d47('0x14'),auth[_0x1d47('0xa')](),controller['update']);router[_0x1d47('0x15')](_0x1d47('0x14'),auth[_0x1d47('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 7aa6fed..f173917 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 _0x4983=['INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','setDataValue','stringify','attrs'];(function(_0x5f1cf7,_0x47d9a9){var _0x2ab77b=function(_0x3b8a33){while(--_0x3b8a33){_0x5f1cf7['push'](_0x5f1cf7['shift']());}};_0x2ab77b(++_0x47d9a9);}(_0x4983,0x1ec));var _0x3498=function(_0x5c093a,_0x4e5818){_0x5c093a=_0x5c093a-0x0;var _0x42c2ce=_0x4983[_0x5c093a];return _0x42c2ce;};'use strict';var Sequelize=require(_0x3498('0x0'));var squel=require(_0x3498('0x1'));var _=require(_0x3498('0x2'));module[_0x3498('0x3')]={'title':{'type':Sequelize[_0x3498('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3498('0x5')](_0x3498('0x6')),'get':function(){try{return JSON[_0x3498('0x7')](this[_0x3498('0x8')]('attrs'));}catch(_0x4fd474){return[];}},'set':function(_0x9c793b){try{this[_0x3498('0x9')]('attrs',JSON[_0x3498('0xa')](_0x9c793b));}catch(_0x3fe341){this[_0x3498('0x9')](_0x3498('0xb'),JSON[_0x3498('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x3498('0xc')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3498('0x4')],'allowNull':![],'defaultValue':_0x3498('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8405=['exports','STRING','TEXT','long','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash'];(function(_0x4ad6af,_0x385f37){var _0x3dd541=function(_0x388eb8){while(--_0x388eb8){_0x4ad6af['push'](_0x4ad6af['shift']());}};_0x3dd541(++_0x385f37);}(_0x8405,0x14d));var _0x5840=function(_0x41aea2,_0x175a77){_0x41aea2=_0x41aea2-0x0;var _0x4e1f8c=_0x8405[_0x41aea2];return _0x4e1f8c;};'use strict';var Sequelize=require(_0x5840('0x0'));var squel=require(_0x5840('0x1'));var _=require(_0x5840('0x2'));module[_0x5840('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5840('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5840('0x5')](_0x5840('0x6')),'get':function(){try{return JSON['parse'](this[_0x5840('0x7')](_0x5840('0x8')));}catch(_0x283ffd){return[];}},'set':function(_0x100577){try{this[_0x5840('0x9')](_0x5840('0x8'),JSON['stringify'](_0x100577));}catch(_0x57f9ee){this[_0x5840('0x9')](_0x5840('0x8'),JSON[_0x5840('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x5840('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5840('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5840('0xb')]},'col':{'type':Sequelize[_0x5840('0xb')]},'background':{'type':Sequelize[_0x5840('0x4')],'allowNull':![],'defaultValue':_0x5840('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5840('0x4')],'allowNull':![],'defaultValue':_0x5840('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 1d5d5ca..dc87477 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 _0x3936=['params','model','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','DashboardItem','find','type','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','create','body','update','catch','html-pdf','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','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','show'];(function(_0x13cd20,_0x1d9211){var _0x22b6de=function(_0x4b574f){while(--_0x4b574f){_0x13cd20['push'](_0x13cd20['shift']());}};_0x22b6de(++_0x1d9211);}(_0x3936,0x18c));var _0x6393=function(_0x6f041d,_0x4029b4){_0x6f041d=_0x6f041d-0x0;var _0x4609b8=_0x3936[_0x6f041d];return _0x4609b8;};'use strict';var pdf=require(_0x6393('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6393('0x1'));var zipdir=require(_0x6393('0x2'));var jsonpatch=require(_0x6393('0x3'));var rp=require(_0x6393('0x4'));var moment=require(_0x6393('0x5'));var BPromise=require(_0x6393('0x6'));var Mustache=require(_0x6393('0x7'));var util=require(_0x6393('0x8'));var path=require(_0x6393('0x9'));var sox=require(_0x6393('0xa'));var csv=require(_0x6393('0xb'));var ejs=require(_0x6393('0xc'));var fs=require('fs');var _=require(_0x6393('0xd'));var squel=require(_0x6393('0xe'));var crypto=require(_0x6393('0xf'));var jsforce=require(_0x6393('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6393('0x11'));var Papa=require(_0x6393('0x12'));var authService=require(_0x6393('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x6393('0x14'));var qs=require(_0x6393('0x15'));var logger=require(_0x6393('0x16'))(_0x6393('0x17'));var utils=require(_0x6393('0x18'));var config=require('../../config/environment');var db=require(_0x6393('0x19'))['db'];config[_0x6393('0x1a')]=_[_0x6393('0x1b')](config[_0x6393('0x1a')],{'host':_0x6393('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6393('0x1a')]));require(_0x6393('0x1d'))[_0x6393('0x1e')](socket);function respondWithStatusCode(_0x983d83,_0x292467){_0x292467=_0x292467||0xcc;return function(_0x36587b){if(_0x36587b){return _0x983d83[_0x6393('0x1f')](_0x292467);}return _0x983d83[_0x6393('0x20')](_0x292467)[_0x6393('0x21')]();};}function respondWithResult(_0x1f9b69,_0x3180f4){_0x3180f4=_0x3180f4||0xc8;return function(_0x1427b1){if(_0x1427b1){return _0x1f9b69['status'](_0x3180f4)[_0x6393('0x22')](_0x1427b1);}};}function respondWithFilteredResult(_0x3652cf,_0x703b67){return function(_0x4c1cfa){if(_0x4c1cfa){var _0x3182fc=_0x4c1cfa[_0x6393('0x23')],_0x273374=_0x703b67['offset'],_0x48573b=_0x703b67[_0x6393('0x24')]+_0x703b67[_0x6393('0x25')],_0x499870;if(_0x48573b>=_0x3182fc){_0x48573b=_0x3182fc;_0x499870=0xc8;}else{_0x499870=0xce;}_0x3652cf[_0x6393('0x20')](_0x499870);return _0x3652cf[_0x6393('0x26')](_0x6393('0x27'),_0x273374+'-'+_0x48573b+'/'+_0x3182fc)[_0x6393('0x22')](_0x4c1cfa);}return null;};}function patchUpdates(_0x28870d){return function(_0x56e9b5){try{jsonpatch[_0x6393('0x28')](_0x56e9b5,_0x28870d,!![]);}catch(_0x444bc5){return BPromise[_0x6393('0x29')](_0x444bc5);}return _0x56e9b5['save']();};}function saveUpdates(_0x14e779,_0x11b520){return function(_0x2f9c5a){if(_0x2f9c5a){return _0x2f9c5a['update'](_0x14e779)[_0x6393('0x2a')](function(_0x29aaf0){return _0x29aaf0;});}return null;};}function removeEntity(_0x10795d,_0x46635b){return function(_0x5c7b59){if(_0x5c7b59){return _0x5c7b59[_0x6393('0x2b')]()['then'](function(){_0x10795d[_0x6393('0x20')](0xcc)[_0x6393('0x21')]();});}};}function handleEntityNotFound(_0x3d72ae,_0x581e59){return function(_0x4478db){if(!_0x4478db){_0x3d72ae[_0x6393('0x1f')](0x194);}return _0x4478db;};}function handleError(_0x3df87c,_0x470afd){_0x470afd=_0x470afd||0x1f4;return function(_0x46e193){logger[_0x6393('0x2c')](_0x46e193[_0x6393('0x2d')]);if(_0x46e193[_0x6393('0x2e')]){delete _0x46e193[_0x6393('0x2e')];}_0x3df87c[_0x6393('0x20')](_0x470afd)[_0x6393('0x2f')](_0x46e193);};}exports[_0x6393('0x30')]=function(_0x38555c,_0x129968){var _0x482559={'raw':![],'where':{'id':_0x38555c[_0x6393('0x31')]['id']}},_0x3b2c32={};_0x3b2c32[_0x6393('0x32')]=_['keys'](db['DashboardItem'][_0x6393('0x33')]);_0x3b2c32[_0x6393('0x34')]=_['keys'](_0x38555c[_0x6393('0x34')]);_0x3b2c32[_0x6393('0x35')]=_[_0x6393('0x36')](_0x3b2c32['model'],_0x3b2c32[_0x6393('0x34')]);_0x482559['attributes']=_['intersection'](_0x3b2c32[_0x6393('0x32')],qs[_0x6393('0x37')](_0x38555c['query']['fields']));_0x482559[_0x6393('0x38')]=_0x482559[_0x6393('0x38')][_0x6393('0x39')]?_0x482559[_0x6393('0x38')]:_0x3b2c32[_0x6393('0x32')];if(_0x38555c[_0x6393('0x34')]['includeAll']){_0x482559[_0x6393('0x3a')]=[{'all':!![]}];}_0x482559=_[_0x6393('0x3b')]({},_0x482559,_0x38555c[_0x6393('0x3c')]);return db[_0x6393('0x3d')][_0x6393('0x3e')](_0x482559)['then'](handleEntityNotFound(_0x129968,null))[_0x6393('0x2a')](respondWithResult(_0x129968,null))['catch'](handleError(_0x129968,null));};exports[_0x6393('0x2b')]=function(_0x5b5687,_0x5dbfac){return db[_0x6393('0x3d')][_0x6393('0x3e')]({'where':{'id':_0x5b5687[_0x6393('0x31')]['id']}})['then'](handleEntityNotFound(_0x5dbfac,null))['then'](removeEntity(_0x5dbfac,null))['catch'](handleError(_0x5dbfac,null));};function widgetAttributes(_0x36ab34){try{switch(_0x36ab34[_0x6393('0x3f')]){case _0x6393('0x40'):return[{'name':'attrUrl','value':_0x36ab34[_0x6393('0x41')]||(_0x36ab34['attrs']&&_0x36ab34['attrs'][0x0]?_0x36ab34[_0x6393('0x42')][0x0][_0x6393('0x43')]:undefined)||'https://'}];case'custom':return[{'name':_0x6393('0x44'),'value':_0x36ab34[_0x6393('0x44')]||(_0x36ab34[_0x6393('0x42')]&&_0x36ab34[_0x6393('0x42')][0x0]?_0x36ab34[_0x6393('0x42')][0x0][_0x6393('0x43')]:undefined)||''}];case _0x6393('0x45'):return[{'name':_0x6393('0x46'),'value':_0x36ab34[_0x6393('0x46')]||(_0x36ab34[_0x6393('0x42')]&&_0x36ab34[_0x6393('0x42')][0x0]?_0x36ab34[_0x6393('0x42')][0x0][_0x6393('0x43')]:undefined)||_0x6393('0x47')},{'name':'attrTimezone','value':_0x36ab34[_0x6393('0x48')]||(_0x36ab34[_0x6393('0x42')]&&_0x36ab34[_0x6393('0x42')][0x1]?_0x36ab34[_0x6393('0x42')][0x1][_0x6393('0x43')]:undefined)||'0.00'},{'name':_0x6393('0x49'),'value':_0x36ab34[_0x6393('0x49')]||(_0x36ab34['attrs']&&_0x36ab34['attrs'][0x2]?_0x36ab34[_0x6393('0x42')][0x2]['value']:undefined)||0xc}];case _0x6393('0x4a'):return[{'name':_0x6393('0x4b'),'value':_0x36ab34['attrMetric']||(_0x36ab34[_0x6393('0x42')]&&_0x36ab34[_0x6393('0x42')][0x0]?_0x36ab34[_0x6393('0x42')][0x0][_0x6393('0x43')]:undefined)||_0x6393('0x4c')},{'name':'attrVoiceQueues','value':_0x36ab34[_0x6393('0x4d')]||(_0x36ab34[_0x6393('0x42')]&&_0x36ab34[_0x6393('0x42')][0x1]?_0x36ab34[_0x6393('0x42')][0x1][_0x6393('0x43')]:undefined)||[]},{'name':_0x6393('0x49'),'value':_0x36ab34[_0x6393('0x49')]||(_0x36ab34[_0x6393('0x42')]&&_0x36ab34['attrs'][0x2]?_0x36ab34['attrs'][0x2][_0x6393('0x43')]:undefined)||0x14}];case'multibar-chart':case _0x6393('0x4e'):return[{'name':_0x6393('0x4f'),'value':_0x36ab34[_0x6393('0x4f')]||(_0x36ab34['attrs']&&_0x36ab34[_0x6393('0x42')][0x0]?_0x36ab34[_0x6393('0x42')][0x0][_0x6393('0x43')]:undefined)||_0x6393('0x4c')},{'name':_0x6393('0x50'),'value':_0x36ab34[_0x6393('0x50')]||(_0x36ab34[_0x6393('0x42')]&&_0x36ab34['attrs'][0x1]?_0x36ab34[_0x6393('0x42')][0x1][_0x6393('0x43')]:undefined)||null},{'name':_0x6393('0x51'),'value':_0x36ab34[_0x6393('0x51')]||(_0x36ab34[_0x6393('0x42')]&&_0x36ab34['attrs'][0x2]?_0x36ab34[_0x6393('0x42')][0x2][_0x6393('0x43')]:undefined)||null},{'name':_0x6393('0x4d'),'value':_0x36ab34[_0x6393('0x4d')]||(_0x36ab34[_0x6393('0x42')]&&_0x36ab34[_0x6393('0x42')][0x3]?_0x36ab34[_0x6393('0x42')][0x3][_0x6393('0x43')]:undefined)||[]}];case _0x6393('0x52'):return[{'name':'attrReport','type':_0x36ab34[_0x6393('0x53')]||(_0x36ab34[_0x6393('0x42')]&&_0x36ab34[_0x6393('0x42')][0x0]?_0x36ab34[_0x6393('0x42')][0x0]['type']:undefined)||null,'value':_0x36ab34['attrReport']||(_0x36ab34['attrs']&&_0x36ab34['attrs'][0x0]?_0x36ab34[_0x6393('0x42')][0x0]['value']:undefined)||null},{'name':_0x6393('0x54'),'value':_0x36ab34[_0x6393('0x54')]||(_0x36ab34['attrs']&&_0x36ab34[_0x6393('0x42')][0x1]?_0x36ab34[_0x6393('0x42')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3bb237){logger[_0x6393('0x2c')]('widgetAttributes:\x20%s',JSON['stringify'](_0x3bb237));return[];}}exports[_0x6393('0x55')]=function(_0x581a9d,_0x53757e){if(_0x581a9d[_0x6393('0x56')]){_0x581a9d['body'][_0x6393('0x42')]=widgetAttributes(_0x581a9d[_0x6393('0x56')]);}return db['DashboardItem']['create'](_0x581a9d[_0x6393('0x56')],{})[_0x6393('0x2a')](respondWithResult(_0x53757e,0xc9))['catch'](handleError(_0x53757e,null));};exports[_0x6393('0x57')]=function(_0x571896,_0xcb1495){if(_0x571896['body']['id']){delete _0x571896[_0x6393('0x56')]['id'];}_0x571896[_0x6393('0x56')][_0x6393('0x42')]=widgetAttributes(_0x571896[_0x6393('0x56')]);return db['DashboardItem'][_0x6393('0x3e')]({'where':{'id':_0x571896[_0x6393('0x31')]['id']}})['then'](handleEntityNotFound(_0xcb1495,null))[_0x6393('0x2a')](saveUpdates(_0x571896[_0x6393('0x56')],null))['then'](respondWithResult(_0xcb1495,null))[_0x6393('0x58')](handleError(_0xcb1495,null));}; \ No newline at end of file +var _0xb30f=['body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../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','offset','json','apply','reject','update','then','destroy','error','stack','name','send','show','params','keys','DashboardItem','filters','intersection','model','attributes','fields','includeAll','merge','options','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0xb30f,0x109));var _0xfb30=function(_0x1af78b,_0x216a77){_0x1af78b=_0x1af78b-0x0;var _0x127c93=_0xb30f[_0x1af78b];return _0x127c93;};'use strict';var pdf=require(_0xfb30('0x0'));var emlformat=require(_0xfb30('0x1'));var rimraf=require(_0xfb30('0x2'));var zipdir=require(_0xfb30('0x3'));var jsonpatch=require(_0xfb30('0x4'));var rp=require('request-promise');var moment=require(_0xfb30('0x5'));var BPromise=require(_0xfb30('0x6'));var Mustache=require(_0xfb30('0x7'));var util=require('util');var path=require(_0xfb30('0x8'));var sox=require(_0xfb30('0x9'));var csv=require(_0xfb30('0xa'));var ejs=require(_0xfb30('0xb'));var fs=require('fs');var _=require(_0xfb30('0xc'));var squel=require('squel');var crypto=require(_0xfb30('0xd'));var jsforce=require(_0xfb30('0xe'));var deskjs=require(_0xfb30('0xf'));var toCsv=require(_0xfb30('0xa'));var querystring=require(_0xfb30('0x10'));var Papa=require('papaparse');var authService=require(_0xfb30('0x11'));var hardwareService=require(_0xfb30('0x12'));var Redis=require(_0xfb30('0x13'));var qs=require(_0xfb30('0x14'));var logger=require(_0xfb30('0x15'))(_0xfb30('0x16'));var utils=require(_0xfb30('0x17'));var config=require(_0xfb30('0x18'));var db=require('../../mysqldb')['db'];config[_0xfb30('0x19')]=_['defaults'](config[_0xfb30('0x19')],{'host':_0xfb30('0x1a'),'port':0x18eb});var socket=require(_0xfb30('0x1b'))(new Redis(config[_0xfb30('0x19')]));require(_0xfb30('0x1c'))[_0xfb30('0x1d')](socket);function respondWithStatusCode(_0x4ce80a,_0x47be36){_0x47be36=_0x47be36||0xcc;return function(_0x1c4f08){if(_0x1c4f08){return _0x4ce80a[_0xfb30('0x1e')](_0x47be36);}return _0x4ce80a[_0xfb30('0x1f')](_0x47be36)[_0xfb30('0x20')]();};}function respondWithResult(_0x443282,_0x2fd24d){_0x2fd24d=_0x2fd24d||0xc8;return function(_0x805cba){if(_0x805cba){return _0x443282['status'](_0x2fd24d)['json'](_0x805cba);}};}function respondWithFilteredResult(_0xb1c99e,_0x1261e3){return function(_0x3290a8){if(_0x3290a8){var _0x386dd4=_0x3290a8['count'],_0x1099d4=_0x1261e3[_0xfb30('0x21')],_0x11438e=_0x1261e3[_0xfb30('0x21')]+_0x1261e3['limit'],_0x56402e;if(_0x11438e>=_0x386dd4){_0x11438e=_0x386dd4;_0x56402e=0xc8;}else{_0x56402e=0xce;}_0xb1c99e[_0xfb30('0x1f')](_0x56402e);return _0xb1c99e['set']('Content-Range',_0x1099d4+'-'+_0x11438e+'/'+_0x386dd4)[_0xfb30('0x22')](_0x3290a8);}return null;};}function patchUpdates(_0x12972b){return function(_0x58d207){try{jsonpatch[_0xfb30('0x23')](_0x58d207,_0x12972b,!![]);}catch(_0x45d441){return BPromise[_0xfb30('0x24')](_0x45d441);}return _0x58d207['save']();};}function saveUpdates(_0x47fafa,_0x10a64d){return function(_0x286f20){if(_0x286f20){return _0x286f20[_0xfb30('0x25')](_0x47fafa)[_0xfb30('0x26')](function(_0x5899c0){return _0x5899c0;});}return null;};}function removeEntity(_0x2449c6,_0xeb8c09){return function(_0x50d75c){if(_0x50d75c){return _0x50d75c[_0xfb30('0x27')]()[_0xfb30('0x26')](function(){_0x2449c6[_0xfb30('0x1f')](0xcc)[_0xfb30('0x20')]();});}};}function handleEntityNotFound(_0x26dbbb,_0x385ef6){return function(_0x39dc68){if(!_0x39dc68){_0x26dbbb[_0xfb30('0x1e')](0x194);}return _0x39dc68;};}function handleError(_0x2b8549,_0x46dd0c){_0x46dd0c=_0x46dd0c||0x1f4;return function(_0x3c5fcb){logger[_0xfb30('0x28')](_0x3c5fcb[_0xfb30('0x29')]);if(_0x3c5fcb[_0xfb30('0x2a')]){delete _0x3c5fcb[_0xfb30('0x2a')];}_0x2b8549[_0xfb30('0x1f')](_0x46dd0c)[_0xfb30('0x2b')](_0x3c5fcb);};}exports[_0xfb30('0x2c')]=function(_0x497d57,_0x36f7a4){var _0x3d74eb={'raw':![],'where':{'id':_0x497d57[_0xfb30('0x2d')]['id']}},_0x514277={};_0x514277['model']=_[_0xfb30('0x2e')](db[_0xfb30('0x2f')]['rawAttributes']);_0x514277['query']=_[_0xfb30('0x2e')](_0x497d57['query']);_0x514277[_0xfb30('0x30')]=_[_0xfb30('0x31')](_0x514277[_0xfb30('0x32')],_0x514277['query']);_0x3d74eb[_0xfb30('0x33')]=_[_0xfb30('0x31')](_0x514277[_0xfb30('0x32')],qs[_0xfb30('0x34')](_0x497d57['query'][_0xfb30('0x34')]));_0x3d74eb[_0xfb30('0x33')]=_0x3d74eb[_0xfb30('0x33')]['length']?_0x3d74eb[_0xfb30('0x33')]:_0x514277[_0xfb30('0x32')];if(_0x497d57['query'][_0xfb30('0x35')]){_0x3d74eb['include']=[{'all':!![]}];}_0x3d74eb=_[_0xfb30('0x36')]({},_0x3d74eb,_0x497d57[_0xfb30('0x37')]);return db[_0xfb30('0x2f')][_0xfb30('0x38')](_0x3d74eb)[_0xfb30('0x26')](handleEntityNotFound(_0x36f7a4,null))[_0xfb30('0x26')](respondWithResult(_0x36f7a4,null))[_0xfb30('0x39')](handleError(_0x36f7a4,null));};exports[_0xfb30('0x27')]=function(_0x3788cc,_0x51b8b5){return db[_0xfb30('0x2f')][_0xfb30('0x38')]({'where':{'id':_0x3788cc[_0xfb30('0x2d')]['id']}})[_0xfb30('0x26')](handleEntityNotFound(_0x51b8b5,null))['then'](removeEntity(_0x51b8b5,null))[_0xfb30('0x39')](handleError(_0x51b8b5,null));};function widgetAttributes(_0x4d9ccb){try{switch(_0x4d9ccb[_0xfb30('0x3a')]){case _0xfb30('0x3b'):return[{'name':'attrUrl','value':_0x4d9ccb[_0xfb30('0x3c')]||(_0x4d9ccb[_0xfb30('0x3d')]&&_0x4d9ccb['attrs'][0x0]?_0x4d9ccb[_0xfb30('0x3d')][0x0]['value']:undefined)||_0xfb30('0x3e')}];case _0xfb30('0x3f'):return[{'name':_0xfb30('0x40'),'value':_0x4d9ccb[_0xfb30('0x40')]||(_0x4d9ccb['attrs']&&_0x4d9ccb[_0xfb30('0x3d')][0x0]?_0x4d9ccb[_0xfb30('0x3d')][0x0][_0xfb30('0x41')]:undefined)||''}];case _0xfb30('0x42'):return[{'name':_0xfb30('0x43'),'value':_0x4d9ccb[_0xfb30('0x43')]||(_0x4d9ccb[_0xfb30('0x3d')]&&_0x4d9ccb[_0xfb30('0x3d')][0x0]?_0x4d9ccb[_0xfb30('0x3d')][0x0]['value']:undefined)||_0xfb30('0x44')},{'name':_0xfb30('0x45'),'value':_0x4d9ccb[_0xfb30('0x45')]||(_0x4d9ccb[_0xfb30('0x3d')]&&_0x4d9ccb[_0xfb30('0x3d')][0x1]?_0x4d9ccb[_0xfb30('0x3d')][0x1][_0xfb30('0x41')]:undefined)||_0xfb30('0x46')},{'name':_0xfb30('0x47'),'value':_0x4d9ccb[_0xfb30('0x47')]||(_0x4d9ccb[_0xfb30('0x3d')]&&_0x4d9ccb[_0xfb30('0x3d')][0x2]?_0x4d9ccb[_0xfb30('0x3d')][0x2][_0xfb30('0x41')]:undefined)||0xc}];case _0xfb30('0x48'):return[{'name':_0xfb30('0x49'),'value':_0x4d9ccb[_0xfb30('0x49')]||(_0x4d9ccb[_0xfb30('0x3d')]&&_0x4d9ccb[_0xfb30('0x3d')][0x0]?_0x4d9ccb[_0xfb30('0x3d')][0x0][_0xfb30('0x41')]:undefined)||_0xfb30('0x4a')},{'name':_0xfb30('0x4b'),'value':_0x4d9ccb['attrVoiceQueues']||(_0x4d9ccb[_0xfb30('0x3d')]&&_0x4d9ccb[_0xfb30('0x3d')][0x1]?_0x4d9ccb['attrs'][0x1][_0xfb30('0x41')]:undefined)||[]},{'name':_0xfb30('0x47'),'value':_0x4d9ccb[_0xfb30('0x47')]||(_0x4d9ccb[_0xfb30('0x3d')]&&_0x4d9ccb[_0xfb30('0x3d')][0x2]?_0x4d9ccb[_0xfb30('0x3d')][0x2][_0xfb30('0x41')]:undefined)||0x14}];case _0xfb30('0x4c'):case _0xfb30('0x4d'):return[{'name':_0xfb30('0x4e'),'value':_0x4d9ccb[_0xfb30('0x4e')]||(_0x4d9ccb['attrs']&&_0x4d9ccb['attrs'][0x0]?_0x4d9ccb['attrs'][0x0]['value']:undefined)||_0xfb30('0x4a')},{'name':_0xfb30('0x4f'),'value':_0x4d9ccb[_0xfb30('0x4f')]||(_0x4d9ccb['attrs']&&_0x4d9ccb[_0xfb30('0x3d')][0x1]?_0x4d9ccb[_0xfb30('0x3d')][0x1][_0xfb30('0x41')]:undefined)||null},{'name':_0xfb30('0x50'),'value':_0x4d9ccb['attrSerie3']||(_0x4d9ccb[_0xfb30('0x3d')]&&_0x4d9ccb['attrs'][0x2]?_0x4d9ccb[_0xfb30('0x3d')][0x2][_0xfb30('0x41')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x4d9ccb[_0xfb30('0x4b')]||(_0x4d9ccb[_0xfb30('0x3d')]&&_0x4d9ccb[_0xfb30('0x3d')][0x3]?_0x4d9ccb[_0xfb30('0x3d')][0x3][_0xfb30('0x41')]:undefined)||[]}];case'web-report':return[{'name':_0xfb30('0x51'),'type':_0x4d9ccb[_0xfb30('0x52')]||(_0x4d9ccb[_0xfb30('0x3d')]&&_0x4d9ccb[_0xfb30('0x3d')][0x0]?_0x4d9ccb[_0xfb30('0x3d')][0x0][_0xfb30('0x3a')]:undefined)||null,'value':_0x4d9ccb[_0xfb30('0x51')]||(_0x4d9ccb[_0xfb30('0x3d')]&&_0x4d9ccb['attrs'][0x0]?_0x4d9ccb[_0xfb30('0x3d')][0x0][_0xfb30('0x41')]:undefined)||null},{'name':'attrRefresh','value':_0x4d9ccb[_0xfb30('0x53')]||(_0x4d9ccb[_0xfb30('0x3d')]&&_0x4d9ccb[_0xfb30('0x3d')][0x1]?_0x4d9ccb[_0xfb30('0x3d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3af063){logger[_0xfb30('0x28')](_0xfb30('0x54'),JSON[_0xfb30('0x55')](_0x3af063));return[];}}exports[_0xfb30('0x56')]=function(_0x432af5,_0x58ca80){if(_0x432af5[_0xfb30('0x57')]){_0x432af5[_0xfb30('0x57')][_0xfb30('0x3d')]=widgetAttributes(_0x432af5[_0xfb30('0x57')]);}return db['DashboardItem']['create'](_0x432af5['body'],{})[_0xfb30('0x26')](respondWithResult(_0x58ca80,0xc9))['catch'](handleError(_0x58ca80,null));};exports[_0xfb30('0x25')]=function(_0x2b8cc7,_0x4ed641){if(_0x2b8cc7[_0xfb30('0x57')]['id']){delete _0x2b8cc7[_0xfb30('0x57')]['id'];}_0x2b8cc7[_0xfb30('0x57')]['attrs']=widgetAttributes(_0x2b8cc7[_0xfb30('0x57')]);return db[_0xfb30('0x2f')][_0xfb30('0x38')]({'where':{'id':_0x2b8cc7[_0xfb30('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4ed641,null))[_0xfb30('0x26')](saveUpdates(_0x2b8cc7[_0xfb30('0x57')],null))[_0xfb30('0x26')](respondWithResult(_0x4ed641,null))['catch'](handleError(_0x4ed641,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 41d447a..8aa1a64 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 _0xe4f7=['events','../../mysqldb','DashboardItem','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2eefb8,_0x15fd4b){var _0x4e8763=function(_0x3d633e){while(--_0x3d633e){_0x2eefb8['push'](_0x2eefb8['shift']());}};_0x4e8763(++_0x15fd4b);}(_0xe4f7,0xf0));var _0x7e4f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe4f7[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x7e4f('0x0'));var DashboardItem=require(_0x7e4f('0x1'))['db'][_0x7e4f('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7e4f('0x3')](0x0);var events={'afterCreate':_0x7e4f('0x4'),'afterUpdate':'update','afterDestroy':_0x7e4f('0x5')};function emitEvent(_0x92ac43){return function(_0x4b2fdc,_0x388dd2,_0x1472cd){DashboardItemEvents['emit'](_0x92ac43+':'+_0x4b2fdc['id'],_0x4b2fdc);DashboardItemEvents[_0x7e4f('0x6')](_0x92ac43,_0x4b2fdc);_0x1472cd(null);};}for(var e in events){if(events[_0x7e4f('0x7')](e)){var event=events[e];DashboardItem[_0x7e4f('0x8')](e,emitEvent(event));}}module[_0x7e4f('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0xf052=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xf052,0x1ae));var _0x2f05=function(_0xd93b26,_0x12bbf2){_0xd93b26=_0xd93b26-0x0;var _0x25f668=_0xf052[_0xd93b26];return _0x25f668;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x2f05('0x0'))['db'][_0x2f05('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x2f05('0x2')](0x0);var events={'afterCreate':_0x2f05('0x3'),'afterUpdate':_0x2f05('0x4'),'afterDestroy':_0x2f05('0x5')};function emitEvent(_0x1fc254){return function(_0x1b0985,_0x24eed4,_0x3afb13){DashboardItemEvents[_0x2f05('0x6')](_0x1fc254+':'+_0x1b0985['id'],_0x1b0985);DashboardItemEvents['emit'](_0x1fc254,_0x1b0985);_0x3afb13(null);};}for(var e in events){if(events[_0x2f05('0x7')](e)){var event=events[e];DashboardItem[_0x2f05('0x8')](e,emitEvent(event));}}module[_0x2f05('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 1ec5aa1..9f88ac9 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(_0x446f11,_0x95cf21){var _0x385cb5=function(_0x426715){while(--_0x426715){_0x446f11['push'](_0x446f11['shift']());}};_0x385cb5(++_0x95cf21);}(_0x7a54,0x106));var _0x47a5=function(_0x37ab3c,_0xeddd59){_0x37ab3c=_0x37ab3c-0x0;var _0x3e399f=_0x7a54[_0x37ab3c];return _0x3e399f;};'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(_0x451d28,_0x1bca56){var _0x3a4497=function(_0x30bdb5){while(--_0x30bdb5){_0x451d28['push'](_0x451d28['shift']());}};_0x3a4497(++_0x1bca56);}(_0x7a54,0x106));var _0x47a5=function(_0x156646,_0x11389b){_0x156646=_0x156646-0x0;var _0x288041=_0x7a54[_0x156646];return _0x288041;};'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 39714a0..67cb17e 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 _0x9c77=['request\x20sent','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','info','result','catch','util','moment','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x2a92a4,_0x5ca2ec){var _0x383acc=function(_0x5a040d){while(--_0x5a040d){_0x2a92a4['push'](_0x2a92a4['shift']());}};_0x383acc(++_0x5ca2ec);}(_0x9c77,0x1ab));var _0x79c7=function(_0x4d36ff,_0x20eeb1){_0x4d36ff=_0x4d36ff-0x0;var _0x33c568=_0x9c77[_0x4d36ff];return _0x33c568;};'use strict';var _=require('lodash');var util=require(_0x79c7('0x0'));var moment=require(_0x79c7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x79c7('0x2'));var logger=require('../../config/logger')(_0x79c7('0x3'));var config=require(_0x79c7('0x4'));var jayson=require(_0x79c7('0x5'));var client=jayson[_0x79c7('0x6')]['http']({'port':0x232a});config[_0x79c7('0x7')]=_[_0x79c7('0x8')](config['redis'],{'host':_0x79c7('0x9'),'port':0x18eb});var socket=require(_0x79c7('0xa'))(new Redis(config[_0x79c7('0x7')]));require(_0x79c7('0xb'))[_0x79c7('0xc')](socket);function respondWithRpcPromise(_0x1829bc,_0x59e58a,_0x446370){return new BPromise(function(_0x36baf,_0xc1ea34){return client['request'](_0x1829bc,_0x446370)['then'](function(_0x810297){logger['info']('DashboardItem,\x20%s,\x20%s',_0x59e58a,_0x79c7('0xd'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x59e58a,'request\x20sent',JSON[_0x79c7('0xe')](_0x810297));if(_0x810297[_0x79c7('0xf')]){if(_0x810297[_0x79c7('0xf')][_0x79c7('0x10')]===0x1f4){logger[_0x79c7('0xf')](_0x79c7('0x11'),_0x59e58a,_0x810297[_0x79c7('0xf')][_0x79c7('0x12')]);return _0xc1ea34(_0x810297[_0x79c7('0xf')][_0x79c7('0x12')]);}logger[_0x79c7('0xf')](_0x79c7('0x11'),_0x59e58a,_0x810297[_0x79c7('0xf')]['message']);return _0x36baf(_0x810297[_0x79c7('0xf')][_0x79c7('0x12')]);}else{logger[_0x79c7('0x13')]('DashboardItem,\x20%s,\x20%s',_0x59e58a,_0x79c7('0xd'));_0x36baf(_0x810297[_0x79c7('0x14')][_0x79c7('0x12')]);}})[_0x79c7('0x15')](function(_0x48ad0b){logger[_0x79c7('0xf')]('DashboardItem,\x20%s,\x20%s',_0x59e58a,_0x48ad0b);_0xc1ea34(_0x48ad0b);});});} \ No newline at end of file +var _0xc625=['jayson/promise','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0xc625,0xc0));var _0x5c62=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xc625[_0xf79bae];return _0x5d2cb7;};'use strict';var _=require(_0x5c62('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5c62('0x1'));var fs=require('fs');var Redis=require(_0x5c62('0x2'));var db=require(_0x5c62('0x3'))['db'];var utils=require(_0x5c62('0x4'));var logger=require(_0x5c62('0x5'))(_0x5c62('0x6'));var config=require(_0x5c62('0x7'));var jayson=require(_0x5c62('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x5c62('0x9')]=_['defaults'](config['redis'],{'host':_0x5c62('0xa'),'port':0x18eb});var socket=require(_0x5c62('0xb'))(new Redis(config[_0x5c62('0x9')]));require(_0x5c62('0xc'))[_0x5c62('0xd')](socket);function respondWithRpcPromise(_0x163172,_0x58fac9,_0x574ebc){return new BPromise(function(_0x536fc4,_0x4a2fce){return client[_0x5c62('0xe')](_0x163172,_0x574ebc)[_0x5c62('0xf')](function(_0x38231c){logger['info'](_0x5c62('0x10'),_0x58fac9,_0x5c62('0x11'));logger[_0x5c62('0x12')](_0x5c62('0x13'),_0x58fac9,_0x5c62('0x11'),JSON[_0x5c62('0x14')](_0x38231c));if(_0x38231c[_0x5c62('0x15')]){if(_0x38231c[_0x5c62('0x15')]['code']===0x1f4){logger[_0x5c62('0x15')]('DashboardItem,\x20%s,\x20%s',_0x58fac9,_0x38231c[_0x5c62('0x15')][_0x5c62('0x16')]);return _0x4a2fce(_0x38231c[_0x5c62('0x15')][_0x5c62('0x16')]);}logger[_0x5c62('0x15')](_0x5c62('0x10'),_0x58fac9,_0x38231c[_0x5c62('0x15')]['message']);return _0x536fc4(_0x38231c[_0x5c62('0x15')][_0x5c62('0x16')]);}else{logger[_0x5c62('0x17')](_0x5c62('0x10'),_0x58fac9,'request\x20sent');_0x536fc4(_0x38231c[_0x5c62('0x18')]['message']);}})['catch'](function(_0x46588a){logger[_0x5c62('0x15')]('DashboardItem,\x20%s,\x20%s',_0x58fac9,_0x46588a);_0x4a2fce(_0x46588a);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 25c870d..c43167a 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 _0x7217=['dashboardItem:','./dashboardItem.events','remove','update','removeListener','register','length'];(function(_0xd281e2,_0x5b9fc4){var _0xfbc4e1=function(_0x1cc27c){while(--_0x1cc27c){_0xd281e2['push'](_0xd281e2['shift']());}};_0xfbc4e1(++_0x5b9fc4);}(_0x7217,0x19e));var _0x7721=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x7217[_0x13ea00];return _0x1f7347;};'use strict';var DashboardItemEvents=require(_0x7721('0x0'));var events=['save',_0x7721('0x1'),_0x7721('0x2')];function createListener(_0x1de988,_0x2a78d8){return function(_0x115ab3){_0x2a78d8['emit'](_0x1de988,_0x115ab3);};}function removeListener(_0x5bf160,_0x472a96){return function(){DashboardItemEvents[_0x7721('0x3')](_0x5bf160,_0x472a96);};}exports[_0x7721('0x4')]=function(_0x3fe47c){for(var _0xb239e0=0x0,_0xf7ff37=events[_0x7721('0x5')];_0xb239e0<_0xf7ff37;_0xb239e0++){var _0x21f680=events[_0xb239e0];var _0x225610=createListener(_0x7721('0x6')+_0x21f680,_0x3fe47c);DashboardItemEvents['on'](_0x21f680,_0x225610);}}; \ No newline at end of file +var _0x34e8=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x20bc10,_0x35bed9){var _0x3bd5ce=function(_0x8d1e4c){while(--_0x8d1e4c){_0x20bc10['push'](_0x20bc10['shift']());}};_0x3bd5ce(++_0x35bed9);}(_0x34e8,0x12c));var _0x834e=function(_0xb0bd3c,_0x56e732){_0xb0bd3c=_0xb0bd3c-0x0;var _0x1582eb=_0x34e8[_0xb0bd3c];return _0x1582eb;};'use strict';var DashboardItemEvents=require(_0x834e('0x0'));var events=[_0x834e('0x1'),_0x834e('0x2'),_0x834e('0x3')];function createListener(_0x530939,_0x832422){return function(_0x21e2e0){_0x832422[_0x834e('0x4')](_0x530939,_0x21e2e0);};}function removeListener(_0x31bf20,_0x289ef2){return function(){DashboardItemEvents[_0x834e('0x5')](_0x31bf20,_0x289ef2);};}exports[_0x834e('0x6')]=function(_0x4a2018){for(var _0x858aa1=0x0,_0x52056d=events[_0x834e('0x7')];_0x858aa1<_0x52056d;_0x858aa1++){var _0x3cc2e3=events[_0x858aa1];var _0x3a3ef6=createListener(_0x834e('0x8')+_0x3cc2e3,_0x4a2018);DashboardItemEvents['on'](_0x3cc2e3,_0x3a3ef6);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 696ad55..83750a3 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 _0x8dbe=['/:id','isAuthenticated','show','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x54e05a,_0x4e44e7){var _0x3ed704=function(_0x30301d){while(--_0x30301d){_0x54e05a['push'](_0x54e05a['shift']());}};_0x3ed704(++_0x4e44e7);}(_0x8dbe,0xf8));var _0xe8db=function(_0x3d2c73,_0x431958){_0x3d2c73=_0x3d2c73-0x0;var _0xb7712f=_0x8dbe[_0x3d2c73];return _0xb7712f;};'use strict';var multer=require(_0xe8db('0x0'));var util=require('util');var path=require(_0xe8db('0x1'));var timeout=require(_0xe8db('0x2'));var express=require(_0xe8db('0x3'));var router=express[_0xe8db('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe8db('0x5'));var config=require(_0xe8db('0x6'));var controller=require('./dashboardItem.controller');router[_0xe8db('0x7')](_0xe8db('0x8'),auth[_0xe8db('0x9')](),controller[_0xe8db('0xa')]);router['post']('/',auth[_0xe8db('0x9')](),controller[_0xe8db('0xb')]);router[_0xe8db('0xc')](_0xe8db('0x8'),auth[_0xe8db('0x9')](),controller[_0xe8db('0xd')]);router['delete'](_0xe8db('0x8'),auth[_0xe8db('0x9')](),controller[_0xe8db('0xe')]);module[_0xe8db('0xf')]=router; \ No newline at end of file +var _0x448c=['./dashboardItem.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0x448c,0xf4));var _0xc448=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x448c[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xc448('0x0'));var path=require(_0xc448('0x1'));var timeout=require(_0xc448('0x2'));var express=require(_0xc448('0x3'));var router=express[_0xc448('0x4')]();var auth=require(_0xc448('0x5'));var interaction=require(_0xc448('0x6'));var config=require(_0xc448('0x7'));var controller=require(_0xc448('0x8'));router[_0xc448('0x9')](_0xc448('0xa'),auth[_0xc448('0xb')](),controller[_0xc448('0xc')]);router[_0xc448('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc448('0xe')](_0xc448('0xa'),auth[_0xc448('0xb')](),controller['update']);router[_0xc448('0xf')](_0xc448('0xa'),auth[_0xc448('0xb')](),controller[_0xc448('0x10')]);module[_0xc448('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 890a42e..e9dc207 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 _0x2a53=['sequelize','STRING'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x2a53,0x1de));var _0x32a5=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0x2a53[_0x56740a];return _0x257144;};'use strict';var Sequelize=require(_0x32a5('0x0'));module['exports']={'name':{'type':Sequelize[_0x32a5('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x35ef=['exports','STRING','sequelize'];(function(_0x51706b,_0x25efcb){var _0x5433db=function(_0x4150cc){while(--_0x4150cc){_0x51706b['push'](_0x51706b['shift']());}};_0x5433db(++_0x25efcb);}(_0x35ef,0x176));var _0xf35e=function(_0x15f8cc,_0x277506){_0x15f8cc=_0x15f8cc-0x0;var _0x526e05=_0x35ef[_0x15f8cc];return _0x526e05;};'use strict';var Sequelize=require(_0xf35e('0x0'));module[_0xf35e('0x1')]={'name':{'type':Sequelize[_0xf35e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index f7886f1..cee1c59 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 _0x6556=['model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','type','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','catch','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','limit','set','Content-Range','apply','reject','then','destroy','get','Dispositions','UserProfileResource','sendStatus','error','stack','name','send','index','Disposition','rawAttributes'];(function(_0x210194,_0x2f16f6){var _0x4f3a23=function(_0x4094ab){while(--_0x4094ab){_0x210194['push'](_0x210194['shift']());}};_0x4f3a23(++_0x2f16f6);}(_0x6556,0x15e));var _0x6655=function(_0x1c97e2,_0x43bebd){_0x1c97e2=_0x1c97e2-0x0;var _0x26f419=_0x6556[_0x1c97e2];return _0x26f419;};'use strict';var pdf=require(_0x6655('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6655('0x1'));var zipdir=require(_0x6655('0x2'));var jsonpatch=require(_0x6655('0x3'));var rp=require(_0x6655('0x4'));var moment=require(_0x6655('0x5'));var BPromise=require(_0x6655('0x6'));var Mustache=require('mustache');var util=require(_0x6655('0x7'));var path=require('path');var sox=require(_0x6655('0x8'));var csv=require('to-csv');var ejs=require(_0x6655('0x9'));var fs=require('fs');var _=require(_0x6655('0xa'));var squel=require(_0x6655('0xb'));var crypto=require(_0x6655('0xc'));var jsforce=require(_0x6655('0xd'));var deskjs=require(_0x6655('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6655('0xf'));var authService=require(_0x6655('0x10'));var hardwareService=require(_0x6655('0x11'));var Redis=require('ioredis');var qs=require(_0x6655('0x12'));var logger=require(_0x6655('0x13'))(_0x6655('0x14'));var utils=require(_0x6655('0x15'));var config=require(_0x6655('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dd038,_0x251237){_0x251237=_0x251237||0xcc;return function(_0x36b7a3){if(_0x36b7a3){return _0x3dd038['sendStatus'](_0x251237);}return _0x3dd038[_0x6655('0x17')](_0x251237)[_0x6655('0x18')]();};}function respondWithResult(_0x2a9767,_0x5e94fb){_0x5e94fb=_0x5e94fb||0xc8;return function(_0xc25750){if(_0xc25750){return _0x2a9767[_0x6655('0x17')](_0x5e94fb)[_0x6655('0x19')](_0xc25750);}};}function respondWithFilteredResult(_0x56c9f9,_0x3a6056){return function(_0x38fd17){if(_0x38fd17){var _0x44d343=_0x38fd17['count'],_0x555da4=_0x3a6056['offset'],_0x599cc6=_0x3a6056[_0x6655('0x1a')]+_0x3a6056[_0x6655('0x1b')],_0x1dd6d7;if(_0x599cc6>=_0x44d343){_0x599cc6=_0x44d343;_0x1dd6d7=0xc8;}else{_0x1dd6d7=0xce;}_0x56c9f9[_0x6655('0x17')](_0x1dd6d7);return _0x56c9f9[_0x6655('0x1c')](_0x6655('0x1d'),_0x555da4+'-'+_0x599cc6+'/'+_0x44d343)['json'](_0x38fd17);}return null;};}function patchUpdates(_0x479370){return function(_0x1c9970){try{jsonpatch[_0x6655('0x1e')](_0x1c9970,_0x479370,!![]);}catch(_0x18ce3c){return BPromise[_0x6655('0x1f')](_0x18ce3c);}return _0x1c9970['save']();};}function saveUpdates(_0x4fbbf6,_0x4bf115){return function(_0xbdc3f7){if(_0xbdc3f7){return _0xbdc3f7['update'](_0x4fbbf6)[_0x6655('0x20')](function(_0x3cf88a){return _0x3cf88a;});}return null;};}function removeEntity(_0x2e4bb0,_0x40eee0){return function(_0x3333c6){if(_0x3333c6){return _0x3333c6[_0x6655('0x21')]()[_0x6655('0x20')](function(){var _0x523c43=_0x3333c6[_0x6655('0x22')]({'plain':!![]});var _0x290e08=_0x6655('0x23');return db[_0x6655('0x24')][_0x6655('0x21')]({'where':{'type':_0x290e08,'resourceId':_0x523c43['id']}})[_0x6655('0x20')](function(){return _0x3333c6;});})['then'](function(){_0x2e4bb0[_0x6655('0x17')](0xcc)[_0x6655('0x18')]();});}};}function handleEntityNotFound(_0x481907,_0x14945a){return function(_0xf575b8){if(!_0xf575b8){_0x481907[_0x6655('0x25')](0x194);}return _0xf575b8;};}function handleError(_0x4596f0,_0xe2baa3){_0xe2baa3=_0xe2baa3||0x1f4;return function(_0x52bc3){logger[_0x6655('0x26')](_0x52bc3[_0x6655('0x27')]);if(_0x52bc3[_0x6655('0x28')]){delete _0x52bc3[_0x6655('0x28')];}_0x4596f0[_0x6655('0x17')](_0xe2baa3)[_0x6655('0x29')](_0x52bc3);};}exports[_0x6655('0x2a')]=function(_0x120b74,_0x2d07dc){var _0x74de17={},_0x35e52d={},_0x57ddbb={'count':0x0,'rows':[]};var _0x5bf750=db[_0x6655('0x2b')][_0x6655('0x2c')];_0x35e52d[_0x6655('0x2d')]=_[_0x6655('0x2e')](_0x5bf750);_0x35e52d[_0x6655('0x2f')]=_[_0x6655('0x2e')](_0x120b74['query']);_0x35e52d[_0x6655('0x30')]=_[_0x6655('0x31')](_0x35e52d[_0x6655('0x2d')],_0x35e52d['query']);_0x74de17[_0x6655('0x32')]=_[_0x6655('0x31')](_0x35e52d[_0x6655('0x2d')],qs[_0x6655('0x33')](_0x120b74['query'][_0x6655('0x33')]));_0x74de17['attributes']=_0x74de17[_0x6655('0x32')][_0x6655('0x34')]?_0x74de17[_0x6655('0x32')]:_0x35e52d[_0x6655('0x2d')];if(!_0x120b74[_0x6655('0x2f')]['hasOwnProperty'](_0x6655('0x35'))){_0x74de17[_0x6655('0x1b')]=qs[_0x6655('0x1b')](_0x120b74[_0x6655('0x2f')][_0x6655('0x1b')]);_0x74de17[_0x6655('0x1a')]=qs[_0x6655('0x1a')](_0x120b74[_0x6655('0x2f')][_0x6655('0x1a')]);}_0x74de17['order']=qs['sort'](_0x120b74[_0x6655('0x2f')][_0x6655('0x36')]);_0x74de17['where']=qs['filters'](_[_0x6655('0x37')](_0x120b74['query'],_0x35e52d['filters']));if(_0x120b74[_0x6655('0x2f')]['filter']){_0x74de17[_0x6655('0x38')]=_[_0x6655('0x39')](_0x74de17[_0x6655('0x38')],{'$or':_['map'](_0x5bf750,function(_0x52a49f){if(_0x52a49f[_0x6655('0x3a')][_0x6655('0x3b')]!==_0x6655('0x3c')){var _0x4e6962={};_0x4e6962[_0x52a49f[_0x6655('0x3d')]]={'$like':'%'+_0x120b74[_0x6655('0x2f')][_0x6655('0x3e')]+'%'};return _0x4e6962;}})});}_0x74de17=_[_0x6655('0x39')]({},_0x74de17,_0x120b74[_0x6655('0x3f')]);var _0x31a273={'where':_0x74de17['where']};return db[_0x6655('0x2b')][_0x6655('0x40')](_0x31a273)['then'](function(_0x2dc5bf){_0x57ddbb['count']=_0x2dc5bf;if(_0x120b74[_0x6655('0x2f')][_0x6655('0x41')]){_0x74de17[_0x6655('0x42')]=[{'all':!![]}];}return db[_0x6655('0x2b')][_0x6655('0x43')](_0x74de17);})[_0x6655('0x20')](function(_0x4713ed){_0x57ddbb['rows']=_0x4713ed;return _0x57ddbb;})[_0x6655('0x20')](respondWithFilteredResult(_0x2d07dc,_0x74de17))[_0x6655('0x44')](handleError(_0x2d07dc,null));};exports['show']=function(_0xcb5b67,_0xe28873){var _0x5b25f1={'raw':!![],'where':{'id':_0xcb5b67['params']['id']}},_0x5a689e={};_0x5a689e['model']=_[_0x6655('0x2e')](db[_0x6655('0x2b')][_0x6655('0x2c')]);_0x5a689e[_0x6655('0x2f')]=_['keys'](_0xcb5b67[_0x6655('0x2f')]);_0x5a689e[_0x6655('0x30')]=_[_0x6655('0x31')](_0x5a689e[_0x6655('0x2d')],_0x5a689e['query']);_0x5b25f1[_0x6655('0x32')]=_['intersection'](_0x5a689e[_0x6655('0x2d')],qs[_0x6655('0x33')](_0xcb5b67[_0x6655('0x2f')][_0x6655('0x33')]));_0x5b25f1[_0x6655('0x32')]=_0x5b25f1[_0x6655('0x32')][_0x6655('0x34')]?_0x5b25f1[_0x6655('0x32')]:_0x5a689e['model'];if(_0xcb5b67[_0x6655('0x2f')][_0x6655('0x41')]){_0x5b25f1[_0x6655('0x42')]=[{'all':!![]}];}_0x5b25f1=_[_0x6655('0x39')]({},_0x5b25f1,_0xcb5b67[_0x6655('0x3f')]);return db[_0x6655('0x2b')][_0x6655('0x45')](_0x5b25f1)[_0x6655('0x20')](handleEntityNotFound(_0xe28873,null))[_0x6655('0x20')](respondWithResult(_0xe28873,null))[_0x6655('0x44')](handleError(_0xe28873,null));};exports[_0x6655('0x46')]=function(_0x3c6081,_0x1e6140){return db['Disposition'][_0x6655('0x46')](_0x3c6081['body'],{})[_0x6655('0x20')](function(_0x4a0ee1){var _0x6f7e93=_0x3c6081[_0x6655('0x47')]['get']({'plain':!![]});if(!_0x6f7e93)throw new Error(_0x6655('0x48'));if(_0x6f7e93[_0x6655('0x49')]===_0x6655('0x47')){var _0x3e6411=_0x4a0ee1[_0x6655('0x22')]({'plain':!![]});var _0x30fc37=_0x6655('0x23');return db[_0x6655('0x4a')]['find']({'where':{'name':_0x30fc37,'userProfileId':_0x6f7e93[_0x6655('0x4b')]},'raw':!![]})['then'](function(_0x386601){if(_0x386601&&_0x386601['autoAssociation']===0x0){return db[_0x6655('0x24')][_0x6655('0x46')]({'name':_0x3e6411[_0x6655('0x28')],'resourceId':_0x3e6411['id'],'type':_0x386601[_0x6655('0x28')],'sectionId':_0x386601['id']},{})['then'](function(){return _0x4a0ee1;});}else{return _0x4a0ee1;}})[_0x6655('0x44')](function(_0x257439){logger[_0x6655('0x26')](_0x6655('0x4c'),_0x257439);throw _0x257439;});}return _0x4a0ee1;})[_0x6655('0x20')](respondWithResult(_0x1e6140,0xc9))[_0x6655('0x44')](handleError(_0x1e6140,null));};exports['update']=function(_0x53caa0,_0x24836a){if(_0x53caa0[_0x6655('0x4d')]['id']){delete _0x53caa0[_0x6655('0x4d')]['id'];}return db[_0x6655('0x2b')][_0x6655('0x45')]({'where':{'id':_0x53caa0[_0x6655('0x4e')]['id']}})['then'](handleEntityNotFound(_0x24836a,null))[_0x6655('0x20')](saveUpdates(_0x53caa0[_0x6655('0x4d')],null))[_0x6655('0x20')](respondWithResult(_0x24836a,null))[_0x6655('0x44')](handleError(_0x24836a,null));};exports[_0x6655('0x21')]=function(_0x5c9f01,_0x1d6a4d){return db[_0x6655('0x2b')]['find']({'where':{'id':_0x5c9f01[_0x6655('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1d6a4d,null))[_0x6655('0x20')](removeEntity(_0x1d6a4d,null))[_0x6655('0x44')](handleError(_0x1d6a4d,null));}; \ No newline at end of file +var _0x053f=['sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','Dispositions','UserProfileResource','name','send','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','type','key','field','Disposition','includeAll','include','rows','params','rawAttributes','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','api','../../config/utils'];(function(_0x496689,_0x1a71ea){var _0x1a3f4b=function(_0x576a0f){while(--_0x576a0f){_0x496689['push'](_0x496689['shift']());}};_0x1a3f4b(++_0x1a71ea);}(_0x053f,0x7d));var _0xf053=function(_0x196a3f,_0x3f9435){_0x196a3f=_0x196a3f-0x0;var _0x44f004=_0x053f[_0x196a3f];return _0x44f004;};'use strict';var pdf=require(_0xf053('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf053('0x1'));var zipdir=require(_0xf053('0x2'));var jsonpatch=require(_0xf053('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf053('0x4'));var util=require(_0xf053('0x5'));var path=require(_0xf053('0x6'));var sox=require(_0xf053('0x7'));var csv=require('to-csv');var ejs=require(_0xf053('0x8'));var fs=require('fs');var _=require(_0xf053('0x9'));var squel=require(_0xf053('0xa'));var crypto=require(_0xf053('0xb'));var jsforce=require(_0xf053('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf053('0xd'));var querystring=require(_0xf053('0xe'));var Papa=require(_0xf053('0xf'));var authService=require(_0xf053('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf053('0x11'));var utils=require(_0xf053('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f2a0c,_0x4bd8ba){_0x4bd8ba=_0x4bd8ba||0xcc;return function(_0x3b40d2){if(_0x3b40d2){return _0x5f2a0c[_0xf053('0x13')](_0x4bd8ba);}return _0x5f2a0c['status'](_0x4bd8ba)[_0xf053('0x14')]();};}function respondWithResult(_0x15d94c,_0x1e6711){_0x1e6711=_0x1e6711||0xc8;return function(_0x573b4c){if(_0x573b4c){return _0x15d94c[_0xf053('0x15')](_0x1e6711)[_0xf053('0x16')](_0x573b4c);}};}function respondWithFilteredResult(_0x188464,_0x114f63){return function(_0x4688ae){if(_0x4688ae){var _0x2a798a=_0x4688ae[_0xf053('0x17')],_0x3204c2=_0x114f63[_0xf053('0x18')],_0x5e97f6=_0x114f63[_0xf053('0x18')]+_0x114f63[_0xf053('0x19')],_0x1aab71;if(_0x5e97f6>=_0x2a798a){_0x5e97f6=_0x2a798a;_0x1aab71=0xc8;}else{_0x1aab71=0xce;}_0x188464['status'](_0x1aab71);return _0x188464[_0xf053('0x1a')](_0xf053('0x1b'),_0x3204c2+'-'+_0x5e97f6+'/'+_0x2a798a)['json'](_0x4688ae);}return null;};}function patchUpdates(_0x2b6efa){return function(_0x5b0bd7){try{jsonpatch['apply'](_0x5b0bd7,_0x2b6efa,!![]);}catch(_0xf1bf25){return BPromise[_0xf053('0x1c')](_0xf1bf25);}return _0x5b0bd7[_0xf053('0x1d')]();};}function saveUpdates(_0x13d3a9,_0xcdb29a){return function(_0x3901b0){if(_0x3901b0){return _0x3901b0[_0xf053('0x1e')](_0x13d3a9)[_0xf053('0x1f')](function(_0x3abe34){return _0x3abe34;});}return null;};}function removeEntity(_0x11b3d,_0x1fbf35){return function(_0x179dcc){if(_0x179dcc){return _0x179dcc[_0xf053('0x20')]()[_0xf053('0x1f')](function(){var _0x45c3e0=_0x179dcc['get']({'plain':!![]});var _0x378c1a=_0xf053('0x21');return db[_0xf053('0x22')]['destroy']({'where':{'type':_0x378c1a,'resourceId':_0x45c3e0['id']}})[_0xf053('0x1f')](function(){return _0x179dcc;});})['then'](function(){_0x11b3d[_0xf053('0x15')](0xcc)[_0xf053('0x14')]();});}};}function handleEntityNotFound(_0x2f8813,_0x23adc9){return function(_0x23bc0a){if(!_0x23bc0a){_0x2f8813[_0xf053('0x13')](0x194);}return _0x23bc0a;};}function handleError(_0x2d6e50,_0x247484){_0x247484=_0x247484||0x1f4;return function(_0x24f86f){logger['error'](_0x24f86f['stack']);if(_0x24f86f['name']){delete _0x24f86f[_0xf053('0x23')];}_0x2d6e50[_0xf053('0x15')](_0x247484)[_0xf053('0x24')](_0x24f86f);};}exports['index']=function(_0x108d3f,_0x206878){var _0x2bdad4={},_0x131021={},_0x44cdf7={'count':0x0,'rows':[]};var _0x5d728d=db['Disposition']['rawAttributes'];_0x131021[_0xf053('0x25')]=_[_0xf053('0x26')](_0x5d728d);_0x131021[_0xf053('0x27')]=_[_0xf053('0x26')](_0x108d3f[_0xf053('0x27')]);_0x131021[_0xf053('0x28')]=_[_0xf053('0x29')](_0x131021[_0xf053('0x25')],_0x131021[_0xf053('0x27')]);_0x2bdad4[_0xf053('0x2a')]=_[_0xf053('0x29')](_0x131021[_0xf053('0x25')],qs['fields'](_0x108d3f[_0xf053('0x27')][_0xf053('0x2b')]));_0x2bdad4[_0xf053('0x2a')]=_0x2bdad4[_0xf053('0x2a')][_0xf053('0x2c')]?_0x2bdad4[_0xf053('0x2a')]:_0x131021[_0xf053('0x25')];if(!_0x108d3f['query']['hasOwnProperty']('nolimit')){_0x2bdad4[_0xf053('0x19')]=qs['limit'](_0x108d3f['query'][_0xf053('0x19')]);_0x2bdad4['offset']=qs[_0xf053('0x18')](_0x108d3f[_0xf053('0x27')]['offset']);}_0x2bdad4[_0xf053('0x2d')]=qs[_0xf053('0x2e')](_0x108d3f['query']['sort']);_0x2bdad4[_0xf053('0x2f')]=qs[_0xf053('0x28')](_['pick'](_0x108d3f[_0xf053('0x27')],_0x131021[_0xf053('0x28')]));if(_0x108d3f[_0xf053('0x27')][_0xf053('0x30')]){_0x2bdad4[_0xf053('0x2f')]=_[_0xf053('0x31')](_0x2bdad4[_0xf053('0x2f')],{'$or':_['map'](_0x5d728d,function(_0x62d308){if(_0x62d308[_0xf053('0x32')][_0xf053('0x33')]!=='VIRTUAL'){var _0x3f4c47={};_0x3f4c47[_0x62d308[_0xf053('0x34')]]={'$like':'%'+_0x108d3f[_0xf053('0x27')]['filter']+'%'};return _0x3f4c47;}})});}_0x2bdad4=_['merge']({},_0x2bdad4,_0x108d3f['options']);var _0x5de38b={'where':_0x2bdad4[_0xf053('0x2f')]};return db[_0xf053('0x35')][_0xf053('0x17')](_0x5de38b)[_0xf053('0x1f')](function(_0x479104){_0x44cdf7[_0xf053('0x17')]=_0x479104;if(_0x108d3f['query'][_0xf053('0x36')]){_0x2bdad4[_0xf053('0x37')]=[{'all':!![]}];}return db[_0xf053('0x35')]['findAll'](_0x2bdad4);})[_0xf053('0x1f')](function(_0x3bf2fb){_0x44cdf7[_0xf053('0x38')]=_0x3bf2fb;return _0x44cdf7;})[_0xf053('0x1f')](respondWithFilteredResult(_0x206878,_0x2bdad4))['catch'](handleError(_0x206878,null));};exports['show']=function(_0x261c34,_0x5332b4){var _0x3f60ec={'raw':!![],'where':{'id':_0x261c34[_0xf053('0x39')]['id']}},_0x4c7d0c={};_0x4c7d0c[_0xf053('0x25')]=_['keys'](db[_0xf053('0x35')][_0xf053('0x3a')]);_0x4c7d0c[_0xf053('0x27')]=_[_0xf053('0x26')](_0x261c34['query']);_0x4c7d0c[_0xf053('0x28')]=_['intersection'](_0x4c7d0c['model'],_0x4c7d0c['query']);_0x3f60ec[_0xf053('0x2a')]=_[_0xf053('0x29')](_0x4c7d0c[_0xf053('0x25')],qs[_0xf053('0x2b')](_0x261c34['query']['fields']));_0x3f60ec[_0xf053('0x2a')]=_0x3f60ec[_0xf053('0x2a')][_0xf053('0x2c')]?_0x3f60ec[_0xf053('0x2a')]:_0x4c7d0c[_0xf053('0x25')];if(_0x261c34['query'][_0xf053('0x36')]){_0x3f60ec[_0xf053('0x37')]=[{'all':!![]}];}_0x3f60ec=_[_0xf053('0x31')]({},_0x3f60ec,_0x261c34[_0xf053('0x3b')]);return db[_0xf053('0x35')][_0xf053('0x3c')](_0x3f60ec)[_0xf053('0x1f')](handleEntityNotFound(_0x5332b4,null))[_0xf053('0x1f')](respondWithResult(_0x5332b4,null))[_0xf053('0x3d')](handleError(_0x5332b4,null));};exports[_0xf053('0x3e')]=function(_0x5084cd,_0x235358){return db['Disposition'][_0xf053('0x3e')](_0x5084cd[_0xf053('0x3f')],{})['then'](function(_0xcf1b33){var _0x216118=_0x5084cd[_0xf053('0x40')][_0xf053('0x41')]({'plain':!![]});if(!_0x216118)throw new Error(_0xf053('0x42'));if(_0x216118[_0xf053('0x43')]===_0xf053('0x40')){var _0x277239=_0xcf1b33[_0xf053('0x41')]({'plain':!![]});var _0x414477=_0xf053('0x21');return db[_0xf053('0x44')][_0xf053('0x3c')]({'where':{'name':_0x414477,'userProfileId':_0x216118[_0xf053('0x45')]},'raw':!![]})[_0xf053('0x1f')](function(_0x2df0a2){if(_0x2df0a2&&_0x2df0a2['autoAssociation']===0x0){return db[_0xf053('0x22')][_0xf053('0x3e')]({'name':_0x277239[_0xf053('0x23')],'resourceId':_0x277239['id'],'type':_0x2df0a2[_0xf053('0x23')],'sectionId':_0x2df0a2['id']},{})[_0xf053('0x1f')](function(){return _0xcf1b33;});}else{return _0xcf1b33;}})['catch'](function(_0x265e00){logger[_0xf053('0x46')](_0xf053('0x47'),_0x265e00);throw _0x265e00;});}return _0xcf1b33;})[_0xf053('0x1f')](respondWithResult(_0x235358,0xc9))[_0xf053('0x3d')](handleError(_0x235358,null));};exports[_0xf053('0x1e')]=function(_0x342cde,_0x2ebdcb){if(_0x342cde['body']['id']){delete _0x342cde[_0xf053('0x3f')]['id'];}return db[_0xf053('0x35')][_0xf053('0x3c')]({'where':{'id':_0x342cde['params']['id']}})[_0xf053('0x1f')](handleEntityNotFound(_0x2ebdcb,null))[_0xf053('0x1f')](saveUpdates(_0x342cde[_0xf053('0x3f')],null))['then'](respondWithResult(_0x2ebdcb,null))['catch'](handleError(_0x2ebdcb,null));};exports[_0xf053('0x20')]=function(_0x5cbf21,_0x57e7d3){return db[_0xf053('0x35')][_0xf053('0x3c')]({'where':{'id':_0x5cbf21[_0xf053('0x39')]['id']}})[_0xf053('0x1f')](handleEntityNotFound(_0x57e7d3,null))[_0xf053('0x1f')](removeEntity(_0x57e7d3,null))[_0xf053('0x3d')](handleError(_0x57e7d3,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 3f90944..260eac2 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 _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(_0xfde7c3,_0x52f6ca){var _0x4bca2c=function(_0x41101f){while(--_0x41101f){_0xfde7c3['push'](_0xfde7c3['shift']());}};_0x4bca2c(++_0x52f6ca);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5abf39,_0x3dd119){_0x5abf39=_0x5abf39-0x0;var _0x1565b0=_0x5f2f[_0x5abf39];return _0x1565b0;};'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 +var _0x1a85=['ListId','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','../../config/logger','api','moment','./disposition.attributes','exports','define','tools_dispositions','name'];(function(_0x3d3f34,_0x492872){var _0x49ed33=function(_0x48e194){while(--_0x48e194){_0x3d3f34['push'](_0x3d3f34['shift']());}};_0x49ed33(++_0x492872);}(_0x1a85,0x178));var _0x51a8=function(_0x5e7cf2,_0x1d3e7c){_0x5e7cf2=_0x5e7cf2-0x0;var _0x412b1a=_0x1a85[_0x5e7cf2];return _0x412b1a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x51a8('0x3'));module[_0x51a8('0x4')]=function(_0x99e371,_0x48a21b){return _0x99e371[_0x51a8('0x5')]('Disposition',attributes,{'tableName':_0x51a8('0x6'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x51a8('0x7'),_0x51a8('0x8')]},{'unique':!![],'name':'name_chat','fields':[_0x51a8('0x7'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x51a8('0x7'),_0x51a8('0x9')]},{'unique':!![],'name':_0x51a8('0xa'),'fields':[_0x51a8('0x7'),_0x51a8('0xb')]},{'unique':!![],'name':_0x51a8('0xc'),'fields':[_0x51a8('0x7'),_0x51a8('0xd')]},{'unique':!![],'name':_0x51a8('0xe'),'fields':[_0x51a8('0x7'),_0x51a8('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index a99f543..2277da3 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 _0xf69d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','message','Disposition,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x15df79,_0x28a338){var _0x2893bb=function(_0x1afc4e){while(--_0x1afc4e){_0x15df79['push'](_0x15df79['shift']());}};_0x2893bb(++_0x28a338);}(_0xf69d,0xd3));var _0xdf69=function(_0x3e6334,_0x1edc33){_0x3e6334=_0x3e6334-0x0;var _0x21be15=_0xf69d[_0x3e6334];return _0x21be15;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var moment=require(_0xdf69('0x2'));var BPromise=require(_0xdf69('0x3'));var rs=require(_0xdf69('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf69('0x5'))['db'];var utils=require(_0xdf69('0x6'));var logger=require(_0xdf69('0x7'))(_0xdf69('0x8'));var config=require(_0xdf69('0x9'));var jayson=require(_0xdf69('0xa'));var client=jayson[_0xdf69('0xb')][_0xdf69('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d2501,_0x12c186,_0x18a08e){return new BPromise(function(_0xc1b77e,_0x38909e){return client[_0xdf69('0xd')](_0x1d2501,_0x18a08e)[_0xdf69('0xe')](function(_0x211ea9){logger[_0xdf69('0xf')]('Disposition,\x20%s,\x20%s',_0x12c186,_0xdf69('0x10'));logger[_0xdf69('0x11')](_0xdf69('0x12'),_0x12c186,_0xdf69('0x10'),JSON[_0xdf69('0x13')](_0x211ea9));if(_0x211ea9[_0xdf69('0x14')]){if(_0x211ea9['error']['code']===0x1f4){logger['error']('Disposition,\x20%s,\x20%s',_0x12c186,_0x211ea9[_0xdf69('0x14')][_0xdf69('0x15')]);return _0x38909e(_0x211ea9[_0xdf69('0x14')][_0xdf69('0x15')]);}logger[_0xdf69('0x14')](_0xdf69('0x16'),_0x12c186,_0x211ea9['error'][_0xdf69('0x15')]);return _0xc1b77e(_0x211ea9[_0xdf69('0x14')][_0xdf69('0x15')]);}else{logger[_0xdf69('0xf')]('Disposition,\x20%s,\x20%s',_0x12c186,_0xdf69('0x10'));_0xc1b77e(_0x211ea9['result'][_0xdf69('0x15')]);}})[_0xdf69('0x17')](function(_0x5263a4){logger[_0xdf69('0x14')](_0xdf69('0x16'),_0x12c186,_0x5263a4);_0x38909e(_0x5263a4);});});} \ No newline at end of file +var _0x4fb4=['../../config/environment','jayson/promise','client','http','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3924fb,_0x114f18){var _0x3eb46a=function(_0x310cbb){while(--_0x310cbb){_0x3924fb['push'](_0x3924fb['shift']());}};_0x3eb46a(++_0x114f18);}(_0x4fb4,0x190));var _0x44fb=function(_0x1705ee,_0x491db1){_0x1705ee=_0x1705ee-0x0;var _0x62613f=_0x4fb4[_0x1705ee];return _0x62613f;};'use strict';var _=require('lodash');var util=require(_0x44fb('0x0'));var moment=require(_0x44fb('0x1'));var BPromise=require(_0x44fb('0x2'));var rs=require(_0x44fb('0x3'));var fs=require('fs');var Redis=require(_0x44fb('0x4'));var db=require(_0x44fb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x44fb('0x6'))(_0x44fb('0x7'));var config=require(_0x44fb('0x8'));var jayson=require(_0x44fb('0x9'));var client=jayson[_0x44fb('0xa')][_0x44fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x464af5,_0x2a4d75,_0x59aa6d){return new BPromise(function(_0x87f716,_0xd4ead0){return client['request'](_0x464af5,_0x59aa6d)[_0x44fb('0xc')](function(_0x3d9002){logger[_0x44fb('0xd')](_0x44fb('0xe'),_0x2a4d75,_0x44fb('0xf'));logger[_0x44fb('0x10')](_0x44fb('0x11'),_0x2a4d75,_0x44fb('0xf'),JSON[_0x44fb('0x12')](_0x3d9002));if(_0x3d9002[_0x44fb('0x13')]){if(_0x3d9002['error'][_0x44fb('0x14')]===0x1f4){logger[_0x44fb('0x13')](_0x44fb('0xe'),_0x2a4d75,_0x3d9002[_0x44fb('0x13')][_0x44fb('0x15')]);return _0xd4ead0(_0x3d9002['error'][_0x44fb('0x15')]);}logger[_0x44fb('0x13')](_0x44fb('0xe'),_0x2a4d75,_0x3d9002[_0x44fb('0x13')][_0x44fb('0x15')]);return _0x87f716(_0x3d9002['error'][_0x44fb('0x15')]);}else{logger[_0x44fb('0xd')](_0x44fb('0xe'),_0x2a4d75,_0x44fb('0xf'));_0x87f716(_0x3d9002[_0x44fb('0x16')][_0x44fb('0x15')]);}})[_0x44fb('0x17')](function(_0x585559){logger[_0x44fb('0x13')](_0x44fb('0xe'),_0x2a4d75,_0x585559);_0xd4ead0(_0x585559);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 7c4c877..8297676 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 _0xa9cf=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','create','put','delete','destroy','exports','multer'];(function(_0x4d2a11,_0x9133e8){var _0x3cf463=function(_0x398e32){while(--_0x398e32){_0x4d2a11['push'](_0x4d2a11['shift']());}};_0x3cf463(++_0x9133e8);}(_0xa9cf,0x6b));var _0xfa9c=function(_0x3ef340,_0x4a0687){_0x3ef340=_0x3ef340-0x0;var _0x4a5b82=_0xa9cf[_0x3ef340];return _0x4a5b82;};'use strict';var multer=require(_0xfa9c('0x0'));var util=require(_0xfa9c('0x1'));var path=require(_0xfa9c('0x2'));var timeout=require(_0xfa9c('0x3'));var express=require(_0xfa9c('0x4'));var router=express[_0xfa9c('0x5')]();var auth=require(_0xfa9c('0x6'));var interaction=require(_0xfa9c('0x7'));var config=require(_0xfa9c('0x8'));var controller=require(_0xfa9c('0x9'));router[_0xfa9c('0xa')]('/',auth[_0xfa9c('0xb')](),controller['index']);router[_0xfa9c('0xa')](_0xfa9c('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xfa9c('0xb')](),controller[_0xfa9c('0xd')]);router[_0xfa9c('0xe')](_0xfa9c('0xc'),auth[_0xfa9c('0xb')](),controller['update']);router[_0xfa9c('0xf')](_0xfa9c('0xc'),auth[_0xfa9c('0xb')](),controller[_0xfa9c('0x10')]);module[_0xfa9c('0x11')]=router; \ No newline at end of file +var _0x11cb=['show','put','update','delete','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','/:id'];(function(_0x8eb4eb,_0xa70079){var _0x1ff8e3=function(_0x1e118e){while(--_0x1e118e){_0x8eb4eb['push'](_0x8eb4eb['shift']());}};_0x1ff8e3(++_0xa70079);}(_0x11cb,0xe4));var _0xb11c=function(_0x44feea,_0xa915cd){_0x44feea=_0x44feea-0x0;var _0x3b3b9c=_0x11cb[_0x44feea];return _0x3b3b9c;};'use strict';var multer=require(_0xb11c('0x0'));var util=require('util');var path=require(_0xb11c('0x1'));var timeout=require(_0xb11c('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xb11c('0x3'));var interaction=require(_0xb11c('0x4'));var config=require('../../config/environment');var controller=require(_0xb11c('0x5'));router[_0xb11c('0x6')]('/',auth[_0xb11c('0x7')](),controller[_0xb11c('0x8')]);router[_0xb11c('0x6')](_0xb11c('0x9'),auth[_0xb11c('0x7')](),controller[_0xb11c('0xa')]);router['post']('/',auth[_0xb11c('0x7')](),controller['create']);router[_0xb11c('0xb')](_0xb11c('0x9'),auth['isAuthenticated'](),controller[_0xb11c('0xc')]);router[_0xb11c('0xd')](_0xb11c('0x9'),auth[_0xb11c('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index f506d23..ebea2f8 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 _0x4c4f=['SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4c4f,0xe1));var _0xf4c4=function(_0x56998d,_0x173114){_0x56998d=_0x56998d-0x0;var _0x196e0c=_0x4c4f[_0x56998d];return _0x196e0c;};'use strict';var Sequelize=require(_0xf4c4('0x0'));module[_0xf4c4('0x1')]={'name':{'type':Sequelize[_0xf4c4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xf4c4('0x3')](_0xf4c4('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xf4c4('0x5')},'localstationid':{'type':Sequelize[_0xf4c4('0x2')],'unique':_0xf4c4('0x6')},'minrate':{'type':Sequelize[_0xf4c4('0x3')](_0xf4c4('0x7'),_0xf4c4('0x8'),'7200','9600','12000','14400'),'defaultValue':_0xf4c4('0x8')},'maxrate':{'type':Sequelize[_0xf4c4('0x3')](_0xf4c4('0x7'),_0xf4c4('0x8'),_0xf4c4('0x9'),_0xf4c4('0xa'),_0xf4c4('0xb'),'14400'),'defaultValue':_0xf4c4('0xc')},'modem':{'type':Sequelize[_0xf4c4('0x2')],'defaultValue':_0xf4c4('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xf4c4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xf4c4('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xf4c4('0x3')]('SIP',_0xf4c4('0xf'),_0xf4c4('0x10'),_0xf4c4('0x11')),'defaultValue':_0xf4c4('0x12')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf4c4('0x13')],'defaultValue':function(){return _0xf4c4('0x14');}},'notificationSound':{'type':Sequelize[_0xf4c4('0x15')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf4c4('0x15')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf4c4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf4c4('0x15')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf4c4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf4c4('0x15')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf4c4('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0xf4c4('0x16')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf4c4('0x17'),'set':function(_0x40cd78){if(!_0x40cd78)this[_0xf4c4('0x18')](_0xf4c4('0x19'),null);this[_0xf4c4('0x18')](_0xf4c4('0x1a'),_0x40cd78);}}}; \ No newline at end of file +var _0x84e3=['2400','4800','7200','9600','12000','14400','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid'];(function(_0x58c5f8,_0x1ed0d4){var _0x30bba8=function(_0x2e8263){while(--_0x2e8263){_0x58c5f8['push'](_0x58c5f8['shift']());}};_0x30bba8(++_0x1ed0d4);}(_0x84e3,0x1f2));var _0x384e=function(_0x3889ae,_0x4770c3){_0x3889ae=_0x3889ae-0x0;var _0x6533dd=_0x84e3[_0x3889ae];return _0x6533dd;};'use strict';var Sequelize=require(_0x384e('0x0'));module[_0x384e('0x1')]={'name':{'type':Sequelize[_0x384e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x384e('0x2')]},'ecm':{'type':Sequelize[_0x384e('0x3')](_0x384e('0x4'),'no'),'defaultValue':_0x384e('0x4')},'headerinfo':{'type':Sequelize[_0x384e('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x384e('0x2')],'unique':_0x384e('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x384e('0x6'),_0x384e('0x7'),_0x384e('0x8'),_0x384e('0x9'),_0x384e('0xa'),_0x384e('0xb')),'defaultValue':_0x384e('0x7')},'maxrate':{'type':Sequelize[_0x384e('0x3')](_0x384e('0x6'),_0x384e('0x7'),_0x384e('0x8'),_0x384e('0x9'),_0x384e('0xa'),_0x384e('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x384e('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x384e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x384e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x384e('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x384e('0x3')](_0x384e('0xd'),_0x384e('0xe'),_0x384e('0xf'),'KHOMP'),'defaultValue':_0x384e('0xd')},'key':{'type':Sequelize[_0x384e('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x384e('0x10')],'defaultValue':function(){return _0x384e('0x11');}},'notificationSound':{'type':Sequelize[_0x384e('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x384e('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x384e('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x384e('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x384e('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x384e('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x384e('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x384e('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x384e('0x12')],'defaultValue':![],'comment':_0x384e('0x14'),'set':function(_0x237abf){if(!_0x237abf)this[_0x384e('0x15')](_0x384e('0x16'),null);this[_0x384e('0x15')](_0x384e('0x17'),_0x237abf);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index d4894bd..3632859 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 _0xa846=['send','index','Pause','FaxAccount','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','filter','merge','map','VIRTUAL','field','options','includeAll','findAll','rows','params','mandatoryDispositionPause','rawAttributes','length','include','find','create','body','role','user','UserProfileSection','UserProfileResource','describe','FaxAccountId','Disposition','getDispositions','findOne','sort','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','tag','addApplications','transaction','bulkCreate','FaxApplication','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','push','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','sequelize','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','CheckAfterSend','isNil','path','from','format','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','omit','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','./faxAccount.socket','register','client','http','request','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','FaxAccounts','end','stack','name'];(function(_0x5e33df,_0x15b730){var _0x322da5=function(_0x6df5e3){while(--_0x6df5e3){_0x5e33df['push'](_0x5e33df['shift']());}};_0x322da5(++_0x15b730);}(_0xa846,0x13e));var _0x6a84=function(_0x2c88f4,_0x350a8e){_0x2c88f4=_0x2c88f4-0x0;var _0x11762d=_0xa846[_0x2c88f4];return _0x11762d;};'use strict';var pdf=require(_0x6a84('0x0'));var emlformat=require(_0x6a84('0x1'));var rimraf=require(_0x6a84('0x2'));var zipdir=require(_0x6a84('0x3'));var jsonpatch=require(_0x6a84('0x4'));var rp=require('request-promise');var moment=require(_0x6a84('0x5'));var BPromise=require(_0x6a84('0x6'));var Mustache=require(_0x6a84('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6a84('0x8'));var ejs=require(_0x6a84('0x9'));var fs=require('fs');var _=require(_0x6a84('0xa'));var squel=require(_0x6a84('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6a84('0xc'));var toCsv=require(_0x6a84('0x8'));var querystring=require(_0x6a84('0xd'));var Papa=require(_0x6a84('0xe'));var authService=require(_0x6a84('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x6a84('0x10'));var logger=require(_0x6a84('0x11'))('api');var utils=require(_0x6a84('0x12'));var config=require('../../config/environment');var db=require(_0x6a84('0x13'))['db'];config[_0x6a84('0x14')]=_['defaults'](config['redis'],{'host':_0x6a84('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6a84('0x14')]));require(_0x6a84('0x16'))[_0x6a84('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6a84('0x18')][_0x6a84('0x19')]({'port':0x232c});var client9002=jayson['client'][_0x6a84('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x58ec58,_0x4b0d38,_0x31dbad,_0x507df8){return new BPromise(function(_0x1e56c7,_0x3e6cb4){var _0x273728=_0x507df8||client;return _0x273728[_0x6a84('0x1a')](_0x58ec58,_0x31dbad)['then'](function(_0x4d5213){logger['info'](_0x6a84('0x1b'),_0x4b0d38,'request\x20sent');logger[_0x6a84('0x1c')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x4b0d38,_0x6a84('0x1d'),JSON[_0x6a84('0x1e')](_0x4d5213));if(_0x4d5213[_0x6a84('0x1f')]){if(_0x4d5213[_0x6a84('0x1f')][_0x6a84('0x20')]===0x1f4){logger[_0x6a84('0x1f')](_0x6a84('0x1b'),_0x4b0d38,_0x4d5213['error'][_0x6a84('0x21')]);return _0x3e6cb4(_0x4d5213[_0x6a84('0x1f')][_0x6a84('0x21')]);}logger[_0x6a84('0x1f')](_0x6a84('0x1b'),_0x4b0d38,_0x4d5213[_0x6a84('0x1f')][_0x6a84('0x21')]);return _0x1e56c7(_0x4d5213[_0x6a84('0x1f')][_0x6a84('0x21')]);}else{logger[_0x6a84('0x22')](_0x6a84('0x1b'),_0x4b0d38,'request\x20sent');_0x1e56c7(_0x4d5213[_0x6a84('0x23')][_0x6a84('0x21')]);}})[_0x6a84('0x24')](function(_0x34db77){logger[_0x6a84('0x1f')](_0x6a84('0x1b'),_0x4b0d38,_0x34db77);_0x3e6cb4(_0x34db77);});});}function respondWithStatusCode(_0x2420ee,_0x52df73){_0x52df73=_0x52df73||0xcc;return function(_0x4f93c1){if(_0x4f93c1){return _0x2420ee['sendStatus'](_0x52df73);}return _0x2420ee[_0x6a84('0x25')](_0x52df73)['end']();};}function respondWithResult(_0x280735,_0x35ef5b){_0x35ef5b=_0x35ef5b||0xc8;return function(_0x421d80){if(_0x421d80){return _0x280735[_0x6a84('0x25')](_0x35ef5b)[_0x6a84('0x26')](_0x421d80);}};}function respondWithFilteredResult(_0x880c07,_0x5ecc5d){return function(_0x97e40f){if(_0x97e40f){var _0x3c30bf=_0x97e40f[_0x6a84('0x27')],_0x2f9f58=_0x5ecc5d[_0x6a84('0x28')],_0x3b02fc=_0x5ecc5d[_0x6a84('0x28')]+_0x5ecc5d[_0x6a84('0x29')],_0x5c600f;if(_0x3b02fc>=_0x3c30bf){_0x3b02fc=_0x3c30bf;_0x5c600f=0xc8;}else{_0x5c600f=0xce;}_0x880c07['status'](_0x5c600f);return _0x880c07[_0x6a84('0x2a')](_0x6a84('0x2b'),_0x2f9f58+'-'+_0x3b02fc+'/'+_0x3c30bf)[_0x6a84('0x26')](_0x97e40f);}return null;};}function patchUpdates(_0x56b8e0){return function(_0x1197d8){try{jsonpatch['apply'](_0x1197d8,_0x56b8e0,!![]);}catch(_0x319da6){return BPromise[_0x6a84('0x2c')](_0x319da6);}return _0x1197d8[_0x6a84('0x2d')]();};}function saveUpdates(_0x328604,_0x3b2de2){return function(_0x16555f){if(_0x16555f){return _0x16555f[_0x6a84('0x2e')](_0x328604)[_0x6a84('0x2f')](function(_0x3c522e){return _0x3c522e;});}return null;};}function removeEntity(_0x543f13,_0x2340d9){return function(_0x3e5a79){if(_0x3e5a79){return _0x3e5a79[_0x6a84('0x30')]()['then'](function(){var _0x42928c=_0x3e5a79[_0x6a84('0x31')]({'plain':!![]});var _0x4a0fb6=_0x6a84('0x32');return db['UserProfileResource'][_0x6a84('0x30')]({'where':{'type':_0x4a0fb6,'resourceId':_0x42928c['id']}})[_0x6a84('0x2f')](function(){return _0x3e5a79;});})[_0x6a84('0x2f')](function(){_0x543f13[_0x6a84('0x25')](0xcc)[_0x6a84('0x33')]();});}};}function handleEntityNotFound(_0x26c418,_0x1a5801){return function(_0x46299f){if(!_0x46299f){_0x26c418['sendStatus'](0x194);}return _0x46299f;};}function handleError(_0x5ea0ed,_0x408b72){_0x408b72=_0x408b72||0x1f4;return function(_0x1cd244){logger[_0x6a84('0x1f')](_0x1cd244[_0x6a84('0x34')]);if(_0x1cd244[_0x6a84('0x35')]){delete _0x1cd244['name'];}_0x5ea0ed[_0x6a84('0x25')](_0x408b72)[_0x6a84('0x36')](_0x1cd244);};}exports[_0x6a84('0x37')]=function(_0x52a853,_0x1ba986){var _0x896da1={'include':[{'model':db[_0x6a84('0x38')],'as':'mandatoryDispositionPause'}]},_0x25362e={},_0x1d1e27={'count':0x0,'rows':[]};var _0x14b2ff=db[_0x6a84('0x39')]['rawAttributes'];_0x25362e[_0x6a84('0x3a')]=_[_0x6a84('0x3b')](_0x14b2ff);_0x25362e[_0x6a84('0x3c')]=_[_0x6a84('0x3b')](_0x52a853['query']);_0x25362e[_0x6a84('0x3d')]=_['intersection'](_0x25362e[_0x6a84('0x3a')],_0x25362e[_0x6a84('0x3c')]);_0x896da1[_0x6a84('0x3e')]=_[_0x6a84('0x3f')](_0x25362e[_0x6a84('0x3a')],qs[_0x6a84('0x40')](_0x52a853[_0x6a84('0x3c')][_0x6a84('0x40')]));_0x896da1[_0x6a84('0x3e')]=_0x896da1[_0x6a84('0x3e')]['length']?_0x896da1[_0x6a84('0x3e')]:_0x25362e['model'];if(!_0x52a853[_0x6a84('0x3c')][_0x6a84('0x41')](_0x6a84('0x42'))){_0x896da1[_0x6a84('0x29')]=qs[_0x6a84('0x29')](_0x52a853['query']['limit']);_0x896da1[_0x6a84('0x28')]=qs['offset'](_0x52a853[_0x6a84('0x3c')]['offset']);}_0x896da1[_0x6a84('0x43')]=qs['sort'](_0x52a853[_0x6a84('0x3c')]['sort']);_0x896da1[_0x6a84('0x44')]=qs[_0x6a84('0x3d')](_['pick'](_0x52a853[_0x6a84('0x3c')],_0x25362e['filters']));if(_0x52a853[_0x6a84('0x3c')][_0x6a84('0x45')]){_0x896da1[_0x6a84('0x44')]=_[_0x6a84('0x46')](_0x896da1['where'],{'$or':_[_0x6a84('0x47')](_0x14b2ff,function(_0x1b0208){if(_0x1b0208['type']['key']!==_0x6a84('0x48')){var _0x15fc6d={};_0x15fc6d[_0x1b0208[_0x6a84('0x49')]]={'$like':'%'+_0x52a853[_0x6a84('0x3c')][_0x6a84('0x45')]+'%'};return _0x15fc6d;}})});}_0x896da1=_[_0x6a84('0x46')]({},_0x896da1,_0x52a853[_0x6a84('0x4a')]);var _0x2b42c3={'where':_0x896da1[_0x6a84('0x44')]};return db[_0x6a84('0x39')][_0x6a84('0x27')](_0x2b42c3)[_0x6a84('0x2f')](function(_0x450a6d){_0x1d1e27[_0x6a84('0x27')]=_0x450a6d;if(_0x52a853[_0x6a84('0x3c')][_0x6a84('0x4b')]){_0x896da1['include']=[{'all':!![]}];}return db[_0x6a84('0x39')][_0x6a84('0x4c')](_0x896da1);})[_0x6a84('0x2f')](function(_0x39ba8f){_0x1d1e27[_0x6a84('0x4d')]=_0x39ba8f;return _0x1d1e27;})[_0x6a84('0x2f')](respondWithFilteredResult(_0x1ba986,_0x896da1))[_0x6a84('0x24')](handleError(_0x1ba986,null));};exports['show']=function(_0x2b4310,_0x20fbc8){var _0x433fd7={'raw':![],'where':{'id':_0x2b4310[_0x6a84('0x4e')]['id']},'include':[{'model':db[_0x6a84('0x38')],'as':_0x6a84('0x4f')}]},_0x56400f={};_0x56400f[_0x6a84('0x3a')]=_[_0x6a84('0x3b')](db['FaxAccount'][_0x6a84('0x50')]);_0x56400f['query']=_[_0x6a84('0x3b')](_0x2b4310[_0x6a84('0x3c')]);_0x56400f[_0x6a84('0x3d')]=_['intersection'](_0x56400f[_0x6a84('0x3a')],_0x56400f[_0x6a84('0x3c')]);_0x433fd7[_0x6a84('0x3e')]=_[_0x6a84('0x3f')](_0x56400f[_0x6a84('0x3a')],qs[_0x6a84('0x40')](_0x2b4310[_0x6a84('0x3c')]['fields']));_0x433fd7[_0x6a84('0x3e')]=_0x433fd7[_0x6a84('0x3e')][_0x6a84('0x51')]?_0x433fd7[_0x6a84('0x3e')]:_0x56400f[_0x6a84('0x3a')];if(_0x2b4310[_0x6a84('0x3c')]['includeAll']){_0x433fd7[_0x6a84('0x52')]=[{'all':!![]}];}_0x433fd7=_[_0x6a84('0x46')]({},_0x433fd7,_0x2b4310[_0x6a84('0x4a')]);return db[_0x6a84('0x39')][_0x6a84('0x53')](_0x433fd7)[_0x6a84('0x2f')](handleEntityNotFound(_0x20fbc8,null))[_0x6a84('0x2f')](respondWithResult(_0x20fbc8,null))[_0x6a84('0x24')](handleError(_0x20fbc8,null));};exports[_0x6a84('0x54')]=function(_0x25236e,_0x18528c){return db['FaxAccount']['create'](_0x25236e[_0x6a84('0x55')],{})[_0x6a84('0x2f')](function(_0x47c86c){var _0x4823ea=_0x25236e['user'][_0x6a84('0x31')]({'plain':!![]});if(!_0x4823ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4823ea[_0x6a84('0x56')]===_0x6a84('0x57')){var _0x357785=_0x47c86c[_0x6a84('0x31')]({'plain':!![]});var _0x4daed5=_0x6a84('0x32');return db[_0x6a84('0x58')][_0x6a84('0x53')]({'where':{'name':_0x4daed5,'userProfileId':_0x4823ea['userProfileId']},'raw':!![]})[_0x6a84('0x2f')](function(_0x10ce7e){if(_0x10ce7e&&_0x10ce7e['autoAssociation']===0x0){return db[_0x6a84('0x59')]['create']({'name':_0x357785[_0x6a84('0x35')],'resourceId':_0x357785['id'],'type':_0x10ce7e[_0x6a84('0x35')],'sectionId':_0x10ce7e['id']},{})[_0x6a84('0x2f')](function(){return _0x47c86c;});}else{return _0x47c86c;}})['catch'](function(_0x1e6513){logger[_0x6a84('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e6513);throw _0x1e6513;});}return _0x47c86c;})[_0x6a84('0x2f')](respondWithResult(_0x18528c,0xc9))[_0x6a84('0x24')](handleError(_0x18528c,null));};exports[_0x6a84('0x2e')]=function(_0x228325,_0x552741){if(_0x228325[_0x6a84('0x55')]['id']){delete _0x228325[_0x6a84('0x55')]['id'];}return db[_0x6a84('0x39')]['find']({'where':{'id':_0x228325[_0x6a84('0x4e')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x6a84('0x2f')](handleEntityNotFound(_0x552741,null))[_0x6a84('0x2f')](saveUpdates(_0x228325[_0x6a84('0x55')],null))[_0x6a84('0x2f')](function(_0xc54e78){if(_0xc54e78&&_0x228325[_0x6a84('0x55')]['mandatoryDispositionPause']){return db[_0x6a84('0x38')][_0x6a84('0x2e')](_0x228325[_0x6a84('0x55')][_0x6a84('0x4f')],{'where':{'FaxAccountId':_0xc54e78['id']}})['then'](function(){return _0xc54e78;});}return _0xc54e78;})[_0x6a84('0x2f')](respondWithResult(_0x552741,null))['catch'](handleError(_0x552741,null));};exports[_0x6a84('0x30')]=function(_0x47d0d9,_0x289bb0){return db['FaxAccount'][_0x6a84('0x53')]({'where':{'id':_0x47d0d9[_0x6a84('0x4e')]['id']}})['then'](handleEntityNotFound(_0x289bb0,null))[_0x6a84('0x2f')](removeEntity(_0x289bb0,null))['catch'](handleError(_0x289bb0,null));};exports[_0x6a84('0x5a')]=function(_0x23ddaf,_0x506591){return db[_0x6a84('0x39')]['describe']()[_0x6a84('0x2f')](respondWithResult(_0x506591,null))['catch'](handleError(_0x506591,null));};exports['addDisposition']=function(_0x10f249,_0x449935,_0x4273db){if(_0x10f249[_0x6a84('0x55')]['id']){delete _0x10f249[_0x6a84('0x55')]['id'];}return db[_0x6a84('0x39')][_0x6a84('0x53')]({'where':{'id':_0x10f249[_0x6a84('0x4e')]['id']}})['then'](handleEntityNotFound(_0x449935,null))[_0x6a84('0x2f')](function(_0x3f0256){if(_0x3f0256){_0x10f249[_0x6a84('0x55')][_0x6a84('0x5b')]=_0x3f0256['id'];return db[_0x6a84('0x5c')][_0x6a84('0x54')](_0x10f249[_0x6a84('0x55')]);}})[_0x6a84('0x2f')](respondWithResult(_0x449935,null))[_0x6a84('0x24')](handleError(_0x449935,null));};exports[_0x6a84('0x5d')]=function(_0x550252,_0x1446d3,_0x25379a){var _0x2f3a8e={'raw':![],'where':{}};var _0x53340a={};var _0x462fe0={'count':0x0,'rows':[]};return db[_0x6a84('0x39')][_0x6a84('0x5e')]({'where':{'id':_0x550252[_0x6a84('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1446d3,null))[_0x6a84('0x2f')](function(_0x53570b){if(_0x53570b){_0x53340a[_0x6a84('0x3a')]=_[_0x6a84('0x3b')](db['Disposition'][_0x6a84('0x50')]);_0x53340a['query']=_['keys'](_0x550252[_0x6a84('0x3c')]);_0x53340a[_0x6a84('0x3d')]=_[_0x6a84('0x3f')](_0x53340a[_0x6a84('0x3a')],_0x53340a[_0x6a84('0x3c')]);_0x2f3a8e[_0x6a84('0x3e')]=_[_0x6a84('0x3f')](_0x53340a['model'],qs['fields'](_0x550252['query'][_0x6a84('0x40')]));_0x2f3a8e[_0x6a84('0x3e')]=_0x2f3a8e[_0x6a84('0x3e')]['length']?_0x2f3a8e[_0x6a84('0x3e')]:_0x53340a[_0x6a84('0x3a')];if(!_0x550252[_0x6a84('0x3c')]['hasOwnProperty']('nolimit')){_0x2f3a8e[_0x6a84('0x29')]=qs['limit'](_0x550252['query']['limit']);_0x2f3a8e[_0x6a84('0x28')]=qs[_0x6a84('0x28')](_0x550252[_0x6a84('0x3c')][_0x6a84('0x28')]);}_0x2f3a8e[_0x6a84('0x43')]=qs[_0x6a84('0x5f')](_0x550252[_0x6a84('0x3c')][_0x6a84('0x5f')]);_0x2f3a8e[_0x6a84('0x44')]=qs[_0x6a84('0x3d')](_[_0x6a84('0x60')](_0x550252[_0x6a84('0x3c')],_0x53340a[_0x6a84('0x3d')]));_0x2f3a8e[_0x6a84('0x44')]['FaxAccountId']=_0x53570b['id'];if(_0x550252[_0x6a84('0x3c')][_0x6a84('0x45')]){_0x2f3a8e['where']=_[_0x6a84('0x46')](_0x2f3a8e['where'],{'$or':_[_0x6a84('0x47')](_0x2f3a8e['attributes'],function(_0x315688){var _0xed7406={};_0xed7406[_0x315688]={'$like':'%'+_0x550252[_0x6a84('0x3c')][_0x6a84('0x45')]+'%'};return _0xed7406;})});}_0x2f3a8e=_[_0x6a84('0x46')]({},_0x2f3a8e,_0x550252[_0x6a84('0x4a')]);return db[_0x6a84('0x5c')][_0x6a84('0x27')]({'where':_0x2f3a8e[_0x6a84('0x44')]})[_0x6a84('0x2f')](function(_0x30019b){_0x462fe0[_0x6a84('0x27')]=_0x30019b;if(_0x550252['query']['includeAll']){_0x2f3a8e[_0x6a84('0x52')]=[{'all':!![]}];}return db[_0x6a84('0x5c')]['findAll'](_0x2f3a8e);})[_0x6a84('0x2f')](function(_0x543ede){_0x462fe0[_0x6a84('0x4d')]=_0x543ede;return _0x462fe0;});}})[_0x6a84('0x2f')](respondWithFilteredResult(_0x1446d3,_0x2f3a8e))['catch'](handleError(_0x1446d3,null));};exports['removeDispositions']=function(_0x3ece89,_0x1cead6,_0x1b50fc){var _0x401e00;return db[_0x6a84('0x39')][_0x6a84('0x53')]({'where':{'id':_0x3ece89[_0x6a84('0x4e')]['id']}})[_0x6a84('0x2f')](handleEntityNotFound(_0x1cead6,null))[_0x6a84('0x2f')](function(_0x276de7){if(_0x276de7){return _0x276de7[_0x6a84('0x61')](_0x3ece89[_0x6a84('0x3c')][_0x6a84('0x62')]);}})[_0x6a84('0x2f')](respondWithStatusCode(_0x1cead6,null))[_0x6a84('0x24')](handleError(_0x1cead6,null));};exports[_0x6a84('0x63')]=function(_0x22c716,_0x4ae989,_0x5e91a7){if(_0x22c716[_0x6a84('0x55')]['id']){delete _0x22c716[_0x6a84('0x55')]['id'];}return db['FaxAccount'][_0x6a84('0x53')]({'where':{'id':_0x22c716['params']['id']}})[_0x6a84('0x2f')](handleEntityNotFound(_0x4ae989,null))[_0x6a84('0x2f')](function(_0x5dabeb){if(_0x5dabeb){_0x22c716[_0x6a84('0x55')][_0x6a84('0x5b')]=_0x5dabeb['id'];return db['CannedAnswer'][_0x6a84('0x54')](_0x22c716[_0x6a84('0x55')]);}})[_0x6a84('0x2f')](respondWithResult(_0x4ae989,null))[_0x6a84('0x24')](handleError(_0x4ae989,null));};exports[_0x6a84('0x64')]=function(_0xb055ef,_0x348f87,_0xd7aede){var _0x412f8a={'raw':![],'where':{}};var _0x1f3afd={};var _0xfd76da={'count':0x0,'rows':[]};return db[_0x6a84('0x39')]['findOne']({'where':{'id':_0xb055ef['params']['id']}})[_0x6a84('0x2f')](handleEntityNotFound(_0x348f87,null))[_0x6a84('0x2f')](function(_0x1c9f2f){if(_0x1c9f2f){_0x1f3afd[_0x6a84('0x3a')]=_[_0x6a84('0x3b')](db['CannedAnswer'][_0x6a84('0x50')]);_0x1f3afd[_0x6a84('0x3c')]=_[_0x6a84('0x3b')](_0xb055ef[_0x6a84('0x3c')]);_0x1f3afd[_0x6a84('0x3d')]=_[_0x6a84('0x3f')](_0x1f3afd[_0x6a84('0x3a')],_0x1f3afd[_0x6a84('0x3c')]);_0x412f8a[_0x6a84('0x3e')]=_[_0x6a84('0x3f')](_0x1f3afd[_0x6a84('0x3a')],qs['fields'](_0xb055ef[_0x6a84('0x3c')][_0x6a84('0x40')]));_0x412f8a[_0x6a84('0x3e')]=_0x412f8a[_0x6a84('0x3e')][_0x6a84('0x51')]?_0x412f8a['attributes']:_0x1f3afd[_0x6a84('0x3a')];if(!_0xb055ef['query'][_0x6a84('0x41')]('nolimit')){_0x412f8a[_0x6a84('0x29')]=qs['limit'](_0xb055ef['query']['limit']);_0x412f8a[_0x6a84('0x28')]=qs[_0x6a84('0x28')](_0xb055ef[_0x6a84('0x3c')][_0x6a84('0x28')]);}_0x412f8a['order']=qs[_0x6a84('0x5f')](_0xb055ef[_0x6a84('0x3c')]['sort']);_0x412f8a['where']=qs['filters'](_['pick'](_0xb055ef[_0x6a84('0x3c')],_0x1f3afd['filters']));_0x412f8a[_0x6a84('0x44')][_0x6a84('0x5b')]=_0x1c9f2f['id'];if(_0xb055ef['query'][_0x6a84('0x45')]){_0x412f8a[_0x6a84('0x44')]=_[_0x6a84('0x46')](_0x412f8a[_0x6a84('0x44')],{'$or':_['map'](_0x412f8a[_0x6a84('0x3e')],function(_0x342b75){var _0x17e9ad={};_0x17e9ad[_0x342b75]={'$like':'%'+_0xb055ef[_0x6a84('0x3c')][_0x6a84('0x45')]+'%'};return _0x17e9ad;})});}_0x412f8a=_[_0x6a84('0x46')]({},_0x412f8a,_0xb055ef['options']);return db[_0x6a84('0x65')][_0x6a84('0x27')]({'where':_0x412f8a['where']})[_0x6a84('0x2f')](function(_0x47eaa2){_0xfd76da['count']=_0x47eaa2;if(_0xb055ef[_0x6a84('0x3c')][_0x6a84('0x4b')]){_0x412f8a[_0x6a84('0x52')]=[{'all':!![]}];}return db['CannedAnswer'][_0x6a84('0x4c')](_0x412f8a);})[_0x6a84('0x2f')](function(_0x33e6c3){_0xfd76da[_0x6a84('0x4d')]=_0x33e6c3;return _0xfd76da;});}})[_0x6a84('0x2f')](respondWithFilteredResult(_0x348f87,_0x412f8a))[_0x6a84('0x24')](handleError(_0x348f87,null));};exports[_0x6a84('0x66')]=function(_0x1702d6,_0x332496,_0x31877e){var _0x597f2a;return db[_0x6a84('0x39')][_0x6a84('0x53')]({'where':{'id':_0x1702d6['params']['id']}})[_0x6a84('0x2f')](handleEntityNotFound(_0x332496,null))[_0x6a84('0x2f')](function(_0x1b01f4){if(_0x1b01f4){return _0x1b01f4[_0x6a84('0x66')](_0x1702d6[_0x6a84('0x3c')]['ids']);}})[_0x6a84('0x2f')](respondWithStatusCode(_0x332496,null))[_0x6a84('0x24')](handleError(_0x332496,null));};exports[_0x6a84('0x67')]=function(_0x17290b,_0x259fa8,_0x5d8699){return db[_0x6a84('0x68')]['find']({'where':{'id':_0x17290b['params']['id']}})[_0x6a84('0x2f')](handleEntityNotFound(_0x259fa8,null))['then'](function(_0x48a102){if(_0x48a102){return _0x48a102[_0x6a84('0x67')](_0x17290b[_0x6a84('0x55')][_0x6a84('0x62')],_['omit'](_0x17290b[_0x6a84('0x55')],[_0x6a84('0x62'),'id'])||{});}})['then'](respondWithResult(_0x259fa8,null))[_0x6a84('0x24')](handleError(_0x259fa8,null));};exports[_0x6a84('0x69')]=function(_0x36c9e4,_0x1028f1,_0x85d2a7){var _0x4eaab9={'raw':![],'where':{}};var _0x4581e5={};var _0x3f0666={'count':0x0,'rows':[]};return db[_0x6a84('0x39')]['findOne']({'where':{'id':_0x36c9e4['params']['id']}})['then'](handleEntityNotFound(_0x1028f1,null))[_0x6a84('0x2f')](function(_0x389d91){if(_0x389d91){_0x4581e5[_0x6a84('0x3a')]=_[_0x6a84('0x3b')](db[_0x6a84('0x68')][_0x6a84('0x50')]);_0x4581e5['query']=_[_0x6a84('0x3b')](_0x36c9e4[_0x6a84('0x3c')]);_0x4581e5[_0x6a84('0x3d')]=_[_0x6a84('0x3f')](_0x4581e5[_0x6a84('0x3a')],_0x4581e5[_0x6a84('0x3c')]);_0x4eaab9[_0x6a84('0x3e')]=_[_0x6a84('0x3f')](_0x4581e5[_0x6a84('0x3a')],qs[_0x6a84('0x40')](_0x36c9e4['query']['fields']));_0x4eaab9[_0x6a84('0x3e')]=_0x4eaab9['attributes']['length']?_0x4eaab9['attributes']:_0x4581e5[_0x6a84('0x3a')];if(!_0x36c9e4[_0x6a84('0x3c')][_0x6a84('0x41')]('nolimit')){_0x4eaab9[_0x6a84('0x29')]=qs[_0x6a84('0x29')](_0x36c9e4[_0x6a84('0x3c')][_0x6a84('0x29')]);_0x4eaab9[_0x6a84('0x28')]=qs[_0x6a84('0x28')](_0x36c9e4[_0x6a84('0x3c')][_0x6a84('0x28')]);}_0x4eaab9['order']=qs['sort'](_0x36c9e4[_0x6a84('0x3c')][_0x6a84('0x5f')]);_0x4eaab9['where']=qs[_0x6a84('0x3d')](_[_0x6a84('0x60')](_0x36c9e4[_0x6a84('0x3c')],_0x4581e5[_0x6a84('0x3d')]));_0x4eaab9[_0x6a84('0x44')][_0x6a84('0x5b')]=_0x389d91['id'];if(_0x36c9e4[_0x6a84('0x3c')][_0x6a84('0x45')]){_0x4eaab9[_0x6a84('0x44')]=_['merge'](_0x4eaab9['where'],{'$or':_[_0x6a84('0x47')](_0x4eaab9[_0x6a84('0x3e')],function(_0x266419){var _0xe38851={};_0xe38851[_0x266419]={'$like':'%'+_0x36c9e4[_0x6a84('0x3c')][_0x6a84('0x45')]+'%'};return _0xe38851;})});}_0x4eaab9=_[_0x6a84('0x46')]({},_0x4eaab9,_0x36c9e4[_0x6a84('0x4a')]);return db[_0x6a84('0x68')][_0x6a84('0x27')]({'where':_0x4eaab9['where']})[_0x6a84('0x2f')](function(_0x53fe4d){_0x3f0666[_0x6a84('0x27')]=_0x53fe4d;if(_0x36c9e4[_0x6a84('0x3c')][_0x6a84('0x4b')]){_0x4eaab9[_0x6a84('0x52')]=[{'model':db[_0x6a84('0x6a')],'as':_0x6a84('0x6b'),'required':![]},{'model':db[_0x6a84('0x6c')],'as':_0x6a84('0x6d'),'attributes':[_0x6a84('0x35'),_0x6a84('0x6e'),_0x6a84('0x6f')],'required':![]},{'model':db['Tag'],'as':_0x6a84('0x70'),'attributes':['id',_0x6a84('0x35'),'color'],'where':_0x36c9e4[_0x6a84('0x3c')][_0x6a84('0x71')]?{'id':_0x36c9e4[_0x6a84('0x3c')]['tag']}:undefined,'required':_0x36c9e4[_0x6a84('0x3c')]['tag']?!![]:![]}];}return db[_0x6a84('0x68')][_0x6a84('0x4c')](_0x4eaab9);})[_0x6a84('0x2f')](function(_0x392c91){_0x3f0666[_0x6a84('0x4d')]=_0x392c91;return _0x3f0666;});}})['then'](respondWithFilteredResult(_0x1028f1,_0x4eaab9))[_0x6a84('0x24')](handleError(_0x1028f1,null));};exports[_0x6a84('0x72')]=function(_0xb201aa,_0x15a13e,_0x4b1b5a){return db[_0x6a84('0x39')][_0x6a84('0x5e')]({'where':{'id':_0xb201aa[_0x6a84('0x4e')]['id']}})[_0x6a84('0x2f')](handleEntityNotFound(_0x15a13e,null))[_0x6a84('0x2f')](function(_0xca23c7){if(_0xca23c7){return db['sequelize'][_0x6a84('0x73')](function(_0x371592){return db['FaxApplication'][_0x6a84('0x30')]({'where':{'FaxAccountId':_0xb201aa[_0x6a84('0x4e')]['id']},'transaction':_0x371592})['then'](function(_0x2379c5){var _0x45d8ee=_[_0x6a84('0x47')](_0xb201aa[_0x6a84('0x55')],function(_0x22870c){_0x22870c[_0x6a84('0x5b')]=_0xb201aa['params']['id'];return _0x22870c;});return db['FaxApplication'][_0x6a84('0x74')](_0x45d8ee,{'transaction':_0x371592});});})[_0x6a84('0x2f')](function(){return db[_0x6a84('0x75')][_0x6a84('0x76')]({'where':{'FaxAccountId':_0xb201aa[_0x6a84('0x4e')]['id']},'order':_0x6a84('0x77')});});}})[_0x6a84('0x2f')](respondWithResult(_0x15a13e,null))[_0x6a84('0x24')](handleError(_0x15a13e,null));};exports[_0x6a84('0x78')]=function(_0x5e7817,_0x53c1a5,_0x3f8017){var _0x541ab0={};var _0x3f1bf4={};var _0x192aa5;var _0x246cb9;return db[_0x6a84('0x39')][_0x6a84('0x5e')]({'where':{'id':_0x5e7817[_0x6a84('0x4e')]['id']}})[_0x6a84('0x2f')](handleEntityNotFound(_0x53c1a5,null))[_0x6a84('0x2f')](function(_0x4c6460){if(_0x4c6460){_0x192aa5=_0x4c6460;_0x3f1bf4[_0x6a84('0x3a')]=_[_0x6a84('0x3b')](db[_0x6a84('0x75')]['rawAttributes']);_0x3f1bf4['query']=_[_0x6a84('0x3b')](_0x5e7817[_0x6a84('0x3c')]);_0x3f1bf4[_0x6a84('0x3d')]=_[_0x6a84('0x3f')](_0x3f1bf4[_0x6a84('0x3a')],_0x3f1bf4[_0x6a84('0x3c')]);_0x541ab0[_0x6a84('0x3e')]=_[_0x6a84('0x3f')](_0x3f1bf4[_0x6a84('0x3a')],qs[_0x6a84('0x40')](_0x5e7817['query'][_0x6a84('0x40')]));_0x541ab0[_0x6a84('0x3e')]=_0x541ab0[_0x6a84('0x3e')][_0x6a84('0x51')]?_0x541ab0['attributes']:_0x3f1bf4[_0x6a84('0x3a')];_0x541ab0['order']=qs[_0x6a84('0x5f')](_0x5e7817[_0x6a84('0x3c')]['sort']);_0x541ab0[_0x6a84('0x44')]=qs[_0x6a84('0x3d')](_[_0x6a84('0x60')](_0x5e7817['query'],_0x3f1bf4[_0x6a84('0x3d')]));if(_0x5e7817[_0x6a84('0x3c')][_0x6a84('0x45')]){_0x541ab0[_0x6a84('0x44')]=_['merge'](_0x541ab0[_0x6a84('0x44')],{'$or':_[_0x6a84('0x47')](_0x541ab0['attributes'],function(_0x92daf3){var _0x529688={};_0x529688[_0x92daf3]={'$like':'%'+_0x5e7817['query']['filter']+'%'};return _0x529688;})});}_0x541ab0=_[_0x6a84('0x46')]({},_0x541ab0,_0x5e7817[_0x6a84('0x4a')]);return _0x192aa5[_0x6a84('0x78')](_0x541ab0);}})[_0x6a84('0x2f')](function(_0x77f3a8){if(_0x77f3a8){_0x246cb9=_0x77f3a8[_0x6a84('0x51')];if(!_0x5e7817['query']['hasOwnProperty'](_0x6a84('0x42'))){_0x541ab0[_0x6a84('0x29')]=qs['limit'](_0x5e7817[_0x6a84('0x3c')][_0x6a84('0x29')]);_0x541ab0[_0x6a84('0x28')]=qs[_0x6a84('0x28')](_0x5e7817['query'][_0x6a84('0x28')]);}return _0x192aa5[_0x6a84('0x78')](_0x541ab0);}})[_0x6a84('0x2f')](function(_0x21e629){if(_0x21e629){return _0x21e629?{'count':_0x246cb9,'rows':_0x21e629}:null;}})['then'](respondWithResult(_0x53c1a5,null))[_0x6a84('0x24')](handleError(_0x53c1a5,null));};function Extension(_0xba4a58,_0x1adad4,_0x4e432c,_0x3b01ff){this['context']=_0x6a84('0x79');this[_0x6a84('0x7a')]=_0xba4a58[_0x6a84('0x7b')];this[_0x6a84('0x7c')]=_0x3b01ff;this['type']=_0x6a84('0x7d');this[_0x6a84('0x7e')]=_0x6a84('0x7f');this['FaxAccountId']=_0xba4a58['id'];this[_0x6a84('0x77')]=_0x1adad4;this[_0x6a84('0x80')]=_0x4e432c;}function createExtensionsReciveFax(_0x481999){var _0x489537=0x1;var _0x1847e1=[];_0x1847e1['push'](new Extension(_0x481999,_0x489537,'',_0x6a84('0x81')));_0x489537+=0x1;_0x1847e1['push'](new Extension(_0x481999,_0x489537,_0x6a84('0x82'),_0x6a84('0x83')));_0x489537+=0x1;for(var _0x1c5f6c in _0x481999){if(_0x481999[_0x6a84('0x41')](_0x1c5f6c)&&(_0x1c5f6c===_0x6a84('0x84')||_0x1c5f6c==='localstationid'||_0x1c5f6c===_0x6a84('0x85')||_0x1c5f6c===_0x6a84('0x86')||_0x1c5f6c===_0x6a84('0x87')||_0x1c5f6c===_0x6a84('0x88')||_0x1c5f6c===_0x6a84('0x89')||_0x1c5f6c==='modem'||_0x1c5f6c==='t38timeout')){_0x1847e1[_0x6a84('0x8a')](new Extension(_0x481999,_0x489537,'FAXOPT('+_0x1c5f6c+')='+_0x481999[_0x1c5f6c],_0x6a84('0x83')));_0x489537+=0x1;}}_0x1847e1['push'](new Extension(_0x481999,_0x489537,'6',_0x6a84('0x8b')));_0x489537+=0x1;_0x1847e1[_0x6a84('0x8a')](new Extension(_0x481999,_0x489537,_0x6a84('0x8c'),_0x6a84('0x8d')));_0x489537=0x0;return _0x1847e1;}exports[_0x6a84('0x8e')]=function(_0x34093f,_0x58b077,_0x3e061e){var _0x3ee5e3;return db[_0x6a84('0x8f')]['transaction'](function(_0x39d78c){return db['FaxAccount'][_0x6a84('0x54')](_0x34093f[_0x6a84('0x55')],{'transaction':_0x39d78c})['then'](function(_0x17115a){_0x3ee5e3=_0x17115a['get']({'plain':!![]});return db[_0x6a84('0x90')][_0x6a84('0x74')](createExtensionsReciveFax(_0x3ee5e3),{'transaction':_0x39d78c});});})[_0x6a84('0x2f')](function(){return _0x3ee5e3;})['then'](respondWithResult(_0x58b077,null))[_0x6a84('0x24')](handleError(_0x58b077,null));};exports[_0x6a84('0x91')]=function(_0x5b7fa4,_0x1684f1,_0x582a3e){var _0x3157a4;return db['sequelize'][_0x6a84('0x73')](function(_0x4f66e0){return db[_0x6a84('0x39')][_0x6a84('0x2e')](_0x5b7fa4[_0x6a84('0x55')],{'where':{'id':_0x5b7fa4[_0x6a84('0x55')]['id']},'transaction':_0x4f66e0})[_0x6a84('0x2f')](function(_0x48cc0b){return db[_0x6a84('0x90')]['destroy']({'where':{'FaxAccountId':_0x5b7fa4['body']['id']},'transaction':_0x4f66e0})[_0x6a84('0x2f')](function(_0x2d200c){return db[_0x6a84('0x90')][_0x6a84('0x74')](createExtensionsReciveFax(_['omit'](_0x5b7fa4[_0x6a84('0x55')],[_0x6a84('0x92'),'key',_0x6a84('0x93'),_0x6a84('0x94'),_0x6a84('0x95'),_0x6a84('0x96')])),{'transaction':_0x4f66e0});});});})[_0x6a84('0x2f')](function(){return db[_0x6a84('0x39')][_0x6a84('0x97')](_0x5b7fa4['body']['id']);})[_0x6a84('0x2f')](respondWithResult(_0x1684f1,null))['catch'](handleError(_0x1684f1,null));};exports['getMessages']=function(_0x2f3b41,_0x4b3ed5,_0x3d10b2){var _0x527058={'raw':!![],'where':{}};var _0x41e2de={};var _0x532977={'count':0x0,'rows':[]};return db[_0x6a84('0x39')]['findOne']({'where':{'id':_0x2f3b41[_0x6a84('0x4e')]['id']}})[_0x6a84('0x2f')](handleEntityNotFound(_0x4b3ed5,null))[_0x6a84('0x2f')](function(_0x55991a){if(_0x55991a){_0x41e2de['model']=_[_0x6a84('0x3b')](db[_0x6a84('0x98')][_0x6a84('0x50')]);_0x41e2de[_0x6a84('0x3c')]=_[_0x6a84('0x3b')](_0x2f3b41[_0x6a84('0x3c')]);_0x41e2de[_0x6a84('0x3d')]=_[_0x6a84('0x3f')](_0x41e2de[_0x6a84('0x3a')],_0x41e2de[_0x6a84('0x3c')]);_0x527058['attributes']=_[_0x6a84('0x3f')](_0x41e2de[_0x6a84('0x3a')],qs[_0x6a84('0x40')](_0x2f3b41[_0x6a84('0x3c')][_0x6a84('0x40')]));_0x527058[_0x6a84('0x3e')]=_0x527058['attributes'][_0x6a84('0x51')]?_0x527058[_0x6a84('0x3e')]:_0x41e2de['model'];if(!_0x2f3b41['query'][_0x6a84('0x41')]('nolimit')){_0x527058[_0x6a84('0x29')]=qs[_0x6a84('0x29')](_0x2f3b41[_0x6a84('0x3c')][_0x6a84('0x29')]);_0x527058[_0x6a84('0x28')]=qs[_0x6a84('0x28')](_0x2f3b41[_0x6a84('0x3c')][_0x6a84('0x28')]);}_0x527058['order']=qs[_0x6a84('0x5f')](_0x2f3b41['query'][_0x6a84('0x5f')]);_0x527058[_0x6a84('0x44')]=qs[_0x6a84('0x3d')](_[_0x6a84('0x60')](_0x2f3b41[_0x6a84('0x3c')],_0x41e2de[_0x6a84('0x3d')]));_0x527058[_0x6a84('0x44')]['FaxAccountId']=_0x55991a['id'];if(_0x2f3b41[_0x6a84('0x3c')]['filter']){_0x527058[_0x6a84('0x44')]=_[_0x6a84('0x46')](_0x527058[_0x6a84('0x44')],{'$or':_['map'](_0x527058['attributes'],function(_0x1313d6){var _0x211d40={};_0x211d40[_0x1313d6]={'$like':'%'+_0x2f3b41[_0x6a84('0x3c')][_0x6a84('0x45')]+'%'};return _0x211d40;})});}if(_0x2f3b41[_0x6a84('0x3c')][_0x6a84('0x99')]){var _0x374f71=_0x2f3b41['query'][_0x6a84('0x99')][_0x6a84('0x9a')](',');var _0x568e65={};_0x568e65[_0x374f71[0x0]]={'$gte':moment(_0x374f71[0x1])['format'](_0x6a84('0x9b'))};_0x527058[_0x6a84('0x44')]=_[_0x6a84('0x46')](_0x527058[_0x6a84('0x44')],_0x568e65);}_0x527058=_['merge']({},_0x527058,_0x2f3b41[_0x6a84('0x4a')]);return db[_0x6a84('0x98')]['count']({'where':_0x527058['where']})[_0x6a84('0x2f')](function(_0x1c2447){_0x532977[_0x6a84('0x27')]=_0x1c2447;if(_0x2f3b41[_0x6a84('0x3c')]['includeAll']){_0x527058['include']=[{'all':!![]}];}return db['FaxMessage'][_0x6a84('0x4c')](_0x527058);})['then'](function(_0x1dd32d){_0x532977[_0x6a84('0x4d')]=_0x1dd32d;return _0x532977;});}})[_0x6a84('0x2f')](respondWithFilteredResult(_0x4b3ed5,_0x527058))[_0x6a84('0x24')](handleError(_0x4b3ed5,null));};exports[_0x6a84('0x36')]=function(_0x272f27,_0x31ef18,_0xb1212a){var _0x524a3c,_0x3e4bea={},_0x22c42a;if(_0x272f27[_0x6a84('0x55')]['to']){_0x22c42a=_0x272f27[_0x6a84('0x55')]['to'][0x0];}return db[_0x6a84('0x39')][_0x6a84('0x53')]({'where':{'id':_0x272f27[_0x6a84('0x4e')]['id']},'include':[{'model':db[_0x6a84('0x9c')],'as':_0x6a84('0x9d'),'include':[{'model':db[_0x6a84('0x6a')],'as':_0x6a84('0x9e'),'where':{'fax':_0x22c42a},'limit':0x1,'order':[[_0x6a84('0x94'),_0x6a84('0x9f')]]}]}]})[_0x6a84('0x2f')](handleEntityNotFound(_0x31ef18,null))[_0x6a84('0x2f')](function(_0x518857){_0x524a3c=_0x518857;if(_0x272f27[_0x6a84('0x55')][_0x6a84('0xa0')]&&_0x272f27[_0x6a84('0x55')][_0x6a84('0xa0')][_0x6a84('0x51')]){for(var _0xf48f56=0x0;_0xf48f56<_0x272f27[_0x6a84('0x55')]['attachments'][_0x6a84('0x51')];_0xf48f56+=0x1){_0x272f27[_0x6a84('0x55')][_0x6a84('0xa0')][_0xf48f56]={'filename':_0x272f27[_0x6a84('0x55')]['attachments'][_0xf48f56][_0x6a84('0x35')],'id':_0x272f27['body'][_0x6a84('0xa0')][_0xf48f56]['id'],'path':path[_0x6a84('0xa1')](config['root'],'server/files/attachments',_0x272f27[_0x6a84('0x55')][_0x6a84('0xa0')][_0xf48f56]['basename'])};}}return respondWithRpcPromise(_0x6a84('0xa2'),'CheckAfterSend',{'FaxAccountId':_[_0x6a84('0xa3')](_0x272f27['params']['id'])?undefined:_0x272f27[_0x6a84('0x4e')]['id'],'path':_['isNil'](_0x272f27['body'][_0x6a84('0xa0')][0x0][_0x6a84('0xa4')])?undefined:_0x272f27['body']['attachments'][0x0][_0x6a84('0xa4')],'fax':_[_0x6a84('0xa3')](_0x272f27['body']['to'][0x0])?undefined:_0x272f27[_0x6a84('0x55')]['to'][0x0]},client9002);})[_0x6a84('0x2f')](function(){if(_0x524a3c){if(_[_0x6a84('0xa3')](_0x272f27[_0x6a84('0x55')]['from'])){_0x272f27[_0x6a84('0x55')][_0x6a84('0xa5')]=util[_0x6a84('0xa6')](_0x6a84('0xa7'),_0x524a3c[_0x6a84('0x35')],_0x524a3c[_0x6a84('0xa8')]);}if(_0x524a3c[_0x6a84('0x9d')]){if(_0x524a3c['List'][_0x6a84('0x9e')][_0x6a84('0x51')]){return _0x524a3c[_0x6a84('0x9d')][_0x6a84('0x9e')][0x0];}else{return db['CmContact'][_0x6a84('0x54')](_[_0x6a84('0xa9')](_0x272f27[_0x6a84('0x55')],{'firstName':_0x272f27[_0x6a84('0x55')]['to'][0x0],'phone':_0x272f27['body']['to'][0x0],'fax':_0x272f27[_0x6a84('0x55')]['to'][0x0],'ListId':_0x524a3c[_0x6a84('0x96')]}));}}else{throw new Error(_0x6a84('0xaa'));}}else{throw new Error(_0x6a84('0xab'));}})['then'](function(_0x1cd777){if(_0x1cd777){return db['FaxInteraction'][_0x6a84('0x53')]({'where':{'ContactId':_0x1cd777['id'],'closed':![],'FaxAccountId':_0x524a3c['id']}})[_0x6a84('0x2f')](function(_0x1bc69c){if(_0x1bc69c){return[_0x1bc69c,![]];}return db[_0x6a84('0x68')][_0x6a84('0x54')]({'UserId':_0x272f27[_0x6a84('0x57')]['id'],'ContactId':_0x1cd777['id'],'FaxAccountId':_0x524a3c['id'],'fax':_0x272f27[_0x6a84('0x55')]['to'][0x0],'firstMsgDirection':_0x6a84('0xac'),'Messages':[_['merge'](_0x272f27[_0x6a84('0x55')],{'read':![],'body':_0x272f27[_0x6a84('0x55')][_0x6a84('0xa0')][0x0]['filename'],'FaxAccountId':_0x524a3c['id'],'UserId':_0x272f27['user']['id'],'ContactId':_0x1cd777['id'],'AttachmentId':_0x272f27['body'][_0x6a84('0xa0')][0x0]['id']})]},{'include':[{'model':db[_0x6a84('0x98')],'as':'Messages'}]})[_0x6a84('0x2f')](function(_0x2234d5){return[_0x2234d5,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x6a84('0xad')](function(_0x2c1439,_0x5875b2){if(_0x5875b2){return _0x2c1439;}return db[_0x6a84('0x98')][_0x6a84('0x54')]({'direction':'out','read':![],'body':_0x272f27['body'][_0x6a84('0xa0')][0x0]['filename'],'FaxAccountId':_0x524a3c['id'],'FaxInteractionId':_0x2c1439['id'],'UserId':_0x272f27['user']['id'],'ContactId':_0x2c1439[_0x6a84('0xae')],'AttachmentId':_0x272f27[_0x6a84('0x55')][_0x6a84('0xa0')][0x0]['id']})[_0x6a84('0x2f')](function(_0x4da354){_0x2c1439[_0x6a84('0xaf')]['Messages']=[];_0x2c1439[_0x6a84('0xaf')]['Messages'][_0x6a84('0x8a')](_0x4da354['dataValues']);return _0x2c1439;});})[_0x6a84('0x2f')](function(_0x4f37d4){respondWithRpcPromise('SendFax',_0x6a84('0xb0'),{'FaxAccountId':_['isNil'](_0x272f27['params']['id'])?undefined:_0x272f27[_0x6a84('0x4e')]['id'],'path':_[_0x6a84('0xa3')](_0x272f27['body'][_0x6a84('0xa0')][0x0]['path'])?undefined:_0x272f27[_0x6a84('0x55')][_0x6a84('0xa0')][0x0][_0x6a84('0xa4')],'fax':_[_0x6a84('0xa3')](_0x272f27[_0x6a84('0x55')]['to'][0x0])?undefined:_0x272f27[_0x6a84('0x55')]['to'][0x0],'AttachmentId':_0x272f27[_0x6a84('0x55')][_0x6a84('0xa0')][0x0]['id']},client9002)[_0x6a84('0x2f')](function(_0x536730){logger['info']('SendFaxRpc,\x20%s',_0x536730);})['catch'](function(_0x2c6e37){logger[_0x6a84('0x22')](_0x6a84('0xb1'),_0x2c6e37);});return _0x4f37d4;})['then'](respondWithResult(_0x31ef18,null))['catch'](handleError(_0x31ef18,null));};exports[_0x6a84('0xb2')]=function(_0x291c53,_0x558de7,_0x3f285b){return db[_0x6a84('0x39')][_0x6a84('0x53')]({'where':{'id':_0x291c53['params']['id']}})['then'](handleEntityNotFound(_0x558de7,null))[_0x6a84('0x2f')](function(_0x26b7eb){if(_0x26b7eb){return _0x26b7eb['addAgents'](_0x291c53[_0x6a84('0x55')][_0x6a84('0x62')],_[_0x6a84('0xb3')](_0x291c53['body'],[_0x6a84('0x62'),'id'])||{})[_0x6a84('0xad')](function(_0xf2e000){for(var _0xbc443a=0x0;_0xbc443a<_0x291c53[_0x6a84('0x55')][_0x6a84('0x62')][_0x6a84('0x51')];_0xbc443a+=0x1){socket[_0x6a84('0xb4')](_0x6a84('0xb5'),{'UserId':_0x291c53[_0x6a84('0x55')][_0x6a84('0x62')][_0xbc443a],'FaxAccountId':_0x291c53['params']['id']});}return _0xf2e000;});}})[_0x6a84('0x2f')](respondWithResult(_0x558de7,null))['catch'](handleError(_0x558de7,null));};exports['removeAgents']=function(_0x14e5a8,_0x1bec71,_0x18f923){var _0x3a0d5e;return db[_0x6a84('0x39')][_0x6a84('0x53')]({'where':{'id':_0x14e5a8[_0x6a84('0x4e')]['id']}})[_0x6a84('0x2f')](handleEntityNotFound(_0x1bec71,null))['then'](function(_0x2f5c7e){if(_0x2f5c7e){return _0x2f5c7e[_0x6a84('0xb6')](_0x14e5a8[_0x6a84('0x3c')]['ids'])[_0x6a84('0x2f')](function(_0x2f481e){if(_[_0x6a84('0xb7')](_0x14e5a8[_0x6a84('0x3c')][_0x6a84('0x62')])){for(var _0x16b75a=0x0;_0x16b75a<_0x14e5a8['query'][_0x6a84('0x62')][_0x6a84('0x51')];_0x16b75a+=0x1){socket[_0x6a84('0xb4')](_0x6a84('0xb8'),{'UserId':_0x14e5a8[_0x6a84('0x3c')][_0x6a84('0x62')][_0x16b75a],'FaxAccountId':_0x14e5a8[_0x6a84('0x4e')]['id']});}}else{socket['emit']('userFaxAccount:remove',{'UserId':_0x14e5a8[_0x6a84('0x3c')][_0x6a84('0x62')],'FaxAccountId':_0x14e5a8[_0x6a84('0x4e')]['id']});}});}})['then'](respondWithStatusCode(_0x1bec71,null))[_0x6a84('0x24')](handleError(_0x1bec71,null));};exports[_0x6a84('0xb9')]=function(_0x441f6b,_0x2e6dd7,_0x39fe0e){var _0x52ce89={};var _0x3fe5b1={};var _0x5cb849;var _0x41a95f;return db[_0x6a84('0x39')][_0x6a84('0x5e')]({'where':{'id':_0x441f6b[_0x6a84('0x4e')]['id']}})[_0x6a84('0x2f')](handleEntityNotFound(_0x2e6dd7,null))[_0x6a84('0x2f')](function(_0x138fc0){if(_0x138fc0){_0x5cb849=_0x138fc0;_0x3fe5b1['model']=_[_0x6a84('0x3b')](db['User'][_0x6a84('0x50')]);_0x3fe5b1[_0x6a84('0x3c')]=_[_0x6a84('0x3b')](_0x441f6b[_0x6a84('0x3c')]);_0x3fe5b1[_0x6a84('0x3d')]=_[_0x6a84('0x3f')](_0x3fe5b1[_0x6a84('0x3a')],_0x3fe5b1[_0x6a84('0x3c')]);_0x52ce89[_0x6a84('0x3e')]=_[_0x6a84('0x3f')](_0x3fe5b1['model'],qs[_0x6a84('0x40')](_0x441f6b[_0x6a84('0x3c')][_0x6a84('0x40')]));_0x52ce89[_0x6a84('0x3e')]=_0x52ce89[_0x6a84('0x3e')][_0x6a84('0x51')]?_0x52ce89['attributes']:_0x3fe5b1['model'];_0x52ce89[_0x6a84('0x43')]=qs[_0x6a84('0x5f')](_0x441f6b[_0x6a84('0x3c')][_0x6a84('0x5f')]);_0x52ce89[_0x6a84('0x44')]=qs[_0x6a84('0x3d')](_[_0x6a84('0x60')](_0x441f6b[_0x6a84('0x3c')],_0x3fe5b1[_0x6a84('0x3d')]));if(_0x441f6b[_0x6a84('0x3c')][_0x6a84('0x45')]){_0x52ce89[_0x6a84('0x44')]=_[_0x6a84('0x46')](_0x52ce89[_0x6a84('0x44')],{'$or':_[_0x6a84('0x47')](_0x52ce89[_0x6a84('0x3e')],function(_0x5358b5){var _0x5312d6={};_0x5312d6[_0x5358b5]={'$like':'%'+_0x441f6b[_0x6a84('0x3c')][_0x6a84('0x45')]+'%'};return _0x5312d6;})});}_0x52ce89=_[_0x6a84('0x46')]({},_0x52ce89,_0x441f6b[_0x6a84('0x4a')]);return _0x5cb849[_0x6a84('0xb9')](_0x52ce89);}})[_0x6a84('0x2f')](function(_0x206e38){if(_0x206e38){_0x41a95f=_0x206e38[_0x6a84('0x51')];if(!_0x441f6b['query'][_0x6a84('0x41')](_0x6a84('0x42'))){_0x52ce89[_0x6a84('0x29')]=qs[_0x6a84('0x29')](_0x441f6b[_0x6a84('0x3c')][_0x6a84('0x29')]);_0x52ce89['offset']=qs[_0x6a84('0x28')](_0x441f6b['query']['offset']);}return _0x5cb849[_0x6a84('0xb9')](_0x52ce89);}})[_0x6a84('0x2f')](function(_0x4e7746){if(_0x4e7746){return _0x4e7746?{'count':_0x41a95f,'rows':_0x4e7746}:null;}})[_0x6a84('0x2f')](respondWithResult(_0x2e6dd7,null))[_0x6a84('0x24')](handleError(_0x2e6dd7,null));}; \ No newline at end of file +var _0x9dc6=['Owner','fullname','internal','Tag','color','tag','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','headerinfo','maxrate','minrate','t38timeout','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','tech','key','createdAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','path','isNil','from','fax','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','http','client','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','user','get','role','UserProfileSection','userProfileId','params','describe','addDisposition','FaxAccountId','Disposition','findOne','length','order','filter','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','User'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9dc6,0x1c7));var _0x69dc=function(_0x68debf,_0x9561d8){_0x68debf=_0x68debf-0x0;var _0x7f3eae=_0x9dc6[_0x68debf];return _0x7f3eae;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x69dc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x69dc('0x1'));var jsonpatch=require(_0x69dc('0x2'));var rp=require('request-promise');var moment=require(_0x69dc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x69dc('0x4'));var util=require('util');var path=require('path');var sox=require(_0x69dc('0x5'));var csv=require(_0x69dc('0x6'));var ejs=require(_0x69dc('0x7'));var fs=require('fs');var _=require(_0x69dc('0x8'));var squel=require(_0x69dc('0x9'));var crypto=require(_0x69dc('0xa'));var jsforce=require(_0x69dc('0xb'));var deskjs=require(_0x69dc('0xc'));var toCsv=require(_0x69dc('0x6'));var querystring=require('querystring');var Papa=require(_0x69dc('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x69dc('0xe'));var Redis=require('ioredis');var qs=require(_0x69dc('0xf'));var logger=require(_0x69dc('0x10'))('api');var utils=require(_0x69dc('0x11'));var config=require(_0x69dc('0x12'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x69dc('0x13')](config[_0x69dc('0x14')],{'host':_0x69dc('0x15'),'port':0x18eb});var socket=require(_0x69dc('0x16'))(new Redis(config[_0x69dc('0x14')]));require(_0x69dc('0x17'))['register'](socket);var jayson=require(_0x69dc('0x18'));var client=jayson['client'][_0x69dc('0x19')]({'port':0x232c});var client9002=jayson[_0x69dc('0x1a')][_0x69dc('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4e4813,_0x178660,_0x25ecd1,_0x179113){return new BPromise(function(_0x20facb,_0x3f51fe){var _0x143687=_0x179113||client;return _0x143687['request'](_0x4e4813,_0x25ecd1)[_0x69dc('0x1b')](function(_0x5b2f84){logger[_0x69dc('0x1c')](_0x69dc('0x1d'),_0x178660,_0x69dc('0x1e'));logger['debug'](_0x69dc('0x1f'),_0x178660,_0x69dc('0x1e'),JSON['stringify'](_0x5b2f84));if(_0x5b2f84['error']){if(_0x5b2f84[_0x69dc('0x20')][_0x69dc('0x21')]===0x1f4){logger[_0x69dc('0x20')](_0x69dc('0x1d'),_0x178660,_0x5b2f84[_0x69dc('0x20')][_0x69dc('0x22')]);return _0x3f51fe(_0x5b2f84['error']['message']);}logger[_0x69dc('0x20')](_0x69dc('0x1d'),_0x178660,_0x5b2f84[_0x69dc('0x20')][_0x69dc('0x22')]);return _0x20facb(_0x5b2f84['error'][_0x69dc('0x22')]);}else{logger[_0x69dc('0x1c')](_0x69dc('0x1d'),_0x178660,'request\x20sent');_0x20facb(_0x5b2f84[_0x69dc('0x23')][_0x69dc('0x22')]);}})[_0x69dc('0x24')](function(_0x5c9432){logger[_0x69dc('0x20')]('FaxAccount,\x20%s,\x20%s',_0x178660,_0x5c9432);_0x3f51fe(_0x5c9432);});});}function respondWithStatusCode(_0x39e0ff,_0x401da8){_0x401da8=_0x401da8||0xcc;return function(_0x1fe6d2){if(_0x1fe6d2){return _0x39e0ff[_0x69dc('0x25')](_0x401da8);}return _0x39e0ff['status'](_0x401da8)[_0x69dc('0x26')]();};}function respondWithResult(_0x31a049,_0x378ef0){_0x378ef0=_0x378ef0||0xc8;return function(_0x5ebe28){if(_0x5ebe28){return _0x31a049[_0x69dc('0x27')](_0x378ef0)[_0x69dc('0x28')](_0x5ebe28);}};}function respondWithFilteredResult(_0x2b13d3,_0x24fb44){return function(_0x47641b){if(_0x47641b){var _0x5eef9b=_0x47641b[_0x69dc('0x29')],_0x303b55=_0x24fb44[_0x69dc('0x2a')],_0x4bcdc3=_0x24fb44[_0x69dc('0x2a')]+_0x24fb44[_0x69dc('0x2b')],_0x2e2551;if(_0x4bcdc3>=_0x5eef9b){_0x4bcdc3=_0x5eef9b;_0x2e2551=0xc8;}else{_0x2e2551=0xce;}_0x2b13d3[_0x69dc('0x27')](_0x2e2551);return _0x2b13d3[_0x69dc('0x2c')](_0x69dc('0x2d'),_0x303b55+'-'+_0x4bcdc3+'/'+_0x5eef9b)[_0x69dc('0x28')](_0x47641b);}return null;};}function patchUpdates(_0x21d4b6){return function(_0x384075){try{jsonpatch[_0x69dc('0x2e')](_0x384075,_0x21d4b6,!![]);}catch(_0x36df7b){return BPromise[_0x69dc('0x2f')](_0x36df7b);}return _0x384075[_0x69dc('0x30')]();};}function saveUpdates(_0x1e1ea3,_0x2acbb6){return function(_0xb8a7bb){if(_0xb8a7bb){return _0xb8a7bb[_0x69dc('0x31')](_0x1e1ea3)[_0x69dc('0x1b')](function(_0x4e8f2e){return _0x4e8f2e;});}return null;};}function removeEntity(_0x1d336e,_0x59eeb5){return function(_0x53749e){if(_0x53749e){return _0x53749e[_0x69dc('0x32')]()[_0x69dc('0x1b')](function(){var _0x2481fc=_0x53749e['get']({'plain':!![]});var _0x16e8ca=_0x69dc('0x33');return db[_0x69dc('0x34')][_0x69dc('0x32')]({'where':{'type':_0x16e8ca,'resourceId':_0x2481fc['id']}})[_0x69dc('0x1b')](function(){return _0x53749e;});})['then'](function(){_0x1d336e[_0x69dc('0x27')](0xcc)[_0x69dc('0x26')]();});}};}function handleEntityNotFound(_0x33b138,_0x787f8d){return function(_0x246d5f){if(!_0x246d5f){_0x33b138[_0x69dc('0x25')](0x194);}return _0x246d5f;};}function handleError(_0xc7c30,_0x447e81){_0x447e81=_0x447e81||0x1f4;return function(_0x16a02c){logger[_0x69dc('0x20')](_0x16a02c[_0x69dc('0x35')]);if(_0x16a02c[_0x69dc('0x36')]){delete _0x16a02c[_0x69dc('0x36')];}_0xc7c30['status'](_0x447e81)[_0x69dc('0x37')](_0x16a02c);};}exports[_0x69dc('0x38')]=function(_0x4cdc23,_0x27e644){var _0x168ee3={'include':[{'model':db[_0x69dc('0x39')],'as':_0x69dc('0x3a')}]},_0x4a564e={},_0x33d110={'count':0x0,'rows':[]};var _0x55cd36=db[_0x69dc('0x3b')][_0x69dc('0x3c')];_0x4a564e['model']=_[_0x69dc('0x3d')](_0x55cd36);_0x4a564e[_0x69dc('0x3e')]=_[_0x69dc('0x3d')](_0x4cdc23['query']);_0x4a564e[_0x69dc('0x3f')]=_[_0x69dc('0x40')](_0x4a564e[_0x69dc('0x41')],_0x4a564e[_0x69dc('0x3e')]);_0x168ee3[_0x69dc('0x42')]=_[_0x69dc('0x40')](_0x4a564e[_0x69dc('0x41')],qs[_0x69dc('0x43')](_0x4cdc23[_0x69dc('0x3e')][_0x69dc('0x43')]));_0x168ee3[_0x69dc('0x42')]=_0x168ee3[_0x69dc('0x42')]['length']?_0x168ee3[_0x69dc('0x42')]:_0x4a564e[_0x69dc('0x41')];if(!_0x4cdc23[_0x69dc('0x3e')][_0x69dc('0x44')](_0x69dc('0x45'))){_0x168ee3[_0x69dc('0x2b')]=qs[_0x69dc('0x2b')](_0x4cdc23[_0x69dc('0x3e')]['limit']);_0x168ee3[_0x69dc('0x2a')]=qs[_0x69dc('0x2a')](_0x4cdc23[_0x69dc('0x3e')][_0x69dc('0x2a')]);}_0x168ee3['order']=qs[_0x69dc('0x46')](_0x4cdc23[_0x69dc('0x3e')][_0x69dc('0x46')]);_0x168ee3[_0x69dc('0x47')]=qs[_0x69dc('0x3f')](_[_0x69dc('0x48')](_0x4cdc23[_0x69dc('0x3e')],_0x4a564e[_0x69dc('0x3f')]));if(_0x4cdc23[_0x69dc('0x3e')]['filter']){_0x168ee3[_0x69dc('0x47')]=_[_0x69dc('0x49')](_0x168ee3[_0x69dc('0x47')],{'$or':_[_0x69dc('0x4a')](_0x55cd36,function(_0x5f4e5c){if(_0x5f4e5c[_0x69dc('0x4b')]['key']!==_0x69dc('0x4c')){var _0x226333={};_0x226333[_0x5f4e5c['field']]={'$like':'%'+_0x4cdc23[_0x69dc('0x3e')]['filter']+'%'};return _0x226333;}})});}_0x168ee3=_[_0x69dc('0x49')]({},_0x168ee3,_0x4cdc23[_0x69dc('0x4d')]);var _0x5a6623={'where':_0x168ee3['where']};return db[_0x69dc('0x3b')]['count'](_0x5a6623)[_0x69dc('0x1b')](function(_0x5af030){_0x33d110[_0x69dc('0x29')]=_0x5af030;if(_0x4cdc23[_0x69dc('0x3e')][_0x69dc('0x4e')]){_0x168ee3[_0x69dc('0x4f')]=[{'all':!![]}];}return db[_0x69dc('0x3b')][_0x69dc('0x50')](_0x168ee3);})[_0x69dc('0x1b')](function(_0xc9ff3a){_0x33d110[_0x69dc('0x51')]=_0xc9ff3a;return _0x33d110;})[_0x69dc('0x1b')](respondWithFilteredResult(_0x27e644,_0x168ee3))[_0x69dc('0x24')](handleError(_0x27e644,null));};exports[_0x69dc('0x52')]=function(_0x210b76,_0x275399){var _0x30e8a8={'raw':![],'where':{'id':_0x210b76['params']['id']},'include':[{'model':db['Pause'],'as':_0x69dc('0x3a')}]},_0x41f584={};_0x41f584['model']=_[_0x69dc('0x3d')](db[_0x69dc('0x3b')][_0x69dc('0x3c')]);_0x41f584[_0x69dc('0x3e')]=_[_0x69dc('0x3d')](_0x210b76[_0x69dc('0x3e')]);_0x41f584[_0x69dc('0x3f')]=_[_0x69dc('0x40')](_0x41f584['model'],_0x41f584[_0x69dc('0x3e')]);_0x30e8a8[_0x69dc('0x42')]=_[_0x69dc('0x40')](_0x41f584[_0x69dc('0x41')],qs[_0x69dc('0x43')](_0x210b76[_0x69dc('0x3e')][_0x69dc('0x43')]));_0x30e8a8[_0x69dc('0x42')]=_0x30e8a8[_0x69dc('0x42')]['length']?_0x30e8a8[_0x69dc('0x42')]:_0x41f584[_0x69dc('0x41')];if(_0x210b76[_0x69dc('0x3e')]['includeAll']){_0x30e8a8[_0x69dc('0x4f')]=[{'all':!![]}];}_0x30e8a8=_[_0x69dc('0x49')]({},_0x30e8a8,_0x210b76[_0x69dc('0x4d')]);return db[_0x69dc('0x3b')][_0x69dc('0x53')](_0x30e8a8)['then'](handleEntityNotFound(_0x275399,null))['then'](respondWithResult(_0x275399,null))[_0x69dc('0x24')](handleError(_0x275399,null));};exports[_0x69dc('0x54')]=function(_0x16b681,_0x4fb676){return db[_0x69dc('0x3b')][_0x69dc('0x54')](_0x16b681[_0x69dc('0x55')],{})['then'](function(_0x379221){var _0x3b1c86=_0x16b681[_0x69dc('0x56')][_0x69dc('0x57')]({'plain':!![]});if(!_0x3b1c86)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b1c86[_0x69dc('0x58')]===_0x69dc('0x56')){var _0x3d77c4=_0x379221['get']({'plain':!![]});var _0x5efe3a='FaxAccounts';return db[_0x69dc('0x59')][_0x69dc('0x53')]({'where':{'name':_0x5efe3a,'userProfileId':_0x3b1c86[_0x69dc('0x5a')]},'raw':!![]})[_0x69dc('0x1b')](function(_0x4b8d0c){if(_0x4b8d0c&&_0x4b8d0c['autoAssociation']===0x0){return db[_0x69dc('0x34')][_0x69dc('0x54')]({'name':_0x3d77c4[_0x69dc('0x36')],'resourceId':_0x3d77c4['id'],'type':_0x4b8d0c[_0x69dc('0x36')],'sectionId':_0x4b8d0c['id']},{})[_0x69dc('0x1b')](function(){return _0x379221;});}else{return _0x379221;}})[_0x69dc('0x24')](function(_0x44a98b){logger[_0x69dc('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44a98b);throw _0x44a98b;});}return _0x379221;})['then'](respondWithResult(_0x4fb676,0xc9))[_0x69dc('0x24')](handleError(_0x4fb676,null));};exports[_0x69dc('0x31')]=function(_0x5beb47,_0x1a4862){if(_0x5beb47[_0x69dc('0x55')]['id']){delete _0x5beb47[_0x69dc('0x55')]['id'];}return db[_0x69dc('0x3b')][_0x69dc('0x53')]({'where':{'id':_0x5beb47[_0x69dc('0x5b')]['id']},'include':[{'model':db[_0x69dc('0x39')],'as':_0x69dc('0x3a')}]})['then'](handleEntityNotFound(_0x1a4862,null))['then'](saveUpdates(_0x5beb47[_0x69dc('0x55')],null))[_0x69dc('0x1b')](function(_0x554d41){if(_0x554d41&&_0x5beb47['body'][_0x69dc('0x3a')]){return db[_0x69dc('0x39')][_0x69dc('0x31')](_0x5beb47[_0x69dc('0x55')][_0x69dc('0x3a')],{'where':{'FaxAccountId':_0x554d41['id']}})['then'](function(){return _0x554d41;});}return _0x554d41;})['then'](respondWithResult(_0x1a4862,null))['catch'](handleError(_0x1a4862,null));};exports['destroy']=function(_0x5cd02c,_0x1f5809){return db[_0x69dc('0x3b')][_0x69dc('0x53')]({'where':{'id':_0x5cd02c['params']['id']}})[_0x69dc('0x1b')](handleEntityNotFound(_0x1f5809,null))[_0x69dc('0x1b')](removeEntity(_0x1f5809,null))[_0x69dc('0x24')](handleError(_0x1f5809,null));};exports['describe']=function(_0x1ebfbc,_0x3910a6){return db[_0x69dc('0x3b')][_0x69dc('0x5c')]()[_0x69dc('0x1b')](respondWithResult(_0x3910a6,null))[_0x69dc('0x24')](handleError(_0x3910a6,null));};exports[_0x69dc('0x5d')]=function(_0x55ec98,_0x11f78d,_0x4de465){if(_0x55ec98[_0x69dc('0x55')]['id']){delete _0x55ec98[_0x69dc('0x55')]['id'];}return db[_0x69dc('0x3b')]['find']({'where':{'id':_0x55ec98[_0x69dc('0x5b')]['id']}})['then'](handleEntityNotFound(_0x11f78d,null))['then'](function(_0x55fea5){if(_0x55fea5){_0x55ec98['body'][_0x69dc('0x5e')]=_0x55fea5['id'];return db[_0x69dc('0x5f')][_0x69dc('0x54')](_0x55ec98[_0x69dc('0x55')]);}})[_0x69dc('0x1b')](respondWithResult(_0x11f78d,null))[_0x69dc('0x24')](handleError(_0x11f78d,null));};exports['getDispositions']=function(_0x44b1c9,_0x28cfa4,_0x165366){var _0x2c7d7a={'raw':![],'where':{}};var _0x1aebd5={};var _0x5db24e={'count':0x0,'rows':[]};return db['FaxAccount'][_0x69dc('0x60')]({'where':{'id':_0x44b1c9['params']['id']}})['then'](handleEntityNotFound(_0x28cfa4,null))[_0x69dc('0x1b')](function(_0x396389){if(_0x396389){_0x1aebd5[_0x69dc('0x41')]=_[_0x69dc('0x3d')](db[_0x69dc('0x5f')][_0x69dc('0x3c')]);_0x1aebd5[_0x69dc('0x3e')]=_[_0x69dc('0x3d')](_0x44b1c9['query']);_0x1aebd5['filters']=_['intersection'](_0x1aebd5[_0x69dc('0x41')],_0x1aebd5[_0x69dc('0x3e')]);_0x2c7d7a[_0x69dc('0x42')]=_[_0x69dc('0x40')](_0x1aebd5[_0x69dc('0x41')],qs['fields'](_0x44b1c9[_0x69dc('0x3e')]['fields']));_0x2c7d7a[_0x69dc('0x42')]=_0x2c7d7a[_0x69dc('0x42')][_0x69dc('0x61')]?_0x2c7d7a[_0x69dc('0x42')]:_0x1aebd5[_0x69dc('0x41')];if(!_0x44b1c9[_0x69dc('0x3e')][_0x69dc('0x44')]('nolimit')){_0x2c7d7a[_0x69dc('0x2b')]=qs['limit'](_0x44b1c9[_0x69dc('0x3e')][_0x69dc('0x2b')]);_0x2c7d7a[_0x69dc('0x2a')]=qs[_0x69dc('0x2a')](_0x44b1c9[_0x69dc('0x3e')][_0x69dc('0x2a')]);}_0x2c7d7a[_0x69dc('0x62')]=qs[_0x69dc('0x46')](_0x44b1c9[_0x69dc('0x3e')][_0x69dc('0x46')]);_0x2c7d7a[_0x69dc('0x47')]=qs['filters'](_[_0x69dc('0x48')](_0x44b1c9['query'],_0x1aebd5[_0x69dc('0x3f')]));_0x2c7d7a[_0x69dc('0x47')][_0x69dc('0x5e')]=_0x396389['id'];if(_0x44b1c9['query'][_0x69dc('0x63')]){_0x2c7d7a['where']=_[_0x69dc('0x49')](_0x2c7d7a['where'],{'$or':_[_0x69dc('0x4a')](_0x2c7d7a[_0x69dc('0x42')],function(_0x52a9d9){var _0x26d9d8={};_0x26d9d8[_0x52a9d9]={'$like':'%'+_0x44b1c9['query'][_0x69dc('0x63')]+'%'};return _0x26d9d8;})});}_0x2c7d7a=_[_0x69dc('0x49')]({},_0x2c7d7a,_0x44b1c9[_0x69dc('0x4d')]);return db[_0x69dc('0x5f')][_0x69dc('0x29')]({'where':_0x2c7d7a['where']})[_0x69dc('0x1b')](function(_0x18a9ed){_0x5db24e[_0x69dc('0x29')]=_0x18a9ed;if(_0x44b1c9['query'][_0x69dc('0x4e')]){_0x2c7d7a['include']=[{'all':!![]}];}return db[_0x69dc('0x5f')]['findAll'](_0x2c7d7a);})[_0x69dc('0x1b')](function(_0x174c03){_0x5db24e[_0x69dc('0x51')]=_0x174c03;return _0x5db24e;});}})[_0x69dc('0x1b')](respondWithFilteredResult(_0x28cfa4,_0x2c7d7a))[_0x69dc('0x24')](handleError(_0x28cfa4,null));};exports[_0x69dc('0x64')]=function(_0x23232b,_0x56d36d,_0xdc9354){var _0x2f840c;return db[_0x69dc('0x3b')]['find']({'where':{'id':_0x23232b['params']['id']}})[_0x69dc('0x1b')](handleEntityNotFound(_0x56d36d,null))[_0x69dc('0x1b')](function(_0x1cd795){if(_0x1cd795){return _0x1cd795[_0x69dc('0x64')](_0x23232b[_0x69dc('0x3e')][_0x69dc('0x65')]);}})['then'](respondWithStatusCode(_0x56d36d,null))[_0x69dc('0x24')](handleError(_0x56d36d,null));};exports[_0x69dc('0x66')]=function(_0x41cc2d,_0xa26989,_0x586af2){if(_0x41cc2d[_0x69dc('0x55')]['id']){delete _0x41cc2d[_0x69dc('0x55')]['id'];}return db[_0x69dc('0x3b')][_0x69dc('0x53')]({'where':{'id':_0x41cc2d['params']['id']}})[_0x69dc('0x1b')](handleEntityNotFound(_0xa26989,null))[_0x69dc('0x1b')](function(_0x241909){if(_0x241909){_0x41cc2d['body']['FaxAccountId']=_0x241909['id'];return db[_0x69dc('0x67')][_0x69dc('0x54')](_0x41cc2d[_0x69dc('0x55')]);}})['then'](respondWithResult(_0xa26989,null))['catch'](handleError(_0xa26989,null));};exports[_0x69dc('0x68')]=function(_0x298f82,_0x29ff9e,_0x31e889){var _0x37fb64={'raw':![],'where':{}};var _0x43e3ce={};var _0x46d51f={'count':0x0,'rows':[]};return db[_0x69dc('0x3b')][_0x69dc('0x60')]({'where':{'id':_0x298f82['params']['id']}})[_0x69dc('0x1b')](handleEntityNotFound(_0x29ff9e,null))[_0x69dc('0x1b')](function(_0x22dd2c){if(_0x22dd2c){_0x43e3ce[_0x69dc('0x41')]=_[_0x69dc('0x3d')](db[_0x69dc('0x67')]['rawAttributes']);_0x43e3ce[_0x69dc('0x3e')]=_['keys'](_0x298f82['query']);_0x43e3ce[_0x69dc('0x3f')]=_[_0x69dc('0x40')](_0x43e3ce[_0x69dc('0x41')],_0x43e3ce[_0x69dc('0x3e')]);_0x37fb64['attributes']=_['intersection'](_0x43e3ce['model'],qs[_0x69dc('0x43')](_0x298f82['query'][_0x69dc('0x43')]));_0x37fb64['attributes']=_0x37fb64['attributes']['length']?_0x37fb64['attributes']:_0x43e3ce[_0x69dc('0x41')];if(!_0x298f82['query'][_0x69dc('0x44')](_0x69dc('0x45'))){_0x37fb64[_0x69dc('0x2b')]=qs[_0x69dc('0x2b')](_0x298f82[_0x69dc('0x3e')][_0x69dc('0x2b')]);_0x37fb64[_0x69dc('0x2a')]=qs['offset'](_0x298f82[_0x69dc('0x3e')][_0x69dc('0x2a')]);}_0x37fb64['order']=qs[_0x69dc('0x46')](_0x298f82[_0x69dc('0x3e')][_0x69dc('0x46')]);_0x37fb64[_0x69dc('0x47')]=qs[_0x69dc('0x3f')](_[_0x69dc('0x48')](_0x298f82['query'],_0x43e3ce[_0x69dc('0x3f')]));_0x37fb64[_0x69dc('0x47')][_0x69dc('0x5e')]=_0x22dd2c['id'];if(_0x298f82[_0x69dc('0x3e')][_0x69dc('0x63')]){_0x37fb64['where']=_[_0x69dc('0x49')](_0x37fb64[_0x69dc('0x47')],{'$or':_['map'](_0x37fb64[_0x69dc('0x42')],function(_0x4d905e){var _0xd48c9={};_0xd48c9[_0x4d905e]={'$like':'%'+_0x298f82['query'][_0x69dc('0x63')]+'%'};return _0xd48c9;})});}_0x37fb64=_[_0x69dc('0x49')]({},_0x37fb64,_0x298f82[_0x69dc('0x4d')]);return db['CannedAnswer'][_0x69dc('0x29')]({'where':_0x37fb64[_0x69dc('0x47')]})[_0x69dc('0x1b')](function(_0x98d19a){_0x46d51f[_0x69dc('0x29')]=_0x98d19a;if(_0x298f82[_0x69dc('0x3e')][_0x69dc('0x4e')]){_0x37fb64['include']=[{'all':!![]}];}return db[_0x69dc('0x67')][_0x69dc('0x50')](_0x37fb64);})[_0x69dc('0x1b')](function(_0x3581f8){_0x46d51f[_0x69dc('0x51')]=_0x3581f8;return _0x46d51f;});}})['then'](respondWithFilteredResult(_0x29ff9e,_0x37fb64))[_0x69dc('0x24')](handleError(_0x29ff9e,null));};exports[_0x69dc('0x69')]=function(_0x5ae400,_0x3c7686,_0x119d2b){var _0x2c0fb5;return db['FaxAccount'][_0x69dc('0x53')]({'where':{'id':_0x5ae400[_0x69dc('0x5b')]['id']}})[_0x69dc('0x1b')](handleEntityNotFound(_0x3c7686,null))[_0x69dc('0x1b')](function(_0x3aee2a){if(_0x3aee2a){return _0x3aee2a['removeAnswers'](_0x5ae400[_0x69dc('0x3e')][_0x69dc('0x65')]);}})[_0x69dc('0x1b')](respondWithStatusCode(_0x3c7686,null))[_0x69dc('0x24')](handleError(_0x3c7686,null));};exports[_0x69dc('0x6a')]=function(_0x1c7197,_0x41169a,_0x95f4fc){return db[_0x69dc('0x6b')][_0x69dc('0x53')]({'where':{'id':_0x1c7197[_0x69dc('0x5b')]['id']}})[_0x69dc('0x1b')](handleEntityNotFound(_0x41169a,null))['then'](function(_0x305315){if(_0x305315){return _0x305315[_0x69dc('0x6a')](_0x1c7197[_0x69dc('0x55')][_0x69dc('0x65')],_[_0x69dc('0x6c')](_0x1c7197[_0x69dc('0x55')],[_0x69dc('0x65'),'id'])||{});}})[_0x69dc('0x1b')](respondWithResult(_0x41169a,null))[_0x69dc('0x24')](handleError(_0x41169a,null));};exports[_0x69dc('0x6d')]=function(_0x470f60,_0x596e7e,_0xdbc953){var _0x4d9ce7={'raw':![],'where':{}};var _0x3d9963={};var _0x456842={'count':0x0,'rows':[]};return db[_0x69dc('0x3b')][_0x69dc('0x60')]({'where':{'id':_0x470f60[_0x69dc('0x5b')]['id']}})['then'](handleEntityNotFound(_0x596e7e,null))['then'](function(_0x58b632){if(_0x58b632){_0x3d9963[_0x69dc('0x41')]=_[_0x69dc('0x3d')](db[_0x69dc('0x6b')]['rawAttributes']);_0x3d9963[_0x69dc('0x3e')]=_[_0x69dc('0x3d')](_0x470f60['query']);_0x3d9963[_0x69dc('0x3f')]=_[_0x69dc('0x40')](_0x3d9963['model'],_0x3d9963['query']);_0x4d9ce7['attributes']=_['intersection'](_0x3d9963[_0x69dc('0x41')],qs[_0x69dc('0x43')](_0x470f60[_0x69dc('0x3e')]['fields']));_0x4d9ce7[_0x69dc('0x42')]=_0x4d9ce7[_0x69dc('0x42')]['length']?_0x4d9ce7[_0x69dc('0x42')]:_0x3d9963[_0x69dc('0x41')];if(!_0x470f60[_0x69dc('0x3e')][_0x69dc('0x44')](_0x69dc('0x45'))){_0x4d9ce7['limit']=qs[_0x69dc('0x2b')](_0x470f60[_0x69dc('0x3e')][_0x69dc('0x2b')]);_0x4d9ce7['offset']=qs[_0x69dc('0x2a')](_0x470f60[_0x69dc('0x3e')]['offset']);}_0x4d9ce7[_0x69dc('0x62')]=qs[_0x69dc('0x46')](_0x470f60[_0x69dc('0x3e')]['sort']);_0x4d9ce7['where']=qs[_0x69dc('0x3f')](_[_0x69dc('0x48')](_0x470f60['query'],_0x3d9963['filters']));_0x4d9ce7['where'][_0x69dc('0x5e')]=_0x58b632['id'];if(_0x470f60[_0x69dc('0x3e')][_0x69dc('0x63')]){_0x4d9ce7['where']=_[_0x69dc('0x49')](_0x4d9ce7[_0x69dc('0x47')],{'$or':_[_0x69dc('0x4a')](_0x4d9ce7[_0x69dc('0x42')],function(_0x4a4951){var _0x5643a5={};_0x5643a5[_0x4a4951]={'$like':'%'+_0x470f60[_0x69dc('0x3e')][_0x69dc('0x63')]+'%'};return _0x5643a5;})});}_0x4d9ce7=_['merge']({},_0x4d9ce7,_0x470f60[_0x69dc('0x4d')]);return db[_0x69dc('0x6b')][_0x69dc('0x29')]({'where':_0x4d9ce7['where']})['then'](function(_0xc531d5){_0x456842[_0x69dc('0x29')]=_0xc531d5;if(_0x470f60[_0x69dc('0x3e')]['includeAll']){_0x4d9ce7[_0x69dc('0x4f')]=[{'model':db[_0x69dc('0x6e')],'as':'Contact','required':![]},{'model':db[_0x69dc('0x6f')],'as':_0x69dc('0x70'),'attributes':[_0x69dc('0x36'),_0x69dc('0x71'),_0x69dc('0x72')],'required':![]},{'model':db[_0x69dc('0x73')],'as':'Tags','attributes':['id',_0x69dc('0x36'),_0x69dc('0x74')],'where':_0x470f60[_0x69dc('0x3e')]['tag']?{'id':_0x470f60[_0x69dc('0x3e')][_0x69dc('0x75')]}:undefined,'required':_0x470f60[_0x69dc('0x3e')][_0x69dc('0x75')]?!![]:![]}];}return db[_0x69dc('0x6b')]['findAll'](_0x4d9ce7);})[_0x69dc('0x1b')](function(_0x2eed04){_0x456842[_0x69dc('0x51')]=_0x2eed04;return _0x456842;});}})[_0x69dc('0x1b')](respondWithFilteredResult(_0x596e7e,_0x4d9ce7))['catch'](handleError(_0x596e7e,null));};exports['addApplications']=function(_0x32cb77,_0x3c71c1,_0x37eed8){return db[_0x69dc('0x3b')][_0x69dc('0x60')]({'where':{'id':_0x32cb77['params']['id']}})['then'](handleEntityNotFound(_0x3c71c1,null))['then'](function(_0x1b5fcb){if(_0x1b5fcb){return db[_0x69dc('0x76')][_0x69dc('0x77')](function(_0x364135){return db['FaxApplication'][_0x69dc('0x32')]({'where':{'FaxAccountId':_0x32cb77[_0x69dc('0x5b')]['id']},'transaction':_0x364135})[_0x69dc('0x1b')](function(_0x340b94){var _0x398dde=_[_0x69dc('0x4a')](_0x32cb77[_0x69dc('0x55')],function(_0x378781){_0x378781[_0x69dc('0x5e')]=_0x32cb77['params']['id'];return _0x378781;});return db['FaxApplication']['bulkCreate'](_0x398dde,{'transaction':_0x364135});});})[_0x69dc('0x1b')](function(){return db[_0x69dc('0x78')][_0x69dc('0x79')]({'where':{'FaxAccountId':_0x32cb77['params']['id']},'order':_0x69dc('0x7a')});});}})[_0x69dc('0x1b')](respondWithResult(_0x3c71c1,null))[_0x69dc('0x24')](handleError(_0x3c71c1,null));};exports[_0x69dc('0x7b')]=function(_0x57c614,_0x2ffd13,_0x4e329e){var _0x407814={};var _0x3df0ff={};var _0x513d33;var _0x1842b2;return db[_0x69dc('0x3b')][_0x69dc('0x60')]({'where':{'id':_0x57c614[_0x69dc('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2ffd13,null))[_0x69dc('0x1b')](function(_0x1b48d4){if(_0x1b48d4){_0x513d33=_0x1b48d4;_0x3df0ff[_0x69dc('0x41')]=_[_0x69dc('0x3d')](db[_0x69dc('0x78')][_0x69dc('0x3c')]);_0x3df0ff[_0x69dc('0x3e')]=_['keys'](_0x57c614['query']);_0x3df0ff[_0x69dc('0x3f')]=_[_0x69dc('0x40')](_0x3df0ff[_0x69dc('0x41')],_0x3df0ff['query']);_0x407814['attributes']=_[_0x69dc('0x40')](_0x3df0ff['model'],qs['fields'](_0x57c614['query'][_0x69dc('0x43')]));_0x407814[_0x69dc('0x42')]=_0x407814['attributes'][_0x69dc('0x61')]?_0x407814[_0x69dc('0x42')]:_0x3df0ff[_0x69dc('0x41')];_0x407814[_0x69dc('0x62')]=qs[_0x69dc('0x46')](_0x57c614[_0x69dc('0x3e')]['sort']);_0x407814[_0x69dc('0x47')]=qs[_0x69dc('0x3f')](_[_0x69dc('0x48')](_0x57c614['query'],_0x3df0ff['filters']));if(_0x57c614['query'][_0x69dc('0x63')]){_0x407814['where']=_[_0x69dc('0x49')](_0x407814['where'],{'$or':_[_0x69dc('0x4a')](_0x407814['attributes'],function(_0x22a304){var _0x4531fb={};_0x4531fb[_0x22a304]={'$like':'%'+_0x57c614[_0x69dc('0x3e')][_0x69dc('0x63')]+'%'};return _0x4531fb;})});}_0x407814=_[_0x69dc('0x49')]({},_0x407814,_0x57c614['options']);return _0x513d33[_0x69dc('0x7b')](_0x407814);}})[_0x69dc('0x1b')](function(_0x1cf298){if(_0x1cf298){_0x1842b2=_0x1cf298[_0x69dc('0x61')];if(!_0x57c614['query'][_0x69dc('0x44')]('nolimit')){_0x407814['limit']=qs[_0x69dc('0x2b')](_0x57c614[_0x69dc('0x3e')][_0x69dc('0x2b')]);_0x407814[_0x69dc('0x2a')]=qs[_0x69dc('0x2a')](_0x57c614[_0x69dc('0x3e')][_0x69dc('0x2a')]);}return _0x513d33[_0x69dc('0x7b')](_0x407814);}})['then'](function(_0x419128){if(_0x419128){return _0x419128?{'count':_0x1842b2,'rows':_0x419128}:null;}})[_0x69dc('0x1b')](respondWithResult(_0x2ffd13,null))['catch'](handleError(_0x2ffd13,null));};function Extension(_0x17df83,_0x3075cb,_0x4dc4cf,_0x4ce628){this[_0x69dc('0x7c')]=_0x69dc('0x7d');this[_0x69dc('0x7e')]=_0x17df83[_0x69dc('0x7f')];this[_0x69dc('0x80')]=_0x4ce628;this[_0x69dc('0x4b')]=_0x69dc('0x81');this[_0x69dc('0x82')]=_0x69dc('0x83');this[_0x69dc('0x5e')]=_0x17df83['id'];this[_0x69dc('0x7a')]=_0x3075cb;this['appdata']=_0x4dc4cf;}function createExtensionsReciveFax(_0x2c8571){var _0x43b0e2=0x1;var _0x604389=[];_0x604389[_0x69dc('0x84')](new Extension(_0x2c8571,_0x43b0e2,'',_0x69dc('0x85')));_0x43b0e2+=0x1;_0x604389[_0x69dc('0x84')](new Extension(_0x2c8571,_0x43b0e2,_0x69dc('0x86'),_0x69dc('0x87')));_0x43b0e2+=0x1;for(var _0x57d899 in _0x2c8571){if(_0x2c8571[_0x69dc('0x44')](_0x57d899)&&(_0x57d899===_0x69dc('0x88')||_0x57d899===_0x69dc('0x7f')||_0x57d899==='gateway'||_0x57d899===_0x69dc('0x89')||_0x57d899===_0x69dc('0x8a')||_0x57d899===_0x69dc('0x8b')||_0x57d899===_0x69dc('0x8c')||_0x57d899==='modem'||_0x57d899===_0x69dc('0x8d'))){_0x604389[_0x69dc('0x84')](new Extension(_0x2c8571,_0x43b0e2,'FAXOPT('+_0x57d899+')='+_0x2c8571[_0x57d899],_0x69dc('0x87')));_0x43b0e2+=0x1;}}_0x604389[_0x69dc('0x84')](new Extension(_0x2c8571,_0x43b0e2,'6','Wait'));_0x43b0e2+=0x1;_0x604389['push'](new Extension(_0x2c8571,_0x43b0e2,_0x69dc('0x8e'),'ReceiveFax'));_0x43b0e2=0x0;return _0x604389;}exports[_0x69dc('0x8f')]=function(_0x9e440b,_0x3d0ad1,_0x12a34c){var _0x3eea7c;return db[_0x69dc('0x76')][_0x69dc('0x77')](function(_0x1343a3){return db[_0x69dc('0x3b')][_0x69dc('0x54')](_0x9e440b[_0x69dc('0x55')],{'transaction':_0x1343a3})[_0x69dc('0x1b')](function(_0x3cbf7f){_0x3eea7c=_0x3cbf7f[_0x69dc('0x57')]({'plain':!![]});return db[_0x69dc('0x90')][_0x69dc('0x91')](createExtensionsReciveFax(_0x3eea7c),{'transaction':_0x1343a3});});})[_0x69dc('0x1b')](function(){return _0x3eea7c;})['then'](respondWithResult(_0x3d0ad1,null))[_0x69dc('0x24')](handleError(_0x3d0ad1,null));};exports[_0x69dc('0x92')]=function(_0x44877b,_0x38870f,_0x5ed42a){var _0x1c249b;return db['sequelize']['transaction'](function(_0x507752){return db[_0x69dc('0x3b')][_0x69dc('0x31')](_0x44877b[_0x69dc('0x55')],{'where':{'id':_0x44877b['body']['id']},'transaction':_0x507752})[_0x69dc('0x1b')](function(_0x58d243){return db['VoiceExtension'][_0x69dc('0x32')]({'where':{'FaxAccountId':_0x44877b['body']['id']},'transaction':_0x507752})['then'](function(_0x28bfbd){return db[_0x69dc('0x90')][_0x69dc('0x91')](createExtensionsReciveFax(_[_0x69dc('0x6c')](_0x44877b['body'],[_0x69dc('0x93'),_0x69dc('0x94'),_0x69dc('0x95'),'updatedAt',_0x69dc('0x96'),_0x69dc('0x97')])),{'transaction':_0x507752});});});})[_0x69dc('0x1b')](function(){return db[_0x69dc('0x3b')][_0x69dc('0x98')](_0x44877b[_0x69dc('0x55')]['id']);})[_0x69dc('0x1b')](respondWithResult(_0x38870f,null))['catch'](handleError(_0x38870f,null));};exports['getMessages']=function(_0x2f6ac1,_0x33bcce,_0x4ab6ac){var _0x14282d={'raw':!![],'where':{}};var _0x304bc0={};var _0x1c2de8={'count':0x0,'rows':[]};return db[_0x69dc('0x3b')][_0x69dc('0x60')]({'where':{'id':_0x2f6ac1['params']['id']}})[_0x69dc('0x1b')](handleEntityNotFound(_0x33bcce,null))['then'](function(_0x6301ed){if(_0x6301ed){_0x304bc0[_0x69dc('0x41')]=_[_0x69dc('0x3d')](db[_0x69dc('0x99')]['rawAttributes']);_0x304bc0[_0x69dc('0x3e')]=_[_0x69dc('0x3d')](_0x2f6ac1[_0x69dc('0x3e')]);_0x304bc0[_0x69dc('0x3f')]=_[_0x69dc('0x40')](_0x304bc0['model'],_0x304bc0[_0x69dc('0x3e')]);_0x14282d['attributes']=_[_0x69dc('0x40')](_0x304bc0['model'],qs[_0x69dc('0x43')](_0x2f6ac1[_0x69dc('0x3e')]['fields']));_0x14282d[_0x69dc('0x42')]=_0x14282d[_0x69dc('0x42')][_0x69dc('0x61')]?_0x14282d['attributes']:_0x304bc0[_0x69dc('0x41')];if(!_0x2f6ac1[_0x69dc('0x3e')]['hasOwnProperty'](_0x69dc('0x45'))){_0x14282d[_0x69dc('0x2b')]=qs[_0x69dc('0x2b')](_0x2f6ac1['query'][_0x69dc('0x2b')]);_0x14282d[_0x69dc('0x2a')]=qs[_0x69dc('0x2a')](_0x2f6ac1[_0x69dc('0x3e')][_0x69dc('0x2a')]);}_0x14282d[_0x69dc('0x62')]=qs[_0x69dc('0x46')](_0x2f6ac1[_0x69dc('0x3e')]['sort']);_0x14282d[_0x69dc('0x47')]=qs['filters'](_['pick'](_0x2f6ac1['query'],_0x304bc0['filters']));_0x14282d[_0x69dc('0x47')][_0x69dc('0x5e')]=_0x6301ed['id'];if(_0x2f6ac1[_0x69dc('0x3e')][_0x69dc('0x63')]){_0x14282d[_0x69dc('0x47')]=_[_0x69dc('0x49')](_0x14282d[_0x69dc('0x47')],{'$or':_[_0x69dc('0x4a')](_0x14282d['attributes'],function(_0x326961){var _0x1c7fb7={};_0x1c7fb7[_0x326961]={'$like':'%'+_0x2f6ac1[_0x69dc('0x3e')][_0x69dc('0x63')]+'%'};return _0x1c7fb7;})});}if(_0x2f6ac1[_0x69dc('0x3e')][_0x69dc('0x9a')]){var _0x426842=_0x2f6ac1[_0x69dc('0x3e')][_0x69dc('0x9a')][_0x69dc('0x9b')](',');var _0x5a7038={};_0x5a7038[_0x426842[0x0]]={'$gte':moment(_0x426842[0x1])[_0x69dc('0x9c')](_0x69dc('0x9d'))};_0x14282d[_0x69dc('0x47')]=_[_0x69dc('0x49')](_0x14282d[_0x69dc('0x47')],_0x5a7038);}_0x14282d=_[_0x69dc('0x49')]({},_0x14282d,_0x2f6ac1['options']);return db[_0x69dc('0x99')][_0x69dc('0x29')]({'where':_0x14282d[_0x69dc('0x47')]})[_0x69dc('0x1b')](function(_0x249f3a){_0x1c2de8[_0x69dc('0x29')]=_0x249f3a;if(_0x2f6ac1['query'][_0x69dc('0x4e')]){_0x14282d[_0x69dc('0x4f')]=[{'all':!![]}];}return db[_0x69dc('0x99')][_0x69dc('0x50')](_0x14282d);})[_0x69dc('0x1b')](function(_0x462269){_0x1c2de8[_0x69dc('0x51')]=_0x462269;return _0x1c2de8;});}})['then'](respondWithFilteredResult(_0x33bcce,_0x14282d))[_0x69dc('0x24')](handleError(_0x33bcce,null));};exports[_0x69dc('0x37')]=function(_0x23cef4,_0x55f635,_0x4c830f){var _0x1ea914,_0x7576b0={},_0x572ec5;if(_0x23cef4[_0x69dc('0x55')]['to']){_0x572ec5=_0x23cef4[_0x69dc('0x55')]['to'][0x0];}return db[_0x69dc('0x3b')][_0x69dc('0x53')]({'where':{'id':_0x23cef4[_0x69dc('0x5b')]['id']},'include':[{'model':db[_0x69dc('0x9e')],'as':_0x69dc('0x9f'),'include':[{'model':db['CmContact'],'as':_0x69dc('0xa0'),'where':{'fax':_0x572ec5},'limit':0x1,'order':[[_0x69dc('0xa1'),_0x69dc('0xa2')]]}]}]})[_0x69dc('0x1b')](handleEntityNotFound(_0x55f635,null))[_0x69dc('0x1b')](function(_0x2316d2){_0x1ea914=_0x2316d2;if(_0x23cef4['body']['attachments']&&_0x23cef4[_0x69dc('0x55')]['attachments'][_0x69dc('0x61')]){for(var _0x200fb7=0x0;_0x200fb7<_0x23cef4[_0x69dc('0x55')][_0x69dc('0xa3')][_0x69dc('0x61')];_0x200fb7+=0x1){_0x23cef4[_0x69dc('0x55')]['attachments'][_0x200fb7]={'filename':_0x23cef4[_0x69dc('0x55')][_0x69dc('0xa3')][_0x200fb7][_0x69dc('0x36')],'id':_0x23cef4[_0x69dc('0x55')][_0x69dc('0xa3')][_0x200fb7]['id'],'path':path[_0x69dc('0xa4')](config[_0x69dc('0xa5')],_0x69dc('0xa6'),_0x23cef4[_0x69dc('0x55')][_0x69dc('0xa3')][_0x200fb7][_0x69dc('0xa7')])};}}return respondWithRpcPromise(_0x69dc('0xa8'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x23cef4[_0x69dc('0x5b')]['id'])?undefined:_0x23cef4['params']['id'],'path':_['isNil'](_0x23cef4[_0x69dc('0x55')][_0x69dc('0xa3')][0x0][_0x69dc('0xa9')])?undefined:_0x23cef4[_0x69dc('0x55')][_0x69dc('0xa3')][0x0][_0x69dc('0xa9')],'fax':_[_0x69dc('0xaa')](_0x23cef4['body']['to'][0x0])?undefined:_0x23cef4[_0x69dc('0x55')]['to'][0x0]},client9002);})['then'](function(){if(_0x1ea914){if(_[_0x69dc('0xaa')](_0x23cef4[_0x69dc('0x55')][_0x69dc('0xab')])){_0x23cef4['body'][_0x69dc('0xab')]=util[_0x69dc('0x9c')]('\x22%s\x22\x20<%s>',_0x1ea914[_0x69dc('0x36')],_0x1ea914[_0x69dc('0xac')]);}if(_0x1ea914[_0x69dc('0x9f')]){if(_0x1ea914[_0x69dc('0x9f')]['Contacts'][_0x69dc('0x61')]){return _0x1ea914['List'][_0x69dc('0xa0')][0x0];}else{return db[_0x69dc('0x6e')][_0x69dc('0x54')](_[_0x69dc('0x13')](_0x23cef4[_0x69dc('0x55')],{'firstName':_0x23cef4[_0x69dc('0x55')]['to'][0x0],'phone':_0x23cef4[_0x69dc('0x55')]['to'][0x0],'fax':_0x23cef4[_0x69dc('0x55')]['to'][0x0],'ListId':_0x1ea914[_0x69dc('0x97')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x69dc('0xad'));}})[_0x69dc('0x1b')](function(_0x1bb277){if(_0x1bb277){return db[_0x69dc('0x6b')]['find']({'where':{'ContactId':_0x1bb277['id'],'closed':![],'FaxAccountId':_0x1ea914['id']}})[_0x69dc('0x1b')](function(_0x3f9063){if(_0x3f9063){return[_0x3f9063,![]];}return db['FaxInteraction']['create']({'UserId':_0x23cef4[_0x69dc('0x56')]['id'],'ContactId':_0x1bb277['id'],'FaxAccountId':_0x1ea914['id'],'fax':_0x23cef4['body']['to'][0x0],'firstMsgDirection':_0x69dc('0xae'),'Messages':[_[_0x69dc('0x49')](_0x23cef4['body'],{'read':![],'body':_0x23cef4[_0x69dc('0x55')]['attachments'][0x0][_0x69dc('0xaf')],'FaxAccountId':_0x1ea914['id'],'UserId':_0x23cef4[_0x69dc('0x56')]['id'],'ContactId':_0x1bb277['id'],'AttachmentId':_0x23cef4[_0x69dc('0x55')][_0x69dc('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0x69dc('0x99')],'as':_0x69dc('0xb0')}]})[_0x69dc('0x1b')](function(_0x2eb985){return[_0x2eb985,!![]];});});}else{throw new Error(_0x69dc('0xb1'));}})[_0x69dc('0xb2')](function(_0x129ed5,_0x14376b){if(_0x14376b){return _0x129ed5;}return db[_0x69dc('0x99')][_0x69dc('0x54')]({'direction':_0x69dc('0xae'),'read':![],'body':_0x23cef4[_0x69dc('0x55')][_0x69dc('0xa3')][0x0][_0x69dc('0xaf')],'FaxAccountId':_0x1ea914['id'],'FaxInteractionId':_0x129ed5['id'],'UserId':_0x23cef4[_0x69dc('0x56')]['id'],'ContactId':_0x129ed5['ContactId'],'AttachmentId':_0x23cef4['body'][_0x69dc('0xa3')][0x0]['id']})[_0x69dc('0x1b')](function(_0x48df3f){_0x129ed5[_0x69dc('0xb3')][_0x69dc('0xb0')]=[];_0x129ed5[_0x69dc('0xb3')][_0x69dc('0xb0')][_0x69dc('0x84')](_0x48df3f['dataValues']);return _0x129ed5;});})['then'](function(_0x481256){respondWithRpcPromise(_0x69dc('0xb4'),_0x69dc('0xb4'),{'FaxAccountId':_[_0x69dc('0xaa')](_0x23cef4[_0x69dc('0x5b')]['id'])?undefined:_0x23cef4[_0x69dc('0x5b')]['id'],'path':_[_0x69dc('0xaa')](_0x23cef4['body'][_0x69dc('0xa3')][0x0][_0x69dc('0xa9')])?undefined:_0x23cef4[_0x69dc('0x55')][_0x69dc('0xa3')][0x0][_0x69dc('0xa9')],'fax':_['isNil'](_0x23cef4['body']['to'][0x0])?undefined:_0x23cef4[_0x69dc('0x55')]['to'][0x0],'AttachmentId':_0x23cef4[_0x69dc('0x55')][_0x69dc('0xa3')][0x0]['id']},client9002)['then'](function(_0x47994f){logger['info'](_0x69dc('0xb5'),_0x47994f);})[_0x69dc('0x24')](function(_0x4ef4c6){logger['info'](_0x69dc('0xb5'),_0x4ef4c6);});return _0x481256;})[_0x69dc('0x1b')](respondWithResult(_0x55f635,null))[_0x69dc('0x24')](handleError(_0x55f635,null));};exports[_0x69dc('0xb6')]=function(_0x4c4cef,_0x4a6990,_0x935118){return db[_0x69dc('0x3b')][_0x69dc('0x53')]({'where':{'id':_0x4c4cef[_0x69dc('0x5b')]['id']}})[_0x69dc('0x1b')](handleEntityNotFound(_0x4a6990,null))[_0x69dc('0x1b')](function(_0x1ed2ba){if(_0x1ed2ba){return _0x1ed2ba[_0x69dc('0xb6')](_0x4c4cef[_0x69dc('0x55')]['ids'],_[_0x69dc('0x6c')](_0x4c4cef['body'],[_0x69dc('0x65'),'id'])||{})['spread'](function(_0x488777){for(var _0x2f7223=0x0;_0x2f7223<_0x4c4cef[_0x69dc('0x55')][_0x69dc('0x65')][_0x69dc('0x61')];_0x2f7223+=0x1){socket[_0x69dc('0xb7')](_0x69dc('0xb8'),{'UserId':_0x4c4cef[_0x69dc('0x55')][_0x69dc('0x65')][_0x2f7223],'FaxAccountId':_0x4c4cef[_0x69dc('0x5b')]['id']});}return _0x488777;});}})[_0x69dc('0x1b')](respondWithResult(_0x4a6990,null))[_0x69dc('0x24')](handleError(_0x4a6990,null));};exports[_0x69dc('0xb9')]=function(_0xf6b0d,_0x3f64e7,_0x16a4d5){var _0x3eb60;return db['FaxAccount'][_0x69dc('0x53')]({'where':{'id':_0xf6b0d[_0x69dc('0x5b')]['id']}})[_0x69dc('0x1b')](handleEntityNotFound(_0x3f64e7,null))['then'](function(_0x3b5277){if(_0x3b5277){return _0x3b5277[_0x69dc('0xb9')](_0xf6b0d[_0x69dc('0x3e')]['ids'])[_0x69dc('0x1b')](function(_0x736442){if(_[_0x69dc('0xba')](_0xf6b0d[_0x69dc('0x3e')][_0x69dc('0x65')])){for(var _0x359ef2=0x0;_0x359ef2<_0xf6b0d['query'][_0x69dc('0x65')][_0x69dc('0x61')];_0x359ef2+=0x1){socket[_0x69dc('0xb7')]('userFaxAccount:remove',{'UserId':_0xf6b0d[_0x69dc('0x3e')]['ids'][_0x359ef2],'FaxAccountId':_0xf6b0d['params']['id']});}}else{socket[_0x69dc('0xb7')](_0x69dc('0xbb'),{'UserId':_0xf6b0d[_0x69dc('0x3e')][_0x69dc('0x65')],'FaxAccountId':_0xf6b0d['params']['id']});}});}})['then'](respondWithStatusCode(_0x3f64e7,null))[_0x69dc('0x24')](handleError(_0x3f64e7,null));};exports[_0x69dc('0xbc')]=function(_0x494ecd,_0x4f55ac,_0x50e866){var _0x51630a={};var _0x54bcb4={};var _0x755345;var _0xb5551a;return db[_0x69dc('0x3b')][_0x69dc('0x60')]({'where':{'id':_0x494ecd[_0x69dc('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4f55ac,null))[_0x69dc('0x1b')](function(_0x5adec2){if(_0x5adec2){_0x755345=_0x5adec2;_0x54bcb4['model']=_[_0x69dc('0x3d')](db['User']['rawAttributes']);_0x54bcb4[_0x69dc('0x3e')]=_[_0x69dc('0x3d')](_0x494ecd[_0x69dc('0x3e')]);_0x54bcb4[_0x69dc('0x3f')]=_[_0x69dc('0x40')](_0x54bcb4[_0x69dc('0x41')],_0x54bcb4[_0x69dc('0x3e')]);_0x51630a[_0x69dc('0x42')]=_[_0x69dc('0x40')](_0x54bcb4[_0x69dc('0x41')],qs['fields'](_0x494ecd[_0x69dc('0x3e')][_0x69dc('0x43')]));_0x51630a['attributes']=_0x51630a[_0x69dc('0x42')][_0x69dc('0x61')]?_0x51630a[_0x69dc('0x42')]:_0x54bcb4['model'];_0x51630a['order']=qs[_0x69dc('0x46')](_0x494ecd[_0x69dc('0x3e')][_0x69dc('0x46')]);_0x51630a['where']=qs[_0x69dc('0x3f')](_['pick'](_0x494ecd[_0x69dc('0x3e')],_0x54bcb4[_0x69dc('0x3f')]));if(_0x494ecd[_0x69dc('0x3e')][_0x69dc('0x63')]){_0x51630a[_0x69dc('0x47')]=_[_0x69dc('0x49')](_0x51630a[_0x69dc('0x47')],{'$or':_[_0x69dc('0x4a')](_0x51630a[_0x69dc('0x42')],function(_0x40c77b){var _0x6da310={};_0x6da310[_0x40c77b]={'$like':'%'+_0x494ecd[_0x69dc('0x3e')]['filter']+'%'};return _0x6da310;})});}_0x51630a=_['merge']({},_0x51630a,_0x494ecd[_0x69dc('0x4d')]);return _0x755345[_0x69dc('0xbc')](_0x51630a);}})[_0x69dc('0x1b')](function(_0x18af89){if(_0x18af89){_0xb5551a=_0x18af89['length'];if(!_0x494ecd[_0x69dc('0x3e')][_0x69dc('0x44')](_0x69dc('0x45'))){_0x51630a['limit']=qs[_0x69dc('0x2b')](_0x494ecd['query']['limit']);_0x51630a[_0x69dc('0x2a')]=qs[_0x69dc('0x2a')](_0x494ecd[_0x69dc('0x3e')][_0x69dc('0x2a')]);}return _0x755345[_0x69dc('0xbc')](_0x51630a);}})[_0x69dc('0x1b')](function(_0xecf5c0){if(_0xecf5c0){return _0xecf5c0?{'count':_0xb5551a,'rows':_0xecf5c0}:null;}})['then'](respondWithResult(_0x4f55ac,null))[_0x69dc('0x24')](handleError(_0x4f55ac,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index cdafba6..8733edf 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 _0x2f80=['emit','hasOwnProperty','hook','exports','events','FaxAccount','setMaxListeners','update'];(function(_0xdd3f04,_0x3e758d){var _0x538cbe=function(_0x25841d){while(--_0x25841d){_0xdd3f04['push'](_0xdd3f04['shift']());}};_0x538cbe(++_0x3e758d);}(_0x2f80,0x1c4));var _0x02f8=function(_0x412b6e,_0x4245c8){_0x412b6e=_0x412b6e-0x0;var _0xd9b9d5=_0x2f80[_0x412b6e];return _0xd9b9d5;};'use strict';var EventEmitter=require(_0x02f8('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x02f8('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x02f8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x02f8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x10c423){return function(_0x235a41,_0x3e11df,_0x1d1c97){FaxAccountEvents[_0x02f8('0x4')](_0x10c423+':'+_0x235a41['id'],_0x235a41);FaxAccountEvents[_0x02f8('0x4')](_0x10c423,_0x235a41);_0x1d1c97(null);};}for(var e in events){if(events[_0x02f8('0x5')](e)){var event=events[e];FaxAccount[_0x02f8('0x6')](e,emitEvent(event));}}module[_0x02f8('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0xa222=['save','update','remove','emit','hasOwnProperty','exports','events','FaxAccount','setMaxListeners'];(function(_0x272d90,_0x5e70ff){var _0x2bf4a2=function(_0x544da6){while(--_0x544da6){_0x272d90['push'](_0x272d90['shift']());}};_0x2bf4a2(++_0x5e70ff);}(_0xa222,0xde));var _0x2a22=function(_0x3a0863,_0x4cd5ef){_0x3a0863=_0x3a0863-0x0;var _0x85c557=_0xa222[_0x3a0863];return _0x85c557;};'use strict';var EventEmitter=require(_0x2a22('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x2a22('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x2a22('0x2')](0x0);var events={'afterCreate':_0x2a22('0x3'),'afterUpdate':_0x2a22('0x4'),'afterDestroy':_0x2a22('0x5')};function emitEvent(_0x269053){return function(_0x5e16b7,_0x143a0e,_0x29e35b){FaxAccountEvents[_0x2a22('0x6')](_0x269053+':'+_0x5e16b7['id'],_0x5e16b7);FaxAccountEvents[_0x2a22('0x6')](_0x269053,_0x5e16b7);_0x29e35b(null);};}for(var e in events){if(events[_0x2a22('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x2a22('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index ff85b3b..7915c25 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 _0x39bb=['api','bluebird','request-promise','./faxAccount.attributes','define','FaxAccount','lodash','../../config/logger'];(function(_0x4744d3,_0x475428){var _0x1a492d=function(_0x5c5bc9){while(--_0x5c5bc9){_0x4744d3['push'](_0x4744d3['shift']());}};_0x1a492d(++_0x475428);}(_0x39bb,0x1a6));var _0xb39b=function(_0x289a67,_0x1e5a3c){_0x289a67=_0x289a67-0x0;var _0x572b49=_0x39bb[_0x289a67];return _0x572b49;};'use strict';var _=require(_0xb39b('0x0'));var util=require('util');var logger=require(_0xb39b('0x1'))(_0xb39b('0x2'));var moment=require('moment');var BPromise=require(_0xb39b('0x3'));var rp=require(_0xb39b('0x4'));var attributes=require(_0xb39b('0x5'));module['exports']=function(_0x1c6e64,_0x545d5d){return _0x1c6e64[_0xb39b('0x6')](_0xb39b('0x7'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0762=['../../config/logger','api','moment','request-promise','./faxAccount.attributes','define','FaxAccount','fax_accounts','util'];(function(_0x302961,_0x4bb394){var _0x2b0704=function(_0x48ddf2){while(--_0x48ddf2){_0x302961['push'](_0x302961['shift']());}};_0x2b0704(++_0x4bb394);}(_0x0762,0x1e5));var _0x2076=function(_0x228b46,_0x6268b6){_0x228b46=_0x228b46-0x0;var _0x472296=_0x0762[_0x228b46];return _0x472296;};'use strict';var _=require('lodash');var util=require(_0x2076('0x0'));var logger=require(_0x2076('0x1'))(_0x2076('0x2'));var moment=require(_0x2076('0x3'));var BPromise=require('bluebird');var rp=require(_0x2076('0x4'));var attributes=require(_0x2076('0x5'));module['exports']=function(_0x4dc543,_0x734461){return _0x4dc543[_0x2076('0x6')](_0x2076('0x7'),attributes,{'tableName':_0x2076('0x8'),'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 f09c1b0..6899bca 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 _0x7cf6=['length','defaults','create','contact','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount','findAll','options','where','attributes','limit','map','include','model','GetFaxAccount','debug','catch','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','difference','keys','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','Applications','get','applications','list','orderBy','priority','asc'];(function(_0x5e14e6,_0x42f560){var _0x46498e=function(_0x52e4a5){while(--_0x52e4a5){_0x5e14e6['push'](_0x5e14e6['shift']());}};_0x46498e(++_0x42f560);}(_0x7cf6,0x125));var _0x67cf=function(_0x45b0c4,_0x2aa848){_0x45b0c4=_0x45b0c4-0x0;var _0x13c380=_0x7cf6[_0x45b0c4];return _0x13c380;};'use strict';var _=require(_0x67cf('0x0'));var util=require('util');var moment=require(_0x67cf('0x1'));var BPromise=require(_0x67cf('0x2'));var rs=require(_0x67cf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67cf('0x4'))['db'];var utils=require(_0x67cf('0x5'));var logger=require(_0x67cf('0x6'))(_0x67cf('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x67cf('0x8')]({'port':0x232c});config[_0x67cf('0x9')]=_['defaults'](config[_0x67cf('0x9')],{'host':_0x67cf('0xa'),'port':0x18eb});var socket=require(_0x67cf('0xb'))(new Redis(config['redis']));require(_0x67cf('0xc'))['register'](socket);function respondWithRpcPromise(_0x7c39f1,_0x3e2c92,_0x124746){return new BPromise(function(_0x25db2,_0x885cf9){return client[_0x67cf('0xd')](_0x7c39f1,_0x124746)[_0x67cf('0xe')](function(_0x458a4f){logger[_0x67cf('0xf')](_0x67cf('0x10'),_0x3e2c92,_0x67cf('0x11'));logger['debug'](_0x67cf('0x12'),_0x3e2c92,_0x67cf('0x11'),JSON[_0x67cf('0x13')](_0x458a4f));if(_0x458a4f[_0x67cf('0x14')]){if(_0x458a4f[_0x67cf('0x14')][_0x67cf('0x15')]===0x1f4){logger[_0x67cf('0x14')](_0x67cf('0x10'),_0x3e2c92,_0x458a4f[_0x67cf('0x14')][_0x67cf('0x16')]);return _0x885cf9(_0x458a4f[_0x67cf('0x14')]['message']);}logger['error'](_0x67cf('0x10'),_0x3e2c92,_0x458a4f['error']['message']);return _0x25db2(_0x458a4f[_0x67cf('0x14')][_0x67cf('0x16')]);}else{logger[_0x67cf('0xf')](_0x67cf('0x10'),_0x3e2c92,_0x67cf('0x11'));_0x25db2(_0x458a4f['result'][_0x67cf('0x16')]);}})['catch'](function(_0x30e7d2){logger[_0x67cf('0x14')]('FaxAccount,\x20%s,\x20%s',_0x3e2c92,_0x30e7d2);_0x885cf9(_0x30e7d2);});});}exports['GetFaxAccount']=function(_0x3d92d4){var _0x4981e8=this;return new Promise(function(_0xd18858,_0x4a9c04){return db[_0x67cf('0x17')][_0x67cf('0x18')]({'raw':_0x3d92d4[_0x67cf('0x19')]?_0x3d92d4[_0x67cf('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3d92d4[_0x67cf('0x19')]?_0x3d92d4[_0x67cf('0x19')][_0x67cf('0x1a')]||null:null,'attributes':_0x3d92d4[_0x67cf('0x19')]?_0x3d92d4[_0x67cf('0x19')][_0x67cf('0x1b')]||null:null,'limit':_0x3d92d4[_0x67cf('0x19')]?_0x3d92d4[_0x67cf('0x19')][_0x67cf('0x1c')]||null:null,'include':_0x3d92d4['options']?_0x3d92d4[_0x67cf('0x19')]['include']?_[_0x67cf('0x1d')](_0x3d92d4[_0x67cf('0x19')][_0x67cf('0x1e')],function(_0xe2d283){return{'model':db[_0xe2d283[_0x67cf('0x1f')]],'as':_0xe2d283['as'],'attributes':_0xe2d283['attributes'],'include':_0xe2d283[_0x67cf('0x1e')]?_['map'](_0xe2d283[_0x67cf('0x1e')],function(_0x19684f){return{'model':db[_0x19684f[_0x67cf('0x1f')]],'as':_0x19684f['as'],'attributes':_0x19684f['attributes'],'include':_0x19684f[_0x67cf('0x1e')]?_[_0x67cf('0x1d')](_0x19684f[_0x67cf('0x1e')],function(_0x31353b){return{'model':db[_0x31353b[_0x67cf('0x1f')]],'as':_0x31353b['as'],'attributes':_0x31353b['attributes']};}):[]};}):[]};}):[]:[]})[_0x67cf('0xe')](function(_0x2d3308){logger[_0x67cf('0xf')](_0x67cf('0x20'),_0x3d92d4);logger[_0x67cf('0x21')](_0x67cf('0x20'),_0x3d92d4,JSON[_0x67cf('0x13')](_0x2d3308));_0xd18858(_0x2d3308);})[_0x67cf('0x22')](function(_0x188d94){logger[_0x67cf('0x14')](_0x67cf('0x20'),_0x188d94[_0x67cf('0x16')],_0x3d92d4);_0x4a9c04(_0x4981e8[_0x67cf('0x14')](0x1f4,_0x188d94['message']));});});};exports[_0x67cf('0x23')]=function(_0x30d6de,_0x7d28f7,_0xf7dd9f){var _0x3a1c0d=this;return new Promise(function(_0x507693,_0x4d5f6c){var _0x23b42b={'body':_0x30d6de[_0x67cf('0x24')],'channel':_0x67cf('0x25')};var _0x516067=[];var _0x44d689=[];var _0x4cb470={};return db[_0x67cf('0x26')]['describe']()[_0x67cf('0xe')](function(_0x46b8c9){if(!_0x46b8c9){throw new db[(_0x67cf('0x27'))][(_0x67cf('0x28'))]('no\x20available\x20attributes');}_0x516067=_[_0x67cf('0x29')](_[_0x67cf('0x2a')](_0x46b8c9),['createdAt',_0x67cf('0x2b')]);_0x44d689=_[_0x67cf('0x29')](_['keys'](_0x46b8c9),[_0x67cf('0x2c'),'updatedAt',_0x67cf('0x2d'),_0x67cf('0x2e')]);if(_0x30d6de[_0x67cf('0x24')]['id']){delete _0x30d6de[_0x67cf('0x24')]['id'];}if(_['isNil'](_0x30d6de[_0x67cf('0x24')][_0x67cf('0x2f')])){throw new db[(_0x67cf('0x27'))][(_0x67cf('0x28'))](_0x67cf('0x30'));}if(_[_0x67cf('0x31')](_0x30d6de[_0x67cf('0x24')]['body'])||_0x30d6de['body'][_0x67cf('0x24')]===''){throw new db['Sequelize'][(_0x67cf('0x28'))](_0x67cf('0x32'));}if(_['isNil'](_0x30d6de['body']['mapKey'])){throw new db['Sequelize'][(_0x67cf('0x28'))](_0x67cf('0x33')+_0x44d689);}if(!_[_0x67cf('0x34')](_0x44d689,_0x30d6de[_0x67cf('0x24')][_0x67cf('0x35')])){throw new db['Sequelize']['ValidationError'](_0x67cf('0x36')+_0x44d689);}_0x4cb470[_0x30d6de[_0x67cf('0x24')][_0x67cf('0x35')]]=_0x30d6de[_0x67cf('0x24')][_0x67cf('0x2f')];})[_0x67cf('0xe')](function(){return db[_0x67cf('0x17')][_0x67cf('0x37')]({'where':{'id':_0x30d6de[_0x67cf('0x38')]['id']},'include':[{'model':db[_0x67cf('0x39')],'as':_0x67cf('0x3a'),'include':[{'model':db[_0x67cf('0x26')],'as':_0x67cf('0x3b'),'where':_0x4cb470,'limit':0x1,'order':[[_0x67cf('0x2b'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0x67cf('0x3c')}]});})[_0x67cf('0xe')](function(_0x4cbb85){if(_0x4cbb85&&_0x4cbb85[_0x67cf('0x3a')]){var _0x6ca08f=_0x4cbb85[_0x67cf('0x3d')]({'plain':!![]});_0x23b42b[_0x67cf('0x38')]=_0x6ca08f;_0x23b42b[_0x67cf('0x3e')]=_0x6ca08f['Applications'];_0x23b42b[_0x67cf('0x3f')]=_0x6ca08f[_0x67cf('0x3a')];_0x23b42b[_0x67cf('0x3e')]=_[_0x67cf('0x40')](_0x23b42b[_0x67cf('0x3e')],[_0x67cf('0x41')],[_0x67cf('0x42')]);if(_0x23b42b['account'][_0x67cf('0x3c')]){delete _0x23b42b[_0x67cf('0x38')][_0x67cf('0x3c')];}if(_0x23b42b[_0x67cf('0x38')][_0x67cf('0x3a')]&&_0x23b42b[_0x67cf('0x38')]['List'][_0x67cf('0x3b')][_0x67cf('0x43')]){return _0x23b42b[_0x67cf('0x38')]['List'][_0x67cf('0x3b')][0x0];}var _0x22866d=_[_0x67cf('0x44')](_0x30d6de[_0x67cf('0x24')],{'firstName':_0x30d6de['body'][_0x67cf('0x2f')],'ListId':_0x6ca08f['ListId']});_0x22866d[_0x30d6de[_0x67cf('0x24')]['mapKey']]=_0x30d6de[_0x67cf('0x24')][_0x67cf('0x2f')];return db[_0x67cf('0x26')][_0x67cf('0x45')](_0x22866d,{'fields':_0x516067,'raw':!![]});}})[_0x67cf('0xe')](function(_0x317143){_0x23b42b[_0x67cf('0x46')]=_0x317143;if(_0x317143){var _0x16e74b={'ContactId':_0x317143['id'],'FaxAccountId':_0x30d6de['account']['id'],'fax':_0x317143['fax']};return db['FaxInteraction'][_0x67cf('0x37')]({'where':{'ContactId':_0x317143['id'],'closed':![],'FaxAccountId':_0x30d6de[_0x67cf('0x38')]['id']}})[_0x67cf('0xe')](function(_0x2b4444){if(_0x2b4444){return[_0x2b4444,![]];}return db['FaxInteraction']['create'](_0x16e74b)[_0x67cf('0xe')](function(_0x114acb){return[_0x114acb,!![]];});});}else{throw new Error(_0x67cf('0x47'));}})[_0x67cf('0x48')](function(_0x4dd37b,_0x3f08c8){var _0x5603e2=_0x4dd37b[_0x67cf('0x3d')]({'plain':!![]});if(_0x3f08c8){if(_0x23b42b['account'][_0x67cf('0x49')]){_0x23b42b[_0x67cf('0x3e')][_0x67cf('0x4a')]({'id':0x0,'priority':_0x23b42b['applications'][_0x67cf('0x43')]+0x1,'app':_0x67cf('0x4b'),'appdata':_0x67cf('0x4c'),'interval':_0x67cf('0x4d')});}_0x5603e2['created']=!![];}else{_0x5603e2[_0x67cf('0x4e')]=![];}_0x23b42b[_0x67cf('0x4f')]=_0x5603e2;return db[_0x67cf('0x50')]['create']({'body':_0x30d6de[_0x67cf('0x24')][_0x67cf('0x24')],'FaxAccountId':_0x30d6de[_0x67cf('0x38')]['id'],'FaxInteractionId':_0x4dd37b['id'],'direction':'in','ContactId':_0x4dd37b[_0x67cf('0x51')],'AttachmentId':_0x30d6de['body'][_0x67cf('0x52')]});})[_0x67cf('0xe')](function(_0x5c7523){_0x23b42b[_0x67cf('0x16')]=_0x5c7523;if(_0x23b42b['interaction'][_0x67cf('0x53')]){return db[_0x67cf('0x54')]['find']({'attributes':['id',_0x67cf('0x55')],'where':{'id':_0x23b42b[_0x67cf('0x4f')][_0x67cf('0x53')]}})[_0x67cf('0xe')](function(_0x1298ff){if(_0x1298ff){_0x23b42b[_0x67cf('0x3e')][_0x67cf('0x56')]({'id':0x0,'priority':0x0,'app':_0x67cf('0x57'),'appdata':_0x1298ff[_0x67cf('0x55')]+','+(_0x23b42b['account']['waitForTheAssignedAgent']||0xa),'interval':_0x67cf('0x4d')});}return respondWithRpcPromise(_0x67cf('0x58'),_0x67cf('0x59'),_0x23b42b);});}return respondWithRpcPromise(_0x67cf('0x58'),'startRouting',_0x23b42b);})[_0x67cf('0xe')](function(_0x1292c8){_0x507693(_0x1292c8);})[_0x67cf('0x22')](function(_0x33893f){_0x4d5f6c(_0x3a1c0d[_0x67cf('0x14')](0x1f4,_0x33893f[_0x67cf('0x16')]));});});}; \ No newline at end of file +var _0xd38d=['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','CmContact','Contacts','DESC','FaxApplication','Applications','List','applications','orderBy','asc','create','spread','get','autoclose','push','length','close','unmanaged','created','interaction','FaxMessage','ContactId','UserId','name','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','FaxAccount,\x20%s,\x20%s','message','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','map','model','catch','body','fax','describe','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','keys','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','isNil'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0xd38d,0x1cb));var _0xdd38=function(_0x2d3d0d,_0x67ac82){_0x2d3d0d=_0x2d3d0d-0x0;var _0xca35b6=_0xd38d[_0x2d3d0d];return _0xca35b6;};'use strict';var _=require(_0xdd38('0x0'));var util=require(_0xdd38('0x1'));var moment=require(_0xdd38('0x2'));var BPromise=require(_0xdd38('0x3'));var rs=require(_0xdd38('0x4'));var fs=require('fs');var Redis=require(_0xdd38('0x5'));var db=require(_0xdd38('0x6'))['db'];var utils=require(_0xdd38('0x7'));var logger=require(_0xdd38('0x8'))('rpc');var config=require(_0xdd38('0x9'));var jayson=require(_0xdd38('0xa'));var client=jayson[_0xdd38('0xb')][_0xdd38('0xc')]({'port':0x232c});config[_0xdd38('0xd')]=_['defaults'](config['redis'],{'host':_0xdd38('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdd38('0xd')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x162237,_0x59c563,_0xb08f67){return new BPromise(function(_0x11c9f5,_0x7d435c){return client[_0xdd38('0xf')](_0x162237,_0xb08f67)[_0xdd38('0x10')](function(_0x5759aa){logger[_0xdd38('0x11')]('FaxAccount,\x20%s,\x20%s',_0x59c563,_0xdd38('0x12'));logger[_0xdd38('0x13')](_0xdd38('0x14'),_0x59c563,'request\x20sent',JSON[_0xdd38('0x15')](_0x5759aa));if(_0x5759aa[_0xdd38('0x16')]){if(_0x5759aa[_0xdd38('0x16')]['code']===0x1f4){logger['error'](_0xdd38('0x17'),_0x59c563,_0x5759aa[_0xdd38('0x16')][_0xdd38('0x18')]);return _0x7d435c(_0x5759aa[_0xdd38('0x16')][_0xdd38('0x18')]);}logger[_0xdd38('0x16')](_0xdd38('0x17'),_0x59c563,_0x5759aa[_0xdd38('0x16')][_0xdd38('0x18')]);return _0x11c9f5(_0x5759aa[_0xdd38('0x16')][_0xdd38('0x18')]);}else{logger[_0xdd38('0x11')](_0xdd38('0x17'),_0x59c563,'request\x20sent');_0x11c9f5(_0x5759aa['result'][_0xdd38('0x18')]);}})['catch'](function(_0x146e55){logger[_0xdd38('0x16')](_0xdd38('0x17'),_0x59c563,_0x146e55);_0x7d435c(_0x146e55);});});}exports[_0xdd38('0x19')]=function(_0x59c17f){var _0x196c00=this;return new Promise(function(_0x3c8adb,_0x5aca5e){return db[_0xdd38('0x1a')][_0xdd38('0x1b')]({'raw':_0x59c17f[_0xdd38('0x1c')]?_0x59c17f[_0xdd38('0x1c')][_0xdd38('0x1d')]===undefined?!![]:![]:!![],'where':_0x59c17f['options']?_0x59c17f[_0xdd38('0x1c')][_0xdd38('0x1e')]||null:null,'attributes':_0x59c17f[_0xdd38('0x1c')]?_0x59c17f['options'][_0xdd38('0x1f')]||null:null,'limit':_0x59c17f[_0xdd38('0x1c')]?_0x59c17f[_0xdd38('0x1c')]['limit']||null:null,'include':_0x59c17f[_0xdd38('0x1c')]?_0x59c17f[_0xdd38('0x1c')][_0xdd38('0x20')]?_[_0xdd38('0x21')](_0x59c17f[_0xdd38('0x1c')]['include'],function(_0x2c72b6){return{'model':db[_0x2c72b6[_0xdd38('0x22')]],'as':_0x2c72b6['as'],'attributes':_0x2c72b6[_0xdd38('0x1f')],'include':_0x2c72b6[_0xdd38('0x20')]?_[_0xdd38('0x21')](_0x2c72b6['include'],function(_0x1c564c){return{'model':db[_0x1c564c['model']],'as':_0x1c564c['as'],'attributes':_0x1c564c[_0xdd38('0x1f')],'include':_0x1c564c[_0xdd38('0x20')]?_['map'](_0x1c564c[_0xdd38('0x20')],function(_0x1d7fb6){return{'model':db[_0x1d7fb6[_0xdd38('0x22')]],'as':_0x1d7fb6['as'],'attributes':_0x1d7fb6['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd38('0x10')](function(_0x1a4a33){logger['info'](_0xdd38('0x19'),_0x59c17f);logger['debug']('GetFaxAccount',_0x59c17f,JSON[_0xdd38('0x15')](_0x1a4a33));_0x3c8adb(_0x1a4a33);})[_0xdd38('0x23')](function(_0x14abd8){logger[_0xdd38('0x16')](_0xdd38('0x19'),_0x14abd8[_0xdd38('0x18')],_0x59c17f);_0x5aca5e(_0x196c00['error'](0x1f4,_0x14abd8[_0xdd38('0x18')]));});});};exports['NotifyFaxAccount']=function(_0x5edd60,_0x5e935e,_0x7c6cd0){var _0x39a467=this;return new Promise(function(_0x2546c3,_0x24ed58){var _0x1e4321={'body':_0x5edd60[_0xdd38('0x24')],'channel':_0xdd38('0x25')};var _0x149018=[];var _0xe1cbee=[];var _0x10f426={};return db['CmContact'][_0xdd38('0x26')]()['then'](function(_0x23b12b){if(!_0x23b12b){throw new db['Sequelize'][(_0xdd38('0x27'))](_0xdd38('0x28'));}_0x149018=_['difference'](_['keys'](_0x23b12b),[_0xdd38('0x29'),_0xdd38('0x2a')]);_0xe1cbee=_[_0xdd38('0x2b')](_[_0xdd38('0x2c')](_0x23b12b),[_0xdd38('0x29'),_0xdd38('0x2a'),_0xdd38('0x2d'),_0xdd38('0x2e')]);if(_0x5edd60[_0xdd38('0x24')]['id']){delete _0x5edd60[_0xdd38('0x24')]['id'];}if(_['isNil'](_0x5edd60[_0xdd38('0x24')][_0xdd38('0x2f')])){throw new db[(_0xdd38('0x30'))]['ValidationError'](_0xdd38('0x31'));}if(_[_0xdd38('0x32')](_0x5edd60[_0xdd38('0x24')]['body'])||_0x5edd60['body'][_0xdd38('0x24')]===''){throw new db[(_0xdd38('0x30'))]['ValidationError'](_0xdd38('0x33'));}if(_['isNil'](_0x5edd60[_0xdd38('0x24')][_0xdd38('0x34')])){throw new db[(_0xdd38('0x30'))][(_0xdd38('0x27'))](_0xdd38('0x35')+_0xe1cbee);}if(!_[_0xdd38('0x36')](_0xe1cbee,_0x5edd60[_0xdd38('0x24')][_0xdd38('0x34')])){throw new db[(_0xdd38('0x30'))]['ValidationError'](_0xdd38('0x37')+_0xe1cbee);}_0x10f426[_0x5edd60[_0xdd38('0x24')][_0xdd38('0x34')]]=_0x5edd60[_0xdd38('0x24')][_0xdd38('0x2f')];})[_0xdd38('0x10')](function(){return db[_0xdd38('0x1a')][_0xdd38('0x38')]({'where':{'id':_0x5edd60[_0xdd38('0x39')]['id']},'include':[{'model':db[_0xdd38('0x3a')],'as':'List','include':[{'model':db[_0xdd38('0x3b')],'as':_0xdd38('0x3c'),'where':_0x10f426,'limit':0x1,'order':[[_0xdd38('0x2a'),_0xdd38('0x3d')]]}]},{'model':db[_0xdd38('0x3e')],'as':_0xdd38('0x3f')}]});})[_0xdd38('0x10')](function(_0x37a7c7){if(_0x37a7c7&&_0x37a7c7[_0xdd38('0x40')]){var _0x223d57=_0x37a7c7['get']({'plain':!![]});_0x1e4321[_0xdd38('0x39')]=_0x223d57;_0x1e4321['applications']=_0x223d57['Applications'];_0x1e4321['list']=_0x223d57[_0xdd38('0x40')];_0x1e4321[_0xdd38('0x41')]=_[_0xdd38('0x42')](_0x1e4321['applications'],['priority'],[_0xdd38('0x43')]);if(_0x1e4321[_0xdd38('0x39')]['Applications']){delete _0x1e4321[_0xdd38('0x39')]['Applications'];}if(_0x1e4321[_0xdd38('0x39')][_0xdd38('0x40')]&&_0x1e4321[_0xdd38('0x39')]['List'][_0xdd38('0x3c')]['length']){return _0x1e4321[_0xdd38('0x39')][_0xdd38('0x40')][_0xdd38('0x3c')][0x0];}var _0x419fdb=_['defaults'](_0x5edd60['body'],{'firstName':_0x5edd60[_0xdd38('0x24')][_0xdd38('0x2f')],'ListId':_0x223d57[_0xdd38('0x2e')]});_0x419fdb[_0x5edd60['body']['mapKey']]=_0x5edd60[_0xdd38('0x24')][_0xdd38('0x2f')];return db['CmContact'][_0xdd38('0x44')](_0x419fdb,{'fields':_0x149018,'raw':!![]});}})[_0xdd38('0x10')](function(_0x1ea363){_0x1e4321['contact']=_0x1ea363;if(_0x1ea363){var _0x366969={'ContactId':_0x1ea363['id'],'FaxAccountId':_0x5edd60['account']['id'],'fax':_0x1ea363['fax']};return db['FaxInteraction'][_0xdd38('0x38')]({'where':{'ContactId':_0x1ea363['id'],'closed':![],'FaxAccountId':_0x5edd60[_0xdd38('0x39')]['id']}})[_0xdd38('0x10')](function(_0x1f01b4){if(_0x1f01b4){return[_0x1f01b4,![]];}return db['FaxInteraction']['create'](_0x366969)['then'](function(_0x248df8){return[_0x248df8,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xdd38('0x45')](function(_0xda3404,_0x53079){var _0x4caefd=_0xda3404[_0xdd38('0x46')]({'plain':!![]});if(_0x53079){if(_0x1e4321[_0xdd38('0x39')][_0xdd38('0x47')]){_0x1e4321['applications'][_0xdd38('0x48')]({'id':0x0,'priority':_0x1e4321[_0xdd38('0x41')][_0xdd38('0x49')]+0x1,'app':_0xdd38('0x4a'),'appdata':_0xdd38('0x4b'),'interval':'*,*,*,*'});}_0x4caefd[_0xdd38('0x4c')]=!![];}else{_0x4caefd[_0xdd38('0x4c')]=![];}_0x1e4321[_0xdd38('0x4d')]=_0x4caefd;return db[_0xdd38('0x4e')][_0xdd38('0x44')]({'body':_0x5edd60[_0xdd38('0x24')][_0xdd38('0x24')],'FaxAccountId':_0x5edd60[_0xdd38('0x39')]['id'],'FaxInteractionId':_0xda3404['id'],'direction':'in','ContactId':_0xda3404[_0xdd38('0x4f')],'AttachmentId':_0x5edd60[_0xdd38('0x24')]['AttachmentId']});})[_0xdd38('0x10')](function(_0x1284d){_0x1e4321['message']=_0x1284d;if(_0x1e4321['interaction'][_0xdd38('0x50')]){return db['User'][_0xdd38('0x38')]({'attributes':['id',_0xdd38('0x51')],'where':{'id':_0x1e4321[_0xdd38('0x4d')]['UserId']}})[_0xdd38('0x10')](function(_0x472d11){if(_0x472d11){_0x1e4321[_0xdd38('0x41')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x472d11['name']+','+(_0x1e4321['account']['waitForTheAssignedAgent']||0xa),'interval':_0xdd38('0x52')});}return respondWithRpcPromise(_0xdd38('0x53'),'startRouting',_0x1e4321);});}return respondWithRpcPromise('Start',_0xdd38('0x54'),_0x1e4321);})[_0xdd38('0x10')](function(_0x209ddf){_0x2546c3(_0x209ddf);})['catch'](function(_0x28eba0){_0x24ed58(_0x39a467['error'](0x1f4,_0x28eba0[_0xdd38('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 62e183c..f417348 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 _0xebc0=['faxAccount:','./faxAccount.events','save','remove','removeListener','register','length'];(function(_0x3b906d,_0x60a43){var _0xb8dd48=function(_0x41aef9){while(--_0x41aef9){_0x3b906d['push'](_0x3b906d['shift']());}};_0xb8dd48(++_0x60a43);}(_0xebc0,0x12e));var _0x0ebc=function(_0x410bdd,_0x26ccdb){_0x410bdd=_0x410bdd-0x0;var _0x5747fb=_0xebc0[_0x410bdd];return _0x5747fb;};'use strict';var FaxAccountEvents=require(_0x0ebc('0x0'));var events=[_0x0ebc('0x1'),_0x0ebc('0x2'),'update'];function createListener(_0x430295,_0x54ca6b){return function(_0x277bbf){_0x54ca6b['emit'](_0x430295,_0x277bbf);};}function removeListener(_0x2d1d63,_0x45f7a8){return function(){FaxAccountEvents[_0x0ebc('0x3')](_0x2d1d63,_0x45f7a8);};}exports[_0x0ebc('0x4')]=function(_0x3a91a5){for(var _0x18493d=0x0,_0x5ee975=events[_0x0ebc('0x5')];_0x18493d<_0x5ee975;_0x18493d++){var _0x4c3a3e=events[_0x18493d];var _0x3e79dd=createListener(_0x0ebc('0x6')+_0x4c3a3e,_0x3a91a5);FaxAccountEvents['on'](_0x4c3a3e,_0x3e79dd);}}; \ No newline at end of file +var _0x36af=['emit','register','length','faxAccount:','save','update'];(function(_0x1649c6,_0x5a08ee){var _0x2c1e0a=function(_0x46d812){while(--_0x46d812){_0x1649c6['push'](_0x1649c6['shift']());}};_0x2c1e0a(++_0x5a08ee);}(_0x36af,0xdc));var _0xf36a=function(_0x2c79a9,_0x5744f2){_0x2c79a9=_0x2c79a9-0x0;var _0x4faba8=_0x36af[_0x2c79a9];return _0x4faba8;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xf36a('0x0'),'remove',_0xf36a('0x1')];function createListener(_0x33c06e,_0x24e436){return function(_0xfeb4c6){_0x24e436[_0xf36a('0x2')](_0x33c06e,_0xfeb4c6);};}function removeListener(_0x21598f,_0x5f02ac){return function(){FaxAccountEvents['removeListener'](_0x21598f,_0x5f02ac);};}exports[_0xf36a('0x3')]=function(_0x100a77){for(var _0x426335=0x0,_0x28a4b2=events[_0xf36a('0x4')];_0x426335<_0x28a4b2;_0x426335++){var _0x33926d=events[_0x426335];var _0x17f2a8=createListener(_0xf36a('0x5')+_0x33926d,_0x100a77);FaxAccountEvents['on'](_0x33926d,_0x17f2a8);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 27bec66..e5605e5 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 _0xb821=['/:id/send','send','addAgents','put','destroy','delete','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','util','path','Router','../../config/environment','./faxAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getMessages','/:id/users','post','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb821,0xa7));var _0x1b82=function(_0x524d27,_0xfd8d08){_0x524d27=_0x524d27-0x0;var _0x3d2006=_0xb821[_0x524d27];return _0x3d2006;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b82('0x3'));var controller=require(_0x1b82('0x4'));router[_0x1b82('0x5')]('/',auth[_0x1b82('0x6')](),controller['index']);router[_0x1b82('0x5')](_0x1b82('0x7'),auth[_0x1b82('0x6')](),controller[_0x1b82('0x8')]);router[_0x1b82('0x5')](_0x1b82('0x9'),auth[_0x1b82('0x6')](),controller[_0x1b82('0xa')]);router[_0x1b82('0x5')]('/:id/dispositions',auth[_0x1b82('0x6')](),controller[_0x1b82('0xb')]);router[_0x1b82('0x5')](_0x1b82('0xc'),auth[_0x1b82('0x6')](),controller[_0x1b82('0xd')]);router[_0x1b82('0x5')](_0x1b82('0xe'),auth['isAuthenticated'](),controller[_0x1b82('0xf')]);router[_0x1b82('0x5')](_0x1b82('0x10'),auth[_0x1b82('0x6')](),controller['getApplications']);router[_0x1b82('0x5')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1b82('0x11')]);router['get'](_0x1b82('0x12'),auth[_0x1b82('0x6')](),controller['getAgents']);router[_0x1b82('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1b82('0x13')]('/:id/dispositions',auth[_0x1b82('0x6')](),controller[_0x1b82('0x14')]);router[_0x1b82('0x13')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x1b82('0x15')]);router['post'](_0x1b82('0xe'),auth[_0x1b82('0x6')](),controller[_0x1b82('0x16')]);router['post'](_0x1b82('0x10'),auth[_0x1b82('0x6')](),controller[_0x1b82('0x17')]);router[_0x1b82('0x13')](_0x1b82('0x18'),auth['isAuthenticated'](),controller[_0x1b82('0x19')]);router[_0x1b82('0x13')](_0x1b82('0x1a'),auth[_0x1b82('0x6')](),controller[_0x1b82('0x1b')]);router[_0x1b82('0x13')](_0x1b82('0x1c'),auth['isAuthenticated'](),controller[_0x1b82('0x1d')]);router[_0x1b82('0x13')]('/:id/users',auth[_0x1b82('0x6')](),controller[_0x1b82('0x1e')]);router[_0x1b82('0x1f')]('/:id',auth[_0x1b82('0x6')](),controller['update']);router['delete']('/:id',auth[_0x1b82('0x6')](),controller[_0x1b82('0x20')]);router[_0x1b82('0x21')](_0x1b82('0x22'),auth['isAuthenticated'](),controller[_0x1b82('0x23')]);router[_0x1b82('0x21')](_0x1b82('0xc'),auth[_0x1b82('0x6')](),controller[_0x1b82('0x24')]);router[_0x1b82('0x21')](_0x1b82('0x12'),auth[_0x1b82('0x6')](),controller[_0x1b82('0x25')]);module[_0x1b82('0x26')]=router; \ No newline at end of file +var _0xf3cd=['index','get','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxAccount.controller','isAuthenticated'];(function(_0x5dea35,_0x4403ce){var _0x420537=function(_0x262e1c){while(--_0x262e1c){_0x5dea35['push'](_0x5dea35['shift']());}};_0x420537(++_0x4403ce);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2341ab,_0x326a6c){_0x2341ab=_0x2341ab-0x0;var _0x54533e=_0xf3cd[_0x2341ab];return _0x54533e;};'use strict';var multer=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var timeout=require(_0xdf3c('0x3'));var express=require(_0xdf3c('0x4'));var router=express[_0xdf3c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xdf3c('0x6'));var config=require(_0xdf3c('0x7'));var controller=require(_0xdf3c('0x8'));router['get']('/',auth[_0xdf3c('0x9')](),controller[_0xdf3c('0xa')]);router[_0xdf3c('0xb')](_0xdf3c('0xc'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0xd')]);router['get'](_0xdf3c('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xdf3c('0xb')](_0xdf3c('0xf'),auth['isAuthenticated'](),controller[_0xdf3c('0x10')]);router[_0xdf3c('0xb')](_0xdf3c('0x11'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x12')]);router[_0xdf3c('0xb')](_0xdf3c('0x13'),auth[_0xdf3c('0x9')](),controller['getInteractions']);router[_0xdf3c('0xb')](_0xdf3c('0x14'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x15')]);router['get'](_0xdf3c('0x16'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x17')]);router['get'](_0xdf3c('0x18'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x19')]);router[_0xdf3c('0x1a')]('/',auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x1b')]);router[_0xdf3c('0x1a')](_0xdf3c('0xf'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x1c')]);router['post'](_0xdf3c('0x11'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x1d')]);router[_0xdf3c('0x1a')](_0xdf3c('0x13'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x1e')]);router[_0xdf3c('0x1a')](_0xdf3c('0x14'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x1f')]);router[_0xdf3c('0x1a')](_0xdf3c('0x20'),auth['isAuthenticated'](),controller['addAccountApplications']);router[_0xdf3c('0x1a')]('/updateaccountapplications',auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x21')]);router[_0xdf3c('0x1a')](_0xdf3c('0x22'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x23')]);router['post'](_0xdf3c('0x18'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x24')]);router[_0xdf3c('0x25')](_0xdf3c('0xe'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x26')]);router[_0xdf3c('0x27')](_0xdf3c('0xe'),auth[_0xdf3c('0x9')](),controller['destroy']);router[_0xdf3c('0x27')](_0xdf3c('0xf'),auth['isAuthenticated'](),controller[_0xdf3c('0x28')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xdf3c('0x29')]);router[_0xdf3c('0x27')]('/:id/users',auth['isAuthenticated'](),controller[_0xdf3c('0x2a')]);module[_0xdf3c('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 b7023bc..716d939 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 _0x7cc0=['sequelize','exports','STRING','*,*,*,*'];(function(_0x466690,_0x1a726b){var _0x5657f8=function(_0x1bfef9){while(--_0x1bfef9){_0x466690['push'](_0x466690['shift']());}};_0x5657f8(++_0x1a726b);}(_0x7cc0,0x78));var _0x07cc=function(_0x1a524d,_0x3d8552){_0x1a524d=_0x1a524d-0x0;var _0x436b26=_0x7cc0[_0x1a524d];return _0x436b26;};'use strict';var Sequelize=require(_0x07cc('0x0'));module[_0x07cc('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x07cc('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x07cc('0x2')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0x07cc('0x2')]},'interval':{'type':Sequelize[_0x07cc('0x2')],'defaultValue':_0x07cc('0x3')}}; \ No newline at end of file +var _0x0d9d=['STRING','exports','INTEGER'];(function(_0x1f269a,_0x23719d){var _0x9aa1d8=function(_0x2dfba6){while(--_0x2dfba6){_0x1f269a['push'](_0x1f269a['shift']());}};_0x9aa1d8(++_0x23719d);}(_0x0d9d,0xb8));var _0xd0d9=function(_0x532de2,_0x28082a){_0x532de2=_0x532de2-0x0;var _0xf8a0bc=_0x0d9d[_0x532de2];return _0xf8a0bc;};'use strict';var Sequelize=require('sequelize');module[_0xd0d9('0x0')]={'priority':{'type':Sequelize[_0xd0d9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd0d9('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['STRING'](0x1000),'defaultValue':''},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b294a6d..96d4aa6 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 _0x10e5=['mustache','util','sox','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','field','merge','options','FaxApplication','include','findAll','show','params','length','includeAll','create','catch','body','destroy','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x58874a,_0x187731){var _0x22e098=function(_0x5d2e77){while(--_0x5d2e77){_0x58874a['push'](_0x58874a['shift']());}};_0x22e098(++_0x187731);}(_0x10e5,0xcf));var _0x510e=function(_0xfbb2c4,_0x26b45a){_0xfbb2c4=_0xfbb2c4-0x0;var _0x440158=_0x10e5[_0xfbb2c4];return _0x440158;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x510e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x510e('0x1'));var jsonpatch=require(_0x510e('0x2'));var rp=require(_0x510e('0x3'));var moment=require(_0x510e('0x4'));var BPromise=require(_0x510e('0x5'));var Mustache=require(_0x510e('0x6'));var util=require(_0x510e('0x7'));var path=require('path');var sox=require(_0x510e('0x8'));var csv=require('to-csv');var ejs=require(_0x510e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x510e('0xa'));var crypto=require(_0x510e('0xb'));var jsforce=require(_0x510e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x510e('0xd'));var Papa=require(_0x510e('0xe'));var authService=require(_0x510e('0xf'));var hardwareService=require(_0x510e('0x10'));var Redis=require(_0x510e('0x11'));var qs=require(_0x510e('0x12'));var logger=require(_0x510e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x510e('0x14'));var db=require(_0x510e('0x15'))['db'];function respondWithStatusCode(_0x1d571b,_0x21e926){_0x21e926=_0x21e926||0xcc;return function(_0x33c3d5){if(_0x33c3d5){return _0x1d571b[_0x510e('0x16')](_0x21e926);}return _0x1d571b[_0x510e('0x17')](_0x21e926)['end']();};}function respondWithResult(_0x2bdc6f,_0x37cb74){_0x37cb74=_0x37cb74||0xc8;return function(_0x1c1d55){if(_0x1c1d55){return _0x2bdc6f['status'](_0x37cb74)[_0x510e('0x18')](_0x1c1d55);}};}function respondWithFilteredResult(_0xa2789b,_0x3da7e3){return function(_0x1173ca){if(_0x1173ca){var _0x2b905a=_0x1173ca[_0x510e('0x19')],_0x33c101=_0x3da7e3[_0x510e('0x1a')],_0x35bfe2=_0x3da7e3[_0x510e('0x1a')]+_0x3da7e3[_0x510e('0x1b')],_0x24aecc;if(_0x35bfe2>=_0x2b905a){_0x35bfe2=_0x2b905a;_0x24aecc=0xc8;}else{_0x24aecc=0xce;}_0xa2789b[_0x510e('0x17')](_0x24aecc);return _0xa2789b[_0x510e('0x1c')](_0x510e('0x1d'),_0x33c101+'-'+_0x35bfe2+'/'+_0x2b905a)[_0x510e('0x18')](_0x1173ca);}return null;};}function patchUpdates(_0x46e9a0){return function(_0x3f7f4f){try{jsonpatch[_0x510e('0x1e')](_0x3f7f4f,_0x46e9a0,!![]);}catch(_0x5e3143){return BPromise[_0x510e('0x1f')](_0x5e3143);}return _0x3f7f4f[_0x510e('0x20')]();};}function saveUpdates(_0xc16a04,_0x1b7e6d){return function(_0x185201){if(_0x185201){return _0x185201[_0x510e('0x21')](_0xc16a04)['then'](function(_0x245b62){return _0x245b62;});}return null;};}function removeEntity(_0xe05b47,_0x24d7e0){return function(_0x55024c){if(_0x55024c){return _0x55024c['destroy']()[_0x510e('0x22')](function(){_0xe05b47[_0x510e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d2f5b,_0x33c8f6){return function(_0x204225){if(!_0x204225){_0x4d2f5b[_0x510e('0x16')](0x194);}return _0x204225;};}function handleError(_0x276695,_0x5c8852){_0x5c8852=_0x5c8852||0x1f4;return function(_0x36255e){logger[_0x510e('0x23')](_0x36255e[_0x510e('0x24')]);if(_0x36255e[_0x510e('0x25')]){delete _0x36255e[_0x510e('0x25')];}_0x276695['status'](_0x5c8852)[_0x510e('0x26')](_0x36255e);};}exports[_0x510e('0x27')]=function(_0x4e8b1f,_0xb8fb0a){var _0x1756ba={},_0xd9a62e={},_0x9bd706={'count':0x0,'rows':[]};var _0x38c793=db['FaxApplication'][_0x510e('0x28')];_0xd9a62e[_0x510e('0x29')]=_[_0x510e('0x2a')](_0x38c793);_0xd9a62e[_0x510e('0x2b')]=_[_0x510e('0x2a')](_0x4e8b1f[_0x510e('0x2b')]);_0xd9a62e[_0x510e('0x2c')]=_[_0x510e('0x2d')](_0xd9a62e[_0x510e('0x29')],_0xd9a62e[_0x510e('0x2b')]);_0x1756ba[_0x510e('0x2e')]=_[_0x510e('0x2d')](_0xd9a62e['model'],qs[_0x510e('0x2f')](_0x4e8b1f[_0x510e('0x2b')][_0x510e('0x2f')]));_0x1756ba[_0x510e('0x2e')]=_0x1756ba['attributes']['length']?_0x1756ba[_0x510e('0x2e')]:_0xd9a62e[_0x510e('0x29')];if(!_0x4e8b1f[_0x510e('0x2b')][_0x510e('0x30')](_0x510e('0x31'))){_0x1756ba['limit']=qs['limit'](_0x4e8b1f[_0x510e('0x2b')][_0x510e('0x1b')]);_0x1756ba[_0x510e('0x1a')]=qs[_0x510e('0x1a')](_0x4e8b1f['query']['offset']);}_0x1756ba[_0x510e('0x32')]=qs[_0x510e('0x33')](_0x4e8b1f[_0x510e('0x2b')][_0x510e('0x33')]);_0x1756ba[_0x510e('0x34')]=qs['filters'](_['pick'](_0x4e8b1f[_0x510e('0x2b')],_0xd9a62e[_0x510e('0x2c')]));if(_0x4e8b1f['query'][_0x510e('0x35')]){_0x1756ba[_0x510e('0x34')]=_['merge'](_0x1756ba['where'],{'$or':_['map'](_0x38c793,function(_0x24ff51){if(_0x24ff51[_0x510e('0x36')]['key']!==_0x510e('0x37')){var _0x52ccfc={};_0x52ccfc[_0x24ff51[_0x510e('0x38')]]={'$like':'%'+_0x4e8b1f['query']['filter']+'%'};return _0x52ccfc;}})});}_0x1756ba=_[_0x510e('0x39')]({},_0x1756ba,_0x4e8b1f[_0x510e('0x3a')]);var _0x401c06={'where':_0x1756ba[_0x510e('0x34')]};return db[_0x510e('0x3b')][_0x510e('0x19')](_0x401c06)[_0x510e('0x22')](function(_0xceedf5){_0x9bd706['count']=_0xceedf5;if(_0x4e8b1f['query']['includeAll']){_0x1756ba[_0x510e('0x3c')]=[{'all':!![]}];}return db[_0x510e('0x3b')][_0x510e('0x3d')](_0x1756ba);})[_0x510e('0x22')](function(_0x260cc1){_0x9bd706['rows']=_0x260cc1;return _0x9bd706;})['then'](respondWithFilteredResult(_0xb8fb0a,_0x1756ba))['catch'](handleError(_0xb8fb0a,null));};exports[_0x510e('0x3e')]=function(_0x2f7a64,_0x166baa){var _0x5eef7a={'raw':!![],'where':{'id':_0x2f7a64[_0x510e('0x3f')]['id']}},_0x480f36={};_0x480f36[_0x510e('0x29')]=_[_0x510e('0x2a')](db[_0x510e('0x3b')][_0x510e('0x28')]);_0x480f36[_0x510e('0x2b')]=_['keys'](_0x2f7a64[_0x510e('0x2b')]);_0x480f36[_0x510e('0x2c')]=_['intersection'](_0x480f36[_0x510e('0x29')],_0x480f36[_0x510e('0x2b')]);_0x5eef7a[_0x510e('0x2e')]=_[_0x510e('0x2d')](_0x480f36[_0x510e('0x29')],qs['fields'](_0x2f7a64['query'][_0x510e('0x2f')]));_0x5eef7a[_0x510e('0x2e')]=_0x5eef7a['attributes'][_0x510e('0x40')]?_0x5eef7a['attributes']:_0x480f36[_0x510e('0x29')];if(_0x2f7a64[_0x510e('0x2b')][_0x510e('0x41')]){_0x5eef7a['include']=[{'all':!![]}];}_0x5eef7a=_[_0x510e('0x39')]({},_0x5eef7a,_0x2f7a64[_0x510e('0x3a')]);return db['FaxApplication']['find'](_0x5eef7a)[_0x510e('0x22')](handleEntityNotFound(_0x166baa,null))[_0x510e('0x22')](respondWithResult(_0x166baa,null))['catch'](handleError(_0x166baa,null));};exports[_0x510e('0x42')]=function(_0x1c27e2,_0x10ec12){return db[_0x510e('0x3b')]['create'](_0x1c27e2['body'],{})['then'](respondWithResult(_0x10ec12,0xc9))[_0x510e('0x43')](handleError(_0x10ec12,null));};exports[_0x510e('0x21')]=function(_0x1e9c02,_0x4b3e90){if(_0x1e9c02[_0x510e('0x44')]['id']){delete _0x1e9c02[_0x510e('0x44')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x1e9c02[_0x510e('0x3f')]['id']}})[_0x510e('0x22')](handleEntityNotFound(_0x4b3e90,null))[_0x510e('0x22')](saveUpdates(_0x1e9c02[_0x510e('0x44')],null))[_0x510e('0x22')](respondWithResult(_0x4b3e90,null))[_0x510e('0x43')](handleError(_0x4b3e90,null));};exports[_0x510e('0x45')]=function(_0x2406d2,_0x4b153b){return db[_0x510e('0x3b')][_0x510e('0x46')]({'where':{'id':_0x2406d2[_0x510e('0x3f')]['id']}})[_0x510e('0x22')](handleEntityNotFound(_0x4b153b,null))['then'](removeEntity(_0x4b153b,null))[_0x510e('0x43')](handleError(_0x4b153b,null));}; \ No newline at end of file +var _0xaa53=['then','destroy','error','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','FaxApplication','count','includeAll','show','include','find','catch','create','body','params','html-pdf','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update'];(function(_0x55bde7,_0x154f22){var _0x585745=function(_0x33bea3){while(--_0x33bea3){_0x55bde7['push'](_0x55bde7['shift']());}};_0x585745(++_0x154f22);}(_0xaa53,0xb0));var _0x3aa5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa53[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x3aa5('0x0'));var emlformat=require(_0x3aa5('0x1'));var rimraf=require(_0x3aa5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3aa5('0x3'));var moment=require(_0x3aa5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3aa5('0x5'));var util=require('util');var path=require(_0x3aa5('0x6'));var sox=require(_0x3aa5('0x7'));var csv=require(_0x3aa5('0x8'));var ejs=require(_0x3aa5('0x9'));var fs=require('fs');var _=require(_0x3aa5('0xa'));var squel=require(_0x3aa5('0xb'));var crypto=require(_0x3aa5('0xc'));var jsforce=require(_0x3aa5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3aa5('0xe'));var Papa=require(_0x3aa5('0xf'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x3aa5('0x10'));var qs=require(_0x3aa5('0x11'));var logger=require(_0x3aa5('0x12'))('api');var utils=require(_0x3aa5('0x13'));var config=require('../../config/environment');var db=require(_0x3aa5('0x14'))['db'];function respondWithStatusCode(_0x13b29b,_0x39efe6){_0x39efe6=_0x39efe6||0xcc;return function(_0x2e4547){if(_0x2e4547){return _0x13b29b[_0x3aa5('0x15')](_0x39efe6);}return _0x13b29b[_0x3aa5('0x16')](_0x39efe6)[_0x3aa5('0x17')]();};}function respondWithResult(_0x505936,_0x2f1554){_0x2f1554=_0x2f1554||0xc8;return function(_0xe0c6ce){if(_0xe0c6ce){return _0x505936[_0x3aa5('0x16')](_0x2f1554)[_0x3aa5('0x18')](_0xe0c6ce);}};}function respondWithFilteredResult(_0x4248a6,_0x4fa378){return function(_0x5e2f5d){if(_0x5e2f5d){var _0x1b650b=_0x5e2f5d['count'],_0x2f7267=_0x4fa378[_0x3aa5('0x19')],_0x45b238=_0x4fa378[_0x3aa5('0x19')]+_0x4fa378[_0x3aa5('0x1a')],_0x48e39a;if(_0x45b238>=_0x1b650b){_0x45b238=_0x1b650b;_0x48e39a=0xc8;}else{_0x48e39a=0xce;}_0x4248a6[_0x3aa5('0x16')](_0x48e39a);return _0x4248a6['set'](_0x3aa5('0x1b'),_0x2f7267+'-'+_0x45b238+'/'+_0x1b650b)[_0x3aa5('0x18')](_0x5e2f5d);}return null;};}function patchUpdates(_0x8e1dc8){return function(_0x59d375){try{jsonpatch[_0x3aa5('0x1c')](_0x59d375,_0x8e1dc8,!![]);}catch(_0x2abbf3){return BPromise['reject'](_0x2abbf3);}return _0x59d375[_0x3aa5('0x1d')]();};}function saveUpdates(_0x4650d7,_0x5984c6){return function(_0x5decdd){if(_0x5decdd){return _0x5decdd[_0x3aa5('0x1e')](_0x4650d7)[_0x3aa5('0x1f')](function(_0x268c68){return _0x268c68;});}return null;};}function removeEntity(_0x2c4781,_0xf7eb21){return function(_0xb096a2){if(_0xb096a2){return _0xb096a2[_0x3aa5('0x20')]()[_0x3aa5('0x1f')](function(){_0x2c4781[_0x3aa5('0x16')](0xcc)[_0x3aa5('0x17')]();});}};}function handleEntityNotFound(_0x793bd7,_0x4d2d2b){return function(_0x2cbfb1){if(!_0x2cbfb1){_0x793bd7['sendStatus'](0x194);}return _0x2cbfb1;};}function handleError(_0xf63b2e,_0x19d70b){_0x19d70b=_0x19d70b||0x1f4;return function(_0xe54936){logger[_0x3aa5('0x21')](_0xe54936[_0x3aa5('0x22')]);if(_0xe54936[_0x3aa5('0x23')]){delete _0xe54936['name'];}_0xf63b2e['status'](_0x19d70b)['send'](_0xe54936);};}exports[_0x3aa5('0x24')]=function(_0x2f67ac,_0x4b8477){var _0x2b4f84={},_0x42342={},_0x509430={'count':0x0,'rows':[]};var _0x226930=db['FaxApplication'][_0x3aa5('0x25')];_0x42342[_0x3aa5('0x26')]=_[_0x3aa5('0x27')](_0x226930);_0x42342[_0x3aa5('0x28')]=_['keys'](_0x2f67ac[_0x3aa5('0x28')]);_0x42342[_0x3aa5('0x29')]=_[_0x3aa5('0x2a')](_0x42342[_0x3aa5('0x26')],_0x42342[_0x3aa5('0x28')]);_0x2b4f84[_0x3aa5('0x2b')]=_['intersection'](_0x42342[_0x3aa5('0x26')],qs[_0x3aa5('0x2c')](_0x2f67ac[_0x3aa5('0x28')][_0x3aa5('0x2c')]));_0x2b4f84[_0x3aa5('0x2b')]=_0x2b4f84[_0x3aa5('0x2b')][_0x3aa5('0x2d')]?_0x2b4f84[_0x3aa5('0x2b')]:_0x42342['model'];if(!_0x2f67ac[_0x3aa5('0x28')][_0x3aa5('0x2e')](_0x3aa5('0x2f'))){_0x2b4f84['limit']=qs['limit'](_0x2f67ac[_0x3aa5('0x28')]['limit']);_0x2b4f84[_0x3aa5('0x19')]=qs[_0x3aa5('0x19')](_0x2f67ac[_0x3aa5('0x28')][_0x3aa5('0x19')]);}_0x2b4f84[_0x3aa5('0x30')]=qs['sort'](_0x2f67ac[_0x3aa5('0x28')][_0x3aa5('0x31')]);_0x2b4f84[_0x3aa5('0x32')]=qs[_0x3aa5('0x29')](_[_0x3aa5('0x33')](_0x2f67ac[_0x3aa5('0x28')],_0x42342[_0x3aa5('0x29')]));if(_0x2f67ac[_0x3aa5('0x28')][_0x3aa5('0x34')]){_0x2b4f84['where']=_[_0x3aa5('0x35')](_0x2b4f84[_0x3aa5('0x32')],{'$or':_[_0x3aa5('0x36')](_0x226930,function(_0x141fc5){if(_0x141fc5['type'][_0x3aa5('0x37')]!==_0x3aa5('0x38')){var _0x156a6a={};_0x156a6a[_0x141fc5[_0x3aa5('0x39')]]={'$like':'%'+_0x2f67ac['query'][_0x3aa5('0x34')]+'%'};return _0x156a6a;}})});}_0x2b4f84=_[_0x3aa5('0x35')]({},_0x2b4f84,_0x2f67ac[_0x3aa5('0x3a')]);var _0x3a013a={'where':_0x2b4f84[_0x3aa5('0x32')]};return db[_0x3aa5('0x3b')][_0x3aa5('0x3c')](_0x3a013a)[_0x3aa5('0x1f')](function(_0x193385){_0x509430[_0x3aa5('0x3c')]=_0x193385;if(_0x2f67ac[_0x3aa5('0x28')][_0x3aa5('0x3d')]){_0x2b4f84['include']=[{'all':!![]}];}return db[_0x3aa5('0x3b')]['findAll'](_0x2b4f84);})[_0x3aa5('0x1f')](function(_0x198020){_0x509430['rows']=_0x198020;return _0x509430;})[_0x3aa5('0x1f')](respondWithFilteredResult(_0x4b8477,_0x2b4f84))['catch'](handleError(_0x4b8477,null));};exports[_0x3aa5('0x3e')]=function(_0x1b5b6c,_0x52cb4c){var _0xc67805={'raw':!![],'where':{'id':_0x1b5b6c['params']['id']}},_0x1a0590={};_0x1a0590[_0x3aa5('0x26')]=_[_0x3aa5('0x27')](db[_0x3aa5('0x3b')][_0x3aa5('0x25')]);_0x1a0590[_0x3aa5('0x28')]=_[_0x3aa5('0x27')](_0x1b5b6c[_0x3aa5('0x28')]);_0x1a0590['filters']=_[_0x3aa5('0x2a')](_0x1a0590['model'],_0x1a0590['query']);_0xc67805['attributes']=_[_0x3aa5('0x2a')](_0x1a0590[_0x3aa5('0x26')],qs[_0x3aa5('0x2c')](_0x1b5b6c[_0x3aa5('0x28')][_0x3aa5('0x2c')]));_0xc67805[_0x3aa5('0x2b')]=_0xc67805[_0x3aa5('0x2b')][_0x3aa5('0x2d')]?_0xc67805[_0x3aa5('0x2b')]:_0x1a0590[_0x3aa5('0x26')];if(_0x1b5b6c[_0x3aa5('0x28')][_0x3aa5('0x3d')]){_0xc67805[_0x3aa5('0x3f')]=[{'all':!![]}];}_0xc67805=_['merge']({},_0xc67805,_0x1b5b6c['options']);return db['FaxApplication'][_0x3aa5('0x40')](_0xc67805)['then'](handleEntityNotFound(_0x52cb4c,null))[_0x3aa5('0x1f')](respondWithResult(_0x52cb4c,null))[_0x3aa5('0x41')](handleError(_0x52cb4c,null));};exports[_0x3aa5('0x42')]=function(_0x593ceb,_0x53195a){return db[_0x3aa5('0x3b')][_0x3aa5('0x42')](_0x593ceb[_0x3aa5('0x43')],{})[_0x3aa5('0x1f')](respondWithResult(_0x53195a,0xc9))['catch'](handleError(_0x53195a,null));};exports[_0x3aa5('0x1e')]=function(_0x45a019,_0x3415d7){if(_0x45a019[_0x3aa5('0x43')]['id']){delete _0x45a019['body']['id'];}return db[_0x3aa5('0x3b')][_0x3aa5('0x40')]({'where':{'id':_0x45a019[_0x3aa5('0x44')]['id']}})['then'](handleEntityNotFound(_0x3415d7,null))[_0x3aa5('0x1f')](saveUpdates(_0x45a019[_0x3aa5('0x43')],null))['then'](respondWithResult(_0x3415d7,null))[_0x3aa5('0x41')](handleError(_0x3415d7,null));};exports[_0x3aa5('0x20')]=function(_0x2b38ec,_0xa60632){return db['FaxApplication'][_0x3aa5('0x40')]({'where':{'id':_0x2b38ec[_0x3aa5('0x44')]['id']}})[_0x3aa5('0x1f')](handleEntityNotFound(_0xa60632,null))[_0x3aa5('0x1f')](removeEntity(_0xa60632,null))[_0x3aa5('0x41')](handleError(_0xa60632,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index b354141..4930e66 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 _0xccca=['./faxApplication.attributes','exports','FaxApplication','fax_applications','lodash','util','../../config/logger','moment','request-promise'];(function(_0x36d5a4,_0x6f3d5c){var _0xd18783=function(_0x2a4ec6){while(--_0x2a4ec6){_0x36d5a4['push'](_0x36d5a4['shift']());}};_0xd18783(++_0x6f3d5c);}(_0xccca,0xa6));var _0xaccc=function(_0x40d891,_0x301ea0){_0x40d891=_0x40d891-0x0;var _0x1ad44e=_0xccca[_0x40d891];return _0x1ad44e;};'use strict';var _=require(_0xaccc('0x0'));var util=require(_0xaccc('0x1'));var logger=require(_0xaccc('0x2'))('api');var moment=require(_0xaccc('0x3'));var BPromise=require('bluebird');var rp=require(_0xaccc('0x4'));var attributes=require(_0xaccc('0x5'));module[_0xaccc('0x6')]=function(_0x2acda8,_0x65d094){return _0x2acda8['define'](_0xaccc('0x7'),attributes,{'tableName':_0xaccc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce0c=['exports','define','FaxApplication','fax_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./faxApplication.attributes'];(function(_0x75fe5e,_0x25e22f){var _0xcfc4a7=function(_0x226853){while(--_0x226853){_0x75fe5e['push'](_0x75fe5e['shift']());}};_0xcfc4a7(++_0x25e22f);}(_0xce0c,0x1b4));var _0xcce0=function(_0x5a7d41,_0x4447e2){_0x5a7d41=_0x5a7d41-0x0;var _0x98d8fa=_0xce0c[_0x5a7d41];return _0x98d8fa;};'use strict';var _=require(_0xcce0('0x0'));var util=require(_0xcce0('0x1'));var logger=require(_0xcce0('0x2'))(_0xcce0('0x3'));var moment=require(_0xcce0('0x4'));var BPromise=require(_0xcce0('0x5'));var rp=require(_0xcce0('0x6'));var attributes=require(_0xcce0('0x7'));module[_0xcce0('0x8')]=function(_0x478734,_0x8d3983){return _0x478734[_0xcce0('0x9')](_0xcce0('0xa'),attributes,{'tableName':_0xcce0('0xb'),'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 a8f0ecc..5cae24b 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 _0x76eb=['error','code','message','catch','UpdateFaxApplication','update','options','raw','attributes','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x19a2ac,_0x4c9f4f){var _0x15058e=function(_0x1fe434){while(--_0x1fe434){_0x19a2ac['push'](_0x19a2ac['shift']());}};_0x15058e(++_0x4c9f4f);}(_0x76eb,0xbf));var _0xb76e=function(_0x378720,_0xa711f1){_0x378720=_0x378720-0x0;var _0x47920a=_0x76eb[_0x378720];return _0x47920a;};'use strict';var _=require(_0xb76e('0x0'));var util=require(_0xb76e('0x1'));var moment=require(_0xb76e('0x2'));var BPromise=require(_0xb76e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb76e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb76e('0x5'));var logger=require(_0xb76e('0x6'))('rpc');var config=require(_0xb76e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb76e('0x8')][_0xb76e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1679b0,_0x3006fe,_0x1eacd2){return new BPromise(function(_0x436db7,_0x389c60){return client[_0xb76e('0xa')](_0x1679b0,_0x1eacd2)['then'](function(_0x7d8003){logger[_0xb76e('0xb')](_0xb76e('0xc'),_0x3006fe,_0xb76e('0xd'));logger[_0xb76e('0xe')](_0xb76e('0xf'),_0x3006fe,_0xb76e('0xd'),JSON[_0xb76e('0x10')](_0x7d8003));if(_0x7d8003[_0xb76e('0x11')]){if(_0x7d8003['error'][_0xb76e('0x12')]===0x1f4){logger['error'](_0xb76e('0xc'),_0x3006fe,_0x7d8003[_0xb76e('0x11')][_0xb76e('0x13')]);return _0x389c60(_0x7d8003[_0xb76e('0x11')][_0xb76e('0x13')]);}logger[_0xb76e('0x11')](_0xb76e('0xc'),_0x3006fe,_0x7d8003[_0xb76e('0x11')][_0xb76e('0x13')]);return _0x436db7(_0x7d8003[_0xb76e('0x11')][_0xb76e('0x13')]);}else{logger['info'](_0xb76e('0xc'),_0x3006fe,_0xb76e('0xd'));_0x436db7(_0x7d8003['result'][_0xb76e('0x13')]);}})[_0xb76e('0x14')](function(_0x5cf383){logger[_0xb76e('0x11')](_0xb76e('0xc'),_0x3006fe,_0x5cf383);_0x389c60(_0x5cf383);});});}exports[_0xb76e('0x15')]=function(_0x413ee2){var _0x2fcaca=this;return new Promise(function(_0xb14d2e,_0x477206){return db['FaxApplication'][_0xb76e('0x16')](_0x413ee2['body'],{'raw':_0x413ee2[_0xb76e('0x17')]?_0x413ee2[_0xb76e('0x17')][_0xb76e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x413ee2['options']?_0x413ee2[_0xb76e('0x17')]['where']||null:null,'attributes':_0x413ee2[_0xb76e('0x17')]?_0x413ee2[_0xb76e('0x17')][_0xb76e('0x19')]||null:null,'limit':_0x413ee2['options']?_0x413ee2['options']['limit']||null:null})['then'](function(_0x189956){logger['info']('UpdateFaxApplication',_0x413ee2);logger[_0xb76e('0xe')](_0xb76e('0x15'),_0x413ee2,JSON[_0xb76e('0x10')](_0x189956));_0xb14d2e(_0x189956);})[_0xb76e('0x14')](function(_0x58c2c7){logger['error'](_0xb76e('0x15'),_0x58c2c7[_0xb76e('0x13')],_0x413ee2);_0x477206(_0x2fcaca[_0xb76e('0x11')](0x1f4,_0x58c2c7[_0xb76e('0x13')]));});});}; \ No newline at end of file +var _0xabf6=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','options','raw','where'];(function(_0x1f5143,_0x5e31e6){var _0x383a38=function(_0x2c123c){while(--_0x2c123c){_0x1f5143['push'](_0x1f5143['shift']());}};_0x383a38(++_0x5e31e6);}(_0xabf6,0x1c4));var _0x6abf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabf6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6abf('0x0'));var util=require(_0x6abf('0x1'));var moment=require(_0x6abf('0x2'));var BPromise=require(_0x6abf('0x3'));var rs=require(_0x6abf('0x4'));var fs=require('fs');var Redis=require(_0x6abf('0x5'));var db=require(_0x6abf('0x6'))['db'];var utils=require(_0x6abf('0x7'));var logger=require(_0x6abf('0x8'))(_0x6abf('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6abf('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4426f9,_0x75d0b9,_0x1421b5){return new BPromise(function(_0x2502cb,_0x1f8ff2){return client[_0x6abf('0xb')](_0x4426f9,_0x1421b5)['then'](function(_0x582549){logger[_0x6abf('0xc')](_0x6abf('0xd'),_0x75d0b9,'request\x20sent');logger[_0x6abf('0xe')](_0x6abf('0xf'),_0x75d0b9,_0x6abf('0x10'),JSON[_0x6abf('0x11')](_0x582549));if(_0x582549[_0x6abf('0x12')]){if(_0x582549[_0x6abf('0x12')][_0x6abf('0x13')]===0x1f4){logger[_0x6abf('0x12')]('FaxApplication,\x20%s,\x20%s',_0x75d0b9,_0x582549['error'][_0x6abf('0x14')]);return _0x1f8ff2(_0x582549[_0x6abf('0x12')][_0x6abf('0x14')]);}logger[_0x6abf('0x12')](_0x6abf('0xd'),_0x75d0b9,_0x582549[_0x6abf('0x12')][_0x6abf('0x14')]);return _0x2502cb(_0x582549[_0x6abf('0x12')][_0x6abf('0x14')]);}else{logger[_0x6abf('0xc')](_0x6abf('0xd'),_0x75d0b9,_0x6abf('0x10'));_0x2502cb(_0x582549[_0x6abf('0x15')][_0x6abf('0x14')]);}})[_0x6abf('0x16')](function(_0x3ddfb3){logger['error'](_0x6abf('0xd'),_0x75d0b9,_0x3ddfb3);_0x1f8ff2(_0x3ddfb3);});});}exports[_0x6abf('0x17')]=function(_0x1677e9){var _0x231586=this;return new Promise(function(_0x558109,_0x63f332){return db[_0x6abf('0x18')]['update'](_0x1677e9['body'],{'raw':_0x1677e9[_0x6abf('0x19')]?_0x1677e9[_0x6abf('0x19')][_0x6abf('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1677e9[_0x6abf('0x19')]?_0x1677e9[_0x6abf('0x19')][_0x6abf('0x1b')]||null:null,'attributes':_0x1677e9[_0x6abf('0x19')]?_0x1677e9[_0x6abf('0x19')][_0x6abf('0x1c')]||null:null,'limit':_0x1677e9[_0x6abf('0x19')]?_0x1677e9[_0x6abf('0x19')][_0x6abf('0x1d')]||null:null})['then'](function(_0x114f03){logger[_0x6abf('0xc')](_0x6abf('0x17'),_0x1677e9);logger['debug'](_0x6abf('0x17'),_0x1677e9,JSON['stringify'](_0x114f03));_0x558109(_0x114f03);})[_0x6abf('0x16')](function(_0x5c6633){logger[_0x6abf('0x12')](_0x6abf('0x17'),_0x5c6633['message'],_0x1677e9);_0x63f332(_0x231586[_0x6abf('0x12')](0x1f4,_0x5c6633[_0x6abf('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 0af362c..c45b9f1 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 _0x0c53=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util'];(function(_0x53a2e6,_0xcaff5c){var _0x4f13ac=function(_0x2c4954){while(--_0x2c4954){_0x53a2e6['push'](_0x53a2e6['shift']());}};_0x4f13ac(++_0xcaff5c);}(_0x0c53,0xfa));var _0x30c5=function(_0xe6f2eb,_0xa741ca){_0xe6f2eb=_0xe6f2eb-0x0;var _0x463bb2=_0x0c53[_0xe6f2eb];return _0x463bb2;};'use strict';var multer=require(_0x30c5('0x0'));var util=require(_0x30c5('0x1'));var path=require(_0x30c5('0x2'));var timeout=require(_0x30c5('0x3'));var express=require(_0x30c5('0x4'));var router=express['Router']();var auth=require(_0x30c5('0x5'));var interaction=require(_0x30c5('0x6'));var config=require('../../config/environment');var controller=require(_0x30c5('0x7'));router[_0x30c5('0x8')]('/',auth[_0x30c5('0x9')](),controller[_0x30c5('0xa')]);router[_0x30c5('0x8')](_0x30c5('0xb'),auth[_0x30c5('0x9')](),controller[_0x30c5('0xc')]);router['post']('/',auth[_0x30c5('0x9')](),controller[_0x30c5('0xd')]);router[_0x30c5('0xe')](_0x30c5('0xb'),auth['isAuthenticated'](),controller[_0x30c5('0xf')]);router[_0x30c5('0x10')](_0x30c5('0xb'),auth[_0x30c5('0x9')](),controller[_0x30c5('0x11')]);module['exports']=router; \ No newline at end of file +var _0xcd78=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0xa1d334,_0x42413f){var _0x477792=function(_0x3ca31d){while(--_0x3ca31d){_0xa1d334['push'](_0xa1d334['shift']());}};_0x477792(++_0x42413f);}(_0xcd78,0xf0));var _0x8cd7=function(_0x2e5394,_0x1491f5){_0x2e5394=_0x2e5394-0x0;var _0x165e2a=_0xcd78[_0x2e5394];return _0x165e2a;};'use strict';var multer=require(_0x8cd7('0x0'));var util=require(_0x8cd7('0x1'));var path=require(_0x8cd7('0x2'));var timeout=require(_0x8cd7('0x3'));var express=require(_0x8cd7('0x4'));var router=express[_0x8cd7('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x8cd7('0x6'));var config=require(_0x8cd7('0x7'));var controller=require('./faxApplication.controller');router[_0x8cd7('0x8')]('/',auth[_0x8cd7('0x9')](),controller[_0x8cd7('0xa')]);router[_0x8cd7('0x8')](_0x8cd7('0xb'),auth[_0x8cd7('0x9')](),controller[_0x8cd7('0xc')]);router[_0x8cd7('0xd')]('/',auth['isAuthenticated'](),controller[_0x8cd7('0xe')]);router['put'](_0x8cd7('0xb'),auth[_0x8cd7('0x9')](),controller[_0x8cd7('0xf')]);router['delete'](_0x8cd7('0xb'),auth[_0x8cd7('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index cd30a03..624db7c 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 _0xabc7=['ENUM','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x1d1c29,_0x434865){var _0x14412a=function(_0x320d49){while(--_0x320d49){_0x1d1c29['push'](_0x1d1c29['shift']());}};_0x14412a(++_0x434865);}(_0xabc7,0xc7));var _0x7abc=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xabc7[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x7abc('0x0'));module[_0x7abc('0x1')]={'closed':{'type':Sequelize[_0x7abc('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7abc('0x3')]},'note':{'type':Sequelize[_0x7abc('0x3')]},'read1stAt':{'type':Sequelize[_0x7abc('0x4')]},'fax':{'type':Sequelize[_0x7abc('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7abc('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x7abc('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x740d=['sequelize','exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x5d049e,_0x28cb67){var _0x42bff9=function(_0x3d19d5){while(--_0x3d19d5){_0x5d049e['push'](_0x5d049e['shift']());}};_0x42bff9(++_0x28cb67);}(_0x740d,0x1dc));var _0xd740=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x740d[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd740('0x0'));module[_0xd740('0x1')]={'closed':{'type':Sequelize[_0xd740('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd740('0x3')]},'note':{'type':Sequelize[_0xd740('0x3')]},'read1stAt':{'type':Sequelize[_0xd740('0x4')]},'fax':{'type':Sequelize[_0xd740('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xd740('0x5')]('in',_0xd740('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd740('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xd740('0x5')]('in','out'),'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 0b321ec..cf42614 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 _0x4c58=['catch','show','params','find','create','body','describe','addMessage','ids','getMessages','hasOwnProperty','filter','map','$gte','split','count','addTags','setTags','omit','spread','Tag','findAll','emit','removeTags','download','unix','toString','join','server','files','attachments','root','format','Attachment','basename','existsSync','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','limit','Content-Range','json','reject','update','then','destroy','error','name','send','index','FaxInteraction','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','type','key','VIRTUAL','field','merge','options','include','tag','push','Tags','distinct','Messages','createdAt','includeAll','User','Users','Contact','Owner','fullname','internal','FaxAccount','Account','FaxMessage','direction','read','color'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x4c58,0x113));var _0x84c5=function(_0x8969d2,_0x387a4d){_0x8969d2=_0x8969d2-0x0;var _0x7982df=_0x4c58[_0x8969d2];return _0x7982df;};'use strict';var pdf=require(_0x84c5('0x0'));var emlformat=require(_0x84c5('0x1'));var rimraf=require(_0x84c5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x84c5('0x3'));var rp=require('request-promise');var moment=require(_0x84c5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x84c5('0x5'));var path=require('path');var sox=require(_0x84c5('0x6'));var csv=require(_0x84c5('0x7'));var ejs=require(_0x84c5('0x8'));var fs=require('fs');var _=require(_0x84c5('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x84c5('0xa'));var toCsv=require(_0x84c5('0x7'));var querystring=require(_0x84c5('0xb'));var Papa=require(_0x84c5('0xc'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x84c5('0xd'));var qs=require(_0x84c5('0xe'));var logger=require(_0x84c5('0xf'))('api');var utils=require(_0x84c5('0x10'));var config=require(_0x84c5('0x11'));var db=require(_0x84c5('0x12'))['db'];config[_0x84c5('0x13')]=_[_0x84c5('0x14')](config['redis'],{'host':_0x84c5('0x15'),'port':0x18eb});var socket=require(_0x84c5('0x16'))(new Redis(config[_0x84c5('0x13')]));require('./faxInteraction.socket')[_0x84c5('0x17')](socket);function respondWithStatusCode(_0x327941,_0x1b0f3b){_0x1b0f3b=_0x1b0f3b||0xcc;return function(_0x45332b){if(_0x45332b){return _0x327941[_0x84c5('0x18')](_0x1b0f3b);}return _0x327941[_0x84c5('0x19')](_0x1b0f3b)['end']();};}function respondWithResult(_0x5230ac,_0x443dc4){_0x443dc4=_0x443dc4||0xc8;return function(_0x54d0ee){if(_0x54d0ee){return _0x5230ac[_0x84c5('0x19')](_0x443dc4)['json'](_0x54d0ee);}};}function respondWithFilteredResult(_0x120d05,_0x12ae5a){return function(_0x127596){if(_0x127596){var _0x3c2879=_0x127596['count'],_0x1aecad=_0x12ae5a[_0x84c5('0x1a')],_0x3f53da=_0x12ae5a[_0x84c5('0x1a')]+_0x12ae5a[_0x84c5('0x1b')],_0x11b858;if(_0x3f53da>=_0x3c2879){_0x3f53da=_0x3c2879;_0x11b858=0xc8;}else{_0x11b858=0xce;}_0x120d05[_0x84c5('0x19')](_0x11b858);return _0x120d05['set'](_0x84c5('0x1c'),_0x1aecad+'-'+_0x3f53da+'/'+_0x3c2879)[_0x84c5('0x1d')](_0x127596);}return null;};}function patchUpdates(_0x2facad){return function(_0x1795fb){try{jsonpatch['apply'](_0x1795fb,_0x2facad,!![]);}catch(_0x414a71){return BPromise[_0x84c5('0x1e')](_0x414a71);}return _0x1795fb['save']();};}function saveUpdates(_0x3d7e6,_0x1eedd8){return function(_0x2397a6){if(_0x2397a6){return _0x2397a6[_0x84c5('0x1f')](_0x3d7e6)[_0x84c5('0x20')](function(_0x4d6584){return _0x4d6584;});}return null;};}function removeEntity(_0xf82534,_0x211ee7){return function(_0x422f30){if(_0x422f30){return _0x422f30[_0x84c5('0x21')]()[_0x84c5('0x20')](function(){_0xf82534[_0x84c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b3b1f,_0x399427){return function(_0x51e16b){if(!_0x51e16b){_0x4b3b1f['sendStatus'](0x194);}return _0x51e16b;};}function handleError(_0x34e743,_0xecdecc){_0xecdecc=_0xecdecc||0x1f4;return function(_0x51d64e){logger[_0x84c5('0x22')](_0x51d64e['stack']);if(_0x51d64e[_0x84c5('0x23')]){delete _0x51d64e[_0x84c5('0x23')];}_0x34e743[_0x84c5('0x19')](_0xecdecc)[_0x84c5('0x24')](_0x51d64e);};}exports[_0x84c5('0x25')]=function(_0x315636,_0x35757f){var _0x599616={},_0x2d30cb={},_0x282bac={'count':0x0,'rows':[]};var _0x56d0c0=db[_0x84c5('0x26')][_0x84c5('0x27')];_0x2d30cb[_0x84c5('0x28')]=_[_0x84c5('0x29')](_0x56d0c0);_0x2d30cb[_0x84c5('0x2a')]=_['keys'](_0x315636[_0x84c5('0x2a')]);_0x2d30cb[_0x84c5('0x2b')]=_['intersection'](_0x2d30cb['model'],_0x2d30cb[_0x84c5('0x2a')]);_0x599616['attributes']=_[_0x84c5('0x2c')](_0x2d30cb[_0x84c5('0x28')],qs[_0x84c5('0x2d')](_0x315636['query']['fields']));_0x599616[_0x84c5('0x2e')]=_0x599616['attributes'][_0x84c5('0x2f')]?_0x599616[_0x84c5('0x2e')]:_0x2d30cb[_0x84c5('0x28')];if(!_0x315636[_0x84c5('0x2a')]['hasOwnProperty'](_0x84c5('0x30'))){_0x599616[_0x84c5('0x1b')]=qs[_0x84c5('0x1b')](_0x315636[_0x84c5('0x2a')][_0x84c5('0x1b')]);_0x599616['offset']=qs[_0x84c5('0x1a')](_0x315636[_0x84c5('0x2a')][_0x84c5('0x1a')]);}_0x599616[_0x84c5('0x31')]=qs[_0x84c5('0x32')](_0x315636[_0x84c5('0x2a')][_0x84c5('0x32')]);_0x599616[_0x84c5('0x33')]=qs[_0x84c5('0x2b')](_[_0x84c5('0x34')](_0x315636[_0x84c5('0x2a')],_0x2d30cb[_0x84c5('0x2b')]));if(_0x315636[_0x84c5('0x2a')]['filter']){_0x599616[_0x84c5('0x33')]=_['merge'](_0x599616[_0x84c5('0x33')],{'$or':_['map'](_0x56d0c0,function(_0x160c6f){if(_0x160c6f[_0x84c5('0x35')][_0x84c5('0x36')]!==_0x84c5('0x37')){var _0x548c03={};_0x548c03[_0x160c6f[_0x84c5('0x38')]]={'$like':'%'+_0x315636[_0x84c5('0x2a')]['filter']+'%'};return _0x548c03;}})});}_0x599616=_[_0x84c5('0x39')]({},_0x599616,_0x315636[_0x84c5('0x3a')]);var _0x370e18={'where':_0x599616[_0x84c5('0x33')]};_0x370e18[_0x84c5('0x3b')]=[];if(_0x315636[_0x84c5('0x2a')][_0x84c5('0x3c')]){_0x370e18['include'][_0x84c5('0x3d')]({'model':db['Tag'],'as':_0x84c5('0x3e'),'attributes':['id'],'where':{'id':_0x315636[_0x84c5('0x2a')]['tag']},'required':!![]});_0x370e18[_0x84c5('0x3f')]=!![];}if(_0x315636['query']['read']){_0x370e18[_0x84c5('0x3b')][_0x84c5('0x3d')]({'model':db['FaxMessage'],'as':_0x84c5('0x40'),'attributes':['id','direction',_0x84c5('0x41'),'read'],'where':{'direction':'in','read':_0x315636[_0x84c5('0x2a')]['read']||![]},'required':!![]});_0x370e18[_0x84c5('0x3f')]=!![];}return db[_0x84c5('0x26')]['count'](_0x370e18)['then'](function(_0x5d22fe){_0x282bac['count']=_0x5d22fe;if(_0x315636['query'][_0x84c5('0x42')]){_0x599616[_0x84c5('0x3b')]=[{'model':db[_0x84c5('0x43')],'as':_0x84c5('0x44'),'required':![],'attributes':['id',_0x84c5('0x23'),'fullname']},{'model':db['CmContact'],'as':_0x84c5('0x45'),'required':![]},{'model':db['User'],'as':_0x84c5('0x46'),'attributes':['name',_0x84c5('0x47'),_0x84c5('0x48')],'required':![]},{'model':db[_0x84c5('0x49')],'as':_0x84c5('0x4a'),'attributes':[_0x84c5('0x23'),_0x84c5('0x36')],'required':![]},{'model':db[_0x84c5('0x4b')],'as':'Messages','attributes':['id',_0x84c5('0x4c'),_0x84c5('0x41'),_0x84c5('0x4d')],'where':{'direction':'in','read':_0x315636[_0x84c5('0x2a')][_0x84c5('0x4d')]||![]},'required':_0x315636[_0x84c5('0x2a')][_0x84c5('0x4d')]||![]},{'model':db['Tag'],'as':_0x84c5('0x3e'),'attributes':['id',_0x84c5('0x23'),_0x84c5('0x4e')],'required':_0x315636[_0x84c5('0x2a')][_0x84c5('0x3c')]?!![]:![]},{'model':db['Tag'],'as':'ThroughTags','attributes':['id',_0x84c5('0x23'),_0x84c5('0x4e')],'through':_0x315636['query'][_0x84c5('0x3c')]?{'attributes':[],'where':{'TagId':_0x315636['query']['tag']||undefined}}:{},'required':_0x315636[_0x84c5('0x2a')][_0x84c5('0x3c')]?!![]:![]}];}return db[_0x84c5('0x26')]['findAll'](_0x599616);})[_0x84c5('0x20')](function(_0x213c81){_0x282bac['rows']=_0x213c81;return _0x282bac;})[_0x84c5('0x20')](respondWithFilteredResult(_0x35757f,_0x599616))[_0x84c5('0x4f')](handleError(_0x35757f,null));};exports[_0x84c5('0x50')]=function(_0x88602c,_0x58a020){var _0x21e5eb={'raw':![],'where':{'id':_0x88602c[_0x84c5('0x51')]['id']}},_0xa7a10f={};_0xa7a10f[_0x84c5('0x28')]=_[_0x84c5('0x29')](db[_0x84c5('0x26')][_0x84c5('0x27')]);_0xa7a10f['query']=_[_0x84c5('0x29')](_0x88602c[_0x84c5('0x2a')]);_0xa7a10f['filters']=_['intersection'](_0xa7a10f[_0x84c5('0x28')],_0xa7a10f[_0x84c5('0x2a')]);_0x21e5eb[_0x84c5('0x2e')]=_[_0x84c5('0x2c')](_0xa7a10f[_0x84c5('0x28')],qs[_0x84c5('0x2d')](_0x88602c[_0x84c5('0x2a')]['fields']));_0x21e5eb[_0x84c5('0x2e')]=_0x21e5eb['attributes'][_0x84c5('0x2f')]?_0x21e5eb['attributes']:_0xa7a10f[_0x84c5('0x28')];if(_0x88602c['query'][_0x84c5('0x42')]){_0x21e5eb[_0x84c5('0x3b')]=[{'all':!![]}];}_0x21e5eb=_[_0x84c5('0x39')]({},_0x21e5eb,_0x88602c[_0x84c5('0x3a')]);return db[_0x84c5('0x26')][_0x84c5('0x52')](_0x21e5eb)[_0x84c5('0x20')](handleEntityNotFound(_0x58a020,null))[_0x84c5('0x20')](respondWithResult(_0x58a020,null))[_0x84c5('0x4f')](handleError(_0x58a020,null));};exports['create']=function(_0x232fed,_0x2a6b25){return db[_0x84c5('0x26')][_0x84c5('0x53')](_0x232fed[_0x84c5('0x54')],{})[_0x84c5('0x20')](respondWithResult(_0x2a6b25,0xc9))[_0x84c5('0x4f')](handleError(_0x2a6b25,null));};exports[_0x84c5('0x1f')]=function(_0x5e232d,_0x570a71){if(_0x5e232d['body']['id']){delete _0x5e232d[_0x84c5('0x54')]['id'];}return db['FaxInteraction'][_0x84c5('0x52')]({'where':{'id':_0x5e232d['params']['id']}})['then'](handleEntityNotFound(_0x570a71,null))[_0x84c5('0x20')](saveUpdates(_0x5e232d['body'],null))['then'](respondWithResult(_0x570a71,null))[_0x84c5('0x4f')](handleError(_0x570a71,null));};exports[_0x84c5('0x21')]=function(_0x14e711,_0x41eec1){return db[_0x84c5('0x26')]['find']({'where':{'id':_0x14e711[_0x84c5('0x51')]['id']}})['then'](handleEntityNotFound(_0x41eec1,null))[_0x84c5('0x20')](removeEntity(_0x41eec1,null))[_0x84c5('0x4f')](handleError(_0x41eec1,null));};exports['describe']=function(_0x521e8b,_0x1148ea){return db[_0x84c5('0x26')][_0x84c5('0x55')]()[_0x84c5('0x20')](respondWithResult(_0x1148ea,null))[_0x84c5('0x4f')](handleError(_0x1148ea,null));};exports[_0x84c5('0x56')]=function(_0x42719b,_0x5d3bd4,_0xcefe51){return db['FaxMessage']['find']({'where':{'id':_0x42719b[_0x84c5('0x51')]['id']}})[_0x84c5('0x20')](handleEntityNotFound(_0x5d3bd4,null))['then'](function(_0xca5f83){if(_0xca5f83){return _0xca5f83[_0x84c5('0x56')](_0x42719b[_0x84c5('0x54')]['ids'],_['omit'](_0x42719b[_0x84c5('0x54')],[_0x84c5('0x57'),'id'])||{});}})[_0x84c5('0x20')](respondWithResult(_0x5d3bd4,null))[_0x84c5('0x4f')](handleError(_0x5d3bd4,null));};exports[_0x84c5('0x58')]=function(_0x31877c,_0x4768d6,_0x5cd021){var _0x15d97f={'raw':![],'where':{}};var _0x52d2fb={};var _0x23f803={'count':0x0,'rows':[]};return db[_0x84c5('0x26')]['findOne']({'where':{'id':_0x31877c[_0x84c5('0x51')]['id']}})[_0x84c5('0x20')](handleEntityNotFound(_0x4768d6,null))['then'](function(_0x4f241d){if(_0x4f241d){_0x52d2fb[_0x84c5('0x28')]=_['keys'](db[_0x84c5('0x4b')][_0x84c5('0x27')]);_0x52d2fb[_0x84c5('0x2a')]=_[_0x84c5('0x29')](_0x31877c[_0x84c5('0x2a')]);_0x52d2fb[_0x84c5('0x2b')]=_[_0x84c5('0x2c')](_0x52d2fb[_0x84c5('0x28')],_0x52d2fb[_0x84c5('0x2a')]);_0x15d97f[_0x84c5('0x2e')]=_['intersection'](_0x52d2fb['model'],qs[_0x84c5('0x2d')](_0x31877c[_0x84c5('0x2a')][_0x84c5('0x2d')]));_0x15d97f[_0x84c5('0x2e')]=_0x15d97f[_0x84c5('0x2e')]['length']?_0x15d97f[_0x84c5('0x2e')]:_0x52d2fb[_0x84c5('0x28')];if(!_0x31877c['query'][_0x84c5('0x59')](_0x84c5('0x30'))){_0x15d97f[_0x84c5('0x1b')]=qs['limit'](_0x31877c[_0x84c5('0x2a')][_0x84c5('0x1b')]);_0x15d97f[_0x84c5('0x1a')]=qs[_0x84c5('0x1a')](_0x31877c[_0x84c5('0x2a')][_0x84c5('0x1a')]);}_0x15d97f[_0x84c5('0x31')]=qs['sort'](_0x31877c['query'][_0x84c5('0x32')]);_0x15d97f['where']=qs['filters'](_[_0x84c5('0x34')](_0x31877c[_0x84c5('0x2a')],_0x52d2fb[_0x84c5('0x2b')]));_0x15d97f[_0x84c5('0x33')]['FaxInteractionId']=_0x4f241d['id'];if(_0x31877c[_0x84c5('0x2a')][_0x84c5('0x5a')]){_0x15d97f[_0x84c5('0x33')]=_[_0x84c5('0x39')](_0x15d97f[_0x84c5('0x33')],{'$or':_[_0x84c5('0x5b')](_0x15d97f[_0x84c5('0x2e')],function(_0x1b63fe){var _0x426dfa={};_0x426dfa[_0x1b63fe]={'$like':'%'+_0x31877c[_0x84c5('0x2a')][_0x84c5('0x5a')]+'%'};return _0x426dfa;})});}if(_0x31877c['query'][_0x84c5('0x5c')]){var _0x250416=_0x31877c[_0x84c5('0x2a')][_0x84c5('0x5c')][_0x84c5('0x5d')](',');var _0x476d42={};_0x476d42[_0x250416[0x0]]={'$gte':moment(_0x250416[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x15d97f[_0x84c5('0x33')]=_['merge'](_0x15d97f[_0x84c5('0x33')],_0x476d42);}_0x15d97f=_[_0x84c5('0x39')]({},_0x15d97f,_0x31877c[_0x84c5('0x3a')]);return db[_0x84c5('0x4b')]['count']({'where':_0x15d97f[_0x84c5('0x33')]})[_0x84c5('0x20')](function(_0x18b107){_0x23f803[_0x84c5('0x5e')]=_0x18b107;if(_0x31877c[_0x84c5('0x2a')][_0x84c5('0x42')]){_0x15d97f[_0x84c5('0x3b')]=[{'all':!![]}];}return db[_0x84c5('0x4b')]['findAll'](_0x15d97f);})[_0x84c5('0x20')](function(_0x534d5e){_0x23f803['rows']=_0x534d5e;return _0x23f803;});}})[_0x84c5('0x20')](respondWithFilteredResult(_0x4768d6,_0x15d97f))[_0x84c5('0x4f')](handleError(_0x4768d6,null));};exports[_0x84c5('0x5f')]=function(_0x376985,_0x22dbac,_0x125fb5){return db[_0x84c5('0x26')][_0x84c5('0x52')]({'where':{'id':_0x376985[_0x84c5('0x51')]['id']}})['then'](handleEntityNotFound(_0x22dbac,null))['then'](function(_0x32d0f5){if(_0x32d0f5){return _0x32d0f5[_0x84c5('0x60')](_0x376985[_0x84c5('0x54')][_0x84c5('0x57')],_[_0x84c5('0x61')](_0x376985[_0x84c5('0x54')],[_0x84c5('0x57'),'id'])||{})[_0x84c5('0x62')](function(){return db[_0x84c5('0x63')][_0x84c5('0x64')]({'attributes':['id',_0x84c5('0x23'),'color'],'where':{'id':_0x376985[_0x84c5('0x54')][_0x84c5('0x57')]}});})[_0x84c5('0x20')](function(_0x584a67){socket[_0x84c5('0x65')]('faxInteractionTags:save',{'id':Number(_0x376985['params']['id']),'tags':_0x584a67||[]});return{'id':Number(_0x376985[_0x84c5('0x51')]['id']),'tags':_0x584a67||[]};});}})[_0x84c5('0x20')](respondWithResult(_0x22dbac,null))['catch'](handleError(_0x22dbac,null));};exports[_0x84c5('0x66')]=function(_0x3ccb5f,_0x2ee592,_0x59e65b){var _0x14c7bc;return db[_0x84c5('0x26')][_0x84c5('0x52')]({'where':{'id':_0x3ccb5f[_0x84c5('0x51')]['id']}})[_0x84c5('0x20')](handleEntityNotFound(_0x2ee592,null))['then'](function(_0x526df6){if(_0x526df6){return _0x526df6[_0x84c5('0x66')](_0x3ccb5f['query'][_0x84c5('0x57')]);}})[_0x84c5('0x20')](respondWithStatusCode(_0x2ee592,null))['catch'](handleError(_0x2ee592,null));};exports[_0x84c5('0x67')]=function(_0x1b461a,_0x5d8956){var _0x20c3b0=moment()[_0x84c5('0x68')]()[_0x84c5('0x69')]();var _0x35e71a=path[_0x84c5('0x6a')](config['root'],_0x84c5('0x6b'),_0x84c5('0x6c'),_0x84c5('0x6d'));var _0x5d6e37=path['join'](config[_0x84c5('0x6e')],_0x84c5('0x6b'),_0x84c5('0x6c'),'tmp');var _0x2e67f9=path[_0x84c5('0x6a')](_0x5d6e37,_0x20c3b0);var _0x4dd04c=util[_0x84c5('0x6f')]('interaction-%s.zip',_0x20c3b0);var _0x1fea59=path['join'](_0x5d6e37,_0x4dd04c);var _0x186bce=![];return db[_0x84c5('0x26')][_0x84c5('0x52')]({'where':{'id':_0x1b461a['params']['id']}})[_0x84c5('0x20')](handleEntityNotFound(_0x5d8956,null))[_0x84c5('0x20')](function(_0x547023){if(_0x547023){return _0x547023[_0x84c5('0x58')]({'attributes':['id',_0x84c5('0x54'),_0x84c5('0x41')],'include':[{'model':db[_0x84c5('0x70')],'as':_0x84c5('0x70')}]});}return[];})['then'](function(_0x384665){_0x186bce=_0x384665['length'];if(_0x384665[_0x84c5('0x2f')]){fs['mkdirSync'](_0x2e67f9);for(var _0xfc4e0d=0x0;_0xfc4e0d<_0x384665[_0x84c5('0x2f')];_0xfc4e0d++){var _0x2aa443=_0x384665[_0xfc4e0d];var _0x2538e5=_0x2aa443[_0x84c5('0x70')];if(_0x2538e5){var _0x47f5fd=path[_0x84c5('0x6a')](_0x35e71a,_0x2538e5[_0x84c5('0x71')]);if(fs[_0x84c5('0x72')](_0x47f5fd)){fs['createReadStream'](_0x47f5fd)['pipe'](fs['createWriteStream'](path[_0x84c5('0x6a')](_0x2e67f9,_0x2538e5[_0x84c5('0x71')])));}}}}})[_0x84c5('0x20')](function(){if(_0x186bce){return new BPromise(function(_0x6bd67d,_0x3cf1b6){zipdir(_0x2e67f9,{'saveTo':_0x1fea59},function(_0x1cf957,_0x511f10){if(_0x1cf957)return _0x3cf1b6(_0x1cf957);return _0x6bd67d(_0x511f10);});});}})[_0x84c5('0x20')](function(){if(_0x186bce){return new BPromise(function(_0x3932ae,_0x2e3cc8){rimraf(_0x2e67f9,function(_0x2e4af8){if(_0x2e4af8)_0x2e3cc8(_0x2e4af8);return _0x3932ae();});});}})[_0x84c5('0x20')](function(){if(_0x186bce){return _0x5d8956[_0x84c5('0x67')](_0x1fea59,_0x4dd04c,function(_0x52900e){if(_0x52900e){console[_0x84c5('0x73')](_0x84c5('0x74'),_0x52900e);}else{fs[_0x84c5('0x75')](_0x1fea59);}});}else{return _0x5d8956[_0x84c5('0x18')](0xc8);}})[_0x84c5('0x4f')](handleError(_0x5d8956,null));}; \ No newline at end of file +var _0x2507=['querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','FaxInteraction','rawAttributes','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','field','filter','options','include','push','Tag','Tags','tag','read','FaxMessage','direction','createdAt','then','includeAll','User','Users','fullname','CmContact','Contact','Owner','internal','FaxAccount','Account','key','color','ThroughTags','rows','catch','show','find','create','body','params','describe','addMessage','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','ids','omit','spread','findAll','faxInteractionTags:save','removeTags','unix','toString','join','root','server','files','tmp','interaction-%s.zip','Attachment','mkdirSync','createReadStream','pipe','createWriteStream','basename','download','err','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js'];(function(_0x4b26b6,_0x594d07){var _0x48301c=function(_0x161899){while(--_0x161899){_0x4b26b6['push'](_0x4b26b6['shift']());}};_0x48301c(++_0x594d07);}(_0x2507,0x1f1));var _0x7250=function(_0xc75431,_0xd2c128){_0xc75431=_0xc75431-0x0;var _0xdc376b=_0x2507[_0xc75431];return _0xdc376b;};'use strict';var pdf=require(_0x7250('0x0'));var emlformat=require(_0x7250('0x1'));var rimraf=require(_0x7250('0x2'));var zipdir=require(_0x7250('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7250('0x4'));var BPromise=require(_0x7250('0x5'));var Mustache=require(_0x7250('0x6'));var util=require(_0x7250('0x7'));var path=require(_0x7250('0x8'));var sox=require(_0x7250('0x9'));var csv=require(_0x7250('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7250('0xb'));var squel=require(_0x7250('0xc'));var crypto=require(_0x7250('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7250('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7250('0xf'));var Papa=require(_0x7250('0x10'));var authService=require(_0x7250('0x11'));var hardwareService=require(_0x7250('0x12'));var Redis=require(_0x7250('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x7250('0x14'))(_0x7250('0x15'));var utils=require(_0x7250('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7250('0x17')]=_['defaults'](config[_0x7250('0x17')],{'host':_0x7250('0x18'),'port':0x18eb});var socket=require(_0x7250('0x19'))(new Redis(config['redis']));require(_0x7250('0x1a'))[_0x7250('0x1b')](socket);function respondWithStatusCode(_0x588004,_0x4d66d6){_0x4d66d6=_0x4d66d6||0xcc;return function(_0x3b2b16){if(_0x3b2b16){return _0x588004[_0x7250('0x1c')](_0x4d66d6);}return _0x588004[_0x7250('0x1d')](_0x4d66d6)['end']();};}function respondWithResult(_0x3ed512,_0x5daeab){_0x5daeab=_0x5daeab||0xc8;return function(_0xa58130){if(_0xa58130){return _0x3ed512['status'](_0x5daeab)[_0x7250('0x1e')](_0xa58130);}};}function respondWithFilteredResult(_0x2ebb52,_0x1c09be){return function(_0x1e4009){if(_0x1e4009){var _0x587630=_0x1e4009[_0x7250('0x1f')],_0x1ce8d0=_0x1c09be['offset'],_0x527090=_0x1c09be[_0x7250('0x20')]+_0x1c09be[_0x7250('0x21')],_0x2796fd;if(_0x527090>=_0x587630){_0x527090=_0x587630;_0x2796fd=0xc8;}else{_0x2796fd=0xce;}_0x2ebb52[_0x7250('0x1d')](_0x2796fd);return _0x2ebb52[_0x7250('0x22')](_0x7250('0x23'),_0x1ce8d0+'-'+_0x527090+'/'+_0x587630)[_0x7250('0x1e')](_0x1e4009);}return null;};}function patchUpdates(_0x2e01a3){return function(_0x584e7d){try{jsonpatch[_0x7250('0x24')](_0x584e7d,_0x2e01a3,!![]);}catch(_0x21dfdf){return BPromise[_0x7250('0x25')](_0x21dfdf);}return _0x584e7d[_0x7250('0x26')]();};}function saveUpdates(_0x29941b,_0x54e0df){return function(_0x5bf14e){if(_0x5bf14e){return _0x5bf14e[_0x7250('0x27')](_0x29941b)['then'](function(_0x9701dc){return _0x9701dc;});}return null;};}function removeEntity(_0x20ec35,_0x420a14){return function(_0x2d44de){if(_0x2d44de){return _0x2d44de[_0x7250('0x28')]()['then'](function(){_0x20ec35[_0x7250('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b045f,_0x52b947){return function(_0x26611c){if(!_0x26611c){_0x2b045f[_0x7250('0x1c')](0x194);}return _0x26611c;};}function handleError(_0x5a9522,_0x5def81){_0x5def81=_0x5def81||0x1f4;return function(_0x27c059){logger[_0x7250('0x29')](_0x27c059[_0x7250('0x2a')]);if(_0x27c059[_0x7250('0x2b')]){delete _0x27c059[_0x7250('0x2b')];}_0x5a9522['status'](_0x5def81)[_0x7250('0x2c')](_0x27c059);};}exports['index']=function(_0x1173d6,_0x3bdafa){var _0x516644={},_0x376bbe={},_0xd45d01={'count':0x0,'rows':[]};var _0x3bdfbd=db[_0x7250('0x2d')][_0x7250('0x2e')];_0x376bbe['model']=_['keys'](_0x3bdfbd);_0x376bbe['query']=_[_0x7250('0x2f')](_0x1173d6['query']);_0x376bbe[_0x7250('0x30')]=_[_0x7250('0x31')](_0x376bbe['model'],_0x376bbe[_0x7250('0x32')]);_0x516644[_0x7250('0x33')]=_[_0x7250('0x31')](_0x376bbe[_0x7250('0x34')],qs[_0x7250('0x35')](_0x1173d6['query'][_0x7250('0x35')]));_0x516644[_0x7250('0x33')]=_0x516644[_0x7250('0x33')][_0x7250('0x36')]?_0x516644['attributes']:_0x376bbe['model'];if(!_0x1173d6[_0x7250('0x32')][_0x7250('0x37')](_0x7250('0x38'))){_0x516644[_0x7250('0x21')]=qs['limit'](_0x1173d6['query']['limit']);_0x516644[_0x7250('0x20')]=qs['offset'](_0x1173d6[_0x7250('0x32')][_0x7250('0x20')]);}_0x516644[_0x7250('0x39')]=qs[_0x7250('0x3a')](_0x1173d6[_0x7250('0x32')]['sort']);_0x516644[_0x7250('0x3b')]=qs['filters'](_[_0x7250('0x3c')](_0x1173d6['query'],_0x376bbe[_0x7250('0x30')]));if(_0x1173d6[_0x7250('0x32')]['filter']){_0x516644[_0x7250('0x3b')]=_[_0x7250('0x3d')](_0x516644[_0x7250('0x3b')],{'$or':_[_0x7250('0x3e')](_0x3bdfbd,function(_0x542958){if(_0x542958[_0x7250('0x3f')]['key']!==_0x7250('0x40')){var _0x18ae79={};_0x18ae79[_0x542958[_0x7250('0x41')]]={'$like':'%'+_0x1173d6[_0x7250('0x32')][_0x7250('0x42')]+'%'};return _0x18ae79;}})});}_0x516644=_['merge']({},_0x516644,_0x1173d6[_0x7250('0x43')]);var _0x5a734b={'where':_0x516644[_0x7250('0x3b')]};_0x5a734b[_0x7250('0x44')]=[];if(_0x1173d6['query']['tag']){_0x5a734b[_0x7250('0x44')][_0x7250('0x45')]({'model':db[_0x7250('0x46')],'as':_0x7250('0x47'),'attributes':['id'],'where':{'id':_0x1173d6[_0x7250('0x32')][_0x7250('0x48')]},'required':!![]});_0x5a734b['distinct']=!![];}if(_0x1173d6[_0x7250('0x32')][_0x7250('0x49')]){_0x5a734b[_0x7250('0x44')][_0x7250('0x45')]({'model':db[_0x7250('0x4a')],'as':'Messages','attributes':['id',_0x7250('0x4b'),_0x7250('0x4c'),'read'],'where':{'direction':'in','read':_0x1173d6[_0x7250('0x32')][_0x7250('0x49')]||![]},'required':!![]});_0x5a734b['distinct']=!![];}return db[_0x7250('0x2d')][_0x7250('0x1f')](_0x5a734b)[_0x7250('0x4d')](function(_0x1f16ff){_0xd45d01[_0x7250('0x1f')]=_0x1f16ff;if(_0x1173d6['query'][_0x7250('0x4e')]){_0x516644['include']=[{'model':db[_0x7250('0x4f')],'as':_0x7250('0x50'),'required':![],'attributes':['id',_0x7250('0x2b'),_0x7250('0x51')]},{'model':db[_0x7250('0x52')],'as':_0x7250('0x53'),'required':![]},{'model':db[_0x7250('0x4f')],'as':_0x7250('0x54'),'attributes':[_0x7250('0x2b'),'fullname',_0x7250('0x55')],'required':![]},{'model':db[_0x7250('0x56')],'as':_0x7250('0x57'),'attributes':[_0x7250('0x2b'),_0x7250('0x58')],'required':![]},{'model':db[_0x7250('0x4a')],'as':'Messages','attributes':['id','direction','createdAt',_0x7250('0x49')],'where':{'direction':'in','read':_0x1173d6[_0x7250('0x32')]['read']||![]},'required':_0x1173d6[_0x7250('0x32')][_0x7250('0x49')]||![]},{'model':db[_0x7250('0x46')],'as':_0x7250('0x47'),'attributes':['id',_0x7250('0x2b'),_0x7250('0x59')],'required':_0x1173d6[_0x7250('0x32')]['tag']?!![]:![]},{'model':db['Tag'],'as':_0x7250('0x5a'),'attributes':['id',_0x7250('0x2b'),'color'],'through':_0x1173d6[_0x7250('0x32')]['tag']?{'attributes':[],'where':{'TagId':_0x1173d6[_0x7250('0x32')]['tag']||undefined}}:{},'required':_0x1173d6[_0x7250('0x32')][_0x7250('0x48')]?!![]:![]}];}return db[_0x7250('0x2d')]['findAll'](_0x516644);})[_0x7250('0x4d')](function(_0x324b21){_0xd45d01[_0x7250('0x5b')]=_0x324b21;return _0xd45d01;})[_0x7250('0x4d')](respondWithFilteredResult(_0x3bdafa,_0x516644))[_0x7250('0x5c')](handleError(_0x3bdafa,null));};exports[_0x7250('0x5d')]=function(_0x2a78e7,_0x275621){var _0x6486f6={'raw':![],'where':{'id':_0x2a78e7['params']['id']}},_0x327151={};_0x327151[_0x7250('0x34')]=_['keys'](db['FaxInteraction']['rawAttributes']);_0x327151[_0x7250('0x32')]=_[_0x7250('0x2f')](_0x2a78e7[_0x7250('0x32')]);_0x327151['filters']=_[_0x7250('0x31')](_0x327151[_0x7250('0x34')],_0x327151['query']);_0x6486f6[_0x7250('0x33')]=_[_0x7250('0x31')](_0x327151['model'],qs[_0x7250('0x35')](_0x2a78e7[_0x7250('0x32')]['fields']));_0x6486f6[_0x7250('0x33')]=_0x6486f6[_0x7250('0x33')][_0x7250('0x36')]?_0x6486f6[_0x7250('0x33')]:_0x327151[_0x7250('0x34')];if(_0x2a78e7['query'][_0x7250('0x4e')]){_0x6486f6['include']=[{'all':!![]}];}_0x6486f6=_[_0x7250('0x3d')]({},_0x6486f6,_0x2a78e7['options']);return db['FaxInteraction'][_0x7250('0x5e')](_0x6486f6)[_0x7250('0x4d')](handleEntityNotFound(_0x275621,null))[_0x7250('0x4d')](respondWithResult(_0x275621,null))[_0x7250('0x5c')](handleError(_0x275621,null));};exports['create']=function(_0x2afcf4,_0x49de5f){return db[_0x7250('0x2d')][_0x7250('0x5f')](_0x2afcf4[_0x7250('0x60')],{})[_0x7250('0x4d')](respondWithResult(_0x49de5f,0xc9))[_0x7250('0x5c')](handleError(_0x49de5f,null));};exports[_0x7250('0x27')]=function(_0x261409,_0x204d63){if(_0x261409[_0x7250('0x60')]['id']){delete _0x261409[_0x7250('0x60')]['id'];}return db['FaxInteraction'][_0x7250('0x5e')]({'where':{'id':_0x261409['params']['id']}})['then'](handleEntityNotFound(_0x204d63,null))[_0x7250('0x4d')](saveUpdates(_0x261409[_0x7250('0x60')],null))[_0x7250('0x4d')](respondWithResult(_0x204d63,null))[_0x7250('0x5c')](handleError(_0x204d63,null));};exports[_0x7250('0x28')]=function(_0x310081,_0x1f02e3){return db[_0x7250('0x2d')]['find']({'where':{'id':_0x310081[_0x7250('0x61')]['id']}})[_0x7250('0x4d')](handleEntityNotFound(_0x1f02e3,null))[_0x7250('0x4d')](removeEntity(_0x1f02e3,null))[_0x7250('0x5c')](handleError(_0x1f02e3,null));};exports['describe']=function(_0xdb8715,_0x62fe97){return db['FaxInteraction'][_0x7250('0x62')]()['then'](respondWithResult(_0x62fe97,null))[_0x7250('0x5c')](handleError(_0x62fe97,null));};exports[_0x7250('0x63')]=function(_0x3200a1,_0x8e5a04,_0x11f768){return db['FaxMessage'][_0x7250('0x5e')]({'where':{'id':_0x3200a1[_0x7250('0x61')]['id']}})[_0x7250('0x4d')](handleEntityNotFound(_0x8e5a04,null))[_0x7250('0x4d')](function(_0x42a57b){if(_0x42a57b){return _0x42a57b['addMessage'](_0x3200a1['body']['ids'],_['omit'](_0x3200a1[_0x7250('0x60')],['ids','id'])||{});}})[_0x7250('0x4d')](respondWithResult(_0x8e5a04,null))[_0x7250('0x5c')](handleError(_0x8e5a04,null));};exports[_0x7250('0x64')]=function(_0x2063c8,_0x10ca58,_0x12ee48){var _0x257a6f={'raw':![],'where':{}};var _0x342df1={};var _0x4d059c={'count':0x0,'rows':[]};return db[_0x7250('0x2d')]['findOne']({'where':{'id':_0x2063c8[_0x7250('0x61')]['id']}})[_0x7250('0x4d')](handleEntityNotFound(_0x10ca58,null))[_0x7250('0x4d')](function(_0x378519){if(_0x378519){_0x342df1[_0x7250('0x34')]=_[_0x7250('0x2f')](db[_0x7250('0x4a')][_0x7250('0x2e')]);_0x342df1['query']=_[_0x7250('0x2f')](_0x2063c8[_0x7250('0x32')]);_0x342df1[_0x7250('0x30')]=_[_0x7250('0x31')](_0x342df1[_0x7250('0x34')],_0x342df1[_0x7250('0x32')]);_0x257a6f['attributes']=_[_0x7250('0x31')](_0x342df1['model'],qs[_0x7250('0x35')](_0x2063c8[_0x7250('0x32')][_0x7250('0x35')]));_0x257a6f[_0x7250('0x33')]=_0x257a6f[_0x7250('0x33')][_0x7250('0x36')]?_0x257a6f['attributes']:_0x342df1['model'];if(!_0x2063c8[_0x7250('0x32')]['hasOwnProperty'](_0x7250('0x38'))){_0x257a6f[_0x7250('0x21')]=qs[_0x7250('0x21')](_0x2063c8[_0x7250('0x32')][_0x7250('0x21')]);_0x257a6f[_0x7250('0x20')]=qs['offset'](_0x2063c8[_0x7250('0x32')][_0x7250('0x20')]);}_0x257a6f[_0x7250('0x39')]=qs['sort'](_0x2063c8['query'][_0x7250('0x3a')]);_0x257a6f[_0x7250('0x3b')]=qs[_0x7250('0x30')](_[_0x7250('0x3c')](_0x2063c8[_0x7250('0x32')],_0x342df1['filters']));_0x257a6f[_0x7250('0x3b')]['FaxInteractionId']=_0x378519['id'];if(_0x2063c8[_0x7250('0x32')][_0x7250('0x42')]){_0x257a6f[_0x7250('0x3b')]=_[_0x7250('0x3d')](_0x257a6f[_0x7250('0x3b')],{'$or':_[_0x7250('0x3e')](_0x257a6f[_0x7250('0x33')],function(_0x4b63b8){var _0x223f9f={};_0x223f9f[_0x4b63b8]={'$like':'%'+_0x2063c8[_0x7250('0x32')][_0x7250('0x42')]+'%'};return _0x223f9f;})});}if(_0x2063c8[_0x7250('0x32')][_0x7250('0x65')]){var _0x5acfde=_0x2063c8[_0x7250('0x32')][_0x7250('0x65')]['split'](',');var _0x2afcd6={};_0x2afcd6[_0x5acfde[0x0]]={'$gte':moment(_0x5acfde[0x1])[_0x7250('0x66')](_0x7250('0x67'))};_0x257a6f[_0x7250('0x3b')]=_[_0x7250('0x3d')](_0x257a6f['where'],_0x2afcd6);}_0x257a6f=_[_0x7250('0x3d')]({},_0x257a6f,_0x2063c8['options']);return db['FaxMessage'][_0x7250('0x1f')]({'where':_0x257a6f[_0x7250('0x3b')]})[_0x7250('0x4d')](function(_0x5546a7){_0x4d059c[_0x7250('0x1f')]=_0x5546a7;if(_0x2063c8[_0x7250('0x32')][_0x7250('0x4e')]){_0x257a6f['include']=[{'all':!![]}];}return db[_0x7250('0x4a')]['findAll'](_0x257a6f);})['then'](function(_0x1fa26d){_0x4d059c[_0x7250('0x5b')]=_0x1fa26d;return _0x4d059c;});}})['then'](respondWithFilteredResult(_0x10ca58,_0x257a6f))['catch'](handleError(_0x10ca58,null));};exports[_0x7250('0x68')]=function(_0x4b037d,_0x1ec7f8,_0x31db4f){return db[_0x7250('0x2d')][_0x7250('0x5e')]({'where':{'id':_0x4b037d['params']['id']}})[_0x7250('0x4d')](handleEntityNotFound(_0x1ec7f8,null))['then'](function(_0x31ccd7){if(_0x31ccd7){return _0x31ccd7[_0x7250('0x69')](_0x4b037d[_0x7250('0x60')][_0x7250('0x6a')],_[_0x7250('0x6b')](_0x4b037d[_0x7250('0x60')],[_0x7250('0x6a'),'id'])||{})[_0x7250('0x6c')](function(){return db[_0x7250('0x46')][_0x7250('0x6d')]({'attributes':['id',_0x7250('0x2b'),'color'],'where':{'id':_0x4b037d[_0x7250('0x60')]['ids']}});})[_0x7250('0x4d')](function(_0x531608){socket['emit'](_0x7250('0x6e'),{'id':Number(_0x4b037d['params']['id']),'tags':_0x531608||[]});return{'id':Number(_0x4b037d['params']['id']),'tags':_0x531608||[]};});}})[_0x7250('0x4d')](respondWithResult(_0x1ec7f8,null))[_0x7250('0x5c')](handleError(_0x1ec7f8,null));};exports['removeTags']=function(_0x1d21b7,_0x866b51,_0x5cec50){var _0x32fe25;return db[_0x7250('0x2d')][_0x7250('0x5e')]({'where':{'id':_0x1d21b7[_0x7250('0x61')]['id']}})[_0x7250('0x4d')](handleEntityNotFound(_0x866b51,null))[_0x7250('0x4d')](function(_0x39bc6c){if(_0x39bc6c){return _0x39bc6c[_0x7250('0x6f')](_0x1d21b7[_0x7250('0x32')][_0x7250('0x6a')]);}})[_0x7250('0x4d')](respondWithStatusCode(_0x866b51,null))['catch'](handleError(_0x866b51,null));};exports['download']=function(_0x841cd7,_0x31ca7e){var _0x11b7eb=moment()[_0x7250('0x70')]()[_0x7250('0x71')]();var _0x16baab=path[_0x7250('0x72')](config[_0x7250('0x73')],_0x7250('0x74'),_0x7250('0x75'),'attachments');var _0xc4e827=path[_0x7250('0x72')](config['root'],_0x7250('0x74'),_0x7250('0x75'),_0x7250('0x76'));var _0x5521ea=path[_0x7250('0x72')](_0xc4e827,_0x11b7eb);var _0x1e729f=util[_0x7250('0x66')](_0x7250('0x77'),_0x11b7eb);var _0x36e639=path[_0x7250('0x72')](_0xc4e827,_0x1e729f);var _0x5b279e=![];return db[_0x7250('0x2d')][_0x7250('0x5e')]({'where':{'id':_0x841cd7[_0x7250('0x61')]['id']}})[_0x7250('0x4d')](handleEntityNotFound(_0x31ca7e,null))[_0x7250('0x4d')](function(_0x266367){if(_0x266367){return _0x266367[_0x7250('0x64')]({'attributes':['id','body','createdAt'],'include':[{'model':db[_0x7250('0x78')],'as':_0x7250('0x78')}]});}return[];})[_0x7250('0x4d')](function(_0x24d367){_0x5b279e=_0x24d367[_0x7250('0x36')];if(_0x24d367[_0x7250('0x36')]){fs[_0x7250('0x79')](_0x5521ea);for(var _0x4ffc1d=0x0;_0x4ffc1d<_0x24d367['length'];_0x4ffc1d++){var _0x4c29d9=_0x24d367[_0x4ffc1d];var _0x4180e1=_0x4c29d9[_0x7250('0x78')];if(_0x4180e1){var _0x324cf6=path[_0x7250('0x72')](_0x16baab,_0x4180e1['basename']);if(fs['existsSync'](_0x324cf6)){fs[_0x7250('0x7a')](_0x324cf6)[_0x7250('0x7b')](fs[_0x7250('0x7c')](path[_0x7250('0x72')](_0x5521ea,_0x4180e1[_0x7250('0x7d')])));}}}}})[_0x7250('0x4d')](function(){if(_0x5b279e){return new BPromise(function(_0x4acb7f,_0x41c544){zipdir(_0x5521ea,{'saveTo':_0x36e639},function(_0x2b62b6,_0x451cf6){if(_0x2b62b6)return _0x41c544(_0x2b62b6);return _0x4acb7f(_0x451cf6);});});}})[_0x7250('0x4d')](function(){if(_0x5b279e){return new BPromise(function(_0x38956e,_0x201595){rimraf(_0x5521ea,function(_0x2bd293){if(_0x2bd293)_0x201595(_0x2bd293);return _0x38956e();});});}})[_0x7250('0x4d')](function(){if(_0x5b279e){return _0x31ca7e[_0x7250('0x7e')](_0x36e639,_0x1e729f,function(_0x32965d){if(_0x32965d){console['log'](_0x7250('0x7f'),_0x32965d);}else{fs['unlinkSync'](_0x36e639);}});}else{return _0x31ca7e[_0x7250('0x1c')](0xc8);}})[_0x7250('0x5c')](handleError(_0x31ca7e,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 5200b0a..ccdbcb6 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 _0x9c5e=['save','emit','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','setMaxListeners'];(function(_0x59e13f,_0x541f21){var _0xf7c360=function(_0x170c75){while(--_0x170c75){_0x59e13f['push'](_0x59e13f['shift']());}};_0xf7c360(++_0x541f21);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x227150,_0x2126af){_0x227150=_0x227150-0x0;var _0x4251e8=_0x9c5e[_0x227150];return _0x4251e8;};'use strict';var EventEmitter=require(_0xe9c5('0x0'));var FaxInteraction=require(_0xe9c5('0x1'))['db'][_0xe9c5('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe9c5('0x3')](0x0);var events={'afterCreate':_0xe9c5('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x595373){return function(_0x120d2f,_0x13d5d7,_0x4fa4c5){FaxInteractionEvents[_0xe9c5('0x5')](_0x595373+':'+_0x120d2f['id'],_0x120d2f);FaxInteractionEvents[_0xe9c5('0x5')](_0x595373,_0x120d2f);_0x4fa4c5(null);};}for(var e in events){if(events[_0xe9c5('0x6')](e)){var event=events[e];FaxInteraction[_0xe9c5('0x7')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x98e5=['setMaxListeners','save','remove','emit','hook','exports'];(function(_0x1953d2,_0x29d90e){var _0x497ddc=function(_0x4d0f51){while(--_0x4d0f51){_0x1953d2['push'](_0x1953d2['shift']());}};_0x497ddc(++_0x29d90e);}(_0x98e5,0x8a));var _0x598e=function(_0x1ea5e1,_0x4e987e){_0x1ea5e1=_0x1ea5e1-0x0;var _0x4bb921=_0x98e5[_0x1ea5e1];return _0x4bb921;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x598e('0x0')](0x0);var events={'afterCreate':_0x598e('0x1'),'afterUpdate':'update','afterDestroy':_0x598e('0x2')};function emitEvent(_0xc090ec){return function(_0x5cc274,_0x3af01f,_0x5a876c){FaxInteractionEvents['emit'](_0xc090ec+':'+_0x5cc274['id'],_0x5cc274);FaxInteractionEvents[_0x598e('0x3')](_0xc090ec,_0x5cc274);_0x5a876c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x598e('0x4')](e,emitEvent(event));}}module[_0x598e('0x5')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 52c2618..ac8f16a 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 _0x481e=['util','../../config/logger','api','moment','bluebird','define','fax_interactions'];(function(_0x3b0042,_0x8e7550){var _0x41bf57=function(_0x2bb397){while(--_0x2bb397){_0x3b0042['push'](_0x3b0042['shift']());}};_0x41bf57(++_0x8e7550);}(_0x481e,0x8c));var _0xe481=function(_0x161737,_0x4afe1d){_0x161737=_0x161737-0x0;var _0x11b53c=_0x481e[_0x161737];return _0x11b53c;};'use strict';var _=require('lodash');var util=require(_0xe481('0x0'));var logger=require(_0xe481('0x1'))(_0xe481('0x2'));var moment=require(_0xe481('0x3'));var BPromise=require(_0xe481('0x4'));var rp=require('request-promise');var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x30140b,_0x2ff112){return _0x30140b[_0xe481('0x5')]('FaxInteraction',attributes,{'tableName':_0xe481('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b6b=['moment','bluebird','request-promise','./faxInteraction.attributes','FaxInteraction','fax_interactions','lodash','../../config/logger','api'];(function(_0x3a4edc,_0x5fbdc8){var _0x3f4a76=function(_0x1b6def){while(--_0x1b6def){_0x3a4edc['push'](_0x3a4edc['shift']());}};_0x3f4a76(++_0x5fbdc8);}(_0x6b6b,0x84));var _0xb6b6=function(_0x44aacc,_0x21005e){_0x44aacc=_0x44aacc-0x0;var _0x838744=_0x6b6b[_0x44aacc];return _0x838744;};'use strict';var _=require(_0xb6b6('0x0'));var util=require('util');var logger=require(_0xb6b6('0x1'))(_0xb6b6('0x2'));var moment=require(_0xb6b6('0x3'));var BPromise=require(_0xb6b6('0x4'));var rp=require(_0xb6b6('0x5'));var attributes=require(_0xb6b6('0x6'));module['exports']=function(_0x22a681,_0x4d0682){return _0x22a681['define'](_0xb6b6('0x7'),attributes,{'tableName':_0xb6b6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 18bb196..89a8dbe 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 _0x4038=['defaults','localhost','./faxInteraction.socket','request','then','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','info','debug','AddTags','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x107f30,_0xae01df){var _0x190ac5=function(_0x59f0e1){while(--_0x59f0e1){_0x107f30['push'](_0x107f30['shift']());}};_0x190ac5(++_0xae01df);}(_0x4038,0x12e));var _0x8403=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0x4038[_0x424501];return _0xb719af;};'use strict';var _=require(_0x8403('0x0'));var util=require(_0x8403('0x1'));var moment=require('moment');var BPromise=require(_0x8403('0x2'));var rs=require(_0x8403('0x3'));var fs=require('fs');var Redis=require(_0x8403('0x4'));var db=require(_0x8403('0x5'))['db'];var utils=require(_0x8403('0x6'));var logger=require(_0x8403('0x7'))(_0x8403('0x8'));var config=require(_0x8403('0x9'));var jayson=require(_0x8403('0xa'));var client=jayson['client'][_0x8403('0xb')]({'port':0x232a});config[_0x8403('0xc')]=_[_0x8403('0xd')](config[_0x8403('0xc')],{'host':_0x8403('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8403('0xc')]));require(_0x8403('0xf'))['register'](socket);function respondWithRpcPromise(_0x23a911,_0x295f86,_0x46b422){return new BPromise(function(_0x3b373c,_0x5a490e){return client[_0x8403('0x10')](_0x23a911,_0x46b422)[_0x8403('0x11')](function(_0x954c6){logger['info'](_0x8403('0x12'),_0x295f86,'request\x20sent');logger['debug'](_0x8403('0x13'),_0x295f86,'request\x20sent',JSON[_0x8403('0x14')](_0x954c6));if(_0x954c6[_0x8403('0x15')]){if(_0x954c6[_0x8403('0x15')][_0x8403('0x16')]===0x1f4){logger[_0x8403('0x15')](_0x8403('0x12'),_0x295f86,_0x954c6[_0x8403('0x15')][_0x8403('0x17')]);return _0x5a490e(_0x954c6[_0x8403('0x15')][_0x8403('0x17')]);}logger[_0x8403('0x15')](_0x8403('0x12'),_0x295f86,_0x954c6['error'][_0x8403('0x17')]);return _0x3b373c(_0x954c6[_0x8403('0x15')][_0x8403('0x17')]);}else{logger['info'](_0x8403('0x12'),_0x295f86,_0x8403('0x18'));_0x3b373c(_0x954c6[_0x8403('0x19')][_0x8403('0x17')]);}})['catch'](function(_0x3485bb){logger[_0x8403('0x15')](_0x8403('0x12'),_0x295f86,_0x3485bb);_0x5a490e(_0x3485bb);});});}exports[_0x8403('0x1a')]=function(_0x7db890){var _0xe1f888=this;return new Promise(function(_0x5032d0,_0x353a4d){return db[_0x8403('0x1b')][_0x8403('0x1c')](_0x7db890[_0x8403('0x1d')],{'raw':_0x7db890[_0x8403('0x1e')]?_0x7db890[_0x8403('0x1e')][_0x8403('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7db890[_0x8403('0x1e')]?_0x7db890[_0x8403('0x1e')][_0x8403('0x20')]||null:null,'attributes':_0x7db890[_0x8403('0x1e')]?_0x7db890[_0x8403('0x1e')][_0x8403('0x21')]||null:null,'limit':_0x7db890['options']?_0x7db890[_0x8403('0x1e')][_0x8403('0x22')]||null:null})['then'](function(_0x1cdbbc){logger['info'](_0x8403('0x1a'),_0x7db890);logger['debug']('UpdateFaxInteraction',_0x7db890,JSON['stringify'](_0x1cdbbc));_0x5032d0(_0x1cdbbc);})['catch'](function(_0x3d00d7){logger[_0x8403('0x15')](_0x8403('0x1a'),_0x3d00d7['message'],_0x7db890);_0x353a4d(_0xe1f888[_0x8403('0x15')](0x1f4,_0x3d00d7[_0x8403('0x17')]));});});};exports[_0x8403('0x23')]=function(_0x22435a){return new Promise(function(_0x51dd26,_0x13fd34){return db[_0x8403('0x1b')][_0x8403('0x24')]({'where':_0x22435a[_0x8403('0x1e')]?_0x22435a[_0x8403('0x1e')][_0x8403('0x20')]||null:null})[_0x8403('0x11')](function(_0xb433ff){if(_0xb433ff){return _0xb433ff[_0x8403('0x25')](_0x22435a['body'][_0x8403('0x26')],_[_0x8403('0x27')](_0x22435a[_0x8403('0x1d')],[_0x8403('0x26'),'id'])||{});}})[_0x8403('0x28')](function(_0x5837d8){logger[_0x8403('0x29')]('AddTags',_0x22435a);logger[_0x8403('0x2a')](_0x8403('0x2b'),_0x22435a,JSON[_0x8403('0x14')](_0x5837d8));_0x51dd26(_0x5837d8);})[_0x8403('0x2c')](function(_0x123851){logger['error']('AddTags',_0x123851[_0x8403('0x17')],_0x22435a);_0x13fd34(_this['error'](0x1f4,_0x123851['message']));});});}; \ No newline at end of file +var _0xf523=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','body','options','where','attributes','limit','then','AddTagsToFaxInteraction','FaxInteraction','find','addTags','omit','stringify','AddTags','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf523,0x108));var _0x3f52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf523[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3f52('0x0'));var BPromise=require(_0x3f52('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f52('0x2'));var db=require(_0x3f52('0x3'))['db'];var utils=require(_0x3f52('0x4'));var logger=require(_0x3f52('0x5'))(_0x3f52('0x6'));var config=require(_0x3f52('0x7'));var jayson=require(_0x3f52('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x3f52('0x9')]=_['defaults'](config[_0x3f52('0x9')],{'host':_0x3f52('0xa'),'port':0x18eb});var socket=require(_0x3f52('0xb'))(new Redis(config[_0x3f52('0x9')]));require(_0x3f52('0xc'))[_0x3f52('0xd')](socket);function respondWithRpcPromise(_0x301659,_0x5da567,_0x209feb){return new BPromise(function(_0x5e96a3,_0x2be4af){return client[_0x3f52('0xe')](_0x301659,_0x209feb)['then'](function(_0x2739d8){logger[_0x3f52('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x5da567,_0x3f52('0x10'));logger[_0x3f52('0x11')](_0x3f52('0x12'),_0x5da567,_0x3f52('0x10'),JSON['stringify'](_0x2739d8));if(_0x2739d8[_0x3f52('0x13')]){if(_0x2739d8['error']['code']===0x1f4){logger[_0x3f52('0x13')](_0x3f52('0x14'),_0x5da567,_0x2739d8[_0x3f52('0x13')][_0x3f52('0x15')]);return _0x2be4af(_0x2739d8[_0x3f52('0x13')][_0x3f52('0x15')]);}logger[_0x3f52('0x13')](_0x3f52('0x14'),_0x5da567,_0x2739d8['error'][_0x3f52('0x15')]);return _0x5e96a3(_0x2739d8[_0x3f52('0x13')][_0x3f52('0x15')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x5da567,_0x3f52('0x10'));_0x5e96a3(_0x2739d8[_0x3f52('0x16')][_0x3f52('0x15')]);}})[_0x3f52('0x17')](function(_0x2b8834){logger[_0x3f52('0x13')](_0x3f52('0x14'),_0x5da567,_0x2b8834);_0x2be4af(_0x2b8834);});});}exports[_0x3f52('0x18')]=function(_0x572855){var _0x565107=this;return new Promise(function(_0x4f921e,_0xab290c){return db['FaxInteraction']['update'](_0x572855[_0x3f52('0x19')],{'raw':_0x572855[_0x3f52('0x1a')]?_0x572855[_0x3f52('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x572855[_0x3f52('0x1a')]?_0x572855['options'][_0x3f52('0x1b')]||null:null,'attributes':_0x572855[_0x3f52('0x1a')]?_0x572855['options'][_0x3f52('0x1c')]||null:null,'limit':_0x572855['options']?_0x572855[_0x3f52('0x1a')][_0x3f52('0x1d')]||null:null})[_0x3f52('0x1e')](function(_0x37e770){logger[_0x3f52('0xf')]('UpdateFaxInteraction',_0x572855);logger['debug'](_0x3f52('0x18'),_0x572855,JSON['stringify'](_0x37e770));_0x4f921e(_0x37e770);})[_0x3f52('0x17')](function(_0x56048b){logger[_0x3f52('0x13')](_0x3f52('0x18'),_0x56048b['message'],_0x572855);_0xab290c(_0x565107['error'](0x1f4,_0x56048b[_0x3f52('0x15')]));});});};exports[_0x3f52('0x1f')]=function(_0x1d9227){return new Promise(function(_0x2e55b6,_0x1020e2){return db[_0x3f52('0x20')][_0x3f52('0x21')]({'where':_0x1d9227[_0x3f52('0x1a')]?_0x1d9227['options'][_0x3f52('0x1b')]||null:null})['then'](function(_0x5e2312){if(_0x5e2312){return _0x5e2312[_0x3f52('0x22')](_0x1d9227['body']['ids'],_[_0x3f52('0x23')](_0x1d9227[_0x3f52('0x19')],['ids','id'])||{});}})['spread'](function(_0x1972b9){logger[_0x3f52('0xf')]('AddTags',_0x1d9227);logger['debug']('AddTags',_0x1d9227,JSON[_0x3f52('0x24')](_0x1972b9));_0x2e55b6(_0x1972b9);})[_0x3f52('0x17')](function(_0x129c7a){logger[_0x3f52('0x13')](_0x3f52('0x25'),_0x129c7a[_0x3f52('0x15')],_0x1d9227);_0x1020e2(_this[_0x3f52('0x13')](0x1f4,_0x129c7a[_0x3f52('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 98757a8..4c49cba 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 _0x7790=['save','remove','update','emit','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x4ded8d,_0x159407){var _0x31e9cb=function(_0x240e3f){while(--_0x240e3f){_0x4ded8d['push'](_0x4ded8d['shift']());}};_0x31e9cb(++_0x159407);}(_0x7790,0x167));var _0x0779=function(_0x4e3779,_0x47e7f9){_0x4e3779=_0x4e3779-0x0;var _0x23d03b=_0x7790[_0x4e3779];return _0x23d03b;};'use strict';var FaxInteractionEvents=require(_0x0779('0x0'));var events=[_0x0779('0x1'),_0x0779('0x2'),_0x0779('0x3')];function createListener(_0x357336,_0x338a13){return function(_0x3aab27){_0x338a13[_0x0779('0x4')](_0x357336,_0x3aab27);};}function removeListener(_0x12a9c2,_0x2f76e7){return function(){FaxInteractionEvents['removeListener'](_0x12a9c2,_0x2f76e7);};}exports[_0x0779('0x5')]=function(_0x4384dc){for(var _0x479f3d=0x0,_0x52e7f=events[_0x0779('0x6')];_0x479f3d<_0x52e7f;_0x479f3d++){var _0x44fbd4=events[_0x479f3d];var _0x125fa6=createListener(_0x0779('0x7')+_0x44fbd4,_0x4384dc);FaxInteractionEvents['on'](_0x44fbd4,_0x125fa6);}}; \ No newline at end of file +var _0x9e0a=['update','emit'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x9e0a,0xa0));var _0xa9e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9e0a[_0x20a584];return _0x4b41a8;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save','remove',_0xa9e0('0x0')];function createListener(_0x1aa900,_0x525ca7){return function(_0xb7cc){_0x525ca7[_0xa9e0('0x1')](_0x1aa900,_0xb7cc);};}function removeListener(_0x293350,_0x4f55c2){return function(){FaxInteractionEvents['removeListener'](_0x293350,_0x4f55c2);};}exports['register']=function(_0x2ec176){for(var _0x7ab865=0x0,_0x3241db=events['length'];_0x7ab865<_0x3241db;_0x7ab865++){var _0x167972=events[_0x7ab865];var _0x56a45d=createListener('faxInteraction:'+_0x167972,_0x2ec176);FaxInteractionEvents['on'](_0x167972,_0x56a45d);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 6ba7389..b0edb52 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 _0x754b=['/:id','show','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x47c678,_0x461b8d){var _0x518b2b=function(_0x1a79e6){while(--_0x1a79e6){_0x47c678['push'](_0x47c678['shift']());}};_0x518b2b(++_0x461b8d);}(_0x754b,0x113));var _0xb754=function(_0x7dbd65,_0x18da49){_0x7dbd65=_0x7dbd65-0x0;var _0x33d551=_0x754b[_0x7dbd65];return _0x33d551;};'use strict';var multer=require(_0xb754('0x0'));var util=require(_0xb754('0x1'));var path=require('path');var timeout=require(_0xb754('0x2'));var express=require(_0xb754('0x3'));var router=express[_0xb754('0x4')]();var auth=require(_0xb754('0x5'));var interaction=require(_0xb754('0x6'));var config=require(_0xb754('0x7'));var controller=require('./faxInteraction.controller');router[_0xb754('0x8')]('/',auth[_0xb754('0x9')](),controller[_0xb754('0xa')]);router[_0xb754('0x8')](_0xb754('0xb'),auth['isAuthenticated'](),controller[_0xb754('0xc')]);router['get'](_0xb754('0xd'),auth['isAuthenticated'](),controller[_0xb754('0xe')]);router[_0xb754('0x8')]('/:id/messages',auth[_0xb754('0x9')](),controller[_0xb754('0xf')]);router['get'](_0xb754('0x10'),auth[_0xb754('0x9')](),controller[_0xb754('0x11')]);router[_0xb754('0x12')]('/',auth[_0xb754('0x9')](),controller[_0xb754('0x13')]);router[_0xb754('0x12')]('/:id/messages',auth[_0xb754('0x9')](),controller[_0xb754('0x14')]);router[_0xb754('0x12')](_0xb754('0x15'),auth['isAuthenticated'](),interaction[_0xb754('0x16')](_0xb754('0x17'),_0xb754('0x18')),controller[_0xb754('0x19')]);router['put']('/:id',auth[_0xb754('0x9')](),interaction[_0xb754('0x16')](_0xb754('0x17'),_0xb754('0x1a')),controller[_0xb754('0x1b')]);router['delete'](_0xb754('0xd'),auth['isAuthenticated'](),interaction[_0xb754('0x16')](_0xb754('0x17'),_0xb754('0x1c')),controller[_0xb754('0x1d')]);router[_0xb754('0x1e')]('/:id/tags',auth[_0xb754('0x9')](),controller['removeTags']);module[_0xb754('0x1f')]=router; \ No newline at end of file +var _0x18f2=['/:id/tags','tracked','addTags','/:id','fax','faxinteraction:update','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','download','create','post','addMessage'];(function(_0x3fd975,_0x968a2c){var _0x374ba6=function(_0x224c73){while(--_0x224c73){_0x3fd975['push'](_0x3fd975['shift']());}};_0x374ba6(++_0x968a2c);}(_0x18f2,0x9f));var _0x218f=function(_0xab56c8,_0x4f5f94){_0xab56c8=_0xab56c8-0x0;var _0x29c649=_0x18f2[_0xab56c8];return _0x29c649;};'use strict';var multer=require(_0x218f('0x0'));var util=require(_0x218f('0x1'));var path=require(_0x218f('0x2'));var timeout=require(_0x218f('0x3'));var express=require(_0x218f('0x4'));var router=express[_0x218f('0x5')]();var auth=require(_0x218f('0x6'));var interaction=require(_0x218f('0x7'));var config=require(_0x218f('0x8'));var controller=require(_0x218f('0x9'));router[_0x218f('0xa')]('/',auth[_0x218f('0xb')](),controller['index']);router['get'](_0x218f('0xc'),auth['isAuthenticated'](),controller[_0x218f('0xd')]);router['get']('/:id',auth[_0x218f('0xb')](),controller[_0x218f('0xe')]);router[_0x218f('0xa')](_0x218f('0xf'),auth[_0x218f('0xb')](),controller[_0x218f('0x10')]);router[_0x218f('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0x218f('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x218f('0x12')]);router[_0x218f('0x13')](_0x218f('0xf'),auth[_0x218f('0xb')](),controller[_0x218f('0x14')]);router[_0x218f('0x13')](_0x218f('0x15'),auth[_0x218f('0xb')](),interaction[_0x218f('0x16')]('fax','faxinteraction:addtags'),controller[_0x218f('0x17')]);router['put'](_0x218f('0x18'),auth[_0x218f('0xb')](),interaction[_0x218f('0x16')](_0x218f('0x19'),_0x218f('0x1a')),controller[_0x218f('0x1b')]);router['delete']('/:id',auth[_0x218f('0xb')](),interaction[_0x218f('0x16')](_0x218f('0x19'),'faxinteraction:destroy'),controller[_0x218f('0x1c')]);router['delete']('/:id/tags',auth[_0x218f('0xb')](),controller['removeTags']);module[_0x218f('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 aea099c..aa41f02 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 _0xb5fc=['DATE','BOOLEAN','out','TEXT'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb5fc,0x71));var _0xcb5f=function(_0x1b0bec,_0x1be414){_0x1b0bec=_0x1b0bec-0x0;var _0x4a919b=_0xb5fc[_0x1b0bec];return _0x4a919b;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xcb5f('0x0')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xcb5f('0x1')),'defaultValue':_0xcb5f('0x1'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xcb5f('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xcb5f('0x3')]}}; \ No newline at end of file +var _0xb863=['medium','BOOLEAN','out','sequelize','exports','TEXT'];(function(_0x2a9462,_0x48e973){var _0xbd9965=function(_0x205099){while(--_0x205099){_0x2a9462['push'](_0x2a9462['shift']());}};_0xbd9965(++_0x48e973);}(_0xb863,0x11d));var _0x3b86=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xb863[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0x3b86('0x0'));module[_0x3b86('0x1')]={'body':{'type':Sequelize[_0x3b86('0x2')](_0x3b86('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3b86('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3b86('0x5')),'defaultValue':_0x3b86('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 0b8fe51..2eff1a3 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 _0x2e0b=['debug','stringify','code','error','message','result','catch','status','json','count','offset','limit','Content-Range','apply','reject','update','destroy','end','sendStatus','stack','name','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','key','field','options','FaxMessage','includeAll','include','findAll','rows','show','params','find','body','describe','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','isNil','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','interface','channel','event','accept','EventManager','acceptmessage','agent','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','rejectmessage','create','CmContact','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','server','files','attachments','html-pdf','eml-format','moment','mustache','util','path','sox','ejs','lodash','crypto','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0xdecce9,_0x20d005){var _0x16f6fa=function(_0x8655a8){while(--_0x8655a8){_0xdecce9['push'](_0xdecce9['shift']());}};_0x16f6fa(++_0x20d005);}(_0x2e0b,0xde));var _0xb2e0=function(_0x4b416c,_0x53ef9e){_0x4b416c=_0x4b416c-0x0;var _0x2037fa=_0x2e0b[_0x4b416c];return _0x2037fa;};'use strict';var pdf=require(_0xb2e0('0x0'));var emlformat=require(_0xb2e0('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb2e0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb2e0('0x3'));var util=require(_0xb2e0('0x4'));var path=require(_0xb2e0('0x5'));var sox=require(_0xb2e0('0x6'));var csv=require('to-csv');var ejs=require(_0xb2e0('0x7'));var fs=require('fs');var _=require(_0xb2e0('0x8'));var squel=require('squel');var crypto=require(_0xb2e0('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb2e0('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xb2e0('0xb'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xb2e0('0xc'));var logger=require(_0xb2e0('0xd'))(_0xb2e0('0xe'));var utils=require(_0xb2e0('0xf'));var config=require(_0xb2e0('0x10'));var db=require(_0xb2e0('0x11'))['db'];config[_0xb2e0('0x12')]=_[_0xb2e0('0x13')](config[_0xb2e0('0x12')],{'host':_0xb2e0('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')[_0xb2e0('0x15')](socket);var jayson=require(_0xb2e0('0x16'));var client=jayson[_0xb2e0('0x17')][_0xb2e0('0x18')]({'port':0x232c});var client9002=jayson[_0xb2e0('0x17')][_0xb2e0('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x2a18f5,_0x5d6f9,_0x29b096,_0x570985){return new BPromise(function(_0x34764d,_0x100a22){var _0x2c565e=_0x570985||client;return _0x2c565e[_0xb2e0('0x19')](_0x2a18f5,_0x29b096)[_0xb2e0('0x1a')](function(_0x580a25){logger[_0xb2e0('0x1b')](_0xb2e0('0x1c'),_0x5d6f9,_0xb2e0('0x1d'));logger[_0xb2e0('0x1e')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5d6f9,_0xb2e0('0x1d'),JSON[_0xb2e0('0x1f')](_0x580a25));if(_0x580a25['error']){if(_0x580a25['error'][_0xb2e0('0x20')]===0x1f4){logger['error'](_0xb2e0('0x1c'),_0x5d6f9,_0x580a25[_0xb2e0('0x21')][_0xb2e0('0x22')]);return _0x100a22(_0x580a25[_0xb2e0('0x21')][_0xb2e0('0x22')]);}logger[_0xb2e0('0x21')](_0xb2e0('0x1c'),_0x5d6f9,_0x580a25[_0xb2e0('0x21')]['message']);return _0x34764d(_0x580a25[_0xb2e0('0x21')][_0xb2e0('0x22')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x5d6f9,_0xb2e0('0x1d'));_0x34764d(_0x580a25[_0xb2e0('0x23')][_0xb2e0('0x22')]);}})[_0xb2e0('0x24')](function(_0x3d73d4){logger[_0xb2e0('0x21')]('FaxMessage,\x20%s,\x20%s',_0x5d6f9,_0x3d73d4);_0x100a22(_0x3d73d4);});});}function respondWithStatusCode(_0x3a74bb,_0x1fc8cc){_0x1fc8cc=_0x1fc8cc||0xcc;return function(_0x2e06c8){if(_0x2e06c8){return _0x3a74bb['sendStatus'](_0x1fc8cc);}return _0x3a74bb[_0xb2e0('0x25')](_0x1fc8cc)['end']();};}function respondWithResult(_0x1f6d63,_0x394f81){_0x394f81=_0x394f81||0xc8;return function(_0x422e75){if(_0x422e75){return _0x1f6d63[_0xb2e0('0x25')](_0x394f81)[_0xb2e0('0x26')](_0x422e75);}};}function respondWithFilteredResult(_0x28d041,_0x6991ff){return function(_0x4522b6){if(_0x4522b6){var _0x38e148=_0x4522b6[_0xb2e0('0x27')],_0x48c1a3=_0x6991ff[_0xb2e0('0x28')],_0x509c7e=_0x6991ff[_0xb2e0('0x28')]+_0x6991ff[_0xb2e0('0x29')],_0x1cfcbe;if(_0x509c7e>=_0x38e148){_0x509c7e=_0x38e148;_0x1cfcbe=0xc8;}else{_0x1cfcbe=0xce;}_0x28d041['status'](_0x1cfcbe);return _0x28d041['set'](_0xb2e0('0x2a'),_0x48c1a3+'-'+_0x509c7e+'/'+_0x38e148)[_0xb2e0('0x26')](_0x4522b6);}return null;};}function patchUpdates(_0x4db9bf){return function(_0x5b0853){try{jsonpatch[_0xb2e0('0x2b')](_0x5b0853,_0x4db9bf,!![]);}catch(_0x39c99a){return BPromise[_0xb2e0('0x2c')](_0x39c99a);}return _0x5b0853['save']();};}function saveUpdates(_0xa51d0a,_0x22c07d){return function(_0x58e196){if(_0x58e196){return _0x58e196[_0xb2e0('0x2d')](_0xa51d0a)[_0xb2e0('0x1a')](function(_0x21318b){return _0x21318b;});}return null;};}function removeEntity(_0x2aa8c9,_0x24d16){return function(_0x5513f9){if(_0x5513f9){return _0x5513f9[_0xb2e0('0x2e')]()[_0xb2e0('0x1a')](function(){_0x2aa8c9[_0xb2e0('0x25')](0xcc)[_0xb2e0('0x2f')]();});}};}function handleEntityNotFound(_0x12a736,_0x2d0b8c){return function(_0x2de691){if(!_0x2de691){_0x12a736[_0xb2e0('0x30')](0x194);}return _0x2de691;};}function handleError(_0xbf378,_0x150054){_0x150054=_0x150054||0x1f4;return function(_0x3115b3){logger[_0xb2e0('0x21')](_0x3115b3[_0xb2e0('0x31')]);if(_0x3115b3[_0xb2e0('0x32')]){delete _0x3115b3[_0xb2e0('0x32')];}_0xbf378['status'](_0x150054)['send'](_0x3115b3);};}exports['index']=function(_0xd8020c,_0x3daf29){var _0x2df0c3={},_0x45e904={},_0x3c1eca={'count':0x0,'rows':[]};var _0x1ecd17=db['FaxMessage'][_0xb2e0('0x33')];_0x45e904[_0xb2e0('0x34')]=_[_0xb2e0('0x35')](_0x1ecd17);_0x45e904['query']=_[_0xb2e0('0x35')](_0xd8020c[_0xb2e0('0x36')]);_0x45e904[_0xb2e0('0x37')]=_[_0xb2e0('0x38')](_0x45e904[_0xb2e0('0x34')],_0x45e904[_0xb2e0('0x36')]);_0x2df0c3['attributes']=_[_0xb2e0('0x38')](_0x45e904[_0xb2e0('0x34')],qs[_0xb2e0('0x39')](_0xd8020c[_0xb2e0('0x36')][_0xb2e0('0x39')]));_0x2df0c3[_0xb2e0('0x3a')]=_0x2df0c3['attributes'][_0xb2e0('0x3b')]?_0x2df0c3[_0xb2e0('0x3a')]:_0x45e904[_0xb2e0('0x34')];if(!_0xd8020c[_0xb2e0('0x36')][_0xb2e0('0x3c')](_0xb2e0('0x3d'))){_0x2df0c3['limit']=qs[_0xb2e0('0x29')](_0xd8020c[_0xb2e0('0x36')][_0xb2e0('0x29')]);_0x2df0c3[_0xb2e0('0x28')]=qs[_0xb2e0('0x28')](_0xd8020c['query']['offset']);}_0x2df0c3[_0xb2e0('0x3e')]=qs[_0xb2e0('0x3f')](_0xd8020c['query'][_0xb2e0('0x3f')]);_0x2df0c3[_0xb2e0('0x40')]=qs['filters'](_['pick'](_0xd8020c[_0xb2e0('0x36')],_0x45e904[_0xb2e0('0x37')]));if(_0xd8020c[_0xb2e0('0x36')][_0xb2e0('0x41')]){_0x2df0c3[_0xb2e0('0x40')]=_[_0xb2e0('0x42')](_0x2df0c3[_0xb2e0('0x40')],{'$or':_['map'](_0x1ecd17,function(_0x13b6e8){if(_0x13b6e8['type'][_0xb2e0('0x43')]!=='VIRTUAL'){var _0x2bd9bf={};_0x2bd9bf[_0x13b6e8[_0xb2e0('0x44')]]={'$like':'%'+_0xd8020c[_0xb2e0('0x36')]['filter']+'%'};return _0x2bd9bf;}})});}_0x2df0c3=_[_0xb2e0('0x42')]({},_0x2df0c3,_0xd8020c[_0xb2e0('0x45')]);var _0x460a19={'where':_0x2df0c3[_0xb2e0('0x40')]};return db[_0xb2e0('0x46')]['count'](_0x460a19)[_0xb2e0('0x1a')](function(_0x21a2ce){_0x3c1eca['count']=_0x21a2ce;if(_0xd8020c[_0xb2e0('0x36')][_0xb2e0('0x47')]){_0x2df0c3[_0xb2e0('0x48')]=[{'all':!![]}];}return db[_0xb2e0('0x46')][_0xb2e0('0x49')](_0x2df0c3);})[_0xb2e0('0x1a')](function(_0x3eb318){_0x3c1eca[_0xb2e0('0x4a')]=_0x3eb318;return _0x3c1eca;})['then'](respondWithFilteredResult(_0x3daf29,_0x2df0c3))[_0xb2e0('0x24')](handleError(_0x3daf29,null));};exports[_0xb2e0('0x4b')]=function(_0x1c5893,_0x74d9a7){var _0x412741={'raw':!![],'where':{'id':_0x1c5893[_0xb2e0('0x4c')]['id']}},_0x1ca92d={};_0x1ca92d[_0xb2e0('0x34')]=_[_0xb2e0('0x35')](db[_0xb2e0('0x46')][_0xb2e0('0x33')]);_0x1ca92d[_0xb2e0('0x36')]=_[_0xb2e0('0x35')](_0x1c5893['query']);_0x1ca92d['filters']=_[_0xb2e0('0x38')](_0x1ca92d[_0xb2e0('0x34')],_0x1ca92d[_0xb2e0('0x36')]);_0x412741['attributes']=_['intersection'](_0x1ca92d[_0xb2e0('0x34')],qs['fields'](_0x1c5893[_0xb2e0('0x36')][_0xb2e0('0x39')]));_0x412741[_0xb2e0('0x3a')]=_0x412741['attributes'][_0xb2e0('0x3b')]?_0x412741[_0xb2e0('0x3a')]:_0x1ca92d[_0xb2e0('0x34')];if(_0x1c5893[_0xb2e0('0x36')][_0xb2e0('0x47')]){_0x412741[_0xb2e0('0x48')]=[{'all':!![]}];}_0x412741=_['merge']({},_0x412741,_0x1c5893['options']);return db['FaxMessage'][_0xb2e0('0x4d')](_0x412741)['then'](handleEntityNotFound(_0x74d9a7,null))[_0xb2e0('0x1a')](respondWithResult(_0x74d9a7,null))['catch'](handleError(_0x74d9a7,null));};exports[_0xb2e0('0x2d')]=function(_0x34ad65,_0x14db9b){if(_0x34ad65[_0xb2e0('0x4e')]['id']){delete _0x34ad65[_0xb2e0('0x4e')]['id'];}return db[_0xb2e0('0x46')]['find']({'where':{'id':_0x34ad65[_0xb2e0('0x4c')]['id']}})[_0xb2e0('0x1a')](handleEntityNotFound(_0x14db9b,null))['then'](saveUpdates(_0x34ad65[_0xb2e0('0x4e')],null))[_0xb2e0('0x1a')](respondWithResult(_0x14db9b,null))[_0xb2e0('0x24')](handleError(_0x14db9b,null));};exports[_0xb2e0('0x2e')]=function(_0x343edd,_0x57d0c2){return db[_0xb2e0('0x46')][_0xb2e0('0x4d')]({'where':{'id':_0x343edd[_0xb2e0('0x4c')]['id']}})[_0xb2e0('0x1a')](handleEntityNotFound(_0x57d0c2,null))[_0xb2e0('0x1a')](removeEntity(_0x57d0c2,null))['catch'](handleError(_0x57d0c2,null));};exports[_0xb2e0('0x4f')]=function(_0xc76a79,_0x14921a){return db['FaxMessage'][_0xb2e0('0x4f')]()[_0xb2e0('0x1a')](respondWithResult(_0x14921a,null))[_0xb2e0('0x24')](handleError(_0x14921a,null));};var interaction_log=require(_0xb2e0('0xd'))(_0xb2e0('0x50'));exports['accept']=function(_0x315eae,_0x563e83,_0x43e13b){var _0x393e69={'channel':_0xb2e0('0x51')};if(_0x315eae[_0xb2e0('0x4e')]['id']){delete _0x315eae[_0xb2e0('0x4e')]['id'];}_0x315eae[_0xb2e0('0x4e')][_0xb2e0('0x52')]=!![];_0x315eae['body'][_0xb2e0('0x53')]=moment()[_0xb2e0('0x54')](_0xb2e0('0x55'));_0x315eae[_0xb2e0('0x4e')][_0xb2e0('0x56')]=_0x315eae['body'][_0xb2e0('0x56')]||_0x315eae[_0xb2e0('0x57')]['id'];return db[_0xb2e0('0x46')][_0xb2e0('0x4d')]({'where':{'id':_0x315eae[_0xb2e0('0x4c')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xb2e0('0x58')}]})[_0xb2e0('0x1a')](handleEntityNotFound(_0x563e83,null))['then'](saveUpdates(_0x315eae['body'],null))[_0xb2e0('0x1a')](function(_0x4ff788){if(_0x4ff788){_0x393e69[_0xb2e0('0x22')]=_0x4ff788['get']({'plain':!![]});return db['FaxInteraction'][_0xb2e0('0x4d')]({'where':{'id':_0x4ff788['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x563e83,null))[_0xb2e0('0x1a')](function(_0x180d47){if(_0x180d47){return _0x180d47[_0xb2e0('0x2d')]({'UserId':_0x315eae[_0xb2e0('0x4e')]['UserId'],'read1stAt':_[_0xb2e0('0x59')](_0x180d47[_0xb2e0('0x5a')])?moment()[_0xb2e0('0x54')](_0xb2e0('0x55')):undefined});}return null;})[_0xb2e0('0x1a')](function(_0x24ba38){if(_0x24ba38){_0x393e69[_0xb2e0('0x5b')]=_0x24ba38[_0xb2e0('0x5c')]({'plain':!![]});interaction_log[_0xb2e0('0x1b')](_0xb2e0('0x5d'),_0x315eae['user']['id'],_0x315eae['user'][_0xb2e0('0x32')],_0x315eae[_0xb2e0('0x57')][_0xb2e0('0x5e')],_0x393e69[_0xb2e0('0x5b')]['id'],_0x315eae[_0xb2e0('0x4e')]?JSON[_0xb2e0('0x1f')](_0x315eae[_0xb2e0('0x4e')]):'null');return respondWithRpcPromise(_0xb2e0('0x5f'),_0xb2e0('0x60'),_0x393e69);}return null;})['then'](function(_0x23d935){if(_0x23d935){if(_0x315eae[_0xb2e0('0x4e')][_0xb2e0('0x61')]){_0x393e69[_0xb2e0('0x22')][_0xb2e0('0x62')]=util[_0xb2e0('0x54')]('SIP/%s',_0x315eae[_0xb2e0('0x57')]['name']);_0x393e69[_0xb2e0('0x22')][_0xb2e0('0x63')]=_0x393e69[_0xb2e0('0x63')];_0x393e69[_0xb2e0('0x22')][_0xb2e0('0x64')]=_0xb2e0('0x65');return respondWithRpcPromise(_0xb2e0('0x66'),'EventManager',{'event':_0xb2e0('0x67'),'message':_0x393e69[_0xb2e0('0x22')]},client9002)[_0xb2e0('0x1a')](function(){return _0x393e69;});}return _0x393e69;}return null;})[_0xb2e0('0x1a')](respondWithResult(_0x563e83,null))[_0xb2e0('0x24')](handleError(_0x563e83,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xb2e0('0x2c')]=function(_0x2d9a29,_0x11eb9b,_0x1a114c){var _0xef4452={'agent':{},'channel':_0xb2e0('0x51')};if(_0x2d9a29[_0xb2e0('0x4e')]['id']){delete _0x2d9a29[_0xb2e0('0x4e')]['id'];}_0x2d9a29[_0xb2e0('0x4e')][_0xb2e0('0x56')]=_0x2d9a29[_0xb2e0('0x4e')][_0xb2e0('0x56')]||_0x2d9a29[_0xb2e0('0x57')]['id'];_0xef4452[_0xb2e0('0x68')]['id']=_0x2d9a29[_0xb2e0('0x4e')][_0xb2e0('0x56')];return db[_0xb2e0('0x46')][_0xb2e0('0x4d')]({'where':{'id':_0x2d9a29[_0xb2e0('0x4c')]['id'],'UserId':null}})[_0xb2e0('0x1a')](handleEntityNotFound(_0x11eb9b,null))[_0xb2e0('0x1a')](function(_0xed1fce){if(_0xed1fce){_0xef4452[_0xb2e0('0x22')]=_0xed1fce[_0xb2e0('0x5c')]({'plain':!![]});return db[_0xb2e0('0x69')][_0xb2e0('0x4d')]({'where':{'id':_0xed1fce[_0xb2e0('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x11eb9b,null))[_0xb2e0('0x1a')](function(_0x223e4e){if(_0x223e4e){_0xef4452[_0xb2e0('0x5b')]=_0x223e4e['get']({'plain':!![]});interaction_log[_0xb2e0('0x1b')](_0xb2e0('0x6b'),_0x2d9a29[_0xb2e0('0x57')]['id'],_0x2d9a29[_0xb2e0('0x57')]['name'],_0x2d9a29['user']['role'],_0xef4452[_0xb2e0('0x5b')]['id'],_0x2d9a29[_0xb2e0('0x4e')]?JSON[_0xb2e0('0x1f')](_0x2d9a29['body']):_0xb2e0('0x6c'));return respondWithRpcPromise(_0xb2e0('0x6d'),_0xb2e0('0x6e'),_0xef4452);}return null;})[_0xb2e0('0x1a')](function(_0x42e502){if(_0x42e502){_0x42e502['message'][_0xb2e0('0x62')]=util['format']('SIP/%s',_0x2d9a29[_0xb2e0('0x57')][_0xb2e0('0x32')]);_0x42e502[_0xb2e0('0x22')][_0xb2e0('0x63')]=_0xef4452[_0xb2e0('0x63')];_0x42e502[_0xb2e0('0x22')][_0xb2e0('0x64')]=_0xb2e0('0x2c');respondWithRpcPromise('EventManager',_0xb2e0('0x66'),{'event':_0xb2e0('0x6f'),'message':_0x42e502[_0xb2e0('0x22')]},client9002);return _0xef4452;}return null;})['then'](respondWithResult(_0x11eb9b,null))[_0xb2e0('0x24')](handleError(_0x11eb9b,null));};exports[_0xb2e0('0x70')]=function(_0x3b943c,_0x29736e){var _0x1d256b;return db[_0xb2e0('0x46')][_0xb2e0('0x70')](_0x3b943c[_0xb2e0('0x4e')],{})['then'](function(_0x330488){_0x1d256b=_0x330488;return db[_0xb2e0('0x71')][_0xb2e0('0x72')]({'where':{'id':_0x1d256b[_0xb2e0('0x73')]}});})[_0xb2e0('0x1a')](function(_0x31bc25){if(_[_0xb2e0('0x59')](_0x31bc25)){return;}else{_0x1d256b['fax']=_0x31bc25[_0xb2e0('0x51')];return db[_0xb2e0('0x74')][_0xb2e0('0x72')]({'where':{'id':_0x1d256b[_0xb2e0('0x75')]}});}})[_0xb2e0('0x1a')](function(_0x1bbc9c){return respondWithRpcPromise(_0xb2e0('0x76'),'SendFax',{'FaxAccountId':_[_0xb2e0('0x59')](_0x3b943c['body'])?undefined:_0x3b943c[_0xb2e0('0x4e')][_0xb2e0('0x77')],'path':_[_0xb2e0('0x59')](_0x1bbc9c)?undefined:util[_0xb2e0('0x54')](_0xb2e0('0x78'),_0x1bbc9c['basename']),'fax':_[_0xb2e0('0x59')](_0x1d256b['fax'])?undefined:_0x1d256b[_0xb2e0('0x51')],'AttachmentId':_0x1d256b['AttachmentId']},client9002);})[_0xb2e0('0x1a')](respondWithResult(_0x29736e,0xc9))[_0xb2e0('0x24')](handleError(_0x29736e,null));};exports[_0xb2e0('0x79')]=function(_0x5d83ae,_0x1dd802){var _0x379eb0=path[_0xb2e0('0x7a')](config['root'],_0xb2e0('0x7b'),_0xb2e0('0x7c'),_0xb2e0('0x7d'));return db[_0xb2e0('0x46')]['find']({'where':{'id':_0x5d83ae['params']['id']},'include':[{'model':db[_0xb2e0('0x74')],'as':_0xb2e0('0x74')}]})['then'](handleEntityNotFound(_0x1dd802,null))[_0xb2e0('0x1a')](function(_0x5d6a0d){if(_0x5d6a0d){return _0x1dd802['download'](path[_0xb2e0('0x7a')](_0x379eb0,_0x5d6a0d[_0xb2e0('0x74')]['basename']));}})[_0xb2e0('0x24')](handleError(_0x1dd802,null));}; \ No newline at end of file +var _0xcb91=['manual','interface','channel','accept','EventManager','agent','RejectMessage','rejectMessage','SIP/%s','event','isNil','fax','Attachment','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','download','html-pdf','eml-format','rimraf','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','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxMessage.socket','register','jayson/promise','http','client','request','then','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','stack','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','FaxMessage','includeAll','include','findAll','rows','show','update','body','find','params','describe','fax-interactions','read','UserId','user','CmContact','get','FaxInteraction','FaxInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','AcceptMessage','acceptMessage'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0xcb91,0x1a0));var _0x1cb9=function(_0x5c38cd,_0x5a6b4e){_0x5c38cd=_0x5c38cd-0x0;var _0xc985ef=_0xcb91[_0x5c38cd];return _0xc985ef;};'use strict';var pdf=require(_0x1cb9('0x0'));var emlformat=require(_0x1cb9('0x1'));var rimraf=require(_0x1cb9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1cb9('0x3'));var rp=require(_0x1cb9('0x4'));var moment=require(_0x1cb9('0x5'));var BPromise=require(_0x1cb9('0x6'));var Mustache=require(_0x1cb9('0x7'));var util=require(_0x1cb9('0x8'));var path=require('path');var sox=require(_0x1cb9('0x9'));var csv=require(_0x1cb9('0xa'));var ejs=require(_0x1cb9('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1cb9('0xc'));var crypto=require(_0x1cb9('0xd'));var jsforce=require(_0x1cb9('0xe'));var deskjs=require(_0x1cb9('0xf'));var toCsv=require(_0x1cb9('0xa'));var querystring=require(_0x1cb9('0x10'));var Papa=require(_0x1cb9('0x11'));var authService=require(_0x1cb9('0x12'));var hardwareService=require(_0x1cb9('0x13'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x1cb9('0x14'))('api');var utils=require(_0x1cb9('0x15'));var config=require(_0x1cb9('0x16'));var db=require(_0x1cb9('0x17'))['db'];config['redis']=_[_0x1cb9('0x18')](config['redis'],{'host':_0x1cb9('0x19'),'port':0x18eb});var socket=require(_0x1cb9('0x1a'))(new Redis(config[_0x1cb9('0x1b')]));require(_0x1cb9('0x1c'))[_0x1cb9('0x1d')](socket);var jayson=require(_0x1cb9('0x1e'));var client=jayson['client'][_0x1cb9('0x1f')]({'port':0x232c});var client9002=jayson[_0x1cb9('0x20')][_0x1cb9('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4b12e7,_0x177790,_0x85a82f,_0x393fe5){return new BPromise(function(_0x162533,_0x522d0c){var _0x5b4e4c=_0x393fe5||client;return _0x5b4e4c[_0x1cb9('0x21')](_0x4b12e7,_0x85a82f)[_0x1cb9('0x22')](function(_0x47a53d){logger['info'](_0x1cb9('0x23'),_0x177790,'request\x20sent');logger[_0x1cb9('0x24')](_0x1cb9('0x25'),_0x177790,'request\x20sent',JSON['stringify'](_0x47a53d));if(_0x47a53d[_0x1cb9('0x26')]){if(_0x47a53d['error'][_0x1cb9('0x27')]===0x1f4){logger[_0x1cb9('0x26')](_0x1cb9('0x23'),_0x177790,_0x47a53d[_0x1cb9('0x26')][_0x1cb9('0x28')]);return _0x522d0c(_0x47a53d[_0x1cb9('0x26')]['message']);}logger[_0x1cb9('0x26')](_0x1cb9('0x23'),_0x177790,_0x47a53d[_0x1cb9('0x26')][_0x1cb9('0x28')]);return _0x162533(_0x47a53d[_0x1cb9('0x26')][_0x1cb9('0x28')]);}else{logger[_0x1cb9('0x29')](_0x1cb9('0x23'),_0x177790,'request\x20sent');_0x162533(_0x47a53d[_0x1cb9('0x2a')]['message']);}})[_0x1cb9('0x2b')](function(_0x3a10c1){logger[_0x1cb9('0x26')](_0x1cb9('0x23'),_0x177790,_0x3a10c1);_0x522d0c(_0x3a10c1);});});}function respondWithStatusCode(_0x5e23c9,_0x301c1a){_0x301c1a=_0x301c1a||0xcc;return function(_0x308196){if(_0x308196){return _0x5e23c9[_0x1cb9('0x2c')](_0x301c1a);}return _0x5e23c9[_0x1cb9('0x2d')](_0x301c1a)[_0x1cb9('0x2e')]();};}function respondWithResult(_0x24158f,_0x2a0770){_0x2a0770=_0x2a0770||0xc8;return function(_0x132957){if(_0x132957){return _0x24158f['status'](_0x2a0770)[_0x1cb9('0x2f')](_0x132957);}};}function respondWithFilteredResult(_0x5c56b1,_0x53a3cc){return function(_0x56bed5){if(_0x56bed5){var _0x4b9139=_0x56bed5[_0x1cb9('0x30')],_0x3bfc76=_0x53a3cc[_0x1cb9('0x31')],_0x34c708=_0x53a3cc[_0x1cb9('0x31')]+_0x53a3cc[_0x1cb9('0x32')],_0x4cf969;if(_0x34c708>=_0x4b9139){_0x34c708=_0x4b9139;_0x4cf969=0xc8;}else{_0x4cf969=0xce;}_0x5c56b1[_0x1cb9('0x2d')](_0x4cf969);return _0x5c56b1[_0x1cb9('0x33')](_0x1cb9('0x34'),_0x3bfc76+'-'+_0x34c708+'/'+_0x4b9139)[_0x1cb9('0x2f')](_0x56bed5);}return null;};}function patchUpdates(_0x406a0b){return function(_0x9f6401){try{jsonpatch[_0x1cb9('0x35')](_0x9f6401,_0x406a0b,!![]);}catch(_0x467d6c){return BPromise[_0x1cb9('0x36')](_0x467d6c);}return _0x9f6401[_0x1cb9('0x37')]();};}function saveUpdates(_0x1cbd70,_0x5281ec){return function(_0x3bec79){if(_0x3bec79){return _0x3bec79['update'](_0x1cbd70)['then'](function(_0x374e29){return _0x374e29;});}return null;};}function removeEntity(_0x20d8b9,_0x1a748b){return function(_0x44c76b){if(_0x44c76b){return _0x44c76b['destroy']()['then'](function(){_0x20d8b9['status'](0xcc)[_0x1cb9('0x2e')]();});}};}function handleEntityNotFound(_0xbfd55c,_0x162bf2){return function(_0x826a74){if(!_0x826a74){_0xbfd55c[_0x1cb9('0x2c')](0x194);}return _0x826a74;};}function handleError(_0x1d6126,_0x39f522){_0x39f522=_0x39f522||0x1f4;return function(_0x29f2d9){logger[_0x1cb9('0x26')](_0x29f2d9[_0x1cb9('0x38')]);if(_0x29f2d9['name']){delete _0x29f2d9['name'];}_0x1d6126[_0x1cb9('0x2d')](_0x39f522)['send'](_0x29f2d9);};}exports['index']=function(_0x1111a4,_0x45b6c9){var _0x3e84d3={},_0x26fb3e={},_0x406702={'count':0x0,'rows':[]};var _0x10f1a3=db['FaxMessage'][_0x1cb9('0x39')];_0x26fb3e[_0x1cb9('0x3a')]=_['keys'](_0x10f1a3);_0x26fb3e[_0x1cb9('0x3b')]=_[_0x1cb9('0x3c')](_0x1111a4[_0x1cb9('0x3b')]);_0x26fb3e[_0x1cb9('0x3d')]=_[_0x1cb9('0x3e')](_0x26fb3e[_0x1cb9('0x3a')],_0x26fb3e[_0x1cb9('0x3b')]);_0x3e84d3[_0x1cb9('0x3f')]=_[_0x1cb9('0x3e')](_0x26fb3e['model'],qs['fields'](_0x1111a4[_0x1cb9('0x3b')][_0x1cb9('0x40')]));_0x3e84d3['attributes']=_0x3e84d3[_0x1cb9('0x3f')][_0x1cb9('0x41')]?_0x3e84d3[_0x1cb9('0x3f')]:_0x26fb3e['model'];if(!_0x1111a4[_0x1cb9('0x3b')][_0x1cb9('0x42')](_0x1cb9('0x43'))){_0x3e84d3[_0x1cb9('0x32')]=qs['limit'](_0x1111a4[_0x1cb9('0x3b')][_0x1cb9('0x32')]);_0x3e84d3[_0x1cb9('0x31')]=qs[_0x1cb9('0x31')](_0x1111a4['query'][_0x1cb9('0x31')]);}_0x3e84d3[_0x1cb9('0x44')]=qs[_0x1cb9('0x45')](_0x1111a4['query'][_0x1cb9('0x45')]);_0x3e84d3[_0x1cb9('0x46')]=qs['filters'](_['pick'](_0x1111a4[_0x1cb9('0x3b')],_0x26fb3e['filters']));if(_0x1111a4[_0x1cb9('0x3b')][_0x1cb9('0x47')]){_0x3e84d3[_0x1cb9('0x46')]=_[_0x1cb9('0x48')](_0x3e84d3[_0x1cb9('0x46')],{'$or':_['map'](_0x10f1a3,function(_0x497864){if(_0x497864[_0x1cb9('0x49')][_0x1cb9('0x4a')]!==_0x1cb9('0x4b')){var _0x461c6c={};_0x461c6c[_0x497864[_0x1cb9('0x4c')]]={'$like':'%'+_0x1111a4[_0x1cb9('0x3b')][_0x1cb9('0x47')]+'%'};return _0x461c6c;}})});}_0x3e84d3=_['merge']({},_0x3e84d3,_0x1111a4[_0x1cb9('0x4d')]);var _0x5c9125={'where':_0x3e84d3[_0x1cb9('0x46')]};return db[_0x1cb9('0x4e')][_0x1cb9('0x30')](_0x5c9125)[_0x1cb9('0x22')](function(_0x275cfd){_0x406702[_0x1cb9('0x30')]=_0x275cfd;if(_0x1111a4['query'][_0x1cb9('0x4f')]){_0x3e84d3[_0x1cb9('0x50')]=[{'all':!![]}];}return db[_0x1cb9('0x4e')][_0x1cb9('0x51')](_0x3e84d3);})[_0x1cb9('0x22')](function(_0x5723e4){_0x406702[_0x1cb9('0x52')]=_0x5723e4;return _0x406702;})[_0x1cb9('0x22')](respondWithFilteredResult(_0x45b6c9,_0x3e84d3))[_0x1cb9('0x2b')](handleError(_0x45b6c9,null));};exports[_0x1cb9('0x53')]=function(_0x53f238,_0x56ad4d){var _0x5edc03={'raw':!![],'where':{'id':_0x53f238['params']['id']}},_0xc58431={};_0xc58431[_0x1cb9('0x3a')]=_[_0x1cb9('0x3c')](db[_0x1cb9('0x4e')][_0x1cb9('0x39')]);_0xc58431[_0x1cb9('0x3b')]=_[_0x1cb9('0x3c')](_0x53f238[_0x1cb9('0x3b')]);_0xc58431['filters']=_[_0x1cb9('0x3e')](_0xc58431[_0x1cb9('0x3a')],_0xc58431[_0x1cb9('0x3b')]);_0x5edc03[_0x1cb9('0x3f')]=_[_0x1cb9('0x3e')](_0xc58431[_0x1cb9('0x3a')],qs[_0x1cb9('0x40')](_0x53f238[_0x1cb9('0x3b')][_0x1cb9('0x40')]));_0x5edc03['attributes']=_0x5edc03['attributes'][_0x1cb9('0x41')]?_0x5edc03[_0x1cb9('0x3f')]:_0xc58431[_0x1cb9('0x3a')];if(_0x53f238[_0x1cb9('0x3b')][_0x1cb9('0x4f')]){_0x5edc03['include']=[{'all':!![]}];}_0x5edc03=_[_0x1cb9('0x48')]({},_0x5edc03,_0x53f238['options']);return db[_0x1cb9('0x4e')]['find'](_0x5edc03)[_0x1cb9('0x22')](handleEntityNotFound(_0x56ad4d,null))[_0x1cb9('0x22')](respondWithResult(_0x56ad4d,null))[_0x1cb9('0x2b')](handleError(_0x56ad4d,null));};exports[_0x1cb9('0x54')]=function(_0x185276,_0x382676){if(_0x185276[_0x1cb9('0x55')]['id']){delete _0x185276['body']['id'];}return db[_0x1cb9('0x4e')][_0x1cb9('0x56')]({'where':{'id':_0x185276[_0x1cb9('0x57')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x382676,null))[_0x1cb9('0x22')](saveUpdates(_0x185276[_0x1cb9('0x55')],null))['then'](respondWithResult(_0x382676,null))['catch'](handleError(_0x382676,null));};exports['destroy']=function(_0x3e0d50,_0xb11ed1){return db[_0x1cb9('0x4e')]['find']({'where':{'id':_0x3e0d50[_0x1cb9('0x57')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0xb11ed1,null))[_0x1cb9('0x22')](removeEntity(_0xb11ed1,null))[_0x1cb9('0x2b')](handleError(_0xb11ed1,null));};exports[_0x1cb9('0x58')]=function(_0x37619e,_0x2ab407){return db[_0x1cb9('0x4e')]['describe']()['then'](respondWithResult(_0x2ab407,null))['catch'](handleError(_0x2ab407,null));};var interaction_log=require('../../config/logger')(_0x1cb9('0x59'));exports['accept']=function(_0x327918,_0x225725,_0x334ef2){var _0x35ba6e={'channel':'fax'};if(_0x327918[_0x1cb9('0x55')]['id']){delete _0x327918[_0x1cb9('0x55')]['id'];}_0x327918['body'][_0x1cb9('0x5a')]=!![];_0x327918[_0x1cb9('0x55')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x327918[_0x1cb9('0x55')][_0x1cb9('0x5b')]=_0x327918[_0x1cb9('0x55')][_0x1cb9('0x5b')]||_0x327918[_0x1cb9('0x5c')]['id'];return db[_0x1cb9('0x4e')]['find']({'where':{'id':_0x327918[_0x1cb9('0x57')]['id'],'UserId':null},'include':[{'model':db[_0x1cb9('0x5d')],'as':'Contact'}]})[_0x1cb9('0x22')](handleEntityNotFound(_0x225725,null))[_0x1cb9('0x22')](saveUpdates(_0x327918[_0x1cb9('0x55')],null))['then'](function(_0x2d4761){if(_0x2d4761){_0x35ba6e[_0x1cb9('0x28')]=_0x2d4761[_0x1cb9('0x5e')]({'plain':!![]});return db[_0x1cb9('0x5f')][_0x1cb9('0x56')]({'where':{'id':_0x2d4761[_0x1cb9('0x60')]}});}return null;})[_0x1cb9('0x22')](handleEntityNotFound(_0x225725,null))['then'](function(_0x2aac65){if(_0x2aac65){return _0x2aac65['update']({'UserId':_0x327918[_0x1cb9('0x55')][_0x1cb9('0x5b')],'read1stAt':_['isNil'](_0x2aac65[_0x1cb9('0x61')])?moment()[_0x1cb9('0x62')](_0x1cb9('0x63')):undefined});}return null;})[_0x1cb9('0x22')](function(_0x420d0f){if(_0x420d0f){_0x35ba6e[_0x1cb9('0x64')]=_0x420d0f[_0x1cb9('0x5e')]({'plain':!![]});interaction_log[_0x1cb9('0x29')](_0x1cb9('0x65'),_0x327918[_0x1cb9('0x5c')]['id'],_0x327918[_0x1cb9('0x5c')][_0x1cb9('0x66')],_0x327918['user'][_0x1cb9('0x67')],_0x35ba6e[_0x1cb9('0x64')]['id'],_0x327918['body']?JSON[_0x1cb9('0x68')](_0x327918['body']):_0x1cb9('0x69'));return respondWithRpcPromise(_0x1cb9('0x6a'),_0x1cb9('0x6b'),_0x35ba6e);}return null;})[_0x1cb9('0x22')](function(_0x1f6cb5){if(_0x1f6cb5){if(_0x327918[_0x1cb9('0x55')][_0x1cb9('0x6c')]){_0x35ba6e[_0x1cb9('0x28')][_0x1cb9('0x6d')]=util[_0x1cb9('0x62')]('SIP/%s',_0x327918[_0x1cb9('0x5c')][_0x1cb9('0x66')]);_0x35ba6e[_0x1cb9('0x28')][_0x1cb9('0x6e')]=_0x35ba6e[_0x1cb9('0x6e')];_0x35ba6e[_0x1cb9('0x28')]['event']=_0x1cb9('0x6f');return respondWithRpcPromise(_0x1cb9('0x70'),_0x1cb9('0x70'),{'event':'acceptmessage','message':_0x35ba6e[_0x1cb9('0x28')]},client9002)[_0x1cb9('0x22')](function(){return _0x35ba6e;});}return _0x35ba6e;}return null;})[_0x1cb9('0x22')](respondWithResult(_0x225725,null))[_0x1cb9('0x2b')](handleError(_0x225725,null));};var interaction_log=require(_0x1cb9('0x14'))('fax-interactions');exports['reject']=function(_0x12593a,_0x2fcff1,_0xc0561b){var _0x2dc891={'agent':{},'channel':'fax'};if(_0x12593a[_0x1cb9('0x55')]['id']){delete _0x12593a[_0x1cb9('0x55')]['id'];}_0x12593a[_0x1cb9('0x55')][_0x1cb9('0x5b')]=_0x12593a[_0x1cb9('0x55')][_0x1cb9('0x5b')]||_0x12593a[_0x1cb9('0x5c')]['id'];_0x2dc891[_0x1cb9('0x71')]['id']=_0x12593a['body'][_0x1cb9('0x5b')];return db[_0x1cb9('0x4e')][_0x1cb9('0x56')]({'where':{'id':_0x12593a[_0x1cb9('0x57')]['id'],'UserId':null}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2fcff1,null))['then'](function(_0x1252da){if(_0x1252da){_0x2dc891[_0x1cb9('0x28')]=_0x1252da[_0x1cb9('0x5e')]({'plain':!![]});return db[_0x1cb9('0x5f')][_0x1cb9('0x56')]({'where':{'id':_0x1252da[_0x1cb9('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x2fcff1,null))[_0x1cb9('0x22')](function(_0x41a8f0){if(_0x41a8f0){_0x2dc891[_0x1cb9('0x64')]=_0x41a8f0['get']({'plain':!![]});interaction_log[_0x1cb9('0x29')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x12593a[_0x1cb9('0x5c')]['id'],_0x12593a[_0x1cb9('0x5c')][_0x1cb9('0x66')],_0x12593a[_0x1cb9('0x5c')][_0x1cb9('0x67')],_0x2dc891['interaction']['id'],_0x12593a['body']?JSON['stringify'](_0x12593a['body']):'null');return respondWithRpcPromise(_0x1cb9('0x72'),_0x1cb9('0x73'),_0x2dc891);}return null;})['then'](function(_0x2ce9cd){if(_0x2ce9cd){_0x2ce9cd[_0x1cb9('0x28')][_0x1cb9('0x6d')]=util[_0x1cb9('0x62')](_0x1cb9('0x74'),_0x12593a[_0x1cb9('0x5c')][_0x1cb9('0x66')]);_0x2ce9cd[_0x1cb9('0x28')]['channel']=_0x2dc891[_0x1cb9('0x6e')];_0x2ce9cd[_0x1cb9('0x28')][_0x1cb9('0x75')]='reject';respondWithRpcPromise(_0x1cb9('0x70'),'EventManager',{'event':'rejectmessage','message':_0x2ce9cd['message']},client9002);return _0x2dc891;}return null;})[_0x1cb9('0x22')](respondWithResult(_0x2fcff1,null))[_0x1cb9('0x2b')](handleError(_0x2fcff1,null));};exports['create']=function(_0xaa3c55,_0x37b0c7){var _0x28daa1;return db[_0x1cb9('0x4e')]['create'](_0xaa3c55[_0x1cb9('0x55')],{})[_0x1cb9('0x22')](function(_0x25e6c1){_0x28daa1=_0x25e6c1;return db[_0x1cb9('0x5d')]['findOne']({'where':{'id':_0x28daa1['ContactId']}});})[_0x1cb9('0x22')](function(_0x53463e){if(_[_0x1cb9('0x76')](_0x53463e)){return;}else{_0x28daa1[_0x1cb9('0x77')]=_0x53463e[_0x1cb9('0x77')];return db[_0x1cb9('0x78')][_0x1cb9('0x79')]({'where':{'id':_0x28daa1[_0x1cb9('0x7a')]}});}})['then'](function(_0x1ebdb9){return respondWithRpcPromise(_0x1cb9('0x7b'),_0x1cb9('0x7b'),{'FaxAccountId':_[_0x1cb9('0x76')](_0xaa3c55[_0x1cb9('0x55')])?undefined:_0xaa3c55[_0x1cb9('0x55')]['FaxAccountId'],'path':_[_0x1cb9('0x76')](_0x1ebdb9)?undefined:util[_0x1cb9('0x62')](_0x1cb9('0x7c'),_0x1ebdb9[_0x1cb9('0x7d')]),'fax':_[_0x1cb9('0x76')](_0x28daa1[_0x1cb9('0x77')])?undefined:_0x28daa1[_0x1cb9('0x77')],'AttachmentId':_0x28daa1['AttachmentId']},client9002);})[_0x1cb9('0x22')](respondWithResult(_0x37b0c7,0xc9))[_0x1cb9('0x2b')](handleError(_0x37b0c7,null));};exports['download']=function(_0x265f68,_0x46e523){var _0x4fa3d5=path[_0x1cb9('0x7e')](config[_0x1cb9('0x7f')],_0x1cb9('0x80'),'files',_0x1cb9('0x81'));return db[_0x1cb9('0x4e')][_0x1cb9('0x56')]({'where':{'id':_0x265f68[_0x1cb9('0x57')]['id']},'include':[{'model':db['Attachment'],'as':_0x1cb9('0x78')}]})[_0x1cb9('0x22')](handleEntityNotFound(_0x46e523,null))[_0x1cb9('0x22')](function(_0x2e052f){if(_0x2e052f){return _0x46e523[_0x1cb9('0x82')](path['join'](_0x4fa3d5,_0x2e052f[_0x1cb9('0x78')][_0x1cb9('0x7d')]));}})[_0x1cb9('0x2b')](handleError(_0x46e523,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index fe918de..304c574 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 _0xcf7b=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','FaxMessage'];(function(_0x29ced8,_0x4ab543){var _0x482976=function(_0xcb2fa8){while(--_0xcb2fa8){_0x29ced8['push'](_0x29ced8['shift']());}};_0x482976(++_0x4ab543);}(_0xcf7b,0x14a));var _0xbcf7=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xcf7b[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require(_0xbcf7('0x0'));var FaxMessage=require(_0xbcf7('0x1'))['db'][_0xbcf7('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xbcf7('0x3')](0x0);var events={'afterCreate':_0xbcf7('0x4'),'afterUpdate':_0xbcf7('0x5'),'afterDestroy':_0xbcf7('0x6')};function emitEvent(_0x4a60e5){return function(_0x15150e,_0x223682,_0x389e0e){FaxMessageEvents[_0xbcf7('0x7')](_0x4a60e5+':'+_0x15150e['id'],_0x15150e);FaxMessageEvents[_0xbcf7('0x7')](_0x4a60e5,_0x15150e);_0x389e0e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xbcf7('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0xf55b=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x41c544,_0x413c5c){var _0x3f8116=function(_0x427e9c){while(--_0x427e9c){_0x41c544['push'](_0x41c544['shift']());}};_0x3f8116(++_0x413c5c);}(_0xf55b,0x1c4));var _0xbf55=function(_0x4e7d18,_0x4e11ff){_0x4e7d18=_0x4e7d18-0x0;var _0x2f9d69=_0xf55b[_0x4e7d18];return _0x2f9d69;};'use strict';var EventEmitter=require(_0xbf55('0x0'));var FaxMessage=require(_0xbf55('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xbf55('0x2')](0x0);var events={'afterCreate':_0xbf55('0x3'),'afterUpdate':_0xbf55('0x4'),'afterDestroy':_0xbf55('0x5')};function emitEvent(_0x5a299d){return function(_0x173604,_0xf5dd3b,_0x4feacb){FaxMessageEvents[_0xbf55('0x6')](_0x5a299d+':'+_0x173604['id'],_0x173604);FaxMessageEvents[_0xbf55('0x6')](_0x5a299d,_0x173604);_0x4feacb(null);};}for(var e in events){if(events[_0xbf55('0x7')](e)){var event=events[e];FaxMessage[_0xbf55('0x8')](e,emitEvent(event));}}module[_0xbf55('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index a7bc381..83464c3 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 _0x60f4=['utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','get','direction','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x60f4,0x143));var _0x460f=function(_0x3a456e,_0xc93d26){_0x3a456e=_0x3a456e-0x0;var _0x5a7eb8=_0x60f4[_0x3a456e];return _0x5a7eb8;};'use strict';var _=require('lodash');var util=require(_0x460f('0x0'));var logger=require(_0x460f('0x1'))('api');var moment=require(_0x460f('0x2'));var BPromise=require('bluebird');var rp=require(_0x460f('0x3'));var attributes=require(_0x460f('0x4'));module[_0x460f('0x5')]=function(_0x33b468,_0x5414db){return _0x33b468[_0x460f('0x6')](_0x460f('0x7'),attributes,{'tableName':_0x460f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x258b62,_0x193c0c,_0x259b1d){var _0x226807=_0x33b468['models'];var _0x165225=_0x258b62[_0x460f('0x9')]({'plain':!![]});if(_0x165225[_0x460f('0xa')]['toLowerCase']()==='in'||_0x165225[_0x460f('0xa')]['toLowerCase']()===_0x460f('0xb')&&!_0x165225[_0x460f('0xc')]&&!_['isNil'](_0x165225[_0x460f('0xd')])){_0x226807[_0x460f('0xe')][_0x460f('0xf')]({'where':{'id':_0x165225[_0x460f('0x10')]}})[_0x460f('0x11')](function(_0x33e16f){if(_0x33e16f){_0x33e16f['update']({'lastMsgAt':_0x165225[_0x460f('0x12')],'lastMsgDirection':_0x165225[_0x460f('0xa')]['toLowerCase'](),'lastMsgBody':_0x165225['body']});}})[_0x460f('0x13')](function(_0x2b96db){console[_0x460f('0x14')](_0x2b96db);});}_0x259b1d();}},'charset':_0x460f('0x15'),'collate':_0x460f('0x16')});}; \ No newline at end of file +var _0x0c95=['define','FaxMessage','fax_messages','models','get','direction','toLowerCase','out','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','body','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','./faxMessage.attributes','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0c95,0x12c));var _0x50c9=function(_0x5f035f,_0x5300d1){_0x5f035f=_0x5f035f-0x0;var _0xad281e=_0x0c95[_0x5f035f];return _0xad281e;};'use strict';var _=require(_0x50c9('0x0'));var util=require('util');var logger=require(_0x50c9('0x1'))(_0x50c9('0x2'));var moment=require(_0x50c9('0x3'));var BPromise=require(_0x50c9('0x4'));var rp=require(_0x50c9('0x5'));var attributes=require(_0x50c9('0x6'));module[_0x50c9('0x7')]=function(_0xa7988d,_0x28f072){return _0xa7988d[_0x50c9('0x8')](_0x50c9('0x9'),attributes,{'tableName':_0x50c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x220894,_0x4cd15c,_0x39744e){var _0x2237bd=_0xa7988d[_0x50c9('0xb')];var _0x4c6b5b=_0x220894[_0x50c9('0xc')]({'plain':!![]});if(_0x4c6b5b[_0x50c9('0xd')][_0x50c9('0xe')]()==='in'||_0x4c6b5b[_0x50c9('0xd')][_0x50c9('0xe')]()===_0x50c9('0xf')&&!_0x4c6b5b['secret']&&!_['isNil'](_0x4c6b5b[_0x50c9('0x10')])){_0x2237bd[_0x50c9('0x11')][_0x50c9('0x12')]({'where':{'id':_0x4c6b5b[_0x50c9('0x13')]}})[_0x50c9('0x14')](function(_0x4ca8b5){if(_0x4ca8b5){_0x4ca8b5[_0x50c9('0x15')]({'lastMsgAt':_0x4c6b5b[_0x50c9('0x16')],'lastMsgDirection':_0x4c6b5b['direction']['toLowerCase'](),'lastMsgBody':_0x4c6b5b[_0x50c9('0x17')]});}})[_0x50c9('0x18')](function(_0x113716){console[_0x50c9('0x19')](_0x113716);});}_0x39744e();}},'charset':_0x50c9('0x1a'),'collate':_0x50c9('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index acdfc43..990ff06 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 _0x9879=['update','body','where','attributes','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','options','raw','catch','UpdateFaxMessage'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9879,0x98));var _0x9987=function(_0x2c7925,_0x32c9e9){_0x2c7925=_0x2c7925-0x0;var _0x49d53d=_0x9879[_0x2c7925];return _0x49d53d;};'use strict';var _=require(_0x9987('0x0'));var util=require(_0x9987('0x1'));var moment=require(_0x9987('0x2'));var BPromise=require('bluebird');var rs=require(_0x9987('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9987('0x4'))['db'];var utils=require(_0x9987('0x5'));var logger=require(_0x9987('0x6'))(_0x9987('0x7'));var config=require(_0x9987('0x8'));var jayson=require(_0x9987('0x9'));var client=jayson[_0x9987('0xa')]['http']({'port':0x232a});config[_0x9987('0xb')]=_['defaults'](config[_0x9987('0xb')],{'host':_0x9987('0xc'),'port':0x18eb});var socket=require(_0x9987('0xd'))(new Redis(config[_0x9987('0xb')]));require(_0x9987('0xe'))[_0x9987('0xf')](socket);function respondWithRpcPromise(_0x1fb6ec,_0x127a7a,_0x177ccc){return new BPromise(function(_0x3b6bc2,_0x40a851){return client[_0x9987('0x10')](_0x1fb6ec,_0x177ccc)[_0x9987('0x11')](function(_0x1ef5cb){logger[_0x9987('0x12')](_0x9987('0x13'),_0x127a7a,_0x9987('0x14'));logger[_0x9987('0x15')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x127a7a,_0x9987('0x14'),JSON[_0x9987('0x16')](_0x1ef5cb));if(_0x1ef5cb[_0x9987('0x17')]){if(_0x1ef5cb[_0x9987('0x17')][_0x9987('0x18')]===0x1f4){logger['error'](_0x9987('0x13'),_0x127a7a,_0x1ef5cb['error'][_0x9987('0x19')]);return _0x40a851(_0x1ef5cb[_0x9987('0x17')][_0x9987('0x19')]);}logger[_0x9987('0x17')](_0x9987('0x13'),_0x127a7a,_0x1ef5cb[_0x9987('0x17')][_0x9987('0x19')]);return _0x3b6bc2(_0x1ef5cb[_0x9987('0x17')][_0x9987('0x19')]);}else{logger[_0x9987('0x12')](_0x9987('0x13'),_0x127a7a,_0x9987('0x14'));_0x3b6bc2(_0x1ef5cb[_0x9987('0x1a')]['message']);}})['catch'](function(_0xc3c8d8){logger[_0x9987('0x17')](_0x9987('0x13'),_0x127a7a,_0xc3c8d8);_0x40a851(_0xc3c8d8);});});}exports[_0x9987('0x1b')]=function(_0x5c9e62){var _0x217e1e=this;return new Promise(function(_0x142924,_0x43379d){return db[_0x9987('0x1c')]['create'](_0x5c9e62['body'],{'raw':_0x5c9e62['options']?_0x5c9e62[_0x9987('0x1d')][_0x9987('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x1dccea){logger['info'](_0x9987('0x1b'),_0x5c9e62);logger[_0x9987('0x15')](_0x9987('0x1b'),_0x5c9e62,JSON[_0x9987('0x16')](_0x1dccea));_0x142924(_0x1dccea);})[_0x9987('0x1f')](function(_0x2c867c){logger[_0x9987('0x17')]('CreateFaxMessage',_0x2c867c['message'],_0x5c9e62);_0x43379d(_0x217e1e[_0x9987('0x17')](0x1f4,_0x2c867c[_0x9987('0x19')]));});});};exports[_0x9987('0x20')]=function(_0x468ae1){var _0x230402=this;return new Promise(function(_0x4c442a,_0x11863a){return db[_0x9987('0x1c')][_0x9987('0x21')](_0x468ae1[_0x9987('0x22')],{'raw':_0x468ae1[_0x9987('0x1d')]?_0x468ae1['options'][_0x9987('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x468ae1['options']?_0x468ae1['options'][_0x9987('0x23')]||null:null,'attributes':_0x468ae1['options']?_0x468ae1[_0x9987('0x1d')][_0x9987('0x24')]||null:null,'limit':_0x468ae1[_0x9987('0x1d')]?_0x468ae1['options']['limit']||null:null})['then'](function(_0x506ab2){logger[_0x9987('0x12')](_0x9987('0x20'),_0x468ae1);logger[_0x9987('0x15')](_0x9987('0x20'),_0x468ae1,JSON[_0x9987('0x16')](_0x506ab2));_0x4c442a(_0x506ab2);})[_0x9987('0x1f')](function(_0x50915e){logger[_0x9987('0x17')](_0x9987('0x20'),_0x50915e['message'],_0x468ae1);_0x11863a(_0x230402[_0x9987('0x17')](0x1f4,_0x50915e[_0x9987('0x19')]));});});}; \ No newline at end of file +var _0x818f=['raw','debug','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateFaxMessage','FaxMessage','create','body','options'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x818f,0x1da));var _0xf818=function(_0x1a53da,_0x23e0ec){_0x1a53da=_0x1a53da-0x0;var _0x188f7e=_0x818f[_0x1a53da];return _0x188f7e;};'use strict';var _=require(_0xf818('0x0'));var util=require(_0xf818('0x1'));var moment=require(_0xf818('0x2'));var BPromise=require(_0xf818('0x3'));var rs=require(_0xf818('0x4'));var fs=require('fs');var Redis=require(_0xf818('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf818('0x6'));var logger=require(_0xf818('0x7'))(_0xf818('0x8'));var config=require(_0xf818('0x9'));var jayson=require(_0xf818('0xa'));var client=jayson[_0xf818('0xb')][_0xf818('0xc')]({'port':0x232a});config[_0xf818('0xd')]=_[_0xf818('0xe')](config['redis'],{'host':_0xf818('0xf'),'port':0x18eb});var socket=require(_0xf818('0x10'))(new Redis(config[_0xf818('0xd')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0xd4bcb3,_0x188f49,_0x458873){return new BPromise(function(_0x3386f9,_0x2d9470){return client['request'](_0xd4bcb3,_0x458873)[_0xf818('0x11')](function(_0x2b1f0e){logger[_0xf818('0x12')](_0xf818('0x13'),_0x188f49,_0xf818('0x14'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x188f49,_0xf818('0x14'),JSON[_0xf818('0x15')](_0x2b1f0e));if(_0x2b1f0e[_0xf818('0x16')]){if(_0x2b1f0e[_0xf818('0x16')]['code']===0x1f4){logger[_0xf818('0x16')](_0xf818('0x13'),_0x188f49,_0x2b1f0e[_0xf818('0x16')][_0xf818('0x17')]);return _0x2d9470(_0x2b1f0e[_0xf818('0x16')]['message']);}logger['error'](_0xf818('0x13'),_0x188f49,_0x2b1f0e['error'][_0xf818('0x17')]);return _0x3386f9(_0x2b1f0e[_0xf818('0x16')]['message']);}else{logger[_0xf818('0x12')](_0xf818('0x13'),_0x188f49,_0xf818('0x14'));_0x3386f9(_0x2b1f0e['result'][_0xf818('0x17')]);}})[_0xf818('0x18')](function(_0x2d9f81){logger['error']('FaxMessage,\x20%s,\x20%s',_0x188f49,_0x2d9f81);_0x2d9470(_0x2d9f81);});});}exports[_0xf818('0x19')]=function(_0x1505ab){var _0x5c63d9=this;return new Promise(function(_0x31a4d3,_0x505a1f){return db[_0xf818('0x1a')][_0xf818('0x1b')](_0x1505ab[_0xf818('0x1c')],{'raw':_0x1505ab['options']?_0x1505ab[_0xf818('0x1d')][_0xf818('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x324a30){logger[_0xf818('0x12')](_0xf818('0x19'),_0x1505ab);logger[_0xf818('0x1f')](_0xf818('0x19'),_0x1505ab,JSON[_0xf818('0x15')](_0x324a30));_0x31a4d3(_0x324a30);})[_0xf818('0x18')](function(_0x49a619){logger['error'](_0xf818('0x19'),_0x49a619[_0xf818('0x17')],_0x1505ab);_0x505a1f(_0x5c63d9['error'](0x1f4,_0x49a619[_0xf818('0x17')]));});});};exports[_0xf818('0x20')]=function(_0x57627f){var _0x565b71=this;return new Promise(function(_0x102d1a,_0x2b99dd){return db[_0xf818('0x1a')][_0xf818('0x21')](_0x57627f[_0xf818('0x1c')],{'raw':_0x57627f['options']?_0x57627f[_0xf818('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57627f[_0xf818('0x1d')]?_0x57627f['options']['where']||null:null,'attributes':_0x57627f['options']?_0x57627f[_0xf818('0x1d')][_0xf818('0x22')]||null:null,'limit':_0x57627f[_0xf818('0x1d')]?_0x57627f['options'][_0xf818('0x23')]||null:null})[_0xf818('0x11')](function(_0x445ec3){logger[_0xf818('0x12')](_0xf818('0x20'),_0x57627f);logger[_0xf818('0x1f')](_0xf818('0x20'),_0x57627f,JSON['stringify'](_0x445ec3));_0x102d1a(_0x445ec3);})['catch'](function(_0x364672){logger[_0xf818('0x16')](_0xf818('0x20'),_0x364672['message'],_0x57627f);_0x2b99dd(_0x565b71[_0xf818('0x16')](0x1f4,_0x364672[_0xf818('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 3ee12b3..2b727ef 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 _0x294b=['./faxMessage.events','remove','update','emit','removeListener','register'];(function(_0x2be485,_0x45fa7d){var _0xee7b5=function(_0x42ec79){while(--_0x42ec79){_0x2be485['push'](_0x2be485['shift']());}};_0xee7b5(++_0x45fa7d);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var FaxMessageEvents=require(_0xb294('0x0'));var events=['save',_0xb294('0x1'),_0xb294('0x2')];function createListener(_0x3fb36e,_0x411640){return function(_0x1cd458){_0x411640[_0xb294('0x3')](_0x3fb36e,_0x1cd458);};}function removeListener(_0x58fe24,_0x5c0237){return function(){FaxMessageEvents[_0xb294('0x4')](_0x58fe24,_0x5c0237);};}exports[_0xb294('0x5')]=function(_0xaa6a67){for(var _0x181f5e=0x0,_0xcc7910=events['length'];_0x181f5e<_0xcc7910;_0x181f5e++){var _0x39dfbf=events[_0x181f5e];var _0x5110aa=createListener('faxMessage:'+_0x39dfbf,_0xaa6a67);FaxMessageEvents['on'](_0x39dfbf,_0x5110aa);}}; \ No newline at end of file +var _0x3308=['register','faxMessage:','update','emit','removeListener'];(function(_0x2bdcfd,_0x32697d){var _0x53a635=function(_0x5de676){while(--_0x5de676){_0x2bdcfd['push'](_0x2bdcfd['shift']());}};_0x53a635(++_0x32697d);}(_0x3308,0x12e));var _0x8330=function(_0x4cfba6,_0x218f6f){_0x4cfba6=_0x4cfba6-0x0;var _0x479538=_0x3308[_0x4cfba6];return _0x479538;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save','remove',_0x8330('0x0')];function createListener(_0x38c12e,_0x38d12e){return function(_0x1ecf6b){_0x38d12e[_0x8330('0x1')](_0x38c12e,_0x1ecf6b);};}function removeListener(_0x5f52e6,_0x28d8af){return function(){FaxMessageEvents[_0x8330('0x2')](_0x5f52e6,_0x28d8af);};}exports[_0x8330('0x3')]=function(_0x131c05){for(var _0x14ac10=0x0,_0x379821=events['length'];_0x14ac10<_0x379821;_0x14ac10++){var _0x295526=events[_0x14ac10];var _0x2961c1=createListener(_0x8330('0x4')+_0x295526,_0x131c05);FaxMessageEvents['on'](_0x295526,_0x2961c1);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 96b1f2c..e0bd404 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 _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(_0x49eff5,_0x16a431){var _0x3617d1=function(_0x344b42){while(--_0x344b42){_0x49eff5['push'](_0x49eff5['shift']());}};_0x3617d1(++_0x16a431);}(_0x9f0e,0x116));var _0xe9f0=function(_0x43995d,_0x50617e){_0x43995d=_0x43995d-0x0;var _0x5d2ce9=_0x9f0e[_0x43995d];return _0x5d2ce9;};'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 +var _0x81c6=['post','tracked','fax','put','/:id/reject','reject','delete','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x2a3c0a,_0x163f5c){var _0x1703a2=function(_0x471dfe){while(--_0x471dfe){_0x2a3c0a['push'](_0x2a3c0a['shift']());}};_0x1703a2(++_0x163f5c);}(_0x81c6,0x1d5));var _0x681c=function(_0x35e7f5,_0x2c52b8){_0x35e7f5=_0x35e7f5-0x0;var _0x290a15=_0x81c6[_0x35e7f5];return _0x290a15;};'use strict';var multer=require('multer');var util=require(_0x681c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x681c('0x1')]();var auth=require(_0x681c('0x2'));var interaction=require(_0x681c('0x3'));var config=require('../../config/environment');var controller=require(_0x681c('0x4'));router[_0x681c('0x5')]('/',auth[_0x681c('0x6')](),controller[_0x681c('0x7')]);router['get'](_0x681c('0x8'),auth[_0x681c('0x6')](),controller['describe']);router['get'](_0x681c('0x9'),auth[_0x681c('0x6')](),controller[_0x681c('0xa')]);router['get']('/:id/download',auth[_0x681c('0x6')](),controller['download']);router[_0x681c('0xb')]('/',auth[_0x681c('0x6')](),interaction[_0x681c('0xc')](_0x681c('0xd'),'faxmessage:create'),controller['create']);router[_0x681c('0xe')](_0x681c('0x9'),auth[_0x681c('0x6')](),controller['update']);router[_0x681c('0xe')]('/:id/accept',auth[_0x681c('0x6')](),controller['accept']);router[_0x681c('0xe')](_0x681c('0xf'),auth[_0x681c('0x6')](),controller[_0x681c('0x10')]);router[_0x681c('0x11')](_0x681c('0x9'),auth['isAuthenticated'](),controller[_0x681c('0x12')]);module[_0x681c('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 2e03139..158030a 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 _0x1ec1=['INTEGER','exports','STRING','name','ENUM','rrmemory','roundrobin'];(function(_0x536ddb,_0x31abda){var _0x34f7cc=function(_0x38cbcf){while(--_0x38cbcf){_0x536ddb['push'](_0x536ddb['shift']());}};_0x34f7cc(++_0x31abda);}(_0x1ec1,0xda));var _0x11ec=function(_0x1d1416,_0x2dd11e){_0x1d1416=_0x1d1416-0x0;var _0x318e34=_0x1ec1[_0x1d1416];return _0x318e34;};'use strict';var Sequelize=require('sequelize');module[_0x11ec('0x0')]={'name':{'type':Sequelize[_0x11ec('0x1')],'unique':_0x11ec('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x11ec('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x11ec('0x3')](_0x11ec('0x4'),'beepall',_0x11ec('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x11ec('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x224a=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x224a,0x1a8));var _0xa224=function(_0x1092d4,_0x217056){_0x1092d4=_0x1092d4-0x0;var _0x4b464c=_0x224a[_0x1092d4];return _0x4b464c;};'use strict';var Sequelize=require(_0xa224('0x0'));module[_0xa224('0x1')]={'name':{'type':Sequelize[_0xa224('0x2')],'unique':_0xa224('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa224('0x2')]},'timeout':{'type':Sequelize[_0xa224('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa224('0x5')](_0xa224('0x6'),_0xa224('0x7'),_0xa224('0x8')),'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 7559ac0..678f0b8 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 _0x9d9d=['keys','filters','intersection','query','attributes','fields','length','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','include','findAll','catch','show','params','rawAttributes','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','nolimit','FaxQueueId','UserFaxQueue','findAndCountAll','faxPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','addTeams','Team','User','Agents','penalty','ids','removeTeams','union','removeAgents','addAgents','omit','emit','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','FaxQueue','model'];(function(_0x623991,_0xf0846f){var _0x2491fa=function(_0x454643){while(--_0x454643){_0x623991['push'](_0x623991['shift']());}};_0x2491fa(++_0xf0846f);}(_0x9d9d,0x129));var _0xd9d9=function(_0x145e49,_0x57266b){_0x145e49=_0x145e49-0x0;var _0x1fe87c=_0x9d9d[_0x145e49];return _0x1fe87c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd9d9('0x0'));var rimraf=require(_0xd9d9('0x1'));var zipdir=require(_0xd9d9('0x2'));var jsonpatch=require(_0xd9d9('0x3'));var rp=require(_0xd9d9('0x4'));var moment=require('moment');var BPromise=require(_0xd9d9('0x5'));var Mustache=require(_0xd9d9('0x6'));var util=require(_0xd9d9('0x7'));var path=require(_0xd9d9('0x8'));var sox=require(_0xd9d9('0x9'));var csv=require(_0xd9d9('0xa'));var ejs=require(_0xd9d9('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd9d9('0xc'));var jsforce=require(_0xd9d9('0xd'));var deskjs=require(_0xd9d9('0xe'));var toCsv=require(_0xd9d9('0xa'));var querystring=require(_0xd9d9('0xf'));var Papa=require('papaparse');var authService=require(_0xd9d9('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xd9d9('0x11'));var qs=require(_0xd9d9('0x12'));var logger=require('../../config/logger')(_0xd9d9('0x13'));var utils=require('../../config/utils');var config=require(_0xd9d9('0x14'));var db=require('../../mysqldb')['db'];config[_0xd9d9('0x15')]=_[_0xd9d9('0x16')](config[_0xd9d9('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xd9d9('0x17'))(new Redis(config[_0xd9d9('0x15')]));require('./faxQueue.socket')[_0xd9d9('0x18')](socket);function respondWithStatusCode(_0x550392,_0x54bf64){_0x54bf64=_0x54bf64||0xcc;return function(_0x3e1c02){if(_0x3e1c02){return _0x550392[_0xd9d9('0x19')](_0x54bf64);}return _0x550392['status'](_0x54bf64)[_0xd9d9('0x1a')]();};}function respondWithResult(_0x25ca0a,_0x54ef05){_0x54ef05=_0x54ef05||0xc8;return function(_0x417eda){if(_0x417eda){return _0x25ca0a['status'](_0x54ef05)[_0xd9d9('0x1b')](_0x417eda);}};}function respondWithFilteredResult(_0x14d993,_0x2787fe){return function(_0x330fac){if(_0x330fac){var _0x124a81=_0x330fac[_0xd9d9('0x1c')],_0x123d50=_0x2787fe[_0xd9d9('0x1d')],_0x5462ed=_0x2787fe[_0xd9d9('0x1d')]+_0x2787fe[_0xd9d9('0x1e')],_0x13748e;if(_0x5462ed>=_0x124a81){_0x5462ed=_0x124a81;_0x13748e=0xc8;}else{_0x13748e=0xce;}_0x14d993[_0xd9d9('0x1f')](_0x13748e);return _0x14d993[_0xd9d9('0x20')](_0xd9d9('0x21'),_0x123d50+'-'+_0x5462ed+'/'+_0x124a81)[_0xd9d9('0x1b')](_0x330fac);}return null;};}function patchUpdates(_0x4f5cf5){return function(_0x33c970){try{jsonpatch[_0xd9d9('0x22')](_0x33c970,_0x4f5cf5,!![]);}catch(_0x5dbf85){return BPromise[_0xd9d9('0x23')](_0x5dbf85);}return _0x33c970[_0xd9d9('0x24')]();};}function saveUpdates(_0x2dddfa,_0x372225){return function(_0x2fb324){if(_0x2fb324){return _0x2fb324[_0xd9d9('0x25')](_0x2dddfa)['then'](function(_0x211465){return _0x211465;});}return null;};}function removeEntity(_0x532723,_0x15554f){return function(_0x2e859c){if(_0x2e859c){return _0x2e859c[_0xd9d9('0x26')]()[_0xd9d9('0x27')](function(){var _0x1dae15=_0x2e859c[_0xd9d9('0x28')]({'plain':!![]});var _0x29ee73='FaxQueues';return db[_0xd9d9('0x29')][_0xd9d9('0x26')]({'where':{'type':_0x29ee73,'resourceId':_0x1dae15['id']}})['then'](function(){return _0x2e859c;});})[_0xd9d9('0x27')](function(){_0x532723[_0xd9d9('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x815152,_0x34ed1e){return function(_0x350503){if(!_0x350503){_0x815152[_0xd9d9('0x19')](0x194);}return _0x350503;};}function handleError(_0xdfad20,_0x3f88d6){_0x3f88d6=_0x3f88d6||0x1f4;return function(_0x2e1d83){logger['error'](_0x2e1d83[_0xd9d9('0x2a')]);if(_0x2e1d83[_0xd9d9('0x2b')]){delete _0x2e1d83[_0xd9d9('0x2b')];}_0xdfad20[_0xd9d9('0x1f')](_0x3f88d6)[_0xd9d9('0x2c')](_0x2e1d83);};}exports[_0xd9d9('0x2d')]=function(_0x3ff4bb,_0x5133c8){var _0x37f8c2={},_0x3a12d1={},_0x1869b6={'count':0x0,'rows':[]};var _0x51c023=db[_0xd9d9('0x2e')]['rawAttributes'];_0x3a12d1[_0xd9d9('0x2f')]=_[_0xd9d9('0x30')](_0x51c023);_0x3a12d1['query']=_[_0xd9d9('0x30')](_0x3ff4bb['query']);_0x3a12d1[_0xd9d9('0x31')]=_[_0xd9d9('0x32')](_0x3a12d1[_0xd9d9('0x2f')],_0x3a12d1[_0xd9d9('0x33')]);_0x37f8c2[_0xd9d9('0x34')]=_[_0xd9d9('0x32')](_0x3a12d1[_0xd9d9('0x2f')],qs[_0xd9d9('0x35')](_0x3ff4bb[_0xd9d9('0x33')]['fields']));_0x37f8c2['attributes']=_0x37f8c2[_0xd9d9('0x34')][_0xd9d9('0x36')]?_0x37f8c2[_0xd9d9('0x34')]:_0x3a12d1[_0xd9d9('0x2f')];if(!_0x3ff4bb['query']['hasOwnProperty']('nolimit')){_0x37f8c2[_0xd9d9('0x1e')]=qs[_0xd9d9('0x1e')](_0x3ff4bb[_0xd9d9('0x33')][_0xd9d9('0x1e')]);_0x37f8c2[_0xd9d9('0x1d')]=qs['offset'](_0x3ff4bb[_0xd9d9('0x33')]['offset']);}_0x37f8c2[_0xd9d9('0x37')]=qs[_0xd9d9('0x38')](_0x3ff4bb['query']['sort']);_0x37f8c2[_0xd9d9('0x39')]=qs['filters'](_[_0xd9d9('0x3a')](_0x3ff4bb['query'],_0x3a12d1['filters']));if(_0x3ff4bb[_0xd9d9('0x33')]['filter']){_0x37f8c2['where']=_['merge'](_0x37f8c2[_0xd9d9('0x39')],{'$or':_[_0xd9d9('0x3b')](_0x51c023,function(_0x22a350){if(_0x22a350[_0xd9d9('0x3c')][_0xd9d9('0x3d')]!==_0xd9d9('0x3e')){var _0x29ec3f={};_0x29ec3f[_0x22a350[_0xd9d9('0x3f')]]={'$like':'%'+_0x3ff4bb['query'][_0xd9d9('0x40')]+'%'};return _0x29ec3f;}})});}_0x37f8c2=_[_0xd9d9('0x41')]({},_0x37f8c2,_0x3ff4bb['options']);var _0x142e12={'where':_0x37f8c2['where']};return db[_0xd9d9('0x2e')]['count'](_0x142e12)['then'](function(_0x395cac){_0x1869b6[_0xd9d9('0x1c')]=_0x395cac;if(_0x3ff4bb[_0xd9d9('0x33')]['includeAll']){_0x37f8c2[_0xd9d9('0x42')]=[{'all':!![]}];}return db[_0xd9d9('0x2e')][_0xd9d9('0x43')](_0x37f8c2);})['then'](function(_0x4edc23){_0x1869b6['rows']=_0x4edc23;return _0x1869b6;})[_0xd9d9('0x27')](respondWithFilteredResult(_0x5133c8,_0x37f8c2))[_0xd9d9('0x44')](handleError(_0x5133c8,null));};exports[_0xd9d9('0x45')]=function(_0x6aab0a,_0x3aea7d){var _0x41e277={'raw':!![],'where':{'id':_0x6aab0a[_0xd9d9('0x46')]['id']}},_0x23794c={};_0x23794c[_0xd9d9('0x2f')]=_[_0xd9d9('0x30')](db[_0xd9d9('0x2e')][_0xd9d9('0x47')]);_0x23794c[_0xd9d9('0x33')]=_[_0xd9d9('0x30')](_0x6aab0a['query']);_0x23794c[_0xd9d9('0x31')]=_['intersection'](_0x23794c[_0xd9d9('0x2f')],_0x23794c['query']);_0x41e277['attributes']=_['intersection'](_0x23794c[_0xd9d9('0x2f')],qs[_0xd9d9('0x35')](_0x6aab0a[_0xd9d9('0x33')][_0xd9d9('0x35')]));_0x41e277['attributes']=_0x41e277[_0xd9d9('0x34')][_0xd9d9('0x36')]?_0x41e277[_0xd9d9('0x34')]:_0x23794c[_0xd9d9('0x2f')];if(_0x6aab0a[_0xd9d9('0x33')][_0xd9d9('0x48')]){_0x41e277[_0xd9d9('0x42')]=[{'all':!![]}];}_0x41e277=_[_0xd9d9('0x41')]({},_0x41e277,_0x6aab0a[_0xd9d9('0x49')]);return db['FaxQueue']['find'](_0x41e277)[_0xd9d9('0x27')](handleEntityNotFound(_0x3aea7d,null))['then'](respondWithResult(_0x3aea7d,null))['catch'](handleError(_0x3aea7d,null));};exports[_0xd9d9('0x4a')]=function(_0x344c89,_0x12a56e){return db['FaxQueue']['create'](_0x344c89[_0xd9d9('0x4b')],{})[_0xd9d9('0x27')](function(_0x5c2086){var _0x3a3b0a=_0x344c89[_0xd9d9('0x4c')][_0xd9d9('0x28')]({'plain':!![]});if(!_0x3a3b0a)throw new Error(_0xd9d9('0x4d'));if(_0x3a3b0a[_0xd9d9('0x4e')]===_0xd9d9('0x4c')){var _0xbd467b=_0x5c2086['get']({'plain':!![]});var _0x28d3ec='FaxQueues';return db[_0xd9d9('0x4f')][_0xd9d9('0x50')]({'where':{'name':_0x28d3ec,'userProfileId':_0x3a3b0a['userProfileId']},'raw':!![]})[_0xd9d9('0x27')](function(_0x5137a0){if(_0x5137a0&&_0x5137a0[_0xd9d9('0x51')]===0x0){return db['UserProfileResource'][_0xd9d9('0x4a')]({'name':_0xbd467b[_0xd9d9('0x2b')],'resourceId':_0xbd467b['id'],'type':_0x5137a0[_0xd9d9('0x2b')],'sectionId':_0x5137a0['id']},{})[_0xd9d9('0x27')](function(){return _0x5c2086;});}else{return _0x5c2086;}})['catch'](function(_0x22ea44){logger[_0xd9d9('0x52')](_0xd9d9('0x53'),_0x22ea44);throw _0x22ea44;});}return _0x5c2086;})['then'](respondWithResult(_0x12a56e,0xc9))[_0xd9d9('0x44')](handleError(_0x12a56e,null));};exports[_0xd9d9('0x25')]=function(_0xc82f38,_0x4fc41a){if(_0xc82f38[_0xd9d9('0x4b')]['id']){delete _0xc82f38[_0xd9d9('0x4b')]['id'];}return db[_0xd9d9('0x2e')][_0xd9d9('0x50')]({'where':{'id':_0xc82f38[_0xd9d9('0x46')]['id']}})[_0xd9d9('0x27')](handleEntityNotFound(_0x4fc41a,null))[_0xd9d9('0x27')](saveUpdates(_0xc82f38[_0xd9d9('0x4b')],null))[_0xd9d9('0x27')](respondWithResult(_0x4fc41a,null))[_0xd9d9('0x44')](handleError(_0x4fc41a,null));};exports[_0xd9d9('0x26')]=function(_0x400e5a,_0x519cef){return db[_0xd9d9('0x2e')][_0xd9d9('0x50')]({'where':{'id':_0x400e5a[_0xd9d9('0x46')]['id']}})[_0xd9d9('0x27')](handleEntityNotFound(_0x519cef,null))[_0xd9d9('0x27')](removeEntity(_0x519cef,null))[_0xd9d9('0x44')](handleError(_0x519cef,null));};exports[_0xd9d9('0x54')]=function(_0x1b075c,_0x2ccc1){return db[_0xd9d9('0x2e')][_0xd9d9('0x54')]()[_0xd9d9('0x27')](respondWithResult(_0x2ccc1,null))[_0xd9d9('0x44')](handleError(_0x2ccc1,null));};exports[_0xd9d9('0x55')]=function(_0xc82b97,_0x151fa6,_0x5e7906){var _0x37dc40={'raw':!![],'where':{}},_0x263f78={},_0x262c01;return db[_0xd9d9('0x2e')][_0xd9d9('0x56')]({'where':{'id':_0xc82b97[_0xd9d9('0x46')]['id']}})['then'](handleEntityNotFound(_0x151fa6,null))['then'](function(_0x1a6299){if(_0x1a6299){_0x262c01=_0x1a6299['get']({'plain':!![]});_0x263f78[_0xd9d9('0x2f')]=_[_0xd9d9('0x30')](db['UserFaxQueue'][_0xd9d9('0x47')]);_0x263f78[_0xd9d9('0x33')]=_[_0xd9d9('0x30')](_0xc82b97[_0xd9d9('0x33')]);_0x263f78[_0xd9d9('0x31')]=_[_0xd9d9('0x32')](_0x263f78[_0xd9d9('0x2f')],_0x263f78[_0xd9d9('0x33')]);_0x37dc40['attributes']=_[_0xd9d9('0x32')](_0x263f78[_0xd9d9('0x2f')],qs[_0xd9d9('0x35')](_0xc82b97['query'][_0xd9d9('0x35')]));_0x37dc40[_0xd9d9('0x34')]=_0x37dc40[_0xd9d9('0x34')][_0xd9d9('0x36')]?_0x37dc40[_0xd9d9('0x34')]:_0x263f78[_0xd9d9('0x2f')];if(!_0xc82b97['query'][_0xd9d9('0x57')](_0xd9d9('0x58'))){_0x37dc40['limit']=qs[_0xd9d9('0x1e')](_0xc82b97[_0xd9d9('0x33')][_0xd9d9('0x1e')]);_0x37dc40[_0xd9d9('0x1d')]=qs['offset'](_0xc82b97[_0xd9d9('0x33')][_0xd9d9('0x1d')]);}_0x37dc40[_0xd9d9('0x37')]=qs['sort'](_0xc82b97['query'][_0xd9d9('0x38')]);_0x37dc40[_0xd9d9('0x39')]=qs[_0xd9d9('0x31')](_[_0xd9d9('0x3a')](_0xc82b97[_0xd9d9('0x33')],_0x263f78['filters']));_0x37dc40[_0xd9d9('0x39')][_0xd9d9('0x59')]=_0x1a6299['id'];if(_0xc82b97['query'][_0xd9d9('0x40')]){_0x37dc40[_0xd9d9('0x39')]=_[_0xd9d9('0x41')](_0x37dc40[_0xd9d9('0x39')],{'$or':_[_0xd9d9('0x3b')](_0x37dc40[_0xd9d9('0x34')],function(_0x19604b){var _0x1c466b={};_0x1c466b[_0x19604b]={'$like':'%'+_0xc82b97['query'][_0xd9d9('0x40')]+'%'};return _0x1c466b;})});}_0x37dc40=_['merge']({},_0x37dc40,_0xc82b97['options']);return db[_0xd9d9('0x5a')]['findAll'](_0x37dc40);}})['then'](function(_0x2c642c){if(_0x2c642c){return db['User'][_0xd9d9('0x5b')]({'where':{'id':_[_0xd9d9('0x3b')](_0x2c642c,'UserId'),'role':'agent'},'attributes':['id',_0xd9d9('0x2b'),_0xd9d9('0x5c'),_0xd9d9('0x5d'),_0xd9d9('0x5e')]});}})[_0xd9d9('0x27')](function(_0x3cdde0){if(_0x3cdde0){return{'count':_0x3cdde0['count'],'rows':_[_0xd9d9('0x3b')](_0x3cdde0[_0xd9d9('0x5f')],function(_0x4ebc28){return{'membername':_0x4ebc28['name'],'UserId':_0x4ebc28['id'],'queue_name':_0x262c01[_0xd9d9('0x2b')],'FaxQueueId':_0x262c01['id'],'interface':util[_0xd9d9('0x60')](_0xd9d9('0x61'),_0xd9d9('0x62'),_0x4ebc28[_0xd9d9('0x2b')]),'penalty':0x0,'paused':_0x4ebc28[_0xd9d9('0x5c')],'createdAt':_0x4ebc28[_0xd9d9('0x5e')],'updatedAt':_0x4ebc28[_0xd9d9('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd9d9('0x27')](respondWithFilteredResult(_0x151fa6,_0x37dc40))['catch'](handleError(_0x151fa6,null));};exports['getTeams']=function(_0x2709fc,_0x472abd,_0x44acbc){var _0x3d4214={};var _0x6441d5={};var _0x2af7c4;var _0x4766bd;return db[_0xd9d9('0x2e')][_0xd9d9('0x56')]({'where':{'id':_0x2709fc[_0xd9d9('0x46')]['id']}})[_0xd9d9('0x27')](handleEntityNotFound(_0x472abd,null))[_0xd9d9('0x27')](function(_0xfbf599){if(_0xfbf599){_0x2af7c4=_0xfbf599;_0x6441d5[_0xd9d9('0x2f')]=_['keys'](db['Team'][_0xd9d9('0x47')]);_0x6441d5[_0xd9d9('0x33')]=_['keys'](_0x2709fc['query']);_0x6441d5[_0xd9d9('0x31')]=_['intersection'](_0x6441d5['model'],_0x6441d5['query']);_0x3d4214[_0xd9d9('0x34')]=_[_0xd9d9('0x32')](_0x6441d5[_0xd9d9('0x2f')],qs[_0xd9d9('0x35')](_0x2709fc[_0xd9d9('0x33')][_0xd9d9('0x35')]));_0x3d4214[_0xd9d9('0x34')]=_0x3d4214['attributes'][_0xd9d9('0x36')]?_0x3d4214[_0xd9d9('0x34')]:_0x6441d5[_0xd9d9('0x2f')];_0x3d4214[_0xd9d9('0x37')]=qs['sort'](_0x2709fc[_0xd9d9('0x33')][_0xd9d9('0x38')]);_0x3d4214[_0xd9d9('0x39')]=qs[_0xd9d9('0x31')](_[_0xd9d9('0x3a')](_0x2709fc['query'],_0x6441d5[_0xd9d9('0x31')]));if(_0x2709fc[_0xd9d9('0x33')][_0xd9d9('0x40')]){_0x3d4214[_0xd9d9('0x39')]=_[_0xd9d9('0x41')](_0x3d4214[_0xd9d9('0x39')],{'$or':_[_0xd9d9('0x3b')](_0x3d4214[_0xd9d9('0x34')],function(_0x3581e4){var _0x4b55b0={};_0x4b55b0[_0x3581e4]={'$like':'%'+_0x2709fc[_0xd9d9('0x33')][_0xd9d9('0x40')]+'%'};return _0x4b55b0;})});}_0x3d4214=_[_0xd9d9('0x41')]({},_0x3d4214,_0x2709fc[_0xd9d9('0x49')]);return _0x2af7c4[_0xd9d9('0x63')](_0x3d4214);}})[_0xd9d9('0x27')](function(_0x72494b){if(_0x72494b){_0x4766bd=_0x72494b[_0xd9d9('0x36')];if(!_0x2709fc[_0xd9d9('0x33')][_0xd9d9('0x57')]('nolimit')){_0x3d4214[_0xd9d9('0x1e')]=qs['limit'](_0x2709fc[_0xd9d9('0x33')][_0xd9d9('0x1e')]);_0x3d4214[_0xd9d9('0x1d')]=qs[_0xd9d9('0x1d')](_0x2709fc['query'][_0xd9d9('0x1d')]);}return _0x2af7c4[_0xd9d9('0x63')](_0x3d4214);}})[_0xd9d9('0x27')](function(_0x546d3b){if(_0x546d3b){return _0x546d3b?{'count':_0x4766bd,'rows':_0x546d3b}:null;}})['then'](respondWithResult(_0x472abd,null))[_0xd9d9('0x44')](handleError(_0x472abd,null));};exports[_0xd9d9('0x64')]=function(_0x437b48,_0x7c34ea,_0x495c86){var _0x1c1bbf=[];var _0x121317;return db[_0xd9d9('0x65')][_0xd9d9('0x43')]({'where':{'id':_0x437b48['body']['ids']},'attributes':['id'],'include':[{'model':db[_0xd9d9('0x66')],'as':_0xd9d9('0x67'),'attributes':['id'],'raw':!![]}]})[_0xd9d9('0x27')](function(_0x51fc94){if(_0x51fc94){for(var _0x2fdfda=0x0;_0x2fdfda<_0x51fc94['length'];_0x2fdfda+=0x1){for(var _0x2cf797=0x0;_0x2cf797<_0x51fc94[_0x2fdfda][_0xd9d9('0x67')][_0xd9d9('0x36')];_0x2cf797+=0x1){_0x1c1bbf=_['union'](_0x1c1bbf,[_0x51fc94[_0x2fdfda]['Agents'][_0x2cf797]['id']]);}}return _0x1c1bbf;}})[_0xd9d9('0x27')](function(_0x4e33cc){if(_0x4e33cc){return db[_0xd9d9('0x2e')]['find']({'where':{'id':_0x437b48[_0xd9d9('0x46')]['id']}});}})['then'](function(_0x42056f){if(_0x42056f){_0x121317=_0x42056f;return _0x121317['addAgents'](_0x1c1bbf,{'penalty':_0x437b48['body'][_0xd9d9('0x68')]});}})[_0xd9d9('0x27')](function(_0x413df3){if(_0x413df3){return _0x121317[_0xd9d9('0x64')](_0x437b48[_0xd9d9('0x4b')][_0xd9d9('0x69')]);}})['then'](handleEntityNotFound(_0x7c34ea,null))[_0xd9d9('0x27')](respondWithStatusCode(_0x7c34ea,null))[_0xd9d9('0x44')](handleError(_0x7c34ea,null));};exports[_0xd9d9('0x6a')]=function(_0x13bdb9,_0x398a8a,_0x28d8c8){var _0x10d7b1=[];var _0xaf1a18;return db['Team'][_0xd9d9('0x43')]({'where':{'id':_0x13bdb9['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xd9d9('0x66')],'as':_0xd9d9('0x67'),'attributes':['id'],'raw':!![]}]})[_0xd9d9('0x27')](function(_0x2be772){if(_0x2be772){for(var _0xffa72a=0x0;_0xffa72a<_0x2be772['length'];_0xffa72a+=0x1){for(var _0x53abca=0x0;_0x53abca<_0x2be772[_0xffa72a]['Agents']['length'];_0x53abca+=0x1){_0x10d7b1=_[_0xd9d9('0x6b')](_0x10d7b1,[_0x2be772[_0xffa72a][_0xd9d9('0x67')][_0x53abca]['id']]);}}return _0x10d7b1;}})[_0xd9d9('0x27')](function(_0x34aa66){if(_0x34aa66){return db[_0xd9d9('0x2e')]['find']({'where':{'id':_0x13bdb9['params']['id']}});}})[_0xd9d9('0x27')](function(_0x54359b){if(_0x54359b){_0xaf1a18=_0x54359b;return _0xaf1a18[_0xd9d9('0x6c')](_0x10d7b1);}})[_0xd9d9('0x27')](function(_0xc44779){if(_0xaf1a18){return _0xaf1a18[_0xd9d9('0x6a')](_0x13bdb9[_0xd9d9('0x33')]['ids']);}})['then'](handleEntityNotFound(_0x398a8a,null))[_0xd9d9('0x27')](respondWithStatusCode(_0x398a8a,null))[_0xd9d9('0x44')](handleError(_0x398a8a,null));};exports[_0xd9d9('0x6d')]=function(_0x23c3cc,_0x51a816,_0x4976a3){return db['FaxQueue'][_0xd9d9('0x50')]({'where':{'id':_0x23c3cc['params']['id']}})[_0xd9d9('0x27')](handleEntityNotFound(_0x51a816,null))[_0xd9d9('0x27')](function(_0x305ae5){if(_0x305ae5){return _0x305ae5[_0xd9d9('0x6d')](_0x23c3cc['body']['ids'],_[_0xd9d9('0x6e')](_0x23c3cc[_0xd9d9('0x4b')],['ids','id'])||{})['spread'](function(_0x25cd67){for(var _0x357353=0x0;_0x357353<_0x23c3cc[_0xd9d9('0x4b')][_0xd9d9('0x69')][_0xd9d9('0x36')];_0x357353+=0x1){socket[_0xd9d9('0x6f')]('userFaxQueue:save',{'UserId':_0x23c3cc['body'][_0xd9d9('0x69')][_0x357353],'FaxQueueId':_0x23c3cc['params']['id']});}return _0x25cd67;});}})['then'](respondWithResult(_0x51a816,null))[_0xd9d9('0x44')](handleError(_0x51a816,null));};exports[_0xd9d9('0x6c')]=function(_0x107c2d,_0x9e0805,_0x4e7c41){var _0x2eb086;return db[_0xd9d9('0x2e')][_0xd9d9('0x50')]({'where':{'id':_0x107c2d[_0xd9d9('0x46')]['id']}})[_0xd9d9('0x27')](handleEntityNotFound(_0x9e0805,null))[_0xd9d9('0x27')](function(_0x1eb1a6){if(_0x1eb1a6){return _0x1eb1a6[_0xd9d9('0x6c')](_0x107c2d[_0xd9d9('0x33')][_0xd9d9('0x69')])['then'](function(_0x48759a){if(_[_0xd9d9('0x70')](_0x107c2d[_0xd9d9('0x33')]['ids'])){for(var _0x4b2f1e=0x0;_0x4b2f1e<_0x107c2d[_0xd9d9('0x33')]['ids'][_0xd9d9('0x36')];_0x4b2f1e+=0x1){socket[_0xd9d9('0x6f')](_0xd9d9('0x71'),{'UserId':_0x107c2d[_0xd9d9('0x33')]['ids'][_0x4b2f1e],'FaxQueueId':_0x107c2d[_0xd9d9('0x46')]['id']});}}else{socket[_0xd9d9('0x6f')]('userFaxQueue:remove',{'UserId':_0x107c2d[_0xd9d9('0x33')][_0xd9d9('0x69')],'FaxQueueId':_0x107c2d[_0xd9d9('0x46')]['id']});}});}})['then'](respondWithStatusCode(_0x9e0805,null))[_0xd9d9('0x44')](handleError(_0x9e0805,null));};exports[_0xd9d9('0x72')]=function(_0x5caa26,_0x9e0a18,_0x101775){var _0x2adabd={};var _0x16f4f2={};var _0x15bf2e;var _0x5dadab;return db[_0xd9d9('0x2e')]['findOne']({'where':{'id':_0x5caa26[_0xd9d9('0x46')]['id']}})['then'](handleEntityNotFound(_0x9e0a18,null))[_0xd9d9('0x27')](function(_0x2fc407){if(_0x2fc407){_0x15bf2e=_0x2fc407;_0x16f4f2[_0xd9d9('0x2f')]=_['keys'](db[_0xd9d9('0x66')][_0xd9d9('0x47')]);_0x16f4f2['query']=_[_0xd9d9('0x30')](_0x5caa26['query']);_0x16f4f2[_0xd9d9('0x31')]=_[_0xd9d9('0x32')](_0x16f4f2[_0xd9d9('0x2f')],_0x16f4f2['query']);_0x2adabd[_0xd9d9('0x34')]=_[_0xd9d9('0x32')](_0x16f4f2[_0xd9d9('0x2f')],qs[_0xd9d9('0x35')](_0x5caa26['query']['fields']));_0x2adabd[_0xd9d9('0x34')]=_0x2adabd[_0xd9d9('0x34')][_0xd9d9('0x36')]?_0x2adabd[_0xd9d9('0x34')]:_0x16f4f2[_0xd9d9('0x2f')];_0x2adabd[_0xd9d9('0x37')]=qs[_0xd9d9('0x38')](_0x5caa26['query'][_0xd9d9('0x38')]);_0x2adabd[_0xd9d9('0x39')]=qs[_0xd9d9('0x31')](_[_0xd9d9('0x3a')](_0x5caa26[_0xd9d9('0x33')],_0x16f4f2['filters']));if(_0x5caa26[_0xd9d9('0x33')][_0xd9d9('0x40')]){_0x2adabd[_0xd9d9('0x39')]=_[_0xd9d9('0x41')](_0x2adabd[_0xd9d9('0x39')],{'$or':_[_0xd9d9('0x3b')](_0x2adabd['attributes'],function(_0x2a09af){var _0x185291={};_0x185291[_0x2a09af]={'$like':'%'+_0x5caa26[_0xd9d9('0x33')][_0xd9d9('0x40')]+'%'};return _0x185291;})});}_0x2adabd=_[_0xd9d9('0x41')]({},_0x2adabd,_0x5caa26['options']);return _0x15bf2e[_0xd9d9('0x72')](_0x2adabd);}})['then'](function(_0x39364c){if(_0x39364c){_0x5dadab=_0x39364c[_0xd9d9('0x36')];if(!_0x5caa26[_0xd9d9('0x33')][_0xd9d9('0x57')](_0xd9d9('0x58'))){_0x2adabd[_0xd9d9('0x1e')]=qs[_0xd9d9('0x1e')](_0x5caa26[_0xd9d9('0x33')][_0xd9d9('0x1e')]);_0x2adabd[_0xd9d9('0x1d')]=qs[_0xd9d9('0x1d')](_0x5caa26[_0xd9d9('0x33')][_0xd9d9('0x1d')]);}return _0x15bf2e['getAgents'](_0x2adabd);}})[_0xd9d9('0x27')](function(_0xff0915){if(_0xff0915){return _0xff0915?{'count':_0x5dadab,'rows':_0xff0915}:null;}})[_0xd9d9('0x27')](respondWithResult(_0x9e0a18,null))['catch'](handleError(_0x9e0a18,null));}; \ No newline at end of file +var _0x6cba=['autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','nolimit','order','map','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','faxPause','Team','pick','getTeams','addTeams','ids','Agents','removeTeams','User','union','addAgents','omit','spread','emit','userFaxQueue:save','removeAgents','userFaxQueue:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/environment','redis','defaults','localhost','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','FaxQueues','name','send','index','FaxQueue','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','type','key','field','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId'];(function(_0x461cad,_0x338d94){var _0x1bae70=function(_0x4be6ea){while(--_0x4be6ea){_0x461cad['push'](_0x461cad['shift']());}};_0x1bae70(++_0x338d94);}(_0x6cba,0x173));var _0xa6cb=function(_0x370397,_0x4f2b07){_0x370397=_0x370397-0x0;var _0x2420ef=_0x6cba[_0x370397];return _0x2420ef;};'use strict';var pdf=require(_0xa6cb('0x0'));var emlformat=require(_0xa6cb('0x1'));var rimraf=require(_0xa6cb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6cb('0x3'));var rp=require(_0xa6cb('0x4'));var moment=require(_0xa6cb('0x5'));var BPromise=require(_0xa6cb('0x6'));var Mustache=require(_0xa6cb('0x7'));var util=require(_0xa6cb('0x8'));var path=require(_0xa6cb('0x9'));var sox=require(_0xa6cb('0xa'));var csv=require(_0xa6cb('0xb'));var ejs=require(_0xa6cb('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa6cb('0xd'));var jsforce=require(_0xa6cb('0xe'));var deskjs=require(_0xa6cb('0xf'));var toCsv=require(_0xa6cb('0xb'));var querystring=require(_0xa6cb('0x10'));var Papa=require(_0xa6cb('0x11'));var authService=require(_0xa6cb('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xa6cb('0x13'));var qs=require(_0xa6cb('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa6cb('0x15'));var db=require('../../mysqldb')['db'];config[_0xa6cb('0x16')]=_[_0xa6cb('0x17')](config[_0xa6cb('0x16')],{'host':_0xa6cb('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa6cb('0x16')]));require('./faxQueue.socket')[_0xa6cb('0x19')](socket);function respondWithStatusCode(_0x46dd09,_0x355f16){_0x355f16=_0x355f16||0xcc;return function(_0x4b1736){if(_0x4b1736){return _0x46dd09[_0xa6cb('0x1a')](_0x355f16);}return _0x46dd09[_0xa6cb('0x1b')](_0x355f16)[_0xa6cb('0x1c')]();};}function respondWithResult(_0x44fc4c,_0x5dc9d5){_0x5dc9d5=_0x5dc9d5||0xc8;return function(_0x15c4ea){if(_0x15c4ea){return _0x44fc4c[_0xa6cb('0x1b')](_0x5dc9d5)[_0xa6cb('0x1d')](_0x15c4ea);}};}function respondWithFilteredResult(_0x968aa1,_0x34c88a){return function(_0x5bf1c9){if(_0x5bf1c9){var _0x54c6f9=_0x5bf1c9[_0xa6cb('0x1e')],_0x25bfe3=_0x34c88a[_0xa6cb('0x1f')],_0x112060=_0x34c88a[_0xa6cb('0x1f')]+_0x34c88a[_0xa6cb('0x20')],_0x566668;if(_0x112060>=_0x54c6f9){_0x112060=_0x54c6f9;_0x566668=0xc8;}else{_0x566668=0xce;}_0x968aa1[_0xa6cb('0x1b')](_0x566668);return _0x968aa1[_0xa6cb('0x21')](_0xa6cb('0x22'),_0x25bfe3+'-'+_0x112060+'/'+_0x54c6f9)[_0xa6cb('0x1d')](_0x5bf1c9);}return null;};}function patchUpdates(_0x1ee44b){return function(_0x1c5cc9){try{jsonpatch['apply'](_0x1c5cc9,_0x1ee44b,!![]);}catch(_0x48aab4){return BPromise[_0xa6cb('0x23')](_0x48aab4);}return _0x1c5cc9[_0xa6cb('0x24')]();};}function saveUpdates(_0x24aff1,_0x4d98bf){return function(_0x2fee2b){if(_0x2fee2b){return _0x2fee2b['update'](_0x24aff1)[_0xa6cb('0x25')](function(_0x1c5ffe){return _0x1c5ffe;});}return null;};}function removeEntity(_0x15b3b9,_0x1abf9a){return function(_0xba7486){if(_0xba7486){return _0xba7486[_0xa6cb('0x26')]()['then'](function(){var _0x223927=_0xba7486[_0xa6cb('0x27')]({'plain':!![]});var _0x13f945=_0xa6cb('0x28');return db['UserProfileResource'][_0xa6cb('0x26')]({'where':{'type':_0x13f945,'resourceId':_0x223927['id']}})[_0xa6cb('0x25')](function(){return _0xba7486;});})[_0xa6cb('0x25')](function(){_0x15b3b9[_0xa6cb('0x1b')](0xcc)[_0xa6cb('0x1c')]();});}};}function handleEntityNotFound(_0x120fc9,_0x161757){return function(_0x4992ff){if(!_0x4992ff){_0x120fc9[_0xa6cb('0x1a')](0x194);}return _0x4992ff;};}function handleError(_0x4c5187,_0x4d4f40){_0x4d4f40=_0x4d4f40||0x1f4;return function(_0x481c0e){logger['error'](_0x481c0e['stack']);if(_0x481c0e[_0xa6cb('0x29')]){delete _0x481c0e['name'];}_0x4c5187[_0xa6cb('0x1b')](_0x4d4f40)[_0xa6cb('0x2a')](_0x481c0e);};}exports[_0xa6cb('0x2b')]=function(_0xeb09f3,_0x3c6b74){var _0xe0d73f={},_0x2b1742={},_0x30478c={'count':0x0,'rows':[]};var _0x12a12a=db[_0xa6cb('0x2c')][_0xa6cb('0x2d')];_0x2b1742[_0xa6cb('0x2e')]=_['keys'](_0x12a12a);_0x2b1742[_0xa6cb('0x2f')]=_[_0xa6cb('0x30')](_0xeb09f3[_0xa6cb('0x2f')]);_0x2b1742[_0xa6cb('0x31')]=_['intersection'](_0x2b1742['model'],_0x2b1742[_0xa6cb('0x2f')]);_0xe0d73f[_0xa6cb('0x32')]=_[_0xa6cb('0x33')](_0x2b1742[_0xa6cb('0x2e')],qs[_0xa6cb('0x34')](_0xeb09f3[_0xa6cb('0x2f')][_0xa6cb('0x34')]));_0xe0d73f[_0xa6cb('0x32')]=_0xe0d73f[_0xa6cb('0x32')][_0xa6cb('0x35')]?_0xe0d73f['attributes']:_0x2b1742['model'];if(!_0xeb09f3[_0xa6cb('0x2f')][_0xa6cb('0x36')]('nolimit')){_0xe0d73f[_0xa6cb('0x20')]=qs[_0xa6cb('0x20')](_0xeb09f3[_0xa6cb('0x2f')][_0xa6cb('0x20')]);_0xe0d73f[_0xa6cb('0x1f')]=qs[_0xa6cb('0x1f')](_0xeb09f3['query']['offset']);}_0xe0d73f['order']=qs[_0xa6cb('0x37')](_0xeb09f3[_0xa6cb('0x2f')][_0xa6cb('0x37')]);_0xe0d73f[_0xa6cb('0x38')]=qs['filters'](_['pick'](_0xeb09f3[_0xa6cb('0x2f')],_0x2b1742[_0xa6cb('0x31')]));if(_0xeb09f3['query'][_0xa6cb('0x39')]){_0xe0d73f[_0xa6cb('0x38')]=_[_0xa6cb('0x3a')](_0xe0d73f[_0xa6cb('0x38')],{'$or':_['map'](_0x12a12a,function(_0xb01a2f){if(_0xb01a2f[_0xa6cb('0x3b')][_0xa6cb('0x3c')]!=='VIRTUAL'){var _0x258999={};_0x258999[_0xb01a2f[_0xa6cb('0x3d')]]={'$like':'%'+_0xeb09f3[_0xa6cb('0x2f')][_0xa6cb('0x39')]+'%'};return _0x258999;}})});}_0xe0d73f=_[_0xa6cb('0x3a')]({},_0xe0d73f,_0xeb09f3[_0xa6cb('0x3e')]);var _0x1ba510={'where':_0xe0d73f['where']};return db[_0xa6cb('0x2c')][_0xa6cb('0x1e')](_0x1ba510)[_0xa6cb('0x25')](function(_0xc4818b){_0x30478c[_0xa6cb('0x1e')]=_0xc4818b;if(_0xeb09f3['query'][_0xa6cb('0x3f')]){_0xe0d73f['include']=[{'all':!![]}];}return db[_0xa6cb('0x2c')][_0xa6cb('0x40')](_0xe0d73f);})[_0xa6cb('0x25')](function(_0x4abcc1){_0x30478c[_0xa6cb('0x41')]=_0x4abcc1;return _0x30478c;})[_0xa6cb('0x25')](respondWithFilteredResult(_0x3c6b74,_0xe0d73f))[_0xa6cb('0x42')](handleError(_0x3c6b74,null));};exports[_0xa6cb('0x43')]=function(_0x1c472a,_0x167af5){var _0x136afb={'raw':!![],'where':{'id':_0x1c472a[_0xa6cb('0x44')]['id']}},_0x1cd0dc={};_0x1cd0dc[_0xa6cb('0x2e')]=_[_0xa6cb('0x30')](db[_0xa6cb('0x2c')]['rawAttributes']);_0x1cd0dc[_0xa6cb('0x2f')]=_[_0xa6cb('0x30')](_0x1c472a[_0xa6cb('0x2f')]);_0x1cd0dc[_0xa6cb('0x31')]=_[_0xa6cb('0x33')](_0x1cd0dc[_0xa6cb('0x2e')],_0x1cd0dc[_0xa6cb('0x2f')]);_0x136afb[_0xa6cb('0x32')]=_[_0xa6cb('0x33')](_0x1cd0dc[_0xa6cb('0x2e')],qs[_0xa6cb('0x34')](_0x1c472a[_0xa6cb('0x2f')][_0xa6cb('0x34')]));_0x136afb[_0xa6cb('0x32')]=_0x136afb[_0xa6cb('0x32')][_0xa6cb('0x35')]?_0x136afb[_0xa6cb('0x32')]:_0x1cd0dc[_0xa6cb('0x2e')];if(_0x1c472a['query'][_0xa6cb('0x3f')]){_0x136afb[_0xa6cb('0x45')]=[{'all':!![]}];}_0x136afb=_['merge']({},_0x136afb,_0x1c472a[_0xa6cb('0x3e')]);return db[_0xa6cb('0x2c')][_0xa6cb('0x46')](_0x136afb)[_0xa6cb('0x25')](handleEntityNotFound(_0x167af5,null))[_0xa6cb('0x25')](respondWithResult(_0x167af5,null))['catch'](handleError(_0x167af5,null));};exports['create']=function(_0x50f668,_0x463629){return db['FaxQueue'][_0xa6cb('0x47')](_0x50f668[_0xa6cb('0x48')],{})[_0xa6cb('0x25')](function(_0x6efc2){var _0x2beadf=_0x50f668['user'][_0xa6cb('0x27')]({'plain':!![]});if(!_0x2beadf)throw new Error(_0xa6cb('0x49'));if(_0x2beadf['role']===_0xa6cb('0x4a')){var _0x2fa0bd=_0x6efc2[_0xa6cb('0x27')]({'plain':!![]});var _0x34cae4='FaxQueues';return db[_0xa6cb('0x4b')][_0xa6cb('0x46')]({'where':{'name':_0x34cae4,'userProfileId':_0x2beadf[_0xa6cb('0x4c')]},'raw':!![]})['then'](function(_0x53bf7c){if(_0x53bf7c&&_0x53bf7c[_0xa6cb('0x4d')]===0x0){return db[_0xa6cb('0x4e')][_0xa6cb('0x47')]({'name':_0x2fa0bd[_0xa6cb('0x29')],'resourceId':_0x2fa0bd['id'],'type':_0x53bf7c[_0xa6cb('0x29')],'sectionId':_0x53bf7c['id']},{})['then'](function(){return _0x6efc2;});}else{return _0x6efc2;}})['catch'](function(_0x322582){logger[_0xa6cb('0x4f')](_0xa6cb('0x50'),_0x322582);throw _0x322582;});}return _0x6efc2;})['then'](respondWithResult(_0x463629,0xc9))['catch'](handleError(_0x463629,null));};exports['update']=function(_0x124734,_0x1b753d){if(_0x124734[_0xa6cb('0x48')]['id']){delete _0x124734[_0xa6cb('0x48')]['id'];}return db[_0xa6cb('0x2c')][_0xa6cb('0x46')]({'where':{'id':_0x124734[_0xa6cb('0x44')]['id']}})[_0xa6cb('0x25')](handleEntityNotFound(_0x1b753d,null))[_0xa6cb('0x25')](saveUpdates(_0x124734[_0xa6cb('0x48')],null))['then'](respondWithResult(_0x1b753d,null))[_0xa6cb('0x42')](handleError(_0x1b753d,null));};exports[_0xa6cb('0x26')]=function(_0x299f63,_0x8ae492){return db[_0xa6cb('0x2c')][_0xa6cb('0x46')]({'where':{'id':_0x299f63[_0xa6cb('0x44')]['id']}})[_0xa6cb('0x25')](handleEntityNotFound(_0x8ae492,null))[_0xa6cb('0x25')](removeEntity(_0x8ae492,null))[_0xa6cb('0x42')](handleError(_0x8ae492,null));};exports[_0xa6cb('0x51')]=function(_0x39a424,_0x199fd3){return db[_0xa6cb('0x2c')][_0xa6cb('0x51')]()[_0xa6cb('0x25')](respondWithResult(_0x199fd3,null))['catch'](handleError(_0x199fd3,null));};exports[_0xa6cb('0x52')]=function(_0x307a8c,_0x4fba02,_0x30e8df){var _0x4da2c0={'raw':!![],'where':{}},_0x18ec07={},_0x30d508;return db[_0xa6cb('0x2c')]['findOne']({'where':{'id':_0x307a8c[_0xa6cb('0x44')]['id']}})[_0xa6cb('0x25')](handleEntityNotFound(_0x4fba02,null))[_0xa6cb('0x25')](function(_0x29376c){if(_0x29376c){_0x30d508=_0x29376c[_0xa6cb('0x27')]({'plain':!![]});_0x18ec07['model']=_[_0xa6cb('0x30')](db[_0xa6cb('0x53')]['rawAttributes']);_0x18ec07[_0xa6cb('0x2f')]=_[_0xa6cb('0x30')](_0x307a8c[_0xa6cb('0x2f')]);_0x18ec07[_0xa6cb('0x31')]=_[_0xa6cb('0x33')](_0x18ec07[_0xa6cb('0x2e')],_0x18ec07['query']);_0x4da2c0[_0xa6cb('0x32')]=_[_0xa6cb('0x33')](_0x18ec07[_0xa6cb('0x2e')],qs[_0xa6cb('0x34')](_0x307a8c['query'][_0xa6cb('0x34')]));_0x4da2c0[_0xa6cb('0x32')]=_0x4da2c0['attributes']['length']?_0x4da2c0[_0xa6cb('0x32')]:_0x18ec07['model'];if(!_0x307a8c[_0xa6cb('0x2f')][_0xa6cb('0x36')](_0xa6cb('0x54'))){_0x4da2c0[_0xa6cb('0x20')]=qs[_0xa6cb('0x20')](_0x307a8c[_0xa6cb('0x2f')][_0xa6cb('0x20')]);_0x4da2c0['offset']=qs[_0xa6cb('0x1f')](_0x307a8c[_0xa6cb('0x2f')][_0xa6cb('0x1f')]);}_0x4da2c0[_0xa6cb('0x55')]=qs[_0xa6cb('0x37')](_0x307a8c[_0xa6cb('0x2f')][_0xa6cb('0x37')]);_0x4da2c0[_0xa6cb('0x38')]=qs['filters'](_['pick'](_0x307a8c['query'],_0x18ec07[_0xa6cb('0x31')]));_0x4da2c0[_0xa6cb('0x38')]['FaxQueueId']=_0x29376c['id'];if(_0x307a8c[_0xa6cb('0x2f')]['filter']){_0x4da2c0[_0xa6cb('0x38')]=_[_0xa6cb('0x3a')](_0x4da2c0[_0xa6cb('0x38')],{'$or':_[_0xa6cb('0x56')](_0x4da2c0[_0xa6cb('0x32')],function(_0x5fc300){var _0x470305={};_0x470305[_0x5fc300]={'$like':'%'+_0x307a8c[_0xa6cb('0x2f')][_0xa6cb('0x39')]+'%'};return _0x470305;})});}_0x4da2c0=_[_0xa6cb('0x3a')]({},_0x4da2c0,_0x307a8c['options']);return db[_0xa6cb('0x53')][_0xa6cb('0x40')](_0x4da2c0);}})[_0xa6cb('0x25')](function(_0x128bd5){if(_0x128bd5){return db['User'][_0xa6cb('0x57')]({'where':{'id':_[_0xa6cb('0x56')](_0x128bd5,_0xa6cb('0x58')),'role':'agent'},'attributes':['id',_0xa6cb('0x29'),'faxPause',_0xa6cb('0x59'),_0xa6cb('0x5a')]});}})[_0xa6cb('0x25')](function(_0x40aea5){if(_0x40aea5){return{'count':_0x40aea5['count'],'rows':_[_0xa6cb('0x56')](_0x40aea5[_0xa6cb('0x41')],function(_0x1e1df5){return{'membername':_0x1e1df5[_0xa6cb('0x29')],'UserId':_0x1e1df5['id'],'queue_name':_0x30d508[_0xa6cb('0x29')],'FaxQueueId':_0x30d508['id'],'interface':util[_0xa6cb('0x5b')](_0xa6cb('0x5c'),_0xa6cb('0x5d'),_0x1e1df5[_0xa6cb('0x29')]),'penalty':0x0,'paused':_0x1e1df5[_0xa6cb('0x5e')],'createdAt':_0x1e1df5[_0xa6cb('0x5a')],'updatedAt':_0x1e1df5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa6cb('0x25')](respondWithFilteredResult(_0x4fba02,_0x4da2c0))[_0xa6cb('0x42')](handleError(_0x4fba02,null));};exports['getTeams']=function(_0x39d5b9,_0x11047c,_0x1cade1){var _0x51e0f8={};var _0x282e6d={};var _0x4ef037;var _0x39e5d2;return db[_0xa6cb('0x2c')]['findOne']({'where':{'id':_0x39d5b9[_0xa6cb('0x44')]['id']}})[_0xa6cb('0x25')](handleEntityNotFound(_0x11047c,null))['then'](function(_0x123d3a){if(_0x123d3a){_0x4ef037=_0x123d3a;_0x282e6d['model']=_['keys'](db[_0xa6cb('0x5f')]['rawAttributes']);_0x282e6d[_0xa6cb('0x2f')]=_[_0xa6cb('0x30')](_0x39d5b9['query']);_0x282e6d['filters']=_['intersection'](_0x282e6d[_0xa6cb('0x2e')],_0x282e6d['query']);_0x51e0f8[_0xa6cb('0x32')]=_[_0xa6cb('0x33')](_0x282e6d[_0xa6cb('0x2e')],qs[_0xa6cb('0x34')](_0x39d5b9[_0xa6cb('0x2f')][_0xa6cb('0x34')]));_0x51e0f8[_0xa6cb('0x32')]=_0x51e0f8[_0xa6cb('0x32')][_0xa6cb('0x35')]?_0x51e0f8['attributes']:_0x282e6d[_0xa6cb('0x2e')];_0x51e0f8[_0xa6cb('0x55')]=qs[_0xa6cb('0x37')](_0x39d5b9[_0xa6cb('0x2f')][_0xa6cb('0x37')]);_0x51e0f8[_0xa6cb('0x38')]=qs[_0xa6cb('0x31')](_[_0xa6cb('0x60')](_0x39d5b9[_0xa6cb('0x2f')],_0x282e6d[_0xa6cb('0x31')]));if(_0x39d5b9[_0xa6cb('0x2f')]['filter']){_0x51e0f8[_0xa6cb('0x38')]=_[_0xa6cb('0x3a')](_0x51e0f8[_0xa6cb('0x38')],{'$or':_[_0xa6cb('0x56')](_0x51e0f8[_0xa6cb('0x32')],function(_0x2c8b42){var _0x5ca493={};_0x5ca493[_0x2c8b42]={'$like':'%'+_0x39d5b9[_0xa6cb('0x2f')][_0xa6cb('0x39')]+'%'};return _0x5ca493;})});}_0x51e0f8=_['merge']({},_0x51e0f8,_0x39d5b9[_0xa6cb('0x3e')]);return _0x4ef037[_0xa6cb('0x61')](_0x51e0f8);}})[_0xa6cb('0x25')](function(_0x39a053){if(_0x39a053){_0x39e5d2=_0x39a053[_0xa6cb('0x35')];if(!_0x39d5b9['query']['hasOwnProperty'](_0xa6cb('0x54'))){_0x51e0f8[_0xa6cb('0x20')]=qs[_0xa6cb('0x20')](_0x39d5b9[_0xa6cb('0x2f')][_0xa6cb('0x20')]);_0x51e0f8[_0xa6cb('0x1f')]=qs['offset'](_0x39d5b9[_0xa6cb('0x2f')]['offset']);}return _0x4ef037[_0xa6cb('0x61')](_0x51e0f8);}})[_0xa6cb('0x25')](function(_0xe21a86){if(_0xe21a86){return _0xe21a86?{'count':_0x39e5d2,'rows':_0xe21a86}:null;}})['then'](respondWithResult(_0x11047c,null))[_0xa6cb('0x42')](handleError(_0x11047c,null));};exports[_0xa6cb('0x62')]=function(_0x21befd,_0x539dc5,_0x354cbb){var _0x316ce4=[];var _0x131e7c;return db[_0xa6cb('0x5f')][_0xa6cb('0x40')]({'where':{'id':_0x21befd[_0xa6cb('0x48')][_0xa6cb('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa6cb('0x64'),'attributes':['id'],'raw':!![]}]})[_0xa6cb('0x25')](function(_0x214ff4){if(_0x214ff4){for(var _0x4f36c1=0x0;_0x4f36c1<_0x214ff4['length'];_0x4f36c1+=0x1){for(var _0x56d94c=0x0;_0x56d94c<_0x214ff4[_0x4f36c1][_0xa6cb('0x64')]['length'];_0x56d94c+=0x1){_0x316ce4=_['union'](_0x316ce4,[_0x214ff4[_0x4f36c1]['Agents'][_0x56d94c]['id']]);}}return _0x316ce4;}})[_0xa6cb('0x25')](function(_0x3915b3){if(_0x3915b3){return db[_0xa6cb('0x2c')][_0xa6cb('0x46')]({'where':{'id':_0x21befd[_0xa6cb('0x44')]['id']}});}})[_0xa6cb('0x25')](function(_0x40bb6f){if(_0x40bb6f){_0x131e7c=_0x40bb6f;return _0x131e7c['addAgents'](_0x316ce4,{'penalty':_0x21befd[_0xa6cb('0x48')]['penalty']});}})['then'](function(_0x57349a){if(_0x57349a){return _0x131e7c[_0xa6cb('0x62')](_0x21befd[_0xa6cb('0x48')][_0xa6cb('0x63')]);}})[_0xa6cb('0x25')](handleEntityNotFound(_0x539dc5,null))[_0xa6cb('0x25')](respondWithStatusCode(_0x539dc5,null))[_0xa6cb('0x42')](handleError(_0x539dc5,null));};exports[_0xa6cb('0x65')]=function(_0x42761c,_0x2b7039,_0xf1a679){var _0x8657e=[];var _0x5868b7;return db[_0xa6cb('0x5f')][_0xa6cb('0x40')]({'where':{'id':_0x42761c[_0xa6cb('0x2f')][_0xa6cb('0x63')]},'attributes':['id'],'include':[{'model':db[_0xa6cb('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa6cb('0x25')](function(_0x406334){if(_0x406334){for(var _0x4b6c03=0x0;_0x4b6c03<_0x406334[_0xa6cb('0x35')];_0x4b6c03+=0x1){for(var _0x776360=0x0;_0x776360<_0x406334[_0x4b6c03][_0xa6cb('0x64')][_0xa6cb('0x35')];_0x776360+=0x1){_0x8657e=_[_0xa6cb('0x67')](_0x8657e,[_0x406334[_0x4b6c03][_0xa6cb('0x64')][_0x776360]['id']]);}}return _0x8657e;}})[_0xa6cb('0x25')](function(_0xc3806c){if(_0xc3806c){return db[_0xa6cb('0x2c')]['find']({'where':{'id':_0x42761c[_0xa6cb('0x44')]['id']}});}})[_0xa6cb('0x25')](function(_0x3ba767){if(_0x3ba767){_0x5868b7=_0x3ba767;return _0x5868b7['removeAgents'](_0x8657e);}})[_0xa6cb('0x25')](function(_0x2f3d3d){if(_0x5868b7){return _0x5868b7[_0xa6cb('0x65')](_0x42761c['query'][_0xa6cb('0x63')]);}})[_0xa6cb('0x25')](handleEntityNotFound(_0x2b7039,null))[_0xa6cb('0x25')](respondWithStatusCode(_0x2b7039,null))[_0xa6cb('0x42')](handleError(_0x2b7039,null));};exports[_0xa6cb('0x68')]=function(_0x4beab5,_0x56c4af,_0x313d30){return db[_0xa6cb('0x2c')][_0xa6cb('0x46')]({'where':{'id':_0x4beab5[_0xa6cb('0x44')]['id']}})[_0xa6cb('0x25')](handleEntityNotFound(_0x56c4af,null))[_0xa6cb('0x25')](function(_0x14bbf7){if(_0x14bbf7){return _0x14bbf7[_0xa6cb('0x68')](_0x4beab5['body'][_0xa6cb('0x63')],_[_0xa6cb('0x69')](_0x4beab5[_0xa6cb('0x48')],[_0xa6cb('0x63'),'id'])||{})[_0xa6cb('0x6a')](function(_0x1c03b1){for(var _0x2b9a97=0x0;_0x2b9a97<_0x4beab5[_0xa6cb('0x48')]['ids']['length'];_0x2b9a97+=0x1){socket[_0xa6cb('0x6b')](_0xa6cb('0x6c'),{'UserId':_0x4beab5[_0xa6cb('0x48')][_0xa6cb('0x63')][_0x2b9a97],'FaxQueueId':_0x4beab5[_0xa6cb('0x44')]['id']});}return _0x1c03b1;});}})['then'](respondWithResult(_0x56c4af,null))[_0xa6cb('0x42')](handleError(_0x56c4af,null));};exports['removeAgents']=function(_0x17a20d,_0x5aa2ba,_0x3d64ec){var _0xd0847d;return db[_0xa6cb('0x2c')][_0xa6cb('0x46')]({'where':{'id':_0x17a20d[_0xa6cb('0x44')]['id']}})['then'](handleEntityNotFound(_0x5aa2ba,null))[_0xa6cb('0x25')](function(_0x3f65e0){if(_0x3f65e0){return _0x3f65e0[_0xa6cb('0x6d')](_0x17a20d[_0xa6cb('0x2f')][_0xa6cb('0x63')])[_0xa6cb('0x25')](function(_0x27302e){if(_['isArray'](_0x17a20d[_0xa6cb('0x2f')][_0xa6cb('0x63')])){for(var _0x4fa3c1=0x0;_0x4fa3c1<_0x17a20d['query'][_0xa6cb('0x63')]['length'];_0x4fa3c1+=0x1){socket[_0xa6cb('0x6b')](_0xa6cb('0x6e'),{'UserId':_0x17a20d[_0xa6cb('0x2f')][_0xa6cb('0x63')][_0x4fa3c1],'FaxQueueId':_0x17a20d[_0xa6cb('0x44')]['id']});}}else{socket[_0xa6cb('0x6b')](_0xa6cb('0x6e'),{'UserId':_0x17a20d[_0xa6cb('0x2f')]['ids'],'FaxQueueId':_0x17a20d[_0xa6cb('0x44')]['id']});}});}})['then'](respondWithStatusCode(_0x5aa2ba,null))[_0xa6cb('0x42')](handleError(_0x5aa2ba,null));};exports['getAgents']=function(_0x55345e,_0x159a6f,_0x207263){var _0x5160e9={};var _0x1b9e83={};var _0x6aba22;var _0x537713;return db[_0xa6cb('0x2c')]['findOne']({'where':{'id':_0x55345e[_0xa6cb('0x44')]['id']}})[_0xa6cb('0x25')](handleEntityNotFound(_0x159a6f,null))['then'](function(_0x2b0c36){if(_0x2b0c36){_0x6aba22=_0x2b0c36;_0x1b9e83[_0xa6cb('0x2e')]=_[_0xa6cb('0x30')](db['User'][_0xa6cb('0x2d')]);_0x1b9e83[_0xa6cb('0x2f')]=_[_0xa6cb('0x30')](_0x55345e['query']);_0x1b9e83[_0xa6cb('0x31')]=_[_0xa6cb('0x33')](_0x1b9e83[_0xa6cb('0x2e')],_0x1b9e83[_0xa6cb('0x2f')]);_0x5160e9[_0xa6cb('0x32')]=_[_0xa6cb('0x33')](_0x1b9e83[_0xa6cb('0x2e')],qs['fields'](_0x55345e['query'][_0xa6cb('0x34')]));_0x5160e9[_0xa6cb('0x32')]=_0x5160e9[_0xa6cb('0x32')][_0xa6cb('0x35')]?_0x5160e9[_0xa6cb('0x32')]:_0x1b9e83[_0xa6cb('0x2e')];_0x5160e9[_0xa6cb('0x55')]=qs[_0xa6cb('0x37')](_0x55345e[_0xa6cb('0x2f')]['sort']);_0x5160e9[_0xa6cb('0x38')]=qs[_0xa6cb('0x31')](_[_0xa6cb('0x60')](_0x55345e['query'],_0x1b9e83[_0xa6cb('0x31')]));if(_0x55345e[_0xa6cb('0x2f')][_0xa6cb('0x39')]){_0x5160e9[_0xa6cb('0x38')]=_['merge'](_0x5160e9[_0xa6cb('0x38')],{'$or':_[_0xa6cb('0x56')](_0x5160e9[_0xa6cb('0x32')],function(_0x2c882f){var _0x249a87={};_0x249a87[_0x2c882f]={'$like':'%'+_0x55345e['query'][_0xa6cb('0x39')]+'%'};return _0x249a87;})});}_0x5160e9=_['merge']({},_0x5160e9,_0x55345e[_0xa6cb('0x3e')]);return _0x6aba22[_0xa6cb('0x6f')](_0x5160e9);}})[_0xa6cb('0x25')](function(_0x126c84){if(_0x126c84){_0x537713=_0x126c84[_0xa6cb('0x35')];if(!_0x55345e[_0xa6cb('0x2f')]['hasOwnProperty'](_0xa6cb('0x54'))){_0x5160e9[_0xa6cb('0x20')]=qs[_0xa6cb('0x20')](_0x55345e[_0xa6cb('0x2f')][_0xa6cb('0x20')]);_0x5160e9['offset']=qs[_0xa6cb('0x1f')](_0x55345e[_0xa6cb('0x2f')]['offset']);}return _0x6aba22['getAgents'](_0x5160e9);}})['then'](function(_0x2b6f45){if(_0x2b6f45){return _0x2b6f45?{'count':_0x537713,'rows':_0x2b6f45}:null;}})['then'](respondWithResult(_0x159a6f,null))[_0xa6cb('0x42')](handleError(_0x159a6f,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index d571a47..2c0115a 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 _0x0a9a=['emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x27e4eb,_0x52d91f){var _0x2fe211=function(_0x1b6767){while(--_0x1b6767){_0x27e4eb['push'](_0x27e4eb['shift']());}};_0x2fe211(++_0x52d91f);}(_0x0a9a,0x183));var _0xa0a9=function(_0x3a3f32,_0x2ece1a){_0x3a3f32=_0x3a3f32-0x0;var _0x18a849=_0x0a9a[_0x3a3f32];return _0x18a849;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xa0a9('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xa0a9('0x1')](0x0);var events={'afterCreate':_0xa0a9('0x2'),'afterUpdate':_0xa0a9('0x3'),'afterDestroy':_0xa0a9('0x4')};function emitEvent(_0x4ba993){return function(_0x317a94,_0x360be5,_0x50ea50){FaxQueueEvents[_0xa0a9('0x5')](_0x4ba993+':'+_0x317a94['id'],_0x317a94);FaxQueueEvents[_0xa0a9('0x5')](_0x4ba993,_0x317a94);_0x50ea50(null);};}for(var e in events){if(events[_0xa0a9('0x6')](e)){var event=events[e];FaxQueue[_0xa0a9('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xd67b=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x65df34,_0x33e342){var _0x3c915f=function(_0x5c789d){while(--_0x5c789d){_0x65df34['push'](_0x65df34['shift']());}};_0x3c915f(++_0x33e342);}(_0xd67b,0x133));var _0xbd67=function(_0x13370f,_0x79c028){_0x13370f=_0x13370f-0x0;var _0x27b61d=_0xd67b[_0x13370f];return _0x27b61d;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xbd67('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xbd67('0x1')](0x0);var events={'afterCreate':_0xbd67('0x2'),'afterUpdate':_0xbd67('0x3'),'afterDestroy':'remove'};function emitEvent(_0x40e384){return function(_0x50da5a,_0x1bf96,_0x5a827b){FaxQueueEvents[_0xbd67('0x4')](_0x40e384+':'+_0x50da5a['id'],_0x50da5a);FaxQueueEvents[_0xbd67('0x4')](_0x40e384,_0x50da5a);_0x5a827b(null);};}for(var e in events){if(events[_0xbd67('0x5')](e)){var event=events[e];FaxQueue[_0xbd67('0x6')](e,emitEvent(event));}}module[_0xbd67('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index e987d9c..592fbc9 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 _0xcdbd=['bluebird','exports','define','FaxQueue','fax_queues','util','../../config/logger','api','moment'];(function(_0x5c1ff3,_0x2ba62b){var _0x494708=function(_0x4a826a){while(--_0x4a826a){_0x5c1ff3['push'](_0x5c1ff3['shift']());}};_0x494708(++_0x2ba62b);}(_0xcdbd,0x101));var _0xdcdb=function(_0x4fa730,_0x52af3e){_0x4fa730=_0x4fa730-0x0;var _0x35c1ac=_0xcdbd[_0x4fa730];return _0x35c1ac;};'use strict';var _=require('lodash');var util=require(_0xdcdb('0x0'));var logger=require(_0xdcdb('0x1'))(_0xdcdb('0x2'));var moment=require(_0xdcdb('0x3'));var BPromise=require(_0xdcdb('0x4'));var rp=require('request-promise');var attributes=require('./faxQueue.attributes');module[_0xdcdb('0x5')]=function(_0x17d26e,_0x61f6f1){return _0x17d26e[_0xdcdb('0x6')](_0xdcdb('0x7'),attributes,{'tableName':_0xdcdb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2eb3=['util','../../config/logger','api','moment','bluebird','request-promise','./faxQueue.attributes','define','FaxQueue','fax_queues'];(function(_0x62d304,_0x271a2d){var _0x2afd9f=function(_0x33e10a){while(--_0x33e10a){_0x62d304['push'](_0x62d304['shift']());}};_0x2afd9f(++_0x271a2d);}(_0x2eb3,0xa0));var _0x32eb=function(_0x13608d,_0x57bdb3){_0x13608d=_0x13608d-0x0;var _0x6c46e5=_0x2eb3[_0x13608d];return _0x6c46e5;};'use strict';var _=require('lodash');var util=require(_0x32eb('0x0'));var logger=require(_0x32eb('0x1'))(_0x32eb('0x2'));var moment=require(_0x32eb('0x3'));var BPromise=require(_0x32eb('0x4'));var rp=require(_0x32eb('0x5'));var attributes=require(_0x32eb('0x6'));module['exports']=function(_0x455fa2,_0x4a9894){return _0x455fa2[_0x32eb('0x7')](_0x32eb('0x8'),attributes,{'tableName':_0x32eb('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 d66af9a..41d35a4 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 _0x8c88=['code','message','result','GetFaxQueue','FaxQueue','options','raw','where','limit','include','model','attributes','map','debug','ShowFaxQueue','find','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0x8c88,0xb5));var _0x88c8=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x8c88[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x88c8('0x0'));var util=require(_0x88c8('0x1'));var moment=require('moment');var BPromise=require(_0x88c8('0x2'));var rs=require(_0x88c8('0x3'));var fs=require('fs');var Redis=require(_0x88c8('0x4'));var db=require(_0x88c8('0x5'))['db'];var utils=require(_0x88c8('0x6'));var logger=require(_0x88c8('0x7'))(_0x88c8('0x8'));var config=require(_0x88c8('0x9'));var jayson=require(_0x88c8('0xa'));var client=jayson[_0x88c8('0xb')]['http']({'port':0x232a});config[_0x88c8('0xc')]=_[_0x88c8('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88c8('0xc')]));require(_0x88c8('0xe'))[_0x88c8('0xf')](socket);function respondWithRpcPromise(_0x5c7400,_0x8a58cf,_0x170d27){return new BPromise(function(_0x3e3e98,_0x3998d1){return client[_0x88c8('0x10')](_0x5c7400,_0x170d27)[_0x88c8('0x11')](function(_0x286d64){logger[_0x88c8('0x12')](_0x88c8('0x13'),_0x8a58cf,_0x88c8('0x14'));logger['debug'](_0x88c8('0x15'),_0x8a58cf,_0x88c8('0x14'),JSON[_0x88c8('0x16')](_0x286d64));if(_0x286d64[_0x88c8('0x17')]){if(_0x286d64[_0x88c8('0x17')][_0x88c8('0x18')]===0x1f4){logger[_0x88c8('0x17')](_0x88c8('0x13'),_0x8a58cf,_0x286d64[_0x88c8('0x17')][_0x88c8('0x19')]);return _0x3998d1(_0x286d64[_0x88c8('0x17')]['message']);}logger['error'](_0x88c8('0x13'),_0x8a58cf,_0x286d64[_0x88c8('0x17')][_0x88c8('0x19')]);return _0x3e3e98(_0x286d64[_0x88c8('0x17')][_0x88c8('0x19')]);}else{logger[_0x88c8('0x12')](_0x88c8('0x13'),_0x8a58cf,_0x88c8('0x14'));_0x3e3e98(_0x286d64[_0x88c8('0x1a')][_0x88c8('0x19')]);}})['catch'](function(_0x2379c1){logger[_0x88c8('0x17')](_0x88c8('0x13'),_0x8a58cf,_0x2379c1);_0x3998d1(_0x2379c1);});});}exports[_0x88c8('0x1b')]=function(_0x2cb34a){var _0x1ded3f=this;return new Promise(function(_0x3ea796,_0x45abdb){return db[_0x88c8('0x1c')]['findAll']({'raw':_0x2cb34a[_0x88c8('0x1d')]?_0x2cb34a[_0x88c8('0x1d')][_0x88c8('0x1e')]===undefined?!![]:![]:!![],'where':_0x2cb34a[_0x88c8('0x1d')]?_0x2cb34a['options'][_0x88c8('0x1f')]||null:null,'attributes':_0x2cb34a['options']?_0x2cb34a['options']['attributes']||null:null,'limit':_0x2cb34a[_0x88c8('0x1d')]?_0x2cb34a['options'][_0x88c8('0x20')]||null:null,'include':_0x2cb34a[_0x88c8('0x1d')]?_0x2cb34a[_0x88c8('0x1d')][_0x88c8('0x21')]?_['map'](_0x2cb34a[_0x88c8('0x1d')]['include'],function(_0xabdf13){return{'model':db[_0xabdf13[_0x88c8('0x22')]],'as':_0xabdf13['as'],'attributes':_0xabdf13[_0x88c8('0x23')],'include':_0xabdf13['include']?_[_0x88c8('0x24')](_0xabdf13[_0x88c8('0x21')],function(_0x242acc){return{'model':db[_0x242acc[_0x88c8('0x22')]],'as':_0x242acc['as'],'attributes':_0x242acc['attributes'],'include':_0x242acc[_0x88c8('0x21')]?_[_0x88c8('0x24')](_0x242acc[_0x88c8('0x21')],function(_0x116dd9){return{'model':db[_0x116dd9[_0x88c8('0x22')]],'as':_0x116dd9['as'],'attributes':_0x116dd9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b70d4){logger['info']('GetFaxQueue',_0x2cb34a);logger[_0x88c8('0x25')]('GetFaxQueue',_0x2cb34a,JSON[_0x88c8('0x16')](_0x5b70d4));_0x3ea796(_0x5b70d4);})['catch'](function(_0x4bc5d1){logger['error'](_0x88c8('0x1b'),_0x4bc5d1['message'],_0x2cb34a);_0x45abdb(_0x1ded3f['error'](0x1f4,_0x4bc5d1['message']));});});};exports[_0x88c8('0x26')]=function(_0x4f648d){var _0x20db16=this;return new Promise(function(_0x1b17f4,_0x4cf941){return db[_0x88c8('0x1c')][_0x88c8('0x27')]({'raw':_0x4f648d['options']?_0x4f648d[_0x88c8('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4f648d[_0x88c8('0x1d')]?_0x4f648d[_0x88c8('0x1d')][_0x88c8('0x1f')]||null:null,'attributes':_0x4f648d[_0x88c8('0x1d')]?_0x4f648d[_0x88c8('0x1d')][_0x88c8('0x23')]||null:null,'include':_0x4f648d['options']?_0x4f648d[_0x88c8('0x1d')]['include']?_[_0x88c8('0x24')](_0x4f648d[_0x88c8('0x1d')][_0x88c8('0x21')],function(_0x3c4b0e){return{'model':db[_0x3c4b0e[_0x88c8('0x22')]],'as':_0x3c4b0e['as'],'attributes':_0x3c4b0e[_0x88c8('0x23')],'include':_0x3c4b0e[_0x88c8('0x21')]?_['map'](_0x3c4b0e[_0x88c8('0x21')],function(_0x5e8265){return{'model':db[_0x5e8265['model']],'as':_0x5e8265['as'],'attributes':_0x5e8265[_0x88c8('0x23')],'include':_0x5e8265[_0x88c8('0x21')]?_[_0x88c8('0x24')](_0x5e8265[_0x88c8('0x21')],function(_0x10d482){return{'model':db[_0x10d482[_0x88c8('0x22')]],'as':_0x10d482['as'],'attributes':_0x10d482['attributes']};}):[]};}):[]};}):[]:[]})[_0x88c8('0x11')](function(_0x16e6af){logger['info'](_0x88c8('0x26'),_0x4f648d);logger['debug'](_0x88c8('0x26'),_0x4f648d,JSON[_0x88c8('0x16')](_0x16e6af));_0x1b17f4(_0x16e6af);})[_0x88c8('0x28')](function(_0x4e6bd9){logger[_0x88c8('0x17')](_0x88c8('0x26'),_0x4e6bd9['message'],_0x4f648d);_0x4cf941(_0x20db16[_0x88c8('0x17')](0x1f4,_0x4e6bd9[_0x88c8('0x19')]));});});}; \ No newline at end of file +var _0xa8aa=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetFaxQueue','FaxQueue','options','raw','where','limit','include','map','model','attributes','info','ShowFaxQueue','find','then','lodash','moment','bluebird','ioredis'];(function(_0x4ea191,_0xaa7f96){var _0x4b3d5d=function(_0xbaf924){while(--_0xbaf924){_0x4ea191['push'](_0x4ea191['shift']());}};_0x4b3d5d(++_0xaa7f96);}(_0xa8aa,0xf2));var _0xaa8a=function(_0x11897a,_0x1d4f4b){_0x11897a=_0x11897a-0x0;var _0x1b906b=_0xa8aa[_0x11897a];return _0x1b906b;};'use strict';var _=require(_0xaa8a('0x0'));var util=require('util');var moment=require(_0xaa8a('0x1'));var BPromise=require(_0xaa8a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa8a('0x3'));var db=require(_0xaa8a('0x4'))['db'];var utils=require(_0xaa8a('0x5'));var logger=require(_0xaa8a('0x6'))('rpc');var config=require(_0xaa8a('0x7'));var jayson=require(_0xaa8a('0x8'));var client=jayson[_0xaa8a('0x9')][_0xaa8a('0xa')]({'port':0x232a});config['redis']=_[_0xaa8a('0xb')](config[_0xaa8a('0xc')],{'host':_0xaa8a('0xd'),'port':0x18eb});var socket=require(_0xaa8a('0xe'))(new Redis(config[_0xaa8a('0xc')]));require(_0xaa8a('0xf'))[_0xaa8a('0x10')](socket);function respondWithRpcPromise(_0x5254cd,_0x59b671,_0x2cd930){return new BPromise(function(_0x1e2655,_0x68338d){return client['request'](_0x5254cd,_0x2cd930)['then'](function(_0x513349){logger['info'](_0xaa8a('0x11'),_0x59b671,'request\x20sent');logger[_0xaa8a('0x12')](_0xaa8a('0x13'),_0x59b671,_0xaa8a('0x14'),JSON[_0xaa8a('0x15')](_0x513349));if(_0x513349['error']){if(_0x513349['error'][_0xaa8a('0x16')]===0x1f4){logger[_0xaa8a('0x17')](_0xaa8a('0x11'),_0x59b671,_0x513349[_0xaa8a('0x17')][_0xaa8a('0x18')]);return _0x68338d(_0x513349[_0xaa8a('0x17')][_0xaa8a('0x18')]);}logger[_0xaa8a('0x17')]('FaxQueue,\x20%s,\x20%s',_0x59b671,_0x513349[_0xaa8a('0x17')][_0xaa8a('0x18')]);return _0x1e2655(_0x513349[_0xaa8a('0x17')][_0xaa8a('0x18')]);}else{logger['info'](_0xaa8a('0x11'),_0x59b671,_0xaa8a('0x14'));_0x1e2655(_0x513349[_0xaa8a('0x19')]['message']);}})[_0xaa8a('0x1a')](function(_0x11c5b9){logger[_0xaa8a('0x17')](_0xaa8a('0x11'),_0x59b671,_0x11c5b9);_0x68338d(_0x11c5b9);});});}exports[_0xaa8a('0x1b')]=function(_0x2fa716){var _0x3e69e8=this;return new Promise(function(_0x5076de,_0x442154){return db[_0xaa8a('0x1c')]['findAll']({'raw':_0x2fa716[_0xaa8a('0x1d')]?_0x2fa716[_0xaa8a('0x1d')][_0xaa8a('0x1e')]===undefined?!![]:![]:!![],'where':_0x2fa716['options']?_0x2fa716[_0xaa8a('0x1d')][_0xaa8a('0x1f')]||null:null,'attributes':_0x2fa716[_0xaa8a('0x1d')]?_0x2fa716[_0xaa8a('0x1d')]['attributes']||null:null,'limit':_0x2fa716[_0xaa8a('0x1d')]?_0x2fa716[_0xaa8a('0x1d')][_0xaa8a('0x20')]||null:null,'include':_0x2fa716[_0xaa8a('0x1d')]?_0x2fa716[_0xaa8a('0x1d')][_0xaa8a('0x21')]?_[_0xaa8a('0x22')](_0x2fa716['options'][_0xaa8a('0x21')],function(_0xf24ab5){return{'model':db[_0xf24ab5[_0xaa8a('0x23')]],'as':_0xf24ab5['as'],'attributes':_0xf24ab5[_0xaa8a('0x24')],'include':_0xf24ab5[_0xaa8a('0x21')]?_['map'](_0xf24ab5[_0xaa8a('0x21')],function(_0x4b6310){return{'model':db[_0x4b6310[_0xaa8a('0x23')]],'as':_0x4b6310['as'],'attributes':_0x4b6310[_0xaa8a('0x24')],'include':_0x4b6310[_0xaa8a('0x21')]?_['map'](_0x4b6310[_0xaa8a('0x21')],function(_0x2e6974){return{'model':db[_0x2e6974[_0xaa8a('0x23')]],'as':_0x2e6974['as'],'attributes':_0x2e6974[_0xaa8a('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x325371){logger[_0xaa8a('0x25')]('GetFaxQueue',_0x2fa716);logger[_0xaa8a('0x12')](_0xaa8a('0x1b'),_0x2fa716,JSON[_0xaa8a('0x15')](_0x325371));_0x5076de(_0x325371);})[_0xaa8a('0x1a')](function(_0x4c6bcb){logger[_0xaa8a('0x17')]('GetFaxQueue',_0x4c6bcb[_0xaa8a('0x18')],_0x2fa716);_0x442154(_0x3e69e8[_0xaa8a('0x17')](0x1f4,_0x4c6bcb[_0xaa8a('0x18')]));});});};exports[_0xaa8a('0x26')]=function(_0x546ad9){var _0x28a4d6=this;return new Promise(function(_0x3f87d9,_0x6046db){return db['FaxQueue'][_0xaa8a('0x27')]({'raw':_0x546ad9[_0xaa8a('0x1d')]?_0x546ad9['options'][_0xaa8a('0x1e')]===undefined?!![]:![]:!![],'where':_0x546ad9[_0xaa8a('0x1d')]?_0x546ad9[_0xaa8a('0x1d')][_0xaa8a('0x1f')]||null:null,'attributes':_0x546ad9[_0xaa8a('0x1d')]?_0x546ad9[_0xaa8a('0x1d')]['attributes']||null:null,'include':_0x546ad9[_0xaa8a('0x1d')]?_0x546ad9['options'][_0xaa8a('0x21')]?_[_0xaa8a('0x22')](_0x546ad9['options'][_0xaa8a('0x21')],function(_0x2ce664){return{'model':db[_0x2ce664[_0xaa8a('0x23')]],'as':_0x2ce664['as'],'attributes':_0x2ce664[_0xaa8a('0x24')],'include':_0x2ce664[_0xaa8a('0x21')]?_[_0xaa8a('0x22')](_0x2ce664[_0xaa8a('0x21')],function(_0x216d82){return{'model':db[_0x216d82[_0xaa8a('0x23')]],'as':_0x216d82['as'],'attributes':_0x216d82[_0xaa8a('0x24')],'include':_0x216d82[_0xaa8a('0x21')]?_[_0xaa8a('0x22')](_0x216d82[_0xaa8a('0x21')],function(_0x31e9f3){return{'model':db[_0x31e9f3[_0xaa8a('0x23')]],'as':_0x31e9f3['as'],'attributes':_0x31e9f3['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa8a('0x28')](function(_0x4b1273){logger[_0xaa8a('0x25')](_0xaa8a('0x26'),_0x546ad9);logger['debug'](_0xaa8a('0x26'),_0x546ad9,JSON[_0xaa8a('0x15')](_0x4b1273));_0x3f87d9(_0x4b1273);})[_0xaa8a('0x1a')](function(_0x2c9f0d){logger[_0xaa8a('0x17')](_0xaa8a('0x26'),_0x2c9f0d['message'],_0x546ad9);_0x6046db(_0x28a4d6[_0xaa8a('0x17')](0x1f4,_0x2c9f0d[_0xaa8a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index fb75b50..4af77d8 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 _0xd5f2=['update','removeListener','register','faxQueue:','./faxQueue.events','remove'];(function(_0x719c45,_0x15c731){var _0x1be11f=function(_0x5d5bbe){while(--_0x5d5bbe){_0x719c45['push'](_0x719c45['shift']());}};_0x1be11f(++_0x15c731);}(_0xd5f2,0xbe));var _0x2d5f=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xd5f2[_0x1a7846];return _0x48049;};'use strict';var FaxQueueEvents=require(_0x2d5f('0x0'));var events=['save',_0x2d5f('0x1'),_0x2d5f('0x2')];function createListener(_0x16b4df,_0x1bb1bb){return function(_0xd8d07d){_0x1bb1bb['emit'](_0x16b4df,_0xd8d07d);};}function removeListener(_0x3cea98,_0xe05f36){return function(){FaxQueueEvents[_0x2d5f('0x3')](_0x3cea98,_0xe05f36);};}exports[_0x2d5f('0x4')]=function(_0x48e0b2){for(var _0x314ac1=0x0,_0xc2329b=events['length'];_0x314ac1<_0xc2329b;_0x314ac1++){var _0x30439b=events[_0x314ac1];var _0x2d30dd=createListener(_0x2d5f('0x5')+_0x30439b,_0x48e0b2);FaxQueueEvents['on'](_0x30439b,_0x2d30dd);}}; \ No newline at end of file +var _0xae43=['removeListener','length','./faxQueue.events','save','update','emit'];(function(_0x211311,_0x5e08e9){var _0x12d89b=function(_0x19390f){while(--_0x19390f){_0x211311['push'](_0x211311['shift']());}};_0x12d89b(++_0x5e08e9);}(_0xae43,0x158));var _0x3ae4=function(_0x5bb4e8,_0x44b756){_0x5bb4e8=_0x5bb4e8-0x0;var _0x2a86f2=_0xae43[_0x5bb4e8];return _0x2a86f2;};'use strict';var FaxQueueEvents=require(_0x3ae4('0x0'));var events=[_0x3ae4('0x1'),'remove',_0x3ae4('0x2')];function createListener(_0x3c7344,_0x4da538){return function(_0x258d27){_0x4da538[_0x3ae4('0x3')](_0x3c7344,_0x258d27);};}function removeListener(_0x2e65e7,_0x3eba66){return function(){FaxQueueEvents[_0x3ae4('0x4')](_0x2e65e7,_0x3eba66);};}exports['register']=function(_0x2f8d05){for(var _0x2d515f=0x0,_0xd6e4af=events[_0x3ae4('0x5')];_0x2d515f<_0xd6e4af;_0x2d515f++){var _0x505d14=events[_0x2d515f];var _0x4be030=createListener('faxQueue:'+_0x505d14,_0x2f8d05);FaxQueueEvents['on'](_0x505d14,_0x4be030);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 9662f2c..faa57f3 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 _0x9d2d=['isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x9d2d,0xc9));var _0xd9d2=function(_0x2995e1,_0x179768){_0x2995e1=_0x2995e1-0x0;var _0x3a1235=_0x9d2d[_0x2995e1];return _0x3a1235;};'use strict';var multer=require(_0xd9d2('0x0'));var util=require(_0xd9d2('0x1'));var path=require(_0xd9d2('0x2'));var timeout=require(_0xd9d2('0x3'));var express=require('express');var router=express[_0xd9d2('0x4')]();var auth=require(_0xd9d2('0x5'));var interaction=require(_0xd9d2('0x6'));var config=require('../../config/environment');var controller=require(_0xd9d2('0x7'));router[_0xd9d2('0x8')]('/',auth[_0xd9d2('0x9')](),controller[_0xd9d2('0xa')]);router[_0xd9d2('0x8')](_0xd9d2('0xb'),auth[_0xd9d2('0x9')](),controller[_0xd9d2('0xc')]);router[_0xd9d2('0x8')](_0xd9d2('0xd'),auth[_0xd9d2('0x9')](),controller[_0xd9d2('0xe')]);router[_0xd9d2('0x8')](_0xd9d2('0xf'),auth[_0xd9d2('0x9')](),controller[_0xd9d2('0x10')]);router[_0xd9d2('0x8')](_0xd9d2('0x11'),auth[_0xd9d2('0x9')](),controller[_0xd9d2('0x12')]);router['get'](_0xd9d2('0x13'),auth[_0xd9d2('0x9')](),controller[_0xd9d2('0x14')]);router[_0xd9d2('0x15')]('/',auth[_0xd9d2('0x9')](),controller[_0xd9d2('0x16')]);router[_0xd9d2('0x15')]('/:id/teams',auth[_0xd9d2('0x9')](),controller['addTeams']);router[_0xd9d2('0x15')](_0xd9d2('0x13'),auth[_0xd9d2('0x9')](),controller[_0xd9d2('0x17')]);router['put'](_0xd9d2('0xd'),auth['isAuthenticated'](),controller[_0xd9d2('0x18')]);router[_0xd9d2('0x19')]('/:id',auth[_0xd9d2('0x9')](),controller[_0xd9d2('0x1a')]);router['delete'](_0xd9d2('0x11'),auth[_0xd9d2('0x9')](),controller[_0xd9d2('0x1b')]);router[_0xd9d2('0x19')](_0xd9d2('0x13'),auth[_0xd9d2('0x9')](),controller[_0xd9d2('0x1c')]);module[_0xd9d2('0x1d')]=router; \ No newline at end of file +var _0x159f=['/:id/members','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x3fadd6,_0x2bf0b2){var _0x5b90f9=function(_0x226bc6){while(--_0x226bc6){_0x3fadd6['push'](_0x3fadd6['shift']());}};_0x5b90f9(++_0x2bf0b2);}(_0x159f,0x19c));var _0xf159=function(_0x4086f9,_0x246b55){_0x4086f9=_0x4086f9-0x0;var _0x1f1eea=_0x159f[_0x4086f9];return _0x1f1eea;};'use strict';var multer=require(_0xf159('0x0'));var util=require(_0xf159('0x1'));var path=require(_0xf159('0x2'));var timeout=require(_0xf159('0x3'));var express=require(_0xf159('0x4'));var router=express['Router']();var auth=require(_0xf159('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf159('0x6'));router[_0xf159('0x7')]('/',auth[_0xf159('0x8')](),controller[_0xf159('0x9')]);router[_0xf159('0x7')](_0xf159('0xa'),auth[_0xf159('0x8')](),controller['describe']);router[_0xf159('0x7')](_0xf159('0xb'),auth[_0xf159('0x8')](),controller[_0xf159('0xc')]);router[_0xf159('0x7')](_0xf159('0xd'),auth[_0xf159('0x8')](),controller['getMembers']);router[_0xf159('0x7')]('/:id/teams',auth[_0xf159('0x8')](),controller['getTeams']);router[_0xf159('0x7')](_0xf159('0xe'),auth[_0xf159('0x8')](),controller['getAgents']);router[_0xf159('0xf')]('/',auth[_0xf159('0x8')](),controller[_0xf159('0x10')]);router['post'](_0xf159('0x11'),auth[_0xf159('0x8')](),controller[_0xf159('0x12')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xf159('0x13')]);router[_0xf159('0x14')](_0xf159('0xb'),auth[_0xf159('0x8')](),controller['update']);router[_0xf159('0x15')](_0xf159('0xb'),auth[_0xf159('0x8')](),controller[_0xf159('0x16')]);router[_0xf159('0x15')]('/:id/teams',auth[_0xf159('0x8')](),controller['removeTeams']);router[_0xf159('0x15')](_0xf159('0xe'),auth[_0xf159('0x8')](),controller[_0xf159('0x17')]);module[_0xf159('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 9730a07..35953e3 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 _0x8c0d=['STRING','DATE','moment','sequelize','exports'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x8c0d,0x93));var _0xd8c0=function(_0x109fbb,_0xa85e95){_0x109fbb=_0x109fbb-0x0;var _0x259275=_0x8c0d[_0x109fbb];return _0x259275;};'use strict';var moment=require(_0xd8c0('0x0'));var Sequelize=require(_0xd8c0('0x1'));module[_0xd8c0('0x2')]={'uniqueid':{'type':Sequelize[_0xd8c0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd8c0('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd8c0('0x4')]},'acceptAt':{'type':Sequelize[_0xd8c0('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x774c=['sequelize','STRING','DATE','moment'];(function(_0x1e85e6,_0x4a9160){var _0x3635f1=function(_0x47608b){while(--_0x47608b){_0x1e85e6['push'](_0x1e85e6['shift']());}};_0x3635f1(++_0x4a9160);}(_0x774c,0xa3));var _0xc774=function(_0x2a5864,_0x2b9396){_0x2a5864=_0x2a5864-0x0;var _0x490ab6=_0x774c[_0x2a5864];return _0x490ab6;};'use strict';var moment=require(_0xc774('0x0'));var Sequelize=require(_0xc774('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xc774('0x2')]},'joinAt':{'type':Sequelize[_0xc774('0x3')]},'leaveAt':{'type':Sequelize[_0xc774('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc774('0x3')]},'reason':{'type':Sequelize[_0xc774('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 7fe19a7..6c09a0b 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 _0xcdbc=['set','reject','update','end','error','stack','name','index','model','query','keys','intersection','fields','attributes','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','field','FaxQueueReport','includeAll','include','findAll','rows','then','catch','show','length','find','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset'];(function(_0x3f7639,_0x1a860b){var _0x6d56f4=function(_0x60973a){while(--_0x60973a){_0x3f7639['push'](_0x3f7639['shift']());}};_0x6d56f4(++_0x1a860b);}(_0xcdbc,0x131));var _0xccdb=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xcdbc[_0x57b54c];return _0x59cc19;};'use strict';var pdf=require(_0xccdb('0x0'));var emlformat=require(_0xccdb('0x1'));var rimraf=require(_0xccdb('0x2'));var zipdir=require(_0xccdb('0x3'));var jsonpatch=require(_0xccdb('0x4'));var rp=require(_0xccdb('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xccdb('0x6'));var util=require(_0xccdb('0x7'));var path=require(_0xccdb('0x8'));var sox=require('sox');var csv=require(_0xccdb('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xccdb('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xccdb('0xb'));var authService=require(_0xccdb('0xc'));var hardwareService=require(_0xccdb('0xd'));var Redis=require(_0xccdb('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0xccdb('0xf'))(_0xccdb('0x10'));var utils=require(_0xccdb('0x11'));var config=require(_0xccdb('0x12'));var db=require(_0xccdb('0x13'))['db'];function respondWithStatusCode(_0x5e35fa,_0x59eb0a){_0x59eb0a=_0x59eb0a||0xcc;return function(_0x304894){if(_0x304894){return _0x5e35fa[_0xccdb('0x14')](_0x59eb0a);}return _0x5e35fa[_0xccdb('0x15')](_0x59eb0a)['end']();};}function respondWithResult(_0x5c5d36,_0x137863){_0x137863=_0x137863||0xc8;return function(_0x56e09b){if(_0x56e09b){return _0x5c5d36[_0xccdb('0x15')](_0x137863)[_0xccdb('0x16')](_0x56e09b);}};}function respondWithFilteredResult(_0x15622d,_0x5b30ca){return function(_0x353309){if(_0x353309){var _0x40d53d=_0x353309[_0xccdb('0x17')],_0x3db8d4=_0x5b30ca[_0xccdb('0x18')],_0x39ad0f=_0x5b30ca[_0xccdb('0x18')]+_0x5b30ca['limit'],_0xa47bea;if(_0x39ad0f>=_0x40d53d){_0x39ad0f=_0x40d53d;_0xa47bea=0xc8;}else{_0xa47bea=0xce;}_0x15622d[_0xccdb('0x15')](_0xa47bea);return _0x15622d[_0xccdb('0x19')]('Content-Range',_0x3db8d4+'-'+_0x39ad0f+'/'+_0x40d53d)[_0xccdb('0x16')](_0x353309);}return null;};}function patchUpdates(_0x525a40){return function(_0x4926f6){try{jsonpatch['apply'](_0x4926f6,_0x525a40,!![]);}catch(_0x4eb3eb){return BPromise[_0xccdb('0x1a')](_0x4eb3eb);}return _0x4926f6['save']();};}function saveUpdates(_0x592e46,_0x54229d){return function(_0x390f61){if(_0x390f61){return _0x390f61[_0xccdb('0x1b')](_0x592e46)['then'](function(_0x5128ef){return _0x5128ef;});}return null;};}function removeEntity(_0x388777,_0x45d5a4){return function(_0x21e31c){if(_0x21e31c){return _0x21e31c['destroy']()['then'](function(){_0x388777[_0xccdb('0x15')](0xcc)[_0xccdb('0x1c')]();});}};}function handleEntityNotFound(_0x579c0d,_0x14fc60){return function(_0x1d582e){if(!_0x1d582e){_0x579c0d[_0xccdb('0x14')](0x194);}return _0x1d582e;};}function handleError(_0x357906,_0x2c1a64){_0x2c1a64=_0x2c1a64||0x1f4;return function(_0x1fa2d8){logger[_0xccdb('0x1d')](_0x1fa2d8[_0xccdb('0x1e')]);if(_0x1fa2d8[_0xccdb('0x1f')]){delete _0x1fa2d8['name'];}_0x357906[_0xccdb('0x15')](_0x2c1a64)['send'](_0x1fa2d8);};}exports[_0xccdb('0x20')]=function(_0x334981,_0x4e56cc){var _0xc6b976={},_0x2f6fb1={},_0x5f389e={'count':0x0,'rows':[]};var _0x390c63=db['FaxQueueReport']['rawAttributes'];_0x2f6fb1[_0xccdb('0x21')]=_['keys'](_0x390c63);_0x2f6fb1[_0xccdb('0x22')]=_[_0xccdb('0x23')](_0x334981['query']);_0x2f6fb1['filters']=_[_0xccdb('0x24')](_0x2f6fb1[_0xccdb('0x21')],_0x2f6fb1['query']);_0xc6b976['attributes']=_['intersection'](_0x2f6fb1[_0xccdb('0x21')],qs[_0xccdb('0x25')](_0x334981['query']['fields']));_0xc6b976[_0xccdb('0x26')]=_0xc6b976[_0xccdb('0x26')]['length']?_0xc6b976[_0xccdb('0x26')]:_0x2f6fb1[_0xccdb('0x21')];if(!_0x334981[_0xccdb('0x22')]['hasOwnProperty'](_0xccdb('0x27'))){_0xc6b976[_0xccdb('0x28')]=qs['limit'](_0x334981[_0xccdb('0x22')][_0xccdb('0x28')]);_0xc6b976[_0xccdb('0x18')]=qs[_0xccdb('0x18')](_0x334981[_0xccdb('0x22')][_0xccdb('0x18')]);}_0xc6b976[_0xccdb('0x29')]=qs[_0xccdb('0x2a')](_0x334981[_0xccdb('0x22')]['sort']);_0xc6b976[_0xccdb('0x2b')]=qs[_0xccdb('0x2c')](_[_0xccdb('0x2d')](_0x334981[_0xccdb('0x22')],_0x2f6fb1[_0xccdb('0x2c')]));if(_0x334981[_0xccdb('0x22')][_0xccdb('0x2e')]){_0xc6b976['where']=_[_0xccdb('0x2f')](_0xc6b976[_0xccdb('0x2b')],{'$or':_[_0xccdb('0x30')](_0x390c63,function(_0x5b4dbf){if(_0x5b4dbf[_0xccdb('0x31')]['key']!=='VIRTUAL'){var _0x1e43ae={};_0x1e43ae[_0x5b4dbf[_0xccdb('0x32')]]={'$like':'%'+_0x334981[_0xccdb('0x22')][_0xccdb('0x2e')]+'%'};return _0x1e43ae;}})});}_0xc6b976=_[_0xccdb('0x2f')]({},_0xc6b976,_0x334981['options']);var _0x54364b={'where':_0xc6b976['where']};return db[_0xccdb('0x33')]['count'](_0x54364b)['then'](function(_0x1e3f8b){_0x5f389e[_0xccdb('0x17')]=_0x1e3f8b;if(_0x334981['query'][_0xccdb('0x34')]){_0xc6b976[_0xccdb('0x35')]=[{'all':!![]}];}return db[_0xccdb('0x33')][_0xccdb('0x36')](_0xc6b976);})['then'](function(_0x54f9e7){_0x5f389e[_0xccdb('0x37')]=_0x54f9e7;return _0x5f389e;})[_0xccdb('0x38')](respondWithFilteredResult(_0x4e56cc,_0xc6b976))[_0xccdb('0x39')](handleError(_0x4e56cc,null));};exports[_0xccdb('0x3a')]=function(_0x41f2d0,_0x4c994c){var _0x12ee5c={'raw':!![],'where':{'id':_0x41f2d0['params']['id']}},_0x43d8d2={};_0x43d8d2[_0xccdb('0x21')]=_[_0xccdb('0x23')](db[_0xccdb('0x33')]['rawAttributes']);_0x43d8d2['query']=_[_0xccdb('0x23')](_0x41f2d0[_0xccdb('0x22')]);_0x43d8d2[_0xccdb('0x2c')]=_['intersection'](_0x43d8d2['model'],_0x43d8d2[_0xccdb('0x22')]);_0x12ee5c['attributes']=_[_0xccdb('0x24')](_0x43d8d2[_0xccdb('0x21')],qs[_0xccdb('0x25')](_0x41f2d0['query'][_0xccdb('0x25')]));_0x12ee5c[_0xccdb('0x26')]=_0x12ee5c[_0xccdb('0x26')][_0xccdb('0x3b')]?_0x12ee5c[_0xccdb('0x26')]:_0x43d8d2['model'];if(_0x41f2d0[_0xccdb('0x22')][_0xccdb('0x34')]){_0x12ee5c[_0xccdb('0x35')]=[{'all':!![]}];}_0x12ee5c=_[_0xccdb('0x2f')]({},_0x12ee5c,_0x41f2d0['options']);return db[_0xccdb('0x33')][_0xccdb('0x3c')](_0x12ee5c)[_0xccdb('0x38')](handleEntityNotFound(_0x4c994c,null))[_0xccdb('0x38')](respondWithResult(_0x4c994c,null))[_0xccdb('0x39')](handleError(_0x4c994c,null));};exports[_0xccdb('0x3d')]=function(_0x5abd2a,_0x45f3c7){return db[_0xccdb('0x33')][_0xccdb('0x3d')](_0x5abd2a[_0xccdb('0x3e')],{})['then'](respondWithResult(_0x45f3c7,0xc9))[_0xccdb('0x39')](handleError(_0x45f3c7,null));};exports[_0xccdb('0x1b')]=function(_0x8ae565,_0x108131){if(_0x8ae565[_0xccdb('0x3e')]['id']){delete _0x8ae565[_0xccdb('0x3e')]['id'];}return db[_0xccdb('0x33')][_0xccdb('0x3c')]({'where':{'id':_0x8ae565[_0xccdb('0x3f')]['id']}})[_0xccdb('0x38')](handleEntityNotFound(_0x108131,null))[_0xccdb('0x38')](saveUpdates(_0x8ae565['body'],null))[_0xccdb('0x38')](respondWithResult(_0x108131,null))[_0xccdb('0x39')](handleError(_0x108131,null));};exports[_0xccdb('0x40')]=function(_0x34e3f5,_0x21beec){return db[_0xccdb('0x33')][_0xccdb('0x3c')]({'where':{'id':_0x34e3f5[_0xccdb('0x3f')]['id']}})['then'](handleEntityNotFound(_0x21beec,null))['then'](removeEntity(_0x21beec,null))[_0xccdb('0x39')](handleError(_0x21beec,null));};exports['describe']=function(_0x15eb73,_0x76c748){return db['FaxQueueReport'][_0xccdb('0x41')]()[_0xccdb('0x38')](respondWithResult(_0x76c748,null))[_0xccdb('0x39')](handleError(_0x76c748,null));}; \ No newline at end of file +var _0x6ea3=['options','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','FaxQueueReport','rawAttributes','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','type','VIRTUAL','field','merge','includeAll','findAll','rows','catch','show','params'];(function(_0x5f44dc,_0x962486){var _0x2f773a=function(_0x1adb19){while(--_0x1adb19){_0x5f44dc['push'](_0x5f44dc['shift']());}};_0x2f773a(++_0x962486);}(_0x6ea3,0x1b5));var _0x36ea=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x6ea3[_0x2642cb];return _0xe6e41;};'use strict';var pdf=require(_0x36ea('0x0'));var emlformat=require(_0x36ea('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x36ea('0x2'));var jsonpatch=require(_0x36ea('0x3'));var rp=require(_0x36ea('0x4'));var moment=require(_0x36ea('0x5'));var BPromise=require(_0x36ea('0x6'));var Mustache=require(_0x36ea('0x7'));var util=require(_0x36ea('0x8'));var path=require('path');var sox=require(_0x36ea('0x9'));var csv=require('to-csv');var ejs=require(_0x36ea('0xa'));var fs=require('fs');var _=require(_0x36ea('0xb'));var squel=require(_0x36ea('0xc'));var crypto=require(_0x36ea('0xd'));var jsforce=require(_0x36ea('0xe'));var deskjs=require(_0x36ea('0xf'));var toCsv=require(_0x36ea('0x10'));var querystring=require(_0x36ea('0x11'));var Papa=require(_0x36ea('0x12'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x36ea('0x13'));var qs=require(_0x36ea('0x14'));var logger=require(_0x36ea('0x15'))('api');var utils=require(_0x36ea('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9a7e2c,_0x8fd0b2){_0x8fd0b2=_0x8fd0b2||0xcc;return function(_0x2ffd3f){if(_0x2ffd3f){return _0x9a7e2c[_0x36ea('0x17')](_0x8fd0b2);}return _0x9a7e2c[_0x36ea('0x18')](_0x8fd0b2)[_0x36ea('0x19')]();};}function respondWithResult(_0x1d7625,_0x2e6fcd){_0x2e6fcd=_0x2e6fcd||0xc8;return function(_0x1ed6ce){if(_0x1ed6ce){return _0x1d7625[_0x36ea('0x18')](_0x2e6fcd)[_0x36ea('0x1a')](_0x1ed6ce);}};}function respondWithFilteredResult(_0x9b29ad,_0x40a11c){return function(_0xfd7e04){if(_0xfd7e04){var _0x4d197c=_0xfd7e04[_0x36ea('0x1b')],_0x39457a=_0x40a11c[_0x36ea('0x1c')],_0x1bd66c=_0x40a11c[_0x36ea('0x1c')]+_0x40a11c[_0x36ea('0x1d')],_0x42c2fc;if(_0x1bd66c>=_0x4d197c){_0x1bd66c=_0x4d197c;_0x42c2fc=0xc8;}else{_0x42c2fc=0xce;}_0x9b29ad[_0x36ea('0x18')](_0x42c2fc);return _0x9b29ad[_0x36ea('0x1e')](_0x36ea('0x1f'),_0x39457a+'-'+_0x1bd66c+'/'+_0x4d197c)['json'](_0xfd7e04);}return null;};}function patchUpdates(_0x380edb){return function(_0x3a1d9b){try{jsonpatch[_0x36ea('0x20')](_0x3a1d9b,_0x380edb,!![]);}catch(_0x323b32){return BPromise[_0x36ea('0x21')](_0x323b32);}return _0x3a1d9b['save']();};}function saveUpdates(_0x513af7,_0x37848d){return function(_0xa5781a){if(_0xa5781a){return _0xa5781a[_0x36ea('0x22')](_0x513af7)[_0x36ea('0x23')](function(_0x39355d){return _0x39355d;});}return null;};}function removeEntity(_0xaf90c8,_0x4bc292){return function(_0x1962ca){if(_0x1962ca){return _0x1962ca[_0x36ea('0x24')]()[_0x36ea('0x23')](function(){_0xaf90c8[_0x36ea('0x18')](0xcc)[_0x36ea('0x19')]();});}};}function handleEntityNotFound(_0x1492eb,_0x4acf2b){return function(_0x2b3b76){if(!_0x2b3b76){_0x1492eb[_0x36ea('0x17')](0x194);}return _0x2b3b76;};}function handleError(_0xfaf56c,_0x29aa70){_0x29aa70=_0x29aa70||0x1f4;return function(_0x4892c2){logger[_0x36ea('0x25')](_0x4892c2[_0x36ea('0x26')]);if(_0x4892c2['name']){delete _0x4892c2[_0x36ea('0x27')];}_0xfaf56c['status'](_0x29aa70)[_0x36ea('0x28')](_0x4892c2);};}exports[_0x36ea('0x29')]=function(_0x5f5a87,_0x51b93a){var _0x469aa6={},_0x37ea5e={},_0x30c395={'count':0x0,'rows':[]};var _0x199719=db[_0x36ea('0x2a')][_0x36ea('0x2b')];_0x37ea5e[_0x36ea('0x2c')]=_[_0x36ea('0x2d')](_0x199719);_0x37ea5e['query']=_['keys'](_0x5f5a87[_0x36ea('0x2e')]);_0x37ea5e['filters']=_['intersection'](_0x37ea5e['model'],_0x37ea5e[_0x36ea('0x2e')]);_0x469aa6[_0x36ea('0x2f')]=_[_0x36ea('0x30')](_0x37ea5e[_0x36ea('0x2c')],qs['fields'](_0x5f5a87[_0x36ea('0x2e')][_0x36ea('0x31')]));_0x469aa6[_0x36ea('0x2f')]=_0x469aa6[_0x36ea('0x2f')][_0x36ea('0x32')]?_0x469aa6[_0x36ea('0x2f')]:_0x37ea5e['model'];if(!_0x5f5a87[_0x36ea('0x2e')]['hasOwnProperty'](_0x36ea('0x33'))){_0x469aa6['limit']=qs[_0x36ea('0x1d')](_0x5f5a87[_0x36ea('0x2e')]['limit']);_0x469aa6[_0x36ea('0x1c')]=qs[_0x36ea('0x1c')](_0x5f5a87[_0x36ea('0x2e')][_0x36ea('0x1c')]);}_0x469aa6[_0x36ea('0x34')]=qs[_0x36ea('0x35')](_0x5f5a87[_0x36ea('0x2e')][_0x36ea('0x35')]);_0x469aa6['where']=qs[_0x36ea('0x36')](_[_0x36ea('0x37')](_0x5f5a87[_0x36ea('0x2e')],_0x37ea5e[_0x36ea('0x36')]));if(_0x5f5a87[_0x36ea('0x2e')]['filter']){_0x469aa6[_0x36ea('0x38')]=_['merge'](_0x469aa6[_0x36ea('0x38')],{'$or':_['map'](_0x199719,function(_0x330476){if(_0x330476[_0x36ea('0x39')]['key']!==_0x36ea('0x3a')){var _0x28a83d={};_0x28a83d[_0x330476[_0x36ea('0x3b')]]={'$like':'%'+_0x5f5a87['query']['filter']+'%'};return _0x28a83d;}})});}_0x469aa6=_[_0x36ea('0x3c')]({},_0x469aa6,_0x5f5a87['options']);var _0x3e7c03={'where':_0x469aa6[_0x36ea('0x38')]};return db['FaxQueueReport'][_0x36ea('0x1b')](_0x3e7c03)[_0x36ea('0x23')](function(_0x557195){_0x30c395[_0x36ea('0x1b')]=_0x557195;if(_0x5f5a87[_0x36ea('0x2e')][_0x36ea('0x3d')]){_0x469aa6['include']=[{'all':!![]}];}return db[_0x36ea('0x2a')][_0x36ea('0x3e')](_0x469aa6);})[_0x36ea('0x23')](function(_0x23291c){_0x30c395[_0x36ea('0x3f')]=_0x23291c;return _0x30c395;})[_0x36ea('0x23')](respondWithFilteredResult(_0x51b93a,_0x469aa6))[_0x36ea('0x40')](handleError(_0x51b93a,null));};exports[_0x36ea('0x41')]=function(_0xadcbfa,_0x45d244){var _0x4c75cc={'raw':!![],'where':{'id':_0xadcbfa[_0x36ea('0x42')]['id']}},_0x34fb06={};_0x34fb06[_0x36ea('0x2c')]=_[_0x36ea('0x2d')](db[_0x36ea('0x2a')][_0x36ea('0x2b')]);_0x34fb06['query']=_[_0x36ea('0x2d')](_0xadcbfa[_0x36ea('0x2e')]);_0x34fb06[_0x36ea('0x36')]=_[_0x36ea('0x30')](_0x34fb06[_0x36ea('0x2c')],_0x34fb06[_0x36ea('0x2e')]);_0x4c75cc['attributes']=_['intersection'](_0x34fb06[_0x36ea('0x2c')],qs[_0x36ea('0x31')](_0xadcbfa['query'][_0x36ea('0x31')]));_0x4c75cc['attributes']=_0x4c75cc[_0x36ea('0x2f')][_0x36ea('0x32')]?_0x4c75cc['attributes']:_0x34fb06['model'];if(_0xadcbfa[_0x36ea('0x2e')][_0x36ea('0x3d')]){_0x4c75cc['include']=[{'all':!![]}];}_0x4c75cc=_[_0x36ea('0x3c')]({},_0x4c75cc,_0xadcbfa[_0x36ea('0x43')]);return db[_0x36ea('0x2a')][_0x36ea('0x44')](_0x4c75cc)[_0x36ea('0x23')](handleEntityNotFound(_0x45d244,null))[_0x36ea('0x23')](respondWithResult(_0x45d244,null))[_0x36ea('0x40')](handleError(_0x45d244,null));};exports[_0x36ea('0x45')]=function(_0x20712,_0x46e242){return db['FaxQueueReport'][_0x36ea('0x45')](_0x20712[_0x36ea('0x46')],{})[_0x36ea('0x23')](respondWithResult(_0x46e242,0xc9))['catch'](handleError(_0x46e242,null));};exports[_0x36ea('0x22')]=function(_0x42e51a,_0x4fdca4){if(_0x42e51a[_0x36ea('0x46')]['id']){delete _0x42e51a[_0x36ea('0x46')]['id'];}return db[_0x36ea('0x2a')][_0x36ea('0x44')]({'where':{'id':_0x42e51a[_0x36ea('0x42')]['id']}})['then'](handleEntityNotFound(_0x4fdca4,null))['then'](saveUpdates(_0x42e51a[_0x36ea('0x46')],null))[_0x36ea('0x23')](respondWithResult(_0x4fdca4,null))[_0x36ea('0x40')](handleError(_0x4fdca4,null));};exports[_0x36ea('0x24')]=function(_0x492c4a,_0x52987d){return db[_0x36ea('0x2a')]['find']({'where':{'id':_0x492c4a[_0x36ea('0x42')]['id']}})['then'](handleEntityNotFound(_0x52987d,null))[_0x36ea('0x23')](removeEntity(_0x52987d,null))[_0x36ea('0x40')](handleError(_0x52987d,null));};exports[_0x36ea('0x47')]=function(_0x3a34d9,_0x49296c){return db['FaxQueueReport'][_0x36ea('0x47')]()[_0x36ea('0x23')](respondWithResult(_0x49296c,null))[_0x36ea('0x40')](handleError(_0x49296c,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 8ae5f1f..aef4c1c 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 _0xaae5=['util','../../config/logger','api','moment','bluebird','request-promise','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x466a1a,_0x37933b){var _0x577165=function(_0x4c97b9){while(--_0x4c97b9){_0x466a1a['push'](_0x466a1a['shift']());}};_0x577165(++_0x37933b);}(_0xaae5,0x175));var _0x5aae=function(_0x3e00a1,_0x43f350){_0x3e00a1=_0x3e00a1-0x0;var _0x1b444f=_0xaae5[_0x3e00a1];return _0x1b444f;};'use strict';var _=require(_0x5aae('0x0'));var util=require(_0x5aae('0x1'));var logger=require(_0x5aae('0x2'))(_0x5aae('0x3'));var moment=require(_0x5aae('0x4'));var BPromise=require(_0x5aae('0x5'));var rp=require(_0x5aae('0x6'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1007a7,_0x15bfd2){return _0x1007a7[_0x5aae('0x7')](_0x5aae('0x8'),attributes,{'tableName':_0x5aae('0x9'),'paranoid':![],'indexes':[{'name':_0x5aae('0xa'),'fields':[_0x5aae('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7176=['FaxQueueReport','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','exports'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0x7176,0x1b1));var _0x6717=function(_0x268ef8,_0x186ffd){_0x268ef8=_0x268ef8-0x0;var _0x5e1cd5=_0x7176[_0x268ef8];return _0x5e1cd5;};'use strict';var _=require(_0x6717('0x0'));var util=require(_0x6717('0x1'));var logger=require(_0x6717('0x2'))(_0x6717('0x3'));var moment=require('moment');var BPromise=require(_0x6717('0x4'));var rp=require(_0x6717('0x5'));var attributes=require('./faxQueueReport.attributes');module[_0x6717('0x6')]=function(_0x3b85ae,_0x4deaf6){return _0x3b85ae['define'](_0x6717('0x7'),attributes,{'tableName':_0x6717('0x8'),'paranoid':![],'indexes':[{'name':_0x6717('0x9'),'fields':[_0x6717('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 41dce89..a7e1aa4 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 _0xfd6f=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','CreateFaxQueueReport','FaxQueueReport','create','options','UpdateFaxQueueReport','update','body','raw','where','attributes','limit','catch','lodash','util','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfd6f,0x19d));var _0xffd6=function(_0x50618c,_0x2224e8){_0x50618c=_0x50618c-0x0;var _0x489904=_0xfd6f[_0x50618c];return _0x489904;};'use strict';var _=require(_0xffd6('0x0'));var util=require(_0xffd6('0x1'));var moment=require(_0xffd6('0x2'));var BPromise=require(_0xffd6('0x3'));var rs=require(_0xffd6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffd6('0x5'))['db'];var utils=require(_0xffd6('0x6'));var logger=require(_0xffd6('0x7'))(_0xffd6('0x8'));var config=require('../../config/environment');var jayson=require(_0xffd6('0x9'));var client=jayson[_0xffd6('0xa')][_0xffd6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10b335,_0x5c19ee,_0x3f9538){return new BPromise(function(_0x534a1b,_0x54d793){return client['request'](_0x10b335,_0x3f9538)[_0xffd6('0xc')](function(_0x4267fc){logger[_0xffd6('0xd')](_0xffd6('0xe'),_0x5c19ee,'request\x20sent');logger[_0xffd6('0xf')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x5c19ee,'request\x20sent',JSON[_0xffd6('0x10')](_0x4267fc));if(_0x4267fc[_0xffd6('0x11')]){if(_0x4267fc[_0xffd6('0x11')]['code']===0x1f4){logger[_0xffd6('0x11')](_0xffd6('0xe'),_0x5c19ee,_0x4267fc['error'][_0xffd6('0x12')]);return _0x54d793(_0x4267fc[_0xffd6('0x11')][_0xffd6('0x12')]);}logger[_0xffd6('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x5c19ee,_0x4267fc['error'][_0xffd6('0x12')]);return _0x534a1b(_0x4267fc[_0xffd6('0x11')][_0xffd6('0x12')]);}else{logger['info'](_0xffd6('0xe'),_0x5c19ee,_0xffd6('0x13'));_0x534a1b(_0x4267fc['result'][_0xffd6('0x12')]);}})['catch'](function(_0x1881a1){logger[_0xffd6('0x11')](_0xffd6('0xe'),_0x5c19ee,_0x1881a1);_0x54d793(_0x1881a1);});});}exports[_0xffd6('0x14')]=function(_0x1c96dc){var _0x57af76=this;return new Promise(function(_0xe2f572,_0x39938d){return db[_0xffd6('0x15')][_0xffd6('0x16')](_0x1c96dc['body'],{'raw':_0x1c96dc['options']?_0x1c96dc[_0xffd6('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x453e4e){logger[_0xffd6('0xd')](_0xffd6('0x14'),_0x1c96dc);logger[_0xffd6('0xf')](_0xffd6('0x14'),_0x1c96dc,JSON[_0xffd6('0x10')](_0x453e4e));_0xe2f572(_0x453e4e);})['catch'](function(_0x44e5f5){logger[_0xffd6('0x11')]('CreateFaxQueueReport',_0x44e5f5[_0xffd6('0x12')],_0x1c96dc);_0x39938d(_0x57af76['error'](0x1f4,_0x44e5f5[_0xffd6('0x12')]));});});};exports[_0xffd6('0x18')]=function(_0x18fd0f){var _0x5e0e4c=this;return new Promise(function(_0x564623,_0x4b75c6){return db[_0xffd6('0x15')][_0xffd6('0x19')](_0x18fd0f[_0xffd6('0x1a')],{'raw':_0x18fd0f['options']?_0x18fd0f[_0xffd6('0x17')][_0xffd6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18fd0f[_0xffd6('0x17')]?_0x18fd0f[_0xffd6('0x17')][_0xffd6('0x1c')]||null:null,'attributes':_0x18fd0f['options']?_0x18fd0f[_0xffd6('0x17')][_0xffd6('0x1d')]||null:null,'limit':_0x18fd0f[_0xffd6('0x17')]?_0x18fd0f[_0xffd6('0x17')][_0xffd6('0x1e')]||null:null})[_0xffd6('0xc')](function(_0x2f3645){logger[_0xffd6('0xd')](_0xffd6('0x18'),_0x18fd0f);logger[_0xffd6('0xf')](_0xffd6('0x18'),_0x18fd0f,JSON['stringify'](_0x2f3645));_0x564623(_0x2f3645);})[_0xffd6('0x1f')](function(_0x3eb1b3){logger[_0xffd6('0x11')](_0xffd6('0x18'),_0x3eb1b3[_0xffd6('0x12')],_0x18fd0f);_0x4b75c6(_0x5e0e4c[_0xffd6('0x11')](0x1f4,_0x3eb1b3['message']));});});}; \ No newline at end of file +var _0x4171=['FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxQueueReport','FaxQueueReport','body','raw','then','catch','UpdateFaxQueueReport','options','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x45b482,_0x3be9d9){var _0x1d7e90=function(_0x6fe47b){while(--_0x6fe47b){_0x45b482['push'](_0x45b482['shift']());}};_0x1d7e90(++_0x3be9d9);}(_0x4171,0x6a));var _0x1417=function(_0x555cdd,_0x4c1018){_0x555cdd=_0x555cdd-0x0;var _0x455c20=_0x4171[_0x555cdd];return _0x455c20;};'use strict';var _=require('lodash');var util=require(_0x1417('0x0'));var moment=require(_0x1417('0x1'));var BPromise=require(_0x1417('0x2'));var rs=require(_0x1417('0x3'));var fs=require('fs');var Redis=require(_0x1417('0x4'));var db=require(_0x1417('0x5'))['db'];var utils=require(_0x1417('0x6'));var logger=require('../../config/logger')(_0x1417('0x7'));var config=require('../../config/environment');var jayson=require(_0x1417('0x8'));var client=jayson['client'][_0x1417('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35c775,_0x3e2a7d,_0x2e8ef8){return new BPromise(function(_0x4b713a,_0x49dc2b){return client['request'](_0x35c775,_0x2e8ef8)['then'](function(_0x57f09e){logger[_0x1417('0xa')](_0x1417('0xb'),_0x3e2a7d,_0x1417('0xc'));logger[_0x1417('0xd')](_0x1417('0xe'),_0x3e2a7d,_0x1417('0xc'),JSON[_0x1417('0xf')](_0x57f09e));if(_0x57f09e[_0x1417('0x10')]){if(_0x57f09e['error']['code']===0x1f4){logger[_0x1417('0x10')](_0x1417('0xb'),_0x3e2a7d,_0x57f09e[_0x1417('0x10')]['message']);return _0x49dc2b(_0x57f09e[_0x1417('0x10')][_0x1417('0x11')]);}logger[_0x1417('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x3e2a7d,_0x57f09e[_0x1417('0x10')][_0x1417('0x11')]);return _0x4b713a(_0x57f09e[_0x1417('0x10')][_0x1417('0x11')]);}else{logger[_0x1417('0xa')](_0x1417('0xb'),_0x3e2a7d,'request\x20sent');_0x4b713a(_0x57f09e[_0x1417('0x12')][_0x1417('0x11')]);}})['catch'](function(_0x121119){logger[_0x1417('0x10')](_0x1417('0xb'),_0x3e2a7d,_0x121119);_0x49dc2b(_0x121119);});});}exports[_0x1417('0x13')]=function(_0x310730){var _0xbc72ff=this;return new Promise(function(_0x166ff6,_0x48df1a){return db[_0x1417('0x14')]['create'](_0x310730[_0x1417('0x15')],{'raw':_0x310730['options']?_0x310730['options'][_0x1417('0x16')]===undefined?!![]:![]:!![]})[_0x1417('0x17')](function(_0x331ddd){logger[_0x1417('0xa')](_0x1417('0x13'),_0x310730);logger[_0x1417('0xd')](_0x1417('0x13'),_0x310730,JSON[_0x1417('0xf')](_0x331ddd));_0x166ff6(_0x331ddd);})[_0x1417('0x18')](function(_0xa8d41a){logger['error'](_0x1417('0x13'),_0xa8d41a[_0x1417('0x11')],_0x310730);_0x48df1a(_0xbc72ff[_0x1417('0x10')](0x1f4,_0xa8d41a[_0x1417('0x11')]));});});};exports[_0x1417('0x19')]=function(_0x2863ee){var _0x4ddcbb=this;return new Promise(function(_0x5dc94a,_0x50e487){return db[_0x1417('0x14')]['update'](_0x2863ee[_0x1417('0x15')],{'raw':_0x2863ee[_0x1417('0x1a')]?_0x2863ee['options'][_0x1417('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2863ee[_0x1417('0x1a')]?_0x2863ee[_0x1417('0x1a')][_0x1417('0x1b')]||null:null,'attributes':_0x2863ee['options']?_0x2863ee[_0x1417('0x1a')][_0x1417('0x1c')]||null:null,'limit':_0x2863ee[_0x1417('0x1a')]?_0x2863ee[_0x1417('0x1a')][_0x1417('0x1d')]||null:null})[_0x1417('0x17')](function(_0x7f8967){logger[_0x1417('0xa')](_0x1417('0x19'),_0x2863ee);logger[_0x1417('0xd')](_0x1417('0x19'),_0x2863ee,JSON[_0x1417('0xf')](_0x7f8967));_0x5dc94a(_0x7f8967);})['catch'](function(_0x519b0b){logger['error']('UpdateFaxQueueReport',_0x519b0b[_0x1417('0x11')],_0x2863ee);_0x50e487(_0x4ddcbb['error'](0x1f4,_0x519b0b['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index a133f67..2a94c59 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 _0x5ad7=['get','isAuthenticated','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36ec19,_0x193334){var _0x2110fb=function(_0x64f27d){while(--_0x64f27d){_0x36ec19['push'](_0x36ec19['shift']());}};_0x2110fb(++_0x193334);}(_0x5ad7,0x174));var _0x75ad=function(_0x1b221b,_0x932953){_0x1b221b=_0x1b221b-0x0;var _0x42105f=_0x5ad7[_0x1b221b];return _0x42105f;};'use strict';var multer=require(_0x75ad('0x0'));var util=require('util');var path=require(_0x75ad('0x1'));var timeout=require(_0x75ad('0x2'));var express=require(_0x75ad('0x3'));var router=express[_0x75ad('0x4')]();var auth=require(_0x75ad('0x5'));var interaction=require(_0x75ad('0x6'));var config=require(_0x75ad('0x7'));var controller=require('./faxQueueReport.controller');router[_0x75ad('0x8')]('/',auth[_0x75ad('0x9')](),controller['index']);router[_0x75ad('0x8')](_0x75ad('0xa'),auth[_0x75ad('0x9')](),controller[_0x75ad('0xb')]);router[_0x75ad('0x8')](_0x75ad('0xc'),auth['isAuthenticated'](),controller[_0x75ad('0xd')]);router[_0x75ad('0xe')]('/',auth[_0x75ad('0x9')](),controller['create']);router['put'](_0x75ad('0xc'),auth['isAuthenticated'](),controller[_0x75ad('0xf')]);router[_0x75ad('0x10')](_0x75ad('0xc'),auth['isAuthenticated'](),controller[_0x75ad('0x11')]);module[_0x75ad('0x12')]=router; \ No newline at end of file +var _0xf971=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x5611d,_0x3c0409){var _0x469204=function(_0x4f3de2){while(--_0x4f3de2){_0x5611d['push'](_0x5611d['shift']());}};_0x469204(++_0x3c0409);}(_0xf971,0xd1));var _0x1f97=function(_0x72c9c0,_0x13b0cf){_0x72c9c0=_0x72c9c0-0x0;var _0x3be41e=_0xf971[_0x72c9c0];return _0x3be41e;};'use strict';var multer=require(_0x1f97('0x0'));var util=require(_0x1f97('0x1'));var path=require(_0x1f97('0x2'));var timeout=require(_0x1f97('0x3'));var express=require(_0x1f97('0x4'));var router=express[_0x1f97('0x5')]();var auth=require(_0x1f97('0x6'));var interaction=require(_0x1f97('0x7'));var config=require(_0x1f97('0x8'));var controller=require(_0x1f97('0x9'));router[_0x1f97('0xa')]('/',auth[_0x1f97('0xb')](),controller['index']);router[_0x1f97('0xa')](_0x1f97('0xc'),auth[_0x1f97('0xb')](),controller[_0x1f97('0xd')]);router[_0x1f97('0xa')](_0x1f97('0xe'),auth[_0x1f97('0xb')](),controller[_0x1f97('0xf')]);router[_0x1f97('0x10')]('/',auth[_0x1f97('0xb')](),controller[_0x1f97('0x11')]);router[_0x1f97('0x12')](_0x1f97('0xe'),auth['isAuthenticated'](),controller[_0x1f97('0x13')]);router[_0x1f97('0x14')](_0x1f97('0xe'),auth[_0x1f97('0xb')](),controller[_0x1f97('0x15')]);module[_0x1f97('0x16')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index eb6819a..488294e 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 _0xfe41=['moment','exports','STRING','ENUM','account','agent','queue','DATE','NOW'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0xfe41,0xab));var _0x1fe4=function(_0x12c4cd,_0xdebe29){_0x12c4cd=_0x12c4cd-0x0;var _0x18a029=_0xfe41[_0x12c4cd];return _0x18a029;};'use strict';var moment=require(_0x1fe4('0x0'));var Sequelize=require('sequelize');module[_0x1fe4('0x1')]={'uniqueid':{'type':Sequelize[_0x1fe4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1fe4('0x3')](_0x1fe4('0x4'),_0x1fe4('0x5'),_0x1fe4('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x1fe4('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x1fe4('0x8')]}}; \ No newline at end of file +var _0x3584=['queue','DATE','NOW','moment','sequelize','exports','STRING','account'];(function(_0x55aa47,_0x56dfa2){var _0x8f82b2=function(_0x46976c){while(--_0x46976c){_0x55aa47['push'](_0x55aa47['shift']());}};_0x8f82b2(++_0x56dfa2);}(_0x3584,0x14b));var _0x4358=function(_0x3ff240,_0xab8a5a){_0x3ff240=_0x3ff240-0x0;var _0x235aa8=_0x3584[_0x3ff240];return _0x235aa8;};'use strict';var moment=require(_0x4358('0x0'));var Sequelize=require(_0x4358('0x1'));module[_0x4358('0x2')]={'uniqueid':{'type':Sequelize[_0x4358('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4358('0x4'),'agent',_0x4358('0x5')),'allowNull':![],'defaultValue':_0x4358('0x5')},'transferredAt':{'type':Sequelize[_0x4358('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x4358('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 0b4a5b3..215cc77 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 _0xeedf=['query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','merge','type','key','VIRTUAL','field','where','includeAll','rows','catch','show','length','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','send','FaxTransferReport','rawAttributes','keys'];(function(_0x100e4b,_0x13335b){var _0x5c7e62=function(_0x4d7670){while(--_0x4d7670){_0x100e4b['push'](_0x100e4b['shift']());}};_0x5c7e62(++_0x13335b);}(_0xeedf,0x12c));var _0xfeed=function(_0x4a9d9b,_0xd77d9a){_0x4a9d9b=_0x4a9d9b-0x0;var _0x30073b=_0xeedf[_0x4a9d9b];return _0x30073b;};'use strict';var pdf=require(_0xfeed('0x0'));var emlformat=require(_0xfeed('0x1'));var rimraf=require(_0xfeed('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfeed('0x3'));var rp=require('request-promise');var moment=require(_0xfeed('0x4'));var BPromise=require(_0xfeed('0x5'));var Mustache=require(_0xfeed('0x6'));var util=require(_0xfeed('0x7'));var path=require('path');var sox=require(_0xfeed('0x8'));var csv=require(_0xfeed('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfeed('0xa'));var squel=require('squel');var crypto=require(_0xfeed('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfeed('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xfeed('0xd'));var hardwareService=require(_0xfeed('0xe'));var Redis=require(_0xfeed('0xf'));var qs=require(_0xfeed('0x10'));var logger=require('../../config/logger')(_0xfeed('0x11'));var utils=require(_0xfeed('0x12'));var config=require(_0xfeed('0x13'));var db=require(_0xfeed('0x14'))['db'];function respondWithStatusCode(_0x4dce80,_0x55bc45){_0x55bc45=_0x55bc45||0xcc;return function(_0x2705ea){if(_0x2705ea){return _0x4dce80[_0xfeed('0x15')](_0x55bc45);}return _0x4dce80[_0xfeed('0x16')](_0x55bc45)[_0xfeed('0x17')]();};}function respondWithResult(_0x23b516,_0x36a842){_0x36a842=_0x36a842||0xc8;return function(_0x4bfefd){if(_0x4bfefd){return _0x23b516[_0xfeed('0x16')](_0x36a842)[_0xfeed('0x18')](_0x4bfefd);}};}function respondWithFilteredResult(_0x44cc75,_0x2d05d4){return function(_0x1ef929){if(_0x1ef929){var _0x31d5f5=_0x1ef929[_0xfeed('0x19')],_0x376ee2=_0x2d05d4[_0xfeed('0x1a')],_0x3d669f=_0x2d05d4[_0xfeed('0x1a')]+_0x2d05d4[_0xfeed('0x1b')],_0x22ed21;if(_0x3d669f>=_0x31d5f5){_0x3d669f=_0x31d5f5;_0x22ed21=0xc8;}else{_0x22ed21=0xce;}_0x44cc75[_0xfeed('0x16')](_0x22ed21);return _0x44cc75['set'](_0xfeed('0x1c'),_0x376ee2+'-'+_0x3d669f+'/'+_0x31d5f5)[_0xfeed('0x18')](_0x1ef929);}return null;};}function patchUpdates(_0x1acdd7){return function(_0x2aeb65){try{jsonpatch[_0xfeed('0x1d')](_0x2aeb65,_0x1acdd7,!![]);}catch(_0x16ff57){return BPromise[_0xfeed('0x1e')](_0x16ff57);}return _0x2aeb65[_0xfeed('0x1f')]();};}function saveUpdates(_0x44c182,_0x39bb8d){return function(_0x4f8e36){if(_0x4f8e36){return _0x4f8e36[_0xfeed('0x20')](_0x44c182)[_0xfeed('0x21')](function(_0x298969){return _0x298969;});}return null;};}function removeEntity(_0x5da2da,_0x149ebe){return function(_0x331338){if(_0x331338){return _0x331338[_0xfeed('0x22')]()[_0xfeed('0x21')](function(){_0x5da2da[_0xfeed('0x16')](0xcc)[_0xfeed('0x17')]();});}};}function handleEntityNotFound(_0x1ffb14,_0x12fd9c){return function(_0x162dc6){if(!_0x162dc6){_0x1ffb14[_0xfeed('0x15')](0x194);}return _0x162dc6;};}function handleError(_0x7de39a,_0xf1ad9){_0xf1ad9=_0xf1ad9||0x1f4;return function(_0x46957d){logger[_0xfeed('0x23')](_0x46957d['stack']);if(_0x46957d['name']){delete _0x46957d['name'];}_0x7de39a[_0xfeed('0x16')](_0xf1ad9)[_0xfeed('0x24')](_0x46957d);};}exports['index']=function(_0x126b88,_0x26959e){var _0x11625e={},_0x69ebae={},_0x50e114={'count':0x0,'rows':[]};var _0x3be102=db[_0xfeed('0x25')][_0xfeed('0x26')];_0x69ebae['model']=_[_0xfeed('0x27')](_0x3be102);_0x69ebae[_0xfeed('0x28')]=_['keys'](_0x126b88[_0xfeed('0x28')]);_0x69ebae['filters']=_[_0xfeed('0x29')](_0x69ebae[_0xfeed('0x2a')],_0x69ebae[_0xfeed('0x28')]);_0x11625e[_0xfeed('0x2b')]=_[_0xfeed('0x29')](_0x69ebae[_0xfeed('0x2a')],qs[_0xfeed('0x2c')](_0x126b88[_0xfeed('0x28')][_0xfeed('0x2c')]));_0x11625e[_0xfeed('0x2b')]=_0x11625e[_0xfeed('0x2b')]['length']?_0x11625e['attributes']:_0x69ebae[_0xfeed('0x2a')];if(!_0x126b88[_0xfeed('0x28')][_0xfeed('0x2d')](_0xfeed('0x2e'))){_0x11625e[_0xfeed('0x1b')]=qs[_0xfeed('0x1b')](_0x126b88[_0xfeed('0x28')][_0xfeed('0x1b')]);_0x11625e['offset']=qs[_0xfeed('0x1a')](_0x126b88['query'][_0xfeed('0x1a')]);}_0x11625e[_0xfeed('0x2f')]=qs['sort'](_0x126b88[_0xfeed('0x28')][_0xfeed('0x30')]);_0x11625e['where']=qs[_0xfeed('0x31')](_['pick'](_0x126b88[_0xfeed('0x28')],_0x69ebae[_0xfeed('0x31')]));if(_0x126b88[_0xfeed('0x28')][_0xfeed('0x32')]){_0x11625e['where']=_[_0xfeed('0x33')](_0x11625e['where'],{'$or':_['map'](_0x3be102,function(_0x27f558){if(_0x27f558[_0xfeed('0x34')][_0xfeed('0x35')]!==_0xfeed('0x36')){var _0x25db5d={};_0x25db5d[_0x27f558[_0xfeed('0x37')]]={'$like':'%'+_0x126b88[_0xfeed('0x28')][_0xfeed('0x32')]+'%'};return _0x25db5d;}})});}_0x11625e=_[_0xfeed('0x33')]({},_0x11625e,_0x126b88['options']);var _0x2ee6e5={'where':_0x11625e[_0xfeed('0x38')]};return db['FaxTransferReport'][_0xfeed('0x19')](_0x2ee6e5)[_0xfeed('0x21')](function(_0x540055){_0x50e114[_0xfeed('0x19')]=_0x540055;if(_0x126b88[_0xfeed('0x28')][_0xfeed('0x39')]){_0x11625e['include']=[{'all':!![]}];}return db[_0xfeed('0x25')]['findAll'](_0x11625e);})['then'](function(_0x145139){_0x50e114[_0xfeed('0x3a')]=_0x145139;return _0x50e114;})['then'](respondWithFilteredResult(_0x26959e,_0x11625e))[_0xfeed('0x3b')](handleError(_0x26959e,null));};exports[_0xfeed('0x3c')]=function(_0xb85631,_0x10d502){var _0x45add8={'raw':!![],'where':{'id':_0xb85631['params']['id']}},_0x1b569f={};_0x1b569f[_0xfeed('0x2a')]=_[_0xfeed('0x27')](db[_0xfeed('0x25')]['rawAttributes']);_0x1b569f[_0xfeed('0x28')]=_[_0xfeed('0x27')](_0xb85631['query']);_0x1b569f['filters']=_[_0xfeed('0x29')](_0x1b569f['model'],_0x1b569f['query']);_0x45add8[_0xfeed('0x2b')]=_[_0xfeed('0x29')](_0x1b569f[_0xfeed('0x2a')],qs[_0xfeed('0x2c')](_0xb85631[_0xfeed('0x28')]['fields']));_0x45add8['attributes']=_0x45add8[_0xfeed('0x2b')][_0xfeed('0x3d')]?_0x45add8[_0xfeed('0x2b')]:_0x1b569f[_0xfeed('0x2a')];if(_0xb85631['query'][_0xfeed('0x39')]){_0x45add8['include']=[{'all':!![]}];}_0x45add8=_[_0xfeed('0x33')]({},_0x45add8,_0xb85631[_0xfeed('0x3e')]);return db['FaxTransferReport'][_0xfeed('0x3f')](_0x45add8)['then'](handleEntityNotFound(_0x10d502,null))[_0xfeed('0x21')](respondWithResult(_0x10d502,null))[_0xfeed('0x3b')](handleError(_0x10d502,null));};exports[_0xfeed('0x40')]=function(_0x20c516,_0x4dd357){return db[_0xfeed('0x25')][_0xfeed('0x40')](_0x20c516[_0xfeed('0x41')],{})['then'](respondWithResult(_0x4dd357,0xc9))[_0xfeed('0x3b')](handleError(_0x4dd357,null));};exports['update']=function(_0x3ff069,_0x3df3aa){if(_0x3ff069[_0xfeed('0x41')]['id']){delete _0x3ff069[_0xfeed('0x41')]['id'];}return db[_0xfeed('0x25')][_0xfeed('0x3f')]({'where':{'id':_0x3ff069[_0xfeed('0x42')]['id']}})[_0xfeed('0x21')](handleEntityNotFound(_0x3df3aa,null))[_0xfeed('0x21')](saveUpdates(_0x3ff069[_0xfeed('0x41')],null))[_0xfeed('0x21')](respondWithResult(_0x3df3aa,null))[_0xfeed('0x3b')](handleError(_0x3df3aa,null));};exports['destroy']=function(_0x4e6ddf,_0xeb69cc){return db[_0xfeed('0x25')][_0xfeed('0x3f')]({'where':{'id':_0x4e6ddf[_0xfeed('0x42')]['id']}})[_0xfeed('0x21')](handleEntityNotFound(_0xeb69cc,null))['then'](removeEntity(_0xeb69cc,null))[_0xfeed('0x3b')](handleError(_0xeb69cc,null));};exports[_0xfeed('0x43')]=function(_0x348bdf,_0x4b11d7){return db[_0xfeed('0x25')][_0xfeed('0x43')]()[_0xfeed('0x21')](respondWithResult(_0x4b11d7,null))[_0xfeed('0x3b')](handleError(_0x4b11d7,null));}; \ No newline at end of file +var _0xe107=['apply','reject','save','update','then','sendStatus','error','stack','name','index','FaxTransferReport','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','map','key','VIRTUAL','field','count','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','lodash','squel','crypto','jsforce','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','end','json','offset','limit','Content-Range'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xe107,0xb3));var _0x7e10=function(_0x269735,_0x783cac){_0x269735=_0x269735-0x0;var _0x30f336=_0xe107[_0x269735];return _0x30f336;};'use strict';var pdf=require(_0x7e10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7e10('0x1'));var zipdir=require(_0x7e10('0x2'));var jsonpatch=require(_0x7e10('0x3'));var rp=require('request-promise');var moment=require(_0x7e10('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7e10('0x5'));var path=require(_0x7e10('0x6'));var sox=require(_0x7e10('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7e10('0x8'));var squel=require(_0x7e10('0x9'));var crypto=require(_0x7e10('0xa'));var jsforce=require(_0x7e10('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7e10('0xc'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x7e10('0xd'));var Redis=require(_0x7e10('0xe'));var qs=require(_0x7e10('0xf'));var logger=require(_0x7e10('0x10'))(_0x7e10('0x11'));var utils=require('../../config/utils');var config=require(_0x7e10('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38e013,_0x2ca84c){_0x2ca84c=_0x2ca84c||0xcc;return function(_0x2f4d72){if(_0x2f4d72){return _0x38e013['sendStatus'](_0x2ca84c);}return _0x38e013[_0x7e10('0x13')](_0x2ca84c)[_0x7e10('0x14')]();};}function respondWithResult(_0x1e07af,_0x3ec8d9){_0x3ec8d9=_0x3ec8d9||0xc8;return function(_0x119ff5){if(_0x119ff5){return _0x1e07af[_0x7e10('0x13')](_0x3ec8d9)[_0x7e10('0x15')](_0x119ff5);}};}function respondWithFilteredResult(_0x1a8b29,_0x5e41b7){return function(_0x15e9e5){if(_0x15e9e5){var _0x433221=_0x15e9e5['count'],_0x4bd78a=_0x5e41b7[_0x7e10('0x16')],_0x48339f=_0x5e41b7[_0x7e10('0x16')]+_0x5e41b7[_0x7e10('0x17')],_0x4f5666;if(_0x48339f>=_0x433221){_0x48339f=_0x433221;_0x4f5666=0xc8;}else{_0x4f5666=0xce;}_0x1a8b29[_0x7e10('0x13')](_0x4f5666);return _0x1a8b29['set'](_0x7e10('0x18'),_0x4bd78a+'-'+_0x48339f+'/'+_0x433221)[_0x7e10('0x15')](_0x15e9e5);}return null;};}function patchUpdates(_0x2bca7b){return function(_0x5d9da3){try{jsonpatch[_0x7e10('0x19')](_0x5d9da3,_0x2bca7b,!![]);}catch(_0x36149a){return BPromise[_0x7e10('0x1a')](_0x36149a);}return _0x5d9da3[_0x7e10('0x1b')]();};}function saveUpdates(_0xd742e4,_0x580ac7){return function(_0x45a0cb){if(_0x45a0cb){return _0x45a0cb[_0x7e10('0x1c')](_0xd742e4)['then'](function(_0x3c5629){return _0x3c5629;});}return null;};}function removeEntity(_0x39daf6,_0x29405c){return function(_0x482faa){if(_0x482faa){return _0x482faa['destroy']()[_0x7e10('0x1d')](function(){_0x39daf6[_0x7e10('0x13')](0xcc)[_0x7e10('0x14')]();});}};}function handleEntityNotFound(_0x1c72df,_0x35e7c9){return function(_0x105a55){if(!_0x105a55){_0x1c72df[_0x7e10('0x1e')](0x194);}return _0x105a55;};}function handleError(_0x2c93ba,_0x5d7586){_0x5d7586=_0x5d7586||0x1f4;return function(_0x4ad422){logger[_0x7e10('0x1f')](_0x4ad422[_0x7e10('0x20')]);if(_0x4ad422[_0x7e10('0x21')]){delete _0x4ad422[_0x7e10('0x21')];}_0x2c93ba['status'](_0x5d7586)['send'](_0x4ad422);};}exports[_0x7e10('0x22')]=function(_0x12ba1b,_0x31bbf2){var _0x13c7d4={},_0x10f93d={},_0xfd3e87={'count':0x0,'rows':[]};var _0x330103=db[_0x7e10('0x23')][_0x7e10('0x24')];_0x10f93d[_0x7e10('0x25')]=_[_0x7e10('0x26')](_0x330103);_0x10f93d['query']=_[_0x7e10('0x26')](_0x12ba1b[_0x7e10('0x27')]);_0x10f93d['filters']=_['intersection'](_0x10f93d[_0x7e10('0x25')],_0x10f93d[_0x7e10('0x27')]);_0x13c7d4['attributes']=_[_0x7e10('0x28')](_0x10f93d['model'],qs[_0x7e10('0x29')](_0x12ba1b[_0x7e10('0x27')][_0x7e10('0x29')]));_0x13c7d4[_0x7e10('0x2a')]=_0x13c7d4[_0x7e10('0x2a')][_0x7e10('0x2b')]?_0x13c7d4['attributes']:_0x10f93d[_0x7e10('0x25')];if(!_0x12ba1b['query'][_0x7e10('0x2c')](_0x7e10('0x2d'))){_0x13c7d4[_0x7e10('0x17')]=qs[_0x7e10('0x17')](_0x12ba1b[_0x7e10('0x27')][_0x7e10('0x17')]);_0x13c7d4[_0x7e10('0x16')]=qs[_0x7e10('0x16')](_0x12ba1b[_0x7e10('0x27')]['offset']);}_0x13c7d4[_0x7e10('0x2e')]=qs[_0x7e10('0x2f')](_0x12ba1b[_0x7e10('0x27')][_0x7e10('0x2f')]);_0x13c7d4[_0x7e10('0x30')]=qs['filters'](_[_0x7e10('0x31')](_0x12ba1b[_0x7e10('0x27')],_0x10f93d[_0x7e10('0x32')]));if(_0x12ba1b[_0x7e10('0x27')]['filter']){_0x13c7d4['where']=_[_0x7e10('0x33')](_0x13c7d4[_0x7e10('0x30')],{'$or':_[_0x7e10('0x34')](_0x330103,function(_0x165b95){if(_0x165b95['type'][_0x7e10('0x35')]!==_0x7e10('0x36')){var _0x5b65e5={};_0x5b65e5[_0x165b95[_0x7e10('0x37')]]={'$like':'%'+_0x12ba1b[_0x7e10('0x27')]['filter']+'%'};return _0x5b65e5;}})});}_0x13c7d4=_['merge']({},_0x13c7d4,_0x12ba1b['options']);var _0x2ab00b={'where':_0x13c7d4[_0x7e10('0x30')]};return db[_0x7e10('0x23')][_0x7e10('0x38')](_0x2ab00b)[_0x7e10('0x1d')](function(_0x36e415){_0xfd3e87[_0x7e10('0x38')]=_0x36e415;if(_0x12ba1b[_0x7e10('0x27')]['includeAll']){_0x13c7d4[_0x7e10('0x39')]=[{'all':!![]}];}return db[_0x7e10('0x23')][_0x7e10('0x3a')](_0x13c7d4);})[_0x7e10('0x1d')](function(_0x4ebf4a){_0xfd3e87[_0x7e10('0x3b')]=_0x4ebf4a;return _0xfd3e87;})[_0x7e10('0x1d')](respondWithFilteredResult(_0x31bbf2,_0x13c7d4))[_0x7e10('0x3c')](handleError(_0x31bbf2,null));};exports[_0x7e10('0x3d')]=function(_0x3ad2f0,_0x4013f8){var _0x109e9f={'raw':!![],'where':{'id':_0x3ad2f0[_0x7e10('0x3e')]['id']}},_0x58d4ca={};_0x58d4ca[_0x7e10('0x25')]=_['keys'](db[_0x7e10('0x23')][_0x7e10('0x24')]);_0x58d4ca[_0x7e10('0x27')]=_['keys'](_0x3ad2f0[_0x7e10('0x27')]);_0x58d4ca[_0x7e10('0x32')]=_[_0x7e10('0x28')](_0x58d4ca[_0x7e10('0x25')],_0x58d4ca[_0x7e10('0x27')]);_0x109e9f['attributes']=_[_0x7e10('0x28')](_0x58d4ca[_0x7e10('0x25')],qs[_0x7e10('0x29')](_0x3ad2f0[_0x7e10('0x27')][_0x7e10('0x29')]));_0x109e9f['attributes']=_0x109e9f[_0x7e10('0x2a')][_0x7e10('0x2b')]?_0x109e9f['attributes']:_0x58d4ca['model'];if(_0x3ad2f0[_0x7e10('0x27')][_0x7e10('0x3f')]){_0x109e9f['include']=[{'all':!![]}];}_0x109e9f=_[_0x7e10('0x33')]({},_0x109e9f,_0x3ad2f0['options']);return db[_0x7e10('0x23')]['find'](_0x109e9f)[_0x7e10('0x1d')](handleEntityNotFound(_0x4013f8,null))[_0x7e10('0x1d')](respondWithResult(_0x4013f8,null))['catch'](handleError(_0x4013f8,null));};exports['create']=function(_0x559d60,_0x5a6181){return db['FaxTransferReport'][_0x7e10('0x40')](_0x559d60[_0x7e10('0x41')],{})[_0x7e10('0x1d')](respondWithResult(_0x5a6181,0xc9))[_0x7e10('0x3c')](handleError(_0x5a6181,null));};exports[_0x7e10('0x1c')]=function(_0x49d773,_0x7d6206){if(_0x49d773['body']['id']){delete _0x49d773[_0x7e10('0x41')]['id'];}return db[_0x7e10('0x23')][_0x7e10('0x42')]({'where':{'id':_0x49d773[_0x7e10('0x3e')]['id']}})['then'](handleEntityNotFound(_0x7d6206,null))['then'](saveUpdates(_0x49d773[_0x7e10('0x41')],null))[_0x7e10('0x1d')](respondWithResult(_0x7d6206,null))['catch'](handleError(_0x7d6206,null));};exports['destroy']=function(_0x2ceaec,_0x3f0a05){return db[_0x7e10('0x23')][_0x7e10('0x42')]({'where':{'id':_0x2ceaec[_0x7e10('0x3e')]['id']}})[_0x7e10('0x1d')](handleEntityNotFound(_0x3f0a05,null))[_0x7e10('0x1d')](removeEntity(_0x3f0a05,null))[_0x7e10('0x3c')](handleError(_0x3f0a05,null));};exports['describe']=function(_0x3a72ad,_0x517862){return db[_0x7e10('0x23')][_0x7e10('0x43')]()[_0x7e10('0x1d')](respondWithResult(_0x517862,null))['catch'](handleError(_0x517862,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 04890b8..0ee986e 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 _0x1805=['util','../../config/logger','api','moment','request-promise','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x5ccb1d,_0x5d130a){var _0x23e3eb=function(_0x35a734){while(--_0x35a734){_0x5ccb1d['push'](_0x5ccb1d['shift']());}};_0x23e3eb(++_0x5d130a);}(_0x1805,0x98));var _0x5180=function(_0x720ff,_0x16919c){_0x720ff=_0x720ff-0x0;var _0x1888a7=_0x1805[_0x720ff];return _0x1888a7;};'use strict';var _=require('lodash');var util=require(_0x5180('0x0'));var logger=require(_0x5180('0x1'))(_0x5180('0x2'));var moment=require(_0x5180('0x3'));var BPromise=require('bluebird');var rp=require(_0x5180('0x4'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x575930,_0x1513ce){return _0x575930['define'](_0x5180('0x5'),attributes,{'tableName':_0x5180('0x6'),'paranoid':![],'indexes':[{'name':_0x5180('0x7'),'fields':[_0x5180('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc5a0=['moment','bluebird','request-promise','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x3d0678,_0x10e9ae){var _0x7f9a43=function(_0x85d80f){while(--_0x85d80f){_0x3d0678['push'](_0x3d0678['shift']());}};_0x7f9a43(++_0x10e9ae);}(_0xc5a0,0xf8));var _0x0c5a=function(_0xaa72b3,_0xbd6780){_0xaa72b3=_0xaa72b3-0x0;var _0x3f7bf3=_0xc5a0[_0xaa72b3];return _0x3f7bf3;};'use strict';var _=require(_0x0c5a('0x0'));var util=require(_0x0c5a('0x1'));var logger=require(_0x0c5a('0x2'))(_0x0c5a('0x3'));var moment=require(_0x0c5a('0x4'));var BPromise=require(_0x0c5a('0x5'));var rp=require(_0x0c5a('0x6'));var attributes=require(_0x0c5a('0x7'));module[_0x0c5a('0x8')]=function(_0x412c88,_0x1e6146){return _0x412c88[_0x0c5a('0x9')]('FaxTransferReport',attributes,{'tableName':_0x0c5a('0xa'),'paranoid':![],'indexes':[{'name':_0x0c5a('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index bded027..50913dd 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 _0x6ca9=['bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x38b0bd,_0x4519a2){var _0xa6e47e=function(_0x10a4c3){while(--_0x10a4c3){_0x38b0bd['push'](_0x38b0bd['shift']());}};_0xa6e47e(++_0x4519a2);}(_0x6ca9,0x81));var _0x96ca=function(_0x12c008,_0x818a6a){_0x12c008=_0x12c008-0x0;var _0x5501f7=_0x6ca9[_0x12c008];return _0x5501f7;};'use strict';var _=require(_0x96ca('0x0'));var util=require(_0x96ca('0x1'));var moment=require(_0x96ca('0x2'));var BPromise=require(_0x96ca('0x3'));var rs=require(_0x96ca('0x4'));var fs=require('fs');var Redis=require(_0x96ca('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x96ca('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x96ca('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x96ca('0x8')][_0x96ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bca50,_0x452618,_0x269ccf){return new BPromise(function(_0x2b7b94,_0x394e04){return client[_0x96ca('0xa')](_0x3bca50,_0x269ccf)[_0x96ca('0xb')](function(_0x3ee3bc){logger[_0x96ca('0xc')](_0x96ca('0xd'),_0x452618,_0x96ca('0xe'));logger['debug'](_0x96ca('0xf'),_0x452618,_0x96ca('0xe'),JSON[_0x96ca('0x10')](_0x3ee3bc));if(_0x3ee3bc[_0x96ca('0x11')]){if(_0x3ee3bc[_0x96ca('0x11')][_0x96ca('0x12')]===0x1f4){logger[_0x96ca('0x11')](_0x96ca('0xd'),_0x452618,_0x3ee3bc[_0x96ca('0x11')][_0x96ca('0x13')]);return _0x394e04(_0x3ee3bc[_0x96ca('0x11')][_0x96ca('0x13')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x452618,_0x3ee3bc[_0x96ca('0x11')]['message']);return _0x2b7b94(_0x3ee3bc[_0x96ca('0x11')][_0x96ca('0x13')]);}else{logger['info'](_0x96ca('0xd'),_0x452618,_0x96ca('0xe'));_0x2b7b94(_0x3ee3bc[_0x96ca('0x14')][_0x96ca('0x13')]);}})[_0x96ca('0x15')](function(_0x50690a){logger[_0x96ca('0x11')](_0x96ca('0xd'),_0x452618,_0x50690a);_0x394e04(_0x50690a);});});} \ No newline at end of file +var _0xa7ef=['result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x284e4a,_0x1e5013){var _0x9bf3d=function(_0x56d48a){while(--_0x56d48a){_0x284e4a['push'](_0x284e4a['shift']());}};_0x9bf3d(++_0x1e5013);}(_0xa7ef,0x1a3));var _0xfa7e=function(_0x109e42,_0x549e64){_0x109e42=_0x109e42-0x0;var _0x51cb71=_0xa7ef[_0x109e42];return _0x51cb71;};'use strict';var _=require(_0xfa7e('0x0'));var util=require(_0xfa7e('0x1'));var moment=require(_0xfa7e('0x2'));var BPromise=require(_0xfa7e('0x3'));var rs=require(_0xfa7e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa7e('0x5'))['db'];var utils=require(_0xfa7e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfa7e('0x7'));var jayson=require(_0xfa7e('0x8'));var client=jayson[_0xfa7e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ebe22,_0x585898,_0x2916a6){return new BPromise(function(_0x41ff8a,_0x37b93e){return client[_0xfa7e('0xa')](_0x5ebe22,_0x2916a6)[_0xfa7e('0xb')](function(_0xdb0b9){logger[_0xfa7e('0xc')](_0xfa7e('0xd'),_0x585898,_0xfa7e('0xe'));logger[_0xfa7e('0xf')](_0xfa7e('0x10'),_0x585898,_0xfa7e('0xe'),JSON[_0xfa7e('0x11')](_0xdb0b9));if(_0xdb0b9[_0xfa7e('0x12')]){if(_0xdb0b9[_0xfa7e('0x12')][_0xfa7e('0x13')]===0x1f4){logger[_0xfa7e('0x12')](_0xfa7e('0xd'),_0x585898,_0xdb0b9[_0xfa7e('0x12')][_0xfa7e('0x14')]);return _0x37b93e(_0xdb0b9[_0xfa7e('0x12')][_0xfa7e('0x14')]);}logger[_0xfa7e('0x12')](_0xfa7e('0xd'),_0x585898,_0xdb0b9[_0xfa7e('0x12')][_0xfa7e('0x14')]);return _0x41ff8a(_0xdb0b9['error'][_0xfa7e('0x14')]);}else{logger[_0xfa7e('0xc')](_0xfa7e('0xd'),_0x585898,'request\x20sent');_0x41ff8a(_0xdb0b9[_0xfa7e('0x15')][_0xfa7e('0x14')]);}})['catch'](function(_0x49528f){logger['error'](_0xfa7e('0xd'),_0x585898,_0x49528f);_0x37b93e(_0x49528f);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index f3ea0ca..e19d639 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 _0xed1f=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xed1f,0x6a));var _0xfed1=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xed1f[_0x29d94e];return _0x106237;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var auth=require(_0xfed1('0x6'));var interaction=require(_0xfed1('0x7'));var config=require(_0xfed1('0x8'));var controller=require(_0xfed1('0x9'));router[_0xfed1('0xa')]('/',auth[_0xfed1('0xb')](),controller[_0xfed1('0xc')]);router[_0xfed1('0xa')](_0xfed1('0xd'),auth[_0xfed1('0xb')](),controller[_0xfed1('0xe')]);router[_0xfed1('0xa')]('/:id',auth[_0xfed1('0xb')](),controller[_0xfed1('0xf')]);router['post']('/',auth[_0xfed1('0xb')](),controller[_0xfed1('0x10')]);router['put'](_0xfed1('0x11'),auth['isAuthenticated'](),controller[_0xfed1('0x12')]);router[_0xfed1('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xfed1('0x14')]);module[_0xfed1('0x15')]=router; \ No newline at end of file +var _0xac31=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put'];(function(_0x4dec73,_0x2f870c){var _0x493071=function(_0x1e1940){while(--_0x1e1940){_0x4dec73['push'](_0x4dec73['shift']());}};_0x493071(++_0x2f870c);}(_0xac31,0xca));var _0x1ac3=function(_0x3835fc,_0x3f1a33){_0x3835fc=_0x3835fc-0x0;var _0x48aa73=_0xac31[_0x3835fc];return _0x48aa73;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var auth=require(_0x1ac3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1ac3('0x7'));var controller=require(_0x1ac3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ac3('0x9')]);router[_0x1ac3('0xa')](_0x1ac3('0xb'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0xd')]);router['get'](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0x10')]('/',auth[_0x1ac3('0xc')](),controller['create']);router[_0x1ac3('0x11')](_0x1ac3('0xe'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0x12')]);router[_0x1ac3('0x13')](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0x14')]);module[_0x1ac3('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index dd330a7..294f79f 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 _0x0924=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','show'];(function(_0x3fd0fc,_0x3bfe41){var _0x4f19a8=function(_0xae566c){while(--_0xae566c){_0x3fd0fc['push'](_0x3fd0fc['shift']());}};_0x4f19a8(++_0x3bfe41);}(_0x0924,0x127));var _0x4092=function(_0x3a83c8,_0x489ffd){_0x3a83c8=_0x3a83c8-0x0;var _0x5c89db=_0x0924[_0x3a83c8];return _0x5c89db;};'use strict';var multer=require(_0x4092('0x0'));var util=require(_0x4092('0x1'));var path=require(_0x4092('0x2'));var timeout=require(_0x4092('0x3'));var express=require(_0x4092('0x4'));var router=express[_0x4092('0x5')]();var auth=require(_0x4092('0x6'));var interaction=require(_0x4092('0x7'));var config=require(_0x4092('0x8'));var controller=require(_0x4092('0x9'));router[_0x4092('0xa')]('/',auth[_0x4092('0xb')](),controller['index']);router[_0x4092('0xa')]('/:id',auth[_0x4092('0xb')](),controller[_0x4092('0xc')]);router['get'](_0x4092('0xd'),auth[_0x4092('0xb')](),controller[_0x4092('0xe')]);router[_0x4092('0xa')](_0x4092('0xf'),auth['isAuthenticated'](),controller[_0x4092('0x10')]);router[_0x4092('0x11')]('/',auth[_0x4092('0xb')](),controller['create']);router[_0x4092('0x11')](_0x4092('0xd'),auth[_0x4092('0xb')](),controller[_0x4092('0x12')]);router[_0x4092('0x13')](_0x4092('0x14'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x4092('0x14'),auth[_0x4092('0xb')](),controller[_0x4092('0x15')]);module['exports']=router; \ No newline at end of file +var _0xd144=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','get','show','getConfigurations','getFields','post','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy'];(function(_0x5a6a1c,_0xb802eb){var _0x132a0e=function(_0x4c3280){while(--_0x4c3280){_0x5a6a1c['push'](_0x5a6a1c['shift']());}};_0x132a0e(++_0xb802eb);}(_0xd144,0xb9));var _0x4d14=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd144[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4d14('0x0'));var util=require(_0x4d14('0x1'));var path=require(_0x4d14('0x2'));var timeout=require('connect-timeout');var express=require(_0x4d14('0x3'));var router=express[_0x4d14('0x4')]();var auth=require(_0x4d14('0x5'));var interaction=require(_0x4d14('0x6'));var config=require(_0x4d14('0x7'));var controller=require(_0x4d14('0x8'));router['get']('/',auth[_0x4d14('0x9')](),controller['index']);router[_0x4d14('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4d14('0xb')]);router[_0x4d14('0xa')]('/:id/configurations',auth[_0x4d14('0x9')](),controller[_0x4d14('0xc')]);router[_0x4d14('0xa')]('/:id/fields',auth[_0x4d14('0x9')](),controller[_0x4d14('0xd')]);router[_0x4d14('0xe')]('/',auth[_0x4d14('0x9')](),controller['create']);router[_0x4d14('0xe')](_0x4d14('0xf'),auth[_0x4d14('0x9')](),controller[_0x4d14('0x10')]);router[_0x4d14('0x11')](_0x4d14('0x12'),auth['isAuthenticated'](),controller[_0x4d14('0x13')]);router[_0x4d14('0x14')](_0x4d14('0x12'),auth[_0x4d14('0x9')](),controller[_0x4d14('0x15')]);module[_0x4d14('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 1d3e698..1b2557f 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 _0x49a9=['STRING','basic','ENUM','integrationTab','sequelize'];(function(_0x2dd3c6,_0x1dbb14){var _0x3e8dac=function(_0x2ec355){while(--_0x2ec355){_0x2dd3c6['push'](_0x2dd3c6['shift']());}};_0x3e8dac(++_0x1dbb14);}(_0x49a9,0x153));var _0x949a=function(_0xd30b00,_0x168daa){_0xd30b00=_0xd30b00-0x0;var _0x1dc8fa=_0x49a9[_0xd30b00];return _0x1dc8fa;};'use strict';var Sequelize=require(_0x949a('0x0'));module['exports']={'name':{'type':Sequelize[_0x949a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x949a('0x1')]},'remoteUri':{'type':Sequelize[_0x949a('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x949a('0x2')),'defaultValue':_0x949a('0x2')},'password':{'type':Sequelize[_0x949a('0x1')]},'consumerKey':{'type':Sequelize[_0x949a('0x1')]},'consumerSecret':{'type':Sequelize[_0x949a('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x949a('0x1')]},'type':{'type':Sequelize[_0x949a('0x3')]('integrationTab','newTab'),'defaultValue':_0x949a('0x4')}}; \ No newline at end of file +var _0x7c9b=['newTab','integrationTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x5c0b8b,_0x23d1e4){var _0x5cde35=function(_0x35e32d){while(--_0x35e32d){_0x5c0b8b['push'](_0x5c0b8b['shift']());}};_0x5cde35(++_0x23d1e4);}(_0x7c9b,0x191));var _0xb7c9=function(_0x31d0a5,_0x316250){_0x31d0a5=_0x31d0a5-0x0;var _0x3f672a=_0x7c9b[_0x31d0a5];return _0x3f672a;};'use strict';var Sequelize=require(_0xb7c9('0x0'));module[_0xb7c9('0x1')]={'name':{'type':Sequelize[_0xb7c9('0x2')]},'description':{'type':Sequelize[_0xb7c9('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb7c9('0x2')]},'authType':{'type':Sequelize[_0xb7c9('0x3')](_0xb7c9('0x4')),'defaultValue':_0xb7c9('0x4')},'password':{'type':Sequelize[_0xb7c9('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xb7c9('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb7c9('0x3')]('integrationTab',_0xb7c9('0x5')),'defaultValue':_0xb7c9('0x6')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 598e32d..53cb4dd 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 _0x7217=['body','params','getConfigurations','DeskConfiguration','pick','addConfiguration','findOne','Subjects','getSubjects','channel','type','getDescriptions','DeskField','Descriptions','getFields','priority','remoteUri','username','password','consumerKey','token','tokenSecret','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','then','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','DeskAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','update','destroy','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','map','key','VIRTUAL','field','merge','DeskAccount','count','includeAll','include','rows','length','options','find','create'];(function(_0xfa0b34,_0x498e7f){var _0x73f784=function(_0x26975a){while(--_0x26975a){_0xfa0b34['push'](_0xfa0b34['shift']());}};_0x73f784(++_0x498e7f);}(_0x7217,0x19e));var _0x7721=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x7217[_0x387777];return _0x3f84c0;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var authService=require(_0x7721('0x12'));var hardwareService=require(_0x7721('0x13'));var Redis=require('ioredis');var qs=require(_0x7721('0x14'));var logger=require(_0x7721('0x15'))(_0x7721('0x16'));var utils=require(_0x7721('0x17'));var config=require(_0x7721('0x18'));var db=require(_0x7721('0x19'))['db'];var integrations=require(_0x7721('0x1a'));var jayson=require(_0x7721('0x1b'));var client=jayson['client'][_0x7721('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x199930,_0x57ff6d,_0x109900,_0x30da54){return new BPromise(function(_0x3f01c5,_0x2e9752){var _0x5069da=_0x30da54||client;return _0x5069da[_0x7721('0x1d')](_0x199930,_0x109900)[_0x7721('0x1e')](function(_0x534f1b){logger['info']('DeskAccount,\x20%s,\x20%s',_0x57ff6d,_0x7721('0x1f'));logger[_0x7721('0x20')](_0x7721('0x21'),_0x57ff6d,_0x7721('0x1f'),JSON['stringify'](_0x534f1b));if(_0x534f1b[_0x7721('0x22')]){if(_0x534f1b['error'][_0x7721('0x23')]===0x1f4){logger['error'](_0x7721('0x24'),_0x57ff6d,_0x534f1b[_0x7721('0x22')][_0x7721('0x25')]);return _0x2e9752(_0x534f1b[_0x7721('0x22')][_0x7721('0x25')]);}logger[_0x7721('0x22')](_0x7721('0x24'),_0x57ff6d,_0x534f1b[_0x7721('0x22')][_0x7721('0x25')]);return _0x3f01c5(_0x534f1b[_0x7721('0x22')]['message']);}else{logger[_0x7721('0x26')](_0x7721('0x24'),_0x57ff6d,_0x7721('0x1f'));_0x3f01c5(_0x534f1b[_0x7721('0x27')]['message']);}})[_0x7721('0x28')](function(_0x512f31){logger[_0x7721('0x22')](_0x7721('0x24'),_0x57ff6d,_0x512f31);_0x2e9752(_0x512f31);});});}function respondWithStatusCode(_0x3e8a4e,_0x1caad8){_0x1caad8=_0x1caad8||0xcc;return function(_0x121cc4){if(_0x121cc4){return _0x3e8a4e[_0x7721('0x29')](_0x1caad8);}return _0x3e8a4e[_0x7721('0x2a')](_0x1caad8)['end']();};}function respondWithResult(_0x216f20,_0x1abedb){_0x1abedb=_0x1abedb||0xc8;return function(_0x125564){if(_0x125564){return _0x216f20[_0x7721('0x2a')](_0x1abedb)[_0x7721('0x2b')](_0x125564);}};}function respondWithFilteredResult(_0x16355a,_0x424e05){return function(_0xf753f1){if(_0xf753f1){var _0x40f367=_0xf753f1['count'],_0x52316e=_0x424e05[_0x7721('0x2c')],_0x258ddf=_0x424e05[_0x7721('0x2c')]+_0x424e05[_0x7721('0x2d')],_0x5b0551;if(_0x258ddf>=_0x40f367){_0x258ddf=_0x40f367;_0x5b0551=0xc8;}else{_0x5b0551=0xce;}_0x16355a[_0x7721('0x2a')](_0x5b0551);return _0x16355a[_0x7721('0x2e')](_0x7721('0x2f'),_0x52316e+'-'+_0x258ddf+'/'+_0x40f367)[_0x7721('0x2b')](_0xf753f1);}return null;};}function patchUpdates(_0x1da2d8){return function(_0x5c54f0){try{jsonpatch[_0x7721('0x30')](_0x5c54f0,_0x1da2d8,!![]);}catch(_0x2871c5){return BPromise['reject'](_0x2871c5);}return _0x5c54f0['save']();};}function saveUpdates(_0xfde9ec,_0x220bbf){return function(_0x48f329){if(_0x48f329){return _0x48f329[_0x7721('0x31')](_0xfde9ec)[_0x7721('0x1e')](function(_0x382821){return _0x382821;});}return null;};}function removeEntity(_0x58d54b,_0x3d9a32){return function(_0x1ff31b){if(_0x1ff31b){return _0x1ff31b[_0x7721('0x32')]()[_0x7721('0x1e')](function(){_0x58d54b[_0x7721('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x195ffb,_0x3e4e56){return function(_0xb2386d){if(!_0xb2386d){_0x195ffb['sendStatus'](0x194);}return _0xb2386d;};}function handleError(_0x35de7a,_0x213a2e){_0x213a2e=_0x213a2e||0x1f4;return function(_0x498654){logger[_0x7721('0x22')](_0x498654['stack']);if(_0x498654[_0x7721('0x33')]){delete _0x498654[_0x7721('0x33')];}_0x35de7a[_0x7721('0x2a')](_0x213a2e)[_0x7721('0x34')](_0x498654);};}exports[_0x7721('0x35')]=function(_0x13c635,_0x2f1fe0){var _0x15545a={},_0x25bdd9={},_0x3a2eb7={'count':0x0,'rows':[]};var _0x385454=db['DeskAccount'][_0x7721('0x36')];_0x25bdd9['model']=_[_0x7721('0x37')](_0x385454);_0x25bdd9[_0x7721('0x38')]=_[_0x7721('0x37')](_0x13c635[_0x7721('0x38')]);_0x25bdd9[_0x7721('0x39')]=_[_0x7721('0x3a')](_0x25bdd9['model'],_0x25bdd9['query']);_0x15545a['attributes']=_['intersection'](_0x25bdd9[_0x7721('0x3b')],qs[_0x7721('0x3c')](_0x13c635[_0x7721('0x38')][_0x7721('0x3c')]));_0x15545a['attributes']=_0x15545a[_0x7721('0x3d')]['length']?_0x15545a[_0x7721('0x3d')]:_0x25bdd9[_0x7721('0x3b')];if(!_0x13c635['query'][_0x7721('0x3e')](_0x7721('0x3f'))){_0x15545a['limit']=qs['limit'](_0x13c635[_0x7721('0x38')][_0x7721('0x2d')]);_0x15545a[_0x7721('0x2c')]=qs[_0x7721('0x2c')](_0x13c635['query'][_0x7721('0x2c')]);}_0x15545a[_0x7721('0x40')]=qs[_0x7721('0x41')](_0x13c635[_0x7721('0x38')][_0x7721('0x41')]);_0x15545a['where']=qs[_0x7721('0x39')](_['pick'](_0x13c635[_0x7721('0x38')],_0x25bdd9['filters']));if(_0x13c635[_0x7721('0x38')][_0x7721('0x42')]){_0x15545a[_0x7721('0x43')]=_['merge'](_0x15545a[_0x7721('0x43')],{'$or':_[_0x7721('0x44')](_0x385454,function(_0x1ad315){if(_0x1ad315['type'][_0x7721('0x45')]!==_0x7721('0x46')){var _0xdb3033={};_0xdb3033[_0x1ad315[_0x7721('0x47')]]={'$like':'%'+_0x13c635[_0x7721('0x38')][_0x7721('0x42')]+'%'};return _0xdb3033;}})});}_0x15545a=_[_0x7721('0x48')]({},_0x15545a,_0x13c635['options']);var _0x479698={'where':_0x15545a[_0x7721('0x43')]};return db[_0x7721('0x49')][_0x7721('0x4a')](_0x479698)[_0x7721('0x1e')](function(_0x335145){_0x3a2eb7[_0x7721('0x4a')]=_0x335145;if(_0x13c635[_0x7721('0x38')][_0x7721('0x4b')]){_0x15545a[_0x7721('0x4c')]=[{'all':!![]}];}return db[_0x7721('0x49')]['findAll'](_0x15545a);})['then'](function(_0x5ed70d){_0x3a2eb7[_0x7721('0x4d')]=_0x5ed70d;return _0x3a2eb7;})[_0x7721('0x1e')](respondWithFilteredResult(_0x2f1fe0,_0x15545a))[_0x7721('0x28')](handleError(_0x2f1fe0,null));};exports['show']=function(_0x30107e,_0x2d5a88){var _0x56c3d9={'raw':![],'where':{'id':_0x30107e['params']['id']}},_0x330fac={};_0x330fac[_0x7721('0x3b')]=_['keys'](db[_0x7721('0x49')][_0x7721('0x36')]);_0x330fac[_0x7721('0x38')]=_['keys'](_0x30107e[_0x7721('0x38')]);_0x330fac[_0x7721('0x39')]=_['intersection'](_0x330fac[_0x7721('0x3b')],_0x330fac[_0x7721('0x38')]);_0x56c3d9[_0x7721('0x3d')]=_['intersection'](_0x330fac[_0x7721('0x3b')],qs['fields'](_0x30107e[_0x7721('0x38')][_0x7721('0x3c')]));_0x56c3d9[_0x7721('0x3d')]=_0x56c3d9[_0x7721('0x3d')][_0x7721('0x4e')]?_0x56c3d9[_0x7721('0x3d')]:_0x330fac[_0x7721('0x3b')];if(_0x30107e[_0x7721('0x38')][_0x7721('0x4b')]){_0x56c3d9[_0x7721('0x4c')]=[{'all':!![]}];}_0x56c3d9=_[_0x7721('0x48')]({},_0x56c3d9,_0x30107e[_0x7721('0x4f')]);return db[_0x7721('0x49')][_0x7721('0x50')](_0x56c3d9)[_0x7721('0x1e')](handleEntityNotFound(_0x2d5a88,null))['then'](respondWithResult(_0x2d5a88,null))[_0x7721('0x28')](handleError(_0x2d5a88,null));};exports[_0x7721('0x51')]=function(_0x8e1214,_0x2c1119){return db[_0x7721('0x49')][_0x7721('0x51')](_0x8e1214[_0x7721('0x52')],{})['then'](respondWithResult(_0x2c1119,0xc9))[_0x7721('0x28')](handleError(_0x2c1119,null));};exports[_0x7721('0x31')]=function(_0x134908,_0x3b7382){if(_0x134908[_0x7721('0x52')]['id']){delete _0x134908[_0x7721('0x52')]['id'];}return db[_0x7721('0x49')][_0x7721('0x50')]({'where':{'id':_0x134908[_0x7721('0x53')]['id']}})[_0x7721('0x1e')](handleEntityNotFound(_0x3b7382,null))[_0x7721('0x1e')](saveUpdates(_0x134908['body'],null))[_0x7721('0x1e')](respondWithResult(_0x3b7382,null))[_0x7721('0x28')](handleError(_0x3b7382,null));};exports[_0x7721('0x32')]=function(_0x2ee3c0,_0x15ed3b){return db[_0x7721('0x49')][_0x7721('0x50')]({'where':{'id':_0x2ee3c0[_0x7721('0x53')]['id']}})[_0x7721('0x1e')](handleEntityNotFound(_0x15ed3b,null))[_0x7721('0x1e')](removeEntity(_0x15ed3b,null))[_0x7721('0x28')](handleError(_0x15ed3b,null));};exports[_0x7721('0x54')]=function(_0x106664,_0x18f7f6,_0x300ea4){var _0x577f47={};var _0x50e9e9={};var _0x4e112e;var _0x885a3a;return db['DeskAccount']['findOne']({'where':{'id':_0x106664['params']['id']}})['then'](handleEntityNotFound(_0x18f7f6,null))[_0x7721('0x1e')](function(_0x219181){if(_0x219181){_0x4e112e=_0x219181;_0x50e9e9[_0x7721('0x3b')]=_['keys'](db[_0x7721('0x55')]['rawAttributes']);_0x50e9e9['query']=_['keys'](_0x106664[_0x7721('0x38')]);_0x50e9e9['filters']=_['intersection'](_0x50e9e9['model'],_0x50e9e9[_0x7721('0x38')]);_0x577f47[_0x7721('0x3d')]=_[_0x7721('0x3a')](_0x50e9e9['model'],qs[_0x7721('0x3c')](_0x106664[_0x7721('0x38')][_0x7721('0x3c')]));_0x577f47[_0x7721('0x3d')]=_0x577f47[_0x7721('0x3d')][_0x7721('0x4e')]?_0x577f47[_0x7721('0x3d')]:_0x50e9e9[_0x7721('0x3b')];_0x577f47[_0x7721('0x40')]=qs[_0x7721('0x41')](_0x106664[_0x7721('0x38')][_0x7721('0x41')]);_0x577f47[_0x7721('0x43')]=qs[_0x7721('0x39')](_[_0x7721('0x56')](_0x106664['query'],_0x50e9e9[_0x7721('0x39')]));if(_0x106664[_0x7721('0x38')][_0x7721('0x42')]){_0x577f47[_0x7721('0x43')]=_['merge'](_0x577f47[_0x7721('0x43')],{'$or':_[_0x7721('0x44')](_0x577f47['attributes'],function(_0x3e7df3){var _0x5d37ad={};_0x5d37ad[_0x3e7df3]={'$like':'%'+_0x106664[_0x7721('0x38')][_0x7721('0x42')]+'%'};return _0x5d37ad;})});}_0x577f47=_[_0x7721('0x48')]({},_0x577f47,_0x106664[_0x7721('0x4f')]);return _0x4e112e[_0x7721('0x54')](_0x577f47);}})[_0x7721('0x1e')](function(_0x3121e0){if(_0x3121e0){_0x885a3a=_0x3121e0[_0x7721('0x4e')];if(!_0x106664[_0x7721('0x38')]['hasOwnProperty'](_0x7721('0x3f'))){_0x577f47[_0x7721('0x2d')]=qs[_0x7721('0x2d')](_0x106664[_0x7721('0x38')][_0x7721('0x2d')]);_0x577f47[_0x7721('0x2c')]=qs[_0x7721('0x2c')](_0x106664['query'][_0x7721('0x2c')]);}return _0x4e112e[_0x7721('0x54')](_0x577f47);}})['then'](function(_0x192f2e){if(_0x192f2e){return _0x192f2e?{'count':_0x885a3a,'rows':_0x192f2e}:null;}})['then'](respondWithResult(_0x18f7f6,null))[_0x7721('0x28')](handleError(_0x18f7f6,null));};exports[_0x7721('0x57')]=function(_0x4282ba,_0x3b64ec,_0x1e2436){if(_0x4282ba[_0x7721('0x52')]['id']){delete _0x4282ba[_0x7721('0x52')]['id'];}return db['DeskAccount'][_0x7721('0x58')]({'where':{'id':_0x4282ba[_0x7721('0x53')]['id']}})[_0x7721('0x1e')](handleEntityNotFound(_0x3b64ec,null))['then'](function(_0x5cef5a){if(_0x5cef5a){_0x4282ba['body']['AccountId']=_0x5cef5a['id'];_0x4282ba['body'][_0x7721('0x59')]=integrations[_0x7721('0x5a')](_0x4282ba['body'][_0x7721('0x5b')],_0x4282ba[_0x7721('0x52')][_0x7721('0x5c')]);_0x4282ba[_0x7721('0x52')]['Descriptions']=integrations[_0x7721('0x5d')](_0x4282ba[_0x7721('0x52')][_0x7721('0x5b')],_0x4282ba[_0x7721('0x52')][_0x7721('0x5c')]);return db['DeskConfiguration'][_0x7721('0x51')](_0x4282ba[_0x7721('0x52')],{'include':[{'model':db[_0x7721('0x5e')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x7721('0x5f')}]});}return null;})[_0x7721('0x1e')](respondWithResult(_0x3b64ec,null))[_0x7721('0x28')](handleError(_0x3b64ec,null));};exports[_0x7721('0x60')]=function(_0x75a5cc,_0x52a614,_0x4ba35e){var _0x263070=[{'name':_0x7721('0x61'),'label':_0x7721('0x61'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];return db[_0x7721('0x49')][_0x7721('0x58')]({'where':{'id':_0x75a5cc[_0x7721('0x53')]['id']},'attributes':['id',_0x7721('0x62'),'authType',_0x7721('0x63'),_0x7721('0x64'),_0x7721('0x65'),'consumerSecret',_0x7721('0x66'),_0x7721('0x67')]})[_0x7721('0x1e')](handleEntityNotFound(_0x52a614,null))[_0x7721('0x1e')](function(_0x56af64){if(_0x56af64){var _0x4d4d6a={'method':_0x7721('0x68'),'uri':util[_0x7721('0x69')](_0x7721('0x6a'),_0x56af64[_0x7721('0x62')]),'headers':{'Content-Type':_0x7721('0x6b'),'Accept':_0x7721('0x6b')},'json':!![]};if(_0x56af64['authType']===_0x7721('0x6c')){_0x4d4d6a[_0x7721('0x6d')][_0x7721('0x6e')]=util['format'](_0x7721('0x6f'),new Buffer(util[_0x7721('0x69')](_0x7721('0x70'),_0x56af64[_0x7721('0x63')],_0x56af64[_0x7721('0x64')]))['toString'](_0x7721('0x71')));}return rp(_0x4d4d6a)['then'](function(_0x12a3f7){return _0x263070[_0x7721('0x72')](_[_0x7721('0x44')](_0x12a3f7[_0x7721('0x73')][_0x7721('0x74')],function(_0x438b9f){return{'id':_0x438b9f[_0x7721('0x33')],'name':_0x438b9f[_0x7721('0x33')],'type':_0x438b9f[_0x7721('0x5c')],'active':_0x438b9f[_0x7721('0x75')],'label':_0x438b9f[_0x7721('0x76')],'custom':!![]};}));});}})['then'](function(_0x19fad6){return{'count':_0x19fad6[_0x7721('0x4e')],'rows':_0x19fad6};})[_0x7721('0x1e')](respondWithResult(_0x52a614,null))['catch'](function(_0x94af20){var _0x26b2cc=_0x75a5cc[_0x7721('0x38')][_0x7721('0x77')]?0x1f4:_0x94af20[_0x7721('0x78')]||0x1f4;logger['error'](_0x7721('0x79'),_0x7721('0x60'),_0x26b2cc,JSON[_0x7721('0x7a')](_0x94af20));delete _0x94af20[_0x7721('0x33')];if(_0x26b2cc===0x191){_0x26b2cc=0x190;}_0x52a614[_0x7721('0x2a')](_0x26b2cc)[_0x7721('0x34')](_0x75a5cc['query'][_0x7721('0x77')]?{'message':_0x7721('0x7b'),'statusCode':_0x94af20['statusCode']}:_0x94af20);});}; \ No newline at end of file +var _0xe14b=['getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','tokenSecret','GET','format','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','map','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','field','options','count','include','DeskAccount','findAll','show','params','rawAttributes','length','includeAll','find','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','channel','type','Descriptions','getDescriptions','DeskConfiguration','create','DeskField'];(function(_0x50cb0f,_0x173193){var _0x95f525=function(_0x47b5d1){while(--_0x47b5d1){_0x50cb0f['push'](_0x50cb0f['shift']());}};_0x95f525(++_0x173193);}(_0xe14b,0x93));var _0xbe14=function(_0x46e2b3,_0x31b4dd){_0x46e2b3=_0x46e2b3-0x0;var _0x1b76b2=_0xe14b[_0x46e2b3];return _0x1b76b2;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var authService=require(_0xbe14('0xe'));var hardwareService=require(_0xbe14('0xf'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xbe14('0x10'))(_0xbe14('0x11'));var utils=require('../../config/utils');var config=require(_0xbe14('0x12'));var db=require(_0xbe14('0x13'))['db'];var integrations=require(_0xbe14('0x14'));var jayson=require(_0xbe14('0x15'));var client=jayson[_0xbe14('0x16')][_0xbe14('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x23a730,_0x2850cb,_0x16893f,_0xa2cf72){return new BPromise(function(_0x1e4826,_0x33fd54){var _0x813399=_0xa2cf72||client;return _0x813399['request'](_0x23a730,_0x16893f)['then'](function(_0x3f58f5){logger[_0xbe14('0x18')](_0xbe14('0x19'),_0x2850cb,_0xbe14('0x1a'));logger['debug'](_0xbe14('0x1b'),_0x2850cb,_0xbe14('0x1a'),JSON[_0xbe14('0x1c')](_0x3f58f5));if(_0x3f58f5[_0xbe14('0x1d')]){if(_0x3f58f5[_0xbe14('0x1d')][_0xbe14('0x1e')]===0x1f4){logger[_0xbe14('0x1d')]('DeskAccount,\x20%s,\x20%s',_0x2850cb,_0x3f58f5[_0xbe14('0x1d')][_0xbe14('0x1f')]);return _0x33fd54(_0x3f58f5[_0xbe14('0x1d')][_0xbe14('0x1f')]);}logger[_0xbe14('0x1d')](_0xbe14('0x19'),_0x2850cb,_0x3f58f5['error'][_0xbe14('0x1f')]);return _0x1e4826(_0x3f58f5[_0xbe14('0x1d')][_0xbe14('0x1f')]);}else{logger[_0xbe14('0x18')](_0xbe14('0x19'),_0x2850cb,'request\x20sent');_0x1e4826(_0x3f58f5[_0xbe14('0x20')]['message']);}})[_0xbe14('0x21')](function(_0x56e80c){logger[_0xbe14('0x1d')]('DeskAccount,\x20%s,\x20%s',_0x2850cb,_0x56e80c);_0x33fd54(_0x56e80c);});});}function respondWithStatusCode(_0x274018,_0x3d3608){_0x3d3608=_0x3d3608||0xcc;return function(_0x505dbd){if(_0x505dbd){return _0x274018[_0xbe14('0x22')](_0x3d3608);}return _0x274018['status'](_0x3d3608)[_0xbe14('0x23')]();};}function respondWithResult(_0x4851f8,_0x36a21e){_0x36a21e=_0x36a21e||0xc8;return function(_0x5fa043){if(_0x5fa043){return _0x4851f8[_0xbe14('0x24')](_0x36a21e)[_0xbe14('0x25')](_0x5fa043);}};}function respondWithFilteredResult(_0x15ef02,_0x2703f5){return function(_0x55d001){if(_0x55d001){var _0x1822e0=_0x55d001['count'],_0x1ba46a=_0x2703f5[_0xbe14('0x26')],_0x391556=_0x2703f5[_0xbe14('0x26')]+_0x2703f5['limit'],_0x169369;if(_0x391556>=_0x1822e0){_0x391556=_0x1822e0;_0x169369=0xc8;}else{_0x169369=0xce;}_0x15ef02[_0xbe14('0x24')](_0x169369);return _0x15ef02[_0xbe14('0x27')](_0xbe14('0x28'),_0x1ba46a+'-'+_0x391556+'/'+_0x1822e0)[_0xbe14('0x25')](_0x55d001);}return null;};}function patchUpdates(_0x34d648){return function(_0x36d4b2){try{jsonpatch[_0xbe14('0x29')](_0x36d4b2,_0x34d648,!![]);}catch(_0x2b05cb){return BPromise[_0xbe14('0x2a')](_0x2b05cb);}return _0x36d4b2[_0xbe14('0x2b')]();};}function saveUpdates(_0x40538f,_0x3bf43c){return function(_0x39dc0a){if(_0x39dc0a){return _0x39dc0a[_0xbe14('0x2c')](_0x40538f)[_0xbe14('0x2d')](function(_0xe6feb2){return _0xe6feb2;});}return null;};}function removeEntity(_0x6ba36c,_0x2ff48e){return function(_0x29e76a){if(_0x29e76a){return _0x29e76a[_0xbe14('0x2e')]()['then'](function(){_0x6ba36c[_0xbe14('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58f8de,_0x46c2d1){return function(_0x4c1e7e){if(!_0x4c1e7e){_0x58f8de[_0xbe14('0x22')](0x194);}return _0x4c1e7e;};}function handleError(_0x345b0,_0x52a25c){_0x52a25c=_0x52a25c||0x1f4;return function(_0x50cb09){logger['error'](_0x50cb09[_0xbe14('0x2f')]);if(_0x50cb09[_0xbe14('0x30')]){delete _0x50cb09['name'];}_0x345b0[_0xbe14('0x24')](_0x52a25c)[_0xbe14('0x31')](_0x50cb09);};}exports[_0xbe14('0x32')]=function(_0x1aa849,_0x29c23e){var _0x5ef1e5={},_0x591a36={},_0x15a997={'count':0x0,'rows':[]};var _0x52b24c=db['DeskAccount']['rawAttributes'];_0x591a36[_0xbe14('0x33')]=_[_0xbe14('0x34')](_0x52b24c);_0x591a36[_0xbe14('0x35')]=_[_0xbe14('0x34')](_0x1aa849[_0xbe14('0x35')]);_0x591a36[_0xbe14('0x36')]=_[_0xbe14('0x37')](_0x591a36[_0xbe14('0x33')],_0x591a36[_0xbe14('0x35')]);_0x5ef1e5[_0xbe14('0x38')]=_[_0xbe14('0x37')](_0x591a36[_0xbe14('0x33')],qs['fields'](_0x1aa849['query'][_0xbe14('0x39')]));_0x5ef1e5[_0xbe14('0x38')]=_0x5ef1e5[_0xbe14('0x38')]['length']?_0x5ef1e5[_0xbe14('0x38')]:_0x591a36[_0xbe14('0x33')];if(!_0x1aa849[_0xbe14('0x35')][_0xbe14('0x3a')](_0xbe14('0x3b'))){_0x5ef1e5[_0xbe14('0x3c')]=qs[_0xbe14('0x3c')](_0x1aa849[_0xbe14('0x35')][_0xbe14('0x3c')]);_0x5ef1e5['offset']=qs[_0xbe14('0x26')](_0x1aa849[_0xbe14('0x35')][_0xbe14('0x26')]);}_0x5ef1e5[_0xbe14('0x3d')]=qs[_0xbe14('0x3e')](_0x1aa849[_0xbe14('0x35')]['sort']);_0x5ef1e5[_0xbe14('0x3f')]=qs[_0xbe14('0x36')](_[_0xbe14('0x40')](_0x1aa849[_0xbe14('0x35')],_0x591a36['filters']));if(_0x1aa849['query'][_0xbe14('0x41')]){_0x5ef1e5[_0xbe14('0x3f')]=_[_0xbe14('0x42')](_0x5ef1e5['where'],{'$or':_['map'](_0x52b24c,function(_0x6b6aa8){if(_0x6b6aa8['type']['key']!==_0xbe14('0x43')){var _0x1f0355={};_0x1f0355[_0x6b6aa8[_0xbe14('0x44')]]={'$like':'%'+_0x1aa849['query']['filter']+'%'};return _0x1f0355;}})});}_0x5ef1e5=_['merge']({},_0x5ef1e5,_0x1aa849[_0xbe14('0x45')]);var _0x1eccf7={'where':_0x5ef1e5[_0xbe14('0x3f')]};return db['DeskAccount'][_0xbe14('0x46')](_0x1eccf7)[_0xbe14('0x2d')](function(_0x32f22e){_0x15a997[_0xbe14('0x46')]=_0x32f22e;if(_0x1aa849['query']['includeAll']){_0x5ef1e5[_0xbe14('0x47')]=[{'all':!![]}];}return db[_0xbe14('0x48')][_0xbe14('0x49')](_0x5ef1e5);})[_0xbe14('0x2d')](function(_0x2550dc){_0x15a997['rows']=_0x2550dc;return _0x15a997;})['then'](respondWithFilteredResult(_0x29c23e,_0x5ef1e5))[_0xbe14('0x21')](handleError(_0x29c23e,null));};exports[_0xbe14('0x4a')]=function(_0x238c60,_0x2a3b35){var _0x4e65d2={'raw':![],'where':{'id':_0x238c60[_0xbe14('0x4b')]['id']}},_0x28b6e3={};_0x28b6e3['model']=_[_0xbe14('0x34')](db[_0xbe14('0x48')][_0xbe14('0x4c')]);_0x28b6e3[_0xbe14('0x35')]=_['keys'](_0x238c60['query']);_0x28b6e3[_0xbe14('0x36')]=_[_0xbe14('0x37')](_0x28b6e3['model'],_0x28b6e3['query']);_0x4e65d2[_0xbe14('0x38')]=_[_0xbe14('0x37')](_0x28b6e3[_0xbe14('0x33')],qs[_0xbe14('0x39')](_0x238c60[_0xbe14('0x35')][_0xbe14('0x39')]));_0x4e65d2[_0xbe14('0x38')]=_0x4e65d2['attributes'][_0xbe14('0x4d')]?_0x4e65d2[_0xbe14('0x38')]:_0x28b6e3[_0xbe14('0x33')];if(_0x238c60[_0xbe14('0x35')][_0xbe14('0x4e')]){_0x4e65d2['include']=[{'all':!![]}];}_0x4e65d2=_[_0xbe14('0x42')]({},_0x4e65d2,_0x238c60[_0xbe14('0x45')]);return db[_0xbe14('0x48')][_0xbe14('0x4f')](_0x4e65d2)[_0xbe14('0x2d')](handleEntityNotFound(_0x2a3b35,null))[_0xbe14('0x2d')](respondWithResult(_0x2a3b35,null))['catch'](handleError(_0x2a3b35,null));};exports['create']=function(_0x3a49f7,_0x2bde72){return db[_0xbe14('0x48')]['create'](_0x3a49f7['body'],{})[_0xbe14('0x2d')](respondWithResult(_0x2bde72,0xc9))[_0xbe14('0x21')](handleError(_0x2bde72,null));};exports['update']=function(_0x339a86,_0x32496a){if(_0x339a86['body']['id']){delete _0x339a86[_0xbe14('0x50')]['id'];}return db['DeskAccount'][_0xbe14('0x4f')]({'where':{'id':_0x339a86[_0xbe14('0x4b')]['id']}})[_0xbe14('0x2d')](handleEntityNotFound(_0x32496a,null))['then'](saveUpdates(_0x339a86[_0xbe14('0x50')],null))[_0xbe14('0x2d')](respondWithResult(_0x32496a,null))['catch'](handleError(_0x32496a,null));};exports[_0xbe14('0x2e')]=function(_0x42ca15,_0x2210cc){return db[_0xbe14('0x48')][_0xbe14('0x4f')]({'where':{'id':_0x42ca15['params']['id']}})[_0xbe14('0x2d')](handleEntityNotFound(_0x2210cc,null))[_0xbe14('0x2d')](removeEntity(_0x2210cc,null))[_0xbe14('0x21')](handleError(_0x2210cc,null));};exports[_0xbe14('0x51')]=function(_0x32968f,_0x44084c,_0x1dd6c7){var _0x56ab61={};var _0x72c875={};var _0x1b47a4;var _0x941ee2;return db[_0xbe14('0x48')][_0xbe14('0x52')]({'where':{'id':_0x32968f[_0xbe14('0x4b')]['id']}})[_0xbe14('0x2d')](handleEntityNotFound(_0x44084c,null))[_0xbe14('0x2d')](function(_0x285b6e){if(_0x285b6e){_0x1b47a4=_0x285b6e;_0x72c875[_0xbe14('0x33')]=_[_0xbe14('0x34')](db['DeskConfiguration']['rawAttributes']);_0x72c875['query']=_[_0xbe14('0x34')](_0x32968f[_0xbe14('0x35')]);_0x72c875[_0xbe14('0x36')]=_[_0xbe14('0x37')](_0x72c875[_0xbe14('0x33')],_0x72c875[_0xbe14('0x35')]);_0x56ab61[_0xbe14('0x38')]=_[_0xbe14('0x37')](_0x72c875[_0xbe14('0x33')],qs[_0xbe14('0x39')](_0x32968f[_0xbe14('0x35')][_0xbe14('0x39')]));_0x56ab61[_0xbe14('0x38')]=_0x56ab61[_0xbe14('0x38')][_0xbe14('0x4d')]?_0x56ab61[_0xbe14('0x38')]:_0x72c875[_0xbe14('0x33')];_0x56ab61[_0xbe14('0x3d')]=qs[_0xbe14('0x3e')](_0x32968f[_0xbe14('0x35')]['sort']);_0x56ab61[_0xbe14('0x3f')]=qs[_0xbe14('0x36')](_[_0xbe14('0x40')](_0x32968f[_0xbe14('0x35')],_0x72c875[_0xbe14('0x36')]));if(_0x32968f[_0xbe14('0x35')][_0xbe14('0x41')]){_0x56ab61[_0xbe14('0x3f')]=_[_0xbe14('0x42')](_0x56ab61[_0xbe14('0x3f')],{'$or':_['map'](_0x56ab61[_0xbe14('0x38')],function(_0x442ec4){var _0x2d4dd4={};_0x2d4dd4[_0x442ec4]={'$like':'%'+_0x32968f[_0xbe14('0x35')][_0xbe14('0x41')]+'%'};return _0x2d4dd4;})});}_0x56ab61=_['merge']({},_0x56ab61,_0x32968f[_0xbe14('0x45')]);return _0x1b47a4[_0xbe14('0x51')](_0x56ab61);}})[_0xbe14('0x2d')](function(_0xd4e1c7){if(_0xd4e1c7){_0x941ee2=_0xd4e1c7[_0xbe14('0x4d')];if(!_0x32968f['query'][_0xbe14('0x3a')](_0xbe14('0x3b'))){_0x56ab61[_0xbe14('0x3c')]=qs[_0xbe14('0x3c')](_0x32968f[_0xbe14('0x35')][_0xbe14('0x3c')]);_0x56ab61[_0xbe14('0x26')]=qs[_0xbe14('0x26')](_0x32968f['query'][_0xbe14('0x26')]);}return _0x1b47a4[_0xbe14('0x51')](_0x56ab61);}})[_0xbe14('0x2d')](function(_0x20b12e){if(_0x20b12e){return _0x20b12e?{'count':_0x941ee2,'rows':_0x20b12e}:null;}})[_0xbe14('0x2d')](respondWithResult(_0x44084c,null))[_0xbe14('0x21')](handleError(_0x44084c,null));};exports[_0xbe14('0x53')]=function(_0x566096,_0x4eedd2,_0x12941d){if(_0x566096[_0xbe14('0x50')]['id']){delete _0x566096[_0xbe14('0x50')]['id'];}return db[_0xbe14('0x48')][_0xbe14('0x52')]({'where':{'id':_0x566096[_0xbe14('0x4b')]['id']}})[_0xbe14('0x2d')](handleEntityNotFound(_0x4eedd2,null))[_0xbe14('0x2d')](function(_0x50e644){if(_0x50e644){_0x566096['body'][_0xbe14('0x54')]=_0x50e644['id'];_0x566096[_0xbe14('0x50')][_0xbe14('0x55')]=integrations['getSubjects'](_0x566096[_0xbe14('0x50')][_0xbe14('0x56')],_0x566096[_0xbe14('0x50')][_0xbe14('0x57')]);_0x566096[_0xbe14('0x50')][_0xbe14('0x58')]=integrations[_0xbe14('0x59')](_0x566096['body'][_0xbe14('0x56')],_0x566096[_0xbe14('0x50')][_0xbe14('0x57')]);return db[_0xbe14('0x5a')][_0xbe14('0x5b')](_0x566096[_0xbe14('0x50')],{'include':[{'model':db[_0xbe14('0x5c')],'as':'Subjects'},{'model':db[_0xbe14('0x5c')],'as':_0xbe14('0x58')}]});}return null;})[_0xbe14('0x2d')](respondWithResult(_0x4eedd2,null))[_0xbe14('0x21')](handleError(_0x4eedd2,null));};exports[_0xbe14('0x5d')]=function(_0x2eb057,_0x350ff6,_0xd756b2){var _0x5d064e=[{'name':_0xbe14('0x5e'),'label':_0xbe14('0x5e'),'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}]}];return db[_0xbe14('0x48')][_0xbe14('0x52')]({'where':{'id':_0x2eb057[_0xbe14('0x4b')]['id']},'attributes':['id',_0xbe14('0x5f'),'authType',_0xbe14('0x60'),_0xbe14('0x61'),_0xbe14('0x62'),_0xbe14('0x63'),'token',_0xbe14('0x64')]})[_0xbe14('0x2d')](handleEntityNotFound(_0x350ff6,null))[_0xbe14('0x2d')](function(_0x1e7770){if(_0x1e7770){var _0x80b6ec={'method':_0xbe14('0x65'),'uri':util[_0xbe14('0x66')]('%s/custom_fields',_0x1e7770[_0xbe14('0x5f')]),'headers':{'Content-Type':'application/json','Accept':_0xbe14('0x67')},'json':!![]};if(_0x1e7770['authType']===_0xbe14('0x68')){_0x80b6ec[_0xbe14('0x69')][_0xbe14('0x6a')]=util['format'](_0xbe14('0x6b'),new Buffer(util[_0xbe14('0x66')](_0xbe14('0x6c'),_0x1e7770['username'],_0x1e7770[_0xbe14('0x61')]))[_0xbe14('0x6d')](_0xbe14('0x6e')));}return rp(_0x80b6ec)[_0xbe14('0x2d')](function(_0x568177){return _0x5d064e[_0xbe14('0x6f')](_[_0xbe14('0x70')](_0x568177[_0xbe14('0x71')][_0xbe14('0x72')],function(_0x1dd5c0){return{'id':_0x1dd5c0[_0xbe14('0x30')],'name':_0x1dd5c0[_0xbe14('0x30')],'type':_0x1dd5c0['type'],'active':_0x1dd5c0[_0xbe14('0x73')],'label':_0x1dd5c0[_0xbe14('0x74')],'custom':!![]};}));});}})[_0xbe14('0x2d')](function(_0x5c89a0){return{'count':_0x5c89a0[_0xbe14('0x4d')],'rows':_0x5c89a0};})[_0xbe14('0x2d')](respondWithResult(_0x350ff6,null))[_0xbe14('0x21')](function(_0x5bc52b){var _0xa53262=_0x2eb057[_0xbe14('0x35')]['test']?0x1f4:_0x5bc52b[_0xbe14('0x75')]||0x1f4;logger['error'](_0xbe14('0x76'),_0xbe14('0x5d'),_0xa53262,JSON['stringify'](_0x5bc52b));delete _0x5bc52b['name'];if(_0xa53262===0x191){_0xa53262=0x190;}_0x350ff6[_0xbe14('0x24')](_0xa53262)[_0xbe14('0x31')](_0x2eb057[_0xbe14('0x35')]['test']?{'message':_0xbe14('0x77'),'statusCode':_0x5bc52b[_0xbe14('0x75')]}:_0x5bc52b);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 8b75b22..dff384b 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 _0xb016=['exports','define','DeskAccount','lodash','util','moment','request-promise','./intDeskAccount.attributes','../../components/integrations/configuration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb016,0x159));var _0x6b01=function(_0x33e725,_0x46b3d5){_0x33e725=_0x33e725-0x0;var _0x28ae8d=_0xb016[_0x33e725];return _0x28ae8d;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b01('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b01('0x3'));var attributes=require(_0x6b01('0x4'));var integrations=require(_0x6b01('0x5'));module[_0x6b01('0x6')]=function(_0x5964ca,_0x1b7dd6){return _0x5964ca[_0x6b01('0x7')](_0x6b01('0x8'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe635=['bluebird','request-promise','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x5abf7a,_0x4d16bb){var _0x17350f=function(_0x142f20){while(--_0x142f20){_0x5abf7a['push'](_0x5abf7a['shift']());}};_0x17350f(++_0x4d16bb);}(_0xe635,0x1be));var _0x5e63=function(_0x6d02f6,_0x21e16f){_0x6d02f6=_0x6d02f6-0x0;var _0x372791=_0xe635[_0x6d02f6];return _0x372791;};'use strict';var _=require(_0x5e63('0x0'));var util=require(_0x5e63('0x1'));var logger=require(_0x5e63('0x2'))(_0x5e63('0x3'));var moment=require(_0x5e63('0x4'));var BPromise=require(_0x5e63('0x5'));var rp=require(_0x5e63('0x6'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x5e63('0x7')]=function(_0x30e8d1,_0x3c3939){return _0x30e8d1[_0x5e63('0x8')](_0x5e63('0x9'),attributes,{'tableName':_0x5e63('0xa'),'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 e157938..3581359 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 _0x6d5c=['code','message','result','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','find','ShowDeskAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1a89e4,_0x252986){var _0x25befe=function(_0x547ac5){while(--_0x547ac5){_0x1a89e4['push'](_0x1a89e4['shift']());}};_0x25befe(++_0x252986);}(_0x6d5c,0x179));var _0xc6d5=function(_0x3a0f07,_0x4e88f7){_0x3a0f07=_0x3a0f07-0x0;var _0x28f557=_0x6d5c[_0x3a0f07];return _0x28f557;};'use strict';var _=require(_0xc6d5('0x0'));var util=require(_0xc6d5('0x1'));var moment=require(_0xc6d5('0x2'));var BPromise=require(_0xc6d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6d5('0x4'));var db=require(_0xc6d5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6d5('0x6'))(_0xc6d5('0x7'));var config=require(_0xc6d5('0x8'));var jayson=require(_0xc6d5('0x9'));var client=jayson['client'][_0xc6d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f110b,_0x42b7c2,_0x4eaff5){return new BPromise(function(_0x505e80,_0xa4f64e){return client[_0xc6d5('0xb')](_0x5f110b,_0x4eaff5)[_0xc6d5('0xc')](function(_0x2b27fa){logger[_0xc6d5('0xd')](_0xc6d5('0xe'),_0x42b7c2,_0xc6d5('0xf'));logger[_0xc6d5('0x10')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x42b7c2,_0xc6d5('0xf'),JSON[_0xc6d5('0x11')](_0x2b27fa));if(_0x2b27fa['error']){if(_0x2b27fa[_0xc6d5('0x12')][_0xc6d5('0x13')]===0x1f4){logger['error'](_0xc6d5('0xe'),_0x42b7c2,_0x2b27fa[_0xc6d5('0x12')][_0xc6d5('0x14')]);return _0xa4f64e(_0x2b27fa[_0xc6d5('0x12')][_0xc6d5('0x14')]);}logger['error'](_0xc6d5('0xe'),_0x42b7c2,_0x2b27fa[_0xc6d5('0x12')][_0xc6d5('0x14')]);return _0x505e80(_0x2b27fa[_0xc6d5('0x12')][_0xc6d5('0x14')]);}else{logger[_0xc6d5('0xd')](_0xc6d5('0xe'),_0x42b7c2,_0xc6d5('0xf'));_0x505e80(_0x2b27fa[_0xc6d5('0x15')][_0xc6d5('0x14')]);}})[_0xc6d5('0x16')](function(_0x3ab803){logger[_0xc6d5('0x12')]('DeskAccount,\x20%s,\x20%s',_0x42b7c2,_0x3ab803);_0xa4f64e(_0x3ab803);});});}exports['GetDeskAccount']=function(_0x811cc2){var _0x2689d8=this;return new Promise(function(_0x2be13e,_0xe1ef6a){return db[_0xc6d5('0x17')][_0xc6d5('0x18')]({'raw':_0x811cc2[_0xc6d5('0x19')]?_0x811cc2[_0xc6d5('0x19')][_0xc6d5('0x1a')]===undefined?!![]:![]:!![],'where':_0x811cc2[_0xc6d5('0x19')]?_0x811cc2['options'][_0xc6d5('0x1b')]||null:null,'attributes':_0x811cc2[_0xc6d5('0x19')]?_0x811cc2['options'][_0xc6d5('0x1c')]||null:null,'limit':_0x811cc2[_0xc6d5('0x19')]?_0x811cc2['options'][_0xc6d5('0x1d')]||null:null,'include':_0x811cc2[_0xc6d5('0x19')]?_0x811cc2['options'][_0xc6d5('0x1e')]?_['map'](_0x811cc2[_0xc6d5('0x19')][_0xc6d5('0x1e')],function(_0x4e7ab2){return{'model':db[_0x4e7ab2['model']],'as':_0x4e7ab2['as'],'attributes':_0x4e7ab2['attributes'],'include':_0x4e7ab2[_0xc6d5('0x1e')]?_[_0xc6d5('0x1f')](_0x4e7ab2[_0xc6d5('0x1e')],function(_0x3e6bc2){return{'model':db[_0x3e6bc2[_0xc6d5('0x20')]],'as':_0x3e6bc2['as'],'attributes':_0x3e6bc2[_0xc6d5('0x1c')],'include':_0x3e6bc2['include']?_[_0xc6d5('0x1f')](_0x3e6bc2['include'],function(_0x1c82c3){return{'model':db[_0x1c82c3[_0xc6d5('0x20')]],'as':_0x1c82c3['as'],'attributes':_0x1c82c3[_0xc6d5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc6d5('0xc')](function(_0x41fab1){logger[_0xc6d5('0xd')]('GetDeskAccount',_0x811cc2);logger['debug'](_0xc6d5('0x21'),_0x811cc2,JSON[_0xc6d5('0x11')](_0x41fab1));_0x2be13e(_0x41fab1);})[_0xc6d5('0x16')](function(_0x515e84){logger[_0xc6d5('0x12')](_0xc6d5('0x21'),_0x515e84['message'],_0x811cc2);_0xe1ef6a(_0x2689d8[_0xc6d5('0x12')](0x1f4,_0x515e84[_0xc6d5('0x14')]));});});};exports['ShowDeskAccount']=function(_0x22f925){var _0x5d034a=this;return new Promise(function(_0x43a8ea,_0x5a7ddf){return db[_0xc6d5('0x17')][_0xc6d5('0x22')]({'raw':_0x22f925[_0xc6d5('0x19')]?_0x22f925['options'][_0xc6d5('0x1a')]===undefined?!![]:![]:!![],'where':_0x22f925[_0xc6d5('0x19')]?_0x22f925[_0xc6d5('0x19')][_0xc6d5('0x1b')]||null:null,'attributes':_0x22f925[_0xc6d5('0x19')]?_0x22f925[_0xc6d5('0x19')]['attributes']||null:null,'include':_0x22f925[_0xc6d5('0x19')]?_0x22f925[_0xc6d5('0x19')][_0xc6d5('0x1e')]?_[_0xc6d5('0x1f')](_0x22f925['options'][_0xc6d5('0x1e')],function(_0x3e7999){return{'model':db[_0x3e7999[_0xc6d5('0x20')]],'as':_0x3e7999['as'],'attributes':_0x3e7999[_0xc6d5('0x1c')],'include':_0x3e7999[_0xc6d5('0x1e')]?_['map'](_0x3e7999[_0xc6d5('0x1e')],function(_0xdf5dbc){return{'model':db[_0xdf5dbc[_0xc6d5('0x20')]],'as':_0xdf5dbc['as'],'attributes':_0xdf5dbc[_0xc6d5('0x1c')],'include':_0xdf5dbc[_0xc6d5('0x1e')]?_[_0xc6d5('0x1f')](_0xdf5dbc[_0xc6d5('0x1e')],function(_0x49dcf2){return{'model':db[_0x49dcf2['model']],'as':_0x49dcf2['as'],'attributes':_0x49dcf2[_0xc6d5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x426cc8){logger[_0xc6d5('0xd')](_0xc6d5('0x23'),_0x22f925);logger['debug'](_0xc6d5('0x23'),_0x22f925,JSON[_0xc6d5('0x11')](_0x426cc8));_0x43a8ea(_0x426cc8);})[_0xc6d5('0x16')](function(_0x444bb9){logger['error']('ShowDeskAccount',_0x444bb9[_0xc6d5('0x14')],_0x22f925);_0x5a7ddf(_0x5d034a[_0xc6d5('0x12')](0x1f4,_0x444bb9[_0xc6d5('0x14')]));});});}; \ No newline at end of file +var _0xd448=['attributes','include','map','model','info','ShowDeskAccount','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','findAll','options','where'];(function(_0x1e6c56,_0x381233){var _0x1ff3e2=function(_0x749216){while(--_0x749216){_0x1e6c56['push'](_0x1e6c56['shift']());}};_0x1ff3e2(++_0x381233);}(_0xd448,0x172));var _0x8d44=function(_0x59d727,_0x41606e){_0x59d727=_0x59d727-0x0;var _0x17f64a=_0xd448[_0x59d727];return _0x17f64a;};'use strict';var _=require('lodash');var util=require(_0x8d44('0x0'));var moment=require(_0x8d44('0x1'));var BPromise=require(_0x8d44('0x2'));var rs=require(_0x8d44('0x3'));var fs=require('fs');var Redis=require(_0x8d44('0x4'));var db=require(_0x8d44('0x5'))['db'];var utils=require(_0x8d44('0x6'));var logger=require(_0x8d44('0x7'))(_0x8d44('0x8'));var config=require(_0x8d44('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8d44('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56539b,_0x3b352e,_0x2cdb53){return new BPromise(function(_0x1680eb,_0x441fd3){return client['request'](_0x56539b,_0x2cdb53)[_0x8d44('0xb')](function(_0x2a5da6){logger['info']('DeskAccount,\x20%s,\x20%s',_0x3b352e,_0x8d44('0xc'));logger[_0x8d44('0xd')](_0x8d44('0xe'),_0x3b352e,'request\x20sent',JSON[_0x8d44('0xf')](_0x2a5da6));if(_0x2a5da6[_0x8d44('0x10')]){if(_0x2a5da6[_0x8d44('0x10')][_0x8d44('0x11')]===0x1f4){logger['error'](_0x8d44('0x12'),_0x3b352e,_0x2a5da6[_0x8d44('0x10')][_0x8d44('0x13')]);return _0x441fd3(_0x2a5da6[_0x8d44('0x10')][_0x8d44('0x13')]);}logger['error'](_0x8d44('0x12'),_0x3b352e,_0x2a5da6[_0x8d44('0x10')][_0x8d44('0x13')]);return _0x1680eb(_0x2a5da6[_0x8d44('0x10')][_0x8d44('0x13')]);}else{logger['info'](_0x8d44('0x12'),_0x3b352e,_0x8d44('0xc'));_0x1680eb(_0x2a5da6[_0x8d44('0x14')][_0x8d44('0x13')]);}})[_0x8d44('0x15')](function(_0x2e7d11){logger[_0x8d44('0x10')](_0x8d44('0x12'),_0x3b352e,_0x2e7d11);_0x441fd3(_0x2e7d11);});});}exports[_0x8d44('0x16')]=function(_0x1f29cb){var _0x4947f9=this;return new Promise(function(_0x10d801,_0x224265){return db['DeskAccount'][_0x8d44('0x17')]({'raw':_0x1f29cb[_0x8d44('0x18')]?_0x1f29cb[_0x8d44('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1f29cb[_0x8d44('0x18')]?_0x1f29cb[_0x8d44('0x18')][_0x8d44('0x19')]||null:null,'attributes':_0x1f29cb[_0x8d44('0x18')]?_0x1f29cb['options'][_0x8d44('0x1a')]||null:null,'limit':_0x1f29cb[_0x8d44('0x18')]?_0x1f29cb[_0x8d44('0x18')]['limit']||null:null,'include':_0x1f29cb[_0x8d44('0x18')]?_0x1f29cb[_0x8d44('0x18')][_0x8d44('0x1b')]?_[_0x8d44('0x1c')](_0x1f29cb[_0x8d44('0x18')]['include'],function(_0x45251a){return{'model':db[_0x45251a[_0x8d44('0x1d')]],'as':_0x45251a['as'],'attributes':_0x45251a[_0x8d44('0x1a')],'include':_0x45251a['include']?_['map'](_0x45251a[_0x8d44('0x1b')],function(_0x105a12){return{'model':db[_0x105a12[_0x8d44('0x1d')]],'as':_0x105a12['as'],'attributes':_0x105a12[_0x8d44('0x1a')],'include':_0x105a12[_0x8d44('0x1b')]?_[_0x8d44('0x1c')](_0x105a12[_0x8d44('0x1b')],function(_0x5f59ab){return{'model':db[_0x5f59ab['model']],'as':_0x5f59ab['as'],'attributes':_0x5f59ab[_0x8d44('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8d44('0xb')](function(_0x3fdad7){logger[_0x8d44('0x1e')](_0x8d44('0x16'),_0x1f29cb);logger[_0x8d44('0xd')](_0x8d44('0x16'),_0x1f29cb,JSON['stringify'](_0x3fdad7));_0x10d801(_0x3fdad7);})[_0x8d44('0x15')](function(_0x5eb0c5){logger['error'](_0x8d44('0x16'),_0x5eb0c5[_0x8d44('0x13')],_0x1f29cb);_0x224265(_0x4947f9[_0x8d44('0x10')](0x1f4,_0x5eb0c5[_0x8d44('0x13')]));});});};exports[_0x8d44('0x1f')]=function(_0x15f214){var _0x2d034d=this;return new Promise(function(_0x5e4d03,_0x159e0e){return db['DeskAccount']['find']({'raw':_0x15f214['options']?_0x15f214['options'][_0x8d44('0x20')]===undefined?!![]:![]:!![],'where':_0x15f214[_0x8d44('0x18')]?_0x15f214[_0x8d44('0x18')][_0x8d44('0x19')]||null:null,'attributes':_0x15f214['options']?_0x15f214[_0x8d44('0x18')][_0x8d44('0x1a')]||null:null,'include':_0x15f214[_0x8d44('0x18')]?_0x15f214[_0x8d44('0x18')]['include']?_[_0x8d44('0x1c')](_0x15f214[_0x8d44('0x18')][_0x8d44('0x1b')],function(_0x3d6a47){return{'model':db[_0x3d6a47[_0x8d44('0x1d')]],'as':_0x3d6a47['as'],'attributes':_0x3d6a47[_0x8d44('0x1a')],'include':_0x3d6a47['include']?_[_0x8d44('0x1c')](_0x3d6a47['include'],function(_0x736b80){return{'model':db[_0x736b80[_0x8d44('0x1d')]],'as':_0x736b80['as'],'attributes':_0x736b80[_0x8d44('0x1a')],'include':_0x736b80[_0x8d44('0x1b')]?_[_0x8d44('0x1c')](_0x736b80[_0x8d44('0x1b')],function(_0x234100){return{'model':db[_0x234100[_0x8d44('0x1d')]],'as':_0x234100['as'],'attributes':_0x234100[_0x8d44('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8d44('0xb')](function(_0x3cfee8){logger[_0x8d44('0x1e')](_0x8d44('0x1f'),_0x15f214);logger[_0x8d44('0xd')]('ShowDeskAccount',_0x15f214,JSON['stringify'](_0x3cfee8));_0x5e4d03(_0x3cfee8);})[_0x8d44('0x15')](function(_0x4dd7ad){logger[_0x8d44('0x10')](_0x8d44('0x1f'),_0x4dd7ad[_0x8d44('0x13')],_0x15f214);_0x159e0e(_0x2d034d[_0x8d44('0x10')](0x1f4,_0x4dd7ad[_0x8d44('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 3d48147..beacfac 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 _0xf0ac=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields'];(function(_0x4d5c92,_0x1a34a8){var _0x3259b4=function(_0x1f2907){while(--_0x1f2907){_0x4d5c92['push'](_0x4d5c92['shift']());}};_0x3259b4(++_0x1a34a8);}(_0xf0ac,0x81));var _0xcf0a=function(_0x228ddc,_0x32c792){_0x228ddc=_0x228ddc-0x0;var _0x1aa76a=_0xf0ac[_0x228ddc];return _0x1aa76a;};'use strict';var multer=require(_0xcf0a('0x0'));var util=require('util');var path=require(_0xcf0a('0x1'));var timeout=require(_0xcf0a('0x2'));var express=require(_0xcf0a('0x3'));var router=express[_0xcf0a('0x4')]();var auth=require(_0xcf0a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcf0a('0x6'));var controller=require(_0xcf0a('0x7'));router[_0xcf0a('0x8')]('/',auth['isAuthenticated'](),controller[_0xcf0a('0x9')]);router[_0xcf0a('0x8')](_0xcf0a('0xa'),auth[_0xcf0a('0xb')](),controller[_0xcf0a('0xc')]);router[_0xcf0a('0x8')](_0xcf0a('0xd'),auth[_0xcf0a('0xb')](),controller[_0xcf0a('0xe')]);router[_0xcf0a('0x8')]('/:id/subjects',auth[_0xcf0a('0xb')](),controller[_0xcf0a('0xf')]);router[_0xcf0a('0x8')](_0xcf0a('0x10'),auth[_0xcf0a('0xb')](),controller[_0xcf0a('0x11')]);router[_0xcf0a('0x8')]('/:id/tags',auth[_0xcf0a('0xb')](),controller[_0xcf0a('0x12')]);router['post']('/',auth[_0xcf0a('0xb')](),controller['create']);router[_0xcf0a('0x13')](_0xcf0a('0x14'),auth[_0xcf0a('0xb')](),controller[_0xcf0a('0x15')]);router['put'](_0xcf0a('0xa'),auth['isAuthenticated'](),controller[_0xcf0a('0x16')]);router[_0xcf0a('0x17')](_0xcf0a('0xa'),auth[_0xcf0a('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x457a=['../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','index','get','/:id','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update','delete','destroy','multer','path','connect-timeout','express','Router'];(function(_0x461262,_0x1f6ae7){var _0x3975d6=function(_0x188fd8){while(--_0x188fd8){_0x461262['push'](_0x461262['shift']());}};_0x3975d6(++_0x1f6ae7);}(_0x457a,0x85));var _0xa457=function(_0x45da40,_0x551d6e){_0x45da40=_0x45da40-0x0;var _0xb4f517=_0x457a[_0x45da40];return _0xb4f517;};'use strict';var multer=require(_0xa457('0x0'));var util=require('util');var path=require(_0xa457('0x1'));var timeout=require(_0xa457('0x2'));var express=require(_0xa457('0x3'));var router=express[_0xa457('0x4')]();var auth=require(_0xa457('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa457('0x6'));var controller=require(_0xa457('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa457('0x8')]);router[_0xa457('0x9')](_0xa457('0xa'),auth[_0xa457('0xb')](),controller['show']);router[_0xa457('0x9')]('/:id/fields',auth[_0xa457('0xb')](),controller[_0xa457('0xc')]);router[_0xa457('0x9')](_0xa457('0xd'),auth[_0xa457('0xb')](),controller[_0xa457('0xe')]);router[_0xa457('0x9')](_0xa457('0xf'),auth[_0xa457('0xb')](),controller['getDescriptions']);router['get'](_0xa457('0x10'),auth['isAuthenticated'](),controller['getTags']);router[_0xa457('0x11')]('/',auth[_0xa457('0xb')](),controller['create']);router[_0xa457('0x11')](_0xa457('0x10'),auth[_0xa457('0xb')](),controller[_0xa457('0x12')]);router[_0xa457('0x13')]('/:id',auth[_0xa457('0xb')](),controller[_0xa457('0x14')]);router[_0xa457('0x15')](_0xa457('0xa'),auth['isAuthenticated'](),controller[_0xa457('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 251abc0..2055447 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 _0x12e7=['sequelize','exports','STRING'];(function(_0x1ad659,_0x1ab26a){var _0x56d7e2=function(_0x3c3f02){while(--_0x3c3f02){_0x1ad659['push'](_0x1ad659['shift']());}};_0x56d7e2(++_0x1ab26a);}(_0x12e7,0xa8));var _0x712e=function(_0x425907,_0xbe0a4f){_0x425907=_0x425907-0x0;var _0x1899e3=_0x12e7[_0x425907];return _0x1899e3;};'use strict';var Sequelize=require(_0x712e('0x0'));module[_0x712e('0x1')]={'name':{'type':Sequelize[_0x712e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xef35=['sequelize','exports','STRING'];(function(_0x5a88ad,_0x386452){var _0x579d30=function(_0x1a8cb6){while(--_0x1a8cb6){_0x5a88ad['push'](_0x5a88ad['shift']());}};_0x579d30(++_0x386452);}(_0xef35,0xff));var _0x5ef3=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0xef35[_0x5c6994];return _0x1d5c84;};'use strict';var Sequelize=require(_0x5ef3('0x0'));module[_0x5ef3('0x1')]={'name':{'type':Sequelize[_0x5ef3('0x2')]},'description':{'type':Sequelize[_0x5ef3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index ef26e69..ae421dc 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 _0xa902=['end','status','json','count','limit','save','update','destroy','stack','name','send','index','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','DeskConfiguration','include','findAll','rows','catch','rawAttributes','includeAll','options','find','create','body','params','getFields','findOne','DeskField','map','getSubjects','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','client','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0xa902,0x8d));var _0x2a90=function(_0x2a9e25,_0x78bb15){_0x2a9e25=_0x2a9e25-0x0;var _0x307944=_0xa902[_0x2a9e25];return _0x307944;};'use strict';var pdf=require(_0x2a90('0x0'));var emlformat=require(_0x2a90('0x1'));var rimraf=require(_0x2a90('0x2'));var zipdir=require(_0x2a90('0x3'));var jsonpatch=require(_0x2a90('0x4'));var rp=require('request-promise');var moment=require(_0x2a90('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2a90('0x6'));var path=require(_0x2a90('0x7'));var sox=require(_0x2a90('0x8'));var csv=require(_0x2a90('0x9'));var ejs=require(_0x2a90('0xa'));var fs=require('fs');var _=require(_0x2a90('0xb'));var squel=require('squel');var crypto=require(_0x2a90('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a90('0x9'));var querystring=require(_0x2a90('0xd'));var Papa=require(_0x2a90('0xe'));var authService=require(_0x2a90('0xf'));var hardwareService=require(_0x2a90('0x10'));var Redis=require('ioredis');var qs=require(_0x2a90('0x11'));var logger=require(_0x2a90('0x12'))(_0x2a90('0x13'));var utils=require(_0x2a90('0x14'));var config=require('../../config/environment');var db=require(_0x2a90('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2a90('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f6953,_0x57aee3,_0x407ce5,_0x30e166){return new BPromise(function(_0x113912,_0x4c328b){var _0x56d1b8=_0x30e166||client;return _0x56d1b8['request'](_0x1f6953,_0x407ce5)[_0x2a90('0x17')](function(_0x3a42df){logger['info'](_0x2a90('0x18'),_0x57aee3,_0x2a90('0x19'));logger[_0x2a90('0x1a')](_0x2a90('0x1b'),_0x57aee3,_0x2a90('0x19'),JSON[_0x2a90('0x1c')](_0x3a42df));if(_0x3a42df[_0x2a90('0x1d')]){if(_0x3a42df[_0x2a90('0x1d')][_0x2a90('0x1e')]===0x1f4){logger['error'](_0x2a90('0x18'),_0x57aee3,_0x3a42df[_0x2a90('0x1d')][_0x2a90('0x1f')]);return _0x4c328b(_0x3a42df['error'][_0x2a90('0x1f')]);}logger[_0x2a90('0x1d')](_0x2a90('0x18'),_0x57aee3,_0x3a42df[_0x2a90('0x1d')][_0x2a90('0x1f')]);return _0x113912(_0x3a42df[_0x2a90('0x1d')][_0x2a90('0x1f')]);}else{logger[_0x2a90('0x20')](_0x2a90('0x18'),_0x57aee3,_0x2a90('0x19'));_0x113912(_0x3a42df[_0x2a90('0x21')][_0x2a90('0x1f')]);}})['catch'](function(_0x3da7d0){logger[_0x2a90('0x1d')](_0x2a90('0x18'),_0x57aee3,_0x3da7d0);_0x4c328b(_0x3da7d0);});});}function respondWithStatusCode(_0x21f03b,_0x5912fd){_0x5912fd=_0x5912fd||0xcc;return function(_0x180485){if(_0x180485){return _0x21f03b[_0x2a90('0x22')](_0x5912fd);}return _0x21f03b['status'](_0x5912fd)[_0x2a90('0x23')]();};}function respondWithResult(_0x1164a8,_0x10a6dd){_0x10a6dd=_0x10a6dd||0xc8;return function(_0x2a4e28){if(_0x2a4e28){return _0x1164a8[_0x2a90('0x24')](_0x10a6dd)[_0x2a90('0x25')](_0x2a4e28);}};}function respondWithFilteredResult(_0x29ed73,_0x24a6d3){return function(_0x48c2f9){if(_0x48c2f9){var _0x27f883=_0x48c2f9[_0x2a90('0x26')],_0x17f978=_0x24a6d3['offset'],_0x3934d4=_0x24a6d3['offset']+_0x24a6d3[_0x2a90('0x27')],_0x40c61a;if(_0x3934d4>=_0x27f883){_0x3934d4=_0x27f883;_0x40c61a=0xc8;}else{_0x40c61a=0xce;}_0x29ed73['status'](_0x40c61a);return _0x29ed73['set']('Content-Range',_0x17f978+'-'+_0x3934d4+'/'+_0x27f883)[_0x2a90('0x25')](_0x48c2f9);}return null;};}function patchUpdates(_0x3c78f5){return function(_0x595638){try{jsonpatch['apply'](_0x595638,_0x3c78f5,!![]);}catch(_0x1add9a){return BPromise['reject'](_0x1add9a);}return _0x595638[_0x2a90('0x28')]();};}function saveUpdates(_0x6892e1,_0x3b580f){return function(_0x27b6b6){if(_0x27b6b6){return _0x27b6b6[_0x2a90('0x29')](_0x6892e1)[_0x2a90('0x17')](function(_0x2795dd){return _0x2795dd;});}return null;};}function removeEntity(_0x4a0bfa,_0x427918){return function(_0x22b1f3){if(_0x22b1f3){return _0x22b1f3[_0x2a90('0x2a')]()['then'](function(){_0x4a0bfa[_0x2a90('0x24')](0xcc)[_0x2a90('0x23')]();});}};}function handleEntityNotFound(_0xfbb545,_0x17dce6){return function(_0x4f8316){if(!_0x4f8316){_0xfbb545[_0x2a90('0x22')](0x194);}return _0x4f8316;};}function handleError(_0x1b5f73,_0xee69e4){_0xee69e4=_0xee69e4||0x1f4;return function(_0x38158b){logger[_0x2a90('0x1d')](_0x38158b[_0x2a90('0x2b')]);if(_0x38158b['name']){delete _0x38158b[_0x2a90('0x2c')];}_0x1b5f73[_0x2a90('0x24')](_0xee69e4)[_0x2a90('0x2d')](_0x38158b);};}exports[_0x2a90('0x2e')]=function(_0x58a86d,_0x1bab1d){var _0x27e2f0={},_0x4a8870={},_0x3e5002={'count':0x0,'rows':[]};var _0x1410eb=db['DeskConfiguration']['rawAttributes'];_0x4a8870[_0x2a90('0x2f')]=_[_0x2a90('0x30')](_0x1410eb);_0x4a8870[_0x2a90('0x31')]=_['keys'](_0x58a86d[_0x2a90('0x31')]);_0x4a8870['filters']=_[_0x2a90('0x32')](_0x4a8870['model'],_0x4a8870[_0x2a90('0x31')]);_0x27e2f0['attributes']=_['intersection'](_0x4a8870[_0x2a90('0x2f')],qs['fields'](_0x58a86d[_0x2a90('0x31')][_0x2a90('0x33')]));_0x27e2f0[_0x2a90('0x34')]=_0x27e2f0['attributes'][_0x2a90('0x35')]?_0x27e2f0[_0x2a90('0x34')]:_0x4a8870[_0x2a90('0x2f')];if(!_0x58a86d['query'][_0x2a90('0x36')](_0x2a90('0x37'))){_0x27e2f0[_0x2a90('0x27')]=qs['limit'](_0x58a86d[_0x2a90('0x31')][_0x2a90('0x27')]);_0x27e2f0['offset']=qs[_0x2a90('0x38')](_0x58a86d[_0x2a90('0x31')][_0x2a90('0x38')]);}_0x27e2f0[_0x2a90('0x39')]=qs[_0x2a90('0x3a')](_0x58a86d[_0x2a90('0x31')][_0x2a90('0x3a')]);_0x27e2f0[_0x2a90('0x3b')]=qs[_0x2a90('0x3c')](_[_0x2a90('0x3d')](_0x58a86d[_0x2a90('0x31')],_0x4a8870[_0x2a90('0x3c')]));if(_0x58a86d[_0x2a90('0x31')][_0x2a90('0x3e')]){_0x27e2f0['where']=_[_0x2a90('0x3f')](_0x27e2f0[_0x2a90('0x3b')],{'$or':_['map'](_0x1410eb,function(_0x1045bb){if(_0x1045bb[_0x2a90('0x40')][_0x2a90('0x41')]!==_0x2a90('0x42')){var _0x471f6a={};_0x471f6a[_0x1045bb['field']]={'$like':'%'+_0x58a86d[_0x2a90('0x31')]['filter']+'%'};return _0x471f6a;}})});}_0x27e2f0=_[_0x2a90('0x3f')]({},_0x27e2f0,_0x58a86d['options']);var _0x24c03b={'where':_0x27e2f0[_0x2a90('0x3b')]};return db[_0x2a90('0x43')][_0x2a90('0x26')](_0x24c03b)[_0x2a90('0x17')](function(_0x20c26b){_0x3e5002[_0x2a90('0x26')]=_0x20c26b;if(_0x58a86d['query']['includeAll']){_0x27e2f0[_0x2a90('0x44')]=[{'all':!![]}];}return db[_0x2a90('0x43')][_0x2a90('0x45')](_0x27e2f0);})[_0x2a90('0x17')](function(_0x1ae049){_0x3e5002[_0x2a90('0x46')]=_0x1ae049;return _0x3e5002;})[_0x2a90('0x17')](respondWithFilteredResult(_0x1bab1d,_0x27e2f0))[_0x2a90('0x47')](handleError(_0x1bab1d,null));};exports['show']=function(_0x368f3c,_0x502f48){var _0x3e0380={'raw':![],'where':{'id':_0x368f3c['params']['id']}},_0x44efec={};_0x44efec[_0x2a90('0x2f')]=_[_0x2a90('0x30')](db[_0x2a90('0x43')][_0x2a90('0x48')]);_0x44efec[_0x2a90('0x31')]=_[_0x2a90('0x30')](_0x368f3c[_0x2a90('0x31')]);_0x44efec['filters']=_['intersection'](_0x44efec[_0x2a90('0x2f')],_0x44efec[_0x2a90('0x31')]);_0x3e0380[_0x2a90('0x34')]=_[_0x2a90('0x32')](_0x44efec[_0x2a90('0x2f')],qs['fields'](_0x368f3c['query'][_0x2a90('0x33')]));_0x3e0380[_0x2a90('0x34')]=_0x3e0380['attributes']['length']?_0x3e0380['attributes']:_0x44efec[_0x2a90('0x2f')];if(_0x368f3c['query'][_0x2a90('0x49')]){_0x3e0380[_0x2a90('0x44')]=[{'all':!![]}];}_0x3e0380=_[_0x2a90('0x3f')]({},_0x3e0380,_0x368f3c[_0x2a90('0x4a')]);return db[_0x2a90('0x43')][_0x2a90('0x4b')](_0x3e0380)['then'](handleEntityNotFound(_0x502f48,null))[_0x2a90('0x17')](respondWithResult(_0x502f48,null))[_0x2a90('0x47')](handleError(_0x502f48,null));};exports['create']=function(_0x265769,_0x4d1303){return db['DeskConfiguration'][_0x2a90('0x4c')](_0x265769[_0x2a90('0x4d')],{})['then'](respondWithResult(_0x4d1303,0xc9))['catch'](handleError(_0x4d1303,null));};exports[_0x2a90('0x29')]=function(_0x5951eb,_0x273111){if(_0x5951eb[_0x2a90('0x4d')]['id']){delete _0x5951eb['body']['id'];}return db[_0x2a90('0x43')][_0x2a90('0x4b')]({'where':{'id':_0x5951eb[_0x2a90('0x4e')]['id']}})['then'](handleEntityNotFound(_0x273111,null))[_0x2a90('0x17')](saveUpdates(_0x5951eb[_0x2a90('0x4d')],null))['then'](respondWithResult(_0x273111,null))['catch'](handleError(_0x273111,null));};exports[_0x2a90('0x2a')]=function(_0x2172d4,_0x58f859){return db[_0x2a90('0x43')]['find']({'where':{'id':_0x2172d4[_0x2a90('0x4e')]['id']}})['then'](handleEntityNotFound(_0x58f859,null))[_0x2a90('0x17')](removeEntity(_0x58f859,null))[_0x2a90('0x47')](handleError(_0x58f859,null));};exports[_0x2a90('0x4f')]=function(_0x4c267b,_0x5ad248,_0x5a4515){var _0x27fde7={};var _0x37adad={};var _0x3793e5;var _0x469d3c;return db[_0x2a90('0x43')][_0x2a90('0x50')]({'where':{'id':_0x4c267b[_0x2a90('0x4e')]['id']}})[_0x2a90('0x17')](handleEntityNotFound(_0x5ad248,null))[_0x2a90('0x17')](function(_0x4f4dc6){if(_0x4f4dc6){_0x3793e5=_0x4f4dc6;_0x37adad[_0x2a90('0x2f')]=_[_0x2a90('0x30')](db[_0x2a90('0x51')]['rawAttributes']);_0x37adad['query']=_['keys'](_0x4c267b[_0x2a90('0x31')]);_0x37adad[_0x2a90('0x3c')]=_[_0x2a90('0x32')](_0x37adad[_0x2a90('0x2f')],_0x37adad[_0x2a90('0x31')]);_0x27fde7[_0x2a90('0x34')]=_[_0x2a90('0x32')](_0x37adad[_0x2a90('0x2f')],qs[_0x2a90('0x33')](_0x4c267b[_0x2a90('0x31')][_0x2a90('0x33')]));_0x27fde7[_0x2a90('0x34')]=_0x27fde7[_0x2a90('0x34')][_0x2a90('0x35')]?_0x27fde7[_0x2a90('0x34')]:_0x37adad[_0x2a90('0x2f')];_0x27fde7['order']=qs[_0x2a90('0x3a')](_0x4c267b['query'][_0x2a90('0x3a')]);_0x27fde7[_0x2a90('0x3b')]=qs[_0x2a90('0x3c')](_[_0x2a90('0x3d')](_0x4c267b[_0x2a90('0x31')],_0x37adad[_0x2a90('0x3c')]));if(_0x4c267b[_0x2a90('0x31')]['filter']){_0x27fde7[_0x2a90('0x3b')]=_[_0x2a90('0x3f')](_0x27fde7[_0x2a90('0x3b')],{'$or':_['map'](_0x27fde7[_0x2a90('0x34')],function(_0x3aa0d5){var _0x35c007={};_0x35c007[_0x3aa0d5]={'$like':'%'+_0x4c267b[_0x2a90('0x31')]['filter']+'%'};return _0x35c007;})});}_0x27fde7=_[_0x2a90('0x3f')]({},_0x27fde7,_0x4c267b['options']);return _0x3793e5[_0x2a90('0x4f')](_0x27fde7);}})[_0x2a90('0x17')](function(_0x368ec6){if(_0x368ec6){_0x469d3c=_0x368ec6[_0x2a90('0x35')];if(!_0x4c267b[_0x2a90('0x31')][_0x2a90('0x36')]('nolimit')){_0x27fde7[_0x2a90('0x27')]=qs[_0x2a90('0x27')](_0x4c267b[_0x2a90('0x31')][_0x2a90('0x27')]);_0x27fde7[_0x2a90('0x38')]=qs[_0x2a90('0x38')](_0x4c267b[_0x2a90('0x31')][_0x2a90('0x38')]);}return _0x3793e5[_0x2a90('0x4f')](_0x27fde7);}})['then'](function(_0xddf932){if(_0xddf932){return _0xddf932?{'count':_0x469d3c,'rows':_0xddf932}:null;}})[_0x2a90('0x17')](respondWithResult(_0x5ad248,null))[_0x2a90('0x47')](handleError(_0x5ad248,null));};exports['getSubjects']=function(_0x4404c1,_0xef2a3d,_0x4565c6){var _0x9030a1={};var _0x1fd54a={};var _0x4ce3ea;var _0x1bf94c;return db['DeskConfiguration']['findOne']({'where':{'id':_0x4404c1[_0x2a90('0x4e')]['id']}})['then'](handleEntityNotFound(_0xef2a3d,null))['then'](function(_0x3b24ee){if(_0x3b24ee){_0x4ce3ea=_0x3b24ee;_0x1fd54a['model']=_[_0x2a90('0x30')](db[_0x2a90('0x51')]['rawAttributes']);_0x1fd54a['query']=_[_0x2a90('0x30')](_0x4404c1['query']);_0x1fd54a['filters']=_[_0x2a90('0x32')](_0x1fd54a[_0x2a90('0x2f')],_0x1fd54a[_0x2a90('0x31')]);_0x9030a1[_0x2a90('0x34')]=_['intersection'](_0x1fd54a['model'],qs[_0x2a90('0x33')](_0x4404c1[_0x2a90('0x31')][_0x2a90('0x33')]));_0x9030a1[_0x2a90('0x34')]=_0x9030a1[_0x2a90('0x34')][_0x2a90('0x35')]?_0x9030a1[_0x2a90('0x34')]:_0x1fd54a[_0x2a90('0x2f')];_0x9030a1[_0x2a90('0x39')]=qs[_0x2a90('0x3a')](_0x4404c1[_0x2a90('0x31')][_0x2a90('0x3a')]);_0x9030a1['where']=qs[_0x2a90('0x3c')](_['pick'](_0x4404c1[_0x2a90('0x31')],_0x1fd54a['filters']));if(_0x4404c1[_0x2a90('0x31')]['filter']){_0x9030a1['where']=_[_0x2a90('0x3f')](_0x9030a1[_0x2a90('0x3b')],{'$or':_[_0x2a90('0x52')](_0x9030a1[_0x2a90('0x34')],function(_0x4a1c1f){var _0x5550d2={};_0x5550d2[_0x4a1c1f]={'$like':'%'+_0x4404c1[_0x2a90('0x31')][_0x2a90('0x3e')]+'%'};return _0x5550d2;})});}_0x9030a1=_[_0x2a90('0x3f')]({},_0x9030a1,_0x4404c1[_0x2a90('0x4a')]);return _0x4ce3ea[_0x2a90('0x53')](_0x9030a1);}})[_0x2a90('0x17')](function(_0xf7527e){if(_0xf7527e){_0x1bf94c=_0xf7527e[_0x2a90('0x35')];if(!_0x4404c1[_0x2a90('0x31')][_0x2a90('0x36')](_0x2a90('0x37'))){_0x9030a1[_0x2a90('0x27')]=qs['limit'](_0x4404c1[_0x2a90('0x31')][_0x2a90('0x27')]);_0x9030a1[_0x2a90('0x38')]=qs[_0x2a90('0x38')](_0x4404c1[_0x2a90('0x31')][_0x2a90('0x38')]);}return _0x4ce3ea[_0x2a90('0x53')](_0x9030a1);}})[_0x2a90('0x17')](function(_0x555159){if(_0x555159){return _0x555159?{'count':_0x1bf94c,'rows':_0x555159}:null;}})[_0x2a90('0x17')](respondWithResult(_0xef2a3d,null))[_0x2a90('0x47')](handleError(_0xef2a3d,null));};exports['getDescriptions']=function(_0x18be57,_0x77a107,_0x46e1d5){var _0xaf1b4a={};var _0x365c36={};var _0x16e9e7;var _0x4b4a47;return db[_0x2a90('0x43')][_0x2a90('0x50')]({'where':{'id':_0x18be57[_0x2a90('0x4e')]['id']}})[_0x2a90('0x17')](handleEntityNotFound(_0x77a107,null))[_0x2a90('0x17')](function(_0x3ff142){if(_0x3ff142){_0x16e9e7=_0x3ff142;_0x365c36[_0x2a90('0x2f')]=_[_0x2a90('0x30')](db['DeskField'][_0x2a90('0x48')]);_0x365c36[_0x2a90('0x31')]=_[_0x2a90('0x30')](_0x18be57[_0x2a90('0x31')]);_0x365c36[_0x2a90('0x3c')]=_[_0x2a90('0x32')](_0x365c36['model'],_0x365c36[_0x2a90('0x31')]);_0xaf1b4a[_0x2a90('0x34')]=_[_0x2a90('0x32')](_0x365c36['model'],qs[_0x2a90('0x33')](_0x18be57[_0x2a90('0x31')][_0x2a90('0x33')]));_0xaf1b4a['attributes']=_0xaf1b4a['attributes'][_0x2a90('0x35')]?_0xaf1b4a[_0x2a90('0x34')]:_0x365c36['model'];_0xaf1b4a[_0x2a90('0x39')]=qs[_0x2a90('0x3a')](_0x18be57['query'][_0x2a90('0x3a')]);_0xaf1b4a[_0x2a90('0x3b')]=qs['filters'](_[_0x2a90('0x3d')](_0x18be57[_0x2a90('0x31')],_0x365c36['filters']));if(_0x18be57['query'][_0x2a90('0x3e')]){_0xaf1b4a[_0x2a90('0x3b')]=_[_0x2a90('0x3f')](_0xaf1b4a[_0x2a90('0x3b')],{'$or':_[_0x2a90('0x52')](_0xaf1b4a[_0x2a90('0x34')],function(_0x14689d){var _0x12f722={};_0x12f722[_0x14689d]={'$like':'%'+_0x18be57[_0x2a90('0x31')][_0x2a90('0x3e')]+'%'};return _0x12f722;})});}_0xaf1b4a=_[_0x2a90('0x3f')]({},_0xaf1b4a,_0x18be57['options']);return _0x16e9e7[_0x2a90('0x54')](_0xaf1b4a);}})[_0x2a90('0x17')](function(_0x415b21){if(_0x415b21){_0x4b4a47=_0x415b21['length'];if(!_0x18be57[_0x2a90('0x31')][_0x2a90('0x36')](_0x2a90('0x37'))){_0xaf1b4a['limit']=qs[_0x2a90('0x27')](_0x18be57[_0x2a90('0x31')][_0x2a90('0x27')]);_0xaf1b4a[_0x2a90('0x38')]=qs[_0x2a90('0x38')](_0x18be57[_0x2a90('0x31')][_0x2a90('0x38')]);}return _0x16e9e7['getDescriptions'](_0xaf1b4a);}})['then'](function(_0x14fe23){if(_0x14fe23){return _0x14fe23?{'count':_0x4b4a47,'rows':_0x14fe23}:null;}})['then'](respondWithResult(_0x77a107,null))[_0x2a90('0x47')](handleError(_0x77a107,null));};exports[_0x2a90('0x55')]=function(_0x4ecf76,_0x156478,_0x34f233){var _0xa47128={};var _0x41df3f={};var _0x90338c;var _0x54d6fa;return db[_0x2a90('0x43')][_0x2a90('0x50')]({'where':{'id':_0x4ecf76[_0x2a90('0x4e')]['id']}})['then'](handleEntityNotFound(_0x156478,null))['then'](function(_0x1ab6df){if(_0x1ab6df){_0x90338c=_0x1ab6df;_0x41df3f[_0x2a90('0x2f')]=_[_0x2a90('0x30')](db[_0x2a90('0x56')][_0x2a90('0x48')]);_0x41df3f[_0x2a90('0x31')]=_[_0x2a90('0x30')](_0x4ecf76[_0x2a90('0x31')]);_0x41df3f[_0x2a90('0x3c')]=_[_0x2a90('0x32')](_0x41df3f[_0x2a90('0x2f')],_0x41df3f[_0x2a90('0x31')]);_0xa47128[_0x2a90('0x34')]=_[_0x2a90('0x32')](_0x41df3f[_0x2a90('0x2f')],qs[_0x2a90('0x33')](_0x4ecf76[_0x2a90('0x31')]['fields']));_0xa47128[_0x2a90('0x34')]=_0xa47128[_0x2a90('0x34')][_0x2a90('0x35')]?_0xa47128[_0x2a90('0x34')]:_0x41df3f['model'];_0xa47128[_0x2a90('0x39')]=qs[_0x2a90('0x3a')](_0x4ecf76[_0x2a90('0x31')]['sort']);_0xa47128[_0x2a90('0x3b')]=qs[_0x2a90('0x3c')](_[_0x2a90('0x3d')](_0x4ecf76[_0x2a90('0x31')],_0x41df3f[_0x2a90('0x3c')]));if(_0x4ecf76['query']['filter']){_0xa47128[_0x2a90('0x3b')]=_[_0x2a90('0x3f')](_0xa47128['where'],{'$or':_[_0x2a90('0x52')](_0xa47128[_0x2a90('0x34')],function(_0x32a924){var _0x45570b={};_0x45570b[_0x32a924]={'$like':'%'+_0x4ecf76[_0x2a90('0x31')][_0x2a90('0x3e')]+'%'};return _0x45570b;})});}_0xa47128=_[_0x2a90('0x3f')]({},_0xa47128,_0x4ecf76[_0x2a90('0x4a')]);return _0x90338c[_0x2a90('0x55')](_0xa47128);}})[_0x2a90('0x17')](function(_0x5c9a2d){if(_0x5c9a2d){_0x54d6fa=_0x5c9a2d[_0x2a90('0x35')];if(!_0x4ecf76[_0x2a90('0x31')][_0x2a90('0x36')](_0x2a90('0x37'))){_0xa47128[_0x2a90('0x27')]=qs[_0x2a90('0x27')](_0x4ecf76[_0x2a90('0x31')][_0x2a90('0x27')]);_0xa47128[_0x2a90('0x38')]=qs[_0x2a90('0x38')](_0x4ecf76['query'][_0x2a90('0x38')]);}return _0x90338c[_0x2a90('0x55')](_0xa47128);}})[_0x2a90('0x17')](function(_0x4f8c5e){if(_0x4f8c5e){return _0x4f8c5e?{'count':_0x54d6fa,'rows':_0x4f8c5e}:null;}})[_0x2a90('0x17')](respondWithResult(_0x156478,null))[_0x2a90('0x47')](handleError(_0x156478,null));};exports[_0x2a90('0x57')]=function(_0x15ed31,_0x1230ee,_0x54934e){if(_0x15ed31['body']['id']){delete _0x15ed31['body']['id'];}return db[_0x2a90('0x43')][_0x2a90('0x50')]({'where':{'id':_0x15ed31[_0x2a90('0x4e')]['id']}})[_0x2a90('0x17')](handleEntityNotFound(_0x1230ee,null))[_0x2a90('0x17')](function(_0x29c51f){if(_0x29c51f){return _0x29c51f[_0x2a90('0x57')](_0x15ed31[_0x2a90('0x4d')]['ids']||[]);}return null;})[_0x2a90('0x17')](respondWithResult(_0x1230ee,null))[_0x2a90('0x47')](handleError(_0x1230ee,null));}; \ No newline at end of file +var _0x2750=['where','pick','filter','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','getFields','findOne','DeskField','map','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','message','DeskConfiguration,\x20%s,\x20%s','result','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','stack','name','send','index','DeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x2fa771,_0x511aec){var _0x8f89c2=function(_0x376db1){while(--_0x376db1){_0x2fa771['push'](_0x2fa771['shift']());}};_0x8f89c2(++_0x511aec);}(_0x2750,0x13b));var _0x0275=function(_0x30917b,_0x11840d){_0x30917b=_0x30917b-0x0;var _0x3a14fd=_0x2750[_0x30917b];return _0x3a14fd;};'use strict';var pdf=require(_0x0275('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0275('0x1'));var zipdir=require(_0x0275('0x2'));var jsonpatch=require(_0x0275('0x3'));var rp=require(_0x0275('0x4'));var moment=require(_0x0275('0x5'));var BPromise=require(_0x0275('0x6'));var Mustache=require(_0x0275('0x7'));var util=require(_0x0275('0x8'));var path=require(_0x0275('0x9'));var sox=require(_0x0275('0xa'));var csv=require('to-csv');var ejs=require(_0x0275('0xb'));var fs=require('fs');var _=require(_0x0275('0xc'));var squel=require(_0x0275('0xd'));var crypto=require(_0x0275('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0275('0xf'));var toCsv=require(_0x0275('0x10'));var querystring=require(_0x0275('0x11'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x0275('0x12'));var Redis=require('ioredis');var qs=require(_0x0275('0x13'));var logger=require(_0x0275('0x14'))(_0x0275('0x15'));var utils=require(_0x0275('0x16'));var config=require(_0x0275('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0275('0x18'));var client=jayson[_0x0275('0x19')][_0x0275('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4c6ee0,_0x55ffd6,_0x292f93,_0x395398){return new BPromise(function(_0x37f809,_0x46a729){var _0x28827b=_0x395398||client;return _0x28827b[_0x0275('0x1b')](_0x4c6ee0,_0x292f93)['then'](function(_0x3e0791){logger[_0x0275('0x1c')]('DeskConfiguration,\x20%s,\x20%s',_0x55ffd6,_0x0275('0x1d'));logger[_0x0275('0x1e')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x55ffd6,_0x0275('0x1d'),JSON[_0x0275('0x1f')](_0x3e0791));if(_0x3e0791['error']){if(_0x3e0791['error']['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x55ffd6,_0x3e0791[_0x0275('0x20')][_0x0275('0x21')]);return _0x46a729(_0x3e0791[_0x0275('0x20')]['message']);}logger[_0x0275('0x20')](_0x0275('0x22'),_0x55ffd6,_0x3e0791[_0x0275('0x20')]['message']);return _0x37f809(_0x3e0791[_0x0275('0x20')][_0x0275('0x21')]);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x55ffd6,_0x0275('0x1d'));_0x37f809(_0x3e0791[_0x0275('0x23')][_0x0275('0x21')]);}})['catch'](function(_0xf3b68e){logger['error'](_0x0275('0x22'),_0x55ffd6,_0xf3b68e);_0x46a729(_0xf3b68e);});});}function respondWithStatusCode(_0x5c75f1,_0x26f2c2){_0x26f2c2=_0x26f2c2||0xcc;return function(_0xfa0081){if(_0xfa0081){return _0x5c75f1['sendStatus'](_0x26f2c2);}return _0x5c75f1[_0x0275('0x24')](_0x26f2c2)[_0x0275('0x25')]();};}function respondWithResult(_0x2e3605,_0x52946b){_0x52946b=_0x52946b||0xc8;return function(_0x2552bc){if(_0x2552bc){return _0x2e3605[_0x0275('0x24')](_0x52946b)[_0x0275('0x26')](_0x2552bc);}};}function respondWithFilteredResult(_0x15813f,_0x1a2024){return function(_0x437752){if(_0x437752){var _0x56f26c=_0x437752[_0x0275('0x27')],_0x35343c=_0x1a2024[_0x0275('0x28')],_0x14d7d8=_0x1a2024['offset']+_0x1a2024[_0x0275('0x29')],_0x1d24b2;if(_0x14d7d8>=_0x56f26c){_0x14d7d8=_0x56f26c;_0x1d24b2=0xc8;}else{_0x1d24b2=0xce;}_0x15813f[_0x0275('0x24')](_0x1d24b2);return _0x15813f[_0x0275('0x2a')](_0x0275('0x2b'),_0x35343c+'-'+_0x14d7d8+'/'+_0x56f26c)[_0x0275('0x26')](_0x437752);}return null;};}function patchUpdates(_0x49e645){return function(_0x2d49b4){try{jsonpatch[_0x0275('0x2c')](_0x2d49b4,_0x49e645,!![]);}catch(_0x127bbd){return BPromise['reject'](_0x127bbd);}return _0x2d49b4['save']();};}function saveUpdates(_0x3cb2d7,_0x299190){return function(_0x5dc2bc){if(_0x5dc2bc){return _0x5dc2bc[_0x0275('0x2d')](_0x3cb2d7)[_0x0275('0x2e')](function(_0x4378dd){return _0x4378dd;});}return null;};}function removeEntity(_0x4111fa,_0x5d763d){return function(_0x24c762){if(_0x24c762){return _0x24c762[_0x0275('0x2f')]()[_0x0275('0x2e')](function(){_0x4111fa[_0x0275('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x134f12,_0x55198e){return function(_0x2cc5df){if(!_0x2cc5df){_0x134f12['sendStatus'](0x194);}return _0x2cc5df;};}function handleError(_0x26aae0,_0x165157){_0x165157=_0x165157||0x1f4;return function(_0x56b568){logger[_0x0275('0x20')](_0x56b568[_0x0275('0x30')]);if(_0x56b568[_0x0275('0x31')]){delete _0x56b568[_0x0275('0x31')];}_0x26aae0['status'](_0x165157)[_0x0275('0x32')](_0x56b568);};}exports[_0x0275('0x33')]=function(_0xbe4741,_0x1d872a){var _0x3383c3={},_0x58e3f3={},_0x2a18c3={'count':0x0,'rows':[]};var _0x2ad334=db[_0x0275('0x34')][_0x0275('0x35')];_0x58e3f3[_0x0275('0x36')]=_[_0x0275('0x37')](_0x2ad334);_0x58e3f3[_0x0275('0x38')]=_[_0x0275('0x37')](_0xbe4741[_0x0275('0x38')]);_0x58e3f3[_0x0275('0x39')]=_[_0x0275('0x3a')](_0x58e3f3['model'],_0x58e3f3[_0x0275('0x38')]);_0x3383c3[_0x0275('0x3b')]=_[_0x0275('0x3a')](_0x58e3f3[_0x0275('0x36')],qs[_0x0275('0x3c')](_0xbe4741[_0x0275('0x38')][_0x0275('0x3c')]));_0x3383c3[_0x0275('0x3b')]=_0x3383c3[_0x0275('0x3b')][_0x0275('0x3d')]?_0x3383c3[_0x0275('0x3b')]:_0x58e3f3[_0x0275('0x36')];if(!_0xbe4741[_0x0275('0x38')][_0x0275('0x3e')]('nolimit')){_0x3383c3[_0x0275('0x29')]=qs[_0x0275('0x29')](_0xbe4741['query'][_0x0275('0x29')]);_0x3383c3[_0x0275('0x28')]=qs[_0x0275('0x28')](_0xbe4741[_0x0275('0x38')][_0x0275('0x28')]);}_0x3383c3[_0x0275('0x3f')]=qs[_0x0275('0x40')](_0xbe4741['query'][_0x0275('0x40')]);_0x3383c3[_0x0275('0x41')]=qs[_0x0275('0x39')](_[_0x0275('0x42')](_0xbe4741['query'],_0x58e3f3[_0x0275('0x39')]));if(_0xbe4741[_0x0275('0x38')][_0x0275('0x43')]){_0x3383c3[_0x0275('0x41')]=_['merge'](_0x3383c3[_0x0275('0x41')],{'$or':_['map'](_0x2ad334,function(_0x261e66){if(_0x261e66[_0x0275('0x44')][_0x0275('0x45')]!==_0x0275('0x46')){var _0x51199b={};_0x51199b[_0x261e66[_0x0275('0x47')]]={'$like':'%'+_0xbe4741[_0x0275('0x38')]['filter']+'%'};return _0x51199b;}})});}_0x3383c3=_[_0x0275('0x48')]({},_0x3383c3,_0xbe4741[_0x0275('0x49')]);var _0x12ec31={'where':_0x3383c3['where']};return db[_0x0275('0x34')][_0x0275('0x27')](_0x12ec31)['then'](function(_0x1da178){_0x2a18c3[_0x0275('0x27')]=_0x1da178;if(_0xbe4741[_0x0275('0x38')][_0x0275('0x4a')]){_0x3383c3[_0x0275('0x4b')]=[{'all':!![]}];}return db[_0x0275('0x34')][_0x0275('0x4c')](_0x3383c3);})[_0x0275('0x2e')](function(_0xb15d65){_0x2a18c3[_0x0275('0x4d')]=_0xb15d65;return _0x2a18c3;})[_0x0275('0x2e')](respondWithFilteredResult(_0x1d872a,_0x3383c3))['catch'](handleError(_0x1d872a,null));};exports[_0x0275('0x4e')]=function(_0x123dd4,_0x350465){var _0x33617b={'raw':![],'where':{'id':_0x123dd4[_0x0275('0x4f')]['id']}},_0x29633c={};_0x29633c[_0x0275('0x36')]=_[_0x0275('0x37')](db[_0x0275('0x34')][_0x0275('0x35')]);_0x29633c[_0x0275('0x38')]=_['keys'](_0x123dd4['query']);_0x29633c[_0x0275('0x39')]=_[_0x0275('0x3a')](_0x29633c[_0x0275('0x36')],_0x29633c[_0x0275('0x38')]);_0x33617b[_0x0275('0x3b')]=_['intersection'](_0x29633c[_0x0275('0x36')],qs['fields'](_0x123dd4[_0x0275('0x38')][_0x0275('0x3c')]));_0x33617b[_0x0275('0x3b')]=_0x33617b[_0x0275('0x3b')]['length']?_0x33617b[_0x0275('0x3b')]:_0x29633c['model'];if(_0x123dd4['query']['includeAll']){_0x33617b[_0x0275('0x4b')]=[{'all':!![]}];}_0x33617b=_['merge']({},_0x33617b,_0x123dd4[_0x0275('0x49')]);return db[_0x0275('0x34')][_0x0275('0x50')](_0x33617b)[_0x0275('0x2e')](handleEntityNotFound(_0x350465,null))[_0x0275('0x2e')](respondWithResult(_0x350465,null))[_0x0275('0x51')](handleError(_0x350465,null));};exports[_0x0275('0x52')]=function(_0x591bfd,_0xe6f266){return db['DeskConfiguration'][_0x0275('0x52')](_0x591bfd[_0x0275('0x53')],{})[_0x0275('0x2e')](respondWithResult(_0xe6f266,0xc9))[_0x0275('0x51')](handleError(_0xe6f266,null));};exports[_0x0275('0x2d')]=function(_0x4097e8,_0x78dc83){if(_0x4097e8[_0x0275('0x53')]['id']){delete _0x4097e8[_0x0275('0x53')]['id'];}return db[_0x0275('0x34')]['find']({'where':{'id':_0x4097e8['params']['id']}})[_0x0275('0x2e')](handleEntityNotFound(_0x78dc83,null))['then'](saveUpdates(_0x4097e8['body'],null))[_0x0275('0x2e')](respondWithResult(_0x78dc83,null))[_0x0275('0x51')](handleError(_0x78dc83,null));};exports[_0x0275('0x2f')]=function(_0x39961c,_0x35994c){return db[_0x0275('0x34')]['find']({'where':{'id':_0x39961c[_0x0275('0x4f')]['id']}})[_0x0275('0x2e')](handleEntityNotFound(_0x35994c,null))[_0x0275('0x2e')](removeEntity(_0x35994c,null))[_0x0275('0x51')](handleError(_0x35994c,null));};exports[_0x0275('0x54')]=function(_0x1ec297,_0x5db4ad,_0x33556f){var _0x1b516f={};var _0x569608={};var _0x19d33f;var _0x5c588d;return db[_0x0275('0x34')][_0x0275('0x55')]({'where':{'id':_0x1ec297[_0x0275('0x4f')]['id']}})[_0x0275('0x2e')](handleEntityNotFound(_0x5db4ad,null))[_0x0275('0x2e')](function(_0x7749c4){if(_0x7749c4){_0x19d33f=_0x7749c4;_0x569608[_0x0275('0x36')]=_[_0x0275('0x37')](db[_0x0275('0x56')][_0x0275('0x35')]);_0x569608[_0x0275('0x38')]=_['keys'](_0x1ec297[_0x0275('0x38')]);_0x569608[_0x0275('0x39')]=_[_0x0275('0x3a')](_0x569608['model'],_0x569608[_0x0275('0x38')]);_0x1b516f[_0x0275('0x3b')]=_['intersection'](_0x569608[_0x0275('0x36')],qs['fields'](_0x1ec297[_0x0275('0x38')][_0x0275('0x3c')]));_0x1b516f[_0x0275('0x3b')]=_0x1b516f[_0x0275('0x3b')]['length']?_0x1b516f[_0x0275('0x3b')]:_0x569608[_0x0275('0x36')];_0x1b516f[_0x0275('0x3f')]=qs[_0x0275('0x40')](_0x1ec297['query'][_0x0275('0x40')]);_0x1b516f[_0x0275('0x41')]=qs['filters'](_[_0x0275('0x42')](_0x1ec297[_0x0275('0x38')],_0x569608['filters']));if(_0x1ec297['query'][_0x0275('0x43')]){_0x1b516f[_0x0275('0x41')]=_['merge'](_0x1b516f['where'],{'$or':_[_0x0275('0x57')](_0x1b516f[_0x0275('0x3b')],function(_0x93831b){var _0x14b5ab={};_0x14b5ab[_0x93831b]={'$like':'%'+_0x1ec297[_0x0275('0x38')][_0x0275('0x43')]+'%'};return _0x14b5ab;})});}_0x1b516f=_[_0x0275('0x48')]({},_0x1b516f,_0x1ec297[_0x0275('0x49')]);return _0x19d33f['getFields'](_0x1b516f);}})[_0x0275('0x2e')](function(_0x115753){if(_0x115753){_0x5c588d=_0x115753[_0x0275('0x3d')];if(!_0x1ec297[_0x0275('0x38')][_0x0275('0x3e')](_0x0275('0x58'))){_0x1b516f['limit']=qs[_0x0275('0x29')](_0x1ec297['query'][_0x0275('0x29')]);_0x1b516f[_0x0275('0x28')]=qs[_0x0275('0x28')](_0x1ec297[_0x0275('0x38')]['offset']);}return _0x19d33f[_0x0275('0x54')](_0x1b516f);}})[_0x0275('0x2e')](function(_0x2fb691){if(_0x2fb691){return _0x2fb691?{'count':_0x5c588d,'rows':_0x2fb691}:null;}})[_0x0275('0x2e')](respondWithResult(_0x5db4ad,null))[_0x0275('0x51')](handleError(_0x5db4ad,null));};exports[_0x0275('0x59')]=function(_0x3c7845,_0xea9c40,_0x155fd9){var _0x49d39c={};var _0x5bc165={};var _0x4c25e9;var _0x1dcaa6;return db[_0x0275('0x34')][_0x0275('0x55')]({'where':{'id':_0x3c7845['params']['id']}})[_0x0275('0x2e')](handleEntityNotFound(_0xea9c40,null))[_0x0275('0x2e')](function(_0x2e7b7e){if(_0x2e7b7e){_0x4c25e9=_0x2e7b7e;_0x5bc165[_0x0275('0x36')]=_[_0x0275('0x37')](db['DeskField'][_0x0275('0x35')]);_0x5bc165['query']=_[_0x0275('0x37')](_0x3c7845[_0x0275('0x38')]);_0x5bc165[_0x0275('0x39')]=_[_0x0275('0x3a')](_0x5bc165['model'],_0x5bc165[_0x0275('0x38')]);_0x49d39c[_0x0275('0x3b')]=_[_0x0275('0x3a')](_0x5bc165['model'],qs[_0x0275('0x3c')](_0x3c7845[_0x0275('0x38')][_0x0275('0x3c')]));_0x49d39c[_0x0275('0x3b')]=_0x49d39c[_0x0275('0x3b')][_0x0275('0x3d')]?_0x49d39c[_0x0275('0x3b')]:_0x5bc165[_0x0275('0x36')];_0x49d39c['order']=qs['sort'](_0x3c7845['query'][_0x0275('0x40')]);_0x49d39c[_0x0275('0x41')]=qs[_0x0275('0x39')](_[_0x0275('0x42')](_0x3c7845[_0x0275('0x38')],_0x5bc165['filters']));if(_0x3c7845[_0x0275('0x38')]['filter']){_0x49d39c['where']=_[_0x0275('0x48')](_0x49d39c['where'],{'$or':_[_0x0275('0x57')](_0x49d39c[_0x0275('0x3b')],function(_0x1fc777){var _0x34f4b8={};_0x34f4b8[_0x1fc777]={'$like':'%'+_0x3c7845[_0x0275('0x38')][_0x0275('0x43')]+'%'};return _0x34f4b8;})});}_0x49d39c=_[_0x0275('0x48')]({},_0x49d39c,_0x3c7845[_0x0275('0x49')]);return _0x4c25e9[_0x0275('0x59')](_0x49d39c);}})[_0x0275('0x2e')](function(_0x2b8909){if(_0x2b8909){_0x1dcaa6=_0x2b8909[_0x0275('0x3d')];if(!_0x3c7845[_0x0275('0x38')][_0x0275('0x3e')](_0x0275('0x58'))){_0x49d39c[_0x0275('0x29')]=qs[_0x0275('0x29')](_0x3c7845[_0x0275('0x38')][_0x0275('0x29')]);_0x49d39c[_0x0275('0x28')]=qs[_0x0275('0x28')](_0x3c7845['query'][_0x0275('0x28')]);}return _0x4c25e9[_0x0275('0x59')](_0x49d39c);}})[_0x0275('0x2e')](function(_0x1a9540){if(_0x1a9540){return _0x1a9540?{'count':_0x1dcaa6,'rows':_0x1a9540}:null;}})[_0x0275('0x2e')](respondWithResult(_0xea9c40,null))[_0x0275('0x51')](handleError(_0xea9c40,null));};exports['getDescriptions']=function(_0x1a2ac3,_0x9476a7,_0x52e15b){var _0x14ca33={};var _0x111c75={};var _0x236039;var _0x17d994;return db['DeskConfiguration'][_0x0275('0x55')]({'where':{'id':_0x1a2ac3[_0x0275('0x4f')]['id']}})['then'](handleEntityNotFound(_0x9476a7,null))[_0x0275('0x2e')](function(_0x49a1e8){if(_0x49a1e8){_0x236039=_0x49a1e8;_0x111c75[_0x0275('0x36')]=_[_0x0275('0x37')](db['DeskField'][_0x0275('0x35')]);_0x111c75[_0x0275('0x38')]=_[_0x0275('0x37')](_0x1a2ac3[_0x0275('0x38')]);_0x111c75[_0x0275('0x39')]=_[_0x0275('0x3a')](_0x111c75[_0x0275('0x36')],_0x111c75['query']);_0x14ca33[_0x0275('0x3b')]=_[_0x0275('0x3a')](_0x111c75['model'],qs[_0x0275('0x3c')](_0x1a2ac3['query']['fields']));_0x14ca33[_0x0275('0x3b')]=_0x14ca33['attributes'][_0x0275('0x3d')]?_0x14ca33[_0x0275('0x3b')]:_0x111c75['model'];_0x14ca33[_0x0275('0x3f')]=qs[_0x0275('0x40')](_0x1a2ac3[_0x0275('0x38')]['sort']);_0x14ca33[_0x0275('0x41')]=qs['filters'](_[_0x0275('0x42')](_0x1a2ac3[_0x0275('0x38')],_0x111c75[_0x0275('0x39')]));if(_0x1a2ac3['query'][_0x0275('0x43')]){_0x14ca33[_0x0275('0x41')]=_[_0x0275('0x48')](_0x14ca33[_0x0275('0x41')],{'$or':_[_0x0275('0x57')](_0x14ca33[_0x0275('0x3b')],function(_0x5393aa){var _0x1d6a76={};_0x1d6a76[_0x5393aa]={'$like':'%'+_0x1a2ac3[_0x0275('0x38')][_0x0275('0x43')]+'%'};return _0x1d6a76;})});}_0x14ca33=_['merge']({},_0x14ca33,_0x1a2ac3[_0x0275('0x49')]);return _0x236039[_0x0275('0x5a')](_0x14ca33);}})[_0x0275('0x2e')](function(_0x53d371){if(_0x53d371){_0x17d994=_0x53d371[_0x0275('0x3d')];if(!_0x1a2ac3[_0x0275('0x38')][_0x0275('0x3e')]('nolimit')){_0x14ca33[_0x0275('0x29')]=qs[_0x0275('0x29')](_0x1a2ac3[_0x0275('0x38')][_0x0275('0x29')]);_0x14ca33[_0x0275('0x28')]=qs[_0x0275('0x28')](_0x1a2ac3[_0x0275('0x38')]['offset']);}return _0x236039['getDescriptions'](_0x14ca33);}})[_0x0275('0x2e')](function(_0x359ccc){if(_0x359ccc){return _0x359ccc?{'count':_0x17d994,'rows':_0x359ccc}:null;}})[_0x0275('0x2e')](respondWithResult(_0x9476a7,null))[_0x0275('0x51')](handleError(_0x9476a7,null));};exports[_0x0275('0x5b')]=function(_0x33064f,_0x2a42a0,_0x47fe2b){var _0x16f14c={};var _0x82548c={};var _0x5498d2;var _0x1b772d;return db['DeskConfiguration'][_0x0275('0x55')]({'where':{'id':_0x33064f[_0x0275('0x4f')]['id']}})[_0x0275('0x2e')](handleEntityNotFound(_0x2a42a0,null))[_0x0275('0x2e')](function(_0x2cbfbc){if(_0x2cbfbc){_0x5498d2=_0x2cbfbc;_0x82548c[_0x0275('0x36')]=_['keys'](db[_0x0275('0x5c')][_0x0275('0x35')]);_0x82548c[_0x0275('0x38')]=_[_0x0275('0x37')](_0x33064f[_0x0275('0x38')]);_0x82548c[_0x0275('0x39')]=_['intersection'](_0x82548c[_0x0275('0x36')],_0x82548c[_0x0275('0x38')]);_0x16f14c[_0x0275('0x3b')]=_[_0x0275('0x3a')](_0x82548c[_0x0275('0x36')],qs['fields'](_0x33064f[_0x0275('0x38')]['fields']));_0x16f14c[_0x0275('0x3b')]=_0x16f14c[_0x0275('0x3b')][_0x0275('0x3d')]?_0x16f14c[_0x0275('0x3b')]:_0x82548c[_0x0275('0x36')];_0x16f14c[_0x0275('0x3f')]=qs[_0x0275('0x40')](_0x33064f[_0x0275('0x38')][_0x0275('0x40')]);_0x16f14c[_0x0275('0x41')]=qs['filters'](_[_0x0275('0x42')](_0x33064f[_0x0275('0x38')],_0x82548c['filters']));if(_0x33064f[_0x0275('0x38')][_0x0275('0x43')]){_0x16f14c['where']=_[_0x0275('0x48')](_0x16f14c['where'],{'$or':_[_0x0275('0x57')](_0x16f14c[_0x0275('0x3b')],function(_0x1cbc90){var _0x194e4c={};_0x194e4c[_0x1cbc90]={'$like':'%'+_0x33064f[_0x0275('0x38')][_0x0275('0x43')]+'%'};return _0x194e4c;})});}_0x16f14c=_['merge']({},_0x16f14c,_0x33064f[_0x0275('0x49')]);return _0x5498d2[_0x0275('0x5b')](_0x16f14c);}})[_0x0275('0x2e')](function(_0x4afb2b){if(_0x4afb2b){_0x1b772d=_0x4afb2b[_0x0275('0x3d')];if(!_0x33064f[_0x0275('0x38')][_0x0275('0x3e')](_0x0275('0x58'))){_0x16f14c['limit']=qs[_0x0275('0x29')](_0x33064f[_0x0275('0x38')][_0x0275('0x29')]);_0x16f14c[_0x0275('0x28')]=qs[_0x0275('0x28')](_0x33064f['query'][_0x0275('0x28')]);}return _0x5498d2[_0x0275('0x5b')](_0x16f14c);}})[_0x0275('0x2e')](function(_0x2efda2){if(_0x2efda2){return _0x2efda2?{'count':_0x1b772d,'rows':_0x2efda2}:null;}})[_0x0275('0x2e')](respondWithResult(_0x2a42a0,null))[_0x0275('0x51')](handleError(_0x2a42a0,null));};exports[_0x0275('0x5d')]=function(_0x42dd4b,_0x64ed4a,_0x2d0ee9){if(_0x42dd4b['body']['id']){delete _0x42dd4b[_0x0275('0x53')]['id'];}return db[_0x0275('0x34')][_0x0275('0x55')]({'where':{'id':_0x42dd4b[_0x0275('0x4f')]['id']}})[_0x0275('0x2e')](handleEntityNotFound(_0x64ed4a,null))[_0x0275('0x2e')](function(_0x4335ec){if(_0x4335ec){return _0x4335ec[_0x0275('0x5d')](_0x42dd4b[_0x0275('0x53')][_0x0275('0x5e')]||[]);}return null;})[_0x0275('0x2e')](respondWithResult(_0x64ed4a,null))[_0x0275('0x51')](handleError(_0x64ed4a,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 6612db1..07ca128 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 _0x955f=['moment','request-promise','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api'];(function(_0x227cfb,_0x4f42cf){var _0x131407=function(_0x37ddbb){while(--_0x37ddbb){_0x227cfb['push'](_0x227cfb['shift']());}};_0x131407(++_0x4f42cf);}(_0x955f,0x1eb));var _0xf955=function(_0x207eeb,_0x248bc3){_0x207eeb=_0x207eeb-0x0;var _0x342b10=_0x955f[_0x207eeb];return _0x342b10;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var logger=require(_0xf955('0x2'))(_0xf955('0x3'));var moment=require(_0xf955('0x4'));var BPromise=require('bluebird');var rp=require(_0xf955('0x5'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x1db0dd,_0x5a20bc){return _0x1db0dd[_0xf955('0x6')](_0xf955('0x7'),attributes,{'tableName':_0xf955('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c00=['DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','moment','request-promise','./intDeskConfiguration.attributes','exports','define'];(function(_0x11ca72,_0x2466c4){var _0x50263a=function(_0x1009e2){while(--_0x1009e2){_0x11ca72['push'](_0x11ca72['shift']());}};_0x50263a(++_0x2466c4);}(_0x5c00,0x17e));var _0x05c0=function(_0xe09d0,_0x1e55d0){_0xe09d0=_0xe09d0-0x0;var _0x44ad05=_0x5c00[_0xe09d0];return _0x44ad05;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var logger=require(_0x05c0('0x2'))('api');var moment=require(_0x05c0('0x3'));var BPromise=require('bluebird');var rp=require(_0x05c0('0x4'));var attributes=require(_0x05c0('0x5'));module[_0x05c0('0x6')]=function(_0x28d9c7,_0x565efc){return _0x28d9c7[_0x05c0('0x7')](_0x05c0('0x8'),attributes,{'tableName':_0x05c0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 1554488..d97e41a 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 _0x326f=['info','DeskConfiguration,\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(_0x510695,_0x35eadd){var _0x3ff8d9=function(_0x1fdce6){while(--_0x1fdce6){_0x510695['push'](_0x510695['shift']());}};_0x3ff8d9(++_0x35eadd);}(_0x326f,0xd1));var _0xf326=function(_0x3b2315,_0x398fe8){_0x3b2315=_0x3b2315-0x0;var _0x32b7e5=_0x326f[_0x3b2315];return _0x32b7e5;};'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')]('DeskConfiguration,\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')]('DeskConfiguration,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x4737ab,_0x583ebf){var _0x380c2c=function(_0x372f93){while(--_0x372f93){_0x4737ab['push'](_0x4737ab['shift']());}};_0x380c2c(++_0x583ebf);}(_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')]('DeskConfiguration,\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/intDeskField/index.js b/server/api/intDeskField/index.js index c46c67f..1c94a9c 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 _0x583d=['get','/:id','create','update','delete','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated'];(function(_0x21eb98,_0x11bfc5){var _0x539df6=function(_0x5c4c4e){while(--_0x5c4c4e){_0x21eb98['push'](_0x21eb98['shift']());}};_0x539df6(++_0x11bfc5);}(_0x583d,0x161));var _0xd583=function(_0x273129,_0x36b2ff){_0x273129=_0x273129-0x0;var _0x5a8a5c=_0x583d[_0x273129];return _0x5a8a5c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd583('0x0'));var express=require(_0xd583('0x1'));var router=express[_0xd583('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xd583('0x3'));var config=require(_0xd583('0x4'));var controller=require(_0xd583('0x5'));router['get']('/',auth[_0xd583('0x6')](),controller['index']);router[_0xd583('0x7')](_0xd583('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xd583('0x9')]);router['put'](_0xd583('0x8'),auth[_0xd583('0x6')](),controller[_0xd583('0xa')]);router[_0xd583('0xb')](_0xd583('0x8'),auth[_0xd583('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe31a=['update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x1eda3b,_0x4d954d){var _0x526ec6=function(_0x3ca7bd){while(--_0x3ca7bd){_0x1eda3b['push'](_0x1eda3b['shift']());}};_0x526ec6(++_0x4d954d);}(_0xe31a,0xdb));var _0xae31=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xe31a[_0x4b7895];return _0x264180;};'use strict';var multer=require(_0xae31('0x0'));var util=require(_0xae31('0x1'));var path=require(_0xae31('0x2'));var timeout=require('connect-timeout');var express=require(_0xae31('0x3'));var router=express['Router']();var auth=require(_0xae31('0x4'));var interaction=require(_0xae31('0x5'));var config=require(_0xae31('0x6'));var controller=require(_0xae31('0x7'));router[_0xae31('0x8')]('/',auth[_0xae31('0x9')](),controller[_0xae31('0xa')]);router[_0xae31('0x8')](_0xae31('0xb'),auth[_0xae31('0x9')](),controller[_0xae31('0xc')]);router[_0xae31('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xae31('0xe')]('/:id',auth[_0xae31('0x9')](),controller[_0xae31('0xf')]);router[_0xae31('0x10')](_0xae31('0xb'),auth['isAuthenticated'](),controller[_0xae31('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index c0cc0a5..e189b2e 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 _0xb7e7=['customVariable','BOOLEAN','sequelize','ENUM','variable','keyValue','STRING'];(function(_0x544136,_0x1313be){var _0x2cc8a1=function(_0x10241d){while(--_0x10241d){_0x544136['push'](_0x544136['shift']());}};_0x2cc8a1(++_0x1313be);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xb7e7[_0x2ec461];return _0x28603d;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'type':{'type':Sequelize[_0x7b7e('0x1')]('string',_0x7b7e('0x2'),'customVariable',_0x7b7e('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7b7e('0x4')]},'key':{'type':Sequelize[_0x7b7e('0x4')]},'keyType':{'type':Sequelize[_0x7b7e('0x1')]('string','variable',_0x7b7e('0x5'))},'keyContent':{'type':Sequelize[_0x7b7e('0x4')]},'idField':{'type':Sequelize[_0x7b7e('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7b7e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7b7e('0x4')]}}; \ No newline at end of file +var _0xee5b=['keyValue','STRING','variable','sequelize','ENUM','string','customVariable'];(function(_0x22d05d,_0x16b544){var _0x366fc2=function(_0x543ad5){while(--_0x543ad5){_0x22d05d['push'](_0x22d05d['shift']());}};_0x366fc2(++_0x16b544);}(_0xee5b,0x1f4));var _0xbee5=function(_0x485dbf,_0x122d63){_0x485dbf=_0x485dbf-0x0;var _0x22a771=_0xee5b[_0x485dbf];return _0x22a771;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'type':{'type':Sequelize[_0xbee5('0x1')](_0xbee5('0x2'),'variable',_0xbee5('0x3'),_0xbee5('0x4')),'defaultValue':_0xbee5('0x2')},'content':{'type':Sequelize[_0xbee5('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xbee5('0x2'),_0xbee5('0x6'),_0xbee5('0x3'))},'keyContent':{'type':Sequelize[_0xbee5('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 61afea3..ae9b01f 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 _0x70e0=['error','name','send','index','DeskField','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','offset','sort','where','filter','merge','map','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end'];(function(_0x324645,_0xdc9c60){var _0x518909=function(_0x48a9f9){while(--_0x48a9f9){_0x324645['push'](_0x324645['shift']());}};_0x518909(++_0xdc9c60);}(_0x70e0,0x17b));var _0x070e=function(_0x1a9dc0,_0x506302){_0x1a9dc0=_0x1a9dc0-0x0;var _0x9219a=_0x70e0[_0x1a9dc0];return _0x9219a;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var authService=require(_0x070e('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x070e('0xf'));var logger=require(_0x070e('0x10'))(_0x070e('0x11'));var utils=require(_0x070e('0x12'));var config=require(_0x070e('0x13'));var db=require(_0x070e('0x14'))['db'];function respondWithStatusCode(_0x25cfe1,_0x1baa12){_0x1baa12=_0x1baa12||0xcc;return function(_0x39d2b9){if(_0x39d2b9){return _0x25cfe1[_0x070e('0x15')](_0x1baa12);}return _0x25cfe1[_0x070e('0x16')](_0x1baa12)['end']();};}function respondWithResult(_0x5dca0f,_0x24baba){_0x24baba=_0x24baba||0xc8;return function(_0x56c7ba){if(_0x56c7ba){return _0x5dca0f['status'](_0x24baba)['json'](_0x56c7ba);}};}function respondWithFilteredResult(_0x11d2ce,_0x14c3fd){return function(_0x51d14d){if(_0x51d14d){var _0x5d3a38=_0x51d14d[_0x070e('0x17')],_0x373d86=_0x14c3fd['offset'],_0xeae1a5=_0x14c3fd['offset']+_0x14c3fd[_0x070e('0x18')],_0x180897;if(_0xeae1a5>=_0x5d3a38){_0xeae1a5=_0x5d3a38;_0x180897=0xc8;}else{_0x180897=0xce;}_0x11d2ce[_0x070e('0x16')](_0x180897);return _0x11d2ce[_0x070e('0x19')](_0x070e('0x1a'),_0x373d86+'-'+_0xeae1a5+'/'+_0x5d3a38)[_0x070e('0x1b')](_0x51d14d);}return null;};}function patchUpdates(_0x5037eb){return function(_0x3938b5){try{jsonpatch[_0x070e('0x1c')](_0x3938b5,_0x5037eb,!![]);}catch(_0x1ad3de){return BPromise[_0x070e('0x1d')](_0x1ad3de);}return _0x3938b5[_0x070e('0x1e')]();};}function saveUpdates(_0x5c16fd,_0x5b2f48){return function(_0x4e958f){if(_0x4e958f){return _0x4e958f[_0x070e('0x1f')](_0x5c16fd)[_0x070e('0x20')](function(_0x20dc60){return _0x20dc60;});}return null;};}function removeEntity(_0x4be0d7,_0x5b184){return function(_0x5dc5d2){if(_0x5dc5d2){return _0x5dc5d2[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x4be0d7[_0x070e('0x16')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0x28a1c3,_0xa86797){return function(_0xe405e){if(!_0xe405e){_0x28a1c3[_0x070e('0x15')](0x194);}return _0xe405e;};}function handleError(_0x595c7e,_0x2f8055){_0x2f8055=_0x2f8055||0x1f4;return function(_0x270061){logger[_0x070e('0x23')](_0x270061['stack']);if(_0x270061[_0x070e('0x24')]){delete _0x270061['name'];}_0x595c7e['status'](_0x2f8055)[_0x070e('0x25')](_0x270061);};}exports[_0x070e('0x26')]=function(_0x41deb1,_0x1743cc){var _0x4763c6={},_0x497f58={},_0x374c54={'count':0x0,'rows':[]};var _0x219e48=db[_0x070e('0x27')][_0x070e('0x28')];_0x497f58[_0x070e('0x29')]=_[_0x070e('0x2a')](_0x219e48);_0x497f58[_0x070e('0x2b')]=_[_0x070e('0x2a')](_0x41deb1['query']);_0x497f58[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x497f58[_0x070e('0x29')],_0x497f58['query']);_0x4763c6['attributes']=_[_0x070e('0x2d')](_0x497f58[_0x070e('0x29')],qs[_0x070e('0x2e')](_0x41deb1['query'][_0x070e('0x2e')]));_0x4763c6[_0x070e('0x2f')]=_0x4763c6[_0x070e('0x2f')][_0x070e('0x30')]?_0x4763c6['attributes']:_0x497f58['model'];if(!_0x41deb1['query']['hasOwnProperty'](_0x070e('0x31'))){_0x4763c6['limit']=qs[_0x070e('0x18')](_0x41deb1[_0x070e('0x2b')]['limit']);_0x4763c6['offset']=qs[_0x070e('0x32')](_0x41deb1[_0x070e('0x2b')]['offset']);}_0x4763c6['order']=qs[_0x070e('0x33')](_0x41deb1[_0x070e('0x2b')][_0x070e('0x33')]);_0x4763c6[_0x070e('0x34')]=qs[_0x070e('0x2c')](_['pick'](_0x41deb1['query'],_0x497f58[_0x070e('0x2c')]));if(_0x41deb1[_0x070e('0x2b')][_0x070e('0x35')]){_0x4763c6[_0x070e('0x34')]=_[_0x070e('0x36')](_0x4763c6['where'],{'$or':_[_0x070e('0x37')](_0x219e48,function(_0x1927f4){if(_0x1927f4['type'][_0x070e('0x38')]!==_0x070e('0x39')){var _0x4ba6f0={};_0x4ba6f0[_0x1927f4['field']]={'$like':'%'+_0x41deb1['query'][_0x070e('0x35')]+'%'};return _0x4ba6f0;}})});}_0x4763c6=_[_0x070e('0x36')]({},_0x4763c6,_0x41deb1[_0x070e('0x3a')]);var _0x334733={'where':_0x4763c6[_0x070e('0x34')]};return db['DeskField'][_0x070e('0x17')](_0x334733)[_0x070e('0x20')](function(_0xb53332){_0x374c54['count']=_0xb53332;if(_0x41deb1[_0x070e('0x2b')][_0x070e('0x3b')]){_0x4763c6[_0x070e('0x3c')]=[{'all':!![]}];}return db['DeskField'][_0x070e('0x3d')](_0x4763c6);})[_0x070e('0x20')](function(_0x4800a9){_0x374c54[_0x070e('0x3e')]=_0x4800a9;return _0x374c54;})['then'](respondWithFilteredResult(_0x1743cc,_0x4763c6))[_0x070e('0x3f')](handleError(_0x1743cc,null));};exports[_0x070e('0x40')]=function(_0x3462d3,_0x30319c){var _0xd03404={'raw':!![],'where':{'id':_0x3462d3[_0x070e('0x41')]['id']}},_0x47b929={};_0x47b929['model']=_['keys'](db[_0x070e('0x27')][_0x070e('0x28')]);_0x47b929[_0x070e('0x2b')]=_['keys'](_0x3462d3[_0x070e('0x2b')]);_0x47b929[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x47b929[_0x070e('0x29')],_0x47b929['query']);_0xd03404[_0x070e('0x2f')]=_['intersection'](_0x47b929['model'],qs['fields'](_0x3462d3[_0x070e('0x2b')][_0x070e('0x2e')]));_0xd03404[_0x070e('0x2f')]=_0xd03404[_0x070e('0x2f')][_0x070e('0x30')]?_0xd03404['attributes']:_0x47b929[_0x070e('0x29')];if(_0x3462d3['query'][_0x070e('0x3b')]){_0xd03404[_0x070e('0x3c')]=[{'all':!![]}];}_0xd03404=_[_0x070e('0x36')]({},_0xd03404,_0x3462d3['options']);return db['DeskField'][_0x070e('0x42')](_0xd03404)['then'](handleEntityNotFound(_0x30319c,null))[_0x070e('0x20')](respondWithResult(_0x30319c,null))[_0x070e('0x3f')](handleError(_0x30319c,null));};exports[_0x070e('0x43')]=function(_0x5f5675,_0x7c15f9){return db[_0x070e('0x27')]['create'](_0x5f5675['body'],{})[_0x070e('0x20')](respondWithResult(_0x7c15f9,0xc9))[_0x070e('0x3f')](handleError(_0x7c15f9,null));};exports[_0x070e('0x1f')]=function(_0x1fc7c4,_0x253e11){if(_0x1fc7c4['body']['id']){delete _0x1fc7c4[_0x070e('0x44')]['id'];}return db[_0x070e('0x27')][_0x070e('0x42')]({'where':{'id':_0x1fc7c4[_0x070e('0x41')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x253e11,null))[_0x070e('0x20')](saveUpdates(_0x1fc7c4[_0x070e('0x44')],null))[_0x070e('0x20')](respondWithResult(_0x253e11,null))[_0x070e('0x3f')](handleError(_0x253e11,null));};exports[_0x070e('0x21')]=function(_0x210c4d,_0x3be553){return db[_0x070e('0x27')][_0x070e('0x42')]({'where':{'id':_0x210c4d[_0x070e('0x41')]['id']}})['then'](handleEntityNotFound(_0x3be553,null))[_0x070e('0x20')](removeEntity(_0x3be553,null))[_0x070e('0x3f')](handleError(_0x3be553,null));}; \ No newline at end of file +var _0x0713=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','set','Content-Range','json','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','DeskField','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','map','key','VIRTUAL','field','include','findAll','catch','show','params','length','includeAll','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x5c3750,_0x4a06b0){var _0xce7d7c=function(_0x41658b){while(--_0x41658b){_0x5c3750['push'](_0x5c3750['shift']());}};_0xce7d7c(++_0x4a06b0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var authService=require(_0x3071('0x11'));var hardwareService=require(_0x3071('0x12'));var Redis=require(_0x3071('0x13'));var qs=require(_0x3071('0x14'));var logger=require(_0x3071('0x15'))('api');var utils=require(_0x3071('0x16'));var config=require(_0x3071('0x17'));var db=require(_0x3071('0x18'))['db'];function respondWithStatusCode(_0x3ed4a0,_0xa0c1){_0xa0c1=_0xa0c1||0xcc;return function(_0x4a8cc7){if(_0x4a8cc7){return _0x3ed4a0['sendStatus'](_0xa0c1);}return _0x3ed4a0[_0x3071('0x19')](_0xa0c1)['end']();};}function respondWithResult(_0x31c220,_0x44fbae){_0x44fbae=_0x44fbae||0xc8;return function(_0x5d4883){if(_0x5d4883){return _0x31c220[_0x3071('0x19')](_0x44fbae)['json'](_0x5d4883);}};}function respondWithFilteredResult(_0x2fc15d,_0x45c93b){return function(_0x1271d0){if(_0x1271d0){var _0x1f14e1=_0x1271d0[_0x3071('0x1a')],_0x1caa5d=_0x45c93b[_0x3071('0x1b')],_0x2a6a4b=_0x45c93b[_0x3071('0x1b')]+_0x45c93b['limit'],_0x157a47;if(_0x2a6a4b>=_0x1f14e1){_0x2a6a4b=_0x1f14e1;_0x157a47=0xc8;}else{_0x157a47=0xce;}_0x2fc15d[_0x3071('0x19')](_0x157a47);return _0x2fc15d[_0x3071('0x1c')](_0x3071('0x1d'),_0x1caa5d+'-'+_0x2a6a4b+'/'+_0x1f14e1)[_0x3071('0x1e')](_0x1271d0);}return null;};}function patchUpdates(_0x3acf0e){return function(_0x17aee2){try{jsonpatch[_0x3071('0x1f')](_0x17aee2,_0x3acf0e,!![]);}catch(_0x26f113){return BPromise['reject'](_0x26f113);}return _0x17aee2[_0x3071('0x20')]();};}function saveUpdates(_0x2bfa33,_0xd3e23d){return function(_0x56c267){if(_0x56c267){return _0x56c267[_0x3071('0x21')](_0x2bfa33)['then'](function(_0x833074){return _0x833074;});}return null;};}function removeEntity(_0x43128c,_0x3762d8){return function(_0x457b57){if(_0x457b57){return _0x457b57[_0x3071('0x22')]()[_0x3071('0x23')](function(){_0x43128c[_0x3071('0x19')](0xcc)[_0x3071('0x24')]();});}};}function handleEntityNotFound(_0x542646,_0x481a51){return function(_0x2ce48a){if(!_0x2ce48a){_0x542646[_0x3071('0x25')](0x194);}return _0x2ce48a;};}function handleError(_0x412652,_0x13df9f){_0x13df9f=_0x13df9f||0x1f4;return function(_0x2793ef){logger[_0x3071('0x26')](_0x2793ef[_0x3071('0x27')]);if(_0x2793ef[_0x3071('0x28')]){delete _0x2793ef[_0x3071('0x28')];}_0x412652['status'](_0x13df9f)[_0x3071('0x29')](_0x2793ef);};}exports[_0x3071('0x2a')]=function(_0x177138,_0x4d5c4b){var _0x4fb1ca={},_0x28792d={},_0x163604={'count':0x0,'rows':[]};var _0x950fde=db[_0x3071('0x2b')][_0x3071('0x2c')];_0x28792d[_0x3071('0x2d')]=_[_0x3071('0x2e')](_0x950fde);_0x28792d[_0x3071('0x2f')]=_[_0x3071('0x2e')](_0x177138[_0x3071('0x2f')]);_0x28792d['filters']=_['intersection'](_0x28792d[_0x3071('0x2d')],_0x28792d[_0x3071('0x2f')]);_0x4fb1ca[_0x3071('0x30')]=_[_0x3071('0x31')](_0x28792d[_0x3071('0x2d')],qs[_0x3071('0x32')](_0x177138[_0x3071('0x2f')][_0x3071('0x32')]));_0x4fb1ca['attributes']=_0x4fb1ca['attributes']['length']?_0x4fb1ca[_0x3071('0x30')]:_0x28792d[_0x3071('0x2d')];if(!_0x177138['query'][_0x3071('0x33')](_0x3071('0x34'))){_0x4fb1ca[_0x3071('0x35')]=qs[_0x3071('0x35')](_0x177138['query'][_0x3071('0x35')]);_0x4fb1ca[_0x3071('0x1b')]=qs[_0x3071('0x1b')](_0x177138[_0x3071('0x2f')][_0x3071('0x1b')]);}_0x4fb1ca[_0x3071('0x36')]=qs[_0x3071('0x37')](_0x177138[_0x3071('0x2f')]['sort']);_0x4fb1ca[_0x3071('0x38')]=qs['filters'](_['pick'](_0x177138[_0x3071('0x2f')],_0x28792d[_0x3071('0x39')]));if(_0x177138['query'][_0x3071('0x3a')]){_0x4fb1ca[_0x3071('0x38')]=_[_0x3071('0x3b')](_0x4fb1ca[_0x3071('0x38')],{'$or':_[_0x3071('0x3c')](_0x950fde,function(_0x232235){if(_0x232235['type'][_0x3071('0x3d')]!==_0x3071('0x3e')){var _0x4ce6d4={};_0x4ce6d4[_0x232235[_0x3071('0x3f')]]={'$like':'%'+_0x177138['query'][_0x3071('0x3a')]+'%'};return _0x4ce6d4;}})});}_0x4fb1ca=_[_0x3071('0x3b')]({},_0x4fb1ca,_0x177138['options']);var _0x593c99={'where':_0x4fb1ca[_0x3071('0x38')]};return db[_0x3071('0x2b')][_0x3071('0x1a')](_0x593c99)['then'](function(_0x4dea69){_0x163604['count']=_0x4dea69;if(_0x177138[_0x3071('0x2f')]['includeAll']){_0x4fb1ca[_0x3071('0x40')]=[{'all':!![]}];}return db[_0x3071('0x2b')][_0x3071('0x41')](_0x4fb1ca);})[_0x3071('0x23')](function(_0x30ab68){_0x163604['rows']=_0x30ab68;return _0x163604;})['then'](respondWithFilteredResult(_0x4d5c4b,_0x4fb1ca))[_0x3071('0x42')](handleError(_0x4d5c4b,null));};exports[_0x3071('0x43')]=function(_0x1455be,_0x1f69a6){var _0x525389={'raw':!![],'where':{'id':_0x1455be[_0x3071('0x44')]['id']}},_0x3cfc05={};_0x3cfc05[_0x3071('0x2d')]=_[_0x3071('0x2e')](db[_0x3071('0x2b')][_0x3071('0x2c')]);_0x3cfc05['query']=_[_0x3071('0x2e')](_0x1455be['query']);_0x3cfc05['filters']=_['intersection'](_0x3cfc05['model'],_0x3cfc05[_0x3071('0x2f')]);_0x525389[_0x3071('0x30')]=_[_0x3071('0x31')](_0x3cfc05[_0x3071('0x2d')],qs[_0x3071('0x32')](_0x1455be[_0x3071('0x2f')][_0x3071('0x32')]));_0x525389[_0x3071('0x30')]=_0x525389['attributes'][_0x3071('0x45')]?_0x525389[_0x3071('0x30')]:_0x3cfc05[_0x3071('0x2d')];if(_0x1455be[_0x3071('0x2f')][_0x3071('0x46')]){_0x525389['include']=[{'all':!![]}];}_0x525389=_['merge']({},_0x525389,_0x1455be[_0x3071('0x47')]);return db[_0x3071('0x2b')][_0x3071('0x48')](_0x525389)[_0x3071('0x23')](handleEntityNotFound(_0x1f69a6,null))[_0x3071('0x23')](respondWithResult(_0x1f69a6,null))['catch'](handleError(_0x1f69a6,null));};exports[_0x3071('0x49')]=function(_0x4a1d29,_0x18a773){return db['DeskField']['create'](_0x4a1d29[_0x3071('0x4a')],{})['then'](respondWithResult(_0x18a773,0xc9))[_0x3071('0x42')](handleError(_0x18a773,null));};exports['update']=function(_0x717c43,_0x1d75e5){if(_0x717c43[_0x3071('0x4a')]['id']){delete _0x717c43[_0x3071('0x4a')]['id'];}return db['DeskField'][_0x3071('0x48')]({'where':{'id':_0x717c43['params']['id']}})[_0x3071('0x23')](handleEntityNotFound(_0x1d75e5,null))['then'](saveUpdates(_0x717c43[_0x3071('0x4a')],null))[_0x3071('0x23')](respondWithResult(_0x1d75e5,null))['catch'](handleError(_0x1d75e5,null));};exports[_0x3071('0x22')]=function(_0x117e73,_0x224a70){return db[_0x3071('0x2b')][_0x3071('0x48')]({'where':{'id':_0x117e73[_0x3071('0x44')]['id']}})[_0x3071('0x23')](handleEntityNotFound(_0x224a70,null))['then'](removeEntity(_0x224a70,null))[_0x3071('0x42')](handleError(_0x224a70,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index c5d8f76..bbe1dc9 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 _0x12b7=['desk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','./intDeskField.attributes','exports','define','DeskField','int_desk_fields'];(function(_0x3ef90f,_0x46f414){var _0x278fab=function(_0x3ef740){while(--_0x3ef740){_0x3ef90f['push'](_0x3ef90f['shift']());}};_0x278fab(++_0x46f414);}(_0x12b7,0x16f));var _0x712b=function(_0x3208ff,_0x42c20a){_0x3208ff=_0x3208ff-0x0;var _0x185cf2=_0x12b7[_0x3208ff];return _0x185cf2;};'use strict';var _=require(_0x712b('0x0'));var util=require('util');var logger=require(_0x712b('0x1'))(_0x712b('0x2'));var moment=require(_0x712b('0x3'));var BPromise=require(_0x712b('0x4'));var rp=require(_0x712b('0x5'));var attributes=require(_0x712b('0x6'));module[_0x712b('0x7')]=function(_0x87747,_0x10c502){return _0x87747[_0x712b('0x8')](_0x712b('0x9'),attributes,{'tableName':_0x712b('0xa'),'paranoid':![],'indexes':[{'name':_0x712b('0xb'),'fields':[_0x712b('0xc'),_0x712b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b0b=['api','moment','bluebird','request-promise','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2b0b,0xfa));var _0xb2b0=function(_0x5387d0,_0x5bd369){_0x5387d0=_0x5387d0-0x0;var _0x50a4ec=_0x2b0b[_0x5387d0];return _0x50a4ec;};'use strict';var _=require('lodash');var util=require(_0xb2b0('0x0'));var logger=require(_0xb2b0('0x1'))(_0xb2b0('0x2'));var moment=require(_0xb2b0('0x3'));var BPromise=require(_0xb2b0('0x4'));var rp=require(_0xb2b0('0x5'));var attributes=require(_0xb2b0('0x6'));module[_0xb2b0('0x7')]=function(_0xbd3d2a,_0x13e8b4){return _0xbd3d2a[_0xb2b0('0x8')](_0xb2b0('0x9'),attributes,{'tableName':_0xb2b0('0xa'),'paranoid':![],'indexes':[{'name':_0xb2b0('0xb'),'fields':[_0xb2b0('0xc'),_0xb2b0('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 1873d56..45b755d 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 _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','result'];(function(_0x4aff25,_0x469c8e){var _0x4b032d=function(_0xa28081){while(--_0xa28081){_0x4aff25['push'](_0x4aff25['shift']());}};_0x4b032d(++_0x469c8e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3d71ba,_0x49a38b){_0x3d71ba=_0x3d71ba-0x0;var _0x5e0ed0=_0xf3cd[_0x3d71ba];return _0x5e0ed0;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('DeskField,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('DeskField,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file +var _0xbd50=['DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbd50,0x196));var _0x0bd5=function(_0x202eed,_0x5a0bcd){_0x202eed=_0x202eed-0x0;var _0x46a69f=_0xbd50[_0x202eed];return _0x46a69f;};'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);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 329d097..1f1d14b 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 _0x872f=['index','/:id','get','getConfigurations','getFields','post','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x872f,0x12a));var _0xf872=function(_0x479c68,_0x4f2415){_0x479c68=_0x479c68-0x0;var _0x5215b1=_0x872f[_0x479c68];return _0x5215b1;};'use strict';var multer=require(_0xf872('0x0'));var util=require(_0xf872('0x1'));var path=require(_0xf872('0x2'));var timeout=require(_0xf872('0x3'));var express=require(_0xf872('0x4'));var router=express[_0xf872('0x5')]();var auth=require(_0xf872('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf872('0x7'));var controller=require(_0xf872('0x8'));router['get']('/',auth[_0xf872('0x9')](),controller[_0xf872('0xa')]);router['get'](_0xf872('0xb'),auth[_0xf872('0x9')](),controller['show']);router[_0xf872('0xc')]('/:id/configurations',auth[_0xf872('0x9')](),controller[_0xf872('0xd')]);router[_0xf872('0xc')]('/:id/fields',auth[_0xf872('0x9')](),controller[_0xf872('0xe')]);router[_0xf872('0xf')]('/',auth[_0xf872('0x9')](),controller['create']);router[_0xf872('0xf')](_0xf872('0x10'),auth[_0xf872('0x9')](),controller[_0xf872('0x11')]);router['put'](_0xf872('0xb'),auth['isAuthenticated'](),controller[_0xf872('0x12')]);router[_0xf872('0x13')](_0xf872('0xb'),auth[_0xf872('0x9')](),controller[_0xf872('0x14')]);module[_0xf872('0x15')]=router; \ No newline at end of file +var _0x48a9=['addConfiguration','put','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations'];(function(_0x5df01c,_0x3ad300){var _0xeb5443=function(_0x35fbc0){while(--_0x35fbc0){_0x5df01c['push'](_0x5df01c['shift']());}};_0xeb5443(++_0x3ad300);}(_0x48a9,0x6c));var _0x948a=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0x48a9[_0x28f1de];return _0x5b5dad;};'use strict';var multer=require(_0x948a('0x0'));var util=require(_0x948a('0x1'));var path=require('path');var timeout=require(_0x948a('0x2'));var express=require(_0x948a('0x3'));var router=express[_0x948a('0x4')]();var auth=require(_0x948a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x948a('0x6'));var controller=require(_0x948a('0x7'));router[_0x948a('0x8')]('/',auth[_0x948a('0x9')](),controller[_0x948a('0xa')]);router[_0x948a('0x8')](_0x948a('0xb'),auth[_0x948a('0x9')](),controller['show']);router['get']('/:id/configurations',auth[_0x948a('0x9')](),controller[_0x948a('0xc')]);router['get'](_0x948a('0xd'),auth[_0x948a('0x9')](),controller[_0x948a('0xe')]);router[_0x948a('0xf')]('/',auth['isAuthenticated'](),controller[_0x948a('0x10')]);router['post'](_0x948a('0x11'),auth['isAuthenticated'](),controller[_0x948a('0x12')]);router[_0x948a('0x13')](_0x948a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x948a('0x14')](_0x948a('0xb'),auth[_0x948a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 73abf29..946e4b9 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 _0xa3a4=['sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa3a4,0x144));var _0x4a3a=function(_0x1ee30c,_0x469059){_0x1ee30c=_0x1ee30c-0x0;var _0x129cf7=_0xa3a4[_0x1ee30c];return _0x129cf7;};'use strict';var Sequelize=require(_0x4a3a('0x0'));module[_0x4a3a('0x1')]={'name':{'type':Sequelize[_0x4a3a('0x2')]},'username':{'type':Sequelize[_0x4a3a('0x2')]},'password':{'type':Sequelize[_0x4a3a('0x2')]},'remoteUri':{'type':Sequelize[_0x4a3a('0x2')]},'tenantId':{'type':Sequelize[_0x4a3a('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x4a3a('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x22c4=['sequelize','STRING'];(function(_0x25612d,_0x4886a5){var _0x3b1456=function(_0x3242c9){while(--_0x3242c9){_0x25612d['push'](_0x25612d['shift']());}};_0x3b1456(++_0x4886a5);}(_0x22c4,0x84));var _0x422c=function(_0x32efcb,_0x55523f){_0x32efcb=_0x32efcb-0x0;var _0x1dae88=_0x22c4[_0x32efcb];return _0x1dae88;};'use strict';var Sequelize=require(_0x422c('0x0'));module['exports']={'name':{'type':Sequelize[_0x422c('0x1')]},'username':{'type':Sequelize[_0x422c('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x422c('0x1')]},'tenantId':{'type':Sequelize[_0x422c('0x1')]},'clientId':{'type':Sequelize[_0x422c('0x1')]},'clientSecret':{'type':Sequelize[_0x422c('0x1')]},'serverUrl':{'type':Sequelize[_0x422c('0x1')]},'description':{'type':Sequelize[_0x422c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 4bad03a..d6a6959 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 _0x326b=['DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','Dynamics365\x20error:\x20','test','name','Wrong\x20credentials','statusCode',')/Attributes(','OptionSet','Options','Label','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','UserLocalizedLabel','Value','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','error','code','message','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','send','Dynamics365Account','rawAttributes','query','keys','filters','intersection','model','attributes','length','nolimit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','fields','includeAll','create','body','find','params','getConfigurations','findOne','Dynamics365Configuration','order','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','ticketType','PhoneCall','title','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','remoteUri','tenantId','clientSecret','format','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','username','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','LogicalName','@odata.type','substring','lastIndexOf','PicklistAttributeMetadata','push','all','forEach','BooleanAttributeMetadata','StringAttributeMetadata'];(function(_0x275947,_0x1459f0){var _0x39cef6=function(_0x591628){while(--_0x591628){_0x275947['push'](_0x275947['shift']());}};_0x39cef6(++_0x1459f0);}(_0x326b,0x1b5));var _0xb326=function(_0x6182ff,_0x59d492){_0x6182ff=_0x6182ff-0x0;var _0x1cec22=_0x326b[_0x6182ff];return _0x1cec22;};'use strict';var pdf=require(_0xb326('0x0'));var emlformat=require(_0xb326('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb326('0x2'));var jsonpatch=require(_0xb326('0x3'));var rp=require('request-promise');var moment=require(_0xb326('0x4'));var BPromise=require(_0xb326('0x5'));var Mustache=require(_0xb326('0x6'));var util=require('util');var path=require(_0xb326('0x7'));var sox=require('sox');var csv=require(_0xb326('0x8'));var ejs=require(_0xb326('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb326('0xa'));var crypto=require(_0xb326('0xb'));var jsforce=require(_0xb326('0xc'));var deskjs=require(_0xb326('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb326('0xe'));var Papa=require(_0xb326('0xf'));var authService=require(_0xb326('0x10'));var hardwareService=require(_0xb326('0x11'));var Redis=require('ioredis');var qs=require(_0xb326('0x12'));var logger=require(_0xb326('0x13'))(_0xb326('0x14'));var utils=require(_0xb326('0x15'));var config=require('../../config/environment');var db=require(_0xb326('0x16'))['db'];var integrations=require(_0xb326('0x17'));var jayson=require(_0xb326('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d3da8,_0x447de3,_0x22cff0,_0x58bfb7){return new BPromise(function(_0x46eb90,_0xae1f00){var _0x1e59d6=_0x58bfb7||client;return _0x1e59d6[_0xb326('0x19')](_0x5d3da8,_0x22cff0)[_0xb326('0x1a')](function(_0x4d67c5){logger[_0xb326('0x1b')](_0xb326('0x1c'),_0x447de3,_0xb326('0x1d'));logger[_0xb326('0x1e')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x447de3,_0xb326('0x1d'),JSON['stringify'](_0x4d67c5));if(_0x4d67c5[_0xb326('0x1f')]){if(_0x4d67c5[_0xb326('0x1f')][_0xb326('0x20')]===0x1f4){logger[_0xb326('0x1f')](_0xb326('0x1c'),_0x447de3,_0x4d67c5[_0xb326('0x1f')][_0xb326('0x21')]);return _0xae1f00(_0x4d67c5[_0xb326('0x1f')]['message']);}logger[_0xb326('0x1f')](_0xb326('0x1c'),_0x447de3,_0x4d67c5[_0xb326('0x1f')]['message']);return _0x46eb90(_0x4d67c5[_0xb326('0x1f')][_0xb326('0x21')]);}else{logger[_0xb326('0x1b')](_0xb326('0x1c'),_0x447de3,'request\x20sent');_0x46eb90(_0x4d67c5['result'][_0xb326('0x21')]);}})['catch'](function(_0x3018f7){logger[_0xb326('0x1f')](_0xb326('0x1c'),_0x447de3,_0x3018f7);_0xae1f00(_0x3018f7);});});}function respondWithStatusCode(_0x3420da,_0x3ae506){_0x3ae506=_0x3ae506||0xcc;return function(_0x82e6d1){if(_0x82e6d1){return _0x3420da[_0xb326('0x22')](_0x3ae506);}return _0x3420da['status'](_0x3ae506)[_0xb326('0x23')]();};}function respondWithResult(_0xf6af60,_0x1d8328){_0x1d8328=_0x1d8328||0xc8;return function(_0x25747c){if(_0x25747c){return _0xf6af60[_0xb326('0x24')](_0x1d8328)[_0xb326('0x25')](_0x25747c);}};}function respondWithFilteredResult(_0x561521,_0x442496){return function(_0x19be51){if(_0x19be51){var _0x13a8f0=_0x19be51[_0xb326('0x26')],_0x5251fd=_0x442496[_0xb326('0x27')],_0x426c84=_0x442496[_0xb326('0x27')]+_0x442496[_0xb326('0x28')],_0x42d652;if(_0x426c84>=_0x13a8f0){_0x426c84=_0x13a8f0;_0x42d652=0xc8;}else{_0x42d652=0xce;}_0x561521['status'](_0x42d652);return _0x561521[_0xb326('0x29')](_0xb326('0x2a'),_0x5251fd+'-'+_0x426c84+'/'+_0x13a8f0)[_0xb326('0x25')](_0x19be51);}return null;};}function patchUpdates(_0x3e93c3){return function(_0xb7f833){try{jsonpatch[_0xb326('0x2b')](_0xb7f833,_0x3e93c3,!![]);}catch(_0x3ab6f6){return BPromise[_0xb326('0x2c')](_0x3ab6f6);}return _0xb7f833[_0xb326('0x2d')]();};}function saveUpdates(_0x22f6c9,_0x3f9b67){return function(_0x2ae016){if(_0x2ae016){return _0x2ae016[_0xb326('0x2e')](_0x22f6c9)[_0xb326('0x1a')](function(_0x950823){return _0x950823;});}return null;};}function removeEntity(_0x512753,_0x6b09ef){return function(_0x14bb65){if(_0x14bb65){return _0x14bb65[_0xb326('0x2f')]()[_0xb326('0x1a')](function(){_0x512753[_0xb326('0x24')](0xcc)[_0xb326('0x23')]();});}};}function handleEntityNotFound(_0x29f69b,_0x231429){return function(_0x55ad92){if(!_0x55ad92){_0x29f69b['sendStatus'](0x194);}return _0x55ad92;};}function handleError(_0x32fabb,_0x32a4f2){_0x32a4f2=_0x32a4f2||0x1f4;return function(_0x3035a1){logger[_0xb326('0x1f')](_0x3035a1[_0xb326('0x30')]);if(_0x3035a1['name']){delete _0x3035a1['name'];}_0x32fabb['status'](_0x32a4f2)[_0xb326('0x31')](_0x3035a1);};}exports['index']=function(_0x3aaa58,_0x4ad233){var _0xa61a9a={},_0x2964a3={},_0x10c12a={'count':0x0,'rows':[]};var _0x3a0b23=db[_0xb326('0x32')][_0xb326('0x33')];_0x2964a3['model']=_['keys'](_0x3a0b23);_0x2964a3[_0xb326('0x34')]=_[_0xb326('0x35')](_0x3aaa58[_0xb326('0x34')]);_0x2964a3[_0xb326('0x36')]=_[_0xb326('0x37')](_0x2964a3[_0xb326('0x38')],_0x2964a3[_0xb326('0x34')]);_0xa61a9a[_0xb326('0x39')]=_['intersection'](_0x2964a3[_0xb326('0x38')],qs['fields'](_0x3aaa58[_0xb326('0x34')]['fields']));_0xa61a9a['attributes']=_0xa61a9a['attributes'][_0xb326('0x3a')]?_0xa61a9a[_0xb326('0x39')]:_0x2964a3[_0xb326('0x38')];if(!_0x3aaa58[_0xb326('0x34')]['hasOwnProperty'](_0xb326('0x3b'))){_0xa61a9a[_0xb326('0x28')]=qs[_0xb326('0x28')](_0x3aaa58['query'][_0xb326('0x28')]);_0xa61a9a[_0xb326('0x27')]=qs[_0xb326('0x27')](_0x3aaa58['query'][_0xb326('0x27')]);}_0xa61a9a['order']=qs[_0xb326('0x3c')](_0x3aaa58[_0xb326('0x34')]['sort']);_0xa61a9a['where']=qs[_0xb326('0x36')](_[_0xb326('0x3d')](_0x3aaa58[_0xb326('0x34')],_0x2964a3[_0xb326('0x36')]));if(_0x3aaa58[_0xb326('0x34')][_0xb326('0x3e')]){_0xa61a9a[_0xb326('0x3f')]=_[_0xb326('0x40')](_0xa61a9a[_0xb326('0x3f')],{'$or':_[_0xb326('0x41')](_0x3a0b23,function(_0x49a8d0){if(_0x49a8d0[_0xb326('0x42')][_0xb326('0x43')]!==_0xb326('0x44')){var _0x1920e8={};_0x1920e8[_0x49a8d0[_0xb326('0x45')]]={'$like':'%'+_0x3aaa58[_0xb326('0x34')]['filter']+'%'};return _0x1920e8;}})});}_0xa61a9a=_['merge']({},_0xa61a9a,_0x3aaa58[_0xb326('0x46')]);var _0x4b8e08={'where':_0xa61a9a[_0xb326('0x3f')]};return db[_0xb326('0x32')][_0xb326('0x26')](_0x4b8e08)['then'](function(_0x4b4c2a){_0x10c12a['count']=_0x4b4c2a;if(_0x3aaa58['query']['includeAll']){_0xa61a9a[_0xb326('0x47')]=[{'all':!![]}];}return db[_0xb326('0x32')][_0xb326('0x48')](_0xa61a9a);})[_0xb326('0x1a')](function(_0x310906){_0x10c12a[_0xb326('0x49')]=_0x310906;return _0x10c12a;})[_0xb326('0x1a')](respondWithFilteredResult(_0x4ad233,_0xa61a9a))[_0xb326('0x4a')](handleError(_0x4ad233,null));};exports['show']=function(_0x2b200b,_0x135572){var _0x3167bd={'raw':![],'where':{'id':_0x2b200b['params']['id']}},_0x39745a={};_0x39745a[_0xb326('0x38')]=_[_0xb326('0x35')](db[_0xb326('0x32')][_0xb326('0x33')]);_0x39745a[_0xb326('0x34')]=_['keys'](_0x2b200b[_0xb326('0x34')]);_0x39745a[_0xb326('0x36')]=_[_0xb326('0x37')](_0x39745a[_0xb326('0x38')],_0x39745a[_0xb326('0x34')]);_0x3167bd[_0xb326('0x39')]=_[_0xb326('0x37')](_0x39745a[_0xb326('0x38')],qs[_0xb326('0x4b')](_0x2b200b['query'][_0xb326('0x4b')]));_0x3167bd[_0xb326('0x39')]=_0x3167bd[_0xb326('0x39')][_0xb326('0x3a')]?_0x3167bd[_0xb326('0x39')]:_0x39745a[_0xb326('0x38')];if(_0x2b200b[_0xb326('0x34')][_0xb326('0x4c')]){_0x3167bd[_0xb326('0x47')]=[{'all':!![]}];}_0x3167bd=_['merge']({},_0x3167bd,_0x2b200b['options']);return db['Dynamics365Account']['find'](_0x3167bd)['then'](handleEntityNotFound(_0x135572,null))[_0xb326('0x1a')](respondWithResult(_0x135572,null))[_0xb326('0x4a')](handleError(_0x135572,null));};exports[_0xb326('0x4d')]=function(_0x1f34a0,_0xc48c10){return db[_0xb326('0x32')][_0xb326('0x4d')](_0x1f34a0[_0xb326('0x4e')],{})[_0xb326('0x1a')](respondWithResult(_0xc48c10,0xc9))['catch'](handleError(_0xc48c10,null));};exports['update']=function(_0x1cf5fe,_0x19eeb2){if(_0x1cf5fe[_0xb326('0x4e')]['id']){delete _0x1cf5fe['body']['id'];}return db[_0xb326('0x32')]['find']({'where':{'id':_0x1cf5fe['params']['id']}})[_0xb326('0x1a')](handleEntityNotFound(_0x19eeb2,null))[_0xb326('0x1a')](saveUpdates(_0x1cf5fe[_0xb326('0x4e')],null))[_0xb326('0x1a')](respondWithResult(_0x19eeb2,null))[_0xb326('0x4a')](handleError(_0x19eeb2,null));};exports[_0xb326('0x2f')]=function(_0x433538,_0x22a9ab){return db['Dynamics365Account'][_0xb326('0x4f')]({'where':{'id':_0x433538[_0xb326('0x50')]['id']}})['then'](handleEntityNotFound(_0x22a9ab,null))[_0xb326('0x1a')](removeEntity(_0x22a9ab,null))[_0xb326('0x4a')](handleError(_0x22a9ab,null));};exports[_0xb326('0x51')]=function(_0x118a4a,_0x5eb246,_0x5b5249){var _0x9f2fd1={};var _0x35cfe8={};var _0x3f16e9;var _0x1e980b;return db['Dynamics365Account'][_0xb326('0x52')]({'where':{'id':_0x118a4a[_0xb326('0x50')]['id']}})[_0xb326('0x1a')](handleEntityNotFound(_0x5eb246,null))['then'](function(_0xd6e863){if(_0xd6e863){_0x3f16e9=_0xd6e863;_0x35cfe8[_0xb326('0x38')]=_[_0xb326('0x35')](db[_0xb326('0x53')][_0xb326('0x33')]);_0x35cfe8['query']=_[_0xb326('0x35')](_0x118a4a[_0xb326('0x34')]);_0x35cfe8[_0xb326('0x36')]=_[_0xb326('0x37')](_0x35cfe8['model'],_0x35cfe8[_0xb326('0x34')]);_0x9f2fd1['attributes']=_[_0xb326('0x37')](_0x35cfe8['model'],qs[_0xb326('0x4b')](_0x118a4a['query'][_0xb326('0x4b')]));_0x9f2fd1[_0xb326('0x39')]=_0x9f2fd1[_0xb326('0x39')][_0xb326('0x3a')]?_0x9f2fd1[_0xb326('0x39')]:_0x35cfe8['model'];_0x9f2fd1[_0xb326('0x54')]=qs['sort'](_0x118a4a[_0xb326('0x34')][_0xb326('0x3c')]);_0x9f2fd1[_0xb326('0x3f')]=qs['filters'](_['pick'](_0x118a4a[_0xb326('0x34')],_0x35cfe8['filters']));if(_0x118a4a[_0xb326('0x34')]['filter']){_0x9f2fd1[_0xb326('0x3f')]=_['merge'](_0x9f2fd1['where'],{'$or':_['map'](_0x9f2fd1[_0xb326('0x39')],function(_0x5a46e4){var _0x23b1ca={};_0x23b1ca[_0x5a46e4]={'$like':'%'+_0x118a4a[_0xb326('0x34')][_0xb326('0x3e')]+'%'};return _0x23b1ca;})});}_0x9f2fd1=_['merge']({},_0x9f2fd1,_0x118a4a[_0xb326('0x46')]);return _0x3f16e9[_0xb326('0x51')](_0x9f2fd1);}})[_0xb326('0x1a')](function(_0x4a1127){if(_0x4a1127){_0x1e980b=_0x4a1127[_0xb326('0x3a')];if(!_0x118a4a[_0xb326('0x34')][_0xb326('0x55')](_0xb326('0x3b'))){_0x9f2fd1[_0xb326('0x28')]=qs[_0xb326('0x28')](_0x118a4a['query'][_0xb326('0x28')]);_0x9f2fd1[_0xb326('0x27')]=qs[_0xb326('0x27')](_0x118a4a[_0xb326('0x34')]['offset']);}return _0x3f16e9[_0xb326('0x51')](_0x9f2fd1);}})[_0xb326('0x1a')](function(_0x581a41){if(_0x581a41){return _0x581a41?{'count':_0x1e980b,'rows':_0x581a41}:null;}})[_0xb326('0x1a')](respondWithResult(_0x5eb246,null))[_0xb326('0x4a')](handleError(_0x5eb246,null));};exports[_0xb326('0x56')]=function(_0x6652d8,_0x11fd05,_0xc46bfd){if(_0x6652d8[_0xb326('0x4e')]['id']){delete _0x6652d8[_0xb326('0x4e')]['id'];}return db[_0xb326('0x32')][_0xb326('0x52')]({'where':{'id':_0x6652d8[_0xb326('0x50')]['id']}})['then'](handleEntityNotFound(_0x11fd05,null))[_0xb326('0x1a')](function(_0x9c5416){if(_0x9c5416){_0x6652d8[_0xb326('0x4e')]['AccountId']=_0x9c5416['id'];_0x6652d8[_0xb326('0x4e')][_0xb326('0x57')]=integrations[_0xb326('0x58')](_0x6652d8[_0xb326('0x4e')][_0xb326('0x59')],_0x6652d8[_0xb326('0x4e')][_0xb326('0x42')]);_0x6652d8[_0xb326('0x4e')]['Descriptions']=integrations[_0xb326('0x5a')](_0x6652d8[_0xb326('0x4e')][_0xb326('0x59')],_0x6652d8[_0xb326('0x4e')][_0xb326('0x42')]);return db[_0xb326('0x53')][_0xb326('0x4d')](_0x6652d8[_0xb326('0x4e')],{'include':[{'model':db[_0xb326('0x5b')],'as':_0xb326('0x57')},{'model':db[_0xb326('0x5b')],'as':'Descriptions'}]});}return null;})[_0xb326('0x1a')](respondWithResult(_0x11fd05,null))[_0xb326('0x4a')](handleError(_0x11fd05,null));};exports['getFields']=function(_0x3bfa44,_0x6f3260,_0x6fb632){var _0x54a1a8=_0x3bfa44[_0xb326('0x34')][_0xb326('0x5c')];var _0x2fd008=_0x54a1a8==='incident'?'Incident':_0xb326('0x5d');var _0x2444bc='';var _0x1b4d8e='';var _0x525fd5='';var _0x28de4a='';var _0x234f12='';var _0x4625ac='';var _0x211f0c='';var _0xf96762=[_0xb326('0x5e'),'description',_0xb326('0x5f'),_0xb326('0x60'),_0xb326('0x61'),_0xb326('0x62'),'phonenumber',_0xb326('0x63'),_0xb326('0x64'),_0xb326('0x65')];var _0x1b4c1a=[_0xb326('0x66'),_0xb326('0x67'),_0xb326('0x68'),_0xb326('0x69'),_0xb326('0x6a'),'contactidyominame',_0xb326('0x6b'),_0xb326('0x6c'),_0xb326('0x6d'),'createdbyexternalpartyyominame',_0xb326('0x6e'),_0xb326('0x6f'),_0xb326('0x70'),'createdonbehalfbyname',_0xb326('0x71'),_0xb326('0x72'),_0xb326('0x73'),_0xb326('0x74'),_0xb326('0x75'),'entitlementidname',_0xb326('0x76'),_0xb326('0x77'),_0xb326('0x78'),'exchangerate',_0xb326('0x79'),'followupby','importsequencenumber',_0xb326('0x7a'),_0xb326('0x7b'),'lastonholdtime',_0xb326('0x7c'),_0xb326('0x7d'),_0xb326('0x7e'),_0xb326('0x7f'),_0xb326('0x80'),_0xb326('0x81'),'modifiedonbehalfbyname',_0xb326('0x82'),_0xb326('0x83'),'msdyn_iotalertname',_0xb326('0x84'),_0xb326('0x85'),_0xb326('0x86'),_0xb326('0x87'),'owneridtype','owneridyominame',_0xb326('0x88'),_0xb326('0x89'),_0xb326('0x8a'),'prioritycodename',_0xb326('0x8b'),'productserialnumber',_0xb326('0x8c'),_0xb326('0x8d'),_0xb326('0x8e'),'responsiblecontactidname',_0xb326('0x8f'),_0xb326('0x90'),_0xb326('0x91'),'slaname',_0xb326('0x92'),_0xb326('0x93'),_0xb326('0x94'),'subjectidname',_0xb326('0x95'),_0xb326('0x96'),'transactioncurrencyidname','traversedpath',_0xb326('0x97'),_0xb326('0x98')];var _0x2ac03a=_0xf96762[_0xb326('0x99')](_0x1b4c1a);return db[_0xb326('0x32')]['findOne']({'where':{'id':_0x3bfa44['params']['id']},'attributes':['id','username','password',_0xb326('0x9a'),_0xb326('0x9b'),'clientId',_0xb326('0x9c')]})[_0xb326('0x1a')](handleEntityNotFound(_0x6f3260,null))[_0xb326('0x1a')](function(_0x26a5d7){if(_0x26a5d7){_0x211f0c=util[_0xb326('0x9d')]('%s/api/data/v9.0/',_0x26a5d7[_0xb326('0x9a')]);var _0x298f10={'method':_0xb326('0x9e'),'uri':_0xb326('0x9f')+_0x26a5d7[_0xb326('0x9b')]+_0xb326('0xa0'),'form':{'client_id':_0x26a5d7[_0xb326('0xa1')],'resource':_0x26a5d7[_0xb326('0x9a')],'username':_0x26a5d7[_0xb326('0xa2')],'password':_0x26a5d7['password'],'grant_type':_0xb326('0xa3'),'client_secret':_0x26a5d7['clientSecret']},'json':!![]};return rp(_0x298f10);}})['then'](function(_0x175bb3){_0x4625ac=_0x175bb3[_0xb326('0xa4')];var _0x261692={'method':_0xb326('0xa5'),'uri':encodeURI(_0x211f0c+_0xb326('0xa6')+_0x2fd008+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x4625ac,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x261692);})[_0xb326('0x1a')](function(_0x367c50){var _0x568e25=_0x367c50[_0xb326('0xa7')][0x0];var _0x334738=_0x568e25[_0xb326('0xa8')];var _0xa6c3ef={'method':_0xb326('0xa5'),'uri':_0x211f0c+_0xb326('0xa9')+_0x334738+_0xb326('0xaa'),'headers':{'Authorization':_0xb326('0xab')+_0x4625ac,'If-None-Match':null,'OData-Version':_0xb326('0xac')},'json':!![]};return rp(_0xa6c3ef);})[_0xb326('0x1a')](function(_0x4741e0){_0x2444bc=_0x4741e0;_0x1b4d8e=_0x2444bc[_0xb326('0xad')];_0x1b4d8e=_['remove'](_0x1b4d8e,function(_0x2d05e){return!_0x2ac03a['includes'](_0x2d05e[_0xb326('0xae')]);});var _0x37a598=[];var _0x2e54d6=[];_0x1b4d8e['forEach'](function(_0x40f12c){if(_0x40f12c['@odata.type']){var _0x3861c8=_0x40f12c[_0xb326('0xaf')][_0xb326('0xb0')](_0x40f12c[_0xb326('0xaf')][_0xb326('0xb1')]('.')+0x1);if(_0x3861c8===_0xb326('0xb2')){_0x37a598[_0xb326('0xb3')](getSelectList(_0x211f0c,_0x54a1a8,_0x2e54d6,_0x2444bc[_0xb326('0xa8')],_0x40f12c[_0xb326('0xa8')],_0x4625ac));}}});return Promise[_0xb326('0xb4')](_0x37a598);})['then'](function(_0xe434f0){_0x525fd5=_0xe434f0[0x0];var _0x1490d4=[];var _0x24434d=[];_0x1b4d8e[_0xb326('0xb5')](function(_0x558cf4){if(_0x558cf4[_0xb326('0xaf')]){var _0x19320e=_0x558cf4['@odata.type'][_0xb326('0xb0')](_0x558cf4['@odata.type'][_0xb326('0xb1')]('.')+0x1);if(_0x19320e===_0xb326('0xb6')){_0x1490d4[_0xb326('0xb3')](getBooleanList(_0x211f0c,_0x54a1a8,_0x24434d,_0x2444bc[_0xb326('0xa8')],_0x558cf4[_0xb326('0xa8')],_0x4625ac));}}});return Promise[_0xb326('0xb4')](_0x1490d4);})[_0xb326('0x1a')](function(_0x3fc445){_0x28de4a=_0x3fc445[0x0];var _0x1f1f06=[];var _0x15b22a=[];_0x1b4d8e['forEach'](function(_0x229a52){if(_0x229a52[_0xb326('0xaf')]){var _0x5cbe61=_0x229a52[_0xb326('0xaf')][_0xb326('0xb0')](_0x229a52[_0xb326('0xaf')]['lastIndexOf']('.')+0x1);if(_0x5cbe61===_0xb326('0xb7')||_0x5cbe61===_0xb326('0xb8')||_0x5cbe61==='BigIntAttributeMetadata'||_0x5cbe61===_0xb326('0xb9')||_0x5cbe61===_0xb326('0xba')||_0x5cbe61===_0xb326('0xbb')||_0x5cbe61==='StatusAttributeMetadata'||_0x5cbe61===_0xb326('0xbc')||_0x5cbe61==='StateAttributeMetadata'||_0x5cbe61===_0xb326('0xbd')){_0x1f1f06['push'](getInputList(_0x211f0c,_0x54a1a8,_0x5cbe61,_0x15b22a,_0x2444bc['MetadataId'],_0x229a52[_0xb326('0xa8')],_0x4625ac));}}});return Promise[_0xb326('0xb4')](_0x1f1f06);})[_0xb326('0x1a')](function(_0x18c4c8){_0x234f12=_0x18c4c8[0x0];var _0x516ad4=_0x525fd5[_0xb326('0x99')](_0x28de4a)['concat'](_0x234f12);var _0x4477bd={'count':_0x516ad4[_0xb326('0x3a')],'rows':_0x516ad4};return _0x4477bd;})['then'](respondWithResult(_0x6f3260,null))['catch'](function(_0x21b8c0){console['log'](_0xb326('0xbe')+_0x21b8c0);var _0x4e55bb=_0x3bfa44[_0xb326('0x34')][_0xb326('0xbf')]?0x1f4:_0x21b8c0['statusCode']||0x1f4;logger[_0xb326('0x1f')](_0x21b8c0['stack']);delete _0x21b8c0[_0xb326('0xc0')];if(_0x4e55bb===0x191){_0x4e55bb=0x190;}_0x6f3260[_0xb326('0x24')](_0x4e55bb)['send'](_0x3bfa44[_0xb326('0x34')]['test']?{'message':_0xb326('0xc1'),'statusCode':_0x21b8c0[_0xb326('0xc2')]}:_0x21b8c0);});};function getSelectList(_0x1056c8,_0x215f4d,_0x3f3164,_0x337cc4,_0x31b6a6,_0x57ee2e){var _0x344f54={'method':_0xb326('0xa5'),'uri':_0x1056c8+_0xb326('0xa9')+_0x337cc4+_0xb326('0xc3')+_0x31b6a6+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x57ee2e,'If-None-Match':null,'OData-Version':_0xb326('0xac')},'json':!![]};return rp(_0x344f54)[_0xb326('0x1a')](function(_0x31a571){var _0x2ff1c8=[];var _0x225a47=_0x31a571[_0xb326('0xc4')][_0xb326('0xc5')];_0x225a47['forEach'](function(_0x1d540b){_0x2ff1c8['push']({'name':_0x1d540b[_0xb326('0xc6')]['UserLocalizedLabel']['Label'],'value':String(_0x1d540b['Value'])});});var _0x10a652={'id':_0x215f4d+'_'+_0x31a571[_0xb326('0xae')],'name':_0x31a571[_0xb326('0xc7')]['UserLocalizedLabel'][_0xb326('0xc6')],'custom':![],'options':_0x2ff1c8};_0x3f3164[_0xb326('0xb3')](_0x10a652);return _0x3f3164;});}function getBooleanList(_0x3a6ee4,_0x9aedd5,_0x27610c,_0x541001,_0x2e30f7,_0x3c9c5a){var _0x167c87={'method':'GET','uri':_0x3a6ee4+_0xb326('0xa9')+_0x541001+')/Attributes('+_0x2e30f7+_0xb326('0xc8'),'headers':{'Authorization':_0xb326('0xab')+_0x3c9c5a,'If-None-Match':null,'OData-Version':_0xb326('0xac')},'json':!![]};return rp(_0x167c87)[_0xb326('0x1a')](function(_0x298f5c){var _0x3f19d9=[];_0x3f19d9[_0xb326('0xb3')]({'name':_0x298f5c[_0xb326('0xc4')][_0xb326('0xc9')]['Label'][_0xb326('0xca')][_0xb326('0xc6')],'value':String(_0x298f5c['OptionSet'][_0xb326('0xc9')][_0xb326('0xcb')])},{'name':_0x298f5c[_0xb326('0xc4')][_0xb326('0xcc')][_0xb326('0xc6')][_0xb326('0xca')][_0xb326('0xc6')],'value':String(_0x298f5c[_0xb326('0xc4')][_0xb326('0xcc')]['Value'])});var _0x4035d2={'id':_0x9aedd5+'_'+_0x298f5c['LogicalName'],'name':_0x298f5c['DisplayName'][_0xb326('0xca')][_0xb326('0xc6')],'custom':![],'options':_0x3f19d9};_0x27610c['push'](_0x4035d2);return _0x27610c;});}function getInputList(_0x4c87cd,_0x35df83,_0x5b9bc3,_0x247838,_0x124c28,_0x49332f,_0x1ab766){var _0x1e7112={'method':'GET','uri':_0x4c87cd+'EntityDefinitions('+_0x124c28+')/Attributes('+_0x49332f+_0xb326('0xcd')+_0x5b9bc3+_0xb326('0xce'),'headers':{'Authorization':'Bearer\x20'+_0x1ab766,'If-None-Match':null,'OData-Version':_0xb326('0xac')},'json':!![]};return rp(_0x1e7112)[_0xb326('0x1a')](function(_0x332c21){var _0x3e67f8={'id':_0x35df83+'_'+_0x332c21[_0xb326('0xae')],'name':_0x332c21[_0xb326('0xc7')][_0xb326('0xca')]?_0x332c21['DisplayName'][_0xb326('0xca')][_0xb326('0xc6')]:_0x332c21['LogicalName'],'custom':![],'options':[]};_0x247838['push'](_0x3e67f8);return _0x247838;});} \ No newline at end of file +var _0x57b2=['subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','@odata.type','substring','PicklistAttributeMetadata','push','all','forEach','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','Dynamics365\x20error:\x20','test','Wrong\x20credentials','statusCode','GET',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Label','Value','DisplayName','UserLocalizedLabel','OptionSet','TrueOption','FalseOption',')/Microsoft.Dynamics.CRM.','html-pdf','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','request','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','destroy','stack','name','send','Dynamics365Account','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','length','find','create','body','params','findOne','Dynamics365Configuration','getConfigurations','nolimit','addConfiguration','Subjects','channel','type','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','description','customerid','ownerid','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','emailaddress','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x57b2,0x104));var _0x257b=function(_0x15e657,_0x22edd7){_0x15e657=_0x15e657-0x0;var _0x2f6e85=_0x57b2[_0x15e657];return _0x2f6e85;};'use strict';var pdf=require(_0x257b('0x0'));var emlformat=require(_0x257b('0x1'));var rimraf=require(_0x257b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x257b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x257b('0x4'));var util=require(_0x257b('0x5'));var path=require(_0x257b('0x6'));var sox=require(_0x257b('0x7'));var csv=require(_0x257b('0x8'));var ejs=require(_0x257b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x257b('0xa'));var crypto=require(_0x257b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x257b('0x8'));var querystring=require(_0x257b('0xc'));var Papa=require(_0x257b('0xd'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x257b('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x257b('0xf'))(_0x257b('0x10'));var utils=require(_0x257b('0x11'));var config=require('../../config/environment');var db=require(_0x257b('0x12'))['db'];var integrations=require(_0x257b('0x13'));var jayson=require(_0x257b('0x14'));var client=jayson[_0x257b('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0x247a97,_0x55d596,_0x3422c0,_0x425420){return new BPromise(function(_0x4a05e0,_0x443ed2){var _0x15e9da=_0x425420||client;return _0x15e9da[_0x257b('0x16')](_0x247a97,_0x3422c0)['then'](function(_0x32673b){logger[_0x257b('0x17')](_0x257b('0x18'),_0x55d596,'request\x20sent');logger[_0x257b('0x19')](_0x257b('0x1a'),_0x55d596,_0x257b('0x1b'),JSON[_0x257b('0x1c')](_0x32673b));if(_0x32673b[_0x257b('0x1d')]){if(_0x32673b[_0x257b('0x1d')]['code']===0x1f4){logger[_0x257b('0x1d')]('Dynamics365Account,\x20%s,\x20%s',_0x55d596,_0x32673b[_0x257b('0x1d')][_0x257b('0x1e')]);return _0x443ed2(_0x32673b[_0x257b('0x1d')]['message']);}logger[_0x257b('0x1d')](_0x257b('0x18'),_0x55d596,_0x32673b['error'][_0x257b('0x1e')]);return _0x4a05e0(_0x32673b[_0x257b('0x1d')]['message']);}else{logger['info'](_0x257b('0x18'),_0x55d596,_0x257b('0x1b'));_0x4a05e0(_0x32673b[_0x257b('0x1f')][_0x257b('0x1e')]);}})[_0x257b('0x20')](function(_0x3b75b7){logger[_0x257b('0x1d')](_0x257b('0x18'),_0x55d596,_0x3b75b7);_0x443ed2(_0x3b75b7);});});}function respondWithStatusCode(_0x20665c,_0x40fdf0){_0x40fdf0=_0x40fdf0||0xcc;return function(_0x547afa){if(_0x547afa){return _0x20665c[_0x257b('0x21')](_0x40fdf0);}return _0x20665c[_0x257b('0x22')](_0x40fdf0)[_0x257b('0x23')]();};}function respondWithResult(_0x394577,_0x17e25d){_0x17e25d=_0x17e25d||0xc8;return function(_0x4bdd42){if(_0x4bdd42){return _0x394577['status'](_0x17e25d)[_0x257b('0x24')](_0x4bdd42);}};}function respondWithFilteredResult(_0x3c5865,_0x4ead8b){return function(_0x37fb0c){if(_0x37fb0c){var _0x1c2a4b=_0x37fb0c[_0x257b('0x25')],_0xe260da=_0x4ead8b[_0x257b('0x26')],_0x44c940=_0x4ead8b[_0x257b('0x26')]+_0x4ead8b[_0x257b('0x27')],_0x4b473c;if(_0x44c940>=_0x1c2a4b){_0x44c940=_0x1c2a4b;_0x4b473c=0xc8;}else{_0x4b473c=0xce;}_0x3c5865[_0x257b('0x22')](_0x4b473c);return _0x3c5865[_0x257b('0x28')]('Content-Range',_0xe260da+'-'+_0x44c940+'/'+_0x1c2a4b)[_0x257b('0x24')](_0x37fb0c);}return null;};}function patchUpdates(_0x676bb6){return function(_0x410670){try{jsonpatch['apply'](_0x410670,_0x676bb6,!![]);}catch(_0xc17e1c){return BPromise[_0x257b('0x29')](_0xc17e1c);}return _0x410670[_0x257b('0x2a')]();};}function saveUpdates(_0x41644f,_0x47415f){return function(_0x2aaeab){if(_0x2aaeab){return _0x2aaeab[_0x257b('0x2b')](_0x41644f)[_0x257b('0x2c')](function(_0x56ddd2){return _0x56ddd2;});}return null;};}function removeEntity(_0x3b37cc,_0x483d93){return function(_0x303f35){if(_0x303f35){return _0x303f35[_0x257b('0x2d')]()['then'](function(){_0x3b37cc[_0x257b('0x22')](0xcc)[_0x257b('0x23')]();});}};}function handleEntityNotFound(_0xc8438,_0x407de2){return function(_0x217a5d){if(!_0x217a5d){_0xc8438['sendStatus'](0x194);}return _0x217a5d;};}function handleError(_0x3eb234,_0x5c41b0){_0x5c41b0=_0x5c41b0||0x1f4;return function(_0x563061){logger[_0x257b('0x1d')](_0x563061[_0x257b('0x2e')]);if(_0x563061[_0x257b('0x2f')]){delete _0x563061[_0x257b('0x2f')];}_0x3eb234[_0x257b('0x22')](_0x5c41b0)[_0x257b('0x30')](_0x563061);};}exports['index']=function(_0x279777,_0x4883bc){var _0x9a2bc7={},_0xa7da92={},_0x235e25={'count':0x0,'rows':[]};var _0x2e2a87=db[_0x257b('0x31')]['rawAttributes'];_0xa7da92[_0x257b('0x32')]=_[_0x257b('0x33')](_0x2e2a87);_0xa7da92[_0x257b('0x34')]=_['keys'](_0x279777[_0x257b('0x34')]);_0xa7da92[_0x257b('0x35')]=_[_0x257b('0x36')](_0xa7da92[_0x257b('0x32')],_0xa7da92[_0x257b('0x34')]);_0x9a2bc7[_0x257b('0x37')]=_[_0x257b('0x36')](_0xa7da92[_0x257b('0x32')],qs[_0x257b('0x38')](_0x279777[_0x257b('0x34')][_0x257b('0x38')]));_0x9a2bc7[_0x257b('0x37')]=_0x9a2bc7[_0x257b('0x37')]['length']?_0x9a2bc7[_0x257b('0x37')]:_0xa7da92['model'];if(!_0x279777[_0x257b('0x34')][_0x257b('0x39')]('nolimit')){_0x9a2bc7['limit']=qs[_0x257b('0x27')](_0x279777[_0x257b('0x34')]['limit']);_0x9a2bc7['offset']=qs['offset'](_0x279777[_0x257b('0x34')]['offset']);}_0x9a2bc7[_0x257b('0x3a')]=qs['sort'](_0x279777[_0x257b('0x34')][_0x257b('0x3b')]);_0x9a2bc7[_0x257b('0x3c')]=qs['filters'](_[_0x257b('0x3d')](_0x279777[_0x257b('0x34')],_0xa7da92[_0x257b('0x35')]));if(_0x279777[_0x257b('0x34')][_0x257b('0x3e')]){_0x9a2bc7[_0x257b('0x3c')]=_[_0x257b('0x3f')](_0x9a2bc7[_0x257b('0x3c')],{'$or':_[_0x257b('0x40')](_0x2e2a87,function(_0x3cfc2f){if(_0x3cfc2f['type']['key']!==_0x257b('0x41')){var _0x1fcc41={};_0x1fcc41[_0x3cfc2f['field']]={'$like':'%'+_0x279777[_0x257b('0x34')][_0x257b('0x3e')]+'%'};return _0x1fcc41;}})});}_0x9a2bc7=_[_0x257b('0x3f')]({},_0x9a2bc7,_0x279777[_0x257b('0x42')]);var _0x160290={'where':_0x9a2bc7['where']};return db[_0x257b('0x31')][_0x257b('0x25')](_0x160290)[_0x257b('0x2c')](function(_0x30c3db){_0x235e25[_0x257b('0x25')]=_0x30c3db;if(_0x279777['query'][_0x257b('0x43')]){_0x9a2bc7[_0x257b('0x44')]=[{'all':!![]}];}return db[_0x257b('0x31')][_0x257b('0x45')](_0x9a2bc7);})['then'](function(_0x147a48){_0x235e25[_0x257b('0x46')]=_0x147a48;return _0x235e25;})['then'](respondWithFilteredResult(_0x4883bc,_0x9a2bc7))[_0x257b('0x20')](handleError(_0x4883bc,null));};exports[_0x257b('0x47')]=function(_0xeb3e50,_0x539b0){var _0x559f9b={'raw':![],'where':{'id':_0xeb3e50['params']['id']}},_0x2f1436={};_0x2f1436[_0x257b('0x32')]=_[_0x257b('0x33')](db['Dynamics365Account'][_0x257b('0x48')]);_0x2f1436[_0x257b('0x34')]=_[_0x257b('0x33')](_0xeb3e50['query']);_0x2f1436[_0x257b('0x35')]=_[_0x257b('0x36')](_0x2f1436['model'],_0x2f1436['query']);_0x559f9b[_0x257b('0x37')]=_[_0x257b('0x36')](_0x2f1436[_0x257b('0x32')],qs[_0x257b('0x38')](_0xeb3e50[_0x257b('0x34')][_0x257b('0x38')]));_0x559f9b[_0x257b('0x37')]=_0x559f9b[_0x257b('0x37')][_0x257b('0x49')]?_0x559f9b['attributes']:_0x2f1436[_0x257b('0x32')];if(_0xeb3e50['query'][_0x257b('0x43')]){_0x559f9b['include']=[{'all':!![]}];}_0x559f9b=_[_0x257b('0x3f')]({},_0x559f9b,_0xeb3e50[_0x257b('0x42')]);return db['Dynamics365Account'][_0x257b('0x4a')](_0x559f9b)[_0x257b('0x2c')](handleEntityNotFound(_0x539b0,null))[_0x257b('0x2c')](respondWithResult(_0x539b0,null))[_0x257b('0x20')](handleError(_0x539b0,null));};exports[_0x257b('0x4b')]=function(_0x319ed9,_0xa73d2b){return db['Dynamics365Account']['create'](_0x319ed9['body'],{})[_0x257b('0x2c')](respondWithResult(_0xa73d2b,0xc9))['catch'](handleError(_0xa73d2b,null));};exports['update']=function(_0x4ee6ff,_0x34435d){if(_0x4ee6ff[_0x257b('0x4c')]['id']){delete _0x4ee6ff[_0x257b('0x4c')]['id'];}return db[_0x257b('0x31')][_0x257b('0x4a')]({'where':{'id':_0x4ee6ff[_0x257b('0x4d')]['id']}})[_0x257b('0x2c')](handleEntityNotFound(_0x34435d,null))[_0x257b('0x2c')](saveUpdates(_0x4ee6ff[_0x257b('0x4c')],null))['then'](respondWithResult(_0x34435d,null))[_0x257b('0x20')](handleError(_0x34435d,null));};exports[_0x257b('0x2d')]=function(_0x5c94ba,_0x461ec8){return db[_0x257b('0x31')]['find']({'where':{'id':_0x5c94ba[_0x257b('0x4d')]['id']}})[_0x257b('0x2c')](handleEntityNotFound(_0x461ec8,null))['then'](removeEntity(_0x461ec8,null))[_0x257b('0x20')](handleError(_0x461ec8,null));};exports['getConfigurations']=function(_0x2a9523,_0x5ac19c,_0x5d4deb){var _0x40c646={};var _0x502798={};var _0x3a621c;var _0x28d808;return db[_0x257b('0x31')][_0x257b('0x4e')]({'where':{'id':_0x2a9523['params']['id']}})[_0x257b('0x2c')](handleEntityNotFound(_0x5ac19c,null))[_0x257b('0x2c')](function(_0x19a8fa){if(_0x19a8fa){_0x3a621c=_0x19a8fa;_0x502798[_0x257b('0x32')]=_['keys'](db[_0x257b('0x4f')][_0x257b('0x48')]);_0x502798[_0x257b('0x34')]=_[_0x257b('0x33')](_0x2a9523['query']);_0x502798['filters']=_[_0x257b('0x36')](_0x502798[_0x257b('0x32')],_0x502798[_0x257b('0x34')]);_0x40c646['attributes']=_[_0x257b('0x36')](_0x502798['model'],qs['fields'](_0x2a9523[_0x257b('0x34')][_0x257b('0x38')]));_0x40c646['attributes']=_0x40c646[_0x257b('0x37')][_0x257b('0x49')]?_0x40c646[_0x257b('0x37')]:_0x502798[_0x257b('0x32')];_0x40c646[_0x257b('0x3a')]=qs['sort'](_0x2a9523[_0x257b('0x34')][_0x257b('0x3b')]);_0x40c646[_0x257b('0x3c')]=qs[_0x257b('0x35')](_['pick'](_0x2a9523['query'],_0x502798[_0x257b('0x35')]));if(_0x2a9523['query']['filter']){_0x40c646[_0x257b('0x3c')]=_[_0x257b('0x3f')](_0x40c646[_0x257b('0x3c')],{'$or':_[_0x257b('0x40')](_0x40c646['attributes'],function(_0x416740){var _0x1836e3={};_0x1836e3[_0x416740]={'$like':'%'+_0x2a9523[_0x257b('0x34')][_0x257b('0x3e')]+'%'};return _0x1836e3;})});}_0x40c646=_[_0x257b('0x3f')]({},_0x40c646,_0x2a9523[_0x257b('0x42')]);return _0x3a621c[_0x257b('0x50')](_0x40c646);}})[_0x257b('0x2c')](function(_0x3fc629){if(_0x3fc629){_0x28d808=_0x3fc629['length'];if(!_0x2a9523[_0x257b('0x34')][_0x257b('0x39')](_0x257b('0x51'))){_0x40c646[_0x257b('0x27')]=qs[_0x257b('0x27')](_0x2a9523[_0x257b('0x34')][_0x257b('0x27')]);_0x40c646[_0x257b('0x26')]=qs[_0x257b('0x26')](_0x2a9523[_0x257b('0x34')][_0x257b('0x26')]);}return _0x3a621c[_0x257b('0x50')](_0x40c646);}})[_0x257b('0x2c')](function(_0x4d3ceb){if(_0x4d3ceb){return _0x4d3ceb?{'count':_0x28d808,'rows':_0x4d3ceb}:null;}})['then'](respondWithResult(_0x5ac19c,null))[_0x257b('0x20')](handleError(_0x5ac19c,null));};exports[_0x257b('0x52')]=function(_0x4524fc,_0x1fd8d5,_0x17a36a){if(_0x4524fc['body']['id']){delete _0x4524fc[_0x257b('0x4c')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x4524fc[_0x257b('0x4d')]['id']}})[_0x257b('0x2c')](handleEntityNotFound(_0x1fd8d5,null))[_0x257b('0x2c')](function(_0x41a288){if(_0x41a288){_0x4524fc[_0x257b('0x4c')]['AccountId']=_0x41a288['id'];_0x4524fc[_0x257b('0x4c')][_0x257b('0x53')]=integrations['getSubjects'](_0x4524fc['body'][_0x257b('0x54')],_0x4524fc[_0x257b('0x4c')][_0x257b('0x55')]);_0x4524fc[_0x257b('0x4c')][_0x257b('0x56')]=integrations[_0x257b('0x57')](_0x4524fc[_0x257b('0x4c')][_0x257b('0x54')],_0x4524fc['body']['type']);return db[_0x257b('0x4f')][_0x257b('0x4b')](_0x4524fc['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x257b('0x53')},{'model':db[_0x257b('0x58')],'as':_0x257b('0x56')}]});}return null;})[_0x257b('0x2c')](respondWithResult(_0x1fd8d5,null))[_0x257b('0x20')](handleError(_0x1fd8d5,null));};exports[_0x257b('0x59')]=function(_0x58e4e7,_0x8eb200,_0x3edb32){var _0x58d15e=_0x58e4e7[_0x257b('0x34')][_0x257b('0x5a')];var _0x13c072=_0x58d15e===_0x257b('0x5b')?'Incident':'PhoneCall';var _0x358f56='';var _0x4abd10='';var _0x166eaf='';var _0x29b56b='';var _0x4ba824='';var _0x5d424c='';var _0x4c3e5a='';var _0x46dddd=['title',_0x257b('0x5c'),_0x257b('0x5d'),_0x257b('0x5e'),'caseorigincode',_0x257b('0x5f'),_0x257b('0x60'),_0x257b('0x61'),'directioncode',_0x257b('0x62')];var _0x1630f9=[_0x257b('0x63'),'accountidyominame','actualserviceunits',_0x257b('0x64'),_0x257b('0x65'),_0x257b('0x66'),'contractdetailidname',_0x257b('0x67'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0x257b('0x68'),_0x257b('0x69'),'createdon',_0x257b('0x6a'),_0x257b('0x6b'),'customeridname',_0x257b('0x6c'),'customeridyominame',_0x257b('0x6d'),'entitlementidname','entityimage_timestamp',_0x257b('0x6e'),_0x257b('0x6f'),_0x257b('0x70'),_0x257b('0x71'),_0x257b('0x72'),_0x257b('0x73'),_0x257b('0x74'),_0x257b('0x75'),_0x257b('0x76'),_0x257b('0x77'),_0x257b('0x78'),'modifiedbyexternalpartyyominame',_0x257b('0x79'),_0x257b('0x7a'),'modifiedon',_0x257b('0x7b'),'modifiedonbehalfbyyominame',_0x257b('0x7c'),_0x257b('0x7d'),_0x257b('0x7e'),'onholdtime',_0x257b('0x7f'),_0x257b('0x80'),_0x257b('0x81'),_0x257b('0x82'),_0x257b('0x83'),_0x257b('0x84'),_0x257b('0x85'),'prioritycodename',_0x257b('0x86'),_0x257b('0x87'),_0x257b('0x88'),_0x257b('0x89'),'responseby','responsiblecontactidname',_0x257b('0x8a'),_0x257b('0x8b'),'slainvokedidname',_0x257b('0x8c'),_0x257b('0x8d'),_0x257b('0x8e'),_0x257b('0x8f'),_0x257b('0x90'),_0x257b('0x91'),_0x257b('0x92'),'transactioncurrencyidname',_0x257b('0x93'),_0x257b('0x94'),_0x257b('0x95')];var _0x183355=_0x46dddd[_0x257b('0x96')](_0x1630f9);return db['Dynamics365Account'][_0x257b('0x4e')]({'where':{'id':_0x58e4e7['params']['id']},'attributes':['id',_0x257b('0x97'),_0x257b('0x98'),_0x257b('0x99'),_0x257b('0x9a'),_0x257b('0x9b'),_0x257b('0x9c')]})[_0x257b('0x2c')](handleEntityNotFound(_0x8eb200,null))[_0x257b('0x2c')](function(_0xb2f022){if(_0xb2f022){_0x4c3e5a=util[_0x257b('0x9d')](_0x257b('0x9e'),_0xb2f022[_0x257b('0x99')]);var _0x424afa={'method':_0x257b('0x9f'),'uri':_0x257b('0xa0')+_0xb2f022[_0x257b('0x9a')]+'/oauth2/token','form':{'client_id':_0xb2f022[_0x257b('0x9b')],'resource':_0xb2f022[_0x257b('0x99')],'username':_0xb2f022['username'],'password':_0xb2f022[_0x257b('0x98')],'grant_type':_0x257b('0x98'),'client_secret':_0xb2f022['clientSecret']},'json':!![]};return rp(_0x424afa);}})[_0x257b('0x2c')](function(_0x49a3f5){_0x5d424c=_0x49a3f5['access_token'];var _0x45696d={'method':'GET','uri':encodeURI(_0x4c3e5a+_0x257b('0xa1')+_0x13c072+'\x27'),'headers':{'Authorization':_0x257b('0xa2')+_0x5d424c,'If-None-Match':null,'OData-Version':_0x257b('0xa3')},'json':!![]};return rp(_0x45696d);})[_0x257b('0x2c')](function(_0x47c454){var _0x5b65c0=_0x47c454[_0x257b('0xa4')][0x0];var _0x3df177=_0x5b65c0[_0x257b('0xa5')];var _0x2fe59b={'method':'GET','uri':_0x4c3e5a+_0x257b('0xa6')+_0x3df177+_0x257b('0xa7'),'headers':{'Authorization':_0x257b('0xa2')+_0x5d424c,'If-None-Match':null,'OData-Version':_0x257b('0xa3')},'json':!![]};return rp(_0x2fe59b);})[_0x257b('0x2c')](function(_0x2c5250){_0x358f56=_0x2c5250;_0x4abd10=_0x358f56['Attributes'];_0x4abd10=_[_0x257b('0xa8')](_0x4abd10,function(_0x560d52){return!_0x183355[_0x257b('0xa9')](_0x560d52[_0x257b('0xaa')]);});var _0x265f11=[];var _0x15c6e6=[];_0x4abd10['forEach'](function(_0x5a80a9){if(_0x5a80a9[_0x257b('0xab')]){var _0x5b3a88=_0x5a80a9[_0x257b('0xab')][_0x257b('0xac')](_0x5a80a9[_0x257b('0xab')]['lastIndexOf']('.')+0x1);if(_0x5b3a88===_0x257b('0xad')){_0x265f11[_0x257b('0xae')](getSelectList(_0x4c3e5a,_0x58d15e,_0x15c6e6,_0x358f56[_0x257b('0xa5')],_0x5a80a9['MetadataId'],_0x5d424c));}}});return Promise[_0x257b('0xaf')](_0x265f11);})[_0x257b('0x2c')](function(_0x44abf6){_0x166eaf=_0x44abf6[0x0];var _0x2be7fc=[];var _0x5ca171=[];_0x4abd10[_0x257b('0xb0')](function(_0xd43c90){if(_0xd43c90[_0x257b('0xab')]){var _0x1382f9=_0xd43c90['@odata.type'][_0x257b('0xac')](_0xd43c90[_0x257b('0xab')]['lastIndexOf']('.')+0x1);if(_0x1382f9==='BooleanAttributeMetadata'){_0x2be7fc[_0x257b('0xae')](getBooleanList(_0x4c3e5a,_0x58d15e,_0x5ca171,_0x358f56['MetadataId'],_0xd43c90[_0x257b('0xa5')],_0x5d424c));}}});return Promise[_0x257b('0xaf')](_0x2be7fc);})['then'](function(_0x354920){_0x29b56b=_0x354920[0x0];var _0x4011e0=[];var _0xfd694c=[];_0x4abd10['forEach'](function(_0x2a0bfd){if(_0x2a0bfd[_0x257b('0xab')]){var _0x4d13a9=_0x2a0bfd['@odata.type']['substring'](_0x2a0bfd[_0x257b('0xab')]['lastIndexOf']('.')+0x1);if(_0x4d13a9===_0x257b('0xb1')||_0x4d13a9===_0x257b('0xb2')||_0x4d13a9===_0x257b('0xb3')||_0x4d13a9===_0x257b('0xb4')||_0x4d13a9===_0x257b('0xb5')||_0x4d13a9===_0x257b('0xb6')||_0x4d13a9===_0x257b('0xb7')||_0x4d13a9===_0x257b('0xb8')||_0x4d13a9===_0x257b('0xb9')||_0x4d13a9===_0x257b('0xba')){_0x4011e0['push'](getInputList(_0x4c3e5a,_0x58d15e,_0x4d13a9,_0xfd694c,_0x358f56[_0x257b('0xa5')],_0x2a0bfd['MetadataId'],_0x5d424c));}}});return Promise['all'](_0x4011e0);})[_0x257b('0x2c')](function(_0x5e9cc8){_0x4ba824=_0x5e9cc8[0x0];var _0x10f600=_0x166eaf['concat'](_0x29b56b)['concat'](_0x4ba824);var _0x3e6699={'count':_0x10f600[_0x257b('0x49')],'rows':_0x10f600};return _0x3e6699;})[_0x257b('0x2c')](respondWithResult(_0x8eb200,null))[_0x257b('0x20')](function(_0x3c4b8a){console['log'](_0x257b('0xbb')+_0x3c4b8a);var _0x1aec25=_0x58e4e7[_0x257b('0x34')][_0x257b('0xbc')]?0x1f4:_0x3c4b8a['statusCode']||0x1f4;logger[_0x257b('0x1d')](_0x3c4b8a[_0x257b('0x2e')]);delete _0x3c4b8a[_0x257b('0x2f')];if(_0x1aec25===0x191){_0x1aec25=0x190;}_0x8eb200['status'](_0x1aec25)['send'](_0x58e4e7[_0x257b('0x34')][_0x257b('0xbc')]?{'message':_0x257b('0xbd'),'statusCode':_0x3c4b8a[_0x257b('0xbe')]}:_0x3c4b8a);});};function getSelectList(_0x2eba54,_0x305a92,_0x286006,_0x43d200,_0x47b82d,_0x4bb60b){var _0x4b8f03={'method':_0x257b('0xbf'),'uri':_0x2eba54+_0x257b('0xa6')+_0x43d200+_0x257b('0xc0')+_0x47b82d+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x257b('0xc1'),'headers':{'Authorization':_0x257b('0xa2')+_0x4bb60b,'If-None-Match':null,'OData-Version':_0x257b('0xa3')},'json':!![]};return rp(_0x4b8f03)[_0x257b('0x2c')](function(_0x3bd57a){var _0x447c61=[];var _0x37411b=_0x3bd57a['OptionSet']['Options'];_0x37411b[_0x257b('0xb0')](function(_0x33fb02){_0x447c61[_0x257b('0xae')]({'name':_0x33fb02[_0x257b('0xc2')]['UserLocalizedLabel'][_0x257b('0xc2')],'value':String(_0x33fb02[_0x257b('0xc3')])});});var _0x31aa79={'id':_0x305a92+'_'+_0x3bd57a[_0x257b('0xaa')],'name':_0x3bd57a[_0x257b('0xc4')][_0x257b('0xc5')][_0x257b('0xc2')],'custom':![],'options':_0x447c61};_0x286006[_0x257b('0xae')](_0x31aa79);return _0x286006;});}function getBooleanList(_0x27cc3e,_0xb41fd3,_0x488c48,_0x408213,_0x3ba672,_0x369842){var _0x3c1ab4={'method':_0x257b('0xbf'),'uri':_0x27cc3e+_0x257b('0xa6')+_0x408213+')/Attributes('+_0x3ba672+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x257b('0xa2')+_0x369842,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3c1ab4)['then'](function(_0x583cfc){var _0x728fc=[];_0x728fc[_0x257b('0xae')]({'name':_0x583cfc[_0x257b('0xc6')]['TrueOption'][_0x257b('0xc2')][_0x257b('0xc5')][_0x257b('0xc2')],'value':String(_0x583cfc['OptionSet'][_0x257b('0xc7')][_0x257b('0xc3')])},{'name':_0x583cfc[_0x257b('0xc6')][_0x257b('0xc8')][_0x257b('0xc2')][_0x257b('0xc5')][_0x257b('0xc2')],'value':String(_0x583cfc[_0x257b('0xc6')][_0x257b('0xc8')][_0x257b('0xc3')])});var _0x1eaaf1={'id':_0xb41fd3+'_'+_0x583cfc['LogicalName'],'name':_0x583cfc[_0x257b('0xc4')][_0x257b('0xc5')]['Label'],'custom':![],'options':_0x728fc};_0x488c48[_0x257b('0xae')](_0x1eaaf1);return _0x488c48;});}function getInputList(_0x19881e,_0x3df724,_0x576c3a,_0x1bb350,_0x32125c,_0xdf5529,_0x54266d){var _0x257bb1={'method':_0x257b('0xbf'),'uri':_0x19881e+_0x257b('0xa6')+_0x32125c+_0x257b('0xc0')+_0xdf5529+_0x257b('0xc9')+_0x576c3a+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x257b('0xa2')+_0x54266d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x257bb1)[_0x257b('0x2c')](function(_0x5313d4){var _0x1f7151={'id':_0x3df724+'_'+_0x5313d4[_0x257b('0xaa')],'name':_0x5313d4[_0x257b('0xc4')]['UserLocalizedLabel']?_0x5313d4[_0x257b('0xc4')][_0x257b('0xc5')][_0x257b('0xc2')]:_0x5313d4[_0x257b('0xaa')],'custom':![],'options':[]};_0x1bb350[_0x257b('0xae')](_0x1f7151);return _0x1bb350;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 908cc80..cb4e706 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 _0x6f0f=['define','int_dynamics365_accounts','util','../../config/logger','api','moment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x386b03,_0x5d0000){var _0xd3d524=function(_0x474754){while(--_0x474754){_0x386b03['push'](_0x386b03['shift']());}};_0xd3d524(++_0x5d0000);}(_0x6f0f,0xb2));var _0xf6f0=function(_0x158a01,_0x50bcb8){_0x158a01=_0x158a01-0x0;var _0x94b215=_0x6f0f[_0x158a01];return _0x94b215;};'use strict';var _=require('lodash');var util=require(_0xf6f0('0x0'));var logger=require(_0xf6f0('0x1'))(_0xf6f0('0x2'));var moment=require(_0xf6f0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xf6f0('0x4'));var integrations=require(_0xf6f0('0x5'));module['exports']=function(_0x2ea531,_0x43a4c3){return _0x2ea531[_0xf6f0('0x6')]('Dynamics365Account',attributes,{'tableName':_0xf6f0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49e5=['../../components/integrations/configuration','define','Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intDynamics365Account.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x49e5,0x1cc));var _0x549e=function(_0xc48607,_0x404775){_0xc48607=_0xc48607-0x0;var _0x5f2fc1=_0x49e5[_0xc48607];return _0x5f2fc1;};'use strict';var _=require(_0x549e('0x0'));var util=require(_0x549e('0x1'));var logger=require(_0x549e('0x2'))(_0x549e('0x3'));var moment=require(_0x549e('0x4'));var BPromise=require(_0x549e('0x5'));var rp=require(_0x549e('0x6'));var attributes=require(_0x549e('0x7'));var integrations=require(_0x549e('0x8'));module['exports']=function(_0x221e78,_0x31543b){return _0x221e78[_0x549e('0x9')](_0x549e('0xa'),attributes,{'tableName':_0x549e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 39293dd..25d1043 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 _0x571c=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','ShowDynamics365Account','find','stringify','lodash','util'];(function(_0x387bdf,_0x34af51){var _0x2e9c9e=function(_0x492c7b){while(--_0x492c7b){_0x387bdf['push'](_0x387bdf['shift']());}};_0x2e9c9e(++_0x34af51);}(_0x571c,0x139));var _0xc571=function(_0x39af44,_0x156f16){_0x39af44=_0x39af44-0x0;var _0x20ead6=_0x571c[_0x39af44];return _0x20ead6;};'use strict';var _=require(_0xc571('0x0'));var util=require(_0xc571('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc571('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc571('0x3'))['db'];var utils=require(_0xc571('0x4'));var logger=require(_0xc571('0x5'))('rpc');var config=require(_0xc571('0x6'));var jayson=require(_0xc571('0x7'));var client=jayson[_0xc571('0x8')][_0xc571('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x518051,_0x410334,_0x45d41d){return new BPromise(function(_0x28e67b,_0x564714){return client[_0xc571('0xa')](_0x518051,_0x45d41d)['then'](function(_0x2289a8){logger[_0xc571('0xb')](_0xc571('0xc'),_0x410334,_0xc571('0xd'));logger[_0xc571('0xe')](_0xc571('0xf'),_0x410334,_0xc571('0xd'),JSON['stringify'](_0x2289a8));if(_0x2289a8['error']){if(_0x2289a8[_0xc571('0x10')][_0xc571('0x11')]===0x1f4){logger['error'](_0xc571('0xc'),_0x410334,_0x2289a8[_0xc571('0x10')][_0xc571('0x12')]);return _0x564714(_0x2289a8['error'][_0xc571('0x12')]);}logger['error'](_0xc571('0xc'),_0x410334,_0x2289a8[_0xc571('0x10')][_0xc571('0x12')]);return _0x28e67b(_0x2289a8[_0xc571('0x10')][_0xc571('0x12')]);}else{logger['info'](_0xc571('0xc'),_0x410334,_0xc571('0xd'));_0x28e67b(_0x2289a8['result'][_0xc571('0x12')]);}})['catch'](function(_0x298d6b){logger[_0xc571('0x10')](_0xc571('0xc'),_0x410334,_0x298d6b);_0x564714(_0x298d6b);});});}exports[_0xc571('0x13')]=function(_0x54270d){var _0x15e321=this;return new Promise(function(_0x968315,_0xe86653){return db[_0xc571('0x14')][_0xc571('0x15')]({'raw':_0x54270d[_0xc571('0x16')]?_0x54270d[_0xc571('0x16')][_0xc571('0x17')]===undefined?!![]:![]:!![],'where':_0x54270d[_0xc571('0x16')]?_0x54270d[_0xc571('0x16')][_0xc571('0x18')]||null:null,'attributes':_0x54270d[_0xc571('0x16')]?_0x54270d[_0xc571('0x16')][_0xc571('0x19')]||null:null,'limit':_0x54270d[_0xc571('0x16')]?_0x54270d[_0xc571('0x16')][_0xc571('0x1a')]||null:null,'include':_0x54270d[_0xc571('0x16')]?_0x54270d[_0xc571('0x16')][_0xc571('0x1b')]?_[_0xc571('0x1c')](_0x54270d[_0xc571('0x16')][_0xc571('0x1b')],function(_0x324b3c){return{'model':db[_0x324b3c[_0xc571('0x1d')]],'as':_0x324b3c['as'],'attributes':_0x324b3c['attributes'],'include':_0x324b3c['include']?_['map'](_0x324b3c[_0xc571('0x1b')],function(_0xc8f9c9){return{'model':db[_0xc8f9c9[_0xc571('0x1d')]],'as':_0xc8f9c9['as'],'attributes':_0xc8f9c9['attributes'],'include':_0xc8f9c9[_0xc571('0x1b')]?_[_0xc571('0x1c')](_0xc8f9c9[_0xc571('0x1b')],function(_0x4e06b0){return{'model':db[_0x4e06b0[_0xc571('0x1d')]],'as':_0x4e06b0['as'],'attributes':_0x4e06b0['attributes']};}):[]};}):[]};}):[]:[]})[_0xc571('0x1e')](function(_0x599d5d){logger[_0xc571('0xb')](_0xc571('0x13'),_0x54270d);logger[_0xc571('0xe')](_0xc571('0x13'),_0x54270d,JSON['stringify'](_0x599d5d));_0x968315(_0x599d5d);})[_0xc571('0x1f')](function(_0x766fe0){logger[_0xc571('0x10')](_0xc571('0x13'),_0x766fe0[_0xc571('0x12')],_0x54270d);_0xe86653(_0x15e321[_0xc571('0x10')](0x1f4,_0x766fe0[_0xc571('0x12')]));});});};exports[_0xc571('0x20')]=function(_0x299cb0){var _0x2dd181=this;return new Promise(function(_0x3124b4,_0x21901e){return db[_0xc571('0x14')][_0xc571('0x21')]({'raw':_0x299cb0['options']?_0x299cb0['options'][_0xc571('0x17')]===undefined?!![]:![]:!![],'where':_0x299cb0[_0xc571('0x16')]?_0x299cb0['options'][_0xc571('0x18')]||null:null,'attributes':_0x299cb0[_0xc571('0x16')]?_0x299cb0[_0xc571('0x16')][_0xc571('0x19')]||null:null,'include':_0x299cb0[_0xc571('0x16')]?_0x299cb0[_0xc571('0x16')][_0xc571('0x1b')]?_[_0xc571('0x1c')](_0x299cb0[_0xc571('0x16')][_0xc571('0x1b')],function(_0x4b2da7){return{'model':db[_0x4b2da7[_0xc571('0x1d')]],'as':_0x4b2da7['as'],'attributes':_0x4b2da7[_0xc571('0x19')],'include':_0x4b2da7[_0xc571('0x1b')]?_[_0xc571('0x1c')](_0x4b2da7['include'],function(_0xe34088){return{'model':db[_0xe34088[_0xc571('0x1d')]],'as':_0xe34088['as'],'attributes':_0xe34088[_0xc571('0x19')],'include':_0xe34088['include']?_[_0xc571('0x1c')](_0xe34088[_0xc571('0x1b')],function(_0x3fb8b0){return{'model':db[_0x3fb8b0[_0xc571('0x1d')]],'as':_0x3fb8b0['as'],'attributes':_0x3fb8b0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x6bc160){logger['info'](_0xc571('0x20'),_0x299cb0);logger[_0xc571('0xe')](_0xc571('0x20'),_0x299cb0,JSON[_0xc571('0x22')](_0x6bc160));_0x3124b4(_0x6bc160);})[_0xc571('0x1f')](function(_0x15e607){logger['error'](_0xc571('0x20'),_0x15e607[_0xc571('0x12')],_0x299cb0);_0x21901e(_0x2dd181[_0xc571('0x10')](0x1f4,_0x15e607[_0xc571('0x12')]));});});}; \ No newline at end of file +var _0xc115=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','map','include','model','find','ShowDynamics365Account','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x24617e,_0x346651){var _0x4bdda3=function(_0x322827){while(--_0x322827){_0x24617e['push'](_0x24617e['shift']());}};_0x4bdda3(++_0x346651);}(_0xc115,0xee));var _0x5c11=function(_0x5eb71d,_0x198b99){_0x5eb71d=_0x5eb71d-0x0;var _0x99c95a=_0xc115[_0x5eb71d];return _0x99c95a;};'use strict';var _=require(_0x5c11('0x0'));var util=require(_0x5c11('0x1'));var moment=require(_0x5c11('0x2'));var BPromise=require('bluebird');var rs=require(_0x5c11('0x3'));var fs=require('fs');var Redis=require(_0x5c11('0x4'));var db=require(_0x5c11('0x5'))['db'];var utils=require(_0x5c11('0x6'));var logger=require(_0x5c11('0x7'))(_0x5c11('0x8'));var config=require(_0x5c11('0x9'));var jayson=require(_0x5c11('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a54d8,_0x1c8da1,_0x8587d7){return new BPromise(function(_0x4ffcbe,_0x5d17b9){return client[_0x5c11('0xb')](_0x4a54d8,_0x8587d7)[_0x5c11('0xc')](function(_0x477fce){logger[_0x5c11('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x1c8da1,'request\x20sent');logger[_0x5c11('0xe')](_0x5c11('0xf'),_0x1c8da1,_0x5c11('0x10'),JSON[_0x5c11('0x11')](_0x477fce));if(_0x477fce[_0x5c11('0x12')]){if(_0x477fce['error'][_0x5c11('0x13')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x1c8da1,_0x477fce[_0x5c11('0x12')][_0x5c11('0x14')]);return _0x5d17b9(_0x477fce[_0x5c11('0x12')][_0x5c11('0x14')]);}logger[_0x5c11('0x12')](_0x5c11('0x15'),_0x1c8da1,_0x477fce[_0x5c11('0x12')]['message']);return _0x4ffcbe(_0x477fce[_0x5c11('0x12')]['message']);}else{logger[_0x5c11('0xd')](_0x5c11('0x15'),_0x1c8da1,_0x5c11('0x10'));_0x4ffcbe(_0x477fce[_0x5c11('0x16')][_0x5c11('0x14')]);}})[_0x5c11('0x17')](function(_0x4919b5){logger[_0x5c11('0x12')](_0x5c11('0x15'),_0x1c8da1,_0x4919b5);_0x5d17b9(_0x4919b5);});});}exports[_0x5c11('0x18')]=function(_0x5bac53){var _0x837b4b=this;return new Promise(function(_0x57a961,_0x1695c8){return db[_0x5c11('0x19')][_0x5c11('0x1a')]({'raw':_0x5bac53[_0x5c11('0x1b')]?_0x5bac53[_0x5c11('0x1b')][_0x5c11('0x1c')]===undefined?!![]:![]:!![],'where':_0x5bac53[_0x5c11('0x1b')]?_0x5bac53[_0x5c11('0x1b')]['where']||null:null,'attributes':_0x5bac53[_0x5c11('0x1b')]?_0x5bac53[_0x5c11('0x1b')][_0x5c11('0x1d')]||null:null,'limit':_0x5bac53['options']?_0x5bac53['options']['limit']||null:null,'include':_0x5bac53['options']?_0x5bac53[_0x5c11('0x1b')]['include']?_[_0x5c11('0x1e')](_0x5bac53[_0x5c11('0x1b')][_0x5c11('0x1f')],function(_0x1aad7b){return{'model':db[_0x1aad7b[_0x5c11('0x20')]],'as':_0x1aad7b['as'],'attributes':_0x1aad7b['attributes'],'include':_0x1aad7b[_0x5c11('0x1f')]?_[_0x5c11('0x1e')](_0x1aad7b[_0x5c11('0x1f')],function(_0x260a4c){return{'model':db[_0x260a4c['model']],'as':_0x260a4c['as'],'attributes':_0x260a4c[_0x5c11('0x1d')],'include':_0x260a4c[_0x5c11('0x1f')]?_[_0x5c11('0x1e')](_0x260a4c[_0x5c11('0x1f')],function(_0x42a210){return{'model':db[_0x42a210[_0x5c11('0x20')]],'as':_0x42a210['as'],'attributes':_0x42a210[_0x5c11('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5c11('0xc')](function(_0x2200b7){logger['info'](_0x5c11('0x18'),_0x5bac53);logger['debug'](_0x5c11('0x18'),_0x5bac53,JSON[_0x5c11('0x11')](_0x2200b7));_0x57a961(_0x2200b7);})['catch'](function(_0x284cb3){logger['error']('GetDynamics365Account',_0x284cb3[_0x5c11('0x14')],_0x5bac53);_0x1695c8(_0x837b4b[_0x5c11('0x12')](0x1f4,_0x284cb3['message']));});});};exports['ShowDynamics365Account']=function(_0x5dad2a){var _0x22c128=this;return new Promise(function(_0x5bb92c,_0x660e04){return db[_0x5c11('0x19')][_0x5c11('0x21')]({'raw':_0x5dad2a[_0x5c11('0x1b')]?_0x5dad2a[_0x5c11('0x1b')][_0x5c11('0x1c')]===undefined?!![]:![]:!![],'where':_0x5dad2a[_0x5c11('0x1b')]?_0x5dad2a[_0x5c11('0x1b')]['where']||null:null,'attributes':_0x5dad2a['options']?_0x5dad2a['options'][_0x5c11('0x1d')]||null:null,'include':_0x5dad2a['options']?_0x5dad2a['options']['include']?_[_0x5c11('0x1e')](_0x5dad2a['options'][_0x5c11('0x1f')],function(_0xa44ea7){return{'model':db[_0xa44ea7[_0x5c11('0x20')]],'as':_0xa44ea7['as'],'attributes':_0xa44ea7['attributes'],'include':_0xa44ea7[_0x5c11('0x1f')]?_[_0x5c11('0x1e')](_0xa44ea7[_0x5c11('0x1f')],function(_0x129b75){return{'model':db[_0x129b75[_0x5c11('0x20')]],'as':_0x129b75['as'],'attributes':_0x129b75[_0x5c11('0x1d')],'include':_0x129b75[_0x5c11('0x1f')]?_[_0x5c11('0x1e')](_0x129b75[_0x5c11('0x1f')],function(_0x3de3b4){return{'model':db[_0x3de3b4['model']],'as':_0x3de3b4['as'],'attributes':_0x3de3b4['attributes']};}):[]};}):[]};}):[]:[]})[_0x5c11('0xc')](function(_0xed3103){logger[_0x5c11('0xd')](_0x5c11('0x22'),_0x5dad2a);logger[_0x5c11('0xe')](_0x5c11('0x22'),_0x5dad2a,JSON[_0x5c11('0x11')](_0xed3103));_0x5bb92c(_0xed3103);})[_0x5c11('0x17')](function(_0x505e39){logger[_0x5c11('0x12')](_0x5c11('0x22'),_0x505e39['message'],_0x5dad2a);_0x660e04(_0x22c128[_0x5c11('0x12')](0x1f4,_0x505e39[_0x5c11('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 6a53fa6..18a7888 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 _0xa063=['getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','multer','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x4c8b3c,_0x7e98d9){var _0x3f0239=function(_0x37aae9){while(--_0x37aae9){_0x4c8b3c['push'](_0x4c8b3c['shift']());}};_0x3f0239(++_0x7e98d9);}(_0xa063,0xe4));var _0x3a06=function(_0x3dc236,_0x40142b){_0x3dc236=_0x3dc236-0x0;var _0x331f90=_0xa063[_0x3dc236];return _0x331f90;};'use strict';var multer=require(_0x3a06('0x0'));var util=require('util');var path=require(_0x3a06('0x1'));var timeout=require('connect-timeout');var express=require(_0x3a06('0x2'));var router=express[_0x3a06('0x3')]();var auth=require(_0x3a06('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3a06('0x5'));var controller=require('./intDynamics365Configuration.controller');router[_0x3a06('0x6')]('/',auth[_0x3a06('0x7')](),controller[_0x3a06('0x8')]);router['get'](_0x3a06('0x9'),auth[_0x3a06('0x7')](),controller[_0x3a06('0xa')]);router[_0x3a06('0x6')](_0x3a06('0xb'),auth['isAuthenticated'](),controller[_0x3a06('0xc')]);router[_0x3a06('0x6')](_0x3a06('0xd'),auth[_0x3a06('0x7')](),controller[_0x3a06('0xe')]);router[_0x3a06('0x6')](_0x3a06('0xf'),auth[_0x3a06('0x7')](),controller['getDescriptions']);router[_0x3a06('0x10')]('/',auth[_0x3a06('0x7')](),controller[_0x3a06('0x11')]);router[_0x3a06('0x12')](_0x3a06('0x9'),auth['isAuthenticated'](),controller[_0x3a06('0x13')]);router['delete']('/:id',auth[_0x3a06('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdb19=['../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','update','delete','destroy','util','path','express','Router'];(function(_0x5413ed,_0x1a6fa0){var _0x8ab64=function(_0x43bcad){while(--_0x43bcad){_0x5413ed['push'](_0x5413ed['shift']());}};_0x8ab64(++_0x1a6fa0);}(_0xdb19,0xb0));var _0x9db1=function(_0xf36354,_0x55640e){_0xf36354=_0xf36354-0x0;var _0x559d8e=_0xdb19[_0xf36354];return _0x559d8e;};'use strict';var multer=require('multer');var util=require(_0x9db1('0x0'));var path=require(_0x9db1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9db1('0x2'));var router=express[_0x9db1('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9db1('0x4'));var controller=require('./intDynamics365Configuration.controller');router[_0x9db1('0x5')]('/',auth['isAuthenticated'](),controller[_0x9db1('0x6')]);router[_0x9db1('0x5')](_0x9db1('0x7'),auth[_0x9db1('0x8')](),controller[_0x9db1('0x9')]);router[_0x9db1('0x5')](_0x9db1('0xa'),auth[_0x9db1('0x8')](),controller[_0x9db1('0xb')]);router[_0x9db1('0x5')](_0x9db1('0xc'),auth[_0x9db1('0x8')](),controller[_0x9db1('0xd')]);router[_0x9db1('0x5')](_0x9db1('0xe'),auth[_0x9db1('0x8')](),controller['getDescriptions']);router[_0x9db1('0xf')]('/',auth[_0x9db1('0x8')](),controller[_0x9db1('0x10')]);router['put'](_0x9db1('0x7'),auth[_0x9db1('0x8')](),controller[_0x9db1('0x11')]);router[_0x9db1('0x12')](_0x9db1('0x7'),auth[_0x9db1('0x8')](),controller[_0x9db1('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 03219f7..34cdd1a 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 _0xb7d5=['incident','phonecall','sequelize','exports','STRING','ENUM'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xb7d5,0x1a6));var _0x5b7d=function(_0x5a0211,_0xaca5e4){_0x5a0211=_0x5a0211-0x0;var _0x59d0ce=_0xb7d5[_0x5a0211];return _0x59d0ce;};'use strict';var Sequelize=require(_0x5b7d('0x0'));module[_0x5b7d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5b7d('0x2')]},'ticketType':{'type':Sequelize[_0x5b7d('0x3')](_0x5b7d('0x4'),_0x5b7d('0x5')),'defaultValue':_0x5b7d('0x4')}}; \ No newline at end of file +var _0x835b=['phonecall','sequelize','exports','STRING','ENUM'];(function(_0x25c988,_0xce8221){var _0x45fcc2=function(_0x47fba5){while(--_0x47fba5){_0x25c988['push'](_0x25c988['shift']());}};_0x45fcc2(++_0xce8221);}(_0x835b,0x1e6));var _0xb835=function(_0x14a1b4,_0x2c72b0){_0x14a1b4=_0x14a1b4-0x0;var _0x3cb209=_0x835b[_0x14a1b4];return _0x3cb209;};'use strict';var Sequelize=require(_0xb835('0x0'));module[_0xb835('0x1')]={'name':{'type':Sequelize[_0xb835('0x2')]},'description':{'type':Sequelize[_0xb835('0x2')]},'ticketType':{'type':Sequelize[_0xb835('0x3')]('incident',_0xb835('0x4')),'defaultValue':'incident'}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 02b9066..4e70545 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 _0x536f=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','getFields','findOne','Dynamics365Field','order','getSubjects','getDescriptions','html-pdf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../config/license/hardware','ioredis','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','stack','name','send','Dynamics365Configuration','rawAttributes','query','filters','attributes','intersection','fields','length','model'];(function(_0x5e9b7d,_0x259099){var _0x24617c=function(_0x229916){while(--_0x229916){_0x5e9b7d['push'](_0x5e9b7d['shift']());}};_0x24617c(++_0x259099);}(_0x536f,0x70));var _0xf536=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x536f[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0xf536('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf536('0x1'));var moment=require(_0xf536('0x2'));var BPromise=require(_0xf536('0x3'));var Mustache=require(_0xf536('0x4'));var util=require('util');var path=require(_0xf536('0x5'));var sox=require('sox');var csv=require(_0xf536('0x6'));var ejs=require(_0xf536('0x7'));var fs=require('fs');var _=require(_0xf536('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf536('0x9'));var deskjs=require(_0xf536('0xa'));var toCsv=require(_0xf536('0x6'));var querystring=require(_0xf536('0xb'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xf536('0xc'));var Redis=require(_0xf536('0xd'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf536('0xe'));var utils=require(_0xf536('0xf'));var config=require(_0xf536('0x10'));var db=require(_0xf536('0x11'))['db'];var jayson=require(_0xf536('0x12'));var client=jayson['client'][_0xf536('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x539d44,_0x146970,_0xd76d38,_0x11136e){return new BPromise(function(_0x3b5df6,_0x458255){var _0x1f8aef=_0x11136e||client;return _0x1f8aef[_0xf536('0x14')](_0x539d44,_0xd76d38)[_0xf536('0x15')](function(_0x1dd826){logger[_0xf536('0x16')](_0xf536('0x17'),_0x146970,_0xf536('0x18'));logger['debug'](_0xf536('0x19'),_0x146970,'request\x20sent',JSON[_0xf536('0x1a')](_0x1dd826));if(_0x1dd826['error']){if(_0x1dd826[_0xf536('0x1b')][_0xf536('0x1c')]===0x1f4){logger[_0xf536('0x1b')](_0xf536('0x17'),_0x146970,_0x1dd826[_0xf536('0x1b')][_0xf536('0x1d')]);return _0x458255(_0x1dd826[_0xf536('0x1b')][_0xf536('0x1d')]);}logger['error'](_0xf536('0x17'),_0x146970,_0x1dd826[_0xf536('0x1b')]['message']);return _0x3b5df6(_0x1dd826['error'][_0xf536('0x1d')]);}else{logger[_0xf536('0x16')](_0xf536('0x17'),_0x146970,_0xf536('0x18'));_0x3b5df6(_0x1dd826[_0xf536('0x1e')][_0xf536('0x1d')]);}})[_0xf536('0x1f')](function(_0xe1d6a8){logger[_0xf536('0x1b')](_0xf536('0x17'),_0x146970,_0xe1d6a8);_0x458255(_0xe1d6a8);});});}function respondWithStatusCode(_0x578947,_0xad8c36){_0xad8c36=_0xad8c36||0xcc;return function(_0xd305eb){if(_0xd305eb){return _0x578947['sendStatus'](_0xad8c36);}return _0x578947[_0xf536('0x20')](_0xad8c36)[_0xf536('0x21')]();};}function respondWithResult(_0x2d9dfb,_0x252cae){_0x252cae=_0x252cae||0xc8;return function(_0xd5098){if(_0xd5098){return _0x2d9dfb[_0xf536('0x20')](_0x252cae)[_0xf536('0x22')](_0xd5098);}};}function respondWithFilteredResult(_0x5d2d57,_0x225a3c){return function(_0x25114b){if(_0x25114b){var _0x2cd4b8=_0x25114b[_0xf536('0x23')],_0x436d12=_0x225a3c[_0xf536('0x24')],_0x19e4c4=_0x225a3c[_0xf536('0x24')]+_0x225a3c[_0xf536('0x25')],_0x5831a1;if(_0x19e4c4>=_0x2cd4b8){_0x19e4c4=_0x2cd4b8;_0x5831a1=0xc8;}else{_0x5831a1=0xce;}_0x5d2d57['status'](_0x5831a1);return _0x5d2d57[_0xf536('0x26')]('Content-Range',_0x436d12+'-'+_0x19e4c4+'/'+_0x2cd4b8)[_0xf536('0x22')](_0x25114b);}return null;};}function patchUpdates(_0x211030){return function(_0x430bb7){try{jsonpatch[_0xf536('0x27')](_0x430bb7,_0x211030,!![]);}catch(_0x1c66b8){return BPromise[_0xf536('0x28')](_0x1c66b8);}return _0x430bb7[_0xf536('0x29')]();};}function saveUpdates(_0x7fc600,_0x3de9ca){return function(_0x17b698){if(_0x17b698){return _0x17b698[_0xf536('0x2a')](_0x7fc600)[_0xf536('0x15')](function(_0x4d2564){return _0x4d2564;});}return null;};}function removeEntity(_0x3a5297,_0x24634b){return function(_0x5b3c9b){if(_0x5b3c9b){return _0x5b3c9b[_0xf536('0x2b')]()[_0xf536('0x15')](function(){_0x3a5297['status'](0xcc)[_0xf536('0x21')]();});}};}function handleEntityNotFound(_0xa17bf6,_0x2df17b){return function(_0x2b397a){if(!_0x2b397a){_0xa17bf6['sendStatus'](0x194);}return _0x2b397a;};}function handleError(_0x91f249,_0x86fd56){_0x86fd56=_0x86fd56||0x1f4;return function(_0x45a25d){logger['error'](_0x45a25d[_0xf536('0x2c')]);if(_0x45a25d[_0xf536('0x2d')]){delete _0x45a25d[_0xf536('0x2d')];}_0x91f249[_0xf536('0x20')](_0x86fd56)[_0xf536('0x2e')](_0x45a25d);};}exports['index']=function(_0x3a5666,_0x507dec){var _0xc45380={},_0x310387={},_0x118910={'count':0x0,'rows':[]};var _0x4de8c4=db[_0xf536('0x2f')][_0xf536('0x30')];_0x310387['model']=_['keys'](_0x4de8c4);_0x310387[_0xf536('0x31')]=_['keys'](_0x3a5666[_0xf536('0x31')]);_0x310387[_0xf536('0x32')]=_['intersection'](_0x310387['model'],_0x310387[_0xf536('0x31')]);_0xc45380[_0xf536('0x33')]=_[_0xf536('0x34')](_0x310387['model'],qs[_0xf536('0x35')](_0x3a5666[_0xf536('0x31')][_0xf536('0x35')]));_0xc45380[_0xf536('0x33')]=_0xc45380[_0xf536('0x33')][_0xf536('0x36')]?_0xc45380[_0xf536('0x33')]:_0x310387[_0xf536('0x37')];if(!_0x3a5666[_0xf536('0x31')][_0xf536('0x38')](_0xf536('0x39'))){_0xc45380[_0xf536('0x25')]=qs[_0xf536('0x25')](_0x3a5666[_0xf536('0x31')][_0xf536('0x25')]);_0xc45380['offset']=qs[_0xf536('0x24')](_0x3a5666[_0xf536('0x31')][_0xf536('0x24')]);}_0xc45380['order']=qs[_0xf536('0x3a')](_0x3a5666[_0xf536('0x31')][_0xf536('0x3a')]);_0xc45380[_0xf536('0x3b')]=qs['filters'](_[_0xf536('0x3c')](_0x3a5666[_0xf536('0x31')],_0x310387[_0xf536('0x32')]));if(_0x3a5666[_0xf536('0x31')][_0xf536('0x3d')]){_0xc45380['where']=_[_0xf536('0x3e')](_0xc45380[_0xf536('0x3b')],{'$or':_[_0xf536('0x3f')](_0x4de8c4,function(_0x5ad71e){if(_0x5ad71e[_0xf536('0x40')][_0xf536('0x41')]!==_0xf536('0x42')){var _0x16d4f9={};_0x16d4f9[_0x5ad71e['field']]={'$like':'%'+_0x3a5666[_0xf536('0x31')][_0xf536('0x3d')]+'%'};return _0x16d4f9;}})});}_0xc45380=_[_0xf536('0x3e')]({},_0xc45380,_0x3a5666[_0xf536('0x43')]);var _0x59a72a={'where':_0xc45380[_0xf536('0x3b')]};return db['Dynamics365Configuration']['count'](_0x59a72a)[_0xf536('0x15')](function(_0x439719){_0x118910[_0xf536('0x23')]=_0x439719;if(_0x3a5666['query'][_0xf536('0x44')]){_0xc45380[_0xf536('0x45')]=[{'all':!![]}];}return db[_0xf536('0x2f')][_0xf536('0x46')](_0xc45380);})['then'](function(_0x37c8c0){_0x118910[_0xf536('0x47')]=_0x37c8c0;return _0x118910;})[_0xf536('0x15')](respondWithFilteredResult(_0x507dec,_0xc45380))[_0xf536('0x1f')](handleError(_0x507dec,null));};exports[_0xf536('0x48')]=function(_0x4ab51e,_0x4a8ab7){var _0x4f9d4b={'raw':![],'where':{'id':_0x4ab51e[_0xf536('0x49')]['id']}},_0x2662f8={};_0x2662f8['model']=_[_0xf536('0x4a')](db[_0xf536('0x2f')][_0xf536('0x30')]);_0x2662f8[_0xf536('0x31')]=_['keys'](_0x4ab51e['query']);_0x2662f8[_0xf536('0x32')]=_['intersection'](_0x2662f8[_0xf536('0x37')],_0x2662f8['query']);_0x4f9d4b[_0xf536('0x33')]=_[_0xf536('0x34')](_0x2662f8[_0xf536('0x37')],qs[_0xf536('0x35')](_0x4ab51e['query'][_0xf536('0x35')]));_0x4f9d4b[_0xf536('0x33')]=_0x4f9d4b[_0xf536('0x33')][_0xf536('0x36')]?_0x4f9d4b['attributes']:_0x2662f8[_0xf536('0x37')];if(_0x4ab51e['query']['includeAll']){_0x4f9d4b[_0xf536('0x45')]=[{'all':!![]}];}_0x4f9d4b=_[_0xf536('0x3e')]({},_0x4f9d4b,_0x4ab51e[_0xf536('0x43')]);return db['Dynamics365Configuration'][_0xf536('0x4b')](_0x4f9d4b)[_0xf536('0x15')](handleEntityNotFound(_0x4a8ab7,null))[_0xf536('0x15')](respondWithResult(_0x4a8ab7,null))[_0xf536('0x1f')](handleError(_0x4a8ab7,null));};exports['create']=function(_0x4e6013,_0x669a69){return db[_0xf536('0x2f')][_0xf536('0x4c')](_0x4e6013['body'],{})['then'](respondWithResult(_0x669a69,0xc9))[_0xf536('0x1f')](handleError(_0x669a69,null));};exports[_0xf536('0x2a')]=function(_0x405dd5,_0x68842){if(_0x405dd5[_0xf536('0x4d')]['id']){delete _0x405dd5['body']['id'];}return db[_0xf536('0x2f')]['find']({'where':{'id':_0x405dd5[_0xf536('0x49')]['id']}})['then'](handleEntityNotFound(_0x68842,null))['then'](saveUpdates(_0x405dd5['body'],null))['then'](respondWithResult(_0x68842,null))[_0xf536('0x1f')](handleError(_0x68842,null));};exports[_0xf536('0x2b')]=function(_0xb58b3a,_0x47b1fd){return db[_0xf536('0x2f')][_0xf536('0x4b')]({'where':{'id':_0xb58b3a[_0xf536('0x49')]['id']}})['then'](handleEntityNotFound(_0x47b1fd,null))[_0xf536('0x15')](removeEntity(_0x47b1fd,null))['catch'](handleError(_0x47b1fd,null));};exports[_0xf536('0x4e')]=function(_0x4c26ec,_0x4aecd9,_0x2946d1){var _0x298571={};var _0x4cba67={};var _0x2d7715;var _0x3f5378;return db[_0xf536('0x2f')][_0xf536('0x4f')]({'where':{'id':_0x4c26ec[_0xf536('0x49')]['id']}})[_0xf536('0x15')](handleEntityNotFound(_0x4aecd9,null))['then'](function(_0x56713e){if(_0x56713e){_0x2d7715=_0x56713e;_0x4cba67[_0xf536('0x37')]=_[_0xf536('0x4a')](db[_0xf536('0x50')][_0xf536('0x30')]);_0x4cba67[_0xf536('0x31')]=_[_0xf536('0x4a')](_0x4c26ec['query']);_0x4cba67[_0xf536('0x32')]=_[_0xf536('0x34')](_0x4cba67[_0xf536('0x37')],_0x4cba67['query']);_0x298571[_0xf536('0x33')]=_[_0xf536('0x34')](_0x4cba67[_0xf536('0x37')],qs[_0xf536('0x35')](_0x4c26ec[_0xf536('0x31')][_0xf536('0x35')]));_0x298571['attributes']=_0x298571[_0xf536('0x33')][_0xf536('0x36')]?_0x298571[_0xf536('0x33')]:_0x4cba67['model'];_0x298571[_0xf536('0x51')]=qs[_0xf536('0x3a')](_0x4c26ec[_0xf536('0x31')][_0xf536('0x3a')]);_0x298571[_0xf536('0x3b')]=qs['filters'](_['pick'](_0x4c26ec[_0xf536('0x31')],_0x4cba67[_0xf536('0x32')]));if(_0x4c26ec[_0xf536('0x31')][_0xf536('0x3d')]){_0x298571['where']=_[_0xf536('0x3e')](_0x298571['where'],{'$or':_[_0xf536('0x3f')](_0x298571['attributes'],function(_0x350420){var _0x2cd59c={};_0x2cd59c[_0x350420]={'$like':'%'+_0x4c26ec[_0xf536('0x31')][_0xf536('0x3d')]+'%'};return _0x2cd59c;})});}_0x298571=_['merge']({},_0x298571,_0x4c26ec[_0xf536('0x43')]);return _0x2d7715[_0xf536('0x4e')](_0x298571);}})[_0xf536('0x15')](function(_0x2c469b){if(_0x2c469b){_0x3f5378=_0x2c469b['length'];if(!_0x4c26ec[_0xf536('0x31')][_0xf536('0x38')](_0xf536('0x39'))){_0x298571[_0xf536('0x25')]=qs[_0xf536('0x25')](_0x4c26ec[_0xf536('0x31')][_0xf536('0x25')]);_0x298571[_0xf536('0x24')]=qs[_0xf536('0x24')](_0x4c26ec['query'][_0xf536('0x24')]);}return _0x2d7715[_0xf536('0x4e')](_0x298571);}})[_0xf536('0x15')](function(_0x37e171){if(_0x37e171){return _0x37e171?{'count':_0x3f5378,'rows':_0x37e171}:null;}})[_0xf536('0x15')](respondWithResult(_0x4aecd9,null))[_0xf536('0x1f')](handleError(_0x4aecd9,null));};exports[_0xf536('0x52')]=function(_0x2bc1fe,_0x4f918c,_0x5a66e6){var _0x19b8bf={};var _0x52ef33={};var _0xa77f70;var _0x5121b5;return db[_0xf536('0x2f')]['findOne']({'where':{'id':_0x2bc1fe[_0xf536('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f918c,null))[_0xf536('0x15')](function(_0x3ba6f5){if(_0x3ba6f5){_0xa77f70=_0x3ba6f5;_0x52ef33['model']=_[_0xf536('0x4a')](db[_0xf536('0x50')][_0xf536('0x30')]);_0x52ef33[_0xf536('0x31')]=_[_0xf536('0x4a')](_0x2bc1fe[_0xf536('0x31')]);_0x52ef33[_0xf536('0x32')]=_['intersection'](_0x52ef33[_0xf536('0x37')],_0x52ef33['query']);_0x19b8bf['attributes']=_[_0xf536('0x34')](_0x52ef33['model'],qs[_0xf536('0x35')](_0x2bc1fe['query'][_0xf536('0x35')]));_0x19b8bf['attributes']=_0x19b8bf[_0xf536('0x33')][_0xf536('0x36')]?_0x19b8bf[_0xf536('0x33')]:_0x52ef33[_0xf536('0x37')];_0x19b8bf[_0xf536('0x51')]=qs[_0xf536('0x3a')](_0x2bc1fe[_0xf536('0x31')]['sort']);_0x19b8bf[_0xf536('0x3b')]=qs[_0xf536('0x32')](_[_0xf536('0x3c')](_0x2bc1fe['query'],_0x52ef33[_0xf536('0x32')]));if(_0x2bc1fe[_0xf536('0x31')][_0xf536('0x3d')]){_0x19b8bf[_0xf536('0x3b')]=_['merge'](_0x19b8bf['where'],{'$or':_['map'](_0x19b8bf['attributes'],function(_0x4e57c0){var _0xa20cf8={};_0xa20cf8[_0x4e57c0]={'$like':'%'+_0x2bc1fe['query'][_0xf536('0x3d')]+'%'};return _0xa20cf8;})});}_0x19b8bf=_[_0xf536('0x3e')]({},_0x19b8bf,_0x2bc1fe[_0xf536('0x43')]);return _0xa77f70[_0xf536('0x52')](_0x19b8bf);}})[_0xf536('0x15')](function(_0x444bcc){if(_0x444bcc){_0x5121b5=_0x444bcc[_0xf536('0x36')];if(!_0x2bc1fe[_0xf536('0x31')][_0xf536('0x38')](_0xf536('0x39'))){_0x19b8bf['limit']=qs['limit'](_0x2bc1fe[_0xf536('0x31')][_0xf536('0x25')]);_0x19b8bf['offset']=qs[_0xf536('0x24')](_0x2bc1fe[_0xf536('0x31')][_0xf536('0x24')]);}return _0xa77f70[_0xf536('0x52')](_0x19b8bf);}})[_0xf536('0x15')](function(_0x28783c){if(_0x28783c){return _0x28783c?{'count':_0x5121b5,'rows':_0x28783c}:null;}})[_0xf536('0x15')](respondWithResult(_0x4f918c,null))[_0xf536('0x1f')](handleError(_0x4f918c,null));};exports[_0xf536('0x53')]=function(_0x5cff3f,_0x4d648e,_0x3deee4){var _0x7e3d92={};var _0x3d934a={};var _0x2c63f7;var _0x165112;return db[_0xf536('0x2f')][_0xf536('0x4f')]({'where':{'id':_0x5cff3f[_0xf536('0x49')]['id']}})[_0xf536('0x15')](handleEntityNotFound(_0x4d648e,null))['then'](function(_0x10ef55){if(_0x10ef55){_0x2c63f7=_0x10ef55;_0x3d934a[_0xf536('0x37')]=_['keys'](db[_0xf536('0x50')][_0xf536('0x30')]);_0x3d934a[_0xf536('0x31')]=_[_0xf536('0x4a')](_0x5cff3f[_0xf536('0x31')]);_0x3d934a[_0xf536('0x32')]=_[_0xf536('0x34')](_0x3d934a[_0xf536('0x37')],_0x3d934a[_0xf536('0x31')]);_0x7e3d92[_0xf536('0x33')]=_[_0xf536('0x34')](_0x3d934a[_0xf536('0x37')],qs[_0xf536('0x35')](_0x5cff3f[_0xf536('0x31')]['fields']));_0x7e3d92[_0xf536('0x33')]=_0x7e3d92[_0xf536('0x33')][_0xf536('0x36')]?_0x7e3d92[_0xf536('0x33')]:_0x3d934a[_0xf536('0x37')];_0x7e3d92['order']=qs[_0xf536('0x3a')](_0x5cff3f[_0xf536('0x31')][_0xf536('0x3a')]);_0x7e3d92[_0xf536('0x3b')]=qs[_0xf536('0x32')](_[_0xf536('0x3c')](_0x5cff3f[_0xf536('0x31')],_0x3d934a['filters']));if(_0x5cff3f[_0xf536('0x31')][_0xf536('0x3d')]){_0x7e3d92[_0xf536('0x3b')]=_[_0xf536('0x3e')](_0x7e3d92[_0xf536('0x3b')],{'$or':_['map'](_0x7e3d92[_0xf536('0x33')],function(_0x2042c5){var _0x2e132a={};_0x2e132a[_0x2042c5]={'$like':'%'+_0x5cff3f[_0xf536('0x31')][_0xf536('0x3d')]+'%'};return _0x2e132a;})});}_0x7e3d92=_[_0xf536('0x3e')]({},_0x7e3d92,_0x5cff3f[_0xf536('0x43')]);return _0x2c63f7['getDescriptions'](_0x7e3d92);}})[_0xf536('0x15')](function(_0x39a345){if(_0x39a345){_0x165112=_0x39a345[_0xf536('0x36')];if(!_0x5cff3f[_0xf536('0x31')][_0xf536('0x38')](_0xf536('0x39'))){_0x7e3d92[_0xf536('0x25')]=qs[_0xf536('0x25')](_0x5cff3f['query'][_0xf536('0x25')]);_0x7e3d92['offset']=qs[_0xf536('0x24')](_0x5cff3f[_0xf536('0x31')]['offset']);}return _0x2c63f7[_0xf536('0x53')](_0x7e3d92);}})[_0xf536('0x15')](function(_0x28d737){if(_0x28d737){return _0x28d737?{'count':_0x165112,'rows':_0x28d737}:null;}})[_0xf536('0x15')](respondWithResult(_0x4d648e,null))[_0xf536('0x1f')](handleError(_0x4d648e,null));}; \ No newline at end of file +var _0x351d=['debug','stringify','error','code','message','request\x20sent','result','sendStatus','end','json','count','limit','set','Content-Range','update','destroy','status','stack','name','send','index','Dynamics365Configuration','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','show','params','filters','length','merge','options','catch','body','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x4782eb,_0x1dafc9){var _0x9f1353=function(_0x1b74b4){while(--_0x1b74b4){_0x4782eb['push'](_0x4782eb['shift']());}};_0x9f1353(++_0x1dafc9);}(_0x351d,0x90));var _0xd351=function(_0x225c21,_0x2d4385){_0x225c21=_0x225c21-0x0;var _0x242412=_0x351d[_0x225c21];return _0x242412;};'use strict';var pdf=require(_0xd351('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd351('0x1'));var zipdir=require(_0xd351('0x2'));var jsonpatch=require(_0xd351('0x3'));var rp=require('request-promise');var moment=require(_0xd351('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd351('0x5'));var util=require(_0xd351('0x6'));var path=require('path');var sox=require(_0xd351('0x7'));var csv=require(_0xd351('0x8'));var ejs=require(_0xd351('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xd351('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xd351('0xe'));var qs=require(_0xd351('0xf'));var logger=require('../../config/logger')(_0xd351('0x10'));var utils=require(_0xd351('0x11'));var config=require('../../config/environment');var db=require(_0xd351('0x12'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xd351('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x15549a,_0x23445f,_0x1eb2a9,_0x4917d5){return new BPromise(function(_0x358382,_0x316cf6){var _0x597d7c=_0x4917d5||client;return _0x597d7c[_0xd351('0x14')](_0x15549a,_0x1eb2a9)[_0xd351('0x15')](function(_0x3c2299){logger[_0xd351('0x16')](_0xd351('0x17'),_0x23445f,'request\x20sent');logger[_0xd351('0x18')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x23445f,'request\x20sent',JSON[_0xd351('0x19')](_0x3c2299));if(_0x3c2299['error']){if(_0x3c2299[_0xd351('0x1a')][_0xd351('0x1b')]===0x1f4){logger[_0xd351('0x1a')]('Dynamics365Configuration,\x20%s,\x20%s',_0x23445f,_0x3c2299[_0xd351('0x1a')][_0xd351('0x1c')]);return _0x316cf6(_0x3c2299[_0xd351('0x1a')][_0xd351('0x1c')]);}logger['error'](_0xd351('0x17'),_0x23445f,_0x3c2299['error']['message']);return _0x358382(_0x3c2299[_0xd351('0x1a')]['message']);}else{logger[_0xd351('0x16')](_0xd351('0x17'),_0x23445f,_0xd351('0x1d'));_0x358382(_0x3c2299[_0xd351('0x1e')][_0xd351('0x1c')]);}})['catch'](function(_0x18625b){logger[_0xd351('0x1a')](_0xd351('0x17'),_0x23445f,_0x18625b);_0x316cf6(_0x18625b);});});}function respondWithStatusCode(_0x4e447f,_0x1ce7f7){_0x1ce7f7=_0x1ce7f7||0xcc;return function(_0x2d9aa0){if(_0x2d9aa0){return _0x4e447f[_0xd351('0x1f')](_0x1ce7f7);}return _0x4e447f['status'](_0x1ce7f7)[_0xd351('0x20')]();};}function respondWithResult(_0x34a5cb,_0x4626c4){_0x4626c4=_0x4626c4||0xc8;return function(_0x469e7d){if(_0x469e7d){return _0x34a5cb['status'](_0x4626c4)[_0xd351('0x21')](_0x469e7d);}};}function respondWithFilteredResult(_0x483c92,_0x358bff){return function(_0x8ad0a6){if(_0x8ad0a6){var _0x54f471=_0x8ad0a6[_0xd351('0x22')],_0x2648d0=_0x358bff['offset'],_0x55b4d3=_0x358bff['offset']+_0x358bff[_0xd351('0x23')],_0x50d67e;if(_0x55b4d3>=_0x54f471){_0x55b4d3=_0x54f471;_0x50d67e=0xc8;}else{_0x50d67e=0xce;}_0x483c92['status'](_0x50d67e);return _0x483c92[_0xd351('0x24')](_0xd351('0x25'),_0x2648d0+'-'+_0x55b4d3+'/'+_0x54f471)[_0xd351('0x21')](_0x8ad0a6);}return null;};}function patchUpdates(_0x4d3f48){return function(_0x71ce9c){try{jsonpatch['apply'](_0x71ce9c,_0x4d3f48,!![]);}catch(_0x1c826b){return BPromise['reject'](_0x1c826b);}return _0x71ce9c['save']();};}function saveUpdates(_0xeb4da9,_0x38c82f){return function(_0x3f9ef3){if(_0x3f9ef3){return _0x3f9ef3[_0xd351('0x26')](_0xeb4da9)['then'](function(_0x341da0){return _0x341da0;});}return null;};}function removeEntity(_0x1f7ee8,_0x38023c){return function(_0x41da60){if(_0x41da60){return _0x41da60[_0xd351('0x27')]()[_0xd351('0x15')](function(){_0x1f7ee8[_0xd351('0x28')](0xcc)[_0xd351('0x20')]();});}};}function handleEntityNotFound(_0x19bddd,_0x571f64){return function(_0x3feab5){if(!_0x3feab5){_0x19bddd[_0xd351('0x1f')](0x194);}return _0x3feab5;};}function handleError(_0xa5a7d4,_0xcb3acf){_0xcb3acf=_0xcb3acf||0x1f4;return function(_0x5e6e6d){logger[_0xd351('0x1a')](_0x5e6e6d[_0xd351('0x29')]);if(_0x5e6e6d[_0xd351('0x2a')]){delete _0x5e6e6d[_0xd351('0x2a')];}_0xa5a7d4[_0xd351('0x28')](_0xcb3acf)[_0xd351('0x2b')](_0x5e6e6d);};}exports[_0xd351('0x2c')]=function(_0x177eb5,_0x238663){var _0x51b280={},_0x521663={},_0x1fae11={'count':0x0,'rows':[]};var _0xa31042=db[_0xd351('0x2d')][_0xd351('0x2e')];_0x521663[_0xd351('0x2f')]=_[_0xd351('0x30')](_0xa31042);_0x521663['query']=_['keys'](_0x177eb5[_0xd351('0x31')]);_0x521663['filters']=_[_0xd351('0x32')](_0x521663[_0xd351('0x2f')],_0x521663[_0xd351('0x31')]);_0x51b280[_0xd351('0x33')]=_[_0xd351('0x32')](_0x521663[_0xd351('0x2f')],qs[_0xd351('0x34')](_0x177eb5[_0xd351('0x31')][_0xd351('0x34')]));_0x51b280[_0xd351('0x33')]=_0x51b280[_0xd351('0x33')]['length']?_0x51b280[_0xd351('0x33')]:_0x521663['model'];if(!_0x177eb5[_0xd351('0x31')][_0xd351('0x35')](_0xd351('0x36'))){_0x51b280[_0xd351('0x23')]=qs[_0xd351('0x23')](_0x177eb5[_0xd351('0x31')]['limit']);_0x51b280[_0xd351('0x37')]=qs[_0xd351('0x37')](_0x177eb5['query'][_0xd351('0x37')]);}_0x51b280[_0xd351('0x38')]=qs[_0xd351('0x39')](_0x177eb5[_0xd351('0x31')][_0xd351('0x39')]);_0x51b280['where']=qs['filters'](_[_0xd351('0x3a')](_0x177eb5[_0xd351('0x31')],_0x521663['filters']));if(_0x177eb5['query'][_0xd351('0x3b')]){_0x51b280[_0xd351('0x3c')]=_['merge'](_0x51b280['where'],{'$or':_[_0xd351('0x3d')](_0xa31042,function(_0x18f9d1){if(_0x18f9d1[_0xd351('0x3e')][_0xd351('0x3f')]!==_0xd351('0x40')){var _0x33a262={};_0x33a262[_0x18f9d1[_0xd351('0x41')]]={'$like':'%'+_0x177eb5[_0xd351('0x31')][_0xd351('0x3b')]+'%'};return _0x33a262;}})});}_0x51b280=_['merge']({},_0x51b280,_0x177eb5['options']);var _0x35e651={'where':_0x51b280[_0xd351('0x3c')]};return db[_0xd351('0x2d')][_0xd351('0x22')](_0x35e651)[_0xd351('0x15')](function(_0x4332e7){_0x1fae11[_0xd351('0x22')]=_0x4332e7;if(_0x177eb5[_0xd351('0x31')][_0xd351('0x42')]){_0x51b280[_0xd351('0x43')]=[{'all':!![]}];}return db[_0xd351('0x2d')][_0xd351('0x44')](_0x51b280);})[_0xd351('0x15')](function(_0x42a162){_0x1fae11[_0xd351('0x45')]=_0x42a162;return _0x1fae11;})[_0xd351('0x15')](respondWithFilteredResult(_0x238663,_0x51b280))['catch'](handleError(_0x238663,null));};exports[_0xd351('0x46')]=function(_0x3ec78a,_0x8fe1b5){var _0x56616f={'raw':![],'where':{'id':_0x3ec78a[_0xd351('0x47')]['id']}},_0x25cf80={};_0x25cf80[_0xd351('0x2f')]=_[_0xd351('0x30')](db[_0xd351('0x2d')]['rawAttributes']);_0x25cf80[_0xd351('0x31')]=_['keys'](_0x3ec78a[_0xd351('0x31')]);_0x25cf80[_0xd351('0x48')]=_['intersection'](_0x25cf80['model'],_0x25cf80[_0xd351('0x31')]);_0x56616f[_0xd351('0x33')]=_[_0xd351('0x32')](_0x25cf80['model'],qs[_0xd351('0x34')](_0x3ec78a[_0xd351('0x31')]['fields']));_0x56616f[_0xd351('0x33')]=_0x56616f['attributes'][_0xd351('0x49')]?_0x56616f[_0xd351('0x33')]:_0x25cf80['model'];if(_0x3ec78a['query'][_0xd351('0x42')]){_0x56616f['include']=[{'all':!![]}];}_0x56616f=_[_0xd351('0x4a')]({},_0x56616f,_0x3ec78a[_0xd351('0x4b')]);return db[_0xd351('0x2d')]['find'](_0x56616f)[_0xd351('0x15')](handleEntityNotFound(_0x8fe1b5,null))['then'](respondWithResult(_0x8fe1b5,null))['catch'](handleError(_0x8fe1b5,null));};exports['create']=function(_0x7e4bad,_0x292af3){return db[_0xd351('0x2d')]['create'](_0x7e4bad['body'],{})[_0xd351('0x15')](respondWithResult(_0x292af3,0xc9))[_0xd351('0x4c')](handleError(_0x292af3,null));};exports['update']=function(_0x2a87cf,_0x202bc4){if(_0x2a87cf['body']['id']){delete _0x2a87cf[_0xd351('0x4d')]['id'];}return db['Dynamics365Configuration'][_0xd351('0x4e')]({'where':{'id':_0x2a87cf['params']['id']}})[_0xd351('0x15')](handleEntityNotFound(_0x202bc4,null))[_0xd351('0x15')](saveUpdates(_0x2a87cf[_0xd351('0x4d')],null))[_0xd351('0x15')](respondWithResult(_0x202bc4,null))[_0xd351('0x4c')](handleError(_0x202bc4,null));};exports[_0xd351('0x27')]=function(_0x1bcbb0,_0x55792e){return db['Dynamics365Configuration'][_0xd351('0x4e')]({'where':{'id':_0x1bcbb0[_0xd351('0x47')]['id']}})['then'](handleEntityNotFound(_0x55792e,null))[_0xd351('0x15')](removeEntity(_0x55792e,null))[_0xd351('0x4c')](handleError(_0x55792e,null));};exports[_0xd351('0x4f')]=function(_0x4da037,_0x169122,_0x5e2dac){var _0x5ab6b1={};var _0x2c0cb1={};var _0x434465;var _0x4d5a60;return db[_0xd351('0x2d')][_0xd351('0x50')]({'where':{'id':_0x4da037[_0xd351('0x47')]['id']}})[_0xd351('0x15')](handleEntityNotFound(_0x169122,null))[_0xd351('0x15')](function(_0x2dc745){if(_0x2dc745){_0x434465=_0x2dc745;_0x2c0cb1['model']=_[_0xd351('0x30')](db[_0xd351('0x51')][_0xd351('0x2e')]);_0x2c0cb1[_0xd351('0x31')]=_[_0xd351('0x30')](_0x4da037[_0xd351('0x31')]);_0x2c0cb1[_0xd351('0x48')]=_['intersection'](_0x2c0cb1[_0xd351('0x2f')],_0x2c0cb1['query']);_0x5ab6b1[_0xd351('0x33')]=_[_0xd351('0x32')](_0x2c0cb1[_0xd351('0x2f')],qs[_0xd351('0x34')](_0x4da037[_0xd351('0x31')]['fields']));_0x5ab6b1[_0xd351('0x33')]=_0x5ab6b1['attributes'][_0xd351('0x49')]?_0x5ab6b1[_0xd351('0x33')]:_0x2c0cb1[_0xd351('0x2f')];_0x5ab6b1[_0xd351('0x38')]=qs[_0xd351('0x39')](_0x4da037['query']['sort']);_0x5ab6b1[_0xd351('0x3c')]=qs[_0xd351('0x48')](_['pick'](_0x4da037[_0xd351('0x31')],_0x2c0cb1[_0xd351('0x48')]));if(_0x4da037[_0xd351('0x31')]['filter']){_0x5ab6b1[_0xd351('0x3c')]=_[_0xd351('0x4a')](_0x5ab6b1[_0xd351('0x3c')],{'$or':_[_0xd351('0x3d')](_0x5ab6b1['attributes'],function(_0x508e5f){var _0x40c78b={};_0x40c78b[_0x508e5f]={'$like':'%'+_0x4da037[_0xd351('0x31')][_0xd351('0x3b')]+'%'};return _0x40c78b;})});}_0x5ab6b1=_[_0xd351('0x4a')]({},_0x5ab6b1,_0x4da037[_0xd351('0x4b')]);return _0x434465[_0xd351('0x4f')](_0x5ab6b1);}})[_0xd351('0x15')](function(_0x5e2e06){if(_0x5e2e06){_0x4d5a60=_0x5e2e06[_0xd351('0x49')];if(!_0x4da037['query']['hasOwnProperty'](_0xd351('0x36'))){_0x5ab6b1[_0xd351('0x23')]=qs['limit'](_0x4da037[_0xd351('0x31')]['limit']);_0x5ab6b1['offset']=qs['offset'](_0x4da037[_0xd351('0x31')][_0xd351('0x37')]);}return _0x434465[_0xd351('0x4f')](_0x5ab6b1);}})['then'](function(_0xadafc9){if(_0xadafc9){return _0xadafc9?{'count':_0x4d5a60,'rows':_0xadafc9}:null;}})[_0xd351('0x15')](respondWithResult(_0x169122,null))[_0xd351('0x4c')](handleError(_0x169122,null));};exports[_0xd351('0x52')]=function(_0x2375db,_0x475534,_0x15fcab){var _0x6bf19c={};var _0x130617={};var _0x22672;var _0x18c261;return db['Dynamics365Configuration'][_0xd351('0x50')]({'where':{'id':_0x2375db[_0xd351('0x47')]['id']}})[_0xd351('0x15')](handleEntityNotFound(_0x475534,null))[_0xd351('0x15')](function(_0xf24a29){if(_0xf24a29){_0x22672=_0xf24a29;_0x130617[_0xd351('0x2f')]=_['keys'](db[_0xd351('0x51')][_0xd351('0x2e')]);_0x130617['query']=_['keys'](_0x2375db[_0xd351('0x31')]);_0x130617[_0xd351('0x48')]=_[_0xd351('0x32')](_0x130617[_0xd351('0x2f')],_0x130617[_0xd351('0x31')]);_0x6bf19c[_0xd351('0x33')]=_[_0xd351('0x32')](_0x130617[_0xd351('0x2f')],qs[_0xd351('0x34')](_0x2375db['query'][_0xd351('0x34')]));_0x6bf19c[_0xd351('0x33')]=_0x6bf19c['attributes'][_0xd351('0x49')]?_0x6bf19c['attributes']:_0x130617[_0xd351('0x2f')];_0x6bf19c['order']=qs[_0xd351('0x39')](_0x2375db[_0xd351('0x31')][_0xd351('0x39')]);_0x6bf19c[_0xd351('0x3c')]=qs[_0xd351('0x48')](_[_0xd351('0x3a')](_0x2375db[_0xd351('0x31')],_0x130617['filters']));if(_0x2375db[_0xd351('0x31')][_0xd351('0x3b')]){_0x6bf19c[_0xd351('0x3c')]=_[_0xd351('0x4a')](_0x6bf19c[_0xd351('0x3c')],{'$or':_['map'](_0x6bf19c[_0xd351('0x33')],function(_0x155c2c){var _0x38f59a={};_0x38f59a[_0x155c2c]={'$like':'%'+_0x2375db['query'][_0xd351('0x3b')]+'%'};return _0x38f59a;})});}_0x6bf19c=_[_0xd351('0x4a')]({},_0x6bf19c,_0x2375db[_0xd351('0x4b')]);return _0x22672[_0xd351('0x52')](_0x6bf19c);}})[_0xd351('0x15')](function(_0x248503){if(_0x248503){_0x18c261=_0x248503[_0xd351('0x49')];if(!_0x2375db[_0xd351('0x31')][_0xd351('0x35')]('nolimit')){_0x6bf19c[_0xd351('0x23')]=qs[_0xd351('0x23')](_0x2375db['query'][_0xd351('0x23')]);_0x6bf19c['offset']=qs['offset'](_0x2375db['query'][_0xd351('0x37')]);}return _0x22672[_0xd351('0x52')](_0x6bf19c);}})[_0xd351('0x15')](function(_0x5b2bf9){if(_0x5b2bf9){return _0x5b2bf9?{'count':_0x18c261,'rows':_0x5b2bf9}:null;}})[_0xd351('0x15')](respondWithResult(_0x475534,null))['catch'](handleError(_0x475534,null));};exports[_0xd351('0x53')]=function(_0x5b7dda,_0x3a3139,_0x12db28){var _0x27aec9={};var _0x16dd16={};var _0x35b148;var _0x1bb955;return db[_0xd351('0x2d')][_0xd351('0x50')]({'where':{'id':_0x5b7dda[_0xd351('0x47')]['id']}})[_0xd351('0x15')](handleEntityNotFound(_0x3a3139,null))[_0xd351('0x15')](function(_0x25694a){if(_0x25694a){_0x35b148=_0x25694a;_0x16dd16['model']=_[_0xd351('0x30')](db[_0xd351('0x51')][_0xd351('0x2e')]);_0x16dd16[_0xd351('0x31')]=_[_0xd351('0x30')](_0x5b7dda['query']);_0x16dd16[_0xd351('0x48')]=_[_0xd351('0x32')](_0x16dd16[_0xd351('0x2f')],_0x16dd16[_0xd351('0x31')]);_0x27aec9['attributes']=_[_0xd351('0x32')](_0x16dd16[_0xd351('0x2f')],qs['fields'](_0x5b7dda[_0xd351('0x31')][_0xd351('0x34')]));_0x27aec9[_0xd351('0x33')]=_0x27aec9[_0xd351('0x33')]['length']?_0x27aec9['attributes']:_0x16dd16[_0xd351('0x2f')];_0x27aec9[_0xd351('0x38')]=qs[_0xd351('0x39')](_0x5b7dda[_0xd351('0x31')]['sort']);_0x27aec9[_0xd351('0x3c')]=qs[_0xd351('0x48')](_[_0xd351('0x3a')](_0x5b7dda[_0xd351('0x31')],_0x16dd16[_0xd351('0x48')]));if(_0x5b7dda['query'][_0xd351('0x3b')]){_0x27aec9[_0xd351('0x3c')]=_['merge'](_0x27aec9[_0xd351('0x3c')],{'$or':_[_0xd351('0x3d')](_0x27aec9['attributes'],function(_0x1e5bba){var _0x55b81e={};_0x55b81e[_0x1e5bba]={'$like':'%'+_0x5b7dda[_0xd351('0x31')]['filter']+'%'};return _0x55b81e;})});}_0x27aec9=_[_0xd351('0x4a')]({},_0x27aec9,_0x5b7dda[_0xd351('0x4b')]);return _0x35b148[_0xd351('0x53')](_0x27aec9);}})[_0xd351('0x15')](function(_0x34835d){if(_0x34835d){_0x1bb955=_0x34835d[_0xd351('0x49')];if(!_0x5b7dda[_0xd351('0x31')][_0xd351('0x35')](_0xd351('0x36'))){_0x27aec9['limit']=qs[_0xd351('0x23')](_0x5b7dda[_0xd351('0x31')][_0xd351('0x23')]);_0x27aec9[_0xd351('0x37')]=qs[_0xd351('0x37')](_0x5b7dda[_0xd351('0x31')][_0xd351('0x37')]);}return _0x35b148[_0xd351('0x53')](_0x27aec9);}})['then'](function(_0x3b8f86){if(_0x3b8f86){return _0x3b8f86?{'count':_0x1bb955,'rows':_0x3b8f86}:null;}})['then'](respondWithResult(_0x3a3139,null))[_0xd351('0x4c')](handleError(_0x3a3139,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 5a700bf..bdf124a 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 _0xea6d=['define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','bluebird','request-promise','./intDynamics365Configuration.attributes'];(function(_0x5260c3,_0x2d5e09){var _0x2a7989=function(_0x4acb3d){while(--_0x4acb3d){_0x5260c3['push'](_0x5260c3['shift']());}};_0x2a7989(++_0x2d5e09);}(_0xea6d,0x174));var _0xdea6=function(_0x537683,_0x410d59){_0x537683=_0x537683-0x0;var _0x1659b4=_0xea6d[_0x537683];return _0x1659b4;};'use strict';var _=require(_0xdea6('0x0'));var util=require(_0xdea6('0x1'));var logger=require('../../config/logger')(_0xdea6('0x2'));var moment=require('moment');var BPromise=require(_0xdea6('0x3'));var rp=require(_0xdea6('0x4'));var attributes=require(_0xdea6('0x5'));module['exports']=function(_0x3392c,_0x4ec3ea){return _0x3392c[_0xdea6('0x6')](_0xdea6('0x7'),attributes,{'tableName':_0xdea6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x469e=['../../config/logger','moment','bluebird','request-promise','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0x1cf7e8,_0x3cea71){var _0x3a9a74=function(_0x4b05ff){while(--_0x4b05ff){_0x1cf7e8['push'](_0x1cf7e8['shift']());}};_0x3a9a74(++_0x3cea71);}(_0x469e,0x17b));var _0xe469=function(_0x539533,_0x59b89b){_0x539533=_0x539533-0x0;var _0x3942f3=_0x469e[_0x539533];return _0x3942f3;};'use strict';var _=require('lodash');var util=require(_0xe469('0x0'));var logger=require(_0xe469('0x1'))('api');var moment=require(_0xe469('0x2'));var BPromise=require(_0xe469('0x3'));var rp=require(_0xe469('0x4'));var attributes=require(_0xe469('0x5'));module[_0xe469('0x6')]=function(_0x36981f,_0x3bea1e){return _0x36981f[_0xe469('0x7')](_0xe469('0x8'),attributes,{'tableName':_0xe469('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index b33f0f9..38acdf1 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 _0x8adb=['http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0x8adb,0x1c1));var _0xb8ad=function(_0x3ffaf6,_0x257a0a){_0x3ffaf6=_0x3ffaf6-0x0;var _0x2f823c=_0x8adb[_0x3ffaf6];return _0x2f823c;};'use strict';var _=require(_0xb8ad('0x0'));var util=require(_0xb8ad('0x1'));var moment=require(_0xb8ad('0x2'));var BPromise=require(_0xb8ad('0x3'));var rs=require(_0xb8ad('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8ad('0x5'))['db'];var utils=require(_0xb8ad('0x6'));var logger=require('../../config/logger')(_0xb8ad('0x7'));var config=require(_0xb8ad('0x8'));var jayson=require(_0xb8ad('0x9'));var client=jayson[_0xb8ad('0xa')][_0xb8ad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xabdb29,_0x4f059b,_0x34aee8){return new BPromise(function(_0x519900,_0xd8bf71){return client[_0xb8ad('0xc')](_0xabdb29,_0x34aee8)[_0xb8ad('0xd')](function(_0x3cb847){logger[_0xb8ad('0xe')](_0xb8ad('0xf'),_0x4f059b,_0xb8ad('0x10'));logger[_0xb8ad('0x11')](_0xb8ad('0x12'),_0x4f059b,'request\x20sent',JSON['stringify'](_0x3cb847));if(_0x3cb847[_0xb8ad('0x13')]){if(_0x3cb847[_0xb8ad('0x13')][_0xb8ad('0x14')]===0x1f4){logger['error'](_0xb8ad('0xf'),_0x4f059b,_0x3cb847['error'][_0xb8ad('0x15')]);return _0xd8bf71(_0x3cb847[_0xb8ad('0x13')][_0xb8ad('0x15')]);}logger[_0xb8ad('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4f059b,_0x3cb847[_0xb8ad('0x13')][_0xb8ad('0x15')]);return _0x519900(_0x3cb847[_0xb8ad('0x13')][_0xb8ad('0x15')]);}else{logger[_0xb8ad('0xe')](_0xb8ad('0xf'),_0x4f059b,_0xb8ad('0x10'));_0x519900(_0x3cb847[_0xb8ad('0x16')][_0xb8ad('0x15')]);}})['catch'](function(_0x1515ba){logger[_0xb8ad('0x13')](_0xb8ad('0xf'),_0x4f059b,_0x1515ba);_0xd8bf71(_0x1515ba);});});} \ No newline at end of file +var _0xc24c=['../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2e1a90,_0x40d0ad){var _0x403ee9=function(_0x1a6ff9){while(--_0x1a6ff9){_0x2e1a90['push'](_0x2e1a90['shift']());}};_0x403ee9(++_0x40d0ad);}(_0xc24c,0x7d));var _0xcc24=function(_0xcb0437,_0x377453){_0xcb0437=_0xcb0437-0x0;var _0x495ace=_0xc24c[_0xcb0437];return _0x495ace;};'use strict';var _=require(_0xcc24('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcc24('0x1'));var rs=require(_0xcc24('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc24('0x3'))['db'];var utils=require(_0xcc24('0x4'));var logger=require(_0xcc24('0x5'))(_0xcc24('0x6'));var config=require(_0xcc24('0x7'));var jayson=require(_0xcc24('0x8'));var client=jayson[_0xcc24('0x9')][_0xcc24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x230d94,_0xe4575d,_0x5e627c){return new BPromise(function(_0x66d26b,_0x32966e){return client[_0xcc24('0xb')](_0x230d94,_0x5e627c)[_0xcc24('0xc')](function(_0x3c4967){logger[_0xcc24('0xd')](_0xcc24('0xe'),_0xe4575d,_0xcc24('0xf'));logger[_0xcc24('0x10')](_0xcc24('0x11'),_0xe4575d,_0xcc24('0xf'),JSON['stringify'](_0x3c4967));if(_0x3c4967[_0xcc24('0x12')]){if(_0x3c4967['error'][_0xcc24('0x13')]===0x1f4){logger[_0xcc24('0x12')](_0xcc24('0xe'),_0xe4575d,_0x3c4967[_0xcc24('0x12')]['message']);return _0x32966e(_0x3c4967['error'][_0xcc24('0x14')]);}logger['error'](_0xcc24('0xe'),_0xe4575d,_0x3c4967[_0xcc24('0x12')][_0xcc24('0x14')]);return _0x66d26b(_0x3c4967[_0xcc24('0x12')][_0xcc24('0x14')]);}else{logger[_0xcc24('0xd')](_0xcc24('0xe'),_0xe4575d,'request\x20sent');_0x66d26b(_0x3c4967['result'][_0xcc24('0x14')]);}})[_0xcc24('0x15')](function(_0xe14dd4){logger[_0xcc24('0x12')](_0xcc24('0xe'),_0xe4575d,_0xe14dd4);_0x32966e(_0xe14dd4);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 1188797..c4cc457 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 _0x579a=['/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated'];(function(_0xb9eb71,_0x3beee0){var _0xe0a037=function(_0x1a473a){while(--_0x1a473a){_0xb9eb71['push'](_0xb9eb71['shift']());}};_0xe0a037(++_0x3beee0);}(_0x579a,0x112));var _0xa579=function(_0x1ea169,_0x37707f){_0x1ea169=_0x1ea169-0x0;var _0x2414ff=_0x579a[_0x1ea169];return _0x2414ff;};'use strict';var multer=require(_0xa579('0x0'));var util=require(_0xa579('0x1'));var path=require(_0xa579('0x2'));var timeout=require(_0xa579('0x3'));var express=require(_0xa579('0x4'));var router=express[_0xa579('0x5')]();var auth=require(_0xa579('0x6'));var interaction=require(_0xa579('0x7'));var config=require('../../config/environment');var controller=require(_0xa579('0x8'));router[_0xa579('0x9')]('/',auth[_0xa579('0xa')](),controller['index']);router[_0xa579('0x9')](_0xa579('0xb'),auth[_0xa579('0xa')](),controller[_0xa579('0xc')]);router[_0xa579('0xd')]('/',auth[_0xa579('0xa')](),controller[_0xa579('0xe')]);router[_0xa579('0xf')](_0xa579('0xb'),auth[_0xa579('0xa')](),controller[_0xa579('0x10')]);router['delete'](_0xa579('0xb'),auth['isAuthenticated'](),controller[_0xa579('0x11')]);module[_0xa579('0x12')]=router; \ No newline at end of file +var _0x67a5=['util','path','connect-timeout','express','Router','../../components/auth/service','./intDynamics365Field.controller','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports'];(function(_0x4e0f57,_0x4286f0){var _0x3d3f87=function(_0x529753){while(--_0x529753){_0x4e0f57['push'](_0x4e0f57['shift']());}};_0x3d3f87(++_0x4286f0);}(_0x67a5,0xee));var _0x567a=function(_0x4da573,_0x31b058){_0x4da573=_0x4da573-0x0;var _0x41d1b3=_0x67a5[_0x4da573];return _0x41d1b3;};'use strict';var multer=require('multer');var util=require(_0x567a('0x0'));var path=require(_0x567a('0x1'));var timeout=require(_0x567a('0x2'));var express=require(_0x567a('0x3'));var router=express[_0x567a('0x4')]();var auth=require(_0x567a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x567a('0x6'));router[_0x567a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x567a('0x8'),auth[_0x567a('0x9')](),controller[_0x567a('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x567a('0xb')]);router[_0x567a('0xc')](_0x567a('0x8'),auth[_0x567a('0x9')](),controller[_0x567a('0xd')]);router[_0x567a('0xe')](_0x567a('0x8'),auth['isAuthenticated'](),controller[_0x567a('0xf')]);module[_0x567a('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 86b6576..9d5fc27 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 _0xbdb7=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1b87a6,_0x4b11a0){_0x1b87a6=_0x1b87a6-0x0;var _0x3f2b76=_0xbdb7[_0x1b87a6];return _0x3f2b76;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'type':{'type':Sequelize[_0x7bdb('0x2')](_0x7bdb('0x3'),_0x7bdb('0x4'),_0x7bdb('0x5'),_0x7bdb('0x6')),'defaultValue':_0x7bdb('0x3')},'content':{'type':Sequelize[_0x7bdb('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7bdb('0x2')]('string','variable',_0x7bdb('0x5'))},'keyContent':{'type':Sequelize[_0x7bdb('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7bdb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7bdb('0x7')]}}; \ No newline at end of file +var _0x4522=['STRING','customVariable','BOOLEAN','ENUM','string','variable','keyValue'];(function(_0x40d548,_0x233d52){var _0x1791f8=function(_0x526c95){while(--_0x526c95){_0x40d548['push'](_0x40d548['shift']());}};_0x1791f8(++_0x233d52);}(_0x4522,0x1a0));var _0x2452=function(_0xeebcf3,_0x119794){_0xeebcf3=_0xeebcf3-0x0;var _0x2dda52=_0x4522[_0xeebcf3];return _0x2dda52;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2452('0x0')](_0x2452('0x1'),_0x2452('0x2'),'customVariable',_0x2452('0x3')),'defaultValue':_0x2452('0x1')},'content':{'type':Sequelize[_0x2452('0x4')]},'key':{'type':Sequelize[_0x2452('0x4')]},'keyType':{'type':Sequelize[_0x2452('0x0')](_0x2452('0x1'),_0x2452('0x2'),_0x2452('0x5'))},'keyContent':{'type':Sequelize[_0x2452('0x4')]},'idField':{'type':Sequelize[_0x2452('0x4')]},'nameField':{'type':Sequelize[_0x2452('0x4')]},'customField':{'type':Sequelize[_0x2452('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2452('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 3c2a077..a60b47d 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 _0xa7d8=['create','body','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','Dynamics365Field','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','map','key','VIRTUAL','field','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','find'];(function(_0x5b1b97,_0xf583f0){var _0x24a10c=function(_0x5028d9){while(--_0x5028d9){_0x5b1b97['push'](_0x5b1b97['shift']());}};_0x24a10c(++_0xf583f0);}(_0xa7d8,0x94));var _0x8a7d=function(_0x508794,_0x20e88c){_0x508794=_0x508794-0x0;var _0x2df96a=_0xa7d8[_0x508794];return _0x2df96a;};'use strict';var pdf=require(_0x8a7d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8a7d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a7d('0x2'));var rp=require(_0x8a7d('0x3'));var moment=require('moment');var BPromise=require(_0x8a7d('0x4'));var Mustache=require(_0x8a7d('0x5'));var util=require(_0x8a7d('0x6'));var path=require(_0x8a7d('0x7'));var sox=require(_0x8a7d('0x8'));var csv=require(_0x8a7d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8a7d('0xa'));var squel=require(_0x8a7d('0xb'));var crypto=require('crypto');var jsforce=require(_0x8a7d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8a7d('0x9'));var querystring=require(_0x8a7d('0xd'));var Papa=require(_0x8a7d('0xe'));var authService=require(_0x8a7d('0xf'));var hardwareService=require(_0x8a7d('0x10'));var Redis=require('ioredis');var qs=require(_0x8a7d('0x11'));var logger=require('../../config/logger')(_0x8a7d('0x12'));var utils=require(_0x8a7d('0x13'));var config=require(_0x8a7d('0x14'));var db=require(_0x8a7d('0x15'))['db'];function respondWithStatusCode(_0x57f00e,_0x13bb99){_0x13bb99=_0x13bb99||0xcc;return function(_0x38259f){if(_0x38259f){return _0x57f00e[_0x8a7d('0x16')](_0x13bb99);}return _0x57f00e[_0x8a7d('0x17')](_0x13bb99)['end']();};}function respondWithResult(_0x1afbdd,_0x1bd62f){_0x1bd62f=_0x1bd62f||0xc8;return function(_0x6cbac6){if(_0x6cbac6){return _0x1afbdd[_0x8a7d('0x17')](_0x1bd62f)[_0x8a7d('0x18')](_0x6cbac6);}};}function respondWithFilteredResult(_0x242b63,_0x34dcb8){return function(_0x3b0f40){if(_0x3b0f40){var _0x21d343=_0x3b0f40[_0x8a7d('0x19')],_0x11cd14=_0x34dcb8['offset'],_0x1b8932=_0x34dcb8[_0x8a7d('0x1a')]+_0x34dcb8[_0x8a7d('0x1b')],_0x15889c;if(_0x1b8932>=_0x21d343){_0x1b8932=_0x21d343;_0x15889c=0xc8;}else{_0x15889c=0xce;}_0x242b63[_0x8a7d('0x17')](_0x15889c);return _0x242b63[_0x8a7d('0x1c')](_0x8a7d('0x1d'),_0x11cd14+'-'+_0x1b8932+'/'+_0x21d343)['json'](_0x3b0f40);}return null;};}function patchUpdates(_0x22bf3a){return function(_0x5367fb){try{jsonpatch['apply'](_0x5367fb,_0x22bf3a,!![]);}catch(_0x5659b3){return BPromise[_0x8a7d('0x1e')](_0x5659b3);}return _0x5367fb[_0x8a7d('0x1f')]();};}function saveUpdates(_0x120812,_0x31a80b){return function(_0x1333e5){if(_0x1333e5){return _0x1333e5[_0x8a7d('0x20')](_0x120812)[_0x8a7d('0x21')](function(_0x36a12a){return _0x36a12a;});}return null;};}function removeEntity(_0x156718,_0x313b7e){return function(_0x164a70){if(_0x164a70){return _0x164a70[_0x8a7d('0x22')]()[_0x8a7d('0x21')](function(){_0x156718['status'](0xcc)[_0x8a7d('0x23')]();});}};}function handleEntityNotFound(_0x5dfa31,_0x2c7706){return function(_0x46956b){if(!_0x46956b){_0x5dfa31[_0x8a7d('0x16')](0x194);}return _0x46956b;};}function handleError(_0x213d4d,_0x5d4233){_0x5d4233=_0x5d4233||0x1f4;return function(_0x16eeba){logger[_0x8a7d('0x24')](_0x16eeba[_0x8a7d('0x25')]);if(_0x16eeba['name']){delete _0x16eeba[_0x8a7d('0x26')];}_0x213d4d[_0x8a7d('0x17')](_0x5d4233)[_0x8a7d('0x27')](_0x16eeba);};}exports[_0x8a7d('0x28')]=function(_0x1eb031,_0x2ad082){var _0x9e4de0={},_0xbbfd01={},_0x54389e={'count':0x0,'rows':[]};var _0xdc95e1=db[_0x8a7d('0x29')]['rawAttributes'];_0xbbfd01['model']=_['keys'](_0xdc95e1);_0xbbfd01[_0x8a7d('0x2a')]=_[_0x8a7d('0x2b')](_0x1eb031[_0x8a7d('0x2a')]);_0xbbfd01['filters']=_[_0x8a7d('0x2c')](_0xbbfd01['model'],_0xbbfd01[_0x8a7d('0x2a')]);_0x9e4de0[_0x8a7d('0x2d')]=_['intersection'](_0xbbfd01[_0x8a7d('0x2e')],qs[_0x8a7d('0x2f')](_0x1eb031[_0x8a7d('0x2a')]['fields']));_0x9e4de0[_0x8a7d('0x2d')]=_0x9e4de0['attributes'][_0x8a7d('0x30')]?_0x9e4de0[_0x8a7d('0x2d')]:_0xbbfd01[_0x8a7d('0x2e')];if(!_0x1eb031[_0x8a7d('0x2a')][_0x8a7d('0x31')](_0x8a7d('0x32'))){_0x9e4de0[_0x8a7d('0x1b')]=qs[_0x8a7d('0x1b')](_0x1eb031[_0x8a7d('0x2a')][_0x8a7d('0x1b')]);_0x9e4de0[_0x8a7d('0x1a')]=qs[_0x8a7d('0x1a')](_0x1eb031[_0x8a7d('0x2a')][_0x8a7d('0x1a')]);}_0x9e4de0[_0x8a7d('0x33')]=qs[_0x8a7d('0x34')](_0x1eb031[_0x8a7d('0x2a')][_0x8a7d('0x34')]);_0x9e4de0[_0x8a7d('0x35')]=qs['filters'](_[_0x8a7d('0x36')](_0x1eb031[_0x8a7d('0x2a')],_0xbbfd01[_0x8a7d('0x37')]));if(_0x1eb031[_0x8a7d('0x2a')]['filter']){_0x9e4de0[_0x8a7d('0x35')]=_[_0x8a7d('0x38')](_0x9e4de0['where'],{'$or':_[_0x8a7d('0x39')](_0xdc95e1,function(_0x29cd92){if(_0x29cd92['type'][_0x8a7d('0x3a')]!==_0x8a7d('0x3b')){var _0x298781={};_0x298781[_0x29cd92[_0x8a7d('0x3c')]]={'$like':'%'+_0x1eb031[_0x8a7d('0x2a')][_0x8a7d('0x3d')]+'%'};return _0x298781;}})});}_0x9e4de0=_[_0x8a7d('0x38')]({},_0x9e4de0,_0x1eb031[_0x8a7d('0x3e')]);var _0x5a107e={'where':_0x9e4de0[_0x8a7d('0x35')]};return db[_0x8a7d('0x29')][_0x8a7d('0x19')](_0x5a107e)['then'](function(_0x48600e){_0x54389e['count']=_0x48600e;if(_0x1eb031[_0x8a7d('0x2a')][_0x8a7d('0x3f')]){_0x9e4de0[_0x8a7d('0x40')]=[{'all':!![]}];}return db[_0x8a7d('0x29')]['findAll'](_0x9e4de0);})['then'](function(_0x3b8c29){_0x54389e[_0x8a7d('0x41')]=_0x3b8c29;return _0x54389e;})[_0x8a7d('0x21')](respondWithFilteredResult(_0x2ad082,_0x9e4de0))[_0x8a7d('0x42')](handleError(_0x2ad082,null));};exports[_0x8a7d('0x43')]=function(_0x2c9308,_0x49d9f0){var _0x5c5439={'raw':!![],'where':{'id':_0x2c9308[_0x8a7d('0x44')]['id']}},_0x47f135={};_0x47f135[_0x8a7d('0x2e')]=_['keys'](db[_0x8a7d('0x29')][_0x8a7d('0x45')]);_0x47f135['query']=_['keys'](_0x2c9308['query']);_0x47f135['filters']=_[_0x8a7d('0x2c')](_0x47f135[_0x8a7d('0x2e')],_0x47f135[_0x8a7d('0x2a')]);_0x5c5439[_0x8a7d('0x2d')]=_[_0x8a7d('0x2c')](_0x47f135[_0x8a7d('0x2e')],qs[_0x8a7d('0x2f')](_0x2c9308['query'][_0x8a7d('0x2f')]));_0x5c5439[_0x8a7d('0x2d')]=_0x5c5439[_0x8a7d('0x2d')]['length']?_0x5c5439['attributes']:_0x47f135[_0x8a7d('0x2e')];if(_0x2c9308['query'][_0x8a7d('0x3f')]){_0x5c5439[_0x8a7d('0x40')]=[{'all':!![]}];}_0x5c5439=_['merge']({},_0x5c5439,_0x2c9308[_0x8a7d('0x3e')]);return db['Dynamics365Field'][_0x8a7d('0x46')](_0x5c5439)['then'](handleEntityNotFound(_0x49d9f0,null))[_0x8a7d('0x21')](respondWithResult(_0x49d9f0,null))['catch'](handleError(_0x49d9f0,null));};exports['create']=function(_0x3b97d1,_0x331e87){return db[_0x8a7d('0x29')][_0x8a7d('0x47')](_0x3b97d1[_0x8a7d('0x48')],{})['then'](respondWithResult(_0x331e87,0xc9))[_0x8a7d('0x42')](handleError(_0x331e87,null));};exports[_0x8a7d('0x20')]=function(_0x592c50,_0x8c4e6c){if(_0x592c50[_0x8a7d('0x48')]['id']){delete _0x592c50['body']['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x592c50[_0x8a7d('0x44')]['id']}})[_0x8a7d('0x21')](handleEntityNotFound(_0x8c4e6c,null))['then'](saveUpdates(_0x592c50[_0x8a7d('0x48')],null))[_0x8a7d('0x21')](respondWithResult(_0x8c4e6c,null))[_0x8a7d('0x42')](handleError(_0x8c4e6c,null));};exports[_0x8a7d('0x22')]=function(_0x1bdda1,_0xaeecdf){return db[_0x8a7d('0x29')][_0x8a7d('0x46')]({'where':{'id':_0x1bdda1['params']['id']}})[_0x8a7d('0x21')](handleEntityNotFound(_0xaeecdf,null))[_0x8a7d('0x21')](removeEntity(_0xaeecdf,null))[_0x8a7d('0x42')](handleError(_0xaeecdf,null));}; \ No newline at end of file +var _0x3de0=['jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','then','error','name','send','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','key','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto'];(function(_0x123516,_0x517a0e){var _0x30faee=function(_0x71a5ed){while(--_0x71a5ed){_0x123516['push'](_0x123516['shift']());}};_0x30faee(++_0x517a0e);}(_0x3de0,0x143));var _0x03de=function(_0x3e8402,_0x49353d){_0x3e8402=_0x3e8402-0x0;var _0x545e08=_0x3de0[_0x3e8402];return _0x545e08;};'use strict';var pdf=require(_0x03de('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x03de('0x1'));var zipdir=require(_0x03de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03de('0x3'));var moment=require(_0x03de('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x03de('0x5'));var util=require(_0x03de('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x03de('0x7'));var ejs=require(_0x03de('0x8'));var fs=require('fs');var _=require(_0x03de('0x9'));var squel=require(_0x03de('0xa'));var crypto=require(_0x03de('0xb'));var jsforce=require(_0x03de('0xc'));var deskjs=require(_0x03de('0xd'));var toCsv=require(_0x03de('0x7'));var querystring=require('querystring');var Papa=require(_0x03de('0xe'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x03de('0xf'));var qs=require(_0x03de('0x10'));var logger=require('../../config/logger')(_0x03de('0x11'));var utils=require(_0x03de('0x12'));var config=require('../../config/environment');var db=require(_0x03de('0x13'))['db'];function respondWithStatusCode(_0x556d3a,_0x48acfa){_0x48acfa=_0x48acfa||0xcc;return function(_0x3d6629){if(_0x3d6629){return _0x556d3a[_0x03de('0x14')](_0x48acfa);}return _0x556d3a[_0x03de('0x15')](_0x48acfa)[_0x03de('0x16')]();};}function respondWithResult(_0x1570c3,_0x5d37da){_0x5d37da=_0x5d37da||0xc8;return function(_0xf9553d){if(_0xf9553d){return _0x1570c3[_0x03de('0x15')](_0x5d37da)[_0x03de('0x17')](_0xf9553d);}};}function respondWithFilteredResult(_0x4064a8,_0x5dcade){return function(_0x453564){if(_0x453564){var _0xedbc6b=_0x453564[_0x03de('0x18')],_0x1aa88d=_0x5dcade[_0x03de('0x19')],_0x45881e=_0x5dcade[_0x03de('0x19')]+_0x5dcade[_0x03de('0x1a')],_0x45fe9e;if(_0x45881e>=_0xedbc6b){_0x45881e=_0xedbc6b;_0x45fe9e=0xc8;}else{_0x45fe9e=0xce;}_0x4064a8['status'](_0x45fe9e);return _0x4064a8['set'](_0x03de('0x1b'),_0x1aa88d+'-'+_0x45881e+'/'+_0xedbc6b)[_0x03de('0x17')](_0x453564);}return null;};}function patchUpdates(_0x9b0ede){return function(_0x55ad7e){try{jsonpatch[_0x03de('0x1c')](_0x55ad7e,_0x9b0ede,!![]);}catch(_0x5f6058){return BPromise[_0x03de('0x1d')](_0x5f6058);}return _0x55ad7e[_0x03de('0x1e')]();};}function saveUpdates(_0x148725,_0x27f814){return function(_0x3cb6ff){if(_0x3cb6ff){return _0x3cb6ff['update'](_0x148725)['then'](function(_0x528862){return _0x528862;});}return null;};}function removeEntity(_0x29686b,_0x2884d7){return function(_0x512d82){if(_0x512d82){return _0x512d82[_0x03de('0x1f')]()[_0x03de('0x20')](function(){_0x29686b[_0x03de('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23e463,_0x396a57){return function(_0x5f2317){if(!_0x5f2317){_0x23e463[_0x03de('0x14')](0x194);}return _0x5f2317;};}function handleError(_0x37b44f,_0x8c74aa){_0x8c74aa=_0x8c74aa||0x1f4;return function(_0xf03160){logger[_0x03de('0x21')](_0xf03160['stack']);if(_0xf03160[_0x03de('0x22')]){delete _0xf03160[_0x03de('0x22')];}_0x37b44f[_0x03de('0x15')](_0x8c74aa)[_0x03de('0x23')](_0xf03160);};}exports['index']=function(_0x14e785,_0x28416a){var _0x5ce3c2={},_0x5c371f={},_0xb3fed8={'count':0x0,'rows':[]};var _0x2147b3=db['Dynamics365Field']['rawAttributes'];_0x5c371f[_0x03de('0x24')]=_[_0x03de('0x25')](_0x2147b3);_0x5c371f['query']=_[_0x03de('0x25')](_0x14e785[_0x03de('0x26')]);_0x5c371f[_0x03de('0x27')]=_[_0x03de('0x28')](_0x5c371f['model'],_0x5c371f['query']);_0x5ce3c2[_0x03de('0x29')]=_[_0x03de('0x28')](_0x5c371f[_0x03de('0x24')],qs[_0x03de('0x2a')](_0x14e785[_0x03de('0x26')][_0x03de('0x2a')]));_0x5ce3c2['attributes']=_0x5ce3c2[_0x03de('0x29')][_0x03de('0x2b')]?_0x5ce3c2[_0x03de('0x29')]:_0x5c371f[_0x03de('0x24')];if(!_0x14e785[_0x03de('0x26')][_0x03de('0x2c')]('nolimit')){_0x5ce3c2[_0x03de('0x1a')]=qs[_0x03de('0x1a')](_0x14e785['query'][_0x03de('0x1a')]);_0x5ce3c2[_0x03de('0x19')]=qs[_0x03de('0x19')](_0x14e785[_0x03de('0x26')]['offset']);}_0x5ce3c2[_0x03de('0x2d')]=qs[_0x03de('0x2e')](_0x14e785[_0x03de('0x26')][_0x03de('0x2e')]);_0x5ce3c2['where']=qs[_0x03de('0x27')](_[_0x03de('0x2f')](_0x14e785[_0x03de('0x26')],_0x5c371f['filters']));if(_0x14e785[_0x03de('0x26')][_0x03de('0x30')]){_0x5ce3c2[_0x03de('0x31')]=_[_0x03de('0x32')](_0x5ce3c2[_0x03de('0x31')],{'$or':_[_0x03de('0x33')](_0x2147b3,function(_0xdb21c3){if(_0xdb21c3['type'][_0x03de('0x34')]!==_0x03de('0x35')){var _0x5ba809={};_0x5ba809[_0xdb21c3['field']]={'$like':'%'+_0x14e785[_0x03de('0x26')][_0x03de('0x30')]+'%'};return _0x5ba809;}})});}_0x5ce3c2=_[_0x03de('0x32')]({},_0x5ce3c2,_0x14e785[_0x03de('0x36')]);var _0x65e73c={'where':_0x5ce3c2[_0x03de('0x31')]};return db[_0x03de('0x37')][_0x03de('0x18')](_0x65e73c)[_0x03de('0x20')](function(_0x269158){_0xb3fed8[_0x03de('0x18')]=_0x269158;if(_0x14e785[_0x03de('0x26')][_0x03de('0x38')]){_0x5ce3c2[_0x03de('0x39')]=[{'all':!![]}];}return db[_0x03de('0x37')][_0x03de('0x3a')](_0x5ce3c2);})[_0x03de('0x20')](function(_0x305187){_0xb3fed8[_0x03de('0x3b')]=_0x305187;return _0xb3fed8;})[_0x03de('0x20')](respondWithFilteredResult(_0x28416a,_0x5ce3c2))['catch'](handleError(_0x28416a,null));};exports[_0x03de('0x3c')]=function(_0x2b2dc3,_0x5b13ae){var _0x2b380e={'raw':!![],'where':{'id':_0x2b2dc3[_0x03de('0x3d')]['id']}},_0x2be56c={};_0x2be56c[_0x03de('0x24')]=_[_0x03de('0x25')](db[_0x03de('0x37')][_0x03de('0x3e')]);_0x2be56c[_0x03de('0x26')]=_['keys'](_0x2b2dc3[_0x03de('0x26')]);_0x2be56c[_0x03de('0x27')]=_[_0x03de('0x28')](_0x2be56c[_0x03de('0x24')],_0x2be56c[_0x03de('0x26')]);_0x2b380e[_0x03de('0x29')]=_[_0x03de('0x28')](_0x2be56c[_0x03de('0x24')],qs['fields'](_0x2b2dc3[_0x03de('0x26')]['fields']));_0x2b380e['attributes']=_0x2b380e[_0x03de('0x29')][_0x03de('0x2b')]?_0x2b380e[_0x03de('0x29')]:_0x2be56c['model'];if(_0x2b2dc3['query'][_0x03de('0x38')]){_0x2b380e[_0x03de('0x39')]=[{'all':!![]}];}_0x2b380e=_[_0x03de('0x32')]({},_0x2b380e,_0x2b2dc3[_0x03de('0x36')]);return db['Dynamics365Field'][_0x03de('0x3f')](_0x2b380e)['then'](handleEntityNotFound(_0x5b13ae,null))[_0x03de('0x20')](respondWithResult(_0x5b13ae,null))[_0x03de('0x40')](handleError(_0x5b13ae,null));};exports[_0x03de('0x41')]=function(_0x23d548,_0x1352c5){return db[_0x03de('0x37')]['create'](_0x23d548[_0x03de('0x42')],{})['then'](respondWithResult(_0x1352c5,0xc9))[_0x03de('0x40')](handleError(_0x1352c5,null));};exports['update']=function(_0x13d15c,_0x1ae15f){if(_0x13d15c[_0x03de('0x42')]['id']){delete _0x13d15c['body']['id'];}return db['Dynamics365Field'][_0x03de('0x3f')]({'where':{'id':_0x13d15c[_0x03de('0x3d')]['id']}})[_0x03de('0x20')](handleEntityNotFound(_0x1ae15f,null))[_0x03de('0x20')](saveUpdates(_0x13d15c[_0x03de('0x42')],null))[_0x03de('0x20')](respondWithResult(_0x1ae15f,null))[_0x03de('0x40')](handleError(_0x1ae15f,null));};exports['destroy']=function(_0x2ae2c6,_0x1b6c6e){return db['Dynamics365Field'][_0x03de('0x3f')]({'where':{'id':_0x2ae2c6[_0x03de('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1b6c6e,null))[_0x03de('0x20')](removeEntity(_0x1b6c6e,null))[_0x03de('0x40')](handleError(_0x1b6c6e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 9d7ad89..90ffc04 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 _0xebd1=['define','int_dynamics365_fields','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','./intDynamics365Field.attributes','exports'];(function(_0x271849,_0x3c70b6){var _0x360a25=function(_0x288296){while(--_0x288296){_0x271849['push'](_0x271849['shift']());}};_0x360a25(++_0x3c70b6);}(_0xebd1,0x10c));var _0x1ebd=function(_0x32e649,_0x228649){_0x32e649=_0x32e649-0x0;var _0x14d386=_0xebd1[_0x32e649];return _0x14d386;};'use strict';var _=require('lodash');var util=require(_0x1ebd('0x0'));var logger=require(_0x1ebd('0x1'))(_0x1ebd('0x2'));var moment=require(_0x1ebd('0x3'));var BPromise=require(_0x1ebd('0x4'));var rp=require(_0x1ebd('0x5'));var attributes=require(_0x1ebd('0x6'));module[_0x1ebd('0x7')]=function(_0x3ba6e9,_0x4c5a7d){return _0x3ba6e9[_0x1ebd('0x8')]('Dynamics365Field',attributes,{'tableName':_0x1ebd('0x9'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x1ebd('0xa'),_0x1ebd('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8597=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','Dynamics365Field','int_dynamics365_fields','idField','FieldId'];(function(_0x3b8f2e,_0x5a99a8){var _0x1433d5=function(_0x5e0353){while(--_0x5e0353){_0x3b8f2e['push'](_0x3b8f2e['shift']());}};_0x1433d5(++_0x5a99a8);}(_0x8597,0xc0));var _0x7859=function(_0x5401ae,_0x5e58ac){_0x5401ae=_0x5401ae-0x0;var _0x286068=_0x8597[_0x5401ae];return _0x286068;};'use strict';var _=require(_0x7859('0x0'));var util=require(_0x7859('0x1'));var logger=require(_0x7859('0x2'))(_0x7859('0x3'));var moment=require(_0x7859('0x4'));var BPromise=require(_0x7859('0x5'));var rp=require(_0x7859('0x6'));var attributes=require('./intDynamics365Field.attributes');module[_0x7859('0x7')]=function(_0x45da40,_0x3ef9b0){return _0x45da40['define'](_0x7859('0x8'),attributes,{'tableName':_0x7859('0x9'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x7859('0xa'),_0x7859('0xb')],'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 460e173..397b0d2 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 _0xdef9=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x165ca9,_0x36e359){var _0x25f49a=function(_0x3da5e5){while(--_0x3da5e5){_0x165ca9['push'](_0x165ca9['shift']());}};_0x25f49a(++_0x36e359);}(_0xdef9,0x1ed));var _0x9def=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0xdef9[_0x51ed62];return _0x34aee3;};'use strict';var _=require(_0x9def('0x0'));var util=require(_0x9def('0x1'));var moment=require(_0x9def('0x2'));var BPromise=require(_0x9def('0x3'));var rs=require(_0x9def('0x4'));var fs=require('fs');var Redis=require(_0x9def('0x5'));var db=require(_0x9def('0x6'))['db'];var utils=require(_0x9def('0x7'));var logger=require(_0x9def('0x8'))(_0x9def('0x9'));var config=require(_0x9def('0xa'));var jayson=require(_0x9def('0xb'));var client=jayson[_0x9def('0xc')][_0x9def('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x40c607,_0x25a03e,_0x42296c){return new BPromise(function(_0x1efce0,_0x8262f1){return client['request'](_0x40c607,_0x42296c)[_0x9def('0xe')](function(_0x4f0a0d){logger['info'](_0x9def('0xf'),_0x25a03e,_0x9def('0x10'));logger[_0x9def('0x11')](_0x9def('0x12'),_0x25a03e,'request\x20sent',JSON[_0x9def('0x13')](_0x4f0a0d));if(_0x4f0a0d[_0x9def('0x14')]){if(_0x4f0a0d[_0x9def('0x14')][_0x9def('0x15')]===0x1f4){logger['error'](_0x9def('0xf'),_0x25a03e,_0x4f0a0d[_0x9def('0x14')]['message']);return _0x8262f1(_0x4f0a0d[_0x9def('0x14')]['message']);}logger['error'](_0x9def('0xf'),_0x25a03e,_0x4f0a0d[_0x9def('0x14')][_0x9def('0x16')]);return _0x1efce0(_0x4f0a0d['error'][_0x9def('0x16')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x25a03e,_0x9def('0x10'));_0x1efce0(_0x4f0a0d[_0x9def('0x17')][_0x9def('0x16')]);}})[_0x9def('0x18')](function(_0x463520){logger[_0x9def('0x14')](_0x9def('0xf'),_0x25a03e,_0x463520);_0x8262f1(_0x463520);});});} \ No newline at end of file +var _0x98c5=['Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x98c5,0xeb));var _0x598c=function(_0x3bf622,_0x410deb){_0x3bf622=_0x3bf622-0x0;var _0x3075f4=_0x98c5[_0x3bf622];return _0x3075f4;};'use strict';var _=require(_0x598c('0x0'));var util=require(_0x598c('0x1'));var moment=require(_0x598c('0x2'));var BPromise=require('bluebird');var rs=require(_0x598c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x598c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x598c('0x5'))(_0x598c('0x6'));var config=require('../../config/environment');var jayson=require(_0x598c('0x7'));var client=jayson[_0x598c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x277d53,_0x2ce892,_0x1cb148){return new BPromise(function(_0x3767ae,_0x57300a){return client[_0x598c('0x9')](_0x277d53,_0x1cb148)[_0x598c('0xa')](function(_0x2fb83c){logger[_0x598c('0xb')](_0x598c('0xc'),_0x2ce892,'request\x20sent');logger[_0x598c('0xd')](_0x598c('0xe'),_0x2ce892,_0x598c('0xf'),JSON['stringify'](_0x2fb83c));if(_0x2fb83c['error']){if(_0x2fb83c[_0x598c('0x10')]['code']===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x2ce892,_0x2fb83c[_0x598c('0x10')]['message']);return _0x57300a(_0x2fb83c[_0x598c('0x10')]['message']);}logger[_0x598c('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x2ce892,_0x2fb83c['error']['message']);return _0x3767ae(_0x2fb83c[_0x598c('0x10')][_0x598c('0x11')]);}else{logger[_0x598c('0xb')](_0x598c('0xc'),_0x2ce892,_0x598c('0xf'));_0x3767ae(_0x2fb83c[_0x598c('0x12')]['message']);}})['catch'](function(_0x4ee571){logger[_0x598c('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x2ce892,_0x4ee571);_0x57300a(_0x4ee571);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 634e75e..f680008 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 _0x37be=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x37be,0xa6));var _0xe37b=function(_0x3569fd,_0x4e6d37){_0x3569fd=_0x3569fd-0x0;var _0x2b51ee=_0x37be[_0x3569fd];return _0x2b51ee;};'use strict';var multer=require(_0xe37b('0x0'));var util=require('util');var path=require(_0xe37b('0x1'));var timeout=require(_0xe37b('0x2'));var express=require(_0xe37b('0x3'));var router=express[_0xe37b('0x4')]();var auth=require(_0xe37b('0x5'));var interaction=require(_0xe37b('0x6'));var config=require(_0xe37b('0x7'));var controller=require(_0xe37b('0x8'));router[_0xe37b('0x9')]('/',auth[_0xe37b('0xa')](),controller[_0xe37b('0xb')]);router['get'](_0xe37b('0xc'),auth[_0xe37b('0xa')](),controller[_0xe37b('0xd')]);router['get'](_0xe37b('0xe'),auth[_0xe37b('0xa')](),controller[_0xe37b('0xf')]);router[_0xe37b('0x9')](_0xe37b('0x10'),auth[_0xe37b('0xa')](),controller['getFields']);router[_0xe37b('0x11')]('/',auth['isAuthenticated'](),controller[_0xe37b('0x12')]);router[_0xe37b('0x11')](_0xe37b('0xe'),auth[_0xe37b('0xa')](),controller[_0xe37b('0x13')]);router[_0xe37b('0x14')](_0xe37b('0xc'),auth[_0xe37b('0xa')](),controller[_0xe37b('0x15')]);router[_0xe37b('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xe37b('0x17')]);module[_0xe37b('0x18')]=router; \ No newline at end of file +var _0x0981=['create','/:id/configurations','addConfiguration','update','delete','destroy','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x35c26e,_0x1583cc){var _0x364f03=function(_0xd00dd){while(--_0xd00dd){_0x35c26e['push'](_0x35c26e['shift']());}};_0x364f03(++_0x1583cc);}(_0x0981,0xae));var _0x1098=function(_0x2577be,_0x321390){_0x2577be=_0x2577be-0x0;var _0x409ce2=_0x0981[_0x2577be];return _0x409ce2;};'use strict';var multer=require(_0x1098('0x0'));var util=require('util');var path=require(_0x1098('0x1'));var timeout=require('connect-timeout');var express=require(_0x1098('0x2'));var router=express['Router']();var auth=require(_0x1098('0x3'));var interaction=require(_0x1098('0x4'));var config=require(_0x1098('0x5'));var controller=require('./intFreshdeskAccount.controller');router[_0x1098('0x6')]('/',auth[_0x1098('0x7')](),controller[_0x1098('0x8')]);router[_0x1098('0x6')](_0x1098('0x9'),auth['isAuthenticated'](),controller[_0x1098('0xa')]);router['get']('/:id/configurations',auth[_0x1098('0x7')](),controller[_0x1098('0xb')]);router[_0x1098('0x6')](_0x1098('0xc'),auth['isAuthenticated'](),controller[_0x1098('0xd')]);router[_0x1098('0xe')]('/',auth[_0x1098('0x7')](),controller[_0x1098('0xf')]);router[_0x1098('0xe')](_0x1098('0x10'),auth[_0x1098('0x7')](),controller[_0x1098('0x11')]);router['put'](_0x1098('0x9'),auth[_0x1098('0x7')](),controller[_0x1098('0x12')]);router[_0x1098('0x13')](_0x1098('0x9'),auth[_0x1098('0x7')](),controller[_0x1098('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index b0a2a40..52aa092 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 _0x6d04=['sequelize','exports','STRING','username'];(function(_0x30a8cd,_0x1a93a9){var _0x11da89=function(_0x5609a1){while(--_0x5609a1){_0x30a8cd['push'](_0x30a8cd['shift']());}};_0x11da89(++_0x1a93a9);}(_0x6d04,0x1e4));var _0x46d0=function(_0x2b935c,_0x1face0){_0x2b935c=_0x2b935c-0x0;var _0x4e69b5=_0x6d04[_0x2b935c];return _0x4e69b5;};'use strict';var Sequelize=require(_0x46d0('0x0'));module[_0x46d0('0x1')]={'name':{'type':Sequelize[_0x46d0('0x2')]},'description':{'type':Sequelize[_0x46d0('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x46d0('0x3')},'apiKey':{'type':Sequelize[_0x46d0('0x2')]},'remoteUri':{'type':Sequelize[_0x46d0('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x46d0('0x2')]}}; \ No newline at end of file +var _0xffb8=['remoteUri','sequelize','exports','STRING','username'];(function(_0x49e6bc,_0x50e8b7){var _0x2778d7=function(_0x1aab02){while(--_0x1aab02){_0x49e6bc['push'](_0x49e6bc['shift']());}};_0x2778d7(++_0x50e8b7);}(_0xffb8,0x164));var _0x8ffb=function(_0x3a7dd6,_0x29a531){_0x3a7dd6=_0x3a7dd6-0x0;var _0xc011f=_0xffb8[_0x3a7dd6];return _0xc011f;};'use strict';var Sequelize=require(_0x8ffb('0x0'));module[_0x8ffb('0x1')]={'name':{'type':Sequelize[_0x8ffb('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x8ffb('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x8ffb('0x2')],'unique':_0x8ffb('0x4')},'serverUrl':{'type':Sequelize[_0x8ffb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 6ce46aa..8251083 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 _0xe7b4=['bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','count','offset','Content-Range','json','apply','reject','update','then','destroy','end','stack','name','send','index','FreshdeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','findOne','order','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','FreshdeskConfiguration','remoteUri','apiKey','slice','substring','lastIndexOf','format','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','includes','custom_text','label','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7b4,0x73));var _0x4e7b=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xe7b4[_0x8a969d];return _0x1d8dc7;};'use strict';var pdf=require(_0x4e7b('0x0'));var emlformat=require(_0x4e7b('0x1'));var rimraf=require(_0x4e7b('0x2'));var zipdir=require(_0x4e7b('0x3'));var jsonpatch=require(_0x4e7b('0x4'));var rp=require(_0x4e7b('0x5'));var moment=require(_0x4e7b('0x6'));var BPromise=require(_0x4e7b('0x7'));var Mustache=require(_0x4e7b('0x8'));var util=require('util');var path=require(_0x4e7b('0x9'));var sox=require(_0x4e7b('0xa'));var csv=require(_0x4e7b('0xb'));var ejs=require(_0x4e7b('0xc'));var fs=require('fs');var _=require(_0x4e7b('0xd'));var squel=require(_0x4e7b('0xe'));var crypto=require('crypto');var jsforce=require(_0x4e7b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4e7b('0xb'));var querystring=require(_0x4e7b('0x10'));var Papa=require(_0x4e7b('0x11'));var authService=require(_0x4e7b('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x4e7b('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x4e7b('0x14'))('api');var utils=require(_0x4e7b('0x15'));var config=require(_0x4e7b('0x16'));var db=require(_0x4e7b('0x17'))['db'];var integrations=require(_0x4e7b('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x4e7b('0x19')][_0x4e7b('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xa596b3,_0x1f1443,_0x560cfe,_0x40f340){return new BPromise(function(_0x23518b,_0x3bf39d){var _0x474d9f=_0x40f340||client;return _0x474d9f[_0x4e7b('0x1b')](_0xa596b3,_0x560cfe)['then'](function(_0x366986){logger[_0x4e7b('0x1c')](_0x4e7b('0x1d'),_0x1f1443,_0x4e7b('0x1e'));logger['debug'](_0x4e7b('0x1f'),_0x1f1443,_0x4e7b('0x1e'),JSON['stringify'](_0x366986));if(_0x366986[_0x4e7b('0x20')]){if(_0x366986[_0x4e7b('0x20')][_0x4e7b('0x21')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x1f1443,_0x366986[_0x4e7b('0x20')][_0x4e7b('0x22')]);return _0x3bf39d(_0x366986[_0x4e7b('0x20')][_0x4e7b('0x22')]);}logger[_0x4e7b('0x20')](_0x4e7b('0x1d'),_0x1f1443,_0x366986[_0x4e7b('0x20')][_0x4e7b('0x22')]);return _0x23518b(_0x366986[_0x4e7b('0x20')][_0x4e7b('0x22')]);}else{logger[_0x4e7b('0x1c')](_0x4e7b('0x1d'),_0x1f1443,_0x4e7b('0x1e'));_0x23518b(_0x366986[_0x4e7b('0x23')]['message']);}})['catch'](function(_0x5efa80){logger[_0x4e7b('0x20')](_0x4e7b('0x1d'),_0x1f1443,_0x5efa80);_0x3bf39d(_0x5efa80);});});}function respondWithStatusCode(_0x1ebafa,_0x365e82){_0x365e82=_0x365e82||0xcc;return function(_0x8bc7eb){if(_0x8bc7eb){return _0x1ebafa[_0x4e7b('0x24')](_0x365e82);}return _0x1ebafa[_0x4e7b('0x25')](_0x365e82)['end']();};}function respondWithResult(_0x577740,_0x434db1){_0x434db1=_0x434db1||0xc8;return function(_0x18f957){if(_0x18f957){return _0x577740[_0x4e7b('0x25')](_0x434db1)['json'](_0x18f957);}};}function respondWithFilteredResult(_0x353f3b,_0x55e03b){return function(_0x4fb4ff){if(_0x4fb4ff){var _0x4e095e=_0x4fb4ff[_0x4e7b('0x26')],_0x2e7c3a=_0x55e03b[_0x4e7b('0x27')],_0x1cc172=_0x55e03b[_0x4e7b('0x27')]+_0x55e03b['limit'],_0x310eaf;if(_0x1cc172>=_0x4e095e){_0x1cc172=_0x4e095e;_0x310eaf=0xc8;}else{_0x310eaf=0xce;}_0x353f3b[_0x4e7b('0x25')](_0x310eaf);return _0x353f3b['set'](_0x4e7b('0x28'),_0x2e7c3a+'-'+_0x1cc172+'/'+_0x4e095e)[_0x4e7b('0x29')](_0x4fb4ff);}return null;};}function patchUpdates(_0x3a6e6f){return function(_0x1cfa47){try{jsonpatch[_0x4e7b('0x2a')](_0x1cfa47,_0x3a6e6f,!![]);}catch(_0x13bbc7){return BPromise[_0x4e7b('0x2b')](_0x13bbc7);}return _0x1cfa47['save']();};}function saveUpdates(_0x132b5f,_0x5baf7c){return function(_0x22498d){if(_0x22498d){return _0x22498d[_0x4e7b('0x2c')](_0x132b5f)[_0x4e7b('0x2d')](function(_0x4b459b){return _0x4b459b;});}return null;};}function removeEntity(_0x1cb311,_0x56964b){return function(_0x5467f2){if(_0x5467f2){return _0x5467f2[_0x4e7b('0x2e')]()[_0x4e7b('0x2d')](function(){_0x1cb311['status'](0xcc)[_0x4e7b('0x2f')]();});}};}function handleEntityNotFound(_0x319c82,_0x58b5e2){return function(_0x32394e){if(!_0x32394e){_0x319c82[_0x4e7b('0x24')](0x194);}return _0x32394e;};}function handleError(_0xb03b1,_0x582e5f){_0x582e5f=_0x582e5f||0x1f4;return function(_0x5f5b68){logger['error'](_0x5f5b68[_0x4e7b('0x30')]);if(_0x5f5b68[_0x4e7b('0x31')]){delete _0x5f5b68[_0x4e7b('0x31')];}_0xb03b1[_0x4e7b('0x25')](_0x582e5f)[_0x4e7b('0x32')](_0x5f5b68);};}exports[_0x4e7b('0x33')]=function(_0x4897ec,_0x5ca2c8){var _0x52ff34={},_0x1b56e8={},_0x2d6c76={'count':0x0,'rows':[]};var _0xef7ab4=db[_0x4e7b('0x34')][_0x4e7b('0x35')];_0x1b56e8[_0x4e7b('0x36')]=_[_0x4e7b('0x37')](_0xef7ab4);_0x1b56e8[_0x4e7b('0x38')]=_['keys'](_0x4897ec[_0x4e7b('0x38')]);_0x1b56e8[_0x4e7b('0x39')]=_[_0x4e7b('0x3a')](_0x1b56e8[_0x4e7b('0x36')],_0x1b56e8[_0x4e7b('0x38')]);_0x52ff34[_0x4e7b('0x3b')]=_[_0x4e7b('0x3a')](_0x1b56e8[_0x4e7b('0x36')],qs[_0x4e7b('0x3c')](_0x4897ec['query'][_0x4e7b('0x3c')]));_0x52ff34['attributes']=_0x52ff34['attributes']['length']?_0x52ff34[_0x4e7b('0x3b')]:_0x1b56e8[_0x4e7b('0x36')];if(!_0x4897ec[_0x4e7b('0x38')][_0x4e7b('0x3d')]('nolimit')){_0x52ff34[_0x4e7b('0x3e')]=qs['limit'](_0x4897ec[_0x4e7b('0x38')]['limit']);_0x52ff34['offset']=qs[_0x4e7b('0x27')](_0x4897ec[_0x4e7b('0x38')][_0x4e7b('0x27')]);}_0x52ff34['order']=qs[_0x4e7b('0x3f')](_0x4897ec[_0x4e7b('0x38')][_0x4e7b('0x3f')]);_0x52ff34['where']=qs[_0x4e7b('0x39')](_[_0x4e7b('0x40')](_0x4897ec[_0x4e7b('0x38')],_0x1b56e8[_0x4e7b('0x39')]));if(_0x4897ec['query'][_0x4e7b('0x41')]){_0x52ff34[_0x4e7b('0x42')]=_[_0x4e7b('0x43')](_0x52ff34[_0x4e7b('0x42')],{'$or':_[_0x4e7b('0x44')](_0xef7ab4,function(_0x453487){if(_0x453487[_0x4e7b('0x45')][_0x4e7b('0x46')]!==_0x4e7b('0x47')){var _0x1c6fef={};_0x1c6fef[_0x453487[_0x4e7b('0x48')]]={'$like':'%'+_0x4897ec[_0x4e7b('0x38')][_0x4e7b('0x41')]+'%'};return _0x1c6fef;}})});}_0x52ff34=_['merge']({},_0x52ff34,_0x4897ec[_0x4e7b('0x49')]);var _0x416f08={'where':_0x52ff34[_0x4e7b('0x42')]};return db[_0x4e7b('0x34')]['count'](_0x416f08)[_0x4e7b('0x2d')](function(_0x15cadd){_0x2d6c76['count']=_0x15cadd;if(_0x4897ec['query'][_0x4e7b('0x4a')]){_0x52ff34[_0x4e7b('0x4b')]=[{'all':!![]}];}return db[_0x4e7b('0x34')][_0x4e7b('0x4c')](_0x52ff34);})['then'](function(_0x2c9a36){_0x2d6c76[_0x4e7b('0x4d')]=_0x2c9a36;return _0x2d6c76;})['then'](respondWithFilteredResult(_0x5ca2c8,_0x52ff34))[_0x4e7b('0x4e')](handleError(_0x5ca2c8,null));};exports['show']=function(_0x3b3d6a,_0x13ec89){var _0x2811c5={'raw':![],'where':{'id':_0x3b3d6a[_0x4e7b('0x4f')]['id']}},_0x32294b={};_0x32294b[_0x4e7b('0x36')]=_[_0x4e7b('0x37')](db[_0x4e7b('0x34')][_0x4e7b('0x35')]);_0x32294b[_0x4e7b('0x38')]=_[_0x4e7b('0x37')](_0x3b3d6a[_0x4e7b('0x38')]);_0x32294b[_0x4e7b('0x39')]=_[_0x4e7b('0x3a')](_0x32294b['model'],_0x32294b['query']);_0x2811c5[_0x4e7b('0x3b')]=_[_0x4e7b('0x3a')](_0x32294b[_0x4e7b('0x36')],qs['fields'](_0x3b3d6a[_0x4e7b('0x38')][_0x4e7b('0x3c')]));_0x2811c5['attributes']=_0x2811c5['attributes'][_0x4e7b('0x50')]?_0x2811c5[_0x4e7b('0x3b')]:_0x32294b[_0x4e7b('0x36')];if(_0x3b3d6a[_0x4e7b('0x38')][_0x4e7b('0x4a')]){_0x2811c5['include']=[{'all':!![]}];}_0x2811c5=_[_0x4e7b('0x43')]({},_0x2811c5,_0x3b3d6a['options']);return db[_0x4e7b('0x34')][_0x4e7b('0x51')](_0x2811c5)[_0x4e7b('0x2d')](handleEntityNotFound(_0x13ec89,null))[_0x4e7b('0x2d')](respondWithResult(_0x13ec89,null))[_0x4e7b('0x4e')](handleError(_0x13ec89,null));};exports[_0x4e7b('0x52')]=function(_0x37a0a1,_0x65542f){return db[_0x4e7b('0x34')]['create'](_0x37a0a1[_0x4e7b('0x53')],{})['then'](respondWithResult(_0x65542f,0xc9))[_0x4e7b('0x4e')](handleError(_0x65542f,null));};exports[_0x4e7b('0x2c')]=function(_0x146421,_0x16d683){if(_0x146421[_0x4e7b('0x53')]['id']){delete _0x146421[_0x4e7b('0x53')]['id'];}return db[_0x4e7b('0x34')][_0x4e7b('0x51')]({'where':{'id':_0x146421[_0x4e7b('0x4f')]['id']}})[_0x4e7b('0x2d')](handleEntityNotFound(_0x16d683,null))[_0x4e7b('0x2d')](saveUpdates(_0x146421[_0x4e7b('0x53')],null))[_0x4e7b('0x2d')](respondWithResult(_0x16d683,null))[_0x4e7b('0x4e')](handleError(_0x16d683,null));};exports[_0x4e7b('0x2e')]=function(_0x3d0a7f,_0x33ec61){return db[_0x4e7b('0x34')]['find']({'where':{'id':_0x3d0a7f[_0x4e7b('0x4f')]['id']}})[_0x4e7b('0x2d')](handleEntityNotFound(_0x33ec61,null))['then'](removeEntity(_0x33ec61,null))[_0x4e7b('0x4e')](handleError(_0x33ec61,null));};exports['getConfigurations']=function(_0x118002,_0x117562,_0x2663f3){var _0x1f06ee={};var _0x4e423f={};var _0x384c75;var _0x3419fb;return db[_0x4e7b('0x34')][_0x4e7b('0x54')]({'where':{'id':_0x118002[_0x4e7b('0x4f')]['id']}})[_0x4e7b('0x2d')](handleEntityNotFound(_0x117562,null))[_0x4e7b('0x2d')](function(_0x14a2fd){if(_0x14a2fd){_0x384c75=_0x14a2fd;_0x4e423f[_0x4e7b('0x36')]=_[_0x4e7b('0x37')](db['FreshdeskConfiguration'][_0x4e7b('0x35')]);_0x4e423f[_0x4e7b('0x38')]=_[_0x4e7b('0x37')](_0x118002[_0x4e7b('0x38')]);_0x4e423f[_0x4e7b('0x39')]=_[_0x4e7b('0x3a')](_0x4e423f[_0x4e7b('0x36')],_0x4e423f[_0x4e7b('0x38')]);_0x1f06ee[_0x4e7b('0x3b')]=_[_0x4e7b('0x3a')](_0x4e423f[_0x4e7b('0x36')],qs['fields'](_0x118002[_0x4e7b('0x38')][_0x4e7b('0x3c')]));_0x1f06ee['attributes']=_0x1f06ee[_0x4e7b('0x3b')][_0x4e7b('0x50')]?_0x1f06ee[_0x4e7b('0x3b')]:_0x4e423f[_0x4e7b('0x36')];_0x1f06ee[_0x4e7b('0x55')]=qs['sort'](_0x118002['query'][_0x4e7b('0x3f')]);_0x1f06ee[_0x4e7b('0x42')]=qs[_0x4e7b('0x39')](_['pick'](_0x118002['query'],_0x4e423f[_0x4e7b('0x39')]));if(_0x118002[_0x4e7b('0x38')][_0x4e7b('0x41')]){_0x1f06ee[_0x4e7b('0x42')]=_[_0x4e7b('0x43')](_0x1f06ee[_0x4e7b('0x42')],{'$or':_[_0x4e7b('0x44')](_0x1f06ee[_0x4e7b('0x3b')],function(_0x28a78d){var _0x2c7c17={};_0x2c7c17[_0x28a78d]={'$like':'%'+_0x118002[_0x4e7b('0x38')]['filter']+'%'};return _0x2c7c17;})});}_0x1f06ee=_['merge']({},_0x1f06ee,_0x118002[_0x4e7b('0x49')]);return _0x384c75['getConfigurations'](_0x1f06ee);}})[_0x4e7b('0x2d')](function(_0x144a6e){if(_0x144a6e){_0x3419fb=_0x144a6e[_0x4e7b('0x50')];if(!_0x118002[_0x4e7b('0x38')][_0x4e7b('0x3d')]('nolimit')){_0x1f06ee[_0x4e7b('0x3e')]=qs[_0x4e7b('0x3e')](_0x118002[_0x4e7b('0x38')]['limit']);_0x1f06ee[_0x4e7b('0x27')]=qs[_0x4e7b('0x27')](_0x118002['query'][_0x4e7b('0x27')]);}return _0x384c75[_0x4e7b('0x56')](_0x1f06ee);}})[_0x4e7b('0x2d')](function(_0x3e8193){if(_0x3e8193){return _0x3e8193?{'count':_0x3419fb,'rows':_0x3e8193}:null;}})[_0x4e7b('0x2d')](respondWithResult(_0x117562,null))['catch'](handleError(_0x117562,null));};exports[_0x4e7b('0x57')]=function(_0x6e3242,_0x5c42a1,_0x1b241b){if(_0x6e3242['body']['id']){delete _0x6e3242[_0x4e7b('0x53')]['id'];}return db['FreshdeskAccount'][_0x4e7b('0x54')]({'where':{'id':_0x6e3242[_0x4e7b('0x4f')]['id']}})[_0x4e7b('0x2d')](handleEntityNotFound(_0x5c42a1,null))['then'](function(_0x5a7843){if(_0x5a7843){_0x6e3242[_0x4e7b('0x53')][_0x4e7b('0x58')]=_0x5a7843['id'];_0x6e3242['body'][_0x4e7b('0x59')]=integrations[_0x4e7b('0x5a')](_0x6e3242[_0x4e7b('0x53')][_0x4e7b('0x5b')],_0x6e3242[_0x4e7b('0x53')]['type']);_0x6e3242[_0x4e7b('0x53')]['Descriptions']=integrations['getDescriptions'](_0x6e3242[_0x4e7b('0x53')][_0x4e7b('0x5b')],_0x6e3242['body'][_0x4e7b('0x45')]);return db[_0x4e7b('0x5c')][_0x4e7b('0x52')](_0x6e3242[_0x4e7b('0x53')],{'include':[{'model':db['FreshdeskField'],'as':_0x4e7b('0x59')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x4e7b('0x2d')](respondWithResult(_0x5c42a1,null))[_0x4e7b('0x4e')](handleError(_0x5c42a1,null));};exports['getFields']=function(_0x2aea81,_0x2b58b9,_0x5336f7){return db[_0x4e7b('0x34')][_0x4e7b('0x54')]({'where':{'id':_0x2aea81[_0x4e7b('0x4f')]['id']},'attributes':['id',_0x4e7b('0x5d'),_0x4e7b('0x5e')]})[_0x4e7b('0x2d')](handleEntityNotFound(_0x2b58b9,null))[_0x4e7b('0x2d')](function(_0x237b08){if(_0x237b08){var _0x4484ea=_0x237b08[_0x4e7b('0x5d')];var _0x4e44dd=_0x237b08['remoteUri'][_0x4e7b('0x5f')](-0x1);if(_0x4e44dd==='/'){_0x4484ea=_0x4484ea[_0x4e7b('0x60')](0x0,_0x4484ea[_0x4e7b('0x61')](_0x4e44dd));}return rp({'method':'GET','uri':util['format']('%s/%s',_0x4484ea,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x4e7b('0x62')](_0x4e7b('0x63'),new Buffer(util['format'](_0x4e7b('0x64'),_0x237b08['apiKey']))[_0x4e7b('0x65')](_0x4e7b('0x66')))},'json':!![]});}})[_0x4e7b('0x2d')](function(_0x2de212){if(_0x2de212){var _0x1968a4=[_0x4e7b('0x67'),_0x4e7b('0x68'),_0x4e7b('0x69'),_0x4e7b('0x6a'),'status',_0x4e7b('0x6b'),_0x4e7b('0x6c'),_0x4e7b('0x6d'),_0x4e7b('0x6e'),_0x4e7b('0x6c'),'company'];_['remove'](_0x2de212,function(_0x4b826f){return _0x1968a4[_0x4e7b('0x6f')](_0x4b826f[_0x4e7b('0x31')])||!_0x4b826f['default']&&_0x4b826f['type']!==_0x4e7b('0x70');});return{'count':_0x2de212[_0x4e7b('0x50')],'rows':_[_0x4e7b('0x44')](_0x2de212,function(_0x44d398){return{'id':_0x44d398[_0x4e7b('0x31')],'name':_0x44d398[_0x4e7b('0x71')],'custom':!_0x44d398[_0x4e7b('0x72')],'options':_0x44d398[_0x4e7b('0x73')]?_[_0x4e7b('0x44')](_0x44d398['choices'],function(_0x1becce){return{'name':_[_0x4e7b('0x74')](_0x1becce),'value':_0x1becce};}):[]};})};}})[_0x4e7b('0x2d')](respondWithResult(_0x2b58b9,null))['catch'](function(_0x534d60){var _0x17dabe=_0x2aea81[_0x4e7b('0x38')][_0x4e7b('0x75')]?0x1f4:_0x534d60[_0x4e7b('0x76')]||0x1f4;logger[_0x4e7b('0x20')](_0x4e7b('0x77'),_0x4e7b('0x78'),_0x17dabe,JSON[_0x4e7b('0x79')](_0x534d60));delete _0x534d60['name'];if(_0x17dabe===0x191){_0x17dabe=0x190;}_0x2b58b9['status'](_0x17dabe)[_0x4e7b('0x32')](_0x2aea81[_0x4e7b('0x38')][_0x4e7b('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x534d60['statusCode']}:_0x534d60);});}; \ No newline at end of file +var _0x0736=['save','update','destroy','end','name','send','FreshdeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','map','type','key','field','filter','merge','options','includeAll','include','findAll','catch','params','length','find','create','body','findOne','FreshdeskConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','subject','description','priority','group','company','remove','includes','default','custom_text','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','count','offset','set','Content-Range','apply'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0736,0xc3));var _0x6073=function(_0x3a7634,_0x18f234){_0x3a7634=_0x3a7634-0x0;var _0x1c7ad5=_0x0736[_0x3a7634];return _0x1c7ad5;};'use strict';var pdf=require(_0x6073('0x0'));var emlformat=require(_0x6073('0x1'));var rimraf=require(_0x6073('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6073('0x3'));var rp=require(_0x6073('0x4'));var moment=require(_0x6073('0x5'));var BPromise=require(_0x6073('0x6'));var Mustache=require(_0x6073('0x7'));var util=require('util');var path=require(_0x6073('0x8'));var sox=require(_0x6073('0x9'));var csv=require(_0x6073('0xa'));var ejs=require(_0x6073('0xb'));var fs=require('fs');var _=require(_0x6073('0xc'));var squel=require('squel');var crypto=require(_0x6073('0xd'));var jsforce=require(_0x6073('0xe'));var deskjs=require(_0x6073('0xf'));var toCsv=require(_0x6073('0xa'));var querystring=require(_0x6073('0x10'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x6073('0x11'));var Redis=require(_0x6073('0x12'));var qs=require(_0x6073('0x13'));var logger=require(_0x6073('0x14'))(_0x6073('0x15'));var utils=require(_0x6073('0x16'));var config=require('../../config/environment');var db=require(_0x6073('0x17'))['db'];var integrations=require(_0x6073('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x6073('0x19')][_0x6073('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x532aff,_0x10d40d,_0x3c4664,_0x2db770){return new BPromise(function(_0x3d2aed,_0x4f1a2b){var _0x5b242c=_0x2db770||client;return _0x5b242c[_0x6073('0x1b')](_0x532aff,_0x3c4664)[_0x6073('0x1c')](function(_0x2fe87b){logger[_0x6073('0x1d')](_0x6073('0x1e'),_0x10d40d,_0x6073('0x1f'));logger[_0x6073('0x20')](_0x6073('0x21'),_0x10d40d,_0x6073('0x1f'),JSON[_0x6073('0x22')](_0x2fe87b));if(_0x2fe87b[_0x6073('0x23')]){if(_0x2fe87b[_0x6073('0x23')]['code']===0x1f4){logger[_0x6073('0x23')]('FreshdeskAccount,\x20%s,\x20%s',_0x10d40d,_0x2fe87b[_0x6073('0x23')]['message']);return _0x4f1a2b(_0x2fe87b[_0x6073('0x23')][_0x6073('0x24')]);}logger[_0x6073('0x23')](_0x6073('0x1e'),_0x10d40d,_0x2fe87b[_0x6073('0x23')][_0x6073('0x24')]);return _0x3d2aed(_0x2fe87b[_0x6073('0x23')][_0x6073('0x24')]);}else{logger[_0x6073('0x1d')]('FreshdeskAccount,\x20%s,\x20%s',_0x10d40d,_0x6073('0x1f'));_0x3d2aed(_0x2fe87b['result'][_0x6073('0x24')]);}})['catch'](function(_0x48c745){logger['error'](_0x6073('0x1e'),_0x10d40d,_0x48c745);_0x4f1a2b(_0x48c745);});});}function respondWithStatusCode(_0x24cf76,_0x4cd9a2){_0x4cd9a2=_0x4cd9a2||0xcc;return function(_0x4f1c61){if(_0x4f1c61){return _0x24cf76[_0x6073('0x25')](_0x4cd9a2);}return _0x24cf76[_0x6073('0x26')](_0x4cd9a2)['end']();};}function respondWithResult(_0x430497,_0x4f5cad){_0x4f5cad=_0x4f5cad||0xc8;return function(_0x28118a){if(_0x28118a){return _0x430497[_0x6073('0x26')](_0x4f5cad)[_0x6073('0x27')](_0x28118a);}};}function respondWithFilteredResult(_0x2c5868,_0x95f102){return function(_0x23e873){if(_0x23e873){var _0x5ee5de=_0x23e873[_0x6073('0x28')],_0x5e8e69=_0x95f102[_0x6073('0x29')],_0x2107e7=_0x95f102['offset']+_0x95f102['limit'],_0x2a4951;if(_0x2107e7>=_0x5ee5de){_0x2107e7=_0x5ee5de;_0x2a4951=0xc8;}else{_0x2a4951=0xce;}_0x2c5868['status'](_0x2a4951);return _0x2c5868[_0x6073('0x2a')](_0x6073('0x2b'),_0x5e8e69+'-'+_0x2107e7+'/'+_0x5ee5de)[_0x6073('0x27')](_0x23e873);}return null;};}function patchUpdates(_0x2c3623){return function(_0x3a6910){try{jsonpatch[_0x6073('0x2c')](_0x3a6910,_0x2c3623,!![]);}catch(_0x3a6a8e){return BPromise['reject'](_0x3a6a8e);}return _0x3a6910[_0x6073('0x2d')]();};}function saveUpdates(_0x4f53f5,_0x4b2cb3){return function(_0xbd18b8){if(_0xbd18b8){return _0xbd18b8[_0x6073('0x2e')](_0x4f53f5)[_0x6073('0x1c')](function(_0x5aa7a6){return _0x5aa7a6;});}return null;};}function removeEntity(_0x49f144,_0x52627d){return function(_0x1fa200){if(_0x1fa200){return _0x1fa200[_0x6073('0x2f')]()[_0x6073('0x1c')](function(){_0x49f144[_0x6073('0x26')](0xcc)[_0x6073('0x30')]();});}};}function handleEntityNotFound(_0x59cc8c,_0x290ec9){return function(_0x5c5b93){if(!_0x5c5b93){_0x59cc8c['sendStatus'](0x194);}return _0x5c5b93;};}function handleError(_0x1d3f97,_0x2b9a5d){_0x2b9a5d=_0x2b9a5d||0x1f4;return function(_0x52bc71){logger[_0x6073('0x23')](_0x52bc71['stack']);if(_0x52bc71[_0x6073('0x31')]){delete _0x52bc71['name'];}_0x1d3f97[_0x6073('0x26')](_0x2b9a5d)[_0x6073('0x32')](_0x52bc71);};}exports['index']=function(_0x2c72fd,_0x5b92f6){var _0x343b70={},_0x48168f={},_0x13869e={'count':0x0,'rows':[]};var _0x32c1c8=db[_0x6073('0x33')][_0x6073('0x34')];_0x48168f[_0x6073('0x35')]=_[_0x6073('0x36')](_0x32c1c8);_0x48168f[_0x6073('0x37')]=_[_0x6073('0x36')](_0x2c72fd['query']);_0x48168f[_0x6073('0x38')]=_[_0x6073('0x39')](_0x48168f['model'],_0x48168f[_0x6073('0x37')]);_0x343b70[_0x6073('0x3a')]=_[_0x6073('0x39')](_0x48168f[_0x6073('0x35')],qs[_0x6073('0x3b')](_0x2c72fd[_0x6073('0x37')][_0x6073('0x3b')]));_0x343b70[_0x6073('0x3a')]=_0x343b70[_0x6073('0x3a')]['length']?_0x343b70[_0x6073('0x3a')]:_0x48168f['model'];if(!_0x2c72fd['query'][_0x6073('0x3c')](_0x6073('0x3d'))){_0x343b70[_0x6073('0x3e')]=qs[_0x6073('0x3e')](_0x2c72fd[_0x6073('0x37')][_0x6073('0x3e')]);_0x343b70[_0x6073('0x29')]=qs['offset'](_0x2c72fd[_0x6073('0x37')]['offset']);}_0x343b70[_0x6073('0x3f')]=qs[_0x6073('0x40')](_0x2c72fd[_0x6073('0x37')][_0x6073('0x40')]);_0x343b70[_0x6073('0x41')]=qs[_0x6073('0x38')](_[_0x6073('0x42')](_0x2c72fd[_0x6073('0x37')],_0x48168f[_0x6073('0x38')]));if(_0x2c72fd['query']['filter']){_0x343b70[_0x6073('0x41')]=_['merge'](_0x343b70[_0x6073('0x41')],{'$or':_[_0x6073('0x43')](_0x32c1c8,function(_0x534974){if(_0x534974[_0x6073('0x44')][_0x6073('0x45')]!=='VIRTUAL'){var _0x4e35f0={};_0x4e35f0[_0x534974[_0x6073('0x46')]]={'$like':'%'+_0x2c72fd[_0x6073('0x37')][_0x6073('0x47')]+'%'};return _0x4e35f0;}})});}_0x343b70=_[_0x6073('0x48')]({},_0x343b70,_0x2c72fd[_0x6073('0x49')]);var _0x462e5a={'where':_0x343b70[_0x6073('0x41')]};return db[_0x6073('0x33')][_0x6073('0x28')](_0x462e5a)[_0x6073('0x1c')](function(_0x1a58d2){_0x13869e[_0x6073('0x28')]=_0x1a58d2;if(_0x2c72fd[_0x6073('0x37')][_0x6073('0x4a')]){_0x343b70[_0x6073('0x4b')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x6073('0x4c')](_0x343b70);})[_0x6073('0x1c')](function(_0x5c95cb){_0x13869e['rows']=_0x5c95cb;return _0x13869e;})[_0x6073('0x1c')](respondWithFilteredResult(_0x5b92f6,_0x343b70))[_0x6073('0x4d')](handleError(_0x5b92f6,null));};exports['show']=function(_0x524c89,_0x51f145){var _0x1ccfeb={'raw':![],'where':{'id':_0x524c89[_0x6073('0x4e')]['id']}},_0x10f137={};_0x10f137[_0x6073('0x35')]=_[_0x6073('0x36')](db[_0x6073('0x33')]['rawAttributes']);_0x10f137[_0x6073('0x37')]=_[_0x6073('0x36')](_0x524c89[_0x6073('0x37')]);_0x10f137[_0x6073('0x38')]=_[_0x6073('0x39')](_0x10f137[_0x6073('0x35')],_0x10f137[_0x6073('0x37')]);_0x1ccfeb[_0x6073('0x3a')]=_[_0x6073('0x39')](_0x10f137[_0x6073('0x35')],qs[_0x6073('0x3b')](_0x524c89[_0x6073('0x37')][_0x6073('0x3b')]));_0x1ccfeb[_0x6073('0x3a')]=_0x1ccfeb[_0x6073('0x3a')][_0x6073('0x4f')]?_0x1ccfeb['attributes']:_0x10f137[_0x6073('0x35')];if(_0x524c89['query'][_0x6073('0x4a')]){_0x1ccfeb[_0x6073('0x4b')]=[{'all':!![]}];}_0x1ccfeb=_[_0x6073('0x48')]({},_0x1ccfeb,_0x524c89[_0x6073('0x49')]);return db['FreshdeskAccount'][_0x6073('0x50')](_0x1ccfeb)[_0x6073('0x1c')](handleEntityNotFound(_0x51f145,null))[_0x6073('0x1c')](respondWithResult(_0x51f145,null))['catch'](handleError(_0x51f145,null));};exports[_0x6073('0x51')]=function(_0x4ad3c4,_0x2f1221){return db[_0x6073('0x33')][_0x6073('0x51')](_0x4ad3c4[_0x6073('0x52')],{})[_0x6073('0x1c')](respondWithResult(_0x2f1221,0xc9))[_0x6073('0x4d')](handleError(_0x2f1221,null));};exports[_0x6073('0x2e')]=function(_0x5148fe,_0x237d4d){if(_0x5148fe[_0x6073('0x52')]['id']){delete _0x5148fe[_0x6073('0x52')]['id'];}return db[_0x6073('0x33')][_0x6073('0x50')]({'where':{'id':_0x5148fe[_0x6073('0x4e')]['id']}})[_0x6073('0x1c')](handleEntityNotFound(_0x237d4d,null))[_0x6073('0x1c')](saveUpdates(_0x5148fe[_0x6073('0x52')],null))[_0x6073('0x1c')](respondWithResult(_0x237d4d,null))['catch'](handleError(_0x237d4d,null));};exports['destroy']=function(_0x1e99e3,_0x1cec47){return db[_0x6073('0x33')]['find']({'where':{'id':_0x1e99e3[_0x6073('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1cec47,null))['then'](removeEntity(_0x1cec47,null))['catch'](handleError(_0x1cec47,null));};exports['getConfigurations']=function(_0x2f8500,_0x1d00b7,_0xf5d637){var _0x38a682={};var _0x2bb49e={};var _0x1da134;var _0x5ad287;return db[_0x6073('0x33')][_0x6073('0x53')]({'where':{'id':_0x2f8500[_0x6073('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1d00b7,null))[_0x6073('0x1c')](function(_0xb0849d){if(_0xb0849d){_0x1da134=_0xb0849d;_0x2bb49e['model']=_[_0x6073('0x36')](db[_0x6073('0x54')][_0x6073('0x34')]);_0x2bb49e[_0x6073('0x37')]=_['keys'](_0x2f8500['query']);_0x2bb49e[_0x6073('0x38')]=_[_0x6073('0x39')](_0x2bb49e[_0x6073('0x35')],_0x2bb49e[_0x6073('0x37')]);_0x38a682[_0x6073('0x3a')]=_['intersection'](_0x2bb49e[_0x6073('0x35')],qs[_0x6073('0x3b')](_0x2f8500['query']['fields']));_0x38a682[_0x6073('0x3a')]=_0x38a682[_0x6073('0x3a')][_0x6073('0x4f')]?_0x38a682[_0x6073('0x3a')]:_0x2bb49e[_0x6073('0x35')];_0x38a682[_0x6073('0x3f')]=qs[_0x6073('0x40')](_0x2f8500[_0x6073('0x37')]['sort']);_0x38a682[_0x6073('0x41')]=qs[_0x6073('0x38')](_[_0x6073('0x42')](_0x2f8500[_0x6073('0x37')],_0x2bb49e[_0x6073('0x38')]));if(_0x2f8500[_0x6073('0x37')][_0x6073('0x47')]){_0x38a682['where']=_[_0x6073('0x48')](_0x38a682[_0x6073('0x41')],{'$or':_[_0x6073('0x43')](_0x38a682[_0x6073('0x3a')],function(_0x533bd6){var _0x5c0d34={};_0x5c0d34[_0x533bd6]={'$like':'%'+_0x2f8500[_0x6073('0x37')][_0x6073('0x47')]+'%'};return _0x5c0d34;})});}_0x38a682=_[_0x6073('0x48')]({},_0x38a682,_0x2f8500['options']);return _0x1da134[_0x6073('0x55')](_0x38a682);}})['then'](function(_0x51ed68){if(_0x51ed68){_0x5ad287=_0x51ed68[_0x6073('0x4f')];if(!_0x2f8500[_0x6073('0x37')]['hasOwnProperty'](_0x6073('0x3d'))){_0x38a682[_0x6073('0x3e')]=qs['limit'](_0x2f8500[_0x6073('0x37')][_0x6073('0x3e')]);_0x38a682[_0x6073('0x29')]=qs[_0x6073('0x29')](_0x2f8500[_0x6073('0x37')]['offset']);}return _0x1da134['getConfigurations'](_0x38a682);}})['then'](function(_0x3ab6a1){if(_0x3ab6a1){return _0x3ab6a1?{'count':_0x5ad287,'rows':_0x3ab6a1}:null;}})[_0x6073('0x1c')](respondWithResult(_0x1d00b7,null))[_0x6073('0x4d')](handleError(_0x1d00b7,null));};exports[_0x6073('0x56')]=function(_0x5a7744,_0x2fcff3,_0x856e81){if(_0x5a7744['body']['id']){delete _0x5a7744['body']['id'];}return db[_0x6073('0x33')][_0x6073('0x53')]({'where':{'id':_0x5a7744[_0x6073('0x4e')]['id']}})[_0x6073('0x1c')](handleEntityNotFound(_0x2fcff3,null))[_0x6073('0x1c')](function(_0x3e0f9a){if(_0x3e0f9a){_0x5a7744['body']['AccountId']=_0x3e0f9a['id'];_0x5a7744[_0x6073('0x52')][_0x6073('0x57')]=integrations[_0x6073('0x58')](_0x5a7744[_0x6073('0x52')][_0x6073('0x59')],_0x5a7744[_0x6073('0x52')][_0x6073('0x44')]);_0x5a7744[_0x6073('0x52')]['Descriptions']=integrations['getDescriptions'](_0x5a7744[_0x6073('0x52')][_0x6073('0x59')],_0x5a7744[_0x6073('0x52')][_0x6073('0x44')]);return db[_0x6073('0x54')]['create'](_0x5a7744[_0x6073('0x52')],{'include':[{'model':db[_0x6073('0x5a')],'as':'Subjects'},{'model':db[_0x6073('0x5a')],'as':_0x6073('0x5b')}]});}return null;})[_0x6073('0x1c')](respondWithResult(_0x2fcff3,null))[_0x6073('0x4d')](handleError(_0x2fcff3,null));};exports[_0x6073('0x5c')]=function(_0x7c316f,_0x48efde,_0x2e27c7){return db[_0x6073('0x33')][_0x6073('0x53')]({'where':{'id':_0x7c316f[_0x6073('0x4e')]['id']},'attributes':['id',_0x6073('0x5d'),_0x6073('0x5e')]})[_0x6073('0x1c')](handleEntityNotFound(_0x48efde,null))[_0x6073('0x1c')](function(_0x387d4e){if(_0x387d4e){var _0x4de167=_0x387d4e[_0x6073('0x5d')];var _0x44cf45=_0x387d4e[_0x6073('0x5d')]['slice'](-0x1);if(_0x44cf45==='/'){_0x4de167=_0x4de167[_0x6073('0x5f')](0x0,_0x4de167[_0x6073('0x60')](_0x44cf45));}return rp({'method':_0x6073('0x61'),'uri':util[_0x6073('0x62')](_0x6073('0x63'),_0x4de167,_0x6073('0x64')),'headers':{'Authorization':util[_0x6073('0x62')](_0x6073('0x65'),new Buffer(util[_0x6073('0x62')](_0x6073('0x66'),_0x387d4e[_0x6073('0x5e')]))[_0x6073('0x67')](_0x6073('0x68')))},'json':!![]});}})[_0x6073('0x1c')](function(_0x148cca){if(_0x148cca){var _0x36dc15=['requester',_0x6073('0x69'),'agent',_0x6073('0x6a'),_0x6073('0x26'),_0x6073('0x6b'),'group','source','ticket_type',_0x6073('0x6c'),_0x6073('0x6d')];_[_0x6073('0x6e')](_0x148cca,function(_0xde9334){return _0x36dc15[_0x6073('0x6f')](_0xde9334[_0x6073('0x31')])||!_0xde9334[_0x6073('0x70')]&&_0xde9334[_0x6073('0x44')]!==_0x6073('0x71');});return{'count':_0x148cca[_0x6073('0x4f')],'rows':_[_0x6073('0x43')](_0x148cca,function(_0x1b9bfa){return{'id':_0x1b9bfa[_0x6073('0x31')],'name':_0x1b9bfa[_0x6073('0x72')],'custom':!_0x1b9bfa['default'],'options':_0x1b9bfa[_0x6073('0x73')]?_[_0x6073('0x43')](_0x1b9bfa[_0x6073('0x73')],function(_0x170682){return{'name':_[_0x6073('0x74')](_0x170682),'value':_0x170682};}):[]};})};}})[_0x6073('0x1c')](respondWithResult(_0x48efde,null))[_0x6073('0x4d')](function(_0x4ac601){var _0x9f955e=_0x7c316f['query'][_0x6073('0x75')]?0x1f4:_0x4ac601[_0x6073('0x76')]||0x1f4;logger[_0x6073('0x23')](_0x6073('0x77'),_0x6073('0x5c'),_0x9f955e,JSON['stringify'](_0x4ac601));delete _0x4ac601[_0x6073('0x31')];if(_0x9f955e===0x191){_0x9f955e=0x190;}_0x48efde[_0x6073('0x26')](_0x9f955e)[_0x6073('0x32')](_0x7c316f[_0x6073('0x37')][_0x6073('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x4ac601[_0x6073('0x76')]}:_0x4ac601);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 84af46d..1a6bd21 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 _0x8e0d=['lodash','api','moment','request-promise','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts'];(function(_0x2f0366,_0x10885f){var _0x5e1c27=function(_0x3495c0){while(--_0x3495c0){_0x2f0366['push'](_0x2f0366['shift']());}};_0x5e1c27(++_0x10885f);}(_0x8e0d,0x82));var _0xd8e0=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x8e0d[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require(_0xd8e0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd8e0('0x1'));var moment=require(_0xd8e0('0x2'));var BPromise=require('bluebird');var rp=require(_0xd8e0('0x3'));var attributes=require(_0xd8e0('0x4'));var integrations=require(_0xd8e0('0x5'));module[_0xd8e0('0x6')]=function(_0x548267,_0x5cf790){return _0x548267[_0xd8e0('0x7')](_0xd8e0('0x8'),attributes,{'tableName':_0xd8e0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x622f=['int_freshdesk_accounts','lodash','util','api','moment','bluebird','./intFreshdeskAccount.attributes','exports','FreshdeskAccount'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x622f,0x172));var _0xf622=function(_0x23fae1,_0x9a7e87){_0x23fae1=_0x23fae1-0x0;var _0x1d57f3=_0x622f[_0x23fae1];return _0x1d57f3;};'use strict';var _=require(_0xf622('0x0'));var util=require(_0xf622('0x1'));var logger=require('../../config/logger')(_0xf622('0x2'));var moment=require(_0xf622('0x3'));var BPromise=require(_0xf622('0x4'));var rp=require('request-promise');var attributes=require(_0xf622('0x5'));var integrations=require('../../components/integrations/configuration');module[_0xf622('0x6')]=function(_0x4228ea,_0x5214ae){return _0x4228ea['define'](_0xf622('0x7'),attributes,{'tableName':_0xf622('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 c6be106..dfd5800 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 _0xe8f7=['client','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','FreshdeskAccount','options','raw','where','limit','include','model','attributes','map','GetFreshdeskAccount','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xe8f7,0xe3));var _0x7e8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe8f7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7e8f('0x0'));var util=require(_0x7e8f('0x1'));var moment=require(_0x7e8f('0x2'));var BPromise=require(_0x7e8f('0x3'));var rs=require(_0x7e8f('0x4'));var fs=require('fs');var Redis=require(_0x7e8f('0x5'));var db=require(_0x7e8f('0x6'))['db'];var utils=require(_0x7e8f('0x7'));var logger=require('../../config/logger')(_0x7e8f('0x8'));var config=require(_0x7e8f('0x9'));var jayson=require(_0x7e8f('0xa'));var client=jayson[_0x7e8f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x100019,_0x321394,_0x2bb014){return new BPromise(function(_0x501425,_0x1201b6){return client[_0x7e8f('0xc')](_0x100019,_0x2bb014)['then'](function(_0x35acb5){logger[_0x7e8f('0xd')](_0x7e8f('0xe'),_0x321394,_0x7e8f('0xf'));logger[_0x7e8f('0x10')](_0x7e8f('0x11'),_0x321394,_0x7e8f('0xf'),JSON['stringify'](_0x35acb5));if(_0x35acb5[_0x7e8f('0x12')]){if(_0x35acb5[_0x7e8f('0x12')]['code']===0x1f4){logger[_0x7e8f('0x12')](_0x7e8f('0xe'),_0x321394,_0x35acb5[_0x7e8f('0x12')][_0x7e8f('0x13')]);return _0x1201b6(_0x35acb5[_0x7e8f('0x12')][_0x7e8f('0x13')]);}logger['error'](_0x7e8f('0xe'),_0x321394,_0x35acb5[_0x7e8f('0x12')]['message']);return _0x501425(_0x35acb5[_0x7e8f('0x12')][_0x7e8f('0x13')]);}else{logger[_0x7e8f('0xd')](_0x7e8f('0xe'),_0x321394,_0x7e8f('0xf'));_0x501425(_0x35acb5[_0x7e8f('0x14')][_0x7e8f('0x13')]);}})[_0x7e8f('0x15')](function(_0x4d1a04){logger[_0x7e8f('0x12')](_0x7e8f('0xe'),_0x321394,_0x4d1a04);_0x1201b6(_0x4d1a04);});});}exports['GetFreshdeskAccount']=function(_0x5d8aeb){var _0x3313fb=this;return new Promise(function(_0xc57ebd,_0x6c99ed){return db[_0x7e8f('0x16')]['findAll']({'raw':_0x5d8aeb[_0x7e8f('0x17')]?_0x5d8aeb[_0x7e8f('0x17')][_0x7e8f('0x18')]===undefined?!![]:![]:!![],'where':_0x5d8aeb[_0x7e8f('0x17')]?_0x5d8aeb[_0x7e8f('0x17')][_0x7e8f('0x19')]||null:null,'attributes':_0x5d8aeb[_0x7e8f('0x17')]?_0x5d8aeb[_0x7e8f('0x17')]['attributes']||null:null,'limit':_0x5d8aeb[_0x7e8f('0x17')]?_0x5d8aeb[_0x7e8f('0x17')][_0x7e8f('0x1a')]||null:null,'include':_0x5d8aeb[_0x7e8f('0x17')]?_0x5d8aeb[_0x7e8f('0x17')][_0x7e8f('0x1b')]?_['map'](_0x5d8aeb[_0x7e8f('0x17')][_0x7e8f('0x1b')],function(_0x1dccd5){return{'model':db[_0x1dccd5[_0x7e8f('0x1c')]],'as':_0x1dccd5['as'],'attributes':_0x1dccd5[_0x7e8f('0x1d')],'include':_0x1dccd5[_0x7e8f('0x1b')]?_[_0x7e8f('0x1e')](_0x1dccd5[_0x7e8f('0x1b')],function(_0x40bebe){return{'model':db[_0x40bebe[_0x7e8f('0x1c')]],'as':_0x40bebe['as'],'attributes':_0x40bebe[_0x7e8f('0x1d')],'include':_0x40bebe[_0x7e8f('0x1b')]?_['map'](_0x40bebe[_0x7e8f('0x1b')],function(_0x1763e3){return{'model':db[_0x1763e3[_0x7e8f('0x1c')]],'as':_0x1763e3['as'],'attributes':_0x1763e3[_0x7e8f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40f187){logger[_0x7e8f('0xd')](_0x7e8f('0x1f'),_0x5d8aeb);logger[_0x7e8f('0x10')](_0x7e8f('0x1f'),_0x5d8aeb,JSON['stringify'](_0x40f187));_0xc57ebd(_0x40f187);})[_0x7e8f('0x15')](function(_0x54ae8a){logger[_0x7e8f('0x12')]('GetFreshdeskAccount',_0x54ae8a['message'],_0x5d8aeb);_0x6c99ed(_0x3313fb[_0x7e8f('0x12')](0x1f4,_0x54ae8a[_0x7e8f('0x13')]));});});};exports[_0x7e8f('0x20')]=function(_0x3f9585){var _0x32639a=this;return new Promise(function(_0x5a10bd,_0x16cca7){return db[_0x7e8f('0x16')][_0x7e8f('0x21')]({'raw':_0x3f9585['options']?_0x3f9585['options'][_0x7e8f('0x18')]===undefined?!![]:![]:!![],'where':_0x3f9585[_0x7e8f('0x17')]?_0x3f9585['options'][_0x7e8f('0x19')]||null:null,'attributes':_0x3f9585[_0x7e8f('0x17')]?_0x3f9585[_0x7e8f('0x17')][_0x7e8f('0x1d')]||null:null,'include':_0x3f9585[_0x7e8f('0x17')]?_0x3f9585[_0x7e8f('0x17')][_0x7e8f('0x1b')]?_['map'](_0x3f9585[_0x7e8f('0x17')]['include'],function(_0x2ef847){return{'model':db[_0x2ef847[_0x7e8f('0x1c')]],'as':_0x2ef847['as'],'attributes':_0x2ef847[_0x7e8f('0x1d')],'include':_0x2ef847[_0x7e8f('0x1b')]?_[_0x7e8f('0x1e')](_0x2ef847[_0x7e8f('0x1b')],function(_0x5d20f2){return{'model':db[_0x5d20f2[_0x7e8f('0x1c')]],'as':_0x5d20f2['as'],'attributes':_0x5d20f2[_0x7e8f('0x1d')],'include':_0x5d20f2[_0x7e8f('0x1b')]?_['map'](_0x5d20f2['include'],function(_0xbd56fe){return{'model':db[_0xbd56fe[_0x7e8f('0x1c')]],'as':_0xbd56fe['as'],'attributes':_0xbd56fe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5297eb){logger['info'](_0x7e8f('0x20'),_0x3f9585);logger['debug'](_0x7e8f('0x20'),_0x3f9585,JSON['stringify'](_0x5297eb));_0x5a10bd(_0x5297eb);})['catch'](function(_0x2f7dac){logger['error']('ShowFreshdeskAccount',_0x2f7dac[_0x7e8f('0x13')],_0x3f9585);_0x16cca7(_0x32639a[_0x7e8f('0x12')](0x1f4,_0x2f7dac[_0x7e8f('0x13')]));});});}; \ No newline at end of file +var _0x77b8=['rpc','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','then','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x77b8,0x135));var _0x877b=function(_0x45cf2a,_0x321b63){_0x45cf2a=_0x45cf2a-0x0;var _0x424317=_0x77b8[_0x45cf2a];return _0x424317;};'use strict';var _=require(_0x877b('0x0'));var util=require('util');var moment=require(_0x877b('0x1'));var BPromise=require('bluebird');var rs=require(_0x877b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x877b('0x3'))['db'];var utils=require(_0x877b('0x4'));var logger=require(_0x877b('0x5'))(_0x877b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x877b('0x7')][_0x877b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4696f6,_0x3090cf,_0x766ef0){return new BPromise(function(_0x186827,_0x5f4647){return client[_0x877b('0x9')](_0x4696f6,_0x766ef0)['then'](function(_0x2e1e7e){logger[_0x877b('0xa')](_0x877b('0xb'),_0x3090cf,'request\x20sent');logger[_0x877b('0xc')](_0x877b('0xd'),_0x3090cf,_0x877b('0xe'),JSON[_0x877b('0xf')](_0x2e1e7e));if(_0x2e1e7e[_0x877b('0x10')]){if(_0x2e1e7e['error'][_0x877b('0x11')]===0x1f4){logger[_0x877b('0x10')](_0x877b('0xb'),_0x3090cf,_0x2e1e7e['error'][_0x877b('0x12')]);return _0x5f4647(_0x2e1e7e[_0x877b('0x10')]['message']);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x3090cf,_0x2e1e7e[_0x877b('0x10')][_0x877b('0x12')]);return _0x186827(_0x2e1e7e[_0x877b('0x10')][_0x877b('0x12')]);}else{logger[_0x877b('0xa')](_0x877b('0xb'),_0x3090cf,_0x877b('0xe'));_0x186827(_0x2e1e7e[_0x877b('0x13')][_0x877b('0x12')]);}})[_0x877b('0x14')](function(_0x182abb){logger[_0x877b('0x10')](_0x877b('0xb'),_0x3090cf,_0x182abb);_0x5f4647(_0x182abb);});});}exports['GetFreshdeskAccount']=function(_0x5816ca){var _0x22ce71=this;return new Promise(function(_0x401356,_0x38f49c){return db[_0x877b('0x15')][_0x877b('0x16')]({'raw':_0x5816ca[_0x877b('0x17')]?_0x5816ca[_0x877b('0x17')][_0x877b('0x18')]===undefined?!![]:![]:!![],'where':_0x5816ca[_0x877b('0x17')]?_0x5816ca['options'][_0x877b('0x19')]||null:null,'attributes':_0x5816ca[_0x877b('0x17')]?_0x5816ca['options'][_0x877b('0x1a')]||null:null,'limit':_0x5816ca[_0x877b('0x17')]?_0x5816ca[_0x877b('0x17')][_0x877b('0x1b')]||null:null,'include':_0x5816ca[_0x877b('0x17')]?_0x5816ca[_0x877b('0x17')][_0x877b('0x1c')]?_[_0x877b('0x1d')](_0x5816ca['options'][_0x877b('0x1c')],function(_0xf07a66){return{'model':db[_0xf07a66[_0x877b('0x1e')]],'as':_0xf07a66['as'],'attributes':_0xf07a66[_0x877b('0x1a')],'include':_0xf07a66[_0x877b('0x1c')]?_['map'](_0xf07a66[_0x877b('0x1c')],function(_0x5af658){return{'model':db[_0x5af658[_0x877b('0x1e')]],'as':_0x5af658['as'],'attributes':_0x5af658[_0x877b('0x1a')],'include':_0x5af658['include']?_[_0x877b('0x1d')](_0x5af658[_0x877b('0x1c')],function(_0x3c00f4){return{'model':db[_0x3c00f4['model']],'as':_0x3c00f4['as'],'attributes':_0x3c00f4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xcbaeca){logger[_0x877b('0xa')](_0x877b('0x1f'),_0x5816ca);logger[_0x877b('0xc')]('GetFreshdeskAccount',_0x5816ca,JSON[_0x877b('0xf')](_0xcbaeca));_0x401356(_0xcbaeca);})['catch'](function(_0x5610ad){logger[_0x877b('0x10')](_0x877b('0x1f'),_0x5610ad[_0x877b('0x12')],_0x5816ca);_0x38f49c(_0x22ce71[_0x877b('0x10')](0x1f4,_0x5610ad[_0x877b('0x12')]));});});};exports[_0x877b('0x20')]=function(_0x56a929){var _0x4416c6=this;return new Promise(function(_0x37a510,_0x1ecc28){return db[_0x877b('0x15')][_0x877b('0x21')]({'raw':_0x56a929[_0x877b('0x17')]?_0x56a929['options'][_0x877b('0x18')]===undefined?!![]:![]:!![],'where':_0x56a929[_0x877b('0x17')]?_0x56a929['options'][_0x877b('0x19')]||null:null,'attributes':_0x56a929[_0x877b('0x17')]?_0x56a929[_0x877b('0x17')][_0x877b('0x1a')]||null:null,'include':_0x56a929[_0x877b('0x17')]?_0x56a929[_0x877b('0x17')]['include']?_['map'](_0x56a929[_0x877b('0x17')][_0x877b('0x1c')],function(_0x2247a0){return{'model':db[_0x2247a0[_0x877b('0x1e')]],'as':_0x2247a0['as'],'attributes':_0x2247a0[_0x877b('0x1a')],'include':_0x2247a0[_0x877b('0x1c')]?_[_0x877b('0x1d')](_0x2247a0[_0x877b('0x1c')],function(_0x267102){return{'model':db[_0x267102['model']],'as':_0x267102['as'],'attributes':_0x267102[_0x877b('0x1a')],'include':_0x267102[_0x877b('0x1c')]?_[_0x877b('0x1d')](_0x267102[_0x877b('0x1c')],function(_0x43e883){return{'model':db[_0x43e883[_0x877b('0x1e')]],'as':_0x43e883['as'],'attributes':_0x43e883[_0x877b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x877b('0x22')](function(_0x82bfbc){logger['info'](_0x877b('0x20'),_0x56a929);logger['debug'](_0x877b('0x20'),_0x56a929,JSON[_0x877b('0xf')](_0x82bfbc));_0x37a510(_0x82bfbc);})[_0x877b('0x14')](function(_0x1b17e4){logger['error'](_0x877b('0x20'),_0x1b17e4[_0x877b('0x12')],_0x56a929);_0x1ecc28(_0x4416c6[_0x877b('0x10')](0x1f4,_0x1b17e4['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index c01a0b0..0084ef3 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 _0xd0bb=['/:id/tags','getTags','post','create','setTags','put','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','getDescriptions'];(function(_0x231dda,_0x5b04cc){var _0x3f88cb=function(_0x16eb77){while(--_0x16eb77){_0x231dda['push'](_0x231dda['shift']());}};_0x3f88cb(++_0x5b04cc);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x24ffa5,_0x119b94){_0x24ffa5=_0x24ffa5-0x0;var _0x1f0a5f=_0xd0bb[_0x24ffa5];return _0x1f0a5f;};'use strict';var multer=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var path=require(_0xbd0b('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd0b('0x3'));var router=express['Router']();var auth=require(_0xbd0b('0x4'));var interaction=require(_0xbd0b('0x5'));var config=require('../../config/environment');var controller=require(_0xbd0b('0x6'));router['get']('/',auth[_0xbd0b('0x7')](),controller[_0xbd0b('0x8')]);router[_0xbd0b('0x9')](_0xbd0b('0xa'),auth[_0xbd0b('0x7')](),controller['show']);router[_0xbd0b('0x9')](_0xbd0b('0xb'),auth[_0xbd0b('0x7')](),controller[_0xbd0b('0xc')]);router[_0xbd0b('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xbd0b('0xd')]);router[_0xbd0b('0x9')]('/:id/descriptions',auth[_0xbd0b('0x7')](),controller[_0xbd0b('0xe')]);router['get'](_0xbd0b('0xf'),auth[_0xbd0b('0x7')](),controller[_0xbd0b('0x10')]);router[_0xbd0b('0x11')]('/',auth[_0xbd0b('0x7')](),controller[_0xbd0b('0x12')]);router[_0xbd0b('0x11')](_0xbd0b('0xf'),auth[_0xbd0b('0x7')](),controller[_0xbd0b('0x13')]);router[_0xbd0b('0x14')]('/:id',auth[_0xbd0b('0x7')](),controller['update']);router['delete'](_0xbd0b('0xa'),auth[_0xbd0b('0x7')](),controller[_0xbd0b('0x15')]);module[_0xbd0b('0x16')]=router; \ No newline at end of file +var _0xc3b5=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','setTags','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','/:id','show','get','getFields'];(function(_0x1ab137,_0x14ea94){var _0x201a85=function(_0x244ee3){while(--_0x244ee3){_0x1ab137['push'](_0x1ab137['shift']());}};_0x201a85(++_0x14ea94);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x2ffebf,_0x4d758b){_0x2ffebf=_0x2ffebf-0x0;var _0x578388=_0xc3b5[_0x2ffebf];return _0x578388;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c3b('0x0'));var timeout=require(_0x5c3b('0x1'));var express=require(_0x5c3b('0x2'));var router=express[_0x5c3b('0x3')]();var auth=require(_0x5c3b('0x4'));var interaction=require(_0x5c3b('0x5'));var config=require(_0x5c3b('0x6'));var controller=require(_0x5c3b('0x7'));router['get']('/',auth[_0x5c3b('0x8')](),controller[_0x5c3b('0x9')]);router['get'](_0x5c3b('0xa'),auth[_0x5c3b('0x8')](),controller[_0x5c3b('0xb')]);router[_0x5c3b('0xc')]('/:id/fields',auth[_0x5c3b('0x8')](),controller[_0x5c3b('0xd')]);router[_0x5c3b('0xc')](_0x5c3b('0xe'),auth['isAuthenticated'](),controller[_0x5c3b('0xf')]);router[_0x5c3b('0xc')](_0x5c3b('0x10'),auth[_0x5c3b('0x8')](),controller[_0x5c3b('0x11')]);router['get'](_0x5c3b('0x12'),auth[_0x5c3b('0x8')](),controller['getTags']);router[_0x5c3b('0x13')]('/',auth[_0x5c3b('0x8')](),controller['create']);router[_0x5c3b('0x13')](_0x5c3b('0x12'),auth[_0x5c3b('0x8')](),controller[_0x5c3b('0x14')]);router[_0x5c3b('0x15')](_0x5c3b('0xa'),auth[_0x5c3b('0x8')](),controller['update']);router[_0x5c3b('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x5c3b('0x17')]);module[_0x5c3b('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 17613b8..2d3e176 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 _0xbbe1=['exports','STRING'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xbbe1,0xfc));var _0x1bbe=function(_0x5447a8,_0x45c8e9){_0x5447a8=_0x5447a8-0x0;var _0x4c586b=_0xbbe1[_0x5447a8];return _0x4c586b;};'use strict';var Sequelize=require('sequelize');module[_0x1bbe('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1bbe('0x1')]}}; \ No newline at end of file +var _0x122e=['STRING','sequelize','exports'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x122e,0x9d));var _0xe122=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x122e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe122('0x0'));module[_0xe122('0x1')]={'name':{'type':Sequelize[_0xe122('0x2')]},'description':{'type':Sequelize[_0xe122('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 86134fc..e59c6b5 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 _0xb723=['hasOwnProperty','getSubjects','getDescriptions','Tag','getTags','setTags','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','api','../../config/utils','../../mysqldb','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','end','name','index','FreshdeskConfiguration','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','field','filter','includeAll','findAll','rows','show','params','keys','include','options','find','catch','create','body','findOne','getFields'];(function(_0x28b83a,_0x401d6f){var _0x5985d9=function(_0x37d489){while(--_0x37d489){_0x28b83a['push'](_0x28b83a['shift']());}};_0x5985d9(++_0x401d6f);}(_0xb723,0xb2));var _0x3b72=function(_0x24c3ae,_0x3bf1d1){_0x24c3ae=_0x24c3ae-0x0;var _0xb02bd8=_0xb723[_0x24c3ae];return _0xb02bd8;};'use strict';var pdf=require(_0x3b72('0x0'));var emlformat=require(_0x3b72('0x1'));var rimraf=require(_0x3b72('0x2'));var zipdir=require(_0x3b72('0x3'));var jsonpatch=require(_0x3b72('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3b72('0x5'));var Mustache=require(_0x3b72('0x6'));var util=require('util');var path=require(_0x3b72('0x7'));var sox=require(_0x3b72('0x8'));var csv=require('to-csv');var ejs=require(_0x3b72('0x9'));var fs=require('fs');var _=require(_0x3b72('0xa'));var squel=require('squel');var crypto=require(_0x3b72('0xb'));var jsforce=require(_0x3b72('0xc'));var deskjs=require(_0x3b72('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3b72('0xe'));var Papa=require(_0x3b72('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x3b72('0x10'));var Redis=require(_0x3b72('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x3b72('0x12'));var utils=require(_0x3b72('0x13'));var config=require('../../config/environment');var db=require(_0x3b72('0x14'))['db'];var jayson=require(_0x3b72('0x15'));var client=jayson[_0x3b72('0x16')][_0x3b72('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4e43e8,_0x257597,_0x5baa7e,_0x3be0ee){return new BPromise(function(_0x26a89a,_0x41d0b4){var _0x382c45=_0x3be0ee||client;return _0x382c45['request'](_0x4e43e8,_0x5baa7e)[_0x3b72('0x18')](function(_0x557077){logger[_0x3b72('0x19')](_0x3b72('0x1a'),_0x257597,_0x3b72('0x1b'));logger[_0x3b72('0x1c')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x257597,_0x3b72('0x1b'),JSON['stringify'](_0x557077));if(_0x557077[_0x3b72('0x1d')]){if(_0x557077[_0x3b72('0x1d')]['code']===0x1f4){logger['error'](_0x3b72('0x1a'),_0x257597,_0x557077[_0x3b72('0x1d')][_0x3b72('0x1e')]);return _0x41d0b4(_0x557077[_0x3b72('0x1d')][_0x3b72('0x1e')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x257597,_0x557077[_0x3b72('0x1d')][_0x3b72('0x1e')]);return _0x26a89a(_0x557077['error']['message']);}else{logger[_0x3b72('0x19')](_0x3b72('0x1a'),_0x257597,'request\x20sent');_0x26a89a(_0x557077['result'][_0x3b72('0x1e')]);}})['catch'](function(_0x16994f){logger[_0x3b72('0x1d')](_0x3b72('0x1a'),_0x257597,_0x16994f);_0x41d0b4(_0x16994f);});});}function respondWithStatusCode(_0x47c15a,_0x3733c8){_0x3733c8=_0x3733c8||0xcc;return function(_0x4600a1){if(_0x4600a1){return _0x47c15a[_0x3b72('0x1f')](_0x3733c8);}return _0x47c15a[_0x3b72('0x20')](_0x3733c8)['end']();};}function respondWithResult(_0x3d0c0d,_0x26adbb){_0x26adbb=_0x26adbb||0xc8;return function(_0x1228db){if(_0x1228db){return _0x3d0c0d['status'](_0x26adbb)[_0x3b72('0x21')](_0x1228db);}};}function respondWithFilteredResult(_0x4dd66d,_0xb5f9ae){return function(_0x57b5af){if(_0x57b5af){var _0x2d56c4=_0x57b5af[_0x3b72('0x22')],_0x4c364d=_0xb5f9ae[_0x3b72('0x23')],_0x148a4e=_0xb5f9ae[_0x3b72('0x23')]+_0xb5f9ae[_0x3b72('0x24')],_0x50fb73;if(_0x148a4e>=_0x2d56c4){_0x148a4e=_0x2d56c4;_0x50fb73=0xc8;}else{_0x50fb73=0xce;}_0x4dd66d['status'](_0x50fb73);return _0x4dd66d[_0x3b72('0x25')](_0x3b72('0x26'),_0x4c364d+'-'+_0x148a4e+'/'+_0x2d56c4)[_0x3b72('0x21')](_0x57b5af);}return null;};}function patchUpdates(_0x5641c0){return function(_0x1c8058){try{jsonpatch[_0x3b72('0x27')](_0x1c8058,_0x5641c0,!![]);}catch(_0xf21ea5){return BPromise['reject'](_0xf21ea5);}return _0x1c8058[_0x3b72('0x28')]();};}function saveUpdates(_0x2f3710,_0x376a6a){return function(_0x1ebbb2){if(_0x1ebbb2){return _0x1ebbb2[_0x3b72('0x29')](_0x2f3710)['then'](function(_0xfe80be){return _0xfe80be;});}return null;};}function removeEntity(_0x1eafe7,_0x3d8e68){return function(_0x3b71ad){if(_0x3b71ad){return _0x3b71ad[_0x3b72('0x2a')]()[_0x3b72('0x18')](function(){_0x1eafe7[_0x3b72('0x20')](0xcc)[_0x3b72('0x2b')]();});}};}function handleEntityNotFound(_0x47ccdd,_0xaba490){return function(_0x400478){if(!_0x400478){_0x47ccdd[_0x3b72('0x1f')](0x194);}return _0x400478;};}function handleError(_0x26e775,_0x23cd9a){_0x23cd9a=_0x23cd9a||0x1f4;return function(_0x52d994){logger[_0x3b72('0x1d')](_0x52d994['stack']);if(_0x52d994['name']){delete _0x52d994[_0x3b72('0x2c')];}_0x26e775[_0x3b72('0x20')](_0x23cd9a)['send'](_0x52d994);};}exports[_0x3b72('0x2d')]=function(_0xc6f6b7,_0x47fdce){var _0x43ac0c={},_0x182852={},_0x1146bd={'count':0x0,'rows':[]};var _0x384dff=db[_0x3b72('0x2e')][_0x3b72('0x2f')];_0x182852[_0x3b72('0x30')]=_['keys'](_0x384dff);_0x182852[_0x3b72('0x31')]=_['keys'](_0xc6f6b7['query']);_0x182852[_0x3b72('0x32')]=_[_0x3b72('0x33')](_0x182852[_0x3b72('0x30')],_0x182852[_0x3b72('0x31')]);_0x43ac0c[_0x3b72('0x34')]=_[_0x3b72('0x33')](_0x182852[_0x3b72('0x30')],qs[_0x3b72('0x35')](_0xc6f6b7[_0x3b72('0x31')]['fields']));_0x43ac0c[_0x3b72('0x34')]=_0x43ac0c[_0x3b72('0x34')][_0x3b72('0x36')]?_0x43ac0c[_0x3b72('0x34')]:_0x182852[_0x3b72('0x30')];if(!_0xc6f6b7[_0x3b72('0x31')]['hasOwnProperty'](_0x3b72('0x37'))){_0x43ac0c['limit']=qs[_0x3b72('0x24')](_0xc6f6b7[_0x3b72('0x31')][_0x3b72('0x24')]);_0x43ac0c[_0x3b72('0x23')]=qs[_0x3b72('0x23')](_0xc6f6b7[_0x3b72('0x31')]['offset']);}_0x43ac0c[_0x3b72('0x38')]=qs[_0x3b72('0x39')](_0xc6f6b7[_0x3b72('0x31')][_0x3b72('0x39')]);_0x43ac0c[_0x3b72('0x3a')]=qs[_0x3b72('0x32')](_[_0x3b72('0x3b')](_0xc6f6b7[_0x3b72('0x31')],_0x182852[_0x3b72('0x32')]));if(_0xc6f6b7[_0x3b72('0x31')]['filter']){_0x43ac0c[_0x3b72('0x3a')]=_[_0x3b72('0x3c')](_0x43ac0c['where'],{'$or':_[_0x3b72('0x3d')](_0x384dff,function(_0x56b954){if(_0x56b954[_0x3b72('0x3e')]['key']!==_0x3b72('0x3f')){var _0x2a8cb4={};_0x2a8cb4[_0x56b954[_0x3b72('0x40')]]={'$like':'%'+_0xc6f6b7[_0x3b72('0x31')][_0x3b72('0x41')]+'%'};return _0x2a8cb4;}})});}_0x43ac0c=_[_0x3b72('0x3c')]({},_0x43ac0c,_0xc6f6b7['options']);var _0x517d2c={'where':_0x43ac0c[_0x3b72('0x3a')]};return db[_0x3b72('0x2e')][_0x3b72('0x22')](_0x517d2c)[_0x3b72('0x18')](function(_0x3e6dd0){_0x1146bd[_0x3b72('0x22')]=_0x3e6dd0;if(_0xc6f6b7['query'][_0x3b72('0x42')]){_0x43ac0c['include']=[{'all':!![]}];}return db[_0x3b72('0x2e')][_0x3b72('0x43')](_0x43ac0c);})[_0x3b72('0x18')](function(_0x451427){_0x1146bd[_0x3b72('0x44')]=_0x451427;return _0x1146bd;})[_0x3b72('0x18')](respondWithFilteredResult(_0x47fdce,_0x43ac0c))['catch'](handleError(_0x47fdce,null));};exports[_0x3b72('0x45')]=function(_0x3760ae,_0x5c1f11){var _0x5c3c5f={'raw':![],'where':{'id':_0x3760ae[_0x3b72('0x46')]['id']}},_0x4b0c59={};_0x4b0c59['model']=_[_0x3b72('0x47')](db['FreshdeskConfiguration'][_0x3b72('0x2f')]);_0x4b0c59[_0x3b72('0x31')]=_[_0x3b72('0x47')](_0x3760ae[_0x3b72('0x31')]);_0x4b0c59['filters']=_['intersection'](_0x4b0c59['model'],_0x4b0c59[_0x3b72('0x31')]);_0x5c3c5f['attributes']=_['intersection'](_0x4b0c59[_0x3b72('0x30')],qs[_0x3b72('0x35')](_0x3760ae[_0x3b72('0x31')]['fields']));_0x5c3c5f[_0x3b72('0x34')]=_0x5c3c5f[_0x3b72('0x34')][_0x3b72('0x36')]?_0x5c3c5f[_0x3b72('0x34')]:_0x4b0c59['model'];if(_0x3760ae['query'][_0x3b72('0x42')]){_0x5c3c5f[_0x3b72('0x48')]=[{'all':!![]}];}_0x5c3c5f=_[_0x3b72('0x3c')]({},_0x5c3c5f,_0x3760ae[_0x3b72('0x49')]);return db[_0x3b72('0x2e')][_0x3b72('0x4a')](_0x5c3c5f)['then'](handleEntityNotFound(_0x5c1f11,null))[_0x3b72('0x18')](respondWithResult(_0x5c1f11,null))[_0x3b72('0x4b')](handleError(_0x5c1f11,null));};exports['create']=function(_0x132e26,_0x290132){return db['FreshdeskConfiguration'][_0x3b72('0x4c')](_0x132e26[_0x3b72('0x4d')],{})[_0x3b72('0x18')](respondWithResult(_0x290132,0xc9))[_0x3b72('0x4b')](handleError(_0x290132,null));};exports[_0x3b72('0x29')]=function(_0x2de7da,_0x2b741f){if(_0x2de7da[_0x3b72('0x4d')]['id']){delete _0x2de7da[_0x3b72('0x4d')]['id'];}return db[_0x3b72('0x2e')]['find']({'where':{'id':_0x2de7da[_0x3b72('0x46')]['id']}})[_0x3b72('0x18')](handleEntityNotFound(_0x2b741f,null))['then'](saveUpdates(_0x2de7da['body'],null))['then'](respondWithResult(_0x2b741f,null))[_0x3b72('0x4b')](handleError(_0x2b741f,null));};exports[_0x3b72('0x2a')]=function(_0x5bc013,_0x2988f1){return db['FreshdeskConfiguration'][_0x3b72('0x4a')]({'where':{'id':_0x5bc013[_0x3b72('0x46')]['id']}})[_0x3b72('0x18')](handleEntityNotFound(_0x2988f1,null))[_0x3b72('0x18')](removeEntity(_0x2988f1,null))[_0x3b72('0x4b')](handleError(_0x2988f1,null));};exports['getFields']=function(_0x4ca5fa,_0x5c2541,_0x5956fa){var _0x1525bb={};var _0x5cc13a={};var _0x3d48b9;var _0x1ec2a2;return db[_0x3b72('0x2e')][_0x3b72('0x4e')]({'where':{'id':_0x4ca5fa[_0x3b72('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c2541,null))[_0x3b72('0x18')](function(_0x159ebe){if(_0x159ebe){_0x3d48b9=_0x159ebe;_0x5cc13a['model']=_[_0x3b72('0x47')](db['FreshdeskField'][_0x3b72('0x2f')]);_0x5cc13a[_0x3b72('0x31')]=_[_0x3b72('0x47')](_0x4ca5fa[_0x3b72('0x31')]);_0x5cc13a[_0x3b72('0x32')]=_['intersection'](_0x5cc13a[_0x3b72('0x30')],_0x5cc13a['query']);_0x1525bb[_0x3b72('0x34')]=_[_0x3b72('0x33')](_0x5cc13a[_0x3b72('0x30')],qs[_0x3b72('0x35')](_0x4ca5fa[_0x3b72('0x31')][_0x3b72('0x35')]));_0x1525bb['attributes']=_0x1525bb[_0x3b72('0x34')]['length']?_0x1525bb[_0x3b72('0x34')]:_0x5cc13a[_0x3b72('0x30')];_0x1525bb[_0x3b72('0x38')]=qs[_0x3b72('0x39')](_0x4ca5fa[_0x3b72('0x31')][_0x3b72('0x39')]);_0x1525bb[_0x3b72('0x3a')]=qs[_0x3b72('0x32')](_[_0x3b72('0x3b')](_0x4ca5fa[_0x3b72('0x31')],_0x5cc13a[_0x3b72('0x32')]));if(_0x4ca5fa[_0x3b72('0x31')]['filter']){_0x1525bb[_0x3b72('0x3a')]=_[_0x3b72('0x3c')](_0x1525bb[_0x3b72('0x3a')],{'$or':_[_0x3b72('0x3d')](_0x1525bb[_0x3b72('0x34')],function(_0x49f887){var _0x1cb662={};_0x1cb662[_0x49f887]={'$like':'%'+_0x4ca5fa[_0x3b72('0x31')][_0x3b72('0x41')]+'%'};return _0x1cb662;})});}_0x1525bb=_[_0x3b72('0x3c')]({},_0x1525bb,_0x4ca5fa[_0x3b72('0x49')]);return _0x3d48b9[_0x3b72('0x4f')](_0x1525bb);}})[_0x3b72('0x18')](function(_0x3e5997){if(_0x3e5997){_0x1ec2a2=_0x3e5997[_0x3b72('0x36')];if(!_0x4ca5fa[_0x3b72('0x31')][_0x3b72('0x50')](_0x3b72('0x37'))){_0x1525bb[_0x3b72('0x24')]=qs[_0x3b72('0x24')](_0x4ca5fa['query'][_0x3b72('0x24')]);_0x1525bb[_0x3b72('0x23')]=qs[_0x3b72('0x23')](_0x4ca5fa[_0x3b72('0x31')][_0x3b72('0x23')]);}return _0x3d48b9[_0x3b72('0x4f')](_0x1525bb);}})[_0x3b72('0x18')](function(_0x495bf8){if(_0x495bf8){return _0x495bf8?{'count':_0x1ec2a2,'rows':_0x495bf8}:null;}})[_0x3b72('0x18')](respondWithResult(_0x5c2541,null))['catch'](handleError(_0x5c2541,null));};exports['getSubjects']=function(_0x589a93,_0x23f421,_0x496f77){var _0x60a954={};var _0x10b14c={};var _0x480eaf;var _0x13fe33;return db['FreshdeskConfiguration'][_0x3b72('0x4e')]({'where':{'id':_0x589a93[_0x3b72('0x46')]['id']}})[_0x3b72('0x18')](handleEntityNotFound(_0x23f421,null))[_0x3b72('0x18')](function(_0x1a5159){if(_0x1a5159){_0x480eaf=_0x1a5159;_0x10b14c['model']=_[_0x3b72('0x47')](db['FreshdeskField'][_0x3b72('0x2f')]);_0x10b14c[_0x3b72('0x31')]=_['keys'](_0x589a93[_0x3b72('0x31')]);_0x10b14c[_0x3b72('0x32')]=_[_0x3b72('0x33')](_0x10b14c[_0x3b72('0x30')],_0x10b14c[_0x3b72('0x31')]);_0x60a954[_0x3b72('0x34')]=_['intersection'](_0x10b14c[_0x3b72('0x30')],qs[_0x3b72('0x35')](_0x589a93[_0x3b72('0x31')][_0x3b72('0x35')]));_0x60a954['attributes']=_0x60a954[_0x3b72('0x34')][_0x3b72('0x36')]?_0x60a954[_0x3b72('0x34')]:_0x10b14c[_0x3b72('0x30')];_0x60a954[_0x3b72('0x38')]=qs[_0x3b72('0x39')](_0x589a93[_0x3b72('0x31')][_0x3b72('0x39')]);_0x60a954[_0x3b72('0x3a')]=qs[_0x3b72('0x32')](_['pick'](_0x589a93[_0x3b72('0x31')],_0x10b14c[_0x3b72('0x32')]));if(_0x589a93[_0x3b72('0x31')][_0x3b72('0x41')]){_0x60a954[_0x3b72('0x3a')]=_[_0x3b72('0x3c')](_0x60a954[_0x3b72('0x3a')],{'$or':_[_0x3b72('0x3d')](_0x60a954[_0x3b72('0x34')],function(_0x7dc6d1){var _0x26535b={};_0x26535b[_0x7dc6d1]={'$like':'%'+_0x589a93[_0x3b72('0x31')][_0x3b72('0x41')]+'%'};return _0x26535b;})});}_0x60a954=_[_0x3b72('0x3c')]({},_0x60a954,_0x589a93[_0x3b72('0x49')]);return _0x480eaf['getSubjects'](_0x60a954);}})[_0x3b72('0x18')](function(_0x14cc55){if(_0x14cc55){_0x13fe33=_0x14cc55[_0x3b72('0x36')];if(!_0x589a93[_0x3b72('0x31')][_0x3b72('0x50')](_0x3b72('0x37'))){_0x60a954[_0x3b72('0x24')]=qs[_0x3b72('0x24')](_0x589a93[_0x3b72('0x31')][_0x3b72('0x24')]);_0x60a954[_0x3b72('0x23')]=qs[_0x3b72('0x23')](_0x589a93[_0x3b72('0x31')][_0x3b72('0x23')]);}return _0x480eaf[_0x3b72('0x51')](_0x60a954);}})[_0x3b72('0x18')](function(_0x2043b1){if(_0x2043b1){return _0x2043b1?{'count':_0x13fe33,'rows':_0x2043b1}:null;}})['then'](respondWithResult(_0x23f421,null))[_0x3b72('0x4b')](handleError(_0x23f421,null));};exports[_0x3b72('0x52')]=function(_0x580414,_0x18922f,_0x282797){var _0x427410={};var _0x4b31ee={};var _0xc3efef;var _0xa743be;return db['FreshdeskConfiguration'][_0x3b72('0x4e')]({'where':{'id':_0x580414['params']['id']}})[_0x3b72('0x18')](handleEntityNotFound(_0x18922f,null))[_0x3b72('0x18')](function(_0x51277e){if(_0x51277e){_0xc3efef=_0x51277e;_0x4b31ee[_0x3b72('0x30')]=_[_0x3b72('0x47')](db['FreshdeskField'][_0x3b72('0x2f')]);_0x4b31ee['query']=_['keys'](_0x580414[_0x3b72('0x31')]);_0x4b31ee[_0x3b72('0x32')]=_['intersection'](_0x4b31ee[_0x3b72('0x30')],_0x4b31ee[_0x3b72('0x31')]);_0x427410[_0x3b72('0x34')]=_[_0x3b72('0x33')](_0x4b31ee[_0x3b72('0x30')],qs[_0x3b72('0x35')](_0x580414['query'][_0x3b72('0x35')]));_0x427410[_0x3b72('0x34')]=_0x427410[_0x3b72('0x34')][_0x3b72('0x36')]?_0x427410[_0x3b72('0x34')]:_0x4b31ee[_0x3b72('0x30')];_0x427410[_0x3b72('0x38')]=qs[_0x3b72('0x39')](_0x580414[_0x3b72('0x31')][_0x3b72('0x39')]);_0x427410[_0x3b72('0x3a')]=qs[_0x3b72('0x32')](_[_0x3b72('0x3b')](_0x580414[_0x3b72('0x31')],_0x4b31ee[_0x3b72('0x32')]));if(_0x580414[_0x3b72('0x31')][_0x3b72('0x41')]){_0x427410['where']=_[_0x3b72('0x3c')](_0x427410[_0x3b72('0x3a')],{'$or':_['map'](_0x427410['attributes'],function(_0x123f4b){var _0x499a61={};_0x499a61[_0x123f4b]={'$like':'%'+_0x580414[_0x3b72('0x31')][_0x3b72('0x41')]+'%'};return _0x499a61;})});}_0x427410=_[_0x3b72('0x3c')]({},_0x427410,_0x580414[_0x3b72('0x49')]);return _0xc3efef[_0x3b72('0x52')](_0x427410);}})[_0x3b72('0x18')](function(_0x20ec29){if(_0x20ec29){_0xa743be=_0x20ec29['length'];if(!_0x580414[_0x3b72('0x31')][_0x3b72('0x50')](_0x3b72('0x37'))){_0x427410[_0x3b72('0x24')]=qs['limit'](_0x580414['query'][_0x3b72('0x24')]);_0x427410['offset']=qs[_0x3b72('0x23')](_0x580414[_0x3b72('0x31')]['offset']);}return _0xc3efef[_0x3b72('0x52')](_0x427410);}})[_0x3b72('0x18')](function(_0x36bac6){if(_0x36bac6){return _0x36bac6?{'count':_0xa743be,'rows':_0x36bac6}:null;}})['then'](respondWithResult(_0x18922f,null))[_0x3b72('0x4b')](handleError(_0x18922f,null));};exports['getTags']=function(_0x1777b9,_0x32bf04,_0x182657){var _0x1a5b7e={};var _0x13ba20={};var _0x3bdbe4;var _0x3102a2;return db['FreshdeskConfiguration'][_0x3b72('0x4e')]({'where':{'id':_0x1777b9['params']['id']}})['then'](handleEntityNotFound(_0x32bf04,null))[_0x3b72('0x18')](function(_0x4b8e3a){if(_0x4b8e3a){_0x3bdbe4=_0x4b8e3a;_0x13ba20[_0x3b72('0x30')]=_[_0x3b72('0x47')](db[_0x3b72('0x53')][_0x3b72('0x2f')]);_0x13ba20[_0x3b72('0x31')]=_['keys'](_0x1777b9[_0x3b72('0x31')]);_0x13ba20[_0x3b72('0x32')]=_['intersection'](_0x13ba20[_0x3b72('0x30')],_0x13ba20[_0x3b72('0x31')]);_0x1a5b7e[_0x3b72('0x34')]=_[_0x3b72('0x33')](_0x13ba20[_0x3b72('0x30')],qs['fields'](_0x1777b9[_0x3b72('0x31')][_0x3b72('0x35')]));_0x1a5b7e[_0x3b72('0x34')]=_0x1a5b7e['attributes'][_0x3b72('0x36')]?_0x1a5b7e[_0x3b72('0x34')]:_0x13ba20[_0x3b72('0x30')];_0x1a5b7e[_0x3b72('0x38')]=qs[_0x3b72('0x39')](_0x1777b9[_0x3b72('0x31')]['sort']);_0x1a5b7e[_0x3b72('0x3a')]=qs[_0x3b72('0x32')](_[_0x3b72('0x3b')](_0x1777b9[_0x3b72('0x31')],_0x13ba20[_0x3b72('0x32')]));if(_0x1777b9[_0x3b72('0x31')][_0x3b72('0x41')]){_0x1a5b7e['where']=_['merge'](_0x1a5b7e[_0x3b72('0x3a')],{'$or':_[_0x3b72('0x3d')](_0x1a5b7e[_0x3b72('0x34')],function(_0x458b26){var _0x44093c={};_0x44093c[_0x458b26]={'$like':'%'+_0x1777b9['query'][_0x3b72('0x41')]+'%'};return _0x44093c;})});}_0x1a5b7e=_[_0x3b72('0x3c')]({},_0x1a5b7e,_0x1777b9['options']);return _0x3bdbe4[_0x3b72('0x54')](_0x1a5b7e);}})[_0x3b72('0x18')](function(_0x704227){if(_0x704227){_0x3102a2=_0x704227[_0x3b72('0x36')];if(!_0x1777b9[_0x3b72('0x31')][_0x3b72('0x50')](_0x3b72('0x37'))){_0x1a5b7e[_0x3b72('0x24')]=qs[_0x3b72('0x24')](_0x1777b9[_0x3b72('0x31')]['limit']);_0x1a5b7e['offset']=qs[_0x3b72('0x23')](_0x1777b9[_0x3b72('0x31')][_0x3b72('0x23')]);}return _0x3bdbe4[_0x3b72('0x54')](_0x1a5b7e);}})['then'](function(_0x410f44){if(_0x410f44){return _0x410f44?{'count':_0x3102a2,'rows':_0x410f44}:null;}})['then'](respondWithResult(_0x32bf04,null))['catch'](handleError(_0x32bf04,null));};exports[_0x3b72('0x55')]=function(_0x4202b3,_0x207854,_0x253d3a){if(_0x4202b3[_0x3b72('0x4d')]['id']){delete _0x4202b3[_0x3b72('0x4d')]['id'];}return db['FreshdeskConfiguration'][_0x3b72('0x4e')]({'where':{'id':_0x4202b3[_0x3b72('0x46')]['id']}})[_0x3b72('0x18')](handleEntityNotFound(_0x207854,null))[_0x3b72('0x18')](function(_0x20cb4f){if(_0x20cb4f){return _0x20cb4f[_0x3b72('0x55')](_0x4202b3[_0x3b72('0x4d')]['ids']||[]);}return null;})[_0x3b72('0x18')](respondWithResult(_0x207854,null))[_0x3b72('0x4b')](handleError(_0x207854,null));}; \ No newline at end of file +var _0x319b=['findOne','FreshdeskField','getSubjects','getDescriptions','getTags','setTags','ids','zip-dir','moment','bluebird','mustache','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','status','end','count','offset','limit','set','json','apply','reject','update','destroy','stack','name','index','FreshdeskConfiguration','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','body','getFields'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x319b,0xb3));var _0xb319=function(_0x285633,_0x4c9897){_0x285633=_0x285633-0x0;var _0x4f03a7=_0x319b[_0x285633];return _0x4f03a7;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb319('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb319('0x1'));var BPromise=require(_0xb319('0x2'));var Mustache=require(_0xb319('0x3'));var util=require('util');var path=require(_0xb319('0x4'));var sox=require(_0xb319('0x5'));var csv=require('to-csv');var ejs=require(_0xb319('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb319('0x7'));var crypto=require(_0xb319('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xb319('0x9'));var toCsv=require(_0xb319('0xa'));var querystring=require(_0xb319('0xb'));var Papa=require('papaparse');var authService=require(_0xb319('0xc'));var hardwareService=require(_0xb319('0xd'));var Redis=require(_0xb319('0xe'));var qs=require(_0xb319('0xf'));var logger=require(_0xb319('0x10'))(_0xb319('0x11'));var utils=require('../../config/utils');var config=require(_0xb319('0x12'));var db=require('../../mysqldb')['db'];var jayson=require(_0xb319('0x13'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdc8045,_0x28d0f0,_0x166e16,_0x24ec16){return new BPromise(function(_0x4d8510,_0x3fffe4){var _0x7f9e9f=_0x24ec16||client;return _0x7f9e9f[_0xb319('0x14')](_0xdc8045,_0x166e16)[_0xb319('0x15')](function(_0x14c89e){logger[_0xb319('0x16')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x28d0f0,_0xb319('0x17'));logger[_0xb319('0x18')](_0xb319('0x19'),_0x28d0f0,_0xb319('0x17'),JSON[_0xb319('0x1a')](_0x14c89e));if(_0x14c89e[_0xb319('0x1b')]){if(_0x14c89e[_0xb319('0x1b')][_0xb319('0x1c')]===0x1f4){logger[_0xb319('0x1b')](_0xb319('0x1d'),_0x28d0f0,_0x14c89e[_0xb319('0x1b')][_0xb319('0x1e')]);return _0x3fffe4(_0x14c89e['error'][_0xb319('0x1e')]);}logger[_0xb319('0x1b')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x28d0f0,_0x14c89e[_0xb319('0x1b')][_0xb319('0x1e')]);return _0x4d8510(_0x14c89e[_0xb319('0x1b')][_0xb319('0x1e')]);}else{logger[_0xb319('0x16')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x28d0f0,'request\x20sent');_0x4d8510(_0x14c89e['result'][_0xb319('0x1e')]);}})[_0xb319('0x1f')](function(_0x54be33){logger[_0xb319('0x1b')](_0xb319('0x1d'),_0x28d0f0,_0x54be33);_0x3fffe4(_0x54be33);});});}function respondWithStatusCode(_0x53be21,_0x28f8b4){_0x28f8b4=_0x28f8b4||0xcc;return function(_0x4cf158){if(_0x4cf158){return _0x53be21['sendStatus'](_0x28f8b4);}return _0x53be21[_0xb319('0x20')](_0x28f8b4)[_0xb319('0x21')]();};}function respondWithResult(_0x523780,_0x584db6){_0x584db6=_0x584db6||0xc8;return function(_0x482ef4){if(_0x482ef4){return _0x523780[_0xb319('0x20')](_0x584db6)['json'](_0x482ef4);}};}function respondWithFilteredResult(_0x3540f2,_0x1940b7){return function(_0x54f60b){if(_0x54f60b){var _0x27cf80=_0x54f60b[_0xb319('0x22')],_0xee2360=_0x1940b7[_0xb319('0x23')],_0x175c6f=_0x1940b7[_0xb319('0x23')]+_0x1940b7[_0xb319('0x24')],_0x495860;if(_0x175c6f>=_0x27cf80){_0x175c6f=_0x27cf80;_0x495860=0xc8;}else{_0x495860=0xce;}_0x3540f2['status'](_0x495860);return _0x3540f2[_0xb319('0x25')]('Content-Range',_0xee2360+'-'+_0x175c6f+'/'+_0x27cf80)[_0xb319('0x26')](_0x54f60b);}return null;};}function patchUpdates(_0x482520){return function(_0x6d3497){try{jsonpatch[_0xb319('0x27')](_0x6d3497,_0x482520,!![]);}catch(_0x4c3bf5){return BPromise[_0xb319('0x28')](_0x4c3bf5);}return _0x6d3497['save']();};}function saveUpdates(_0x254347,_0x210970){return function(_0x95e9cf){if(_0x95e9cf){return _0x95e9cf[_0xb319('0x29')](_0x254347)['then'](function(_0x51e5c3){return _0x51e5c3;});}return null;};}function removeEntity(_0x519306,_0x120331){return function(_0x7f89a1){if(_0x7f89a1){return _0x7f89a1[_0xb319('0x2a')]()[_0xb319('0x15')](function(){_0x519306[_0xb319('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16baa3,_0x4ab860){return function(_0x2fcd61){if(!_0x2fcd61){_0x16baa3['sendStatus'](0x194);}return _0x2fcd61;};}function handleError(_0x59a4c7,_0x5448a5){_0x5448a5=_0x5448a5||0x1f4;return function(_0xfa3e03){logger[_0xb319('0x1b')](_0xfa3e03[_0xb319('0x2b')]);if(_0xfa3e03['name']){delete _0xfa3e03[_0xb319('0x2c')];}_0x59a4c7[_0xb319('0x20')](_0x5448a5)['send'](_0xfa3e03);};}exports[_0xb319('0x2d')]=function(_0x104792,_0x4e6c46){var _0x53355b={},_0x3e0e28={},_0x585b61={'count':0x0,'rows':[]};var _0x3bd433=db[_0xb319('0x2e')][_0xb319('0x2f')];_0x3e0e28[_0xb319('0x30')]=_[_0xb319('0x31')](_0x3bd433);_0x3e0e28[_0xb319('0x32')]=_[_0xb319('0x31')](_0x104792[_0xb319('0x32')]);_0x3e0e28['filters']=_[_0xb319('0x33')](_0x3e0e28[_0xb319('0x30')],_0x3e0e28['query']);_0x53355b['attributes']=_[_0xb319('0x33')](_0x3e0e28[_0xb319('0x30')],qs['fields'](_0x104792[_0xb319('0x32')][_0xb319('0x34')]));_0x53355b['attributes']=_0x53355b[_0xb319('0x35')][_0xb319('0x36')]?_0x53355b['attributes']:_0x3e0e28[_0xb319('0x30')];if(!_0x104792[_0xb319('0x32')][_0xb319('0x37')](_0xb319('0x38'))){_0x53355b[_0xb319('0x24')]=qs['limit'](_0x104792[_0xb319('0x32')]['limit']);_0x53355b['offset']=qs[_0xb319('0x23')](_0x104792[_0xb319('0x32')][_0xb319('0x23')]);}_0x53355b[_0xb319('0x39')]=qs[_0xb319('0x3a')](_0x104792[_0xb319('0x32')]['sort']);_0x53355b[_0xb319('0x3b')]=qs[_0xb319('0x3c')](_[_0xb319('0x3d')](_0x104792[_0xb319('0x32')],_0x3e0e28[_0xb319('0x3c')]));if(_0x104792['query'][_0xb319('0x3e')]){_0x53355b[_0xb319('0x3b')]=_[_0xb319('0x3f')](_0x53355b[_0xb319('0x3b')],{'$or':_[_0xb319('0x40')](_0x3bd433,function(_0x3878fa){if(_0x3878fa[_0xb319('0x41')][_0xb319('0x42')]!==_0xb319('0x43')){var _0x278bb4={};_0x278bb4[_0x3878fa['field']]={'$like':'%'+_0x104792[_0xb319('0x32')][_0xb319('0x3e')]+'%'};return _0x278bb4;}})});}_0x53355b=_[_0xb319('0x3f')]({},_0x53355b,_0x104792['options']);var _0x14c0bf={'where':_0x53355b[_0xb319('0x3b')]};return db['FreshdeskConfiguration'][_0xb319('0x22')](_0x14c0bf)['then'](function(_0x1798c4){_0x585b61[_0xb319('0x22')]=_0x1798c4;if(_0x104792[_0xb319('0x32')][_0xb319('0x44')]){_0x53355b[_0xb319('0x45')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xb319('0x46')](_0x53355b);})[_0xb319('0x15')](function(_0x59e9ea){_0x585b61[_0xb319('0x47')]=_0x59e9ea;return _0x585b61;})[_0xb319('0x15')](respondWithFilteredResult(_0x4e6c46,_0x53355b))[_0xb319('0x1f')](handleError(_0x4e6c46,null));};exports[_0xb319('0x48')]=function(_0x4c28ed,_0x2902e3){var _0x35ba3a={'raw':![],'where':{'id':_0x4c28ed[_0xb319('0x49')]['id']}},_0x532582={};_0x532582[_0xb319('0x30')]=_[_0xb319('0x31')](db[_0xb319('0x2e')][_0xb319('0x2f')]);_0x532582[_0xb319('0x32')]=_[_0xb319('0x31')](_0x4c28ed[_0xb319('0x32')]);_0x532582[_0xb319('0x3c')]=_['intersection'](_0x532582['model'],_0x532582[_0xb319('0x32')]);_0x35ba3a[_0xb319('0x35')]=_[_0xb319('0x33')](_0x532582[_0xb319('0x30')],qs['fields'](_0x4c28ed['query']['fields']));_0x35ba3a[_0xb319('0x35')]=_0x35ba3a['attributes'][_0xb319('0x36')]?_0x35ba3a[_0xb319('0x35')]:_0x532582[_0xb319('0x30')];if(_0x4c28ed[_0xb319('0x32')]['includeAll']){_0x35ba3a['include']=[{'all':!![]}];}_0x35ba3a=_[_0xb319('0x3f')]({},_0x35ba3a,_0x4c28ed[_0xb319('0x4a')]);return db[_0xb319('0x2e')][_0xb319('0x4b')](_0x35ba3a)[_0xb319('0x15')](handleEntityNotFound(_0x2902e3,null))[_0xb319('0x15')](respondWithResult(_0x2902e3,null))[_0xb319('0x1f')](handleError(_0x2902e3,null));};exports[_0xb319('0x4c')]=function(_0x3991d7,_0x3a94c4){return db[_0xb319('0x2e')][_0xb319('0x4c')](_0x3991d7['body'],{})[_0xb319('0x15')](respondWithResult(_0x3a94c4,0xc9))[_0xb319('0x1f')](handleError(_0x3a94c4,null));};exports[_0xb319('0x29')]=function(_0x23bb15,_0x5060d2){if(_0x23bb15[_0xb319('0x4d')]['id']){delete _0x23bb15[_0xb319('0x4d')]['id'];}return db[_0xb319('0x2e')]['find']({'where':{'id':_0x23bb15[_0xb319('0x49')]['id']}})[_0xb319('0x15')](handleEntityNotFound(_0x5060d2,null))[_0xb319('0x15')](saveUpdates(_0x23bb15[_0xb319('0x4d')],null))[_0xb319('0x15')](respondWithResult(_0x5060d2,null))[_0xb319('0x1f')](handleError(_0x5060d2,null));};exports[_0xb319('0x2a')]=function(_0x464a00,_0x2a21c9){return db['FreshdeskConfiguration'][_0xb319('0x4b')]({'where':{'id':_0x464a00['params']['id']}})['then'](handleEntityNotFound(_0x2a21c9,null))['then'](removeEntity(_0x2a21c9,null))['catch'](handleError(_0x2a21c9,null));};exports[_0xb319('0x4e')]=function(_0x2a1403,_0x573ee5,_0x165a7e){var _0x18089f={};var _0x388a2c={};var _0x5ae990;var _0x969409;return db[_0xb319('0x2e')][_0xb319('0x4f')]({'where':{'id':_0x2a1403[_0xb319('0x49')]['id']}})[_0xb319('0x15')](handleEntityNotFound(_0x573ee5,null))[_0xb319('0x15')](function(_0x10fc95){if(_0x10fc95){_0x5ae990=_0x10fc95;_0x388a2c['model']=_[_0xb319('0x31')](db[_0xb319('0x50')][_0xb319('0x2f')]);_0x388a2c[_0xb319('0x32')]=_[_0xb319('0x31')](_0x2a1403[_0xb319('0x32')]);_0x388a2c[_0xb319('0x3c')]=_[_0xb319('0x33')](_0x388a2c['model'],_0x388a2c[_0xb319('0x32')]);_0x18089f['attributes']=_[_0xb319('0x33')](_0x388a2c[_0xb319('0x30')],qs[_0xb319('0x34')](_0x2a1403[_0xb319('0x32')]['fields']));_0x18089f[_0xb319('0x35')]=_0x18089f[_0xb319('0x35')][_0xb319('0x36')]?_0x18089f[_0xb319('0x35')]:_0x388a2c['model'];_0x18089f['order']=qs[_0xb319('0x3a')](_0x2a1403[_0xb319('0x32')]['sort']);_0x18089f['where']=qs[_0xb319('0x3c')](_['pick'](_0x2a1403[_0xb319('0x32')],_0x388a2c[_0xb319('0x3c')]));if(_0x2a1403[_0xb319('0x32')][_0xb319('0x3e')]){_0x18089f['where']=_[_0xb319('0x3f')](_0x18089f[_0xb319('0x3b')],{'$or':_[_0xb319('0x40')](_0x18089f[_0xb319('0x35')],function(_0x2fa5f5){var _0x53339b={};_0x53339b[_0x2fa5f5]={'$like':'%'+_0x2a1403['query']['filter']+'%'};return _0x53339b;})});}_0x18089f=_['merge']({},_0x18089f,_0x2a1403['options']);return _0x5ae990[_0xb319('0x4e')](_0x18089f);}})[_0xb319('0x15')](function(_0x2fdcd8){if(_0x2fdcd8){_0x969409=_0x2fdcd8[_0xb319('0x36')];if(!_0x2a1403[_0xb319('0x32')][_0xb319('0x37')](_0xb319('0x38'))){_0x18089f[_0xb319('0x24')]=qs[_0xb319('0x24')](_0x2a1403['query']['limit']);_0x18089f[_0xb319('0x23')]=qs[_0xb319('0x23')](_0x2a1403[_0xb319('0x32')][_0xb319('0x23')]);}return _0x5ae990[_0xb319('0x4e')](_0x18089f);}})['then'](function(_0x12efcd){if(_0x12efcd){return _0x12efcd?{'count':_0x969409,'rows':_0x12efcd}:null;}})[_0xb319('0x15')](respondWithResult(_0x573ee5,null))[_0xb319('0x1f')](handleError(_0x573ee5,null));};exports[_0xb319('0x51')]=function(_0x4d8f66,_0xddc3fe,_0x3d2fd3){var _0x8a1789={};var _0x45fab6={};var _0x299c07;var _0x32514d;return db['FreshdeskConfiguration'][_0xb319('0x4f')]({'where':{'id':_0x4d8f66['params']['id']}})[_0xb319('0x15')](handleEntityNotFound(_0xddc3fe,null))[_0xb319('0x15')](function(_0x46e664){if(_0x46e664){_0x299c07=_0x46e664;_0x45fab6['model']=_[_0xb319('0x31')](db[_0xb319('0x50')][_0xb319('0x2f')]);_0x45fab6[_0xb319('0x32')]=_[_0xb319('0x31')](_0x4d8f66[_0xb319('0x32')]);_0x45fab6['filters']=_[_0xb319('0x33')](_0x45fab6[_0xb319('0x30')],_0x45fab6[_0xb319('0x32')]);_0x8a1789[_0xb319('0x35')]=_[_0xb319('0x33')](_0x45fab6['model'],qs[_0xb319('0x34')](_0x4d8f66[_0xb319('0x32')][_0xb319('0x34')]));_0x8a1789[_0xb319('0x35')]=_0x8a1789[_0xb319('0x35')][_0xb319('0x36')]?_0x8a1789[_0xb319('0x35')]:_0x45fab6['model'];_0x8a1789[_0xb319('0x39')]=qs['sort'](_0x4d8f66[_0xb319('0x32')]['sort']);_0x8a1789[_0xb319('0x3b')]=qs[_0xb319('0x3c')](_[_0xb319('0x3d')](_0x4d8f66[_0xb319('0x32')],_0x45fab6['filters']));if(_0x4d8f66[_0xb319('0x32')]['filter']){_0x8a1789[_0xb319('0x3b')]=_['merge'](_0x8a1789[_0xb319('0x3b')],{'$or':_[_0xb319('0x40')](_0x8a1789[_0xb319('0x35')],function(_0x12627c){var _0x5dfef2={};_0x5dfef2[_0x12627c]={'$like':'%'+_0x4d8f66[_0xb319('0x32')]['filter']+'%'};return _0x5dfef2;})});}_0x8a1789=_[_0xb319('0x3f')]({},_0x8a1789,_0x4d8f66['options']);return _0x299c07[_0xb319('0x51')](_0x8a1789);}})[_0xb319('0x15')](function(_0x54d19c){if(_0x54d19c){_0x32514d=_0x54d19c[_0xb319('0x36')];if(!_0x4d8f66['query'][_0xb319('0x37')](_0xb319('0x38'))){_0x8a1789[_0xb319('0x24')]=qs[_0xb319('0x24')](_0x4d8f66[_0xb319('0x32')]['limit']);_0x8a1789['offset']=qs[_0xb319('0x23')](_0x4d8f66[_0xb319('0x32')][_0xb319('0x23')]);}return _0x299c07[_0xb319('0x51')](_0x8a1789);}})[_0xb319('0x15')](function(_0x20982d){if(_0x20982d){return _0x20982d?{'count':_0x32514d,'rows':_0x20982d}:null;}})[_0xb319('0x15')](respondWithResult(_0xddc3fe,null))[_0xb319('0x1f')](handleError(_0xddc3fe,null));};exports[_0xb319('0x52')]=function(_0x3b398c,_0x59e0de,_0x1c7182){var _0x29f2eb={};var _0x52499f={};var _0x145654;var _0x833d91;return db[_0xb319('0x2e')][_0xb319('0x4f')]({'where':{'id':_0x3b398c[_0xb319('0x49')]['id']}})[_0xb319('0x15')](handleEntityNotFound(_0x59e0de,null))[_0xb319('0x15')](function(_0x38dade){if(_0x38dade){_0x145654=_0x38dade;_0x52499f[_0xb319('0x30')]=_[_0xb319('0x31')](db[_0xb319('0x50')][_0xb319('0x2f')]);_0x52499f[_0xb319('0x32')]=_[_0xb319('0x31')](_0x3b398c['query']);_0x52499f[_0xb319('0x3c')]=_[_0xb319('0x33')](_0x52499f[_0xb319('0x30')],_0x52499f[_0xb319('0x32')]);_0x29f2eb[_0xb319('0x35')]=_[_0xb319('0x33')](_0x52499f[_0xb319('0x30')],qs[_0xb319('0x34')](_0x3b398c[_0xb319('0x32')][_0xb319('0x34')]));_0x29f2eb[_0xb319('0x35')]=_0x29f2eb[_0xb319('0x35')][_0xb319('0x36')]?_0x29f2eb[_0xb319('0x35')]:_0x52499f['model'];_0x29f2eb[_0xb319('0x39')]=qs[_0xb319('0x3a')](_0x3b398c[_0xb319('0x32')][_0xb319('0x3a')]);_0x29f2eb[_0xb319('0x3b')]=qs[_0xb319('0x3c')](_[_0xb319('0x3d')](_0x3b398c[_0xb319('0x32')],_0x52499f[_0xb319('0x3c')]));if(_0x3b398c['query']['filter']){_0x29f2eb[_0xb319('0x3b')]=_[_0xb319('0x3f')](_0x29f2eb[_0xb319('0x3b')],{'$or':_[_0xb319('0x40')](_0x29f2eb[_0xb319('0x35')],function(_0x1906ae){var _0x593d1a={};_0x593d1a[_0x1906ae]={'$like':'%'+_0x3b398c['query'][_0xb319('0x3e')]+'%'};return _0x593d1a;})});}_0x29f2eb=_[_0xb319('0x3f')]({},_0x29f2eb,_0x3b398c[_0xb319('0x4a')]);return _0x145654[_0xb319('0x52')](_0x29f2eb);}})[_0xb319('0x15')](function(_0xf7c787){if(_0xf7c787){_0x833d91=_0xf7c787[_0xb319('0x36')];if(!_0x3b398c['query'][_0xb319('0x37')](_0xb319('0x38'))){_0x29f2eb[_0xb319('0x24')]=qs[_0xb319('0x24')](_0x3b398c[_0xb319('0x32')][_0xb319('0x24')]);_0x29f2eb['offset']=qs['offset'](_0x3b398c[_0xb319('0x32')][_0xb319('0x23')]);}return _0x145654[_0xb319('0x52')](_0x29f2eb);}})['then'](function(_0x1549d8){if(_0x1549d8){return _0x1549d8?{'count':_0x833d91,'rows':_0x1549d8}:null;}})[_0xb319('0x15')](respondWithResult(_0x59e0de,null))['catch'](handleError(_0x59e0de,null));};exports[_0xb319('0x53')]=function(_0x15bee7,_0x3e20ea,_0x43b378){var _0x53f578={};var _0x4055c4={};var _0x3e13ca;var _0x3d2151;return db[_0xb319('0x2e')]['findOne']({'where':{'id':_0x15bee7[_0xb319('0x49')]['id']}})[_0xb319('0x15')](handleEntityNotFound(_0x3e20ea,null))[_0xb319('0x15')](function(_0x3791ea){if(_0x3791ea){_0x3e13ca=_0x3791ea;_0x4055c4[_0xb319('0x30')]=_['keys'](db['Tag'][_0xb319('0x2f')]);_0x4055c4[_0xb319('0x32')]=_[_0xb319('0x31')](_0x15bee7[_0xb319('0x32')]);_0x4055c4[_0xb319('0x3c')]=_['intersection'](_0x4055c4['model'],_0x4055c4[_0xb319('0x32')]);_0x53f578[_0xb319('0x35')]=_[_0xb319('0x33')](_0x4055c4[_0xb319('0x30')],qs[_0xb319('0x34')](_0x15bee7[_0xb319('0x32')][_0xb319('0x34')]));_0x53f578[_0xb319('0x35')]=_0x53f578['attributes']['length']?_0x53f578[_0xb319('0x35')]:_0x4055c4[_0xb319('0x30')];_0x53f578[_0xb319('0x39')]=qs[_0xb319('0x3a')](_0x15bee7[_0xb319('0x32')]['sort']);_0x53f578[_0xb319('0x3b')]=qs[_0xb319('0x3c')](_[_0xb319('0x3d')](_0x15bee7[_0xb319('0x32')],_0x4055c4['filters']));if(_0x15bee7[_0xb319('0x32')][_0xb319('0x3e')]){_0x53f578['where']=_[_0xb319('0x3f')](_0x53f578['where'],{'$or':_[_0xb319('0x40')](_0x53f578[_0xb319('0x35')],function(_0x49dbab){var _0x4bc99b={};_0x4bc99b[_0x49dbab]={'$like':'%'+_0x15bee7[_0xb319('0x32')][_0xb319('0x3e')]+'%'};return _0x4bc99b;})});}_0x53f578=_['merge']({},_0x53f578,_0x15bee7['options']);return _0x3e13ca[_0xb319('0x53')](_0x53f578);}})[_0xb319('0x15')](function(_0x14a6cc){if(_0x14a6cc){_0x3d2151=_0x14a6cc[_0xb319('0x36')];if(!_0x15bee7[_0xb319('0x32')][_0xb319('0x37')](_0xb319('0x38'))){_0x53f578[_0xb319('0x24')]=qs['limit'](_0x15bee7[_0xb319('0x32')][_0xb319('0x24')]);_0x53f578['offset']=qs[_0xb319('0x23')](_0x15bee7[_0xb319('0x32')][_0xb319('0x23')]);}return _0x3e13ca[_0xb319('0x53')](_0x53f578);}})[_0xb319('0x15')](function(_0x3ce5d4){if(_0x3ce5d4){return _0x3ce5d4?{'count':_0x3d2151,'rows':_0x3ce5d4}:null;}})[_0xb319('0x15')](respondWithResult(_0x3e20ea,null))[_0xb319('0x1f')](handleError(_0x3e20ea,null));};exports[_0xb319('0x54')]=function(_0x20606d,_0x5c6c59,_0x5557b3){if(_0x20606d[_0xb319('0x4d')]['id']){delete _0x20606d[_0xb319('0x4d')]['id'];}return db['FreshdeskConfiguration'][_0xb319('0x4f')]({'where':{'id':_0x20606d['params']['id']}})[_0xb319('0x15')](handleEntityNotFound(_0x5c6c59,null))[_0xb319('0x15')](function(_0x28233f){if(_0x28233f){return _0x28233f[_0xb319('0x54')](_0x20606d['body'][_0xb319('0x55')]||[]);}return null;})[_0xb319('0x15')](respondWithResult(_0x5c6c59,null))['catch'](handleError(_0x5c6c59,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 5d7900c..dd22817 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 _0x2af3=['bluebird','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','lodash','../../config/logger','api','moment'];(function(_0xb37311,_0x180fef){var _0x496834=function(_0x5c5624){while(--_0x5c5624){_0xb37311['push'](_0xb37311['shift']());}};_0x496834(++_0x180fef);}(_0x2af3,0xbc));var _0x32af=function(_0x23a8ec,_0x3ddb28){_0x23a8ec=_0x23a8ec-0x0;var _0x2b2ce1=_0x2af3[_0x23a8ec];return _0x2b2ce1;};'use strict';var _=require(_0x32af('0x0'));var util=require('util');var logger=require(_0x32af('0x1'))(_0x32af('0x2'));var moment=require(_0x32af('0x3'));var BPromise=require(_0x32af('0x4'));var rp=require('request-promise');var attributes=require(_0x32af('0x5'));module['exports']=function(_0x485634,_0x50ead6){return _0x485634[_0x32af('0x6')](_0x32af('0x7'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb2a=['../../config/logger','bluebird','request-promise','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util'];(function(_0x44dd67,_0x36b3f7){var _0x7e1f04=function(_0x42d52b){while(--_0x42d52b){_0x44dd67['push'](_0x44dd67['shift']());}};_0x7e1f04(++_0x36b3f7);}(_0xdb2a,0x16f));var _0xadb2=function(_0x37975d,_0x5ef72b){_0x37975d=_0x37975d-0x0;var _0x3e4aad=_0xdb2a[_0x37975d];return _0x3e4aad;};'use strict';var _=require(_0xadb2('0x0'));var util=require(_0xadb2('0x1'));var logger=require(_0xadb2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xadb2('0x3'));var rp=require(_0xadb2('0x4'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xadb2('0x5')]=function(_0x51f39a,_0x3aa5e1){return _0x51f39a[_0xadb2('0x6')](_0xadb2('0x7'),attributes,{'tableName':_0xadb2('0x8'),'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 cd05c4a..4626ce7 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 _0x4976=['client','http','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x4976,0x140));var _0x6497=function(_0x1f185e,_0x47e170){_0x1f185e=_0x1f185e-0x0;var _0x2ffdd1=_0x4976[_0x1f185e];return _0x2ffdd1;};'use strict';var _=require(_0x6497('0x0'));var util=require(_0x6497('0x1'));var moment=require(_0x6497('0x2'));var BPromise=require(_0x6497('0x3'));var rs=require(_0x6497('0x4'));var fs=require('fs');var Redis=require(_0x6497('0x5'));var db=require(_0x6497('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6497('0x7'))(_0x6497('0x8'));var config=require('../../config/environment');var jayson=require(_0x6497('0x9'));var client=jayson[_0x6497('0xa')][_0x6497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x822ff2,_0x34d8c5,_0x4ae4fb){return new BPromise(function(_0x3a9490,_0x9edc0a){return client['request'](_0x822ff2,_0x4ae4fb)[_0x6497('0xc')](function(_0x39e329){logger['info'](_0x6497('0xd'),_0x34d8c5,_0x6497('0xe'));logger[_0x6497('0xf')](_0x6497('0x10'),_0x34d8c5,_0x6497('0xe'),JSON['stringify'](_0x39e329));if(_0x39e329[_0x6497('0x11')]){if(_0x39e329[_0x6497('0x11')][_0x6497('0x12')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x34d8c5,_0x39e329[_0x6497('0x11')]['message']);return _0x9edc0a(_0x39e329[_0x6497('0x11')][_0x6497('0x13')]);}logger[_0x6497('0x11')](_0x6497('0xd'),_0x34d8c5,_0x39e329[_0x6497('0x11')][_0x6497('0x13')]);return _0x3a9490(_0x39e329['error'][_0x6497('0x13')]);}else{logger[_0x6497('0x14')](_0x6497('0xd'),_0x34d8c5,'request\x20sent');_0x3a9490(_0x39e329[_0x6497('0x15')]['message']);}})['catch'](function(_0x232c16){logger[_0x6497('0x11')](_0x6497('0xd'),_0x34d8c5,_0x232c16);_0x9edc0a(_0x232c16);});});} \ No newline at end of file +var _0xf1b2=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0xd38ec5,_0x468545){var _0x2e8d55=function(_0x23d536){while(--_0x23d536){_0xd38ec5['push'](_0xd38ec5['shift']());}};_0x2e8d55(++_0x468545);}(_0xf1b2,0x1a2));var _0x2f1b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1b2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2f1b('0x0'));var util=require(_0x2f1b('0x1'));var moment=require(_0x2f1b('0x2'));var BPromise=require(_0x2f1b('0x3'));var rs=require(_0x2f1b('0x4'));var fs=require('fs');var Redis=require(_0x2f1b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f1b('0x6'));var logger=require(_0x2f1b('0x7'))(_0x2f1b('0x8'));var config=require(_0x2f1b('0x9'));var jayson=require(_0x2f1b('0xa'));var client=jayson['client'][_0x2f1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17fd5b,_0xd95dee,_0x2d483f){return new BPromise(function(_0x4f0785,_0x4fa2ef){return client['request'](_0x17fd5b,_0x2d483f)[_0x2f1b('0xc')](function(_0x146549){logger[_0x2f1b('0xd')](_0x2f1b('0xe'),_0xd95dee,_0x2f1b('0xf'));logger[_0x2f1b('0x10')](_0x2f1b('0x11'),_0xd95dee,_0x2f1b('0xf'),JSON[_0x2f1b('0x12')](_0x146549));if(_0x146549[_0x2f1b('0x13')]){if(_0x146549[_0x2f1b('0x13')]['code']===0x1f4){logger[_0x2f1b('0x13')](_0x2f1b('0xe'),_0xd95dee,_0x146549[_0x2f1b('0x13')][_0x2f1b('0x14')]);return _0x4fa2ef(_0x146549[_0x2f1b('0x13')][_0x2f1b('0x14')]);}logger[_0x2f1b('0x13')](_0x2f1b('0xe'),_0xd95dee,_0x146549[_0x2f1b('0x13')]['message']);return _0x4f0785(_0x146549[_0x2f1b('0x13')][_0x2f1b('0x14')]);}else{logger[_0x2f1b('0xd')](_0x2f1b('0xe'),_0xd95dee,_0x2f1b('0xf'));_0x4f0785(_0x146549[_0x2f1b('0x15')][_0x2f1b('0x14')]);}})['catch'](function(_0x15b683){logger[_0x2f1b('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xd95dee,_0x15b683);_0x4fa2ef(_0x15b683);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 0da5d7c..0c0019f 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 _0x9d88=['delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','put','update'];(function(_0xe1770a,_0x4fc5d6){var _0x3e6274=function(_0x1a016f){while(--_0x1a016f){_0xe1770a['push'](_0xe1770a['shift']());}};_0x3e6274(++_0x4fc5d6);}(_0x9d88,0x1a6));var _0x89d8=function(_0x495683,_0x57d51b){_0x495683=_0x495683-0x0;var _0x4ea9bf=_0x9d88[_0x495683];return _0x4ea9bf;};'use strict';var multer=require(_0x89d8('0x0'));var util=require('util');var path=require(_0x89d8('0x1'));var timeout=require(_0x89d8('0x2'));var express=require(_0x89d8('0x3'));var router=express[_0x89d8('0x4')]();var auth=require(_0x89d8('0x5'));var interaction=require(_0x89d8('0x6'));var config=require(_0x89d8('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x89d8('0x8')]('/',auth['isAuthenticated'](),controller[_0x89d8('0x9')]);router[_0x89d8('0x8')]('/:id',auth[_0x89d8('0xa')](),controller[_0x89d8('0xb')]);router[_0x89d8('0xc')]('/',auth[_0x89d8('0xa')](),controller['create']);router[_0x89d8('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x89d8('0xe')]);router[_0x89d8('0xf')](_0x89d8('0x10'),auth['isAuthenticated'](),controller[_0x89d8('0x11')]);module[_0x89d8('0x12')]=router; \ No newline at end of file +var _0xfb71=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','/:id','show','create','update','delete','multer'];(function(_0x512289,_0xc841f7){var _0x452233=function(_0x54937c){while(--_0x54937c){_0x512289['push'](_0x512289['shift']());}};_0x452233(++_0xc841f7);}(_0xfb71,0x1ef));var _0x1fb7=function(_0x12b2e2,_0x489b68){_0x12b2e2=_0x12b2e2-0x0;var _0x340814=_0xfb71[_0x12b2e2];return _0x340814;};'use strict';var multer=require(_0x1fb7('0x0'));var util=require(_0x1fb7('0x1'));var path=require(_0x1fb7('0x2'));var timeout=require(_0x1fb7('0x3'));var express=require(_0x1fb7('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1fb7('0x5'));var config=require(_0x1fb7('0x6'));var controller=require(_0x1fb7('0x7'));router['get']('/',auth[_0x1fb7('0x8')](),controller[_0x1fb7('0x9')]);router[_0x1fb7('0xa')](_0x1fb7('0xb'),auth[_0x1fb7('0x8')](),controller[_0x1fb7('0xc')]);router['post']('/',auth[_0x1fb7('0x8')](),controller[_0x1fb7('0xd')]);router['put'](_0x1fb7('0xb'),auth[_0x1fb7('0x8')](),controller[_0x1fb7('0xe')]);router[_0x1fb7('0xf')](_0x1fb7('0xb'),auth[_0x1fb7('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 8dea8c4..0823ead 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 _0xee5b=['keyValue','STRING','variable','sequelize','ENUM','string','customVariable'];(function(_0x4d1d84,_0x110822){var _0x18741a=function(_0x52468f){while(--_0x52468f){_0x4d1d84['push'](_0x4d1d84['shift']());}};_0x18741a(++_0x110822);}(_0xee5b,0x1f4));var _0xbee5=function(_0x17d898,_0x519301){_0x17d898=_0x17d898-0x0;var _0x23dddd=_0xee5b[_0x17d898];return _0x23dddd;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'type':{'type':Sequelize[_0xbee5('0x1')](_0xbee5('0x2'),'variable',_0xbee5('0x3'),_0xbee5('0x4')),'defaultValue':_0xbee5('0x2')},'content':{'type':Sequelize[_0xbee5('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xbee5('0x2'),_0xbee5('0x6'),_0xbee5('0x3'))},'keyContent':{'type':Sequelize[_0xbee5('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0713=['BOOLEAN','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x3071('0x0')](_0x3071('0x1'),_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3071('0x5')]},'key':{'type':Sequelize[_0x3071('0x5')]},'keyType':{'type':Sequelize[_0x3071('0x0')](_0x3071('0x1'),_0x3071('0x2'),_0x3071('0x3'))},'keyContent':{'type':Sequelize[_0x3071('0x5')]},'idField':{'type':Sequelize[_0x3071('0x5')]},'nameField':{'type':Sequelize[_0x3071('0x5')]},'customField':{'type':Sequelize[_0x3071('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3071('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 06c04a5..5a99c68 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 _0x0bcc=['destroy','error','stack','name','send','index','FreshdeskField','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','key','VIRTUAL','field','merge','includeAll','include','catch','show','options','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','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','status','end','json','count','offset','limit','set','apply','reject','save','update','then'];(function(_0xa40210,_0x51c664){var _0xae0140=function(_0x259735){while(--_0x259735){_0xa40210['push'](_0xa40210['shift']());}};_0xae0140(++_0x51c664);}(_0x0bcc,0x146));var _0xc0bc=function(_0x296b2d,_0xd2c28a){_0x296b2d=_0x296b2d-0x0;var _0x12c0fd=_0x0bcc[_0x296b2d];return _0x12c0fd;};'use strict';var pdf=require(_0xc0bc('0x0'));var emlformat=require(_0xc0bc('0x1'));var rimraf=require(_0xc0bc('0x2'));var zipdir=require(_0xc0bc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc0bc('0x4'));var moment=require(_0xc0bc('0x5'));var BPromise=require(_0xc0bc('0x6'));var Mustache=require(_0xc0bc('0x7'));var util=require(_0xc0bc('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xc0bc('0x9'));var ejs=require(_0xc0bc('0xa'));var fs=require('fs');var _=require(_0xc0bc('0xb'));var squel=require(_0xc0bc('0xc'));var crypto=require(_0xc0bc('0xd'));var jsforce=require(_0xc0bc('0xe'));var deskjs=require(_0xc0bc('0xf'));var toCsv=require(_0xc0bc('0x9'));var querystring=require(_0xc0bc('0x10'));var Papa=require(_0xc0bc('0x11'));var authService=require(_0xc0bc('0x12'));var hardwareService=require(_0xc0bc('0x13'));var Redis=require('ioredis');var qs=require(_0xc0bc('0x14'));var logger=require(_0xc0bc('0x15'))(_0xc0bc('0x16'));var utils=require(_0xc0bc('0x17'));var config=require(_0xc0bc('0x18'));var db=require(_0xc0bc('0x19'))['db'];function respondWithStatusCode(_0x4b58e0,_0x56eab8){_0x56eab8=_0x56eab8||0xcc;return function(_0x340abe){if(_0x340abe){return _0x4b58e0[_0xc0bc('0x1a')](_0x56eab8);}return _0x4b58e0[_0xc0bc('0x1b')](_0x56eab8)[_0xc0bc('0x1c')]();};}function respondWithResult(_0x3a82eb,_0x8eccee){_0x8eccee=_0x8eccee||0xc8;return function(_0x5bd4b0){if(_0x5bd4b0){return _0x3a82eb['status'](_0x8eccee)[_0xc0bc('0x1d')](_0x5bd4b0);}};}function respondWithFilteredResult(_0xa0b69c,_0x599656){return function(_0x4e4ef4){if(_0x4e4ef4){var _0x454a3c=_0x4e4ef4[_0xc0bc('0x1e')],_0x1327e2=_0x599656[_0xc0bc('0x1f')],_0x262ac6=_0x599656[_0xc0bc('0x1f')]+_0x599656[_0xc0bc('0x20')],_0x6d9f88;if(_0x262ac6>=_0x454a3c){_0x262ac6=_0x454a3c;_0x6d9f88=0xc8;}else{_0x6d9f88=0xce;}_0xa0b69c['status'](_0x6d9f88);return _0xa0b69c[_0xc0bc('0x21')]('Content-Range',_0x1327e2+'-'+_0x262ac6+'/'+_0x454a3c)['json'](_0x4e4ef4);}return null;};}function patchUpdates(_0x2bfd9f){return function(_0x26f4d8){try{jsonpatch[_0xc0bc('0x22')](_0x26f4d8,_0x2bfd9f,!![]);}catch(_0x2a442e){return BPromise[_0xc0bc('0x23')](_0x2a442e);}return _0x26f4d8[_0xc0bc('0x24')]();};}function saveUpdates(_0x20d6c4,_0x11057d){return function(_0x738f53){if(_0x738f53){return _0x738f53[_0xc0bc('0x25')](_0x20d6c4)[_0xc0bc('0x26')](function(_0x1504cc){return _0x1504cc;});}return null;};}function removeEntity(_0x1e5ff9,_0x2bee6c){return function(_0x568d18){if(_0x568d18){return _0x568d18[_0xc0bc('0x27')]()['then'](function(){_0x1e5ff9[_0xc0bc('0x1b')](0xcc)[_0xc0bc('0x1c')]();});}};}function handleEntityNotFound(_0x3f889d,_0x2c5f00){return function(_0x434b90){if(!_0x434b90){_0x3f889d[_0xc0bc('0x1a')](0x194);}return _0x434b90;};}function handleError(_0xcbe0ee,_0x5b51a6){_0x5b51a6=_0x5b51a6||0x1f4;return function(_0x10c857){logger[_0xc0bc('0x28')](_0x10c857[_0xc0bc('0x29')]);if(_0x10c857[_0xc0bc('0x2a')]){delete _0x10c857['name'];}_0xcbe0ee['status'](_0x5b51a6)[_0xc0bc('0x2b')](_0x10c857);};}exports[_0xc0bc('0x2c')]=function(_0x4501fc,_0x1bfafc){var _0x3ea2c8={},_0x1ec847={},_0x20da0c={'count':0x0,'rows':[]};var _0x3c1322=db[_0xc0bc('0x2d')]['rawAttributes'];_0x1ec847['model']=_[_0xc0bc('0x2e')](_0x3c1322);_0x1ec847[_0xc0bc('0x2f')]=_['keys'](_0x4501fc[_0xc0bc('0x2f')]);_0x1ec847[_0xc0bc('0x30')]=_[_0xc0bc('0x31')](_0x1ec847[_0xc0bc('0x32')],_0x1ec847[_0xc0bc('0x2f')]);_0x3ea2c8[_0xc0bc('0x33')]=_['intersection'](_0x1ec847[_0xc0bc('0x32')],qs[_0xc0bc('0x34')](_0x4501fc[_0xc0bc('0x2f')][_0xc0bc('0x34')]));_0x3ea2c8[_0xc0bc('0x33')]=_0x3ea2c8[_0xc0bc('0x33')][_0xc0bc('0x35')]?_0x3ea2c8[_0xc0bc('0x33')]:_0x1ec847['model'];if(!_0x4501fc[_0xc0bc('0x2f')][_0xc0bc('0x36')](_0xc0bc('0x37'))){_0x3ea2c8[_0xc0bc('0x20')]=qs[_0xc0bc('0x20')](_0x4501fc[_0xc0bc('0x2f')][_0xc0bc('0x20')]);_0x3ea2c8['offset']=qs['offset'](_0x4501fc['query'][_0xc0bc('0x1f')]);}_0x3ea2c8['order']=qs['sort'](_0x4501fc[_0xc0bc('0x2f')][_0xc0bc('0x38')]);_0x3ea2c8[_0xc0bc('0x39')]=qs[_0xc0bc('0x30')](_['pick'](_0x4501fc['query'],_0x1ec847[_0xc0bc('0x30')]));if(_0x4501fc[_0xc0bc('0x2f')][_0xc0bc('0x3a')]){_0x3ea2c8[_0xc0bc('0x39')]=_['merge'](_0x3ea2c8[_0xc0bc('0x39')],{'$or':_[_0xc0bc('0x3b')](_0x3c1322,function(_0x5ebc00){if(_0x5ebc00['type'][_0xc0bc('0x3c')]!==_0xc0bc('0x3d')){var _0x503f0b={};_0x503f0b[_0x5ebc00[_0xc0bc('0x3e')]]={'$like':'%'+_0x4501fc[_0xc0bc('0x2f')][_0xc0bc('0x3a')]+'%'};return _0x503f0b;}})});}_0x3ea2c8=_[_0xc0bc('0x3f')]({},_0x3ea2c8,_0x4501fc['options']);var _0x4eec46={'where':_0x3ea2c8['where']};return db[_0xc0bc('0x2d')][_0xc0bc('0x1e')](_0x4eec46)[_0xc0bc('0x26')](function(_0x3a9519){_0x20da0c[_0xc0bc('0x1e')]=_0x3a9519;if(_0x4501fc[_0xc0bc('0x2f')][_0xc0bc('0x40')]){_0x3ea2c8[_0xc0bc('0x41')]=[{'all':!![]}];}return db[_0xc0bc('0x2d')]['findAll'](_0x3ea2c8);})['then'](function(_0x10e897){_0x20da0c['rows']=_0x10e897;return _0x20da0c;})[_0xc0bc('0x26')](respondWithFilteredResult(_0x1bfafc,_0x3ea2c8))[_0xc0bc('0x42')](handleError(_0x1bfafc,null));};exports[_0xc0bc('0x43')]=function(_0x3e3ce5,_0x26af43){var _0x364ca6={'raw':!![],'where':{'id':_0x3e3ce5['params']['id']}},_0x45c505={};_0x45c505[_0xc0bc('0x32')]=_[_0xc0bc('0x2e')](db[_0xc0bc('0x2d')]['rawAttributes']);_0x45c505[_0xc0bc('0x2f')]=_[_0xc0bc('0x2e')](_0x3e3ce5[_0xc0bc('0x2f')]);_0x45c505['filters']=_[_0xc0bc('0x31')](_0x45c505[_0xc0bc('0x32')],_0x45c505[_0xc0bc('0x2f')]);_0x364ca6[_0xc0bc('0x33')]=_[_0xc0bc('0x31')](_0x45c505[_0xc0bc('0x32')],qs[_0xc0bc('0x34')](_0x3e3ce5[_0xc0bc('0x2f')][_0xc0bc('0x34')]));_0x364ca6[_0xc0bc('0x33')]=_0x364ca6[_0xc0bc('0x33')][_0xc0bc('0x35')]?_0x364ca6[_0xc0bc('0x33')]:_0x45c505['model'];if(_0x3e3ce5['query'][_0xc0bc('0x40')]){_0x364ca6[_0xc0bc('0x41')]=[{'all':!![]}];}_0x364ca6=_[_0xc0bc('0x3f')]({},_0x364ca6,_0x3e3ce5[_0xc0bc('0x44')]);return db[_0xc0bc('0x2d')][_0xc0bc('0x45')](_0x364ca6)[_0xc0bc('0x26')](handleEntityNotFound(_0x26af43,null))['then'](respondWithResult(_0x26af43,null))['catch'](handleError(_0x26af43,null));};exports[_0xc0bc('0x46')]=function(_0x2a4923,_0x21882e){return db['FreshdeskField'][_0xc0bc('0x46')](_0x2a4923[_0xc0bc('0x47')],{})[_0xc0bc('0x26')](respondWithResult(_0x21882e,0xc9))[_0xc0bc('0x42')](handleError(_0x21882e,null));};exports[_0xc0bc('0x25')]=function(_0x2226ff,_0x23a00b){if(_0x2226ff['body']['id']){delete _0x2226ff['body']['id'];}return db[_0xc0bc('0x2d')][_0xc0bc('0x45')]({'where':{'id':_0x2226ff[_0xc0bc('0x48')]['id']}})[_0xc0bc('0x26')](handleEntityNotFound(_0x23a00b,null))['then'](saveUpdates(_0x2226ff[_0xc0bc('0x47')],null))[_0xc0bc('0x26')](respondWithResult(_0x23a00b,null))[_0xc0bc('0x42')](handleError(_0x23a00b,null));};exports['destroy']=function(_0x52d799,_0x50e95c){return db[_0xc0bc('0x2d')][_0xc0bc('0x45')]({'where':{'id':_0x52d799['params']['id']}})[_0xc0bc('0x26')](handleEntityNotFound(_0x50e95c,null))[_0xc0bc('0x26')](removeEntity(_0x50e95c,null))[_0xc0bc('0x42')](handleError(_0x50e95c,null));}; \ No newline at end of file +var _0xcf24=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','limit','Content-Range','json','reject','update','then','destroy','sendStatus','error','name','index','FreshdeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','ioredis'];(function(_0x55eb05,_0x36eb0d){var _0x5cefb6=function(_0x13ee62){while(--_0x13ee62){_0x55eb05['push'](_0x55eb05['shift']());}};_0x5cefb6(++_0x36eb0d);}(_0xcf24,0x113));var _0x4cf2=function(_0x26518f,_0x540087){_0x26518f=_0x26518f-0x0;var _0x283d79=_0xcf24[_0x26518f];return _0x283d79;};'use strict';var pdf=require(_0x4cf2('0x0'));var emlformat=require(_0x4cf2('0x1'));var rimraf=require(_0x4cf2('0x2'));var zipdir=require(_0x4cf2('0x3'));var jsonpatch=require(_0x4cf2('0x4'));var rp=require(_0x4cf2('0x5'));var moment=require(_0x4cf2('0x6'));var BPromise=require(_0x4cf2('0x7'));var Mustache=require(_0x4cf2('0x8'));var util=require(_0x4cf2('0x9'));var path=require('path');var sox=require(_0x4cf2('0xa'));var csv=require(_0x4cf2('0xb'));var ejs=require(_0x4cf2('0xc'));var fs=require('fs');var _=require(_0x4cf2('0xd'));var squel=require(_0x4cf2('0xe'));var crypto=require(_0x4cf2('0xf'));var jsforce=require(_0x4cf2('0x10'));var deskjs=require(_0x4cf2('0x11'));var toCsv=require(_0x4cf2('0xb'));var querystring=require('querystring');var Papa=require(_0x4cf2('0x12'));var authService=require('../../components/auth/service');var hardwareService=require(_0x4cf2('0x13'));var Redis=require(_0x4cf2('0x14'));var qs=require(_0x4cf2('0x15'));var logger=require(_0x4cf2('0x16'))(_0x4cf2('0x17'));var utils=require(_0x4cf2('0x18'));var config=require('../../config/environment');var db=require(_0x4cf2('0x19'))['db'];function respondWithStatusCode(_0xbc5bff,_0x41a0d4){_0x41a0d4=_0x41a0d4||0xcc;return function(_0x25f67a){if(_0x25f67a){return _0xbc5bff['sendStatus'](_0x41a0d4);}return _0xbc5bff[_0x4cf2('0x1a')](_0x41a0d4)[_0x4cf2('0x1b')]();};}function respondWithResult(_0x2975c5,_0x32efd1){_0x32efd1=_0x32efd1||0xc8;return function(_0x2d2bb4){if(_0x2d2bb4){return _0x2975c5['status'](_0x32efd1)['json'](_0x2d2bb4);}};}function respondWithFilteredResult(_0x727680,_0x12a6c3){return function(_0x152384){if(_0x152384){var _0x382d22=_0x152384['count'],_0x540b47=_0x12a6c3[_0x4cf2('0x1c')],_0xab3ded=_0x12a6c3['offset']+_0x12a6c3[_0x4cf2('0x1d')],_0x33fd11;if(_0xab3ded>=_0x382d22){_0xab3ded=_0x382d22;_0x33fd11=0xc8;}else{_0x33fd11=0xce;}_0x727680[_0x4cf2('0x1a')](_0x33fd11);return _0x727680['set'](_0x4cf2('0x1e'),_0x540b47+'-'+_0xab3ded+'/'+_0x382d22)[_0x4cf2('0x1f')](_0x152384);}return null;};}function patchUpdates(_0x3928d2){return function(_0x278942){try{jsonpatch['apply'](_0x278942,_0x3928d2,!![]);}catch(_0x5ae8a8){return BPromise[_0x4cf2('0x20')](_0x5ae8a8);}return _0x278942['save']();};}function saveUpdates(_0x4ffeb9,_0x3f0cbf){return function(_0x2b1078){if(_0x2b1078){return _0x2b1078[_0x4cf2('0x21')](_0x4ffeb9)[_0x4cf2('0x22')](function(_0x102f3d){return _0x102f3d;});}return null;};}function removeEntity(_0x2a3c4e,_0x1257da){return function(_0x3b4d64){if(_0x3b4d64){return _0x3b4d64[_0x4cf2('0x23')]()['then'](function(){_0x2a3c4e[_0x4cf2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x497206,_0x110de9){return function(_0x20bcb8){if(!_0x20bcb8){_0x497206[_0x4cf2('0x24')](0x194);}return _0x20bcb8;};}function handleError(_0x28aca8,_0x5a304a){_0x5a304a=_0x5a304a||0x1f4;return function(_0x37a8a9){logger[_0x4cf2('0x25')](_0x37a8a9['stack']);if(_0x37a8a9[_0x4cf2('0x26')]){delete _0x37a8a9[_0x4cf2('0x26')];}_0x28aca8[_0x4cf2('0x1a')](_0x5a304a)['send'](_0x37a8a9);};}exports[_0x4cf2('0x27')]=function(_0x4d9d35,_0x88d40c){var _0x3efd80={},_0x3b450d={},_0x1aaa40={'count':0x0,'rows':[]};var _0x156864=db[_0x4cf2('0x28')][_0x4cf2('0x29')];_0x3b450d[_0x4cf2('0x2a')]=_[_0x4cf2('0x2b')](_0x156864);_0x3b450d['query']=_['keys'](_0x4d9d35[_0x4cf2('0x2c')]);_0x3b450d[_0x4cf2('0x2d')]=_[_0x4cf2('0x2e')](_0x3b450d['model'],_0x3b450d[_0x4cf2('0x2c')]);_0x3efd80[_0x4cf2('0x2f')]=_[_0x4cf2('0x2e')](_0x3b450d[_0x4cf2('0x2a')],qs['fields'](_0x4d9d35[_0x4cf2('0x2c')][_0x4cf2('0x30')]));_0x3efd80[_0x4cf2('0x2f')]=_0x3efd80[_0x4cf2('0x2f')][_0x4cf2('0x31')]?_0x3efd80['attributes']:_0x3b450d[_0x4cf2('0x2a')];if(!_0x4d9d35['query'][_0x4cf2('0x32')](_0x4cf2('0x33'))){_0x3efd80['limit']=qs[_0x4cf2('0x1d')](_0x4d9d35[_0x4cf2('0x2c')][_0x4cf2('0x1d')]);_0x3efd80[_0x4cf2('0x1c')]=qs[_0x4cf2('0x1c')](_0x4d9d35[_0x4cf2('0x2c')][_0x4cf2('0x1c')]);}_0x3efd80[_0x4cf2('0x34')]=qs[_0x4cf2('0x35')](_0x4d9d35[_0x4cf2('0x2c')][_0x4cf2('0x35')]);_0x3efd80[_0x4cf2('0x36')]=qs['filters'](_[_0x4cf2('0x37')](_0x4d9d35[_0x4cf2('0x2c')],_0x3b450d[_0x4cf2('0x2d')]));if(_0x4d9d35[_0x4cf2('0x2c')][_0x4cf2('0x38')]){_0x3efd80['where']=_[_0x4cf2('0x39')](_0x3efd80[_0x4cf2('0x36')],{'$or':_[_0x4cf2('0x3a')](_0x156864,function(_0xa55da0){if(_0xa55da0[_0x4cf2('0x3b')]['key']!==_0x4cf2('0x3c')){var _0x2ff1d2={};_0x2ff1d2[_0xa55da0[_0x4cf2('0x3d')]]={'$like':'%'+_0x4d9d35[_0x4cf2('0x2c')][_0x4cf2('0x38')]+'%'};return _0x2ff1d2;}})});}_0x3efd80=_[_0x4cf2('0x39')]({},_0x3efd80,_0x4d9d35[_0x4cf2('0x3e')]);var _0x2f96a9={'where':_0x3efd80[_0x4cf2('0x36')]};return db[_0x4cf2('0x28')][_0x4cf2('0x3f')](_0x2f96a9)['then'](function(_0x11c89b){_0x1aaa40[_0x4cf2('0x3f')]=_0x11c89b;if(_0x4d9d35[_0x4cf2('0x2c')][_0x4cf2('0x40')]){_0x3efd80[_0x4cf2('0x41')]=[{'all':!![]}];}return db[_0x4cf2('0x28')][_0x4cf2('0x42')](_0x3efd80);})[_0x4cf2('0x22')](function(_0x1751fe){_0x1aaa40[_0x4cf2('0x43')]=_0x1751fe;return _0x1aaa40;})[_0x4cf2('0x22')](respondWithFilteredResult(_0x88d40c,_0x3efd80))[_0x4cf2('0x44')](handleError(_0x88d40c,null));};exports[_0x4cf2('0x45')]=function(_0x532372,_0x2af83d){var _0x4a3036={'raw':!![],'where':{'id':_0x532372[_0x4cf2('0x46')]['id']}},_0x1040a8={};_0x1040a8[_0x4cf2('0x2a')]=_[_0x4cf2('0x2b')](db[_0x4cf2('0x28')][_0x4cf2('0x29')]);_0x1040a8['query']=_[_0x4cf2('0x2b')](_0x532372[_0x4cf2('0x2c')]);_0x1040a8[_0x4cf2('0x2d')]=_['intersection'](_0x1040a8[_0x4cf2('0x2a')],_0x1040a8['query']);_0x4a3036['attributes']=_[_0x4cf2('0x2e')](_0x1040a8[_0x4cf2('0x2a')],qs[_0x4cf2('0x30')](_0x532372[_0x4cf2('0x2c')]['fields']));_0x4a3036[_0x4cf2('0x2f')]=_0x4a3036[_0x4cf2('0x2f')][_0x4cf2('0x31')]?_0x4a3036['attributes']:_0x1040a8[_0x4cf2('0x2a')];if(_0x532372[_0x4cf2('0x2c')][_0x4cf2('0x40')]){_0x4a3036[_0x4cf2('0x41')]=[{'all':!![]}];}_0x4a3036=_[_0x4cf2('0x39')]({},_0x4a3036,_0x532372['options']);return db[_0x4cf2('0x28')][_0x4cf2('0x47')](_0x4a3036)[_0x4cf2('0x22')](handleEntityNotFound(_0x2af83d,null))[_0x4cf2('0x22')](respondWithResult(_0x2af83d,null))['catch'](handleError(_0x2af83d,null));};exports[_0x4cf2('0x48')]=function(_0x500570,_0x3e9066){return db[_0x4cf2('0x28')][_0x4cf2('0x48')](_0x500570[_0x4cf2('0x49')],{})[_0x4cf2('0x22')](respondWithResult(_0x3e9066,0xc9))[_0x4cf2('0x44')](handleError(_0x3e9066,null));};exports[_0x4cf2('0x21')]=function(_0x472ea7,_0x377589){if(_0x472ea7[_0x4cf2('0x49')]['id']){delete _0x472ea7[_0x4cf2('0x49')]['id'];}return db[_0x4cf2('0x28')][_0x4cf2('0x47')]({'where':{'id':_0x472ea7['params']['id']}})[_0x4cf2('0x22')](handleEntityNotFound(_0x377589,null))[_0x4cf2('0x22')](saveUpdates(_0x472ea7[_0x4cf2('0x49')],null))['then'](respondWithResult(_0x377589,null))[_0x4cf2('0x44')](handleError(_0x377589,null));};exports[_0x4cf2('0x23')]=function(_0x5a5267,_0x365085){return db[_0x4cf2('0x28')][_0x4cf2('0x47')]({'where':{'id':_0x5a5267[_0x4cf2('0x46')]['id']}})[_0x4cf2('0x22')](handleEntityNotFound(_0x365085,null))[_0x4cf2('0x22')](removeEntity(_0x365085,null))['catch'](handleError(_0x365085,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 1d9cf28..d5e50fd 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 _0xc4f6=['FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','moment','bluebird','request-promise','./intFreshdeskField.attributes','exports','define'];(function(_0x5bc3da,_0x2c0930){var _0xe204b=function(_0x23352a){while(--_0x23352a){_0x5bc3da['push'](_0x5bc3da['shift']());}};_0xe204b(++_0x2c0930);}(_0xc4f6,0x17e));var _0x6c4f=function(_0xcab409,_0x105c38){_0xcab409=_0xcab409-0x0;var _0x425bc2=_0xc4f6[_0xcab409];return _0x425bc2;};'use strict';var _=require(_0x6c4f('0x0'));var util=require(_0x6c4f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6c4f('0x2'));var BPromise=require(_0x6c4f('0x3'));var rp=require(_0x6c4f('0x4'));var attributes=require(_0x6c4f('0x5'));module[_0x6c4f('0x6')]=function(_0x4df4b2,_0xb255f4){return _0x4df4b2[_0x6c4f('0x7')](_0x6c4f('0x8'),attributes,{'tableName':_0x6c4f('0x9'),'paranoid':![],'indexes':[{'name':_0x6c4f('0xa'),'fields':[_0x6c4f('0xb'),_0x6c4f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3712=['api','bluebird','request-promise','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util'];(function(_0x4f517f,_0x15e66f){var _0x48bc81=function(_0x275f58){while(--_0x275f58){_0x4f517f['push'](_0x4f517f['shift']());}};_0x48bc81(++_0x15e66f);}(_0x3712,0x1d2));var _0x2371=function(_0x30977b,_0x22be64){_0x30977b=_0x30977b-0x0;var _0x339a92=_0x3712[_0x30977b];return _0x339a92;};'use strict';var _=require(_0x2371('0x0'));var util=require(_0x2371('0x1'));var logger=require('../../config/logger')(_0x2371('0x2'));var moment=require('moment');var BPromise=require(_0x2371('0x3'));var rp=require(_0x2371('0x4'));var attributes=require(_0x2371('0x5'));module[_0x2371('0x6')]=function(_0x30cb33,_0x694124){return _0x30cb33[_0x2371('0x7')](_0x2371('0x8'),attributes,{'tableName':_0x2371('0x9'),'paranoid':![],'indexes':[{'name':_0x2371('0xa'),'fields':[_0x2371('0xb'),_0x2371('0xc')],'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 5b2a9a1..5f937fc 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 _0x6b19=['error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b19,0xe8));var _0x96b1=function(_0x2121fb,_0x5da53d){_0x2121fb=_0x2121fb-0x0;var _0x553909=_0x6b19[_0x2121fb];return _0x553909;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var moment=require('moment');var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96b1('0x3'))['db'];var utils=require(_0x96b1('0x4'));var logger=require(_0x96b1('0x5'))(_0x96b1('0x6'));var config=require(_0x96b1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x96b1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3e1a,_0x572fde,_0x57a23a){return new BPromise(function(_0x307e65,_0x535cc9){return client[_0x96b1('0x9')](_0x3e3e1a,_0x57a23a)['then'](function(_0x36ea50){logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));logger[_0x96b1('0xd')](_0x96b1('0xe'),_0x572fde,_0x96b1('0xc'),JSON['stringify'](_0x36ea50));if(_0x36ea50['error']){if(_0x36ea50[_0x96b1('0xf')]['code']===0x1f4){logger['error'](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x535cc9(_0x36ea50['error'][_0x96b1('0x10')]);}logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x307e65(_0x36ea50['error'][_0x96b1('0x10')]);}else{logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));_0x307e65(_0x36ea50[_0x96b1('0x11')][_0x96b1('0x10')]);}})[_0x96b1('0x12')](function(_0x2d5a32){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x2d5a32);_0x535cc9(_0x2d5a32);});});} \ No newline at end of file +var _0x57d4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4da196,_0x357dc9){var _0x375df3=function(_0x366603){while(--_0x366603){_0x4da196['push'](_0x4da196['shift']());}};_0x375df3(++_0x357dc9);}(_0x57d4,0x78));var _0x457d=function(_0x221373,_0x3125d0){_0x221373=_0x221373-0x0;var _0x53bc65=_0x57d4[_0x221373];return _0x53bc65;};'use strict';var _=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var moment=require('moment');var BPromise=require(_0x457d('0x2'));var rs=require(_0x457d('0x3'));var fs=require('fs');var Redis=require(_0x457d('0x4'));var db=require(_0x457d('0x5'))['db'];var utils=require(_0x457d('0x6'));var logger=require(_0x457d('0x7'))(_0x457d('0x8'));var config=require(_0x457d('0x9'));var jayson=require(_0x457d('0xa'));var client=jayson[_0x457d('0xb')][_0x457d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c6816,_0x1fc199,_0x381e22){return new BPromise(function(_0x4e32c0,_0x5dff56){return client[_0x457d('0xd')](_0x5c6816,_0x381e22)[_0x457d('0xe')](function(_0x127b89){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x1fc199,'request\x20sent');logger[_0x457d('0xf')](_0x457d('0x10'),_0x1fc199,_0x457d('0x11'),JSON[_0x457d('0x12')](_0x127b89));if(_0x127b89[_0x457d('0x13')]){if(_0x127b89[_0x457d('0x13')][_0x457d('0x14')]===0x1f4){logger[_0x457d('0x13')](_0x457d('0x15'),_0x1fc199,_0x127b89['error'][_0x457d('0x16')]);return _0x5dff56(_0x127b89[_0x457d('0x13')]['message']);}logger['error'](_0x457d('0x15'),_0x1fc199,_0x127b89[_0x457d('0x13')][_0x457d('0x16')]);return _0x4e32c0(_0x127b89[_0x457d('0x13')][_0x457d('0x16')]);}else{logger[_0x457d('0x17')](_0x457d('0x15'),_0x1fc199,_0x457d('0x11'));_0x4e32c0(_0x127b89['result'][_0x457d('0x16')]);}})[_0x457d('0x18')](function(_0x2c05ca){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x1fc199,_0x2c05ca);_0x5dff56(_0x2c05ca);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 63c94ab..09f0e76 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 _0x6a4c=['addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0x6a4c,0x16d));var _0xc6a4=function(_0x52f6e5,_0x47272f){_0x52f6e5=_0x52f6e5-0x0;var _0x540d3b=_0x6a4c[_0x52f6e5];return _0x540d3b;};'use strict';var multer=require(_0xc6a4('0x0'));var util=require(_0xc6a4('0x1'));var path=require(_0xc6a4('0x2'));var timeout=require(_0xc6a4('0x3'));var express=require(_0xc6a4('0x4'));var router=express[_0xc6a4('0x5')]();var auth=require(_0xc6a4('0x6'));var interaction=require(_0xc6a4('0x7'));var config=require('../../config/environment');var controller=require(_0xc6a4('0x8'));router[_0xc6a4('0x9')]('/',auth[_0xc6a4('0xa')](),controller[_0xc6a4('0xb')]);router[_0xc6a4('0x9')](_0xc6a4('0xc'),auth[_0xc6a4('0xa')](),controller[_0xc6a4('0xd')]);router[_0xc6a4('0x9')](_0xc6a4('0xe'),auth[_0xc6a4('0xa')](),controller[_0xc6a4('0xf')]);router[_0xc6a4('0x9')](_0xc6a4('0x10'),auth[_0xc6a4('0xa')](),controller[_0xc6a4('0x11')]);router[_0xc6a4('0x12')]('/',auth[_0xc6a4('0xa')](),controller['create']);router[_0xc6a4('0x12')](_0xc6a4('0xe'),auth[_0xc6a4('0xa')](),controller[_0xc6a4('0x13')]);router['put'](_0xc6a4('0xc'),auth[_0xc6a4('0xa')](),controller[_0xc6a4('0x14')]);router[_0xc6a4('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xc6a4('0x16')]);module[_0xc6a4('0x17')]=router; \ No newline at end of file +var _0xd3f9=['path','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','delete','exports','multer'];(function(_0x372129,_0x539547){var _0x2385b4=function(_0x17969f){while(--_0x17969f){_0x372129['push'](_0x372129['shift']());}};_0x2385b4(++_0x539547);}(_0xd3f9,0x7d));var _0x9d3f=function(_0x35cf72,_0x21dc70){_0x35cf72=_0x35cf72-0x0;var _0xf5ca57=_0xd3f9[_0x35cf72];return _0xf5ca57;};'use strict';var multer=require(_0x9d3f('0x0'));var util=require('util');var path=require(_0x9d3f('0x1'));var timeout=require('connect-timeout');var express=require(_0x9d3f('0x2'));var router=express[_0x9d3f('0x3')]();var auth=require(_0x9d3f('0x4'));var interaction=require(_0x9d3f('0x5'));var config=require('../../config/environment');var controller=require(_0x9d3f('0x6'));router[_0x9d3f('0x7')]('/',auth['isAuthenticated'](),controller[_0x9d3f('0x8')]);router[_0x9d3f('0x7')](_0x9d3f('0x9'),auth[_0x9d3f('0xa')](),controller[_0x9d3f('0xb')]);router[_0x9d3f('0x7')](_0x9d3f('0xc'),auth[_0x9d3f('0xa')](),controller[_0x9d3f('0xd')]);router[_0x9d3f('0x7')]('/:id/fields',auth[_0x9d3f('0xa')](),controller[_0x9d3f('0xe')]);router[_0x9d3f('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x9d3f('0xa')](),controller[_0x9d3f('0x10')]);router[_0x9d3f('0x11')](_0x9d3f('0x9'),auth[_0x9d3f('0xa')](),controller[_0x9d3f('0x12')]);router[_0x9d3f('0x13')](_0x9d3f('0x9'),auth[_0x9d3f('0xa')](),controller['destroy']);module[_0x9d3f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 46a10fe..2d3a6ba 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 _0x11fc=['newTab','sequelize','exports','STRING','ENUM','integrationTab'];(function(_0x1e2ea1,_0x16d443){var _0x42d780=function(_0x1984b){while(--_0x1984b){_0x1e2ea1['push'](_0x1e2ea1['shift']());}};_0x42d780(++_0x16d443);}(_0x11fc,0x1b7));var _0xc11f=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x11fc[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0xc11f('0x0'));module[_0xc11f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc11f('0x2')]},'username':{'type':Sequelize[_0xc11f('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc11f('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc11f('0x2')]},'securityToken':{'type':Sequelize[_0xc11f('0x2')]},'serverUrl':{'type':Sequelize[_0xc11f('0x2')]},'type':{'type':Sequelize[_0xc11f('0x3')](_0xc11f('0x4'),_0xc11f('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xf519=['ENUM','integrationTab','sequelize','exports','STRING','username'];(function(_0x2d1e5f,_0x45c24c){var _0xefe11c=function(_0x1c6ba4){while(--_0x1c6ba4){_0x2d1e5f['push'](_0x2d1e5f['shift']());}};_0xefe11c(++_0x45c24c);}(_0xf519,0xc8));var _0x9f51=function(_0x4c73ac,_0x46b73c){_0x4c73ac=_0x4c73ac-0x0;var _0x9839ee=_0xf519[_0x4c73ac];return _0x9839ee;};'use strict';var Sequelize=require(_0x9f51('0x0'));module[_0x9f51('0x1')]={'name':{'type':Sequelize[_0x9f51('0x2')]},'description':{'type':Sequelize[_0x9f51('0x2')]},'username':{'type':Sequelize[_0x9f51('0x2')],'unique':_0x9f51('0x3')},'remoteUri':{'type':Sequelize[_0x9f51('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9f51('0x2')]},'clientSecret':{'type':Sequelize[_0x9f51('0x2')]},'securityToken':{'type':Sequelize[_0x9f51('0x2')]},'serverUrl':{'type':Sequelize[_0x9f51('0x2')]},'type':{'type':Sequelize[_0x9f51('0x4')](_0x9f51('0x5'),'newTab'),'defaultValue':_0x9f51('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index ee96af4..847895d 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 _0x3120=['Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','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','../../components/integrations/configuration','jayson/promise','http','request','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','SalesforceAccount','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','rows','show','params','create','body','update','find','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','Subjects','remoteUri','clientSecret','username','Connection','clientId','login','concat','describe','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Type','remove','custom','includes','label','picklistValues','test','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x3df82c,_0x46b7ba){var _0x26b919=function(_0x2a22cc){while(--_0x2a22cc){_0x3df82c['push'](_0x3df82c['shift']());}};_0x26b919(++_0x46b7ba);}(_0x3120,0x7f));var _0x0312=function(_0x422621,_0x2b5fb6){_0x422621=_0x422621-0x0;var _0x2c8d61=_0x3120[_0x422621];return _0x2c8d61;};'use strict';var pdf=require(_0x0312('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0312('0x1'));var zipdir=require(_0x0312('0x2'));var jsonpatch=require(_0x0312('0x3'));var rp=require('request-promise');var moment=require(_0x0312('0x4'));var BPromise=require(_0x0312('0x5'));var Mustache=require(_0x0312('0x6'));var util=require(_0x0312('0x7'));var path=require(_0x0312('0x8'));var sox=require(_0x0312('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0312('0xa'));var squel=require(_0x0312('0xb'));var crypto=require('crypto');var jsforce=require(_0x0312('0xc'));var deskjs=require(_0x0312('0xd'));var toCsv=require(_0x0312('0xe'));var querystring=require(_0x0312('0xf'));var Papa=require(_0x0312('0x10'));var authService=require(_0x0312('0x11'));var hardwareService=require(_0x0312('0x12'));var Redis=require(_0x0312('0x13'));var qs=require(_0x0312('0x14'));var logger=require(_0x0312('0x15'))(_0x0312('0x16'));var utils=require(_0x0312('0x17'));var config=require(_0x0312('0x18'));var db=require(_0x0312('0x19'))['db'];var integrations=require(_0x0312('0x1a'));var jayson=require(_0x0312('0x1b'));var client=jayson['client'][_0x0312('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xe23b63,_0x2dd775,_0x2a4859,_0xba95af){return new BPromise(function(_0x18f4bf,_0x5dd42b){var _0x4db11a=_0xba95af||client;return _0x4db11a[_0x0312('0x1d')](_0xe23b63,_0x2a4859)['then'](function(_0xe22c9f){logger[_0x0312('0x1e')]('SalesforceAccount,\x20%s,\x20%s',_0x2dd775,_0x0312('0x1f'));logger[_0x0312('0x20')](_0x0312('0x21'),_0x2dd775,_0x0312('0x1f'),JSON[_0x0312('0x22')](_0xe22c9f));if(_0xe22c9f[_0x0312('0x23')]){if(_0xe22c9f[_0x0312('0x23')][_0x0312('0x24')]===0x1f4){logger[_0x0312('0x23')](_0x0312('0x25'),_0x2dd775,_0xe22c9f[_0x0312('0x23')][_0x0312('0x26')]);return _0x5dd42b(_0xe22c9f['error'][_0x0312('0x26')]);}logger[_0x0312('0x23')](_0x0312('0x25'),_0x2dd775,_0xe22c9f['error']['message']);return _0x18f4bf(_0xe22c9f[_0x0312('0x23')][_0x0312('0x26')]);}else{logger[_0x0312('0x1e')](_0x0312('0x25'),_0x2dd775,_0x0312('0x1f'));_0x18f4bf(_0xe22c9f[_0x0312('0x27')][_0x0312('0x26')]);}})[_0x0312('0x28')](function(_0x5c13c7){logger[_0x0312('0x23')](_0x0312('0x25'),_0x2dd775,_0x5c13c7);_0x5dd42b(_0x5c13c7);});});}function respondWithStatusCode(_0x2d4998,_0x344edf){_0x344edf=_0x344edf||0xcc;return function(_0x1dcc56){if(_0x1dcc56){return _0x2d4998[_0x0312('0x29')](_0x344edf);}return _0x2d4998[_0x0312('0x2a')](_0x344edf)['end']();};}function respondWithResult(_0x182582,_0x208d58){_0x208d58=_0x208d58||0xc8;return function(_0x1d2992){if(_0x1d2992){return _0x182582[_0x0312('0x2a')](_0x208d58)[_0x0312('0x2b')](_0x1d2992);}};}function respondWithFilteredResult(_0x14ecdb,_0x559309){return function(_0xab811f){if(_0xab811f){var _0x353b5f=_0xab811f[_0x0312('0x2c')],_0x446939=_0x559309[_0x0312('0x2d')],_0x423930=_0x559309[_0x0312('0x2d')]+_0x559309['limit'],_0xe7d3a5;if(_0x423930>=_0x353b5f){_0x423930=_0x353b5f;_0xe7d3a5=0xc8;}else{_0xe7d3a5=0xce;}_0x14ecdb['status'](_0xe7d3a5);return _0x14ecdb[_0x0312('0x2e')](_0x0312('0x2f'),_0x446939+'-'+_0x423930+'/'+_0x353b5f)[_0x0312('0x2b')](_0xab811f);}return null;};}function patchUpdates(_0x384d49){return function(_0x4a16ad){try{jsonpatch[_0x0312('0x30')](_0x4a16ad,_0x384d49,!![]);}catch(_0x2003b0){return BPromise[_0x0312('0x31')](_0x2003b0);}return _0x4a16ad[_0x0312('0x32')]();};}function saveUpdates(_0x3dc316,_0x42b5c5){return function(_0x49c360){if(_0x49c360){return _0x49c360['update'](_0x3dc316)[_0x0312('0x33')](function(_0x4bd8f1){return _0x4bd8f1;});}return null;};}function removeEntity(_0x47c327,_0x4ca459){return function(_0x2b2cc8){if(_0x2b2cc8){return _0x2b2cc8[_0x0312('0x34')]()['then'](function(){_0x47c327['status'](0xcc)[_0x0312('0x35')]();});}};}function handleEntityNotFound(_0x202cfc,_0x1da121){return function(_0x2398fa){if(!_0x2398fa){_0x202cfc['sendStatus'](0x194);}return _0x2398fa;};}function handleError(_0x240a47,_0x4041fa){_0x4041fa=_0x4041fa||0x1f4;return function(_0x944942){logger['error'](_0x944942[_0x0312('0x36')]);if(_0x944942['name']){delete _0x944942[_0x0312('0x37')];}_0x240a47[_0x0312('0x2a')](_0x4041fa)[_0x0312('0x38')](_0x944942);};}exports['index']=function(_0x3a7bb1,_0x528d47){var _0x66973a={},_0x1531c5={},_0x1303cc={'count':0x0,'rows':[]};var _0x3db393=db[_0x0312('0x39')][_0x0312('0x3a')];_0x1531c5['model']=_['keys'](_0x3db393);_0x1531c5[_0x0312('0x3b')]=_[_0x0312('0x3c')](_0x3a7bb1[_0x0312('0x3b')]);_0x1531c5['filters']=_[_0x0312('0x3d')](_0x1531c5[_0x0312('0x3e')],_0x1531c5[_0x0312('0x3b')]);_0x66973a[_0x0312('0x3f')]=_[_0x0312('0x3d')](_0x1531c5[_0x0312('0x3e')],qs[_0x0312('0x40')](_0x3a7bb1[_0x0312('0x3b')][_0x0312('0x40')]));_0x66973a[_0x0312('0x3f')]=_0x66973a[_0x0312('0x3f')][_0x0312('0x41')]?_0x66973a['attributes']:_0x1531c5[_0x0312('0x3e')];if(!_0x3a7bb1['query'][_0x0312('0x42')](_0x0312('0x43'))){_0x66973a['limit']=qs['limit'](_0x3a7bb1['query'][_0x0312('0x44')]);_0x66973a[_0x0312('0x2d')]=qs['offset'](_0x3a7bb1[_0x0312('0x3b')][_0x0312('0x2d')]);}_0x66973a[_0x0312('0x45')]=qs['sort'](_0x3a7bb1[_0x0312('0x3b')][_0x0312('0x46')]);_0x66973a[_0x0312('0x47')]=qs[_0x0312('0x48')](_[_0x0312('0x49')](_0x3a7bb1[_0x0312('0x3b')],_0x1531c5[_0x0312('0x48')]));if(_0x3a7bb1['query']['filter']){_0x66973a[_0x0312('0x47')]=_['merge'](_0x66973a[_0x0312('0x47')],{'$or':_[_0x0312('0x4a')](_0x3db393,function(_0x195448){if(_0x195448[_0x0312('0x4b')][_0x0312('0x4c')]!==_0x0312('0x4d')){var _0x3bd5e4={};_0x3bd5e4[_0x195448[_0x0312('0x4e')]]={'$like':'%'+_0x3a7bb1[_0x0312('0x3b')][_0x0312('0x4f')]+'%'};return _0x3bd5e4;}})});}_0x66973a=_[_0x0312('0x50')]({},_0x66973a,_0x3a7bb1[_0x0312('0x51')]);var _0x22394b={'where':_0x66973a[_0x0312('0x47')]};return db[_0x0312('0x39')][_0x0312('0x2c')](_0x22394b)[_0x0312('0x33')](function(_0x3de172){_0x1303cc[_0x0312('0x2c')]=_0x3de172;if(_0x3a7bb1['query'][_0x0312('0x52')]){_0x66973a[_0x0312('0x53')]=[{'all':!![]}];}return db[_0x0312('0x39')]['findAll'](_0x66973a);})[_0x0312('0x33')](function(_0x60712d){_0x1303cc[_0x0312('0x54')]=_0x60712d;return _0x1303cc;})[_0x0312('0x33')](respondWithFilteredResult(_0x528d47,_0x66973a))[_0x0312('0x28')](handleError(_0x528d47,null));};exports[_0x0312('0x55')]=function(_0x55e4ee,_0x484a9a){var _0x2b1360={'raw':![],'where':{'id':_0x55e4ee[_0x0312('0x56')]['id']}},_0x1fe107={};_0x1fe107[_0x0312('0x3e')]=_[_0x0312('0x3c')](db[_0x0312('0x39')][_0x0312('0x3a')]);_0x1fe107[_0x0312('0x3b')]=_[_0x0312('0x3c')](_0x55e4ee[_0x0312('0x3b')]);_0x1fe107[_0x0312('0x48')]=_['intersection'](_0x1fe107['model'],_0x1fe107[_0x0312('0x3b')]);_0x2b1360[_0x0312('0x3f')]=_[_0x0312('0x3d')](_0x1fe107['model'],qs[_0x0312('0x40')](_0x55e4ee[_0x0312('0x3b')][_0x0312('0x40')]));_0x2b1360[_0x0312('0x3f')]=_0x2b1360[_0x0312('0x3f')][_0x0312('0x41')]?_0x2b1360[_0x0312('0x3f')]:_0x1fe107['model'];if(_0x55e4ee['query'][_0x0312('0x52')]){_0x2b1360[_0x0312('0x53')]=[{'all':!![]}];}_0x2b1360=_[_0x0312('0x50')]({},_0x2b1360,_0x55e4ee[_0x0312('0x51')]);return db[_0x0312('0x39')]['find'](_0x2b1360)[_0x0312('0x33')](handleEntityNotFound(_0x484a9a,null))[_0x0312('0x33')](respondWithResult(_0x484a9a,null))[_0x0312('0x28')](handleError(_0x484a9a,null));};exports[_0x0312('0x57')]=function(_0x21e371,_0x1ca009){return db[_0x0312('0x39')]['create'](_0x21e371[_0x0312('0x58')],{})['then'](respondWithResult(_0x1ca009,0xc9))[_0x0312('0x28')](handleError(_0x1ca009,null));};exports[_0x0312('0x59')]=function(_0x124da1,_0x127d5c){if(_0x124da1[_0x0312('0x58')]['id']){delete _0x124da1[_0x0312('0x58')]['id'];}return db['SalesforceAccount'][_0x0312('0x5a')]({'where':{'id':_0x124da1['params']['id']}})[_0x0312('0x33')](handleEntityNotFound(_0x127d5c,null))['then'](saveUpdates(_0x124da1[_0x0312('0x58')],null))['then'](respondWithResult(_0x127d5c,null))[_0x0312('0x28')](handleError(_0x127d5c,null));};exports[_0x0312('0x34')]=function(_0x22b6e5,_0x59e178){return db[_0x0312('0x39')][_0x0312('0x5a')]({'where':{'id':_0x22b6e5[_0x0312('0x56')]['id']}})[_0x0312('0x33')](handleEntityNotFound(_0x59e178,null))[_0x0312('0x33')](removeEntity(_0x59e178,null))[_0x0312('0x28')](handleError(_0x59e178,null));};exports[_0x0312('0x5b')]=function(_0x3742f9,_0x1ecbbc,_0x2b0f52){var _0x5a726b={};var _0x237216={};var _0x4898e7;var _0x536a4d;return db[_0x0312('0x39')][_0x0312('0x5c')]({'where':{'id':_0x3742f9[_0x0312('0x56')]['id']}})[_0x0312('0x33')](handleEntityNotFound(_0x1ecbbc,null))[_0x0312('0x33')](function(_0x1e5b24){if(_0x1e5b24){_0x4898e7=_0x1e5b24;_0x237216[_0x0312('0x3e')]=_[_0x0312('0x3c')](db[_0x0312('0x5d')]['rawAttributes']);_0x237216[_0x0312('0x3b')]=_[_0x0312('0x3c')](_0x3742f9['query']);_0x237216[_0x0312('0x48')]=_[_0x0312('0x3d')](_0x237216[_0x0312('0x3e')],_0x237216[_0x0312('0x3b')]);_0x5a726b[_0x0312('0x3f')]=_[_0x0312('0x3d')](_0x237216[_0x0312('0x3e')],qs['fields'](_0x3742f9['query'][_0x0312('0x40')]));_0x5a726b[_0x0312('0x3f')]=_0x5a726b[_0x0312('0x3f')]['length']?_0x5a726b['attributes']:_0x237216[_0x0312('0x3e')];_0x5a726b[_0x0312('0x45')]=qs[_0x0312('0x46')](_0x3742f9[_0x0312('0x3b')][_0x0312('0x46')]);_0x5a726b[_0x0312('0x47')]=qs['filters'](_[_0x0312('0x49')](_0x3742f9['query'],_0x237216['filters']));if(_0x3742f9[_0x0312('0x3b')]['filter']){_0x5a726b[_0x0312('0x47')]=_[_0x0312('0x50')](_0x5a726b['where'],{'$or':_[_0x0312('0x4a')](_0x5a726b[_0x0312('0x3f')],function(_0x4369e8){var _0x14452b={};_0x14452b[_0x4369e8]={'$like':'%'+_0x3742f9[_0x0312('0x3b')][_0x0312('0x4f')]+'%'};return _0x14452b;})});}_0x5a726b=_[_0x0312('0x50')]({},_0x5a726b,_0x3742f9['options']);return _0x4898e7['getConfigurations'](_0x5a726b);}})[_0x0312('0x33')](function(_0x24f0c0){if(_0x24f0c0){_0x536a4d=_0x24f0c0[_0x0312('0x41')];if(!_0x3742f9[_0x0312('0x3b')]['hasOwnProperty'](_0x0312('0x43'))){_0x5a726b['limit']=qs['limit'](_0x3742f9['query']['limit']);_0x5a726b['offset']=qs['offset'](_0x3742f9['query']['offset']);}return _0x4898e7[_0x0312('0x5b')](_0x5a726b);}})[_0x0312('0x33')](function(_0x5eb340){if(_0x5eb340){return _0x5eb340?{'count':_0x536a4d,'rows':_0x5eb340}:null;}})['then'](respondWithResult(_0x1ecbbc,null))[_0x0312('0x28')](handleError(_0x1ecbbc,null));};exports[_0x0312('0x5e')]=function(_0x38d20d,_0xb7f85a,_0x2aff03){if(_0x38d20d[_0x0312('0x58')]['id']){delete _0x38d20d['body']['id'];}return db[_0x0312('0x39')][_0x0312('0x5c')]({'where':{'id':_0x38d20d['params']['id']}})[_0x0312('0x33')](handleEntityNotFound(_0xb7f85a,null))['then'](function(_0x1d12d){if(_0x1d12d){_0x38d20d[_0x0312('0x58')][_0x0312('0x5f')]=_0x1d12d['id'];_0x38d20d[_0x0312('0x58')]['Subjects']=integrations[_0x0312('0x60')](_0x38d20d[_0x0312('0x58')]['channel'],_0x38d20d[_0x0312('0x58')][_0x0312('0x4b')]);_0x38d20d['body'][_0x0312('0x61')]=integrations[_0x0312('0x62')](_0x38d20d[_0x0312('0x58')][_0x0312('0x63')],_0x38d20d[_0x0312('0x58')][_0x0312('0x4b')]);return db[_0x0312('0x5d')][_0x0312('0x57')](_0x38d20d[_0x0312('0x58')],{'include':[{'model':db[_0x0312('0x64')],'as':_0x0312('0x65')},{'model':db['SalesforceField'],'as':_0x0312('0x61')}]});}return null;})[_0x0312('0x33')](respondWithResult(_0xb7f85a,null))[_0x0312('0x28')](handleError(_0xb7f85a,null));};exports['getFields']=function(_0x74a4d9,_0xab31d7,_0x21a76e){var _0x56e633;return db[_0x0312('0x39')][_0x0312('0x5c')]({'where':{'id':_0x74a4d9[_0x0312('0x56')]['id']},'attributes':['id',_0x0312('0x66'),'clientId',_0x0312('0x67'),_0x0312('0x68'),'password','securityToken']})[_0x0312('0x33')](handleEntityNotFound(_0xab31d7,null))['then'](function(_0x2f86d8){if(_0x2f86d8){_0x56e633=new jsforce[(_0x0312('0x69'))]({'oauth2':{'loginUrl':_0x2f86d8[_0x0312('0x66')],'clientId':_0x2f86d8[_0x0312('0x6a')],'clientSecret':_0x2f86d8[_0x0312('0x67')]}});return _0x56e633[_0x0312('0x6b')](_0x2f86d8[_0x0312('0x68')],_0x2f86d8['password'][_0x0312('0x6c')](_0x2f86d8['securityToken']));}})[_0x0312('0x33')](function(_0x1c7fae){if(_0x1c7fae){return _0x56e633['sobject']('Task')[_0x0312('0x6d')]();}})[_0x0312('0x33')](function(_0x19147f){var _0x15927d=['CallDisposition',_0x0312('0x6e'),_0x0312('0x6f'),_0x0312('0x70'),_0x0312('0x71'),_0x0312('0x72'),_0x0312('0x73'),_0x0312('0x74')];if(_0x19147f){_[_0x0312('0x75')](_0x19147f[_0x0312('0x40')],function(_0x442840){return _0x442840[_0x0312('0x76')]===![]&&!_0x15927d[_0x0312('0x77')](_0x442840[_0x0312('0x37')]);});return{'count':_0x19147f['fields'][_0x0312('0x41')],'rows':_['map'](_0x19147f[_0x0312('0x40')],function(_0x560a28){return{'id':_0x560a28[_0x0312('0x37')],'name':_0x560a28[_0x0312('0x78')],'custom':_0x560a28[_0x0312('0x76')],'options':_0x560a28[_0x0312('0x79')]?_[_0x0312('0x4a')](_0x560a28[_0x0312('0x79')],function(_0x1eb654){return{'name':_0x1eb654[_0x0312('0x78')],'value':_0x1eb654['value']};}):[]};})};}})[_0x0312('0x33')](respondWithResult(_0xab31d7,null))[_0x0312('0x28')](function(_0x141ea5){var _0x32a4dd=_0x74a4d9[_0x0312('0x3b')][_0x0312('0x7a')]?0x1f4:_0x141ea5[_0x0312('0x7b')]||0x1f4;logger['error'](_0x0312('0x7c'),'getFields',_0x32a4dd,JSON[_0x0312('0x22')](_0x141ea5));delete _0x141ea5[_0x0312('0x37')];if(_0x32a4dd===0x191){_0x32a4dd=0x190;}_0xab31d7[_0x0312('0x2a')](_0x32a4dd)['send'](_0x74a4d9[_0x0312('0x3b')]['test']?{'message':_0x0312('0x7d'),'statusCode':_0x141ea5[_0x0312('0x7b')]}:_0x141ea5);});}; \ No newline at end of file +var _0x3a88=['SalesforceField','getFields','remoteUri','clientId','clientSecret','username','securityToken','Connection','login','sobject','Task','describe','CallDisposition','CallDurationInSeconds','CallObject','Priority','Status','Type','remove','custom','includes','label','picklistValues','value','statusCode','html-pdf','eml-format','request-promise','moment','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','save','update','destroy','end','stack','name','send','index','SalesforceAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','options','count','rows','show','length','includeAll','include','find','create','body','params','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration'];(function(_0xb837f5,_0x3f80a9){var _0x357368=function(_0x432e64){while(--_0x432e64){_0xb837f5['push'](_0xb837f5['shift']());}};_0x357368(++_0x3f80a9);}(_0x3a88,0x8d));var _0x83a8=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x3a88[_0x30c649];return _0x3edfb9;};'use strict';var pdf=require(_0x83a8('0x0'));var emlformat=require(_0x83a8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x83a8('0x2'));var moment=require(_0x83a8('0x3'));var BPromise=require(_0x83a8('0x4'));var Mustache=require(_0x83a8('0x5'));var util=require('util');var path=require(_0x83a8('0x6'));var sox=require('sox');var csv=require(_0x83a8('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x83a8('0x8'));var squel=require('squel');var crypto=require(_0x83a8('0x9'));var jsforce=require(_0x83a8('0xa'));var deskjs=require(_0x83a8('0xb'));var toCsv=require(_0x83a8('0x7'));var querystring=require(_0x83a8('0xc'));var Papa=require(_0x83a8('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x83a8('0xe'));var Redis=require(_0x83a8('0xf'));var qs=require(_0x83a8('0x10'));var logger=require(_0x83a8('0x11'))(_0x83a8('0x12'));var utils=require(_0x83a8('0x13'));var config=require(_0x83a8('0x14'));var db=require(_0x83a8('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x83a8('0x16'));var client=jayson[_0x83a8('0x17')][_0x83a8('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x23b79c,_0x211c68,_0x4449df,_0x3b5659){return new BPromise(function(_0x50c0c6,_0x1367e4){var _0x457703=_0x3b5659||client;return _0x457703['request'](_0x23b79c,_0x4449df)[_0x83a8('0x19')](function(_0x4827b7){logger[_0x83a8('0x1a')]('SalesforceAccount,\x20%s,\x20%s',_0x211c68,_0x83a8('0x1b'));logger[_0x83a8('0x1c')](_0x83a8('0x1d'),_0x211c68,'request\x20sent',JSON[_0x83a8('0x1e')](_0x4827b7));if(_0x4827b7['error']){if(_0x4827b7[_0x83a8('0x1f')][_0x83a8('0x20')]===0x1f4){logger['error'](_0x83a8('0x21'),_0x211c68,_0x4827b7[_0x83a8('0x1f')][_0x83a8('0x22')]);return _0x1367e4(_0x4827b7[_0x83a8('0x1f')][_0x83a8('0x22')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x211c68,_0x4827b7[_0x83a8('0x1f')][_0x83a8('0x22')]);return _0x50c0c6(_0x4827b7['error'][_0x83a8('0x22')]);}else{logger[_0x83a8('0x1a')]('SalesforceAccount,\x20%s,\x20%s',_0x211c68,_0x83a8('0x1b'));_0x50c0c6(_0x4827b7[_0x83a8('0x23')][_0x83a8('0x22')]);}})[_0x83a8('0x24')](function(_0x25fe82){logger['error'](_0x83a8('0x21'),_0x211c68,_0x25fe82);_0x1367e4(_0x25fe82);});});}function respondWithStatusCode(_0x18fa0d,_0x3ec388){_0x3ec388=_0x3ec388||0xcc;return function(_0x37d1e0){if(_0x37d1e0){return _0x18fa0d[_0x83a8('0x25')](_0x3ec388);}return _0x18fa0d[_0x83a8('0x26')](_0x3ec388)['end']();};}function respondWithResult(_0x2acf1c,_0x53f16b){_0x53f16b=_0x53f16b||0xc8;return function(_0x16cdf8){if(_0x16cdf8){return _0x2acf1c[_0x83a8('0x26')](_0x53f16b)[_0x83a8('0x27')](_0x16cdf8);}};}function respondWithFilteredResult(_0x1bb0a6,_0x3c8e77){return function(_0x2e31a4){if(_0x2e31a4){var _0x31ece1=_0x2e31a4['count'],_0x52a37a=_0x3c8e77[_0x83a8('0x28')],_0x2e539e=_0x3c8e77['offset']+_0x3c8e77[_0x83a8('0x29')],_0x2367c4;if(_0x2e539e>=_0x31ece1){_0x2e539e=_0x31ece1;_0x2367c4=0xc8;}else{_0x2367c4=0xce;}_0x1bb0a6['status'](_0x2367c4);return _0x1bb0a6[_0x83a8('0x2a')](_0x83a8('0x2b'),_0x52a37a+'-'+_0x2e539e+'/'+_0x31ece1)[_0x83a8('0x27')](_0x2e31a4);}return null;};}function patchUpdates(_0x4e50ff){return function(_0x1db3bb){try{jsonpatch['apply'](_0x1db3bb,_0x4e50ff,!![]);}catch(_0x2e68cf){return BPromise['reject'](_0x2e68cf);}return _0x1db3bb[_0x83a8('0x2c')]();};}function saveUpdates(_0x1d8e94,_0x170b6a){return function(_0xc01d09){if(_0xc01d09){return _0xc01d09[_0x83a8('0x2d')](_0x1d8e94)[_0x83a8('0x19')](function(_0x4c29a4){return _0x4c29a4;});}return null;};}function removeEntity(_0x2f2830,_0x207120){return function(_0x2cde98){if(_0x2cde98){return _0x2cde98[_0x83a8('0x2e')]()[_0x83a8('0x19')](function(){_0x2f2830[_0x83a8('0x26')](0xcc)[_0x83a8('0x2f')]();});}};}function handleEntityNotFound(_0x1c2e03,_0x3db50b){return function(_0x58a42f){if(!_0x58a42f){_0x1c2e03[_0x83a8('0x25')](0x194);}return _0x58a42f;};}function handleError(_0x168b3b,_0x326042){_0x326042=_0x326042||0x1f4;return function(_0xd78e2a){logger[_0x83a8('0x1f')](_0xd78e2a[_0x83a8('0x30')]);if(_0xd78e2a['name']){delete _0xd78e2a[_0x83a8('0x31')];}_0x168b3b[_0x83a8('0x26')](_0x326042)[_0x83a8('0x32')](_0xd78e2a);};}exports[_0x83a8('0x33')]=function(_0x18bc84,_0x14afa4){var _0x10dd66={},_0xaa7a4d={},_0x4543d2={'count':0x0,'rows':[]};var _0x4ff9b2=db[_0x83a8('0x34')][_0x83a8('0x35')];_0xaa7a4d[_0x83a8('0x36')]=_[_0x83a8('0x37')](_0x4ff9b2);_0xaa7a4d[_0x83a8('0x38')]=_[_0x83a8('0x37')](_0x18bc84[_0x83a8('0x38')]);_0xaa7a4d[_0x83a8('0x39')]=_[_0x83a8('0x3a')](_0xaa7a4d[_0x83a8('0x36')],_0xaa7a4d[_0x83a8('0x38')]);_0x10dd66[_0x83a8('0x3b')]=_['intersection'](_0xaa7a4d['model'],qs[_0x83a8('0x3c')](_0x18bc84['query'][_0x83a8('0x3c')]));_0x10dd66[_0x83a8('0x3b')]=_0x10dd66[_0x83a8('0x3b')]['length']?_0x10dd66[_0x83a8('0x3b')]:_0xaa7a4d['model'];if(!_0x18bc84['query'][_0x83a8('0x3d')](_0x83a8('0x3e'))){_0x10dd66[_0x83a8('0x29')]=qs['limit'](_0x18bc84[_0x83a8('0x38')][_0x83a8('0x29')]);_0x10dd66[_0x83a8('0x28')]=qs[_0x83a8('0x28')](_0x18bc84['query'][_0x83a8('0x28')]);}_0x10dd66['order']=qs[_0x83a8('0x3f')](_0x18bc84['query'][_0x83a8('0x3f')]);_0x10dd66[_0x83a8('0x40')]=qs[_0x83a8('0x39')](_[_0x83a8('0x41')](_0x18bc84['query'],_0xaa7a4d[_0x83a8('0x39')]));if(_0x18bc84['query'][_0x83a8('0x42')]){_0x10dd66[_0x83a8('0x40')]=_[_0x83a8('0x43')](_0x10dd66[_0x83a8('0x40')],{'$or':_[_0x83a8('0x44')](_0x4ff9b2,function(_0x24db27){if(_0x24db27[_0x83a8('0x45')]['key']!==_0x83a8('0x46')){var _0x558e0a={};_0x558e0a[_0x24db27['field']]={'$like':'%'+_0x18bc84[_0x83a8('0x38')][_0x83a8('0x42')]+'%'};return _0x558e0a;}})});}_0x10dd66=_['merge']({},_0x10dd66,_0x18bc84[_0x83a8('0x47')]);var _0x1a3579={'where':_0x10dd66[_0x83a8('0x40')]};return db[_0x83a8('0x34')][_0x83a8('0x48')](_0x1a3579)[_0x83a8('0x19')](function(_0x25159a){_0x4543d2['count']=_0x25159a;if(_0x18bc84[_0x83a8('0x38')]['includeAll']){_0x10dd66['include']=[{'all':!![]}];}return db[_0x83a8('0x34')]['findAll'](_0x10dd66);})[_0x83a8('0x19')](function(_0x22f375){_0x4543d2[_0x83a8('0x49')]=_0x22f375;return _0x4543d2;})[_0x83a8('0x19')](respondWithFilteredResult(_0x14afa4,_0x10dd66))[_0x83a8('0x24')](handleError(_0x14afa4,null));};exports[_0x83a8('0x4a')]=function(_0x4b433f,_0x236ec2){var _0xa7b23c={'raw':![],'where':{'id':_0x4b433f['params']['id']}},_0x3a3413={};_0x3a3413['model']=_['keys'](db[_0x83a8('0x34')]['rawAttributes']);_0x3a3413[_0x83a8('0x38')]=_[_0x83a8('0x37')](_0x4b433f['query']);_0x3a3413['filters']=_['intersection'](_0x3a3413[_0x83a8('0x36')],_0x3a3413['query']);_0xa7b23c[_0x83a8('0x3b')]=_['intersection'](_0x3a3413[_0x83a8('0x36')],qs['fields'](_0x4b433f[_0x83a8('0x38')][_0x83a8('0x3c')]));_0xa7b23c[_0x83a8('0x3b')]=_0xa7b23c[_0x83a8('0x3b')][_0x83a8('0x4b')]?_0xa7b23c[_0x83a8('0x3b')]:_0x3a3413[_0x83a8('0x36')];if(_0x4b433f[_0x83a8('0x38')][_0x83a8('0x4c')]){_0xa7b23c[_0x83a8('0x4d')]=[{'all':!![]}];}_0xa7b23c=_[_0x83a8('0x43')]({},_0xa7b23c,_0x4b433f['options']);return db[_0x83a8('0x34')][_0x83a8('0x4e')](_0xa7b23c)[_0x83a8('0x19')](handleEntityNotFound(_0x236ec2,null))[_0x83a8('0x19')](respondWithResult(_0x236ec2,null))[_0x83a8('0x24')](handleError(_0x236ec2,null));};exports['create']=function(_0x234bb5,_0x34e501){return db[_0x83a8('0x34')][_0x83a8('0x4f')](_0x234bb5[_0x83a8('0x50')],{})[_0x83a8('0x19')](respondWithResult(_0x34e501,0xc9))['catch'](handleError(_0x34e501,null));};exports[_0x83a8('0x2d')]=function(_0x265ea5,_0x974458){if(_0x265ea5[_0x83a8('0x50')]['id']){delete _0x265ea5[_0x83a8('0x50')]['id'];}return db[_0x83a8('0x34')][_0x83a8('0x4e')]({'where':{'id':_0x265ea5['params']['id']}})['then'](handleEntityNotFound(_0x974458,null))['then'](saveUpdates(_0x265ea5[_0x83a8('0x50')],null))['then'](respondWithResult(_0x974458,null))[_0x83a8('0x24')](handleError(_0x974458,null));};exports[_0x83a8('0x2e')]=function(_0x174ed0,_0x55a4b4){return db['SalesforceAccount'][_0x83a8('0x4e')]({'where':{'id':_0x174ed0[_0x83a8('0x51')]['id']}})[_0x83a8('0x19')](handleEntityNotFound(_0x55a4b4,null))[_0x83a8('0x19')](removeEntity(_0x55a4b4,null))[_0x83a8('0x24')](handleError(_0x55a4b4,null));};exports[_0x83a8('0x52')]=function(_0x4d3ece,_0x1a41c0,_0x55546e){var _0xcb85c0={};var _0x1fdd64={};var _0x99170f;var _0x35f0a4;return db['SalesforceAccount'][_0x83a8('0x53')]({'where':{'id':_0x4d3ece[_0x83a8('0x51')]['id']}})['then'](handleEntityNotFound(_0x1a41c0,null))[_0x83a8('0x19')](function(_0x58e923){if(_0x58e923){_0x99170f=_0x58e923;_0x1fdd64[_0x83a8('0x36')]=_[_0x83a8('0x37')](db['SalesforceConfiguration']['rawAttributes']);_0x1fdd64['query']=_[_0x83a8('0x37')](_0x4d3ece[_0x83a8('0x38')]);_0x1fdd64[_0x83a8('0x39')]=_[_0x83a8('0x3a')](_0x1fdd64[_0x83a8('0x36')],_0x1fdd64['query']);_0xcb85c0[_0x83a8('0x3b')]=_[_0x83a8('0x3a')](_0x1fdd64[_0x83a8('0x36')],qs[_0x83a8('0x3c')](_0x4d3ece[_0x83a8('0x38')][_0x83a8('0x3c')]));_0xcb85c0[_0x83a8('0x3b')]=_0xcb85c0[_0x83a8('0x3b')]['length']?_0xcb85c0[_0x83a8('0x3b')]:_0x1fdd64[_0x83a8('0x36')];_0xcb85c0['order']=qs['sort'](_0x4d3ece['query'][_0x83a8('0x3f')]);_0xcb85c0['where']=qs['filters'](_[_0x83a8('0x41')](_0x4d3ece['query'],_0x1fdd64[_0x83a8('0x39')]));if(_0x4d3ece[_0x83a8('0x38')]['filter']){_0xcb85c0[_0x83a8('0x40')]=_[_0x83a8('0x43')](_0xcb85c0[_0x83a8('0x40')],{'$or':_[_0x83a8('0x44')](_0xcb85c0[_0x83a8('0x3b')],function(_0xfcdf23){var _0x3dd31e={};_0x3dd31e[_0xfcdf23]={'$like':'%'+_0x4d3ece['query'][_0x83a8('0x42')]+'%'};return _0x3dd31e;})});}_0xcb85c0=_[_0x83a8('0x43')]({},_0xcb85c0,_0x4d3ece['options']);return _0x99170f[_0x83a8('0x52')](_0xcb85c0);}})[_0x83a8('0x19')](function(_0x173ce1){if(_0x173ce1){_0x35f0a4=_0x173ce1[_0x83a8('0x4b')];if(!_0x4d3ece[_0x83a8('0x38')][_0x83a8('0x3d')]('nolimit')){_0xcb85c0[_0x83a8('0x29')]=qs['limit'](_0x4d3ece['query'][_0x83a8('0x29')]);_0xcb85c0[_0x83a8('0x28')]=qs[_0x83a8('0x28')](_0x4d3ece[_0x83a8('0x38')][_0x83a8('0x28')]);}return _0x99170f[_0x83a8('0x52')](_0xcb85c0);}})[_0x83a8('0x19')](function(_0x246a76){if(_0x246a76){return _0x246a76?{'count':_0x35f0a4,'rows':_0x246a76}:null;}})[_0x83a8('0x19')](respondWithResult(_0x1a41c0,null))['catch'](handleError(_0x1a41c0,null));};exports[_0x83a8('0x54')]=function(_0x139e1b,_0x1c766c,_0x45c576){if(_0x139e1b['body']['id']){delete _0x139e1b[_0x83a8('0x50')]['id'];}return db[_0x83a8('0x34')][_0x83a8('0x53')]({'where':{'id':_0x139e1b[_0x83a8('0x51')]['id']}})[_0x83a8('0x19')](handleEntityNotFound(_0x1c766c,null))[_0x83a8('0x19')](function(_0x162f4c){if(_0x162f4c){_0x139e1b['body']['AccountId']=_0x162f4c['id'];_0x139e1b[_0x83a8('0x50')][_0x83a8('0x55')]=integrations[_0x83a8('0x56')](_0x139e1b[_0x83a8('0x50')][_0x83a8('0x57')],_0x139e1b[_0x83a8('0x50')]['type']);_0x139e1b[_0x83a8('0x50')][_0x83a8('0x58')]=integrations[_0x83a8('0x59')](_0x139e1b[_0x83a8('0x50')]['channel'],_0x139e1b['body'][_0x83a8('0x45')]);return db[_0x83a8('0x5a')][_0x83a8('0x4f')](_0x139e1b[_0x83a8('0x50')],{'include':[{'model':db[_0x83a8('0x5b')],'as':'Subjects'},{'model':db[_0x83a8('0x5b')],'as':'Descriptions'}]});}return null;})[_0x83a8('0x19')](respondWithResult(_0x1c766c,null))['catch'](handleError(_0x1c766c,null));};exports[_0x83a8('0x5c')]=function(_0x153e37,_0x383a25,_0x15a15a){var _0x39143a;return db[_0x83a8('0x34')][_0x83a8('0x53')]({'where':{'id':_0x153e37[_0x83a8('0x51')]['id']},'attributes':['id',_0x83a8('0x5d'),_0x83a8('0x5e'),_0x83a8('0x5f'),_0x83a8('0x60'),'password',_0x83a8('0x61')]})['then'](handleEntityNotFound(_0x383a25,null))['then'](function(_0x2b07fd){if(_0x2b07fd){_0x39143a=new jsforce[(_0x83a8('0x62'))]({'oauth2':{'loginUrl':_0x2b07fd['remoteUri'],'clientId':_0x2b07fd['clientId'],'clientSecret':_0x2b07fd['clientSecret']}});return _0x39143a[_0x83a8('0x63')](_0x2b07fd['username'],_0x2b07fd['password']['concat'](_0x2b07fd['securityToken']));}})['then'](function(_0x5005f){if(_0x5005f){return _0x39143a[_0x83a8('0x64')](_0x83a8('0x65'))[_0x83a8('0x66')]();}})[_0x83a8('0x19')](function(_0x5c28c4){var _0x40728e=[_0x83a8('0x67'),_0x83a8('0x68'),_0x83a8('0x69'),'CallType','IsArchived',_0x83a8('0x6a'),_0x83a8('0x6b'),_0x83a8('0x6c')];if(_0x5c28c4){_[_0x83a8('0x6d')](_0x5c28c4[_0x83a8('0x3c')],function(_0x11ae50){return _0x11ae50[_0x83a8('0x6e')]===![]&&!_0x40728e[_0x83a8('0x6f')](_0x11ae50[_0x83a8('0x31')]);});return{'count':_0x5c28c4['fields'][_0x83a8('0x4b')],'rows':_[_0x83a8('0x44')](_0x5c28c4[_0x83a8('0x3c')],function(_0x371e4b){return{'id':_0x371e4b[_0x83a8('0x31')],'name':_0x371e4b[_0x83a8('0x70')],'custom':_0x371e4b[_0x83a8('0x6e')],'options':_0x371e4b[_0x83a8('0x71')]?_[_0x83a8('0x44')](_0x371e4b[_0x83a8('0x71')],function(_0x3e7d7c){return{'name':_0x3e7d7c[_0x83a8('0x70')],'value':_0x3e7d7c[_0x83a8('0x72')]};}):[]};})};}})['then'](respondWithResult(_0x383a25,null))['catch'](function(_0xba5f4){var _0x49b92f=_0x153e37[_0x83a8('0x38')]['test']?0x1f4:_0xba5f4[_0x83a8('0x73')]||0x1f4;logger[_0x83a8('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0x83a8('0x5c'),_0x49b92f,JSON[_0x83a8('0x1e')](_0xba5f4));delete _0xba5f4[_0x83a8('0x31')];if(_0x49b92f===0x191){_0x49b92f=0x190;}_0x383a25[_0x83a8('0x26')](_0x49b92f)[_0x83a8('0x32')](_0x153e37[_0x83a8('0x38')]['test']?{'message':'Wrong\x20credentials','statusCode':_0xba5f4[_0x83a8('0x73')]}:_0xba5f4);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index abfe9b4..4dcfd35 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 _0xf458=['api','bluebird','request-promise','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','lodash','util'];(function(_0x54d73d,_0x4e84af){var _0x1211bc=function(_0x488232){while(--_0x488232){_0x54d73d['push'](_0x54d73d['shift']());}};_0x1211bc(++_0x4e84af);}(_0xf458,0x85));var _0x8f45=function(_0x1a333b,_0x38971c){_0x1a333b=_0x1a333b-0x0;var _0x10376b=_0xf458[_0x1a333b];return _0x10376b;};'use strict';var _=require(_0x8f45('0x0'));var util=require(_0x8f45('0x1'));var logger=require('../../config/logger')(_0x8f45('0x2'));var moment=require('moment');var BPromise=require(_0x8f45('0x3'));var rp=require(_0x8f45('0x4'));var attributes=require(_0x8f45('0x5'));var integrations=require(_0x8f45('0x6'));module[_0x8f45('0x7')]=function(_0x1c698d,_0x247c73){return _0x1c698d['define'](_0x8f45('0x8'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e56=['moment','bluebird','request-promise','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','lodash','util','../../config/logger'];(function(_0x7a502a,_0x22c4be){var _0x53845b=function(_0x2c59dd){while(--_0x2c59dd){_0x7a502a['push'](_0x7a502a['shift']());}};_0x53845b(++_0x22c4be);}(_0x4e56,0x89));var _0x64e5=function(_0x319f51,_0x30257a){_0x319f51=_0x319f51-0x0;var _0x9aa82f=_0x4e56[_0x319f51];return _0x9aa82f;};'use strict';var _=require(_0x64e5('0x0'));var util=require(_0x64e5('0x1'));var logger=require(_0x64e5('0x2'))('api');var moment=require(_0x64e5('0x3'));var BPromise=require(_0x64e5('0x4'));var rp=require(_0x64e5('0x5'));var attributes=require(_0x64e5('0x6'));var integrations=require(_0x64e5('0x7'));module['exports']=function(_0x275276,_0xc4eb7c){return _0x275276[_0x64e5('0x8')](_0x64e5('0x9'),attributes,{'tableName':'int_salesforce_accounts','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 71eda5e..7aa742e 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 _0x54cb=['attributes','limit','include','map','model','GetSalesforceAccount','debug','stringify','ShowSalesforceAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','SalesforceAccount','options','raw','where'];(function(_0x17a448,_0x1cd8e2){var _0x4b5d58=function(_0x2311a3){while(--_0x2311a3){_0x17a448['push'](_0x17a448['shift']());}};_0x4b5d58(++_0x1cd8e2);}(_0x54cb,0x195));var _0xb54c=function(_0x1b5400,_0x54b8d5){_0x1b5400=_0x1b5400-0x0;var _0x32840a=_0x54cb[_0x1b5400];return _0x32840a;};'use strict';var _=require(_0xb54c('0x0'));var util=require(_0xb54c('0x1'));var moment=require(_0xb54c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb54c('0x3'));var db=require(_0xb54c('0x4'))['db'];var utils=require(_0xb54c('0x5'));var logger=require(_0xb54c('0x6'))('rpc');var config=require(_0xb54c('0x7'));var jayson=require(_0xb54c('0x8'));var client=jayson[_0xb54c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bbfff,_0x55a105,_0x580a60){return new BPromise(function(_0x1bc906,_0x4d0051){return client[_0xb54c('0xa')](_0x3bbfff,_0x580a60)[_0xb54c('0xb')](function(_0x2ada37){logger[_0xb54c('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x55a105,'request\x20sent');logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x55a105,_0xb54c('0xd'),JSON['stringify'](_0x2ada37));if(_0x2ada37[_0xb54c('0xe')]){if(_0x2ada37[_0xb54c('0xe')][_0xb54c('0xf')]===0x1f4){logger[_0xb54c('0xe')](_0xb54c('0x10'),_0x55a105,_0x2ada37[_0xb54c('0xe')][_0xb54c('0x11')]);return _0x4d0051(_0x2ada37[_0xb54c('0xe')][_0xb54c('0x11')]);}logger[_0xb54c('0xe')](_0xb54c('0x10'),_0x55a105,_0x2ada37[_0xb54c('0xe')]['message']);return _0x1bc906(_0x2ada37[_0xb54c('0xe')][_0xb54c('0x11')]);}else{logger[_0xb54c('0xc')](_0xb54c('0x10'),_0x55a105,_0xb54c('0xd'));_0x1bc906(_0x2ada37[_0xb54c('0x12')]['message']);}})[_0xb54c('0x13')](function(_0x390251){logger['error'](_0xb54c('0x10'),_0x55a105,_0x390251);_0x4d0051(_0x390251);});});}exports['GetSalesforceAccount']=function(_0x436926){var _0x1526d4=this;return new Promise(function(_0x49256c,_0x27e338){return db[_0xb54c('0x14')]['findAll']({'raw':_0x436926[_0xb54c('0x15')]?_0x436926[_0xb54c('0x15')][_0xb54c('0x16')]===undefined?!![]:![]:!![],'where':_0x436926[_0xb54c('0x15')]?_0x436926[_0xb54c('0x15')][_0xb54c('0x17')]||null:null,'attributes':_0x436926[_0xb54c('0x15')]?_0x436926[_0xb54c('0x15')][_0xb54c('0x18')]||null:null,'limit':_0x436926[_0xb54c('0x15')]?_0x436926[_0xb54c('0x15')][_0xb54c('0x19')]||null:null,'include':_0x436926[_0xb54c('0x15')]?_0x436926['options'][_0xb54c('0x1a')]?_[_0xb54c('0x1b')](_0x436926[_0xb54c('0x15')][_0xb54c('0x1a')],function(_0xb59d78){return{'model':db[_0xb59d78['model']],'as':_0xb59d78['as'],'attributes':_0xb59d78[_0xb54c('0x18')],'include':_0xb59d78['include']?_[_0xb54c('0x1b')](_0xb59d78[_0xb54c('0x1a')],function(_0x293cdc){return{'model':db[_0x293cdc[_0xb54c('0x1c')]],'as':_0x293cdc['as'],'attributes':_0x293cdc['attributes'],'include':_0x293cdc[_0xb54c('0x1a')]?_[_0xb54c('0x1b')](_0x293cdc[_0xb54c('0x1a')],function(_0x155bcb){return{'model':db[_0x155bcb[_0xb54c('0x1c')]],'as':_0x155bcb['as'],'attributes':_0x155bcb[_0xb54c('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x155d93){logger['info'](_0xb54c('0x1d'),_0x436926);logger[_0xb54c('0x1e')](_0xb54c('0x1d'),_0x436926,JSON[_0xb54c('0x1f')](_0x155d93));_0x49256c(_0x155d93);})['catch'](function(_0x33a389){logger[_0xb54c('0xe')]('GetSalesforceAccount',_0x33a389[_0xb54c('0x11')],_0x436926);_0x27e338(_0x1526d4[_0xb54c('0xe')](0x1f4,_0x33a389['message']));});});};exports[_0xb54c('0x20')]=function(_0xeb565b){var _0x505652=this;return new Promise(function(_0x47c8e9,_0x498ddb){return db['SalesforceAccount']['find']({'raw':_0xeb565b[_0xb54c('0x15')]?_0xeb565b['options'][_0xb54c('0x16')]===undefined?!![]:![]:!![],'where':_0xeb565b[_0xb54c('0x15')]?_0xeb565b[_0xb54c('0x15')]['where']||null:null,'attributes':_0xeb565b[_0xb54c('0x15')]?_0xeb565b[_0xb54c('0x15')][_0xb54c('0x18')]||null:null,'include':_0xeb565b[_0xb54c('0x15')]?_0xeb565b[_0xb54c('0x15')][_0xb54c('0x1a')]?_[_0xb54c('0x1b')](_0xeb565b[_0xb54c('0x15')][_0xb54c('0x1a')],function(_0x407472){return{'model':db[_0x407472[_0xb54c('0x1c')]],'as':_0x407472['as'],'attributes':_0x407472[_0xb54c('0x18')],'include':_0x407472[_0xb54c('0x1a')]?_[_0xb54c('0x1b')](_0x407472[_0xb54c('0x1a')],function(_0x2336a4){return{'model':db[_0x2336a4[_0xb54c('0x1c')]],'as':_0x2336a4['as'],'attributes':_0x2336a4['attributes'],'include':_0x2336a4[_0xb54c('0x1a')]?_[_0xb54c('0x1b')](_0x2336a4[_0xb54c('0x1a')],function(_0x6654e9){return{'model':db[_0x6654e9[_0xb54c('0x1c')]],'as':_0x6654e9['as'],'attributes':_0x6654e9['attributes']};}):[]};}):[]};}):[]:[]})[_0xb54c('0xb')](function(_0x414e2f){logger['info'](_0xb54c('0x20'),_0xeb565b);logger[_0xb54c('0x1e')](_0xb54c('0x20'),_0xeb565b,JSON[_0xb54c('0x1f')](_0x414e2f));_0x47c8e9(_0x414e2f);})[_0xb54c('0x13')](function(_0x5c57af){logger[_0xb54c('0xe')](_0xb54c('0x20'),_0x5c57af[_0xb54c('0x11')],_0xeb565b);_0x498ddb(_0x505652['error'](0x1f4,_0x5c57af[_0xb54c('0x11')]));});});}; \ No newline at end of file +var _0x7211=['then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','findAll','options','raw','include','model','attributes','map','GetSalesforceAccount','SalesforceAccount','where','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x4f2108,_0x53035c){var _0x5fe59c=function(_0x278cc1){while(--_0x278cc1){_0x4f2108['push'](_0x4f2108['shift']());}};_0x5fe59c(++_0x53035c);}(_0x7211,0x1d5));var _0x1721=function(_0x4f97f4,_0x30f006){_0x4f97f4=_0x4f97f4-0x0;var _0x240450=_0x7211[_0x4f97f4];return _0x240450;};'use strict';var _=require(_0x1721('0x0'));var util=require(_0x1721('0x1'));var moment=require(_0x1721('0x2'));var BPromise=require(_0x1721('0x3'));var rs=require(_0x1721('0x4'));var fs=require('fs');var Redis=require(_0x1721('0x5'));var db=require(_0x1721('0x6'))['db'];var utils=require(_0x1721('0x7'));var logger=require(_0x1721('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1721('0x9')][_0x1721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21b7c7,_0x62097,_0x576cec){return new BPromise(function(_0x11ac22,_0x39dc7e){return client['request'](_0x21b7c7,_0x576cec)[_0x1721('0xb')](function(_0xaaa78d){logger[_0x1721('0xc')](_0x1721('0xd'),_0x62097,'request\x20sent');logger[_0x1721('0xe')](_0x1721('0xf'),_0x62097,'request\x20sent',JSON[_0x1721('0x10')](_0xaaa78d));if(_0xaaa78d[_0x1721('0x11')]){if(_0xaaa78d[_0x1721('0x11')]['code']===0x1f4){logger['error'](_0x1721('0xd'),_0x62097,_0xaaa78d[_0x1721('0x11')]['message']);return _0x39dc7e(_0xaaa78d[_0x1721('0x11')][_0x1721('0x12')]);}logger['error'](_0x1721('0xd'),_0x62097,_0xaaa78d[_0x1721('0x11')][_0x1721('0x12')]);return _0x11ac22(_0xaaa78d[_0x1721('0x11')][_0x1721('0x12')]);}else{logger[_0x1721('0xc')](_0x1721('0xd'),_0x62097,_0x1721('0x13'));_0x11ac22(_0xaaa78d['result']['message']);}})[_0x1721('0x14')](function(_0xb61ec5){logger[_0x1721('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x62097,_0xb61ec5);_0x39dc7e(_0xb61ec5);});});}exports['GetSalesforceAccount']=function(_0x57cb96){var _0xbea966=this;return new Promise(function(_0x459fe3,_0x28e40c){return db['SalesforceAccount'][_0x1721('0x15')]({'raw':_0x57cb96[_0x1721('0x16')]?_0x57cb96[_0x1721('0x16')][_0x1721('0x17')]===undefined?!![]:![]:!![],'where':_0x57cb96[_0x1721('0x16')]?_0x57cb96['options']['where']||null:null,'attributes':_0x57cb96[_0x1721('0x16')]?_0x57cb96[_0x1721('0x16')]['attributes']||null:null,'limit':_0x57cb96[_0x1721('0x16')]?_0x57cb96[_0x1721('0x16')]['limit']||null:null,'include':_0x57cb96[_0x1721('0x16')]?_0x57cb96['options'][_0x1721('0x18')]?_['map'](_0x57cb96[_0x1721('0x16')][_0x1721('0x18')],function(_0x425cdb){return{'model':db[_0x425cdb[_0x1721('0x19')]],'as':_0x425cdb['as'],'attributes':_0x425cdb[_0x1721('0x1a')],'include':_0x425cdb[_0x1721('0x18')]?_['map'](_0x425cdb['include'],function(_0x3bf668){return{'model':db[_0x3bf668[_0x1721('0x19')]],'as':_0x3bf668['as'],'attributes':_0x3bf668[_0x1721('0x1a')],'include':_0x3bf668['include']?_[_0x1721('0x1b')](_0x3bf668[_0x1721('0x18')],function(_0x2cd61d){return{'model':db[_0x2cd61d[_0x1721('0x19')]],'as':_0x2cd61d['as'],'attributes':_0x2cd61d[_0x1721('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1721('0xb')](function(_0x359c31){logger[_0x1721('0xc')](_0x1721('0x1c'),_0x57cb96);logger['debug'](_0x1721('0x1c'),_0x57cb96,JSON[_0x1721('0x10')](_0x359c31));_0x459fe3(_0x359c31);})['catch'](function(_0x3e2984){logger[_0x1721('0x11')]('GetSalesforceAccount',_0x3e2984[_0x1721('0x12')],_0x57cb96);_0x28e40c(_0xbea966[_0x1721('0x11')](0x1f4,_0x3e2984[_0x1721('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0x32ee1b){var _0x59c231=this;return new Promise(function(_0x1e8826,_0x200d68){return db[_0x1721('0x1d')]['find']({'raw':_0x32ee1b['options']?_0x32ee1b[_0x1721('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x32ee1b[_0x1721('0x16')]?_0x32ee1b['options'][_0x1721('0x1e')]||null:null,'attributes':_0x32ee1b['options']?_0x32ee1b[_0x1721('0x16')][_0x1721('0x1a')]||null:null,'include':_0x32ee1b['options']?_0x32ee1b[_0x1721('0x16')][_0x1721('0x18')]?_[_0x1721('0x1b')](_0x32ee1b[_0x1721('0x16')][_0x1721('0x18')],function(_0x3e8c14){return{'model':db[_0x3e8c14['model']],'as':_0x3e8c14['as'],'attributes':_0x3e8c14[_0x1721('0x1a')],'include':_0x3e8c14['include']?_[_0x1721('0x1b')](_0x3e8c14[_0x1721('0x18')],function(_0x1d233d){return{'model':db[_0x1d233d['model']],'as':_0x1d233d['as'],'attributes':_0x1d233d[_0x1721('0x1a')],'include':_0x1d233d['include']?_[_0x1721('0x1b')](_0x1d233d[_0x1721('0x18')],function(_0x3909a8){return{'model':db[_0x3909a8[_0x1721('0x19')]],'as':_0x3909a8['as'],'attributes':_0x3909a8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e89d7){logger[_0x1721('0xc')]('ShowSalesforceAccount',_0x32ee1b);logger['debug'](_0x1721('0x1f'),_0x32ee1b,JSON['stringify'](_0x5e89d7));_0x1e8826(_0x5e89d7);})[_0x1721('0x14')](function(_0x2f0f33){logger[_0x1721('0x11')](_0x1721('0x1f'),_0x2f0f33[_0x1721('0x12')],_0x32ee1b);_0x200d68(_0x59c231[_0x1721('0x11')](0x1f4,_0x2f0f33[_0x1721('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 8ef2ac7..cfb7c72 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 _0xdca9=['delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','put','update'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xdca9,0xaa));var _0x9dca=function(_0x46b46d,_0x3758ff){_0x46b46d=_0x46b46d-0x0;var _0x49b2d6=_0xdca9[_0x46b46d];return _0x49b2d6;};'use strict';var multer=require('multer');var util=require(_0x9dca('0x0'));var path=require('path');var timeout=require(_0x9dca('0x1'));var express=require(_0x9dca('0x2'));var router=express[_0x9dca('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x9dca('0x4'));var config=require(_0x9dca('0x5'));var controller=require(_0x9dca('0x6'));router['get']('/',auth[_0x9dca('0x7')](),controller[_0x9dca('0x8')]);router[_0x9dca('0x9')](_0x9dca('0xa'),auth[_0x9dca('0x7')](),controller[_0x9dca('0xb')]);router[_0x9dca('0x9')](_0x9dca('0xc'),auth[_0x9dca('0x7')](),controller[_0x9dca('0xd')]);router[_0x9dca('0x9')](_0x9dca('0xe'),auth[_0x9dca('0x7')](),controller[_0x9dca('0xf')]);router[_0x9dca('0x9')](_0x9dca('0x10'),auth[_0x9dca('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0x9dca('0x7')](),controller['create']);router[_0x9dca('0x11')](_0x9dca('0xa'),auth['isAuthenticated'](),controller[_0x9dca('0x12')]);router[_0x9dca('0x13')]('/:id',auth[_0x9dca('0x7')](),controller['destroy']);module[_0x9dca('0x14')]=router; \ No newline at end of file +var _0x3bf6=['getFields','/:id/subjects','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields'];(function(_0x1ec4a7,_0x48c768){var _0x30ec83=function(_0x458af0){while(--_0x458af0){_0x1ec4a7['push'](_0x1ec4a7['shift']());}};_0x30ec83(++_0x48c768);}(_0x3bf6,0x181));var _0x63bf=function(_0x34c544,_0x247d25){_0x34c544=_0x34c544-0x0;var _0x335312=_0x3bf6[_0x34c544];return _0x335312;};'use strict';var multer=require(_0x63bf('0x0'));var util=require(_0x63bf('0x1'));var path=require(_0x63bf('0x2'));var timeout=require(_0x63bf('0x3'));var express=require(_0x63bf('0x4'));var router=express['Router']();var auth=require(_0x63bf('0x5'));var interaction=require(_0x63bf('0x6'));var config=require(_0x63bf('0x7'));var controller=require(_0x63bf('0x8'));router[_0x63bf('0x9')]('/',auth[_0x63bf('0xa')](),controller[_0x63bf('0xb')]);router[_0x63bf('0x9')]('/:id',auth[_0x63bf('0xa')](),controller[_0x63bf('0xc')]);router[_0x63bf('0x9')](_0x63bf('0xd'),auth['isAuthenticated'](),controller[_0x63bf('0xe')]);router[_0x63bf('0x9')](_0x63bf('0xf'),auth[_0x63bf('0xa')](),controller['getSubjects']);router[_0x63bf('0x9')]('/:id/descriptions',auth[_0x63bf('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0x63bf('0xa')](),controller[_0x63bf('0x10')]);router[_0x63bf('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x63bf('0x12')]('/:id',auth[_0x63bf('0xa')](),controller[_0x63bf('0x13')]);module[_0x63bf('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index a338885..98bf832 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 _0x7f3b=['lead','nothing','sequelize','ENUM','contact_lead','contact'];(function(_0xcf3a52,_0x1c1e31){var _0x102f35=function(_0x5c261a){while(--_0x5c261a){_0xcf3a52['push'](_0xcf3a52['shift']());}};_0x102f35(++_0x1c1e31);}(_0x7f3b,0x1b2));var _0xb7f3=function(_0x3978b7,_0x2e69b3){_0x3978b7=_0x3978b7-0x0;var _0x114377=_0x7f3b[_0x3978b7];return _0x114377;};'use strict';var Sequelize=require(_0xb7f3('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'moduleSearch':{'type':Sequelize[_0xb7f3('0x1')](_0xb7f3('0x2'),_0xb7f3('0x3'),_0xb7f3('0x4')),'defaultValue':_0xb7f3('0x2')},'moduleCreate':{'type':Sequelize['ENUM'](_0xb7f3('0x5'),_0xb7f3('0x3'),'lead'),'defaultValue':_0xb7f3('0x4')}}; \ No newline at end of file +var _0x7e0c=['contact','sequelize','exports','STRING','ENUM','contact_lead','lead','nothing'];(function(_0x19d181,_0xbd9929){var _0x21f0b3=function(_0x27ca09){while(--_0x27ca09){_0x19d181['push'](_0x19d181['shift']());}};_0x21f0b3(++_0xbd9929);}(_0x7e0c,0x111));var _0xc7e0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e0c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc7e0('0x0'));module[_0xc7e0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc7e0('0x2')]},'moduleSearch':{'type':Sequelize[_0xc7e0('0x3')](_0xc7e0('0x4'),'contact',_0xc7e0('0x5')),'defaultValue':_0xc7e0('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0xc7e0('0x6'),_0xc7e0('0x7'),_0xc7e0('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 80108cb..d44b4d6 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 _0x5fc3=['request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','jayson/promise','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','SalesforceConfiguration','rawAttributes','keys','query','filters','intersection','fields','attributes','length','model','nolimit','sort','pick','filter','where','merge','map','VIRTUAL','options','findAll','show','params','includeAll','include','find','create','body','findOne','SalesforceField','getFields','hasOwnProperty','getSubjects','order','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2caaef,_0x3c19ed){_0x2caaef=_0x2caaef-0x0;var _0xd011f8=_0x5fc3[_0x2caaef];return _0xd011f8;};'use strict';var pdf=require(_0x35fc('0x0'));var emlformat=require(_0x35fc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35fc('0x2'));var jsonpatch=require(_0x35fc('0x3'));var rp=require(_0x35fc('0x4'));var moment=require(_0x35fc('0x5'));var BPromise=require(_0x35fc('0x6'));var Mustache=require('mustache');var util=require(_0x35fc('0x7'));var path=require(_0x35fc('0x8'));var sox=require(_0x35fc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0xe'));var querystring=require(_0x35fc('0xf'));var Papa=require(_0x35fc('0x10'));var authService=require(_0x35fc('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x35fc('0x12'));var qs=require(_0x35fc('0x13'));var logger=require('../../config/logger')(_0x35fc('0x14'));var utils=require(_0x35fc('0x15'));var config=require('../../config/environment');var db=require(_0x35fc('0x16'))['db'];var jayson=require(_0x35fc('0x17'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x409357,_0x5d462a,_0x397738,_0x22055e){return new BPromise(function(_0x2a6ad2,_0x29730f){var _0x38d9f2=_0x22055e||client;return _0x38d9f2['request'](_0x409357,_0x397738)['then'](function(_0x5eac0f){logger['info'](_0x35fc('0x18'),_0x5d462a,_0x35fc('0x19'));logger[_0x35fc('0x1a')](_0x35fc('0x1b'),_0x5d462a,_0x35fc('0x19'),JSON[_0x35fc('0x1c')](_0x5eac0f));if(_0x5eac0f['error']){if(_0x5eac0f[_0x35fc('0x1d')][_0x35fc('0x1e')]===0x1f4){logger['error'](_0x35fc('0x18'),_0x5d462a,_0x5eac0f[_0x35fc('0x1d')][_0x35fc('0x1f')]);return _0x29730f(_0x5eac0f['error'][_0x35fc('0x1f')]);}logger[_0x35fc('0x1d')](_0x35fc('0x18'),_0x5d462a,_0x5eac0f['error'][_0x35fc('0x1f')]);return _0x2a6ad2(_0x5eac0f[_0x35fc('0x1d')][_0x35fc('0x1f')]);}else{logger[_0x35fc('0x20')](_0x35fc('0x18'),_0x5d462a,_0x35fc('0x19'));_0x2a6ad2(_0x5eac0f[_0x35fc('0x21')][_0x35fc('0x1f')]);}})[_0x35fc('0x22')](function(_0x427eae){logger['error'](_0x35fc('0x18'),_0x5d462a,_0x427eae);_0x29730f(_0x427eae);});});}function respondWithStatusCode(_0xd5399f,_0x257719){_0x257719=_0x257719||0xcc;return function(_0x2d8183){if(_0x2d8183){return _0xd5399f[_0x35fc('0x23')](_0x257719);}return _0xd5399f['status'](_0x257719)[_0x35fc('0x24')]();};}function respondWithResult(_0x4c587a,_0x561bf8){_0x561bf8=_0x561bf8||0xc8;return function(_0x265324){if(_0x265324){return _0x4c587a[_0x35fc('0x25')](_0x561bf8)[_0x35fc('0x26')](_0x265324);}};}function respondWithFilteredResult(_0x51cfec,_0x4086e9){return function(_0x598d7a){if(_0x598d7a){var _0x1bf180=_0x598d7a[_0x35fc('0x27')],_0xdfab9f=_0x4086e9['offset'],_0x5cb986=_0x4086e9[_0x35fc('0x28')]+_0x4086e9[_0x35fc('0x29')],_0x519264;if(_0x5cb986>=_0x1bf180){_0x5cb986=_0x1bf180;_0x519264=0xc8;}else{_0x519264=0xce;}_0x51cfec['status'](_0x519264);return _0x51cfec[_0x35fc('0x2a')](_0x35fc('0x2b'),_0xdfab9f+'-'+_0x5cb986+'/'+_0x1bf180)[_0x35fc('0x26')](_0x598d7a);}return null;};}function patchUpdates(_0x9f3c8a){return function(_0x3735da){try{jsonpatch[_0x35fc('0x2c')](_0x3735da,_0x9f3c8a,!![]);}catch(_0x11ccdb){return BPromise[_0x35fc('0x2d')](_0x11ccdb);}return _0x3735da['save']();};}function saveUpdates(_0x1cd1ae,_0x220931){return function(_0x22af18){if(_0x22af18){return _0x22af18['update'](_0x1cd1ae)[_0x35fc('0x2e')](function(_0x16f067){return _0x16f067;});}return null;};}function removeEntity(_0x3822a8,_0xe6e4ba){return function(_0xd8a4ca){if(_0xd8a4ca){return _0xd8a4ca[_0x35fc('0x2f')]()[_0x35fc('0x2e')](function(){_0x3822a8[_0x35fc('0x25')](0xcc)[_0x35fc('0x24')]();});}};}function handleEntityNotFound(_0x127bfc,_0x57072d){return function(_0x5e0313){if(!_0x5e0313){_0x127bfc[_0x35fc('0x23')](0x194);}return _0x5e0313;};}function handleError(_0x4af5fe,_0x37b394){_0x37b394=_0x37b394||0x1f4;return function(_0x39454e){logger[_0x35fc('0x1d')](_0x39454e[_0x35fc('0x30')]);if(_0x39454e[_0x35fc('0x31')]){delete _0x39454e[_0x35fc('0x31')];}_0x4af5fe['status'](_0x37b394)[_0x35fc('0x32')](_0x39454e);};}exports[_0x35fc('0x33')]=function(_0x46b9ef,_0x4441d8){var _0x2bbd36={},_0x2f823b={},_0x553597={'count':0x0,'rows':[]};var _0x2483be=db[_0x35fc('0x34')][_0x35fc('0x35')];_0x2f823b['model']=_[_0x35fc('0x36')](_0x2483be);_0x2f823b['query']=_[_0x35fc('0x36')](_0x46b9ef[_0x35fc('0x37')]);_0x2f823b[_0x35fc('0x38')]=_[_0x35fc('0x39')](_0x2f823b['model'],_0x2f823b['query']);_0x2bbd36['attributes']=_[_0x35fc('0x39')](_0x2f823b['model'],qs[_0x35fc('0x3a')](_0x46b9ef['query'][_0x35fc('0x3a')]));_0x2bbd36[_0x35fc('0x3b')]=_0x2bbd36[_0x35fc('0x3b')][_0x35fc('0x3c')]?_0x2bbd36[_0x35fc('0x3b')]:_0x2f823b[_0x35fc('0x3d')];if(!_0x46b9ef[_0x35fc('0x37')]['hasOwnProperty'](_0x35fc('0x3e'))){_0x2bbd36[_0x35fc('0x29')]=qs['limit'](_0x46b9ef[_0x35fc('0x37')][_0x35fc('0x29')]);_0x2bbd36[_0x35fc('0x28')]=qs[_0x35fc('0x28')](_0x46b9ef[_0x35fc('0x37')][_0x35fc('0x28')]);}_0x2bbd36['order']=qs[_0x35fc('0x3f')](_0x46b9ef[_0x35fc('0x37')][_0x35fc('0x3f')]);_0x2bbd36['where']=qs[_0x35fc('0x38')](_[_0x35fc('0x40')](_0x46b9ef['query'],_0x2f823b[_0x35fc('0x38')]));if(_0x46b9ef[_0x35fc('0x37')][_0x35fc('0x41')]){_0x2bbd36[_0x35fc('0x42')]=_[_0x35fc('0x43')](_0x2bbd36[_0x35fc('0x42')],{'$or':_[_0x35fc('0x44')](_0x2483be,function(_0x3ec51f){if(_0x3ec51f['type']['key']!==_0x35fc('0x45')){var _0x36fcf9={};_0x36fcf9[_0x3ec51f['field']]={'$like':'%'+_0x46b9ef['query']['filter']+'%'};return _0x36fcf9;}})});}_0x2bbd36=_[_0x35fc('0x43')]({},_0x2bbd36,_0x46b9ef[_0x35fc('0x46')]);var _0x4e56ed={'where':_0x2bbd36[_0x35fc('0x42')]};return db[_0x35fc('0x34')][_0x35fc('0x27')](_0x4e56ed)[_0x35fc('0x2e')](function(_0x5c52be){_0x553597['count']=_0x5c52be;if(_0x46b9ef['query']['includeAll']){_0x2bbd36['include']=[{'all':!![]}];}return db[_0x35fc('0x34')][_0x35fc('0x47')](_0x2bbd36);})['then'](function(_0x119925){_0x553597['rows']=_0x119925;return _0x553597;})[_0x35fc('0x2e')](respondWithFilteredResult(_0x4441d8,_0x2bbd36))[_0x35fc('0x22')](handleError(_0x4441d8,null));};exports[_0x35fc('0x48')]=function(_0x2de5d1,_0x16f7c8){var _0x5d3d0f={'raw':![],'where':{'id':_0x2de5d1[_0x35fc('0x49')]['id']}},_0x64d381={};_0x64d381['model']=_[_0x35fc('0x36')](db[_0x35fc('0x34')][_0x35fc('0x35')]);_0x64d381[_0x35fc('0x37')]=_['keys'](_0x2de5d1[_0x35fc('0x37')]);_0x64d381['filters']=_['intersection'](_0x64d381[_0x35fc('0x3d')],_0x64d381[_0x35fc('0x37')]);_0x5d3d0f[_0x35fc('0x3b')]=_[_0x35fc('0x39')](_0x64d381[_0x35fc('0x3d')],qs[_0x35fc('0x3a')](_0x2de5d1[_0x35fc('0x37')][_0x35fc('0x3a')]));_0x5d3d0f['attributes']=_0x5d3d0f[_0x35fc('0x3b')][_0x35fc('0x3c')]?_0x5d3d0f[_0x35fc('0x3b')]:_0x64d381[_0x35fc('0x3d')];if(_0x2de5d1[_0x35fc('0x37')][_0x35fc('0x4a')]){_0x5d3d0f[_0x35fc('0x4b')]=[{'all':!![]}];}_0x5d3d0f=_[_0x35fc('0x43')]({},_0x5d3d0f,_0x2de5d1[_0x35fc('0x46')]);return db[_0x35fc('0x34')][_0x35fc('0x4c')](_0x5d3d0f)[_0x35fc('0x2e')](handleEntityNotFound(_0x16f7c8,null))[_0x35fc('0x2e')](respondWithResult(_0x16f7c8,null))[_0x35fc('0x22')](handleError(_0x16f7c8,null));};exports['create']=function(_0x553ed6,_0x144f77){return db[_0x35fc('0x34')][_0x35fc('0x4d')](_0x553ed6[_0x35fc('0x4e')],{})[_0x35fc('0x2e')](respondWithResult(_0x144f77,0xc9))[_0x35fc('0x22')](handleError(_0x144f77,null));};exports['update']=function(_0x4f024c,_0x388521){if(_0x4f024c[_0x35fc('0x4e')]['id']){delete _0x4f024c[_0x35fc('0x4e')]['id'];}return db[_0x35fc('0x34')]['find']({'where':{'id':_0x4f024c[_0x35fc('0x49')]['id']}})[_0x35fc('0x2e')](handleEntityNotFound(_0x388521,null))['then'](saveUpdates(_0x4f024c[_0x35fc('0x4e')],null))[_0x35fc('0x2e')](respondWithResult(_0x388521,null))['catch'](handleError(_0x388521,null));};exports[_0x35fc('0x2f')]=function(_0x1ab472,_0x26118e){return db[_0x35fc('0x34')]['find']({'where':{'id':_0x1ab472['params']['id']}})['then'](handleEntityNotFound(_0x26118e,null))[_0x35fc('0x2e')](removeEntity(_0x26118e,null))[_0x35fc('0x22')](handleError(_0x26118e,null));};exports['getFields']=function(_0x444d7e,_0x1f89b3,_0x381640){var _0x145854={};var _0x46c59b={};var _0x538be0;var _0x2d9d45;return db[_0x35fc('0x34')][_0x35fc('0x4f')]({'where':{'id':_0x444d7e['params']['id']}})[_0x35fc('0x2e')](handleEntityNotFound(_0x1f89b3,null))[_0x35fc('0x2e')](function(_0x47fb1a){if(_0x47fb1a){_0x538be0=_0x47fb1a;_0x46c59b[_0x35fc('0x3d')]=_[_0x35fc('0x36')](db[_0x35fc('0x50')][_0x35fc('0x35')]);_0x46c59b[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x444d7e[_0x35fc('0x37')]);_0x46c59b[_0x35fc('0x38')]=_['intersection'](_0x46c59b[_0x35fc('0x3d')],_0x46c59b[_0x35fc('0x37')]);_0x145854[_0x35fc('0x3b')]=_['intersection'](_0x46c59b[_0x35fc('0x3d')],qs['fields'](_0x444d7e['query']['fields']));_0x145854[_0x35fc('0x3b')]=_0x145854[_0x35fc('0x3b')][_0x35fc('0x3c')]?_0x145854[_0x35fc('0x3b')]:_0x46c59b[_0x35fc('0x3d')];_0x145854['order']=qs['sort'](_0x444d7e['query']['sort']);_0x145854['where']=qs[_0x35fc('0x38')](_[_0x35fc('0x40')](_0x444d7e[_0x35fc('0x37')],_0x46c59b[_0x35fc('0x38')]));if(_0x444d7e['query'][_0x35fc('0x41')]){_0x145854[_0x35fc('0x42')]=_[_0x35fc('0x43')](_0x145854[_0x35fc('0x42')],{'$or':_[_0x35fc('0x44')](_0x145854[_0x35fc('0x3b')],function(_0x27071b){var _0x2127e0={};_0x2127e0[_0x27071b]={'$like':'%'+_0x444d7e[_0x35fc('0x37')]['filter']+'%'};return _0x2127e0;})});}_0x145854=_[_0x35fc('0x43')]({},_0x145854,_0x444d7e['options']);return _0x538be0[_0x35fc('0x51')](_0x145854);}})[_0x35fc('0x2e')](function(_0x2ac8e1){if(_0x2ac8e1){_0x2d9d45=_0x2ac8e1[_0x35fc('0x3c')];if(!_0x444d7e['query'][_0x35fc('0x52')]('nolimit')){_0x145854['limit']=qs['limit'](_0x444d7e[_0x35fc('0x37')]['limit']);_0x145854[_0x35fc('0x28')]=qs['offset'](_0x444d7e[_0x35fc('0x37')]['offset']);}return _0x538be0[_0x35fc('0x51')](_0x145854);}})[_0x35fc('0x2e')](function(_0x3400f0){if(_0x3400f0){return _0x3400f0?{'count':_0x2d9d45,'rows':_0x3400f0}:null;}})[_0x35fc('0x2e')](respondWithResult(_0x1f89b3,null))['catch'](handleError(_0x1f89b3,null));};exports[_0x35fc('0x53')]=function(_0x1e2214,_0x184057,_0x5df92d){var _0x3aa7fa={};var _0x8a4a13={};var _0x37764b;var _0x3c1b56;return db[_0x35fc('0x34')][_0x35fc('0x4f')]({'where':{'id':_0x1e2214[_0x35fc('0x49')]['id']}})[_0x35fc('0x2e')](handleEntityNotFound(_0x184057,null))['then'](function(_0x28a44b){if(_0x28a44b){_0x37764b=_0x28a44b;_0x8a4a13[_0x35fc('0x3d')]=_[_0x35fc('0x36')](db['SalesforceField'][_0x35fc('0x35')]);_0x8a4a13[_0x35fc('0x37')]=_['keys'](_0x1e2214['query']);_0x8a4a13[_0x35fc('0x38')]=_['intersection'](_0x8a4a13[_0x35fc('0x3d')],_0x8a4a13[_0x35fc('0x37')]);_0x3aa7fa[_0x35fc('0x3b')]=_[_0x35fc('0x39')](_0x8a4a13[_0x35fc('0x3d')],qs[_0x35fc('0x3a')](_0x1e2214[_0x35fc('0x37')][_0x35fc('0x3a')]));_0x3aa7fa[_0x35fc('0x3b')]=_0x3aa7fa[_0x35fc('0x3b')][_0x35fc('0x3c')]?_0x3aa7fa[_0x35fc('0x3b')]:_0x8a4a13[_0x35fc('0x3d')];_0x3aa7fa[_0x35fc('0x54')]=qs[_0x35fc('0x3f')](_0x1e2214[_0x35fc('0x37')][_0x35fc('0x3f')]);_0x3aa7fa[_0x35fc('0x42')]=qs[_0x35fc('0x38')](_[_0x35fc('0x40')](_0x1e2214['query'],_0x8a4a13[_0x35fc('0x38')]));if(_0x1e2214['query'][_0x35fc('0x41')]){_0x3aa7fa[_0x35fc('0x42')]=_[_0x35fc('0x43')](_0x3aa7fa[_0x35fc('0x42')],{'$or':_[_0x35fc('0x44')](_0x3aa7fa[_0x35fc('0x3b')],function(_0x2913ba){var _0x32023a={};_0x32023a[_0x2913ba]={'$like':'%'+_0x1e2214[_0x35fc('0x37')][_0x35fc('0x41')]+'%'};return _0x32023a;})});}_0x3aa7fa=_[_0x35fc('0x43')]({},_0x3aa7fa,_0x1e2214['options']);return _0x37764b[_0x35fc('0x53')](_0x3aa7fa);}})[_0x35fc('0x2e')](function(_0x2c1bd2){if(_0x2c1bd2){_0x3c1b56=_0x2c1bd2[_0x35fc('0x3c')];if(!_0x1e2214[_0x35fc('0x37')][_0x35fc('0x52')]('nolimit')){_0x3aa7fa[_0x35fc('0x29')]=qs[_0x35fc('0x29')](_0x1e2214[_0x35fc('0x37')][_0x35fc('0x29')]);_0x3aa7fa[_0x35fc('0x28')]=qs[_0x35fc('0x28')](_0x1e2214[_0x35fc('0x37')][_0x35fc('0x28')]);}return _0x37764b[_0x35fc('0x53')](_0x3aa7fa);}})['then'](function(_0x28f02b){if(_0x28f02b){return _0x28f02b?{'count':_0x3c1b56,'rows':_0x28f02b}:null;}})['then'](respondWithResult(_0x184057,null))[_0x35fc('0x22')](handleError(_0x184057,null));};exports[_0x35fc('0x55')]=function(_0x52272e,_0x1ce050,_0x41002a){var _0xcaa49={};var _0x4274d6={};var _0x4026cc;var _0x1a765f;return db[_0x35fc('0x34')][_0x35fc('0x4f')]({'where':{'id':_0x52272e[_0x35fc('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ce050,null))['then'](function(_0x4e7c7b){if(_0x4e7c7b){_0x4026cc=_0x4e7c7b;_0x4274d6['model']=_[_0x35fc('0x36')](db[_0x35fc('0x50')][_0x35fc('0x35')]);_0x4274d6[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x52272e['query']);_0x4274d6[_0x35fc('0x38')]=_[_0x35fc('0x39')](_0x4274d6[_0x35fc('0x3d')],_0x4274d6[_0x35fc('0x37')]);_0xcaa49['attributes']=_[_0x35fc('0x39')](_0x4274d6[_0x35fc('0x3d')],qs[_0x35fc('0x3a')](_0x52272e['query'][_0x35fc('0x3a')]));_0xcaa49[_0x35fc('0x3b')]=_0xcaa49[_0x35fc('0x3b')][_0x35fc('0x3c')]?_0xcaa49[_0x35fc('0x3b')]:_0x4274d6[_0x35fc('0x3d')];_0xcaa49[_0x35fc('0x54')]=qs[_0x35fc('0x3f')](_0x52272e['query'][_0x35fc('0x3f')]);_0xcaa49[_0x35fc('0x42')]=qs[_0x35fc('0x38')](_[_0x35fc('0x40')](_0x52272e[_0x35fc('0x37')],_0x4274d6[_0x35fc('0x38')]));if(_0x52272e['query'][_0x35fc('0x41')]){_0xcaa49['where']=_['merge'](_0xcaa49[_0x35fc('0x42')],{'$or':_['map'](_0xcaa49[_0x35fc('0x3b')],function(_0x233b7d){var _0x2885b9={};_0x2885b9[_0x233b7d]={'$like':'%'+_0x52272e['query'][_0x35fc('0x41')]+'%'};return _0x2885b9;})});}_0xcaa49=_[_0x35fc('0x43')]({},_0xcaa49,_0x52272e[_0x35fc('0x46')]);return _0x4026cc[_0x35fc('0x55')](_0xcaa49);}})[_0x35fc('0x2e')](function(_0x5abdf9){if(_0x5abdf9){_0x1a765f=_0x5abdf9['length'];if(!_0x52272e['query'][_0x35fc('0x52')]('nolimit')){_0xcaa49[_0x35fc('0x29')]=qs[_0x35fc('0x29')](_0x52272e[_0x35fc('0x37')][_0x35fc('0x29')]);_0xcaa49['offset']=qs[_0x35fc('0x28')](_0x52272e[_0x35fc('0x37')][_0x35fc('0x28')]);}return _0x4026cc['getDescriptions'](_0xcaa49);}})[_0x35fc('0x2e')](function(_0x175cc7){if(_0x175cc7){return _0x175cc7?{'count':_0x1a765f,'rows':_0x175cc7}:null;}})[_0x35fc('0x2e')](respondWithResult(_0x1ce050,null))['catch'](handleError(_0x1ce050,null));}; \ No newline at end of file +var _0x7217=['offset','limit','set','Content-Range','reject','destroy','stack','name','send','index','SalesforceConfiguration','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','getFields','hasOwnProperty','getSubjects','findOne','SalesforceField','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','then','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','SalesforceConfiguration,\x20%s,\x20%s','result','sendStatus','status','end','json'];(function(_0x3a2ed1,_0x1a5716){var _0x2e01b4=function(_0x198a1e){while(--_0x198a1e){_0x3a2ed1['push'](_0x3a2ed1['shift']());}};_0x2e01b4(++_0x1a5716);}(_0x7217,0x19e));var _0x7721=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x7217[_0x6c993a];return _0x27f547;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var authService=require(_0x7721('0x12'));var hardwareService=require(_0x7721('0x13'));var Redis=require('ioredis');var qs=require(_0x7721('0x14'));var logger=require(_0x7721('0x15'))(_0x7721('0x16'));var utils=require(_0x7721('0x17'));var config=require(_0x7721('0x18'));var db=require(_0x7721('0x19'))['db'];var jayson=require(_0x7721('0x1a'));var client=jayson[_0x7721('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2911ec,_0x199930,_0x57ff6d,_0x109900){return new BPromise(function(_0x30da54,_0x3f01c5){var _0x2e9752=_0x109900||client;return _0x2e9752['request'](_0x2911ec,_0x57ff6d)[_0x7721('0x1c')](function(_0x25b1c0){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x199930,'request\x20sent');logger[_0x7721('0x1d')](_0x7721('0x1e'),_0x199930,_0x7721('0x1f'),JSON[_0x7721('0x20')](_0x25b1c0));if(_0x25b1c0['error']){if(_0x25b1c0[_0x7721('0x21')]['code']===0x1f4){logger[_0x7721('0x21')]('SalesforceConfiguration,\x20%s,\x20%s',_0x199930,_0x25b1c0[_0x7721('0x21')][_0x7721('0x22')]);return _0x3f01c5(_0x25b1c0[_0x7721('0x21')][_0x7721('0x22')]);}logger[_0x7721('0x21')](_0x7721('0x23'),_0x199930,_0x25b1c0[_0x7721('0x21')][_0x7721('0x22')]);return _0x30da54(_0x25b1c0[_0x7721('0x21')][_0x7721('0x22')]);}else{logger['info'](_0x7721('0x23'),_0x199930,_0x7721('0x1f'));_0x30da54(_0x25b1c0[_0x7721('0x24')][_0x7721('0x22')]);}})['catch'](function(_0x28f5a6){logger['error'](_0x7721('0x23'),_0x199930,_0x28f5a6);_0x3f01c5(_0x28f5a6);});});}function respondWithStatusCode(_0x288e3a,_0x3e8a4e){_0x3e8a4e=_0x3e8a4e||0xcc;return function(_0x1caad8){if(_0x1caad8){return _0x288e3a[_0x7721('0x25')](_0x3e8a4e);}return _0x288e3a[_0x7721('0x26')](_0x3e8a4e)[_0x7721('0x27')]();};}function respondWithResult(_0x5b4d74,_0x216f20){_0x216f20=_0x216f20||0xc8;return function(_0x1abedb){if(_0x1abedb){return _0x5b4d74[_0x7721('0x26')](_0x216f20)[_0x7721('0x28')](_0x1abedb);}};}function respondWithFilteredResult(_0x40d550,_0x16355a){return function(_0x424e05){if(_0x424e05){var _0xf753f1=_0x424e05['count'],_0x40f367=_0x16355a['offset'],_0x52316e=_0x16355a[_0x7721('0x29')]+_0x16355a[_0x7721('0x2a')],_0x258ddf;if(_0x52316e>=_0xf753f1){_0x52316e=_0xf753f1;_0x258ddf=0xc8;}else{_0x258ddf=0xce;}_0x40d550[_0x7721('0x26')](_0x258ddf);return _0x40d550[_0x7721('0x2b')](_0x7721('0x2c'),_0x40f367+'-'+_0x52316e+'/'+_0xf753f1)[_0x7721('0x28')](_0x424e05);}return null;};}function patchUpdates(_0xd7d703){return function(_0x1da2d8){try{jsonpatch['apply'](_0x1da2d8,_0xd7d703,!![]);}catch(_0x471651){return BPromise[_0x7721('0x2d')](_0x471651);}return _0x1da2d8['save']();};}function saveUpdates(_0x4a25c9,_0xfde9ec){return function(_0x220bbf){if(_0x220bbf){return _0x220bbf['update'](_0x4a25c9)[_0x7721('0x1c')](function(_0x4651b5){return _0x4651b5;});}return null;};}function removeEntity(_0x382821,_0x58d54b){return function(_0x3d9a32){if(_0x3d9a32){return _0x3d9a32[_0x7721('0x2e')]()[_0x7721('0x1c')](function(){_0x382821[_0x7721('0x26')](0xcc)[_0x7721('0x27')]();});}};}function handleEntityNotFound(_0x508202,_0x195ffb){return function(_0x3e4e56){if(!_0x3e4e56){_0x508202[_0x7721('0x25')](0x194);}return _0x3e4e56;};}function handleError(_0x5c5b33,_0x35de7a){_0x35de7a=_0x35de7a||0x1f4;return function(_0x213a2e){logger['error'](_0x213a2e[_0x7721('0x2f')]);if(_0x213a2e['name']){delete _0x213a2e[_0x7721('0x30')];}_0x5c5b33[_0x7721('0x26')](_0x35de7a)[_0x7721('0x31')](_0x213a2e);};}exports[_0x7721('0x32')]=function(_0x1c84c0,_0x13c635){var _0x2f1fe0={},_0x15545a={},_0x25bdd9={'count':0x0,'rows':[]};var _0x3a2eb7=db[_0x7721('0x33')]['rawAttributes'];_0x15545a[_0x7721('0x34')]=_['keys'](_0x3a2eb7);_0x15545a[_0x7721('0x35')]=_[_0x7721('0x36')](_0x1c84c0[_0x7721('0x35')]);_0x15545a[_0x7721('0x37')]=_[_0x7721('0x38')](_0x15545a[_0x7721('0x34')],_0x15545a['query']);_0x2f1fe0['attributes']=_['intersection'](_0x15545a['model'],qs[_0x7721('0x39')](_0x1c84c0[_0x7721('0x35')][_0x7721('0x39')]));_0x2f1fe0[_0x7721('0x3a')]=_0x2f1fe0['attributes'][_0x7721('0x3b')]?_0x2f1fe0['attributes']:_0x15545a[_0x7721('0x34')];if(!_0x1c84c0[_0x7721('0x35')]['hasOwnProperty'](_0x7721('0x3c'))){_0x2f1fe0[_0x7721('0x2a')]=qs['limit'](_0x1c84c0['query'][_0x7721('0x2a')]);_0x2f1fe0[_0x7721('0x29')]=qs[_0x7721('0x29')](_0x1c84c0[_0x7721('0x35')]['offset']);}_0x2f1fe0[_0x7721('0x3d')]=qs[_0x7721('0x3e')](_0x1c84c0[_0x7721('0x35')][_0x7721('0x3e')]);_0x2f1fe0[_0x7721('0x3f')]=qs['filters'](_[_0x7721('0x40')](_0x1c84c0['query'],_0x15545a[_0x7721('0x37')]));if(_0x1c84c0['query'][_0x7721('0x41')]){_0x2f1fe0[_0x7721('0x3f')]=_[_0x7721('0x42')](_0x2f1fe0['where'],{'$or':_[_0x7721('0x43')](_0x3a2eb7,function(_0x11d853){if(_0x11d853[_0x7721('0x44')]['key']!==_0x7721('0x45')){var _0x754071={};_0x754071[_0x11d853[_0x7721('0x46')]]={'$like':'%'+_0x1c84c0[_0x7721('0x35')][_0x7721('0x41')]+'%'};return _0x754071;}})});}_0x2f1fe0=_[_0x7721('0x42')]({},_0x2f1fe0,_0x1c84c0[_0x7721('0x47')]);var _0x4c76c3={'where':_0x2f1fe0['where']};return db[_0x7721('0x33')][_0x7721('0x48')](_0x4c76c3)[_0x7721('0x1c')](function(_0x39a3ad){_0x25bdd9[_0x7721('0x48')]=_0x39a3ad;if(_0x1c84c0[_0x7721('0x35')][_0x7721('0x49')]){_0x2f1fe0[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x33')][_0x7721('0x4b')](_0x2f1fe0);})['then'](function(_0x578867){_0x25bdd9[_0x7721('0x4c')]=_0x578867;return _0x25bdd9;})[_0x7721('0x1c')](respondWithFilteredResult(_0x13c635,_0x2f1fe0))[_0x7721('0x4d')](handleError(_0x13c635,null));};exports[_0x7721('0x4e')]=function(_0x589e95,_0x30107e){var _0x2d5a88={'raw':![],'where':{'id':_0x589e95[_0x7721('0x4f')]['id']}},_0x56c3d9={};_0x56c3d9['model']=_[_0x7721('0x36')](db['SalesforceConfiguration'][_0x7721('0x50')]);_0x56c3d9[_0x7721('0x35')]=_[_0x7721('0x36')](_0x589e95['query']);_0x56c3d9[_0x7721('0x37')]=_[_0x7721('0x38')](_0x56c3d9['model'],_0x56c3d9[_0x7721('0x35')]);_0x2d5a88[_0x7721('0x3a')]=_[_0x7721('0x38')](_0x56c3d9['model'],qs[_0x7721('0x39')](_0x589e95['query'][_0x7721('0x39')]));_0x2d5a88[_0x7721('0x3a')]=_0x2d5a88[_0x7721('0x3a')][_0x7721('0x3b')]?_0x2d5a88[_0x7721('0x3a')]:_0x56c3d9[_0x7721('0x34')];if(_0x589e95[_0x7721('0x35')][_0x7721('0x49')]){_0x2d5a88[_0x7721('0x4a')]=[{'all':!![]}];}_0x2d5a88=_[_0x7721('0x42')]({},_0x2d5a88,_0x589e95[_0x7721('0x47')]);return db[_0x7721('0x33')][_0x7721('0x51')](_0x2d5a88)[_0x7721('0x1c')](handleEntityNotFound(_0x30107e,null))[_0x7721('0x1c')](respondWithResult(_0x30107e,null))['catch'](handleError(_0x30107e,null));};exports[_0x7721('0x52')]=function(_0x2f6f30,_0x8e1214){return db[_0x7721('0x33')][_0x7721('0x52')](_0x2f6f30[_0x7721('0x53')],{})[_0x7721('0x1c')](respondWithResult(_0x8e1214,0xc9))['catch'](handleError(_0x8e1214,null));};exports[_0x7721('0x54')]=function(_0x17036e,_0x134908){if(_0x17036e[_0x7721('0x53')]['id']){delete _0x17036e[_0x7721('0x53')]['id'];}return db[_0x7721('0x33')][_0x7721('0x51')]({'where':{'id':_0x17036e[_0x7721('0x4f')]['id']}})[_0x7721('0x1c')](handleEntityNotFound(_0x134908,null))[_0x7721('0x1c')](saveUpdates(_0x17036e[_0x7721('0x53')],null))['then'](respondWithResult(_0x134908,null))[_0x7721('0x4d')](handleError(_0x134908,null));};exports[_0x7721('0x2e')]=function(_0x1234bc,_0x2ee3c0){return db[_0x7721('0x33')][_0x7721('0x51')]({'where':{'id':_0x1234bc[_0x7721('0x4f')]['id']}})[_0x7721('0x1c')](handleEntityNotFound(_0x2ee3c0,null))[_0x7721('0x1c')](removeEntity(_0x2ee3c0,null))[_0x7721('0x4d')](handleError(_0x2ee3c0,null));};exports[_0x7721('0x55')]=function(_0x2e5c28,_0x106664,_0x18f7f6){var _0x300ea4={};var _0x577f47={};var _0x50e9e9;var _0x4e112e;return db[_0x7721('0x33')]['findOne']({'where':{'id':_0x2e5c28['params']['id']}})['then'](handleEntityNotFound(_0x106664,null))['then'](function(_0x47925a){if(_0x47925a){_0x50e9e9=_0x47925a;_0x577f47[_0x7721('0x34')]=_[_0x7721('0x36')](db['SalesforceField'][_0x7721('0x50')]);_0x577f47['query']=_['keys'](_0x2e5c28['query']);_0x577f47[_0x7721('0x37')]=_['intersection'](_0x577f47['model'],_0x577f47['query']);_0x300ea4[_0x7721('0x3a')]=_[_0x7721('0x38')](_0x577f47[_0x7721('0x34')],qs['fields'](_0x2e5c28[_0x7721('0x35')][_0x7721('0x39')]));_0x300ea4[_0x7721('0x3a')]=_0x300ea4[_0x7721('0x3a')][_0x7721('0x3b')]?_0x300ea4[_0x7721('0x3a')]:_0x577f47[_0x7721('0x34')];_0x300ea4[_0x7721('0x3d')]=qs[_0x7721('0x3e')](_0x2e5c28[_0x7721('0x35')][_0x7721('0x3e')]);_0x300ea4[_0x7721('0x3f')]=qs[_0x7721('0x37')](_[_0x7721('0x40')](_0x2e5c28[_0x7721('0x35')],_0x577f47['filters']));if(_0x2e5c28[_0x7721('0x35')][_0x7721('0x41')]){_0x300ea4[_0x7721('0x3f')]=_[_0x7721('0x42')](_0x300ea4['where'],{'$or':_[_0x7721('0x43')](_0x300ea4[_0x7721('0x3a')],function(_0x4c8284){var _0x3e7df3={};_0x3e7df3[_0x4c8284]={'$like':'%'+_0x2e5c28['query'][_0x7721('0x41')]+'%'};return _0x3e7df3;})});}_0x300ea4=_[_0x7721('0x42')]({},_0x300ea4,_0x2e5c28[_0x7721('0x47')]);return _0x50e9e9[_0x7721('0x55')](_0x300ea4);}})[_0x7721('0x1c')](function(_0x158aae){if(_0x158aae){_0x4e112e=_0x158aae[_0x7721('0x3b')];if(!_0x2e5c28[_0x7721('0x35')][_0x7721('0x56')]('nolimit')){_0x300ea4[_0x7721('0x2a')]=qs[_0x7721('0x2a')](_0x2e5c28[_0x7721('0x35')][_0x7721('0x2a')]);_0x300ea4[_0x7721('0x29')]=qs[_0x7721('0x29')](_0x2e5c28[_0x7721('0x35')]['offset']);}return _0x50e9e9[_0x7721('0x55')](_0x300ea4);}})[_0x7721('0x1c')](function(_0x53c918){if(_0x53c918){return _0x53c918?{'count':_0x4e112e,'rows':_0x53c918}:null;}})[_0x7721('0x1c')](respondWithResult(_0x106664,null))['catch'](handleError(_0x106664,null));};exports[_0x7721('0x57')]=function(_0x382800,_0x4282ba,_0x3b64ec){var _0x1e2436={};var _0x2bab14={};var _0x258c57;var _0x5dca04;return db[_0x7721('0x33')][_0x7721('0x58')]({'where':{'id':_0x382800[_0x7721('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4282ba,null))['then'](function(_0x515fb9){if(_0x515fb9){_0x258c57=_0x515fb9;_0x2bab14['model']=_['keys'](db[_0x7721('0x59')][_0x7721('0x50')]);_0x2bab14['query']=_[_0x7721('0x36')](_0x382800[_0x7721('0x35')]);_0x2bab14[_0x7721('0x37')]=_[_0x7721('0x38')](_0x2bab14['model'],_0x2bab14[_0x7721('0x35')]);_0x1e2436[_0x7721('0x3a')]=_[_0x7721('0x38')](_0x2bab14[_0x7721('0x34')],qs[_0x7721('0x39')](_0x382800['query'][_0x7721('0x39')]));_0x1e2436[_0x7721('0x3a')]=_0x1e2436[_0x7721('0x3a')]['length']?_0x1e2436['attributes']:_0x2bab14[_0x7721('0x34')];_0x1e2436[_0x7721('0x3d')]=qs[_0x7721('0x3e')](_0x382800[_0x7721('0x35')][_0x7721('0x3e')]);_0x1e2436['where']=qs['filters'](_[_0x7721('0x40')](_0x382800[_0x7721('0x35')],_0x2bab14[_0x7721('0x37')]));if(_0x382800[_0x7721('0x35')][_0x7721('0x41')]){_0x1e2436[_0x7721('0x3f')]=_[_0x7721('0x42')](_0x1e2436['where'],{'$or':_[_0x7721('0x43')](_0x1e2436[_0x7721('0x3a')],function(_0x27d7f1){var _0x5e85d9={};_0x5e85d9[_0x27d7f1]={'$like':'%'+_0x382800[_0x7721('0x35')][_0x7721('0x41')]+'%'};return _0x5e85d9;})});}_0x1e2436=_[_0x7721('0x42')]({},_0x1e2436,_0x382800[_0x7721('0x47')]);return _0x258c57['getSubjects'](_0x1e2436);}})['then'](function(_0x37f8f8){if(_0x37f8f8){_0x5dca04=_0x37f8f8[_0x7721('0x3b')];if(!_0x382800[_0x7721('0x35')][_0x7721('0x56')](_0x7721('0x3c'))){_0x1e2436[_0x7721('0x2a')]=qs['limit'](_0x382800[_0x7721('0x35')][_0x7721('0x2a')]);_0x1e2436[_0x7721('0x29')]=qs['offset'](_0x382800[_0x7721('0x35')][_0x7721('0x29')]);}return _0x258c57[_0x7721('0x57')](_0x1e2436);}})[_0x7721('0x1c')](function(_0x457d7f){if(_0x457d7f){return _0x457d7f?{'count':_0x5dca04,'rows':_0x457d7f}:null;}})['then'](respondWithResult(_0x4282ba,null))[_0x7721('0x4d')](handleError(_0x4282ba,null));};exports['getDescriptions']=function(_0x12a3f7,_0x47764b,_0x2d5433){var _0x7f0598={};var _0x963dbe={};var _0x438b9f;var _0x24fe2a;return db[_0x7721('0x33')][_0x7721('0x58')]({'where':{'id':_0x12a3f7[_0x7721('0x4f')]['id']}})[_0x7721('0x1c')](handleEntityNotFound(_0x47764b,null))['then'](function(_0x19fad6){if(_0x19fad6){_0x438b9f=_0x19fad6;_0x963dbe[_0x7721('0x34')]=_[_0x7721('0x36')](db['SalesforceField'][_0x7721('0x50')]);_0x963dbe[_0x7721('0x35')]=_[_0x7721('0x36')](_0x12a3f7[_0x7721('0x35')]);_0x963dbe[_0x7721('0x37')]=_['intersection'](_0x963dbe[_0x7721('0x34')],_0x963dbe[_0x7721('0x35')]);_0x7f0598[_0x7721('0x3a')]=_[_0x7721('0x38')](_0x963dbe[_0x7721('0x34')],qs[_0x7721('0x39')](_0x12a3f7['query'][_0x7721('0x39')]));_0x7f0598[_0x7721('0x3a')]=_0x7f0598['attributes'][_0x7721('0x3b')]?_0x7f0598['attributes']:_0x963dbe[_0x7721('0x34')];_0x7f0598[_0x7721('0x3d')]=qs['sort'](_0x12a3f7[_0x7721('0x35')]['sort']);_0x7f0598['where']=qs['filters'](_[_0x7721('0x40')](_0x12a3f7[_0x7721('0x35')],_0x963dbe[_0x7721('0x37')]));if(_0x12a3f7['query']['filter']){_0x7f0598['where']=_[_0x7721('0x42')](_0x7f0598[_0x7721('0x3f')],{'$or':_[_0x7721('0x43')](_0x7f0598[_0x7721('0x3a')],function(_0x3b02d7){var _0x259ee8={};_0x259ee8[_0x3b02d7]={'$like':'%'+_0x12a3f7['query'][_0x7721('0x41')]+'%'};return _0x259ee8;})});}_0x7f0598=_[_0x7721('0x42')]({},_0x7f0598,_0x12a3f7[_0x7721('0x47')]);return _0x438b9f[_0x7721('0x5a')](_0x7f0598);}})[_0x7721('0x1c')](function(_0x1a0232){if(_0x1a0232){_0x24fe2a=_0x1a0232[_0x7721('0x3b')];if(!_0x12a3f7[_0x7721('0x35')][_0x7721('0x56')](_0x7721('0x3c'))){_0x7f0598[_0x7721('0x2a')]=qs[_0x7721('0x2a')](_0x12a3f7['query']['limit']);_0x7f0598[_0x7721('0x29')]=qs[_0x7721('0x29')](_0x12a3f7['query'][_0x7721('0x29')]);}return _0x438b9f['getDescriptions'](_0x7f0598);}})['then'](function(_0x154b4b){if(_0x154b4b){return _0x154b4b?{'count':_0x24fe2a,'rows':_0x154b4b}:null;}})['then'](respondWithResult(_0x47764b,null))['catch'](handleError(_0x47764b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 831d546..ce92b04 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 _0x7e87=['util','../../config/logger','api','moment','bluebird','request-promise','exports','define','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0x7e87,0x172));var _0x77e8=function(_0x505937,_0x48b31b){_0x505937=_0x505937-0x0;var _0x4b9d70=_0x7e87[_0x505937];return _0x4b9d70;};'use strict';var _=require('lodash');var util=require(_0x77e8('0x0'));var logger=require(_0x77e8('0x1'))(_0x77e8('0x2'));var moment=require(_0x77e8('0x3'));var BPromise=require(_0x77e8('0x4'));var rp=require(_0x77e8('0x5'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x77e8('0x6')]=function(_0x348faa,_0x2ae21c){return _0x348faa[_0x77e8('0x7')](_0x77e8('0x8'),attributes,{'tableName':_0x77e8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed8c=['exports','define','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xf0a8c4,_0xf33a36){var _0x4ac614=function(_0x5aefa4){while(--_0x5aefa4){_0xf0a8c4['push'](_0xf0a8c4['shift']());}};_0x4ac614(++_0xf33a36);}(_0xed8c,0x135));var _0xced8=function(_0x14a821,_0x415614){_0x14a821=_0x14a821-0x0;var _0x401a41=_0xed8c[_0x14a821];return _0x401a41;};'use strict';var _=require(_0xced8('0x0'));var util=require(_0xced8('0x1'));var logger=require(_0xced8('0x2'))(_0xced8('0x3'));var moment=require(_0xced8('0x4'));var BPromise=require(_0xced8('0x5'));var rp=require('request-promise');var attributes=require('./intSalesforceConfiguration.attributes');module[_0xced8('0x6')]=function(_0x46728e,_0x49a823){return _0x46728e[_0xced8('0x7')]('SalesforceConfiguration',attributes,{'tableName':_0xced8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 92441a4..f769e5f 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 _0x814b=['info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x814b,0x1a2));var _0xb814=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0x814b[_0x15d18f];return _0xd12bf7;};'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')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x2abba6,_0x4aeadb){var _0x48e64a=function(_0x94f2f8){while(--_0x94f2f8){_0x2abba6['push'](_0x2abba6['shift']());}};_0x48e64a(++_0x4aeadb);}(_0xe14b,0x93));var _0xbe14=function(_0x218956,_0x13b2ae){_0x218956=_0x218956-0x0;var _0x868dd1=_0xe14b[_0x218956];return _0x868dd1;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 917dff7..481824a 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 _0xa004=['show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index'];(function(_0x50302e,_0x5c93d1){var _0x18bd13=function(_0x29aa44){while(--_0x29aa44){_0x50302e['push'](_0x50302e['shift']());}};_0x18bd13(++_0x5c93d1);}(_0xa004,0x8d));var _0x4a00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa004[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4a00('0x0'));var util=require(_0x4a00('0x1'));var path=require(_0x4a00('0x2'));var timeout=require(_0x4a00('0x3'));var express=require(_0x4a00('0x4'));var router=express[_0x4a00('0x5')]();var auth=require(_0x4a00('0x6'));var interaction=require(_0x4a00('0x7'));var config=require(_0x4a00('0x8'));var controller=require(_0x4a00('0x9'));router[_0x4a00('0xa')]('/',auth[_0x4a00('0xb')](),controller[_0x4a00('0xc')]);router[_0x4a00('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4a00('0xd')]);router[_0x4a00('0xe')]('/',auth['isAuthenticated'](),controller[_0x4a00('0xf')]);router[_0x4a00('0x10')]('/:id',auth[_0x4a00('0xb')](),controller[_0x4a00('0x11')]);router[_0x4a00('0x12')](_0x4a00('0x13'),auth[_0x4a00('0xb')](),controller[_0x4a00('0x14')]);module[_0x4a00('0x15')]=router; \ No newline at end of file +var _0xacd7=['get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller'];(function(_0x26eda0,_0x2cd87b){var _0x26ec70=function(_0x57af2d){while(--_0x57af2d){_0x26eda0['push'](_0x26eda0['shift']());}};_0x26ec70(++_0x2cd87b);}(_0xacd7,0xbf));var _0x7acd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xacd7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7acd('0x0'));var util=require(_0x7acd('0x1'));var path=require(_0x7acd('0x2'));var timeout=require('connect-timeout');var express=require(_0x7acd('0x3'));var router=express[_0x7acd('0x4')]();var auth=require(_0x7acd('0x5'));var interaction=require(_0x7acd('0x6'));var config=require(_0x7acd('0x7'));var controller=require(_0x7acd('0x8'));router[_0x7acd('0x9')]('/',auth[_0x7acd('0xa')](),controller[_0x7acd('0xb')]);router[_0x7acd('0x9')](_0x7acd('0xc'),auth[_0x7acd('0xa')](),controller[_0x7acd('0xd')]);router[_0x7acd('0xe')]('/',auth[_0x7acd('0xa')](),controller['create']);router[_0x7acd('0xf')](_0x7acd('0xc'),auth[_0x7acd('0xa')](),controller[_0x7acd('0x10')]);router[_0x7acd('0x11')](_0x7acd('0xc'),auth[_0x7acd('0xa')](),controller[_0x7acd('0x12')]);module[_0x7acd('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 033f3f2..2295ded 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 _0xfdd1=['STRING','sequelize','exports','string','variable','keyValue'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfdd1,0xa9));var _0x1fdd=function(_0x2cdfa7,_0x34eeb6){_0x2cdfa7=_0x2cdfa7-0x0;var _0x23a81a=_0xfdd1[_0x2cdfa7];return _0x23a81a;};'use strict';var Sequelize=require(_0x1fdd('0x0'));module[_0x1fdd('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1fdd('0x2'),_0x1fdd('0x3'),'customVariable',_0x1fdd('0x4')),'defaultValue':_0x1fdd('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1fdd('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x1fdd('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x1fdd('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x1fdd('0x5')]}}; \ No newline at end of file +var _0xb020=['STRING','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x5b065e,_0x261d12){var _0x1a5df6=function(_0x3cc219){while(--_0x3cc219){_0x5b065e['push'](_0x5b065e['shift']());}};_0x1a5df6(++_0x261d12);}(_0xb020,0x86));var _0x0b02=function(_0x305486,_0x24acd4){_0x305486=_0x305486-0x0;var _0xa04940=_0xb020[_0x305486];return _0xa04940;};'use strict';var Sequelize=require(_0x0b02('0x0'));module['exports']={'type':{'type':Sequelize[_0x0b02('0x1')](_0x0b02('0x2'),_0x0b02('0x3'),_0x0b02('0x4'),_0x0b02('0x5')),'defaultValue':_0x0b02('0x2')},'content':{'type':Sequelize[_0x0b02('0x6')]},'key':{'type':Sequelize[_0x0b02('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x0b02('0x2'),_0x0b02('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x0b02('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 55e7674..b5696f8 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 _0x5ce1=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','index','SalesforceField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','key','field','options','findAll','catch','show','params','includeAll','include','create','body','destroy','find','eml-format'];(function(_0x124bfa,_0x257315){var _0x2a9424=function(_0x3322b7){while(--_0x3322b7){_0x124bfa['push'](_0x124bfa['shift']());}};_0x2a9424(++_0x257315);}(_0x5ce1,0xd4));var _0x15ce=function(_0x4f2862,_0x16ff3c){_0x4f2862=_0x4f2862-0x0;var _0x427280=_0x5ce1[_0x4f2862];return _0x427280;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x15ce('0x0'));var rimraf=require(_0x15ce('0x1'));var zipdir=require(_0x15ce('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x15ce('0x3'));var moment=require(_0x15ce('0x4'));var BPromise=require(_0x15ce('0x5'));var Mustache=require(_0x15ce('0x6'));var util=require(_0x15ce('0x7'));var path=require(_0x15ce('0x8'));var sox=require(_0x15ce('0x9'));var csv=require('to-csv');var ejs=require(_0x15ce('0xa'));var fs=require('fs');var _=require(_0x15ce('0xb'));var squel=require(_0x15ce('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x15ce('0xd'));var toCsv=require(_0x15ce('0xe'));var querystring=require(_0x15ce('0xf'));var Papa=require('papaparse');var authService=require(_0x15ce('0x10'));var hardwareService=require(_0x15ce('0x11'));var Redis=require(_0x15ce('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x15ce('0x13'))('api');var utils=require(_0x15ce('0x14'));var config=require(_0x15ce('0x15'));var db=require(_0x15ce('0x16'))['db'];function respondWithStatusCode(_0xc9a3da,_0x5bec54){_0x5bec54=_0x5bec54||0xcc;return function(_0x43ef54){if(_0x43ef54){return _0xc9a3da[_0x15ce('0x17')](_0x5bec54);}return _0xc9a3da[_0x15ce('0x18')](_0x5bec54)[_0x15ce('0x19')]();};}function respondWithResult(_0x52ca1f,_0x14ae67){_0x14ae67=_0x14ae67||0xc8;return function(_0x4de2bb){if(_0x4de2bb){return _0x52ca1f[_0x15ce('0x18')](_0x14ae67)[_0x15ce('0x1a')](_0x4de2bb);}};}function respondWithFilteredResult(_0x31febd,_0xb79ad1){return function(_0x3fbcd7){if(_0x3fbcd7){var _0x402f4c=_0x3fbcd7[_0x15ce('0x1b')],_0x41eee9=_0xb79ad1[_0x15ce('0x1c')],_0x42c0ad=_0xb79ad1[_0x15ce('0x1c')]+_0xb79ad1[_0x15ce('0x1d')],_0x3cef7b;if(_0x42c0ad>=_0x402f4c){_0x42c0ad=_0x402f4c;_0x3cef7b=0xc8;}else{_0x3cef7b=0xce;}_0x31febd['status'](_0x3cef7b);return _0x31febd[_0x15ce('0x1e')](_0x15ce('0x1f'),_0x41eee9+'-'+_0x42c0ad+'/'+_0x402f4c)[_0x15ce('0x1a')](_0x3fbcd7);}return null;};}function patchUpdates(_0x196035){return function(_0x5c93df){try{jsonpatch[_0x15ce('0x20')](_0x5c93df,_0x196035,!![]);}catch(_0x22e196){return BPromise[_0x15ce('0x21')](_0x22e196);}return _0x5c93df[_0x15ce('0x22')]();};}function saveUpdates(_0x1a781f,_0x2d6419){return function(_0x257668){if(_0x257668){return _0x257668[_0x15ce('0x23')](_0x1a781f)['then'](function(_0x40c538){return _0x40c538;});}return null;};}function removeEntity(_0x1f4f78,_0x414395){return function(_0x41518d){if(_0x41518d){return _0x41518d['destroy']()[_0x15ce('0x24')](function(){_0x1f4f78[_0x15ce('0x18')](0xcc)[_0x15ce('0x19')]();});}};}function handleEntityNotFound(_0x2a25e9,_0x2bffd9){return function(_0x146b3d){if(!_0x146b3d){_0x2a25e9[_0x15ce('0x17')](0x194);}return _0x146b3d;};}function handleError(_0x193d31,_0x9363c1){_0x9363c1=_0x9363c1||0x1f4;return function(_0xa98e97){logger[_0x15ce('0x25')](_0xa98e97[_0x15ce('0x26')]);if(_0xa98e97['name']){delete _0xa98e97['name'];}_0x193d31[_0x15ce('0x18')](_0x9363c1)['send'](_0xa98e97);};}exports[_0x15ce('0x27')]=function(_0x2e027d,_0x2b0f3d){var _0x29554e={},_0x3c5707={},_0x363d18={'count':0x0,'rows':[]};var _0x18407e=db[_0x15ce('0x28')][_0x15ce('0x29')];_0x3c5707[_0x15ce('0x2a')]=_[_0x15ce('0x2b')](_0x18407e);_0x3c5707[_0x15ce('0x2c')]=_[_0x15ce('0x2b')](_0x2e027d['query']);_0x3c5707[_0x15ce('0x2d')]=_[_0x15ce('0x2e')](_0x3c5707['model'],_0x3c5707['query']);_0x29554e[_0x15ce('0x2f')]=_[_0x15ce('0x2e')](_0x3c5707[_0x15ce('0x2a')],qs[_0x15ce('0x30')](_0x2e027d[_0x15ce('0x2c')]['fields']));_0x29554e[_0x15ce('0x2f')]=_0x29554e[_0x15ce('0x2f')][_0x15ce('0x31')]?_0x29554e[_0x15ce('0x2f')]:_0x3c5707[_0x15ce('0x2a')];if(!_0x2e027d[_0x15ce('0x2c')][_0x15ce('0x32')]('nolimit')){_0x29554e['limit']=qs[_0x15ce('0x1d')](_0x2e027d['query']['limit']);_0x29554e['offset']=qs[_0x15ce('0x1c')](_0x2e027d['query'][_0x15ce('0x1c')]);}_0x29554e['order']=qs[_0x15ce('0x33')](_0x2e027d['query'][_0x15ce('0x33')]);_0x29554e[_0x15ce('0x34')]=qs['filters'](_[_0x15ce('0x35')](_0x2e027d[_0x15ce('0x2c')],_0x3c5707[_0x15ce('0x2d')]));if(_0x2e027d['query'][_0x15ce('0x36')]){_0x29554e[_0x15ce('0x34')]=_[_0x15ce('0x37')](_0x29554e[_0x15ce('0x34')],{'$or':_[_0x15ce('0x38')](_0x18407e,function(_0x23c3e9){if(_0x23c3e9[_0x15ce('0x39')][_0x15ce('0x3a')]!=='VIRTUAL'){var _0x32d391={};_0x32d391[_0x23c3e9[_0x15ce('0x3b')]]={'$like':'%'+_0x2e027d[_0x15ce('0x2c')]['filter']+'%'};return _0x32d391;}})});}_0x29554e=_['merge']({},_0x29554e,_0x2e027d[_0x15ce('0x3c')]);var _0x28658={'where':_0x29554e['where']};return db[_0x15ce('0x28')][_0x15ce('0x1b')](_0x28658)[_0x15ce('0x24')](function(_0x3ac5db){_0x363d18['count']=_0x3ac5db;if(_0x2e027d[_0x15ce('0x2c')]['includeAll']){_0x29554e['include']=[{'all':!![]}];}return db[_0x15ce('0x28')][_0x15ce('0x3d')](_0x29554e);})['then'](function(_0x1b96a0){_0x363d18['rows']=_0x1b96a0;return _0x363d18;})['then'](respondWithFilteredResult(_0x2b0f3d,_0x29554e))[_0x15ce('0x3e')](handleError(_0x2b0f3d,null));};exports[_0x15ce('0x3f')]=function(_0x1dc09b,_0x359dc9){var _0x58db27={'raw':!![],'where':{'id':_0x1dc09b[_0x15ce('0x40')]['id']}},_0x12edb2={};_0x12edb2[_0x15ce('0x2a')]=_[_0x15ce('0x2b')](db[_0x15ce('0x28')][_0x15ce('0x29')]);_0x12edb2[_0x15ce('0x2c')]=_['keys'](_0x1dc09b[_0x15ce('0x2c')]);_0x12edb2['filters']=_[_0x15ce('0x2e')](_0x12edb2[_0x15ce('0x2a')],_0x12edb2[_0x15ce('0x2c')]);_0x58db27[_0x15ce('0x2f')]=_[_0x15ce('0x2e')](_0x12edb2[_0x15ce('0x2a')],qs['fields'](_0x1dc09b[_0x15ce('0x2c')][_0x15ce('0x30')]));_0x58db27['attributes']=_0x58db27[_0x15ce('0x2f')][_0x15ce('0x31')]?_0x58db27[_0x15ce('0x2f')]:_0x12edb2[_0x15ce('0x2a')];if(_0x1dc09b[_0x15ce('0x2c')][_0x15ce('0x41')]){_0x58db27[_0x15ce('0x42')]=[{'all':!![]}];}_0x58db27=_[_0x15ce('0x37')]({},_0x58db27,_0x1dc09b[_0x15ce('0x3c')]);return db[_0x15ce('0x28')]['find'](_0x58db27)[_0x15ce('0x24')](handleEntityNotFound(_0x359dc9,null))[_0x15ce('0x24')](respondWithResult(_0x359dc9,null))[_0x15ce('0x3e')](handleError(_0x359dc9,null));};exports[_0x15ce('0x43')]=function(_0x5afbbb,_0x5def59){return db[_0x15ce('0x28')][_0x15ce('0x43')](_0x5afbbb[_0x15ce('0x44')],{})['then'](respondWithResult(_0x5def59,0xc9))[_0x15ce('0x3e')](handleError(_0x5def59,null));};exports[_0x15ce('0x23')]=function(_0x44ff45,_0x15a8e0){if(_0x44ff45[_0x15ce('0x44')]['id']){delete _0x44ff45[_0x15ce('0x44')]['id'];}return db[_0x15ce('0x28')]['find']({'where':{'id':_0x44ff45[_0x15ce('0x40')]['id']}})[_0x15ce('0x24')](handleEntityNotFound(_0x15a8e0,null))[_0x15ce('0x24')](saveUpdates(_0x44ff45[_0x15ce('0x44')],null))['then'](respondWithResult(_0x15a8e0,null))[_0x15ce('0x3e')](handleError(_0x15a8e0,null));};exports[_0x15ce('0x45')]=function(_0x4155fa,_0x4dbed9){return db['SalesforceField'][_0x15ce('0x46')]({'where':{'id':_0x4155fa[_0x15ce('0x40')]['id']}})[_0x15ce('0x24')](handleEntityNotFound(_0x4dbed9,null))[_0x15ce('0x24')](removeEntity(_0x4dbed9,null))[_0x15ce('0x3e')](handleError(_0x4dbed9,null));}; \ No newline at end of file +var _0x86d2=['nolimit','order','where','filters','merge','map','type','VIRTUAL','field','filter','findAll','catch','show','params','include','options','find','create','body','eml-format','rimraf','fast-json-patch','moment','mustache','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/utils','../../config/environment','../../mysqldb','json','count','offset','limit','status','set','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','SalesforceField','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty'];(function(_0x31852b,_0x5ca827){var _0x2da2ac=function(_0x168a9b){while(--_0x168a9b){_0x31852b['push'](_0x31852b['shift']());}};_0x2da2ac(++_0x5ca827);}(_0x86d2,0x15d));var _0x286d=function(_0x1e7135,_0x2f7024){_0x1e7135=_0x1e7135-0x0;var _0x5e72d3=_0x86d2[_0x1e7135];return _0x5e72d3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x286d('0x0'));var rimraf=require(_0x286d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x286d('0x2'));var rp=require('request-promise');var moment=require(_0x286d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x286d('0x4'));var util=require('util');var path=require(_0x286d('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x286d('0x6'));var fs=require('fs');var _=require(_0x286d('0x7'));var squel=require('squel');var crypto=require(_0x286d('0x8'));var jsforce=require(_0x286d('0x9'));var deskjs=require(_0x286d('0xa'));var toCsv=require(_0x286d('0xb'));var querystring=require(_0x286d('0xc'));var Papa=require('papaparse');var authService=require(_0x286d('0xd'));var hardwareService=require(_0x286d('0xe'));var Redis=require(_0x286d('0xf'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x286d('0x10'));var utils=require(_0x286d('0x11'));var config=require(_0x286d('0x12'));var db=require(_0x286d('0x13'))['db'];function respondWithStatusCode(_0x7acc87,_0x27231c){_0x27231c=_0x27231c||0xcc;return function(_0xd36fd8){if(_0xd36fd8){return _0x7acc87['sendStatus'](_0x27231c);}return _0x7acc87['status'](_0x27231c)['end']();};}function respondWithResult(_0x4bac3a,_0x1d362b){_0x1d362b=_0x1d362b||0xc8;return function(_0x4100ee){if(_0x4100ee){return _0x4bac3a['status'](_0x1d362b)[_0x286d('0x14')](_0x4100ee);}};}function respondWithFilteredResult(_0x55bbce,_0x14fffe){return function(_0xce3051){if(_0xce3051){var _0x2e3870=_0xce3051[_0x286d('0x15')],_0x36bc48=_0x14fffe['offset'],_0x3537f7=_0x14fffe[_0x286d('0x16')]+_0x14fffe[_0x286d('0x17')],_0x2703d2;if(_0x3537f7>=_0x2e3870){_0x3537f7=_0x2e3870;_0x2703d2=0xc8;}else{_0x2703d2=0xce;}_0x55bbce[_0x286d('0x18')](_0x2703d2);return _0x55bbce[_0x286d('0x19')]('Content-Range',_0x36bc48+'-'+_0x3537f7+'/'+_0x2e3870)['json'](_0xce3051);}return null;};}function patchUpdates(_0x1196db){return function(_0x5ae5c3){try{jsonpatch[_0x286d('0x1a')](_0x5ae5c3,_0x1196db,!![]);}catch(_0x48a4bc){return BPromise[_0x286d('0x1b')](_0x48a4bc);}return _0x5ae5c3[_0x286d('0x1c')]();};}function saveUpdates(_0x52a9d4,_0xe022b5){return function(_0x389403){if(_0x389403){return _0x389403[_0x286d('0x1d')](_0x52a9d4)['then'](function(_0x94387e){return _0x94387e;});}return null;};}function removeEntity(_0x3e2f9c,_0x187e8a){return function(_0x5be548){if(_0x5be548){return _0x5be548[_0x286d('0x1e')]()[_0x286d('0x1f')](function(){_0x3e2f9c[_0x286d('0x18')](0xcc)[_0x286d('0x20')]();});}};}function handleEntityNotFound(_0x2c0bb4,_0x3920a4){return function(_0x46e4a1){if(!_0x46e4a1){_0x2c0bb4[_0x286d('0x21')](0x194);}return _0x46e4a1;};}function handleError(_0x189226,_0x30b6ee){_0x30b6ee=_0x30b6ee||0x1f4;return function(_0x7e1a95){logger[_0x286d('0x22')](_0x7e1a95[_0x286d('0x23')]);if(_0x7e1a95['name']){delete _0x7e1a95[_0x286d('0x24')];}_0x189226[_0x286d('0x18')](_0x30b6ee)['send'](_0x7e1a95);};}exports['index']=function(_0x30c9cf,_0x4bab7e){var _0xcbcda9={},_0x2e642d={},_0x1645b0={'count':0x0,'rows':[]};var _0x27521e=db[_0x286d('0x25')][_0x286d('0x26')];_0x2e642d['model']=_[_0x286d('0x27')](_0x27521e);_0x2e642d['query']=_['keys'](_0x30c9cf[_0x286d('0x28')]);_0x2e642d['filters']=_[_0x286d('0x29')](_0x2e642d[_0x286d('0x2a')],_0x2e642d[_0x286d('0x28')]);_0xcbcda9['attributes']=_[_0x286d('0x29')](_0x2e642d[_0x286d('0x2a')],qs['fields'](_0x30c9cf['query'][_0x286d('0x2b')]));_0xcbcda9[_0x286d('0x2c')]=_0xcbcda9['attributes'][_0x286d('0x2d')]?_0xcbcda9[_0x286d('0x2c')]:_0x2e642d[_0x286d('0x2a')];if(!_0x30c9cf[_0x286d('0x28')][_0x286d('0x2e')](_0x286d('0x2f'))){_0xcbcda9[_0x286d('0x17')]=qs[_0x286d('0x17')](_0x30c9cf[_0x286d('0x28')][_0x286d('0x17')]);_0xcbcda9[_0x286d('0x16')]=qs[_0x286d('0x16')](_0x30c9cf[_0x286d('0x28')][_0x286d('0x16')]);}_0xcbcda9[_0x286d('0x30')]=qs['sort'](_0x30c9cf[_0x286d('0x28')]['sort']);_0xcbcda9[_0x286d('0x31')]=qs[_0x286d('0x32')](_['pick'](_0x30c9cf[_0x286d('0x28')],_0x2e642d[_0x286d('0x32')]));if(_0x30c9cf[_0x286d('0x28')]['filter']){_0xcbcda9[_0x286d('0x31')]=_[_0x286d('0x33')](_0xcbcda9[_0x286d('0x31')],{'$or':_[_0x286d('0x34')](_0x27521e,function(_0x70e5f7){if(_0x70e5f7[_0x286d('0x35')]['key']!==_0x286d('0x36')){var _0x2455e2={};_0x2455e2[_0x70e5f7[_0x286d('0x37')]]={'$like':'%'+_0x30c9cf[_0x286d('0x28')][_0x286d('0x38')]+'%'};return _0x2455e2;}})});}_0xcbcda9=_[_0x286d('0x33')]({},_0xcbcda9,_0x30c9cf['options']);var _0x55910e={'where':_0xcbcda9[_0x286d('0x31')]};return db['SalesforceField'][_0x286d('0x15')](_0x55910e)[_0x286d('0x1f')](function(_0xd5db3b){_0x1645b0[_0x286d('0x15')]=_0xd5db3b;if(_0x30c9cf['query']['includeAll']){_0xcbcda9['include']=[{'all':!![]}];}return db[_0x286d('0x25')][_0x286d('0x39')](_0xcbcda9);})[_0x286d('0x1f')](function(_0x4d4949){_0x1645b0['rows']=_0x4d4949;return _0x1645b0;})[_0x286d('0x1f')](respondWithFilteredResult(_0x4bab7e,_0xcbcda9))[_0x286d('0x3a')](handleError(_0x4bab7e,null));};exports[_0x286d('0x3b')]=function(_0x316482,_0x248184){var _0x1bc6ca={'raw':!![],'where':{'id':_0x316482[_0x286d('0x3c')]['id']}},_0x49333f={};_0x49333f[_0x286d('0x2a')]=_[_0x286d('0x27')](db[_0x286d('0x25')]['rawAttributes']);_0x49333f[_0x286d('0x28')]=_['keys'](_0x316482[_0x286d('0x28')]);_0x49333f[_0x286d('0x32')]=_[_0x286d('0x29')](_0x49333f[_0x286d('0x2a')],_0x49333f[_0x286d('0x28')]);_0x1bc6ca[_0x286d('0x2c')]=_[_0x286d('0x29')](_0x49333f[_0x286d('0x2a')],qs[_0x286d('0x2b')](_0x316482[_0x286d('0x28')]['fields']));_0x1bc6ca[_0x286d('0x2c')]=_0x1bc6ca[_0x286d('0x2c')][_0x286d('0x2d')]?_0x1bc6ca['attributes']:_0x49333f['model'];if(_0x316482[_0x286d('0x28')]['includeAll']){_0x1bc6ca[_0x286d('0x3d')]=[{'all':!![]}];}_0x1bc6ca=_[_0x286d('0x33')]({},_0x1bc6ca,_0x316482[_0x286d('0x3e')]);return db[_0x286d('0x25')][_0x286d('0x3f')](_0x1bc6ca)[_0x286d('0x1f')](handleEntityNotFound(_0x248184,null))[_0x286d('0x1f')](respondWithResult(_0x248184,null))['catch'](handleError(_0x248184,null));};exports[_0x286d('0x40')]=function(_0x2dd28c,_0x40861f){return db[_0x286d('0x25')][_0x286d('0x40')](_0x2dd28c[_0x286d('0x41')],{})[_0x286d('0x1f')](respondWithResult(_0x40861f,0xc9))[_0x286d('0x3a')](handleError(_0x40861f,null));};exports[_0x286d('0x1d')]=function(_0xfcb44f,_0xf80c66){if(_0xfcb44f['body']['id']){delete _0xfcb44f[_0x286d('0x41')]['id'];}return db[_0x286d('0x25')]['find']({'where':{'id':_0xfcb44f[_0x286d('0x3c')]['id']}})['then'](handleEntityNotFound(_0xf80c66,null))[_0x286d('0x1f')](saveUpdates(_0xfcb44f[_0x286d('0x41')],null))['then'](respondWithResult(_0xf80c66,null))[_0x286d('0x3a')](handleError(_0xf80c66,null));};exports['destroy']=function(_0x5e3aa2,_0x4ce48d){return db['SalesforceField']['find']({'where':{'id':_0x5e3aa2[_0x286d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4ce48d,null))['then'](removeEntity(_0x4ce48d,null))[_0x286d('0x3a')](handleError(_0x4ce48d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index b095dfe..c802cf4 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 _0x09d1=['idField','lodash','util','api','moment','request-promise','exports','define','SalesforceField','salesforce_unique_index'];(function(_0x36fd0c,_0x3144df){var _0x1f8d06=function(_0xeb6e3a){while(--_0xeb6e3a){_0x36fd0c['push'](_0x36fd0c['shift']());}};_0x1f8d06(++_0x3144df);}(_0x09d1,0x191));var _0x109d=function(_0x45b55d,_0x9b081d){_0x45b55d=_0x45b55d-0x0;var _0x4e8533=_0x09d1[_0x45b55d];return _0x4e8533;};'use strict';var _=require(_0x109d('0x0'));var util=require(_0x109d('0x1'));var logger=require('../../config/logger')(_0x109d('0x2'));var moment=require(_0x109d('0x3'));var BPromise=require('bluebird');var rp=require(_0x109d('0x4'));var attributes=require('./intSalesforceField.attributes');module[_0x109d('0x5')]=function(_0x47af85,_0x4bb293){return _0x47af85[_0x109d('0x6')](_0x109d('0x7'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x109d('0x8'),'fields':[_0x109d('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc320=['request-promise','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','api','moment','bluebird'];(function(_0x3a4f18,_0x1af741){var _0x4c20fc=function(_0x27115f){while(--_0x27115f){_0x3a4f18['push'](_0x3a4f18['shift']());}};_0x4c20fc(++_0x1af741);}(_0xc320,0x6b));var _0x0c32=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xc320[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x0c32('0x0'));var util=require(_0x0c32('0x1'));var logger=require('../../config/logger')(_0x0c32('0x2'));var moment=require(_0x0c32('0x3'));var BPromise=require(_0x0c32('0x4'));var rp=require(_0x0c32('0x5'));var attributes=require(_0x0c32('0x6'));module[_0x0c32('0x7')]=function(_0x59c587,_0x36a912){return _0x59c587[_0x0c32('0x8')](_0x0c32('0x9'),attributes,{'tableName':_0x0c32('0xa'),'paranoid':![],'indexes':[{'name':_0x0c32('0xb'),'fields':[_0x0c32('0xc'),_0x0c32('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 6934445..8a1db62 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 _0x873a=['code','message','catch','lodash','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0x873a,0xad));var _0xa873=function(_0x3e0d64,_0x41399b){_0x3e0d64=_0x3e0d64-0x0;var _0xc44ce8=_0x873a[_0x3e0d64];return _0xc44ce8;};'use strict';var _=require(_0xa873('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa873('0x1'));var rs=require(_0xa873('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa873('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa873('0x4'));var config=require('../../config/environment');var jayson=require(_0xa873('0x5'));var client=jayson[_0xa873('0x6')][_0xa873('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5927fa,_0x55d1a1,_0x9f4221){return new BPromise(function(_0x21f905,_0x5546f4){return client['request'](_0x5927fa,_0x9f4221)['then'](function(_0x5c8e65){logger[_0xa873('0x8')](_0xa873('0x9'),_0x55d1a1,_0xa873('0xa'));logger[_0xa873('0xb')](_0xa873('0xc'),_0x55d1a1,_0xa873('0xa'),JSON['stringify'](_0x5c8e65));if(_0x5c8e65[_0xa873('0xd')]){if(_0x5c8e65[_0xa873('0xd')][_0xa873('0xe')]===0x1f4){logger[_0xa873('0xd')](_0xa873('0x9'),_0x55d1a1,_0x5c8e65[_0xa873('0xd')][_0xa873('0xf')]);return _0x5546f4(_0x5c8e65[_0xa873('0xd')][_0xa873('0xf')]);}logger[_0xa873('0xd')](_0xa873('0x9'),_0x55d1a1,_0x5c8e65[_0xa873('0xd')][_0xa873('0xf')]);return _0x21f905(_0x5c8e65['error']['message']);}else{logger[_0xa873('0x8')](_0xa873('0x9'),_0x55d1a1,_0xa873('0xa'));_0x21f905(_0x5c8e65['result'][_0xa873('0xf')]);}})[_0xa873('0x10')](function(_0x5c3e84){logger['error'](_0xa873('0x9'),_0x55d1a1,_0x5c3e84);_0x5546f4(_0x5c3e84);});});} \ No newline at end of file +var _0x7a3a=['debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent'];(function(_0x275a56,_0x45f7ca){var _0x3ec77e=function(_0x34d74a){while(--_0x34d74a){_0x275a56['push'](_0x275a56['shift']());}};_0x3ec77e(++_0x45f7ca);}(_0x7a3a,0x1bc));var _0xa7a3=function(_0x1e202c,_0x29ac28){_0x1e202c=_0x1e202c-0x0;var _0x3f6143=_0x7a3a[_0x1e202c];return _0x3f6143;};'use strict';var _=require(_0xa7a3('0x0'));var util=require('util');var moment=require(_0xa7a3('0x1'));var BPromise=require(_0xa7a3('0x2'));var rs=require(_0xa7a3('0x3'));var fs=require('fs');var Redis=require(_0xa7a3('0x4'));var db=require(_0xa7a3('0x5'))['db'];var utils=require(_0xa7a3('0x6'));var logger=require('../../config/logger')(_0xa7a3('0x7'));var config=require(_0xa7a3('0x8'));var jayson=require(_0xa7a3('0x9'));var client=jayson['client'][_0xa7a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x375682,_0x5e80a6,_0x24484d){return new BPromise(function(_0x4a0920,_0x110557){return client[_0xa7a3('0xb')](_0x375682,_0x24484d)[_0xa7a3('0xc')](function(_0x34387f){logger[_0xa7a3('0xd')](_0xa7a3('0xe'),_0x5e80a6,_0xa7a3('0xf'));logger[_0xa7a3('0x10')](_0xa7a3('0x11'),_0x5e80a6,_0xa7a3('0xf'),JSON[_0xa7a3('0x12')](_0x34387f));if(_0x34387f['error']){if(_0x34387f[_0xa7a3('0x13')][_0xa7a3('0x14')]===0x1f4){logger['error'](_0xa7a3('0xe'),_0x5e80a6,_0x34387f[_0xa7a3('0x13')][_0xa7a3('0x15')]);return _0x110557(_0x34387f['error'][_0xa7a3('0x15')]);}logger['error'](_0xa7a3('0xe'),_0x5e80a6,_0x34387f[_0xa7a3('0x13')]['message']);return _0x4a0920(_0x34387f[_0xa7a3('0x13')][_0xa7a3('0x15')]);}else{logger[_0xa7a3('0xd')](_0xa7a3('0xe'),_0x5e80a6,'request\x20sent');_0x4a0920(_0x34387f[_0xa7a3('0x16')]['message']);}})['catch'](function(_0x31bdf3){logger[_0xa7a3('0x13')](_0xa7a3('0xe'),_0x5e80a6,_0x31bdf3);_0x110557(_0x31bdf3);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 1c2dd77..ac8eafa 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 _0xc0b5=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','index','get','/:id','isAuthenticated','show','/:id/fields','post','/:id/configurations','update','delete','exports','util'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0xc0b5,0x131));var _0x5c0b=function(_0x4200bd,_0x418b20){_0x4200bd=_0x4200bd-0x0;var _0x1f8ca1=_0xc0b5[_0x4200bd];return _0x1f8ca1;};'use strict';var multer=require('multer');var util=require(_0x5c0b('0x0'));var path=require(_0x5c0b('0x1'));var timeout=require(_0x5c0b('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x5c0b('0x3'));var interaction=require(_0x5c0b('0x4'));var config=require(_0x5c0b('0x5'));var controller=require(_0x5c0b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5c0b('0x7')]);router[_0x5c0b('0x8')](_0x5c0b('0x9'),auth[_0x5c0b('0xa')](),controller[_0x5c0b('0xb')]);router['get']('/:id/configurations',auth[_0x5c0b('0xa')](),controller['getConfigurations']);router[_0x5c0b('0x8')](_0x5c0b('0xc'),auth[_0x5c0b('0xa')](),controller['getFields']);router[_0x5c0b('0xd')]('/',auth[_0x5c0b('0xa')](),controller['create']);router[_0x5c0b('0xd')](_0x5c0b('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x5c0b('0x9'),auth[_0x5c0b('0xa')](),controller[_0x5c0b('0xf')]);router[_0x5c0b('0x10')](_0x5c0b('0x9'),auth[_0x5c0b('0xa')](),controller['destroy']);module[_0x5c0b('0x11')]=router; \ No newline at end of file +var _0xbdf7=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xbdf7,0x187));var _0x7bdf=function(_0x70d37e,_0xa394a6){_0x70d37e=_0x70d37e-0x0;var _0x1e2fed=_0xbdf7[_0x70d37e];return _0x1e2fed;};'use strict';var multer=require(_0x7bdf('0x0'));var util=require(_0x7bdf('0x1'));var path=require(_0x7bdf('0x2'));var timeout=require(_0x7bdf('0x3'));var express=require(_0x7bdf('0x4'));var router=express[_0x7bdf('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7bdf('0x6'));var config=require(_0x7bdf('0x7'));var controller=require(_0x7bdf('0x8'));router[_0x7bdf('0x9')]('/',auth[_0x7bdf('0xa')](),controller[_0x7bdf('0xb')]);router[_0x7bdf('0x9')](_0x7bdf('0xc'),auth[_0x7bdf('0xa')](),controller[_0x7bdf('0xd')]);router[_0x7bdf('0x9')](_0x7bdf('0xe'),auth[_0x7bdf('0xa')](),controller[_0x7bdf('0xf')]);router['get'](_0x7bdf('0x10'),auth[_0x7bdf('0xa')](),controller[_0x7bdf('0x11')]);router['post']('/',auth[_0x7bdf('0xa')](),controller[_0x7bdf('0x12')]);router['post']('/:id/configurations',auth[_0x7bdf('0xa')](),controller[_0x7bdf('0x13')]);router[_0x7bdf('0x14')](_0x7bdf('0xc'),auth[_0x7bdf('0xa')](),controller[_0x7bdf('0x15')]);router[_0x7bdf('0x16')](_0x7bdf('0xc'),auth[_0x7bdf('0xa')](),controller[_0x7bdf('0x17')]);module[_0x7bdf('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 72f6576..b704419 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 _0x750a=['exports','STRING','username','remoteUri'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x750a,0x140));var _0xa750=function(_0x5b5b2f,_0x1878fb){_0x5b5b2f=_0x5b5b2f-0x0;var _0x508873=_0x750a[_0x5b5b2f];return _0x508873;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa750('0x1')],'unique':_0xa750('0x2')},'password':{'type':Sequelize[_0xa750('0x1')]},'email':{'type':Sequelize[_0xa750('0x1')]},'remoteUri':{'type':Sequelize[_0xa750('0x1')],'unique':_0xa750('0x3')},'serverUrl':{'type':Sequelize[_0xa750('0x1')]}}; \ No newline at end of file +var _0x1d2d=['sequelize','exports','STRING','remoteUri'];(function(_0x353207,_0xbbcec2){var _0xc9b939=function(_0x4aec7f){while(--_0x4aec7f){_0x353207['push'](_0x353207['shift']());}};_0xc9b939(++_0xbbcec2);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x6dc431,_0x135790){_0x6dc431=_0x6dc431-0x0;var _0x3c52bd=_0x1d2d[_0x6dc431];return _0x3c52bd;};'use strict';var Sequelize=require(_0xd1d2('0x0'));module[_0xd1d2('0x1')]={'name':{'type':Sequelize[_0xd1d2('0x2')]},'description':{'type':Sequelize[_0xd1d2('0x2')]},'username':{'type':Sequelize[_0xd1d2('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xd1d2('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xd1d2('0x3')},'serverUrl':{'type':Sequelize[_0xd1d2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 680a941..1b85e20 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 _0xbd7a=['options','findAll','catch','show','params','include','find','create','body','getConfigurations','findOne','ServicenowConfiguration','map','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','subcategory','close_code','category','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','closed_at','cmdb_ci','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','correlation_display','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','closed_by','follow_up','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','location','username','password','remoteUri','serverUrl','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','incident\x20table\x20objects','assign','forEach','internalType','label','push','all','log','TCL:\x20_object','remove','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','test','statusCode','stack','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','name','send','index','ServicenowAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','key'];(function(_0x3b5686,_0x3f016b){var _0x37f327=function(_0x3d71fa){while(--_0x3d71fa){_0x3b5686['push'](_0x3b5686['shift']());}};_0x37f327(++_0x3f016b);}(_0xbd7a,0x1ee));var _0xabd7=function(_0x130dac,_0x4799d4){_0x130dac=_0x130dac-0x0;var _0x4d2555=_0xbd7a[_0x130dac];return _0x4d2555;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xabd7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabd7('0x1'));var jsonpatch=require(_0xabd7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xabd7('0x3'));var util=require(_0xabd7('0x4'));var path=require(_0xabd7('0x5'));var sox=require(_0xabd7('0x6'));var csv=require(_0xabd7('0x7'));var ejs=require(_0xabd7('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xabd7('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xabd7('0xa'));var toCsv=require(_0xabd7('0x7'));var querystring=require(_0xabd7('0xb'));var Papa=require(_0xabd7('0xc'));var authService=require(_0xabd7('0xd'));var hardwareService=require(_0xabd7('0xe'));var Redis=require('ioredis');var qs=require(_0xabd7('0xf'));var logger=require(_0xabd7('0x10'))('api');var utils=require(_0xabd7('0x11'));var config=require(_0xabd7('0x12'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xabd7('0x13')][_0xabd7('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x11c457,_0x549693,_0xf33575,_0x2ce168){return new BPromise(function(_0x466b85,_0x1dc723){var _0x40bc45=_0x2ce168||client;return _0x40bc45[_0xabd7('0x15')](_0x11c457,_0xf33575)[_0xabd7('0x16')](function(_0x353cdf){logger['info'](_0xabd7('0x17'),_0x549693,_0xabd7('0x18'));logger['debug'](_0xabd7('0x19'),_0x549693,_0xabd7('0x18'),JSON[_0xabd7('0x1a')](_0x353cdf));if(_0x353cdf[_0xabd7('0x1b')]){if(_0x353cdf[_0xabd7('0x1b')]['code']===0x1f4){logger[_0xabd7('0x1b')](_0xabd7('0x17'),_0x549693,_0x353cdf[_0xabd7('0x1b')][_0xabd7('0x1c')]);return _0x1dc723(_0x353cdf[_0xabd7('0x1b')]['message']);}logger[_0xabd7('0x1b')](_0xabd7('0x17'),_0x549693,_0x353cdf[_0xabd7('0x1b')][_0xabd7('0x1c')]);return _0x466b85(_0x353cdf[_0xabd7('0x1b')]['message']);}else{logger[_0xabd7('0x1d')]('ServicenowAccount,\x20%s,\x20%s',_0x549693,_0xabd7('0x18'));_0x466b85(_0x353cdf[_0xabd7('0x1e')][_0xabd7('0x1c')]);}})['catch'](function(_0x217b76){logger[_0xabd7('0x1b')](_0xabd7('0x17'),_0x549693,_0x217b76);_0x1dc723(_0x217b76);});});}function respondWithStatusCode(_0x358195,_0x233250){_0x233250=_0x233250||0xcc;return function(_0xbb7245){if(_0xbb7245){return _0x358195[_0xabd7('0x1f')](_0x233250);}return _0x358195[_0xabd7('0x20')](_0x233250)[_0xabd7('0x21')]();};}function respondWithResult(_0x999643,_0x51267f){_0x51267f=_0x51267f||0xc8;return function(_0x3db7c2){if(_0x3db7c2){return _0x999643[_0xabd7('0x20')](_0x51267f)[_0xabd7('0x22')](_0x3db7c2);}};}function respondWithFilteredResult(_0x20a042,_0x4235a5){return function(_0x37ba04){if(_0x37ba04){var _0x371c6c=_0x37ba04[_0xabd7('0x23')],_0x3d2088=_0x4235a5['offset'],_0xc541ab=_0x4235a5['offset']+_0x4235a5[_0xabd7('0x24')],_0x21762e;if(_0xc541ab>=_0x371c6c){_0xc541ab=_0x371c6c;_0x21762e=0xc8;}else{_0x21762e=0xce;}_0x20a042[_0xabd7('0x20')](_0x21762e);return _0x20a042[_0xabd7('0x25')](_0xabd7('0x26'),_0x3d2088+'-'+_0xc541ab+'/'+_0x371c6c)[_0xabd7('0x22')](_0x37ba04);}return null;};}function patchUpdates(_0x105063){return function(_0x253d78){try{jsonpatch[_0xabd7('0x27')](_0x253d78,_0x105063,!![]);}catch(_0x299792){return BPromise[_0xabd7('0x28')](_0x299792);}return _0x253d78[_0xabd7('0x29')]();};}function saveUpdates(_0xd644b3,_0x32bc72){return function(_0xe184cc){if(_0xe184cc){return _0xe184cc[_0xabd7('0x2a')](_0xd644b3)[_0xabd7('0x16')](function(_0x2018af){return _0x2018af;});}return null;};}function removeEntity(_0x21a940,_0x6b3381){return function(_0x404a92){if(_0x404a92){return _0x404a92['destroy']()[_0xabd7('0x16')](function(){_0x21a940['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40db15,_0x441588){return function(_0x52e4d0){if(!_0x52e4d0){_0x40db15[_0xabd7('0x1f')](0x194);}return _0x52e4d0;};}function handleError(_0x309dbc,_0x51471e){_0x51471e=_0x51471e||0x1f4;return function(_0x28ac1b){logger[_0xabd7('0x1b')](_0x28ac1b['stack']);if(_0x28ac1b[_0xabd7('0x2b')]){delete _0x28ac1b[_0xabd7('0x2b')];}_0x309dbc['status'](_0x51471e)[_0xabd7('0x2c')](_0x28ac1b);};}exports[_0xabd7('0x2d')]=function(_0x1749e9,_0x1affae){var _0x55fecf={},_0x36c213={},_0x555094={'count':0x0,'rows':[]};var _0x53c4f7=db[_0xabd7('0x2e')][_0xabd7('0x2f')];_0x36c213[_0xabd7('0x30')]=_[_0xabd7('0x31')](_0x53c4f7);_0x36c213[_0xabd7('0x32')]=_[_0xabd7('0x31')](_0x1749e9[_0xabd7('0x32')]);_0x36c213[_0xabd7('0x33')]=_[_0xabd7('0x34')](_0x36c213['model'],_0x36c213[_0xabd7('0x32')]);_0x55fecf[_0xabd7('0x35')]=_[_0xabd7('0x34')](_0x36c213[_0xabd7('0x30')],qs[_0xabd7('0x36')](_0x1749e9['query']['fields']));_0x55fecf[_0xabd7('0x35')]=_0x55fecf[_0xabd7('0x35')][_0xabd7('0x37')]?_0x55fecf[_0xabd7('0x35')]:_0x36c213[_0xabd7('0x30')];if(!_0x1749e9[_0xabd7('0x32')][_0xabd7('0x38')](_0xabd7('0x39'))){_0x55fecf[_0xabd7('0x24')]=qs[_0xabd7('0x24')](_0x1749e9[_0xabd7('0x32')][_0xabd7('0x24')]);_0x55fecf[_0xabd7('0x3a')]=qs[_0xabd7('0x3a')](_0x1749e9['query']['offset']);}_0x55fecf[_0xabd7('0x3b')]=qs[_0xabd7('0x3c')](_0x1749e9[_0xabd7('0x32')]['sort']);_0x55fecf[_0xabd7('0x3d')]=qs[_0xabd7('0x33')](_[_0xabd7('0x3e')](_0x1749e9[_0xabd7('0x32')],_0x36c213['filters']));if(_0x1749e9[_0xabd7('0x32')][_0xabd7('0x3f')]){_0x55fecf[_0xabd7('0x3d')]=_[_0xabd7('0x40')](_0x55fecf[_0xabd7('0x3d')],{'$or':_['map'](_0x53c4f7,function(_0x34d952){if(_0x34d952[_0xabd7('0x41')][_0xabd7('0x42')]!=='VIRTUAL'){var _0x2d7cbd={};_0x2d7cbd[_0x34d952['field']]={'$like':'%'+_0x1749e9[_0xabd7('0x32')][_0xabd7('0x3f')]+'%'};return _0x2d7cbd;}})});}_0x55fecf=_[_0xabd7('0x40')]({},_0x55fecf,_0x1749e9[_0xabd7('0x43')]);var _0x199b37={'where':_0x55fecf[_0xabd7('0x3d')]};return db[_0xabd7('0x2e')][_0xabd7('0x23')](_0x199b37)[_0xabd7('0x16')](function(_0x372e67){_0x555094[_0xabd7('0x23')]=_0x372e67;if(_0x1749e9[_0xabd7('0x32')]['includeAll']){_0x55fecf['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0xabd7('0x44')](_0x55fecf);})[_0xabd7('0x16')](function(_0x5da1c5){_0x555094['rows']=_0x5da1c5;return _0x555094;})['then'](respondWithFilteredResult(_0x1affae,_0x55fecf))[_0xabd7('0x45')](handleError(_0x1affae,null));};exports[_0xabd7('0x46')]=function(_0x901950,_0x487eea){var _0x18ba5e={'raw':![],'where':{'id':_0x901950[_0xabd7('0x47')]['id']}},_0x2799b3={};_0x2799b3[_0xabd7('0x30')]=_['keys'](db[_0xabd7('0x2e')][_0xabd7('0x2f')]);_0x2799b3['query']=_['keys'](_0x901950[_0xabd7('0x32')]);_0x2799b3[_0xabd7('0x33')]=_[_0xabd7('0x34')](_0x2799b3[_0xabd7('0x30')],_0x2799b3[_0xabd7('0x32')]);_0x18ba5e[_0xabd7('0x35')]=_[_0xabd7('0x34')](_0x2799b3['model'],qs[_0xabd7('0x36')](_0x901950[_0xabd7('0x32')][_0xabd7('0x36')]));_0x18ba5e[_0xabd7('0x35')]=_0x18ba5e[_0xabd7('0x35')][_0xabd7('0x37')]?_0x18ba5e['attributes']:_0x2799b3['model'];if(_0x901950[_0xabd7('0x32')]['includeAll']){_0x18ba5e[_0xabd7('0x48')]=[{'all':!![]}];}_0x18ba5e=_[_0xabd7('0x40')]({},_0x18ba5e,_0x901950[_0xabd7('0x43')]);return db[_0xabd7('0x2e')][_0xabd7('0x49')](_0x18ba5e)[_0xabd7('0x16')](handleEntityNotFound(_0x487eea,null))[_0xabd7('0x16')](respondWithResult(_0x487eea,null))[_0xabd7('0x45')](handleError(_0x487eea,null));};exports[_0xabd7('0x4a')]=function(_0x11ba68,_0x1adc28){return db['ServicenowAccount'][_0xabd7('0x4a')](_0x11ba68[_0xabd7('0x4b')],{})[_0xabd7('0x16')](respondWithResult(_0x1adc28,0xc9))[_0xabd7('0x45')](handleError(_0x1adc28,null));};exports[_0xabd7('0x2a')]=function(_0x113051,_0x5ea983){if(_0x113051[_0xabd7('0x4b')]['id']){delete _0x113051[_0xabd7('0x4b')]['id'];}return db[_0xabd7('0x2e')][_0xabd7('0x49')]({'where':{'id':_0x113051['params']['id']}})[_0xabd7('0x16')](handleEntityNotFound(_0x5ea983,null))[_0xabd7('0x16')](saveUpdates(_0x113051[_0xabd7('0x4b')],null))[_0xabd7('0x16')](respondWithResult(_0x5ea983,null))[_0xabd7('0x45')](handleError(_0x5ea983,null));};exports['destroy']=function(_0x4b595d,_0x4ea5e9){return db[_0xabd7('0x2e')][_0xabd7('0x49')]({'where':{'id':_0x4b595d[_0xabd7('0x47')]['id']}})[_0xabd7('0x16')](handleEntityNotFound(_0x4ea5e9,null))[_0xabd7('0x16')](removeEntity(_0x4ea5e9,null))[_0xabd7('0x45')](handleError(_0x4ea5e9,null));};exports[_0xabd7('0x4c')]=function(_0x5b6191,_0xd09de4,_0x524961){var _0x1f6ef1={};var _0x4e879b={};var _0x3da040;var _0x13a940;return db['ServicenowAccount'][_0xabd7('0x4d')]({'where':{'id':_0x5b6191[_0xabd7('0x47')]['id']}})[_0xabd7('0x16')](handleEntityNotFound(_0xd09de4,null))[_0xabd7('0x16')](function(_0x3cccfe){if(_0x3cccfe){_0x3da040=_0x3cccfe;_0x4e879b[_0xabd7('0x30')]=_[_0xabd7('0x31')](db[_0xabd7('0x4e')]['rawAttributes']);_0x4e879b[_0xabd7('0x32')]=_[_0xabd7('0x31')](_0x5b6191['query']);_0x4e879b['filters']=_[_0xabd7('0x34')](_0x4e879b[_0xabd7('0x30')],_0x4e879b['query']);_0x1f6ef1[_0xabd7('0x35')]=_[_0xabd7('0x34')](_0x4e879b[_0xabd7('0x30')],qs[_0xabd7('0x36')](_0x5b6191[_0xabd7('0x32')][_0xabd7('0x36')]));_0x1f6ef1[_0xabd7('0x35')]=_0x1f6ef1[_0xabd7('0x35')]['length']?_0x1f6ef1['attributes']:_0x4e879b['model'];_0x1f6ef1[_0xabd7('0x3b')]=qs[_0xabd7('0x3c')](_0x5b6191[_0xabd7('0x32')]['sort']);_0x1f6ef1[_0xabd7('0x3d')]=qs[_0xabd7('0x33')](_[_0xabd7('0x3e')](_0x5b6191[_0xabd7('0x32')],_0x4e879b[_0xabd7('0x33')]));if(_0x5b6191['query'][_0xabd7('0x3f')]){_0x1f6ef1[_0xabd7('0x3d')]=_[_0xabd7('0x40')](_0x1f6ef1[_0xabd7('0x3d')],{'$or':_[_0xabd7('0x4f')](_0x1f6ef1[_0xabd7('0x35')],function(_0x136e0a){var _0x2e335c={};_0x2e335c[_0x136e0a]={'$like':'%'+_0x5b6191[_0xabd7('0x32')]['filter']+'%'};return _0x2e335c;})});}_0x1f6ef1=_['merge']({},_0x1f6ef1,_0x5b6191[_0xabd7('0x43')]);return _0x3da040['getConfigurations'](_0x1f6ef1);}})[_0xabd7('0x16')](function(_0x105b0e){if(_0x105b0e){_0x13a940=_0x105b0e[_0xabd7('0x37')];if(!_0x5b6191[_0xabd7('0x32')][_0xabd7('0x38')](_0xabd7('0x39'))){_0x1f6ef1['limit']=qs[_0xabd7('0x24')](_0x5b6191[_0xabd7('0x32')][_0xabd7('0x24')]);_0x1f6ef1[_0xabd7('0x3a')]=qs['offset'](_0x5b6191[_0xabd7('0x32')][_0xabd7('0x3a')]);}return _0x3da040[_0xabd7('0x4c')](_0x1f6ef1);}})[_0xabd7('0x16')](function(_0x2dad1e){if(_0x2dad1e){return _0x2dad1e?{'count':_0x13a940,'rows':_0x2dad1e}:null;}})[_0xabd7('0x16')](respondWithResult(_0xd09de4,null))[_0xabd7('0x45')](handleError(_0xd09de4,null));};exports[_0xabd7('0x50')]=function(_0x5e99e8,_0x294730,_0x2d7594){if(_0x5e99e8[_0xabd7('0x4b')]['id']){delete _0x5e99e8['body']['id'];}return db['ServicenowAccount'][_0xabd7('0x4d')]({'where':{'id':_0x5e99e8[_0xabd7('0x47')]['id']}})['then'](handleEntityNotFound(_0x294730,null))[_0xabd7('0x16')](function(_0x561e6f){if(_0x561e6f){_0x5e99e8[_0xabd7('0x4b')][_0xabd7('0x51')]=_0x561e6f['id'];_0x5e99e8[_0xabd7('0x4b')][_0xabd7('0x52')]=integrations[_0xabd7('0x53')](_0x5e99e8[_0xabd7('0x4b')][_0xabd7('0x54')],_0x5e99e8[_0xabd7('0x4b')]['type']);_0x5e99e8[_0xabd7('0x4b')][_0xabd7('0x55')]=integrations[_0xabd7('0x56')](_0x5e99e8[_0xabd7('0x4b')][_0xabd7('0x54')],_0x5e99e8['body'][_0xabd7('0x41')]);return db[_0xabd7('0x4e')]['create'](_0x5e99e8['body'],{'include':[{'model':db[_0xabd7('0x57')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0xabd7('0x55')}]});}return null;})['then'](respondWithResult(_0x294730,null))['catch'](handleError(_0x294730,null));};exports[_0xabd7('0x58')]=function(_0x2ca82e,_0x32a7f8,_0x26209e){var _0x1b5d3b=[_0xabd7('0x59'),'hold_reason','knowledge',_0xabd7('0x5a'),_0xabd7('0x5b'),'notify','incident_state','severity',_0xabd7('0x5c')];var _0x132ad1=['parent',_0xabd7('0x59'),'caused_by',_0xabd7('0x5d'),'upon_reject',_0xabd7('0x5e'),_0xabd7('0x5f'),'hold_reason',_0xabd7('0x60'),_0xabd7('0x61'),_0xabd7('0x62'),_0xabd7('0x63'),'opened_by',_0xabd7('0x64'),_0xabd7('0x65'),_0xabd7('0x66'),_0xabd7('0x67'),_0xabd7('0x68'),_0xabd7('0x69'),_0xabd7('0x3b'),'calendar_stc',_0xabd7('0x6a'),_0xabd7('0x6b'),_0xabd7('0x6c'),_0xabd7('0x6d'),_0xabd7('0x6e'),'work_notes_list',_0xabd7('0x6f'),_0xabd7('0x70'),_0xabd7('0x71'),_0xabd7('0x72'),_0xabd7('0x73'),_0xabd7('0x74'),_0xabd7('0x75'),'business_duration',_0xabd7('0x76'),_0xabd7('0x77'),'reopened_time',_0xabd7('0x78'),_0xabd7('0x79'),_0xabd7('0x7a'),'subcategory',_0xabd7('0x7b'),'short_description',_0xabd7('0x5b'),_0xabd7('0x7c'),'delivery_task','work_start',_0xabd7('0x7d'),_0xabd7('0x7e'),_0xabd7('0x7f'),_0xabd7('0x80'),_0xabd7('0x81'),_0xabd7('0x82'),'sys_class_name','close_notes',_0xabd7('0x83'),_0xabd7('0x84'),'parent_incident',_0xabd7('0x85'),_0xabd7('0x86'),_0xabd7('0x87'),_0xabd7('0x88'),_0xabd7('0x89'),_0xabd7('0x8a'),_0xabd7('0x8b'),_0xabd7('0x8c'),_0xabd7('0x8d'),_0xabd7('0x8e'),_0xabd7('0x8f'),_0xabd7('0x90'),_0xabd7('0x91'),_0xabd7('0x92'),_0xabd7('0x93'),_0xabd7('0x94'),_0xabd7('0x95'),_0xabd7('0x96'),_0xabd7('0x97'),_0xabd7('0x98'),'upon_approval','correlation_id',_0xabd7('0x99'),_0xabd7('0x5c')];var _0x45cc5f='';var _0x39e5b7='';var _0xaf6db2=[];var _0x13d16c='';var _0x515d2b='';var _0x3f53a2=[];var _0x4551ad='';var _0x2b46cc='';var _0x566d87={};return db[_0xabd7('0x2e')][_0xabd7('0x4d')]({'where':{'id':_0x2ca82e[_0xabd7('0x47')]['id']},'attributes':['id',_0xabd7('0x9a'),_0xabd7('0x9b'),'email',_0xabd7('0x9c'),_0xabd7('0x9d')]})['then'](handleEntityNotFound(_0x32a7f8,null))['then'](function(_0xe6637a){if(_0xe6637a){_0x2b46cc=util[_0xabd7('0x9e')](_0xabd7('0x9f'),_0xe6637a[_0xabd7('0x9c')]);_0x4551ad=util[_0xabd7('0x9e')]('%s/api/now/table/',_0xe6637a[_0xabd7('0x9c')]);_0x566d87={'user':_0xe6637a[_0xabd7('0x9a')],'pass':_0xe6637a['password']};var _0x2198c8={'method':_0xabd7('0xa0'),'uri':_0x2b46cc+_0xabd7('0xa1'),'auth':_0x566d87,'json':!![]};return rp(_0x2198c8);}})[_0xabd7('0x16')](function(_0x3c9d12){if(_0x3c9d12['result']['length']>0x0){_0x45cc5f=_0x3c9d12[_0xabd7('0x1e')];}console['log'](_0xabd7('0xa2'),_0x45cc5f);_0x3f53a2=[];_0x39e5b7=Object[_0xabd7('0xa3')]([],_0x45cc5f);_['remove'](_0x39e5b7,function(_0xc3f3bb){return!_0x1b5d3b['includes'](_0xc3f3bb['name']);});_0x39e5b7[_0xabd7('0xa4')](function(_0x2dec3e){var _0x523456=createFieldObject(_0x4551ad,_0x566d87,_0x2dec3e[_0xabd7('0xa5')],_0x2dec3e[_0xabd7('0x2b')],_0x2dec3e[_0xabd7('0xa6')],![]);_0x3f53a2[_0xabd7('0xa7')](_0x523456);});return Promise[_0xabd7('0xa8')](_0x3f53a2);})['then'](function(_0x4fa848){_0xaf6db2=_0x4fa848;_0x13d16c=Object[_0xabd7('0xa3')]([],_0x45cc5f);console[_0xabd7('0xa9')](_0xabd7('0xaa'),_0x45cc5f);_[_0xabd7('0xab')](_0x13d16c,function(_0x265c5c){return _0x132ad1[_0xabd7('0xac')](_0x265c5c[_0xabd7('0x2b')]);});console[_0xabd7('0xa9')](_0xabd7('0xad'),_0x13d16c);_0x3f53a2=[];_0x13d16c[_0xabd7('0xa4')](function(_0x489807){var _0x7ce043=createFieldObject(_0x4551ad,_0x566d87,_0x489807[_0xabd7('0xa5')],_0x489807[_0xabd7('0x2b')],_0x489807['label'],!![]);_0x3f53a2['push'](_0x7ce043);});return Promise[_0xabd7('0xa8')](_0x3f53a2);})['then'](function(_0x597995){_0x515d2b=_0x597995;var _0x48e605=_0xaf6db2['concat'](_0x515d2b);return{'count':_0x48e605[_0xabd7('0x37')],'rows':_0x48e605};})[_0xabd7('0x16')](respondWithResult(_0x32a7f8,null))[_0xabd7('0x45')](function(_0x25c978){console[_0xabd7('0xa9')](_0xabd7('0xae')+_0x25c978);var _0x15eac2=_0x2ca82e[_0xabd7('0x32')][_0xabd7('0xaf')]?0x1f4:_0x25c978[_0xabd7('0xb0')]||0x1f4;logger[_0xabd7('0x1b')](_0x25c978[_0xabd7('0xb1')]);delete _0x25c978[_0xabd7('0x2b')];if(_0x15eac2===0x191){_0x15eac2=0x190;}_0x32a7f8[_0xabd7('0x20')](_0x15eac2)[_0xabd7('0x2c')](_0x2ca82e[_0xabd7('0x32')][_0xabd7('0xaf')]?{'message':_0xabd7('0xb2'),'statusCode':_0x25c978[_0xabd7('0xb0')]}:_0x25c978);});};function createFieldObject(_0x4dd019,_0x49b307,_0x5017af,_0x5e6a12,_0x252a63,_0x9f9400){return new Promise(function(_0x4302d8,_0x5885cc){var _0x5e9f61={'id':_0x5e6a12,'name':_0x252a63,'custom':_0x9f9400};if(_0x5017af===_0xabd7('0xb3')){_0x5e9f61[_0xabd7('0x43')]=[{'name':_0xabd7('0xb4'),'value':_0xabd7('0xb5')},{'name':_0xabd7('0xb6'),'value':_0xabd7('0xb7')}];_0x4302d8(_0x5e9f61);}else{var _0x5b0af3={'method':_0xabd7('0xa0'),'uri':_0x4dd019+_0xabd7('0xb8')+_0x5e6a12,'auth':_0x49b307,'json':!![]};return rp(_0x5b0af3)[_0xabd7('0x16')](function(_0x48fb5a){var _0x2083a4=[];if(_0x48fb5a[_0xabd7('0x1e')][_0xabd7('0x37')]>0x0){_0x48fb5a[_0xabd7('0x1e')][_0xabd7('0xa4')](function(_0x4537af){if(_0x4537af[_0xabd7('0xb9')]===_0xabd7('0xb7')){var _0x1ca7b7={'name':_0x4537af['label'],'value':_0x4537af[_0xabd7('0xba')]};_0x2083a4[_0xabd7('0xa7')](_0x1ca7b7);}});}_0x5e9f61['options']=_0x2083a4;if(_0x5e9f61[_0xabd7('0x43')][_0xabd7('0x37')]>0x0){_0x4302d8(_0x5e9f61);}else{if(_0x9f9400==![]){_0x4302d8();}else{_0x4302d8(_0x5e9f61);}}});}});} \ No newline at end of file +var _0x53c8=['assigned_to','comments','approval','comments_and_work_notes','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','password','email','serverUrl','format','%s/api/now/doc/table/schema/','remoteUri','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','index','ServicenowAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','options','include','findAll','rows','show','length','includeAll','find','create','update','body','params','findOne','getConfigurations','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','Subjects','getFields','made_sla','hold_reason','subcategory','close_code','notify','severity','category','parent','caused_by','watch_list','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','rfc','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','calendar_duration','sys_class_name','close_notes','follow_up','sys_id','contact_type','incident_state','urgency','problem_id','company','reassignment_count','activity_due'];(function(_0x526b20,_0xc7b64d){var _0x455172=function(_0xdd6599){while(--_0xdd6599){_0x526b20['push'](_0x526b20['shift']());}};_0x455172(++_0xc7b64d);}(_0x53c8,0x1b0));var _0x853c=function(_0x323c7e,_0x3d16ec){_0x323c7e=_0x323c7e-0x0;var _0x2b0f72=_0x53c8[_0x323c7e];return _0x2b0f72;};'use strict';var pdf=require(_0x853c('0x0'));var emlformat=require(_0x853c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x853c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x853c('0x3'));var moment=require(_0x853c('0x4'));var BPromise=require(_0x853c('0x5'));var Mustache=require(_0x853c('0x6'));var util=require(_0x853c('0x7'));var path=require(_0x853c('0x8'));var sox=require(_0x853c('0x9'));var csv=require(_0x853c('0xa'));var ejs=require(_0x853c('0xb'));var fs=require('fs');var _=require(_0x853c('0xc'));var squel=require(_0x853c('0xd'));var crypto=require(_0x853c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x853c('0xa'));var querystring=require(_0x853c('0xf'));var Papa=require('papaparse');var authService=require(_0x853c('0x10'));var hardwareService=require(_0x853c('0x11'));var Redis=require(_0x853c('0x12'));var qs=require(_0x853c('0x13'));var logger=require(_0x853c('0x14'))(_0x853c('0x15'));var utils=require(_0x853c('0x16'));var config=require('../../config/environment');var db=require(_0x853c('0x17'))['db'];var integrations=require(_0x853c('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x853c('0x19')][_0x853c('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3f1df2,_0x17fd00,_0x357ff6,_0x30cce1){return new BPromise(function(_0x3b3f6f,_0x353965){var _0x3c7670=_0x30cce1||client;return _0x3c7670[_0x853c('0x1b')](_0x3f1df2,_0x357ff6)[_0x853c('0x1c')](function(_0x3ef252){logger[_0x853c('0x1d')](_0x853c('0x1e'),_0x17fd00,_0x853c('0x1f'));logger[_0x853c('0x20')](_0x853c('0x21'),_0x17fd00,_0x853c('0x1f'),JSON[_0x853c('0x22')](_0x3ef252));if(_0x3ef252[_0x853c('0x23')]){if(_0x3ef252['error'][_0x853c('0x24')]===0x1f4){logger[_0x853c('0x23')](_0x853c('0x1e'),_0x17fd00,_0x3ef252[_0x853c('0x23')][_0x853c('0x25')]);return _0x353965(_0x3ef252[_0x853c('0x23')][_0x853c('0x25')]);}logger[_0x853c('0x23')]('ServicenowAccount,\x20%s,\x20%s',_0x17fd00,_0x3ef252['error'][_0x853c('0x25')]);return _0x3b3f6f(_0x3ef252['error'][_0x853c('0x25')]);}else{logger[_0x853c('0x1d')]('ServicenowAccount,\x20%s,\x20%s',_0x17fd00,_0x853c('0x1f'));_0x3b3f6f(_0x3ef252[_0x853c('0x26')][_0x853c('0x25')]);}})[_0x853c('0x27')](function(_0xaa5a73){logger[_0x853c('0x23')](_0x853c('0x1e'),_0x17fd00,_0xaa5a73);_0x353965(_0xaa5a73);});});}function respondWithStatusCode(_0x571fa1,_0x24346c){_0x24346c=_0x24346c||0xcc;return function(_0x39bc41){if(_0x39bc41){return _0x571fa1[_0x853c('0x28')](_0x24346c);}return _0x571fa1[_0x853c('0x29')](_0x24346c)[_0x853c('0x2a')]();};}function respondWithResult(_0x16c8fb,_0x604898){_0x604898=_0x604898||0xc8;return function(_0x367ee6){if(_0x367ee6){return _0x16c8fb[_0x853c('0x29')](_0x604898)[_0x853c('0x2b')](_0x367ee6);}};}function respondWithFilteredResult(_0x1fadce,_0x418fb9){return function(_0x2379da){if(_0x2379da){var _0x27d9e3=_0x2379da[_0x853c('0x2c')],_0x4e64bb=_0x418fb9[_0x853c('0x2d')],_0xd09593=_0x418fb9['offset']+_0x418fb9[_0x853c('0x2e')],_0x3180f5;if(_0xd09593>=_0x27d9e3){_0xd09593=_0x27d9e3;_0x3180f5=0xc8;}else{_0x3180f5=0xce;}_0x1fadce[_0x853c('0x29')](_0x3180f5);return _0x1fadce[_0x853c('0x2f')](_0x853c('0x30'),_0x4e64bb+'-'+_0xd09593+'/'+_0x27d9e3)['json'](_0x2379da);}return null;};}function patchUpdates(_0x35f400){return function(_0x389114){try{jsonpatch[_0x853c('0x31')](_0x389114,_0x35f400,!![]);}catch(_0xaf152e){return BPromise[_0x853c('0x32')](_0xaf152e);}return _0x389114[_0x853c('0x33')]();};}function saveUpdates(_0xcb5723,_0x3d9dd0){return function(_0x416635){if(_0x416635){return _0x416635['update'](_0xcb5723)[_0x853c('0x1c')](function(_0x2b5356){return _0x2b5356;});}return null;};}function removeEntity(_0x418b8c,_0x48a117){return function(_0x14ef52){if(_0x14ef52){return _0x14ef52[_0x853c('0x34')]()['then'](function(){_0x418b8c[_0x853c('0x29')](0xcc)[_0x853c('0x2a')]();});}};}function handleEntityNotFound(_0x1c9db6,_0xaf1159){return function(_0x5a38f5){if(!_0x5a38f5){_0x1c9db6[_0x853c('0x28')](0x194);}return _0x5a38f5;};}function handleError(_0x49607f,_0x45cad5){_0x45cad5=_0x45cad5||0x1f4;return function(_0xc39875){logger[_0x853c('0x23')](_0xc39875[_0x853c('0x35')]);if(_0xc39875[_0x853c('0x36')]){delete _0xc39875['name'];}_0x49607f[_0x853c('0x29')](_0x45cad5)['send'](_0xc39875);};}exports[_0x853c('0x37')]=function(_0xa2a23c,_0x407e21){var _0x28dbcb={},_0x3a1816={},_0x5ed47d={'count':0x0,'rows':[]};var _0x5a5307=db[_0x853c('0x38')][_0x853c('0x39')];_0x3a1816[_0x853c('0x3a')]=_[_0x853c('0x3b')](_0x5a5307);_0x3a1816[_0x853c('0x3c')]=_[_0x853c('0x3b')](_0xa2a23c['query']);_0x3a1816[_0x853c('0x3d')]=_[_0x853c('0x3e')](_0x3a1816[_0x853c('0x3a')],_0x3a1816[_0x853c('0x3c')]);_0x28dbcb[_0x853c('0x3f')]=_[_0x853c('0x3e')](_0x3a1816[_0x853c('0x3a')],qs[_0x853c('0x40')](_0xa2a23c[_0x853c('0x3c')][_0x853c('0x40')]));_0x28dbcb['attributes']=_0x28dbcb['attributes']['length']?_0x28dbcb['attributes']:_0x3a1816[_0x853c('0x3a')];if(!_0xa2a23c[_0x853c('0x3c')][_0x853c('0x41')](_0x853c('0x42'))){_0x28dbcb[_0x853c('0x2e')]=qs[_0x853c('0x2e')](_0xa2a23c[_0x853c('0x3c')][_0x853c('0x2e')]);_0x28dbcb[_0x853c('0x2d')]=qs[_0x853c('0x2d')](_0xa2a23c[_0x853c('0x3c')][_0x853c('0x2d')]);}_0x28dbcb[_0x853c('0x43')]=qs[_0x853c('0x44')](_0xa2a23c[_0x853c('0x3c')][_0x853c('0x44')]);_0x28dbcb['where']=qs['filters'](_[_0x853c('0x45')](_0xa2a23c['query'],_0x3a1816[_0x853c('0x3d')]));if(_0xa2a23c[_0x853c('0x3c')][_0x853c('0x46')]){_0x28dbcb[_0x853c('0x47')]=_[_0x853c('0x48')](_0x28dbcb[_0x853c('0x47')],{'$or':_[_0x853c('0x49')](_0x5a5307,function(_0x35cc56){if(_0x35cc56[_0x853c('0x4a')]['key']!==_0x853c('0x4b')){var _0x19f96b={};_0x19f96b[_0x35cc56['field']]={'$like':'%'+_0xa2a23c[_0x853c('0x3c')][_0x853c('0x46')]+'%'};return _0x19f96b;}})});}_0x28dbcb=_[_0x853c('0x48')]({},_0x28dbcb,_0xa2a23c[_0x853c('0x4c')]);var _0x16bb18={'where':_0x28dbcb['where']};return db[_0x853c('0x38')][_0x853c('0x2c')](_0x16bb18)['then'](function(_0x4e2581){_0x5ed47d[_0x853c('0x2c')]=_0x4e2581;if(_0xa2a23c['query']['includeAll']){_0x28dbcb[_0x853c('0x4d')]=[{'all':!![]}];}return db[_0x853c('0x38')][_0x853c('0x4e')](_0x28dbcb);})[_0x853c('0x1c')](function(_0x4e5712){_0x5ed47d[_0x853c('0x4f')]=_0x4e5712;return _0x5ed47d;})['then'](respondWithFilteredResult(_0x407e21,_0x28dbcb))['catch'](handleError(_0x407e21,null));};exports[_0x853c('0x50')]=function(_0x1995d8,_0x448b93){var _0x38d857={'raw':![],'where':{'id':_0x1995d8['params']['id']}},_0x34f7f0={};_0x34f7f0['model']=_[_0x853c('0x3b')](db['ServicenowAccount']['rawAttributes']);_0x34f7f0[_0x853c('0x3c')]=_[_0x853c('0x3b')](_0x1995d8[_0x853c('0x3c')]);_0x34f7f0[_0x853c('0x3d')]=_[_0x853c('0x3e')](_0x34f7f0[_0x853c('0x3a')],_0x34f7f0[_0x853c('0x3c')]);_0x38d857[_0x853c('0x3f')]=_['intersection'](_0x34f7f0[_0x853c('0x3a')],qs['fields'](_0x1995d8[_0x853c('0x3c')][_0x853c('0x40')]));_0x38d857[_0x853c('0x3f')]=_0x38d857['attributes'][_0x853c('0x51')]?_0x38d857[_0x853c('0x3f')]:_0x34f7f0[_0x853c('0x3a')];if(_0x1995d8[_0x853c('0x3c')][_0x853c('0x52')]){_0x38d857[_0x853c('0x4d')]=[{'all':!![]}];}_0x38d857=_[_0x853c('0x48')]({},_0x38d857,_0x1995d8['options']);return db[_0x853c('0x38')][_0x853c('0x53')](_0x38d857)[_0x853c('0x1c')](handleEntityNotFound(_0x448b93,null))[_0x853c('0x1c')](respondWithResult(_0x448b93,null))['catch'](handleError(_0x448b93,null));};exports[_0x853c('0x54')]=function(_0x27a0ff,_0x201965){return db[_0x853c('0x38')][_0x853c('0x54')](_0x27a0ff['body'],{})[_0x853c('0x1c')](respondWithResult(_0x201965,0xc9))['catch'](handleError(_0x201965,null));};exports[_0x853c('0x55')]=function(_0x4d6f5c,_0x1ed1b2){if(_0x4d6f5c[_0x853c('0x56')]['id']){delete _0x4d6f5c['body']['id'];}return db[_0x853c('0x38')][_0x853c('0x53')]({'where':{'id':_0x4d6f5c[_0x853c('0x57')]['id']}})[_0x853c('0x1c')](handleEntityNotFound(_0x1ed1b2,null))[_0x853c('0x1c')](saveUpdates(_0x4d6f5c[_0x853c('0x56')],null))[_0x853c('0x1c')](respondWithResult(_0x1ed1b2,null))[_0x853c('0x27')](handleError(_0x1ed1b2,null));};exports[_0x853c('0x34')]=function(_0x49e94a,_0x451efd){return db['ServicenowAccount'][_0x853c('0x53')]({'where':{'id':_0x49e94a[_0x853c('0x57')]['id']}})[_0x853c('0x1c')](handleEntityNotFound(_0x451efd,null))[_0x853c('0x1c')](removeEntity(_0x451efd,null))['catch'](handleError(_0x451efd,null));};exports['getConfigurations']=function(_0x459f29,_0x5f3f0a,_0x281eca){var _0x31ffec={};var _0x646adf={};var _0x48e7b0;var _0x2ffa89;return db[_0x853c('0x38')][_0x853c('0x58')]({'where':{'id':_0x459f29[_0x853c('0x57')]['id']}})['then'](handleEntityNotFound(_0x5f3f0a,null))[_0x853c('0x1c')](function(_0xe1257b){if(_0xe1257b){_0x48e7b0=_0xe1257b;_0x646adf[_0x853c('0x3a')]=_['keys'](db['ServicenowConfiguration'][_0x853c('0x39')]);_0x646adf[_0x853c('0x3c')]=_[_0x853c('0x3b')](_0x459f29[_0x853c('0x3c')]);_0x646adf[_0x853c('0x3d')]=_[_0x853c('0x3e')](_0x646adf[_0x853c('0x3a')],_0x646adf[_0x853c('0x3c')]);_0x31ffec[_0x853c('0x3f')]=_[_0x853c('0x3e')](_0x646adf[_0x853c('0x3a')],qs[_0x853c('0x40')](_0x459f29[_0x853c('0x3c')]['fields']));_0x31ffec['attributes']=_0x31ffec['attributes']['length']?_0x31ffec['attributes']:_0x646adf['model'];_0x31ffec[_0x853c('0x43')]=qs['sort'](_0x459f29[_0x853c('0x3c')][_0x853c('0x44')]);_0x31ffec[_0x853c('0x47')]=qs[_0x853c('0x3d')](_[_0x853c('0x45')](_0x459f29[_0x853c('0x3c')],_0x646adf['filters']));if(_0x459f29[_0x853c('0x3c')]['filter']){_0x31ffec[_0x853c('0x47')]=_[_0x853c('0x48')](_0x31ffec['where'],{'$or':_[_0x853c('0x49')](_0x31ffec[_0x853c('0x3f')],function(_0x2b317d){var _0x526de2={};_0x526de2[_0x2b317d]={'$like':'%'+_0x459f29['query'][_0x853c('0x46')]+'%'};return _0x526de2;})});}_0x31ffec=_[_0x853c('0x48')]({},_0x31ffec,_0x459f29[_0x853c('0x4c')]);return _0x48e7b0[_0x853c('0x59')](_0x31ffec);}})['then'](function(_0x1b8d2a){if(_0x1b8d2a){_0x2ffa89=_0x1b8d2a[_0x853c('0x51')];if(!_0x459f29['query'][_0x853c('0x41')](_0x853c('0x42'))){_0x31ffec[_0x853c('0x2e')]=qs[_0x853c('0x2e')](_0x459f29[_0x853c('0x3c')][_0x853c('0x2e')]);_0x31ffec[_0x853c('0x2d')]=qs['offset'](_0x459f29[_0x853c('0x3c')][_0x853c('0x2d')]);}return _0x48e7b0['getConfigurations'](_0x31ffec);}})[_0x853c('0x1c')](function(_0x3ffaab){if(_0x3ffaab){return _0x3ffaab?{'count':_0x2ffa89,'rows':_0x3ffaab}:null;}})[_0x853c('0x1c')](respondWithResult(_0x5f3f0a,null))['catch'](handleError(_0x5f3f0a,null));};exports['addConfiguration']=function(_0x211314,_0x539a21,_0x1bd47c){if(_0x211314[_0x853c('0x56')]['id']){delete _0x211314['body']['id'];}return db[_0x853c('0x38')][_0x853c('0x58')]({'where':{'id':_0x211314[_0x853c('0x57')]['id']}})[_0x853c('0x1c')](handleEntityNotFound(_0x539a21,null))[_0x853c('0x1c')](function(_0xeaa065){if(_0xeaa065){_0x211314['body']['AccountId']=_0xeaa065['id'];_0x211314[_0x853c('0x56')]['Subjects']=integrations[_0x853c('0x5a')](_0x211314[_0x853c('0x56')][_0x853c('0x5b')],_0x211314[_0x853c('0x56')][_0x853c('0x4a')]);_0x211314[_0x853c('0x56')][_0x853c('0x5c')]=integrations[_0x853c('0x5d')](_0x211314[_0x853c('0x56')][_0x853c('0x5b')],_0x211314[_0x853c('0x56')][_0x853c('0x4a')]);return db['ServicenowConfiguration'][_0x853c('0x54')](_0x211314[_0x853c('0x56')],{'include':[{'model':db[_0x853c('0x5e')],'as':_0x853c('0x5f')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x853c('0x1c')](respondWithResult(_0x539a21,null))['catch'](handleError(_0x539a21,null));};exports[_0x853c('0x60')]=function(_0x15a37b,_0x22ae0b,_0x1970e1){var _0x3c2ddb=[_0x853c('0x61'),_0x853c('0x62'),'knowledge',_0x853c('0x63'),_0x853c('0x64'),_0x853c('0x65'),'incident_state',_0x853c('0x66'),_0x853c('0x67')];var _0x16e936=[_0x853c('0x68'),_0x853c('0x61'),_0x853c('0x69'),_0x853c('0x6a'),'upon_reject',_0x853c('0x6b'),_0x853c('0x6c'),_0x853c('0x62'),'approval_history',_0x853c('0x6d'),_0x853c('0x6e'),_0x853c('0x6f'),_0x853c('0x70'),_0x853c('0x71'),_0x853c('0x72'),_0x853c('0x73'),_0x853c('0x74'),_0x853c('0x75'),'knowledge',_0x853c('0x43'),'calendar_stc',_0x853c('0x76'),_0x853c('0x77'),_0x853c('0x78'),'impact',_0x853c('0x79'),_0x853c('0x7a'),_0x853c('0x7b'),_0x853c('0x7c'),'sys_domain_path',_0x853c('0x7d'),_0x853c('0x7e'),'expected_start',_0x853c('0x7f'),_0x853c('0x80'),_0x853c('0x81'),_0x853c('0x82'),_0x853c('0x83'),_0x853c('0x84'),_0x853c('0x85'),_0x853c('0x86'),'subcategory','work_notes',_0x853c('0x87'),'close_code',_0x853c('0x88'),_0x853c('0x89'),_0x853c('0x8a'),_0x853c('0x8b'),_0x853c('0x8c'),'additional_assignee_list','description',_0x853c('0x8d'),_0x853c('0x65'),_0x853c('0x8e'),_0x853c('0x8f'),'closed_by',_0x853c('0x90'),'parent_incident',_0x853c('0x91'),_0x853c('0x92'),'reopened_by',_0x853c('0x93'),_0x853c('0x94'),_0x853c('0x95'),_0x853c('0x96'),_0x853c('0x97'),_0x853c('0x98'),_0x853c('0x99'),_0x853c('0x66'),_0x853c('0x9a'),'sla_due',_0x853c('0x9b'),_0x853c('0x9c'),'due_date','sys_mod_count',_0x853c('0x9d'),_0x853c('0x9e'),_0x853c('0x9f'),_0x853c('0xa0'),_0x853c('0xa1'),_0x853c('0xa2'),_0x853c('0x67')];var _0x372fda='';var _0x4ee3b8='';var _0x2a08ed=[];var _0x3e1a4b='';var _0x4713f6='';var _0x2680c8=[];var _0xb63d7b='';var _0x561d53='';var _0x5bbc70={};return db['ServicenowAccount'][_0x853c('0x58')]({'where':{'id':_0x15a37b[_0x853c('0x57')]['id']},'attributes':['id','username',_0x853c('0xa3'),_0x853c('0xa4'),'remoteUri',_0x853c('0xa5')]})[_0x853c('0x1c')](handleEntityNotFound(_0x22ae0b,null))[_0x853c('0x1c')](function(_0x58e943){if(_0x58e943){_0x561d53=util[_0x853c('0xa6')](_0x853c('0xa7'),_0x58e943[_0x853c('0xa8')]);_0xb63d7b=util['format'](_0x853c('0xa9'),_0x58e943['remoteUri']);_0x5bbc70={'user':_0x58e943['username'],'pass':_0x58e943['password']};var _0x5d5643={'method':_0x853c('0xaa'),'uri':_0x561d53+_0x853c('0xab'),'auth':_0x5bbc70,'json':!![]};return rp(_0x5d5643);}})[_0x853c('0x1c')](function(_0x2c6018){if(_0x2c6018[_0x853c('0x26')][_0x853c('0x51')]>0x0){_0x372fda=_0x2c6018[_0x853c('0x26')];}console[_0x853c('0xac')](_0x853c('0xad'),_0x372fda);_0x2680c8=[];_0x4ee3b8=Object[_0x853c('0xae')]([],_0x372fda);_[_0x853c('0xaf')](_0x4ee3b8,function(_0x5b2b6d){return!_0x3c2ddb[_0x853c('0xb0')](_0x5b2b6d[_0x853c('0x36')]);});_0x4ee3b8[_0x853c('0xb1')](function(_0x50d955){var _0x4c8598=createFieldObject(_0xb63d7b,_0x5bbc70,_0x50d955[_0x853c('0xb2')],_0x50d955[_0x853c('0x36')],_0x50d955[_0x853c('0xb3')],![]);_0x2680c8[_0x853c('0xb4')](_0x4c8598);});return Promise['all'](_0x2680c8);})[_0x853c('0x1c')](function(_0x298b2b){_0x2a08ed=_0x298b2b;_0x3e1a4b=Object[_0x853c('0xae')]([],_0x372fda);console[_0x853c('0xac')](_0x853c('0xb5'),_0x372fda);_[_0x853c('0xaf')](_0x3e1a4b,function(_0x2b1f5a){return _0x16e936[_0x853c('0xb0')](_0x2b1f5a[_0x853c('0x36')]);});console[_0x853c('0xac')](_0x853c('0xb6'),_0x3e1a4b);_0x2680c8=[];_0x3e1a4b[_0x853c('0xb1')](function(_0x397ed6){var _0x5eaf27=createFieldObject(_0xb63d7b,_0x5bbc70,_0x397ed6[_0x853c('0xb2')],_0x397ed6['name'],_0x397ed6[_0x853c('0xb3')],!![]);_0x2680c8[_0x853c('0xb4')](_0x5eaf27);});return Promise[_0x853c('0xb7')](_0x2680c8);})[_0x853c('0x1c')](function(_0xab1f8){_0x4713f6=_0xab1f8;var _0x110d45=_0x2a08ed[_0x853c('0xb8')](_0x4713f6);return{'count':_0x110d45[_0x853c('0x51')],'rows':_0x110d45};})[_0x853c('0x1c')](respondWithResult(_0x22ae0b,null))[_0x853c('0x27')](function(_0x5de24f){console[_0x853c('0xac')](_0x853c('0xb9')+_0x5de24f);var _0x3ee4ea=_0x15a37b[_0x853c('0x3c')][_0x853c('0xba')]?0x1f4:_0x5de24f[_0x853c('0xbb')]||0x1f4;logger[_0x853c('0x23')](_0x5de24f[_0x853c('0x35')]);delete _0x5de24f[_0x853c('0x36')];if(_0x3ee4ea===0x191){_0x3ee4ea=0x190;}_0x22ae0b[_0x853c('0x29')](_0x3ee4ea)['send'](_0x15a37b[_0x853c('0x3c')][_0x853c('0xba')]?{'message':'Wrong\x20credentials','statusCode':_0x5de24f['statusCode']}:_0x5de24f);});};function createFieldObject(_0x43e8d6,_0x3acb0b,_0x263b96,_0x260e61,_0x4fee2e,_0x266508){return new Promise(function(_0x4c729b,_0x568cc7){var _0x55ab41={'id':_0x260e61,'name':_0x4fee2e,'custom':_0x266508};if(_0x263b96===_0x853c('0xbc')){_0x55ab41[_0x853c('0x4c')]=[{'name':'True','value':_0x853c('0xbd')},{'name':_0x853c('0xbe'),'value':_0x853c('0xbf')}];_0x4c729b(_0x55ab41);}else{var _0x3773b0={'method':_0x853c('0xaa'),'uri':_0x43e8d6+_0x853c('0xc0')+_0x260e61,'auth':_0x3acb0b,'json':!![]};return rp(_0x3773b0)[_0x853c('0x1c')](function(_0x3c69cc){var _0x2b1c7a=[];if(_0x3c69cc['result'][_0x853c('0x51')]>0x0){_0x3c69cc['result'][_0x853c('0xb1')](function(_0x329e2c){if(_0x329e2c[_0x853c('0xc1')]===_0x853c('0xbf')){var _0x4def3e={'name':_0x329e2c[_0x853c('0xb3')],'value':_0x329e2c[_0x853c('0xc2')]};_0x2b1c7a[_0x853c('0xb4')](_0x4def3e);}});}_0x55ab41[_0x853c('0x4c')]=_0x2b1c7a;if(_0x55ab41[_0x853c('0x4c')][_0x853c('0x51')]>0x0){_0x4c729b(_0x55ab41);}else{if(_0x266508==![]){_0x4c729b();}else{_0x4c729b(_0x55ab41);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 991b153..754aa5f 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 _0x2391=['request-promise','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xd3b789,_0x12a3bc){var _0x17088b=function(_0x220f95){while(--_0x220f95){_0xd3b789['push'](_0xd3b789['shift']());}};_0x17088b(++_0x12a3bc);}(_0x2391,0xc0));var _0x1239=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x2391[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x1239('0x0'));var util=require(_0x1239('0x1'));var logger=require(_0x1239('0x2'))(_0x1239('0x3'));var moment=require(_0x1239('0x4'));var BPromise=require(_0x1239('0x5'));var rp=require(_0x1239('0x6'));var attributes=require(_0x1239('0x7'));var integrations=require(_0x1239('0x8'));module[_0x1239('0x9')]=function(_0x561837,_0x4e0912){return _0x561837['define']('ServicenowAccount',attributes,{'tableName':_0x1239('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0bc=['exports','define','ServicenowAccount','int_servicenow_accounts','util','moment','bluebird','request-promise','./intServicenowAccount.attributes'];(function(_0x1b2255,_0x3de34f){var _0x33e57d=function(_0x2f9cce){while(--_0x2f9cce){_0x1b2255['push'](_0x1b2255['shift']());}};_0x33e57d(++_0x3de34f);}(_0xa0bc,0x148));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xca0b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xca0b('0x1'));var BPromise=require(_0xca0b('0x2'));var rp=require(_0xca0b('0x3'));var attributes=require(_0xca0b('0x4'));var integrations=require('../../components/integrations/configuration');module[_0xca0b('0x5')]=function(_0x3e1ceb,_0x51a0fa){return _0x3e1ceb[_0xca0b('0x6')](_0xca0b('0x7'),attributes,{'tableName':_0xca0b('0x8'),'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 f7ff42e..25dc93b 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 _0x8bf2=['debug','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','attributes','limit','include','model','map','where','then','ShowServicenowAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','request\x20sent'];(function(_0xa3c06b,_0x490f99){var _0x33aa1d=function(_0x23a88e){while(--_0x23a88e){_0xa3c06b['push'](_0xa3c06b['shift']());}};_0x33aa1d(++_0x490f99);}(_0x8bf2,0x1f1));var _0x28bf=function(_0x1dd64b,_0x50abfa){_0x1dd64b=_0x1dd64b-0x0;var _0x3f81f4=_0x8bf2[_0x1dd64b];return _0x3f81f4;};'use strict';var _=require('lodash');var util=require(_0x28bf('0x0'));var moment=require(_0x28bf('0x1'));var BPromise=require(_0x28bf('0x2'));var rs=require(_0x28bf('0x3'));var fs=require('fs');var Redis=require(_0x28bf('0x4'));var db=require(_0x28bf('0x5'))['db'];var utils=require(_0x28bf('0x6'));var logger=require('../../config/logger')(_0x28bf('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x28bf('0x8')][_0x28bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2facbb,_0x29a3cc,_0xb35ca1){return new BPromise(function(_0x13eb65,_0x18ed86){return client[_0x28bf('0xa')](_0x2facbb,_0xb35ca1)['then'](function(_0x36f72d){logger[_0x28bf('0xb')]('ServicenowAccount,\x20%s,\x20%s',_0x29a3cc,_0x28bf('0xc'));logger[_0x28bf('0xd')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x29a3cc,'request\x20sent',JSON[_0x28bf('0xe')](_0x36f72d));if(_0x36f72d[_0x28bf('0xf')]){if(_0x36f72d[_0x28bf('0xf')][_0x28bf('0x10')]===0x1f4){logger[_0x28bf('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x29a3cc,_0x36f72d['error']['message']);return _0x18ed86(_0x36f72d[_0x28bf('0xf')][_0x28bf('0x11')]);}logger[_0x28bf('0xf')](_0x28bf('0x12'),_0x29a3cc,_0x36f72d[_0x28bf('0xf')]['message']);return _0x13eb65(_0x36f72d[_0x28bf('0xf')][_0x28bf('0x11')]);}else{logger[_0x28bf('0xb')](_0x28bf('0x12'),_0x29a3cc,'request\x20sent');_0x13eb65(_0x36f72d[_0x28bf('0x13')]['message']);}})[_0x28bf('0x14')](function(_0xe51b4f){logger[_0x28bf('0xf')](_0x28bf('0x12'),_0x29a3cc,_0xe51b4f);_0x18ed86(_0xe51b4f);});});}exports[_0x28bf('0x15')]=function(_0x3cc391){var _0xf40fda=this;return new Promise(function(_0x3a569a,_0x473bb4){return db[_0x28bf('0x16')][_0x28bf('0x17')]({'raw':_0x3cc391[_0x28bf('0x18')]?_0x3cc391['options'][_0x28bf('0x19')]===undefined?!![]:![]:!![],'where':_0x3cc391[_0x28bf('0x18')]?_0x3cc391[_0x28bf('0x18')]['where']||null:null,'attributes':_0x3cc391[_0x28bf('0x18')]?_0x3cc391[_0x28bf('0x18')][_0x28bf('0x1a')]||null:null,'limit':_0x3cc391[_0x28bf('0x18')]?_0x3cc391[_0x28bf('0x18')][_0x28bf('0x1b')]||null:null,'include':_0x3cc391[_0x28bf('0x18')]?_0x3cc391[_0x28bf('0x18')][_0x28bf('0x1c')]?_['map'](_0x3cc391[_0x28bf('0x18')][_0x28bf('0x1c')],function(_0xfb0e2){return{'model':db[_0xfb0e2[_0x28bf('0x1d')]],'as':_0xfb0e2['as'],'attributes':_0xfb0e2['attributes'],'include':_0xfb0e2[_0x28bf('0x1c')]?_[_0x28bf('0x1e')](_0xfb0e2[_0x28bf('0x1c')],function(_0x40a820){return{'model':db[_0x40a820[_0x28bf('0x1d')]],'as':_0x40a820['as'],'attributes':_0x40a820[_0x28bf('0x1a')],'include':_0x40a820[_0x28bf('0x1c')]?_[_0x28bf('0x1e')](_0x40a820['include'],function(_0x43ccb5){return{'model':db[_0x43ccb5['model']],'as':_0x43ccb5['as'],'attributes':_0x43ccb5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x7e44a6){logger['info'](_0x28bf('0x15'),_0x3cc391);logger['debug'](_0x28bf('0x15'),_0x3cc391,JSON['stringify'](_0x7e44a6));_0x3a569a(_0x7e44a6);})[_0x28bf('0x14')](function(_0x47ba67){logger['error']('GetServicenowAccount',_0x47ba67[_0x28bf('0x11')],_0x3cc391);_0x473bb4(_0xf40fda[_0x28bf('0xf')](0x1f4,_0x47ba67[_0x28bf('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x1f8cc3){var _0x1d835a=this;return new Promise(function(_0x42fc04,_0x19aab1){return db[_0x28bf('0x16')]['find']({'raw':_0x1f8cc3['options']?_0x1f8cc3[_0x28bf('0x18')][_0x28bf('0x19')]===undefined?!![]:![]:!![],'where':_0x1f8cc3[_0x28bf('0x18')]?_0x1f8cc3[_0x28bf('0x18')][_0x28bf('0x1f')]||null:null,'attributes':_0x1f8cc3[_0x28bf('0x18')]?_0x1f8cc3[_0x28bf('0x18')][_0x28bf('0x1a')]||null:null,'include':_0x1f8cc3[_0x28bf('0x18')]?_0x1f8cc3[_0x28bf('0x18')][_0x28bf('0x1c')]?_[_0x28bf('0x1e')](_0x1f8cc3[_0x28bf('0x18')]['include'],function(_0x9ae764){return{'model':db[_0x9ae764[_0x28bf('0x1d')]],'as':_0x9ae764['as'],'attributes':_0x9ae764[_0x28bf('0x1a')],'include':_0x9ae764[_0x28bf('0x1c')]?_[_0x28bf('0x1e')](_0x9ae764[_0x28bf('0x1c')],function(_0x542280){return{'model':db[_0x542280[_0x28bf('0x1d')]],'as':_0x542280['as'],'attributes':_0x542280[_0x28bf('0x1a')],'include':_0x542280[_0x28bf('0x1c')]?_['map'](_0x542280['include'],function(_0x9793b5){return{'model':db[_0x9793b5[_0x28bf('0x1d')]],'as':_0x9793b5['as'],'attributes':_0x9793b5[_0x28bf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x28bf('0x20')](function(_0x90ca81){logger[_0x28bf('0xb')](_0x28bf('0x21'),_0x1f8cc3);logger[_0x28bf('0xd')]('ShowServicenowAccount',_0x1f8cc3,JSON['stringify'](_0x90ca81));_0x42fc04(_0x90ca81);})[_0x28bf('0x14')](function(_0x1eca51){logger['error'](_0x28bf('0x21'),_0x1eca51['message'],_0x1f8cc3);_0x19aab1(_0x1d835a[_0x28bf('0xf')](0x1f4,_0x1eca51[_0x28bf('0x11')]));});});}; \ No newline at end of file +var _0x6ca1=['lodash','util','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit','map','model','include','debug','ShowServicenowAccount'];(function(_0x2a4a99,_0x64b4a){var _0x1cef2f=function(_0x43beef){while(--_0x43beef){_0x2a4a99['push'](_0x2a4a99['shift']());}};_0x1cef2f(++_0x64b4a);}(_0x6ca1,0x1f0));var _0x16ca=function(_0x292388,_0x4a7058){_0x292388=_0x292388-0x0;var _0x549241=_0x6ca1[_0x292388];return _0x549241;};'use strict';var _=require(_0x16ca('0x0'));var util=require(_0x16ca('0x1'));var moment=require('moment');var BPromise=require(_0x16ca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x16ca('0x3'));var logger=require('../../config/logger')(_0x16ca('0x4'));var config=require(_0x16ca('0x5'));var jayson=require(_0x16ca('0x6'));var client=jayson[_0x16ca('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x587773,_0x25a0bd,_0x193c34){return new BPromise(function(_0x173922,_0x3a7291){return client['request'](_0x587773,_0x193c34)[_0x16ca('0x8')](function(_0x148d3f){logger[_0x16ca('0x9')](_0x16ca('0xa'),_0x25a0bd,'request\x20sent');logger['debug'](_0x16ca('0xb'),_0x25a0bd,_0x16ca('0xc'),JSON[_0x16ca('0xd')](_0x148d3f));if(_0x148d3f[_0x16ca('0xe')]){if(_0x148d3f['error'][_0x16ca('0xf')]===0x1f4){logger[_0x16ca('0xe')](_0x16ca('0xa'),_0x25a0bd,_0x148d3f[_0x16ca('0xe')][_0x16ca('0x10')]);return _0x3a7291(_0x148d3f[_0x16ca('0xe')][_0x16ca('0x10')]);}logger[_0x16ca('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x25a0bd,_0x148d3f[_0x16ca('0xe')]['message']);return _0x173922(_0x148d3f[_0x16ca('0xe')][_0x16ca('0x10')]);}else{logger[_0x16ca('0x9')]('ServicenowAccount,\x20%s,\x20%s',_0x25a0bd,_0x16ca('0xc'));_0x173922(_0x148d3f[_0x16ca('0x11')][_0x16ca('0x10')]);}})[_0x16ca('0x12')](function(_0x2e3983){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x25a0bd,_0x2e3983);_0x3a7291(_0x2e3983);});});}exports[_0x16ca('0x13')]=function(_0x51d722){var _0x5a394c=this;return new Promise(function(_0x1dc78c,_0x173c99){return db[_0x16ca('0x14')]['findAll']({'raw':_0x51d722[_0x16ca('0x15')]?_0x51d722[_0x16ca('0x15')][_0x16ca('0x16')]===undefined?!![]:![]:!![],'where':_0x51d722[_0x16ca('0x15')]?_0x51d722['options'][_0x16ca('0x17')]||null:null,'attributes':_0x51d722[_0x16ca('0x15')]?_0x51d722[_0x16ca('0x15')][_0x16ca('0x18')]||null:null,'limit':_0x51d722[_0x16ca('0x15')]?_0x51d722[_0x16ca('0x15')][_0x16ca('0x19')]||null:null,'include':_0x51d722['options']?_0x51d722[_0x16ca('0x15')]['include']?_[_0x16ca('0x1a')](_0x51d722['options']['include'],function(_0x3f2e38){return{'model':db[_0x3f2e38[_0x16ca('0x1b')]],'as':_0x3f2e38['as'],'attributes':_0x3f2e38[_0x16ca('0x18')],'include':_0x3f2e38[_0x16ca('0x1c')]?_['map'](_0x3f2e38[_0x16ca('0x1c')],function(_0x41e021){return{'model':db[_0x41e021[_0x16ca('0x1b')]],'as':_0x41e021['as'],'attributes':_0x41e021[_0x16ca('0x18')],'include':_0x41e021[_0x16ca('0x1c')]?_['map'](_0x41e021[_0x16ca('0x1c')],function(_0x60ad7){return{'model':db[_0x60ad7[_0x16ca('0x1b')]],'as':_0x60ad7['as'],'attributes':_0x60ad7['attributes']};}):[]};}):[]};}):[]:[]})[_0x16ca('0x8')](function(_0x1404a5){logger[_0x16ca('0x9')]('GetServicenowAccount',_0x51d722);logger[_0x16ca('0x1d')](_0x16ca('0x13'),_0x51d722,JSON['stringify'](_0x1404a5));_0x1dc78c(_0x1404a5);})[_0x16ca('0x12')](function(_0x125f75){logger[_0x16ca('0xe')](_0x16ca('0x13'),_0x125f75[_0x16ca('0x10')],_0x51d722);_0x173c99(_0x5a394c['error'](0x1f4,_0x125f75['message']));});});};exports[_0x16ca('0x1e')]=function(_0x377122){var _0x309f73=this;return new Promise(function(_0x900238,_0x4bf7dd){return db[_0x16ca('0x14')]['find']({'raw':_0x377122[_0x16ca('0x15')]?_0x377122[_0x16ca('0x15')][_0x16ca('0x16')]===undefined?!![]:![]:!![],'where':_0x377122[_0x16ca('0x15')]?_0x377122[_0x16ca('0x15')][_0x16ca('0x17')]||null:null,'attributes':_0x377122[_0x16ca('0x15')]?_0x377122[_0x16ca('0x15')][_0x16ca('0x18')]||null:null,'include':_0x377122[_0x16ca('0x15')]?_0x377122[_0x16ca('0x15')]['include']?_[_0x16ca('0x1a')](_0x377122[_0x16ca('0x15')]['include'],function(_0x2327ab){return{'model':db[_0x2327ab['model']],'as':_0x2327ab['as'],'attributes':_0x2327ab[_0x16ca('0x18')],'include':_0x2327ab[_0x16ca('0x1c')]?_[_0x16ca('0x1a')](_0x2327ab['include'],function(_0x16a6b6){return{'model':db[_0x16a6b6[_0x16ca('0x1b')]],'as':_0x16a6b6['as'],'attributes':_0x16a6b6[_0x16ca('0x18')],'include':_0x16a6b6[_0x16ca('0x1c')]?_['map'](_0x16a6b6[_0x16ca('0x1c')],function(_0x1827a2){return{'model':db[_0x1827a2[_0x16ca('0x1b')]],'as':_0x1827a2['as'],'attributes':_0x1827a2[_0x16ca('0x18')]};}):[]};}):[]};}):[]:[]})[_0x16ca('0x8')](function(_0x3ab549){logger[_0x16ca('0x9')](_0x16ca('0x1e'),_0x377122);logger[_0x16ca('0x1d')](_0x16ca('0x1e'),_0x377122,JSON[_0x16ca('0xd')](_0x3ab549));_0x900238(_0x3ab549);})[_0x16ca('0x12')](function(_0x1e879e){logger[_0x16ca('0xe')](_0x16ca('0x1e'),_0x1e879e[_0x16ca('0x10')],_0x377122);_0x4bf7dd(_0x309f73[_0x16ca('0xe')](0x1f4,_0x1e879e[_0x16ca('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 3d3947f..0f8808e 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 _0x557f=['update','delete','exports','multer','path','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','post','put'];(function(_0x388513,_0x517030){var _0x48e189=function(_0x5a52b8){while(--_0x5a52b8){_0x388513['push'](_0x388513['shift']());}};_0x48e189(++_0x517030);}(_0x557f,0x146));var _0xf557=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x557f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf557('0x0'));var util=require('util');var path=require(_0xf557('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf557('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xf557('0x3'));var config=require(_0xf557('0x4'));var controller=require(_0xf557('0x5'));router[_0xf557('0x6')]('/',auth[_0xf557('0x7')](),controller[_0xf557('0x8')]);router[_0xf557('0x6')](_0xf557('0x9'),auth[_0xf557('0x7')](),controller[_0xf557('0xa')]);router[_0xf557('0x6')](_0xf557('0xb'),auth['isAuthenticated'](),controller[_0xf557('0xc')]);router[_0xf557('0x6')](_0xf557('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf557('0x6')]('/:id/descriptions',auth[_0xf557('0x7')](),controller['getDescriptions']);router[_0xf557('0xe')]('/',auth[_0xf557('0x7')](),controller['create']);router[_0xf557('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf557('0x10')]);router[_0xf557('0x11')](_0xf557('0x9'),auth[_0xf557('0x7')](),controller['destroy']);module[_0xf557('0x12')]=router; \ No newline at end of file +var _0x1cba=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x20f0b7,_0x2dd297){var _0x78b55f=function(_0x3b8eb5){while(--_0x3b8eb5){_0x20f0b7['push'](_0x20f0b7['shift']());}};_0x78b55f(++_0x2dd297);}(_0x1cba,0x126));var _0xa1cb=function(_0x3c3128,_0x117d7d){_0x3c3128=_0x3c3128-0x0;var _0x26b55e=_0x1cba[_0x3c3128];return _0x26b55e;};'use strict';var multer=require('multer');var util=require(_0xa1cb('0x0'));var path=require(_0xa1cb('0x1'));var timeout=require(_0xa1cb('0x2'));var express=require(_0xa1cb('0x3'));var router=express[_0xa1cb('0x4')]();var auth=require(_0xa1cb('0x5'));var interaction=require(_0xa1cb('0x6'));var config=require(_0xa1cb('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0xa1cb('0x8')]('/',auth['isAuthenticated'](),controller[_0xa1cb('0x9')]);router[_0xa1cb('0x8')](_0xa1cb('0xa'),auth[_0xa1cb('0xb')](),controller['show']);router['get'](_0xa1cb('0xc'),auth[_0xa1cb('0xb')](),controller['getFields']);router[_0xa1cb('0x8')](_0xa1cb('0xd'),auth[_0xa1cb('0xb')](),controller[_0xa1cb('0xe')]);router[_0xa1cb('0x8')](_0xa1cb('0xf'),auth[_0xa1cb('0xb')](),controller[_0xa1cb('0x10')]);router[_0xa1cb('0x11')]('/',auth[_0xa1cb('0xb')](),controller['create']);router[_0xa1cb('0x12')](_0xa1cb('0xa'),auth[_0xa1cb('0xb')](),controller[_0xa1cb('0x13')]);router[_0xa1cb('0x14')](_0xa1cb('0xa'),auth[_0xa1cb('0xb')](),controller[_0xa1cb('0x15')]);module[_0xa1cb('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index a68d364..67f6353 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 _0x91db=['STRING','sequelize','exports'];(function(_0x1da618,_0x410d3a){var _0x7f0f5b=function(_0x4572aa){while(--_0x4572aa){_0x1da618['push'](_0x1da618['shift']());}};_0x7f0f5b(++_0x410d3a);}(_0x91db,0x181));var _0xb91d=function(_0x107d56,_0x50f3c5){_0x107d56=_0x107d56-0x0;var _0x42ab38=_0x91db[_0x107d56];return _0x42ab38;};'use strict';var Sequelize=require(_0xb91d('0x0'));module[_0xb91d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb91d('0x2')]}}; \ No newline at end of file +var _0x150b=['exports','STRING','sequelize'];(function(_0x5ca2ff,_0x304690){var _0x2d0936=function(_0x5a0a4b){while(--_0x5a0a4b){_0x5ca2ff['push'](_0x5ca2ff['shift']());}};_0x2d0936(++_0x304690);}(_0x150b,0x12b));var _0xb150=function(_0x4f9d26,_0x641341){_0x4f9d26=_0x4f9d26-0x0;var _0x57debc=_0x150b[_0x4f9d26];return _0x57debc;};'use strict';var Sequelize=require(_0xb150('0x0'));module[_0xb150('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb150('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index be76705..729a84b 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 _0xb58b=['status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','rawAttributes','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','ServicenowConfiguration','includeAll','include','findAll','show','params','find','create','body','findOne','ServicenowField','getFields','hasOwnProperty','getSubjects','getDescriptions','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','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','then','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','ServicenowConfiguration,\x20%s,\x20%s','info','result','catch','sendStatus'];(function(_0x4ffec6,_0x130c12){var _0x321ed4=function(_0x1bb34c){while(--_0x1bb34c){_0x4ffec6['push'](_0x4ffec6['shift']());}};_0x321ed4(++_0x130c12);}(_0xb58b,0x1f1));var _0xbb58=function(_0x4fff10,_0x4938ec){_0x4fff10=_0x4fff10-0x0;var _0x29a7a7=_0xb58b[_0x4fff10];return _0x29a7a7;};'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'];var jayson=require(_0xbb58('0x17'));var client=jayson['client'][_0xbb58('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x18810f,_0x4cda21,_0x132511,_0xdc68b9){return new BPromise(function(_0x14106f,_0x3b9406){var _0x19ceda=_0xdc68b9||client;return _0x19ceda['request'](_0x18810f,_0x132511)[_0xbb58('0x19')](function(_0x23fd15){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x4cda21,_0xbb58('0x1a'));logger[_0xbb58('0x1b')](_0xbb58('0x1c'),_0x4cda21,'request\x20sent',JSON['stringify'](_0x23fd15));if(_0x23fd15['error']){if(_0x23fd15['error'][_0xbb58('0x1d')]===0x1f4){logger[_0xbb58('0x1e')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4cda21,_0x23fd15[_0xbb58('0x1e')]['message']);return _0x3b9406(_0x23fd15[_0xbb58('0x1e')][_0xbb58('0x1f')]);}logger[_0xbb58('0x1e')](_0xbb58('0x20'),_0x4cda21,_0x23fd15[_0xbb58('0x1e')][_0xbb58('0x1f')]);return _0x14106f(_0x23fd15[_0xbb58('0x1e')]['message']);}else{logger[_0xbb58('0x21')](_0xbb58('0x20'),_0x4cda21,_0xbb58('0x1a'));_0x14106f(_0x23fd15[_0xbb58('0x22')][_0xbb58('0x1f')]);}})[_0xbb58('0x23')](function(_0x49453a){logger[_0xbb58('0x1e')](_0xbb58('0x20'),_0x4cda21,_0x49453a);_0x3b9406(_0x49453a);});});}function respondWithStatusCode(_0x4f74a0,_0x27806d){_0x27806d=_0x27806d||0xcc;return function(_0x53b693){if(_0x53b693){return _0x4f74a0[_0xbb58('0x24')](_0x27806d);}return _0x4f74a0[_0xbb58('0x25')](_0x27806d)[_0xbb58('0x26')]();};}function respondWithResult(_0x3e215c,_0x2d111c){_0x2d111c=_0x2d111c||0xc8;return function(_0xd4f956){if(_0xd4f956){return _0x3e215c[_0xbb58('0x25')](_0x2d111c)[_0xbb58('0x27')](_0xd4f956);}};}function respondWithFilteredResult(_0x4e0303,_0x283dff){return function(_0x3bd550){if(_0x3bd550){var _0x1be0ae=_0x3bd550[_0xbb58('0x28')],_0x129094=_0x283dff[_0xbb58('0x29')],_0x8e9ed9=_0x283dff[_0xbb58('0x29')]+_0x283dff[_0xbb58('0x2a')],_0x521d0c;if(_0x8e9ed9>=_0x1be0ae){_0x8e9ed9=_0x1be0ae;_0x521d0c=0xc8;}else{_0x521d0c=0xce;}_0x4e0303[_0xbb58('0x25')](_0x521d0c);return _0x4e0303[_0xbb58('0x2b')](_0xbb58('0x2c'),_0x129094+'-'+_0x8e9ed9+'/'+_0x1be0ae)[_0xbb58('0x27')](_0x3bd550);}return null;};}function patchUpdates(_0x3559b6){return function(_0x573cca){try{jsonpatch[_0xbb58('0x2d')](_0x573cca,_0x3559b6,!![]);}catch(_0xe46bc1){return BPromise[_0xbb58('0x2e')](_0xe46bc1);}return _0x573cca[_0xbb58('0x2f')]();};}function saveUpdates(_0x3304b9,_0x9d379f){return function(_0x1ba526){if(_0x1ba526){return _0x1ba526[_0xbb58('0x30')](_0x3304b9)[_0xbb58('0x19')](function(_0x5ac926){return _0x5ac926;});}return null;};}function removeEntity(_0xc39e3f,_0x22329b){return function(_0x3edc34){if(_0x3edc34){return _0x3edc34[_0xbb58('0x31')]()[_0xbb58('0x19')](function(){_0xc39e3f[_0xbb58('0x25')](0xcc)[_0xbb58('0x26')]();});}};}function handleEntityNotFound(_0x2599af,_0x23816c){return function(_0x1cae1c){if(!_0x1cae1c){_0x2599af[_0xbb58('0x24')](0x194);}return _0x1cae1c;};}function handleError(_0x34583e,_0x2f5967){_0x2f5967=_0x2f5967||0x1f4;return function(_0x59b935){logger['error'](_0x59b935['stack']);if(_0x59b935[_0xbb58('0x32')]){delete _0x59b935[_0xbb58('0x32')];}_0x34583e[_0xbb58('0x25')](_0x2f5967)[_0xbb58('0x33')](_0x59b935);};}exports[_0xbb58('0x34')]=function(_0x3333e5,_0x3093bf){var _0x29137f={},_0x5db313={},_0x2fbf90={'count':0x0,'rows':[]};var _0x230859=db['ServicenowConfiguration'][_0xbb58('0x35')];_0x5db313['model']=_[_0xbb58('0x36')](_0x230859);_0x5db313['query']=_[_0xbb58('0x36')](_0x3333e5[_0xbb58('0x37')]);_0x5db313['filters']=_[_0xbb58('0x38')](_0x5db313[_0xbb58('0x39')],_0x5db313[_0xbb58('0x37')]);_0x29137f[_0xbb58('0x3a')]=_[_0xbb58('0x38')](_0x5db313[_0xbb58('0x39')],qs[_0xbb58('0x3b')](_0x3333e5[_0xbb58('0x37')]['fields']));_0x29137f[_0xbb58('0x3a')]=_0x29137f[_0xbb58('0x3a')][_0xbb58('0x3c')]?_0x29137f['attributes']:_0x5db313['model'];if(!_0x3333e5[_0xbb58('0x37')]['hasOwnProperty'](_0xbb58('0x3d'))){_0x29137f[_0xbb58('0x2a')]=qs[_0xbb58('0x2a')](_0x3333e5['query']['limit']);_0x29137f[_0xbb58('0x29')]=qs[_0xbb58('0x29')](_0x3333e5[_0xbb58('0x37')][_0xbb58('0x29')]);}_0x29137f[_0xbb58('0x3e')]=qs[_0xbb58('0x3f')](_0x3333e5['query'][_0xbb58('0x3f')]);_0x29137f[_0xbb58('0x40')]=qs[_0xbb58('0x41')](_[_0xbb58('0x42')](_0x3333e5[_0xbb58('0x37')],_0x5db313[_0xbb58('0x41')]));if(_0x3333e5['query'][_0xbb58('0x43')]){_0x29137f['where']=_[_0xbb58('0x44')](_0x29137f[_0xbb58('0x40')],{'$or':_[_0xbb58('0x45')](_0x230859,function(_0x45817f){if(_0x45817f['type'][_0xbb58('0x46')]!==_0xbb58('0x47')){var _0x10d5ba={};_0x10d5ba[_0x45817f[_0xbb58('0x48')]]={'$like':'%'+_0x3333e5['query'][_0xbb58('0x43')]+'%'};return _0x10d5ba;}})});}_0x29137f=_['merge']({},_0x29137f,_0x3333e5[_0xbb58('0x49')]);var _0x2af9c3={'where':_0x29137f[_0xbb58('0x40')]};return db[_0xbb58('0x4a')][_0xbb58('0x28')](_0x2af9c3)[_0xbb58('0x19')](function(_0x666a57){_0x2fbf90[_0xbb58('0x28')]=_0x666a57;if(_0x3333e5[_0xbb58('0x37')][_0xbb58('0x4b')]){_0x29137f[_0xbb58('0x4c')]=[{'all':!![]}];}return db[_0xbb58('0x4a')][_0xbb58('0x4d')](_0x29137f);})['then'](function(_0xc690d){_0x2fbf90['rows']=_0xc690d;return _0x2fbf90;})['then'](respondWithFilteredResult(_0x3093bf,_0x29137f))[_0xbb58('0x23')](handleError(_0x3093bf,null));};exports[_0xbb58('0x4e')]=function(_0x110849,_0x1aaad9){var _0x8877b1={'raw':![],'where':{'id':_0x110849[_0xbb58('0x4f')]['id']}},_0x2ab2b6={};_0x2ab2b6[_0xbb58('0x39')]=_[_0xbb58('0x36')](db[_0xbb58('0x4a')][_0xbb58('0x35')]);_0x2ab2b6['query']=_[_0xbb58('0x36')](_0x110849[_0xbb58('0x37')]);_0x2ab2b6['filters']=_[_0xbb58('0x38')](_0x2ab2b6[_0xbb58('0x39')],_0x2ab2b6[_0xbb58('0x37')]);_0x8877b1[_0xbb58('0x3a')]=_['intersection'](_0x2ab2b6[_0xbb58('0x39')],qs['fields'](_0x110849[_0xbb58('0x37')][_0xbb58('0x3b')]));_0x8877b1[_0xbb58('0x3a')]=_0x8877b1['attributes'][_0xbb58('0x3c')]?_0x8877b1[_0xbb58('0x3a')]:_0x2ab2b6['model'];if(_0x110849[_0xbb58('0x37')]['includeAll']){_0x8877b1[_0xbb58('0x4c')]=[{'all':!![]}];}_0x8877b1=_[_0xbb58('0x44')]({},_0x8877b1,_0x110849[_0xbb58('0x49')]);return db[_0xbb58('0x4a')][_0xbb58('0x50')](_0x8877b1)[_0xbb58('0x19')](handleEntityNotFound(_0x1aaad9,null))[_0xbb58('0x19')](respondWithResult(_0x1aaad9,null))['catch'](handleError(_0x1aaad9,null));};exports[_0xbb58('0x51')]=function(_0x1fd892,_0x592da8){return db[_0xbb58('0x4a')][_0xbb58('0x51')](_0x1fd892['body'],{})[_0xbb58('0x19')](respondWithResult(_0x592da8,0xc9))[_0xbb58('0x23')](handleError(_0x592da8,null));};exports[_0xbb58('0x30')]=function(_0x4e21e0,_0x376569){if(_0x4e21e0[_0xbb58('0x52')]['id']){delete _0x4e21e0[_0xbb58('0x52')]['id'];}return db['ServicenowConfiguration'][_0xbb58('0x50')]({'where':{'id':_0x4e21e0['params']['id']}})[_0xbb58('0x19')](handleEntityNotFound(_0x376569,null))[_0xbb58('0x19')](saveUpdates(_0x4e21e0[_0xbb58('0x52')],null))['then'](respondWithResult(_0x376569,null))['catch'](handleError(_0x376569,null));};exports[_0xbb58('0x31')]=function(_0x40c55d,_0x37bb99){return db[_0xbb58('0x4a')][_0xbb58('0x50')]({'where':{'id':_0x40c55d['params']['id']}})[_0xbb58('0x19')](handleEntityNotFound(_0x37bb99,null))[_0xbb58('0x19')](removeEntity(_0x37bb99,null))[_0xbb58('0x23')](handleError(_0x37bb99,null));};exports['getFields']=function(_0x5ad867,_0x62b12c,_0x2bc858){var _0x3365ae={};var _0x3f5add={};var _0x5e7ae0;var _0x1174b1;return db[_0xbb58('0x4a')][_0xbb58('0x53')]({'where':{'id':_0x5ad867[_0xbb58('0x4f')]['id']}})[_0xbb58('0x19')](handleEntityNotFound(_0x62b12c,null))[_0xbb58('0x19')](function(_0x85278c){if(_0x85278c){_0x5e7ae0=_0x85278c;_0x3f5add[_0xbb58('0x39')]=_['keys'](db[_0xbb58('0x54')]['rawAttributes']);_0x3f5add[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x5ad867[_0xbb58('0x37')]);_0x3f5add[_0xbb58('0x41')]=_[_0xbb58('0x38')](_0x3f5add[_0xbb58('0x39')],_0x3f5add[_0xbb58('0x37')]);_0x3365ae[_0xbb58('0x3a')]=_[_0xbb58('0x38')](_0x3f5add[_0xbb58('0x39')],qs[_0xbb58('0x3b')](_0x5ad867['query'][_0xbb58('0x3b')]));_0x3365ae[_0xbb58('0x3a')]=_0x3365ae[_0xbb58('0x3a')]['length']?_0x3365ae[_0xbb58('0x3a')]:_0x3f5add['model'];_0x3365ae[_0xbb58('0x3e')]=qs[_0xbb58('0x3f')](_0x5ad867['query'][_0xbb58('0x3f')]);_0x3365ae[_0xbb58('0x40')]=qs[_0xbb58('0x41')](_[_0xbb58('0x42')](_0x5ad867[_0xbb58('0x37')],_0x3f5add['filters']));if(_0x5ad867['query'][_0xbb58('0x43')]){_0x3365ae[_0xbb58('0x40')]=_[_0xbb58('0x44')](_0x3365ae['where'],{'$or':_[_0xbb58('0x45')](_0x3365ae[_0xbb58('0x3a')],function(_0x581506){var _0xfcad4c={};_0xfcad4c[_0x581506]={'$like':'%'+_0x5ad867[_0xbb58('0x37')]['filter']+'%'};return _0xfcad4c;})});}_0x3365ae=_[_0xbb58('0x44')]({},_0x3365ae,_0x5ad867[_0xbb58('0x49')]);return _0x5e7ae0[_0xbb58('0x55')](_0x3365ae);}})[_0xbb58('0x19')](function(_0x3cface){if(_0x3cface){_0x1174b1=_0x3cface['length'];if(!_0x5ad867[_0xbb58('0x37')][_0xbb58('0x56')](_0xbb58('0x3d'))){_0x3365ae[_0xbb58('0x2a')]=qs[_0xbb58('0x2a')](_0x5ad867['query']['limit']);_0x3365ae[_0xbb58('0x29')]=qs['offset'](_0x5ad867[_0xbb58('0x37')][_0xbb58('0x29')]);}return _0x5e7ae0[_0xbb58('0x55')](_0x3365ae);}})[_0xbb58('0x19')](function(_0x3211a9){if(_0x3211a9){return _0x3211a9?{'count':_0x1174b1,'rows':_0x3211a9}:null;}})[_0xbb58('0x19')](respondWithResult(_0x62b12c,null))[_0xbb58('0x23')](handleError(_0x62b12c,null));};exports[_0xbb58('0x57')]=function(_0x1529cf,_0x38129a,_0x4c1162){var _0x418d19={};var _0x30d4c8={};var _0x3830a6;var _0x5b6508;return db[_0xbb58('0x4a')]['findOne']({'where':{'id':_0x1529cf['params']['id']}})[_0xbb58('0x19')](handleEntityNotFound(_0x38129a,null))[_0xbb58('0x19')](function(_0x439120){if(_0x439120){_0x3830a6=_0x439120;_0x30d4c8[_0xbb58('0x39')]=_['keys'](db['ServicenowField'][_0xbb58('0x35')]);_0x30d4c8[_0xbb58('0x37')]=_['keys'](_0x1529cf[_0xbb58('0x37')]);_0x30d4c8[_0xbb58('0x41')]=_[_0xbb58('0x38')](_0x30d4c8[_0xbb58('0x39')],_0x30d4c8[_0xbb58('0x37')]);_0x418d19['attributes']=_[_0xbb58('0x38')](_0x30d4c8['model'],qs['fields'](_0x1529cf[_0xbb58('0x37')][_0xbb58('0x3b')]));_0x418d19[_0xbb58('0x3a')]=_0x418d19['attributes'][_0xbb58('0x3c')]?_0x418d19[_0xbb58('0x3a')]:_0x30d4c8[_0xbb58('0x39')];_0x418d19[_0xbb58('0x3e')]=qs['sort'](_0x1529cf[_0xbb58('0x37')]['sort']);_0x418d19['where']=qs[_0xbb58('0x41')](_[_0xbb58('0x42')](_0x1529cf[_0xbb58('0x37')],_0x30d4c8['filters']));if(_0x1529cf['query'][_0xbb58('0x43')]){_0x418d19[_0xbb58('0x40')]=_[_0xbb58('0x44')](_0x418d19[_0xbb58('0x40')],{'$or':_[_0xbb58('0x45')](_0x418d19[_0xbb58('0x3a')],function(_0x115249){var _0x37ed76={};_0x37ed76[_0x115249]={'$like':'%'+_0x1529cf[_0xbb58('0x37')][_0xbb58('0x43')]+'%'};return _0x37ed76;})});}_0x418d19=_[_0xbb58('0x44')]({},_0x418d19,_0x1529cf['options']);return _0x3830a6['getSubjects'](_0x418d19);}})[_0xbb58('0x19')](function(_0x12add7){if(_0x12add7){_0x5b6508=_0x12add7[_0xbb58('0x3c')];if(!_0x1529cf['query'][_0xbb58('0x56')](_0xbb58('0x3d'))){_0x418d19[_0xbb58('0x2a')]=qs['limit'](_0x1529cf[_0xbb58('0x37')]['limit']);_0x418d19[_0xbb58('0x29')]=qs['offset'](_0x1529cf[_0xbb58('0x37')][_0xbb58('0x29')]);}return _0x3830a6[_0xbb58('0x57')](_0x418d19);}})[_0xbb58('0x19')](function(_0x26c15a){if(_0x26c15a){return _0x26c15a?{'count':_0x5b6508,'rows':_0x26c15a}:null;}})[_0xbb58('0x19')](respondWithResult(_0x38129a,null))['catch'](handleError(_0x38129a,null));};exports['getDescriptions']=function(_0x7f2426,_0x334737,_0x49edfe){var _0x14197f={};var _0x1c43dd={};var _0x43eb15;var _0x5604d1;return db[_0xbb58('0x4a')]['findOne']({'where':{'id':_0x7f2426[_0xbb58('0x4f')]['id']}})[_0xbb58('0x19')](handleEntityNotFound(_0x334737,null))[_0xbb58('0x19')](function(_0x2326ae){if(_0x2326ae){_0x43eb15=_0x2326ae;_0x1c43dd[_0xbb58('0x39')]=_[_0xbb58('0x36')](db[_0xbb58('0x54')]['rawAttributes']);_0x1c43dd[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x7f2426[_0xbb58('0x37')]);_0x1c43dd['filters']=_[_0xbb58('0x38')](_0x1c43dd[_0xbb58('0x39')],_0x1c43dd['query']);_0x14197f['attributes']=_[_0xbb58('0x38')](_0x1c43dd[_0xbb58('0x39')],qs[_0xbb58('0x3b')](_0x7f2426['query']['fields']));_0x14197f[_0xbb58('0x3a')]=_0x14197f[_0xbb58('0x3a')][_0xbb58('0x3c')]?_0x14197f[_0xbb58('0x3a')]:_0x1c43dd[_0xbb58('0x39')];_0x14197f[_0xbb58('0x3e')]=qs[_0xbb58('0x3f')](_0x7f2426[_0xbb58('0x37')][_0xbb58('0x3f')]);_0x14197f[_0xbb58('0x40')]=qs[_0xbb58('0x41')](_[_0xbb58('0x42')](_0x7f2426[_0xbb58('0x37')],_0x1c43dd[_0xbb58('0x41')]));if(_0x7f2426[_0xbb58('0x37')]['filter']){_0x14197f[_0xbb58('0x40')]=_['merge'](_0x14197f[_0xbb58('0x40')],{'$or':_[_0xbb58('0x45')](_0x14197f[_0xbb58('0x3a')],function(_0x47105b){var _0x20d5ad={};_0x20d5ad[_0x47105b]={'$like':'%'+_0x7f2426[_0xbb58('0x37')][_0xbb58('0x43')]+'%'};return _0x20d5ad;})});}_0x14197f=_[_0xbb58('0x44')]({},_0x14197f,_0x7f2426[_0xbb58('0x49')]);return _0x43eb15[_0xbb58('0x58')](_0x14197f);}})['then'](function(_0x2eb3cc){if(_0x2eb3cc){_0x5604d1=_0x2eb3cc[_0xbb58('0x3c')];if(!_0x7f2426[_0xbb58('0x37')][_0xbb58('0x56')](_0xbb58('0x3d'))){_0x14197f['limit']=qs[_0xbb58('0x2a')](_0x7f2426['query']['limit']);_0x14197f[_0xbb58('0x29')]=qs['offset'](_0x7f2426[_0xbb58('0x37')]['offset']);}return _0x43eb15[_0xbb58('0x58')](_0x14197f);}})['then'](function(_0x3b320a){if(_0x3b320a){return _0x3b320a?{'count':_0x5604d1,'rows':_0x3b320a}:null;}})[_0xbb58('0x19')](respondWithResult(_0x334737,null))[_0xbb58('0x23')](handleError(_0x334737,null));}; \ No newline at end of file +var _0xec56=['info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','sendStatus','stack','name','send','index','ServicenowConfiguration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','create','body','find','params','getFields','findOne','ServicenowField','length','order','filter','getSubjects','getDescriptions','html-pdf','zip-dir','fast-json-patch','request-promise','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','jayson/promise','client','http','then'];(function(_0x42bbf2,_0x6ed3f2){var _0x31a732=function(_0x5b3c39){while(--_0x5b3c39){_0x42bbf2['push'](_0x42bbf2['shift']());}};_0x31a732(++_0x6ed3f2);}(_0xec56,0x1bd));var _0x6ec5=function(_0x47c4cf,_0x8e7539){_0x47c4cf=_0x47c4cf-0x0;var _0x2c83b7=_0xec56[_0x47c4cf];return _0x2c83b7;};'use strict';var pdf=require(_0x6ec5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ec5('0x1'));var jsonpatch=require(_0x6ec5('0x2'));var rp=require(_0x6ec5('0x3'));var moment=require(_0x6ec5('0x4'));var BPromise=require(_0x6ec5('0x5'));var Mustache=require(_0x6ec5('0x6'));var util=require(_0x6ec5('0x7'));var path=require(_0x6ec5('0x8'));var sox=require(_0x6ec5('0x9'));var csv=require(_0x6ec5('0xa'));var ejs=require(_0x6ec5('0xb'));var fs=require('fs');var _=require(_0x6ec5('0xc'));var squel=require(_0x6ec5('0xd'));var crypto=require(_0x6ec5('0xe'));var jsforce=require(_0x6ec5('0xf'));var deskjs=require(_0x6ec5('0x10'));var toCsv=require(_0x6ec5('0xa'));var querystring=require(_0x6ec5('0x11'));var Papa=require(_0x6ec5('0x12'));var authService=require('../../components/auth/service');var hardwareService=require(_0x6ec5('0x13'));var Redis=require(_0x6ec5('0x14'));var qs=require(_0x6ec5('0x15'));var logger=require(_0x6ec5('0x16'))(_0x6ec5('0x17'));var utils=require(_0x6ec5('0x18'));var config=require(_0x6ec5('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6ec5('0x1a'));var client=jayson[_0x6ec5('0x1b')][_0x6ec5('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xb04ab6,_0x135aaf,_0x2890fb,_0x2f4c5d){return new BPromise(function(_0x39125b,_0x5166ad){var _0x3ed07a=_0x2f4c5d||client;return _0x3ed07a['request'](_0xb04ab6,_0x2890fb)[_0x6ec5('0x1d')](function(_0x287542){logger[_0x6ec5('0x1e')](_0x6ec5('0x1f'),_0x135aaf,_0x6ec5('0x20'));logger['debug'](_0x6ec5('0x21'),_0x135aaf,_0x6ec5('0x20'),JSON[_0x6ec5('0x22')](_0x287542));if(_0x287542[_0x6ec5('0x23')]){if(_0x287542[_0x6ec5('0x23')][_0x6ec5('0x24')]===0x1f4){logger[_0x6ec5('0x23')](_0x6ec5('0x1f'),_0x135aaf,_0x287542[_0x6ec5('0x23')][_0x6ec5('0x25')]);return _0x5166ad(_0x287542[_0x6ec5('0x23')][_0x6ec5('0x25')]);}logger[_0x6ec5('0x23')](_0x6ec5('0x1f'),_0x135aaf,_0x287542[_0x6ec5('0x23')][_0x6ec5('0x25')]);return _0x39125b(_0x287542[_0x6ec5('0x23')]['message']);}else{logger[_0x6ec5('0x1e')](_0x6ec5('0x1f'),_0x135aaf,_0x6ec5('0x20'));_0x39125b(_0x287542[_0x6ec5('0x26')][_0x6ec5('0x25')]);}})[_0x6ec5('0x27')](function(_0x18243f){logger['error'](_0x6ec5('0x1f'),_0x135aaf,_0x18243f);_0x5166ad(_0x18243f);});});}function respondWithStatusCode(_0x2ecdcf,_0x358d18){_0x358d18=_0x358d18||0xcc;return function(_0x1560c6){if(_0x1560c6){return _0x2ecdcf['sendStatus'](_0x358d18);}return _0x2ecdcf[_0x6ec5('0x28')](_0x358d18)[_0x6ec5('0x29')]();};}function respondWithResult(_0x5be80f,_0x2dc0a7){_0x2dc0a7=_0x2dc0a7||0xc8;return function(_0x19812b){if(_0x19812b){return _0x5be80f[_0x6ec5('0x28')](_0x2dc0a7)['json'](_0x19812b);}};}function respondWithFilteredResult(_0x1b779a,_0xd0e8d7){return function(_0x197ea8){if(_0x197ea8){var _0x462488=_0x197ea8[_0x6ec5('0x2a')],_0x425fac=_0xd0e8d7['offset'],_0x484847=_0xd0e8d7[_0x6ec5('0x2b')]+_0xd0e8d7[_0x6ec5('0x2c')],_0x171e2a;if(_0x484847>=_0x462488){_0x484847=_0x462488;_0x171e2a=0xc8;}else{_0x171e2a=0xce;}_0x1b779a['status'](_0x171e2a);return _0x1b779a[_0x6ec5('0x2d')](_0x6ec5('0x2e'),_0x425fac+'-'+_0x484847+'/'+_0x462488)[_0x6ec5('0x2f')](_0x197ea8);}return null;};}function patchUpdates(_0xa227ff){return function(_0x116659){try{jsonpatch['apply'](_0x116659,_0xa227ff,!![]);}catch(_0x2b8c99){return BPromise[_0x6ec5('0x30')](_0x2b8c99);}return _0x116659[_0x6ec5('0x31')]();};}function saveUpdates(_0x174164,_0x3e6d33){return function(_0x22c3d3){if(_0x22c3d3){return _0x22c3d3[_0x6ec5('0x32')](_0x174164)['then'](function(_0x2684fd){return _0x2684fd;});}return null;};}function removeEntity(_0x47a052,_0x15e1f6){return function(_0x5c6517){if(_0x5c6517){return _0x5c6517[_0x6ec5('0x33')]()[_0x6ec5('0x1d')](function(){_0x47a052['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bfab4,_0x293915){return function(_0x4b7662){if(!_0x4b7662){_0x3bfab4[_0x6ec5('0x34')](0x194);}return _0x4b7662;};}function handleError(_0x251bcf,_0x54ab73){_0x54ab73=_0x54ab73||0x1f4;return function(_0x249a8b){logger[_0x6ec5('0x23')](_0x249a8b[_0x6ec5('0x35')]);if(_0x249a8b[_0x6ec5('0x36')]){delete _0x249a8b[_0x6ec5('0x36')];}_0x251bcf[_0x6ec5('0x28')](_0x54ab73)[_0x6ec5('0x37')](_0x249a8b);};}exports[_0x6ec5('0x38')]=function(_0x4b7a08,_0x11ba9b){var _0x4d8b6e={},_0x9fec63={},_0xe1e58={'count':0x0,'rows':[]};var _0x26ada3=db[_0x6ec5('0x39')][_0x6ec5('0x3a')];_0x9fec63[_0x6ec5('0x3b')]=_[_0x6ec5('0x3c')](_0x26ada3);_0x9fec63[_0x6ec5('0x3d')]=_[_0x6ec5('0x3c')](_0x4b7a08[_0x6ec5('0x3d')]);_0x9fec63[_0x6ec5('0x3e')]=_['intersection'](_0x9fec63['model'],_0x9fec63[_0x6ec5('0x3d')]);_0x4d8b6e['attributes']=_[_0x6ec5('0x3f')](_0x9fec63[_0x6ec5('0x3b')],qs[_0x6ec5('0x40')](_0x4b7a08[_0x6ec5('0x3d')][_0x6ec5('0x40')]));_0x4d8b6e[_0x6ec5('0x41')]=_0x4d8b6e[_0x6ec5('0x41')]['length']?_0x4d8b6e[_0x6ec5('0x41')]:_0x9fec63[_0x6ec5('0x3b')];if(!_0x4b7a08[_0x6ec5('0x3d')][_0x6ec5('0x42')](_0x6ec5('0x43'))){_0x4d8b6e[_0x6ec5('0x2c')]=qs[_0x6ec5('0x2c')](_0x4b7a08[_0x6ec5('0x3d')][_0x6ec5('0x2c')]);_0x4d8b6e['offset']=qs[_0x6ec5('0x2b')](_0x4b7a08['query'][_0x6ec5('0x2b')]);}_0x4d8b6e['order']=qs[_0x6ec5('0x44')](_0x4b7a08[_0x6ec5('0x3d')]['sort']);_0x4d8b6e[_0x6ec5('0x45')]=qs[_0x6ec5('0x3e')](_[_0x6ec5('0x46')](_0x4b7a08['query'],_0x9fec63[_0x6ec5('0x3e')]));if(_0x4b7a08[_0x6ec5('0x3d')]['filter']){_0x4d8b6e[_0x6ec5('0x45')]=_[_0x6ec5('0x47')](_0x4d8b6e[_0x6ec5('0x45')],{'$or':_[_0x6ec5('0x48')](_0x26ada3,function(_0x43d858){if(_0x43d858[_0x6ec5('0x49')][_0x6ec5('0x4a')]!==_0x6ec5('0x4b')){var _0xce0f06={};_0xce0f06[_0x43d858[_0x6ec5('0x4c')]]={'$like':'%'+_0x4b7a08[_0x6ec5('0x3d')]['filter']+'%'};return _0xce0f06;}})});}_0x4d8b6e=_[_0x6ec5('0x47')]({},_0x4d8b6e,_0x4b7a08[_0x6ec5('0x4d')]);var _0x468a74={'where':_0x4d8b6e[_0x6ec5('0x45')]};return db['ServicenowConfiguration'][_0x6ec5('0x2a')](_0x468a74)[_0x6ec5('0x1d')](function(_0x56cd2a){_0xe1e58[_0x6ec5('0x2a')]=_0x56cd2a;if(_0x4b7a08['query'][_0x6ec5('0x4e')]){_0x4d8b6e[_0x6ec5('0x4f')]=[{'all':!![]}];}return db[_0x6ec5('0x39')][_0x6ec5('0x50')](_0x4d8b6e);})['then'](function(_0x5b0656){_0xe1e58[_0x6ec5('0x51')]=_0x5b0656;return _0xe1e58;})['then'](respondWithFilteredResult(_0x11ba9b,_0x4d8b6e))[_0x6ec5('0x27')](handleError(_0x11ba9b,null));};exports[_0x6ec5('0x52')]=function(_0x390141,_0x3442a9){var _0x2cf8c7={'raw':![],'where':{'id':_0x390141['params']['id']}},_0x4d6733={};_0x4d6733[_0x6ec5('0x3b')]=_[_0x6ec5('0x3c')](db[_0x6ec5('0x39')][_0x6ec5('0x3a')]);_0x4d6733[_0x6ec5('0x3d')]=_[_0x6ec5('0x3c')](_0x390141[_0x6ec5('0x3d')]);_0x4d6733[_0x6ec5('0x3e')]=_[_0x6ec5('0x3f')](_0x4d6733[_0x6ec5('0x3b')],_0x4d6733[_0x6ec5('0x3d')]);_0x2cf8c7[_0x6ec5('0x41')]=_[_0x6ec5('0x3f')](_0x4d6733[_0x6ec5('0x3b')],qs['fields'](_0x390141[_0x6ec5('0x3d')]['fields']));_0x2cf8c7[_0x6ec5('0x41')]=_0x2cf8c7[_0x6ec5('0x41')]['length']?_0x2cf8c7[_0x6ec5('0x41')]:_0x4d6733[_0x6ec5('0x3b')];if(_0x390141['query'][_0x6ec5('0x4e')]){_0x2cf8c7[_0x6ec5('0x4f')]=[{'all':!![]}];}_0x2cf8c7=_['merge']({},_0x2cf8c7,_0x390141['options']);return db[_0x6ec5('0x39')]['find'](_0x2cf8c7)['then'](handleEntityNotFound(_0x3442a9,null))[_0x6ec5('0x1d')](respondWithResult(_0x3442a9,null))[_0x6ec5('0x27')](handleError(_0x3442a9,null));};exports[_0x6ec5('0x53')]=function(_0x16ac52,_0x5aecab){return db[_0x6ec5('0x39')][_0x6ec5('0x53')](_0x16ac52[_0x6ec5('0x54')],{})[_0x6ec5('0x1d')](respondWithResult(_0x5aecab,0xc9))[_0x6ec5('0x27')](handleError(_0x5aecab,null));};exports[_0x6ec5('0x32')]=function(_0x15c0d7,_0x29bf52){if(_0x15c0d7[_0x6ec5('0x54')]['id']){delete _0x15c0d7[_0x6ec5('0x54')]['id'];}return db[_0x6ec5('0x39')][_0x6ec5('0x55')]({'where':{'id':_0x15c0d7[_0x6ec5('0x56')]['id']}})['then'](handleEntityNotFound(_0x29bf52,null))[_0x6ec5('0x1d')](saveUpdates(_0x15c0d7[_0x6ec5('0x54')],null))['then'](respondWithResult(_0x29bf52,null))[_0x6ec5('0x27')](handleError(_0x29bf52,null));};exports[_0x6ec5('0x33')]=function(_0x377c08,_0x1e80bc){return db[_0x6ec5('0x39')]['find']({'where':{'id':_0x377c08['params']['id']}})[_0x6ec5('0x1d')](handleEntityNotFound(_0x1e80bc,null))['then'](removeEntity(_0x1e80bc,null))[_0x6ec5('0x27')](handleError(_0x1e80bc,null));};exports[_0x6ec5('0x57')]=function(_0x16ce99,_0x1f7674,_0x301e31){var _0x4bb0e4={};var _0xa00917={};var _0x4838a9;var _0x4c7104;return db['ServicenowConfiguration'][_0x6ec5('0x58')]({'where':{'id':_0x16ce99[_0x6ec5('0x56')]['id']}})['then'](handleEntityNotFound(_0x1f7674,null))['then'](function(_0x36d685){if(_0x36d685){_0x4838a9=_0x36d685;_0xa00917[_0x6ec5('0x3b')]=_[_0x6ec5('0x3c')](db[_0x6ec5('0x59')][_0x6ec5('0x3a')]);_0xa00917['query']=_[_0x6ec5('0x3c')](_0x16ce99[_0x6ec5('0x3d')]);_0xa00917[_0x6ec5('0x3e')]=_[_0x6ec5('0x3f')](_0xa00917[_0x6ec5('0x3b')],_0xa00917['query']);_0x4bb0e4[_0x6ec5('0x41')]=_[_0x6ec5('0x3f')](_0xa00917[_0x6ec5('0x3b')],qs[_0x6ec5('0x40')](_0x16ce99[_0x6ec5('0x3d')][_0x6ec5('0x40')]));_0x4bb0e4[_0x6ec5('0x41')]=_0x4bb0e4[_0x6ec5('0x41')][_0x6ec5('0x5a')]?_0x4bb0e4[_0x6ec5('0x41')]:_0xa00917[_0x6ec5('0x3b')];_0x4bb0e4[_0x6ec5('0x5b')]=qs[_0x6ec5('0x44')](_0x16ce99[_0x6ec5('0x3d')][_0x6ec5('0x44')]);_0x4bb0e4[_0x6ec5('0x45')]=qs[_0x6ec5('0x3e')](_['pick'](_0x16ce99[_0x6ec5('0x3d')],_0xa00917['filters']));if(_0x16ce99[_0x6ec5('0x3d')]['filter']){_0x4bb0e4['where']=_[_0x6ec5('0x47')](_0x4bb0e4[_0x6ec5('0x45')],{'$or':_[_0x6ec5('0x48')](_0x4bb0e4[_0x6ec5('0x41')],function(_0x1d4424){var _0x48b5a9={};_0x48b5a9[_0x1d4424]={'$like':'%'+_0x16ce99[_0x6ec5('0x3d')][_0x6ec5('0x5c')]+'%'};return _0x48b5a9;})});}_0x4bb0e4=_[_0x6ec5('0x47')]({},_0x4bb0e4,_0x16ce99[_0x6ec5('0x4d')]);return _0x4838a9[_0x6ec5('0x57')](_0x4bb0e4);}})['then'](function(_0x43453f){if(_0x43453f){_0x4c7104=_0x43453f[_0x6ec5('0x5a')];if(!_0x16ce99[_0x6ec5('0x3d')][_0x6ec5('0x42')]('nolimit')){_0x4bb0e4[_0x6ec5('0x2c')]=qs[_0x6ec5('0x2c')](_0x16ce99['query']['limit']);_0x4bb0e4[_0x6ec5('0x2b')]=qs[_0x6ec5('0x2b')](_0x16ce99[_0x6ec5('0x3d')][_0x6ec5('0x2b')]);}return _0x4838a9[_0x6ec5('0x57')](_0x4bb0e4);}})[_0x6ec5('0x1d')](function(_0x3233ab){if(_0x3233ab){return _0x3233ab?{'count':_0x4c7104,'rows':_0x3233ab}:null;}})[_0x6ec5('0x1d')](respondWithResult(_0x1f7674,null))[_0x6ec5('0x27')](handleError(_0x1f7674,null));};exports[_0x6ec5('0x5d')]=function(_0x37503f,_0x5c297f,_0x2dcd18){var _0x12fdac={};var _0x3ee62e={};var _0x3003d8;var _0x480f40;return db[_0x6ec5('0x39')][_0x6ec5('0x58')]({'where':{'id':_0x37503f[_0x6ec5('0x56')]['id']}})[_0x6ec5('0x1d')](handleEntityNotFound(_0x5c297f,null))['then'](function(_0x3c3d8c){if(_0x3c3d8c){_0x3003d8=_0x3c3d8c;_0x3ee62e[_0x6ec5('0x3b')]=_[_0x6ec5('0x3c')](db['ServicenowField']['rawAttributes']);_0x3ee62e[_0x6ec5('0x3d')]=_[_0x6ec5('0x3c')](_0x37503f['query']);_0x3ee62e[_0x6ec5('0x3e')]=_[_0x6ec5('0x3f')](_0x3ee62e[_0x6ec5('0x3b')],_0x3ee62e[_0x6ec5('0x3d')]);_0x12fdac['attributes']=_[_0x6ec5('0x3f')](_0x3ee62e[_0x6ec5('0x3b')],qs[_0x6ec5('0x40')](_0x37503f['query'][_0x6ec5('0x40')]));_0x12fdac[_0x6ec5('0x41')]=_0x12fdac[_0x6ec5('0x41')][_0x6ec5('0x5a')]?_0x12fdac[_0x6ec5('0x41')]:_0x3ee62e[_0x6ec5('0x3b')];_0x12fdac[_0x6ec5('0x5b')]=qs[_0x6ec5('0x44')](_0x37503f['query'][_0x6ec5('0x44')]);_0x12fdac[_0x6ec5('0x45')]=qs['filters'](_['pick'](_0x37503f[_0x6ec5('0x3d')],_0x3ee62e[_0x6ec5('0x3e')]));if(_0x37503f[_0x6ec5('0x3d')]['filter']){_0x12fdac[_0x6ec5('0x45')]=_[_0x6ec5('0x47')](_0x12fdac[_0x6ec5('0x45')],{'$or':_[_0x6ec5('0x48')](_0x12fdac['attributes'],function(_0x220b28){var _0x376411={};_0x376411[_0x220b28]={'$like':'%'+_0x37503f[_0x6ec5('0x3d')][_0x6ec5('0x5c')]+'%'};return _0x376411;})});}_0x12fdac=_[_0x6ec5('0x47')]({},_0x12fdac,_0x37503f[_0x6ec5('0x4d')]);return _0x3003d8[_0x6ec5('0x5d')](_0x12fdac);}})[_0x6ec5('0x1d')](function(_0x16b3d8){if(_0x16b3d8){_0x480f40=_0x16b3d8['length'];if(!_0x37503f['query'][_0x6ec5('0x42')](_0x6ec5('0x43'))){_0x12fdac[_0x6ec5('0x2c')]=qs['limit'](_0x37503f[_0x6ec5('0x3d')]['limit']);_0x12fdac[_0x6ec5('0x2b')]=qs[_0x6ec5('0x2b')](_0x37503f['query']['offset']);}return _0x3003d8[_0x6ec5('0x5d')](_0x12fdac);}})[_0x6ec5('0x1d')](function(_0x207142){if(_0x207142){return _0x207142?{'count':_0x480f40,'rows':_0x207142}:null;}})[_0x6ec5('0x1d')](respondWithResult(_0x5c297f,null))['catch'](handleError(_0x5c297f,null));};exports[_0x6ec5('0x5e')]=function(_0x27b01b,_0x180865,_0x569fc6){var _0x5befa3={};var _0x579490={};var _0x3a5b21;var _0x18fbea;return db[_0x6ec5('0x39')][_0x6ec5('0x58')]({'where':{'id':_0x27b01b[_0x6ec5('0x56')]['id']}})[_0x6ec5('0x1d')](handleEntityNotFound(_0x180865,null))[_0x6ec5('0x1d')](function(_0x543c38){if(_0x543c38){_0x3a5b21=_0x543c38;_0x579490[_0x6ec5('0x3b')]=_['keys'](db[_0x6ec5('0x59')][_0x6ec5('0x3a')]);_0x579490['query']=_[_0x6ec5('0x3c')](_0x27b01b[_0x6ec5('0x3d')]);_0x579490['filters']=_[_0x6ec5('0x3f')](_0x579490[_0x6ec5('0x3b')],_0x579490['query']);_0x5befa3[_0x6ec5('0x41')]=_[_0x6ec5('0x3f')](_0x579490[_0x6ec5('0x3b')],qs['fields'](_0x27b01b['query'][_0x6ec5('0x40')]));_0x5befa3[_0x6ec5('0x41')]=_0x5befa3[_0x6ec5('0x41')][_0x6ec5('0x5a')]?_0x5befa3[_0x6ec5('0x41')]:_0x579490[_0x6ec5('0x3b')];_0x5befa3[_0x6ec5('0x5b')]=qs[_0x6ec5('0x44')](_0x27b01b[_0x6ec5('0x3d')][_0x6ec5('0x44')]);_0x5befa3[_0x6ec5('0x45')]=qs[_0x6ec5('0x3e')](_[_0x6ec5('0x46')](_0x27b01b['query'],_0x579490[_0x6ec5('0x3e')]));if(_0x27b01b[_0x6ec5('0x3d')][_0x6ec5('0x5c')]){_0x5befa3[_0x6ec5('0x45')]=_['merge'](_0x5befa3[_0x6ec5('0x45')],{'$or':_['map'](_0x5befa3[_0x6ec5('0x41')],function(_0x2e6e33){var _0x34a8d9={};_0x34a8d9[_0x2e6e33]={'$like':'%'+_0x27b01b[_0x6ec5('0x3d')][_0x6ec5('0x5c')]+'%'};return _0x34a8d9;})});}_0x5befa3=_[_0x6ec5('0x47')]({},_0x5befa3,_0x27b01b[_0x6ec5('0x4d')]);return _0x3a5b21['getDescriptions'](_0x5befa3);}})[_0x6ec5('0x1d')](function(_0xd13ca6){if(_0xd13ca6){_0x18fbea=_0xd13ca6['length'];if(!_0x27b01b[_0x6ec5('0x3d')][_0x6ec5('0x42')](_0x6ec5('0x43'))){_0x5befa3[_0x6ec5('0x2c')]=qs[_0x6ec5('0x2c')](_0x27b01b[_0x6ec5('0x3d')][_0x6ec5('0x2c')]);_0x5befa3[_0x6ec5('0x2b')]=qs[_0x6ec5('0x2b')](_0x27b01b[_0x6ec5('0x3d')][_0x6ec5('0x2b')]);}return _0x3a5b21[_0x6ec5('0x5e')](_0x5befa3);}})[_0x6ec5('0x1d')](function(_0x3d0b1d){if(_0x3d0b1d){return _0x3d0b1d?{'count':_0x18fbea,'rows':_0x3d0b1d}:null;}})[_0x6ec5('0x1d')](respondWithResult(_0x180865,null))['catch'](handleError(_0x180865,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 9a7c508..4b31ad1 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 _0x582f=['api','moment','bluebird','request-promise','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','lodash','util','../../config/logger'];(function(_0x4b8aa0,_0x253d23){var _0x296cec=function(_0x3be4c3){while(--_0x3be4c3){_0x4b8aa0['push'](_0x4b8aa0['shift']());}};_0x296cec(++_0x253d23);}(_0x582f,0xce));var _0xf582=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x582f[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0xf582('0x0'));var util=require(_0xf582('0x1'));var logger=require(_0xf582('0x2'))(_0xf582('0x3'));var moment=require(_0xf582('0x4'));var BPromise=require(_0xf582('0x5'));var rp=require(_0xf582('0x6'));var attributes=require(_0xf582('0x7'));module[_0xf582('0x8')]=function(_0x4581b8,_0x449bea){return _0x4581b8[_0xf582('0x9')]('ServicenowConfiguration',attributes,{'tableName':_0xf582('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x151b=['../../config/logger','api','moment','bluebird','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x251142,_0x58857b){var _0x4a2b81=function(_0x432b7d){while(--_0x432b7d){_0x251142['push'](_0x251142['shift']());}};_0x4a2b81(++_0x58857b);}(_0x151b,0x1dc));var _0xb151=function(_0x10366f,_0xc62ff4){_0x10366f=_0x10366f-0x0;var _0x545ba9=_0x151b[_0x10366f];return _0x545ba9;};'use strict';var _=require(_0xb151('0x0'));var util=require('util');var logger=require(_0xb151('0x1'))(_0xb151('0x2'));var moment=require(_0xb151('0x3'));var BPromise=require(_0xb151('0x4'));var rp=require('request-promise');var attributes=require(_0xb151('0x5'));module['exports']=function(_0x387eaa,_0x1ddb09){return _0x387eaa[_0xb151('0x6')](_0xb151('0x7'),attributes,{'tableName':_0xb151('0x8'),'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 9a584c1..7f12b56 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 _0xf0bd=['stringify','error','code','message','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x28c939,_0x110e29){var _0x527fe9=function(_0x1df2a6){while(--_0x1df2a6){_0x28c939['push'](_0x28c939['shift']());}};_0x527fe9(++_0x110e29);}(_0xf0bd,0x82));var _0xdf0b=function(_0x45ae8f,_0x16693){_0x45ae8f=_0x45ae8f-0x0;var _0x5128fb=_0xf0bd[_0x45ae8f];return _0x5128fb;};'use strict';var _=require(_0xdf0b('0x0'));var util=require('util');var moment=require(_0xdf0b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf0b('0x2'));var db=require(_0xdf0b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf0b('0x4'))(_0xdf0b('0x5'));var config=require(_0xdf0b('0x6'));var jayson=require(_0xdf0b('0x7'));var client=jayson[_0xdf0b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x423250,_0x107bdc,_0x18b9cf){return new BPromise(function(_0x13eaf2,_0x2685a8){return client['request'](_0x423250,_0x18b9cf)[_0xdf0b('0x9')](function(_0x2bc9f2){logger[_0xdf0b('0xa')](_0xdf0b('0xb'),_0x107bdc,_0xdf0b('0xc'));logger[_0xdf0b('0xd')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x107bdc,_0xdf0b('0xc'),JSON[_0xdf0b('0xe')](_0x2bc9f2));if(_0x2bc9f2[_0xdf0b('0xf')]){if(_0x2bc9f2['error'][_0xdf0b('0x10')]===0x1f4){logger[_0xdf0b('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x107bdc,_0x2bc9f2[_0xdf0b('0xf')]['message']);return _0x2685a8(_0x2bc9f2[_0xdf0b('0xf')][_0xdf0b('0x11')]);}logger[_0xdf0b('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x107bdc,_0x2bc9f2['error'][_0xdf0b('0x11')]);return _0x13eaf2(_0x2bc9f2[_0xdf0b('0xf')][_0xdf0b('0x11')]);}else{logger['info'](_0xdf0b('0xb'),_0x107bdc,'request\x20sent');_0x13eaf2(_0x2bc9f2['result']['message']);}})['catch'](function(_0x367929){logger[_0xdf0b('0xf')](_0xdf0b('0xb'),_0x107bdc,_0x367929);_0x2685a8(_0x367929);});});} \ No newline at end of file +var _0x7ddb=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x7ddb,0x158));var _0xb7dd=function(_0x332f5f,_0x162887){_0x332f5f=_0x332f5f-0x0;var _0x396cd9=_0x7ddb[_0x332f5f];return _0x396cd9;};'use strict';var _=require(_0xb7dd('0x0'));var util=require(_0xb7dd('0x1'));var moment=require(_0xb7dd('0x2'));var BPromise=require(_0xb7dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7dd('0x4'));var db=require(_0xb7dd('0x5'))['db'];var utils=require(_0xb7dd('0x6'));var logger=require(_0xb7dd('0x7'))(_0xb7dd('0x8'));var config=require(_0xb7dd('0x9'));var jayson=require(_0xb7dd('0xa'));var client=jayson[_0xb7dd('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9832e1,_0x8c7501,_0x430be5){return new BPromise(function(_0x521599,_0x39913a){return client['request'](_0x9832e1,_0x430be5)['then'](function(_0x2e7969){logger[_0xb7dd('0xc')](_0xb7dd('0xd'),_0x8c7501,_0xb7dd('0xe'));logger[_0xb7dd('0xf')](_0xb7dd('0x10'),_0x8c7501,_0xb7dd('0xe'),JSON[_0xb7dd('0x11')](_0x2e7969));if(_0x2e7969[_0xb7dd('0x12')]){if(_0x2e7969[_0xb7dd('0x12')][_0xb7dd('0x13')]===0x1f4){logger[_0xb7dd('0x12')](_0xb7dd('0xd'),_0x8c7501,_0x2e7969[_0xb7dd('0x12')][_0xb7dd('0x14')]);return _0x39913a(_0x2e7969[_0xb7dd('0x12')][_0xb7dd('0x14')]);}logger[_0xb7dd('0x12')](_0xb7dd('0xd'),_0x8c7501,_0x2e7969[_0xb7dd('0x12')][_0xb7dd('0x14')]);return _0x521599(_0x2e7969[_0xb7dd('0x12')][_0xb7dd('0x14')]);}else{logger[_0xb7dd('0xc')](_0xb7dd('0xd'),_0x8c7501,_0xb7dd('0xe'));_0x521599(_0x2e7969[_0xb7dd('0x15')]['message']);}})[_0xb7dd('0x16')](function(_0x174417){logger[_0xb7dd('0x12')](_0xb7dd('0xd'),_0x8c7501,_0x174417);_0x39913a(_0x174417);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 364d19c..318480a 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 _0xe4cb=['get','/:id','show','post','create','put','update','delete','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x78fc26,_0x59d527){var _0x5c8a1e=function(_0x26b288){while(--_0x26b288){_0x78fc26['push'](_0x78fc26['shift']());}};_0x5c8a1e(++_0x59d527);}(_0xe4cb,0xb4));var _0xbe4c=function(_0x50ed46,_0x2e5db1){_0x50ed46=_0x50ed46-0x0;var _0x135278=_0xe4cb[_0x50ed46];return _0x135278;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe4c('0x0'));var router=express[_0xbe4c('0x1')]();var auth=require(_0xbe4c('0x2'));var interaction=require(_0xbe4c('0x3'));var config=require(_0xbe4c('0x4'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0xbe4c('0x5')](),controller[_0xbe4c('0x6')]);router[_0xbe4c('0x7')](_0xbe4c('0x8'),auth[_0xbe4c('0x5')](),controller[_0xbe4c('0x9')]);router[_0xbe4c('0xa')]('/',auth['isAuthenticated'](),controller[_0xbe4c('0xb')]);router[_0xbe4c('0xc')](_0xbe4c('0x8'),auth[_0xbe4c('0x5')](),controller[_0xbe4c('0xd')]);router[_0xbe4c('0xe')](_0xbe4c('0x8'),auth[_0xbe4c('0x5')](),controller[_0xbe4c('0xf')]);module[_0xbe4c('0x10')]=router; \ No newline at end of file +var _0x4e40=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','/:id','show','put','update','delete','exports'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x4e40,0x1f0));var _0x04e4=function(_0x2b0f8c,_0x2c51bc){_0x2b0f8c=_0x2b0f8c-0x0;var _0x407a38=_0x4e40[_0x2b0f8c];return _0x407a38;};'use strict';var multer=require(_0x04e4('0x0'));var util=require(_0x04e4('0x1'));var path=require(_0x04e4('0x2'));var timeout=require('connect-timeout');var express=require(_0x04e4('0x3'));var router=express[_0x04e4('0x4')]();var auth=require(_0x04e4('0x5'));var interaction=require(_0x04e4('0x6'));var config=require('../../config/environment');var controller=require(_0x04e4('0x7'));router[_0x04e4('0x8')]('/',auth[_0x04e4('0x9')](),controller['index']);router[_0x04e4('0x8')](_0x04e4('0xa'),auth['isAuthenticated'](),controller[_0x04e4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x04e4('0xc')](_0x04e4('0xa'),auth[_0x04e4('0x9')](),controller[_0x04e4('0xd')]);router[_0x04e4('0xe')]('/:id',auth[_0x04e4('0x9')](),controller['destroy']);module[_0x04e4('0xf')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 0a0ff0f..08f6fc0 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 _0xf109=['ENUM','keyValue','string','STRING','variable','customVariable','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf109,0xce));var _0x9f10=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xf109[_0x49b207];return _0x2dc8fa;};'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 _0xb688=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x44f312,_0x4ed402){var _0x3ec697=function(_0x3ac5d5){while(--_0x3ac5d5){_0x44f312['push'](_0x44f312['shift']());}};_0x3ec697(++_0x4ed402);}(_0xb688,0xcf));var _0x8b68=function(_0x18f1ab,_0x481922){_0x18f1ab=_0x18f1ab-0x0;var _0x3122da=_0xb688[_0x18f1ab];return _0x3122da;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'type':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),_0x8b68('0x3'),_0x8b68('0x4'),_0x8b68('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8b68('0x6')]},'key':{'type':Sequelize[_0x8b68('0x6')]},'keyType':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),'variable',_0x8b68('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8b68('0x6')]},'nameField':{'type':Sequelize[_0x8b68('0x6')]},'customField':{'type':Sequelize[_0x8b68('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8b68('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 2467c3f..92c6f61 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 _0x6ffb=['options','includeAll','include','findAll','rows','catch','length','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','ServicenowField','rawAttributes','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','key','VIRTUAL','field'];(function(_0x2e2673,_0x5755bf){var _0x5c75f9=function(_0x3973b2){while(--_0x3973b2){_0x2e2673['push'](_0x2e2673['shift']());}};_0x5c75f9(++_0x5755bf);}(_0x6ffb,0x12f));var _0xb6ff=function(_0x322d70,_0xff52a4){_0x322d70=_0x322d70-0x0;var _0x57adad=_0x6ffb[_0x322d70];return _0x57adad;};'use strict';var pdf=require(_0xb6ff('0x0'));var emlformat=require(_0xb6ff('0x1'));var rimraf=require(_0xb6ff('0x2'));var zipdir=require(_0xb6ff('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6ff('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb6ff('0x5'));var util=require(_0xb6ff('0x6'));var path=require(_0xb6ff('0x7'));var sox=require(_0xb6ff('0x8'));var csv=require(_0xb6ff('0x9'));var ejs=require(_0xb6ff('0xa'));var fs=require('fs');var _=require(_0xb6ff('0xb'));var squel=require('squel');var crypto=require(_0xb6ff('0xc'));var jsforce=require(_0xb6ff('0xd'));var deskjs=require(_0xb6ff('0xe'));var toCsv=require(_0xb6ff('0x9'));var querystring=require(_0xb6ff('0xf'));var Papa=require('papaparse');var authService=require(_0xb6ff('0x10'));var hardwareService=require(_0xb6ff('0x11'));var Redis=require('ioredis');var qs=require(_0xb6ff('0x12'));var logger=require(_0xb6ff('0x13'))(_0xb6ff('0x14'));var utils=require(_0xb6ff('0x15'));var config=require(_0xb6ff('0x16'));var db=require(_0xb6ff('0x17'))['db'];function respondWithStatusCode(_0x37e881,_0x1acadd){_0x1acadd=_0x1acadd||0xcc;return function(_0x1c48e1){if(_0x1c48e1){return _0x37e881[_0xb6ff('0x18')](_0x1acadd);}return _0x37e881[_0xb6ff('0x19')](_0x1acadd)[_0xb6ff('0x1a')]();};}function respondWithResult(_0x3c3a0c,_0x5c1cdd){_0x5c1cdd=_0x5c1cdd||0xc8;return function(_0x120cef){if(_0x120cef){return _0x3c3a0c['status'](_0x5c1cdd)[_0xb6ff('0x1b')](_0x120cef);}};}function respondWithFilteredResult(_0x3352e6,_0x58f47e){return function(_0x4f4290){if(_0x4f4290){var _0x54fe0a=_0x4f4290[_0xb6ff('0x1c')],_0x47c3=_0x58f47e[_0xb6ff('0x1d')],_0x476de6=_0x58f47e[_0xb6ff('0x1d')]+_0x58f47e['limit'],_0x52f40d;if(_0x476de6>=_0x54fe0a){_0x476de6=_0x54fe0a;_0x52f40d=0xc8;}else{_0x52f40d=0xce;}_0x3352e6[_0xb6ff('0x19')](_0x52f40d);return _0x3352e6[_0xb6ff('0x1e')](_0xb6ff('0x1f'),_0x47c3+'-'+_0x476de6+'/'+_0x54fe0a)['json'](_0x4f4290);}return null;};}function patchUpdates(_0x39012c){return function(_0xa1031f){try{jsonpatch[_0xb6ff('0x20')](_0xa1031f,_0x39012c,!![]);}catch(_0x50d37a){return BPromise['reject'](_0x50d37a);}return _0xa1031f[_0xb6ff('0x21')]();};}function saveUpdates(_0x1495cd,_0x59bc72){return function(_0x1258d5){if(_0x1258d5){return _0x1258d5[_0xb6ff('0x22')](_0x1495cd)[_0xb6ff('0x23')](function(_0x5838e9){return _0x5838e9;});}return null;};}function removeEntity(_0x1b18cd,_0xd8564d){return function(_0x3795f1){if(_0x3795f1){return _0x3795f1[_0xb6ff('0x24')]()['then'](function(){_0x1b18cd['status'](0xcc)[_0xb6ff('0x1a')]();});}};}function handleEntityNotFound(_0x1015a3,_0x2287a6){return function(_0x377609){if(!_0x377609){_0x1015a3[_0xb6ff('0x18')](0x194);}return _0x377609;};}function handleError(_0x39c13b,_0x32eb6b){_0x32eb6b=_0x32eb6b||0x1f4;return function(_0x5b66d1){logger[_0xb6ff('0x25')](_0x5b66d1['stack']);if(_0x5b66d1[_0xb6ff('0x26')]){delete _0x5b66d1[_0xb6ff('0x26')];}_0x39c13b[_0xb6ff('0x19')](_0x32eb6b)[_0xb6ff('0x27')](_0x5b66d1);};}exports[_0xb6ff('0x28')]=function(_0x5b07d5,_0xc5e7b0){var _0x26ca58={},_0x21a98f={},_0x581688={'count':0x0,'rows':[]};var _0x12a10d=db[_0xb6ff('0x29')][_0xb6ff('0x2a')];_0x21a98f['model']=_[_0xb6ff('0x2b')](_0x12a10d);_0x21a98f[_0xb6ff('0x2c')]=_[_0xb6ff('0x2b')](_0x5b07d5[_0xb6ff('0x2c')]);_0x21a98f['filters']=_[_0xb6ff('0x2d')](_0x21a98f[_0xb6ff('0x2e')],_0x21a98f[_0xb6ff('0x2c')]);_0x26ca58[_0xb6ff('0x2f')]=_[_0xb6ff('0x2d')](_0x21a98f[_0xb6ff('0x2e')],qs[_0xb6ff('0x30')](_0x5b07d5[_0xb6ff('0x2c')][_0xb6ff('0x30')]));_0x26ca58['attributes']=_0x26ca58['attributes']['length']?_0x26ca58[_0xb6ff('0x2f')]:_0x21a98f[_0xb6ff('0x2e')];if(!_0x5b07d5[_0xb6ff('0x2c')][_0xb6ff('0x31')](_0xb6ff('0x32'))){_0x26ca58[_0xb6ff('0x33')]=qs['limit'](_0x5b07d5[_0xb6ff('0x2c')][_0xb6ff('0x33')]);_0x26ca58['offset']=qs['offset'](_0x5b07d5['query']['offset']);}_0x26ca58[_0xb6ff('0x34')]=qs[_0xb6ff('0x35')](_0x5b07d5[_0xb6ff('0x2c')][_0xb6ff('0x35')]);_0x26ca58[_0xb6ff('0x36')]=qs[_0xb6ff('0x37')](_[_0xb6ff('0x38')](_0x5b07d5['query'],_0x21a98f[_0xb6ff('0x37')]));if(_0x5b07d5[_0xb6ff('0x2c')][_0xb6ff('0x39')]){_0x26ca58[_0xb6ff('0x36')]=_[_0xb6ff('0x3a')](_0x26ca58['where'],{'$or':_['map'](_0x12a10d,function(_0x146725){if(_0x146725['type'][_0xb6ff('0x3b')]!==_0xb6ff('0x3c')){var _0x503820={};_0x503820[_0x146725[_0xb6ff('0x3d')]]={'$like':'%'+_0x5b07d5[_0xb6ff('0x2c')][_0xb6ff('0x39')]+'%'};return _0x503820;}})});}_0x26ca58=_[_0xb6ff('0x3a')]({},_0x26ca58,_0x5b07d5[_0xb6ff('0x3e')]);var _0x3526a1={'where':_0x26ca58[_0xb6ff('0x36')]};return db[_0xb6ff('0x29')]['count'](_0x3526a1)[_0xb6ff('0x23')](function(_0x10eabb){_0x581688['count']=_0x10eabb;if(_0x5b07d5[_0xb6ff('0x2c')][_0xb6ff('0x3f')]){_0x26ca58[_0xb6ff('0x40')]=[{'all':!![]}];}return db[_0xb6ff('0x29')][_0xb6ff('0x41')](_0x26ca58);})['then'](function(_0x544bed){_0x581688[_0xb6ff('0x42')]=_0x544bed;return _0x581688;})[_0xb6ff('0x23')](respondWithFilteredResult(_0xc5e7b0,_0x26ca58))[_0xb6ff('0x43')](handleError(_0xc5e7b0,null));};exports['show']=function(_0x388ad5,_0x52b0b0){var _0x23b386={'raw':!![],'where':{'id':_0x388ad5['params']['id']}},_0x1696ef={};_0x1696ef[_0xb6ff('0x2e')]=_[_0xb6ff('0x2b')](db[_0xb6ff('0x29')][_0xb6ff('0x2a')]);_0x1696ef[_0xb6ff('0x2c')]=_[_0xb6ff('0x2b')](_0x388ad5[_0xb6ff('0x2c')]);_0x1696ef[_0xb6ff('0x37')]=_['intersection'](_0x1696ef[_0xb6ff('0x2e')],_0x1696ef[_0xb6ff('0x2c')]);_0x23b386[_0xb6ff('0x2f')]=_[_0xb6ff('0x2d')](_0x1696ef['model'],qs[_0xb6ff('0x30')](_0x388ad5['query']['fields']));_0x23b386[_0xb6ff('0x2f')]=_0x23b386[_0xb6ff('0x2f')][_0xb6ff('0x44')]?_0x23b386[_0xb6ff('0x2f')]:_0x1696ef['model'];if(_0x388ad5[_0xb6ff('0x2c')][_0xb6ff('0x3f')]){_0x23b386[_0xb6ff('0x40')]=[{'all':!![]}];}_0x23b386=_[_0xb6ff('0x3a')]({},_0x23b386,_0x388ad5['options']);return db[_0xb6ff('0x29')][_0xb6ff('0x45')](_0x23b386)[_0xb6ff('0x23')](handleEntityNotFound(_0x52b0b0,null))['then'](respondWithResult(_0x52b0b0,null))['catch'](handleError(_0x52b0b0,null));};exports[_0xb6ff('0x46')]=function(_0x7c8def,_0x2f9f20){return db[_0xb6ff('0x29')]['create'](_0x7c8def[_0xb6ff('0x47')],{})[_0xb6ff('0x23')](respondWithResult(_0x2f9f20,0xc9))[_0xb6ff('0x43')](handleError(_0x2f9f20,null));};exports[_0xb6ff('0x22')]=function(_0x6174c4,_0x5b4553){if(_0x6174c4['body']['id']){delete _0x6174c4[_0xb6ff('0x47')]['id'];}return db[_0xb6ff('0x29')]['find']({'where':{'id':_0x6174c4[_0xb6ff('0x48')]['id']}})[_0xb6ff('0x23')](handleEntityNotFound(_0x5b4553,null))[_0xb6ff('0x23')](saveUpdates(_0x6174c4[_0xb6ff('0x47')],null))[_0xb6ff('0x23')](respondWithResult(_0x5b4553,null))[_0xb6ff('0x43')](handleError(_0x5b4553,null));};exports[_0xb6ff('0x24')]=function(_0x143bbc,_0x14bf52){return db[_0xb6ff('0x29')][_0xb6ff('0x45')]({'where':{'id':_0x143bbc['params']['id']}})['then'](handleEntityNotFound(_0x14bf52,null))[_0xb6ff('0x23')](removeEntity(_0x14bf52,null))[_0xb6ff('0x43')](handleError(_0x14bf52,null));}; \ No newline at end of file +var _0x3113=['json','count','offset','limit','set','Content-Range','apply','update','destroy','error','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','then','includeAll','include','ServicenowField','findAll','catch','length','options','create','body','find','params','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end'];(function(_0x2e655a,_0x6d5799){var _0x26f13b=function(_0x2dd535){while(--_0x2dd535){_0x2e655a['push'](_0x2e655a['shift']());}};_0x26f13b(++_0x6d5799);}(_0x3113,0xfb));var _0x3311=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3113[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0x3311('0x0'));var emlformat=require(_0x3311('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3311('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3311('0x3'));var moment=require(_0x3311('0x4'));var BPromise=require(_0x3311('0x5'));var Mustache=require(_0x3311('0x6'));var util=require(_0x3311('0x7'));var path=require(_0x3311('0x8'));var sox=require(_0x3311('0x9'));var csv=require(_0x3311('0xa'));var ejs=require(_0x3311('0xb'));var fs=require('fs');var _=require(_0x3311('0xc'));var squel=require(_0x3311('0xd'));var crypto=require('crypto');var jsforce=require(_0x3311('0xe'));var deskjs=require(_0x3311('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3311('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x3311('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x3311('0x12'))(_0x3311('0x13'));var utils=require(_0x3311('0x14'));var config=require(_0x3311('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fdda5,_0x5aa2f2){_0x5aa2f2=_0x5aa2f2||0xcc;return function(_0x324c73){if(_0x324c73){return _0x1fdda5[_0x3311('0x16')](_0x5aa2f2);}return _0x1fdda5[_0x3311('0x17')](_0x5aa2f2)[_0x3311('0x18')]();};}function respondWithResult(_0x4f0571,_0x243235){_0x243235=_0x243235||0xc8;return function(_0x50228a){if(_0x50228a){return _0x4f0571[_0x3311('0x17')](_0x243235)[_0x3311('0x19')](_0x50228a);}};}function respondWithFilteredResult(_0x347584,_0x1367d0){return function(_0x32842b){if(_0x32842b){var _0x454a67=_0x32842b[_0x3311('0x1a')],_0x4771f0=_0x1367d0[_0x3311('0x1b')],_0x4a008e=_0x1367d0[_0x3311('0x1b')]+_0x1367d0[_0x3311('0x1c')],_0x31b5c1;if(_0x4a008e>=_0x454a67){_0x4a008e=_0x454a67;_0x31b5c1=0xc8;}else{_0x31b5c1=0xce;}_0x347584[_0x3311('0x17')](_0x31b5c1);return _0x347584[_0x3311('0x1d')](_0x3311('0x1e'),_0x4771f0+'-'+_0x4a008e+'/'+_0x454a67)[_0x3311('0x19')](_0x32842b);}return null;};}function patchUpdates(_0x2ac89f){return function(_0x5e8d2d){try{jsonpatch[_0x3311('0x1f')](_0x5e8d2d,_0x2ac89f,!![]);}catch(_0x12f97b){return BPromise['reject'](_0x12f97b);}return _0x5e8d2d['save']();};}function saveUpdates(_0xad905b,_0x30d10d){return function(_0x66182d){if(_0x66182d){return _0x66182d[_0x3311('0x20')](_0xad905b)['then'](function(_0x3d2cc7){return _0x3d2cc7;});}return null;};}function removeEntity(_0x15e9b6,_0x1efea6){return function(_0x30df90){if(_0x30df90){return _0x30df90[_0x3311('0x21')]()['then'](function(){_0x15e9b6['status'](0xcc)[_0x3311('0x18')]();});}};}function handleEntityNotFound(_0x555c07,_0x292f61){return function(_0x1f84da){if(!_0x1f84da){_0x555c07['sendStatus'](0x194);}return _0x1f84da;};}function handleError(_0x2b317f,_0x5b1daa){_0x5b1daa=_0x5b1daa||0x1f4;return function(_0x22b811){logger[_0x3311('0x22')](_0x22b811['stack']);if(_0x22b811[_0x3311('0x23')]){delete _0x22b811[_0x3311('0x23')];}_0x2b317f[_0x3311('0x17')](_0x5b1daa)[_0x3311('0x24')](_0x22b811);};}exports[_0x3311('0x25')]=function(_0xd5b3ca,_0x2de50f){var _0xbea1cf={},_0xc581e9={},_0x206aec={'count':0x0,'rows':[]};var _0xe05f69=db['ServicenowField'][_0x3311('0x26')];_0xc581e9['model']=_[_0x3311('0x27')](_0xe05f69);_0xc581e9[_0x3311('0x28')]=_[_0x3311('0x27')](_0xd5b3ca[_0x3311('0x28')]);_0xc581e9[_0x3311('0x29')]=_[_0x3311('0x2a')](_0xc581e9[_0x3311('0x2b')],_0xc581e9[_0x3311('0x28')]);_0xbea1cf[_0x3311('0x2c')]=_['intersection'](_0xc581e9[_0x3311('0x2b')],qs['fields'](_0xd5b3ca[_0x3311('0x28')][_0x3311('0x2d')]));_0xbea1cf[_0x3311('0x2c')]=_0xbea1cf[_0x3311('0x2c')]['length']?_0xbea1cf[_0x3311('0x2c')]:_0xc581e9[_0x3311('0x2b')];if(!_0xd5b3ca[_0x3311('0x28')]['hasOwnProperty'](_0x3311('0x2e'))){_0xbea1cf[_0x3311('0x1c')]=qs[_0x3311('0x1c')](_0xd5b3ca[_0x3311('0x28')][_0x3311('0x1c')]);_0xbea1cf[_0x3311('0x1b')]=qs[_0x3311('0x1b')](_0xd5b3ca[_0x3311('0x28')][_0x3311('0x1b')]);}_0xbea1cf[_0x3311('0x2f')]=qs['sort'](_0xd5b3ca['query'][_0x3311('0x30')]);_0xbea1cf[_0x3311('0x31')]=qs['filters'](_[_0x3311('0x32')](_0xd5b3ca[_0x3311('0x28')],_0xc581e9['filters']));if(_0xd5b3ca[_0x3311('0x28')][_0x3311('0x33')]){_0xbea1cf['where']=_[_0x3311('0x34')](_0xbea1cf[_0x3311('0x31')],{'$or':_[_0x3311('0x35')](_0xe05f69,function(_0x17dfa){if(_0x17dfa[_0x3311('0x36')][_0x3311('0x37')]!=='VIRTUAL'){var _0x435eb9={};_0x435eb9[_0x17dfa[_0x3311('0x38')]]={'$like':'%'+_0xd5b3ca[_0x3311('0x28')][_0x3311('0x33')]+'%'};return _0x435eb9;}})});}_0xbea1cf=_[_0x3311('0x34')]({},_0xbea1cf,_0xd5b3ca['options']);var _0xcd9284={'where':_0xbea1cf[_0x3311('0x31')]};return db['ServicenowField']['count'](_0xcd9284)[_0x3311('0x39')](function(_0x22559e){_0x206aec[_0x3311('0x1a')]=_0x22559e;if(_0xd5b3ca[_0x3311('0x28')][_0x3311('0x3a')]){_0xbea1cf[_0x3311('0x3b')]=[{'all':!![]}];}return db[_0x3311('0x3c')][_0x3311('0x3d')](_0xbea1cf);})[_0x3311('0x39')](function(_0x5280a8){_0x206aec['rows']=_0x5280a8;return _0x206aec;})['then'](respondWithFilteredResult(_0x2de50f,_0xbea1cf))[_0x3311('0x3e')](handleError(_0x2de50f,null));};exports['show']=function(_0x42ca49,_0xa42027){var _0x479c19={'raw':!![],'where':{'id':_0x42ca49['params']['id']}},_0x6c8cff={};_0x6c8cff[_0x3311('0x2b')]=_[_0x3311('0x27')](db['ServicenowField']['rawAttributes']);_0x6c8cff[_0x3311('0x28')]=_[_0x3311('0x27')](_0x42ca49[_0x3311('0x28')]);_0x6c8cff['filters']=_[_0x3311('0x2a')](_0x6c8cff[_0x3311('0x2b')],_0x6c8cff[_0x3311('0x28')]);_0x479c19['attributes']=_[_0x3311('0x2a')](_0x6c8cff['model'],qs[_0x3311('0x2d')](_0x42ca49[_0x3311('0x28')][_0x3311('0x2d')]));_0x479c19[_0x3311('0x2c')]=_0x479c19[_0x3311('0x2c')][_0x3311('0x3f')]?_0x479c19[_0x3311('0x2c')]:_0x6c8cff[_0x3311('0x2b')];if(_0x42ca49['query']['includeAll']){_0x479c19[_0x3311('0x3b')]=[{'all':!![]}];}_0x479c19=_[_0x3311('0x34')]({},_0x479c19,_0x42ca49[_0x3311('0x40')]);return db[_0x3311('0x3c')]['find'](_0x479c19)[_0x3311('0x39')](handleEntityNotFound(_0xa42027,null))['then'](respondWithResult(_0xa42027,null))[_0x3311('0x3e')](handleError(_0xa42027,null));};exports[_0x3311('0x41')]=function(_0xbee916,_0x28a673){return db[_0x3311('0x3c')]['create'](_0xbee916['body'],{})[_0x3311('0x39')](respondWithResult(_0x28a673,0xc9))[_0x3311('0x3e')](handleError(_0x28a673,null));};exports[_0x3311('0x20')]=function(_0x4ad274,_0x270e6c){if(_0x4ad274[_0x3311('0x42')]['id']){delete _0x4ad274[_0x3311('0x42')]['id'];}return db[_0x3311('0x3c')][_0x3311('0x43')]({'where':{'id':_0x4ad274[_0x3311('0x44')]['id']}})[_0x3311('0x39')](handleEntityNotFound(_0x270e6c,null))[_0x3311('0x39')](saveUpdates(_0x4ad274['body'],null))[_0x3311('0x39')](respondWithResult(_0x270e6c,null))[_0x3311('0x3e')](handleError(_0x270e6c,null));};exports[_0x3311('0x21')]=function(_0x4759e5,_0x582d93){return db[_0x3311('0x3c')]['find']({'where':{'id':_0x4759e5[_0x3311('0x44')]['id']}})[_0x3311('0x39')](handleEntityNotFound(_0x582d93,null))[_0x3311('0x39')](removeEntity(_0x582d93,null))['catch'](handleError(_0x582d93,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index decc21d..a3518a7 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 _0x19ac=['./intServicenowField.attributes','exports','ServicenowField','servicenow_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xff8a90,_0x5fb7dc){var _0x1fe068=function(_0x554511){while(--_0x554511){_0xff8a90['push'](_0xff8a90['shift']());}};_0x1fe068(++_0x5fb7dc);}(_0x19ac,0x17b));var _0xc19a=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x19ac[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xc19a('0x0'));var util=require('util');var logger=require(_0xc19a('0x1'))(_0xc19a('0x2'));var moment=require(_0xc19a('0x3'));var BPromise=require(_0xc19a('0x4'));var rp=require(_0xc19a('0x5'));var attributes=require(_0xc19a('0x6'));module[_0xc19a('0x7')]=function(_0x1c1e86,_0xa9ea8f){return _0x1c1e86['define'](_0xc19a('0x8'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xc19a('0x9'),'fields':[_0xc19a('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e5a=['ServicenowField','servicenow_unique_index','idField','FieldId','../../config/logger','api','request-promise','./intServicenowField.attributes','exports','define'];(function(_0x36d25e,_0x1a047d){var _0x4b95b8=function(_0x74da3){while(--_0x74da3){_0x36d25e['push'](_0x36d25e['shift']());}};_0x4b95b8(++_0x1a047d);}(_0x7e5a,0x1d0));var _0xa7e5=function(_0x18b9b5,_0x59ae05){_0x18b9b5=_0x18b9b5-0x0;var _0x2670ac=_0x7e5a[_0x18b9b5];return _0x2670ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa7e5('0x0'))(_0xa7e5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa7e5('0x2'));var attributes=require(_0xa7e5('0x3'));module[_0xa7e5('0x4')]=function(_0x1c1f69,_0x1f9ca8){return _0x1c1f69[_0xa7e5('0x5')](_0xa7e5('0x6'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xa7e5('0x7'),'fields':[_0xa7e5('0x8'),_0xa7e5('0x9')],'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 b644fa8..b002dac 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 _0xb145=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowField,\x20%s,\x20%s','message'];(function(_0x18d7ac,_0x4cdd23){var _0x2a5840=function(_0x11f098){while(--_0x11f098){_0x18d7ac['push'](_0x18d7ac['shift']());}};_0x2a5840(++_0x4cdd23);}(_0xb145,0xa3));var _0x5b14=function(_0x32f82c,_0xf65f9e){_0x32f82c=_0x32f82c-0x0;var _0x1a8a39=_0xb145[_0x32f82c];return _0x1a8a39;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var BPromise=require(_0x5b14('0x2'));var rs=require(_0x5b14('0x3'));var fs=require('fs');var Redis=require(_0x5b14('0x4'));var db=require(_0x5b14('0x5'))['db'];var utils=require(_0x5b14('0x6'));var logger=require(_0x5b14('0x7'))('rpc');var config=require(_0x5b14('0x8'));var jayson=require(_0x5b14('0x9'));var client=jayson[_0x5b14('0xa')][_0x5b14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50fd91,_0x1d12ed,_0x2a3921){return new BPromise(function(_0x34530a,_0x62cdcd){return client[_0x5b14('0xc')](_0x50fd91,_0x2a3921)['then'](function(_0x32d729){logger[_0x5b14('0xd')]('ServicenowField,\x20%s,\x20%s',_0x1d12ed,_0x5b14('0xe'));logger[_0x5b14('0xf')](_0x5b14('0x10'),_0x1d12ed,_0x5b14('0xe'),JSON[_0x5b14('0x11')](_0x32d729));if(_0x32d729['error']){if(_0x32d729[_0x5b14('0x12')]['code']===0x1f4){logger[_0x5b14('0x12')](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x62cdcd(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x34530a(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}else{logger[_0x5b14('0xd')](_0x5b14('0x13'),_0x1d12ed,_0x5b14('0xe'));_0x34530a(_0x32d729[_0x5b14('0x15')][_0x5b14('0x14')]);}})[_0x5b14('0x16')](function(_0x2c3efb){logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x2c3efb);_0x62cdcd(_0x2c3efb);});});} \ No newline at end of file +var _0xa30a=['stringify','error','code','message','request\x20sent','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ServicenowField,\x20%s,\x20%s','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x23fae4,_0x3fdf93){var _0x165c2f=function(_0x48e8b8){while(--_0x48e8b8){_0x23fae4['push'](_0x23fae4['shift']());}};_0x165c2f(++_0x3fdf93);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8af448,_0x14fe09,_0x42dc22){return new BPromise(function(_0x5d076a,_0xedbc45){return client[_0xaa30('0xb')](_0x8af448,_0x42dc22)[_0xaa30('0xc')](function(_0x59d028){logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,'request\x20sent');logger['debug'](_0xaa30('0xf'),_0x14fe09,'request\x20sent',JSON[_0xaa30('0x10')](_0x59d028));if(_0x59d028[_0xaa30('0x11')]){if(_0x59d028[_0xaa30('0x11')][_0xaa30('0x12')]===0x1f4){logger['error'](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0xedbc45(_0x59d028['error'][_0xaa30('0x13')]);}logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0x5d076a(_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);}else{logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,_0xaa30('0x14'));_0x5d076a(_0x59d028['result'][_0xaa30('0x13')]);}})['catch'](function(_0x5eb356){logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x5eb356);_0xedbc45(_0x5eb356);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index c71522a..5f2b64a 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 _0x07f6=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete','destroy','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller'];(function(_0x5c0d29,_0x3bfd47){var _0x3303ae=function(_0x5d79eb){while(--_0x5d79eb){_0x5c0d29['push'](_0x5c0d29['shift']());}};_0x3303ae(++_0x3bfd47);}(_0x07f6,0xa2));var _0x607f=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x07f6[_0x3f5dca];return _0x5b833a;};'use strict';var multer=require(_0x607f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x607f('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x607f('0x2'));var interaction=require(_0x607f('0x3'));var config=require(_0x607f('0x4'));var controller=require(_0x607f('0x5'));router[_0x607f('0x6')]('/',auth[_0x607f('0x7')](),controller[_0x607f('0x8')]);router[_0x607f('0x6')](_0x607f('0x9'),auth['isAuthenticated'](),controller[_0x607f('0xa')]);router[_0x607f('0x6')](_0x607f('0xb'),auth[_0x607f('0x7')](),controller[_0x607f('0xc')]);router['get'](_0x607f('0xd'),auth[_0x607f('0x7')](),controller['getFields']);router[_0x607f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x607f('0xe')](_0x607f('0xb'),auth[_0x607f('0x7')](),controller[_0x607f('0xf')]);router[_0x607f('0x10')](_0x607f('0x9'),auth['isAuthenticated'](),controller[_0x607f('0x11')]);router[_0x607f('0x12')](_0x607f('0x9'),auth[_0x607f('0x7')](),controller[_0x607f('0x13')]);module[_0x607f('0x14')]=router; \ No newline at end of file +var _0xe073=['../../config/environment','./intSugarcrmAccount.controller','isAuthenticated','get','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','/:id','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xe073,0x134));var _0x3e07=function(_0xb5646e,_0x327fd7){_0xb5646e=_0xb5646e-0x0;var _0x55fe64=_0xe073[_0xb5646e];return _0x55fe64;};'use strict';var multer=require(_0x3e07('0x0'));var util=require(_0x3e07('0x1'));var path=require(_0x3e07('0x2'));var timeout=require(_0x3e07('0x3'));var express=require('express');var router=express[_0x3e07('0x4')]();var auth=require(_0x3e07('0x5'));var interaction=require(_0x3e07('0x6'));var config=require(_0x3e07('0x7'));var controller=require(_0x3e07('0x8'));router['get']('/',auth[_0x3e07('0x9')](),controller['index']);router[_0x3e07('0xa')]('/:id',auth[_0x3e07('0x9')](),controller[_0x3e07('0xb')]);router[_0x3e07('0xa')]('/:id/configurations',auth[_0x3e07('0x9')](),controller[_0x3e07('0xc')]);router['get'](_0x3e07('0xd'),auth[_0x3e07('0x9')](),controller[_0x3e07('0xe')]);router[_0x3e07('0xf')]('/',auth[_0x3e07('0x9')](),controller[_0x3e07('0x10')]);router['post'](_0x3e07('0x11'),auth[_0x3e07('0x9')](),controller['addConfiguration']);router[_0x3e07('0x12')](_0x3e07('0x13'),auth[_0x3e07('0x9')](),controller['update']);router['delete'](_0x3e07('0x13'),auth[_0x3e07('0x9')](),controller['destroy']);module[_0x3e07('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 44aa1cc..e346682 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 _0x7f59=['username','remoteUri','sequelize','exports','STRING'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x7f59,0x1c4));var _0x97f5=function(_0x1d230c,_0x284f89){_0x1d230c=_0x1d230c-0x0;var _0xbdaea9=_0x7f59[_0x1d230c];return _0xbdaea9;};'use strict';var Sequelize=require(_0x97f5('0x0'));module[_0x97f5('0x1')]={'name':{'type':Sequelize[_0x97f5('0x2')]},'description':{'type':Sequelize[_0x97f5('0x2')]},'username':{'type':Sequelize[_0x97f5('0x2')],'unique':_0x97f5('0x3')},'password':{'type':Sequelize[_0x97f5('0x2')]},'remoteUri':{'type':Sequelize[_0x97f5('0x2')],'unique':_0x97f5('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x280f=['STRING','username','remoteUri','sequelize','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x280f,0x102));var _0xf280=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x280f[_0x479509];return _0x382da8;};'use strict';var Sequelize=require(_0xf280('0x0'));module[_0xf280('0x1')]={'name':{'type':Sequelize[_0xf280('0x2')]},'description':{'type':Sequelize[_0xf280('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xf280('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xf280('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index f8d9c47..c787b7a 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 _0xc70b=['pick','filter','map','type','key','VIRTUAL','merge','count','includeAll','include','SugarcrmAccount','findAll','rows','params','rawAttributes','find','create','body','getConfigurations','findOne','options','getSubjects','Descriptions','getDescriptions','channel','Subjects','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','Calls','values','remove','length','label','value','test','statusCode','Wrong\x20credentials','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','message','result','catch','SugarcrmAccount,\x20%s,\x20%s','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3ec73f,_0x2dce6a){var _0x4b771a=function(_0x4c8d1a){while(--_0x4c8d1a){_0x3ec73f['push'](_0x3ec73f['shift']());}};_0x4b771a(++_0x2dce6a);}(_0xc70b,0x13b));var _0xbc70=function(_0x3c0d98,_0x510a42){_0x3c0d98=_0x3c0d98-0x0;var _0x3fdc28=_0xc70b[_0x3c0d98];return _0x3fdc28;};'use strict';var pdf=require(_0xbc70('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbc70('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc70('0x2'));var rp=require(_0xbc70('0x3'));var moment=require(_0xbc70('0x4'));var BPromise=require(_0xbc70('0x5'));var Mustache=require(_0xbc70('0x6'));var util=require('util');var path=require(_0xbc70('0x7'));var sox=require(_0xbc70('0x8'));var csv=require(_0xbc70('0x9'));var ejs=require(_0xbc70('0xa'));var fs=require('fs');var _=require(_0xbc70('0xb'));var squel=require(_0xbc70('0xc'));var crypto=require(_0xbc70('0xd'));var jsforce=require(_0xbc70('0xe'));var deskjs=require(_0xbc70('0xf'));var toCsv=require(_0xbc70('0x9'));var querystring=require('querystring');var Papa=require(_0xbc70('0x10'));var authService=require(_0xbc70('0x11'));var hardwareService=require(_0xbc70('0x12'));var Redis=require(_0xbc70('0x13'));var qs=require(_0xbc70('0x14'));var logger=require(_0xbc70('0x15'))('api');var utils=require(_0xbc70('0x16'));var config=require(_0xbc70('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbc70('0x18'));var jayson=require(_0xbc70('0x19'));var client=jayson[_0xbc70('0x1a')][_0xbc70('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x210013,_0x245b87,_0x1247e6,_0x16d47a){return new BPromise(function(_0x1c5ae8,_0x2a4ed4){var _0x325d8c=_0x16d47a||client;return _0x325d8c['request'](_0x210013,_0x1247e6)[_0xbc70('0x1c')](function(_0x27b9a1){logger[_0xbc70('0x1d')]('SugarcrmAccount,\x20%s,\x20%s',_0x245b87,_0xbc70('0x1e'));logger[_0xbc70('0x1f')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x245b87,_0xbc70('0x1e'),JSON[_0xbc70('0x20')](_0x27b9a1));if(_0x27b9a1[_0xbc70('0x21')]){if(_0x27b9a1[_0xbc70('0x21')]['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x245b87,_0x27b9a1[_0xbc70('0x21')][_0xbc70('0x22')]);return _0x2a4ed4(_0x27b9a1[_0xbc70('0x21')][_0xbc70('0x22')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x245b87,_0x27b9a1[_0xbc70('0x21')][_0xbc70('0x22')]);return _0x1c5ae8(_0x27b9a1[_0xbc70('0x21')][_0xbc70('0x22')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x245b87,_0xbc70('0x1e'));_0x1c5ae8(_0x27b9a1[_0xbc70('0x23')]['message']);}})[_0xbc70('0x24')](function(_0x2d84ab){logger[_0xbc70('0x21')](_0xbc70('0x25'),_0x245b87,_0x2d84ab);_0x2a4ed4(_0x2d84ab);});});}function respondWithStatusCode(_0x56ace2,_0x1e6822){_0x1e6822=_0x1e6822||0xcc;return function(_0x3f8e84){if(_0x3f8e84){return _0x56ace2[_0xbc70('0x26')](_0x1e6822);}return _0x56ace2[_0xbc70('0x27')](_0x1e6822)[_0xbc70('0x28')]();};}function respondWithResult(_0x39c539,_0x577af5){_0x577af5=_0x577af5||0xc8;return function(_0x2bfef6){if(_0x2bfef6){return _0x39c539[_0xbc70('0x27')](_0x577af5)[_0xbc70('0x29')](_0x2bfef6);}};}function respondWithFilteredResult(_0x3bbdf1,_0x15b533){return function(_0x4c999c){if(_0x4c999c){var _0x3f7700=_0x4c999c['count'],_0x7699fa=_0x15b533[_0xbc70('0x2a')],_0x26bc9a=_0x15b533[_0xbc70('0x2a')]+_0x15b533[_0xbc70('0x2b')],_0x1958d5;if(_0x26bc9a>=_0x3f7700){_0x26bc9a=_0x3f7700;_0x1958d5=0xc8;}else{_0x1958d5=0xce;}_0x3bbdf1['status'](_0x1958d5);return _0x3bbdf1[_0xbc70('0x2c')](_0xbc70('0x2d'),_0x7699fa+'-'+_0x26bc9a+'/'+_0x3f7700)[_0xbc70('0x29')](_0x4c999c);}return null;};}function patchUpdates(_0x31311e){return function(_0x5ac54e){try{jsonpatch[_0xbc70('0x2e')](_0x5ac54e,_0x31311e,!![]);}catch(_0x12be13){return BPromise[_0xbc70('0x2f')](_0x12be13);}return _0x5ac54e['save']();};}function saveUpdates(_0x4923bf,_0x4a7121){return function(_0x5e6d03){if(_0x5e6d03){return _0x5e6d03[_0xbc70('0x30')](_0x4923bf)[_0xbc70('0x1c')](function(_0x34d15f){return _0x34d15f;});}return null;};}function removeEntity(_0x5728c6,_0x106675){return function(_0x4c522c){if(_0x4c522c){return _0x4c522c[_0xbc70('0x31')]()[_0xbc70('0x1c')](function(){_0x5728c6['status'](0xcc)[_0xbc70('0x28')]();});}};}function handleEntityNotFound(_0x37a2de,_0x4ada88){return function(_0xb17538){if(!_0xb17538){_0x37a2de[_0xbc70('0x26')](0x194);}return _0xb17538;};}function handleError(_0x33cb86,_0x17ca40){_0x17ca40=_0x17ca40||0x1f4;return function(_0x12e18c){logger['error'](_0x12e18c[_0xbc70('0x32')]);if(_0x12e18c[_0xbc70('0x33')]){delete _0x12e18c[_0xbc70('0x33')];}_0x33cb86[_0xbc70('0x27')](_0x17ca40)[_0xbc70('0x34')](_0x12e18c);};}exports[_0xbc70('0x35')]=function(_0x4b5e61,_0x14d2f6){var _0x3972f7={},_0x547f6c={},_0x5c6348={'count':0x0,'rows':[]};var _0x1c08d5=db['SugarcrmAccount']['rawAttributes'];_0x547f6c['model']=_[_0xbc70('0x36')](_0x1c08d5);_0x547f6c['query']=_[_0xbc70('0x36')](_0x4b5e61[_0xbc70('0x37')]);_0x547f6c[_0xbc70('0x38')]=_[_0xbc70('0x39')](_0x547f6c[_0xbc70('0x3a')],_0x547f6c[_0xbc70('0x37')]);_0x3972f7[_0xbc70('0x3b')]=_[_0xbc70('0x39')](_0x547f6c[_0xbc70('0x3a')],qs[_0xbc70('0x3c')](_0x4b5e61['query'][_0xbc70('0x3c')]));_0x3972f7['attributes']=_0x3972f7[_0xbc70('0x3b')]['length']?_0x3972f7[_0xbc70('0x3b')]:_0x547f6c['model'];if(!_0x4b5e61[_0xbc70('0x37')][_0xbc70('0x3d')](_0xbc70('0x3e'))){_0x3972f7[_0xbc70('0x2b')]=qs['limit'](_0x4b5e61['query']['limit']);_0x3972f7['offset']=qs['offset'](_0x4b5e61[_0xbc70('0x37')][_0xbc70('0x2a')]);}_0x3972f7[_0xbc70('0x3f')]=qs['sort'](_0x4b5e61[_0xbc70('0x37')][_0xbc70('0x40')]);_0x3972f7[_0xbc70('0x41')]=qs[_0xbc70('0x38')](_[_0xbc70('0x42')](_0x4b5e61[_0xbc70('0x37')],_0x547f6c[_0xbc70('0x38')]));if(_0x4b5e61[_0xbc70('0x37')][_0xbc70('0x43')]){_0x3972f7['where']=_['merge'](_0x3972f7[_0xbc70('0x41')],{'$or':_[_0xbc70('0x44')](_0x1c08d5,function(_0x5bffeb){if(_0x5bffeb[_0xbc70('0x45')][_0xbc70('0x46')]!==_0xbc70('0x47')){var _0x863887={};_0x863887[_0x5bffeb['field']]={'$like':'%'+_0x4b5e61[_0xbc70('0x37')]['filter']+'%'};return _0x863887;}})});}_0x3972f7=_[_0xbc70('0x48')]({},_0x3972f7,_0x4b5e61['options']);var _0x43f5ce={'where':_0x3972f7[_0xbc70('0x41')]};return db['SugarcrmAccount'][_0xbc70('0x49')](_0x43f5ce)[_0xbc70('0x1c')](function(_0x4ff234){_0x5c6348[_0xbc70('0x49')]=_0x4ff234;if(_0x4b5e61[_0xbc70('0x37')][_0xbc70('0x4a')]){_0x3972f7[_0xbc70('0x4b')]=[{'all':!![]}];}return db[_0xbc70('0x4c')][_0xbc70('0x4d')](_0x3972f7);})[_0xbc70('0x1c')](function(_0x37ffa7){_0x5c6348[_0xbc70('0x4e')]=_0x37ffa7;return _0x5c6348;})[_0xbc70('0x1c')](respondWithFilteredResult(_0x14d2f6,_0x3972f7))['catch'](handleError(_0x14d2f6,null));};exports['show']=function(_0x30d528,_0x4f1eb9){var _0x97129d={'raw':![],'where':{'id':_0x30d528[_0xbc70('0x4f')]['id']}},_0x594436={};_0x594436[_0xbc70('0x3a')]=_['keys'](db[_0xbc70('0x4c')][_0xbc70('0x50')]);_0x594436[_0xbc70('0x37')]=_[_0xbc70('0x36')](_0x30d528[_0xbc70('0x37')]);_0x594436['filters']=_[_0xbc70('0x39')](_0x594436[_0xbc70('0x3a')],_0x594436['query']);_0x97129d[_0xbc70('0x3b')]=_[_0xbc70('0x39')](_0x594436[_0xbc70('0x3a')],qs[_0xbc70('0x3c')](_0x30d528[_0xbc70('0x37')]['fields']));_0x97129d[_0xbc70('0x3b')]=_0x97129d[_0xbc70('0x3b')]['length']?_0x97129d['attributes']:_0x594436['model'];if(_0x30d528[_0xbc70('0x37')]['includeAll']){_0x97129d['include']=[{'all':!![]}];}_0x97129d=_[_0xbc70('0x48')]({},_0x97129d,_0x30d528['options']);return db[_0xbc70('0x4c')][_0xbc70('0x51')](_0x97129d)[_0xbc70('0x1c')](handleEntityNotFound(_0x4f1eb9,null))[_0xbc70('0x1c')](respondWithResult(_0x4f1eb9,null))[_0xbc70('0x24')](handleError(_0x4f1eb9,null));};exports[_0xbc70('0x52')]=function(_0x1120d3,_0x546a1d){return db['SugarcrmAccount'][_0xbc70('0x52')](_0x1120d3['body'],{})[_0xbc70('0x1c')](respondWithResult(_0x546a1d,0xc9))['catch'](handleError(_0x546a1d,null));};exports[_0xbc70('0x30')]=function(_0x535866,_0x1460db){if(_0x535866['body']['id']){delete _0x535866[_0xbc70('0x53')]['id'];}return db[_0xbc70('0x4c')][_0xbc70('0x51')]({'where':{'id':_0x535866[_0xbc70('0x4f')]['id']}})[_0xbc70('0x1c')](handleEntityNotFound(_0x1460db,null))['then'](saveUpdates(_0x535866[_0xbc70('0x53')],null))[_0xbc70('0x1c')](respondWithResult(_0x1460db,null))[_0xbc70('0x24')](handleError(_0x1460db,null));};exports[_0xbc70('0x31')]=function(_0x389308,_0x1c29e0){return db[_0xbc70('0x4c')][_0xbc70('0x51')]({'where':{'id':_0x389308[_0xbc70('0x4f')]['id']}})[_0xbc70('0x1c')](handleEntityNotFound(_0x1c29e0,null))['then'](removeEntity(_0x1c29e0,null))[_0xbc70('0x24')](handleError(_0x1c29e0,null));};exports[_0xbc70('0x54')]=function(_0x3c9474,_0x280684,_0x4ac729){var _0x105dc0={};var _0x560e53={};var _0x3df172;var _0x56dc33;return db[_0xbc70('0x4c')][_0xbc70('0x55')]({'where':{'id':_0x3c9474[_0xbc70('0x4f')]['id']}})['then'](handleEntityNotFound(_0x280684,null))[_0xbc70('0x1c')](function(_0x512f27){if(_0x512f27){_0x3df172=_0x512f27;_0x560e53[_0xbc70('0x3a')]=_[_0xbc70('0x36')](db['SugarcrmConfiguration'][_0xbc70('0x50')]);_0x560e53[_0xbc70('0x37')]=_[_0xbc70('0x36')](_0x3c9474['query']);_0x560e53[_0xbc70('0x38')]=_[_0xbc70('0x39')](_0x560e53[_0xbc70('0x3a')],_0x560e53[_0xbc70('0x37')]);_0x105dc0['attributes']=_[_0xbc70('0x39')](_0x560e53[_0xbc70('0x3a')],qs[_0xbc70('0x3c')](_0x3c9474[_0xbc70('0x37')][_0xbc70('0x3c')]));_0x105dc0[_0xbc70('0x3b')]=_0x105dc0[_0xbc70('0x3b')]['length']?_0x105dc0[_0xbc70('0x3b')]:_0x560e53['model'];_0x105dc0[_0xbc70('0x3f')]=qs[_0xbc70('0x40')](_0x3c9474[_0xbc70('0x37')][_0xbc70('0x40')]);_0x105dc0['where']=qs[_0xbc70('0x38')](_[_0xbc70('0x42')](_0x3c9474[_0xbc70('0x37')],_0x560e53[_0xbc70('0x38')]));if(_0x3c9474['query'][_0xbc70('0x43')]){_0x105dc0[_0xbc70('0x41')]=_['merge'](_0x105dc0[_0xbc70('0x41')],{'$or':_['map'](_0x105dc0['attributes'],function(_0x317322){var _0x408f90={};_0x408f90[_0x317322]={'$like':'%'+_0x3c9474[_0xbc70('0x37')][_0xbc70('0x43')]+'%'};return _0x408f90;})});}_0x105dc0=_['merge']({},_0x105dc0,_0x3c9474[_0xbc70('0x56')]);return _0x3df172[_0xbc70('0x54')](_0x105dc0);}})['then'](function(_0x3b0116){if(_0x3b0116){_0x56dc33=_0x3b0116['length'];if(!_0x3c9474[_0xbc70('0x37')]['hasOwnProperty'](_0xbc70('0x3e'))){_0x105dc0[_0xbc70('0x2b')]=qs[_0xbc70('0x2b')](_0x3c9474[_0xbc70('0x37')][_0xbc70('0x2b')]);_0x105dc0[_0xbc70('0x2a')]=qs[_0xbc70('0x2a')](_0x3c9474[_0xbc70('0x37')][_0xbc70('0x2a')]);}return _0x3df172['getConfigurations'](_0x105dc0);}})[_0xbc70('0x1c')](function(_0x5a2336){if(_0x5a2336){return _0x5a2336?{'count':_0x56dc33,'rows':_0x5a2336}:null;}})['then'](respondWithResult(_0x280684,null))['catch'](handleError(_0x280684,null));};exports['addConfiguration']=function(_0x125c9d,_0x3dd2b0,_0x5bd9ae){if(_0x125c9d[_0xbc70('0x53')]['id']){delete _0x125c9d[_0xbc70('0x53')]['id'];}return db['SugarcrmAccount'][_0xbc70('0x55')]({'where':{'id':_0x125c9d[_0xbc70('0x4f')]['id']}})[_0xbc70('0x1c')](handleEntityNotFound(_0x3dd2b0,null))[_0xbc70('0x1c')](function(_0x5087cd){if(_0x5087cd){_0x125c9d[_0xbc70('0x53')]['AccountId']=_0x5087cd['id'];_0x125c9d[_0xbc70('0x53')]['Subjects']=integrations[_0xbc70('0x57')](_0x125c9d[_0xbc70('0x53')]['channel'],_0x125c9d[_0xbc70('0x53')][_0xbc70('0x45')]);_0x125c9d[_0xbc70('0x53')][_0xbc70('0x58')]=integrations[_0xbc70('0x59')](_0x125c9d['body'][_0xbc70('0x5a')],_0x125c9d[_0xbc70('0x53')][_0xbc70('0x45')]);return db['SugarcrmConfiguration'][_0xbc70('0x52')](_0x125c9d['body'],{'include':[{'model':db['SugarcrmField'],'as':_0xbc70('0x5b')},{'model':db[_0xbc70('0x5c')],'as':'Descriptions'}]});}return null;})[_0xbc70('0x1c')](respondWithResult(_0x3dd2b0,null))[_0xbc70('0x24')](handleError(_0x3dd2b0,null));};exports[_0xbc70('0x5d')]=function(_0x4c5844,_0x2f7a63,_0x1f4499){var _0x270f5c;var _0x347ed1=['id',_0xbc70('0x33'),_0xbc70('0x5e'),_0xbc70('0x5f'),_0xbc70('0x60'),_0xbc70('0x61'),_0xbc70('0x62'),_0xbc70('0x63'),_0xbc70('0x64'),_0xbc70('0x65'),_0xbc70('0x66'),_0xbc70('0x67')];return db[_0xbc70('0x4c')][_0xbc70('0x55')]({'where':{'id':_0x4c5844[_0xbc70('0x4f')]['id']},'attributes':['id',_0xbc70('0x68'),_0xbc70('0x69'),'remoteUri']})['then'](handleEntityNotFound(_0x2f7a63,null))[_0xbc70('0x1c')](function(_0x4fac47){if(_0x4fac47){_0x270f5c=_0x4fac47[_0xbc70('0x6a')];return rp({'method':'POST','uri':util[_0xbc70('0x6b')](_0xbc70('0x6c'),_0x270f5c,_0xbc70('0x6d')),'json':!![],'form':{'method':_0xbc70('0x6e'),'input_type':_0xbc70('0x6f'),'response_type':_0xbc70('0x6f'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x4fac47[_0xbc70('0x68')],'password':_0x4fac47['password'],'encryption':_0xbc70('0x70')},'application':_0xbc70('0x71')})}});}})[_0xbc70('0x1c')](function(_0x274a4d){if(_0x274a4d&&_0x274a4d['name']!==_0xbc70('0x72')&&_0x274a4d[_0xbc70('0x33')]!==_0xbc70('0x73')){return rp({'method':_0xbc70('0x74'),'uri':util[_0xbc70('0x6b')](_0xbc70('0x6c'),_0x270f5c,_0xbc70('0x6d')),'json':!![],'form':{'method':_0xbc70('0x75'),'input_type':_0xbc70('0x6f'),'response_type':_0xbc70('0x6f'),'rest_data':JSON[_0xbc70('0x20')]({'session':_0x274a4d['id'],'module_name':_0xbc70('0x76')})}})['then'](function(_0x48cdb4){if(_0x48cdb4){var _0x42ce38=_[_0xbc70('0x77')](_0x48cdb4['module_fields']);_[_0xbc70('0x78')](_0x42ce38,function(_0x360a14){return _0x347ed1['includes'](_0x360a14[_0xbc70('0x33')]);});return{'count':_0x42ce38[_0xbc70('0x79')],'rows':_[_0xbc70('0x44')](_0x42ce38,function(_0x29c17c){return{'id':_0x29c17c[_0xbc70('0x33')],'name':_0x29c17c[_0xbc70('0x7a')],'custom':_['endsWith'](_0x29c17c['name'],'_c')?!![]:![],'options':_0x29c17c[_0xbc70('0x56')]?_['map'](_[_0xbc70('0x77')](_0x29c17c[_0xbc70('0x56')]),function(_0x5d04a5){return{'name':_0x5d04a5[_0xbc70('0x7b')],'value':_0x5d04a5['name']};}):[]};})};}})['then'](respondWithResult(_0x2f7a63,null))[_0xbc70('0x24')](function(_0x593535){var _0x49d410=_0x4c5844[_0xbc70('0x37')][_0xbc70('0x7c')]?0x1f4:_0x593535[_0xbc70('0x7d')]||0x1f4;logger[_0xbc70('0x21')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x49d410,JSON[_0xbc70('0x20')](_0x593535));delete _0x593535['name'];if(_0x49d410===0x191){_0x49d410=0x190;}_0x2f7a63['status'](_0x49d410)[_0xbc70('0x34')](_0x4c5844[_0xbc70('0x37')][_0xbc70('0x7c')]?{'message':_0xbc70('0x7e'),'statusCode':_0x593535['statusCode']}:_0x593535);});}else{var _0x98b2e1=0x1f4;_0x2f7a63[_0xbc70('0x27')](_0x98b2e1)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x0f54=['info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','apply','save','destroy','then','sendStatus','stack','name','send','index','SugarcrmAccount','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','key','VIRTUAL','filter','merge','findAll','rows','show','params','keys','rawAttributes','include','create','body','update','find','getConfigurations','findOne','SugarcrmConfiguration','map','options','AccountId','Subjects','Descriptions','getDescriptions','channel','type','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','password','remoteUri','format','%s%s','JSON','username','PLAIN','Invalid\x20Login','POST','/service/v4_1/rest.php','Calls','values','module_fields','remove','includes','label','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','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','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','request'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x0f54,0x1db));var _0x40f5=function(_0x5d516b,_0x347b84){_0x5d516b=_0x5d516b-0x0;var _0x3cede5=_0x0f54[_0x5d516b];return _0x3cede5;};'use strict';var pdf=require(_0x40f5('0x0'));var emlformat=require(_0x40f5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x40f5('0x2'));var jsonpatch=require(_0x40f5('0x3'));var rp=require(_0x40f5('0x4'));var moment=require(_0x40f5('0x5'));var BPromise=require(_0x40f5('0x6'));var Mustache=require(_0x40f5('0x7'));var util=require(_0x40f5('0x8'));var path=require(_0x40f5('0x9'));var sox=require(_0x40f5('0xa'));var csv=require(_0x40f5('0xb'));var ejs=require(_0x40f5('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x40f5('0xd'));var crypto=require(_0x40f5('0xe'));var jsforce=require(_0x40f5('0xf'));var deskjs=require(_0x40f5('0x10'));var toCsv=require(_0x40f5('0xb'));var querystring=require(_0x40f5('0x11'));var Papa=require(_0x40f5('0x12'));var authService=require(_0x40f5('0x13'));var hardwareService=require(_0x40f5('0x14'));var Redis=require('ioredis');var qs=require(_0x40f5('0x15'));var logger=require(_0x40f5('0x16'))(_0x40f5('0x17'));var utils=require(_0x40f5('0x18'));var config=require('../../config/environment');var db=require(_0x40f5('0x19'))['db'];var integrations=require(_0x40f5('0x1a'));var jayson=require(_0x40f5('0x1b'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x320763,_0x3e690b,_0x526bd1,_0x52489a){return new BPromise(function(_0x5c12ed,_0x10ae08){var _0x3c4913=_0x52489a||client;return _0x3c4913[_0x40f5('0x1c')](_0x320763,_0x526bd1)['then'](function(_0x462cb1){logger[_0x40f5('0x1d')](_0x40f5('0x1e'),_0x3e690b,_0x40f5('0x1f'));logger[_0x40f5('0x20')](_0x40f5('0x21'),_0x3e690b,_0x40f5('0x1f'),JSON[_0x40f5('0x22')](_0x462cb1));if(_0x462cb1[_0x40f5('0x23')]){if(_0x462cb1['error'][_0x40f5('0x24')]===0x1f4){logger[_0x40f5('0x23')](_0x40f5('0x1e'),_0x3e690b,_0x462cb1['error'][_0x40f5('0x25')]);return _0x10ae08(_0x462cb1['error']['message']);}logger[_0x40f5('0x23')](_0x40f5('0x1e'),_0x3e690b,_0x462cb1[_0x40f5('0x23')][_0x40f5('0x25')]);return _0x5c12ed(_0x462cb1['error']['message']);}else{logger[_0x40f5('0x1d')]('SugarcrmAccount,\x20%s,\x20%s',_0x3e690b,'request\x20sent');_0x5c12ed(_0x462cb1[_0x40f5('0x26')][_0x40f5('0x25')]);}})[_0x40f5('0x27')](function(_0x30e8a2){logger[_0x40f5('0x23')](_0x40f5('0x1e'),_0x3e690b,_0x30e8a2);_0x10ae08(_0x30e8a2);});});}function respondWithStatusCode(_0x3a4cc7,_0x337aa4){_0x337aa4=_0x337aa4||0xcc;return function(_0x113fc8){if(_0x113fc8){return _0x3a4cc7['sendStatus'](_0x337aa4);}return _0x3a4cc7[_0x40f5('0x28')](_0x337aa4)[_0x40f5('0x29')]();};}function respondWithResult(_0x199241,_0x309262){_0x309262=_0x309262||0xc8;return function(_0x3db099){if(_0x3db099){return _0x199241['status'](_0x309262)[_0x40f5('0x2a')](_0x3db099);}};}function respondWithFilteredResult(_0x212e98,_0x5eb00d){return function(_0x1161e2){if(_0x1161e2){var _0x50d07d=_0x1161e2[_0x40f5('0x2b')],_0x50d38e=_0x5eb00d[_0x40f5('0x2c')],_0xa36029=_0x5eb00d['offset']+_0x5eb00d['limit'],_0x1a1a22;if(_0xa36029>=_0x50d07d){_0xa36029=_0x50d07d;_0x1a1a22=0xc8;}else{_0x1a1a22=0xce;}_0x212e98[_0x40f5('0x28')](_0x1a1a22);return _0x212e98['set']('Content-Range',_0x50d38e+'-'+_0xa36029+'/'+_0x50d07d)[_0x40f5('0x2a')](_0x1161e2);}return null;};}function patchUpdates(_0x199204){return function(_0x4cf548){try{jsonpatch[_0x40f5('0x2d')](_0x4cf548,_0x199204,!![]);}catch(_0x4a4d9e){return BPromise['reject'](_0x4a4d9e);}return _0x4cf548[_0x40f5('0x2e')]();};}function saveUpdates(_0x1e3c21,_0x201552){return function(_0x57f30f){if(_0x57f30f){return _0x57f30f['update'](_0x1e3c21)['then'](function(_0x277b0f){return _0x277b0f;});}return null;};}function removeEntity(_0x29873f,_0x4d1b66){return function(_0x4d2725){if(_0x4d2725){return _0x4d2725[_0x40f5('0x2f')]()[_0x40f5('0x30')](function(){_0x29873f[_0x40f5('0x28')](0xcc)[_0x40f5('0x29')]();});}};}function handleEntityNotFound(_0x1e41ab,_0x956b6){return function(_0x5d2bf6){if(!_0x5d2bf6){_0x1e41ab[_0x40f5('0x31')](0x194);}return _0x5d2bf6;};}function handleError(_0x2508f6,_0x436c40){_0x436c40=_0x436c40||0x1f4;return function(_0x1b97de){logger['error'](_0x1b97de[_0x40f5('0x32')]);if(_0x1b97de[_0x40f5('0x33')]){delete _0x1b97de[_0x40f5('0x33')];}_0x2508f6[_0x40f5('0x28')](_0x436c40)[_0x40f5('0x34')](_0x1b97de);};}exports[_0x40f5('0x35')]=function(_0x2075c5,_0x5b3458){var _0x2a0d90={},_0xb8947e={},_0x4af8fc={'count':0x0,'rows':[]};var _0x171d8f=db[_0x40f5('0x36')]['rawAttributes'];_0xb8947e[_0x40f5('0x37')]=_['keys'](_0x171d8f);_0xb8947e['query']=_['keys'](_0x2075c5[_0x40f5('0x38')]);_0xb8947e[_0x40f5('0x39')]=_[_0x40f5('0x3a')](_0xb8947e['model'],_0xb8947e['query']);_0x2a0d90[_0x40f5('0x3b')]=_['intersection'](_0xb8947e[_0x40f5('0x37')],qs[_0x40f5('0x3c')](_0x2075c5['query'][_0x40f5('0x3c')]));_0x2a0d90[_0x40f5('0x3b')]=_0x2a0d90[_0x40f5('0x3b')][_0x40f5('0x3d')]?_0x2a0d90[_0x40f5('0x3b')]:_0xb8947e['model'];if(!_0x2075c5[_0x40f5('0x38')][_0x40f5('0x3e')](_0x40f5('0x3f'))){_0x2a0d90[_0x40f5('0x40')]=qs[_0x40f5('0x40')](_0x2075c5['query'][_0x40f5('0x40')]);_0x2a0d90[_0x40f5('0x2c')]=qs[_0x40f5('0x2c')](_0x2075c5[_0x40f5('0x38')][_0x40f5('0x2c')]);}_0x2a0d90[_0x40f5('0x41')]=qs[_0x40f5('0x42')](_0x2075c5[_0x40f5('0x38')][_0x40f5('0x42')]);_0x2a0d90[_0x40f5('0x43')]=qs[_0x40f5('0x39')](_[_0x40f5('0x44')](_0x2075c5[_0x40f5('0x38')],_0xb8947e[_0x40f5('0x39')]));if(_0x2075c5[_0x40f5('0x38')]['filter']){_0x2a0d90[_0x40f5('0x43')]=_['merge'](_0x2a0d90['where'],{'$or':_['map'](_0x171d8f,function(_0x2ee41b){if(_0x2ee41b['type'][_0x40f5('0x45')]!==_0x40f5('0x46')){var _0x3a8e96={};_0x3a8e96[_0x2ee41b['field']]={'$like':'%'+_0x2075c5[_0x40f5('0x38')][_0x40f5('0x47')]+'%'};return _0x3a8e96;}})});}_0x2a0d90=_[_0x40f5('0x48')]({},_0x2a0d90,_0x2075c5['options']);var _0x6aee2d={'where':_0x2a0d90['where']};return db[_0x40f5('0x36')][_0x40f5('0x2b')](_0x6aee2d)['then'](function(_0x560942){_0x4af8fc[_0x40f5('0x2b')]=_0x560942;if(_0x2075c5[_0x40f5('0x38')]['includeAll']){_0x2a0d90['include']=[{'all':!![]}];}return db[_0x40f5('0x36')][_0x40f5('0x49')](_0x2a0d90);})[_0x40f5('0x30')](function(_0x16fec9){_0x4af8fc[_0x40f5('0x4a')]=_0x16fec9;return _0x4af8fc;})['then'](respondWithFilteredResult(_0x5b3458,_0x2a0d90))[_0x40f5('0x27')](handleError(_0x5b3458,null));};exports[_0x40f5('0x4b')]=function(_0x422225,_0x5a1c8f){var _0x20a71c={'raw':![],'where':{'id':_0x422225[_0x40f5('0x4c')]['id']}},_0x2ab929={};_0x2ab929[_0x40f5('0x37')]=_[_0x40f5('0x4d')](db['SugarcrmAccount'][_0x40f5('0x4e')]);_0x2ab929[_0x40f5('0x38')]=_['keys'](_0x422225[_0x40f5('0x38')]);_0x2ab929[_0x40f5('0x39')]=_[_0x40f5('0x3a')](_0x2ab929[_0x40f5('0x37')],_0x2ab929[_0x40f5('0x38')]);_0x20a71c[_0x40f5('0x3b')]=_['intersection'](_0x2ab929['model'],qs[_0x40f5('0x3c')](_0x422225['query'][_0x40f5('0x3c')]));_0x20a71c[_0x40f5('0x3b')]=_0x20a71c['attributes'][_0x40f5('0x3d')]?_0x20a71c[_0x40f5('0x3b')]:_0x2ab929[_0x40f5('0x37')];if(_0x422225['query']['includeAll']){_0x20a71c[_0x40f5('0x4f')]=[{'all':!![]}];}_0x20a71c=_[_0x40f5('0x48')]({},_0x20a71c,_0x422225['options']);return db[_0x40f5('0x36')]['find'](_0x20a71c)[_0x40f5('0x30')](handleEntityNotFound(_0x5a1c8f,null))[_0x40f5('0x30')](respondWithResult(_0x5a1c8f,null))[_0x40f5('0x27')](handleError(_0x5a1c8f,null));};exports[_0x40f5('0x50')]=function(_0x191a86,_0x26e0c3){return db[_0x40f5('0x36')][_0x40f5('0x50')](_0x191a86[_0x40f5('0x51')],{})['then'](respondWithResult(_0x26e0c3,0xc9))['catch'](handleError(_0x26e0c3,null));};exports[_0x40f5('0x52')]=function(_0x21c3ae,_0x404a2d){if(_0x21c3ae[_0x40f5('0x51')]['id']){delete _0x21c3ae[_0x40f5('0x51')]['id'];}return db[_0x40f5('0x36')][_0x40f5('0x53')]({'where':{'id':_0x21c3ae[_0x40f5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x404a2d,null))[_0x40f5('0x30')](saveUpdates(_0x21c3ae[_0x40f5('0x51')],null))[_0x40f5('0x30')](respondWithResult(_0x404a2d,null))[_0x40f5('0x27')](handleError(_0x404a2d,null));};exports['destroy']=function(_0x4352c9,_0x4c2e2c){return db[_0x40f5('0x36')][_0x40f5('0x53')]({'where':{'id':_0x4352c9[_0x40f5('0x4c')]['id']}})[_0x40f5('0x30')](handleEntityNotFound(_0x4c2e2c,null))[_0x40f5('0x30')](removeEntity(_0x4c2e2c,null))['catch'](handleError(_0x4c2e2c,null));};exports[_0x40f5('0x54')]=function(_0x1a9154,_0x3c2cff,_0x3d6cfd){var _0x531a2d={};var _0x4e46cc={};var _0x541870;var _0x55851e;return db['SugarcrmAccount'][_0x40f5('0x55')]({'where':{'id':_0x1a9154[_0x40f5('0x4c')]['id']}})[_0x40f5('0x30')](handleEntityNotFound(_0x3c2cff,null))[_0x40f5('0x30')](function(_0x41a95a){if(_0x41a95a){_0x541870=_0x41a95a;_0x4e46cc['model']=_[_0x40f5('0x4d')](db[_0x40f5('0x56')][_0x40f5('0x4e')]);_0x4e46cc[_0x40f5('0x38')]=_[_0x40f5('0x4d')](_0x1a9154[_0x40f5('0x38')]);_0x4e46cc[_0x40f5('0x39')]=_['intersection'](_0x4e46cc[_0x40f5('0x37')],_0x4e46cc[_0x40f5('0x38')]);_0x531a2d[_0x40f5('0x3b')]=_[_0x40f5('0x3a')](_0x4e46cc[_0x40f5('0x37')],qs[_0x40f5('0x3c')](_0x1a9154[_0x40f5('0x38')]['fields']));_0x531a2d[_0x40f5('0x3b')]=_0x531a2d['attributes'][_0x40f5('0x3d')]?_0x531a2d['attributes']:_0x4e46cc[_0x40f5('0x37')];_0x531a2d[_0x40f5('0x41')]=qs[_0x40f5('0x42')](_0x1a9154[_0x40f5('0x38')][_0x40f5('0x42')]);_0x531a2d[_0x40f5('0x43')]=qs[_0x40f5('0x39')](_['pick'](_0x1a9154['query'],_0x4e46cc[_0x40f5('0x39')]));if(_0x1a9154['query'][_0x40f5('0x47')]){_0x531a2d[_0x40f5('0x43')]=_['merge'](_0x531a2d[_0x40f5('0x43')],{'$or':_[_0x40f5('0x57')](_0x531a2d[_0x40f5('0x3b')],function(_0x220761){var _0x45d33b={};_0x45d33b[_0x220761]={'$like':'%'+_0x1a9154['query']['filter']+'%'};return _0x45d33b;})});}_0x531a2d=_[_0x40f5('0x48')]({},_0x531a2d,_0x1a9154[_0x40f5('0x58')]);return _0x541870[_0x40f5('0x54')](_0x531a2d);}})[_0x40f5('0x30')](function(_0x59b907){if(_0x59b907){_0x55851e=_0x59b907[_0x40f5('0x3d')];if(!_0x1a9154['query'][_0x40f5('0x3e')]('nolimit')){_0x531a2d[_0x40f5('0x40')]=qs[_0x40f5('0x40')](_0x1a9154[_0x40f5('0x38')]['limit']);_0x531a2d[_0x40f5('0x2c')]=qs[_0x40f5('0x2c')](_0x1a9154[_0x40f5('0x38')][_0x40f5('0x2c')]);}return _0x541870[_0x40f5('0x54')](_0x531a2d);}})[_0x40f5('0x30')](function(_0x14b7c2){if(_0x14b7c2){return _0x14b7c2?{'count':_0x55851e,'rows':_0x14b7c2}:null;}})[_0x40f5('0x30')](respondWithResult(_0x3c2cff,null))[_0x40f5('0x27')](handleError(_0x3c2cff,null));};exports['addConfiguration']=function(_0x546726,_0x28a88e,_0x3b2171){if(_0x546726[_0x40f5('0x51')]['id']){delete _0x546726['body']['id'];}return db['SugarcrmAccount'][_0x40f5('0x55')]({'where':{'id':_0x546726['params']['id']}})[_0x40f5('0x30')](handleEntityNotFound(_0x28a88e,null))['then'](function(_0x42f3cb){if(_0x42f3cb){_0x546726['body'][_0x40f5('0x59')]=_0x42f3cb['id'];_0x546726[_0x40f5('0x51')][_0x40f5('0x5a')]=integrations['getSubjects'](_0x546726[_0x40f5('0x51')]['channel'],_0x546726[_0x40f5('0x51')]['type']);_0x546726[_0x40f5('0x51')][_0x40f5('0x5b')]=integrations[_0x40f5('0x5c')](_0x546726[_0x40f5('0x51')][_0x40f5('0x5d')],_0x546726[_0x40f5('0x51')][_0x40f5('0x5e')]);return db['SugarcrmConfiguration'][_0x40f5('0x50')](_0x546726[_0x40f5('0x51')],{'include':[{'model':db['SugarcrmField'],'as':_0x40f5('0x5a')},{'model':db['SugarcrmField'],'as':_0x40f5('0x5b')}]});}return null;})[_0x40f5('0x30')](respondWithResult(_0x28a88e,null))['catch'](handleError(_0x28a88e,null));};exports[_0x40f5('0x5f')]=function(_0x1d9cba,_0x40d673,_0x443044){var _0x2e3602;var _0x24d954=['id',_0x40f5('0x33'),_0x40f5('0x60'),_0x40f5('0x61'),'description',_0x40f5('0x62'),_0x40f5('0x63'),_0x40f5('0x64'),_0x40f5('0x65'),_0x40f5('0x66'),_0x40f5('0x67'),_0x40f5('0x68')];return db[_0x40f5('0x36')][_0x40f5('0x55')]({'where':{'id':_0x1d9cba[_0x40f5('0x4c')]['id']},'attributes':['id','username',_0x40f5('0x69'),'remoteUri']})[_0x40f5('0x30')](handleEntityNotFound(_0x40d673,null))['then'](function(_0x2f23b6){if(_0x2f23b6){_0x2e3602=_0x2f23b6[_0x40f5('0x6a')];return rp({'method':'POST','uri':util[_0x40f5('0x6b')](_0x40f5('0x6c'),_0x2e3602,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x40f5('0x6d'),'response_type':_0x40f5('0x6d'),'rest_data':JSON[_0x40f5('0x22')]({'user_auth':{'user_name':_0x2f23b6[_0x40f5('0x6e')],'password':_0x2f23b6[_0x40f5('0x69')],'encryption':_0x40f5('0x6f')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x40f5('0x30')](function(_0x158fd3){if(_0x158fd3&&_0x158fd3[_0x40f5('0x33')]!==_0x40f5('0x70')&&_0x158fd3[_0x40f5('0x33')]!=='Password\x20Expired'){return rp({'method':_0x40f5('0x71'),'uri':util['format'](_0x40f5('0x6c'),_0x2e3602,_0x40f5('0x72')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x40f5('0x22')]({'session':_0x158fd3['id'],'module_name':_0x40f5('0x73')})}})[_0x40f5('0x30')](function(_0x3e029f){if(_0x3e029f){var _0x473998=_[_0x40f5('0x74')](_0x3e029f[_0x40f5('0x75')]);_[_0x40f5('0x76')](_0x473998,function(_0xdcdf83){return _0x24d954[_0x40f5('0x77')](_0xdcdf83[_0x40f5('0x33')]);});return{'count':_0x473998['length'],'rows':_[_0x40f5('0x57')](_0x473998,function(_0xd79031){return{'id':_0xd79031['name'],'name':_0xd79031[_0x40f5('0x78')],'custom':_['endsWith'](_0xd79031[_0x40f5('0x33')],'_c')?!![]:![],'options':_0xd79031[_0x40f5('0x58')]?_[_0x40f5('0x57')](_[_0x40f5('0x74')](_0xd79031['options']),function(_0x30748f){return{'name':_0x30748f[_0x40f5('0x79')],'value':_0x30748f[_0x40f5('0x33')]};}):[]};})};}})[_0x40f5('0x30')](respondWithResult(_0x40d673,null))['catch'](function(_0x150e08){var _0x41e78e=_0x1d9cba['query']['test']?0x1f4:_0x150e08[_0x40f5('0x7a')]||0x1f4;logger[_0x40f5('0x23')](_0x40f5('0x7b'),_0x40f5('0x5f'),_0x41e78e,JSON[_0x40f5('0x22')](_0x150e08));delete _0x150e08[_0x40f5('0x33')];if(_0x41e78e===0x191){_0x41e78e=0x190;}_0x40d673[_0x40f5('0x28')](_0x41e78e)[_0x40f5('0x34')](_0x1d9cba[_0x40f5('0x38')][_0x40f5('0x7c')]?{'message':_0x40f5('0x7d'),'statusCode':_0x150e08[_0x40f5('0x7a')]}:_0x150e08);});}else{var _0x3aea38=0x1f4;_0x40d673[_0x40f5('0x28')](_0x3aea38)[_0x40f5('0x34')]({'message':_0x40f5('0x7d'),'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 e6dc941..3be0c01 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 _0x7cb1=['../../components/integrations/configuration','exports','define','SugarcrmAccount','lodash','util','../../config/logger','api','bluebird','./intSugarcrmAccount.attributes'];(function(_0x368fc3,_0x2b7c2c){var _0x1fa4b2=function(_0x50ff8c){while(--_0x50ff8c){_0x368fc3['push'](_0x368fc3['shift']());}};_0x1fa4b2(++_0x2b7c2c);}(_0x7cb1,0x194));var _0x17cb=function(_0x1b8b56,_0x272144){_0x1b8b56=_0x1b8b56-0x0;var _0x5b7efc=_0x7cb1[_0x1b8b56];return _0x5b7efc;};'use strict';var _=require(_0x17cb('0x0'));var util=require(_0x17cb('0x1'));var logger=require(_0x17cb('0x2'))(_0x17cb('0x3'));var moment=require('moment');var BPromise=require(_0x17cb('0x4'));var rp=require('request-promise');var attributes=require(_0x17cb('0x5'));var integrations=require(_0x17cb('0x6'));module[_0x17cb('0x7')]=function(_0x35e4e9,_0x553b29){return _0x35e4e9[_0x17cb('0x8')](_0x17cb('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ea3=['request-promise','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1e7ea9,_0x37874d){var _0x309f4c=function(_0x4304b1){while(--_0x4304b1){_0x1e7ea9['push'](_0x1e7ea9['shift']());}};_0x309f4c(++_0x37874d);}(_0x5ea3,0xf7));var _0x35ea=function(_0x1bfbd9,_0x2ab718){_0x1bfbd9=_0x1bfbd9-0x0;var _0x4c54d4=_0x5ea3[_0x1bfbd9];return _0x4c54d4;};'use strict';var _=require(_0x35ea('0x0'));var util=require(_0x35ea('0x1'));var logger=require(_0x35ea('0x2'))('api');var moment=require(_0x35ea('0x3'));var BPromise=require(_0x35ea('0x4'));var rp=require(_0x35ea('0x5'));var attributes=require(_0x35ea('0x6'));var integrations=require(_0x35ea('0x7'));module[_0x35ea('0x8')]=function(_0x569e23,_0x1faf94){return _0x569e23[_0x35ea('0x9')](_0x35ea('0xa'),attributes,{'tableName':_0x35ea('0xb'),'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 214acf2..a0493f6 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 _0x67ae=['GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','include','model','then','ShowSugarcrmAccount','map','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x4b87dc,_0x65bfba){var _0x4c3b12=function(_0xf7ff85){while(--_0xf7ff85){_0x4b87dc['push'](_0x4b87dc['shift']());}};_0x4c3b12(++_0x65bfba);}(_0x67ae,0x177));var _0xe67a=function(_0x31097f,_0x282f66){_0x31097f=_0x31097f-0x0;var _0x61b14d=_0x67ae[_0x31097f];return _0x61b14d;};'use strict';var _=require(_0xe67a('0x0'));var util=require(_0xe67a('0x1'));var moment=require(_0xe67a('0x2'));var BPromise=require('bluebird');var rs=require(_0xe67a('0x3'));var fs=require('fs');var Redis=require(_0xe67a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe67a('0x5'));var logger=require(_0xe67a('0x6'))('rpc');var config=require(_0xe67a('0x7'));var jayson=require(_0xe67a('0x8'));var client=jayson[_0xe67a('0x9')][_0xe67a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53bc08,_0x1c513f,_0x55354f){return new BPromise(function(_0x570095,_0x5326ee){return client['request'](_0x53bc08,_0x55354f)['then'](function(_0x103c1a){logger[_0xe67a('0xb')](_0xe67a('0xc'),_0x1c513f,_0xe67a('0xd'));logger[_0xe67a('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1c513f,_0xe67a('0xd'),JSON[_0xe67a('0xf')](_0x103c1a));if(_0x103c1a[_0xe67a('0x10')]){if(_0x103c1a[_0xe67a('0x10')][_0xe67a('0x11')]===0x1f4){logger[_0xe67a('0x10')](_0xe67a('0xc'),_0x1c513f,_0x103c1a['error'][_0xe67a('0x12')]);return _0x5326ee(_0x103c1a['error'][_0xe67a('0x12')]);}logger[_0xe67a('0x10')](_0xe67a('0xc'),_0x1c513f,_0x103c1a[_0xe67a('0x10')][_0xe67a('0x12')]);return _0x570095(_0x103c1a['error'][_0xe67a('0x12')]);}else{logger[_0xe67a('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x1c513f,_0xe67a('0xd'));_0x570095(_0x103c1a[_0xe67a('0x13')][_0xe67a('0x12')]);}})[_0xe67a('0x14')](function(_0x335e15){logger[_0xe67a('0x10')](_0xe67a('0xc'),_0x1c513f,_0x335e15);_0x5326ee(_0x335e15);});});}exports[_0xe67a('0x15')]=function(_0x23f4b6){var _0x35d3d8=this;return new Promise(function(_0x49fe73,_0x2c8caf){return db[_0xe67a('0x16')][_0xe67a('0x17')]({'raw':_0x23f4b6[_0xe67a('0x18')]?_0x23f4b6[_0xe67a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x23f4b6[_0xe67a('0x18')]?_0x23f4b6['options'][_0xe67a('0x19')]||null:null,'attributes':_0x23f4b6[_0xe67a('0x18')]?_0x23f4b6[_0xe67a('0x18')][_0xe67a('0x1a')]||null:null,'limit':_0x23f4b6[_0xe67a('0x18')]?_0x23f4b6[_0xe67a('0x18')][_0xe67a('0x1b')]||null:null,'include':_0x23f4b6[_0xe67a('0x18')]?_0x23f4b6[_0xe67a('0x18')][_0xe67a('0x1c')]?_['map'](_0x23f4b6[_0xe67a('0x18')][_0xe67a('0x1c')],function(_0x21c444){return{'model':db[_0x21c444[_0xe67a('0x1d')]],'as':_0x21c444['as'],'attributes':_0x21c444[_0xe67a('0x1a')],'include':_0x21c444['include']?_['map'](_0x21c444[_0xe67a('0x1c')],function(_0x2a21d2){return{'model':db[_0x2a21d2[_0xe67a('0x1d')]],'as':_0x2a21d2['as'],'attributes':_0x2a21d2[_0xe67a('0x1a')],'include':_0x2a21d2[_0xe67a('0x1c')]?_['map'](_0x2a21d2[_0xe67a('0x1c')],function(_0x27f0f6){return{'model':db[_0x27f0f6[_0xe67a('0x1d')]],'as':_0x27f0f6['as'],'attributes':_0x27f0f6[_0xe67a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe67a('0x1e')](function(_0x44644d){logger[_0xe67a('0xb')]('GetSugarcrmAccount',_0x23f4b6);logger[_0xe67a('0xe')](_0xe67a('0x15'),_0x23f4b6,JSON['stringify'](_0x44644d));_0x49fe73(_0x44644d);})[_0xe67a('0x14')](function(_0x3770f5){logger['error'](_0xe67a('0x15'),_0x3770f5[_0xe67a('0x12')],_0x23f4b6);_0x2c8caf(_0x35d3d8['error'](0x1f4,_0x3770f5[_0xe67a('0x12')]));});});};exports[_0xe67a('0x1f')]=function(_0x262fae){var _0x258b90=this;return new Promise(function(_0x493b2a,_0x3076ad){return db[_0xe67a('0x16')]['find']({'raw':_0x262fae[_0xe67a('0x18')]?_0x262fae[_0xe67a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x262fae[_0xe67a('0x18')]?_0x262fae[_0xe67a('0x18')][_0xe67a('0x19')]||null:null,'attributes':_0x262fae[_0xe67a('0x18')]?_0x262fae['options']['attributes']||null:null,'include':_0x262fae[_0xe67a('0x18')]?_0x262fae['options'][_0xe67a('0x1c')]?_[_0xe67a('0x20')](_0x262fae[_0xe67a('0x18')][_0xe67a('0x1c')],function(_0x4d22ed){return{'model':db[_0x4d22ed[_0xe67a('0x1d')]],'as':_0x4d22ed['as'],'attributes':_0x4d22ed[_0xe67a('0x1a')],'include':_0x4d22ed['include']?_[_0xe67a('0x20')](_0x4d22ed['include'],function(_0x95d030){return{'model':db[_0x95d030[_0xe67a('0x1d')]],'as':_0x95d030['as'],'attributes':_0x95d030[_0xe67a('0x1a')],'include':_0x95d030[_0xe67a('0x1c')]?_[_0xe67a('0x20')](_0x95d030['include'],function(_0x39c33a){return{'model':db[_0x39c33a[_0xe67a('0x1d')]],'as':_0x39c33a['as'],'attributes':_0x39c33a[_0xe67a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe67a('0x1e')](function(_0x5deed7){logger[_0xe67a('0xb')](_0xe67a('0x1f'),_0x262fae);logger[_0xe67a('0xe')](_0xe67a('0x1f'),_0x262fae,JSON[_0xe67a('0xf')](_0x5deed7));_0x493b2a(_0x5deed7);})['catch'](function(_0x485b1d){logger[_0xe67a('0x10')](_0xe67a('0x1f'),_0x485b1d[_0xe67a('0x12')],_0x262fae);_0x3076ad(_0x258b90[_0xe67a('0x10')](0x1f4,_0x485b1d['message']));});});}; \ No newline at end of file +var _0x898b=['raw','attributes','limit','include','map','model','where','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','options'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x898b,0xb7));var _0xb898=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x898b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb898('0x0'));var util=require(_0xb898('0x1'));var moment=require(_0xb898('0x2'));var BPromise=require(_0xb898('0x3'));var rs=require(_0xb898('0x4'));var fs=require('fs');var Redis=require(_0xb898('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb898('0x6'));var logger=require(_0xb898('0x7'))('rpc');var config=require(_0xb898('0x8'));var jayson=require(_0xb898('0x9'));var client=jayson[_0xb898('0xa')][_0xb898('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x529630,_0x8e67a2,_0x4a5c34){return new BPromise(function(_0x113539,_0x52081d){return client[_0xb898('0xc')](_0x529630,_0x4a5c34)[_0xb898('0xd')](function(_0x74793f){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x8e67a2,_0xb898('0xe'));logger[_0xb898('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x8e67a2,_0xb898('0xe'),JSON[_0xb898('0x10')](_0x74793f));if(_0x74793f['error']){if(_0x74793f[_0xb898('0x11')][_0xb898('0x12')]===0x1f4){logger[_0xb898('0x11')](_0xb898('0x13'),_0x8e67a2,_0x74793f[_0xb898('0x11')][_0xb898('0x14')]);return _0x52081d(_0x74793f[_0xb898('0x11')]['message']);}logger[_0xb898('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x8e67a2,_0x74793f[_0xb898('0x11')][_0xb898('0x14')]);return _0x113539(_0x74793f[_0xb898('0x11')][_0xb898('0x14')]);}else{logger[_0xb898('0x15')](_0xb898('0x13'),_0x8e67a2,_0xb898('0xe'));_0x113539(_0x74793f[_0xb898('0x16')][_0xb898('0x14')]);}})[_0xb898('0x17')](function(_0x415e11){logger['error'](_0xb898('0x13'),_0x8e67a2,_0x415e11);_0x52081d(_0x415e11);});});}exports[_0xb898('0x18')]=function(_0xf1ee33){var _0x3020b8=this;return new Promise(function(_0x316506,_0x929f0b){return db[_0xb898('0x19')]['findAll']({'raw':_0xf1ee33[_0xb898('0x1a')]?_0xf1ee33[_0xb898('0x1a')][_0xb898('0x1b')]===undefined?!![]:![]:!![],'where':_0xf1ee33[_0xb898('0x1a')]?_0xf1ee33['options']['where']||null:null,'attributes':_0xf1ee33[_0xb898('0x1a')]?_0xf1ee33[_0xb898('0x1a')][_0xb898('0x1c')]||null:null,'limit':_0xf1ee33[_0xb898('0x1a')]?_0xf1ee33[_0xb898('0x1a')][_0xb898('0x1d')]||null:null,'include':_0xf1ee33['options']?_0xf1ee33[_0xb898('0x1a')][_0xb898('0x1e')]?_[_0xb898('0x1f')](_0xf1ee33[_0xb898('0x1a')][_0xb898('0x1e')],function(_0x2d6d4a){return{'model':db[_0x2d6d4a['model']],'as':_0x2d6d4a['as'],'attributes':_0x2d6d4a[_0xb898('0x1c')],'include':_0x2d6d4a[_0xb898('0x1e')]?_['map'](_0x2d6d4a[_0xb898('0x1e')],function(_0x4561da){return{'model':db[_0x4561da[_0xb898('0x20')]],'as':_0x4561da['as'],'attributes':_0x4561da[_0xb898('0x1c')],'include':_0x4561da[_0xb898('0x1e')]?_[_0xb898('0x1f')](_0x4561da[_0xb898('0x1e')],function(_0x22a4f0){return{'model':db[_0x22a4f0[_0xb898('0x20')]],'as':_0x22a4f0['as'],'attributes':_0x22a4f0[_0xb898('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb898('0xd')](function(_0x3c6718){logger[_0xb898('0x15')]('GetSugarcrmAccount',_0xf1ee33);logger[_0xb898('0xf')](_0xb898('0x18'),_0xf1ee33,JSON[_0xb898('0x10')](_0x3c6718));_0x316506(_0x3c6718);})[_0xb898('0x17')](function(_0x3907c1){logger[_0xb898('0x11')](_0xb898('0x18'),_0x3907c1[_0xb898('0x14')],_0xf1ee33);_0x929f0b(_0x3020b8[_0xb898('0x11')](0x1f4,_0x3907c1[_0xb898('0x14')]));});});};exports['ShowSugarcrmAccount']=function(_0x3c478f){var _0x297c34=this;return new Promise(function(_0x481f7b,_0x153380){return db[_0xb898('0x19')]['find']({'raw':_0x3c478f[_0xb898('0x1a')]?_0x3c478f[_0xb898('0x1a')][_0xb898('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c478f[_0xb898('0x1a')]?_0x3c478f[_0xb898('0x1a')][_0xb898('0x21')]||null:null,'attributes':_0x3c478f['options']?_0x3c478f[_0xb898('0x1a')][_0xb898('0x1c')]||null:null,'include':_0x3c478f['options']?_0x3c478f[_0xb898('0x1a')][_0xb898('0x1e')]?_[_0xb898('0x1f')](_0x3c478f[_0xb898('0x1a')][_0xb898('0x1e')],function(_0x3f8462){return{'model':db[_0x3f8462['model']],'as':_0x3f8462['as'],'attributes':_0x3f8462[_0xb898('0x1c')],'include':_0x3f8462[_0xb898('0x1e')]?_[_0xb898('0x1f')](_0x3f8462[_0xb898('0x1e')],function(_0x55a23f){return{'model':db[_0x55a23f[_0xb898('0x20')]],'as':_0x55a23f['as'],'attributes':_0x55a23f[_0xb898('0x1c')],'include':_0x55a23f['include']?_['map'](_0x55a23f['include'],function(_0x561b66){return{'model':db[_0x561b66[_0xb898('0x20')]],'as':_0x561b66['as'],'attributes':_0x561b66['attributes']};}):[]};}):[]};}):[]:[]})[_0xb898('0xd')](function(_0x4cadd4){logger[_0xb898('0x15')](_0xb898('0x22'),_0x3c478f);logger[_0xb898('0xf')]('ShowSugarcrmAccount',_0x3c478f,JSON['stringify'](_0x4cadd4));_0x481f7b(_0x4cadd4);})[_0xb898('0x17')](function(_0x3d3465){logger[_0xb898('0x11')](_0xb898('0x22'),_0x3d3465[_0xb898('0x14')],_0x3c478f);_0x153380(_0x297c34['error'](0x1f4,_0x3d3465['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index c63885e..537f442 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 _0xc910=['express','Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','post','create','put','update','delete','destroy','exports','util','path'];(function(_0xfab131,_0x5c01d7){var _0x5453a2=function(_0x44e1c8){while(--_0x44e1c8){_0xfab131['push'](_0xfab131['shift']());}};_0x5453a2(++_0x5c01d7);}(_0xc910,0x1e1));var _0x0c91=function(_0x5b8b14,_0x203159){_0x5b8b14=_0x5b8b14-0x0;var _0x396fe0=_0xc910[_0x5b8b14];return _0x396fe0;};'use strict';var multer=require('multer');var util=require(_0x0c91('0x0'));var path=require(_0x0c91('0x1'));var timeout=require('connect-timeout');var express=require(_0x0c91('0x2'));var router=express[_0x0c91('0x3')]();var auth=require(_0x0c91('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0c91('0x5'));var controller=require(_0x0c91('0x6'));router[_0x0c91('0x7')]('/',auth[_0x0c91('0x8')](),controller[_0x0c91('0x9')]);router[_0x0c91('0x7')](_0x0c91('0xa'),auth['isAuthenticated'](),controller[_0x0c91('0xb')]);router[_0x0c91('0x7')](_0x0c91('0xc'),auth[_0x0c91('0x8')](),controller['getFields']);router[_0x0c91('0x7')](_0x0c91('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x0c91('0x8')](),controller['getDescriptions']);router[_0x0c91('0xe')]('/',auth['isAuthenticated'](),controller[_0x0c91('0xf')]);router[_0x0c91('0x10')](_0x0c91('0xa'),auth[_0x0c91('0x8')](),controller[_0x0c91('0x11')]);router[_0x0c91('0x12')](_0x0c91('0xa'),auth[_0x0c91('0x8')](),controller[_0x0c91('0x13')]);module[_0x0c91('0x14')]=router; \ No newline at end of file +var _0xfde6=['./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x41b95a,_0x281d00){var _0x309134=function(_0x867ace){while(--_0x867ace){_0x41b95a['push'](_0x41b95a['shift']());}};_0x309134(++_0x281d00);}(_0xfde6,0x19f));var _0x6fde=function(_0x55311c,_0x4c6a2d){_0x55311c=_0x55311c-0x0;var _0x220908=_0xfde6[_0x55311c];return _0x220908;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6fde('0x0'));var express=require('express');var router=express[_0x6fde('0x1')]();var auth=require(_0x6fde('0x2'));var interaction=require(_0x6fde('0x3'));var config=require(_0x6fde('0x4'));var controller=require(_0x6fde('0x5'));router[_0x6fde('0x6')]('/',auth[_0x6fde('0x7')](),controller[_0x6fde('0x8')]);router[_0x6fde('0x6')](_0x6fde('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x6fde('0x6')](_0x6fde('0xa'),auth['isAuthenticated'](),controller[_0x6fde('0xb')]);router[_0x6fde('0x6')]('/:id/subjects',auth[_0x6fde('0x7')](),controller['getSubjects']);router[_0x6fde('0x6')](_0x6fde('0xc'),auth[_0x6fde('0x7')](),controller[_0x6fde('0xd')]);router[_0x6fde('0xe')]('/',auth[_0x6fde('0x7')](),controller[_0x6fde('0xf')]);router[_0x6fde('0x10')](_0x6fde('0x9'),auth[_0x6fde('0x7')](),controller[_0x6fde('0x11')]);router[_0x6fde('0x12')](_0x6fde('0x9'),auth[_0x6fde('0x7')](),controller[_0x6fde('0x13')]);module[_0x6fde('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 5e10f4b..b00c5d4 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 _0xb529=['STRING','exports'];(function(_0x441fae,_0x3ab2ee){var _0x189025=function(_0x4914e1){while(--_0x4914e1){_0x441fae['push'](_0x441fae['shift']());}};_0x189025(++_0x3ab2ee);}(_0xb529,0x9b));var _0x9b52=function(_0x27eca3,_0x5e9d2c){_0x27eca3=_0x27eca3-0x0;var _0x299f2a=_0xb529[_0x27eca3];return _0x299f2a;};'use strict';var Sequelize=require('sequelize');module[_0x9b52('0x0')]={'name':{'type':Sequelize[_0x9b52('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4678=['sequelize','exports','STRING'];(function(_0xfe69e2,_0x487c34){var _0x22f244=function(_0x54565f){while(--_0x54565f){_0xfe69e2['push'](_0xfe69e2['shift']());}};_0x22f244(++_0x487c34);}(_0x4678,0x96));var _0x8467=function(_0x4417ba,_0x377056){_0x4417ba=_0x4417ba-0x0;var _0x403f76=_0x4678[_0x4417ba];return _0x403f76;};'use strict';var Sequelize=require(_0x8467('0x0'));module[_0x8467('0x1')]={'name':{'type':Sequelize[_0x8467('0x2')]},'description':{'type':Sequelize[_0x8467('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index b040eca..9127a72 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 _0xef38=['limit','set','Content-Range','apply','update','then','destroy','stack','name','send','index','SugarcrmConfiguration','model','keys','query','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','getFields','findOne','hasOwnProperty','nolimit','getSubjects','SugarcrmField','getDescriptions','eml-format','zip-dir','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','offset'];(function(_0x27f0da,_0x581497){var _0x230846=function(_0x13522e){while(--_0x13522e){_0x27f0da['push'](_0x27f0da['shift']());}};_0x230846(++_0x581497);}(_0xef38,0x89));var _0x8ef3=function(_0x4a85e7,_0x15a838){_0x4a85e7=_0x4a85e7-0x0;var _0x15db96=_0xef38[_0x4a85e7];return _0x15db96;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8ef3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ef3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8ef3('0x2'));var moment=require(_0x8ef3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8ef3('0x4'));var util=require('util');var path=require(_0x8ef3('0x5'));var sox=require(_0x8ef3('0x6'));var csv=require('to-csv');var ejs=require(_0x8ef3('0x7'));var fs=require('fs');var _=require(_0x8ef3('0x8'));var squel=require(_0x8ef3('0x9'));var crypto=require(_0x8ef3('0xa'));var jsforce=require(_0x8ef3('0xb'));var deskjs=require(_0x8ef3('0xc'));var toCsv=require(_0x8ef3('0xd'));var querystring=require(_0x8ef3('0xe'));var Papa=require('papaparse');var authService=require(_0x8ef3('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x8ef3('0x10'));var qs=require(_0x8ef3('0x11'));var logger=require('../../config/logger')(_0x8ef3('0x12'));var utils=require(_0x8ef3('0x13'));var config=require(_0x8ef3('0x14'));var db=require(_0x8ef3('0x15'))['db'];var jayson=require(_0x8ef3('0x16'));var client=jayson['client'][_0x8ef3('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x268d79,_0x369280,_0x59fa05,_0x1f389d){return new BPromise(function(_0x21ae89,_0x11b776){var _0x33a293=_0x1f389d||client;return _0x33a293[_0x8ef3('0x18')](_0x268d79,_0x59fa05)['then'](function(_0x2d0e32){logger['info'](_0x8ef3('0x19'),_0x369280,_0x8ef3('0x1a'));logger[_0x8ef3('0x1b')](_0x8ef3('0x1c'),_0x369280,_0x8ef3('0x1a'),JSON[_0x8ef3('0x1d')](_0x2d0e32));if(_0x2d0e32[_0x8ef3('0x1e')]){if(_0x2d0e32['error']['code']===0x1f4){logger['error'](_0x8ef3('0x19'),_0x369280,_0x2d0e32[_0x8ef3('0x1e')][_0x8ef3('0x1f')]);return _0x11b776(_0x2d0e32['error'][_0x8ef3('0x1f')]);}logger[_0x8ef3('0x1e')](_0x8ef3('0x19'),_0x369280,_0x2d0e32[_0x8ef3('0x1e')][_0x8ef3('0x1f')]);return _0x21ae89(_0x2d0e32[_0x8ef3('0x1e')]['message']);}else{logger[_0x8ef3('0x20')](_0x8ef3('0x19'),_0x369280,_0x8ef3('0x1a'));_0x21ae89(_0x2d0e32[_0x8ef3('0x21')][_0x8ef3('0x1f')]);}})[_0x8ef3('0x22')](function(_0x3a99a5){logger['error'](_0x8ef3('0x19'),_0x369280,_0x3a99a5);_0x11b776(_0x3a99a5);});});}function respondWithStatusCode(_0x227e37,_0x5338a3){_0x5338a3=_0x5338a3||0xcc;return function(_0x12fa99){if(_0x12fa99){return _0x227e37[_0x8ef3('0x23')](_0x5338a3);}return _0x227e37[_0x8ef3('0x24')](_0x5338a3)[_0x8ef3('0x25')]();};}function respondWithResult(_0x4bc55e,_0x2ffa03){_0x2ffa03=_0x2ffa03||0xc8;return function(_0x461e88){if(_0x461e88){return _0x4bc55e[_0x8ef3('0x24')](_0x2ffa03)['json'](_0x461e88);}};}function respondWithFilteredResult(_0x568e12,_0x4e8371){return function(_0x53fa75){if(_0x53fa75){var _0x5676bc=_0x53fa75['count'],_0x369e98=_0x4e8371['offset'],_0x129717=_0x4e8371[_0x8ef3('0x26')]+_0x4e8371[_0x8ef3('0x27')],_0x10c7c4;if(_0x129717>=_0x5676bc){_0x129717=_0x5676bc;_0x10c7c4=0xc8;}else{_0x10c7c4=0xce;}_0x568e12[_0x8ef3('0x24')](_0x10c7c4);return _0x568e12[_0x8ef3('0x28')](_0x8ef3('0x29'),_0x369e98+'-'+_0x129717+'/'+_0x5676bc)['json'](_0x53fa75);}return null;};}function patchUpdates(_0xd4e71a){return function(_0x589206){try{jsonpatch[_0x8ef3('0x2a')](_0x589206,_0xd4e71a,!![]);}catch(_0x2f11f9){return BPromise['reject'](_0x2f11f9);}return _0x589206['save']();};}function saveUpdates(_0x55cd60,_0x193bc6){return function(_0x3c5178){if(_0x3c5178){return _0x3c5178[_0x8ef3('0x2b')](_0x55cd60)[_0x8ef3('0x2c')](function(_0x100f0a){return _0x100f0a;});}return null;};}function removeEntity(_0x5c5e2a,_0x8c63e){return function(_0x55cf72){if(_0x55cf72){return _0x55cf72[_0x8ef3('0x2d')]()['then'](function(){_0x5c5e2a['status'](0xcc)[_0x8ef3('0x25')]();});}};}function handleEntityNotFound(_0x3ff741,_0x57307f){return function(_0x12811a){if(!_0x12811a){_0x3ff741[_0x8ef3('0x23')](0x194);}return _0x12811a;};}function handleError(_0x2472ab,_0x3bd92c){_0x3bd92c=_0x3bd92c||0x1f4;return function(_0x356dc7){logger[_0x8ef3('0x1e')](_0x356dc7[_0x8ef3('0x2e')]);if(_0x356dc7[_0x8ef3('0x2f')]){delete _0x356dc7[_0x8ef3('0x2f')];}_0x2472ab[_0x8ef3('0x24')](_0x3bd92c)[_0x8ef3('0x30')](_0x356dc7);};}exports[_0x8ef3('0x31')]=function(_0x3c816f,_0x567948){var _0x209709={},_0x4dada0={},_0x3651dd={'count':0x0,'rows':[]};var _0x5ce3d0=db[_0x8ef3('0x32')]['rawAttributes'];_0x4dada0[_0x8ef3('0x33')]=_[_0x8ef3('0x34')](_0x5ce3d0);_0x4dada0[_0x8ef3('0x35')]=_[_0x8ef3('0x34')](_0x3c816f[_0x8ef3('0x35')]);_0x4dada0['filters']=_['intersection'](_0x4dada0[_0x8ef3('0x33')],_0x4dada0[_0x8ef3('0x35')]);_0x209709[_0x8ef3('0x36')]=_[_0x8ef3('0x37')](_0x4dada0['model'],qs[_0x8ef3('0x38')](_0x3c816f[_0x8ef3('0x35')][_0x8ef3('0x38')]));_0x209709[_0x8ef3('0x36')]=_0x209709['attributes'][_0x8ef3('0x39')]?_0x209709[_0x8ef3('0x36')]:_0x4dada0[_0x8ef3('0x33')];if(!_0x3c816f[_0x8ef3('0x35')]['hasOwnProperty']('nolimit')){_0x209709[_0x8ef3('0x27')]=qs['limit'](_0x3c816f[_0x8ef3('0x35')][_0x8ef3('0x27')]);_0x209709[_0x8ef3('0x26')]=qs['offset'](_0x3c816f['query'][_0x8ef3('0x26')]);}_0x209709[_0x8ef3('0x3a')]=qs['sort'](_0x3c816f[_0x8ef3('0x35')][_0x8ef3('0x3b')]);_0x209709[_0x8ef3('0x3c')]=qs[_0x8ef3('0x3d')](_[_0x8ef3('0x3e')](_0x3c816f['query'],_0x4dada0[_0x8ef3('0x3d')]));if(_0x3c816f['query'][_0x8ef3('0x3f')]){_0x209709[_0x8ef3('0x3c')]=_[_0x8ef3('0x40')](_0x209709[_0x8ef3('0x3c')],{'$or':_[_0x8ef3('0x41')](_0x5ce3d0,function(_0x5c63cb){if(_0x5c63cb[_0x8ef3('0x42')][_0x8ef3('0x43')]!==_0x8ef3('0x44')){var _0x28d5e9={};_0x28d5e9[_0x5c63cb['field']]={'$like':'%'+_0x3c816f[_0x8ef3('0x35')][_0x8ef3('0x3f')]+'%'};return _0x28d5e9;}})});}_0x209709=_[_0x8ef3('0x40')]({},_0x209709,_0x3c816f[_0x8ef3('0x45')]);var _0x224314={'where':_0x209709['where']};return db[_0x8ef3('0x32')][_0x8ef3('0x46')](_0x224314)[_0x8ef3('0x2c')](function(_0x31a0d5){_0x3651dd[_0x8ef3('0x46')]=_0x31a0d5;if(_0x3c816f[_0x8ef3('0x35')][_0x8ef3('0x47')]){_0x209709[_0x8ef3('0x48')]=[{'all':!![]}];}return db[_0x8ef3('0x32')][_0x8ef3('0x49')](_0x209709);})['then'](function(_0x3727a5){_0x3651dd[_0x8ef3('0x4a')]=_0x3727a5;return _0x3651dd;})['then'](respondWithFilteredResult(_0x567948,_0x209709))['catch'](handleError(_0x567948,null));};exports[_0x8ef3('0x4b')]=function(_0x410929,_0x57e980){var _0x722764={'raw':![],'where':{'id':_0x410929[_0x8ef3('0x4c')]['id']}},_0x2ba5b5={};_0x2ba5b5[_0x8ef3('0x33')]=_[_0x8ef3('0x34')](db[_0x8ef3('0x32')][_0x8ef3('0x4d')]);_0x2ba5b5[_0x8ef3('0x35')]=_['keys'](_0x410929['query']);_0x2ba5b5[_0x8ef3('0x3d')]=_['intersection'](_0x2ba5b5[_0x8ef3('0x33')],_0x2ba5b5[_0x8ef3('0x35')]);_0x722764[_0x8ef3('0x36')]=_[_0x8ef3('0x37')](_0x2ba5b5[_0x8ef3('0x33')],qs['fields'](_0x410929[_0x8ef3('0x35')][_0x8ef3('0x38')]));_0x722764['attributes']=_0x722764[_0x8ef3('0x36')]['length']?_0x722764[_0x8ef3('0x36')]:_0x2ba5b5[_0x8ef3('0x33')];if(_0x410929['query'][_0x8ef3('0x47')]){_0x722764[_0x8ef3('0x48')]=[{'all':!![]}];}_0x722764=_[_0x8ef3('0x40')]({},_0x722764,_0x410929[_0x8ef3('0x45')]);return db['SugarcrmConfiguration'][_0x8ef3('0x4e')](_0x722764)[_0x8ef3('0x2c')](handleEntityNotFound(_0x57e980,null))[_0x8ef3('0x2c')](respondWithResult(_0x57e980,null))[_0x8ef3('0x22')](handleError(_0x57e980,null));};exports[_0x8ef3('0x4f')]=function(_0x50cfbb,_0x1655a2){return db[_0x8ef3('0x32')][_0x8ef3('0x4f')](_0x50cfbb[_0x8ef3('0x50')],{})['then'](respondWithResult(_0x1655a2,0xc9))[_0x8ef3('0x22')](handleError(_0x1655a2,null));};exports[_0x8ef3('0x2b')]=function(_0x58cd8e,_0x471bd4){if(_0x58cd8e[_0x8ef3('0x50')]['id']){delete _0x58cd8e['body']['id'];}return db[_0x8ef3('0x32')][_0x8ef3('0x4e')]({'where':{'id':_0x58cd8e['params']['id']}})[_0x8ef3('0x2c')](handleEntityNotFound(_0x471bd4,null))[_0x8ef3('0x2c')](saveUpdates(_0x58cd8e['body'],null))[_0x8ef3('0x2c')](respondWithResult(_0x471bd4,null))[_0x8ef3('0x22')](handleError(_0x471bd4,null));};exports[_0x8ef3('0x2d')]=function(_0x11e2d0,_0x3adee8){return db[_0x8ef3('0x32')][_0x8ef3('0x4e')]({'where':{'id':_0x11e2d0[_0x8ef3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3adee8,null))[_0x8ef3('0x2c')](removeEntity(_0x3adee8,null))[_0x8ef3('0x22')](handleError(_0x3adee8,null));};exports[_0x8ef3('0x51')]=function(_0x21559e,_0x48a7cc,_0x14ef01){var _0x357259={};var _0x5c63b3={};var _0x21fcc4;var _0x372a6b;return db[_0x8ef3('0x32')][_0x8ef3('0x52')]({'where':{'id':_0x21559e['params']['id']}})['then'](handleEntityNotFound(_0x48a7cc,null))[_0x8ef3('0x2c')](function(_0x37704c){if(_0x37704c){_0x21fcc4=_0x37704c;_0x5c63b3['model']=_[_0x8ef3('0x34')](db['SugarcrmField'][_0x8ef3('0x4d')]);_0x5c63b3['query']=_['keys'](_0x21559e[_0x8ef3('0x35')]);_0x5c63b3[_0x8ef3('0x3d')]=_[_0x8ef3('0x37')](_0x5c63b3['model'],_0x5c63b3[_0x8ef3('0x35')]);_0x357259[_0x8ef3('0x36')]=_[_0x8ef3('0x37')](_0x5c63b3[_0x8ef3('0x33')],qs[_0x8ef3('0x38')](_0x21559e['query']['fields']));_0x357259[_0x8ef3('0x36')]=_0x357259[_0x8ef3('0x36')][_0x8ef3('0x39')]?_0x357259[_0x8ef3('0x36')]:_0x5c63b3['model'];_0x357259['order']=qs[_0x8ef3('0x3b')](_0x21559e['query'][_0x8ef3('0x3b')]);_0x357259[_0x8ef3('0x3c')]=qs[_0x8ef3('0x3d')](_[_0x8ef3('0x3e')](_0x21559e[_0x8ef3('0x35')],_0x5c63b3['filters']));if(_0x21559e[_0x8ef3('0x35')][_0x8ef3('0x3f')]){_0x357259[_0x8ef3('0x3c')]=_['merge'](_0x357259[_0x8ef3('0x3c')],{'$or':_['map'](_0x357259[_0x8ef3('0x36')],function(_0x1f6707){var _0x230415={};_0x230415[_0x1f6707]={'$like':'%'+_0x21559e['query'][_0x8ef3('0x3f')]+'%'};return _0x230415;})});}_0x357259=_[_0x8ef3('0x40')]({},_0x357259,_0x21559e[_0x8ef3('0x45')]);return _0x21fcc4['getFields'](_0x357259);}})[_0x8ef3('0x2c')](function(_0x9995a2){if(_0x9995a2){_0x372a6b=_0x9995a2['length'];if(!_0x21559e[_0x8ef3('0x35')][_0x8ef3('0x53')](_0x8ef3('0x54'))){_0x357259[_0x8ef3('0x27')]=qs['limit'](_0x21559e[_0x8ef3('0x35')][_0x8ef3('0x27')]);_0x357259[_0x8ef3('0x26')]=qs['offset'](_0x21559e[_0x8ef3('0x35')][_0x8ef3('0x26')]);}return _0x21fcc4[_0x8ef3('0x51')](_0x357259);}})['then'](function(_0x356b77){if(_0x356b77){return _0x356b77?{'count':_0x372a6b,'rows':_0x356b77}:null;}})[_0x8ef3('0x2c')](respondWithResult(_0x48a7cc,null))[_0x8ef3('0x22')](handleError(_0x48a7cc,null));};exports[_0x8ef3('0x55')]=function(_0x39b245,_0xfc6b9c,_0x3ecda6){var _0x3a1325={};var _0x5ba717={};var _0x3f8b46;var _0x217ae9;return db[_0x8ef3('0x32')][_0x8ef3('0x52')]({'where':{'id':_0x39b245[_0x8ef3('0x4c')]['id']}})['then'](handleEntityNotFound(_0xfc6b9c,null))[_0x8ef3('0x2c')](function(_0x2b6d79){if(_0x2b6d79){_0x3f8b46=_0x2b6d79;_0x5ba717[_0x8ef3('0x33')]=_['keys'](db[_0x8ef3('0x56')]['rawAttributes']);_0x5ba717[_0x8ef3('0x35')]=_['keys'](_0x39b245['query']);_0x5ba717[_0x8ef3('0x3d')]=_[_0x8ef3('0x37')](_0x5ba717[_0x8ef3('0x33')],_0x5ba717[_0x8ef3('0x35')]);_0x3a1325[_0x8ef3('0x36')]=_['intersection'](_0x5ba717[_0x8ef3('0x33')],qs[_0x8ef3('0x38')](_0x39b245[_0x8ef3('0x35')]['fields']));_0x3a1325[_0x8ef3('0x36')]=_0x3a1325['attributes'][_0x8ef3('0x39')]?_0x3a1325['attributes']:_0x5ba717[_0x8ef3('0x33')];_0x3a1325[_0x8ef3('0x3a')]=qs[_0x8ef3('0x3b')](_0x39b245['query'][_0x8ef3('0x3b')]);_0x3a1325[_0x8ef3('0x3c')]=qs[_0x8ef3('0x3d')](_[_0x8ef3('0x3e')](_0x39b245['query'],_0x5ba717[_0x8ef3('0x3d')]));if(_0x39b245['query'][_0x8ef3('0x3f')]){_0x3a1325[_0x8ef3('0x3c')]=_['merge'](_0x3a1325[_0x8ef3('0x3c')],{'$or':_[_0x8ef3('0x41')](_0x3a1325[_0x8ef3('0x36')],function(_0x241081){var _0x2b4155={};_0x2b4155[_0x241081]={'$like':'%'+_0x39b245[_0x8ef3('0x35')][_0x8ef3('0x3f')]+'%'};return _0x2b4155;})});}_0x3a1325=_[_0x8ef3('0x40')]({},_0x3a1325,_0x39b245[_0x8ef3('0x45')]);return _0x3f8b46[_0x8ef3('0x55')](_0x3a1325);}})[_0x8ef3('0x2c')](function(_0x50039a){if(_0x50039a){_0x217ae9=_0x50039a[_0x8ef3('0x39')];if(!_0x39b245[_0x8ef3('0x35')][_0x8ef3('0x53')](_0x8ef3('0x54'))){_0x3a1325[_0x8ef3('0x27')]=qs[_0x8ef3('0x27')](_0x39b245[_0x8ef3('0x35')]['limit']);_0x3a1325[_0x8ef3('0x26')]=qs['offset'](_0x39b245[_0x8ef3('0x35')]['offset']);}return _0x3f8b46[_0x8ef3('0x55')](_0x3a1325);}})[_0x8ef3('0x2c')](function(_0x42d9d4){if(_0x42d9d4){return _0x42d9d4?{'count':_0x217ae9,'rows':_0x42d9d4}:null;}})[_0x8ef3('0x2c')](respondWithResult(_0xfc6b9c,null))[_0x8ef3('0x22')](handleError(_0xfc6b9c,null));};exports['getDescriptions']=function(_0x19a3aa,_0x34a02c,_0x383847){var _0x367541={};var _0x15e205={};var _0x51d81f;var _0x36afcb;return db[_0x8ef3('0x32')]['findOne']({'where':{'id':_0x19a3aa[_0x8ef3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34a02c,null))[_0x8ef3('0x2c')](function(_0x13c0bd){if(_0x13c0bd){_0x51d81f=_0x13c0bd;_0x15e205[_0x8ef3('0x33')]=_[_0x8ef3('0x34')](db[_0x8ef3('0x56')][_0x8ef3('0x4d')]);_0x15e205[_0x8ef3('0x35')]=_[_0x8ef3('0x34')](_0x19a3aa[_0x8ef3('0x35')]);_0x15e205[_0x8ef3('0x3d')]=_[_0x8ef3('0x37')](_0x15e205['model'],_0x15e205[_0x8ef3('0x35')]);_0x367541[_0x8ef3('0x36')]=_[_0x8ef3('0x37')](_0x15e205[_0x8ef3('0x33')],qs[_0x8ef3('0x38')](_0x19a3aa[_0x8ef3('0x35')][_0x8ef3('0x38')]));_0x367541[_0x8ef3('0x36')]=_0x367541['attributes']['length']?_0x367541[_0x8ef3('0x36')]:_0x15e205[_0x8ef3('0x33')];_0x367541[_0x8ef3('0x3a')]=qs[_0x8ef3('0x3b')](_0x19a3aa[_0x8ef3('0x35')][_0x8ef3('0x3b')]);_0x367541['where']=qs[_0x8ef3('0x3d')](_['pick'](_0x19a3aa[_0x8ef3('0x35')],_0x15e205[_0x8ef3('0x3d')]));if(_0x19a3aa[_0x8ef3('0x35')][_0x8ef3('0x3f')]){_0x367541['where']=_[_0x8ef3('0x40')](_0x367541[_0x8ef3('0x3c')],{'$or':_[_0x8ef3('0x41')](_0x367541['attributes'],function(_0x4ca2b1){var _0x406d6e={};_0x406d6e[_0x4ca2b1]={'$like':'%'+_0x19a3aa[_0x8ef3('0x35')][_0x8ef3('0x3f')]+'%'};return _0x406d6e;})});}_0x367541=_['merge']({},_0x367541,_0x19a3aa[_0x8ef3('0x45')]);return _0x51d81f['getDescriptions'](_0x367541);}})[_0x8ef3('0x2c')](function(_0x1ccfa0){if(_0x1ccfa0){_0x36afcb=_0x1ccfa0['length'];if(!_0x19a3aa[_0x8ef3('0x35')][_0x8ef3('0x53')]('nolimit')){_0x367541['limit']=qs[_0x8ef3('0x27')](_0x19a3aa[_0x8ef3('0x35')][_0x8ef3('0x27')]);_0x367541['offset']=qs['offset'](_0x19a3aa[_0x8ef3('0x35')][_0x8ef3('0x26')]);}return _0x51d81f[_0x8ef3('0x57')](_0x367541);}})[_0x8ef3('0x2c')](function(_0x596ef5){if(_0x596ef5){return _0x596ef5?{'count':_0x36afcb,'rows':_0x596ef5}:null;}})['then'](respondWithResult(_0x34a02c,null))['catch'](handleError(_0x34a02c,null));}; \ No newline at end of file +var _0xf743=['../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\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','index','SugarcrmConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','include','findAll','rows','show','params','create','body','find','getFields','findOne','order','getSubjects','SugarcrmField','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xf743,0x1ba));var _0x3f74=function(_0x131604,_0x475a68){_0x131604=_0x131604-0x0;var _0x4a2aea=_0xf743[_0x131604];return _0x4a2aea;};'use strict';var pdf=require(_0x3f74('0x0'));var emlformat=require(_0x3f74('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3f74('0x2'));var jsonpatch=require(_0x3f74('0x3'));var rp=require(_0x3f74('0x4'));var moment=require('moment');var BPromise=require(_0x3f74('0x5'));var Mustache=require(_0x3f74('0x6'));var util=require(_0x3f74('0x7'));var path=require(_0x3f74('0x8'));var sox=require(_0x3f74('0x9'));var csv=require(_0x3f74('0xa'));var ejs=require(_0x3f74('0xb'));var fs=require('fs');var _=require(_0x3f74('0xc'));var squel=require(_0x3f74('0xd'));var crypto=require(_0x3f74('0xe'));var jsforce=require(_0x3f74('0xf'));var deskjs=require(_0x3f74('0x10'));var toCsv=require(_0x3f74('0xa'));var querystring=require(_0x3f74('0x11'));var Papa=require(_0x3f74('0x12'));var authService=require(_0x3f74('0x13'));var hardwareService=require(_0x3f74('0x14'));var Redis=require('ioredis');var qs=require(_0x3f74('0x15'));var logger=require(_0x3f74('0x16'))('api');var utils=require(_0x3f74('0x17'));var config=require(_0x3f74('0x18'));var db=require(_0x3f74('0x19'))['db'];var jayson=require(_0x3f74('0x1a'));var client=jayson['client'][_0x3f74('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x32936b,_0x54fc95,_0x4045b6,_0xcd6af1){return new BPromise(function(_0x3f83ae,_0x221681){var _0xdf1cc3=_0xcd6af1||client;return _0xdf1cc3[_0x3f74('0x1c')](_0x32936b,_0x4045b6)[_0x3f74('0x1d')](function(_0xb5bc73){logger[_0x3f74('0x1e')](_0x3f74('0x1f'),_0x54fc95,_0x3f74('0x20'));logger['debug'](_0x3f74('0x21'),_0x54fc95,_0x3f74('0x20'),JSON[_0x3f74('0x22')](_0xb5bc73));if(_0xb5bc73[_0x3f74('0x23')]){if(_0xb5bc73[_0x3f74('0x23')][_0x3f74('0x24')]===0x1f4){logger[_0x3f74('0x23')](_0x3f74('0x1f'),_0x54fc95,_0xb5bc73['error'][_0x3f74('0x25')]);return _0x221681(_0xb5bc73[_0x3f74('0x23')][_0x3f74('0x25')]);}logger[_0x3f74('0x23')](_0x3f74('0x1f'),_0x54fc95,_0xb5bc73[_0x3f74('0x23')][_0x3f74('0x25')]);return _0x3f83ae(_0xb5bc73[_0x3f74('0x23')]['message']);}else{logger['info'](_0x3f74('0x1f'),_0x54fc95,_0x3f74('0x20'));_0x3f83ae(_0xb5bc73[_0x3f74('0x26')]['message']);}})[_0x3f74('0x27')](function(_0x57cad3){logger[_0x3f74('0x23')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x54fc95,_0x57cad3);_0x221681(_0x57cad3);});});}function respondWithStatusCode(_0x2107f6,_0xc41d3d){_0xc41d3d=_0xc41d3d||0xcc;return function(_0x240de1){if(_0x240de1){return _0x2107f6[_0x3f74('0x28')](_0xc41d3d);}return _0x2107f6[_0x3f74('0x29')](_0xc41d3d)[_0x3f74('0x2a')]();};}function respondWithResult(_0x34d5fb,_0x27eeb3){_0x27eeb3=_0x27eeb3||0xc8;return function(_0x3b9e7a){if(_0x3b9e7a){return _0x34d5fb['status'](_0x27eeb3)[_0x3f74('0x2b')](_0x3b9e7a);}};}function respondWithFilteredResult(_0x3fa647,_0x3bea86){return function(_0x108114){if(_0x108114){var _0x391f86=_0x108114[_0x3f74('0x2c')],_0x2b9301=_0x3bea86[_0x3f74('0x2d')],_0x5cb597=_0x3bea86[_0x3f74('0x2d')]+_0x3bea86[_0x3f74('0x2e')],_0x16af69;if(_0x5cb597>=_0x391f86){_0x5cb597=_0x391f86;_0x16af69=0xc8;}else{_0x16af69=0xce;}_0x3fa647[_0x3f74('0x29')](_0x16af69);return _0x3fa647[_0x3f74('0x2f')](_0x3f74('0x30'),_0x2b9301+'-'+_0x5cb597+'/'+_0x391f86)['json'](_0x108114);}return null;};}function patchUpdates(_0x569e59){return function(_0x3c03de){try{jsonpatch[_0x3f74('0x31')](_0x3c03de,_0x569e59,!![]);}catch(_0x1ef1f2){return BPromise['reject'](_0x1ef1f2);}return _0x3c03de[_0x3f74('0x32')]();};}function saveUpdates(_0x585e7c,_0x59f5bc){return function(_0x9bc87f){if(_0x9bc87f){return _0x9bc87f[_0x3f74('0x33')](_0x585e7c)[_0x3f74('0x1d')](function(_0x2c759f){return _0x2c759f;});}return null;};}function removeEntity(_0x1a281a,_0x4bdc7f){return function(_0x41c45c){if(_0x41c45c){return _0x41c45c[_0x3f74('0x34')]()[_0x3f74('0x1d')](function(){_0x1a281a[_0x3f74('0x29')](0xcc)[_0x3f74('0x2a')]();});}};}function handleEntityNotFound(_0x576a60,_0x39a1c0){return function(_0x1373ff){if(!_0x1373ff){_0x576a60[_0x3f74('0x28')](0x194);}return _0x1373ff;};}function handleError(_0x55140c,_0x5cb8f6){_0x5cb8f6=_0x5cb8f6||0x1f4;return function(_0x385221){logger[_0x3f74('0x23')](_0x385221[_0x3f74('0x35')]);if(_0x385221[_0x3f74('0x36')]){delete _0x385221[_0x3f74('0x36')];}_0x55140c[_0x3f74('0x29')](_0x5cb8f6)['send'](_0x385221);};}exports[_0x3f74('0x37')]=function(_0x1438f6,_0x46b5c5){var _0x4f160a={},_0x563b1b={},_0x57f1c2={'count':0x0,'rows':[]};var _0x1d3c93=db[_0x3f74('0x38')][_0x3f74('0x39')];_0x563b1b[_0x3f74('0x3a')]=_[_0x3f74('0x3b')](_0x1d3c93);_0x563b1b[_0x3f74('0x3c')]=_[_0x3f74('0x3b')](_0x1438f6['query']);_0x563b1b[_0x3f74('0x3d')]=_[_0x3f74('0x3e')](_0x563b1b[_0x3f74('0x3a')],_0x563b1b[_0x3f74('0x3c')]);_0x4f160a[_0x3f74('0x3f')]=_['intersection'](_0x563b1b['model'],qs[_0x3f74('0x40')](_0x1438f6[_0x3f74('0x3c')]['fields']));_0x4f160a[_0x3f74('0x3f')]=_0x4f160a[_0x3f74('0x3f')][_0x3f74('0x41')]?_0x4f160a['attributes']:_0x563b1b['model'];if(!_0x1438f6[_0x3f74('0x3c')][_0x3f74('0x42')](_0x3f74('0x43'))){_0x4f160a[_0x3f74('0x2e')]=qs[_0x3f74('0x2e')](_0x1438f6[_0x3f74('0x3c')][_0x3f74('0x2e')]);_0x4f160a[_0x3f74('0x2d')]=qs['offset'](_0x1438f6[_0x3f74('0x3c')][_0x3f74('0x2d')]);}_0x4f160a['order']=qs[_0x3f74('0x44')](_0x1438f6[_0x3f74('0x3c')][_0x3f74('0x44')]);_0x4f160a[_0x3f74('0x45')]=qs[_0x3f74('0x3d')](_[_0x3f74('0x46')](_0x1438f6[_0x3f74('0x3c')],_0x563b1b[_0x3f74('0x3d')]));if(_0x1438f6[_0x3f74('0x3c')]['filter']){_0x4f160a[_0x3f74('0x45')]=_[_0x3f74('0x47')](_0x4f160a[_0x3f74('0x45')],{'$or':_[_0x3f74('0x48')](_0x1d3c93,function(_0xb34342){if(_0xb34342[_0x3f74('0x49')][_0x3f74('0x4a')]!==_0x3f74('0x4b')){var _0x481856={};_0x481856[_0xb34342[_0x3f74('0x4c')]]={'$like':'%'+_0x1438f6[_0x3f74('0x3c')][_0x3f74('0x4d')]+'%'};return _0x481856;}})});}_0x4f160a=_['merge']({},_0x4f160a,_0x1438f6[_0x3f74('0x4e')]);var _0x5e40cf={'where':_0x4f160a[_0x3f74('0x45')]};return db[_0x3f74('0x38')][_0x3f74('0x2c')](_0x5e40cf)['then'](function(_0x5ac01c){_0x57f1c2['count']=_0x5ac01c;if(_0x1438f6[_0x3f74('0x3c')]['includeAll']){_0x4f160a[_0x3f74('0x4f')]=[{'all':!![]}];}return db[_0x3f74('0x38')][_0x3f74('0x50')](_0x4f160a);})[_0x3f74('0x1d')](function(_0x20f28c){_0x57f1c2[_0x3f74('0x51')]=_0x20f28c;return _0x57f1c2;})[_0x3f74('0x1d')](respondWithFilteredResult(_0x46b5c5,_0x4f160a))[_0x3f74('0x27')](handleError(_0x46b5c5,null));};exports[_0x3f74('0x52')]=function(_0x28fb99,_0x11f0d4){var _0x207471={'raw':![],'where':{'id':_0x28fb99[_0x3f74('0x53')]['id']}},_0x42fe49={};_0x42fe49['model']=_[_0x3f74('0x3b')](db['SugarcrmConfiguration'][_0x3f74('0x39')]);_0x42fe49[_0x3f74('0x3c')]=_['keys'](_0x28fb99[_0x3f74('0x3c')]);_0x42fe49['filters']=_[_0x3f74('0x3e')](_0x42fe49[_0x3f74('0x3a')],_0x42fe49[_0x3f74('0x3c')]);_0x207471[_0x3f74('0x3f')]=_['intersection'](_0x42fe49[_0x3f74('0x3a')],qs[_0x3f74('0x40')](_0x28fb99[_0x3f74('0x3c')][_0x3f74('0x40')]));_0x207471[_0x3f74('0x3f')]=_0x207471[_0x3f74('0x3f')][_0x3f74('0x41')]?_0x207471[_0x3f74('0x3f')]:_0x42fe49[_0x3f74('0x3a')];if(_0x28fb99[_0x3f74('0x3c')]['includeAll']){_0x207471[_0x3f74('0x4f')]=[{'all':!![]}];}_0x207471=_[_0x3f74('0x47')]({},_0x207471,_0x28fb99['options']);return db[_0x3f74('0x38')]['find'](_0x207471)[_0x3f74('0x1d')](handleEntityNotFound(_0x11f0d4,null))[_0x3f74('0x1d')](respondWithResult(_0x11f0d4,null))['catch'](handleError(_0x11f0d4,null));};exports[_0x3f74('0x54')]=function(_0x453b87,_0x11d9b9){return db['SugarcrmConfiguration'][_0x3f74('0x54')](_0x453b87[_0x3f74('0x55')],{})[_0x3f74('0x1d')](respondWithResult(_0x11d9b9,0xc9))[_0x3f74('0x27')](handleError(_0x11d9b9,null));};exports['update']=function(_0x4de2f7,_0x171440){if(_0x4de2f7[_0x3f74('0x55')]['id']){delete _0x4de2f7['body']['id'];}return db['SugarcrmConfiguration'][_0x3f74('0x56')]({'where':{'id':_0x4de2f7['params']['id']}})['then'](handleEntityNotFound(_0x171440,null))[_0x3f74('0x1d')](saveUpdates(_0x4de2f7['body'],null))[_0x3f74('0x1d')](respondWithResult(_0x171440,null))[_0x3f74('0x27')](handleError(_0x171440,null));};exports[_0x3f74('0x34')]=function(_0xe9a635,_0x367777){return db[_0x3f74('0x38')][_0x3f74('0x56')]({'where':{'id':_0xe9a635[_0x3f74('0x53')]['id']}})[_0x3f74('0x1d')](handleEntityNotFound(_0x367777,null))['then'](removeEntity(_0x367777,null))[_0x3f74('0x27')](handleError(_0x367777,null));};exports[_0x3f74('0x57')]=function(_0x4d1870,_0x186fa5,_0x3d9bdb){var _0x1a23fa={};var _0x17f2fa={};var _0x55a977;var _0x3d62cc;return db[_0x3f74('0x38')][_0x3f74('0x58')]({'where':{'id':_0x4d1870['params']['id']}})[_0x3f74('0x1d')](handleEntityNotFound(_0x186fa5,null))[_0x3f74('0x1d')](function(_0x16a1ea){if(_0x16a1ea){_0x55a977=_0x16a1ea;_0x17f2fa[_0x3f74('0x3a')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x17f2fa[_0x3f74('0x3c')]=_['keys'](_0x4d1870[_0x3f74('0x3c')]);_0x17f2fa[_0x3f74('0x3d')]=_['intersection'](_0x17f2fa[_0x3f74('0x3a')],_0x17f2fa[_0x3f74('0x3c')]);_0x1a23fa['attributes']=_[_0x3f74('0x3e')](_0x17f2fa[_0x3f74('0x3a')],qs[_0x3f74('0x40')](_0x4d1870['query']['fields']));_0x1a23fa[_0x3f74('0x3f')]=_0x1a23fa['attributes'][_0x3f74('0x41')]?_0x1a23fa[_0x3f74('0x3f')]:_0x17f2fa[_0x3f74('0x3a')];_0x1a23fa[_0x3f74('0x59')]=qs[_0x3f74('0x44')](_0x4d1870['query'][_0x3f74('0x44')]);_0x1a23fa[_0x3f74('0x45')]=qs[_0x3f74('0x3d')](_[_0x3f74('0x46')](_0x4d1870[_0x3f74('0x3c')],_0x17f2fa['filters']));if(_0x4d1870['query'][_0x3f74('0x4d')]){_0x1a23fa['where']=_[_0x3f74('0x47')](_0x1a23fa[_0x3f74('0x45')],{'$or':_[_0x3f74('0x48')](_0x1a23fa[_0x3f74('0x3f')],function(_0x2fb07a){var _0xb6d35a={};_0xb6d35a[_0x2fb07a]={'$like':'%'+_0x4d1870[_0x3f74('0x3c')][_0x3f74('0x4d')]+'%'};return _0xb6d35a;})});}_0x1a23fa=_['merge']({},_0x1a23fa,_0x4d1870[_0x3f74('0x4e')]);return _0x55a977[_0x3f74('0x57')](_0x1a23fa);}})[_0x3f74('0x1d')](function(_0x299339){if(_0x299339){_0x3d62cc=_0x299339[_0x3f74('0x41')];if(!_0x4d1870['query'][_0x3f74('0x42')]('nolimit')){_0x1a23fa[_0x3f74('0x2e')]=qs[_0x3f74('0x2e')](_0x4d1870[_0x3f74('0x3c')][_0x3f74('0x2e')]);_0x1a23fa[_0x3f74('0x2d')]=qs[_0x3f74('0x2d')](_0x4d1870[_0x3f74('0x3c')][_0x3f74('0x2d')]);}return _0x55a977['getFields'](_0x1a23fa);}})[_0x3f74('0x1d')](function(_0x166a4b){if(_0x166a4b){return _0x166a4b?{'count':_0x3d62cc,'rows':_0x166a4b}:null;}})[_0x3f74('0x1d')](respondWithResult(_0x186fa5,null))['catch'](handleError(_0x186fa5,null));};exports[_0x3f74('0x5a')]=function(_0x637e8b,_0x490f1d,_0x103633){var _0xcadd8c={};var _0x1e902d={};var _0x517c28;var _0x165497;return db[_0x3f74('0x38')]['findOne']({'where':{'id':_0x637e8b['params']['id']}})['then'](handleEntityNotFound(_0x490f1d,null))['then'](function(_0x4f8eaf){if(_0x4f8eaf){_0x517c28=_0x4f8eaf;_0x1e902d[_0x3f74('0x3a')]=_[_0x3f74('0x3b')](db[_0x3f74('0x5b')][_0x3f74('0x39')]);_0x1e902d[_0x3f74('0x3c')]=_[_0x3f74('0x3b')](_0x637e8b['query']);_0x1e902d['filters']=_[_0x3f74('0x3e')](_0x1e902d[_0x3f74('0x3a')],_0x1e902d[_0x3f74('0x3c')]);_0xcadd8c[_0x3f74('0x3f')]=_[_0x3f74('0x3e')](_0x1e902d[_0x3f74('0x3a')],qs['fields'](_0x637e8b[_0x3f74('0x3c')][_0x3f74('0x40')]));_0xcadd8c[_0x3f74('0x3f')]=_0xcadd8c[_0x3f74('0x3f')]['length']?_0xcadd8c[_0x3f74('0x3f')]:_0x1e902d[_0x3f74('0x3a')];_0xcadd8c[_0x3f74('0x59')]=qs['sort'](_0x637e8b['query'][_0x3f74('0x44')]);_0xcadd8c[_0x3f74('0x45')]=qs[_0x3f74('0x3d')](_[_0x3f74('0x46')](_0x637e8b[_0x3f74('0x3c')],_0x1e902d[_0x3f74('0x3d')]));if(_0x637e8b[_0x3f74('0x3c')]['filter']){_0xcadd8c[_0x3f74('0x45')]=_[_0x3f74('0x47')](_0xcadd8c['where'],{'$or':_[_0x3f74('0x48')](_0xcadd8c[_0x3f74('0x3f')],function(_0xcd5035){var _0x46fa41={};_0x46fa41[_0xcd5035]={'$like':'%'+_0x637e8b[_0x3f74('0x3c')][_0x3f74('0x4d')]+'%'};return _0x46fa41;})});}_0xcadd8c=_['merge']({},_0xcadd8c,_0x637e8b[_0x3f74('0x4e')]);return _0x517c28[_0x3f74('0x5a')](_0xcadd8c);}})[_0x3f74('0x1d')](function(_0x2da1b0){if(_0x2da1b0){_0x165497=_0x2da1b0[_0x3f74('0x41')];if(!_0x637e8b[_0x3f74('0x3c')]['hasOwnProperty'](_0x3f74('0x43'))){_0xcadd8c[_0x3f74('0x2e')]=qs['limit'](_0x637e8b[_0x3f74('0x3c')][_0x3f74('0x2e')]);_0xcadd8c[_0x3f74('0x2d')]=qs[_0x3f74('0x2d')](_0x637e8b['query'][_0x3f74('0x2d')]);}return _0x517c28[_0x3f74('0x5a')](_0xcadd8c);}})[_0x3f74('0x1d')](function(_0x395507){if(_0x395507){return _0x395507?{'count':_0x165497,'rows':_0x395507}:null;}})[_0x3f74('0x1d')](respondWithResult(_0x490f1d,null))[_0x3f74('0x27')](handleError(_0x490f1d,null));};exports[_0x3f74('0x5c')]=function(_0x3c4135,_0xf90646,_0x1ff437){var _0xdd156a={};var _0x5d815c={};var _0x4b5fc7;var _0x2c20a5;return db[_0x3f74('0x38')][_0x3f74('0x58')]({'where':{'id':_0x3c4135[_0x3f74('0x53')]['id']}})[_0x3f74('0x1d')](handleEntityNotFound(_0xf90646,null))[_0x3f74('0x1d')](function(_0x25f241){if(_0x25f241){_0x4b5fc7=_0x25f241;_0x5d815c['model']=_['keys'](db[_0x3f74('0x5b')]['rawAttributes']);_0x5d815c['query']=_[_0x3f74('0x3b')](_0x3c4135['query']);_0x5d815c[_0x3f74('0x3d')]=_[_0x3f74('0x3e')](_0x5d815c[_0x3f74('0x3a')],_0x5d815c[_0x3f74('0x3c')]);_0xdd156a[_0x3f74('0x3f')]=_[_0x3f74('0x3e')](_0x5d815c[_0x3f74('0x3a')],qs['fields'](_0x3c4135[_0x3f74('0x3c')][_0x3f74('0x40')]));_0xdd156a['attributes']=_0xdd156a[_0x3f74('0x3f')][_0x3f74('0x41')]?_0xdd156a[_0x3f74('0x3f')]:_0x5d815c[_0x3f74('0x3a')];_0xdd156a[_0x3f74('0x59')]=qs[_0x3f74('0x44')](_0x3c4135[_0x3f74('0x3c')][_0x3f74('0x44')]);_0xdd156a[_0x3f74('0x45')]=qs['filters'](_[_0x3f74('0x46')](_0x3c4135[_0x3f74('0x3c')],_0x5d815c[_0x3f74('0x3d')]));if(_0x3c4135['query'][_0x3f74('0x4d')]){_0xdd156a['where']=_[_0x3f74('0x47')](_0xdd156a['where'],{'$or':_[_0x3f74('0x48')](_0xdd156a['attributes'],function(_0x3370d0){var _0x25b832={};_0x25b832[_0x3370d0]={'$like':'%'+_0x3c4135[_0x3f74('0x3c')][_0x3f74('0x4d')]+'%'};return _0x25b832;})});}_0xdd156a=_[_0x3f74('0x47')]({},_0xdd156a,_0x3c4135[_0x3f74('0x4e')]);return _0x4b5fc7[_0x3f74('0x5c')](_0xdd156a);}})['then'](function(_0x31859d){if(_0x31859d){_0x2c20a5=_0x31859d[_0x3f74('0x41')];if(!_0x3c4135[_0x3f74('0x3c')][_0x3f74('0x42')](_0x3f74('0x43'))){_0xdd156a[_0x3f74('0x2e')]=qs['limit'](_0x3c4135[_0x3f74('0x3c')]['limit']);_0xdd156a[_0x3f74('0x2d')]=qs[_0x3f74('0x2d')](_0x3c4135[_0x3f74('0x3c')][_0x3f74('0x2d')]);}return _0x4b5fc7[_0x3f74('0x5c')](_0xdd156a);}})[_0x3f74('0x1d')](function(_0x32953b){if(_0x32953b){return _0x32953b?{'count':_0x2c20a5,'rows':_0x32953b}:null;}})['then'](respondWithResult(_0xf90646,null))['catch'](handleError(_0xf90646,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index eab6734..fc09455 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 _0xd1ca=['bluebird','request-promise','./intSugarcrmConfiguration.attributes','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util'];(function(_0x21c69c,_0x1b7535){var _0x2acd03=function(_0x4c70f0){while(--_0x4c70f0){_0x21c69c['push'](_0x21c69c['shift']());}};_0x2acd03(++_0x1b7535);}(_0xd1ca,0x140));var _0xad1c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd1ca[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xad1c('0x2'));var rp=require(_0xad1c('0x3'));var attributes=require(_0xad1c('0x4'));module['exports']=function(_0x25a756,_0x4cf710){return _0x25a756['define'](_0xad1c('0x5'),attributes,{'tableName':_0xad1c('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cc7=['util','../../config/logger','api','moment','request-promise','exports','define','SugarcrmConfiguration','lodash'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0x3cc7,0x11f));var _0x73cc=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0x3cc7[_0x2ddfd9];return _0x2668f0;};'use strict';var _=require(_0x73cc('0x0'));var util=require(_0x73cc('0x1'));var logger=require(_0x73cc('0x2'))(_0x73cc('0x3'));var moment=require(_0x73cc('0x4'));var BPromise=require('bluebird');var rp=require(_0x73cc('0x5'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x73cc('0x6')]=function(_0x4d7784,_0x435e90){return _0x4d7784[_0x73cc('0x7')](_0x73cc('0x8'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index b63e07b..976cce5 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 _0xf07d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x1fc18b,_0x13d27d){var _0x16a351=function(_0x54a799){while(--_0x54a799){_0x1fc18b['push'](_0x1fc18b['shift']());}};_0x16a351(++_0x13d27d);}(_0xf07d,0xe1));var _0xdf07=function(_0x3cc7e2,_0x525b5f){_0x3cc7e2=_0x3cc7e2-0x0;var _0x1b0f21=_0xf07d[_0x3cc7e2];return _0x1b0f21;};'use strict';var _=require(_0xdf07('0x0'));var util=require(_0xdf07('0x1'));var moment=require(_0xdf07('0x2'));var BPromise=require('bluebird');var rs=require(_0xdf07('0x3'));var fs=require('fs');var Redis=require(_0xdf07('0x4'));var db=require(_0xdf07('0x5'))['db'];var utils=require(_0xdf07('0x6'));var logger=require(_0xdf07('0x7'))(_0xdf07('0x8'));var config=require(_0xdf07('0x9'));var jayson=require(_0xdf07('0xa'));var client=jayson[_0xdf07('0xb')][_0xdf07('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd4add1,_0x3b754e,_0x3d4c48){return new BPromise(function(_0x20c486,_0x3b7154){return client['request'](_0xd4add1,_0x3d4c48)[_0xdf07('0xd')](function(_0x3fd201){logger[_0xdf07('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3b754e,_0xdf07('0xf'));logger[_0xdf07('0x10')](_0xdf07('0x11'),_0x3b754e,_0xdf07('0xf'),JSON['stringify'](_0x3fd201));if(_0x3fd201[_0xdf07('0x12')]){if(_0x3fd201[_0xdf07('0x12')][_0xdf07('0x13')]===0x1f4){logger['error'](_0xdf07('0x14'),_0x3b754e,_0x3fd201['error'][_0xdf07('0x15')]);return _0x3b7154(_0x3fd201['error'][_0xdf07('0x15')]);}logger[_0xdf07('0x12')](_0xdf07('0x14'),_0x3b754e,_0x3fd201[_0xdf07('0x12')]['message']);return _0x20c486(_0x3fd201[_0xdf07('0x12')][_0xdf07('0x15')]);}else{logger[_0xdf07('0xe')](_0xdf07('0x14'),_0x3b754e,_0xdf07('0xf'));_0x20c486(_0x3fd201[_0xdf07('0x16')][_0xdf07('0x15')]);}})['catch'](function(_0x4ff939){logger[_0xdf07('0x12')](_0xdf07('0x14'),_0x3b754e,_0x4ff939);_0x3b7154(_0x4ff939);});});} \ No newline at end of file +var _0x06ce=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x55cbb8,_0x3362d1){var _0x5d0e21=function(_0x847066){while(--_0x847066){_0x55cbb8['push'](_0x55cbb8['shift']());}};_0x5d0e21(++_0x3362d1);}(_0x06ce,0xa0));var _0xe06c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x06ce[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xe06c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe06c('0x1'));var rs=require(_0xe06c('0x2'));var fs=require('fs');var Redis=require(_0xe06c('0x3'));var db=require(_0xe06c('0x4'))['db'];var utils=require(_0xe06c('0x5'));var logger=require(_0xe06c('0x6'))(_0xe06c('0x7'));var config=require(_0xe06c('0x8'));var jayson=require(_0xe06c('0x9'));var client=jayson[_0xe06c('0xa')][_0xe06c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x907539,_0x180832,_0x3b4a67){return new BPromise(function(_0x587835,_0x1e3dbd){return client[_0xe06c('0xc')](_0x907539,_0x3b4a67)[_0xe06c('0xd')](function(_0xe8b40b){logger[_0xe06c('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x180832,_0xe06c('0xf'));logger[_0xe06c('0x10')](_0xe06c('0x11'),_0x180832,_0xe06c('0xf'),JSON[_0xe06c('0x12')](_0xe8b40b));if(_0xe8b40b[_0xe06c('0x13')]){if(_0xe8b40b[_0xe06c('0x13')][_0xe06c('0x14')]===0x1f4){logger[_0xe06c('0x13')](_0xe06c('0x15'),_0x180832,_0xe8b40b[_0xe06c('0x13')]['message']);return _0x1e3dbd(_0xe8b40b['error'][_0xe06c('0x16')]);}logger[_0xe06c('0x13')](_0xe06c('0x15'),_0x180832,_0xe8b40b[_0xe06c('0x13')]['message']);return _0x587835(_0xe8b40b[_0xe06c('0x13')][_0xe06c('0x16')]);}else{logger['info'](_0xe06c('0x15'),_0x180832,'request\x20sent');_0x587835(_0xe8b40b[_0xe06c('0x17')]['message']);}})['catch'](function(_0x3ea915){logger[_0xe06c('0x13')](_0xe06c('0x15'),_0x180832,_0x3ea915);_0x1e3dbd(_0x3ea915);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index df84b9b..a3ac161 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 _0x329a=['../../components/interaction/service','./intSugarcrmField.controller','isAuthenticated','get','show','post','create','put','update','delete','/:id','destroy','util','express','Router','../../components/auth/service'];(function(_0x1ee0d2,_0x5e7b7e){var _0x54d50b=function(_0x29d94a){while(--_0x29d94a){_0x1ee0d2['push'](_0x1ee0d2['shift']());}};_0x54d50b(++_0x5e7b7e);}(_0x329a,0x12c));var _0xa329=function(_0x21219b,_0x215e1f){_0x21219b=_0x21219b-0x0;var _0x54b5ed=_0x329a[_0x21219b];return _0x54b5ed;};'use strict';var multer=require('multer');var util=require(_0xa329('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa329('0x1'));var router=express[_0xa329('0x2')]();var auth=require(_0xa329('0x3'));var interaction=require(_0xa329('0x4'));var config=require('../../config/environment');var controller=require(_0xa329('0x5'));router['get']('/',auth[_0xa329('0x6')](),controller['index']);router[_0xa329('0x7')]('/:id',auth[_0xa329('0x6')](),controller[_0xa329('0x8')]);router[_0xa329('0x9')]('/',auth[_0xa329('0x6')](),controller[_0xa329('0xa')]);router[_0xa329('0xb')]('/:id',auth[_0xa329('0x6')](),controller[_0xa329('0xc')]);router[_0xa329('0xd')](_0xa329('0xe'),auth['isAuthenticated'](),controller[_0xa329('0xf')]);module['exports']=router; \ No newline at end of file +var _0xa534=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0xa534,0x156));var _0x4a53=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa534[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x4a53('0x0'));var util=require(_0x4a53('0x1'));var path=require(_0x4a53('0x2'));var timeout=require('connect-timeout');var express=require(_0x4a53('0x3'));var router=express[_0x4a53('0x4')]();var auth=require(_0x4a53('0x5'));var interaction=require(_0x4a53('0x6'));var config=require(_0x4a53('0x7'));var controller=require(_0x4a53('0x8'));router[_0x4a53('0x9')]('/',auth[_0x4a53('0xa')](),controller[_0x4a53('0xb')]);router[_0x4a53('0x9')](_0x4a53('0xc'),auth[_0x4a53('0xa')](),controller[_0x4a53('0xd')]);router[_0x4a53('0xe')]('/',auth[_0x4a53('0xa')](),controller[_0x4a53('0xf')]);router[_0x4a53('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x4a53('0xc'),auth['isAuthenticated'](),controller[_0x4a53('0x11')]);module[_0x4a53('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 00346ee..40412c1 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 _0x6324=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','STRING'];(function(_0x3679fe,_0x216f65){var _0x97f634=function(_0x76db98){while(--_0x76db98){_0x3679fe['push'](_0x3679fe['shift']());}};_0x97f634(++_0x216f65);}(_0x6324,0x142));var _0x4632=function(_0x3aadde,_0x50f23f){_0x3aadde=_0x3aadde-0x0;var _0x21df4e=_0x6324[_0x3aadde];return _0x21df4e;};'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 _0x22fb=['string','STRING','BOOLEAN','ENUM','variable','customVariable','keyValue'];(function(_0x3b04d7,_0x24731a){var _0x21135f=function(_0x28d8dd){while(--_0x28d8dd){_0x3b04d7['push'](_0x3b04d7['shift']());}};_0x21135f(++_0x24731a);}(_0x22fb,0x192));var _0xb22f=function(_0x61d996,_0x298278){_0x61d996=_0x61d996-0x0;var _0x2fef51=_0x22fb[_0x61d996];return _0x2fef51;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb22f('0x0')]('string',_0xb22f('0x1'),_0xb22f('0x2'),_0xb22f('0x3')),'defaultValue':_0xb22f('0x4')},'content':{'type':Sequelize[_0xb22f('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb22f('0x0')](_0xb22f('0x4'),_0xb22f('0x1'),_0xb22f('0x2'))},'keyContent':{'type':Sequelize[_0xb22f('0x5')]},'idField':{'type':Sequelize[_0xb22f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb22f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb22f('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 966c3ce..bc6c8c9 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 _0xe11d=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','save','then','stack','name','send','index','SugarcrmField','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','count','includeAll','include','rows','params','rawAttributes','find','catch','create','body','update','destroy','eml-format','fast-json-patch','request-promise','moment','mustache','util','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs'];(function(_0x115e17,_0x4d2edc){var _0x9d6320=function(_0x56254f){while(--_0x56254f){_0x115e17['push'](_0x115e17['shift']());}};_0x9d6320(++_0x4d2edc);}(_0xe11d,0x78));var _0xde11=function(_0x51ebac,_0x395e4f){_0x51ebac=_0x51ebac-0x0;var _0x5a2aa1=_0xe11d[_0x51ebac];return _0x5a2aa1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xde11('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xde11('0x1'));var rp=require(_0xde11('0x2'));var moment=require(_0xde11('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xde11('0x4'));var util=require(_0xde11('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xde11('0x6'));var fs=require('fs');var _=require(_0xde11('0x7'));var squel=require(_0xde11('0x8'));var crypto=require('crypto');var jsforce=require(_0xde11('0x9'));var deskjs=require(_0xde11('0xa'));var toCsv=require(_0xde11('0xb'));var querystring=require('querystring');var Papa=require(_0xde11('0xc'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xde11('0xd'));var logger=require(_0xde11('0xe'))(_0xde11('0xf'));var utils=require(_0xde11('0x10'));var config=require(_0xde11('0x11'));var db=require(_0xde11('0x12'))['db'];function respondWithStatusCode(_0x172882,_0x43c1fc){_0x43c1fc=_0x43c1fc||0xcc;return function(_0x462cba){if(_0x462cba){return _0x172882[_0xde11('0x13')](_0x43c1fc);}return _0x172882[_0xde11('0x14')](_0x43c1fc)[_0xde11('0x15')]();};}function respondWithResult(_0x278b27,_0x3dd09e){_0x3dd09e=_0x3dd09e||0xc8;return function(_0x1daaa8){if(_0x1daaa8){return _0x278b27[_0xde11('0x14')](_0x3dd09e)[_0xde11('0x16')](_0x1daaa8);}};}function respondWithFilteredResult(_0x275dc9,_0x18d3f4){return function(_0x40a6ba){if(_0x40a6ba){var _0x48ef7e=_0x40a6ba['count'],_0x370d09=_0x18d3f4[_0xde11('0x17')],_0x4f6d83=_0x18d3f4[_0xde11('0x17')]+_0x18d3f4[_0xde11('0x18')],_0x4a602a;if(_0x4f6d83>=_0x48ef7e){_0x4f6d83=_0x48ef7e;_0x4a602a=0xc8;}else{_0x4a602a=0xce;}_0x275dc9[_0xde11('0x14')](_0x4a602a);return _0x275dc9[_0xde11('0x19')]('Content-Range',_0x370d09+'-'+_0x4f6d83+'/'+_0x48ef7e)[_0xde11('0x16')](_0x40a6ba);}return null;};}function patchUpdates(_0x349863){return function(_0x2c4d8f){try{jsonpatch[_0xde11('0x1a')](_0x2c4d8f,_0x349863,!![]);}catch(_0x2a8de0){return BPromise['reject'](_0x2a8de0);}return _0x2c4d8f[_0xde11('0x1b')]();};}function saveUpdates(_0x5989f7,_0x376c35){return function(_0x182159){if(_0x182159){return _0x182159['update'](_0x5989f7)[_0xde11('0x1c')](function(_0x3579ff){return _0x3579ff;});}return null;};}function removeEntity(_0x1dcced,_0x2c2a62){return function(_0x4add49){if(_0x4add49){return _0x4add49['destroy']()[_0xde11('0x1c')](function(){_0x1dcced[_0xde11('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ddf9c,_0xcdc1de){return function(_0x36b3f8){if(!_0x36b3f8){_0x4ddf9c[_0xde11('0x13')](0x194);}return _0x36b3f8;};}function handleError(_0x126559,_0xfe249c){_0xfe249c=_0xfe249c||0x1f4;return function(_0xbe19e8){logger['error'](_0xbe19e8[_0xde11('0x1d')]);if(_0xbe19e8[_0xde11('0x1e')]){delete _0xbe19e8[_0xde11('0x1e')];}_0x126559[_0xde11('0x14')](_0xfe249c)[_0xde11('0x1f')](_0xbe19e8);};}exports[_0xde11('0x20')]=function(_0x31c404,_0x5a57b6){var _0x1acc5a={},_0x35918d={},_0x2eee9a={'count':0x0,'rows':[]};var _0x275446=db[_0xde11('0x21')]['rawAttributes'];_0x35918d['model']=_[_0xde11('0x22')](_0x275446);_0x35918d[_0xde11('0x23')]=_[_0xde11('0x22')](_0x31c404['query']);_0x35918d[_0xde11('0x24')]=_[_0xde11('0x25')](_0x35918d['model'],_0x35918d[_0xde11('0x23')]);_0x1acc5a[_0xde11('0x26')]=_[_0xde11('0x25')](_0x35918d[_0xde11('0x27')],qs['fields'](_0x31c404[_0xde11('0x23')][_0xde11('0x28')]));_0x1acc5a[_0xde11('0x26')]=_0x1acc5a[_0xde11('0x26')][_0xde11('0x29')]?_0x1acc5a[_0xde11('0x26')]:_0x35918d[_0xde11('0x27')];if(!_0x31c404['query'][_0xde11('0x2a')](_0xde11('0x2b'))){_0x1acc5a[_0xde11('0x18')]=qs[_0xde11('0x18')](_0x31c404['query'][_0xde11('0x18')]);_0x1acc5a[_0xde11('0x17')]=qs['offset'](_0x31c404[_0xde11('0x23')]['offset']);}_0x1acc5a[_0xde11('0x2c')]=qs[_0xde11('0x2d')](_0x31c404[_0xde11('0x23')]['sort']);_0x1acc5a[_0xde11('0x2e')]=qs[_0xde11('0x24')](_[_0xde11('0x2f')](_0x31c404[_0xde11('0x23')],_0x35918d['filters']));if(_0x31c404[_0xde11('0x23')]['filter']){_0x1acc5a[_0xde11('0x2e')]=_[_0xde11('0x30')](_0x1acc5a[_0xde11('0x2e')],{'$or':_['map'](_0x275446,function(_0x422d2f){if(_0x422d2f[_0xde11('0x31')][_0xde11('0x32')]!==_0xde11('0x33')){var _0xdd35c2={};_0xdd35c2[_0x422d2f[_0xde11('0x34')]]={'$like':'%'+_0x31c404[_0xde11('0x23')][_0xde11('0x35')]+'%'};return _0xdd35c2;}})});}_0x1acc5a=_[_0xde11('0x30')]({},_0x1acc5a,_0x31c404[_0xde11('0x36')]);var _0x391730={'where':_0x1acc5a[_0xde11('0x2e')]};return db[_0xde11('0x21')]['count'](_0x391730)[_0xde11('0x1c')](function(_0x550f78){_0x2eee9a[_0xde11('0x37')]=_0x550f78;if(_0x31c404['query'][_0xde11('0x38')]){_0x1acc5a[_0xde11('0x39')]=[{'all':!![]}];}return db[_0xde11('0x21')]['findAll'](_0x1acc5a);})[_0xde11('0x1c')](function(_0x23a158){_0x2eee9a[_0xde11('0x3a')]=_0x23a158;return _0x2eee9a;})[_0xde11('0x1c')](respondWithFilteredResult(_0x5a57b6,_0x1acc5a))['catch'](handleError(_0x5a57b6,null));};exports['show']=function(_0x58e08c,_0x2055d7){var _0x58d2e8={'raw':!![],'where':{'id':_0x58e08c[_0xde11('0x3b')]['id']}},_0x2eebe6={};_0x2eebe6[_0xde11('0x27')]=_[_0xde11('0x22')](db[_0xde11('0x21')][_0xde11('0x3c')]);_0x2eebe6[_0xde11('0x23')]=_[_0xde11('0x22')](_0x58e08c[_0xde11('0x23')]);_0x2eebe6[_0xde11('0x24')]=_[_0xde11('0x25')](_0x2eebe6['model'],_0x2eebe6[_0xde11('0x23')]);_0x58d2e8[_0xde11('0x26')]=_[_0xde11('0x25')](_0x2eebe6[_0xde11('0x27')],qs[_0xde11('0x28')](_0x58e08c[_0xde11('0x23')][_0xde11('0x28')]));_0x58d2e8[_0xde11('0x26')]=_0x58d2e8['attributes']['length']?_0x58d2e8[_0xde11('0x26')]:_0x2eebe6[_0xde11('0x27')];if(_0x58e08c[_0xde11('0x23')][_0xde11('0x38')]){_0x58d2e8['include']=[{'all':!![]}];}_0x58d2e8=_[_0xde11('0x30')]({},_0x58d2e8,_0x58e08c[_0xde11('0x36')]);return db['SugarcrmField'][_0xde11('0x3d')](_0x58d2e8)['then'](handleEntityNotFound(_0x2055d7,null))[_0xde11('0x1c')](respondWithResult(_0x2055d7,null))[_0xde11('0x3e')](handleError(_0x2055d7,null));};exports[_0xde11('0x3f')]=function(_0x56763c,_0x1b82f3){return db[_0xde11('0x21')][_0xde11('0x3f')](_0x56763c[_0xde11('0x40')],{})[_0xde11('0x1c')](respondWithResult(_0x1b82f3,0xc9))['catch'](handleError(_0x1b82f3,null));};exports[_0xde11('0x41')]=function(_0x14d354,_0x2917b8){if(_0x14d354['body']['id']){delete _0x14d354[_0xde11('0x40')]['id'];}return db[_0xde11('0x21')][_0xde11('0x3d')]({'where':{'id':_0x14d354[_0xde11('0x3b')]['id']}})[_0xde11('0x1c')](handleEntityNotFound(_0x2917b8,null))[_0xde11('0x1c')](saveUpdates(_0x14d354['body'],null))['then'](respondWithResult(_0x2917b8,null))['catch'](handleError(_0x2917b8,null));};exports[_0xde11('0x42')]=function(_0x29f51a,_0x5122e2){return db[_0xde11('0x21')][_0xde11('0x3d')]({'where':{'id':_0x29f51a['params']['id']}})[_0xde11('0x1c')](handleEntityNotFound(_0x5122e2,null))[_0xde11('0x1c')](removeEntity(_0x5122e2,null))['catch'](handleError(_0x5122e2,null));}; \ No newline at end of file +var _0xc6e0=['reject','save','update','destroy','then','stack','name','send','index','SugarcrmField','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply'];(function(_0x37ef22,_0x348c92){var _0x49eeb3=function(_0x1ef837){while(--_0x1ef837){_0x37ef22['push'](_0x37ef22['shift']());}};_0x49eeb3(++_0x348c92);}(_0xc6e0,0x110));var _0x0c6e=function(_0x3510bf,_0x35ee2c){_0x3510bf=_0x3510bf-0x0;var _0x28994b=_0xc6e0[_0x3510bf];return _0x28994b;};'use strict';var pdf=require(_0x0c6e('0x0'));var emlformat=require(_0x0c6e('0x1'));var rimraf=require(_0x0c6e('0x2'));var zipdir=require(_0x0c6e('0x3'));var jsonpatch=require(_0x0c6e('0x4'));var rp=require(_0x0c6e('0x5'));var moment=require(_0x0c6e('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x0c6e('0x7'));var util=require(_0x0c6e('0x8'));var path=require(_0x0c6e('0x9'));var sox=require(_0x0c6e('0xa'));var csv=require('to-csv');var ejs=require(_0x0c6e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0c6e('0xc'));var crypto=require(_0x0c6e('0xd'));var jsforce=require(_0x0c6e('0xe'));var deskjs=require(_0x0c6e('0xf'));var toCsv=require(_0x0c6e('0x10'));var querystring=require(_0x0c6e('0x11'));var Papa=require(_0x0c6e('0x12'));var authService=require('../../components/auth/service');var hardwareService=require(_0x0c6e('0x13'));var Redis=require(_0x0c6e('0x14'));var qs=require(_0x0c6e('0x15'));var logger=require(_0x0c6e('0x16'))(_0x0c6e('0x17'));var utils=require(_0x0c6e('0x18'));var config=require(_0x0c6e('0x19'));var db=require(_0x0c6e('0x1a'))['db'];function respondWithStatusCode(_0x4d47c9,_0x5f35c4){_0x5f35c4=_0x5f35c4||0xcc;return function(_0x41e739){if(_0x41e739){return _0x4d47c9[_0x0c6e('0x1b')](_0x5f35c4);}return _0x4d47c9['status'](_0x5f35c4)[_0x0c6e('0x1c')]();};}function respondWithResult(_0x4f2084,_0x494953){_0x494953=_0x494953||0xc8;return function(_0x41ada9){if(_0x41ada9){return _0x4f2084[_0x0c6e('0x1d')](_0x494953)[_0x0c6e('0x1e')](_0x41ada9);}};}function respondWithFilteredResult(_0x189c36,_0xfe1b4e){return function(_0x2e0085){if(_0x2e0085){var _0x3f7b91=_0x2e0085[_0x0c6e('0x1f')],_0x55f11c=_0xfe1b4e['offset'],_0x3b8ba9=_0xfe1b4e[_0x0c6e('0x20')]+_0xfe1b4e['limit'],_0xf0bf67;if(_0x3b8ba9>=_0x3f7b91){_0x3b8ba9=_0x3f7b91;_0xf0bf67=0xc8;}else{_0xf0bf67=0xce;}_0x189c36[_0x0c6e('0x1d')](_0xf0bf67);return _0x189c36[_0x0c6e('0x21')](_0x0c6e('0x22'),_0x55f11c+'-'+_0x3b8ba9+'/'+_0x3f7b91)[_0x0c6e('0x1e')](_0x2e0085);}return null;};}function patchUpdates(_0x4a52e2){return function(_0x2e9799){try{jsonpatch[_0x0c6e('0x23')](_0x2e9799,_0x4a52e2,!![]);}catch(_0x127975){return BPromise[_0x0c6e('0x24')](_0x127975);}return _0x2e9799[_0x0c6e('0x25')]();};}function saveUpdates(_0x3437b0,_0x44044c){return function(_0x223ea9){if(_0x223ea9){return _0x223ea9[_0x0c6e('0x26')](_0x3437b0)['then'](function(_0x8a843b){return _0x8a843b;});}return null;};}function removeEntity(_0x3497d5,_0x10ffdc){return function(_0x1b2053){if(_0x1b2053){return _0x1b2053[_0x0c6e('0x27')]()[_0x0c6e('0x28')](function(){_0x3497d5[_0x0c6e('0x1d')](0xcc)[_0x0c6e('0x1c')]();});}};}function handleEntityNotFound(_0x353c31,_0x54f073){return function(_0x14cefc){if(!_0x14cefc){_0x353c31[_0x0c6e('0x1b')](0x194);}return _0x14cefc;};}function handleError(_0x226ed9,_0x1d97ac){_0x1d97ac=_0x1d97ac||0x1f4;return function(_0x123e0c){logger['error'](_0x123e0c[_0x0c6e('0x29')]);if(_0x123e0c[_0x0c6e('0x2a')]){delete _0x123e0c[_0x0c6e('0x2a')];}_0x226ed9[_0x0c6e('0x1d')](_0x1d97ac)[_0x0c6e('0x2b')](_0x123e0c);};}exports[_0x0c6e('0x2c')]=function(_0x27d88e,_0x197b80){var _0xe349ca={},_0x261519={},_0x50cce5={'count':0x0,'rows':[]};var _0xafb084=db[_0x0c6e('0x2d')][_0x0c6e('0x2e')];_0x261519['model']=_[_0x0c6e('0x2f')](_0xafb084);_0x261519['query']=_[_0x0c6e('0x2f')](_0x27d88e[_0x0c6e('0x30')]);_0x261519[_0x0c6e('0x31')]=_['intersection'](_0x261519[_0x0c6e('0x32')],_0x261519[_0x0c6e('0x30')]);_0xe349ca[_0x0c6e('0x33')]=_[_0x0c6e('0x34')](_0x261519['model'],qs['fields'](_0x27d88e['query'][_0x0c6e('0x35')]));_0xe349ca[_0x0c6e('0x33')]=_0xe349ca[_0x0c6e('0x33')][_0x0c6e('0x36')]?_0xe349ca['attributes']:_0x261519['model'];if(!_0x27d88e[_0x0c6e('0x30')][_0x0c6e('0x37')](_0x0c6e('0x38'))){_0xe349ca['limit']=qs[_0x0c6e('0x39')](_0x27d88e['query'][_0x0c6e('0x39')]);_0xe349ca['offset']=qs[_0x0c6e('0x20')](_0x27d88e[_0x0c6e('0x30')][_0x0c6e('0x20')]);}_0xe349ca[_0x0c6e('0x3a')]=qs[_0x0c6e('0x3b')](_0x27d88e[_0x0c6e('0x30')]['sort']);_0xe349ca[_0x0c6e('0x3c')]=qs[_0x0c6e('0x31')](_[_0x0c6e('0x3d')](_0x27d88e[_0x0c6e('0x30')],_0x261519[_0x0c6e('0x31')]));if(_0x27d88e[_0x0c6e('0x30')][_0x0c6e('0x3e')]){_0xe349ca[_0x0c6e('0x3c')]=_[_0x0c6e('0x3f')](_0xe349ca[_0x0c6e('0x3c')],{'$or':_[_0x0c6e('0x40')](_0xafb084,function(_0x2fc8f2){if(_0x2fc8f2[_0x0c6e('0x41')]['key']!==_0x0c6e('0x42')){var _0x57bd98={};_0x57bd98[_0x2fc8f2['field']]={'$like':'%'+_0x27d88e[_0x0c6e('0x30')][_0x0c6e('0x3e')]+'%'};return _0x57bd98;}})});}_0xe349ca=_[_0x0c6e('0x3f')]({},_0xe349ca,_0x27d88e[_0x0c6e('0x43')]);var _0x3dad06={'where':_0xe349ca['where']};return db[_0x0c6e('0x2d')]['count'](_0x3dad06)[_0x0c6e('0x28')](function(_0x1615c5){_0x50cce5[_0x0c6e('0x1f')]=_0x1615c5;if(_0x27d88e[_0x0c6e('0x30')][_0x0c6e('0x44')]){_0xe349ca[_0x0c6e('0x45')]=[{'all':!![]}];}return db[_0x0c6e('0x2d')][_0x0c6e('0x46')](_0xe349ca);})['then'](function(_0x3f4412){_0x50cce5['rows']=_0x3f4412;return _0x50cce5;})['then'](respondWithFilteredResult(_0x197b80,_0xe349ca))[_0x0c6e('0x47')](handleError(_0x197b80,null));};exports[_0x0c6e('0x48')]=function(_0x5984eb,_0x21b3fb){var _0x36f48b={'raw':!![],'where':{'id':_0x5984eb[_0x0c6e('0x49')]['id']}},_0x1dcb00={};_0x1dcb00['model']=_[_0x0c6e('0x2f')](db[_0x0c6e('0x2d')][_0x0c6e('0x2e')]);_0x1dcb00[_0x0c6e('0x30')]=_[_0x0c6e('0x2f')](_0x5984eb[_0x0c6e('0x30')]);_0x1dcb00['filters']=_['intersection'](_0x1dcb00[_0x0c6e('0x32')],_0x1dcb00[_0x0c6e('0x30')]);_0x36f48b['attributes']=_[_0x0c6e('0x34')](_0x1dcb00['model'],qs[_0x0c6e('0x35')](_0x5984eb['query'][_0x0c6e('0x35')]));_0x36f48b[_0x0c6e('0x33')]=_0x36f48b[_0x0c6e('0x33')][_0x0c6e('0x36')]?_0x36f48b['attributes']:_0x1dcb00[_0x0c6e('0x32')];if(_0x5984eb[_0x0c6e('0x30')][_0x0c6e('0x44')]){_0x36f48b[_0x0c6e('0x45')]=[{'all':!![]}];}_0x36f48b=_[_0x0c6e('0x3f')]({},_0x36f48b,_0x5984eb[_0x0c6e('0x43')]);return db['SugarcrmField'][_0x0c6e('0x4a')](_0x36f48b)[_0x0c6e('0x28')](handleEntityNotFound(_0x21b3fb,null))[_0x0c6e('0x28')](respondWithResult(_0x21b3fb,null))['catch'](handleError(_0x21b3fb,null));};exports[_0x0c6e('0x4b')]=function(_0x2d51ba,_0x3594df){return db[_0x0c6e('0x2d')][_0x0c6e('0x4b')](_0x2d51ba[_0x0c6e('0x4c')],{})[_0x0c6e('0x28')](respondWithResult(_0x3594df,0xc9))['catch'](handleError(_0x3594df,null));};exports[_0x0c6e('0x26')]=function(_0x2e6743,_0x1b1b66){if(_0x2e6743[_0x0c6e('0x4c')]['id']){delete _0x2e6743['body']['id'];}return db[_0x0c6e('0x2d')][_0x0c6e('0x4a')]({'where':{'id':_0x2e6743[_0x0c6e('0x49')]['id']}})[_0x0c6e('0x28')](handleEntityNotFound(_0x1b1b66,null))['then'](saveUpdates(_0x2e6743[_0x0c6e('0x4c')],null))[_0x0c6e('0x28')](respondWithResult(_0x1b1b66,null))[_0x0c6e('0x47')](handleError(_0x1b1b66,null));};exports['destroy']=function(_0x25b9cf,_0x42a40f){return db[_0x0c6e('0x2d')][_0x0c6e('0x4a')]({'where':{'id':_0x25b9cf[_0x0c6e('0x49')]['id']}})['then'](handleEntityNotFound(_0x42a40f,null))[_0x0c6e('0x28')](removeEntity(_0x42a40f,null))[_0x0c6e('0x47')](handleError(_0x42a40f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 91414fe..b315028 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 _0x4de0=['../../config/logger','api','moment','bluebird','request-promise','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','util'];(function(_0x4b54bf,_0xefb6c1){var _0x955030=function(_0x132ae9){while(--_0x132ae9){_0x4b54bf['push'](_0x4b54bf['shift']());}};_0x955030(++_0xefb6c1);}(_0x4de0,0x12b));var _0x04de=function(_0x54eecc,_0x45f07c){_0x54eecc=_0x54eecc-0x0;var _0x5f1a49=_0x4de0[_0x54eecc];return _0x5f1a49;};'use strict';var _=require('lodash');var util=require(_0x04de('0x0'));var logger=require(_0x04de('0x1'))(_0x04de('0x2'));var moment=require(_0x04de('0x3'));var BPromise=require(_0x04de('0x4'));var rp=require(_0x04de('0x5'));var attributes=require(_0x04de('0x6'));module[_0x04de('0x7')]=function(_0x42b5cd,_0x4b33a5){return _0x42b5cd['define'](_0x04de('0x8'),attributes,{'tableName':_0x04de('0x9'),'paranoid':![],'indexes':[{'name':_0x04de('0xa'),'fields':[_0x04de('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa8c8=['SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger','moment','request-promise','./intSugarcrmField.attributes','exports','define'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xa8c8,0x138));var _0x8a8c=function(_0x26fcfa,_0x5136c5){_0x26fcfa=_0x26fcfa-0x0;var _0x1429fa=_0xa8c8[_0x26fcfa];return _0x1429fa;};'use strict';var _=require(_0x8a8c('0x0'));var util=require('util');var logger=require(_0x8a8c('0x1'))('api');var moment=require(_0x8a8c('0x2'));var BPromise=require('bluebird');var rp=require(_0x8a8c('0x3'));var attributes=require(_0x8a8c('0x4'));module[_0x8a8c('0x5')]=function(_0x38ca16,_0x1cde03){return _0x38ca16[_0x8a8c('0x6')](_0x8a8c('0x7'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x8a8c('0x8'),'fields':[_0x8a8c('0x9'),_0x8a8c('0xa')],'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 6f931f1..e7461e6 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 _0x29e8=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x29e8,0xc3));var _0x829e=function(_0x1cba89,_0x5d3126){_0x1cba89=_0x1cba89-0x0;var _0x348fca=_0x29e8[_0x1cba89];return _0x348fca;};'use strict';var _=require(_0x829e('0x0'));var util=require(_0x829e('0x1'));var moment=require(_0x829e('0x2'));var BPromise=require(_0x829e('0x3'));var rs=require(_0x829e('0x4'));var fs=require('fs');var Redis=require(_0x829e('0x5'));var db=require(_0x829e('0x6'))['db'];var utils=require(_0x829e('0x7'));var logger=require(_0x829e('0x8'))('rpc');var config=require(_0x829e('0x9'));var jayson=require(_0x829e('0xa'));var client=jayson[_0x829e('0xb')][_0x829e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xaf3a6f,_0x502e4d,_0x3c4c2e){return new BPromise(function(_0x47ad73,_0x21d090){return client[_0x829e('0xd')](_0xaf3a6f,_0x3c4c2e)[_0x829e('0xe')](function(_0x119cc2){logger[_0x829e('0xf')](_0x829e('0x10'),_0x502e4d,_0x829e('0x11'));logger[_0x829e('0x12')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x502e4d,_0x829e('0x11'),JSON[_0x829e('0x13')](_0x119cc2));if(_0x119cc2['error']){if(_0x119cc2['error']['code']===0x1f4){logger[_0x829e('0x14')](_0x829e('0x10'),_0x502e4d,_0x119cc2[_0x829e('0x14')][_0x829e('0x15')]);return _0x21d090(_0x119cc2[_0x829e('0x14')][_0x829e('0x15')]);}logger[_0x829e('0x14')](_0x829e('0x10'),_0x502e4d,_0x119cc2[_0x829e('0x14')][_0x829e('0x15')]);return _0x47ad73(_0x119cc2[_0x829e('0x14')][_0x829e('0x15')]);}else{logger[_0x829e('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x502e4d,_0x829e('0x11'));_0x47ad73(_0x119cc2[_0x829e('0x16')][_0x829e('0x15')]);}})[_0x829e('0x17')](function(_0x14c911){logger[_0x829e('0x14')](_0x829e('0x10'),_0x502e4d,_0x14c911);_0x21d090(_0x14c911);});});} \ No newline at end of file +var _0xc94b=['SugarcrmField,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc94b,0x17a));var _0xbc94=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xc94b[_0x59d89e];return _0x554e93;};'use strict';var _=require(_0xbc94('0x0'));var util=require(_0xbc94('0x1'));var moment=require(_0xbc94('0x2'));var BPromise=require(_0xbc94('0x3'));var rs=require(_0xbc94('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc94('0x5'))['db'];var utils=require(_0xbc94('0x6'));var logger=require(_0xbc94('0x7'))(_0xbc94('0x8'));var config=require(_0xbc94('0x9'));var jayson=require(_0xbc94('0xa'));var client=jayson['client'][_0xbc94('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x324bd7,_0x58440e,_0x4e2536){return new BPromise(function(_0x38dc4f,_0x4d7929){return client[_0xbc94('0xc')](_0x324bd7,_0x4e2536)[_0xbc94('0xd')](function(_0x3065a7){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x58440e,'request\x20sent');logger['debug'](_0xbc94('0xe'),_0x58440e,'request\x20sent',JSON[_0xbc94('0xf')](_0x3065a7));if(_0x3065a7['error']){if(_0x3065a7[_0xbc94('0x10')][_0xbc94('0x11')]===0x1f4){logger[_0xbc94('0x10')](_0xbc94('0x12'),_0x58440e,_0x3065a7[_0xbc94('0x10')][_0xbc94('0x13')]);return _0x4d7929(_0x3065a7['error'][_0xbc94('0x13')]);}logger['error'](_0xbc94('0x12'),_0x58440e,_0x3065a7[_0xbc94('0x10')][_0xbc94('0x13')]);return _0x38dc4f(_0x3065a7[_0xbc94('0x10')][_0xbc94('0x13')]);}else{logger['info'](_0xbc94('0x12'),_0x58440e,_0xbc94('0x14'));_0x38dc4f(_0x3065a7[_0xbc94('0x15')][_0xbc94('0x13')]);}})['catch'](function(_0x3f7216){logger[_0xbc94('0x10')](_0xbc94('0x12'),_0x58440e,_0x3f7216);_0x4d7929(_0x3f7216);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 288f26c..a8ead2a 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 _0xba92=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','index','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update'];(function(_0x422d6d,_0x1809f6){var _0x2bdd94=function(_0xf20f9e){while(--_0xf20f9e){_0x422d6d['push'](_0x422d6d['shift']());}};_0x2bdd94(++_0x1809f6);}(_0xba92,0xe9));var _0x2ba9=function(_0x10da97,_0x383eec){_0x10da97=_0x10da97-0x0;var _0x4493f3=_0xba92[_0x10da97];return _0x4493f3;};'use strict';var multer=require(_0x2ba9('0x0'));var util=require(_0x2ba9('0x1'));var path=require(_0x2ba9('0x2'));var timeout=require(_0x2ba9('0x3'));var express=require(_0x2ba9('0x4'));var router=express[_0x2ba9('0x5')]();var auth=require(_0x2ba9('0x6'));var interaction=require(_0x2ba9('0x7'));var config=require('../../config/environment');var controller=require(_0x2ba9('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2ba9('0x9')]);router[_0x2ba9('0xa')](_0x2ba9('0xb'),auth[_0x2ba9('0xc')](),controller['show']);router[_0x2ba9('0xa')](_0x2ba9('0xd'),auth[_0x2ba9('0xc')](),controller[_0x2ba9('0xe')]);router[_0x2ba9('0xa')](_0x2ba9('0xf'),auth[_0x2ba9('0xc')](),controller[_0x2ba9('0x10')]);router[_0x2ba9('0x11')]('/',auth[_0x2ba9('0xc')](),controller[_0x2ba9('0x12')]);router[_0x2ba9('0x11')](_0x2ba9('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x2ba9('0xb'),auth[_0x2ba9('0xc')](),controller[_0x2ba9('0x13')]);router[_0x2ba9('0x14')]('/:id',auth[_0x2ba9('0xc')](),controller[_0x2ba9('0x15')]);module[_0x2ba9('0x16')]=router; \ No newline at end of file +var _0x6f58=['create','post','put','/:id','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','getFields'];(function(_0x1a1df6,_0x2dd467){var _0x2ce232=function(_0x2d813a){while(--_0x2d813a){_0x1a1df6['push'](_0x1a1df6['shift']());}};_0x2ce232(++_0x2dd467);}(_0x6f58,0x1e1));var _0x86f5=function(_0x1286c5,_0x479506){_0x1286c5=_0x1286c5-0x0;var _0x11b8e7=_0x6f58[_0x1286c5];return _0x11b8e7;};'use strict';var multer=require(_0x86f5('0x0'));var util=require(_0x86f5('0x1'));var path=require(_0x86f5('0x2'));var timeout=require(_0x86f5('0x3'));var express=require('express');var router=express[_0x86f5('0x4')]();var auth=require(_0x86f5('0x5'));var interaction=require(_0x86f5('0x6'));var config=require('../../config/environment');var controller=require(_0x86f5('0x7'));router[_0x86f5('0x8')]('/',auth[_0x86f5('0x9')](),controller['index']);router[_0x86f5('0x8')]('/:id',auth[_0x86f5('0x9')](),controller['show']);router[_0x86f5('0x8')](_0x86f5('0xa'),auth['isAuthenticated'](),controller[_0x86f5('0xb')]);router['get']('/:id/fields',auth[_0x86f5('0x9')](),controller[_0x86f5('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x86f5('0xd')]);router[_0x86f5('0xe')](_0x86f5('0xa'),auth[_0x86f5('0x9')](),controller['addConfiguration']);router[_0x86f5('0xf')](_0x86f5('0x10'),auth[_0x86f5('0x9')](),controller[_0x86f5('0x11')]);router['delete'](_0x86f5('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x86f5('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index ff4245e..0cb1444 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 _0xc0b5=['STRING','HelpDesk','sequelize','exports'];(function(_0x39c087,_0x521266){var _0x10fd17=function(_0x569ded){while(--_0x569ded){_0x39c087['push'](_0x39c087['shift']());}};_0x10fd17(++_0x521266);}(_0xc0b5,0xce));var _0x5c0b=function(_0xdfeda1,_0x472780){_0xdfeda1=_0xdfeda1-0x0;var _0x18d9b7=_0xc0b5[_0xdfeda1];return _0x18d9b7;};'use strict';var Sequelize=require(_0x5c0b('0x0'));module[_0x5c0b('0x1')]={'name':{'type':Sequelize[_0x5c0b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5c0b('0x2')]},'username':{'type':Sequelize[_0x5c0b('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5c0b('0x3')},'remoteUri':{'type':Sequelize[_0x5c0b('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize[_0x5c0b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa866=['exports','STRING','HelpDesk','sequelize'];(function(_0x3cc8e8,_0x389797){var _0x409c44=function(_0x219cd0){while(--_0x219cd0){_0x3cc8e8['push'](_0x3cc8e8['shift']());}};_0x409c44(++_0x389797);}(_0xa866,0xab));var _0x6a86=function(_0x217e8f,_0x508a57){_0x217e8f=_0x217e8f-0x0;var _0x4a605e=_0xa866[_0x217e8f];return _0x4a605e;};'use strict';var Sequelize=require(_0x6a86('0x0'));module[_0x6a86('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6a86('0x2')]},'username':{'type':Sequelize[_0x6a86('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6a86('0x2')],'allowNull':![],'defaultValue':_0x6a86('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6a86('0x2')]},'accessKey':{'type':Sequelize[_0x6a86('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index e896e41..744ee6b 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 _0xb234=['catch','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','destroy','end','name','send','index','VtigerAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','findAll','rows','params','includeAll','include','find','body','getConfigurations','findOne','VtigerConfiguration','map','AccountId','getSubjects','Descriptions','getDescriptions','channel','create','VtigerField','Subjects','md5','getFields','description','moduleName','serverUrl','accessKey','format','GET','getchallenge','success','login','token','describe','autogenerated','reference','owner','remove','editable','false','label','startsWith','picklistValues','value','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb234,0x13f));var _0x4b23=function(_0x5d3858,_0x10ae61){_0x5d3858=_0x5d3858-0x0;var _0x446111=_0xb234[_0x5d3858];return _0x446111;};'use strict';var pdf=require(_0x4b23('0x0'));var emlformat=require(_0x4b23('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4b23('0x2'));var jsonpatch=require(_0x4b23('0x3'));var rp=require(_0x4b23('0x4'));var moment=require(_0x4b23('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4b23('0x6'));var path=require(_0x4b23('0x7'));var sox=require('sox');var csv=require(_0x4b23('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4b23('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4b23('0xa'));var deskjs=require(_0x4b23('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4b23('0xc'));var Papa=require(_0x4b23('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x4b23('0xe'));var Redis=require('ioredis');var qs=require(_0x4b23('0xf'));var logger=require(_0x4b23('0x10'))(_0x4b23('0x11'));var utils=require(_0x4b23('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x4b23('0x13'));var client=jayson[_0x4b23('0x14')][_0x4b23('0x15')]({'port':0x232a});function respondWithRpcPromise(_0xd27698,_0x1cf4fd,_0x149e95,_0x1ec5d5){return new BPromise(function(_0x3d9d2a,_0x5c8b32){var _0x1347df=_0x1ec5d5||client;return _0x1347df['request'](_0xd27698,_0x149e95)[_0x4b23('0x16')](function(_0x260aca){logger[_0x4b23('0x17')](_0x4b23('0x18'),_0x1cf4fd,_0x4b23('0x19'));logger['debug'](_0x4b23('0x1a'),_0x1cf4fd,_0x4b23('0x19'),JSON[_0x4b23('0x1b')](_0x260aca));if(_0x260aca[_0x4b23('0x1c')]){if(_0x260aca[_0x4b23('0x1c')][_0x4b23('0x1d')]===0x1f4){logger['error'](_0x4b23('0x18'),_0x1cf4fd,_0x260aca[_0x4b23('0x1c')][_0x4b23('0x1e')]);return _0x5c8b32(_0x260aca[_0x4b23('0x1c')][_0x4b23('0x1e')]);}logger[_0x4b23('0x1c')](_0x4b23('0x18'),_0x1cf4fd,_0x260aca[_0x4b23('0x1c')]['message']);return _0x3d9d2a(_0x260aca['error'][_0x4b23('0x1e')]);}else{logger[_0x4b23('0x17')](_0x4b23('0x18'),_0x1cf4fd,_0x4b23('0x19'));_0x3d9d2a(_0x260aca[_0x4b23('0x1f')][_0x4b23('0x1e')]);}})[_0x4b23('0x20')](function(_0x38dc4d){logger[_0x4b23('0x1c')](_0x4b23('0x18'),_0x1cf4fd,_0x38dc4d);_0x5c8b32(_0x38dc4d);});});}function respondWithStatusCode(_0x55ebd1,_0x53d327){_0x53d327=_0x53d327||0xcc;return function(_0x505fd4){if(_0x505fd4){return _0x55ebd1[_0x4b23('0x21')](_0x53d327);}return _0x55ebd1[_0x4b23('0x22')](_0x53d327)['end']();};}function respondWithResult(_0x41f246,_0x125b18){_0x125b18=_0x125b18||0xc8;return function(_0x5331c2){if(_0x5331c2){return _0x41f246['status'](_0x125b18)[_0x4b23('0x23')](_0x5331c2);}};}function respondWithFilteredResult(_0xc01968,_0x2813b5){return function(_0x1b8d5e){if(_0x1b8d5e){var _0x4bf5d5=_0x1b8d5e[_0x4b23('0x24')],_0x346cb8=_0x2813b5['offset'],_0xa5e6bf=_0x2813b5[_0x4b23('0x25')]+_0x2813b5[_0x4b23('0x26')],_0x2f73bd;if(_0xa5e6bf>=_0x4bf5d5){_0xa5e6bf=_0x4bf5d5;_0x2f73bd=0xc8;}else{_0x2f73bd=0xce;}_0xc01968[_0x4b23('0x22')](_0x2f73bd);return _0xc01968['set'](_0x4b23('0x27'),_0x346cb8+'-'+_0xa5e6bf+'/'+_0x4bf5d5)[_0x4b23('0x23')](_0x1b8d5e);}return null;};}function patchUpdates(_0x5cedb4){return function(_0xfdc265){try{jsonpatch['apply'](_0xfdc265,_0x5cedb4,!![]);}catch(_0x111c91){return BPromise[_0x4b23('0x28')](_0x111c91);}return _0xfdc265[_0x4b23('0x29')]();};}function saveUpdates(_0x32a409,_0x3c5feb){return function(_0x4fbf51){if(_0x4fbf51){return _0x4fbf51[_0x4b23('0x2a')](_0x32a409)[_0x4b23('0x16')](function(_0x25872e){return _0x25872e;});}return null;};}function removeEntity(_0x180383,_0x4e60a6){return function(_0x2e6a82){if(_0x2e6a82){return _0x2e6a82[_0x4b23('0x2b')]()['then'](function(){_0x180383['status'](0xcc)[_0x4b23('0x2c')]();});}};}function handleEntityNotFound(_0x4c824e,_0x3d85a1){return function(_0x572a66){if(!_0x572a66){_0x4c824e[_0x4b23('0x21')](0x194);}return _0x572a66;};}function handleError(_0x323589,_0x3ff24f){_0x3ff24f=_0x3ff24f||0x1f4;return function(_0x301f5a){logger[_0x4b23('0x1c')](_0x301f5a['stack']);if(_0x301f5a['name']){delete _0x301f5a[_0x4b23('0x2d')];}_0x323589[_0x4b23('0x22')](_0x3ff24f)[_0x4b23('0x2e')](_0x301f5a);};}exports[_0x4b23('0x2f')]=function(_0x2ced3e,_0x480db5){var _0x3e39e2={},_0x49ef23={},_0x3667b6={'count':0x0,'rows':[]};var _0x296a36=db[_0x4b23('0x30')][_0x4b23('0x31')];_0x49ef23[_0x4b23('0x32')]=_[_0x4b23('0x33')](_0x296a36);_0x49ef23[_0x4b23('0x34')]=_[_0x4b23('0x33')](_0x2ced3e[_0x4b23('0x34')]);_0x49ef23[_0x4b23('0x35')]=_[_0x4b23('0x36')](_0x49ef23['model'],_0x49ef23[_0x4b23('0x34')]);_0x3e39e2[_0x4b23('0x37')]=_[_0x4b23('0x36')](_0x49ef23[_0x4b23('0x32')],qs[_0x4b23('0x38')](_0x2ced3e['query'][_0x4b23('0x38')]));_0x3e39e2[_0x4b23('0x37')]=_0x3e39e2[_0x4b23('0x37')][_0x4b23('0x39')]?_0x3e39e2[_0x4b23('0x37')]:_0x49ef23['model'];if(!_0x2ced3e[_0x4b23('0x34')]['hasOwnProperty'](_0x4b23('0x3a'))){_0x3e39e2[_0x4b23('0x26')]=qs['limit'](_0x2ced3e[_0x4b23('0x34')][_0x4b23('0x26')]);_0x3e39e2['offset']=qs[_0x4b23('0x25')](_0x2ced3e[_0x4b23('0x34')][_0x4b23('0x25')]);}_0x3e39e2[_0x4b23('0x3b')]=qs['sort'](_0x2ced3e[_0x4b23('0x34')][_0x4b23('0x3c')]);_0x3e39e2[_0x4b23('0x3d')]=qs[_0x4b23('0x35')](_[_0x4b23('0x3e')](_0x2ced3e[_0x4b23('0x34')],_0x49ef23[_0x4b23('0x35')]));if(_0x2ced3e[_0x4b23('0x34')][_0x4b23('0x3f')]){_0x3e39e2[_0x4b23('0x3d')]=_[_0x4b23('0x40')](_0x3e39e2[_0x4b23('0x3d')],{'$or':_['map'](_0x296a36,function(_0x5a92c4){if(_0x5a92c4[_0x4b23('0x41')][_0x4b23('0x42')]!==_0x4b23('0x43')){var _0xd2cb9b={};_0xd2cb9b[_0x5a92c4[_0x4b23('0x44')]]={'$like':'%'+_0x2ced3e[_0x4b23('0x34')][_0x4b23('0x3f')]+'%'};return _0xd2cb9b;}})});}_0x3e39e2=_['merge']({},_0x3e39e2,_0x2ced3e[_0x4b23('0x45')]);var _0x46eed9={'where':_0x3e39e2[_0x4b23('0x3d')]};return db['VtigerAccount'][_0x4b23('0x24')](_0x46eed9)['then'](function(_0x254fb5){_0x3667b6[_0x4b23('0x24')]=_0x254fb5;if(_0x2ced3e[_0x4b23('0x34')]['includeAll']){_0x3e39e2['include']=[{'all':!![]}];}return db['VtigerAccount'][_0x4b23('0x46')](_0x3e39e2);})['then'](function(_0x53cca5){_0x3667b6[_0x4b23('0x47')]=_0x53cca5;return _0x3667b6;})[_0x4b23('0x16')](respondWithFilteredResult(_0x480db5,_0x3e39e2))[_0x4b23('0x20')](handleError(_0x480db5,null));};exports['show']=function(_0x21ef22,_0x1d18a8){var _0x5e9151={'raw':![],'where':{'id':_0x21ef22[_0x4b23('0x48')]['id']}},_0x2a5d20={};_0x2a5d20[_0x4b23('0x32')]=_[_0x4b23('0x33')](db[_0x4b23('0x30')][_0x4b23('0x31')]);_0x2a5d20[_0x4b23('0x34')]=_['keys'](_0x21ef22[_0x4b23('0x34')]);_0x2a5d20[_0x4b23('0x35')]=_[_0x4b23('0x36')](_0x2a5d20[_0x4b23('0x32')],_0x2a5d20[_0x4b23('0x34')]);_0x5e9151['attributes']=_[_0x4b23('0x36')](_0x2a5d20[_0x4b23('0x32')],qs[_0x4b23('0x38')](_0x21ef22[_0x4b23('0x34')][_0x4b23('0x38')]));_0x5e9151['attributes']=_0x5e9151[_0x4b23('0x37')][_0x4b23('0x39')]?_0x5e9151[_0x4b23('0x37')]:_0x2a5d20[_0x4b23('0x32')];if(_0x21ef22['query'][_0x4b23('0x49')]){_0x5e9151[_0x4b23('0x4a')]=[{'all':!![]}];}_0x5e9151=_['merge']({},_0x5e9151,_0x21ef22['options']);return db[_0x4b23('0x30')][_0x4b23('0x4b')](_0x5e9151)[_0x4b23('0x16')](handleEntityNotFound(_0x1d18a8,null))[_0x4b23('0x16')](respondWithResult(_0x1d18a8,null))['catch'](handleError(_0x1d18a8,null));};exports['create']=function(_0x88d0cb,_0x52e1f7){return db[_0x4b23('0x30')]['create'](_0x88d0cb[_0x4b23('0x4c')],{})[_0x4b23('0x16')](respondWithResult(_0x52e1f7,0xc9))[_0x4b23('0x20')](handleError(_0x52e1f7,null));};exports[_0x4b23('0x2a')]=function(_0x30c799,_0xb72011){if(_0x30c799[_0x4b23('0x4c')]['id']){delete _0x30c799['body']['id'];}return db[_0x4b23('0x30')][_0x4b23('0x4b')]({'where':{'id':_0x30c799[_0x4b23('0x48')]['id']}})[_0x4b23('0x16')](handleEntityNotFound(_0xb72011,null))['then'](saveUpdates(_0x30c799['body'],null))[_0x4b23('0x16')](respondWithResult(_0xb72011,null))[_0x4b23('0x20')](handleError(_0xb72011,null));};exports[_0x4b23('0x2b')]=function(_0x5f128f,_0x5e2885){return db[_0x4b23('0x30')][_0x4b23('0x4b')]({'where':{'id':_0x5f128f['params']['id']}})[_0x4b23('0x16')](handleEntityNotFound(_0x5e2885,null))[_0x4b23('0x16')](removeEntity(_0x5e2885,null))['catch'](handleError(_0x5e2885,null));};exports[_0x4b23('0x4d')]=function(_0x522ec3,_0x372c01,_0x32de64){var _0x26a8da={};var _0x11e672={};var _0x4d09a4;var _0x3719c0;return db['VtigerAccount'][_0x4b23('0x4e')]({'where':{'id':_0x522ec3['params']['id']}})['then'](handleEntityNotFound(_0x372c01,null))[_0x4b23('0x16')](function(_0x55fe20){if(_0x55fe20){_0x4d09a4=_0x55fe20;_0x11e672[_0x4b23('0x32')]=_[_0x4b23('0x33')](db[_0x4b23('0x4f')][_0x4b23('0x31')]);_0x11e672[_0x4b23('0x34')]=_[_0x4b23('0x33')](_0x522ec3['query']);_0x11e672[_0x4b23('0x35')]=_[_0x4b23('0x36')](_0x11e672[_0x4b23('0x32')],_0x11e672[_0x4b23('0x34')]);_0x26a8da['attributes']=_[_0x4b23('0x36')](_0x11e672[_0x4b23('0x32')],qs[_0x4b23('0x38')](_0x522ec3[_0x4b23('0x34')][_0x4b23('0x38')]));_0x26a8da[_0x4b23('0x37')]=_0x26a8da['attributes'][_0x4b23('0x39')]?_0x26a8da[_0x4b23('0x37')]:_0x11e672[_0x4b23('0x32')];_0x26a8da[_0x4b23('0x3b')]=qs[_0x4b23('0x3c')](_0x522ec3['query'][_0x4b23('0x3c')]);_0x26a8da[_0x4b23('0x3d')]=qs['filters'](_[_0x4b23('0x3e')](_0x522ec3[_0x4b23('0x34')],_0x11e672[_0x4b23('0x35')]));if(_0x522ec3[_0x4b23('0x34')][_0x4b23('0x3f')]){_0x26a8da[_0x4b23('0x3d')]=_[_0x4b23('0x40')](_0x26a8da[_0x4b23('0x3d')],{'$or':_[_0x4b23('0x50')](_0x26a8da[_0x4b23('0x37')],function(_0x204b37){var _0x2d8f67={};_0x2d8f67[_0x204b37]={'$like':'%'+_0x522ec3[_0x4b23('0x34')][_0x4b23('0x3f')]+'%'};return _0x2d8f67;})});}_0x26a8da=_[_0x4b23('0x40')]({},_0x26a8da,_0x522ec3['options']);return _0x4d09a4[_0x4b23('0x4d')](_0x26a8da);}})[_0x4b23('0x16')](function(_0xcba92c){if(_0xcba92c){_0x3719c0=_0xcba92c[_0x4b23('0x39')];if(!_0x522ec3['query']['hasOwnProperty'](_0x4b23('0x3a'))){_0x26a8da['limit']=qs['limit'](_0x522ec3[_0x4b23('0x34')][_0x4b23('0x26')]);_0x26a8da[_0x4b23('0x25')]=qs[_0x4b23('0x25')](_0x522ec3['query'][_0x4b23('0x25')]);}return _0x4d09a4[_0x4b23('0x4d')](_0x26a8da);}})['then'](function(_0x5a5ae8){if(_0x5a5ae8){return _0x5a5ae8?{'count':_0x3719c0,'rows':_0x5a5ae8}:null;}})[_0x4b23('0x16')](respondWithResult(_0x372c01,null))['catch'](handleError(_0x372c01,null));};exports['addConfiguration']=function(_0x11c3cb,_0x3f61cf,_0x1128ca){if(_0x11c3cb[_0x4b23('0x4c')]['id']){delete _0x11c3cb[_0x4b23('0x4c')]['id'];}return db[_0x4b23('0x30')]['findOne']({'where':{'id':_0x11c3cb[_0x4b23('0x48')]['id']}})[_0x4b23('0x16')](handleEntityNotFound(_0x3f61cf,null))[_0x4b23('0x16')](function(_0x1f817f){if(_0x1f817f){_0x11c3cb['body'][_0x4b23('0x51')]=_0x1f817f['id'];_0x11c3cb[_0x4b23('0x4c')]['Subjects']=integrations[_0x4b23('0x52')](_0x11c3cb[_0x4b23('0x4c')]['channel'],_0x11c3cb[_0x4b23('0x4c')][_0x4b23('0x41')]);_0x11c3cb[_0x4b23('0x4c')][_0x4b23('0x53')]=integrations[_0x4b23('0x54')](_0x11c3cb[_0x4b23('0x4c')][_0x4b23('0x55')],_0x11c3cb[_0x4b23('0x4c')][_0x4b23('0x41')]);return db[_0x4b23('0x4f')][_0x4b23('0x56')](_0x11c3cb[_0x4b23('0x4c')],{'include':[{'model':db[_0x4b23('0x57')],'as':_0x4b23('0x58')},{'model':db[_0x4b23('0x57')],'as':'Descriptions'}]});}return null;})[_0x4b23('0x16')](respondWithResult(_0x3f61cf,null))[_0x4b23('0x20')](handleError(_0x3f61cf,null));};var md5=require(_0x4b23('0x59'));exports[_0x4b23('0x5a')]=function(_0x453b3f,_0xe10dc7,_0x35f365){var _0x53e441=null;var _0x1db416=null;var _0x17bc96=null;var _0x5d3085=null;return db[_0x4b23('0x30')][_0x4b23('0x4e')]({'where':{'id':_0x453b3f[_0x4b23('0x48')]['id']},'attributes':['id','name','username',_0x4b23('0x5b'),_0x4b23('0x5c'),'remoteUri',_0x4b23('0x5d'),_0x4b23('0x5e')]})[_0x4b23('0x16')](handleEntityNotFound(_0xe10dc7,null))['then'](function(_0x1830de){if(_0x1830de){_0x53e441=_0x1830de['username'];_0x1db416=_0x1830de[_0x4b23('0x5e')];_0x17bc96=_0x1830de[_0x4b23('0x5c')];_0x5d3085=util[_0x4b23('0x5f')]('%s/webservice.php',_0x1830de['remoteUri']);var _0x1358d9={'method':_0x4b23('0x60'),'uri':_0x5d3085,'qs':{'operation':_0x4b23('0x61'),'username':_0x1830de['username']},'json':!![]};return rp(_0x1358d9);}})[_0x4b23('0x16')](function(_0xbdab23){if(_0xbdab23[_0x4b23('0x62')]){var _0x2918ed={'method':'POST','uri':_0x5d3085,'form':{'operation':_0x4b23('0x63'),'username':_0x53e441,'accessKey':md5(_0xbdab23['result'][_0x4b23('0x64')]+_0x1db416)},'json':!![]};return rp(_0x2918ed);}})['then'](function(_0x46b9da){if(_0x46b9da[_0x4b23('0x62')]){var _0x545c08={'method':_0x4b23('0x60'),'uri':_0x5d3085,'qs':{'operation':_0x4b23('0x65'),'username':_0x53e441,'sessionName':_0x46b9da[_0x4b23('0x1f')]['sessionName'],'elementType':_0x17bc96},'json':!![]};return rp(_0x545c08);}})[_0x4b23('0x16')](function(_0x19a93b){if(_0x19a93b[_0x4b23('0x62')]){var _0x140dc8=[_0x4b23('0x66'),_0x4b23('0x67'),_0x4b23('0x68')];_[_0x4b23('0x69')](_0x19a93b[_0x4b23('0x1f')][_0x4b23('0x38')],function(_0x1126a7){return _0x140dc8['includes'](_0x1126a7[_0x4b23('0x41')][_0x4b23('0x2d')]);});_[_0x4b23('0x69')](_0x19a93b[_0x4b23('0x1f')][_0x4b23('0x38')],function(_0x3e601f){return _0x3e601f[_0x4b23('0x6a')]===_0x4b23('0x6b');});return{'count':_0x19a93b[_0x4b23('0x1f')][_0x4b23('0x38')]['length'],'rows':_[_0x4b23('0x50')](_0x19a93b[_0x4b23('0x1f')][_0x4b23('0x38')],function(_0x42e9dc){return{'id':_0x42e9dc['name'],'name':_0x42e9dc[_0x4b23('0x6c')],'custom':_[_0x4b23('0x6d')](_0x42e9dc['name'],'cf_')?!![]:![],'options':_0x42e9dc['type'][_0x4b23('0x2d')]==='picklist'&&_0x42e9dc[_0x4b23('0x41')][_0x4b23('0x6e')][_0x4b23('0x39')]>0x0?_[_0x4b23('0x50')](_0x42e9dc['type']['picklistValues'],function(_0x775848){return{'name':_0x775848[_0x4b23('0x6c')],'value':_0x775848[_0x4b23('0x6f')]};}):[]};})};}})[_0x4b23('0x16')](respondWithResult(_0xe10dc7,null))[_0x4b23('0x20')](function(_0x5dba43){console[_0x4b23('0x70')]('vTiger\x20error:\x20'+_0x5dba43);var _0x5d5749=_0x453b3f[_0x4b23('0x34')][_0x4b23('0x71')]?0x1f4:_0x5dba43[_0x4b23('0x72')]||0x1f4;logger['error'](_0x4b23('0x73'),'getFields',_0x5d5749,JSON['stringify'](_0x5dba43));delete _0x5dba43[_0x4b23('0x2d')];if(_0x5d5749===0x191){_0x5d5749=0x190;}_0xe10dc7[_0x4b23('0x22')](_0x5d5749)[_0x4b23('0x2e')](_0x453b3f[_0x4b23('0x34')][_0x4b23('0x71')]?{'message':_0x4b23('0x74'),'statusCode':_0x5dba43['statusCode']}:_0x5dba43);});}; \ No newline at end of file +var _0xe685=['statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../components/integrations/configuration','jayson/promise','client','request','then','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','status','json','count','offset','set','apply','reject','save','sendStatus','stack','name','send','index','VtigerAccount','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','show','params','options','find','create','body','update','getConfigurations','findOne','VtigerConfiguration','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerField','username','description','moduleName','remoteUri','serverUrl','accessKey','format','%s/webservice.php','getchallenge','success','token','GET','describe','sessionName','autogenerated','reference','owner','remove','result','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20'];(function(_0x36e32f,_0x239f58){var _0x987f9f=function(_0x1500e2){while(--_0x1500e2){_0x36e32f['push'](_0x36e32f['shift']());}};_0x987f9f(++_0x239f58);}(_0xe685,0x1ed));var _0x5e68=function(_0x55b020,_0x21fff9){_0x55b020=_0x55b020-0x0;var _0x2a3b0a=_0xe685[_0x55b020];return _0x2a3b0a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5e68('0x0'));var rimraf=require(_0x5e68('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e68('0x2'));var rp=require(_0x5e68('0x3'));var moment=require(_0x5e68('0x4'));var BPromise=require(_0x5e68('0x5'));var Mustache=require(_0x5e68('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5e68('0x7'));var csv=require(_0x5e68('0x8'));var ejs=require(_0x5e68('0x9'));var fs=require('fs');var _=require(_0x5e68('0xa'));var squel=require('squel');var crypto=require(_0x5e68('0xb'));var jsforce=require(_0x5e68('0xc'));var deskjs=require(_0x5e68('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x5e68('0xe'));var hardwareService=require(_0x5e68('0xf'));var Redis=require(_0x5e68('0x10'));var qs=require(_0x5e68('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x5e68('0x12'));var jayson=require(_0x5e68('0x13'));var client=jayson[_0x5e68('0x14')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f4df9,_0x2f4a3d,_0x5059b4,_0x341f98){return new BPromise(function(_0x5b3ff2,_0x183736){var _0x5dd1c1=_0x341f98||client;return _0x5dd1c1[_0x5e68('0x15')](_0x1f4df9,_0x5059b4)[_0x5e68('0x16')](function(_0x222350){logger['info'](_0x5e68('0x17'),_0x2f4a3d,'request\x20sent');logger['debug'](_0x5e68('0x18'),_0x2f4a3d,_0x5e68('0x19'),JSON[_0x5e68('0x1a')](_0x222350));if(_0x222350[_0x5e68('0x1b')]){if(_0x222350[_0x5e68('0x1b')][_0x5e68('0x1c')]===0x1f4){logger['error'](_0x5e68('0x17'),_0x2f4a3d,_0x222350[_0x5e68('0x1b')]['message']);return _0x183736(_0x222350[_0x5e68('0x1b')][_0x5e68('0x1d')]);}logger[_0x5e68('0x1b')]('VtigerAccount,\x20%s,\x20%s',_0x2f4a3d,_0x222350[_0x5e68('0x1b')][_0x5e68('0x1d')]);return _0x5b3ff2(_0x222350[_0x5e68('0x1b')][_0x5e68('0x1d')]);}else{logger[_0x5e68('0x1e')](_0x5e68('0x17'),_0x2f4a3d,_0x5e68('0x19'));_0x5b3ff2(_0x222350['result'][_0x5e68('0x1d')]);}})[_0x5e68('0x1f')](function(_0x4132c2){logger[_0x5e68('0x1b')](_0x5e68('0x17'),_0x2f4a3d,_0x4132c2);_0x183736(_0x4132c2);});});}function respondWithStatusCode(_0x41a572,_0x4ded56){_0x4ded56=_0x4ded56||0xcc;return function(_0x5bf874){if(_0x5bf874){return _0x41a572['sendStatus'](_0x4ded56);}return _0x41a572['status'](_0x4ded56)['end']();};}function respondWithResult(_0x5e8959,_0x1b4894){_0x1b4894=_0x1b4894||0xc8;return function(_0x4e597b){if(_0x4e597b){return _0x5e8959[_0x5e68('0x20')](_0x1b4894)[_0x5e68('0x21')](_0x4e597b);}};}function respondWithFilteredResult(_0x3f7888,_0x4da484){return function(_0x1847df){if(_0x1847df){var _0xb81447=_0x1847df[_0x5e68('0x22')],_0x110e8d=_0x4da484[_0x5e68('0x23')],_0x13c5b2=_0x4da484[_0x5e68('0x23')]+_0x4da484['limit'],_0x7de68c;if(_0x13c5b2>=_0xb81447){_0x13c5b2=_0xb81447;_0x7de68c=0xc8;}else{_0x7de68c=0xce;}_0x3f7888['status'](_0x7de68c);return _0x3f7888[_0x5e68('0x24')]('Content-Range',_0x110e8d+'-'+_0x13c5b2+'/'+_0xb81447)['json'](_0x1847df);}return null;};}function patchUpdates(_0x510689){return function(_0x5d22f1){try{jsonpatch[_0x5e68('0x25')](_0x5d22f1,_0x510689,!![]);}catch(_0x47b1b8){return BPromise[_0x5e68('0x26')](_0x47b1b8);}return _0x5d22f1[_0x5e68('0x27')]();};}function saveUpdates(_0xfbf5be,_0x3ed932){return function(_0x383764){if(_0x383764){return _0x383764['update'](_0xfbf5be)[_0x5e68('0x16')](function(_0x2ed303){return _0x2ed303;});}return null;};}function removeEntity(_0x32b7ec,_0x3a5828){return function(_0xa65d73){if(_0xa65d73){return _0xa65d73['destroy']()[_0x5e68('0x16')](function(){_0x32b7ec[_0x5e68('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x417f1c,_0x361b76){return function(_0x5c657e){if(!_0x5c657e){_0x417f1c[_0x5e68('0x28')](0x194);}return _0x5c657e;};}function handleError(_0x515eab,_0x57a77e){_0x57a77e=_0x57a77e||0x1f4;return function(_0x4de6c6){logger['error'](_0x4de6c6[_0x5e68('0x29')]);if(_0x4de6c6[_0x5e68('0x2a')]){delete _0x4de6c6[_0x5e68('0x2a')];}_0x515eab[_0x5e68('0x20')](_0x57a77e)[_0x5e68('0x2b')](_0x4de6c6);};}exports[_0x5e68('0x2c')]=function(_0x1542cf,_0x333b6c){var _0x32e495={},_0x3f8eae={},_0x274231={'count':0x0,'rows':[]};var _0x10e2d1=db[_0x5e68('0x2d')][_0x5e68('0x2e')];_0x3f8eae['model']=_[_0x5e68('0x2f')](_0x10e2d1);_0x3f8eae[_0x5e68('0x30')]=_[_0x5e68('0x2f')](_0x1542cf['query']);_0x3f8eae[_0x5e68('0x31')]=_[_0x5e68('0x32')](_0x3f8eae['model'],_0x3f8eae[_0x5e68('0x30')]);_0x32e495[_0x5e68('0x33')]=_[_0x5e68('0x32')](_0x3f8eae[_0x5e68('0x34')],qs['fields'](_0x1542cf['query'][_0x5e68('0x35')]));_0x32e495[_0x5e68('0x33')]=_0x32e495[_0x5e68('0x33')][_0x5e68('0x36')]?_0x32e495['attributes']:_0x3f8eae['model'];if(!_0x1542cf[_0x5e68('0x30')][_0x5e68('0x37')]('nolimit')){_0x32e495[_0x5e68('0x38')]=qs['limit'](_0x1542cf[_0x5e68('0x30')][_0x5e68('0x38')]);_0x32e495[_0x5e68('0x23')]=qs['offset'](_0x1542cf['query'][_0x5e68('0x23')]);}_0x32e495['order']=qs[_0x5e68('0x39')](_0x1542cf[_0x5e68('0x30')][_0x5e68('0x39')]);_0x32e495[_0x5e68('0x3a')]=qs[_0x5e68('0x31')](_[_0x5e68('0x3b')](_0x1542cf[_0x5e68('0x30')],_0x3f8eae[_0x5e68('0x31')]));if(_0x1542cf[_0x5e68('0x30')][_0x5e68('0x3c')]){_0x32e495[_0x5e68('0x3a')]=_[_0x5e68('0x3d')](_0x32e495['where'],{'$or':_[_0x5e68('0x3e')](_0x10e2d1,function(_0x36a957){if(_0x36a957[_0x5e68('0x3f')][_0x5e68('0x40')]!==_0x5e68('0x41')){var _0x16558d={};_0x16558d[_0x36a957[_0x5e68('0x42')]]={'$like':'%'+_0x1542cf[_0x5e68('0x30')][_0x5e68('0x3c')]+'%'};return _0x16558d;}})});}_0x32e495=_['merge']({},_0x32e495,_0x1542cf['options']);var _0x422556={'where':_0x32e495['where']};return db[_0x5e68('0x2d')][_0x5e68('0x22')](_0x422556)[_0x5e68('0x16')](function(_0xbbeedf){_0x274231[_0x5e68('0x22')]=_0xbbeedf;if(_0x1542cf[_0x5e68('0x30')][_0x5e68('0x43')]){_0x32e495[_0x5e68('0x44')]=[{'all':!![]}];}return db['VtigerAccount'][_0x5e68('0x45')](_0x32e495);})['then'](function(_0x72b87){_0x274231[_0x5e68('0x46')]=_0x72b87;return _0x274231;})[_0x5e68('0x16')](respondWithFilteredResult(_0x333b6c,_0x32e495))[_0x5e68('0x1f')](handleError(_0x333b6c,null));};exports[_0x5e68('0x47')]=function(_0x247dd3,_0x3fc981){var _0x22e42d={'raw':![],'where':{'id':_0x247dd3[_0x5e68('0x48')]['id']}},_0x5a8dcc={};_0x5a8dcc[_0x5e68('0x34')]=_[_0x5e68('0x2f')](db[_0x5e68('0x2d')][_0x5e68('0x2e')]);_0x5a8dcc[_0x5e68('0x30')]=_['keys'](_0x247dd3[_0x5e68('0x30')]);_0x5a8dcc[_0x5e68('0x31')]=_[_0x5e68('0x32')](_0x5a8dcc[_0x5e68('0x34')],_0x5a8dcc['query']);_0x22e42d[_0x5e68('0x33')]=_['intersection'](_0x5a8dcc[_0x5e68('0x34')],qs[_0x5e68('0x35')](_0x247dd3[_0x5e68('0x30')][_0x5e68('0x35')]));_0x22e42d['attributes']=_0x22e42d[_0x5e68('0x33')][_0x5e68('0x36')]?_0x22e42d[_0x5e68('0x33')]:_0x5a8dcc[_0x5e68('0x34')];if(_0x247dd3[_0x5e68('0x30')][_0x5e68('0x43')]){_0x22e42d[_0x5e68('0x44')]=[{'all':!![]}];}_0x22e42d=_['merge']({},_0x22e42d,_0x247dd3[_0x5e68('0x49')]);return db[_0x5e68('0x2d')][_0x5e68('0x4a')](_0x22e42d)[_0x5e68('0x16')](handleEntityNotFound(_0x3fc981,null))[_0x5e68('0x16')](respondWithResult(_0x3fc981,null))[_0x5e68('0x1f')](handleError(_0x3fc981,null));};exports[_0x5e68('0x4b')]=function(_0x1667a3,_0x4c5f5d){return db['VtigerAccount']['create'](_0x1667a3[_0x5e68('0x4c')],{})[_0x5e68('0x16')](respondWithResult(_0x4c5f5d,0xc9))['catch'](handleError(_0x4c5f5d,null));};exports[_0x5e68('0x4d')]=function(_0x1c6e71,_0x4bf977){if(_0x1c6e71[_0x5e68('0x4c')]['id']){delete _0x1c6e71[_0x5e68('0x4c')]['id'];}return db['VtigerAccount'][_0x5e68('0x4a')]({'where':{'id':_0x1c6e71[_0x5e68('0x48')]['id']}})[_0x5e68('0x16')](handleEntityNotFound(_0x4bf977,null))[_0x5e68('0x16')](saveUpdates(_0x1c6e71[_0x5e68('0x4c')],null))[_0x5e68('0x16')](respondWithResult(_0x4bf977,null))[_0x5e68('0x1f')](handleError(_0x4bf977,null));};exports['destroy']=function(_0xa344eb,_0x4c7ffd){return db[_0x5e68('0x2d')][_0x5e68('0x4a')]({'where':{'id':_0xa344eb[_0x5e68('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c7ffd,null))[_0x5e68('0x16')](removeEntity(_0x4c7ffd,null))['catch'](handleError(_0x4c7ffd,null));};exports[_0x5e68('0x4e')]=function(_0x198a9e,_0x64d1ad,_0x22af2c){var _0xdd8e89={};var _0x366b9b={};var _0x5c99ab;var _0x4b3599;return db[_0x5e68('0x2d')][_0x5e68('0x4f')]({'where':{'id':_0x198a9e['params']['id']}})[_0x5e68('0x16')](handleEntityNotFound(_0x64d1ad,null))[_0x5e68('0x16')](function(_0x8ec07f){if(_0x8ec07f){_0x5c99ab=_0x8ec07f;_0x366b9b[_0x5e68('0x34')]=_['keys'](db[_0x5e68('0x50')][_0x5e68('0x2e')]);_0x366b9b[_0x5e68('0x30')]=_['keys'](_0x198a9e[_0x5e68('0x30')]);_0x366b9b[_0x5e68('0x31')]=_['intersection'](_0x366b9b[_0x5e68('0x34')],_0x366b9b[_0x5e68('0x30')]);_0xdd8e89[_0x5e68('0x33')]=_[_0x5e68('0x32')](_0x366b9b[_0x5e68('0x34')],qs[_0x5e68('0x35')](_0x198a9e[_0x5e68('0x30')][_0x5e68('0x35')]));_0xdd8e89[_0x5e68('0x33')]=_0xdd8e89['attributes']['length']?_0xdd8e89[_0x5e68('0x33')]:_0x366b9b['model'];_0xdd8e89[_0x5e68('0x51')]=qs[_0x5e68('0x39')](_0x198a9e[_0x5e68('0x30')]['sort']);_0xdd8e89['where']=qs[_0x5e68('0x31')](_['pick'](_0x198a9e[_0x5e68('0x30')],_0x366b9b[_0x5e68('0x31')]));if(_0x198a9e['query'][_0x5e68('0x3c')]){_0xdd8e89[_0x5e68('0x3a')]=_[_0x5e68('0x3d')](_0xdd8e89[_0x5e68('0x3a')],{'$or':_[_0x5e68('0x3e')](_0xdd8e89[_0x5e68('0x33')],function(_0x389999){var _0x383ffd={};_0x383ffd[_0x389999]={'$like':'%'+_0x198a9e[_0x5e68('0x30')][_0x5e68('0x3c')]+'%'};return _0x383ffd;})});}_0xdd8e89=_[_0x5e68('0x3d')]({},_0xdd8e89,_0x198a9e[_0x5e68('0x49')]);return _0x5c99ab[_0x5e68('0x4e')](_0xdd8e89);}})[_0x5e68('0x16')](function(_0x4e7f43){if(_0x4e7f43){_0x4b3599=_0x4e7f43[_0x5e68('0x36')];if(!_0x198a9e['query'][_0x5e68('0x37')](_0x5e68('0x52'))){_0xdd8e89[_0x5e68('0x38')]=qs[_0x5e68('0x38')](_0x198a9e['query'][_0x5e68('0x38')]);_0xdd8e89[_0x5e68('0x23')]=qs[_0x5e68('0x23')](_0x198a9e['query']['offset']);}return _0x5c99ab[_0x5e68('0x4e')](_0xdd8e89);}})['then'](function(_0x575509){if(_0x575509){return _0x575509?{'count':_0x4b3599,'rows':_0x575509}:null;}})['then'](respondWithResult(_0x64d1ad,null))['catch'](handleError(_0x64d1ad,null));};exports[_0x5e68('0x53')]=function(_0x5ec0eb,_0x196a99,_0x4fa344){if(_0x5ec0eb[_0x5e68('0x4c')]['id']){delete _0x5ec0eb[_0x5e68('0x4c')]['id'];}return db[_0x5e68('0x2d')][_0x5e68('0x4f')]({'where':{'id':_0x5ec0eb['params']['id']}})[_0x5e68('0x16')](handleEntityNotFound(_0x196a99,null))['then'](function(_0x151c79){if(_0x151c79){_0x5ec0eb['body'][_0x5e68('0x54')]=_0x151c79['id'];_0x5ec0eb[_0x5e68('0x4c')][_0x5e68('0x55')]=integrations[_0x5e68('0x56')](_0x5ec0eb['body'][_0x5e68('0x57')],_0x5ec0eb['body']['type']);_0x5ec0eb['body'][_0x5e68('0x58')]=integrations['getDescriptions'](_0x5ec0eb[_0x5e68('0x4c')]['channel'],_0x5ec0eb[_0x5e68('0x4c')][_0x5e68('0x3f')]);return db['VtigerConfiguration'][_0x5e68('0x4b')](_0x5ec0eb[_0x5e68('0x4c')],{'include':[{'model':db[_0x5e68('0x59')],'as':_0x5e68('0x55')},{'model':db[_0x5e68('0x59')],'as':_0x5e68('0x58')}]});}return null;})[_0x5e68('0x16')](respondWithResult(_0x196a99,null))[_0x5e68('0x1f')](handleError(_0x196a99,null));};var md5=require('md5');exports['getFields']=function(_0x2964b2,_0x31c6f1,_0x6033e7){var _0x4a795b=null;var _0x46c5d3=null;var _0x23fe4f=null;var _0x10f4a8=null;return db['VtigerAccount']['findOne']({'where':{'id':_0x2964b2[_0x5e68('0x48')]['id']},'attributes':['id',_0x5e68('0x2a'),_0x5e68('0x5a'),_0x5e68('0x5b'),_0x5e68('0x5c'),_0x5e68('0x5d'),_0x5e68('0x5e'),_0x5e68('0x5f')]})[_0x5e68('0x16')](handleEntityNotFound(_0x31c6f1,null))['then'](function(_0x205638){if(_0x205638){_0x4a795b=_0x205638[_0x5e68('0x5a')];_0x46c5d3=_0x205638[_0x5e68('0x5f')];_0x23fe4f=_0x205638[_0x5e68('0x5c')];_0x10f4a8=util[_0x5e68('0x60')](_0x5e68('0x61'),_0x205638[_0x5e68('0x5d')]);var _0x44be2d={'method':'GET','uri':_0x10f4a8,'qs':{'operation':_0x5e68('0x62'),'username':_0x205638[_0x5e68('0x5a')]},'json':!![]};return rp(_0x44be2d);}})[_0x5e68('0x16')](function(_0x539580){if(_0x539580[_0x5e68('0x63')]){var _0x270daf={'method':'POST','uri':_0x10f4a8,'form':{'operation':'login','username':_0x4a795b,'accessKey':md5(_0x539580['result'][_0x5e68('0x64')]+_0x46c5d3)},'json':!![]};return rp(_0x270daf);}})[_0x5e68('0x16')](function(_0x58f162){if(_0x58f162[_0x5e68('0x63')]){var _0xb645a5={'method':_0x5e68('0x65'),'uri':_0x10f4a8,'qs':{'operation':_0x5e68('0x66'),'username':_0x4a795b,'sessionName':_0x58f162['result'][_0x5e68('0x67')],'elementType':_0x23fe4f},'json':!![]};return rp(_0xb645a5);}})[_0x5e68('0x16')](function(_0x561832){if(_0x561832[_0x5e68('0x63')]){var _0x1e767a=[_0x5e68('0x68'),_0x5e68('0x69'),_0x5e68('0x6a')];_[_0x5e68('0x6b')](_0x561832[_0x5e68('0x6c')][_0x5e68('0x35')],function(_0x360fed){return _0x1e767a['includes'](_0x360fed[_0x5e68('0x3f')]['name']);});_[_0x5e68('0x6b')](_0x561832['result'][_0x5e68('0x35')],function(_0x38d9fe){return _0x38d9fe['editable']==='false';});return{'count':_0x561832[_0x5e68('0x6c')][_0x5e68('0x35')][_0x5e68('0x36')],'rows':_[_0x5e68('0x3e')](_0x561832['result'][_0x5e68('0x35')],function(_0x3dd6b0){return{'id':_0x3dd6b0[_0x5e68('0x2a')],'name':_0x3dd6b0[_0x5e68('0x6d')],'custom':_[_0x5e68('0x6e')](_0x3dd6b0[_0x5e68('0x2a')],_0x5e68('0x6f'))?!![]:![],'options':_0x3dd6b0['type'][_0x5e68('0x2a')]===_0x5e68('0x70')&&_0x3dd6b0['type'][_0x5e68('0x71')][_0x5e68('0x36')]>0x0?_[_0x5e68('0x3e')](_0x3dd6b0[_0x5e68('0x3f')][_0x5e68('0x71')],function(_0x56ba25){return{'name':_0x56ba25[_0x5e68('0x6d')],'value':_0x56ba25[_0x5e68('0x72')]};}):[]};})};}})[_0x5e68('0x16')](respondWithResult(_0x31c6f1,null))[_0x5e68('0x1f')](function(_0x245f49){console[_0x5e68('0x73')](_0x5e68('0x74')+_0x245f49);var _0x26d552=_0x2964b2[_0x5e68('0x30')]['test']?0x1f4:_0x245f49[_0x5e68('0x75')]||0x1f4;logger[_0x5e68('0x1b')](_0x5e68('0x76'),_0x5e68('0x77'),_0x26d552,JSON[_0x5e68('0x1a')](_0x245f49));delete _0x245f49[_0x5e68('0x2a')];if(_0x26d552===0x191){_0x26d552=0x190;}_0x31c6f1['status'](_0x26d552)[_0x5e68('0x2b')](_0x2964b2['query'][_0x5e68('0x78')]?{'message':_0x5e68('0x79'),'statusCode':_0x245f49['statusCode']}:_0x245f49);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index c23ed32..1fc824a 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 _0x72f1=['VtigerAccount','util','api','moment','bluebird','request-promise','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x223e9c,_0x9160f6){var _0x335d8a=function(_0x243d96){while(--_0x243d96){_0x223e9c['push'](_0x223e9c['shift']());}};_0x335d8a(++_0x9160f6);}(_0x72f1,0x10f));var _0x172f=function(_0xe3c8ab,_0x8e8267){_0xe3c8ab=_0xe3c8ab-0x0;var _0xd9910a=_0x72f1[_0xe3c8ab];return _0xd9910a;};'use strict';var _=require('lodash');var util=require(_0x172f('0x0'));var logger=require('../../config/logger')(_0x172f('0x1'));var moment=require(_0x172f('0x2'));var BPromise=require(_0x172f('0x3'));var rp=require(_0x172f('0x4'));var attributes=require(_0x172f('0x5'));var integrations=require(_0x172f('0x6'));module[_0x172f('0x7')]=function(_0x42a190,_0x3ec97b){return _0x42a190[_0x172f('0x8')](_0x172f('0x9'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9faf=['api','moment','request-promise','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','util','../../config/logger'];(function(_0x308375,_0x3a93cc){var _0x18d40c=function(_0x21bbbf){while(--_0x21bbbf){_0x308375['push'](_0x308375['shift']());}};_0x18d40c(++_0x3a93cc);}(_0x9faf,0x184));var _0xf9fa=function(_0x45b34e,_0x549706){_0x45b34e=_0x45b34e-0x0;var _0x130dd6=_0x9faf[_0x45b34e];return _0x130dd6;};'use strict';var _=require('lodash');var util=require(_0xf9fa('0x0'));var logger=require(_0xf9fa('0x1'))(_0xf9fa('0x2'));var moment=require(_0xf9fa('0x3'));var BPromise=require('bluebird');var rp=require(_0xf9fa('0x4'));var attributes=require(_0xf9fa('0x5'));var integrations=require(_0xf9fa('0x6'));module[_0xf9fa('0x7')]=function(_0x1bf2a2,_0x4c46e0){return _0x1bf2a2[_0xf9fa('0x8')]('VtigerAccount',attributes,{'tableName':_0xf9fa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 5d091e0..bdbd248 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 _0xf1b5=['limit','include','map','model','debug','catch','ShowVtigerAccount','where','lodash','util','moment','../../mysqldb','../../config/logger','client','http','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes'];(function(_0x5b4fc8,_0x11aeda){var _0x5d97fc=function(_0x8a202){while(--_0x8a202){_0x5b4fc8['push'](_0x5b4fc8['shift']());}};_0x5d97fc(++_0x11aeda);}(_0xf1b5,0x1a8));var _0x5f1b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5f1b('0x0'));var util=require(_0x5f1b('0x1'));var moment=require(_0x5f1b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f1b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f1b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5f1b('0x5')][_0x5f1b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x109dfc,_0x2086b2,_0x30aeb0){return new BPromise(function(_0x1ed976,_0x597465){return client[_0x5f1b('0x7')](_0x109dfc,_0x30aeb0)[_0x5f1b('0x8')](function(_0x49081e){logger['info'](_0x5f1b('0x9'),_0x2086b2,_0x5f1b('0xa'));logger['debug'](_0x5f1b('0xb'),_0x2086b2,_0x5f1b('0xa'),JSON[_0x5f1b('0xc')](_0x49081e));if(_0x49081e[_0x5f1b('0xd')]){if(_0x49081e[_0x5f1b('0xd')][_0x5f1b('0xe')]===0x1f4){logger['error'](_0x5f1b('0x9'),_0x2086b2,_0x49081e[_0x5f1b('0xd')][_0x5f1b('0xf')]);return _0x597465(_0x49081e['error'][_0x5f1b('0xf')]);}logger[_0x5f1b('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x2086b2,_0x49081e[_0x5f1b('0xd')][_0x5f1b('0xf')]);return _0x1ed976(_0x49081e[_0x5f1b('0xd')][_0x5f1b('0xf')]);}else{logger[_0x5f1b('0x10')](_0x5f1b('0x9'),_0x2086b2,'request\x20sent');_0x1ed976(_0x49081e[_0x5f1b('0x11')][_0x5f1b('0xf')]);}})['catch'](function(_0x2efd67){logger[_0x5f1b('0xd')](_0x5f1b('0x9'),_0x2086b2,_0x2efd67);_0x597465(_0x2efd67);});});}exports[_0x5f1b('0x12')]=function(_0x20430b){var _0x18f18b=this;return new Promise(function(_0x49d21a,_0x529314){return db[_0x5f1b('0x13')][_0x5f1b('0x14')]({'raw':_0x20430b['options']?_0x20430b[_0x5f1b('0x15')][_0x5f1b('0x16')]===undefined?!![]:![]:!![],'where':_0x20430b[_0x5f1b('0x15')]?_0x20430b[_0x5f1b('0x15')]['where']||null:null,'attributes':_0x20430b[_0x5f1b('0x15')]?_0x20430b[_0x5f1b('0x15')][_0x5f1b('0x17')]||null:null,'limit':_0x20430b['options']?_0x20430b[_0x5f1b('0x15')][_0x5f1b('0x18')]||null:null,'include':_0x20430b[_0x5f1b('0x15')]?_0x20430b[_0x5f1b('0x15')][_0x5f1b('0x19')]?_[_0x5f1b('0x1a')](_0x20430b[_0x5f1b('0x15')][_0x5f1b('0x19')],function(_0x3c247f){return{'model':db[_0x3c247f[_0x5f1b('0x1b')]],'as':_0x3c247f['as'],'attributes':_0x3c247f[_0x5f1b('0x17')],'include':_0x3c247f['include']?_[_0x5f1b('0x1a')](_0x3c247f[_0x5f1b('0x19')],function(_0xa4d683){return{'model':db[_0xa4d683['model']],'as':_0xa4d683['as'],'attributes':_0xa4d683[_0x5f1b('0x17')],'include':_0xa4d683['include']?_['map'](_0xa4d683[_0x5f1b('0x19')],function(_0x20d510){return{'model':db[_0x20d510['model']],'as':_0x20d510['as'],'attributes':_0x20d510[_0x5f1b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5f1b('0x8')](function(_0x1d8cf9){logger[_0x5f1b('0x10')](_0x5f1b('0x12'),_0x20430b);logger[_0x5f1b('0x1c')](_0x5f1b('0x12'),_0x20430b,JSON[_0x5f1b('0xc')](_0x1d8cf9));_0x49d21a(_0x1d8cf9);})[_0x5f1b('0x1d')](function(_0x43365e){logger['error'](_0x5f1b('0x12'),_0x43365e[_0x5f1b('0xf')],_0x20430b);_0x529314(_0x18f18b['error'](0x1f4,_0x43365e[_0x5f1b('0xf')]));});});};exports[_0x5f1b('0x1e')]=function(_0x509e16){var _0x4d1f17=this;return new Promise(function(_0x1ac5b1,_0x1b63a9){return db['VtigerAccount']['find']({'raw':_0x509e16[_0x5f1b('0x15')]?_0x509e16[_0x5f1b('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x509e16[_0x5f1b('0x15')]?_0x509e16[_0x5f1b('0x15')][_0x5f1b('0x1f')]||null:null,'attributes':_0x509e16['options']?_0x509e16[_0x5f1b('0x15')][_0x5f1b('0x17')]||null:null,'include':_0x509e16[_0x5f1b('0x15')]?_0x509e16[_0x5f1b('0x15')][_0x5f1b('0x19')]?_[_0x5f1b('0x1a')](_0x509e16[_0x5f1b('0x15')][_0x5f1b('0x19')],function(_0x69aa87){return{'model':db[_0x69aa87[_0x5f1b('0x1b')]],'as':_0x69aa87['as'],'attributes':_0x69aa87[_0x5f1b('0x17')],'include':_0x69aa87[_0x5f1b('0x19')]?_['map'](_0x69aa87[_0x5f1b('0x19')],function(_0x4cb14e){return{'model':db[_0x4cb14e[_0x5f1b('0x1b')]],'as':_0x4cb14e['as'],'attributes':_0x4cb14e['attributes'],'include':_0x4cb14e[_0x5f1b('0x19')]?_[_0x5f1b('0x1a')](_0x4cb14e[_0x5f1b('0x19')],function(_0xaf12e2){return{'model':db[_0xaf12e2[_0x5f1b('0x1b')]],'as':_0xaf12e2['as'],'attributes':_0xaf12e2[_0x5f1b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5f1b('0x8')](function(_0x4e9e65){logger[_0x5f1b('0x10')](_0x5f1b('0x1e'),_0x509e16);logger[_0x5f1b('0x1c')](_0x5f1b('0x1e'),_0x509e16,JSON['stringify'](_0x4e9e65));_0x1ac5b1(_0x4e9e65);})[_0x5f1b('0x1d')](function(_0x348ead){logger[_0x5f1b('0xd')](_0x5f1b('0x1e'),_0x348ead[_0x5f1b('0xf')],_0x509e16);_0x1b63a9(_0x4d1f17[_0x5f1b('0xd')](0x1f4,_0x348ead[_0x5f1b('0xf')]));});});}; \ No newline at end of file +var _0x38df=['http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','attributes','include','map','model','ShowVtigerAccount','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4a2f8f,_0x21a198){var _0x1ea8a6=function(_0x8a7fc){while(--_0x8a7fc){_0x4a2f8f['push'](_0x4a2f8f['shift']());}};_0x1ea8a6(++_0x21a198);}(_0x38df,0x117));var _0xf38d=function(_0x2ffd05,_0x1840e3){_0x2ffd05=_0x2ffd05-0x0;var _0x5038bf=_0x38df[_0x2ffd05];return _0x5038bf;};'use strict';var _=require('lodash');var util=require(_0xf38d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf38d('0x1'));var fs=require('fs');var Redis=require(_0xf38d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf38d('0x3'));var logger=require(_0xf38d('0x4'))(_0xf38d('0x5'));var config=require(_0xf38d('0x6'));var jayson=require(_0xf38d('0x7'));var client=jayson[_0xf38d('0x8')][_0xf38d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13b687,_0x92287a,_0x136d91){return new BPromise(function(_0x3152b1,_0x29c6b2){return client[_0xf38d('0xa')](_0x13b687,_0x136d91)[_0xf38d('0xb')](function(_0x1e0ee3){logger[_0xf38d('0xc')](_0xf38d('0xd'),_0x92287a,_0xf38d('0xe'));logger[_0xf38d('0xf')](_0xf38d('0x10'),_0x92287a,'request\x20sent',JSON[_0xf38d('0x11')](_0x1e0ee3));if(_0x1e0ee3[_0xf38d('0x12')]){if(_0x1e0ee3[_0xf38d('0x12')][_0xf38d('0x13')]===0x1f4){logger[_0xf38d('0x12')](_0xf38d('0xd'),_0x92287a,_0x1e0ee3[_0xf38d('0x12')][_0xf38d('0x14')]);return _0x29c6b2(_0x1e0ee3[_0xf38d('0x12')][_0xf38d('0x14')]);}logger[_0xf38d('0x12')](_0xf38d('0xd'),_0x92287a,_0x1e0ee3[_0xf38d('0x12')][_0xf38d('0x14')]);return _0x3152b1(_0x1e0ee3[_0xf38d('0x12')][_0xf38d('0x14')]);}else{logger[_0xf38d('0xc')](_0xf38d('0xd'),_0x92287a,_0xf38d('0xe'));_0x3152b1(_0x1e0ee3[_0xf38d('0x15')][_0xf38d('0x14')]);}})[_0xf38d('0x16')](function(_0x1a32b3){logger['error'](_0xf38d('0xd'),_0x92287a,_0x1a32b3);_0x29c6b2(_0x1a32b3);});});}exports[_0xf38d('0x17')]=function(_0x47e025){var _0x3ba8ed=this;return new Promise(function(_0x5456d6,_0x392549){return db[_0xf38d('0x18')]['findAll']({'raw':_0x47e025[_0xf38d('0x19')]?_0x47e025[_0xf38d('0x19')][_0xf38d('0x1a')]===undefined?!![]:![]:!![],'where':_0x47e025['options']?_0x47e025[_0xf38d('0x19')]['where']||null:null,'attributes':_0x47e025[_0xf38d('0x19')]?_0x47e025[_0xf38d('0x19')][_0xf38d('0x1b')]||null:null,'limit':_0x47e025[_0xf38d('0x19')]?_0x47e025[_0xf38d('0x19')]['limit']||null:null,'include':_0x47e025['options']?_0x47e025[_0xf38d('0x19')][_0xf38d('0x1c')]?_[_0xf38d('0x1d')](_0x47e025[_0xf38d('0x19')][_0xf38d('0x1c')],function(_0x2ce6be){return{'model':db[_0x2ce6be[_0xf38d('0x1e')]],'as':_0x2ce6be['as'],'attributes':_0x2ce6be[_0xf38d('0x1b')],'include':_0x2ce6be[_0xf38d('0x1c')]?_[_0xf38d('0x1d')](_0x2ce6be[_0xf38d('0x1c')],function(_0x4f6a30){return{'model':db[_0x4f6a30[_0xf38d('0x1e')]],'as':_0x4f6a30['as'],'attributes':_0x4f6a30[_0xf38d('0x1b')],'include':_0x4f6a30[_0xf38d('0x1c')]?_[_0xf38d('0x1d')](_0x4f6a30[_0xf38d('0x1c')],function(_0x1790be){return{'model':db[_0x1790be[_0xf38d('0x1e')]],'as':_0x1790be['as'],'attributes':_0x1790be[_0xf38d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x282308){logger[_0xf38d('0xc')](_0xf38d('0x17'),_0x47e025);logger[_0xf38d('0xf')](_0xf38d('0x17'),_0x47e025,JSON[_0xf38d('0x11')](_0x282308));_0x5456d6(_0x282308);})[_0xf38d('0x16')](function(_0x5d07b3){logger[_0xf38d('0x12')](_0xf38d('0x17'),_0x5d07b3[_0xf38d('0x14')],_0x47e025);_0x392549(_0x3ba8ed[_0xf38d('0x12')](0x1f4,_0x5d07b3['message']));});});};exports[_0xf38d('0x1f')]=function(_0x2073d8){var _0x2b573a=this;return new Promise(function(_0x4d9b69,_0x289743){return db[_0xf38d('0x18')]['find']({'raw':_0x2073d8[_0xf38d('0x19')]?_0x2073d8[_0xf38d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2073d8[_0xf38d('0x19')]?_0x2073d8[_0xf38d('0x19')]['where']||null:null,'attributes':_0x2073d8[_0xf38d('0x19')]?_0x2073d8[_0xf38d('0x19')][_0xf38d('0x1b')]||null:null,'include':_0x2073d8[_0xf38d('0x19')]?_0x2073d8[_0xf38d('0x19')][_0xf38d('0x1c')]?_[_0xf38d('0x1d')](_0x2073d8[_0xf38d('0x19')][_0xf38d('0x1c')],function(_0x4980af){return{'model':db[_0x4980af[_0xf38d('0x1e')]],'as':_0x4980af['as'],'attributes':_0x4980af[_0xf38d('0x1b')],'include':_0x4980af[_0xf38d('0x1c')]?_[_0xf38d('0x1d')](_0x4980af[_0xf38d('0x1c')],function(_0x3c7fad){return{'model':db[_0x3c7fad['model']],'as':_0x3c7fad['as'],'attributes':_0x3c7fad[_0xf38d('0x1b')],'include':_0x3c7fad[_0xf38d('0x1c')]?_[_0xf38d('0x1d')](_0x3c7fad[_0xf38d('0x1c')],function(_0x283461){return{'model':db[_0x283461[_0xf38d('0x1e')]],'as':_0x283461['as'],'attributes':_0x283461[_0xf38d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf38d('0xb')](function(_0x59063e){logger[_0xf38d('0xc')](_0xf38d('0x1f'),_0x2073d8);logger['debug'](_0xf38d('0x1f'),_0x2073d8,JSON[_0xf38d('0x11')](_0x59063e));_0x4d9b69(_0x59063e);})['catch'](function(_0x4c5fcb){logger[_0xf38d('0x12')](_0xf38d('0x1f'),_0x4c5fcb['message'],_0x2073d8);_0x289743(_0x2b573a[_0xf38d('0x12')](0x1f4,_0x4c5fcb[_0xf38d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 41f7cdb..3e393a3 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0xd98ca3,_0x38fbd9){var _0x35960d=function(_0x52e8ee){while(--_0x52e8ee){_0xd98ca3['push'](_0xd98ca3['shift']());}};_0x35960d(++_0x38fbd9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file +var _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 8e94599..bc64aad 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 _0x01c1=['STRING'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x01c1,0xef));var _0x101c=function(_0xe93fd9,_0x240400){_0xe93fd9=_0xe93fd9-0x0;var _0x2c09f3=_0x01c1[_0xe93fd9];return _0x2c09f3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x101c('0x0')]},'description':{'type':Sequelize[_0x101c('0x0')]}}; \ No newline at end of file +var _0x1cc6=['sequelize','exports','STRING'];(function(_0x128cac,_0x5bed99){var _0x4bc54a=function(_0x32914f){while(--_0x32914f){_0x128cac['push'](_0x128cac['shift']());}};_0x4bc54a(++_0x5bed99);}(_0x1cc6,0x66));var _0x61cc=function(_0x2c3a8f,_0x374e56){_0x2c3a8f=_0x2c3a8f-0x0;var _0x189412=_0x1cc6[_0x2c3a8f];return _0x189412;};'use strict';var Sequelize=require(_0x61cc('0x0'));module[_0x61cc('0x1')]={'name':{'type':Sequelize[_0x61cc('0x2')]},'description':{'type':Sequelize[_0x61cc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 0bb6b63..86a95dd 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 _0xfaf2=['findAll','rows','show','params','includeAll','find','body','getFields','findOne','VtigerField','pick','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','jayson/promise','http','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','stack','name','index','VtigerConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfaf2,0x169));var _0x2faf=function(_0x22feb1,_0x32f0cd){_0x22feb1=_0x22feb1-0x0;var _0x38f8de=_0xfaf2[_0x22feb1];return _0x38f8de;};'use strict';var pdf=require(_0x2faf('0x0'));var emlformat=require(_0x2faf('0x1'));var rimraf=require(_0x2faf('0x2'));var zipdir=require(_0x2faf('0x3'));var jsonpatch=require(_0x2faf('0x4'));var rp=require('request-promise');var moment=require(_0x2faf('0x5'));var BPromise=require(_0x2faf('0x6'));var Mustache=require(_0x2faf('0x7'));var util=require(_0x2faf('0x8'));var path=require(_0x2faf('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2faf('0xa'));var squel=require(_0x2faf('0xb'));var crypto=require(_0x2faf('0xc'));var jsforce=require(_0x2faf('0xd'));var deskjs=require(_0x2faf('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2faf('0xf'));var authService=require(_0x2faf('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x2faf('0x11'));var logger=require(_0x2faf('0x12'))(_0x2faf('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2faf('0x14'))['db'];var jayson=require(_0x2faf('0x15'));var client=jayson['client'][_0x2faf('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x509157,_0x1945fe,_0x8c74bf,_0x400a19){return new BPromise(function(_0x3b7751,_0x1be421){var _0x27d2c1=_0x400a19||client;return _0x27d2c1['request'](_0x509157,_0x8c74bf)[_0x2faf('0x17')](function(_0x3910c3){logger['info'](_0x2faf('0x18'),_0x1945fe,_0x2faf('0x19'));logger[_0x2faf('0x1a')](_0x2faf('0x1b'),_0x1945fe,'request\x20sent',JSON[_0x2faf('0x1c')](_0x3910c3));if(_0x3910c3[_0x2faf('0x1d')]){if(_0x3910c3[_0x2faf('0x1d')][_0x2faf('0x1e')]===0x1f4){logger['error'](_0x2faf('0x18'),_0x1945fe,_0x3910c3[_0x2faf('0x1d')][_0x2faf('0x1f')]);return _0x1be421(_0x3910c3[_0x2faf('0x1d')][_0x2faf('0x1f')]);}logger[_0x2faf('0x1d')](_0x2faf('0x18'),_0x1945fe,_0x3910c3['error']['message']);return _0x3b7751(_0x3910c3['error'][_0x2faf('0x1f')]);}else{logger[_0x2faf('0x20')]('VtigerConfiguration,\x20%s,\x20%s',_0x1945fe,_0x2faf('0x19'));_0x3b7751(_0x3910c3['result']['message']);}})[_0x2faf('0x21')](function(_0x2cb862){logger['error'](_0x2faf('0x18'),_0x1945fe,_0x2cb862);_0x1be421(_0x2cb862);});});}function respondWithStatusCode(_0x3c1e49,_0x3545cf){_0x3545cf=_0x3545cf||0xcc;return function(_0x3f598c){if(_0x3f598c){return _0x3c1e49[_0x2faf('0x22')](_0x3545cf);}return _0x3c1e49[_0x2faf('0x23')](_0x3545cf)[_0x2faf('0x24')]();};}function respondWithResult(_0x1ee5a7,_0x107cd4){_0x107cd4=_0x107cd4||0xc8;return function(_0x2dd82b){if(_0x2dd82b){return _0x1ee5a7[_0x2faf('0x23')](_0x107cd4)[_0x2faf('0x25')](_0x2dd82b);}};}function respondWithFilteredResult(_0x5f1359,_0x404f67){return function(_0x13b655){if(_0x13b655){var _0xa092f6=_0x13b655[_0x2faf('0x26')],_0x53f72c=_0x404f67[_0x2faf('0x27')],_0x2553fc=_0x404f67[_0x2faf('0x27')]+_0x404f67[_0x2faf('0x28')],_0x24f6c2;if(_0x2553fc>=_0xa092f6){_0x2553fc=_0xa092f6;_0x24f6c2=0xc8;}else{_0x24f6c2=0xce;}_0x5f1359['status'](_0x24f6c2);return _0x5f1359[_0x2faf('0x29')]('Content-Range',_0x53f72c+'-'+_0x2553fc+'/'+_0xa092f6)[_0x2faf('0x25')](_0x13b655);}return null;};}function patchUpdates(_0x1133a0){return function(_0x147730){try{jsonpatch[_0x2faf('0x2a')](_0x147730,_0x1133a0,!![]);}catch(_0x462d9b){return BPromise[_0x2faf('0x2b')](_0x462d9b);}return _0x147730[_0x2faf('0x2c')]();};}function saveUpdates(_0x266dce,_0x3b504c){return function(_0x48f6a5){if(_0x48f6a5){return _0x48f6a5[_0x2faf('0x2d')](_0x266dce)[_0x2faf('0x17')](function(_0xfa4391){return _0xfa4391;});}return null;};}function removeEntity(_0x404366,_0x2d86a4){return function(_0x5a0c5e){if(_0x5a0c5e){return _0x5a0c5e[_0x2faf('0x2e')]()[_0x2faf('0x17')](function(){_0x404366['status'](0xcc)[_0x2faf('0x24')]();});}};}function handleEntityNotFound(_0xcb2caf,_0x129878){return function(_0xf57453){if(!_0xf57453){_0xcb2caf['sendStatus'](0x194);}return _0xf57453;};}function handleError(_0x201695,_0x56c8b0){_0x56c8b0=_0x56c8b0||0x1f4;return function(_0x4d1b94){logger[_0x2faf('0x1d')](_0x4d1b94[_0x2faf('0x2f')]);if(_0x4d1b94[_0x2faf('0x30')]){delete _0x4d1b94[_0x2faf('0x30')];}_0x201695['status'](_0x56c8b0)['send'](_0x4d1b94);};}exports[_0x2faf('0x31')]=function(_0x1aa654,_0xa8bb28){var _0x1a34ac={},_0x1a5dbf={},_0x23ccb6={'count':0x0,'rows':[]};var _0x5c5d57=db[_0x2faf('0x32')][_0x2faf('0x33')];_0x1a5dbf[_0x2faf('0x34')]=_[_0x2faf('0x35')](_0x5c5d57);_0x1a5dbf[_0x2faf('0x36')]=_[_0x2faf('0x35')](_0x1aa654[_0x2faf('0x36')]);_0x1a5dbf[_0x2faf('0x37')]=_[_0x2faf('0x38')](_0x1a5dbf[_0x2faf('0x34')],_0x1a5dbf[_0x2faf('0x36')]);_0x1a34ac[_0x2faf('0x39')]=_[_0x2faf('0x38')](_0x1a5dbf['model'],qs['fields'](_0x1aa654[_0x2faf('0x36')][_0x2faf('0x3a')]));_0x1a34ac['attributes']=_0x1a34ac['attributes'][_0x2faf('0x3b')]?_0x1a34ac[_0x2faf('0x39')]:_0x1a5dbf[_0x2faf('0x34')];if(!_0x1aa654[_0x2faf('0x36')][_0x2faf('0x3c')](_0x2faf('0x3d'))){_0x1a34ac[_0x2faf('0x28')]=qs['limit'](_0x1aa654['query'][_0x2faf('0x28')]);_0x1a34ac['offset']=qs['offset'](_0x1aa654['query']['offset']);}_0x1a34ac[_0x2faf('0x3e')]=qs[_0x2faf('0x3f')](_0x1aa654[_0x2faf('0x36')]['sort']);_0x1a34ac[_0x2faf('0x40')]=qs['filters'](_['pick'](_0x1aa654[_0x2faf('0x36')],_0x1a5dbf[_0x2faf('0x37')]));if(_0x1aa654[_0x2faf('0x36')][_0x2faf('0x41')]){_0x1a34ac[_0x2faf('0x40')]=_['merge'](_0x1a34ac[_0x2faf('0x40')],{'$or':_[_0x2faf('0x42')](_0x5c5d57,function(_0x294e5c){if(_0x294e5c[_0x2faf('0x43')][_0x2faf('0x44')]!==_0x2faf('0x45')){var _0x1f8f93={};_0x1f8f93[_0x294e5c[_0x2faf('0x46')]]={'$like':'%'+_0x1aa654[_0x2faf('0x36')][_0x2faf('0x41')]+'%'};return _0x1f8f93;}})});}_0x1a34ac=_[_0x2faf('0x47')]({},_0x1a34ac,_0x1aa654[_0x2faf('0x48')]);var _0x4f98e9={'where':_0x1a34ac[_0x2faf('0x40')]};return db[_0x2faf('0x32')][_0x2faf('0x26')](_0x4f98e9)[_0x2faf('0x17')](function(_0x42c0fb){_0x23ccb6[_0x2faf('0x26')]=_0x42c0fb;if(_0x1aa654[_0x2faf('0x36')]['includeAll']){_0x1a34ac[_0x2faf('0x49')]=[{'all':!![]}];}return db[_0x2faf('0x32')][_0x2faf('0x4a')](_0x1a34ac);})[_0x2faf('0x17')](function(_0x2bf5b8){_0x23ccb6[_0x2faf('0x4b')]=_0x2bf5b8;return _0x23ccb6;})[_0x2faf('0x17')](respondWithFilteredResult(_0xa8bb28,_0x1a34ac))['catch'](handleError(_0xa8bb28,null));};exports[_0x2faf('0x4c')]=function(_0x5c6a9f,_0x44e939){var _0x23d802={'raw':![],'where':{'id':_0x5c6a9f[_0x2faf('0x4d')]['id']}},_0xfb260a={};_0xfb260a[_0x2faf('0x34')]=_[_0x2faf('0x35')](db['VtigerConfiguration'][_0x2faf('0x33')]);_0xfb260a[_0x2faf('0x36')]=_[_0x2faf('0x35')](_0x5c6a9f[_0x2faf('0x36')]);_0xfb260a[_0x2faf('0x37')]=_[_0x2faf('0x38')](_0xfb260a[_0x2faf('0x34')],_0xfb260a[_0x2faf('0x36')]);_0x23d802[_0x2faf('0x39')]=_[_0x2faf('0x38')](_0xfb260a['model'],qs['fields'](_0x5c6a9f['query'][_0x2faf('0x3a')]));_0x23d802[_0x2faf('0x39')]=_0x23d802['attributes'][_0x2faf('0x3b')]?_0x23d802['attributes']:_0xfb260a[_0x2faf('0x34')];if(_0x5c6a9f['query'][_0x2faf('0x4e')]){_0x23d802[_0x2faf('0x49')]=[{'all':!![]}];}_0x23d802=_[_0x2faf('0x47')]({},_0x23d802,_0x5c6a9f['options']);return db['VtigerConfiguration'][_0x2faf('0x4f')](_0x23d802)[_0x2faf('0x17')](handleEntityNotFound(_0x44e939,null))['then'](respondWithResult(_0x44e939,null))[_0x2faf('0x21')](handleError(_0x44e939,null));};exports['create']=function(_0x575f31,_0x4495ca){return db[_0x2faf('0x32')]['create'](_0x575f31[_0x2faf('0x50')],{})[_0x2faf('0x17')](respondWithResult(_0x4495ca,0xc9))[_0x2faf('0x21')](handleError(_0x4495ca,null));};exports[_0x2faf('0x2d')]=function(_0x194946,_0x28d2c8){if(_0x194946[_0x2faf('0x50')]['id']){delete _0x194946[_0x2faf('0x50')]['id'];}return db[_0x2faf('0x32')][_0x2faf('0x4f')]({'where':{'id':_0x194946['params']['id']}})[_0x2faf('0x17')](handleEntityNotFound(_0x28d2c8,null))['then'](saveUpdates(_0x194946[_0x2faf('0x50')],null))[_0x2faf('0x17')](respondWithResult(_0x28d2c8,null))[_0x2faf('0x21')](handleError(_0x28d2c8,null));};exports[_0x2faf('0x2e')]=function(_0x351d7d,_0x230669){return db[_0x2faf('0x32')][_0x2faf('0x4f')]({'where':{'id':_0x351d7d['params']['id']}})[_0x2faf('0x17')](handleEntityNotFound(_0x230669,null))['then'](removeEntity(_0x230669,null))[_0x2faf('0x21')](handleError(_0x230669,null));};exports[_0x2faf('0x51')]=function(_0x45d652,_0x53c15d,_0x3992cc){var _0x5f529c={};var _0x2d7167={};var _0x18beb0;var _0x5d7e05;return db[_0x2faf('0x32')][_0x2faf('0x52')]({'where':{'id':_0x45d652['params']['id']}})[_0x2faf('0x17')](handleEntityNotFound(_0x53c15d,null))[_0x2faf('0x17')](function(_0x3efacc){if(_0x3efacc){_0x18beb0=_0x3efacc;_0x2d7167['model']=_[_0x2faf('0x35')](db[_0x2faf('0x53')]['rawAttributes']);_0x2d7167[_0x2faf('0x36')]=_[_0x2faf('0x35')](_0x45d652[_0x2faf('0x36')]);_0x2d7167[_0x2faf('0x37')]=_['intersection'](_0x2d7167[_0x2faf('0x34')],_0x2d7167[_0x2faf('0x36')]);_0x5f529c[_0x2faf('0x39')]=_['intersection'](_0x2d7167[_0x2faf('0x34')],qs[_0x2faf('0x3a')](_0x45d652['query'][_0x2faf('0x3a')]));_0x5f529c[_0x2faf('0x39')]=_0x5f529c[_0x2faf('0x39')]['length']?_0x5f529c[_0x2faf('0x39')]:_0x2d7167[_0x2faf('0x34')];_0x5f529c[_0x2faf('0x3e')]=qs[_0x2faf('0x3f')](_0x45d652[_0x2faf('0x36')][_0x2faf('0x3f')]);_0x5f529c[_0x2faf('0x40')]=qs[_0x2faf('0x37')](_[_0x2faf('0x54')](_0x45d652[_0x2faf('0x36')],_0x2d7167['filters']));if(_0x45d652[_0x2faf('0x36')]['filter']){_0x5f529c[_0x2faf('0x40')]=_[_0x2faf('0x47')](_0x5f529c['where'],{'$or':_[_0x2faf('0x42')](_0x5f529c['attributes'],function(_0x5a3e44){var _0x37b56d={};_0x37b56d[_0x5a3e44]={'$like':'%'+_0x45d652[_0x2faf('0x36')][_0x2faf('0x41')]+'%'};return _0x37b56d;})});}_0x5f529c=_[_0x2faf('0x47')]({},_0x5f529c,_0x45d652[_0x2faf('0x48')]);return _0x18beb0['getFields'](_0x5f529c);}})['then'](function(_0x31a718){if(_0x31a718){_0x5d7e05=_0x31a718[_0x2faf('0x3b')];if(!_0x45d652[_0x2faf('0x36')]['hasOwnProperty'](_0x2faf('0x3d'))){_0x5f529c[_0x2faf('0x28')]=qs[_0x2faf('0x28')](_0x45d652[_0x2faf('0x36')][_0x2faf('0x28')]);_0x5f529c[_0x2faf('0x27')]=qs[_0x2faf('0x27')](_0x45d652[_0x2faf('0x36')][_0x2faf('0x27')]);}return _0x18beb0['getFields'](_0x5f529c);}})[_0x2faf('0x17')](function(_0x3200d5){if(_0x3200d5){return _0x3200d5?{'count':_0x5d7e05,'rows':_0x3200d5}:null;}})[_0x2faf('0x17')](respondWithResult(_0x53c15d,null))[_0x2faf('0x21')](handleError(_0x53c15d,null));};exports['getSubjects']=function(_0x19e368,_0x3d869a,_0x422d84){var _0x233f21={};var _0x57eda2={};var _0x4be783;var _0x280adb;return db[_0x2faf('0x32')][_0x2faf('0x52')]({'where':{'id':_0x19e368[_0x2faf('0x4d')]['id']}})[_0x2faf('0x17')](handleEntityNotFound(_0x3d869a,null))[_0x2faf('0x17')](function(_0x5d1f3a){if(_0x5d1f3a){_0x4be783=_0x5d1f3a;_0x57eda2[_0x2faf('0x34')]=_[_0x2faf('0x35')](db[_0x2faf('0x53')][_0x2faf('0x33')]);_0x57eda2[_0x2faf('0x36')]=_[_0x2faf('0x35')](_0x19e368[_0x2faf('0x36')]);_0x57eda2[_0x2faf('0x37')]=_['intersection'](_0x57eda2['model'],_0x57eda2[_0x2faf('0x36')]);_0x233f21[_0x2faf('0x39')]=_[_0x2faf('0x38')](_0x57eda2['model'],qs[_0x2faf('0x3a')](_0x19e368[_0x2faf('0x36')][_0x2faf('0x3a')]));_0x233f21[_0x2faf('0x39')]=_0x233f21['attributes']['length']?_0x233f21[_0x2faf('0x39')]:_0x57eda2[_0x2faf('0x34')];_0x233f21[_0x2faf('0x3e')]=qs[_0x2faf('0x3f')](_0x19e368[_0x2faf('0x36')][_0x2faf('0x3f')]);_0x233f21[_0x2faf('0x40')]=qs[_0x2faf('0x37')](_[_0x2faf('0x54')](_0x19e368[_0x2faf('0x36')],_0x57eda2[_0x2faf('0x37')]));if(_0x19e368[_0x2faf('0x36')][_0x2faf('0x41')]){_0x233f21[_0x2faf('0x40')]=_[_0x2faf('0x47')](_0x233f21[_0x2faf('0x40')],{'$or':_['map'](_0x233f21[_0x2faf('0x39')],function(_0xcfef00){var _0x19a5a3={};_0x19a5a3[_0xcfef00]={'$like':'%'+_0x19e368['query'][_0x2faf('0x41')]+'%'};return _0x19a5a3;})});}_0x233f21=_[_0x2faf('0x47')]({},_0x233f21,_0x19e368[_0x2faf('0x48')]);return _0x4be783[_0x2faf('0x55')](_0x233f21);}})['then'](function(_0x29bc73){if(_0x29bc73){_0x280adb=_0x29bc73[_0x2faf('0x3b')];if(!_0x19e368[_0x2faf('0x36')][_0x2faf('0x3c')]('nolimit')){_0x233f21[_0x2faf('0x28')]=qs[_0x2faf('0x28')](_0x19e368['query'][_0x2faf('0x28')]);_0x233f21[_0x2faf('0x27')]=qs[_0x2faf('0x27')](_0x19e368['query'][_0x2faf('0x27')]);}return _0x4be783[_0x2faf('0x55')](_0x233f21);}})[_0x2faf('0x17')](function(_0x44a676){if(_0x44a676){return _0x44a676?{'count':_0x280adb,'rows':_0x44a676}:null;}})['then'](respondWithResult(_0x3d869a,null))[_0x2faf('0x21')](handleError(_0x3d869a,null));};exports[_0x2faf('0x56')]=function(_0x2e6fe7,_0x314d58,_0x2a90ff){var _0x100ce0={};var _0x5f5140={};var _0x57be52;var _0x51bb3c;return db[_0x2faf('0x32')]['findOne']({'where':{'id':_0x2e6fe7[_0x2faf('0x4d')]['id']}})[_0x2faf('0x17')](handleEntityNotFound(_0x314d58,null))[_0x2faf('0x17')](function(_0x3e9b0b){if(_0x3e9b0b){_0x57be52=_0x3e9b0b;_0x5f5140[_0x2faf('0x34')]=_[_0x2faf('0x35')](db['VtigerField'][_0x2faf('0x33')]);_0x5f5140[_0x2faf('0x36')]=_[_0x2faf('0x35')](_0x2e6fe7[_0x2faf('0x36')]);_0x5f5140[_0x2faf('0x37')]=_['intersection'](_0x5f5140['model'],_0x5f5140['query']);_0x100ce0[_0x2faf('0x39')]=_[_0x2faf('0x38')](_0x5f5140['model'],qs[_0x2faf('0x3a')](_0x2e6fe7[_0x2faf('0x36')]['fields']));_0x100ce0[_0x2faf('0x39')]=_0x100ce0[_0x2faf('0x39')][_0x2faf('0x3b')]?_0x100ce0[_0x2faf('0x39')]:_0x5f5140[_0x2faf('0x34')];_0x100ce0[_0x2faf('0x3e')]=qs[_0x2faf('0x3f')](_0x2e6fe7[_0x2faf('0x36')][_0x2faf('0x3f')]);_0x100ce0[_0x2faf('0x40')]=qs[_0x2faf('0x37')](_[_0x2faf('0x54')](_0x2e6fe7[_0x2faf('0x36')],_0x5f5140['filters']));if(_0x2e6fe7[_0x2faf('0x36')][_0x2faf('0x41')]){_0x100ce0[_0x2faf('0x40')]=_[_0x2faf('0x47')](_0x100ce0[_0x2faf('0x40')],{'$or':_['map'](_0x100ce0[_0x2faf('0x39')],function(_0x414f9a){var _0x3cacc6={};_0x3cacc6[_0x414f9a]={'$like':'%'+_0x2e6fe7[_0x2faf('0x36')][_0x2faf('0x41')]+'%'};return _0x3cacc6;})});}_0x100ce0=_[_0x2faf('0x47')]({},_0x100ce0,_0x2e6fe7[_0x2faf('0x48')]);return _0x57be52[_0x2faf('0x56')](_0x100ce0);}})[_0x2faf('0x17')](function(_0x453818){if(_0x453818){_0x51bb3c=_0x453818[_0x2faf('0x3b')];if(!_0x2e6fe7['query'][_0x2faf('0x3c')](_0x2faf('0x3d'))){_0x100ce0[_0x2faf('0x28')]=qs[_0x2faf('0x28')](_0x2e6fe7[_0x2faf('0x36')]['limit']);_0x100ce0[_0x2faf('0x27')]=qs[_0x2faf('0x27')](_0x2e6fe7[_0x2faf('0x36')][_0x2faf('0x27')]);}return _0x57be52[_0x2faf('0x56')](_0x100ce0);}})[_0x2faf('0x17')](function(_0x258d9b){if(_0x258d9b){return _0x258d9b?{'count':_0x51bb3c,'rows':_0x258d9b}:null;}})[_0x2faf('0x17')](respondWithResult(_0x314d58,null))[_0x2faf('0x21')](handleError(_0x314d58,null));}; \ No newline at end of file +var _0xffc0=['getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','request','then','info','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','message','VtigerConfiguration,\x20%s,\x20%s','result','catch','sendStatus','json','offset','set','apply','reject','save','update','destroy','status','stack','name','send','index','VtigerConfiguration','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','type','VIRTUAL','filter','options','count','include','findAll','rows','params','filters','create','body','getFields','findOne','VtigerField','map','pick'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xffc0,0x1a0));var _0x0ffc=function(_0x3304ba,_0x5df355){_0x3304ba=_0x3304ba-0x0;var _0x44dd4c=_0xffc0[_0x3304ba];return _0x44dd4c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0ffc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0ffc('0x1'));var jsonpatch=require(_0x0ffc('0x2'));var rp=require(_0x0ffc('0x3'));var moment=require(_0x0ffc('0x4'));var BPromise=require(_0x0ffc('0x5'));var Mustache=require(_0x0ffc('0x6'));var util=require(_0x0ffc('0x7'));var path=require('path');var sox=require(_0x0ffc('0x8'));var csv=require(_0x0ffc('0x9'));var ejs=require(_0x0ffc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0ffc('0xb'));var jsforce=require(_0x0ffc('0xc'));var deskjs=require(_0x0ffc('0xd'));var toCsv=require(_0x0ffc('0x9'));var querystring=require('querystring');var Papa=require(_0x0ffc('0xe'));var authService=require(_0x0ffc('0xf'));var hardwareService=require(_0x0ffc('0x10'));var Redis=require(_0x0ffc('0x11'));var qs=require(_0x0ffc('0x12'));var logger=require(_0x0ffc('0x13'))(_0x0ffc('0x14'));var utils=require(_0x0ffc('0x15'));var config=require('../../config/environment');var db=require(_0x0ffc('0x16'))['db'];var jayson=require(_0x0ffc('0x17'));var client=jayson['client'][_0x0ffc('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xbf12d1,_0x9622fe,_0x59d73e,_0x15f5f8){return new BPromise(function(_0x232345,_0x47a80b){var _0x2095df=_0x15f5f8||client;return _0x2095df[_0x0ffc('0x19')](_0xbf12d1,_0x59d73e)[_0x0ffc('0x1a')](function(_0x11a5ee){logger[_0x0ffc('0x1b')]('VtigerConfiguration,\x20%s,\x20%s',_0x9622fe,_0x0ffc('0x1c'));logger['debug'](_0x0ffc('0x1d'),_0x9622fe,_0x0ffc('0x1c'),JSON['stringify'](_0x11a5ee));if(_0x11a5ee[_0x0ffc('0x1e')]){if(_0x11a5ee['error']['code']===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x9622fe,_0x11a5ee[_0x0ffc('0x1e')][_0x0ffc('0x1f')]);return _0x47a80b(_0x11a5ee[_0x0ffc('0x1e')][_0x0ffc('0x1f')]);}logger[_0x0ffc('0x1e')]('VtigerConfiguration,\x20%s,\x20%s',_0x9622fe,_0x11a5ee['error'][_0x0ffc('0x1f')]);return _0x232345(_0x11a5ee['error']['message']);}else{logger[_0x0ffc('0x1b')](_0x0ffc('0x20'),_0x9622fe,'request\x20sent');_0x232345(_0x11a5ee[_0x0ffc('0x21')][_0x0ffc('0x1f')]);}})[_0x0ffc('0x22')](function(_0x527fd4){logger['error'](_0x0ffc('0x20'),_0x9622fe,_0x527fd4);_0x47a80b(_0x527fd4);});});}function respondWithStatusCode(_0x2721b6,_0x418150){_0x418150=_0x418150||0xcc;return function(_0x948451){if(_0x948451){return _0x2721b6[_0x0ffc('0x23')](_0x418150);}return _0x2721b6['status'](_0x418150)['end']();};}function respondWithResult(_0x3e1180,_0x529415){_0x529415=_0x529415||0xc8;return function(_0x154ffe){if(_0x154ffe){return _0x3e1180['status'](_0x529415)[_0x0ffc('0x24')](_0x154ffe);}};}function respondWithFilteredResult(_0x136b0a,_0x23b14e){return function(_0x1265f5){if(_0x1265f5){var _0x3968cc=_0x1265f5['count'],_0x34bce1=_0x23b14e[_0x0ffc('0x25')],_0x20db15=_0x23b14e[_0x0ffc('0x25')]+_0x23b14e['limit'],_0x4a2794;if(_0x20db15>=_0x3968cc){_0x20db15=_0x3968cc;_0x4a2794=0xc8;}else{_0x4a2794=0xce;}_0x136b0a['status'](_0x4a2794);return _0x136b0a[_0x0ffc('0x26')]('Content-Range',_0x34bce1+'-'+_0x20db15+'/'+_0x3968cc)[_0x0ffc('0x24')](_0x1265f5);}return null;};}function patchUpdates(_0x5d3cff){return function(_0x4ece4f){try{jsonpatch[_0x0ffc('0x27')](_0x4ece4f,_0x5d3cff,!![]);}catch(_0x4f9cae){return BPromise[_0x0ffc('0x28')](_0x4f9cae);}return _0x4ece4f[_0x0ffc('0x29')]();};}function saveUpdates(_0x28c608,_0x4e813f){return function(_0x29f0cf){if(_0x29f0cf){return _0x29f0cf[_0x0ffc('0x2a')](_0x28c608)[_0x0ffc('0x1a')](function(_0x10e86d){return _0x10e86d;});}return null;};}function removeEntity(_0x51c673,_0x170390){return function(_0x557f1f){if(_0x557f1f){return _0x557f1f[_0x0ffc('0x2b')]()['then'](function(){_0x51c673[_0x0ffc('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x321fa9,_0x47a923){return function(_0x214faf){if(!_0x214faf){_0x321fa9[_0x0ffc('0x23')](0x194);}return _0x214faf;};}function handleError(_0x48fdca,_0x473d6c){_0x473d6c=_0x473d6c||0x1f4;return function(_0x313d57){logger[_0x0ffc('0x1e')](_0x313d57[_0x0ffc('0x2d')]);if(_0x313d57['name']){delete _0x313d57[_0x0ffc('0x2e')];}_0x48fdca[_0x0ffc('0x2c')](_0x473d6c)[_0x0ffc('0x2f')](_0x313d57);};}exports[_0x0ffc('0x30')]=function(_0x1edd2c,_0x6f3091){var _0x1ba0b6={},_0x597d9a={},_0x482372={'count':0x0,'rows':[]};var _0x3e3c5f=db[_0x0ffc('0x31')][_0x0ffc('0x32')];_0x597d9a['model']=_[_0x0ffc('0x33')](_0x3e3c5f);_0x597d9a[_0x0ffc('0x34')]=_[_0x0ffc('0x33')](_0x1edd2c[_0x0ffc('0x34')]);_0x597d9a['filters']=_[_0x0ffc('0x35')](_0x597d9a[_0x0ffc('0x36')],_0x597d9a[_0x0ffc('0x34')]);_0x1ba0b6[_0x0ffc('0x37')]=_[_0x0ffc('0x35')](_0x597d9a[_0x0ffc('0x36')],qs[_0x0ffc('0x38')](_0x1edd2c[_0x0ffc('0x34')][_0x0ffc('0x38')]));_0x1ba0b6['attributes']=_0x1ba0b6[_0x0ffc('0x37')][_0x0ffc('0x39')]?_0x1ba0b6[_0x0ffc('0x37')]:_0x597d9a[_0x0ffc('0x36')];if(!_0x1edd2c['query'][_0x0ffc('0x3a')](_0x0ffc('0x3b'))){_0x1ba0b6[_0x0ffc('0x3c')]=qs[_0x0ffc('0x3c')](_0x1edd2c[_0x0ffc('0x34')][_0x0ffc('0x3c')]);_0x1ba0b6[_0x0ffc('0x25')]=qs[_0x0ffc('0x25')](_0x1edd2c[_0x0ffc('0x34')]['offset']);}_0x1ba0b6[_0x0ffc('0x3d')]=qs[_0x0ffc('0x3e')](_0x1edd2c[_0x0ffc('0x34')][_0x0ffc('0x3e')]);_0x1ba0b6['where']=qs['filters'](_['pick'](_0x1edd2c[_0x0ffc('0x34')],_0x597d9a['filters']));if(_0x1edd2c[_0x0ffc('0x34')]['filter']){_0x1ba0b6[_0x0ffc('0x3f')]=_[_0x0ffc('0x40')](_0x1ba0b6['where'],{'$or':_['map'](_0x3e3c5f,function(_0x1bf431){if(_0x1bf431[_0x0ffc('0x41')]['key']!==_0x0ffc('0x42')){var _0x153a04={};_0x153a04[_0x1bf431['field']]={'$like':'%'+_0x1edd2c['query'][_0x0ffc('0x43')]+'%'};return _0x153a04;}})});}_0x1ba0b6=_['merge']({},_0x1ba0b6,_0x1edd2c[_0x0ffc('0x44')]);var _0x4928ef={'where':_0x1ba0b6['where']};return db['VtigerConfiguration'][_0x0ffc('0x45')](_0x4928ef)['then'](function(_0x1683d8){_0x482372[_0x0ffc('0x45')]=_0x1683d8;if(_0x1edd2c[_0x0ffc('0x34')]['includeAll']){_0x1ba0b6[_0x0ffc('0x46')]=[{'all':!![]}];}return db[_0x0ffc('0x31')][_0x0ffc('0x47')](_0x1ba0b6);})[_0x0ffc('0x1a')](function(_0x3ed692){_0x482372[_0x0ffc('0x48')]=_0x3ed692;return _0x482372;})[_0x0ffc('0x1a')](respondWithFilteredResult(_0x6f3091,_0x1ba0b6))[_0x0ffc('0x22')](handleError(_0x6f3091,null));};exports['show']=function(_0xd7aa22,_0x200b10){var _0x3c4b87={'raw':![],'where':{'id':_0xd7aa22[_0x0ffc('0x49')]['id']}},_0x5c5093={};_0x5c5093[_0x0ffc('0x36')]=_[_0x0ffc('0x33')](db[_0x0ffc('0x31')]['rawAttributes']);_0x5c5093[_0x0ffc('0x34')]=_[_0x0ffc('0x33')](_0xd7aa22['query']);_0x5c5093[_0x0ffc('0x4a')]=_[_0x0ffc('0x35')](_0x5c5093['model'],_0x5c5093['query']);_0x3c4b87[_0x0ffc('0x37')]=_[_0x0ffc('0x35')](_0x5c5093[_0x0ffc('0x36')],qs['fields'](_0xd7aa22['query'][_0x0ffc('0x38')]));_0x3c4b87['attributes']=_0x3c4b87[_0x0ffc('0x37')][_0x0ffc('0x39')]?_0x3c4b87[_0x0ffc('0x37')]:_0x5c5093[_0x0ffc('0x36')];if(_0xd7aa22[_0x0ffc('0x34')]['includeAll']){_0x3c4b87[_0x0ffc('0x46')]=[{'all':!![]}];}_0x3c4b87=_[_0x0ffc('0x40')]({},_0x3c4b87,_0xd7aa22[_0x0ffc('0x44')]);return db[_0x0ffc('0x31')]['find'](_0x3c4b87)['then'](handleEntityNotFound(_0x200b10,null))[_0x0ffc('0x1a')](respondWithResult(_0x200b10,null))['catch'](handleError(_0x200b10,null));};exports[_0x0ffc('0x4b')]=function(_0x4456f5,_0x52cc45){return db['VtigerConfiguration'][_0x0ffc('0x4b')](_0x4456f5[_0x0ffc('0x4c')],{})['then'](respondWithResult(_0x52cc45,0xc9))[_0x0ffc('0x22')](handleError(_0x52cc45,null));};exports[_0x0ffc('0x2a')]=function(_0x265b8d,_0x38aa4b){if(_0x265b8d[_0x0ffc('0x4c')]['id']){delete _0x265b8d[_0x0ffc('0x4c')]['id'];}return db[_0x0ffc('0x31')]['find']({'where':{'id':_0x265b8d['params']['id']}})[_0x0ffc('0x1a')](handleEntityNotFound(_0x38aa4b,null))[_0x0ffc('0x1a')](saveUpdates(_0x265b8d['body'],null))[_0x0ffc('0x1a')](respondWithResult(_0x38aa4b,null))[_0x0ffc('0x22')](handleError(_0x38aa4b,null));};exports[_0x0ffc('0x2b')]=function(_0x49fa0a,_0x14e012){return db['VtigerConfiguration']['find']({'where':{'id':_0x49fa0a[_0x0ffc('0x49')]['id']}})['then'](handleEntityNotFound(_0x14e012,null))['then'](removeEntity(_0x14e012,null))[_0x0ffc('0x22')](handleError(_0x14e012,null));};exports[_0x0ffc('0x4d')]=function(_0xd5e2cf,_0x5847c4,_0x252aa0){var _0x3320e9={};var _0x53d060={};var _0x51d53d;var _0x2a4b66;return db[_0x0ffc('0x31')][_0x0ffc('0x4e')]({'where':{'id':_0xd5e2cf[_0x0ffc('0x49')]['id']}})[_0x0ffc('0x1a')](handleEntityNotFound(_0x5847c4,null))['then'](function(_0x348874){if(_0x348874){_0x51d53d=_0x348874;_0x53d060['model']=_['keys'](db[_0x0ffc('0x4f')][_0x0ffc('0x32')]);_0x53d060[_0x0ffc('0x34')]=_['keys'](_0xd5e2cf['query']);_0x53d060['filters']=_[_0x0ffc('0x35')](_0x53d060[_0x0ffc('0x36')],_0x53d060['query']);_0x3320e9[_0x0ffc('0x37')]=_[_0x0ffc('0x35')](_0x53d060['model'],qs[_0x0ffc('0x38')](_0xd5e2cf[_0x0ffc('0x34')][_0x0ffc('0x38')]));_0x3320e9['attributes']=_0x3320e9[_0x0ffc('0x37')][_0x0ffc('0x39')]?_0x3320e9[_0x0ffc('0x37')]:_0x53d060[_0x0ffc('0x36')];_0x3320e9['order']=qs['sort'](_0xd5e2cf[_0x0ffc('0x34')]['sort']);_0x3320e9[_0x0ffc('0x3f')]=qs[_0x0ffc('0x4a')](_['pick'](_0xd5e2cf[_0x0ffc('0x34')],_0x53d060['filters']));if(_0xd5e2cf[_0x0ffc('0x34')][_0x0ffc('0x43')]){_0x3320e9['where']=_['merge'](_0x3320e9[_0x0ffc('0x3f')],{'$or':_[_0x0ffc('0x50')](_0x3320e9[_0x0ffc('0x37')],function(_0x26f3d8){var _0x21bb09={};_0x21bb09[_0x26f3d8]={'$like':'%'+_0xd5e2cf[_0x0ffc('0x34')]['filter']+'%'};return _0x21bb09;})});}_0x3320e9=_['merge']({},_0x3320e9,_0xd5e2cf[_0x0ffc('0x44')]);return _0x51d53d[_0x0ffc('0x4d')](_0x3320e9);}})[_0x0ffc('0x1a')](function(_0x18dc97){if(_0x18dc97){_0x2a4b66=_0x18dc97[_0x0ffc('0x39')];if(!_0xd5e2cf['query']['hasOwnProperty'](_0x0ffc('0x3b'))){_0x3320e9[_0x0ffc('0x3c')]=qs[_0x0ffc('0x3c')](_0xd5e2cf['query'][_0x0ffc('0x3c')]);_0x3320e9[_0x0ffc('0x25')]=qs[_0x0ffc('0x25')](_0xd5e2cf[_0x0ffc('0x34')][_0x0ffc('0x25')]);}return _0x51d53d['getFields'](_0x3320e9);}})[_0x0ffc('0x1a')](function(_0x435ea9){if(_0x435ea9){return _0x435ea9?{'count':_0x2a4b66,'rows':_0x435ea9}:null;}})[_0x0ffc('0x1a')](respondWithResult(_0x5847c4,null))[_0x0ffc('0x22')](handleError(_0x5847c4,null));};exports['getSubjects']=function(_0x228e23,_0x463132,_0x5db7ba){var _0x24dd64={};var _0x589e42={};var _0xc8e26d;var _0x416aad;return db[_0x0ffc('0x31')][_0x0ffc('0x4e')]({'where':{'id':_0x228e23[_0x0ffc('0x49')]['id']}})[_0x0ffc('0x1a')](handleEntityNotFound(_0x463132,null))[_0x0ffc('0x1a')](function(_0x53ee34){if(_0x53ee34){_0xc8e26d=_0x53ee34;_0x589e42[_0x0ffc('0x36')]=_['keys'](db[_0x0ffc('0x4f')][_0x0ffc('0x32')]);_0x589e42['query']=_[_0x0ffc('0x33')](_0x228e23[_0x0ffc('0x34')]);_0x589e42[_0x0ffc('0x4a')]=_[_0x0ffc('0x35')](_0x589e42[_0x0ffc('0x36')],_0x589e42[_0x0ffc('0x34')]);_0x24dd64[_0x0ffc('0x37')]=_[_0x0ffc('0x35')](_0x589e42['model'],qs[_0x0ffc('0x38')](_0x228e23[_0x0ffc('0x34')][_0x0ffc('0x38')]));_0x24dd64[_0x0ffc('0x37')]=_0x24dd64[_0x0ffc('0x37')][_0x0ffc('0x39')]?_0x24dd64[_0x0ffc('0x37')]:_0x589e42[_0x0ffc('0x36')];_0x24dd64['order']=qs[_0x0ffc('0x3e')](_0x228e23[_0x0ffc('0x34')]['sort']);_0x24dd64[_0x0ffc('0x3f')]=qs['filters'](_[_0x0ffc('0x51')](_0x228e23['query'],_0x589e42[_0x0ffc('0x4a')]));if(_0x228e23['query'][_0x0ffc('0x43')]){_0x24dd64[_0x0ffc('0x3f')]=_[_0x0ffc('0x40')](_0x24dd64['where'],{'$or':_['map'](_0x24dd64[_0x0ffc('0x37')],function(_0x512dde){var _0x56a68b={};_0x56a68b[_0x512dde]={'$like':'%'+_0x228e23[_0x0ffc('0x34')][_0x0ffc('0x43')]+'%'};return _0x56a68b;})});}_0x24dd64=_['merge']({},_0x24dd64,_0x228e23[_0x0ffc('0x44')]);return _0xc8e26d['getSubjects'](_0x24dd64);}})[_0x0ffc('0x1a')](function(_0x396992){if(_0x396992){_0x416aad=_0x396992[_0x0ffc('0x39')];if(!_0x228e23['query'][_0x0ffc('0x3a')](_0x0ffc('0x3b'))){_0x24dd64[_0x0ffc('0x3c')]=qs[_0x0ffc('0x3c')](_0x228e23[_0x0ffc('0x34')]['limit']);_0x24dd64[_0x0ffc('0x25')]=qs[_0x0ffc('0x25')](_0x228e23['query'][_0x0ffc('0x25')]);}return _0xc8e26d['getSubjects'](_0x24dd64);}})[_0x0ffc('0x1a')](function(_0x100d6c){if(_0x100d6c){return _0x100d6c?{'count':_0x416aad,'rows':_0x100d6c}:null;}})[_0x0ffc('0x1a')](respondWithResult(_0x463132,null))[_0x0ffc('0x22')](handleError(_0x463132,null));};exports[_0x0ffc('0x52')]=function(_0x3314be,_0x5956a0,_0x355a70){var _0x1034db={};var _0x52dd03={};var _0x7789d4;var _0x418de1;return db[_0x0ffc('0x31')][_0x0ffc('0x4e')]({'where':{'id':_0x3314be[_0x0ffc('0x49')]['id']}})[_0x0ffc('0x1a')](handleEntityNotFound(_0x5956a0,null))[_0x0ffc('0x1a')](function(_0x2fbe10){if(_0x2fbe10){_0x7789d4=_0x2fbe10;_0x52dd03[_0x0ffc('0x36')]=_[_0x0ffc('0x33')](db['VtigerField']['rawAttributes']);_0x52dd03['query']=_[_0x0ffc('0x33')](_0x3314be[_0x0ffc('0x34')]);_0x52dd03[_0x0ffc('0x4a')]=_[_0x0ffc('0x35')](_0x52dd03[_0x0ffc('0x36')],_0x52dd03['query']);_0x1034db[_0x0ffc('0x37')]=_[_0x0ffc('0x35')](_0x52dd03[_0x0ffc('0x36')],qs[_0x0ffc('0x38')](_0x3314be['query'][_0x0ffc('0x38')]));_0x1034db[_0x0ffc('0x37')]=_0x1034db[_0x0ffc('0x37')][_0x0ffc('0x39')]?_0x1034db[_0x0ffc('0x37')]:_0x52dd03[_0x0ffc('0x36')];_0x1034db[_0x0ffc('0x3d')]=qs[_0x0ffc('0x3e')](_0x3314be[_0x0ffc('0x34')]['sort']);_0x1034db[_0x0ffc('0x3f')]=qs[_0x0ffc('0x4a')](_['pick'](_0x3314be[_0x0ffc('0x34')],_0x52dd03[_0x0ffc('0x4a')]));if(_0x3314be[_0x0ffc('0x34')][_0x0ffc('0x43')]){_0x1034db[_0x0ffc('0x3f')]=_['merge'](_0x1034db[_0x0ffc('0x3f')],{'$or':_[_0x0ffc('0x50')](_0x1034db['attributes'],function(_0x5e62ea){var _0xe3c7e1={};_0xe3c7e1[_0x5e62ea]={'$like':'%'+_0x3314be[_0x0ffc('0x34')]['filter']+'%'};return _0xe3c7e1;})});}_0x1034db=_['merge']({},_0x1034db,_0x3314be[_0x0ffc('0x44')]);return _0x7789d4[_0x0ffc('0x52')](_0x1034db);}})[_0x0ffc('0x1a')](function(_0x365ca7){if(_0x365ca7){_0x418de1=_0x365ca7['length'];if(!_0x3314be[_0x0ffc('0x34')][_0x0ffc('0x3a')](_0x0ffc('0x3b'))){_0x1034db['limit']=qs[_0x0ffc('0x3c')](_0x3314be['query'][_0x0ffc('0x3c')]);_0x1034db[_0x0ffc('0x25')]=qs[_0x0ffc('0x25')](_0x3314be[_0x0ffc('0x34')][_0x0ffc('0x25')]);}return _0x7789d4['getDescriptions'](_0x1034db);}})[_0x0ffc('0x1a')](function(_0xed11c7){if(_0xed11c7){return _0xed11c7?{'count':_0x418de1,'rows':_0xed11c7}:null;}})[_0x0ffc('0x1a')](respondWithResult(_0x5956a0,null))[_0x0ffc('0x22')](handleError(_0x5956a0,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index bcbf5cc..96cf42c 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 _0xc993=['exports','define','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intVtigerConfiguration.attributes'];(function(_0x4443ff,_0x24c111){var _0x3fae10=function(_0x40ff9c){while(--_0x40ff9c){_0x4443ff['push'](_0x4443ff['shift']());}};_0x3fae10(++_0x24c111);}(_0xc993,0x10b));var _0x3c99=function(_0x9b4cbc,_0x894a4f){_0x9b4cbc=_0x9b4cbc-0x0;var _0x43dcc5=_0xc993[_0x9b4cbc];return _0x43dcc5;};'use strict';var _=require(_0x3c99('0x0'));var util=require(_0x3c99('0x1'));var logger=require(_0x3c99('0x2'))(_0x3c99('0x3'));var moment=require(_0x3c99('0x4'));var BPromise=require(_0x3c99('0x5'));var rp=require(_0x3c99('0x6'));var attributes=require(_0x3c99('0x7'));module[_0x3c99('0x8')]=function(_0x3ce845,_0xeb9c87){return _0x3ce845[_0x3c99('0x9')]('VtigerConfiguration',attributes,{'tableName':_0x3c99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf904=['util','../../config/logger','api','request-promise','./intVtigerConfiguration.attributes','exports','lodash'];(function(_0x2fe523,_0x40f413){var _0x3afb74=function(_0x3c0157){while(--_0x3c0157){_0x2fe523['push'](_0x2fe523['shift']());}};_0x3afb74(++_0x40f413);}(_0xf904,0x18e));var _0x4f90=function(_0x8956db,_0x565a5f){_0x8956db=_0x8956db-0x0;var _0x175a41=_0xf904[_0x8956db];return _0x175a41;};'use strict';var _=require(_0x4f90('0x0'));var util=require(_0x4f90('0x1'));var logger=require(_0x4f90('0x2'))(_0x4f90('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4f90('0x4'));var attributes=require(_0x4f90('0x5'));module[_0x4f90('0x6')]=function(_0x2ec3a7,_0x39d09b){return _0x2ec3a7['define']('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index e2999d7..d088c0f 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 _0x597b=['http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x9d0cec,_0x56c642){var _0x45f456=function(_0x121024){while(--_0x121024){_0x9d0cec['push'](_0x9d0cec['shift']());}};_0x45f456(++_0x56c642);}(_0x597b,0x96));var _0xb597=function(_0x47a105,_0x5c14b5){_0x47a105=_0x47a105-0x0;var _0x50c724=_0x597b[_0x47a105];return _0x50c724;};'use strict';var _=require('lodash');var util=require(_0xb597('0x0'));var moment=require(_0xb597('0x1'));var BPromise=require(_0xb597('0x2'));var rs=require(_0xb597('0x3'));var fs=require('fs');var Redis=require(_0xb597('0x4'));var db=require(_0xb597('0x5'))['db'];var utils=require(_0xb597('0x6'));var logger=require(_0xb597('0x7'))('rpc');var config=require(_0xb597('0x8'));var jayson=require(_0xb597('0x9'));var client=jayson[_0xb597('0xa')][_0xb597('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x397160,_0x3e2e2c,_0xa5f117){return new BPromise(function(_0x226b30,_0x3e7816){return client[_0xb597('0xc')](_0x397160,_0xa5f117)[_0xb597('0xd')](function(_0x46af7e){logger[_0xb597('0xe')](_0xb597('0xf'),_0x3e2e2c,'request\x20sent');logger[_0xb597('0x10')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3e2e2c,_0xb597('0x11'),JSON[_0xb597('0x12')](_0x46af7e));if(_0x46af7e['error']){if(_0x46af7e['error'][_0xb597('0x13')]===0x1f4){logger[_0xb597('0x14')](_0xb597('0xf'),_0x3e2e2c,_0x46af7e[_0xb597('0x14')][_0xb597('0x15')]);return _0x3e7816(_0x46af7e['error'][_0xb597('0x15')]);}logger[_0xb597('0x14')](_0xb597('0xf'),_0x3e2e2c,_0x46af7e[_0xb597('0x14')][_0xb597('0x15')]);return _0x226b30(_0x46af7e[_0xb597('0x14')][_0xb597('0x15')]);}else{logger[_0xb597('0xe')](_0xb597('0xf'),_0x3e2e2c,'request\x20sent');_0x226b30(_0x46af7e[_0xb597('0x16')][_0xb597('0x15')]);}})['catch'](function(_0x5d8301){logger['error'](_0xb597('0xf'),_0x3e2e2c,_0x5d8301);_0x3e7816(_0x5d8301);});});} \ No newline at end of file +var _0x850d=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0xef1c93,_0x357079){var _0x4f7c0e=function(_0x1b7016){while(--_0x1b7016){_0xef1c93['push'](_0xef1c93['shift']());}};_0x4f7c0e(++_0x357079);}(_0x850d,0xe1));var _0xd850=function(_0x46bac8,_0x33ca8c){_0x46bac8=_0x46bac8-0x0;var _0x3b196c=_0x850d[_0x46bac8];return _0x3b196c;};'use strict';var _=require('lodash');var util=require(_0xd850('0x0'));var moment=require(_0xd850('0x1'));var BPromise=require(_0xd850('0x2'));var rs=require(_0xd850('0x3'));var fs=require('fs');var Redis=require(_0xd850('0x4'));var db=require(_0xd850('0x5'))['db'];var utils=require(_0xd850('0x6'));var logger=require('../../config/logger')(_0xd850('0x7'));var config=require(_0xd850('0x8'));var jayson=require(_0xd850('0x9'));var client=jayson[_0xd850('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27349e,_0x20f0ef,_0x19d2c2){return new BPromise(function(_0x35215b,_0x3cd3f6){return client[_0xd850('0xb')](_0x27349e,_0x19d2c2)['then'](function(_0x443555){logger[_0xd850('0xc')](_0xd850('0xd'),_0x20f0ef,_0xd850('0xe'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x20f0ef,'request\x20sent',JSON['stringify'](_0x443555));if(_0x443555['error']){if(_0x443555[_0xd850('0xf')][_0xd850('0x10')]===0x1f4){logger[_0xd850('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x20f0ef,_0x443555[_0xd850('0xf')]['message']);return _0x3cd3f6(_0x443555['error']['message']);}logger[_0xd850('0xf')](_0xd850('0xd'),_0x20f0ef,_0x443555[_0xd850('0xf')][_0xd850('0x11')]);return _0x35215b(_0x443555[_0xd850('0xf')]['message']);}else{logger['info'](_0xd850('0xd'),_0x20f0ef,_0xd850('0xe'));_0x35215b(_0x443555[_0xd850('0x12')][_0xd850('0x11')]);}})[_0xd850('0x13')](function(_0x1f9a4d){logger[_0xd850('0xf')](_0xd850('0xd'),_0x20f0ef,_0x1f9a4d);_0x3cd3f6(_0x1f9a4d);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index cf7119c..d346a3e 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 _0x92ad=['post','create','put','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id','show'];(function(_0x272d77,_0x4dc87f){var _0x1fd6ef=function(_0x4c4b1b){while(--_0x4c4b1b){_0x272d77['push'](_0x272d77['shift']());}};_0x1fd6ef(++_0x4dc87f);}(_0x92ad,0x137));var _0xd92a=function(_0x2089cb,_0x5ef541){_0x2089cb=_0x2089cb-0x0;var _0x1d3cc2=_0x92ad[_0x2089cb];return _0x1d3cc2;};'use strict';var multer=require(_0xd92a('0x0'));var util=require(_0xd92a('0x1'));var path=require(_0xd92a('0x2'));var timeout=require(_0xd92a('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xd92a('0x4'));var interaction=require(_0xd92a('0x5'));var config=require(_0xd92a('0x6'));var controller=require(_0xd92a('0x7'));router['get']('/',auth[_0xd92a('0x8')](),controller[_0xd92a('0x9')]);router[_0xd92a('0xa')](_0xd92a('0xb'),auth['isAuthenticated'](),controller[_0xd92a('0xc')]);router[_0xd92a('0xd')]('/',auth[_0xd92a('0x8')](),controller[_0xd92a('0xe')]);router[_0xd92a('0xf')](_0xd92a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xd92a('0x10')]('/:id',auth[_0xd92a('0x8')](),controller[_0xd92a('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1fef=['show','post','/:id','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x56a1d0,_0x16a437){var _0x5952c4=function(_0x3a4e4e){while(--_0x3a4e4e){_0x56a1d0['push'](_0x56a1d0['shift']());}};_0x5952c4(++_0x16a437);}(_0x1fef,0x155));var _0xf1fe=function(_0x26d850,_0x4c6832){_0x26d850=_0x26d850-0x0;var _0x3e020c=_0x1fef[_0x26d850];return _0x3e020c;};'use strict';var multer=require(_0xf1fe('0x0'));var util=require(_0xf1fe('0x1'));var path=require(_0xf1fe('0x2'));var timeout=require(_0xf1fe('0x3'));var express=require('express');var router=express[_0xf1fe('0x4')]();var auth=require(_0xf1fe('0x5'));var interaction=require(_0xf1fe('0x6'));var config=require(_0xf1fe('0x7'));var controller=require('./intVtigerField.controller');router[_0xf1fe('0x8')]('/',auth[_0xf1fe('0x9')](),controller[_0xf1fe('0xa')]);router[_0xf1fe('0x8')]('/:id',auth[_0xf1fe('0x9')](),controller[_0xf1fe('0xb')]);router[_0xf1fe('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf1fe('0xd'),auth[_0xf1fe('0x9')](),controller['update']);router[_0xf1fe('0xe')](_0xf1fe('0xd'),auth['isAuthenticated'](),controller[_0xf1fe('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 98b35ce..eb82cb0 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 _0x91a7=['STRING','exports','ENUM','string','customVariable'];(function(_0x13305e,_0x145dfc){var _0x377fbc=function(_0x220f67){while(--_0x220f67){_0x13305e['push'](_0x13305e['shift']());}};_0x377fbc(++_0x145dfc);}(_0x91a7,0xe7));var _0x791a=function(_0x2e56d6,_0x14d3bd){_0x2e56d6=_0x2e56d6-0x0;var _0x111d87=_0x91a7[_0x2e56d6];return _0x111d87;};'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 +var _0x5b02=['BOOLEAN','sequelize','exports','ENUM','string','keyValue','STRING','variable'];(function(_0x305550,_0x567d29){var _0x54b500=function(_0x141a6b){while(--_0x141a6b){_0x305550['push'](_0x305550['shift']());}};_0x54b500(++_0x567d29);}(_0x5b02,0xe9));var _0x25b0=function(_0x30d0e7,_0x2e914f){_0x30d0e7=_0x30d0e7-0x0;var _0x3592b7=_0x5b02[_0x30d0e7];return _0x3592b7;};'use strict';var Sequelize=require(_0x25b0('0x0'));module[_0x25b0('0x1')]={'type':{'type':Sequelize[_0x25b0('0x2')](_0x25b0('0x3'),'variable','customVariable',_0x25b0('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x25b0('0x5')]},'key':{'type':Sequelize[_0x25b0('0x5')]},'keyType':{'type':Sequelize[_0x25b0('0x2')](_0x25b0('0x3'),_0x25b0('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x25b0('0x5')]},'idField':{'type':Sequelize[_0x25b0('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x25b0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 7b5ac22..dcf86ec 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 _0xe678=['merge','VIRTUAL','field','options','VtigerField','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','set','Content-Range','update','then','destroy','error','name','send','index','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','sort','where','pick','filter'];(function(_0x38ec9b,_0x30d00e){var _0x209616=function(_0x316a17){while(--_0x316a17){_0x38ec9b['push'](_0x38ec9b['shift']());}};_0x209616(++_0x30d00e);}(_0xe678,0x95));var _0x8e67=function(_0x2eef88,_0x3b0d9d){_0x2eef88=_0x2eef88-0x0;var _0xf45e81=_0xe678[_0x2eef88];return _0xf45e81;};'use strict';var pdf=require(_0x8e67('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8e67('0x1'));var jsonpatch=require(_0x8e67('0x2'));var rp=require(_0x8e67('0x3'));var moment=require(_0x8e67('0x4'));var BPromise=require(_0x8e67('0x5'));var Mustache=require(_0x8e67('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8e67('0x7'));var csv=require('to-csv');var ejs=require(_0x8e67('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8e67('0x9'));var crypto=require(_0x8e67('0xa'));var jsforce=require(_0x8e67('0xb'));var deskjs=require(_0x8e67('0xc'));var toCsv=require(_0x8e67('0xd'));var querystring=require(_0x8e67('0xe'));var Papa=require('papaparse');var authService=require(_0x8e67('0xf'));var hardwareService=require(_0x8e67('0x10'));var Redis=require(_0x8e67('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x8e67('0x12'))(_0x8e67('0x13'));var utils=require(_0x8e67('0x14'));var config=require(_0x8e67('0x15'));var db=require(_0x8e67('0x16'))['db'];function respondWithStatusCode(_0x58cae7,_0x96f3f){_0x96f3f=_0x96f3f||0xcc;return function(_0x5b45c0){if(_0x5b45c0){return _0x58cae7['sendStatus'](_0x96f3f);}return _0x58cae7['status'](_0x96f3f)[_0x8e67('0x17')]();};}function respondWithResult(_0x41b753,_0x3395c4){_0x3395c4=_0x3395c4||0xc8;return function(_0x37b974){if(_0x37b974){return _0x41b753[_0x8e67('0x18')](_0x3395c4)[_0x8e67('0x19')](_0x37b974);}};}function respondWithFilteredResult(_0x35ebbc,_0xf36c44){return function(_0x5b53d0){if(_0x5b53d0){var _0x408c93=_0x5b53d0[_0x8e67('0x1a')],_0x91ae28=_0xf36c44['offset'],_0x44549b=_0xf36c44['offset']+_0xf36c44['limit'],_0x3f21b1;if(_0x44549b>=_0x408c93){_0x44549b=_0x408c93;_0x3f21b1=0xc8;}else{_0x3f21b1=0xce;}_0x35ebbc[_0x8e67('0x18')](_0x3f21b1);return _0x35ebbc[_0x8e67('0x1b')](_0x8e67('0x1c'),_0x91ae28+'-'+_0x44549b+'/'+_0x408c93)[_0x8e67('0x19')](_0x5b53d0);}return null;};}function patchUpdates(_0x43ed48){return function(_0x2d8dec){try{jsonpatch['apply'](_0x2d8dec,_0x43ed48,!![]);}catch(_0x130ffe){return BPromise['reject'](_0x130ffe);}return _0x2d8dec['save']();};}function saveUpdates(_0x2b1f83,_0x270657){return function(_0x4f8836){if(_0x4f8836){return _0x4f8836[_0x8e67('0x1d')](_0x2b1f83)[_0x8e67('0x1e')](function(_0x539aee){return _0x539aee;});}return null;};}function removeEntity(_0x1a4fc2,_0x2aa771){return function(_0x3ccbda){if(_0x3ccbda){return _0x3ccbda[_0x8e67('0x1f')]()[_0x8e67('0x1e')](function(){_0x1a4fc2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b0e08,_0x11f3fd){return function(_0xf66e13){if(!_0xf66e13){_0x1b0e08['sendStatus'](0x194);}return _0xf66e13;};}function handleError(_0x1f5a8a,_0x396c09){_0x396c09=_0x396c09||0x1f4;return function(_0x42a317){logger[_0x8e67('0x20')](_0x42a317['stack']);if(_0x42a317[_0x8e67('0x21')]){delete _0x42a317[_0x8e67('0x21')];}_0x1f5a8a['status'](_0x396c09)[_0x8e67('0x22')](_0x42a317);};}exports[_0x8e67('0x23')]=function(_0x16a320,_0x173bd3){var _0x15b75d={},_0x7bac28={},_0x245837={'count':0x0,'rows':[]};var _0x1cd481=db['VtigerField'][_0x8e67('0x24')];_0x7bac28[_0x8e67('0x25')]=_[_0x8e67('0x26')](_0x1cd481);_0x7bac28[_0x8e67('0x27')]=_['keys'](_0x16a320['query']);_0x7bac28[_0x8e67('0x28')]=_['intersection'](_0x7bac28[_0x8e67('0x25')],_0x7bac28['query']);_0x15b75d[_0x8e67('0x29')]=_['intersection'](_0x7bac28[_0x8e67('0x25')],qs[_0x8e67('0x2a')](_0x16a320[_0x8e67('0x27')]['fields']));_0x15b75d['attributes']=_0x15b75d[_0x8e67('0x29')][_0x8e67('0x2b')]?_0x15b75d[_0x8e67('0x29')]:_0x7bac28[_0x8e67('0x25')];if(!_0x16a320[_0x8e67('0x27')][_0x8e67('0x2c')](_0x8e67('0x2d'))){_0x15b75d[_0x8e67('0x2e')]=qs[_0x8e67('0x2e')](_0x16a320[_0x8e67('0x27')][_0x8e67('0x2e')]);_0x15b75d['offset']=qs[_0x8e67('0x2f')](_0x16a320[_0x8e67('0x27')][_0x8e67('0x2f')]);}_0x15b75d['order']=qs[_0x8e67('0x30')](_0x16a320[_0x8e67('0x27')]['sort']);_0x15b75d[_0x8e67('0x31')]=qs[_0x8e67('0x28')](_[_0x8e67('0x32')](_0x16a320[_0x8e67('0x27')],_0x7bac28[_0x8e67('0x28')]));if(_0x16a320[_0x8e67('0x27')][_0x8e67('0x33')]){_0x15b75d[_0x8e67('0x31')]=_[_0x8e67('0x34')](_0x15b75d[_0x8e67('0x31')],{'$or':_['map'](_0x1cd481,function(_0x102f19){if(_0x102f19['type']['key']!==_0x8e67('0x35')){var _0xe149d5={};_0xe149d5[_0x102f19[_0x8e67('0x36')]]={'$like':'%'+_0x16a320['query'][_0x8e67('0x33')]+'%'};return _0xe149d5;}})});}_0x15b75d=_[_0x8e67('0x34')]({},_0x15b75d,_0x16a320[_0x8e67('0x37')]);var _0x3111a2={'where':_0x15b75d[_0x8e67('0x31')]};return db[_0x8e67('0x38')][_0x8e67('0x1a')](_0x3111a2)[_0x8e67('0x1e')](function(_0x58a05f){_0x245837['count']=_0x58a05f;if(_0x16a320[_0x8e67('0x27')][_0x8e67('0x39')]){_0x15b75d[_0x8e67('0x3a')]=[{'all':!![]}];}return db[_0x8e67('0x38')][_0x8e67('0x3b')](_0x15b75d);})[_0x8e67('0x1e')](function(_0x5e59a4){_0x245837[_0x8e67('0x3c')]=_0x5e59a4;return _0x245837;})[_0x8e67('0x1e')](respondWithFilteredResult(_0x173bd3,_0x15b75d))[_0x8e67('0x3d')](handleError(_0x173bd3,null));};exports['show']=function(_0x1e2b50,_0x3ab09e){var _0x5551f5={'raw':!![],'where':{'id':_0x1e2b50[_0x8e67('0x3e')]['id']}},_0x43e479={};_0x43e479[_0x8e67('0x25')]=_[_0x8e67('0x26')](db[_0x8e67('0x38')][_0x8e67('0x24')]);_0x43e479['query']=_[_0x8e67('0x26')](_0x1e2b50['query']);_0x43e479[_0x8e67('0x28')]=_['intersection'](_0x43e479['model'],_0x43e479[_0x8e67('0x27')]);_0x5551f5['attributes']=_[_0x8e67('0x3f')](_0x43e479[_0x8e67('0x25')],qs['fields'](_0x1e2b50[_0x8e67('0x27')]['fields']));_0x5551f5[_0x8e67('0x29')]=_0x5551f5['attributes'][_0x8e67('0x2b')]?_0x5551f5[_0x8e67('0x29')]:_0x43e479[_0x8e67('0x25')];if(_0x1e2b50['query'][_0x8e67('0x39')]){_0x5551f5[_0x8e67('0x3a')]=[{'all':!![]}];}_0x5551f5=_[_0x8e67('0x34')]({},_0x5551f5,_0x1e2b50['options']);return db[_0x8e67('0x38')][_0x8e67('0x40')](_0x5551f5)[_0x8e67('0x1e')](handleEntityNotFound(_0x3ab09e,null))[_0x8e67('0x1e')](respondWithResult(_0x3ab09e,null))[_0x8e67('0x3d')](handleError(_0x3ab09e,null));};exports[_0x8e67('0x41')]=function(_0x288c68,_0x560b02){return db[_0x8e67('0x38')][_0x8e67('0x41')](_0x288c68['body'],{})['then'](respondWithResult(_0x560b02,0xc9))[_0x8e67('0x3d')](handleError(_0x560b02,null));};exports[_0x8e67('0x1d')]=function(_0xd1a905,_0x5ab61e){if(_0xd1a905[_0x8e67('0x42')]['id']){delete _0xd1a905[_0x8e67('0x42')]['id'];}return db[_0x8e67('0x38')]['find']({'where':{'id':_0xd1a905[_0x8e67('0x3e')]['id']}})[_0x8e67('0x1e')](handleEntityNotFound(_0x5ab61e,null))[_0x8e67('0x1e')](saveUpdates(_0xd1a905[_0x8e67('0x42')],null))[_0x8e67('0x1e')](respondWithResult(_0x5ab61e,null))[_0x8e67('0x3d')](handleError(_0x5ab61e,null));};exports[_0x8e67('0x1f')]=function(_0x5f278d,_0x4bf548){return db[_0x8e67('0x38')]['find']({'where':{'id':_0x5f278d['params']['id']}})[_0x8e67('0x1e')](handleEntityNotFound(_0x4bf548,null))[_0x8e67('0x1e')](removeEntity(_0x4bf548,null))[_0x8e67('0x3d')](handleError(_0x4bf548,null));}; \ No newline at end of file +var _0xd2be=['params','rawAttributes','options','find','create','body','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../mysqldb','status','end','json','count','offset','apply','reject','save','update','then','destroy','sendStatus','error','name','index','VtigerField','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','key','field','includeAll','include','findAll','rows','catch','show'];(function(_0x52c5cc,_0x1d948f){var _0x4ab346=function(_0x3d941d){while(--_0x3d941d){_0x52c5cc['push'](_0x52c5cc['shift']());}};_0x4ab346(++_0x1d948f);}(_0xd2be,0x86));var _0xed2b=function(_0x9a7796,_0xe30784){_0x9a7796=_0x9a7796-0x0;var _0x2e73a0=_0xd2be[_0x9a7796];return _0x2e73a0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xed2b('0x0'));var zipdir=require(_0xed2b('0x1'));var jsonpatch=require(_0xed2b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xed2b('0x3'));var Mustache=require(_0xed2b('0x4'));var util=require(_0xed2b('0x5'));var path=require(_0xed2b('0x6'));var sox=require('sox');var csv=require(_0xed2b('0x7'));var ejs=require(_0xed2b('0x8'));var fs=require('fs');var _=require(_0xed2b('0x9'));var squel=require(_0xed2b('0xa'));var crypto=require('crypto');var jsforce=require(_0xed2b('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xed2b('0xc'));var authService=require(_0xed2b('0xd'));var hardwareService=require(_0xed2b('0xe'));var Redis=require(_0xed2b('0xf'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xed2b('0x10'))['db'];function respondWithStatusCode(_0x1421c4,_0x5df3d9){_0x5df3d9=_0x5df3d9||0xcc;return function(_0x3bda34){if(_0x3bda34){return _0x1421c4['sendStatus'](_0x5df3d9);}return _0x1421c4[_0xed2b('0x11')](_0x5df3d9)[_0xed2b('0x12')]();};}function respondWithResult(_0x366d2a,_0x111901){_0x111901=_0x111901||0xc8;return function(_0x3dd18b){if(_0x3dd18b){return _0x366d2a[_0xed2b('0x11')](_0x111901)[_0xed2b('0x13')](_0x3dd18b);}};}function respondWithFilteredResult(_0x5a08b0,_0x4ae146){return function(_0x1a6b66){if(_0x1a6b66){var _0xa6c74c=_0x1a6b66[_0xed2b('0x14')],_0x4fcf61=_0x4ae146[_0xed2b('0x15')],_0x4c9198=_0x4ae146['offset']+_0x4ae146['limit'],_0x13119d;if(_0x4c9198>=_0xa6c74c){_0x4c9198=_0xa6c74c;_0x13119d=0xc8;}else{_0x13119d=0xce;}_0x5a08b0[_0xed2b('0x11')](_0x13119d);return _0x5a08b0['set']('Content-Range',_0x4fcf61+'-'+_0x4c9198+'/'+_0xa6c74c)[_0xed2b('0x13')](_0x1a6b66);}return null;};}function patchUpdates(_0x572b39){return function(_0x173b44){try{jsonpatch[_0xed2b('0x16')](_0x173b44,_0x572b39,!![]);}catch(_0x29dd2e){return BPromise[_0xed2b('0x17')](_0x29dd2e);}return _0x173b44[_0xed2b('0x18')]();};}function saveUpdates(_0x52c32d,_0x545045){return function(_0x39f1a2){if(_0x39f1a2){return _0x39f1a2[_0xed2b('0x19')](_0x52c32d)[_0xed2b('0x1a')](function(_0xcd06b9){return _0xcd06b9;});}return null;};}function removeEntity(_0x42e92a,_0x40668a){return function(_0x21306b){if(_0x21306b){return _0x21306b[_0xed2b('0x1b')]()[_0xed2b('0x1a')](function(){_0x42e92a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53911d,_0x1a244e){return function(_0xfc2f52){if(!_0xfc2f52){_0x53911d[_0xed2b('0x1c')](0x194);}return _0xfc2f52;};}function handleError(_0x4deda7,_0x15d036){_0x15d036=_0x15d036||0x1f4;return function(_0x313c13){logger[_0xed2b('0x1d')](_0x313c13['stack']);if(_0x313c13['name']){delete _0x313c13[_0xed2b('0x1e')];}_0x4deda7[_0xed2b('0x11')](_0x15d036)['send'](_0x313c13);};}exports[_0xed2b('0x1f')]=function(_0x2f4755,_0x50e57e){var _0x169135={},_0x5ef8c1={},_0x51ae98={'count':0x0,'rows':[]};var _0x56c741=db[_0xed2b('0x20')]['rawAttributes'];_0x5ef8c1[_0xed2b('0x21')]=_[_0xed2b('0x22')](_0x56c741);_0x5ef8c1['query']=_[_0xed2b('0x22')](_0x2f4755[_0xed2b('0x23')]);_0x5ef8c1['filters']=_[_0xed2b('0x24')](_0x5ef8c1[_0xed2b('0x21')],_0x5ef8c1[_0xed2b('0x23')]);_0x169135[_0xed2b('0x25')]=_['intersection'](_0x5ef8c1[_0xed2b('0x21')],qs[_0xed2b('0x26')](_0x2f4755[_0xed2b('0x23')][_0xed2b('0x26')]));_0x169135[_0xed2b('0x25')]=_0x169135[_0xed2b('0x25')][_0xed2b('0x27')]?_0x169135[_0xed2b('0x25')]:_0x5ef8c1[_0xed2b('0x21')];if(!_0x2f4755[_0xed2b('0x23')][_0xed2b('0x28')]('nolimit')){_0x169135[_0xed2b('0x29')]=qs[_0xed2b('0x29')](_0x2f4755[_0xed2b('0x23')][_0xed2b('0x29')]);_0x169135[_0xed2b('0x15')]=qs['offset'](_0x2f4755[_0xed2b('0x23')][_0xed2b('0x15')]);}_0x169135[_0xed2b('0x2a')]=qs['sort'](_0x2f4755[_0xed2b('0x23')][_0xed2b('0x2b')]);_0x169135[_0xed2b('0x2c')]=qs[_0xed2b('0x2d')](_[_0xed2b('0x2e')](_0x2f4755[_0xed2b('0x23')],_0x5ef8c1[_0xed2b('0x2d')]));if(_0x2f4755['query'][_0xed2b('0x2f')]){_0x169135[_0xed2b('0x2c')]=_[_0xed2b('0x30')](_0x169135[_0xed2b('0x2c')],{'$or':_[_0xed2b('0x31')](_0x56c741,function(_0x394314){if(_0x394314['type'][_0xed2b('0x32')]!=='VIRTUAL'){var _0xa5a57a={};_0xa5a57a[_0x394314[_0xed2b('0x33')]]={'$like':'%'+_0x2f4755['query'][_0xed2b('0x2f')]+'%'};return _0xa5a57a;}})});}_0x169135=_[_0xed2b('0x30')]({},_0x169135,_0x2f4755['options']);var _0x26e8d1={'where':_0x169135[_0xed2b('0x2c')]};return db[_0xed2b('0x20')][_0xed2b('0x14')](_0x26e8d1)[_0xed2b('0x1a')](function(_0x30ac08){_0x51ae98[_0xed2b('0x14')]=_0x30ac08;if(_0x2f4755[_0xed2b('0x23')][_0xed2b('0x34')]){_0x169135[_0xed2b('0x35')]=[{'all':!![]}];}return db[_0xed2b('0x20')][_0xed2b('0x36')](_0x169135);})['then'](function(_0x3ab194){_0x51ae98[_0xed2b('0x37')]=_0x3ab194;return _0x51ae98;})[_0xed2b('0x1a')](respondWithFilteredResult(_0x50e57e,_0x169135))[_0xed2b('0x38')](handleError(_0x50e57e,null));};exports[_0xed2b('0x39')]=function(_0x3fdb84,_0xe43e86){var _0x28b333={'raw':!![],'where':{'id':_0x3fdb84[_0xed2b('0x3a')]['id']}},_0x3e7de6={};_0x3e7de6[_0xed2b('0x21')]=_['keys'](db[_0xed2b('0x20')][_0xed2b('0x3b')]);_0x3e7de6[_0xed2b('0x23')]=_[_0xed2b('0x22')](_0x3fdb84['query']);_0x3e7de6[_0xed2b('0x2d')]=_[_0xed2b('0x24')](_0x3e7de6[_0xed2b('0x21')],_0x3e7de6[_0xed2b('0x23')]);_0x28b333[_0xed2b('0x25')]=_[_0xed2b('0x24')](_0x3e7de6['model'],qs[_0xed2b('0x26')](_0x3fdb84[_0xed2b('0x23')][_0xed2b('0x26')]));_0x28b333[_0xed2b('0x25')]=_0x28b333['attributes'][_0xed2b('0x27')]?_0x28b333['attributes']:_0x3e7de6[_0xed2b('0x21')];if(_0x3fdb84[_0xed2b('0x23')][_0xed2b('0x34')]){_0x28b333[_0xed2b('0x35')]=[{'all':!![]}];}_0x28b333=_['merge']({},_0x28b333,_0x3fdb84[_0xed2b('0x3c')]);return db[_0xed2b('0x20')][_0xed2b('0x3d')](_0x28b333)[_0xed2b('0x1a')](handleEntityNotFound(_0xe43e86,null))['then'](respondWithResult(_0xe43e86,null))[_0xed2b('0x38')](handleError(_0xe43e86,null));};exports['create']=function(_0x4fd2cb,_0x32f4bf){return db['VtigerField'][_0xed2b('0x3e')](_0x4fd2cb[_0xed2b('0x3f')],{})[_0xed2b('0x1a')](respondWithResult(_0x32f4bf,0xc9))['catch'](handleError(_0x32f4bf,null));};exports[_0xed2b('0x19')]=function(_0x5dfd6b,_0x4d1d36){if(_0x5dfd6b[_0xed2b('0x3f')]['id']){delete _0x5dfd6b[_0xed2b('0x3f')]['id'];}return db[_0xed2b('0x20')][_0xed2b('0x3d')]({'where':{'id':_0x5dfd6b[_0xed2b('0x3a')]['id']}})[_0xed2b('0x1a')](handleEntityNotFound(_0x4d1d36,null))[_0xed2b('0x1a')](saveUpdates(_0x5dfd6b[_0xed2b('0x3f')],null))[_0xed2b('0x1a')](respondWithResult(_0x4d1d36,null))[_0xed2b('0x38')](handleError(_0x4d1d36,null));};exports['destroy']=function(_0x41bdcd,_0x581ffe){return db['VtigerField'][_0xed2b('0x3d')]({'where':{'id':_0x41bdcd['params']['id']}})[_0xed2b('0x1a')](handleEntityNotFound(_0x581ffe,null))['then'](removeEntity(_0x581ffe,null))[_0xed2b('0x38')](handleError(_0x581ffe,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index a983db6..8528d49 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 _0x0148=['../../config/logger','moment','bluebird','request-promise','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash'];(function(_0x196c03,_0x4c6782){var _0x11ba02=function(_0x5efa1f){while(--_0x5efa1f){_0x196c03['push'](_0x196c03['shift']());}};_0x11ba02(++_0x4c6782);}(_0x0148,0xdb));var _0x8014=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x0148[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x8014('0x0'));var util=require('util');var logger=require(_0x8014('0x1'))('api');var moment=require(_0x8014('0x2'));var BPromise=require(_0x8014('0x3'));var rp=require(_0x8014('0x4'));var attributes=require('./intVtigerField.attributes');module[_0x8014('0x5')]=function(_0x5857d0,_0x112bae){return _0x5857d0['define'](_0x8014('0x6'),attributes,{'tableName':_0x8014('0x7'),'paranoid':![],'indexes':[{'name':_0x8014('0x8'),'fields':[_0x8014('0x9'),_0x8014('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4d7e=['exports','define','VtigerField','int_vtiger_fields','idField','lodash','../../config/logger','api','bluebird','request-promise','./intVtigerField.attributes'];(function(_0x17253f,_0xbb82c){var _0x69d8=function(_0x36cfcb){while(--_0x36cfcb){_0x17253f['push'](_0x17253f['shift']());}};_0x69d8(++_0xbb82c);}(_0x4d7e,0x19c));var _0xe4d7=function(_0x11362f,_0x2fc8f0){_0x11362f=_0x11362f-0x0;var _0x5a446c=_0x4d7e[_0x11362f];return _0x5a446c;};'use strict';var _=require(_0xe4d7('0x0'));var util=require('util');var logger=require(_0xe4d7('0x1'))(_0xe4d7('0x2'));var moment=require('moment');var BPromise=require(_0xe4d7('0x3'));var rp=require(_0xe4d7('0x4'));var attributes=require(_0xe4d7('0x5'));module[_0xe4d7('0x6')]=function(_0x3b34f8,_0x476c70){return _0x3b34f8[_0xe4d7('0x7')](_0xe4d7('0x8'),attributes,{'tableName':_0xe4d7('0x9'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xe4d7('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 4b3abde..1285875 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 _0x4f09=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0xea5edf,_0x477146){var _0x1e7bc6=function(_0x581263){while(--_0x581263){_0xea5edf['push'](_0xea5edf['shift']());}};_0x1e7bc6(++_0x477146);}(_0x4f09,0x1cf));var _0x94f0=function(_0x1afa27,_0x5797fb){_0x1afa27=_0x1afa27-0x0;var _0xc82207=_0x4f09[_0x1afa27];return _0xc82207;};'use strict';var _=require(_0x94f0('0x0'));var util=require(_0x94f0('0x1'));var moment=require(_0x94f0('0x2'));var BPromise=require(_0x94f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94f0('0x4'));var db=require(_0x94f0('0x5'))['db'];var utils=require(_0x94f0('0x6'));var logger=require(_0x94f0('0x7'))(_0x94f0('0x8'));var config=require(_0x94f0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x94f0('0xa')][_0x94f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11922c,_0x325db9,_0x5483b4){return new BPromise(function(_0xfc552e,_0x164b0f){return client[_0x94f0('0xc')](_0x11922c,_0x5483b4)['then'](function(_0x5147bb){logger[_0x94f0('0xd')](_0x94f0('0xe'),_0x325db9,_0x94f0('0xf'));logger['debug'](_0x94f0('0x10'),_0x325db9,_0x94f0('0xf'),JSON['stringify'](_0x5147bb));if(_0x5147bb[_0x94f0('0x11')]){if(_0x5147bb[_0x94f0('0x11')][_0x94f0('0x12')]===0x1f4){logger[_0x94f0('0x11')](_0x94f0('0xe'),_0x325db9,_0x5147bb[_0x94f0('0x11')][_0x94f0('0x13')]);return _0x164b0f(_0x5147bb[_0x94f0('0x11')][_0x94f0('0x13')]);}logger[_0x94f0('0x11')](_0x94f0('0xe'),_0x325db9,_0x5147bb[_0x94f0('0x11')][_0x94f0('0x13')]);return _0xfc552e(_0x5147bb[_0x94f0('0x11')][_0x94f0('0x13')]);}else{logger[_0x94f0('0xd')](_0x94f0('0xe'),_0x325db9,_0x94f0('0xf'));_0xfc552e(_0x5147bb[_0x94f0('0x14')][_0x94f0('0x13')]);}})[_0x94f0('0x15')](function(_0x14f3a4){logger[_0x94f0('0x11')](_0x94f0('0xe'),_0x325db9,_0x14f3a4);_0x164b0f(_0x14f3a4);});});} \ No newline at end of file +var _0x752c=['rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','debug','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4caa5f,_0x92897d){var _0x1e9d74=function(_0x534182){while(--_0x534182){_0x4caa5f['push'](_0x4caa5f['shift']());}};_0x1e9d74(++_0x92897d);}(_0x752c,0x98));var _0xc752=function(_0x5f15c2,_0x5f0114){_0x5f15c2=_0x5f15c2-0x0;var _0x137189=_0x752c[_0x5f15c2];return _0x137189;};'use strict';var _=require(_0xc752('0x0'));var util=require(_0xc752('0x1'));var moment=require(_0xc752('0x2'));var BPromise=require(_0xc752('0x3'));var rs=require(_0xc752('0x4'));var fs=require('fs');var Redis=require(_0xc752('0x5'));var db=require(_0xc752('0x6'))['db'];var utils=require(_0xc752('0x7'));var logger=require(_0xc752('0x8'))(_0xc752('0x9'));var config=require(_0xc752('0xa'));var jayson=require(_0xc752('0xb'));var client=jayson[_0xc752('0xc')][_0xc752('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x17b341,_0x45aa5f,_0x29fbd2){return new BPromise(function(_0x39971,_0x4a373c){return client[_0xc752('0xe')](_0x17b341,_0x29fbd2)['then'](function(_0x5f56a5){logger[_0xc752('0xf')](_0xc752('0x10'),_0x45aa5f,'request\x20sent');logger[_0xc752('0x11')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x45aa5f,'request\x20sent',JSON['stringify'](_0x5f56a5));if(_0x5f56a5['error']){if(_0x5f56a5[_0xc752('0x12')][_0xc752('0x13')]===0x1f4){logger[_0xc752('0x12')]('VtigerField,\x20%s,\x20%s',_0x45aa5f,_0x5f56a5['error'][_0xc752('0x14')]);return _0x4a373c(_0x5f56a5[_0xc752('0x12')]['message']);}logger[_0xc752('0x12')]('VtigerField,\x20%s,\x20%s',_0x45aa5f,_0x5f56a5[_0xc752('0x12')][_0xc752('0x14')]);return _0x39971(_0x5f56a5['error'][_0xc752('0x14')]);}else{logger[_0xc752('0xf')](_0xc752('0x10'),_0x45aa5f,_0xc752('0x15'));_0x39971(_0x5f56a5['result'][_0xc752('0x14')]);}})[_0xc752('0x16')](function(_0xd781ba){logger[_0xc752('0x12')](_0xc752('0x10'),_0x45aa5f,_0xd781ba);_0x4a373c(_0xd781ba);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index f2ca9a6..9b6020b 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 _0x7853=['index','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','destroy','exports','multer','path','connect-timeout','Router','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated'];(function(_0x2a8550,_0x3b2ce2){var _0xfc322a=function(_0x57d273){while(--_0x57d273){_0x2a8550['push'](_0x2a8550['shift']());}};_0xfc322a(++_0x3b2ce2);}(_0x7853,0x98));var _0x3785=function(_0x835cb7,_0x1e574d){_0x835cb7=_0x835cb7-0x0;var _0x3ef599=_0x7853[_0x835cb7];return _0x3ef599;};'use strict';var multer=require(_0x3785('0x0'));var util=require('util');var path=require(_0x3785('0x1'));var timeout=require(_0x3785('0x2'));var express=require('express');var router=express[_0x3785('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3785('0x4'));var controller=require(_0x3785('0x5'));router[_0x3785('0x6')]('/',auth[_0x3785('0x7')](),controller[_0x3785('0x8')]);router['get'](_0x3785('0x9'),auth[_0x3785('0x7')](),controller[_0x3785('0xa')]);router[_0x3785('0x6')](_0x3785('0xb'),auth[_0x3785('0x7')](),controller[_0x3785('0xc')]);router['get']('/:id/fields',auth[_0x3785('0x7')](),controller[_0x3785('0xd')]);router['post']('/',auth[_0x3785('0x7')](),controller['create']);router[_0x3785('0xe')](_0x3785('0xb'),auth[_0x3785('0x7')](),controller[_0x3785('0xf')]);router[_0x3785('0x10')](_0x3785('0x9'),auth[_0x3785('0x7')](),controller[_0x3785('0x11')]);router['delete']('/:id',auth[_0x3785('0x7')](),controller[_0x3785('0x12')]);module[_0x3785('0x13')]=router; \ No newline at end of file +var _0xf60b=['getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show'];(function(_0xe1ec97,_0xb385e2){var _0x1a8924=function(_0x543fea){while(--_0x543fea){_0xe1ec97['push'](_0xe1ec97['shift']());}};_0x1a8924(++_0xb385e2);}(_0xf60b,0x19a));var _0xbf60=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xf60b[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0xbf60('0x0'));var util=require('util');var path=require(_0xbf60('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf60('0x2'));var router=express[_0xbf60('0x3')]();var auth=require(_0xbf60('0x4'));var interaction=require(_0xbf60('0x5'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0xbf60('0x6')]('/',auth[_0xbf60('0x7')](),controller[_0xbf60('0x8')]);router[_0xbf60('0x6')]('/:id',auth[_0xbf60('0x7')](),controller[_0xbf60('0x9')]);router[_0xbf60('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xbf60('0xa')]);router['get'](_0xbf60('0xb'),auth[_0xbf60('0x7')](),controller['getFields']);router[_0xbf60('0xc')]('/',auth[_0xbf60('0x7')](),controller[_0xbf60('0xd')]);router['post']('/:id/configurations',auth[_0xbf60('0x7')](),controller[_0xbf60('0xe')]);router[_0xbf60('0xf')](_0xbf60('0x10'),auth['isAuthenticated'](),controller[_0xbf60('0x11')]);router['delete'](_0xbf60('0x10'),auth[_0xbf60('0x7')](),controller[_0xbf60('0x12')]);module[_0xbf60('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index d6f63d1..9c51ecd 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 _0x98a7=['STRING','username','remoteUri','token','password','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x22aded,_0x3894e6){var _0x54c1d8=function(_0x51cf28){while(--_0x51cf28){_0x22aded['push'](_0x22aded['shift']());}};_0x54c1d8(++_0x3894e6);}(_0x98a7,0x9e));var _0x798a=function(_0x1bfd92,_0x213856){_0x1bfd92=_0x1bfd92-0x0;var _0x264472=_0x98a7[_0x1bfd92];return _0x264472;};'use strict';var Sequelize=require(_0x798a('0x0'));module[_0x798a('0x1')]={'name':{'type':Sequelize[_0x798a('0x2')]},'description':{'type':Sequelize[_0x798a('0x2')]},'username':{'type':Sequelize[_0x798a('0x2')],'unique':_0x798a('0x3')},'password':{'type':Sequelize[_0x798a('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x798a('0x2')],'unique':_0x798a('0x4')},'authType':{'type':Sequelize['ENUM']('password',_0x798a('0x5')),'defaultValue':_0x798a('0x6')},'serverUrl':{'type':Sequelize[_0x798a('0x2')]},'type':{'type':Sequelize[_0x798a('0x7')](_0x798a('0x8'),_0x798a('0x9')),'defaultValue':_0x798a('0x8')}}; \ No newline at end of file +var _0x572b=['integrationTab','newTab','sequelize','exports','STRING','ENUM','password','token'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x572b,0x1b2));var _0xb572=function(_0x10c16d,_0x2b3e14){_0x10c16d=_0x10c16d-0x0;var _0x5896f4=_0x572b[_0x10c16d];return _0x5896f4;};'use strict';var Sequelize=require(_0xb572('0x0'));module[_0xb572('0x1')]={'name':{'type':Sequelize[_0xb572('0x2')]},'description':{'type':Sequelize[_0xb572('0x2')]},'username':{'type':Sequelize[_0xb572('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xb572('0x2')]},'token':{'type':Sequelize[_0xb572('0x2')]},'remoteUri':{'type':Sequelize[_0xb572('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xb572('0x3')](_0xb572('0x4'),_0xb572('0x5')),'defaultValue':_0xb572('0x4')},'serverUrl':{'type':Sequelize[_0xb572('0x2')]},'type':{'type':Sequelize[_0xb572('0x3')](_0xb572('0x6'),_0xb572('0x7')),'defaultValue':_0xb572('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index ca17a73..f85c58d 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 _0x5f66=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','GET','%s%s','remoteUri','ticket_fields','headers','Basic\x20%s','format','toString','%s/token:%s','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','includes','title','system_field_options','test','Wrong\x20credentials','statusCode','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','../../components/integrations/configuration','client','request','then','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','destroy','stack','name','send','index','ZendeskAccount','model','keys','query'];(function(_0x466e45,_0x332cac){var _0x15876e=function(_0x1b0c88){while(--_0x1b0c88){_0x466e45['push'](_0x466e45['shift']());}};_0x15876e(++_0x332cac);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'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'];var integrations=require(_0x65f6('0x13'));var jayson=require('jayson/promise');var client=jayson[_0x65f6('0x14')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f964a,_0x186a6a,_0x2c4ee5,_0x217570){return new BPromise(function(_0x369f96,_0x1d29fd){var _0x44144b=_0x217570||client;return _0x44144b[_0x65f6('0x15')](_0x2f964a,_0x2c4ee5)[_0x65f6('0x16')](function(_0x3440af){logger['info'](_0x65f6('0x17'),_0x186a6a,'request\x20sent');logger['debug'](_0x65f6('0x18'),_0x186a6a,_0x65f6('0x19'),JSON[_0x65f6('0x1a')](_0x3440af));if(_0x3440af[_0x65f6('0x1b')]){if(_0x3440af[_0x65f6('0x1b')][_0x65f6('0x1c')]===0x1f4){logger[_0x65f6('0x1b')](_0x65f6('0x17'),_0x186a6a,_0x3440af['error']['message']);return _0x1d29fd(_0x3440af[_0x65f6('0x1b')]['message']);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x186a6a,_0x3440af[_0x65f6('0x1b')][_0x65f6('0x1d')]);return _0x369f96(_0x3440af['error'][_0x65f6('0x1d')]);}else{logger[_0x65f6('0x1e')](_0x65f6('0x17'),_0x186a6a,_0x65f6('0x19'));_0x369f96(_0x3440af[_0x65f6('0x1f')][_0x65f6('0x1d')]);}})['catch'](function(_0x197a49){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x186a6a,_0x197a49);_0x1d29fd(_0x197a49);});});}function respondWithStatusCode(_0x212247,_0xd173f4){_0xd173f4=_0xd173f4||0xcc;return function(_0x524e42){if(_0x524e42){return _0x212247[_0x65f6('0x20')](_0xd173f4);}return _0x212247[_0x65f6('0x21')](_0xd173f4)[_0x65f6('0x22')]();};}function respondWithResult(_0x2774a1,_0x4f5a69){_0x4f5a69=_0x4f5a69||0xc8;return function(_0x9d7bb0){if(_0x9d7bb0){return _0x2774a1[_0x65f6('0x21')](_0x4f5a69)[_0x65f6('0x23')](_0x9d7bb0);}};}function respondWithFilteredResult(_0x5963e0,_0x5cb131){return function(_0x4fde2f){if(_0x4fde2f){var _0x29abdb=_0x4fde2f[_0x65f6('0x24')],_0x16cde8=_0x5cb131['offset'],_0x4b2292=_0x5cb131[_0x65f6('0x25')]+_0x5cb131[_0x65f6('0x26')],_0x296cd9;if(_0x4b2292>=_0x29abdb){_0x4b2292=_0x29abdb;_0x296cd9=0xc8;}else{_0x296cd9=0xce;}_0x5963e0[_0x65f6('0x21')](_0x296cd9);return _0x5963e0['set']('Content-Range',_0x16cde8+'-'+_0x4b2292+'/'+_0x29abdb)['json'](_0x4fde2f);}return null;};}function patchUpdates(_0x266cfe){return function(_0x3c032f){try{jsonpatch[_0x65f6('0x27')](_0x3c032f,_0x266cfe,!![]);}catch(_0x408ccc){return BPromise[_0x65f6('0x28')](_0x408ccc);}return _0x3c032f[_0x65f6('0x29')]();};}function saveUpdates(_0x144e55,_0x4ace4c){return function(_0x4ea23d){if(_0x4ea23d){return _0x4ea23d[_0x65f6('0x2a')](_0x144e55)[_0x65f6('0x16')](function(_0x5878bc){return _0x5878bc;});}return null;};}function removeEntity(_0x4e50c0,_0x10b368){return function(_0x1ce43c){if(_0x1ce43c){return _0x1ce43c[_0x65f6('0x2b')]()[_0x65f6('0x16')](function(){_0x4e50c0[_0x65f6('0x21')](0xcc)[_0x65f6('0x22')]();});}};}function handleEntityNotFound(_0x5792a0,_0x103265){return function(_0x38f3c6){if(!_0x38f3c6){_0x5792a0[_0x65f6('0x20')](0x194);}return _0x38f3c6;};}function handleError(_0x4bc037,_0x217f35){_0x217f35=_0x217f35||0x1f4;return function(_0x2a7aa8){logger[_0x65f6('0x1b')](_0x2a7aa8[_0x65f6('0x2c')]);if(_0x2a7aa8[_0x65f6('0x2d')]){delete _0x2a7aa8[_0x65f6('0x2d')];}_0x4bc037['status'](_0x217f35)[_0x65f6('0x2e')](_0x2a7aa8);};}exports[_0x65f6('0x2f')]=function(_0x4f3e22,_0x36dbf4){var _0x5a740a={},_0x2b403b={},_0x50494b={'count':0x0,'rows':[]};var _0x2b9fb6=db[_0x65f6('0x30')]['rawAttributes'];_0x2b403b[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x2b9fb6);_0x2b403b[_0x65f6('0x33')]=_['keys'](_0x4f3e22['query']);_0x2b403b[_0x65f6('0x34')]=_['intersection'](_0x2b403b[_0x65f6('0x31')],_0x2b403b['query']);_0x5a740a[_0x65f6('0x35')]=_[_0x65f6('0x36')](_0x2b403b['model'],qs[_0x65f6('0x37')](_0x4f3e22['query']['fields']));_0x5a740a[_0x65f6('0x35')]=_0x5a740a[_0x65f6('0x35')][_0x65f6('0x38')]?_0x5a740a[_0x65f6('0x35')]:_0x2b403b[_0x65f6('0x31')];if(!_0x4f3e22[_0x65f6('0x33')][_0x65f6('0x39')](_0x65f6('0x3a'))){_0x5a740a['limit']=qs[_0x65f6('0x26')](_0x4f3e22['query'][_0x65f6('0x26')]);_0x5a740a[_0x65f6('0x25')]=qs[_0x65f6('0x25')](_0x4f3e22[_0x65f6('0x33')]['offset']);}_0x5a740a[_0x65f6('0x3b')]=qs[_0x65f6('0x3c')](_0x4f3e22[_0x65f6('0x33')][_0x65f6('0x3c')]);_0x5a740a[_0x65f6('0x3d')]=qs[_0x65f6('0x34')](_[_0x65f6('0x3e')](_0x4f3e22[_0x65f6('0x33')],_0x2b403b[_0x65f6('0x34')]));if(_0x4f3e22['query'][_0x65f6('0x3f')]){_0x5a740a[_0x65f6('0x3d')]=_[_0x65f6('0x40')](_0x5a740a[_0x65f6('0x3d')],{'$or':_[_0x65f6('0x41')](_0x2b9fb6,function(_0x1ac040){if(_0x1ac040[_0x65f6('0x42')][_0x65f6('0x43')]!==_0x65f6('0x44')){var _0x2abbed={};_0x2abbed[_0x1ac040[_0x65f6('0x45')]]={'$like':'%'+_0x4f3e22[_0x65f6('0x33')][_0x65f6('0x3f')]+'%'};return _0x2abbed;}})});}_0x5a740a=_[_0x65f6('0x40')]({},_0x5a740a,_0x4f3e22[_0x65f6('0x46')]);var _0x2cb38d={'where':_0x5a740a['where']};return db[_0x65f6('0x30')][_0x65f6('0x24')](_0x2cb38d)[_0x65f6('0x16')](function(_0x3828c9){_0x50494b['count']=_0x3828c9;if(_0x4f3e22[_0x65f6('0x33')][_0x65f6('0x47')]){_0x5a740a[_0x65f6('0x48')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x65f6('0x49')](_0x5a740a);})[_0x65f6('0x16')](function(_0x426937){_0x50494b[_0x65f6('0x4a')]=_0x426937;return _0x50494b;})['then'](respondWithFilteredResult(_0x36dbf4,_0x5a740a))[_0x65f6('0x4b')](handleError(_0x36dbf4,null));};exports['show']=function(_0x3f1baa,_0x6968b){var _0x577c93={'raw':![],'where':{'id':_0x3f1baa['params']['id']}},_0xf754ee={};_0xf754ee[_0x65f6('0x31')]=_[_0x65f6('0x32')](db[_0x65f6('0x30')][_0x65f6('0x4c')]);_0xf754ee[_0x65f6('0x33')]=_[_0x65f6('0x32')](_0x3f1baa['query']);_0xf754ee['filters']=_[_0x65f6('0x36')](_0xf754ee[_0x65f6('0x31')],_0xf754ee[_0x65f6('0x33')]);_0x577c93[_0x65f6('0x35')]=_[_0x65f6('0x36')](_0xf754ee[_0x65f6('0x31')],qs[_0x65f6('0x37')](_0x3f1baa[_0x65f6('0x33')][_0x65f6('0x37')]));_0x577c93['attributes']=_0x577c93[_0x65f6('0x35')][_0x65f6('0x38')]?_0x577c93[_0x65f6('0x35')]:_0xf754ee['model'];if(_0x3f1baa[_0x65f6('0x33')][_0x65f6('0x47')]){_0x577c93['include']=[{'all':!![]}];}_0x577c93=_[_0x65f6('0x40')]({},_0x577c93,_0x3f1baa[_0x65f6('0x46')]);return db['ZendeskAccount'][_0x65f6('0x4d')](_0x577c93)['then'](handleEntityNotFound(_0x6968b,null))[_0x65f6('0x16')](respondWithResult(_0x6968b,null))[_0x65f6('0x4b')](handleError(_0x6968b,null));};exports[_0x65f6('0x4e')]=function(_0x4b9f0a,_0x1646c5){return db[_0x65f6('0x30')]['create'](_0x4b9f0a[_0x65f6('0x4f')],{})[_0x65f6('0x16')](respondWithResult(_0x1646c5,0xc9))['catch'](handleError(_0x1646c5,null));};exports[_0x65f6('0x2a')]=function(_0x344c0e,_0x413dbc){if(_0x344c0e[_0x65f6('0x4f')]['id']){delete _0x344c0e[_0x65f6('0x4f')]['id'];}return db[_0x65f6('0x30')][_0x65f6('0x4d')]({'where':{'id':_0x344c0e[_0x65f6('0x50')]['id']}})['then'](handleEntityNotFound(_0x413dbc,null))['then'](saveUpdates(_0x344c0e['body'],null))[_0x65f6('0x16')](respondWithResult(_0x413dbc,null))[_0x65f6('0x4b')](handleError(_0x413dbc,null));};exports[_0x65f6('0x2b')]=function(_0x20c322,_0x545445){return db[_0x65f6('0x30')][_0x65f6('0x4d')]({'where':{'id':_0x20c322[_0x65f6('0x50')]['id']}})['then'](handleEntityNotFound(_0x545445,null))[_0x65f6('0x16')](removeEntity(_0x545445,null))[_0x65f6('0x4b')](handleError(_0x545445,null));};exports[_0x65f6('0x51')]=function(_0x4e289e,_0x551fe3,_0x1d337d){var _0x44f3dd={};var _0x4125cb={};var _0x39364f;var _0x2a76b3;return db[_0x65f6('0x30')][_0x65f6('0x52')]({'where':{'id':_0x4e289e[_0x65f6('0x50')]['id']}})[_0x65f6('0x16')](handleEntityNotFound(_0x551fe3,null))[_0x65f6('0x16')](function(_0xa7eee9){if(_0xa7eee9){_0x39364f=_0xa7eee9;_0x4125cb[_0x65f6('0x31')]=_[_0x65f6('0x32')](db[_0x65f6('0x53')]['rawAttributes']);_0x4125cb[_0x65f6('0x33')]=_[_0x65f6('0x32')](_0x4e289e[_0x65f6('0x33')]);_0x4125cb['filters']=_[_0x65f6('0x36')](_0x4125cb[_0x65f6('0x31')],_0x4125cb[_0x65f6('0x33')]);_0x44f3dd[_0x65f6('0x35')]=_['intersection'](_0x4125cb[_0x65f6('0x31')],qs[_0x65f6('0x37')](_0x4e289e[_0x65f6('0x33')][_0x65f6('0x37')]));_0x44f3dd['attributes']=_0x44f3dd[_0x65f6('0x35')][_0x65f6('0x38')]?_0x44f3dd['attributes']:_0x4125cb[_0x65f6('0x31')];_0x44f3dd[_0x65f6('0x3b')]=qs[_0x65f6('0x3c')](_0x4e289e['query'][_0x65f6('0x3c')]);_0x44f3dd[_0x65f6('0x3d')]=qs[_0x65f6('0x34')](_[_0x65f6('0x3e')](_0x4e289e[_0x65f6('0x33')],_0x4125cb[_0x65f6('0x34')]));if(_0x4e289e['query']['filter']){_0x44f3dd['where']=_[_0x65f6('0x40')](_0x44f3dd[_0x65f6('0x3d')],{'$or':_[_0x65f6('0x41')](_0x44f3dd[_0x65f6('0x35')],function(_0xab6f0){var _0x304cf9={};_0x304cf9[_0xab6f0]={'$like':'%'+_0x4e289e['query'][_0x65f6('0x3f')]+'%'};return _0x304cf9;})});}_0x44f3dd=_[_0x65f6('0x40')]({},_0x44f3dd,_0x4e289e['options']);return _0x39364f[_0x65f6('0x51')](_0x44f3dd);}})[_0x65f6('0x16')](function(_0x477489){if(_0x477489){_0x2a76b3=_0x477489['length'];if(!_0x4e289e[_0x65f6('0x33')][_0x65f6('0x39')]('nolimit')){_0x44f3dd[_0x65f6('0x26')]=qs[_0x65f6('0x26')](_0x4e289e[_0x65f6('0x33')][_0x65f6('0x26')]);_0x44f3dd[_0x65f6('0x25')]=qs[_0x65f6('0x25')](_0x4e289e[_0x65f6('0x33')]['offset']);}return _0x39364f['getConfigurations'](_0x44f3dd);}})[_0x65f6('0x16')](function(_0x3da139){if(_0x3da139){return _0x3da139?{'count':_0x2a76b3,'rows':_0x3da139}:null;}})['then'](respondWithResult(_0x551fe3,null))[_0x65f6('0x4b')](handleError(_0x551fe3,null));};exports['addConfiguration']=function(_0x3a483b,_0x4e0450,_0x440df1){if(_0x3a483b[_0x65f6('0x4f')]['id']){delete _0x3a483b[_0x65f6('0x4f')]['id'];}return db[_0x65f6('0x30')][_0x65f6('0x52')]({'where':{'id':_0x3a483b[_0x65f6('0x50')]['id']}})[_0x65f6('0x16')](handleEntityNotFound(_0x4e0450,null))[_0x65f6('0x16')](function(_0x2405a7){if(_0x2405a7){_0x3a483b['body']['AccountId']=_0x2405a7['id'];_0x3a483b[_0x65f6('0x4f')][_0x65f6('0x54')]=integrations[_0x65f6('0x55')](_0x3a483b['body']['channel'],_0x3a483b[_0x65f6('0x4f')][_0x65f6('0x42')]);_0x3a483b[_0x65f6('0x4f')][_0x65f6('0x56')]=integrations[_0x65f6('0x57')](_0x3a483b[_0x65f6('0x4f')]['channel'],_0x3a483b['body'][_0x65f6('0x42')]);return db[_0x65f6('0x53')]['create'](_0x3a483b[_0x65f6('0x4f')],{'include':[{'model':db['ZendeskField'],'as':_0x65f6('0x54')},{'model':db[_0x65f6('0x58')],'as':_0x65f6('0x56')}]});}return null;})[_0x65f6('0x16')](respondWithResult(_0x4e0450,null))['catch'](handleError(_0x4e0450,null));};exports[_0x65f6('0x59')]=function(_0x351d43,_0x11411c,_0x59131c){return db['ZendeskAccount'][_0x65f6('0x52')]({'where':{'id':_0x351d43['params']['id']},'attributes':['id',_0x65f6('0x5a'),_0x65f6('0x5b'),_0x65f6('0x5c'),_0x65f6('0x5d'),'remoteUri']})['then'](handleEntityNotFound(_0x11411c,null))['then'](function(_0x2e29b4){if(_0x2e29b4){var _0x838539={'method':_0x65f6('0x5e'),'uri':util['format'](_0x65f6('0x5f'),_0x2e29b4[_0x65f6('0x60')],_0x65f6('0x61')),'json':!![]};switch(_0x2e29b4['authType']){case _0x65f6('0x5b'):_0x838539[_0x65f6('0x62')]={'Authorization':util['format'](_0x65f6('0x63'),new Buffer(util[_0x65f6('0x64')]('%s:%s',_0x2e29b4[_0x65f6('0x5a')],_0x2e29b4['password']))[_0x65f6('0x65')]('base64'))};break;case _0x65f6('0x5c'):_0x838539[_0x65f6('0x62')]={'Authorization':util['format'](_0x65f6('0x63'),new Buffer(util[_0x65f6('0x64')](_0x65f6('0x66'),_0x2e29b4[_0x65f6('0x5a')],_0x2e29b4[_0x65f6('0x5c')]))[_0x65f6('0x65')](_0x65f6('0x67')))};break;default:throw new db[(_0x65f6('0x68'))][(_0x65f6('0x69'))](_0x65f6('0x6a'));}return rp(_0x838539);}})[_0x65f6('0x16')](function(_0x574d84){if(_0x574d84){var _0x10a661=[_0x65f6('0x6b'),_0x65f6('0x6c'),_0x65f6('0x6d'),'assignee'];_[_0x65f6('0x6e')](_0x574d84[_0x65f6('0x61')],function(_0x4a7928){return _0x10a661[_0x65f6('0x6f')](_0x4a7928['type']);});return{'count':_0x574d84[_0x65f6('0x61')]['length'],'rows':_[_0x65f6('0x41')](_0x574d84[_0x65f6('0x61')],function(_0x5e7d9d){return{'id':_0x5e7d9d['id'],'name':_0x5e7d9d['position']>0x7?_0x5e7d9d[_0x65f6('0x70')]:_0x5e7d9d[_0x65f6('0x42')],'custom':_0x5e7d9d['position']>0x7?!![]:![],'options':_0x5e7d9d[_0x65f6('0x71')]?_0x5e7d9d[_0x65f6('0x71')]:[]};})};}})[_0x65f6('0x16')](respondWithResult(_0x11411c,null))['catch'](function(_0x1348ec){var _0x246510=_0x351d43['query'][_0x65f6('0x72')]?0x1f4:_0x1348ec['statusCode']||0x1f4;logger[_0x65f6('0x1b')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x246510,JSON[_0x65f6('0x1a')](_0x1348ec));delete _0x1348ec[_0x65f6('0x2d')];if(_0x246510===0x191){_0x246510=0x190;}_0x11411c[_0x65f6('0x21')](_0x246510)[_0x65f6('0x2e')](_0x351d43[_0x65f6('0x33')][_0x65f6('0x72')]?{'message':_0x65f6('0x73'),'statusCode':_0x1348ec[_0x65f6('0x74')]}:_0x1348ec);});}; \ No newline at end of file +var _0x5f2f=['sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','then','destroy','end','stack','name','send','index','ZendeskAccount','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','show','params','rawAttributes','length','find','create','body','update','getConfigurations','ZendeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','password','token','authType','remoteUri','GET','format','%s%s','%s:%s','username','toString','base64','headers','Basic\x20%s','%s/token:%s','Sequelize','ValidationError','subject','description','group','assignee','remove','position','title','system_field_options','getFields,\x20%s,\x20%s,\x20%s','test','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path'];(function(_0x236f0a,_0xdda8f1){var _0x1b7512=function(_0xad2e46){while(--_0xad2e46){_0x236f0a['push'](_0x236f0a['shift']());}};_0x1b7512(++_0xdda8f1);}(_0x5f2f,0x73));var _0xf5f2=function(_0xe47ca,_0x5eeec0){_0xe47ca=_0xe47ca-0x0;var _0x2d90b7=_0x5f2f[_0xe47ca];return _0x2d90b7;};'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'];var integrations=require(_0xf5f2('0x16'));var jayson=require(_0xf5f2('0x17'));var client=jayson[_0xf5f2('0x18')][_0xf5f2('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x59bb6c,_0x3e5956,_0x5c01b8,_0x5850f4){return new BPromise(function(_0xea612c,_0x269909){var _0x1c1a5c=_0x5850f4||client;return _0x1c1a5c[_0xf5f2('0x1a')](_0x59bb6c,_0x5c01b8)['then'](function(_0xafe430){logger[_0xf5f2('0x1b')](_0xf5f2('0x1c'),_0x3e5956,_0xf5f2('0x1d'));logger[_0xf5f2('0x1e')](_0xf5f2('0x1f'),_0x3e5956,_0xf5f2('0x1d'),JSON[_0xf5f2('0x20')](_0xafe430));if(_0xafe430[_0xf5f2('0x21')]){if(_0xafe430[_0xf5f2('0x21')][_0xf5f2('0x22')]===0x1f4){logger[_0xf5f2('0x21')](_0xf5f2('0x1c'),_0x3e5956,_0xafe430[_0xf5f2('0x21')][_0xf5f2('0x23')]);return _0x269909(_0xafe430[_0xf5f2('0x21')][_0xf5f2('0x23')]);}logger['error'](_0xf5f2('0x1c'),_0x3e5956,_0xafe430[_0xf5f2('0x21')]['message']);return _0xea612c(_0xafe430['error'][_0xf5f2('0x23')]);}else{logger[_0xf5f2('0x1b')]('ZendeskAccount,\x20%s,\x20%s',_0x3e5956,_0xf5f2('0x1d'));_0xea612c(_0xafe430[_0xf5f2('0x24')][_0xf5f2('0x23')]);}})[_0xf5f2('0x25')](function(_0x36f1cb){logger['error'](_0xf5f2('0x1c'),_0x3e5956,_0x36f1cb);_0x269909(_0x36f1cb);});});}function respondWithStatusCode(_0x4669a6,_0x4e8bda){_0x4e8bda=_0x4e8bda||0xcc;return function(_0x2833fe){if(_0x2833fe){return _0x4669a6[_0xf5f2('0x26')](_0x4e8bda);}return _0x4669a6['status'](_0x4e8bda)['end']();};}function respondWithResult(_0x5f1124,_0x3f79d5){_0x3f79d5=_0x3f79d5||0xc8;return function(_0x13da6f){if(_0x13da6f){return _0x5f1124[_0xf5f2('0x27')](_0x3f79d5)[_0xf5f2('0x28')](_0x13da6f);}};}function respondWithFilteredResult(_0x788a8d,_0x13a3be){return function(_0x281ec8){if(_0x281ec8){var _0x294414=_0x281ec8[_0xf5f2('0x29')],_0x4ab014=_0x13a3be[_0xf5f2('0x2a')],_0xaa2602=_0x13a3be[_0xf5f2('0x2a')]+_0x13a3be[_0xf5f2('0x2b')],_0x102449;if(_0xaa2602>=_0x294414){_0xaa2602=_0x294414;_0x102449=0xc8;}else{_0x102449=0xce;}_0x788a8d['status'](_0x102449);return _0x788a8d['set'](_0xf5f2('0x2c'),_0x4ab014+'-'+_0xaa2602+'/'+_0x294414)[_0xf5f2('0x28')](_0x281ec8);}return null;};}function patchUpdates(_0x11c771){return function(_0x5027ab){try{jsonpatch['apply'](_0x5027ab,_0x11c771,!![]);}catch(_0x29571b){return BPromise[_0xf5f2('0x2d')](_0x29571b);}return _0x5027ab[_0xf5f2('0x2e')]();};}function saveUpdates(_0x153924,_0x1b381e){return function(_0x54c0c8){if(_0x54c0c8){return _0x54c0c8['update'](_0x153924)[_0xf5f2('0x2f')](function(_0x4e19cb){return _0x4e19cb;});}return null;};}function removeEntity(_0xb744b9,_0x58a4df){return function(_0x45b643){if(_0x45b643){return _0x45b643[_0xf5f2('0x30')]()[_0xf5f2('0x2f')](function(){_0xb744b9[_0xf5f2('0x27')](0xcc)[_0xf5f2('0x31')]();});}};}function handleEntityNotFound(_0x277eee,_0x2ac089){return function(_0x2c0e05){if(!_0x2c0e05){_0x277eee['sendStatus'](0x194);}return _0x2c0e05;};}function handleError(_0x4149e6,_0x43e4ff){_0x43e4ff=_0x43e4ff||0x1f4;return function(_0x4590ec){logger[_0xf5f2('0x21')](_0x4590ec[_0xf5f2('0x32')]);if(_0x4590ec[_0xf5f2('0x33')]){delete _0x4590ec[_0xf5f2('0x33')];}_0x4149e6['status'](_0x43e4ff)[_0xf5f2('0x34')](_0x4590ec);};}exports[_0xf5f2('0x35')]=function(_0x55989d,_0x3fc168){var _0x4b8c42={},_0x18ae07={},_0x3930fb={'count':0x0,'rows':[]};var _0x2a2c31=db[_0xf5f2('0x36')]['rawAttributes'];_0x18ae07['model']=_[_0xf5f2('0x37')](_0x2a2c31);_0x18ae07[_0xf5f2('0x38')]=_[_0xf5f2('0x37')](_0x55989d['query']);_0x18ae07[_0xf5f2('0x39')]=_['intersection'](_0x18ae07[_0xf5f2('0x3a')],_0x18ae07['query']);_0x4b8c42[_0xf5f2('0x3b')]=_[_0xf5f2('0x3c')](_0x18ae07['model'],qs[_0xf5f2('0x3d')](_0x55989d[_0xf5f2('0x38')][_0xf5f2('0x3d')]));_0x4b8c42[_0xf5f2('0x3b')]=_0x4b8c42['attributes']['length']?_0x4b8c42[_0xf5f2('0x3b')]:_0x18ae07[_0xf5f2('0x3a')];if(!_0x55989d[_0xf5f2('0x38')][_0xf5f2('0x3e')](_0xf5f2('0x3f'))){_0x4b8c42[_0xf5f2('0x2b')]=qs[_0xf5f2('0x2b')](_0x55989d['query'][_0xf5f2('0x2b')]);_0x4b8c42[_0xf5f2('0x2a')]=qs['offset'](_0x55989d[_0xf5f2('0x38')][_0xf5f2('0x2a')]);}_0x4b8c42[_0xf5f2('0x40')]=qs[_0xf5f2('0x41')](_0x55989d[_0xf5f2('0x38')][_0xf5f2('0x41')]);_0x4b8c42[_0xf5f2('0x42')]=qs[_0xf5f2('0x39')](_['pick'](_0x55989d[_0xf5f2('0x38')],_0x18ae07[_0xf5f2('0x39')]));if(_0x55989d[_0xf5f2('0x38')]['filter']){_0x4b8c42['where']=_['merge'](_0x4b8c42[_0xf5f2('0x42')],{'$or':_[_0xf5f2('0x43')](_0x2a2c31,function(_0x4c8d8e){if(_0x4c8d8e[_0xf5f2('0x44')][_0xf5f2('0x45')]!==_0xf5f2('0x46')){var _0x31f86c={};_0x31f86c[_0x4c8d8e[_0xf5f2('0x47')]]={'$like':'%'+_0x55989d[_0xf5f2('0x38')][_0xf5f2('0x48')]+'%'};return _0x31f86c;}})});}_0x4b8c42=_[_0xf5f2('0x49')]({},_0x4b8c42,_0x55989d[_0xf5f2('0x4a')]);var _0x106062={'where':_0x4b8c42[_0xf5f2('0x42')]};return db[_0xf5f2('0x36')][_0xf5f2('0x29')](_0x106062)[_0xf5f2('0x2f')](function(_0x4faeed){_0x3930fb[_0xf5f2('0x29')]=_0x4faeed;if(_0x55989d['query'][_0xf5f2('0x4b')]){_0x4b8c42[_0xf5f2('0x4c')]=[{'all':!![]}];}return db[_0xf5f2('0x36')][_0xf5f2('0x4d')](_0x4b8c42);})[_0xf5f2('0x2f')](function(_0x3721c4){_0x3930fb['rows']=_0x3721c4;return _0x3930fb;})[_0xf5f2('0x2f')](respondWithFilteredResult(_0x3fc168,_0x4b8c42))[_0xf5f2('0x25')](handleError(_0x3fc168,null));};exports[_0xf5f2('0x4e')]=function(_0x29b108,_0x12124d){var _0x10753a={'raw':![],'where':{'id':_0x29b108[_0xf5f2('0x4f')]['id']}},_0xf638ff={};_0xf638ff['model']=_[_0xf5f2('0x37')](db[_0xf5f2('0x36')][_0xf5f2('0x50')]);_0xf638ff['query']=_[_0xf5f2('0x37')](_0x29b108[_0xf5f2('0x38')]);_0xf638ff[_0xf5f2('0x39')]=_['intersection'](_0xf638ff['model'],_0xf638ff[_0xf5f2('0x38')]);_0x10753a[_0xf5f2('0x3b')]=_['intersection'](_0xf638ff[_0xf5f2('0x3a')],qs['fields'](_0x29b108[_0xf5f2('0x38')]['fields']));_0x10753a[_0xf5f2('0x3b')]=_0x10753a['attributes'][_0xf5f2('0x51')]?_0x10753a[_0xf5f2('0x3b')]:_0xf638ff[_0xf5f2('0x3a')];if(_0x29b108[_0xf5f2('0x38')]['includeAll']){_0x10753a[_0xf5f2('0x4c')]=[{'all':!![]}];}_0x10753a=_[_0xf5f2('0x49')]({},_0x10753a,_0x29b108['options']);return db['ZendeskAccount'][_0xf5f2('0x52')](_0x10753a)[_0xf5f2('0x2f')](handleEntityNotFound(_0x12124d,null))['then'](respondWithResult(_0x12124d,null))[_0xf5f2('0x25')](handleError(_0x12124d,null));};exports[_0xf5f2('0x53')]=function(_0x29c9b6,_0x41b1c7){return db['ZendeskAccount']['create'](_0x29c9b6[_0xf5f2('0x54')],{})[_0xf5f2('0x2f')](respondWithResult(_0x41b1c7,0xc9))['catch'](handleError(_0x41b1c7,null));};exports[_0xf5f2('0x55')]=function(_0x43fc49,_0x255125){if(_0x43fc49[_0xf5f2('0x54')]['id']){delete _0x43fc49[_0xf5f2('0x54')]['id'];}return db[_0xf5f2('0x36')][_0xf5f2('0x52')]({'where':{'id':_0x43fc49['params']['id']}})['then'](handleEntityNotFound(_0x255125,null))[_0xf5f2('0x2f')](saveUpdates(_0x43fc49[_0xf5f2('0x54')],null))[_0xf5f2('0x2f')](respondWithResult(_0x255125,null))[_0xf5f2('0x25')](handleError(_0x255125,null));};exports[_0xf5f2('0x30')]=function(_0x5a861d,_0xdb1106){return db[_0xf5f2('0x36')][_0xf5f2('0x52')]({'where':{'id':_0x5a861d['params']['id']}})[_0xf5f2('0x2f')](handleEntityNotFound(_0xdb1106,null))['then'](removeEntity(_0xdb1106,null))[_0xf5f2('0x25')](handleError(_0xdb1106,null));};exports[_0xf5f2('0x56')]=function(_0x28cce5,_0x10f391,_0x4afa4d){var _0x5a5338={};var _0x756f1f={};var _0x4de303;var _0xa39c65;return db[_0xf5f2('0x36')]['findOne']({'where':{'id':_0x28cce5[_0xf5f2('0x4f')]['id']}})[_0xf5f2('0x2f')](handleEntityNotFound(_0x10f391,null))[_0xf5f2('0x2f')](function(_0x51ef09){if(_0x51ef09){_0x4de303=_0x51ef09;_0x756f1f[_0xf5f2('0x3a')]=_[_0xf5f2('0x37')](db[_0xf5f2('0x57')][_0xf5f2('0x50')]);_0x756f1f['query']=_[_0xf5f2('0x37')](_0x28cce5['query']);_0x756f1f[_0xf5f2('0x39')]=_[_0xf5f2('0x3c')](_0x756f1f[_0xf5f2('0x3a')],_0x756f1f[_0xf5f2('0x38')]);_0x5a5338[_0xf5f2('0x3b')]=_['intersection'](_0x756f1f[_0xf5f2('0x3a')],qs[_0xf5f2('0x3d')](_0x28cce5[_0xf5f2('0x38')][_0xf5f2('0x3d')]));_0x5a5338[_0xf5f2('0x3b')]=_0x5a5338['attributes'][_0xf5f2('0x51')]?_0x5a5338['attributes']:_0x756f1f['model'];_0x5a5338[_0xf5f2('0x40')]=qs['sort'](_0x28cce5[_0xf5f2('0x38')][_0xf5f2('0x41')]);_0x5a5338[_0xf5f2('0x42')]=qs[_0xf5f2('0x39')](_['pick'](_0x28cce5[_0xf5f2('0x38')],_0x756f1f[_0xf5f2('0x39')]));if(_0x28cce5[_0xf5f2('0x38')][_0xf5f2('0x48')]){_0x5a5338[_0xf5f2('0x42')]=_[_0xf5f2('0x49')](_0x5a5338[_0xf5f2('0x42')],{'$or':_['map'](_0x5a5338[_0xf5f2('0x3b')],function(_0x2d171d){var _0xb39a6e={};_0xb39a6e[_0x2d171d]={'$like':'%'+_0x28cce5[_0xf5f2('0x38')]['filter']+'%'};return _0xb39a6e;})});}_0x5a5338=_[_0xf5f2('0x49')]({},_0x5a5338,_0x28cce5['options']);return _0x4de303[_0xf5f2('0x56')](_0x5a5338);}})[_0xf5f2('0x2f')](function(_0x5588cf){if(_0x5588cf){_0xa39c65=_0x5588cf[_0xf5f2('0x51')];if(!_0x28cce5[_0xf5f2('0x38')][_0xf5f2('0x3e')](_0xf5f2('0x3f'))){_0x5a5338[_0xf5f2('0x2b')]=qs['limit'](_0x28cce5[_0xf5f2('0x38')][_0xf5f2('0x2b')]);_0x5a5338[_0xf5f2('0x2a')]=qs[_0xf5f2('0x2a')](_0x28cce5[_0xf5f2('0x38')][_0xf5f2('0x2a')]);}return _0x4de303['getConfigurations'](_0x5a5338);}})[_0xf5f2('0x2f')](function(_0x3f475e){if(_0x3f475e){return _0x3f475e?{'count':_0xa39c65,'rows':_0x3f475e}:null;}})['then'](respondWithResult(_0x10f391,null))[_0xf5f2('0x25')](handleError(_0x10f391,null));};exports[_0xf5f2('0x58')]=function(_0x377aad,_0x51a3c7,_0x551cc9){if(_0x377aad['body']['id']){delete _0x377aad[_0xf5f2('0x54')]['id'];}return db[_0xf5f2('0x36')][_0xf5f2('0x59')]({'where':{'id':_0x377aad[_0xf5f2('0x4f')]['id']}})[_0xf5f2('0x2f')](handleEntityNotFound(_0x51a3c7,null))['then'](function(_0x278b76){if(_0x278b76){_0x377aad[_0xf5f2('0x54')][_0xf5f2('0x5a')]=_0x278b76['id'];_0x377aad[_0xf5f2('0x54')][_0xf5f2('0x5b')]=integrations[_0xf5f2('0x5c')](_0x377aad[_0xf5f2('0x54')][_0xf5f2('0x5d')],_0x377aad[_0xf5f2('0x54')][_0xf5f2('0x44')]);_0x377aad[_0xf5f2('0x54')]['Descriptions']=integrations['getDescriptions'](_0x377aad['body'][_0xf5f2('0x5d')],_0x377aad[_0xf5f2('0x54')][_0xf5f2('0x44')]);return db[_0xf5f2('0x57')][_0xf5f2('0x53')](_0x377aad['body'],{'include':[{'model':db[_0xf5f2('0x5e')],'as':_0xf5f2('0x5b')},{'model':db[_0xf5f2('0x5e')],'as':_0xf5f2('0x5f')}]});}return null;})[_0xf5f2('0x2f')](respondWithResult(_0x51a3c7,null))['catch'](handleError(_0x51a3c7,null));};exports[_0xf5f2('0x60')]=function(_0x1409b9,_0x517c15,_0x777098){return db[_0xf5f2('0x36')][_0xf5f2('0x59')]({'where':{'id':_0x1409b9[_0xf5f2('0x4f')]['id']},'attributes':['id','username',_0xf5f2('0x61'),_0xf5f2('0x62'),_0xf5f2('0x63'),_0xf5f2('0x64')]})[_0xf5f2('0x2f')](handleEntityNotFound(_0x517c15,null))['then'](function(_0x5cab92){if(_0x5cab92){var _0x32788b={'method':_0xf5f2('0x65'),'uri':util[_0xf5f2('0x66')](_0xf5f2('0x67'),_0x5cab92['remoteUri'],'ticket_fields'),'json':!![]};switch(_0x5cab92[_0xf5f2('0x63')]){case'password':_0x32788b['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xf5f2('0x66')](_0xf5f2('0x68'),_0x5cab92[_0xf5f2('0x69')],_0x5cab92[_0xf5f2('0x61')]))[_0xf5f2('0x6a')](_0xf5f2('0x6b')))};break;case _0xf5f2('0x62'):_0x32788b[_0xf5f2('0x6c')]={'Authorization':util[_0xf5f2('0x66')](_0xf5f2('0x6d'),new Buffer(util[_0xf5f2('0x66')](_0xf5f2('0x6e'),_0x5cab92[_0xf5f2('0x69')],_0x5cab92[_0xf5f2('0x62')]))[_0xf5f2('0x6a')](_0xf5f2('0x6b')))};break;default:throw new db[(_0xf5f2('0x6f'))][(_0xf5f2('0x70'))]('Unknown\x20authentication\x20type');}return rp(_0x32788b);}})[_0xf5f2('0x2f')](function(_0x35299d){if(_0x35299d){var _0x21043b=[_0xf5f2('0x71'),_0xf5f2('0x72'),_0xf5f2('0x73'),_0xf5f2('0x74')];_[_0xf5f2('0x75')](_0x35299d['ticket_fields'],function(_0x38675d){return _0x21043b['includes'](_0x38675d['type']);});return{'count':_0x35299d['ticket_fields']['length'],'rows':_['map'](_0x35299d['ticket_fields'],function(_0x161890){return{'id':_0x161890['id'],'name':_0x161890[_0xf5f2('0x76')]>0x7?_0x161890[_0xf5f2('0x77')]:_0x161890[_0xf5f2('0x44')],'custom':_0x161890[_0xf5f2('0x76')]>0x7?!![]:![],'options':_0x161890[_0xf5f2('0x78')]?_0x161890['system_field_options']:[]};})};}})['then'](respondWithResult(_0x517c15,null))[_0xf5f2('0x25')](function(_0x578a22){var _0x418ece=_0x1409b9[_0xf5f2('0x38')]['test']?0x1f4:_0x578a22['statusCode']||0x1f4;logger[_0xf5f2('0x21')](_0xf5f2('0x79'),'getFields',_0x418ece,JSON[_0xf5f2('0x20')](_0x578a22));delete _0x578a22[_0xf5f2('0x33')];if(_0x418ece===0x191){_0x418ece=0x190;}_0x517c15['status'](_0x418ece)[_0xf5f2('0x34')](_0x1409b9[_0xf5f2('0x38')][_0xf5f2('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0x578a22[_0xf5f2('0x7b')]}:_0x578a22);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index ad360a6..e12e7d0 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 _0xe91c=['bluebird','request-promise','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x4d1f55,_0x422572){var _0xc051d8=function(_0x5103f0){while(--_0x5103f0){_0x4d1f55['push'](_0x4d1f55['shift']());}};_0xc051d8(++_0x422572);}(_0xe91c,0x119));var _0xce91=function(_0x5bd10f,_0x4913e9){_0x5bd10f=_0x5bd10f-0x0;var _0xed352b=_0xe91c[_0x5bd10f];return _0xed352b;};'use strict';var _=require(_0xce91('0x0'));var util=require(_0xce91('0x1'));var logger=require(_0xce91('0x2'))(_0xce91('0x3'));var moment=require(_0xce91('0x4'));var BPromise=require(_0xce91('0x5'));var rp=require(_0xce91('0x6'));var attributes=require(_0xce91('0x7'));var integrations=require(_0xce91('0x8'));module[_0xce91('0x9')]=function(_0x4a3f55,_0xda67a){return _0x4a3f55[_0xce91('0xa')](_0xce91('0xb'),attributes,{'tableName':_0xce91('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7eba=['int_zendesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount'];(function(_0x1875be,_0x3b8c30){var _0x3e3950=function(_0xb90242){while(--_0xb90242){_0x1875be['push'](_0x1875be['shift']());}};_0x3e3950(++_0x3b8c30);}(_0x7eba,0x121));var _0xa7eb=function(_0x567df6,_0x268db8){_0x567df6=_0x567df6-0x0;var _0x5c97e2=_0x7eba[_0x567df6];return _0x5c97e2;};'use strict';var _=require(_0xa7eb('0x0'));var util=require(_0xa7eb('0x1'));var logger=require(_0xa7eb('0x2'))(_0xa7eb('0x3'));var moment=require(_0xa7eb('0x4'));var BPromise=require('bluebird');var rp=require(_0xa7eb('0x5'));var attributes=require(_0xa7eb('0x6'));var integrations=require(_0xa7eb('0x7'));module[_0xa7eb('0x8')]=function(_0x1f977a,_0x3c6c31){return _0x1f977a[_0xa7eb('0x9')](_0xa7eb('0xa'),attributes,{'tableName':_0xa7eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 82e7e0f..c0dbc5d 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 _0x74e2=['GetZendeskAccount','ZendeskAccount','options','raw','attributes','include','map','model','then','debug','catch','ShowZendeskAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x37fa56,_0x41bef3){var _0xe3272a=function(_0x492714){while(--_0x492714){_0x37fa56['push'](_0x37fa56['shift']());}};_0xe3272a(++_0x41bef3);}(_0x74e2,0x1d4));var _0x274e=function(_0x5e0bda,_0x4c9b6b){_0x5e0bda=_0x5e0bda-0x0;var _0x5cc542=_0x74e2[_0x5e0bda];return _0x5cc542;};'use strict';var _=require(_0x274e('0x0'));var util=require(_0x274e('0x1'));var moment=require(_0x274e('0x2'));var BPromise=require(_0x274e('0x3'));var rs=require(_0x274e('0x4'));var fs=require('fs');var Redis=require(_0x274e('0x5'));var db=require(_0x274e('0x6'))['db'];var utils=require(_0x274e('0x7'));var logger=require(_0x274e('0x8'))(_0x274e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x274e('0xa')][_0x274e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41273a,_0x6b33b8,_0x332590){return new BPromise(function(_0x4aa79e,_0x580439){return client[_0x274e('0xc')](_0x41273a,_0x332590)['then'](function(_0x7e384d){logger[_0x274e('0xd')](_0x274e('0xe'),_0x6b33b8,_0x274e('0xf'));logger['debug'](_0x274e('0x10'),_0x6b33b8,_0x274e('0xf'),JSON[_0x274e('0x11')](_0x7e384d));if(_0x7e384d[_0x274e('0x12')]){if(_0x7e384d[_0x274e('0x12')][_0x274e('0x13')]===0x1f4){logger['error'](_0x274e('0xe'),_0x6b33b8,_0x7e384d[_0x274e('0x12')]['message']);return _0x580439(_0x7e384d[_0x274e('0x12')][_0x274e('0x14')]);}logger[_0x274e('0x12')](_0x274e('0xe'),_0x6b33b8,_0x7e384d[_0x274e('0x12')][_0x274e('0x14')]);return _0x4aa79e(_0x7e384d[_0x274e('0x12')]['message']);}else{logger['info'](_0x274e('0xe'),_0x6b33b8,_0x274e('0xf'));_0x4aa79e(_0x7e384d[_0x274e('0x15')]['message']);}})['catch'](function(_0x7d017e){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x6b33b8,_0x7d017e);_0x580439(_0x7d017e);});});}exports[_0x274e('0x16')]=function(_0x351151){var _0xdf5d05=this;return new Promise(function(_0x500f54,_0x18ae01){return db[_0x274e('0x17')]['findAll']({'raw':_0x351151[_0x274e('0x18')]?_0x351151['options'][_0x274e('0x19')]===undefined?!![]:![]:!![],'where':_0x351151[_0x274e('0x18')]?_0x351151[_0x274e('0x18')]['where']||null:null,'attributes':_0x351151['options']?_0x351151[_0x274e('0x18')][_0x274e('0x1a')]||null:null,'limit':_0x351151[_0x274e('0x18')]?_0x351151[_0x274e('0x18')]['limit']||null:null,'include':_0x351151['options']?_0x351151[_0x274e('0x18')][_0x274e('0x1b')]?_[_0x274e('0x1c')](_0x351151[_0x274e('0x18')][_0x274e('0x1b')],function(_0x4a455c){return{'model':db[_0x4a455c['model']],'as':_0x4a455c['as'],'attributes':_0x4a455c[_0x274e('0x1a')],'include':_0x4a455c[_0x274e('0x1b')]?_[_0x274e('0x1c')](_0x4a455c['include'],function(_0x4ab121){return{'model':db[_0x4ab121[_0x274e('0x1d')]],'as':_0x4ab121['as'],'attributes':_0x4ab121[_0x274e('0x1a')],'include':_0x4ab121[_0x274e('0x1b')]?_[_0x274e('0x1c')](_0x4ab121['include'],function(_0x5a9c6c){return{'model':db[_0x5a9c6c['model']],'as':_0x5a9c6c['as'],'attributes':_0x5a9c6c[_0x274e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x274e('0x1e')](function(_0x5ee756){logger[_0x274e('0xd')]('GetZendeskAccount',_0x351151);logger[_0x274e('0x1f')](_0x274e('0x16'),_0x351151,JSON['stringify'](_0x5ee756));_0x500f54(_0x5ee756);})[_0x274e('0x20')](function(_0x13a6ad){logger[_0x274e('0x12')]('GetZendeskAccount',_0x13a6ad[_0x274e('0x14')],_0x351151);_0x18ae01(_0xdf5d05[_0x274e('0x12')](0x1f4,_0x13a6ad[_0x274e('0x14')]));});});};exports[_0x274e('0x21')]=function(_0x4073c8){var _0x450e1c=this;return new Promise(function(_0x7bcfb3,_0x5da7e4){return db['ZendeskAccount']['find']({'raw':_0x4073c8['options']?_0x4073c8['options'][_0x274e('0x19')]===undefined?!![]:![]:!![],'where':_0x4073c8['options']?_0x4073c8[_0x274e('0x18')][_0x274e('0x22')]||null:null,'attributes':_0x4073c8[_0x274e('0x18')]?_0x4073c8['options'][_0x274e('0x1a')]||null:null,'include':_0x4073c8[_0x274e('0x18')]?_0x4073c8[_0x274e('0x18')][_0x274e('0x1b')]?_[_0x274e('0x1c')](_0x4073c8['options']['include'],function(_0x443005){return{'model':db[_0x443005[_0x274e('0x1d')]],'as':_0x443005['as'],'attributes':_0x443005['attributes'],'include':_0x443005[_0x274e('0x1b')]?_[_0x274e('0x1c')](_0x443005[_0x274e('0x1b')],function(_0x341562){return{'model':db[_0x341562[_0x274e('0x1d')]],'as':_0x341562['as'],'attributes':_0x341562[_0x274e('0x1a')],'include':_0x341562[_0x274e('0x1b')]?_[_0x274e('0x1c')](_0x341562[_0x274e('0x1b')],function(_0x3b8b46){return{'model':db[_0x3b8b46['model']],'as':_0x3b8b46['as'],'attributes':_0x3b8b46[_0x274e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x274e('0x1e')](function(_0x48746a){logger[_0x274e('0xd')](_0x274e('0x21'),_0x4073c8);logger[_0x274e('0x1f')]('ShowZendeskAccount',_0x4073c8,JSON[_0x274e('0x11')](_0x48746a));_0x7bcfb3(_0x48746a);})[_0x274e('0x20')](function(_0x3ae542){logger['error'](_0x274e('0x21'),_0x3ae542[_0x274e('0x14')],_0x4073c8);_0x5da7e4(_0x450e1c['error'](0x1f4,_0x3ae542['message']));});});}; \ No newline at end of file +var _0x7af0=['code','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetZendeskAccount','ZendeskAccount','find','ShowZendeskAccount','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x370ac9,_0x3a39bd){var _0x57d290=function(_0x3e1599){while(--_0x3e1599){_0x370ac9['push'](_0x370ac9['shift']());}};_0x57d290(++_0x3a39bd);}(_0x7af0,0x139));var _0x07af=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x7af0[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0x07af('0x0'));var util=require(_0x07af('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07af('0x2'));var db=require(_0x07af('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x07af('0x4'))(_0x07af('0x5'));var config=require(_0x07af('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x07af('0x7')][_0x07af('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c89ac,_0x1e461e,_0x15bb4e){return new BPromise(function(_0x7dd0a2,_0xabb75c){return client[_0x07af('0x9')](_0x5c89ac,_0x15bb4e)[_0x07af('0xa')](function(_0x1da9b3){logger[_0x07af('0xb')](_0x07af('0xc'),_0x1e461e,_0x07af('0xd'));logger[_0x07af('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x1e461e,'request\x20sent',JSON[_0x07af('0xf')](_0x1da9b3));if(_0x1da9b3[_0x07af('0x10')]){if(_0x1da9b3[_0x07af('0x10')][_0x07af('0x11')]===0x1f4){logger['error'](_0x07af('0xc'),_0x1e461e,_0x1da9b3[_0x07af('0x10')][_0x07af('0x12')]);return _0xabb75c(_0x1da9b3[_0x07af('0x10')][_0x07af('0x12')]);}logger['error'](_0x07af('0xc'),_0x1e461e,_0x1da9b3[_0x07af('0x10')][_0x07af('0x12')]);return _0x7dd0a2(_0x1da9b3[_0x07af('0x10')]['message']);}else{logger[_0x07af('0xb')](_0x07af('0xc'),_0x1e461e,_0x07af('0xd'));_0x7dd0a2(_0x1da9b3[_0x07af('0x13')][_0x07af('0x12')]);}})[_0x07af('0x14')](function(_0x5666b6){logger['error'](_0x07af('0xc'),_0x1e461e,_0x5666b6);_0xabb75c(_0x5666b6);});});}exports['GetZendeskAccount']=function(_0x117bc6){var _0xaae6e0=this;return new Promise(function(_0x3f3ebb,_0x447a54){return db['ZendeskAccount']['findAll']({'raw':_0x117bc6['options']?_0x117bc6[_0x07af('0x15')][_0x07af('0x16')]===undefined?!![]:![]:!![],'where':_0x117bc6[_0x07af('0x15')]?_0x117bc6[_0x07af('0x15')][_0x07af('0x17')]||null:null,'attributes':_0x117bc6[_0x07af('0x15')]?_0x117bc6[_0x07af('0x15')][_0x07af('0x18')]||null:null,'limit':_0x117bc6[_0x07af('0x15')]?_0x117bc6['options'][_0x07af('0x19')]||null:null,'include':_0x117bc6['options']?_0x117bc6[_0x07af('0x15')][_0x07af('0x1a')]?_[_0x07af('0x1b')](_0x117bc6[_0x07af('0x15')]['include'],function(_0x4cf1ca){return{'model':db[_0x4cf1ca[_0x07af('0x1c')]],'as':_0x4cf1ca['as'],'attributes':_0x4cf1ca[_0x07af('0x18')],'include':_0x4cf1ca[_0x07af('0x1a')]?_['map'](_0x4cf1ca[_0x07af('0x1a')],function(_0x223384){return{'model':db[_0x223384[_0x07af('0x1c')]],'as':_0x223384['as'],'attributes':_0x223384[_0x07af('0x18')],'include':_0x223384[_0x07af('0x1a')]?_[_0x07af('0x1b')](_0x223384['include'],function(_0x1b30c9){return{'model':db[_0x1b30c9[_0x07af('0x1c')]],'as':_0x1b30c9['as'],'attributes':_0x1b30c9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x8d512a){logger[_0x07af('0xb')]('GetZendeskAccount',_0x117bc6);logger[_0x07af('0xe')](_0x07af('0x1d'),_0x117bc6,JSON[_0x07af('0xf')](_0x8d512a));_0x3f3ebb(_0x8d512a);})[_0x07af('0x14')](function(_0x1bdeb6){logger[_0x07af('0x10')](_0x07af('0x1d'),_0x1bdeb6[_0x07af('0x12')],_0x117bc6);_0x447a54(_0xaae6e0[_0x07af('0x10')](0x1f4,_0x1bdeb6['message']));});});};exports['ShowZendeskAccount']=function(_0x4db158){var _0xb30d1e=this;return new Promise(function(_0x33a148,_0x5cd94b){return db[_0x07af('0x1e')][_0x07af('0x1f')]({'raw':_0x4db158[_0x07af('0x15')]?_0x4db158[_0x07af('0x15')][_0x07af('0x16')]===undefined?!![]:![]:!![],'where':_0x4db158[_0x07af('0x15')]?_0x4db158[_0x07af('0x15')][_0x07af('0x17')]||null:null,'attributes':_0x4db158[_0x07af('0x15')]?_0x4db158[_0x07af('0x15')]['attributes']||null:null,'include':_0x4db158[_0x07af('0x15')]?_0x4db158[_0x07af('0x15')][_0x07af('0x1a')]?_[_0x07af('0x1b')](_0x4db158['options'][_0x07af('0x1a')],function(_0xfa9f25){return{'model':db[_0xfa9f25[_0x07af('0x1c')]],'as':_0xfa9f25['as'],'attributes':_0xfa9f25[_0x07af('0x18')],'include':_0xfa9f25[_0x07af('0x1a')]?_[_0x07af('0x1b')](_0xfa9f25[_0x07af('0x1a')],function(_0x207d4e){return{'model':db[_0x207d4e['model']],'as':_0x207d4e['as'],'attributes':_0x207d4e[_0x07af('0x18')],'include':_0x207d4e[_0x07af('0x1a')]?_[_0x07af('0x1b')](_0x207d4e['include'],function(_0xcd22f6){return{'model':db[_0xcd22f6[_0x07af('0x1c')]],'as':_0xcd22f6['as'],'attributes':_0xcd22f6['attributes']};}):[]};}):[]};}):[]:[]})[_0x07af('0xa')](function(_0x4b126e){logger[_0x07af('0xb')](_0x07af('0x20'),_0x4db158);logger[_0x07af('0xe')]('ShowZendeskAccount',_0x4db158,JSON['stringify'](_0x4b126e));_0x33a148(_0x4b126e);})[_0x07af('0x14')](function(_0x46c285){logger[_0x07af('0x10')](_0x07af('0x20'),_0x46c285[_0x07af('0x12')],_0x4db158);_0x5cd94b(_0xb30d1e[_0x07af('0x10')](0x1f4,_0x46c285[_0x07af('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index c001cf1..e9aacce 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 _0xa5a6=['/:id','show','/:id/fields','getDescriptions','/:id/tags','post','setTags','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index'];(function(_0x33de88,_0x581346){var _0x105957=function(_0x52752d){while(--_0x52752d){_0x33de88['push'](_0x33de88['shift']());}};_0x105957(++_0x581346);}(_0xa5a6,0xac));var _0x6a5a=function(_0x26bcec,_0xe13f50){_0x26bcec=_0x26bcec-0x0;var _0x1049dc=_0xa5a6[_0x26bcec];return _0x1049dc;};'use strict';var multer=require(_0x6a5a('0x0'));var util=require(_0x6a5a('0x1'));var path=require(_0x6a5a('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a5a('0x3'));var router=express[_0x6a5a('0x4')]();var auth=require(_0x6a5a('0x5'));var interaction=require(_0x6a5a('0x6'));var config=require(_0x6a5a('0x7'));var controller=require(_0x6a5a('0x8'));router[_0x6a5a('0x9')]('/',auth[_0x6a5a('0xa')](),controller[_0x6a5a('0xb')]);router[_0x6a5a('0x9')](_0x6a5a('0xc'),auth['isAuthenticated'](),controller[_0x6a5a('0xd')]);router[_0x6a5a('0x9')](_0x6a5a('0xe'),auth[_0x6a5a('0xa')](),controller['getFields']);router[_0x6a5a('0x9')]('/:id/subjects',auth[_0x6a5a('0xa')](),controller['getSubjects']);router[_0x6a5a('0x9')]('/:id/descriptions',auth[_0x6a5a('0xa')](),controller[_0x6a5a('0xf')]);router[_0x6a5a('0x9')](_0x6a5a('0x10'),auth[_0x6a5a('0xa')](),controller['getTags']);router[_0x6a5a('0x11')]('/',auth[_0x6a5a('0xa')](),controller['create']);router[_0x6a5a('0x11')](_0x6a5a('0x10'),auth['isAuthenticated'](),controller[_0x6a5a('0x12')]);router[_0x6a5a('0x13')](_0x6a5a('0xc'),auth[_0x6a5a('0xa')](),controller['update']);router[_0x6a5a('0x14')](_0x6a5a('0xc'),auth[_0x6a5a('0xa')](),controller[_0x6a5a('0x15')]);module[_0x6a5a('0x16')]=router; \ No newline at end of file +var _0xc0d2=['connect-timeout','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','setTags','put','update','destroy','exports','util','path'];(function(_0x30d6e2,_0x2b5b17){var _0x4b6b98=function(_0x26afe1){while(--_0x26afe1){_0x30d6e2['push'](_0x30d6e2['shift']());}};_0x4b6b98(++_0x2b5b17);}(_0xc0d2,0x98));var _0x2c0d=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xc0d2[_0xefd519];return _0x4bb882;};'use strict';var multer=require('multer');var util=require(_0x2c0d('0x0'));var path=require(_0x2c0d('0x1'));var timeout=require(_0x2c0d('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x2c0d('0x3'));var interaction=require(_0x2c0d('0x4'));var config=require('../../config/environment');var controller=require(_0x2c0d('0x5'));router['get']('/',auth[_0x2c0d('0x6')](),controller[_0x2c0d('0x7')]);router[_0x2c0d('0x8')](_0x2c0d('0x9'),auth[_0x2c0d('0x6')](),controller[_0x2c0d('0xa')]);router[_0x2c0d('0x8')]('/:id/fields',auth[_0x2c0d('0x6')](),controller['getFields']);router[_0x2c0d('0x8')](_0x2c0d('0xb'),auth[_0x2c0d('0x6')](),controller['getSubjects']);router['get'](_0x2c0d('0xc'),auth['isAuthenticated'](),controller[_0x2c0d('0xd')]);router[_0x2c0d('0x8')](_0x2c0d('0xe'),auth[_0x2c0d('0x6')](),controller[_0x2c0d('0xf')]);router['post']('/',auth[_0x2c0d('0x6')](),controller[_0x2c0d('0x10')]);router['post'](_0x2c0d('0xe'),auth[_0x2c0d('0x6')](),controller[_0x2c0d('0x11')]);router[_0x2c0d('0x12')]('/:id',auth[_0x2c0d('0x6')](),controller[_0x2c0d('0x13')]);router['delete'](_0x2c0d('0x9'),auth[_0x2c0d('0x6')](),controller[_0x2c0d('0x14')]);module[_0x2c0d('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index d3fcb20..acf542d 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 _0x168f=['sequelize','STRING'];(function(_0x2d96c1,_0x5bbd37){var _0x5e102d=function(_0x51f30f){while(--_0x51f30f){_0x2d96c1['push'](_0x2d96c1['shift']());}};_0x5e102d(++_0x5bbd37);}(_0x168f,0x96));var _0xf168=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0x168f[_0x2fd69d];return _0x5d5ef3;};'use strict';var Sequelize=require(_0xf168('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf168('0x1')]}}; \ No newline at end of file +var _0x5c02=['STRING','sequelize','exports'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0x5c02,0x166));var _0x25c0=function(_0x198f31,_0x55fc7a){_0x198f31=_0x198f31-0x0;var _0x3d1d9a=_0x5c02[_0x198f31];return _0x3d1d9a;};'use strict';var Sequelize=require(_0x25c0('0x0'));module[_0x25c0('0x1')]={'name':{'type':Sequelize[_0x25c0('0x2')]},'description':{'type':Sequelize[_0x25c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index e141859..79203ea 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 _0xdc00=['html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','ZendeskConfiguration','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','field','options','includeAll','include','findAll','rows','params','rawAttributes','create','body','update','find','getFields','findOne','order','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','ids'];(function(_0x54e512,_0x3eb474){var _0x29db21=function(_0x3ea672){while(--_0x3ea672){_0x54e512['push'](_0x54e512['shift']());}};_0x29db21(++_0x3eb474);}(_0xdc00,0xb0));var _0x0dc0=function(_0x1f0a5f,_0x3ac5c3){_0x1f0a5f=_0x1f0a5f-0x0;var _0x23350b=_0xdc00[_0x1f0a5f];return _0x23350b;};'use strict';var pdf=require(_0x0dc0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0dc0('0x1'));var zipdir=require(_0x0dc0('0x2'));var jsonpatch=require(_0x0dc0('0x3'));var rp=require('request-promise');var moment=require(_0x0dc0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0dc0('0x5'));var util=require(_0x0dc0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0dc0('0x7'));var ejs=require(_0x0dc0('0x8'));var fs=require('fs');var _=require(_0x0dc0('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0dc0('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0dc0('0xb'));var Papa=require(_0x0dc0('0xc'));var authService=require('../../components/auth/service');var hardwareService=require(_0x0dc0('0xd'));var Redis=require(_0x0dc0('0xe'));var qs=require(_0x0dc0('0xf'));var logger=require(_0x0dc0('0x10'))(_0x0dc0('0x11'));var utils=require('../../config/utils');var config=require(_0x0dc0('0x12'));var db=require(_0x0dc0('0x13'))['db'];var jayson=require(_0x0dc0('0x14'));var client=jayson[_0x0dc0('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34399b,_0x239d4d,_0x7d11d7,_0x55e9ef){return new BPromise(function(_0x49eb5d,_0x160bdf){var _0x4a1a82=_0x55e9ef||client;return _0x4a1a82[_0x0dc0('0x16')](_0x34399b,_0x7d11d7)[_0x0dc0('0x17')](function(_0x4a33b8){logger[_0x0dc0('0x18')](_0x0dc0('0x19'),_0x239d4d,_0x0dc0('0x1a'));logger[_0x0dc0('0x1b')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x239d4d,_0x0dc0('0x1a'),JSON['stringify'](_0x4a33b8));if(_0x4a33b8[_0x0dc0('0x1c')]){if(_0x4a33b8[_0x0dc0('0x1c')][_0x0dc0('0x1d')]===0x1f4){logger[_0x0dc0('0x1c')](_0x0dc0('0x19'),_0x239d4d,_0x4a33b8[_0x0dc0('0x1c')][_0x0dc0('0x1e')]);return _0x160bdf(_0x4a33b8['error'][_0x0dc0('0x1e')]);}logger['error'](_0x0dc0('0x19'),_0x239d4d,_0x4a33b8[_0x0dc0('0x1c')][_0x0dc0('0x1e')]);return _0x49eb5d(_0x4a33b8[_0x0dc0('0x1c')][_0x0dc0('0x1e')]);}else{logger['info'](_0x0dc0('0x19'),_0x239d4d,_0x0dc0('0x1a'));_0x49eb5d(_0x4a33b8[_0x0dc0('0x1f')][_0x0dc0('0x1e')]);}})[_0x0dc0('0x20')](function(_0x34c82d){logger[_0x0dc0('0x1c')]('ZendeskConfiguration,\x20%s,\x20%s',_0x239d4d,_0x34c82d);_0x160bdf(_0x34c82d);});});}function respondWithStatusCode(_0x35d0e9,_0x201706){_0x201706=_0x201706||0xcc;return function(_0x46725c){if(_0x46725c){return _0x35d0e9[_0x0dc0('0x21')](_0x201706);}return _0x35d0e9[_0x0dc0('0x22')](_0x201706)['end']();};}function respondWithResult(_0x5d9a74,_0x59e841){_0x59e841=_0x59e841||0xc8;return function(_0x49a6f0){if(_0x49a6f0){return _0x5d9a74[_0x0dc0('0x22')](_0x59e841)['json'](_0x49a6f0);}};}function respondWithFilteredResult(_0x30e7d3,_0x3572b){return function(_0x17eb8b){if(_0x17eb8b){var _0x1c4b61=_0x17eb8b[_0x0dc0('0x23')],_0x30ffe1=_0x3572b[_0x0dc0('0x24')],_0x37af22=_0x3572b['offset']+_0x3572b[_0x0dc0('0x25')],_0x4e8195;if(_0x37af22>=_0x1c4b61){_0x37af22=_0x1c4b61;_0x4e8195=0xc8;}else{_0x4e8195=0xce;}_0x30e7d3[_0x0dc0('0x22')](_0x4e8195);return _0x30e7d3[_0x0dc0('0x26')](_0x0dc0('0x27'),_0x30ffe1+'-'+_0x37af22+'/'+_0x1c4b61)[_0x0dc0('0x28')](_0x17eb8b);}return null;};}function patchUpdates(_0x4b17c3){return function(_0x25dd73){try{jsonpatch[_0x0dc0('0x29')](_0x25dd73,_0x4b17c3,!![]);}catch(_0x3969ed){return BPromise[_0x0dc0('0x2a')](_0x3969ed);}return _0x25dd73[_0x0dc0('0x2b')]();};}function saveUpdates(_0x2a4678,_0x137cdd){return function(_0x1a105e){if(_0x1a105e){return _0x1a105e['update'](_0x2a4678)['then'](function(_0x23234a){return _0x23234a;});}return null;};}function removeEntity(_0x3d96b9,_0xf470fd){return function(_0x3222f7){if(_0x3222f7){return _0x3222f7[_0x0dc0('0x2c')]()[_0x0dc0('0x17')](function(){_0x3d96b9[_0x0dc0('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46b466,_0x49725a){return function(_0x367304){if(!_0x367304){_0x46b466[_0x0dc0('0x21')](0x194);}return _0x367304;};}function handleError(_0x774ec0,_0x56099e){_0x56099e=_0x56099e||0x1f4;return function(_0x21ee13){logger[_0x0dc0('0x1c')](_0x21ee13[_0x0dc0('0x2d')]);if(_0x21ee13[_0x0dc0('0x2e')]){delete _0x21ee13[_0x0dc0('0x2e')];}_0x774ec0[_0x0dc0('0x22')](_0x56099e)[_0x0dc0('0x2f')](_0x21ee13);};}exports['index']=function(_0x462c13,_0x308fbd){var _0xc525b7={},_0x3eb81a={},_0x4d6a2e={'count':0x0,'rows':[]};var _0x26f685=db[_0x0dc0('0x30')]['rawAttributes'];_0x3eb81a[_0x0dc0('0x31')]=_[_0x0dc0('0x32')](_0x26f685);_0x3eb81a[_0x0dc0('0x33')]=_[_0x0dc0('0x32')](_0x462c13[_0x0dc0('0x33')]);_0x3eb81a[_0x0dc0('0x34')]=_[_0x0dc0('0x35')](_0x3eb81a[_0x0dc0('0x31')],_0x3eb81a[_0x0dc0('0x33')]);_0xc525b7[_0x0dc0('0x36')]=_[_0x0dc0('0x35')](_0x3eb81a[_0x0dc0('0x31')],qs[_0x0dc0('0x37')](_0x462c13[_0x0dc0('0x33')]['fields']));_0xc525b7[_0x0dc0('0x36')]=_0xc525b7[_0x0dc0('0x36')][_0x0dc0('0x38')]?_0xc525b7[_0x0dc0('0x36')]:_0x3eb81a['model'];if(!_0x462c13[_0x0dc0('0x33')][_0x0dc0('0x39')](_0x0dc0('0x3a'))){_0xc525b7[_0x0dc0('0x25')]=qs[_0x0dc0('0x25')](_0x462c13[_0x0dc0('0x33')][_0x0dc0('0x25')]);_0xc525b7[_0x0dc0('0x24')]=qs[_0x0dc0('0x24')](_0x462c13[_0x0dc0('0x33')][_0x0dc0('0x24')]);}_0xc525b7['order']=qs[_0x0dc0('0x3b')](_0x462c13[_0x0dc0('0x33')][_0x0dc0('0x3b')]);_0xc525b7[_0x0dc0('0x3c')]=qs[_0x0dc0('0x34')](_[_0x0dc0('0x3d')](_0x462c13[_0x0dc0('0x33')],_0x3eb81a[_0x0dc0('0x34')]));if(_0x462c13[_0x0dc0('0x33')][_0x0dc0('0x3e')]){_0xc525b7['where']=_[_0x0dc0('0x3f')](_0xc525b7[_0x0dc0('0x3c')],{'$or':_[_0x0dc0('0x40')](_0x26f685,function(_0x2fe2c1){if(_0x2fe2c1['type']['key']!==_0x0dc0('0x41')){var _0x52927f={};_0x52927f[_0x2fe2c1[_0x0dc0('0x42')]]={'$like':'%'+_0x462c13[_0x0dc0('0x33')][_0x0dc0('0x3e')]+'%'};return _0x52927f;}})});}_0xc525b7=_[_0x0dc0('0x3f')]({},_0xc525b7,_0x462c13[_0x0dc0('0x43')]);var _0xc36e25={'where':_0xc525b7['where']};return db['ZendeskConfiguration'][_0x0dc0('0x23')](_0xc36e25)['then'](function(_0x2463e3){_0x4d6a2e[_0x0dc0('0x23')]=_0x2463e3;if(_0x462c13[_0x0dc0('0x33')][_0x0dc0('0x44')]){_0xc525b7[_0x0dc0('0x45')]=[{'all':!![]}];}return db[_0x0dc0('0x30')][_0x0dc0('0x46')](_0xc525b7);})['then'](function(_0x567d86){_0x4d6a2e[_0x0dc0('0x47')]=_0x567d86;return _0x4d6a2e;})['then'](respondWithFilteredResult(_0x308fbd,_0xc525b7))[_0x0dc0('0x20')](handleError(_0x308fbd,null));};exports['show']=function(_0x4d7375,_0x59cc47){var _0x122657={'raw':![],'where':{'id':_0x4d7375[_0x0dc0('0x48')]['id']}},_0x44b15a={};_0x44b15a['model']=_[_0x0dc0('0x32')](db['ZendeskConfiguration'][_0x0dc0('0x49')]);_0x44b15a[_0x0dc0('0x33')]=_[_0x0dc0('0x32')](_0x4d7375[_0x0dc0('0x33')]);_0x44b15a[_0x0dc0('0x34')]=_['intersection'](_0x44b15a['model'],_0x44b15a['query']);_0x122657[_0x0dc0('0x36')]=_[_0x0dc0('0x35')](_0x44b15a[_0x0dc0('0x31')],qs[_0x0dc0('0x37')](_0x4d7375[_0x0dc0('0x33')][_0x0dc0('0x37')]));_0x122657[_0x0dc0('0x36')]=_0x122657[_0x0dc0('0x36')][_0x0dc0('0x38')]?_0x122657['attributes']:_0x44b15a[_0x0dc0('0x31')];if(_0x4d7375['query'][_0x0dc0('0x44')]){_0x122657[_0x0dc0('0x45')]=[{'all':!![]}];}_0x122657=_[_0x0dc0('0x3f')]({},_0x122657,_0x4d7375[_0x0dc0('0x43')]);return db[_0x0dc0('0x30')]['find'](_0x122657)[_0x0dc0('0x17')](handleEntityNotFound(_0x59cc47,null))[_0x0dc0('0x17')](respondWithResult(_0x59cc47,null))[_0x0dc0('0x20')](handleError(_0x59cc47,null));};exports[_0x0dc0('0x4a')]=function(_0x9ed15b,_0x5bba07){return db[_0x0dc0('0x30')][_0x0dc0('0x4a')](_0x9ed15b[_0x0dc0('0x4b')],{})[_0x0dc0('0x17')](respondWithResult(_0x5bba07,0xc9))['catch'](handleError(_0x5bba07,null));};exports[_0x0dc0('0x4c')]=function(_0x52e004,_0x940166){if(_0x52e004[_0x0dc0('0x4b')]['id']){delete _0x52e004[_0x0dc0('0x4b')]['id'];}return db[_0x0dc0('0x30')][_0x0dc0('0x4d')]({'where':{'id':_0x52e004[_0x0dc0('0x48')]['id']}})[_0x0dc0('0x17')](handleEntityNotFound(_0x940166,null))[_0x0dc0('0x17')](saveUpdates(_0x52e004['body'],null))[_0x0dc0('0x17')](respondWithResult(_0x940166,null))[_0x0dc0('0x20')](handleError(_0x940166,null));};exports['destroy']=function(_0x579974,_0x4acc9e){return db[_0x0dc0('0x30')][_0x0dc0('0x4d')]({'where':{'id':_0x579974[_0x0dc0('0x48')]['id']}})[_0x0dc0('0x17')](handleEntityNotFound(_0x4acc9e,null))[_0x0dc0('0x17')](removeEntity(_0x4acc9e,null))[_0x0dc0('0x20')](handleError(_0x4acc9e,null));};exports[_0x0dc0('0x4e')]=function(_0x31e1d9,_0x19cefe,_0xbe0d76){var _0x111bdb={};var _0x4f3ab5={};var _0x5982a3;var _0x4a2a96;return db[_0x0dc0('0x30')][_0x0dc0('0x4f')]({'where':{'id':_0x31e1d9[_0x0dc0('0x48')]['id']}})['then'](handleEntityNotFound(_0x19cefe,null))[_0x0dc0('0x17')](function(_0x3bcb5d){if(_0x3bcb5d){_0x5982a3=_0x3bcb5d;_0x4f3ab5[_0x0dc0('0x31')]=_[_0x0dc0('0x32')](db['ZendeskField']['rawAttributes']);_0x4f3ab5[_0x0dc0('0x33')]=_[_0x0dc0('0x32')](_0x31e1d9[_0x0dc0('0x33')]);_0x4f3ab5[_0x0dc0('0x34')]=_[_0x0dc0('0x35')](_0x4f3ab5['model'],_0x4f3ab5[_0x0dc0('0x33')]);_0x111bdb['attributes']=_['intersection'](_0x4f3ab5[_0x0dc0('0x31')],qs[_0x0dc0('0x37')](_0x31e1d9[_0x0dc0('0x33')][_0x0dc0('0x37')]));_0x111bdb[_0x0dc0('0x36')]=_0x111bdb[_0x0dc0('0x36')][_0x0dc0('0x38')]?_0x111bdb['attributes']:_0x4f3ab5['model'];_0x111bdb[_0x0dc0('0x50')]=qs['sort'](_0x31e1d9[_0x0dc0('0x33')][_0x0dc0('0x3b')]);_0x111bdb[_0x0dc0('0x3c')]=qs[_0x0dc0('0x34')](_['pick'](_0x31e1d9[_0x0dc0('0x33')],_0x4f3ab5[_0x0dc0('0x34')]));if(_0x31e1d9[_0x0dc0('0x33')][_0x0dc0('0x3e')]){_0x111bdb[_0x0dc0('0x3c')]=_[_0x0dc0('0x3f')](_0x111bdb['where'],{'$or':_[_0x0dc0('0x40')](_0x111bdb[_0x0dc0('0x36')],function(_0x2b0a2b){var _0x31719c={};_0x31719c[_0x2b0a2b]={'$like':'%'+_0x31e1d9[_0x0dc0('0x33')]['filter']+'%'};return _0x31719c;})});}_0x111bdb=_['merge']({},_0x111bdb,_0x31e1d9['options']);return _0x5982a3[_0x0dc0('0x4e')](_0x111bdb);}})[_0x0dc0('0x17')](function(_0x4161b2){if(_0x4161b2){_0x4a2a96=_0x4161b2[_0x0dc0('0x38')];if(!_0x31e1d9[_0x0dc0('0x33')][_0x0dc0('0x39')](_0x0dc0('0x3a'))){_0x111bdb[_0x0dc0('0x25')]=qs['limit'](_0x31e1d9[_0x0dc0('0x33')][_0x0dc0('0x25')]);_0x111bdb[_0x0dc0('0x24')]=qs[_0x0dc0('0x24')](_0x31e1d9[_0x0dc0('0x33')][_0x0dc0('0x24')]);}return _0x5982a3['getFields'](_0x111bdb);}})[_0x0dc0('0x17')](function(_0x105def){if(_0x105def){return _0x105def?{'count':_0x4a2a96,'rows':_0x105def}:null;}})[_0x0dc0('0x17')](respondWithResult(_0x19cefe,null))[_0x0dc0('0x20')](handleError(_0x19cefe,null));};exports[_0x0dc0('0x51')]=function(_0x23f8dc,_0x355a82,_0x4c6f65){var _0x320aaa={};var _0x14be66={};var _0x553f6d;var _0x301771;return db['ZendeskConfiguration'][_0x0dc0('0x4f')]({'where':{'id':_0x23f8dc[_0x0dc0('0x48')]['id']}})[_0x0dc0('0x17')](handleEntityNotFound(_0x355a82,null))[_0x0dc0('0x17')](function(_0x20bb87){if(_0x20bb87){_0x553f6d=_0x20bb87;_0x14be66[_0x0dc0('0x31')]=_['keys'](db[_0x0dc0('0x52')][_0x0dc0('0x49')]);_0x14be66['query']=_[_0x0dc0('0x32')](_0x23f8dc[_0x0dc0('0x33')]);_0x14be66[_0x0dc0('0x34')]=_[_0x0dc0('0x35')](_0x14be66[_0x0dc0('0x31')],_0x14be66[_0x0dc0('0x33')]);_0x320aaa[_0x0dc0('0x36')]=_[_0x0dc0('0x35')](_0x14be66['model'],qs[_0x0dc0('0x37')](_0x23f8dc[_0x0dc0('0x33')][_0x0dc0('0x37')]));_0x320aaa[_0x0dc0('0x36')]=_0x320aaa[_0x0dc0('0x36')][_0x0dc0('0x38')]?_0x320aaa[_0x0dc0('0x36')]:_0x14be66['model'];_0x320aaa['order']=qs[_0x0dc0('0x3b')](_0x23f8dc['query']['sort']);_0x320aaa[_0x0dc0('0x3c')]=qs[_0x0dc0('0x34')](_[_0x0dc0('0x3d')](_0x23f8dc[_0x0dc0('0x33')],_0x14be66[_0x0dc0('0x34')]));if(_0x23f8dc[_0x0dc0('0x33')][_0x0dc0('0x3e')]){_0x320aaa[_0x0dc0('0x3c')]=_['merge'](_0x320aaa[_0x0dc0('0x3c')],{'$or':_['map'](_0x320aaa['attributes'],function(_0x9c4082){var _0x4901db={};_0x4901db[_0x9c4082]={'$like':'%'+_0x23f8dc[_0x0dc0('0x33')]['filter']+'%'};return _0x4901db;})});}_0x320aaa=_[_0x0dc0('0x3f')]({},_0x320aaa,_0x23f8dc['options']);return _0x553f6d[_0x0dc0('0x51')](_0x320aaa);}})[_0x0dc0('0x17')](function(_0x2e1b37){if(_0x2e1b37){_0x301771=_0x2e1b37[_0x0dc0('0x38')];if(!_0x23f8dc['query'][_0x0dc0('0x39')](_0x0dc0('0x3a'))){_0x320aaa[_0x0dc0('0x25')]=qs[_0x0dc0('0x25')](_0x23f8dc[_0x0dc0('0x33')][_0x0dc0('0x25')]);_0x320aaa[_0x0dc0('0x24')]=qs['offset'](_0x23f8dc[_0x0dc0('0x33')]['offset']);}return _0x553f6d[_0x0dc0('0x51')](_0x320aaa);}})[_0x0dc0('0x17')](function(_0x1c3fcb){if(_0x1c3fcb){return _0x1c3fcb?{'count':_0x301771,'rows':_0x1c3fcb}:null;}})['then'](respondWithResult(_0x355a82,null))[_0x0dc0('0x20')](handleError(_0x355a82,null));};exports[_0x0dc0('0x53')]=function(_0x95e8f9,_0x159be8,_0x1b4dc2){var _0xfdaf2f={};var _0x310745={};var _0xba7370;var _0x4167bd;return db[_0x0dc0('0x30')][_0x0dc0('0x4f')]({'where':{'id':_0x95e8f9['params']['id']}})['then'](handleEntityNotFound(_0x159be8,null))['then'](function(_0x5048aa){if(_0x5048aa){_0xba7370=_0x5048aa;_0x310745['model']=_[_0x0dc0('0x32')](db['ZendeskField']['rawAttributes']);_0x310745[_0x0dc0('0x33')]=_[_0x0dc0('0x32')](_0x95e8f9[_0x0dc0('0x33')]);_0x310745['filters']=_[_0x0dc0('0x35')](_0x310745['model'],_0x310745[_0x0dc0('0x33')]);_0xfdaf2f[_0x0dc0('0x36')]=_[_0x0dc0('0x35')](_0x310745[_0x0dc0('0x31')],qs[_0x0dc0('0x37')](_0x95e8f9['query']['fields']));_0xfdaf2f[_0x0dc0('0x36')]=_0xfdaf2f[_0x0dc0('0x36')][_0x0dc0('0x38')]?_0xfdaf2f[_0x0dc0('0x36')]:_0x310745[_0x0dc0('0x31')];_0xfdaf2f[_0x0dc0('0x50')]=qs[_0x0dc0('0x3b')](_0x95e8f9[_0x0dc0('0x33')]['sort']);_0xfdaf2f[_0x0dc0('0x3c')]=qs[_0x0dc0('0x34')](_[_0x0dc0('0x3d')](_0x95e8f9[_0x0dc0('0x33')],_0x310745[_0x0dc0('0x34')]));if(_0x95e8f9[_0x0dc0('0x33')][_0x0dc0('0x3e')]){_0xfdaf2f['where']=_['merge'](_0xfdaf2f[_0x0dc0('0x3c')],{'$or':_['map'](_0xfdaf2f[_0x0dc0('0x36')],function(_0x57acd4){var _0x50c2d5={};_0x50c2d5[_0x57acd4]={'$like':'%'+_0x95e8f9[_0x0dc0('0x33')]['filter']+'%'};return _0x50c2d5;})});}_0xfdaf2f=_[_0x0dc0('0x3f')]({},_0xfdaf2f,_0x95e8f9['options']);return _0xba7370['getDescriptions'](_0xfdaf2f);}})['then'](function(_0x1e77d5){if(_0x1e77d5){_0x4167bd=_0x1e77d5['length'];if(!_0x95e8f9[_0x0dc0('0x33')][_0x0dc0('0x39')](_0x0dc0('0x3a'))){_0xfdaf2f[_0x0dc0('0x25')]=qs['limit'](_0x95e8f9['query'][_0x0dc0('0x25')]);_0xfdaf2f[_0x0dc0('0x24')]=qs[_0x0dc0('0x24')](_0x95e8f9[_0x0dc0('0x33')][_0x0dc0('0x24')]);}return _0xba7370[_0x0dc0('0x53')](_0xfdaf2f);}})['then'](function(_0x4a9a36){if(_0x4a9a36){return _0x4a9a36?{'count':_0x4167bd,'rows':_0x4a9a36}:null;}})[_0x0dc0('0x17')](respondWithResult(_0x159be8,null))[_0x0dc0('0x20')](handleError(_0x159be8,null));};exports[_0x0dc0('0x54')]=function(_0xeb0b4b,_0x20eaae,_0x54374f){var _0x6218a9={};var _0x448a25={};var _0x2d84b7;var _0x5c7322;return db['ZendeskConfiguration'][_0x0dc0('0x4f')]({'where':{'id':_0xeb0b4b[_0x0dc0('0x48')]['id']}})['then'](handleEntityNotFound(_0x20eaae,null))[_0x0dc0('0x17')](function(_0x19eeae){if(_0x19eeae){_0x2d84b7=_0x19eeae;_0x448a25[_0x0dc0('0x31')]=_[_0x0dc0('0x32')](db[_0x0dc0('0x55')]['rawAttributes']);_0x448a25[_0x0dc0('0x33')]=_[_0x0dc0('0x32')](_0xeb0b4b[_0x0dc0('0x33')]);_0x448a25[_0x0dc0('0x34')]=_[_0x0dc0('0x35')](_0x448a25[_0x0dc0('0x31')],_0x448a25[_0x0dc0('0x33')]);_0x6218a9[_0x0dc0('0x36')]=_[_0x0dc0('0x35')](_0x448a25[_0x0dc0('0x31')],qs[_0x0dc0('0x37')](_0xeb0b4b[_0x0dc0('0x33')][_0x0dc0('0x37')]));_0x6218a9[_0x0dc0('0x36')]=_0x6218a9[_0x0dc0('0x36')][_0x0dc0('0x38')]?_0x6218a9['attributes']:_0x448a25[_0x0dc0('0x31')];_0x6218a9[_0x0dc0('0x50')]=qs[_0x0dc0('0x3b')](_0xeb0b4b[_0x0dc0('0x33')][_0x0dc0('0x3b')]);_0x6218a9[_0x0dc0('0x3c')]=qs[_0x0dc0('0x34')](_[_0x0dc0('0x3d')](_0xeb0b4b[_0x0dc0('0x33')],_0x448a25['filters']));if(_0xeb0b4b[_0x0dc0('0x33')][_0x0dc0('0x3e')]){_0x6218a9[_0x0dc0('0x3c')]=_[_0x0dc0('0x3f')](_0x6218a9[_0x0dc0('0x3c')],{'$or':_[_0x0dc0('0x40')](_0x6218a9[_0x0dc0('0x36')],function(_0x579458){var _0x58ae93={};_0x58ae93[_0x579458]={'$like':'%'+_0xeb0b4b['query'][_0x0dc0('0x3e')]+'%'};return _0x58ae93;})});}_0x6218a9=_[_0x0dc0('0x3f')]({},_0x6218a9,_0xeb0b4b[_0x0dc0('0x43')]);return _0x2d84b7[_0x0dc0('0x54')](_0x6218a9);}})[_0x0dc0('0x17')](function(_0x5c6825){if(_0x5c6825){_0x5c7322=_0x5c6825[_0x0dc0('0x38')];if(!_0xeb0b4b[_0x0dc0('0x33')][_0x0dc0('0x39')](_0x0dc0('0x3a'))){_0x6218a9[_0x0dc0('0x25')]=qs[_0x0dc0('0x25')](_0xeb0b4b[_0x0dc0('0x33')]['limit']);_0x6218a9[_0x0dc0('0x24')]=qs['offset'](_0xeb0b4b[_0x0dc0('0x33')][_0x0dc0('0x24')]);}return _0x2d84b7[_0x0dc0('0x54')](_0x6218a9);}})[_0x0dc0('0x17')](function(_0x2acd27){if(_0x2acd27){return _0x2acd27?{'count':_0x5c7322,'rows':_0x2acd27}:null;}})[_0x0dc0('0x17')](respondWithResult(_0x20eaae,null))[_0x0dc0('0x20')](handleError(_0x20eaae,null));};exports[_0x0dc0('0x56')]=function(_0x31ca1e,_0x1534c7,_0x105889){if(_0x31ca1e[_0x0dc0('0x4b')]['id']){delete _0x31ca1e[_0x0dc0('0x4b')]['id'];}return db[_0x0dc0('0x30')][_0x0dc0('0x4f')]({'where':{'id':_0x31ca1e[_0x0dc0('0x48')]['id']}})[_0x0dc0('0x17')](handleEntityNotFound(_0x1534c7,null))[_0x0dc0('0x17')](function(_0x360ad5){if(_0x360ad5){return _0x360ad5[_0x0dc0('0x56')](_0x31ca1e[_0x0dc0('0x4b')][_0x0dc0('0x57')]||[]);}return null;})[_0x0dc0('0x17')](respondWithResult(_0x1534c7,null))[_0x0dc0('0x20')](handleError(_0x1534c7,null));}; \ No newline at end of file +var _0x1e94=['name','send','index','ZendeskConfiguration','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','count','includeAll','include','rows','catch','show','params','rawAttributes','create','body','find','getFields','findOne','ZendeskField','map','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','status','end','offset','limit','set','Content-Range','json','reject','save','update','destroy','sendStatus','stack'];(function(_0x3ddd67,_0x2a102d){var _0x172e0b=function(_0x3e8786){while(--_0x3e8786){_0x3ddd67['push'](_0x3ddd67['shift']());}};_0x172e0b(++_0x2a102d);}(_0x1e94,0x87));var _0x41e9=function(_0x2f8de5,_0x3ab8ac){_0x2f8de5=_0x2f8de5-0x0;var _0x1364a6=_0x1e94[_0x2f8de5];return _0x1364a6;};'use strict';var pdf=require(_0x41e9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x41e9('0x1'));var jsonpatch=require(_0x41e9('0x2'));var rp=require(_0x41e9('0x3'));var moment=require('moment');var BPromise=require(_0x41e9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x41e9('0x5'));var csv=require(_0x41e9('0x6'));var ejs=require(_0x41e9('0x7'));var fs=require('fs');var _=require(_0x41e9('0x8'));var squel=require('squel');var crypto=require(_0x41e9('0x9'));var jsforce=require(_0x41e9('0xa'));var deskjs=require(_0x41e9('0xb'));var toCsv=require(_0x41e9('0x6'));var querystring=require(_0x41e9('0xc'));var Papa=require(_0x41e9('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x41e9('0xe'));var Redis=require(_0x41e9('0xf'));var qs=require(_0x41e9('0x10'));var logger=require(_0x41e9('0x11'))(_0x41e9('0x12'));var utils=require(_0x41e9('0x13'));var config=require(_0x41e9('0x14'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a5201,_0xec4e4a,_0x14402f,_0x210262){return new BPromise(function(_0x3484dc,_0xef368f){var _0x540746=_0x210262||client;return _0x540746[_0x41e9('0x15')](_0x4a5201,_0x14402f)[_0x41e9('0x16')](function(_0x334c13){logger[_0x41e9('0x17')](_0x41e9('0x18'),_0xec4e4a,'request\x20sent');logger[_0x41e9('0x19')](_0x41e9('0x1a'),_0xec4e4a,_0x41e9('0x1b'),JSON[_0x41e9('0x1c')](_0x334c13));if(_0x334c13[_0x41e9('0x1d')]){if(_0x334c13[_0x41e9('0x1d')]['code']===0x1f4){logger[_0x41e9('0x1d')](_0x41e9('0x18'),_0xec4e4a,_0x334c13[_0x41e9('0x1d')][_0x41e9('0x1e')]);return _0xef368f(_0x334c13[_0x41e9('0x1d')][_0x41e9('0x1e')]);}logger['error'](_0x41e9('0x18'),_0xec4e4a,_0x334c13[_0x41e9('0x1d')]['message']);return _0x3484dc(_0x334c13[_0x41e9('0x1d')][_0x41e9('0x1e')]);}else{logger[_0x41e9('0x17')](_0x41e9('0x18'),_0xec4e4a,_0x41e9('0x1b'));_0x3484dc(_0x334c13[_0x41e9('0x1f')][_0x41e9('0x1e')]);}})['catch'](function(_0x17f6ec){logger[_0x41e9('0x1d')](_0x41e9('0x18'),_0xec4e4a,_0x17f6ec);_0xef368f(_0x17f6ec);});});}function respondWithStatusCode(_0x15e6fb,_0x1a2559){_0x1a2559=_0x1a2559||0xcc;return function(_0x28b3d7){if(_0x28b3d7){return _0x15e6fb['sendStatus'](_0x1a2559);}return _0x15e6fb[_0x41e9('0x20')](_0x1a2559)[_0x41e9('0x21')]();};}function respondWithResult(_0x4ae4f7,_0x1be130){_0x1be130=_0x1be130||0xc8;return function(_0x3a3316){if(_0x3a3316){return _0x4ae4f7[_0x41e9('0x20')](_0x1be130)['json'](_0x3a3316);}};}function respondWithFilteredResult(_0x44c5b3,_0x2a6dd1){return function(_0x5f36ae){if(_0x5f36ae){var _0x23b46d=_0x5f36ae['count'],_0x27fa81=_0x2a6dd1[_0x41e9('0x22')],_0x42aa6a=_0x2a6dd1[_0x41e9('0x22')]+_0x2a6dd1[_0x41e9('0x23')],_0x4d60f1;if(_0x42aa6a>=_0x23b46d){_0x42aa6a=_0x23b46d;_0x4d60f1=0xc8;}else{_0x4d60f1=0xce;}_0x44c5b3[_0x41e9('0x20')](_0x4d60f1);return _0x44c5b3[_0x41e9('0x24')](_0x41e9('0x25'),_0x27fa81+'-'+_0x42aa6a+'/'+_0x23b46d)[_0x41e9('0x26')](_0x5f36ae);}return null;};}function patchUpdates(_0x34e6bb){return function(_0x5b5b13){try{jsonpatch['apply'](_0x5b5b13,_0x34e6bb,!![]);}catch(_0xc9583){return BPromise[_0x41e9('0x27')](_0xc9583);}return _0x5b5b13[_0x41e9('0x28')]();};}function saveUpdates(_0x312d3e,_0x57b220){return function(_0x2e82da){if(_0x2e82da){return _0x2e82da[_0x41e9('0x29')](_0x312d3e)[_0x41e9('0x16')](function(_0x2aaa5a){return _0x2aaa5a;});}return null;};}function removeEntity(_0x5f0b94,_0x52034c){return function(_0x54c3a8){if(_0x54c3a8){return _0x54c3a8[_0x41e9('0x2a')]()[_0x41e9('0x16')](function(){_0x5f0b94[_0x41e9('0x20')](0xcc)[_0x41e9('0x21')]();});}};}function handleEntityNotFound(_0x2946ed,_0x1b765f){return function(_0x2b4a6c){if(!_0x2b4a6c){_0x2946ed[_0x41e9('0x2b')](0x194);}return _0x2b4a6c;};}function handleError(_0x206c59,_0x15a54f){_0x15a54f=_0x15a54f||0x1f4;return function(_0x561687){logger[_0x41e9('0x1d')](_0x561687[_0x41e9('0x2c')]);if(_0x561687[_0x41e9('0x2d')]){delete _0x561687[_0x41e9('0x2d')];}_0x206c59[_0x41e9('0x20')](_0x15a54f)[_0x41e9('0x2e')](_0x561687);};}exports[_0x41e9('0x2f')]=function(_0x3e529e,_0x28eb1d){var _0x496624={},_0x4a5f3e={},_0x258abd={'count':0x0,'rows':[]};var _0x18eb11=db[_0x41e9('0x30')]['rawAttributes'];_0x4a5f3e[_0x41e9('0x31')]=_[_0x41e9('0x32')](_0x18eb11);_0x4a5f3e['query']=_[_0x41e9('0x32')](_0x3e529e[_0x41e9('0x33')]);_0x4a5f3e[_0x41e9('0x34')]=_['intersection'](_0x4a5f3e['model'],_0x4a5f3e[_0x41e9('0x33')]);_0x496624[_0x41e9('0x35')]=_[_0x41e9('0x36')](_0x4a5f3e[_0x41e9('0x31')],qs[_0x41e9('0x37')](_0x3e529e[_0x41e9('0x33')][_0x41e9('0x37')]));_0x496624[_0x41e9('0x35')]=_0x496624[_0x41e9('0x35')][_0x41e9('0x38')]?_0x496624['attributes']:_0x4a5f3e[_0x41e9('0x31')];if(!_0x3e529e['query'][_0x41e9('0x39')](_0x41e9('0x3a'))){_0x496624['limit']=qs[_0x41e9('0x23')](_0x3e529e[_0x41e9('0x33')][_0x41e9('0x23')]);_0x496624[_0x41e9('0x22')]=qs[_0x41e9('0x22')](_0x3e529e[_0x41e9('0x33')][_0x41e9('0x22')]);}_0x496624[_0x41e9('0x3b')]=qs['sort'](_0x3e529e[_0x41e9('0x33')][_0x41e9('0x3c')]);_0x496624[_0x41e9('0x3d')]=qs[_0x41e9('0x34')](_[_0x41e9('0x3e')](_0x3e529e[_0x41e9('0x33')],_0x4a5f3e[_0x41e9('0x34')]));if(_0x3e529e[_0x41e9('0x33')][_0x41e9('0x3f')]){_0x496624[_0x41e9('0x3d')]=_[_0x41e9('0x40')](_0x496624[_0x41e9('0x3d')],{'$or':_['map'](_0x18eb11,function(_0x5f3090){if(_0x5f3090['type'][_0x41e9('0x41')]!==_0x41e9('0x42')){var _0x463ff6={};_0x463ff6[_0x5f3090[_0x41e9('0x43')]]={'$like':'%'+_0x3e529e[_0x41e9('0x33')][_0x41e9('0x3f')]+'%'};return _0x463ff6;}})});}_0x496624=_[_0x41e9('0x40')]({},_0x496624,_0x3e529e[_0x41e9('0x44')]);var _0x550c37={'where':_0x496624[_0x41e9('0x3d')]};return db[_0x41e9('0x30')][_0x41e9('0x45')](_0x550c37)[_0x41e9('0x16')](function(_0x1fe46d){_0x258abd['count']=_0x1fe46d;if(_0x3e529e['query'][_0x41e9('0x46')]){_0x496624[_0x41e9('0x47')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x496624);})[_0x41e9('0x16')](function(_0x297d53){_0x258abd[_0x41e9('0x48')]=_0x297d53;return _0x258abd;})['then'](respondWithFilteredResult(_0x28eb1d,_0x496624))[_0x41e9('0x49')](handleError(_0x28eb1d,null));};exports[_0x41e9('0x4a')]=function(_0x21c477,_0x42404c){var _0x25df59={'raw':![],'where':{'id':_0x21c477[_0x41e9('0x4b')]['id']}},_0x19d52b={};_0x19d52b[_0x41e9('0x31')]=_['keys'](db[_0x41e9('0x30')][_0x41e9('0x4c')]);_0x19d52b[_0x41e9('0x33')]=_[_0x41e9('0x32')](_0x21c477['query']);_0x19d52b['filters']=_[_0x41e9('0x36')](_0x19d52b['model'],_0x19d52b[_0x41e9('0x33')]);_0x25df59[_0x41e9('0x35')]=_[_0x41e9('0x36')](_0x19d52b[_0x41e9('0x31')],qs[_0x41e9('0x37')](_0x21c477['query'][_0x41e9('0x37')]));_0x25df59['attributes']=_0x25df59[_0x41e9('0x35')][_0x41e9('0x38')]?_0x25df59[_0x41e9('0x35')]:_0x19d52b[_0x41e9('0x31')];if(_0x21c477[_0x41e9('0x33')]['includeAll']){_0x25df59['include']=[{'all':!![]}];}_0x25df59=_[_0x41e9('0x40')]({},_0x25df59,_0x21c477[_0x41e9('0x44')]);return db[_0x41e9('0x30')]['find'](_0x25df59)['then'](handleEntityNotFound(_0x42404c,null))[_0x41e9('0x16')](respondWithResult(_0x42404c,null))[_0x41e9('0x49')](handleError(_0x42404c,null));};exports[_0x41e9('0x4d')]=function(_0x35b084,_0x36bbd5){return db[_0x41e9('0x30')][_0x41e9('0x4d')](_0x35b084[_0x41e9('0x4e')],{})[_0x41e9('0x16')](respondWithResult(_0x36bbd5,0xc9))[_0x41e9('0x49')](handleError(_0x36bbd5,null));};exports[_0x41e9('0x29')]=function(_0x5e0b76,_0x47a45c){if(_0x5e0b76[_0x41e9('0x4e')]['id']){delete _0x5e0b76[_0x41e9('0x4e')]['id'];}return db[_0x41e9('0x30')][_0x41e9('0x4f')]({'where':{'id':_0x5e0b76['params']['id']}})['then'](handleEntityNotFound(_0x47a45c,null))[_0x41e9('0x16')](saveUpdates(_0x5e0b76['body'],null))[_0x41e9('0x16')](respondWithResult(_0x47a45c,null))[_0x41e9('0x49')](handleError(_0x47a45c,null));};exports[_0x41e9('0x2a')]=function(_0x2edb3a,_0x1e480a){return db[_0x41e9('0x30')][_0x41e9('0x4f')]({'where':{'id':_0x2edb3a[_0x41e9('0x4b')]['id']}})[_0x41e9('0x16')](handleEntityNotFound(_0x1e480a,null))[_0x41e9('0x16')](removeEntity(_0x1e480a,null))[_0x41e9('0x49')](handleError(_0x1e480a,null));};exports[_0x41e9('0x50')]=function(_0x122a62,_0x270dcc,_0x5e56ca){var _0x3fa1ef={};var _0x241caa={};var _0x1531f0;var _0x56bde1;return db['ZendeskConfiguration'][_0x41e9('0x51')]({'where':{'id':_0x122a62[_0x41e9('0x4b')]['id']}})[_0x41e9('0x16')](handleEntityNotFound(_0x270dcc,null))[_0x41e9('0x16')](function(_0x4ea030){if(_0x4ea030){_0x1531f0=_0x4ea030;_0x241caa['model']=_[_0x41e9('0x32')](db[_0x41e9('0x52')][_0x41e9('0x4c')]);_0x241caa['query']=_[_0x41e9('0x32')](_0x122a62[_0x41e9('0x33')]);_0x241caa['filters']=_[_0x41e9('0x36')](_0x241caa[_0x41e9('0x31')],_0x241caa[_0x41e9('0x33')]);_0x3fa1ef[_0x41e9('0x35')]=_[_0x41e9('0x36')](_0x241caa[_0x41e9('0x31')],qs[_0x41e9('0x37')](_0x122a62['query'][_0x41e9('0x37')]));_0x3fa1ef[_0x41e9('0x35')]=_0x3fa1ef[_0x41e9('0x35')][_0x41e9('0x38')]?_0x3fa1ef[_0x41e9('0x35')]:_0x241caa[_0x41e9('0x31')];_0x3fa1ef[_0x41e9('0x3b')]=qs[_0x41e9('0x3c')](_0x122a62[_0x41e9('0x33')][_0x41e9('0x3c')]);_0x3fa1ef[_0x41e9('0x3d')]=qs['filters'](_[_0x41e9('0x3e')](_0x122a62['query'],_0x241caa['filters']));if(_0x122a62[_0x41e9('0x33')]['filter']){_0x3fa1ef['where']=_[_0x41e9('0x40')](_0x3fa1ef[_0x41e9('0x3d')],{'$or':_[_0x41e9('0x53')](_0x3fa1ef[_0x41e9('0x35')],function(_0x3c7893){var _0x1d5ea4={};_0x1d5ea4[_0x3c7893]={'$like':'%'+_0x122a62['query']['filter']+'%'};return _0x1d5ea4;})});}_0x3fa1ef=_['merge']({},_0x3fa1ef,_0x122a62['options']);return _0x1531f0[_0x41e9('0x50')](_0x3fa1ef);}})[_0x41e9('0x16')](function(_0x31b5d6){if(_0x31b5d6){_0x56bde1=_0x31b5d6[_0x41e9('0x38')];if(!_0x122a62[_0x41e9('0x33')]['hasOwnProperty'](_0x41e9('0x3a'))){_0x3fa1ef[_0x41e9('0x23')]=qs[_0x41e9('0x23')](_0x122a62[_0x41e9('0x33')][_0x41e9('0x23')]);_0x3fa1ef[_0x41e9('0x22')]=qs[_0x41e9('0x22')](_0x122a62['query'][_0x41e9('0x22')]);}return _0x1531f0[_0x41e9('0x50')](_0x3fa1ef);}})['then'](function(_0x5bb5ec){if(_0x5bb5ec){return _0x5bb5ec?{'count':_0x56bde1,'rows':_0x5bb5ec}:null;}})['then'](respondWithResult(_0x270dcc,null))[_0x41e9('0x49')](handleError(_0x270dcc,null));};exports[_0x41e9('0x54')]=function(_0x582295,_0x3178cd,_0x29530c){var _0x5193a2={};var _0x475aa0={};var _0x4cdbc9;var _0x290a4d;return db[_0x41e9('0x30')][_0x41e9('0x51')]({'where':{'id':_0x582295[_0x41e9('0x4b')]['id']}})[_0x41e9('0x16')](handleEntityNotFound(_0x3178cd,null))[_0x41e9('0x16')](function(_0x2049ec){if(_0x2049ec){_0x4cdbc9=_0x2049ec;_0x475aa0[_0x41e9('0x31')]=_[_0x41e9('0x32')](db['ZendeskField'][_0x41e9('0x4c')]);_0x475aa0[_0x41e9('0x33')]=_[_0x41e9('0x32')](_0x582295['query']);_0x475aa0[_0x41e9('0x34')]=_[_0x41e9('0x36')](_0x475aa0['model'],_0x475aa0[_0x41e9('0x33')]);_0x5193a2[_0x41e9('0x35')]=_[_0x41e9('0x36')](_0x475aa0[_0x41e9('0x31')],qs[_0x41e9('0x37')](_0x582295[_0x41e9('0x33')][_0x41e9('0x37')]));_0x5193a2[_0x41e9('0x35')]=_0x5193a2[_0x41e9('0x35')][_0x41e9('0x38')]?_0x5193a2[_0x41e9('0x35')]:_0x475aa0[_0x41e9('0x31')];_0x5193a2[_0x41e9('0x3b')]=qs['sort'](_0x582295[_0x41e9('0x33')][_0x41e9('0x3c')]);_0x5193a2['where']=qs[_0x41e9('0x34')](_[_0x41e9('0x3e')](_0x582295[_0x41e9('0x33')],_0x475aa0['filters']));if(_0x582295[_0x41e9('0x33')][_0x41e9('0x3f')]){_0x5193a2[_0x41e9('0x3d')]=_[_0x41e9('0x40')](_0x5193a2[_0x41e9('0x3d')],{'$or':_['map'](_0x5193a2[_0x41e9('0x35')],function(_0x34636b){var _0x19013e={};_0x19013e[_0x34636b]={'$like':'%'+_0x582295[_0x41e9('0x33')][_0x41e9('0x3f')]+'%'};return _0x19013e;})});}_0x5193a2=_[_0x41e9('0x40')]({},_0x5193a2,_0x582295[_0x41e9('0x44')]);return _0x4cdbc9[_0x41e9('0x54')](_0x5193a2);}})[_0x41e9('0x16')](function(_0x568996){if(_0x568996){_0x290a4d=_0x568996[_0x41e9('0x38')];if(!_0x582295[_0x41e9('0x33')][_0x41e9('0x39')](_0x41e9('0x3a'))){_0x5193a2['limit']=qs[_0x41e9('0x23')](_0x582295[_0x41e9('0x33')]['limit']);_0x5193a2[_0x41e9('0x22')]=qs['offset'](_0x582295[_0x41e9('0x33')][_0x41e9('0x22')]);}return _0x4cdbc9['getSubjects'](_0x5193a2);}})['then'](function(_0xd956b9){if(_0xd956b9){return _0xd956b9?{'count':_0x290a4d,'rows':_0xd956b9}:null;}})['then'](respondWithResult(_0x3178cd,null))[_0x41e9('0x49')](handleError(_0x3178cd,null));};exports['getDescriptions']=function(_0x12c8b1,_0xf473e0,_0x5aff54){var _0x2dd793={};var _0x50abc9={};var _0x19ace8;var _0x40fce3;return db[_0x41e9('0x30')]['findOne']({'where':{'id':_0x12c8b1[_0x41e9('0x4b')]['id']}})[_0x41e9('0x16')](handleEntityNotFound(_0xf473e0,null))[_0x41e9('0x16')](function(_0x28856a){if(_0x28856a){_0x19ace8=_0x28856a;_0x50abc9[_0x41e9('0x31')]=_[_0x41e9('0x32')](db[_0x41e9('0x52')][_0x41e9('0x4c')]);_0x50abc9[_0x41e9('0x33')]=_[_0x41e9('0x32')](_0x12c8b1[_0x41e9('0x33')]);_0x50abc9['filters']=_[_0x41e9('0x36')](_0x50abc9[_0x41e9('0x31')],_0x50abc9[_0x41e9('0x33')]);_0x2dd793[_0x41e9('0x35')]=_[_0x41e9('0x36')](_0x50abc9[_0x41e9('0x31')],qs[_0x41e9('0x37')](_0x12c8b1[_0x41e9('0x33')]['fields']));_0x2dd793['attributes']=_0x2dd793['attributes'][_0x41e9('0x38')]?_0x2dd793['attributes']:_0x50abc9[_0x41e9('0x31')];_0x2dd793[_0x41e9('0x3b')]=qs[_0x41e9('0x3c')](_0x12c8b1[_0x41e9('0x33')]['sort']);_0x2dd793[_0x41e9('0x3d')]=qs['filters'](_[_0x41e9('0x3e')](_0x12c8b1[_0x41e9('0x33')],_0x50abc9[_0x41e9('0x34')]));if(_0x12c8b1['query'][_0x41e9('0x3f')]){_0x2dd793[_0x41e9('0x3d')]=_[_0x41e9('0x40')](_0x2dd793[_0x41e9('0x3d')],{'$or':_[_0x41e9('0x53')](_0x2dd793['attributes'],function(_0x8c7eb5){var _0x20a886={};_0x20a886[_0x8c7eb5]={'$like':'%'+_0x12c8b1['query']['filter']+'%'};return _0x20a886;})});}_0x2dd793=_[_0x41e9('0x40')]({},_0x2dd793,_0x12c8b1[_0x41e9('0x44')]);return _0x19ace8[_0x41e9('0x55')](_0x2dd793);}})[_0x41e9('0x16')](function(_0x375fcc){if(_0x375fcc){_0x40fce3=_0x375fcc[_0x41e9('0x38')];if(!_0x12c8b1['query'][_0x41e9('0x39')](_0x41e9('0x3a'))){_0x2dd793[_0x41e9('0x23')]=qs['limit'](_0x12c8b1[_0x41e9('0x33')][_0x41e9('0x23')]);_0x2dd793[_0x41e9('0x22')]=qs[_0x41e9('0x22')](_0x12c8b1[_0x41e9('0x33')][_0x41e9('0x22')]);}return _0x19ace8[_0x41e9('0x55')](_0x2dd793);}})[_0x41e9('0x16')](function(_0x5aaa71){if(_0x5aaa71){return _0x5aaa71?{'count':_0x40fce3,'rows':_0x5aaa71}:null;}})['then'](respondWithResult(_0xf473e0,null))[_0x41e9('0x49')](handleError(_0xf473e0,null));};exports[_0x41e9('0x56')]=function(_0x1a3ce9,_0x43e5f8,_0x41a816){var _0x2546b4={};var _0x2a4eda={};var _0x1c4ad5;var _0x21ccc3;return db['ZendeskConfiguration'][_0x41e9('0x51')]({'where':{'id':_0x1a3ce9[_0x41e9('0x4b')]['id']}})[_0x41e9('0x16')](handleEntityNotFound(_0x43e5f8,null))[_0x41e9('0x16')](function(_0x29ead3){if(_0x29ead3){_0x1c4ad5=_0x29ead3;_0x2a4eda[_0x41e9('0x31')]=_['keys'](db[_0x41e9('0x57')][_0x41e9('0x4c')]);_0x2a4eda[_0x41e9('0x33')]=_['keys'](_0x1a3ce9[_0x41e9('0x33')]);_0x2a4eda[_0x41e9('0x34')]=_[_0x41e9('0x36')](_0x2a4eda[_0x41e9('0x31')],_0x2a4eda[_0x41e9('0x33')]);_0x2546b4['attributes']=_[_0x41e9('0x36')](_0x2a4eda['model'],qs[_0x41e9('0x37')](_0x1a3ce9['query'][_0x41e9('0x37')]));_0x2546b4[_0x41e9('0x35')]=_0x2546b4['attributes'][_0x41e9('0x38')]?_0x2546b4[_0x41e9('0x35')]:_0x2a4eda['model'];_0x2546b4['order']=qs['sort'](_0x1a3ce9[_0x41e9('0x33')]['sort']);_0x2546b4[_0x41e9('0x3d')]=qs[_0x41e9('0x34')](_[_0x41e9('0x3e')](_0x1a3ce9[_0x41e9('0x33')],_0x2a4eda[_0x41e9('0x34')]));if(_0x1a3ce9['query']['filter']){_0x2546b4[_0x41e9('0x3d')]=_[_0x41e9('0x40')](_0x2546b4[_0x41e9('0x3d')],{'$or':_[_0x41e9('0x53')](_0x2546b4['attributes'],function(_0x119882){var _0x763989={};_0x763989[_0x119882]={'$like':'%'+_0x1a3ce9[_0x41e9('0x33')][_0x41e9('0x3f')]+'%'};return _0x763989;})});}_0x2546b4=_[_0x41e9('0x40')]({},_0x2546b4,_0x1a3ce9[_0x41e9('0x44')]);return _0x1c4ad5[_0x41e9('0x56')](_0x2546b4);}})[_0x41e9('0x16')](function(_0x102644){if(_0x102644){_0x21ccc3=_0x102644[_0x41e9('0x38')];if(!_0x1a3ce9[_0x41e9('0x33')][_0x41e9('0x39')](_0x41e9('0x3a'))){_0x2546b4[_0x41e9('0x23')]=qs['limit'](_0x1a3ce9[_0x41e9('0x33')]['limit']);_0x2546b4[_0x41e9('0x22')]=qs[_0x41e9('0x22')](_0x1a3ce9[_0x41e9('0x33')]['offset']);}return _0x1c4ad5[_0x41e9('0x56')](_0x2546b4);}})['then'](function(_0x5b5d97){if(_0x5b5d97){return _0x5b5d97?{'count':_0x21ccc3,'rows':_0x5b5d97}:null;}})['then'](respondWithResult(_0x43e5f8,null))['catch'](handleError(_0x43e5f8,null));};exports['setTags']=function(_0x1d9f4b,_0x5ee30f,_0x2e5a3b){if(_0x1d9f4b['body']['id']){delete _0x1d9f4b['body']['id'];}return db[_0x41e9('0x30')][_0x41e9('0x51')]({'where':{'id':_0x1d9f4b['params']['id']}})['then'](handleEntityNotFound(_0x5ee30f,null))[_0x41e9('0x16')](function(_0x324841){if(_0x324841){return _0x324841[_0x41e9('0x58')](_0x1d9f4b['body'][_0x41e9('0x59')]||[]);}return null;})[_0x41e9('0x16')](respondWithResult(_0x5ee30f,null))['catch'](handleError(_0x5ee30f,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 8c58e47..6918c21 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 _0xa329=['bluebird','./intZendeskConfiguration.attributes','exports','define','../../config/logger','api'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa329,0x9a));var _0x9a32=function(_0x259c2b,_0x26873d){_0x259c2b=_0x259c2b-0x0;var _0x52d235=_0xa329[_0x259c2b];return _0x52d235;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9a32('0x0'))(_0x9a32('0x1'));var moment=require('moment');var BPromise=require(_0x9a32('0x2'));var rp=require('request-promise');var attributes=require(_0x9a32('0x3'));module[_0x9a32('0x4')]=function(_0x1911b2,_0x2bb82e){return _0x1911b2[_0x9a32('0x5')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6acf=['int_zendesk_configurations','lodash','util','../../config/logger','moment','request-promise','./intZendeskConfiguration.attributes','define','ZendeskConfiguration'];(function(_0x11c8e5,_0x2876e1){var _0x46689a=function(_0x40ba0a){while(--_0x40ba0a){_0x11c8e5['push'](_0x11c8e5['shift']());}};_0x46689a(++_0x2876e1);}(_0x6acf,0x9a));var _0xf6ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6acf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6ac('0x0'));var util=require(_0xf6ac('0x1'));var logger=require(_0xf6ac('0x2'))('api');var moment=require(_0xf6ac('0x3'));var BPromise=require('bluebird');var rp=require(_0xf6ac('0x4'));var attributes=require(_0xf6ac('0x5'));module['exports']=function(_0x4407da,_0x5552ac){return _0x4407da[_0xf6ac('0x6')](_0xf6ac('0x7'),attributes,{'tableName':_0xf6ac('0x8'),'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 3a8cf3c..1624b39 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 _0xc3ca=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x3d8243,_0x431106){var _0x140fb4=function(_0x1bde1f){while(--_0x1bde1f){_0x3d8243['push'](_0x3d8243['shift']());}};_0x140fb4(++_0x431106);}(_0xc3ca,0x15c));var _0xac3c=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xc3ca[_0x35885a];return _0xe86249;};'use strict';var _=require(_0xac3c('0x0'));var util=require(_0xac3c('0x1'));var moment=require(_0xac3c('0x2'));var BPromise=require(_0xac3c('0x3'));var rs=require(_0xac3c('0x4'));var fs=require('fs');var Redis=require(_0xac3c('0x5'));var db=require(_0xac3c('0x6'))['db'];var utils=require(_0xac3c('0x7'));var logger=require(_0xac3c('0x8'))(_0xac3c('0x9'));var config=require(_0xac3c('0xa'));var jayson=require(_0xac3c('0xb'));var client=jayson['client'][_0xac3c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23f5ff,_0x46f00b,_0x2b5fd2){return new BPromise(function(_0x43c795,_0x32da22){return client[_0xac3c('0xd')](_0x23f5ff,_0x2b5fd2)[_0xac3c('0xe')](function(_0x5c44c9){logger[_0xac3c('0xf')](_0xac3c('0x10'),_0x46f00b,_0xac3c('0x11'));logger[_0xac3c('0x12')](_0xac3c('0x13'),_0x46f00b,_0xac3c('0x11'),JSON['stringify'](_0x5c44c9));if(_0x5c44c9[_0xac3c('0x14')]){if(_0x5c44c9[_0xac3c('0x14')][_0xac3c('0x15')]===0x1f4){logger[_0xac3c('0x14')](_0xac3c('0x10'),_0x46f00b,_0x5c44c9[_0xac3c('0x14')][_0xac3c('0x16')]);return _0x32da22(_0x5c44c9['error'][_0xac3c('0x16')]);}logger['error'](_0xac3c('0x10'),_0x46f00b,_0x5c44c9[_0xac3c('0x14')][_0xac3c('0x16')]);return _0x43c795(_0x5c44c9[_0xac3c('0x14')][_0xac3c('0x16')]);}else{logger[_0xac3c('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x46f00b,_0xac3c('0x11'));_0x43c795(_0x5c44c9[_0xac3c('0x17')][_0xac3c('0x16')]);}})[_0xac3c('0x18')](function(_0xd7b6ee){logger[_0xac3c('0x14')](_0xac3c('0x10'),_0x46f00b,_0xd7b6ee);_0x32da22(_0xd7b6ee);});});} \ No newline at end of file +var _0x86d7=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x2b3ddc,_0x19a52d){var _0x5a71ec=function(_0x50b962){while(--_0x50b962){_0x2b3ddc['push'](_0x2b3ddc['shift']());}};_0x5a71ec(++_0x19a52d);}(_0x86d7,0x147));var _0x786d=function(_0x1c1f72,_0x219e0b){_0x1c1f72=_0x1c1f72-0x0;var _0x4baf14=_0x86d7[_0x1c1f72];return _0x4baf14;};'use strict';var _=require(_0x786d('0x0'));var util=require(_0x786d('0x1'));var moment=require(_0x786d('0x2'));var BPromise=require('bluebird');var rs=require(_0x786d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x786d('0x4'))['db'];var utils=require(_0x786d('0x5'));var logger=require(_0x786d('0x6'))(_0x786d('0x7'));var config=require(_0x786d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x786d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3517ca,_0x542245,_0xa502ca){return new BPromise(function(_0x41816a,_0x4b574a){return client[_0x786d('0xa')](_0x3517ca,_0xa502ca)['then'](function(_0x23c3a2){logger[_0x786d('0xb')](_0x786d('0xc'),_0x542245,'request\x20sent');logger[_0x786d('0xd')](_0x786d('0xe'),_0x542245,_0x786d('0xf'),JSON['stringify'](_0x23c3a2));if(_0x23c3a2[_0x786d('0x10')]){if(_0x23c3a2[_0x786d('0x10')][_0x786d('0x11')]===0x1f4){logger[_0x786d('0x10')](_0x786d('0xc'),_0x542245,_0x23c3a2[_0x786d('0x10')][_0x786d('0x12')]);return _0x4b574a(_0x23c3a2[_0x786d('0x10')]['message']);}logger[_0x786d('0x10')](_0x786d('0xc'),_0x542245,_0x23c3a2[_0x786d('0x10')][_0x786d('0x12')]);return _0x41816a(_0x23c3a2[_0x786d('0x10')]['message']);}else{logger[_0x786d('0xb')](_0x786d('0xc'),_0x542245,_0x786d('0xf'));_0x41816a(_0x23c3a2['result'][_0x786d('0x12')]);}})[_0x786d('0x13')](function(_0x3a2048){logger['error'](_0x786d('0xc'),_0x542245,_0x3a2048);_0x4b574a(_0x3a2048);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index f494934..e1b5ae1 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 _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x2da53c,_0x23f636){var _0x397c2e=function(_0x176ab0){while(--_0x176ab0){_0x2da53c['push'](_0x2da53c['shift']());}};_0x397c2e(++_0x23f636);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var 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 +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(_0x4e434f,_0x22f4c5){var _0x32e41f=function(_0x26723f){while(--_0x26723f){_0x4e434f['push'](_0x4e434f['shift']());}};_0x32e41f(++_0x22f4c5);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var 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 diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 28e9c7f..61bf28a 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 _0x5b02=['BOOLEAN','sequelize','exports','ENUM','string','keyValue','STRING','variable'];(function(_0x5e7617,_0x39a004){var _0x580ea8=function(_0x24a684){while(--_0x24a684){_0x5e7617['push'](_0x5e7617['shift']());}};_0x580ea8(++_0x39a004);}(_0x5b02,0xe9));var _0x25b0=function(_0x2d7770,_0x59def8){_0x2d7770=_0x2d7770-0x0;var _0x4edfa4=_0x5b02[_0x2d7770];return _0x4edfa4;};'use strict';var Sequelize=require(_0x25b0('0x0'));module[_0x25b0('0x1')]={'type':{'type':Sequelize[_0x25b0('0x2')](_0x25b0('0x3'),'variable','customVariable',_0x25b0('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x25b0('0x5')]},'key':{'type':Sequelize[_0x25b0('0x5')]},'keyType':{'type':Sequelize[_0x25b0('0x2')](_0x25b0('0x3'),_0x25b0('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x25b0('0x5')]},'idField':{'type':Sequelize[_0x25b0('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x25b0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6c76=['customVariable','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x6c76,0x184));var _0x66c7=function(_0x13080c,_0x878006){_0x13080c=_0x13080c-0x0;var _0x228c66=_0x6c76[_0x13080c];return _0x228c66;};'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/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 3fd3caf..ebd6318 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 _0x159f=['name','send','index','ZendeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','find','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x1abaf6,_0xe66f1a){var _0x23d291=function(_0x5f4471){while(--_0x5f4471){_0x1abaf6['push'](_0x1abaf6['shift']());}};_0x23d291(++_0xe66f1a);}(_0x159f,0xfa));var _0xf159=function(_0x1422c1,_0x56e7aa){_0x1422c1=_0x1422c1-0x0;var _0x4eb024=_0x159f[_0x1422c1];return _0x4eb024;};'use strict';var pdf=require(_0xf159('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf159('0x1'));var jsonpatch=require(_0xf159('0x2'));var rp=require(_0xf159('0x3'));var moment=require(_0xf159('0x4'));var BPromise=require(_0xf159('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf159('0x6'));var sox=require(_0xf159('0x7'));var csv=require(_0xf159('0x8'));var ejs=require(_0xf159('0x9'));var fs=require('fs');var _=require(_0xf159('0xa'));var squel=require(_0xf159('0xb'));var crypto=require(_0xf159('0xc'));var jsforce=require(_0xf159('0xd'));var deskjs=require(_0xf159('0xe'));var toCsv=require(_0xf159('0x8'));var querystring=require(_0xf159('0xf'));var Papa=require(_0xf159('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0xf159('0x11'));var Redis=require(_0xf159('0x12'));var qs=require(_0xf159('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf159('0x14'));var config=require(_0xf159('0x15'));var db=require(_0xf159('0x16'))['db'];function respondWithStatusCode(_0x495133,_0x38eee0){_0x38eee0=_0x38eee0||0xcc;return function(_0x2b7c6b){if(_0x2b7c6b){return _0x495133[_0xf159('0x17')](_0x38eee0);}return _0x495133['status'](_0x38eee0)[_0xf159('0x18')]();};}function respondWithResult(_0x28d9ca,_0xad10f5){_0xad10f5=_0xad10f5||0xc8;return function(_0x3bec80){if(_0x3bec80){return _0x28d9ca[_0xf159('0x19')](_0xad10f5)[_0xf159('0x1a')](_0x3bec80);}};}function respondWithFilteredResult(_0x530a34,_0x5023ac){return function(_0x193594){if(_0x193594){var _0x4174fb=_0x193594[_0xf159('0x1b')],_0xd8db43=_0x5023ac['offset'],_0x3b162a=_0x5023ac[_0xf159('0x1c')]+_0x5023ac['limit'],_0xd84544;if(_0x3b162a>=_0x4174fb){_0x3b162a=_0x4174fb;_0xd84544=0xc8;}else{_0xd84544=0xce;}_0x530a34[_0xf159('0x19')](_0xd84544);return _0x530a34['set'](_0xf159('0x1d'),_0xd8db43+'-'+_0x3b162a+'/'+_0x4174fb)[_0xf159('0x1a')](_0x193594);}return null;};}function patchUpdates(_0x105c53){return function(_0x5cceb4){try{jsonpatch[_0xf159('0x1e')](_0x5cceb4,_0x105c53,!![]);}catch(_0x213a33){return BPromise[_0xf159('0x1f')](_0x213a33);}return _0x5cceb4[_0xf159('0x20')]();};}function saveUpdates(_0x1b4114,_0x257cb5){return function(_0xed1ee8){if(_0xed1ee8){return _0xed1ee8[_0xf159('0x21')](_0x1b4114)[_0xf159('0x22')](function(_0x41b3d4){return _0x41b3d4;});}return null;};}function removeEntity(_0x3585a7,_0x4dd24b){return function(_0x434886){if(_0x434886){return _0x434886[_0xf159('0x23')]()[_0xf159('0x22')](function(){_0x3585a7[_0xf159('0x19')](0xcc)[_0xf159('0x18')]();});}};}function handleEntityNotFound(_0x2332d7,_0x1afa5e){return function(_0x50113d){if(!_0x50113d){_0x2332d7[_0xf159('0x17')](0x194);}return _0x50113d;};}function handleError(_0x1a2b29,_0x133f7b){_0x133f7b=_0x133f7b||0x1f4;return function(_0x345ff0){logger[_0xf159('0x24')](_0x345ff0[_0xf159('0x25')]);if(_0x345ff0[_0xf159('0x26')]){delete _0x345ff0[_0xf159('0x26')];}_0x1a2b29[_0xf159('0x19')](_0x133f7b)[_0xf159('0x27')](_0x345ff0);};}exports[_0xf159('0x28')]=function(_0x67e4e9,_0xa7ae9d){var _0xdcf0cb={},_0x5e42bd={},_0x17a707={'count':0x0,'rows':[]};var _0xc27e7f=db[_0xf159('0x29')][_0xf159('0x2a')];_0x5e42bd[_0xf159('0x2b')]=_[_0xf159('0x2c')](_0xc27e7f);_0x5e42bd[_0xf159('0x2d')]=_[_0xf159('0x2c')](_0x67e4e9[_0xf159('0x2d')]);_0x5e42bd[_0xf159('0x2e')]=_[_0xf159('0x2f')](_0x5e42bd['model'],_0x5e42bd[_0xf159('0x2d')]);_0xdcf0cb[_0xf159('0x30')]=_[_0xf159('0x2f')](_0x5e42bd[_0xf159('0x2b')],qs[_0xf159('0x31')](_0x67e4e9['query']['fields']));_0xdcf0cb['attributes']=_0xdcf0cb[_0xf159('0x30')][_0xf159('0x32')]?_0xdcf0cb[_0xf159('0x30')]:_0x5e42bd['model'];if(!_0x67e4e9[_0xf159('0x2d')][_0xf159('0x33')](_0xf159('0x34'))){_0xdcf0cb[_0xf159('0x35')]=qs['limit'](_0x67e4e9[_0xf159('0x2d')][_0xf159('0x35')]);_0xdcf0cb[_0xf159('0x1c')]=qs[_0xf159('0x1c')](_0x67e4e9[_0xf159('0x2d')][_0xf159('0x1c')]);}_0xdcf0cb['order']=qs[_0xf159('0x36')](_0x67e4e9[_0xf159('0x2d')][_0xf159('0x36')]);_0xdcf0cb[_0xf159('0x37')]=qs[_0xf159('0x2e')](_['pick'](_0x67e4e9[_0xf159('0x2d')],_0x5e42bd[_0xf159('0x2e')]));if(_0x67e4e9[_0xf159('0x2d')][_0xf159('0x38')]){_0xdcf0cb[_0xf159('0x37')]=_['merge'](_0xdcf0cb[_0xf159('0x37')],{'$or':_[_0xf159('0x39')](_0xc27e7f,function(_0x32cadc){if(_0x32cadc[_0xf159('0x3a')][_0xf159('0x3b')]!==_0xf159('0x3c')){var _0xbb28bc={};_0xbb28bc[_0x32cadc[_0xf159('0x3d')]]={'$like':'%'+_0x67e4e9[_0xf159('0x2d')]['filter']+'%'};return _0xbb28bc;}})});}_0xdcf0cb=_['merge']({},_0xdcf0cb,_0x67e4e9[_0xf159('0x3e')]);var _0x58dce5={'where':_0xdcf0cb['where']};return db[_0xf159('0x29')]['count'](_0x58dce5)[_0xf159('0x22')](function(_0xa5eb07){_0x17a707[_0xf159('0x1b')]=_0xa5eb07;if(_0x67e4e9[_0xf159('0x2d')][_0xf159('0x3f')]){_0xdcf0cb[_0xf159('0x40')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0xdcf0cb);})[_0xf159('0x22')](function(_0x169977){_0x17a707[_0xf159('0x41')]=_0x169977;return _0x17a707;})['then'](respondWithFilteredResult(_0xa7ae9d,_0xdcf0cb))[_0xf159('0x42')](handleError(_0xa7ae9d,null));};exports[_0xf159('0x43')]=function(_0x3d568b,_0xc5c5b3){var _0x293ec3={'raw':!![],'where':{'id':_0x3d568b[_0xf159('0x44')]['id']}},_0x758d8={};_0x758d8[_0xf159('0x2b')]=_[_0xf159('0x2c')](db[_0xf159('0x29')][_0xf159('0x2a')]);_0x758d8['query']=_[_0xf159('0x2c')](_0x3d568b[_0xf159('0x2d')]);_0x758d8[_0xf159('0x2e')]=_[_0xf159('0x2f')](_0x758d8[_0xf159('0x2b')],_0x758d8[_0xf159('0x2d')]);_0x293ec3['attributes']=_[_0xf159('0x2f')](_0x758d8['model'],qs[_0xf159('0x31')](_0x3d568b[_0xf159('0x2d')]['fields']));_0x293ec3[_0xf159('0x30')]=_0x293ec3[_0xf159('0x30')][_0xf159('0x32')]?_0x293ec3[_0xf159('0x30')]:_0x758d8[_0xf159('0x2b')];if(_0x3d568b[_0xf159('0x2d')][_0xf159('0x3f')]){_0x293ec3[_0xf159('0x40')]=[{'all':!![]}];}_0x293ec3=_['merge']({},_0x293ec3,_0x3d568b[_0xf159('0x3e')]);return db[_0xf159('0x29')][_0xf159('0x45')](_0x293ec3)[_0xf159('0x22')](handleEntityNotFound(_0xc5c5b3,null))[_0xf159('0x22')](respondWithResult(_0xc5c5b3,null))['catch'](handleError(_0xc5c5b3,null));};exports[_0xf159('0x46')]=function(_0x3b4cd1,_0x2972ca){return db[_0xf159('0x29')][_0xf159('0x46')](_0x3b4cd1[_0xf159('0x47')],{})['then'](respondWithResult(_0x2972ca,0xc9))[_0xf159('0x42')](handleError(_0x2972ca,null));};exports[_0xf159('0x21')]=function(_0x1564fe,_0x516b3d){if(_0x1564fe[_0xf159('0x47')]['id']){delete _0x1564fe[_0xf159('0x47')]['id'];}return db['ZendeskField'][_0xf159('0x45')]({'where':{'id':_0x1564fe[_0xf159('0x44')]['id']}})[_0xf159('0x22')](handleEntityNotFound(_0x516b3d,null))['then'](saveUpdates(_0x1564fe['body'],null))['then'](respondWithResult(_0x516b3d,null))[_0xf159('0x42')](handleError(_0x516b3d,null));};exports[_0xf159('0x23')]=function(_0x2a7000,_0x2c8f9b){return db[_0xf159('0x29')][_0xf159('0x45')]({'where':{'id':_0x2a7000[_0xf159('0x44')]['id']}})[_0xf159('0x22')](handleEntityNotFound(_0x2c8f9b,null))[_0xf159('0x22')](removeEntity(_0x2c8f9b,null))[_0xf159('0x42')](handleError(_0x2c8f9b,null));}; \ No newline at end of file +var _0x1df5=['fast-json-patch','request-promise','moment','bluebird','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','ZendeskField','rawAttributes','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','rows','show','params','find','create','catch','body','html-pdf','eml-format','rimraf'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1df5,0x85));var _0x51df=function(_0x43112b,_0x192fcd){_0x43112b=_0x43112b-0x0;var _0x3d916d=_0x1df5[_0x43112b];return _0x3d916d;};'use strict';var pdf=require(_0x51df('0x0'));var emlformat=require(_0x51df('0x1'));var rimraf=require(_0x51df('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51df('0x3'));var rp=require(_0x51df('0x4'));var moment=require(_0x51df('0x5'));var BPromise=require(_0x51df('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x51df('0x7'));var fs=require('fs');var _=require(_0x51df('0x8'));var squel=require(_0x51df('0x9'));var crypto=require('crypto');var jsforce=require(_0x51df('0xa'));var deskjs=require(_0x51df('0xb'));var toCsv=require(_0x51df('0xc'));var querystring=require(_0x51df('0xd'));var Papa=require(_0x51df('0xe'));var authService=require(_0x51df('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x51df('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0x51df('0x11'));var config=require(_0x51df('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16cc38,_0x35e374){_0x35e374=_0x35e374||0xcc;return function(_0x371895){if(_0x371895){return _0x16cc38[_0x51df('0x13')](_0x35e374);}return _0x16cc38[_0x51df('0x14')](_0x35e374)['end']();};}function respondWithResult(_0x868d15,_0x1f3e18){_0x1f3e18=_0x1f3e18||0xc8;return function(_0x1a2a6b){if(_0x1a2a6b){return _0x868d15['status'](_0x1f3e18)['json'](_0x1a2a6b);}};}function respondWithFilteredResult(_0x58801a,_0x3997c1){return function(_0x292589){if(_0x292589){var _0x4c1f11=_0x292589[_0x51df('0x15')],_0x2178d6=_0x3997c1[_0x51df('0x16')],_0x5387da=_0x3997c1[_0x51df('0x16')]+_0x3997c1[_0x51df('0x17')],_0x37424d;if(_0x5387da>=_0x4c1f11){_0x5387da=_0x4c1f11;_0x37424d=0xc8;}else{_0x37424d=0xce;}_0x58801a['status'](_0x37424d);return _0x58801a[_0x51df('0x18')](_0x51df('0x19'),_0x2178d6+'-'+_0x5387da+'/'+_0x4c1f11)['json'](_0x292589);}return null;};}function patchUpdates(_0x44c7fb){return function(_0x4edde3){try{jsonpatch[_0x51df('0x1a')](_0x4edde3,_0x44c7fb,!![]);}catch(_0x28badb){return BPromise['reject'](_0x28badb);}return _0x4edde3[_0x51df('0x1b')]();};}function saveUpdates(_0x3cabfb,_0x360558){return function(_0x3d22f1){if(_0x3d22f1){return _0x3d22f1[_0x51df('0x1c')](_0x3cabfb)[_0x51df('0x1d')](function(_0xd67fd8){return _0xd67fd8;});}return null;};}function removeEntity(_0x3e9dba,_0x20868c){return function(_0x543aad){if(_0x543aad){return _0x543aad[_0x51df('0x1e')]()[_0x51df('0x1d')](function(){_0x3e9dba[_0x51df('0x14')](0xcc)[_0x51df('0x1f')]();});}};}function handleEntityNotFound(_0x54e4df,_0x878e29){return function(_0x2bf40a){if(!_0x2bf40a){_0x54e4df[_0x51df('0x13')](0x194);}return _0x2bf40a;};}function handleError(_0x4b6d5b,_0x4668e8){_0x4668e8=_0x4668e8||0x1f4;return function(_0x4ca9e5){logger['error'](_0x4ca9e5[_0x51df('0x20')]);if(_0x4ca9e5[_0x51df('0x21')]){delete _0x4ca9e5[_0x51df('0x21')];}_0x4b6d5b[_0x51df('0x14')](_0x4668e8)[_0x51df('0x22')](_0x4ca9e5);};}exports[_0x51df('0x23')]=function(_0x4a86c5,_0x249210){var _0x389de4={},_0x5383bb={},_0xb3a713={'count':0x0,'rows':[]};var _0x446615=db[_0x51df('0x24')][_0x51df('0x25')];_0x5383bb[_0x51df('0x26')]=_['keys'](_0x446615);_0x5383bb[_0x51df('0x27')]=_[_0x51df('0x28')](_0x4a86c5[_0x51df('0x27')]);_0x5383bb['filters']=_['intersection'](_0x5383bb['model'],_0x5383bb[_0x51df('0x27')]);_0x389de4[_0x51df('0x29')]=_[_0x51df('0x2a')](_0x5383bb[_0x51df('0x26')],qs[_0x51df('0x2b')](_0x4a86c5[_0x51df('0x27')]['fields']));_0x389de4[_0x51df('0x29')]=_0x389de4[_0x51df('0x29')][_0x51df('0x2c')]?_0x389de4[_0x51df('0x29')]:_0x5383bb['model'];if(!_0x4a86c5[_0x51df('0x27')]['hasOwnProperty'](_0x51df('0x2d'))){_0x389de4['limit']=qs[_0x51df('0x17')](_0x4a86c5[_0x51df('0x27')][_0x51df('0x17')]);_0x389de4[_0x51df('0x16')]=qs[_0x51df('0x16')](_0x4a86c5[_0x51df('0x27')][_0x51df('0x16')]);}_0x389de4[_0x51df('0x2e')]=qs[_0x51df('0x2f')](_0x4a86c5[_0x51df('0x27')][_0x51df('0x2f')]);_0x389de4[_0x51df('0x30')]=qs['filters'](_[_0x51df('0x31')](_0x4a86c5[_0x51df('0x27')],_0x5383bb[_0x51df('0x32')]));if(_0x4a86c5[_0x51df('0x27')]['filter']){_0x389de4[_0x51df('0x30')]=_['merge'](_0x389de4[_0x51df('0x30')],{'$or':_[_0x51df('0x33')](_0x446615,function(_0x4aad2a){if(_0x4aad2a[_0x51df('0x34')][_0x51df('0x35')]!==_0x51df('0x36')){var _0x2cae9e={};_0x2cae9e[_0x4aad2a[_0x51df('0x37')]]={'$like':'%'+_0x4a86c5[_0x51df('0x27')][_0x51df('0x38')]+'%'};return _0x2cae9e;}})});}_0x389de4=_[_0x51df('0x39')]({},_0x389de4,_0x4a86c5[_0x51df('0x3a')]);var _0x58d146={'where':_0x389de4[_0x51df('0x30')]};return db[_0x51df('0x24')]['count'](_0x58d146)['then'](function(_0x5c3468){_0xb3a713[_0x51df('0x15')]=_0x5c3468;if(_0x4a86c5[_0x51df('0x27')][_0x51df('0x3b')]){_0x389de4[_0x51df('0x3c')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x389de4);})['then'](function(_0x596130){_0xb3a713[_0x51df('0x3d')]=_0x596130;return _0xb3a713;})['then'](respondWithFilteredResult(_0x249210,_0x389de4))['catch'](handleError(_0x249210,null));};exports[_0x51df('0x3e')]=function(_0x38704d,_0x103da1){var _0x179902={'raw':!![],'where':{'id':_0x38704d[_0x51df('0x3f')]['id']}},_0x510ae9={};_0x510ae9[_0x51df('0x26')]=_[_0x51df('0x28')](db[_0x51df('0x24')][_0x51df('0x25')]);_0x510ae9[_0x51df('0x27')]=_['keys'](_0x38704d[_0x51df('0x27')]);_0x510ae9[_0x51df('0x32')]=_[_0x51df('0x2a')](_0x510ae9[_0x51df('0x26')],_0x510ae9[_0x51df('0x27')]);_0x179902[_0x51df('0x29')]=_[_0x51df('0x2a')](_0x510ae9[_0x51df('0x26')],qs[_0x51df('0x2b')](_0x38704d[_0x51df('0x27')][_0x51df('0x2b')]));_0x179902['attributes']=_0x179902[_0x51df('0x29')]['length']?_0x179902[_0x51df('0x29')]:_0x510ae9['model'];if(_0x38704d['query']['includeAll']){_0x179902[_0x51df('0x3c')]=[{'all':!![]}];}_0x179902=_[_0x51df('0x39')]({},_0x179902,_0x38704d[_0x51df('0x3a')]);return db[_0x51df('0x24')][_0x51df('0x40')](_0x179902)[_0x51df('0x1d')](handleEntityNotFound(_0x103da1,null))[_0x51df('0x1d')](respondWithResult(_0x103da1,null))['catch'](handleError(_0x103da1,null));};exports[_0x51df('0x41')]=function(_0x2b0e78,_0x3d0c9e){return db['ZendeskField'][_0x51df('0x41')](_0x2b0e78['body'],{})[_0x51df('0x1d')](respondWithResult(_0x3d0c9e,0xc9))[_0x51df('0x42')](handleError(_0x3d0c9e,null));};exports[_0x51df('0x1c')]=function(_0x53103c,_0x2cc108){if(_0x53103c[_0x51df('0x43')]['id']){delete _0x53103c[_0x51df('0x43')]['id'];}return db[_0x51df('0x24')]['find']({'where':{'id':_0x53103c[_0x51df('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2cc108,null))[_0x51df('0x1d')](saveUpdates(_0x53103c[_0x51df('0x43')],null))['then'](respondWithResult(_0x2cc108,null))[_0x51df('0x42')](handleError(_0x2cc108,null));};exports[_0x51df('0x1e')]=function(_0x36fec0,_0x21e8ac){return db['ZendeskField']['find']({'where':{'id':_0x36fec0[_0x51df('0x3f')]['id']}})[_0x51df('0x1d')](handleEntityNotFound(_0x21e8ac,null))[_0x51df('0x1d')](removeEntity(_0x21e8ac,null))[_0x51df('0x42')](handleError(_0x21e8ac,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index a112933..54493e8 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 _0x9ffd=['idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','./intZendeskField.attributes','ZendeskField','int_zendesk_fields','zendesk_unique_index'];(function(_0x393db8,_0x3e1157){var _0x4295cc=function(_0x59aaf2){while(--_0x59aaf2){_0x393db8['push'](_0x393db8['shift']());}};_0x4295cc(++_0x3e1157);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3b43e8,_0x5e2f3a){_0x3b43e8=_0x3b43e8-0x0;var _0x2e5e6e=_0x9ffd[_0x3b43e8];return _0x2e5e6e;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('api');var moment=require(_0xd9ff('0x3'));var BPromise=require(_0xd9ff('0x4'));var rp=require(_0xd9ff('0x5'));var attributes=require(_0xd9ff('0x6'));module['exports']=function(_0x1c9460,_0x111697){return _0x1c9460['define'](_0xd9ff('0x7'),attributes,{'tableName':_0xd9ff('0x8'),'paranoid':![],'indexes':[{'name':_0xd9ff('0x9'),'fields':[_0xd9ff('0xa'),_0xd9ff('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xea28=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index'];(function(_0xda209,_0x97f42f){var _0x3c1551=function(_0x4c54a5){while(--_0x4c54a5){_0xda209['push'](_0xda209['shift']());}};_0x3c1551(++_0x97f42f);}(_0xea28,0x13a));var _0x8ea2=function(_0x53b9d1,_0x2a98b2){_0x53b9d1=_0x53b9d1-0x0;var _0x1e222d=_0xea28[_0x53b9d1];return _0x1e222d;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var attributes=require(_0x8ea2('0x7'));module['exports']=function(_0x9b45ab,_0x23aaf1){return _0x9b45ab[_0x8ea2('0x8')]('ZendeskField',attributes,{'tableName':_0x8ea2('0x9'),'paranoid':![],'indexes':[{'name':_0x8ea2('0xa'),'fields':[_0x8ea2('0xb'),_0x8ea2('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index a136bd6..099999d 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 _0x02ce=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring'];(function(_0x51c301,_0x56bab6){var _0x5c81e9=function(_0x3f13b4){while(--_0x3f13b4){_0x51c301['push'](_0x51c301['shift']());}};_0x5c81e9(++_0x56bab6);}(_0x02ce,0x1ac));var _0xe02c=function(_0x243525,_0x1b9911){_0x243525=_0x243525-0x0;var _0x3c9b3d=_0x02ce[_0x243525];return _0x3c9b3d;};'use strict';var _=require(_0xe02c('0x0'));var util=require(_0xe02c('0x1'));var moment=require(_0xe02c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe02c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe02c('0x4'))['db'];var utils=require(_0xe02c('0x5'));var logger=require(_0xe02c('0x6'))(_0xe02c('0x7'));var config=require(_0xe02c('0x8'));var jayson=require(_0xe02c('0x9'));var client=jayson[_0xe02c('0xa')][_0xe02c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36a87f,_0x4fecb3,_0x5eabb0){return new BPromise(function(_0x3c757e,_0x2d85d7){return client[_0xe02c('0xc')](_0x36a87f,_0x5eabb0)[_0xe02c('0xd')](function(_0x2afbf5){logger[_0xe02c('0xe')](_0xe02c('0xf'),_0x4fecb3,_0xe02c('0x10'));logger[_0xe02c('0x11')](_0xe02c('0x12'),_0x4fecb3,_0xe02c('0x10'),JSON[_0xe02c('0x13')](_0x2afbf5));if(_0x2afbf5[_0xe02c('0x14')]){if(_0x2afbf5[_0xe02c('0x14')][_0xe02c('0x15')]===0x1f4){logger[_0xe02c('0x14')](_0xe02c('0xf'),_0x4fecb3,_0x2afbf5[_0xe02c('0x14')]['message']);return _0x2d85d7(_0x2afbf5[_0xe02c('0x14')]['message']);}logger['error'](_0xe02c('0xf'),_0x4fecb3,_0x2afbf5['error'][_0xe02c('0x16')]);return _0x3c757e(_0x2afbf5['error'][_0xe02c('0x16')]);}else{logger['info'](_0xe02c('0xf'),_0x4fecb3,_0xe02c('0x10'));_0x3c757e(_0x2afbf5['result'][_0xe02c('0x16')]);}})[_0xe02c('0x17')](function(_0x51676c){logger[_0xe02c('0x14')](_0xe02c('0xf'),_0x4fecb3,_0x51676c);_0x2d85d7(_0x51676c);});});} \ No newline at end of file +var _0xc901=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','lodash'];(function(_0x22be6d,_0x90876b){var _0x1985e1=function(_0x4a8921){while(--_0x4a8921){_0x22be6d['push'](_0x22be6d['shift']());}};_0x1985e1(++_0x90876b);}(_0xc901,0x142));var _0x1c90=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc901[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c90('0x1'));var db=require(_0x1c90('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c90('0x3'))(_0x1c90('0x4'));var config=require(_0x1c90('0x5'));var jayson=require(_0x1c90('0x6'));var client=jayson[_0x1c90('0x7')][_0x1c90('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x912860,_0x12c07d,_0x423cfb){return new BPromise(function(_0x19196f,_0x514386){return client[_0x1c90('0x9')](_0x912860,_0x423cfb)[_0x1c90('0xa')](function(_0x38cd18){logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x12c07d,'request\x20sent',JSON['stringify'](_0x38cd18));if(_0x38cd18[_0x1c90('0x10')]){if(_0x38cd18[_0x1c90('0x10')][_0x1c90('0x11')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x12c07d,_0x38cd18[_0x1c90('0x10')][_0x1c90('0x12')]);return _0x514386(_0x38cd18['error'][_0x1c90('0x12')]);}logger[_0x1c90('0x10')](_0x1c90('0xc'),_0x12c07d,_0x38cd18['error'][_0x1c90('0x12')]);return _0x19196f(_0x38cd18['error'][_0x1c90('0x12')]);}else{logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));_0x19196f(_0x38cd18['result'][_0x1c90('0x12')]);}})['catch'](function(_0x2d3c90){logger[_0x1c90('0x10')]('ZendeskField,\x20%s,\x20%s',_0x12c07d,_0x2d3c90);_0x514386(_0x2d3c90);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index c3360bc..255bfd8 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 _0xb688=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy'];(function(_0x368dbc,_0x1b3ddc){var _0x257b6b=function(_0x4cef54){while(--_0x4cef54){_0x368dbc['push'](_0x368dbc['shift']());}};_0x257b6b(++_0x1b3ddc);}(_0xb688,0xcf));var _0x8b68=function(_0x1292f1,_0xf3498c){_0x1292f1=_0x1292f1-0x0;var _0x4aacc1=_0xb688[_0x1292f1];return _0x4aacc1;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var auth=require(_0x8b68('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b68('0x6'));var controller=require(_0x8b68('0x7'));router[_0x8b68('0x8')]('/',auth[_0x8b68('0x9')](),controller['index']);router[_0x8b68('0x8')]('/:id',auth[_0x8b68('0x9')](),controller[_0x8b68('0xa')]);router[_0x8b68('0x8')](_0x8b68('0xb'),auth[_0x8b68('0x9')](),controller[_0x8b68('0xc')]);router[_0x8b68('0x8')](_0x8b68('0xd'),auth[_0x8b68('0x9')](),controller[_0x8b68('0xe')]);router[_0x8b68('0xf')]('/',auth[_0x8b68('0x9')](),controller[_0x8b68('0x10')]);router['post'](_0x8b68('0xb'),auth[_0x8b68('0x9')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0x13'),auth[_0x8b68('0x9')](),controller[_0x8b68('0x14')]);router[_0x8b68('0x15')](_0x8b68('0x13'),auth['isAuthenticated'](),controller[_0x8b68('0x16')]);module['exports']=router; \ No newline at end of file +var _0xa571=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','./intZohoAccount.controller','isAuthenticated','index','get'];(function(_0x52f177,_0x41ea86){var _0x32d5ef=function(_0x417c4b){while(--_0x417c4b){_0x52f177['push'](_0x52f177['shift']());}};_0x32d5ef(++_0x41ea86);}(_0xa571,0x107));var _0x1a57=function(_0x549966,_0x1bb990){_0x549966=_0x549966-0x0;var _0x4e1609=_0xa571[_0x549966];return _0x4e1609;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var auth=require(_0x1a57('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a57('0x6'));router['get']('/',auth[_0x1a57('0x7')](),controller[_0x1a57('0x8')]);router[_0x1a57('0x9')](_0x1a57('0xa'),auth[_0x1a57('0x7')](),controller[_0x1a57('0xb')]);router['get'](_0x1a57('0xc'),auth[_0x1a57('0x7')](),controller[_0x1a57('0xd')]);router['get'](_0x1a57('0xe'),auth[_0x1a57('0x7')](),controller[_0x1a57('0xf')]);router[_0x1a57('0x10')]('/',auth[_0x1a57('0x7')](),controller[_0x1a57('0x11')]);router[_0x1a57('0x10')](_0x1a57('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x1a57('0x12')](_0x1a57('0xa'),auth[_0x1a57('0x7')](),controller['update']);router[_0x1a57('0x13')](_0x1a57('0xa'),auth['isAuthenticated'](),controller[_0x1a57('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 25758ad..7982238 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 _0xef40=['exports','STRING','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xef40,0x146));var _0x0ef4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xef40[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0ef4('0x0'));module[_0x0ef4('0x1')]={'name':{'type':Sequelize[_0x0ef4('0x2')]},'description':{'type':Sequelize[_0x0ef4('0x2')]},'authToken':{'type':Sequelize[_0x0ef4('0x2')]},'host':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda2d=['STRING','exports'];(function(_0x417123,_0x5b001e){var _0x1b1ccf=function(_0x1694f9){while(--_0x1694f9){_0x417123['push'](_0x417123['shift']());}};_0x1b1ccf(++_0x5b001e);}(_0xda2d,0x113));var _0xdda2=function(_0x55cf2b,_0x5ffdcb){_0x55cf2b=_0x55cf2b-0x0;var _0x127942=_0xda2d[_0x55cf2b];return _0x127942;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'name':{'type':Sequelize[_0xdda2('0x1')]},'description':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xdda2('0x1')]},'host':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 8277d72..b9af977 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 _0xac10=['jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','request','then','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZohoAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','update','destroy','stack','send','index','ZohoAccount','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','field','merge','options','includeAll','include','findAll','show','keys','rawAttributes','find','create','body','params','getConfigurations','ZohoConfiguration','map','addConfiguration','findOne','AccountId','Subjects','channel','type','Descriptions','getDescriptions','ZohoField','getFields','host','authToken','GET','format','crmapi','response','Calls','section','Call\x20Purpose','push','customfield','true','Pick\x20List','val','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','name','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x5e72e1,_0x4bde3b){var _0x4150cb=function(_0x40dd8a){while(--_0x40dd8a){_0x5e72e1['push'](_0x5e72e1['shift']());}};_0x4150cb(++_0x4bde3b);}(_0xac10,0x65));var _0x0ac1=function(_0x2550c0,_0x48fb19){_0x2550c0=_0x2550c0-0x0;var _0x2e8666=_0xac10[_0x2550c0];return _0x2e8666;};'use strict';var pdf=require(_0x0ac1('0x0'));var emlformat=require(_0x0ac1('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0ac1('0x2'));var rp=require(_0x0ac1('0x3'));var moment=require(_0x0ac1('0x4'));var BPromise=require(_0x0ac1('0x5'));var Mustache=require(_0x0ac1('0x6'));var util=require('util');var path=require(_0x0ac1('0x7'));var sox=require(_0x0ac1('0x8'));var csv=require(_0x0ac1('0x9'));var ejs=require(_0x0ac1('0xa'));var fs=require('fs');var _=require(_0x0ac1('0xb'));var squel=require(_0x0ac1('0xc'));var crypto=require(_0x0ac1('0xd'));var jsforce=require(_0x0ac1('0xe'));var deskjs=require(_0x0ac1('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ac1('0x10'));var Papa=require('papaparse');var authService=require(_0x0ac1('0x11'));var hardwareService=require(_0x0ac1('0x12'));var Redis=require(_0x0ac1('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x0ac1('0x14'))(_0x0ac1('0x15'));var utils=require(_0x0ac1('0x16'));var config=require(_0x0ac1('0x17'));var db=require(_0x0ac1('0x18'))['db'];var integrations=require(_0x0ac1('0x19'));var jayson=require('jayson/promise');var client=jayson[_0x0ac1('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e1884,_0x3ab175,_0x4e37ed,_0x4011b2){return new BPromise(function(_0x375405,_0xffd8ae){var _0x34cdb4=_0x4011b2||client;return _0x34cdb4[_0x0ac1('0x1b')](_0x5e1884,_0x4e37ed)[_0x0ac1('0x1c')](function(_0x5da32e){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x3ab175,_0x0ac1('0x1d'));logger[_0x0ac1('0x1e')](_0x0ac1('0x1f'),_0x3ab175,'request\x20sent',JSON[_0x0ac1('0x20')](_0x5da32e));if(_0x5da32e[_0x0ac1('0x21')]){if(_0x5da32e[_0x0ac1('0x21')]['code']===0x1f4){logger[_0x0ac1('0x21')](_0x0ac1('0x22'),_0x3ab175,_0x5da32e[_0x0ac1('0x21')]['message']);return _0xffd8ae(_0x5da32e[_0x0ac1('0x21')][_0x0ac1('0x23')]);}logger[_0x0ac1('0x21')]('ZohoAccount,\x20%s,\x20%s',_0x3ab175,_0x5da32e[_0x0ac1('0x21')][_0x0ac1('0x23')]);return _0x375405(_0x5da32e['error'][_0x0ac1('0x23')]);}else{logger[_0x0ac1('0x24')](_0x0ac1('0x22'),_0x3ab175,'request\x20sent');_0x375405(_0x5da32e[_0x0ac1('0x25')][_0x0ac1('0x23')]);}})[_0x0ac1('0x26')](function(_0x31ea37){logger[_0x0ac1('0x21')]('ZohoAccount,\x20%s,\x20%s',_0x3ab175,_0x31ea37);_0xffd8ae(_0x31ea37);});});}function respondWithStatusCode(_0x8260bc,_0x424dd7){_0x424dd7=_0x424dd7||0xcc;return function(_0x3efee9){if(_0x3efee9){return _0x8260bc[_0x0ac1('0x27')](_0x424dd7);}return _0x8260bc['status'](_0x424dd7)[_0x0ac1('0x28')]();};}function respondWithResult(_0x315d00,_0x466032){_0x466032=_0x466032||0xc8;return function(_0x2f7541){if(_0x2f7541){return _0x315d00[_0x0ac1('0x29')](_0x466032)[_0x0ac1('0x2a')](_0x2f7541);}};}function respondWithFilteredResult(_0x20c4f9,_0xc97dd3){return function(_0x1ed96c){if(_0x1ed96c){var _0x232efb=_0x1ed96c[_0x0ac1('0x2b')],_0xe509ba=_0xc97dd3[_0x0ac1('0x2c')],_0x30d2ce=_0xc97dd3['offset']+_0xc97dd3['limit'],_0x42e84e;if(_0x30d2ce>=_0x232efb){_0x30d2ce=_0x232efb;_0x42e84e=0xc8;}else{_0x42e84e=0xce;}_0x20c4f9[_0x0ac1('0x29')](_0x42e84e);return _0x20c4f9['set'](_0x0ac1('0x2d'),_0xe509ba+'-'+_0x30d2ce+'/'+_0x232efb)['json'](_0x1ed96c);}return null;};}function patchUpdates(_0x29a25f){return function(_0x191297){try{jsonpatch[_0x0ac1('0x2e')](_0x191297,_0x29a25f,!![]);}catch(_0x38be80){return BPromise[_0x0ac1('0x2f')](_0x38be80);}return _0x191297['save']();};}function saveUpdates(_0x4d1ede,_0xaa9f97){return function(_0x9e2b71){if(_0x9e2b71){return _0x9e2b71[_0x0ac1('0x30')](_0x4d1ede)[_0x0ac1('0x1c')](function(_0x405db3){return _0x405db3;});}return null;};}function removeEntity(_0x48d082,_0x5171d6){return function(_0x2cbb93){if(_0x2cbb93){return _0x2cbb93[_0x0ac1('0x31')]()[_0x0ac1('0x1c')](function(){_0x48d082[_0x0ac1('0x29')](0xcc)[_0x0ac1('0x28')]();});}};}function handleEntityNotFound(_0x24cafb,_0x5b3ff6){return function(_0x315a06){if(!_0x315a06){_0x24cafb[_0x0ac1('0x27')](0x194);}return _0x315a06;};}function handleError(_0x265ff4,_0x574814){_0x574814=_0x574814||0x1f4;return function(_0x1f06a7){logger[_0x0ac1('0x21')](_0x1f06a7[_0x0ac1('0x32')]);if(_0x1f06a7['name']){delete _0x1f06a7['name'];}_0x265ff4[_0x0ac1('0x29')](_0x574814)[_0x0ac1('0x33')](_0x1f06a7);};}exports[_0x0ac1('0x34')]=function(_0x3ae3da,_0x3f2210){var _0x182212={},_0x1656dd={},_0x2d8f15={'count':0x0,'rows':[]};var _0x592bf5=db[_0x0ac1('0x35')]['rawAttributes'];_0x1656dd[_0x0ac1('0x36')]=_['keys'](_0x592bf5);_0x1656dd[_0x0ac1('0x37')]=_['keys'](_0x3ae3da['query']);_0x1656dd['filters']=_['intersection'](_0x1656dd['model'],_0x1656dd['query']);_0x182212[_0x0ac1('0x38')]=_[_0x0ac1('0x39')](_0x1656dd[_0x0ac1('0x36')],qs[_0x0ac1('0x3a')](_0x3ae3da[_0x0ac1('0x37')][_0x0ac1('0x3a')]));_0x182212[_0x0ac1('0x38')]=_0x182212[_0x0ac1('0x38')][_0x0ac1('0x3b')]?_0x182212[_0x0ac1('0x38')]:_0x1656dd[_0x0ac1('0x36')];if(!_0x3ae3da[_0x0ac1('0x37')][_0x0ac1('0x3c')](_0x0ac1('0x3d'))){_0x182212[_0x0ac1('0x3e')]=qs[_0x0ac1('0x3e')](_0x3ae3da[_0x0ac1('0x37')][_0x0ac1('0x3e')]);_0x182212[_0x0ac1('0x2c')]=qs[_0x0ac1('0x2c')](_0x3ae3da[_0x0ac1('0x37')][_0x0ac1('0x2c')]);}_0x182212[_0x0ac1('0x3f')]=qs[_0x0ac1('0x40')](_0x3ae3da['query'][_0x0ac1('0x40')]);_0x182212[_0x0ac1('0x41')]=qs[_0x0ac1('0x42')](_[_0x0ac1('0x43')](_0x3ae3da[_0x0ac1('0x37')],_0x1656dd[_0x0ac1('0x42')]));if(_0x3ae3da['query'][_0x0ac1('0x44')]){_0x182212[_0x0ac1('0x41')]=_['merge'](_0x182212[_0x0ac1('0x41')],{'$or':_['map'](_0x592bf5,function(_0x515aa0){if(_0x515aa0['type']['key']!==_0x0ac1('0x45')){var _0x539ab6={};_0x539ab6[_0x515aa0[_0x0ac1('0x46')]]={'$like':'%'+_0x3ae3da[_0x0ac1('0x37')]['filter']+'%'};return _0x539ab6;}})});}_0x182212=_[_0x0ac1('0x47')]({},_0x182212,_0x3ae3da[_0x0ac1('0x48')]);var _0x777d35={'where':_0x182212[_0x0ac1('0x41')]};return db[_0x0ac1('0x35')]['count'](_0x777d35)[_0x0ac1('0x1c')](function(_0x4e21a7){_0x2d8f15[_0x0ac1('0x2b')]=_0x4e21a7;if(_0x3ae3da[_0x0ac1('0x37')][_0x0ac1('0x49')]){_0x182212[_0x0ac1('0x4a')]=[{'all':!![]}];}return db[_0x0ac1('0x35')][_0x0ac1('0x4b')](_0x182212);})[_0x0ac1('0x1c')](function(_0x1766ee){_0x2d8f15['rows']=_0x1766ee;return _0x2d8f15;})[_0x0ac1('0x1c')](respondWithFilteredResult(_0x3f2210,_0x182212))[_0x0ac1('0x26')](handleError(_0x3f2210,null));};exports[_0x0ac1('0x4c')]=function(_0x5291c2,_0xa5fe26){var _0x1627d2={'raw':![],'where':{'id':_0x5291c2['params']['id']}},_0x4dd2d2={};_0x4dd2d2[_0x0ac1('0x36')]=_[_0x0ac1('0x4d')](db[_0x0ac1('0x35')][_0x0ac1('0x4e')]);_0x4dd2d2[_0x0ac1('0x37')]=_['keys'](_0x5291c2[_0x0ac1('0x37')]);_0x4dd2d2[_0x0ac1('0x42')]=_[_0x0ac1('0x39')](_0x4dd2d2[_0x0ac1('0x36')],_0x4dd2d2[_0x0ac1('0x37')]);_0x1627d2[_0x0ac1('0x38')]=_[_0x0ac1('0x39')](_0x4dd2d2[_0x0ac1('0x36')],qs[_0x0ac1('0x3a')](_0x5291c2['query'][_0x0ac1('0x3a')]));_0x1627d2[_0x0ac1('0x38')]=_0x1627d2['attributes'][_0x0ac1('0x3b')]?_0x1627d2[_0x0ac1('0x38')]:_0x4dd2d2[_0x0ac1('0x36')];if(_0x5291c2[_0x0ac1('0x37')][_0x0ac1('0x49')]){_0x1627d2[_0x0ac1('0x4a')]=[{'all':!![]}];}_0x1627d2=_[_0x0ac1('0x47')]({},_0x1627d2,_0x5291c2['options']);return db[_0x0ac1('0x35')][_0x0ac1('0x4f')](_0x1627d2)['then'](handleEntityNotFound(_0xa5fe26,null))[_0x0ac1('0x1c')](respondWithResult(_0xa5fe26,null))[_0x0ac1('0x26')](handleError(_0xa5fe26,null));};exports[_0x0ac1('0x50')]=function(_0x59e96f,_0x30cf3c){return db[_0x0ac1('0x35')][_0x0ac1('0x50')](_0x59e96f[_0x0ac1('0x51')],{})[_0x0ac1('0x1c')](respondWithResult(_0x30cf3c,0xc9))[_0x0ac1('0x26')](handleError(_0x30cf3c,null));};exports[_0x0ac1('0x30')]=function(_0x3440ee,_0x2118d2){if(_0x3440ee[_0x0ac1('0x51')]['id']){delete _0x3440ee[_0x0ac1('0x51')]['id'];}return db[_0x0ac1('0x35')]['find']({'where':{'id':_0x3440ee[_0x0ac1('0x52')]['id']}})[_0x0ac1('0x1c')](handleEntityNotFound(_0x2118d2,null))[_0x0ac1('0x1c')](saveUpdates(_0x3440ee[_0x0ac1('0x51')],null))[_0x0ac1('0x1c')](respondWithResult(_0x2118d2,null))[_0x0ac1('0x26')](handleError(_0x2118d2,null));};exports['destroy']=function(_0x243b9b,_0x4e9752){return db[_0x0ac1('0x35')][_0x0ac1('0x4f')]({'where':{'id':_0x243b9b['params']['id']}})['then'](handleEntityNotFound(_0x4e9752,null))[_0x0ac1('0x1c')](removeEntity(_0x4e9752,null))[_0x0ac1('0x26')](handleError(_0x4e9752,null));};exports[_0x0ac1('0x53')]=function(_0x5f40de,_0x135b69,_0x2a0c8e){var _0x555c32={};var _0x15582e={};var _0x133899;var _0x434d56;return db[_0x0ac1('0x35')]['findOne']({'where':{'id':_0x5f40de[_0x0ac1('0x52')]['id']}})[_0x0ac1('0x1c')](handleEntityNotFound(_0x135b69,null))[_0x0ac1('0x1c')](function(_0x28a1ad){if(_0x28a1ad){_0x133899=_0x28a1ad;_0x15582e[_0x0ac1('0x36')]=_[_0x0ac1('0x4d')](db[_0x0ac1('0x54')][_0x0ac1('0x4e')]);_0x15582e[_0x0ac1('0x37')]=_[_0x0ac1('0x4d')](_0x5f40de[_0x0ac1('0x37')]);_0x15582e[_0x0ac1('0x42')]=_[_0x0ac1('0x39')](_0x15582e['model'],_0x15582e[_0x0ac1('0x37')]);_0x555c32[_0x0ac1('0x38')]=_[_0x0ac1('0x39')](_0x15582e[_0x0ac1('0x36')],qs[_0x0ac1('0x3a')](_0x5f40de[_0x0ac1('0x37')][_0x0ac1('0x3a')]));_0x555c32['attributes']=_0x555c32[_0x0ac1('0x38')]['length']?_0x555c32[_0x0ac1('0x38')]:_0x15582e[_0x0ac1('0x36')];_0x555c32['order']=qs[_0x0ac1('0x40')](_0x5f40de[_0x0ac1('0x37')]['sort']);_0x555c32[_0x0ac1('0x41')]=qs[_0x0ac1('0x42')](_[_0x0ac1('0x43')](_0x5f40de[_0x0ac1('0x37')],_0x15582e[_0x0ac1('0x42')]));if(_0x5f40de[_0x0ac1('0x37')][_0x0ac1('0x44')]){_0x555c32['where']=_[_0x0ac1('0x47')](_0x555c32[_0x0ac1('0x41')],{'$or':_[_0x0ac1('0x55')](_0x555c32[_0x0ac1('0x38')],function(_0x12370d){var _0x1a976c={};_0x1a976c[_0x12370d]={'$like':'%'+_0x5f40de['query'][_0x0ac1('0x44')]+'%'};return _0x1a976c;})});}_0x555c32=_[_0x0ac1('0x47')]({},_0x555c32,_0x5f40de[_0x0ac1('0x48')]);return _0x133899[_0x0ac1('0x53')](_0x555c32);}})[_0x0ac1('0x1c')](function(_0x4fa743){if(_0x4fa743){_0x434d56=_0x4fa743[_0x0ac1('0x3b')];if(!_0x5f40de[_0x0ac1('0x37')][_0x0ac1('0x3c')]('nolimit')){_0x555c32[_0x0ac1('0x3e')]=qs[_0x0ac1('0x3e')](_0x5f40de[_0x0ac1('0x37')][_0x0ac1('0x3e')]);_0x555c32[_0x0ac1('0x2c')]=qs[_0x0ac1('0x2c')](_0x5f40de['query'][_0x0ac1('0x2c')]);}return _0x133899[_0x0ac1('0x53')](_0x555c32);}})[_0x0ac1('0x1c')](function(_0xe12a4d){if(_0xe12a4d){return _0xe12a4d?{'count':_0x434d56,'rows':_0xe12a4d}:null;}})[_0x0ac1('0x1c')](respondWithResult(_0x135b69,null))[_0x0ac1('0x26')](handleError(_0x135b69,null));};exports[_0x0ac1('0x56')]=function(_0x53ba67,_0x5796a7,_0x2c3220){if(_0x53ba67[_0x0ac1('0x51')]['id']){delete _0x53ba67[_0x0ac1('0x51')]['id'];}return db[_0x0ac1('0x35')][_0x0ac1('0x57')]({'where':{'id':_0x53ba67[_0x0ac1('0x52')]['id']}})[_0x0ac1('0x1c')](handleEntityNotFound(_0x5796a7,null))[_0x0ac1('0x1c')](function(_0x1aaf55){if(_0x1aaf55){_0x53ba67['body'][_0x0ac1('0x58')]=_0x1aaf55['id'];_0x53ba67[_0x0ac1('0x51')][_0x0ac1('0x59')]=integrations['getSubjects'](_0x53ba67['body'][_0x0ac1('0x5a')],_0x53ba67[_0x0ac1('0x51')][_0x0ac1('0x5b')]);_0x53ba67[_0x0ac1('0x51')][_0x0ac1('0x5c')]=integrations[_0x0ac1('0x5d')](_0x53ba67[_0x0ac1('0x51')]['channel'],_0x53ba67[_0x0ac1('0x51')]['type']);return db['ZohoConfiguration'][_0x0ac1('0x50')](_0x53ba67[_0x0ac1('0x51')],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0x0ac1('0x5e')],'as':_0x0ac1('0x5c')}]});}return null;})[_0x0ac1('0x1c')](respondWithResult(_0x5796a7,null))[_0x0ac1('0x26')](handleError(_0x5796a7,null));};exports[_0x0ac1('0x5f')]=function(_0xfcbb30,_0x4178f8,_0x315c28){return db[_0x0ac1('0x35')][_0x0ac1('0x57')]({'where':{'id':_0xfcbb30['params']['id']},'attributes':['id',_0x0ac1('0x60'),_0x0ac1('0x61')]})[_0x0ac1('0x1c')](handleEntityNotFound(_0x4178f8,null))[_0x0ac1('0x1c')](function(_0x5cc57c){if(_0x5cc57c){return rp({'method':_0x0ac1('0x62'),'uri':util[_0x0ac1('0x63')]('https://crm.%s/crm/private/json/Calls/getFields',_0x5cc57c[_0x0ac1('0x60')]),'qs':{'authtoken':_0x5cc57c['authToken'],'scope':_0x0ac1('0x64')},'json':!![]});}})[_0x0ac1('0x1c')](function(_0x22b9b7){if(_0x22b9b7){if(_0x22b9b7[_0x0ac1('0x65')]&&_0x22b9b7[_0x0ac1('0x65')]['error']){throw new Error(_0x22b9b7[_0x0ac1('0x65')][_0x0ac1('0x21')][_0x0ac1('0x23')]);}var _0x20fda7=[];if(_0x22b9b7[_0x0ac1('0x66')]&&_0x22b9b7[_0x0ac1('0x66')][_0x0ac1('0x67')]){if(_0x22b9b7[_0x0ac1('0x66')][_0x0ac1('0x67')]['FL']){var _0x859949=[_0x0ac1('0x68')];for(var _0x25be5a=0x0,_0x3ffd09=_0x22b9b7[_0x0ac1('0x66')]['section']['FL']['length'];_0x25be5a<_0x3ffd09;_0x25be5a++){if(_['includes'](_0x859949,_0x22b9b7[_0x0ac1('0x66')][_0x0ac1('0x67')]['FL'][_0x25be5a]['dv'])){_0x20fda7[_0x0ac1('0x69')]({'id':_0x22b9b7['Calls']['section']['FL'][_0x25be5a]['dv'],'name':_0x22b9b7['Calls'][_0x0ac1('0x67')]['FL'][_0x25be5a]['label'],'custom':_0x22b9b7[_0x0ac1('0x66')][_0x0ac1('0x67')]['FL'][_0x25be5a][_0x0ac1('0x6a')]===_0x0ac1('0x6b')?!![]:![],'options':_0x22b9b7[_0x0ac1('0x66')][_0x0ac1('0x67')]['FL'][_0x25be5a][_0x0ac1('0x5b')]===_0x0ac1('0x6c')&&_0x22b9b7[_0x0ac1('0x66')][_0x0ac1('0x67')]['FL'][_0x25be5a]['val']?_[_0x0ac1('0x55')](_0x22b9b7[_0x0ac1('0x66')][_0x0ac1('0x67')]['FL'][_0x25be5a][_0x0ac1('0x6d')],function(_0x1d4c38){return{'name':_0x1d4c38,'value':_0x1d4c38};}):[]});}}}}return{'count':_0x20fda7['length'],'rows':_0x20fda7};}})[_0x0ac1('0x1c')](respondWithResult(_0x4178f8,null))[_0x0ac1('0x26')](function(_0x26c59a){var _0x44b751=_0xfcbb30[_0x0ac1('0x37')][_0x0ac1('0x6e')]?0x1f4:_0x26c59a[_0x0ac1('0x6f')]||0x1f4;logger['error'](_0x0ac1('0x70'),_0x0ac1('0x5f'),_0x44b751,JSON[_0x0ac1('0x20')](_0x26c59a));delete _0x26c59a[_0x0ac1('0x71')];if(_0x44b751===0x191){_0x44b751=0x190;}_0x4178f8[_0x0ac1('0x29')](_0x44b751)['send'](_0xfcbb30[_0x0ac1('0x37')]['test']?{'message':_0x0ac1('0x72'),'statusCode':_0x26c59a[_0x0ac1('0x6f')]}:_0x26c59a);});}; \ No newline at end of file +var _0x6918=['field','merge','options','count','includeAll','findAll','rows','show','params','include','find','create','body','getConfigurations','findOne','ZohoConfiguration','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','ZohoField','getFields','host','GET','format','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','Calls','section','Call\x20Purpose','includes','push','label','Pick\x20List','val','test','statusCode','name','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','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','../../components/integrations/configuration','jayson/promise','client','http','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','status','json','offset','limit','Content-Range','apply','reject','save','update','end','send','ZohoAccount','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','map','type','key','VIRTUAL'];(function(_0x39b6bc,_0x4aff45){var _0x544ae2=function(_0x3f10be){while(--_0x3f10be){_0x39b6bc['push'](_0x39b6bc['shift']());}};_0x544ae2(++_0x4aff45);}(_0x6918,0x17a));var _0x8691=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6918[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require(_0x8691('0x0'));var emlformat=require(_0x8691('0x1'));var rimraf=require(_0x8691('0x2'));var zipdir=require(_0x8691('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8691('0x4'));var moment=require('moment');var BPromise=require(_0x8691('0x5'));var Mustache=require(_0x8691('0x6'));var util=require('util');var path=require(_0x8691('0x7'));var sox=require('sox');var csv=require(_0x8691('0x8'));var ejs=require(_0x8691('0x9'));var fs=require('fs');var _=require(_0x8691('0xa'));var squel=require(_0x8691('0xb'));var crypto=require(_0x8691('0xc'));var jsforce=require(_0x8691('0xd'));var deskjs=require(_0x8691('0xe'));var toCsv=require(_0x8691('0x8'));var querystring=require(_0x8691('0xf'));var Papa=require(_0x8691('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0x8691('0x11'));var Redis=require(_0x8691('0x12'));var qs=require(_0x8691('0x13'));var logger=require(_0x8691('0x14'))(_0x8691('0x15'));var utils=require(_0x8691('0x16'));var config=require(_0x8691('0x17'));var db=require(_0x8691('0x18'))['db'];var integrations=require(_0x8691('0x19'));var jayson=require(_0x8691('0x1a'));var client=jayson[_0x8691('0x1b')][_0x8691('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1476b3,_0x605711,_0x18f549,_0x4eca94){return new BPromise(function(_0x3fd5e9,_0x4620c3){var _0xdd195a=_0x4eca94||client;return _0xdd195a['request'](_0x1476b3,_0x18f549)[_0x8691('0x1d')](function(_0x3530bc){logger['info'](_0x8691('0x1e'),_0x605711,_0x8691('0x1f'));logger[_0x8691('0x20')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x605711,'request\x20sent',JSON[_0x8691('0x21')](_0x3530bc));if(_0x3530bc['error']){if(_0x3530bc[_0x8691('0x22')][_0x8691('0x23')]===0x1f4){logger[_0x8691('0x22')](_0x8691('0x1e'),_0x605711,_0x3530bc[_0x8691('0x22')][_0x8691('0x24')]);return _0x4620c3(_0x3530bc[_0x8691('0x22')][_0x8691('0x24')]);}logger[_0x8691('0x22')](_0x8691('0x1e'),_0x605711,_0x3530bc[_0x8691('0x22')][_0x8691('0x24')]);return _0x3fd5e9(_0x3530bc[_0x8691('0x22')][_0x8691('0x24')]);}else{logger[_0x8691('0x25')]('ZohoAccount,\x20%s,\x20%s',_0x605711,_0x8691('0x1f'));_0x3fd5e9(_0x3530bc[_0x8691('0x26')][_0x8691('0x24')]);}})[_0x8691('0x27')](function(_0x4c672b){logger[_0x8691('0x22')](_0x8691('0x1e'),_0x605711,_0x4c672b);_0x4620c3(_0x4c672b);});});}function respondWithStatusCode(_0x5e9d7d,_0x11c593){_0x11c593=_0x11c593||0xcc;return function(_0x5d0e26){if(_0x5d0e26){return _0x5e9d7d['sendStatus'](_0x11c593);}return _0x5e9d7d[_0x8691('0x28')](_0x11c593)['end']();};}function respondWithResult(_0x2702f4,_0x2b7574){_0x2b7574=_0x2b7574||0xc8;return function(_0x53a5d6){if(_0x53a5d6){return _0x2702f4[_0x8691('0x28')](_0x2b7574)[_0x8691('0x29')](_0x53a5d6);}};}function respondWithFilteredResult(_0x3b4d61,_0x1a2c69){return function(_0x4f16a9){if(_0x4f16a9){var _0x4bd77c=_0x4f16a9['count'],_0x556e86=_0x1a2c69[_0x8691('0x2a')],_0x51cf6c=_0x1a2c69['offset']+_0x1a2c69[_0x8691('0x2b')],_0x572b2e;if(_0x51cf6c>=_0x4bd77c){_0x51cf6c=_0x4bd77c;_0x572b2e=0xc8;}else{_0x572b2e=0xce;}_0x3b4d61['status'](_0x572b2e);return _0x3b4d61['set'](_0x8691('0x2c'),_0x556e86+'-'+_0x51cf6c+'/'+_0x4bd77c)['json'](_0x4f16a9);}return null;};}function patchUpdates(_0x3826a7){return function(_0x332024){try{jsonpatch[_0x8691('0x2d')](_0x332024,_0x3826a7,!![]);}catch(_0x31adec){return BPromise[_0x8691('0x2e')](_0x31adec);}return _0x332024[_0x8691('0x2f')]();};}function saveUpdates(_0x342e68,_0x868b22){return function(_0x2bc6ee){if(_0x2bc6ee){return _0x2bc6ee[_0x8691('0x30')](_0x342e68)[_0x8691('0x1d')](function(_0x463f76){return _0x463f76;});}return null;};}function removeEntity(_0x345160,_0x495999){return function(_0x1f7a75){if(_0x1f7a75){return _0x1f7a75['destroy']()['then'](function(){_0x345160[_0x8691('0x28')](0xcc)[_0x8691('0x31')]();});}};}function handleEntityNotFound(_0x44d4f4,_0x594901){return function(_0x4417c6){if(!_0x4417c6){_0x44d4f4['sendStatus'](0x194);}return _0x4417c6;};}function handleError(_0x190301,_0x5c003b){_0x5c003b=_0x5c003b||0x1f4;return function(_0x942a0c){logger[_0x8691('0x22')](_0x942a0c['stack']);if(_0x942a0c['name']){delete _0x942a0c['name'];}_0x190301['status'](_0x5c003b)[_0x8691('0x32')](_0x942a0c);};}exports['index']=function(_0x54ee35,_0x48f5e1){var _0x3eefd9={},_0x314dd8={},_0x3f2411={'count':0x0,'rows':[]};var _0x587b7b=db[_0x8691('0x33')][_0x8691('0x34')];_0x314dd8['model']=_[_0x8691('0x35')](_0x587b7b);_0x314dd8[_0x8691('0x36')]=_[_0x8691('0x35')](_0x54ee35[_0x8691('0x36')]);_0x314dd8[_0x8691('0x37')]=_[_0x8691('0x38')](_0x314dd8[_0x8691('0x39')],_0x314dd8[_0x8691('0x36')]);_0x3eefd9[_0x8691('0x3a')]=_[_0x8691('0x38')](_0x314dd8['model'],qs[_0x8691('0x3b')](_0x54ee35[_0x8691('0x36')][_0x8691('0x3b')]));_0x3eefd9['attributes']=_0x3eefd9[_0x8691('0x3a')][_0x8691('0x3c')]?_0x3eefd9[_0x8691('0x3a')]:_0x314dd8[_0x8691('0x39')];if(!_0x54ee35[_0x8691('0x36')]['hasOwnProperty']('nolimit')){_0x3eefd9[_0x8691('0x2b')]=qs[_0x8691('0x2b')](_0x54ee35[_0x8691('0x36')][_0x8691('0x2b')]);_0x3eefd9['offset']=qs['offset'](_0x54ee35[_0x8691('0x36')]['offset']);}_0x3eefd9[_0x8691('0x3d')]=qs[_0x8691('0x3e')](_0x54ee35['query'][_0x8691('0x3e')]);_0x3eefd9[_0x8691('0x3f')]=qs[_0x8691('0x37')](_[_0x8691('0x40')](_0x54ee35[_0x8691('0x36')],_0x314dd8[_0x8691('0x37')]));if(_0x54ee35[_0x8691('0x36')][_0x8691('0x41')]){_0x3eefd9[_0x8691('0x3f')]=_['merge'](_0x3eefd9[_0x8691('0x3f')],{'$or':_[_0x8691('0x42')](_0x587b7b,function(_0x469669){if(_0x469669[_0x8691('0x43')][_0x8691('0x44')]!==_0x8691('0x45')){var _0xce6924={};_0xce6924[_0x469669[_0x8691('0x46')]]={'$like':'%'+_0x54ee35[_0x8691('0x36')][_0x8691('0x41')]+'%'};return _0xce6924;}})});}_0x3eefd9=_[_0x8691('0x47')]({},_0x3eefd9,_0x54ee35[_0x8691('0x48')]);var _0x4dc4c5={'where':_0x3eefd9[_0x8691('0x3f')]};return db[_0x8691('0x33')][_0x8691('0x49')](_0x4dc4c5)['then'](function(_0x1c8313){_0x3f2411[_0x8691('0x49')]=_0x1c8313;if(_0x54ee35['query'][_0x8691('0x4a')]){_0x3eefd9['include']=[{'all':!![]}];}return db[_0x8691('0x33')][_0x8691('0x4b')](_0x3eefd9);})[_0x8691('0x1d')](function(_0x270bf3){_0x3f2411[_0x8691('0x4c')]=_0x270bf3;return _0x3f2411;})[_0x8691('0x1d')](respondWithFilteredResult(_0x48f5e1,_0x3eefd9))[_0x8691('0x27')](handleError(_0x48f5e1,null));};exports[_0x8691('0x4d')]=function(_0x124c53,_0x1694cd){var _0x1a3f0e={'raw':![],'where':{'id':_0x124c53[_0x8691('0x4e')]['id']}},_0x147097={};_0x147097[_0x8691('0x39')]=_[_0x8691('0x35')](db[_0x8691('0x33')][_0x8691('0x34')]);_0x147097['query']=_['keys'](_0x124c53['query']);_0x147097[_0x8691('0x37')]=_['intersection'](_0x147097[_0x8691('0x39')],_0x147097[_0x8691('0x36')]);_0x1a3f0e[_0x8691('0x3a')]=_['intersection'](_0x147097[_0x8691('0x39')],qs[_0x8691('0x3b')](_0x124c53[_0x8691('0x36')][_0x8691('0x3b')]));_0x1a3f0e['attributes']=_0x1a3f0e[_0x8691('0x3a')]['length']?_0x1a3f0e[_0x8691('0x3a')]:_0x147097['model'];if(_0x124c53[_0x8691('0x36')][_0x8691('0x4a')]){_0x1a3f0e[_0x8691('0x4f')]=[{'all':!![]}];}_0x1a3f0e=_['merge']({},_0x1a3f0e,_0x124c53[_0x8691('0x48')]);return db[_0x8691('0x33')][_0x8691('0x50')](_0x1a3f0e)['then'](handleEntityNotFound(_0x1694cd,null))[_0x8691('0x1d')](respondWithResult(_0x1694cd,null))[_0x8691('0x27')](handleError(_0x1694cd,null));};exports['create']=function(_0x1fe909,_0x17d7d2){return db[_0x8691('0x33')][_0x8691('0x51')](_0x1fe909[_0x8691('0x52')],{})['then'](respondWithResult(_0x17d7d2,0xc9))['catch'](handleError(_0x17d7d2,null));};exports[_0x8691('0x30')]=function(_0x3266c2,_0x3816dd){if(_0x3266c2[_0x8691('0x52')]['id']){delete _0x3266c2[_0x8691('0x52')]['id'];}return db[_0x8691('0x33')][_0x8691('0x50')]({'where':{'id':_0x3266c2[_0x8691('0x4e')]['id']}})[_0x8691('0x1d')](handleEntityNotFound(_0x3816dd,null))['then'](saveUpdates(_0x3266c2[_0x8691('0x52')],null))[_0x8691('0x1d')](respondWithResult(_0x3816dd,null))[_0x8691('0x27')](handleError(_0x3816dd,null));};exports['destroy']=function(_0x353d17,_0x51cd6a){return db['ZohoAccount'][_0x8691('0x50')]({'where':{'id':_0x353d17[_0x8691('0x4e')]['id']}})['then'](handleEntityNotFound(_0x51cd6a,null))[_0x8691('0x1d')](removeEntity(_0x51cd6a,null))[_0x8691('0x27')](handleError(_0x51cd6a,null));};exports[_0x8691('0x53')]=function(_0x565dda,_0x298647,_0x1fd3c1){var _0x361407={};var _0x23d778={};var _0x2f5a2c;var _0x171aad;return db[_0x8691('0x33')][_0x8691('0x54')]({'where':{'id':_0x565dda[_0x8691('0x4e')]['id']}})[_0x8691('0x1d')](handleEntityNotFound(_0x298647,null))[_0x8691('0x1d')](function(_0x35eaaf){if(_0x35eaaf){_0x2f5a2c=_0x35eaaf;_0x23d778['model']=_[_0x8691('0x35')](db[_0x8691('0x55')][_0x8691('0x34')]);_0x23d778[_0x8691('0x36')]=_['keys'](_0x565dda['query']);_0x23d778[_0x8691('0x37')]=_['intersection'](_0x23d778[_0x8691('0x39')],_0x23d778[_0x8691('0x36')]);_0x361407['attributes']=_[_0x8691('0x38')](_0x23d778[_0x8691('0x39')],qs[_0x8691('0x3b')](_0x565dda['query']['fields']));_0x361407[_0x8691('0x3a')]=_0x361407[_0x8691('0x3a')][_0x8691('0x3c')]?_0x361407[_0x8691('0x3a')]:_0x23d778[_0x8691('0x39')];_0x361407[_0x8691('0x3d')]=qs[_0x8691('0x3e')](_0x565dda[_0x8691('0x36')]['sort']);_0x361407[_0x8691('0x3f')]=qs[_0x8691('0x37')](_[_0x8691('0x40')](_0x565dda['query'],_0x23d778[_0x8691('0x37')]));if(_0x565dda[_0x8691('0x36')][_0x8691('0x41')]){_0x361407[_0x8691('0x3f')]=_[_0x8691('0x47')](_0x361407[_0x8691('0x3f')],{'$or':_['map'](_0x361407[_0x8691('0x3a')],function(_0x45f9b2){var _0x59bc6f={};_0x59bc6f[_0x45f9b2]={'$like':'%'+_0x565dda[_0x8691('0x36')]['filter']+'%'};return _0x59bc6f;})});}_0x361407=_[_0x8691('0x47')]({},_0x361407,_0x565dda[_0x8691('0x48')]);return _0x2f5a2c[_0x8691('0x53')](_0x361407);}})[_0x8691('0x1d')](function(_0x3bc4cb){if(_0x3bc4cb){_0x171aad=_0x3bc4cb[_0x8691('0x3c')];if(!_0x565dda[_0x8691('0x36')]['hasOwnProperty'](_0x8691('0x56'))){_0x361407['limit']=qs['limit'](_0x565dda['query'][_0x8691('0x2b')]);_0x361407[_0x8691('0x2a')]=qs[_0x8691('0x2a')](_0x565dda[_0x8691('0x36')][_0x8691('0x2a')]);}return _0x2f5a2c[_0x8691('0x53')](_0x361407);}})[_0x8691('0x1d')](function(_0x5ea08c){if(_0x5ea08c){return _0x5ea08c?{'count':_0x171aad,'rows':_0x5ea08c}:null;}})[_0x8691('0x1d')](respondWithResult(_0x298647,null))['catch'](handleError(_0x298647,null));};exports[_0x8691('0x57')]=function(_0x4eb30c,_0x382977,_0x5a8a3e){if(_0x4eb30c[_0x8691('0x52')]['id']){delete _0x4eb30c[_0x8691('0x52')]['id'];}return db[_0x8691('0x33')][_0x8691('0x54')]({'where':{'id':_0x4eb30c['params']['id']}})[_0x8691('0x1d')](handleEntityNotFound(_0x382977,null))[_0x8691('0x1d')](function(_0x123364){if(_0x123364){_0x4eb30c[_0x8691('0x52')][_0x8691('0x58')]=_0x123364['id'];_0x4eb30c[_0x8691('0x52')][_0x8691('0x59')]=integrations['getSubjects'](_0x4eb30c[_0x8691('0x52')]['channel'],_0x4eb30c[_0x8691('0x52')][_0x8691('0x43')]);_0x4eb30c['body'][_0x8691('0x5a')]=integrations[_0x8691('0x5b')](_0x4eb30c[_0x8691('0x52')]['channel'],_0x4eb30c[_0x8691('0x52')][_0x8691('0x43')]);return db[_0x8691('0x55')][_0x8691('0x51')](_0x4eb30c['body'],{'include':[{'model':db['ZohoField'],'as':_0x8691('0x59')},{'model':db[_0x8691('0x5c')],'as':_0x8691('0x5a')}]});}return null;})[_0x8691('0x1d')](respondWithResult(_0x382977,null))[_0x8691('0x27')](handleError(_0x382977,null));};exports[_0x8691('0x5d')]=function(_0x1dbced,_0x40fbe3,_0x2273bf){return db[_0x8691('0x33')][_0x8691('0x54')]({'where':{'id':_0x1dbced['params']['id']},'attributes':['id',_0x8691('0x5e'),'authToken']})['then'](handleEntityNotFound(_0x40fbe3,null))['then'](function(_0x3bd993){if(_0x3bd993){return rp({'method':_0x8691('0x5f'),'uri':util[_0x8691('0x60')](_0x8691('0x61'),_0x3bd993[_0x8691('0x5e')]),'qs':{'authtoken':_0x3bd993['authToken'],'scope':_0x8691('0x62')},'json':!![]});}})[_0x8691('0x1d')](function(_0x3a27f4){if(_0x3a27f4){if(_0x3a27f4['response']&&_0x3a27f4[_0x8691('0x63')][_0x8691('0x22')]){throw new Error(_0x3a27f4[_0x8691('0x63')]['error'][_0x8691('0x24')]);}var _0x4e32c0=[];if(_0x3a27f4[_0x8691('0x64')]&&_0x3a27f4[_0x8691('0x64')][_0x8691('0x65')]){if(_0x3a27f4[_0x8691('0x64')][_0x8691('0x65')]['FL']){var _0x4ec17e=[_0x8691('0x66')];for(var _0x3d5adb=0x0,_0x4e03e9=_0x3a27f4['Calls'][_0x8691('0x65')]['FL'][_0x8691('0x3c')];_0x3d5adb<_0x4e03e9;_0x3d5adb++){if(_[_0x8691('0x67')](_0x4ec17e,_0x3a27f4[_0x8691('0x64')][_0x8691('0x65')]['FL'][_0x3d5adb]['dv'])){_0x4e32c0[_0x8691('0x68')]({'id':_0x3a27f4[_0x8691('0x64')][_0x8691('0x65')]['FL'][_0x3d5adb]['dv'],'name':_0x3a27f4[_0x8691('0x64')]['section']['FL'][_0x3d5adb][_0x8691('0x69')],'custom':_0x3a27f4[_0x8691('0x64')][_0x8691('0x65')]['FL'][_0x3d5adb]['customfield']==='true'?!![]:![],'options':_0x3a27f4[_0x8691('0x64')][_0x8691('0x65')]['FL'][_0x3d5adb][_0x8691('0x43')]===_0x8691('0x6a')&&_0x3a27f4['Calls']['section']['FL'][_0x3d5adb][_0x8691('0x6b')]?_[_0x8691('0x42')](_0x3a27f4[_0x8691('0x64')]['section']['FL'][_0x3d5adb][_0x8691('0x6b')],function(_0x3d7a90){return{'name':_0x3d7a90,'value':_0x3d7a90};}):[]});}}}}return{'count':_0x4e32c0['length'],'rows':_0x4e32c0};}})['then'](respondWithResult(_0x40fbe3,null))[_0x8691('0x27')](function(_0x13eac1){var _0xad4292=_0x1dbced[_0x8691('0x36')][_0x8691('0x6c')]?0x1f4:_0x13eac1[_0x8691('0x6d')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x8691('0x5d'),_0xad4292,JSON[_0x8691('0x21')](_0x13eac1));delete _0x13eac1[_0x8691('0x6e')];if(_0xad4292===0x191){_0xad4292=0x190;}_0x40fbe3[_0x8691('0x28')](_0xad4292)['send'](_0x1dbced[_0x8691('0x36')]['test']?{'message':_0x8691('0x6f'),'statusCode':_0x13eac1[_0x8691('0x6d')]}:_0x13eac1);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 9f2cf5b..b7556af 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 _0x7ef3=['exports','ZohoAccount','int_zoho_accounts','lodash','util','api','moment','bluebird','request-promise','./intZohoAccount.attributes','../../components/integrations/configuration'];(function(_0x382d7e,_0x16798c){var _0x33c721=function(_0x13d857){while(--_0x13d857){_0x382d7e['push'](_0x382d7e['shift']());}};_0x33c721(++_0x16798c);}(_0x7ef3,0x19a));var _0x37ef=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0x7ef3[_0x54defc];return _0x1955d3;};'use strict';var _=require(_0x37ef('0x0'));var util=require(_0x37ef('0x1'));var logger=require('../../config/logger')(_0x37ef('0x2'));var moment=require(_0x37ef('0x3'));var BPromise=require(_0x37ef('0x4'));var rp=require(_0x37ef('0x5'));var attributes=require(_0x37ef('0x6'));var integrations=require(_0x37ef('0x7'));module[_0x37ef('0x8')]=function(_0x134e23,_0x3f5718){return _0x134e23['define'](_0x37ef('0x9'),attributes,{'tableName':_0x37ef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f28=['exports','int_zoho_accounts','util','api','bluebird','request-promise','../../components/integrations/configuration'];(function(_0x5bfa44,_0x76dacc){var _0x43815f=function(_0x307fca){while(--_0x307fca){_0x5bfa44['push'](_0x5bfa44['shift']());}};_0x43815f(++_0x76dacc);}(_0x6f28,0x72));var _0x86f2=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0x6f28[_0x4d674b];return _0x535a1f;};'use strict';var _=require('lodash');var util=require(_0x86f2('0x0'));var logger=require('../../config/logger')(_0x86f2('0x1'));var moment=require('moment');var BPromise=require(_0x86f2('0x2'));var rp=require(_0x86f2('0x3'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x86f2('0x4'));module[_0x86f2('0x5')]=function(_0x27440c,_0x2ba5c3){return _0x27440c['define']('ZohoAccount',attributes,{'tableName':_0x86f2('0x6'),'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 f0c51b9..dc9b696 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 _0x7348=['ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetZohoAccount','options','raw','where','include','map','model','attributes','then','ShowZohoAccount','ZohoAccount','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x2a0aaa,_0x35db19){var _0x1db051=function(_0x5bcfab){while(--_0x5bcfab){_0x2a0aaa['push'](_0x2a0aaa['shift']());}};_0x1db051(++_0x35db19);}(_0x7348,0x16b));var _0x8734=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7348[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x8734('0x0'));var moment=require(_0x8734('0x1'));var BPromise=require('bluebird');var rs=require(_0x8734('0x2'));var fs=require('fs');var Redis=require(_0x8734('0x3'));var db=require(_0x8734('0x4'))['db'];var utils=require(_0x8734('0x5'));var logger=require(_0x8734('0x6'))('rpc');var config=require(_0x8734('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8734('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11505f,_0x3dbaf1,_0x409987){return new BPromise(function(_0x4b55fc,_0x282efb){return client['request'](_0x11505f,_0x409987)['then'](function(_0xb06875){logger['info'](_0x8734('0x9'),_0x3dbaf1,'request\x20sent');logger[_0x8734('0xa')](_0x8734('0xb'),_0x3dbaf1,_0x8734('0xc'),JSON[_0x8734('0xd')](_0xb06875));if(_0xb06875['error']){if(_0xb06875[_0x8734('0xe')][_0x8734('0xf')]===0x1f4){logger[_0x8734('0xe')](_0x8734('0x9'),_0x3dbaf1,_0xb06875[_0x8734('0xe')][_0x8734('0x10')]);return _0x282efb(_0xb06875[_0x8734('0xe')]['message']);}logger[_0x8734('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x3dbaf1,_0xb06875['error']['message']);return _0x4b55fc(_0xb06875[_0x8734('0xe')][_0x8734('0x10')]);}else{logger[_0x8734('0x11')](_0x8734('0x9'),_0x3dbaf1,_0x8734('0xc'));_0x4b55fc(_0xb06875['result'][_0x8734('0x10')]);}})[_0x8734('0x12')](function(_0x5b1663){logger[_0x8734('0xe')](_0x8734('0x9'),_0x3dbaf1,_0x5b1663);_0x282efb(_0x5b1663);});});}exports[_0x8734('0x13')]=function(_0x92addd){var _0x39da0c=this;return new Promise(function(_0x467ece,_0x25f144){return db['ZohoAccount']['findAll']({'raw':_0x92addd[_0x8734('0x14')]?_0x92addd[_0x8734('0x14')][_0x8734('0x15')]===undefined?!![]:![]:!![],'where':_0x92addd[_0x8734('0x14')]?_0x92addd[_0x8734('0x14')][_0x8734('0x16')]||null:null,'attributes':_0x92addd['options']?_0x92addd['options']['attributes']||null:null,'limit':_0x92addd[_0x8734('0x14')]?_0x92addd[_0x8734('0x14')]['limit']||null:null,'include':_0x92addd[_0x8734('0x14')]?_0x92addd[_0x8734('0x14')][_0x8734('0x17')]?_[_0x8734('0x18')](_0x92addd['options'][_0x8734('0x17')],function(_0x4a022e){return{'model':db[_0x4a022e[_0x8734('0x19')]],'as':_0x4a022e['as'],'attributes':_0x4a022e[_0x8734('0x1a')],'include':_0x4a022e[_0x8734('0x17')]?_[_0x8734('0x18')](_0x4a022e[_0x8734('0x17')],function(_0x23b59e){return{'model':db[_0x23b59e[_0x8734('0x19')]],'as':_0x23b59e['as'],'attributes':_0x23b59e[_0x8734('0x1a')],'include':_0x23b59e['include']?_[_0x8734('0x18')](_0x23b59e[_0x8734('0x17')],function(_0x3e7bcf){return{'model':db[_0x3e7bcf[_0x8734('0x19')]],'as':_0x3e7bcf['as'],'attributes':_0x3e7bcf[_0x8734('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8734('0x1b')](function(_0xa831f3){logger[_0x8734('0x11')]('GetZohoAccount',_0x92addd);logger[_0x8734('0xa')](_0x8734('0x13'),_0x92addd,JSON[_0x8734('0xd')](_0xa831f3));_0x467ece(_0xa831f3);})[_0x8734('0x12')](function(_0x2c439d){logger[_0x8734('0xe')]('GetZohoAccount',_0x2c439d[_0x8734('0x10')],_0x92addd);_0x25f144(_0x39da0c[_0x8734('0xe')](0x1f4,_0x2c439d['message']));});});};exports[_0x8734('0x1c')]=function(_0x4fd0dc){var _0x3be5da=this;return new Promise(function(_0x1e0674,_0x70175c){return db[_0x8734('0x1d')][_0x8734('0x1e')]({'raw':_0x4fd0dc[_0x8734('0x14')]?_0x4fd0dc[_0x8734('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x4fd0dc[_0x8734('0x14')]?_0x4fd0dc[_0x8734('0x14')][_0x8734('0x16')]||null:null,'attributes':_0x4fd0dc['options']?_0x4fd0dc[_0x8734('0x14')][_0x8734('0x1a')]||null:null,'include':_0x4fd0dc[_0x8734('0x14')]?_0x4fd0dc[_0x8734('0x14')][_0x8734('0x17')]?_[_0x8734('0x18')](_0x4fd0dc[_0x8734('0x14')]['include'],function(_0x4edfc2){return{'model':db[_0x4edfc2['model']],'as':_0x4edfc2['as'],'attributes':_0x4edfc2[_0x8734('0x1a')],'include':_0x4edfc2[_0x8734('0x17')]?_[_0x8734('0x18')](_0x4edfc2[_0x8734('0x17')],function(_0x5f2149){return{'model':db[_0x5f2149[_0x8734('0x19')]],'as':_0x5f2149['as'],'attributes':_0x5f2149[_0x8734('0x1a')],'include':_0x5f2149[_0x8734('0x17')]?_[_0x8734('0x18')](_0x5f2149[_0x8734('0x17')],function(_0x1bcdb4){return{'model':db[_0x1bcdb4['model']],'as':_0x1bcdb4['as'],'attributes':_0x1bcdb4[_0x8734('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c9520){logger['info'](_0x8734('0x1c'),_0x4fd0dc);logger[_0x8734('0xa')](_0x8734('0x1c'),_0x4fd0dc,JSON[_0x8734('0xd')](_0x4c9520));_0x1e0674(_0x4c9520);})[_0x8734('0x12')](function(_0x4e6740){logger[_0x8734('0xe')](_0x8734('0x1c'),_0x4e6740['message'],_0x4fd0dc);_0x70175c(_0x3be5da[_0x8734('0xe')](0x1f4,_0x4e6740['message']));});});}; \ No newline at end of file +var _0xbfe0=['error','code','message','result','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','catch','find','ShowZohoAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xbfe0,0x1ed));var _0x0bfe=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xbfe0[_0x42f009];return _0x22a1e0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0bfe('0x0'));var BPromise=require(_0x0bfe('0x1'));var rs=require(_0x0bfe('0x2'));var fs=require('fs');var Redis=require(_0x0bfe('0x3'));var db=require(_0x0bfe('0x4'))['db'];var utils=require(_0x0bfe('0x5'));var logger=require(_0x0bfe('0x6'))(_0x0bfe('0x7'));var config=require(_0x0bfe('0x8'));var jayson=require(_0x0bfe('0x9'));var client=jayson['client'][_0x0bfe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x213935,_0x812d73,_0x366459){return new BPromise(function(_0x361780,_0x4f3227){return client['request'](_0x213935,_0x366459)[_0x0bfe('0xb')](function(_0x5d986e){logger[_0x0bfe('0xc')](_0x0bfe('0xd'),_0x812d73,_0x0bfe('0xe'));logger[_0x0bfe('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x812d73,_0x0bfe('0xe'),JSON[_0x0bfe('0x10')](_0x5d986e));if(_0x5d986e[_0x0bfe('0x11')]){if(_0x5d986e['error'][_0x0bfe('0x12')]===0x1f4){logger[_0x0bfe('0x11')](_0x0bfe('0xd'),_0x812d73,_0x5d986e[_0x0bfe('0x11')][_0x0bfe('0x13')]);return _0x4f3227(_0x5d986e[_0x0bfe('0x11')][_0x0bfe('0x13')]);}logger[_0x0bfe('0x11')](_0x0bfe('0xd'),_0x812d73,_0x5d986e['error'][_0x0bfe('0x13')]);return _0x361780(_0x5d986e[_0x0bfe('0x11')][_0x0bfe('0x13')]);}else{logger[_0x0bfe('0xc')](_0x0bfe('0xd'),_0x812d73,_0x0bfe('0xe'));_0x361780(_0x5d986e[_0x0bfe('0x14')][_0x0bfe('0x13')]);}})['catch'](function(_0x33b12a){logger[_0x0bfe('0x11')](_0x0bfe('0xd'),_0x812d73,_0x33b12a);_0x4f3227(_0x33b12a);});});}exports[_0x0bfe('0x15')]=function(_0x4db956){var _0x24b6d5=this;return new Promise(function(_0x1c9c6c,_0x13dcf2){return db[_0x0bfe('0x16')][_0x0bfe('0x17')]({'raw':_0x4db956[_0x0bfe('0x18')]?_0x4db956[_0x0bfe('0x18')][_0x0bfe('0x19')]===undefined?!![]:![]:!![],'where':_0x4db956[_0x0bfe('0x18')]?_0x4db956[_0x0bfe('0x18')][_0x0bfe('0x1a')]||null:null,'attributes':_0x4db956['options']?_0x4db956[_0x0bfe('0x18')][_0x0bfe('0x1b')]||null:null,'limit':_0x4db956[_0x0bfe('0x18')]?_0x4db956[_0x0bfe('0x18')]['limit']||null:null,'include':_0x4db956[_0x0bfe('0x18')]?_0x4db956[_0x0bfe('0x18')][_0x0bfe('0x1c')]?_[_0x0bfe('0x1d')](_0x4db956[_0x0bfe('0x18')]['include'],function(_0x18d7da){return{'model':db[_0x18d7da[_0x0bfe('0x1e')]],'as':_0x18d7da['as'],'attributes':_0x18d7da[_0x0bfe('0x1b')],'include':_0x18d7da['include']?_[_0x0bfe('0x1d')](_0x18d7da[_0x0bfe('0x1c')],function(_0x4aabbe){return{'model':db[_0x4aabbe[_0x0bfe('0x1e')]],'as':_0x4aabbe['as'],'attributes':_0x4aabbe[_0x0bfe('0x1b')],'include':_0x4aabbe[_0x0bfe('0x1c')]?_[_0x0bfe('0x1d')](_0x4aabbe[_0x0bfe('0x1c')],function(_0x2010fe){return{'model':db[_0x2010fe[_0x0bfe('0x1e')]],'as':_0x2010fe['as'],'attributes':_0x2010fe['attributes']};}):[]};}):[]};}):[]:[]})[_0x0bfe('0xb')](function(_0x4f9196){logger[_0x0bfe('0xc')]('GetZohoAccount',_0x4db956);logger['debug'](_0x0bfe('0x15'),_0x4db956,JSON[_0x0bfe('0x10')](_0x4f9196));_0x1c9c6c(_0x4f9196);})[_0x0bfe('0x1f')](function(_0x59aee8){logger[_0x0bfe('0x11')](_0x0bfe('0x15'),_0x59aee8[_0x0bfe('0x13')],_0x4db956);_0x13dcf2(_0x24b6d5[_0x0bfe('0x11')](0x1f4,_0x59aee8[_0x0bfe('0x13')]));});});};exports['ShowZohoAccount']=function(_0x1da3a7){var _0x253045=this;return new Promise(function(_0x51c6da,_0x48fd6b){return db['ZohoAccount'][_0x0bfe('0x20')]({'raw':_0x1da3a7[_0x0bfe('0x18')]?_0x1da3a7[_0x0bfe('0x18')][_0x0bfe('0x19')]===undefined?!![]:![]:!![],'where':_0x1da3a7['options']?_0x1da3a7[_0x0bfe('0x18')][_0x0bfe('0x1a')]||null:null,'attributes':_0x1da3a7['options']?_0x1da3a7[_0x0bfe('0x18')][_0x0bfe('0x1b')]||null:null,'include':_0x1da3a7['options']?_0x1da3a7[_0x0bfe('0x18')]['include']?_[_0x0bfe('0x1d')](_0x1da3a7[_0x0bfe('0x18')]['include'],function(_0x56ffb4){return{'model':db[_0x56ffb4[_0x0bfe('0x1e')]],'as':_0x56ffb4['as'],'attributes':_0x56ffb4[_0x0bfe('0x1b')],'include':_0x56ffb4[_0x0bfe('0x1c')]?_[_0x0bfe('0x1d')](_0x56ffb4[_0x0bfe('0x1c')],function(_0x1d5f9a){return{'model':db[_0x1d5f9a[_0x0bfe('0x1e')]],'as':_0x1d5f9a['as'],'attributes':_0x1d5f9a[_0x0bfe('0x1b')],'include':_0x1d5f9a[_0x0bfe('0x1c')]?_[_0x0bfe('0x1d')](_0x1d5f9a[_0x0bfe('0x1c')],function(_0x4922c3){return{'model':db[_0x4922c3[_0x0bfe('0x1e')]],'as':_0x4922c3['as'],'attributes':_0x4922c3['attributes']};}):[]};}):[]};}):[]:[]})[_0x0bfe('0xb')](function(_0x19fbe9){logger[_0x0bfe('0xc')](_0x0bfe('0x21'),_0x1da3a7);logger[_0x0bfe('0xf')](_0x0bfe('0x21'),_0x1da3a7,JSON[_0x0bfe('0x10')](_0x19fbe9));_0x51c6da(_0x19fbe9);})[_0x0bfe('0x1f')](function(_0x30bf07){logger[_0x0bfe('0x11')](_0x0bfe('0x21'),_0x30bf07[_0x0bfe('0x13')],_0x1da3a7);_0x48fd6b(_0x253045[_0x0bfe('0x11')](0x1f4,_0x30bf07['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index c372674..3c6f4e6 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 _0x3b59=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','destroy','exports'];(function(_0x12e8d6,_0x5dd585){var _0x2a720b=function(_0x310db9){while(--_0x310db9){_0x12e8d6['push'](_0x12e8d6['shift']());}};_0x2a720b(++_0x5dd585);}(_0x3b59,0xc0));var _0x93b5=function(_0x3c053d,_0x2bec05){_0x3c053d=_0x3c053d-0x0;var _0x102283=_0x3b59[_0x3c053d];return _0x102283;};'use strict';var multer=require(_0x93b5('0x0'));var util=require('util');var path=require(_0x93b5('0x1'));var timeout=require(_0x93b5('0x2'));var express=require(_0x93b5('0x3'));var router=express[_0x93b5('0x4')]();var auth=require(_0x93b5('0x5'));var interaction=require(_0x93b5('0x6'));var config=require(_0x93b5('0x7'));var controller=require(_0x93b5('0x8'));router[_0x93b5('0x9')]('/',auth['isAuthenticated'](),controller[_0x93b5('0xa')]);router['get'](_0x93b5('0xb'),auth[_0x93b5('0xc')](),controller[_0x93b5('0xd')]);router[_0x93b5('0x9')](_0x93b5('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x93b5('0x9')](_0x93b5('0xf'),auth[_0x93b5('0xc')](),controller[_0x93b5('0x10')]);router[_0x93b5('0x9')](_0x93b5('0x11'),auth[_0x93b5('0xc')](),controller[_0x93b5('0x12')]);router[_0x93b5('0x13')]('/',auth['isAuthenticated'](),controller[_0x93b5('0x14')]);router[_0x93b5('0x15')]('/:id',auth[_0x93b5('0xc')](),controller['update']);router['delete'](_0x93b5('0xb'),auth[_0x93b5('0xc')](),controller[_0x93b5('0x16')]);module[_0x93b5('0x17')]=router; \ No newline at end of file +var _0x8c1a=['isAuthenticated','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x1cf748,_0x4160a2){var _0x45c034=function(_0x49cd11){while(--_0x49cd11){_0x1cf748['push'](_0x1cf748['shift']());}};_0x45c034(++_0x4160a2);}(_0x8c1a,0x1ad));var _0xa8c1=function(_0x208749,_0x2b7b66){_0x208749=_0x208749-0x0;var _0x3e0042=_0x8c1a[_0x208749];return _0x3e0042;};'use strict';var multer=require(_0xa8c1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa8c1('0x1'));var express=require(_0xa8c1('0x2'));var router=express[_0xa8c1('0x3')]();var auth=require(_0xa8c1('0x4'));var interaction=require(_0xa8c1('0x5'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0xa8c1('0x6')]('/',auth['isAuthenticated'](),controller[_0xa8c1('0x7')]);router[_0xa8c1('0x6')]('/:id',auth[_0xa8c1('0x8')](),controller[_0xa8c1('0x9')]);router[_0xa8c1('0x6')](_0xa8c1('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0xa8c1('0x6')](_0xa8c1('0xb'),auth[_0xa8c1('0x8')](),controller['getSubjects']);router['get'](_0xa8c1('0xc'),auth[_0xa8c1('0x8')](),controller[_0xa8c1('0xd')]);router[_0xa8c1('0xe')]('/',auth[_0xa8c1('0x8')](),controller[_0xa8c1('0xf')]);router['put']('/:id',auth[_0xa8c1('0x8')](),controller[_0xa8c1('0x10')]);router[_0xa8c1('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa8c1('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 4bcefb0..17c6ee4 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 _0x1b77=['sequelize','STRING'];(function(_0x66133d,_0x3cb3ea){var _0x3af9b9=function(_0x54cea3){while(--_0x54cea3){_0x66133d['push'](_0x66133d['shift']());}};_0x3af9b9(++_0x3cb3ea);}(_0x1b77,0x88));var _0x71b7=function(_0x537684,_0x93f906){_0x537684=_0x537684-0x0;var _0x1e4533=_0x1b77[_0x537684];return _0x1e4533;};'use strict';var Sequelize=require(_0x71b7('0x0'));module['exports']={'name':{'type':Sequelize[_0x71b7('0x1')]},'description':{'type':Sequelize[_0x71b7('0x1')]}}; \ No newline at end of file +var _0xa7da=['STRING'];(function(_0x2c4c8,_0x78e5c9){var _0x592a8c=function(_0x2b2b67){while(--_0x2b2b67){_0x2c4c8['push'](_0x2c4c8['shift']());}};_0x592a8c(++_0x78e5c9);}(_0xa7da,0x120));var _0xaa7d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa7da[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xaa7d('0x0')]},'description':{'type':Sequelize[_0xaa7d('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 5cddbba..dd65217 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 _0xef6d=['moment','bluebird','util','to-csv','ejs','squel','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','client','http','request','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','destroy','name','send','index','ZohoConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','where','pick','filter','type','key','field','merge','options','count','includeAll','findAll','rows','params','include','create','body','find','ZohoField','order','sort','map','getFields','hasOwnProperty','nolimit','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3a3562,_0x5ddf4e){var _0x45a8d8=function(_0x3f773e){while(--_0x3f773e){_0x3a3562['push'](_0x3a3562['shift']());}};_0x45a8d8(++_0x5ddf4e);}(_0xef6d,0xf8));var _0xdef6=function(_0x56ec5d,_0x449610){_0x56ec5d=_0x56ec5d-0x0;var _0x2f197c=_0xef6d[_0x56ec5d];return _0x2f197c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xdef6('0x0'));var zipdir=require(_0xdef6('0x1'));var jsonpatch=require(_0xdef6('0x2'));var rp=require(_0xdef6('0x3'));var moment=require(_0xdef6('0x4'));var BPromise=require(_0xdef6('0x5'));var Mustache=require('mustache');var util=require(_0xdef6('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xdef6('0x7'));var ejs=require(_0xdef6('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdef6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdef6('0x7'));var querystring=require(_0xdef6('0xa'));var Papa=require(_0xdef6('0xb'));var authService=require('../../components/auth/service');var hardwareService=require(_0xdef6('0xc'));var Redis=require(_0xdef6('0xd'));var qs=require(_0xdef6('0xe'));var logger=require(_0xdef6('0xf'))('api');var utils=require(_0xdef6('0x10'));var config=require(_0xdef6('0x11'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xdef6('0x12')][_0xdef6('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x2aa66d,_0x483879,_0x23805a,_0x5eb39){return new BPromise(function(_0x50bca3,_0x3c9f60){var _0x3ffbb0=_0x5eb39||client;return _0x3ffbb0[_0xdef6('0x14')](_0x2aa66d,_0x23805a)[_0xdef6('0x15')](function(_0x15629e){logger[_0xdef6('0x16')]('ZohoConfiguration,\x20%s,\x20%s',_0x483879,'request\x20sent');logger[_0xdef6('0x17')](_0xdef6('0x18'),_0x483879,_0xdef6('0x19'),JSON[_0xdef6('0x1a')](_0x15629e));if(_0x15629e[_0xdef6('0x1b')]){if(_0x15629e['error']['code']===0x1f4){logger[_0xdef6('0x1b')](_0xdef6('0x1c'),_0x483879,_0x15629e[_0xdef6('0x1b')][_0xdef6('0x1d')]);return _0x3c9f60(_0x15629e[_0xdef6('0x1b')][_0xdef6('0x1d')]);}logger[_0xdef6('0x1b')](_0xdef6('0x1c'),_0x483879,_0x15629e[_0xdef6('0x1b')][_0xdef6('0x1d')]);return _0x50bca3(_0x15629e[_0xdef6('0x1b')][_0xdef6('0x1d')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x483879,_0xdef6('0x19'));_0x50bca3(_0x15629e[_0xdef6('0x1e')]['message']);}})[_0xdef6('0x1f')](function(_0x21095f){logger[_0xdef6('0x1b')]('ZohoConfiguration,\x20%s,\x20%s',_0x483879,_0x21095f);_0x3c9f60(_0x21095f);});});}function respondWithStatusCode(_0x5b1858,_0x35778a){_0x35778a=_0x35778a||0xcc;return function(_0x356b6c){if(_0x356b6c){return _0x5b1858[_0xdef6('0x20')](_0x35778a);}return _0x5b1858[_0xdef6('0x21')](_0x35778a)[_0xdef6('0x22')]();};}function respondWithResult(_0x427149,_0x3a0f9e){_0x3a0f9e=_0x3a0f9e||0xc8;return function(_0x5911a4){if(_0x5911a4){return _0x427149[_0xdef6('0x21')](_0x3a0f9e)[_0xdef6('0x23')](_0x5911a4);}};}function respondWithFilteredResult(_0x275ccc,_0x18e676){return function(_0x5d595b){if(_0x5d595b){var _0x5540b9=_0x5d595b['count'],_0x1f65b4=_0x18e676[_0xdef6('0x24')],_0x295986=_0x18e676[_0xdef6('0x24')]+_0x18e676[_0xdef6('0x25')],_0x247793;if(_0x295986>=_0x5540b9){_0x295986=_0x5540b9;_0x247793=0xc8;}else{_0x247793=0xce;}_0x275ccc[_0xdef6('0x21')](_0x247793);return _0x275ccc[_0xdef6('0x26')]('Content-Range',_0x1f65b4+'-'+_0x295986+'/'+_0x5540b9)[_0xdef6('0x23')](_0x5d595b);}return null;};}function patchUpdates(_0x425c85){return function(_0x54585c){try{jsonpatch[_0xdef6('0x27')](_0x54585c,_0x425c85,!![]);}catch(_0xf57277){return BPromise[_0xdef6('0x28')](_0xf57277);}return _0x54585c[_0xdef6('0x29')]();};}function saveUpdates(_0x1fc420,_0x8a3c0){return function(_0x13d27e){if(_0x13d27e){return _0x13d27e[_0xdef6('0x2a')](_0x1fc420)[_0xdef6('0x15')](function(_0x36b1f4){return _0x36b1f4;});}return null;};}function removeEntity(_0x381e0c,_0x40640d){return function(_0x15632f){if(_0x15632f){return _0x15632f[_0xdef6('0x2b')]()[_0xdef6('0x15')](function(){_0x381e0c[_0xdef6('0x21')](0xcc)[_0xdef6('0x22')]();});}};}function handleEntityNotFound(_0xe471df,_0x1bf710){return function(_0x4e7d69){if(!_0x4e7d69){_0xe471df['sendStatus'](0x194);}return _0x4e7d69;};}function handleError(_0x12f125,_0x443560){_0x443560=_0x443560||0x1f4;return function(_0x18a0b8){logger[_0xdef6('0x1b')](_0x18a0b8['stack']);if(_0x18a0b8[_0xdef6('0x2c')]){delete _0x18a0b8[_0xdef6('0x2c')];}_0x12f125[_0xdef6('0x21')](_0x443560)[_0xdef6('0x2d')](_0x18a0b8);};}exports[_0xdef6('0x2e')]=function(_0x15d0ec,_0x4f2d3f){var _0xf8ac46={},_0x3bac31={},_0x1aa21c={'count':0x0,'rows':[]};var _0x3b87cd=db[_0xdef6('0x2f')][_0xdef6('0x30')];_0x3bac31[_0xdef6('0x31')]=_[_0xdef6('0x32')](_0x3b87cd);_0x3bac31[_0xdef6('0x33')]=_[_0xdef6('0x32')](_0x15d0ec['query']);_0x3bac31[_0xdef6('0x34')]=_[_0xdef6('0x35')](_0x3bac31['model'],_0x3bac31['query']);_0xf8ac46[_0xdef6('0x36')]=_[_0xdef6('0x35')](_0x3bac31[_0xdef6('0x31')],qs['fields'](_0x15d0ec['query'][_0xdef6('0x37')]));_0xf8ac46[_0xdef6('0x36')]=_0xf8ac46[_0xdef6('0x36')][_0xdef6('0x38')]?_0xf8ac46[_0xdef6('0x36')]:_0x3bac31['model'];if(!_0x15d0ec[_0xdef6('0x33')]['hasOwnProperty']('nolimit')){_0xf8ac46['limit']=qs[_0xdef6('0x25')](_0x15d0ec[_0xdef6('0x33')][_0xdef6('0x25')]);_0xf8ac46[_0xdef6('0x24')]=qs[_0xdef6('0x24')](_0x15d0ec['query']['offset']);}_0xf8ac46['order']=qs['sort'](_0x15d0ec[_0xdef6('0x33')]['sort']);_0xf8ac46[_0xdef6('0x39')]=qs[_0xdef6('0x34')](_[_0xdef6('0x3a')](_0x15d0ec[_0xdef6('0x33')],_0x3bac31[_0xdef6('0x34')]));if(_0x15d0ec[_0xdef6('0x33')][_0xdef6('0x3b')]){_0xf8ac46[_0xdef6('0x39')]=_['merge'](_0xf8ac46[_0xdef6('0x39')],{'$or':_['map'](_0x3b87cd,function(_0x143023){if(_0x143023[_0xdef6('0x3c')][_0xdef6('0x3d')]!=='VIRTUAL'){var _0x1437c6={};_0x1437c6[_0x143023[_0xdef6('0x3e')]]={'$like':'%'+_0x15d0ec[_0xdef6('0x33')][_0xdef6('0x3b')]+'%'};return _0x1437c6;}})});}_0xf8ac46=_[_0xdef6('0x3f')]({},_0xf8ac46,_0x15d0ec[_0xdef6('0x40')]);var _0x5a1781={'where':_0xf8ac46['where']};return db[_0xdef6('0x2f')][_0xdef6('0x41')](_0x5a1781)[_0xdef6('0x15')](function(_0x2d79b7){_0x1aa21c[_0xdef6('0x41')]=_0x2d79b7;if(_0x15d0ec[_0xdef6('0x33')][_0xdef6('0x42')]){_0xf8ac46['include']=[{'all':!![]}];}return db[_0xdef6('0x2f')][_0xdef6('0x43')](_0xf8ac46);})[_0xdef6('0x15')](function(_0x21a489){_0x1aa21c[_0xdef6('0x44')]=_0x21a489;return _0x1aa21c;})[_0xdef6('0x15')](respondWithFilteredResult(_0x4f2d3f,_0xf8ac46))[_0xdef6('0x1f')](handleError(_0x4f2d3f,null));};exports['show']=function(_0xcdf63d,_0x1c2d92){var _0x422a38={'raw':![],'where':{'id':_0xcdf63d[_0xdef6('0x45')]['id']}},_0xc47607={};_0xc47607['model']=_[_0xdef6('0x32')](db[_0xdef6('0x2f')][_0xdef6('0x30')]);_0xc47607[_0xdef6('0x33')]=_['keys'](_0xcdf63d[_0xdef6('0x33')]);_0xc47607[_0xdef6('0x34')]=_[_0xdef6('0x35')](_0xc47607[_0xdef6('0x31')],_0xc47607[_0xdef6('0x33')]);_0x422a38['attributes']=_['intersection'](_0xc47607['model'],qs[_0xdef6('0x37')](_0xcdf63d['query'][_0xdef6('0x37')]));_0x422a38[_0xdef6('0x36')]=_0x422a38['attributes'][_0xdef6('0x38')]?_0x422a38['attributes']:_0xc47607[_0xdef6('0x31')];if(_0xcdf63d[_0xdef6('0x33')]['includeAll']){_0x422a38[_0xdef6('0x46')]=[{'all':!![]}];}_0x422a38=_['merge']({},_0x422a38,_0xcdf63d['options']);return db[_0xdef6('0x2f')]['find'](_0x422a38)['then'](handleEntityNotFound(_0x1c2d92,null))[_0xdef6('0x15')](respondWithResult(_0x1c2d92,null))['catch'](handleError(_0x1c2d92,null));};exports['create']=function(_0x53e247,_0x1c8e14){return db[_0xdef6('0x2f')][_0xdef6('0x47')](_0x53e247[_0xdef6('0x48')],{})[_0xdef6('0x15')](respondWithResult(_0x1c8e14,0xc9))[_0xdef6('0x1f')](handleError(_0x1c8e14,null));};exports[_0xdef6('0x2a')]=function(_0x5c1aa9,_0x13e518){if(_0x5c1aa9[_0xdef6('0x48')]['id']){delete _0x5c1aa9[_0xdef6('0x48')]['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x5c1aa9[_0xdef6('0x45')]['id']}})[_0xdef6('0x15')](handleEntityNotFound(_0x13e518,null))[_0xdef6('0x15')](saveUpdates(_0x5c1aa9[_0xdef6('0x48')],null))['then'](respondWithResult(_0x13e518,null))[_0xdef6('0x1f')](handleError(_0x13e518,null));};exports[_0xdef6('0x2b')]=function(_0x495bc7,_0x1458dd){return db[_0xdef6('0x2f')][_0xdef6('0x49')]({'where':{'id':_0x495bc7[_0xdef6('0x45')]['id']}})[_0xdef6('0x15')](handleEntityNotFound(_0x1458dd,null))[_0xdef6('0x15')](removeEntity(_0x1458dd,null))[_0xdef6('0x1f')](handleError(_0x1458dd,null));};exports['getFields']=function(_0xefb18d,_0x50f991,_0x579db1){var _0x3682fe={};var _0x48e3b8={};var _0x2f02aa;var _0x4306d6;return db['ZohoConfiguration']['findOne']({'where':{'id':_0xefb18d[_0xdef6('0x45')]['id']}})[_0xdef6('0x15')](handleEntityNotFound(_0x50f991,null))[_0xdef6('0x15')](function(_0x1ecc36){if(_0x1ecc36){_0x2f02aa=_0x1ecc36;_0x48e3b8[_0xdef6('0x31')]=_[_0xdef6('0x32')](db[_0xdef6('0x4a')][_0xdef6('0x30')]);_0x48e3b8[_0xdef6('0x33')]=_[_0xdef6('0x32')](_0xefb18d['query']);_0x48e3b8[_0xdef6('0x34')]=_['intersection'](_0x48e3b8[_0xdef6('0x31')],_0x48e3b8[_0xdef6('0x33')]);_0x3682fe[_0xdef6('0x36')]=_['intersection'](_0x48e3b8[_0xdef6('0x31')],qs[_0xdef6('0x37')](_0xefb18d[_0xdef6('0x33')][_0xdef6('0x37')]));_0x3682fe[_0xdef6('0x36')]=_0x3682fe[_0xdef6('0x36')][_0xdef6('0x38')]?_0x3682fe['attributes']:_0x48e3b8[_0xdef6('0x31')];_0x3682fe[_0xdef6('0x4b')]=qs[_0xdef6('0x4c')](_0xefb18d[_0xdef6('0x33')]['sort']);_0x3682fe[_0xdef6('0x39')]=qs['filters'](_['pick'](_0xefb18d['query'],_0x48e3b8[_0xdef6('0x34')]));if(_0xefb18d[_0xdef6('0x33')][_0xdef6('0x3b')]){_0x3682fe[_0xdef6('0x39')]=_[_0xdef6('0x3f')](_0x3682fe[_0xdef6('0x39')],{'$or':_[_0xdef6('0x4d')](_0x3682fe[_0xdef6('0x36')],function(_0x11912c){var _0x530620={};_0x530620[_0x11912c]={'$like':'%'+_0xefb18d[_0xdef6('0x33')]['filter']+'%'};return _0x530620;})});}_0x3682fe=_[_0xdef6('0x3f')]({},_0x3682fe,_0xefb18d[_0xdef6('0x40')]);return _0x2f02aa[_0xdef6('0x4e')](_0x3682fe);}})['then'](function(_0xde8cc){if(_0xde8cc){_0x4306d6=_0xde8cc['length'];if(!_0xefb18d[_0xdef6('0x33')][_0xdef6('0x4f')](_0xdef6('0x50'))){_0x3682fe[_0xdef6('0x25')]=qs[_0xdef6('0x25')](_0xefb18d[_0xdef6('0x33')][_0xdef6('0x25')]);_0x3682fe['offset']=qs[_0xdef6('0x24')](_0xefb18d['query']['offset']);}return _0x2f02aa['getFields'](_0x3682fe);}})['then'](function(_0x3107d9){if(_0x3107d9){return _0x3107d9?{'count':_0x4306d6,'rows':_0x3107d9}:null;}})[_0xdef6('0x15')](respondWithResult(_0x50f991,null))['catch'](handleError(_0x50f991,null));};exports[_0xdef6('0x51')]=function(_0x4dd299,_0x7041ff,_0x2886ab){var _0x4a138a={};var _0x197460={};var _0x387424;var _0x3095c9;return db[_0xdef6('0x2f')][_0xdef6('0x52')]({'where':{'id':_0x4dd299['params']['id']}})['then'](handleEntityNotFound(_0x7041ff,null))[_0xdef6('0x15')](function(_0x381aa8){if(_0x381aa8){_0x387424=_0x381aa8;_0x197460['model']=_[_0xdef6('0x32')](db[_0xdef6('0x4a')][_0xdef6('0x30')]);_0x197460[_0xdef6('0x33')]=_[_0xdef6('0x32')](_0x4dd299[_0xdef6('0x33')]);_0x197460[_0xdef6('0x34')]=_[_0xdef6('0x35')](_0x197460['model'],_0x197460['query']);_0x4a138a['attributes']=_[_0xdef6('0x35')](_0x197460['model'],qs[_0xdef6('0x37')](_0x4dd299[_0xdef6('0x33')]['fields']));_0x4a138a[_0xdef6('0x36')]=_0x4a138a['attributes'][_0xdef6('0x38')]?_0x4a138a[_0xdef6('0x36')]:_0x197460['model'];_0x4a138a[_0xdef6('0x4b')]=qs[_0xdef6('0x4c')](_0x4dd299[_0xdef6('0x33')][_0xdef6('0x4c')]);_0x4a138a[_0xdef6('0x39')]=qs[_0xdef6('0x34')](_[_0xdef6('0x3a')](_0x4dd299['query'],_0x197460[_0xdef6('0x34')]));if(_0x4dd299[_0xdef6('0x33')][_0xdef6('0x3b')]){_0x4a138a[_0xdef6('0x39')]=_[_0xdef6('0x3f')](_0x4a138a[_0xdef6('0x39')],{'$or':_[_0xdef6('0x4d')](_0x4a138a['attributes'],function(_0x110f46){var _0x49e0ad={};_0x49e0ad[_0x110f46]={'$like':'%'+_0x4dd299['query'][_0xdef6('0x3b')]+'%'};return _0x49e0ad;})});}_0x4a138a=_[_0xdef6('0x3f')]({},_0x4a138a,_0x4dd299['options']);return _0x387424[_0xdef6('0x51')](_0x4a138a);}})['then'](function(_0x2556cc){if(_0x2556cc){_0x3095c9=_0x2556cc[_0xdef6('0x38')];if(!_0x4dd299[_0xdef6('0x33')][_0xdef6('0x4f')](_0xdef6('0x50'))){_0x4a138a['limit']=qs[_0xdef6('0x25')](_0x4dd299[_0xdef6('0x33')]['limit']);_0x4a138a[_0xdef6('0x24')]=qs[_0xdef6('0x24')](_0x4dd299[_0xdef6('0x33')][_0xdef6('0x24')]);}return _0x387424[_0xdef6('0x51')](_0x4a138a);}})['then'](function(_0x5cb081){if(_0x5cb081){return _0x5cb081?{'count':_0x3095c9,'rows':_0x5cb081}:null;}})[_0xdef6('0x15')](respondWithResult(_0x7041ff,null))[_0xdef6('0x1f')](handleError(_0x7041ff,null));};exports['getDescriptions']=function(_0x4b8b0f,_0x238418,_0xa30405){var _0x13776b={};var _0x283cb2={};var _0x5663e9;var _0x3130bd;return db[_0xdef6('0x2f')][_0xdef6('0x52')]({'where':{'id':_0x4b8b0f[_0xdef6('0x45')]['id']}})['then'](handleEntityNotFound(_0x238418,null))['then'](function(_0x319733){if(_0x319733){_0x5663e9=_0x319733;_0x283cb2[_0xdef6('0x31')]=_['keys'](db[_0xdef6('0x4a')][_0xdef6('0x30')]);_0x283cb2[_0xdef6('0x33')]=_[_0xdef6('0x32')](_0x4b8b0f['query']);_0x283cb2[_0xdef6('0x34')]=_['intersection'](_0x283cb2[_0xdef6('0x31')],_0x283cb2['query']);_0x13776b[_0xdef6('0x36')]=_[_0xdef6('0x35')](_0x283cb2['model'],qs[_0xdef6('0x37')](_0x4b8b0f[_0xdef6('0x33')]['fields']));_0x13776b[_0xdef6('0x36')]=_0x13776b[_0xdef6('0x36')][_0xdef6('0x38')]?_0x13776b[_0xdef6('0x36')]:_0x283cb2['model'];_0x13776b[_0xdef6('0x4b')]=qs[_0xdef6('0x4c')](_0x4b8b0f[_0xdef6('0x33')]['sort']);_0x13776b['where']=qs['filters'](_[_0xdef6('0x3a')](_0x4b8b0f['query'],_0x283cb2[_0xdef6('0x34')]));if(_0x4b8b0f[_0xdef6('0x33')][_0xdef6('0x3b')]){_0x13776b[_0xdef6('0x39')]=_['merge'](_0x13776b[_0xdef6('0x39')],{'$or':_[_0xdef6('0x4d')](_0x13776b[_0xdef6('0x36')],function(_0x3ffc70){var _0x5ac234={};_0x5ac234[_0x3ffc70]={'$like':'%'+_0x4b8b0f[_0xdef6('0x33')]['filter']+'%'};return _0x5ac234;})});}_0x13776b=_[_0xdef6('0x3f')]({},_0x13776b,_0x4b8b0f[_0xdef6('0x40')]);return _0x5663e9[_0xdef6('0x53')](_0x13776b);}})['then'](function(_0x4aea6e){if(_0x4aea6e){_0x3130bd=_0x4aea6e[_0xdef6('0x38')];if(!_0x4b8b0f['query'][_0xdef6('0x4f')](_0xdef6('0x50'))){_0x13776b[_0xdef6('0x25')]=qs[_0xdef6('0x25')](_0x4b8b0f[_0xdef6('0x33')][_0xdef6('0x25')]);_0x13776b[_0xdef6('0x24')]=qs[_0xdef6('0x24')](_0x4b8b0f['query']['offset']);}return _0x5663e9[_0xdef6('0x53')](_0x13776b);}})[_0xdef6('0x15')](function(_0x70eb62){if(_0x70eb62){return _0x70eb62?{'count':_0x3130bd,'rows':_0x70eb62}:null;}})[_0xdef6('0x15')](respondWithResult(_0x238418,null))[_0xdef6('0x1f')](handleError(_0x238418,null));}; \ No newline at end of file +var _0xc51a=['moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','name','send','index','ZohoConfiguration','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','include','rows','show','params','length','includeAll','find','create','body','findOne','getFields','getSubjects','ZohoField','getDescriptions','html-pdf','eml-format','zip-dir','request-promise'];(function(_0x204587,_0x3e40c2){var _0x224eb0=function(_0x116bc7){while(--_0x116bc7){_0x204587['push'](_0x204587['shift']());}};_0x224eb0(++_0x3e40c2);}(_0xc51a,0x104));var _0xac51=function(_0x4f135e,_0x384f25){_0x4f135e=_0x4f135e-0x0;var _0x3e84c7=_0xc51a[_0x4f135e];return _0x3e84c7;};'use strict';var pdf=require(_0xac51('0x0'));var emlformat=require(_0xac51('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xac51('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac51('0x3'));var moment=require(_0xac51('0x4'));var BPromise=require(_0xac51('0x5'));var Mustache=require('mustache');var util=require(_0xac51('0x6'));var path=require('path');var sox=require(_0xac51('0x7'));var csv=require(_0xac51('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xac51('0x9'));var squel=require(_0xac51('0xa'));var crypto=require(_0xac51('0xb'));var jsforce=require(_0xac51('0xc'));var deskjs=require(_0xac51('0xd'));var toCsv=require(_0xac51('0x8'));var querystring=require(_0xac51('0xe'));var Papa=require(_0xac51('0xf'));var authService=require(_0xac51('0x10'));var hardwareService=require(_0xac51('0x11'));var Redis=require('ioredis');var qs=require(_0xac51('0x12'));var logger=require(_0xac51('0x13'))(_0xac51('0x14'));var utils=require('../../config/utils');var config=require(_0xac51('0x15'));var db=require(_0xac51('0x16'))['db'];var jayson=require(_0xac51('0x17'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37787b,_0x74b580,_0x324ddc,_0x1807d9){return new BPromise(function(_0x368cb5,_0x5a8871){var _0x4ef85b=_0x1807d9||client;return _0x4ef85b[_0xac51('0x18')](_0x37787b,_0x324ddc)[_0xac51('0x19')](function(_0x39c264){logger[_0xac51('0x1a')](_0xac51('0x1b'),_0x74b580,'request\x20sent');logger[_0xac51('0x1c')](_0xac51('0x1d'),_0x74b580,_0xac51('0x1e'),JSON[_0xac51('0x1f')](_0x39c264));if(_0x39c264[_0xac51('0x20')]){if(_0x39c264[_0xac51('0x20')]['code']===0x1f4){logger[_0xac51('0x20')](_0xac51('0x1b'),_0x74b580,_0x39c264[_0xac51('0x20')]['message']);return _0x5a8871(_0x39c264[_0xac51('0x20')][_0xac51('0x21')]);}logger['error'](_0xac51('0x1b'),_0x74b580,_0x39c264['error'][_0xac51('0x21')]);return _0x368cb5(_0x39c264[_0xac51('0x20')][_0xac51('0x21')]);}else{logger[_0xac51('0x1a')]('ZohoConfiguration,\x20%s,\x20%s',_0x74b580,_0xac51('0x1e'));_0x368cb5(_0x39c264['result'][_0xac51('0x21')]);}})[_0xac51('0x22')](function(_0x234fac){logger[_0xac51('0x20')]('ZohoConfiguration,\x20%s,\x20%s',_0x74b580,_0x234fac);_0x5a8871(_0x234fac);});});}function respondWithStatusCode(_0x1daa26,_0x319782){_0x319782=_0x319782||0xcc;return function(_0x364b48){if(_0x364b48){return _0x1daa26[_0xac51('0x23')](_0x319782);}return _0x1daa26['status'](_0x319782)[_0xac51('0x24')]();};}function respondWithResult(_0x32b68d,_0x132629){_0x132629=_0x132629||0xc8;return function(_0x56ede4){if(_0x56ede4){return _0x32b68d[_0xac51('0x25')](_0x132629)[_0xac51('0x26')](_0x56ede4);}};}function respondWithFilteredResult(_0x404803,_0x5316aa){return function(_0x3667d1){if(_0x3667d1){var _0x3a8ab4=_0x3667d1[_0xac51('0x27')],_0x44ab96=_0x5316aa[_0xac51('0x28')],_0xed1412=_0x5316aa[_0xac51('0x28')]+_0x5316aa[_0xac51('0x29')],_0x483cc8;if(_0xed1412>=_0x3a8ab4){_0xed1412=_0x3a8ab4;_0x483cc8=0xc8;}else{_0x483cc8=0xce;}_0x404803[_0xac51('0x25')](_0x483cc8);return _0x404803['set'](_0xac51('0x2a'),_0x44ab96+'-'+_0xed1412+'/'+_0x3a8ab4)[_0xac51('0x26')](_0x3667d1);}return null;};}function patchUpdates(_0x4c81d0){return function(_0x3e8332){try{jsonpatch[_0xac51('0x2b')](_0x3e8332,_0x4c81d0,!![]);}catch(_0x15e050){return BPromise[_0xac51('0x2c')](_0x15e050);}return _0x3e8332[_0xac51('0x2d')]();};}function saveUpdates(_0x3f8190,_0x24b961){return function(_0x26ab58){if(_0x26ab58){return _0x26ab58[_0xac51('0x2e')](_0x3f8190)[_0xac51('0x19')](function(_0x37f254){return _0x37f254;});}return null;};}function removeEntity(_0x91e54b,_0xabdee5){return function(_0x17a192){if(_0x17a192){return _0x17a192[_0xac51('0x2f')]()[_0xac51('0x19')](function(){_0x91e54b[_0xac51('0x25')](0xcc)[_0xac51('0x24')]();});}};}function handleEntityNotFound(_0x35a1a8,_0x6ecefc){return function(_0x32f411){if(!_0x32f411){_0x35a1a8[_0xac51('0x23')](0x194);}return _0x32f411;};}function handleError(_0x47786d,_0x3079ac){_0x3079ac=_0x3079ac||0x1f4;return function(_0x5d2e52){logger[_0xac51('0x20')](_0x5d2e52['stack']);if(_0x5d2e52[_0xac51('0x30')]){delete _0x5d2e52['name'];}_0x47786d['status'](_0x3079ac)[_0xac51('0x31')](_0x5d2e52);};}exports[_0xac51('0x32')]=function(_0x270f64,_0x185730){var _0x4038ac={},_0x443316={},_0x3d70ba={'count':0x0,'rows':[]};var _0xebfe86=db[_0xac51('0x33')][_0xac51('0x34')];_0x443316[_0xac51('0x35')]=_[_0xac51('0x36')](_0xebfe86);_0x443316[_0xac51('0x37')]=_[_0xac51('0x36')](_0x270f64[_0xac51('0x37')]);_0x443316[_0xac51('0x38')]=_['intersection'](_0x443316[_0xac51('0x35')],_0x443316['query']);_0x4038ac[_0xac51('0x39')]=_[_0xac51('0x3a')](_0x443316[_0xac51('0x35')],qs[_0xac51('0x3b')](_0x270f64[_0xac51('0x37')]['fields']));_0x4038ac[_0xac51('0x39')]=_0x4038ac[_0xac51('0x39')]['length']?_0x4038ac['attributes']:_0x443316[_0xac51('0x35')];if(!_0x270f64['query'][_0xac51('0x3c')](_0xac51('0x3d'))){_0x4038ac['limit']=qs[_0xac51('0x29')](_0x270f64[_0xac51('0x37')][_0xac51('0x29')]);_0x4038ac[_0xac51('0x28')]=qs[_0xac51('0x28')](_0x270f64[_0xac51('0x37')][_0xac51('0x28')]);}_0x4038ac[_0xac51('0x3e')]=qs[_0xac51('0x3f')](_0x270f64[_0xac51('0x37')][_0xac51('0x3f')]);_0x4038ac['where']=qs[_0xac51('0x38')](_[_0xac51('0x40')](_0x270f64[_0xac51('0x37')],_0x443316[_0xac51('0x38')]));if(_0x270f64['query'][_0xac51('0x41')]){_0x4038ac[_0xac51('0x42')]=_[_0xac51('0x43')](_0x4038ac[_0xac51('0x42')],{'$or':_[_0xac51('0x44')](_0xebfe86,function(_0xc5c493){if(_0xc5c493[_0xac51('0x45')][_0xac51('0x46')]!==_0xac51('0x47')){var _0x4b09c2={};_0x4b09c2[_0xc5c493[_0xac51('0x48')]]={'$like':'%'+_0x270f64[_0xac51('0x37')]['filter']+'%'};return _0x4b09c2;}})});}_0x4038ac=_[_0xac51('0x43')]({},_0x4038ac,_0x270f64[_0xac51('0x49')]);var _0x1beb15={'where':_0x4038ac[_0xac51('0x42')]};return db[_0xac51('0x33')][_0xac51('0x27')](_0x1beb15)[_0xac51('0x19')](function(_0xe1bef6){_0x3d70ba[_0xac51('0x27')]=_0xe1bef6;if(_0x270f64[_0xac51('0x37')]['includeAll']){_0x4038ac[_0xac51('0x4a')]=[{'all':!![]}];}return db[_0xac51('0x33')]['findAll'](_0x4038ac);})[_0xac51('0x19')](function(_0x3a74a6){_0x3d70ba[_0xac51('0x4b')]=_0x3a74a6;return _0x3d70ba;})[_0xac51('0x19')](respondWithFilteredResult(_0x185730,_0x4038ac))[_0xac51('0x22')](handleError(_0x185730,null));};exports[_0xac51('0x4c')]=function(_0x4b41e3,_0x83cb59){var _0x2755a7={'raw':![],'where':{'id':_0x4b41e3[_0xac51('0x4d')]['id']}},_0x69129d={};_0x69129d[_0xac51('0x35')]=_['keys'](db[_0xac51('0x33')][_0xac51('0x34')]);_0x69129d[_0xac51('0x37')]=_[_0xac51('0x36')](_0x4b41e3['query']);_0x69129d['filters']=_['intersection'](_0x69129d[_0xac51('0x35')],_0x69129d['query']);_0x2755a7[_0xac51('0x39')]=_[_0xac51('0x3a')](_0x69129d['model'],qs[_0xac51('0x3b')](_0x4b41e3['query'][_0xac51('0x3b')]));_0x2755a7[_0xac51('0x39')]=_0x2755a7[_0xac51('0x39')][_0xac51('0x4e')]?_0x2755a7['attributes']:_0x69129d[_0xac51('0x35')];if(_0x4b41e3['query'][_0xac51('0x4f')]){_0x2755a7['include']=[{'all':!![]}];}_0x2755a7=_['merge']({},_0x2755a7,_0x4b41e3[_0xac51('0x49')]);return db[_0xac51('0x33')][_0xac51('0x50')](_0x2755a7)[_0xac51('0x19')](handleEntityNotFound(_0x83cb59,null))[_0xac51('0x19')](respondWithResult(_0x83cb59,null))[_0xac51('0x22')](handleError(_0x83cb59,null));};exports[_0xac51('0x51')]=function(_0x304300,_0x1df405){return db[_0xac51('0x33')][_0xac51('0x51')](_0x304300[_0xac51('0x52')],{})[_0xac51('0x19')](respondWithResult(_0x1df405,0xc9))[_0xac51('0x22')](handleError(_0x1df405,null));};exports[_0xac51('0x2e')]=function(_0x568932,_0x5835f7){if(_0x568932[_0xac51('0x52')]['id']){delete _0x568932[_0xac51('0x52')]['id'];}return db[_0xac51('0x33')][_0xac51('0x50')]({'where':{'id':_0x568932[_0xac51('0x4d')]['id']}})[_0xac51('0x19')](handleEntityNotFound(_0x5835f7,null))[_0xac51('0x19')](saveUpdates(_0x568932['body'],null))[_0xac51('0x19')](respondWithResult(_0x5835f7,null))['catch'](handleError(_0x5835f7,null));};exports[_0xac51('0x2f')]=function(_0x287c96,_0x1773e2){return db[_0xac51('0x33')][_0xac51('0x50')]({'where':{'id':_0x287c96[_0xac51('0x4d')]['id']}})[_0xac51('0x19')](handleEntityNotFound(_0x1773e2,null))[_0xac51('0x19')](removeEntity(_0x1773e2,null))[_0xac51('0x22')](handleError(_0x1773e2,null));};exports['getFields']=function(_0x3809f1,_0x5a2088,_0x4a6bd4){var _0x127f34={};var _0x2ef526={};var _0x14aa7a;var _0x2296b4;return db[_0xac51('0x33')][_0xac51('0x53')]({'where':{'id':_0x3809f1[_0xac51('0x4d')]['id']}})[_0xac51('0x19')](handleEntityNotFound(_0x5a2088,null))['then'](function(_0x39f7ab){if(_0x39f7ab){_0x14aa7a=_0x39f7ab;_0x2ef526['model']=_[_0xac51('0x36')](db['ZohoField']['rawAttributes']);_0x2ef526[_0xac51('0x37')]=_[_0xac51('0x36')](_0x3809f1['query']);_0x2ef526['filters']=_[_0xac51('0x3a')](_0x2ef526[_0xac51('0x35')],_0x2ef526['query']);_0x127f34['attributes']=_['intersection'](_0x2ef526[_0xac51('0x35')],qs[_0xac51('0x3b')](_0x3809f1[_0xac51('0x37')][_0xac51('0x3b')]));_0x127f34['attributes']=_0x127f34['attributes'][_0xac51('0x4e')]?_0x127f34[_0xac51('0x39')]:_0x2ef526[_0xac51('0x35')];_0x127f34['order']=qs[_0xac51('0x3f')](_0x3809f1[_0xac51('0x37')]['sort']);_0x127f34[_0xac51('0x42')]=qs[_0xac51('0x38')](_[_0xac51('0x40')](_0x3809f1[_0xac51('0x37')],_0x2ef526[_0xac51('0x38')]));if(_0x3809f1[_0xac51('0x37')][_0xac51('0x41')]){_0x127f34[_0xac51('0x42')]=_['merge'](_0x127f34['where'],{'$or':_[_0xac51('0x44')](_0x127f34[_0xac51('0x39')],function(_0x12d541){var _0x4ba8d2={};_0x4ba8d2[_0x12d541]={'$like':'%'+_0x3809f1[_0xac51('0x37')][_0xac51('0x41')]+'%'};return _0x4ba8d2;})});}_0x127f34=_[_0xac51('0x43')]({},_0x127f34,_0x3809f1[_0xac51('0x49')]);return _0x14aa7a[_0xac51('0x54')](_0x127f34);}})['then'](function(_0x20611a){if(_0x20611a){_0x2296b4=_0x20611a[_0xac51('0x4e')];if(!_0x3809f1[_0xac51('0x37')]['hasOwnProperty']('nolimit')){_0x127f34['limit']=qs[_0xac51('0x29')](_0x3809f1[_0xac51('0x37')]['limit']);_0x127f34['offset']=qs[_0xac51('0x28')](_0x3809f1[_0xac51('0x37')][_0xac51('0x28')]);}return _0x14aa7a[_0xac51('0x54')](_0x127f34);}})[_0xac51('0x19')](function(_0x5de660){if(_0x5de660){return _0x5de660?{'count':_0x2296b4,'rows':_0x5de660}:null;}})[_0xac51('0x19')](respondWithResult(_0x5a2088,null))['catch'](handleError(_0x5a2088,null));};exports[_0xac51('0x55')]=function(_0x493b64,_0x44ad24,_0xa8a45e){var _0x2b7c54={};var _0x4e7779={};var _0x542482;var _0x3a2aa7;return db[_0xac51('0x33')]['findOne']({'where':{'id':_0x493b64['params']['id']}})[_0xac51('0x19')](handleEntityNotFound(_0x44ad24,null))[_0xac51('0x19')](function(_0x26be08){if(_0x26be08){_0x542482=_0x26be08;_0x4e7779[_0xac51('0x35')]=_['keys'](db[_0xac51('0x56')]['rawAttributes']);_0x4e7779[_0xac51('0x37')]=_[_0xac51('0x36')](_0x493b64['query']);_0x4e7779[_0xac51('0x38')]=_['intersection'](_0x4e7779['model'],_0x4e7779[_0xac51('0x37')]);_0x2b7c54[_0xac51('0x39')]=_['intersection'](_0x4e7779[_0xac51('0x35')],qs[_0xac51('0x3b')](_0x493b64[_0xac51('0x37')][_0xac51('0x3b')]));_0x2b7c54[_0xac51('0x39')]=_0x2b7c54['attributes'][_0xac51('0x4e')]?_0x2b7c54[_0xac51('0x39')]:_0x4e7779[_0xac51('0x35')];_0x2b7c54[_0xac51('0x3e')]=qs[_0xac51('0x3f')](_0x493b64['query']['sort']);_0x2b7c54[_0xac51('0x42')]=qs[_0xac51('0x38')](_['pick'](_0x493b64[_0xac51('0x37')],_0x4e7779[_0xac51('0x38')]));if(_0x493b64[_0xac51('0x37')]['filter']){_0x2b7c54[_0xac51('0x42')]=_[_0xac51('0x43')](_0x2b7c54['where'],{'$or':_['map'](_0x2b7c54[_0xac51('0x39')],function(_0x3fd40d){var _0x1ab26a={};_0x1ab26a[_0x3fd40d]={'$like':'%'+_0x493b64[_0xac51('0x37')]['filter']+'%'};return _0x1ab26a;})});}_0x2b7c54=_[_0xac51('0x43')]({},_0x2b7c54,_0x493b64[_0xac51('0x49')]);return _0x542482[_0xac51('0x55')](_0x2b7c54);}})[_0xac51('0x19')](function(_0xdaaeda){if(_0xdaaeda){_0x3a2aa7=_0xdaaeda[_0xac51('0x4e')];if(!_0x493b64['query'][_0xac51('0x3c')](_0xac51('0x3d'))){_0x2b7c54[_0xac51('0x29')]=qs[_0xac51('0x29')](_0x493b64[_0xac51('0x37')]['limit']);_0x2b7c54['offset']=qs['offset'](_0x493b64['query'][_0xac51('0x28')]);}return _0x542482[_0xac51('0x55')](_0x2b7c54);}})['then'](function(_0x21ec83){if(_0x21ec83){return _0x21ec83?{'count':_0x3a2aa7,'rows':_0x21ec83}:null;}})[_0xac51('0x19')](respondWithResult(_0x44ad24,null))[_0xac51('0x22')](handleError(_0x44ad24,null));};exports['getDescriptions']=function(_0x2191e0,_0x2e0d3d,_0x478144){var _0x384f2d={};var _0x28dc3b={};var _0x502a4f;var _0x111cb5;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x2191e0[_0xac51('0x4d')]['id']}})[_0xac51('0x19')](handleEntityNotFound(_0x2e0d3d,null))['then'](function(_0x37c83c){if(_0x37c83c){_0x502a4f=_0x37c83c;_0x28dc3b[_0xac51('0x35')]=_[_0xac51('0x36')](db[_0xac51('0x56')][_0xac51('0x34')]);_0x28dc3b[_0xac51('0x37')]=_[_0xac51('0x36')](_0x2191e0[_0xac51('0x37')]);_0x28dc3b[_0xac51('0x38')]=_[_0xac51('0x3a')](_0x28dc3b[_0xac51('0x35')],_0x28dc3b[_0xac51('0x37')]);_0x384f2d[_0xac51('0x39')]=_['intersection'](_0x28dc3b[_0xac51('0x35')],qs[_0xac51('0x3b')](_0x2191e0[_0xac51('0x37')][_0xac51('0x3b')]));_0x384f2d[_0xac51('0x39')]=_0x384f2d['attributes'][_0xac51('0x4e')]?_0x384f2d[_0xac51('0x39')]:_0x28dc3b[_0xac51('0x35')];_0x384f2d[_0xac51('0x3e')]=qs[_0xac51('0x3f')](_0x2191e0[_0xac51('0x37')]['sort']);_0x384f2d[_0xac51('0x42')]=qs[_0xac51('0x38')](_[_0xac51('0x40')](_0x2191e0[_0xac51('0x37')],_0x28dc3b['filters']));if(_0x2191e0['query'][_0xac51('0x41')]){_0x384f2d[_0xac51('0x42')]=_[_0xac51('0x43')](_0x384f2d['where'],{'$or':_[_0xac51('0x44')](_0x384f2d[_0xac51('0x39')],function(_0x5b791e){var _0x598582={};_0x598582[_0x5b791e]={'$like':'%'+_0x2191e0[_0xac51('0x37')][_0xac51('0x41')]+'%'};return _0x598582;})});}_0x384f2d=_[_0xac51('0x43')]({},_0x384f2d,_0x2191e0['options']);return _0x502a4f[_0xac51('0x57')](_0x384f2d);}})['then'](function(_0x4ee783){if(_0x4ee783){_0x111cb5=_0x4ee783[_0xac51('0x4e')];if(!_0x2191e0[_0xac51('0x37')][_0xac51('0x3c')](_0xac51('0x3d'))){_0x384f2d[_0xac51('0x29')]=qs[_0xac51('0x29')](_0x2191e0[_0xac51('0x37')][_0xac51('0x29')]);_0x384f2d[_0xac51('0x28')]=qs['offset'](_0x2191e0['query'][_0xac51('0x28')]);}return _0x502a4f['getDescriptions'](_0x384f2d);}})[_0xac51('0x19')](function(_0x2c23f7){if(_0x2c23f7){return _0x2c23f7?{'count':_0x111cb5,'rows':_0x2c23f7}:null;}})[_0xac51('0x19')](respondWithResult(_0x2e0d3d,null))[_0xac51('0x22')](handleError(_0x2e0d3d,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index d374222..3b4e592 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 _0xad95=['bluebird','request-promise','lodash','util','../../config/logger'];(function(_0x1486e5,_0x39684f){var _0x29d89b=function(_0x4a0a80){while(--_0x4a0a80){_0x1486e5['push'](_0x1486e5['shift']());}};_0x29d89b(++_0x39684f);}(_0xad95,0x70));var _0x5ad9=function(_0x5b0c4e,_0x3d69ca){_0x5b0c4e=_0x5b0c4e-0x0;var _0x21ad2a=_0xad95[_0x5b0c4e];return _0x21ad2a;};'use strict';var _=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var logger=require(_0x5ad9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5ad9('0x3'));var rp=require(_0x5ad9('0x4'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x185bff,_0x5277fa){return _0x185bff['define']('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce9b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xce9b,0xc6));var _0xbce9=function(_0x9d421,_0x21275d){_0x9d421=_0x9d421-0x0;var _0x152bc1=_0xce9b[_0x9d421];return _0x152bc1;};'use strict';var _=require(_0xbce9('0x0'));var util=require(_0xbce9('0x1'));var logger=require(_0xbce9('0x2'))(_0xbce9('0x3'));var moment=require(_0xbce9('0x4'));var BPromise=require(_0xbce9('0x5'));var rp=require(_0xbce9('0x6'));var attributes=require(_0xbce9('0x7'));module['exports']=function(_0x2461ee,_0x302861){return _0x2461ee[_0xbce9('0x8')](_0xbce9('0x9'),attributes,{'tableName':_0xbce9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 4859a4d..bfa5ba8 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 _0x5e90=['client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x5e90,0x1df));var _0x05e9=function(_0x44c246,_0x19983a){_0x44c246=_0x44c246-0x0;var _0x438154=_0x5e90[_0x44c246];return _0x438154;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x05e9('0x0'));var rs=require(_0x05e9('0x1'));var fs=require('fs');var Redis=require(_0x05e9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x05e9('0x3'));var logger=require(_0x05e9('0x4'))(_0x05e9('0x5'));var config=require('../../config/environment');var jayson=require(_0x05e9('0x6'));var client=jayson[_0x05e9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41fa6b,_0x24bce5,_0x317e52){return new BPromise(function(_0x370ff0,_0x501907){return client[_0x05e9('0x8')](_0x41fa6b,_0x317e52)[_0x05e9('0x9')](function(_0x1cacca){logger[_0x05e9('0xa')](_0x05e9('0xb'),_0x24bce5,'request\x20sent');logger[_0x05e9('0xc')](_0x05e9('0xd'),_0x24bce5,_0x05e9('0xe'),JSON[_0x05e9('0xf')](_0x1cacca));if(_0x1cacca[_0x05e9('0x10')]){if(_0x1cacca[_0x05e9('0x10')]['code']===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x24bce5,_0x1cacca[_0x05e9('0x10')][_0x05e9('0x11')]);return _0x501907(_0x1cacca[_0x05e9('0x10')][_0x05e9('0x11')]);}logger[_0x05e9('0x10')](_0x05e9('0xb'),_0x24bce5,_0x1cacca[_0x05e9('0x10')][_0x05e9('0x11')]);return _0x370ff0(_0x1cacca['error'][_0x05e9('0x11')]);}else{logger[_0x05e9('0xa')](_0x05e9('0xb'),_0x24bce5,_0x05e9('0xe'));_0x370ff0(_0x1cacca['result']['message']);}})['catch'](function(_0x3bf58e){logger[_0x05e9('0x10')](_0x05e9('0xb'),_0x24bce5,_0x3bf58e);_0x501907(_0x3bf58e);});});} \ No newline at end of file +var _0xdd3a=['error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5773ed,_0x2270ce){var _0x4a75d9=function(_0x31a9a3){while(--_0x31a9a3){_0x5773ed['push'](_0x5773ed['shift']());}};_0x4a75d9(++_0x2270ce);}(_0xdd3a,0x13d));var _0xadd3=function(_0x3e5f37,_0x38b152){_0x3e5f37=_0x3e5f37-0x0;var _0x1cf477=_0xdd3a[_0x3e5f37];return _0x1cf477;};'use strict';var _=require(_0xadd3('0x0'));var util=require(_0xadd3('0x1'));var moment=require(_0xadd3('0x2'));var BPromise=require(_0xadd3('0x3'));var rs=require(_0xadd3('0x4'));var fs=require('fs');var Redis=require(_0xadd3('0x5'));var db=require(_0xadd3('0x6'))['db'];var utils=require(_0xadd3('0x7'));var logger=require(_0xadd3('0x8'))(_0xadd3('0x9'));var config=require(_0xadd3('0xa'));var jayson=require(_0xadd3('0xb'));var client=jayson[_0xadd3('0xc')][_0xadd3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x446eab,_0xc855b0,_0x34e35c){return new BPromise(function(_0x6508bb,_0x728499){return client[_0xadd3('0xe')](_0x446eab,_0x34e35c)['then'](function(_0x40e7c1){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0xc855b0,_0xadd3('0xf'));logger[_0xadd3('0x10')](_0xadd3('0x11'),_0xc855b0,_0xadd3('0xf'),JSON[_0xadd3('0x12')](_0x40e7c1));if(_0x40e7c1['error']){if(_0x40e7c1[_0xadd3('0x13')][_0xadd3('0x14')]===0x1f4){logger[_0xadd3('0x13')](_0xadd3('0x15'),_0xc855b0,_0x40e7c1[_0xadd3('0x13')][_0xadd3('0x16')]);return _0x728499(_0x40e7c1['error'][_0xadd3('0x16')]);}logger[_0xadd3('0x13')](_0xadd3('0x15'),_0xc855b0,_0x40e7c1['error'][_0xadd3('0x16')]);return _0x6508bb(_0x40e7c1['error'][_0xadd3('0x16')]);}else{logger['info'](_0xadd3('0x15'),_0xc855b0,_0xadd3('0xf'));_0x6508bb(_0x40e7c1[_0xadd3('0x17')][_0xadd3('0x16')]);}})['catch'](function(_0x2ddd39){logger[_0xadd3('0x13')](_0xadd3('0x15'),_0xc855b0,_0x2ddd39);_0x728499(_0x2ddd39);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 5b13d0b..d310873 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 _0xdf6b=['/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index'];(function(_0x55c2db,_0x5669e4){var _0x5072b5=function(_0x164d2e){while(--_0x164d2e){_0x55c2db['push'](_0x55c2db['shift']());}};_0x5072b5(++_0x5669e4);}(_0xdf6b,0xb1));var _0xbdf6=function(_0x3669b6,_0x45083a){_0x3669b6=_0x3669b6-0x0;var _0xc34609=_0xdf6b[_0x3669b6];return _0xc34609;};'use strict';var multer=require(_0xbdf6('0x0'));var util=require(_0xbdf6('0x1'));var path=require(_0xbdf6('0x2'));var timeout=require(_0xbdf6('0x3'));var express=require(_0xbdf6('0x4'));var router=express[_0xbdf6('0x5')]();var auth=require(_0xbdf6('0x6'));var interaction=require(_0xbdf6('0x7'));var config=require(_0xbdf6('0x8'));var controller=require(_0xbdf6('0x9'));router[_0xbdf6('0xa')]('/',auth[_0xbdf6('0xb')](),controller[_0xbdf6('0xc')]);router[_0xbdf6('0xa')](_0xbdf6('0xd'),auth['isAuthenticated'](),controller[_0xbdf6('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xbdf6('0xd'),auth[_0xbdf6('0xb')](),controller[_0xbdf6('0xf')]);router[_0xbdf6('0x10')]('/:id',auth[_0xbdf6('0xb')](),controller[_0xbdf6('0x11')]);module[_0xbdf6('0x12')]=router; \ No newline at end of file +var _0x3371=['delete','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show','create','put','/:id','update'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x3371,0xe3));var _0x1337=function(_0x1b646f,_0x44b1f0){_0x1b646f=_0x1b646f-0x0;var _0x5663a8=_0x3371[_0x1b646f];return _0x5663a8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1337('0x0'));var router=express[_0x1337('0x1')]();var auth=require(_0x1337('0x2'));var interaction=require(_0x1337('0x3'));var config=require(_0x1337('0x4'));var controller=require('./intZohoField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1337('0x5')]);router[_0x1337('0x6')]('/:id',auth[_0x1337('0x7')](),controller[_0x1337('0x8')]);router['post']('/',auth[_0x1337('0x7')](),controller[_0x1337('0x9')]);router[_0x1337('0xa')](_0x1337('0xb'),auth['isAuthenticated'](),controller[_0x1337('0xc')]);router[_0x1337('0xd')](_0x1337('0xb'),auth[_0x1337('0x7')](),controller[_0x1337('0xe')]);module[_0x1337('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index db490a1..bf15bcc 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 _0x22fb=['string','STRING','BOOLEAN','ENUM','variable','customVariable','keyValue'];(function(_0xc4bb1f,_0x4abaf4){var _0x5d8485=function(_0xa65eba){while(--_0xa65eba){_0xc4bb1f['push'](_0xc4bb1f['shift']());}};_0x5d8485(++_0x4abaf4);}(_0x22fb,0x192));var _0xb22f=function(_0x15fa6d,_0x33515e){_0x15fa6d=_0x15fa6d-0x0;var _0x911913=_0x22fb[_0x15fa6d];return _0x911913;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb22f('0x0')]('string',_0xb22f('0x1'),_0xb22f('0x2'),_0xb22f('0x3')),'defaultValue':_0xb22f('0x4')},'content':{'type':Sequelize[_0xb22f('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb22f('0x0')](_0xb22f('0x4'),_0xb22f('0x1'),_0xb22f('0x2'))},'keyContent':{'type':Sequelize[_0xb22f('0x5')]},'idField':{'type':Sequelize[_0xb22f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb22f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb22f('0x5')]}}; \ No newline at end of file +var _0x9348=['exports','ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x13a190,_0x4026c7){var _0x23c5be=function(_0xf6062d){while(--_0xf6062d){_0x13a190['push'](_0x13a190['shift']());}};_0x23c5be(++_0x4026c7);}(_0x9348,0x10d));var _0x8934=function(_0x2f8d85,_0x436c0f){_0x2f8d85=_0x2f8d85-0x0;var _0x2767f5=_0x9348[_0x2f8d85];return _0x2767f5;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'type':{'type':Sequelize[_0x8934('0x2')](_0x8934('0x3'),_0x8934('0x4'),'customVariable',_0x8934('0x5')),'defaultValue':_0x8934('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8934('0x6')]},'keyType':{'type':Sequelize[_0x8934('0x2')](_0x8934('0x3'),_0x8934('0x4'),_0x8934('0x7'))},'keyContent':{'type':Sequelize[_0x8934('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8934('0x6')]},'customField':{'type':Sequelize[_0x8934('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8934('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index b990c38..4a56f18 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 _0xd404=['path','sox','to-csv','ejs','lodash','crypto','jsforce','../../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','save','update','then','end','stack','name','send','index','ZohoField','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','field','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x5e1eb2,_0x34c6af){var _0x849ba3=function(_0x3f0808){while(--_0x3f0808){_0x5e1eb2['push'](_0x5e1eb2['shift']());}};_0x849ba3(++_0x34c6af);}(_0xd404,0x15b));var _0x4d40=function(_0x3f9310,_0x22d770){_0x3f9310=_0x3f9310-0x0;var _0x2de91f=_0xd404[_0x3f9310];return _0x2de91f;};'use strict';var pdf=require(_0x4d40('0x0'));var emlformat=require(_0x4d40('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4d40('0x2'));var jsonpatch=require(_0x4d40('0x3'));var rp=require('request-promise');var moment=require(_0x4d40('0x4'));var BPromise=require(_0x4d40('0x5'));var Mustache=require(_0x4d40('0x6'));var util=require(_0x4d40('0x7'));var path=require(_0x4d40('0x8'));var sox=require(_0x4d40('0x9'));var csv=require(_0x4d40('0xa'));var ejs=require(_0x4d40('0xb'));var fs=require('fs');var _=require(_0x4d40('0xc'));var squel=require('squel');var crypto=require(_0x4d40('0xd'));var jsforce=require(_0x4d40('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4d40('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x4d40('0xf'));var hardwareService=require(_0x4d40('0x10'));var Redis=require(_0x4d40('0x11'));var qs=require(_0x4d40('0x12'));var logger=require(_0x4d40('0x13'))(_0x4d40('0x14'));var utils=require(_0x4d40('0x15'));var config=require(_0x4d40('0x16'));var db=require(_0x4d40('0x17'))['db'];function respondWithStatusCode(_0x3f5c29,_0x44b5d0){_0x44b5d0=_0x44b5d0||0xcc;return function(_0x3c3b7e){if(_0x3c3b7e){return _0x3f5c29[_0x4d40('0x18')](_0x44b5d0);}return _0x3f5c29[_0x4d40('0x19')](_0x44b5d0)['end']();};}function respondWithResult(_0xa644d2,_0x1bed4c){_0x1bed4c=_0x1bed4c||0xc8;return function(_0x3b071b){if(_0x3b071b){return _0xa644d2[_0x4d40('0x19')](_0x1bed4c)[_0x4d40('0x1a')](_0x3b071b);}};}function respondWithFilteredResult(_0x478cdd,_0x23de7b){return function(_0x4077ce){if(_0x4077ce){var _0x20bc1b=_0x4077ce[_0x4d40('0x1b')],_0xcee25a=_0x23de7b[_0x4d40('0x1c')],_0x453857=_0x23de7b[_0x4d40('0x1c')]+_0x23de7b['limit'],_0x361a41;if(_0x453857>=_0x20bc1b){_0x453857=_0x20bc1b;_0x361a41=0xc8;}else{_0x361a41=0xce;}_0x478cdd['status'](_0x361a41);return _0x478cdd[_0x4d40('0x1d')](_0x4d40('0x1e'),_0xcee25a+'-'+_0x453857+'/'+_0x20bc1b)['json'](_0x4077ce);}return null;};}function patchUpdates(_0x23b8fd){return function(_0x803d26){try{jsonpatch['apply'](_0x803d26,_0x23b8fd,!![]);}catch(_0x36d031){return BPromise['reject'](_0x36d031);}return _0x803d26[_0x4d40('0x1f')]();};}function saveUpdates(_0x42618b,_0x5230b4){return function(_0x57c997){if(_0x57c997){return _0x57c997[_0x4d40('0x20')](_0x42618b)[_0x4d40('0x21')](function(_0x4d52ce){return _0x4d52ce;});}return null;};}function removeEntity(_0xc458da,_0x3684eb){return function(_0x30f058){if(_0x30f058){return _0x30f058['destroy']()[_0x4d40('0x21')](function(){_0xc458da[_0x4d40('0x19')](0xcc)[_0x4d40('0x22')]();});}};}function handleEntityNotFound(_0x5ca0a0,_0x4eebc3){return function(_0x2df33a){if(!_0x2df33a){_0x5ca0a0[_0x4d40('0x18')](0x194);}return _0x2df33a;};}function handleError(_0x1285f6,_0x470411){_0x470411=_0x470411||0x1f4;return function(_0x4677c9){logger['error'](_0x4677c9[_0x4d40('0x23')]);if(_0x4677c9[_0x4d40('0x24')]){delete _0x4677c9['name'];}_0x1285f6['status'](_0x470411)[_0x4d40('0x25')](_0x4677c9);};}exports[_0x4d40('0x26')]=function(_0x3fa83e,_0x3ad1d7){var _0x4a8ad6={},_0x325f6f={},_0x105635={'count':0x0,'rows':[]};var _0x35dd32=db[_0x4d40('0x27')][_0x4d40('0x28')];_0x325f6f[_0x4d40('0x29')]=_['keys'](_0x35dd32);_0x325f6f['query']=_['keys'](_0x3fa83e[_0x4d40('0x2a')]);_0x325f6f[_0x4d40('0x2b')]=_[_0x4d40('0x2c')](_0x325f6f[_0x4d40('0x29')],_0x325f6f['query']);_0x4a8ad6[_0x4d40('0x2d')]=_[_0x4d40('0x2c')](_0x325f6f[_0x4d40('0x29')],qs['fields'](_0x3fa83e[_0x4d40('0x2a')][_0x4d40('0x2e')]));_0x4a8ad6[_0x4d40('0x2d')]=_0x4a8ad6[_0x4d40('0x2d')][_0x4d40('0x2f')]?_0x4a8ad6['attributes']:_0x325f6f[_0x4d40('0x29')];if(!_0x3fa83e['query'][_0x4d40('0x30')](_0x4d40('0x31'))){_0x4a8ad6[_0x4d40('0x32')]=qs[_0x4d40('0x32')](_0x3fa83e['query']['limit']);_0x4a8ad6[_0x4d40('0x1c')]=qs[_0x4d40('0x1c')](_0x3fa83e[_0x4d40('0x2a')][_0x4d40('0x1c')]);}_0x4a8ad6['order']=qs[_0x4d40('0x33')](_0x3fa83e['query'][_0x4d40('0x33')]);_0x4a8ad6[_0x4d40('0x34')]=qs[_0x4d40('0x2b')](_[_0x4d40('0x35')](_0x3fa83e[_0x4d40('0x2a')],_0x325f6f[_0x4d40('0x2b')]));if(_0x3fa83e[_0x4d40('0x2a')][_0x4d40('0x36')]){_0x4a8ad6[_0x4d40('0x34')]=_[_0x4d40('0x37')](_0x4a8ad6['where'],{'$or':_[_0x4d40('0x38')](_0x35dd32,function(_0x2c020e){if(_0x2c020e['type']['key']!=='VIRTUAL'){var _0x246b9f={};_0x246b9f[_0x2c020e[_0x4d40('0x39')]]={'$like':'%'+_0x3fa83e['query'][_0x4d40('0x36')]+'%'};return _0x246b9f;}})});}_0x4a8ad6=_[_0x4d40('0x37')]({},_0x4a8ad6,_0x3fa83e[_0x4d40('0x3a')]);var _0x3c5451={'where':_0x4a8ad6[_0x4d40('0x34')]};return db['ZohoField'][_0x4d40('0x1b')](_0x3c5451)[_0x4d40('0x21')](function(_0x4a84fa){_0x105635['count']=_0x4a84fa;if(_0x3fa83e[_0x4d40('0x2a')][_0x4d40('0x3b')]){_0x4a8ad6['include']=[{'all':!![]}];}return db[_0x4d40('0x27')][_0x4d40('0x3c')](_0x4a8ad6);})['then'](function(_0x1e8427){_0x105635[_0x4d40('0x3d')]=_0x1e8427;return _0x105635;})['then'](respondWithFilteredResult(_0x3ad1d7,_0x4a8ad6))[_0x4d40('0x3e')](handleError(_0x3ad1d7,null));};exports[_0x4d40('0x3f')]=function(_0x4841ac,_0x2b5db0){var _0x55cdf4={'raw':!![],'where':{'id':_0x4841ac[_0x4d40('0x40')]['id']}},_0x2ec933={};_0x2ec933[_0x4d40('0x29')]=_[_0x4d40('0x41')](db[_0x4d40('0x27')][_0x4d40('0x28')]);_0x2ec933[_0x4d40('0x2a')]=_[_0x4d40('0x41')](_0x4841ac[_0x4d40('0x2a')]);_0x2ec933['filters']=_[_0x4d40('0x2c')](_0x2ec933[_0x4d40('0x29')],_0x2ec933[_0x4d40('0x2a')]);_0x55cdf4[_0x4d40('0x2d')]=_[_0x4d40('0x2c')](_0x2ec933['model'],qs[_0x4d40('0x2e')](_0x4841ac['query'][_0x4d40('0x2e')]));_0x55cdf4[_0x4d40('0x2d')]=_0x55cdf4[_0x4d40('0x2d')][_0x4d40('0x2f')]?_0x55cdf4['attributes']:_0x2ec933[_0x4d40('0x29')];if(_0x4841ac[_0x4d40('0x2a')]['includeAll']){_0x55cdf4[_0x4d40('0x42')]=[{'all':!![]}];}_0x55cdf4=_['merge']({},_0x55cdf4,_0x4841ac[_0x4d40('0x3a')]);return db[_0x4d40('0x27')][_0x4d40('0x43')](_0x55cdf4)[_0x4d40('0x21')](handleEntityNotFound(_0x2b5db0,null))['then'](respondWithResult(_0x2b5db0,null))[_0x4d40('0x3e')](handleError(_0x2b5db0,null));};exports['create']=function(_0x2f03cb,_0x465af2){return db[_0x4d40('0x27')][_0x4d40('0x44')](_0x2f03cb['body'],{})[_0x4d40('0x21')](respondWithResult(_0x465af2,0xc9))[_0x4d40('0x3e')](handleError(_0x465af2,null));};exports[_0x4d40('0x20')]=function(_0x363fcc,_0x4990f9){if(_0x363fcc[_0x4d40('0x45')]['id']){delete _0x363fcc[_0x4d40('0x45')]['id'];}return db['ZohoField'][_0x4d40('0x43')]({'where':{'id':_0x363fcc['params']['id']}})[_0x4d40('0x21')](handleEntityNotFound(_0x4990f9,null))[_0x4d40('0x21')](saveUpdates(_0x363fcc[_0x4d40('0x45')],null))[_0x4d40('0x21')](respondWithResult(_0x4990f9,null))[_0x4d40('0x3e')](handleError(_0x4990f9,null));};exports[_0x4d40('0x46')]=function(_0x30be7b,_0x37b6bf){return db[_0x4d40('0x27')]['find']({'where':{'id':_0x30be7b[_0x4d40('0x40')]['id']}})[_0x4d40('0x21')](handleEntityNotFound(_0x37b6bf,null))[_0x4d40('0x21')](removeEntity(_0x37b6bf,null))[_0x4d40('0x3e')](handleError(_0x37b6bf,null));}; \ No newline at end of file +var _0xbfc0=['filters','map','type','key','VIRTUAL','field','filter','merge','where','then','includeAll','include','findAll','catch','show','params','options','find','create','body','destroy','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','lodash','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','save','update','error','stack','name','send','index','ZohoField','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','sort'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0xbfc0,0x115));var _0x0bfc=function(_0x263a2f,_0x1e81e3){_0x263a2f=_0x263a2f-0x0;var _0x8020e8=_0xbfc0[_0x263a2f];return _0x8020e8;};'use strict';var pdf=require(_0x0bfc('0x0'));var emlformat=require(_0x0bfc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0bfc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bfc('0x3'));var moment=require(_0x0bfc('0x4'));var BPromise=require(_0x0bfc('0x5'));var Mustache=require('mustache');var util=require(_0x0bfc('0x6'));var path=require(_0x0bfc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0bfc('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0bfc('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x0bfc('0xa'));var querystring=require(_0x0bfc('0xb'));var Papa=require(_0x0bfc('0xc'));var authService=require(_0x0bfc('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x0bfc('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x0bfc('0xf'));var config=require('../../config/environment');var db=require(_0x0bfc('0x10'))['db'];function respondWithStatusCode(_0x29cf86,_0x9ee167){_0x9ee167=_0x9ee167||0xcc;return function(_0x259b30){if(_0x259b30){return _0x29cf86[_0x0bfc('0x11')](_0x9ee167);}return _0x29cf86[_0x0bfc('0x12')](_0x9ee167)[_0x0bfc('0x13')]();};}function respondWithResult(_0x399c1a,_0x3155e1){_0x3155e1=_0x3155e1||0xc8;return function(_0x357c45){if(_0x357c45){return _0x399c1a[_0x0bfc('0x12')](_0x3155e1)[_0x0bfc('0x14')](_0x357c45);}};}function respondWithFilteredResult(_0x1b8e46,_0x4e06cd){return function(_0x31babe){if(_0x31babe){var _0x434f33=_0x31babe[_0x0bfc('0x15')],_0x5971fb=_0x4e06cd[_0x0bfc('0x16')],_0x40f312=_0x4e06cd['offset']+_0x4e06cd[_0x0bfc('0x17')],_0x1defb0;if(_0x40f312>=_0x434f33){_0x40f312=_0x434f33;_0x1defb0=0xc8;}else{_0x1defb0=0xce;}_0x1b8e46['status'](_0x1defb0);return _0x1b8e46['set']('Content-Range',_0x5971fb+'-'+_0x40f312+'/'+_0x434f33)[_0x0bfc('0x14')](_0x31babe);}return null;};}function patchUpdates(_0x3933aa){return function(_0x408e67){try{jsonpatch[_0x0bfc('0x18')](_0x408e67,_0x3933aa,!![]);}catch(_0x4b7dfd){return BPromise['reject'](_0x4b7dfd);}return _0x408e67[_0x0bfc('0x19')]();};}function saveUpdates(_0x5a5c00,_0x109a05){return function(_0x316e70){if(_0x316e70){return _0x316e70[_0x0bfc('0x1a')](_0x5a5c00)['then'](function(_0x575700){return _0x575700;});}return null;};}function removeEntity(_0x4a8225,_0x488f3d){return function(_0x13a8a0){if(_0x13a8a0){return _0x13a8a0['destroy']()['then'](function(){_0x4a8225[_0x0bfc('0x12')](0xcc)[_0x0bfc('0x13')]();});}};}function handleEntityNotFound(_0x45bda4,_0x3928b2){return function(_0x2fe950){if(!_0x2fe950){_0x45bda4[_0x0bfc('0x11')](0x194);}return _0x2fe950;};}function handleError(_0x518a5b,_0x1d665a){_0x1d665a=_0x1d665a||0x1f4;return function(_0x26db58){logger[_0x0bfc('0x1b')](_0x26db58[_0x0bfc('0x1c')]);if(_0x26db58[_0x0bfc('0x1d')]){delete _0x26db58[_0x0bfc('0x1d')];}_0x518a5b[_0x0bfc('0x12')](_0x1d665a)[_0x0bfc('0x1e')](_0x26db58);};}exports[_0x0bfc('0x1f')]=function(_0x2f704b,_0x4b56ff){var _0x50c7cb={},_0xe9452d={},_0x469199={'count':0x0,'rows':[]};var _0x3616f1=db[_0x0bfc('0x20')][_0x0bfc('0x21')];_0xe9452d['model']=_[_0x0bfc('0x22')](_0x3616f1);_0xe9452d[_0x0bfc('0x23')]=_[_0x0bfc('0x22')](_0x2f704b[_0x0bfc('0x23')]);_0xe9452d['filters']=_[_0x0bfc('0x24')](_0xe9452d[_0x0bfc('0x25')],_0xe9452d['query']);_0x50c7cb[_0x0bfc('0x26')]=_[_0x0bfc('0x24')](_0xe9452d[_0x0bfc('0x25')],qs[_0x0bfc('0x27')](_0x2f704b[_0x0bfc('0x23')]['fields']));_0x50c7cb[_0x0bfc('0x26')]=_0x50c7cb['attributes'][_0x0bfc('0x28')]?_0x50c7cb[_0x0bfc('0x26')]:_0xe9452d[_0x0bfc('0x25')];if(!_0x2f704b[_0x0bfc('0x23')][_0x0bfc('0x29')]('nolimit')){_0x50c7cb[_0x0bfc('0x17')]=qs[_0x0bfc('0x17')](_0x2f704b[_0x0bfc('0x23')][_0x0bfc('0x17')]);_0x50c7cb[_0x0bfc('0x16')]=qs[_0x0bfc('0x16')](_0x2f704b[_0x0bfc('0x23')][_0x0bfc('0x16')]);}_0x50c7cb['order']=qs[_0x0bfc('0x2a')](_0x2f704b['query'][_0x0bfc('0x2a')]);_0x50c7cb['where']=qs['filters'](_['pick'](_0x2f704b[_0x0bfc('0x23')],_0xe9452d[_0x0bfc('0x2b')]));if(_0x2f704b[_0x0bfc('0x23')]['filter']){_0x50c7cb['where']=_['merge'](_0x50c7cb['where'],{'$or':_[_0x0bfc('0x2c')](_0x3616f1,function(_0x3a9ec1){if(_0x3a9ec1[_0x0bfc('0x2d')][_0x0bfc('0x2e')]!==_0x0bfc('0x2f')){var _0x4cb955={};_0x4cb955[_0x3a9ec1[_0x0bfc('0x30')]]={'$like':'%'+_0x2f704b[_0x0bfc('0x23')][_0x0bfc('0x31')]+'%'};return _0x4cb955;}})});}_0x50c7cb=_[_0x0bfc('0x32')]({},_0x50c7cb,_0x2f704b['options']);var _0x4281b1={'where':_0x50c7cb[_0x0bfc('0x33')]};return db[_0x0bfc('0x20')][_0x0bfc('0x15')](_0x4281b1)[_0x0bfc('0x34')](function(_0x2afa14){_0x469199[_0x0bfc('0x15')]=_0x2afa14;if(_0x2f704b[_0x0bfc('0x23')][_0x0bfc('0x35')]){_0x50c7cb[_0x0bfc('0x36')]=[{'all':!![]}];}return db['ZohoField'][_0x0bfc('0x37')](_0x50c7cb);})[_0x0bfc('0x34')](function(_0x579e9f){_0x469199['rows']=_0x579e9f;return _0x469199;})['then'](respondWithFilteredResult(_0x4b56ff,_0x50c7cb))[_0x0bfc('0x38')](handleError(_0x4b56ff,null));};exports[_0x0bfc('0x39')]=function(_0x3d8e32,_0x23ed14){var _0x1bdb2d={'raw':!![],'where':{'id':_0x3d8e32[_0x0bfc('0x3a')]['id']}},_0x37a19b={};_0x37a19b[_0x0bfc('0x25')]=_[_0x0bfc('0x22')](db[_0x0bfc('0x20')][_0x0bfc('0x21')]);_0x37a19b['query']=_[_0x0bfc('0x22')](_0x3d8e32[_0x0bfc('0x23')]);_0x37a19b[_0x0bfc('0x2b')]=_[_0x0bfc('0x24')](_0x37a19b[_0x0bfc('0x25')],_0x37a19b[_0x0bfc('0x23')]);_0x1bdb2d['attributes']=_['intersection'](_0x37a19b['model'],qs[_0x0bfc('0x27')](_0x3d8e32[_0x0bfc('0x23')][_0x0bfc('0x27')]));_0x1bdb2d['attributes']=_0x1bdb2d[_0x0bfc('0x26')][_0x0bfc('0x28')]?_0x1bdb2d[_0x0bfc('0x26')]:_0x37a19b[_0x0bfc('0x25')];if(_0x3d8e32[_0x0bfc('0x23')][_0x0bfc('0x35')]){_0x1bdb2d[_0x0bfc('0x36')]=[{'all':!![]}];}_0x1bdb2d=_[_0x0bfc('0x32')]({},_0x1bdb2d,_0x3d8e32[_0x0bfc('0x3b')]);return db[_0x0bfc('0x20')][_0x0bfc('0x3c')](_0x1bdb2d)[_0x0bfc('0x34')](handleEntityNotFound(_0x23ed14,null))[_0x0bfc('0x34')](respondWithResult(_0x23ed14,null))[_0x0bfc('0x38')](handleError(_0x23ed14,null));};exports[_0x0bfc('0x3d')]=function(_0x2d21ed,_0x4f1ebf){return db[_0x0bfc('0x20')][_0x0bfc('0x3d')](_0x2d21ed[_0x0bfc('0x3e')],{})[_0x0bfc('0x34')](respondWithResult(_0x4f1ebf,0xc9))[_0x0bfc('0x38')](handleError(_0x4f1ebf,null));};exports['update']=function(_0x50b414,_0x25f3cd){if(_0x50b414[_0x0bfc('0x3e')]['id']){delete _0x50b414[_0x0bfc('0x3e')]['id'];}return db['ZohoField'][_0x0bfc('0x3c')]({'where':{'id':_0x50b414[_0x0bfc('0x3a')]['id']}})[_0x0bfc('0x34')](handleEntityNotFound(_0x25f3cd,null))[_0x0bfc('0x34')](saveUpdates(_0x50b414[_0x0bfc('0x3e')],null))[_0x0bfc('0x34')](respondWithResult(_0x25f3cd,null))[_0x0bfc('0x38')](handleError(_0x25f3cd,null));};exports[_0x0bfc('0x3f')]=function(_0x15025d,_0x398b43){return db[_0x0bfc('0x20')]['find']({'where':{'id':_0x15025d['params']['id']}})[_0x0bfc('0x34')](handleEntityNotFound(_0x398b43,null))[_0x0bfc('0x34')](removeEntity(_0x398b43,null))[_0x0bfc('0x38')](handleError(_0x398b43,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 8083b05..4b7023b 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 _0x2525=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x2525,0x1f0));var _0x5252=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x2525[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x5252('0x0'));var util=require(_0x5252('0x1'));var logger=require(_0x5252('0x2'))(_0x5252('0x3'));var moment=require(_0x5252('0x4'));var BPromise=require(_0x5252('0x5'));var rp=require(_0x5252('0x6'));var attributes=require(_0x5252('0x7'));module[_0x5252('0x8')]=function(_0x4907eb,_0x4a73a2){return _0x4907eb[_0x5252('0x9')](_0x5252('0xa'),attributes,{'tableName':_0x5252('0xb'),'paranoid':![],'indexes':[{'name':_0x5252('0xc'),'fields':[_0x5252('0xd'),_0x5252('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x756f=['util','../../config/logger','api','bluebird','request-promise','./intZohoField.attributes','exports','ZohoField','zoho_unique_index','idField','FieldId','lodash'];(function(_0x5e5720,_0x239782){var _0x32abb1=function(_0x34fa48){while(--_0x34fa48){_0x5e5720['push'](_0x5e5720['shift']());}};_0x32abb1(++_0x239782);}(_0x756f,0x137));var _0xf756=function(_0x2f4ab6,_0x271ad4){_0x2f4ab6=_0x2f4ab6-0x0;var _0x1d8027=_0x756f[_0x2f4ab6];return _0x1d8027;};'use strict';var _=require(_0xf756('0x0'));var util=require(_0xf756('0x1'));var logger=require(_0xf756('0x2'))(_0xf756('0x3'));var moment=require('moment');var BPromise=require(_0xf756('0x4'));var rp=require(_0xf756('0x5'));var attributes=require(_0xf756('0x6'));module[_0xf756('0x7')]=function(_0xa001d3,_0x532d13){return _0xa001d3['define'](_0xf756('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xf756('0x9'),'fields':[_0xf756('0xa'),_0xf756('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index c604059..edb7a97 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 _0x007e=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoField,\x20%s,\x20%s','message'];(function(_0x209603,_0x351b88){var _0x3e06d4=function(_0x4e9655){while(--_0x4e9655){_0x209603['push'](_0x209603['shift']());}};_0x3e06d4(++_0x351b88);}(_0x007e,0x193));var _0xe007=function(_0x42d1a1,_0x12c206){_0x42d1a1=_0x42d1a1-0x0;var _0x116879=_0x007e[_0x42d1a1];return _0x116879;};'use strict';var _=require(_0xe007('0x0'));var util=require(_0xe007('0x1'));var moment=require(_0xe007('0x2'));var BPromise=require(_0xe007('0x3'));var rs=require(_0xe007('0x4'));var fs=require('fs');var Redis=require(_0xe007('0x5'));var db=require(_0xe007('0x6'))['db'];var utils=require(_0xe007('0x7'));var logger=require(_0xe007('0x8'))(_0xe007('0x9'));var config=require(_0xe007('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe007('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x158d1b,_0xc05f38,_0x545f73){return new BPromise(function(_0x37ebbd,_0x32bc40){return client[_0xe007('0xc')](_0x158d1b,_0x545f73)[_0xe007('0xd')](function(_0x44d1ec){logger['info']('ZohoField,\x20%s,\x20%s',_0xc05f38,'request\x20sent');logger[_0xe007('0xe')](_0xe007('0xf'),_0xc05f38,_0xe007('0x10'),JSON[_0xe007('0x11')](_0x44d1ec));if(_0x44d1ec[_0xe007('0x12')]){if(_0x44d1ec[_0xe007('0x12')][_0xe007('0x13')]===0x1f4){logger[_0xe007('0x12')](_0xe007('0x14'),_0xc05f38,_0x44d1ec[_0xe007('0x12')]['message']);return _0x32bc40(_0x44d1ec[_0xe007('0x12')][_0xe007('0x15')]);}logger[_0xe007('0x12')](_0xe007('0x14'),_0xc05f38,_0x44d1ec[_0xe007('0x12')][_0xe007('0x15')]);return _0x37ebbd(_0x44d1ec[_0xe007('0x12')][_0xe007('0x15')]);}else{logger[_0xe007('0x16')](_0xe007('0x14'),_0xc05f38,_0xe007('0x10'));_0x37ebbd(_0x44d1ec[_0xe007('0x17')][_0xe007('0x15')]);}})[_0xe007('0x18')](function(_0x5a8d9a){logger[_0xe007('0x12')](_0xe007('0x14'),_0xc05f38,_0x5a8d9a);_0x32bc40(_0x5a8d9a);});});} \ No newline at end of file +var _0xd552=['ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x1254c8,_0x34e836){var _0x4c2496=function(_0x2e84ad){while(--_0x2e84ad){_0x1254c8['push'](_0x1254c8['shift']());}};_0x4c2496(++_0x34e836);}(_0xd552,0x103));var _0x2d55=function(_0xc70ce0,_0x2dadf5){_0xc70ce0=_0xc70ce0-0x0;var _0x6d78b9=_0xd552[_0xc70ce0];return _0x6d78b9;};'use strict';var _=require(_0x2d55('0x0'));var util=require(_0x2d55('0x1'));var moment=require(_0x2d55('0x2'));var BPromise=require('bluebird');var rs=require(_0x2d55('0x3'));var fs=require('fs');var Redis=require(_0x2d55('0x4'));var db=require(_0x2d55('0x5'))['db'];var utils=require(_0x2d55('0x6'));var logger=require(_0x2d55('0x7'))('rpc');var config=require(_0x2d55('0x8'));var jayson=require(_0x2d55('0x9'));var client=jayson[_0x2d55('0xa')][_0x2d55('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c7c66,_0x210faf,_0x30f796){return new BPromise(function(_0x42e4c2,_0x5ac87f){return client['request'](_0x4c7c66,_0x30f796)[_0x2d55('0xc')](function(_0xc995f8){logger[_0x2d55('0xd')](_0x2d55('0xe'),_0x210faf,_0x2d55('0xf'));logger[_0x2d55('0x10')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x210faf,_0x2d55('0xf'),JSON[_0x2d55('0x11')](_0xc995f8));if(_0xc995f8[_0x2d55('0x12')]){if(_0xc995f8[_0x2d55('0x12')]['code']===0x1f4){logger[_0x2d55('0x12')](_0x2d55('0xe'),_0x210faf,_0xc995f8[_0x2d55('0x12')][_0x2d55('0x13')]);return _0x5ac87f(_0xc995f8[_0x2d55('0x12')][_0x2d55('0x13')]);}logger[_0x2d55('0x12')](_0x2d55('0xe'),_0x210faf,_0xc995f8[_0x2d55('0x12')]['message']);return _0x42e4c2(_0xc995f8[_0x2d55('0x12')]['message']);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x210faf,_0x2d55('0xf'));_0x42e4c2(_0xc995f8[_0x2d55('0x14')][_0x2d55('0x13')]);}})['catch'](function(_0x283b95){logger[_0x2d55('0x12')](_0x2d55('0xe'),_0x210faf,_0x283b95);_0x5ac87f(_0x283b95);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index c46d84c..ef4107c 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 _0xce68=['Router','../../components/auth/service','../../config/environment','exports','multer','path','connect-timeout','express'];(function(_0x327f60,_0x3f5282){var _0x2090e6=function(_0x212e9b){while(--_0x212e9b){_0x327f60['push'](_0x327f60['shift']());}};_0x2090e6(++_0x3f5282);}(_0xce68,0x10c));var _0x8ce6=function(_0x25ba6c,_0x353f7f){_0x25ba6c=_0x25ba6c-0x0;var _0x4a5a87=_0xce68[_0x25ba6c];return _0x4a5a87;};'use strict';var multer=require(_0x8ce6('0x0'));var util=require('util');var path=require(_0x8ce6('0x1'));var timeout=require(_0x8ce6('0x2'));var express=require(_0x8ce6('0x3'));var router=express[_0x8ce6('0x4')]();var auth=require(_0x8ce6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8ce6('0x6'));module[_0x8ce6('0x7')]=router; \ No newline at end of file +var _0xb96d=['../../components/auth/service','../../components/interaction/service','util','path','connect-timeout','Router'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xb96d,0x9e));var _0xdb96=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0xb96d[_0x408e38];return _0x426b0e;};'use strict';var multer=require('multer');var util=require(_0xdb96('0x0'));var path=require(_0xdb96('0x1'));var timeout=require(_0xdb96('0x2'));var express=require('express');var router=express[_0xdb96('0x3')]();var auth=require(_0xdb96('0x4'));var interaction=require(_0xdb96('0x5'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 3e7004a..2050ea9 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 _0xb385=['state','sequelize','exports','STRING','unique_name_and_version','INTEGER'];(function(_0x535bb1,_0x547f03){var _0x551953=function(_0x5b4efd){while(--_0x5b4efd){_0x535bb1['push'](_0x535bb1['shift']());}};_0x551953(++_0x547f03);}(_0xb385,0x1ed));var _0x5b38=function(_0x125045,_0x24c751){_0x125045=_0x125045-0x0;var _0x371a2b=_0xb385[_0x125045];return _0x371a2b;};'use strict';var Sequelize=require(_0x5b38('0x0'));module[_0x5b38('0x1')]={'name':{'type':Sequelize[_0x5b38('0x2')],'allowNull':![],'unique':_0x5b38('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5b38('0x3')},'main':{'type':Sequelize[_0x5b38('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x5b38('0x2')]},'path':{'type':Sequelize[_0x5b38('0x2')]},'type':{'type':Sequelize[_0x5b38('0x2')]},'size':{'type':Sequelize[_0x5b38('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x5b38('0x2')]},'logo':{'type':Sequelize[_0x5b38('0x2')]},'state':{'type':Sequelize[_0x5b38('0x2')],'unique':_0x5b38('0x5')},'description':{'type':Sequelize[_0x5b38('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x5b38('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x4b18=['unique_name_and_version','app.js','INTEGER','sequelize','exports','STRING'];(function(_0x58b3ca,_0x4183bc){var _0x1dfab9=function(_0xa24c69){while(--_0xa24c69){_0x58b3ca['push'](_0x58b3ca['shift']());}};_0x1dfab9(++_0x4183bc);}(_0x4b18,0xe7));var _0x84b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b18[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x84b1('0x0'));module[_0x84b1('0x1')]={'name':{'type':Sequelize[_0x84b1('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x84b1('0x2')],'allowNull':![],'unique':_0x84b1('0x3')},'main':{'type':Sequelize[_0x84b1('0x2')],'defaultValue':_0x84b1('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x84b1('0x2')]},'type':{'type':Sequelize[_0x84b1('0x2')]},'size':{'type':Sequelize[_0x84b1('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x84b1('0x2')],'unique':'state'},'description':{'type':Sequelize[_0x84b1('0x2')]},'title':{'type':Sequelize[_0x84b1('0x2')]},'remoteUri':{'type':Sequelize[_0x84b1('0x2')]},'link':{'type':Sequelize[_0x84b1('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 860046d..a35b69e 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 _0x3870=['api','../../config/utils','../../config/environment','end','status','json','count','offset','limit','set','apply','reject','save','update','then','sendStatus','stack','name','send','index','Integration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','order','sort','pick','filter','where','merge','type','key','VIRTUAL','field','includeAll','include','rows','catch','show','length','find','create','body','params','destroy','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger'];(function(_0x44be99,_0x5b8798){var _0x2f9464=function(_0xd7e1c9){while(--_0xd7e1c9){_0x44be99['push'](_0x44be99['shift']());}};_0x2f9464(++_0x5b8798);}(_0x3870,0x146));var _0x0387=function(_0x5ae5c0,_0x2da2ed){_0x5ae5c0=_0x5ae5c0-0x0;var _0x252ca6=_0x3870[_0x5ae5c0];return _0x252ca6;};'use strict';var pdf=require(_0x0387('0x0'));var emlformat=require(_0x0387('0x1'));var rimraf=require(_0x0387('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0387('0x3'));var rp=require('request-promise');var moment=require(_0x0387('0x4'));var BPromise=require(_0x0387('0x5'));var Mustache=require('mustache');var util=require(_0x0387('0x6'));var path=require(_0x0387('0x7'));var sox=require(_0x0387('0x8'));var csv=require('to-csv');var ejs=require(_0x0387('0x9'));var fs=require('fs');var _=require(_0x0387('0xa'));var squel=require(_0x0387('0xb'));var crypto=require(_0x0387('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0387('0xd'));var toCsv=require(_0x0387('0xe'));var querystring=require(_0x0387('0xf'));var Papa=require('papaparse');var authService=require(_0x0387('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x0387('0x11'));var logger=require(_0x0387('0x12'))(_0x0387('0x13'));var utils=require(_0x0387('0x14'));var config=require(_0x0387('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x284bc2,_0x6d7dc6){_0x6d7dc6=_0x6d7dc6||0xcc;return function(_0x37e90c){if(_0x37e90c){return _0x284bc2['sendStatus'](_0x6d7dc6);}return _0x284bc2['status'](_0x6d7dc6)[_0x0387('0x16')]();};}function respondWithResult(_0x5d82f5,_0x4fa340){_0x4fa340=_0x4fa340||0xc8;return function(_0x56db25){if(_0x56db25){return _0x5d82f5[_0x0387('0x17')](_0x4fa340)[_0x0387('0x18')](_0x56db25);}};}function respondWithFilteredResult(_0xaef05c,_0x4c49b8){return function(_0x5d4825){if(_0x5d4825){var _0x162e73=_0x5d4825[_0x0387('0x19')],_0x559407=_0x4c49b8[_0x0387('0x1a')],_0x3fc119=_0x4c49b8[_0x0387('0x1a')]+_0x4c49b8[_0x0387('0x1b')],_0x561ebd;if(_0x3fc119>=_0x162e73){_0x3fc119=_0x162e73;_0x561ebd=0xc8;}else{_0x561ebd=0xce;}_0xaef05c[_0x0387('0x17')](_0x561ebd);return _0xaef05c[_0x0387('0x1c')]('Content-Range',_0x559407+'-'+_0x3fc119+'/'+_0x162e73)[_0x0387('0x18')](_0x5d4825);}return null;};}function patchUpdates(_0x2fb755){return function(_0x29d3b0){try{jsonpatch[_0x0387('0x1d')](_0x29d3b0,_0x2fb755,!![]);}catch(_0x575e24){return BPromise[_0x0387('0x1e')](_0x575e24);}return _0x29d3b0[_0x0387('0x1f')]();};}function saveUpdates(_0x1791d8,_0x1ec522){return function(_0x18484e){if(_0x18484e){return _0x18484e[_0x0387('0x20')](_0x1791d8)[_0x0387('0x21')](function(_0x1f8d9a){return _0x1f8d9a;});}return null;};}function removeEntity(_0x1a0844,_0x42b8a8){return function(_0x4095cb){if(_0x4095cb){return _0x4095cb['destroy']()[_0x0387('0x21')](function(){_0x1a0844[_0x0387('0x17')](0xcc)[_0x0387('0x16')]();});}};}function handleEntityNotFound(_0x2a0bf7,_0x11654d){return function(_0x5923c2){if(!_0x5923c2){_0x2a0bf7[_0x0387('0x22')](0x194);}return _0x5923c2;};}function handleError(_0xf62ede,_0x1016ab){_0x1016ab=_0x1016ab||0x1f4;return function(_0x11ec89){logger['error'](_0x11ec89[_0x0387('0x23')]);if(_0x11ec89[_0x0387('0x24')]){delete _0x11ec89[_0x0387('0x24')];}_0xf62ede[_0x0387('0x17')](_0x1016ab)[_0x0387('0x25')](_0x11ec89);};}exports[_0x0387('0x26')]=function(_0x5975e3,_0x2d36a7){var _0x493fac={},_0x4ba247={},_0x3040d1={'count':0x0,'rows':[]};var _0x2dfe11=db[_0x0387('0x27')][_0x0387('0x28')];_0x4ba247[_0x0387('0x29')]=_[_0x0387('0x2a')](_0x2dfe11);_0x4ba247[_0x0387('0x2b')]=_['keys'](_0x5975e3['query']);_0x4ba247[_0x0387('0x2c')]=_[_0x0387('0x2d')](_0x4ba247[_0x0387('0x29')],_0x4ba247[_0x0387('0x2b')]);_0x493fac['attributes']=_['intersection'](_0x4ba247[_0x0387('0x29')],qs[_0x0387('0x2e')](_0x5975e3[_0x0387('0x2b')][_0x0387('0x2e')]));_0x493fac[_0x0387('0x2f')]=_0x493fac[_0x0387('0x2f')]['length']?_0x493fac[_0x0387('0x2f')]:_0x4ba247['model'];if(!_0x5975e3['query']['hasOwnProperty']('nolimit')){_0x493fac['limit']=qs[_0x0387('0x1b')](_0x5975e3['query'][_0x0387('0x1b')]);_0x493fac['offset']=qs[_0x0387('0x1a')](_0x5975e3['query']['offset']);}_0x493fac[_0x0387('0x30')]=qs['sort'](_0x5975e3['query'][_0x0387('0x31')]);_0x493fac['where']=qs[_0x0387('0x2c')](_[_0x0387('0x32')](_0x5975e3['query'],_0x4ba247[_0x0387('0x2c')]));if(_0x5975e3['query'][_0x0387('0x33')]){_0x493fac[_0x0387('0x34')]=_[_0x0387('0x35')](_0x493fac[_0x0387('0x34')],{'$or':_['map'](_0x2dfe11,function(_0x5e7c08){if(_0x5e7c08[_0x0387('0x36')][_0x0387('0x37')]!==_0x0387('0x38')){var _0x145e42={};_0x145e42[_0x5e7c08[_0x0387('0x39')]]={'$like':'%'+_0x5975e3[_0x0387('0x2b')]['filter']+'%'};return _0x145e42;}})});}_0x493fac=_[_0x0387('0x35')]({},_0x493fac,_0x5975e3['options']);var _0x33958b={'where':_0x493fac[_0x0387('0x34')]};return db[_0x0387('0x27')][_0x0387('0x19')](_0x33958b)[_0x0387('0x21')](function(_0x40bec2){_0x3040d1[_0x0387('0x19')]=_0x40bec2;if(_0x5975e3['query'][_0x0387('0x3a')]){_0x493fac[_0x0387('0x3b')]=[{'all':!![]}];}return db[_0x0387('0x27')]['findAll'](_0x493fac);})[_0x0387('0x21')](function(_0x2bd495){_0x3040d1[_0x0387('0x3c')]=_0x2bd495;return _0x3040d1;})[_0x0387('0x21')](respondWithFilteredResult(_0x2d36a7,_0x493fac))[_0x0387('0x3d')](handleError(_0x2d36a7,null));};exports[_0x0387('0x3e')]=function(_0x8718b0,_0x50cc4d){var _0xa8a5a8={'raw':![],'where':{'id':_0x8718b0['params']['id']}},_0x452c08={};_0x452c08[_0x0387('0x29')]=_[_0x0387('0x2a')](db[_0x0387('0x27')][_0x0387('0x28')]);_0x452c08[_0x0387('0x2b')]=_[_0x0387('0x2a')](_0x8718b0[_0x0387('0x2b')]);_0x452c08['filters']=_[_0x0387('0x2d')](_0x452c08[_0x0387('0x29')],_0x452c08['query']);_0xa8a5a8[_0x0387('0x2f')]=_[_0x0387('0x2d')](_0x452c08[_0x0387('0x29')],qs[_0x0387('0x2e')](_0x8718b0[_0x0387('0x2b')][_0x0387('0x2e')]));_0xa8a5a8[_0x0387('0x2f')]=_0xa8a5a8[_0x0387('0x2f')][_0x0387('0x3f')]?_0xa8a5a8[_0x0387('0x2f')]:_0x452c08[_0x0387('0x29')];if(_0x8718b0[_0x0387('0x2b')]['includeAll']){_0xa8a5a8[_0x0387('0x3b')]=[{'all':!![]}];}_0xa8a5a8=_[_0x0387('0x35')]({},_0xa8a5a8,_0x8718b0['options']);return db['Integration'][_0x0387('0x40')](_0xa8a5a8)[_0x0387('0x21')](handleEntityNotFound(_0x50cc4d,null))[_0x0387('0x21')](respondWithResult(_0x50cc4d,null))[_0x0387('0x3d')](handleError(_0x50cc4d,null));};exports[_0x0387('0x41')]=function(_0x2d614d,_0x4a8672){return db[_0x0387('0x27')]['create'](_0x2d614d[_0x0387('0x42')],{})['then'](respondWithResult(_0x4a8672,0xc9))[_0x0387('0x3d')](handleError(_0x4a8672,null));};exports[_0x0387('0x20')]=function(_0x2e0a93,_0x1ca0e7){if(_0x2e0a93['body']['id']){delete _0x2e0a93[_0x0387('0x42')]['id'];}return db[_0x0387('0x27')][_0x0387('0x40')]({'where':{'id':_0x2e0a93[_0x0387('0x43')]['id']}})['then'](handleEntityNotFound(_0x1ca0e7,null))[_0x0387('0x21')](saveUpdates(_0x2e0a93[_0x0387('0x42')],null))['then'](respondWithResult(_0x1ca0e7,null))[_0x0387('0x3d')](handleError(_0x1ca0e7,null));};exports[_0x0387('0x44')]=function(_0xec3456,_0x61b4df){return db[_0x0387('0x27')][_0x0387('0x40')]({'where':{'id':_0xec3456['params']['id']}})[_0x0387('0x21')](handleEntityNotFound(_0x61b4df,null))[_0x0387('0x21')](removeEntity(_0x61b4df,null))[_0x0387('0x3d')](handleError(_0x61b4df,null));}; \ No newline at end of file +var _0x9348=['zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','apply','reject','save','update','then','destroy','stack','name','send','Integration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','count','findAll','params','includeAll','find','create','body','catch','html-pdf','eml-format','rimraf'];(function(_0x2ce8f1,_0x4ccbe7){var _0x466ce9=function(_0x53d29e){while(--_0x53d29e){_0x2ce8f1['push'](_0x2ce8f1['shift']());}};_0x466ce9(++_0x4ccbe7);}(_0x9348,0x10d));var _0x8934=function(_0x546680,_0x55ac3a){_0x546680=_0x546680-0x0;var _0x142c9b=_0x9348[_0x546680];return _0x142c9b;};'use strict';var pdf=require(_0x8934('0x0'));var emlformat=require(_0x8934('0x1'));var rimraf=require(_0x8934('0x2'));var zipdir=require(_0x8934('0x3'));var jsonpatch=require(_0x8934('0x4'));var rp=require('request-promise');var moment=require(_0x8934('0x5'));var BPromise=require(_0x8934('0x6'));var Mustache=require('mustache');var util=require(_0x8934('0x7'));var path=require(_0x8934('0x8'));var sox=require(_0x8934('0x9'));var csv=require(_0x8934('0xa'));var ejs=require(_0x8934('0xb'));var fs=require('fs');var _=require(_0x8934('0xc'));var squel=require('squel');var crypto=require(_0x8934('0xd'));var jsforce=require(_0x8934('0xe'));var deskjs=require(_0x8934('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x8934('0x10'));var Redis=require('ioredis');var qs=require(_0x8934('0x11'));var logger=require(_0x8934('0x12'))(_0x8934('0x13'));var utils=require(_0x8934('0x14'));var config=require(_0x8934('0x15'));var db=require(_0x8934('0x16'))['db'];function respondWithStatusCode(_0x41909f,_0xbb421b){_0xbb421b=_0xbb421b||0xcc;return function(_0x4a999c){if(_0x4a999c){return _0x41909f[_0x8934('0x17')](_0xbb421b);}return _0x41909f[_0x8934('0x18')](_0xbb421b)[_0x8934('0x19')]();};}function respondWithResult(_0x1906d0,_0xbc487e){_0xbc487e=_0xbc487e||0xc8;return function(_0xdf59f4){if(_0xdf59f4){return _0x1906d0['status'](_0xbc487e)[_0x8934('0x1a')](_0xdf59f4);}};}function respondWithFilteredResult(_0x38230a,_0xdfc97c){return function(_0x94b948){if(_0x94b948){var _0x34d4dc=_0x94b948['count'],_0x41e6a9=_0xdfc97c[_0x8934('0x1b')],_0x2a5b04=_0xdfc97c[_0x8934('0x1b')]+_0xdfc97c[_0x8934('0x1c')],_0x357cf8;if(_0x2a5b04>=_0x34d4dc){_0x2a5b04=_0x34d4dc;_0x357cf8=0xc8;}else{_0x357cf8=0xce;}_0x38230a['status'](_0x357cf8);return _0x38230a['set']('Content-Range',_0x41e6a9+'-'+_0x2a5b04+'/'+_0x34d4dc)[_0x8934('0x1a')](_0x94b948);}return null;};}function patchUpdates(_0x51f9ed){return function(_0xe64ebd){try{jsonpatch[_0x8934('0x1d')](_0xe64ebd,_0x51f9ed,!![]);}catch(_0x14b4e4){return BPromise[_0x8934('0x1e')](_0x14b4e4);}return _0xe64ebd[_0x8934('0x1f')]();};}function saveUpdates(_0x5024e9,_0xf3998){return function(_0x5ae49f){if(_0x5ae49f){return _0x5ae49f[_0x8934('0x20')](_0x5024e9)[_0x8934('0x21')](function(_0x1ccbe5){return _0x1ccbe5;});}return null;};}function removeEntity(_0x379445,_0x2500ec){return function(_0x331e18){if(_0x331e18){return _0x331e18[_0x8934('0x22')]()['then'](function(){_0x379445[_0x8934('0x18')](0xcc)[_0x8934('0x19')]();});}};}function handleEntityNotFound(_0x32020a,_0x343e09){return function(_0x43b89a){if(!_0x43b89a){_0x32020a['sendStatus'](0x194);}return _0x43b89a;};}function handleError(_0x3cf295,_0x1c15c5){_0x1c15c5=_0x1c15c5||0x1f4;return function(_0x1b5775){logger['error'](_0x1b5775[_0x8934('0x23')]);if(_0x1b5775['name']){delete _0x1b5775[_0x8934('0x24')];}_0x3cf295[_0x8934('0x18')](_0x1c15c5)[_0x8934('0x25')](_0x1b5775);};}exports['index']=function(_0x1fd5eb,_0x15910b){var _0x310454={},_0x50b89e={},_0x4b5780={'count':0x0,'rows':[]};var _0x3db790=db[_0x8934('0x26')][_0x8934('0x27')];_0x50b89e[_0x8934('0x28')]=_[_0x8934('0x29')](_0x3db790);_0x50b89e[_0x8934('0x2a')]=_[_0x8934('0x29')](_0x1fd5eb[_0x8934('0x2a')]);_0x50b89e[_0x8934('0x2b')]=_[_0x8934('0x2c')](_0x50b89e['model'],_0x50b89e[_0x8934('0x2a')]);_0x310454[_0x8934('0x2d')]=_['intersection'](_0x50b89e[_0x8934('0x28')],qs[_0x8934('0x2e')](_0x1fd5eb[_0x8934('0x2a')][_0x8934('0x2e')]));_0x310454['attributes']=_0x310454[_0x8934('0x2d')][_0x8934('0x2f')]?_0x310454[_0x8934('0x2d')]:_0x50b89e[_0x8934('0x28')];if(!_0x1fd5eb[_0x8934('0x2a')]['hasOwnProperty'](_0x8934('0x30'))){_0x310454['limit']=qs['limit'](_0x1fd5eb[_0x8934('0x2a')][_0x8934('0x1c')]);_0x310454[_0x8934('0x1b')]=qs[_0x8934('0x1b')](_0x1fd5eb['query'][_0x8934('0x1b')]);}_0x310454[_0x8934('0x31')]=qs[_0x8934('0x32')](_0x1fd5eb[_0x8934('0x2a')][_0x8934('0x32')]);_0x310454['where']=qs[_0x8934('0x2b')](_[_0x8934('0x33')](_0x1fd5eb['query'],_0x50b89e['filters']));if(_0x1fd5eb[_0x8934('0x2a')][_0x8934('0x34')]){_0x310454['where']=_['merge'](_0x310454[_0x8934('0x35')],{'$or':_[_0x8934('0x36')](_0x3db790,function(_0x2f710a){if(_0x2f710a[_0x8934('0x37')][_0x8934('0x38')]!==_0x8934('0x39')){var _0x30f8c6={};_0x30f8c6[_0x2f710a[_0x8934('0x3a')]]={'$like':'%'+_0x1fd5eb[_0x8934('0x2a')][_0x8934('0x34')]+'%'};return _0x30f8c6;}})});}_0x310454=_[_0x8934('0x3b')]({},_0x310454,_0x1fd5eb['options']);var _0x31c805={'where':_0x310454[_0x8934('0x35')]};return db['Integration'][_0x8934('0x3c')](_0x31c805)[_0x8934('0x21')](function(_0x414091){_0x4b5780[_0x8934('0x3c')]=_0x414091;if(_0x1fd5eb[_0x8934('0x2a')]['includeAll']){_0x310454['include']=[{'all':!![]}];}return db['Integration'][_0x8934('0x3d')](_0x310454);})[_0x8934('0x21')](function(_0x8814f6){_0x4b5780['rows']=_0x8814f6;return _0x4b5780;})[_0x8934('0x21')](respondWithFilteredResult(_0x15910b,_0x310454))['catch'](handleError(_0x15910b,null));};exports['show']=function(_0x332098,_0x1f36d0){var _0x533eee={'raw':![],'where':{'id':_0x332098[_0x8934('0x3e')]['id']}},_0x52b95f={};_0x52b95f[_0x8934('0x28')]=_[_0x8934('0x29')](db['Integration'][_0x8934('0x27')]);_0x52b95f['query']=_[_0x8934('0x29')](_0x332098['query']);_0x52b95f[_0x8934('0x2b')]=_[_0x8934('0x2c')](_0x52b95f[_0x8934('0x28')],_0x52b95f['query']);_0x533eee[_0x8934('0x2d')]=_[_0x8934('0x2c')](_0x52b95f[_0x8934('0x28')],qs[_0x8934('0x2e')](_0x332098['query'][_0x8934('0x2e')]));_0x533eee[_0x8934('0x2d')]=_0x533eee[_0x8934('0x2d')][_0x8934('0x2f')]?_0x533eee[_0x8934('0x2d')]:_0x52b95f[_0x8934('0x28')];if(_0x332098[_0x8934('0x2a')][_0x8934('0x3f')]){_0x533eee['include']=[{'all':!![]}];}_0x533eee=_['merge']({},_0x533eee,_0x332098['options']);return db[_0x8934('0x26')][_0x8934('0x40')](_0x533eee)['then'](handleEntityNotFound(_0x1f36d0,null))[_0x8934('0x21')](respondWithResult(_0x1f36d0,null))['catch'](handleError(_0x1f36d0,null));};exports[_0x8934('0x41')]=function(_0x170fbf,_0x4be80d){return db[_0x8934('0x26')][_0x8934('0x41')](_0x170fbf[_0x8934('0x42')],{})[_0x8934('0x21')](respondWithResult(_0x4be80d,0xc9))['catch'](handleError(_0x4be80d,null));};exports[_0x8934('0x20')]=function(_0xa35ac9,_0x5991fc){if(_0xa35ac9[_0x8934('0x42')]['id']){delete _0xa35ac9[_0x8934('0x42')]['id'];}return db[_0x8934('0x26')][_0x8934('0x40')]({'where':{'id':_0xa35ac9[_0x8934('0x3e')]['id']}})[_0x8934('0x21')](handleEntityNotFound(_0x5991fc,null))[_0x8934('0x21')](saveUpdates(_0xa35ac9[_0x8934('0x42')],null))[_0x8934('0x21')](respondWithResult(_0x5991fc,null))[_0x8934('0x43')](handleError(_0x5991fc,null));};exports[_0x8934('0x22')]=function(_0xe212bc,_0x2c322d){return db[_0x8934('0x26')][_0x8934('0x40')]({'where':{'id':_0xe212bc[_0x8934('0x3e')]['id']}})[_0x8934('0x21')](handleEntityNotFound(_0x2c322d,null))[_0x8934('0x21')](removeEntity(_0x2c322d,null))['catch'](handleError(_0x2c322d,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index fa085c2..3bb1627 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 _0x1a85=['moment','./integration.attributes','exports','define','integrations','../../config/logger','api'];(function(_0x5a02ca,_0x41dc85){var _0x23c2d1=function(_0x45dd17){while(--_0x45dd17){_0x5a02ca['push'](_0x5a02ca['shift']());}};_0x23c2d1(++_0x41dc85);}(_0x1a85,0x178));var _0x51a8=function(_0x5b25af,_0x121dd7){_0x5b25af=_0x5b25af-0x0;var _0x181a07=_0x1a85[_0x5b25af];return _0x181a07;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x51a8('0x3'));module[_0x51a8('0x4')]=function(_0x99e371,_0x48a21b){return _0x99e371[_0x51a8('0x5')]('Integration',attributes,{'tableName':_0x51a8('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['../../config/logger','api','moment','bluebird','define','Integration','integrations','lodash','util'];(function(_0xc0374e,_0x2de1fc){var _0x3cabe1=function(_0x2cfcae){while(--_0x2cfcae){_0xc0374e['push'](_0xc0374e['shift']());}};_0x3cabe1(++_0x2de1fc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var attributes=require('./integration.attributes');module['exports']=function(_0x2f48ed,_0x15b967){return _0x2f48ed[_0xac4a('0x6')](_0xac4a('0x7'),attributes,{'tableName':_0xac4a('0x8'),'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 4a0013f..688ee04 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 _0xc0ab=['Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x17d05a,_0x12b393){var _0x583f4c=function(_0x435d04){while(--_0x435d04){_0x17d05a['push'](_0x17d05a['shift']());}};_0x583f4c(++_0x12b393);}(_0xc0ab,0x14b));var _0xbc0a=function(_0x85f059,_0x27d70e){_0x85f059=_0x85f059-0x0;var _0x3520f7=_0xc0ab[_0x85f059];return _0x3520f7;};'use strict';var _=require(_0xbc0a('0x0'));var util=require(_0xbc0a('0x1'));var moment=require(_0xbc0a('0x2'));var BPromise=require(_0xbc0a('0x3'));var rs=require(_0xbc0a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbc0a('0x5'));var logger=require(_0xbc0a('0x6'))('rpc');var config=require(_0xbc0a('0x7'));var jayson=require(_0xbc0a('0x8'));var client=jayson[_0xbc0a('0x9')][_0xbc0a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f4fec,_0x4e8ada,_0xb44624){return new BPromise(function(_0x4f031a,_0x2d9e14){return client[_0xbc0a('0xb')](_0x4f4fec,_0xb44624)[_0xbc0a('0xc')](function(_0x105b70){logger[_0xbc0a('0xd')](_0xbc0a('0xe'),_0x4e8ada,_0xbc0a('0xf'));logger[_0xbc0a('0x10')]('Integration,\x20%s,\x20%s,\x20%s',_0x4e8ada,_0xbc0a('0xf'),JSON[_0xbc0a('0x11')](_0x105b70));if(_0x105b70['error']){if(_0x105b70[_0xbc0a('0x12')][_0xbc0a('0x13')]===0x1f4){logger[_0xbc0a('0x12')](_0xbc0a('0xe'),_0x4e8ada,_0x105b70[_0xbc0a('0x12')][_0xbc0a('0x14')]);return _0x2d9e14(_0x105b70[_0xbc0a('0x12')]['message']);}logger['error']('Integration,\x20%s,\x20%s',_0x4e8ada,_0x105b70['error'][_0xbc0a('0x14')]);return _0x4f031a(_0x105b70['error']['message']);}else{logger[_0xbc0a('0xd')](_0xbc0a('0xe'),_0x4e8ada,_0xbc0a('0xf'));_0x4f031a(_0x105b70[_0xbc0a('0x15')][_0xbc0a('0x14')]);}})[_0xbc0a('0x16')](function(_0x2c87e9){logger['error']('Integration,\x20%s,\x20%s',_0x4e8ada,_0x2c87e9);_0x2d9e14(_0x2c87e9);});});} \ No newline at end of file +var _0xe2fc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis'];(function(_0x188ee2,_0x507bba){var _0x4e1fa2=function(_0x11c526){while(--_0x11c526){_0x188ee2['push'](_0x188ee2['shift']());}};_0x4e1fa2(++_0x507bba);}(_0xe2fc,0x1df));var _0xce2f=function(_0x24ce70,_0x15557b){_0x24ce70=_0x24ce70-0x0;var _0x16651a=_0xe2fc[_0x24ce70];return _0x16651a;};'use strict';var _=require(_0xce2f('0x0'));var util=require('util');var moment=require(_0xce2f('0x1'));var BPromise=require('bluebird');var rs=require(_0xce2f('0x2'));var fs=require('fs');var Redis=require(_0xce2f('0x3'));var db=require(_0xce2f('0x4'))['db'];var utils=require(_0xce2f('0x5'));var logger=require(_0xce2f('0x6'))(_0xce2f('0x7'));var config=require(_0xce2f('0x8'));var jayson=require(_0xce2f('0x9'));var client=jayson[_0xce2f('0xa')][_0xce2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c0e31,_0x124411,_0x1042a5){return new BPromise(function(_0xb43ce2,_0x3a0b1c){return client['request'](_0x2c0e31,_0x1042a5)[_0xce2f('0xc')](function(_0x3478ce){logger[_0xce2f('0xd')](_0xce2f('0xe'),_0x124411,_0xce2f('0xf'));logger[_0xce2f('0x10')]('Integration,\x20%s,\x20%s,\x20%s',_0x124411,_0xce2f('0xf'),JSON[_0xce2f('0x11')](_0x3478ce));if(_0x3478ce[_0xce2f('0x12')]){if(_0x3478ce[_0xce2f('0x12')][_0xce2f('0x13')]===0x1f4){logger['error'](_0xce2f('0xe'),_0x124411,_0x3478ce[_0xce2f('0x12')][_0xce2f('0x14')]);return _0x3a0b1c(_0x3478ce[_0xce2f('0x12')][_0xce2f('0x14')]);}logger[_0xce2f('0x12')](_0xce2f('0xe'),_0x124411,_0x3478ce[_0xce2f('0x12')]['message']);return _0xb43ce2(_0x3478ce[_0xce2f('0x12')][_0xce2f('0x14')]);}else{logger['info'](_0xce2f('0xe'),_0x124411,_0xce2f('0xf'));_0xb43ce2(_0x3478ce[_0xce2f('0x15')][_0xce2f('0x14')]);}})[_0xce2f('0x16')](function(_0x5939a6){logger[_0xce2f('0x12')](_0xce2f('0xe'),_0x124411,_0x5939a6);_0x3a0b1c(_0x5939a6);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 2d288b2..a29f6aa 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 _0xa9bb=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put'];(function(_0x421ce1,_0x10c772){var _0x57c710=function(_0x3490a0){while(--_0x3490a0){_0x421ce1['push'](_0x421ce1['shift']());}};_0x57c710(++_0x10c772);}(_0xa9bb,0x1bc));var _0xba9b=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xa9bb[_0x1b2ff7];return _0x31656a;};'use strict';var multer=require('multer');var util=require(_0xba9b('0x0'));var path=require(_0xba9b('0x1'));var timeout=require(_0xba9b('0x2'));var express=require(_0xba9b('0x3'));var router=express[_0xba9b('0x4')]();var auth=require(_0xba9b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xba9b('0x6'));var controller=require(_0xba9b('0x7'));router[_0xba9b('0x8')]('/',auth[_0xba9b('0x9')](),controller[_0xba9b('0xa')]);router[_0xba9b('0x8')](_0xba9b('0xb'),auth[_0xba9b('0x9')](),controller[_0xba9b('0xc')]);router[_0xba9b('0x8')](_0xba9b('0xd'),auth[_0xba9b('0x9')](),controller[_0xba9b('0xe')]);router['post']('/',auth[_0xba9b('0x9')](),controller['create']);router[_0xba9b('0xf')](_0xba9b('0xd'),auth[_0xba9b('0x9')](),controller[_0xba9b('0x10')]);router[_0xba9b('0x11')](_0xba9b('0xd'),auth[_0xba9b('0x9')](),controller[_0xba9b('0x12')]);module[_0xba9b('0x13')]=router; \ No newline at end of file +var _0x68f8=['multer','util','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated','/describe','describe','/:id','show','post','put','delete','destroy','exports'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x68f8,0x154));var _0x868f=function(_0x484ab6,_0x5627a5){_0x484ab6=_0x484ab6-0x0;var _0x333e67=_0x68f8[_0x484ab6];return _0x333e67;};'use strict';var multer=require(_0x868f('0x0'));var util=require(_0x868f('0x1'));var path=require(_0x868f('0x2'));var timeout=require(_0x868f('0x3'));var express=require(_0x868f('0x4'));var router=express['Router']();var auth=require(_0x868f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./integrationReport.controller');router[_0x868f('0x6')]('/',auth[_0x868f('0x7')](),controller['index']);router[_0x868f('0x6')](_0x868f('0x8'),auth['isAuthenticated'](),controller[_0x868f('0x9')]);router[_0x868f('0x6')](_0x868f('0xa'),auth['isAuthenticated'](),controller[_0x868f('0xb')]);router[_0x868f('0xc')]('/',auth[_0x868f('0x7')](),controller['create']);router[_0x868f('0xd')]('/:id',auth[_0x868f('0x7')](),controller['update']);router[_0x868f('0xe')](_0x868f('0xa'),auth['isAuthenticated'](),controller[_0x868f('0xf')]);module[_0x868f('0x10')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 485a3eb..36562c2 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 _0x5995=['RECEIVED','FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x304b39,_0x16a7fd){var _0x1b699c=function(_0x59f1ff){while(--_0x59f1ff){_0x304b39['push'](_0x304b39['shift']());}};_0x1b699c(++_0x16a7fd);}(_0x5995,0x152));var _0x5599=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5995[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x5599('0x0'));module[_0x5599('0x1')]={'integration':{'type':Sequelize[_0x5599('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x5599('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5599('0x2')]},'calleridnum':{'type':Sequelize[_0x5599('0x2')]},'calleridname':{'type':Sequelize[_0x5599('0x2')]},'queue':{'type':Sequelize[_0x5599('0x2')]},'interface':{'type':Sequelize[_0x5599('0x2')]},'membername':{'type':Sequelize[_0x5599('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5599('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5599('0x3')]},'holdtime':{'type':Sequelize[_0x5599('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5599('0x3')]},'talktime':{'type':Sequelize[_0x5599('0x4')]},'agentacw':{'type':Sequelize[_0x5599('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5599('0x4')]},'reason':{'type':Sequelize[_0x5599('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x5599('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5599('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x5599('0x2')]},'channel':{'type':Sequelize[_0x5599('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x5599('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5599('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5599('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x5599('0x2')]},'exten':{'type':Sequelize[_0x5599('0x2')]},'priority':{'type':Sequelize[_0x5599('0x2')]},'destchannel':{'type':Sequelize[_0x5599('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x5599('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5599('0x2')]},'destcalleridname':{'type':Sequelize[_0x5599('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x5599('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x5599('0x2')]},'destexten':{'type':Sequelize[_0x5599('0x2')]},'destpriority':{'type':Sequelize[_0x5599('0x2')]},'destuniqueid':{'type':Sequelize[_0x5599('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x5599('0x2')]},'from':{'type':Sequelize[_0x5599('0x2')]},'to':{'type':Sequelize[_0x5599('0x2')]},'cc':{'type':Sequelize[_0x5599('0x2')]},'attachment':{'type':Sequelize[_0x5599('0x6')]},'html':{'type':Sequelize[_0x5599('0x6')]},'text':{'type':Sequelize[_0x5599('0x6')]},'status':{'type':Sequelize[_0x5599('0x7')](_0x5599('0x8'),_0x5599('0x9'),_0x5599('0xa'),_0x5599('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x5599('0x2')]},'appdata':{'type':Sequelize[_0x5599('0x2')]},'projectId':{'type':Sequelize[_0x5599('0x4')]}}; \ No newline at end of file +var _0xe38b=['TEXT','ENUM','SENT','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x47430a,_0x2e3f19){var _0x3efc3a=function(_0xcd33b6){while(--_0xcd33b6){_0x47430a['push'](_0x47430a['shift']());}};_0x3efc3a(++_0x2e3f19);}(_0xe38b,0x1a1));var _0xbe38=function(_0x2432d7,_0x15e20e){_0x2432d7=_0x2432d7-0x0;var _0x3bd787=_0xe38b[_0x2432d7];return _0x3bd787;};'use strict';var Sequelize=require(_0xbe38('0x0'));module[_0xbe38('0x1')]={'integration':{'type':Sequelize[_0xbe38('0x2')]},'eventChannel':{'type':Sequelize[_0xbe38('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xbe38('0x2')]},'integrationId':{'type':Sequelize[_0xbe38('0x3')]},'contacts':{'type':Sequelize[_0xbe38('0x2')]},'uniqueid':{'type':Sequelize[_0xbe38('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xbe38('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xbe38('0x2')]},'membername':{'type':Sequelize[_0xbe38('0x2')]},'agentcalledAt':{'type':Sequelize[_0xbe38('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xbe38('0x3')]},'agentcomplete':{'type':Sequelize[_0xbe38('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbe38('0x3')]},'reason':{'type':Sequelize[_0xbe38('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xbe38('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xbe38('0x4')]},'agentdump':{'type':Sequelize[_0xbe38('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xbe38('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xbe38('0x3')]},'channelstatedesc':{'type':Sequelize[_0xbe38('0x2')]},'connectedlinenum':{'type':Sequelize[_0xbe38('0x2')]},'connectedlinename':{'type':Sequelize[_0xbe38('0x2')]},'language':{'type':Sequelize[_0xbe38('0x2')]},'accountcode':{'type':Sequelize[_0xbe38('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbe38('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xbe38('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xbe38('0x2')]},'destcalleridnum':{'type':Sequelize[_0xbe38('0x2')]},'destcalleridname':{'type':Sequelize[_0xbe38('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xbe38('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xbe38('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xbe38('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xbe38('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xbe38('0x2')]},'messageId':{'type':Sequelize[_0xbe38('0x2')]},'inReplyTo':{'type':Sequelize[_0xbe38('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xbe38('0x2')]},'attachment':{'type':Sequelize[_0xbe38('0x6')]},'html':{'type':Sequelize[_0xbe38('0x6')]},'text':{'type':Sequelize[_0xbe38('0x6')]},'status':{'type':Sequelize[_0xbe38('0x7')](_0xbe38('0x8'),'SENDING','RECEIVED','FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xbe38('0x2')]},'appdata':{'type':Sequelize[_0xbe38('0x2')]},'projectId':{'type':Sequelize[_0xbe38('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 71d6f55..476aa84 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 _0x8b84=['where','pick','filter','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','end','json','count','offset','limit','Content-Range','apply','reject','then','destroy','sendStatus','error','name','index','IntegrationReport','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort'];(function(_0xcd77c9,_0x4cf20f){var _0x5f06f8=function(_0x108bf9){while(--_0x108bf9){_0xcd77c9['push'](_0xcd77c9['shift']());}};_0x5f06f8(++_0x4cf20f);}(_0x8b84,0x166));var _0x48b8=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x8b84[_0x5608a3];return _0x1ed50a;};'use strict';var pdf=require(_0x48b8('0x0'));var emlformat=require(_0x48b8('0x1'));var rimraf=require(_0x48b8('0x2'));var zipdir=require(_0x48b8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48b8('0x4'));var moment=require(_0x48b8('0x5'));var BPromise=require(_0x48b8('0x6'));var Mustache=require(_0x48b8('0x7'));var util=require('util');var path=require(_0x48b8('0x8'));var sox=require(_0x48b8('0x9'));var csv=require('to-csv');var ejs=require(_0x48b8('0xa'));var fs=require('fs');var _=require(_0x48b8('0xb'));var squel=require(_0x48b8('0xc'));var crypto=require(_0x48b8('0xd'));var jsforce=require(_0x48b8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x48b8('0xf'));var querystring=require(_0x48b8('0x10'));var Papa=require(_0x48b8('0x11'));var authService=require(_0x48b8('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x48b8('0x13'));var qs=require(_0x48b8('0x14'));var logger=require(_0x48b8('0x15'))(_0x48b8('0x16'));var utils=require(_0x48b8('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa8458f,_0x5e07ca){_0x5e07ca=_0x5e07ca||0xcc;return function(_0x2b667b){if(_0x2b667b){return _0xa8458f['sendStatus'](_0x5e07ca);}return _0xa8458f[_0x48b8('0x18')](_0x5e07ca)[_0x48b8('0x19')]();};}function respondWithResult(_0x58bd03,_0x4542d9){_0x4542d9=_0x4542d9||0xc8;return function(_0x5c3ff2){if(_0x5c3ff2){return _0x58bd03[_0x48b8('0x18')](_0x4542d9)[_0x48b8('0x1a')](_0x5c3ff2);}};}function respondWithFilteredResult(_0x468cc8,_0x465986){return function(_0x365891){if(_0x365891){var _0x15809d=_0x365891[_0x48b8('0x1b')],_0x560851=_0x465986[_0x48b8('0x1c')],_0x33147f=_0x465986[_0x48b8('0x1c')]+_0x465986[_0x48b8('0x1d')],_0x467fb4;if(_0x33147f>=_0x15809d){_0x33147f=_0x15809d;_0x467fb4=0xc8;}else{_0x467fb4=0xce;}_0x468cc8[_0x48b8('0x18')](_0x467fb4);return _0x468cc8['set'](_0x48b8('0x1e'),_0x560851+'-'+_0x33147f+'/'+_0x15809d)[_0x48b8('0x1a')](_0x365891);}return null;};}function patchUpdates(_0x23f29e){return function(_0x16ef37){try{jsonpatch[_0x48b8('0x1f')](_0x16ef37,_0x23f29e,!![]);}catch(_0x2619bc){return BPromise[_0x48b8('0x20')](_0x2619bc);}return _0x16ef37['save']();};}function saveUpdates(_0x359dc2,_0x38c6c1){return function(_0x443728){if(_0x443728){return _0x443728['update'](_0x359dc2)[_0x48b8('0x21')](function(_0x4ee9a9){return _0x4ee9a9;});}return null;};}function removeEntity(_0x4fde62,_0x896ab3){return function(_0x4238bb){if(_0x4238bb){return _0x4238bb[_0x48b8('0x22')]()[_0x48b8('0x21')](function(){_0x4fde62['status'](0xcc)[_0x48b8('0x19')]();});}};}function handleEntityNotFound(_0x5e413c,_0x2e533f){return function(_0x4d801f){if(!_0x4d801f){_0x5e413c[_0x48b8('0x23')](0x194);}return _0x4d801f;};}function handleError(_0x40a0d3,_0x26268f){_0x26268f=_0x26268f||0x1f4;return function(_0x5cb4a9){logger[_0x48b8('0x24')](_0x5cb4a9['stack']);if(_0x5cb4a9['name']){delete _0x5cb4a9[_0x48b8('0x25')];}_0x40a0d3['status'](_0x26268f)['send'](_0x5cb4a9);};}exports[_0x48b8('0x26')]=function(_0x18f74a,_0x26c971){var _0x41a9b2={},_0x33ef9b={},_0x56ed3f={'count':0x0,'rows':[]};var _0x3c2e7b=db[_0x48b8('0x27')]['rawAttributes'];_0x33ef9b[_0x48b8('0x28')]=_[_0x48b8('0x29')](_0x3c2e7b);_0x33ef9b[_0x48b8('0x2a')]=_[_0x48b8('0x29')](_0x18f74a[_0x48b8('0x2a')]);_0x33ef9b[_0x48b8('0x2b')]=_[_0x48b8('0x2c')](_0x33ef9b[_0x48b8('0x28')],_0x33ef9b[_0x48b8('0x2a')]);_0x41a9b2['attributes']=_['intersection'](_0x33ef9b[_0x48b8('0x28')],qs['fields'](_0x18f74a[_0x48b8('0x2a')][_0x48b8('0x2d')]));_0x41a9b2[_0x48b8('0x2e')]=_0x41a9b2[_0x48b8('0x2e')]['length']?_0x41a9b2[_0x48b8('0x2e')]:_0x33ef9b[_0x48b8('0x28')];if(!_0x18f74a[_0x48b8('0x2a')]['hasOwnProperty'](_0x48b8('0x2f'))){_0x41a9b2[_0x48b8('0x1d')]=qs[_0x48b8('0x1d')](_0x18f74a[_0x48b8('0x2a')][_0x48b8('0x1d')]);_0x41a9b2[_0x48b8('0x1c')]=qs[_0x48b8('0x1c')](_0x18f74a[_0x48b8('0x2a')][_0x48b8('0x1c')]);}_0x41a9b2[_0x48b8('0x30')]=qs[_0x48b8('0x31')](_0x18f74a[_0x48b8('0x2a')][_0x48b8('0x31')]);_0x41a9b2[_0x48b8('0x32')]=qs[_0x48b8('0x2b')](_[_0x48b8('0x33')](_0x18f74a[_0x48b8('0x2a')],_0x33ef9b['filters']));if(_0x18f74a[_0x48b8('0x2a')][_0x48b8('0x34')]){_0x41a9b2[_0x48b8('0x32')]=_[_0x48b8('0x35')](_0x41a9b2[_0x48b8('0x32')],{'$or':_['map'](_0x3c2e7b,function(_0x1b3e01){if(_0x1b3e01['type']['key']!==_0x48b8('0x36')){var _0x1e9e58={};_0x1e9e58[_0x1b3e01[_0x48b8('0x37')]]={'$like':'%'+_0x18f74a[_0x48b8('0x2a')][_0x48b8('0x34')]+'%'};return _0x1e9e58;}})});}_0x41a9b2=_[_0x48b8('0x35')]({},_0x41a9b2,_0x18f74a[_0x48b8('0x38')]);var _0x1f2daa={'where':_0x41a9b2[_0x48b8('0x32')]};return db[_0x48b8('0x27')]['count'](_0x1f2daa)['then'](function(_0xdc1a6a){_0x56ed3f['count']=_0xdc1a6a;if(_0x18f74a[_0x48b8('0x2a')][_0x48b8('0x39')]){_0x41a9b2[_0x48b8('0x3a')]=[{'all':!![]}];}return db['IntegrationReport'][_0x48b8('0x3b')](_0x41a9b2);})['then'](function(_0x514b71){_0x56ed3f[_0x48b8('0x3c')]=_0x514b71;return _0x56ed3f;})[_0x48b8('0x21')](respondWithFilteredResult(_0x26c971,_0x41a9b2))[_0x48b8('0x3d')](handleError(_0x26c971,null));};exports[_0x48b8('0x3e')]=function(_0x2b7001,_0x273a41){var _0x15bdfb={'raw':![],'where':{'id':_0x2b7001['params']['id']}},_0x3cd0b8={};_0x3cd0b8[_0x48b8('0x28')]=_['keys'](db['IntegrationReport'][_0x48b8('0x3f')]);_0x3cd0b8['query']=_['keys'](_0x2b7001[_0x48b8('0x2a')]);_0x3cd0b8['filters']=_[_0x48b8('0x2c')](_0x3cd0b8[_0x48b8('0x28')],_0x3cd0b8[_0x48b8('0x2a')]);_0x15bdfb[_0x48b8('0x2e')]=_[_0x48b8('0x2c')](_0x3cd0b8[_0x48b8('0x28')],qs['fields'](_0x2b7001[_0x48b8('0x2a')]['fields']));_0x15bdfb[_0x48b8('0x2e')]=_0x15bdfb['attributes'][_0x48b8('0x40')]?_0x15bdfb[_0x48b8('0x2e')]:_0x3cd0b8[_0x48b8('0x28')];if(_0x2b7001['query']['includeAll']){_0x15bdfb[_0x48b8('0x3a')]=[{'all':!![]}];}_0x15bdfb=_[_0x48b8('0x35')]({},_0x15bdfb,_0x2b7001[_0x48b8('0x38')]);return db[_0x48b8('0x27')][_0x48b8('0x41')](_0x15bdfb)[_0x48b8('0x21')](handleEntityNotFound(_0x273a41,null))[_0x48b8('0x21')](respondWithResult(_0x273a41,null))[_0x48b8('0x3d')](handleError(_0x273a41,null));};exports[_0x48b8('0x42')]=function(_0x48e14d,_0x2838dc){return db[_0x48b8('0x27')][_0x48b8('0x42')](_0x48e14d[_0x48b8('0x43')],{})['then'](respondWithResult(_0x2838dc,0xc9))['catch'](handleError(_0x2838dc,null));};exports['update']=function(_0x552126,_0x3221eb){if(_0x552126['body']['id']){delete _0x552126['body']['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x552126['params']['id']}})[_0x48b8('0x21')](handleEntityNotFound(_0x3221eb,null))[_0x48b8('0x21')](saveUpdates(_0x552126[_0x48b8('0x43')],null))[_0x48b8('0x21')](respondWithResult(_0x3221eb,null))[_0x48b8('0x3d')](handleError(_0x3221eb,null));};exports['destroy']=function(_0x3f995e,_0x36c81a){return db[_0x48b8('0x27')][_0x48b8('0x41')]({'where':{'id':_0x3f995e['params']['id']}})['then'](handleEntityNotFound(_0x36c81a,null))[_0x48b8('0x21')](removeEntity(_0x36c81a,null))[_0x48b8('0x3d')](handleError(_0x36c81a,null));};exports['describe']=function(_0x331a9a,_0x493116){return db[_0x48b8('0x27')]['describe']()['then'](respondWithResult(_0x493116,null))[_0x48b8('0x3d')](handleError(_0x493116,null));}; \ No newline at end of file +var _0x760e=['../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','IntegrationReport','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','include','rows','catch','params','rawAttributes','includeAll','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x760e,0x1a3));var _0xe760=function(_0x123bfe,_0x500614){_0x123bfe=_0x123bfe-0x0;var _0x1cfbc7=_0x760e[_0x123bfe];return _0x1cfbc7;};'use strict';var pdf=require(_0xe760('0x0'));var emlformat=require(_0xe760('0x1'));var rimraf=require(_0xe760('0x2'));var zipdir=require(_0xe760('0x3'));var jsonpatch=require(_0xe760('0x4'));var rp=require(_0xe760('0x5'));var moment=require('moment');var BPromise=require(_0xe760('0x6'));var Mustache=require(_0xe760('0x7'));var util=require(_0xe760('0x8'));var path=require('path');var sox=require(_0xe760('0x9'));var csv=require(_0xe760('0xa'));var ejs=require(_0xe760('0xb'));var fs=require('fs');var _=require(_0xe760('0xc'));var squel=require(_0xe760('0xd'));var crypto=require(_0xe760('0xe'));var jsforce=require(_0xe760('0xf'));var deskjs=require(_0xe760('0x10'));var toCsv=require(_0xe760('0xa'));var querystring=require(_0xe760('0x11'));var Papa=require(_0xe760('0x12'));var authService=require('../../components/auth/service');var hardwareService=require(_0xe760('0x13'));var Redis=require(_0xe760('0x14'));var qs=require(_0xe760('0x15'));var logger=require(_0xe760('0x16'))(_0xe760('0x17'));var utils=require('../../config/utils');var config=require(_0xe760('0x18'));var db=require(_0xe760('0x19'))['db'];function respondWithStatusCode(_0x4629ff,_0x47f36e){_0x47f36e=_0x47f36e||0xcc;return function(_0xa1e225){if(_0xa1e225){return _0x4629ff[_0xe760('0x1a')](_0x47f36e);}return _0x4629ff[_0xe760('0x1b')](_0x47f36e)[_0xe760('0x1c')]();};}function respondWithResult(_0x2c2b50,_0x3acd9b){_0x3acd9b=_0x3acd9b||0xc8;return function(_0x2821a0){if(_0x2821a0){return _0x2c2b50[_0xe760('0x1b')](_0x3acd9b)['json'](_0x2821a0);}};}function respondWithFilteredResult(_0x58d5d4,_0x1144e6){return function(_0x18a604){if(_0x18a604){var _0x5ccfbc=_0x18a604[_0xe760('0x1d')],_0x3dbe7d=_0x1144e6[_0xe760('0x1e')],_0x3b9927=_0x1144e6[_0xe760('0x1e')]+_0x1144e6[_0xe760('0x1f')],_0x4f1a56;if(_0x3b9927>=_0x5ccfbc){_0x3b9927=_0x5ccfbc;_0x4f1a56=0xc8;}else{_0x4f1a56=0xce;}_0x58d5d4[_0xe760('0x1b')](_0x4f1a56);return _0x58d5d4['set'](_0xe760('0x20'),_0x3dbe7d+'-'+_0x3b9927+'/'+_0x5ccfbc)[_0xe760('0x21')](_0x18a604);}return null;};}function patchUpdates(_0x2add3e){return function(_0x178b33){try{jsonpatch[_0xe760('0x22')](_0x178b33,_0x2add3e,!![]);}catch(_0x1803f7){return BPromise[_0xe760('0x23')](_0x1803f7);}return _0x178b33[_0xe760('0x24')]();};}function saveUpdates(_0x210adc,_0x317f12){return function(_0x22f7a4){if(_0x22f7a4){return _0x22f7a4[_0xe760('0x25')](_0x210adc)[_0xe760('0x26')](function(_0x22c02c){return _0x22c02c;});}return null;};}function removeEntity(_0x2fe4d9,_0x1e3965){return function(_0x28d340){if(_0x28d340){return _0x28d340[_0xe760('0x27')]()['then'](function(){_0x2fe4d9[_0xe760('0x1b')](0xcc)[_0xe760('0x1c')]();});}};}function handleEntityNotFound(_0x17862a,_0x5d8aea){return function(_0x2a9b7f){if(!_0x2a9b7f){_0x17862a[_0xe760('0x1a')](0x194);}return _0x2a9b7f;};}function handleError(_0x542355,_0x1f618){_0x1f618=_0x1f618||0x1f4;return function(_0x1884c7){logger[_0xe760('0x28')](_0x1884c7['stack']);if(_0x1884c7[_0xe760('0x29')]){delete _0x1884c7['name'];}_0x542355[_0xe760('0x1b')](_0x1f618)[_0xe760('0x2a')](_0x1884c7);};}exports[_0xe760('0x2b')]=function(_0x44deb4,_0x33a5c2){var _0xb5bee9={},_0x369211={},_0x435e6f={'count':0x0,'rows':[]};var _0x9ccacf=db[_0xe760('0x2c')]['rawAttributes'];_0x369211['model']=_['keys'](_0x9ccacf);_0x369211[_0xe760('0x2d')]=_[_0xe760('0x2e')](_0x44deb4[_0xe760('0x2d')]);_0x369211[_0xe760('0x2f')]=_[_0xe760('0x30')](_0x369211[_0xe760('0x31')],_0x369211['query']);_0xb5bee9['attributes']=_[_0xe760('0x30')](_0x369211[_0xe760('0x31')],qs[_0xe760('0x32')](_0x44deb4[_0xe760('0x2d')][_0xe760('0x32')]));_0xb5bee9[_0xe760('0x33')]=_0xb5bee9[_0xe760('0x33')]['length']?_0xb5bee9[_0xe760('0x33')]:_0x369211[_0xe760('0x31')];if(!_0x44deb4[_0xe760('0x2d')][_0xe760('0x34')]('nolimit')){_0xb5bee9[_0xe760('0x1f')]=qs[_0xe760('0x1f')](_0x44deb4[_0xe760('0x2d')]['limit']);_0xb5bee9['offset']=qs[_0xe760('0x1e')](_0x44deb4[_0xe760('0x2d')][_0xe760('0x1e')]);}_0xb5bee9[_0xe760('0x35')]=qs[_0xe760('0x36')](_0x44deb4['query'][_0xe760('0x36')]);_0xb5bee9[_0xe760('0x37')]=qs['filters'](_[_0xe760('0x38')](_0x44deb4[_0xe760('0x2d')],_0x369211[_0xe760('0x2f')]));if(_0x44deb4['query'][_0xe760('0x39')]){_0xb5bee9[_0xe760('0x37')]=_[_0xe760('0x3a')](_0xb5bee9[_0xe760('0x37')],{'$or':_[_0xe760('0x3b')](_0x9ccacf,function(_0x242640){if(_0x242640[_0xe760('0x3c')]['key']!==_0xe760('0x3d')){var _0xff85b2={};_0xff85b2[_0x242640[_0xe760('0x3e')]]={'$like':'%'+_0x44deb4['query']['filter']+'%'};return _0xff85b2;}})});}_0xb5bee9=_[_0xe760('0x3a')]({},_0xb5bee9,_0x44deb4['options']);var _0x208ec0={'where':_0xb5bee9[_0xe760('0x37')]};return db[_0xe760('0x2c')]['count'](_0x208ec0)['then'](function(_0xab391f){_0x435e6f[_0xe760('0x1d')]=_0xab391f;if(_0x44deb4[_0xe760('0x2d')]['includeAll']){_0xb5bee9[_0xe760('0x3f')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0xb5bee9);})[_0xe760('0x26')](function(_0x1a63dc){_0x435e6f[_0xe760('0x40')]=_0x1a63dc;return _0x435e6f;})[_0xe760('0x26')](respondWithFilteredResult(_0x33a5c2,_0xb5bee9))[_0xe760('0x41')](handleError(_0x33a5c2,null));};exports['show']=function(_0x1f9d80,_0xdaf20a){var _0x2d0f60={'raw':![],'where':{'id':_0x1f9d80[_0xe760('0x42')]['id']}},_0x5aca16={};_0x5aca16['model']=_[_0xe760('0x2e')](db[_0xe760('0x2c')][_0xe760('0x43')]);_0x5aca16[_0xe760('0x2d')]=_[_0xe760('0x2e')](_0x1f9d80['query']);_0x5aca16['filters']=_[_0xe760('0x30')](_0x5aca16['model'],_0x5aca16[_0xe760('0x2d')]);_0x2d0f60[_0xe760('0x33')]=_[_0xe760('0x30')](_0x5aca16[_0xe760('0x31')],qs[_0xe760('0x32')](_0x1f9d80['query'][_0xe760('0x32')]));_0x2d0f60['attributes']=_0x2d0f60[_0xe760('0x33')]['length']?_0x2d0f60[_0xe760('0x33')]:_0x5aca16[_0xe760('0x31')];if(_0x1f9d80['query'][_0xe760('0x44')]){_0x2d0f60[_0xe760('0x3f')]=[{'all':!![]}];}_0x2d0f60=_[_0xe760('0x3a')]({},_0x2d0f60,_0x1f9d80[_0xe760('0x45')]);return db['IntegrationReport'][_0xe760('0x46')](_0x2d0f60)[_0xe760('0x26')](handleEntityNotFound(_0xdaf20a,null))[_0xe760('0x26')](respondWithResult(_0xdaf20a,null))[_0xe760('0x41')](handleError(_0xdaf20a,null));};exports[_0xe760('0x47')]=function(_0x492a2c,_0x4be5c8){return db[_0xe760('0x2c')][_0xe760('0x47')](_0x492a2c['body'],{})[_0xe760('0x26')](respondWithResult(_0x4be5c8,0xc9))[_0xe760('0x41')](handleError(_0x4be5c8,null));};exports['update']=function(_0xcb9990,_0x12bd67){if(_0xcb9990[_0xe760('0x48')]['id']){delete _0xcb9990['body']['id'];}return db['IntegrationReport'][_0xe760('0x46')]({'where':{'id':_0xcb9990['params']['id']}})[_0xe760('0x26')](handleEntityNotFound(_0x12bd67,null))[_0xe760('0x26')](saveUpdates(_0xcb9990[_0xe760('0x48')],null))['then'](respondWithResult(_0x12bd67,null))[_0xe760('0x41')](handleError(_0x12bd67,null));};exports['destroy']=function(_0x35efd1,_0x524fb5){return db[_0xe760('0x2c')][_0xe760('0x46')]({'where':{'id':_0x35efd1[_0xe760('0x42')]['id']}})[_0xe760('0x26')](handleEntityNotFound(_0x524fb5,null))[_0xe760('0x26')](removeEntity(_0x524fb5,null))[_0xe760('0x41')](handleError(_0x524fb5,null));};exports[_0xe760('0x49')]=function(_0xe8452a,_0x53ffa4){return db[_0xe760('0x2c')]['describe']()[_0xe760('0x26')](respondWithResult(_0x53ffa4,null))['catch'](handleError(_0x53ffa4,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 8daa69f..12c8b8c 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 _0xf2ca=['util','../../config/logger','moment','bluebird','request-promise','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash'];(function(_0x5808a9,_0x7887a){var _0x1a4e25=function(_0x3c901f){while(--_0x3c901f){_0x5808a9['push'](_0x5808a9['shift']());}};_0x1a4e25(++_0x7887a);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x342782,_0x4236e0){_0x342782=_0x342782-0x0;var _0xadb50c=_0xf2ca[_0x342782];return _0xadb50c;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var logger=require(_0xaf2c('0x2'))('api');var moment=require(_0xaf2c('0x3'));var BPromise=require(_0xaf2c('0x4'));var rp=require(_0xaf2c('0x5'));var attributes=require(_0xaf2c('0x6'));module[_0xaf2c('0x7')]=function(_0x10c910,_0x5b8c81){return _0x10c910[_0xaf2c('0x8')](_0xaf2c('0x9'),attributes,{'tableName':_0xaf2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','./integrationReport.attributes','define'];(function(_0x23f642,_0x3c8f66){var _0x4ba0d0=function(_0x507a88){while(--_0x507a88){_0x23f642['push'](_0x23f642['shift']());}};_0x4ba0d0(++_0x3c8f66);}(_0x5fc3,0xa8));var _0x35fc=function(_0x53b594,_0x559767){_0x53b594=_0x53b594-0x0;var _0x1e616f=_0x5fc3[_0x53b594];return _0x1e616f;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var attributes=require(_0x35fc('0x6'));module['exports']=function(_0x2d1404,_0x1d5fec){return _0x2d1404[_0x35fc('0x7')]('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index cd6198d..c345cda 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 _0x9e91=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9e91,0x1ca));var _0x19e9=function(_0xec720b,_0x3b4569){_0xec720b=_0xec720b-0x0;var _0x1f9295=_0x9e91[_0xec720b];return _0x1f9295;};'use strict';var _=require(_0x19e9('0x0'));var util=require(_0x19e9('0x1'));var moment=require(_0x19e9('0x2'));var BPromise=require(_0x19e9('0x3'));var rs=require(_0x19e9('0x4'));var fs=require('fs');var Redis=require(_0x19e9('0x5'));var db=require(_0x19e9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x19e9('0x7'))(_0x19e9('0x8'));var config=require(_0x19e9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x19e9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ba5f2,_0x1af28d,_0x3210fb){return new BPromise(function(_0x25dba5,_0x5f12c7){return client['request'](_0x5ba5f2,_0x3210fb)[_0x19e9('0xb')](function(_0xfbb11){logger[_0x19e9('0xc')](_0x19e9('0xd'),_0x1af28d,_0x19e9('0xe'));logger[_0x19e9('0xf')](_0x19e9('0x10'),_0x1af28d,_0x19e9('0xe'),JSON[_0x19e9('0x11')](_0xfbb11));if(_0xfbb11[_0x19e9('0x12')]){if(_0xfbb11[_0x19e9('0x12')]['code']===0x1f4){logger['error'](_0x19e9('0xd'),_0x1af28d,_0xfbb11['error'][_0x19e9('0x13')]);return _0x5f12c7(_0xfbb11[_0x19e9('0x12')][_0x19e9('0x13')]);}logger[_0x19e9('0x12')](_0x19e9('0xd'),_0x1af28d,_0xfbb11[_0x19e9('0x12')][_0x19e9('0x13')]);return _0x25dba5(_0xfbb11[_0x19e9('0x12')][_0x19e9('0x13')]);}else{logger[_0x19e9('0xc')](_0x19e9('0xd'),_0x1af28d,_0x19e9('0xe'));_0x25dba5(_0xfbb11['result'][_0x19e9('0x13')]);}})[_0x19e9('0x14')](function(_0x3575f8){logger[_0x19e9('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x1af28d,_0x3575f8);_0x5f12c7(_0x3575f8);});});} \ No newline at end of file +var _0x6147=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','IntegrationReport,\x20%s,\x20%s','message','result'];(function(_0x3be61a,_0x3df6ab){var _0x519072=function(_0x1ee1fa){while(--_0x1ee1fa){_0x3be61a['push'](_0x3be61a['shift']());}};_0x519072(++_0x3df6ab);}(_0x6147,0xf2));var _0x7614=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x6147[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x7614('0x0'));var util=require(_0x7614('0x1'));var moment=require(_0x7614('0x2'));var BPromise=require(_0x7614('0x3'));var rs=require(_0x7614('0x4'));var fs=require('fs');var Redis=require(_0x7614('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7614('0x6'));var logger=require(_0x7614('0x7'))(_0x7614('0x8'));var config=require('../../config/environment');var jayson=require(_0x7614('0x9'));var client=jayson['client'][_0x7614('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49a9ff,_0x39b1e7,_0x33d1a4){return new BPromise(function(_0x1726fa,_0x4c2b49){return client[_0x7614('0xb')](_0x49a9ff,_0x33d1a4)[_0x7614('0xc')](function(_0x4463e2){logger[_0x7614('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x39b1e7,_0x7614('0xe'));logger[_0x7614('0xf')](_0x7614('0x10'),_0x39b1e7,_0x7614('0xe'),JSON[_0x7614('0x11')](_0x4463e2));if(_0x4463e2['error']){if(_0x4463e2[_0x7614('0x12')]['code']===0x1f4){logger[_0x7614('0x12')](_0x7614('0x13'),_0x39b1e7,_0x4463e2[_0x7614('0x12')][_0x7614('0x14')]);return _0x4c2b49(_0x4463e2[_0x7614('0x12')]['message']);}logger[_0x7614('0x12')](_0x7614('0x13'),_0x39b1e7,_0x4463e2['error'][_0x7614('0x14')]);return _0x1726fa(_0x4463e2['error'][_0x7614('0x14')]);}else{logger[_0x7614('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x39b1e7,_0x7614('0xe'));_0x1726fa(_0x4463e2[_0x7614('0x15')][_0x7614('0x14')]);}})['catch'](function(_0x609a2a){logger[_0x7614('0x12')](_0x7614('0x13'),_0x39b1e7,_0x609a2a);_0x4c2b49(_0x609a2a);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 443b852..fd6ca90 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 _0x0ab9=['exports','multer','path','Router','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','delete','destroy'];(function(_0x15d3c0,_0x3bf166){var _0x292d3d=function(_0x52c9a1){while(--_0x52c9a1){_0x15d3c0['push'](_0x15d3c0['shift']());}};_0x292d3d(++_0x3bf166);}(_0x0ab9,0x157));var _0x90ab=function(_0x597c7a,_0x1ee4f0){_0x597c7a=_0x597c7a-0x0;var _0x41c077=_0x0ab9[_0x597c7a];return _0x41c077;};'use strict';var multer=require(_0x90ab('0x0'));var util=require('util');var path=require(_0x90ab('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x90ab('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x90ab('0x3'));var config=require(_0x90ab('0x4'));var controller=require(_0x90ab('0x5'));router[_0x90ab('0x6')]('/',auth[_0x90ab('0x7')](),controller[_0x90ab('0x8')]);router[_0x90ab('0x6')](_0x90ab('0x9'),auth[_0x90ab('0x7')](),controller['show']);router[_0x90ab('0x6')](_0x90ab('0xa'),auth[_0x90ab('0x7')](),controller['getIntervals']);router[_0x90ab('0xb')]('/',auth['isAuthenticated'](),controller[_0x90ab('0xc')]);router[_0x90ab('0xb')]('/:id/sub_intervals',auth[_0x90ab('0x7')](),controller[_0x90ab('0xd')]);router[_0x90ab('0xb')](_0x90ab('0xe'),auth[_0x90ab('0x7')](),controller[_0x90ab('0xf')]);router['put'](_0x90ab('0x9'),auth[_0x90ab('0x7')](),controller['update']);router[_0x90ab('0x10')](_0x90ab('0x9'),auth['isAuthenticated'](),controller[_0x90ab('0x11')]);module[_0x90ab('0x12')]=router; \ No newline at end of file +var _0xd290=['multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','create','post','addIntervals','put','delete','destroy','exports'];(function(_0xe8b0db,_0x14d346){var _0x5cd46f=function(_0x365ca9){while(--_0x365ca9){_0xe8b0db['push'](_0xe8b0db['shift']());}};_0x5cd46f(++_0x14d346);}(_0xd290,0x165));var _0x0d29=function(_0x10a51c,_0x2ace0a){_0x10a51c=_0x10a51c-0x0;var _0xaf3bfc=_0xd290[_0x10a51c];return _0xaf3bfc;};'use strict';var multer=require(_0x0d29('0x0'));var util=require(_0x0d29('0x1'));var path=require('path');var timeout=require(_0x0d29('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x0d29('0x3'));var interaction=require(_0x0d29('0x4'));var config=require(_0x0d29('0x5'));var controller=require(_0x0d29('0x6'));router[_0x0d29('0x7')]('/',auth['isAuthenticated'](),controller[_0x0d29('0x8')]);router[_0x0d29('0x7')](_0x0d29('0x9'),auth[_0x0d29('0xa')](),controller[_0x0d29('0xb')]);router['get'](_0x0d29('0xc'),auth[_0x0d29('0xa')](),controller[_0x0d29('0xd')]);router['post']('/',auth[_0x0d29('0xa')](),controller[_0x0d29('0xe')]);router['post'](_0x0d29('0xc'),auth[_0x0d29('0xa')](),controller['addInterval']);router[_0x0d29('0xf')]('/:id/sub_intervals/create_many',auth[_0x0d29('0xa')](),controller[_0x0d29('0x10')]);router[_0x0d29('0x11')](_0x0d29('0x9'),auth[_0x0d29('0xa')](),controller['update']);router[_0x0d29('0x12')](_0x0d29('0x9'),auth[_0x0d29('0xa')](),controller[_0x0d29('0x13')]);module[_0x0d29('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 93f3676..60d2c44 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 _0x9030=['STRING','sequelize','exports'];(function(_0x2bf9b5,_0x2f7b63){var _0x446004=function(_0x4993ce){while(--_0x4993ce){_0x2bf9b5['push'](_0x2bf9b5['shift']());}};_0x446004(++_0x2f7b63);}(_0x9030,0x121));var _0x0903=function(_0x55823e,_0x4e7106){_0x55823e=_0x55823e-0x0;var _0xbcf056=_0x9030[_0x55823e];return _0xbcf056;};'use strict';var Sequelize=require(_0x0903('0x0'));module[_0x0903('0x1')]={'name':{'type':Sequelize[_0x0903('0x2')]},'description':{'type':Sequelize[_0x0903('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x0cb6=['sequelize','exports','STRING'];(function(_0x24df0f,_0x3afdfe){var _0x424c75=function(_0x1e8064){while(--_0x1e8064){_0x24df0f['push'](_0x24df0f['shift']());}};_0x424c75(++_0x3afdfe);}(_0x0cb6,0xb7));var _0x60cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cb6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x60cb('0x0'));module[_0x60cb('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x60cb('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 6b7efa0..edf70cf 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 _0x4f43=['papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','show','options','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','IntervalId','findOne','getIntervals','nolimit','addIntervals','sequelize','transaction','bulkCreate','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4f43,0x1b2));var _0x34f4=function(_0xcd0744,_0x389c5e){_0xcd0744=_0xcd0744-0x0;var _0x10b952=_0x4f43[_0xcd0744];return _0x10b952;};'use strict';var pdf=require(_0x34f4('0x0'));var emlformat=require(_0x34f4('0x1'));var rimraf=require(_0x34f4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x34f4('0x3'));var rp=require(_0x34f4('0x4'));var moment=require(_0x34f4('0x5'));var BPromise=require(_0x34f4('0x6'));var Mustache=require(_0x34f4('0x7'));var util=require(_0x34f4('0x8'));var path=require('path');var sox=require(_0x34f4('0x9'));var csv=require(_0x34f4('0xa'));var ejs=require(_0x34f4('0xb'));var fs=require('fs');var _=require(_0x34f4('0xc'));var squel=require('squel');var crypto=require(_0x34f4('0xd'));var jsforce=require(_0x34f4('0xe'));var deskjs=require(_0x34f4('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x34f4('0x10'));var authService=require(_0x34f4('0x11'));var hardwareService=require(_0x34f4('0x12'));var Redis=require(_0x34f4('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x34f4('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x34f4('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x48aff1,_0x2b8836){_0x2b8836=_0x2b8836||0xcc;return function(_0x3c112e){if(_0x3c112e){return _0x48aff1[_0x34f4('0x16')](_0x2b8836);}return _0x48aff1['status'](_0x2b8836)[_0x34f4('0x17')]();};}function respondWithResult(_0x17f455,_0x5309be){_0x5309be=_0x5309be||0xc8;return function(_0x30e43f){if(_0x30e43f){return _0x17f455[_0x34f4('0x18')](_0x5309be)[_0x34f4('0x19')](_0x30e43f);}};}function respondWithFilteredResult(_0x557d7a,_0x35788a){return function(_0x306a19){if(_0x306a19){var _0xef09e1=_0x306a19[_0x34f4('0x1a')],_0x50c1d9=_0x35788a[_0x34f4('0x1b')],_0x532d33=_0x35788a['offset']+_0x35788a['limit'],_0x54d457;if(_0x532d33>=_0xef09e1){_0x532d33=_0xef09e1;_0x54d457=0xc8;}else{_0x54d457=0xce;}_0x557d7a['status'](_0x54d457);return _0x557d7a['set'](_0x34f4('0x1c'),_0x50c1d9+'-'+_0x532d33+'/'+_0xef09e1)[_0x34f4('0x19')](_0x306a19);}return null;};}function patchUpdates(_0x4bb216){return function(_0x376c91){try{jsonpatch['apply'](_0x376c91,_0x4bb216,!![]);}catch(_0x12fdea){return BPromise['reject'](_0x12fdea);}return _0x376c91[_0x34f4('0x1d')]();};}function saveUpdates(_0x16fc13,_0x1fa00c){return function(_0x5d143e){if(_0x5d143e){return _0x5d143e[_0x34f4('0x1e')](_0x16fc13)[_0x34f4('0x1f')](function(_0x405267){return _0x405267;});}return null;};}function removeEntity(_0x5c6b0c,_0xbee5cf){return function(_0x460741){if(_0x460741){return _0x460741[_0x34f4('0x20')]()[_0x34f4('0x1f')](function(){var _0x397dfe=_0x460741[_0x34f4('0x21')]({'plain':!![]});var _0x14772d=_0x34f4('0x22');return db[_0x34f4('0x23')]['destroy']({'where':{'type':_0x14772d,'resourceId':_0x397dfe['id']}})[_0x34f4('0x1f')](function(){return _0x460741;});})['then'](function(){_0x5c6b0c[_0x34f4('0x18')](0xcc)[_0x34f4('0x17')]();});}};}function handleEntityNotFound(_0xa93e86,_0x378a79){return function(_0x570df6){if(!_0x570df6){_0xa93e86[_0x34f4('0x16')](0x194);}return _0x570df6;};}function handleError(_0x26e728,_0x40e533){_0x40e533=_0x40e533||0x1f4;return function(_0x3b942c){logger[_0x34f4('0x24')](_0x3b942c[_0x34f4('0x25')]);if(_0x3b942c[_0x34f4('0x26')]){delete _0x3b942c[_0x34f4('0x26')];}_0x26e728[_0x34f4('0x18')](_0x40e533)[_0x34f4('0x27')](_0x3b942c);};}exports[_0x34f4('0x28')]=function(_0x413cab,_0x17a183){var _0x3bf2ae={},_0x335e52={},_0x56ec71={'count':0x0,'rows':[]};var _0x1feda8=db[_0x34f4('0x29')][_0x34f4('0x2a')];_0x335e52[_0x34f4('0x2b')]=_['keys'](_0x1feda8);_0x335e52[_0x34f4('0x2c')]=_[_0x34f4('0x2d')](_0x413cab[_0x34f4('0x2c')]);_0x335e52[_0x34f4('0x2e')]=_[_0x34f4('0x2f')](_0x335e52[_0x34f4('0x2b')],_0x335e52[_0x34f4('0x2c')]);_0x3bf2ae[_0x34f4('0x30')]=_[_0x34f4('0x2f')](_0x335e52['model'],qs[_0x34f4('0x31')](_0x413cab[_0x34f4('0x2c')][_0x34f4('0x31')]));_0x3bf2ae['attributes']=_0x3bf2ae['attributes'][_0x34f4('0x32')]?_0x3bf2ae[_0x34f4('0x30')]:_0x335e52[_0x34f4('0x2b')];if(!_0x413cab[_0x34f4('0x2c')][_0x34f4('0x33')]('nolimit')){_0x3bf2ae[_0x34f4('0x34')]=qs[_0x34f4('0x34')](_0x413cab['query'][_0x34f4('0x34')]);_0x3bf2ae[_0x34f4('0x1b')]=qs[_0x34f4('0x1b')](_0x413cab['query'][_0x34f4('0x1b')]);}_0x3bf2ae[_0x34f4('0x35')]=qs['sort'](_0x413cab[_0x34f4('0x2c')][_0x34f4('0x36')]);_0x3bf2ae[_0x34f4('0x37')]=qs['filters'](_[_0x34f4('0x38')](_0x413cab['query'],_0x335e52[_0x34f4('0x2e')]));if(_0x413cab[_0x34f4('0x2c')][_0x34f4('0x39')]){_0x3bf2ae[_0x34f4('0x37')]=_[_0x34f4('0x3a')](_0x3bf2ae[_0x34f4('0x37')],{'$or':_[_0x34f4('0x3b')](_0x1feda8,function(_0x3b4ee1){if(_0x3b4ee1[_0x34f4('0x3c')][_0x34f4('0x3d')]!==_0x34f4('0x3e')){var _0x525b46={};_0x525b46[_0x3b4ee1[_0x34f4('0x3f')]]={'$like':'%'+_0x413cab['query'][_0x34f4('0x39')]+'%'};return _0x525b46;}})});}_0x3bf2ae=_[_0x34f4('0x3a')]({},_0x3bf2ae,_0x413cab['options']);var _0x4d3f34={'where':_0x3bf2ae[_0x34f4('0x37')]};return db['Interval'][_0x34f4('0x1a')](_0x4d3f34)[_0x34f4('0x1f')](function(_0x35bf40){_0x56ec71['count']=_0x35bf40;if(_0x413cab[_0x34f4('0x2c')][_0x34f4('0x40')]){_0x3bf2ae[_0x34f4('0x41')]=[{'all':!![]}];}return db['Interval'][_0x34f4('0x42')](_0x3bf2ae);})[_0x34f4('0x1f')](function(_0x502b7d){_0x56ec71[_0x34f4('0x43')]=_0x502b7d;return _0x56ec71;})[_0x34f4('0x1f')](respondWithFilteredResult(_0x17a183,_0x3bf2ae))['catch'](handleError(_0x17a183,null));};exports[_0x34f4('0x44')]=function(_0x1c6e87,_0x2215b1){var _0x42b1f4={'raw':!![],'where':{'id':_0x1c6e87['params']['id']}},_0x395002={};_0x395002[_0x34f4('0x2b')]=_['keys'](db[_0x34f4('0x29')]['rawAttributes']);_0x395002[_0x34f4('0x2c')]=_[_0x34f4('0x2d')](_0x1c6e87['query']);_0x395002[_0x34f4('0x2e')]=_[_0x34f4('0x2f')](_0x395002['model'],_0x395002[_0x34f4('0x2c')]);_0x42b1f4[_0x34f4('0x30')]=_[_0x34f4('0x2f')](_0x395002['model'],qs['fields'](_0x1c6e87[_0x34f4('0x2c')][_0x34f4('0x31')]));_0x42b1f4['attributes']=_0x42b1f4[_0x34f4('0x30')][_0x34f4('0x32')]?_0x42b1f4[_0x34f4('0x30')]:_0x395002[_0x34f4('0x2b')];if(_0x1c6e87['query'][_0x34f4('0x40')]){_0x42b1f4['include']=[{'all':!![]}];}_0x42b1f4=_[_0x34f4('0x3a')]({},_0x42b1f4,_0x1c6e87[_0x34f4('0x45')]);return db[_0x34f4('0x29')][_0x34f4('0x46')](_0x42b1f4)[_0x34f4('0x1f')](handleEntityNotFound(_0x2215b1,null))['then'](respondWithResult(_0x2215b1,null))[_0x34f4('0x47')](handleError(_0x2215b1,null));};exports['create']=function(_0x4e6cf8,_0x349e0f){return db[_0x34f4('0x29')]['create'](_0x4e6cf8[_0x34f4('0x48')],{})[_0x34f4('0x1f')](function(_0x143712){var _0x14cf72=_0x4e6cf8[_0x34f4('0x49')]['get']({'plain':!![]});if(!_0x14cf72)throw new Error(_0x34f4('0x4a'));if(_0x14cf72[_0x34f4('0x4b')]===_0x34f4('0x49')){var _0x1e86f7=_0x143712[_0x34f4('0x21')]({'plain':!![]});var _0x24725a='Intervals';return db[_0x34f4('0x4c')]['find']({'where':{'name':_0x24725a,'userProfileId':_0x14cf72[_0x34f4('0x4d')]},'raw':!![]})[_0x34f4('0x1f')](function(_0x44124d){if(_0x44124d&&_0x44124d[_0x34f4('0x4e')]===0x0){return db['UserProfileResource'][_0x34f4('0x4f')]({'name':_0x1e86f7[_0x34f4('0x26')],'resourceId':_0x1e86f7['id'],'type':_0x44124d[_0x34f4('0x26')],'sectionId':_0x44124d['id']},{})['then'](function(){return _0x143712;});}else{return _0x143712;}})[_0x34f4('0x47')](function(_0x3ef3be){logger[_0x34f4('0x24')](_0x34f4('0x50'),_0x3ef3be);throw _0x3ef3be;});}return _0x143712;})[_0x34f4('0x1f')](respondWithResult(_0x349e0f,0xc9))[_0x34f4('0x47')](handleError(_0x349e0f,null));};exports['update']=function(_0x481dd1,_0x31b965){if(_0x481dd1[_0x34f4('0x48')]['id']){delete _0x481dd1[_0x34f4('0x48')]['id'];}return db[_0x34f4('0x29')]['find']({'where':{'id':_0x481dd1[_0x34f4('0x51')]['id']}})[_0x34f4('0x1f')](handleEntityNotFound(_0x31b965,null))[_0x34f4('0x1f')](saveUpdates(_0x481dd1[_0x34f4('0x48')],null))[_0x34f4('0x1f')](respondWithResult(_0x31b965,null))[_0x34f4('0x47')](handleError(_0x31b965,null));};exports[_0x34f4('0x20')]=function(_0xc61ce8,_0x486560){return db['Interval']['find']({'where':{'id':_0xc61ce8[_0x34f4('0x51')]['id']}})[_0x34f4('0x1f')](handleEntityNotFound(_0x486560,null))['then'](removeEntity(_0x486560,null))[_0x34f4('0x47')](handleError(_0x486560,null));};exports['addInterval']=function(_0x538778,_0xc00ea6,_0x34a105){if(_0x538778['body']['id']){delete _0x538778['body']['id'];}return db['Interval'][_0x34f4('0x46')]({'where':{'id':_0x538778[_0x34f4('0x51')]['id']}})[_0x34f4('0x1f')](handleEntityNotFound(_0xc00ea6,null))[_0x34f4('0x1f')](function(_0x44e15a){if(_0x44e15a){_0x538778[_0x34f4('0x48')][_0x34f4('0x52')]=_0x44e15a['id'];return db[_0x34f4('0x29')]['create'](_0x538778[_0x34f4('0x48')]);}})['then'](respondWithResult(_0xc00ea6,null))[_0x34f4('0x47')](handleError(_0xc00ea6,null));};exports['getIntervals']=function(_0x3ab549,_0xd6e370,_0x178801){var _0x878fa1={};var _0x3619e1={};var _0x3f3606;var _0xd99df0;return db[_0x34f4('0x29')][_0x34f4('0x53')]({'where':{'id':_0x3ab549[_0x34f4('0x51')]['id']}})[_0x34f4('0x1f')](handleEntityNotFound(_0xd6e370,null))[_0x34f4('0x1f')](function(_0x25782c){if(_0x25782c){_0x3f3606=_0x25782c;_0x3619e1[_0x34f4('0x2b')]=_[_0x34f4('0x2d')](db[_0x34f4('0x29')][_0x34f4('0x2a')]);_0x3619e1[_0x34f4('0x2c')]=_['keys'](_0x3ab549[_0x34f4('0x2c')]);_0x3619e1[_0x34f4('0x2e')]=_['intersection'](_0x3619e1['model'],_0x3619e1['query']);_0x878fa1[_0x34f4('0x30')]=_[_0x34f4('0x2f')](_0x3619e1[_0x34f4('0x2b')],qs[_0x34f4('0x31')](_0x3ab549[_0x34f4('0x2c')]['fields']));_0x878fa1['attributes']=_0x878fa1['attributes'][_0x34f4('0x32')]?_0x878fa1['attributes']:_0x3619e1[_0x34f4('0x2b')];_0x878fa1[_0x34f4('0x35')]=qs[_0x34f4('0x36')](_0x3ab549[_0x34f4('0x2c')][_0x34f4('0x36')]);_0x878fa1[_0x34f4('0x37')]=qs[_0x34f4('0x2e')](_[_0x34f4('0x38')](_0x3ab549[_0x34f4('0x2c')],_0x3619e1[_0x34f4('0x2e')]));if(_0x3ab549['query']['filter']){_0x878fa1[_0x34f4('0x37')]=_[_0x34f4('0x3a')](_0x878fa1[_0x34f4('0x37')],{'$or':_[_0x34f4('0x3b')](_0x878fa1[_0x34f4('0x30')],function(_0x47fcec){var _0x11f0e0={};_0x11f0e0[_0x47fcec]={'$like':'%'+_0x3ab549['query']['filter']+'%'};return _0x11f0e0;})});}_0x878fa1=_['merge']({},_0x878fa1,_0x3ab549['options']);return _0x3f3606[_0x34f4('0x54')](_0x878fa1);}})[_0x34f4('0x1f')](function(_0x5f1ee4){if(_0x5f1ee4){_0xd99df0=_0x5f1ee4[_0x34f4('0x32')];if(!_0x3ab549[_0x34f4('0x2c')][_0x34f4('0x33')](_0x34f4('0x55'))){_0x878fa1[_0x34f4('0x34')]=qs['limit'](_0x3ab549[_0x34f4('0x2c')][_0x34f4('0x34')]);_0x878fa1[_0x34f4('0x1b')]=qs[_0x34f4('0x1b')](_0x3ab549['query'][_0x34f4('0x1b')]);}return _0x3f3606[_0x34f4('0x54')](_0x878fa1);}})[_0x34f4('0x1f')](function(_0x548b5b){if(_0x548b5b){return _0x548b5b?{'count':_0xd99df0,'rows':_0x548b5b}:null;}})[_0x34f4('0x1f')](respondWithResult(_0xd6e370,null))[_0x34f4('0x47')](handleError(_0xd6e370,null));};exports[_0x34f4('0x56')]=function(_0x321987,_0x3efe4d,_0x2788ae){return db[_0x34f4('0x29')][_0x34f4('0x53')]({'where':{'id':_0x321987[_0x34f4('0x51')]['id']}})['then'](handleEntityNotFound(_0x3efe4d,null))['then'](function(_0x16e037){if(_0x16e037){return db[_0x34f4('0x57')][_0x34f4('0x58')](function(_0x5d7a3d){return db[_0x34f4('0x29')]['destroy']({'where':{'IntervalId':_0x321987[_0x34f4('0x51')]['id']},'transaction':_0x5d7a3d})['then'](function(_0x272b9a){var _0x2184c8=_['map'](_0x321987[_0x34f4('0x48')],function(_0x41f170){delete _0x41f170['id'];_0x41f170[_0x34f4('0x52')]=_0x321987[_0x34f4('0x51')]['id'];return _0x41f170;});return db['Interval'][_0x34f4('0x59')](_0x2184c8,{'transaction':_0x5d7a3d});});})[_0x34f4('0x1f')](function(){return db[_0x34f4('0x29')][_0x34f4('0x42')]({'where':{'IntervalId':_0x321987['params']['id']}});});}})[_0x34f4('0x1f')](respondWithResult(_0x3efe4d,null))[_0x34f4('0x47')](handleError(_0x3efe4d,null));}; \ No newline at end of file +var _0x85b5=['Intervals','UserProfileSection','find','userProfileId','autoAssociation','name','update','params','addInterval','IntervalId','getIntervals','findOne','order','pick','map','hasOwnProperty','addIntervals','sequelize','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','then','get','error','stack','send','index','Interval','rawAttributes','keys','query','filters','intersection','model','attributes','fields','nolimit','sort','where','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','show','length','merge','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user'];(function(_0x4c5708,_0x34b1f9){var _0x37fa9b=function(_0x534dc4){while(--_0x534dc4){_0x4c5708['push'](_0x4c5708['shift']());}};_0x37fa9b(++_0x34b1f9);}(_0x85b5,0xcc));var _0x585b=function(_0x300ac7,_0xe1df87){_0x300ac7=_0x300ac7-0x0;var _0x57b19f=_0x85b5[_0x300ac7];return _0x57b19f;};'use strict';var pdf=require(_0x585b('0x0'));var emlformat=require(_0x585b('0x1'));var rimraf=require(_0x585b('0x2'));var zipdir=require(_0x585b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x585b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x585b('0x5'));var util=require(_0x585b('0x6'));var path=require(_0x585b('0x7'));var sox=require(_0x585b('0x8'));var csv=require(_0x585b('0x9'));var ejs=require(_0x585b('0xa'));var fs=require('fs');var _=require(_0x585b('0xb'));var squel=require(_0x585b('0xc'));var crypto=require(_0x585b('0xd'));var jsforce=require(_0x585b('0xe'));var deskjs=require(_0x585b('0xf'));var toCsv=require(_0x585b('0x9'));var querystring=require(_0x585b('0x10'));var Papa=require(_0x585b('0x11'));var authService=require(_0x585b('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x585b('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x585b('0x14'))(_0x585b('0x15'));var utils=require(_0x585b('0x16'));var config=require(_0x585b('0x17'));var db=require(_0x585b('0x18'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x51db1b,_0x544538){_0x544538=_0x544538||0xcc;return function(_0x5c36e1){if(_0x5c36e1){return _0x51db1b[_0x585b('0x19')](_0x544538);}return _0x51db1b[_0x585b('0x1a')](_0x544538)[_0x585b('0x1b')]();};}function respondWithResult(_0x188e2c,_0x4fce4c){_0x4fce4c=_0x4fce4c||0xc8;return function(_0x41e371){if(_0x41e371){return _0x188e2c['status'](_0x4fce4c)['json'](_0x41e371);}};}function respondWithFilteredResult(_0xc87de1,_0x7a00a4){return function(_0x3d4241){if(_0x3d4241){var _0x2eefc3=_0x3d4241[_0x585b('0x1c')],_0x3fcbeb=_0x7a00a4[_0x585b('0x1d')],_0x27a84a=_0x7a00a4[_0x585b('0x1d')]+_0x7a00a4[_0x585b('0x1e')],_0x2a896e;if(_0x27a84a>=_0x2eefc3){_0x27a84a=_0x2eefc3;_0x2a896e=0xc8;}else{_0x2a896e=0xce;}_0xc87de1[_0x585b('0x1a')](_0x2a896e);return _0xc87de1[_0x585b('0x1f')](_0x585b('0x20'),_0x3fcbeb+'-'+_0x27a84a+'/'+_0x2eefc3)[_0x585b('0x21')](_0x3d4241);}return null;};}function patchUpdates(_0x1f33f8){return function(_0x52115d){try{jsonpatch[_0x585b('0x22')](_0x52115d,_0x1f33f8,!![]);}catch(_0x2e2bc2){return BPromise[_0x585b('0x23')](_0x2e2bc2);}return _0x52115d[_0x585b('0x24')]();};}function saveUpdates(_0x18cf82,_0x530f9f){return function(_0xbc0dd0){if(_0xbc0dd0){return _0xbc0dd0['update'](_0x18cf82)['then'](function(_0x530ba5){return _0x530ba5;});}return null;};}function removeEntity(_0x22dbb7,_0x493a8c){return function(_0x494cb6){if(_0x494cb6){return _0x494cb6[_0x585b('0x25')]()[_0x585b('0x26')](function(){var _0x30bf11=_0x494cb6[_0x585b('0x27')]({'plain':!![]});var _0x495a6a='Intervals';return db['UserProfileResource'][_0x585b('0x25')]({'where':{'type':_0x495a6a,'resourceId':_0x30bf11['id']}})[_0x585b('0x26')](function(){return _0x494cb6;});})['then'](function(){_0x22dbb7['status'](0xcc)[_0x585b('0x1b')]();});}};}function handleEntityNotFound(_0x2dfa58,_0x41eb54){return function(_0x2dc1b9){if(!_0x2dc1b9){_0x2dfa58[_0x585b('0x19')](0x194);}return _0x2dc1b9;};}function handleError(_0x3becb3,_0x2004c1){_0x2004c1=_0x2004c1||0x1f4;return function(_0x1e566a){logger[_0x585b('0x28')](_0x1e566a[_0x585b('0x29')]);if(_0x1e566a['name']){delete _0x1e566a['name'];}_0x3becb3['status'](_0x2004c1)[_0x585b('0x2a')](_0x1e566a);};}exports[_0x585b('0x2b')]=function(_0x4ba204,_0x315577){var _0x40476b={},_0x9d8813={},_0x597827={'count':0x0,'rows':[]};var _0x3dda6a=db[_0x585b('0x2c')][_0x585b('0x2d')];_0x9d8813['model']=_['keys'](_0x3dda6a);_0x9d8813['query']=_[_0x585b('0x2e')](_0x4ba204[_0x585b('0x2f')]);_0x9d8813[_0x585b('0x30')]=_[_0x585b('0x31')](_0x9d8813[_0x585b('0x32')],_0x9d8813['query']);_0x40476b[_0x585b('0x33')]=_[_0x585b('0x31')](_0x9d8813['model'],qs[_0x585b('0x34')](_0x4ba204[_0x585b('0x2f')][_0x585b('0x34')]));_0x40476b[_0x585b('0x33')]=_0x40476b[_0x585b('0x33')]['length']?_0x40476b[_0x585b('0x33')]:_0x9d8813[_0x585b('0x32')];if(!_0x4ba204[_0x585b('0x2f')]['hasOwnProperty'](_0x585b('0x35'))){_0x40476b[_0x585b('0x1e')]=qs[_0x585b('0x1e')](_0x4ba204[_0x585b('0x2f')][_0x585b('0x1e')]);_0x40476b[_0x585b('0x1d')]=qs[_0x585b('0x1d')](_0x4ba204[_0x585b('0x2f')][_0x585b('0x1d')]);}_0x40476b['order']=qs[_0x585b('0x36')](_0x4ba204['query']['sort']);_0x40476b[_0x585b('0x37')]=qs[_0x585b('0x30')](_['pick'](_0x4ba204[_0x585b('0x2f')],_0x9d8813[_0x585b('0x30')]));if(_0x4ba204[_0x585b('0x2f')]['filter']){_0x40476b[_0x585b('0x37')]=_['merge'](_0x40476b['where'],{'$or':_['map'](_0x3dda6a,function(_0x24534e){if(_0x24534e[_0x585b('0x38')][_0x585b('0x39')]!==_0x585b('0x3a')){var _0x1b2b2d={};_0x1b2b2d[_0x24534e[_0x585b('0x3b')]]={'$like':'%'+_0x4ba204[_0x585b('0x2f')][_0x585b('0x3c')]+'%'};return _0x1b2b2d;}})});}_0x40476b=_['merge']({},_0x40476b,_0x4ba204[_0x585b('0x3d')]);var _0x1974b6={'where':_0x40476b['where']};return db[_0x585b('0x2c')]['count'](_0x1974b6)['then'](function(_0x118670){_0x597827[_0x585b('0x1c')]=_0x118670;if(_0x4ba204[_0x585b('0x2f')][_0x585b('0x3e')]){_0x40476b[_0x585b('0x3f')]=[{'all':!![]}];}return db['Interval'][_0x585b('0x40')](_0x40476b);})[_0x585b('0x26')](function(_0x311429){_0x597827[_0x585b('0x41')]=_0x311429;return _0x597827;})['then'](respondWithFilteredResult(_0x315577,_0x40476b))['catch'](handleError(_0x315577,null));};exports[_0x585b('0x42')]=function(_0x5d8bf8,_0x4ad68a){var _0x953946={'raw':!![],'where':{'id':_0x5d8bf8['params']['id']}},_0x3b63c1={};_0x3b63c1[_0x585b('0x32')]=_[_0x585b('0x2e')](db[_0x585b('0x2c')][_0x585b('0x2d')]);_0x3b63c1[_0x585b('0x2f')]=_[_0x585b('0x2e')](_0x5d8bf8[_0x585b('0x2f')]);_0x3b63c1[_0x585b('0x30')]=_[_0x585b('0x31')](_0x3b63c1[_0x585b('0x32')],_0x3b63c1['query']);_0x953946[_0x585b('0x33')]=_['intersection'](_0x3b63c1[_0x585b('0x32')],qs[_0x585b('0x34')](_0x5d8bf8[_0x585b('0x2f')][_0x585b('0x34')]));_0x953946[_0x585b('0x33')]=_0x953946[_0x585b('0x33')][_0x585b('0x43')]?_0x953946[_0x585b('0x33')]:_0x3b63c1[_0x585b('0x32')];if(_0x5d8bf8[_0x585b('0x2f')]['includeAll']){_0x953946[_0x585b('0x3f')]=[{'all':!![]}];}_0x953946=_[_0x585b('0x44')]({},_0x953946,_0x5d8bf8[_0x585b('0x3d')]);return db[_0x585b('0x2c')]['find'](_0x953946)[_0x585b('0x26')](handleEntityNotFound(_0x4ad68a,null))[_0x585b('0x26')](respondWithResult(_0x4ad68a,null))[_0x585b('0x45')](handleError(_0x4ad68a,null));};exports[_0x585b('0x46')]=function(_0x2556cd,_0x10389c){return db[_0x585b('0x2c')]['create'](_0x2556cd[_0x585b('0x47')],{})[_0x585b('0x26')](function(_0x1981eb){var _0x97f028=_0x2556cd['user'][_0x585b('0x27')]({'plain':!![]});if(!_0x97f028)throw new Error(_0x585b('0x48'));if(_0x97f028[_0x585b('0x49')]===_0x585b('0x4a')){var _0x490aed=_0x1981eb[_0x585b('0x27')]({'plain':!![]});var _0x1e1ff1=_0x585b('0x4b');return db[_0x585b('0x4c')][_0x585b('0x4d')]({'where':{'name':_0x1e1ff1,'userProfileId':_0x97f028[_0x585b('0x4e')]},'raw':!![]})['then'](function(_0x26f332){if(_0x26f332&&_0x26f332[_0x585b('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x490aed[_0x585b('0x50')],'resourceId':_0x490aed['id'],'type':_0x26f332[_0x585b('0x50')],'sectionId':_0x26f332['id']},{})['then'](function(){return _0x1981eb;});}else{return _0x1981eb;}})[_0x585b('0x45')](function(_0x519abe){logger[_0x585b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x519abe);throw _0x519abe;});}return _0x1981eb;})[_0x585b('0x26')](respondWithResult(_0x10389c,0xc9))['catch'](handleError(_0x10389c,null));};exports[_0x585b('0x51')]=function(_0x343056,_0x47dda2){if(_0x343056[_0x585b('0x47')]['id']){delete _0x343056['body']['id'];}return db['Interval'][_0x585b('0x4d')]({'where':{'id':_0x343056['params']['id']}})[_0x585b('0x26')](handleEntityNotFound(_0x47dda2,null))['then'](saveUpdates(_0x343056[_0x585b('0x47')],null))[_0x585b('0x26')](respondWithResult(_0x47dda2,null))[_0x585b('0x45')](handleError(_0x47dda2,null));};exports[_0x585b('0x25')]=function(_0x33f574,_0x15cd73){return db[_0x585b('0x2c')]['find']({'where':{'id':_0x33f574[_0x585b('0x52')]['id']}})[_0x585b('0x26')](handleEntityNotFound(_0x15cd73,null))[_0x585b('0x26')](removeEntity(_0x15cd73,null))[_0x585b('0x45')](handleError(_0x15cd73,null));};exports[_0x585b('0x53')]=function(_0x29b07d,_0x20075d,_0x2e20b0){if(_0x29b07d[_0x585b('0x47')]['id']){delete _0x29b07d['body']['id'];}return db['Interval'][_0x585b('0x4d')]({'where':{'id':_0x29b07d[_0x585b('0x52')]['id']}})['then'](handleEntityNotFound(_0x20075d,null))[_0x585b('0x26')](function(_0x5e2aa3){if(_0x5e2aa3){_0x29b07d[_0x585b('0x47')][_0x585b('0x54')]=_0x5e2aa3['id'];return db[_0x585b('0x2c')][_0x585b('0x46')](_0x29b07d[_0x585b('0x47')]);}})[_0x585b('0x26')](respondWithResult(_0x20075d,null))[_0x585b('0x45')](handleError(_0x20075d,null));};exports[_0x585b('0x55')]=function(_0x5a0830,_0x2b4497,_0x36cbb9){var _0x3d08fd={};var _0x317278={};var _0x585edd;var _0x1e4c00;return db['Interval'][_0x585b('0x56')]({'where':{'id':_0x5a0830[_0x585b('0x52')]['id']}})['then'](handleEntityNotFound(_0x2b4497,null))[_0x585b('0x26')](function(_0x5778dc){if(_0x5778dc){_0x585edd=_0x5778dc;_0x317278['model']=_[_0x585b('0x2e')](db[_0x585b('0x2c')]['rawAttributes']);_0x317278[_0x585b('0x2f')]=_[_0x585b('0x2e')](_0x5a0830[_0x585b('0x2f')]);_0x317278['filters']=_['intersection'](_0x317278['model'],_0x317278[_0x585b('0x2f')]);_0x3d08fd[_0x585b('0x33')]=_[_0x585b('0x31')](_0x317278[_0x585b('0x32')],qs['fields'](_0x5a0830['query'][_0x585b('0x34')]));_0x3d08fd[_0x585b('0x33')]=_0x3d08fd[_0x585b('0x33')][_0x585b('0x43')]?_0x3d08fd[_0x585b('0x33')]:_0x317278['model'];_0x3d08fd[_0x585b('0x57')]=qs['sort'](_0x5a0830[_0x585b('0x2f')][_0x585b('0x36')]);_0x3d08fd[_0x585b('0x37')]=qs[_0x585b('0x30')](_[_0x585b('0x58')](_0x5a0830[_0x585b('0x2f')],_0x317278[_0x585b('0x30')]));if(_0x5a0830[_0x585b('0x2f')][_0x585b('0x3c')]){_0x3d08fd['where']=_[_0x585b('0x44')](_0x3d08fd['where'],{'$or':_[_0x585b('0x59')](_0x3d08fd[_0x585b('0x33')],function(_0x18c610){var _0x37095b={};_0x37095b[_0x18c610]={'$like':'%'+_0x5a0830[_0x585b('0x2f')][_0x585b('0x3c')]+'%'};return _0x37095b;})});}_0x3d08fd=_[_0x585b('0x44')]({},_0x3d08fd,_0x5a0830[_0x585b('0x3d')]);return _0x585edd[_0x585b('0x55')](_0x3d08fd);}})[_0x585b('0x26')](function(_0x447b5a){if(_0x447b5a){_0x1e4c00=_0x447b5a[_0x585b('0x43')];if(!_0x5a0830[_0x585b('0x2f')][_0x585b('0x5a')](_0x585b('0x35'))){_0x3d08fd['limit']=qs[_0x585b('0x1e')](_0x5a0830[_0x585b('0x2f')]['limit']);_0x3d08fd[_0x585b('0x1d')]=qs[_0x585b('0x1d')](_0x5a0830[_0x585b('0x2f')][_0x585b('0x1d')]);}return _0x585edd[_0x585b('0x55')](_0x3d08fd);}})[_0x585b('0x26')](function(_0x556a7f){if(_0x556a7f){return _0x556a7f?{'count':_0x1e4c00,'rows':_0x556a7f}:null;}})['then'](respondWithResult(_0x2b4497,null))[_0x585b('0x45')](handleError(_0x2b4497,null));};exports[_0x585b('0x5b')]=function(_0x103fa7,_0x1afad0,_0x36b104){return db[_0x585b('0x2c')]['findOne']({'where':{'id':_0x103fa7['params']['id']}})[_0x585b('0x26')](handleEntityNotFound(_0x1afad0,null))[_0x585b('0x26')](function(_0x4c7579){if(_0x4c7579){return db[_0x585b('0x5c')]['transaction'](function(_0x413050){return db[_0x585b('0x2c')][_0x585b('0x25')]({'where':{'IntervalId':_0x103fa7[_0x585b('0x52')]['id']},'transaction':_0x413050})[_0x585b('0x26')](function(_0x497ac3){var _0x4c86d7=_[_0x585b('0x59')](_0x103fa7[_0x585b('0x47')],function(_0xd9a99c){delete _0xd9a99c['id'];_0xd9a99c[_0x585b('0x54')]=_0x103fa7[_0x585b('0x52')]['id'];return _0xd9a99c;});return db[_0x585b('0x2c')]['bulkCreate'](_0x4c86d7,{'transaction':_0x413050});});})['then'](function(){return db[_0x585b('0x2c')][_0x585b('0x40')]({'where':{'IntervalId':_0x103fa7[_0x585b('0x52')]['id']}});});}})[_0x585b('0x26')](respondWithResult(_0x1afad0,null))['catch'](handleError(_0x1afad0,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index cb95010..f94b57c 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 _0xde5e=['./interval.attributes','../../components/extensions/rewrite','define','rewrite','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x147b7b,_0x475438){var _0x37e3b4=function(_0x2ade27){while(--_0x2ade27){_0x147b7b['push'](_0x147b7b['shift']());}};_0x37e3b4(++_0x475438);}(_0xde5e,0xae));var _0xede5=function(_0x907b68,_0x1ed3fa){_0x907b68=_0x907b68-0x0;var _0x4d55c8=_0xde5e[_0x907b68];return _0x4d55c8;};'use strict';var _=require('lodash');var util=require(_0xede5('0x0'));var logger=require(_0xede5('0x1'))(_0xede5('0x2'));var moment=require(_0xede5('0x3'));var BPromise=require(_0xede5('0x4'));var rp=require(_0xede5('0x5'));var attributes=require(_0xede5('0x6'));var extensions=require(_0xede5('0x7'));module['exports']=function(_0x326af1,_0x286879){return _0x326af1[_0xede5('0x8')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d875d,_0x5106f6){extensions['rewrite'](_0x326af1,_0x3d875d);},'afterBulkCreate':function(_0x5c51e1,_0x50e01e,_0x2ad0e0){_0x2ad0e0();extensions['rewrite'](_0x326af1,_0x5c51e1[0x0]);},'afterUpdate':function(_0x406da0,_0x37a9cd){extensions[_0xede5('0x9')](_0x326af1,_0x406da0);},'afterDestroy':function(_0x2654c8,_0x4bee69){extensions[_0xede5('0x9')](_0x326af1,_0x2654c8);}}});}; \ No newline at end of file +var _0x0c7a=['rewrite','lodash','../../config/logger','moment','bluebird','request-promise','../../components/extensions/rewrite','exports','define','Interval','tools_intervals'];(function(_0x2101bd,_0x24dbd1){var _0x4afc0d=function(_0x29951c){while(--_0x29951c){_0x2101bd['push'](_0x2101bd['shift']());}};_0x4afc0d(++_0x24dbd1);}(_0x0c7a,0x1a3));var _0xa0c7=function(_0x6e4d83,_0x2435d8){_0x6e4d83=_0x6e4d83-0x0;var _0x3ce968=_0x0c7a[_0x6e4d83];return _0x3ce968;};'use strict';var _=require(_0xa0c7('0x0'));var util=require('util');var logger=require(_0xa0c7('0x1'))('api');var moment=require(_0xa0c7('0x2'));var BPromise=require(_0xa0c7('0x3'));var rp=require(_0xa0c7('0x4'));var attributes=require('./interval.attributes');var extensions=require(_0xa0c7('0x5'));module[_0xa0c7('0x6')]=function(_0x341d6b,_0x53f8b3){return _0x341d6b[_0xa0c7('0x7')](_0xa0c7('0x8'),attributes,{'tableName':_0xa0c7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x7fb922,_0x180e45){extensions[_0xa0c7('0xa')](_0x341d6b,_0x7fb922);},'afterBulkCreate':function(_0x9de770,_0x3841e0,_0x141741){_0x141741();extensions['rewrite'](_0x341d6b,_0x9de770[0x0]);},'afterUpdate':function(_0x31d33d,_0x5f2823){extensions[_0xa0c7('0xa')](_0x341d6b,_0x31d33d);},'afterDestroy':function(_0x541dae,_0x2abd20){extensions[_0xa0c7('0xa')](_0x341d6b,_0x541dae);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 2a637ef..f6e3cb7 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 _0x2123=['map','model','ShowInterval','Interval','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Interval,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Interval,\x20%s,\x20%s','message','catch','GetInterval','findAll','options','raw','where','attributes','include'];(function(_0x3886f5,_0x509dab){var _0x5b84ae=function(_0x5a9675){while(--_0x5a9675){_0x3886f5['push'](_0x3886f5['shift']());}};_0x5b84ae(++_0x509dab);}(_0x2123,0x190));var _0x3212=function(_0x314054,_0x1ad72c){_0x314054=_0x314054-0x0;var _0x56d285=_0x2123[_0x314054];return _0x56d285;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var moment=require(_0x3212('0x2'));var BPromise=require(_0x3212('0x3'));var rs=require(_0x3212('0x4'));var fs=require('fs');var Redis=require(_0x3212('0x5'));var db=require(_0x3212('0x6'))['db'];var utils=require(_0x3212('0x7'));var logger=require(_0x3212('0x8'))(_0x3212('0x9'));var config=require(_0x3212('0xa'));var jayson=require(_0x3212('0xb'));var client=jayson['client'][_0x3212('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b1302,_0x1fec5d,_0x4b35e9){return new BPromise(function(_0x3e17a3,_0x56c38f){return client[_0x3212('0xd')](_0x2b1302,_0x4b35e9)[_0x3212('0xe')](function(_0x8ca483){logger[_0x3212('0xf')]('Interval,\x20%s,\x20%s',_0x1fec5d,'request\x20sent');logger[_0x3212('0x10')](_0x3212('0x11'),_0x1fec5d,_0x3212('0x12'),JSON[_0x3212('0x13')](_0x8ca483));if(_0x8ca483[_0x3212('0x14')]){if(_0x8ca483[_0x3212('0x14')][_0x3212('0x15')]===0x1f4){logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);return _0x56c38f(_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);}logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);return _0x3e17a3(_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);}else{logger[_0x3212('0xf')](_0x3212('0x16'),_0x1fec5d,_0x3212('0x12'));_0x3e17a3(_0x8ca483['result'][_0x3212('0x17')]);}})[_0x3212('0x18')](function(_0x2720c6){logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x2720c6);_0x56c38f(_0x2720c6);});});}exports[_0x3212('0x19')]=function(_0x21954a){var _0x5b952f=this;return new Promise(function(_0x4c1158,_0x1cad7b){return db['Interval'][_0x3212('0x1a')]({'raw':_0x21954a[_0x3212('0x1b')]?_0x21954a[_0x3212('0x1b')][_0x3212('0x1c')]===undefined?!![]:![]:!![],'where':_0x21954a[_0x3212('0x1b')]?_0x21954a['options'][_0x3212('0x1d')]||null:null,'attributes':_0x21954a[_0x3212('0x1b')]?_0x21954a['options'][_0x3212('0x1e')]||null:null,'limit':_0x21954a[_0x3212('0x1b')]?_0x21954a[_0x3212('0x1b')]['limit']||null:null,'include':_0x21954a['options']?_0x21954a[_0x3212('0x1b')][_0x3212('0x1f')]?_[_0x3212('0x20')](_0x21954a[_0x3212('0x1b')][_0x3212('0x1f')],function(_0x436ecd){return{'model':db[_0x436ecd['model']],'as':_0x436ecd['as'],'attributes':_0x436ecd['attributes'],'include':_0x436ecd[_0x3212('0x1f')]?_['map'](_0x436ecd[_0x3212('0x1f')],function(_0x3108a6){return{'model':db[_0x3108a6[_0x3212('0x21')]],'as':_0x3108a6['as'],'attributes':_0x3108a6['attributes'],'include':_0x3108a6[_0x3212('0x1f')]?_[_0x3212('0x20')](_0x3108a6[_0x3212('0x1f')],function(_0x4de92e){return{'model':db[_0x4de92e[_0x3212('0x21')]],'as':_0x4de92e['as'],'attributes':_0x4de92e[_0x3212('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3212('0xe')](function(_0x443a5){logger[_0x3212('0xf')](_0x3212('0x19'),_0x21954a);logger[_0x3212('0x10')](_0x3212('0x19'),_0x21954a,JSON[_0x3212('0x13')](_0x443a5));_0x4c1158(_0x443a5);})[_0x3212('0x18')](function(_0x31c672){logger[_0x3212('0x14')]('GetInterval',_0x31c672[_0x3212('0x17')],_0x21954a);_0x1cad7b(_0x5b952f[_0x3212('0x14')](0x1f4,_0x31c672[_0x3212('0x17')]));});});};exports[_0x3212('0x22')]=function(_0x402a01){var _0x309420=this;return new Promise(function(_0x3a7883,_0x5059bd){return db[_0x3212('0x23')]['find']({'raw':_0x402a01[_0x3212('0x1b')]?_0x402a01['options'][_0x3212('0x1c')]===undefined?!![]:![]:!![],'where':_0x402a01['options']?_0x402a01['options'][_0x3212('0x1d')]||null:null,'attributes':_0x402a01['options']?_0x402a01[_0x3212('0x1b')][_0x3212('0x1e')]||null:null,'include':_0x402a01[_0x3212('0x1b')]?_0x402a01['options'][_0x3212('0x1f')]?_[_0x3212('0x20')](_0x402a01[_0x3212('0x1b')]['include'],function(_0x4ccbd1){return{'model':db[_0x4ccbd1[_0x3212('0x21')]],'as':_0x4ccbd1['as'],'attributes':_0x4ccbd1[_0x3212('0x1e')],'include':_0x4ccbd1[_0x3212('0x1f')]?_[_0x3212('0x20')](_0x4ccbd1['include'],function(_0x2b0437){return{'model':db[_0x2b0437[_0x3212('0x21')]],'as':_0x2b0437['as'],'attributes':_0x2b0437[_0x3212('0x1e')],'include':_0x2b0437['include']?_[_0x3212('0x20')](_0x2b0437[_0x3212('0x1f')],function(_0x40a602){return{'model':db[_0x40a602[_0x3212('0x21')]],'as':_0x40a602['as'],'attributes':_0x40a602['attributes']};}):[]};}):[]};}):[]:[]})[_0x3212('0xe')](function(_0x3f157c){logger[_0x3212('0xf')](_0x3212('0x22'),_0x402a01);logger['debug']('ShowInterval',_0x402a01,JSON['stringify'](_0x3f157c));_0x3a7883(_0x3f157c);})['catch'](function(_0xb2908a){logger[_0x3212('0x14')](_0x3212('0x22'),_0xb2908a[_0x3212('0x17')],_0x402a01);_0x5059bd(_0x309420['error'](0x1f4,_0xb2908a[_0x3212('0x17')]));});});}; \ No newline at end of file +var _0x31f0=['error','code','message','result','GetInterval','Interval','findAll','options','raw','where','attributes','include','model','then','catch','ShowInterval','find','map','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x447675,_0x3af6fe){var _0x553e5a=function(_0x270123){while(--_0x270123){_0x447675['push'](_0x447675['shift']());}};_0x553e5a(++_0x3af6fe);}(_0x31f0,0xb7));var _0x031f=function(_0x1a3f88,_0x38a506){_0x1a3f88=_0x1a3f88-0x0;var _0x4d7534=_0x31f0[_0x1a3f88];return _0x4d7534;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('Interval,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});}exports[_0x031f('0x13')]=function(_0x535e70){var _0x421f75=this;return new Promise(function(_0x5f2199,_0x563bc8){return db[_0x031f('0x14')][_0x031f('0x15')]({'raw':_0x535e70[_0x031f('0x16')]?_0x535e70[_0x031f('0x16')][_0x031f('0x17')]===undefined?!![]:![]:!![],'where':_0x535e70[_0x031f('0x16')]?_0x535e70[_0x031f('0x16')][_0x031f('0x18')]||null:null,'attributes':_0x535e70['options']?_0x535e70[_0x031f('0x16')][_0x031f('0x19')]||null:null,'limit':_0x535e70[_0x031f('0x16')]?_0x535e70['options']['limit']||null:null,'include':_0x535e70[_0x031f('0x16')]?_0x535e70['options'][_0x031f('0x1a')]?_['map'](_0x535e70['options']['include'],function(_0x971691){return{'model':db[_0x971691[_0x031f('0x1b')]],'as':_0x971691['as'],'attributes':_0x971691[_0x031f('0x19')],'include':_0x971691[_0x031f('0x1a')]?_['map'](_0x971691[_0x031f('0x1a')],function(_0x5a64c0){return{'model':db[_0x5a64c0[_0x031f('0x1b')]],'as':_0x5a64c0['as'],'attributes':_0x5a64c0[_0x031f('0x19')],'include':_0x5a64c0[_0x031f('0x1a')]?_['map'](_0x5a64c0[_0x031f('0x1a')],function(_0x3b2a51){return{'model':db[_0x3b2a51['model']],'as':_0x3b2a51['as'],'attributes':_0x3b2a51[_0x031f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x031f('0x1c')](function(_0x2403e9){logger['info'](_0x031f('0x13'),_0x535e70);logger[_0x031f('0xc')](_0x031f('0x13'),_0x535e70,JSON[_0x031f('0xe')](_0x2403e9));_0x5f2199(_0x2403e9);})[_0x031f('0x1d')](function(_0x301bd2){logger['error'](_0x031f('0x13'),_0x301bd2[_0x031f('0x11')],_0x535e70);_0x563bc8(_0x421f75[_0x031f('0xf')](0x1f4,_0x301bd2[_0x031f('0x11')]));});});};exports[_0x031f('0x1e')]=function(_0x2d24f0){var _0x378692=this;return new Promise(function(_0x87dc07,_0x2034ac){return db[_0x031f('0x14')][_0x031f('0x1f')]({'raw':_0x2d24f0['options']?_0x2d24f0[_0x031f('0x16')][_0x031f('0x17')]===undefined?!![]:![]:!![],'where':_0x2d24f0[_0x031f('0x16')]?_0x2d24f0[_0x031f('0x16')][_0x031f('0x18')]||null:null,'attributes':_0x2d24f0[_0x031f('0x16')]?_0x2d24f0[_0x031f('0x16')][_0x031f('0x19')]||null:null,'include':_0x2d24f0[_0x031f('0x16')]?_0x2d24f0[_0x031f('0x16')][_0x031f('0x1a')]?_[_0x031f('0x20')](_0x2d24f0[_0x031f('0x16')]['include'],function(_0x38061b){return{'model':db[_0x38061b[_0x031f('0x1b')]],'as':_0x38061b['as'],'attributes':_0x38061b['attributes'],'include':_0x38061b[_0x031f('0x1a')]?_[_0x031f('0x20')](_0x38061b['include'],function(_0x17b93c){return{'model':db[_0x17b93c[_0x031f('0x1b')]],'as':_0x17b93c['as'],'attributes':_0x17b93c[_0x031f('0x19')],'include':_0x17b93c[_0x031f('0x1a')]?_['map'](_0x17b93c['include'],function(_0x36ab13){return{'model':db[_0x36ab13['model']],'as':_0x36ab13['as'],'attributes':_0x36ab13[_0x031f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x031f('0x1c')](function(_0x43ef89){logger['info']('ShowInterval',_0x2d24f0);logger[_0x031f('0xc')]('ShowInterval',_0x2d24f0,JSON['stringify'](_0x43ef89));_0x87dc07(_0x43ef89);})[_0x031f('0x1d')](function(_0x45e3a4){logger[_0x031f('0xf')](_0x031f('0x1e'),_0x45e3a4[_0x031f('0x11')],_0x2d24f0);_0x2034ac(_0x378692[_0x031f('0xf')](0x1f4,_0x45e3a4[_0x031f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 64b9ec1..efbcc52 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x5358b7,_0x42da6f){var _0x54042d=function(_0x1e369a){while(--_0x1e369a){_0x5358b7['push'](_0x5358b7['shift']());}};_0x54042d(++_0x42da6f);}(_0xadb5,0xad));var _0x5adb=function(_0xa38d66,_0x444382){_0xa38d66=_0xa38d66-0x0;var _0x493017=_0xadb5[_0xa38d66];return _0x493017;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x11d56f,_0x5451fa){var _0x38c4ff=function(_0x562f1b){while(--_0x562f1b){_0x11d56f['push'](_0x11d56f['shift']());}};_0x38c4ff(++_0x5451fa);}(_0x5f2f,0x73));var _0xf5f2=function(_0x9d83c1,_0x20c4e6){_0x9d83c1=_0x9d83c1-0x0;var _0x4acc75=_0x5f2f[_0x9d83c1];return _0x4acc75;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 7a487eb..e734c82 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 _0xa9e0=['Basic\x20','toString','base64','utf8','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','send','body','connection','remoteAddress','socket','bluebird','https','../../config/logger','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json'];(function(_0x1b0dd3,_0x510b79){var _0x31b5da=function(_0x1c5e43){while(--_0x1c5e43){_0x1b0dd3['push'](_0x1b0dd3['shift']());}};_0x31b5da(++_0x510b79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var BPromise=require(_0x0a9e('0x0'));var https=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var USERNAME='support';var PASSWORD=_0x0a9e('0x3');function openIssue(_0x4ce2f1,_0x333808){var _0x432180={'fields':{'project':{'key':_0x4ce2f1[_0x0a9e('0x4')]||_0x0a9e('0x5')},'summary':(_0x4ce2f1[_0x0a9e('0x6')]||'Report')+_0x0a9e('0x7')+_0x4ce2f1['ip'],'description':_0x4ce2f1[_0x0a9e('0x8')]||JSON[_0x0a9e('0x9')](_0x4ce2f1),'issuetype':{'name':_0x4ce2f1['issuetype']||'Bug'}}};_0x432180[_0x0a9e('0xa')]['customfield_11500']=_0x4ce2f1['email'];_0x432180[_0x0a9e('0xa')][_0x0a9e('0xb')]=_0x4ce2f1[_0x0a9e('0xc')];_0x432180[_0x0a9e('0xa')][_0x0a9e('0xd')]=_0x4ce2f1[_0x0a9e('0xe')];_0x432180['fields']['customfield_11503']=_0x4ce2f1['name'];_0x432180['fields'][_0x0a9e('0xf')]=_0x4ce2f1[_0x0a9e('0x10')];_0x432180[_0x0a9e('0xa')][_0x0a9e('0x11')]=_0x4ce2f1['ip'];var _0x32d742={'host':_0x0a9e('0x12'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x0a9e('0x13'),'timeout':0x4e20,'headers':{'Content-Type':_0x0a9e('0x14'),'Authorization':_0x0a9e('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x0a9e('0x16')](_0x0a9e('0x17'))}};var _0x4d5611=JSON['stringify'](_0x432180);var _0x22dccb=https['request'](_0x32d742,function(_0x1985b6){_0x1985b6['setEncoding'](_0x0a9e('0x18'));var _0x12066b='';_0x1985b6['on']('data',function(_0x225616){_0x12066b+=_0x225616;});_0x1985b6['on']('end',function(){if(_0x333808){return _0x333808[_0x0a9e('0x19')](_0x1985b6[_0x0a9e('0x1a')])[_0x0a9e('0x1b')](JSON[_0x0a9e('0x1c')](_0x12066b));}});});_0x22dccb['on'](_0x0a9e('0x1d'),function(_0x2eb11f){if(_0x333808){return _0x333808[_0x0a9e('0x19')](0x1f4)[_0x0a9e('0x1b')]({'errors':[{'message':_0x0a9e('0x1e'),'type':_0x0a9e('0x1f')}]});}});_0x22dccb[_0x0a9e('0x20')](_0x4d5611);_0x22dccb[_0x0a9e('0x21')]();}exports['openIssue']=openIssue;exports[_0x0a9e('0x22')]=function(_0x155cce,_0x53682f){_0x155cce[_0x0a9e('0x23')]['ip']=_0x155cce['headers']['x-forwarded-for']||_0x155cce[_0x0a9e('0x24')][_0x0a9e('0x25')]||_0x155cce[_0x0a9e('0x26')][_0x0a9e('0x25')]||_0x155cce['connection'][_0x0a9e('0x26')][_0x0a9e('0x25')];return openIssue(_0x155cce[_0x0a9e('0x23')],_0x53682f);}; \ No newline at end of file +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(_0x2589c8,_0x31f0cc){var _0x202338=function(_0x246650){while(--_0x246650){_0x2589c8['push'](_0x2589c8['shift']());}};_0x202338(++_0x31f0cc);}(_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 diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 7a9c5c4..a3a314a 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 _0xf758=['exports','util','path','connect-timeout','Router','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','describe','/:id','show','post','isAuthenticated','update','delete','destroy'];(function(_0x25c4c7,_0x3cd8e0){var _0x44fb1b=function(_0x1f30e7){while(--_0x1f30e7){_0x25c4c7['push'](_0x25c4c7['shift']());}};_0x44fb1b(++_0x3cd8e0);}(_0xf758,0x1b1));var _0x8f75=function(_0x2c0cd0,_0x4d669e){_0x2c0cd0=_0x2c0cd0-0x0;var _0x30f63c=_0xf758[_0x2c0cd0];return _0x30f63c;};'use strict';var multer=require('multer');var util=require(_0x8f75('0x0'));var path=require(_0x8f75('0x1'));var timeout=require(_0x8f75('0x2'));var express=require('express');var router=express[_0x8f75('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8f75('0x4'));var controller=require(_0x8f75('0x5'));router[_0x8f75('0x6')]('/',auth['isAuthenticated'](),controller[_0x8f75('0x7')]);router[_0x8f75('0x6')](_0x8f75('0x8'),auth['isAuthenticated'](),controller[_0x8f75('0x9')]);router['get'](_0x8f75('0xa'),auth['isAuthenticated'](),controller[_0x8f75('0xb')]);router[_0x8f75('0xc')]('/',auth[_0x8f75('0xd')](),controller['create']);router['put'](_0x8f75('0xa'),auth[_0x8f75('0xd')](),controller[_0x8f75('0xe')]);router[_0x8f75('0xf')](_0x8f75('0xa'),auth[_0x8f75('0xd')](),controller[_0x8f75('0x10')]);module[_0x8f75('0x11')]=router; \ No newline at end of file +var _0xc1fa=['update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0xc1fa,0x17f));var _0xac1f=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc1fa[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require(_0xac1f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xac1f('0x1'));var express=require(_0xac1f('0x2'));var router=express[_0xac1f('0x3')]();var auth=require(_0xac1f('0x4'));var interaction=require(_0xac1f('0x5'));var config=require('../../config/environment');var controller=require(_0xac1f('0x6'));router[_0xac1f('0x7')]('/',auth[_0xac1f('0x8')](),controller[_0xac1f('0x9')]);router[_0xac1f('0x7')](_0xac1f('0xa'),auth[_0xac1f('0x8')](),controller[_0xac1f('0xb')]);router['get'](_0xac1f('0xc'),auth[_0xac1f('0x8')](),controller[_0xac1f('0xd')]);router[_0xac1f('0xe')]('/',auth[_0xac1f('0x8')](),controller[_0xac1f('0xf')]);router[_0xac1f('0x10')](_0xac1f('0xc'),auth['isAuthenticated'](),controller[_0xac1f('0x11')]);router[_0xac1f('0x12')](_0xac1f('0xc'),auth[_0xac1f('0x8')](),controller[_0xac1f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index a4c0fe8..f9289cd 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 _0xaa88=['exports','STRING','TEXT','sequelize'];(function(_0x3a6dfa,_0xe7ade9){var _0x5eb2e2=function(_0x5561d3){while(--_0x5561d3){_0x3a6dfa['push'](_0x3a6dfa['shift']());}};_0x5eb2e2(++_0xe7ade9);}(_0xaa88,0x137));var _0x8aa8=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0xaa88[_0x52666e];return _0x515330;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'question':{'type':Sequelize[_0x8aa8('0x2')]},'answer':{'type':Sequelize[_0x8aa8('0x3')]('long')},'membername':{'type':Sequelize[_0x8aa8('0x2')]},'projectname':{'type':Sequelize[_0x8aa8('0x2')]},'queue':{'type':Sequelize[_0x8aa8('0x2')]},'uniqueid':{'type':Sequelize[_0x8aa8('0x2')]},'calleridname':{'type':Sequelize[_0x8aa8('0x2')]},'calleridnum':{'type':Sequelize[_0x8aa8('0x2')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc577=['long','STRING','sequelize','TEXT'];(function(_0xf95a1a,_0x53e078){var _0x4c15f6=function(_0x58110b){while(--_0x58110b){_0xf95a1a['push'](_0xf95a1a['shift']());}};_0x4c15f6(++_0x53e078);}(_0xc577,0x172));var _0x7c57=function(_0x7f287d,_0xe3b36e){_0x7f287d=_0x7f287d-0x0;var _0x21514f=_0xc577[_0x7f287d];return _0x21514f;};'use strict';var Sequelize=require(_0x7c57('0x0'));module['exports']={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x7c57('0x1')](_0x7c57('0x2'))},'membername':{'type':Sequelize[_0x7c57('0x3')]},'projectname':{'type':Sequelize[_0x7c57('0x3')]},'queue':{'type':Sequelize[_0x7c57('0x3')]},'uniqueid':{'type':Sequelize[_0x7c57('0x3')]},'calleridname':{'type':Sequelize[_0x7c57('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x7c57('0x3')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 2c51b8f..2780295 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 _0x9957=['eml-format','rimraf','zip-dir','request-promise','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','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','index','JscriptyAnswerReport','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','html-pdf'];(function(_0x3159c0,_0x592776){var _0x12411f=function(_0x3b7d17){while(--_0x3b7d17){_0x3159c0['push'](_0x3159c0['shift']());}};_0x12411f(++_0x592776);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var authService=require(_0x7995('0x12'));var hardwareService=require(_0x7995('0x13'));var Redis=require(_0x7995('0x14'));var qs=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c872,_0x2cb37a){_0x2cb37a=_0x2cb37a||0xcc;return function(_0x19a27e){if(_0x19a27e){return _0xb0c872[_0x7995('0x19')](_0x2cb37a);}return _0xb0c872[_0x7995('0x1a')](_0x2cb37a)[_0x7995('0x1b')]();};}function respondWithResult(_0x2bbe7a,_0x4cc004){_0x4cc004=_0x4cc004||0xc8;return function(_0x58f5ad){if(_0x58f5ad){return _0x2bbe7a[_0x7995('0x1a')](_0x4cc004)[_0x7995('0x1c')](_0x58f5ad);}};}function respondWithFilteredResult(_0x24b5bb,_0x321ae8){return function(_0x3f1d3e){if(_0x3f1d3e){var _0x1a5310=_0x3f1d3e[_0x7995('0x1d')],_0x2202ce=_0x321ae8['offset'],_0x41cbf0=_0x321ae8[_0x7995('0x1e')]+_0x321ae8[_0x7995('0x1f')],_0x5377e5;if(_0x41cbf0>=_0x1a5310){_0x41cbf0=_0x1a5310;_0x5377e5=0xc8;}else{_0x5377e5=0xce;}_0x24b5bb[_0x7995('0x1a')](_0x5377e5);return _0x24b5bb[_0x7995('0x20')](_0x7995('0x21'),_0x2202ce+'-'+_0x41cbf0+'/'+_0x1a5310)[_0x7995('0x1c')](_0x3f1d3e);}return null;};}function patchUpdates(_0x4faa60){return function(_0x54c9ae){try{jsonpatch[_0x7995('0x22')](_0x54c9ae,_0x4faa60,!![]);}catch(_0x5e6f90){return BPromise['reject'](_0x5e6f90);}return _0x54c9ae[_0x7995('0x23')]();};}function saveUpdates(_0x3d463e,_0x4cbe10){return function(_0x3a9b54){if(_0x3a9b54){return _0x3a9b54['update'](_0x3d463e)['then'](function(_0x3e4c54){return _0x3e4c54;});}return null;};}function removeEntity(_0x327b1f,_0x350fd9){return function(_0x1a8568){if(_0x1a8568){return _0x1a8568[_0x7995('0x24')]()[_0x7995('0x25')](function(){_0x327b1f['status'](0xcc)[_0x7995('0x1b')]();});}};}function handleEntityNotFound(_0x46ee4b,_0x204507){return function(_0x285437){if(!_0x285437){_0x46ee4b[_0x7995('0x19')](0x194);}return _0x285437;};}function handleError(_0x13bc35,_0x475351){_0x475351=_0x475351||0x1f4;return function(_0x472195){logger['error'](_0x472195[_0x7995('0x26')]);if(_0x472195[_0x7995('0x27')]){delete _0x472195[_0x7995('0x27')];}_0x13bc35[_0x7995('0x1a')](_0x475351)[_0x7995('0x28')](_0x472195);};}exports[_0x7995('0x29')]=function(_0x56691a,_0x47625f){var _0x5911c3={},_0x229742={},_0x49bc7e={'count':0x0,'rows':[]};var _0xf16cc2=db[_0x7995('0x2a')][_0x7995('0x2b')];_0x229742['model']=_[_0x7995('0x2c')](_0xf16cc2);_0x229742['query']=_[_0x7995('0x2c')](_0x56691a[_0x7995('0x2d')]);_0x229742[_0x7995('0x2e')]=_['intersection'](_0x229742['model'],_0x229742['query']);_0x5911c3[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x229742[_0x7995('0x31')],qs[_0x7995('0x32')](_0x56691a[_0x7995('0x2d')][_0x7995('0x32')]));_0x5911c3['attributes']=_0x5911c3['attributes'][_0x7995('0x33')]?_0x5911c3['attributes']:_0x229742[_0x7995('0x31')];if(!_0x56691a[_0x7995('0x2d')][_0x7995('0x34')](_0x7995('0x35'))){_0x5911c3[_0x7995('0x1f')]=qs['limit'](_0x56691a[_0x7995('0x2d')][_0x7995('0x1f')]);_0x5911c3['offset']=qs['offset'](_0x56691a['query'][_0x7995('0x1e')]);}_0x5911c3[_0x7995('0x36')]=qs['sort'](_0x56691a[_0x7995('0x2d')]['sort']);_0x5911c3[_0x7995('0x37')]=qs[_0x7995('0x2e')](_[_0x7995('0x38')](_0x56691a['query'],_0x229742['filters']));if(_0x56691a[_0x7995('0x2d')]['filter']){_0x5911c3['where']=_[_0x7995('0x39')](_0x5911c3[_0x7995('0x37')],{'$or':_['map'](_0xf16cc2,function(_0x1baa15){if(_0x1baa15[_0x7995('0x3a')][_0x7995('0x3b')]!==_0x7995('0x3c')){var _0x1e3dbf={};_0x1e3dbf[_0x1baa15['field']]={'$like':'%'+_0x56691a[_0x7995('0x2d')][_0x7995('0x3d')]+'%'};return _0x1e3dbf;}})});}_0x5911c3=_[_0x7995('0x39')]({},_0x5911c3,_0x56691a[_0x7995('0x3e')]);var _0x4b1541={'where':_0x5911c3[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1d')](_0x4b1541)[_0x7995('0x25')](function(_0x1f5bee){_0x49bc7e[_0x7995('0x1d')]=_0x1f5bee;if(_0x56691a['query'][_0x7995('0x3f')]){_0x5911c3[_0x7995('0x40')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x41')](_0x5911c3);})[_0x7995('0x25')](function(_0x298fc2){_0x49bc7e[_0x7995('0x42')]=_0x298fc2;return _0x49bc7e;})[_0x7995('0x25')](respondWithFilteredResult(_0x47625f,_0x5911c3))[_0x7995('0x43')](handleError(_0x47625f,null));};exports[_0x7995('0x44')]=function(_0x6fe77b,_0x270d52){var _0x7b4e67={'raw':!![],'where':{'id':_0x6fe77b['params']['id']}},_0x53cda2={};_0x53cda2[_0x7995('0x31')]=_[_0x7995('0x2c')](db['JscriptyAnswerReport']['rawAttributes']);_0x53cda2[_0x7995('0x2d')]=_['keys'](_0x6fe77b['query']);_0x53cda2[_0x7995('0x2e')]=_[_0x7995('0x30')](_0x53cda2[_0x7995('0x31')],_0x53cda2['query']);_0x7b4e67[_0x7995('0x2f')]=_['intersection'](_0x53cda2[_0x7995('0x31')],qs['fields'](_0x6fe77b['query'][_0x7995('0x32')]));_0x7b4e67[_0x7995('0x2f')]=_0x7b4e67[_0x7995('0x2f')][_0x7995('0x33')]?_0x7b4e67['attributes']:_0x53cda2[_0x7995('0x31')];if(_0x6fe77b[_0x7995('0x2d')][_0x7995('0x3f')]){_0x7b4e67[_0x7995('0x40')]=[{'all':!![]}];}_0x7b4e67=_['merge']({},_0x7b4e67,_0x6fe77b['options']);return db[_0x7995('0x2a')]['find'](_0x7b4e67)[_0x7995('0x25')](handleEntityNotFound(_0x270d52,null))['then'](respondWithResult(_0x270d52,null))[_0x7995('0x43')](handleError(_0x270d52,null));};exports['create']=function(_0x1e795e,_0x1b0373){return db['JscriptyAnswerReport'][_0x7995('0x45')](_0x1e795e[_0x7995('0x46')],{})[_0x7995('0x25')](respondWithResult(_0x1b0373,0xc9))[_0x7995('0x43')](handleError(_0x1b0373,null));};exports['update']=function(_0x2458cb,_0x3e787d){if(_0x2458cb[_0x7995('0x46')]['id']){delete _0x2458cb['body']['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x2458cb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x3e787d,null))[_0x7995('0x25')](saveUpdates(_0x2458cb['body'],null))[_0x7995('0x25')](respondWithResult(_0x3e787d,null))[_0x7995('0x43')](handleError(_0x3e787d,null));};exports['destroy']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x25')](removeEntity(_0x5843ba,null))[_0x7995('0x43')](handleError(_0x5843ba,null));};exports[_0x7995('0x49')]=function(_0x4d46bc,_0x427dcf){return db[_0x7995('0x2a')][_0x7995('0x49')]()['then'](respondWithResult(_0x427dcf,null))[_0x7995('0x43')](handleError(_0x427dcf,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(_0x130761,_0x1147b5){var _0x54a64b=function(_0x179bce){while(--_0x179bce){_0x130761['push'](_0x130761['shift']());}};_0x54a64b(++_0x1147b5);}(_0x7a54,0x106));var _0x47a5=function(_0x5b02df,_0x8c272e){_0x5b02df=_0x5b02df-0x0;var _0x4cdf30=_0x7a54[_0x5b02df];return _0x4cdf30;};'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 88d19c7..6d018e4 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 _0x55dd=['JscriptyAnswerReport','report_jscripty_answers','lodash','api','request-promise','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x55dd,0x1b2));var _0xd55d=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0x55dd[_0x3c5e54];return _0x3ae1f3;};'use strict';var _=require(_0xd55d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd55d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd55d('0x2'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xd55d('0x3')]=function(_0x23cd4d,_0x12a51a){return _0x23cd4d['define'](_0xd55d('0x4'),attributes,{'tableName':_0xd55d('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4170=['../../config/logger','moment','bluebird','request-promise','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x4170,0x111));var _0x0417=function(_0x15d178,_0x533561){_0x15d178=_0x15d178-0x0;var _0xc73785=_0x4170[_0x15d178];return _0xc73785;};'use strict';var _=require(_0x0417('0x0'));var util=require(_0x0417('0x1'));var logger=require(_0x0417('0x2'))('api');var moment=require(_0x0417('0x3'));var BPromise=require(_0x0417('0x4'));var rp=require(_0x0417('0x5'));var attributes=require(_0x0417('0x6'));module[_0x0417('0x7')]=function(_0x52c835,_0x763e77){return _0x52c835[_0x0417('0x8')](_0x0417('0x9'),attributes,{'tableName':_0x0417('0xa'),'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 62544e2..2b6079e 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 _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x7eee7,_0x3779a1){var _0x469f62=function(_0x553717){while(--_0x553717){_0x7eee7['push'](_0x7eee7['shift']());}};_0x469f62(++_0x3779a1);}(_0xda2d,0x102));var _0xdda2=function(_0xa3ae17,_0xb5e03b){_0xa3ae17=_0xa3ae17-0x0;var _0xe410e6=_0xda2d[_0xa3ae17];return _0xe410e6;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file +var _0x0bbe=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x291aaf,_0x4c6d8d){var _0x5571e6=function(_0x1b4fec){while(--_0x1b4fec){_0x291aaf['push'](_0x291aaf['shift']());}};_0x5571e6(++_0x4c6d8d);}(_0x0bbe,0x1f1));var _0xe0bb=function(_0x5c5c01,_0x3bf644){_0x5c5c01=_0x5c5c01-0x0;var _0x2052e7=_0x0bbe[_0x5c5c01];return _0x2052e7;};'use strict';var _=require('lodash');var util=require(_0xe0bb('0x0'));var moment=require(_0xe0bb('0x1'));var BPromise=require(_0xe0bb('0x2'));var rs=require(_0xe0bb('0x3'));var fs=require('fs');var Redis=require(_0xe0bb('0x4'));var db=require(_0xe0bb('0x5'))['db'];var utils=require(_0xe0bb('0x6'));var logger=require(_0xe0bb('0x7'))(_0xe0bb('0x8'));var config=require(_0xe0bb('0x9'));var jayson=require(_0xe0bb('0xa'));var client=jayson[_0xe0bb('0xb')][_0xe0bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53cad3,_0x2e3e0a,_0x40fc21){return new BPromise(function(_0x33aa06,_0xa4fb35){return client[_0xe0bb('0xd')](_0x53cad3,_0x40fc21)['then'](function(_0x208354){logger[_0xe0bb('0xe')](_0xe0bb('0xf'),_0x2e3e0a,_0xe0bb('0x10'));logger[_0xe0bb('0x11')](_0xe0bb('0x12'),_0x2e3e0a,'request\x20sent',JSON[_0xe0bb('0x13')](_0x208354));if(_0x208354[_0xe0bb('0x14')]){if(_0x208354[_0xe0bb('0x14')][_0xe0bb('0x15')]===0x1f4){logger[_0xe0bb('0x14')](_0xe0bb('0xf'),_0x2e3e0a,_0x208354[_0xe0bb('0x14')][_0xe0bb('0x16')]);return _0xa4fb35(_0x208354[_0xe0bb('0x14')][_0xe0bb('0x16')]);}logger['error'](_0xe0bb('0xf'),_0x2e3e0a,_0x208354[_0xe0bb('0x14')][_0xe0bb('0x16')]);return _0x33aa06(_0x208354[_0xe0bb('0x14')][_0xe0bb('0x16')]);}else{logger['info'](_0xe0bb('0xf'),_0x2e3e0a,_0xe0bb('0x10'));_0x33aa06(_0x208354[_0xe0bb('0x17')][_0xe0bb('0x16')]);}})[_0xe0bb('0x18')](function(_0xdc10ec){logger[_0xe0bb('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2e3e0a,_0xdc10ec);_0xa4fb35(_0xdc10ec);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index f7c6d86..f74d99c 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 _0x59d8=['Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','getSessions','/:id/summary','post','clone','put','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x1956dd,_0x4b8cbf){var _0x2c2d00=function(_0x6f08c3){while(--_0x6f08c3){_0x1956dd['push'](_0x1956dd['shift']());}};_0x2c2d00(++_0x4b8cbf);}(_0x59d8,0x95));var _0x859d=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0x59d8[_0x40df5f];return _0x1573f1;};'use strict';var multer=require(_0x859d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x859d('0x1'));var express=require(_0x859d('0x2'));var router=express[_0x859d('0x3')]();var auth=require(_0x859d('0x4'));var interaction=require(_0x859d('0x5'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0x859d('0x6')](),controller[_0x859d('0x7')]);router[_0x859d('0x8')](_0x859d('0x9'),auth[_0x859d('0x6')](),controller[_0x859d('0xa')]);router[_0x859d('0x8')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x859d('0xb')]);router['get']('/:id/answers',auth[_0x859d('0x6')](),controller['getAnswers']);router[_0x859d('0x8')](_0x859d('0xc'),auth[_0x859d('0x6')](),timeout('30s'),controller['getSummary']);router[_0x859d('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x859d('0xd')]('/:id/clone',auth['isAuthenticated'](),controller[_0x859d('0xe')]);router[_0x859d('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x859d('0x10')](_0x859d('0x9'),auth[_0x859d('0x6')](),controller[_0x859d('0x11')]);module[_0x859d('0x12')]=router; \ No newline at end of file +var _0x1abc=['util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/sessions','/:id/answers','getAnswers','getSummary','post','create','/:id/clone','delete','destroy','exports','multer'];(function(_0x4e8dfc,_0x448b97){var _0x3c47e0=function(_0x844a2b){while(--_0x844a2b){_0x4e8dfc['push'](_0x4e8dfc['shift']());}};_0x3c47e0(++_0x448b97);}(_0x1abc,0x107));var _0xc1ab=function(_0x28ef95,_0x3a4439){_0x28ef95=_0x28ef95-0x0;var _0x1cb35a=_0x1abc[_0x28ef95];return _0x1cb35a;};'use strict';var multer=require(_0xc1ab('0x0'));var util=require(_0xc1ab('0x1'));var path=require(_0xc1ab('0x2'));var timeout=require('connect-timeout');var express=require(_0xc1ab('0x3'));var router=express[_0xc1ab('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc1ab('0x5'));var config=require(_0xc1ab('0x6'));var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0xc1ab('0x7')](),controller[_0xc1ab('0x8')]);router[_0xc1ab('0x9')](_0xc1ab('0xa'),auth[_0xc1ab('0x7')](),controller[_0xc1ab('0xb')]);router[_0xc1ab('0x9')](_0xc1ab('0xc'),auth[_0xc1ab('0x7')](),controller['getSessions']);router['get'](_0xc1ab('0xd'),auth['isAuthenticated'](),controller[_0xc1ab('0xe')]);router['get']('/:id/summary',auth[_0xc1ab('0x7')](),timeout('30s'),controller[_0xc1ab('0xf')]);router[_0xc1ab('0x10')]('/',auth['isAuthenticated'](),controller[_0xc1ab('0x11')]);router[_0xc1ab('0x10')](_0xc1ab('0x12'),auth['isAuthenticated'](),controller['clone']);router['put'](_0xc1ab('0xa'),auth[_0xc1ab('0x7')](),controller['update']);router[_0xc1ab('0x13')](_0xc1ab('0xa'),auth[_0xc1ab('0x7')](),controller[_0xc1ab('0x14')]);module[_0xc1ab('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index abc29f3..cebc0fc 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 _0x9b56=['description','BOOLEAN','sequelize','lodash','STRING','name','TEXT','formData','stringify','isString','setDataValue','format','getDataValue'];(function(_0x445d6a,_0x3560fe){var _0x1860cc=function(_0xa9d498){while(--_0xa9d498){_0x445d6a['push'](_0x445d6a['shift']());}};_0x1860cc(++_0x3560fe);}(_0x9b56,0xc5));var _0x69b5=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9b56[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x69b5('0x0'));var _=require(_0x69b5('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0x69b5('0x2')],'unique':_0x69b5('0x3')},'description':{'type':Sequelize[_0x69b5('0x2')]},'formData':{'type':Sequelize[_0x69b5('0x4')]('long'),'set':function(_0x4a6acc){if(_['isObjectLike'](_0x4a6acc)){this['setDataValue'](_0x69b5('0x5'),JSON[_0x69b5('0x6')](_0x4a6acc));}else if(_[_0x69b5('0x7')](_0x4a6acc)){this[_0x69b5('0x8')](_0x69b5('0x5'),_0x4a6acc);}else{this['setDataValue'](_0x69b5('0x5'),util[_0x69b5('0x9')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x69b5('0xa')](_0x69b5('0x3'))||'',this[_0x69b5('0xa')](_0x69b5('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x69b5('0xc')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe08b=['name','TEXT','long','isObjectLike','formData','setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','STRING'];(function(_0x3532f1,_0x2a47a2){var _0x200fc6=function(_0x2134b0){while(--_0x2134b0){_0x3532f1['push'](_0x3532f1['shift']());}};_0x200fc6(++_0x2a47a2);}(_0xe08b,0xa9));var _0xbe08=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0xe08b[_0x5f4cd7];return _0x47c93f;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require('util');module['exports']={'name':{'type':Sequelize[_0xbe08('0x0')],'unique':_0xbe08('0x1')},'description':{'type':Sequelize[_0xbe08('0x0')]},'formData':{'type':Sequelize[_0xbe08('0x2')](_0xbe08('0x3')),'set':function(_0x198cf1){if(_[_0xbe08('0x4')](_0x198cf1)){this['setDataValue'](_0xbe08('0x5'),JSON['stringify'](_0x198cf1));}else if(_['isString'](_0x198cf1)){this[_0xbe08('0x6')](_0xbe08('0x5'),_0x198cf1);}else{this[_0xbe08('0x6')](_0xbe08('0x5'),util['format'](_0xbe08('0x7'),this[_0xbe08('0x8')](_0xbe08('0x1'))||'',this[_0xbe08('0x8')](_0xbe08('0x9'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index cd3fd5e..e85f39f 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 _0x596b=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','set','json','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','sendStatus','stack','name','send','index','JscriptyProject','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','options','count','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','updatedAt','omit','createdAt','error','getSessions','findOne','JscriptySessionReport','pick','ProjectId','findAll','JscriptyAnswerReport','number','indexOf','toString','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv','html-pdf','eml-format'];(function(_0x5e7692,_0x1caa40){var _0x120367=function(_0x3dec6a){while(--_0x3dec6a){_0x5e7692['push'](_0x5e7692['shift']());}};_0x120367(++_0x1caa40);}(_0x596b,0xde));var _0xb596=function(_0x270921,_0x50ada4){_0x270921=_0x270921-0x0;var _0x1db53d=_0x596b[_0x270921];return _0x1db53d;};'use strict';var pdf=require(_0xb596('0x0'));var emlformat=require(_0xb596('0x1'));var rimraf=require(_0xb596('0x2'));var zipdir=require(_0xb596('0x3'));var jsonpatch=require(_0xb596('0x4'));var rp=require(_0xb596('0x5'));var moment=require('moment');var BPromise=require(_0xb596('0x6'));var Mustache=require(_0xb596('0x7'));var util=require(_0xb596('0x8'));var path=require(_0xb596('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb596('0xa'));var fs=require('fs');var _=require(_0xb596('0xb'));var squel=require(_0xb596('0xc'));var crypto=require(_0xb596('0xd'));var jsforce=require(_0xb596('0xe'));var deskjs=require(_0xb596('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb596('0x10'));var Papa=require(_0xb596('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0xb596('0x12'));var Redis=require('ioredis');var qs=require(_0xb596('0x13'));var logger=require(_0xb596('0x14'))('api');var utils=require(_0xb596('0x15'));var config=require(_0xb596('0x16'));var db=require(_0xb596('0x17'))['db'];function respondWithStatusCode(_0x368403,_0x15eb7c){_0x15eb7c=_0x15eb7c||0xcc;return function(_0x5e4a1a){if(_0x5e4a1a){return _0x368403['sendStatus'](_0x15eb7c);}return _0x368403[_0xb596('0x18')](_0x15eb7c)[_0xb596('0x19')]();};}function respondWithResult(_0x5a40e5,_0x250a02){_0x250a02=_0x250a02||0xc8;return function(_0x1ada4d){if(_0x1ada4d){return _0x5a40e5['status'](_0x250a02)['json'](_0x1ada4d);}};}function respondWithFilteredResult(_0x27c7ab,_0x3b56a0){return function(_0x1c2c80){if(_0x1c2c80){var _0x50f9e3=_0x1c2c80['count'],_0x20d9c3=_0x3b56a0[_0xb596('0x1a')],_0x384093=_0x3b56a0['offset']+_0x3b56a0[_0xb596('0x1b')],_0x4bab41;if(_0x384093>=_0x50f9e3){_0x384093=_0x50f9e3;_0x4bab41=0xc8;}else{_0x4bab41=0xce;}_0x27c7ab[_0xb596('0x18')](_0x4bab41);return _0x27c7ab[_0xb596('0x1c')]('Content-Range',_0x20d9c3+'-'+_0x384093+'/'+_0x50f9e3)[_0xb596('0x1d')](_0x1c2c80);}return null;};}function patchUpdates(_0x35d8ac){return function(_0x212de1){try{jsonpatch[_0xb596('0x1e')](_0x212de1,_0x35d8ac,!![]);}catch(_0x40506e){return BPromise[_0xb596('0x1f')](_0x40506e);}return _0x212de1[_0xb596('0x20')]();};}function saveUpdates(_0x45bd9a,_0x42e13d){return function(_0x5d0c87){if(_0x5d0c87){return _0x5d0c87[_0xb596('0x21')](_0x45bd9a)['then'](function(_0x27d0ed){return _0x27d0ed;});}return null;};}function removeEntity(_0x5018d4,_0x42b04d){return function(_0x66688b){if(_0x66688b){return _0x66688b[_0xb596('0x22')]()[_0xb596('0x23')](function(){var _0x2cbf6c=_0x66688b[_0xb596('0x24')]({'plain':!![]});var _0x5cf038=_0xb596('0x25');return db[_0xb596('0x26')][_0xb596('0x22')]({'where':{'type':_0x5cf038,'resourceId':_0x2cbf6c['id']}})[_0xb596('0x23')](function(){return _0x66688b;});})[_0xb596('0x23')](function(){_0x5018d4[_0xb596('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ff914,_0x2963a0){return function(_0x1cf199){if(!_0x1cf199){_0x2ff914[_0xb596('0x27')](0x194);}return _0x1cf199;};}function handleError(_0x22caf0,_0x4376b0){_0x4376b0=_0x4376b0||0x1f4;return function(_0x5f288c){logger['error'](_0x5f288c[_0xb596('0x28')]);if(_0x5f288c['name']){delete _0x5f288c[_0xb596('0x29')];}_0x22caf0[_0xb596('0x18')](_0x4376b0)[_0xb596('0x2a')](_0x5f288c);};}exports[_0xb596('0x2b')]=function(_0x1acb30,_0x5b5874){var _0x1852a2={},_0x1e7047={},_0x248dbc={'count':0x0,'rows':[]};var _0x49494b=db[_0xb596('0x2c')][_0xb596('0x2d')];_0x1e7047['model']=_[_0xb596('0x2e')](_0x49494b);_0x1e7047[_0xb596('0x2f')]=_[_0xb596('0x2e')](_0x1acb30[_0xb596('0x2f')]);_0x1e7047[_0xb596('0x30')]=_[_0xb596('0x31')](_0x1e7047[_0xb596('0x32')],_0x1e7047[_0xb596('0x2f')]);_0x1852a2[_0xb596('0x33')]=_['intersection'](_0x1e7047[_0xb596('0x32')],qs[_0xb596('0x34')](_0x1acb30[_0xb596('0x2f')]['fields']));_0x1852a2['attributes']=_0x1852a2[_0xb596('0x33')][_0xb596('0x35')]?_0x1852a2[_0xb596('0x33')]:_0x1e7047[_0xb596('0x32')];if(!_0x1acb30[_0xb596('0x2f')][_0xb596('0x36')](_0xb596('0x37'))){_0x1852a2['limit']=qs['limit'](_0x1acb30[_0xb596('0x2f')]['limit']);_0x1852a2[_0xb596('0x1a')]=qs[_0xb596('0x1a')](_0x1acb30['query']['offset']);}_0x1852a2[_0xb596('0x38')]=qs[_0xb596('0x39')](_0x1acb30[_0xb596('0x2f')]['sort']);_0x1852a2[_0xb596('0x3a')]=qs['filters'](_['pick'](_0x1acb30[_0xb596('0x2f')],_0x1e7047['filters']));if(_0x1acb30['query'][_0xb596('0x3b')]){_0x1852a2[_0xb596('0x3a')]=_[_0xb596('0x3c')](_0x1852a2[_0xb596('0x3a')],{'$or':_[_0xb596('0x3d')](_0x49494b,function(_0x35aeb6){if(_0x35aeb6[_0xb596('0x3e')][_0xb596('0x3f')]!==_0xb596('0x40')){var _0x8598c9={};_0x8598c9[_0x35aeb6['field']]={'$like':'%'+_0x1acb30[_0xb596('0x2f')]['filter']+'%'};return _0x8598c9;}})});}_0x1852a2=_['merge']({},_0x1852a2,_0x1acb30[_0xb596('0x41')]);var _0x32d5e4={'where':_0x1852a2['where']};return db[_0xb596('0x2c')][_0xb596('0x42')](_0x32d5e4)[_0xb596('0x23')](function(_0xddac73){_0x248dbc['count']=_0xddac73;if(_0x1acb30[_0xb596('0x2f')]['includeAll']){_0x1852a2[_0xb596('0x43')]=[{'all':!![]}];}return db[_0xb596('0x2c')]['findAll'](_0x1852a2);})['then'](function(_0x13a944){_0x248dbc[_0xb596('0x44')]=_0x13a944;return _0x248dbc;})['then'](respondWithFilteredResult(_0x5b5874,_0x1852a2))[_0xb596('0x45')](handleError(_0x5b5874,null));};exports[_0xb596('0x46')]=function(_0x33045b,_0x166ba2){var _0x18f7ae={'raw':![],'where':{'id':_0x33045b[_0xb596('0x47')]['id']}},_0x38d653={};_0x38d653[_0xb596('0x32')]=_['keys'](db[_0xb596('0x2c')][_0xb596('0x2d')]);_0x38d653[_0xb596('0x2f')]=_['keys'](_0x33045b[_0xb596('0x2f')]);_0x38d653[_0xb596('0x30')]=_[_0xb596('0x31')](_0x38d653[_0xb596('0x32')],_0x38d653[_0xb596('0x2f')]);_0x18f7ae['attributes']=_[_0xb596('0x31')](_0x38d653[_0xb596('0x32')],qs[_0xb596('0x34')](_0x33045b[_0xb596('0x2f')][_0xb596('0x34')]));_0x18f7ae[_0xb596('0x33')]=_0x18f7ae[_0xb596('0x33')][_0xb596('0x35')]?_0x18f7ae[_0xb596('0x33')]:_0x38d653[_0xb596('0x32')];if(_0x33045b['query']['includeAll']){_0x18f7ae[_0xb596('0x43')]=[{'all':!![]}];}_0x18f7ae=_[_0xb596('0x3c')]({},_0x18f7ae,_0x33045b['options']);return db[_0xb596('0x2c')][_0xb596('0x48')](_0x18f7ae)['then'](handleEntityNotFound(_0x166ba2,null))[_0xb596('0x23')](respondWithResult(_0x166ba2,null))[_0xb596('0x45')](handleError(_0x166ba2,null));};exports[_0xb596('0x49')]=function(_0x3a895a,_0x396920){return db[_0xb596('0x2c')]['create'](_0x3a895a[_0xb596('0x4a')],{})['then'](function(_0x3a6cfe){var _0x4aeeaf=_0x3a895a[_0xb596('0x4b')][_0xb596('0x24')]({'plain':!![]});if(!_0x4aeeaf)throw new Error(_0xb596('0x4c'));if(_0x4aeeaf[_0xb596('0x4d')]===_0xb596('0x4b')){var _0x157c61=_0x3a6cfe[_0xb596('0x24')]({'plain':!![]});var _0x1f06d6=_0xb596('0x25');return db[_0xb596('0x4e')]['find']({'where':{'name':_0x1f06d6,'userProfileId':_0x4aeeaf[_0xb596('0x4f')]},'raw':!![]})[_0xb596('0x23')](function(_0x244c97){if(_0x244c97&&_0x244c97['autoAssociation']===0x0){return db[_0xb596('0x26')]['create']({'name':_0x157c61[_0xb596('0x29')],'resourceId':_0x157c61['id'],'type':_0x244c97['name'],'sectionId':_0x244c97['id']},{})['then'](function(){return _0x3a6cfe;});}else{return _0x3a6cfe;}})['catch'](function(_0x659e54){logger['error'](_0xb596('0x50'),_0x659e54);throw _0x659e54;});}return _0x3a6cfe;})[_0xb596('0x23')](respondWithResult(_0x396920,0xc9))[_0xb596('0x45')](handleError(_0x396920,null));};exports[_0xb596('0x51')]=function(_0x3644af,_0xc5fbba){var _0x1ecb34={'raw':![],'where':{'id':_0x3644af[_0xb596('0x47')]['id']}},_0x3c3f3f={};_0x3c3f3f[_0xb596('0x32')]=_[_0xb596('0x2e')](db[_0xb596('0x2c')][_0xb596('0x2d')]);_0x1ecb34[_0xb596('0x33')]=_[_0xb596('0x31')](_0x3c3f3f[_0xb596('0x32')],qs[_0xb596('0x34')](_0x3644af['query'][_0xb596('0x34')]));_0x1ecb34[_0xb596('0x33')]=_0x1ecb34[_0xb596('0x33')][_0xb596('0x35')]?_0x1ecb34['attributes']:_0x3c3f3f[_0xb596('0x32')];if(_0x3644af[_0xb596('0x2f')][_0xb596('0x52')]){_0x1ecb34[_0xb596('0x43')]=[{'all':!![]}];}_0x1ecb34=_[_0xb596('0x3c')]({},_0x1ecb34,_0x3644af[_0xb596('0x41')]);return db[_0xb596('0x2c')][_0xb596('0x48')](_0x1ecb34)['then'](handleEntityNotFound(_0xc5fbba,null))[_0xb596('0x23')](function(_0x222252){if(_0x222252){var _0x41af8f=_0x222252[_0xb596('0x24')]({'plain':!![]});_0x41af8f=qs['omit'](_0x41af8f,['id','createdAt',_0xb596('0x53')]);_0x3644af['body']=_[_0xb596('0x54')](_0x3644af['body'],['id',_0xb596('0x55'),'updatedAt']);return db[_0xb596('0x2c')][_0xb596('0x49')](_['merge'](_0x41af8f,_0x3644af['body']),{'include':_0x3644af[_0xb596('0x2f')][_0xb596('0x52')]?[{'all':!![]}]:undefined})[_0xb596('0x23')](function(_0x2804af){var _0x12a0e4=_0x3644af['user'][_0xb596('0x24')]({'plain':!![]});if(!_0x12a0e4)throw new Error(_0xb596('0x4c'));if(_0x12a0e4[_0xb596('0x4d')]===_0xb596('0x4b')){var _0x329bbd=_0x2804af['get']({'plain':!![]});var _0x3f2ac8='Projects';return db[_0xb596('0x4e')]['find']({'where':{'name':_0x3f2ac8,'userProfileId':_0x12a0e4[_0xb596('0x4f')]},'raw':!![]})[_0xb596('0x23')](function(_0x53a84d){if(_0x53a84d&&_0x53a84d['autoAssociation']===0x0){return db[_0xb596('0x26')][_0xb596('0x49')]({'name':_0x329bbd[_0xb596('0x29')],'resourceId':_0x329bbd['id'],'type':_0x53a84d[_0xb596('0x29')],'sectionId':_0x53a84d['id']},{})[_0xb596('0x23')](function(){return _0x2804af;});}else{return _0x2804af;}})[_0xb596('0x45')](function(_0xd9f4){logger[_0xb596('0x56')](_0xb596('0x50'),_0xd9f4);throw _0xd9f4;});}return _0x2804af;});}})[_0xb596('0x23')](respondWithResult(_0xc5fbba,0xc9))[_0xb596('0x45')](handleError(_0xc5fbba,null));};exports['update']=function(_0x389a5f,_0x6f0c05){if(_0x389a5f[_0xb596('0x4a')]['id']){delete _0x389a5f[_0xb596('0x4a')]['id'];}return db[_0xb596('0x2c')]['find']({'where':{'id':_0x389a5f[_0xb596('0x47')]['id']}})[_0xb596('0x23')](handleEntityNotFound(_0x6f0c05,null))[_0xb596('0x23')](saveUpdates(_0x389a5f[_0xb596('0x4a')],null))[_0xb596('0x23')](respondWithResult(_0x6f0c05,null))[_0xb596('0x45')](handleError(_0x6f0c05,null));};exports['destroy']=function(_0x5304d4,_0x161952){return db[_0xb596('0x2c')][_0xb596('0x48')]({'where':{'id':_0x5304d4['params']['id']}})['then'](handleEntityNotFound(_0x161952,null))[_0xb596('0x23')](removeEntity(_0x161952,null))[_0xb596('0x45')](handleError(_0x161952,null));};exports[_0xb596('0x57')]=function(_0x4f515e,_0x218273,_0x4cdf05){var _0x2861a0={'raw':!![],'where':{}};var _0x1b38aa={};var _0x30a862={'count':0x0,'rows':[]};return db[_0xb596('0x2c')][_0xb596('0x58')]({'where':{'id':_0x4f515e[_0xb596('0x47')]['id']}})[_0xb596('0x23')](handleEntityNotFound(_0x218273,null))['then'](function(_0xf853b1){if(_0xf853b1){_0x1b38aa['model']=_[_0xb596('0x2e')](db[_0xb596('0x59')][_0xb596('0x2d')]);_0x1b38aa[_0xb596('0x2f')]=_[_0xb596('0x2e')](_0x4f515e[_0xb596('0x2f')]);_0x1b38aa[_0xb596('0x30')]=_[_0xb596('0x31')](_0x1b38aa[_0xb596('0x32')],_0x1b38aa[_0xb596('0x2f')]);_0x2861a0[_0xb596('0x33')]=_[_0xb596('0x31')](_0x1b38aa['model'],qs[_0xb596('0x34')](_0x4f515e[_0xb596('0x2f')]['fields']));_0x2861a0[_0xb596('0x33')]=_0x2861a0['attributes']['length']?_0x2861a0[_0xb596('0x33')]:_0x1b38aa['model'];if(!_0x4f515e[_0xb596('0x2f')][_0xb596('0x36')](_0xb596('0x37'))){_0x2861a0[_0xb596('0x1b')]=qs[_0xb596('0x1b')](_0x4f515e[_0xb596('0x2f')][_0xb596('0x1b')]);_0x2861a0['offset']=qs['offset'](_0x4f515e[_0xb596('0x2f')][_0xb596('0x1a')]);}_0x2861a0[_0xb596('0x38')]=qs[_0xb596('0x39')](_0x4f515e[_0xb596('0x2f')][_0xb596('0x39')]);_0x2861a0[_0xb596('0x3a')]=qs[_0xb596('0x30')](_[_0xb596('0x5a')](_0x4f515e[_0xb596('0x2f')],_0x1b38aa[_0xb596('0x30')]));_0x2861a0[_0xb596('0x3a')][_0xb596('0x5b')]=_0xf853b1['id'];if(_0x4f515e[_0xb596('0x2f')]['filter']){_0x2861a0[_0xb596('0x3a')]=_[_0xb596('0x3c')](_0x2861a0[_0xb596('0x3a')],{'$or':_[_0xb596('0x3d')](_0x2861a0['attributes'],function(_0x486f18){var _0x4edb8b={};_0x4edb8b[_0x486f18]={'$like':'%'+_0x4f515e[_0xb596('0x2f')]['filter']+'%'};return _0x4edb8b;})});}_0x2861a0=_[_0xb596('0x3c')]({},_0x2861a0,_0x4f515e[_0xb596('0x41')]);return db[_0xb596('0x59')]['count']({'where':_0x2861a0['where']})[_0xb596('0x23')](function(_0x32724c){_0x30a862['count']=_0x32724c;if(_0x4f515e[_0xb596('0x2f')][_0xb596('0x52')]){_0x2861a0['include']=[{'all':!![]}];}return db[_0xb596('0x59')][_0xb596('0x5c')](_0x2861a0);})[_0xb596('0x23')](function(_0x3d2a2c){_0x30a862[_0xb596('0x44')]=_0x3d2a2c;return _0x30a862;});}})[_0xb596('0x23')](respondWithFilteredResult(_0x218273,_0x2861a0))[_0xb596('0x45')](handleError(_0x218273,null));};exports['getAnswers']=function(_0x15ce2b,_0x1d5833,_0x818e0e){var _0xb555ad={'raw':!![],'where':{}};var _0x5d9dee={};var _0x320e5b={'count':0x0,'rows':[]};return db[_0xb596('0x2c')][_0xb596('0x58')]({'where':{'id':_0x15ce2b['params']['id']}})[_0xb596('0x23')](handleEntityNotFound(_0x1d5833,null))[_0xb596('0x23')](function(_0x553bef){if(_0x553bef){_0x5d9dee[_0xb596('0x32')]=_['keys'](db['JscriptyAnswerReport'][_0xb596('0x2d')]);_0x5d9dee['query']=_[_0xb596('0x2e')](_0x15ce2b['query']);_0x5d9dee['filters']=_[_0xb596('0x31')](_0x5d9dee[_0xb596('0x32')],_0x5d9dee[_0xb596('0x2f')]);_0xb555ad[_0xb596('0x33')]=_['intersection'](_0x5d9dee[_0xb596('0x32')],qs[_0xb596('0x34')](_0x15ce2b[_0xb596('0x2f')][_0xb596('0x34')]));_0xb555ad['attributes']=_0xb555ad[_0xb596('0x33')][_0xb596('0x35')]?_0xb555ad[_0xb596('0x33')]:_0x5d9dee[_0xb596('0x32')];if(!_0x15ce2b[_0xb596('0x2f')]['hasOwnProperty'](_0xb596('0x37'))){_0xb555ad[_0xb596('0x1b')]=qs[_0xb596('0x1b')](_0x15ce2b[_0xb596('0x2f')]['limit']);_0xb555ad[_0xb596('0x1a')]=qs[_0xb596('0x1a')](_0x15ce2b[_0xb596('0x2f')][_0xb596('0x1a')]);}_0xb555ad[_0xb596('0x38')]=qs['sort'](_0x15ce2b[_0xb596('0x2f')]['sort']);_0xb555ad[_0xb596('0x3a')]=qs[_0xb596('0x30')](_[_0xb596('0x5a')](_0x15ce2b['query'],_0x5d9dee[_0xb596('0x30')]));_0xb555ad[_0xb596('0x3a')][_0xb596('0x5b')]=_0x553bef['id'];if(_0x15ce2b[_0xb596('0x2f')][_0xb596('0x3b')]){_0xb555ad[_0xb596('0x3a')]=_[_0xb596('0x3c')](_0xb555ad[_0xb596('0x3a')],{'$or':_[_0xb596('0x3d')](_0xb555ad[_0xb596('0x33')],function(_0x5ea038){var _0x1bf26f={};_0x1bf26f[_0x5ea038]={'$like':'%'+_0x15ce2b[_0xb596('0x2f')][_0xb596('0x3b')]+'%'};return _0x1bf26f;})});}_0xb555ad=_[_0xb596('0x3c')]({},_0xb555ad,_0x15ce2b[_0xb596('0x41')]);return db[_0xb596('0x5d')]['count']({'where':_0xb555ad[_0xb596('0x3a')]})[_0xb596('0x23')](function(_0x143844){_0x320e5b[_0xb596('0x42')]=_0x143844;if(_0x15ce2b['query']['includeAll']){_0xb555ad['include']=[{'all':!![]}];}return db[_0xb596('0x5d')]['findAll'](_0xb555ad);})[_0xb596('0x23')](function(_0x5e27cd){_0x320e5b[_0xb596('0x44')]=_0x5e27cd;return _0x320e5b;});}})[_0xb596('0x23')](respondWithFilteredResult(_0x1d5833,_0xb555ad))[_0xb596('0x45')](handleError(_0x1d5833,null));};function char(_0x3eb6d3){return _0xb596('0x5e')===typeof _0x3eb6d3?String['fromCharCode']['apply'](null,arguments):_0x3eb6d3;}function needsEncapsulation(_0x3f6ff7){return!!_0x3f6ff7&&(_0x3f6ff7['toString']()[_0xb596('0x5f')](char(0xd))>=0x0||_0x3f6ff7[_0xb596('0x60')]()['indexOf'](char(0xa))>=0x0||_0x3f6ff7[_0xb596('0x60')]()['indexOf'](char(0x2c))>=0x0||_0x3f6ff7[_0xb596('0x60')]()[_0xb596('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x46123d){var _0x361c82=char(0x22),_0x5f1eb5='\x5c'+char(0x22),_0x5367d0=_0x46123d[_0xb596('0x60')]()['replace'](new RegExp(_0x361c82,'g'),_0x5f1eb5);return _0x361c82+_0x5367d0+_0x361c82;}exports[_0xb596('0x61')]=function(_0x2e2fe8,_0x331748,_0xe68b65){var _0x3181f4,_0x4e0719;return db['JscriptySessionReport'][_0xb596('0x5c')]({'where':{'ProjectId':_0x2e2fe8[_0xb596('0x47')]['id'],'starttime':_0x2e2fe8[_0xb596('0x2f')][_0xb596('0x62')]}})[_0xb596('0x23')](handleEntityNotFound(_0x331748,null))[_0xb596('0x23')](function(_0x342d50){if(_0x342d50){_0x3181f4=_0x342d50;return db[_0xb596('0x63')][_0xb596('0x5c')]({'where':{'SessionId':{'$in':_[_0xb596('0x3d')](_0x3181f4,'id')},'ProjectId':_0x2e2fe8['params']['id']},'order':_0xb596('0x64')});}})[_0xb596('0x23')](handleEntityNotFound(_0x331748,null))['then'](function(_0x4a22d9){if(_0x4a22d9){_0x4e0719=_0x4a22d9;var _0x304395={};for(var _0x5157fe=0x0,_0x296b4=_0x4e0719['length'];_0x5157fe<_0x296b4;_0x5157fe++){if(!_0x304395[_0xb596('0x36')](_0x4e0719[_0x5157fe][_0xb596('0x65')])){_0x304395[_0x4e0719[_0x5157fe][_0xb596('0x65')]]=needsEncapsulation(_0x4e0719[_0x5157fe][_0xb596('0x66')])?encapsulate(_0x4e0719[_0x5157fe][_0xb596('0x66')]):_0x4e0719[_0x5157fe]['question'];}}var _0x2db307=[],_0x16edf7={};for(var _0x143d54=0x0,_0xd20a10=_0x3181f4[_0xb596('0x35')];_0x143d54<_0xd20a10;_0x143d54++){_0x16edf7={'ProjectId':_0x2e2fe8['params']['id'],'SessionId':_0x3181f4[_0x143d54]['id'],'StartTime':moment(_0x3181f4[_0x143d54][_0xb596('0x67')])[_0xb596('0x68')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x312a1e=0x0,_0x2a7604=_0x4e0719[_0xb596('0x35')];_0x312a1e<_0x2a7604;_0x312a1e++){if(_0x4e0719[_0x312a1e]['SessionId']==_0x3181f4[_0x143d54]['id']&&_0x304395[_0xb596('0x36')](_0x4e0719[_0x312a1e][_0xb596('0x65')])){_0x16edf7[_0x304395[_0x4e0719[_0x312a1e]['questionId']]]=_0x4e0719[_0x312a1e][_0xb596('0x69')];}}for(var _0x1f5f73 in _0x304395){if(!_0x16edf7[_0xb596('0x36')](_0x304395[_0x1f5f73])){_0x16edf7[_0x304395[_0x1f5f73]]=null;}}_0x2db307['push'](_0x16edf7);}return _0x2db307;}})[_0xb596('0x23')](function(_0x43e734){if(!_[_0xb596('0x6a')](_0x43e734)){var _0x1c19f8=toCsv(_0x43e734);var _0x43fa85=Date[_0xb596('0x6b')]();fs[_0xb596('0x6c')](util[_0xb596('0x68')](_0xb596('0x6d'),_0x2e2fe8[_0xb596('0x47')]['id'],_0x43fa85),_0x1c19f8);_0x331748[_0xb596('0x6e')]('Content-disposition','attachment;\x20filename='+util[_0xb596('0x68')]('Jscripty_Project_%d_Summary_%s.csv',_0x2e2fe8[_0xb596('0x47')]['id'],_0x43fa85));_0x331748['setHeader']('Content-type',_0xb596('0x6f'));return _0x331748['download'](util['format'](_0xb596('0x6d'),_0x2e2fe8[_0xb596('0x47')]['id'],_0x43fa85));}else{return _0x331748[_0xb596('0x27')](0xcc);}})[_0xb596('0x45')](handleError(_0x331748,null));}; \ No newline at end of file +var _0xf706=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','create','user','userProfileId','getSessions','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','getAnswers','params','JscriptyAnswerReport','rows','toString','indexOf','replace','getSummary','startTime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','stack','name','send','index','JscriptyProject','rawAttributes','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','merge','map','type','key','field','filter','options','includeAll','findAll','show','include','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf706,0x16d));var _0x6f70=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xf706[_0xb24a3e];return _0x4038d7;};'use strict';var pdf=require(_0x6f70('0x0'));var emlformat=require(_0x6f70('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6f70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6f70('0x3'));var BPromise=require(_0x6f70('0x4'));var Mustache=require(_0x6f70('0x5'));var util=require(_0x6f70('0x6'));var path=require(_0x6f70('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6f70('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6f70('0x9'));var crypto=require(_0x6f70('0xa'));var jsforce=require(_0x6f70('0xb'));var deskjs=require(_0x6f70('0xc'));var toCsv=require(_0x6f70('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x6f70('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x6f70('0xf'));var qs=require(_0x6f70('0x10'));var logger=require(_0x6f70('0x11'))(_0x6f70('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x160182,_0x3bae54){_0x3bae54=_0x3bae54||0xcc;return function(_0x5815d0){if(_0x5815d0){return _0x160182['sendStatus'](_0x3bae54);}return _0x160182[_0x6f70('0x13')](_0x3bae54)['end']();};}function respondWithResult(_0x380009,_0x1052ba){_0x1052ba=_0x1052ba||0xc8;return function(_0x3321d1){if(_0x3321d1){return _0x380009[_0x6f70('0x13')](_0x1052ba)[_0x6f70('0x14')](_0x3321d1);}};}function respondWithFilteredResult(_0x44db01,_0x1020f8){return function(_0x1700d9){if(_0x1700d9){var _0x45e0d5=_0x1700d9[_0x6f70('0x15')],_0x444b97=_0x1020f8[_0x6f70('0x16')],_0x4fa49d=_0x1020f8[_0x6f70('0x16')]+_0x1020f8['limit'],_0xf80529;if(_0x4fa49d>=_0x45e0d5){_0x4fa49d=_0x45e0d5;_0xf80529=0xc8;}else{_0xf80529=0xce;}_0x44db01['status'](_0xf80529);return _0x44db01[_0x6f70('0x17')](_0x6f70('0x18'),_0x444b97+'-'+_0x4fa49d+'/'+_0x45e0d5)[_0x6f70('0x14')](_0x1700d9);}return null;};}function patchUpdates(_0xf2d7bc){return function(_0x532064){try{jsonpatch[_0x6f70('0x19')](_0x532064,_0xf2d7bc,!![]);}catch(_0xcb5ea8){return BPromise[_0x6f70('0x1a')](_0xcb5ea8);}return _0x532064[_0x6f70('0x1b')]();};}function saveUpdates(_0xe93cd5,_0x1db5fc){return function(_0x523251){if(_0x523251){return _0x523251[_0x6f70('0x1c')](_0xe93cd5)[_0x6f70('0x1d')](function(_0x9d8f72){return _0x9d8f72;});}return null;};}function removeEntity(_0x5b0b2c,_0x2a0f75){return function(_0x459112){if(_0x459112){return _0x459112[_0x6f70('0x1e')]()[_0x6f70('0x1d')](function(){var _0x1597fe=_0x459112[_0x6f70('0x1f')]({'plain':!![]});var _0x457805=_0x6f70('0x20');return db[_0x6f70('0x21')][_0x6f70('0x1e')]({'where':{'type':_0x457805,'resourceId':_0x1597fe['id']}})['then'](function(){return _0x459112;});})[_0x6f70('0x1d')](function(){_0x5b0b2c[_0x6f70('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18ef62,_0x1ff613){return function(_0x3eb568){if(!_0x3eb568){_0x18ef62['sendStatus'](0x194);}return _0x3eb568;};}function handleError(_0x6a4c36,_0x4c0904){_0x4c0904=_0x4c0904||0x1f4;return function(_0x48846b){logger['error'](_0x48846b[_0x6f70('0x22')]);if(_0x48846b['name']){delete _0x48846b[_0x6f70('0x23')];}_0x6a4c36[_0x6f70('0x13')](_0x4c0904)[_0x6f70('0x24')](_0x48846b);};}exports[_0x6f70('0x25')]=function(_0x30ddc7,_0x557637){var _0x463cf2={},_0x542307={},_0x1e9e15={'count':0x0,'rows':[]};var _0x1b7f31=db[_0x6f70('0x26')][_0x6f70('0x27')];_0x542307[_0x6f70('0x28')]=_['keys'](_0x1b7f31);_0x542307[_0x6f70('0x29')]=_[_0x6f70('0x2a')](_0x30ddc7[_0x6f70('0x29')]);_0x542307['filters']=_[_0x6f70('0x2b')](_0x542307['model'],_0x542307[_0x6f70('0x29')]);_0x463cf2[_0x6f70('0x2c')]=_[_0x6f70('0x2b')](_0x542307[_0x6f70('0x28')],qs[_0x6f70('0x2d')](_0x30ddc7[_0x6f70('0x29')][_0x6f70('0x2d')]));_0x463cf2[_0x6f70('0x2c')]=_0x463cf2[_0x6f70('0x2c')][_0x6f70('0x2e')]?_0x463cf2[_0x6f70('0x2c')]:_0x542307[_0x6f70('0x28')];if(!_0x30ddc7['query']['hasOwnProperty'](_0x6f70('0x2f'))){_0x463cf2[_0x6f70('0x30')]=qs[_0x6f70('0x30')](_0x30ddc7['query'][_0x6f70('0x30')]);_0x463cf2[_0x6f70('0x16')]=qs[_0x6f70('0x16')](_0x30ddc7[_0x6f70('0x29')][_0x6f70('0x16')]);}_0x463cf2[_0x6f70('0x31')]=qs['sort'](_0x30ddc7[_0x6f70('0x29')][_0x6f70('0x32')]);_0x463cf2[_0x6f70('0x33')]=qs[_0x6f70('0x34')](_[_0x6f70('0x35')](_0x30ddc7['query'],_0x542307['filters']));if(_0x30ddc7[_0x6f70('0x29')]['filter']){_0x463cf2[_0x6f70('0x33')]=_[_0x6f70('0x36')](_0x463cf2[_0x6f70('0x33')],{'$or':_[_0x6f70('0x37')](_0x1b7f31,function(_0x3ac777){if(_0x3ac777[_0x6f70('0x38')][_0x6f70('0x39')]!=='VIRTUAL'){var _0x59243b={};_0x59243b[_0x3ac777[_0x6f70('0x3a')]]={'$like':'%'+_0x30ddc7[_0x6f70('0x29')][_0x6f70('0x3b')]+'%'};return _0x59243b;}})});}_0x463cf2=_['merge']({},_0x463cf2,_0x30ddc7[_0x6f70('0x3c')]);var _0x128e66={'where':_0x463cf2[_0x6f70('0x33')]};return db[_0x6f70('0x26')][_0x6f70('0x15')](_0x128e66)['then'](function(_0x42c98d){_0x1e9e15[_0x6f70('0x15')]=_0x42c98d;if(_0x30ddc7['query'][_0x6f70('0x3d')]){_0x463cf2['include']=[{'all':!![]}];}return db[_0x6f70('0x26')][_0x6f70('0x3e')](_0x463cf2);})[_0x6f70('0x1d')](function(_0x53a7f6){_0x1e9e15['rows']=_0x53a7f6;return _0x1e9e15;})[_0x6f70('0x1d')](respondWithFilteredResult(_0x557637,_0x463cf2))['catch'](handleError(_0x557637,null));};exports[_0x6f70('0x3f')]=function(_0x32b45f,_0x5873a4){var _0x59fbab={'raw':![],'where':{'id':_0x32b45f['params']['id']}},_0x59b1c1={};_0x59b1c1['model']=_[_0x6f70('0x2a')](db[_0x6f70('0x26')][_0x6f70('0x27')]);_0x59b1c1[_0x6f70('0x29')]=_[_0x6f70('0x2a')](_0x32b45f[_0x6f70('0x29')]);_0x59b1c1[_0x6f70('0x34')]=_[_0x6f70('0x2b')](_0x59b1c1[_0x6f70('0x28')],_0x59b1c1[_0x6f70('0x29')]);_0x59fbab[_0x6f70('0x2c')]=_['intersection'](_0x59b1c1[_0x6f70('0x28')],qs[_0x6f70('0x2d')](_0x32b45f['query'][_0x6f70('0x2d')]));_0x59fbab['attributes']=_0x59fbab[_0x6f70('0x2c')][_0x6f70('0x2e')]?_0x59fbab[_0x6f70('0x2c')]:_0x59b1c1[_0x6f70('0x28')];if(_0x32b45f['query'][_0x6f70('0x3d')]){_0x59fbab[_0x6f70('0x40')]=[{'all':!![]}];}_0x59fbab=_[_0x6f70('0x36')]({},_0x59fbab,_0x32b45f[_0x6f70('0x3c')]);return db['JscriptyProject'][_0x6f70('0x41')](_0x59fbab)['then'](handleEntityNotFound(_0x5873a4,null))[_0x6f70('0x1d')](respondWithResult(_0x5873a4,null))['catch'](handleError(_0x5873a4,null));};exports['create']=function(_0x2ff61b,_0x5546c9){return db['JscriptyProject']['create'](_0x2ff61b[_0x6f70('0x42')],{})[_0x6f70('0x1d')](function(_0x43b847){var _0x4e4f7b=_0x2ff61b['user'][_0x6f70('0x1f')]({'plain':!![]});if(!_0x4e4f7b)throw new Error(_0x6f70('0x43'));if(_0x4e4f7b[_0x6f70('0x44')]==='user'){var _0x2728fd=_0x43b847[_0x6f70('0x1f')]({'plain':!![]});var _0x1d66fc=_0x6f70('0x20');return db['UserProfileSection']['find']({'where':{'name':_0x1d66fc,'userProfileId':_0x4e4f7b['userProfileId']},'raw':!![]})[_0x6f70('0x1d')](function(_0x5d843b){if(_0x5d843b&&_0x5d843b[_0x6f70('0x45')]===0x0){return db[_0x6f70('0x21')]['create']({'name':_0x2728fd[_0x6f70('0x23')],'resourceId':_0x2728fd['id'],'type':_0x5d843b['name'],'sectionId':_0x5d843b['id']},{})[_0x6f70('0x1d')](function(){return _0x43b847;});}else{return _0x43b847;}})[_0x6f70('0x46')](function(_0x493acf){logger[_0x6f70('0x47')](_0x6f70('0x48'),_0x493acf);throw _0x493acf;});}return _0x43b847;})['then'](respondWithResult(_0x5546c9,0xc9))[_0x6f70('0x46')](handleError(_0x5546c9,null));};exports[_0x6f70('0x49')]=function(_0x56156f,_0x63d3d4){var _0x5dedf7={'raw':![],'where':{'id':_0x56156f['params']['id']}},_0x1b040a={};_0x1b040a[_0x6f70('0x28')]=_[_0x6f70('0x2a')](db[_0x6f70('0x26')][_0x6f70('0x27')]);_0x5dedf7[_0x6f70('0x2c')]=_[_0x6f70('0x2b')](_0x1b040a[_0x6f70('0x28')],qs[_0x6f70('0x2d')](_0x56156f['query']['fields']));_0x5dedf7[_0x6f70('0x2c')]=_0x5dedf7[_0x6f70('0x2c')][_0x6f70('0x2e')]?_0x5dedf7[_0x6f70('0x2c')]:_0x1b040a[_0x6f70('0x28')];if(_0x56156f['query'][_0x6f70('0x3d')]){_0x5dedf7[_0x6f70('0x40')]=[{'all':!![]}];}_0x5dedf7=_[_0x6f70('0x36')]({},_0x5dedf7,_0x56156f[_0x6f70('0x3c')]);return db[_0x6f70('0x26')]['find'](_0x5dedf7)[_0x6f70('0x1d')](handleEntityNotFound(_0x63d3d4,null))[_0x6f70('0x1d')](function(_0xd47cce){if(_0xd47cce){var _0x125713=_0xd47cce['get']({'plain':!![]});_0x125713=qs['omit'](_0x125713,['id',_0x6f70('0x4a'),_0x6f70('0x4b')]);_0x56156f[_0x6f70('0x42')]=_[_0x6f70('0x4c')](_0x56156f[_0x6f70('0x42')],['id','createdAt',_0x6f70('0x4b')]);return db['JscriptyProject'][_0x6f70('0x4d')](_[_0x6f70('0x36')](_0x125713,_0x56156f[_0x6f70('0x42')]),{'include':_0x56156f[_0x6f70('0x29')][_0x6f70('0x3d')]?[{'all':!![]}]:undefined})['then'](function(_0x5ce602){var _0x27f3cf=_0x56156f[_0x6f70('0x4e')][_0x6f70('0x1f')]({'plain':!![]});if(!_0x27f3cf)throw new Error(_0x6f70('0x43'));if(_0x27f3cf[_0x6f70('0x44')]==='user'){var _0x3f2680=_0x5ce602['get']({'plain':!![]});var _0x24c143=_0x6f70('0x20');return db['UserProfileSection'][_0x6f70('0x41')]({'where':{'name':_0x24c143,'userProfileId':_0x27f3cf[_0x6f70('0x4f')]},'raw':!![]})[_0x6f70('0x1d')](function(_0x2cef27){if(_0x2cef27&&_0x2cef27[_0x6f70('0x45')]===0x0){return db[_0x6f70('0x21')]['create']({'name':_0x3f2680[_0x6f70('0x23')],'resourceId':_0x3f2680['id'],'type':_0x2cef27[_0x6f70('0x23')],'sectionId':_0x2cef27['id']},{})['then'](function(){return _0x5ce602;});}else{return _0x5ce602;}})[_0x6f70('0x46')](function(_0x118f24){logger[_0x6f70('0x47')](_0x6f70('0x48'),_0x118f24);throw _0x118f24;});}return _0x5ce602;});}})[_0x6f70('0x1d')](respondWithResult(_0x63d3d4,0xc9))[_0x6f70('0x46')](handleError(_0x63d3d4,null));};exports[_0x6f70('0x1c')]=function(_0x4fd715,_0x15ba21){if(_0x4fd715[_0x6f70('0x42')]['id']){delete _0x4fd715[_0x6f70('0x42')]['id'];}return db[_0x6f70('0x26')][_0x6f70('0x41')]({'where':{'id':_0x4fd715['params']['id']}})[_0x6f70('0x1d')](handleEntityNotFound(_0x15ba21,null))[_0x6f70('0x1d')](saveUpdates(_0x4fd715[_0x6f70('0x42')],null))[_0x6f70('0x1d')](respondWithResult(_0x15ba21,null))[_0x6f70('0x46')](handleError(_0x15ba21,null));};exports[_0x6f70('0x1e')]=function(_0x329484,_0x4dc467){return db[_0x6f70('0x26')][_0x6f70('0x41')]({'where':{'id':_0x329484['params']['id']}})[_0x6f70('0x1d')](handleEntityNotFound(_0x4dc467,null))['then'](removeEntity(_0x4dc467,null))['catch'](handleError(_0x4dc467,null));};exports[_0x6f70('0x50')]=function(_0x566244,_0x5794ff,_0xa337fd){var _0x3b25f4={'raw':!![],'where':{}};var _0x476b27={};var _0x4f6c51={'count':0x0,'rows':[]};return db[_0x6f70('0x26')][_0x6f70('0x51')]({'where':{'id':_0x566244['params']['id']}})[_0x6f70('0x1d')](handleEntityNotFound(_0x5794ff,null))['then'](function(_0x45c9b1){if(_0x45c9b1){_0x476b27['model']=_['keys'](db[_0x6f70('0x52')][_0x6f70('0x27')]);_0x476b27[_0x6f70('0x29')]=_[_0x6f70('0x2a')](_0x566244[_0x6f70('0x29')]);_0x476b27[_0x6f70('0x34')]=_['intersection'](_0x476b27[_0x6f70('0x28')],_0x476b27['query']);_0x3b25f4['attributes']=_[_0x6f70('0x2b')](_0x476b27['model'],qs[_0x6f70('0x2d')](_0x566244[_0x6f70('0x29')]['fields']));_0x3b25f4['attributes']=_0x3b25f4[_0x6f70('0x2c')][_0x6f70('0x2e')]?_0x3b25f4[_0x6f70('0x2c')]:_0x476b27[_0x6f70('0x28')];if(!_0x566244[_0x6f70('0x29')][_0x6f70('0x53')](_0x6f70('0x2f'))){_0x3b25f4[_0x6f70('0x30')]=qs[_0x6f70('0x30')](_0x566244['query'][_0x6f70('0x30')]);_0x3b25f4[_0x6f70('0x16')]=qs[_0x6f70('0x16')](_0x566244[_0x6f70('0x29')][_0x6f70('0x16')]);}_0x3b25f4[_0x6f70('0x31')]=qs[_0x6f70('0x32')](_0x566244[_0x6f70('0x29')]['sort']);_0x3b25f4[_0x6f70('0x33')]=qs[_0x6f70('0x34')](_[_0x6f70('0x35')](_0x566244[_0x6f70('0x29')],_0x476b27['filters']));_0x3b25f4[_0x6f70('0x33')][_0x6f70('0x54')]=_0x45c9b1['id'];if(_0x566244[_0x6f70('0x29')][_0x6f70('0x3b')]){_0x3b25f4['where']=_['merge'](_0x3b25f4[_0x6f70('0x33')],{'$or':_[_0x6f70('0x37')](_0x3b25f4[_0x6f70('0x2c')],function(_0x269097){var _0x417d2c={};_0x417d2c[_0x269097]={'$like':'%'+_0x566244['query']['filter']+'%'};return _0x417d2c;})});}_0x3b25f4=_[_0x6f70('0x36')]({},_0x3b25f4,_0x566244['options']);return db[_0x6f70('0x52')][_0x6f70('0x15')]({'where':_0x3b25f4[_0x6f70('0x33')]})[_0x6f70('0x1d')](function(_0x230c88){_0x4f6c51[_0x6f70('0x15')]=_0x230c88;if(_0x566244[_0x6f70('0x29')][_0x6f70('0x3d')]){_0x3b25f4[_0x6f70('0x40')]=[{'all':!![]}];}return db[_0x6f70('0x52')][_0x6f70('0x3e')](_0x3b25f4);})['then'](function(_0xb2ea02){_0x4f6c51['rows']=_0xb2ea02;return _0x4f6c51;});}})[_0x6f70('0x1d')](respondWithFilteredResult(_0x5794ff,_0x3b25f4))['catch'](handleError(_0x5794ff,null));};exports[_0x6f70('0x55')]=function(_0x274775,_0x1c497d,_0x2fab02){var _0x298f4d={'raw':!![],'where':{}};var _0x5c332a={};var _0xb4b003={'count':0x0,'rows':[]};return db[_0x6f70('0x26')][_0x6f70('0x51')]({'where':{'id':_0x274775[_0x6f70('0x56')]['id']}})[_0x6f70('0x1d')](handleEntityNotFound(_0x1c497d,null))[_0x6f70('0x1d')](function(_0x31285f){if(_0x31285f){_0x5c332a['model']=_[_0x6f70('0x2a')](db[_0x6f70('0x57')]['rawAttributes']);_0x5c332a[_0x6f70('0x29')]=_[_0x6f70('0x2a')](_0x274775[_0x6f70('0x29')]);_0x5c332a['filters']=_['intersection'](_0x5c332a[_0x6f70('0x28')],_0x5c332a[_0x6f70('0x29')]);_0x298f4d['attributes']=_['intersection'](_0x5c332a[_0x6f70('0x28')],qs[_0x6f70('0x2d')](_0x274775[_0x6f70('0x29')][_0x6f70('0x2d')]));_0x298f4d['attributes']=_0x298f4d[_0x6f70('0x2c')][_0x6f70('0x2e')]?_0x298f4d[_0x6f70('0x2c')]:_0x5c332a[_0x6f70('0x28')];if(!_0x274775[_0x6f70('0x29')][_0x6f70('0x53')](_0x6f70('0x2f'))){_0x298f4d[_0x6f70('0x30')]=qs[_0x6f70('0x30')](_0x274775[_0x6f70('0x29')]['limit']);_0x298f4d[_0x6f70('0x16')]=qs[_0x6f70('0x16')](_0x274775[_0x6f70('0x29')][_0x6f70('0x16')]);}_0x298f4d['order']=qs[_0x6f70('0x32')](_0x274775[_0x6f70('0x29')][_0x6f70('0x32')]);_0x298f4d[_0x6f70('0x33')]=qs['filters'](_[_0x6f70('0x35')](_0x274775[_0x6f70('0x29')],_0x5c332a[_0x6f70('0x34')]));_0x298f4d[_0x6f70('0x33')][_0x6f70('0x54')]=_0x31285f['id'];if(_0x274775[_0x6f70('0x29')][_0x6f70('0x3b')]){_0x298f4d[_0x6f70('0x33')]=_[_0x6f70('0x36')](_0x298f4d['where'],{'$or':_[_0x6f70('0x37')](_0x298f4d[_0x6f70('0x2c')],function(_0x3e6d3f){var _0x5f2c77={};_0x5f2c77[_0x3e6d3f]={'$like':'%'+_0x274775[_0x6f70('0x29')][_0x6f70('0x3b')]+'%'};return _0x5f2c77;})});}_0x298f4d=_['merge']({},_0x298f4d,_0x274775[_0x6f70('0x3c')]);return db['JscriptyAnswerReport'][_0x6f70('0x15')]({'where':_0x298f4d[_0x6f70('0x33')]})[_0x6f70('0x1d')](function(_0x4bf934){_0xb4b003['count']=_0x4bf934;if(_0x274775[_0x6f70('0x29')][_0x6f70('0x3d')]){_0x298f4d[_0x6f70('0x40')]=[{'all':!![]}];}return db[_0x6f70('0x57')][_0x6f70('0x3e')](_0x298f4d);})['then'](function(_0x16b7e1){_0xb4b003[_0x6f70('0x58')]=_0x16b7e1;return _0xb4b003;});}})[_0x6f70('0x1d')](respondWithFilteredResult(_0x1c497d,_0x298f4d))[_0x6f70('0x46')](handleError(_0x1c497d,null));};function char(_0x44ff82){return'number'===typeof _0x44ff82?String['fromCharCode'][_0x6f70('0x19')](null,arguments):_0x44ff82;}function needsEncapsulation(_0x302bb0){return!!_0x302bb0&&(_0x302bb0[_0x6f70('0x59')]()[_0x6f70('0x5a')](char(0xd))>=0x0||_0x302bb0[_0x6f70('0x59')]()[_0x6f70('0x5a')](char(0xa))>=0x0||_0x302bb0[_0x6f70('0x59')]()[_0x6f70('0x5a')](char(0x2c))>=0x0||_0x302bb0[_0x6f70('0x59')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x451e7f){var _0x10e687=char(0x22),_0x2cb2ef='\x5c'+char(0x22),_0x1e73ae=_0x451e7f[_0x6f70('0x59')]()[_0x6f70('0x5b')](new RegExp(_0x10e687,'g'),_0x2cb2ef);return _0x10e687+_0x1e73ae+_0x10e687;}exports[_0x6f70('0x5c')]=function(_0x218763,_0x5c7a44,_0x203327){var _0x198d71,_0x147bd2;return db[_0x6f70('0x52')][_0x6f70('0x3e')]({'where':{'ProjectId':_0x218763[_0x6f70('0x56')]['id'],'starttime':_0x218763[_0x6f70('0x29')][_0x6f70('0x5d')]}})[_0x6f70('0x1d')](handleEntityNotFound(_0x5c7a44,null))[_0x6f70('0x1d')](function(_0x327269){if(_0x327269){_0x198d71=_0x327269;return db['JscriptyQuestionReport'][_0x6f70('0x3e')]({'where':{'SessionId':{'$in':_[_0x6f70('0x37')](_0x198d71,'id')},'ProjectId':_0x218763[_0x6f70('0x56')]['id']},'order':_0x6f70('0x5e')});}})[_0x6f70('0x1d')](handleEntityNotFound(_0x5c7a44,null))[_0x6f70('0x1d')](function(_0x161dbd){if(_0x161dbd){_0x147bd2=_0x161dbd;var _0x3e0b21={};for(var _0x3bc971=0x0,_0x2d37df=_0x147bd2[_0x6f70('0x2e')];_0x3bc971<_0x2d37df;_0x3bc971++){if(!_0x3e0b21['hasOwnProperty'](_0x147bd2[_0x3bc971][_0x6f70('0x5f')])){_0x3e0b21[_0x147bd2[_0x3bc971][_0x6f70('0x5f')]]=needsEncapsulation(_0x147bd2[_0x3bc971][_0x6f70('0x60')])?encapsulate(_0x147bd2[_0x3bc971][_0x6f70('0x60')]):_0x147bd2[_0x3bc971][_0x6f70('0x60')];}}var _0x4a5654=[],_0x1e023f={};for(var _0x3e77a2=0x0,_0x5af0e8=_0x198d71[_0x6f70('0x2e')];_0x3e77a2<_0x5af0e8;_0x3e77a2++){_0x1e023f={'ProjectId':_0x218763['params']['id'],'SessionId':_0x198d71[_0x3e77a2]['id'],'StartTime':moment(_0x198d71[_0x3e77a2]['starttime'])[_0x6f70('0x61')](_0x6f70('0x62'))};for(var _0x290052=0x0,_0x199dac=_0x147bd2['length'];_0x290052<_0x199dac;_0x290052++){if(_0x147bd2[_0x290052][_0x6f70('0x63')]==_0x198d71[_0x3e77a2]['id']&&_0x3e0b21[_0x6f70('0x53')](_0x147bd2[_0x290052][_0x6f70('0x5f')])){_0x1e023f[_0x3e0b21[_0x147bd2[_0x290052][_0x6f70('0x5f')]]]=_0x147bd2[_0x290052][_0x6f70('0x64')];}}for(var _0x1222f6 in _0x3e0b21){if(!_0x1e023f[_0x6f70('0x53')](_0x3e0b21[_0x1222f6])){_0x1e023f[_0x3e0b21[_0x1222f6]]=null;}}_0x4a5654[_0x6f70('0x65')](_0x1e023f);}return _0x4a5654;}})[_0x6f70('0x1d')](function(_0x5ae20a){if(!_['isEmpty'](_0x5ae20a)){var _0x3807bc=toCsv(_0x5ae20a);var _0x5ddc60=Date[_0x6f70('0x66')]();fs['writeFileSync'](util[_0x6f70('0x61')](_0x6f70('0x67'),_0x218763[_0x6f70('0x56')]['id'],_0x5ddc60),_0x3807bc);_0x5c7a44['setHeader'](_0x6f70('0x68'),_0x6f70('0x69')+util['format'](_0x6f70('0x6a'),_0x218763[_0x6f70('0x56')]['id'],_0x5ddc60));_0x5c7a44['setHeader'](_0x6f70('0x6b'),'text/csv');return _0x5c7a44[_0x6f70('0x6c')](util[_0x6f70('0x61')](_0x6f70('0x67'),_0x218763[_0x6f70('0x56')]['id'],_0x5ddc60));}else{return _0x5c7a44['sendStatus'](0xcc);}})[_0x6f70('0x46')](handleError(_0x5c7a44,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 7802876..c6ea4d3 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 _0xfd83=['../../config/logger','moment','bluebird','request-promise','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash'];(function(_0x2e8de0,_0x54efa9){var _0x5ac2a4=function(_0xc9c4bd){while(--_0xc9c4bd){_0x2e8de0['push'](_0x2e8de0['shift']());}};_0x5ac2a4(++_0x54efa9);}(_0xfd83,0xe0));var _0x3fd8=function(_0xe2d14f,_0x49fd0e){_0xe2d14f=_0xe2d14f-0x0;var _0x4522d2=_0xfd83[_0xe2d14f];return _0x4522d2;};'use strict';var _=require(_0x3fd8('0x0'));var util=require('util');var logger=require(_0x3fd8('0x1'))('api');var moment=require(_0x3fd8('0x2'));var BPromise=require(_0x3fd8('0x3'));var rp=require(_0x3fd8('0x4'));var attributes=require(_0x3fd8('0x5'));module[_0x3fd8('0x6')]=function(_0xaf4743,_0x1b2ad2){return _0xaf4743['define'](_0x3fd8('0x7'),attributes,{'tableName':_0x3fd8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b00=['./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util','api','moment','request-promise'];(function(_0x30eb14,_0x56d32d){var _0x104545=function(_0x22d3d3){while(--_0x22d3d3){_0x30eb14['push'](_0x30eb14['shift']());}};_0x104545(++_0x56d32d);}(_0x5b00,0x113));var _0x05b0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5b00[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x05b0('0x0'));var logger=require('../../config/logger')(_0x05b0('0x1'));var moment=require(_0x05b0('0x2'));var BPromise=require('bluebird');var rp=require(_0x05b0('0x3'));var attributes=require(_0x05b0('0x4'));module[_0x05b0('0x5')]=function(_0x5e6dce,_0x536e44){return _0x5e6dce[_0x05b0('0x6')](_0x05b0('0x7'),attributes,{'tableName':_0x05b0('0x8'),'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 6f11dbc..eacbfbc 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 _0x2507=['../../config/environment','jayson/promise','client','http','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x299595,_0x3c8f09){var _0x5122b0=function(_0x5c9242){while(--_0x5c9242){_0x299595['push'](_0x299595['shift']());}};_0x5122b0(++_0x3c8f09);}(_0x2507,0x112));var _0x7250=function(_0x47e22c,_0x3de0e6){_0x47e22c=_0x47e22c-0x0;var _0x27435e=_0x2507[_0x47e22c];return _0x27435e;};'use strict';var _=require(_0x7250('0x0'));var util=require(_0x7250('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7250('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7250('0x3'));var logger=require(_0x7250('0x4'))(_0x7250('0x5'));var config=require(_0x7250('0x6'));var jayson=require(_0x7250('0x7'));var client=jayson[_0x7250('0x8')][_0x7250('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x456d37,_0x175dc2,_0x485868){return new BPromise(function(_0x38be59,_0x186637){return client['request'](_0x456d37,_0x485868)[_0x7250('0xa')](function(_0x4d2f36){logger[_0x7250('0xb')](_0x7250('0xc'),_0x175dc2,_0x7250('0xd'));logger['debug'](_0x7250('0xe'),_0x175dc2,'request\x20sent',JSON[_0x7250('0xf')](_0x4d2f36));if(_0x4d2f36[_0x7250('0x10')]){if(_0x4d2f36[_0x7250('0x10')][_0x7250('0x11')]===0x1f4){logger['error'](_0x7250('0xc'),_0x175dc2,_0x4d2f36['error'][_0x7250('0x12')]);return _0x186637(_0x4d2f36[_0x7250('0x10')][_0x7250('0x12')]);}logger[_0x7250('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x175dc2,_0x4d2f36[_0x7250('0x10')]['message']);return _0x38be59(_0x4d2f36[_0x7250('0x10')]['message']);}else{logger['info'](_0x7250('0xc'),_0x175dc2,_0x7250('0xd'));_0x38be59(_0x4d2f36[_0x7250('0x13')][_0x7250('0x12')]);}})['catch'](function(_0x5631a2){logger[_0x7250('0x10')](_0x7250('0xc'),_0x175dc2,_0x5631a2);_0x186637(_0x5631a2);});});} \ No newline at end of file +var _0xbac2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment'];(function(_0x547348,_0x210f75){var _0xd44e19=function(_0x13a30d){while(--_0x13a30d){_0x547348['push'](_0x547348['shift']());}};_0xd44e19(++_0x210f75);}(_0xbac2,0x71));var _0x2bac=function(_0x3b3a82,_0x53b5e0){_0x3b3a82=_0x3b3a82-0x0;var _0x267063=_0xbac2[_0x3b3a82];return _0x267063;};'use strict';var _=require(_0x2bac('0x0'));var util=require('util');var moment=require(_0x2bac('0x1'));var BPromise=require(_0x2bac('0x2'));var rs=require(_0x2bac('0x3'));var fs=require('fs');var Redis=require(_0x2bac('0x4'));var db=require(_0x2bac('0x5'))['db'];var utils=require(_0x2bac('0x6'));var logger=require('../../config/logger')(_0x2bac('0x7'));var config=require(_0x2bac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2bac('0x9')][_0x2bac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x580af9,_0x3a5ef3,_0x734e6a){return new BPromise(function(_0x45c00b,_0x1cfab3){return client[_0x2bac('0xb')](_0x580af9,_0x734e6a)['then'](function(_0x18f134){logger['info'](_0x2bac('0xc'),_0x3a5ef3,_0x2bac('0xd'));logger[_0x2bac('0xe')](_0x2bac('0xf'),_0x3a5ef3,_0x2bac('0xd'),JSON[_0x2bac('0x10')](_0x18f134));if(_0x18f134[_0x2bac('0x11')]){if(_0x18f134[_0x2bac('0x11')][_0x2bac('0x12')]===0x1f4){logger[_0x2bac('0x11')](_0x2bac('0xc'),_0x3a5ef3,_0x18f134[_0x2bac('0x11')][_0x2bac('0x13')]);return _0x1cfab3(_0x18f134['error']['message']);}logger['error'](_0x2bac('0xc'),_0x3a5ef3,_0x18f134[_0x2bac('0x11')][_0x2bac('0x13')]);return _0x45c00b(_0x18f134['error'][_0x2bac('0x13')]);}else{logger[_0x2bac('0x14')]('JscriptyProject,\x20%s,\x20%s',_0x3a5ef3,_0x2bac('0xd'));_0x45c00b(_0x18f134[_0x2bac('0x15')][_0x2bac('0x13')]);}})[_0x2bac('0x16')](function(_0x1572db){logger[_0x2bac('0x11')]('JscriptyProject,\x20%s,\x20%s',_0x3a5ef3,_0x1572db);_0x1cfab3(_0x1572db);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 203b23d..da850b3 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 _0xc28b=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','create','update','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4d134b,_0x4fc60a){var _0x38dc02=function(_0x20aa53){while(--_0x20aa53){_0x4d134b['push'](_0x4d134b['shift']());}};_0x38dc02(++_0x4fc60a);}(_0xc28b,0x178));var _0xbc28=function(_0xe8b463,_0x129158){_0xe8b463=_0xe8b463-0x0;var _0x24141b=_0xc28b[_0xe8b463];return _0x24141b;};'use strict';var multer=require(_0xbc28('0x0'));var util=require(_0xbc28('0x1'));var path=require(_0xbc28('0x2'));var timeout=require(_0xbc28('0x3'));var express=require(_0xbc28('0x4'));var router=express[_0xbc28('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xbc28('0x6'));var config=require(_0xbc28('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0xbc28('0x8')]('/',auth[_0xbc28('0x9')](),controller[_0xbc28('0xa')]);router[_0xbc28('0x8')](_0xbc28('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xbc28('0x8')]('/:id',auth[_0xbc28('0x9')](),controller[_0xbc28('0xc')]);router[_0xbc28('0xd')]('/',auth['isAuthenticated'](),controller[_0xbc28('0xe')]);router['put']('/:id',auth[_0xbc28('0x9')](),controller[_0xbc28('0xf')]);router['delete'](_0xbc28('0x10'),auth['isAuthenticated'](),controller[_0xbc28('0x11')]);module[_0xbc28('0x12')]=router; \ No newline at end of file +var _0xd9dc=['describe','/:id','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','get','/describe'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xd9dc,0x16f));var _0xcd9d=function(_0x3e0709,_0x3e427b){_0x3e0709=_0x3e0709-0x0;var _0x9ed3b4=_0xd9dc[_0x3e0709];return _0x9ed3b4;};'use strict';var multer=require(_0xcd9d('0x0'));var util=require(_0xcd9d('0x1'));var path=require(_0xcd9d('0x2'));var timeout=require(_0xcd9d('0x3'));var express=require(_0xcd9d('0x4'));var router=express[_0xcd9d('0x5')]();var auth=require(_0xcd9d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcd9d('0x7'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0xcd9d('0x8')](),controller['index']);router[_0xcd9d('0x9')](_0xcd9d('0xa'),auth[_0xcd9d('0x8')](),controller[_0xcd9d('0xb')]);router[_0xcd9d('0x9')](_0xcd9d('0xc'),auth[_0xcd9d('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xcd9d('0xd')]);router[_0xcd9d('0xe')]('/:id',auth[_0xcd9d('0x8')](),controller[_0xcd9d('0xf')]);router[_0xcd9d('0x10')](_0xcd9d('0xc'),auth[_0xcd9d('0x8')](),controller[_0xcd9d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 2e8db65..814ff7d 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 _0xe130=['sequelize','exports','TEXT','long','STRING'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xe130,0x127));var _0x0e13=function(_0x299531,_0x207834){_0x299531=_0x299531-0x0;var _0x400819=_0xe130[_0x299531];return _0x400819;};'use strict';var Sequelize=require(_0x0e13('0x0'));module[_0x0e13('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x0e13('0x2')](_0x0e13('0x3'))},'membername':{'type':Sequelize[_0x0e13('0x4')]},'projectname':{'type':Sequelize[_0x0e13('0x4')]},'queue':{'type':Sequelize[_0x0e13('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0e13('0x4')]},'calleridnum':{'type':Sequelize[_0x0e13('0x4')]},'questionId':{'type':Sequelize[_0x0e13('0x4')]}}; \ No newline at end of file +var _0xb58b=['STRING','TEXT','exports'];(function(_0x117ce0,_0x528e86){var _0x1489b9=function(_0x3f4cbd){while(--_0x3f4cbd){_0x117ce0['push'](_0x117ce0['shift']());}};_0x1489b9(++_0x528e86);}(_0xb58b,0x1f1));var _0xbb58=function(_0x189c1e,_0x1d6bf6){_0x189c1e=_0x189c1e-0x0;var _0x5c0d4a=_0xb58b[_0x189c1e];return _0x5c0d4a;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'question':{'type':Sequelize[_0xbb58('0x1')]},'answer':{'type':Sequelize[_0xbb58('0x2')]('long')},'membername':{'type':Sequelize[_0xbb58('0x1')]},'projectname':{'type':Sequelize[_0xbb58('0x1')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xbb58('0x1')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xbb58('0x1')]},'questionId':{'type':Sequelize[_0xbb58('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index c91c34e..edf3574 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 _0xb62e=['filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','then','stack','name','send','index','JscriptyQuestionReport','rawAttributes','keys','query'];(function(_0x493c8c,_0x470567){var _0x17344b=function(_0x47aee7){while(--_0x47aee7){_0x493c8c['push'](_0x493c8c['shift']());}};_0x17344b(++_0x470567);}(_0xb62e,0x1de));var _0xeb62=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xb62e[_0x160c73];return _0xd9302;};'use strict';var pdf=require(_0xeb62('0x0'));var emlformat=require(_0xeb62('0x1'));var rimraf=require(_0xeb62('0x2'));var zipdir=require(_0xeb62('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb62('0x4'));var moment=require(_0xeb62('0x5'));var BPromise=require(_0xeb62('0x6'));var Mustache=require(_0xeb62('0x7'));var util=require(_0xeb62('0x8'));var path=require(_0xeb62('0x9'));var sox=require('sox');var csv=require(_0xeb62('0xa'));var ejs=require(_0xeb62('0xb'));var fs=require('fs');var _=require(_0xeb62('0xc'));var squel=require('squel');var crypto=require(_0xeb62('0xd'));var jsforce=require(_0xeb62('0xe'));var deskjs=require(_0xeb62('0xf'));var toCsv=require(_0xeb62('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xeb62('0x10'));var hardwareService=require(_0xeb62('0x11'));var Redis=require(_0xeb62('0x12'));var qs=require(_0xeb62('0x13'));var logger=require(_0xeb62('0x14'))(_0xeb62('0x15'));var utils=require(_0xeb62('0x16'));var config=require(_0xeb62('0x17'));var db=require(_0xeb62('0x18'))['db'];function respondWithStatusCode(_0x17724e,_0x4a493c){_0x4a493c=_0x4a493c||0xcc;return function(_0x422daf){if(_0x422daf){return _0x17724e[_0xeb62('0x19')](_0x4a493c);}return _0x17724e[_0xeb62('0x1a')](_0x4a493c)[_0xeb62('0x1b')]();};}function respondWithResult(_0x55a629,_0x333126){_0x333126=_0x333126||0xc8;return function(_0x2fbad2){if(_0x2fbad2){return _0x55a629[_0xeb62('0x1a')](_0x333126)['json'](_0x2fbad2);}};}function respondWithFilteredResult(_0x26c3fd,_0x195837){return function(_0x2fd4c7){if(_0x2fd4c7){var _0x4ce9fa=_0x2fd4c7[_0xeb62('0x1c')],_0x1f6a1f=_0x195837[_0xeb62('0x1d')],_0x15b3e8=_0x195837[_0xeb62('0x1d')]+_0x195837[_0xeb62('0x1e')],_0x184106;if(_0x15b3e8>=_0x4ce9fa){_0x15b3e8=_0x4ce9fa;_0x184106=0xc8;}else{_0x184106=0xce;}_0x26c3fd[_0xeb62('0x1a')](_0x184106);return _0x26c3fd[_0xeb62('0x1f')](_0xeb62('0x20'),_0x1f6a1f+'-'+_0x15b3e8+'/'+_0x4ce9fa)[_0xeb62('0x21')](_0x2fd4c7);}return null;};}function patchUpdates(_0x11d516){return function(_0x3cdf76){try{jsonpatch['apply'](_0x3cdf76,_0x11d516,!![]);}catch(_0x38c5e4){return BPromise[_0xeb62('0x22')](_0x38c5e4);}return _0x3cdf76[_0xeb62('0x23')]();};}function saveUpdates(_0xb44905,_0x425817){return function(_0x24cbf3){if(_0x24cbf3){return _0x24cbf3[_0xeb62('0x24')](_0xb44905)['then'](function(_0x599d0b){return _0x599d0b;});}return null;};}function removeEntity(_0x1fbfaa,_0x154451){return function(_0x11ed9c){if(_0x11ed9c){return _0x11ed9c[_0xeb62('0x25')]()[_0xeb62('0x26')](function(){_0x1fbfaa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4664ce,_0x132861){return function(_0x182781){if(!_0x182781){_0x4664ce[_0xeb62('0x19')](0x194);}return _0x182781;};}function handleError(_0x55a169,_0x4e92f5){_0x4e92f5=_0x4e92f5||0x1f4;return function(_0x3ef988){logger['error'](_0x3ef988[_0xeb62('0x27')]);if(_0x3ef988['name']){delete _0x3ef988[_0xeb62('0x28')];}_0x55a169['status'](_0x4e92f5)[_0xeb62('0x29')](_0x3ef988);};}exports[_0xeb62('0x2a')]=function(_0x46d1bb,_0x4e4268){var _0x3ef784={},_0x3ae031={},_0x5222f4={'count':0x0,'rows':[]};var _0xe8872c=db[_0xeb62('0x2b')][_0xeb62('0x2c')];_0x3ae031['model']=_[_0xeb62('0x2d')](_0xe8872c);_0x3ae031[_0xeb62('0x2e')]=_['keys'](_0x46d1bb[_0xeb62('0x2e')]);_0x3ae031[_0xeb62('0x2f')]=_[_0xeb62('0x30')](_0x3ae031[_0xeb62('0x31')],_0x3ae031[_0xeb62('0x2e')]);_0x3ef784['attributes']=_['intersection'](_0x3ae031[_0xeb62('0x31')],qs[_0xeb62('0x32')](_0x46d1bb[_0xeb62('0x2e')][_0xeb62('0x32')]));_0x3ef784[_0xeb62('0x33')]=_0x3ef784[_0xeb62('0x33')][_0xeb62('0x34')]?_0x3ef784['attributes']:_0x3ae031[_0xeb62('0x31')];if(!_0x46d1bb['query']['hasOwnProperty'](_0xeb62('0x35'))){_0x3ef784[_0xeb62('0x1e')]=qs['limit'](_0x46d1bb[_0xeb62('0x2e')]['limit']);_0x3ef784[_0xeb62('0x1d')]=qs[_0xeb62('0x1d')](_0x46d1bb['query'][_0xeb62('0x1d')]);}_0x3ef784[_0xeb62('0x36')]=qs['sort'](_0x46d1bb[_0xeb62('0x2e')][_0xeb62('0x37')]);_0x3ef784[_0xeb62('0x38')]=qs[_0xeb62('0x2f')](_['pick'](_0x46d1bb[_0xeb62('0x2e')],_0x3ae031[_0xeb62('0x2f')]));if(_0x46d1bb['query']['filter']){_0x3ef784[_0xeb62('0x38')]=_[_0xeb62('0x39')](_0x3ef784['where'],{'$or':_[_0xeb62('0x3a')](_0xe8872c,function(_0x30cff0){if(_0x30cff0[_0xeb62('0x3b')][_0xeb62('0x3c')]!==_0xeb62('0x3d')){var _0x15387a={};_0x15387a[_0x30cff0[_0xeb62('0x3e')]]={'$like':'%'+_0x46d1bb['query']['filter']+'%'};return _0x15387a;}})});}_0x3ef784=_[_0xeb62('0x39')]({},_0x3ef784,_0x46d1bb[_0xeb62('0x3f')]);var _0x21772a={'where':_0x3ef784[_0xeb62('0x38')]};return db['JscriptyQuestionReport'][_0xeb62('0x1c')](_0x21772a)['then'](function(_0x20fd7a){_0x5222f4[_0xeb62('0x1c')]=_0x20fd7a;if(_0x46d1bb[_0xeb62('0x2e')][_0xeb62('0x40')]){_0x3ef784[_0xeb62('0x41')]=[{'all':!![]}];}return db[_0xeb62('0x2b')][_0xeb62('0x42')](_0x3ef784);})[_0xeb62('0x26')](function(_0x5e8ef8){_0x5222f4[_0xeb62('0x43')]=_0x5e8ef8;return _0x5222f4;})[_0xeb62('0x26')](respondWithFilteredResult(_0x4e4268,_0x3ef784))[_0xeb62('0x44')](handleError(_0x4e4268,null));};exports[_0xeb62('0x45')]=function(_0x5dd0e3,_0x4eda8b){var _0x46a560={'raw':!![],'where':{'id':_0x5dd0e3['params']['id']}},_0x41fb7d={};_0x41fb7d[_0xeb62('0x31')]=_[_0xeb62('0x2d')](db['JscriptyQuestionReport'][_0xeb62('0x2c')]);_0x41fb7d['query']=_[_0xeb62('0x2d')](_0x5dd0e3['query']);_0x41fb7d[_0xeb62('0x2f')]=_['intersection'](_0x41fb7d[_0xeb62('0x31')],_0x41fb7d[_0xeb62('0x2e')]);_0x46a560[_0xeb62('0x33')]=_['intersection'](_0x41fb7d['model'],qs[_0xeb62('0x32')](_0x5dd0e3[_0xeb62('0x2e')][_0xeb62('0x32')]));_0x46a560[_0xeb62('0x33')]=_0x46a560[_0xeb62('0x33')]['length']?_0x46a560[_0xeb62('0x33')]:_0x41fb7d['model'];if(_0x5dd0e3[_0xeb62('0x2e')]['includeAll']){_0x46a560[_0xeb62('0x41')]=[{'all':!![]}];}_0x46a560=_['merge']({},_0x46a560,_0x5dd0e3[_0xeb62('0x3f')]);return db['JscriptyQuestionReport'][_0xeb62('0x46')](_0x46a560)[_0xeb62('0x26')](handleEntityNotFound(_0x4eda8b,null))[_0xeb62('0x26')](respondWithResult(_0x4eda8b,null))[_0xeb62('0x44')](handleError(_0x4eda8b,null));};exports[_0xeb62('0x47')]=function(_0x21bb97,_0x4e62eb){return db[_0xeb62('0x2b')][_0xeb62('0x47')](_0x21bb97['body'],{})['then'](respondWithResult(_0x4e62eb,0xc9))['catch'](handleError(_0x4e62eb,null));};exports['update']=function(_0x24dff5,_0x12562f){if(_0x24dff5['body']['id']){delete _0x24dff5[_0xeb62('0x48')]['id'];}return db[_0xeb62('0x2b')][_0xeb62('0x46')]({'where':{'id':_0x24dff5[_0xeb62('0x49')]['id']}})[_0xeb62('0x26')](handleEntityNotFound(_0x12562f,null))['then'](saveUpdates(_0x24dff5[_0xeb62('0x48')],null))['then'](respondWithResult(_0x12562f,null))[_0xeb62('0x44')](handleError(_0x12562f,null));};exports[_0xeb62('0x25')]=function(_0x7fb53f,_0x18c40d){return db[_0xeb62('0x2b')][_0xeb62('0x46')]({'where':{'id':_0x7fb53f[_0xeb62('0x49')]['id']}})[_0xeb62('0x26')](handleEntityNotFound(_0x18c40d,null))[_0xeb62('0x26')](removeEntity(_0x18c40d,null))[_0xeb62('0x44')](handleError(_0x18c40d,null));};exports[_0xeb62('0x4a')]=function(_0x13e102,_0x4c3b96){return db[_0xeb62('0x2b')]['describe']()['then'](respondWithResult(_0x4c3b96,null))[_0xeb62('0x44')](handleError(_0x4c3b96,null));}; \ No newline at end of file +var _0x1c3d=['VIRTUAL','includeAll','include','findAll','rows','catch','show','options','create','update','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','apply','save','then','destroy','end','sendStatus','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','pick','merge','map','type','key'];(function(_0x536107,_0x20cb98){var _0x460378=function(_0x3425bc){while(--_0x3425bc){_0x536107['push'](_0x536107['shift']());}};_0x460378(++_0x20cb98);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x10f0dd,_0x342d6f){_0x10f0dd=_0x10f0dd-0x0;var _0x56e241=_0x1c3d[_0x10f0dd];return _0x56e241;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd1c3('0x0'));var rimraf=require(_0xd1c3('0x1'));var zipdir=require(_0xd1c3('0x2'));var jsonpatch=require(_0xd1c3('0x3'));var rp=require(_0xd1c3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd1c3('0x5'));var util=require(_0xd1c3('0x6'));var path=require(_0xd1c3('0x7'));var sox=require(_0xd1c3('0x8'));var csv=require(_0xd1c3('0x9'));var ejs=require(_0xd1c3('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd1c3('0xb'));var crypto=require(_0xd1c3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd1c3('0xd'));var toCsv=require(_0xd1c3('0x9'));var querystring=require(_0xd1c3('0xe'));var Papa=require(_0xd1c3('0xf'));var authService=require(_0xd1c3('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xd1c3('0x11'));var logger=require(_0xd1c3('0x12'))(_0xd1c3('0x13'));var utils=require(_0xd1c3('0x14'));var config=require(_0xd1c3('0x15'));var db=require(_0xd1c3('0x16'))['db'];function respondWithStatusCode(_0x373ffb,_0x280405){_0x280405=_0x280405||0xcc;return function(_0x159691){if(_0x159691){return _0x373ffb['sendStatus'](_0x280405);}return _0x373ffb[_0xd1c3('0x17')](_0x280405)['end']();};}function respondWithResult(_0x5eb3c1,_0x11d1f3){_0x11d1f3=_0x11d1f3||0xc8;return function(_0x57a55e){if(_0x57a55e){return _0x5eb3c1[_0xd1c3('0x17')](_0x11d1f3)[_0xd1c3('0x18')](_0x57a55e);}};}function respondWithFilteredResult(_0x37d175,_0x52e7bc){return function(_0xaaa259){if(_0xaaa259){var _0x4230f7=_0xaaa259[_0xd1c3('0x19')],_0x127067=_0x52e7bc[_0xd1c3('0x1a')],_0x3bc2b=_0x52e7bc[_0xd1c3('0x1a')]+_0x52e7bc[_0xd1c3('0x1b')],_0x42ba11;if(_0x3bc2b>=_0x4230f7){_0x3bc2b=_0x4230f7;_0x42ba11=0xc8;}else{_0x42ba11=0xce;}_0x37d175[_0xd1c3('0x17')](_0x42ba11);return _0x37d175['set']('Content-Range',_0x127067+'-'+_0x3bc2b+'/'+_0x4230f7)[_0xd1c3('0x18')](_0xaaa259);}return null;};}function patchUpdates(_0x3a1a74){return function(_0x3f1df3){try{jsonpatch[_0xd1c3('0x1c')](_0x3f1df3,_0x3a1a74,!![]);}catch(_0x5b2571){return BPromise['reject'](_0x5b2571);}return _0x3f1df3[_0xd1c3('0x1d')]();};}function saveUpdates(_0xac3076,_0x1dcb29){return function(_0x588f4e){if(_0x588f4e){return _0x588f4e['update'](_0xac3076)[_0xd1c3('0x1e')](function(_0x1b5fae){return _0x1b5fae;});}return null;};}function removeEntity(_0x4f8277,_0x4b2f00){return function(_0x1b5732){if(_0x1b5732){return _0x1b5732[_0xd1c3('0x1f')]()[_0xd1c3('0x1e')](function(){_0x4f8277[_0xd1c3('0x17')](0xcc)[_0xd1c3('0x20')]();});}};}function handleEntityNotFound(_0x46ed40,_0x137fd5){return function(_0xaa7580){if(!_0xaa7580){_0x46ed40[_0xd1c3('0x21')](0x194);}return _0xaa7580;};}function handleError(_0x218ef1,_0x5a9d5d){_0x5a9d5d=_0x5a9d5d||0x1f4;return function(_0x56091a){logger[_0xd1c3('0x22')](_0x56091a[_0xd1c3('0x23')]);if(_0x56091a[_0xd1c3('0x24')]){delete _0x56091a[_0xd1c3('0x24')];}_0x218ef1['status'](_0x5a9d5d)[_0xd1c3('0x25')](_0x56091a);};}exports[_0xd1c3('0x26')]=function(_0x54fd33,_0xcb5283){var _0x3f5206={},_0x6f912b={},_0x173cb9={'count':0x0,'rows':[]};var _0x10be91=db[_0xd1c3('0x27')][_0xd1c3('0x28')];_0x6f912b['model']=_['keys'](_0x10be91);_0x6f912b[_0xd1c3('0x29')]=_[_0xd1c3('0x2a')](_0x54fd33[_0xd1c3('0x29')]);_0x6f912b[_0xd1c3('0x2b')]=_[_0xd1c3('0x2c')](_0x6f912b['model'],_0x6f912b[_0xd1c3('0x29')]);_0x3f5206[_0xd1c3('0x2d')]=_['intersection'](_0x6f912b[_0xd1c3('0x2e')],qs['fields'](_0x54fd33[_0xd1c3('0x29')][_0xd1c3('0x2f')]));_0x3f5206[_0xd1c3('0x2d')]=_0x3f5206[_0xd1c3('0x2d')][_0xd1c3('0x30')]?_0x3f5206[_0xd1c3('0x2d')]:_0x6f912b[_0xd1c3('0x2e')];if(!_0x54fd33[_0xd1c3('0x29')][_0xd1c3('0x31')]('nolimit')){_0x3f5206[_0xd1c3('0x1b')]=qs[_0xd1c3('0x1b')](_0x54fd33['query'][_0xd1c3('0x1b')]);_0x3f5206['offset']=qs[_0xd1c3('0x1a')](_0x54fd33[_0xd1c3('0x29')][_0xd1c3('0x1a')]);}_0x3f5206['order']=qs[_0xd1c3('0x32')](_0x54fd33[_0xd1c3('0x29')][_0xd1c3('0x32')]);_0x3f5206[_0xd1c3('0x33')]=qs[_0xd1c3('0x2b')](_[_0xd1c3('0x34')](_0x54fd33[_0xd1c3('0x29')],_0x6f912b[_0xd1c3('0x2b')]));if(_0x54fd33[_0xd1c3('0x29')]['filter']){_0x3f5206['where']=_[_0xd1c3('0x35')](_0x3f5206['where'],{'$or':_[_0xd1c3('0x36')](_0x10be91,function(_0x3b2efa){if(_0x3b2efa[_0xd1c3('0x37')][_0xd1c3('0x38')]!==_0xd1c3('0x39')){var _0x3690f8={};_0x3690f8[_0x3b2efa['field']]={'$like':'%'+_0x54fd33[_0xd1c3('0x29')]['filter']+'%'};return _0x3690f8;}})});}_0x3f5206=_[_0xd1c3('0x35')]({},_0x3f5206,_0x54fd33['options']);var _0x292a57={'where':_0x3f5206['where']};return db['JscriptyQuestionReport'][_0xd1c3('0x19')](_0x292a57)[_0xd1c3('0x1e')](function(_0x40d394){_0x173cb9['count']=_0x40d394;if(_0x54fd33[_0xd1c3('0x29')][_0xd1c3('0x3a')]){_0x3f5206[_0xd1c3('0x3b')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xd1c3('0x3c')](_0x3f5206);})[_0xd1c3('0x1e')](function(_0x21b01a){_0x173cb9[_0xd1c3('0x3d')]=_0x21b01a;return _0x173cb9;})[_0xd1c3('0x1e')](respondWithFilteredResult(_0xcb5283,_0x3f5206))[_0xd1c3('0x3e')](handleError(_0xcb5283,null));};exports[_0xd1c3('0x3f')]=function(_0x5744f0,_0x20c891){var _0x357855={'raw':!![],'where':{'id':_0x5744f0['params']['id']}},_0x58d588={};_0x58d588[_0xd1c3('0x2e')]=_[_0xd1c3('0x2a')](db[_0xd1c3('0x27')][_0xd1c3('0x28')]);_0x58d588[_0xd1c3('0x29')]=_['keys'](_0x5744f0[_0xd1c3('0x29')]);_0x58d588[_0xd1c3('0x2b')]=_[_0xd1c3('0x2c')](_0x58d588[_0xd1c3('0x2e')],_0x58d588[_0xd1c3('0x29')]);_0x357855[_0xd1c3('0x2d')]=_[_0xd1c3('0x2c')](_0x58d588[_0xd1c3('0x2e')],qs[_0xd1c3('0x2f')](_0x5744f0[_0xd1c3('0x29')]['fields']));_0x357855[_0xd1c3('0x2d')]=_0x357855['attributes'][_0xd1c3('0x30')]?_0x357855[_0xd1c3('0x2d')]:_0x58d588[_0xd1c3('0x2e')];if(_0x5744f0['query'][_0xd1c3('0x3a')]){_0x357855[_0xd1c3('0x3b')]=[{'all':!![]}];}_0x357855=_[_0xd1c3('0x35')]({},_0x357855,_0x5744f0[_0xd1c3('0x40')]);return db[_0xd1c3('0x27')]['find'](_0x357855)['then'](handleEntityNotFound(_0x20c891,null))[_0xd1c3('0x1e')](respondWithResult(_0x20c891,null))['catch'](handleError(_0x20c891,null));};exports[_0xd1c3('0x41')]=function(_0x3a261c,_0x426a31){return db[_0xd1c3('0x27')]['create'](_0x3a261c['body'],{})[_0xd1c3('0x1e')](respondWithResult(_0x426a31,0xc9))[_0xd1c3('0x3e')](handleError(_0x426a31,null));};exports[_0xd1c3('0x42')]=function(_0x5df790,_0xc860d5){if(_0x5df790['body']['id']){delete _0x5df790[_0xd1c3('0x43')]['id'];}return db[_0xd1c3('0x27')][_0xd1c3('0x44')]({'where':{'id':_0x5df790[_0xd1c3('0x45')]['id']}})['then'](handleEntityNotFound(_0xc860d5,null))['then'](saveUpdates(_0x5df790[_0xd1c3('0x43')],null))[_0xd1c3('0x1e')](respondWithResult(_0xc860d5,null))[_0xd1c3('0x3e')](handleError(_0xc860d5,null));};exports[_0xd1c3('0x1f')]=function(_0xbaf0b7,_0xae72ab){return db[_0xd1c3('0x27')][_0xd1c3('0x44')]({'where':{'id':_0xbaf0b7['params']['id']}})[_0xd1c3('0x1e')](handleEntityNotFound(_0xae72ab,null))[_0xd1c3('0x1e')](removeEntity(_0xae72ab,null))[_0xd1c3('0x3e')](handleError(_0xae72ab,null));};exports[_0xd1c3('0x46')]=function(_0x2eb58e,_0x5d3db4){return db['JscriptyQuestionReport'][_0xd1c3('0x46')]()['then'](respondWithResult(_0x5d3db4,null))[_0xd1c3('0x3e')](handleError(_0x5d3db4,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 7bec57a..9eef384 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 _0xec7d=['lodash','util','../../config/logger','moment','bluebird','request-promise','exports','define','JscriptyQuestionReport'];(function(_0x824626,_0x590cd4){var _0x7247cb=function(_0x18b0b9){while(--_0x18b0b9){_0x824626['push'](_0x824626['shift']());}};_0x7247cb(++_0x590cd4);}(_0xec7d,0x1b9));var _0xdec7=function(_0x1f49d5,_0x178592){_0x1f49d5=_0x1f49d5-0x0;var _0x2fbcda=_0xec7d[_0x1f49d5];return _0x2fbcda;};'use strict';var _=require(_0xdec7('0x0'));var util=require(_0xdec7('0x1'));var logger=require(_0xdec7('0x2'))('api');var moment=require(_0xdec7('0x3'));var BPromise=require(_0xdec7('0x4'));var rp=require(_0xdec7('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xdec7('0x6')]=function(_0x2247c9,_0x120f1b){return _0x2247c9[_0xdec7('0x7')](_0xdec7('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55d6=['./jscriptyQuestionReport.attributes','report_jscripty_questions','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2d138a,_0x38524c){var _0x1c13e9=function(_0x342d00){while(--_0x342d00){_0x2d138a['push'](_0x2d138a['shift']());}};_0x1c13e9(++_0x38524c);}(_0x55d6,0x112));var _0x655d=function(_0x5899fa,_0x8b9e30){_0x5899fa=_0x5899fa-0x0;var _0x5388e8=_0x55d6[_0x5899fa];return _0x5388e8;};'use strict';var _=require(_0x655d('0x0'));var util=require(_0x655d('0x1'));var logger=require('../../config/logger')(_0x655d('0x2'));var moment=require(_0x655d('0x3'));var BPromise=require(_0x655d('0x4'));var rp=require(_0x655d('0x5'));var attributes=require(_0x655d('0x6'));module['exports']=function(_0x291ea2,_0x31e95a){return _0x291ea2['define']('JscriptyQuestionReport',attributes,{'tableName':_0x655d('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 3ca68f9..aaa625d 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 _0x4f67=['request\x20sent','stringify','error','code','message','JscriptyQuestionReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug'];(function(_0x2ba4e6,_0x101413){var _0x5cc4ac=function(_0x7a8b5b){while(--_0x7a8b5b){_0x2ba4e6['push'](_0x2ba4e6['shift']());}};_0x5cc4ac(++_0x101413);}(_0x4f67,0x178));var _0x74f6=function(_0x3a1cca,_0xf9cf7e){_0x3a1cca=_0x3a1cca-0x0;var _0x53b71c=_0x4f67[_0x3a1cca];return _0x53b71c;};'use strict';var _=require(_0x74f6('0x0'));var util=require(_0x74f6('0x1'));var moment=require(_0x74f6('0x2'));var BPromise=require(_0x74f6('0x3'));var rs=require(_0x74f6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74f6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x74f6('0x6'))(_0x74f6('0x7'));var config=require(_0x74f6('0x8'));var jayson=require(_0x74f6('0x9'));var client=jayson[_0x74f6('0xa')][_0x74f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x87f34d,_0x430317,_0x1e5d11){return new BPromise(function(_0x3e8785,_0xea3482){return client['request'](_0x87f34d,_0x1e5d11)[_0x74f6('0xc')](function(_0x1abd4c){logger[_0x74f6('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x430317,'request\x20sent');logger[_0x74f6('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x430317,_0x74f6('0xf'),JSON[_0x74f6('0x10')](_0x1abd4c));if(_0x1abd4c['error']){if(_0x1abd4c[_0x74f6('0x11')][_0x74f6('0x12')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x430317,_0x1abd4c[_0x74f6('0x11')][_0x74f6('0x13')]);return _0xea3482(_0x1abd4c[_0x74f6('0x11')][_0x74f6('0x13')]);}logger['error'](_0x74f6('0x14'),_0x430317,_0x1abd4c[_0x74f6('0x11')][_0x74f6('0x13')]);return _0x3e8785(_0x1abd4c[_0x74f6('0x11')]['message']);}else{logger[_0x74f6('0xd')](_0x74f6('0x14'),_0x430317,'request\x20sent');_0x3e8785(_0x1abd4c[_0x74f6('0x15')][_0x74f6('0x13')]);}})[_0x74f6('0x16')](function(_0x95b5c4){logger[_0x74f6('0x11')](_0x74f6('0x14'),_0x430317,_0x95b5c4);_0xea3482(_0x95b5c4);});});} \ No newline at end of file +var _0x0e55=['error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify'];(function(_0x3b2ebd,_0x5da4e9){var _0x4389ec=function(_0x14ef3d){while(--_0x14ef3d){_0x3b2ebd['push'](_0x3b2ebd['shift']());}};_0x4389ec(++_0x5da4e9);}(_0x0e55,0x1d1));var _0x50e5=function(_0x6f3820,_0x22c69b){_0x6f3820=_0x6f3820-0x0;var _0x4bc1f9=_0x0e55[_0x6f3820];return _0x4bc1f9;};'use strict';var _=require(_0x50e5('0x0'));var util=require(_0x50e5('0x1'));var moment=require(_0x50e5('0x2'));var BPromise=require(_0x50e5('0x3'));var rs=require(_0x50e5('0x4'));var fs=require('fs');var Redis=require(_0x50e5('0x5'));var db=require(_0x50e5('0x6'))['db'];var utils=require(_0x50e5('0x7'));var logger=require(_0x50e5('0x8'))(_0x50e5('0x9'));var config=require(_0x50e5('0xa'));var jayson=require(_0x50e5('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e0b2b,_0x5af3e3,_0x39f203){return new BPromise(function(_0x23101d,_0x414237){return client[_0x50e5('0xc')](_0x2e0b2b,_0x39f203)[_0x50e5('0xd')](function(_0x52d62e){logger[_0x50e5('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5af3e3,_0x50e5('0xf'));logger[_0x50e5('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x5af3e3,_0x50e5('0xf'),JSON[_0x50e5('0x11')](_0x52d62e));if(_0x52d62e[_0x50e5('0x12')]){if(_0x52d62e[_0x50e5('0x12')][_0x50e5('0x13')]===0x1f4){logger['error'](_0x50e5('0x14'),_0x5af3e3,_0x52d62e['error'][_0x50e5('0x15')]);return _0x414237(_0x52d62e[_0x50e5('0x12')][_0x50e5('0x15')]);}logger[_0x50e5('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5af3e3,_0x52d62e['error'][_0x50e5('0x15')]);return _0x23101d(_0x52d62e[_0x50e5('0x12')][_0x50e5('0x15')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x5af3e3,_0x50e5('0xf'));_0x23101d(_0x52d62e[_0x50e5('0x16')]['message']);}})['catch'](function(_0x4f24e8){logger[_0x50e5('0x12')](_0x50e5('0x14'),_0x5af3e3,_0x4f24e8);_0x414237(_0x4f24e8);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index dffeb33..7372f7e 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 _0x3faa=['describe','/:id','show','getQuestions','isAuthenticated','create','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe'];(function(_0x5bcb68,_0x2d692f){var _0x15cc98=function(_0x1d65e0){while(--_0x1d65e0){_0x5bcb68['push'](_0x5bcb68['shift']());}};_0x15cc98(++_0x2d692f);}(_0x3faa,0x129));var _0xa3fa=function(_0xfbc931,_0x2fb6bc){_0xfbc931=_0xfbc931-0x0;var _0x4e11f8=_0x3faa[_0xfbc931];return _0x4e11f8;};'use strict';var multer=require(_0xa3fa('0x0'));var util=require(_0xa3fa('0x1'));var path=require(_0xa3fa('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa3fa('0x3')]();var auth=require(_0xa3fa('0x4'));var interaction=require(_0xa3fa('0x5'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0xa3fa('0x6')]('/',auth['isAuthenticated'](),controller[_0xa3fa('0x7')]);router['get'](_0xa3fa('0x8'),auth['isAuthenticated'](),controller[_0xa3fa('0x9')]);router['get'](_0xa3fa('0xa'),auth['isAuthenticated'](),controller[_0xa3fa('0xb')]);router[_0xa3fa('0x6')]('/:id/questions',auth['isAuthenticated'](),controller[_0xa3fa('0xc')]);router['post']('/',auth[_0xa3fa('0xd')](),controller[_0xa3fa('0xe')]);router['put']('/:id',auth[_0xa3fa('0xd')](),controller[_0xa3fa('0xf')]);router['delete'](_0xa3fa('0xa'),auth[_0xa3fa('0xd')](),controller[_0xa3fa('0x10')]);module[_0xa3fa('0x11')]=router; \ No newline at end of file +var _0xf84b=['index','/describe','describe','/:id','show','getQuestions','post','create','put','update','delete','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated'];(function(_0x356460,_0xb1cd1b){var _0x338efe=function(_0x5b313c){while(--_0x5b313c){_0x356460['push'](_0x356460['shift']());}};_0x338efe(++_0xb1cd1b);}(_0xf84b,0x1ee));var _0xbf84=function(_0x20f1ff,_0x1cbbdd){_0x20f1ff=_0x20f1ff-0x0;var _0x58222e=_0xf84b[_0x20f1ff];return _0x58222e;};'use strict';var multer=require('multer');var util=require(_0xbf84('0x0'));var path=require('path');var timeout=require(_0xbf84('0x1'));var express=require(_0xbf84('0x2'));var router=express[_0xbf84('0x3')]();var auth=require(_0xbf84('0x4'));var interaction=require(_0xbf84('0x5'));var config=require(_0xbf84('0x6'));var controller=require(_0xbf84('0x7'));router[_0xbf84('0x8')]('/',auth[_0xbf84('0x9')](),controller[_0xbf84('0xa')]);router['get'](_0xbf84('0xb'),auth[_0xbf84('0x9')](),controller[_0xbf84('0xc')]);router[_0xbf84('0x8')](_0xbf84('0xd'),auth[_0xbf84('0x9')](),controller[_0xbf84('0xe')]);router[_0xbf84('0x8')]('/:id/questions',auth[_0xbf84('0x9')](),controller[_0xbf84('0xf')]);router[_0xbf84('0x10')]('/',auth[_0xbf84('0x9')](),controller[_0xbf84('0x11')]);router[_0xbf84('0x12')](_0xbf84('0xd'),auth['isAuthenticated'](),controller[_0xbf84('0x13')]);router[_0xbf84('0x14')](_0xbf84('0xd'),auth[_0xbf84('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 300d7ec..a9bb9c3 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 _0x0e30=['BOOLEAN','exports','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING'];(function(_0x43b8b3,_0x545f16){var _0x49c41e=function(_0x4f6976){while(--_0x4f6976){_0x43b8b3['push'](_0x43b8b3['shift']());}};_0x49c41e(++_0x545f16);}(_0x0e30,0x1d5));var _0x00e3=function(_0x303821,_0x5f3f67){_0x303821=_0x303821-0x0;var _0x33c46f=_0x0e30[_0x303821];return _0x33c46f;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x00e3('0x0')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x321d6f){this[_0x00e3('0x1')](_0x00e3('0x2'),_0x321d6f);this[_0x00e3('0x1')](_0x00e3('0x3'),moment()[_0x00e3('0x4')](_0x00e3('0x5')));}},'endtime':{'type':Sequelize[_0x00e3('0x6')]},'membername':{'type':Sequelize[_0x00e3('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x00e3('0x7')]},'uniqueid':{'type':Sequelize[_0x00e3('0x7')]},'calleridname':{'type':Sequelize[_0x00e3('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xff4f=['moment','sequelize','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x4bf398,_0xc4c7d0){var _0x13f9b3=function(_0x414fbf){while(--_0x414fbf){_0x4bf398['push'](_0x4bf398['shift']());}};_0x13f9b3(++_0xc4c7d0);}(_0xff4f,0x19a));var _0xfff4=function(_0x5bed8f,_0x4a5e51){_0x5bed8f=_0x5bed8f-0x0;var _0x34d119=_0xff4f[_0x5bed8f];return _0x34d119;};'use strict';var moment=require(_0xfff4('0x0'));var Sequelize=require(_0xfff4('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xfff4('0x2')],'set':function(_0xbd700c){this[_0xfff4('0x3')](_0xfff4('0x4'),_0xbd700c);this[_0xfff4('0x3')](_0xfff4('0x5'),moment()[_0xfff4('0x6')](_0xfff4('0x7')));}},'endtime':{'type':Sequelize[_0xfff4('0x2')]},'membername':{'type':Sequelize[_0xfff4('0x8')]},'projectname':{'type':Sequelize[_0xfff4('0x8')]},'queue':{'type':Sequelize[_0xfff4('0x8')]},'uniqueid':{'type':Sequelize[_0xfff4('0x8')]},'calleridname':{'type':Sequelize[_0xfff4('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xfff4('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index b3e4ffc..08c235c 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 _0xe343=['../../config/environment','../../mysqldb','status','end','count','set','Content-Range','json','reject','save','update','then','sendStatus','error','stack','name','send','index','JscriptySessionReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','offset','order','where','pick','filter','key','field','merge','options','include','findAll','rows','catch','show','params','length','find','create','body','destroy','getQuestions','hasOwnProperty','sort','SessionId','map','JscriptyQuestionReport','includeAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x1ea917,_0x11aed7){var _0x3077d9=function(_0x6b8c1e){while(--_0x6b8c1e){_0x1ea917['push'](_0x1ea917['shift']());}};_0x3077d9(++_0x11aed7);}(_0xe343,0xd2));var _0x3e34=function(_0x7c0074,_0x1ffdcf){_0x7c0074=_0x7c0074-0x0;var _0x13e95b=_0xe343[_0x7c0074];return _0x13e95b;};'use strict';var pdf=require(_0x3e34('0x0'));var emlformat=require(_0x3e34('0x1'));var rimraf=require(_0x3e34('0x2'));var zipdir=require(_0x3e34('0x3'));var jsonpatch=require(_0x3e34('0x4'));var rp=require(_0x3e34('0x5'));var moment=require(_0x3e34('0x6'));var BPromise=require(_0x3e34('0x7'));var Mustache=require('mustache');var util=require(_0x3e34('0x8'));var path=require(_0x3e34('0x9'));var sox=require('sox');var csv=require(_0x3e34('0xa'));var ejs=require(_0x3e34('0xb'));var fs=require('fs');var _=require(_0x3e34('0xc'));var squel=require('squel');var crypto=require(_0x3e34('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3e34('0xa'));var querystring=require(_0x3e34('0xe'));var Papa=require('papaparse');var authService=require(_0x3e34('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x3e34('0x10'));var qs=require(_0x3e34('0x11'));var logger=require(_0x3e34('0x12'))(_0x3e34('0x13'));var utils=require(_0x3e34('0x14'));var config=require(_0x3e34('0x15'));var db=require(_0x3e34('0x16'))['db'];function respondWithStatusCode(_0xfa1c30,_0x4e19da){_0x4e19da=_0x4e19da||0xcc;return function(_0x2754df){if(_0x2754df){return _0xfa1c30['sendStatus'](_0x4e19da);}return _0xfa1c30[_0x3e34('0x17')](_0x4e19da)[_0x3e34('0x18')]();};}function respondWithResult(_0x2a5100,_0x1bfe70){_0x1bfe70=_0x1bfe70||0xc8;return function(_0x33f933){if(_0x33f933){return _0x2a5100['status'](_0x1bfe70)['json'](_0x33f933);}};}function respondWithFilteredResult(_0x11cad7,_0x1e2202){return function(_0x1db12e){if(_0x1db12e){var _0x42e5e0=_0x1db12e[_0x3e34('0x19')],_0x26ce7d=_0x1e2202['offset'],_0x98e6a7=_0x1e2202['offset']+_0x1e2202['limit'],_0x587a5a;if(_0x98e6a7>=_0x42e5e0){_0x98e6a7=_0x42e5e0;_0x587a5a=0xc8;}else{_0x587a5a=0xce;}_0x11cad7[_0x3e34('0x17')](_0x587a5a);return _0x11cad7[_0x3e34('0x1a')](_0x3e34('0x1b'),_0x26ce7d+'-'+_0x98e6a7+'/'+_0x42e5e0)[_0x3e34('0x1c')](_0x1db12e);}return null;};}function patchUpdates(_0x1ca731){return function(_0xc17fcd){try{jsonpatch['apply'](_0xc17fcd,_0x1ca731,!![]);}catch(_0x331924){return BPromise[_0x3e34('0x1d')](_0x331924);}return _0xc17fcd[_0x3e34('0x1e')]();};}function saveUpdates(_0x382f36,_0x12990d){return function(_0x5a3fa5){if(_0x5a3fa5){return _0x5a3fa5[_0x3e34('0x1f')](_0x382f36)['then'](function(_0xa7cdb0){return _0xa7cdb0;});}return null;};}function removeEntity(_0x54a071,_0x15f0d5){return function(_0x381093){if(_0x381093){return _0x381093['destroy']()[_0x3e34('0x20')](function(){_0x54a071[_0x3e34('0x17')](0xcc)[_0x3e34('0x18')]();});}};}function handleEntityNotFound(_0x1cb6b8,_0x3ad239){return function(_0x46a032){if(!_0x46a032){_0x1cb6b8[_0x3e34('0x21')](0x194);}return _0x46a032;};}function handleError(_0x3cd4e9,_0x1aa036){_0x1aa036=_0x1aa036||0x1f4;return function(_0x30e20a){logger[_0x3e34('0x22')](_0x30e20a[_0x3e34('0x23')]);if(_0x30e20a[_0x3e34('0x24')]){delete _0x30e20a[_0x3e34('0x24')];}_0x3cd4e9[_0x3e34('0x17')](_0x1aa036)[_0x3e34('0x25')](_0x30e20a);};}exports[_0x3e34('0x26')]=function(_0x4c9d53,_0x4a9e43){var _0x17669a={},_0x51d89f={},_0x4ed84c={'count':0x0,'rows':[]};var _0x344676=db[_0x3e34('0x27')][_0x3e34('0x28')];_0x51d89f[_0x3e34('0x29')]=_[_0x3e34('0x2a')](_0x344676);_0x51d89f[_0x3e34('0x2b')]=_[_0x3e34('0x2a')](_0x4c9d53['query']);_0x51d89f[_0x3e34('0x2c')]=_[_0x3e34('0x2d')](_0x51d89f[_0x3e34('0x29')],_0x51d89f[_0x3e34('0x2b')]);_0x17669a[_0x3e34('0x2e')]=_['intersection'](_0x51d89f[_0x3e34('0x29')],qs[_0x3e34('0x2f')](_0x4c9d53[_0x3e34('0x2b')]['fields']));_0x17669a[_0x3e34('0x2e')]=_0x17669a['attributes']['length']?_0x17669a['attributes']:_0x51d89f[_0x3e34('0x29')];if(!_0x4c9d53[_0x3e34('0x2b')]['hasOwnProperty'](_0x3e34('0x30'))){_0x17669a[_0x3e34('0x31')]=qs[_0x3e34('0x31')](_0x4c9d53[_0x3e34('0x2b')]['limit']);_0x17669a[_0x3e34('0x32')]=qs[_0x3e34('0x32')](_0x4c9d53[_0x3e34('0x2b')]['offset']);}_0x17669a[_0x3e34('0x33')]=qs['sort'](_0x4c9d53[_0x3e34('0x2b')]['sort']);_0x17669a[_0x3e34('0x34')]=qs['filters'](_[_0x3e34('0x35')](_0x4c9d53[_0x3e34('0x2b')],_0x51d89f[_0x3e34('0x2c')]));if(_0x4c9d53[_0x3e34('0x2b')][_0x3e34('0x36')]){_0x17669a[_0x3e34('0x34')]=_['merge'](_0x17669a[_0x3e34('0x34')],{'$or':_['map'](_0x344676,function(_0x43f548){if(_0x43f548['type'][_0x3e34('0x37')]!=='VIRTUAL'){var _0x1e984d={};_0x1e984d[_0x43f548[_0x3e34('0x38')]]={'$like':'%'+_0x4c9d53[_0x3e34('0x2b')][_0x3e34('0x36')]+'%'};return _0x1e984d;}})});}_0x17669a=_[_0x3e34('0x39')]({},_0x17669a,_0x4c9d53[_0x3e34('0x3a')]);var _0x1b18ab={'where':_0x17669a[_0x3e34('0x34')]};return db[_0x3e34('0x27')][_0x3e34('0x19')](_0x1b18ab)[_0x3e34('0x20')](function(_0x1f1fdc){_0x4ed84c['count']=_0x1f1fdc;if(_0x4c9d53[_0x3e34('0x2b')]['includeAll']){_0x17669a[_0x3e34('0x3b')]=[{'all':!![]}];}return db[_0x3e34('0x27')][_0x3e34('0x3c')](_0x17669a);})[_0x3e34('0x20')](function(_0x172b7d){_0x4ed84c[_0x3e34('0x3d')]=_0x172b7d;return _0x4ed84c;})['then'](respondWithFilteredResult(_0x4a9e43,_0x17669a))[_0x3e34('0x3e')](handleError(_0x4a9e43,null));};exports[_0x3e34('0x3f')]=function(_0x869336,_0x70cfc){var _0x1dba4b={'raw':!![],'where':{'id':_0x869336[_0x3e34('0x40')]['id']}},_0x349b91={};_0x349b91[_0x3e34('0x29')]=_[_0x3e34('0x2a')](db[_0x3e34('0x27')][_0x3e34('0x28')]);_0x349b91[_0x3e34('0x2b')]=_['keys'](_0x869336[_0x3e34('0x2b')]);_0x349b91[_0x3e34('0x2c')]=_[_0x3e34('0x2d')](_0x349b91[_0x3e34('0x29')],_0x349b91[_0x3e34('0x2b')]);_0x1dba4b[_0x3e34('0x2e')]=_[_0x3e34('0x2d')](_0x349b91[_0x3e34('0x29')],qs[_0x3e34('0x2f')](_0x869336['query'][_0x3e34('0x2f')]));_0x1dba4b['attributes']=_0x1dba4b[_0x3e34('0x2e')][_0x3e34('0x41')]?_0x1dba4b[_0x3e34('0x2e')]:_0x349b91[_0x3e34('0x29')];if(_0x869336[_0x3e34('0x2b')]['includeAll']){_0x1dba4b[_0x3e34('0x3b')]=[{'all':!![]}];}_0x1dba4b=_[_0x3e34('0x39')]({},_0x1dba4b,_0x869336[_0x3e34('0x3a')]);return db[_0x3e34('0x27')][_0x3e34('0x42')](_0x1dba4b)[_0x3e34('0x20')](handleEntityNotFound(_0x70cfc,null))[_0x3e34('0x20')](respondWithResult(_0x70cfc,null))[_0x3e34('0x3e')](handleError(_0x70cfc,null));};exports[_0x3e34('0x43')]=function(_0x4b63b3,_0xea3ac2){return db[_0x3e34('0x27')][_0x3e34('0x43')](_0x4b63b3[_0x3e34('0x44')],{})[_0x3e34('0x20')](respondWithResult(_0xea3ac2,0xc9))['catch'](handleError(_0xea3ac2,null));};exports[_0x3e34('0x1f')]=function(_0x31317e,_0x512a44){if(_0x31317e[_0x3e34('0x44')]['id']){delete _0x31317e[_0x3e34('0x44')]['id'];}return db[_0x3e34('0x27')][_0x3e34('0x42')]({'where':{'id':_0x31317e[_0x3e34('0x40')]['id']}})[_0x3e34('0x20')](handleEntityNotFound(_0x512a44,null))['then'](saveUpdates(_0x31317e[_0x3e34('0x44')],null))[_0x3e34('0x20')](respondWithResult(_0x512a44,null))[_0x3e34('0x3e')](handleError(_0x512a44,null));};exports[_0x3e34('0x45')]=function(_0x8569dd,_0x84328){return db[_0x3e34('0x27')][_0x3e34('0x42')]({'where':{'id':_0x8569dd[_0x3e34('0x40')]['id']}})[_0x3e34('0x20')](handleEntityNotFound(_0x84328,null))[_0x3e34('0x20')](removeEntity(_0x84328,null))[_0x3e34('0x3e')](handleError(_0x84328,null));};exports['describe']=function(_0x9a34cf,_0x42a5c5){return db['JscriptySessionReport']['describe']()[_0x3e34('0x20')](respondWithResult(_0x42a5c5,null))[_0x3e34('0x3e')](handleError(_0x42a5c5,null));};exports[_0x3e34('0x46')]=function(_0x47fbea,_0x2a87eb,_0x4f6b48){var _0x47ec5f={'raw':!![],'where':{}};var _0x385162={};var _0x2ed998={'count':0x0,'rows':[]};return db[_0x3e34('0x27')]['findOne']({'where':{'id':_0x47fbea[_0x3e34('0x40')]['id']}})[_0x3e34('0x20')](handleEntityNotFound(_0x2a87eb,null))[_0x3e34('0x20')](function(_0x4c0204){if(_0x4c0204){_0x385162[_0x3e34('0x29')]=_[_0x3e34('0x2a')](db['JscriptyQuestionReport'][_0x3e34('0x28')]);_0x385162[_0x3e34('0x2b')]=_[_0x3e34('0x2a')](_0x47fbea[_0x3e34('0x2b')]);_0x385162[_0x3e34('0x2c')]=_[_0x3e34('0x2d')](_0x385162['model'],_0x385162[_0x3e34('0x2b')]);_0x47ec5f['attributes']=_[_0x3e34('0x2d')](_0x385162[_0x3e34('0x29')],qs[_0x3e34('0x2f')](_0x47fbea[_0x3e34('0x2b')][_0x3e34('0x2f')]));_0x47ec5f[_0x3e34('0x2e')]=_0x47ec5f['attributes']['length']?_0x47ec5f[_0x3e34('0x2e')]:_0x385162['model'];if(!_0x47fbea[_0x3e34('0x2b')][_0x3e34('0x47')](_0x3e34('0x30'))){_0x47ec5f[_0x3e34('0x31')]=qs[_0x3e34('0x31')](_0x47fbea[_0x3e34('0x2b')][_0x3e34('0x31')]);_0x47ec5f['offset']=qs['offset'](_0x47fbea['query'][_0x3e34('0x32')]);}_0x47ec5f[_0x3e34('0x33')]=qs[_0x3e34('0x48')](_0x47fbea[_0x3e34('0x2b')][_0x3e34('0x48')]);_0x47ec5f[_0x3e34('0x34')]=qs[_0x3e34('0x2c')](_['pick'](_0x47fbea['query'],_0x385162['filters']));_0x47ec5f[_0x3e34('0x34')][_0x3e34('0x49')]=_0x4c0204['id'];if(_0x47fbea[_0x3e34('0x2b')][_0x3e34('0x36')]){_0x47ec5f[_0x3e34('0x34')]=_['merge'](_0x47ec5f['where'],{'$or':_[_0x3e34('0x4a')](_0x47ec5f[_0x3e34('0x2e')],function(_0x5b098f){var _0x5ecbca={};_0x5ecbca[_0x5b098f]={'$like':'%'+_0x47fbea[_0x3e34('0x2b')][_0x3e34('0x36')]+'%'};return _0x5ecbca;})});}_0x47ec5f=_[_0x3e34('0x39')]({},_0x47ec5f,_0x47fbea['options']);return db[_0x3e34('0x4b')]['count']({'where':_0x47ec5f['where']})[_0x3e34('0x20')](function(_0xa19e01){_0x2ed998[_0x3e34('0x19')]=_0xa19e01;if(_0x47fbea[_0x3e34('0x2b')][_0x3e34('0x4c')]){_0x47ec5f['include']=[{'all':!![]}];}return db[_0x3e34('0x4b')][_0x3e34('0x3c')](_0x47ec5f);})['then'](function(_0x16eb36){_0x2ed998[_0x3e34('0x3d')]=_0x16eb36;return _0x2ed998;});}})[_0x3e34('0x20')](respondWithFilteredResult(_0x2a87eb,_0x47ec5f))[_0x3e34('0x3e')](handleError(_0x2a87eb,null));}; \ No newline at end of file +var _0xfedb=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','destroy','describe','findOne','params','JscriptyQuestionReport','SessionId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','desk.js','to-csv','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','JscriptySessionReport','rawAttributes','model','keys','query'];(function(_0x1be845,_0x394031){var _0x38f6b0=function(_0x70d9b6){while(--_0x70d9b6){_0x1be845['push'](_0x1be845['shift']());}};_0x38f6b0(++_0x394031);}(_0xfedb,0x14c));var _0xbfed=function(_0x18dce6,_0x2b825e){_0x18dce6=_0x18dce6-0x0;var _0x137eb9=_0xfedb[_0x18dce6];return _0x137eb9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbfed('0x0'));var zipdir=require(_0xbfed('0x1'));var jsonpatch=require(_0xbfed('0x2'));var rp=require(_0xbfed('0x3'));var moment=require(_0xbfed('0x4'));var BPromise=require(_0xbfed('0x5'));var Mustache=require(_0xbfed('0x6'));var util=require(_0xbfed('0x7'));var path=require(_0xbfed('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbfed('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbfed('0xa'));var crypto=require(_0xbfed('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbfed('0xc'));var toCsv=require(_0xbfed('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xbfed('0xe'));var hardwareService=require(_0xbfed('0xf'));var Redis=require(_0xbfed('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xbfed('0x11'));var utils=require(_0xbfed('0x12'));var config=require('../../config/environment');var db=require(_0xbfed('0x13'))['db'];function respondWithStatusCode(_0x5c24dc,_0x16b5ca){_0x16b5ca=_0x16b5ca||0xcc;return function(_0x1bec8b){if(_0x1bec8b){return _0x5c24dc[_0xbfed('0x14')](_0x16b5ca);}return _0x5c24dc[_0xbfed('0x15')](_0x16b5ca)[_0xbfed('0x16')]();};}function respondWithResult(_0x1e8b25,_0x5bb650){_0x5bb650=_0x5bb650||0xc8;return function(_0x154996){if(_0x154996){return _0x1e8b25[_0xbfed('0x15')](_0x5bb650)[_0xbfed('0x17')](_0x154996);}};}function respondWithFilteredResult(_0x4c2e5d,_0x2d73b5){return function(_0x4a6957){if(_0x4a6957){var _0x2442d6=_0x4a6957[_0xbfed('0x18')],_0x379142=_0x2d73b5[_0xbfed('0x19')],_0xaf13b0=_0x2d73b5[_0xbfed('0x19')]+_0x2d73b5[_0xbfed('0x1a')],_0x2bd7f3;if(_0xaf13b0>=_0x2442d6){_0xaf13b0=_0x2442d6;_0x2bd7f3=0xc8;}else{_0x2bd7f3=0xce;}_0x4c2e5d[_0xbfed('0x15')](_0x2bd7f3);return _0x4c2e5d[_0xbfed('0x1b')](_0xbfed('0x1c'),_0x379142+'-'+_0xaf13b0+'/'+_0x2442d6)[_0xbfed('0x17')](_0x4a6957);}return null;};}function patchUpdates(_0x4ddb4a){return function(_0x4ba2bb){try{jsonpatch[_0xbfed('0x1d')](_0x4ba2bb,_0x4ddb4a,!![]);}catch(_0x3ce1f3){return BPromise[_0xbfed('0x1e')](_0x3ce1f3);}return _0x4ba2bb[_0xbfed('0x1f')]();};}function saveUpdates(_0x54676f,_0xdbf58e){return function(_0x68d5fd){if(_0x68d5fd){return _0x68d5fd[_0xbfed('0x20')](_0x54676f)[_0xbfed('0x21')](function(_0x42c2c2){return _0x42c2c2;});}return null;};}function removeEntity(_0x5c7485,_0x176664){return function(_0x43451e){if(_0x43451e){return _0x43451e['destroy']()[_0xbfed('0x21')](function(){_0x5c7485[_0xbfed('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x544cf8,_0x2eb32c){return function(_0x4f05d8){if(!_0x4f05d8){_0x544cf8[_0xbfed('0x14')](0x194);}return _0x4f05d8;};}function handleError(_0x181acc,_0x58fbd7){_0x58fbd7=_0x58fbd7||0x1f4;return function(_0xd430bf){logger[_0xbfed('0x22')](_0xd430bf[_0xbfed('0x23')]);if(_0xd430bf['name']){delete _0xd430bf[_0xbfed('0x24')];}_0x181acc['status'](_0x58fbd7)[_0xbfed('0x25')](_0xd430bf);};}exports['index']=function(_0x4c1b70,_0x4ac0f4){var _0x54369e={},_0x374d82={},_0x3f56b3={'count':0x0,'rows':[]};var _0x1f7de8=db[_0xbfed('0x26')][_0xbfed('0x27')];_0x374d82[_0xbfed('0x28')]=_[_0xbfed('0x29')](_0x1f7de8);_0x374d82[_0xbfed('0x2a')]=_['keys'](_0x4c1b70['query']);_0x374d82[_0xbfed('0x2b')]=_[_0xbfed('0x2c')](_0x374d82[_0xbfed('0x28')],_0x374d82[_0xbfed('0x2a')]);_0x54369e[_0xbfed('0x2d')]=_[_0xbfed('0x2c')](_0x374d82[_0xbfed('0x28')],qs[_0xbfed('0x2e')](_0x4c1b70['query'][_0xbfed('0x2e')]));_0x54369e[_0xbfed('0x2d')]=_0x54369e[_0xbfed('0x2d')]['length']?_0x54369e['attributes']:_0x374d82[_0xbfed('0x28')];if(!_0x4c1b70[_0xbfed('0x2a')][_0xbfed('0x2f')](_0xbfed('0x30'))){_0x54369e[_0xbfed('0x1a')]=qs[_0xbfed('0x1a')](_0x4c1b70[_0xbfed('0x2a')][_0xbfed('0x1a')]);_0x54369e[_0xbfed('0x19')]=qs[_0xbfed('0x19')](_0x4c1b70['query'][_0xbfed('0x19')]);}_0x54369e[_0xbfed('0x31')]=qs[_0xbfed('0x32')](_0x4c1b70[_0xbfed('0x2a')][_0xbfed('0x32')]);_0x54369e[_0xbfed('0x33')]=qs[_0xbfed('0x2b')](_[_0xbfed('0x34')](_0x4c1b70[_0xbfed('0x2a')],_0x374d82[_0xbfed('0x2b')]));if(_0x4c1b70[_0xbfed('0x2a')][_0xbfed('0x35')]){_0x54369e[_0xbfed('0x33')]=_[_0xbfed('0x36')](_0x54369e[_0xbfed('0x33')],{'$or':_[_0xbfed('0x37')](_0x1f7de8,function(_0x4d9866){if(_0x4d9866[_0xbfed('0x38')][_0xbfed('0x39')]!==_0xbfed('0x3a')){var _0x174306={};_0x174306[_0x4d9866['field']]={'$like':'%'+_0x4c1b70[_0xbfed('0x2a')][_0xbfed('0x35')]+'%'};return _0x174306;}})});}_0x54369e=_['merge']({},_0x54369e,_0x4c1b70[_0xbfed('0x3b')]);var _0x413766={'where':_0x54369e[_0xbfed('0x33')]};return db[_0xbfed('0x26')][_0xbfed('0x18')](_0x413766)[_0xbfed('0x21')](function(_0x523507){_0x3f56b3[_0xbfed('0x18')]=_0x523507;if(_0x4c1b70[_0xbfed('0x2a')][_0xbfed('0x3c')]){_0x54369e[_0xbfed('0x3d')]=[{'all':!![]}];}return db[_0xbfed('0x26')][_0xbfed('0x3e')](_0x54369e);})[_0xbfed('0x21')](function(_0x44354b){_0x3f56b3[_0xbfed('0x3f')]=_0x44354b;return _0x3f56b3;})[_0xbfed('0x21')](respondWithFilteredResult(_0x4ac0f4,_0x54369e))[_0xbfed('0x40')](handleError(_0x4ac0f4,null));};exports[_0xbfed('0x41')]=function(_0x5d5946,_0x53d3ba){var _0x518b99={'raw':!![],'where':{'id':_0x5d5946['params']['id']}},_0x2fa53f={};_0x2fa53f['model']=_[_0xbfed('0x29')](db[_0xbfed('0x26')][_0xbfed('0x27')]);_0x2fa53f[_0xbfed('0x2a')]=_[_0xbfed('0x29')](_0x5d5946['query']);_0x2fa53f[_0xbfed('0x2b')]=_['intersection'](_0x2fa53f[_0xbfed('0x28')],_0x2fa53f['query']);_0x518b99[_0xbfed('0x2d')]=_[_0xbfed('0x2c')](_0x2fa53f[_0xbfed('0x28')],qs[_0xbfed('0x2e')](_0x5d5946[_0xbfed('0x2a')][_0xbfed('0x2e')]));_0x518b99[_0xbfed('0x2d')]=_0x518b99[_0xbfed('0x2d')]['length']?_0x518b99['attributes']:_0x2fa53f['model'];if(_0x5d5946[_0xbfed('0x2a')]['includeAll']){_0x518b99[_0xbfed('0x3d')]=[{'all':!![]}];}_0x518b99=_[_0xbfed('0x36')]({},_0x518b99,_0x5d5946['options']);return db['JscriptySessionReport'][_0xbfed('0x42')](_0x518b99)[_0xbfed('0x21')](handleEntityNotFound(_0x53d3ba,null))[_0xbfed('0x21')](respondWithResult(_0x53d3ba,null))['catch'](handleError(_0x53d3ba,null));};exports['create']=function(_0x2a973c,_0x2bd3c9){return db[_0xbfed('0x26')][_0xbfed('0x43')](_0x2a973c['body'],{})['then'](respondWithResult(_0x2bd3c9,0xc9))['catch'](handleError(_0x2bd3c9,null));};exports[_0xbfed('0x20')]=function(_0x29843e,_0x1ccd45){if(_0x29843e[_0xbfed('0x44')]['id']){delete _0x29843e[_0xbfed('0x44')]['id'];}return db[_0xbfed('0x26')][_0xbfed('0x42')]({'where':{'id':_0x29843e['params']['id']}})[_0xbfed('0x21')](handleEntityNotFound(_0x1ccd45,null))[_0xbfed('0x21')](saveUpdates(_0x29843e[_0xbfed('0x44')],null))[_0xbfed('0x21')](respondWithResult(_0x1ccd45,null))[_0xbfed('0x40')](handleError(_0x1ccd45,null));};exports[_0xbfed('0x45')]=function(_0xfed367,_0xd3b2ca){return db['JscriptySessionReport'][_0xbfed('0x42')]({'where':{'id':_0xfed367['params']['id']}})['then'](handleEntityNotFound(_0xd3b2ca,null))[_0xbfed('0x21')](removeEntity(_0xd3b2ca,null))[_0xbfed('0x40')](handleError(_0xd3b2ca,null));};exports['describe']=function(_0x818dcd,_0x269e08){return db[_0xbfed('0x26')][_0xbfed('0x46')]()['then'](respondWithResult(_0x269e08,null))[_0xbfed('0x40')](handleError(_0x269e08,null));};exports['getQuestions']=function(_0x456a3c,_0x1c4169,_0x32b8f6){var _0x23dea8={'raw':!![],'where':{}};var _0x309de0={};var _0x272a9f={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xbfed('0x47')]({'where':{'id':_0x456a3c[_0xbfed('0x48')]['id']}})[_0xbfed('0x21')](handleEntityNotFound(_0x1c4169,null))[_0xbfed('0x21')](function(_0xee2a3e){if(_0xee2a3e){_0x309de0[_0xbfed('0x28')]=_[_0xbfed('0x29')](db[_0xbfed('0x49')]['rawAttributes']);_0x309de0[_0xbfed('0x2a')]=_[_0xbfed('0x29')](_0x456a3c[_0xbfed('0x2a')]);_0x309de0[_0xbfed('0x2b')]=_['intersection'](_0x309de0['model'],_0x309de0[_0xbfed('0x2a')]);_0x23dea8[_0xbfed('0x2d')]=_['intersection'](_0x309de0['model'],qs[_0xbfed('0x2e')](_0x456a3c[_0xbfed('0x2a')][_0xbfed('0x2e')]));_0x23dea8['attributes']=_0x23dea8[_0xbfed('0x2d')]['length']?_0x23dea8[_0xbfed('0x2d')]:_0x309de0[_0xbfed('0x28')];if(!_0x456a3c[_0xbfed('0x2a')][_0xbfed('0x2f')](_0xbfed('0x30'))){_0x23dea8[_0xbfed('0x1a')]=qs[_0xbfed('0x1a')](_0x456a3c[_0xbfed('0x2a')]['limit']);_0x23dea8['offset']=qs[_0xbfed('0x19')](_0x456a3c[_0xbfed('0x2a')][_0xbfed('0x19')]);}_0x23dea8[_0xbfed('0x31')]=qs['sort'](_0x456a3c[_0xbfed('0x2a')]['sort']);_0x23dea8[_0xbfed('0x33')]=qs[_0xbfed('0x2b')](_['pick'](_0x456a3c[_0xbfed('0x2a')],_0x309de0[_0xbfed('0x2b')]));_0x23dea8[_0xbfed('0x33')][_0xbfed('0x4a')]=_0xee2a3e['id'];if(_0x456a3c['query'][_0xbfed('0x35')]){_0x23dea8['where']=_[_0xbfed('0x36')](_0x23dea8[_0xbfed('0x33')],{'$or':_[_0xbfed('0x37')](_0x23dea8[_0xbfed('0x2d')],function(_0x4e3a3d){var _0x35a063={};_0x35a063[_0x4e3a3d]={'$like':'%'+_0x456a3c[_0xbfed('0x2a')]['filter']+'%'};return _0x35a063;})});}_0x23dea8=_[_0xbfed('0x36')]({},_0x23dea8,_0x456a3c[_0xbfed('0x3b')]);return db[_0xbfed('0x49')]['count']({'where':_0x23dea8['where']})[_0xbfed('0x21')](function(_0x2c7ebc){_0x272a9f['count']=_0x2c7ebc;if(_0x456a3c[_0xbfed('0x2a')][_0xbfed('0x3c')]){_0x23dea8[_0xbfed('0x3d')]=[{'all':!![]}];}return db[_0xbfed('0x49')][_0xbfed('0x3e')](_0x23dea8);})[_0xbfed('0x21')](function(_0x2655b7){_0x272a9f[_0xbfed('0x3f')]=_0x2655b7;return _0x272a9f;});}})[_0xbfed('0x21')](respondWithFilteredResult(_0x1c4169,_0x23dea8))['catch'](handleError(_0x1c4169,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 9057079..6300092 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 _0x3bfc=['bluebird','request-promise','./jscriptySessionReport.attributes','exports','define','lodash','api','moment'];(function(_0x15408c,_0x4b5b2d){var _0x1cbbba=function(_0x4e8b2c){while(--_0x4e8b2c){_0x15408c['push'](_0x15408c['shift']());}};_0x1cbbba(++_0x4b5b2d);}(_0x3bfc,0xe5));var _0xc3bf=function(_0x1cd577,_0x180f2a){_0x1cd577=_0x1cd577-0x0;var _0x790837=_0x3bfc[_0x1cd577];return _0x790837;};'use strict';var _=require(_0xc3bf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3bf('0x1'));var moment=require(_0xc3bf('0x2'));var BPromise=require(_0xc3bf('0x3'));var rp=require(_0xc3bf('0x4'));var attributes=require(_0xc3bf('0x5'));module[_0xc3bf('0x6')]=function(_0x533ec9,_0x3da90f){return _0x533ec9[_0xc3bf('0x7')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0149=['exports','define','lodash','util','moment','bluebird','request-promise','./jscriptySessionReport.attributes'];(function(_0x335b14,_0xc85f2f){var _0x43790d=function(_0x3e8252){while(--_0x3e8252){_0x335b14['push'](_0x335b14['shift']());}};_0x43790d(++_0xc85f2f);}(_0x0149,0x1ea));var _0x9014=function(_0x55a978,_0x4a809f){_0x55a978=_0x55a978-0x0;var _0x321a6c=_0x0149[_0x55a978];return _0x321a6c;};'use strict';var _=require(_0x9014('0x0'));var util=require(_0x9014('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9014('0x2'));var BPromise=require(_0x9014('0x3'));var rp=require(_0x9014('0x4'));var attributes=require(_0x9014('0x5'));module[_0x9014('0x6')]=function(_0x622d50,_0x41ab5e){return _0x622d50[_0x9014('0x7')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index b355e52..214d853 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 _0x6f44=['request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f44,0x1ea));var _0x46f4=function(_0x1df75d,_0x14e146){_0x1df75d=_0x1df75d-0x0;var _0x58a880=_0x6f44[_0x1df75d];return _0x58a880;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var moment=require('moment');var BPromise=require(_0x46f4('0x2'));var rs=require(_0x46f4('0x3'));var fs=require('fs');var Redis=require(_0x46f4('0x4'));var db=require(_0x46f4('0x5'))['db'];var utils=require(_0x46f4('0x6'));var logger=require(_0x46f4('0x7'))(_0x46f4('0x8'));var config=require(_0x46f4('0x9'));var jayson=require(_0x46f4('0xa'));var client=jayson['client'][_0x46f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a50b1,_0x37d6a2,_0x4b791c){return new BPromise(function(_0x5ce344,_0x357069){return client[_0x46f4('0xc')](_0x2a50b1,_0x4b791c)['then'](function(_0x1eabea){logger['info'](_0x46f4('0xd'),_0x37d6a2,'request\x20sent');logger[_0x46f4('0xe')](_0x46f4('0xf'),_0x37d6a2,_0x46f4('0x10'),JSON[_0x46f4('0x11')](_0x1eabea));if(_0x1eabea[_0x46f4('0x12')]){if(_0x1eabea[_0x46f4('0x12')][_0x46f4('0x13')]===0x1f4){logger[_0x46f4('0x12')](_0x46f4('0xd'),_0x37d6a2,_0x1eabea[_0x46f4('0x12')][_0x46f4('0x14')]);return _0x357069(_0x1eabea[_0x46f4('0x12')]['message']);}logger[_0x46f4('0x12')](_0x46f4('0xd'),_0x37d6a2,_0x1eabea['error'][_0x46f4('0x14')]);return _0x5ce344(_0x1eabea[_0x46f4('0x12')][_0x46f4('0x14')]);}else{logger['info'](_0x46f4('0xd'),_0x37d6a2,'request\x20sent');_0x5ce344(_0x1eabea['result'][_0x46f4('0x14')]);}})[_0x46f4('0x15')](function(_0x39f902){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x37d6a2,_0x39f902);_0x357069(_0x39f902);});});} \ No newline at end of file +var _0x3024=['rpc','../../config/environment','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x3024,0x64));var _0x4302=function(_0x281480,_0x7c054b){_0x281480=_0x281480-0x0;var _0x3fe6a6=_0x3024[_0x281480];return _0x3fe6a6;};'use strict';var _=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var moment=require('moment');var BPromise=require(_0x4302('0x2'));var rs=require(_0x4302('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4302('0x4'));var logger=require('../../config/logger')(_0x4302('0x5'));var config=require(_0x4302('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4302('0x7')][_0x4302('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c3983,_0xced9fc,_0x2aecd7){return new BPromise(function(_0x3c007b,_0x285613){return client[_0x4302('0x9')](_0x4c3983,_0x2aecd7)[_0x4302('0xa')](function(_0x41580c){logger['info'](_0x4302('0xb'),_0xced9fc,_0x4302('0xc'));logger[_0x4302('0xd')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0xced9fc,_0x4302('0xc'),JSON[_0x4302('0xe')](_0x41580c));if(_0x41580c['error']){if(_0x41580c[_0x4302('0xf')][_0x4302('0x10')]===0x1f4){logger[_0x4302('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0xced9fc,_0x41580c[_0x4302('0xf')][_0x4302('0x11')]);return _0x285613(_0x41580c['error'][_0x4302('0x11')]);}logger[_0x4302('0xf')](_0x4302('0xb'),_0xced9fc,_0x41580c['error'][_0x4302('0x11')]);return _0x3c007b(_0x41580c[_0x4302('0xf')]['message']);}else{logger[_0x4302('0x12')](_0x4302('0xb'),_0xced9fc,'request\x20sent');_0x3c007b(_0x41580c[_0x4302('0x13')][_0x4302('0x11')]);}})[_0x4302('0x14')](function(_0x32178f){logger[_0x4302('0xf')](_0x4302('0xb'),_0xced9fc,_0x32178f);_0x285613(_0x32178f);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 9e14cc2..c8e1ecb 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 _0xd3ce=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./license.controller','index','put','/:id','update','exports'];(function(_0x26b1e6,_0x368e13){var _0x5e18e1=function(_0x58e0bb){while(--_0x58e0bb){_0x26b1e6['push'](_0x26b1e6['shift']());}};_0x5e18e1(++_0x368e13);}(_0xd3ce,0x15f));var _0xed3c=function(_0x185ff8,_0x45bd75){_0x185ff8=_0x185ff8-0x0;var _0x5775d=_0xd3ce[_0x185ff8];return _0x5775d;};'use strict';var multer=require(_0xed3c('0x0'));var util=require('util');var path=require(_0xed3c('0x1'));var timeout=require(_0xed3c('0x2'));var express=require(_0xed3c('0x3'));var router=express[_0xed3c('0x4')]();var auth=require(_0xed3c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed3c('0x6'));var controller=require(_0xed3c('0x7'));router['get']('/',controller[_0xed3c('0x8')]);router[_0xed3c('0x9')](_0xed3c('0xa'),auth['isAuthenticated'](),controller[_0xed3c('0xb')]);module[_0xed3c('0xc')]=router; \ No newline at end of file +var _0xc4b5=['update','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated'];(function(_0x500f61,_0x257d07){var _0x105931=function(_0x59f0e8){while(--_0x59f0e8){_0x500f61['push'](_0x500f61['shift']());}};_0x105931(++_0x257d07);}(_0xc4b5,0x64));var _0x5c4b=function(_0x159d98,_0x5052b4){_0x159d98=_0x159d98-0x0;var _0x44ba54=_0xc4b5[_0x159d98];return _0x44ba54;};'use strict';var multer=require(_0x5c4b('0x0'));var util=require('util');var path=require(_0x5c4b('0x1'));var timeout=require(_0x5c4b('0x2'));var express=require(_0x5c4b('0x3'));var router=express[_0x5c4b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5c4b('0x5'));var config=require(_0x5c4b('0x6'));var controller=require('./license.controller');router['get']('/',controller['index']);router[_0x5c4b('0x7')](_0x5c4b('0x8'),auth[_0x5c4b('0x9')](),controller[_0x5c4b('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index f4b025f..99308ad 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 _0x30b2=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x30b2,0xb1));var _0x230b=function(_0x297d89,_0xff950){_0x297d89=_0x297d89-0x0;var _0x21b531=_0x30b2[_0x297d89];return _0x21b531;};'use strict';var Sequelize=require(_0x230b('0x0'));module[_0x230b('0x1')]={'license':{'type':Sequelize[_0x230b('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x230b('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x230b('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x94be=['INTEGER','TEXT'];(function(_0x484c72,_0xeaa814){var _0x51497d=function(_0x4a1d63){while(--_0x4a1d63){_0x484c72['push'](_0x484c72['shift']());}};_0x51497d(++_0xeaa814);}(_0x94be,0x11f));var _0xe94b=function(_0x577d6a,_0x168189){_0x577d6a=_0x577d6a-0x0;var _0x2a6f0c=_0x94be[_0x577d6a];return _0x2a6f0c;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0xe94b('0x0')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xe94b('0x1')],'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 2050932..2944b99 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 _0x71ee=['index','keys','License','rawAttributes','query','filters','intersection','model','attributes','fields','merge','getLicense','catch','body','find','params','get','checkLicense','demo','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','status','send','../../config/license/util'];(function(_0x55e74c,_0x1aeb5c){var _0x1e1f1a=function(_0x5d83ca){while(--_0x5d83ca){_0x55e74c['push'](_0x55e74c['shift']());}};_0x1e1f1a(++_0x1aeb5c);}(_0x71ee,0x107));var _0xe71e=function(_0x323419,_0x2a6172){_0x323419=_0x323419-0x0;var _0x4c0be7=_0x71ee[_0x323419];return _0x4c0be7;};'use strict';var pdf=require(_0xe71e('0x0'));var emlformat=require(_0xe71e('0x1'));var rimraf=require(_0xe71e('0x2'));var zipdir=require(_0xe71e('0x3'));var jsonpatch=require(_0xe71e('0x4'));var rp=require(_0xe71e('0x5'));var moment=require(_0xe71e('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xe71e('0x7'));var util=require(_0xe71e('0x8'));var path=require(_0xe71e('0x9'));var sox=require(_0xe71e('0xa'));var csv=require(_0xe71e('0xb'));var ejs=require(_0xe71e('0xc'));var fs=require('fs');var _=require(_0xe71e('0xd'));var squel=require(_0xe71e('0xe'));var crypto=require('crypto');var jsforce=require(_0xe71e('0xf'));var deskjs=require(_0xe71e('0x10'));var toCsv=require(_0xe71e('0xb'));var querystring=require(_0xe71e('0x11'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xe71e('0x12'));var Redis=require(_0xe71e('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0xe71e('0x14'))(_0xe71e('0x15'));var utils=require(_0xe71e('0x16'));var config=require(_0xe71e('0x17'));var db=require(_0xe71e('0x18'))['db'];function respondWithStatusCode(_0xaf8707,_0x5d4973){_0x5d4973=_0x5d4973||0xcc;return function(_0x574e92){if(_0x574e92){return _0xaf8707[_0xe71e('0x19')](_0x5d4973);}return _0xaf8707['status'](_0x5d4973)[_0xe71e('0x1a')]();};}function respondWithResult(_0x261b05,_0x2b4e2a){_0x2b4e2a=_0x2b4e2a||0xc8;return function(_0xec169c){if(_0xec169c){return _0x261b05['status'](_0x2b4e2a)[_0xe71e('0x1b')](_0xec169c);}};}function respondWithFilteredResult(_0x3f9705,_0x4c8750){return function(_0x29aa67){if(_0x29aa67){var _0x6ee7db=_0x29aa67[_0xe71e('0x1c')],_0x158ce2=_0x4c8750[_0xe71e('0x1d')],_0x134cae=_0x4c8750[_0xe71e('0x1d')]+_0x4c8750['limit'],_0x12840b;if(_0x134cae>=_0x6ee7db){_0x134cae=_0x6ee7db;_0x12840b=0xc8;}else{_0x12840b=0xce;}_0x3f9705['status'](_0x12840b);return _0x3f9705[_0xe71e('0x1e')](_0xe71e('0x1f'),_0x158ce2+'-'+_0x134cae+'/'+_0x6ee7db)['json'](_0x29aa67);}return null;};}function patchUpdates(_0x538413){return function(_0x431b5f){try{jsonpatch[_0xe71e('0x20')](_0x431b5f,_0x538413,!![]);}catch(_0x23d823){return BPromise[_0xe71e('0x21')](_0x23d823);}return _0x431b5f[_0xe71e('0x22')]();};}function saveUpdates(_0x20db9e,_0x36996e){return function(_0x1b9f54){if(_0x1b9f54){return _0x1b9f54[_0xe71e('0x23')](_0x20db9e)['then'](function(_0x22261f){return _0x22261f;});}return null;};}function removeEntity(_0x13827e,_0x8df4f2){return function(_0x485517){if(_0x485517){return _0x485517['destroy']()[_0xe71e('0x24')](function(){_0x13827e['status'](0xcc)[_0xe71e('0x1a')]();});}};}function handleEntityNotFound(_0x2ea761,_0x5498f3){return function(_0x565214){if(!_0x565214){_0x2ea761['sendStatus'](0x194);}return _0x565214;};}function handleError(_0x56d29d,_0x1db1c6){_0x1db1c6=_0x1db1c6||0x1f4;return function(_0x51f33){logger[_0xe71e('0x25')](_0x51f33['stack']);if(_0x51f33[_0xe71e('0x26')]){delete _0x51f33[_0xe71e('0x26')];}_0x56d29d[_0xe71e('0x27')](_0x1db1c6)[_0xe71e('0x28')](_0x51f33);};}var utilLicense=require(_0xe71e('0x29'));exports[_0xe71e('0x2a')]=function(_0x429bfc,_0x4ab9a1){var _0x1b8cc9={'raw':!![],'where':{'id':0x1}},_0x42cd01={};_0x42cd01['model']=_[_0xe71e('0x2b')](db[_0xe71e('0x2c')][_0xe71e('0x2d')]);_0x42cd01[_0xe71e('0x2e')]=_[_0xe71e('0x2b')](_0x429bfc[_0xe71e('0x2e')]);_0x42cd01[_0xe71e('0x2f')]=_[_0xe71e('0x30')](_0x42cd01[_0xe71e('0x31')],_0x42cd01['query']);_0x1b8cc9[_0xe71e('0x32')]=_[_0xe71e('0x30')](_0x42cd01[_0xe71e('0x31')],qs[_0xe71e('0x33')](_0x429bfc[_0xe71e('0x2e')][_0xe71e('0x33')]));_0x1b8cc9['attributes']=_0x1b8cc9[_0xe71e('0x32')]['length']?_0x1b8cc9['attributes']:_0x42cd01['model'];_0x1b8cc9=_[_0xe71e('0x34')]({},_0x1b8cc9,_0x429bfc['options']);return utilLicense[_0xe71e('0x35')](_0x1b8cc9)[_0xe71e('0x24')](respondWithResult(_0x4ab9a1,null))[_0xe71e('0x36')](handleError(_0x4ab9a1,null));};exports[_0xe71e('0x23')]=function(_0xa61b47,_0xa7a1d5){if(_0xa61b47[_0xe71e('0x37')]['id']){delete _0xa61b47[_0xe71e('0x37')]['id'];}return db['License'][_0xe71e('0x38')]({'where':{'id':_0xa61b47[_0xe71e('0x39')]['id']}})[_0xe71e('0x24')](handleEntityNotFound(_0xa7a1d5,null))[_0xe71e('0x24')](function(_0x2b38b1){var _0x30ddb4=_0x2b38b1[_0xe71e('0x3a')]({'plain':!![]});return utilLicense[_0xe71e('0x3b')](_0x30ddb4,_0xa61b47[_0xe71e('0x37')]['key']);})['then'](function(_0x341cfd){if(!_0x341cfd[_0xe71e('0x3c')]){return saveUpdates(_0xa61b47['body'],null);}return _0x341cfd;})[_0xe71e('0x24')](respondWithResult(_0xa7a1d5,null))[_0xe71e('0x36')](handleError(_0xa7a1d5,null));}; \ No newline at end of file +var _0x4b99=['body','find','get','checkLicense','key','demo','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','end','status','json','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','keys','License','rawAttributes','query','filters','intersection','model','fields','attributes','length','options','getLicense','catch'];(function(_0x1e8d58,_0x55d6d3){var _0x83f072=function(_0xb04832){while(--_0xb04832){_0x1e8d58['push'](_0x1e8d58['shift']());}};_0x83f072(++_0x55d6d3);}(_0x4b99,0x1de));var _0x94b9=function(_0x1e33c7,_0x173913){_0x1e33c7=_0x1e33c7-0x0;var _0x558ed7=_0x4b99[_0x1e33c7];return _0x558ed7;};'use strict';var pdf=require(_0x94b9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x94b9('0x1'));var zipdir=require(_0x94b9('0x2'));var jsonpatch=require(_0x94b9('0x3'));var rp=require(_0x94b9('0x4'));var moment=require(_0x94b9('0x5'));var BPromise=require(_0x94b9('0x6'));var Mustache=require(_0x94b9('0x7'));var util=require(_0x94b9('0x8'));var path=require(_0x94b9('0x9'));var sox=require(_0x94b9('0xa'));var csv=require('to-csv');var ejs=require(_0x94b9('0xb'));var fs=require('fs');var _=require(_0x94b9('0xc'));var squel=require(_0x94b9('0xd'));var crypto=require(_0x94b9('0xe'));var jsforce=require(_0x94b9('0xf'));var deskjs=require(_0x94b9('0x10'));var toCsv=require('to-csv');var querystring=require(_0x94b9('0x11'));var Papa=require(_0x94b9('0x12'));var authService=require('../../components/auth/service');var hardwareService=require(_0x94b9('0x13'));var Redis=require('ioredis');var qs=require(_0x94b9('0x14'));var logger=require('../../config/logger')(_0x94b9('0x15'));var utils=require(_0x94b9('0x16'));var config=require(_0x94b9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e0972,_0x382f6c){_0x382f6c=_0x382f6c||0xcc;return function(_0x1ae735){if(_0x1ae735){return _0x2e0972['sendStatus'](_0x382f6c);}return _0x2e0972['status'](_0x382f6c)[_0x94b9('0x18')]();};}function respondWithResult(_0x4c03b4,_0x1e4063){_0x1e4063=_0x1e4063||0xc8;return function(_0x3af8fd){if(_0x3af8fd){return _0x4c03b4[_0x94b9('0x19')](_0x1e4063)[_0x94b9('0x1a')](_0x3af8fd);}};}function respondWithFilteredResult(_0x4dda2d,_0x599b1f){return function(_0x5a6b1f){if(_0x5a6b1f){var _0x43b8b5=_0x5a6b1f['count'],_0x70b5d=_0x599b1f[_0x94b9('0x1b')],_0x43f425=_0x599b1f[_0x94b9('0x1b')]+_0x599b1f['limit'],_0x46a8ac;if(_0x43f425>=_0x43b8b5){_0x43f425=_0x43b8b5;_0x46a8ac=0xc8;}else{_0x46a8ac=0xce;}_0x4dda2d[_0x94b9('0x19')](_0x46a8ac);return _0x4dda2d['set'](_0x94b9('0x1c'),_0x70b5d+'-'+_0x43f425+'/'+_0x43b8b5)[_0x94b9('0x1a')](_0x5a6b1f);}return null;};}function patchUpdates(_0x1fe934){return function(_0x175491){try{jsonpatch[_0x94b9('0x1d')](_0x175491,_0x1fe934,!![]);}catch(_0x219fad){return BPromise[_0x94b9('0x1e')](_0x219fad);}return _0x175491[_0x94b9('0x1f')]();};}function saveUpdates(_0x512545,_0x4499d3){return function(_0x4a93be){if(_0x4a93be){return _0x4a93be[_0x94b9('0x20')](_0x512545)[_0x94b9('0x21')](function(_0x5898e0){return _0x5898e0;});}return null;};}function removeEntity(_0x3f6484,_0x186c62){return function(_0x358b4e){if(_0x358b4e){return _0x358b4e[_0x94b9('0x22')]()['then'](function(){_0x3f6484['status'](0xcc)[_0x94b9('0x18')]();});}};}function handleEntityNotFound(_0x2ccf53,_0x1065c5){return function(_0xbbc6db){if(!_0xbbc6db){_0x2ccf53['sendStatus'](0x194);}return _0xbbc6db;};}function handleError(_0x134658,_0x5f227d){_0x5f227d=_0x5f227d||0x1f4;return function(_0x1c766e){logger[_0x94b9('0x23')](_0x1c766e[_0x94b9('0x24')]);if(_0x1c766e[_0x94b9('0x25')]){delete _0x1c766e[_0x94b9('0x25')];}_0x134658[_0x94b9('0x19')](_0x5f227d)[_0x94b9('0x26')](_0x1c766e);};}var utilLicense=require('../../config/license/util');exports[_0x94b9('0x27')]=function(_0x972398,_0x39f6d2){var _0x78385a={'raw':!![],'where':{'id':0x1}},_0x56b838={};_0x56b838['model']=_[_0x94b9('0x28')](db[_0x94b9('0x29')][_0x94b9('0x2a')]);_0x56b838[_0x94b9('0x2b')]=_[_0x94b9('0x28')](_0x972398[_0x94b9('0x2b')]);_0x56b838[_0x94b9('0x2c')]=_[_0x94b9('0x2d')](_0x56b838[_0x94b9('0x2e')],_0x56b838[_0x94b9('0x2b')]);_0x78385a['attributes']=_[_0x94b9('0x2d')](_0x56b838['model'],qs[_0x94b9('0x2f')](_0x972398[_0x94b9('0x2b')]['fields']));_0x78385a[_0x94b9('0x30')]=_0x78385a['attributes'][_0x94b9('0x31')]?_0x78385a[_0x94b9('0x30')]:_0x56b838[_0x94b9('0x2e')];_0x78385a=_['merge']({},_0x78385a,_0x972398[_0x94b9('0x32')]);return utilLicense[_0x94b9('0x33')](_0x78385a)[_0x94b9('0x21')](respondWithResult(_0x39f6d2,null))[_0x94b9('0x34')](handleError(_0x39f6d2,null));};exports[_0x94b9('0x20')]=function(_0x5a0bcc,_0x20f9a8){if(_0x5a0bcc['body']['id']){delete _0x5a0bcc[_0x94b9('0x35')]['id'];}return db['License'][_0x94b9('0x36')]({'where':{'id':_0x5a0bcc['params']['id']}})[_0x94b9('0x21')](handleEntityNotFound(_0x20f9a8,null))[_0x94b9('0x21')](function(_0x41bb05){var _0x49f79e=_0x41bb05[_0x94b9('0x37')]({'plain':!![]});return utilLicense[_0x94b9('0x38')](_0x49f79e,_0x5a0bcc[_0x94b9('0x35')][_0x94b9('0x39')]);})[_0x94b9('0x21')](function(_0x92569){if(!_0x92569[_0x94b9('0x3a')]){return saveUpdates(_0x5a0bcc[_0x94b9('0x35')],null);}return _0x92569;})['then'](respondWithResult(_0x20f9a8,null))[_0x94b9('0x34')](handleError(_0x20f9a8,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index b264dd9..eb03d6c 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 _0x83f1=['license','lodash','util','../../config/logger','api','moment','./license.attributes','exports','define'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x83f1,0x1cc));var _0x183f=function(_0x41204e,_0x377d65){_0x41204e=_0x41204e-0x0;var _0x5ef93b=_0x83f1[_0x41204e];return _0x5ef93b;};'use strict';var _=require(_0x183f('0x0'));var util=require(_0x183f('0x1'));var logger=require(_0x183f('0x2'))(_0x183f('0x3'));var moment=require(_0x183f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x183f('0x5'));module[_0x183f('0x6')]=function(_0x7f265,_0x2436de){return _0x7f265[_0x183f('0x7')]('License',attributes,{'tableName':_0x183f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9585=['moment','bluebird','request-promise','./license.attributes','exports','License','util','api'];(function(_0x1e009e,_0x1fb11c){var _0x531fb7=function(_0x30b9b6){while(--_0x30b9b6){_0x1e009e['push'](_0x1e009e['shift']());}};_0x531fb7(++_0x1fb11c);}(_0x9585,0x15e));var _0x5958=function(_0x52da09,_0x2b9cbd){_0x52da09=_0x52da09-0x0;var _0xf3b51f=_0x9585[_0x52da09];return _0xf3b51f;};'use strict';var _=require('lodash');var util=require(_0x5958('0x0'));var logger=require('../../config/logger')(_0x5958('0x1'));var moment=require(_0x5958('0x2'));var BPromise=require(_0x5958('0x3'));var rp=require(_0x5958('0x4'));var attributes=require(_0x5958('0x5'));module[_0x5958('0x6')]=function(_0x28be1b,_0x44ce6d){return _0x28be1b['define'](_0x5958('0x7'),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 d53a675..bdf6e31 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 _0x38b5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x2bb10e,_0x570ae7){var _0x19e79b=function(_0x52f2d0){while(--_0x52f2d0){_0x2bb10e['push'](_0x2bb10e['shift']());}};_0x19e79b(++_0x570ae7);}(_0x38b5,0x11b));var _0x538b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x38b5[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x538b('0x0'));var util=require(_0x538b('0x1'));var moment=require(_0x538b('0x2'));var BPromise=require(_0x538b('0x3'));var rs=require(_0x538b('0x4'));var fs=require('fs');var Redis=require(_0x538b('0x5'));var db=require(_0x538b('0x6'))['db'];var utils=require(_0x538b('0x7'));var logger=require(_0x538b('0x8'))('rpc');var config=require(_0x538b('0x9'));var jayson=require(_0x538b('0xa'));var client=jayson[_0x538b('0xb')][_0x538b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d2c7c,_0x1345b8,_0x5426c0){return new BPromise(function(_0x3bab0a,_0x1caf8e){return client[_0x538b('0xd')](_0x1d2c7c,_0x5426c0)[_0x538b('0xe')](function(_0x4cf9f6){logger[_0x538b('0xf')](_0x538b('0x10'),_0x1345b8,_0x538b('0x11'));logger[_0x538b('0x12')](_0x538b('0x13'),_0x1345b8,'request\x20sent',JSON[_0x538b('0x14')](_0x4cf9f6));if(_0x4cf9f6['error']){if(_0x4cf9f6[_0x538b('0x15')][_0x538b('0x16')]===0x1f4){logger[_0x538b('0x15')]('License,\x20%s,\x20%s',_0x1345b8,_0x4cf9f6[_0x538b('0x15')][_0x538b('0x17')]);return _0x1caf8e(_0x4cf9f6[_0x538b('0x15')][_0x538b('0x17')]);}logger[_0x538b('0x15')](_0x538b('0x10'),_0x1345b8,_0x4cf9f6[_0x538b('0x15')][_0x538b('0x17')]);return _0x3bab0a(_0x4cf9f6[_0x538b('0x15')][_0x538b('0x17')]);}else{logger[_0x538b('0xf')](_0x538b('0x10'),_0x1345b8,_0x538b('0x11'));_0x3bab0a(_0x4cf9f6[_0x538b('0x18')][_0x538b('0x17')]);}})[_0x538b('0x19')](function(_0x1470dc){logger['error'](_0x538b('0x10'),_0x1345b8,_0x1470dc);_0x1caf8e(_0x1470dc);});});} \ No newline at end of file +var _0xedc9=['License,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4d3c10,_0x451e74){var _0x5e8578=function(_0x57b3ee){while(--_0x57b3ee){_0x4d3c10['push'](_0x4d3c10['shift']());}};_0x5e8578(++_0x451e74);}(_0xedc9,0x17f));var _0x9edc=function(_0x5162ed,_0x386cb7){_0x5162ed=_0x5162ed-0x0;var _0x4c579b=_0xedc9[_0x5162ed];return _0x4c579b;};'use strict';var _=require(_0x9edc('0x0'));var util=require(_0x9edc('0x1'));var moment=require(_0x9edc('0x2'));var BPromise=require('bluebird');var rs=require(_0x9edc('0x3'));var fs=require('fs');var Redis=require(_0x9edc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9edc('0x5'))('rpc');var config=require(_0x9edc('0x6'));var jayson=require(_0x9edc('0x7'));var client=jayson[_0x9edc('0x8')][_0x9edc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9a5f0e,_0x10dbcb,_0x48bce8){return new BPromise(function(_0x34e12e,_0x1c190a){return client[_0x9edc('0xa')](_0x9a5f0e,_0x48bce8)[_0x9edc('0xb')](function(_0x28e97c){logger[_0x9edc('0xc')]('License,\x20%s,\x20%s',_0x10dbcb,_0x9edc('0xd'));logger['debug'](_0x9edc('0xe'),_0x10dbcb,_0x9edc('0xd'),JSON[_0x9edc('0xf')](_0x28e97c));if(_0x28e97c[_0x9edc('0x10')]){if(_0x28e97c[_0x9edc('0x10')]['code']===0x1f4){logger[_0x9edc('0x10')](_0x9edc('0x11'),_0x10dbcb,_0x28e97c['error'][_0x9edc('0x12')]);return _0x1c190a(_0x28e97c[_0x9edc('0x10')][_0x9edc('0x12')]);}logger[_0x9edc('0x10')](_0x9edc('0x11'),_0x10dbcb,_0x28e97c[_0x9edc('0x10')][_0x9edc('0x12')]);return _0x34e12e(_0x28e97c[_0x9edc('0x10')][_0x9edc('0x12')]);}else{logger[_0x9edc('0xc')]('License,\x20%s,\x20%s',_0x10dbcb,_0x9edc('0xd'));_0x34e12e(_0x28e97c[_0x9edc('0x13')]['message']);}})['catch'](function(_0x4cb975){logger[_0x9edc('0x10')](_0x9edc('0x11'),_0x10dbcb,_0x4cb975);_0x1c190a(_0x4cb975);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 9c4776c..3ad890e 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 _0xceb3=['put','update','delete','removeDispositions','removeImap','removeSmtp','/:id','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/canned_answers','/:id/in_servers','getImap','getSmtp','/:id/interactions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','create','addImap','/:id/out_servers','addInteraction','/:id/send','send','addAgents'];(function(_0x49c0b0,_0x22fed5){var _0x322419=function(_0x81fa8){while(--_0x81fa8){_0x49c0b0['push'](_0x49c0b0['shift']());}};_0x322419(++_0x22fed5);}(_0xceb3,0x1ed));var _0x3ceb=function(_0x15a634,_0x4feb86){_0x15a634=_0x15a634-0x0;var _0xf4f7a0=_0xceb3[_0x15a634];return _0xf4f7a0;};'use strict';var multer=require(_0x3ceb('0x0'));var util=require(_0x3ceb('0x1'));var path=require('path');var timeout=require(_0x3ceb('0x2'));var express=require(_0x3ceb('0x3'));var router=express['Router']();var auth=require(_0x3ceb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3ceb('0x5'));var controller=require(_0x3ceb('0x6'));router[_0x3ceb('0x7')]('/',auth[_0x3ceb('0x8')](),controller['index']);router[_0x3ceb('0x7')](_0x3ceb('0x9'),auth[_0x3ceb('0x8')](),controller[_0x3ceb('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3ceb('0xb')]);router[_0x3ceb('0x7')]('/:id/dispositions',auth[_0x3ceb('0x8')](),controller['getDispositions']);router[_0x3ceb('0x7')](_0x3ceb('0xc'),auth[_0x3ceb('0x8')](),controller['getAnswers']);router[_0x3ceb('0x7')](_0x3ceb('0xd'),auth[_0x3ceb('0x8')](),controller[_0x3ceb('0xe')]);router['get']('/:id/out_servers',auth[_0x3ceb('0x8')](),controller[_0x3ceb('0xf')]);router[_0x3ceb('0x7')](_0x3ceb('0x10'),auth[_0x3ceb('0x8')](),controller['getInteractions']);router[_0x3ceb('0x7')](_0x3ceb('0x11'),auth[_0x3ceb('0x8')](),controller['getApplications']);router[_0x3ceb('0x7')](_0x3ceb('0x12'),auth['isAuthenticated'](),controller[_0x3ceb('0x13')]);router[_0x3ceb('0x7')](_0x3ceb('0x14'),auth[_0x3ceb('0x8')](),controller[_0x3ceb('0x15')]);router[_0x3ceb('0x7')](_0x3ceb('0x16'),auth[_0x3ceb('0x8')](),controller[_0x3ceb('0x17')]);router[_0x3ceb('0x18')](_0x3ceb('0x19'),auth['isAuthenticated'](),controller[_0x3ceb('0x1a')]);router[_0x3ceb('0x18')](_0x3ceb('0xc'),auth[_0x3ceb('0x8')](),controller[_0x3ceb('0x1b')]);router[_0x3ceb('0x18')]('/',auth['isAuthenticated'](),controller[_0x3ceb('0x1c')]);router[_0x3ceb('0x18')](_0x3ceb('0xd'),auth[_0x3ceb('0x8')](),controller[_0x3ceb('0x1d')]);router['post'](_0x3ceb('0x1e'),auth[_0x3ceb('0x8')](),controller['addSmtp']);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x3ceb('0x1f')]);router[_0x3ceb('0x18')](_0x3ceb('0x11'),auth[_0x3ceb('0x8')](),controller['addApplications']);router['post'](_0x3ceb('0x20'),auth[_0x3ceb('0x8')](),controller[_0x3ceb('0x21')]);router[_0x3ceb('0x18')](_0x3ceb('0x16'),auth[_0x3ceb('0x8')](),controller[_0x3ceb('0x22')]);router[_0x3ceb('0x23')]('/:id',auth[_0x3ceb('0x8')](),controller[_0x3ceb('0x24')]);router[_0x3ceb('0x25')](_0x3ceb('0x19'),auth[_0x3ceb('0x8')](),controller[_0x3ceb('0x26')]);router[_0x3ceb('0x25')](_0x3ceb('0xc'),auth[_0x3ceb('0x8')](),controller['removeAnswers']);router['delete']('/:id/in_servers',auth['isAuthenticated'](),controller[_0x3ceb('0x27')]);router[_0x3ceb('0x25')](_0x3ceb('0x1e'),auth['isAuthenticated'](),controller[_0x3ceb('0x28')]);router['delete'](_0x3ceb('0x29'),auth[_0x3ceb('0x8')](),controller[_0x3ceb('0x2a')]);router[_0x3ceb('0x25')](_0x3ceb('0x16'),auth[_0x3ceb('0x8')](),controller['removeAgents']);module[_0x3ceb('0x2b')]=router; \ No newline at end of file +var _0x40f0=['send','/:id/users','addAgents','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','Router','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp','getAgents','addDisposition','post','create','/:id/in_servers','addImap','addSmtp','addApplications','/:id/send'];(function(_0x3d0889,_0x50ff41){var _0x13758f=function(_0x29b3f7){while(--_0x29b3f7){_0x3d0889['push'](_0x3d0889['shift']());}};_0x13758f(++_0x50ff41);}(_0x40f0,0x1c4));var _0x040f=function(_0x2ea539,_0x25cb5f){_0x2ea539=_0x2ea539-0x0;var _0xe70849=_0x40f0[_0x2ea539];return _0xe70849;};'use strict';var multer=require(_0x040f('0x0'));var util=require('util');var path=require(_0x040f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x040f('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x040f('0x3'));var controller=require(_0x040f('0x4'));router[_0x040f('0x5')]('/',auth['isAuthenticated'](),controller[_0x040f('0x6')]);router['get'](_0x040f('0x7'),auth[_0x040f('0x8')](),controller[_0x040f('0x9')]);router[_0x040f('0x5')](_0x040f('0xa'),auth[_0x040f('0x8')](),controller[_0x040f('0xb')]);router['get'](_0x040f('0xc'),auth[_0x040f('0x8')](),controller['getDispositions']);router[_0x040f('0x5')](_0x040f('0xd'),auth[_0x040f('0x8')](),controller[_0x040f('0xe')]);router['get']('/:id/in_servers',auth['isAuthenticated'](),controller['getImap']);router['get'](_0x040f('0xf'),auth['isAuthenticated'](),controller[_0x040f('0x10')]);router[_0x040f('0x5')](_0x040f('0x11'),auth[_0x040f('0x8')](),controller['getInteractions']);router['get'](_0x040f('0x12'),auth[_0x040f('0x8')](),controller[_0x040f('0x13')]);router[_0x040f('0x5')]('/:id/messages',auth[_0x040f('0x8')](),controller[_0x040f('0x14')]);router[_0x040f('0x5')](_0x040f('0x15'),auth[_0x040f('0x8')](),controller[_0x040f('0x16')]);router[_0x040f('0x5')]('/:id/users',auth[_0x040f('0x8')](),controller[_0x040f('0x17')]);router['post'](_0x040f('0xc'),auth['isAuthenticated'](),controller[_0x040f('0x18')]);router[_0x040f('0x19')](_0x040f('0xd'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x040f('0x19')]('/',auth[_0x040f('0x8')](),controller[_0x040f('0x1a')]);router[_0x040f('0x19')](_0x040f('0x1b'),auth[_0x040f('0x8')](),controller[_0x040f('0x1c')]);router[_0x040f('0x19')](_0x040f('0xf'),auth['isAuthenticated'](),controller[_0x040f('0x1d')]);router[_0x040f('0x19')](_0x040f('0x11'),auth[_0x040f('0x8')](),controller['addInteraction']);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x040f('0x1e')]);router[_0x040f('0x19')](_0x040f('0x1f'),auth['isAuthenticated'](),controller[_0x040f('0x20')]);router['post'](_0x040f('0x21'),auth[_0x040f('0x8')](),controller[_0x040f('0x22')]);router['put']('/:id',auth[_0x040f('0x8')](),controller[_0x040f('0x23')]);router[_0x040f('0x24')](_0x040f('0xc'),auth[_0x040f('0x8')](),controller[_0x040f('0x25')]);router[_0x040f('0x24')](_0x040f('0xd'),auth[_0x040f('0x8')](),controller[_0x040f('0x26')]);router[_0x040f('0x24')](_0x040f('0x1b'),auth[_0x040f('0x8')](),controller[_0x040f('0x27')]);router[_0x040f('0x24')](_0x040f('0xf'),auth['isAuthenticated'](),controller[_0x040f('0x28')]);router[_0x040f('0x24')](_0x040f('0xa'),auth[_0x040f('0x8')](),controller[_0x040f('0x29')]);router[_0x040f('0x24')]('/:id/users',auth[_0x040f('0x8')](),controller[_0x040f('0x2a')]);module[_0x040f('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 640ff88..07e7dc9 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 _0xbeda=['TEXT','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','STRING','BOOLEAN'];(function(_0x370cc4,_0x531958){var _0xcf1ac8=function(_0x3a97fb){while(--_0x3a97fb){_0x370cc4['push'](_0x370cc4['shift']());}};_0xcf1ac8(++_0x531958);}(_0xbeda,0x1a2));var _0xabed=function(_0x152136,_0x4f14f1){_0x152136=_0x152136-0x0;var _0x20df44=_0xbeda[_0x152136];return _0x20df44;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xabed('0x0')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xabed('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0xabed('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0xabed('0x2')]},'markAsUnread':{'type':Sequelize[_0xabed('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xabed('0x0')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xabed('0x3')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xabed('0x2')],'defaultValue':function(){return _0xabed('0x4');}},'notificationSound':{'type':Sequelize[_0xabed('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xabed('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xabed('0x5')],'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[_0xabed('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xabed('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xabed('0x6')},'mandatoryDisposition':{'type':Sequelize[_0xabed('0x1')],'defaultValue':![],'comment':_0xabed('0x7'),'set':function(_0x46d539){if(!_0x46d539)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xabed('0x8')](_0xabed('0x9'),_0x46d539);}}}; \ No newline at end of file +var _0x5dae=['Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT'];(function(_0xa320b2,_0x358a2e){var _0x59a838=function(_0x229db5){while(--_0x229db5){_0xa320b2['push'](_0xa320b2['shift']());}};_0x59a838(++_0x358a2e);}(_0x5dae,0x121));var _0xe5da=function(_0x41c621,_0x1edf7c){_0x41c621=_0x41c621-0x0;var _0x2de75b=_0x5dae[_0x41c621];return _0x2de75b;};'use strict';var Sequelize=require(_0xe5da('0x0'));module[_0xe5da('0x1')]={'description':{'type':Sequelize[_0xe5da('0x2')]},'name':{'type':Sequelize[_0xe5da('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xe5da('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xe5da('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xe5da('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xe5da('0x4')]},'markAsUnread':{'type':Sequelize[_0xe5da('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xe5da('0x2')],'allowNull':![],'defaultValue':_0xe5da('0x5')},'fontSize':{'type':Sequelize[_0xe5da('0x6')](0x2)[_0xe5da('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xe5da('0x4')],'defaultValue':function(){return _0xe5da('0x8');}},'notificationSound':{'type':Sequelize[_0xe5da('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe5da('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe5da('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe5da('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe5da('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe5da('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe5da('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xe5da('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xe5da('0x3')],'defaultValue':![],'comment':_0xe5da('0xa'),'set':function(_0x19143b){if(!_0x19143b)this[_0xe5da('0xb')](_0xe5da('0xc'),null);this[_0xe5da('0xb')](_0xe5da('0xd'),_0x19143b);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index f7d2192..94251f6 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 _0x2a8b=['pick','filter','merge','map','type','field','includeAll','include','MailAccount','findAll','rows','show','params','fields','options','find','body','Smtp','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','CannedAnswer','removeAnswers','ListId','isNil','active','cservice','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','order','CmContact','Contact','User','Owner','fullname','internal','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','getApplications','MailMessage','$gte','format','send','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','root','server/files/attachments','basename','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','auth','VerifySmtp','verifySmtp','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./mailAccount.socket','register','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','stack','name','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','rawAttributes','model','keys','query','filters','intersection','attributes','length','nolimit','sort','where'];(function(_0x3050b5,_0x182c6a){var _0x37cceb=function(_0x49b797){while(--_0x49b797){_0x3050b5['push'](_0x3050b5['shift']());}};_0x37cceb(++_0x182c6a);}(_0x2a8b,0x1e4));var _0xb2a8=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x2a8b[_0x1e7b16];return _0x37fadc;};'use strict';var pdf=require(_0xb2a8('0x0'));var emlformat=require(_0xb2a8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb2a8('0x2'));var jsonpatch=require(_0xb2a8('0x3'));var rp=require(_0xb2a8('0x4'));var moment=require(_0xb2a8('0x5'));var BPromise=require(_0xb2a8('0x6'));var Mustache=require(_0xb2a8('0x7'));var util=require(_0xb2a8('0x8'));var path=require(_0xb2a8('0x9'));var sox=require(_0xb2a8('0xa'));var csv=require('to-csv');var ejs=require(_0xb2a8('0xb'));var fs=require('fs');var _=require(_0xb2a8('0xc'));var squel=require(_0xb2a8('0xd'));var crypto=require(_0xb2a8('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb2a8('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xb2a8('0x10'));var qs=require(_0xb2a8('0x11'));var logger=require(_0xb2a8('0x12'))(_0xb2a8('0x13'));var utils=require(_0xb2a8('0x14'));var config=require(_0xb2a8('0x15'));var db=require(_0xb2a8('0x16'))['db'];config['redis']=_[_0xb2a8('0x17')](config[_0xb2a8('0x18')],{'host':_0xb2a8('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb2a8('0x18')]));require(_0xb2a8('0x1a'))[_0xb2a8('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb2a8('0x1c')][_0xb2a8('0x1d')]({'port':0x232b});function respondWithRpcPromise(_0x19981e,_0xeca901,_0x4afe7e,_0x1e0f2f){return new BPromise(function(_0xfe9078,_0x1319d5){var _0x223b9a=_0x1e0f2f||client;return _0x223b9a[_0xb2a8('0x1e')](_0x19981e,_0x4afe7e)[_0xb2a8('0x1f')](function(_0x40ad5c){logger['info'](_0xb2a8('0x20'),_0xeca901,_0xb2a8('0x21'));logger[_0xb2a8('0x22')]('MailAccount,\x20%s,\x20%s,\x20%s',_0xeca901,_0xb2a8('0x21'),JSON[_0xb2a8('0x23')](_0x40ad5c));if(_0x40ad5c[_0xb2a8('0x24')]){if(_0x40ad5c['error'][_0xb2a8('0x25')]===0x1f4){logger[_0xb2a8('0x24')]('MailAccount,\x20%s,\x20%s',_0xeca901,_0x40ad5c['error'][_0xb2a8('0x26')]);return _0x1319d5(_0x40ad5c[_0xb2a8('0x24')][_0xb2a8('0x26')]);}logger[_0xb2a8('0x24')](_0xb2a8('0x20'),_0xeca901,_0x40ad5c['error'][_0xb2a8('0x26')]);return _0xfe9078(_0x40ad5c[_0xb2a8('0x24')][_0xb2a8('0x26')]);}else{logger[_0xb2a8('0x27')]('MailAccount,\x20%s,\x20%s',_0xeca901,_0xb2a8('0x21'));_0xfe9078(_0x40ad5c[_0xb2a8('0x28')][_0xb2a8('0x26')]);}})[_0xb2a8('0x29')](function(_0x185388){logger[_0xb2a8('0x24')](_0xb2a8('0x20'),_0xeca901,_0x185388);_0x1319d5(_0x185388);});});}function respondWithStatusCode(_0x23be5d,_0x123bc0){_0x123bc0=_0x123bc0||0xcc;return function(_0x5947bf){if(_0x5947bf){return _0x23be5d[_0xb2a8('0x2a')](_0x123bc0);}return _0x23be5d[_0xb2a8('0x2b')](_0x123bc0)[_0xb2a8('0x2c')]();};}function respondWithResult(_0x197394,_0x20245b){_0x20245b=_0x20245b||0xc8;return function(_0x408c05){if(_0x408c05){return _0x197394[_0xb2a8('0x2b')](_0x20245b)['json'](_0x408c05);}};}function respondWithFilteredResult(_0x384f40,_0x4b5534){return function(_0x406405){if(_0x406405){var _0x3de085=_0x406405[_0xb2a8('0x2d')],_0x2c815f=_0x4b5534[_0xb2a8('0x2e')],_0x2d7407=_0x4b5534[_0xb2a8('0x2e')]+_0x4b5534[_0xb2a8('0x2f')],_0x2490f1;if(_0x2d7407>=_0x3de085){_0x2d7407=_0x3de085;_0x2490f1=0xc8;}else{_0x2490f1=0xce;}_0x384f40['status'](_0x2490f1);return _0x384f40['set'](_0xb2a8('0x30'),_0x2c815f+'-'+_0x2d7407+'/'+_0x3de085)[_0xb2a8('0x31')](_0x406405);}return null;};}function patchUpdates(_0x1d86ce){return function(_0x5ae7fc){try{jsonpatch[_0xb2a8('0x32')](_0x5ae7fc,_0x1d86ce,!![]);}catch(_0x453701){return BPromise[_0xb2a8('0x33')](_0x453701);}return _0x5ae7fc[_0xb2a8('0x34')]();};}function saveUpdates(_0x877a1,_0x30dbfd){return function(_0x5bc916){if(_0x5bc916){return _0x5bc916[_0xb2a8('0x35')](_0x877a1)[_0xb2a8('0x1f')](function(_0x48b1d3){return _0x48b1d3;});}return null;};}function removeEntity(_0x242a41,_0x3d2d87){return function(_0x45c01d){if(_0x45c01d){return _0x45c01d[_0xb2a8('0x36')]()[_0xb2a8('0x1f')](function(){var _0x5f4039=_0x45c01d[_0xb2a8('0x37')]({'plain':!![]});var _0x54a345=_0xb2a8('0x38');return db[_0xb2a8('0x39')][_0xb2a8('0x36')]({'where':{'type':_0x54a345,'resourceId':_0x5f4039['id']}})[_0xb2a8('0x1f')](function(){return _0x45c01d;});})['then'](function(){_0x242a41['status'](0xcc)[_0xb2a8('0x2c')]();});}};}function handleEntityNotFound(_0x2feed5,_0x814cfe){return function(_0x3e625e){if(!_0x3e625e){_0x2feed5[_0xb2a8('0x2a')](0x194);}return _0x3e625e;};}function handleError(_0xa8fc63,_0x43a13c){_0x43a13c=_0x43a13c||0x1f4;return function(_0x5adfae){logger[_0xb2a8('0x24')](_0x5adfae[_0xb2a8('0x3a')]);if(_0x5adfae[_0xb2a8('0x3b')]){delete _0x5adfae[_0xb2a8('0x3b')];}_0xa8fc63[_0xb2a8('0x2b')](_0x43a13c)['send'](_0x5adfae);};}exports[_0xb2a8('0x3c')]=function(_0x511bf7,_0x3afc8d){var _0x4736f6={'include':[{'model':db[_0xb2a8('0x3d')],'as':_0xb2a8('0x3e')},{'model':db[_0xb2a8('0x3f')],'as':'Smtp'},{'model':db[_0xb2a8('0x40')],'as':_0xb2a8('0x41')}]},_0x37a0ca={},_0x11dfbd={'count':0x0,'rows':[]};var _0xd1ba01=db['MailAccount'][_0xb2a8('0x42')];_0x37a0ca[_0xb2a8('0x43')]=_[_0xb2a8('0x44')](_0xd1ba01);_0x37a0ca[_0xb2a8('0x45')]=_[_0xb2a8('0x44')](_0x511bf7['query']);_0x37a0ca[_0xb2a8('0x46')]=_[_0xb2a8('0x47')](_0x37a0ca[_0xb2a8('0x43')],_0x37a0ca['query']);_0x4736f6['attributes']=_[_0xb2a8('0x47')](_0x37a0ca[_0xb2a8('0x43')],qs['fields'](_0x511bf7[_0xb2a8('0x45')]['fields']));_0x4736f6['attributes']=_0x4736f6[_0xb2a8('0x48')][_0xb2a8('0x49')]?_0x4736f6[_0xb2a8('0x48')]:_0x37a0ca[_0xb2a8('0x43')];if(!_0x511bf7[_0xb2a8('0x45')]['hasOwnProperty'](_0xb2a8('0x4a'))){_0x4736f6['limit']=qs['limit'](_0x511bf7[_0xb2a8('0x45')]['limit']);_0x4736f6[_0xb2a8('0x2e')]=qs[_0xb2a8('0x2e')](_0x511bf7[_0xb2a8('0x45')][_0xb2a8('0x2e')]);}_0x4736f6['order']=qs[_0xb2a8('0x4b')](_0x511bf7[_0xb2a8('0x45')][_0xb2a8('0x4b')]);_0x4736f6[_0xb2a8('0x4c')]=qs[_0xb2a8('0x46')](_[_0xb2a8('0x4d')](_0x511bf7['query'],_0x37a0ca[_0xb2a8('0x46')]));if(_0x511bf7['query'][_0xb2a8('0x4e')]){_0x4736f6[_0xb2a8('0x4c')]=_[_0xb2a8('0x4f')](_0x4736f6[_0xb2a8('0x4c')],{'$or':_[_0xb2a8('0x50')](_0xd1ba01,function(_0x4c88df){if(_0x4c88df[_0xb2a8('0x51')]['key']!=='VIRTUAL'){var _0x5e72cc={};_0x5e72cc[_0x4c88df[_0xb2a8('0x52')]]={'$like':'%'+_0x511bf7[_0xb2a8('0x45')][_0xb2a8('0x4e')]+'%'};return _0x5e72cc;}})});}_0x4736f6=_['merge']({},_0x4736f6,_0x511bf7['options']);var _0x1818f8={'where':_0x4736f6[_0xb2a8('0x4c')]};return db['MailAccount'][_0xb2a8('0x2d')](_0x1818f8)[_0xb2a8('0x1f')](function(_0xdf6d3f){_0x11dfbd[_0xb2a8('0x2d')]=_0xdf6d3f;if(_0x511bf7[_0xb2a8('0x45')][_0xb2a8('0x53')]){_0x4736f6[_0xb2a8('0x54')]=[{'all':!![]}];}return db[_0xb2a8('0x55')][_0xb2a8('0x56')](_0x4736f6);})['then'](function(_0x279522){_0x11dfbd[_0xb2a8('0x57')]=_0x279522;return _0x11dfbd;})[_0xb2a8('0x1f')](respondWithFilteredResult(_0x3afc8d,_0x4736f6))[_0xb2a8('0x29')](handleError(_0x3afc8d,null));};exports[_0xb2a8('0x58')]=function(_0x2fcd05,_0x5d81ed){var _0x3e7fa8={'raw':![],'where':{'id':_0x2fcd05[_0xb2a8('0x59')]['id']},'include':[{'model':db[_0xb2a8('0x3d')],'as':_0xb2a8('0x3e')},{'model':db[_0xb2a8('0x3f')],'as':'Smtp'},{'model':db[_0xb2a8('0x40')],'as':'mandatoryDispositionPause'}]},_0x12e6b0={};_0x12e6b0['model']=_['keys'](db[_0xb2a8('0x55')][_0xb2a8('0x42')]);_0x12e6b0[_0xb2a8('0x45')]=_['keys'](_0x2fcd05[_0xb2a8('0x45')]);_0x12e6b0['filters']=_[_0xb2a8('0x47')](_0x12e6b0[_0xb2a8('0x43')],_0x12e6b0[_0xb2a8('0x45')]);_0x3e7fa8[_0xb2a8('0x48')]=_[_0xb2a8('0x47')](_0x12e6b0['model'],qs[_0xb2a8('0x5a')](_0x2fcd05[_0xb2a8('0x45')]['fields']));_0x3e7fa8['attributes']=_0x3e7fa8[_0xb2a8('0x48')][_0xb2a8('0x49')]?_0x3e7fa8[_0xb2a8('0x48')]:_0x12e6b0[_0xb2a8('0x43')];if(_0x2fcd05[_0xb2a8('0x45')][_0xb2a8('0x53')]){_0x3e7fa8[_0xb2a8('0x54')]=[{'all':!![]}];}_0x3e7fa8=_['merge']({},_0x3e7fa8,_0x2fcd05[_0xb2a8('0x5b')]);return db[_0xb2a8('0x55')][_0xb2a8('0x5c')](_0x3e7fa8)['then'](handleEntityNotFound(_0x5d81ed,null))[_0xb2a8('0x1f')](respondWithResult(_0x5d81ed,null))[_0xb2a8('0x29')](handleError(_0x5d81ed,null));};exports[_0xb2a8('0x35')]=function(_0x5ae8ee,_0x32135b){if(_0x5ae8ee[_0xb2a8('0x5d')]['id']){delete _0x5ae8ee['body']['id'];}return db[_0xb2a8('0x55')][_0xb2a8('0x5c')]({'where':{'id':_0x5ae8ee['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xb2a8('0x3e')},{'model':db['MailServerOut'],'as':_0xb2a8('0x5e')},{'model':db[_0xb2a8('0x40')],'as':'mandatoryDispositionPause'}]})[_0xb2a8('0x1f')](handleEntityNotFound(_0x32135b,null))[_0xb2a8('0x1f')](saveUpdates(_0x5ae8ee[_0xb2a8('0x5d')],null))['then'](function(_0x1d0c34){if(_0x1d0c34&&_0x5ae8ee['body'][_0xb2a8('0x3e')]){return db['MailServerIn'][_0xb2a8('0x35')](_0x5ae8ee[_0xb2a8('0x5d')][_0xb2a8('0x3e')],{'where':{'MailAccountId':_0x1d0c34['id']}})[_0xb2a8('0x1f')](function(){return _0x1d0c34;});}return _0x1d0c34;})[_0xb2a8('0x1f')](function(_0x508fbb){if(_0x508fbb&&_0x5ae8ee['body']['Smtp']){return db[_0xb2a8('0x3f')][_0xb2a8('0x35')](_0x5ae8ee['body'][_0xb2a8('0x5e')],{'where':{'MailAccountId':_0x508fbb['id']}})[_0xb2a8('0x1f')](function(){return _0x508fbb;});}return _0x508fbb;})[_0xb2a8('0x1f')](function(_0x4bbe20){if(_0x4bbe20&&_0x5ae8ee[_0xb2a8('0x5d')][_0xb2a8('0x41')]){return db[_0xb2a8('0x40')][_0xb2a8('0x35')](_0x5ae8ee[_0xb2a8('0x5d')][_0xb2a8('0x41')],{'where':{'MailAccountId':_0x4bbe20['id']}})[_0xb2a8('0x1f')](function(){return _0x4bbe20;});}return _0x4bbe20;})['then'](respondWithResult(_0x32135b,null))[_0xb2a8('0x29')](handleError(_0x32135b,null));};exports[_0xb2a8('0x5f')]=function(_0x3d9238,_0x2ba9ab){return db[_0xb2a8('0x55')]['describe']()[_0xb2a8('0x1f')](respondWithResult(_0x2ba9ab,null))['catch'](handleError(_0x2ba9ab,null));};exports[_0xb2a8('0x60')]=function(_0x58a577,_0xeced89,_0x179467){if(_0x58a577[_0xb2a8('0x5d')]['id']){delete _0x58a577[_0xb2a8('0x5d')]['id'];}return db[_0xb2a8('0x55')][_0xb2a8('0x5c')]({'where':{'id':_0x58a577[_0xb2a8('0x59')]['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0xeced89,null))['then'](function(_0x779e5e){if(_0x779e5e){_0x58a577['body'][_0xb2a8('0x61')]=_0x779e5e['id'];return db[_0xb2a8('0x62')][_0xb2a8('0x63')](_0x58a577[_0xb2a8('0x5d')]);}})[_0xb2a8('0x1f')](respondWithResult(_0xeced89,null))[_0xb2a8('0x29')](handleError(_0xeced89,null));};exports[_0xb2a8('0x64')]=function(_0x22b296,_0x562451,_0x1733c7){var _0x4fad88={'raw':![],'where':{}};var _0x14127d={};var _0x1dbabd={'count':0x0,'rows':[]};return db[_0xb2a8('0x55')][_0xb2a8('0x65')]({'where':{'id':_0x22b296[_0xb2a8('0x59')]['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0x562451,null))[_0xb2a8('0x1f')](function(_0x2f9aa5){if(_0x2f9aa5){_0x14127d[_0xb2a8('0x43')]=_[_0xb2a8('0x44')](db['Disposition'][_0xb2a8('0x42')]);_0x14127d[_0xb2a8('0x45')]=_[_0xb2a8('0x44')](_0x22b296[_0xb2a8('0x45')]);_0x14127d[_0xb2a8('0x46')]=_[_0xb2a8('0x47')](_0x14127d[_0xb2a8('0x43')],_0x14127d[_0xb2a8('0x45')]);_0x4fad88[_0xb2a8('0x48')]=_[_0xb2a8('0x47')](_0x14127d[_0xb2a8('0x43')],qs[_0xb2a8('0x5a')](_0x22b296['query'][_0xb2a8('0x5a')]));_0x4fad88[_0xb2a8('0x48')]=_0x4fad88['attributes']['length']?_0x4fad88[_0xb2a8('0x48')]:_0x14127d[_0xb2a8('0x43')];if(!_0x22b296[_0xb2a8('0x45')][_0xb2a8('0x66')](_0xb2a8('0x4a'))){_0x4fad88['limit']=qs[_0xb2a8('0x2f')](_0x22b296[_0xb2a8('0x45')]['limit']);_0x4fad88['offset']=qs[_0xb2a8('0x2e')](_0x22b296[_0xb2a8('0x45')][_0xb2a8('0x2e')]);}_0x4fad88['order']=qs[_0xb2a8('0x4b')](_0x22b296[_0xb2a8('0x45')][_0xb2a8('0x4b')]);_0x4fad88[_0xb2a8('0x4c')]=qs[_0xb2a8('0x46')](_[_0xb2a8('0x4d')](_0x22b296[_0xb2a8('0x45')],_0x14127d[_0xb2a8('0x46')]));_0x4fad88['where']['MailAccountId']=_0x2f9aa5['id'];if(_0x22b296['query'][_0xb2a8('0x4e')]){_0x4fad88[_0xb2a8('0x4c')]=_[_0xb2a8('0x4f')](_0x4fad88['where'],{'$or':_[_0xb2a8('0x50')](_0x4fad88['attributes'],function(_0x1b6d9a){var _0x5299d5={};_0x5299d5[_0x1b6d9a]={'$like':'%'+_0x22b296[_0xb2a8('0x45')][_0xb2a8('0x4e')]+'%'};return _0x5299d5;})});}_0x4fad88=_[_0xb2a8('0x4f')]({},_0x4fad88,_0x22b296[_0xb2a8('0x5b')]);return db[_0xb2a8('0x62')][_0xb2a8('0x2d')]({'where':_0x4fad88['where']})['then'](function(_0x481d0d){_0x1dbabd[_0xb2a8('0x2d')]=_0x481d0d;if(_0x22b296[_0xb2a8('0x45')]['includeAll']){_0x4fad88[_0xb2a8('0x54')]=[{'all':!![]}];}return db[_0xb2a8('0x62')][_0xb2a8('0x56')](_0x4fad88);})[_0xb2a8('0x1f')](function(_0x2de71c){_0x1dbabd[_0xb2a8('0x57')]=_0x2de71c;return _0x1dbabd;});}})[_0xb2a8('0x1f')](respondWithFilteredResult(_0x562451,_0x4fad88))[_0xb2a8('0x29')](handleError(_0x562451,null));};exports[_0xb2a8('0x67')]=function(_0x554e6a,_0xee7817,_0x4dbcb8){var _0x837e2b;return db[_0xb2a8('0x55')][_0xb2a8('0x5c')]({'where':{'id':_0x554e6a[_0xb2a8('0x59')]['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0xee7817,null))[_0xb2a8('0x1f')](function(_0x2860d3){if(_0x2860d3){return _0x2860d3[_0xb2a8('0x67')](_0x554e6a[_0xb2a8('0x45')][_0xb2a8('0x68')]);}})['then'](respondWithStatusCode(_0xee7817,null))['catch'](handleError(_0xee7817,null));};exports['addAnswer']=function(_0xb61b91,_0x42ab24,_0x3394ea){if(_0xb61b91[_0xb2a8('0x5d')]['id']){delete _0xb61b91[_0xb2a8('0x5d')]['id'];}return db[_0xb2a8('0x55')][_0xb2a8('0x5c')]({'where':{'id':_0xb61b91[_0xb2a8('0x59')]['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0x42ab24,null))[_0xb2a8('0x1f')](function(_0x5d6058){if(_0x5d6058){_0xb61b91[_0xb2a8('0x5d')][_0xb2a8('0x61')]=_0x5d6058['id'];return db[_0xb2a8('0x69')][_0xb2a8('0x63')](_0xb61b91[_0xb2a8('0x5d')]);}})['then'](respondWithResult(_0x42ab24,null))[_0xb2a8('0x29')](handleError(_0x42ab24,null));};exports['getAnswers']=function(_0x51db76,_0x2a3b7e,_0x179ea7){var _0x1f487a={'raw':![],'where':{}};var _0x3d3564={};var _0x1f431d={'count':0x0,'rows':[]};return db[_0xb2a8('0x55')]['findOne']({'where':{'id':_0x51db76[_0xb2a8('0x59')]['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0x2a3b7e,null))['then'](function(_0x16069e){if(_0x16069e){_0x3d3564[_0xb2a8('0x43')]=_[_0xb2a8('0x44')](db[_0xb2a8('0x69')][_0xb2a8('0x42')]);_0x3d3564[_0xb2a8('0x45')]=_[_0xb2a8('0x44')](_0x51db76[_0xb2a8('0x45')]);_0x3d3564[_0xb2a8('0x46')]=_[_0xb2a8('0x47')](_0x3d3564['model'],_0x3d3564['query']);_0x1f487a[_0xb2a8('0x48')]=_[_0xb2a8('0x47')](_0x3d3564['model'],qs[_0xb2a8('0x5a')](_0x51db76[_0xb2a8('0x45')][_0xb2a8('0x5a')]));_0x1f487a[_0xb2a8('0x48')]=_0x1f487a[_0xb2a8('0x48')][_0xb2a8('0x49')]?_0x1f487a[_0xb2a8('0x48')]:_0x3d3564['model'];if(!_0x51db76['query'][_0xb2a8('0x66')](_0xb2a8('0x4a'))){_0x1f487a[_0xb2a8('0x2f')]=qs[_0xb2a8('0x2f')](_0x51db76[_0xb2a8('0x45')]['limit']);_0x1f487a[_0xb2a8('0x2e')]=qs[_0xb2a8('0x2e')](_0x51db76['query']['offset']);}_0x1f487a['order']=qs[_0xb2a8('0x4b')](_0x51db76['query']['sort']);_0x1f487a[_0xb2a8('0x4c')]=qs[_0xb2a8('0x46')](_[_0xb2a8('0x4d')](_0x51db76[_0xb2a8('0x45')],_0x3d3564['filters']));_0x1f487a['where']['MailAccountId']=_0x16069e['id'];if(_0x51db76['query'][_0xb2a8('0x4e')]){_0x1f487a[_0xb2a8('0x4c')]=_[_0xb2a8('0x4f')](_0x1f487a['where'],{'$or':_[_0xb2a8('0x50')](_0x1f487a[_0xb2a8('0x48')],function(_0x4c30b8){var _0x24ba22={};_0x24ba22[_0x4c30b8]={'$like':'%'+_0x51db76[_0xb2a8('0x45')][_0xb2a8('0x4e')]+'%'};return _0x24ba22;})});}_0x1f487a=_[_0xb2a8('0x4f')]({},_0x1f487a,_0x51db76[_0xb2a8('0x5b')]);return db['CannedAnswer']['count']({'where':_0x1f487a[_0xb2a8('0x4c')]})[_0xb2a8('0x1f')](function(_0x9648a6){_0x1f431d[_0xb2a8('0x2d')]=_0x9648a6;if(_0x51db76['query'][_0xb2a8('0x53')]){_0x1f487a[_0xb2a8('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb2a8('0x56')](_0x1f487a);})[_0xb2a8('0x1f')](function(_0x3e7a3b){_0x1f431d[_0xb2a8('0x57')]=_0x3e7a3b;return _0x1f431d;});}})['then'](respondWithFilteredResult(_0x2a3b7e,_0x1f487a))[_0xb2a8('0x29')](handleError(_0x2a3b7e,null));};exports[_0xb2a8('0x6a')]=function(_0x381e8e,_0x34a5b3,_0x2590ac){var _0x108523;return db[_0xb2a8('0x55')][_0xb2a8('0x5c')]({'where':{'id':_0x381e8e[_0xb2a8('0x59')]['id']}})['then'](handleEntityNotFound(_0x34a5b3,null))[_0xb2a8('0x1f')](function(_0x504491){if(_0x504491){return _0x504491['removeAnswers'](_0x381e8e[_0xb2a8('0x45')]['ids']);}})[_0xb2a8('0x1f')](respondWithStatusCode(_0x34a5b3,null))[_0xb2a8('0x29')](handleError(_0x34a5b3,null));};exports[_0xb2a8('0x63')]=function(_0xf588f3,_0x19198a){var _0x2866f5={'name':_0xf588f3[_0xb2a8('0x5d')][_0xb2a8('0x3b')],'key':_0xf588f3['body']['key'],'email':_0xf588f3['body']['email'],'ListId':_0xf588f3[_0xb2a8('0x5d')][_0xb2a8('0x6b')],'active':!_[_0xb2a8('0x6c')](_0xf588f3[_0xb2a8('0x5d')]['active'])?_0xf588f3[_0xb2a8('0x5d')][_0xb2a8('0x6d')]:!![],'description':_0xf588f3[_0xb2a8('0x5d')]['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0xf588f3[_0xb2a8('0x5d')][_0xb2a8('0x6e')])){if(_0xf588f3[_0xb2a8('0x5d')]['cauthentication']){_0x2866f5[_0xb2a8('0x3e')][_0xb2a8('0x6f')]=_0x2866f5['Smtp']['user']=_0xf588f3[_0xb2a8('0x5d')][_0xb2a8('0x70')];_0x2866f5[_0xb2a8('0x3e')][_0xb2a8('0x71')]=_0x2866f5[_0xb2a8('0x5e')][_0xb2a8('0x72')]=_0xf588f3[_0xb2a8('0x5d')][_0xb2a8('0x73')];}else{_0x2866f5[_0xb2a8('0x3e')][_0xb2a8('0x74')]=_0x2866f5[_0xb2a8('0x5e')][_0xb2a8('0x74')]=![];}_0x2866f5['Imap'][_0xb2a8('0x75')]=_0xf588f3[_0xb2a8('0x5d')][_0xb2a8('0x3e')][_0xb2a8('0x75')];_0x2866f5['Imap'][_0xb2a8('0x76')]=_0xf588f3[_0xb2a8('0x5d')][_0xb2a8('0x3e')]['port'];_0x2866f5[_0xb2a8('0x5e')]['host']=_0xf588f3[_0xb2a8('0x5d')][_0xb2a8('0x5e')][_0xb2a8('0x75')];_0x2866f5[_0xb2a8('0x5e')][_0xb2a8('0x76')]=_0xf588f3['body'][_0xb2a8('0x5e')][_0xb2a8('0x76')];}else{_0x2866f5[_0xb2a8('0x3e')]['service']=_0x2866f5[_0xb2a8('0x5e')][_0xb2a8('0x77')]=_0xf588f3[_0xb2a8('0x5d')]['cservice'];_0x2866f5[_0xb2a8('0x3e')][_0xb2a8('0x6f')]=_0x2866f5[_0xb2a8('0x5e')][_0xb2a8('0x6f')]=_0xf588f3[_0xb2a8('0x5d')]['cuser'];_0x2866f5['Imap'][_0xb2a8('0x71')]=_0x2866f5[_0xb2a8('0x5e')]['pass']=_0xf588f3[_0xb2a8('0x5d')]['cpassword'];}return db[_0xb2a8('0x55')][_0xb2a8('0x63')](_0x2866f5,{'include':[{'model':db[_0xb2a8('0x3f')],'as':_0xb2a8('0x5e')},{'model':db[_0xb2a8('0x3d')],'as':_0xb2a8('0x3e')}]})[_0xb2a8('0x1f')](function(_0x34b1a0){var _0x4ecf9e=_0xf588f3[_0xb2a8('0x6f')]['get']({'plain':!![]});if(!_0x4ecf9e)throw new Error(_0xb2a8('0x78'));if(_0x4ecf9e[_0xb2a8('0x79')]===_0xb2a8('0x6f')){var _0x3dbc47=_0x34b1a0[_0xb2a8('0x37')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MailAccounts','userProfileId':_0x4ecf9e[_0xb2a8('0x7a')]},'raw':!![]})[_0xb2a8('0x1f')](function(_0x7eb7ff){if(_0x7eb7ff&&_0x7eb7ff[_0xb2a8('0x7b')]===0x0){return db[_0xb2a8('0x39')][_0xb2a8('0x63')]({'name':_0x3dbc47[_0xb2a8('0x3b')],'resourceId':_0x3dbc47['id'],'type':_0x7eb7ff[_0xb2a8('0x3b')],'sectionId':_0x7eb7ff['id']},{})[_0xb2a8('0x1f')](function(){return _0x34b1a0;});}else{return _0x34b1a0;}})['catch'](function(_0xb06e88){logger[_0xb2a8('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb06e88);throw _0xb06e88;});}return _0x34b1a0;})[_0xb2a8('0x1f')](respondWithResult(_0x19198a,0xc9))[_0xb2a8('0x29')](handleError(_0x19198a,null));};exports['getImap']=function(_0x1b429b,_0x3703e4,_0x1751af){return db[_0xb2a8('0x55')]['findOne']({'where':{'id':_0x1b429b[_0xb2a8('0x59')]['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0x3703e4,null))[_0xb2a8('0x1f')](function(_0xf09686){if(_0xf09686){return _0xf09686[_0xb2a8('0x7c')]();}return null;})[_0xb2a8('0x1f')](respondWithResult(_0x3703e4,null))[_0xb2a8('0x29')](handleError(_0x3703e4,null));};exports[_0xb2a8('0x7d')]=function(_0x24ebbd,_0x1f0cc0,_0x175db4){if(_0x24ebbd[_0xb2a8('0x5d')]['id']){delete _0x24ebbd[_0xb2a8('0x5d')]['id'];}return db[_0xb2a8('0x55')]['find']({'where':{'id':_0x24ebbd[_0xb2a8('0x59')]['id']}})['then'](handleEntityNotFound(_0x1f0cc0,null))['then'](function(_0x3469d3){if(_0x3469d3){_0x24ebbd[_0xb2a8('0x5d')][_0xb2a8('0x61')]=_0x3469d3['id'];return db[_0xb2a8('0x3d')][_0xb2a8('0x63')](_0x24ebbd[_0xb2a8('0x5d')]);}})['then'](respondWithResult(_0x1f0cc0,null))[_0xb2a8('0x29')](handleError(_0x1f0cc0,null));};exports[_0xb2a8('0x7e')]=function(_0x3f0515,_0x5a40da,_0x130582){return db[_0xb2a8('0x55')][_0xb2a8('0x65')]({'where':{'id':_0x3f0515['params']['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0x5a40da,null))['then'](function(_0x265db0){if(_0x265db0){return _0x265db0['setImap'](null);}return null;})[_0xb2a8('0x1f')](respondWithStatusCode(_0x5a40da,null))[_0xb2a8('0x29')](handleError(_0x5a40da,null));};exports[_0xb2a8('0x7f')]=function(_0x4c4a94,_0x44e795,_0x2638ae){return db['MailAccount']['findOne']({'where':{'id':_0x4c4a94['params']['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0x44e795,null))[_0xb2a8('0x1f')](function(_0x3db7d0){if(_0x3db7d0){return _0x3db7d0[_0xb2a8('0x7f')]();}return null;})['then'](respondWithResult(_0x44e795,null))['catch'](handleError(_0x44e795,null));};exports[_0xb2a8('0x80')]=function(_0x112aaf,_0x4deb60,_0x45a48d){if(_0x112aaf[_0xb2a8('0x5d')]['id']){delete _0x112aaf[_0xb2a8('0x5d')]['id'];}return db['MailAccount'][_0xb2a8('0x5c')]({'where':{'id':_0x112aaf['params']['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0x4deb60,null))[_0xb2a8('0x1f')](function(_0x16994f){if(_0x16994f){_0x112aaf[_0xb2a8('0x5d')]['MailAccountId']=_0x16994f['id'];return db[_0xb2a8('0x3f')][_0xb2a8('0x63')](_0x112aaf[_0xb2a8('0x5d')]);}})[_0xb2a8('0x1f')](respondWithResult(_0x4deb60,null))[_0xb2a8('0x29')](handleError(_0x4deb60,null));};exports[_0xb2a8('0x81')]=function(_0xa7d85a,_0x4d0ad5,_0x4066b3){return db[_0xb2a8('0x55')][_0xb2a8('0x65')]({'where':{'id':_0xa7d85a['params']['id']}})['then'](handleEntityNotFound(_0x4d0ad5,null))[_0xb2a8('0x1f')](function(_0x2964d0){if(_0x2964d0){return _0x2964d0[_0xb2a8('0x82')](null);}return null;})[_0xb2a8('0x1f')](respondWithStatusCode(_0x4d0ad5,null))[_0xb2a8('0x29')](handleError(_0x4d0ad5,null));};exports[_0xb2a8('0x83')]=function(_0x52feb5,_0x322b8e,_0x1f9328){return db[_0xb2a8('0x84')][_0xb2a8('0x5c')]({'where':{'id':_0x52feb5[_0xb2a8('0x59')]['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0x322b8e,null))['then'](function(_0x30f564){if(_0x30f564){return _0x30f564[_0xb2a8('0x83')](_0x52feb5[_0xb2a8('0x5d')][_0xb2a8('0x68')],_['omit'](_0x52feb5[_0xb2a8('0x5d')],['ids','id'])||{});}})[_0xb2a8('0x1f')](respondWithResult(_0x322b8e,null))['catch'](handleError(_0x322b8e,null));};exports[_0xb2a8('0x85')]=function(_0x27ef5b,_0x14e5d3,_0x4660d6){var _0x1368e2={'raw':![],'where':{}};var _0x119c4b={};var _0xce2d37={'count':0x0,'rows':[]};return db[_0xb2a8('0x55')][_0xb2a8('0x65')]({'where':{'id':_0x27ef5b[_0xb2a8('0x59')]['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0x14e5d3,null))[_0xb2a8('0x1f')](function(_0x327a5c){if(_0x327a5c){_0x119c4b[_0xb2a8('0x43')]=_[_0xb2a8('0x44')](db[_0xb2a8('0x84')][_0xb2a8('0x42')]);_0x119c4b[_0xb2a8('0x45')]=_[_0xb2a8('0x44')](_0x27ef5b[_0xb2a8('0x45')]);_0x119c4b[_0xb2a8('0x46')]=_[_0xb2a8('0x47')](_0x119c4b[_0xb2a8('0x43')],_0x119c4b[_0xb2a8('0x45')]);_0x1368e2[_0xb2a8('0x48')]=_['intersection'](_0x119c4b[_0xb2a8('0x43')],qs[_0xb2a8('0x5a')](_0x27ef5b[_0xb2a8('0x45')][_0xb2a8('0x5a')]));_0x1368e2[_0xb2a8('0x48')]=_0x1368e2[_0xb2a8('0x48')][_0xb2a8('0x49')]?_0x1368e2[_0xb2a8('0x48')]:_0x119c4b[_0xb2a8('0x43')];if(!_0x27ef5b['query']['hasOwnProperty'](_0xb2a8('0x4a'))){_0x1368e2[_0xb2a8('0x2f')]=qs[_0xb2a8('0x2f')](_0x27ef5b[_0xb2a8('0x45')][_0xb2a8('0x2f')]);_0x1368e2[_0xb2a8('0x2e')]=qs[_0xb2a8('0x2e')](_0x27ef5b[_0xb2a8('0x45')][_0xb2a8('0x2e')]);}_0x1368e2[_0xb2a8('0x86')]=qs['sort'](_0x27ef5b[_0xb2a8('0x45')][_0xb2a8('0x4b')]);_0x1368e2[_0xb2a8('0x4c')]=qs[_0xb2a8('0x46')](_[_0xb2a8('0x4d')](_0x27ef5b[_0xb2a8('0x45')],_0x119c4b[_0xb2a8('0x46')]));_0x1368e2[_0xb2a8('0x4c')][_0xb2a8('0x61')]=_0x327a5c['id'];if(_0x27ef5b[_0xb2a8('0x45')][_0xb2a8('0x4e')]){_0x1368e2[_0xb2a8('0x4c')]=_[_0xb2a8('0x4f')](_0x1368e2['where'],{'$or':_[_0xb2a8('0x50')](_0x1368e2[_0xb2a8('0x48')],function(_0x22b4a3){var _0x64fe58={};_0x64fe58[_0x22b4a3]={'$like':'%'+_0x27ef5b[_0xb2a8('0x45')][_0xb2a8('0x4e')]+'%'};return _0x64fe58;})});}_0x1368e2=_[_0xb2a8('0x4f')]({},_0x1368e2,_0x27ef5b[_0xb2a8('0x5b')]);return db[_0xb2a8('0x84')][_0xb2a8('0x2d')]({'where':_0x1368e2[_0xb2a8('0x4c')]})['then'](function(_0x3963fc){_0xce2d37[_0xb2a8('0x2d')]=_0x3963fc;if(_0x27ef5b[_0xb2a8('0x45')][_0xb2a8('0x53')]){_0x1368e2['include']=[{'model':db[_0xb2a8('0x87')],'as':_0xb2a8('0x88'),'required':![]},{'model':db[_0xb2a8('0x89')],'as':_0xb2a8('0x8a'),'attributes':[_0xb2a8('0x3b'),_0xb2a8('0x8b'),_0xb2a8('0x8c')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xb2a8('0x3b'),'color'],'where':_0x27ef5b[_0xb2a8('0x45')][_0xb2a8('0x8d')]?{'id':_0x27ef5b['query'][_0xb2a8('0x8d')]}:undefined,'required':_0x27ef5b['query'][_0xb2a8('0x8d')]?!![]:![]}];}return db[_0xb2a8('0x84')]['findAll'](_0x1368e2);})['then'](function(_0x3c4339){_0xce2d37[_0xb2a8('0x57')]=_0x3c4339;return _0xce2d37;});}})[_0xb2a8('0x1f')](respondWithFilteredResult(_0x14e5d3,_0x1368e2))[_0xb2a8('0x29')](handleError(_0x14e5d3,null));};exports[_0xb2a8('0x8e')]=function(_0x1b7314,_0xb944a9,_0x3d67d6){return db['MailAccount'][_0xb2a8('0x65')]({'where':{'id':_0x1b7314[_0xb2a8('0x59')]['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0xb944a9,null))['then'](function(_0x48b75f){if(_0x48b75f){return db[_0xb2a8('0x8f')][_0xb2a8('0x90')](function(_0x1ab651){return db[_0xb2a8('0x91')][_0xb2a8('0x36')]({'where':{'MailAccountId':_0x1b7314[_0xb2a8('0x59')]['id']},'transaction':_0x1ab651})[_0xb2a8('0x1f')](function(_0x40afc1){var _0x15493d=_['map'](_0x1b7314['body'],function(_0x4b686d){_0x4b686d['MailAccountId']=_0x1b7314[_0xb2a8('0x59')]['id'];return _0x4b686d;});return db[_0xb2a8('0x91')][_0xb2a8('0x92')](_0x15493d,{'transaction':_0x1ab651});});})[_0xb2a8('0x1f')](function(){return db[_0xb2a8('0x91')][_0xb2a8('0x93')]({'where':{'MailAccountId':_0x1b7314[_0xb2a8('0x59')]['id']},'order':'priority'});});}})[_0xb2a8('0x1f')](respondWithResult(_0xb944a9,null))['catch'](handleError(_0xb944a9,null));};exports[_0xb2a8('0x94')]=function(_0x3b40c9,_0x1ea089,_0x1c44c6){var _0x15d225={};var _0x9bc158={};var _0x2377a9;var _0x31e9eb;return db[_0xb2a8('0x55')][_0xb2a8('0x65')]({'where':{'id':_0x3b40c9[_0xb2a8('0x59')]['id']}})['then'](handleEntityNotFound(_0x1ea089,null))[_0xb2a8('0x1f')](function(_0x562ba3){if(_0x562ba3){_0x2377a9=_0x562ba3;_0x9bc158[_0xb2a8('0x43')]=_[_0xb2a8('0x44')](db[_0xb2a8('0x91')]['rawAttributes']);_0x9bc158['query']=_[_0xb2a8('0x44')](_0x3b40c9[_0xb2a8('0x45')]);_0x9bc158['filters']=_[_0xb2a8('0x47')](_0x9bc158[_0xb2a8('0x43')],_0x9bc158[_0xb2a8('0x45')]);_0x15d225['attributes']=_[_0xb2a8('0x47')](_0x9bc158[_0xb2a8('0x43')],qs[_0xb2a8('0x5a')](_0x3b40c9['query'][_0xb2a8('0x5a')]));_0x15d225[_0xb2a8('0x48')]=_0x15d225[_0xb2a8('0x48')][_0xb2a8('0x49')]?_0x15d225[_0xb2a8('0x48')]:_0x9bc158[_0xb2a8('0x43')];_0x15d225['order']=qs[_0xb2a8('0x4b')](_0x3b40c9[_0xb2a8('0x45')][_0xb2a8('0x4b')]);_0x15d225[_0xb2a8('0x4c')]=qs[_0xb2a8('0x46')](_['pick'](_0x3b40c9[_0xb2a8('0x45')],_0x9bc158[_0xb2a8('0x46')]));if(_0x3b40c9[_0xb2a8('0x45')][_0xb2a8('0x4e')]){_0x15d225['where']=_[_0xb2a8('0x4f')](_0x15d225['where'],{'$or':_[_0xb2a8('0x50')](_0x15d225[_0xb2a8('0x48')],function(_0x53a102){var _0x5d98e2={};_0x5d98e2[_0x53a102]={'$like':'%'+_0x3b40c9['query'][_0xb2a8('0x4e')]+'%'};return _0x5d98e2;})});}_0x15d225=_[_0xb2a8('0x4f')]({},_0x15d225,_0x3b40c9['options']);return _0x2377a9['getApplications'](_0x15d225);}})['then'](function(_0x4fae05){if(_0x4fae05){_0x31e9eb=_0x4fae05[_0xb2a8('0x49')];if(!_0x3b40c9[_0xb2a8('0x45')][_0xb2a8('0x66')](_0xb2a8('0x4a'))){_0x15d225[_0xb2a8('0x2f')]=qs[_0xb2a8('0x2f')](_0x3b40c9['query'][_0xb2a8('0x2f')]);_0x15d225[_0xb2a8('0x2e')]=qs['offset'](_0x3b40c9['query']['offset']);}return _0x2377a9[_0xb2a8('0x94')](_0x15d225);}})['then'](function(_0x4c08a0){if(_0x4c08a0){return _0x4c08a0?{'count':_0x31e9eb,'rows':_0x4c08a0}:null;}})['then'](respondWithResult(_0x1ea089,null))[_0xb2a8('0x29')](handleError(_0x1ea089,null));};exports['getMessages']=function(_0x2afce0,_0x156aaa,_0x22b080){var _0x2cda0b={'raw':!![],'where':{}};var _0x36e7f1={};var _0x445113={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x2afce0['params']['id']}})['then'](handleEntityNotFound(_0x156aaa,null))[_0xb2a8('0x1f')](function(_0x3232c8){if(_0x3232c8){_0x36e7f1['model']=_[_0xb2a8('0x44')](db[_0xb2a8('0x95')][_0xb2a8('0x42')]);_0x36e7f1[_0xb2a8('0x45')]=_[_0xb2a8('0x44')](_0x2afce0[_0xb2a8('0x45')]);_0x36e7f1['filters']=_[_0xb2a8('0x47')](_0x36e7f1[_0xb2a8('0x43')],_0x36e7f1[_0xb2a8('0x45')]);_0x2cda0b[_0xb2a8('0x48')]=_[_0xb2a8('0x47')](_0x36e7f1[_0xb2a8('0x43')],qs['fields'](_0x2afce0[_0xb2a8('0x45')]['fields']));_0x2cda0b[_0xb2a8('0x48')]=_0x2cda0b[_0xb2a8('0x48')][_0xb2a8('0x49')]?_0x2cda0b[_0xb2a8('0x48')]:_0x36e7f1['model'];if(!_0x2afce0['query'][_0xb2a8('0x66')](_0xb2a8('0x4a'))){_0x2cda0b[_0xb2a8('0x2f')]=qs[_0xb2a8('0x2f')](_0x2afce0['query'][_0xb2a8('0x2f')]);_0x2cda0b[_0xb2a8('0x2e')]=qs[_0xb2a8('0x2e')](_0x2afce0[_0xb2a8('0x45')][_0xb2a8('0x2e')]);}_0x2cda0b['order']=qs[_0xb2a8('0x4b')](_0x2afce0[_0xb2a8('0x45')]['sort']);_0x2cda0b[_0xb2a8('0x4c')]=qs[_0xb2a8('0x46')](_[_0xb2a8('0x4d')](_0x2afce0[_0xb2a8('0x45')],_0x36e7f1['filters']));_0x2cda0b[_0xb2a8('0x4c')][_0xb2a8('0x61')]=_0x3232c8['id'];if(_0x2afce0[_0xb2a8('0x45')]['filter']){_0x2cda0b[_0xb2a8('0x4c')]=_['merge'](_0x2cda0b[_0xb2a8('0x4c')],{'$or':_[_0xb2a8('0x50')](_0x2cda0b[_0xb2a8('0x48')],function(_0x328340){var _0x4a311b={};_0x4a311b[_0x328340]={'$like':'%'+_0x2afce0[_0xb2a8('0x45')][_0xb2a8('0x4e')]+'%'};return _0x4a311b;})});}if(_0x2afce0[_0xb2a8('0x45')][_0xb2a8('0x96')]){var _0x286b10=_0x2afce0[_0xb2a8('0x45')][_0xb2a8('0x96')]['split'](',');var _0x528a90={};_0x528a90[_0x286b10[0x0]]={'$gte':moment(_0x286b10[0x1])[_0xb2a8('0x97')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2cda0b[_0xb2a8('0x4c')]=_[_0xb2a8('0x4f')](_0x2cda0b[_0xb2a8('0x4c')],_0x528a90);}_0x2cda0b=_['merge']({},_0x2cda0b,_0x2afce0[_0xb2a8('0x5b')]);return db[_0xb2a8('0x95')][_0xb2a8('0x2d')]({'where':_0x2cda0b['where']})[_0xb2a8('0x1f')](function(_0x5d426a){_0x445113[_0xb2a8('0x2d')]=_0x5d426a;if(_0x2afce0[_0xb2a8('0x45')][_0xb2a8('0x53')]){_0x2cda0b[_0xb2a8('0x54')]=[{'all':!![]}];}return db[_0xb2a8('0x95')]['findAll'](_0x2cda0b);})[_0xb2a8('0x1f')](function(_0x5a6b60){_0x445113[_0xb2a8('0x57')]=_0x5a6b60;return _0x445113;});}})['then'](respondWithFilteredResult(_0x156aaa,_0x2cda0b))['catch'](handleError(_0x156aaa,null));};exports[_0xb2a8('0x98')]=function(_0x324e7b,_0x6941e4,_0x3c9230){var _0x23e2f9,_0x998315={},_0x4e3b3a;if(_0x324e7b['body']['to']){_0x4e3b3a=_0x324e7b[_0xb2a8('0x5d')]['to']['split'](',')[0x0];}return db[_0xb2a8('0x55')][_0xb2a8('0x5c')]({'where':{'id':_0x324e7b[_0xb2a8('0x59')]['id']},'include':[{'model':db[_0xb2a8('0x99')],'as':_0xb2a8('0x9a'),'include':[{'model':db['CmContact'],'as':_0xb2a8('0x9b'),'where':{'email':_0x4e3b3a},'limit':0x1,'order':[[_0xb2a8('0x9c'),_0xb2a8('0x9d')]]}]},{'model':db['MailServerOut'],'as':_0xb2a8('0x5e'),'raw':!![]}]})[_0xb2a8('0x1f')](handleEntityNotFound(_0x6941e4,null))['then'](function(_0x52d512){if(_0x52d512){_0x23e2f9=_0x52d512;if(_0x52d512['Smtp']){if(_['isNil'](_0x324e7b['body']['from'])){_0x324e7b[_0xb2a8('0x5d')][_0xb2a8('0x9e')]=util[_0xb2a8('0x97')](_0xb2a8('0x9f'),_0x52d512['name'],_0x52d512[_0xb2a8('0xa0')]||_0x52d512[_0xb2a8('0x5e')][_0xb2a8('0x6f')]);}if(_0x324e7b[_0xb2a8('0x5d')][_0xb2a8('0xa1')]&&_0x324e7b[_0xb2a8('0x5d')][_0xb2a8('0xa1')][_0xb2a8('0x49')]){for(var _0x163295=0x0;_0x163295<_0x324e7b['body']['attachments']['length'];_0x163295+=0x1){_0x324e7b[_0xb2a8('0x5d')]['attachments'][_0x163295]={'filename':_0x324e7b[_0xb2a8('0x5d')][_0xb2a8('0xa1')][_0x163295][_0xb2a8('0x3b')],'path':path['join'](config[_0xb2a8('0xa2')],_0xb2a8('0xa3'),_0x324e7b[_0xb2a8('0x5d')][_0xb2a8('0xa1')][_0x163295][_0xb2a8('0xa4')])};}}var _0x33cc99={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x52d512[_0xb2a8('0x5e')]['service'])){if(_0x52d512['Smtp'][_0xb2a8('0x74')]){_0x33cc99['auth']={'user':_0x52d512[_0xb2a8('0x5e')][_0xb2a8('0x6f')],'pass':_0x52d512[_0xb2a8('0x5e')][_0xb2a8('0x72')]};}_0x33cc99[_0xb2a8('0x75')]=_0x52d512[_0xb2a8('0x5e')][_0xb2a8('0x75')];_0x33cc99[_0xb2a8('0x76')]=_0x52d512[_0xb2a8('0x5e')][_0xb2a8('0x76')];_0x33cc99[_0xb2a8('0xa5')]=_0x52d512[_0xb2a8('0x5e')][_0xb2a8('0xa5')];}else{_0x33cc99[_0xb2a8('0x77')]=_0x52d512[_0xb2a8('0x5e')]['service'];_0x33cc99['auth']={'user':_0x52d512[_0xb2a8('0x5e')][_0xb2a8('0x6f')],'pass':_0x52d512[_0xb2a8('0x5e')]['pass']};}return respondWithRpcPromise(_0xb2a8('0xa6'),_0xb2a8('0xa7'),{'account':_0x33cc99,'message':_0x324e7b['body']});}else{throw new Error(_0xb2a8('0xa8'));}}})[_0xb2a8('0x1f')](function(_0xe91b54){if(_0xe91b54){_0x998315=_0xe91b54;if(_0x23e2f9[_0xb2a8('0x9a')]){if(_0x23e2f9[_0xb2a8('0x9a')][_0xb2a8('0x9b')][_0xb2a8('0x49')]){return _0x23e2f9[_0xb2a8('0x9a')][_0xb2a8('0x9b')][0x0];}else{return db[_0xb2a8('0x87')]['create'](_[_0xb2a8('0x17')](_0x324e7b['body'],{'firstName':_0x324e7b[_0xb2a8('0x5d')]['to'],'email':_0x324e7b[_0xb2a8('0x5d')]['to'],'phone':_0x324e7b[_0xb2a8('0x5d')]['to'],'ListId':_0x23e2f9['ListId']}));}}else{throw new Error(_0xb2a8('0xa8'));}}})['then'](function(_0x3259e1){if(_0x3259e1){var _0x4beb22={'UserId':_0x324e7b[_0xb2a8('0x6f')]['id'],'ContactId':_0x3259e1['id'],'MailAccountId':_0x23e2f9['id'],'inReplyTo':_0x998315[_0xb2a8('0xa9')],'to':_0x324e7b[_0xb2a8('0x5d')][_0xb2a8('0x9e')],'cc':_0x324e7b[_0xb2a8('0x5d')]['cc'],'subject':_0x324e7b[_0xb2a8('0x5d')][_0xb2a8('0xaa')],'attach':_0x324e7b[_0xb2a8('0x5d')][_0xb2a8('0xab')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xb2a8('0x97')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xb2a8('0xac'),'lastMsgBody':_0x324e7b['body'][_0xb2a8('0x5d')],'Messages':[_[_0xb2a8('0x4f')](_0x324e7b[_0xb2a8('0x5d')],{'messageId':_0x998315['messageId'],'sentAt':moment()[_0xb2a8('0x97')](_0xb2a8('0xad')),'read':!![],'MailAccountId':_0x23e2f9['id'],'UserId':_0x324e7b[_0xb2a8('0x6f')]['id'],'ContactId':_0x3259e1['id']})]};if(_0x324e7b[_0xb2a8('0x5d')]['Interaction']){_0x4beb22=_[_0xb2a8('0x4f')](_0x4beb22,_0x324e7b[_0xb2a8('0x5d')][_0xb2a8('0xae')]);}return db['MailInteraction'][_0xb2a8('0x63')](_0x4beb22,{'include':[{'model':db[_0xb2a8('0x95')],'as':'Messages'}]});}})['then'](respondWithResult(_0x6941e4,null))[_0xb2a8('0x29')](handleError(_0x6941e4,null));};exports['verifySmtp']=function(_0x171821,_0x50fb17,_0x5bb8bf){return db[_0xb2a8('0x55')]['find']({'where':{'id':_0x171821[_0xb2a8('0x59')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xb2a8('0x5e'),'raw':!![]}]})[_0xb2a8('0x1f')](handleEntityNotFound(_0x50fb17,null))[_0xb2a8('0x1f')](function(_0x2977f4){if(_0x2977f4&&_0x2977f4[_0xb2a8('0x5e')]){var _0x1a5b0a={'id':_0x2977f4['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2977f4[_0xb2a8('0x5e')]['service']){_0x1a5b0a[_0xb2a8('0x77')]=_0x2977f4['Smtp'][_0xb2a8('0x77')];}else{_0x1a5b0a[_0xb2a8('0x75')]=_0x2977f4[_0xb2a8('0x5e')][_0xb2a8('0x75')];_0x1a5b0a[_0xb2a8('0x76')]=_0x2977f4[_0xb2a8('0x5e')][_0xb2a8('0x76')];_0x1a5b0a[_0xb2a8('0xa5')]=_0x2977f4['Smtp'][_0xb2a8('0xa5')];}if(_0x2977f4['Smtp'][_0xb2a8('0x74')]){_0x1a5b0a[_0xb2a8('0xaf')]={'user':_0x2977f4[_0xb2a8('0x5e')][_0xb2a8('0x6f')],'pass':_0x2977f4[_0xb2a8('0x5e')][_0xb2a8('0x72')]};}return respondWithRpcPromise(_0xb2a8('0xb0'),_0xb2a8('0xb1'),{'account':_0x1a5b0a});}})[_0xb2a8('0x1f')](respondWithResult(_0x50fb17,null))[_0xb2a8('0x29')](handleError(_0x50fb17,null));};exports['destroy']=function(_0xcb0def,_0x4d43e7){return db[_0xb2a8('0x55')][_0xb2a8('0x5c')]({'where':{'id':_0xcb0def[_0xb2a8('0x59')]['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0x4d43e7,null))[_0xb2a8('0x1f')](function(_0x34d898){if(_0x34d898&&_0x34d898[_0xb2a8('0x77')]){throw new db['Sequelize'][(_0xb2a8('0xb2'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x34d898;})[_0xb2a8('0x1f')](removeEntity(_0x4d43e7,null))['catch'](handleError(_0x4d43e7,null));};exports[_0xb2a8('0xb3')]=function(_0x355fda,_0x52d71a,_0x54ad08){return db[_0xb2a8('0x55')][_0xb2a8('0x5c')]({'where':{'id':_0x355fda[_0xb2a8('0x59')]['id']}})['then'](handleEntityNotFound(_0x52d71a,null))[_0xb2a8('0x1f')](function(_0x4bf559){if(_0x4bf559){return _0x4bf559['addAgents'](_0x355fda[_0xb2a8('0x5d')][_0xb2a8('0x68')],_['omit'](_0x355fda[_0xb2a8('0x5d')],[_0xb2a8('0x68'),'id'])||{})[_0xb2a8('0xb4')](function(_0x43b148){for(var _0xd5d9c2=0x0;_0xd5d9c2<_0x355fda[_0xb2a8('0x5d')][_0xb2a8('0x68')][_0xb2a8('0x49')];_0xd5d9c2+=0x1){socket[_0xb2a8('0xb5')](_0xb2a8('0xb6'),{'UserId':_0x355fda['body']['ids'][_0xd5d9c2],'MailAccountId':_0x355fda[_0xb2a8('0x59')]['id']});}return _0x43b148;});}})[_0xb2a8('0x1f')](respondWithResult(_0x52d71a,null))[_0xb2a8('0x29')](handleError(_0x52d71a,null));};exports[_0xb2a8('0xb7')]=function(_0x1d92f2,_0x435551,_0x38ccd3){var _0x48ea16;return db[_0xb2a8('0x55')][_0xb2a8('0x5c')]({'where':{'id':_0x1d92f2[_0xb2a8('0x59')]['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0x435551,null))['then'](function(_0x5b49a2){if(_0x5b49a2){return _0x5b49a2[_0xb2a8('0xb7')](_0x1d92f2[_0xb2a8('0x45')][_0xb2a8('0x68')])['then'](function(_0x3275dc){if(_[_0xb2a8('0xb8')](_0x1d92f2[_0xb2a8('0x45')]['ids'])){for(var _0x103527=0x0;_0x103527<_0x1d92f2['query'][_0xb2a8('0x68')][_0xb2a8('0x49')];_0x103527+=0x1){socket['emit'](_0xb2a8('0xb9'),{'UserId':_0x1d92f2['query'][_0xb2a8('0x68')][_0x103527],'MailAccountId':_0x1d92f2[_0xb2a8('0x59')]['id']});}}else{socket[_0xb2a8('0xb5')](_0xb2a8('0xb9'),{'UserId':_0x1d92f2[_0xb2a8('0x45')][_0xb2a8('0x68')],'MailAccountId':_0x1d92f2[_0xb2a8('0x59')]['id']});}});}})[_0xb2a8('0x1f')](respondWithStatusCode(_0x435551,null))[_0xb2a8('0x29')](handleError(_0x435551,null));};exports['getAgents']=function(_0x3e28ad,_0x1f175a,_0x3a8e93){var _0x559586={};var _0x2740b9={};var _0x364095;var _0x2e94cb;return db[_0xb2a8('0x55')]['findOne']({'where':{'id':_0x3e28ad[_0xb2a8('0x59')]['id']}})[_0xb2a8('0x1f')](handleEntityNotFound(_0x1f175a,null))[_0xb2a8('0x1f')](function(_0xcf7540){if(_0xcf7540){_0x364095=_0xcf7540;_0x2740b9[_0xb2a8('0x43')]=_[_0xb2a8('0x44')](db['User']['rawAttributes']);_0x2740b9[_0xb2a8('0x45')]=_[_0xb2a8('0x44')](_0x3e28ad[_0xb2a8('0x45')]);_0x2740b9[_0xb2a8('0x46')]=_['intersection'](_0x2740b9[_0xb2a8('0x43')],_0x2740b9[_0xb2a8('0x45')]);_0x559586[_0xb2a8('0x48')]=_[_0xb2a8('0x47')](_0x2740b9[_0xb2a8('0x43')],qs['fields'](_0x3e28ad[_0xb2a8('0x45')][_0xb2a8('0x5a')]));_0x559586[_0xb2a8('0x48')]=_0x559586['attributes'][_0xb2a8('0x49')]?_0x559586[_0xb2a8('0x48')]:_0x2740b9[_0xb2a8('0x43')];_0x559586[_0xb2a8('0x86')]=qs[_0xb2a8('0x4b')](_0x3e28ad[_0xb2a8('0x45')][_0xb2a8('0x4b')]);_0x559586[_0xb2a8('0x4c')]=qs[_0xb2a8('0x46')](_['pick'](_0x3e28ad[_0xb2a8('0x45')],_0x2740b9['filters']));if(_0x3e28ad[_0xb2a8('0x45')][_0xb2a8('0x4e')]){_0x559586[_0xb2a8('0x4c')]=_[_0xb2a8('0x4f')](_0x559586[_0xb2a8('0x4c')],{'$or':_[_0xb2a8('0x50')](_0x559586['attributes'],function(_0x450932){var _0x4aaa61={};_0x4aaa61[_0x450932]={'$like':'%'+_0x3e28ad['query']['filter']+'%'};return _0x4aaa61;})});}_0x559586=_[_0xb2a8('0x4f')]({},_0x559586,_0x3e28ad['options']);return _0x364095[_0xb2a8('0xba')](_0x559586);}})[_0xb2a8('0x1f')](function(_0x1cfbd6){if(_0x1cfbd6){_0x2e94cb=_0x1cfbd6[_0xb2a8('0x49')];if(!_0x3e28ad[_0xb2a8('0x45')][_0xb2a8('0x66')]('nolimit')){_0x559586['limit']=qs['limit'](_0x3e28ad[_0xb2a8('0x45')][_0xb2a8('0x2f')]);_0x559586[_0xb2a8('0x2e')]=qs[_0xb2a8('0x2e')](_0x3e28ad[_0xb2a8('0x45')]['offset']);}return _0x364095['getAgents'](_0x559586);}})[_0xb2a8('0x1f')](function(_0xf8e34d){if(_0xf8e34d){return _0xf8e34d?{'count':_0x2e94cb,'rows':_0xf8e34d}:null;}})[_0xb2a8('0x1f')](respondWithResult(_0x1f175a,null))[_0xb2a8('0x29')](handleError(_0x1f175a,null));}; \ No newline at end of file +var _0x77af=['removeImap','getSmtp','addSmtp','setSmtp','MailInteraction','addInteraction','omit','CmContact','Contact','User','Owner','internal','Tag','Tags','tag','addApplications','bulkCreate','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','CmList','List','from','%s\x20<%s>','attachments','join','pass','secure','auth','SendMail','sendMail','List\x20not\x20found','Contacts','defaults','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','destroy','get','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','limit','sort','where','filters','pick','filter','merge','key','field','options','MailAccount','includeAll','include','findAll','rows','show','params','Pause','length','find','body','describe','addDisposition','MailAccountId','Disposition','create','findOne','nolimit','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','map','removeAnswers','email','ListId','isNil','active','description','user','cuser','password','cpassword','authentication','host','port','service','cservice','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap'];(function(_0x412d2,_0x44e6f0){var _0x29b402=function(_0x1a67e1){while(--_0x1a67e1){_0x412d2['push'](_0x412d2['shift']());}};_0x29b402(++_0x44e6f0);}(_0x77af,0xf4));var _0xf77a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x77af[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require(_0xf77a('0x0'));var emlformat=require(_0xf77a('0x1'));var rimraf=require(_0xf77a('0x2'));var zipdir=require(_0xf77a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf77a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf77a('0x5'));var path=require(_0xf77a('0x6'));var sox=require(_0xf77a('0x7'));var csv=require(_0xf77a('0x8'));var ejs=require(_0xf77a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf77a('0xa'));var crypto=require(_0xf77a('0xb'));var jsforce=require(_0xf77a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf77a('0x8'));var querystring=require(_0xf77a('0xd'));var Papa=require(_0xf77a('0xe'));var authService=require(_0xf77a('0xf'));var hardwareService=require(_0xf77a('0x10'));var Redis=require(_0xf77a('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf77a('0x12'));var utils=require('../../config/utils');var config=require(_0xf77a('0x13'));var db=require(_0xf77a('0x14'))['db'];config[_0xf77a('0x15')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf77a('0x16'))(new Redis(config[_0xf77a('0x15')]));require('./mailAccount.socket')[_0xf77a('0x17')](socket);var jayson=require(_0xf77a('0x18'));var client=jayson[_0xf77a('0x19')][_0xf77a('0x1a')]({'port':0x232b});function respondWithRpcPromise(_0x1a58a7,_0x576d02,_0x44a9b0,_0x34749f){return new BPromise(function(_0x5e4bf3,_0x88bfde){var _0xe44a66=_0x34749f||client;return _0xe44a66[_0xf77a('0x1b')](_0x1a58a7,_0x44a9b0)[_0xf77a('0x1c')](function(_0x257c9a){logger[_0xf77a('0x1d')](_0xf77a('0x1e'),_0x576d02,_0xf77a('0x1f'));logger[_0xf77a('0x20')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x576d02,_0xf77a('0x1f'),JSON[_0xf77a('0x21')](_0x257c9a));if(_0x257c9a[_0xf77a('0x22')]){if(_0x257c9a['error'][_0xf77a('0x23')]===0x1f4){logger[_0xf77a('0x22')](_0xf77a('0x1e'),_0x576d02,_0x257c9a[_0xf77a('0x22')][_0xf77a('0x24')]);return _0x88bfde(_0x257c9a['error'][_0xf77a('0x24')]);}logger[_0xf77a('0x22')]('MailAccount,\x20%s,\x20%s',_0x576d02,_0x257c9a[_0xf77a('0x22')][_0xf77a('0x24')]);return _0x5e4bf3(_0x257c9a[_0xf77a('0x22')][_0xf77a('0x24')]);}else{logger[_0xf77a('0x1d')](_0xf77a('0x1e'),_0x576d02,_0xf77a('0x1f'));_0x5e4bf3(_0x257c9a[_0xf77a('0x25')][_0xf77a('0x24')]);}})[_0xf77a('0x26')](function(_0x552907){logger[_0xf77a('0x22')](_0xf77a('0x1e'),_0x576d02,_0x552907);_0x88bfde(_0x552907);});});}function respondWithStatusCode(_0x518bd6,_0xa92a73){_0xa92a73=_0xa92a73||0xcc;return function(_0x40394a){if(_0x40394a){return _0x518bd6[_0xf77a('0x27')](_0xa92a73);}return _0x518bd6[_0xf77a('0x28')](_0xa92a73)[_0xf77a('0x29')]();};}function respondWithResult(_0x530b2e,_0x124136){_0x124136=_0x124136||0xc8;return function(_0x29d42a){if(_0x29d42a){return _0x530b2e['status'](_0x124136)[_0xf77a('0x2a')](_0x29d42a);}};}function respondWithFilteredResult(_0x5cb253,_0x510055){return function(_0x110b74){if(_0x110b74){var _0x326bf2=_0x110b74[_0xf77a('0x2b')],_0x3d75bd=_0x510055[_0xf77a('0x2c')],_0x45f63b=_0x510055[_0xf77a('0x2c')]+_0x510055['limit'],_0x35af70;if(_0x45f63b>=_0x326bf2){_0x45f63b=_0x326bf2;_0x35af70=0xc8;}else{_0x35af70=0xce;}_0x5cb253[_0xf77a('0x28')](_0x35af70);return _0x5cb253[_0xf77a('0x2d')](_0xf77a('0x2e'),_0x3d75bd+'-'+_0x45f63b+'/'+_0x326bf2)[_0xf77a('0x2a')](_0x110b74);}return null;};}function patchUpdates(_0x16b789){return function(_0x165164){try{jsonpatch[_0xf77a('0x2f')](_0x165164,_0x16b789,!![]);}catch(_0x2f6b06){return BPromise[_0xf77a('0x30')](_0x2f6b06);}return _0x165164['save']();};}function saveUpdates(_0x106287,_0x391edb){return function(_0x1ac089){if(_0x1ac089){return _0x1ac089[_0xf77a('0x31')](_0x106287)[_0xf77a('0x1c')](function(_0xf0a159){return _0xf0a159;});}return null;};}function removeEntity(_0x392e2a,_0x584ff6){return function(_0x42527e){if(_0x42527e){return _0x42527e[_0xf77a('0x32')]()[_0xf77a('0x1c')](function(){var _0x3b38fb=_0x42527e[_0xf77a('0x33')]({'plain':!![]});var _0x303fbd='MailAccounts';return db['UserProfileResource'][_0xf77a('0x32')]({'where':{'type':_0x303fbd,'resourceId':_0x3b38fb['id']}})[_0xf77a('0x1c')](function(){return _0x42527e;});})[_0xf77a('0x1c')](function(){_0x392e2a[_0xf77a('0x28')](0xcc)[_0xf77a('0x29')]();});}};}function handleEntityNotFound(_0x57ed65,_0x8dd703){return function(_0x514808){if(!_0x514808){_0x57ed65[_0xf77a('0x27')](0x194);}return _0x514808;};}function handleError(_0x27d3db,_0x24c65d){_0x24c65d=_0x24c65d||0x1f4;return function(_0x4ee322){logger[_0xf77a('0x22')](_0x4ee322[_0xf77a('0x34')]);if(_0x4ee322[_0xf77a('0x35')]){delete _0x4ee322[_0xf77a('0x35')];}_0x27d3db[_0xf77a('0x28')](_0x24c65d)[_0xf77a('0x36')](_0x4ee322);};}exports[_0xf77a('0x37')]=function(_0x1d2072,_0x4a5ff6){var _0x45d06d={'include':[{'model':db[_0xf77a('0x38')],'as':_0xf77a('0x39')},{'model':db[_0xf77a('0x3a')],'as':_0xf77a('0x3b')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xeaec4c={},_0x32f5bf={'count':0x0,'rows':[]};var _0x403778=db['MailAccount'][_0xf77a('0x3c')];_0xeaec4c[_0xf77a('0x3d')]=_['keys'](_0x403778);_0xeaec4c['query']=_[_0xf77a('0x3e')](_0x1d2072[_0xf77a('0x3f')]);_0xeaec4c['filters']=_[_0xf77a('0x40')](_0xeaec4c[_0xf77a('0x3d')],_0xeaec4c[_0xf77a('0x3f')]);_0x45d06d[_0xf77a('0x41')]=_['intersection'](_0xeaec4c[_0xf77a('0x3d')],qs[_0xf77a('0x42')](_0x1d2072[_0xf77a('0x3f')][_0xf77a('0x42')]));_0x45d06d['attributes']=_0x45d06d[_0xf77a('0x41')]['length']?_0x45d06d[_0xf77a('0x41')]:_0xeaec4c['model'];if(!_0x1d2072[_0xf77a('0x3f')][_0xf77a('0x43')]('nolimit')){_0x45d06d['limit']=qs[_0xf77a('0x44')](_0x1d2072['query'][_0xf77a('0x44')]);_0x45d06d['offset']=qs['offset'](_0x1d2072[_0xf77a('0x3f')][_0xf77a('0x2c')]);}_0x45d06d['order']=qs[_0xf77a('0x45')](_0x1d2072['query'][_0xf77a('0x45')]);_0x45d06d[_0xf77a('0x46')]=qs[_0xf77a('0x47')](_[_0xf77a('0x48')](_0x1d2072[_0xf77a('0x3f')],_0xeaec4c['filters']));if(_0x1d2072[_0xf77a('0x3f')][_0xf77a('0x49')]){_0x45d06d[_0xf77a('0x46')]=_[_0xf77a('0x4a')](_0x45d06d[_0xf77a('0x46')],{'$or':_['map'](_0x403778,function(_0x1e6788){if(_0x1e6788['type'][_0xf77a('0x4b')]!=='VIRTUAL'){var _0x1f7ac6={};_0x1f7ac6[_0x1e6788[_0xf77a('0x4c')]]={'$like':'%'+_0x1d2072[_0xf77a('0x3f')][_0xf77a('0x49')]+'%'};return _0x1f7ac6;}})});}_0x45d06d=_[_0xf77a('0x4a')]({},_0x45d06d,_0x1d2072[_0xf77a('0x4d')]);var _0x4303cc={'where':_0x45d06d[_0xf77a('0x46')]};return db[_0xf77a('0x4e')]['count'](_0x4303cc)['then'](function(_0x1426e1){_0x32f5bf['count']=_0x1426e1;if(_0x1d2072[_0xf77a('0x3f')][_0xf77a('0x4f')]){_0x45d06d[_0xf77a('0x50')]=[{'all':!![]}];}return db[_0xf77a('0x4e')][_0xf77a('0x51')](_0x45d06d);})[_0xf77a('0x1c')](function(_0x501eb8){_0x32f5bf[_0xf77a('0x52')]=_0x501eb8;return _0x32f5bf;})[_0xf77a('0x1c')](respondWithFilteredResult(_0x4a5ff6,_0x45d06d))[_0xf77a('0x26')](handleError(_0x4a5ff6,null));};exports[_0xf77a('0x53')]=function(_0x217017,_0x23cd2e){var _0x6fe6ef={'raw':![],'where':{'id':_0x217017[_0xf77a('0x54')]['id']},'include':[{'model':db[_0xf77a('0x38')],'as':_0xf77a('0x39')},{'model':db[_0xf77a('0x3a')],'as':_0xf77a('0x3b')},{'model':db[_0xf77a('0x55')],'as':'mandatoryDispositionPause'}]},_0x219193={};_0x219193['model']=_['keys'](db['MailAccount']['rawAttributes']);_0x219193[_0xf77a('0x3f')]=_[_0xf77a('0x3e')](_0x217017[_0xf77a('0x3f')]);_0x219193[_0xf77a('0x47')]=_[_0xf77a('0x40')](_0x219193['model'],_0x219193[_0xf77a('0x3f')]);_0x6fe6ef[_0xf77a('0x41')]=_['intersection'](_0x219193[_0xf77a('0x3d')],qs[_0xf77a('0x42')](_0x217017[_0xf77a('0x3f')][_0xf77a('0x42')]));_0x6fe6ef[_0xf77a('0x41')]=_0x6fe6ef['attributes'][_0xf77a('0x56')]?_0x6fe6ef[_0xf77a('0x41')]:_0x219193[_0xf77a('0x3d')];if(_0x217017[_0xf77a('0x3f')][_0xf77a('0x4f')]){_0x6fe6ef[_0xf77a('0x50')]=[{'all':!![]}];}_0x6fe6ef=_[_0xf77a('0x4a')]({},_0x6fe6ef,_0x217017[_0xf77a('0x4d')]);return db[_0xf77a('0x4e')][_0xf77a('0x57')](_0x6fe6ef)[_0xf77a('0x1c')](handleEntityNotFound(_0x23cd2e,null))[_0xf77a('0x1c')](respondWithResult(_0x23cd2e,null))[_0xf77a('0x26')](handleError(_0x23cd2e,null));};exports['update']=function(_0x251f9c,_0x57fa62){if(_0x251f9c[_0xf77a('0x58')]['id']){delete _0x251f9c[_0xf77a('0x58')]['id'];}return db['MailAccount'][_0xf77a('0x57')]({'where':{'id':_0x251f9c['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xf77a('0x39')},{'model':db[_0xf77a('0x3a')],'as':_0xf77a('0x3b')},{'model':db[_0xf77a('0x55')],'as':'mandatoryDispositionPause'}]})[_0xf77a('0x1c')](handleEntityNotFound(_0x57fa62,null))[_0xf77a('0x1c')](saveUpdates(_0x251f9c[_0xf77a('0x58')],null))['then'](function(_0x3a1ec3){if(_0x3a1ec3&&_0x251f9c[_0xf77a('0x58')][_0xf77a('0x39')]){return db['MailServerIn'][_0xf77a('0x31')](_0x251f9c[_0xf77a('0x58')]['Imap'],{'where':{'MailAccountId':_0x3a1ec3['id']}})[_0xf77a('0x1c')](function(){return _0x3a1ec3;});}return _0x3a1ec3;})[_0xf77a('0x1c')](function(_0x1dcb94){if(_0x1dcb94&&_0x251f9c[_0xf77a('0x58')][_0xf77a('0x3b')]){return db[_0xf77a('0x3a')]['update'](_0x251f9c[_0xf77a('0x58')][_0xf77a('0x3b')],{'where':{'MailAccountId':_0x1dcb94['id']}})[_0xf77a('0x1c')](function(){return _0x1dcb94;});}return _0x1dcb94;})['then'](function(_0x6b9261){if(_0x6b9261&&_0x251f9c['body']['mandatoryDispositionPause']){return db[_0xf77a('0x55')][_0xf77a('0x31')](_0x251f9c[_0xf77a('0x58')]['mandatoryDispositionPause'],{'where':{'MailAccountId':_0x6b9261['id']}})['then'](function(){return _0x6b9261;});}return _0x6b9261;})[_0xf77a('0x1c')](respondWithResult(_0x57fa62,null))[_0xf77a('0x26')](handleError(_0x57fa62,null));};exports[_0xf77a('0x59')]=function(_0x59b830,_0x678031){return db[_0xf77a('0x4e')][_0xf77a('0x59')]()[_0xf77a('0x1c')](respondWithResult(_0x678031,null))[_0xf77a('0x26')](handleError(_0x678031,null));};exports[_0xf77a('0x5a')]=function(_0x1d3ce4,_0x505f2d,_0x2670e5){if(_0x1d3ce4['body']['id']){delete _0x1d3ce4[_0xf77a('0x58')]['id'];}return db[_0xf77a('0x4e')][_0xf77a('0x57')]({'where':{'id':_0x1d3ce4[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x505f2d,null))[_0xf77a('0x1c')](function(_0x2b175b){if(_0x2b175b){_0x1d3ce4['body'][_0xf77a('0x5b')]=_0x2b175b['id'];return db[_0xf77a('0x5c')][_0xf77a('0x5d')](_0x1d3ce4['body']);}})['then'](respondWithResult(_0x505f2d,null))[_0xf77a('0x26')](handleError(_0x505f2d,null));};exports['getDispositions']=function(_0x2545be,_0x3e4123,_0x5f56a4){var _0x41aa77={'raw':![],'where':{}};var _0x8644a5={};var _0x49b920={'count':0x0,'rows':[]};return db['MailAccount'][_0xf77a('0x5e')]({'where':{'id':_0x2545be[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x3e4123,null))[_0xf77a('0x1c')](function(_0x5a6074){if(_0x5a6074){_0x8644a5['model']=_[_0xf77a('0x3e')](db[_0xf77a('0x5c')][_0xf77a('0x3c')]);_0x8644a5['query']=_['keys'](_0x2545be[_0xf77a('0x3f')]);_0x8644a5[_0xf77a('0x47')]=_['intersection'](_0x8644a5[_0xf77a('0x3d')],_0x8644a5[_0xf77a('0x3f')]);_0x41aa77['attributes']=_[_0xf77a('0x40')](_0x8644a5[_0xf77a('0x3d')],qs['fields'](_0x2545be['query']['fields']));_0x41aa77[_0xf77a('0x41')]=_0x41aa77[_0xf77a('0x41')][_0xf77a('0x56')]?_0x41aa77[_0xf77a('0x41')]:_0x8644a5[_0xf77a('0x3d')];if(!_0x2545be[_0xf77a('0x3f')][_0xf77a('0x43')](_0xf77a('0x5f'))){_0x41aa77[_0xf77a('0x44')]=qs['limit'](_0x2545be[_0xf77a('0x3f')]['limit']);_0x41aa77[_0xf77a('0x2c')]=qs[_0xf77a('0x2c')](_0x2545be[_0xf77a('0x3f')][_0xf77a('0x2c')]);}_0x41aa77[_0xf77a('0x60')]=qs['sort'](_0x2545be[_0xf77a('0x3f')]['sort']);_0x41aa77['where']=qs[_0xf77a('0x47')](_[_0xf77a('0x48')](_0x2545be[_0xf77a('0x3f')],_0x8644a5[_0xf77a('0x47')]));_0x41aa77[_0xf77a('0x46')][_0xf77a('0x5b')]=_0x5a6074['id'];if(_0x2545be[_0xf77a('0x3f')][_0xf77a('0x49')]){_0x41aa77[_0xf77a('0x46')]=_[_0xf77a('0x4a')](_0x41aa77[_0xf77a('0x46')],{'$or':_['map'](_0x41aa77['attributes'],function(_0x5ee5f2){var _0xe06700={};_0xe06700[_0x5ee5f2]={'$like':'%'+_0x2545be[_0xf77a('0x3f')]['filter']+'%'};return _0xe06700;})});}_0x41aa77=_['merge']({},_0x41aa77,_0x2545be[_0xf77a('0x4d')]);return db[_0xf77a('0x5c')][_0xf77a('0x2b')]({'where':_0x41aa77[_0xf77a('0x46')]})[_0xf77a('0x1c')](function(_0x276b36){_0x49b920[_0xf77a('0x2b')]=_0x276b36;if(_0x2545be['query'][_0xf77a('0x4f')]){_0x41aa77[_0xf77a('0x50')]=[{'all':!![]}];}return db[_0xf77a('0x5c')][_0xf77a('0x51')](_0x41aa77);})['then'](function(_0x20174e){_0x49b920[_0xf77a('0x52')]=_0x20174e;return _0x49b920;});}})[_0xf77a('0x1c')](respondWithFilteredResult(_0x3e4123,_0x41aa77))[_0xf77a('0x26')](handleError(_0x3e4123,null));};exports[_0xf77a('0x61')]=function(_0x43e4f7,_0x1492a2,_0xb7a7d6){var _0x37a253;return db[_0xf77a('0x4e')][_0xf77a('0x57')]({'where':{'id':_0x43e4f7[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x1492a2,null))[_0xf77a('0x1c')](function(_0x2d8c2c){if(_0x2d8c2c){return _0x2d8c2c[_0xf77a('0x61')](_0x43e4f7[_0xf77a('0x3f')][_0xf77a('0x62')]);}})[_0xf77a('0x1c')](respondWithStatusCode(_0x1492a2,null))[_0xf77a('0x26')](handleError(_0x1492a2,null));};exports[_0xf77a('0x63')]=function(_0x154591,_0x4b5b9e,_0x2b6870){if(_0x154591[_0xf77a('0x58')]['id']){delete _0x154591['body']['id'];}return db[_0xf77a('0x4e')][_0xf77a('0x57')]({'where':{'id':_0x154591[_0xf77a('0x54')]['id']}})['then'](handleEntityNotFound(_0x4b5b9e,null))['then'](function(_0x4e3349){if(_0x4e3349){_0x154591[_0xf77a('0x58')][_0xf77a('0x5b')]=_0x4e3349['id'];return db[_0xf77a('0x64')]['create'](_0x154591[_0xf77a('0x58')]);}})[_0xf77a('0x1c')](respondWithResult(_0x4b5b9e,null))['catch'](handleError(_0x4b5b9e,null));};exports[_0xf77a('0x65')]=function(_0x1936e6,_0x4b93f8,_0xcc8456){var _0x38eff0={'raw':![],'where':{}};var _0xc418f0={};var _0x485f6a={'count':0x0,'rows':[]};return db['MailAccount'][_0xf77a('0x5e')]({'where':{'id':_0x1936e6[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x4b93f8,null))[_0xf77a('0x1c')](function(_0x34d3b7){if(_0x34d3b7){_0xc418f0[_0xf77a('0x3d')]=_[_0xf77a('0x3e')](db[_0xf77a('0x64')]['rawAttributes']);_0xc418f0[_0xf77a('0x3f')]=_['keys'](_0x1936e6[_0xf77a('0x3f')]);_0xc418f0[_0xf77a('0x47')]=_[_0xf77a('0x40')](_0xc418f0[_0xf77a('0x3d')],_0xc418f0[_0xf77a('0x3f')]);_0x38eff0[_0xf77a('0x41')]=_[_0xf77a('0x40')](_0xc418f0[_0xf77a('0x3d')],qs[_0xf77a('0x42')](_0x1936e6['query'][_0xf77a('0x42')]));_0x38eff0[_0xf77a('0x41')]=_0x38eff0[_0xf77a('0x41')]['length']?_0x38eff0[_0xf77a('0x41')]:_0xc418f0['model'];if(!_0x1936e6[_0xf77a('0x3f')][_0xf77a('0x43')](_0xf77a('0x5f'))){_0x38eff0[_0xf77a('0x44')]=qs['limit'](_0x1936e6[_0xf77a('0x3f')][_0xf77a('0x44')]);_0x38eff0['offset']=qs[_0xf77a('0x2c')](_0x1936e6['query'][_0xf77a('0x2c')]);}_0x38eff0[_0xf77a('0x60')]=qs[_0xf77a('0x45')](_0x1936e6[_0xf77a('0x3f')][_0xf77a('0x45')]);_0x38eff0[_0xf77a('0x46')]=qs[_0xf77a('0x47')](_[_0xf77a('0x48')](_0x1936e6[_0xf77a('0x3f')],_0xc418f0[_0xf77a('0x47')]));_0x38eff0[_0xf77a('0x46')][_0xf77a('0x5b')]=_0x34d3b7['id'];if(_0x1936e6[_0xf77a('0x3f')][_0xf77a('0x49')]){_0x38eff0[_0xf77a('0x46')]=_[_0xf77a('0x4a')](_0x38eff0[_0xf77a('0x46')],{'$or':_[_0xf77a('0x66')](_0x38eff0[_0xf77a('0x41')],function(_0x28657a){var _0x106753={};_0x106753[_0x28657a]={'$like':'%'+_0x1936e6['query'][_0xf77a('0x49')]+'%'};return _0x106753;})});}_0x38eff0=_[_0xf77a('0x4a')]({},_0x38eff0,_0x1936e6[_0xf77a('0x4d')]);return db[_0xf77a('0x64')][_0xf77a('0x2b')]({'where':_0x38eff0[_0xf77a('0x46')]})[_0xf77a('0x1c')](function(_0x27a32f){_0x485f6a['count']=_0x27a32f;if(_0x1936e6[_0xf77a('0x3f')][_0xf77a('0x4f')]){_0x38eff0[_0xf77a('0x50')]=[{'all':!![]}];}return db[_0xf77a('0x64')][_0xf77a('0x51')](_0x38eff0);})[_0xf77a('0x1c')](function(_0x336335){_0x485f6a[_0xf77a('0x52')]=_0x336335;return _0x485f6a;});}})['then'](respondWithFilteredResult(_0x4b93f8,_0x38eff0))[_0xf77a('0x26')](handleError(_0x4b93f8,null));};exports[_0xf77a('0x67')]=function(_0x24b6dd,_0xe4c0a2,_0x1427b1){var _0x3aebac;return db[_0xf77a('0x4e')][_0xf77a('0x57')]({'where':{'id':_0x24b6dd[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0xe4c0a2,null))[_0xf77a('0x1c')](function(_0x2f9bba){if(_0x2f9bba){return _0x2f9bba[_0xf77a('0x67')](_0x24b6dd[_0xf77a('0x3f')][_0xf77a('0x62')]);}})['then'](respondWithStatusCode(_0xe4c0a2,null))[_0xf77a('0x26')](handleError(_0xe4c0a2,null));};exports[_0xf77a('0x5d')]=function(_0x170244,_0x3a3ed9){var _0xa54954={'name':_0x170244[_0xf77a('0x58')]['name'],'key':_0x170244['body'][_0xf77a('0x4b')],'email':_0x170244['body'][_0xf77a('0x68')],'ListId':_0x170244[_0xf77a('0x58')][_0xf77a('0x69')],'active':!_[_0xf77a('0x6a')](_0x170244[_0xf77a('0x58')][_0xf77a('0x6b')])?_0x170244[_0xf77a('0x58')]['active']:!![],'description':_0x170244[_0xf77a('0x58')][_0xf77a('0x6c')]||null,'Imap':{},'Smtp':{}};if(_[_0xf77a('0x6a')](_0x170244[_0xf77a('0x58')]['cservice'])){if(_0x170244['body']['cauthentication']){_0xa54954[_0xf77a('0x39')][_0xf77a('0x6d')]=_0xa54954[_0xf77a('0x3b')][_0xf77a('0x6d')]=_0x170244[_0xf77a('0x58')][_0xf77a('0x6e')];_0xa54954['Imap'][_0xf77a('0x6f')]=_0xa54954[_0xf77a('0x3b')]['pass']=_0x170244[_0xf77a('0x58')][_0xf77a('0x70')];}else{_0xa54954[_0xf77a('0x39')][_0xf77a('0x71')]=_0xa54954[_0xf77a('0x3b')]['authentication']=![];}_0xa54954['Imap'][_0xf77a('0x72')]=_0x170244[_0xf77a('0x58')][_0xf77a('0x39')][_0xf77a('0x72')];_0xa54954[_0xf77a('0x39')][_0xf77a('0x73')]=_0x170244[_0xf77a('0x58')][_0xf77a('0x39')][_0xf77a('0x73')];_0xa54954[_0xf77a('0x3b')][_0xf77a('0x72')]=_0x170244[_0xf77a('0x58')][_0xf77a('0x3b')]['host'];_0xa54954['Smtp'][_0xf77a('0x73')]=_0x170244[_0xf77a('0x58')][_0xf77a('0x3b')][_0xf77a('0x73')];}else{_0xa54954[_0xf77a('0x39')][_0xf77a('0x74')]=_0xa54954['Smtp']['service']=_0x170244[_0xf77a('0x58')][_0xf77a('0x75')];_0xa54954[_0xf77a('0x39')]['user']=_0xa54954[_0xf77a('0x3b')]['user']=_0x170244[_0xf77a('0x58')][_0xf77a('0x6e')];_0xa54954['Imap'][_0xf77a('0x6f')]=_0xa54954[_0xf77a('0x3b')]['pass']=_0x170244['body']['cpassword'];}return db['MailAccount'][_0xf77a('0x5d')](_0xa54954,{'include':[{'model':db[_0xf77a('0x3a')],'as':_0xf77a('0x3b')},{'model':db[_0xf77a('0x38')],'as':_0xf77a('0x39')}]})[_0xf77a('0x1c')](function(_0x34e56f){var _0x26c386=_0x170244[_0xf77a('0x6d')]['get']({'plain':!![]});if(!_0x26c386)throw new Error(_0xf77a('0x76'));if(_0x26c386[_0xf77a('0x77')]===_0xf77a('0x6d')){var _0x50b156=_0x34e56f[_0xf77a('0x33')]({'plain':!![]});return db[_0xf77a('0x78')]['find']({'where':{'name':_0xf77a('0x79'),'userProfileId':_0x26c386[_0xf77a('0x7a')]},'raw':!![]})[_0xf77a('0x1c')](function(_0x216d04){if(_0x216d04&&_0x216d04[_0xf77a('0x7b')]===0x0){return db[_0xf77a('0x7c')][_0xf77a('0x5d')]({'name':_0x50b156[_0xf77a('0x35')],'resourceId':_0x50b156['id'],'type':_0x216d04[_0xf77a('0x35')],'sectionId':_0x216d04['id']},{})[_0xf77a('0x1c')](function(){return _0x34e56f;});}else{return _0x34e56f;}})['catch'](function(_0x385d8a){logger[_0xf77a('0x22')](_0xf77a('0x7d'),_0x385d8a);throw _0x385d8a;});}return _0x34e56f;})[_0xf77a('0x1c')](respondWithResult(_0x3a3ed9,0xc9))[_0xf77a('0x26')](handleError(_0x3a3ed9,null));};exports[_0xf77a('0x7e')]=function(_0x1170e0,_0x1c4a0e,_0x529465){return db['MailAccount'][_0xf77a('0x5e')]({'where':{'id':_0x1170e0[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x1c4a0e,null))[_0xf77a('0x1c')](function(_0x3b2a9a){if(_0x3b2a9a){return _0x3b2a9a['getImap']();}return null;})['then'](respondWithResult(_0x1c4a0e,null))[_0xf77a('0x26')](handleError(_0x1c4a0e,null));};exports[_0xf77a('0x7f')]=function(_0x208a73,_0x2ea02e,_0x60b76c){if(_0x208a73['body']['id']){delete _0x208a73['body']['id'];}return db[_0xf77a('0x4e')][_0xf77a('0x57')]({'where':{'id':_0x208a73[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x2ea02e,null))[_0xf77a('0x1c')](function(_0x49fe49){if(_0x49fe49){_0x208a73[_0xf77a('0x58')][_0xf77a('0x5b')]=_0x49fe49['id'];return db[_0xf77a('0x38')]['create'](_0x208a73[_0xf77a('0x58')]);}})[_0xf77a('0x1c')](respondWithResult(_0x2ea02e,null))[_0xf77a('0x26')](handleError(_0x2ea02e,null));};exports[_0xf77a('0x80')]=function(_0x5568b5,_0x341bcc,_0x3a022f){return db[_0xf77a('0x4e')][_0xf77a('0x5e')]({'where':{'id':_0x5568b5[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x341bcc,null))[_0xf77a('0x1c')](function(_0x431551){if(_0x431551){return _0x431551['setImap'](null);}return null;})[_0xf77a('0x1c')](respondWithStatusCode(_0x341bcc,null))[_0xf77a('0x26')](handleError(_0x341bcc,null));};exports['getSmtp']=function(_0x56da6f,_0x3c0040,_0x4de594){return db['MailAccount'][_0xf77a('0x5e')]({'where':{'id':_0x56da6f[_0xf77a('0x54')]['id']}})['then'](handleEntityNotFound(_0x3c0040,null))['then'](function(_0x1ea9bf){if(_0x1ea9bf){return _0x1ea9bf[_0xf77a('0x81')]();}return null;})[_0xf77a('0x1c')](respondWithResult(_0x3c0040,null))[_0xf77a('0x26')](handleError(_0x3c0040,null));};exports[_0xf77a('0x82')]=function(_0x5c807a,_0x28049a,_0x5a684c){if(_0x5c807a[_0xf77a('0x58')]['id']){delete _0x5c807a[_0xf77a('0x58')]['id'];}return db[_0xf77a('0x4e')]['find']({'where':{'id':_0x5c807a[_0xf77a('0x54')]['id']}})['then'](handleEntityNotFound(_0x28049a,null))[_0xf77a('0x1c')](function(_0x3ae2ce){if(_0x3ae2ce){_0x5c807a[_0xf77a('0x58')]['MailAccountId']=_0x3ae2ce['id'];return db['MailServerOut'][_0xf77a('0x5d')](_0x5c807a[_0xf77a('0x58')]);}})[_0xf77a('0x1c')](respondWithResult(_0x28049a,null))[_0xf77a('0x26')](handleError(_0x28049a,null));};exports['removeSmtp']=function(_0x55d3c5,_0x5c3a86,_0x308e9c){return db['MailAccount'][_0xf77a('0x5e')]({'where':{'id':_0x55d3c5['params']['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x5c3a86,null))[_0xf77a('0x1c')](function(_0x19ea2e){if(_0x19ea2e){return _0x19ea2e[_0xf77a('0x83')](null);}return null;})[_0xf77a('0x1c')](respondWithStatusCode(_0x5c3a86,null))[_0xf77a('0x26')](handleError(_0x5c3a86,null));};exports['addInteraction']=function(_0xa19a11,_0x33aed1,_0x3d42b0){return db[_0xf77a('0x84')]['find']({'where':{'id':_0xa19a11['params']['id']}})['then'](handleEntityNotFound(_0x33aed1,null))['then'](function(_0x28f597){if(_0x28f597){return _0x28f597[_0xf77a('0x85')](_0xa19a11[_0xf77a('0x58')]['ids'],_[_0xf77a('0x86')](_0xa19a11[_0xf77a('0x58')],['ids','id'])||{});}})[_0xf77a('0x1c')](respondWithResult(_0x33aed1,null))[_0xf77a('0x26')](handleError(_0x33aed1,null));};exports['getInteractions']=function(_0x451148,_0x1367a4,_0x383f46){var _0xbb8e2c={'raw':![],'where':{}};var _0x2d5c7e={};var _0x3587bd={'count':0x0,'rows':[]};return db[_0xf77a('0x4e')]['findOne']({'where':{'id':_0x451148[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x1367a4,null))['then'](function(_0x10a8e2){if(_0x10a8e2){_0x2d5c7e[_0xf77a('0x3d')]=_[_0xf77a('0x3e')](db['MailInteraction'][_0xf77a('0x3c')]);_0x2d5c7e[_0xf77a('0x3f')]=_['keys'](_0x451148[_0xf77a('0x3f')]);_0x2d5c7e['filters']=_[_0xf77a('0x40')](_0x2d5c7e[_0xf77a('0x3d')],_0x2d5c7e[_0xf77a('0x3f')]);_0xbb8e2c[_0xf77a('0x41')]=_[_0xf77a('0x40')](_0x2d5c7e['model'],qs[_0xf77a('0x42')](_0x451148['query']['fields']));_0xbb8e2c[_0xf77a('0x41')]=_0xbb8e2c[_0xf77a('0x41')][_0xf77a('0x56')]?_0xbb8e2c[_0xf77a('0x41')]:_0x2d5c7e[_0xf77a('0x3d')];if(!_0x451148[_0xf77a('0x3f')][_0xf77a('0x43')](_0xf77a('0x5f'))){_0xbb8e2c[_0xf77a('0x44')]=qs[_0xf77a('0x44')](_0x451148['query'][_0xf77a('0x44')]);_0xbb8e2c[_0xf77a('0x2c')]=qs[_0xf77a('0x2c')](_0x451148[_0xf77a('0x3f')][_0xf77a('0x2c')]);}_0xbb8e2c['order']=qs['sort'](_0x451148[_0xf77a('0x3f')][_0xf77a('0x45')]);_0xbb8e2c['where']=qs[_0xf77a('0x47')](_[_0xf77a('0x48')](_0x451148[_0xf77a('0x3f')],_0x2d5c7e['filters']));_0xbb8e2c[_0xf77a('0x46')][_0xf77a('0x5b')]=_0x10a8e2['id'];if(_0x451148[_0xf77a('0x3f')][_0xf77a('0x49')]){_0xbb8e2c[_0xf77a('0x46')]=_['merge'](_0xbb8e2c[_0xf77a('0x46')],{'$or':_['map'](_0xbb8e2c['attributes'],function(_0x9fbae5){var _0x339efb={};_0x339efb[_0x9fbae5]={'$like':'%'+_0x451148['query'][_0xf77a('0x49')]+'%'};return _0x339efb;})});}_0xbb8e2c=_[_0xf77a('0x4a')]({},_0xbb8e2c,_0x451148[_0xf77a('0x4d')]);return db[_0xf77a('0x84')][_0xf77a('0x2b')]({'where':_0xbb8e2c[_0xf77a('0x46')]})[_0xf77a('0x1c')](function(_0x394471){_0x3587bd[_0xf77a('0x2b')]=_0x394471;if(_0x451148['query'][_0xf77a('0x4f')]){_0xbb8e2c['include']=[{'model':db[_0xf77a('0x87')],'as':_0xf77a('0x88'),'required':![]},{'model':db[_0xf77a('0x89')],'as':_0xf77a('0x8a'),'attributes':[_0xf77a('0x35'),'fullname',_0xf77a('0x8b')],'required':![]},{'model':db[_0xf77a('0x8c')],'as':_0xf77a('0x8d'),'attributes':['id',_0xf77a('0x35'),'color'],'where':_0x451148[_0xf77a('0x3f')][_0xf77a('0x8e')]?{'id':_0x451148['query'][_0xf77a('0x8e')]}:undefined,'required':_0x451148[_0xf77a('0x3f')][_0xf77a('0x8e')]?!![]:![]}];}return db[_0xf77a('0x84')][_0xf77a('0x51')](_0xbb8e2c);})[_0xf77a('0x1c')](function(_0x55f1f1){_0x3587bd[_0xf77a('0x52')]=_0x55f1f1;return _0x3587bd;});}})['then'](respondWithFilteredResult(_0x1367a4,_0xbb8e2c))[_0xf77a('0x26')](handleError(_0x1367a4,null));};exports[_0xf77a('0x8f')]=function(_0x47021f,_0xf8290b,_0x1edfb6){return db[_0xf77a('0x4e')][_0xf77a('0x5e')]({'where':{'id':_0x47021f[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0xf8290b,null))[_0xf77a('0x1c')](function(_0x4191dd){if(_0x4191dd){return db['sequelize']['transaction'](function(_0x5011a0){return db['MailApplication'][_0xf77a('0x32')]({'where':{'MailAccountId':_0x47021f[_0xf77a('0x54')]['id']},'transaction':_0x5011a0})['then'](function(_0x390c53){var _0x9958f5=_[_0xf77a('0x66')](_0x47021f['body'],function(_0x577f91){_0x577f91[_0xf77a('0x5b')]=_0x47021f[_0xf77a('0x54')]['id'];return _0x577f91;});return db['MailApplication'][_0xf77a('0x90')](_0x9958f5,{'transaction':_0x5011a0});});})[_0xf77a('0x1c')](function(){return db[_0xf77a('0x91')][_0xf77a('0x92')]({'where':{'MailAccountId':_0x47021f[_0xf77a('0x54')]['id']},'order':_0xf77a('0x93')});});}})[_0xf77a('0x1c')](respondWithResult(_0xf8290b,null))[_0xf77a('0x26')](handleError(_0xf8290b,null));};exports[_0xf77a('0x94')]=function(_0x605010,_0x1e528c,_0x5411dc){var _0x2d9430={};var _0x57e5ce={};var _0x142002;var _0x312fda;return db[_0xf77a('0x4e')]['findOne']({'where':{'id':_0x605010[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x1e528c,null))['then'](function(_0x472ee6){if(_0x472ee6){_0x142002=_0x472ee6;_0x57e5ce[_0xf77a('0x3d')]=_[_0xf77a('0x3e')](db[_0xf77a('0x91')][_0xf77a('0x3c')]);_0x57e5ce[_0xf77a('0x3f')]=_['keys'](_0x605010['query']);_0x57e5ce[_0xf77a('0x47')]=_[_0xf77a('0x40')](_0x57e5ce[_0xf77a('0x3d')],_0x57e5ce[_0xf77a('0x3f')]);_0x2d9430['attributes']=_['intersection'](_0x57e5ce['model'],qs[_0xf77a('0x42')](_0x605010['query'][_0xf77a('0x42')]));_0x2d9430[_0xf77a('0x41')]=_0x2d9430[_0xf77a('0x41')][_0xf77a('0x56')]?_0x2d9430[_0xf77a('0x41')]:_0x57e5ce[_0xf77a('0x3d')];_0x2d9430['order']=qs['sort'](_0x605010['query'][_0xf77a('0x45')]);_0x2d9430['where']=qs[_0xf77a('0x47')](_[_0xf77a('0x48')](_0x605010[_0xf77a('0x3f')],_0x57e5ce[_0xf77a('0x47')]));if(_0x605010[_0xf77a('0x3f')][_0xf77a('0x49')]){_0x2d9430[_0xf77a('0x46')]=_[_0xf77a('0x4a')](_0x2d9430[_0xf77a('0x46')],{'$or':_['map'](_0x2d9430[_0xf77a('0x41')],function(_0x11f211){var _0x354452={};_0x354452[_0x11f211]={'$like':'%'+_0x605010[_0xf77a('0x3f')][_0xf77a('0x49')]+'%'};return _0x354452;})});}_0x2d9430=_[_0xf77a('0x4a')]({},_0x2d9430,_0x605010['options']);return _0x142002[_0xf77a('0x94')](_0x2d9430);}})[_0xf77a('0x1c')](function(_0x12538d){if(_0x12538d){_0x312fda=_0x12538d['length'];if(!_0x605010['query'][_0xf77a('0x43')](_0xf77a('0x5f'))){_0x2d9430[_0xf77a('0x44')]=qs['limit'](_0x605010[_0xf77a('0x3f')][_0xf77a('0x44')]);_0x2d9430[_0xf77a('0x2c')]=qs[_0xf77a('0x2c')](_0x605010['query'][_0xf77a('0x2c')]);}return _0x142002['getApplications'](_0x2d9430);}})[_0xf77a('0x1c')](function(_0x83444d){if(_0x83444d){return _0x83444d?{'count':_0x312fda,'rows':_0x83444d}:null;}})[_0xf77a('0x1c')](respondWithResult(_0x1e528c,null))[_0xf77a('0x26')](handleError(_0x1e528c,null));};exports[_0xf77a('0x95')]=function(_0x4d70e3,_0x30847a,_0x5011c2){var _0x155fec={'raw':!![],'where':{}};var _0x543bee={};var _0x2a2f7b={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x4d70e3['params']['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x30847a,null))[_0xf77a('0x1c')](function(_0x458763){if(_0x458763){_0x543bee[_0xf77a('0x3d')]=_['keys'](db[_0xf77a('0x96')][_0xf77a('0x3c')]);_0x543bee['query']=_['keys'](_0x4d70e3[_0xf77a('0x3f')]);_0x543bee[_0xf77a('0x47')]=_[_0xf77a('0x40')](_0x543bee[_0xf77a('0x3d')],_0x543bee['query']);_0x155fec[_0xf77a('0x41')]=_[_0xf77a('0x40')](_0x543bee[_0xf77a('0x3d')],qs['fields'](_0x4d70e3['query']['fields']));_0x155fec['attributes']=_0x155fec[_0xf77a('0x41')][_0xf77a('0x56')]?_0x155fec[_0xf77a('0x41')]:_0x543bee[_0xf77a('0x3d')];if(!_0x4d70e3[_0xf77a('0x3f')][_0xf77a('0x43')](_0xf77a('0x5f'))){_0x155fec[_0xf77a('0x44')]=qs[_0xf77a('0x44')](_0x4d70e3['query'][_0xf77a('0x44')]);_0x155fec[_0xf77a('0x2c')]=qs[_0xf77a('0x2c')](_0x4d70e3[_0xf77a('0x3f')][_0xf77a('0x2c')]);}_0x155fec[_0xf77a('0x60')]=qs[_0xf77a('0x45')](_0x4d70e3[_0xf77a('0x3f')][_0xf77a('0x45')]);_0x155fec[_0xf77a('0x46')]=qs[_0xf77a('0x47')](_['pick'](_0x4d70e3[_0xf77a('0x3f')],_0x543bee[_0xf77a('0x47')]));_0x155fec[_0xf77a('0x46')][_0xf77a('0x5b')]=_0x458763['id'];if(_0x4d70e3[_0xf77a('0x3f')][_0xf77a('0x49')]){_0x155fec['where']=_[_0xf77a('0x4a')](_0x155fec[_0xf77a('0x46')],{'$or':_[_0xf77a('0x66')](_0x155fec[_0xf77a('0x41')],function(_0x39eaf1){var _0xdf118d={};_0xdf118d[_0x39eaf1]={'$like':'%'+_0x4d70e3['query'][_0xf77a('0x49')]+'%'};return _0xdf118d;})});}if(_0x4d70e3[_0xf77a('0x3f')]['$gte']){var _0x59033a=_0x4d70e3[_0xf77a('0x3f')][_0xf77a('0x97')][_0xf77a('0x98')](',');var _0x17ec34={};_0x17ec34[_0x59033a[0x0]]={'$gte':moment(_0x59033a[0x1])[_0xf77a('0x99')]('YYYY-MM-DD\x20HH:mm:ss')};_0x155fec[_0xf77a('0x46')]=_[_0xf77a('0x4a')](_0x155fec[_0xf77a('0x46')],_0x17ec34);}_0x155fec=_[_0xf77a('0x4a')]({},_0x155fec,_0x4d70e3[_0xf77a('0x4d')]);return db[_0xf77a('0x96')][_0xf77a('0x2b')]({'where':_0x155fec['where']})['then'](function(_0x4d80f2){_0x2a2f7b['count']=_0x4d80f2;if(_0x4d70e3[_0xf77a('0x3f')][_0xf77a('0x4f')]){_0x155fec['include']=[{'all':!![]}];}return db[_0xf77a('0x96')][_0xf77a('0x51')](_0x155fec);})['then'](function(_0x21d6b0){_0x2a2f7b[_0xf77a('0x52')]=_0x21d6b0;return _0x2a2f7b;});}})[_0xf77a('0x1c')](respondWithFilteredResult(_0x30847a,_0x155fec))[_0xf77a('0x26')](handleError(_0x30847a,null));};exports[_0xf77a('0x36')]=function(_0x1db935,_0x104531,_0x5f2397){var _0xb53cfa,_0x175cd0={},_0x3e32a2;if(_0x1db935[_0xf77a('0x58')]['to']){_0x3e32a2=_0x1db935[_0xf77a('0x58')]['to'][_0xf77a('0x98')](',')[0x0];}return db[_0xf77a('0x4e')][_0xf77a('0x57')]({'where':{'id':_0x1db935[_0xf77a('0x54')]['id']},'include':[{'model':db[_0xf77a('0x9a')],'as':_0xf77a('0x9b'),'include':[{'model':db[_0xf77a('0x87')],'as':'Contacts','where':{'email':_0x3e32a2},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xf77a('0x3a')],'as':_0xf77a('0x3b'),'raw':!![]}]})[_0xf77a('0x1c')](handleEntityNotFound(_0x104531,null))['then'](function(_0x302539){if(_0x302539){_0xb53cfa=_0x302539;if(_0x302539[_0xf77a('0x3b')]){if(_[_0xf77a('0x6a')](_0x1db935[_0xf77a('0x58')][_0xf77a('0x9c')])){_0x1db935[_0xf77a('0x58')]['from']=util[_0xf77a('0x99')](_0xf77a('0x9d'),_0x302539['name'],_0x302539[_0xf77a('0x68')]||_0x302539[_0xf77a('0x3b')]['user']);}if(_0x1db935[_0xf77a('0x58')][_0xf77a('0x9e')]&&_0x1db935[_0xf77a('0x58')][_0xf77a('0x9e')][_0xf77a('0x56')]){for(var _0x4530fc=0x0;_0x4530fc<_0x1db935['body']['attachments'][_0xf77a('0x56')];_0x4530fc+=0x1){_0x1db935[_0xf77a('0x58')]['attachments'][_0x4530fc]={'filename':_0x1db935['body']['attachments'][_0x4530fc][_0xf77a('0x35')],'path':path[_0xf77a('0x9f')](config['root'],'server/files/attachments',_0x1db935[_0xf77a('0x58')]['attachments'][_0x4530fc]['basename'])};}}var _0x4a95fd={'tls':{'rejectUnauthorized':![]}};if(_[_0xf77a('0x6a')](_0x302539[_0xf77a('0x3b')][_0xf77a('0x74')])){if(_0x302539[_0xf77a('0x3b')][_0xf77a('0x71')]){_0x4a95fd['auth']={'user':_0x302539[_0xf77a('0x3b')]['user'],'pass':_0x302539[_0xf77a('0x3b')][_0xf77a('0xa0')]};}_0x4a95fd[_0xf77a('0x72')]=_0x302539[_0xf77a('0x3b')][_0xf77a('0x72')];_0x4a95fd[_0xf77a('0x73')]=_0x302539[_0xf77a('0x3b')][_0xf77a('0x73')];_0x4a95fd[_0xf77a('0xa1')]=_0x302539[_0xf77a('0x3b')][_0xf77a('0xa1')];}else{_0x4a95fd[_0xf77a('0x74')]=_0x302539[_0xf77a('0x3b')][_0xf77a('0x74')];_0x4a95fd[_0xf77a('0xa2')]={'user':_0x302539[_0xf77a('0x3b')][_0xf77a('0x6d')],'pass':_0x302539[_0xf77a('0x3b')][_0xf77a('0xa0')]};}return respondWithRpcPromise(_0xf77a('0xa3'),_0xf77a('0xa4'),{'account':_0x4a95fd,'message':_0x1db935[_0xf77a('0x58')]});}else{throw new Error(_0xf77a('0xa5'));}}})[_0xf77a('0x1c')](function(_0x474750){if(_0x474750){_0x175cd0=_0x474750;if(_0xb53cfa[_0xf77a('0x9b')]){if(_0xb53cfa[_0xf77a('0x9b')][_0xf77a('0xa6')][_0xf77a('0x56')]){return _0xb53cfa[_0xf77a('0x9b')][_0xf77a('0xa6')][0x0];}else{return db['CmContact'][_0xf77a('0x5d')](_[_0xf77a('0xa7')](_0x1db935['body'],{'firstName':_0x1db935['body']['to'],'email':_0x1db935['body']['to'],'phone':_0x1db935[_0xf77a('0x58')]['to'],'ListId':_0xb53cfa[_0xf77a('0x69')]}));}}else{throw new Error(_0xf77a('0xa5'));}}})[_0xf77a('0x1c')](function(_0x42c428){if(_0x42c428){var _0x1d68ff={'UserId':_0x1db935[_0xf77a('0x6d')]['id'],'ContactId':_0x42c428['id'],'MailAccountId':_0xb53cfa['id'],'inReplyTo':_0x175cd0['messageId'],'to':_0x1db935[_0xf77a('0x58')]['from'],'cc':_0x1db935[_0xf77a('0x58')]['cc'],'subject':_0x1db935[_0xf77a('0x58')][_0xf77a('0xa8')],'attach':_0x1db935[_0xf77a('0x58')][_0xf77a('0xa9')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xf77a('0x99')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xf77a('0xaa'),'lastMsgBody':_0x1db935[_0xf77a('0x58')][_0xf77a('0x58')],'Messages':[_[_0xf77a('0x4a')](_0x1db935[_0xf77a('0x58')],{'messageId':_0x175cd0['messageId'],'sentAt':moment()[_0xf77a('0x99')](_0xf77a('0xab')),'read':!![],'MailAccountId':_0xb53cfa['id'],'UserId':_0x1db935['user']['id'],'ContactId':_0x42c428['id']})]};if(_0x1db935[_0xf77a('0x58')][_0xf77a('0xac')]){_0x1d68ff=_[_0xf77a('0x4a')](_0x1d68ff,_0x1db935[_0xf77a('0x58')][_0xf77a('0xac')]);}return db['MailInteraction'][_0xf77a('0x5d')](_0x1d68ff,{'include':[{'model':db[_0xf77a('0x96')],'as':_0xf77a('0xad')}]});}})['then'](respondWithResult(_0x104531,null))[_0xf77a('0x26')](handleError(_0x104531,null));};exports[_0xf77a('0xae')]=function(_0x2a1bc6,_0x4ea1bf,_0xefd58a){return db[_0xf77a('0x4e')]['find']({'where':{'id':_0x2a1bc6[_0xf77a('0x54')]['id']},'include':[{'model':db[_0xf77a('0x3a')],'as':_0xf77a('0x3b'),'raw':!![]}]})[_0xf77a('0x1c')](handleEntityNotFound(_0x4ea1bf,null))['then'](function(_0x86b122){if(_0x86b122&&_0x86b122[_0xf77a('0x3b')]){var _0x352b72={'id':_0x86b122['id'],'tls':{'rejectUnauthorized':![]}};if(_0x86b122['Smtp'][_0xf77a('0x74')]){_0x352b72[_0xf77a('0x74')]=_0x86b122[_0xf77a('0x3b')][_0xf77a('0x74')];}else{_0x352b72['host']=_0x86b122['Smtp'][_0xf77a('0x72')];_0x352b72[_0xf77a('0x73')]=_0x86b122[_0xf77a('0x3b')]['port'];_0x352b72[_0xf77a('0xa1')]=_0x86b122[_0xf77a('0x3b')][_0xf77a('0xa1')];}if(_0x86b122[_0xf77a('0x3b')][_0xf77a('0x71')]){_0x352b72[_0xf77a('0xa2')]={'user':_0x86b122[_0xf77a('0x3b')][_0xf77a('0x6d')],'pass':_0x86b122[_0xf77a('0x3b')][_0xf77a('0xa0')]};}return respondWithRpcPromise(_0xf77a('0xaf'),_0xf77a('0xae'),{'account':_0x352b72});}})[_0xf77a('0x1c')](respondWithResult(_0x4ea1bf,null))['catch'](handleError(_0x4ea1bf,null));};exports[_0xf77a('0x32')]=function(_0x24a1f7,_0x4cc784){return db['MailAccount']['find']({'where':{'id':_0x24a1f7[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x4cc784,null))[_0xf77a('0x1c')](function(_0x403fef){if(_0x403fef&&_0x403fef[_0xf77a('0x74')]){throw new db[(_0xf77a('0xb0'))][(_0xf77a('0xb1'))](_0xf77a('0xb2'));}return _0x403fef;})[_0xf77a('0x1c')](removeEntity(_0x4cc784,null))[_0xf77a('0x26')](handleError(_0x4cc784,null));};exports[_0xf77a('0xb3')]=function(_0x3001b8,_0x3967cc,_0x39a8b5){return db[_0xf77a('0x4e')][_0xf77a('0x57')]({'where':{'id':_0x3001b8[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x3967cc,null))[_0xf77a('0x1c')](function(_0x3cfb00){if(_0x3cfb00){return _0x3cfb00[_0xf77a('0xb3')](_0x3001b8[_0xf77a('0x58')][_0xf77a('0x62')],_[_0xf77a('0x86')](_0x3001b8[_0xf77a('0x58')],['ids','id'])||{})[_0xf77a('0xb4')](function(_0xaf4cc4){for(var _0x5e7ab1=0x0;_0x5e7ab1<_0x3001b8['body']['ids'][_0xf77a('0x56')];_0x5e7ab1+=0x1){socket[_0xf77a('0xb5')](_0xf77a('0xb6'),{'UserId':_0x3001b8[_0xf77a('0x58')][_0xf77a('0x62')][_0x5e7ab1],'MailAccountId':_0x3001b8[_0xf77a('0x54')]['id']});}return _0xaf4cc4;});}})['then'](respondWithResult(_0x3967cc,null))[_0xf77a('0x26')](handleError(_0x3967cc,null));};exports[_0xf77a('0xb7')]=function(_0x2c78bb,_0x2374cc,_0x30ad21){var _0x1dc1d6;return db[_0xf77a('0x4e')][_0xf77a('0x57')]({'where':{'id':_0x2c78bb['params']['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x2374cc,null))[_0xf77a('0x1c')](function(_0x5b65b4){if(_0x5b65b4){return _0x5b65b4[_0xf77a('0xb7')](_0x2c78bb[_0xf77a('0x3f')]['ids'])[_0xf77a('0x1c')](function(_0x300274){if(_['isArray'](_0x2c78bb[_0xf77a('0x3f')][_0xf77a('0x62')])){for(var _0x3c7914=0x0;_0x3c7914<_0x2c78bb[_0xf77a('0x3f')][_0xf77a('0x62')][_0xf77a('0x56')];_0x3c7914+=0x1){socket[_0xf77a('0xb5')](_0xf77a('0xb8'),{'UserId':_0x2c78bb[_0xf77a('0x3f')][_0xf77a('0x62')][_0x3c7914],'MailAccountId':_0x2c78bb[_0xf77a('0x54')]['id']});}}else{socket[_0xf77a('0xb5')](_0xf77a('0xb8'),{'UserId':_0x2c78bb[_0xf77a('0x3f')][_0xf77a('0x62')],'MailAccountId':_0x2c78bb[_0xf77a('0x54')]['id']});}});}})[_0xf77a('0x1c')](respondWithStatusCode(_0x2374cc,null))['catch'](handleError(_0x2374cc,null));};exports['getAgents']=function(_0x2c2b10,_0x3a283a,_0x2f0f2b){var _0x4f4f6c={};var _0x4d4b3a={};var _0x38ea8d;var _0xab8d32;return db[_0xf77a('0x4e')][_0xf77a('0x5e')]({'where':{'id':_0x2c2b10[_0xf77a('0x54')]['id']}})[_0xf77a('0x1c')](handleEntityNotFound(_0x3a283a,null))[_0xf77a('0x1c')](function(_0x210af7){if(_0x210af7){_0x38ea8d=_0x210af7;_0x4d4b3a[_0xf77a('0x3d')]=_[_0xf77a('0x3e')](db[_0xf77a('0x89')][_0xf77a('0x3c')]);_0x4d4b3a[_0xf77a('0x3f')]=_[_0xf77a('0x3e')](_0x2c2b10[_0xf77a('0x3f')]);_0x4d4b3a[_0xf77a('0x47')]=_['intersection'](_0x4d4b3a[_0xf77a('0x3d')],_0x4d4b3a[_0xf77a('0x3f')]);_0x4f4f6c[_0xf77a('0x41')]=_[_0xf77a('0x40')](_0x4d4b3a[_0xf77a('0x3d')],qs[_0xf77a('0x42')](_0x2c2b10[_0xf77a('0x3f')][_0xf77a('0x42')]));_0x4f4f6c[_0xf77a('0x41')]=_0x4f4f6c[_0xf77a('0x41')]['length']?_0x4f4f6c[_0xf77a('0x41')]:_0x4d4b3a['model'];_0x4f4f6c[_0xf77a('0x60')]=qs[_0xf77a('0x45')](_0x2c2b10['query'][_0xf77a('0x45')]);_0x4f4f6c[_0xf77a('0x46')]=qs[_0xf77a('0x47')](_[_0xf77a('0x48')](_0x2c2b10[_0xf77a('0x3f')],_0x4d4b3a[_0xf77a('0x47')]));if(_0x2c2b10[_0xf77a('0x3f')][_0xf77a('0x49')]){_0x4f4f6c[_0xf77a('0x46')]=_['merge'](_0x4f4f6c[_0xf77a('0x46')],{'$or':_[_0xf77a('0x66')](_0x4f4f6c[_0xf77a('0x41')],function(_0x50bd77){var _0x42997f={};_0x42997f[_0x50bd77]={'$like':'%'+_0x2c2b10[_0xf77a('0x3f')][_0xf77a('0x49')]+'%'};return _0x42997f;})});}_0x4f4f6c=_[_0xf77a('0x4a')]({},_0x4f4f6c,_0x2c2b10[_0xf77a('0x4d')]);return _0x38ea8d[_0xf77a('0xb9')](_0x4f4f6c);}})[_0xf77a('0x1c')](function(_0x7ea454){if(_0x7ea454){_0xab8d32=_0x7ea454[_0xf77a('0x56')];if(!_0x2c2b10[_0xf77a('0x3f')][_0xf77a('0x43')](_0xf77a('0x5f'))){_0x4f4f6c[_0xf77a('0x44')]=qs[_0xf77a('0x44')](_0x2c2b10[_0xf77a('0x3f')][_0xf77a('0x44')]);_0x4f4f6c[_0xf77a('0x2c')]=qs[_0xf77a('0x2c')](_0x2c2b10['query'][_0xf77a('0x2c')]);}return _0x38ea8d['getAgents'](_0x4f4f6c);}})[_0xf77a('0x1c')](function(_0x38b26e){if(_0x38b26e){return _0x38b26e?{'count':_0xab8d32,'rows':_0x38b26e}:null;}})[_0xf77a('0x1c')](respondWithResult(_0x3a283a,null))[_0xf77a('0x26')](handleError(_0x3a283a,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 98f1f63..a64e511 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 _0xc18d=['save','remove','emit','hook','../../mysqldb'];(function(_0x45ad7d,_0x4f2724){var _0x40e590=function(_0x499c5f){while(--_0x499c5f){_0x45ad7d['push'](_0x45ad7d['shift']());}};_0x40e590(++_0x4f2724);}(_0xc18d,0xf9));var _0xdc18=function(_0x44b711,_0x1dae42){_0x44b711=_0x44b711-0x0;var _0xcfd1be=_0xc18d[_0x44b711];return _0xcfd1be;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xdc18('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdc18('0x1'),'afterUpdate':'update','afterDestroy':_0xdc18('0x2')};function emitEvent(_0xc94f16){return function(_0x47ff8d,_0x382ff3,_0x22d870){MailAccountEvents[_0xdc18('0x3')](_0xc94f16+':'+_0x47ff8d['id'],_0x47ff8d);MailAccountEvents['emit'](_0xc94f16,_0x47ff8d);_0x22d870(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xdc18('0x4')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xf4d5=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xf4d5,0x138));var _0x5f4d=function(_0x22a1b0,_0x235470){_0x22a1b0=_0x22a1b0-0x0;var _0x99019e=_0xf4d5[_0x22a1b0];return _0x99019e;};'use strict';var EventEmitter=require(_0x5f4d('0x0'));var MailAccount=require(_0x5f4d('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x5f4d('0x2')](0x0);var events={'afterCreate':_0x5f4d('0x3'),'afterUpdate':_0x5f4d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x94a577){return function(_0x1709d5,_0xa53f1e,_0x43d7a7){MailAccountEvents['emit'](_0x94a577+':'+_0x1709d5['id'],_0x1709d5);MailAccountEvents[_0x5f4d('0x5')](_0x94a577,_0x1709d5);_0x43d7a7(null);};}for(var e in events){if(events[_0x5f4d('0x6')](e)){var event=events[e];MailAccount[_0x5f4d('0x7')](e,emitEvent(event));}}module[_0x5f4d('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 780340f..5fd5da0 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 _0xd1ab=['exports','define','MailAccount','mail_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0xb5f114,_0x474cdc){var _0x1e9429=function(_0x4ef082){while(--_0x4ef082){_0xb5f114['push'](_0xb5f114['shift']());}};_0x1e9429(++_0x474cdc);}(_0xd1ab,0x130));var _0xbd1a=function(_0x249c67,_0x13df73){_0x249c67=_0x249c67-0x0;var _0x48c9e9=_0xd1ab[_0x249c67];return _0x48c9e9;};'use strict';var _=require(_0xbd1a('0x0'));var util=require(_0xbd1a('0x1'));var logger=require('../../config/logger')(_0xbd1a('0x2'));var moment=require(_0xbd1a('0x3'));var BPromise=require(_0xbd1a('0x4'));var rp=require(_0xbd1a('0x5'));var attributes=require('./mailAccount.attributes');module[_0xbd1a('0x6')]=function(_0x59581c,_0x139059){return _0x59581c[_0xbd1a('0x7')](_0xbd1a('0x8'),attributes,{'tableName':_0xbd1a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43ce=['moment','exports','mail_accounts','lodash','../../config/logger','api'];(function(_0x2beeb9,_0x415c85){var _0x3f7f25=function(_0x1890d1){while(--_0x1890d1){_0x2beeb9['push'](_0x2beeb9['shift']());}};_0x3f7f25(++_0x415c85);}(_0x43ce,0x117));var _0xe43c=function(_0x2e2053,_0x5794d3){_0x2e2053=_0x2e2053-0x0;var _0x2fbc78=_0x43ce[_0x2e2053];return _0x2fbc78;};'use strict';var _=require(_0xe43c('0x0'));var util=require('util');var logger=require(_0xe43c('0x1'))(_0xe43c('0x2'));var moment=require(_0xe43c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./mailAccount.attributes');module[_0xe43c('0x4')]=function(_0x221d40,_0x29053d){return _0x221d40['define']('MailAccount',attributes,{'tableName':_0xe43c('0x5'),'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 92c87b7..c7db32b 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 _0x71fa=['then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetMailAccount','ShowMailAccount','NotifyMailAccount','mail','CmContact','rawAttributes','updatedAt','CompanyId','ListId','body','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','Contacts','DESC','MailApplication','Smtp','applications','orderBy','priority','autoclose','length','close','*,*,*,*','Applications','create','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','spread','update','interaction','get','created','originTo','originCc','bcc','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request'];(function(_0x4a0505,_0x1978e2){var _0x2de63c=function(_0x20664e){while(--_0x20664e){_0x4a0505['push'](_0x4a0505['shift']());}};_0x2de63c(++_0x1978e2);}(_0x71fa,0x175));var _0xa71f=function(_0x385236,_0x35d695){_0x385236=_0x385236-0x0;var _0x2f8988=_0x71fa[_0x385236];return _0x2f8988;};'use strict';var _=require(_0xa71f('0x0'));var util=require(_0xa71f('0x1'));var moment=require(_0xa71f('0x2'));var BPromise=require('bluebird');var rs=require(_0xa71f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa71f('0x4'));var logger=require('../../config/logger')(_0xa71f('0x5'));var config=require(_0xa71f('0x6'));var jayson=require(_0xa71f('0x7'));var client=jayson['client'][_0xa71f('0x8')]({'port':0x232c});config[_0xa71f('0x9')]=_[_0xa71f('0xa')](config[_0xa71f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xa71f('0xb'))(new Redis(config[_0xa71f('0x9')]));require(_0xa71f('0xc'))[_0xa71f('0xd')](socket);function respondWithRpcPromise(_0x434af2,_0x3f0a7d,_0x4f0487){return new BPromise(function(_0x2429fb,_0x5e0f89){return client[_0xa71f('0xe')](_0x434af2,_0x4f0487)[_0xa71f('0xf')](function(_0x53e74c){logger[_0xa71f('0x10')](_0xa71f('0x11'),_0x3f0a7d,_0xa71f('0x12'));logger[_0xa71f('0x13')](_0xa71f('0x14'),_0x3f0a7d,_0xa71f('0x12'),JSON[_0xa71f('0x15')](_0x53e74c));if(_0x53e74c['error']){if(_0x53e74c[_0xa71f('0x16')][_0xa71f('0x17')]===0x1f4){logger[_0xa71f('0x16')]('MailAccount,\x20%s,\x20%s',_0x3f0a7d,_0x53e74c[_0xa71f('0x16')][_0xa71f('0x18')]);return _0x5e0f89(_0x53e74c['error'][_0xa71f('0x18')]);}logger[_0xa71f('0x16')](_0xa71f('0x11'),_0x3f0a7d,_0x53e74c[_0xa71f('0x16')][_0xa71f('0x18')]);return _0x2429fb(_0x53e74c[_0xa71f('0x16')][_0xa71f('0x18')]);}else{logger[_0xa71f('0x10')](_0xa71f('0x11'),_0x3f0a7d,_0xa71f('0x12'));_0x2429fb(_0x53e74c['result'][_0xa71f('0x18')]);}})[_0xa71f('0x19')](function(_0x34cf3b){logger[_0xa71f('0x16')](_0xa71f('0x11'),_0x3f0a7d,_0x34cf3b);_0x5e0f89(_0x34cf3b);});});}exports['GetMailAccount']=function(_0x18120a){var _0x201f31=this;return new Promise(function(_0x5e6ff5,_0x2624f2){return db[_0xa71f('0x1a')][_0xa71f('0x1b')]({'raw':_0x18120a[_0xa71f('0x1c')]?_0x18120a['options'][_0xa71f('0x1d')]===undefined?!![]:![]:!![],'where':_0x18120a[_0xa71f('0x1c')]?_0x18120a[_0xa71f('0x1c')][_0xa71f('0x1e')]||null:null,'attributes':_0x18120a['options']?_0x18120a[_0xa71f('0x1c')][_0xa71f('0x1f')]||null:null,'limit':_0x18120a[_0xa71f('0x1c')]?_0x18120a[_0xa71f('0x1c')][_0xa71f('0x20')]||null:null,'include':_0x18120a[_0xa71f('0x1c')]?_0x18120a[_0xa71f('0x1c')][_0xa71f('0x21')]?_[_0xa71f('0x22')](_0x18120a[_0xa71f('0x1c')]['include'],function(_0x5c6b46){return{'model':db[_0x5c6b46[_0xa71f('0x23')]],'as':_0x5c6b46['as'],'attributes':_0x5c6b46[_0xa71f('0x1f')],'include':_0x5c6b46[_0xa71f('0x21')]?_[_0xa71f('0x22')](_0x5c6b46[_0xa71f('0x21')],function(_0x2f27c5){return{'model':db[_0x2f27c5[_0xa71f('0x23')]],'as':_0x2f27c5['as'],'attributes':_0x2f27c5[_0xa71f('0x1f')],'include':_0x2f27c5[_0xa71f('0x21')]?_[_0xa71f('0x22')](_0x2f27c5['include'],function(_0x30b89d){return{'model':db[_0x30b89d[_0xa71f('0x23')]],'as':_0x30b89d['as'],'attributes':_0x30b89d['attributes']};}):[]};}):[]};}):[]:[]})[_0xa71f('0xf')](function(_0x32c8c1){logger['info']('GetMailAccount',_0x18120a);logger['debug'](_0xa71f('0x24'),_0x18120a,JSON[_0xa71f('0x15')](_0x32c8c1));_0x5e6ff5(_0x32c8c1);})[_0xa71f('0x19')](function(_0x3a7e80){logger[_0xa71f('0x16')](_0xa71f('0x24'),_0x3a7e80[_0xa71f('0x18')],_0x18120a);_0x2624f2(_0x201f31['error'](0x1f4,_0x3a7e80[_0xa71f('0x18')]));});});};exports[_0xa71f('0x25')]=function(_0x434439){var _0x7d6601=this;return new Promise(function(_0xb066e4,_0x4330f9){return db[_0xa71f('0x1a')]['find']({'raw':_0x434439[_0xa71f('0x1c')]?_0x434439['options'][_0xa71f('0x1d')]===undefined?!![]:![]:!![],'where':_0x434439['options']?_0x434439[_0xa71f('0x1c')][_0xa71f('0x1e')]||null:null,'attributes':_0x434439[_0xa71f('0x1c')]?_0x434439[_0xa71f('0x1c')][_0xa71f('0x1f')]||null:null,'include':_0x434439['options']?_0x434439[_0xa71f('0x1c')]['include']?_[_0xa71f('0x22')](_0x434439['options'][_0xa71f('0x21')],function(_0x413f44){return{'model':db[_0x413f44[_0xa71f('0x23')]],'as':_0x413f44['as'],'attributes':_0x413f44['attributes'],'include':_0x413f44['include']?_[_0xa71f('0x22')](_0x413f44[_0xa71f('0x21')],function(_0x2b8bd6){return{'model':db[_0x2b8bd6[_0xa71f('0x23')]],'as':_0x2b8bd6['as'],'attributes':_0x2b8bd6[_0xa71f('0x1f')],'include':_0x2b8bd6[_0xa71f('0x21')]?_[_0xa71f('0x22')](_0x2b8bd6[_0xa71f('0x21')],function(_0x4f0d1f){return{'model':db[_0x4f0d1f['model']],'as':_0x4f0d1f['as'],'attributes':_0x4f0d1f[_0xa71f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d9cff){logger[_0xa71f('0x10')](_0xa71f('0x25'),_0x434439);logger[_0xa71f('0x13')](_0xa71f('0x25'),_0x434439,JSON[_0xa71f('0x15')](_0x2d9cff));_0xb066e4(_0x2d9cff);})['catch'](function(_0x3834bd){logger[_0xa71f('0x16')](_0xa71f('0x25'),_0x3834bd[_0xa71f('0x18')],_0x434439);_0x4330f9(_0x7d6601['error'](0x1f4,_0x3834bd[_0xa71f('0x18')]));});});};exports[_0xa71f('0x26')]=function(_0x1ae787){var _0x51c8ad=this;return new Promise(function(_0x48b339,_0x106294){var _0x236c49={'body':_0x1ae787['body'],'channel':_0xa71f('0x27')};var _0xdb5a1f=_['difference'](_['keys'](db[_0xa71f('0x28')][_0xa71f('0x29')]),['createdAt',_0xa71f('0x2a'),_0xa71f('0x2b'),_0xa71f('0x2c')]);var _0x1809c3=![];if(_0x1ae787[_0xa71f('0x2d')]['id']){delete _0x1ae787[_0xa71f('0x2d')]['id'];}if(_[_0xa71f('0x2e')](_0x1ae787[_0xa71f('0x2d')]['from'])){return _0x106294(_0x51c8ad[_0xa71f('0x16')](0x1f4,_0xa71f('0x2f')));}if(_[_0xa71f('0x2e')](_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x2d')])||_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x2d')]===''){return _0x106294(_0x51c8ad['error'](0x1f4,_0xa71f('0x30')));}if(_[_0xa71f('0x2e')](_0x1ae787[_0xa71f('0x2d')]['mapKey'])){return _0x106294(_0x51c8ad[_0xa71f('0x16')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xdb5a1f));}if(!_[_0xa71f('0x31')](_0xdb5a1f,_0x1ae787['body'][_0xa71f('0x32')])){return _0x106294(_0x51c8ad[_0xa71f('0x16')](0x1f4,_0xa71f('0x33')+_0xdb5a1f));}var _0x4296a3={};_0x4296a3[_0x1ae787['body']['mapKey']]=_0x1ae787['body'][_0xa71f('0x34')];return db[_0xa71f('0x1a')][_0xa71f('0x35')]({'where':{'id':_0x1ae787[_0xa71f('0x36')]['id']},'include':[{'model':db[_0xa71f('0x37')],'as':_0xa71f('0x38'),'include':[{'model':db[_0xa71f('0x28')],'as':_0xa71f('0x39'),'where':_0x4296a3,'limit':0x1,'order':[[_0xa71f('0x2a'),_0xa71f('0x3a')]]}]},{'model':db[_0xa71f('0x3b')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0xa71f('0x3c')}]})[_0xa71f('0xf')](function(_0x48ce01){if(_0x48ce01&&_0x48ce01[_0xa71f('0x38')]){var _0x32b4ad=_0x48ce01['get']({'plain':!![]});_0x236c49[_0xa71f('0x36')]=_['omit'](_0x32b4ad,['Applications',_0xa71f('0x38')]);_0x236c49[_0xa71f('0x3d')]=_0x32b4ad['Applications'];_0x236c49['list']=_0x32b4ad['List'];_0x236c49['applications']=_[_0xa71f('0x3e')](_0x236c49[_0xa71f('0x3d')],[_0xa71f('0x3f')],['asc']);if(_0x236c49['account']&&_0x236c49[_0xa71f('0x36')][_0xa71f('0x40')]){_0x236c49['applications']['push']({'id':0x0,'priority':_0x236c49['applications'][_0xa71f('0x41')]+0x1,'app':_0xa71f('0x42'),'appdata':_0xa71f('0x40'),'interval':_0xa71f('0x43')});}if(_0x236c49[_0xa71f('0x36')]['Applications']){delete _0x236c49[_0xa71f('0x36')][_0xa71f('0x44')];}if(_0x236c49[_0xa71f('0x36')][_0xa71f('0x38')]){delete _0x236c49['account'][_0xa71f('0x38')];}if(_0x32b4ad[_0xa71f('0x38')][_0xa71f('0x39')]['length']){return _0x32b4ad[_0xa71f('0x38')]['Contacts'][0x0];}var _0xf43ec3=_[_0xa71f('0xa')](_0x1ae787['body'],{'firstName':_0x1ae787[_0xa71f('0x2d')]['from'],'ListId':_0x32b4ad['ListId']});_0xf43ec3[_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x32')]]=_0x1ae787[_0xa71f('0x2d')]['from'];return db[_0xa71f('0x28')][_0xa71f('0x45')](_0xf43ec3);}else{throw new Error('List\x20not\x20found');}})[_0xa71f('0xf')](function(_0x4830d1){_0x236c49[_0xa71f('0x46')]=_0x4830d1;if(_0x4830d1){if(!_0x1ae787['body'][_0xa71f('0x18')][_0xa71f('0x47')]){_0x1ae787['body'][_0xa71f('0x18')][_0xa71f('0x47')]=rs[_0xa71f('0x48')]()+'\x20'+_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x18')][_0xa71f('0x34')];}var _0x5c2fbf={'ContactId':_0x4830d1['id'],'MailAccountId':_0x1ae787[_0xa71f('0x36')]['id'],'inReplyTo':_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x18')][_0xa71f('0x47')],'to':_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x18')][_0xa71f('0x34')],'cc':_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x18')]['cc'],'subject':_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x18')][_0xa71f('0x49')],'attach':_0x1ae787['body']['message'][_0xa71f('0x4a')],'lastMsgAt':moment()[_0xa71f('0x4b')](_0xa71f('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x2d')]};return db[_0xa71f('0x4d')][_0xa71f('0x35')]({'where':{'closed':![],'MailAccountId':_0x1ae787['account']['id']},'include':[{'model':db[_0xa71f('0x4e')],'as':_0xa71f('0x4f'),'attributes':[_0xa71f('0x47')],'where':{'messageId':_0x1ae787[_0xa71f('0x2d')]['message']['inReplyTo']}}]})['then'](function(_0x1c52cf){if(_0x1c52cf){return[_0x1c52cf,![]];}return db[_0xa71f('0x4d')][_0xa71f('0x45')](_0x5c2fbf)['then'](function(_0x4ae707){return[_0x4ae707,!![]];});});}else{throw new Error(_0xa71f('0x50'));}})[_0xa71f('0x51')](function(_0x4e1caf,_0x396fc9){if(_0x4e1caf){_0x1809c3=_0x396fc9;if(!_0x396fc9){return _0x4e1caf[_0xa71f('0x52')]({'inReplyTo':_0x1ae787[_0xa71f('0x2d')]['message'][_0xa71f('0x47')],'to':_0x1ae787['body']['message'][_0xa71f('0x34')],'cc':_0x1ae787['body']['message']['cc'],'subject':_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x18')]['subject'],'attach':_0x4e1caf[_0xa71f('0x4a')]?_0x4e1caf['attach']:_0x1ae787['body']['message'][_0xa71f('0x4a')],'substatus':null,'substatusAt':moment()['format'](_0xa71f('0x4c')),'lastMsgAt':moment()[_0xa71f('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x2d')]});}else{return _0x4e1caf;}}})[_0xa71f('0xf')](function(_0xe526a3){_0x236c49[_0xa71f('0x53')]=_0xe526a3[_0xa71f('0x54')]({'plain':!![]});_0x236c49[_0xa71f('0x53')][_0xa71f('0x55')]=_0x1809c3;return db[_0xa71f('0x4e')][_0xa71f('0x45')]({'body':_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x2d')],'MailAccountId':_0x1ae787['account']['id'],'MailInteractionId':_0xe526a3['id'],'direction':'in','ContactId':_0x236c49[_0xa71f('0x46')]['id'],'messageId':_0x1ae787[_0xa71f('0x2d')]['message']['messageId'],'from':_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x18')][_0xa71f('0x34')],'to':_0x1ae787[_0xa71f('0x2d')]['message']['to'],'cc':_0x1ae787[_0xa71f('0x2d')]['message']['cc'],'subject':_0x1ae787['body']['message'][_0xa71f('0x49')],'attach':_0x1ae787[_0xa71f('0x2d')]['message'][_0xa71f('0x4a')],'Attachments':_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x18')]['attachments'],'originTo':_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x18')][_0xa71f('0x56')],'originCc':_0x1ae787[_0xa71f('0x2d')][_0xa71f('0x18')][_0xa71f('0x57')],'bcc':_0x1ae787['body'][_0xa71f('0x18')][_0xa71f('0x58')]},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})['then'](function(_0x12713e){_0x236c49[_0xa71f('0x18')]=_0x12713e;if(_0x236c49[_0xa71f('0x53')][_0xa71f('0x59')]){return db[_0xa71f('0x5a')][_0xa71f('0x35')]({'attributes':['id',_0xa71f('0x5b')],'where':{'id':_0x236c49[_0xa71f('0x53')][_0xa71f('0x59')]}})[_0xa71f('0xf')](function(_0x11213a){if(_0x11213a){_0x236c49[_0xa71f('0x3d')][_0xa71f('0x5c')]({'id':0x0,'priority':0x0,'app':_0xa71f('0x5d'),'appdata':_0x11213a['name']+','+(_0x236c49[_0xa71f('0x36')][_0xa71f('0x5e')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xa71f('0x5f'),_0xa71f('0x60'),_0x236c49);});}return respondWithRpcPromise(_0xa71f('0x5f'),'startRouting',_0x236c49);})[_0xa71f('0xf')](function(_0x1184ff){_0x48b339(_0x1184ff);})[_0xa71f('0x19')](function(_0x996356){_0x106294(_0x51c8ad[_0xa71f('0x16')](0x1f4,_0x996356[_0xa71f('0x18')]));});});}; \ No newline at end of file +var _0x38ec=['limit','map','include','model','ShowMailAccount','find','debug','body','difference','keys','createdAt','ListId','from','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','omit','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','CmContact','create','List\x20not\x20found','contact','messageId','generate','subject','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','spread','attach','format','interaction','get','created','attachments','originCc','bcc','Attachments','UserId','unshift','agent','startRouting','Start','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','raw','where','attributes'];(function(_0x19e800,_0x1d7cb0){var _0xd20191=function(_0x2d457f){while(--_0x2d457f){_0x19e800['push'](_0x19e800['shift']());}};_0xd20191(++_0x1d7cb0);}(_0x38ec,0x160));var _0xc38e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x38ec[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xc38e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc38e('0x1'));var fs=require('fs');var Redis=require(_0xc38e('0x2'));var db=require(_0xc38e('0x3'))['db'];var utils=require(_0xc38e('0x4'));var logger=require('../../config/logger')(_0xc38e('0x5'));var config=require('../../config/environment');var jayson=require(_0xc38e('0x6'));var client=jayson[_0xc38e('0x7')][_0xc38e('0x8')]({'port':0x232c});config[_0xc38e('0x9')]=_['defaults'](config[_0xc38e('0x9')],{'host':_0xc38e('0xa'),'port':0x18eb});var socket=require(_0xc38e('0xb'))(new Redis(config[_0xc38e('0x9')]));require(_0xc38e('0xc'))[_0xc38e('0xd')](socket);function respondWithRpcPromise(_0x59c67f,_0x225916,_0x589411){return new BPromise(function(_0x245c28,_0x5bb7d0){return client[_0xc38e('0xe')](_0x59c67f,_0x589411)[_0xc38e('0xf')](function(_0x4c1e80){logger[_0xc38e('0x10')](_0xc38e('0x11'),_0x225916,'request\x20sent');logger['debug'](_0xc38e('0x12'),_0x225916,_0xc38e('0x13'),JSON[_0xc38e('0x14')](_0x4c1e80));if(_0x4c1e80['error']){if(_0x4c1e80[_0xc38e('0x15')][_0xc38e('0x16')]===0x1f4){logger[_0xc38e('0x15')](_0xc38e('0x11'),_0x225916,_0x4c1e80[_0xc38e('0x15')][_0xc38e('0x17')]);return _0x5bb7d0(_0x4c1e80[_0xc38e('0x15')][_0xc38e('0x17')]);}logger[_0xc38e('0x15')](_0xc38e('0x11'),_0x225916,_0x4c1e80['error'][_0xc38e('0x17')]);return _0x245c28(_0x4c1e80[_0xc38e('0x15')][_0xc38e('0x17')]);}else{logger['info'](_0xc38e('0x11'),_0x225916,_0xc38e('0x13'));_0x245c28(_0x4c1e80[_0xc38e('0x18')][_0xc38e('0x17')]);}})[_0xc38e('0x19')](function(_0x12fad2){logger[_0xc38e('0x15')](_0xc38e('0x11'),_0x225916,_0x12fad2);_0x5bb7d0(_0x12fad2);});});}exports[_0xc38e('0x1a')]=function(_0x1f079f){var _0x5a1c59=this;return new Promise(function(_0x46c3b9,_0x1a45a6){return db[_0xc38e('0x1b')]['findAll']({'raw':_0x1f079f[_0xc38e('0x1c')]?_0x1f079f[_0xc38e('0x1c')][_0xc38e('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f079f[_0xc38e('0x1c')]?_0x1f079f['options'][_0xc38e('0x1e')]||null:null,'attributes':_0x1f079f['options']?_0x1f079f[_0xc38e('0x1c')][_0xc38e('0x1f')]||null:null,'limit':_0x1f079f['options']?_0x1f079f[_0xc38e('0x1c')][_0xc38e('0x20')]||null:null,'include':_0x1f079f[_0xc38e('0x1c')]?_0x1f079f[_0xc38e('0x1c')]['include']?_[_0xc38e('0x21')](_0x1f079f[_0xc38e('0x1c')][_0xc38e('0x22')],function(_0x5b91a7){return{'model':db[_0x5b91a7[_0xc38e('0x23')]],'as':_0x5b91a7['as'],'attributes':_0x5b91a7['attributes'],'include':_0x5b91a7[_0xc38e('0x22')]?_[_0xc38e('0x21')](_0x5b91a7[_0xc38e('0x22')],function(_0x2f6c7d){return{'model':db[_0x2f6c7d[_0xc38e('0x23')]],'as':_0x2f6c7d['as'],'attributes':_0x2f6c7d[_0xc38e('0x1f')],'include':_0x2f6c7d[_0xc38e('0x22')]?_['map'](_0x2f6c7d[_0xc38e('0x22')],function(_0x1e9488){return{'model':db[_0x1e9488[_0xc38e('0x23')]],'as':_0x1e9488['as'],'attributes':_0x1e9488[_0xc38e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc38e('0xf')](function(_0x1c1d64){logger[_0xc38e('0x10')](_0xc38e('0x1a'),_0x1f079f);logger['debug'](_0xc38e('0x1a'),_0x1f079f,JSON['stringify'](_0x1c1d64));_0x46c3b9(_0x1c1d64);})['catch'](function(_0x5ab039){logger[_0xc38e('0x15')](_0xc38e('0x1a'),_0x5ab039[_0xc38e('0x17')],_0x1f079f);_0x1a45a6(_0x5a1c59['error'](0x1f4,_0x5ab039[_0xc38e('0x17')]));});});};exports[_0xc38e('0x24')]=function(_0x321300){var _0x57f036=this;return new Promise(function(_0x432992,_0x5abbb1){return db[_0xc38e('0x1b')][_0xc38e('0x25')]({'raw':_0x321300['options']?_0x321300['options'][_0xc38e('0x1d')]===undefined?!![]:![]:!![],'where':_0x321300['options']?_0x321300[_0xc38e('0x1c')]['where']||null:null,'attributes':_0x321300['options']?_0x321300[_0xc38e('0x1c')][_0xc38e('0x1f')]||null:null,'include':_0x321300[_0xc38e('0x1c')]?_0x321300[_0xc38e('0x1c')][_0xc38e('0x22')]?_[_0xc38e('0x21')](_0x321300['options']['include'],function(_0x511b0f){return{'model':db[_0x511b0f[_0xc38e('0x23')]],'as':_0x511b0f['as'],'attributes':_0x511b0f[_0xc38e('0x1f')],'include':_0x511b0f[_0xc38e('0x22')]?_[_0xc38e('0x21')](_0x511b0f[_0xc38e('0x22')],function(_0x2064ab){return{'model':db[_0x2064ab[_0xc38e('0x23')]],'as':_0x2064ab['as'],'attributes':_0x2064ab['attributes'],'include':_0x2064ab[_0xc38e('0x22')]?_['map'](_0x2064ab[_0xc38e('0x22')],function(_0x30e757){return{'model':db[_0x30e757[_0xc38e('0x23')]],'as':_0x30e757['as'],'attributes':_0x30e757[_0xc38e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc38e('0xf')](function(_0x277da4){logger[_0xc38e('0x10')]('ShowMailAccount',_0x321300);logger[_0xc38e('0x26')](_0xc38e('0x24'),_0x321300,JSON['stringify'](_0x277da4));_0x432992(_0x277da4);})[_0xc38e('0x19')](function(_0x2a302a){logger['error'](_0xc38e('0x24'),_0x2a302a['message'],_0x321300);_0x5abbb1(_0x57f036[_0xc38e('0x15')](0x1f4,_0x2a302a[_0xc38e('0x17')]));});});};exports['NotifyMailAccount']=function(_0x565c62){var _0x33b9aa=this;return new Promise(function(_0x4a2ba3,_0x5c1698){var _0x231d20={'body':_0x565c62[_0xc38e('0x27')],'channel':'mail'};var _0x59a7ff=_[_0xc38e('0x28')](_[_0xc38e('0x29')](db['CmContact']['rawAttributes']),[_0xc38e('0x2a'),'updatedAt','CompanyId',_0xc38e('0x2b')]);var _0xc20bfa=![];if(_0x565c62[_0xc38e('0x27')]['id']){delete _0x565c62[_0xc38e('0x27')]['id'];}if(_['isNil'](_0x565c62['body'][_0xc38e('0x2c')])){return _0x5c1698(_0x33b9aa[_0xc38e('0x15')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xc38e('0x2d')](_0x565c62[_0xc38e('0x27')][_0xc38e('0x27')])||_0x565c62[_0xc38e('0x27')][_0xc38e('0x27')]===''){return _0x5c1698(_0x33b9aa[_0xc38e('0x15')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x565c62[_0xc38e('0x27')][_0xc38e('0x2e')])){return _0x5c1698(_0x33b9aa[_0xc38e('0x15')](0x1f4,_0xc38e('0x2f')+_0x59a7ff));}if(!_[_0xc38e('0x30')](_0x59a7ff,_0x565c62[_0xc38e('0x27')]['mapKey'])){return _0x5c1698(_0x33b9aa[_0xc38e('0x15')](0x1f4,_0xc38e('0x31')+_0x59a7ff));}var _0x4ca154={};_0x4ca154[_0x565c62[_0xc38e('0x27')][_0xc38e('0x2e')]]=_0x565c62[_0xc38e('0x27')]['from'];return db[_0xc38e('0x1b')][_0xc38e('0x25')]({'where':{'id':_0x565c62[_0xc38e('0x32')]['id']},'include':[{'model':db['CmList'],'as':_0xc38e('0x33'),'include':[{'model':db['CmContact'],'as':_0xc38e('0x34'),'where':_0x4ca154,'limit':0x1,'order':[[_0xc38e('0x35'),_0xc38e('0x36')]]}]},{'model':db['MailApplication'],'as':_0xc38e('0x37')},{'model':db[_0xc38e('0x38')],'as':_0xc38e('0x39')}]})[_0xc38e('0xf')](function(_0x1473bc){if(_0x1473bc&&_0x1473bc[_0xc38e('0x33')]){var _0x2e1223=_0x1473bc['get']({'plain':!![]});_0x231d20['account']=_[_0xc38e('0x3a')](_0x2e1223,[_0xc38e('0x37'),_0xc38e('0x33')]);_0x231d20[_0xc38e('0x3b')]=_0x2e1223[_0xc38e('0x37')];_0x231d20[_0xc38e('0x3c')]=_0x2e1223[_0xc38e('0x33')];_0x231d20['applications']=_[_0xc38e('0x3d')](_0x231d20[_0xc38e('0x3b')],[_0xc38e('0x3e')],[_0xc38e('0x3f')]);if(_0x231d20[_0xc38e('0x32')]&&_0x231d20[_0xc38e('0x32')][_0xc38e('0x40')]){_0x231d20[_0xc38e('0x3b')][_0xc38e('0x41')]({'id':0x0,'priority':_0x231d20[_0xc38e('0x3b')][_0xc38e('0x42')]+0x1,'app':_0xc38e('0x43'),'appdata':_0xc38e('0x40'),'interval':_0xc38e('0x44')});}if(_0x231d20[_0xc38e('0x32')]['Applications']){delete _0x231d20['account'][_0xc38e('0x37')];}if(_0x231d20[_0xc38e('0x32')][_0xc38e('0x33')]){delete _0x231d20[_0xc38e('0x32')][_0xc38e('0x33')];}if(_0x2e1223[_0xc38e('0x33')][_0xc38e('0x34')][_0xc38e('0x42')]){return _0x2e1223[_0xc38e('0x33')]['Contacts'][0x0];}var _0x33c687=_['defaults'](_0x565c62[_0xc38e('0x27')],{'firstName':_0x565c62[_0xc38e('0x27')]['from'],'ListId':_0x2e1223['ListId']});_0x33c687[_0x565c62[_0xc38e('0x27')]['mapKey']]=_0x565c62['body'][_0xc38e('0x2c')];return db[_0xc38e('0x45')][_0xc38e('0x46')](_0x33c687);}else{throw new Error(_0xc38e('0x47'));}})[_0xc38e('0xf')](function(_0x3f9c2a){_0x231d20[_0xc38e('0x48')]=_0x3f9c2a;if(_0x3f9c2a){if(!_0x565c62[_0xc38e('0x27')]['message'][_0xc38e('0x49')]){_0x565c62[_0xc38e('0x27')]['message'][_0xc38e('0x49')]=rs[_0xc38e('0x4a')]()+'\x20'+_0x565c62[_0xc38e('0x27')][_0xc38e('0x17')][_0xc38e('0x2c')];}var _0x26f3e8={'ContactId':_0x3f9c2a['id'],'MailAccountId':_0x565c62[_0xc38e('0x32')]['id'],'inReplyTo':_0x565c62['body'][_0xc38e('0x17')][_0xc38e('0x49')],'to':_0x565c62[_0xc38e('0x27')][_0xc38e('0x17')][_0xc38e('0x2c')],'cc':_0x565c62['body']['message']['cc'],'subject':_0x565c62['body']['message'][_0xc38e('0x4b')],'attach':_0x565c62[_0xc38e('0x27')]['message']['attach'],'lastMsgAt':moment()['format'](_0xc38e('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x565c62['body'][_0xc38e('0x27')]};return db[_0xc38e('0x4d')]['find']({'where':{'closed':![],'MailAccountId':_0x565c62[_0xc38e('0x32')]['id']},'include':[{'model':db[_0xc38e('0x4e')],'as':_0xc38e('0x4f'),'attributes':[_0xc38e('0x49')],'where':{'messageId':_0x565c62[_0xc38e('0x27')][_0xc38e('0x17')][_0xc38e('0x50')]}}]})[_0xc38e('0xf')](function(_0x714860){if(_0x714860){return[_0x714860,![]];}return db[_0xc38e('0x4d')][_0xc38e('0x46')](_0x26f3e8)[_0xc38e('0xf')](function(_0x7871e7){return[_0x7871e7,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xc38e('0x51')](function(_0x4fcf23,_0x241b79){if(_0x4fcf23){_0xc20bfa=_0x241b79;if(!_0x241b79){return _0x4fcf23['update']({'inReplyTo':_0x565c62['body'][_0xc38e('0x17')][_0xc38e('0x49')],'to':_0x565c62[_0xc38e('0x27')][_0xc38e('0x17')]['from'],'cc':_0x565c62[_0xc38e('0x27')][_0xc38e('0x17')]['cc'],'subject':_0x565c62[_0xc38e('0x27')][_0xc38e('0x17')]['subject'],'attach':_0x4fcf23[_0xc38e('0x52')]?_0x4fcf23[_0xc38e('0x52')]:_0x565c62[_0xc38e('0x27')]['message'][_0xc38e('0x52')],'substatus':null,'substatusAt':moment()[_0xc38e('0x53')](_0xc38e('0x4c')),'lastMsgAt':moment()[_0xc38e('0x53')](_0xc38e('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x565c62[_0xc38e('0x27')][_0xc38e('0x27')]});}else{return _0x4fcf23;}}})[_0xc38e('0xf')](function(_0x3c7219){_0x231d20[_0xc38e('0x54')]=_0x3c7219[_0xc38e('0x55')]({'plain':!![]});_0x231d20[_0xc38e('0x54')][_0xc38e('0x56')]=_0xc20bfa;return db['MailMessage'][_0xc38e('0x46')]({'body':_0x565c62[_0xc38e('0x27')][_0xc38e('0x27')],'MailAccountId':_0x565c62['account']['id'],'MailInteractionId':_0x3c7219['id'],'direction':'in','ContactId':_0x231d20[_0xc38e('0x48')]['id'],'messageId':_0x565c62[_0xc38e('0x27')][_0xc38e('0x17')][_0xc38e('0x49')],'from':_0x565c62[_0xc38e('0x27')][_0xc38e('0x17')][_0xc38e('0x2c')],'to':_0x565c62[_0xc38e('0x27')][_0xc38e('0x17')]['to'],'cc':_0x565c62[_0xc38e('0x27')][_0xc38e('0x17')]['cc'],'subject':_0x565c62['body'][_0xc38e('0x17')]['subject'],'attach':_0x565c62['body'][_0xc38e('0x17')][_0xc38e('0x52')],'Attachments':_0x565c62[_0xc38e('0x27')]['message'][_0xc38e('0x57')],'originTo':_0x565c62[_0xc38e('0x27')][_0xc38e('0x17')]['originTo'],'originCc':_0x565c62['body'][_0xc38e('0x17')][_0xc38e('0x58')],'bcc':_0x565c62['body'][_0xc38e('0x17')][_0xc38e('0x59')]},{'include':[{'model':db['Attachment'],'as':_0xc38e('0x5a')}]});})[_0xc38e('0xf')](function(_0x454a43){_0x231d20[_0xc38e('0x17')]=_0x454a43;if(_0x231d20['interaction']['UserId']){return db['User'][_0xc38e('0x25')]({'attributes':['id','name'],'where':{'id':_0x231d20[_0xc38e('0x54')][_0xc38e('0x5b')]}})[_0xc38e('0xf')](function(_0x30544e){if(_0x30544e){_0x231d20['applications'][_0xc38e('0x5c')]({'id':0x0,'priority':0x0,'app':_0xc38e('0x5d'),'appdata':_0x30544e['name']+','+(_0x231d20[_0xc38e('0x32')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xc38e('0x5e'),_0x231d20);});}return respondWithRpcPromise(_0xc38e('0x5f'),'startRouting',_0x231d20);})[_0xc38e('0xf')](function(_0x5e9b22){_0x4a2ba3(_0x5e9b22);})['catch'](function(_0x3c2b34){_0x5c1698(_0x33b9aa[_0xc38e('0x15')](0x1f4,_0x3c2b34[_0xc38e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index adf6bd2..e668560 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 _0x30f4=['remove','update','emit','removeListener','register','length','mailAccount:','save'];(function(_0x35c79d,_0x55a910){var _0x5a93e8=function(_0xf9026f){while(--_0xf9026f){_0x35c79d['push'](_0x35c79d['shift']());}};_0x5a93e8(++_0x55a910);}(_0x30f4,0xdf));var _0x430f=function(_0x2f691b,_0x2b25df){_0x2f691b=_0x2f691b-0x0;var _0x3ac64e=_0x30f4[_0x2f691b];return _0x3ac64e;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x430f('0x0'),_0x430f('0x1'),_0x430f('0x2')];function createListener(_0x1c6bc3,_0x3f81c8){return function(_0x30accd){_0x3f81c8[_0x430f('0x3')](_0x1c6bc3,_0x30accd);};}function removeListener(_0x4bfd54,_0x48b984){return function(){MailAccountEvents[_0x430f('0x4')](_0x4bfd54,_0x48b984);};}exports[_0x430f('0x5')]=function(_0x588db4){for(var _0x182769=0x0,_0x3cca1f=events[_0x430f('0x6')];_0x182769<_0x3cca1f;_0x182769++){var _0x59c1de=events[_0x182769];var _0x41baa9=createListener(_0x430f('0x7')+_0x59c1de,_0x588db4);MailAccountEvents['on'](_0x59c1de,_0x41baa9);}}; \ No newline at end of file +var _0x1658=['length','mailAccount:','save','update','removeListener'];(function(_0x171fdc,_0x16ae91){var _0x3782ea=function(_0x58b691){while(--_0x58b691){_0x171fdc['push'](_0x171fdc['shift']());}};_0x3782ea(++_0x16ae91);}(_0x1658,0x110));var _0x8165=function(_0x355e7f,_0x18d2cf){_0x355e7f=_0x355e7f-0x0;var _0x4aec9f=_0x1658[_0x355e7f];return _0x4aec9f;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x8165('0x0'),'remove',_0x8165('0x1')];function createListener(_0x274448,_0x384a39){return function(_0x5b3f98){_0x384a39['emit'](_0x274448,_0x5b3f98);};}function removeListener(_0x5d1b68,_0x51e3cd){return function(){MailAccountEvents[_0x8165('0x2')](_0x5d1b68,_0x51e3cd);};}exports['register']=function(_0xf9644f){for(var _0x2bb06a=0x0,_0x27ccb6=events[_0x8165('0x3')];_0x2bb06a<_0x27ccb6;_0x2bb06a++){var _0x12a383=events[_0x2bb06a];var _0x103675=createListener(_0x8165('0x4')+_0x12a383,_0xf9644f);MailAccountEvents['on'](_0x12a383,_0x103675);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 629a61a..c1fbe04 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 _0x9099=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','exports','multer','path','connect-timeout','express'];(function(_0x3058f0,_0x4f21c8){var _0x2dafac=function(_0x21a8e4){while(--_0x21a8e4){_0x3058f0['push'](_0x3058f0['shift']());}};_0x2dafac(++_0x4f21c8);}(_0x9099,0x1ac));var _0x9909=function(_0x27c24e,_0x5db1c7){_0x27c24e=_0x27c24e-0x0;var _0x39004a=_0x9099[_0x27c24e];return _0x39004a;};'use strict';var multer=require(_0x9909('0x0'));var util=require('util');var path=require(_0x9909('0x1'));var timeout=require(_0x9909('0x2'));var express=require(_0x9909('0x3'));var router=express[_0x9909('0x4')]();var auth=require(_0x9909('0x5'));var interaction=require(_0x9909('0x6'));var config=require(_0x9909('0x7'));var controller=require(_0x9909('0x8'));router[_0x9909('0x9')](_0x9909('0xa'),auth[_0x9909('0xb')](),controller[_0x9909('0xc')]);router[_0x9909('0xd')](_0x9909('0xa'),auth['isAuthenticated'](),controller[_0x9909('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9909('0xf')]=router; \ No newline at end of file +var _0xc788=['update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put'];(function(_0xbcd604,_0x5c6862){var _0x16a71e=function(_0xa68500){while(--_0xa68500){_0xbcd604['push'](_0xbcd604['shift']());}};_0x16a71e(++_0x5c6862);}(_0xc788,0xc4));var _0x8c78=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xc788[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var path=require(_0x8c78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c78('0x3')]();var auth=require(_0x8c78('0x4'));var interaction=require(_0x8c78('0x5'));var config=require(_0x8c78('0x6'));var controller=require(_0x8c78('0x7'));router['get'](_0x8c78('0x8'),auth[_0x8c78('0x9')](),controller[_0x8c78('0xa')]);router[_0x8c78('0xb')](_0x8c78('0x8'),auth['isAuthenticated'](),controller[_0x8c78('0xc')]);router[_0x8c78('0xd')](_0x8c78('0x8'),auth[_0x8c78('0x9')](),controller[_0x8c78('0xe')]);module[_0x8c78('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 0388ad5..678f899 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 _0x3b15=['sequelize','exports','INTEGER','STRING','*,*,*,*'];(function(_0x3fb00e,_0x5513da){var _0x5dc77f=function(_0x38fee1){while(--_0x38fee1){_0x3fb00e['push'](_0x3fb00e['shift']());}};_0x5dc77f(++_0x5513da);}(_0x3b15,0x140));var _0x53b1=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x3b15[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x53b1('0x0'));module[_0x53b1('0x1')]={'priority':{'type':Sequelize[_0x53b1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x53b1('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x53b1('0x3')](0x1000),'defaultValue':''},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x53b1('0x4')}}; \ No newline at end of file +var _0xcd9f=['STRING','*,*,*,*','sequelize','exports'];(function(_0x2e997e,_0x4edf31){var _0x5a6cb1=function(_0x3904da){while(--_0x3904da){_0x2e997e['push'](_0x2e997e['shift']());}};_0x5a6cb1(++_0x4edf31);}(_0xcd9f,0x1b6));var _0xfcd9=function(_0x573d8f,_0x2fcad2){_0x573d8f=_0x573d8f-0x0;var _0xc340f3=_0xcd9f[_0x573d8f];return _0xc340f3;};'use strict';var Sequelize=require(_0xfcd9('0x0'));module[_0xfcd9('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xfcd9('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xfcd9('0x2')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0xfcd9('0x2')]},'interval':{'type':Sequelize[_0xfcd9('0x2')],'defaultValue':_0xfcd9('0x3')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 76ed44e..8e5422c 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(_0x143992,_0x355f67){var _0x41e765=function(_0x5c010b){while(--_0x5c010b){_0x143992['push'](_0x143992['shift']());}};_0x41e765(++_0x355f67);}(_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'];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(_0x1d8d2a,_0x104f26){var _0x146cdf=function(_0x3f402f){while(--_0x3f402f){_0x1d8d2a['push'](_0x1d8d2a['shift']());}};_0x146cdf(++_0x104f26);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 ad32d35..2fa3f7f 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 _0x27a4=['util','../../config/logger','api','request-promise','exports','define','MailApplication','lodash'];(function(_0x5593bf,_0xa2880d){var _0x5c4f90=function(_0x21f82d){while(--_0x21f82d){_0x5593bf['push'](_0x5593bf['shift']());}};_0x5c4f90(++_0xa2880d);}(_0x27a4,0x1bf));var _0x427a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x27a4[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x427a('0x0'));var util=require(_0x427a('0x1'));var logger=require(_0x427a('0x2'))(_0x427a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x427a('0x4'));var attributes=require('./mailApplication.attributes');module[_0x427a('0x5')]=function(_0x4bdd9d,_0x2d9118){return _0x4bdd9d[_0x427a('0x6')](_0x427a('0x7'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0c7=['MailApplication','mail_applications','../../config/logger','moment','bluebird','request-promise','./mailApplication.attributes','exports','define'];(function(_0x2820ad,_0x3db242){var _0x1c3275=function(_0x4e55fd){while(--_0x4e55fd){_0x2820ad['push'](_0x2820ad['shift']());}};_0x1c3275(++_0x3db242);}(_0xf0c7,0xad));var _0x7f0c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf0c7[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7f0c('0x0'))('api');var moment=require(_0x7f0c('0x1'));var BPromise=require(_0x7f0c('0x2'));var rp=require(_0x7f0c('0x3'));var attributes=require(_0x7f0c('0x4'));module[_0x7f0c('0x5')]=function(_0x344675,_0x116c91){return _0x344675[_0x7f0c('0x6')](_0x7f0c('0x7'),attributes,{'tableName':_0x7f0c('0x8'),'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 7ed372c..389ea5d 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(_0x35f7e8,_0x54ae36){var _0x3b0b75=function(_0x23c57c){while(--_0x23c57c){_0x35f7e8['push'](_0x35f7e8['shift']());}};_0x3b0b75(++_0x54ae36);}(_0x7a54,0x106));var _0x47a5=function(_0x11746e,_0x5214f7){_0x11746e=_0x11746e-0x0;var _0x18a594=_0x7a54[_0x11746e];return _0x18a594;};'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 _0x9957=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','update','options','raw','attributes','limit','lodash','util','moment'];(function(_0x17c216,_0x1eed2a){var _0x2b2b39=function(_0x26a65a){while(--_0x26a65a){_0x17c216['push'](_0x17c216['shift']());}};_0x2b2b39(++_0x1eed2a);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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']('MailApplication,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['MailApplication'][_0x7995('0x19')](_0x291317['body'],{'raw':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291317['options']?_0x291317[_0x7995('0x1a')]['where']||null:null,'attributes':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1c')]||null:null,'limit':_0x291317[_0x7995('0x1a')]?_0x291317[_0x7995('0x1a')][_0x7995('0x1d')]||null:null})[_0x7995('0xc')](function(_0x5d40ae){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x5d40ae));_0x37a7d4(_0x5d40ae);})[_0x7995('0x17')](function(_0x475351){logger[_0x7995('0x13')]('UpdateMailApplication',_0x475351[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x475351[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 415c1cb..f9863ce 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 _0xb684=['put','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0xb684,0x17e));var _0x4b68=function(_0x26808f,_0x23c5d8){_0x26808f=_0x26808f-0x0;var _0x35be41=_0xb684[_0x26808f];return _0x35be41;};'use strict';var multer=require(_0x4b68('0x0'));var util=require(_0x4b68('0x1'));var path=require(_0x4b68('0x2'));var timeout=require(_0x4b68('0x3'));var express=require(_0x4b68('0x4'));var router=express[_0x4b68('0x5')]();var auth=require(_0x4b68('0x6'));var interaction=require(_0x4b68('0x7'));var config=require(_0x4b68('0x8'));var controller=require('./mailInteraction.controller');router[_0x4b68('0x9')]('/',auth[_0x4b68('0xa')](),controller[_0x4b68('0xb')]);router['get']('/describe',auth[_0x4b68('0xa')](),controller[_0x4b68('0xc')]);router[_0x4b68('0x9')](_0x4b68('0xd'),auth[_0x4b68('0xa')](),controller[_0x4b68('0xe')]);router[_0x4b68('0x9')](_0x4b68('0xf'),auth[_0x4b68('0xa')](),controller[_0x4b68('0x10')]);router[_0x4b68('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x4b68('0x11')]);router[_0x4b68('0x12')]('/',auth[_0x4b68('0xa')](),controller[_0x4b68('0x13')]);router[_0x4b68('0x12')]('/:id/messages',auth[_0x4b68('0xa')](),controller[_0x4b68('0x14')]);router[_0x4b68('0x12')](_0x4b68('0x15'),auth[_0x4b68('0xa')](),interaction[_0x4b68('0x16')](_0x4b68('0x17'),_0x4b68('0x18')),controller[_0x4b68('0x19')]);router[_0x4b68('0x1a')]('/:id',auth[_0x4b68('0xa')](),interaction[_0x4b68('0x16')](_0x4b68('0x17'),_0x4b68('0x1b')),controller[_0x4b68('0x1c')]);router['delete']('/:id',auth[_0x4b68('0xa')](),interaction[_0x4b68('0x16')](_0x4b68('0x17'),_0x4b68('0x1d')),controller[_0x4b68('0x1e')]);router[_0x4b68('0x1f')](_0x4b68('0x15'),auth[_0x4b68('0xa')](),controller[_0x4b68('0x20')]);module[_0x4b68('0x21')]=router; \ No newline at end of file +var _0xe5f1=['delete','mailinteraction:destroy','removeTags','exports','multer','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','mail','mailinteraction:update','update'];(function(_0x12f596,_0x398fea){var _0x3fbeab=function(_0x29e0dc){while(--_0x29e0dc){_0x12f596['push'](_0x12f596['shift']());}};_0x3fbeab(++_0x398fea);}(_0xe5f1,0xee));var _0x1e5f=function(_0x47e85c,_0x320f49){_0x47e85c=_0x47e85c-0x0;var _0x4f53b2=_0xe5f1[_0x47e85c];return _0x4f53b2;};'use strict';var multer=require(_0x1e5f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1e5f('0x1')]();var auth=require(_0x1e5f('0x2'));var interaction=require(_0x1e5f('0x3'));var config=require('../../config/environment');var controller=require('./mailInteraction.controller');router[_0x1e5f('0x4')]('/',auth[_0x1e5f('0x5')](),controller[_0x1e5f('0x6')]);router[_0x1e5f('0x4')](_0x1e5f('0x7'),auth[_0x1e5f('0x5')](),controller['describe']);router[_0x1e5f('0x4')](_0x1e5f('0x8'),auth[_0x1e5f('0x5')](),controller[_0x1e5f('0x9')]);router[_0x1e5f('0x4')](_0x1e5f('0xa'),auth['isAuthenticated'](),controller[_0x1e5f('0xb')]);router['get']('/:id/download',auth[_0x1e5f('0x5')](),controller[_0x1e5f('0xc')]);router[_0x1e5f('0xd')]('/',auth[_0x1e5f('0x5')](),controller[_0x1e5f('0xe')]);router['post'](_0x1e5f('0xa'),auth[_0x1e5f('0x5')](),controller[_0x1e5f('0xf')]);router[_0x1e5f('0xd')](_0x1e5f('0x10'),auth['isAuthenticated'](),interaction[_0x1e5f('0x11')]('mail',_0x1e5f('0x12')),controller['addTags']);router['put'](_0x1e5f('0x8'),auth['isAuthenticated'](),interaction['tracked'](_0x1e5f('0x13'),_0x1e5f('0x14')),controller[_0x1e5f('0x15')]);router[_0x1e5f('0x16')](_0x1e5f('0x8'),auth[_0x1e5f('0x5')](),interaction[_0x1e5f('0x11')](_0x1e5f('0x13'),_0x1e5f('0x17')),controller['destroy']);router[_0x1e5f('0x16')](_0x1e5f('0x10'),auth[_0x1e5f('0x5')](),controller[_0x1e5f('0x18')]);module[_0x1e5f('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index f8651c1..75defdc 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 _0x6238=['ENUM','out','getDataValue','lastMsgBody','fromString','split','slice','join','sequelize','html-to-text','iconv','exports','DATE','STRING','TEXT','long'];(function(_0xb43e2c,_0x17baba){var _0x4940b5=function(_0x4d790d){while(--_0x4d790d){_0xb43e2c['push'](_0xb43e2c['shift']());}};_0x4940b5(++_0x17baba);}(_0x6238,0x98));var _0x8623=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6238[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x8623('0x0'));var htmlToText=require(_0x8623('0x1'));var iconv=require(_0x8623('0x2'));module[_0x8623('0x3')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8623('0x4')]},'disposition':{'type':Sequelize[_0x8623('0x5')]},'note':{'type':Sequelize[_0x8623('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x8623('0x5')]},'cc':{'type':Sequelize[_0x8623('0x6')](_0x8623('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x8623('0x4')]},'substatus':{'type':Sequelize[_0x8623('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x8623('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x8623('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8623('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8623('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x8623('0x6')]('long'),'get':function(){try{return this[_0x8623('0xa')](_0x8623('0xb'))?htmlToText[_0x8623('0xc')](this['getDataValue'](_0x8623('0xb')),{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'ignoreImage':!![]})[_0x8623('0xd')]('\x0a')[_0x8623('0xe')](0x0,0x6)[_0x8623('0xf')]('\x0a'):null;}catch(_0xc1d05){return null;}}}}; \ No newline at end of file +var _0x2f36=['join','sequelize','html-to-text','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','getDataValue','lastMsgBody','fromString','split'];(function(_0xc54faf,_0x3ad988){var _0x88476f=function(_0x1a2d62){while(--_0x1a2d62){_0xc54faf['push'](_0xc54faf['shift']());}};_0x88476f(++_0x3ad988);}(_0x2f36,0x191));var _0x62f3=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x2f36[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0x62f3('0x0'));var htmlToText=require(_0x62f3('0x1'));var iconv=require(_0x62f3('0x2'));module[_0x62f3('0x3')]={'closed':{'type':Sequelize[_0x62f3('0x4')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x62f3('0x5')]},'disposition':{'type':Sequelize[_0x62f3('0x6')]},'note':{'type':Sequelize[_0x62f3('0x6')]},'inReplyTo':{'type':Sequelize[_0x62f3('0x6')](0x1fe)},'to':{'type':Sequelize[_0x62f3('0x6')]},'cc':{'type':Sequelize[_0x62f3('0x7')](_0x62f3('0x8'))},'subject':{'type':Sequelize[_0x62f3('0x7')]()},'attach':{'type':Sequelize[_0x62f3('0x4')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x62f3('0x5')]},'substatus':{'type':Sequelize[_0x62f3('0x6')](0x3c)},'substatusAt':{'type':Sequelize[_0x62f3('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x62f3('0x9')]('in',_0x62f3('0xa')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x62f3('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x62f3('0x9')]('in',_0x62f3('0xa')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x62f3('0x7')](_0x62f3('0x8')),'get':function(){try{return this[_0x62f3('0xb')](_0x62f3('0xc'))?htmlToText[_0x62f3('0xd')](this[_0x62f3('0xb')](_0x62f3('0xc')),{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'ignoreImage':!![]})[_0x62f3('0xe')]('\x0a')['slice'](0x0,0x6)[_0x62f3('0xf')]('\x0a'):null;}catch(_0x36122b){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 dd369d5..a40743b 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 _0x90db=['Account','email','color','MailInteraction','findAll','rows','catch','show','params','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','rawAttributes','sort','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','removeTags','find','unix','toString','join','root','server','files','tmp','interaction-%s.zip','from','subject','attachments','Attachment','Attachments','mkdirSync','each','basename','existsSync','readFileSync','build','message%d.eml','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','register','sendStatus','end','json','count','limit','status','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','where','pick','filter','merge','map','type','key','field','include','push','Tag','Tags','tag','distinct','read','MailMessage','Messages','direction','createdAt','includeAll','Users','Owner','internal'];(function(_0x36ed6c,_0x302b25){var _0x13a7e4=function(_0x429a79){while(--_0x429a79){_0x36ed6c['push'](_0x36ed6c['shift']());}};_0x13a7e4(++_0x302b25);}(_0x90db,0x1c0));var _0xb90d=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x90db[_0x37bd26];return _0xe83dc4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb90d('0x0'));var rimraf=require(_0xb90d('0x1'));var zipdir=require(_0xb90d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb90d('0x3'));var path=require(_0xb90d('0x4'));var sox=require(_0xb90d('0x5'));var csv=require(_0xb90d('0x6'));var ejs=require(_0xb90d('0x7'));var fs=require('fs');var _=require(_0xb90d('0x8'));var squel=require(_0xb90d('0x9'));var crypto=require(_0xb90d('0xa'));var jsforce=require(_0xb90d('0xb'));var deskjs=require(_0xb90d('0xc'));var toCsv=require(_0xb90d('0x6'));var querystring=require(_0xb90d('0xd'));var Papa=require('papaparse');var authService=require(_0xb90d('0xe'));var hardwareService=require(_0xb90d('0xf'));var Redis=require(_0xb90d('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xb90d('0x11'))(_0xb90d('0x12'));var utils=require(_0xb90d('0x13'));var config=require(_0xb90d('0x14'));var db=require(_0xb90d('0x15'))['db'];config['redis']=_[_0xb90d('0x16')](config['redis'],{'host':_0xb90d('0x17'),'port':0x18eb});var socket=require(_0xb90d('0x18'))(new Redis(config[_0xb90d('0x19')]));require(_0xb90d('0x1a'))[_0xb90d('0x1b')](socket);function respondWithStatusCode(_0x1152fb,_0x1f797c){_0x1f797c=_0x1f797c||0xcc;return function(_0x56c67c){if(_0x56c67c){return _0x1152fb[_0xb90d('0x1c')](_0x1f797c);}return _0x1152fb['status'](_0x1f797c)[_0xb90d('0x1d')]();};}function respondWithResult(_0x469d74,_0x5af3c4){_0x5af3c4=_0x5af3c4||0xc8;return function(_0x1b2324){if(_0x1b2324){return _0x469d74['status'](_0x5af3c4)[_0xb90d('0x1e')](_0x1b2324);}};}function respondWithFilteredResult(_0x396f3f,_0x36ee8a){return function(_0x23c136){if(_0x23c136){var _0x1a7b11=_0x23c136[_0xb90d('0x1f')],_0x47ee5d=_0x36ee8a['offset'],_0x135bf2=_0x36ee8a['offset']+_0x36ee8a[_0xb90d('0x20')],_0x4bd383;if(_0x135bf2>=_0x1a7b11){_0x135bf2=_0x1a7b11;_0x4bd383=0xc8;}else{_0x4bd383=0xce;}_0x396f3f[_0xb90d('0x21')](_0x4bd383);return _0x396f3f[_0xb90d('0x22')](_0xb90d('0x23'),_0x47ee5d+'-'+_0x135bf2+'/'+_0x1a7b11)[_0xb90d('0x1e')](_0x23c136);}return null;};}function patchUpdates(_0x134076){return function(_0x4d3a04){try{jsonpatch[_0xb90d('0x24')](_0x4d3a04,_0x134076,!![]);}catch(_0x14958c){return BPromise['reject'](_0x14958c);}return _0x4d3a04[_0xb90d('0x25')]();};}function saveUpdates(_0x21d28e,_0x3b3b80){return function(_0x39dcc4){if(_0x39dcc4){return _0x39dcc4[_0xb90d('0x26')](_0x21d28e)[_0xb90d('0x27')](function(_0x818e68){return _0x818e68;});}return null;};}function removeEntity(_0x24f299,_0x37b8ec){return function(_0x1cf8cc){if(_0x1cf8cc){return _0x1cf8cc[_0xb90d('0x28')]()[_0xb90d('0x27')](function(){_0x24f299[_0xb90d('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x280ec3,_0x54827c){return function(_0x130cc8){if(!_0x130cc8){_0x280ec3[_0xb90d('0x1c')](0x194);}return _0x130cc8;};}function handleError(_0x373246,_0x41273b){_0x41273b=_0x41273b||0x1f4;return function(_0x31aee9){logger[_0xb90d('0x29')](_0x31aee9[_0xb90d('0x2a')]);if(_0x31aee9[_0xb90d('0x2b')]){delete _0x31aee9[_0xb90d('0x2b')];}_0x373246[_0xb90d('0x21')](_0x41273b)['send'](_0x31aee9);};}exports[_0xb90d('0x2c')]=function(_0x12022d,_0x9428fe){var _0x112370={},_0x1f9151={},_0x21fcea={'count':0x0,'rows':[]};var _0x480d90=db['MailInteraction']['rawAttributes'];_0x1f9151[_0xb90d('0x2d')]=_['keys'](_0x480d90);_0x1f9151[_0xb90d('0x2e')]=_[_0xb90d('0x2f')](_0x12022d['query']);_0x1f9151[_0xb90d('0x30')]=_[_0xb90d('0x31')](_0x1f9151[_0xb90d('0x2d')],_0x1f9151[_0xb90d('0x2e')]);_0x112370[_0xb90d('0x32')]=_[_0xb90d('0x31')](_0x1f9151[_0xb90d('0x2d')],qs[_0xb90d('0x33')](_0x12022d[_0xb90d('0x2e')][_0xb90d('0x33')]));_0x112370[_0xb90d('0x32')]=_0x112370[_0xb90d('0x32')][_0xb90d('0x34')]?_0x112370[_0xb90d('0x32')]:_0x1f9151[_0xb90d('0x2d')];if(!_0x12022d[_0xb90d('0x2e')][_0xb90d('0x35')](_0xb90d('0x36'))){_0x112370['limit']=qs['limit'](_0x12022d[_0xb90d('0x2e')][_0xb90d('0x20')]);_0x112370[_0xb90d('0x37')]=qs[_0xb90d('0x37')](_0x12022d[_0xb90d('0x2e')][_0xb90d('0x37')]);}_0x112370[_0xb90d('0x38')]=qs['sort'](_0x12022d[_0xb90d('0x2e')]['sort']);_0x112370[_0xb90d('0x39')]=qs[_0xb90d('0x30')](_[_0xb90d('0x3a')](_0x12022d[_0xb90d('0x2e')],_0x1f9151[_0xb90d('0x30')]));if(_0x12022d[_0xb90d('0x2e')][_0xb90d('0x3b')]){_0x112370[_0xb90d('0x39')]=_[_0xb90d('0x3c')](_0x112370['where'],{'$or':_[_0xb90d('0x3d')](_0x480d90,function(_0x8fa42d){if(_0x8fa42d[_0xb90d('0x3e')][_0xb90d('0x3f')]!=='VIRTUAL'){var _0x447f0c={};_0x447f0c[_0x8fa42d[_0xb90d('0x40')]]={'$like':'%'+_0x12022d[_0xb90d('0x2e')][_0xb90d('0x3b')]+'%'};return _0x447f0c;}})});}_0x112370=_[_0xb90d('0x3c')]({},_0x112370,_0x12022d['options']);var _0x25a408={'where':_0x112370[_0xb90d('0x39')]};_0x25a408[_0xb90d('0x41')]=[];if(_0x12022d[_0xb90d('0x2e')]['tag']){_0x25a408[_0xb90d('0x41')][_0xb90d('0x42')]({'model':db[_0xb90d('0x43')],'as':_0xb90d('0x44'),'attributes':['id'],'where':{'id':_0x12022d[_0xb90d('0x2e')][_0xb90d('0x45')]},'required':!![]});_0x25a408[_0xb90d('0x46')]=!![];}if(_0x12022d[_0xb90d('0x2e')][_0xb90d('0x47')]){_0x25a408[_0xb90d('0x41')][_0xb90d('0x42')]({'model':db[_0xb90d('0x48')],'as':_0xb90d('0x49'),'attributes':['id',_0xb90d('0x4a'),_0xb90d('0x4b'),_0xb90d('0x47')],'where':{'direction':'in','read':_0x12022d[_0xb90d('0x2e')]['read']||![]},'required':!![]});_0x25a408[_0xb90d('0x46')]=!![];}return db['MailInteraction'][_0xb90d('0x1f')](_0x25a408)['then'](function(_0x1705ca){_0x21fcea[_0xb90d('0x1f')]=_0x1705ca;if(_0x12022d[_0xb90d('0x2e')][_0xb90d('0x4c')]){_0x112370[_0xb90d('0x41')]=[{'model':db['User'],'as':_0xb90d('0x4d'),'required':![],'attributes':['id',_0xb90d('0x2b'),'fullname']},{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xb90d('0x4e'),'attributes':[_0xb90d('0x2b'),'fullname',_0xb90d('0x4f')],'required':![]},{'model':db['MailAccount'],'as':_0xb90d('0x50'),'attributes':['name','key',_0xb90d('0x51')],'required':![]},{'model':db[_0xb90d('0x48')],'as':_0xb90d('0x49'),'attributes':['id',_0xb90d('0x4a'),_0xb90d('0x4b'),'read'],'where':{'direction':'in','read':_0x12022d[_0xb90d('0x2e')][_0xb90d('0x47')]||![]},'required':_0x12022d[_0xb90d('0x2e')][_0xb90d('0x47')]||![]},{'model':db[_0xb90d('0x43')],'as':_0xb90d('0x44'),'attributes':['id',_0xb90d('0x2b'),'color'],'required':_0x12022d[_0xb90d('0x2e')][_0xb90d('0x45')]?!![]:![]},{'model':db[_0xb90d('0x43')],'as':'ThroughTags','attributes':['id',_0xb90d('0x2b'),_0xb90d('0x52')],'through':_0x12022d[_0xb90d('0x2e')]['tag']?{'attributes':[],'where':{'TagId':_0x12022d['query'][_0xb90d('0x45')]||undefined}}:{},'required':_0x12022d[_0xb90d('0x2e')][_0xb90d('0x45')]?!![]:![]}];}return db[_0xb90d('0x53')][_0xb90d('0x54')](_0x112370);})[_0xb90d('0x27')](function(_0x2afb4c){_0x21fcea[_0xb90d('0x55')]=_0x2afb4c;return _0x21fcea;})[_0xb90d('0x27')](respondWithFilteredResult(_0x9428fe,_0x112370))[_0xb90d('0x56')](handleError(_0x9428fe,null));};exports[_0xb90d('0x57')]=function(_0x3f510c,_0x3f3c14){var _0x45821a={'raw':![],'where':{'id':_0x3f510c[_0xb90d('0x58')]['id']}},_0x4882ac={};_0x4882ac[_0xb90d('0x2d')]=_[_0xb90d('0x2f')](db['MailInteraction']['rawAttributes']);_0x4882ac['query']=_[_0xb90d('0x2f')](_0x3f510c[_0xb90d('0x2e')]);_0x4882ac[_0xb90d('0x30')]=_[_0xb90d('0x31')](_0x4882ac['model'],_0x4882ac[_0xb90d('0x2e')]);_0x45821a[_0xb90d('0x32')]=_[_0xb90d('0x31')](_0x4882ac[_0xb90d('0x2d')],qs[_0xb90d('0x33')](_0x3f510c[_0xb90d('0x2e')][_0xb90d('0x33')]));_0x45821a[_0xb90d('0x32')]=_0x45821a['attributes'][_0xb90d('0x34')]?_0x45821a[_0xb90d('0x32')]:_0x4882ac['model'];if(_0x3f510c['query']['includeAll']){_0x45821a[_0xb90d('0x41')]=[{'all':!![]}];}_0x45821a=_[_0xb90d('0x3c')]({},_0x45821a,_0x3f510c[_0xb90d('0x59')]);return db[_0xb90d('0x53')]['find'](_0x45821a)[_0xb90d('0x27')](handleEntityNotFound(_0x3f3c14,null))['then'](respondWithResult(_0x3f3c14,null))[_0xb90d('0x56')](handleError(_0x3f3c14,null));};exports[_0xb90d('0x5a')]=function(_0x934371,_0x256665){return db[_0xb90d('0x53')]['create'](_0x934371['body'],{})[_0xb90d('0x27')](respondWithResult(_0x256665,0xc9))[_0xb90d('0x56')](handleError(_0x256665,null));};exports[_0xb90d('0x26')]=function(_0x50943b,_0x589044){if(_0x50943b[_0xb90d('0x5b')]['id']){delete _0x50943b[_0xb90d('0x5b')]['id'];}return db[_0xb90d('0x53')]['find']({'where':{'id':_0x50943b[_0xb90d('0x58')]['id']}})['then'](handleEntityNotFound(_0x589044,null))[_0xb90d('0x27')](saveUpdates(_0x50943b[_0xb90d('0x5b')],null))[_0xb90d('0x27')](respondWithResult(_0x589044,null))[_0xb90d('0x56')](handleError(_0x589044,null));};exports['destroy']=function(_0x5ec79c,_0x24d55e){return db[_0xb90d('0x53')]['find']({'where':{'id':_0x5ec79c[_0xb90d('0x58')]['id']}})[_0xb90d('0x27')](handleEntityNotFound(_0x24d55e,null))[_0xb90d('0x27')](removeEntity(_0x24d55e,null))[_0xb90d('0x56')](handleError(_0x24d55e,null));};exports[_0xb90d('0x5c')]=function(_0x3a80c5,_0xc91141){return db[_0xb90d('0x53')][_0xb90d('0x5c')]()['then'](respondWithResult(_0xc91141,null))[_0xb90d('0x56')](handleError(_0xc91141,null));};exports[_0xb90d('0x5d')]=function(_0x5bd7ec,_0xba0271,_0xf1782c){return db[_0xb90d('0x48')]['find']({'where':{'id':_0x5bd7ec[_0xb90d('0x58')]['id']}})[_0xb90d('0x27')](handleEntityNotFound(_0xba0271,null))['then'](function(_0x1f9536){if(_0x1f9536){return _0x1f9536[_0xb90d('0x5d')](_0x5bd7ec['body'][_0xb90d('0x5e')],_[_0xb90d('0x5f')](_0x5bd7ec[_0xb90d('0x5b')],[_0xb90d('0x5e'),'id'])||{});}})['then'](respondWithResult(_0xba0271,null))['catch'](handleError(_0xba0271,null));};exports[_0xb90d('0x60')]=function(_0x249080,_0x17ad0b,_0x19e0d0){var _0x6e1acc={'raw':![],'where':{}};var _0x13cfa5={};var _0x1c03fe={'count':0x0,'rows':[]};return db[_0xb90d('0x53')][_0xb90d('0x61')]({'where':{'id':_0x249080[_0xb90d('0x58')]['id']}})[_0xb90d('0x27')](handleEntityNotFound(_0x17ad0b,null))[_0xb90d('0x27')](function(_0x3eb2a9){if(_0x3eb2a9){_0x13cfa5[_0xb90d('0x2d')]=_[_0xb90d('0x2f')](db[_0xb90d('0x48')][_0xb90d('0x62')]);_0x13cfa5[_0xb90d('0x2e')]=_[_0xb90d('0x2f')](_0x249080[_0xb90d('0x2e')]);_0x13cfa5[_0xb90d('0x30')]=_[_0xb90d('0x31')](_0x13cfa5[_0xb90d('0x2d')],_0x13cfa5[_0xb90d('0x2e')]);_0x6e1acc[_0xb90d('0x32')]=_['intersection'](_0x13cfa5['model'],qs[_0xb90d('0x33')](_0x249080['query'][_0xb90d('0x33')]));_0x6e1acc[_0xb90d('0x32')]=_0x6e1acc[_0xb90d('0x32')][_0xb90d('0x34')]?_0x6e1acc[_0xb90d('0x32')]:_0x13cfa5[_0xb90d('0x2d')];if(!_0x249080['query']['hasOwnProperty']('nolimit')){_0x6e1acc['limit']=qs[_0xb90d('0x20')](_0x249080[_0xb90d('0x2e')]['limit']);_0x6e1acc['offset']=qs[_0xb90d('0x37')](_0x249080[_0xb90d('0x2e')][_0xb90d('0x37')]);}_0x6e1acc[_0xb90d('0x38')]=qs[_0xb90d('0x63')](_0x249080['query'][_0xb90d('0x63')]);_0x6e1acc['where']=qs['filters'](_[_0xb90d('0x3a')](_0x249080['query'],_0x13cfa5[_0xb90d('0x30')]));_0x6e1acc[_0xb90d('0x39')]['MailInteractionId']=_0x3eb2a9['id'];if(_0x249080[_0xb90d('0x2e')][_0xb90d('0x3b')]){_0x6e1acc[_0xb90d('0x39')]=_['merge'](_0x6e1acc[_0xb90d('0x39')],{'$or':_[_0xb90d('0x3d')](_0x6e1acc[_0xb90d('0x32')],function(_0x1f51df){var _0x1ac2b2={};_0x1ac2b2[_0x1f51df]={'$like':'%'+_0x249080['query'][_0xb90d('0x3b')]+'%'};return _0x1ac2b2;})});}if(_0x249080[_0xb90d('0x2e')][_0xb90d('0x64')]){var _0x4c37e0=_0x249080[_0xb90d('0x2e')][_0xb90d('0x64')]['split'](',');var _0xeed1e4={};_0xeed1e4[_0x4c37e0[0x0]]={'$gte':moment(_0x4c37e0[0x1])[_0xb90d('0x65')](_0xb90d('0x66'))};_0x6e1acc[_0xb90d('0x39')]=_[_0xb90d('0x3c')](_0x6e1acc[_0xb90d('0x39')],_0xeed1e4);}_0x6e1acc=_[_0xb90d('0x3c')]({},_0x6e1acc,_0x249080[_0xb90d('0x59')]);return db['MailMessage'][_0xb90d('0x1f')]({'where':_0x6e1acc[_0xb90d('0x39')]})[_0xb90d('0x27')](function(_0x233848){_0x1c03fe['count']=_0x233848;if(_0x249080[_0xb90d('0x2e')]['includeAll']){_0x6e1acc[_0xb90d('0x41')]=[{'all':!![]}];}return db[_0xb90d('0x48')][_0xb90d('0x54')](_0x6e1acc);})[_0xb90d('0x27')](function(_0x18c59a){_0x1c03fe['rows']=_0x18c59a;return _0x1c03fe;});}})[_0xb90d('0x27')](respondWithFilteredResult(_0x17ad0b,_0x6e1acc))['catch'](handleError(_0x17ad0b,null));};exports[_0xb90d('0x67')]=function(_0x33c13d,_0x4c1699,_0x55d7c6){return db[_0xb90d('0x53')]['find']({'where':{'id':_0x33c13d[_0xb90d('0x58')]['id']}})[_0xb90d('0x27')](handleEntityNotFound(_0x4c1699,null))[_0xb90d('0x27')](function(_0x5b13de){if(_0x5b13de){return _0x5b13de[_0xb90d('0x68')](_0x33c13d[_0xb90d('0x5b')]['ids'],_[_0xb90d('0x5f')](_0x33c13d[_0xb90d('0x5b')],[_0xb90d('0x5e'),'id'])||{})[_0xb90d('0x69')](function(){return db[_0xb90d('0x43')][_0xb90d('0x54')]({'attributes':['id',_0xb90d('0x2b'),_0xb90d('0x52')],'where':{'id':_0x33c13d[_0xb90d('0x5b')][_0xb90d('0x5e')]}});})[_0xb90d('0x27')](function(_0x1ca3f0){socket['emit']('mailInteractionTags:save',{'id':Number(_0x33c13d[_0xb90d('0x58')]['id']),'tags':_0x1ca3f0||[]});return{'id':Number(_0x33c13d[_0xb90d('0x58')]['id']),'tags':_0x1ca3f0||[]};});}})[_0xb90d('0x27')](respondWithResult(_0x4c1699,null))[_0xb90d('0x56')](handleError(_0x4c1699,null));};exports[_0xb90d('0x6a')]=function(_0x1b37c2,_0x2fc072,_0x53fd27){var _0x40f50c;return db[_0xb90d('0x53')][_0xb90d('0x6b')]({'where':{'id':_0x1b37c2[_0xb90d('0x58')]['id']}})[_0xb90d('0x27')](handleEntityNotFound(_0x2fc072,null))[_0xb90d('0x27')](function(_0x244e8e){if(_0x244e8e){return _0x244e8e[_0xb90d('0x6a')](_0x1b37c2[_0xb90d('0x2e')][_0xb90d('0x5e')]);}})[_0xb90d('0x27')](respondWithStatusCode(_0x2fc072,null))[_0xb90d('0x56')](handleError(_0x2fc072,null));};exports['download']=function(_0x1ecdc2,_0x13cf88){var _0x13bce7=moment()[_0xb90d('0x6c')]()[_0xb90d('0x6d')]();var _0x4ca5d0=path[_0xb90d('0x6e')](config[_0xb90d('0x6f')],_0xb90d('0x70'),_0xb90d('0x71'),'attachments');var _0xa3de46=path['join'](config[_0xb90d('0x6f')],'server',_0xb90d('0x71'),_0xb90d('0x72'));var _0x20e686=path[_0xb90d('0x6e')](_0xa3de46,_0x13bce7);var _0x56ce19=util['format'](_0xb90d('0x73'),_0x13bce7);var _0x1dedc0=path[_0xb90d('0x6e')](_0xa3de46,_0x56ce19);var _0x49565f=![];return db[_0xb90d('0x53')][_0xb90d('0x6b')]({'where':{'id':_0x1ecdc2['params']['id']}})[_0xb90d('0x27')](handleEntityNotFound(_0x13cf88,null))[_0xb90d('0x27')](function(_0x57edd9){if(_0x57edd9){return _0x57edd9[_0xb90d('0x60')]({'attributes':['id','body',_0xb90d('0x74'),'to','cc',_0xb90d('0x75'),_0xb90d('0x4b')],'where':{'secret':![]},'include':_0x1ecdc2[_0xb90d('0x2e')][_0xb90d('0x76')]?[{'model':db[_0xb90d('0x77')],'as':_0xb90d('0x78')}]:undefined,'order':qs[_0xb90d('0x63')]('id')});}return[];})[_0xb90d('0x27')](function(_0x345b1a){_0x49565f=_0x345b1a[_0xb90d('0x34')];if(_0x345b1a[_0xb90d('0x34')]){fs[_0xb90d('0x79')](_0x20e686);return BPromise[_0xb90d('0x7a')](_0x345b1a,function(_0x5f1c62,_0xd19a65){var _0x452653=_0x5f1c62;var _0x1806b5={'from':_0x452653[_0xb90d('0x74')],'to':_0x452653['to'],'subject':_0x452653[_0xb90d('0x75')],'html':_0x452653[_0xb90d('0x5b')],'attachments':[]};return new BPromise(function(_0x32fa7b,_0x2414f1){if(_0x5f1c62[_0xb90d('0x78')]){for(var _0x41c30d=0x0;_0x41c30d<_0x5f1c62[_0xb90d('0x78')][_0xb90d('0x34')];_0x41c30d++){var _0x11db4c=_0x5f1c62[_0xb90d('0x78')][_0x41c30d];var _0x130a2a=path[_0xb90d('0x6e')](_0x4ca5d0,_0x11db4c[_0xb90d('0x7b')]);if(fs[_0xb90d('0x7c')](_0x130a2a)){_0x1806b5[_0xb90d('0x76')][_0xb90d('0x42')]({'name':_0x11db4c['name'],'contentType':_0x11db4c[_0xb90d('0x3e')],'data':fs[_0xb90d('0x7d')](_0x130a2a)});}}}emlformat[_0xb90d('0x7e')](_0x1806b5,function(_0x25bc50,_0x400d1b){if(_0x25bc50)return _0x2414f1(_0x25bc50);fs['writeFileSync'](path[_0xb90d('0x6e')](_0x20e686,util[_0xb90d('0x65')](_0xb90d('0x7f'),_0xd19a65)),_0x400d1b);return _0x32fa7b(_0x400d1b);});});});}})['then'](function(){if(_0x49565f){return new BPromise(function(_0x324878,_0x1516cf){zipdir(_0x20e686,{'saveTo':_0x1dedc0},function(_0x13d05e,_0x5c98d9){if(_0x13d05e)return _0x1516cf(_0x13d05e);return _0x324878(_0x5c98d9);});});}})['then'](function(){if(_0x49565f){return new BPromise(function(_0x580c14,_0x58abb1){rimraf(_0x20e686,function(_0x24d65c){if(_0x24d65c)_0x58abb1(_0x24d65c);return _0x580c14();});});}})['then'](function(){if(_0x49565f){return _0x13cf88[_0xb90d('0x80')](_0x1dedc0,_0x56ce19,function(_0x456981){if(_0x456981){console[_0xb90d('0x81')](_0xb90d('0x82'),_0x456981);}else{fs[_0xb90d('0x83')](_0x1dedc0);}});}else{return _0x13cf88[_0xb90d('0x1c')](0xc8);}})[_0xb90d('0x56')](handleError(_0x13cf88,null));}; \ No newline at end of file +var _0xdb1a=['addMessage','ids','omit','hasOwnProperty','MailInteractionId','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','spread','emit','mailInteractionTags:save','removeTags','unix','root','server','attachments','files','tmp','join','getMessages','Attachment','Attachments','mkdirSync','each','from','subject','basename','existsSync','type','readFileSync','build','writeFileSync','format','message%d.eml','download','err','unlinkSync','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','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailInteraction','rawAttributes','keys','query','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','field','options','tag','include','push','Tags','distinct','MailMessage','Messages','createdAt','read','includeAll','fullname','CmContact','User','Owner','internal','MailAccount','Account','direction','Tag','color','rows','catch','show','filters','find','create','body','params','describe'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xdb1a,0x1bc));var _0xadb1=function(_0x59a50e,_0x578844){_0x59a50e=_0x59a50e-0x0;var _0x1e4bef=_0xdb1a[_0x59a50e];return _0x1e4bef;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xadb1('0x0'));var rimraf=require(_0xadb1('0x1'));var zipdir=require(_0xadb1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xadb1('0x3'));var moment=require('moment');var BPromise=require(_0xadb1('0x4'));var Mustache=require(_0xadb1('0x5'));var util=require(_0xadb1('0x6'));var path=require(_0xadb1('0x7'));var sox=require(_0xadb1('0x8'));var csv=require(_0xadb1('0x9'));var ejs=require(_0xadb1('0xa'));var fs=require('fs');var _=require(_0xadb1('0xb'));var squel=require('squel');var crypto=require(_0xadb1('0xc'));var jsforce=require(_0xadb1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xadb1('0x9'));var querystring=require(_0xadb1('0xe'));var Papa=require(_0xadb1('0xf'));var authService=require(_0xadb1('0x10'));var hardwareService=require(_0xadb1('0x11'));var Redis=require(_0xadb1('0x12'));var qs=require(_0xadb1('0x13'));var logger=require(_0xadb1('0x14'))(_0xadb1('0x15'));var utils=require('../../config/utils');var config=require(_0xadb1('0x16'));var db=require(_0xadb1('0x17'))['db'];config[_0xadb1('0x18')]=_['defaults'](config[_0xadb1('0x18')],{'host':_0xadb1('0x19'),'port':0x18eb});var socket=require(_0xadb1('0x1a'))(new Redis(config[_0xadb1('0x18')]));require(_0xadb1('0x1b'))['register'](socket);function respondWithStatusCode(_0x26a768,_0x1bffbe){_0x1bffbe=_0x1bffbe||0xcc;return function(_0x1f7544){if(_0x1f7544){return _0x26a768[_0xadb1('0x1c')](_0x1bffbe);}return _0x26a768['status'](_0x1bffbe)[_0xadb1('0x1d')]();};}function respondWithResult(_0x71ff15,_0x1bacb3){_0x1bacb3=_0x1bacb3||0xc8;return function(_0x5bc7ad){if(_0x5bc7ad){return _0x71ff15[_0xadb1('0x1e')](_0x1bacb3)['json'](_0x5bc7ad);}};}function respondWithFilteredResult(_0x38905b,_0x58e986){return function(_0x391007){if(_0x391007){var _0x46c28b=_0x391007[_0xadb1('0x1f')],_0x328111=_0x58e986[_0xadb1('0x20')],_0xa4949c=_0x58e986[_0xadb1('0x20')]+_0x58e986['limit'],_0x243b08;if(_0xa4949c>=_0x46c28b){_0xa4949c=_0x46c28b;_0x243b08=0xc8;}else{_0x243b08=0xce;}_0x38905b[_0xadb1('0x1e')](_0x243b08);return _0x38905b[_0xadb1('0x21')](_0xadb1('0x22'),_0x328111+'-'+_0xa4949c+'/'+_0x46c28b)[_0xadb1('0x23')](_0x391007);}return null;};}function patchUpdates(_0x5e6660){return function(_0xf649ae){try{jsonpatch[_0xadb1('0x24')](_0xf649ae,_0x5e6660,!![]);}catch(_0x49b848){return BPromise[_0xadb1('0x25')](_0x49b848);}return _0xf649ae[_0xadb1('0x26')]();};}function saveUpdates(_0x247bd6,_0x5e336e){return function(_0x44e39d){if(_0x44e39d){return _0x44e39d[_0xadb1('0x27')](_0x247bd6)[_0xadb1('0x28')](function(_0x3b2b0d){return _0x3b2b0d;});}return null;};}function removeEntity(_0x3c91e1,_0x149898){return function(_0x22128b){if(_0x22128b){return _0x22128b[_0xadb1('0x29')]()[_0xadb1('0x28')](function(){_0x3c91e1['status'](0xcc)[_0xadb1('0x1d')]();});}};}function handleEntityNotFound(_0x5b4175,_0x597803){return function(_0x3a8b8e){if(!_0x3a8b8e){_0x5b4175[_0xadb1('0x1c')](0x194);}return _0x3a8b8e;};}function handleError(_0x3fec16,_0xf1add){_0xf1add=_0xf1add||0x1f4;return function(_0x234ebb){logger[_0xadb1('0x2a')](_0x234ebb[_0xadb1('0x2b')]);if(_0x234ebb[_0xadb1('0x2c')]){delete _0x234ebb['name'];}_0x3fec16['status'](_0xf1add)[_0xadb1('0x2d')](_0x234ebb);};}exports[_0xadb1('0x2e')]=function(_0x46149a,_0x2a1bea){var _0x28ef46={},_0x5ec39d={},_0x46a63a={'count':0x0,'rows':[]};var _0x2ebbf6=db[_0xadb1('0x2f')][_0xadb1('0x30')];_0x5ec39d['model']=_[_0xadb1('0x31')](_0x2ebbf6);_0x5ec39d[_0xadb1('0x32')]=_[_0xadb1('0x31')](_0x46149a['query']);_0x5ec39d['filters']=_[_0xadb1('0x33')](_0x5ec39d[_0xadb1('0x34')],_0x5ec39d[_0xadb1('0x32')]);_0x28ef46[_0xadb1('0x35')]=_[_0xadb1('0x33')](_0x5ec39d[_0xadb1('0x34')],qs[_0xadb1('0x36')](_0x46149a[_0xadb1('0x32')][_0xadb1('0x36')]));_0x28ef46[_0xadb1('0x35')]=_0x28ef46[_0xadb1('0x35')][_0xadb1('0x37')]?_0x28ef46[_0xadb1('0x35')]:_0x5ec39d[_0xadb1('0x34')];if(!_0x46149a[_0xadb1('0x32')]['hasOwnProperty'](_0xadb1('0x38'))){_0x28ef46[_0xadb1('0x39')]=qs['limit'](_0x46149a['query'][_0xadb1('0x39')]);_0x28ef46[_0xadb1('0x20')]=qs[_0xadb1('0x20')](_0x46149a['query'][_0xadb1('0x20')]);}_0x28ef46[_0xadb1('0x3a')]=qs[_0xadb1('0x3b')](_0x46149a[_0xadb1('0x32')][_0xadb1('0x3b')]);_0x28ef46[_0xadb1('0x3c')]=qs['filters'](_[_0xadb1('0x3d')](_0x46149a[_0xadb1('0x32')],_0x5ec39d['filters']));if(_0x46149a[_0xadb1('0x32')][_0xadb1('0x3e')]){_0x28ef46[_0xadb1('0x3c')]=_[_0xadb1('0x3f')](_0x28ef46['where'],{'$or':_['map'](_0x2ebbf6,function(_0x51acfc){if(_0x51acfc['type']['key']!==_0xadb1('0x40')){var _0x2bcf2d={};_0x2bcf2d[_0x51acfc[_0xadb1('0x41')]]={'$like':'%'+_0x46149a['query'][_0xadb1('0x3e')]+'%'};return _0x2bcf2d;}})});}_0x28ef46=_[_0xadb1('0x3f')]({},_0x28ef46,_0x46149a[_0xadb1('0x42')]);var _0x40ca05={'where':_0x28ef46['where']};_0x40ca05['include']=[];if(_0x46149a[_0xadb1('0x32')][_0xadb1('0x43')]){_0x40ca05[_0xadb1('0x44')][_0xadb1('0x45')]({'model':db['Tag'],'as':_0xadb1('0x46'),'attributes':['id'],'where':{'id':_0x46149a['query'][_0xadb1('0x43')]},'required':!![]});_0x40ca05[_0xadb1('0x47')]=!![];}if(_0x46149a[_0xadb1('0x32')]['read']){_0x40ca05[_0xadb1('0x44')][_0xadb1('0x45')]({'model':db[_0xadb1('0x48')],'as':_0xadb1('0x49'),'attributes':['id','direction',_0xadb1('0x4a'),_0xadb1('0x4b')],'where':{'direction':'in','read':_0x46149a[_0xadb1('0x32')]['read']||![]},'required':!![]});_0x40ca05['distinct']=!![];}return db[_0xadb1('0x2f')]['count'](_0x40ca05)[_0xadb1('0x28')](function(_0x483dcb){_0x46a63a[_0xadb1('0x1f')]=_0x483dcb;if(_0x46149a['query'][_0xadb1('0x4c')]){_0x28ef46[_0xadb1('0x44')]=[{'model':db['User'],'as':'Users','required':![],'attributes':['id',_0xadb1('0x2c'),_0xadb1('0x4d')]},{'model':db[_0xadb1('0x4e')],'as':'Contact','required':![]},{'model':db[_0xadb1('0x4f')],'as':_0xadb1('0x50'),'attributes':[_0xadb1('0x2c'),_0xadb1('0x4d'),_0xadb1('0x51')],'required':![]},{'model':db[_0xadb1('0x52')],'as':_0xadb1('0x53'),'attributes':[_0xadb1('0x2c'),'key','email'],'required':![]},{'model':db[_0xadb1('0x48')],'as':_0xadb1('0x49'),'attributes':['id',_0xadb1('0x54'),_0xadb1('0x4a'),'read'],'where':{'direction':'in','read':_0x46149a[_0xadb1('0x32')]['read']||![]},'required':_0x46149a[_0xadb1('0x32')][_0xadb1('0x4b')]||![]},{'model':db[_0xadb1('0x55')],'as':_0xadb1('0x46'),'attributes':['id',_0xadb1('0x2c'),_0xadb1('0x56')],'required':_0x46149a['query']['tag']?!![]:![]},{'model':db[_0xadb1('0x55')],'as':'ThroughTags','attributes':['id','name',_0xadb1('0x56')],'through':_0x46149a[_0xadb1('0x32')][_0xadb1('0x43')]?{'attributes':[],'where':{'TagId':_0x46149a[_0xadb1('0x32')][_0xadb1('0x43')]||undefined}}:{},'required':_0x46149a[_0xadb1('0x32')][_0xadb1('0x43')]?!![]:![]}];}return db[_0xadb1('0x2f')]['findAll'](_0x28ef46);})[_0xadb1('0x28')](function(_0x2fa9de){_0x46a63a[_0xadb1('0x57')]=_0x2fa9de;return _0x46a63a;})[_0xadb1('0x28')](respondWithFilteredResult(_0x2a1bea,_0x28ef46))[_0xadb1('0x58')](handleError(_0x2a1bea,null));};exports[_0xadb1('0x59')]=function(_0x298b84,_0x2a5334){var _0x237579={'raw':![],'where':{'id':_0x298b84['params']['id']}},_0x536047={};_0x536047[_0xadb1('0x34')]=_[_0xadb1('0x31')](db['MailInteraction'][_0xadb1('0x30')]);_0x536047[_0xadb1('0x32')]=_[_0xadb1('0x31')](_0x298b84[_0xadb1('0x32')]);_0x536047[_0xadb1('0x5a')]=_[_0xadb1('0x33')](_0x536047[_0xadb1('0x34')],_0x536047[_0xadb1('0x32')]);_0x237579[_0xadb1('0x35')]=_[_0xadb1('0x33')](_0x536047[_0xadb1('0x34')],qs[_0xadb1('0x36')](_0x298b84[_0xadb1('0x32')][_0xadb1('0x36')]));_0x237579['attributes']=_0x237579[_0xadb1('0x35')][_0xadb1('0x37')]?_0x237579[_0xadb1('0x35')]:_0x536047[_0xadb1('0x34')];if(_0x298b84[_0xadb1('0x32')][_0xadb1('0x4c')]){_0x237579[_0xadb1('0x44')]=[{'all':!![]}];}_0x237579=_[_0xadb1('0x3f')]({},_0x237579,_0x298b84[_0xadb1('0x42')]);return db[_0xadb1('0x2f')][_0xadb1('0x5b')](_0x237579)['then'](handleEntityNotFound(_0x2a5334,null))[_0xadb1('0x28')](respondWithResult(_0x2a5334,null))[_0xadb1('0x58')](handleError(_0x2a5334,null));};exports[_0xadb1('0x5c')]=function(_0x433ffa,_0x30e249){return db[_0xadb1('0x2f')][_0xadb1('0x5c')](_0x433ffa[_0xadb1('0x5d')],{})[_0xadb1('0x28')](respondWithResult(_0x30e249,0xc9))[_0xadb1('0x58')](handleError(_0x30e249,null));};exports[_0xadb1('0x27')]=function(_0x514a07,_0x2697f6){if(_0x514a07['body']['id']){delete _0x514a07[_0xadb1('0x5d')]['id'];}return db['MailInteraction'][_0xadb1('0x5b')]({'where':{'id':_0x514a07[_0xadb1('0x5e')]['id']}})[_0xadb1('0x28')](handleEntityNotFound(_0x2697f6,null))[_0xadb1('0x28')](saveUpdates(_0x514a07[_0xadb1('0x5d')],null))[_0xadb1('0x28')](respondWithResult(_0x2697f6,null))['catch'](handleError(_0x2697f6,null));};exports['destroy']=function(_0x4176fc,_0x1fc6e1){return db['MailInteraction'][_0xadb1('0x5b')]({'where':{'id':_0x4176fc['params']['id']}})['then'](handleEntityNotFound(_0x1fc6e1,null))[_0xadb1('0x28')](removeEntity(_0x1fc6e1,null))[_0xadb1('0x58')](handleError(_0x1fc6e1,null));};exports[_0xadb1('0x5f')]=function(_0x26d571,_0x927841){return db[_0xadb1('0x2f')][_0xadb1('0x5f')]()['then'](respondWithResult(_0x927841,null))[_0xadb1('0x58')](handleError(_0x927841,null));};exports[_0xadb1('0x60')]=function(_0xcf2c84,_0x17990c,_0x4e8aa0){return db[_0xadb1('0x48')][_0xadb1('0x5b')]({'where':{'id':_0xcf2c84[_0xadb1('0x5e')]['id']}})['then'](handleEntityNotFound(_0x17990c,null))[_0xadb1('0x28')](function(_0x3c7b60){if(_0x3c7b60){return _0x3c7b60[_0xadb1('0x60')](_0xcf2c84['body'][_0xadb1('0x61')],_[_0xadb1('0x62')](_0xcf2c84['body'],['ids','id'])||{});}})[_0xadb1('0x28')](respondWithResult(_0x17990c,null))[_0xadb1('0x58')](handleError(_0x17990c,null));};exports['getMessages']=function(_0xbd8e,_0x41b44a,_0x3a68f0){var _0x50d40e={'raw':![],'where':{}};var _0x37099f={};var _0x3cf9e7={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0xbd8e['params']['id']}})['then'](handleEntityNotFound(_0x41b44a,null))[_0xadb1('0x28')](function(_0xe61f08){if(_0xe61f08){_0x37099f[_0xadb1('0x34')]=_[_0xadb1('0x31')](db['MailMessage'][_0xadb1('0x30')]);_0x37099f[_0xadb1('0x32')]=_[_0xadb1('0x31')](_0xbd8e[_0xadb1('0x32')]);_0x37099f[_0xadb1('0x5a')]=_[_0xadb1('0x33')](_0x37099f[_0xadb1('0x34')],_0x37099f[_0xadb1('0x32')]);_0x50d40e[_0xadb1('0x35')]=_[_0xadb1('0x33')](_0x37099f[_0xadb1('0x34')],qs[_0xadb1('0x36')](_0xbd8e['query'][_0xadb1('0x36')]));_0x50d40e[_0xadb1('0x35')]=_0x50d40e[_0xadb1('0x35')]['length']?_0x50d40e[_0xadb1('0x35')]:_0x37099f['model'];if(!_0xbd8e[_0xadb1('0x32')][_0xadb1('0x63')](_0xadb1('0x38'))){_0x50d40e[_0xadb1('0x39')]=qs[_0xadb1('0x39')](_0xbd8e[_0xadb1('0x32')][_0xadb1('0x39')]);_0x50d40e[_0xadb1('0x20')]=qs[_0xadb1('0x20')](_0xbd8e['query'][_0xadb1('0x20')]);}_0x50d40e[_0xadb1('0x3a')]=qs[_0xadb1('0x3b')](_0xbd8e[_0xadb1('0x32')]['sort']);_0x50d40e[_0xadb1('0x3c')]=qs[_0xadb1('0x5a')](_[_0xadb1('0x3d')](_0xbd8e[_0xadb1('0x32')],_0x37099f[_0xadb1('0x5a')]));_0x50d40e['where'][_0xadb1('0x64')]=_0xe61f08['id'];if(_0xbd8e[_0xadb1('0x32')][_0xadb1('0x3e')]){_0x50d40e[_0xadb1('0x3c')]=_[_0xadb1('0x3f')](_0x50d40e[_0xadb1('0x3c')],{'$or':_[_0xadb1('0x65')](_0x50d40e[_0xadb1('0x35')],function(_0x2bdf62){var _0x20a655={};_0x20a655[_0x2bdf62]={'$like':'%'+_0xbd8e[_0xadb1('0x32')]['filter']+'%'};return _0x20a655;})});}if(_0xbd8e['query'][_0xadb1('0x66')]){var _0x32cc93=_0xbd8e[_0xadb1('0x32')][_0xadb1('0x66')][_0xadb1('0x67')](',');var _0x25e5ed={};_0x25e5ed[_0x32cc93[0x0]]={'$gte':moment(_0x32cc93[0x1])['format'](_0xadb1('0x68'))};_0x50d40e[_0xadb1('0x3c')]=_[_0xadb1('0x3f')](_0x50d40e[_0xadb1('0x3c')],_0x25e5ed);}_0x50d40e=_[_0xadb1('0x3f')]({},_0x50d40e,_0xbd8e[_0xadb1('0x42')]);return db[_0xadb1('0x48')][_0xadb1('0x1f')]({'where':_0x50d40e[_0xadb1('0x3c')]})[_0xadb1('0x28')](function(_0x106718){_0x3cf9e7[_0xadb1('0x1f')]=_0x106718;if(_0xbd8e['query']['includeAll']){_0x50d40e[_0xadb1('0x44')]=[{'all':!![]}];}return db[_0xadb1('0x48')][_0xadb1('0x69')](_0x50d40e);})['then'](function(_0x2dc3ba){_0x3cf9e7[_0xadb1('0x57')]=_0x2dc3ba;return _0x3cf9e7;});}})[_0xadb1('0x28')](respondWithFilteredResult(_0x41b44a,_0x50d40e))[_0xadb1('0x58')](handleError(_0x41b44a,null));};exports['addTags']=function(_0xa2d4bc,_0x4fa997,_0x39deda){return db[_0xadb1('0x2f')][_0xadb1('0x5b')]({'where':{'id':_0xa2d4bc[_0xadb1('0x5e')]['id']}})[_0xadb1('0x28')](handleEntityNotFound(_0x4fa997,null))['then'](function(_0x51bc79){if(_0x51bc79){return _0x51bc79['setTags'](_0xa2d4bc[_0xadb1('0x5d')][_0xadb1('0x61')],_['omit'](_0xa2d4bc[_0xadb1('0x5d')],[_0xadb1('0x61'),'id'])||{})[_0xadb1('0x6a')](function(){return db[_0xadb1('0x55')][_0xadb1('0x69')]({'attributes':['id',_0xadb1('0x2c'),_0xadb1('0x56')],'where':{'id':_0xa2d4bc[_0xadb1('0x5d')][_0xadb1('0x61')]}});})[_0xadb1('0x28')](function(_0x6450cf){socket[_0xadb1('0x6b')](_0xadb1('0x6c'),{'id':Number(_0xa2d4bc['params']['id']),'tags':_0x6450cf||[]});return{'id':Number(_0xa2d4bc[_0xadb1('0x5e')]['id']),'tags':_0x6450cf||[]};});}})[_0xadb1('0x28')](respondWithResult(_0x4fa997,null))[_0xadb1('0x58')](handleError(_0x4fa997,null));};exports['removeTags']=function(_0x1606e1,_0x53b3b3,_0x896c86){var _0x1abe06;return db[_0xadb1('0x2f')][_0xadb1('0x5b')]({'where':{'id':_0x1606e1[_0xadb1('0x5e')]['id']}})[_0xadb1('0x28')](handleEntityNotFound(_0x53b3b3,null))['then'](function(_0x50cfed){if(_0x50cfed){return _0x50cfed[_0xadb1('0x6d')](_0x1606e1[_0xadb1('0x32')]['ids']);}})[_0xadb1('0x28')](respondWithStatusCode(_0x53b3b3,null))['catch'](handleError(_0x53b3b3,null));};exports['download']=function(_0x32f773,_0x6fd2a5){var _0x2e43cc=moment()[_0xadb1('0x6e')]()['toString']();var _0x1510e6=path['join'](config[_0xadb1('0x6f')],_0xadb1('0x70'),'files',_0xadb1('0x71'));var _0x552904=path['join'](config['root'],_0xadb1('0x70'),_0xadb1('0x72'),_0xadb1('0x73'));var _0x1845c5=path[_0xadb1('0x74')](_0x552904,_0x2e43cc);var _0x54ebb0=util['format']('interaction-%s.zip',_0x2e43cc);var _0x176b0=path[_0xadb1('0x74')](_0x552904,_0x54ebb0);var _0x1f6e22=![];return db[_0xadb1('0x2f')][_0xadb1('0x5b')]({'where':{'id':_0x32f773[_0xadb1('0x5e')]['id']}})[_0xadb1('0x28')](handleEntityNotFound(_0x6fd2a5,null))[_0xadb1('0x28')](function(_0x2319e3){if(_0x2319e3){return _0x2319e3[_0xadb1('0x75')]({'attributes':['id',_0xadb1('0x5d'),'from','to','cc','subject','createdAt'],'where':{'secret':![]},'include':_0x32f773[_0xadb1('0x32')]['attachments']?[{'model':db[_0xadb1('0x76')],'as':_0xadb1('0x77')}]:undefined,'order':qs[_0xadb1('0x3b')]('id')});}return[];})[_0xadb1('0x28')](function(_0x50f6fd){_0x1f6e22=_0x50f6fd[_0xadb1('0x37')];if(_0x50f6fd[_0xadb1('0x37')]){fs[_0xadb1('0x78')](_0x1845c5);return BPromise[_0xadb1('0x79')](_0x50f6fd,function(_0x338074,_0x50b5ca){var _0x20b4c8=_0x338074;var _0x29563e={'from':_0x20b4c8[_0xadb1('0x7a')],'to':_0x20b4c8['to'],'subject':_0x20b4c8[_0xadb1('0x7b')],'html':_0x20b4c8[_0xadb1('0x5d')],'attachments':[]};return new BPromise(function(_0xda509f,_0x5a0a1b){if(_0x338074[_0xadb1('0x77')]){for(var _0x16cb02=0x0;_0x16cb02<_0x338074[_0xadb1('0x77')][_0xadb1('0x37')];_0x16cb02++){var _0x3c7308=_0x338074[_0xadb1('0x77')][_0x16cb02];var _0x303045=path[_0xadb1('0x74')](_0x1510e6,_0x3c7308[_0xadb1('0x7c')]);if(fs[_0xadb1('0x7d')](_0x303045)){_0x29563e[_0xadb1('0x71')][_0xadb1('0x45')]({'name':_0x3c7308[_0xadb1('0x2c')],'contentType':_0x3c7308[_0xadb1('0x7e')],'data':fs[_0xadb1('0x7f')](_0x303045)});}}}emlformat[_0xadb1('0x80')](_0x29563e,function(_0x4b018c,_0x413ed5){if(_0x4b018c)return _0x5a0a1b(_0x4b018c);fs[_0xadb1('0x81')](path[_0xadb1('0x74')](_0x1845c5,util[_0xadb1('0x82')](_0xadb1('0x83'),_0x50b5ca)),_0x413ed5);return _0xda509f(_0x413ed5);});});});}})['then'](function(){if(_0x1f6e22){return new BPromise(function(_0x2d0b3b,_0x4d27cf){zipdir(_0x1845c5,{'saveTo':_0x176b0},function(_0x41ec98,_0x1f2bdc){if(_0x41ec98)return _0x4d27cf(_0x41ec98);return _0x2d0b3b(_0x1f2bdc);});});}})[_0xadb1('0x28')](function(){if(_0x1f6e22){return new BPromise(function(_0x693ad4,_0x1a0fb3){rimraf(_0x1845c5,function(_0x79591d){if(_0x79591d)_0x1a0fb3(_0x79591d);return _0x693ad4();});});}})[_0xadb1('0x28')](function(){if(_0x1f6e22){return _0x6fd2a5[_0xadb1('0x84')](_0x176b0,_0x54ebb0,function(_0x309923){if(_0x309923){console['log'](_0xadb1('0x85'),_0x309923);}else{fs[_0xadb1('0x86')](_0x176b0);}});}else{return _0x6fd2a5['sendStatus'](0xc8);}})['catch'](handleError(_0x6fd2a5,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index e35748c..fd21e38 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 _0xc742=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x309991,_0x457e73){var _0x4ca94d=function(_0x294acc){while(--_0x294acc){_0x309991['push'](_0x309991['shift']());}};_0x4ca94d(++_0x457e73);}(_0xc742,0x1c1));var _0x2c74=function(_0x5179e5,_0x4c9c82){_0x5179e5=_0x5179e5-0x0;var _0x4d38dc=_0xc742[_0x5179e5];return _0x4d38dc;};'use strict';var EventEmitter=require(_0x2c74('0x0'));var MailInteraction=require(_0x2c74('0x1'))['db']['MailInteraction'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2c74('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2c74('0x3'),'afterDestroy':_0x2c74('0x4')};function emitEvent(_0x233f02){return function(_0x2f6769,_0x551cdd,_0x311b71){MailInteractionEvents[_0x2c74('0x5')](_0x233f02+':'+_0x2f6769['id'],_0x2f6769);MailInteractionEvents[_0x2c74('0x5')](_0x233f02,_0x2f6769);_0x311b71(null);};}for(var e in events){if(events[_0x2c74('0x6')](e)){var event=events[e];MailInteraction[_0x2c74('0x7')](e,emitEvent(event));}}module[_0x2c74('0x8')]=MailInteractionEvents; \ No newline at end of file +var _0x5392=['hook','exports','events','../../mysqldb','MailInteraction','save','update','remove','emit','hasOwnProperty'];(function(_0x46f521,_0x11747b){var _0x1489d2=function(_0x368041){while(--_0x368041){_0x46f521['push'](_0x46f521['shift']());}};_0x1489d2(++_0x11747b);}(_0x5392,0x138));var _0x2539=function(_0x885c7f,_0xd3f99c){_0x885c7f=_0x885c7f-0x0;var _0x1149ea=_0x5392[_0x885c7f];return _0x1149ea;};'use strict';var EventEmitter=require(_0x2539('0x0'));var MailInteraction=require(_0x2539('0x1'))['db'][_0x2539('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2539('0x3'),'afterUpdate':_0x2539('0x4'),'afterDestroy':_0x2539('0x5')};function emitEvent(_0xf28cd){return function(_0x1f68b7,_0x819b8b,_0x5299ac){MailInteractionEvents['emit'](_0xf28cd+':'+_0x1f68b7['id'],_0x1f68b7);MailInteractionEvents[_0x2539('0x6')](_0xf28cd,_0x1f68b7);_0x5299ac(null);};}for(var e in events){if(events[_0x2539('0x7')](e)){var event=events[e];MailInteraction[_0x2539('0x8')](e,emitEvent(event));}}module[_0x2539('0x9')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index df672be..7e512e3 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 _0xfdad=['define','mail_interactions','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','./mailInteraction.attributes','exports'];(function(_0x230a02,_0x2937de){var _0x2c9b7a=function(_0x10f443){while(--_0x10f443){_0x230a02['push'](_0x230a02['shift']());}};_0x2c9b7a(++_0x2937de);}(_0xfdad,0x164));var _0xdfda=function(_0x362d30,_0x5d9751){_0x362d30=_0x362d30-0x0;var _0x35c215=_0xfdad[_0x362d30];return _0x35c215;};'use strict';var _=require(_0xdfda('0x0'));var util=require(_0xdfda('0x1'));var logger=require('../../config/logger')(_0xdfda('0x2'));var moment=require(_0xdfda('0x3'));var BPromise=require('bluebird');var rp=require(_0xdfda('0x4'));var attributes=require(_0xdfda('0x5'));module[_0xdfda('0x6')]=function(_0x50384d,_0x1f2fb5){return _0x50384d[_0xdfda('0x7')]('MailInteraction',attributes,{'tableName':_0xdfda('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdfda('0x9'),'collate':_0xdfda('0xa')});}; \ No newline at end of file +var _0x219d=['util','../../config/logger','api','moment','bluebird','request-promise','./mailInteraction.attributes','exports','mail_interactions','utf8mb4','lodash'];(function(_0x1a934a,_0x3f6d10){var _0x59e40a=function(_0x32d4ab){while(--_0x32d4ab){_0x1a934a['push'](_0x1a934a['shift']());}};_0x59e40a(++_0x3f6d10);}(_0x219d,0xa4));var _0xd219=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x219d[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xd219('0x0'));var util=require(_0xd219('0x1'));var logger=require(_0xd219('0x2'))(_0xd219('0x3'));var moment=require(_0xd219('0x4'));var BPromise=require(_0xd219('0x5'));var rp=require(_0xd219('0x6'));var attributes=require(_0xd219('0x7'));module[_0xd219('0x8')]=function(_0x3e0efa,_0x1e590b){return _0x3e0efa['define']('MailInteraction',attributes,{'tableName':_0xd219('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd219('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index cb9204d..20a9e30 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 _0x5b5a=['register','info','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailInteraction,\x20%s,\x20%s','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','then','debug','find','addTags','ids','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailInteraction.socket'];(function(_0x5413f5,_0x3154c7){var _0x639288=function(_0x4b85e9){while(--_0x4b85e9){_0x5413f5['push'](_0x5413f5['shift']());}};_0x639288(++_0x3154c7);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x2ac71a,_0x1d2a02){_0x2ac71a=_0x2ac71a-0x0;var _0x3ee904=_0x5b5a[_0x2ac71a];return _0x3ee904;};'use strict';var _=require('lodash');var util=require(_0xa5b5('0x0'));var moment=require(_0xa5b5('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5b5('0x2'));var fs=require('fs');var Redis=require(_0xa5b5('0x3'));var db=require(_0xa5b5('0x4'))['db'];var utils=require(_0xa5b5('0x5'));var logger=require(_0xa5b5('0x6'))(_0xa5b5('0x7'));var config=require(_0xa5b5('0x8'));var jayson=require(_0xa5b5('0x9'));var client=jayson['client'][_0xa5b5('0xa')]({'port':0x232a});config[_0xa5b5('0xb')]=_['defaults'](config[_0xa5b5('0xb')],{'host':_0xa5b5('0xc'),'port':0x18eb});var socket=require(_0xa5b5('0xd'))(new Redis(config[_0xa5b5('0xb')]));require(_0xa5b5('0xe'))[_0xa5b5('0xf')](socket);function respondWithRpcPromise(_0x3d635d,_0x396c44,_0x37489f){return new BPromise(function(_0x1a35a0,_0x529bc3){return client['request'](_0x3d635d,_0x37489f)['then'](function(_0x5ad9f4){logger[_0xa5b5('0x10')]('MailInteraction,\x20%s,\x20%s',_0x396c44,_0xa5b5('0x11'));logger['debug'](_0xa5b5('0x12'),_0x396c44,_0xa5b5('0x11'),JSON[_0xa5b5('0x13')](_0x5ad9f4));if(_0x5ad9f4[_0xa5b5('0x14')]){if(_0x5ad9f4[_0xa5b5('0x14')][_0xa5b5('0x15')]===0x1f4){logger[_0xa5b5('0x14')]('MailInteraction,\x20%s,\x20%s',_0x396c44,_0x5ad9f4['error'][_0xa5b5('0x16')]);return _0x529bc3(_0x5ad9f4['error'][_0xa5b5('0x16')]);}logger[_0xa5b5('0x14')](_0xa5b5('0x17'),_0x396c44,_0x5ad9f4['error']['message']);return _0x1a35a0(_0x5ad9f4['error']['message']);}else{logger[_0xa5b5('0x10')](_0xa5b5('0x17'),_0x396c44,_0xa5b5('0x11'));_0x1a35a0(_0x5ad9f4[_0xa5b5('0x18')][_0xa5b5('0x16')]);}})[_0xa5b5('0x19')](function(_0x590620){logger[_0xa5b5('0x14')](_0xa5b5('0x17'),_0x396c44,_0x590620);_0x529bc3(_0x590620);});});}exports[_0xa5b5('0x1a')]=function(_0x4f31d4){var _0x21aa02=this;return new Promise(function(_0x243708,_0x5c64a9){return db[_0xa5b5('0x1b')][_0xa5b5('0x1c')](_0x4f31d4[_0xa5b5('0x1d')],{'raw':_0x4f31d4[_0xa5b5('0x1e')]?_0x4f31d4[_0xa5b5('0x1e')][_0xa5b5('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f31d4[_0xa5b5('0x1e')]?_0x4f31d4[_0xa5b5('0x1e')][_0xa5b5('0x20')]||null:null,'attributes':_0x4f31d4[_0xa5b5('0x1e')]?_0x4f31d4[_0xa5b5('0x1e')][_0xa5b5('0x21')]||null:null,'limit':_0x4f31d4[_0xa5b5('0x1e')]?_0x4f31d4[_0xa5b5('0x1e')][_0xa5b5('0x22')]||null:null})[_0xa5b5('0x23')](function(_0x1f9712){logger[_0xa5b5('0x10')](_0xa5b5('0x1a'),_0x4f31d4);logger[_0xa5b5('0x24')](_0xa5b5('0x1a'),_0x4f31d4,JSON[_0xa5b5('0x13')](_0x1f9712));_0x243708(_0x1f9712);})[_0xa5b5('0x19')](function(_0x12da31){logger['error'](_0xa5b5('0x1a'),_0x12da31[_0xa5b5('0x16')],_0x4f31d4);_0x5c64a9(_0x21aa02[_0xa5b5('0x14')](0x1f4,_0x12da31[_0xa5b5('0x16')]));});});};exports['AddTagsToMailInteraction']=function(_0xf7a0bc){return new Promise(function(_0x3d91ba,_0x39a721){return db[_0xa5b5('0x1b')][_0xa5b5('0x25')]({'where':_0xf7a0bc['options']?_0xf7a0bc[_0xa5b5('0x1e')]['where']||null:null})[_0xa5b5('0x23')](function(_0x1a7ce3){if(_0x1a7ce3){return _0x1a7ce3[_0xa5b5('0x26')](_0xf7a0bc['body'][_0xa5b5('0x27')],_['omit'](_0xf7a0bc[_0xa5b5('0x1d')],[_0xa5b5('0x27'),'id'])||{});}})[_0xa5b5('0x28')](function(_0x10b378){logger[_0xa5b5('0x10')](_0xa5b5('0x29'),_0xf7a0bc);logger['debug'](_0xa5b5('0x29'),_0xf7a0bc,JSON[_0xa5b5('0x13')](_0x10b378));_0x3d91ba(_0x10b378);})[_0xa5b5('0x19')](function(_0x15c141){logger[_0xa5b5('0x14')](_0xa5b5('0x29'),_0x15c141['message'],_0xf7a0bc);_0x39a721(_this[_0xa5b5('0x14')](0x1f4,_0x15c141[_0xa5b5('0x16')]));});});}; \ No newline at end of file +var _0x6691=['find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','raw','attributes','AddTagsToMailInteraction'];(function(_0x4f83a6,_0x41dcae){var _0x48b8e8=function(_0x352d67){while(--_0x352d67){_0x4f83a6['push'](_0x4f83a6['shift']());}};_0x48b8e8(++_0x41dcae);}(_0x6691,0x12d));var _0x1669=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6691[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var moment=require(_0x1669('0x2'));var BPromise=require(_0x1669('0x3'));var rs=require(_0x1669('0x4'));var fs=require('fs');var Redis=require(_0x1669('0x5'));var db=require(_0x1669('0x6'))['db'];var utils=require(_0x1669('0x7'));var logger=require(_0x1669('0x8'))(_0x1669('0x9'));var config=require('../../config/environment');var jayson=require(_0x1669('0xa'));var client=jayson[_0x1669('0xb')][_0x1669('0xc')]({'port':0x232a});config[_0x1669('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1669('0xe'))(new Redis(config['redis']));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x56e0ee,_0x52b44f,_0x408538){return new BPromise(function(_0x93d633,_0xdf793d){return client[_0x1669('0xf')](_0x56e0ee,_0x408538)[_0x1669('0x10')](function(_0x3d6f5e){logger[_0x1669('0x11')](_0x1669('0x12'),_0x52b44f,_0x1669('0x13'));logger[_0x1669('0x14')](_0x1669('0x15'),_0x52b44f,_0x1669('0x13'),JSON[_0x1669('0x16')](_0x3d6f5e));if(_0x3d6f5e[_0x1669('0x17')]){if(_0x3d6f5e[_0x1669('0x17')][_0x1669('0x18')]===0x1f4){logger[_0x1669('0x17')](_0x1669('0x12'),_0x52b44f,_0x3d6f5e[_0x1669('0x17')][_0x1669('0x19')]);return _0xdf793d(_0x3d6f5e[_0x1669('0x17')][_0x1669('0x19')]);}logger[_0x1669('0x17')]('MailInteraction,\x20%s,\x20%s',_0x52b44f,_0x3d6f5e[_0x1669('0x17')][_0x1669('0x19')]);return _0x93d633(_0x3d6f5e[_0x1669('0x17')][_0x1669('0x19')]);}else{logger[_0x1669('0x11')]('MailInteraction,\x20%s,\x20%s',_0x52b44f,'request\x20sent');_0x93d633(_0x3d6f5e[_0x1669('0x1a')][_0x1669('0x19')]);}})[_0x1669('0x1b')](function(_0x4fcf1c){logger[_0x1669('0x17')](_0x1669('0x12'),_0x52b44f,_0x4fcf1c);_0xdf793d(_0x4fcf1c);});});}exports[_0x1669('0x1c')]=function(_0x59853b){var _0x31483f=this;return new Promise(function(_0x42cc8a,_0x51297e){return db[_0x1669('0x1d')][_0x1669('0x1e')](_0x59853b['body'],{'raw':_0x59853b[_0x1669('0x1f')]?_0x59853b[_0x1669('0x1f')][_0x1669('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59853b[_0x1669('0x1f')]?_0x59853b[_0x1669('0x1f')]['where']||null:null,'attributes':_0x59853b[_0x1669('0x1f')]?_0x59853b[_0x1669('0x1f')][_0x1669('0x21')]||null:null,'limit':_0x59853b['options']?_0x59853b[_0x1669('0x1f')]['limit']||null:null})['then'](function(_0x238ce2){logger['info'](_0x1669('0x1c'),_0x59853b);logger[_0x1669('0x14')](_0x1669('0x1c'),_0x59853b,JSON[_0x1669('0x16')](_0x238ce2));_0x42cc8a(_0x238ce2);})[_0x1669('0x1b')](function(_0x660cc7){logger[_0x1669('0x17')]('UpdateMailInteraction',_0x660cc7[_0x1669('0x19')],_0x59853b);_0x51297e(_0x31483f['error'](0x1f4,_0x660cc7[_0x1669('0x19')]));});});};exports[_0x1669('0x22')]=function(_0x4fcf88){return new Promise(function(_0xfca7c6,_0x590053){return db[_0x1669('0x1d')][_0x1669('0x23')]({'where':_0x4fcf88[_0x1669('0x1f')]?_0x4fcf88[_0x1669('0x1f')]['where']||null:null})['then'](function(_0x47fbda){if(_0x47fbda){return _0x47fbda[_0x1669('0x24')](_0x4fcf88[_0x1669('0x25')][_0x1669('0x26')],_[_0x1669('0x27')](_0x4fcf88[_0x1669('0x25')],['ids','id'])||{});}})[_0x1669('0x28')](function(_0xc17e95){logger[_0x1669('0x11')](_0x1669('0x29'),_0x4fcf88);logger[_0x1669('0x14')](_0x1669('0x29'),_0x4fcf88,JSON[_0x1669('0x16')](_0xc17e95));_0xfca7c6(_0xc17e95);})[_0x1669('0x1b')](function(_0x496df9){logger[_0x1669('0x17')]('AddTags',_0x496df9[_0x1669('0x19')],_0x4fcf88);_0x590053(_this['error'](0x1f4,_0x496df9['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 1f5b589..88ee0ec 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 _0x3adf=['remove','update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3adf,0x15f));var _0xf3ad=function(_0x377cd8,_0x3aaabf){_0x377cd8=_0x377cd8-0x0;var _0x2685e1=_0x3adf[_0x377cd8];return _0x2685e1;};'use strict';var MailInteractionEvents=require(_0xf3ad('0x0'));var events=['save',_0xf3ad('0x1'),_0xf3ad('0x2')];function createListener(_0x2ceb0f,_0x45cbaf){return function(_0x59e874){_0x45cbaf[_0xf3ad('0x3')](_0x2ceb0f,_0x59e874);};}function removeListener(_0x4af961,_0x319593){return function(){MailInteractionEvents[_0xf3ad('0x4')](_0x4af961,_0x319593);};}exports[_0xf3ad('0x5')]=function(_0x4d38aa){for(var _0x2db9d0=0x0,_0x29de69=events[_0xf3ad('0x6')];_0x2db9d0<_0x29de69;_0x2db9d0++){var _0x31993f=events[_0x2db9d0];var _0x2bf409=createListener(_0xf3ad('0x7')+_0x31993f,_0x4d38aa);MailInteractionEvents['on'](_0x31993f,_0x2bf409);}}; \ No newline at end of file +var _0x6288=['register','length','mailInteraction:','remove','removeListener'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6288,0x116));var _0x8628=function(_0x1d7b23,_0x75416d){_0x1d7b23=_0x1d7b23-0x0;var _0x50fd26=_0x6288[_0x1d7b23];return _0x50fd26;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0x8628('0x0'),'update'];function createListener(_0x30f7d0,_0x4390b3){return function(_0x36fea4){_0x4390b3['emit'](_0x30f7d0,_0x36fea4);};}function removeListener(_0x18400a,_0x4a6709){return function(){MailInteractionEvents[_0x8628('0x1')](_0x18400a,_0x4a6709);};}exports[_0x8628('0x2')]=function(_0x4c3d53){for(var _0x5a7315=0x0,_0x43308e=events[_0x8628('0x3')];_0x5a7315<_0x43308e;_0x5a7315++){var _0x5bc87f=events[_0x5a7315];var _0x476df2=createListener(_0x8628('0x4')+_0x5bc87f,_0x4c3d53);MailInteractionEvents['on'](_0x5bc87f,_0x476df2);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index b7e0fbd..9595007 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 _0xeec6=['get','index','isAuthenticated','describe','/:id','show','/:id/download','tracked','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller'];(function(_0x50db7b,_0x2e3858){var _0x550cad=function(_0x1a4e7d){while(--_0x1a4e7d){_0x50db7b['push'](_0x50db7b['shift']());}};_0x550cad(++_0x2e3858);}(_0xeec6,0x1c2));var _0x6eec=function(_0x4ccd32,_0x3b11c9){_0x4ccd32=_0x4ccd32-0x0;var _0x30b693=_0xeec6[_0x4ccd32];return _0x30b693;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var auth=require(_0x6eec('0x5'));var interaction=require(_0x6eec('0x6'));var config=require(_0x6eec('0x7'));var controller=require(_0x6eec('0x8'));router[_0x6eec('0x9')]('/',auth['isAuthenticated'](),controller[_0x6eec('0xa')]);router[_0x6eec('0x9')]('/describe',auth[_0x6eec('0xb')](),controller[_0x6eec('0xc')]);router[_0x6eec('0x9')](_0x6eec('0xd'),auth['isAuthenticated'](),controller[_0x6eec('0xe')]);router[_0x6eec('0x9')](_0x6eec('0xf'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x6eec('0xb')](),interaction[_0x6eec('0x10')]('mail','mailmessage:create'),controller[_0x6eec('0x11')]);router['put'](_0x6eec('0xd'),auth[_0x6eec('0xb')](),controller[_0x6eec('0x12')]);router[_0x6eec('0x13')](_0x6eec('0x14'),auth['isAuthenticated'](),controller[_0x6eec('0x15')]);router[_0x6eec('0x13')](_0x6eec('0x16'),auth[_0x6eec('0xb')](),controller[_0x6eec('0x17')]);router[_0x6eec('0x18')](_0x6eec('0xd'),auth[_0x6eec('0xb')](),controller[_0x6eec('0x19')]);module[_0x6eec('0x1a')]=router; \ No newline at end of file +var _0x5d17=['/:id/download','post','mail','mailmessage:create','create','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x18d264,_0x10d90f){var _0x33bcb2=function(_0x198dc6){while(--_0x198dc6){_0x18d264['push'](_0x18d264['shift']());}};_0x33bcb2(++_0x10d90f);}(_0x5d17,0x114));var _0x75d1=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0x5d17[_0x18fb16];return _0x147b0d;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var auth=require(_0x75d1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x75d1('0x5'));var controller=require(_0x75d1('0x6'));router[_0x75d1('0x7')]('/',auth[_0x75d1('0x8')](),controller['index']);router[_0x75d1('0x7')](_0x75d1('0x9'),auth[_0x75d1('0x8')](),controller[_0x75d1('0xa')]);router[_0x75d1('0x7')](_0x75d1('0xb'),auth[_0x75d1('0x8')](),controller['show']);router['get'](_0x75d1('0xc'),auth['isAuthenticated'](),controller['download']);router[_0x75d1('0xd')]('/',auth[_0x75d1('0x8')](),interaction['tracked'](_0x75d1('0xe'),_0x75d1('0xf')),controller[_0x75d1('0x10')]);router[_0x75d1('0x11')](_0x75d1('0xb'),auth[_0x75d1('0x8')](),controller['update']);router[_0x75d1('0x11')](_0x75d1('0x12'),auth[_0x75d1('0x8')](),controller[_0x75d1('0x13')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x75d1('0x14')]);router[_0x75d1('0x15')](_0x75d1('0xb'),auth['isAuthenticated'](),controller[_0x75d1('0x16')]);module[_0x75d1('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index af3932a..c039607 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 _0x0fe0=['ENUM','out','STRING','DATE','INTEGER','sequelize','lodash','exports','TEXT','long','BOOLEAN'];(function(_0x59bc4b,_0xf4b146){var _0x3518f3=function(_0x38b738){while(--_0x38b738){_0x59bc4b['push'](_0x59bc4b['shift']());}};_0x3518f3(++_0xf4b146);}(_0x0fe0,0x102));var _0x00fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0fe0[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x00fe('0x0'));var _=require(_0x00fe('0x1'));module[_0x00fe('0x2')]={'body':{'type':Sequelize[_0x00fe('0x3')](_0x00fe('0x4')),'allowNull':![]},'read':{'type':Sequelize[_0x00fe('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x00fe('0x6')]('in',_0x00fe('0x7')),'defaultValue':_0x00fe('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x00fe('0x8')](0x1fe)},'from':{'type':Sequelize[_0x00fe('0x8')]},'to':{'type':Sequelize['TEXT'](_0x00fe('0x4'))},'cc':{'type':Sequelize[_0x00fe('0x3')]('long')},'bcc':{'type':Sequelize[_0x00fe('0x3')](_0x00fe('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x00fe('0x9')]},'attach':{'type':Sequelize[_0x00fe('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x00fe('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x00fe('0x3')](_0x00fe('0x4'))},'originCc':{'type':Sequelize[_0x00fe('0x3')]('long')}}; \ No newline at end of file +var _0xef3c=['TEXT','DATE','lodash','exports','long','BOOLEAN','out','STRING'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0xef3c,0xaa));var _0xcef3=function(_0x24f479,_0x3046bf){_0x24f479=_0x24f479-0x0;var _0x425a42=_0xef3c[_0x24f479];return _0x425a42;};'use strict';var Sequelize=require('sequelize');var _=require(_0xcef3('0x0'));module[_0xcef3('0x1')]={'body':{'type':Sequelize['TEXT'](_0xcef3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcef3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xcef3('0x4')),'defaultValue':_0xcef3('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xcef3('0x5')]},'to':{'type':Sequelize[_0xcef3('0x6')](_0xcef3('0x2'))},'cc':{'type':Sequelize[_0xcef3('0x6')]('long')},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xcef3('0x7')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xcef3('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xcef3('0x7')]},'originTo':{'type':Sequelize[_0xcef3('0x6')](_0xcef3('0x2'))},'originCc':{'type':Sequelize[_0xcef3('0x6')]('long')}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 6bce480..0b4b6ab 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 _0x8488=['../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','count','offset','limit','Content-Range','apply','reject','save','update','end','sendStatus','stack','name','index','MailMessage','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','type','VIRTUAL','field','filter','includeAll','include','findAll','rows','show','params','find','body','destroy','create','out','secret','MailAccount','findOne','MailAccountId','MailServerOut','Smtp','host','port','secure','authentication','auth','user','pass','service','attachments','join','root','basename','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','mail','read','UserId','Contact','get','MailInteraction','MailInteractionId','isNil','interaction','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','event','rejectmessage','download','toString','server','files','createdAt','Attachment','Attachments','from','subject','existsSync','push','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x160a03,_0x3769f2){var _0x899179=function(_0x263287){while(--_0x263287){_0x160a03['push'](_0x160a03['shift']());}};_0x899179(++_0x3769f2);}(_0x8488,0x83));var _0x8848=function(_0x49ab1e,_0x1ef9df){_0x49ab1e=_0x49ab1e-0x0;var _0x10f0a1=_0x8488[_0x49ab1e];return _0x10f0a1;};'use strict';var pdf=require(_0x8848('0x0'));var emlformat=require(_0x8848('0x1'));var rimraf=require(_0x8848('0x2'));var zipdir=require(_0x8848('0x3'));var jsonpatch=require(_0x8848('0x4'));var rp=require(_0x8848('0x5'));var moment=require('moment');var BPromise=require(_0x8848('0x6'));var Mustache=require(_0x8848('0x7'));var util=require('util');var path=require(_0x8848('0x8'));var sox=require(_0x8848('0x9'));var csv=require(_0x8848('0xa'));var ejs=require(_0x8848('0xb'));var fs=require('fs');var _=require(_0x8848('0xc'));var squel=require(_0x8848('0xd'));var crypto=require('crypto');var jsforce=require(_0x8848('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8848('0xa'));var querystring=require('querystring');var Papa=require(_0x8848('0xf'));var authService=require(_0x8848('0x10'));var hardwareService=require(_0x8848('0x11'));var Redis=require(_0x8848('0x12'));var qs=require(_0x8848('0x13'));var logger=require(_0x8848('0x14'))(_0x8848('0x15'));var utils=require(_0x8848('0x16'));var config=require(_0x8848('0x17'));var db=require('../../mysqldb')['db'];config[_0x8848('0x18')]=_[_0x8848('0x19')](config[_0x8848('0x18')],{'host':_0x8848('0x1a'),'port':0x18eb});var socket=require(_0x8848('0x1b'))(new Redis(config[_0x8848('0x18')]));require(_0x8848('0x1c'))['register'](socket);var jayson=require(_0x8848('0x1d'));var client=jayson['client'][_0x8848('0x1e')]({'port':0x232c});var client9003=jayson['client'][_0x8848('0x1e')]({'port':0x232b});var client9002=jayson[_0x8848('0x1f')][_0x8848('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x281f12,_0x2021bc,_0x56ba66,_0x4c2f81){return new BPromise(function(_0x26c904,_0x479ddb){var _0x566f45=_0x4c2f81||client;return _0x566f45[_0x8848('0x20')](_0x281f12,_0x56ba66)[_0x8848('0x21')](function(_0x1e5b65){logger[_0x8848('0x22')](_0x8848('0x23'),_0x2021bc,_0x8848('0x24'));logger[_0x8848('0x25')](_0x8848('0x26'),_0x2021bc,'request\x20sent',JSON[_0x8848('0x27')](_0x1e5b65));if(_0x1e5b65[_0x8848('0x28')]){if(_0x1e5b65[_0x8848('0x28')][_0x8848('0x29')]===0x1f4){logger['error'](_0x8848('0x23'),_0x2021bc,_0x1e5b65[_0x8848('0x28')][_0x8848('0x2a')]);return _0x479ddb(_0x1e5b65[_0x8848('0x28')][_0x8848('0x2a')]);}logger[_0x8848('0x28')]('MailMessage,\x20%s,\x20%s',_0x2021bc,_0x1e5b65[_0x8848('0x28')][_0x8848('0x2a')]);return _0x26c904(_0x1e5b65[_0x8848('0x28')][_0x8848('0x2a')]);}else{logger[_0x8848('0x22')](_0x8848('0x23'),_0x2021bc,_0x8848('0x24'));_0x26c904(_0x1e5b65[_0x8848('0x2b')][_0x8848('0x2a')]);}})[_0x8848('0x2c')](function(_0x49e3b3){logger['error'](_0x8848('0x23'),_0x2021bc,_0x49e3b3);_0x479ddb(_0x49e3b3);});});}function respondWithStatusCode(_0x15905b,_0x2ec42b){_0x2ec42b=_0x2ec42b||0xcc;return function(_0x1caa9c){if(_0x1caa9c){return _0x15905b['sendStatus'](_0x2ec42b);}return _0x15905b[_0x8848('0x2d')](_0x2ec42b)['end']();};}function respondWithResult(_0x1e3238,_0x5c18f0){_0x5c18f0=_0x5c18f0||0xc8;return function(_0x5c70e1){if(_0x5c70e1){return _0x1e3238['status'](_0x5c18f0)[_0x8848('0x2e')](_0x5c70e1);}};}function respondWithFilteredResult(_0x1e8dbe,_0x5a9488){return function(_0x194c70){if(_0x194c70){var _0x288ebe=_0x194c70[_0x8848('0x2f')],_0x3bf783=_0x5a9488['offset'],_0xe5d5d=_0x5a9488[_0x8848('0x30')]+_0x5a9488[_0x8848('0x31')],_0x3783c3;if(_0xe5d5d>=_0x288ebe){_0xe5d5d=_0x288ebe;_0x3783c3=0xc8;}else{_0x3783c3=0xce;}_0x1e8dbe[_0x8848('0x2d')](_0x3783c3);return _0x1e8dbe['set'](_0x8848('0x32'),_0x3bf783+'-'+_0xe5d5d+'/'+_0x288ebe)[_0x8848('0x2e')](_0x194c70);}return null;};}function patchUpdates(_0x1a7e05){return function(_0x43d803){try{jsonpatch[_0x8848('0x33')](_0x43d803,_0x1a7e05,!![]);}catch(_0x2947ba){return BPromise[_0x8848('0x34')](_0x2947ba);}return _0x43d803[_0x8848('0x35')]();};}function saveUpdates(_0x3216ed,_0x5f1f55){return function(_0x2cd306){if(_0x2cd306){return _0x2cd306[_0x8848('0x36')](_0x3216ed)[_0x8848('0x21')](function(_0x18c559){return _0x18c559;});}return null;};}function removeEntity(_0x4affe9,_0x2167f5){return function(_0x50ead3){if(_0x50ead3){return _0x50ead3['destroy']()[_0x8848('0x21')](function(){_0x4affe9[_0x8848('0x2d')](0xcc)[_0x8848('0x37')]();});}};}function handleEntityNotFound(_0x14df18,_0x2783a9){return function(_0x5b2ed8){if(!_0x5b2ed8){_0x14df18[_0x8848('0x38')](0x194);}return _0x5b2ed8;};}function handleError(_0x24dcd8,_0x23ab1b){_0x23ab1b=_0x23ab1b||0x1f4;return function(_0x2c1246){logger[_0x8848('0x28')](_0x2c1246[_0x8848('0x39')]);if(_0x2c1246['name']){delete _0x2c1246[_0x8848('0x3a')];}_0x24dcd8[_0x8848('0x2d')](_0x23ab1b)['send'](_0x2c1246);};}exports[_0x8848('0x3b')]=function(_0x5d9eb7,_0x52380b){var _0x3f1a91={},_0x305435={},_0x21123e={'count':0x0,'rows':[]};var _0x206491=db[_0x8848('0x3c')][_0x8848('0x3d')];_0x305435[_0x8848('0x3e')]=_[_0x8848('0x3f')](_0x206491);_0x305435[_0x8848('0x40')]=_[_0x8848('0x3f')](_0x5d9eb7[_0x8848('0x40')]);_0x305435['filters']=_[_0x8848('0x41')](_0x305435[_0x8848('0x3e')],_0x305435[_0x8848('0x40')]);_0x3f1a91[_0x8848('0x42')]=_['intersection'](_0x305435['model'],qs[_0x8848('0x43')](_0x5d9eb7[_0x8848('0x40')][_0x8848('0x43')]));_0x3f1a91[_0x8848('0x42')]=_0x3f1a91[_0x8848('0x42')][_0x8848('0x44')]?_0x3f1a91[_0x8848('0x42')]:_0x305435[_0x8848('0x3e')];if(!_0x5d9eb7[_0x8848('0x40')][_0x8848('0x45')](_0x8848('0x46'))){_0x3f1a91[_0x8848('0x31')]=qs['limit'](_0x5d9eb7[_0x8848('0x40')][_0x8848('0x31')]);_0x3f1a91['offset']=qs[_0x8848('0x30')](_0x5d9eb7[_0x8848('0x40')][_0x8848('0x30')]);}_0x3f1a91['order']=qs[_0x8848('0x47')](_0x5d9eb7[_0x8848('0x40')][_0x8848('0x47')]);_0x3f1a91['where']=qs[_0x8848('0x48')](_[_0x8848('0x49')](_0x5d9eb7[_0x8848('0x40')],_0x305435['filters']));if(_0x5d9eb7[_0x8848('0x40')]['filter']){_0x3f1a91[_0x8848('0x4a')]=_[_0x8848('0x4b')](_0x3f1a91[_0x8848('0x4a')],{'$or':_['map'](_0x206491,function(_0x3c5b9e){if(_0x3c5b9e[_0x8848('0x4c')]['key']!==_0x8848('0x4d')){var _0x1587e1={};_0x1587e1[_0x3c5b9e[_0x8848('0x4e')]]={'$like':'%'+_0x5d9eb7[_0x8848('0x40')][_0x8848('0x4f')]+'%'};return _0x1587e1;}})});}_0x3f1a91=_[_0x8848('0x4b')]({},_0x3f1a91,_0x5d9eb7['options']);var _0x433cac={'where':_0x3f1a91[_0x8848('0x4a')]};return db[_0x8848('0x3c')]['count'](_0x433cac)[_0x8848('0x21')](function(_0x4ec252){_0x21123e[_0x8848('0x2f')]=_0x4ec252;if(_0x5d9eb7[_0x8848('0x40')][_0x8848('0x50')]){_0x3f1a91[_0x8848('0x51')]=[{'all':!![]}];}return db[_0x8848('0x3c')][_0x8848('0x52')](_0x3f1a91);})['then'](function(_0x157599){_0x21123e[_0x8848('0x53')]=_0x157599;return _0x21123e;})['then'](respondWithFilteredResult(_0x52380b,_0x3f1a91))[_0x8848('0x2c')](handleError(_0x52380b,null));};exports[_0x8848('0x54')]=function(_0x439b9d,_0x210610){var _0x4a042d={'raw':!![],'where':{'id':_0x439b9d[_0x8848('0x55')]['id']}},_0x54d917={};_0x54d917[_0x8848('0x3e')]=_[_0x8848('0x3f')](db[_0x8848('0x3c')][_0x8848('0x3d')]);_0x54d917[_0x8848('0x40')]=_[_0x8848('0x3f')](_0x439b9d[_0x8848('0x40')]);_0x54d917['filters']=_[_0x8848('0x41')](_0x54d917[_0x8848('0x3e')],_0x54d917[_0x8848('0x40')]);_0x4a042d[_0x8848('0x42')]=_['intersection'](_0x54d917['model'],qs[_0x8848('0x43')](_0x439b9d[_0x8848('0x40')]['fields']));_0x4a042d[_0x8848('0x42')]=_0x4a042d[_0x8848('0x42')][_0x8848('0x44')]?_0x4a042d[_0x8848('0x42')]:_0x54d917[_0x8848('0x3e')];if(_0x439b9d['query'][_0x8848('0x50')]){_0x4a042d[_0x8848('0x51')]=[{'all':!![]}];}_0x4a042d=_[_0x8848('0x4b')]({},_0x4a042d,_0x439b9d['options']);return db[_0x8848('0x3c')][_0x8848('0x56')](_0x4a042d)[_0x8848('0x21')](handleEntityNotFound(_0x210610,null))[_0x8848('0x21')](respondWithResult(_0x210610,null))[_0x8848('0x2c')](handleError(_0x210610,null));};exports[_0x8848('0x36')]=function(_0x1b1085,_0x4b9101){if(_0x1b1085[_0x8848('0x57')]['id']){delete _0x1b1085[_0x8848('0x57')]['id'];}return db[_0x8848('0x3c')][_0x8848('0x56')]({'where':{'id':_0x1b1085[_0x8848('0x55')]['id']}})[_0x8848('0x21')](handleEntityNotFound(_0x4b9101,null))[_0x8848('0x21')](saveUpdates(_0x1b1085['body'],null))['then'](respondWithResult(_0x4b9101,null))[_0x8848('0x2c')](handleError(_0x4b9101,null));};exports[_0x8848('0x58')]=function(_0x4ff5c9,_0x2215e5){return db[_0x8848('0x3c')][_0x8848('0x56')]({'where':{'id':_0x4ff5c9['params']['id']}})['then'](handleEntityNotFound(_0x2215e5,null))[_0x8848('0x21')](removeEntity(_0x2215e5,null))[_0x8848('0x2c')](handleError(_0x2215e5,null));};exports['describe']=function(_0x36c9d0,_0x59216b){return db[_0x8848('0x3c')]['describe']()['then'](respondWithResult(_0x59216b,null))[_0x8848('0x2c')](handleError(_0x59216b,null));};exports[_0x8848('0x59')]=function(_0x3daa39,_0x5f394d){return db[_0x8848('0x3c')][_0x8848('0x59')](_0x3daa39[_0x8848('0x57')])[_0x8848('0x21')](function(_0x54b170){if(_0x54b170){if(_0x54b170['direction']===_0x8848('0x5a')&&!_0x54b170[_0x8848('0x5b')]){return db[_0x8848('0x5c')][_0x8848('0x5d')]({'where':{'id':_0x54b170[_0x8848('0x5e')]},'include':[{'model':db[_0x8848('0x5f')],'as':_0x8848('0x60'),'raw':!![]}]})[_0x8848('0x21')](function(_0x599909){if(_0x599909&&_0x599909['Smtp']){var _0x1d0d73={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x599909[_0x8848('0x60')]['service'])){_0x1d0d73[_0x8848('0x61')]=_0x599909[_0x8848('0x60')]['host'];_0x1d0d73['port']=_0x599909[_0x8848('0x60')][_0x8848('0x62')];_0x1d0d73[_0x8848('0x63')]=_0x599909[_0x8848('0x60')][_0x8848('0x63')];if(_0x599909[_0x8848('0x60')][_0x8848('0x64')]){_0x1d0d73[_0x8848('0x65')]={'user':_0x599909[_0x8848('0x60')][_0x8848('0x66')],'pass':_0x599909[_0x8848('0x60')][_0x8848('0x67')]};}}else{_0x1d0d73['service']=_0x599909[_0x8848('0x60')][_0x8848('0x68')];_0x1d0d73['auth']={'user':_0x599909[_0x8848('0x60')][_0x8848('0x66')],'pass':_0x599909[_0x8848('0x60')][_0x8848('0x67')]};_0x1d0d73['secure']=_0x599909[_0x8848('0x60')][_0x8848('0x63')];}if(_0x3daa39[_0x8848('0x57')][_0x8848('0x69')]&&_0x3daa39[_0x8848('0x57')][_0x8848('0x69')][_0x8848('0x44')]){for(var _0x4de70b=0x0;_0x4de70b<_0x3daa39[_0x8848('0x57')][_0x8848('0x69')]['length'];_0x4de70b+=0x1){_0x3daa39[_0x8848('0x57')][_0x8848('0x69')][_0x4de70b]={'filename':_0x3daa39[_0x8848('0x57')][_0x8848('0x69')][_0x4de70b]['name'],'path':path[_0x8848('0x6a')](config[_0x8848('0x6b')],'server/files/attachments',_0x3daa39[_0x8848('0x57')][_0x8848('0x69')][_0x4de70b][_0x8848('0x6c')])};}}return{'account':_0x1d0d73,'message':_0x3daa39['body']};}})[_0x8848('0x21')](function(_0x17aa3c){if(_0x17aa3c){return respondWithRpcPromise('SendMail',_0x8848('0x6d'),_0x17aa3c,client9003)[_0x8848('0x21')](function(_0x19e7e3){return _0x54b170[_0x8848('0x36')]({'read':!![],'messageId':_0x19e7e3[_0x8848('0x6e')],'sentAt':moment()[_0x8848('0x6f')](_0x8848('0x70'))});})['catch'](function(_0x3de957){logger['error']('%s',JSON['stringify'](_0x3de957));return _0x54b170;});}return _0x54b170;});}return _0x54b170;}})['then'](respondWithResult(_0x5f394d,0xc9))[_0x8848('0x2c')](handleError(_0x5f394d,null));};var interaction_log=require(_0x8848('0x14'))(_0x8848('0x71'));exports['accept']=function(_0x596ec2,_0x4afe8e,_0x176b0f){var _0x49bc3a={'channel':_0x8848('0x72')};if(_0x596ec2[_0x8848('0x57')]['id']){delete _0x596ec2[_0x8848('0x57')]['id'];}_0x596ec2[_0x8848('0x57')][_0x8848('0x73')]=!![];_0x596ec2[_0x8848('0x57')]['readAt']=moment()[_0x8848('0x6f')](_0x8848('0x70'));_0x596ec2[_0x8848('0x57')]['UserId']=_0x596ec2[_0x8848('0x57')][_0x8848('0x74')]||_0x596ec2[_0x8848('0x66')]['id'];return db[_0x8848('0x3c')][_0x8848('0x56')]({'where':{'id':_0x596ec2['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x8848('0x75')}]})[_0x8848('0x21')](handleEntityNotFound(_0x4afe8e,null))[_0x8848('0x21')](saveUpdates(_0x596ec2[_0x8848('0x57')],null))['then'](function(_0xfd61ca){if(_0xfd61ca){_0x49bc3a[_0x8848('0x2a')]=_0xfd61ca[_0x8848('0x76')]({'plain':!![]});return db[_0x8848('0x77')]['find']({'where':{'id':_0xfd61ca[_0x8848('0x78')]}});}return null;})[_0x8848('0x21')](handleEntityNotFound(_0x4afe8e,null))['then'](function(_0x6e551d){if(_0x6e551d){return _0x6e551d[_0x8848('0x36')]({'UserId':_0x596ec2['body'][_0x8848('0x74')],'read1stAt':_[_0x8848('0x79')](_0x6e551d['read1stAt'])?moment()['format'](_0x8848('0x70')):undefined});}return null;})[_0x8848('0x21')](function(_0x438594){if(_0x438594){_0x49bc3a[_0x8848('0x7a')]=_0x438594[_0x8848('0x76')]({'plain':!![]});interaction_log[_0x8848('0x22')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x596ec2[_0x8848('0x66')]['id'],_0x596ec2[_0x8848('0x66')]['name'],_0x596ec2[_0x8848('0x66')][_0x8848('0x7b')],_0x49bc3a[_0x8848('0x7a')]['id'],_0x596ec2[_0x8848('0x57')]?JSON['stringify'](_0x596ec2['body']):'null');return respondWithRpcPromise(_0x8848('0x7c'),_0x8848('0x7d'),_0x49bc3a);}return null;})[_0x8848('0x21')](function(_0x21ef17){if(_0x21ef17){if(_0x596ec2[_0x8848('0x57')][_0x8848('0x7e')]){_0x49bc3a[_0x8848('0x2a')][_0x8848('0x7f')]=util['format'](_0x8848('0x80'),_0x596ec2[_0x8848('0x66')]['name']);_0x49bc3a[_0x8848('0x2a')][_0x8848('0x81')]=_0x49bc3a[_0x8848('0x81')];_0x49bc3a[_0x8848('0x2a')]['event']='accept';return respondWithRpcPromise(_0x8848('0x82'),_0x8848('0x82'),{'event':'acceptmessage','message':_0x49bc3a[_0x8848('0x2a')]},client9002)[_0x8848('0x21')](function(){return _0x49bc3a;});}return _0x49bc3a;}return null;})[_0x8848('0x21')](respondWithResult(_0x4afe8e,null))[_0x8848('0x2c')](handleError(_0x4afe8e,null));};var interaction_log=require(_0x8848('0x14'))(_0x8848('0x71'));exports[_0x8848('0x34')]=function(_0x9e0ef4,_0x471098,_0x3758a2){var _0x557f01={'agent':{},'channel':_0x8848('0x72')};if(_0x9e0ef4[_0x8848('0x57')]['id']){delete _0x9e0ef4[_0x8848('0x57')]['id'];}_0x9e0ef4[_0x8848('0x57')][_0x8848('0x74')]=_0x9e0ef4['body'][_0x8848('0x74')]||_0x9e0ef4[_0x8848('0x66')]['id'];_0x557f01[_0x8848('0x83')]['id']=_0x9e0ef4[_0x8848('0x57')]['UserId'];return db[_0x8848('0x3c')][_0x8848('0x56')]({'where':{'id':_0x9e0ef4[_0x8848('0x55')]['id'],'UserId':null}})[_0x8848('0x21')](handleEntityNotFound(_0x471098,null))['then'](function(_0x5f89ae){if(_0x5f89ae){_0x557f01['message']=_0x5f89ae[_0x8848('0x76')]({'plain':!![]});return db[_0x8848('0x77')][_0x8848('0x56')]({'where':{'id':_0x5f89ae[_0x8848('0x78')]}});}return null;})[_0x8848('0x21')](handleEntityNotFound(_0x471098,null))[_0x8848('0x21')](function(_0x304999){if(_0x304999){_0x557f01[_0x8848('0x7a')]=_0x304999[_0x8848('0x76')]({'plain':!![]});interaction_log[_0x8848('0x22')](_0x8848('0x84'),_0x9e0ef4[_0x8848('0x66')]['id'],_0x9e0ef4['user'][_0x8848('0x3a')],_0x9e0ef4['user'][_0x8848('0x7b')],_0x557f01['interaction']['id'],_0x9e0ef4[_0x8848('0x57')]?JSON[_0x8848('0x27')](_0x9e0ef4[_0x8848('0x57')]):_0x8848('0x85'));return respondWithRpcPromise(_0x8848('0x86'),'rejectMessage',_0x557f01);}return null;})[_0x8848('0x21')](function(_0x2a2feb){if(_0x2a2feb){_0x2a2feb['message'][_0x8848('0x7f')]=util[_0x8848('0x6f')](_0x8848('0x80'),_0x9e0ef4[_0x8848('0x66')][_0x8848('0x3a')]);_0x2a2feb[_0x8848('0x2a')]['channel']=_0x557f01[_0x8848('0x81')];_0x2a2feb[_0x8848('0x2a')][_0x8848('0x87')]=_0x8848('0x34');respondWithRpcPromise('EventManager',_0x8848('0x82'),{'event':_0x8848('0x88'),'message':_0x2a2feb[_0x8848('0x2a')]},client9002);return _0x557f01;}return null;})[_0x8848('0x21')](respondWithResult(_0x471098,null))[_0x8848('0x2c')](handleError(_0x471098,null));};exports[_0x8848('0x89')]=function(_0x30923a,_0x106029){var _0xaaa0e2=moment()['unix']()[_0x8848('0x8a')]();var _0x134c49=path[_0x8848('0x6a')](config[_0x8848('0x6b')],_0x8848('0x8b'),'files','tmp');var _0x33e16e=path['join'](config[_0x8848('0x6b')],_0x8848('0x8b'),_0x8848('0x8c'),_0x8848('0x69'));var _0x627dda=util[_0x8848('0x6f')]('message-%s.eml',_0xaaa0e2);return db[_0x8848('0x3c')][_0x8848('0x56')]({'where':{'id':_0x30923a['params']['id']},'attributes':['id','body','from','to','cc','subject',_0x8848('0x8d')],'include':_0x30923a['query'][_0x8848('0x69')]?[{'model':db[_0x8848('0x8e')],'as':_0x8848('0x8f')}]:undefined})[_0x8848('0x21')](handleEntityNotFound(_0x106029,null))[_0x8848('0x21')](function(_0x29a752){if(_0x29a752){var _0x28cd88=_0x29a752;var _0x590261={'from':_0x28cd88[_0x8848('0x90')],'to':_0x28cd88['to'],'subject':_0x28cd88[_0x8848('0x91')],'html':_0x28cd88[_0x8848('0x57')],'attachments':[]};return new BPromise(function(_0x1fc76b,_0x1b5b96){if(_0x29a752[_0x8848('0x8f')]){for(var _0x5e9336=0x0;_0x5e9336<_0x29a752[_0x8848('0x8f')][_0x8848('0x44')];_0x5e9336++){var _0x1363e5=_0x29a752[_0x8848('0x8f')][_0x5e9336];var _0x1599fc=path[_0x8848('0x6a')](_0x33e16e,_0x1363e5[_0x8848('0x6c')]);if(fs[_0x8848('0x92')](_0x1599fc)){_0x590261[_0x8848('0x69')][_0x8848('0x93')]({'name':_0x1363e5[_0x8848('0x3a')],'contentType':_0x1363e5['type'],'data':fs[_0x8848('0x94')](_0x1599fc)});}}}emlformat[_0x8848('0x95')](_0x590261,function(_0x20caea,_0x22b99d){if(_0x20caea)return _0x1b5b96(_0x20caea);fs[_0x8848('0x96')](path[_0x8848('0x6a')](_0x134c49,_0x627dda),_0x22b99d);return _0x1fc76b(_0x22b99d);});});}})[_0x8848('0x21')](function(_0x4e9e5c){if(_0x4e9e5c){return _0x106029['download'](path['join'](_0x134c49,_0x627dda),_0x627dda,function(_0x560a53){if(_0x560a53){console[_0x8848('0x97')](_0x8848('0x98'),_0x560a53);}else{fs[_0x8848('0x99')](path[_0x8848('0x6a')](_0x134c49,_0x627dda));}});}})[_0x8848('0x2c')](handleError(_0x106029,null));}; \ No newline at end of file +var _0xa523=['channel','event','EventManager','mail-interactions','reject','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectmessage','unix','toString','server','files','tmp','message-%s.eml','from','subject','Attachment','Attachments','existsSync','push','type','build','writeFileSync','download','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','json','offset','status','set','Content-Range','update','then','destroy','end','stack','send','index','MailMessage','rawAttributes','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','filters','filter','where','merge','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','body','find','params','describe','create','direction','out','MailAccount','findOne','MailAccountId','Smtp','isNil','service','host','port','secure','auth','user','pass','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','UserId','CmContact','Contact','get','MailInteraction','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','null','AcceptMessage','manual','interface','SIP/%s'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xa523,0xb9));var _0x3a52=function(_0x3832b1,_0x1636c6){_0x3832b1=_0x3832b1-0x0;var _0x33371c=_0xa523[_0x3832b1];return _0x33371c;};'use strict';var pdf=require(_0x3a52('0x0'));var emlformat=require(_0x3a52('0x1'));var rimraf=require(_0x3a52('0x2'));var zipdir=require(_0x3a52('0x3'));var jsonpatch=require(_0x3a52('0x4'));var rp=require(_0x3a52('0x5'));var moment=require('moment');var BPromise=require(_0x3a52('0x6'));var Mustache=require(_0x3a52('0x7'));var util=require(_0x3a52('0x8'));var path=require(_0x3a52('0x9'));var sox=require(_0x3a52('0xa'));var csv=require(_0x3a52('0xb'));var ejs=require(_0x3a52('0xc'));var fs=require('fs');var _=require(_0x3a52('0xd'));var squel=require(_0x3a52('0xe'));var crypto=require(_0x3a52('0xf'));var jsforce=require(_0x3a52('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3a52('0xb'));var querystring=require('querystring');var Papa=require(_0x3a52('0x11'));var authService=require(_0x3a52('0x12'));var hardwareService=require(_0x3a52('0x13'));var Redis=require(_0x3a52('0x14'));var qs=require(_0x3a52('0x15'));var logger=require(_0x3a52('0x16'))(_0x3a52('0x17'));var utils=require(_0x3a52('0x18'));var config=require(_0x3a52('0x19'));var db=require(_0x3a52('0x1a'))['db'];config[_0x3a52('0x1b')]=_['defaults'](config['redis'],{'host':_0x3a52('0x1c'),'port':0x18eb});var socket=require(_0x3a52('0x1d'))(new Redis(config['redis']));require('./mailMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9003=jayson[_0x3a52('0x1e')][_0x3a52('0x1f')]({'port':0x232b});var client9002=jayson['client'][_0x3a52('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2a3000,_0x568b05,_0x4e7212,_0x5942d6){return new BPromise(function(_0x3b0f6b,_0x51edc1){var _0x1b3485=_0x5942d6||client;return _0x1b3485[_0x3a52('0x20')](_0x2a3000,_0x4e7212)['then'](function(_0x4e458a){logger[_0x3a52('0x21')](_0x3a52('0x22'),_0x568b05,_0x3a52('0x23'));logger[_0x3a52('0x24')](_0x3a52('0x25'),_0x568b05,_0x3a52('0x23'),JSON[_0x3a52('0x26')](_0x4e458a));if(_0x4e458a[_0x3a52('0x27')]){if(_0x4e458a[_0x3a52('0x27')][_0x3a52('0x28')]===0x1f4){logger[_0x3a52('0x27')]('MailMessage,\x20%s,\x20%s',_0x568b05,_0x4e458a[_0x3a52('0x27')][_0x3a52('0x29')]);return _0x51edc1(_0x4e458a['error'][_0x3a52('0x29')]);}logger[_0x3a52('0x27')](_0x3a52('0x22'),_0x568b05,_0x4e458a[_0x3a52('0x27')][_0x3a52('0x29')]);return _0x3b0f6b(_0x4e458a[_0x3a52('0x27')][_0x3a52('0x29')]);}else{logger[_0x3a52('0x21')](_0x3a52('0x22'),_0x568b05,'request\x20sent');_0x3b0f6b(_0x4e458a[_0x3a52('0x2a')][_0x3a52('0x29')]);}})[_0x3a52('0x2b')](function(_0x417a0d){logger[_0x3a52('0x27')](_0x3a52('0x22'),_0x568b05,_0x417a0d);_0x51edc1(_0x417a0d);});});}function respondWithStatusCode(_0x5631d9,_0x2ee637){_0x2ee637=_0x2ee637||0xcc;return function(_0x299784){if(_0x299784){return _0x5631d9[_0x3a52('0x2c')](_0x2ee637);}return _0x5631d9['status'](_0x2ee637)['end']();};}function respondWithResult(_0x1a04f4,_0x1d01b1){_0x1d01b1=_0x1d01b1||0xc8;return function(_0x389a77){if(_0x389a77){return _0x1a04f4['status'](_0x1d01b1)[_0x3a52('0x2d')](_0x389a77);}};}function respondWithFilteredResult(_0x1e42f6,_0x366dba){return function(_0x2d170b){if(_0x2d170b){var _0x315d24=_0x2d170b['count'],_0x14b0b8=_0x366dba[_0x3a52('0x2e')],_0x2dcdf6=_0x366dba['offset']+_0x366dba['limit'],_0x2b2fcc;if(_0x2dcdf6>=_0x315d24){_0x2dcdf6=_0x315d24;_0x2b2fcc=0xc8;}else{_0x2b2fcc=0xce;}_0x1e42f6[_0x3a52('0x2f')](_0x2b2fcc);return _0x1e42f6[_0x3a52('0x30')](_0x3a52('0x31'),_0x14b0b8+'-'+_0x2dcdf6+'/'+_0x315d24)['json'](_0x2d170b);}return null;};}function patchUpdates(_0x8dc174){return function(_0x49732f){try{jsonpatch['apply'](_0x49732f,_0x8dc174,!![]);}catch(_0xcfb6bc){return BPromise['reject'](_0xcfb6bc);}return _0x49732f['save']();};}function saveUpdates(_0x4c4f67,_0x54baff){return function(_0x58498c){if(_0x58498c){return _0x58498c[_0x3a52('0x32')](_0x4c4f67)[_0x3a52('0x33')](function(_0x43d543){return _0x43d543;});}return null;};}function removeEntity(_0x3efbbd,_0x14ae64){return function(_0x1dee80){if(_0x1dee80){return _0x1dee80[_0x3a52('0x34')]()['then'](function(){_0x3efbbd[_0x3a52('0x2f')](0xcc)[_0x3a52('0x35')]();});}};}function handleEntityNotFound(_0x374193,_0x19438c){return function(_0x4e5666){if(!_0x4e5666){_0x374193[_0x3a52('0x2c')](0x194);}return _0x4e5666;};}function handleError(_0x1efd58,_0x5c6140){_0x5c6140=_0x5c6140||0x1f4;return function(_0x321eb5){logger[_0x3a52('0x27')](_0x321eb5[_0x3a52('0x36')]);if(_0x321eb5['name']){delete _0x321eb5['name'];}_0x1efd58['status'](_0x5c6140)[_0x3a52('0x37')](_0x321eb5);};}exports[_0x3a52('0x38')]=function(_0x1de402,_0x495e8d){var _0x26dc3f={},_0x1806a6={},_0x5e0bf6={'count':0x0,'rows':[]};var _0x25c277=db[_0x3a52('0x39')][_0x3a52('0x3a')];_0x1806a6['model']=_[_0x3a52('0x3b')](_0x25c277);_0x1806a6[_0x3a52('0x3c')]=_['keys'](_0x1de402[_0x3a52('0x3c')]);_0x1806a6['filters']=_['intersection'](_0x1806a6[_0x3a52('0x3d')],_0x1806a6[_0x3a52('0x3c')]);_0x26dc3f[_0x3a52('0x3e')]=_[_0x3a52('0x3f')](_0x1806a6[_0x3a52('0x3d')],qs[_0x3a52('0x40')](_0x1de402[_0x3a52('0x3c')][_0x3a52('0x40')]));_0x26dc3f[_0x3a52('0x3e')]=_0x26dc3f[_0x3a52('0x3e')][_0x3a52('0x41')]?_0x26dc3f[_0x3a52('0x3e')]:_0x1806a6[_0x3a52('0x3d')];if(!_0x1de402[_0x3a52('0x3c')][_0x3a52('0x42')]('nolimit')){_0x26dc3f['limit']=qs[_0x3a52('0x43')](_0x1de402[_0x3a52('0x3c')]['limit']);_0x26dc3f[_0x3a52('0x2e')]=qs[_0x3a52('0x2e')](_0x1de402['query'][_0x3a52('0x2e')]);}_0x26dc3f[_0x3a52('0x44')]=qs[_0x3a52('0x45')](_0x1de402[_0x3a52('0x3c')]['sort']);_0x26dc3f['where']=qs['filters'](_[_0x3a52('0x46')](_0x1de402[_0x3a52('0x3c')],_0x1806a6[_0x3a52('0x47')]));if(_0x1de402[_0x3a52('0x3c')][_0x3a52('0x48')]){_0x26dc3f[_0x3a52('0x49')]=_[_0x3a52('0x4a')](_0x26dc3f[_0x3a52('0x49')],{'$or':_[_0x3a52('0x4b')](_0x25c277,function(_0x40e10b){if(_0x40e10b['type'][_0x3a52('0x4c')]!==_0x3a52('0x4d')){var _0x517ff6={};_0x517ff6[_0x40e10b[_0x3a52('0x4e')]]={'$like':'%'+_0x1de402[_0x3a52('0x3c')][_0x3a52('0x48')]+'%'};return _0x517ff6;}})});}_0x26dc3f=_[_0x3a52('0x4a')]({},_0x26dc3f,_0x1de402[_0x3a52('0x4f')]);var _0xbd835e={'where':_0x26dc3f['where']};return db[_0x3a52('0x39')][_0x3a52('0x50')](_0xbd835e)[_0x3a52('0x33')](function(_0x87db46){_0x5e0bf6['count']=_0x87db46;if(_0x1de402[_0x3a52('0x3c')][_0x3a52('0x51')]){_0x26dc3f[_0x3a52('0x52')]=[{'all':!![]}];}return db['MailMessage'][_0x3a52('0x53')](_0x26dc3f);})[_0x3a52('0x33')](function(_0xe1a50b){_0x5e0bf6[_0x3a52('0x54')]=_0xe1a50b;return _0x5e0bf6;})[_0x3a52('0x33')](respondWithFilteredResult(_0x495e8d,_0x26dc3f))['catch'](handleError(_0x495e8d,null));};exports[_0x3a52('0x55')]=function(_0x515d6c,_0x548839){var _0x2965c7={'raw':!![],'where':{'id':_0x515d6c['params']['id']}},_0x1e7fde={};_0x1e7fde[_0x3a52('0x3d')]=_[_0x3a52('0x3b')](db[_0x3a52('0x39')]['rawAttributes']);_0x1e7fde[_0x3a52('0x3c')]=_['keys'](_0x515d6c[_0x3a52('0x3c')]);_0x1e7fde[_0x3a52('0x47')]=_[_0x3a52('0x3f')](_0x1e7fde['model'],_0x1e7fde[_0x3a52('0x3c')]);_0x2965c7[_0x3a52('0x3e')]=_['intersection'](_0x1e7fde[_0x3a52('0x3d')],qs[_0x3a52('0x40')](_0x515d6c['query'][_0x3a52('0x40')]));_0x2965c7[_0x3a52('0x3e')]=_0x2965c7['attributes']['length']?_0x2965c7['attributes']:_0x1e7fde[_0x3a52('0x3d')];if(_0x515d6c['query'][_0x3a52('0x51')]){_0x2965c7[_0x3a52('0x52')]=[{'all':!![]}];}_0x2965c7=_[_0x3a52('0x4a')]({},_0x2965c7,_0x515d6c[_0x3a52('0x4f')]);return db[_0x3a52('0x39')]['find'](_0x2965c7)['then'](handleEntityNotFound(_0x548839,null))['then'](respondWithResult(_0x548839,null))[_0x3a52('0x2b')](handleError(_0x548839,null));};exports[_0x3a52('0x32')]=function(_0x2d37fb,_0x2161b6){if(_0x2d37fb[_0x3a52('0x56')]['id']){delete _0x2d37fb[_0x3a52('0x56')]['id'];}return db['MailMessage'][_0x3a52('0x57')]({'where':{'id':_0x2d37fb[_0x3a52('0x58')]['id']}})[_0x3a52('0x33')](handleEntityNotFound(_0x2161b6,null))[_0x3a52('0x33')](saveUpdates(_0x2d37fb[_0x3a52('0x56')],null))['then'](respondWithResult(_0x2161b6,null))[_0x3a52('0x2b')](handleError(_0x2161b6,null));};exports[_0x3a52('0x34')]=function(_0x4cd687,_0x35d73a){return db[_0x3a52('0x39')][_0x3a52('0x57')]({'where':{'id':_0x4cd687[_0x3a52('0x58')]['id']}})['then'](handleEntityNotFound(_0x35d73a,null))[_0x3a52('0x33')](removeEntity(_0x35d73a,null))[_0x3a52('0x2b')](handleError(_0x35d73a,null));};exports[_0x3a52('0x59')]=function(_0x1113ee,_0x484312){return db['MailMessage'][_0x3a52('0x59')]()[_0x3a52('0x33')](respondWithResult(_0x484312,null))['catch'](handleError(_0x484312,null));};exports[_0x3a52('0x5a')]=function(_0x23e2ee,_0x182e34){return db[_0x3a52('0x39')][_0x3a52('0x5a')](_0x23e2ee[_0x3a52('0x56')])['then'](function(_0x1433e9){if(_0x1433e9){if(_0x1433e9[_0x3a52('0x5b')]===_0x3a52('0x5c')&&!_0x1433e9['secret']){return db[_0x3a52('0x5d')][_0x3a52('0x5e')]({'where':{'id':_0x1433e9[_0x3a52('0x5f')]},'include':[{'model':db['MailServerOut'],'as':_0x3a52('0x60'),'raw':!![]}]})[_0x3a52('0x33')](function(_0xc5b796){if(_0xc5b796&&_0xc5b796[_0x3a52('0x60')]){var _0x32dfac={'tls':{'rejectUnauthorized':![]}};if(_[_0x3a52('0x61')](_0xc5b796['Smtp'][_0x3a52('0x62')])){_0x32dfac[_0x3a52('0x63')]=_0xc5b796[_0x3a52('0x60')]['host'];_0x32dfac[_0x3a52('0x64')]=_0xc5b796[_0x3a52('0x60')]['port'];_0x32dfac[_0x3a52('0x65')]=_0xc5b796['Smtp'][_0x3a52('0x65')];if(_0xc5b796['Smtp']['authentication']){_0x32dfac[_0x3a52('0x66')]={'user':_0xc5b796[_0x3a52('0x60')][_0x3a52('0x67')],'pass':_0xc5b796[_0x3a52('0x60')][_0x3a52('0x68')]};}}else{_0x32dfac[_0x3a52('0x62')]=_0xc5b796[_0x3a52('0x60')][_0x3a52('0x62')];_0x32dfac[_0x3a52('0x66')]={'user':_0xc5b796['Smtp'][_0x3a52('0x67')],'pass':_0xc5b796[_0x3a52('0x60')][_0x3a52('0x68')]};_0x32dfac[_0x3a52('0x65')]=_0xc5b796['Smtp'][_0x3a52('0x65')];}if(_0x23e2ee[_0x3a52('0x56')][_0x3a52('0x69')]&&_0x23e2ee['body'][_0x3a52('0x69')][_0x3a52('0x41')]){for(var _0x5de28a=0x0;_0x5de28a<_0x23e2ee[_0x3a52('0x56')][_0x3a52('0x69')][_0x3a52('0x41')];_0x5de28a+=0x1){_0x23e2ee[_0x3a52('0x56')][_0x3a52('0x69')][_0x5de28a]={'filename':_0x23e2ee[_0x3a52('0x56')][_0x3a52('0x69')][_0x5de28a]['name'],'path':path[_0x3a52('0x6a')](config[_0x3a52('0x6b')],_0x3a52('0x6c'),_0x23e2ee[_0x3a52('0x56')][_0x3a52('0x69')][_0x5de28a][_0x3a52('0x6d')])};}}return{'account':_0x32dfac,'message':_0x23e2ee[_0x3a52('0x56')]};}})[_0x3a52('0x33')](function(_0x2e0b96){if(_0x2e0b96){return respondWithRpcPromise(_0x3a52('0x6e'),_0x3a52('0x6f'),_0x2e0b96,client9003)['then'](function(_0x373833){return _0x1433e9['update']({'read':!![],'messageId':_0x373833['messageId'],'sentAt':moment()[_0x3a52('0x70')](_0x3a52('0x71'))});})[_0x3a52('0x2b')](function(_0x2631cd){logger['error']('%s',JSON['stringify'](_0x2631cd));return _0x1433e9;});}return _0x1433e9;});}return _0x1433e9;}})[_0x3a52('0x33')](respondWithResult(_0x182e34,0xc9))[_0x3a52('0x2b')](handleError(_0x182e34,null));};var interaction_log=require(_0x3a52('0x16'))('mail-interactions');exports[_0x3a52('0x72')]=function(_0x3b6111,_0x43b8b3,_0x11a569){var _0x565919={'channel':_0x3a52('0x73')};if(_0x3b6111[_0x3a52('0x56')]['id']){delete _0x3b6111[_0x3a52('0x56')]['id'];}_0x3b6111[_0x3a52('0x56')][_0x3a52('0x74')]=!![];_0x3b6111[_0x3a52('0x56')]['readAt']=moment()['format'](_0x3a52('0x71'));_0x3b6111[_0x3a52('0x56')][_0x3a52('0x75')]=_0x3b6111[_0x3a52('0x56')][_0x3a52('0x75')]||_0x3b6111[_0x3a52('0x67')]['id'];return db[_0x3a52('0x39')]['find']({'where':{'id':_0x3b6111[_0x3a52('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x3a52('0x76')],'as':_0x3a52('0x77')}]})['then'](handleEntityNotFound(_0x43b8b3,null))['then'](saveUpdates(_0x3b6111[_0x3a52('0x56')],null))['then'](function(_0x488dcc){if(_0x488dcc){_0x565919['message']=_0x488dcc[_0x3a52('0x78')]({'plain':!![]});return db[_0x3a52('0x79')][_0x3a52('0x57')]({'where':{'id':_0x488dcc[_0x3a52('0x7a')]}});}return null;})[_0x3a52('0x33')](handleEntityNotFound(_0x43b8b3,null))['then'](function(_0x3b2da0){if(_0x3b2da0){return _0x3b2da0[_0x3a52('0x32')]({'UserId':_0x3b6111[_0x3a52('0x56')]['UserId'],'read1stAt':_[_0x3a52('0x61')](_0x3b2da0['read1stAt'])?moment()[_0x3a52('0x70')](_0x3a52('0x71')):undefined});}return null;})[_0x3a52('0x33')](function(_0x25a5a5){if(_0x25a5a5){_0x565919[_0x3a52('0x7b')]=_0x25a5a5['get']({'plain':!![]});interaction_log['info'](_0x3a52('0x7c'),_0x3b6111[_0x3a52('0x67')]['id'],_0x3b6111[_0x3a52('0x67')][_0x3a52('0x7d')],_0x3b6111['user']['role'],_0x565919[_0x3a52('0x7b')]['id'],_0x3b6111['body']?JSON[_0x3a52('0x26')](_0x3b6111[_0x3a52('0x56')]):_0x3a52('0x7e'));return respondWithRpcPromise(_0x3a52('0x7f'),'acceptMessage',_0x565919);}return null;})[_0x3a52('0x33')](function(_0x435c58){if(_0x435c58){if(_0x3b6111[_0x3a52('0x56')][_0x3a52('0x80')]){_0x565919[_0x3a52('0x29')][_0x3a52('0x81')]=util[_0x3a52('0x70')](_0x3a52('0x82'),_0x3b6111[_0x3a52('0x67')][_0x3a52('0x7d')]);_0x565919[_0x3a52('0x29')][_0x3a52('0x83')]=_0x565919[_0x3a52('0x83')];_0x565919[_0x3a52('0x29')][_0x3a52('0x84')]='accept';return respondWithRpcPromise(_0x3a52('0x85'),'EventManager',{'event':'acceptmessage','message':_0x565919['message']},client9002)[_0x3a52('0x33')](function(){return _0x565919;});}return _0x565919;}return null;})[_0x3a52('0x33')](respondWithResult(_0x43b8b3,null))[_0x3a52('0x2b')](handleError(_0x43b8b3,null));};var interaction_log=require('../../config/logger')(_0x3a52('0x86'));exports[_0x3a52('0x87')]=function(_0x48ca02,_0xa06c3c,_0x398c00){var _0xe74dd7={'agent':{},'channel':_0x3a52('0x73')};if(_0x48ca02[_0x3a52('0x56')]['id']){delete _0x48ca02['body']['id'];}_0x48ca02[_0x3a52('0x56')][_0x3a52('0x75')]=_0x48ca02[_0x3a52('0x56')][_0x3a52('0x75')]||_0x48ca02[_0x3a52('0x67')]['id'];_0xe74dd7[_0x3a52('0x88')]['id']=_0x48ca02['body']['UserId'];return db['MailMessage']['find']({'where':{'id':_0x48ca02[_0x3a52('0x58')]['id'],'UserId':null}})[_0x3a52('0x33')](handleEntityNotFound(_0xa06c3c,null))[_0x3a52('0x33')](function(_0x336c1f){if(_0x336c1f){_0xe74dd7['message']=_0x336c1f[_0x3a52('0x78')]({'plain':!![]});return db['MailInteraction'][_0x3a52('0x57')]({'where':{'id':_0x336c1f[_0x3a52('0x7a')]}});}return null;})[_0x3a52('0x33')](handleEntityNotFound(_0xa06c3c,null))[_0x3a52('0x33')](function(_0x1b32c7){if(_0x1b32c7){_0xe74dd7[_0x3a52('0x7b')]=_0x1b32c7[_0x3a52('0x78')]({'plain':!![]});interaction_log[_0x3a52('0x21')](_0x3a52('0x89'),_0x48ca02[_0x3a52('0x67')]['id'],_0x48ca02['user'][_0x3a52('0x7d')],_0x48ca02[_0x3a52('0x67')][_0x3a52('0x8a')],_0xe74dd7[_0x3a52('0x7b')]['id'],_0x48ca02[_0x3a52('0x56')]?JSON[_0x3a52('0x26')](_0x48ca02['body']):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0xe74dd7);}return null;})[_0x3a52('0x33')](function(_0x49652d){if(_0x49652d){_0x49652d[_0x3a52('0x29')]['interface']=util[_0x3a52('0x70')](_0x3a52('0x82'),_0x48ca02[_0x3a52('0x67')][_0x3a52('0x7d')]);_0x49652d['message'][_0x3a52('0x83')]=_0xe74dd7[_0x3a52('0x83')];_0x49652d['message'][_0x3a52('0x84')]=_0x3a52('0x87');respondWithRpcPromise(_0x3a52('0x85'),_0x3a52('0x85'),{'event':_0x3a52('0x8b'),'message':_0x49652d[_0x3a52('0x29')]},client9002);return _0xe74dd7;}return null;})[_0x3a52('0x33')](respondWithResult(_0xa06c3c,null))[_0x3a52('0x2b')](handleError(_0xa06c3c,null));};exports['download']=function(_0x32e702,_0x5853da){var _0x182c0d=moment()[_0x3a52('0x8c')]()[_0x3a52('0x8d')]();var _0x133f3e=path['join'](config[_0x3a52('0x6b')],_0x3a52('0x8e'),_0x3a52('0x8f'),_0x3a52('0x90'));var _0x3c5e85=path[_0x3a52('0x6a')](config[_0x3a52('0x6b')],_0x3a52('0x8e'),_0x3a52('0x8f'),_0x3a52('0x69'));var _0x11fd06=util[_0x3a52('0x70')](_0x3a52('0x91'),_0x182c0d);return db['MailMessage']['find']({'where':{'id':_0x32e702[_0x3a52('0x58')]['id']},'attributes':['id',_0x3a52('0x56'),_0x3a52('0x92'),'to','cc',_0x3a52('0x93'),'createdAt'],'include':_0x32e702[_0x3a52('0x3c')][_0x3a52('0x69')]?[{'model':db[_0x3a52('0x94')],'as':_0x3a52('0x95')}]:undefined})[_0x3a52('0x33')](handleEntityNotFound(_0x5853da,null))[_0x3a52('0x33')](function(_0xce3412){if(_0xce3412){var _0x403b53=_0xce3412;var _0x49a51d={'from':_0x403b53[_0x3a52('0x92')],'to':_0x403b53['to'],'subject':_0x403b53['subject'],'html':_0x403b53['body'],'attachments':[]};return new BPromise(function(_0x5e09a6,_0x45bbd1){if(_0xce3412[_0x3a52('0x95')]){for(var _0x41266d=0x0;_0x41266d<_0xce3412['Attachments'][_0x3a52('0x41')];_0x41266d++){var _0x4b6644=_0xce3412[_0x3a52('0x95')][_0x41266d];var _0xf53f4e=path[_0x3a52('0x6a')](_0x3c5e85,_0x4b6644[_0x3a52('0x6d')]);if(fs[_0x3a52('0x96')](_0xf53f4e)){_0x49a51d[_0x3a52('0x69')][_0x3a52('0x97')]({'name':_0x4b6644['name'],'contentType':_0x4b6644[_0x3a52('0x98')],'data':fs['readFileSync'](_0xf53f4e)});}}}emlformat[_0x3a52('0x99')](_0x49a51d,function(_0x45139f,_0x42eb6d){if(_0x45139f)return _0x45bbd1(_0x45139f);fs[_0x3a52('0x9a')](path['join'](_0x133f3e,_0x11fd06),_0x42eb6d);return _0x5e09a6(_0x42eb6d);});});}})[_0x3a52('0x33')](function(_0x47d06e){if(_0x47d06e){return _0x5853da[_0x3a52('0x9b')](path[_0x3a52('0x6a')](_0x133f3e,_0x11fd06),_0x11fd06,function(_0xc2f4dd){if(_0xc2f4dd){console['log'](_0x3a52('0x9c'),_0xc2f4dd);}else{fs[_0x3a52('0x9d')](path['join'](_0x133f3e,_0x11fd06));}});}})[_0x3a52('0x2b')](handleError(_0x5853da,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index ff5f25f..ff8ed0e 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 _0x4a25=['remove','emit','hasOwnProperty','exports','events','MailMessage','save','update'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x4a25,0x1d4));var _0x54a2=function(_0x456a4b,_0x51df8){_0x456a4b=_0x456a4b-0x0;var _0x42957c=_0x4a25[_0x456a4b];return _0x42957c;};'use strict';var EventEmitter=require(_0x54a2('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x54a2('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x54a2('0x2'),'afterUpdate':_0x54a2('0x3'),'afterDestroy':_0x54a2('0x4')};function emitEvent(_0x3e5d5b){return function(_0x5c6c1f,_0x3031e9,_0x15f81b){MailMessageEvents[_0x54a2('0x5')](_0x3e5d5b+':'+_0x5c6c1f['id'],_0x5c6c1f);MailMessageEvents[_0x54a2('0x5')](_0x3e5d5b,_0x5c6c1f);_0x15f81b(null);};}for(var e in events){if(events[_0x54a2('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x54a2('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x6334=['hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','emit'];(function(_0x4c96ae,_0x45faaf){var _0x259063=function(_0x19a442){while(--_0x19a442){_0x4c96ae['push'](_0x4c96ae['shift']());}};_0x259063(++_0x45faaf);}(_0x6334,0x119));var _0x4633=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x6334[_0x2d61b2];return _0x12df89;};'use strict';var EventEmitter=require(_0x4633('0x0'));var MailMessage=require(_0x4633('0x1'))['db'][_0x4633('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x4633('0x3')](0x0);var events={'afterCreate':_0x4633('0x4'),'afterUpdate':_0x4633('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1099be){return function(_0x205442,_0x2a2b3c,_0x3572d1){MailMessageEvents[_0x4633('0x6')](_0x1099be+':'+_0x205442['id'],_0x205442);MailMessageEvents[_0x4633('0x6')](_0x1099be,_0x205442);_0x3572d1(null);};}for(var e in events){if(events[_0x4633('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x4633('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 96c9f3f..89e4766 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 _0xffaf=['define','messageId','utf8mb4_unicode_ci','../../config/logger','api','request-promise','./mailMessage.attributes','exports'];(function(_0x408d22,_0x53eef9){var _0x58effd=function(_0x4ab8ee){while(--_0x4ab8ee){_0x408d22['push'](_0x408d22['shift']());}};_0x58effd(++_0x53eef9);}(_0xffaf,0x1c3));var _0xfffa=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xffaf[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfffa('0x0'))(_0xfffa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfffa('0x2'));var attributes=require(_0xfffa('0x3'));module[_0xfffa('0x4')]=function(_0x576b08,_0x5dc4be){return _0x576b08[_0xfffa('0x5')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xfffa('0x6'),'fields':[_0xfffa('0x6')]}],'timestamps':!![],'charset':'utf8mb4','collate':_0xfffa('0x7')});}; \ No newline at end of file +var _0x0c11=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0c11,0x179));var _0x10c1=function(_0x456032,_0x1a799d){_0x456032=_0x456032-0x0;var _0x1a53cd=_0x0c11[_0x456032];return _0x1a53cd;};'use strict';var _=require(_0x10c1('0x0'));var util=require(_0x10c1('0x1'));var logger=require(_0x10c1('0x2'))(_0x10c1('0x3'));var moment=require(_0x10c1('0x4'));var BPromise=require(_0x10c1('0x5'));var rp=require(_0x10c1('0x6'));var attributes=require(_0x10c1('0x7'));module[_0x10c1('0x8')]=function(_0x3cf33b,_0x3232e2){return _0x3cf33b[_0x10c1('0x9')](_0x10c1('0xa'),attributes,{'tableName':_0x10c1('0xb'),'paranoid':![],'indexes':[{'name':_0x10c1('0xc'),'fields':[_0x10c1('0xc')]}],'timestamps':!![],'charset':_0x10c1('0xd'),'collate':_0x10c1('0xe')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index d9e4c36..f7e0091 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 _0xa23f=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','then'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa23f,0x7c));var _0xfa23=function(_0x1b00e1,_0x44c085){_0x1b00e1=_0x1b00e1-0x0;var _0x9a0ae5=_0xa23f[_0x1b00e1];return _0x9a0ae5;};'use strict';var _=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfa23('0x2'));var fs=require('fs');var Redis=require(_0xfa23('0x3'));var db=require(_0xfa23('0x4'))['db'];var utils=require(_0xfa23('0x5'));var logger=require('../../config/logger')(_0xfa23('0x6'));var config=require('../../config/environment');var jayson=require(_0xfa23('0x7'));var client=jayson[_0xfa23('0x8')][_0xfa23('0x9')]({'port':0x232a});config[_0xfa23('0xa')]=_['defaults'](config[_0xfa23('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa23('0xb'))(new Redis(config[_0xfa23('0xa')]));require(_0xfa23('0xc'))[_0xfa23('0xd')](socket);function respondWithRpcPromise(_0x798943,_0x539453,_0x4b59d1){return new BPromise(function(_0x20a9b6,_0x4ea7a8){return client[_0xfa23('0xe')](_0x798943,_0x4b59d1)['then'](function(_0x1b99b7){logger[_0xfa23('0xf')](_0xfa23('0x10'),_0x539453,'request\x20sent');logger[_0xfa23('0x11')](_0xfa23('0x12'),_0x539453,_0xfa23('0x13'),JSON['stringify'](_0x1b99b7));if(_0x1b99b7['error']){if(_0x1b99b7[_0xfa23('0x14')][_0xfa23('0x15')]===0x1f4){logger[_0xfa23('0x14')](_0xfa23('0x10'),_0x539453,_0x1b99b7['error'][_0xfa23('0x16')]);return _0x4ea7a8(_0x1b99b7[_0xfa23('0x14')][_0xfa23('0x16')]);}logger[_0xfa23('0x14')]('MailMessage,\x20%s,\x20%s',_0x539453,_0x1b99b7[_0xfa23('0x14')][_0xfa23('0x16')]);return _0x20a9b6(_0x1b99b7[_0xfa23('0x14')][_0xfa23('0x16')]);}else{logger[_0xfa23('0xf')]('MailMessage,\x20%s,\x20%s',_0x539453,'request\x20sent');_0x20a9b6(_0x1b99b7['result'][_0xfa23('0x16')]);}})[_0xfa23('0x17')](function(_0x4bd0e0){logger[_0xfa23('0x14')](_0xfa23('0x10'),_0x539453,_0x4bd0e0);_0x4ea7a8(_0x4bd0e0);});});}exports[_0xfa23('0x18')]=function(_0x54bb04){var _0x1970ec=this;return new Promise(function(_0x452604,_0x47c323){return db[_0xfa23('0x19')][_0xfa23('0x1a')](_0x54bb04[_0xfa23('0x1b')],{'raw':_0x54bb04[_0xfa23('0x1c')]?_0x54bb04[_0xfa23('0x1c')][_0xfa23('0x1d')]===undefined?!![]:![]:!![]})[_0xfa23('0x1e')](function(_0x485838){logger[_0xfa23('0xf')](_0xfa23('0x18'),_0x54bb04);logger[_0xfa23('0x11')](_0xfa23('0x18'),_0x54bb04,JSON['stringify'](_0x485838));_0x452604(_0x485838);})[_0xfa23('0x17')](function(_0x511a93){logger[_0xfa23('0x14')](_0xfa23('0x18'),_0x511a93[_0xfa23('0x16')],_0x54bb04);_0x47c323(_0x1970ec[_0xfa23('0x14')](0x1f4,_0x511a93[_0xfa23('0x16')]));});});}; \ No newline at end of file +var _0x6c32=['CreateMailMessage','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailMessage','create','body'];(function(_0x4f716e,_0x45191f){var _0x486be9=function(_0x4eafd2){while(--_0x4eafd2){_0x4f716e['push'](_0x4f716e['shift']());}};_0x486be9(++_0x45191f);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26c3('0x0'));var util=require('util');var moment=require(_0x26c3('0x1'));var BPromise=require('bluebird');var rs=require(_0x26c3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26c3('0x3'))['db'];var utils=require(_0x26c3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x26c3('0x5'));var jayson=require(_0x26c3('0x6'));var client=jayson[_0x26c3('0x7')][_0x26c3('0x8')]({'port':0x232a});config[_0x26c3('0x9')]=_[_0x26c3('0xa')](config[_0x26c3('0x9')],{'host':_0x26c3('0xb'),'port':0x18eb});var socket=require(_0x26c3('0xc'))(new Redis(config[_0x26c3('0x9')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3a2f06,_0x5f2097,_0x24de21){return new BPromise(function(_0xc6e3b4,_0x4b7ab2){return client[_0x26c3('0xd')](_0x3a2f06,_0x24de21)[_0x26c3('0xe')](function(_0x431d15){logger[_0x26c3('0xf')](_0x26c3('0x10'),_0x5f2097,'request\x20sent');logger[_0x26c3('0x11')](_0x26c3('0x12'),_0x5f2097,_0x26c3('0x13'),JSON[_0x26c3('0x14')](_0x431d15));if(_0x431d15[_0x26c3('0x15')]){if(_0x431d15[_0x26c3('0x15')][_0x26c3('0x16')]===0x1f4){logger[_0x26c3('0x15')]('MailMessage,\x20%s,\x20%s',_0x5f2097,_0x431d15['error'][_0x26c3('0x17')]);return _0x4b7ab2(_0x431d15[_0x26c3('0x15')][_0x26c3('0x17')]);}logger[_0x26c3('0x15')](_0x26c3('0x10'),_0x5f2097,_0x431d15[_0x26c3('0x15')]['message']);return _0xc6e3b4(_0x431d15[_0x26c3('0x15')][_0x26c3('0x17')]);}else{logger['info'](_0x26c3('0x10'),_0x5f2097,'request\x20sent');_0xc6e3b4(_0x431d15[_0x26c3('0x18')]['message']);}})[_0x26c3('0x19')](function(_0xdd7a33){logger[_0x26c3('0x15')](_0x26c3('0x10'),_0x5f2097,_0xdd7a33);_0x4b7ab2(_0xdd7a33);});});}exports['CreateMailMessage']=function(_0x3ba156){var _0x47bc19=this;return new Promise(function(_0x16441c,_0x48ea4a){return db[_0x26c3('0x1a')][_0x26c3('0x1b')](_0x3ba156[_0x26c3('0x1c')],{'raw':_0x3ba156['options']?_0x3ba156['options']['raw']===undefined?!![]:![]:!![]})[_0x26c3('0xe')](function(_0xba4076){logger[_0x26c3('0xf')](_0x26c3('0x1d'),_0x3ba156);logger[_0x26c3('0x11')]('CreateMailMessage',_0x3ba156,JSON[_0x26c3('0x14')](_0xba4076));_0x16441c(_0xba4076);})['catch'](function(_0x3316a7){logger[_0x26c3('0x15')](_0x26c3('0x1d'),_0x3316a7[_0x26c3('0x17')],_0x3ba156);_0x48ea4a(_0x47bc19[_0x26c3('0x15')](0x1f4,_0x3316a7[_0x26c3('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index a59e7db..f06b211 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 _0xc5b9=['length','mailMessage:','update','emit','removeListener','register'];(function(_0x503203,_0x3864ef){var _0x206651=function(_0x48570f){while(--_0x48570f){_0x503203['push'](_0x503203['shift']());}};_0x206651(++_0x3864ef);}(_0xc5b9,0x16a));var _0x9c5b=function(_0x1c7556,_0x3c6679){_0x1c7556=_0x1c7556-0x0;var _0x514fcd=_0xc5b9[_0x1c7556];return _0x514fcd;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save','remove',_0x9c5b('0x0')];function createListener(_0x3ff8e9,_0x5456f3){return function(_0x433579){_0x5456f3[_0x9c5b('0x1')](_0x3ff8e9,_0x433579);};}function removeListener(_0x1d6ef3,_0x558b78){return function(){MailMessageEvents[_0x9c5b('0x2')](_0x1d6ef3,_0x558b78);};}exports[_0x9c5b('0x3')]=function(_0x472fd1){for(var _0x214fc0=0x0,_0x10e2ba=events[_0x9c5b('0x4')];_0x214fc0<_0x10e2ba;_0x214fc0++){var _0x5e335e=events[_0x214fc0];var _0x4ede6f=createListener(_0x9c5b('0x5')+_0x5e335e,_0x472fd1);MailMessageEvents['on'](_0x5e335e,_0x4ede6f);}}; \ No newline at end of file +var _0xa6a9=['register','length','./mailMessage.events','save','remove','update','emit','removeListener'];(function(_0x38d6e8,_0x21c3b9){var _0x37e27f=function(_0x2e9a3e){while(--_0x2e9a3e){_0x38d6e8['push'](_0x38d6e8['shift']());}};_0x37e27f(++_0x21c3b9);}(_0xa6a9,0x102));var _0x9a6a=function(_0x2e8418,_0x58c529){_0x2e8418=_0x2e8418-0x0;var _0x548fe6=_0xa6a9[_0x2e8418];return _0x548fe6;};'use strict';var MailMessageEvents=require(_0x9a6a('0x0'));var events=[_0x9a6a('0x1'),_0x9a6a('0x2'),_0x9a6a('0x3')];function createListener(_0x14e04b,_0xe8525b){return function(_0x45cb03){_0xe8525b[_0x9a6a('0x4')](_0x14e04b,_0x45cb03);};}function removeListener(_0x582c4f,_0x1c0467){return function(){MailMessageEvents[_0x9a6a('0x5')](_0x582c4f,_0x1c0467);};}exports[_0x9a6a('0x6')]=function(_0x7baaa7){for(var _0x168236=0x0,_0x58a218=events[_0x9a6a('0x7')];_0x168236<_0x58a218;_0x168236++){var _0x43b589=events[_0x168236];var _0x396dcb=createListener('mailMessage:'+_0x43b589,_0x7baaa7);MailMessageEvents['on'](_0x43b589,_0x396dcb);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 64c118e..8993af6 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 _0xc9c9=['describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','post','put','destroy','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc9c9,0x120));var _0x9c9c=function(_0x253141,_0x396c1e){_0x253141=_0x253141-0x0;var _0x4472f3=_0xc9c9[_0x253141];return _0x4472f3;};'use strict';var multer=require(_0x9c9c('0x0'));var util=require(_0x9c9c('0x1'));var path=require(_0x9c9c('0x2'));var timeout=require(_0x9c9c('0x3'));var express=require(_0x9c9c('0x4'));var router=express[_0x9c9c('0x5')]();var auth=require(_0x9c9c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9c9c('0x7'));var controller=require(_0x9c9c('0x8'));router[_0x9c9c('0x9')]('/',auth[_0x9c9c('0xa')](),controller['index']);router[_0x9c9c('0x9')](_0x9c9c('0xb'),auth[_0x9c9c('0xa')](),controller[_0x9c9c('0xc')]);router[_0x9c9c('0x9')](_0x9c9c('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9c9c('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0x9c9c('0xe')]);router[_0x9c9c('0x9')](_0x9c9c('0xf'),auth['isAuthenticated'](),controller[_0x9c9c('0x10')]);router[_0x9c9c('0x9')](_0x9c9c('0x11'),auth['isAuthenticated'](),controller[_0x9c9c('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9c9c('0x13')]);router['post']('/:id/teams',auth[_0x9c9c('0xa')](),controller[_0x9c9c('0x14')]);router[_0x9c9c('0x15')](_0x9c9c('0x11'),auth['isAuthenticated'](),controller['addAgents']);router[_0x9c9c('0x16')]('/:id',auth[_0x9c9c('0xa')](),controller['update']);router['delete'](_0x9c9c('0xd'),auth[_0x9c9c('0xa')](),controller[_0x9c9c('0x17')]);router[_0x9c9c('0x18')](_0x9c9c('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x9c9c('0x18')]('/:id/users',auth[_0x9c9c('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x601b=['delete','destroy','/:id/teams','removeAgents','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getAgents','create','addTeams','/:id/users','addAgents','put','update'];(function(_0x140d25,_0x50a0d4){var _0x5985e7=function(_0x4f60f3){while(--_0x4f60f3){_0x140d25['push'](_0x140d25['shift']());}};_0x5985e7(++_0x50a0d4);}(_0x601b,0xb4));var _0xb601=function(_0x7854e8,_0x2c4428){_0x7854e8=_0x7854e8-0x0;var _0x53473a=_0x601b[_0x7854e8];return _0x53473a;};'use strict';var multer=require(_0xb601('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb601('0x1'));var express=require(_0xb601('0x2'));var router=express[_0xb601('0x3')]();var auth=require(_0xb601('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb601('0x5'));var controller=require('./mailQueue.controller');router[_0xb601('0x6')]('/',auth[_0xb601('0x7')](),controller[_0xb601('0x8')]);router[_0xb601('0x6')](_0xb601('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xb601('0xa'),auth[_0xb601('0x7')](),controller[_0xb601('0xb')]);router[_0xb601('0x6')](_0xb601('0xc'),auth[_0xb601('0x7')](),controller['getMembers']);router[_0xb601('0x6')]('/:id/teams',auth[_0xb601('0x7')](),controller['getTeams']);router[_0xb601('0x6')]('/:id/users',auth[_0xb601('0x7')](),controller[_0xb601('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb601('0xe')]);router['post']('/:id/teams',auth[_0xb601('0x7')](),controller[_0xb601('0xf')]);router['post'](_0xb601('0x10'),auth[_0xb601('0x7')](),controller[_0xb601('0x11')]);router[_0xb601('0x12')](_0xb601('0xa'),auth[_0xb601('0x7')](),controller[_0xb601('0x13')]);router[_0xb601('0x14')](_0xb601('0xa'),auth[_0xb601('0x7')](),controller[_0xb601('0x15')]);router['delete'](_0xb601('0x16'),auth[_0xb601('0x7')](),controller['removeTeams']);router[_0xb601('0x14')](_0xb601('0x10'),auth[_0xb601('0x7')](),controller[_0xb601('0x17')]);module[_0xb601('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index ba5434c..16e1a51 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 _0x1c64=['STRING','name','INTEGER','ENUM','beepall','roundrobin','exports'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x1c64,0x1e2));var _0x41c6=function(_0x3dad5,_0x416c24){_0x3dad5=_0x3dad5-0x0;var _0x49bc75=_0x1c64[_0x3dad5];return _0x49bc75;};'use strict';var Sequelize=require('sequelize');module[_0x41c6('0x0')]={'name':{'type':Sequelize[_0x41c6('0x1')],'unique':_0x41c6('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x41c6('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x41c6('0x4')]('rrmemory',_0x41c6('0x5'),_0x41c6('0x6'))}}; \ No newline at end of file +var _0xe0f3=['ENUM','beepall','sequelize','exports','STRING','name'];(function(_0x17e3eb,_0x247074){var _0x51885d=function(_0x214fd0){while(--_0x214fd0){_0x17e3eb['push'](_0x17e3eb['shift']());}};_0x51885d(++_0x247074);}(_0xe0f3,0xf2));var _0x3e0f=function(_0x5be5af,_0x47f09e){_0x5be5af=_0x5be5af-0x0;var _0x854c06=_0xe0f3[_0x5be5af];return _0x854c06;};'use strict';var Sequelize=require(_0x3e0f('0x0'));module[_0x3e0f('0x1')]={'name':{'type':Sequelize[_0x3e0f('0x2')],'unique':_0x3e0f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3e0f('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3e0f('0x4')]('rrmemory',_0x3e0f('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 2836497..c0b8e51 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(_0x3af1ee,_0x2c54b1){var _0x49cbcf=function(_0x4fffa1){while(--_0x4fffa1){_0x3af1ee['push'](_0x3af1ee['shift']());}};_0x49cbcf(++_0x2c54b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x333e56,_0x5ed0d9){var _0x14524c=function(_0x1c2d7d){while(--_0x1c2d7d){_0x333e56['push'](_0x333e56['shift']());}};_0x14524c(++_0x5ed0d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 ea2014d..ebf90dd 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 _0x3488=['hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','save','emit'];(function(_0x2bdf1d,_0x581e34){var _0x5ad854=function(_0xff7d1){while(--_0xff7d1){_0x2bdf1d['push'](_0x2bdf1d['shift']());}};_0x5ad854(++_0x581e34);}(_0x3488,0xab));var _0x8348=function(_0x20cae1,_0x577a10){_0x20cae1=_0x20cae1-0x0;var _0x5ac480=_0x3488[_0x20cae1];return _0x5ac480;};'use strict';var EventEmitter=require(_0x8348('0x0'));var MailQueue=require(_0x8348('0x1'))['db'][_0x8348('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8348('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x369c1f){return function(_0x2a0bff,_0x110b65,_0x4733d1){MailQueueEvents[_0x8348('0x4')](_0x369c1f+':'+_0x2a0bff['id'],_0x2a0bff);MailQueueEvents[_0x8348('0x4')](_0x369c1f,_0x2a0bff);_0x4733d1(null);};}for(var e in events){if(events[_0x8348('0x5')](e)){var event=events[e];MailQueue[_0x8348('0x6')](e,emitEvent(event));}}module[_0x8348('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x6da7=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue','save'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0x6da7,0x18c));var _0x76da=function(_0x49983a,_0x245b5b){_0x49983a=_0x49983a-0x0;var _0x25feb9=_0x6da7[_0x49983a];return _0x25feb9;};'use strict';var EventEmitter=require(_0x76da('0x0'));var MailQueue=require(_0x76da('0x1'))['db'][_0x76da('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x76da('0x3'),'afterUpdate':'update','afterDestroy':_0x76da('0x4')};function emitEvent(_0xdbd62a){return function(_0x45f397,_0x15915f,_0x4949de){MailQueueEvents[_0x76da('0x5')](_0xdbd62a+':'+_0x45f397['id'],_0x45f397);MailQueueEvents[_0x76da('0x5')](_0xdbd62a,_0x45f397);_0x4949de(null);};}for(var e in events){if(events[_0x76da('0x6')](e)){var event=events[e];MailQueue[_0x76da('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 b9d6238..31b82f3 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 _0x7db1=['moment','bluebird','request-promise','./mailQueue.attributes','exports','define','mail_queues','lodash','util','api'];(function(_0x5c152b,_0x1f47c9){var _0x5efd21=function(_0x4a7cdb){while(--_0x4a7cdb){_0x5c152b['push'](_0x5c152b['shift']());}};_0x5efd21(++_0x1f47c9);}(_0x7db1,0x151));var _0x17db=function(_0x350465,_0x18ed5d){_0x350465=_0x350465-0x0;var _0x4ae53d=_0x7db1[_0x350465];return _0x4ae53d;};'use strict';var _=require(_0x17db('0x0'));var util=require(_0x17db('0x1'));var logger=require('../../config/logger')(_0x17db('0x2'));var moment=require(_0x17db('0x3'));var BPromise=require(_0x17db('0x4'));var rp=require(_0x17db('0x5'));var attributes=require(_0x17db('0x6'));module[_0x17db('0x7')]=function(_0x150006,_0x11f2fc){return _0x150006[_0x17db('0x8')]('MailQueue',attributes,{'tableName':_0x17db('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1339=['request-promise','./mailQueue.attributes','exports','define','../../config/logger','api','moment','bluebird'];(function(_0x168794,_0x2abf4a){var _0x5451d7=function(_0x346be9){while(--_0x346be9){_0x168794['push'](_0x168794['shift']());}};_0x5451d7(++_0x2abf4a);}(_0x1339,0x1c4));var _0x9133=function(_0x4ce35b,_0x2526f3){_0x4ce35b=_0x4ce35b-0x0;var _0x46e4d8=_0x1339[_0x4ce35b];return _0x46e4d8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var attributes=require(_0x9133('0x5'));module[_0x9133('0x6')]=function(_0x1f0e59,_0x701d49){return _0x1f0e59[_0x9133('0x7')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 151487d..ee1558a 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 _0x383c=['error','code','MailQueue,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','info','GetMailQueue','stringify','ShowMailQueue','MailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0x383c,0x1cd));var _0xc383=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x383c[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xc383('0x0'));var util=require(_0xc383('0x1'));var moment=require(_0xc383('0x2'));var BPromise=require(_0xc383('0x3'));var rs=require(_0xc383('0x4'));var fs=require('fs');var Redis=require(_0xc383('0x5'));var db=require(_0xc383('0x6'))['db'];var utils=require(_0xc383('0x7'));var logger=require(_0xc383('0x8'))(_0xc383('0x9'));var config=require(_0xc383('0xa'));var jayson=require(_0xc383('0xb'));var client=jayson[_0xc383('0xc')][_0xc383('0xd')]({'port':0x232a});config[_0xc383('0xe')]=_[_0xc383('0xf')](config[_0xc383('0xe')],{'host':_0xc383('0x10'),'port':0x18eb});var socket=require(_0xc383('0x11'))(new Redis(config['redis']));require(_0xc383('0x12'))[_0xc383('0x13')](socket);function respondWithRpcPromise(_0xafb2d4,_0x385fd5,_0x5e425b){return new BPromise(function(_0xbc4fac,_0x2f456d){return client['request'](_0xafb2d4,_0x5e425b)['then'](function(_0xbaca8a){logger['info']('MailQueue,\x20%s,\x20%s',_0x385fd5,_0xc383('0x14'));logger[_0xc383('0x15')](_0xc383('0x16'),_0x385fd5,_0xc383('0x14'),JSON['stringify'](_0xbaca8a));if(_0xbaca8a[_0xc383('0x17')]){if(_0xbaca8a[_0xc383('0x17')][_0xc383('0x18')]===0x1f4){logger[_0xc383('0x17')](_0xc383('0x19'),_0x385fd5,_0xbaca8a[_0xc383('0x17')][_0xc383('0x1a')]);return _0x2f456d(_0xbaca8a['error'][_0xc383('0x1a')]);}logger['error'](_0xc383('0x19'),_0x385fd5,_0xbaca8a[_0xc383('0x17')][_0xc383('0x1a')]);return _0xbc4fac(_0xbaca8a[_0xc383('0x17')][_0xc383('0x1a')]);}else{logger['info'](_0xc383('0x19'),_0x385fd5,_0xc383('0x14'));_0xbc4fac(_0xbaca8a[_0xc383('0x1b')][_0xc383('0x1a')]);}})[_0xc383('0x1c')](function(_0x38484f){logger['error']('MailQueue,\x20%s,\x20%s',_0x385fd5,_0x38484f);_0x2f456d(_0x38484f);});});}exports['GetMailQueue']=function(_0x115be5){var _0x567257=this;return new Promise(function(_0x141490,_0x568ca3){return db['MailQueue'][_0xc383('0x1d')]({'raw':_0x115be5[_0xc383('0x1e')]?_0x115be5[_0xc383('0x1e')][_0xc383('0x1f')]===undefined?!![]:![]:!![],'where':_0x115be5[_0xc383('0x1e')]?_0x115be5[_0xc383('0x1e')][_0xc383('0x20')]||null:null,'attributes':_0x115be5[_0xc383('0x1e')]?_0x115be5[_0xc383('0x1e')][_0xc383('0x21')]||null:null,'limit':_0x115be5[_0xc383('0x1e')]?_0x115be5[_0xc383('0x1e')][_0xc383('0x22')]||null:null,'include':_0x115be5[_0xc383('0x1e')]?_0x115be5[_0xc383('0x1e')][_0xc383('0x23')]?_[_0xc383('0x24')](_0x115be5[_0xc383('0x1e')][_0xc383('0x23')],function(_0x28aeac){return{'model':db[_0x28aeac[_0xc383('0x25')]],'as':_0x28aeac['as'],'attributes':_0x28aeac[_0xc383('0x21')],'include':_0x28aeac['include']?_[_0xc383('0x24')](_0x28aeac[_0xc383('0x23')],function(_0x31966d){return{'model':db[_0x31966d[_0xc383('0x25')]],'as':_0x31966d['as'],'attributes':_0x31966d[_0xc383('0x21')],'include':_0x31966d['include']?_[_0xc383('0x24')](_0x31966d[_0xc383('0x23')],function(_0x2c7517){return{'model':db[_0x2c7517[_0xc383('0x25')]],'as':_0x2c7517['as'],'attributes':_0x2c7517[_0xc383('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc383('0x26')](function(_0x1e5cfb){logger[_0xc383('0x27')](_0xc383('0x28'),_0x115be5);logger[_0xc383('0x15')](_0xc383('0x28'),_0x115be5,JSON[_0xc383('0x29')](_0x1e5cfb));_0x141490(_0x1e5cfb);})[_0xc383('0x1c')](function(_0x1d84f3){logger[_0xc383('0x17')]('GetMailQueue',_0x1d84f3[_0xc383('0x1a')],_0x115be5);_0x568ca3(_0x567257['error'](0x1f4,_0x1d84f3[_0xc383('0x1a')]));});});};exports[_0xc383('0x2a')]=function(_0x39cbc3){var _0x1c2489=this;return new Promise(function(_0xa2e801,_0x5775c5){return db[_0xc383('0x2b')]['find']({'raw':_0x39cbc3[_0xc383('0x1e')]?_0x39cbc3[_0xc383('0x1e')][_0xc383('0x1f')]===undefined?!![]:![]:!![],'where':_0x39cbc3[_0xc383('0x1e')]?_0x39cbc3[_0xc383('0x1e')][_0xc383('0x20')]||null:null,'attributes':_0x39cbc3[_0xc383('0x1e')]?_0x39cbc3['options'][_0xc383('0x21')]||null:null,'include':_0x39cbc3[_0xc383('0x1e')]?_0x39cbc3[_0xc383('0x1e')][_0xc383('0x23')]?_[_0xc383('0x24')](_0x39cbc3['options'][_0xc383('0x23')],function(_0x530959){return{'model':db[_0x530959[_0xc383('0x25')]],'as':_0x530959['as'],'attributes':_0x530959['attributes'],'include':_0x530959[_0xc383('0x23')]?_[_0xc383('0x24')](_0x530959[_0xc383('0x23')],function(_0x307ae3){return{'model':db[_0x307ae3[_0xc383('0x25')]],'as':_0x307ae3['as'],'attributes':_0x307ae3[_0xc383('0x21')],'include':_0x307ae3['include']?_[_0xc383('0x24')](_0x307ae3[_0xc383('0x23')],function(_0x9b4a03){return{'model':db[_0x9b4a03[_0xc383('0x25')]],'as':_0x9b4a03['as'],'attributes':_0x9b4a03[_0xc383('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc383('0x26')](function(_0x5211e0){logger['info']('ShowMailQueue',_0x39cbc3);logger[_0xc383('0x15')](_0xc383('0x2a'),_0x39cbc3,JSON[_0xc383('0x29')](_0x5211e0));_0xa2e801(_0x5211e0);})[_0xc383('0x1c')](function(_0xe62651){logger['error'](_0xc383('0x2a'),_0xe62651[_0xc383('0x1a')],_0x39cbc3);_0x5775c5(_0x1c2489[_0xc383('0x17')](0x1f4,_0xe62651[_0xc383('0x1a')]));});});}; \ No newline at end of file +var _0xe243=['../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetMailQueue','findAll','options','raw','where','include','map','model','attributes','then','ShowMailQueue','MailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x24e674,_0x25eafd){var _0x23801f=function(_0xcc6621){while(--_0xcc6621){_0x24e674['push'](_0x24e674['shift']());}};_0x23801f(++_0x25eafd);}(_0xe243,0x14f));var _0x3e24=function(_0x23d2a0,_0x516174){_0x23d2a0=_0x23d2a0-0x0;var _0x409e80=_0xe243[_0x23d2a0];return _0x409e80;};'use strict';var _=require(_0x3e24('0x0'));var util=require(_0x3e24('0x1'));var moment=require(_0x3e24('0x2'));var BPromise=require(_0x3e24('0x3'));var rs=require(_0x3e24('0x4'));var fs=require('fs');var Redis=require(_0x3e24('0x5'));var db=require(_0x3e24('0x6'))['db'];var utils=require(_0x3e24('0x7'));var logger=require(_0x3e24('0x8'))(_0x3e24('0x9'));var config=require(_0x3e24('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3e24('0xb')],{'host':_0x3e24('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailQueue.socket')[_0x3e24('0xd')](socket);function respondWithRpcPromise(_0x2ddaf1,_0x37e991,_0xc76e8d){return new BPromise(function(_0x466db2,_0x2153fd){return client[_0x3e24('0xe')](_0x2ddaf1,_0xc76e8d)['then'](function(_0x593727){logger['info'](_0x3e24('0xf'),_0x37e991,_0x3e24('0x10'));logger[_0x3e24('0x11')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x37e991,_0x3e24('0x10'),JSON[_0x3e24('0x12')](_0x593727));if(_0x593727[_0x3e24('0x13')]){if(_0x593727['error'][_0x3e24('0x14')]===0x1f4){logger[_0x3e24('0x13')](_0x3e24('0xf'),_0x37e991,_0x593727['error']['message']);return _0x2153fd(_0x593727['error'][_0x3e24('0x15')]);}logger[_0x3e24('0x13')](_0x3e24('0xf'),_0x37e991,_0x593727[_0x3e24('0x13')]['message']);return _0x466db2(_0x593727[_0x3e24('0x13')]['message']);}else{logger[_0x3e24('0x16')]('MailQueue,\x20%s,\x20%s',_0x37e991,_0x3e24('0x10'));_0x466db2(_0x593727[_0x3e24('0x17')][_0x3e24('0x15')]);}})[_0x3e24('0x18')](function(_0x36d0e2){logger[_0x3e24('0x13')](_0x3e24('0xf'),_0x37e991,_0x36d0e2);_0x2153fd(_0x36d0e2);});});}exports[_0x3e24('0x19')]=function(_0x1d32ec){var _0x29806a=this;return new Promise(function(_0x2b5968,_0x41dbc2){return db['MailQueue'][_0x3e24('0x1a')]({'raw':_0x1d32ec[_0x3e24('0x1b')]?_0x1d32ec[_0x3e24('0x1b')][_0x3e24('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d32ec[_0x3e24('0x1b')]?_0x1d32ec[_0x3e24('0x1b')][_0x3e24('0x1d')]||null:null,'attributes':_0x1d32ec[_0x3e24('0x1b')]?_0x1d32ec[_0x3e24('0x1b')]['attributes']||null:null,'limit':_0x1d32ec[_0x3e24('0x1b')]?_0x1d32ec['options']['limit']||null:null,'include':_0x1d32ec['options']?_0x1d32ec['options'][_0x3e24('0x1e')]?_[_0x3e24('0x1f')](_0x1d32ec[_0x3e24('0x1b')][_0x3e24('0x1e')],function(_0x5f2cc0){return{'model':db[_0x5f2cc0[_0x3e24('0x20')]],'as':_0x5f2cc0['as'],'attributes':_0x5f2cc0['attributes'],'include':_0x5f2cc0[_0x3e24('0x1e')]?_[_0x3e24('0x1f')](_0x5f2cc0[_0x3e24('0x1e')],function(_0x5464ff){return{'model':db[_0x5464ff[_0x3e24('0x20')]],'as':_0x5464ff['as'],'attributes':_0x5464ff[_0x3e24('0x21')],'include':_0x5464ff[_0x3e24('0x1e')]?_[_0x3e24('0x1f')](_0x5464ff[_0x3e24('0x1e')],function(_0x409723){return{'model':db[_0x409723['model']],'as':_0x409723['as'],'attributes':_0x409723['attributes']};}):[]};}):[]};}):[]:[]})[_0x3e24('0x22')](function(_0x97412){logger[_0x3e24('0x16')]('GetMailQueue',_0x1d32ec);logger['debug'](_0x3e24('0x19'),_0x1d32ec,JSON['stringify'](_0x97412));_0x2b5968(_0x97412);})[_0x3e24('0x18')](function(_0x5553bf){logger['error']('GetMailQueue',_0x5553bf[_0x3e24('0x15')],_0x1d32ec);_0x41dbc2(_0x29806a[_0x3e24('0x13')](0x1f4,_0x5553bf['message']));});});};exports[_0x3e24('0x23')]=function(_0x4a74f1){var _0x11147b=this;return new Promise(function(_0x2ce53f,_0x103e38){return db[_0x3e24('0x24')][_0x3e24('0x25')]({'raw':_0x4a74f1[_0x3e24('0x1b')]?_0x4a74f1[_0x3e24('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4a74f1[_0x3e24('0x1b')]?_0x4a74f1[_0x3e24('0x1b')][_0x3e24('0x1d')]||null:null,'attributes':_0x4a74f1[_0x3e24('0x1b')]?_0x4a74f1[_0x3e24('0x1b')][_0x3e24('0x21')]||null:null,'include':_0x4a74f1[_0x3e24('0x1b')]?_0x4a74f1[_0x3e24('0x1b')][_0x3e24('0x1e')]?_[_0x3e24('0x1f')](_0x4a74f1['options'][_0x3e24('0x1e')],function(_0x3aa5e6){return{'model':db[_0x3aa5e6['model']],'as':_0x3aa5e6['as'],'attributes':_0x3aa5e6['attributes'],'include':_0x3aa5e6[_0x3e24('0x1e')]?_[_0x3e24('0x1f')](_0x3aa5e6[_0x3e24('0x1e')],function(_0x39e6d2){return{'model':db[_0x39e6d2[_0x3e24('0x20')]],'as':_0x39e6d2['as'],'attributes':_0x39e6d2[_0x3e24('0x21')],'include':_0x39e6d2['include']?_[_0x3e24('0x1f')](_0x39e6d2[_0x3e24('0x1e')],function(_0x32c56d){return{'model':db[_0x32c56d[_0x3e24('0x20')]],'as':_0x32c56d['as'],'attributes':_0x32c56d[_0x3e24('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3e24('0x22')](function(_0x27429f){logger[_0x3e24('0x16')](_0x3e24('0x23'),_0x4a74f1);logger[_0x3e24('0x11')]('ShowMailQueue',_0x4a74f1,JSON[_0x3e24('0x12')](_0x27429f));_0x2ce53f(_0x27429f);})[_0x3e24('0x18')](function(_0x1b056b){logger[_0x3e24('0x13')](_0x3e24('0x23'),_0x1b056b[_0x3e24('0x15')],_0x4a74f1);_0x103e38(_0x11147b[_0x3e24('0x13')](0x1f4,_0x1b056b[_0x3e24('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 8974872..9ec8853 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 _0xc96f=['register','length','mailQueue:','save'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0xc96f,0x6f));var _0xfc96=function(_0x16b761,_0x385c0c){_0x16b761=_0x16b761-0x0;var _0x5cde65=_0xc96f[_0x16b761];return _0x5cde65;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xfc96('0x0'),'remove','update'];function createListener(_0x51bb1c,_0x282e06){return function(_0x4f480d){_0x282e06['emit'](_0x51bb1c,_0x4f480d);};}function removeListener(_0x1137c0,_0x4955db){return function(){MailQueueEvents['removeListener'](_0x1137c0,_0x4955db);};}exports[_0xfc96('0x1')]=function(_0x32edca){for(var _0x3f19a3=0x0,_0x5a0d68=events[_0xfc96('0x2')];_0x3f19a3<_0x5a0d68;_0x3f19a3++){var _0x355ec0=events[_0x3f19a3];var _0x1f4b0e=createListener(_0xfc96('0x3')+_0x355ec0,_0x32edca);MailQueueEvents['on'](_0x355ec0,_0x1f4b0e);}}; \ No newline at end of file +var _0xe0b8=['emit','register','length','mailQueue:','./mailQueue.events','save','update'];(function(_0x446208,_0xb483fb){var _0xe49563=function(_0x1d3a21){while(--_0x1d3a21){_0x446208['push'](_0x446208['shift']());}};_0xe49563(++_0xb483fb);}(_0xe0b8,0xe4));var _0x8e0b=function(_0xa2a5c9,_0x5209c1){_0xa2a5c9=_0xa2a5c9-0x0;var _0x46291f=_0xe0b8[_0xa2a5c9];return _0x46291f;};'use strict';var MailQueueEvents=require(_0x8e0b('0x0'));var events=[_0x8e0b('0x1'),'remove',_0x8e0b('0x2')];function createListener(_0x3d5b8e,_0x281bf7){return function(_0x4ee13e){_0x281bf7[_0x8e0b('0x3')](_0x3d5b8e,_0x4ee13e);};}function removeListener(_0x4eb646,_0x39c9ce){return function(){MailQueueEvents['removeListener'](_0x4eb646,_0x39c9ce);};}exports[_0x8e0b('0x4')]=function(_0x378994){for(var _0x55adc5=0x0,_0x160887=events[_0x8e0b('0x5')];_0x55adc5<_0x160887;_0x55adc5++){var _0xaec343=events[_0x55adc5];var _0x5ca7a7=createListener(_0x8e0b('0x6')+_0xaec343,_0x378994);MailQueueEvents['on'](_0xaec343,_0x5ca7a7);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 5886372..17d7225 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 _0x943d=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','describe','/:id','post','create','put'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x943d,0xeb));var _0xd943=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x943d[_0x4d1ee9];return _0x9a5456;};'use strict';var multer=require(_0xd943('0x0'));var util=require(_0xd943('0x1'));var path=require(_0xd943('0x2'));var timeout=require(_0xd943('0x3'));var express=require(_0xd943('0x4'));var router=express[_0xd943('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd943('0x6'));var config=require(_0xd943('0x7'));var controller=require(_0xd943('0x8'));router['get']('/',auth[_0xd943('0x9')](),controller[_0xd943('0xa')]);router[_0xd943('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xd943('0xc')]);router['get'](_0xd943('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xd943('0xe')]('/',auth['isAuthenticated'](),controller[_0xd943('0xf')]);router[_0xd943('0x10')](_0xd943('0xd'),auth[_0xd943('0x9')](),controller[_0xd943('0x11')]);router[_0xd943('0x12')]('/:id',auth[_0xd943('0x9')](),controller[_0xd943('0x13')]);module[_0xd943('0x14')]=router; \ No newline at end of file +var _0x2e23=['isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x846dab,_0x6919da){var _0x590ba9=function(_0x7687aa){while(--_0x7687aa){_0x846dab['push'](_0x846dab['shift']());}};_0x590ba9(++_0x6919da);}(_0x2e23,0x161));var _0x32e2=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x2e23[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0x32e2('0x0'));var util=require('util');var path=require(_0x32e2('0x1'));var timeout=require(_0x32e2('0x2'));var express=require(_0x32e2('0x3'));var router=express[_0x32e2('0x4')]();var auth=require(_0x32e2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x32e2('0x6'));var controller=require('./mailQueueReport.controller');router[_0x32e2('0x7')]('/',auth[_0x32e2('0x8')](),controller[_0x32e2('0x9')]);router['get'](_0x32e2('0xa'),auth['isAuthenticated'](),controller[_0x32e2('0xb')]);router['get'](_0x32e2('0xc'),auth[_0x32e2('0x8')](),controller[_0x32e2('0xd')]);router[_0x32e2('0xe')]('/',auth[_0x32e2('0x8')](),controller['create']);router[_0x32e2('0xf')](_0x32e2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x32e2('0x10')]('/:id',auth[_0x32e2('0x8')](),controller[_0x32e2('0x11')]);module[_0x32e2('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index d85c264..5490985 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 _0x8ce1=['sequelize','exports','STRING','DATE','moment'];(function(_0x3f1459,_0x174d0f){var _0x53da5c=function(_0xe5143b){while(--_0xe5143b){_0x3f1459['push'](_0x3f1459['shift']());}};_0x53da5c(++_0x174d0f);}(_0x8ce1,0x117));var _0x18ce=function(_0x4d1272,_0x46090d){_0x4d1272=_0x4d1272-0x0;var _0x525a41=_0x8ce1[_0x4d1272];return _0x525a41;};'use strict';var moment=require(_0x18ce('0x0'));var Sequelize=require(_0x18ce('0x1'));module[_0x18ce('0x2')]={'uniqueid':{'type':Sequelize[_0x18ce('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x18ce('0x3')]},'joinAt':{'type':Sequelize[_0x18ce('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x18ce('0x4')]},'exitAt':{'type':Sequelize[_0x18ce('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x729c=['moment','sequelize','exports','STRING','DATE'];(function(_0xff8af1,_0x386da2){var _0x51d65c=function(_0x3a3a94){while(--_0x3a3a94){_0xff8af1['push'](_0xff8af1['shift']());}};_0x51d65c(++_0x386da2);}(_0x729c,0x1b8));var _0xc729=function(_0x58ff7f,_0x5798ba){_0x58ff7f=_0x58ff7f-0x0;var _0x103507=_0x729c[_0x58ff7f];return _0x103507;};'use strict';var moment=require(_0xc729('0x0'));var Sequelize=require(_0xc729('0x1'));module[_0xc729('0x2')]={'uniqueid':{'type':Sequelize[_0xc729('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc729('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc729('0x4')]},'reason':{'type':Sequelize[_0xc729('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index a715ee3..e4bd2de 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 _0xb98c=['error','name','index','MailQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','field','filter','includeAll','include','rows','catch','params','options','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','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','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','end','sendStatus'];(function(_0x5da2c5,_0x6306e){var _0x2c0749=function(_0x5cf155){while(--_0x5cf155){_0x5da2c5['push'](_0x5da2c5['shift']());}};_0x2c0749(++_0x6306e);}(_0xb98c,0x144));var _0xcb98=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0xb98c[_0x3da832];return _0xe602f2;};'use strict';var pdf=require(_0xcb98('0x0'));var emlformat=require(_0xcb98('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcb98('0x2'));var jsonpatch=require(_0xcb98('0x3'));var rp=require(_0xcb98('0x4'));var moment=require(_0xcb98('0x5'));var BPromise=require(_0xcb98('0x6'));var Mustache=require(_0xcb98('0x7'));var util=require('util');var path=require(_0xcb98('0x8'));var sox=require(_0xcb98('0x9'));var csv=require(_0xcb98('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcb98('0xb'));var squel=require(_0xcb98('0xc'));var crypto=require(_0xcb98('0xd'));var jsforce=require(_0xcb98('0xe'));var deskjs=require(_0xcb98('0xf'));var toCsv=require(_0xcb98('0xa'));var querystring=require(_0xcb98('0x10'));var Papa=require(_0xcb98('0x11'));var authService=require(_0xcb98('0x12'));var hardwareService=require(_0xcb98('0x13'));var Redis=require(_0xcb98('0x14'));var qs=require(_0xcb98('0x15'));var logger=require('../../config/logger')(_0xcb98('0x16'));var utils=require(_0xcb98('0x17'));var config=require(_0xcb98('0x18'));var db=require(_0xcb98('0x19'))['db'];function respondWithStatusCode(_0x149ae1,_0x88efe3){_0x88efe3=_0x88efe3||0xcc;return function(_0x5bf49f){if(_0x5bf49f){return _0x149ae1['sendStatus'](_0x88efe3);}return _0x149ae1[_0xcb98('0x1a')](_0x88efe3)['end']();};}function respondWithResult(_0x12485d,_0x4e9e4f){_0x4e9e4f=_0x4e9e4f||0xc8;return function(_0x2f3c5e){if(_0x2f3c5e){return _0x12485d['status'](_0x4e9e4f)['json'](_0x2f3c5e);}};}function respondWithFilteredResult(_0x25b25e,_0x34adce){return function(_0x3ff986){if(_0x3ff986){var _0x7dc4df=_0x3ff986[_0xcb98('0x1b')],_0x5bfdb7=_0x34adce[_0xcb98('0x1c')],_0x35dda3=_0x34adce['offset']+_0x34adce[_0xcb98('0x1d')],_0x4b5c94;if(_0x35dda3>=_0x7dc4df){_0x35dda3=_0x7dc4df;_0x4b5c94=0xc8;}else{_0x4b5c94=0xce;}_0x25b25e['status'](_0x4b5c94);return _0x25b25e[_0xcb98('0x1e')](_0xcb98('0x1f'),_0x5bfdb7+'-'+_0x35dda3+'/'+_0x7dc4df)[_0xcb98('0x20')](_0x3ff986);}return null;};}function patchUpdates(_0x21c0b7){return function(_0x5f4e14){try{jsonpatch[_0xcb98('0x21')](_0x5f4e14,_0x21c0b7,!![]);}catch(_0xb57046){return BPromise[_0xcb98('0x22')](_0xb57046);}return _0x5f4e14[_0xcb98('0x23')]();};}function saveUpdates(_0x2d512c,_0x2002ea){return function(_0x2048c7){if(_0x2048c7){return _0x2048c7[_0xcb98('0x24')](_0x2d512c)['then'](function(_0x44efa3){return _0x44efa3;});}return null;};}function removeEntity(_0x41e21f,_0x1a6660){return function(_0x286a72){if(_0x286a72){return _0x286a72[_0xcb98('0x25')]()[_0xcb98('0x26')](function(){_0x41e21f[_0xcb98('0x1a')](0xcc)[_0xcb98('0x27')]();});}};}function handleEntityNotFound(_0x513f0e,_0x376279){return function(_0x5bd888){if(!_0x5bd888){_0x513f0e[_0xcb98('0x28')](0x194);}return _0x5bd888;};}function handleError(_0x132727,_0x5da54d){_0x5da54d=_0x5da54d||0x1f4;return function(_0x2b5480){logger[_0xcb98('0x29')](_0x2b5480['stack']);if(_0x2b5480[_0xcb98('0x2a')]){delete _0x2b5480['name'];}_0x132727['status'](_0x5da54d)['send'](_0x2b5480);};}exports[_0xcb98('0x2b')]=function(_0xd766f9,_0x430312){var _0x853c47={},_0x2ea901={},_0x488c1a={'count':0x0,'rows':[]};var _0x1d9e1a=db[_0xcb98('0x2c')][_0xcb98('0x2d')];_0x2ea901[_0xcb98('0x2e')]=_[_0xcb98('0x2f')](_0x1d9e1a);_0x2ea901[_0xcb98('0x30')]=_['keys'](_0xd766f9['query']);_0x2ea901[_0xcb98('0x31')]=_[_0xcb98('0x32')](_0x2ea901[_0xcb98('0x2e')],_0x2ea901[_0xcb98('0x30')]);_0x853c47[_0xcb98('0x33')]=_[_0xcb98('0x32')](_0x2ea901[_0xcb98('0x2e')],qs[_0xcb98('0x34')](_0xd766f9[_0xcb98('0x30')][_0xcb98('0x34')]));_0x853c47[_0xcb98('0x33')]=_0x853c47[_0xcb98('0x33')][_0xcb98('0x35')]?_0x853c47['attributes']:_0x2ea901[_0xcb98('0x2e')];if(!_0xd766f9[_0xcb98('0x30')][_0xcb98('0x36')](_0xcb98('0x37'))){_0x853c47['limit']=qs[_0xcb98('0x1d')](_0xd766f9[_0xcb98('0x30')][_0xcb98('0x1d')]);_0x853c47[_0xcb98('0x1c')]=qs[_0xcb98('0x1c')](_0xd766f9[_0xcb98('0x30')][_0xcb98('0x1c')]);}_0x853c47[_0xcb98('0x38')]=qs[_0xcb98('0x39')](_0xd766f9[_0xcb98('0x30')][_0xcb98('0x39')]);_0x853c47['where']=qs['filters'](_['pick'](_0xd766f9[_0xcb98('0x30')],_0x2ea901[_0xcb98('0x31')]));if(_0xd766f9[_0xcb98('0x30')]['filter']){_0x853c47[_0xcb98('0x3a')]=_[_0xcb98('0x3b')](_0x853c47[_0xcb98('0x3a')],{'$or':_['map'](_0x1d9e1a,function(_0x13247e){if(_0x13247e['type']['key']!==_0xcb98('0x3c')){var _0x1e4b4f={};_0x1e4b4f[_0x13247e[_0xcb98('0x3d')]]={'$like':'%'+_0xd766f9[_0xcb98('0x30')][_0xcb98('0x3e')]+'%'};return _0x1e4b4f;}})});}_0x853c47=_[_0xcb98('0x3b')]({},_0x853c47,_0xd766f9['options']);var _0x3a21d0={'where':_0x853c47[_0xcb98('0x3a')]};return db[_0xcb98('0x2c')]['count'](_0x3a21d0)[_0xcb98('0x26')](function(_0x49602f){_0x488c1a[_0xcb98('0x1b')]=_0x49602f;if(_0xd766f9[_0xcb98('0x30')][_0xcb98('0x3f')]){_0x853c47[_0xcb98('0x40')]=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x853c47);})['then'](function(_0x3f3d53){_0x488c1a[_0xcb98('0x41')]=_0x3f3d53;return _0x488c1a;})[_0xcb98('0x26')](respondWithFilteredResult(_0x430312,_0x853c47))[_0xcb98('0x42')](handleError(_0x430312,null));};exports['show']=function(_0x147e6c,_0x2c27f7){var _0x5303f9={'raw':!![],'where':{'id':_0x147e6c[_0xcb98('0x43')]['id']}},_0x1eaf94={};_0x1eaf94[_0xcb98('0x2e')]=_[_0xcb98('0x2f')](db[_0xcb98('0x2c')][_0xcb98('0x2d')]);_0x1eaf94[_0xcb98('0x30')]=_[_0xcb98('0x2f')](_0x147e6c[_0xcb98('0x30')]);_0x1eaf94['filters']=_[_0xcb98('0x32')](_0x1eaf94[_0xcb98('0x2e')],_0x1eaf94[_0xcb98('0x30')]);_0x5303f9[_0xcb98('0x33')]=_[_0xcb98('0x32')](_0x1eaf94[_0xcb98('0x2e')],qs[_0xcb98('0x34')](_0x147e6c[_0xcb98('0x30')]['fields']));_0x5303f9[_0xcb98('0x33')]=_0x5303f9['attributes'][_0xcb98('0x35')]?_0x5303f9[_0xcb98('0x33')]:_0x1eaf94['model'];if(_0x147e6c[_0xcb98('0x30')][_0xcb98('0x3f')]){_0x5303f9['include']=[{'all':!![]}];}_0x5303f9=_[_0xcb98('0x3b')]({},_0x5303f9,_0x147e6c[_0xcb98('0x44')]);return db[_0xcb98('0x2c')]['find'](_0x5303f9)['then'](handleEntityNotFound(_0x2c27f7,null))['then'](respondWithResult(_0x2c27f7,null))[_0xcb98('0x42')](handleError(_0x2c27f7,null));};exports[_0xcb98('0x45')]=function(_0x14e7bb,_0x14cf98){return db[_0xcb98('0x2c')][_0xcb98('0x45')](_0x14e7bb[_0xcb98('0x46')],{})[_0xcb98('0x26')](respondWithResult(_0x14cf98,0xc9))[_0xcb98('0x42')](handleError(_0x14cf98,null));};exports['update']=function(_0x28bdce,_0x353732){if(_0x28bdce['body']['id']){delete _0x28bdce['body']['id'];}return db['MailQueueReport'][_0xcb98('0x47')]({'where':{'id':_0x28bdce[_0xcb98('0x43')]['id']}})[_0xcb98('0x26')](handleEntityNotFound(_0x353732,null))[_0xcb98('0x26')](saveUpdates(_0x28bdce[_0xcb98('0x46')],null))[_0xcb98('0x26')](respondWithResult(_0x353732,null))[_0xcb98('0x42')](handleError(_0x353732,null));};exports[_0xcb98('0x25')]=function(_0x101fb1,_0x2c1442){return db[_0xcb98('0x2c')][_0xcb98('0x47')]({'where':{'id':_0x101fb1['params']['id']}})[_0xcb98('0x26')](handleEntityNotFound(_0x2c1442,null))[_0xcb98('0x26')](removeEntity(_0x2c1442,null))[_0xcb98('0x42')](handleError(_0x2c1442,null));};exports[_0xcb98('0x48')]=function(_0x320774,_0xd1f137){return db[_0xcb98('0x2c')][_0xcb98('0x48')]()[_0xcb98('0x26')](respondWithResult(_0xd1f137,null))[_0xcb98('0x42')](handleError(_0xd1f137,null));}; \ No newline at end of file +var _0xf235=['count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','MailQueueReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','nolimit','sort','where','filter','merge','map','type','key','VIRTUAL','options','include','findAll','rows','catch','show','params','length','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','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','sendStatus','status','end','json'];(function(_0xd7a30,_0x5890d2){var _0x445a54=function(_0x3506df){while(--_0x3506df){_0xd7a30['push'](_0xd7a30['shift']());}};_0x445a54(++_0x5890d2);}(_0xf235,0x1ef));var _0x5f23=function(_0x1fabba,_0x2496ef){_0x1fabba=_0x1fabba-0x0;var _0x86fc5d=_0xf235[_0x1fabba];return _0x86fc5d;};'use strict';var pdf=require(_0x5f23('0x0'));var emlformat=require(_0x5f23('0x1'));var rimraf=require(_0x5f23('0x2'));var zipdir=require(_0x5f23('0x3'));var jsonpatch=require(_0x5f23('0x4'));var rp=require('request-promise');var moment=require(_0x5f23('0x5'));var BPromise=require(_0x5f23('0x6'));var Mustache=require(_0x5f23('0x7'));var util=require(_0x5f23('0x8'));var path=require(_0x5f23('0x9'));var sox=require('sox');var csv=require(_0x5f23('0xa'));var ejs=require(_0x5f23('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5f23('0xc'));var crypto=require(_0x5f23('0xd'));var jsforce=require(_0x5f23('0xe'));var deskjs=require(_0x5f23('0xf'));var toCsv=require(_0x5f23('0xa'));var querystring=require(_0x5f23('0x10'));var Papa=require(_0x5f23('0x11'));var authService=require(_0x5f23('0x12'));var hardwareService=require(_0x5f23('0x13'));var Redis=require(_0x5f23('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0x5f23('0x15'))(_0x5f23('0x16'));var utils=require(_0x5f23('0x17'));var config=require(_0x5f23('0x18'));var db=require(_0x5f23('0x19'))['db'];function respondWithStatusCode(_0x480b3e,_0x507ad2){_0x507ad2=_0x507ad2||0xcc;return function(_0x3f0fd5){if(_0x3f0fd5){return _0x480b3e[_0x5f23('0x1a')](_0x507ad2);}return _0x480b3e[_0x5f23('0x1b')](_0x507ad2)[_0x5f23('0x1c')]();};}function respondWithResult(_0x4a9a3e,_0x27732c){_0x27732c=_0x27732c||0xc8;return function(_0x50158c){if(_0x50158c){return _0x4a9a3e[_0x5f23('0x1b')](_0x27732c)[_0x5f23('0x1d')](_0x50158c);}};}function respondWithFilteredResult(_0x5125c9,_0x2a902){return function(_0x16a297){if(_0x16a297){var _0x5f54b0=_0x16a297[_0x5f23('0x1e')],_0x395461=_0x2a902[_0x5f23('0x1f')],_0x2cb54a=_0x2a902[_0x5f23('0x1f')]+_0x2a902[_0x5f23('0x20')],_0x4e8f7c;if(_0x2cb54a>=_0x5f54b0){_0x2cb54a=_0x5f54b0;_0x4e8f7c=0xc8;}else{_0x4e8f7c=0xce;}_0x5125c9[_0x5f23('0x1b')](_0x4e8f7c);return _0x5125c9[_0x5f23('0x21')](_0x5f23('0x22'),_0x395461+'-'+_0x2cb54a+'/'+_0x5f54b0)[_0x5f23('0x1d')](_0x16a297);}return null;};}function patchUpdates(_0x26019d){return function(_0xacbb6f){try{jsonpatch[_0x5f23('0x23')](_0xacbb6f,_0x26019d,!![]);}catch(_0x8444b9){return BPromise[_0x5f23('0x24')](_0x8444b9);}return _0xacbb6f[_0x5f23('0x25')]();};}function saveUpdates(_0x190d0d,_0x4dbf4d){return function(_0x50466c){if(_0x50466c){return _0x50466c[_0x5f23('0x26')](_0x190d0d)[_0x5f23('0x27')](function(_0x5f254f){return _0x5f254f;});}return null;};}function removeEntity(_0x133e37,_0x5b3481){return function(_0x3b1843){if(_0x3b1843){return _0x3b1843[_0x5f23('0x28')]()['then'](function(){_0x133e37[_0x5f23('0x1b')](0xcc)[_0x5f23('0x1c')]();});}};}function handleEntityNotFound(_0x2ed697,_0x1ea91f){return function(_0x122d17){if(!_0x122d17){_0x2ed697[_0x5f23('0x1a')](0x194);}return _0x122d17;};}function handleError(_0x105c45,_0xdd0881){_0xdd0881=_0xdd0881||0x1f4;return function(_0x597b4b){logger[_0x5f23('0x29')](_0x597b4b['stack']);if(_0x597b4b[_0x5f23('0x2a')]){delete _0x597b4b[_0x5f23('0x2a')];}_0x105c45['status'](_0xdd0881)[_0x5f23('0x2b')](_0x597b4b);};}exports[_0x5f23('0x2c')]=function(_0x1bb199,_0xc74275){var _0xecb59f={},_0x200ad3={},_0x4bc7ff={'count':0x0,'rows':[]};var _0x5230fe=db[_0x5f23('0x2d')][_0x5f23('0x2e')];_0x200ad3[_0x5f23('0x2f')]=_[_0x5f23('0x30')](_0x5230fe);_0x200ad3[_0x5f23('0x31')]=_[_0x5f23('0x30')](_0x1bb199[_0x5f23('0x31')]);_0x200ad3[_0x5f23('0x32')]=_['intersection'](_0x200ad3['model'],_0x200ad3[_0x5f23('0x31')]);_0xecb59f[_0x5f23('0x33')]=_[_0x5f23('0x34')](_0x200ad3[_0x5f23('0x2f')],qs[_0x5f23('0x35')](_0x1bb199['query'][_0x5f23('0x35')]));_0xecb59f['attributes']=_0xecb59f[_0x5f23('0x33')]['length']?_0xecb59f[_0x5f23('0x33')]:_0x200ad3[_0x5f23('0x2f')];if(!_0x1bb199[_0x5f23('0x31')]['hasOwnProperty'](_0x5f23('0x36'))){_0xecb59f[_0x5f23('0x20')]=qs[_0x5f23('0x20')](_0x1bb199[_0x5f23('0x31')][_0x5f23('0x20')]);_0xecb59f[_0x5f23('0x1f')]=qs[_0x5f23('0x1f')](_0x1bb199[_0x5f23('0x31')][_0x5f23('0x1f')]);}_0xecb59f['order']=qs['sort'](_0x1bb199['query'][_0x5f23('0x37')]);_0xecb59f[_0x5f23('0x38')]=qs['filters'](_['pick'](_0x1bb199[_0x5f23('0x31')],_0x200ad3[_0x5f23('0x32')]));if(_0x1bb199[_0x5f23('0x31')][_0x5f23('0x39')]){_0xecb59f[_0x5f23('0x38')]=_[_0x5f23('0x3a')](_0xecb59f[_0x5f23('0x38')],{'$or':_[_0x5f23('0x3b')](_0x5230fe,function(_0x122942){if(_0x122942[_0x5f23('0x3c')][_0x5f23('0x3d')]!==_0x5f23('0x3e')){var _0x25f3e0={};_0x25f3e0[_0x122942['field']]={'$like':'%'+_0x1bb199[_0x5f23('0x31')][_0x5f23('0x39')]+'%'};return _0x25f3e0;}})});}_0xecb59f=_[_0x5f23('0x3a')]({},_0xecb59f,_0x1bb199[_0x5f23('0x3f')]);var _0xcba113={'where':_0xecb59f[_0x5f23('0x38')]};return db[_0x5f23('0x2d')][_0x5f23('0x1e')](_0xcba113)[_0x5f23('0x27')](function(_0x3289fa){_0x4bc7ff[_0x5f23('0x1e')]=_0x3289fa;if(_0x1bb199['query']['includeAll']){_0xecb59f[_0x5f23('0x40')]=[{'all':!![]}];}return db[_0x5f23('0x2d')][_0x5f23('0x41')](_0xecb59f);})[_0x5f23('0x27')](function(_0xb82ffe){_0x4bc7ff[_0x5f23('0x42')]=_0xb82ffe;return _0x4bc7ff;})['then'](respondWithFilteredResult(_0xc74275,_0xecb59f))[_0x5f23('0x43')](handleError(_0xc74275,null));};exports[_0x5f23('0x44')]=function(_0x21acaf,_0xce830b){var _0x409a4e={'raw':!![],'where':{'id':_0x21acaf[_0x5f23('0x45')]['id']}},_0x4128f0={};_0x4128f0[_0x5f23('0x2f')]=_[_0x5f23('0x30')](db[_0x5f23('0x2d')][_0x5f23('0x2e')]);_0x4128f0[_0x5f23('0x31')]=_[_0x5f23('0x30')](_0x21acaf[_0x5f23('0x31')]);_0x4128f0[_0x5f23('0x32')]=_[_0x5f23('0x34')](_0x4128f0[_0x5f23('0x2f')],_0x4128f0[_0x5f23('0x31')]);_0x409a4e[_0x5f23('0x33')]=_[_0x5f23('0x34')](_0x4128f0['model'],qs['fields'](_0x21acaf[_0x5f23('0x31')][_0x5f23('0x35')]));_0x409a4e[_0x5f23('0x33')]=_0x409a4e[_0x5f23('0x33')][_0x5f23('0x46')]?_0x409a4e[_0x5f23('0x33')]:_0x4128f0[_0x5f23('0x2f')];if(_0x21acaf['query']['includeAll']){_0x409a4e[_0x5f23('0x40')]=[{'all':!![]}];}_0x409a4e=_['merge']({},_0x409a4e,_0x21acaf[_0x5f23('0x3f')]);return db['MailQueueReport']['find'](_0x409a4e)[_0x5f23('0x27')](handleEntityNotFound(_0xce830b,null))[_0x5f23('0x27')](respondWithResult(_0xce830b,null))[_0x5f23('0x43')](handleError(_0xce830b,null));};exports[_0x5f23('0x47')]=function(_0xbed224,_0x30ba3e){return db[_0x5f23('0x2d')][_0x5f23('0x47')](_0xbed224[_0x5f23('0x48')],{})[_0x5f23('0x27')](respondWithResult(_0x30ba3e,0xc9))[_0x5f23('0x43')](handleError(_0x30ba3e,null));};exports[_0x5f23('0x26')]=function(_0x3e8a98,_0x556497){if(_0x3e8a98[_0x5f23('0x48')]['id']){delete _0x3e8a98['body']['id'];}return db['MailQueueReport'][_0x5f23('0x49')]({'where':{'id':_0x3e8a98[_0x5f23('0x45')]['id']}})[_0x5f23('0x27')](handleEntityNotFound(_0x556497,null))[_0x5f23('0x27')](saveUpdates(_0x3e8a98['body'],null))[_0x5f23('0x27')](respondWithResult(_0x556497,null))[_0x5f23('0x43')](handleError(_0x556497,null));};exports['destroy']=function(_0xa9c48c,_0x46fddb){return db[_0x5f23('0x2d')][_0x5f23('0x49')]({'where':{'id':_0xa9c48c['params']['id']}})['then'](handleEntityNotFound(_0x46fddb,null))[_0x5f23('0x27')](removeEntity(_0x46fddb,null))[_0x5f23('0x43')](handleError(_0x46fddb,null));};exports['describe']=function(_0x9054f0,_0x5b1f70){return db[_0x5f23('0x2d')][_0x5f23('0x4a')]()[_0x5f23('0x27')](respondWithResult(_0x5b1f70,null))[_0x5f23('0x43')](handleError(_0x5b1f70,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 4924f21..9e06f69 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 _0xa9a3=['moment','bluebird','request-promise','./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger','api'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xa9a3,0x19f));var _0x3a9a=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xa9a3[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0x3a9a('0x0'));var util=require('util');var logger=require(_0x3a9a('0x1'))(_0x3a9a('0x2'));var moment=require(_0x3a9a('0x3'));var BPromise=require(_0x3a9a('0x4'));var rp=require(_0x3a9a('0x5'));var attributes=require(_0x3a9a('0x6'));module['exports']=function(_0xf12f62,_0xf7f24a){return _0xf12f62[_0x3a9a('0x7')](_0x3a9a('0x8'),attributes,{'tableName':_0x3a9a('0x9'),'paranoid':![],'indexes':[{'name':_0x3a9a('0xa'),'fields':[_0x3a9a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3b9c=['util','../../config/logger','moment','bluebird','request-promise','exports','MailQueueReport','uniqueid','lodash'];(function(_0x4f018a,_0x350704){var _0x56f3a6=function(_0x5cecfe){while(--_0x5cecfe){_0x4f018a['push'](_0x4f018a['shift']());}};_0x56f3a6(++_0x350704);}(_0x3b9c,0x1ca));var _0xc3b9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3b9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc3b9('0x0'));var util=require(_0xc3b9('0x1'));var logger=require(_0xc3b9('0x2'))('api');var moment=require(_0xc3b9('0x3'));var BPromise=require(_0xc3b9('0x4'));var rp=require(_0xc3b9('0x5'));var attributes=require('./mailQueueReport.attributes');module[_0xc3b9('0x6')]=function(_0x517dce,_0x3f1a29){return _0x517dce['define'](_0xc3b9('0x7'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xc3b9('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index e8b803d..9001f8a 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 _0xbbcb=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','MailQueueReport','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','where','limit'];(function(_0x1cafde,_0x2ba18e){var _0x477e6c=function(_0x194991){while(--_0x194991){_0x1cafde['push'](_0x1cafde['shift']());}};_0x477e6c(++_0x2ba18e);}(_0xbbcb,0xfc));var _0xbbbc=function(_0x319f1e,_0x25e1e1){_0x319f1e=_0x319f1e-0x0;var _0x4ce668=_0xbbcb[_0x319f1e];return _0x4ce668;};'use strict';var _=require('lodash');var util=require(_0xbbbc('0x0'));var moment=require(_0xbbbc('0x1'));var BPromise=require(_0xbbbc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbbc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbbbc('0x4'));var logger=require(_0xbbbc('0x5'))(_0xbbbc('0x6'));var config=require(_0xbbbc('0x7'));var jayson=require(_0xbbbc('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x134b71,_0x397a62,_0xeac592){return new BPromise(function(_0x5ae74e,_0x58bcc1){return client[_0xbbbc('0x9')](_0x134b71,_0xeac592)[_0xbbbc('0xa')](function(_0x554360){logger[_0xbbbc('0xb')](_0xbbbc('0xc'),_0x397a62,_0xbbbc('0xd'));logger[_0xbbbc('0xe')](_0xbbbc('0xf'),_0x397a62,_0xbbbc('0xd'),JSON[_0xbbbc('0x10')](_0x554360));if(_0x554360[_0xbbbc('0x11')]){if(_0x554360[_0xbbbc('0x11')]['code']===0x1f4){logger[_0xbbbc('0x11')](_0xbbbc('0xc'),_0x397a62,_0x554360[_0xbbbc('0x11')][_0xbbbc('0x12')]);return _0x58bcc1(_0x554360[_0xbbbc('0x11')][_0xbbbc('0x12')]);}logger[_0xbbbc('0x11')](_0xbbbc('0xc'),_0x397a62,_0x554360['error'][_0xbbbc('0x12')]);return _0x5ae74e(_0x554360[_0xbbbc('0x11')][_0xbbbc('0x12')]);}else{logger[_0xbbbc('0xb')](_0xbbbc('0xc'),_0x397a62,_0xbbbc('0xd'));_0x5ae74e(_0x554360['result'][_0xbbbc('0x12')]);}})[_0xbbbc('0x13')](function(_0x3e313b){logger[_0xbbbc('0x11')]('MailQueueReport,\x20%s,\x20%s',_0x397a62,_0x3e313b);_0x58bcc1(_0x3e313b);});});}exports['CreateMailQueueReport']=function(_0x312bd4){var _0x1a4b45=this;return new Promise(function(_0x5791d5,_0x3686c2){return db[_0xbbbc('0x14')]['create'](_0x312bd4[_0xbbbc('0x15')],{'raw':_0x312bd4[_0xbbbc('0x16')]?_0x312bd4['options'][_0xbbbc('0x17')]===undefined?!![]:![]:!![]})[_0xbbbc('0xa')](function(_0x412960){logger['info'](_0xbbbc('0x18'),_0x312bd4);logger[_0xbbbc('0xe')](_0xbbbc('0x18'),_0x312bd4,JSON[_0xbbbc('0x10')](_0x412960));_0x5791d5(_0x412960);})[_0xbbbc('0x13')](function(_0x419a9d){logger[_0xbbbc('0x11')](_0xbbbc('0x18'),_0x419a9d['message'],_0x312bd4);_0x3686c2(_0x1a4b45['error'](0x1f4,_0x419a9d[_0xbbbc('0x12')]));});});};exports[_0xbbbc('0x19')]=function(_0xb9bb84){var _0x5a7bb7=this;return new Promise(function(_0x1798dc,_0x37a2a7){return db[_0xbbbc('0x14')]['update'](_0xb9bb84[_0xbbbc('0x15')],{'raw':_0xb9bb84[_0xbbbc('0x16')]?_0xb9bb84[_0xbbbc('0x16')][_0xbbbc('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb9bb84[_0xbbbc('0x16')]?_0xb9bb84[_0xbbbc('0x16')][_0xbbbc('0x1a')]||null:null,'attributes':_0xb9bb84[_0xbbbc('0x16')]?_0xb9bb84['options']['attributes']||null:null,'limit':_0xb9bb84['options']?_0xb9bb84[_0xbbbc('0x16')][_0xbbbc('0x1b')]||null:null})[_0xbbbc('0xa')](function(_0x278f03){logger[_0xbbbc('0xb')](_0xbbbc('0x19'),_0xb9bb84);logger[_0xbbbc('0xe')]('UpdateMailQueueReport',_0xb9bb84,JSON[_0xbbbc('0x10')](_0x278f03));_0x1798dc(_0x278f03);})[_0xbbbc('0x13')](function(_0x5d66b9){logger['error'](_0xbbbc('0x19'),_0x5d66b9[_0xbbbc('0x12')],_0xb9bb84);_0x37a2a7(_0x5a7bb7[_0xbbbc('0x11')](0x1f4,_0x5d66b9[_0xbbbc('0x12')]));});});}; \ No newline at end of file +var _0xab78=['lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','MailQueueReport','options','raw','CreateMailQueueReport','update','body','where','attributes','limit','UpdateMailQueueReport'];(function(_0x57f8fe,_0x3e3402){var _0x38dfb8=function(_0x5b4c83){while(--_0x5b4c83){_0x57f8fe['push'](_0x57f8fe['shift']());}};_0x38dfb8(++_0x3e3402);}(_0xab78,0x1a0));var _0x8ab7=function(_0xe6117a,_0x488cd3){_0xe6117a=_0xe6117a-0x0;var _0x2c2e11=_0xab78[_0xe6117a];return _0x2c2e11;};'use strict';var _=require(_0x8ab7('0x0'));var util=require(_0x8ab7('0x1'));var moment=require('moment');var BPromise=require(_0x8ab7('0x2'));var rs=require(_0x8ab7('0x3'));var fs=require('fs');var Redis=require(_0x8ab7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8ab7('0x5'))(_0x8ab7('0x6'));var config=require(_0x8ab7('0x7'));var jayson=require(_0x8ab7('0x8'));var client=jayson['client'][_0x8ab7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3255d,_0x117648,_0xbfa76){return new BPromise(function(_0x55a368,_0x2bb57a){return client[_0x8ab7('0xa')](_0x3255d,_0xbfa76)[_0x8ab7('0xb')](function(_0xb3cab7){logger['info'](_0x8ab7('0xc'),_0x117648,_0x8ab7('0xd'));logger[_0x8ab7('0xe')](_0x8ab7('0xf'),_0x117648,'request\x20sent',JSON[_0x8ab7('0x10')](_0xb3cab7));if(_0xb3cab7[_0x8ab7('0x11')]){if(_0xb3cab7[_0x8ab7('0x11')]['code']===0x1f4){logger[_0x8ab7('0x11')](_0x8ab7('0xc'),_0x117648,_0xb3cab7[_0x8ab7('0x11')][_0x8ab7('0x12')]);return _0x2bb57a(_0xb3cab7[_0x8ab7('0x11')]['message']);}logger['error'](_0x8ab7('0xc'),_0x117648,_0xb3cab7[_0x8ab7('0x11')][_0x8ab7('0x12')]);return _0x55a368(_0xb3cab7[_0x8ab7('0x11')][_0x8ab7('0x12')]);}else{logger[_0x8ab7('0x13')](_0x8ab7('0xc'),_0x117648,_0x8ab7('0xd'));_0x55a368(_0xb3cab7[_0x8ab7('0x14')][_0x8ab7('0x12')]);}})[_0x8ab7('0x15')](function(_0x2d10bc){logger[_0x8ab7('0x11')](_0x8ab7('0xc'),_0x117648,_0x2d10bc);_0x2bb57a(_0x2d10bc);});});}exports['CreateMailQueueReport']=function(_0x28e4fa){var _0x54d777=this;return new Promise(function(_0x3df347,_0x44d5da){return db[_0x8ab7('0x16')]['create'](_0x28e4fa['body'],{'raw':_0x28e4fa['options']?_0x28e4fa[_0x8ab7('0x17')][_0x8ab7('0x18')]===undefined?!![]:![]:!![]})[_0x8ab7('0xb')](function(_0x163631){logger[_0x8ab7('0x13')](_0x8ab7('0x19'),_0x28e4fa);logger[_0x8ab7('0xe')](_0x8ab7('0x19'),_0x28e4fa,JSON[_0x8ab7('0x10')](_0x163631));_0x3df347(_0x163631);})[_0x8ab7('0x15')](function(_0x4b690e){logger[_0x8ab7('0x11')](_0x8ab7('0x19'),_0x4b690e[_0x8ab7('0x12')],_0x28e4fa);_0x44d5da(_0x54d777[_0x8ab7('0x11')](0x1f4,_0x4b690e[_0x8ab7('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1e7688){var _0x11054c=this;return new Promise(function(_0x50584e,_0x7c93aa){return db[_0x8ab7('0x16')][_0x8ab7('0x1a')](_0x1e7688[_0x8ab7('0x1b')],{'raw':_0x1e7688['options']?_0x1e7688[_0x8ab7('0x17')][_0x8ab7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e7688[_0x8ab7('0x17')]?_0x1e7688[_0x8ab7('0x17')][_0x8ab7('0x1c')]||null:null,'attributes':_0x1e7688[_0x8ab7('0x17')]?_0x1e7688[_0x8ab7('0x17')][_0x8ab7('0x1d')]||null:null,'limit':_0x1e7688['options']?_0x1e7688['options'][_0x8ab7('0x1e')]||null:null})['then'](function(_0x5c8582){logger[_0x8ab7('0x13')](_0x8ab7('0x1f'),_0x1e7688);logger[_0x8ab7('0xe')]('UpdateMailQueueReport',_0x1e7688,JSON[_0x8ab7('0x10')](_0x5c8582));_0x50584e(_0x5c8582);})[_0x8ab7('0x15')](function(_0x4608c2){logger['error']('UpdateMailQueueReport',_0x4608c2[_0x8ab7('0x12')],_0x1e7688);_0x7c93aa(_0x11054c[_0x8ab7('0x11')](0x1f4,_0x4608c2[_0x8ab7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index d227783..1dbcdec 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 _0x4489=['Router','../../components/auth/service','multer','util','connect-timeout','express'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9448('0x0'));var util=require(_0x9448('0x1'));var path=require('path');var timeout=require(_0x9448('0x2'));var express=require(_0x9448('0x3'));var router=express[_0x9448('0x4')]();var auth=require(_0x9448('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x5d17=['../../components/auth/service','../../config/environment','exports','multer','util','express','Router'];(function(_0x4f4a36,_0x371b5d){var _0x3fd9e4=function(_0x59637f){while(--_0x59637f){_0x4f4a36['push'](_0x4f4a36['shift']());}};_0x3fd9e4(++_0x371b5d);}(_0x5d17,0x114));var _0x75d1=function(_0x166b97,_0x2833d5){_0x166b97=_0x166b97-0x0;var _0x4d3c9a=_0x5d17[_0x166b97];return _0x4d3c9a;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var auth=require(_0x75d1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x75d1('0x5'));module[_0x75d1('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index f2714ee..d52a296 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 _0xa9e0=['INTEGER','BOOLEAN','INBOX','sequelize','exports','STRING'];(function(_0x30673d,_0x3ffe3f){var _0x3a0c6c=function(_0x42299f){while(--_0x42299f){_0x30673d['push'](_0x30673d['shift']());}};_0x3a0c6c(++_0x3ffe3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'description':{'type':Sequelize[_0x0a9e('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x0a9e('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x0a9e('0x2')]},'port':{'type':Sequelize[_0x0a9e('0x3')]},'tls':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file +var _0xd691=['exports','STRING','BOOLEAN','username','INTEGER','INBOX','sequelize'];(function(_0x252699,_0x134b4e){var _0x56d0c6=function(_0x5551a8){while(--_0x5551a8){_0x252699['push'](_0x252699['shift']());}};_0x56d0c6(++_0x134b4e);}(_0xd691,0xe6));var _0x1d69=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0xd691[_0x35485a];return _0x5148e6;};'use strict';var Sequelize=require(_0x1d69('0x0'));module[_0x1d69('0x1')]={'description':{'type':Sequelize[_0x1d69('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x1d69('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x1d69('0x2')],'unique':_0x1d69('0x4')},'password':{'type':Sequelize[_0x1d69('0x2')]},'port':{'type':Sequelize[_0x1d69('0x5')]},'tls':{'type':Sequelize[_0x1d69('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1d69('0x2')],'defaultValue':_0x1d69('0x6')},'connTimeout':{'type':Sequelize[_0x1d69('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1d69('0x5')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 8963e2f..ec2a30d 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 _0x13eb=['define','MailServerIn','mail_servers_in','lodash','util','api','moment','request-promise','./mailServerIn.attributes','exports'];(function(_0x56418a,_0x2c7f9f){var _0xd02067=function(_0xa9074a){while(--_0xa9074a){_0x56418a['push'](_0x56418a['shift']());}};_0xd02067(++_0x2c7f9f);}(_0x13eb,0x8f));var _0xb13e=function(_0x12f59c,_0x13d956){_0x12f59c=_0x12f59c-0x0;var _0x2db43e=_0x13eb[_0x12f59c];return _0x2db43e;};'use strict';var _=require(_0xb13e('0x0'));var util=require(_0xb13e('0x1'));var logger=require('../../config/logger')(_0xb13e('0x2'));var moment=require(_0xb13e('0x3'));var BPromise=require('bluebird');var rp=require(_0xb13e('0x4'));var attributes=require(_0xb13e('0x5'));module[_0xb13e('0x6')]=function(_0x4b3215,_0x4eb55b){return _0x4b3215[_0xb13e('0x7')](_0xb13e('0x8'),attributes,{'tableName':_0xb13e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa74f=['request-promise','./mailServerIn.attributes','exports','mail_servers_in','../../config/logger','bluebird'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xa74f,0x9a));var _0xfa74=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0xa74f[_0x30d87a];return _0x48f64b;};'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']('MailServerIn',attributes,{'tableName':_0xfa74('0x5'),'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 a22aa91..6174d48 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 _0xf6d4=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','options','where','include','map','model','attributes'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0xf6d4,0x1b2));var _0x4f6d=function(_0x47dda0,_0xbb60a9){_0x47dda0=_0x47dda0-0x0;var _0x24278a=_0xf6d4[_0x47dda0];return _0x24278a;};'use strict';var _=require(_0x4f6d('0x0'));var util=require(_0x4f6d('0x1'));var moment=require(_0x4f6d('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f6d('0x3'));var fs=require('fs');var Redis=require(_0x4f6d('0x4'));var db=require(_0x4f6d('0x5'))['db'];var utils=require(_0x4f6d('0x6'));var logger=require(_0x4f6d('0x7'))(_0x4f6d('0x8'));var config=require(_0x4f6d('0x9'));var jayson=require(_0x4f6d('0xa'));var client=jayson[_0x4f6d('0xb')][_0x4f6d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x521f21,_0x54f0be,_0x12f49d){return new BPromise(function(_0x2575ac,_0x3f4750){return client[_0x4f6d('0xd')](_0x521f21,_0x12f49d)[_0x4f6d('0xe')](function(_0x570568){logger[_0x4f6d('0xf')](_0x4f6d('0x10'),_0x54f0be,_0x4f6d('0x11'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x54f0be,_0x4f6d('0x11'),JSON[_0x4f6d('0x12')](_0x570568));if(_0x570568[_0x4f6d('0x13')]){if(_0x570568[_0x4f6d('0x13')]['code']===0x1f4){logger[_0x4f6d('0x13')](_0x4f6d('0x10'),_0x54f0be,_0x570568[_0x4f6d('0x13')][_0x4f6d('0x14')]);return _0x3f4750(_0x570568[_0x4f6d('0x13')]['message']);}logger['error'](_0x4f6d('0x10'),_0x54f0be,_0x570568[_0x4f6d('0x13')][_0x4f6d('0x14')]);return _0x2575ac(_0x570568['error']['message']);}else{logger['info'](_0x4f6d('0x10'),_0x54f0be,_0x4f6d('0x11'));_0x2575ac(_0x570568[_0x4f6d('0x15')][_0x4f6d('0x14')]);}})[_0x4f6d('0x16')](function(_0x29e060){logger[_0x4f6d('0x13')](_0x4f6d('0x10'),_0x54f0be,_0x29e060);_0x3f4750(_0x29e060);});});}exports[_0x4f6d('0x17')]=function(_0x1ae761){var _0x49aaec=this;return new Promise(function(_0x4484a1,_0x15aefd){return db[_0x4f6d('0x18')]['findAll']({'raw':_0x1ae761[_0x4f6d('0x19')]?_0x1ae761[_0x4f6d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1ae761[_0x4f6d('0x19')]?_0x1ae761[_0x4f6d('0x19')][_0x4f6d('0x1a')]||null:null,'attributes':_0x1ae761['options']?_0x1ae761[_0x4f6d('0x19')]['attributes']||null:null,'limit':_0x1ae761[_0x4f6d('0x19')]?_0x1ae761[_0x4f6d('0x19')]['limit']||null:null,'include':_0x1ae761['options']?_0x1ae761[_0x4f6d('0x19')][_0x4f6d('0x1b')]?_[_0x4f6d('0x1c')](_0x1ae761[_0x4f6d('0x19')]['include'],function(_0xad2ecc){return{'model':db[_0xad2ecc[_0x4f6d('0x1d')]],'as':_0xad2ecc['as'],'attributes':_0xad2ecc[_0x4f6d('0x1e')],'include':_0xad2ecc[_0x4f6d('0x1b')]?_[_0x4f6d('0x1c')](_0xad2ecc[_0x4f6d('0x1b')],function(_0xd8a447){return{'model':db[_0xd8a447[_0x4f6d('0x1d')]],'as':_0xd8a447['as'],'attributes':_0xd8a447['attributes'],'include':_0xd8a447['include']?_['map'](_0xd8a447[_0x4f6d('0x1b')],function(_0x142531){return{'model':db[_0x142531['model']],'as':_0x142531['as'],'attributes':_0x142531['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f6d('0xe')](function(_0x1c7d59){logger[_0x4f6d('0xf')](_0x4f6d('0x17'),_0x1ae761);logger['debug'](_0x4f6d('0x17'),_0x1ae761,JSON[_0x4f6d('0x12')](_0x1c7d59));_0x4484a1(_0x1c7d59);})[_0x4f6d('0x16')](function(_0x12b8d4){logger['error'](_0x4f6d('0x17'),_0x12b8d4[_0x4f6d('0x14')],_0x1ae761);_0x15aefd(_0x49aaec[_0x4f6d('0x13')](0x1f4,_0x12b8d4['message']));});});}; \ No newline at end of file +var _0xfc03=['request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http'];(function(_0x52c1f6,_0x4eda0b){var _0x4df981=function(_0x71aa7){while(--_0x71aa7){_0x52c1f6['push'](_0x52c1f6['shift']());}};_0x4df981(++_0x4eda0b);}(_0xfc03,0xde));var _0x3fc0=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xfc03[_0x26f702];return _0x11417d;};'use strict';var _=require(_0x3fc0('0x0'));var util=require(_0x3fc0('0x1'));var moment=require(_0x3fc0('0x2'));var BPromise=require('bluebird');var rs=require(_0x3fc0('0x3'));var fs=require('fs');var Redis=require(_0x3fc0('0x4'));var db=require(_0x3fc0('0x5'))['db'];var utils=require(_0x3fc0('0x6'));var logger=require('../../config/logger')(_0x3fc0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3fc0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4434ba,_0x3c3c33,_0x3aa2f4){return new BPromise(function(_0x3fb1a3,_0x5d9c6b){return client[_0x3fc0('0x9')](_0x4434ba,_0x3aa2f4)[_0x3fc0('0xa')](function(_0x1e2e4e){logger[_0x3fc0('0xb')](_0x3fc0('0xc'),_0x3c3c33,_0x3fc0('0xd'));logger[_0x3fc0('0xe')](_0x3fc0('0xf'),_0x3c3c33,_0x3fc0('0xd'),JSON['stringify'](_0x1e2e4e));if(_0x1e2e4e['error']){if(_0x1e2e4e['error'][_0x3fc0('0x10')]===0x1f4){logger[_0x3fc0('0x11')]('MailServerIn,\x20%s,\x20%s',_0x3c3c33,_0x1e2e4e['error'][_0x3fc0('0x12')]);return _0x5d9c6b(_0x1e2e4e[_0x3fc0('0x11')][_0x3fc0('0x12')]);}logger[_0x3fc0('0x11')](_0x3fc0('0xc'),_0x3c3c33,_0x1e2e4e['error']['message']);return _0x3fb1a3(_0x1e2e4e[_0x3fc0('0x11')][_0x3fc0('0x12')]);}else{logger[_0x3fc0('0xb')]('MailServerIn,\x20%s,\x20%s',_0x3c3c33,_0x3fc0('0xd'));_0x3fb1a3(_0x1e2e4e[_0x3fc0('0x13')][_0x3fc0('0x12')]);}})[_0x3fc0('0x14')](function(_0x1c65f2){logger[_0x3fc0('0x11')]('MailServerIn,\x20%s,\x20%s',_0x3c3c33,_0x1c65f2);_0x5d9c6b(_0x1c65f2);});});}exports[_0x3fc0('0x15')]=function(_0x21f739){var _0x11e96c=this;return new Promise(function(_0x4954ea,_0x294a40){return db[_0x3fc0('0x16')][_0x3fc0('0x17')]({'raw':_0x21f739[_0x3fc0('0x18')]?_0x21f739[_0x3fc0('0x18')][_0x3fc0('0x19')]===undefined?!![]:![]:!![],'where':_0x21f739[_0x3fc0('0x18')]?_0x21f739['options'][_0x3fc0('0x1a')]||null:null,'attributes':_0x21f739[_0x3fc0('0x18')]?_0x21f739[_0x3fc0('0x18')][_0x3fc0('0x1b')]||null:null,'limit':_0x21f739[_0x3fc0('0x18')]?_0x21f739[_0x3fc0('0x18')][_0x3fc0('0x1c')]||null:null,'include':_0x21f739[_0x3fc0('0x18')]?_0x21f739[_0x3fc0('0x18')][_0x3fc0('0x1d')]?_[_0x3fc0('0x1e')](_0x21f739[_0x3fc0('0x18')][_0x3fc0('0x1d')],function(_0x918011){return{'model':db[_0x918011[_0x3fc0('0x1f')]],'as':_0x918011['as'],'attributes':_0x918011['attributes'],'include':_0x918011[_0x3fc0('0x1d')]?_[_0x3fc0('0x1e')](_0x918011[_0x3fc0('0x1d')],function(_0x5dbb6f){return{'model':db[_0x5dbb6f[_0x3fc0('0x1f')]],'as':_0x5dbb6f['as'],'attributes':_0x5dbb6f[_0x3fc0('0x1b')],'include':_0x5dbb6f[_0x3fc0('0x1d')]?_[_0x3fc0('0x1e')](_0x5dbb6f['include'],function(_0xaf7f5f){return{'model':db[_0xaf7f5f['model']],'as':_0xaf7f5f['as'],'attributes':_0xaf7f5f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4404b7){logger['info'](_0x3fc0('0x15'),_0x21f739);logger[_0x3fc0('0xe')](_0x3fc0('0x15'),_0x21f739,JSON[_0x3fc0('0x20')](_0x4404b7));_0x4954ea(_0x4404b7);})[_0x3fc0('0x14')](function(_0x2eff72){logger[_0x3fc0('0x11')]('GetMailServerIn',_0x2eff72[_0x3fc0('0x12')],_0x21f739);_0x294a40(_0x11e96c[_0x3fc0('0x11')](0x1f4,_0x2eff72[_0x3fc0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index a836f2c..0370263 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 _0x950a=['express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','post','create','put','delete','destroy','exports','path','connect-timeout'];(function(_0x56e00f,_0x55de3b){var _0x16c4bf=function(_0x40aba4){while(--_0x40aba4){_0x56e00f['push'](_0x56e00f['shift']());}};_0x16c4bf(++_0x55de3b);}(_0x950a,0x186));var _0xa950=function(_0x26e780,_0x5465ba){_0x26e780=_0x26e780-0x0;var _0x2e9594=_0x950a[_0x26e780];return _0x2e9594;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa950('0x0'));var timeout=require(_0xa950('0x1'));var express=require(_0xa950('0x2'));var router=express['Router']();var auth=require(_0xa950('0x3'));var interaction=require(_0xa950('0x4'));var config=require('../../config/environment');var controller=require('./mailServerOut.controller');router[_0xa950('0x5')]('/',auth[_0xa950('0x6')](),controller['index']);router[_0xa950('0x5')]('/:id',auth[_0xa950('0x6')](),controller[_0xa950('0x7')]);router[_0xa950('0x8')]('/',auth[_0xa950('0x6')](),controller[_0xa950('0x9')]);router[_0xa950('0xa')]('/:id',auth[_0xa950('0x6')](),controller['update']);router[_0xa950('0xb')]('/:id',auth[_0xa950('0x6')](),controller[_0xa950('0xc')]);module[_0xa950('0xd')]=router; \ No newline at end of file +var _0x5c37=['express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x2bccd4,_0x3d4a58){var _0x434602=function(_0x2d468e){while(--_0x2d468e){_0x2bccd4['push'](_0x2bccd4['shift']());}};_0x434602(++_0x3d4a58);}(_0x5c37,0x96));var _0x75c3=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0x5c37[_0x381379];return _0x3e1063;};'use strict';var multer=require(_0x75c3('0x0'));var util=require(_0x75c3('0x1'));var path=require(_0x75c3('0x2'));var timeout=require('connect-timeout');var express=require(_0x75c3('0x3'));var router=express[_0x75c3('0x4')]();var auth=require(_0x75c3('0x5'));var interaction=require(_0x75c3('0x6'));var config=require('../../config/environment');var controller=require('./mailServerOut.controller');router[_0x75c3('0x7')]('/',auth[_0x75c3('0x8')](),controller['index']);router['get']('/:id',auth[_0x75c3('0x8')](),controller[_0x75c3('0x9')]);router['post']('/',auth[_0x75c3('0x8')](),controller[_0x75c3('0xa')]);router[_0x75c3('0xb')](_0x75c3('0xc'),auth[_0x75c3('0x8')](),controller[_0x75c3('0xd')]);router[_0x75c3('0xe')](_0x75c3('0xc'),auth[_0x75c3('0x8')](),controller[_0x75c3('0xf')]);module[_0x75c3('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 65388d0..328c7a1 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 _0xb619=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x433b93,_0x40db4f){var _0x116edd=function(_0x62fb77){while(--_0x62fb77){_0x433b93['push'](_0x433b93['shift']());}};_0x116edd(++_0x40db4f);}(_0xb619,0x14e));var _0x9b61=function(_0x5ce43f,_0x150909){_0x5ce43f=_0x5ce43f-0x0;var _0x13d1f2=_0xb619[_0x5ce43f];return _0x13d1f2;};'use strict';var Sequelize=require(_0x9b61('0x0'));module[_0x9b61('0x1')]={'description':{'type':Sequelize[_0x9b61('0x2')]},'host':{'type':Sequelize[_0x9b61('0x2')]},'user':{'type':Sequelize[_0x9b61('0x2')]},'pass':{'type':Sequelize[_0x9b61('0x2')]},'port':{'type':Sequelize[_0x9b61('0x3')]},'secure':{'type':Sequelize[_0x9b61('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x9b61('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x2453=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x438856,_0x3cb432){var _0x18692d=function(_0x20aeb4){while(--_0x20aeb4){_0x438856['push'](_0x438856['shift']());}};_0x18692d(++_0x3cb432);}(_0x2453,0xa9));var _0x3245=function(_0xb3a3b9,_0x323427){_0xb3a3b9=_0xb3a3b9-0x0;var _0x2de1bb=_0x2453[_0xb3a3b9];return _0x2de1bb;};'use strict';var Sequelize=require(_0x3245('0x0'));module[_0x3245('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x3245('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x3245('0x2')]},'port':{'type':Sequelize[_0x3245('0x3')]},'secure':{'type':Sequelize[_0x3245('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x3245('0x2')]},'authentication':{'type':Sequelize[_0x3245('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 21189a7..17f887f 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 _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','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','Content-Range','apply','reject','save','then','error','stack','send','index','MailServerOut','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x5cb29e,_0x237e9d){var _0x462274=function(_0x187343){while(--_0x187343){_0x5cb29e['push'](_0x5cb29e['shift']());}};_0x462274(++_0x237e9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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['MailServerOut'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['MailServerOut']['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['MailServerOut'][_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));}; \ No newline at end of file +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','MailServerOut','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(_0x1b22bb,_0x3fd5cf){var _0x4611b5=function(_0x3f2db6){while(--_0x3f2db6){_0x1b22bb['push'](_0x1b22bb['shift']());}};_0x4611b5(++_0x3fd5cf);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'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['MailServerOut'][_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['MailServerOut'][_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 diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 9b30d60..f8a0d68 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 _0x8375=['define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','moment','bluebird','request-promise','./mailServerOut.attributes','exports'];(function(_0x1f951b,_0x654997){var _0x503af0=function(_0x40a7d9){while(--_0x40a7d9){_0x1f951b['push'](_0x1f951b['shift']());}};_0x503af0(++_0x654997);}(_0x8375,0xa8));var _0x5837=function(_0x2874b5,_0x5d49fe){_0x2874b5=_0x2874b5-0x0;var _0x4cd03c=_0x8375[_0x2874b5];return _0x4cd03c;};'use strict';var _=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var logger=require(_0x5837('0x2'))('api');var moment=require(_0x5837('0x3'));var BPromise=require(_0x5837('0x4'));var rp=require(_0x5837('0x5'));var attributes=require(_0x5837('0x6'));module[_0x5837('0x7')]=function(_0x1edfc5,_0x5e32d8){return _0x1edfc5[_0x5837('0x8')](_0x5837('0x9'),attributes,{'tableName':_0x5837('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3831=['bluebird','request-promise','exports','lodash','../../config/logger','api','moment'];(function(_0x451104,_0x44850b){var _0x1ce890=function(_0x366691){while(--_0x366691){_0x451104['push'](_0x451104['shift']());}};_0x1ce890(++_0x44850b);}(_0x3831,0x14c));var _0x1383=function(_0x437e08,_0x1cab6c){_0x437e08=_0x437e08-0x0;var _0xcf57f2=_0x3831[_0x437e08];return _0xcf57f2;};'use strict';var _=require(_0x1383('0x0'));var util=require('util');var logger=require(_0x1383('0x1'))(_0x1383('0x2'));var moment=require(_0x1383('0x3'));var BPromise=require(_0x1383('0x4'));var rp=require(_0x1383('0x5'));var attributes=require('./mailServerOut.attributes');module[_0x1383('0x6')]=function(_0x573874,_0x21ea2c){return _0x573874['define']('MailServerOut',attributes,{'tableName':'mail_servers_out','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 7f106c0..55641ff 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 _0xf44c=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x44bac4,_0x2c07a6){var _0x2e60fd=function(_0x486ecb){while(--_0x486ecb){_0x44bac4['push'](_0x44bac4['shift']());}};_0x2e60fd(++_0x2c07a6);}(_0xf44c,0xd2));var _0xcf44=function(_0x28cc3d,_0x3a0d54){_0x28cc3d=_0x28cc3d-0x0;var _0x14cfdf=_0xf44c[_0x28cc3d];return _0x14cfdf;};'use strict';var _=require(_0xcf44('0x0'));var util=require(_0xcf44('0x1'));var moment=require(_0xcf44('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf44('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf44('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf44('0x5'))('rpc');var config=require(_0xcf44('0x6'));var jayson=require(_0xcf44('0x7'));var client=jayson['client'][_0xcf44('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x191ac8,_0x4f3fa5,_0x3e7be4){return new BPromise(function(_0xb74167,_0x4b17d4){return client[_0xcf44('0x9')](_0x191ac8,_0x3e7be4)[_0xcf44('0xa')](function(_0x2d1ed7){logger[_0xcf44('0xb')](_0xcf44('0xc'),_0x4f3fa5,_0xcf44('0xd'));logger[_0xcf44('0xe')](_0xcf44('0xf'),_0x4f3fa5,_0xcf44('0xd'),JSON['stringify'](_0x2d1ed7));if(_0x2d1ed7[_0xcf44('0x10')]){if(_0x2d1ed7[_0xcf44('0x10')]['code']===0x1f4){logger[_0xcf44('0x10')](_0xcf44('0xc'),_0x4f3fa5,_0x2d1ed7[_0xcf44('0x10')][_0xcf44('0x11')]);return _0x4b17d4(_0x2d1ed7[_0xcf44('0x10')][_0xcf44('0x11')]);}logger['error'](_0xcf44('0xc'),_0x4f3fa5,_0x2d1ed7[_0xcf44('0x10')][_0xcf44('0x11')]);return _0xb74167(_0x2d1ed7[_0xcf44('0x10')][_0xcf44('0x11')]);}else{logger['info'](_0xcf44('0xc'),_0x4f3fa5,'request\x20sent');_0xb74167(_0x2d1ed7[_0xcf44('0x12')]['message']);}})[_0xcf44('0x13')](function(_0x2e7730){logger[_0xcf44('0x10')](_0xcf44('0xc'),_0x4f3fa5,_0x2e7730);_0x4b17d4(_0x2e7730);});});} \ No newline at end of file +var _0x83a0=['client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1cf95c,_0x4bd6f6){var _0x5245b6=function(_0xab1d9c){while(--_0xab1d9c){_0x1cf95c['push'](_0x1cf95c['shift']());}};_0x5245b6(++_0x4bd6f6);}(_0x83a0,0xc5));var _0x083a=function(_0x44766f,_0x2d31ae){_0x44766f=_0x44766f-0x0;var _0x227d88=_0x83a0[_0x44766f];return _0x227d88;};'use strict';var _=require(_0x083a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x083a('0x1'));var rs=require(_0x083a('0x2'));var fs=require('fs');var Redis=require(_0x083a('0x3'));var db=require(_0x083a('0x4'))['db'];var utils=require(_0x083a('0x5'));var logger=require(_0x083a('0x6'))(_0x083a('0x7'));var config=require(_0x083a('0x8'));var jayson=require(_0x083a('0x9'));var client=jayson[_0x083a('0xa')][_0x083a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc09dc3,_0x57214d,_0xc3777){return new BPromise(function(_0x4f5a09,_0xabda14){return client[_0x083a('0xc')](_0xc09dc3,_0xc3777)[_0x083a('0xd')](function(_0x584fe4){logger[_0x083a('0xe')](_0x083a('0xf'),_0x57214d,_0x083a('0x10'));logger[_0x083a('0x11')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x57214d,_0x083a('0x10'),JSON[_0x083a('0x12')](_0x584fe4));if(_0x584fe4[_0x083a('0x13')]){if(_0x584fe4['error'][_0x083a('0x14')]===0x1f4){logger[_0x083a('0x13')]('MailServerOut,\x20%s,\x20%s',_0x57214d,_0x584fe4['error'][_0x083a('0x15')]);return _0xabda14(_0x584fe4['error'][_0x083a('0x15')]);}logger[_0x083a('0x13')]('MailServerOut,\x20%s,\x20%s',_0x57214d,_0x584fe4[_0x083a('0x13')][_0x083a('0x15')]);return _0x4f5a09(_0x584fe4[_0x083a('0x13')]['message']);}else{logger[_0x083a('0xe')](_0x083a('0xf'),_0x57214d,_0x083a('0x10'));_0x4f5a09(_0x584fe4[_0x083a('0x16')][_0x083a('0x15')]);}})['catch'](function(_0x33167d){logger[_0x083a('0x13')](_0x083a('0xf'),_0x57214d,_0x33167d);_0xabda14(_0x33167d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index d197318..96ba818 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 _0x63a0=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','isAuthenticated','index','get','/describe','/:id','show','post'];(function(_0x1ec7b0,_0x2eb52a){var _0x5aff54=function(_0x1af5e6){while(--_0x1af5e6){_0x1ec7b0['push'](_0x1ec7b0['shift']());}};_0x5aff54(++_0x2eb52a);}(_0x63a0,0x16e));var _0x063a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x63a0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x063a('0x0'));var util=require(_0x063a('0x1'));var path=require(_0x063a('0x2'));var timeout=require(_0x063a('0x3'));var express=require(_0x063a('0x4'));var router=express[_0x063a('0x5')]();var auth=require(_0x063a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router['get']('/',auth[_0x063a('0x7')](),controller[_0x063a('0x8')]);router[_0x063a('0x9')](_0x063a('0xa'),auth[_0x063a('0x7')](),controller['describe']);router[_0x063a('0x9')](_0x063a('0xb'),auth[_0x063a('0x7')](),controller[_0x063a('0xc')]);router[_0x063a('0xd')]('/',auth['isAuthenticated'](),controller[_0x063a('0xe')]);router[_0x063a('0xf')](_0x063a('0xb'),auth[_0x063a('0x7')](),controller[_0x063a('0x10')]);router[_0x063a('0x11')](_0x063a('0xb'),auth[_0x063a('0x7')](),controller[_0x063a('0x12')]);module['exports']=router; \ No newline at end of file +var _0x752d=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer'];(function(_0x7a0cc7,_0x1ae700){var _0x37408c=function(_0x192de3){while(--_0x192de3){_0x7a0cc7['push'](_0x7a0cc7['shift']());}};_0x37408c(++_0x1ae700);}(_0x752d,0xaf));var _0xd752=function(_0x565094,_0x475a80){_0x565094=_0x565094-0x0;var _0x1e35c6=_0x752d[_0x565094];return _0x1e35c6;};'use strict';var multer=require(_0xd752('0x0'));var util=require(_0xd752('0x1'));var path=require(_0xd752('0x2'));var timeout=require(_0xd752('0x3'));var express=require(_0xd752('0x4'));var router=express[_0xd752('0x5')]();var auth=require(_0xd752('0x6'));var interaction=require(_0xd752('0x7'));var config=require(_0xd752('0x8'));var controller=require(_0xd752('0x9'));router[_0xd752('0xa')]('/',auth[_0xd752('0xb')](),controller['index']);router[_0xd752('0xa')](_0xd752('0xc'),auth[_0xd752('0xb')](),controller[_0xd752('0xd')]);router[_0xd752('0xa')](_0xd752('0xe'),auth['isAuthenticated'](),controller[_0xd752('0xf')]);router[_0xd752('0x10')]('/',auth[_0xd752('0xb')](),controller[_0xd752('0x11')]);router[_0xd752('0x12')](_0xd752('0xe'),auth[_0xd752('0xb')](),controller['update']);router[_0xd752('0x13')](_0xd752('0xe'),auth[_0xd752('0xb')](),controller[_0xd752('0x14')]);module[_0xd752('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index ae68bfd..3911cd8 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 _0xdb94=['exports','STRING','name','sequelize'];(function(_0x36bf1b,_0x1b8bc9){var _0x49c980=function(_0xd2122f){while(--_0xd2122f){_0x36bf1b['push'](_0x36bf1b['shift']());}};_0x49c980(++_0x1b8bc9);}(_0xdb94,0xab));var _0x4db9=function(_0x28b402,_0x29011a){_0x28b402=_0x28b402-0x0;var _0x2d4474=_0xdb94[_0x28b402];return _0x2d4474;};'use strict';var Sequelize=require(_0x4db9('0x0'));module[_0x4db9('0x1')]={'name':{'type':Sequelize[_0x4db9('0x2')],'unique':_0x4db9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4db9('0x2')]}}; \ No newline at end of file +var _0x42f4=['STRING','name','sequelize'];(function(_0x2ba9ac,_0xa1fdc4){var _0x1b0fc9=function(_0x4343de){while(--_0x4343de){_0x2ba9ac['push'](_0x2ba9ac['shift']());}};_0x1b0fc9(++_0xa1fdc4);}(_0x42f4,0x19d));var _0x442f=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0x42f4[_0x35a274];return _0x40d905;};'use strict';var Sequelize=require(_0x442f('0x0'));module['exports']={'name':{'type':Sequelize[_0x442f('0x1')],'unique':_0x442f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x442f('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index d118d00..349d2cc 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 _0x195f=['../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','destroy','then','end','error','stack','name','send','index','MailSubstatus','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','include','rows','catch','show','params','includeAll','merge','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api'];(function(_0x3dea7d,_0x2cd4ea){var _0x53919a=function(_0x1554e2){while(--_0x1554e2){_0x3dea7d['push'](_0x3dea7d['shift']());}};_0x53919a(++_0x2cd4ea);}(_0x195f,0x113));var _0xf195=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0x195f[_0x58c20f];return _0x3b0318;};'use strict';var pdf=require(_0xf195('0x0'));var emlformat=require(_0xf195('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf195('0x2'));var jsonpatch=require(_0xf195('0x3'));var rp=require('request-promise');var moment=require(_0xf195('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf195('0x5'));var util=require(_0xf195('0x6'));var path=require(_0xf195('0x7'));var sox=require(_0xf195('0x8'));var csv=require(_0xf195('0x9'));var ejs=require(_0xf195('0xa'));var fs=require('fs');var _=require(_0xf195('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf195('0xc'));var deskjs=require(_0xf195('0xd'));var toCsv=require(_0xf195('0x9'));var querystring=require(_0xf195('0xe'));var Papa=require(_0xf195('0xf'));var authService=require(_0xf195('0x10'));var hardwareService=require(_0xf195('0x11'));var Redis=require('ioredis');var qs=require(_0xf195('0x12'));var logger=require(_0xf195('0x13'))(_0xf195('0x14'));var utils=require('../../config/utils');var config=require(_0xf195('0x15'));var db=require(_0xf195('0x16'))['db'];function respondWithStatusCode(_0x153fc3,_0x3113d1){_0x3113d1=_0x3113d1||0xcc;return function(_0x48c9d9){if(_0x48c9d9){return _0x153fc3[_0xf195('0x17')](_0x3113d1);}return _0x153fc3[_0xf195('0x18')](_0x3113d1)['end']();};}function respondWithResult(_0x33d5f0,_0x5db10b){_0x5db10b=_0x5db10b||0xc8;return function(_0x3d06cc){if(_0x3d06cc){return _0x33d5f0[_0xf195('0x18')](_0x5db10b)[_0xf195('0x19')](_0x3d06cc);}};}function respondWithFilteredResult(_0x41a77d,_0x27ac95){return function(_0x33b5c4){if(_0x33b5c4){var _0x5041fd=_0x33b5c4[_0xf195('0x1a')],_0xe76164=_0x27ac95[_0xf195('0x1b')],_0x4c1956=_0x27ac95[_0xf195('0x1b')]+_0x27ac95[_0xf195('0x1c')],_0x56c2d7;if(_0x4c1956>=_0x5041fd){_0x4c1956=_0x5041fd;_0x56c2d7=0xc8;}else{_0x56c2d7=0xce;}_0x41a77d['status'](_0x56c2d7);return _0x41a77d[_0xf195('0x1d')](_0xf195('0x1e'),_0xe76164+'-'+_0x4c1956+'/'+_0x5041fd)['json'](_0x33b5c4);}return null;};}function patchUpdates(_0x452931){return function(_0x2c6bfd){try{jsonpatch['apply'](_0x2c6bfd,_0x452931,!![]);}catch(_0x15acd6){return BPromise[_0xf195('0x1f')](_0x15acd6);}return _0x2c6bfd['save']();};}function saveUpdates(_0x1d5168,_0x26dfea){return function(_0x421cab){if(_0x421cab){return _0x421cab[_0xf195('0x20')](_0x1d5168)['then'](function(_0x5933f0){return _0x5933f0;});}return null;};}function removeEntity(_0x5cfc82,_0x35264e){return function(_0x1b2821){if(_0x1b2821){return _0x1b2821[_0xf195('0x21')]()[_0xf195('0x22')](function(){_0x5cfc82[_0xf195('0x18')](0xcc)[_0xf195('0x23')]();});}};}function handleEntityNotFound(_0x3d3d14,_0x1ee8d6){return function(_0x45cfa4){if(!_0x45cfa4){_0x3d3d14[_0xf195('0x17')](0x194);}return _0x45cfa4;};}function handleError(_0x45ebf9,_0x1481ae){_0x1481ae=_0x1481ae||0x1f4;return function(_0x4fc393){logger[_0xf195('0x24')](_0x4fc393[_0xf195('0x25')]);if(_0x4fc393[_0xf195('0x26')]){delete _0x4fc393[_0xf195('0x26')];}_0x45ebf9[_0xf195('0x18')](_0x1481ae)[_0xf195('0x27')](_0x4fc393);};}exports[_0xf195('0x28')]=function(_0x3c1371,_0x4bd815){var _0x583255={},_0x190b43={},_0x37d9e9={'count':0x0,'rows':[]};var _0x44ebeb=db[_0xf195('0x29')][_0xf195('0x2a')];_0x190b43[_0xf195('0x2b')]=_[_0xf195('0x2c')](_0x44ebeb);_0x190b43[_0xf195('0x2d')]=_[_0xf195('0x2c')](_0x3c1371[_0xf195('0x2d')]);_0x190b43[_0xf195('0x2e')]=_[_0xf195('0x2f')](_0x190b43[_0xf195('0x2b')],_0x190b43[_0xf195('0x2d')]);_0x583255[_0xf195('0x30')]=_[_0xf195('0x2f')](_0x190b43[_0xf195('0x2b')],qs[_0xf195('0x31')](_0x3c1371[_0xf195('0x2d')]['fields']));_0x583255[_0xf195('0x30')]=_0x583255[_0xf195('0x30')][_0xf195('0x32')]?_0x583255[_0xf195('0x30')]:_0x190b43[_0xf195('0x2b')];if(!_0x3c1371[_0xf195('0x2d')][_0xf195('0x33')](_0xf195('0x34'))){_0x583255[_0xf195('0x1c')]=qs[_0xf195('0x1c')](_0x3c1371[_0xf195('0x2d')][_0xf195('0x1c')]);_0x583255[_0xf195('0x1b')]=qs[_0xf195('0x1b')](_0x3c1371[_0xf195('0x2d')][_0xf195('0x1b')]);}_0x583255[_0xf195('0x35')]=qs['sort'](_0x3c1371[_0xf195('0x2d')][_0xf195('0x36')]);_0x583255[_0xf195('0x37')]=qs[_0xf195('0x2e')](_[_0xf195('0x38')](_0x3c1371['query'],_0x190b43[_0xf195('0x2e')]));if(_0x3c1371[_0xf195('0x2d')][_0xf195('0x39')]){_0x583255['where']=_['merge'](_0x583255[_0xf195('0x37')],{'$or':_[_0xf195('0x3a')](_0x44ebeb,function(_0x2814f6){if(_0x2814f6[_0xf195('0x3b')][_0xf195('0x3c')]!==_0xf195('0x3d')){var _0x23ff48={};_0x23ff48[_0x2814f6[_0xf195('0x3e')]]={'$like':'%'+_0x3c1371[_0xf195('0x2d')][_0xf195('0x39')]+'%'};return _0x23ff48;}})});}_0x583255=_['merge']({},_0x583255,_0x3c1371['options']);var _0x218b6b={'where':_0x583255[_0xf195('0x37')]};return db[_0xf195('0x29')][_0xf195('0x1a')](_0x218b6b)[_0xf195('0x22')](function(_0x3e58b2){_0x37d9e9[_0xf195('0x1a')]=_0x3e58b2;if(_0x3c1371[_0xf195('0x2d')]['includeAll']){_0x583255[_0xf195('0x3f')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x583255);})[_0xf195('0x22')](function(_0x83c396){_0x37d9e9[_0xf195('0x40')]=_0x83c396;return _0x37d9e9;})[_0xf195('0x22')](respondWithFilteredResult(_0x4bd815,_0x583255))[_0xf195('0x41')](handleError(_0x4bd815,null));};exports[_0xf195('0x42')]=function(_0x7f9360,_0x9a0873){var _0x35d385={'raw':!![],'where':{'id':_0x7f9360[_0xf195('0x43')]['id']}},_0x2ab4c3={};_0x2ab4c3[_0xf195('0x2b')]=_[_0xf195('0x2c')](db[_0xf195('0x29')]['rawAttributes']);_0x2ab4c3['query']=_[_0xf195('0x2c')](_0x7f9360[_0xf195('0x2d')]);_0x2ab4c3[_0xf195('0x2e')]=_[_0xf195('0x2f')](_0x2ab4c3[_0xf195('0x2b')],_0x2ab4c3[_0xf195('0x2d')]);_0x35d385[_0xf195('0x30')]=_[_0xf195('0x2f')](_0x2ab4c3['model'],qs[_0xf195('0x31')](_0x7f9360[_0xf195('0x2d')][_0xf195('0x31')]));_0x35d385[_0xf195('0x30')]=_0x35d385[_0xf195('0x30')][_0xf195('0x32')]?_0x35d385[_0xf195('0x30')]:_0x2ab4c3['model'];if(_0x7f9360[_0xf195('0x2d')][_0xf195('0x44')]){_0x35d385['include']=[{'all':!![]}];}_0x35d385=_[_0xf195('0x45')]({},_0x35d385,_0x7f9360['options']);return db[_0xf195('0x29')][_0xf195('0x46')](_0x35d385)[_0xf195('0x22')](handleEntityNotFound(_0x9a0873,null))['then'](respondWithResult(_0x9a0873,null))[_0xf195('0x41')](handleError(_0x9a0873,null));};exports[_0xf195('0x47')]=function(_0x5e48ed,_0x308b13){return db[_0xf195('0x29')][_0xf195('0x47')](_0x5e48ed[_0xf195('0x48')],{})[_0xf195('0x22')](respondWithResult(_0x308b13,0xc9))['catch'](handleError(_0x308b13,null));};exports[_0xf195('0x20')]=function(_0x42447c,_0xd4358e){if(_0x42447c[_0xf195('0x48')]['id']){delete _0x42447c[_0xf195('0x48')]['id'];}return db[_0xf195('0x29')][_0xf195('0x46')]({'where':{'id':_0x42447c[_0xf195('0x43')]['id']}})['then'](handleEntityNotFound(_0xd4358e,null))[_0xf195('0x22')](saveUpdates(_0x42447c['body'],null))[_0xf195('0x22')](respondWithResult(_0xd4358e,null))[_0xf195('0x41')](handleError(_0xd4358e,null));};exports[_0xf195('0x21')]=function(_0x42f895,_0x2e56ea){return db[_0xf195('0x29')][_0xf195('0x46')]({'where':{'id':_0x42f895[_0xf195('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e56ea,null))[_0xf195('0x22')](removeEntity(_0x2e56ea,null))['catch'](handleError(_0x2e56ea,null));};exports[_0xf195('0x49')]=function(_0x2e29d9,_0x2d09d2){return db[_0xf195('0x29')][_0xf195('0x49')]()['then'](respondWithResult(_0x2d09d2,null))[_0xf195('0x41')](handleError(_0x2d09d2,null));}; \ No newline at end of file +var _0x8d0a=['desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','MailSubstatus','rawAttributes','keys','query','model','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','merge','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x5a4d4c,_0x2bef70){var _0x561128=function(_0x52a32c){while(--_0x52a32c){_0x5a4d4c['push'](_0x5a4d4c['shift']());}};_0x561128(++_0x2bef70);}(_0x8d0a,0x172));var _0xa8d0=function(_0x255d98,_0x1315c1){_0x255d98=_0x255d98-0x0;var _0x40ec9f=_0x8d0a[_0x255d98];return _0x40ec9f;};'use strict';var pdf=require(_0xa8d0('0x0'));var emlformat=require(_0xa8d0('0x1'));var rimraf=require(_0xa8d0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa8d0('0x3'));var rp=require(_0xa8d0('0x4'));var moment=require('moment');var BPromise=require(_0xa8d0('0x5'));var Mustache=require(_0xa8d0('0x6'));var util=require(_0xa8d0('0x7'));var path=require('path');var sox=require(_0xa8d0('0x8'));var csv=require(_0xa8d0('0x9'));var ejs=require(_0xa8d0('0xa'));var fs=require('fs');var _=require(_0xa8d0('0xb'));var squel=require(_0xa8d0('0xc'));var crypto=require(_0xa8d0('0xd'));var jsforce=require(_0xa8d0('0xe'));var deskjs=require(_0xa8d0('0xf'));var toCsv=require(_0xa8d0('0x9'));var querystring=require(_0xa8d0('0x10'));var Papa=require(_0xa8d0('0x11'));var authService=require(_0xa8d0('0x12'));var hardwareService=require(_0xa8d0('0x13'));var Redis=require(_0xa8d0('0x14'));var qs=require(_0xa8d0('0x15'));var logger=require(_0xa8d0('0x16'))(_0xa8d0('0x17'));var utils=require(_0xa8d0('0x18'));var config=require(_0xa8d0('0x19'));var db=require(_0xa8d0('0x1a'))['db'];function respondWithStatusCode(_0x4d7543,_0x5caa24){_0x5caa24=_0x5caa24||0xcc;return function(_0x318fb1){if(_0x318fb1){return _0x4d7543[_0xa8d0('0x1b')](_0x5caa24);}return _0x4d7543['status'](_0x5caa24)['end']();};}function respondWithResult(_0x16093f,_0x2af6fc){_0x2af6fc=_0x2af6fc||0xc8;return function(_0x3ecc36){if(_0x3ecc36){return _0x16093f[_0xa8d0('0x1c')](_0x2af6fc)[_0xa8d0('0x1d')](_0x3ecc36);}};}function respondWithFilteredResult(_0x18f935,_0x192b0a){return function(_0x1daf70){if(_0x1daf70){var _0x2871cb=_0x1daf70[_0xa8d0('0x1e')],_0x238e85=_0x192b0a[_0xa8d0('0x1f')],_0xfa19ee=_0x192b0a['offset']+_0x192b0a[_0xa8d0('0x20')],_0x575f69;if(_0xfa19ee>=_0x2871cb){_0xfa19ee=_0x2871cb;_0x575f69=0xc8;}else{_0x575f69=0xce;}_0x18f935[_0xa8d0('0x1c')](_0x575f69);return _0x18f935[_0xa8d0('0x21')](_0xa8d0('0x22'),_0x238e85+'-'+_0xfa19ee+'/'+_0x2871cb)[_0xa8d0('0x1d')](_0x1daf70);}return null;};}function patchUpdates(_0x48e8c5){return function(_0x35554e){try{jsonpatch[_0xa8d0('0x23')](_0x35554e,_0x48e8c5,!![]);}catch(_0x213de2){return BPromise[_0xa8d0('0x24')](_0x213de2);}return _0x35554e[_0xa8d0('0x25')]();};}function saveUpdates(_0x16e479,_0x21a6ca){return function(_0x595452){if(_0x595452){return _0x595452[_0xa8d0('0x26')](_0x16e479)[_0xa8d0('0x27')](function(_0x3c8843){return _0x3c8843;});}return null;};}function removeEntity(_0x3ceb45,_0x4b003f){return function(_0x31cf4f){if(_0x31cf4f){return _0x31cf4f[_0xa8d0('0x28')]()[_0xa8d0('0x27')](function(){_0x3ceb45[_0xa8d0('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x150080,_0x30a566){return function(_0x20ae2c){if(!_0x20ae2c){_0x150080[_0xa8d0('0x1b')](0x194);}return _0x20ae2c;};}function handleError(_0x55e6e0,_0x35b4a6){_0x35b4a6=_0x35b4a6||0x1f4;return function(_0x3e5d26){logger[_0xa8d0('0x29')](_0x3e5d26['stack']);if(_0x3e5d26[_0xa8d0('0x2a')]){delete _0x3e5d26['name'];}_0x55e6e0[_0xa8d0('0x1c')](_0x35b4a6)[_0xa8d0('0x2b')](_0x3e5d26);};}exports['index']=function(_0x5d7292,_0x216045){var _0x5d9a04={},_0x312a29={},_0x327673={'count':0x0,'rows':[]};var _0x3cc8fd=db[_0xa8d0('0x2c')][_0xa8d0('0x2d')];_0x312a29['model']=_[_0xa8d0('0x2e')](_0x3cc8fd);_0x312a29[_0xa8d0('0x2f')]=_[_0xa8d0('0x2e')](_0x5d7292['query']);_0x312a29['filters']=_['intersection'](_0x312a29[_0xa8d0('0x30')],_0x312a29[_0xa8d0('0x2f')]);_0x5d9a04[_0xa8d0('0x31')]=_[_0xa8d0('0x32')](_0x312a29[_0xa8d0('0x30')],qs[_0xa8d0('0x33')](_0x5d7292[_0xa8d0('0x2f')]['fields']));_0x5d9a04[_0xa8d0('0x31')]=_0x5d9a04['attributes'][_0xa8d0('0x34')]?_0x5d9a04['attributes']:_0x312a29['model'];if(!_0x5d7292['query']['hasOwnProperty'](_0xa8d0('0x35'))){_0x5d9a04[_0xa8d0('0x20')]=qs['limit'](_0x5d7292['query'][_0xa8d0('0x20')]);_0x5d9a04[_0xa8d0('0x1f')]=qs[_0xa8d0('0x1f')](_0x5d7292[_0xa8d0('0x2f')][_0xa8d0('0x1f')]);}_0x5d9a04['order']=qs['sort'](_0x5d7292[_0xa8d0('0x2f')][_0xa8d0('0x36')]);_0x5d9a04[_0xa8d0('0x37')]=qs[_0xa8d0('0x38')](_[_0xa8d0('0x39')](_0x5d7292[_0xa8d0('0x2f')],_0x312a29['filters']));if(_0x5d7292[_0xa8d0('0x2f')][_0xa8d0('0x3a')]){_0x5d9a04[_0xa8d0('0x37')]=_['merge'](_0x5d9a04[_0xa8d0('0x37')],{'$or':_[_0xa8d0('0x3b')](_0x3cc8fd,function(_0x285f08){if(_0x285f08[_0xa8d0('0x3c')][_0xa8d0('0x3d')]!==_0xa8d0('0x3e')){var _0x133d39={};_0x133d39[_0x285f08[_0xa8d0('0x3f')]]={'$like':'%'+_0x5d7292[_0xa8d0('0x2f')][_0xa8d0('0x3a')]+'%'};return _0x133d39;}})});}_0x5d9a04=_[_0xa8d0('0x40')]({},_0x5d9a04,_0x5d7292['options']);var _0x232515={'where':_0x5d9a04['where']};return db[_0xa8d0('0x2c')][_0xa8d0('0x1e')](_0x232515)[_0xa8d0('0x27')](function(_0x584f75){_0x327673[_0xa8d0('0x1e')]=_0x584f75;if(_0x5d7292[_0xa8d0('0x2f')][_0xa8d0('0x41')]){_0x5d9a04['include']=[{'all':!![]}];}return db[_0xa8d0('0x2c')][_0xa8d0('0x42')](_0x5d9a04);})[_0xa8d0('0x27')](function(_0x3c3080){_0x327673[_0xa8d0('0x43')]=_0x3c3080;return _0x327673;})[_0xa8d0('0x27')](respondWithFilteredResult(_0x216045,_0x5d9a04))[_0xa8d0('0x44')](handleError(_0x216045,null));};exports[_0xa8d0('0x45')]=function(_0x2e2778,_0x48399a){var _0x21371d={'raw':!![],'where':{'id':_0x2e2778[_0xa8d0('0x46')]['id']}},_0x1193f6={};_0x1193f6[_0xa8d0('0x30')]=_[_0xa8d0('0x2e')](db[_0xa8d0('0x2c')][_0xa8d0('0x2d')]);_0x1193f6[_0xa8d0('0x2f')]=_[_0xa8d0('0x2e')](_0x2e2778['query']);_0x1193f6[_0xa8d0('0x38')]=_['intersection'](_0x1193f6[_0xa8d0('0x30')],_0x1193f6[_0xa8d0('0x2f')]);_0x21371d['attributes']=_[_0xa8d0('0x32')](_0x1193f6['model'],qs[_0xa8d0('0x33')](_0x2e2778[_0xa8d0('0x2f')][_0xa8d0('0x33')]));_0x21371d['attributes']=_0x21371d['attributes'][_0xa8d0('0x34')]?_0x21371d[_0xa8d0('0x31')]:_0x1193f6[_0xa8d0('0x30')];if(_0x2e2778[_0xa8d0('0x2f')][_0xa8d0('0x41')]){_0x21371d[_0xa8d0('0x47')]=[{'all':!![]}];}_0x21371d=_[_0xa8d0('0x40')]({},_0x21371d,_0x2e2778[_0xa8d0('0x48')]);return db['MailSubstatus'][_0xa8d0('0x49')](_0x21371d)['then'](handleEntityNotFound(_0x48399a,null))[_0xa8d0('0x27')](respondWithResult(_0x48399a,null))['catch'](handleError(_0x48399a,null));};exports[_0xa8d0('0x4a')]=function(_0x44df67,_0x3b48f2){return db['MailSubstatus'][_0xa8d0('0x4a')](_0x44df67[_0xa8d0('0x4b')],{})[_0xa8d0('0x27')](respondWithResult(_0x3b48f2,0xc9))[_0xa8d0('0x44')](handleError(_0x3b48f2,null));};exports[_0xa8d0('0x26')]=function(_0x38abbf,_0x2b0f77){if(_0x38abbf[_0xa8d0('0x4b')]['id']){delete _0x38abbf[_0xa8d0('0x4b')]['id'];}return db[_0xa8d0('0x2c')][_0xa8d0('0x49')]({'where':{'id':_0x38abbf[_0xa8d0('0x46')]['id']}})[_0xa8d0('0x27')](handleEntityNotFound(_0x2b0f77,null))[_0xa8d0('0x27')](saveUpdates(_0x38abbf[_0xa8d0('0x4b')],null))['then'](respondWithResult(_0x2b0f77,null))['catch'](handleError(_0x2b0f77,null));};exports[_0xa8d0('0x28')]=function(_0x15f801,_0x3ddebe){return db[_0xa8d0('0x2c')][_0xa8d0('0x49')]({'where':{'id':_0x15f801[_0xa8d0('0x46')]['id']}})[_0xa8d0('0x27')](handleEntityNotFound(_0x3ddebe,null))[_0xa8d0('0x27')](removeEntity(_0x3ddebe,null))[_0xa8d0('0x44')](handleError(_0x3ddebe,null));};exports[_0xa8d0('0x4c')]=function(_0x2c4ef4,_0x2e9112){return db[_0xa8d0('0x2c')]['describe']()[_0xa8d0('0x27')](respondWithResult(_0x2e9112,null))[_0xa8d0('0x44')](handleError(_0x2e9112,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 7a1f4db..3855f36 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 _0x8ccf=['../../config/logger','api','moment','request-promise','define','mail_substatuses','util'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x8ccf,0x180));var _0xf8cc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8ccf[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xf8cc('0x0'));var logger=require(_0xf8cc('0x1'))(_0xf8cc('0x2'));var moment=require(_0xf8cc('0x3'));var BPromise=require('bluebird');var rp=require(_0xf8cc('0x4'));var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x154818,_0x1cd4aa){return _0x154818[_0xf8cc('0x5')]('MailSubstatus',attributes,{'tableName':_0xf8cc('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd856=['../../config/logger','moment','bluebird','request-promise','./mailSubstatus.attributes','exports','define','MailSubstatus','lodash','util'];(function(_0x1de755,_0x4c69e4){var _0x17b58c=function(_0x4da068){while(--_0x4da068){_0x1de755['push'](_0x1de755['shift']());}};_0x17b58c(++_0x4c69e4);}(_0xd856,0x1f2));var _0x6d85=function(_0x29c3b9,_0x4adaf7){_0x29c3b9=_0x29c3b9-0x0;var _0x637286=_0xd856[_0x29c3b9];return _0x637286;};'use strict';var _=require(_0x6d85('0x0'));var util=require(_0x6d85('0x1'));var logger=require(_0x6d85('0x2'))('api');var moment=require(_0x6d85('0x3'));var BPromise=require(_0x6d85('0x4'));var rp=require(_0x6d85('0x5'));var attributes=require(_0x6d85('0x6'));module[_0x6d85('0x7')]=function(_0x8b0087,_0x48e822){return _0x8b0087[_0x6d85('0x8')](_0x6d85('0x9'),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 ff0d8c0..5eee3e7 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 _0x7ad0=['request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x2f2925,_0x182259){var _0x2dd1aa=function(_0x48ec43){while(--_0x48ec43){_0x2f2925['push'](_0x2f2925['shift']());}};_0x2dd1aa(++_0x182259);}(_0x7ad0,0x1d6));var _0x07ad=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0x7ad0[_0x1e06f1];return _0x34f77e;};'use strict';var _=require(_0x07ad('0x0'));var util=require(_0x07ad('0x1'));var moment=require(_0x07ad('0x2'));var BPromise=require(_0x07ad('0x3'));var rs=require(_0x07ad('0x4'));var fs=require('fs');var Redis=require(_0x07ad('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x07ad('0x6'));var logger=require(_0x07ad('0x7'))('rpc');var config=require(_0x07ad('0x8'));var jayson=require(_0x07ad('0x9'));var client=jayson['client'][_0x07ad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x543f9c,_0x538631,_0x4eac63){return new BPromise(function(_0x2e852e,_0x42e2e5){return client[_0x07ad('0xb')](_0x543f9c,_0x4eac63)['then'](function(_0x31a8c7){logger[_0x07ad('0xc')](_0x07ad('0xd'),_0x538631,_0x07ad('0xe'));logger[_0x07ad('0xf')](_0x07ad('0x10'),_0x538631,_0x07ad('0xe'),JSON[_0x07ad('0x11')](_0x31a8c7));if(_0x31a8c7[_0x07ad('0x12')]){if(_0x31a8c7['error'][_0x07ad('0x13')]===0x1f4){logger['error'](_0x07ad('0xd'),_0x538631,_0x31a8c7['error'][_0x07ad('0x14')]);return _0x42e2e5(_0x31a8c7[_0x07ad('0x12')][_0x07ad('0x14')]);}logger[_0x07ad('0x12')](_0x07ad('0xd'),_0x538631,_0x31a8c7[_0x07ad('0x12')][_0x07ad('0x14')]);return _0x2e852e(_0x31a8c7[_0x07ad('0x12')]['message']);}else{logger[_0x07ad('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x538631,_0x07ad('0xe'));_0x2e852e(_0x31a8c7[_0x07ad('0x15')][_0x07ad('0x14')]);}})['catch'](function(_0x51abd8){logger[_0x07ad('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x538631,_0x51abd8);_0x42e2e5(_0x51abd8);});});} \ No newline at end of file +var _0x0e85=['code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','error'];(function(_0x27edb0,_0x41bd7b){var _0x31f134=function(_0x4a71d8){while(--_0x4a71d8){_0x27edb0['push'](_0x27edb0['shift']());}};_0x31f134(++_0x41bd7b);}(_0x0e85,0x101));var _0x50e8=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x0e85[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require(_0x50e8('0x2'));var BPromise=require(_0x50e8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x50e8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x5'))(_0x50e8('0x6'));var config=require('../../config/environment');var jayson=require(_0x50e8('0x7'));var client=jayson[_0x50e8('0x8')][_0x50e8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19df22,_0x2c3a9d,_0xfbc398){return new BPromise(function(_0x476daf,_0x3efb11){return client['request'](_0x19df22,_0xfbc398)['then'](function(_0x160537){logger[_0x50e8('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x2c3a9d,_0x50e8('0xb'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2c3a9d,_0x50e8('0xb'),JSON['stringify'](_0x160537));if(_0x160537[_0x50e8('0xc')]){if(_0x160537[_0x50e8('0xc')][_0x50e8('0xd')]===0x1f4){logger['error'](_0x50e8('0xe'),_0x2c3a9d,_0x160537[_0x50e8('0xc')][_0x50e8('0xf')]);return _0x3efb11(_0x160537['error'][_0x50e8('0xf')]);}logger['error'](_0x50e8('0xe'),_0x2c3a9d,_0x160537[_0x50e8('0xc')][_0x50e8('0xf')]);return _0x476daf(_0x160537[_0x50e8('0xc')][_0x50e8('0xf')]);}else{logger[_0x50e8('0xa')](_0x50e8('0xe'),_0x2c3a9d,_0x50e8('0xb'));_0x476daf(_0x160537[_0x50e8('0x10')][_0x50e8('0xf')]);}})[_0x50e8('0x11')](function(_0x364f63){logger['error'](_0x50e8('0xe'),_0x2c3a9d,_0x364f63);_0x3efb11(_0x364f63);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 79d4df6..15ed231 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 _0xbd10=['/:id','show','create','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index'];(function(_0x27ae81,_0x2448e9){var _0x27ea3a=function(_0x34ac2a){while(--_0x34ac2a){_0x27ae81['push'](_0x27ae81['shift']());}};_0x27ea3a(++_0x2448e9);}(_0xbd10,0x85));var _0x0bd1=function(_0x3554e1,_0x53021a){_0x3554e1=_0x3554e1-0x0;var _0x481714=_0xbd10[_0x3554e1];return _0x481714;};'use strict';var multer=require(_0x0bd1('0x0'));var util=require(_0x0bd1('0x1'));var path=require(_0x0bd1('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd1('0x3'));var router=express[_0x0bd1('0x4')]();var auth=require(_0x0bd1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0bd1('0x6'));var controller=require(_0x0bd1('0x7'));router[_0x0bd1('0x8')]('/',auth[_0x0bd1('0x9')](),controller[_0x0bd1('0xa')]);router[_0x0bd1('0x8')]('/describe',auth[_0x0bd1('0x9')](),controller['describe']);router[_0x0bd1('0x8')](_0x0bd1('0xb'),auth[_0x0bd1('0x9')](),controller[_0x0bd1('0xc')]);router['post']('/',auth[_0x0bd1('0x9')](),controller[_0x0bd1('0xd')]);router[_0x0bd1('0xe')](_0x0bd1('0xb'),auth[_0x0bd1('0x9')](),controller[_0x0bd1('0xf')]);router['delete'](_0x0bd1('0xb'),auth[_0x0bd1('0x9')](),controller[_0x0bd1('0x10')]);module[_0x0bd1('0x11')]=router; \ No newline at end of file +var _0x1883=['put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create'];(function(_0x28d164,_0x275c50){var _0x30a0e9=function(_0x45bc65){while(--_0x45bc65){_0x28d164['push'](_0x28d164['shift']());}};_0x30a0e9(++_0x275c50);}(_0x1883,0xab));var _0x3188=function(_0x31d03a,_0x473d2c){_0x31d03a=_0x31d03a-0x0;var _0x355f25=_0x1883[_0x31d03a];return _0x355f25;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var auth=require(_0x3188('0x6'));var interaction=require(_0x3188('0x7'));var config=require(_0x3188('0x8'));var controller=require(_0x3188('0x9'));router[_0x3188('0xa')]('/',auth[_0x3188('0xb')](),controller[_0x3188('0xc')]);router[_0x3188('0xa')](_0x3188('0xd'),auth[_0x3188('0xb')](),controller[_0x3188('0xe')]);router['get'](_0x3188('0xf'),auth[_0x3188('0xb')](),controller['show']);router[_0x3188('0x10')]('/',auth['isAuthenticated'](),controller[_0x3188('0x11')]);router[_0x3188('0x12')](_0x3188('0xf'),auth[_0x3188('0xb')](),controller['update']);router[_0x3188('0x13')](_0x3188('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x3188('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 456b584..10c9684 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 _0xce4c=['queue','DATE','NOW','moment','sequelize','exports','STRING','agent'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0xce4c,0xbb));var _0xcce4=function(_0x4d295c,_0x175860){_0x4d295c=_0x4d295c-0x0;var _0x453690=_0xce4c[_0x4d295c];return _0x453690;};'use strict';var moment=require(_0xcce4('0x0'));var Sequelize=require(_0xcce4('0x1'));module[_0xcce4('0x2')]={'uniqueid':{'type':Sequelize[_0xcce4('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xcce4('0x4'),_0xcce4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xcce4('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xcce4('0x7')]}}; \ No newline at end of file +var _0x15de=['STRING','ENUM','account','agent','queue','DATE','NOW','sequelize'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x15de,0x1af));var _0xe15d=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0x15de[_0x4eb6ec];return _0x58881b;};'use strict';var moment=require('moment');var Sequelize=require(_0xe15d('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe15d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe15d('0x2')](_0xe15d('0x3'),_0xe15d('0x4'),_0xe15d('0x5')),'allowNull':![],'defaultValue':_0xe15d('0x5')},'transferredAt':{'type':Sequelize[_0xe15d('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xe15d('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index c86f7b5..3177f76 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 _0xf4eb=['../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../mysqldb','end','status','json','count','offset','apply','update','then','destroy','sendStatus','stack','name','send','MailTransferReport','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','filter','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','html-pdf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf4eb,0xec));var _0xbf4e=function(_0x24c5c8,_0x1864e1){_0x24c5c8=_0x24c5c8-0x0;var _0x3268b9=_0xf4eb[_0x24c5c8];return _0x3268b9;};'use strict';var pdf=require(_0xbf4e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf4e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf4e('0x2'));var util=require(_0xbf4e('0x3'));var path=require(_0xbf4e('0x4'));var sox=require(_0xbf4e('0x5'));var csv=require(_0xbf4e('0x6'));var ejs=require(_0xbf4e('0x7'));var fs=require('fs');var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x6'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var authService=require(_0xbf4e('0xc'));var hardwareService=require(_0xbf4e('0xd'));var Redis=require(_0xbf4e('0xe'));var qs=require(_0xbf4e('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xbf4e('0x10'));var config=require('../../config/environment');var db=require(_0xbf4e('0x11'))['db'];function respondWithStatusCode(_0xcf6ba8,_0x54a96e){_0x54a96e=_0x54a96e||0xcc;return function(_0x17fd01){if(_0x17fd01){return _0xcf6ba8['sendStatus'](_0x54a96e);}return _0xcf6ba8['status'](_0x54a96e)[_0xbf4e('0x12')]();};}function respondWithResult(_0x46c79c,_0x1e029b){_0x1e029b=_0x1e029b||0xc8;return function(_0x302841){if(_0x302841){return _0x46c79c[_0xbf4e('0x13')](_0x1e029b)[_0xbf4e('0x14')](_0x302841);}};}function respondWithFilteredResult(_0x4984b4,_0x59fb15){return function(_0x180432){if(_0x180432){var _0x1735ae=_0x180432[_0xbf4e('0x15')],_0x28fc6b=_0x59fb15[_0xbf4e('0x16')],_0x542909=_0x59fb15[_0xbf4e('0x16')]+_0x59fb15['limit'],_0x14110b;if(_0x542909>=_0x1735ae){_0x542909=_0x1735ae;_0x14110b=0xc8;}else{_0x14110b=0xce;}_0x4984b4[_0xbf4e('0x13')](_0x14110b);return _0x4984b4['set']('Content-Range',_0x28fc6b+'-'+_0x542909+'/'+_0x1735ae)['json'](_0x180432);}return null;};}function patchUpdates(_0x4f8762){return function(_0x35992b){try{jsonpatch[_0xbf4e('0x17')](_0x35992b,_0x4f8762,!![]);}catch(_0x1fc800){return BPromise['reject'](_0x1fc800);}return _0x35992b['save']();};}function saveUpdates(_0x3d1aa7,_0x9a46ee){return function(_0x3be138){if(_0x3be138){return _0x3be138[_0xbf4e('0x18')](_0x3d1aa7)[_0xbf4e('0x19')](function(_0x1e2a68){return _0x1e2a68;});}return null;};}function removeEntity(_0x415963,_0x3d642a){return function(_0xd09e12){if(_0xd09e12){return _0xd09e12[_0xbf4e('0x1a')]()[_0xbf4e('0x19')](function(){_0x415963['status'](0xcc)[_0xbf4e('0x12')]();});}};}function handleEntityNotFound(_0x2e7673,_0x51648c){return function(_0x31e3f5){if(!_0x31e3f5){_0x2e7673[_0xbf4e('0x1b')](0x194);}return _0x31e3f5;};}function handleError(_0x114412,_0x1bda8b){_0x1bda8b=_0x1bda8b||0x1f4;return function(_0x3a5d72){logger['error'](_0x3a5d72[_0xbf4e('0x1c')]);if(_0x3a5d72[_0xbf4e('0x1d')]){delete _0x3a5d72[_0xbf4e('0x1d')];}_0x114412['status'](_0x1bda8b)[_0xbf4e('0x1e')](_0x3a5d72);};}exports['index']=function(_0x5bcf71,_0x2bfccf){var _0x5a0a9b={},_0x38c923={},_0x315df3={'count':0x0,'rows':[]};var _0x4021a9=db[_0xbf4e('0x1f')]['rawAttributes'];_0x38c923[_0xbf4e('0x20')]=_[_0xbf4e('0x21')](_0x4021a9);_0x38c923[_0xbf4e('0x22')]=_['keys'](_0x5bcf71[_0xbf4e('0x22')]);_0x38c923['filters']=_[_0xbf4e('0x23')](_0x38c923[_0xbf4e('0x20')],_0x38c923[_0xbf4e('0x22')]);_0x5a0a9b['attributes']=_[_0xbf4e('0x23')](_0x38c923[_0xbf4e('0x20')],qs[_0xbf4e('0x24')](_0x5bcf71[_0xbf4e('0x22')][_0xbf4e('0x24')]));_0x5a0a9b[_0xbf4e('0x25')]=_0x5a0a9b['attributes'][_0xbf4e('0x26')]?_0x5a0a9b[_0xbf4e('0x25')]:_0x38c923['model'];if(!_0x5bcf71[_0xbf4e('0x22')][_0xbf4e('0x27')]('nolimit')){_0x5a0a9b[_0xbf4e('0x28')]=qs['limit'](_0x5bcf71[_0xbf4e('0x22')]['limit']);_0x5a0a9b[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0x5bcf71[_0xbf4e('0x22')]['offset']);}_0x5a0a9b[_0xbf4e('0x29')]=qs[_0xbf4e('0x2a')](_0x5bcf71[_0xbf4e('0x22')][_0xbf4e('0x2a')]);_0x5a0a9b[_0xbf4e('0x2b')]=qs[_0xbf4e('0x2c')](_['pick'](_0x5bcf71[_0xbf4e('0x22')],_0x38c923[_0xbf4e('0x2c')]));if(_0x5bcf71[_0xbf4e('0x22')][_0xbf4e('0x2d')]){_0x5a0a9b[_0xbf4e('0x2b')]=_['merge'](_0x5a0a9b['where'],{'$or':_['map'](_0x4021a9,function(_0x4be59a){if(_0x4be59a[_0xbf4e('0x2e')][_0xbf4e('0x2f')]!==_0xbf4e('0x30')){var _0x2693ba={};_0x2693ba[_0x4be59a[_0xbf4e('0x31')]]={'$like':'%'+_0x5bcf71[_0xbf4e('0x22')][_0xbf4e('0x2d')]+'%'};return _0x2693ba;}})});}_0x5a0a9b=_[_0xbf4e('0x32')]({},_0x5a0a9b,_0x5bcf71[_0xbf4e('0x33')]);var _0x54527d={'where':_0x5a0a9b['where']};return db[_0xbf4e('0x1f')][_0xbf4e('0x15')](_0x54527d)[_0xbf4e('0x19')](function(_0x4ae676){_0x315df3[_0xbf4e('0x15')]=_0x4ae676;if(_0x5bcf71['query'][_0xbf4e('0x34')]){_0x5a0a9b[_0xbf4e('0x35')]=[{'all':!![]}];}return db[_0xbf4e('0x1f')][_0xbf4e('0x36')](_0x5a0a9b);})['then'](function(_0x31d8dc){_0x315df3[_0xbf4e('0x37')]=_0x31d8dc;return _0x315df3;})[_0xbf4e('0x19')](respondWithFilteredResult(_0x2bfccf,_0x5a0a9b))[_0xbf4e('0x38')](handleError(_0x2bfccf,null));};exports['show']=function(_0x3d08d5,_0x44e96b){var _0x148d94={'raw':!![],'where':{'id':_0x3d08d5[_0xbf4e('0x39')]['id']}},_0x29fe9d={};_0x29fe9d[_0xbf4e('0x20')]=_[_0xbf4e('0x21')](db['MailTransferReport'][_0xbf4e('0x3a')]);_0x29fe9d[_0xbf4e('0x22')]=_['keys'](_0x3d08d5['query']);_0x29fe9d[_0xbf4e('0x2c')]=_[_0xbf4e('0x23')](_0x29fe9d['model'],_0x29fe9d['query']);_0x148d94[_0xbf4e('0x25')]=_[_0xbf4e('0x23')](_0x29fe9d[_0xbf4e('0x20')],qs[_0xbf4e('0x24')](_0x3d08d5[_0xbf4e('0x22')][_0xbf4e('0x24')]));_0x148d94['attributes']=_0x148d94[_0xbf4e('0x25')][_0xbf4e('0x26')]?_0x148d94['attributes']:_0x29fe9d['model'];if(_0x3d08d5['query']['includeAll']){_0x148d94[_0xbf4e('0x35')]=[{'all':!![]}];}_0x148d94=_['merge']({},_0x148d94,_0x3d08d5[_0xbf4e('0x33')]);return db[_0xbf4e('0x1f')]['find'](_0x148d94)['then'](handleEntityNotFound(_0x44e96b,null))[_0xbf4e('0x19')](respondWithResult(_0x44e96b,null))[_0xbf4e('0x38')](handleError(_0x44e96b,null));};exports[_0xbf4e('0x3b')]=function(_0x40c147,_0x8ab634){return db['MailTransferReport'][_0xbf4e('0x3b')](_0x40c147[_0xbf4e('0x3c')],{})[_0xbf4e('0x19')](respondWithResult(_0x8ab634,0xc9))[_0xbf4e('0x38')](handleError(_0x8ab634,null));};exports[_0xbf4e('0x18')]=function(_0x1bc421,_0x4060c7){if(_0x1bc421[_0xbf4e('0x3c')]['id']){delete _0x1bc421['body']['id'];}return db[_0xbf4e('0x1f')][_0xbf4e('0x3d')]({'where':{'id':_0x1bc421[_0xbf4e('0x39')]['id']}})[_0xbf4e('0x19')](handleEntityNotFound(_0x4060c7,null))[_0xbf4e('0x19')](saveUpdates(_0x1bc421[_0xbf4e('0x3c')],null))[_0xbf4e('0x19')](respondWithResult(_0x4060c7,null))[_0xbf4e('0x38')](handleError(_0x4060c7,null));};exports[_0xbf4e('0x1a')]=function(_0x3447ab,_0x2fdba9){return db[_0xbf4e('0x1f')][_0xbf4e('0x3d')]({'where':{'id':_0x3447ab[_0xbf4e('0x39')]['id']}})[_0xbf4e('0x19')](handleEntityNotFound(_0x2fdba9,null))[_0xbf4e('0x19')](removeEntity(_0x2fdba9,null))[_0xbf4e('0x38')](handleError(_0x2fdba9,null));};exports['describe']=function(_0x22d8ef,_0x17a7be){return db[_0xbf4e('0x1f')]['describe']()[_0xbf4e('0x19')](respondWithResult(_0x17a7be,null))['catch'](handleError(_0x17a7be,null));}; \ No newline at end of file +var _0x4fc2=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','MailTransferReport','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','findAll','catch','show','params','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis'];(function(_0x1734f9,_0x558efb){var _0x22f0dc=function(_0x43ab1b){while(--_0x43ab1b){_0x1734f9['push'](_0x1734f9['shift']());}};_0x22f0dc(++_0x558efb);}(_0x4fc2,0x111));var _0x24fc=function(_0x4b60cc,_0x2e5e22){_0x4b60cc=_0x4b60cc-0x0;var _0x116ffe=_0x4fc2[_0x4b60cc];return _0x116ffe;};'use strict';var pdf=require(_0x24fc('0x0'));var emlformat=require(_0x24fc('0x1'));var rimraf=require(_0x24fc('0x2'));var zipdir=require(_0x24fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24fc('0x4'));var moment=require(_0x24fc('0x5'));var BPromise=require(_0x24fc('0x6'));var Mustache=require('mustache');var util=require(_0x24fc('0x7'));var path=require(_0x24fc('0x8'));var sox=require('sox');var csv=require(_0x24fc('0x9'));var ejs=require(_0x24fc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0x9'));var querystring=require(_0x24fc('0xf'));var Papa=require('papaparse');var authService=require(_0x24fc('0x10'));var hardwareService=require(_0x24fc('0x11'));var Redis=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var logger=require(_0x24fc('0x14'))(_0x24fc('0x15'));var utils=require(_0x24fc('0x16'));var config=require(_0x24fc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bd032,_0x1cde5d){_0x1cde5d=_0x1cde5d||0xcc;return function(_0x5cc65e){if(_0x5cc65e){return _0x3bd032[_0x24fc('0x18')](_0x1cde5d);}return _0x3bd032[_0x24fc('0x19')](_0x1cde5d)[_0x24fc('0x1a')]();};}function respondWithResult(_0x3bc30b,_0x30f19b){_0x30f19b=_0x30f19b||0xc8;return function(_0x326276){if(_0x326276){return _0x3bc30b['status'](_0x30f19b)[_0x24fc('0x1b')](_0x326276);}};}function respondWithFilteredResult(_0x18c0a7,_0x2ffed3){return function(_0x42cbe8){if(_0x42cbe8){var _0x4acd36=_0x42cbe8[_0x24fc('0x1c')],_0x2ac989=_0x2ffed3[_0x24fc('0x1d')],_0x588543=_0x2ffed3[_0x24fc('0x1d')]+_0x2ffed3[_0x24fc('0x1e')],_0x4af098;if(_0x588543>=_0x4acd36){_0x588543=_0x4acd36;_0x4af098=0xc8;}else{_0x4af098=0xce;}_0x18c0a7['status'](_0x4af098);return _0x18c0a7[_0x24fc('0x1f')](_0x24fc('0x20'),_0x2ac989+'-'+_0x588543+'/'+_0x4acd36)[_0x24fc('0x1b')](_0x42cbe8);}return null;};}function patchUpdates(_0x8ac114){return function(_0x4c5a43){try{jsonpatch[_0x24fc('0x21')](_0x4c5a43,_0x8ac114,!![]);}catch(_0x4073e0){return BPromise[_0x24fc('0x22')](_0x4073e0);}return _0x4c5a43['save']();};}function saveUpdates(_0x32a57d,_0x36a771){return function(_0xbf1d6b){if(_0xbf1d6b){return _0xbf1d6b[_0x24fc('0x23')](_0x32a57d)['then'](function(_0x323beb){return _0x323beb;});}return null;};}function removeEntity(_0x545939,_0x339b50){return function(_0x591c8f){if(_0x591c8f){return _0x591c8f[_0x24fc('0x24')]()[_0x24fc('0x25')](function(){_0x545939[_0x24fc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x313a25,_0x552035){return function(_0x35a9c7){if(!_0x35a9c7){_0x313a25[_0x24fc('0x18')](0x194);}return _0x35a9c7;};}function handleError(_0x36a9b4,_0x34b5b2){_0x34b5b2=_0x34b5b2||0x1f4;return function(_0x3296fc){logger[_0x24fc('0x26')](_0x3296fc[_0x24fc('0x27')]);if(_0x3296fc[_0x24fc('0x28')]){delete _0x3296fc[_0x24fc('0x28')];}_0x36a9b4[_0x24fc('0x19')](_0x34b5b2)['send'](_0x3296fc);};}exports[_0x24fc('0x29')]=function(_0x16f27f,_0x3ee302){var _0x5bb4c8={},_0xf2f77d={},_0x3d1ec8={'count':0x0,'rows':[]};var _0x35f9f9=db[_0x24fc('0x2a')][_0x24fc('0x2b')];_0xf2f77d[_0x24fc('0x2c')]=_['keys'](_0x35f9f9);_0xf2f77d[_0x24fc('0x2d')]=_[_0x24fc('0x2e')](_0x16f27f[_0x24fc('0x2d')]);_0xf2f77d[_0x24fc('0x2f')]=_[_0x24fc('0x30')](_0xf2f77d['model'],_0xf2f77d['query']);_0x5bb4c8['attributes']=_[_0x24fc('0x30')](_0xf2f77d['model'],qs[_0x24fc('0x31')](_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x31')]));_0x5bb4c8[_0x24fc('0x32')]=_0x5bb4c8['attributes'][_0x24fc('0x33')]?_0x5bb4c8[_0x24fc('0x32')]:_0xf2f77d['model'];if(!_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x34')]('nolimit')){_0x5bb4c8['limit']=qs[_0x24fc('0x1e')](_0x16f27f['query'][_0x24fc('0x1e')]);_0x5bb4c8[_0x24fc('0x1d')]=qs['offset'](_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x1d')]);}_0x5bb4c8[_0x24fc('0x35')]=qs[_0x24fc('0x36')](_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x36')]);_0x5bb4c8[_0x24fc('0x37')]=qs[_0x24fc('0x2f')](_[_0x24fc('0x38')](_0x16f27f['query'],_0xf2f77d[_0x24fc('0x2f')]));if(_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x39')]){_0x5bb4c8[_0x24fc('0x37')]=_[_0x24fc('0x3a')](_0x5bb4c8['where'],{'$or':_['map'](_0x35f9f9,function(_0xd52d10){if(_0xd52d10['type'][_0x24fc('0x3b')]!==_0x24fc('0x3c')){var _0x10399f={};_0x10399f[_0xd52d10[_0x24fc('0x3d')]]={'$like':'%'+_0x16f27f['query'][_0x24fc('0x39')]+'%'};return _0x10399f;}})});}_0x5bb4c8=_['merge']({},_0x5bb4c8,_0x16f27f[_0x24fc('0x3e')]);var _0x3b8fb6={'where':_0x5bb4c8[_0x24fc('0x37')]};return db[_0x24fc('0x2a')][_0x24fc('0x1c')](_0x3b8fb6)['then'](function(_0xadedb4){_0x3d1ec8[_0x24fc('0x1c')]=_0xadedb4;if(_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x3f')]){_0x5bb4c8['include']=[{'all':!![]}];}return db[_0x24fc('0x2a')][_0x24fc('0x40')](_0x5bb4c8);})['then'](function(_0xf40435){_0x3d1ec8['rows']=_0xf40435;return _0x3d1ec8;})[_0x24fc('0x25')](respondWithFilteredResult(_0x3ee302,_0x5bb4c8))[_0x24fc('0x41')](handleError(_0x3ee302,null));};exports[_0x24fc('0x42')]=function(_0x1e045a,_0x431189){var _0x278b18={'raw':!![],'where':{'id':_0x1e045a[_0x24fc('0x43')]['id']}},_0x77b959={};_0x77b959['model']=_[_0x24fc('0x2e')](db[_0x24fc('0x2a')][_0x24fc('0x2b')]);_0x77b959['query']=_[_0x24fc('0x2e')](_0x1e045a[_0x24fc('0x2d')]);_0x77b959['filters']=_[_0x24fc('0x30')](_0x77b959[_0x24fc('0x2c')],_0x77b959[_0x24fc('0x2d')]);_0x278b18['attributes']=_[_0x24fc('0x30')](_0x77b959[_0x24fc('0x2c')],qs['fields'](_0x1e045a[_0x24fc('0x2d')][_0x24fc('0x31')]));_0x278b18[_0x24fc('0x32')]=_0x278b18[_0x24fc('0x32')]['length']?_0x278b18[_0x24fc('0x32')]:_0x77b959[_0x24fc('0x2c')];if(_0x1e045a[_0x24fc('0x2d')][_0x24fc('0x3f')]){_0x278b18[_0x24fc('0x44')]=[{'all':!![]}];}_0x278b18=_['merge']({},_0x278b18,_0x1e045a[_0x24fc('0x3e')]);return db[_0x24fc('0x2a')][_0x24fc('0x45')](_0x278b18)[_0x24fc('0x25')](handleEntityNotFound(_0x431189,null))['then'](respondWithResult(_0x431189,null))[_0x24fc('0x41')](handleError(_0x431189,null));};exports[_0x24fc('0x46')]=function(_0x5ea251,_0x5bbb6c){return db[_0x24fc('0x2a')]['create'](_0x5ea251['body'],{})[_0x24fc('0x25')](respondWithResult(_0x5bbb6c,0xc9))['catch'](handleError(_0x5bbb6c,null));};exports[_0x24fc('0x23')]=function(_0x264854,_0x5052c8){if(_0x264854['body']['id']){delete _0x264854[_0x24fc('0x47')]['id'];}return db[_0x24fc('0x2a')][_0x24fc('0x45')]({'where':{'id':_0x264854[_0x24fc('0x43')]['id']}})[_0x24fc('0x25')](handleEntityNotFound(_0x5052c8,null))[_0x24fc('0x25')](saveUpdates(_0x264854[_0x24fc('0x47')],null))[_0x24fc('0x25')](respondWithResult(_0x5052c8,null))['catch'](handleError(_0x5052c8,null));};exports['destroy']=function(_0x266378,_0x2f1a99){return db[_0x24fc('0x2a')]['find']({'where':{'id':_0x266378['params']['id']}})[_0x24fc('0x25')](handleEntityNotFound(_0x2f1a99,null))[_0x24fc('0x25')](removeEntity(_0x2f1a99,null))[_0x24fc('0x41')](handleError(_0x2f1a99,null));};exports[_0x24fc('0x48')]=function(_0x21f8b8,_0x42e22a){return db[_0x24fc('0x2a')][_0x24fc('0x48')]()[_0x24fc('0x25')](respondWithResult(_0x42e22a,null))[_0x24fc('0x41')](handleError(_0x42e22a,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 26dd4a8..e310436 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 _0xae76=['./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xae76,0x74));var _0x6ae7=function(_0x543e6b,_0x218c9a){_0x543e6b=_0x543e6b-0x0;var _0xffb501=_0xae76[_0x543e6b];return _0xffb501;};'use strict';var _=require(_0x6ae7('0x0'));var util=require('util');var logger=require(_0x6ae7('0x1'))(_0x6ae7('0x2'));var moment=require('moment');var BPromise=require(_0x6ae7('0x3'));var rp=require(_0x6ae7('0x4'));var attributes=require(_0x6ae7('0x5'));module[_0x6ae7('0x6')]=function(_0x4d793d,_0x42bb84){return _0x4d793d[_0x6ae7('0x7')](_0x6ae7('0x8'),attributes,{'tableName':_0x6ae7('0x9'),'paranoid':![],'indexes':[{'name':_0x6ae7('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa217=['exports','define','MailTransferReport','uniqueid','util','api','moment','bluebird','request-promise','./mailTransferReport.attributes'];(function(_0x16e594,_0x41bb0b){var _0x582ccc=function(_0x471c37){while(--_0x471c37){_0x16e594['push'](_0x16e594['shift']());}};_0x582ccc(++_0x41bb0b);}(_0xa217,0x1b2));var _0x7a21=function(_0x5d98f1,_0x5e6890){_0x5d98f1=_0x5d98f1-0x0;var _0x7dd486=_0xa217[_0x5d98f1];return _0x7dd486;};'use strict';var _=require('lodash');var util=require(_0x7a21('0x0'));var logger=require('../../config/logger')(_0x7a21('0x1'));var moment=require(_0x7a21('0x2'));var BPromise=require(_0x7a21('0x3'));var rp=require(_0x7a21('0x4'));var attributes=require(_0x7a21('0x5'));module[_0x7a21('0x6')]=function(_0x216ebb,_0x2ca250){return _0x216ebb[_0x7a21('0x7')](_0x7a21('0x8'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x7a21('0x9'),'fields':[_0x7a21('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 65c96c5..7f61413 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 _0x5aeb=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','bluebird'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0x5aeb,0xa5));var _0xb5ae=function(_0x3223a6,_0x447e47){_0x3223a6=_0x3223a6-0x0;var _0x49ebe1=_0x5aeb[_0x3223a6];return _0x49ebe1;};'use strict';var _=require(_0xb5ae('0x0'));var util=require('util');var moment=require(_0xb5ae('0x1'));var BPromise=require(_0xb5ae('0x2'));var rs=require(_0xb5ae('0x3'));var fs=require('fs');var Redis=require(_0xb5ae('0x4'));var db=require(_0xb5ae('0x5'))['db'];var utils=require(_0xb5ae('0x6'));var logger=require(_0xb5ae('0x7'))('rpc');var config=require(_0xb5ae('0x8'));var jayson=require(_0xb5ae('0x9'));var client=jayson[_0xb5ae('0xa')][_0xb5ae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3783c1,_0x2cf7f3,_0x43411f){return new BPromise(function(_0x569b9d,_0x62a5c){return client[_0xb5ae('0xc')](_0x3783c1,_0x43411f)[_0xb5ae('0xd')](function(_0xbc3eb2){logger['info'](_0xb5ae('0xe'),_0x2cf7f3,_0xb5ae('0xf'));logger[_0xb5ae('0x10')](_0xb5ae('0x11'),_0x2cf7f3,'request\x20sent',JSON[_0xb5ae('0x12')](_0xbc3eb2));if(_0xbc3eb2[_0xb5ae('0x13')]){if(_0xbc3eb2[_0xb5ae('0x13')][_0xb5ae('0x14')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x2cf7f3,_0xbc3eb2[_0xb5ae('0x13')][_0xb5ae('0x15')]);return _0x62a5c(_0xbc3eb2['error']['message']);}logger[_0xb5ae('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x2cf7f3,_0xbc3eb2['error'][_0xb5ae('0x15')]);return _0x569b9d(_0xbc3eb2[_0xb5ae('0x13')]['message']);}else{logger[_0xb5ae('0x16')](_0xb5ae('0xe'),_0x2cf7f3,_0xb5ae('0xf'));_0x569b9d(_0xbc3eb2[_0xb5ae('0x17')]['message']);}})['catch'](function(_0x2a88d4){logger['error'](_0xb5ae('0xe'),_0x2cf7f3,_0x2a88d4);_0x62a5c(_0x2a88d4);});});} \ No newline at end of file +var _0x6d4b=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0xb66df,_0x4fb5ce){var _0x42a702=function(_0x252d1d){while(--_0x252d1d){_0xb66df['push'](_0xb66df['shift']());}};_0x42a702(++_0x4fb5ce);}(_0x6d4b,0x1b4));var _0xb6d4=function(_0x2d20f3,_0xbc107c){_0x2d20f3=_0x2d20f3-0x0;var _0x5674be=_0x6d4b[_0x2d20f3];return _0x5674be;};'use strict';var _=require(_0xb6d4('0x0'));var util=require(_0xb6d4('0x1'));var moment=require('moment');var BPromise=require(_0xb6d4('0x2'));var rs=require(_0xb6d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb6d4('0x4'));var logger=require(_0xb6d4('0x5'))('rpc');var config=require(_0xb6d4('0x6'));var jayson=require(_0xb6d4('0x7'));var client=jayson[_0xb6d4('0x8')][_0xb6d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ef79e,_0x9bf906,_0xf11f71){return new BPromise(function(_0x5881e1,_0x306dbf){return client[_0xb6d4('0xa')](_0x5ef79e,_0xf11f71)['then'](function(_0xa73a98){logger[_0xb6d4('0xb')](_0xb6d4('0xc'),_0x9bf906,_0xb6d4('0xd'));logger[_0xb6d4('0xe')](_0xb6d4('0xf'),_0x9bf906,_0xb6d4('0xd'),JSON[_0xb6d4('0x10')](_0xa73a98));if(_0xa73a98[_0xb6d4('0x11')]){if(_0xa73a98[_0xb6d4('0x11')][_0xb6d4('0x12')]===0x1f4){logger['error'](_0xb6d4('0xc'),_0x9bf906,_0xa73a98['error']['message']);return _0x306dbf(_0xa73a98[_0xb6d4('0x11')][_0xb6d4('0x13')]);}logger[_0xb6d4('0x11')](_0xb6d4('0xc'),_0x9bf906,_0xa73a98[_0xb6d4('0x11')][_0xb6d4('0x13')]);return _0x5881e1(_0xa73a98[_0xb6d4('0x11')][_0xb6d4('0x13')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x9bf906,_0xb6d4('0xd'));_0x5881e1(_0xa73a98[_0xb6d4('0x14')][_0xb6d4('0x13')]);}})[_0xb6d4('0x15')](function(_0x575b09){logger[_0xb6d4('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x9bf906,_0x575b09);_0x306dbf(_0x575b09);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index c5073f5..9462008 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 _0x7673=['/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','index','/describe','isAuthenticated','describe','get'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0x7673,0x168));var _0x3767=function(_0x5c6272,_0xd82df5){_0x5c6272=_0x5c6272-0x0;var _0x19c236=_0x7673[_0x5c6272];return _0x19c236;};'use strict';var multer=require(_0x3767('0x0'));var util=require(_0x3767('0x1'));var path=require(_0x3767('0x2'));var timeout=require(_0x3767('0x3'));var express=require(_0x3767('0x4'));var router=express[_0x3767('0x5')]();var auth=require(_0x3767('0x6'));var interaction=require(_0x3767('0x7'));var config=require('../../config/environment');var controller=require(_0x3767('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3767('0x9')]);router['get'](_0x3767('0xa'),auth[_0x3767('0xb')](),controller[_0x3767('0xc')]);router[_0x3767('0xd')](_0x3767('0xe'),auth[_0x3767('0xb')](),controller[_0x3767('0xf')]);router[_0x3767('0x10')]('/',auth[_0x3767('0xb')](),controller[_0x3767('0x11')]);router[_0x3767('0x12')](_0x3767('0xe'),auth[_0x3767('0xb')](),controller[_0x3767('0x13')]);router['delete'](_0x3767('0xe'),auth[_0x3767('0xb')](),controller[_0x3767('0x14')]);module[_0x3767('0x15')]=router; \ No newline at end of file +var _0x9913=['create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','describe','/:id','isAuthenticated','show','post'];(function(_0x34f710,_0x477617){var _0x54e40e=function(_0x362917){while(--_0x362917){_0x34f710['push'](_0x34f710['shift']());}};_0x54e40e(++_0x477617);}(_0x9913,0x16e));var _0x3991=function(_0x3fcc20,_0x57c31b){_0x3fcc20=_0x3fcc20-0x0;var _0x15d3ce=_0x9913[_0x3fcc20];return _0x15d3ce;};'use strict';var multer=require(_0x3991('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3991('0x1'));var express=require(_0x3991('0x2'));var router=express[_0x3991('0x3')]();var auth=require(_0x3991('0x4'));var interaction=require(_0x3991('0x5'));var config=require(_0x3991('0x6'));var controller=require(_0x3991('0x7'));router[_0x3991('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3991('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x3991('0x9')]);router[_0x3991('0x8')](_0x3991('0xa'),auth[_0x3991('0xb')](),controller[_0x3991('0xc')]);router[_0x3991('0xd')]('/',auth[_0x3991('0xb')](),controller[_0x3991('0xe')]);router[_0x3991('0xf')](_0x3991('0xa'),auth[_0x3991('0xb')](),controller[_0x3991('0x10')]);router[_0x3991('0x11')]('/:id',auth[_0x3991('0xb')](),controller[_0x3991('0x12')]);module[_0x3991('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 71dfb85..63b225f 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 _0xada2=['STRING','DEFAULT\x20PAUSE','DATE','getDataValue','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xada2,0xfd));var _0x2ada=function(_0x45a8eb,_0x2dc556){_0x45a8eb=_0x45a8eb-0x0;var _0x2845bc=_0xada2[_0x45a8eb];return _0x2845bc;};'use strict';var Sequelize=require(_0x2ada('0x0'));var moment=require(_0x2ada('0x1'));module[_0x2ada('0x2')]={'channel':{'type':Sequelize[_0x2ada('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x2ada('0x3')]},'type':{'type':Sequelize[_0x2ada('0x3')],'defaultValue':_0x2ada('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x2ada('0x5')]},'exitAt':{'type':Sequelize[_0x2ada('0x5')],'set':function(_0x3a53f3){var _0x14ca49=moment(_0x3a53f3);var _0xa4b8b1=moment(this[_0x2ada('0x6')](_0x2ada('0x7')));var _0x1deb4a=_0x14ca49[_0x2ada('0x8')](_0xa4b8b1,_0x2ada('0x9'));this['setDataValue']('exitAt',_0x3a53f3);this[_0x2ada('0xa')](_0x2ada('0xb'),_0x1deb4a||null);}},'data1':{'type':Sequelize[_0x2ada('0x3')],'comment':_0x2ada('0xc')},'data2':{'type':Sequelize[_0x2ada('0x3')],'comment':_0x2ada('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0x2ada('0xe')},'data4':{'type':Sequelize[_0x2ada('0x3')],'comment':_0x2ada('0xf')},'data5':{'type':Sequelize[_0x2ada('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x2ada('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2ada('0x3')]}}; \ No newline at end of file +var _0xc2c9=['moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','seconds','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize'];(function(_0x3a2deb,_0x2f8c2d){var _0x203ab0=function(_0x5d8343){while(--_0x5d8343){_0x3a2deb['push'](_0x3a2deb['shift']());}};_0x203ab0(++_0x2f8c2d);}(_0xc2c9,0x11c));var _0x9c2c=function(_0x20dd87,_0x386277){_0x20dd87=_0x20dd87-0x0;var _0x1abe67=_0xc2c9[_0x20dd87];return _0x1abe67;};'use strict';var Sequelize=require(_0x9c2c('0x0'));var moment=require(_0x9c2c('0x1'));module['exports']={'channel':{'type':Sequelize[_0x9c2c('0x2')]},'membername':{'type':Sequelize[_0x9c2c('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9c2c('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x9c2c('0x3')},'duration':{'type':Sequelize[_0x9c2c('0x4')]},'enterAt':{'type':Sequelize[_0x9c2c('0x5')]},'exitAt':{'type':Sequelize[_0x9c2c('0x5')],'set':function(_0x35dec1){var _0x5a6fe3=moment(_0x35dec1);var _0x5a3f05=moment(this['getDataValue'](_0x9c2c('0x6')));var _0x1d6104=_0x5a6fe3['diff'](_0x5a3f05,_0x9c2c('0x7'));this[_0x9c2c('0x8')](_0x9c2c('0x9'),_0x35dec1);this[_0x9c2c('0x8')](_0x9c2c('0xa'),_0x1d6104||null);}},'data1':{'type':Sequelize[_0x9c2c('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x9c2c('0x2')],'comment':_0x9c2c('0xb')},'data3':{'type':Sequelize[_0x9c2c('0x2')],'comment':_0x9c2c('0xc')},'data4':{'type':Sequelize[_0x9c2c('0x2')],'comment':_0x9c2c('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0x9c2c('0xe')},'role':{'type':Sequelize[_0x9c2c('0x2')]},'internal':{'type':Sequelize[_0x9c2c('0x4')]},'uniqueid':{'type':Sequelize[_0x9c2c('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 75906a7..a963fbf 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 _0xc638=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','count','offset','set','json','apply','save','update','then','destroy','sendStatus','name','send','index','MemberReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','lodash','squel'];(function(_0x4e75b3,_0x28de85){var _0x11e329=function(_0x266fd9){while(--_0x266fd9){_0x4e75b3['push'](_0x4e75b3['shift']());}};_0x11e329(++_0x28de85);}(_0xc638,0x112));var _0x8c63=function(_0x328f1e,_0x5e9aa0){_0x328f1e=_0x328f1e-0x0;var _0xa51835=_0xc638[_0x328f1e];return _0xa51835;};'use strict';var pdf=require(_0x8c63('0x0'));var emlformat=require(_0x8c63('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8c63('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c63('0x3'));var moment=require(_0x8c63('0x4'));var BPromise=require(_0x8c63('0x5'));var Mustache=require(_0x8c63('0x6'));var util=require(_0x8c63('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8c63('0x8'));var squel=require(_0x8c63('0x9'));var crypto=require(_0x8c63('0xa'));var jsforce=require(_0x8c63('0xb'));var deskjs=require(_0x8c63('0xc'));var toCsv=require(_0x8c63('0xd'));var querystring=require(_0x8c63('0xe'));var Papa=require(_0x8c63('0xf'));var authService=require(_0x8c63('0x10'));var hardwareService=require(_0x8c63('0x11'));var Redis=require('ioredis');var qs=require(_0x8c63('0x12'));var logger=require(_0x8c63('0x13'))(_0x8c63('0x14'));var utils=require('../../config/utils');var config=require(_0x8c63('0x15'));var db=require(_0x8c63('0x16'))['db'];function respondWithStatusCode(_0x1a6306,_0x2d76e3){_0x2d76e3=_0x2d76e3||0xcc;return function(_0x4ad8d7){if(_0x4ad8d7){return _0x1a6306['sendStatus'](_0x2d76e3);}return _0x1a6306[_0x8c63('0x17')](_0x2d76e3)[_0x8c63('0x18')]();};}function respondWithResult(_0x2dad0b,_0x30f73b){_0x30f73b=_0x30f73b||0xc8;return function(_0x55a35c){if(_0x55a35c){return _0x2dad0b[_0x8c63('0x17')](_0x30f73b)['json'](_0x55a35c);}};}function respondWithFilteredResult(_0x3c9a1e,_0x413590){return function(_0x3e60d0){if(_0x3e60d0){var _0x53fff2=_0x3e60d0[_0x8c63('0x19')],_0x5e59be=_0x413590[_0x8c63('0x1a')],_0x111164=_0x413590[_0x8c63('0x1a')]+_0x413590['limit'],_0x407b64;if(_0x111164>=_0x53fff2){_0x111164=_0x53fff2;_0x407b64=0xc8;}else{_0x407b64=0xce;}_0x3c9a1e['status'](_0x407b64);return _0x3c9a1e[_0x8c63('0x1b')]('Content-Range',_0x5e59be+'-'+_0x111164+'/'+_0x53fff2)[_0x8c63('0x1c')](_0x3e60d0);}return null;};}function patchUpdates(_0x16d528){return function(_0x3c2be2){try{jsonpatch[_0x8c63('0x1d')](_0x3c2be2,_0x16d528,!![]);}catch(_0x59b5c2){return BPromise['reject'](_0x59b5c2);}return _0x3c2be2[_0x8c63('0x1e')]();};}function saveUpdates(_0x3f7387,_0xbe23ab){return function(_0x5a0025){if(_0x5a0025){return _0x5a0025[_0x8c63('0x1f')](_0x3f7387)[_0x8c63('0x20')](function(_0x36de2d){return _0x36de2d;});}return null;};}function removeEntity(_0x30faac,_0x576923){return function(_0x5b3d0d){if(_0x5b3d0d){return _0x5b3d0d[_0x8c63('0x21')]()['then'](function(){_0x30faac[_0x8c63('0x17')](0xcc)[_0x8c63('0x18')]();});}};}function handleEntityNotFound(_0x2d290e,_0x48e1f9){return function(_0x162832){if(!_0x162832){_0x2d290e[_0x8c63('0x22')](0x194);}return _0x162832;};}function handleError(_0x16badb,_0x108bc2){_0x108bc2=_0x108bc2||0x1f4;return function(_0x43c1b2){logger['error'](_0x43c1b2['stack']);if(_0x43c1b2[_0x8c63('0x23')]){delete _0x43c1b2[_0x8c63('0x23')];}_0x16badb['status'](_0x108bc2)[_0x8c63('0x24')](_0x43c1b2);};}exports[_0x8c63('0x25')]=function(_0x20d01f,_0x57ab1c){var _0xdb972f={},_0x89c1e6={},_0x4d2dab={'count':0x0,'rows':[]};var _0x366060=db[_0x8c63('0x26')][_0x8c63('0x27')];_0x89c1e6[_0x8c63('0x28')]=_[_0x8c63('0x29')](_0x366060);_0x89c1e6[_0x8c63('0x2a')]=_[_0x8c63('0x29')](_0x20d01f[_0x8c63('0x2a')]);_0x89c1e6[_0x8c63('0x2b')]=_[_0x8c63('0x2c')](_0x89c1e6['model'],_0x89c1e6['query']);_0xdb972f[_0x8c63('0x2d')]=_[_0x8c63('0x2c')](_0x89c1e6[_0x8c63('0x28')],qs[_0x8c63('0x2e')](_0x20d01f['query'][_0x8c63('0x2e')]));_0xdb972f['attributes']=_0xdb972f[_0x8c63('0x2d')][_0x8c63('0x2f')]?_0xdb972f[_0x8c63('0x2d')]:_0x89c1e6[_0x8c63('0x28')];if(!_0x20d01f[_0x8c63('0x2a')]['hasOwnProperty'](_0x8c63('0x30'))){_0xdb972f['limit']=qs[_0x8c63('0x31')](_0x20d01f['query'][_0x8c63('0x31')]);_0xdb972f[_0x8c63('0x1a')]=qs[_0x8c63('0x1a')](_0x20d01f['query'][_0x8c63('0x1a')]);}_0xdb972f[_0x8c63('0x32')]=qs['sort'](_0x20d01f[_0x8c63('0x2a')]['sort']);_0xdb972f[_0x8c63('0x33')]=qs['filters'](_['pick'](_0x20d01f[_0x8c63('0x2a')],_0x89c1e6[_0x8c63('0x2b')]));if(_0x20d01f[_0x8c63('0x2a')][_0x8c63('0x34')]){_0xdb972f[_0x8c63('0x33')]=_[_0x8c63('0x35')](_0xdb972f[_0x8c63('0x33')],{'$or':_[_0x8c63('0x36')](_0x366060,function(_0x448cbf){if(_0x448cbf[_0x8c63('0x37')][_0x8c63('0x38')]!==_0x8c63('0x39')){var _0x3d2e95={};_0x3d2e95[_0x448cbf[_0x8c63('0x3a')]]={'$like':'%'+_0x20d01f[_0x8c63('0x2a')][_0x8c63('0x34')]+'%'};return _0x3d2e95;}})});}_0xdb972f=_[_0x8c63('0x35')]({},_0xdb972f,_0x20d01f[_0x8c63('0x3b')]);var _0xbf6142={'where':_0xdb972f[_0x8c63('0x33')]};return db[_0x8c63('0x26')][_0x8c63('0x19')](_0xbf6142)[_0x8c63('0x20')](function(_0x1ac950){_0x4d2dab[_0x8c63('0x19')]=_0x1ac950;if(_0x20d01f['query'][_0x8c63('0x3c')]){_0xdb972f[_0x8c63('0x3d')]=[{'all':!![]}];}return db[_0x8c63('0x26')][_0x8c63('0x3e')](_0xdb972f);})[_0x8c63('0x20')](function(_0x3b4f3c){_0x4d2dab[_0x8c63('0x3f')]=_0x3b4f3c;return _0x4d2dab;})[_0x8c63('0x20')](respondWithFilteredResult(_0x57ab1c,_0xdb972f))[_0x8c63('0x40')](handleError(_0x57ab1c,null));};exports[_0x8c63('0x41')]=function(_0x48db34,_0x86d965){var _0x28ca9d={'raw':!![],'where':{'id':_0x48db34[_0x8c63('0x42')]['id']}},_0x17ce6e={};_0x17ce6e[_0x8c63('0x28')]=_['keys'](db[_0x8c63('0x26')][_0x8c63('0x27')]);_0x17ce6e[_0x8c63('0x2a')]=_[_0x8c63('0x29')](_0x48db34[_0x8c63('0x2a')]);_0x17ce6e[_0x8c63('0x2b')]=_[_0x8c63('0x2c')](_0x17ce6e[_0x8c63('0x28')],_0x17ce6e[_0x8c63('0x2a')]);_0x28ca9d['attributes']=_[_0x8c63('0x2c')](_0x17ce6e[_0x8c63('0x28')],qs['fields'](_0x48db34[_0x8c63('0x2a')][_0x8c63('0x2e')]));_0x28ca9d[_0x8c63('0x2d')]=_0x28ca9d[_0x8c63('0x2d')]['length']?_0x28ca9d[_0x8c63('0x2d')]:_0x17ce6e[_0x8c63('0x28')];if(_0x48db34[_0x8c63('0x2a')][_0x8c63('0x3c')]){_0x28ca9d[_0x8c63('0x3d')]=[{'all':!![]}];}_0x28ca9d=_[_0x8c63('0x35')]({},_0x28ca9d,_0x48db34['options']);return db['MemberReport'][_0x8c63('0x43')](_0x28ca9d)[_0x8c63('0x20')](handleEntityNotFound(_0x86d965,null))[_0x8c63('0x20')](respondWithResult(_0x86d965,null))[_0x8c63('0x40')](handleError(_0x86d965,null));};exports[_0x8c63('0x44')]=function(_0x56af54,_0x5585b6){return db[_0x8c63('0x26')][_0x8c63('0x44')](_0x56af54[_0x8c63('0x45')],{})['then'](respondWithResult(_0x5585b6,0xc9))[_0x8c63('0x40')](handleError(_0x5585b6,null));};exports['update']=function(_0x51b8a2,_0x3ff2c5){if(_0x51b8a2[_0x8c63('0x45')]['id']){delete _0x51b8a2['body']['id'];}return db[_0x8c63('0x26')][_0x8c63('0x43')]({'where':{'id':_0x51b8a2[_0x8c63('0x42')]['id']}})[_0x8c63('0x20')](handleEntityNotFound(_0x3ff2c5,null))[_0x8c63('0x20')](saveUpdates(_0x51b8a2[_0x8c63('0x45')],null))[_0x8c63('0x20')](respondWithResult(_0x3ff2c5,null))[_0x8c63('0x40')](handleError(_0x3ff2c5,null));};exports[_0x8c63('0x21')]=function(_0x19b2b2,_0x56213a){return db[_0x8c63('0x26')]['find']({'where':{'id':_0x19b2b2[_0x8c63('0x42')]['id']}})[_0x8c63('0x20')](handleEntityNotFound(_0x56213a,null))[_0x8c63('0x20')](removeEntity(_0x56213a,null))[_0x8c63('0x40')](handleError(_0x56213a,null));};exports['describe']=function(_0x16b669,_0xb4787c){return db[_0x8c63('0x26')][_0x8c63('0x46')]()['then'](respondWithResult(_0xb4787c,null))[_0x8c63('0x40')](handleError(_0xb4787c,null));}; \ No newline at end of file +var _0x2f68=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','key','VIRTUAL','field','filter','then','include','findAll','show','params','includeAll','options','find','create','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../mysqldb','status','json','count','offset','limit','Content-Range','reject','save','update','destroy','sendStatus','error','name','send','index','MemberReport','rawAttributes','model','query','keys'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x2f68,0x12b));var _0x82f6=function(_0x186223,_0x21a38e){_0x186223=_0x186223-0x0;var _0x3dc609=_0x2f68[_0x186223];return _0x3dc609;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x82f6('0x0'));var rimraf=require(_0x82f6('0x1'));var zipdir=require(_0x82f6('0x2'));var jsonpatch=require(_0x82f6('0x3'));var rp=require(_0x82f6('0x4'));var moment=require('moment');var BPromise=require(_0x82f6('0x5'));var Mustache=require(_0x82f6('0x6'));var util=require(_0x82f6('0x7'));var path=require(_0x82f6('0x8'));var sox=require(_0x82f6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x82f6('0xa'));var squel=require('squel');var crypto=require(_0x82f6('0xb'));var jsforce=require(_0x82f6('0xc'));var deskjs=require(_0x82f6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x82f6('0xe'));var Papa=require(_0x82f6('0xf'));var authService=require(_0x82f6('0x10'));var hardwareService=require(_0x82f6('0x11'));var Redis=require('ioredis');var qs=require(_0x82f6('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x82f6('0x13'));var config=require('../../config/environment');var db=require(_0x82f6('0x14'))['db'];function respondWithStatusCode(_0x27def8,_0x4d8700){_0x4d8700=_0x4d8700||0xcc;return function(_0x470319){if(_0x470319){return _0x27def8['sendStatus'](_0x4d8700);}return _0x27def8[_0x82f6('0x15')](_0x4d8700)['end']();};}function respondWithResult(_0x4d139a,_0x22d172){_0x22d172=_0x22d172||0xc8;return function(_0xb4c0d7){if(_0xb4c0d7){return _0x4d139a[_0x82f6('0x15')](_0x22d172)[_0x82f6('0x16')](_0xb4c0d7);}};}function respondWithFilteredResult(_0x318a29,_0x28f3cf){return function(_0x3b0252){if(_0x3b0252){var _0x376b4b=_0x3b0252[_0x82f6('0x17')],_0x447987=_0x28f3cf[_0x82f6('0x18')],_0x42ef53=_0x28f3cf[_0x82f6('0x18')]+_0x28f3cf[_0x82f6('0x19')],_0x3ca73f;if(_0x42ef53>=_0x376b4b){_0x42ef53=_0x376b4b;_0x3ca73f=0xc8;}else{_0x3ca73f=0xce;}_0x318a29[_0x82f6('0x15')](_0x3ca73f);return _0x318a29['set'](_0x82f6('0x1a'),_0x447987+'-'+_0x42ef53+'/'+_0x376b4b)[_0x82f6('0x16')](_0x3b0252);}return null;};}function patchUpdates(_0x32b458){return function(_0x15c8c6){try{jsonpatch['apply'](_0x15c8c6,_0x32b458,!![]);}catch(_0x2de7b4){return BPromise[_0x82f6('0x1b')](_0x2de7b4);}return _0x15c8c6[_0x82f6('0x1c')]();};}function saveUpdates(_0xb22355,_0x52ebaf){return function(_0x3abb44){if(_0x3abb44){return _0x3abb44[_0x82f6('0x1d')](_0xb22355)['then'](function(_0x238de3){return _0x238de3;});}return null;};}function removeEntity(_0x2e65a2,_0x38e9e1){return function(_0x52085d){if(_0x52085d){return _0x52085d[_0x82f6('0x1e')]()['then'](function(){_0x2e65a2[_0x82f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37fb0c,_0xf58240){return function(_0xe45c){if(!_0xe45c){_0x37fb0c[_0x82f6('0x1f')](0x194);}return _0xe45c;};}function handleError(_0x390681,_0x4b9384){_0x4b9384=_0x4b9384||0x1f4;return function(_0x6aa93d){logger[_0x82f6('0x20')](_0x6aa93d['stack']);if(_0x6aa93d[_0x82f6('0x21')]){delete _0x6aa93d['name'];}_0x390681[_0x82f6('0x15')](_0x4b9384)[_0x82f6('0x22')](_0x6aa93d);};}exports[_0x82f6('0x23')]=function(_0x4b734e,_0x44a8ec){var _0x215991={},_0x547ce7={},_0x3350f2={'count':0x0,'rows':[]};var _0x1856af=db[_0x82f6('0x24')][_0x82f6('0x25')];_0x547ce7[_0x82f6('0x26')]=_['keys'](_0x1856af);_0x547ce7[_0x82f6('0x27')]=_[_0x82f6('0x28')](_0x4b734e[_0x82f6('0x27')]);_0x547ce7[_0x82f6('0x29')]=_[_0x82f6('0x2a')](_0x547ce7['model'],_0x547ce7[_0x82f6('0x27')]);_0x215991['attributes']=_[_0x82f6('0x2a')](_0x547ce7['model'],qs[_0x82f6('0x2b')](_0x4b734e['query'][_0x82f6('0x2b')]));_0x215991[_0x82f6('0x2c')]=_0x215991[_0x82f6('0x2c')][_0x82f6('0x2d')]?_0x215991['attributes']:_0x547ce7[_0x82f6('0x26')];if(!_0x4b734e['query'][_0x82f6('0x2e')](_0x82f6('0x2f'))){_0x215991['limit']=qs[_0x82f6('0x19')](_0x4b734e['query'][_0x82f6('0x19')]);_0x215991[_0x82f6('0x18')]=qs[_0x82f6('0x18')](_0x4b734e[_0x82f6('0x27')][_0x82f6('0x18')]);}_0x215991['order']=qs['sort'](_0x4b734e[_0x82f6('0x27')][_0x82f6('0x30')]);_0x215991[_0x82f6('0x31')]=qs[_0x82f6('0x29')](_[_0x82f6('0x32')](_0x4b734e[_0x82f6('0x27')],_0x547ce7[_0x82f6('0x29')]));if(_0x4b734e[_0x82f6('0x27')]['filter']){_0x215991[_0x82f6('0x31')]=_[_0x82f6('0x33')](_0x215991[_0x82f6('0x31')],{'$or':_['map'](_0x1856af,function(_0x2887bc){if(_0x2887bc[_0x82f6('0x34')][_0x82f6('0x35')]!==_0x82f6('0x36')){var _0x48d561={};_0x48d561[_0x2887bc[_0x82f6('0x37')]]={'$like':'%'+_0x4b734e[_0x82f6('0x27')][_0x82f6('0x38')]+'%'};return _0x48d561;}})});}_0x215991=_[_0x82f6('0x33')]({},_0x215991,_0x4b734e['options']);var _0x209edd={'where':_0x215991[_0x82f6('0x31')]};return db[_0x82f6('0x24')][_0x82f6('0x17')](_0x209edd)[_0x82f6('0x39')](function(_0x572858){_0x3350f2[_0x82f6('0x17')]=_0x572858;if(_0x4b734e[_0x82f6('0x27')]['includeAll']){_0x215991[_0x82f6('0x3a')]=[{'all':!![]}];}return db[_0x82f6('0x24')][_0x82f6('0x3b')](_0x215991);})[_0x82f6('0x39')](function(_0x39760e){_0x3350f2['rows']=_0x39760e;return _0x3350f2;})[_0x82f6('0x39')](respondWithFilteredResult(_0x44a8ec,_0x215991))['catch'](handleError(_0x44a8ec,null));};exports[_0x82f6('0x3c')]=function(_0x4d341d,_0x2e5b13){var _0x2be4b0={'raw':!![],'where':{'id':_0x4d341d[_0x82f6('0x3d')]['id']}},_0x200571={};_0x200571['model']=_['keys'](db[_0x82f6('0x24')][_0x82f6('0x25')]);_0x200571[_0x82f6('0x27')]=_[_0x82f6('0x28')](_0x4d341d[_0x82f6('0x27')]);_0x200571[_0x82f6('0x29')]=_[_0x82f6('0x2a')](_0x200571['model'],_0x200571[_0x82f6('0x27')]);_0x2be4b0[_0x82f6('0x2c')]=_[_0x82f6('0x2a')](_0x200571[_0x82f6('0x26')],qs['fields'](_0x4d341d[_0x82f6('0x27')][_0x82f6('0x2b')]));_0x2be4b0[_0x82f6('0x2c')]=_0x2be4b0[_0x82f6('0x2c')][_0x82f6('0x2d')]?_0x2be4b0[_0x82f6('0x2c')]:_0x200571[_0x82f6('0x26')];if(_0x4d341d[_0x82f6('0x27')][_0x82f6('0x3e')]){_0x2be4b0[_0x82f6('0x3a')]=[{'all':!![]}];}_0x2be4b0=_[_0x82f6('0x33')]({},_0x2be4b0,_0x4d341d[_0x82f6('0x3f')]);return db[_0x82f6('0x24')][_0x82f6('0x40')](_0x2be4b0)[_0x82f6('0x39')](handleEntityNotFound(_0x2e5b13,null))['then'](respondWithResult(_0x2e5b13,null))['catch'](handleError(_0x2e5b13,null));};exports[_0x82f6('0x41')]=function(_0x55bdf3,_0x2315c1){return db[_0x82f6('0x24')][_0x82f6('0x41')](_0x55bdf3['body'],{})[_0x82f6('0x39')](respondWithResult(_0x2315c1,0xc9))[_0x82f6('0x42')](handleError(_0x2315c1,null));};exports['update']=function(_0x5860bb,_0x1b0b1d){if(_0x5860bb['body']['id']){delete _0x5860bb['body']['id'];}return db[_0x82f6('0x24')]['find']({'where':{'id':_0x5860bb['params']['id']}})[_0x82f6('0x39')](handleEntityNotFound(_0x1b0b1d,null))['then'](saveUpdates(_0x5860bb['body'],null))[_0x82f6('0x39')](respondWithResult(_0x1b0b1d,null))['catch'](handleError(_0x1b0b1d,null));};exports[_0x82f6('0x1e')]=function(_0xff24e,_0x419d86){return db[_0x82f6('0x24')][_0x82f6('0x40')]({'where':{'id':_0xff24e[_0x82f6('0x3d')]['id']}})['then'](handleEntityNotFound(_0x419d86,null))['then'](removeEntity(_0x419d86,null))[_0x82f6('0x42')](handleError(_0x419d86,null));};exports[_0x82f6('0x43')]=function(_0x27a312,_0x3caab1){return db[_0x82f6('0x24')][_0x82f6('0x43')]()['then'](respondWithResult(_0x3caab1,null))[_0x82f6('0x42')](handleError(_0x3caab1,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index c2ac766..fa67267 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 _0x8359=['request-promise','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','../../config/logger','api','moment'];(function(_0x3fdf69,_0x2baee0){var _0x2cc3b1=function(_0x3e9959){while(--_0x3e9959){_0x3fdf69['push'](_0x3fdf69['shift']());}};_0x2cc3b1(++_0x2baee0);}(_0x8359,0x127));var _0x9835=function(_0x58de4a,_0x564dbc){_0x58de4a=_0x58de4a-0x0;var _0x178820=_0x8359[_0x58de4a];return _0x178820;};'use strict';var _=require(_0x9835('0x0'));var util=require('util');var logger=require(_0x9835('0x1'))(_0x9835('0x2'));var moment=require(_0x9835('0x3'));var BPromise=require('bluebird');var rp=require(_0x9835('0x4'));var attributes=require(_0x9835('0x5'));module[_0x9835('0x6')]=function(_0x3ab26b,_0x2e9fab){return _0x3ab26b[_0x9835('0x7')](_0x9835('0x8'),attributes,{'tableName':_0x9835('0x9'),'paranoid':![],'indexes':[{'name':_0x9835('0xa'),'fields':[_0x9835('0xb'),_0x9835('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2a19=['request-promise','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','interface','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0x2a19,0x14a));var _0x92a1=function(_0x8d1439,_0x552101){_0x8d1439=_0x8d1439-0x0;var _0x5e4509=_0x2a19[_0x8d1439];return _0x5e4509;};'use strict';var _=require(_0x92a1('0x0'));var util=require(_0x92a1('0x1'));var logger=require(_0x92a1('0x2'))(_0x92a1('0x3'));var moment=require(_0x92a1('0x4'));var BPromise=require(_0x92a1('0x5'));var rp=require(_0x92a1('0x6'));var attributes=require(_0x92a1('0x7'));module[_0x92a1('0x8')]=function(_0x345ac5,_0x17ea5f){return _0x345ac5[_0x92a1('0x9')](_0x92a1('0xa'),attributes,{'tableName':_0x92a1('0xb'),'paranoid':![],'indexes':[{'name':_0x92a1('0xc'),'fields':['membername',_0x92a1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index c780421..2666df8 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 _0xbfba=['where','attributes','limit','model','include','map','debug','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMemberReport','findAll','options','raw'];(function(_0x3a0c60,_0x167991){var _0x388633=function(_0x31f8c9){while(--_0x31f8c9){_0x3a0c60['push'](_0x3a0c60['shift']());}};_0x388633(++_0x167991);}(_0xbfba,0x1c4));var _0xabfb=function(_0x526270,_0x25aea4){_0x526270=_0x526270-0x0;var _0x44c115=_0xbfba[_0x526270];return _0x44c115;};'use strict';var _=require(_0xabfb('0x0'));var util=require(_0xabfb('0x1'));var moment=require(_0xabfb('0x2'));var BPromise=require(_0xabfb('0x3'));var rs=require(_0xabfb('0x4'));var fs=require('fs');var Redis=require(_0xabfb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xabfb('0x6'));var logger=require(_0xabfb('0x7'))(_0xabfb('0x8'));var config=require(_0xabfb('0x9'));var jayson=require(_0xabfb('0xa'));var client=jayson[_0xabfb('0xb')][_0xabfb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c97d5,_0x2bdae0,_0x1492e0){return new BPromise(function(_0x5e922a,_0x5f4e31){return client[_0xabfb('0xd')](_0x2c97d5,_0x1492e0)[_0xabfb('0xe')](function(_0x3d3347){logger[_0xabfb('0xf')](_0xabfb('0x10'),_0x2bdae0,_0xabfb('0x11'));logger['debug'](_0xabfb('0x12'),_0x2bdae0,_0xabfb('0x11'),JSON[_0xabfb('0x13')](_0x3d3347));if(_0x3d3347[_0xabfb('0x14')]){if(_0x3d3347['error'][_0xabfb('0x15')]===0x1f4){logger[_0xabfb('0x14')](_0xabfb('0x10'),_0x2bdae0,_0x3d3347[_0xabfb('0x14')][_0xabfb('0x16')]);return _0x5f4e31(_0x3d3347[_0xabfb('0x14')][_0xabfb('0x16')]);}logger[_0xabfb('0x14')](_0xabfb('0x10'),_0x2bdae0,_0x3d3347[_0xabfb('0x14')][_0xabfb('0x16')]);return _0x5e922a(_0x3d3347['error'][_0xabfb('0x16')]);}else{logger['info'](_0xabfb('0x10'),_0x2bdae0,'request\x20sent');_0x5e922a(_0x3d3347['result'][_0xabfb('0x16')]);}})[_0xabfb('0x17')](function(_0x47e845){logger[_0xabfb('0x14')](_0xabfb('0x10'),_0x2bdae0,_0x47e845);_0x5f4e31(_0x47e845);});});}exports[_0xabfb('0x18')]=function(_0xbff81d){var _0x1cf6ed=this;return new Promise(function(_0x1f5706,_0x3ae9d7){return db['MemberReport'][_0xabfb('0x19')]({'raw':_0xbff81d[_0xabfb('0x1a')]?_0xbff81d[_0xabfb('0x1a')][_0xabfb('0x1b')]===undefined?!![]:![]:!![],'where':_0xbff81d['options']?_0xbff81d[_0xabfb('0x1a')][_0xabfb('0x1c')]||null:null,'attributes':_0xbff81d[_0xabfb('0x1a')]?_0xbff81d['options'][_0xabfb('0x1d')]||null:null,'limit':_0xbff81d['options']?_0xbff81d[_0xabfb('0x1a')][_0xabfb('0x1e')]||null:null,'include':_0xbff81d[_0xabfb('0x1a')]?_0xbff81d['options']['include']?_['map'](_0xbff81d['options']['include'],function(_0x5cd332){return{'model':db[_0x5cd332[_0xabfb('0x1f')]],'as':_0x5cd332['as'],'attributes':_0x5cd332[_0xabfb('0x1d')],'include':_0x5cd332[_0xabfb('0x20')]?_[_0xabfb('0x21')](_0x5cd332[_0xabfb('0x20')],function(_0x39f72c){return{'model':db[_0x39f72c['model']],'as':_0x39f72c['as'],'attributes':_0x39f72c[_0xabfb('0x1d')],'include':_0x39f72c[_0xabfb('0x20')]?_[_0xabfb('0x21')](_0x39f72c[_0xabfb('0x20')],function(_0x20cc75){return{'model':db[_0x20cc75[_0xabfb('0x1f')]],'as':_0x20cc75['as'],'attributes':_0x20cc75['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xda3f7d){logger[_0xabfb('0xf')](_0xabfb('0x18'),_0xbff81d);logger[_0xabfb('0x22')](_0xabfb('0x18'),_0xbff81d,JSON[_0xabfb('0x13')](_0xda3f7d));_0x1f5706(_0xda3f7d);})[_0xabfb('0x17')](function(_0x209894){logger[_0xabfb('0x14')](_0xabfb('0x18'),_0x209894['message'],_0xbff81d);_0x3ae9d7(_0x1cf6ed['error'](0x1f4,_0x209894['message']));});});};exports[_0xabfb('0x23')]=function(_0x3d76a1){var _0x59be8a=this;return new Promise(function(_0x557487,_0x54888c){return db[_0xabfb('0x24')][_0xabfb('0x25')](_0x3d76a1[_0xabfb('0x26')],{'raw':_0x3d76a1[_0xabfb('0x1a')]?_0x3d76a1[_0xabfb('0x1a')][_0xabfb('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x33b117){logger[_0xabfb('0xf')](_0xabfb('0x23'),_0x3d76a1);logger[_0xabfb('0x22')](_0xabfb('0x23'),_0x3d76a1,JSON[_0xabfb('0x13')](_0x33b117));_0x557487(_0x33b117);})[_0xabfb('0x17')](function(_0x21b999){logger[_0xabfb('0x14')](_0xabfb('0x23'),_0x21b999[_0xabfb('0x16')],_0x3d76a1);_0x54888c(_0x59be8a[_0xabfb('0x14')](0x1f4,_0x21b999[_0xabfb('0x16')]));});});};exports[_0xabfb('0x27')]=function(_0x5c0676){var _0x233e1b=this;return new Promise(function(_0x16f639,_0x56cd8a){return db[_0xabfb('0x24')]['update'](_0x5c0676[_0xabfb('0x26')],{'raw':_0x5c0676['options']?_0x5c0676['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c0676['options']?_0x5c0676[_0xabfb('0x1a')][_0xabfb('0x1c')]||null:null,'attributes':_0x5c0676[_0xabfb('0x1a')]?_0x5c0676[_0xabfb('0x1a')][_0xabfb('0x1d')]||null:null,'limit':_0x5c0676[_0xabfb('0x1a')]?_0x5c0676[_0xabfb('0x1a')]['limit']||null:null})['then'](function(_0xbbafd7){logger[_0xabfb('0xf')]('UpdateMemberReport',_0x5c0676);logger['debug'](_0xabfb('0x27'),_0x5c0676,JSON[_0xabfb('0x13')](_0xbbafd7));_0x16f639(_0xbbafd7);})[_0xabfb('0x17')](function(_0x3f68e7){logger[_0xabfb('0x14')](_0xabfb('0x27'),_0x3f68e7[_0xabfb('0x16')],_0x5c0676);_0x56cd8a(_0x233e1b[_0xabfb('0x14')](0x1f4,_0x3f68e7['message']));});});}; \ No newline at end of file +var _0xa0a8=['map','include','model','then','debug','stringify','CreateMemberReport','MemberReport','body','catch','UpdateMemberReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','GetMemberReport','options','raw','where','attributes','limit'];(function(_0xa57936,_0x4698d8){var _0x327085=function(_0x3d47a8){while(--_0x3d47a8){_0xa57936['push'](_0xa57936['shift']());}};_0x327085(++_0x4698d8);}(_0xa0a8,0xfc));var _0x8a0a=function(_0x34ecfb,_0x2cfac9){_0x34ecfb=_0x34ecfb-0x0;var _0x2abc3e=_0xa0a8[_0x34ecfb];return _0x2abc3e;};'use strict';var _=require(_0x8a0a('0x0'));var util=require(_0x8a0a('0x1'));var moment=require('moment');var BPromise=require(_0x8a0a('0x2'));var rs=require(_0x8a0a('0x3'));var fs=require('fs');var Redis=require(_0x8a0a('0x4'));var db=require(_0x8a0a('0x5'))['db'];var utils=require(_0x8a0a('0x6'));var logger=require(_0x8a0a('0x7'))(_0x8a0a('0x8'));var config=require(_0x8a0a('0x9'));var jayson=require(_0x8a0a('0xa'));var client=jayson[_0x8a0a('0xb')][_0x8a0a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x589075,_0x1cd842,_0x24e030){return new BPromise(function(_0x299bc3,_0x1587c6){return client[_0x8a0a('0xd')](_0x589075,_0x24e030)['then'](function(_0x1783ac){logger[_0x8a0a('0xe')](_0x8a0a('0xf'),_0x1cd842,_0x8a0a('0x10'));logger['debug'](_0x8a0a('0x11'),_0x1cd842,_0x8a0a('0x10'),JSON['stringify'](_0x1783ac));if(_0x1783ac[_0x8a0a('0x12')]){if(_0x1783ac[_0x8a0a('0x12')][_0x8a0a('0x13')]===0x1f4){logger[_0x8a0a('0x12')](_0x8a0a('0xf'),_0x1cd842,_0x1783ac[_0x8a0a('0x12')][_0x8a0a('0x14')]);return _0x1587c6(_0x1783ac[_0x8a0a('0x12')][_0x8a0a('0x14')]);}logger[_0x8a0a('0x12')](_0x8a0a('0xf'),_0x1cd842,_0x1783ac[_0x8a0a('0x12')]['message']);return _0x299bc3(_0x1783ac['error']['message']);}else{logger[_0x8a0a('0xe')](_0x8a0a('0xf'),_0x1cd842,_0x8a0a('0x10'));_0x299bc3(_0x1783ac[_0x8a0a('0x15')][_0x8a0a('0x14')]);}})['catch'](function(_0x36cbcb){logger['error'](_0x8a0a('0xf'),_0x1cd842,_0x36cbcb);_0x1587c6(_0x36cbcb);});});}exports[_0x8a0a('0x16')]=function(_0x13c76f){var _0x1ce0cb=this;return new Promise(function(_0xc9afd2,_0x29cbe0){return db['MemberReport']['findAll']({'raw':_0x13c76f[_0x8a0a('0x17')]?_0x13c76f[_0x8a0a('0x17')][_0x8a0a('0x18')]===undefined?!![]:![]:!![],'where':_0x13c76f['options']?_0x13c76f[_0x8a0a('0x17')][_0x8a0a('0x19')]||null:null,'attributes':_0x13c76f[_0x8a0a('0x17')]?_0x13c76f[_0x8a0a('0x17')][_0x8a0a('0x1a')]||null:null,'limit':_0x13c76f['options']?_0x13c76f[_0x8a0a('0x17')][_0x8a0a('0x1b')]||null:null,'include':_0x13c76f[_0x8a0a('0x17')]?_0x13c76f[_0x8a0a('0x17')]['include']?_[_0x8a0a('0x1c')](_0x13c76f['options'][_0x8a0a('0x1d')],function(_0x490bfc){return{'model':db[_0x490bfc[_0x8a0a('0x1e')]],'as':_0x490bfc['as'],'attributes':_0x490bfc['attributes'],'include':_0x490bfc[_0x8a0a('0x1d')]?_[_0x8a0a('0x1c')](_0x490bfc[_0x8a0a('0x1d')],function(_0x5600e8){return{'model':db[_0x5600e8[_0x8a0a('0x1e')]],'as':_0x5600e8['as'],'attributes':_0x5600e8['attributes'],'include':_0x5600e8[_0x8a0a('0x1d')]?_[_0x8a0a('0x1c')](_0x5600e8['include'],function(_0x35f321){return{'model':db[_0x35f321[_0x8a0a('0x1e')]],'as':_0x35f321['as'],'attributes':_0x35f321[_0x8a0a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8a0a('0x1f')](function(_0x42cc58){logger[_0x8a0a('0xe')](_0x8a0a('0x16'),_0x13c76f);logger[_0x8a0a('0x20')](_0x8a0a('0x16'),_0x13c76f,JSON[_0x8a0a('0x21')](_0x42cc58));_0xc9afd2(_0x42cc58);})['catch'](function(_0x4f6155){logger['error'](_0x8a0a('0x16'),_0x4f6155['message'],_0x13c76f);_0x29cbe0(_0x1ce0cb[_0x8a0a('0x12')](0x1f4,_0x4f6155['message']));});});};exports[_0x8a0a('0x22')]=function(_0x5dd6fc){var _0x3d1c5a=this;return new Promise(function(_0x1075dc,_0x48a343){return db[_0x8a0a('0x23')]['create'](_0x5dd6fc[_0x8a0a('0x24')],{'raw':_0x5dd6fc[_0x8a0a('0x17')]?_0x5dd6fc[_0x8a0a('0x17')][_0x8a0a('0x18')]===undefined?!![]:![]:!![]})[_0x8a0a('0x1f')](function(_0x868129){logger[_0x8a0a('0xe')](_0x8a0a('0x22'),_0x5dd6fc);logger[_0x8a0a('0x20')](_0x8a0a('0x22'),_0x5dd6fc,JSON[_0x8a0a('0x21')](_0x868129));_0x1075dc(_0x868129);})[_0x8a0a('0x25')](function(_0x29cb25){logger[_0x8a0a('0x12')]('CreateMemberReport',_0x29cb25[_0x8a0a('0x14')],_0x5dd6fc);_0x48a343(_0x3d1c5a['error'](0x1f4,_0x29cb25[_0x8a0a('0x14')]));});});};exports[_0x8a0a('0x26')]=function(_0x4d5e01){var _0x133817=this;return new Promise(function(_0x2b3226,_0x5790fc){return db[_0x8a0a('0x23')][_0x8a0a('0x27')](_0x4d5e01['body'],{'raw':_0x4d5e01[_0x8a0a('0x17')]?_0x4d5e01[_0x8a0a('0x17')][_0x8a0a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d5e01['options']?_0x4d5e01['options'][_0x8a0a('0x19')]||null:null,'attributes':_0x4d5e01[_0x8a0a('0x17')]?_0x4d5e01['options'][_0x8a0a('0x1a')]||null:null,'limit':_0x4d5e01[_0x8a0a('0x17')]?_0x4d5e01[_0x8a0a('0x17')][_0x8a0a('0x1b')]||null:null})[_0x8a0a('0x1f')](function(_0x985426){logger[_0x8a0a('0xe')](_0x8a0a('0x26'),_0x4d5e01);logger[_0x8a0a('0x20')](_0x8a0a('0x26'),_0x4d5e01,JSON[_0x8a0a('0x21')](_0x985426));_0x2b3226(_0x985426);})[_0x8a0a('0x25')](function(_0x443cee){logger['error'](_0x8a0a('0x26'),_0x443cee['message'],_0x4d5e01);_0x5790fc(_0x133817[_0x8a0a('0x12')](0x1f4,_0x443cee[_0x8a0a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 2159d3e..d6361b4 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 _0x6258=['./migration.controller','get','index','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x5b1b97,_0x2f94d5){var _0x4b189d=function(_0x526f24){while(--_0x526f24){_0x5b1b97['push'](_0x5b1b97['shift']());}};_0x4b189d(++_0x2f94d5);}(_0x6258,0x117));var _0x8625=function(_0x5babf4,_0x5c7650){_0x5babf4=_0x5babf4-0x0;var _0x10896a=_0x6258[_0x5babf4];return _0x10896a;};'use strict';var multer=require(_0x8625('0x0'));var util=require('util');var path=require(_0x8625('0x1'));var timeout=require(_0x8625('0x2'));var express=require(_0x8625('0x3'));var router=express[_0x8625('0x4')]();var auth=require(_0x8625('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8625('0x6'));var controller=require(_0x8625('0x7'));router[_0x8625('0x8')]('/',controller[_0x8625('0x9')]);module[_0x8625('0xa')]=router; \ No newline at end of file +var _0x1963=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','util','path','connect-timeout'];(function(_0x5ddb91,_0x50a3c6){var _0x222f31=function(_0x543d54){while(--_0x543d54){_0x5ddb91['push'](_0x5ddb91['shift']());}};_0x222f31(++_0x50a3c6);}(_0x1963,0x171));var _0x3196=function(_0x4110da,_0x85f1af){_0x4110da=_0x4110da-0x0;var _0x5b0b30=_0x1963[_0x4110da];return _0x5b0b30;};'use strict';var multer=require('multer');var util=require(_0x3196('0x0'));var path=require(_0x3196('0x1'));var timeout=require(_0x3196('0x2'));var express=require(_0x3196('0x3'));var router=express[_0x3196('0x4')]();var auth=require(_0x3196('0x5'));var interaction=require(_0x3196('0x6'));var config=require(_0x3196('0x7'));var controller=require(_0x3196('0x8'));router[_0x3196('0x9')]('/',controller[_0x3196('0xa')]);module[_0x3196('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 16de830..e590467 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 _0x17b1=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17b1,0x7a));var _0x117b=function(_0x430095,_0x122722){_0x430095=_0x430095-0x0;var _0x115f8a=_0x17b1[_0x430095];return _0x115f8a;};'use strict';var Sequelize=require(_0x117b('0x0'));module[_0x117b('0x1')]={'version':{'type':Sequelize[_0x117b('0x2')],'primaryKey':!![],'autoIncrement':![]}}; \ No newline at end of file +var _0x3713=['sequelize','exports','STRING'];(function(_0x5bccb8,_0x45866){var _0x3ec26a=function(_0x4f0876){while(--_0x4f0876){_0x5bccb8['push'](_0x5bccb8['shift']());}};_0x3ec26a(++_0x45866);}(_0x3713,0xa2));var _0x3371=function(_0x230df0,_0x244d3c){_0x230df0=_0x230df0-0x0;var _0xf0cd24=_0x3713[_0x230df0];return _0xf0cd24;};'use strict';var Sequelize=require(_0x3371('0x0'));module[_0x3371('0x1')]={'version':{'type':Sequelize[_0x3371('0x2')],'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 d78f6ed..344f523 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 _0xc390=['intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','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','reject','save','update','then','destroy','error','stack','name','send','index','Migration','rawAttributes','model','keys','filters'];(function(_0x89407,_0x519198){var _0x2bf4bf=function(_0x52b0f9){while(--_0x52b0f9){_0x89407['push'](_0x89407['shift']());}};_0x2bf4bf(++_0x519198);}(_0xc390,0x9f));var _0x0c39=function(_0xbcd873,_0x1b6be7){_0xbcd873=_0xbcd873-0x0;var _0x303fa8=_0xc390[_0xbcd873];return _0x303fa8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0c39('0x0'));var rimraf=require(_0x0c39('0x1'));var zipdir=require(_0x0c39('0x2'));var jsonpatch=require(_0x0c39('0x3'));var rp=require(_0x0c39('0x4'));var moment=require('moment');var BPromise=require(_0x0c39('0x5'));var Mustache=require(_0x0c39('0x6'));var util=require('util');var path=require(_0x0c39('0x7'));var sox=require(_0x0c39('0x8'));var csv=require('to-csv');var ejs=require(_0x0c39('0x9'));var fs=require('fs');var _=require(_0x0c39('0xa'));var squel=require(_0x0c39('0xb'));var crypto=require('crypto');var jsforce=require(_0x0c39('0xc'));var deskjs=require(_0x0c39('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0c39('0xe'));var authService=require(_0x0c39('0xf'));var hardwareService=require(_0x0c39('0x10'));var Redis=require(_0x0c39('0x11'));var qs=require(_0x0c39('0x12'));var logger=require(_0x0c39('0x13'))(_0x0c39('0x14'));var utils=require(_0x0c39('0x15'));var config=require(_0x0c39('0x16'));var db=require(_0x0c39('0x17'))['db'];function respondWithStatusCode(_0x2a2c17,_0x335a1c){_0x335a1c=_0x335a1c||0xcc;return function(_0x3b512c){if(_0x3b512c){return _0x2a2c17[_0x0c39('0x18')](_0x335a1c);}return _0x2a2c17[_0x0c39('0x19')](_0x335a1c)[_0x0c39('0x1a')]();};}function respondWithResult(_0x54e9ef,_0x27796f){_0x27796f=_0x27796f||0xc8;return function(_0x41b4ee){if(_0x41b4ee){return _0x54e9ef[_0x0c39('0x19')](_0x27796f)[_0x0c39('0x1b')](_0x41b4ee);}};}function respondWithFilteredResult(_0x34cd93,_0x285fa6){return function(_0xc7c667){if(_0xc7c667){var _0x2abbfe=_0xc7c667[_0x0c39('0x1c')],_0x9ab72d=_0x285fa6[_0x0c39('0x1d')],_0x28c0f1=_0x285fa6['offset']+_0x285fa6[_0x0c39('0x1e')],_0x12b79c;if(_0x28c0f1>=_0x2abbfe){_0x28c0f1=_0x2abbfe;_0x12b79c=0xc8;}else{_0x12b79c=0xce;}_0x34cd93[_0x0c39('0x19')](_0x12b79c);return _0x34cd93[_0x0c39('0x1f')](_0x0c39('0x20'),_0x9ab72d+'-'+_0x28c0f1+'/'+_0x2abbfe)[_0x0c39('0x1b')](_0xc7c667);}return null;};}function patchUpdates(_0x39e165){return function(_0x2360a4){try{jsonpatch['apply'](_0x2360a4,_0x39e165,!![]);}catch(_0x520d8d){return BPromise[_0x0c39('0x21')](_0x520d8d);}return _0x2360a4[_0x0c39('0x22')]();};}function saveUpdates(_0x2b5304,_0x392d5c){return function(_0x5044d7){if(_0x5044d7){return _0x5044d7[_0x0c39('0x23')](_0x2b5304)[_0x0c39('0x24')](function(_0x216f3c){return _0x216f3c;});}return null;};}function removeEntity(_0x582fad,_0x18d721){return function(_0x1d58c0){if(_0x1d58c0){return _0x1d58c0[_0x0c39('0x25')]()[_0x0c39('0x24')](function(){_0x582fad[_0x0c39('0x19')](0xcc)[_0x0c39('0x1a')]();});}};}function handleEntityNotFound(_0x1d721e,_0xa578f6){return function(_0x2e30b4){if(!_0x2e30b4){_0x1d721e[_0x0c39('0x18')](0x194);}return _0x2e30b4;};}function handleError(_0x5eef5e,_0x1c0d21){_0x1c0d21=_0x1c0d21||0x1f4;return function(_0x38c2cc){logger[_0x0c39('0x26')](_0x38c2cc[_0x0c39('0x27')]);if(_0x38c2cc[_0x0c39('0x28')]){delete _0x38c2cc[_0x0c39('0x28')];}_0x5eef5e[_0x0c39('0x19')](_0x1c0d21)[_0x0c39('0x29')](_0x38c2cc);};}exports[_0x0c39('0x2a')]=function(_0x552d0f,_0x34c857){var _0x343ea8={},_0x5884b7={},_0x1debcd={'count':0x0,'rows':[]};var _0x47ffeb=db[_0x0c39('0x2b')][_0x0c39('0x2c')];_0x5884b7[_0x0c39('0x2d')]=_[_0x0c39('0x2e')](_0x47ffeb);_0x5884b7['query']=_[_0x0c39('0x2e')](_0x552d0f['query']);_0x5884b7[_0x0c39('0x2f')]=_[_0x0c39('0x30')](_0x5884b7[_0x0c39('0x2d')],_0x5884b7[_0x0c39('0x31')]);_0x343ea8[_0x0c39('0x32')]=_['intersection'](_0x5884b7[_0x0c39('0x2d')],qs[_0x0c39('0x33')](_0x552d0f[_0x0c39('0x31')][_0x0c39('0x33')]));_0x343ea8['attributes']=_0x343ea8['attributes'][_0x0c39('0x34')]?_0x343ea8[_0x0c39('0x32')]:_0x5884b7[_0x0c39('0x2d')];if(!_0x552d0f['query'][_0x0c39('0x35')](_0x0c39('0x36'))){_0x343ea8['limit']=qs[_0x0c39('0x1e')](_0x552d0f[_0x0c39('0x31')][_0x0c39('0x1e')]);_0x343ea8[_0x0c39('0x1d')]=qs[_0x0c39('0x1d')](_0x552d0f[_0x0c39('0x31')][_0x0c39('0x1d')]);}_0x343ea8['order']=qs[_0x0c39('0x37')](_0x552d0f[_0x0c39('0x31')]['sort']);_0x343ea8['where']=qs[_0x0c39('0x2f')](_[_0x0c39('0x38')](_0x552d0f[_0x0c39('0x31')],_0x5884b7[_0x0c39('0x2f')]));if(_0x552d0f[_0x0c39('0x31')][_0x0c39('0x39')]){_0x343ea8[_0x0c39('0x3a')]=_[_0x0c39('0x3b')](_0x343ea8[_0x0c39('0x3a')],{'$or':_[_0x0c39('0x3c')](_0x47ffeb,function(_0x455ebe){if(_0x455ebe[_0x0c39('0x3d')]['key']!==_0x0c39('0x3e')){var _0x3c57ba={};_0x3c57ba[_0x455ebe[_0x0c39('0x3f')]]={'$like':'%'+_0x552d0f[_0x0c39('0x31')][_0x0c39('0x39')]+'%'};return _0x3c57ba;}})});}_0x343ea8=_[_0x0c39('0x3b')]({},_0x343ea8,_0x552d0f[_0x0c39('0x40')]);var _0x12abc4={'where':_0x343ea8[_0x0c39('0x3a')]};return db['Migration'][_0x0c39('0x1c')](_0x12abc4)[_0x0c39('0x24')](function(_0x17e9f7){_0x1debcd['count']=_0x17e9f7;if(_0x552d0f[_0x0c39('0x31')][_0x0c39('0x41')]){_0x343ea8[_0x0c39('0x42')]=[{'all':!![]}];}return db[_0x0c39('0x2b')]['findAll'](_0x343ea8);})[_0x0c39('0x24')](function(_0x235cfa){_0x1debcd[_0x0c39('0x43')]=_0x235cfa;return _0x1debcd;})[_0x0c39('0x24')](respondWithFilteredResult(_0x34c857,_0x343ea8))[_0x0c39('0x44')](handleError(_0x34c857,null));}; \ No newline at end of file +var _0x8811=['../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','update','error','stack','name','send','Migration','rawAttributes','keys','query','intersection','model','fields','attributes','length','nolimit','limit','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','then','includeAll','include','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x8811,0x1a2));var _0x1881=function(_0x15bd45,_0x2267f4){_0x15bd45=_0x15bd45-0x0;var _0x127818=_0x8811[_0x15bd45];return _0x127818;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1881('0x0'));var rimraf=require(_0x1881('0x1'));var zipdir=require(_0x1881('0x2'));var jsonpatch=require(_0x1881('0x3'));var rp=require(_0x1881('0x4'));var moment=require(_0x1881('0x5'));var BPromise=require(_0x1881('0x6'));var Mustache=require(_0x1881('0x7'));var util=require('util');var path=require(_0x1881('0x8'));var sox=require(_0x1881('0x9'));var csv=require(_0x1881('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1881('0xb'));var squel=require(_0x1881('0xc'));var crypto=require(_0x1881('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1881('0xe'));var toCsv=require(_0x1881('0xa'));var querystring=require(_0x1881('0xf'));var Papa=require('papaparse');var authService=require(_0x1881('0x10'));var hardwareService=require(_0x1881('0x11'));var Redis=require('ioredis');var qs=require(_0x1881('0x12'));var logger=require(_0x1881('0x13'))('api');var utils=require(_0x1881('0x14'));var config=require(_0x1881('0x15'));var db=require(_0x1881('0x16'))['db'];function respondWithStatusCode(_0x78dadf,_0x5a0edb){_0x5a0edb=_0x5a0edb||0xcc;return function(_0x559b7e){if(_0x559b7e){return _0x78dadf[_0x1881('0x17')](_0x5a0edb);}return _0x78dadf[_0x1881('0x18')](_0x5a0edb)[_0x1881('0x19')]();};}function respondWithResult(_0x4411eb,_0x18f348){_0x18f348=_0x18f348||0xc8;return function(_0x175580){if(_0x175580){return _0x4411eb[_0x1881('0x18')](_0x18f348)[_0x1881('0x1a')](_0x175580);}};}function respondWithFilteredResult(_0x4a0086,_0x1343f8){return function(_0x3ffe50){if(_0x3ffe50){var _0x22f32d=_0x3ffe50[_0x1881('0x1b')],_0x4b73dd=_0x1343f8[_0x1881('0x1c')],_0x292234=_0x1343f8[_0x1881('0x1c')]+_0x1343f8['limit'],_0x501ad8;if(_0x292234>=_0x22f32d){_0x292234=_0x22f32d;_0x501ad8=0xc8;}else{_0x501ad8=0xce;}_0x4a0086[_0x1881('0x18')](_0x501ad8);return _0x4a0086[_0x1881('0x1d')](_0x1881('0x1e'),_0x4b73dd+'-'+_0x292234+'/'+_0x22f32d)[_0x1881('0x1a')](_0x3ffe50);}return null;};}function patchUpdates(_0x350c6a){return function(_0x13706c){try{jsonpatch[_0x1881('0x1f')](_0x13706c,_0x350c6a,!![]);}catch(_0x184941){return BPromise['reject'](_0x184941);}return _0x13706c['save']();};}function saveUpdates(_0x5daf85,_0x52fc62){return function(_0x1a1452){if(_0x1a1452){return _0x1a1452[_0x1881('0x20')](_0x5daf85)['then'](function(_0x15357b){return _0x15357b;});}return null;};}function removeEntity(_0x500542,_0x188be2){return function(_0x2d2bd4){if(_0x2d2bd4){return _0x2d2bd4['destroy']()['then'](function(){_0x500542[_0x1881('0x18')](0xcc)[_0x1881('0x19')]();});}};}function handleEntityNotFound(_0x309f35,_0x138bda){return function(_0x3c5376){if(!_0x3c5376){_0x309f35['sendStatus'](0x194);}return _0x3c5376;};}function handleError(_0x5beeac,_0x1a086c){_0x1a086c=_0x1a086c||0x1f4;return function(_0x6e05fb){logger[_0x1881('0x21')](_0x6e05fb[_0x1881('0x22')]);if(_0x6e05fb[_0x1881('0x23')]){delete _0x6e05fb[_0x1881('0x23')];}_0x5beeac[_0x1881('0x18')](_0x1a086c)[_0x1881('0x24')](_0x6e05fb);};}exports['index']=function(_0x31646f,_0x956224){var _0x31335c={},_0x2f714c={},_0x517414={'count':0x0,'rows':[]};var _0x3be7b1=db[_0x1881('0x25')][_0x1881('0x26')];_0x2f714c['model']=_[_0x1881('0x27')](_0x3be7b1);_0x2f714c[_0x1881('0x28')]=_['keys'](_0x31646f[_0x1881('0x28')]);_0x2f714c['filters']=_[_0x1881('0x29')](_0x2f714c['model'],_0x2f714c[_0x1881('0x28')]);_0x31335c['attributes']=_[_0x1881('0x29')](_0x2f714c[_0x1881('0x2a')],qs['fields'](_0x31646f[_0x1881('0x28')][_0x1881('0x2b')]));_0x31335c['attributes']=_0x31335c[_0x1881('0x2c')][_0x1881('0x2d')]?_0x31335c[_0x1881('0x2c')]:_0x2f714c[_0x1881('0x2a')];if(!_0x31646f[_0x1881('0x28')]['hasOwnProperty'](_0x1881('0x2e'))){_0x31335c['limit']=qs['limit'](_0x31646f['query'][_0x1881('0x2f')]);_0x31335c[_0x1881('0x1c')]=qs['offset'](_0x31646f[_0x1881('0x28')][_0x1881('0x1c')]);}_0x31335c['order']=qs['sort'](_0x31646f['query']['sort']);_0x31335c[_0x1881('0x30')]=qs[_0x1881('0x31')](_[_0x1881('0x32')](_0x31646f[_0x1881('0x28')],_0x2f714c[_0x1881('0x31')]));if(_0x31646f[_0x1881('0x28')][_0x1881('0x33')]){_0x31335c[_0x1881('0x30')]=_[_0x1881('0x34')](_0x31335c[_0x1881('0x30')],{'$or':_[_0x1881('0x35')](_0x3be7b1,function(_0x2a1190){if(_0x2a1190[_0x1881('0x36')][_0x1881('0x37')]!==_0x1881('0x38')){var _0x1889a7={};_0x1889a7[_0x2a1190['field']]={'$like':'%'+_0x31646f[_0x1881('0x28')][_0x1881('0x33')]+'%'};return _0x1889a7;}})});}_0x31335c=_[_0x1881('0x34')]({},_0x31335c,_0x31646f[_0x1881('0x39')]);var _0x1b10c1={'where':_0x31335c['where']};return db['Migration'][_0x1881('0x1b')](_0x1b10c1)[_0x1881('0x3a')](function(_0x2de30e){_0x517414[_0x1881('0x1b')]=_0x2de30e;if(_0x31646f['query'][_0x1881('0x3b')]){_0x31335c[_0x1881('0x3c')]=[{'all':!![]}];}return db[_0x1881('0x25')][_0x1881('0x3d')](_0x31335c);})['then'](function(_0x240c2f){_0x517414['rows']=_0x240c2f;return _0x517414;})[_0x1881('0x3a')](respondWithFilteredResult(_0x956224,_0x31335c))['catch'](handleError(_0x956224,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 65ddda8..795cb26 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 _0x508a=['exports','Migration','migrations','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3de01a,_0xcc1fd4){var _0x43f31e=function(_0xf8e692){while(--_0xf8e692){_0x3de01a['push'](_0x3de01a['shift']());}};_0x43f31e(++_0xcc1fd4);}(_0x508a,0x1aa));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa508('0x0'));var util=require('util');var logger=require(_0xa508('0x1'))(_0xa508('0x2'));var moment=require(_0xa508('0x3'));var BPromise=require(_0xa508('0x4'));var rp=require(_0xa508('0x5'));var attributes=require('./migration.attributes');module[_0xa508('0x6')]=function(_0x40f2f0,_0x2e26ae){return _0x40f2f0['define'](_0xa508('0x7'),attributes,{'tableName':_0xa508('0x8'),'paranoid':![],'indexes':[],'timestamps':![]});}; \ No newline at end of file +var _0xc0d7=['moment','bluebird','request-promise','./migration.attributes','exports','define','migrations','api'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x3d3546,_0x1687d4){_0x3d3546=_0x3d3546-0x0;var _0x44fe75=_0xc0d7[_0x3d3546];return _0x44fe75;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7c0d('0x0'));var moment=require(_0x7c0d('0x1'));var BPromise=require(_0x7c0d('0x2'));var rp=require(_0x7c0d('0x3'));var attributes=require(_0x7c0d('0x4'));module[_0x7c0d('0x5')]=function(_0xfbd3c8,_0x276b49){return _0xfbd3c8[_0x7c0d('0x6')]('Migration',attributes,{'tableName':_0x7c0d('0x7'),'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 54c1481..9cfb769 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 _0x24ca=['request\x20sent','debug','Migration,\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','Migration,\x20%s,\x20%s'];(function(_0x39f15c,_0x4e4da2){var _0xe7e43c=function(_0x3e7292){while(--_0x3e7292){_0x39f15c['push'](_0x39f15c['shift']());}};_0xe7e43c(++_0x4e4da2);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0x24ca[_0x5280f4];return _0xba93e7;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){return client[_0xa24c('0xc')](_0x2dd348,_0x9a5013)[_0xa24c('0xd')](function(_0x5eac78){logger[_0xa24c('0xe')](_0xa24c('0xf'),_0x257264,_0xa24c('0x10'));logger[_0xa24c('0x11')](_0xa24c('0x12'),_0x257264,_0xa24c('0x10'),JSON[_0xa24c('0x13')](_0x5eac78));if(_0x5eac78[_0xa24c('0x14')]){if(_0x5eac78[_0xa24c('0x14')]['code']===0x1f4){logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x42d89c(_0x5eac78['error'][_0xa24c('0x15')]);}logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x481196(_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x257264,_0xa24c('0x10'));_0x481196(_0x5eac78[_0xa24c('0x16')]['message']);}})['catch'](function(_0x221d21){logger[_0xa24c('0x14')]('Migration,\x20%s,\x20%s',_0x257264,_0x221d21);_0x42d89c(_0x221d21);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Migration,\x20%s,\x20%s','message','catch','util'];(function(_0x352255,_0x4f5adf){var _0x2d1931=function(_0x25a103){while(--_0x25a103){_0x352255['push'](_0x352255['shift']());}};_0x2d1931(++_0x4f5adf);}(_0xedd9,0xfc));var _0x9edd=function(_0x3e1c7f,_0x2d927b){_0x3e1c7f=_0x3e1c7f-0x0;var _0x5f3213=_0xedd9[_0x3e1c7f];return _0x5f3213;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('Migration,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('Migration,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 37d528e..7b0b14e 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 _0x7fd4=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x275caa,_0x166d5e){var _0x28d670=function(_0x2a20e1){while(--_0x2a20e1){_0x275caa['push'](_0x275caa['shift']());}};_0x28d670(++_0x166d5e);}(_0x7fd4,0x117));var _0x47fd=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x7fd4[_0x4e7d25];return _0x526fe6;};'use strict';var multer=require(_0x47fd('0x0'));var util=require(_0x47fd('0x1'));var path=require('path');var timeout=require(_0x47fd('0x2'));var express=require(_0x47fd('0x3'));var router=express[_0x47fd('0x4')]();var auth=require(_0x47fd('0x5'));var interaction=require(_0x47fd('0x6'));var config=require(_0x47fd('0x7'));var controller=require('./network.controller');router[_0x47fd('0x8')]('/',auth[_0x47fd('0x9')](),controller[_0x47fd('0xa')]);router[_0x47fd('0x8')](_0x47fd('0xb'),auth[_0x47fd('0x9')](),controller[_0x47fd('0xc')]);router[_0x47fd('0xd')]('/',auth[_0x47fd('0x9')](),controller['create']);router[_0x47fd('0xe')](_0x47fd('0xb'),auth[_0x47fd('0x9')](),controller[_0x47fd('0xf')]);router[_0x47fd('0x10')](_0x47fd('0xb'),auth[_0x47fd('0x9')](),controller[_0x47fd('0x11')]);module[_0x47fd('0x12')]=router; \ No newline at end of file +var _0xbe25=['destroy','exports','multer','util','path','connect-timeout','express','./network.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete'];(function(_0x5198d3,_0x28f2ce){var _0xb145dd=function(_0x88d32f){while(--_0x88d32f){_0x5198d3['push'](_0x5198d3['shift']());}};_0xb145dd(++_0x28f2ce);}(_0xbe25,0x1ab));var _0x5be2=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xbe25[_0x344a3f];return _0x264712;};'use strict';var multer=require(_0x5be2('0x0'));var util=require(_0x5be2('0x1'));var path=require(_0x5be2('0x2'));var timeout=require(_0x5be2('0x3'));var express=require(_0x5be2('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(_0x5be2('0x5'));router[_0x5be2('0x6')]('/',auth[_0x5be2('0x7')](),controller[_0x5be2('0x8')]);router[_0x5be2('0x6')](_0x5be2('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x5be2('0xa')]('/',auth[_0x5be2('0x7')](),controller[_0x5be2('0xb')]);router[_0x5be2('0xc')](_0x5be2('0x9'),auth[_0x5be2('0x7')](),controller[_0x5be2('0xd')]);router[_0x5be2('0xe')](_0x5be2('0x9'),auth['isAuthenticated'](),controller[_0x5be2('0xf')]);module[_0x5be2('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 6c9081d..5df00db 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 _0xd332=['localnet','sequelize'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xd332,0xdb));var _0x2d33=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xd332[_0x4fbfd9];return _0x31dc94;};'use strict';var Sequelize=require(_0x2d33('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x2d33('0x1'),'externip')},'value':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x230e=['exports','localnet','externip','sequelize'];(function(_0x422945,_0x159d82){var _0x2dda86=function(_0x131744){while(--_0x131744){_0x422945['push'](_0x422945['shift']());}};_0x2dda86(++_0x159d82);}(_0x230e,0x16f));var _0xe230=function(_0x1415ac,_0x48591f){_0x1415ac=_0x1415ac-0x0;var _0x40e7eb=_0x230e[_0x1415ac];return _0x40e7eb;};'use strict';var Sequelize=require(_0xe230('0x0'));module[_0xe230('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe230('0x2'),_0xe230('0x3'))},'value':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index cf7157d..fce1b76 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 _0xc80e=['querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','count','offset','limit','Content-Range','apply','reject','update','sendStatus','stack','name','send','Network','rawAttributes','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','filter','merge','map','type','key','field','options','includeAll','rows','catch','find','sequelize','transaction','create','body','findAll','readFileSync','join','root','utf8','render','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','params','writeFileSync','format','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc80e,0x152));var _0xec80=function(_0x5e6fca,_0x540568){_0x5e6fca=_0x5e6fca-0x0;var _0x505941=_0xc80e[_0x5e6fca];return _0x505941;};'use strict';var pdf=require(_0xec80('0x0'));var emlformat=require(_0xec80('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xec80('0x2'));var jsonpatch=require(_0xec80('0x3'));var rp=require(_0xec80('0x4'));var moment=require('moment');var BPromise=require(_0xec80('0x5'));var Mustache=require(_0xec80('0x6'));var util=require(_0xec80('0x7'));var path=require('path');var sox=require(_0xec80('0x8'));var csv=require(_0xec80('0x9'));var ejs=require(_0xec80('0xa'));var fs=require('fs');var _=require(_0xec80('0xb'));var squel=require('squel');var crypto=require(_0xec80('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xec80('0xd'));var toCsv=require(_0xec80('0x9'));var querystring=require(_0xec80('0xe'));var Papa=require('papaparse');var authService=require(_0xec80('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xec80('0x10'));var logger=require('../../config/logger')(_0xec80('0x11'));var utils=require(_0xec80('0x12'));var config=require(_0xec80('0x13'));var db=require(_0xec80('0x14'))['db'];var jayson=require(_0xec80('0x15'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x399cdd,_0x29d9a5,_0x26f5d8,_0x3a8784){return new BPromise(function(_0x179518,_0x1f1a7){var _0x4f66c0=_0x3a8784||client;return _0x4f66c0[_0xec80('0x16')](_0x399cdd,_0x26f5d8)[_0xec80('0x17')](function(_0x2e23f3){logger[_0xec80('0x18')](_0xec80('0x19'),_0x29d9a5,_0xec80('0x1a'));logger[_0xec80('0x1b')](_0xec80('0x1c'),_0x29d9a5,'request\x20sent',JSON[_0xec80('0x1d')](_0x2e23f3));if(_0x2e23f3['error']){if(_0x2e23f3[_0xec80('0x1e')]['code']===0x1f4){logger[_0xec80('0x1e')](_0xec80('0x19'),_0x29d9a5,_0x2e23f3[_0xec80('0x1e')]['message']);return _0x1f1a7(_0x2e23f3[_0xec80('0x1e')][_0xec80('0x1f')]);}logger['error'](_0xec80('0x19'),_0x29d9a5,_0x2e23f3[_0xec80('0x1e')][_0xec80('0x1f')]);return _0x179518(_0x2e23f3['error'][_0xec80('0x1f')]);}else{logger[_0xec80('0x18')]('Network,\x20%s,\x20%s',_0x29d9a5,_0xec80('0x1a'));_0x179518(_0x2e23f3[_0xec80('0x20')]['message']);}})['catch'](function(_0xb353ab){logger[_0xec80('0x1e')](_0xec80('0x19'),_0x29d9a5,_0xb353ab);_0x1f1a7(_0xb353ab);});});}function respondWithStatusCode(_0x474de0,_0x2e8134){_0x2e8134=_0x2e8134||0xcc;return function(_0x27fa9c){if(_0x27fa9c){return _0x474de0['sendStatus'](_0x2e8134);}return _0x474de0[_0xec80('0x21')](_0x2e8134)[_0xec80('0x22')]();};}function respondWithResult(_0x5da672,_0xd24edc){_0xd24edc=_0xd24edc||0xc8;return function(_0x4673e4){if(_0x4673e4){return _0x5da672[_0xec80('0x21')](_0xd24edc)[_0xec80('0x23')](_0x4673e4);}};}function respondWithFilteredResult(_0x967a9f,_0x51b8c8){return function(_0x1dc036){if(_0x1dc036){var _0x5af91c=_0x1dc036[_0xec80('0x24')],_0x2446d2=_0x51b8c8[_0xec80('0x25')],_0x463987=_0x51b8c8[_0xec80('0x25')]+_0x51b8c8[_0xec80('0x26')],_0x7d570e;if(_0x463987>=_0x5af91c){_0x463987=_0x5af91c;_0x7d570e=0xc8;}else{_0x7d570e=0xce;}_0x967a9f[_0xec80('0x21')](_0x7d570e);return _0x967a9f['set'](_0xec80('0x27'),_0x2446d2+'-'+_0x463987+'/'+_0x5af91c)[_0xec80('0x23')](_0x1dc036);}return null;};}function patchUpdates(_0x2372b3){return function(_0x8c6d3){try{jsonpatch[_0xec80('0x28')](_0x8c6d3,_0x2372b3,!![]);}catch(_0x2255f7){return BPromise[_0xec80('0x29')](_0x2255f7);}return _0x8c6d3['save']();};}function saveUpdates(_0x4332af,_0x3251b3){return function(_0x59e8e2){if(_0x59e8e2){return _0x59e8e2[_0xec80('0x2a')](_0x4332af)['then'](function(_0x1656ab){return _0x1656ab;});}return null;};}function removeEntity(_0xeca8fc,_0x3c684b){return function(_0x4ba016){if(_0x4ba016){return _0x4ba016['destroy']()[_0xec80('0x17')](function(){_0xeca8fc[_0xec80('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b1853,_0x5010fb){return function(_0x3ad798){if(!_0x3ad798){_0x5b1853[_0xec80('0x2b')](0x194);}return _0x3ad798;};}function handleError(_0x204180,_0x54082b){_0x54082b=_0x54082b||0x1f4;return function(_0x2f78a3){logger[_0xec80('0x1e')](_0x2f78a3[_0xec80('0x2c')]);if(_0x2f78a3['name']){delete _0x2f78a3[_0xec80('0x2d')];}_0x204180[_0xec80('0x21')](_0x54082b)[_0xec80('0x2e')](_0x2f78a3);};}exports['index']=function(_0x54d5b7,_0x39a976){var _0xf0ac3c={},_0x185eb6={},_0x4d3d47={'count':0x0,'rows':[]};var _0x274746=db[_0xec80('0x2f')][_0xec80('0x30')];_0x185eb6[_0xec80('0x31')]=_['keys'](_0x274746);_0x185eb6[_0xec80('0x32')]=_[_0xec80('0x33')](_0x54d5b7[_0xec80('0x32')]);_0x185eb6[_0xec80('0x34')]=_[_0xec80('0x35')](_0x185eb6[_0xec80('0x31')],_0x185eb6[_0xec80('0x32')]);_0xf0ac3c['attributes']=_[_0xec80('0x35')](_0x185eb6['model'],qs[_0xec80('0x36')](_0x54d5b7[_0xec80('0x32')][_0xec80('0x36')]));_0xf0ac3c['attributes']=_0xf0ac3c[_0xec80('0x37')]['length']?_0xf0ac3c[_0xec80('0x37')]:_0x185eb6[_0xec80('0x31')];if(!_0x54d5b7['query']['hasOwnProperty'](_0xec80('0x38'))){_0xf0ac3c[_0xec80('0x26')]=qs[_0xec80('0x26')](_0x54d5b7[_0xec80('0x32')][_0xec80('0x26')]);_0xf0ac3c[_0xec80('0x25')]=qs[_0xec80('0x25')](_0x54d5b7[_0xec80('0x32')]['offset']);}_0xf0ac3c['order']=qs[_0xec80('0x39')](_0x54d5b7['query'][_0xec80('0x39')]);_0xf0ac3c[_0xec80('0x3a')]=qs['filters'](_['pick'](_0x54d5b7['query'],_0x185eb6[_0xec80('0x34')]));if(_0x54d5b7[_0xec80('0x32')][_0xec80('0x3b')]){_0xf0ac3c[_0xec80('0x3a')]=_[_0xec80('0x3c')](_0xf0ac3c['where'],{'$or':_[_0xec80('0x3d')](_0x274746,function(_0x509133){if(_0x509133[_0xec80('0x3e')][_0xec80('0x3f')]!=='VIRTUAL'){var _0x47f3b4={};_0x47f3b4[_0x509133[_0xec80('0x40')]]={'$like':'%'+_0x54d5b7[_0xec80('0x32')]['filter']+'%'};return _0x47f3b4;}})});}_0xf0ac3c=_[_0xec80('0x3c')]({},_0xf0ac3c,_0x54d5b7[_0xec80('0x41')]);var _0x521e12={'where':_0xf0ac3c[_0xec80('0x3a')]};return db[_0xec80('0x2f')]['count'](_0x521e12)[_0xec80('0x17')](function(_0x3ccf8b){_0x4d3d47[_0xec80('0x24')]=_0x3ccf8b;if(_0x54d5b7['query'][_0xec80('0x42')]){_0xf0ac3c['include']=[{'all':!![]}];}return db[_0xec80('0x2f')]['findAll'](_0xf0ac3c);})[_0xec80('0x17')](function(_0x447d2c){_0x4d3d47[_0xec80('0x43')]=_0x447d2c;return _0x4d3d47;})[_0xec80('0x17')](respondWithFilteredResult(_0x39a976,_0xf0ac3c))[_0xec80('0x44')](handleError(_0x39a976,null));};exports['show']=function(_0x1a959f,_0x46b47a){var _0x1ad476={'raw':!![],'where':{'id':_0x1a959f['params']['id']}},_0x11840d={};_0x11840d['model']=_[_0xec80('0x33')](db[_0xec80('0x2f')][_0xec80('0x30')]);_0x11840d[_0xec80('0x32')]=_['keys'](_0x1a959f[_0xec80('0x32')]);_0x11840d[_0xec80('0x34')]=_['intersection'](_0x11840d['model'],_0x11840d[_0xec80('0x32')]);_0x1ad476['attributes']=_['intersection'](_0x11840d['model'],qs[_0xec80('0x36')](_0x1a959f[_0xec80('0x32')][_0xec80('0x36')]));_0x1ad476['attributes']=_0x1ad476[_0xec80('0x37')]['length']?_0x1ad476['attributes']:_0x11840d[_0xec80('0x31')];if(_0x1a959f[_0xec80('0x32')][_0xec80('0x42')]){_0x1ad476['include']=[{'all':!![]}];}_0x1ad476=_[_0xec80('0x3c')]({},_0x1ad476,_0x1a959f[_0xec80('0x41')]);return db[_0xec80('0x2f')][_0xec80('0x45')](_0x1ad476)[_0xec80('0x17')](handleEntityNotFound(_0x46b47a,null))['then'](respondWithResult(_0x46b47a,null))[_0xec80('0x44')](handleError(_0x46b47a,null));};exports['create']=function(_0x12946b,_0x2155a7,_0x223218){var _0x298de6;return db[_0xec80('0x46')][_0xec80('0x47')](function(_0x338d55){return db[_0xec80('0x2f')][_0xec80('0x48')](_0x12946b[_0xec80('0x49')],{'raw':!![]})[_0xec80('0x17')](function(_0x51c7e0){_0x298de6=_0x51c7e0;return db[_0xec80('0x2f')][_0xec80('0x4a')]({'where':{'type':_0x12946b[_0xec80('0x49')][_0xec80('0x3e')]},'raw':!![]});})[_0xec80('0x17')](function(_0x33dc50){var _0x32154a=fs[_0xec80('0x4b')](path[_0xec80('0x4c')](config[_0xec80('0x4d')],'server/files/templates/network.ejs'),_0xec80('0x4e'));var _0x4bfcf5=ejs[_0xec80('0x4f')](_0x32154a,{'networks':_0x33dc50||[]});fs['writeFileSync'](util['format'](_0xec80('0x50'),_0x12946b[_0xec80('0x49')][_0xec80('0x3e')][_0xec80('0x51')]()),_0x4bfcf5);})[_0xec80('0x17')](function(){return respondWithRpcPromise(_0xec80('0x52'),_0xec80('0x48'),{'module':_0xec80('0x53')});})[_0xec80('0x17')](function(){return _0x298de6;});})[_0xec80('0x17')](respondWithResult(_0x2155a7,0xc9))['catch'](handleError(_0x2155a7,null));};exports['update']=function(_0x43ef45,_0x21084c,_0x5714b8){var _0x490e9c;return db['sequelize'][_0xec80('0x47')](function(_0x43d869){return db[_0xec80('0x2f')][_0xec80('0x45')]({'where':{'id':_0x43ef45[_0xec80('0x54')]['id']}})['then'](handleEntityNotFound(_0x21084c,null))['then'](saveUpdates(_0x43ef45[_0xec80('0x49')],null))[_0xec80('0x17')](function(_0x2ce34b){if(_0x2ce34b){_0x490e9c=_0x2ce34b;return db[_0xec80('0x2f')][_0xec80('0x4a')]({'where':{'type':_0x490e9c[_0xec80('0x3e')]},'raw':!![]});}return null;})[_0xec80('0x17')](function(_0x5bc4b1){if(_0x5bc4b1){var _0x3566f6=fs['readFileSync'](path[_0xec80('0x4c')](config[_0xec80('0x4d')],'server/files/templates/network.ejs'),_0xec80('0x4e'));var _0x1530b4=ejs[_0xec80('0x4f')](_0x3566f6,{'networks':_0x5bc4b1||[]});fs[_0xec80('0x55')](util[_0xec80('0x56')](_0xec80('0x50'),_0x490e9c[_0xec80('0x3e')]['toLowerCase']()),_0x1530b4);return respondWithRpcPromise(_0xec80('0x52'),_0xec80('0x2a'),{'module':_0xec80('0x53')});}return null;})[_0xec80('0x17')](function(_0x56668f){if(_0x56668f){return _0x490e9c;}return null;});})[_0xec80('0x17')](respondWithResult(_0x21084c,null))[_0xec80('0x44')](handleError(_0x21084c,null));};exports[_0xec80('0x57')]=function(_0xc88369,_0x3cd94a,_0x139692){var _0x17113d;return db['Network'][_0xec80('0x45')]({'where':{'id':_0xc88369[_0xec80('0x54')]['id']}})[_0xec80('0x17')](function(_0x881d2d){_0x17113d=_0x881d2d;return _0x881d2d;})[_0xec80('0x17')](handleEntityNotFound(_0x3cd94a,null))[_0xec80('0x17')](removeEntity(_0x3cd94a,null))[_0xec80('0x17')](function(){if(_0x17113d){return db[_0xec80('0x2f')][_0xec80('0x4a')]({'where':{'type':_0x17113d['type']},'raw':!![]});}})[_0xec80('0x17')](function(_0x3b4777){if(_0x3b4777){var _0x18b1b8=fs[_0xec80('0x4b')](path[_0xec80('0x4c')](config['root'],'server/files/templates/network.ejs'),_0xec80('0x4e'));var _0xa65586=ejs[_0xec80('0x4f')](_0x18b1b8,{'networks':_0x3b4777||[]});fs[_0xec80('0x55')](util['format'](_0xec80('0x50'),_0x17113d['type']['toLowerCase']()),_0xa65586);return respondWithRpcPromise(_0xec80('0x52'),_0xec80('0x57'),{'module':_0xec80('0x53')});}})[_0xec80('0x44')](handleError(_0x3cd94a,null));}; \ No newline at end of file +var _0x8b62=['html-pdf','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','Network','rawAttributes','keys','query','intersection','attributes','model','fields','length','limit','order','sort','filters','pick','filter','where','merge','map','type','VIRTUAL','field','options','include','findAll','rows','show','params','find','create','sequelize','transaction','body','join','root','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','readFileSync','server/files/templates/network.ejs'];(function(_0x9beaba,_0x279c65){var _0x3637bf=function(_0x4d2f4d){while(--_0x4d2f4d){_0x9beaba['push'](_0x9beaba['shift']());}};_0x3637bf(++_0x279c65);}(_0x8b62,0x184));var _0x28b6=function(_0x6aad74,_0x32ecf4){_0x6aad74=_0x6aad74-0x0;var _0x5b1c38=_0x8b62[_0x6aad74];return _0x5b1c38;};'use strict';var pdf=require(_0x28b6('0x0'));var emlformat=require(_0x28b6('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x28b6('0x2'));var rp=require(_0x28b6('0x3'));var moment=require('moment');var BPromise=require(_0x28b6('0x4'));var Mustache=require('mustache');var util=require(_0x28b6('0x5'));var path=require(_0x28b6('0x6'));var sox=require(_0x28b6('0x7'));var csv=require(_0x28b6('0x8'));var ejs=require(_0x28b6('0x9'));var fs=require('fs');var _=require(_0x28b6('0xa'));var squel=require(_0x28b6('0xb'));var crypto=require(_0x28b6('0xc'));var jsforce=require(_0x28b6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x28b6('0x8'));var querystring=require(_0x28b6('0xe'));var Papa=require(_0x28b6('0xf'));var authService=require(_0x28b6('0x10'));var hardwareService=require(_0x28b6('0x11'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x28b6('0x12'))(_0x28b6('0x13'));var utils=require(_0x28b6('0x14'));var config=require(_0x28b6('0x15'));var db=require(_0x28b6('0x16'))['db'];var jayson=require(_0x28b6('0x17'));var client=jayson['client'][_0x28b6('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3d670e,_0x479849,_0x19331d,_0x2c3afe){return new BPromise(function(_0x5f3897,_0x559cb5){var _0x5e2ed3=_0x2c3afe||client;return _0x5e2ed3[_0x28b6('0x19')](_0x3d670e,_0x19331d)[_0x28b6('0x1a')](function(_0x20a5e2){logger[_0x28b6('0x1b')](_0x28b6('0x1c'),_0x479849,_0x28b6('0x1d'));logger[_0x28b6('0x1e')](_0x28b6('0x1f'),_0x479849,_0x28b6('0x1d'),JSON['stringify'](_0x20a5e2));if(_0x20a5e2['error']){if(_0x20a5e2[_0x28b6('0x20')][_0x28b6('0x21')]===0x1f4){logger[_0x28b6('0x20')](_0x28b6('0x1c'),_0x479849,_0x20a5e2[_0x28b6('0x20')]['message']);return _0x559cb5(_0x20a5e2[_0x28b6('0x20')][_0x28b6('0x22')]);}logger[_0x28b6('0x20')](_0x28b6('0x1c'),_0x479849,_0x20a5e2['error'][_0x28b6('0x22')]);return _0x5f3897(_0x20a5e2[_0x28b6('0x20')][_0x28b6('0x22')]);}else{logger['info'](_0x28b6('0x1c'),_0x479849,_0x28b6('0x1d'));_0x5f3897(_0x20a5e2[_0x28b6('0x23')]['message']);}})[_0x28b6('0x24')](function(_0x3c5734){logger[_0x28b6('0x20')](_0x28b6('0x1c'),_0x479849,_0x3c5734);_0x559cb5(_0x3c5734);});});}function respondWithStatusCode(_0x367bc9,_0x225440){_0x225440=_0x225440||0xcc;return function(_0x4acc15){if(_0x4acc15){return _0x367bc9[_0x28b6('0x25')](_0x225440);}return _0x367bc9[_0x28b6('0x26')](_0x225440)['end']();};}function respondWithResult(_0x360d61,_0x3b7b4d){_0x3b7b4d=_0x3b7b4d||0xc8;return function(_0x447997){if(_0x447997){return _0x360d61['status'](_0x3b7b4d)['json'](_0x447997);}};}function respondWithFilteredResult(_0x74c4b7,_0x4bc0f6){return function(_0x5fa74a){if(_0x5fa74a){var _0x1c6884=_0x5fa74a[_0x28b6('0x27')],_0x31e09b=_0x4bc0f6['offset'],_0xa553aa=_0x4bc0f6[_0x28b6('0x28')]+_0x4bc0f6['limit'],_0x13df58;if(_0xa553aa>=_0x1c6884){_0xa553aa=_0x1c6884;_0x13df58=0xc8;}else{_0x13df58=0xce;}_0x74c4b7[_0x28b6('0x26')](_0x13df58);return _0x74c4b7[_0x28b6('0x29')](_0x28b6('0x2a'),_0x31e09b+'-'+_0xa553aa+'/'+_0x1c6884)[_0x28b6('0x2b')](_0x5fa74a);}return null;};}function patchUpdates(_0x5657){return function(_0x5cc993){try{jsonpatch[_0x28b6('0x2c')](_0x5cc993,_0x5657,!![]);}catch(_0x5b47d1){return BPromise[_0x28b6('0x2d')](_0x5b47d1);}return _0x5cc993[_0x28b6('0x2e')]();};}function saveUpdates(_0x1af939,_0x29ed54){return function(_0x53b799){if(_0x53b799){return _0x53b799[_0x28b6('0x2f')](_0x1af939)[_0x28b6('0x1a')](function(_0x2f9a03){return _0x2f9a03;});}return null;};}function removeEntity(_0x8dea80,_0x321a2f){return function(_0x521ac1){if(_0x521ac1){return _0x521ac1[_0x28b6('0x30')]()[_0x28b6('0x1a')](function(){_0x8dea80['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f4c09,_0x533be8){return function(_0x4a9f1e){if(!_0x4a9f1e){_0x2f4c09['sendStatus'](0x194);}return _0x4a9f1e;};}function handleError(_0x477b41,_0x4a813c){_0x4a813c=_0x4a813c||0x1f4;return function(_0x981af2){logger[_0x28b6('0x20')](_0x981af2[_0x28b6('0x31')]);if(_0x981af2[_0x28b6('0x32')]){delete _0x981af2[_0x28b6('0x32')];}_0x477b41['status'](_0x4a813c)[_0x28b6('0x33')](_0x981af2);};}exports[_0x28b6('0x34')]=function(_0x159f5e,_0x49a0c5){var _0xf91c73={},_0x36f567={},_0x516219={'count':0x0,'rows':[]};var _0x1fb8e1=db[_0x28b6('0x35')][_0x28b6('0x36')];_0x36f567['model']=_[_0x28b6('0x37')](_0x1fb8e1);_0x36f567[_0x28b6('0x38')]=_[_0x28b6('0x37')](_0x159f5e[_0x28b6('0x38')]);_0x36f567['filters']=_[_0x28b6('0x39')](_0x36f567['model'],_0x36f567[_0x28b6('0x38')]);_0xf91c73[_0x28b6('0x3a')]=_['intersection'](_0x36f567[_0x28b6('0x3b')],qs['fields'](_0x159f5e[_0x28b6('0x38')][_0x28b6('0x3c')]));_0xf91c73[_0x28b6('0x3a')]=_0xf91c73[_0x28b6('0x3a')][_0x28b6('0x3d')]?_0xf91c73['attributes']:_0x36f567[_0x28b6('0x3b')];if(!_0x159f5e['query']['hasOwnProperty']('nolimit')){_0xf91c73[_0x28b6('0x3e')]=qs['limit'](_0x159f5e[_0x28b6('0x38')][_0x28b6('0x3e')]);_0xf91c73[_0x28b6('0x28')]=qs[_0x28b6('0x28')](_0x159f5e[_0x28b6('0x38')][_0x28b6('0x28')]);}_0xf91c73[_0x28b6('0x3f')]=qs['sort'](_0x159f5e['query'][_0x28b6('0x40')]);_0xf91c73['where']=qs[_0x28b6('0x41')](_[_0x28b6('0x42')](_0x159f5e['query'],_0x36f567[_0x28b6('0x41')]));if(_0x159f5e['query'][_0x28b6('0x43')]){_0xf91c73[_0x28b6('0x44')]=_[_0x28b6('0x45')](_0xf91c73[_0x28b6('0x44')],{'$or':_[_0x28b6('0x46')](_0x1fb8e1,function(_0x37c68b){if(_0x37c68b[_0x28b6('0x47')]['key']!==_0x28b6('0x48')){var _0x5d3560={};_0x5d3560[_0x37c68b[_0x28b6('0x49')]]={'$like':'%'+_0x159f5e[_0x28b6('0x38')][_0x28b6('0x43')]+'%'};return _0x5d3560;}})});}_0xf91c73=_[_0x28b6('0x45')]({},_0xf91c73,_0x159f5e[_0x28b6('0x4a')]);var _0x197b05={'where':_0xf91c73[_0x28b6('0x44')]};return db[_0x28b6('0x35')][_0x28b6('0x27')](_0x197b05)[_0x28b6('0x1a')](function(_0x8b647){_0x516219[_0x28b6('0x27')]=_0x8b647;if(_0x159f5e[_0x28b6('0x38')]['includeAll']){_0xf91c73[_0x28b6('0x4b')]=[{'all':!![]}];}return db['Network'][_0x28b6('0x4c')](_0xf91c73);})[_0x28b6('0x1a')](function(_0x99698b){_0x516219[_0x28b6('0x4d')]=_0x99698b;return _0x516219;})[_0x28b6('0x1a')](respondWithFilteredResult(_0x49a0c5,_0xf91c73))[_0x28b6('0x24')](handleError(_0x49a0c5,null));};exports[_0x28b6('0x4e')]=function(_0x2377b3,_0x5bd574){var _0x42f85c={'raw':!![],'where':{'id':_0x2377b3[_0x28b6('0x4f')]['id']}},_0x255c49={};_0x255c49['model']=_[_0x28b6('0x37')](db[_0x28b6('0x35')][_0x28b6('0x36')]);_0x255c49['query']=_['keys'](_0x2377b3[_0x28b6('0x38')]);_0x255c49[_0x28b6('0x41')]=_['intersection'](_0x255c49[_0x28b6('0x3b')],_0x255c49['query']);_0x42f85c[_0x28b6('0x3a')]=_[_0x28b6('0x39')](_0x255c49[_0x28b6('0x3b')],qs[_0x28b6('0x3c')](_0x2377b3[_0x28b6('0x38')][_0x28b6('0x3c')]));_0x42f85c[_0x28b6('0x3a')]=_0x42f85c[_0x28b6('0x3a')][_0x28b6('0x3d')]?_0x42f85c[_0x28b6('0x3a')]:_0x255c49[_0x28b6('0x3b')];if(_0x2377b3[_0x28b6('0x38')]['includeAll']){_0x42f85c['include']=[{'all':!![]}];}_0x42f85c=_[_0x28b6('0x45')]({},_0x42f85c,_0x2377b3[_0x28b6('0x4a')]);return db[_0x28b6('0x35')][_0x28b6('0x50')](_0x42f85c)['then'](handleEntityNotFound(_0x5bd574,null))['then'](respondWithResult(_0x5bd574,null))[_0x28b6('0x24')](handleError(_0x5bd574,null));};exports[_0x28b6('0x51')]=function(_0x4b16b4,_0xe3211b,_0x50453d){var _0x496c99;return db[_0x28b6('0x52')][_0x28b6('0x53')](function(_0x2c5298){return db[_0x28b6('0x35')][_0x28b6('0x51')](_0x4b16b4[_0x28b6('0x54')],{'raw':!![]})[_0x28b6('0x1a')](function(_0xcf60eb){_0x496c99=_0xcf60eb;return db[_0x28b6('0x35')][_0x28b6('0x4c')]({'where':{'type':_0x4b16b4[_0x28b6('0x54')][_0x28b6('0x47')]},'raw':!![]});})['then'](function(_0xf37327){var _0x5a1417=fs['readFileSync'](path[_0x28b6('0x55')](config[_0x28b6('0x56')],'server/files/templates/network.ejs'),_0x28b6('0x57'));var _0xbf8d6a=ejs[_0x28b6('0x58')](_0x5a1417,{'networks':_0xf37327||[]});fs[_0x28b6('0x59')](util[_0x28b6('0x5a')](_0x28b6('0x5b'),_0x4b16b4[_0x28b6('0x54')][_0x28b6('0x47')][_0x28b6('0x5c')]()),_0xbf8d6a);})[_0x28b6('0x1a')](function(){return respondWithRpcPromise(_0x28b6('0x5d'),_0x28b6('0x51'),{'module':_0x28b6('0x5e')});})[_0x28b6('0x1a')](function(){return _0x496c99;});})[_0x28b6('0x1a')](respondWithResult(_0xe3211b,0xc9))['catch'](handleError(_0xe3211b,null));};exports[_0x28b6('0x2f')]=function(_0x24b281,_0x1255aa,_0x4e66f1){var _0x24f81f;return db[_0x28b6('0x52')][_0x28b6('0x53')](function(_0x380053){return db[_0x28b6('0x35')][_0x28b6('0x50')]({'where':{'id':_0x24b281[_0x28b6('0x4f')]['id']}})[_0x28b6('0x1a')](handleEntityNotFound(_0x1255aa,null))[_0x28b6('0x1a')](saveUpdates(_0x24b281[_0x28b6('0x54')],null))['then'](function(_0x1e3530){if(_0x1e3530){_0x24f81f=_0x1e3530;return db[_0x28b6('0x35')][_0x28b6('0x4c')]({'where':{'type':_0x24f81f[_0x28b6('0x47')]},'raw':!![]});}return null;})[_0x28b6('0x1a')](function(_0x118611){if(_0x118611){var _0x4e1f22=fs[_0x28b6('0x5f')](path[_0x28b6('0x55')](config['root'],'server/files/templates/network.ejs'),_0x28b6('0x57'));var _0x22a711=ejs[_0x28b6('0x58')](_0x4e1f22,{'networks':_0x118611||[]});fs[_0x28b6('0x59')](util['format'](_0x28b6('0x5b'),_0x24f81f['type'][_0x28b6('0x5c')]()),_0x22a711);return respondWithRpcPromise(_0x28b6('0x5d'),_0x28b6('0x2f'),{'module':_0x28b6('0x5e')});}return null;})[_0x28b6('0x1a')](function(_0x408f83){if(_0x408f83){return _0x24f81f;}return null;});})['then'](respondWithResult(_0x1255aa,null))['catch'](handleError(_0x1255aa,null));};exports[_0x28b6('0x30')]=function(_0x37b7ff,_0x3851c1,_0x1351e0){var _0x107f29;return db[_0x28b6('0x35')]['find']({'where':{'id':_0x37b7ff[_0x28b6('0x4f')]['id']}})[_0x28b6('0x1a')](function(_0x11b788){_0x107f29=_0x11b788;return _0x11b788;})['then'](handleEntityNotFound(_0x3851c1,null))[_0x28b6('0x1a')](removeEntity(_0x3851c1,null))[_0x28b6('0x1a')](function(){if(_0x107f29){return db[_0x28b6('0x35')][_0x28b6('0x4c')]({'where':{'type':_0x107f29[_0x28b6('0x47')]},'raw':!![]});}})[_0x28b6('0x1a')](function(_0x2b88be){if(_0x2b88be){var _0x2ae4ba=fs[_0x28b6('0x5f')](path[_0x28b6('0x55')](config[_0x28b6('0x56')],_0x28b6('0x60')),_0x28b6('0x57'));var _0x2575c0=ejs[_0x28b6('0x58')](_0x2ae4ba,{'networks':_0x2b88be||[]});fs[_0x28b6('0x59')](util[_0x28b6('0x5a')](_0x28b6('0x5b'),_0x107f29[_0x28b6('0x47')]['toLowerCase']()),_0x2575c0);return respondWithRpcPromise('Reload','destroy',{'module':_0x28b6('0x5e')});}})[_0x28b6('0x24')](handleError(_0x3851c1,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 721cffe..0af8fc2 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 _0xe027=['lodash','util','../../config/logger','moment','bluebird','request-promise','./network.attributes','exports','define','Network','network'];(function(_0x2eb14b,_0x4053ad){var _0x224ed3=function(_0x5d3dcb){while(--_0x5d3dcb){_0x2eb14b['push'](_0x2eb14b['shift']());}};_0x224ed3(++_0x4053ad);}(_0xe027,0x16b));var _0x7e02=function(_0x2707af,_0x1f68b6){_0x2707af=_0x2707af-0x0;var _0x223733=_0xe027[_0x2707af];return _0x223733;};'use strict';var _=require(_0x7e02('0x0'));var util=require(_0x7e02('0x1'));var logger=require(_0x7e02('0x2'))('api');var moment=require(_0x7e02('0x3'));var BPromise=require(_0x7e02('0x4'));var rp=require(_0x7e02('0x5'));var attributes=require(_0x7e02('0x6'));module[_0x7e02('0x7')]=function(_0x332e4c,_0x24df9c){return _0x332e4c[_0x7e02('0x8')](_0x7e02('0x9'),attributes,{'tableName':_0x7e02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1186=['lodash','util','../../config/logger','bluebird','define','network'];(function(_0x44f3a1,_0x47ded1){var _0x235638=function(_0x58e52d){while(--_0x58e52d){_0x44f3a1['push'](_0x44f3a1['shift']());}};_0x235638(++_0x47ded1);}(_0x1186,0x78));var _0x6118=function(_0x1dd001,_0x497201){_0x1dd001=_0x1dd001-0x0;var _0x45f77f=_0x1186[_0x1dd001];return _0x45f77f;};'use strict';var _=require(_0x6118('0x0'));var util=require(_0x6118('0x1'));var logger=require(_0x6118('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6118('0x3'));var rp=require('request-promise');var attributes=require('./network.attributes');module['exports']=function(_0x4d8352,_0x3480a1){return _0x4d8352[_0x6118('0x4')]('Network',attributes,{'tableName':_0x6118('0x5'),'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 4233a3e..ba4333b 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 _0xbd51=['Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','then','info','Network,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x1c648a,_0x167d08){_0x1c648a=_0x1c648a-0x0;var _0x5636db=_0xbd51[_0x1c648a];return _0x5636db;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var moment=require(_0x1bd5('0x1'));var BPromise=require(_0x1bd5('0x2'));var rs=require(_0x1bd5('0x3'));var fs=require('fs');var Redis=require(_0x1bd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1bd5('0x5'));var jayson=require(_0x1bd5('0x6'));var client=jayson[_0x1bd5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29abea,_0x30a385,_0x19077c){return new BPromise(function(_0x27d58f,_0xd8418f){return client['request'](_0x29abea,_0x19077c)[_0x1bd5('0x8')](function(_0x5c8e0d){logger[_0x1bd5('0x9')](_0x1bd5('0xa'),_0x30a385,_0x1bd5('0xb'));logger[_0x1bd5('0xc')](_0x1bd5('0xd'),_0x30a385,_0x1bd5('0xb'),JSON['stringify'](_0x5c8e0d));if(_0x5c8e0d[_0x1bd5('0xe')]){if(_0x5c8e0d['error'][_0x1bd5('0xf')]===0x1f4){logger[_0x1bd5('0xe')](_0x1bd5('0xa'),_0x30a385,_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);return _0xd8418f(_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);}logger['error']('Network,\x20%s,\x20%s',_0x30a385,_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);return _0x27d58f(_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x30a385,_0x1bd5('0xb'));_0x27d58f(_0x5c8e0d[_0x1bd5('0x11')][_0x1bd5('0x10')]);}})[_0x1bd5('0x12')](function(_0x43ea3e){logger[_0x1bd5('0xe')](_0x1bd5('0xa'),_0x30a385,_0x43ea3e);_0xd8418f(_0x43ea3e);});});} \ No newline at end of file +var _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','Network,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x434f85,_0x241072){var _0x14c8af=function(_0x391746){while(--_0x391746){_0x434f85['push'](_0x434f85['shift']());}};_0x14c8af(++_0x241072);}(_0x5fd1,0x155));var _0x15fd=function(_0x2eaa86,_0x614702){_0x2eaa86=_0x2eaa86-0x0;var _0x11767f=_0x5fd1[_0x2eaa86];return _0x11767f;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('Network,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index acf32c0..2f0a52c 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 _0x992e=['notify','addApplications','/:id/send','send','put','update','delete','destroy','/:id/dispositions','removeAnswers','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/notify'];(function(_0x20c19d,_0x3eb7e9){var _0x39d8cd=function(_0x3ffdb6){while(--_0x3ffdb6){_0x20c19d['push'](_0x20c19d['shift']());}};_0x39d8cd(++_0x3eb7e9);}(_0x992e,0x10e));var _0xe992=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0x992e[_0x470bfb];return _0x2f5d97;};'use strict';var multer=require('multer');var util=require(_0xe992('0x0'));var path=require(_0xe992('0x1'));var timeout=require(_0xe992('0x2'));var express=require('express');var router=express[_0xe992('0x3')]();var auth=require(_0xe992('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe992('0x5'));var controller=require(_0xe992('0x6'));router[_0xe992('0x7')]('/',auth[_0xe992('0x8')](),controller[_0xe992('0x9')]);router['get']('/describe',auth[_0xe992('0x8')](),controller[_0xe992('0xa')]);router['get'](_0xe992('0xb'),auth[_0xe992('0x8')](),controller[_0xe992('0xc')]);router[_0xe992('0x7')]('/:id/dispositions',auth[_0xe992('0x8')](),controller[_0xe992('0xd')]);router['get'](_0xe992('0xe'),auth[_0xe992('0x8')](),controller[_0xe992('0xf')]);router['get'](_0xe992('0x10'),auth[_0xe992('0x8')](),controller[_0xe992('0x11')]);router[_0xe992('0x7')](_0xe992('0x12'),auth['isAuthenticated'](),controller[_0xe992('0x13')]);router['get'](_0xe992('0x14'),auth[_0xe992('0x8')](),controller[_0xe992('0x15')]);router[_0xe992('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe992('0x16')]('/:id/dispositions',auth[_0xe992('0x8')](),controller[_0xe992('0x17')]);router['post'](_0xe992('0xe'),auth[_0xe992('0x8')](),controller[_0xe992('0x18')]);router[_0xe992('0x16')](_0xe992('0x19'),controller[_0xe992('0x1a')]);router[_0xe992('0x16')]('/:id/applications',auth[_0xe992('0x8')](),controller[_0xe992('0x1b')]);router[_0xe992('0x16')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['post'](_0xe992('0x1c'),auth[_0xe992('0x8')](),controller[_0xe992('0x1d')]);router[_0xe992('0x1e')](_0xe992('0xb'),auth[_0xe992('0x8')](),controller[_0xe992('0x1f')]);router[_0xe992('0x20')](_0xe992('0xb'),auth[_0xe992('0x8')](),controller[_0xe992('0x21')]);router[_0xe992('0x20')](_0xe992('0x22'),auth[_0xe992('0x8')](),controller['removeDispositions']);router[_0xe992('0x20')](_0xe992('0xe'),auth[_0xe992('0x8')](),controller[_0xe992('0x23')]);router[_0xe992('0x20')](_0xe992('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xe992('0x24')]=router; \ No newline at end of file +var _0x46eb=['get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/notify','addAgents','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller'];(function(_0x58f152,_0x48eee4){var _0x56f250=function(_0x45a1a0){while(--_0x45a1a0){_0x58f152['push'](_0x58f152['shift']());}};_0x56f250(++_0x48eee4);}(_0x46eb,0x16a));var _0xb46e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x46eb[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xb46e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb46e('0x1'));var express=require(_0xb46e('0x2'));var router=express[_0xb46e('0x3')]();var auth=require(_0xb46e('0x4'));var interaction=require(_0xb46e('0x5'));var config=require(_0xb46e('0x6'));var controller=require(_0xb46e('0x7'));router[_0xb46e('0x8')]('/',auth[_0xb46e('0x9')](),controller['index']);router[_0xb46e('0x8')](_0xb46e('0xa'),auth[_0xb46e('0x9')](),controller[_0xb46e('0xb')]);router[_0xb46e('0x8')]('/:id',auth[_0xb46e('0x9')](),controller[_0xb46e('0xc')]);router[_0xb46e('0x8')](_0xb46e('0xd'),auth[_0xb46e('0x9')](),controller[_0xb46e('0xe')]);router['get'](_0xb46e('0xf'),auth[_0xb46e('0x9')](),controller[_0xb46e('0x10')]);router['get'](_0xb46e('0x11'),auth[_0xb46e('0x9')](),controller['getApplications']);router[_0xb46e('0x8')](_0xb46e('0x12'),auth[_0xb46e('0x9')](),controller[_0xb46e('0x13')]);router[_0xb46e('0x8')](_0xb46e('0x14'),auth[_0xb46e('0x9')](),controller[_0xb46e('0x15')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb46e('0x16')](_0xb46e('0xd'),auth[_0xb46e('0x9')](),controller[_0xb46e('0x17')]);router['post'](_0xb46e('0xf'),auth[_0xb46e('0x9')](),controller[_0xb46e('0x18')]);router[_0xb46e('0x16')](_0xb46e('0x19'),controller['notify']);router[_0xb46e('0x16')](_0xb46e('0x11'),auth[_0xb46e('0x9')](),controller['addApplications']);router[_0xb46e('0x16')](_0xb46e('0x14'),auth[_0xb46e('0x9')](),controller[_0xb46e('0x1a')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0xb46e('0x1b')]);router[_0xb46e('0x1c')](_0xb46e('0x1d'),auth[_0xb46e('0x9')](),controller[_0xb46e('0x1e')]);router[_0xb46e('0x1f')](_0xb46e('0x1d'),auth[_0xb46e('0x9')](),controller[_0xb46e('0x20')]);router[_0xb46e('0x1f')](_0xb46e('0xd'),auth[_0xb46e('0x9')](),controller[_0xb46e('0x21')]);router[_0xb46e('0x1f')](_0xb46e('0xf'),auth[_0xb46e('0x9')](),controller[_0xb46e('0x22')]);router[_0xb46e('0x1f')](_0xb46e('0x14'),auth[_0xb46e('0x9')](),controller[_0xb46e('0x23')]);module[_0xb46e('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 f236594..a17b2e7 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 _0x0a0d=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x58b797,_0x33affc){var _0x4a206a=function(_0xdd90b0){while(--_0xdd90b0){_0x58b797['push'](_0x58b797['shift']());}};_0x4a206a(++_0x33affc);}(_0x0a0d,0x1ce));var _0xd0a0=function(_0x87239,_0x38c793){_0x87239=_0x87239-0x0;var _0x53af1e=_0x0a0d[_0x87239];return _0x53af1e;};'use strict';var Sequelize=require(_0xd0a0('0x0'));var rs=require(_0xd0a0('0x1'));module[_0xd0a0('0x2')]={'name':{'type':Sequelize[_0xd0a0('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xd0a0('0x3')],'defaultValue':function(){return rs[_0xd0a0('0x4')]();}},'replyUri':{'type':Sequelize[_0xd0a0('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd0a0('0x5');}},'notificationSound':{'type':Sequelize[_0xd0a0('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd0a0('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd0a0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd0a0('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd0a0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd0a0('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd0a0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd0a0('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xd0a0('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xd0a0('0x6')],'defaultValue':![],'comment':_0xd0a0('0x9'),'set':function(_0x51e250){if(!_0x51e250)this[_0xd0a0('0xa')](_0xd0a0('0xb'),null);this[_0xd0a0('0xa')]('mandatoryDisposition',_0x51e250);}}}; \ No newline at end of file +var _0x0aed=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x0aed,0xaa));var _0xd0ae=function(_0x4c075b,_0x56c2e7){_0x4c075b=_0x4c075b-0x0;var _0x228448=_0x0aed[_0x4c075b];return _0x228448;};'use strict';var Sequelize=require(_0xd0ae('0x0'));var rs=require(_0xd0ae('0x1'));module[_0xd0ae('0x2')]={'name':{'type':Sequelize[_0xd0ae('0x3')],'unique':_0xd0ae('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xd0ae('0x3')]},'token':{'type':Sequelize[_0xd0ae('0x3')],'defaultValue':function(){return rs[_0xd0ae('0x5')]();}},'replyUri':{'type':Sequelize[_0xd0ae('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd0ae('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd0ae('0x6')],'defaultValue':function(){return _0xd0ae('0x7');}},'notificationSound':{'type':Sequelize[_0xd0ae('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd0ae('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd0ae('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd0ae('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd0ae('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd0ae('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd0ae('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0xd0ae('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xd0ae('0x8')],'defaultValue':![],'comment':_0xd0ae('0xb'),'set':function(_0xb490a4){if(!_0xb490a4)this['setDataValue'](_0xd0ae('0xc'),null);this[_0xd0ae('0xd')](_0xd0ae('0xe'),_0xb490a4);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 39801f9..307a505 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 _0x8599=['createdAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','from','CmList','List','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','Contacts','defaults','contact','firstName','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','lastName','messageId','interaction','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','Contact','Owner','fullname','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','dataValues','Messages','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','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','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','OpenchannelAccount,\x20%s,\x20%s','catch','sendStatus','end','status','json','offset','limit','Content-Range','reject','save','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','model','keys','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','VIRTUAL','field','options','count','includeAll','findAll','rows','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','merge','removeDispositions','ids','addAnswer','OpenchannelAccountId','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference'];(function(_0x212a37,_0xf35b2e){var _0x5d0bf9=function(_0x51850f){while(--_0x51850f){_0x212a37['push'](_0x212a37['shift']());}};_0x5d0bf9(++_0xf35b2e);}(_0x8599,0x105));var _0x9859=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8599[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x9859('0x0'));var emlformat=require(_0x9859('0x1'));var rimraf=require(_0x9859('0x2'));var zipdir=require(_0x9859('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9859('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9859('0x5'));var util=require(_0x9859('0x6'));var path=require(_0x9859('0x7'));var sox=require('sox');var csv=require(_0x9859('0x8'));var ejs=require(_0x9859('0x9'));var fs=require('fs');var _=require(_0x9859('0xa'));var squel=require(_0x9859('0xb'));var crypto=require(_0x9859('0xc'));var jsforce=require(_0x9859('0xd'));var deskjs=require(_0x9859('0xe'));var toCsv=require(_0x9859('0x8'));var querystring=require(_0x9859('0xf'));var Papa=require(_0x9859('0x10'));var authService=require(_0x9859('0x11'));var hardwareService=require(_0x9859('0x12'));var Redis=require(_0x9859('0x13'));var qs=require(_0x9859('0x14'));var logger=require('../../config/logger')(_0x9859('0x15'));var utils=require(_0x9859('0x16'));var config=require(_0x9859('0x17'));var db=require('../../mysqldb')['db'];config[_0x9859('0x18')]=_['defaults'](config[_0x9859('0x18')],{'host':_0x9859('0x19'),'port':0x18eb});var socket=require(_0x9859('0x1a'))(new Redis(config[_0x9859('0x18')]));require(_0x9859('0x1b'))[_0x9859('0x1c')](socket);var jayson=require(_0x9859('0x1d'));var client=jayson[_0x9859('0x1e')][_0x9859('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x9859('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x395355,_0x10077b,_0x210871,_0x5ccbe6){return new BPromise(function(_0xa2608e,_0x9304ce){var _0x2b243e=_0x5ccbe6||client;return _0x2b243e['request'](_0x395355,_0x210871)['then'](function(_0x432108){logger[_0x9859('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x10077b,'request\x20sent');logger[_0x9859('0x21')](_0x9859('0x22'),_0x10077b,_0x9859('0x23'),JSON[_0x9859('0x24')](_0x432108));if(_0x432108[_0x9859('0x25')]){if(_0x432108['error']['code']===0x1f4){logger[_0x9859('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x10077b,_0x432108['error'][_0x9859('0x26')]);return _0x9304ce(_0x432108[_0x9859('0x25')][_0x9859('0x26')]);}logger[_0x9859('0x25')](_0x9859('0x27'),_0x10077b,_0x432108[_0x9859('0x25')][_0x9859('0x26')]);return _0xa2608e(_0x432108['error'][_0x9859('0x26')]);}else{logger['info'](_0x9859('0x27'),_0x10077b,_0x9859('0x23'));_0xa2608e(_0x432108['result']['message']);}})[_0x9859('0x28')](function(_0x21085c){logger[_0x9859('0x25')](_0x9859('0x27'),_0x10077b,_0x21085c);_0x9304ce(_0x21085c);});});}function respondWithStatusCode(_0xdecaa2,_0x41863d){_0x41863d=_0x41863d||0xcc;return function(_0x223a4b){if(_0x223a4b){return _0xdecaa2[_0x9859('0x29')](_0x41863d);}return _0xdecaa2['status'](_0x41863d)[_0x9859('0x2a')]();};}function respondWithResult(_0x1846e5,_0x210527){_0x210527=_0x210527||0xc8;return function(_0x114feb){if(_0x114feb){return _0x1846e5[_0x9859('0x2b')](_0x210527)[_0x9859('0x2c')](_0x114feb);}};}function respondWithFilteredResult(_0x3aca3b,_0x66f3fd){return function(_0xf41ef5){if(_0xf41ef5){var _0x71cbc0=_0xf41ef5['count'],_0xd9602b=_0x66f3fd[_0x9859('0x2d')],_0x1406d8=_0x66f3fd[_0x9859('0x2d')]+_0x66f3fd[_0x9859('0x2e')],_0x2a5717;if(_0x1406d8>=_0x71cbc0){_0x1406d8=_0x71cbc0;_0x2a5717=0xc8;}else{_0x2a5717=0xce;}_0x3aca3b[_0x9859('0x2b')](_0x2a5717);return _0x3aca3b['set'](_0x9859('0x2f'),_0xd9602b+'-'+_0x1406d8+'/'+_0x71cbc0)['json'](_0xf41ef5);}return null;};}function patchUpdates(_0x1e55b8){return function(_0x1838ff){try{jsonpatch['apply'](_0x1838ff,_0x1e55b8,!![]);}catch(_0x50158f){return BPromise[_0x9859('0x30')](_0x50158f);}return _0x1838ff[_0x9859('0x31')]();};}function saveUpdates(_0x3d8967,_0x51e1cf){return function(_0x24dc4c){if(_0x24dc4c){return _0x24dc4c[_0x9859('0x32')](_0x3d8967)[_0x9859('0x33')](function(_0x3a27e1){return _0x3a27e1;});}return null;};}function removeEntity(_0x31af50,_0x4c67b1){return function(_0x653f1d){if(_0x653f1d){return _0x653f1d[_0x9859('0x34')]()[_0x9859('0x33')](function(){var _0x1dffa6=_0x653f1d[_0x9859('0x35')]({'plain':!![]});var _0x268946=_0x9859('0x36');return db[_0x9859('0x37')][_0x9859('0x34')]({'where':{'type':_0x268946,'resourceId':_0x1dffa6['id']}})[_0x9859('0x33')](function(){return _0x653f1d;});})[_0x9859('0x33')](function(){_0x31af50[_0x9859('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ba6a0,_0x98dc0){return function(_0x4f0a6c){if(!_0x4f0a6c){_0x3ba6a0[_0x9859('0x29')](0x194);}return _0x4f0a6c;};}function handleError(_0x515f74,_0x4dfdcf){_0x4dfdcf=_0x4dfdcf||0x1f4;return function(_0x55cd77){logger['error'](_0x55cd77[_0x9859('0x38')]);if(_0x55cd77[_0x9859('0x39')]){delete _0x55cd77[_0x9859('0x39')];}_0x515f74[_0x9859('0x2b')](_0x4dfdcf)[_0x9859('0x3a')](_0x55cd77);};}exports[_0x9859('0x3b')]=function(_0x425d23,_0x1acb2a){var _0x38e2c3={'include':[{'model':db[_0x9859('0x3c')],'as':_0x9859('0x3d')}]},_0xb7c22e={},_0x79ba8d={'count':0x0,'rows':[]};var _0xb29ac5=db[_0x9859('0x3e')][_0x9859('0x3f')];_0xb7c22e[_0x9859('0x40')]=_[_0x9859('0x41')](_0xb29ac5);_0xb7c22e[_0x9859('0x42')]=_[_0x9859('0x41')](_0x425d23[_0x9859('0x42')]);_0xb7c22e['filters']=_[_0x9859('0x43')](_0xb7c22e['model'],_0xb7c22e[_0x9859('0x42')]);_0x38e2c3['attributes']=_[_0x9859('0x43')](_0xb7c22e['model'],qs[_0x9859('0x44')](_0x425d23['query'][_0x9859('0x44')]));_0x38e2c3['attributes']=_0x38e2c3['attributes'][_0x9859('0x45')]?_0x38e2c3[_0x9859('0x46')]:_0xb7c22e[_0x9859('0x40')];if(!_0x425d23[_0x9859('0x42')][_0x9859('0x47')](_0x9859('0x48'))){_0x38e2c3[_0x9859('0x2e')]=qs[_0x9859('0x2e')](_0x425d23[_0x9859('0x42')][_0x9859('0x2e')]);_0x38e2c3['offset']=qs['offset'](_0x425d23[_0x9859('0x42')][_0x9859('0x2d')]);}_0x38e2c3[_0x9859('0x49')]=qs[_0x9859('0x4a')](_0x425d23['query'][_0x9859('0x4a')]);_0x38e2c3[_0x9859('0x4b')]=qs[_0x9859('0x4c')](_[_0x9859('0x4d')](_0x425d23['query'],_0xb7c22e[_0x9859('0x4c')]));if(_0x425d23[_0x9859('0x42')][_0x9859('0x4e')]){_0x38e2c3[_0x9859('0x4b')]=_['merge'](_0x38e2c3[_0x9859('0x4b')],{'$or':_[_0x9859('0x4f')](_0xb29ac5,function(_0x48474d){if(_0x48474d[_0x9859('0x50')]['key']!==_0x9859('0x51')){var _0x88ea42={};_0x88ea42[_0x48474d[_0x9859('0x52')]]={'$like':'%'+_0x425d23['query'][_0x9859('0x4e')]+'%'};return _0x88ea42;}})});}_0x38e2c3=_['merge']({},_0x38e2c3,_0x425d23[_0x9859('0x53')]);var _0x4cddd0={'where':_0x38e2c3[_0x9859('0x4b')]};return db[_0x9859('0x3e')]['count'](_0x4cddd0)[_0x9859('0x33')](function(_0x3f8d3){_0x79ba8d[_0x9859('0x54')]=_0x3f8d3;if(_0x425d23[_0x9859('0x42')][_0x9859('0x55')]){_0x38e2c3['include']=[{'all':!![]}];}return db[_0x9859('0x3e')][_0x9859('0x56')](_0x38e2c3);})[_0x9859('0x33')](function(_0x39bca9){_0x79ba8d[_0x9859('0x57')]=_0x39bca9;return _0x79ba8d;})[_0x9859('0x33')](respondWithFilteredResult(_0x1acb2a,_0x38e2c3))[_0x9859('0x28')](handleError(_0x1acb2a,null));};exports['show']=function(_0x4f26a9,_0x489f96){var _0x587063={'raw':![],'where':{'id':_0x4f26a9[_0x9859('0x58')]['id']},'include':[{'model':db[_0x9859('0x3c')],'as':_0x9859('0x3d')}]},_0x2f14d5={};_0x2f14d5[_0x9859('0x40')]=_[_0x9859('0x41')](db[_0x9859('0x3e')]['rawAttributes']);_0x2f14d5[_0x9859('0x42')]=_['keys'](_0x4f26a9['query']);_0x2f14d5[_0x9859('0x4c')]=_['intersection'](_0x2f14d5[_0x9859('0x40')],_0x2f14d5[_0x9859('0x42')]);_0x587063['attributes']=_[_0x9859('0x43')](_0x2f14d5[_0x9859('0x40')],qs[_0x9859('0x44')](_0x4f26a9[_0x9859('0x42')][_0x9859('0x44')]));_0x587063[_0x9859('0x46')]=_0x587063[_0x9859('0x46')][_0x9859('0x45')]?_0x587063['attributes']:_0x2f14d5[_0x9859('0x40')];if(_0x4f26a9[_0x9859('0x42')][_0x9859('0x55')]){_0x587063[_0x9859('0x59')]=[{'all':!![]}];}_0x587063=_['merge']({},_0x587063,_0x4f26a9[_0x9859('0x53')]);return db[_0x9859('0x3e')]['find'](_0x587063)[_0x9859('0x33')](handleEntityNotFound(_0x489f96,null))['then'](respondWithResult(_0x489f96,null))[_0x9859('0x28')](handleError(_0x489f96,null));};exports[_0x9859('0x5a')]=function(_0xf7cb4,_0x21f290){return db[_0x9859('0x3e')]['create'](_0xf7cb4[_0x9859('0x5b')],{})['then'](function(_0x56f6d3){var _0xc8a488=_0xf7cb4[_0x9859('0x5c')]['get']({'plain':!![]});if(!_0xc8a488)throw new Error(_0x9859('0x5d'));if(_0xc8a488[_0x9859('0x5e')]===_0x9859('0x5c')){var _0x141ef1=_0x56f6d3[_0x9859('0x35')]({'plain':!![]});var _0x16c051=_0x9859('0x36');return db[_0x9859('0x5f')][_0x9859('0x60')]({'where':{'name':_0x16c051,'userProfileId':_0xc8a488[_0x9859('0x61')]},'raw':!![]})[_0x9859('0x33')](function(_0x5eca80){if(_0x5eca80&&_0x5eca80['autoAssociation']===0x0){return db[_0x9859('0x37')]['create']({'name':_0x141ef1[_0x9859('0x39')],'resourceId':_0x141ef1['id'],'type':_0x5eca80[_0x9859('0x39')],'sectionId':_0x5eca80['id']},{})[_0x9859('0x33')](function(){return _0x56f6d3;});}else{return _0x56f6d3;}})[_0x9859('0x28')](function(_0x4b0cf1){logger['error'](_0x9859('0x62'),_0x4b0cf1);throw _0x4b0cf1;});}return _0x56f6d3;})[_0x9859('0x33')](respondWithResult(_0x21f290,0xc9))[_0x9859('0x28')](handleError(_0x21f290,null));};exports[_0x9859('0x32')]=function(_0x3ced56,_0x3c0d63){if(_0x3ced56[_0x9859('0x5b')]['id']){delete _0x3ced56[_0x9859('0x5b')]['id'];}return db[_0x9859('0x3e')]['find']({'where':{'id':_0x3ced56[_0x9859('0x58')]['id']},'include':[{'model':db[_0x9859('0x3c')],'as':_0x9859('0x3d')}]})[_0x9859('0x33')](handleEntityNotFound(_0x3c0d63,null))[_0x9859('0x33')](saveUpdates(_0x3ced56['body'],null))[_0x9859('0x33')](function(_0x32d13c){if(_0x32d13c&&_0x3ced56[_0x9859('0x5b')][_0x9859('0x3d')]){return db[_0x9859('0x3c')]['update'](_0x3ced56[_0x9859('0x5b')]['mandatoryDispositionPause'],{'where':{'OpenchannelAccountId':_0x32d13c['id']}})['then'](function(){return _0x32d13c;});}return _0x32d13c;})['then'](respondWithResult(_0x3c0d63,null))[_0x9859('0x28')](handleError(_0x3c0d63,null));};exports[_0x9859('0x34')]=function(_0x4a4574,_0x1aa786){return db[_0x9859('0x3e')][_0x9859('0x60')]({'where':{'id':_0x4a4574[_0x9859('0x58')]['id']}})['then'](handleEntityNotFound(_0x1aa786,null))['then'](removeEntity(_0x1aa786,null))[_0x9859('0x28')](handleError(_0x1aa786,null));};exports[_0x9859('0x63')]=function(_0x197d03,_0x3e1d6f){return db[_0x9859('0x3e')][_0x9859('0x63')]()[_0x9859('0x33')](respondWithResult(_0x3e1d6f,null))['catch'](handleError(_0x3e1d6f,null));};exports[_0x9859('0x64')]=function(_0x12e786,_0x452ac9,_0x219682){if(_0x12e786[_0x9859('0x5b')]['id']){delete _0x12e786['body']['id'];}return db[_0x9859('0x3e')][_0x9859('0x60')]({'where':{'id':_0x12e786[_0x9859('0x58')]['id']}})[_0x9859('0x33')](handleEntityNotFound(_0x452ac9,null))[_0x9859('0x33')](function(_0x3cb3b1){if(_0x3cb3b1){_0x12e786['body']['OpnechannelAccountId']=_0x3cb3b1['id'];return db[_0x9859('0x65')][_0x9859('0x5a')](_0x12e786[_0x9859('0x5b')]);}})[_0x9859('0x33')](respondWithResult(_0x452ac9,null))[_0x9859('0x28')](handleError(_0x452ac9,null));};exports[_0x9859('0x66')]=function(_0x20230c,_0x5ad71a,_0x560b5c){var _0x251176={'raw':![],'where':{}};var _0x1bb204={};var _0x483cbc={'count':0x0,'rows':[]};return db[_0x9859('0x3e')][_0x9859('0x67')]({'where':{'id':_0x20230c['params']['id']}})[_0x9859('0x33')](handleEntityNotFound(_0x5ad71a,null))[_0x9859('0x33')](function(_0x1d7a15){if(_0x1d7a15){_0x1bb204[_0x9859('0x40')]=_['keys'](db[_0x9859('0x65')][_0x9859('0x3f')]);_0x1bb204['query']=_[_0x9859('0x41')](_0x20230c[_0x9859('0x42')]);_0x1bb204[_0x9859('0x4c')]=_[_0x9859('0x43')](_0x1bb204[_0x9859('0x40')],_0x1bb204[_0x9859('0x42')]);_0x251176[_0x9859('0x46')]=_[_0x9859('0x43')](_0x1bb204[_0x9859('0x40')],qs[_0x9859('0x44')](_0x20230c['query']['fields']));_0x251176[_0x9859('0x46')]=_0x251176['attributes'][_0x9859('0x45')]?_0x251176[_0x9859('0x46')]:_0x1bb204[_0x9859('0x40')];if(!_0x20230c['query'][_0x9859('0x47')](_0x9859('0x48'))){_0x251176[_0x9859('0x2e')]=qs[_0x9859('0x2e')](_0x20230c[_0x9859('0x42')][_0x9859('0x2e')]);_0x251176['offset']=qs[_0x9859('0x2d')](_0x20230c[_0x9859('0x42')][_0x9859('0x2d')]);}_0x251176[_0x9859('0x49')]=qs[_0x9859('0x4a')](_0x20230c['query']['sort']);_0x251176['where']=qs[_0x9859('0x4c')](_[_0x9859('0x4d')](_0x20230c[_0x9859('0x42')],_0x1bb204['filters']));_0x251176[_0x9859('0x4b')]['OpenchannelAccountId']=_0x1d7a15['id'];if(_0x20230c[_0x9859('0x42')]['filter']){_0x251176['where']=_[_0x9859('0x68')](_0x251176['where'],{'$or':_['map'](_0x251176[_0x9859('0x46')],function(_0x2697cd){var _0x42cbf2={};_0x42cbf2[_0x2697cd]={'$like':'%'+_0x20230c[_0x9859('0x42')][_0x9859('0x4e')]+'%'};return _0x42cbf2;})});}_0x251176=_[_0x9859('0x68')]({},_0x251176,_0x20230c[_0x9859('0x53')]);return db[_0x9859('0x65')]['count']({'where':_0x251176[_0x9859('0x4b')]})['then'](function(_0x1620c6){_0x483cbc[_0x9859('0x54')]=_0x1620c6;if(_0x20230c['query'][_0x9859('0x55')]){_0x251176[_0x9859('0x59')]=[{'all':!![]}];}return db[_0x9859('0x65')]['findAll'](_0x251176);})[_0x9859('0x33')](function(_0x1451ec){_0x483cbc['rows']=_0x1451ec;return _0x483cbc;});}})[_0x9859('0x33')](respondWithFilteredResult(_0x5ad71a,_0x251176))[_0x9859('0x28')](handleError(_0x5ad71a,null));};exports['removeDispositions']=function(_0x20634c,_0x20c89f,_0x10411d){var _0x22e6fe;return db['OpenchannelAccount']['find']({'where':{'id':_0x20634c[_0x9859('0x58')]['id']}})[_0x9859('0x33')](handleEntityNotFound(_0x20c89f,null))[_0x9859('0x33')](function(_0x24acb3){if(_0x24acb3){return _0x24acb3[_0x9859('0x69')](_0x20634c['query'][_0x9859('0x6a')]);}})[_0x9859('0x33')](respondWithStatusCode(_0x20c89f,null))[_0x9859('0x28')](handleError(_0x20c89f,null));};exports[_0x9859('0x6b')]=function(_0x1d8625,_0x585ee4,_0x2b99ef){if(_0x1d8625[_0x9859('0x5b')]['id']){delete _0x1d8625[_0x9859('0x5b')]['id'];}return db[_0x9859('0x3e')][_0x9859('0x60')]({'where':{'id':_0x1d8625[_0x9859('0x58')]['id']}})[_0x9859('0x33')](handleEntityNotFound(_0x585ee4,null))[_0x9859('0x33')](function(_0x5e6ff9){if(_0x5e6ff9){_0x1d8625[_0x9859('0x5b')][_0x9859('0x6c')]=_0x5e6ff9['id'];return db[_0x9859('0x6d')][_0x9859('0x5a')](_0x1d8625[_0x9859('0x5b')]);}})[_0x9859('0x33')](respondWithResult(_0x585ee4,null))[_0x9859('0x28')](handleError(_0x585ee4,null));};exports['getAnswers']=function(_0x35d144,_0x27508c,_0x5d2ebd){var _0x209298={'raw':![],'where':{}};var _0x3ad9a1={};var _0x17569b={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9859('0x67')]({'where':{'id':_0x35d144[_0x9859('0x58')]['id']}})[_0x9859('0x33')](handleEntityNotFound(_0x27508c,null))['then'](function(_0x333849){if(_0x333849){_0x3ad9a1[_0x9859('0x40')]=_[_0x9859('0x41')](db[_0x9859('0x6d')][_0x9859('0x3f')]);_0x3ad9a1[_0x9859('0x42')]=_[_0x9859('0x41')](_0x35d144[_0x9859('0x42')]);_0x3ad9a1[_0x9859('0x4c')]=_[_0x9859('0x43')](_0x3ad9a1[_0x9859('0x40')],_0x3ad9a1[_0x9859('0x42')]);_0x209298[_0x9859('0x46')]=_[_0x9859('0x43')](_0x3ad9a1[_0x9859('0x40')],qs[_0x9859('0x44')](_0x35d144['query'][_0x9859('0x44')]));_0x209298[_0x9859('0x46')]=_0x209298[_0x9859('0x46')]['length']?_0x209298[_0x9859('0x46')]:_0x3ad9a1['model'];if(!_0x35d144[_0x9859('0x42')][_0x9859('0x47')](_0x9859('0x48'))){_0x209298['limit']=qs[_0x9859('0x2e')](_0x35d144['query'][_0x9859('0x2e')]);_0x209298[_0x9859('0x2d')]=qs[_0x9859('0x2d')](_0x35d144['query'][_0x9859('0x2d')]);}_0x209298[_0x9859('0x49')]=qs[_0x9859('0x4a')](_0x35d144['query'][_0x9859('0x4a')]);_0x209298[_0x9859('0x4b')]=qs['filters'](_[_0x9859('0x4d')](_0x35d144['query'],_0x3ad9a1[_0x9859('0x4c')]));_0x209298['where']['OpenchannelAccountId']=_0x333849['id'];if(_0x35d144[_0x9859('0x42')][_0x9859('0x4e')]){_0x209298[_0x9859('0x4b')]=_[_0x9859('0x68')](_0x209298[_0x9859('0x4b')],{'$or':_['map'](_0x209298[_0x9859('0x46')],function(_0x4cf0ac){var _0x1d0fbe={};_0x1d0fbe[_0x4cf0ac]={'$like':'%'+_0x35d144['query'][_0x9859('0x4e')]+'%'};return _0x1d0fbe;})});}_0x209298=_[_0x9859('0x68')]({},_0x209298,_0x35d144[_0x9859('0x53')]);return db[_0x9859('0x6d')]['count']({'where':_0x209298['where']})[_0x9859('0x33')](function(_0x4a6852){_0x17569b[_0x9859('0x54')]=_0x4a6852;if(_0x35d144[_0x9859('0x42')]['includeAll']){_0x209298['include']=[{'all':!![]}];}return db[_0x9859('0x6d')][_0x9859('0x56')](_0x209298);})[_0x9859('0x33')](function(_0x2c8a3a){_0x17569b[_0x9859('0x57')]=_0x2c8a3a;return _0x17569b;});}})[_0x9859('0x33')](respondWithFilteredResult(_0x27508c,_0x209298))['catch'](handleError(_0x27508c,null));};exports[_0x9859('0x6e')]=function(_0x34546c,_0x315786,_0x5620fa){var _0x6bd606;return db[_0x9859('0x3e')][_0x9859('0x60')]({'where':{'id':_0x34546c['params']['id']}})['then'](handleEntityNotFound(_0x315786,null))['then'](function(_0x281680){if(_0x281680){return _0x281680[_0x9859('0x6e')](_0x34546c[_0x9859('0x42')][_0x9859('0x6a')]);}})[_0x9859('0x33')](respondWithStatusCode(_0x315786,null))[_0x9859('0x28')](handleError(_0x315786,null));};exports[_0x9859('0x6f')]=function(_0x5c3b9d,_0x567190,_0x5322d3){var _0x4b6dee={'body':_0x5c3b9d[_0x9859('0x5b')],'channel':_0x9859('0x70')};var _0x48a650=[];var _0x5b5787=[];var _0x43a899={};var _0x1dd0d9=![];return db[_0x9859('0x71')][_0x9859('0x63')]()['then'](function(_0x4592d9){if(!_0x4592d9){throw new db[(_0x9859('0x72'))][(_0x9859('0x73'))](_0x9859('0x74'));}_0x48a650=_['difference'](_[_0x9859('0x41')](_0x4592d9),['createdAt',_0x9859('0x75')]);_0x5b5787=_[_0x9859('0x76')](_[_0x9859('0x41')](_0x4592d9),[_0x9859('0x77'),'updatedAt',_0x9859('0x78'),_0x9859('0x79')]);if(_0x5c3b9d['body']['id']){delete _0x5c3b9d[_0x9859('0x5b')]['id'];}if(_[_0x9859('0x7a')](_0x5c3b9d[_0x9859('0x5b')]['from'])){throw new db[(_0x9859('0x72'))][(_0x9859('0x73'))](_0x9859('0x7b'));}if(_[_0x9859('0x7a')](_0x5c3b9d['body'][_0x9859('0x5b')])||_0x5c3b9d[_0x9859('0x5b')][_0x9859('0x5b')]===''){throw new db[(_0x9859('0x72'))][(_0x9859('0x73'))](_0x9859('0x7c'));}if(_['isNil'](_0x5c3b9d[_0x9859('0x5b')]['mapKey'])){throw new db[(_0x9859('0x72'))]['ValidationError'](_0x9859('0x7d')+_0x5b5787);}if(!_[_0x9859('0x7e')](_0x5b5787,_0x5c3b9d[_0x9859('0x5b')][_0x9859('0x7f')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5b5787);}_0x43a899[_0x5c3b9d[_0x9859('0x5b')][_0x9859('0x7f')]]=_0x5c3b9d[_0x9859('0x5b')][_0x9859('0x80')];})[_0x9859('0x33')](function(){return db[_0x9859('0x3e')]['find']({'where':{'id':_0x5c3b9d[_0x9859('0x58')]['id']},'include':[{'model':db[_0x9859('0x81')],'as':_0x9859('0x82'),'include':[{'model':db[_0x9859('0x71')],'as':'Contacts','where':_0x43a899,'limit':0x1,'order':[[_0x9859('0x75'),'DESC']]}]},{'model':db[_0x9859('0x83')],'as':_0x9859('0x84')}]});})[_0x9859('0x33')](handleEntityNotFound(_0x567190,null))[_0x9859('0x33')](function(_0x48259e){if(_0x48259e&&_0x48259e[_0x9859('0x82')]){_0x4b6dee[_0x9859('0x85')]=_0x48259e;_0x4b6dee[_0x9859('0x86')]=_0x48259e[_0x9859('0x84')];_0x4b6dee[_0x9859('0x87')]=_0x48259e['List'];_0x4b6dee[_0x9859('0x86')]=_[_0x9859('0x88')](_0x4b6dee[_0x9859('0x86')],[_0x9859('0x89')],[_0x9859('0x8a')]);if(_0x4b6dee['account']['Applications']){delete _0x4b6dee[_0x9859('0x85')][_0x9859('0x84')];}if(_0x4b6dee[_0x9859('0x85')][_0x9859('0x82')]&&_0x4b6dee[_0x9859('0x85')][_0x9859('0x82')][_0x9859('0x8b')]['length']){return _0x4b6dee['account'][_0x9859('0x82')]['Contacts'][0x0];}var _0x2eb605=_[_0x9859('0x8c')](_0x5c3b9d['body'],{'firstName':_0x5c3b9d[_0x9859('0x5b')][_0x9859('0x80')],'ListId':_0x48259e[_0x9859('0x79')]});_0x2eb605[_0x5c3b9d[_0x9859('0x5b')]['mapKey']]=_0x5c3b9d[_0x9859('0x5b')][_0x9859('0x80')];return db[_0x9859('0x71')][_0x9859('0x5a')](_0x2eb605,{'fields':_0x48a650,'raw':!![]});}})['then'](handleEntityNotFound(_0x567190,null))[_0x9859('0x33')](function(_0x291dcb){_0x4b6dee[_0x9859('0x8d')]=_0x291dcb;if(_0x291dcb){var _0x147f39={'ContactId':_0x291dcb['id'],'OpenchannelAccountId':_0x5c3b9d[_0x9859('0x58')]['id'],'from':(_0x291dcb[_0x9859('0x8e')]||'')+'\x20'+(_0x291dcb['lastName']||'')};var _0x4699c7={'OpenchannelAccountId':_0x5c3b9d[_0x9859('0x58')]['id'],'closed':![]};if(_0x5c3b9d[_0x9859('0x5b')][_0x9859('0x8f')]){_0x4699c7[_0x9859('0x8f')]=_0x5c3b9d[_0x9859('0x5b')][_0x9859('0x8f')];return db['OpenchannelInteraction'][_0x9859('0x60')]({'where':_0x4699c7})[_0x9859('0x33')](function(_0x3e06df){if(_0x3e06df){return[_0x3e06df,![]];}_0x147f39[_0x9859('0x8f')]=_0x5c3b9d[_0x9859('0x5b')][_0x9859('0x8f')];_0x147f39[_0x9859('0x90')]=_0x5c3b9d['body'][_0x9859('0x90')];return db['OpenchannelInteraction']['create'](_0x147f39)[_0x9859('0x33')](function(_0x3658e7){return[_0x3658e7,!![]];});});}else{_0x4699c7['threadId']=null;}_0x4699c7[_0x9859('0x91')]=_0x291dcb['id'];return db[_0x9859('0x92')]['find']({'where':_0x4699c7})[_0x9859('0x33')](function(_0x1234bd){if(_0x1234bd){return[_0x1234bd,![]];}return db[_0x9859('0x92')][_0x9859('0x5a')](_0x147f39)['then'](function(_0x259d8f){return[_0x259d8f,!![]];});});}})[_0x9859('0x93')](function(_0x1d2ce1,_0x37f1a6){if(_0x1d2ce1){_0x1dd0d9=_0x37f1a6;if(!_0x37f1a6){var _0x3da6fc={'from':(_0x4b6dee['contact'][_0x9859('0x8e')]||'')+'\x20'+(_0x4b6dee[_0x9859('0x8d')][_0x9859('0x94')]||'')};if(_0x5c3b9d['body'][_0x9859('0x8f')]&&_0x5c3b9d[_0x9859('0x5b')][_0x9859('0x95')]&&_0x5c3b9d[_0x9859('0x5b')][_0x9859('0x8f')]!=_0x5c3b9d['body'][_0x9859('0x95')]){_0x3da6fc['threadId']=_0x5c3b9d['body'][_0x9859('0x95')];}return _0x1d2ce1[_0x9859('0x32')](_0x3da6fc);}else{return _0x1d2ce1;}}})[_0x9859('0x33')](function(_0x571fd5){_0x4b6dee['interaction']=_0x571fd5[_0x9859('0x35')]({'plain':!![]});_0x4b6dee[_0x9859('0x96')]['created']=_0x1dd0d9;if(_0x4b6dee[_0x9859('0x96')]['created']){if(_0x4b6dee[_0x9859('0x85')][_0x9859('0x97')]){_0x4b6dee['applications'][_0x9859('0x98')]({'id':0x0,'priority':_0x4b6dee[_0x9859('0x86')]['length']+0x1,'app':_0x9859('0x99'),'appdata':_0x9859('0x9a'),'interval':_0x9859('0x9b')});}}return db[_0x9859('0x9c')][_0x9859('0x5a')]({'body':_0x5c3b9d['body'][_0x9859('0x5b')],'OpenchannelAccountId':_0x5c3b9d['params']['id'],'OpenchannelInteractionId':_0x571fd5['id'],'direction':'in','ContactId':_0x4b6dee[_0x9859('0x8d')]['id'],'AttachmentId':_0x5c3b9d['body'][_0x9859('0x9d')]});})[_0x9859('0x33')](function(_0x4a8fbe){_0x4b6dee['message']=_0x4a8fbe;if(_0x4b6dee[_0x9859('0x96')][_0x9859('0x9e')]){return db[_0x9859('0x9f')][_0x9859('0x60')]({'attributes':['id',_0x9859('0x39')],'where':{'id':_0x4b6dee['interaction']['UserId']}})[_0x9859('0x33')](function(_0x52682e){if(_0x52682e){_0x4b6dee['applications'][_0x9859('0xa0')]({'id':0x0,'priority':0x0,'app':_0x9859('0xa1'),'appdata':_0x52682e[_0x9859('0x39')]+','+(_0x4b6dee['account'][_0x9859('0xa2')]||0xa),'interval':_0x9859('0x9b')});_0x4b6dee[_0x9859('0xa3')]=![];}return respondWithRpcPromise(_0x9859('0xa4'),_0x9859('0xa5'),_0x4b6dee);});}return respondWithRpcPromise(_0x9859('0xa4'),_0x9859('0xa5'),_0x4b6dee);})[_0x9859('0x33')](function(_0x56ff24){respondWithRpcPromise('EventManager',_0x9859('0xa6'),{'event':_0x9859('0x6f'),'message':_0x56ff24},client9002);return _0x56ff24;})['then'](respondWithResult(_0x567190,null))[_0x9859('0x28')](handleError(_0x567190,null));};exports['addApplications']=function(_0x418a9b,_0x185363,_0x416b69){return db[_0x9859('0x3e')][_0x9859('0x67')]({'where':{'id':_0x418a9b[_0x9859('0x58')]['id']}})['then'](handleEntityNotFound(_0x185363,null))[_0x9859('0x33')](function(_0xbda029){if(_0xbda029){return db[_0x9859('0xa7')][_0x9859('0xa8')](function(_0x1bba74){return db['OpenchannelApplication'][_0x9859('0x34')]({'where':{'OpenchannelAccountId':_0x418a9b[_0x9859('0x58')]['id']},'transaction':_0x1bba74})[_0x9859('0x33')](function(_0x136ab9){var _0x3ce3da=_[_0x9859('0x4f')](_0x418a9b['body'],function(_0xa30e0b){_0xa30e0b['OpenchannelAccountId']=_0x418a9b[_0x9859('0x58')]['id'];return _0xa30e0b;});return db['OpenchannelApplication'][_0x9859('0xa9')](_0x3ce3da,{'transaction':_0x1bba74});});})[_0x9859('0x33')](function(){return db[_0x9859('0x83')][_0x9859('0xaa')]({'where':{'OpenchannelAccountId':_0x418a9b[_0x9859('0x58')]['id']},'order':'priority'});});}})[_0x9859('0x33')](respondWithResult(_0x185363,null))[_0x9859('0x28')](handleError(_0x185363,null));};exports[_0x9859('0xab')]=function(_0x2e056b,_0x34e75c,_0x40e74f){var _0x21c6f6={};var _0x418d46={};var _0x223651;var _0x3815e7;return db[_0x9859('0x3e')][_0x9859('0x67')]({'where':{'id':_0x2e056b[_0x9859('0x58')]['id']}})['then'](handleEntityNotFound(_0x34e75c,null))['then'](function(_0x523412){if(_0x523412){_0x223651=_0x523412;_0x418d46['model']=_[_0x9859('0x41')](db[_0x9859('0x83')][_0x9859('0x3f')]);_0x418d46['query']=_['keys'](_0x2e056b['query']);_0x418d46[_0x9859('0x4c')]=_[_0x9859('0x43')](_0x418d46[_0x9859('0x40')],_0x418d46['query']);_0x21c6f6[_0x9859('0x46')]=_['intersection'](_0x418d46[_0x9859('0x40')],qs[_0x9859('0x44')](_0x2e056b[_0x9859('0x42')][_0x9859('0x44')]));_0x21c6f6[_0x9859('0x46')]=_0x21c6f6[_0x9859('0x46')][_0x9859('0x45')]?_0x21c6f6[_0x9859('0x46')]:_0x418d46['model'];_0x21c6f6[_0x9859('0x49')]=qs['sort'](_0x2e056b[_0x9859('0x42')]['sort']);_0x21c6f6[_0x9859('0x4b')]=qs[_0x9859('0x4c')](_['pick'](_0x2e056b[_0x9859('0x42')],_0x418d46['filters']));if(_0x2e056b[_0x9859('0x42')][_0x9859('0x4e')]){_0x21c6f6[_0x9859('0x4b')]=_[_0x9859('0x68')](_0x21c6f6[_0x9859('0x4b')],{'$or':_['map'](_0x21c6f6[_0x9859('0x46')],function(_0x1cb30e){var _0x22b2d4={};_0x22b2d4[_0x1cb30e]={'$like':'%'+_0x2e056b['query'][_0x9859('0x4e')]+'%'};return _0x22b2d4;})});}_0x21c6f6=_[_0x9859('0x68')]({},_0x21c6f6,_0x2e056b[_0x9859('0x53')]);return _0x223651['getApplications'](_0x21c6f6);}})[_0x9859('0x33')](function(_0x29bbc2){if(_0x29bbc2){_0x3815e7=_0x29bbc2['length'];if(!_0x2e056b[_0x9859('0x42')][_0x9859('0x47')]('nolimit')){_0x21c6f6[_0x9859('0x2e')]=qs[_0x9859('0x2e')](_0x2e056b[_0x9859('0x42')][_0x9859('0x2e')]);_0x21c6f6[_0x9859('0x2d')]=qs[_0x9859('0x2d')](_0x2e056b[_0x9859('0x42')][_0x9859('0x2d')]);}return _0x223651[_0x9859('0xab')](_0x21c6f6);}})[_0x9859('0x33')](function(_0x5b54af){if(_0x5b54af){return _0x5b54af?{'count':_0x3815e7,'rows':_0x5b54af}:null;}})[_0x9859('0x33')](respondWithResult(_0x34e75c,null))[_0x9859('0x28')](handleError(_0x34e75c,null));};exports['getInteractions']=function(_0x292f52,_0x292a81,_0x4ae135){var _0x15b5b8={'raw':![],'where':{}};var _0x4a72a1={};var _0x44577e={'count':0x0,'rows':[]};return db[_0x9859('0x3e')][_0x9859('0x67')]({'where':{'id':_0x292f52[_0x9859('0x58')]['id']}})[_0x9859('0x33')](handleEntityNotFound(_0x292a81,null))[_0x9859('0x33')](function(_0x52329f){if(_0x52329f){_0x4a72a1[_0x9859('0x40')]=_[_0x9859('0x41')](db[_0x9859('0x92')][_0x9859('0x3f')]);_0x4a72a1[_0x9859('0x42')]=_['keys'](_0x292f52['query']);_0x4a72a1[_0x9859('0x4c')]=_[_0x9859('0x43')](_0x4a72a1[_0x9859('0x40')],_0x4a72a1[_0x9859('0x42')]);_0x15b5b8[_0x9859('0x46')]=_['intersection'](_0x4a72a1['model'],qs['fields'](_0x292f52[_0x9859('0x42')][_0x9859('0x44')]));_0x15b5b8[_0x9859('0x46')]=_0x15b5b8['attributes']['length']?_0x15b5b8[_0x9859('0x46')]:_0x4a72a1[_0x9859('0x40')];if(!_0x292f52[_0x9859('0x42')][_0x9859('0x47')](_0x9859('0x48'))){_0x15b5b8[_0x9859('0x2e')]=qs[_0x9859('0x2e')](_0x292f52[_0x9859('0x42')][_0x9859('0x2e')]);_0x15b5b8[_0x9859('0x2d')]=qs[_0x9859('0x2d')](_0x292f52[_0x9859('0x42')]['offset']);}_0x15b5b8[_0x9859('0x49')]=qs[_0x9859('0x4a')](_0x292f52['query'][_0x9859('0x4a')]);_0x15b5b8[_0x9859('0x4b')]=qs[_0x9859('0x4c')](_['pick'](_0x292f52[_0x9859('0x42')],_0x4a72a1[_0x9859('0x4c')]));_0x15b5b8['where']['OpenchannelAccountId']=_0x52329f['id'];if(_0x292f52[_0x9859('0x42')][_0x9859('0x4e')]){_0x15b5b8[_0x9859('0x4b')]=_['merge'](_0x15b5b8[_0x9859('0x4b')],{'$or':_[_0x9859('0x4f')](_0x15b5b8['attributes'],function(_0x3a13ed){var _0x2fd7fa={};_0x2fd7fa[_0x3a13ed]={'$like':'%'+_0x292f52[_0x9859('0x42')][_0x9859('0x4e')]+'%'};return _0x2fd7fa;})});}_0x15b5b8=_[_0x9859('0x68')]({},_0x15b5b8,_0x292f52['options']);return db[_0x9859('0x92')]['count']({'where':_0x15b5b8[_0x9859('0x4b')]})[_0x9859('0x33')](function(_0x397c97){_0x44577e[_0x9859('0x54')]=_0x397c97;if(_0x292f52[_0x9859('0x42')][_0x9859('0x55')]){_0x15b5b8[_0x9859('0x59')]=[{'model':db[_0x9859('0x71')],'as':_0x9859('0xac'),'required':![]},{'model':db[_0x9859('0x9f')],'as':_0x9859('0xad'),'attributes':[_0x9859('0x39'),_0x9859('0xae'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x9859('0xaf'),'attributes':['id',_0x9859('0x39'),_0x9859('0xb0')],'where':_0x292f52[_0x9859('0x42')][_0x9859('0xb1')]?{'id':_0x292f52[_0x9859('0x42')]['tag']}:undefined,'required':_0x292f52['query'][_0x9859('0xb1')]?!![]:![]}];}return db[_0x9859('0x92')]['findAll'](_0x15b5b8);})[_0x9859('0x33')](function(_0x584abb){_0x44577e[_0x9859('0x57')]=_0x584abb;return _0x44577e;});}})[_0x9859('0x33')](respondWithFilteredResult(_0x292a81,_0x15b5b8))[_0x9859('0x28')](handleError(_0x292a81,null));};exports[_0x9859('0xb2')]=function(_0x52cf4d,_0x51b66d,_0x3b43c3){return db[_0x9859('0x3e')][_0x9859('0x60')]({'where':{'id':_0x52cf4d[_0x9859('0x58')]['id']}})[_0x9859('0x33')](handleEntityNotFound(_0x51b66d,null))[_0x9859('0x33')](function(_0x37f4eb){if(_0x37f4eb){return _0x37f4eb[_0x9859('0xb2')](_0x52cf4d['body'][_0x9859('0x6a')],_[_0x9859('0xb3')](_0x52cf4d[_0x9859('0x5b')],[_0x9859('0x6a'),'id'])||{})[_0x9859('0x93')](function(_0x1e15e5){for(var _0x42fc9c=0x0;_0x42fc9c<_0x52cf4d[_0x9859('0x5b')][_0x9859('0x6a')][_0x9859('0x45')];_0x42fc9c+=0x1){socket[_0x9859('0xb4')](_0x9859('0xb5'),{'UserId':_0x52cf4d['body']['ids'][_0x42fc9c],'OpenchannelAccountId':_0x52cf4d[_0x9859('0x58')]['id']});}return _0x1e15e5;});}})[_0x9859('0x33')](respondWithResult(_0x51b66d,null))[_0x9859('0x28')](handleError(_0x51b66d,null));};exports[_0x9859('0xb6')]=function(_0x21576c,_0x33654a,_0x4df4f1){var _0xde5f81;return db['OpenchannelAccount'][_0x9859('0x60')]({'where':{'id':_0x21576c[_0x9859('0x58')]['id']}})['then'](handleEntityNotFound(_0x33654a,null))[_0x9859('0x33')](function(_0x5ca733){if(_0x5ca733){return _0x5ca733[_0x9859('0xb6')](_0x21576c[_0x9859('0x42')][_0x9859('0x6a')])[_0x9859('0x33')](function(_0x5299ca){if(_[_0x9859('0xb7')](_0x21576c[_0x9859('0x42')][_0x9859('0x6a')])){for(var _0x474c9c=0x0;_0x474c9c<_0x21576c[_0x9859('0x42')][_0x9859('0x6a')][_0x9859('0x45')];_0x474c9c+=0x1){socket['emit'](_0x9859('0xb8'),{'UserId':_0x21576c[_0x9859('0x42')]['ids'][_0x474c9c],'OpenchannelAccountId':_0x21576c['params']['id']});}}else{socket[_0x9859('0xb4')](_0x9859('0xb8'),{'UserId':_0x21576c['query'][_0x9859('0x6a')],'OpenchannelAccountId':_0x21576c[_0x9859('0x58')]['id']});}});}})[_0x9859('0x33')](respondWithStatusCode(_0x33654a,null))[_0x9859('0x28')](handleError(_0x33654a,null));};exports['getAgents']=function(_0x4eca1b,_0x36f8a4,_0x4bb860){var _0x55df55={};var _0x22da9c={};var _0x49e293;var _0x25503c;return db[_0x9859('0x3e')][_0x9859('0x67')]({'where':{'id':_0x4eca1b['params']['id']}})[_0x9859('0x33')](handleEntityNotFound(_0x36f8a4,null))[_0x9859('0x33')](function(_0xb89b54){if(_0xb89b54){_0x49e293=_0xb89b54;_0x22da9c['model']=_[_0x9859('0x41')](db[_0x9859('0x9f')]['rawAttributes']);_0x22da9c[_0x9859('0x42')]=_[_0x9859('0x41')](_0x4eca1b[_0x9859('0x42')]);_0x22da9c[_0x9859('0x4c')]=_['intersection'](_0x22da9c[_0x9859('0x40')],_0x22da9c['query']);_0x55df55[_0x9859('0x46')]=_[_0x9859('0x43')](_0x22da9c[_0x9859('0x40')],qs['fields'](_0x4eca1b[_0x9859('0x42')]['fields']));_0x55df55[_0x9859('0x46')]=_0x55df55[_0x9859('0x46')][_0x9859('0x45')]?_0x55df55['attributes']:_0x22da9c[_0x9859('0x40')];_0x55df55[_0x9859('0x49')]=qs[_0x9859('0x4a')](_0x4eca1b['query'][_0x9859('0x4a')]);_0x55df55['where']=qs[_0x9859('0x4c')](_['pick'](_0x4eca1b[_0x9859('0x42')],_0x22da9c['filters']));if(_0x4eca1b[_0x9859('0x42')][_0x9859('0x4e')]){_0x55df55[_0x9859('0x4b')]=_[_0x9859('0x68')](_0x55df55[_0x9859('0x4b')],{'$or':_['map'](_0x55df55[_0x9859('0x46')],function(_0x5747a3){var _0x28cb4d={};_0x28cb4d[_0x5747a3]={'$like':'%'+_0x4eca1b['query']['filter']+'%'};return _0x28cb4d;})});}_0x55df55=_[_0x9859('0x68')]({},_0x55df55,_0x4eca1b['options']);return _0x49e293['getAgents'](_0x55df55);}})[_0x9859('0x33')](function(_0x47d123){if(_0x47d123){_0x25503c=_0x47d123[_0x9859('0x45')];if(!_0x4eca1b[_0x9859('0x42')][_0x9859('0x47')](_0x9859('0x48'))){_0x55df55[_0x9859('0x2e')]=qs[_0x9859('0x2e')](_0x4eca1b[_0x9859('0x42')][_0x9859('0x2e')]);_0x55df55['offset']=qs[_0x9859('0x2d')](_0x4eca1b[_0x9859('0x42')]['offset']);}return _0x49e293[_0x9859('0xb9')](_0x55df55);}})['then'](function(_0x28b670){if(_0x28b670){return _0x28b670?{'count':_0x25503c,'rows':_0x28b670}:null;}})['then'](respondWithResult(_0x36f8a4,null))['catch'](handleError(_0x36f8a4,null));};exports[_0x9859('0x3a')]=function(_0x4dbb29,_0xa9e1ed,_0x17ae73){var _0xe97332,_0x3b35bf,_0x4cfbec;if(_[_0x9859('0x7a')](_0x4dbb29[_0x9859('0x5b')][_0x9859('0x5b')])||_0x4dbb29['body'][_0x9859('0x5b')]===''){throw new db[(_0x9859('0x72'))]['ValidationError'](_0x9859('0x7c'));}if(_[_0x9859('0x7a')](_0x4dbb29['body']['to'])){}_0xe97332=_0x4dbb29[_0x9859('0x5b')]['to'];return db[_0x9859('0x3e')][_0x9859('0x67')]({'where':{'id':_0x4dbb29[_0x9859('0x58')]['id']}})[_0x9859('0x33')](handleEntityNotFound(_0xa9e1ed,null))[_0x9859('0x33')](function(_0x28f79e){if(_0x28f79e){return db['OpenchannelAccount'][_0x9859('0x60')]({'where':{'id':_0x28f79e['id']},'include':[{'model':db[_0x9859('0x81')],'as':_0x9859('0x82'),'include':[{'model':db[_0x9859('0x71')],'as':_0x9859('0x8b'),'where':{[_0x28f79e[_0x9859('0x7f')]]:_0xe97332},'limit':0x1,'order':[[_0x9859('0x75'),_0x9859('0xba')]]}]}]})[_0x9859('0x33')](handleEntityNotFound(_0xa9e1ed,null))[_0x9859('0x33')](function(_0x1a1571){if(_0x1a1571&&_0x1a1571[_0x9859('0x82')]){_0x3b35bf=_0x1a1571[_0x9859('0x35')]({'plain':!![]});if(_0x3b35bf['List']&&_0x3b35bf['List'][_0x9859('0x8b')][_0x9859('0x45')]){return _0x3b35bf[_0x9859('0x82')]['Contacts'][0x0];}return db[_0x9859('0x71')][_0x9859('0x5a')](_[_0x9859('0x8c')](_0x4dbb29[_0x9859('0x5b')],{'firstName':_0xe97332,[_0x1a1571[_0x9859('0x7f')]]:_0xe97332,'phone':_0xe97332,'ListId':_0x3b35bf[_0x9859('0x79')]}));}})[_0x9859('0x33')](handleEntityNotFound(_0xa9e1ed,null))[_0x9859('0x33')](function(_0x2dba84){if(_0x2dba84){_0x4cfbec=_0x2dba84;return db[_0x9859('0x92')][_0x9859('0x60')]({'where':{'ContactId':_0x4cfbec['id'],'closed':![],'OpenchannelAccountId':_0x3b35bf['id']}})[_0x9859('0x33')](function(_0x3686cd){if(_0x3686cd){return[_0x3686cd,![]];}return db[_0x9859('0x92')][_0x9859('0x5a')]({'UserId':_0x4dbb29[_0x9859('0x5c')]['id'],'ContactId':_0x4cfbec['id'],'OpenchannelAccountId':_0x3b35bf['id'],'lastMsgDirection':_0x9859('0xbb'),'Messages':[_[_0x9859('0x68')](_0x4dbb29[_0x9859('0x5b')],{'read':![],'body':_0x4dbb29[_0x9859('0x5b')]['body'],'OpenchannelAccountId':_0x3b35bf['id'],'UserId':_0x4dbb29[_0x9859('0x5c')]['id'],'ContactId':_0x4cfbec['id']})]},{'include':[{'model':db[_0x9859('0x9c')],'as':'Messages'}]})[_0x9859('0x33')](function(_0x2cf3f2){return[_0x2cf3f2,!![]];});});}})[_0x9859('0x93')](function(_0x157325,_0x47182d){if(_0x47182d){return _0x157325;}return db['OpenchannelMessage'][_0x9859('0x5a')](_['merge'](_0x4dbb29[_0x9859('0x5b')],{'read':![],'body':_0x4dbb29[_0x9859('0x5b')][_0x9859('0x5b')],'OpenchannelAccountId':_0x3b35bf['id'],'OpenchannelInteractionId':_0x157325['id'],'UserId':_0x4dbb29[_0x9859('0x5c')]['id'],'ContactId':_0x4cfbec['id']}))[_0x9859('0x33')](function(_0x53022d){_0x157325[_0x9859('0xbc')]['Messages']=[];_0x157325[_0x9859('0xbc')][_0x9859('0xbd')][_0x9859('0x98')](_0x53022d[_0x9859('0xbc')]);return _0x157325;});});}})[_0x9859('0x33')](respondWithResult(_0xa9e1ed,null))[_0x9859('0x28')](handleError(_0xa9e1ed,null));}; \ No newline at end of file +var _0x4fd0=['threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','created','interaction','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','Contact','User','Owner','fullname','internal','Tags','color','tag','addAgents','emit','removeAgents','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','reject','update','destroy','OpenchannelAccounts','UserProfileResource','name','send','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','includeAll','include','rows','params','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','OpenchannelAccountId','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','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','from','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName'];(function(_0x589433,_0x3cd1d3){var _0x3976fc=function(_0x4958ae){while(--_0x4958ae){_0x589433['push'](_0x589433['shift']());}};_0x3976fc(++_0x3cd1d3);}(_0x4fd0,0xe3));var _0x04fd=function(_0x255840,_0x411b6e){_0x255840=_0x255840-0x0;var _0x40dad5=_0x4fd0[_0x255840];return _0x40dad5;};'use strict';var pdf=require(_0x04fd('0x0'));var emlformat=require(_0x04fd('0x1'));var rimraf=require(_0x04fd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04fd('0x3'));var rp=require(_0x04fd('0x4'));var moment=require(_0x04fd('0x5'));var BPromise=require(_0x04fd('0x6'));var Mustache=require(_0x04fd('0x7'));var util=require(_0x04fd('0x8'));var path=require('path');var sox=require(_0x04fd('0x9'));var csv=require(_0x04fd('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x04fd('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x04fd('0xc'));var toCsv=require(_0x04fd('0xa'));var querystring=require(_0x04fd('0xd'));var Papa=require(_0x04fd('0xe'));var authService=require(_0x04fd('0xf'));var hardwareService=require(_0x04fd('0x10'));var Redis=require(_0x04fd('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x04fd('0x12'))['db'];config[_0x04fd('0x13')]=_[_0x04fd('0x14')](config[_0x04fd('0x13')],{'host':_0x04fd('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04fd('0x13')]));require(_0x04fd('0x16'))[_0x04fd('0x17')](socket);var jayson=require(_0x04fd('0x18'));var client=jayson[_0x04fd('0x19')][_0x04fd('0x1a')]({'port':0x232c});var client9002=jayson[_0x04fd('0x19')][_0x04fd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xc62b50,_0x2cdad3,_0x538ecc,_0x240dd3){return new BPromise(function(_0x248ebe,_0xd83011){var _0x2f2571=_0x240dd3||client;return _0x2f2571['request'](_0xc62b50,_0x538ecc)[_0x04fd('0x1b')](function(_0x59be60){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2cdad3,_0x04fd('0x1c'));logger[_0x04fd('0x1d')](_0x04fd('0x1e'),_0x2cdad3,_0x04fd('0x1c'),JSON[_0x04fd('0x1f')](_0x59be60));if(_0x59be60[_0x04fd('0x20')]){if(_0x59be60[_0x04fd('0x20')][_0x04fd('0x21')]===0x1f4){logger[_0x04fd('0x20')](_0x04fd('0x22'),_0x2cdad3,_0x59be60[_0x04fd('0x20')][_0x04fd('0x23')]);return _0xd83011(_0x59be60[_0x04fd('0x20')]['message']);}logger['error'](_0x04fd('0x22'),_0x2cdad3,_0x59be60[_0x04fd('0x20')][_0x04fd('0x23')]);return _0x248ebe(_0x59be60[_0x04fd('0x20')]['message']);}else{logger[_0x04fd('0x24')](_0x04fd('0x22'),_0x2cdad3,'request\x20sent');_0x248ebe(_0x59be60[_0x04fd('0x25')][_0x04fd('0x23')]);}})[_0x04fd('0x26')](function(_0x40f5aa){logger[_0x04fd('0x20')](_0x04fd('0x22'),_0x2cdad3,_0x40f5aa);_0xd83011(_0x40f5aa);});});}function respondWithStatusCode(_0x2500f0,_0x4d4ce6){_0x4d4ce6=_0x4d4ce6||0xcc;return function(_0x43388a){if(_0x43388a){return _0x2500f0[_0x04fd('0x27')](_0x4d4ce6);}return _0x2500f0['status'](_0x4d4ce6)['end']();};}function respondWithResult(_0x3f575b,_0x40bce3){_0x40bce3=_0x40bce3||0xc8;return function(_0x341e8d){if(_0x341e8d){return _0x3f575b['status'](_0x40bce3)[_0x04fd('0x28')](_0x341e8d);}};}function respondWithFilteredResult(_0x20490e,_0x159773){return function(_0x4785c7){if(_0x4785c7){var _0xa6b9a5=_0x4785c7[_0x04fd('0x29')],_0x511a12=_0x159773[_0x04fd('0x2a')],_0x3b5e67=_0x159773[_0x04fd('0x2a')]+_0x159773[_0x04fd('0x2b')],_0x52500b;if(_0x3b5e67>=_0xa6b9a5){_0x3b5e67=_0xa6b9a5;_0x52500b=0xc8;}else{_0x52500b=0xce;}_0x20490e[_0x04fd('0x2c')](_0x52500b);return _0x20490e[_0x04fd('0x2d')](_0x04fd('0x2e'),_0x511a12+'-'+_0x3b5e67+'/'+_0xa6b9a5)[_0x04fd('0x28')](_0x4785c7);}return null;};}function patchUpdates(_0x164758){return function(_0x451c39){try{jsonpatch[_0x04fd('0x2f')](_0x451c39,_0x164758,!![]);}catch(_0x4dbe19){return BPromise[_0x04fd('0x30')](_0x4dbe19);}return _0x451c39['save']();};}function saveUpdates(_0xc00b2d,_0x3b2003){return function(_0x210f37){if(_0x210f37){return _0x210f37[_0x04fd('0x31')](_0xc00b2d)[_0x04fd('0x1b')](function(_0x50fd23){return _0x50fd23;});}return null;};}function removeEntity(_0x56a0cd,_0x225be1){return function(_0x4299f2){if(_0x4299f2){return _0x4299f2[_0x04fd('0x32')]()[_0x04fd('0x1b')](function(){var _0x1e7bb7=_0x4299f2['get']({'plain':!![]});var _0x4d2127=_0x04fd('0x33');return db[_0x04fd('0x34')][_0x04fd('0x32')]({'where':{'type':_0x4d2127,'resourceId':_0x1e7bb7['id']}})[_0x04fd('0x1b')](function(){return _0x4299f2;});})[_0x04fd('0x1b')](function(){_0x56a0cd[_0x04fd('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fbe7a,_0x559ffd){return function(_0x5b8b0e){if(!_0x5b8b0e){_0x1fbe7a['sendStatus'](0x194);}return _0x5b8b0e;};}function handleError(_0x447da1,_0x3a7ef1){_0x3a7ef1=_0x3a7ef1||0x1f4;return function(_0x344ab5){logger[_0x04fd('0x20')](_0x344ab5['stack']);if(_0x344ab5['name']){delete _0x344ab5[_0x04fd('0x35')];}_0x447da1[_0x04fd('0x2c')](_0x3a7ef1)[_0x04fd('0x36')](_0x344ab5);};}exports['index']=function(_0x385b6c,_0x31846a){var _0x49fa41={'include':[{'model':db[_0x04fd('0x37')],'as':_0x04fd('0x38')}]},_0xee47b7={},_0x4db17d={'count':0x0,'rows':[]};var _0x30719e=db[_0x04fd('0x39')][_0x04fd('0x3a')];_0xee47b7['model']=_['keys'](_0x30719e);_0xee47b7[_0x04fd('0x3b')]=_[_0x04fd('0x3c')](_0x385b6c[_0x04fd('0x3b')]);_0xee47b7[_0x04fd('0x3d')]=_[_0x04fd('0x3e')](_0xee47b7['model'],_0xee47b7[_0x04fd('0x3b')]);_0x49fa41['attributes']=_[_0x04fd('0x3e')](_0xee47b7[_0x04fd('0x3f')],qs[_0x04fd('0x40')](_0x385b6c['query'][_0x04fd('0x40')]));_0x49fa41[_0x04fd('0x41')]=_0x49fa41[_0x04fd('0x41')][_0x04fd('0x42')]?_0x49fa41['attributes']:_0xee47b7[_0x04fd('0x3f')];if(!_0x385b6c[_0x04fd('0x3b')][_0x04fd('0x43')](_0x04fd('0x44'))){_0x49fa41[_0x04fd('0x2b')]=qs[_0x04fd('0x2b')](_0x385b6c[_0x04fd('0x3b')]['limit']);_0x49fa41[_0x04fd('0x2a')]=qs[_0x04fd('0x2a')](_0x385b6c['query'][_0x04fd('0x2a')]);}_0x49fa41[_0x04fd('0x45')]=qs[_0x04fd('0x46')](_0x385b6c[_0x04fd('0x3b')][_0x04fd('0x46')]);_0x49fa41[_0x04fd('0x47')]=qs[_0x04fd('0x3d')](_[_0x04fd('0x48')](_0x385b6c[_0x04fd('0x3b')],_0xee47b7[_0x04fd('0x3d')]));if(_0x385b6c[_0x04fd('0x3b')]['filter']){_0x49fa41['where']=_[_0x04fd('0x49')](_0x49fa41['where'],{'$or':_[_0x04fd('0x4a')](_0x30719e,function(_0x2ed1ea){if(_0x2ed1ea[_0x04fd('0x4b')][_0x04fd('0x4c')]!==_0x04fd('0x4d')){var _0x55bf8a={};_0x55bf8a[_0x2ed1ea['field']]={'$like':'%'+_0x385b6c[_0x04fd('0x3b')][_0x04fd('0x4e')]+'%'};return _0x55bf8a;}})});}_0x49fa41=_[_0x04fd('0x49')]({},_0x49fa41,_0x385b6c[_0x04fd('0x4f')]);var _0x35d905={'where':_0x49fa41[_0x04fd('0x47')]};return db[_0x04fd('0x39')][_0x04fd('0x29')](_0x35d905)[_0x04fd('0x1b')](function(_0x168878){_0x4db17d[_0x04fd('0x29')]=_0x168878;if(_0x385b6c[_0x04fd('0x3b')][_0x04fd('0x50')]){_0x49fa41[_0x04fd('0x51')]=[{'all':!![]}];}return db[_0x04fd('0x39')]['findAll'](_0x49fa41);})['then'](function(_0x1a3b5f){_0x4db17d[_0x04fd('0x52')]=_0x1a3b5f;return _0x4db17d;})[_0x04fd('0x1b')](respondWithFilteredResult(_0x31846a,_0x49fa41))[_0x04fd('0x26')](handleError(_0x31846a,null));};exports['show']=function(_0x3ba1b7,_0x588684){var _0x411d90={'raw':![],'where':{'id':_0x3ba1b7[_0x04fd('0x53')]['id']},'include':[{'model':db[_0x04fd('0x37')],'as':_0x04fd('0x38')}]},_0x1851ed={};_0x1851ed[_0x04fd('0x3f')]=_['keys'](db[_0x04fd('0x39')]['rawAttributes']);_0x1851ed[_0x04fd('0x3b')]=_['keys'](_0x3ba1b7[_0x04fd('0x3b')]);_0x1851ed[_0x04fd('0x3d')]=_[_0x04fd('0x3e')](_0x1851ed[_0x04fd('0x3f')],_0x1851ed['query']);_0x411d90[_0x04fd('0x41')]=_[_0x04fd('0x3e')](_0x1851ed[_0x04fd('0x3f')],qs[_0x04fd('0x40')](_0x3ba1b7[_0x04fd('0x3b')]['fields']));_0x411d90[_0x04fd('0x41')]=_0x411d90[_0x04fd('0x41')]['length']?_0x411d90[_0x04fd('0x41')]:_0x1851ed[_0x04fd('0x3f')];if(_0x3ba1b7[_0x04fd('0x3b')][_0x04fd('0x50')]){_0x411d90[_0x04fd('0x51')]=[{'all':!![]}];}_0x411d90=_[_0x04fd('0x49')]({},_0x411d90,_0x3ba1b7[_0x04fd('0x4f')]);return db[_0x04fd('0x39')]['find'](_0x411d90)[_0x04fd('0x1b')](handleEntityNotFound(_0x588684,null))[_0x04fd('0x1b')](respondWithResult(_0x588684,null))[_0x04fd('0x26')](handleError(_0x588684,null));};exports[_0x04fd('0x54')]=function(_0x4f2f8d,_0x4e64a1){return db[_0x04fd('0x39')][_0x04fd('0x54')](_0x4f2f8d[_0x04fd('0x55')],{})[_0x04fd('0x1b')](function(_0x2bd0bf){var _0x1cb6cf=_0x4f2f8d['user'][_0x04fd('0x56')]({'plain':!![]});if(!_0x1cb6cf)throw new Error(_0x04fd('0x57'));if(_0x1cb6cf[_0x04fd('0x58')]===_0x04fd('0x59')){var _0x57b83f=_0x2bd0bf['get']({'plain':!![]});var _0x797d2='OpenchannelAccounts';return db[_0x04fd('0x5a')]['find']({'where':{'name':_0x797d2,'userProfileId':_0x1cb6cf['userProfileId']},'raw':!![]})[_0x04fd('0x1b')](function(_0x5c68ab){if(_0x5c68ab&&_0x5c68ab[_0x04fd('0x5b')]===0x0){return db[_0x04fd('0x34')][_0x04fd('0x54')]({'name':_0x57b83f[_0x04fd('0x35')],'resourceId':_0x57b83f['id'],'type':_0x5c68ab[_0x04fd('0x35')],'sectionId':_0x5c68ab['id']},{})[_0x04fd('0x1b')](function(){return _0x2bd0bf;});}else{return _0x2bd0bf;}})[_0x04fd('0x26')](function(_0x525f69){logger[_0x04fd('0x20')](_0x04fd('0x5c'),_0x525f69);throw _0x525f69;});}return _0x2bd0bf;})[_0x04fd('0x1b')](respondWithResult(_0x4e64a1,0xc9))[_0x04fd('0x26')](handleError(_0x4e64a1,null));};exports['update']=function(_0x10b22a,_0x3b5e94){if(_0x10b22a[_0x04fd('0x55')]['id']){delete _0x10b22a[_0x04fd('0x55')]['id'];}return db['OpenchannelAccount'][_0x04fd('0x5d')]({'where':{'id':_0x10b22a[_0x04fd('0x53')]['id']},'include':[{'model':db[_0x04fd('0x37')],'as':_0x04fd('0x38')}]})[_0x04fd('0x1b')](handleEntityNotFound(_0x3b5e94,null))[_0x04fd('0x1b')](saveUpdates(_0x10b22a['body'],null))[_0x04fd('0x1b')](function(_0x1ad7d4){if(_0x1ad7d4&&_0x10b22a[_0x04fd('0x55')][_0x04fd('0x38')]){return db[_0x04fd('0x37')]['update'](_0x10b22a[_0x04fd('0x55')][_0x04fd('0x38')],{'where':{'OpenchannelAccountId':_0x1ad7d4['id']}})['then'](function(){return _0x1ad7d4;});}return _0x1ad7d4;})[_0x04fd('0x1b')](respondWithResult(_0x3b5e94,null))[_0x04fd('0x26')](handleError(_0x3b5e94,null));};exports['destroy']=function(_0x2673f6,_0x3d625d){return db[_0x04fd('0x39')][_0x04fd('0x5d')]({'where':{'id':_0x2673f6[_0x04fd('0x53')]['id']}})[_0x04fd('0x1b')](handleEntityNotFound(_0x3d625d,null))[_0x04fd('0x1b')](removeEntity(_0x3d625d,null))[_0x04fd('0x26')](handleError(_0x3d625d,null));};exports[_0x04fd('0x5e')]=function(_0x48e8a4,_0x2f7975){return db['OpenchannelAccount'][_0x04fd('0x5e')]()[_0x04fd('0x1b')](respondWithResult(_0x2f7975,null))[_0x04fd('0x26')](handleError(_0x2f7975,null));};exports[_0x04fd('0x5f')]=function(_0xe12d70,_0x550b9f,_0x5924b6){if(_0xe12d70[_0x04fd('0x55')]['id']){delete _0xe12d70[_0x04fd('0x55')]['id'];}return db[_0x04fd('0x39')][_0x04fd('0x5d')]({'where':{'id':_0xe12d70[_0x04fd('0x53')]['id']}})[_0x04fd('0x1b')](handleEntityNotFound(_0x550b9f,null))['then'](function(_0x4c040c){if(_0x4c040c){_0xe12d70[_0x04fd('0x55')][_0x04fd('0x60')]=_0x4c040c['id'];return db[_0x04fd('0x61')][_0x04fd('0x54')](_0xe12d70[_0x04fd('0x55')]);}})[_0x04fd('0x1b')](respondWithResult(_0x550b9f,null))['catch'](handleError(_0x550b9f,null));};exports[_0x04fd('0x62')]=function(_0x41283c,_0x560f11,_0x50c89b){var _0x49f60d={'raw':![],'where':{}};var _0x4dce28={};var _0x16014d={'count':0x0,'rows':[]};return db[_0x04fd('0x39')][_0x04fd('0x63')]({'where':{'id':_0x41283c[_0x04fd('0x53')]['id']}})[_0x04fd('0x1b')](handleEntityNotFound(_0x560f11,null))[_0x04fd('0x1b')](function(_0x11f893){if(_0x11f893){_0x4dce28[_0x04fd('0x3f')]=_[_0x04fd('0x3c')](db[_0x04fd('0x61')][_0x04fd('0x3a')]);_0x4dce28['query']=_[_0x04fd('0x3c')](_0x41283c[_0x04fd('0x3b')]);_0x4dce28['filters']=_[_0x04fd('0x3e')](_0x4dce28[_0x04fd('0x3f')],_0x4dce28[_0x04fd('0x3b')]);_0x49f60d[_0x04fd('0x41')]=_[_0x04fd('0x3e')](_0x4dce28[_0x04fd('0x3f')],qs[_0x04fd('0x40')](_0x41283c['query'][_0x04fd('0x40')]));_0x49f60d['attributes']=_0x49f60d[_0x04fd('0x41')][_0x04fd('0x42')]?_0x49f60d[_0x04fd('0x41')]:_0x4dce28[_0x04fd('0x3f')];if(!_0x41283c[_0x04fd('0x3b')][_0x04fd('0x43')](_0x04fd('0x44'))){_0x49f60d[_0x04fd('0x2b')]=qs['limit'](_0x41283c[_0x04fd('0x3b')]['limit']);_0x49f60d[_0x04fd('0x2a')]=qs[_0x04fd('0x2a')](_0x41283c['query'][_0x04fd('0x2a')]);}_0x49f60d[_0x04fd('0x45')]=qs['sort'](_0x41283c[_0x04fd('0x3b')][_0x04fd('0x46')]);_0x49f60d[_0x04fd('0x47')]=qs['filters'](_[_0x04fd('0x48')](_0x41283c[_0x04fd('0x3b')],_0x4dce28[_0x04fd('0x3d')]));_0x49f60d[_0x04fd('0x47')][_0x04fd('0x64')]=_0x11f893['id'];if(_0x41283c['query'][_0x04fd('0x4e')]){_0x49f60d[_0x04fd('0x47')]=_[_0x04fd('0x49')](_0x49f60d[_0x04fd('0x47')],{'$or':_[_0x04fd('0x4a')](_0x49f60d[_0x04fd('0x41')],function(_0x37a2e6){var _0x5327b7={};_0x5327b7[_0x37a2e6]={'$like':'%'+_0x41283c[_0x04fd('0x3b')][_0x04fd('0x4e')]+'%'};return _0x5327b7;})});}_0x49f60d=_[_0x04fd('0x49')]({},_0x49f60d,_0x41283c['options']);return db['Disposition'][_0x04fd('0x29')]({'where':_0x49f60d['where']})['then'](function(_0x4c4f9e){_0x16014d[_0x04fd('0x29')]=_0x4c4f9e;if(_0x41283c[_0x04fd('0x3b')][_0x04fd('0x50')]){_0x49f60d[_0x04fd('0x51')]=[{'all':!![]}];}return db[_0x04fd('0x61')][_0x04fd('0x65')](_0x49f60d);})[_0x04fd('0x1b')](function(_0x529e03){_0x16014d[_0x04fd('0x52')]=_0x529e03;return _0x16014d;});}})[_0x04fd('0x1b')](respondWithFilteredResult(_0x560f11,_0x49f60d))[_0x04fd('0x26')](handleError(_0x560f11,null));};exports[_0x04fd('0x66')]=function(_0x36975d,_0xc226cf,_0x1fe081){var _0x598f26;return db[_0x04fd('0x39')][_0x04fd('0x5d')]({'where':{'id':_0x36975d[_0x04fd('0x53')]['id']}})[_0x04fd('0x1b')](handleEntityNotFound(_0xc226cf,null))['then'](function(_0x185de7){if(_0x185de7){return _0x185de7['removeDispositions'](_0x36975d['query']['ids']);}})['then'](respondWithStatusCode(_0xc226cf,null))['catch'](handleError(_0xc226cf,null));};exports[_0x04fd('0x67')]=function(_0x49ed0e,_0x2b6a4a,_0x290a5c){if(_0x49ed0e[_0x04fd('0x55')]['id']){delete _0x49ed0e[_0x04fd('0x55')]['id'];}return db[_0x04fd('0x39')][_0x04fd('0x5d')]({'where':{'id':_0x49ed0e[_0x04fd('0x53')]['id']}})[_0x04fd('0x1b')](handleEntityNotFound(_0x2b6a4a,null))[_0x04fd('0x1b')](function(_0x238945){if(_0x238945){_0x49ed0e[_0x04fd('0x55')][_0x04fd('0x64')]=_0x238945['id'];return db[_0x04fd('0x68')]['create'](_0x49ed0e['body']);}})[_0x04fd('0x1b')](respondWithResult(_0x2b6a4a,null))['catch'](handleError(_0x2b6a4a,null));};exports[_0x04fd('0x69')]=function(_0x15bf10,_0x1d62b8,_0x18f31a){var _0x37bf22={'raw':![],'where':{}};var _0x21a7e0={};var _0x3ac8a3={'count':0x0,'rows':[]};return db[_0x04fd('0x39')][_0x04fd('0x63')]({'where':{'id':_0x15bf10[_0x04fd('0x53')]['id']}})['then'](handleEntityNotFound(_0x1d62b8,null))[_0x04fd('0x1b')](function(_0x32fa4e){if(_0x32fa4e){_0x21a7e0['model']=_['keys'](db[_0x04fd('0x68')][_0x04fd('0x3a')]);_0x21a7e0[_0x04fd('0x3b')]=_[_0x04fd('0x3c')](_0x15bf10[_0x04fd('0x3b')]);_0x21a7e0[_0x04fd('0x3d')]=_['intersection'](_0x21a7e0[_0x04fd('0x3f')],_0x21a7e0[_0x04fd('0x3b')]);_0x37bf22[_0x04fd('0x41')]=_[_0x04fd('0x3e')](_0x21a7e0[_0x04fd('0x3f')],qs[_0x04fd('0x40')](_0x15bf10['query']['fields']));_0x37bf22[_0x04fd('0x41')]=_0x37bf22[_0x04fd('0x41')][_0x04fd('0x42')]?_0x37bf22[_0x04fd('0x41')]:_0x21a7e0[_0x04fd('0x3f')];if(!_0x15bf10['query'][_0x04fd('0x43')](_0x04fd('0x44'))){_0x37bf22[_0x04fd('0x2b')]=qs[_0x04fd('0x2b')](_0x15bf10[_0x04fd('0x3b')][_0x04fd('0x2b')]);_0x37bf22['offset']=qs['offset'](_0x15bf10[_0x04fd('0x3b')][_0x04fd('0x2a')]);}_0x37bf22[_0x04fd('0x45')]=qs[_0x04fd('0x46')](_0x15bf10[_0x04fd('0x3b')][_0x04fd('0x46')]);_0x37bf22[_0x04fd('0x47')]=qs[_0x04fd('0x3d')](_[_0x04fd('0x48')](_0x15bf10[_0x04fd('0x3b')],_0x21a7e0['filters']));_0x37bf22['where']['OpenchannelAccountId']=_0x32fa4e['id'];if(_0x15bf10[_0x04fd('0x3b')]['filter']){_0x37bf22[_0x04fd('0x47')]=_[_0x04fd('0x49')](_0x37bf22[_0x04fd('0x47')],{'$or':_[_0x04fd('0x4a')](_0x37bf22[_0x04fd('0x41')],function(_0x47f3d4){var _0x16ad55={};_0x16ad55[_0x47f3d4]={'$like':'%'+_0x15bf10['query'][_0x04fd('0x4e')]+'%'};return _0x16ad55;})});}_0x37bf22=_[_0x04fd('0x49')]({},_0x37bf22,_0x15bf10[_0x04fd('0x4f')]);return db['CannedAnswer']['count']({'where':_0x37bf22['where']})['then'](function(_0xbc04fb){_0x3ac8a3['count']=_0xbc04fb;if(_0x15bf10[_0x04fd('0x3b')][_0x04fd('0x50')]){_0x37bf22[_0x04fd('0x51')]=[{'all':!![]}];}return db['CannedAnswer'][_0x04fd('0x65')](_0x37bf22);})['then'](function(_0x4e7e4d){_0x3ac8a3[_0x04fd('0x52')]=_0x4e7e4d;return _0x3ac8a3;});}})[_0x04fd('0x1b')](respondWithFilteredResult(_0x1d62b8,_0x37bf22))[_0x04fd('0x26')](handleError(_0x1d62b8,null));};exports[_0x04fd('0x6a')]=function(_0xd736ea,_0x2d402d,_0x291d87){var _0x5a63e1;return db['OpenchannelAccount'][_0x04fd('0x5d')]({'where':{'id':_0xd736ea[_0x04fd('0x53')]['id']}})[_0x04fd('0x1b')](handleEntityNotFound(_0x2d402d,null))[_0x04fd('0x1b')](function(_0x1833ab){if(_0x1833ab){return _0x1833ab[_0x04fd('0x6a')](_0xd736ea[_0x04fd('0x3b')][_0x04fd('0x6b')]);}})['then'](respondWithStatusCode(_0x2d402d,null))[_0x04fd('0x26')](handleError(_0x2d402d,null));};exports[_0x04fd('0x6c')]=function(_0x42163b,_0x301265,_0x36c937){var _0x1a4ddc={'body':_0x42163b['body'],'channel':'openchannel'};var _0x510da9=[];var _0x179b9c=[];var _0x1e8d48={};var _0x143192=![];return db[_0x04fd('0x6d')]['describe']()[_0x04fd('0x1b')](function(_0x2844c6){if(!_0x2844c6){throw new db[(_0x04fd('0x6e'))][(_0x04fd('0x6f'))](_0x04fd('0x70'));}_0x510da9=_[_0x04fd('0x71')](_[_0x04fd('0x3c')](_0x2844c6),[_0x04fd('0x72'),_0x04fd('0x73')]);_0x179b9c=_[_0x04fd('0x71')](_[_0x04fd('0x3c')](_0x2844c6),[_0x04fd('0x72'),'updatedAt',_0x04fd('0x74'),_0x04fd('0x75')]);if(_0x42163b[_0x04fd('0x55')]['id']){delete _0x42163b[_0x04fd('0x55')]['id'];}if(_[_0x04fd('0x76')](_0x42163b[_0x04fd('0x55')]['from'])){throw new db[(_0x04fd('0x6e'))][(_0x04fd('0x6f'))](_0x04fd('0x77'));}if(_['isNil'](_0x42163b['body'][_0x04fd('0x55')])||_0x42163b['body']['body']===''){throw new db[(_0x04fd('0x6e'))][(_0x04fd('0x6f'))](_0x04fd('0x78'));}if(_[_0x04fd('0x76')](_0x42163b[_0x04fd('0x55')]['mapKey'])){throw new db[(_0x04fd('0x6e'))][(_0x04fd('0x6f'))](_0x04fd('0x79')+_0x179b9c);}if(!_[_0x04fd('0x7a')](_0x179b9c,_0x42163b[_0x04fd('0x55')][_0x04fd('0x7b')])){throw new db[(_0x04fd('0x6e'))][(_0x04fd('0x6f'))](_0x04fd('0x7c')+_0x179b9c);}_0x1e8d48[_0x42163b[_0x04fd('0x55')][_0x04fd('0x7b')]]=_0x42163b[_0x04fd('0x55')][_0x04fd('0x7d')];})['then'](function(){return db['OpenchannelAccount'][_0x04fd('0x5d')]({'where':{'id':_0x42163b[_0x04fd('0x53')]['id']},'include':[{'model':db[_0x04fd('0x7e')],'as':_0x04fd('0x7f'),'include':[{'model':db[_0x04fd('0x6d')],'as':_0x04fd('0x80'),'where':_0x1e8d48,'limit':0x1,'order':[[_0x04fd('0x73'),_0x04fd('0x81')]]}]},{'model':db[_0x04fd('0x82')],'as':_0x04fd('0x83')}]});})[_0x04fd('0x1b')](handleEntityNotFound(_0x301265,null))[_0x04fd('0x1b')](function(_0x13de55){if(_0x13de55&&_0x13de55[_0x04fd('0x7f')]){_0x1a4ddc[_0x04fd('0x84')]=_0x13de55;_0x1a4ddc[_0x04fd('0x85')]=_0x13de55[_0x04fd('0x83')];_0x1a4ddc[_0x04fd('0x86')]=_0x13de55[_0x04fd('0x7f')];_0x1a4ddc['applications']=_[_0x04fd('0x87')](_0x1a4ddc[_0x04fd('0x85')],[_0x04fd('0x88')],[_0x04fd('0x89')]);if(_0x1a4ddc['account'][_0x04fd('0x83')]){delete _0x1a4ddc[_0x04fd('0x84')][_0x04fd('0x83')];}if(_0x1a4ddc['account'][_0x04fd('0x7f')]&&_0x1a4ddc[_0x04fd('0x84')][_0x04fd('0x7f')][_0x04fd('0x80')][_0x04fd('0x42')]){return _0x1a4ddc[_0x04fd('0x84')][_0x04fd('0x7f')][_0x04fd('0x80')][0x0];}var _0x5a65b4=_[_0x04fd('0x14')](_0x42163b[_0x04fd('0x55')],{'firstName':_0x42163b['body'][_0x04fd('0x7d')],'ListId':_0x13de55['ListId']});_0x5a65b4[_0x42163b[_0x04fd('0x55')]['mapKey']]=_0x42163b['body'][_0x04fd('0x7d')];return db[_0x04fd('0x6d')][_0x04fd('0x54')](_0x5a65b4,{'fields':_0x510da9,'raw':!![]});}})[_0x04fd('0x1b')](handleEntityNotFound(_0x301265,null))['then'](function(_0x4f8ae1){_0x1a4ddc[_0x04fd('0x8a')]=_0x4f8ae1;if(_0x4f8ae1){var _0x1c7dd0={'ContactId':_0x4f8ae1['id'],'OpenchannelAccountId':_0x42163b['params']['id'],'from':(_0x4f8ae1[_0x04fd('0x8b')]||'')+'\x20'+(_0x4f8ae1[_0x04fd('0x8c')]||'')};var _0x35add3={'OpenchannelAccountId':_0x42163b[_0x04fd('0x53')]['id'],'closed':![]};if(_0x42163b[_0x04fd('0x55')]['threadId']){_0x35add3[_0x04fd('0x8d')]=_0x42163b[_0x04fd('0x55')][_0x04fd('0x8d')];return db[_0x04fd('0x8e')]['find']({'where':_0x35add3})[_0x04fd('0x1b')](function(_0x160e9f){if(_0x160e9f){return[_0x160e9f,![]];}_0x1c7dd0['threadId']=_0x42163b[_0x04fd('0x55')][_0x04fd('0x8d')];_0x1c7dd0[_0x04fd('0x8f')]=_0x42163b[_0x04fd('0x55')][_0x04fd('0x8f')];return db['OpenchannelInteraction'][_0x04fd('0x54')](_0x1c7dd0)[_0x04fd('0x1b')](function(_0x3caa2c){return[_0x3caa2c,!![]];});});}else{_0x35add3[_0x04fd('0x8d')]=null;}_0x35add3[_0x04fd('0x90')]=_0x4f8ae1['id'];return db[_0x04fd('0x8e')][_0x04fd('0x5d')]({'where':_0x35add3})[_0x04fd('0x1b')](function(_0x44cc3a){if(_0x44cc3a){return[_0x44cc3a,![]];}return db['OpenchannelInteraction'][_0x04fd('0x54')](_0x1c7dd0)[_0x04fd('0x1b')](function(_0x5c475c){return[_0x5c475c,!![]];});});}})[_0x04fd('0x91')](function(_0x3be598,_0x1c24e3){if(_0x3be598){_0x143192=_0x1c24e3;if(!_0x1c24e3){var _0x237e2d={'from':(_0x1a4ddc['contact'][_0x04fd('0x8b')]||'')+'\x20'+(_0x1a4ddc[_0x04fd('0x8a')][_0x04fd('0x8c')]||'')};if(_0x42163b[_0x04fd('0x55')]['threadId']&&_0x42163b['body'][_0x04fd('0x92')]&&_0x42163b[_0x04fd('0x55')][_0x04fd('0x8d')]!=_0x42163b['body'][_0x04fd('0x92')]){_0x237e2d[_0x04fd('0x8d')]=_0x42163b['body'][_0x04fd('0x92')];}return _0x3be598['update'](_0x237e2d);}else{return _0x3be598;}}})['then'](function(_0x23997e){_0x1a4ddc['interaction']=_0x23997e[_0x04fd('0x56')]({'plain':!![]});_0x1a4ddc['interaction'][_0x04fd('0x93')]=_0x143192;if(_0x1a4ddc[_0x04fd('0x94')][_0x04fd('0x93')]){if(_0x1a4ddc['account']['autoclose']){_0x1a4ddc[_0x04fd('0x85')]['push']({'id':0x0,'priority':_0x1a4ddc[_0x04fd('0x85')][_0x04fd('0x42')]+0x1,'app':_0x04fd('0x95'),'appdata':_0x04fd('0x96'),'interval':_0x04fd('0x97')});}}return db[_0x04fd('0x98')]['create']({'body':_0x42163b[_0x04fd('0x55')][_0x04fd('0x55')],'OpenchannelAccountId':_0x42163b[_0x04fd('0x53')]['id'],'OpenchannelInteractionId':_0x23997e['id'],'direction':'in','ContactId':_0x1a4ddc['contact']['id'],'AttachmentId':_0x42163b[_0x04fd('0x55')][_0x04fd('0x99')]});})[_0x04fd('0x1b')](function(_0x39cbae){_0x1a4ddc[_0x04fd('0x23')]=_0x39cbae;if(_0x1a4ddc[_0x04fd('0x94')][_0x04fd('0x9a')]){return db['User'][_0x04fd('0x5d')]({'attributes':['id',_0x04fd('0x35')],'where':{'id':_0x1a4ddc['interaction'][_0x04fd('0x9a')]}})[_0x04fd('0x1b')](function(_0x4f03fa){if(_0x4f03fa){_0x1a4ddc[_0x04fd('0x85')][_0x04fd('0x9b')]({'id':0x0,'priority':0x0,'app':_0x04fd('0x9c'),'appdata':_0x4f03fa[_0x04fd('0x35')]+','+(_0x1a4ddc[_0x04fd('0x84')][_0x04fd('0x9d')]||0xa),'interval':'*,*,*,*'});_0x1a4ddc[_0x04fd('0x9e')]=![];}return respondWithRpcPromise(_0x04fd('0x9f'),_0x04fd('0xa0'),_0x1a4ddc);});}return respondWithRpcPromise(_0x04fd('0x9f'),'startRouting',_0x1a4ddc);})[_0x04fd('0x1b')](function(_0x1fe583){respondWithRpcPromise(_0x04fd('0xa1'),_0x04fd('0xa1'),{'event':_0x04fd('0x6c'),'message':_0x1fe583},client9002);return _0x1fe583;})['then'](respondWithResult(_0x301265,null))[_0x04fd('0x26')](handleError(_0x301265,null));};exports['addApplications']=function(_0x135b4e,_0x5c81a5,_0x25b9d0){return db[_0x04fd('0x39')][_0x04fd('0x63')]({'where':{'id':_0x135b4e[_0x04fd('0x53')]['id']}})[_0x04fd('0x1b')](handleEntityNotFound(_0x5c81a5,null))['then'](function(_0x86cced){if(_0x86cced){return db[_0x04fd('0xa2')][_0x04fd('0xa3')](function(_0x5433f6){return db[_0x04fd('0x82')][_0x04fd('0x32')]({'where':{'OpenchannelAccountId':_0x135b4e['params']['id']},'transaction':_0x5433f6})[_0x04fd('0x1b')](function(_0x2f8ef1){var _0x3130b9=_[_0x04fd('0x4a')](_0x135b4e[_0x04fd('0x55')],function(_0x4c9094){_0x4c9094[_0x04fd('0x64')]=_0x135b4e[_0x04fd('0x53')]['id'];return _0x4c9094;});return db['OpenchannelApplication'][_0x04fd('0xa4')](_0x3130b9,{'transaction':_0x5433f6});});})[_0x04fd('0x1b')](function(){return db[_0x04fd('0x82')][_0x04fd('0xa5')]({'where':{'OpenchannelAccountId':_0x135b4e['params']['id']},'order':_0x04fd('0x88')});});}})[_0x04fd('0x1b')](respondWithResult(_0x5c81a5,null))['catch'](handleError(_0x5c81a5,null));};exports[_0x04fd('0xa6')]=function(_0x35b441,_0x7c816c,_0x540a13){var _0x5a8530={};var _0x5ea63d={};var _0x7b46c5;var _0x471dbf;return db['OpenchannelAccount'][_0x04fd('0x63')]({'where':{'id':_0x35b441[_0x04fd('0x53')]['id']}})[_0x04fd('0x1b')](handleEntityNotFound(_0x7c816c,null))[_0x04fd('0x1b')](function(_0x239c8c){if(_0x239c8c){_0x7b46c5=_0x239c8c;_0x5ea63d[_0x04fd('0x3f')]=_[_0x04fd('0x3c')](db[_0x04fd('0x82')][_0x04fd('0x3a')]);_0x5ea63d[_0x04fd('0x3b')]=_['keys'](_0x35b441[_0x04fd('0x3b')]);_0x5ea63d[_0x04fd('0x3d')]=_[_0x04fd('0x3e')](_0x5ea63d[_0x04fd('0x3f')],_0x5ea63d[_0x04fd('0x3b')]);_0x5a8530[_0x04fd('0x41')]=_[_0x04fd('0x3e')](_0x5ea63d[_0x04fd('0x3f')],qs[_0x04fd('0x40')](_0x35b441[_0x04fd('0x3b')]['fields']));_0x5a8530[_0x04fd('0x41')]=_0x5a8530['attributes'][_0x04fd('0x42')]?_0x5a8530[_0x04fd('0x41')]:_0x5ea63d[_0x04fd('0x3f')];_0x5a8530[_0x04fd('0x45')]=qs['sort'](_0x35b441[_0x04fd('0x3b')][_0x04fd('0x46')]);_0x5a8530[_0x04fd('0x47')]=qs[_0x04fd('0x3d')](_['pick'](_0x35b441[_0x04fd('0x3b')],_0x5ea63d[_0x04fd('0x3d')]));if(_0x35b441[_0x04fd('0x3b')][_0x04fd('0x4e')]){_0x5a8530[_0x04fd('0x47')]=_[_0x04fd('0x49')](_0x5a8530['where'],{'$or':_[_0x04fd('0x4a')](_0x5a8530[_0x04fd('0x41')],function(_0x387f48){var _0x5bd88b={};_0x5bd88b[_0x387f48]={'$like':'%'+_0x35b441[_0x04fd('0x3b')]['filter']+'%'};return _0x5bd88b;})});}_0x5a8530=_['merge']({},_0x5a8530,_0x35b441[_0x04fd('0x4f')]);return _0x7b46c5[_0x04fd('0xa6')](_0x5a8530);}})[_0x04fd('0x1b')](function(_0x1e55bb){if(_0x1e55bb){_0x471dbf=_0x1e55bb['length'];if(!_0x35b441[_0x04fd('0x3b')][_0x04fd('0x43')](_0x04fd('0x44'))){_0x5a8530[_0x04fd('0x2b')]=qs[_0x04fd('0x2b')](_0x35b441[_0x04fd('0x3b')][_0x04fd('0x2b')]);_0x5a8530[_0x04fd('0x2a')]=qs[_0x04fd('0x2a')](_0x35b441[_0x04fd('0x3b')]['offset']);}return _0x7b46c5[_0x04fd('0xa6')](_0x5a8530);}})[_0x04fd('0x1b')](function(_0x2bf07e){if(_0x2bf07e){return _0x2bf07e?{'count':_0x471dbf,'rows':_0x2bf07e}:null;}})[_0x04fd('0x1b')](respondWithResult(_0x7c816c,null))['catch'](handleError(_0x7c816c,null));};exports['getInteractions']=function(_0x18cd4d,_0x1cd8ad,_0x659dca){var _0x3e9e90={'raw':![],'where':{}};var _0x166696={};var _0x5359f0={'count':0x0,'rows':[]};return db[_0x04fd('0x39')][_0x04fd('0x63')]({'where':{'id':_0x18cd4d[_0x04fd('0x53')]['id']}})[_0x04fd('0x1b')](handleEntityNotFound(_0x1cd8ad,null))[_0x04fd('0x1b')](function(_0x34d520){if(_0x34d520){_0x166696['model']=_[_0x04fd('0x3c')](db[_0x04fd('0x8e')][_0x04fd('0x3a')]);_0x166696[_0x04fd('0x3b')]=_['keys'](_0x18cd4d[_0x04fd('0x3b')]);_0x166696[_0x04fd('0x3d')]=_[_0x04fd('0x3e')](_0x166696[_0x04fd('0x3f')],_0x166696[_0x04fd('0x3b')]);_0x3e9e90[_0x04fd('0x41')]=_['intersection'](_0x166696['model'],qs[_0x04fd('0x40')](_0x18cd4d[_0x04fd('0x3b')][_0x04fd('0x40')]));_0x3e9e90[_0x04fd('0x41')]=_0x3e9e90[_0x04fd('0x41')]['length']?_0x3e9e90[_0x04fd('0x41')]:_0x166696[_0x04fd('0x3f')];if(!_0x18cd4d['query'][_0x04fd('0x43')](_0x04fd('0x44'))){_0x3e9e90['limit']=qs[_0x04fd('0x2b')](_0x18cd4d[_0x04fd('0x3b')][_0x04fd('0x2b')]);_0x3e9e90[_0x04fd('0x2a')]=qs[_0x04fd('0x2a')](_0x18cd4d[_0x04fd('0x3b')]['offset']);}_0x3e9e90[_0x04fd('0x45')]=qs['sort'](_0x18cd4d['query'][_0x04fd('0x46')]);_0x3e9e90[_0x04fd('0x47')]=qs[_0x04fd('0x3d')](_[_0x04fd('0x48')](_0x18cd4d[_0x04fd('0x3b')],_0x166696[_0x04fd('0x3d')]));_0x3e9e90['where'][_0x04fd('0x64')]=_0x34d520['id'];if(_0x18cd4d[_0x04fd('0x3b')][_0x04fd('0x4e')]){_0x3e9e90[_0x04fd('0x47')]=_[_0x04fd('0x49')](_0x3e9e90[_0x04fd('0x47')],{'$or':_[_0x04fd('0x4a')](_0x3e9e90[_0x04fd('0x41')],function(_0x17537e){var _0x55f4a5={};_0x55f4a5[_0x17537e]={'$like':'%'+_0x18cd4d['query'][_0x04fd('0x4e')]+'%'};return _0x55f4a5;})});}_0x3e9e90=_[_0x04fd('0x49')]({},_0x3e9e90,_0x18cd4d[_0x04fd('0x4f')]);return db[_0x04fd('0x8e')][_0x04fd('0x29')]({'where':_0x3e9e90[_0x04fd('0x47')]})['then'](function(_0xe00952){_0x5359f0['count']=_0xe00952;if(_0x18cd4d['query'][_0x04fd('0x50')]){_0x3e9e90[_0x04fd('0x51')]=[{'model':db[_0x04fd('0x6d')],'as':_0x04fd('0xa7'),'required':![]},{'model':db[_0x04fd('0xa8')],'as':_0x04fd('0xa9'),'attributes':['name',_0x04fd('0xaa'),_0x04fd('0xab')],'required':![]},{'model':db['Tag'],'as':_0x04fd('0xac'),'attributes':['id',_0x04fd('0x35'),_0x04fd('0xad')],'where':_0x18cd4d['query']['tag']?{'id':_0x18cd4d[_0x04fd('0x3b')][_0x04fd('0xae')]}:undefined,'required':_0x18cd4d[_0x04fd('0x3b')][_0x04fd('0xae')]?!![]:![]}];}return db[_0x04fd('0x8e')]['findAll'](_0x3e9e90);})[_0x04fd('0x1b')](function(_0x356f14){_0x5359f0[_0x04fd('0x52')]=_0x356f14;return _0x5359f0;});}})[_0x04fd('0x1b')](respondWithFilteredResult(_0x1cd8ad,_0x3e9e90))[_0x04fd('0x26')](handleError(_0x1cd8ad,null));};exports[_0x04fd('0xaf')]=function(_0x2283d4,_0x1c5a22,_0x3dc815){return db[_0x04fd('0x39')][_0x04fd('0x5d')]({'where':{'id':_0x2283d4[_0x04fd('0x53')]['id']}})[_0x04fd('0x1b')](handleEntityNotFound(_0x1c5a22,null))['then'](function(_0x371445){if(_0x371445){return _0x371445['addAgents'](_0x2283d4[_0x04fd('0x55')][_0x04fd('0x6b')],_['omit'](_0x2283d4['body'],[_0x04fd('0x6b'),'id'])||{})[_0x04fd('0x91')](function(_0x514321){for(var _0x3c45fb=0x0;_0x3c45fb<_0x2283d4[_0x04fd('0x55')][_0x04fd('0x6b')]['length'];_0x3c45fb+=0x1){socket[_0x04fd('0xb0')]('userOpenchannelAccount:save',{'UserId':_0x2283d4[_0x04fd('0x55')][_0x04fd('0x6b')][_0x3c45fb],'OpenchannelAccountId':_0x2283d4['params']['id']});}return _0x514321;});}})['then'](respondWithResult(_0x1c5a22,null))[_0x04fd('0x26')](handleError(_0x1c5a22,null));};exports[_0x04fd('0xb1')]=function(_0x1f1039,_0x40c984,_0x2cd424){var _0x5586c7;return db[_0x04fd('0x39')][_0x04fd('0x5d')]({'where':{'id':_0x1f1039[_0x04fd('0x53')]['id']}})['then'](handleEntityNotFound(_0x40c984,null))[_0x04fd('0x1b')](function(_0xf3c731){if(_0xf3c731){return _0xf3c731[_0x04fd('0xb1')](_0x1f1039['query'][_0x04fd('0x6b')])[_0x04fd('0x1b')](function(_0x25e690){if(_['isArray'](_0x1f1039[_0x04fd('0x3b')][_0x04fd('0x6b')])){for(var _0xaeb894=0x0;_0xaeb894<_0x1f1039[_0x04fd('0x3b')]['ids'][_0x04fd('0x42')];_0xaeb894+=0x1){socket[_0x04fd('0xb0')](_0x04fd('0xb2'),{'UserId':_0x1f1039['query']['ids'][_0xaeb894],'OpenchannelAccountId':_0x1f1039['params']['id']});}}else{socket[_0x04fd('0xb0')]('userOpenchannelAccount:remove',{'UserId':_0x1f1039[_0x04fd('0x3b')][_0x04fd('0x6b')],'OpenchannelAccountId':_0x1f1039[_0x04fd('0x53')]['id']});}});}})[_0x04fd('0x1b')](respondWithStatusCode(_0x40c984,null))[_0x04fd('0x26')](handleError(_0x40c984,null));};exports['getAgents']=function(_0x10ee6b,_0x46ad43,_0x344e67){var _0x5f2ca3={};var _0x105c51={};var _0x2ca78f;var _0x53588b;return db[_0x04fd('0x39')][_0x04fd('0x63')]({'where':{'id':_0x10ee6b['params']['id']}})[_0x04fd('0x1b')](handleEntityNotFound(_0x46ad43,null))[_0x04fd('0x1b')](function(_0x19b721){if(_0x19b721){_0x2ca78f=_0x19b721;_0x105c51[_0x04fd('0x3f')]=_['keys'](db['User'][_0x04fd('0x3a')]);_0x105c51[_0x04fd('0x3b')]=_[_0x04fd('0x3c')](_0x10ee6b[_0x04fd('0x3b')]);_0x105c51[_0x04fd('0x3d')]=_[_0x04fd('0x3e')](_0x105c51['model'],_0x105c51[_0x04fd('0x3b')]);_0x5f2ca3['attributes']=_[_0x04fd('0x3e')](_0x105c51[_0x04fd('0x3f')],qs['fields'](_0x10ee6b[_0x04fd('0x3b')]['fields']));_0x5f2ca3[_0x04fd('0x41')]=_0x5f2ca3[_0x04fd('0x41')][_0x04fd('0x42')]?_0x5f2ca3['attributes']:_0x105c51[_0x04fd('0x3f')];_0x5f2ca3[_0x04fd('0x45')]=qs[_0x04fd('0x46')](_0x10ee6b['query'][_0x04fd('0x46')]);_0x5f2ca3['where']=qs[_0x04fd('0x3d')](_[_0x04fd('0x48')](_0x10ee6b['query'],_0x105c51['filters']));if(_0x10ee6b['query'][_0x04fd('0x4e')]){_0x5f2ca3[_0x04fd('0x47')]=_['merge'](_0x5f2ca3[_0x04fd('0x47')],{'$or':_[_0x04fd('0x4a')](_0x5f2ca3['attributes'],function(_0x3c974a){var _0x564648={};_0x564648[_0x3c974a]={'$like':'%'+_0x10ee6b[_0x04fd('0x3b')][_0x04fd('0x4e')]+'%'};return _0x564648;})});}_0x5f2ca3=_[_0x04fd('0x49')]({},_0x5f2ca3,_0x10ee6b[_0x04fd('0x4f')]);return _0x2ca78f[_0x04fd('0xb3')](_0x5f2ca3);}})[_0x04fd('0x1b')](function(_0x490712){if(_0x490712){_0x53588b=_0x490712[_0x04fd('0x42')];if(!_0x10ee6b[_0x04fd('0x3b')][_0x04fd('0x43')](_0x04fd('0x44'))){_0x5f2ca3[_0x04fd('0x2b')]=qs[_0x04fd('0x2b')](_0x10ee6b[_0x04fd('0x3b')][_0x04fd('0x2b')]);_0x5f2ca3[_0x04fd('0x2a')]=qs[_0x04fd('0x2a')](_0x10ee6b['query'][_0x04fd('0x2a')]);}return _0x2ca78f['getAgents'](_0x5f2ca3);}})['then'](function(_0xafef48){if(_0xafef48){return _0xafef48?{'count':_0x53588b,'rows':_0xafef48}:null;}})['then'](respondWithResult(_0x46ad43,null))['catch'](handleError(_0x46ad43,null));};exports[_0x04fd('0x36')]=function(_0x3eb3ee,_0x39bdb4,_0x3d61de){var _0x1f9bd5,_0x1a4e69,_0x36309f;if(_[_0x04fd('0x76')](_0x3eb3ee[_0x04fd('0x55')][_0x04fd('0x55')])||_0x3eb3ee[_0x04fd('0x55')][_0x04fd('0x55')]===''){throw new db[(_0x04fd('0x6e'))]['ValidationError'](_0x04fd('0x78'));}if(_[_0x04fd('0x76')](_0x3eb3ee[_0x04fd('0x55')]['to'])){}_0x1f9bd5=_0x3eb3ee[_0x04fd('0x55')]['to'];return db[_0x04fd('0x39')][_0x04fd('0x63')]({'where':{'id':_0x3eb3ee[_0x04fd('0x53')]['id']}})['then'](handleEntityNotFound(_0x39bdb4,null))['then'](function(_0x45f409){if(_0x45f409){return db[_0x04fd('0x39')][_0x04fd('0x5d')]({'where':{'id':_0x45f409['id']},'include':[{'model':db[_0x04fd('0x7e')],'as':'List','include':[{'model':db[_0x04fd('0x6d')],'as':_0x04fd('0x80'),'where':{[_0x45f409['mapKey']]:_0x1f9bd5},'limit':0x1,'order':[[_0x04fd('0x73'),'DESC']]}]}]})[_0x04fd('0x1b')](handleEntityNotFound(_0x39bdb4,null))[_0x04fd('0x1b')](function(_0x586706){if(_0x586706&&_0x586706['List']){_0x1a4e69=_0x586706['get']({'plain':!![]});if(_0x1a4e69[_0x04fd('0x7f')]&&_0x1a4e69[_0x04fd('0x7f')]['Contacts'][_0x04fd('0x42')]){return _0x1a4e69[_0x04fd('0x7f')][_0x04fd('0x80')][0x0];}return db[_0x04fd('0x6d')]['create'](_[_0x04fd('0x14')](_0x3eb3ee[_0x04fd('0x55')],{'firstName':_0x1f9bd5,[_0x586706[_0x04fd('0x7b')]]:_0x1f9bd5,'phone':_0x1f9bd5,'ListId':_0x1a4e69[_0x04fd('0x75')]}));}})['then'](handleEntityNotFound(_0x39bdb4,null))[_0x04fd('0x1b')](function(_0x2091f7){if(_0x2091f7){_0x36309f=_0x2091f7;return db[_0x04fd('0x8e')][_0x04fd('0x5d')]({'where':{'ContactId':_0x36309f['id'],'closed':![],'OpenchannelAccountId':_0x1a4e69['id']}})['then'](function(_0x455a03){if(_0x455a03){return[_0x455a03,![]];}return db[_0x04fd('0x8e')][_0x04fd('0x54')]({'UserId':_0x3eb3ee[_0x04fd('0x59')]['id'],'ContactId':_0x36309f['id'],'OpenchannelAccountId':_0x1a4e69['id'],'lastMsgDirection':_0x04fd('0xb4'),'Messages':[_[_0x04fd('0x49')](_0x3eb3ee['body'],{'read':![],'body':_0x3eb3ee['body']['body'],'OpenchannelAccountId':_0x1a4e69['id'],'UserId':_0x3eb3ee[_0x04fd('0x59')]['id'],'ContactId':_0x36309f['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x04fd('0xb5')}]})[_0x04fd('0x1b')](function(_0x5bf329){return[_0x5bf329,!![]];});});}})[_0x04fd('0x91')](function(_0x592c56,_0x4c478b){if(_0x4c478b){return _0x592c56;}return db[_0x04fd('0x98')][_0x04fd('0x54')](_['merge'](_0x3eb3ee[_0x04fd('0x55')],{'read':![],'body':_0x3eb3ee['body'][_0x04fd('0x55')],'OpenchannelAccountId':_0x1a4e69['id'],'OpenchannelInteractionId':_0x592c56['id'],'UserId':_0x3eb3ee[_0x04fd('0x59')]['id'],'ContactId':_0x36309f['id']}))[_0x04fd('0x1b')](function(_0x52397a){_0x592c56[_0x04fd('0xb6')]['Messages']=[];_0x592c56[_0x04fd('0xb6')]['Messages'][_0x04fd('0xb7')](_0x52397a[_0x04fd('0xb6')]);return _0x592c56;});});}})['then'](respondWithResult(_0x39bdb4,null))[_0x04fd('0x26')](handleError(_0x39bdb4,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index d98282d..2fd6a35 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 _0x8a24=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','emit','hook','exports'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8a24,0x132));var _0x48a2=function(_0x2d976d,_0x47657d){_0x2d976d=_0x2d976d-0x0;var _0xf4bfb8=_0x8a24[_0x2d976d];return _0xf4bfb8;};'use strict';var EventEmitter=require(_0x48a2('0x0'));var OpenchannelAccount=require(_0x48a2('0x1'))['db'][_0x48a2('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x48a2('0x3')](0x0);var events={'afterCreate':_0x48a2('0x4'),'afterUpdate':_0x48a2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5e53b8){return function(_0xf33554,_0x45c103,_0x5d7158){OpenchannelAccountEvents[_0x48a2('0x6')](_0x5e53b8+':'+_0xf33554['id'],_0xf33554);OpenchannelAccountEvents[_0x48a2('0x6')](_0x5e53b8,_0xf33554);_0x5d7158(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x48a2('0x7')](e,emitEvent(event));}}module[_0x48a2('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x8a63=['save','update','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelAccount','setMaxListeners'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0x8a63,0x1dd));var _0x38a6=function(_0x5e6116,_0x4bae08){_0x5e6116=_0x5e6116-0x0;var _0x29bf86=_0x8a63[_0x5e6116];return _0x29bf86;};'use strict';var EventEmitter=require(_0x38a6('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x38a6('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x38a6('0x2')](0x0);var events={'afterCreate':_0x38a6('0x3'),'afterUpdate':_0x38a6('0x4'),'afterDestroy':_0x38a6('0x5')};function emitEvent(_0x400c8e){return function(_0x47f54b,_0x266ea3,_0x27fa7b){OpenchannelAccountEvents[_0x38a6('0x6')](_0x400c8e+':'+_0x47f54b['id'],_0x47f54b);OpenchannelAccountEvents[_0x38a6('0x6')](_0x400c8e,_0x47f54b);_0x27fa7b(null);};}for(var e in events){if(events[_0x38a6('0x7')](e)){var event=events[e];OpenchannelAccount[_0x38a6('0x8')](e,emitEvent(event));}}module[_0x38a6('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index dd3a93d..96850c5 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 _0x9ffd=['util','../../config/logger','moment','bluebird','request-promise','./openchannelAccount.attributes','OpenchannelAccount','openchannel_accounts','lodash'];(function(_0x215264,_0x5d4324){var _0x1965ed=function(_0x11097f){while(--_0x11097f){_0x215264['push'](_0x215264['shift']());}};_0x1965ed(++_0x5d4324);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x484c03,_0x57adca){_0x484c03=_0x484c03-0x0;var _0x27e084=_0x9ffd[_0x484c03];return _0x27e084;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('api');var moment=require(_0xd9ff('0x3'));var BPromise=require(_0xd9ff('0x4'));var rp=require(_0xd9ff('0x5'));var attributes=require(_0xd9ff('0x6'));module['exports']=function(_0x1c9460,_0x111697){return _0x1c9460['define'](_0xd9ff('0x7'),attributes,{'tableName':_0xd9ff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdb7=['exports','openchannel_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./openchannelAccount.attributes'];(function(_0x509da2,_0xd2f81a){var _0x277535=function(_0x4823bb){while(--_0x4823bb){_0x509da2['push'](_0x509da2['shift']());}};_0x277535(++_0xd2f81a);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1ac0dd,_0x5a1e5f){_0x1ac0dd=_0x1ac0dd-0x0;var _0x31fc81=_0xbdb7[_0x1ac0dd];return _0x31fc81;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var attributes=require(_0x7bdb('0x7'));module[_0x7bdb('0x8')]=function(_0x47aec5,_0x28542c){return _0x47aec5['define']('OpenchannelAccount',attributes,{'tableName':_0x7bdb('0x9'),'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 f3dc4db..5288329 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 _0xc4aa=['redis','defaults','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3f6bb4,_0x67511a){var _0x2e8c79=function(_0x30d771){while(--_0x30d771){_0x3f6bb4['push'](_0x3f6bb4['shift']());}};_0x2e8c79(++_0x67511a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});config[_0xac4a('0xb')]=_[_0xac4a('0xc')](config[_0xac4a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac4a('0xb')]));require(_0xac4a('0xd'))[_0xac4a('0xe')](socket);function respondWithRpcPromise(_0x4f4146,_0x1d182e,_0x3a82de){return new BPromise(function(_0x3e64f5,_0x4d4acc){return client[_0xac4a('0xf')](_0x4f4146,_0x3a82de)['then'](function(_0x2f062c){logger['info'](_0xac4a('0x10'),_0x1d182e,_0xac4a('0x11'));logger[_0xac4a('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1d182e,_0xac4a('0x11'),JSON[_0xac4a('0x13')](_0x2f062c));if(_0x2f062c[_0xac4a('0x14')]){if(_0x2f062c[_0xac4a('0x14')][_0xac4a('0x15')]===0x1f4){logger[_0xac4a('0x14')](_0xac4a('0x10'),_0x1d182e,_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);return _0x4d4acc(_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);}logger[_0xac4a('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x1d182e,_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);return _0x3e64f5(_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);}else{logger[_0xac4a('0x17')](_0xac4a('0x10'),_0x1d182e,_0xac4a('0x11'));_0x3e64f5(_0x2f062c[_0xac4a('0x18')]['message']);}})['catch'](function(_0x21a729){logger[_0xac4a('0x14')](_0xac4a('0x10'),_0x1d182e,_0x21a729);_0x4d4acc(_0x21a729);});});} \ No newline at end of file +var _0x326f=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x24deba,_0x3c0e0b){var _0x1b79cc=function(_0x5ce205){while(--_0x5ce205){_0x24deba['push'](_0x24deba['shift']());}};_0x1b79cc(++_0x3c0e0b);}(_0x326f,0xd1));var _0xf326=function(_0xe0521,_0x19b9b2){_0xe0521=_0xe0521-0x0;var _0x2c77ea=_0x326f[_0xe0521];return _0x2c77ea;};'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});config[_0xf326('0xb')]=_[_0xf326('0xc')](config[_0xf326('0xb')],{'host':_0xf326('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xf326('0xe')](socket);function respondWithRpcPromise(_0x1fc80e,_0x163416,_0x2686e1){return new BPromise(function(_0x1f3a33,_0x5db9d7){return client[_0xf326('0xf')](_0x1fc80e,_0x2686e1)['then'](function(_0x1cf441){logger['info'](_0xf326('0x10'),_0x163416,'request\x20sent');logger[_0xf326('0x11')](_0xf326('0x12'),_0x163416,'request\x20sent',JSON[_0xf326('0x13')](_0x1cf441));if(_0x1cf441[_0xf326('0x14')]){if(_0x1cf441[_0xf326('0x14')][_0xf326('0x15')]===0x1f4){logger['error'](_0xf326('0x10'),_0x163416,_0x1cf441['error']['message']);return _0x5db9d7(_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);}logger[_0xf326('0x14')](_0xf326('0x10'),_0x163416,_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);return _0x1f3a33(_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);}else{logger['info'](_0xf326('0x10'),_0x163416,_0xf326('0x17'));_0x1f3a33(_0x1cf441[_0xf326('0x18')][_0xf326('0x16')]);}})[_0xf326('0x19')](function(_0x311af0){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x163416,_0x311af0);_0x5db9d7(_0x311af0);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 32bdcbb..fae4a77 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 _0x74d8=['removeListener','register','length','save','remove','update','emit'];(function(_0x55b074,_0x5073e2){var _0x1c643b=function(_0x37543b){while(--_0x37543b){_0x55b074['push'](_0x55b074['shift']());}};_0x1c643b(++_0x5073e2);}(_0x74d8,0x1a0));var _0x874d=function(_0x4d394f,_0x2cce25){_0x4d394f=_0x4d394f-0x0;var _0x50848d=_0x74d8[_0x4d394f];return _0x50848d;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x874d('0x0'),_0x874d('0x1'),_0x874d('0x2')];function createListener(_0x393734,_0x69e400){return function(_0x260a39){_0x69e400[_0x874d('0x3')](_0x393734,_0x260a39);};}function removeListener(_0x587751,_0x251be6){return function(){OpenchannelAccountEvents[_0x874d('0x4')](_0x587751,_0x251be6);};}exports[_0x874d('0x5')]=function(_0x25f739){for(var _0x30eaa0=0x0,_0x14baa9=events[_0x874d('0x6')];_0x30eaa0<_0x14baa9;_0x30eaa0++){var _0x359324=events[_0x30eaa0];var _0x4c4e9f=createListener('openchannelAccount:'+_0x359324,_0x25f739);OpenchannelAccountEvents['on'](_0x359324,_0x4c4e9f);}}; \ No newline at end of file +var _0xb5cd=['openchannelAccount:','./openchannelAccount.events','save','remove','emit','length'];(function(_0x5ae307,_0x32c66d){var _0x31c0fb=function(_0x181858){while(--_0x181858){_0x5ae307['push'](_0x5ae307['shift']());}};_0x31c0fb(++_0x32c66d);}(_0xb5cd,0x8b));var _0xdb5c=function(_0x20865f,_0x49849f){_0x20865f=_0x20865f-0x0;var _0x14129b=_0xb5cd[_0x20865f];return _0x14129b;};'use strict';var OpenchannelAccountEvents=require(_0xdb5c('0x0'));var events=[_0xdb5c('0x1'),_0xdb5c('0x2'),'update'];function createListener(_0x23257e,_0x281c2f){return function(_0x16f443){_0x281c2f[_0xdb5c('0x3')](_0x23257e,_0x16f443);};}function removeListener(_0x7dede4,_0x77e161){return function(){OpenchannelAccountEvents['removeListener'](_0x7dede4,_0x77e161);};}exports['register']=function(_0x232ab5){for(var _0x31a139=0x0,_0x149a53=events[_0xdb5c('0x4')];_0x31a139<_0x149a53;_0x31a139++){var _0x4311cf=events[_0x31a139];var _0x55363a=createListener(_0xdb5c('0x5')+_0x4311cf,_0x232ab5);OpenchannelAccountEvents['on'](_0x4311cf,_0x55363a);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index baa3b4c..81a6f42 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 _0xd045=['delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd045,0x159));var _0x5d04=function(_0x179b1c,_0x55f877){_0x179b1c=_0x179b1c-0x0;var _0x3eb1b1=_0xd045[_0x179b1c];return _0x3eb1b1;};'use strict';var multer=require(_0x5d04('0x0'));var util=require(_0x5d04('0x1'));var path=require(_0x5d04('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d04('0x3'));var router=express[_0x5d04('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5d04('0x5'));var config=require(_0x5d04('0x6'));var controller=require(_0x5d04('0x7'));router[_0x5d04('0x8')]('/',auth[_0x5d04('0x9')](),controller['index']);router[_0x5d04('0x8')](_0x5d04('0xa'),auth[_0x5d04('0x9')](),controller[_0x5d04('0xb')]);router[_0x5d04('0xc')]('/',auth[_0x5d04('0x9')](),controller[_0x5d04('0xd')]);router[_0x5d04('0xe')](_0x5d04('0xa'),auth[_0x5d04('0x9')](),controller[_0x5d04('0xf')]);router[_0x5d04('0x10')](_0x5d04('0xa'),auth[_0x5d04('0x9')](),controller[_0x5d04('0x11')]);module[_0x5d04('0x12')]=router; \ No newline at end of file +var _0xba15=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','/:id','isAuthenticated','post','create','update','destroy'];(function(_0x4b5d26,_0x1a39be){var _0x265b9b=function(_0x42225d){while(--_0x42225d){_0x4b5d26['push'](_0x4b5d26['shift']());}};_0x265b9b(++_0x1a39be);}(_0xba15,0xb0));var _0x5ba1=function(_0x1d0cd4,_0x514246){_0x1d0cd4=_0x1d0cd4-0x0;var _0x57aa32=_0xba15[_0x1d0cd4];return _0x57aa32;};'use strict';var multer=require(_0x5ba1('0x0'));var util=require(_0x5ba1('0x1'));var path=require('path');var timeout=require(_0x5ba1('0x2'));var express=require(_0x5ba1('0x3'));var router=express[_0x5ba1('0x4')]();var auth=require(_0x5ba1('0x5'));var interaction=require(_0x5ba1('0x6'));var config=require(_0x5ba1('0x7'));var controller=require(_0x5ba1('0x8'));router[_0x5ba1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5ba1('0x9')](_0x5ba1('0xa'),auth[_0x5ba1('0xb')](),controller['show']);router[_0x5ba1('0xc')]('/',auth[_0x5ba1('0xb')](),controller[_0x5ba1('0xd')]);router['put'](_0x5ba1('0xa'),auth[_0x5ba1('0xb')](),controller[_0x5ba1('0xe')]);router['delete'](_0x5ba1('0xa'),auth[_0x5ba1('0xb')](),controller[_0x5ba1('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 24caa58..cc39285 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 _0x59b7=['noop','*,*,*,*','exports','STRING'];(function(_0x1276c5,_0x45e491){var _0x460b90=function(_0x5bd339){while(--_0x5bd339){_0x1276c5['push'](_0x1276c5['shift']());}};_0x460b90(++_0x45e491);}(_0x59b7,0x11e));var _0x759b=function(_0x189e02,_0x187061){_0x189e02=_0x189e02-0x0;var _0x2db24f=_0x59b7[_0x189e02];return _0x2db24f;};'use strict';var Sequelize=require('sequelize');module[_0x759b('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x759b('0x1')],'allowNull':![],'defaultValue':_0x759b('0x2')},'appdata':{'type':Sequelize[_0x759b('0x1')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0x759b('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x759b('0x3')}}; \ No newline at end of file +var _0xa7c0=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x2e51f0,_0x339cb1){var _0xc970e=function(_0x34c096){while(--_0x34c096){_0x2e51f0['push'](_0x2e51f0['shift']());}};_0xc970e(++_0x339cb1);}(_0xa7c0,0x70));var _0x0a7c=function(_0x3b63af,_0x50797a){_0x3b63af=_0x3b63af-0x0;var _0x57ead8=_0xa7c0[_0x3b63af];return _0x57ead8;};'use strict';var Sequelize=require(_0x0a7c('0x0'));module[_0x0a7c('0x1')]={'priority':{'type':Sequelize[_0x0a7c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0a7c('0x3')],'allowNull':![],'defaultValue':_0x0a7c('0x4')},'appdata':{'type':Sequelize[_0x0a7c('0x3')](0x1000),'defaultValue':''},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0a7c('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index d5eef03..82a071e 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 _0x911d=['find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','OpenchannelApplication','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','show','params','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x911d,0x8c));var _0xd911=function(_0x4e5d67,_0x54dffc){_0x4e5d67=_0x4e5d67-0x0;var _0x4acdf3=_0x911d[_0x4e5d67];return _0x4acdf3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd911('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd911('0x1'));var jsonpatch=require(_0xd911('0x2'));var rp=require(_0xd911('0x3'));var moment=require(_0xd911('0x4'));var BPromise=require(_0xd911('0x5'));var Mustache=require(_0xd911('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd911('0x7'));var fs=require('fs');var _=require(_0xd911('0x8'));var squel=require(_0xd911('0x9'));var crypto=require(_0xd911('0xa'));var jsforce=require(_0xd911('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd911('0xc'));var querystring=require('querystring');var Papa=require(_0xd911('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0xd911('0xe'));var Redis=require(_0xd911('0xf'));var qs=require(_0xd911('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xd911('0x11'));var config=require(_0xd911('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x359970,_0x288688){_0x288688=_0x288688||0xcc;return function(_0x293a41){if(_0x293a41){return _0x359970[_0xd911('0x13')](_0x288688);}return _0x359970['status'](_0x288688)[_0xd911('0x14')]();};}function respondWithResult(_0x2cfada,_0x42db74){_0x42db74=_0x42db74||0xc8;return function(_0x2ed4a0){if(_0x2ed4a0){return _0x2cfada[_0xd911('0x15')](_0x42db74)[_0xd911('0x16')](_0x2ed4a0);}};}function respondWithFilteredResult(_0x919c37,_0x323164){return function(_0x18cad2){if(_0x18cad2){var _0x565e5e=_0x18cad2[_0xd911('0x17')],_0x4740c3=_0x323164[_0xd911('0x18')],_0x478b1b=_0x323164[_0xd911('0x18')]+_0x323164[_0xd911('0x19')],_0x4fd2d2;if(_0x478b1b>=_0x565e5e){_0x478b1b=_0x565e5e;_0x4fd2d2=0xc8;}else{_0x4fd2d2=0xce;}_0x919c37[_0xd911('0x15')](_0x4fd2d2);return _0x919c37[_0xd911('0x1a')](_0xd911('0x1b'),_0x4740c3+'-'+_0x478b1b+'/'+_0x565e5e)['json'](_0x18cad2);}return null;};}function patchUpdates(_0x22f7f5){return function(_0x3a7eb2){try{jsonpatch[_0xd911('0x1c')](_0x3a7eb2,_0x22f7f5,!![]);}catch(_0x480fb3){return BPromise[_0xd911('0x1d')](_0x480fb3);}return _0x3a7eb2['save']();};}function saveUpdates(_0x56c638,_0x1eea35){return function(_0x987c8b){if(_0x987c8b){return _0x987c8b[_0xd911('0x1e')](_0x56c638)[_0xd911('0x1f')](function(_0x22c5df){return _0x22c5df;});}return null;};}function removeEntity(_0x12eda4,_0x58d48e){return function(_0x49d3f8){if(_0x49d3f8){return _0x49d3f8[_0xd911('0x20')]()[_0xd911('0x1f')](function(){_0x12eda4[_0xd911('0x15')](0xcc)[_0xd911('0x14')]();});}};}function handleEntityNotFound(_0x3ba53a,_0xd29993){return function(_0x2a0334){if(!_0x2a0334){_0x3ba53a[_0xd911('0x13')](0x194);}return _0x2a0334;};}function handleError(_0x86f4c7,_0x5a2dcb){_0x5a2dcb=_0x5a2dcb||0x1f4;return function(_0x3c7da9){logger[_0xd911('0x21')](_0x3c7da9[_0xd911('0x22')]);if(_0x3c7da9[_0xd911('0x23')]){delete _0x3c7da9[_0xd911('0x23')];}_0x86f4c7[_0xd911('0x15')](_0x5a2dcb)[_0xd911('0x24')](_0x3c7da9);};}exports[_0xd911('0x25')]=function(_0x1677f1,_0x559142){var _0x52bfef={},_0x1ba04d={},_0x8c613a={'count':0x0,'rows':[]};var _0x43ce46=db[_0xd911('0x26')][_0xd911('0x27')];_0x1ba04d['model']=_[_0xd911('0x28')](_0x43ce46);_0x1ba04d[_0xd911('0x29')]=_[_0xd911('0x28')](_0x1677f1[_0xd911('0x29')]);_0x1ba04d[_0xd911('0x2a')]=_[_0xd911('0x2b')](_0x1ba04d[_0xd911('0x2c')],_0x1ba04d[_0xd911('0x29')]);_0x52bfef['attributes']=_['intersection'](_0x1ba04d[_0xd911('0x2c')],qs[_0xd911('0x2d')](_0x1677f1[_0xd911('0x29')]['fields']));_0x52bfef[_0xd911('0x2e')]=_0x52bfef[_0xd911('0x2e')][_0xd911('0x2f')]?_0x52bfef[_0xd911('0x2e')]:_0x1ba04d['model'];if(!_0x1677f1[_0xd911('0x29')][_0xd911('0x30')](_0xd911('0x31'))){_0x52bfef['limit']=qs['limit'](_0x1677f1[_0xd911('0x29')][_0xd911('0x19')]);_0x52bfef['offset']=qs[_0xd911('0x18')](_0x1677f1[_0xd911('0x29')]['offset']);}_0x52bfef[_0xd911('0x32')]=qs['sort'](_0x1677f1[_0xd911('0x29')]['sort']);_0x52bfef[_0xd911('0x33')]=qs['filters'](_['pick'](_0x1677f1[_0xd911('0x29')],_0x1ba04d[_0xd911('0x2a')]));if(_0x1677f1[_0xd911('0x29')][_0xd911('0x34')]){_0x52bfef[_0xd911('0x33')]=_[_0xd911('0x35')](_0x52bfef['where'],{'$or':_[_0xd911('0x36')](_0x43ce46,function(_0x58e9ef){if(_0x58e9ef[_0xd911('0x37')][_0xd911('0x38')]!==_0xd911('0x39')){var _0x2e5dcd={};_0x2e5dcd[_0x58e9ef[_0xd911('0x3a')]]={'$like':'%'+_0x1677f1[_0xd911('0x29')]['filter']+'%'};return _0x2e5dcd;}})});}_0x52bfef=_[_0xd911('0x35')]({},_0x52bfef,_0x1677f1[_0xd911('0x3b')]);var _0x46d005={'where':_0x52bfef[_0xd911('0x33')]};return db[_0xd911('0x26')]['count'](_0x46d005)['then'](function(_0x5b4455){_0x8c613a[_0xd911('0x17')]=_0x5b4455;if(_0x1677f1[_0xd911('0x29')][_0xd911('0x3c')]){_0x52bfef['include']=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x52bfef);})[_0xd911('0x1f')](function(_0x5cf27c){_0x8c613a['rows']=_0x5cf27c;return _0x8c613a;})['then'](respondWithFilteredResult(_0x559142,_0x52bfef))['catch'](handleError(_0x559142,null));};exports[_0xd911('0x3d')]=function(_0x54058f,_0x155c9b){var _0x5d60c1={'raw':!![],'where':{'id':_0x54058f[_0xd911('0x3e')]['id']}},_0x35f0b8={};_0x35f0b8[_0xd911('0x2c')]=_[_0xd911('0x28')](db[_0xd911('0x26')][_0xd911('0x27')]);_0x35f0b8[_0xd911('0x29')]=_[_0xd911('0x28')](_0x54058f[_0xd911('0x29')]);_0x35f0b8[_0xd911('0x2a')]=_['intersection'](_0x35f0b8[_0xd911('0x2c')],_0x35f0b8[_0xd911('0x29')]);_0x5d60c1[_0xd911('0x2e')]=_[_0xd911('0x2b')](_0x35f0b8['model'],qs[_0xd911('0x2d')](_0x54058f[_0xd911('0x29')][_0xd911('0x2d')]));_0x5d60c1['attributes']=_0x5d60c1[_0xd911('0x2e')][_0xd911('0x2f')]?_0x5d60c1[_0xd911('0x2e')]:_0x35f0b8[_0xd911('0x2c')];if(_0x54058f[_0xd911('0x29')][_0xd911('0x3c')]){_0x5d60c1[_0xd911('0x3f')]=[{'all':!![]}];}_0x5d60c1=_['merge']({},_0x5d60c1,_0x54058f[_0xd911('0x3b')]);return db[_0xd911('0x26')][_0xd911('0x40')](_0x5d60c1)['then'](handleEntityNotFound(_0x155c9b,null))[_0xd911('0x1f')](respondWithResult(_0x155c9b,null))[_0xd911('0x41')](handleError(_0x155c9b,null));};exports[_0xd911('0x42')]=function(_0xd11d9e,_0xacca0e){return db['OpenchannelApplication'][_0xd911('0x42')](_0xd11d9e[_0xd911('0x43')],{})[_0xd911('0x1f')](respondWithResult(_0xacca0e,0xc9))[_0xd911('0x41')](handleError(_0xacca0e,null));};exports[_0xd911('0x1e')]=function(_0x1680c4,_0x2d96c3){if(_0x1680c4[_0xd911('0x43')]['id']){delete _0x1680c4[_0xd911('0x43')]['id'];}return db[_0xd911('0x26')]['find']({'where':{'id':_0x1680c4[_0xd911('0x3e')]['id']}})[_0xd911('0x1f')](handleEntityNotFound(_0x2d96c3,null))[_0xd911('0x1f')](saveUpdates(_0x1680c4[_0xd911('0x43')],null))[_0xd911('0x1f')](respondWithResult(_0x2d96c3,null))[_0xd911('0x41')](handleError(_0x2d96c3,null));};exports['destroy']=function(_0x2859eb,_0x1a1bdf){return db['OpenchannelApplication'][_0xd911('0x40')]({'where':{'id':_0x2859eb['params']['id']}})[_0xd911('0x1f')](handleEntityNotFound(_0x1a1bdf,null))[_0xd911('0x1f')](removeEntity(_0x1a1bdf,null))[_0xd911('0x41')](handleError(_0x1a1bdf,null));}; \ No newline at end of file +var _0x1206=['sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','destroy','end','error','stack','name','send','index','OpenchannelApplication','rawAttributes','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','then','includeAll','catch','show','params','fields','length','include','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment'];(function(_0x16e892,_0x132763){var _0x229775=function(_0x406f42){while(--_0x406f42){_0x16e892['push'](_0x16e892['shift']());}};_0x229775(++_0x132763);}(_0x1206,0x1d3));var _0x6120=function(_0x27f004,_0x1a1e9d){_0x27f004=_0x27f004-0x0;var _0x411a9d=_0x1206[_0x27f004];return _0x411a9d;};'use strict';var pdf=require(_0x6120('0x0'));var emlformat=require(_0x6120('0x1'));var rimraf=require(_0x6120('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6120('0x3'));var rp=require(_0x6120('0x4'));var moment=require(_0x6120('0x5'));var BPromise=require(_0x6120('0x6'));var Mustache=require(_0x6120('0x7'));var util=require(_0x6120('0x8'));var path=require(_0x6120('0x9'));var sox=require('sox');var csv=require(_0x6120('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6120('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6120('0xc'));var deskjs=require(_0x6120('0xd'));var toCsv=require(_0x6120('0xa'));var querystring=require(_0x6120('0xe'));var Papa=require(_0x6120('0xf'));var authService=require(_0x6120('0x10'));var hardwareService=require(_0x6120('0x11'));var Redis=require(_0x6120('0x12'));var qs=require(_0x6120('0x13'));var logger=require(_0x6120('0x14'))('api');var utils=require(_0x6120('0x15'));var config=require(_0x6120('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7437e7,_0x191e7d){_0x191e7d=_0x191e7d||0xcc;return function(_0x441111){if(_0x441111){return _0x7437e7[_0x6120('0x17')](_0x191e7d);}return _0x7437e7[_0x6120('0x18')](_0x191e7d)['end']();};}function respondWithResult(_0xb797b9,_0x1d9f62){_0x1d9f62=_0x1d9f62||0xc8;return function(_0x15b088){if(_0x15b088){return _0xb797b9[_0x6120('0x18')](_0x1d9f62)[_0x6120('0x19')](_0x15b088);}};}function respondWithFilteredResult(_0x11907a,_0x1a8bd3){return function(_0x10d0f9){if(_0x10d0f9){var _0x1ddb7d=_0x10d0f9[_0x6120('0x1a')],_0x1fb96d=_0x1a8bd3['offset'],_0x329cb1=_0x1a8bd3[_0x6120('0x1b')]+_0x1a8bd3[_0x6120('0x1c')],_0x5c06a5;if(_0x329cb1>=_0x1ddb7d){_0x329cb1=_0x1ddb7d;_0x5c06a5=0xc8;}else{_0x5c06a5=0xce;}_0x11907a[_0x6120('0x18')](_0x5c06a5);return _0x11907a['set'](_0x6120('0x1d'),_0x1fb96d+'-'+_0x329cb1+'/'+_0x1ddb7d)[_0x6120('0x19')](_0x10d0f9);}return null;};}function patchUpdates(_0x433154){return function(_0x553fdc){try{jsonpatch[_0x6120('0x1e')](_0x553fdc,_0x433154,!![]);}catch(_0x3e7366){return BPromise[_0x6120('0x1f')](_0x3e7366);}return _0x553fdc['save']();};}function saveUpdates(_0x560a2a,_0x290747){return function(_0x318b4a){if(_0x318b4a){return _0x318b4a[_0x6120('0x20')](_0x560a2a)['then'](function(_0x26407a){return _0x26407a;});}return null;};}function removeEntity(_0x58a544,_0x543cb5){return function(_0x1d2cf3){if(_0x1d2cf3){return _0x1d2cf3[_0x6120('0x21')]()['then'](function(){_0x58a544[_0x6120('0x18')](0xcc)[_0x6120('0x22')]();});}};}function handleEntityNotFound(_0x3f9309,_0x42cc3d){return function(_0x1b3bc5){if(!_0x1b3bc5){_0x3f9309[_0x6120('0x17')](0x194);}return _0x1b3bc5;};}function handleError(_0x5a471f,_0x576e8d){_0x576e8d=_0x576e8d||0x1f4;return function(_0x1f1fae){logger[_0x6120('0x23')](_0x1f1fae[_0x6120('0x24')]);if(_0x1f1fae[_0x6120('0x25')]){delete _0x1f1fae[_0x6120('0x25')];}_0x5a471f[_0x6120('0x18')](_0x576e8d)[_0x6120('0x26')](_0x1f1fae);};}exports[_0x6120('0x27')]=function(_0x119293,_0x2939fd){var _0x558b74={},_0x3237d1={},_0xec5007={'count':0x0,'rows':[]};var _0x1252b8=db[_0x6120('0x28')][_0x6120('0x29')];_0x3237d1[_0x6120('0x2a')]=_[_0x6120('0x2b')](_0x1252b8);_0x3237d1[_0x6120('0x2c')]=_[_0x6120('0x2b')](_0x119293['query']);_0x3237d1[_0x6120('0x2d')]=_[_0x6120('0x2e')](_0x3237d1[_0x6120('0x2a')],_0x3237d1[_0x6120('0x2c')]);_0x558b74[_0x6120('0x2f')]=_[_0x6120('0x2e')](_0x3237d1[_0x6120('0x2a')],qs['fields'](_0x119293['query']['fields']));_0x558b74[_0x6120('0x2f')]=_0x558b74['attributes']['length']?_0x558b74['attributes']:_0x3237d1[_0x6120('0x2a')];if(!_0x119293[_0x6120('0x2c')][_0x6120('0x30')](_0x6120('0x31'))){_0x558b74[_0x6120('0x1c')]=qs[_0x6120('0x1c')](_0x119293['query'][_0x6120('0x1c')]);_0x558b74[_0x6120('0x1b')]=qs['offset'](_0x119293[_0x6120('0x2c')][_0x6120('0x1b')]);}_0x558b74['order']=qs['sort'](_0x119293['query'][_0x6120('0x32')]);_0x558b74[_0x6120('0x33')]=qs[_0x6120('0x2d')](_[_0x6120('0x34')](_0x119293[_0x6120('0x2c')],_0x3237d1[_0x6120('0x2d')]));if(_0x119293[_0x6120('0x2c')][_0x6120('0x35')]){_0x558b74[_0x6120('0x33')]=_[_0x6120('0x36')](_0x558b74[_0x6120('0x33')],{'$or':_['map'](_0x1252b8,function(_0x3e6463){if(_0x3e6463[_0x6120('0x37')][_0x6120('0x38')]!==_0x6120('0x39')){var _0x31b608={};_0x31b608[_0x3e6463[_0x6120('0x3a')]]={'$like':'%'+_0x119293[_0x6120('0x2c')][_0x6120('0x35')]+'%'};return _0x31b608;}})});}_0x558b74=_[_0x6120('0x36')]({},_0x558b74,_0x119293['options']);var _0x332939={'where':_0x558b74[_0x6120('0x33')]};return db[_0x6120('0x28')]['count'](_0x332939)[_0x6120('0x3b')](function(_0x57445b){_0xec5007[_0x6120('0x1a')]=_0x57445b;if(_0x119293[_0x6120('0x2c')][_0x6120('0x3c')]){_0x558b74['include']=[{'all':!![]}];}return db[_0x6120('0x28')]['findAll'](_0x558b74);})[_0x6120('0x3b')](function(_0x446bd5){_0xec5007['rows']=_0x446bd5;return _0xec5007;})['then'](respondWithFilteredResult(_0x2939fd,_0x558b74))[_0x6120('0x3d')](handleError(_0x2939fd,null));};exports[_0x6120('0x3e')]=function(_0x57a3f5,_0x5194f4){var _0x35dd6e={'raw':!![],'where':{'id':_0x57a3f5[_0x6120('0x3f')]['id']}},_0x504692={};_0x504692['model']=_[_0x6120('0x2b')](db[_0x6120('0x28')][_0x6120('0x29')]);_0x504692[_0x6120('0x2c')]=_[_0x6120('0x2b')](_0x57a3f5['query']);_0x504692[_0x6120('0x2d')]=_['intersection'](_0x504692[_0x6120('0x2a')],_0x504692[_0x6120('0x2c')]);_0x35dd6e['attributes']=_[_0x6120('0x2e')](_0x504692[_0x6120('0x2a')],qs[_0x6120('0x40')](_0x57a3f5[_0x6120('0x2c')][_0x6120('0x40')]));_0x35dd6e[_0x6120('0x2f')]=_0x35dd6e[_0x6120('0x2f')][_0x6120('0x41')]?_0x35dd6e['attributes']:_0x504692[_0x6120('0x2a')];if(_0x57a3f5[_0x6120('0x2c')]['includeAll']){_0x35dd6e[_0x6120('0x42')]=[{'all':!![]}];}_0x35dd6e=_[_0x6120('0x36')]({},_0x35dd6e,_0x57a3f5['options']);return db['OpenchannelApplication'][_0x6120('0x43')](_0x35dd6e)['then'](handleEntityNotFound(_0x5194f4,null))[_0x6120('0x3b')](respondWithResult(_0x5194f4,null))[_0x6120('0x3d')](handleError(_0x5194f4,null));};exports[_0x6120('0x44')]=function(_0xfc528d,_0x3927a3){return db[_0x6120('0x28')]['create'](_0xfc528d[_0x6120('0x45')],{})['then'](respondWithResult(_0x3927a3,0xc9))[_0x6120('0x3d')](handleError(_0x3927a3,null));};exports[_0x6120('0x20')]=function(_0x501731,_0x51d215){if(_0x501731[_0x6120('0x45')]['id']){delete _0x501731[_0x6120('0x45')]['id'];}return db[_0x6120('0x28')]['find']({'where':{'id':_0x501731[_0x6120('0x3f')]['id']}})['then'](handleEntityNotFound(_0x51d215,null))['then'](saveUpdates(_0x501731['body'],null))['then'](respondWithResult(_0x51d215,null))['catch'](handleError(_0x51d215,null));};exports[_0x6120('0x21')]=function(_0x5d940b,_0x237a1b){return db[_0x6120('0x28')][_0x6120('0x43')]({'where':{'id':_0x5d940b[_0x6120('0x3f')]['id']}})[_0x6120('0x3b')](handleEntityNotFound(_0x237a1b,null))[_0x6120('0x3b')](removeEntity(_0x237a1b,null))['catch'](handleError(_0x237a1b,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 029c526..9dfc448 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 _0xb20d=['bluebird','request-promise','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger','moment'];(function(_0x3e2936,_0x1d57a9){var _0x35d87a=function(_0x19dd6a){while(--_0x19dd6a){_0x3e2936['push'](_0x3e2936['shift']());}};_0x35d87a(++_0x1d57a9);}(_0xb20d,0x104));var _0xdb20=function(_0x29fbf3,_0x130494){_0x29fbf3=_0x29fbf3-0x0;var _0x49829a=_0xb20d[_0x29fbf3];return _0x49829a;};'use strict';var _=require(_0xdb20('0x0'));var util=require(_0xdb20('0x1'));var logger=require(_0xdb20('0x2'))('api');var moment=require(_0xdb20('0x3'));var BPromise=require(_0xdb20('0x4'));var rp=require(_0xdb20('0x5'));var attributes=require(_0xdb20('0x6'));module[_0xdb20('0x7')]=function(_0x378525,_0x4e5a82){return _0x378525[_0xdb20('0x8')](_0xdb20('0x9'),attributes,{'tableName':_0xdb20('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8bb6=['../../config/logger','api','moment','request-promise','exports','OpenchannelApplication','util'];(function(_0x4701fd,_0x4d85aa){var _0x44b225=function(_0x2fe28a){while(--_0x2fe28a){_0x4701fd['push'](_0x4701fd['shift']());}};_0x44b225(++_0x4d85aa);}(_0x8bb6,0xe6));var _0x68bb=function(_0x3809e3,_0x132e51){_0x3809e3=_0x3809e3-0x0;var _0x334579=_0x8bb6[_0x3809e3];return _0x334579;};'use strict';var _=require('lodash');var util=require(_0x68bb('0x0'));var logger=require(_0x68bb('0x1'))(_0x68bb('0x2'));var moment=require(_0x68bb('0x3'));var BPromise=require('bluebird');var rp=require(_0x68bb('0x4'));var attributes=require('./openchannelApplication.attributes');module[_0x68bb('0x5')]=function(_0x16d312,_0x264796){return _0x16d312['define'](_0x68bb('0x6'),attributes,{'tableName':'openchannel_applications','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 94f1658..5cbdf7f 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 _0x31b5=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','OpenchannelApplication,\x20%s,\x20%s','message','info','result','catch','update','body','options','raw','where','UpdateOpenchannelApplication','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent'];(function(_0x2ac71a,_0x1d2a02){var _0x3ee904=function(_0x5c902a){while(--_0x5c902a){_0x2ac71a['push'](_0x2ac71a['shift']());}};_0x3ee904(++_0x1d2a02);}(_0x31b5,0x159));var _0x531b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x31b5[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x531b('0x0'));var util=require(_0x531b('0x1'));var moment=require(_0x531b('0x2'));var BPromise=require(_0x531b('0x3'));var rs=require(_0x531b('0x4'));var fs=require('fs');var Redis=require(_0x531b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x531b('0x6'));var logger=require(_0x531b('0x7'))(_0x531b('0x8'));var config=require(_0x531b('0x9'));var jayson=require(_0x531b('0xa'));var client=jayson['client'][_0x531b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52216c,_0x252caf,_0x513a12){return new BPromise(function(_0x3c4230,_0x353a64){return client[_0x531b('0xc')](_0x52216c,_0x513a12)[_0x531b('0xd')](function(_0x442a35){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x252caf,_0x531b('0xe'));logger['debug'](_0x531b('0xf'),_0x252caf,'request\x20sent',JSON['stringify'](_0x442a35));if(_0x442a35[_0x531b('0x10')]){if(_0x442a35[_0x531b('0x10')][_0x531b('0x11')]===0x1f4){logger[_0x531b('0x10')](_0x531b('0x12'),_0x252caf,_0x442a35[_0x531b('0x10')][_0x531b('0x13')]);return _0x353a64(_0x442a35['error'][_0x531b('0x13')]);}logger['error'](_0x531b('0x12'),_0x252caf,_0x442a35[_0x531b('0x10')]['message']);return _0x3c4230(_0x442a35[_0x531b('0x10')][_0x531b('0x13')]);}else{logger[_0x531b('0x14')]('OpenchannelApplication,\x20%s,\x20%s',_0x252caf,'request\x20sent');_0x3c4230(_0x442a35[_0x531b('0x15')][_0x531b('0x13')]);}})[_0x531b('0x16')](function(_0x244a0e){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x252caf,_0x244a0e);_0x353a64(_0x244a0e);});});}exports['UpdateOpenchannelApplication']=function(_0x3e9e0f){var _0x1c1165=this;return new Promise(function(_0x3e4aac,_0xd5cad3){return db['OpenchannelApplication'][_0x531b('0x17')](_0x3e9e0f[_0x531b('0x18')],{'raw':_0x3e9e0f[_0x531b('0x19')]?_0x3e9e0f['options'][_0x531b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e9e0f[_0x531b('0x19')]?_0x3e9e0f[_0x531b('0x19')][_0x531b('0x1b')]||null:null,'attributes':_0x3e9e0f[_0x531b('0x19')]?_0x3e9e0f['options']['attributes']||null:null,'limit':_0x3e9e0f[_0x531b('0x19')]?_0x3e9e0f[_0x531b('0x19')]['limit']||null:null})[_0x531b('0xd')](function(_0x2d9a6d){logger[_0x531b('0x14')](_0x531b('0x1c'),_0x3e9e0f);logger['debug'](_0x531b('0x1c'),_0x3e9e0f,JSON[_0x531b('0x1d')](_0x2d9a6d));_0x3e4aac(_0x2d9a6d);})[_0x531b('0x16')](function(_0x197487){logger['error'](_0x531b('0x1c'),_0x197487[_0x531b('0x13')],_0x3e9e0f);_0xd5cad3(_0x1c1165[_0x531b('0x10')](0x1f4,_0x197487[_0x531b('0x13')]));});});}; \ No newline at end of file +var _0x3caf=['stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','where','limit','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s'];(function(_0x4d4f61,_0x56d7a7){var _0x297414=function(_0x30d055){while(--_0x30d055){_0x4d4f61['push'](_0x4d4f61['shift']());}};_0x297414(++_0x56d7a7);}(_0x3caf,0x108));var _0xf3ca=function(_0xc9671e,_0x5ae235){_0xc9671e=_0xc9671e-0x0;var _0x54957a=_0x3caf[_0xc9671e];return _0x54957a;};'use strict';var _=require('lodash');var util=require(_0xf3ca('0x0'));var moment=require('moment');var BPromise=require(_0xf3ca('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3ca('0x2'))['db'];var utils=require(_0xf3ca('0x3'));var logger=require(_0xf3ca('0x4'))(_0xf3ca('0x5'));var config=require(_0xf3ca('0x6'));var jayson=require(_0xf3ca('0x7'));var client=jayson[_0xf3ca('0x8')][_0xf3ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x339c4c,_0x53411c,_0x5e741f){return new BPromise(function(_0x2bad8f,_0x497fec){return client[_0xf3ca('0xa')](_0x339c4c,_0x5e741f)[_0xf3ca('0xb')](function(_0x4661a0){logger[_0xf3ca('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x53411c,_0xf3ca('0xd'));logger[_0xf3ca('0xe')](_0xf3ca('0xf'),_0x53411c,_0xf3ca('0xd'),JSON[_0xf3ca('0x10')](_0x4661a0));if(_0x4661a0[_0xf3ca('0x11')]){if(_0x4661a0[_0xf3ca('0x11')][_0xf3ca('0x12')]===0x1f4){logger['error'](_0xf3ca('0x13'),_0x53411c,_0x4661a0[_0xf3ca('0x11')][_0xf3ca('0x14')]);return _0x497fec(_0x4661a0[_0xf3ca('0x11')][_0xf3ca('0x14')]);}logger[_0xf3ca('0x11')](_0xf3ca('0x13'),_0x53411c,_0x4661a0[_0xf3ca('0x11')][_0xf3ca('0x14')]);return _0x2bad8f(_0x4661a0[_0xf3ca('0x11')][_0xf3ca('0x14')]);}else{logger[_0xf3ca('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x53411c,_0xf3ca('0xd'));_0x2bad8f(_0x4661a0['result'][_0xf3ca('0x14')]);}})[_0xf3ca('0x15')](function(_0x5acef1){logger[_0xf3ca('0x11')](_0xf3ca('0x13'),_0x53411c,_0x5acef1);_0x497fec(_0x5acef1);});});}exports[_0xf3ca('0x16')]=function(_0x23130e){var _0x2bfffd=this;return new Promise(function(_0x4e2a44,_0x4b042f){return db[_0xf3ca('0x17')][_0xf3ca('0x18')](_0x23130e['body'],{'raw':_0x23130e[_0xf3ca('0x19')]?_0x23130e[_0xf3ca('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23130e['options']?_0x23130e['options'][_0xf3ca('0x1a')]||null:null,'attributes':_0x23130e[_0xf3ca('0x19')]?_0x23130e[_0xf3ca('0x19')]['attributes']||null:null,'limit':_0x23130e[_0xf3ca('0x19')]?_0x23130e[_0xf3ca('0x19')][_0xf3ca('0x1b')]||null:null})[_0xf3ca('0xb')](function(_0x1eb801){logger['info']('UpdateOpenchannelApplication',_0x23130e);logger[_0xf3ca('0xe')](_0xf3ca('0x16'),_0x23130e,JSON[_0xf3ca('0x10')](_0x1eb801));_0x4e2a44(_0x1eb801);})[_0xf3ca('0x15')](function(_0x1dc0b9){logger[_0xf3ca('0x11')](_0xf3ca('0x16'),_0x1dc0b9[_0xf3ca('0x14')],_0x23130e);_0x4b042f(_0x2bfffd[_0xf3ca('0x11')](0x1f4,_0x1dc0b9[_0xf3ca('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 727f991..473fb5d 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 _0x305b=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','delete','exports'];(function(_0x3fad49,_0x4e166b){var _0x3869d4=function(_0x172802){while(--_0x172802){_0x3fad49['push'](_0x3fad49['shift']());}};_0x3869d4(++_0x4e166b);}(_0x305b,0x12c));var _0xb305=function(_0x16ea87,_0x378d8b){_0x16ea87=_0x16ea87-0x0;var _0x6e7b1c=_0x305b[_0x16ea87];return _0x6e7b1c;};'use strict';var multer=require(_0xb305('0x0'));var util=require(_0xb305('0x1'));var path=require(_0xb305('0x2'));var timeout=require(_0xb305('0x3'));var express=require(_0xb305('0x4'));var router=express['Router']();var auth=require(_0xb305('0x5'));var interaction=require(_0xb305('0x6'));var config=require(_0xb305('0x7'));var controller=require(_0xb305('0x8'));router[_0xb305('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xb305('0xa')](),controller[_0xb305('0xb')]);router[_0xb305('0x9')](_0xb305('0xc'),auth['isAuthenticated'](),controller[_0xb305('0xd')]);router[_0xb305('0x9')](_0xb305('0xe'),auth[_0xb305('0xa')](),controller[_0xb305('0xf')]);router['get'](_0xb305('0x10'),auth['isAuthenticated'](),controller['download']);router[_0xb305('0x11')]('/',auth[_0xb305('0xa')](),controller['create']);router[_0xb305('0x11')](_0xb305('0xe'),auth['isAuthenticated'](),controller[_0xb305('0x12')]);router[_0xb305('0x11')](_0xb305('0x13'),auth['isAuthenticated'](),interaction[_0xb305('0x14')](_0xb305('0x15'),_0xb305('0x16')),controller[_0xb305('0x17')]);router[_0xb305('0x18')](_0xb305('0xc'),auth[_0xb305('0xa')](),interaction[_0xb305('0x14')](_0xb305('0x15'),_0xb305('0x19')),controller[_0xb305('0x1a')]);router['delete'](_0xb305('0xc'),auth['isAuthenticated'](),interaction[_0xb305('0x14')](_0xb305('0x15'),_0xb305('0x1b')),controller['destroy']);router[_0xb305('0x1c')](_0xb305('0x13'),auth[_0xb305('0xa')](),controller['removeTags']);module[_0xb305('0x1d')]=router; \ No newline at end of file +var _0xd0d9=['openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','/:id/tags','tracked','openchannel','addTags','put'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0xd0d9,0x1e7));var _0x9d0d=function(_0x83e839,_0x1a85fe){_0x83e839=_0x83e839-0x0;var _0x16e346=_0xd0d9[_0x83e839];return _0x16e346;};'use strict';var multer=require(_0x9d0d('0x0'));var util=require(_0x9d0d('0x1'));var path=require(_0x9d0d('0x2'));var timeout=require(_0x9d0d('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x9d0d('0x4'));var interaction=require(_0x9d0d('0x5'));var config=require(_0x9d0d('0x6'));var controller=require(_0x9d0d('0x7'));router['get']('/',auth[_0x9d0d('0x8')](),controller[_0x9d0d('0x9')]);router[_0x9d0d('0xa')]('/describe',auth[_0x9d0d('0x8')](),controller[_0x9d0d('0xb')]);router['get'](_0x9d0d('0xc'),auth['isAuthenticated'](),controller[_0x9d0d('0xd')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x9d0d('0xe')]);router[_0x9d0d('0xa')](_0x9d0d('0xf'),auth[_0x9d0d('0x8')](),controller[_0x9d0d('0x10')]);router[_0x9d0d('0x11')]('/',auth[_0x9d0d('0x8')](),controller[_0x9d0d('0x12')]);router['post'](_0x9d0d('0x13'),auth[_0x9d0d('0x8')](),controller['addMessage']);router[_0x9d0d('0x11')](_0x9d0d('0x14'),auth[_0x9d0d('0x8')](),interaction[_0x9d0d('0x15')](_0x9d0d('0x16'),'openchannelinteraction:addtags'),controller[_0x9d0d('0x17')]);router[_0x9d0d('0x18')](_0x9d0d('0xc'),auth[_0x9d0d('0x8')](),interaction[_0x9d0d('0x15')](_0x9d0d('0x16'),_0x9d0d('0x19')),controller[_0x9d0d('0x1a')]);router[_0x9d0d('0x1b')](_0x9d0d('0xc'),auth[_0x9d0d('0x8')](),interaction['tracked'](_0x9d0d('0x16'),_0x9d0d('0x1c')),controller[_0x9d0d('0x1d')]);router[_0x9d0d('0x1b')](_0x9d0d('0x14'),auth[_0x9d0d('0x8')](),controller[_0x9d0d('0x1e')]);module[_0x9d0d('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 2282970..5849ca2 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 _0x6b27=['DATE','STRING','sequelize','exports'];(function(_0x2b500f,_0x1f9b20){var _0x5c8342=function(_0x3d45e8){while(--_0x3d45e8){_0x2b500f['push'](_0x2b500f['shift']());}};_0x5c8342(++_0x1f9b20);}(_0x6b27,0x176));var _0x76b2=function(_0x1a813e,_0x341d1c){_0x1a813e=_0x1a813e-0x0;var _0x3fae84=_0x6b27[_0x1a813e];return _0x3fae84;};'use strict';var Sequelize=require(_0x76b2('0x0'));module[_0x76b2('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x76b2('0x2')]},'disposition':{'type':Sequelize[_0x76b2('0x3')]},'note':{'type':Sequelize[_0x76b2('0x3')]},'read1stAt':{'type':Sequelize[_0x76b2('0x2')]},'threadId':{'type':Sequelize[_0x76b2('0x3')]},'externalUrl':{'type':Sequelize[_0x76b2('0x3')]},'lastMsgAt':{'type':Sequelize[_0x76b2('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x76b2('0x3')]}}; \ No newline at end of file +var _0x1052=['BOOLEAN','DATE','STRING','out','sequelize','exports'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x1052,0xf4));var _0x2105=function(_0x64bfc4,_0x46d7fe){_0x64bfc4=_0x64bfc4-0x0;var _0x4f6d04=_0x1052[_0x64bfc4];return _0x4f6d04;};'use strict';var Sequelize=require(_0x2105('0x0'));module[_0x2105('0x1')]={'closed':{'type':Sequelize[_0x2105('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2105('0x3')]},'disposition':{'type':Sequelize[_0x2105('0x4')]},'note':{'type':Sequelize[_0x2105('0x4')]},'read1stAt':{'type':Sequelize[_0x2105('0x3')]},'threadId':{'type':Sequelize[_0x2105('0x4')]},'externalUrl':{'type':Sequelize[_0x2105('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2105('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 814f4db..7b5ec06 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 _0x0a34=['files','tmp','interaction-%s.zip','Attachment','1cm','mkdirSync','

Openchannel\x20Interaction:\x20#%d

','
','','%s:\x20%s

','firstName','','basename','createReadStream','pipe','createWriteStream','toFile','.pdf','log','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','json','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','OpenchannelInteraction','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','tag','include','push','Tag','Tags','distinct','read','OpenchannelMessage','Messages','direction','createdAt','count','User','fullname','CmContact','Contact','Owner','OpenchannelAccount','Account','color','ThroughTags','findAll','rows','catch','find','create','body','update','params','describe','addMessage','ids','omit','getMessages','OpenchannelInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','spread','emit','removeTags','download','unix','toString','join','root','server'];(function(_0x5ad6f3,_0x45013d){var _0x27b1c4=function(_0x5bede9){while(--_0x5bede9){_0x5ad6f3['push'](_0x5ad6f3['shift']());}};_0x27b1c4(++_0x45013d);}(_0x0a34,0x12a));var _0x40a3=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x0a34[_0x1969a7];return _0x3d665f;};'use strict';var pdf=require(_0x40a3('0x0'));var emlformat=require(_0x40a3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x40a3('0x2'));var jsonpatch=require(_0x40a3('0x3'));var rp=require(_0x40a3('0x4'));var moment=require('moment');var BPromise=require(_0x40a3('0x5'));var Mustache=require(_0x40a3('0x6'));var util=require(_0x40a3('0x7'));var path=require('path');var sox=require(_0x40a3('0x8'));var csv=require(_0x40a3('0x9'));var ejs=require(_0x40a3('0xa'));var fs=require('fs');var _=require(_0x40a3('0xb'));var squel=require(_0x40a3('0xc'));var crypto=require(_0x40a3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x40a3('0xe'));var toCsv=require(_0x40a3('0x9'));var querystring=require(_0x40a3('0xf'));var Papa=require(_0x40a3('0x10'));var authService=require(_0x40a3('0x11'));var hardwareService=require(_0x40a3('0x12'));var Redis=require('ioredis');var qs=require(_0x40a3('0x13'));var logger=require(_0x40a3('0x14'))(_0x40a3('0x15'));var utils=require('../../config/utils');var config=require(_0x40a3('0x16'));var db=require(_0x40a3('0x17'))['db'];config['redis']=_[_0x40a3('0x18')](config[_0x40a3('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x40a3('0x1a'))(new Redis(config[_0x40a3('0x19')]));require('./openchannelInteraction.socket')[_0x40a3('0x1b')](socket);function respondWithStatusCode(_0x3ced7b,_0x13ac55){_0x13ac55=_0x13ac55||0xcc;return function(_0x476c82){if(_0x476c82){return _0x3ced7b['sendStatus'](_0x13ac55);}return _0x3ced7b['status'](_0x13ac55)['end']();};}function respondWithResult(_0x28bb05,_0x19e09e){_0x19e09e=_0x19e09e||0xc8;return function(_0x20d6cf){if(_0x20d6cf){return _0x28bb05['status'](_0x19e09e)[_0x40a3('0x1c')](_0x20d6cf);}};}function respondWithFilteredResult(_0x8c3d45,_0x47b6dd){return function(_0x4d6499){if(_0x4d6499){var _0x20df02=_0x4d6499['count'],_0x31aef5=_0x47b6dd[_0x40a3('0x1d')],_0x22f31e=_0x47b6dd[_0x40a3('0x1d')]+_0x47b6dd[_0x40a3('0x1e')],_0x1c5102;if(_0x22f31e>=_0x20df02){_0x22f31e=_0x20df02;_0x1c5102=0xc8;}else{_0x1c5102=0xce;}_0x8c3d45[_0x40a3('0x1f')](_0x1c5102);return _0x8c3d45[_0x40a3('0x20')](_0x40a3('0x21'),_0x31aef5+'-'+_0x22f31e+'/'+_0x20df02)[_0x40a3('0x1c')](_0x4d6499);}return null;};}function patchUpdates(_0xb723d3){return function(_0x975ca){try{jsonpatch[_0x40a3('0x22')](_0x975ca,_0xb723d3,!![]);}catch(_0x2d18d6){return BPromise[_0x40a3('0x23')](_0x2d18d6);}return _0x975ca[_0x40a3('0x24')]();};}function saveUpdates(_0x1416d2,_0x1dbc00){return function(_0x1daace){if(_0x1daace){return _0x1daace['update'](_0x1416d2)[_0x40a3('0x25')](function(_0x46fbbe){return _0x46fbbe;});}return null;};}function removeEntity(_0x1d0cf0,_0x1e11fb){return function(_0x1d034a){if(_0x1d034a){return _0x1d034a[_0x40a3('0x26')]()['then'](function(){_0x1d0cf0[_0x40a3('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37321a,_0x348685){return function(_0x5a9b6f){if(!_0x5a9b6f){_0x37321a[_0x40a3('0x27')](0x194);}return _0x5a9b6f;};}function handleError(_0x3eb097,_0x1b6c7c){_0x1b6c7c=_0x1b6c7c||0x1f4;return function(_0x599474){logger[_0x40a3('0x28')](_0x599474[_0x40a3('0x29')]);if(_0x599474[_0x40a3('0x2a')]){delete _0x599474[_0x40a3('0x2a')];}_0x3eb097[_0x40a3('0x1f')](_0x1b6c7c)[_0x40a3('0x2b')](_0x599474);};}exports[_0x40a3('0x2c')]=function(_0x3d50d7,_0x5d288e){var _0x4b7b86={},_0x355a8f={},_0x4a7fd8={'count':0x0,'rows':[]};var _0x58beaf=db[_0x40a3('0x2d')][_0x40a3('0x2e')];_0x355a8f[_0x40a3('0x2f')]=_['keys'](_0x58beaf);_0x355a8f[_0x40a3('0x30')]=_[_0x40a3('0x31')](_0x3d50d7[_0x40a3('0x30')]);_0x355a8f[_0x40a3('0x32')]=_['intersection'](_0x355a8f[_0x40a3('0x2f')],_0x355a8f[_0x40a3('0x30')]);_0x4b7b86[_0x40a3('0x33')]=_[_0x40a3('0x34')](_0x355a8f[_0x40a3('0x2f')],qs[_0x40a3('0x35')](_0x3d50d7[_0x40a3('0x30')][_0x40a3('0x35')]));_0x4b7b86[_0x40a3('0x33')]=_0x4b7b86[_0x40a3('0x33')][_0x40a3('0x36')]?_0x4b7b86[_0x40a3('0x33')]:_0x355a8f[_0x40a3('0x2f')];if(!_0x3d50d7[_0x40a3('0x30')][_0x40a3('0x37')](_0x40a3('0x38'))){_0x4b7b86[_0x40a3('0x1e')]=qs[_0x40a3('0x1e')](_0x3d50d7[_0x40a3('0x30')][_0x40a3('0x1e')]);_0x4b7b86[_0x40a3('0x1d')]=qs[_0x40a3('0x1d')](_0x3d50d7[_0x40a3('0x30')][_0x40a3('0x1d')]);}_0x4b7b86['order']=qs[_0x40a3('0x39')](_0x3d50d7[_0x40a3('0x30')][_0x40a3('0x39')]);_0x4b7b86[_0x40a3('0x3a')]=qs[_0x40a3('0x32')](_[_0x40a3('0x3b')](_0x3d50d7[_0x40a3('0x30')],_0x355a8f['filters']));if(_0x3d50d7[_0x40a3('0x30')][_0x40a3('0x3c')]){_0x4b7b86[_0x40a3('0x3a')]=_['merge'](_0x4b7b86[_0x40a3('0x3a')],{'$or':_[_0x40a3('0x3d')](_0x58beaf,function(_0x1dd805){if(_0x1dd805[_0x40a3('0x3e')][_0x40a3('0x3f')]!==_0x40a3('0x40')){var _0x20fdea={};_0x20fdea[_0x1dd805[_0x40a3('0x41')]]={'$like':'%'+_0x3d50d7['query']['filter']+'%'};return _0x20fdea;}})});}_0x4b7b86=_[_0x40a3('0x42')]({},_0x4b7b86,_0x3d50d7[_0x40a3('0x43')]);var _0x3492fd={'where':_0x4b7b86[_0x40a3('0x3a')]};_0x3492fd['include']=[];if(_0x3d50d7[_0x40a3('0x30')][_0x40a3('0x44')]){_0x3492fd[_0x40a3('0x45')][_0x40a3('0x46')]({'model':db[_0x40a3('0x47')],'as':_0x40a3('0x48'),'attributes':['id'],'where':{'id':_0x3d50d7[_0x40a3('0x30')]['tag']},'required':!![]});_0x3492fd[_0x40a3('0x49')]=!![];}if(_0x3d50d7[_0x40a3('0x30')][_0x40a3('0x4a')]){_0x3492fd[_0x40a3('0x45')][_0x40a3('0x46')]({'model':db[_0x40a3('0x4b')],'as':_0x40a3('0x4c'),'attributes':['id',_0x40a3('0x4d'),_0x40a3('0x4e'),_0x40a3('0x4a')],'where':{'direction':'in','read':_0x3d50d7[_0x40a3('0x30')][_0x40a3('0x4a')]||![]},'required':!![]});_0x3492fd['distinct']=!![];}return db[_0x40a3('0x2d')][_0x40a3('0x4f')](_0x3492fd)[_0x40a3('0x25')](function(_0x889d9a){_0x4a7fd8[_0x40a3('0x4f')]=_0x889d9a;if(_0x3d50d7[_0x40a3('0x30')]['includeAll']){_0x4b7b86[_0x40a3('0x45')]=[{'model':db[_0x40a3('0x50')],'as':'Users','required':![],'attributes':['id','name',_0x40a3('0x51')]},{'model':db[_0x40a3('0x52')],'as':_0x40a3('0x53'),'required':![]},{'model':db[_0x40a3('0x50')],'as':_0x40a3('0x54'),'attributes':['name',_0x40a3('0x51'),'internal'],'required':![]},{'model':db[_0x40a3('0x55')],'as':_0x40a3('0x56'),'attributes':[_0x40a3('0x2a'),_0x40a3('0x3f')],'required':![]},{'model':db[_0x40a3('0x4b')],'as':_0x40a3('0x4c'),'attributes':['id',_0x40a3('0x4d'),_0x40a3('0x4e'),'read'],'where':{'direction':'in','read':_0x3d50d7[_0x40a3('0x30')][_0x40a3('0x4a')]||![]},'required':_0x3d50d7[_0x40a3('0x30')]['read']||![]},{'model':db['Tag'],'as':_0x40a3('0x48'),'attributes':['id',_0x40a3('0x2a'),_0x40a3('0x57')],'required':_0x3d50d7[_0x40a3('0x30')]['tag']?!![]:![]},{'model':db[_0x40a3('0x47')],'as':_0x40a3('0x58'),'attributes':['id',_0x40a3('0x2a'),_0x40a3('0x57')],'through':_0x3d50d7['query'][_0x40a3('0x44')]?{'attributes':[],'where':{'TagId':_0x3d50d7[_0x40a3('0x30')][_0x40a3('0x44')]||undefined}}:{},'required':_0x3d50d7[_0x40a3('0x30')][_0x40a3('0x44')]?!![]:![]}];}return db[_0x40a3('0x2d')][_0x40a3('0x59')](_0x4b7b86);})['then'](function(_0x2e666d){_0x4a7fd8[_0x40a3('0x5a')]=_0x2e666d;return _0x4a7fd8;})['then'](respondWithFilteredResult(_0x5d288e,_0x4b7b86))[_0x40a3('0x5b')](handleError(_0x5d288e,null));};exports['show']=function(_0x437d29,_0x590fa9){var _0x2a9bd1={'raw':![],'where':{'id':_0x437d29['params']['id']}},_0x3eda1b={};_0x3eda1b['model']=_[_0x40a3('0x31')](db[_0x40a3('0x2d')][_0x40a3('0x2e')]);_0x3eda1b[_0x40a3('0x30')]=_[_0x40a3('0x31')](_0x437d29[_0x40a3('0x30')]);_0x3eda1b[_0x40a3('0x32')]=_[_0x40a3('0x34')](_0x3eda1b[_0x40a3('0x2f')],_0x3eda1b[_0x40a3('0x30')]);_0x2a9bd1[_0x40a3('0x33')]=_[_0x40a3('0x34')](_0x3eda1b['model'],qs[_0x40a3('0x35')](_0x437d29[_0x40a3('0x30')][_0x40a3('0x35')]));_0x2a9bd1[_0x40a3('0x33')]=_0x2a9bd1['attributes'][_0x40a3('0x36')]?_0x2a9bd1['attributes']:_0x3eda1b[_0x40a3('0x2f')];if(_0x437d29['query']['includeAll']){_0x2a9bd1['include']=[{'all':!![]}];}_0x2a9bd1=_[_0x40a3('0x42')]({},_0x2a9bd1,_0x437d29[_0x40a3('0x43')]);return db[_0x40a3('0x2d')][_0x40a3('0x5c')](_0x2a9bd1)[_0x40a3('0x25')](handleEntityNotFound(_0x590fa9,null))[_0x40a3('0x25')](respondWithResult(_0x590fa9,null))[_0x40a3('0x5b')](handleError(_0x590fa9,null));};exports[_0x40a3('0x5d')]=function(_0x4ed27b,_0x53848d){return db['OpenchannelInteraction'][_0x40a3('0x5d')](_0x4ed27b[_0x40a3('0x5e')],{})[_0x40a3('0x25')](respondWithResult(_0x53848d,0xc9))['catch'](handleError(_0x53848d,null));};exports[_0x40a3('0x5f')]=function(_0x4b439c,_0x5dff9e){if(_0x4b439c[_0x40a3('0x5e')]['id']){delete _0x4b439c[_0x40a3('0x5e')]['id'];}return db[_0x40a3('0x2d')][_0x40a3('0x5c')]({'where':{'id':_0x4b439c[_0x40a3('0x60')]['id']}})['then'](handleEntityNotFound(_0x5dff9e,null))[_0x40a3('0x25')](saveUpdates(_0x4b439c[_0x40a3('0x5e')],null))[_0x40a3('0x25')](respondWithResult(_0x5dff9e,null))[_0x40a3('0x5b')](handleError(_0x5dff9e,null));};exports[_0x40a3('0x26')]=function(_0x1ece6b,_0x2cc66d){return db[_0x40a3('0x2d')][_0x40a3('0x5c')]({'where':{'id':_0x1ece6b['params']['id']}})[_0x40a3('0x25')](handleEntityNotFound(_0x2cc66d,null))[_0x40a3('0x25')](removeEntity(_0x2cc66d,null))['catch'](handleError(_0x2cc66d,null));};exports[_0x40a3('0x61')]=function(_0x443b8e,_0x5013c1){return db[_0x40a3('0x2d')][_0x40a3('0x61')]()[_0x40a3('0x25')](respondWithResult(_0x5013c1,null))[_0x40a3('0x5b')](handleError(_0x5013c1,null));};exports[_0x40a3('0x62')]=function(_0x5b6eb7,_0x5a8855,_0x19bdd9){return db[_0x40a3('0x4b')]['find']({'where':{'id':_0x5b6eb7[_0x40a3('0x60')]['id']}})['then'](handleEntityNotFound(_0x5a8855,null))[_0x40a3('0x25')](function(_0x472249){if(_0x472249){return _0x472249[_0x40a3('0x62')](_0x5b6eb7[_0x40a3('0x5e')][_0x40a3('0x63')],_[_0x40a3('0x64')](_0x5b6eb7[_0x40a3('0x5e')],[_0x40a3('0x63'),'id'])||{});}})[_0x40a3('0x25')](respondWithResult(_0x5a8855,null))['catch'](handleError(_0x5a8855,null));};exports[_0x40a3('0x65')]=function(_0x19618b,_0x2b8904,_0x210ee5){var _0x261590={'raw':![],'where':{}};var _0xc0079b={};var _0x1e2249={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x19618b[_0x40a3('0x60')]['id']}})['then'](handleEntityNotFound(_0x2b8904,null))[_0x40a3('0x25')](function(_0x16ab72){if(_0x16ab72){_0xc0079b[_0x40a3('0x2f')]=_[_0x40a3('0x31')](db[_0x40a3('0x4b')]['rawAttributes']);_0xc0079b[_0x40a3('0x30')]=_['keys'](_0x19618b[_0x40a3('0x30')]);_0xc0079b[_0x40a3('0x32')]=_[_0x40a3('0x34')](_0xc0079b[_0x40a3('0x2f')],_0xc0079b[_0x40a3('0x30')]);_0x261590[_0x40a3('0x33')]=_[_0x40a3('0x34')](_0xc0079b[_0x40a3('0x2f')],qs[_0x40a3('0x35')](_0x19618b[_0x40a3('0x30')][_0x40a3('0x35')]));_0x261590[_0x40a3('0x33')]=_0x261590['attributes']['length']?_0x261590[_0x40a3('0x33')]:_0xc0079b['model'];if(!_0x19618b['query'][_0x40a3('0x37')](_0x40a3('0x38'))){_0x261590['limit']=qs[_0x40a3('0x1e')](_0x19618b['query'][_0x40a3('0x1e')]);_0x261590[_0x40a3('0x1d')]=qs[_0x40a3('0x1d')](_0x19618b[_0x40a3('0x30')]['offset']);}_0x261590['order']=qs[_0x40a3('0x39')](_0x19618b['query']['sort']);_0x261590[_0x40a3('0x3a')]=qs[_0x40a3('0x32')](_[_0x40a3('0x3b')](_0x19618b[_0x40a3('0x30')],_0xc0079b[_0x40a3('0x32')]));_0x261590['where'][_0x40a3('0x66')]=_0x16ab72['id'];if(_0x19618b['query'][_0x40a3('0x3c')]){_0x261590[_0x40a3('0x3a')]=_[_0x40a3('0x42')](_0x261590['where'],{'$or':_[_0x40a3('0x3d')](_0x261590['attributes'],function(_0x3311cb){var _0x588cdf={};_0x588cdf[_0x3311cb]={'$like':'%'+_0x19618b['query'][_0x40a3('0x3c')]+'%'};return _0x588cdf;})});}if(_0x19618b[_0x40a3('0x30')][_0x40a3('0x67')]){var _0x1f10f5=_0x19618b[_0x40a3('0x30')][_0x40a3('0x67')][_0x40a3('0x68')](',');var _0x265f3={};_0x265f3[_0x1f10f5[0x0]]={'$gte':moment(_0x1f10f5[0x1])[_0x40a3('0x69')](_0x40a3('0x6a'))};_0x261590['where']=_[_0x40a3('0x42')](_0x261590[_0x40a3('0x3a')],_0x265f3);}_0x261590=_[_0x40a3('0x42')]({},_0x261590,_0x19618b[_0x40a3('0x43')]);return db[_0x40a3('0x4b')][_0x40a3('0x4f')]({'where':_0x261590[_0x40a3('0x3a')]})['then'](function(_0x42c875){_0x1e2249[_0x40a3('0x4f')]=_0x42c875;if(_0x19618b[_0x40a3('0x30')][_0x40a3('0x6b')]){_0x261590[_0x40a3('0x45')]=[{'all':!![]}];}return db[_0x40a3('0x4b')][_0x40a3('0x59')](_0x261590);})[_0x40a3('0x25')](function(_0x168f77){_0x1e2249[_0x40a3('0x5a')]=_0x168f77;return _0x1e2249;});}})[_0x40a3('0x25')](respondWithFilteredResult(_0x2b8904,_0x261590))['catch'](handleError(_0x2b8904,null));};exports[_0x40a3('0x6c')]=function(_0x280767,_0xb486dd,_0x5a39a9){return db[_0x40a3('0x2d')][_0x40a3('0x5c')]({'where':{'id':_0x280767[_0x40a3('0x60')]['id']}})['then'](handleEntityNotFound(_0xb486dd,null))[_0x40a3('0x25')](function(_0x1c17e9){if(_0x1c17e9){return _0x1c17e9[_0x40a3('0x6d')](_0x280767['body']['ids'],_['omit'](_0x280767[_0x40a3('0x5e')],[_0x40a3('0x63'),'id'])||{})[_0x40a3('0x6e')](function(){return db[_0x40a3('0x47')][_0x40a3('0x59')]({'attributes':['id',_0x40a3('0x2a'),_0x40a3('0x57')],'where':{'id':_0x280767[_0x40a3('0x5e')]['ids']}});})[_0x40a3('0x25')](function(_0x5f56df){socket[_0x40a3('0x6f')]('openchannelInteractionTags:save',{'id':Number(_0x280767[_0x40a3('0x60')]['id']),'tags':_0x5f56df||[]});return{'id':Number(_0x280767[_0x40a3('0x60')]['id']),'tags':_0x5f56df||[]};});}})[_0x40a3('0x25')](respondWithResult(_0xb486dd,null))[_0x40a3('0x5b')](handleError(_0xb486dd,null));};exports[_0x40a3('0x70')]=function(_0x2bd1c3,_0x2f198f,_0x87331b){var _0x4063ea;return db[_0x40a3('0x2d')]['find']({'where':{'id':_0x2bd1c3[_0x40a3('0x60')]['id']}})['then'](handleEntityNotFound(_0x2f198f,null))[_0x40a3('0x25')](function(_0x549acc){if(_0x549acc){return _0x549acc[_0x40a3('0x70')](_0x2bd1c3[_0x40a3('0x30')][_0x40a3('0x63')]);}})['then'](respondWithStatusCode(_0x2f198f,null))['catch'](handleError(_0x2f198f,null));};exports[_0x40a3('0x71')]=function(_0x3d38e7,_0x113944){var _0x373528=moment()[_0x40a3('0x72')]()[_0x40a3('0x73')]();var _0x29da22=path[_0x40a3('0x74')](config[_0x40a3('0x75')],_0x40a3('0x76'),_0x40a3('0x77'),_0x40a3('0x78'));var _0x3a715d=path['join'](config[_0x40a3('0x75')],_0x40a3('0x76'),'files','attachments');var _0x2081ed=path[_0x40a3('0x74')](_0x29da22,_0x373528);var _0xc94d75=util[_0x40a3('0x69')](_0x40a3('0x79'),_0x373528);var _0x508150=path['join'](_0x29da22,_0xc94d75);var _0x5f1ab0=![];return db[_0x40a3('0x2d')][_0x40a3('0x5c')]({'where':{'id':_0x3d38e7[_0x40a3('0x60')]['id']},'include':[{'model':db[_0x40a3('0x4b')],'as':_0x40a3('0x4c'),'attributes':['id',_0x40a3('0x5e')],'include':[{'model':db[_0x40a3('0x50')],'as':'User','attributes':['id',_0x40a3('0x51')],'raw':!![]},{'model':db[_0x40a3('0x52')],'as':_0x40a3('0x53'),'attributes':['id','firstName'],'raw':!![]},{'model':db[_0x40a3('0x7a')],'as':_0x40a3('0x7a'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x113944,null))['then'](function(_0x4cea59){if(_0x4cea59){_0x5f1ab0=!![];var _0x26a702='';var _0x3472fd={'format':'Letter','border':_0x40a3('0x7b')};fs[_0x40a3('0x7c')](_0x2081ed);_0x26a702+=util[_0x40a3('0x69')](_0x40a3('0x7d'),_0x4cea59['id']);_0x26a702+=util[_0x40a3('0x69')]('

Date:\x20%s

',moment()['format']('MMMM\x20Do\x20YYYY,\x20HH:mm:ss')[_0x40a3('0x73')]());_0x26a702+=_0x40a3('0x7e');for(var _0x2b6017=0x0;_0x2b6017<_0x4cea59[_0x40a3('0x4c')][_0x40a3('0x36')];_0x2b6017++){var _0x2e136d=_0x4cea59[_0x40a3('0x4c')][_0x2b6017];_0x26a702+=_0x40a3('0x7f');_0x26a702+=util['format'](_0x40a3('0x80'),_0x2e136d[_0x40a3('0x50')]?_0x2e136d[_0x40a3('0x50')]['fullname']:_0x2e136d['Contact'][_0x40a3('0x81')],_0x2e136d[_0x40a3('0x5e')]);_0x26a702+=_0x40a3('0x82');if(_0x2e136d['Attachment']){var _0x2d82b1=_0x2e136d[_0x40a3('0x7a')];var _0x30e251=path['join'](_0x3a715d,_0x2d82b1[_0x40a3('0x83')]);if(fs['existsSync'](_0x30e251)){fs[_0x40a3('0x84')](_0x30e251)[_0x40a3('0x85')](fs[_0x40a3('0x86')](path[_0x40a3('0x74')](_0x2081ed,_0x2d82b1[_0x40a3('0x83')])));}}}return new BPromise(function(_0x18c9d6,_0x1b66bc){pdf['create'](_0x26a702,_0x3472fd)[_0x40a3('0x87')](path['join'](_0x2081ed,'interaction-'+_0x373528+_0x40a3('0x88')),function(_0x5377c5,_0x165ac0){if(_0x5377c5)return _0x1b66bc(_0x5377c5);_0x18c9d6(_0x165ac0);});});}})['then'](function(){if(_0x5f1ab0){return new BPromise(function(_0x3374f6,_0x5068b7){zipdir(_0x2081ed,{'saveTo':_0x508150},function(_0x2f4c45,_0x34fa3a){if(_0x2f4c45)return _0x5068b7(_0x2f4c45);return _0x3374f6(_0x34fa3a);});});}})[_0x40a3('0x25')](function(){if(_0x5f1ab0){return new BPromise(function(_0x2152d6,_0x306982){rimraf(_0x2081ed,function(_0x44a819){if(_0x44a819)_0x306982(_0x44a819);return _0x2152d6();});});}})[_0x40a3('0x25')](function(){if(_0x5f1ab0){return _0x113944[_0x40a3('0x71')](_0x508150,_0xc94d75,function(_0x529e4a){if(_0x529e4a){console[_0x40a3('0x89')]('err',_0x529e4a);}else{fs[_0x40a3('0x8a')](_0x508150);}});}else{return _0x113944[_0x40a3('0x27')](0xc8);}})[_0x40a3('0x5b')](handleError(_0x113944,null));}; \ No newline at end of file +var _0x355e=['$gte','format','rows','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','attachments','firstName','Attachment','1cm','
','','%s:\x20%s

','','basename','existsSync','createReadStream','pipe','createWriteStream','toFile','.pdf','log','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','OpenchannelInteraction','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','map','type','key','VIRTUAL','options','include','push','Tag','tag','distinct','read','OpenchannelMessage','direction','count','then','includeAll','User','Users','fullname','CmContact','Contact','Owner','internal','OpenchannelAccount','Messages','createdAt','color','ThroughTags','findAll','catch','show','params','find','create','body','describe','addMessage','ids','omit','getMessages','nolimit','order','filter','merge'];(function(_0xde9447,_0x45a41c){var _0x3760b7=function(_0x592400){while(--_0x592400){_0xde9447['push'](_0xde9447['shift']());}};_0x3760b7(++_0x45a41c);}(_0x355e,0xa7));var _0xe355=function(_0x565675,_0x1e467c){_0x565675=_0x565675-0x0;var _0x468999=_0x355e[_0x565675];return _0x468999;};'use strict';var pdf=require(_0xe355('0x0'));var emlformat=require(_0xe355('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe355('0x2'));var jsonpatch=require(_0xe355('0x3'));var rp=require(_0xe355('0x4'));var moment=require(_0xe355('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe355('0x6'));var path=require(_0xe355('0x7'));var sox=require(_0xe355('0x8'));var csv=require(_0xe355('0x9'));var ejs=require(_0xe355('0xa'));var fs=require('fs');var _=require(_0xe355('0xb'));var squel=require(_0xe355('0xc'));var crypto=require(_0xe355('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe355('0xe'));var toCsv=require(_0xe355('0x9'));var querystring=require(_0xe355('0xf'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xe355('0x10'));var Redis=require(_0xe355('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xe355('0x12'))(_0xe355('0x13'));var utils=require(_0xe355('0x14'));var config=require('../../config/environment');var db=require(_0xe355('0x15'))['db'];config[_0xe355('0x16')]=_[_0xe355('0x17')](config[_0xe355('0x16')],{'host':_0xe355('0x18'),'port':0x18eb});var socket=require(_0xe355('0x19'))(new Redis(config[_0xe355('0x16')]));require(_0xe355('0x1a'))[_0xe355('0x1b')](socket);function respondWithStatusCode(_0x54ec53,_0x3ac130){_0x3ac130=_0x3ac130||0xcc;return function(_0x13a1b7){if(_0x13a1b7){return _0x54ec53['sendStatus'](_0x3ac130);}return _0x54ec53[_0xe355('0x1c')](_0x3ac130)[_0xe355('0x1d')]();};}function respondWithResult(_0x338099,_0x26abf6){_0x26abf6=_0x26abf6||0xc8;return function(_0x1a604){if(_0x1a604){return _0x338099[_0xe355('0x1c')](_0x26abf6)[_0xe355('0x1e')](_0x1a604);}};}function respondWithFilteredResult(_0x548c1c,_0x2e2230){return function(_0x1b602e){if(_0x1b602e){var _0x4b9c31=_0x1b602e['count'],_0x1266d5=_0x2e2230[_0xe355('0x1f')],_0x1d71b0=_0x2e2230[_0xe355('0x1f')]+_0x2e2230[_0xe355('0x20')],_0x3d5fc5;if(_0x1d71b0>=_0x4b9c31){_0x1d71b0=_0x4b9c31;_0x3d5fc5=0xc8;}else{_0x3d5fc5=0xce;}_0x548c1c[_0xe355('0x1c')](_0x3d5fc5);return _0x548c1c['set'](_0xe355('0x21'),_0x1266d5+'-'+_0x1d71b0+'/'+_0x4b9c31)[_0xe355('0x1e')](_0x1b602e);}return null;};}function patchUpdates(_0x2f4c55){return function(_0x4d100a){try{jsonpatch[_0xe355('0x22')](_0x4d100a,_0x2f4c55,!![]);}catch(_0x33e5ef){return BPromise[_0xe355('0x23')](_0x33e5ef);}return _0x4d100a[_0xe355('0x24')]();};}function saveUpdates(_0x20f237,_0x2eca9){return function(_0x1f0408){if(_0x1f0408){return _0x1f0408[_0xe355('0x25')](_0x20f237)['then'](function(_0x4c5304){return _0x4c5304;});}return null;};}function removeEntity(_0x1987f3,_0x5aae40){return function(_0x38e1ba){if(_0x38e1ba){return _0x38e1ba[_0xe355('0x26')]()['then'](function(){_0x1987f3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52063a,_0x349533){return function(_0x20858d){if(!_0x20858d){_0x52063a[_0xe355('0x27')](0x194);}return _0x20858d;};}function handleError(_0x5bad20,_0x458a0d){_0x458a0d=_0x458a0d||0x1f4;return function(_0x1034ee){logger[_0xe355('0x28')](_0x1034ee[_0xe355('0x29')]);if(_0x1034ee[_0xe355('0x2a')]){delete _0x1034ee['name'];}_0x5bad20['status'](_0x458a0d)['send'](_0x1034ee);};}exports['index']=function(_0x1ac0dd,_0x572a2d){var _0x3b9178={},_0x24dda1={},_0x2b961d={'count':0x0,'rows':[]};var _0x34b1eb=db[_0xe355('0x2b')][_0xe355('0x2c')];_0x24dda1[_0xe355('0x2d')]=_['keys'](_0x34b1eb);_0x24dda1['query']=_[_0xe355('0x2e')](_0x1ac0dd[_0xe355('0x2f')]);_0x24dda1['filters']=_['intersection'](_0x24dda1['model'],_0x24dda1['query']);_0x3b9178['attributes']=_[_0xe355('0x30')](_0x24dda1[_0xe355('0x2d')],qs['fields'](_0x1ac0dd[_0xe355('0x2f')][_0xe355('0x31')]));_0x3b9178[_0xe355('0x32')]=_0x3b9178[_0xe355('0x32')][_0xe355('0x33')]?_0x3b9178[_0xe355('0x32')]:_0x24dda1[_0xe355('0x2d')];if(!_0x1ac0dd['query'][_0xe355('0x34')]('nolimit')){_0x3b9178[_0xe355('0x20')]=qs[_0xe355('0x20')](_0x1ac0dd[_0xe355('0x2f')][_0xe355('0x20')]);_0x3b9178[_0xe355('0x1f')]=qs[_0xe355('0x1f')](_0x1ac0dd[_0xe355('0x2f')]['offset']);}_0x3b9178['order']=qs[_0xe355('0x35')](_0x1ac0dd[_0xe355('0x2f')][_0xe355('0x35')]);_0x3b9178[_0xe355('0x36')]=qs[_0xe355('0x37')](_[_0xe355('0x38')](_0x1ac0dd[_0xe355('0x2f')],_0x24dda1[_0xe355('0x37')]));if(_0x1ac0dd[_0xe355('0x2f')]['filter']){_0x3b9178[_0xe355('0x36')]=_['merge'](_0x3b9178[_0xe355('0x36')],{'$or':_[_0xe355('0x39')](_0x34b1eb,function(_0x46317c){if(_0x46317c[_0xe355('0x3a')][_0xe355('0x3b')]!==_0xe355('0x3c')){var _0x1c4514={};_0x1c4514[_0x46317c['field']]={'$like':'%'+_0x1ac0dd[_0xe355('0x2f')]['filter']+'%'};return _0x1c4514;}})});}_0x3b9178=_['merge']({},_0x3b9178,_0x1ac0dd[_0xe355('0x3d')]);var _0x26d8f5={'where':_0x3b9178[_0xe355('0x36')]};_0x26d8f5['include']=[];if(_0x1ac0dd[_0xe355('0x2f')]['tag']){_0x26d8f5[_0xe355('0x3e')][_0xe355('0x3f')]({'model':db[_0xe355('0x40')],'as':'Tags','attributes':['id'],'where':{'id':_0x1ac0dd[_0xe355('0x2f')][_0xe355('0x41')]},'required':!![]});_0x26d8f5[_0xe355('0x42')]=!![];}if(_0x1ac0dd[_0xe355('0x2f')][_0xe355('0x43')]){_0x26d8f5[_0xe355('0x3e')]['push']({'model':db[_0xe355('0x44')],'as':'Messages','attributes':['id',_0xe355('0x45'),'createdAt',_0xe355('0x43')],'where':{'direction':'in','read':_0x1ac0dd[_0xe355('0x2f')]['read']||![]},'required':!![]});_0x26d8f5[_0xe355('0x42')]=!![];}return db['OpenchannelInteraction'][_0xe355('0x46')](_0x26d8f5)[_0xe355('0x47')](function(_0x38426b){_0x2b961d[_0xe355('0x46')]=_0x38426b;if(_0x1ac0dd['query'][_0xe355('0x48')]){_0x3b9178[_0xe355('0x3e')]=[{'model':db[_0xe355('0x49')],'as':_0xe355('0x4a'),'required':![],'attributes':['id',_0xe355('0x2a'),_0xe355('0x4b')]},{'model':db[_0xe355('0x4c')],'as':_0xe355('0x4d'),'required':![]},{'model':db[_0xe355('0x49')],'as':_0xe355('0x4e'),'attributes':['name',_0xe355('0x4b'),_0xe355('0x4f')],'required':![]},{'model':db[_0xe355('0x50')],'as':'Account','attributes':[_0xe355('0x2a'),_0xe355('0x3b')],'required':![]},{'model':db[_0xe355('0x44')],'as':_0xe355('0x51'),'attributes':['id',_0xe355('0x45'),_0xe355('0x52'),_0xe355('0x43')],'where':{'direction':'in','read':_0x1ac0dd[_0xe355('0x2f')]['read']||![]},'required':_0x1ac0dd[_0xe355('0x2f')][_0xe355('0x43')]||![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0xe355('0x53')],'required':_0x1ac0dd[_0xe355('0x2f')][_0xe355('0x41')]?!![]:![]},{'model':db[_0xe355('0x40')],'as':_0xe355('0x54'),'attributes':['id',_0xe355('0x2a'),_0xe355('0x53')],'through':_0x1ac0dd[_0xe355('0x2f')][_0xe355('0x41')]?{'attributes':[],'where':{'TagId':_0x1ac0dd[_0xe355('0x2f')][_0xe355('0x41')]||undefined}}:{},'required':_0x1ac0dd[_0xe355('0x2f')]['tag']?!![]:![]}];}return db[_0xe355('0x2b')][_0xe355('0x55')](_0x3b9178);})['then'](function(_0x4cbef4){_0x2b961d['rows']=_0x4cbef4;return _0x2b961d;})['then'](respondWithFilteredResult(_0x572a2d,_0x3b9178))[_0xe355('0x56')](handleError(_0x572a2d,null));};exports[_0xe355('0x57')]=function(_0x1b5584,_0x490af1){var _0x28acb4={'raw':![],'where':{'id':_0x1b5584[_0xe355('0x58')]['id']}},_0x124bc9={};_0x124bc9[_0xe355('0x2d')]=_['keys'](db['OpenchannelInteraction'][_0xe355('0x2c')]);_0x124bc9[_0xe355('0x2f')]=_[_0xe355('0x2e')](_0x1b5584[_0xe355('0x2f')]);_0x124bc9['filters']=_[_0xe355('0x30')](_0x124bc9[_0xe355('0x2d')],_0x124bc9[_0xe355('0x2f')]);_0x28acb4['attributes']=_[_0xe355('0x30')](_0x124bc9[_0xe355('0x2d')],qs[_0xe355('0x31')](_0x1b5584[_0xe355('0x2f')][_0xe355('0x31')]));_0x28acb4[_0xe355('0x32')]=_0x28acb4[_0xe355('0x32')][_0xe355('0x33')]?_0x28acb4[_0xe355('0x32')]:_0x124bc9[_0xe355('0x2d')];if(_0x1b5584[_0xe355('0x2f')][_0xe355('0x48')]){_0x28acb4[_0xe355('0x3e')]=[{'all':!![]}];}_0x28acb4=_['merge']({},_0x28acb4,_0x1b5584[_0xe355('0x3d')]);return db[_0xe355('0x2b')][_0xe355('0x59')](_0x28acb4)[_0xe355('0x47')](handleEntityNotFound(_0x490af1,null))[_0xe355('0x47')](respondWithResult(_0x490af1,null))[_0xe355('0x56')](handleError(_0x490af1,null));};exports[_0xe355('0x5a')]=function(_0x31fe2d,_0x1b9da0){return db[_0xe355('0x2b')][_0xe355('0x5a')](_0x31fe2d[_0xe355('0x5b')],{})[_0xe355('0x47')](respondWithResult(_0x1b9da0,0xc9))[_0xe355('0x56')](handleError(_0x1b9da0,null));};exports[_0xe355('0x25')]=function(_0x21cdc5,_0x3711a3){if(_0x21cdc5['body']['id']){delete _0x21cdc5[_0xe355('0x5b')]['id'];}return db[_0xe355('0x2b')][_0xe355('0x59')]({'where':{'id':_0x21cdc5[_0xe355('0x58')]['id']}})['then'](handleEntityNotFound(_0x3711a3,null))['then'](saveUpdates(_0x21cdc5[_0xe355('0x5b')],null))[_0xe355('0x47')](respondWithResult(_0x3711a3,null))[_0xe355('0x56')](handleError(_0x3711a3,null));};exports[_0xe355('0x26')]=function(_0x213ff6,_0x3064e4){return db[_0xe355('0x2b')][_0xe355('0x59')]({'where':{'id':_0x213ff6[_0xe355('0x58')]['id']}})[_0xe355('0x47')](handleEntityNotFound(_0x3064e4,null))[_0xe355('0x47')](removeEntity(_0x3064e4,null))[_0xe355('0x56')](handleError(_0x3064e4,null));};exports[_0xe355('0x5c')]=function(_0x5ba438,_0x34a5e1){return db[_0xe355('0x2b')][_0xe355('0x5c')]()['then'](respondWithResult(_0x34a5e1,null))['catch'](handleError(_0x34a5e1,null));};exports[_0xe355('0x5d')]=function(_0x55e4d2,_0x42985f,_0x19c032){return db[_0xe355('0x44')][_0xe355('0x59')]({'where':{'id':_0x55e4d2[_0xe355('0x58')]['id']}})[_0xe355('0x47')](handleEntityNotFound(_0x42985f,null))['then'](function(_0x5e2dc5){if(_0x5e2dc5){return _0x5e2dc5[_0xe355('0x5d')](_0x55e4d2['body'][_0xe355('0x5e')],_[_0xe355('0x5f')](_0x55e4d2[_0xe355('0x5b')],[_0xe355('0x5e'),'id'])||{});}})[_0xe355('0x47')](respondWithResult(_0x42985f,null))['catch'](handleError(_0x42985f,null));};exports[_0xe355('0x60')]=function(_0x29dec5,_0xf36af,_0x95a4f9){var _0xf1ded8={'raw':![],'where':{}};var _0x5de9de={};var _0x1585a0={'count':0x0,'rows':[]};return db[_0xe355('0x2b')]['findOne']({'where':{'id':_0x29dec5[_0xe355('0x58')]['id']}})[_0xe355('0x47')](handleEntityNotFound(_0xf36af,null))[_0xe355('0x47')](function(_0x5b5b7d){if(_0x5b5b7d){_0x5de9de[_0xe355('0x2d')]=_[_0xe355('0x2e')](db[_0xe355('0x44')]['rawAttributes']);_0x5de9de['query']=_[_0xe355('0x2e')](_0x29dec5['query']);_0x5de9de[_0xe355('0x37')]=_[_0xe355('0x30')](_0x5de9de[_0xe355('0x2d')],_0x5de9de[_0xe355('0x2f')]);_0xf1ded8[_0xe355('0x32')]=_[_0xe355('0x30')](_0x5de9de[_0xe355('0x2d')],qs['fields'](_0x29dec5[_0xe355('0x2f')][_0xe355('0x31')]));_0xf1ded8['attributes']=_0xf1ded8[_0xe355('0x32')][_0xe355('0x33')]?_0xf1ded8[_0xe355('0x32')]:_0x5de9de[_0xe355('0x2d')];if(!_0x29dec5[_0xe355('0x2f')][_0xe355('0x34')](_0xe355('0x61'))){_0xf1ded8['limit']=qs[_0xe355('0x20')](_0x29dec5[_0xe355('0x2f')][_0xe355('0x20')]);_0xf1ded8[_0xe355('0x1f')]=qs[_0xe355('0x1f')](_0x29dec5['query'][_0xe355('0x1f')]);}_0xf1ded8[_0xe355('0x62')]=qs[_0xe355('0x35')](_0x29dec5[_0xe355('0x2f')][_0xe355('0x35')]);_0xf1ded8[_0xe355('0x36')]=qs[_0xe355('0x37')](_[_0xe355('0x38')](_0x29dec5[_0xe355('0x2f')],_0x5de9de[_0xe355('0x37')]));_0xf1ded8[_0xe355('0x36')]['OpenchannelInteractionId']=_0x5b5b7d['id'];if(_0x29dec5['query'][_0xe355('0x63')]){_0xf1ded8[_0xe355('0x36')]=_[_0xe355('0x64')](_0xf1ded8[_0xe355('0x36')],{'$or':_['map'](_0xf1ded8[_0xe355('0x32')],function(_0x411695){var _0x27dd24={};_0x27dd24[_0x411695]={'$like':'%'+_0x29dec5[_0xe355('0x2f')]['filter']+'%'};return _0x27dd24;})});}if(_0x29dec5[_0xe355('0x2f')][_0xe355('0x65')]){var _0x28037d=_0x29dec5['query'][_0xe355('0x65')]['split'](',');var _0x422ef6={};_0x422ef6[_0x28037d[0x0]]={'$gte':moment(_0x28037d[0x1])[_0xe355('0x66')]('YYYY-MM-DD\x20HH:mm:ss')};_0xf1ded8[_0xe355('0x36')]=_[_0xe355('0x64')](_0xf1ded8[_0xe355('0x36')],_0x422ef6);}_0xf1ded8=_[_0xe355('0x64')]({},_0xf1ded8,_0x29dec5[_0xe355('0x3d')]);return db['OpenchannelMessage'][_0xe355('0x46')]({'where':_0xf1ded8['where']})[_0xe355('0x47')](function(_0x500b30){_0x1585a0['count']=_0x500b30;if(_0x29dec5['query'][_0xe355('0x48')]){_0xf1ded8[_0xe355('0x3e')]=[{'all':!![]}];}return db[_0xe355('0x44')][_0xe355('0x55')](_0xf1ded8);})[_0xe355('0x47')](function(_0x3449f2){_0x1585a0[_0xe355('0x67')]=_0x3449f2;return _0x1585a0;});}})[_0xe355('0x47')](respondWithFilteredResult(_0xf36af,_0xf1ded8))[_0xe355('0x56')](handleError(_0xf36af,null));};exports[_0xe355('0x68')]=function(_0x2059aa,_0x22e263,_0x15c5ee){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2059aa[_0xe355('0x58')]['id']}})[_0xe355('0x47')](handleEntityNotFound(_0x22e263,null))[_0xe355('0x47')](function(_0x4e3f25){if(_0x4e3f25){return _0x4e3f25[_0xe355('0x69')](_0x2059aa['body'][_0xe355('0x5e')],_[_0xe355('0x5f')](_0x2059aa[_0xe355('0x5b')],[_0xe355('0x5e'),'id'])||{})[_0xe355('0x6a')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0xe355('0x53')],'where':{'id':_0x2059aa[_0xe355('0x5b')][_0xe355('0x5e')]}});})['then'](function(_0x2e649a){socket[_0xe355('0x6b')](_0xe355('0x6c'),{'id':Number(_0x2059aa[_0xe355('0x58')]['id']),'tags':_0x2e649a||[]});return{'id':Number(_0x2059aa[_0xe355('0x58')]['id']),'tags':_0x2e649a||[]};});}})['then'](respondWithResult(_0x22e263,null))['catch'](handleError(_0x22e263,null));};exports[_0xe355('0x6d')]=function(_0x34994d,_0x1ea17b,_0x55f633){var _0x1766c7;return db[_0xe355('0x2b')]['find']({'where':{'id':_0x34994d[_0xe355('0x58')]['id']}})[_0xe355('0x47')](handleEntityNotFound(_0x1ea17b,null))[_0xe355('0x47')](function(_0x130efa){if(_0x130efa){return _0x130efa[_0xe355('0x6d')](_0x34994d[_0xe355('0x2f')][_0xe355('0x5e')]);}})['then'](respondWithStatusCode(_0x1ea17b,null))[_0xe355('0x56')](handleError(_0x1ea17b,null));};exports[_0xe355('0x6e')]=function(_0x148d74,_0x1e6ffa){var _0x805abc=moment()[_0xe355('0x6f')]()[_0xe355('0x70')]();var _0x33f2ae=path[_0xe355('0x71')](config[_0xe355('0x72')],'server',_0xe355('0x73'),_0xe355('0x74'));var _0x38826a=path['join'](config[_0xe355('0x72')],'server',_0xe355('0x73'),_0xe355('0x75'));var _0x66d6b5=path[_0xe355('0x71')](_0x33f2ae,_0x805abc);var _0x5b0671=util[_0xe355('0x66')]('interaction-%s.zip',_0x805abc);var _0x532704=path['join'](_0x33f2ae,_0x5b0671);var _0x502ec2=![];return db[_0xe355('0x2b')][_0xe355('0x59')]({'where':{'id':_0x148d74[_0xe355('0x58')]['id']},'include':[{'model':db['OpenchannelMessage'],'as':_0xe355('0x51'),'attributes':['id',_0xe355('0x5b')],'include':[{'model':db[_0xe355('0x49')],'as':'User','attributes':['id','fullname'],'raw':!![]},{'model':db[_0xe355('0x4c')],'as':'Contact','attributes':['id',_0xe355('0x76')],'raw':!![]},{'model':db[_0xe355('0x77')],'as':_0xe355('0x77'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1e6ffa,null))[_0xe355('0x47')](function(_0x4744b5){if(_0x4744b5){_0x502ec2=!![];var _0x102ada='';var _0x16cc48={'format':'Letter','border':_0xe355('0x78')};fs['mkdirSync'](_0x66d6b5);_0x102ada+=util['format']('

Openchannel\x20Interaction:\x20#%d

',_0x4744b5['id']);_0x102ada+=util['format']('

Date:\x20%s

',moment()['format']('MMMM\x20Do\x20YYYY,\x20HH:mm:ss')[_0xe355('0x70')]());_0x102ada+=_0xe355('0x79');for(var _0x1465fc=0x0;_0x1465fc<_0x4744b5[_0xe355('0x51')][_0xe355('0x33')];_0x1465fc++){var _0x3913b3=_0x4744b5[_0xe355('0x51')][_0x1465fc];_0x102ada+=_0xe355('0x7a');_0x102ada+=util[_0xe355('0x66')](_0xe355('0x7b'),_0x3913b3[_0xe355('0x49')]?_0x3913b3[_0xe355('0x49')][_0xe355('0x4b')]:_0x3913b3[_0xe355('0x4d')]['firstName'],_0x3913b3[_0xe355('0x5b')]);_0x102ada+=_0xe355('0x7c');if(_0x3913b3['Attachment']){var _0xeeb463=_0x3913b3[_0xe355('0x77')];var _0x41bdf7=path['join'](_0x38826a,_0xeeb463[_0xe355('0x7d')]);if(fs[_0xe355('0x7e')](_0x41bdf7)){fs[_0xe355('0x7f')](_0x41bdf7)[_0xe355('0x80')](fs[_0xe355('0x81')](path['join'](_0x66d6b5,_0xeeb463['basename'])));}}}return new BPromise(function(_0x6f7b1a,_0x6daffe){pdf[_0xe355('0x5a')](_0x102ada,_0x16cc48)[_0xe355('0x82')](path['join'](_0x66d6b5,'interaction-'+_0x805abc+_0xe355('0x83')),function(_0x445e31,_0x101fc7){if(_0x445e31)return _0x6daffe(_0x445e31);_0x6f7b1a(_0x101fc7);});});}})[_0xe355('0x47')](function(){if(_0x502ec2){return new BPromise(function(_0x44fcf0,_0x4a1f87){zipdir(_0x66d6b5,{'saveTo':_0x532704},function(_0x475b78,_0x2ba89f){if(_0x475b78)return _0x4a1f87(_0x475b78);return _0x44fcf0(_0x2ba89f);});});}})[_0xe355('0x47')](function(){if(_0x502ec2){return new BPromise(function(_0x361923,_0x9d05d5){rimraf(_0x66d6b5,function(_0x1892bb){if(_0x1892bb)_0x9d05d5(_0x1892bb);return _0x361923();});});}})[_0xe355('0x47')](function(){if(_0x502ec2){return _0x1e6ffa['download'](_0x532704,_0x5b0671,function(_0x478bfb){if(_0x478bfb){console[_0xe355('0x84')]('err',_0x478bfb);}else{fs[_0xe355('0x85')](_0x532704);}});}else{return _0x1e6ffa[_0xe355('0x27')](0xc8);}})[_0xe355('0x56')](handleError(_0x1e6ffa,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 7ad0c53..89cc313 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 _0x42c8=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x42c8,0xce));var _0x842c=function(_0x3abce4,_0x34e488){_0x3abce4=_0x3abce4-0x0;var _0x2c25db=_0x42c8[_0x3abce4];return _0x2c25db;};'use strict';var EventEmitter=require(_0x842c('0x0'));var OpenchannelInteraction=require(_0x842c('0x1'))['db']['OpenchannelInteraction'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x842c('0x2')](0x0);var events={'afterCreate':_0x842c('0x3'),'afterUpdate':_0x842c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x315d47){return function(_0x1dc57d,_0x45fc51,_0x40964b){OpenchannelInteractionEvents['emit'](_0x315d47+':'+_0x1dc57d['id'],_0x1dc57d);OpenchannelInteractionEvents[_0x842c('0x5')](_0x315d47,_0x1dc57d);_0x40964b(null);};}for(var e in events){if(events[_0x842c('0x6')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x842c('0x7')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x6582=['OpenchannelInteraction','setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x6582,0xd6));var _0x2658=function(_0x448f50,_0x5587ba){_0x448f50=_0x448f50-0x0;var _0x2af4c3=_0x6582[_0x448f50];return _0x2af4c3;};'use strict';var EventEmitter=require(_0x2658('0x0'));var OpenchannelInteraction=require(_0x2658('0x1'))['db'][_0x2658('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2658('0x3')](0x0);var events={'afterCreate':_0x2658('0x4'),'afterUpdate':_0x2658('0x5'),'afterDestroy':'remove'};function emitEvent(_0x322d55){return function(_0x22e81f,_0x4b1633,_0x17ffdc){OpenchannelInteractionEvents[_0x2658('0x6')](_0x322d55+':'+_0x22e81f['id'],_0x22e81f);OpenchannelInteractionEvents[_0x2658('0x6')](_0x322d55,_0x22e81f);_0x17ffdc(null);};}for(var e in events){if(events[_0x2658('0x7')](e)){var event=events[e];OpenchannelInteraction[_0x2658('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 942f878..b1bc7c8 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 _0xbb91=['request-promise','exports','define','openchannel_interactions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x7a30a0,_0x26e76c){var _0x336c43=function(_0x109714){while(--_0x109714){_0x7a30a0['push'](_0x7a30a0['shift']());}};_0x336c43(++_0x26e76c);}(_0xbb91,0x1da));var _0x1bb9=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0xbb91[_0x386c3e];return _0x4b8e13;};'use strict';var _=require(_0x1bb9('0x0'));var util=require(_0x1bb9('0x1'));var logger=require(_0x1bb9('0x2'))(_0x1bb9('0x3'));var moment=require(_0x1bb9('0x4'));var BPromise=require(_0x1bb9('0x5'));var rp=require(_0x1bb9('0x6'));var attributes=require('./openchannelInteraction.attributes');module[_0x1bb9('0x7')]=function(_0x225657,_0x4fed69){return _0x225657[_0x1bb9('0x8')]('OpenchannelInteraction',attributes,{'tableName':_0x1bb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f5c=['util','../../config/logger','api','moment','bluebird','request-promise','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','lodash'];(function(_0x559863,_0x20859d){var _0x458366=function(_0x3ec6a5){while(--_0x3ec6a5){_0x559863['push'](_0x559863['shift']());}};_0x458366(++_0x20859d);}(_0x4f5c,0xef));var _0xc4f5=function(_0xcee2a7,_0x1c7f6e){_0xcee2a7=_0xcee2a7-0x0;var _0x1347fc=_0x4f5c[_0xcee2a7];return _0x1347fc;};'use strict';var _=require(_0xc4f5('0x0'));var util=require(_0xc4f5('0x1'));var logger=require(_0xc4f5('0x2'))(_0xc4f5('0x3'));var moment=require(_0xc4f5('0x4'));var BPromise=require(_0xc4f5('0x5'));var rp=require(_0xc4f5('0x6'));var attributes=require(_0xc4f5('0x7'));module[_0xc4f5('0x8')]=function(_0xaf8d60,_0xa3c280){return _0xaf8d60[_0xc4f5('0x9')](_0xc4f5('0xa'),attributes,{'tableName':_0xc4f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 781d40f..d9e9269 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 _0xcca7=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','stringify','catch','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','AddTags','lodash','util','moment','bluebird'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xcca7,0x1aa));var _0x7cca=function(_0x120b93,_0x532248){_0x120b93=_0x120b93-0x0;var _0x49401b=_0xcca7[_0x120b93];return _0x49401b;};'use strict';var _=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var moment=require(_0x7cca('0x2'));var BPromise=require(_0x7cca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7cca('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7cca('0x5'))(_0x7cca('0x6'));var config=require(_0x7cca('0x7'));var jayson=require(_0x7cca('0x8'));var client=jayson[_0x7cca('0x9')][_0x7cca('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7cca('0xb')],{'host':_0x7cca('0xc'),'port':0x18eb});var socket=require(_0x7cca('0xd'))(new Redis(config[_0x7cca('0xb')]));require(_0x7cca('0xe'))[_0x7cca('0xf')](socket);function respondWithRpcPromise(_0x20ffa9,_0x2b8b62,_0x27323a){return new BPromise(function(_0x1a773e,_0x53b5f6){return client[_0x7cca('0x10')](_0x20ffa9,_0x27323a)[_0x7cca('0x11')](function(_0x275ab2){logger[_0x7cca('0x12')](_0x7cca('0x13'),_0x2b8b62,'request\x20sent');logger[_0x7cca('0x14')](_0x7cca('0x15'),_0x2b8b62,_0x7cca('0x16'),JSON['stringify'](_0x275ab2));if(_0x275ab2['error']){if(_0x275ab2[_0x7cca('0x17')][_0x7cca('0x18')]===0x1f4){logger[_0x7cca('0x17')](_0x7cca('0x13'),_0x2b8b62,_0x275ab2[_0x7cca('0x17')][_0x7cca('0x19')]);return _0x53b5f6(_0x275ab2[_0x7cca('0x17')]['message']);}logger[_0x7cca('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x2b8b62,_0x275ab2['error']['message']);return _0x1a773e(_0x275ab2[_0x7cca('0x17')][_0x7cca('0x19')]);}else{logger[_0x7cca('0x12')](_0x7cca('0x13'),_0x2b8b62,_0x7cca('0x16'));_0x1a773e(_0x275ab2['result'][_0x7cca('0x19')]);}})['catch'](function(_0x5d47f8){logger['error'](_0x7cca('0x13'),_0x2b8b62,_0x5d47f8);_0x53b5f6(_0x5d47f8);});});}exports[_0x7cca('0x1a')]=function(_0x2beb6c){var _0x1a20be=this;return new Promise(function(_0x36ba41,_0x45db2f){return db[_0x7cca('0x1b')][_0x7cca('0x1c')](_0x2beb6c['body'],{'raw':_0x2beb6c[_0x7cca('0x1d')]?_0x2beb6c[_0x7cca('0x1d')][_0x7cca('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2beb6c[_0x7cca('0x1d')]?_0x2beb6c['options'][_0x7cca('0x1f')]||null:null,'attributes':_0x2beb6c[_0x7cca('0x1d')]?_0x2beb6c[_0x7cca('0x1d')][_0x7cca('0x20')]||null:null,'limit':_0x2beb6c[_0x7cca('0x1d')]?_0x2beb6c[_0x7cca('0x1d')][_0x7cca('0x21')]||null:null})[_0x7cca('0x11')](function(_0x4b99b6){logger[_0x7cca('0x12')](_0x7cca('0x1a'),_0x2beb6c);logger[_0x7cca('0x14')](_0x7cca('0x1a'),_0x2beb6c,JSON[_0x7cca('0x22')](_0x4b99b6));_0x36ba41(_0x4b99b6);})[_0x7cca('0x23')](function(_0x35ebe8){logger[_0x7cca('0x17')]('UpdateOpenchannelInteraction',_0x35ebe8[_0x7cca('0x19')],_0x2beb6c);_0x45db2f(_0x1a20be['error'](0x1f4,_0x35ebe8[_0x7cca('0x19')]));});});};exports[_0x7cca('0x24')]=function(_0x5a87d6){return new Promise(function(_0x17b137,_0x3d91b1){return db['OpenchannelInteraction'][_0x7cca('0x25')]({'where':_0x5a87d6[_0x7cca('0x1d')]?_0x5a87d6[_0x7cca('0x1d')]['where']||null:null})['then'](function(_0x41f5bc){if(_0x41f5bc){return _0x41f5bc[_0x7cca('0x26')](_0x5a87d6[_0x7cca('0x27')][_0x7cca('0x28')],_[_0x7cca('0x29')](_0x5a87d6[_0x7cca('0x27')],[_0x7cca('0x28'),'id'])||{});}})['spread'](function(_0x5ac208){logger[_0x7cca('0x12')](_0x7cca('0x2a'),_0x5a87d6);logger[_0x7cca('0x14')]('AddTags',_0x5a87d6,JSON[_0x7cca('0x22')](_0x5ac208));_0x17b137(_0x5ac208);})['catch'](function(_0x2061fe){logger[_0x7cca('0x17')](_0x7cca('0x2a'),_0x2061fe[_0x7cca('0x19')],_0x5a87d6);_0x3d91b1(_this['error'](0x1f4,_0x2061fe[_0x7cca('0x19')]));});});}; \ No newline at end of file +var _0x71ab=['message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','attributes','limit','debug','AddTagsToOpenchannelInteraction','find','body','omit','spread','AddTags','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','request\x20sent','stringify','error'];(function(_0x297a24,_0x14cffd){var _0x192419=function(_0x54343c){while(--_0x54343c){_0x297a24['push'](_0x297a24['shift']());}};_0x192419(++_0x14cffd);}(_0x71ab,0x64));var _0xb71a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x71ab[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var moment=require('moment');var BPromise=require(_0xb71a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var utils=require(_0xb71a('0x4'));var logger=require(_0xb71a('0x5'))(_0xb71a('0x6'));var config=require(_0xb71a('0x7'));var jayson=require(_0xb71a('0x8'));var client=jayson[_0xb71a('0x9')][_0xb71a('0xa')]({'port':0x232a});config[_0xb71a('0xb')]=_[_0xb71a('0xc')](config[_0xb71a('0xb')],{'host':_0xb71a('0xd'),'port':0x18eb});var socket=require(_0xb71a('0xe'))(new Redis(config[_0xb71a('0xb')]));require(_0xb71a('0xf'))[_0xb71a('0x10')](socket);function respondWithRpcPromise(_0x2e8883,_0x517eed,_0xfec897){return new BPromise(function(_0x58956d,_0x3d7bd7){return client[_0xb71a('0x11')](_0x2e8883,_0xfec897)[_0xb71a('0x12')](function(_0x591311){logger[_0xb71a('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x517eed,_0xb71a('0x14'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x517eed,_0xb71a('0x14'),JSON[_0xb71a('0x15')](_0x591311));if(_0x591311[_0xb71a('0x16')]){if(_0x591311[_0xb71a('0x16')]['code']===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x517eed,_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);return _0x3d7bd7(_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);}logger[_0xb71a('0x16')](_0xb71a('0x18'),_0x517eed,_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);return _0x58956d(_0x591311[_0xb71a('0x16')]['message']);}else{logger[_0xb71a('0x13')](_0xb71a('0x18'),_0x517eed,_0xb71a('0x14'));_0x58956d(_0x591311[_0xb71a('0x19')][_0xb71a('0x17')]);}})[_0xb71a('0x1a')](function(_0x349de1){logger[_0xb71a('0x16')](_0xb71a('0x18'),_0x517eed,_0x349de1);_0x3d7bd7(_0x349de1);});});}exports[_0xb71a('0x1b')]=function(_0x16394a){var _0x494899=this;return new Promise(function(_0x5bb77a,_0x1358f2){return db[_0xb71a('0x1c')]['update'](_0x16394a['body'],{'raw':_0x16394a[_0xb71a('0x1d')]?_0x16394a['options'][_0xb71a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16394a[_0xb71a('0x1d')]?_0x16394a[_0xb71a('0x1d')][_0xb71a('0x1f')]||null:null,'attributes':_0x16394a[_0xb71a('0x1d')]?_0x16394a[_0xb71a('0x1d')][_0xb71a('0x20')]||null:null,'limit':_0x16394a[_0xb71a('0x1d')]?_0x16394a['options'][_0xb71a('0x21')]||null:null})[_0xb71a('0x12')](function(_0x353930){logger[_0xb71a('0x13')](_0xb71a('0x1b'),_0x16394a);logger[_0xb71a('0x22')](_0xb71a('0x1b'),_0x16394a,JSON[_0xb71a('0x15')](_0x353930));_0x5bb77a(_0x353930);})[_0xb71a('0x1a')](function(_0x2a847a){logger[_0xb71a('0x16')](_0xb71a('0x1b'),_0x2a847a[_0xb71a('0x17')],_0x16394a);_0x1358f2(_0x494899['error'](0x1f4,_0x2a847a[_0xb71a('0x17')]));});});};exports[_0xb71a('0x23')]=function(_0x1689ce){return new Promise(function(_0x358954,_0x2fbd73){return db[_0xb71a('0x1c')][_0xb71a('0x24')]({'where':_0x1689ce[_0xb71a('0x1d')]?_0x1689ce[_0xb71a('0x1d')][_0xb71a('0x1f')]||null:null})[_0xb71a('0x12')](function(_0x542ffd){if(_0x542ffd){return _0x542ffd['addTags'](_0x1689ce[_0xb71a('0x25')]['ids'],_[_0xb71a('0x26')](_0x1689ce[_0xb71a('0x25')],['ids','id'])||{});}})[_0xb71a('0x27')](function(_0xa42f25){logger[_0xb71a('0x13')](_0xb71a('0x28'),_0x1689ce);logger[_0xb71a('0x22')](_0xb71a('0x28'),_0x1689ce,JSON['stringify'](_0xa42f25));_0x358954(_0xa42f25);})[_0xb71a('0x1a')](function(_0x3f137a){logger[_0xb71a('0x16')](_0xb71a('0x28'),_0x3f137a['message'],_0x1689ce);_0x2fbd73(_this[_0xb71a('0x16')](0x1f4,_0x3f137a[_0xb71a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index e68cd08..21dda61 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 _0x09d3=['emit','removeListener','register','length','update'];(function(_0x1235d2,_0x404d33){var _0x5b0fdd=function(_0xfa4eb3){while(--_0xfa4eb3){_0x1235d2['push'](_0x1235d2['shift']());}};_0x5b0fdd(++_0x404d33);}(_0x09d3,0x1df));var _0x309d=function(_0x4975c5,_0x1ca463){_0x4975c5=_0x4975c5-0x0;var _0x5ebf72=_0x09d3[_0x4975c5];return _0x5ebf72;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save','remove',_0x309d('0x0')];function createListener(_0x35e95b,_0x531ceb){return function(_0x4e198c){_0x531ceb[_0x309d('0x1')](_0x35e95b,_0x4e198c);};}function removeListener(_0x42fe2f,_0x752c30){return function(){OpenchannelInteractionEvents[_0x309d('0x2')](_0x42fe2f,_0x752c30);};}exports[_0x309d('0x3')]=function(_0x1bf464){for(var _0x54eb14=0x0,_0x55dd42=events[_0x309d('0x4')];_0x54eb14<_0x55dd42;_0x54eb14++){var _0x7ce4b2=events[_0x54eb14];var _0x5cdcf6=createListener('openchannelInteraction:'+_0x7ce4b2,_0x1bf464);OpenchannelInteractionEvents['on'](_0x7ce4b2,_0x5cdcf6);}}; \ No newline at end of file +var _0xb4e3=['register','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit','removeListener'];(function(_0x152db2,_0x8dc4e4){var _0xd714ec=function(_0x8c0d70){while(--_0x8c0d70){_0x152db2['push'](_0x152db2['shift']());}};_0xd714ec(++_0x8dc4e4);}(_0xb4e3,0x1f2));var _0x3b4e=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xb4e3[_0x20c9b2];return _0x2c6030;};'use strict';var OpenchannelInteractionEvents=require(_0x3b4e('0x0'));var events=[_0x3b4e('0x1'),_0x3b4e('0x2'),_0x3b4e('0x3')];function createListener(_0x57b34f,_0x14dbb0){return function(_0x4a24e3){_0x14dbb0[_0x3b4e('0x4')](_0x57b34f,_0x4a24e3);};}function removeListener(_0xbd6200,_0x3fe35f){return function(){OpenchannelInteractionEvents[_0x3b4e('0x5')](_0xbd6200,_0x3fe35f);};}exports[_0x3b4e('0x6')]=function(_0x1e1f0c){for(var _0x420b85=0x0,_0x52769d=events['length'];_0x420b85<_0x52769d;_0x420b85++){var _0x43158f=events[_0x420b85];var _0x140e40=createListener(_0x3b4e('0x7')+_0x43158f,_0x1e1f0c);OpenchannelInteractionEvents['on'](_0x43158f,_0x140e40);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index f93847f..077be55 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 _0x24fe=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','multer','path'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0x24fe,0x1b8));var _0xe24f=function(_0x1a0691,_0x13368d){_0x1a0691=_0x1a0691-0x0;var _0x1edcaa=_0x24fe[_0x1a0691];return _0x1edcaa;};'use strict';var multer=require(_0xe24f('0x0'));var util=require('util');var path=require(_0xe24f('0x1'));var timeout=require(_0xe24f('0x2'));var express=require(_0xe24f('0x3'));var router=express[_0xe24f('0x4')]();var auth=require(_0xe24f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe24f('0x6'));var controller=require(_0xe24f('0x7'));router['get']('/',auth[_0xe24f('0x8')](),controller[_0xe24f('0x9')]);router[_0xe24f('0xa')](_0xe24f('0xb'),auth[_0xe24f('0x8')](),controller[_0xe24f('0xc')]);router[_0xe24f('0xa')](_0xe24f('0xd'),auth[_0xe24f('0x8')](),controller[_0xe24f('0xe')]);router[_0xe24f('0xf')]('/',auth['isAuthenticated'](),interaction[_0xe24f('0x10')](_0xe24f('0x11'),'openchannelmessage:create'),controller[_0xe24f('0x12')]);router[_0xe24f('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xe24f('0x14')]);router[_0xe24f('0x13')](_0xe24f('0x15'),auth[_0xe24f('0x8')](),controller[_0xe24f('0x16')]);router[_0xe24f('0x13')](_0xe24f('0x17'),auth[_0xe24f('0x8')](),controller[_0xe24f('0x18')]);router['delete']('/:id',auth[_0xe24f('0x8')](),controller[_0xe24f('0x19')]);module['exports']=router; \ No newline at end of file +var _0xed95=['../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','/describe','describe','/:id','tracked','openchannel','openchannelmessage:create','update','put','accept','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x21ca26,_0x200761){var _0x15d313=function(_0xaf0c5c){while(--_0xaf0c5c){_0x21ca26['push'](_0x21ca26['shift']());}};_0x15d313(++_0x200761);}(_0xed95,0xb9));var _0x5ed9=function(_0x3eae06,_0x33fa4e){_0x3eae06=_0x3eae06-0x0;var _0x49b4c1=_0xed95[_0x3eae06];return _0x49b4c1;};'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')]('/',auth[_0x5ed9('0xb')](),controller['index']);router['get'](_0x5ed9('0xc'),auth[_0x5ed9('0xb')](),controller[_0x5ed9('0xd')]);router[_0x5ed9('0xa')](_0x5ed9('0xe'),auth[_0x5ed9('0xb')](),controller['show']);router['post']('/',auth[_0x5ed9('0xb')](),interaction[_0x5ed9('0xf')](_0x5ed9('0x10'),_0x5ed9('0x11')),controller['create']);router['put'](_0x5ed9('0xe'),auth[_0x5ed9('0xb')](),controller[_0x5ed9('0x12')]);router[_0x5ed9('0x13')]('/:id/accept',auth[_0x5ed9('0xb')](),controller[_0x5ed9('0x14')]);router[_0x5ed9('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0x5ed9('0x15')]);router[_0x5ed9('0x16')]('/:id',auth[_0x5ed9('0xb')](),controller[_0x5ed9('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index a504f41..303ed14 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 _0x863c=['DATE','medium','BOOLEAN','ENUM','out'];(function(_0x871715,_0xa647ca){var _0x3d506a=function(_0x261164){while(--_0x261164){_0x871715['push'](_0x871715['shift']());}};_0x3d506a(++_0xa647ca);}(_0x863c,0x15f));var _0xc863=function(_0x4ef610,_0x9d7ea6){_0x4ef610=_0x4ef610-0x0;var _0x189282=_0x863c[_0x4ef610];return _0x189282;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xc863('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0xc863('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc863('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc863('0x2')]('in',_0xc863('0x3')),'defaultValue':_0xc863('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc863('0x4')]}}; \ No newline at end of file +var _0x224b=['out','DATE','exports','TEXT','BOOLEAN'];(function(_0x1b22bc,_0xe4edc9){var _0x11f4e8=function(_0x3aa000){while(--_0x3aa000){_0x1b22bc['push'](_0x1b22bc['shift']());}};_0x11f4e8(++_0xe4edc9);}(_0x224b,0x8e));var _0xb224=function(_0x38ba9c,_0x1daf18){_0x38ba9c=_0x38ba9c-0x0;var _0x4de41d=_0x224b[_0x38ba9c];return _0x4de41d;};'use strict';var Sequelize=require('sequelize');module[_0xb224('0x0')]={'body':{'type':Sequelize[_0xb224('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb224('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb224('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb224('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xb224('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 779fff9..1e96360 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 _0x1d66=['type','field','includeAll','include','OpenchannelMessage','rows','show','length','options','create','body','find','params','describe','../../config/logger','accept','openchannel','readAt','format','UserId','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','interface','channel','event','EventManager','acceptmessage','agent','get','role','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','stack','name','send','index','rawAttributes','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','where','merge'];(function(_0xd8a152,_0x497456){var _0x325f54=function(_0x44254a){while(--_0x44254a){_0xd8a152['push'](_0xd8a152['shift']());}};_0x325f54(++_0x497456);}(_0x1d66,0x189));var _0x61d6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1d66[_0x40a045];return _0x1a687c;};'use strict';var pdf=require(_0x61d6('0x0'));var emlformat=require(_0x61d6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x61d6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x61d6('0x3'));var BPromise=require(_0x61d6('0x4'));var Mustache=require(_0x61d6('0x5'));var util=require(_0x61d6('0x6'));var path=require(_0x61d6('0x7'));var sox=require(_0x61d6('0x8'));var csv=require('to-csv');var ejs=require(_0x61d6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x61d6('0xa'));var crypto=require(_0x61d6('0xb'));var jsforce=require(_0x61d6('0xc'));var deskjs=require(_0x61d6('0xd'));var toCsv=require(_0x61d6('0xe'));var querystring=require(_0x61d6('0xf'));var Papa=require('papaparse');var authService=require(_0x61d6('0x10'));var hardwareService=require(_0x61d6('0x11'));var Redis=require(_0x61d6('0x12'));var qs=require(_0x61d6('0x13'));var logger=require('../../config/logger')(_0x61d6('0x14'));var utils=require(_0x61d6('0x15'));var config=require(_0x61d6('0x16'));var db=require(_0x61d6('0x17'))['db'];config[_0x61d6('0x18')]=_[_0x61d6('0x19')](config[_0x61d6('0x18')],{'host':_0x61d6('0x1a'),'port':0x18eb});var socket=require(_0x61d6('0x1b'))(new Redis(config[_0x61d6('0x18')]));require(_0x61d6('0x1c'))[_0x61d6('0x1d')](socket);var jayson=require(_0x61d6('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x61d6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x259d90,_0x196950,_0x511eb7,_0x4d60a5){return new BPromise(function(_0x5523cf,_0xa9b52b){var _0x3384ba=_0x4d60a5||client;return _0x3384ba[_0x61d6('0x20')](_0x259d90,_0x511eb7)[_0x61d6('0x21')](function(_0xb64080){logger[_0x61d6('0x22')](_0x61d6('0x23'),_0x196950,_0x61d6('0x24'));logger[_0x61d6('0x25')](_0x61d6('0x26'),_0x196950,_0x61d6('0x24'),JSON[_0x61d6('0x27')](_0xb64080));if(_0xb64080[_0x61d6('0x28')]){if(_0xb64080[_0x61d6('0x28')][_0x61d6('0x29')]===0x1f4){logger[_0x61d6('0x28')](_0x61d6('0x23'),_0x196950,_0xb64080[_0x61d6('0x28')][_0x61d6('0x2a')]);return _0xa9b52b(_0xb64080[_0x61d6('0x28')]['message']);}logger[_0x61d6('0x28')](_0x61d6('0x23'),_0x196950,_0xb64080[_0x61d6('0x28')][_0x61d6('0x2a')]);return _0x5523cf(_0xb64080[_0x61d6('0x28')][_0x61d6('0x2a')]);}else{logger[_0x61d6('0x22')](_0x61d6('0x23'),_0x196950,_0x61d6('0x24'));_0x5523cf(_0xb64080['result']['message']);}})[_0x61d6('0x2b')](function(_0x5316a8){logger['error'](_0x61d6('0x23'),_0x196950,_0x5316a8);_0xa9b52b(_0x5316a8);});});}function respondWithStatusCode(_0x1dbcf3,_0x3a8d17){_0x3a8d17=_0x3a8d17||0xcc;return function(_0x5ba0b1){if(_0x5ba0b1){return _0x1dbcf3[_0x61d6('0x2c')](_0x3a8d17);}return _0x1dbcf3[_0x61d6('0x2d')](_0x3a8d17)[_0x61d6('0x2e')]();};}function respondWithResult(_0x5565da,_0x1bcd2a){_0x1bcd2a=_0x1bcd2a||0xc8;return function(_0x438fa8){if(_0x438fa8){return _0x5565da[_0x61d6('0x2d')](_0x1bcd2a)['json'](_0x438fa8);}};}function respondWithFilteredResult(_0x27ffbb,_0xdc5850){return function(_0x1a1c02){if(_0x1a1c02){var _0x528015=_0x1a1c02[_0x61d6('0x2f')],_0x467aba=_0xdc5850[_0x61d6('0x30')],_0x60e806=_0xdc5850[_0x61d6('0x30')]+_0xdc5850[_0x61d6('0x31')],_0xaaa23d;if(_0x60e806>=_0x528015){_0x60e806=_0x528015;_0xaaa23d=0xc8;}else{_0xaaa23d=0xce;}_0x27ffbb[_0x61d6('0x2d')](_0xaaa23d);return _0x27ffbb[_0x61d6('0x32')](_0x61d6('0x33'),_0x467aba+'-'+_0x60e806+'/'+_0x528015)[_0x61d6('0x34')](_0x1a1c02);}return null;};}function patchUpdates(_0x21af6a){return function(_0x2bc531){try{jsonpatch[_0x61d6('0x35')](_0x2bc531,_0x21af6a,!![]);}catch(_0x4894e9){return BPromise[_0x61d6('0x36')](_0x4894e9);}return _0x2bc531['save']();};}function saveUpdates(_0x299044,_0x265783){return function(_0x305cb5){if(_0x305cb5){return _0x305cb5[_0x61d6('0x37')](_0x299044)[_0x61d6('0x21')](function(_0x2981ac){return _0x2981ac;});}return null;};}function removeEntity(_0x3c787b,_0x244344){return function(_0x57df99){if(_0x57df99){return _0x57df99['destroy']()['then'](function(){_0x3c787b[_0x61d6('0x2d')](0xcc)[_0x61d6('0x2e')]();});}};}function handleEntityNotFound(_0x26e62d,_0x650575){return function(_0x195525){if(!_0x195525){_0x26e62d['sendStatus'](0x194);}return _0x195525;};}function handleError(_0x35f1cb,_0xb2a29b){_0xb2a29b=_0xb2a29b||0x1f4;return function(_0x5dedf1){logger[_0x61d6('0x28')](_0x5dedf1[_0x61d6('0x38')]);if(_0x5dedf1[_0x61d6('0x39')]){delete _0x5dedf1['name'];}_0x35f1cb[_0x61d6('0x2d')](_0xb2a29b)[_0x61d6('0x3a')](_0x5dedf1);};}exports[_0x61d6('0x3b')]=function(_0x1deac9,_0x35ed86){var _0x143c2d={},_0x502247={},_0x6dfcce={'count':0x0,'rows':[]};var _0x4562b7=db['OpenchannelMessage'][_0x61d6('0x3c')];_0x502247[_0x61d6('0x3d')]=_['keys'](_0x4562b7);_0x502247[_0x61d6('0x3e')]=_[_0x61d6('0x3f')](_0x1deac9[_0x61d6('0x3e')]);_0x502247[_0x61d6('0x40')]=_['intersection'](_0x502247['model'],_0x502247[_0x61d6('0x3e')]);_0x143c2d[_0x61d6('0x41')]=_[_0x61d6('0x42')](_0x502247[_0x61d6('0x3d')],qs['fields'](_0x1deac9[_0x61d6('0x3e')][_0x61d6('0x43')]));_0x143c2d['attributes']=_0x143c2d[_0x61d6('0x41')]['length']?_0x143c2d[_0x61d6('0x41')]:_0x502247[_0x61d6('0x3d')];if(!_0x1deac9[_0x61d6('0x3e')]['hasOwnProperty'](_0x61d6('0x44'))){_0x143c2d[_0x61d6('0x31')]=qs[_0x61d6('0x31')](_0x1deac9[_0x61d6('0x3e')][_0x61d6('0x31')]);_0x143c2d[_0x61d6('0x30')]=qs[_0x61d6('0x30')](_0x1deac9['query'][_0x61d6('0x30')]);}_0x143c2d[_0x61d6('0x45')]=qs[_0x61d6('0x46')](_0x1deac9['query'][_0x61d6('0x46')]);_0x143c2d['where']=qs[_0x61d6('0x40')](_[_0x61d6('0x47')](_0x1deac9[_0x61d6('0x3e')],_0x502247[_0x61d6('0x40')]));if(_0x1deac9[_0x61d6('0x3e')][_0x61d6('0x48')]){_0x143c2d[_0x61d6('0x49')]=_[_0x61d6('0x4a')](_0x143c2d['where'],{'$or':_['map'](_0x4562b7,function(_0x41bb27){if(_0x41bb27[_0x61d6('0x4b')]['key']!=='VIRTUAL'){var _0x234296={};_0x234296[_0x41bb27[_0x61d6('0x4c')]]={'$like':'%'+_0x1deac9['query'][_0x61d6('0x48')]+'%'};return _0x234296;}})});}_0x143c2d=_[_0x61d6('0x4a')]({},_0x143c2d,_0x1deac9['options']);var _0x2509e9={'where':_0x143c2d[_0x61d6('0x49')]};return db['OpenchannelMessage'][_0x61d6('0x2f')](_0x2509e9)[_0x61d6('0x21')](function(_0x1a7d9b){_0x6dfcce[_0x61d6('0x2f')]=_0x1a7d9b;if(_0x1deac9[_0x61d6('0x3e')][_0x61d6('0x4d')]){_0x143c2d[_0x61d6('0x4e')]=[{'all':!![]}];}return db[_0x61d6('0x4f')]['findAll'](_0x143c2d);})[_0x61d6('0x21')](function(_0x97863c){_0x6dfcce[_0x61d6('0x50')]=_0x97863c;return _0x6dfcce;})[_0x61d6('0x21')](respondWithFilteredResult(_0x35ed86,_0x143c2d))[_0x61d6('0x2b')](handleError(_0x35ed86,null));};exports[_0x61d6('0x51')]=function(_0x1f5f96,_0x4e9665){var _0x21ab8e={'raw':!![],'where':{'id':_0x1f5f96['params']['id']}},_0x1fc448={};_0x1fc448['model']=_['keys'](db['OpenchannelMessage'][_0x61d6('0x3c')]);_0x1fc448[_0x61d6('0x3e')]=_[_0x61d6('0x3f')](_0x1f5f96[_0x61d6('0x3e')]);_0x1fc448[_0x61d6('0x40')]=_['intersection'](_0x1fc448['model'],_0x1fc448[_0x61d6('0x3e')]);_0x21ab8e['attributes']=_[_0x61d6('0x42')](_0x1fc448[_0x61d6('0x3d')],qs[_0x61d6('0x43')](_0x1f5f96[_0x61d6('0x3e')][_0x61d6('0x43')]));_0x21ab8e[_0x61d6('0x41')]=_0x21ab8e[_0x61d6('0x41')][_0x61d6('0x52')]?_0x21ab8e['attributes']:_0x1fc448[_0x61d6('0x3d')];if(_0x1f5f96[_0x61d6('0x3e')]['includeAll']){_0x21ab8e[_0x61d6('0x4e')]=[{'all':!![]}];}_0x21ab8e=_['merge']({},_0x21ab8e,_0x1f5f96[_0x61d6('0x53')]);return db[_0x61d6('0x4f')]['find'](_0x21ab8e)[_0x61d6('0x21')](handleEntityNotFound(_0x4e9665,null))[_0x61d6('0x21')](respondWithResult(_0x4e9665,null))['catch'](handleError(_0x4e9665,null));};exports[_0x61d6('0x54')]=function(_0x1c1136,_0x3f7795){return db[_0x61d6('0x4f')]['create'](_0x1c1136['body'],{})[_0x61d6('0x21')](respondWithResult(_0x3f7795,0xc9))['catch'](handleError(_0x3f7795,null));};exports[_0x61d6('0x37')]=function(_0x35270e,_0x1d0105){if(_0x35270e[_0x61d6('0x55')]['id']){delete _0x35270e[_0x61d6('0x55')]['id'];}return db[_0x61d6('0x4f')][_0x61d6('0x56')]({'where':{'id':_0x35270e[_0x61d6('0x57')]['id']}})[_0x61d6('0x21')](handleEntityNotFound(_0x1d0105,null))[_0x61d6('0x21')](saveUpdates(_0x35270e[_0x61d6('0x55')],null))[_0x61d6('0x21')](respondWithResult(_0x1d0105,null))[_0x61d6('0x2b')](handleError(_0x1d0105,null));};exports['destroy']=function(_0x4e758e,_0x50710c){return db[_0x61d6('0x4f')][_0x61d6('0x56')]({'where':{'id':_0x4e758e[_0x61d6('0x57')]['id']}})[_0x61d6('0x21')](handleEntityNotFound(_0x50710c,null))[_0x61d6('0x21')](removeEntity(_0x50710c,null))[_0x61d6('0x2b')](handleError(_0x50710c,null));};exports[_0x61d6('0x58')]=function(_0x3b2ecc,_0x5b5fa1){return db[_0x61d6('0x4f')][_0x61d6('0x58')]()['then'](respondWithResult(_0x5b5fa1,null))[_0x61d6('0x2b')](handleError(_0x5b5fa1,null));};var interaction_log=require(_0x61d6('0x59'))('openchannel-interactions');exports[_0x61d6('0x5a')]=function(_0x36e13e,_0x48d538,_0x3f5b47){var _0x548d8d={'channel':_0x61d6('0x5b')};if(_0x36e13e[_0x61d6('0x55')]['id']){delete _0x36e13e[_0x61d6('0x55')]['id'];}_0x36e13e[_0x61d6('0x55')]['read']=!![];_0x36e13e['body'][_0x61d6('0x5c')]=moment()[_0x61d6('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x36e13e['body']['UserId']=_0x36e13e[_0x61d6('0x55')][_0x61d6('0x5e')]||_0x36e13e[_0x61d6('0x5f')]['id'];return db[_0x61d6('0x4f')][_0x61d6('0x56')]({'where':{'id':_0x36e13e[_0x61d6('0x57')]['id'],'UserId':null},'include':[{'model':db[_0x61d6('0x60')],'as':_0x61d6('0x61')}]})[_0x61d6('0x21')](handleEntityNotFound(_0x48d538,null))[_0x61d6('0x21')](saveUpdates(_0x36e13e[_0x61d6('0x55')],null))['then'](function(_0x4c038e){if(_0x4c038e){_0x548d8d[_0x61d6('0x2a')]=_0x4c038e['get']({'plain':!![]});return db[_0x61d6('0x62')]['find']({'where':{'id':_0x4c038e[_0x61d6('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x48d538,null))[_0x61d6('0x21')](function(_0x1d5bd8){if(_0x1d5bd8){return _0x1d5bd8['update']({'UserId':_0x36e13e[_0x61d6('0x55')][_0x61d6('0x5e')],'read1stAt':_[_0x61d6('0x64')](_0x1d5bd8[_0x61d6('0x65')])?moment()[_0x61d6('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x61d6('0x21')](function(_0x4af8f4){if(_0x4af8f4){_0x548d8d['interaction']=_0x4af8f4['get']({'plain':!![]});interaction_log[_0x61d6('0x22')](_0x61d6('0x66'),_0x36e13e[_0x61d6('0x5f')]['id'],_0x36e13e[_0x61d6('0x5f')][_0x61d6('0x39')],_0x36e13e[_0x61d6('0x5f')]['role'],_0x548d8d[_0x61d6('0x67')]['id'],_0x36e13e['body']?JSON[_0x61d6('0x27')](_0x36e13e['body']):_0x61d6('0x68'));return respondWithRpcPromise(_0x61d6('0x69'),'acceptMessage',_0x548d8d);}return null;})[_0x61d6('0x21')](function(_0x2806f4){if(_0x2806f4){if(_0x36e13e[_0x61d6('0x55')]['manual']){_0x548d8d[_0x61d6('0x2a')][_0x61d6('0x6a')]=util[_0x61d6('0x5d')]('SIP/%s',_0x36e13e['user'][_0x61d6('0x39')]);_0x548d8d[_0x61d6('0x2a')]['channel']=_0x548d8d[_0x61d6('0x6b')];_0x548d8d[_0x61d6('0x2a')][_0x61d6('0x6c')]=_0x61d6('0x5a');return respondWithRpcPromise(_0x61d6('0x6d'),'EventManager',{'event':_0x61d6('0x6e'),'message':_0x548d8d[_0x61d6('0x2a')]},client9002)[_0x61d6('0x21')](function(){return _0x548d8d;});}return _0x548d8d;}return null;})[_0x61d6('0x21')](respondWithResult(_0x48d538,null))[_0x61d6('0x2b')](handleError(_0x48d538,null));};var interaction_log=require(_0x61d6('0x59'))('openchannel-interactions');exports['reject']=function(_0x5f46b8,_0x4bbe47,_0x69b7a9){var _0x4b76e9={'agent':{},'channel':_0x61d6('0x5b')};if(_0x5f46b8[_0x61d6('0x55')]['id']){delete _0x5f46b8[_0x61d6('0x55')]['id'];}_0x5f46b8[_0x61d6('0x55')][_0x61d6('0x5e')]=_0x5f46b8['body'][_0x61d6('0x5e')]||_0x5f46b8['user']['id'];_0x4b76e9[_0x61d6('0x6f')]['id']=_0x5f46b8[_0x61d6('0x55')][_0x61d6('0x5e')];return db[_0x61d6('0x4f')][_0x61d6('0x56')]({'where':{'id':_0x5f46b8[_0x61d6('0x57')]['id'],'UserId':null}})[_0x61d6('0x21')](handleEntityNotFound(_0x4bbe47,null))[_0x61d6('0x21')](function(_0x281e08){if(_0x281e08){_0x4b76e9[_0x61d6('0x2a')]=_0x281e08[_0x61d6('0x70')]({'plain':!![]});return db['OpenchannelInteraction'][_0x61d6('0x56')]({'where':{'id':_0x281e08[_0x61d6('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x4bbe47,null))['then'](function(_0x4231cf){if(_0x4231cf){_0x4b76e9[_0x61d6('0x67')]=_0x4231cf[_0x61d6('0x70')]({'plain':!![]});interaction_log[_0x61d6('0x22')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5f46b8[_0x61d6('0x5f')]['id'],_0x5f46b8['user'][_0x61d6('0x39')],_0x5f46b8[_0x61d6('0x5f')][_0x61d6('0x71')],_0x4b76e9[_0x61d6('0x67')]['id'],_0x5f46b8[_0x61d6('0x55')]?JSON[_0x61d6('0x27')](_0x5f46b8[_0x61d6('0x55')]):_0x61d6('0x68'));return respondWithRpcPromise(_0x61d6('0x72'),_0x61d6('0x73'),_0x4b76e9);}return null;})[_0x61d6('0x21')](function(_0x5b9646){if(_0x5b9646){_0x5b9646[_0x61d6('0x2a')][_0x61d6('0x6a')]=util[_0x61d6('0x5d')]('SIP/%s',_0x5f46b8[_0x61d6('0x5f')]['name']);_0x5b9646[_0x61d6('0x2a')][_0x61d6('0x6b')]=_0x4b76e9[_0x61d6('0x6b')];_0x5b9646[_0x61d6('0x2a')][_0x61d6('0x6c')]=_0x61d6('0x36');respondWithRpcPromise(_0x61d6('0x6d'),_0x61d6('0x6d'),{'event':_0x61d6('0x74'),'message':_0x5b9646[_0x61d6('0x2a')]},client9002);return _0x4b76e9;}return null;})[_0x61d6('0x21')](respondWithResult(_0x4bbe47,null))['catch'](handleError(_0x4bbe47,null));}; \ No newline at end of file +var _0xb3b3=['hasOwnProperty','nolimit','limit','order','sort','where','merge','map','type','key','VIRTUAL','filter','includeAll','include','params','rawAttributes','find','create','body','openchannel-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','openchannel','agent','role','rejectmessage','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','index','OpenchannelMessage','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0xb3b3,0x11b));var _0x3b3b=function(_0xc7ca5f,_0x5eb60b){_0xc7ca5f=_0xc7ca5f-0x0;var _0x15bbea=_0xb3b3[_0xc7ca5f];return _0x15bbea;};'use strict';var pdf=require(_0x3b3b('0x0'));var emlformat=require(_0x3b3b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3b3b('0x2'));var rp=require(_0x3b3b('0x3'));var moment=require(_0x3b3b('0x4'));var BPromise=require(_0x3b3b('0x5'));var Mustache=require(_0x3b3b('0x6'));var util=require('util');var path=require(_0x3b3b('0x7'));var sox=require(_0x3b3b('0x8'));var csv=require('to-csv');var ejs=require(_0x3b3b('0x9'));var fs=require('fs');var _=require(_0x3b3b('0xa'));var squel=require(_0x3b3b('0xb'));var crypto=require(_0x3b3b('0xc'));var jsforce=require(_0x3b3b('0xd'));var deskjs=require(_0x3b3b('0xe'));var toCsv=require(_0x3b3b('0xf'));var querystring=require('querystring');var Papa=require(_0x3b3b('0x10'));var authService=require(_0x3b3b('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x3b3b('0x12'));var logger=require(_0x3b3b('0x13'))(_0x3b3b('0x14'));var utils=require(_0x3b3b('0x15'));var config=require(_0x3b3b('0x16'));var db=require(_0x3b3b('0x17'))['db'];config[_0x3b3b('0x18')]=_[_0x3b3b('0x19')](config[_0x3b3b('0x18')],{'host':_0x3b3b('0x1a'),'port':0x18eb});var socket=require(_0x3b3b('0x1b'))(new Redis(config[_0x3b3b('0x18')]));require(_0x3b3b('0x1c'))[_0x3b3b('0x1d')](socket);var jayson=require(_0x3b3b('0x1e'));var client=jayson[_0x3b3b('0x1f')][_0x3b3b('0x20')]({'port':0x232c});var client9002=jayson[_0x3b3b('0x1f')][_0x3b3b('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x46a948,_0x144d5f,_0x57a121,_0x436511){return new BPromise(function(_0x2c05b4,_0x4bb252){var _0x1be84b=_0x436511||client;return _0x1be84b[_0x3b3b('0x21')](_0x46a948,_0x57a121)[_0x3b3b('0x22')](function(_0x445914){logger[_0x3b3b('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x144d5f,_0x3b3b('0x24'));logger[_0x3b3b('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x144d5f,_0x3b3b('0x24'),JSON[_0x3b3b('0x26')](_0x445914));if(_0x445914[_0x3b3b('0x27')]){if(_0x445914[_0x3b3b('0x27')]['code']===0x1f4){logger[_0x3b3b('0x27')](_0x3b3b('0x28'),_0x144d5f,_0x445914['error']['message']);return _0x4bb252(_0x445914[_0x3b3b('0x27')]['message']);}logger[_0x3b3b('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x144d5f,_0x445914['error'][_0x3b3b('0x29')]);return _0x2c05b4(_0x445914[_0x3b3b('0x27')][_0x3b3b('0x29')]);}else{logger['info'](_0x3b3b('0x28'),_0x144d5f,'request\x20sent');_0x2c05b4(_0x445914[_0x3b3b('0x2a')][_0x3b3b('0x29')]);}})[_0x3b3b('0x2b')](function(_0x201dc3){logger[_0x3b3b('0x27')](_0x3b3b('0x28'),_0x144d5f,_0x201dc3);_0x4bb252(_0x201dc3);});});}function respondWithStatusCode(_0xc4d036,_0x56949a){_0x56949a=_0x56949a||0xcc;return function(_0x2c84b4){if(_0x2c84b4){return _0xc4d036[_0x3b3b('0x2c')](_0x56949a);}return _0xc4d036[_0x3b3b('0x2d')](_0x56949a)[_0x3b3b('0x2e')]();};}function respondWithResult(_0x2d4b8a,_0x2d9b72){_0x2d9b72=_0x2d9b72||0xc8;return function(_0x2ea225){if(_0x2ea225){return _0x2d4b8a[_0x3b3b('0x2d')](_0x2d9b72)[_0x3b3b('0x2f')](_0x2ea225);}};}function respondWithFilteredResult(_0x3d7862,_0xf8122e){return function(_0x539d5d){if(_0x539d5d){var _0x283ec7=_0x539d5d[_0x3b3b('0x30')],_0x21f9ed=_0xf8122e[_0x3b3b('0x31')],_0x14b997=_0xf8122e['offset']+_0xf8122e['limit'],_0x4846c5;if(_0x14b997>=_0x283ec7){_0x14b997=_0x283ec7;_0x4846c5=0xc8;}else{_0x4846c5=0xce;}_0x3d7862[_0x3b3b('0x2d')](_0x4846c5);return _0x3d7862['set'](_0x3b3b('0x32'),_0x21f9ed+'-'+_0x14b997+'/'+_0x283ec7)[_0x3b3b('0x2f')](_0x539d5d);}return null;};}function patchUpdates(_0x4cef7f){return function(_0x208ce2){try{jsonpatch[_0x3b3b('0x33')](_0x208ce2,_0x4cef7f,!![]);}catch(_0x4702dd){return BPromise[_0x3b3b('0x34')](_0x4702dd);}return _0x208ce2[_0x3b3b('0x35')]();};}function saveUpdates(_0x59b827,_0xf5feba){return function(_0x2ee343){if(_0x2ee343){return _0x2ee343[_0x3b3b('0x36')](_0x59b827)['then'](function(_0x57bb44){return _0x57bb44;});}return null;};}function removeEntity(_0x119006,_0x350902){return function(_0x58cfdf){if(_0x58cfdf){return _0x58cfdf[_0x3b3b('0x37')]()['then'](function(){_0x119006[_0x3b3b('0x2d')](0xcc)[_0x3b3b('0x2e')]();});}};}function handleEntityNotFound(_0x3b4ae9,_0x3de745){return function(_0x1f7df1){if(!_0x1f7df1){_0x3b4ae9['sendStatus'](0x194);}return _0x1f7df1;};}function handleError(_0x1d6af5,_0x3b8c91){_0x3b8c91=_0x3b8c91||0x1f4;return function(_0x1b8b5e){logger[_0x3b3b('0x27')](_0x1b8b5e[_0x3b3b('0x38')]);if(_0x1b8b5e[_0x3b3b('0x39')]){delete _0x1b8b5e[_0x3b3b('0x39')];}_0x1d6af5['status'](_0x3b8c91)['send'](_0x1b8b5e);};}exports[_0x3b3b('0x3a')]=function(_0x511a7c,_0x3358c3){var _0x488e9e={},_0x16df55={},_0x2f2a31={'count':0x0,'rows':[]};var _0x3ead3a=db[_0x3b3b('0x3b')]['rawAttributes'];_0x16df55[_0x3b3b('0x3c')]=_[_0x3b3b('0x3d')](_0x3ead3a);_0x16df55[_0x3b3b('0x3e')]=_[_0x3b3b('0x3d')](_0x511a7c[_0x3b3b('0x3e')]);_0x16df55[_0x3b3b('0x3f')]=_[_0x3b3b('0x40')](_0x16df55['model'],_0x16df55[_0x3b3b('0x3e')]);_0x488e9e[_0x3b3b('0x41')]=_[_0x3b3b('0x40')](_0x16df55['model'],qs['fields'](_0x511a7c[_0x3b3b('0x3e')][_0x3b3b('0x42')]));_0x488e9e[_0x3b3b('0x41')]=_0x488e9e['attributes'][_0x3b3b('0x43')]?_0x488e9e[_0x3b3b('0x41')]:_0x16df55[_0x3b3b('0x3c')];if(!_0x511a7c[_0x3b3b('0x3e')][_0x3b3b('0x44')](_0x3b3b('0x45'))){_0x488e9e[_0x3b3b('0x46')]=qs['limit'](_0x511a7c[_0x3b3b('0x3e')][_0x3b3b('0x46')]);_0x488e9e[_0x3b3b('0x31')]=qs[_0x3b3b('0x31')](_0x511a7c[_0x3b3b('0x3e')][_0x3b3b('0x31')]);}_0x488e9e[_0x3b3b('0x47')]=qs[_0x3b3b('0x48')](_0x511a7c[_0x3b3b('0x3e')][_0x3b3b('0x48')]);_0x488e9e[_0x3b3b('0x49')]=qs['filters'](_['pick'](_0x511a7c[_0x3b3b('0x3e')],_0x16df55[_0x3b3b('0x3f')]));if(_0x511a7c[_0x3b3b('0x3e')]['filter']){_0x488e9e[_0x3b3b('0x49')]=_[_0x3b3b('0x4a')](_0x488e9e[_0x3b3b('0x49')],{'$or':_[_0x3b3b('0x4b')](_0x3ead3a,function(_0x251442){if(_0x251442[_0x3b3b('0x4c')][_0x3b3b('0x4d')]!==_0x3b3b('0x4e')){var _0x2aabd8={};_0x2aabd8[_0x251442['field']]={'$like':'%'+_0x511a7c[_0x3b3b('0x3e')][_0x3b3b('0x4f')]+'%'};return _0x2aabd8;}})});}_0x488e9e=_[_0x3b3b('0x4a')]({},_0x488e9e,_0x511a7c['options']);var _0x463425={'where':_0x488e9e['where']};return db[_0x3b3b('0x3b')][_0x3b3b('0x30')](_0x463425)[_0x3b3b('0x22')](function(_0x22e059){_0x2f2a31['count']=_0x22e059;if(_0x511a7c['query'][_0x3b3b('0x50')]){_0x488e9e[_0x3b3b('0x51')]=[{'all':!![]}];}return db[_0x3b3b('0x3b')]['findAll'](_0x488e9e);})[_0x3b3b('0x22')](function(_0x1f1f2f){_0x2f2a31['rows']=_0x1f1f2f;return _0x2f2a31;})[_0x3b3b('0x22')](respondWithFilteredResult(_0x3358c3,_0x488e9e))[_0x3b3b('0x2b')](handleError(_0x3358c3,null));};exports['show']=function(_0x1ea701,_0x139328){var _0x15d466={'raw':!![],'where':{'id':_0x1ea701[_0x3b3b('0x52')]['id']}},_0x72e7f9={};_0x72e7f9['model']=_['keys'](db[_0x3b3b('0x3b')][_0x3b3b('0x53')]);_0x72e7f9['query']=_[_0x3b3b('0x3d')](_0x1ea701[_0x3b3b('0x3e')]);_0x72e7f9[_0x3b3b('0x3f')]=_[_0x3b3b('0x40')](_0x72e7f9['model'],_0x72e7f9[_0x3b3b('0x3e')]);_0x15d466[_0x3b3b('0x41')]=_[_0x3b3b('0x40')](_0x72e7f9['model'],qs[_0x3b3b('0x42')](_0x1ea701['query'][_0x3b3b('0x42')]));_0x15d466[_0x3b3b('0x41')]=_0x15d466['attributes'][_0x3b3b('0x43')]?_0x15d466[_0x3b3b('0x41')]:_0x72e7f9[_0x3b3b('0x3c')];if(_0x1ea701[_0x3b3b('0x3e')][_0x3b3b('0x50')]){_0x15d466[_0x3b3b('0x51')]=[{'all':!![]}];}_0x15d466=_['merge']({},_0x15d466,_0x1ea701['options']);return db['OpenchannelMessage'][_0x3b3b('0x54')](_0x15d466)[_0x3b3b('0x22')](handleEntityNotFound(_0x139328,null))[_0x3b3b('0x22')](respondWithResult(_0x139328,null))['catch'](handleError(_0x139328,null));};exports[_0x3b3b('0x55')]=function(_0x57fefb,_0x16cd81){return db[_0x3b3b('0x3b')][_0x3b3b('0x55')](_0x57fefb[_0x3b3b('0x56')],{})[_0x3b3b('0x22')](respondWithResult(_0x16cd81,0xc9))[_0x3b3b('0x2b')](handleError(_0x16cd81,null));};exports[_0x3b3b('0x36')]=function(_0x33e523,_0x15c2c6){if(_0x33e523[_0x3b3b('0x56')]['id']){delete _0x33e523[_0x3b3b('0x56')]['id'];}return db[_0x3b3b('0x3b')]['find']({'where':{'id':_0x33e523[_0x3b3b('0x52')]['id']}})[_0x3b3b('0x22')](handleEntityNotFound(_0x15c2c6,null))['then'](saveUpdates(_0x33e523[_0x3b3b('0x56')],null))['then'](respondWithResult(_0x15c2c6,null))['catch'](handleError(_0x15c2c6,null));};exports[_0x3b3b('0x37')]=function(_0x2f8100,_0x448181){return db[_0x3b3b('0x3b')]['find']({'where':{'id':_0x2f8100['params']['id']}})[_0x3b3b('0x22')](handleEntityNotFound(_0x448181,null))['then'](removeEntity(_0x448181,null))['catch'](handleError(_0x448181,null));};exports['describe']=function(_0x1ef00c,_0x3fa505){return db[_0x3b3b('0x3b')]['describe']()[_0x3b3b('0x22')](respondWithResult(_0x3fa505,null))['catch'](handleError(_0x3fa505,null));};var interaction_log=require(_0x3b3b('0x13'))(_0x3b3b('0x57'));exports['accept']=function(_0x8a4510,_0x247976,_0x483e84){var _0x16010e={'channel':'openchannel'};if(_0x8a4510['body']['id']){delete _0x8a4510[_0x3b3b('0x56')]['id'];}_0x8a4510[_0x3b3b('0x56')][_0x3b3b('0x58')]=!![];_0x8a4510['body'][_0x3b3b('0x59')]=moment()[_0x3b3b('0x5a')](_0x3b3b('0x5b'));_0x8a4510[_0x3b3b('0x56')]['UserId']=_0x8a4510[_0x3b3b('0x56')][_0x3b3b('0x5c')]||_0x8a4510['user']['id'];return db['OpenchannelMessage'][_0x3b3b('0x54')]({'where':{'id':_0x8a4510['params']['id'],'UserId':null},'include':[{'model':db[_0x3b3b('0x5d')],'as':_0x3b3b('0x5e')}]})[_0x3b3b('0x22')](handleEntityNotFound(_0x247976,null))[_0x3b3b('0x22')](saveUpdates(_0x8a4510[_0x3b3b('0x56')],null))[_0x3b3b('0x22')](function(_0x1605c4){if(_0x1605c4){_0x16010e['message']=_0x1605c4[_0x3b3b('0x5f')]({'plain':!![]});return db[_0x3b3b('0x60')][_0x3b3b('0x54')]({'where':{'id':_0x1605c4[_0x3b3b('0x61')]}});}return null;})[_0x3b3b('0x22')](handleEntityNotFound(_0x247976,null))[_0x3b3b('0x22')](function(_0x1ffe0b){if(_0x1ffe0b){return _0x1ffe0b[_0x3b3b('0x36')]({'UserId':_0x8a4510[_0x3b3b('0x56')][_0x3b3b('0x5c')],'read1stAt':_['isNil'](_0x1ffe0b[_0x3b3b('0x62')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3b3b('0x22')](function(_0x412cd9){if(_0x412cd9){_0x16010e[_0x3b3b('0x63')]=_0x412cd9[_0x3b3b('0x5f')]({'plain':!![]});interaction_log[_0x3b3b('0x23')](_0x3b3b('0x64'),_0x8a4510[_0x3b3b('0x65')]['id'],_0x8a4510[_0x3b3b('0x65')][_0x3b3b('0x39')],_0x8a4510[_0x3b3b('0x65')]['role'],_0x16010e[_0x3b3b('0x63')]['id'],_0x8a4510[_0x3b3b('0x56')]?JSON['stringify'](_0x8a4510[_0x3b3b('0x56')]):_0x3b3b('0x66'));return respondWithRpcPromise(_0x3b3b('0x67'),_0x3b3b('0x68'),_0x16010e);}return null;})[_0x3b3b('0x22')](function(_0x4fe5eb){if(_0x4fe5eb){if(_0x8a4510[_0x3b3b('0x56')][_0x3b3b('0x69')]){_0x16010e[_0x3b3b('0x29')][_0x3b3b('0x6a')]=util[_0x3b3b('0x5a')](_0x3b3b('0x6b'),_0x8a4510[_0x3b3b('0x65')]['name']);_0x16010e['message'][_0x3b3b('0x6c')]=_0x16010e[_0x3b3b('0x6c')];_0x16010e[_0x3b3b('0x29')][_0x3b3b('0x6d')]=_0x3b3b('0x6e');return respondWithRpcPromise(_0x3b3b('0x6f'),_0x3b3b('0x6f'),{'event':_0x3b3b('0x70'),'message':_0x16010e[_0x3b3b('0x29')]},client9002)['then'](function(){return _0x16010e;});}return _0x16010e;}return null;})['then'](respondWithResult(_0x247976,null))[_0x3b3b('0x2b')](handleError(_0x247976,null));};var interaction_log=require(_0x3b3b('0x13'))('openchannel-interactions');exports[_0x3b3b('0x34')]=function(_0x52c8e8,_0x4e9caf,_0x1d9231){var _0x3f4026={'agent':{},'channel':_0x3b3b('0x71')};if(_0x52c8e8[_0x3b3b('0x56')]['id']){delete _0x52c8e8[_0x3b3b('0x56')]['id'];}_0x52c8e8[_0x3b3b('0x56')][_0x3b3b('0x5c')]=_0x52c8e8[_0x3b3b('0x56')]['UserId']||_0x52c8e8[_0x3b3b('0x65')]['id'];_0x3f4026[_0x3b3b('0x72')]['id']=_0x52c8e8[_0x3b3b('0x56')]['UserId'];return db['OpenchannelMessage'][_0x3b3b('0x54')]({'where':{'id':_0x52c8e8[_0x3b3b('0x52')]['id'],'UserId':null}})[_0x3b3b('0x22')](handleEntityNotFound(_0x4e9caf,null))[_0x3b3b('0x22')](function(_0xcbf506){if(_0xcbf506){_0x3f4026[_0x3b3b('0x29')]=_0xcbf506[_0x3b3b('0x5f')]({'plain':!![]});return db[_0x3b3b('0x60')]['find']({'where':{'id':_0xcbf506[_0x3b3b('0x61')]}});}return null;})[_0x3b3b('0x22')](handleEntityNotFound(_0x4e9caf,null))[_0x3b3b('0x22')](function(_0x447ef5){if(_0x447ef5){_0x3f4026[_0x3b3b('0x63')]=_0x447ef5[_0x3b3b('0x5f')]({'plain':!![]});interaction_log[_0x3b3b('0x23')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x52c8e8[_0x3b3b('0x65')]['id'],_0x52c8e8[_0x3b3b('0x65')][_0x3b3b('0x39')],_0x52c8e8[_0x3b3b('0x65')][_0x3b3b('0x73')],_0x3f4026[_0x3b3b('0x63')]['id'],_0x52c8e8[_0x3b3b('0x56')]?JSON[_0x3b3b('0x26')](_0x52c8e8['body']):_0x3b3b('0x66'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x3f4026);}return null;})[_0x3b3b('0x22')](function(_0x36ee95){if(_0x36ee95){_0x36ee95[_0x3b3b('0x29')][_0x3b3b('0x6a')]=util['format'](_0x3b3b('0x6b'),_0x52c8e8['user'][_0x3b3b('0x39')]);_0x36ee95[_0x3b3b('0x29')][_0x3b3b('0x6c')]=_0x3f4026[_0x3b3b('0x6c')];_0x36ee95[_0x3b3b('0x29')][_0x3b3b('0x6d')]=_0x3b3b('0x34');respondWithRpcPromise(_0x3b3b('0x6f'),'EventManager',{'event':_0x3b3b('0x74'),'message':_0x36ee95[_0x3b3b('0x29')]},client9002);return _0x3f4026;}return null;})[_0x3b3b('0x22')](respondWithResult(_0x4e9caf,null))['catch'](handleError(_0x4e9caf,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index ebfdb25..a8ac3e1 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 _0xf26c=['hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0x8030c4,_0x5366df){var _0xd4864e=function(_0x4fad5f){while(--_0x4fad5f){_0x8030c4['push'](_0x8030c4['shift']());}};_0xd4864e(++_0x5366df);}(_0xf26c,0x1b0));var _0xcf26=function(_0x1892b1,_0xbc71a0){_0x1892b1=_0x1892b1-0x0;var _0x5f03cb=_0xf26c[_0x1892b1];return _0x5f03cb;};'use strict';var EventEmitter=require(_0xcf26('0x0'));var OpenchannelMessage=require(_0xcf26('0x1'))['db'][_0xcf26('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xcf26('0x3')](0x0);var events={'afterCreate':_0xcf26('0x4'),'afterUpdate':_0xcf26('0x5'),'afterDestroy':_0xcf26('0x6')};function emitEvent(_0x3d12f7){return function(_0x38fa91,_0x1728f3,_0x5a6684){OpenchannelMessageEvents[_0xcf26('0x7')](_0x3d12f7+':'+_0x38fa91['id'],_0x38fa91);OpenchannelMessageEvents[_0xcf26('0x7')](_0x3d12f7,_0x38fa91);_0x5a6684(null);};}for(var e in events){if(events[_0xcf26('0x8')](e)){var event=events[e];OpenchannelMessage[_0xcf26('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x0cee=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','emit'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x0cee,0x12f));var _0xe0ce=function(_0x12881f,_0x51cbb0){_0x12881f=_0x12881f-0x0;var _0xe88b03=_0x0cee[_0x12881f];return _0xe88b03;};'use strict';var EventEmitter=require(_0xe0ce('0x0'));var OpenchannelMessage=require(_0xe0ce('0x1'))['db'][_0xe0ce('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xe0ce('0x3')](0x0);var events={'afterCreate':_0xe0ce('0x4'),'afterUpdate':_0xe0ce('0x5'),'afterDestroy':'remove'};function emitEvent(_0x563553){return function(_0xe181aa,_0x3e377b,_0xe84b07){OpenchannelMessageEvents[_0xe0ce('0x6')](_0x563553+':'+_0xe181aa['id'],_0xe181aa);OpenchannelMessageEvents[_0xe0ce('0x6')](_0x563553,_0xe181aa);_0xe84b07(null);};}for(var e in events){if(events[_0xe0ce('0x7')](e)){var event=events[e];OpenchannelMessage[_0xe0ce('0x8')](e,emitEvent(event));}}module[_0xe0ce('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index ce3bc33..cf57550 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 _0x1169=['info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','catch','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','./openchannelMessage.attributes','openchannel_messages','models','get','toLowerCase','direction','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','createdAt','body','error','CmContact','OpenchannelAccount','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','replyUri'];(function(_0x13b7fd,_0x4eaf7f){var _0x32a74a=function(_0x2c5d80){while(--_0x2c5d80){_0x13b7fd['push'](_0x13b7fd['shift']());}};_0x32a74a(++_0x4eaf7f);}(_0x1169,0x68));var _0x9116=function(_0x3d929e,_0x1efd7c){_0x3d929e=_0x3d929e-0x0;var _0x3bc395=_0x1169[_0x3d929e];return _0x3bc395;};'use strict';var _=require(_0x9116('0x0'));var util=require(_0x9116('0x1'));var logger=require('../../config/logger')(_0x9116('0x2'));var moment=require('moment');var BPromise=require(_0x9116('0x3'));var rp=require(_0x9116('0x4'));var attributes=require(_0x9116('0x5'));module['exports']=function(_0x199bdf,_0x24c32b){return _0x199bdf['define']('OpenchannelMessage',attributes,{'tableName':_0x9116('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xce8dec,_0xe0fe69,_0x1061f3){var _0x19e723=_0x199bdf[_0x9116('0x7')];var _0x4fcf6c=_0xce8dec[_0x9116('0x8')]({'plain':!![]});if(_0x4fcf6c['direction'][_0x9116('0x9')]()==='in'||_0x4fcf6c[_0x9116('0xa')]['toLowerCase']()===_0x9116('0xb')&&!_0x4fcf6c[_0x9116('0xc')]&&!_[_0x9116('0xd')](_0x4fcf6c[_0x9116('0xe')])){_0x19e723['OpenchannelInteraction'][_0x9116('0xf')]({'where':{'id':_0x4fcf6c[_0x9116('0x10')]}})[_0x9116('0x11')](function(_0x3fec78){if(_0x3fec78){_0x3fec78['update']({'lastMsgAt':_0x4fcf6c[_0x9116('0x12')],'lastMsgDirection':_0x4fcf6c[_0x9116('0xa')]['toLowerCase'](),'lastMsgBody':_0x4fcf6c[_0x9116('0x13')]});}})['catch'](function(_0x255407){console[_0x9116('0x14')](_0x255407);});}if(_0x4fcf6c['direction']==='out'&&!_0x4fcf6c[_0x9116('0xc')]){var _0x3a623e;_0x19e723[_0x9116('0x15')]['describe']()[_0x9116('0x11')](function(_0x4e0131){return _0x19e723[_0x9116('0x16')]['find']({'where':{'id':_0x4fcf6c[_0x9116('0x17')]},'include':[{'model':_0x19e723[_0x9116('0x18')],'as':_0x9116('0x19'),'where':{'id':_0x4fcf6c['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x19e723[_0x9116('0x15')],'as':_0x9116('0x1a'),'attributes':_['keys'](_0x4e0131)}]}]});})[_0x9116('0x11')](function(_0x4b8040){_0x3a623e=_0x4b8040['get']({'plain':!![]});if(_0x3a623e&&_0x3a623e[_0x9116('0x1b')]){logger[_0x9116('0x1c')](_0x9116('0x1d'),_0x9116('0x1e'),util[_0x9116('0x1f')](_0x9116('0x20'),_0x4fcf6c['id'],_0x3a623e[_0x9116('0x1b')]));if(_0x3a623e[_0x9116('0x19')]&&_0x3a623e[_0x9116('0x19')][_0x9116('0x21')]){_0x4fcf6c['Interaction']=_['omit'](_0x3a623e[_0x9116('0x19')][0x0],'Contact');_0x4fcf6c['Contact']=_0x3a623e[_0x9116('0x19')][0x0][_0x9116('0x1a')];}var _0xe0fe69={'method':_0x9116('0x22'),'uri':encodeURI(_0x3a623e[_0x9116('0x1b')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0xe0fe69[_0x9116('0x23')]){case _0x9116('0x24'):_0xe0fe69['qs']=_0x4fcf6c;break;case'POST':_0xe0fe69[_0x9116('0x13')]=_0x4fcf6c;break;}return rp(_0xe0fe69)[_0x9116('0x11')](function(_0x151ae7){logger[_0x9116('0x1c')](_0x9116('0x1d'),_0x9116('0x1e'),util[_0x9116('0x1f')](_0x9116('0x25'),_0x4fcf6c['id'],_0x3a623e['replyUri']));if(_0x151ae7[_0x9116('0x13')][_0x9116('0x26')]&&_0x151ae7[_0x9116('0x13')]['threadId']!=_0x4fcf6c['Interaction']['threadId']){return _0x19e723[_0x9116('0x18')][_0x9116('0x27')]({'threadId':_0x151ae7['body'][_0x9116('0x26')]},{'logging':!![],'where':{'id':_0x4fcf6c['Interaction']['id']}});}else{return;}})[_0x9116('0x11')](function(){return _0xce8dec['update']({'read':!![]});})[_0x9116('0x28')](function(_0x1036c1){logger[_0x9116('0x14')](_0x9116('0x1d'),_0x9116('0x1e'),util[_0x9116('0x29')](_0x1036c1,{'showHidden':![],'depth':null}));_0x1061f3();});}else{_0x1061f3();}})['finally'](function(){_0x1061f3();});}else{_0x1061f3();}}},'charset':_0x9116('0x2a'),'collate':_0x9116('0x2b')});}; \ No newline at end of file +var _0xc7ed=['update','createdAt','catch','error','CmContact','OpenchannelAccount','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','GET','threadId','body','Interaction','inspect','finally','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','./openchannelMessage.attributes','exports','define','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then'];(function(_0x4643ae,_0x588d99){var _0x59ccef=function(_0x41879c){while(--_0x41879c){_0x4643ae['push'](_0x4643ae['shift']());}};_0x59ccef(++_0x588d99);}(_0xc7ed,0x164));var _0xdc7e=function(_0xb14376,_0x5b0bf2){_0xb14376=_0xb14376-0x0;var _0x232f52=_0xc7ed[_0xb14376];return _0x232f52;};'use strict';var _=require(_0xdc7e('0x0'));var util=require(_0xdc7e('0x1'));var logger=require(_0xdc7e('0x2'))(_0xdc7e('0x3'));var moment=require('moment');var BPromise=require(_0xdc7e('0x4'));var rp=require(_0xdc7e('0x5'));var attributes=require(_0xdc7e('0x6'));module[_0xdc7e('0x7')]=function(_0x459ec5,_0x3a1fbd){return _0x459ec5[_0xdc7e('0x8')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x34651c,_0x559be0,_0x496bc9){var _0x2539f0=_0x459ec5[_0xdc7e('0x9')];var _0x418851=_0x34651c[_0xdc7e('0xa')]({'plain':!![]});if(_0x418851[_0xdc7e('0xb')][_0xdc7e('0xc')]()==='in'||_0x418851['direction'][_0xdc7e('0xc')]()===_0xdc7e('0xd')&&!_0x418851[_0xdc7e('0xe')]&&!_[_0xdc7e('0xf')](_0x418851[_0xdc7e('0x10')])){_0x2539f0[_0xdc7e('0x11')]['findOne']({'where':{'id':_0x418851[_0xdc7e('0x12')]}})[_0xdc7e('0x13')](function(_0x12f5df){if(_0x12f5df){_0x12f5df[_0xdc7e('0x14')]({'lastMsgAt':_0x418851[_0xdc7e('0x15')],'lastMsgDirection':_0x418851[_0xdc7e('0xb')][_0xdc7e('0xc')](),'lastMsgBody':_0x418851['body']});}})[_0xdc7e('0x16')](function(_0x474265){console[_0xdc7e('0x17')](_0x474265);});}if(_0x418851[_0xdc7e('0xb')]===_0xdc7e('0xd')&&!_0x418851[_0xdc7e('0xe')]){var _0x337b45;_0x2539f0[_0xdc7e('0x18')]['describe']()[_0xdc7e('0x13')](function(_0x514a0b){return _0x2539f0[_0xdc7e('0x19')]['find']({'where':{'id':_0x418851[_0xdc7e('0x1a')]},'include':[{'model':_0x2539f0[_0xdc7e('0x11')],'as':_0xdc7e('0x1b'),'where':{'id':_0x418851[_0xdc7e('0x12')]},'limit':0x1,'include':[{'model':_0x2539f0[_0xdc7e('0x18')],'as':_0xdc7e('0x1c'),'attributes':_[_0xdc7e('0x1d')](_0x514a0b)}]}]});})[_0xdc7e('0x13')](function(_0x57946c){_0x337b45=_0x57946c[_0xdc7e('0xa')]({'plain':!![]});if(_0x337b45&&_0x337b45[_0xdc7e('0x1e')]){logger[_0xdc7e('0x1f')](_0xdc7e('0x20'),_0xdc7e('0x21'),util[_0xdc7e('0x22')](_0xdc7e('0x23'),_0x418851['id'],_0x337b45[_0xdc7e('0x1e')]));if(_0x337b45[_0xdc7e('0x1b')]&&_0x337b45['Interactions'][_0xdc7e('0x24')]){_0x418851['Interaction']=_[_0xdc7e('0x25')](_0x337b45[_0xdc7e('0x1b')][0x0],_0xdc7e('0x1c'));_0x418851['Contact']=_0x337b45['Interactions'][0x0][_0xdc7e('0x1c')];}var _0x559be0={'method':_0xdc7e('0x26'),'uri':encodeURI(_0x337b45[_0xdc7e('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x559be0[_0xdc7e('0x27')]){case _0xdc7e('0x28'):_0x559be0['qs']=_0x418851;break;case _0xdc7e('0x26'):_0x559be0['body']=_0x418851;break;}return rp(_0x559be0)[_0xdc7e('0x13')](function(_0x469ac7){logger['info'](_0xdc7e('0x20'),_0xdc7e('0x21'),util[_0xdc7e('0x22')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x418851['id'],_0x337b45[_0xdc7e('0x1e')]));if(_0x469ac7['body'][_0xdc7e('0x29')]&&_0x469ac7[_0xdc7e('0x2a')]['threadId']!=_0x418851[_0xdc7e('0x2b')][_0xdc7e('0x29')]){return _0x2539f0['OpenchannelInteraction'][_0xdc7e('0x14')]({'threadId':_0x469ac7[_0xdc7e('0x2a')][_0xdc7e('0x29')]},{'logging':!![],'where':{'id':_0x418851[_0xdc7e('0x2b')]['id']}});}else{return;}})[_0xdc7e('0x13')](function(){return _0x34651c[_0xdc7e('0x14')]({'read':!![]});})[_0xdc7e('0x16')](function(_0x2bcb4d){logger['error']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xdc7e('0x2c')](_0x2bcb4d,{'showHidden':![],'depth':null}));_0x496bc9();});}else{_0x496bc9();}})[_0xdc7e('0x2d')](function(){_0x496bc9();});}else{_0x496bc9();}}},'charset':_0xdc7e('0x2e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index f1e5209..06daa32 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 _0x167a=['message','result','CreateOpenchannelMessage','body','options','raw','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4fffee,_0xfd3e36){var _0x2ee6ad=function(_0xf03302){while(--_0xf03302){_0x4fffee['push'](_0x4fffee['shift']());}};_0x2ee6ad(++_0xfd3e36);}(_0x167a,0x1ab));var _0xa167=function(_0x253bb5,_0x165e2b){_0x253bb5=_0x253bb5-0x0;var _0x5f1c7f=_0x167a[_0x253bb5];return _0x5f1c7f;};'use strict';var _=require('lodash');var util=require(_0xa167('0x0'));var moment=require(_0xa167('0x1'));var BPromise=require('bluebird');var rs=require(_0xa167('0x2'));var fs=require('fs');var Redis=require(_0xa167('0x3'));var db=require(_0xa167('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa167('0x5'))('rpc');var config=require(_0xa167('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa167('0x7')][_0xa167('0x8')]({'port':0x232a});config[_0xa167('0x9')]=_[_0xa167('0xa')](config[_0xa167('0x9')],{'host':_0xa167('0xb'),'port':0x18eb});var socket=require(_0xa167('0xc'))(new Redis(config['redis']));require(_0xa167('0xd'))[_0xa167('0xe')](socket);function respondWithRpcPromise(_0x5f1914,_0x2d94f3,_0x1f46d){return new BPromise(function(_0x187277,_0x47e0eb){return client[_0xa167('0xf')](_0x5f1914,_0x1f46d)['then'](function(_0x424500){logger[_0xa167('0x10')](_0xa167('0x11'),_0x2d94f3,_0xa167('0x12'));logger[_0xa167('0x13')](_0xa167('0x14'),_0x2d94f3,_0xa167('0x12'),JSON[_0xa167('0x15')](_0x424500));if(_0x424500['error']){if(_0x424500[_0xa167('0x16')]['code']===0x1f4){logger['error'](_0xa167('0x11'),_0x2d94f3,_0x424500[_0xa167('0x16')][_0xa167('0x17')]);return _0x47e0eb(_0x424500['error'][_0xa167('0x17')]);}logger['error'](_0xa167('0x11'),_0x2d94f3,_0x424500[_0xa167('0x16')][_0xa167('0x17')]);return _0x187277(_0x424500['error']['message']);}else{logger[_0xa167('0x10')](_0xa167('0x11'),_0x2d94f3,'request\x20sent');_0x187277(_0x424500[_0xa167('0x18')][_0xa167('0x17')]);}})['catch'](function(_0x16ecc2){logger[_0xa167('0x16')](_0xa167('0x11'),_0x2d94f3,_0x16ecc2);_0x47e0eb(_0x16ecc2);});});}exports[_0xa167('0x19')]=function(_0x451533){var _0x4dc84c=this;return new Promise(function(_0x5e41f0,_0x550afb){return db['OpenchannelMessage']['create'](_0x451533[_0xa167('0x1a')],{'raw':_0x451533[_0xa167('0x1b')]?_0x451533[_0xa167('0x1b')][_0xa167('0x1c')]===undefined?!![]:![]:!![]})[_0xa167('0x1d')](function(_0x27f470){logger[_0xa167('0x10')]('CreateOpenchannelMessage',_0x451533);logger[_0xa167('0x13')](_0xa167('0x19'),_0x451533,JSON[_0xa167('0x15')](_0x27f470));_0x5e41f0(_0x27f470);})['catch'](function(_0x542015){logger['error'](_0xa167('0x19'),_0x542015[_0xa167('0x17')],_0x451533);_0x550afb(_0x4dc84c[_0xa167('0x16')](0x1f4,_0x542015['message']));});});}; \ No newline at end of file +var _0x92e3=['lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','body','options','raw'];(function(_0x43ebd3,_0x4827e5){var _0xf90201=function(_0x295d4d){while(--_0x295d4d){_0x43ebd3['push'](_0x43ebd3['shift']());}};_0xf90201(++_0x4827e5);}(_0x92e3,0x1dc));var _0x392e=function(_0x3338b9,_0x54bbcf){_0x3338b9=_0x3338b9-0x0;var _0x3f7a4f=_0x92e3[_0x3338b9];return _0x3f7a4f;};'use strict';var _=require(_0x392e('0x0'));var util=require(_0x392e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x392e('0x2'))['db'];var utils=require(_0x392e('0x3'));var logger=require(_0x392e('0x4'))(_0x392e('0x5'));var config=require(_0x392e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x392e('0x7')]({'port':0x232a});config[_0x392e('0x8')]=_[_0x392e('0x9')](config[_0x392e('0x8')],{'host':_0x392e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x392e('0x8')]));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x30da5c,_0x315bbd,_0x8b15c5){return new BPromise(function(_0x49b1ea,_0x358d1f){return client[_0x392e('0xb')](_0x30da5c,_0x8b15c5)[_0x392e('0xc')](function(_0x1bdb42){logger[_0x392e('0xd')](_0x392e('0xe'),_0x315bbd,_0x392e('0xf'));logger[_0x392e('0x10')](_0x392e('0x11'),_0x315bbd,'request\x20sent',JSON[_0x392e('0x12')](_0x1bdb42));if(_0x1bdb42[_0x392e('0x13')]){if(_0x1bdb42[_0x392e('0x13')][_0x392e('0x14')]===0x1f4){logger['error'](_0x392e('0xe'),_0x315bbd,_0x1bdb42[_0x392e('0x13')][_0x392e('0x15')]);return _0x358d1f(_0x1bdb42[_0x392e('0x13')][_0x392e('0x15')]);}logger[_0x392e('0x13')](_0x392e('0xe'),_0x315bbd,_0x1bdb42[_0x392e('0x13')]['message']);return _0x49b1ea(_0x1bdb42['error'][_0x392e('0x15')]);}else{logger[_0x392e('0xd')](_0x392e('0xe'),_0x315bbd,_0x392e('0xf'));_0x49b1ea(_0x1bdb42[_0x392e('0x16')][_0x392e('0x15')]);}})[_0x392e('0x17')](function(_0x5659b4){logger[_0x392e('0x13')](_0x392e('0xe'),_0x315bbd,_0x5659b4);_0x358d1f(_0x5659b4);});});}exports[_0x392e('0x18')]=function(_0x2c0ca4){var _0x4684b0=this;return new Promise(function(_0x17c008,_0x265c61){return db['OpenchannelMessage']['create'](_0x2c0ca4[_0x392e('0x19')],{'raw':_0x2c0ca4[_0x392e('0x1a')]?_0x2c0ca4[_0x392e('0x1a')][_0x392e('0x1b')]===undefined?!![]:![]:!![]})[_0x392e('0xc')](function(_0x476ce0){logger[_0x392e('0xd')](_0x392e('0x18'),_0x2c0ca4);logger['debug'](_0x392e('0x18'),_0x2c0ca4,JSON[_0x392e('0x12')](_0x476ce0));_0x17c008(_0x476ce0);})['catch'](function(_0x120cc8){logger[_0x392e('0x13')](_0x392e('0x18'),_0x120cc8['message'],_0x2c0ca4);_0x265c61(_0x4684b0[_0x392e('0x13')](0x1f4,_0x120cc8[_0x392e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index de7b75e..1228657 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 _0x9335=['register','length','openchannelMessage:','./openchannelMessage.events','save','update','emit'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0x9335,0xab));var _0x5933=function(_0x20eaaa,_0x4d689c){_0x20eaaa=_0x20eaaa-0x0;var _0x3ee983=_0x9335[_0x20eaaa];return _0x3ee983;};'use strict';var OpenchannelMessageEvents=require(_0x5933('0x0'));var events=[_0x5933('0x1'),'remove',_0x5933('0x2')];function createListener(_0x407b89,_0x3617bd){return function(_0x1a529c){_0x3617bd[_0x5933('0x3')](_0x407b89,_0x1a529c);};}function removeListener(_0xc3fbd1,_0x310370){return function(){OpenchannelMessageEvents['removeListener'](_0xc3fbd1,_0x310370);};}exports[_0x5933('0x4')]=function(_0x4de024){for(var _0x553710=0x0,_0x21f4c1=events[_0x5933('0x5')];_0x553710<_0x21f4c1;_0x553710++){var _0x21ab46=events[_0x553710];var _0x59c5cb=createListener(_0x5933('0x6')+_0x21ab46,_0x4de024);OpenchannelMessageEvents['on'](_0x21ab46,_0x59c5cb);}}; \ No newline at end of file +var _0x66fa=['removeListener','register','length','./openchannelMessage.events','save','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66fa,0x168));var _0xa66f=function(_0xa8e4b2,_0x1cafea){_0xa8e4b2=_0xa8e4b2-0x0;var _0x2a04fe=_0x66fa[_0xa8e4b2];return _0x2a04fe;};'use strict';var OpenchannelMessageEvents=require(_0xa66f('0x0'));var events=[_0xa66f('0x1'),_0xa66f('0x2'),'update'];function createListener(_0x4a6840,_0x3dc747){return function(_0x2325d7){_0x3dc747[_0xa66f('0x3')](_0x4a6840,_0x2325d7);};}function removeListener(_0x2e663b,_0x2143e6){return function(){OpenchannelMessageEvents[_0xa66f('0x4')](_0x2e663b,_0x2143e6);};}exports[_0xa66f('0x5')]=function(_0x4532ee){for(var _0x25a7a0=0x0,_0x33bd0d=events[_0xa66f('0x6')];_0x25a7a0<_0x33bd0d;_0x25a7a0++){var _0x5b7cf7=events[_0x25a7a0];var _0x1cf624=createListener('openchannelMessage:'+_0x5b7cf7,_0x4532ee);OpenchannelMessageEvents['on'](_0x5b7cf7,_0x1cf624);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 3d4ca6c..93fc671 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 _0xa6ef=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelQueue.controller'];(function(_0x50e124,_0x74a4cc){var _0x20f397=function(_0x2601ff){while(--_0x2601ff){_0x50e124['push'](_0x50e124['shift']());}};_0x20f397(++_0x74a4cc);}(_0xa6ef,0x106));var _0xfa6e=function(_0x2bbca4,_0x1e8f91){_0x2bbca4=_0x2bbca4-0x0;var _0x46e27f=_0xa6ef[_0x2bbca4];return _0x46e27f;};'use strict';var multer=require(_0xfa6e('0x0'));var util=require('util');var path=require(_0xfa6e('0x1'));var timeout=require(_0xfa6e('0x2'));var express=require(_0xfa6e('0x3'));var router=express[_0xfa6e('0x4')]();var auth=require(_0xfa6e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfa6e('0x6'));var controller=require(_0xfa6e('0x7'));router[_0xfa6e('0x8')]('/',auth[_0xfa6e('0x9')](),controller[_0xfa6e('0xa')]);router[_0xfa6e('0x8')](_0xfa6e('0xb'),auth[_0xfa6e('0x9')](),controller[_0xfa6e('0xc')]);router[_0xfa6e('0x8')](_0xfa6e('0xd'),auth[_0xfa6e('0x9')](),controller[_0xfa6e('0xe')]);router['get'](_0xfa6e('0xf'),auth[_0xfa6e('0x9')](),controller[_0xfa6e('0x10')]);router[_0xfa6e('0x8')](_0xfa6e('0x11'),auth[_0xfa6e('0x9')](),controller[_0xfa6e('0x12')]);router['get'](_0xfa6e('0x13'),auth[_0xfa6e('0x9')](),controller[_0xfa6e('0x14')]);router[_0xfa6e('0x15')]('/',auth[_0xfa6e('0x9')](),controller[_0xfa6e('0x16')]);router[_0xfa6e('0x15')](_0xfa6e('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0xfa6e('0x15')](_0xfa6e('0x13'),auth[_0xfa6e('0x9')](),controller[_0xfa6e('0x17')]);router[_0xfa6e('0x18')](_0xfa6e('0xd'),auth[_0xfa6e('0x9')](),controller[_0xfa6e('0x19')]);router[_0xfa6e('0x1a')](_0xfa6e('0xd'),auth[_0xfa6e('0x9')](),controller[_0xfa6e('0x1b')]);router['delete'](_0xfa6e('0x11'),auth['isAuthenticated'](),controller[_0xfa6e('0x1c')]);router['delete'](_0xfa6e('0x13'),auth[_0xfa6e('0x9')](),controller['removeAgents']);module[_0xfa6e('0x1d')]=router; \ No newline at end of file +var _0x5cb6=['put','update','destroy','removeTeams','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','getTeams','post','create','/:id/teams','addTeams','/:id/users'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x5cb6,0x16f));var _0x65cb=function(_0x308e4f,_0x134e25){_0x308e4f=_0x308e4f-0x0;var _0x17ab35=_0x5cb6[_0x308e4f];return _0x17ab35;};'use strict';var multer=require(_0x65cb('0x0'));var util=require(_0x65cb('0x1'));var path=require(_0x65cb('0x2'));var timeout=require(_0x65cb('0x3'));var express=require(_0x65cb('0x4'));var router=express[_0x65cb('0x5')]();var auth=require(_0x65cb('0x6'));var interaction=require(_0x65cb('0x7'));var config=require(_0x65cb('0x8'));var controller=require(_0x65cb('0x9'));router[_0x65cb('0xa')]('/',auth[_0x65cb('0xb')](),controller[_0x65cb('0xc')]);router['get']('/describe',auth[_0x65cb('0xb')](),controller[_0x65cb('0xd')]);router[_0x65cb('0xa')](_0x65cb('0xe'),auth[_0x65cb('0xb')](),controller['show']);router[_0x65cb('0xa')](_0x65cb('0xf'),auth[_0x65cb('0xb')](),controller[_0x65cb('0x10')]);router[_0x65cb('0xa')]('/:id/teams',auth[_0x65cb('0xb')](),controller[_0x65cb('0x11')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x65cb('0x12')]('/',auth[_0x65cb('0xb')](),controller[_0x65cb('0x13')]);router[_0x65cb('0x12')](_0x65cb('0x14'),auth[_0x65cb('0xb')](),controller[_0x65cb('0x15')]);router[_0x65cb('0x12')](_0x65cb('0x16'),auth[_0x65cb('0xb')](),controller['addAgents']);router[_0x65cb('0x17')](_0x65cb('0xe'),auth[_0x65cb('0xb')](),controller[_0x65cb('0x18')]);router['delete'](_0x65cb('0xe'),auth[_0x65cb('0xb')](),controller[_0x65cb('0x19')]);router['delete'](_0x65cb('0x14'),auth[_0x65cb('0xb')](),controller[_0x65cb('0x1a')]);router[_0x65cb('0x1b')](_0x65cb('0x16'),auth[_0x65cb('0xb')](),controller[_0x65cb('0x1c')]);module[_0x65cb('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 5e87de3..82e72cc 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 _0xbc7d=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0xbc7d,0xaa));var _0xdbc7=function(_0x3598bb,_0x24befa){_0x3598bb=_0x3598bb-0x0;var _0x13c837=_0xbc7d[_0x3598bb];return _0x13c837;};'use strict';var Sequelize=require(_0xdbc7('0x0'));module[_0xdbc7('0x1')]={'name':{'type':Sequelize[_0xdbc7('0x2')],'unique':_0xdbc7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdbc7('0x2')]},'timeout':{'type':Sequelize[_0xdbc7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdbc7('0x5')](_0xdbc7('0x6'),'beepall',_0xdbc7('0x7'))}}; \ No newline at end of file +var _0xf413=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x45d80c,_0x35c0ff){var _0x449a98=function(_0x1b5ab7){while(--_0x1b5ab7){_0x45d80c['push'](_0x45d80c['shift']());}};_0x449a98(++_0x35c0ff);}(_0xf413,0xd9));var _0x3f41=function(_0x1877a1,_0x38ea7c){_0x1877a1=_0x1877a1-0x0;var _0x3d39f3=_0xf413[_0x1877a1];return _0x3d39f3;};'use strict';var Sequelize=require(_0x3f41('0x0'));module[_0x3f41('0x1')]={'name':{'type':Sequelize[_0x3f41('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3f41('0x2')]},'timeout':{'type':Sequelize[_0x3f41('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3f41('0x4')](_0x3f41('0x5'),_0x3f41('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 3750549..f35afef 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(_0xbdc82c,_0x54c5b5){var _0x531bab=function(_0x56b94b){while(--_0x56b94b){_0xbdc82c['push'](_0xbdc82c['shift']());}};_0x531bab(++_0x54c5b5);}(_0xb10b,0x12a));var _0xbb10=function(_0x49ab20,_0x204482){_0x49ab20=_0x49ab20-0x0;var _0x3c10b4=_0xb10b[_0x49ab20];return _0x3c10b4;};'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(_0x4fc117,_0x18b65a){var _0x359a74=function(_0x3e459c){while(--_0x3e459c){_0x4fc117['push'](_0x4fc117['shift']());}};_0x359a74(++_0x18b65a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 17fca8b..cdbeb03 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 _0x3cfa=['OpenchannelQueue','setMaxListeners','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x31d6ee,_0x3d2dac){var _0x2436ed=function(_0x32cb87){while(--_0x32cb87){_0x31d6ee['push'](_0x31d6ee['shift']());}};_0x2436ed(++_0x3d2dac);}(_0x3cfa,0x10c));var _0xa3cf=function(_0x467b1b,_0x711ba7){_0x467b1b=_0x467b1b-0x0;var _0x4e33e8=_0x3cfa[_0x467b1b];return _0x4e33e8;};'use strict';var EventEmitter=require(_0xa3cf('0x0'));var OpenchannelQueue=require(_0xa3cf('0x1'))['db'][_0xa3cf('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa3cf('0x3')](0x0);var events={'afterCreate':_0xa3cf('0x4'),'afterUpdate':'update','afterDestroy':_0xa3cf('0x5')};function emitEvent(_0x5f52dc){return function(_0x128c4a,_0xa1b36,_0x572de1){OpenchannelQueueEvents[_0xa3cf('0x6')](_0x5f52dc+':'+_0x128c4a['id'],_0x128c4a);OpenchannelQueueEvents[_0xa3cf('0x6')](_0x5f52dc,_0x128c4a);_0x572de1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xa3cf('0x7')](e,emitEvent(event));}}module[_0xa3cf('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xdda4=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x28e74e,_0x53fdf1){var _0xb45ac1=function(_0x311a7a){while(--_0x311a7a){_0x28e74e['push'](_0x28e74e['shift']());}};_0xb45ac1(++_0x53fdf1);}(_0xdda4,0x189));var _0x4dda=function(_0x3f00ee,_0x1d1673){_0x3f00ee=_0x3f00ee-0x0;var _0x18a07e=_0xdda4[_0x3f00ee];return _0x18a07e;};'use strict';var EventEmitter=require(_0x4dda('0x0'));var OpenchannelQueue=require(_0x4dda('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4dda('0x2')](0x0);var events={'afterCreate':_0x4dda('0x3'),'afterUpdate':_0x4dda('0x4'),'afterDestroy':'remove'};function emitEvent(_0x381ffb){return function(_0x101f20,_0xc7c019,_0x91b0ba){OpenchannelQueueEvents[_0x4dda('0x5')](_0x381ffb+':'+_0x101f20['id'],_0x101f20);OpenchannelQueueEvents['emit'](_0x381ffb,_0x101f20);_0x91b0ba(null);};}for(var e in events){if(events[_0x4dda('0x6')](e)){var event=events[e];OpenchannelQueue[_0x4dda('0x7')](e,emitEvent(event));}}module[_0x4dda('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 297fab7..139a0bd 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 _0x4bc3=['moment','request-promise','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util','api'];(function(_0x5afd58,_0x52c443){var _0x2d6d02=function(_0x34cc1c){while(--_0x34cc1c){_0x5afd58['push'](_0x5afd58['shift']());}};_0x2d6d02(++_0x52c443);}(_0x4bc3,0x16e));var _0x34bc=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x4bc3[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var logger=require('../../config/logger')(_0x34bc('0x2'));var moment=require(_0x34bc('0x3'));var BPromise=require('bluebird');var rp=require(_0x34bc('0x4'));var attributes=require(_0x34bc('0x5'));module[_0x34bc('0x6')]=function(_0x2e043e,_0x232f40){return _0x2e043e[_0x34bc('0x7')](_0x34bc('0x8'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4eb=['OpenchannelQueue','openchannel_queues','lodash','bluebird','exports','define'];(function(_0x1039b3,_0x46cf35){var _0x334b16=function(_0x2119ad){while(--_0x2119ad){_0x1039b3['push'](_0x1039b3['shift']());}};_0x334b16(++_0x46cf35);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3dac80,_0x3d7a35){_0x3dac80=_0x3dac80-0x0;var _0x48148f=_0xf4eb[_0x3dac80];return _0x48148f;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var attributes=require('./openchannelQueue.attributes');module[_0xbf4e('0x2')]=function(_0x1c7606,_0x32d1d7){return _0x1c7606[_0xbf4e('0x3')](_0xbf4e('0x4'),attributes,{'tableName':_0xbf4e('0x5'),'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 1658e3f..50b3774 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 _0x34b2=['../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2598b8,_0x48f632){var _0x44983f=function(_0xc47082){while(--_0xc47082){_0x2598b8['push'](_0x2598b8['shift']());}};_0x44983f(++_0x48f632);}(_0x34b2,0x11c));var _0x234b=function(_0x348fec,_0x486f87){_0x348fec=_0x348fec-0x0;var _0x5914c7=_0x34b2[_0x348fec];return _0x5914c7;};'use strict';var _=require(_0x234b('0x0'));var util=require(_0x234b('0x1'));var moment=require(_0x234b('0x2'));var BPromise=require(_0x234b('0x3'));var rs=require(_0x234b('0x4'));var fs=require('fs');var Redis=require(_0x234b('0x5'));var db=require(_0x234b('0x6'))['db'];var utils=require(_0x234b('0x7'));var logger=require(_0x234b('0x8'))(_0x234b('0x9'));var config=require(_0x234b('0xa'));var jayson=require(_0x234b('0xb'));var client=jayson[_0x234b('0xc')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x234b('0xd')],{'host':_0x234b('0xe'),'port':0x18eb});var socket=require(_0x234b('0xf'))(new Redis(config[_0x234b('0xd')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1e81b6,_0x3a900b,_0x277a27){return new BPromise(function(_0x30b17b,_0x2446ee){return client[_0x234b('0x10')](_0x1e81b6,_0x277a27)[_0x234b('0x11')](function(_0x9dcfd3){logger[_0x234b('0x12')](_0x234b('0x13'),_0x3a900b,_0x234b('0x14'));logger[_0x234b('0x15')](_0x234b('0x16'),_0x3a900b,'request\x20sent',JSON[_0x234b('0x17')](_0x9dcfd3));if(_0x9dcfd3[_0x234b('0x18')]){if(_0x9dcfd3['error'][_0x234b('0x19')]===0x1f4){logger[_0x234b('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x3a900b,_0x9dcfd3[_0x234b('0x18')][_0x234b('0x1a')]);return _0x2446ee(_0x9dcfd3[_0x234b('0x18')][_0x234b('0x1a')]);}logger[_0x234b('0x18')](_0x234b('0x13'),_0x3a900b,_0x9dcfd3[_0x234b('0x18')][_0x234b('0x1a')]);return _0x30b17b(_0x9dcfd3[_0x234b('0x18')]['message']);}else{logger[_0x234b('0x12')](_0x234b('0x13'),_0x3a900b,_0x234b('0x14'));_0x30b17b(_0x9dcfd3[_0x234b('0x1b')][_0x234b('0x1a')]);}})[_0x234b('0x1c')](function(_0x76e4cf){logger[_0x234b('0x18')](_0x234b('0x13'),_0x3a900b,_0x76e4cf);_0x2446ee(_0x76e4cf);});});}exports[_0x234b('0x1d')]=function(_0x4a597e){var _0x2d11cf=this;return new Promise(function(_0xae1383,_0x2a47e1){return db[_0x234b('0x1e')][_0x234b('0x1f')]({'raw':_0x4a597e['options']?_0x4a597e[_0x234b('0x20')][_0x234b('0x21')]===undefined?!![]:![]:!![],'where':_0x4a597e['options']?_0x4a597e[_0x234b('0x20')][_0x234b('0x22')]||null:null,'attributes':_0x4a597e[_0x234b('0x20')]?_0x4a597e[_0x234b('0x20')][_0x234b('0x23')]||null:null,'limit':_0x4a597e[_0x234b('0x20')]?_0x4a597e[_0x234b('0x20')][_0x234b('0x24')]||null:null,'include':_0x4a597e[_0x234b('0x20')]?_0x4a597e[_0x234b('0x20')][_0x234b('0x25')]?_['map'](_0x4a597e[_0x234b('0x20')]['include'],function(_0x1f64d9){return{'model':db[_0x1f64d9[_0x234b('0x26')]],'as':_0x1f64d9['as'],'attributes':_0x1f64d9[_0x234b('0x23')],'include':_0x1f64d9[_0x234b('0x25')]?_[_0x234b('0x27')](_0x1f64d9[_0x234b('0x25')],function(_0x1d0822){return{'model':db[_0x1d0822['model']],'as':_0x1d0822['as'],'attributes':_0x1d0822[_0x234b('0x23')],'include':_0x1d0822[_0x234b('0x25')]?_[_0x234b('0x27')](_0x1d0822[_0x234b('0x25')],function(_0x1de1dc){return{'model':db[_0x1de1dc['model']],'as':_0x1de1dc['as'],'attributes':_0x1de1dc[_0x234b('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x439577){logger[_0x234b('0x12')](_0x234b('0x1d'),_0x4a597e);logger['debug']('GetOpenchannelQueue',_0x4a597e,JSON['stringify'](_0x439577));_0xae1383(_0x439577);})[_0x234b('0x1c')](function(_0x5ab94b){logger[_0x234b('0x18')](_0x234b('0x1d'),_0x5ab94b[_0x234b('0x1a')],_0x4a597e);_0x2a47e1(_0x2d11cf[_0x234b('0x18')](0x1f4,_0x5ab94b['message']));});});};exports['ShowOpenchannelQueue']=function(_0x527f6b){var _0x3351d3=this;return new Promise(function(_0x19d95a,_0x12231f){return db['OpenchannelQueue'][_0x234b('0x28')]({'raw':_0x527f6b[_0x234b('0x20')]?_0x527f6b[_0x234b('0x20')][_0x234b('0x21')]===undefined?!![]:![]:!![],'where':_0x527f6b[_0x234b('0x20')]?_0x527f6b[_0x234b('0x20')][_0x234b('0x22')]||null:null,'attributes':_0x527f6b[_0x234b('0x20')]?_0x527f6b[_0x234b('0x20')]['attributes']||null:null,'include':_0x527f6b[_0x234b('0x20')]?_0x527f6b[_0x234b('0x20')]['include']?_[_0x234b('0x27')](_0x527f6b[_0x234b('0x20')]['include'],function(_0x3be12f){return{'model':db[_0x3be12f[_0x234b('0x26')]],'as':_0x3be12f['as'],'attributes':_0x3be12f['attributes'],'include':_0x3be12f[_0x234b('0x25')]?_[_0x234b('0x27')](_0x3be12f[_0x234b('0x25')],function(_0x5bd4a7){return{'model':db[_0x5bd4a7[_0x234b('0x26')]],'as':_0x5bd4a7['as'],'attributes':_0x5bd4a7[_0x234b('0x23')],'include':_0x5bd4a7['include']?_[_0x234b('0x27')](_0x5bd4a7['include'],function(_0x1509dc){return{'model':db[_0x1509dc['model']],'as':_0x1509dc['as'],'attributes':_0x1509dc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e02f1){logger[_0x234b('0x12')](_0x234b('0x29'),_0x527f6b);logger[_0x234b('0x15')](_0x234b('0x29'),_0x527f6b,JSON[_0x234b('0x17')](_0x3e02f1));_0x19d95a(_0x3e02f1);})[_0x234b('0x1c')](function(_0x167950){logger[_0x234b('0x18')](_0x234b('0x29'),_0x167950['message'],_0x527f6b);_0x12231f(_0x3351d3[_0x234b('0x18')](0x1f4,_0x167950[_0x234b('0x1a')]));});});}; \ No newline at end of file +var _0xc5c7=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','redis','./openchannelQueue.socket','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','limit','include','map','model','ShowOpenchannelQueue','raw','util','moment','bluebird','randomstring','ioredis'];(function(_0x326aa7,_0x12dceb){var _0x3955b2=function(_0x1fc290){while(--_0x1fc290){_0x326aa7['push'](_0x326aa7['shift']());}};_0x3955b2(++_0x12dceb);}(_0xc5c7,0x1cf));var _0x7c5c=function(_0x420417,_0x2cf536){_0x420417=_0x420417-0x0;var _0x36e1e0=_0xc5c7[_0x420417];return _0x36e1e0;};'use strict';var _=require('lodash');var util=require(_0x7c5c('0x0'));var moment=require(_0x7c5c('0x1'));var BPromise=require(_0x7c5c('0x2'));var rs=require(_0x7c5c('0x3'));var fs=require('fs');var Redis=require(_0x7c5c('0x4'));var db=require(_0x7c5c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c5c('0x6'))(_0x7c5c('0x7'));var config=require(_0x7c5c('0x8'));var jayson=require(_0x7c5c('0x9'));var client=jayson[_0x7c5c('0xa')]['http']({'port':0x232a});config['redis']=_[_0x7c5c('0xb')](config['redis'],{'host':_0x7c5c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c5c('0xd')]));require(_0x7c5c('0xe'))['register'](socket);function respondWithRpcPromise(_0x4f0093,_0x17597c,_0x1cd540){return new BPromise(function(_0x5c7073,_0x39fbdf){return client['request'](_0x4f0093,_0x1cd540)[_0x7c5c('0xf')](function(_0x5bb950){logger[_0x7c5c('0x10')](_0x7c5c('0x11'),_0x17597c,'request\x20sent');logger[_0x7c5c('0x12')](_0x7c5c('0x13'),_0x17597c,_0x7c5c('0x14'),JSON[_0x7c5c('0x15')](_0x5bb950));if(_0x5bb950[_0x7c5c('0x16')]){if(_0x5bb950[_0x7c5c('0x16')][_0x7c5c('0x17')]===0x1f4){logger[_0x7c5c('0x16')](_0x7c5c('0x11'),_0x17597c,_0x5bb950[_0x7c5c('0x16')][_0x7c5c('0x18')]);return _0x39fbdf(_0x5bb950[_0x7c5c('0x16')][_0x7c5c('0x18')]);}logger[_0x7c5c('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x17597c,_0x5bb950['error'][_0x7c5c('0x18')]);return _0x5c7073(_0x5bb950[_0x7c5c('0x16')][_0x7c5c('0x18')]);}else{logger[_0x7c5c('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x17597c,_0x7c5c('0x14'));_0x5c7073(_0x5bb950[_0x7c5c('0x19')][_0x7c5c('0x18')]);}})[_0x7c5c('0x1a')](function(_0x1215a3){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x17597c,_0x1215a3);_0x39fbdf(_0x1215a3);});});}exports[_0x7c5c('0x1b')]=function(_0x32f191){var _0x2a5877=this;return new Promise(function(_0x5e821e,_0x170896){return db[_0x7c5c('0x1c')][_0x7c5c('0x1d')]({'raw':_0x32f191[_0x7c5c('0x1e')]?_0x32f191[_0x7c5c('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x32f191[_0x7c5c('0x1e')]?_0x32f191[_0x7c5c('0x1e')][_0x7c5c('0x1f')]||null:null,'attributes':_0x32f191['options']?_0x32f191[_0x7c5c('0x1e')][_0x7c5c('0x20')]||null:null,'limit':_0x32f191['options']?_0x32f191[_0x7c5c('0x1e')][_0x7c5c('0x21')]||null:null,'include':_0x32f191[_0x7c5c('0x1e')]?_0x32f191[_0x7c5c('0x1e')][_0x7c5c('0x22')]?_[_0x7c5c('0x23')](_0x32f191[_0x7c5c('0x1e')][_0x7c5c('0x22')],function(_0x4673f8){return{'model':db[_0x4673f8[_0x7c5c('0x24')]],'as':_0x4673f8['as'],'attributes':_0x4673f8[_0x7c5c('0x20')],'include':_0x4673f8['include']?_[_0x7c5c('0x23')](_0x4673f8['include'],function(_0x5a5402){return{'model':db[_0x5a5402[_0x7c5c('0x24')]],'as':_0x5a5402['as'],'attributes':_0x5a5402['attributes'],'include':_0x5a5402[_0x7c5c('0x22')]?_[_0x7c5c('0x23')](_0x5a5402[_0x7c5c('0x22')],function(_0x1b8d20){return{'model':db[_0x1b8d20['model']],'as':_0x1b8d20['as'],'attributes':_0x1b8d20['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c5c('0xf')](function(_0x1467fa){logger[_0x7c5c('0x10')](_0x7c5c('0x1b'),_0x32f191);logger['debug'](_0x7c5c('0x1b'),_0x32f191,JSON[_0x7c5c('0x15')](_0x1467fa));_0x5e821e(_0x1467fa);})[_0x7c5c('0x1a')](function(_0x36bf25){logger[_0x7c5c('0x16')](_0x7c5c('0x1b'),_0x36bf25[_0x7c5c('0x18')],_0x32f191);_0x170896(_0x2a5877['error'](0x1f4,_0x36bf25[_0x7c5c('0x18')]));});});};exports[_0x7c5c('0x25')]=function(_0x56a073){var _0x34b6a0=this;return new Promise(function(_0x382215,_0x300e6c){return db[_0x7c5c('0x1c')]['find']({'raw':_0x56a073[_0x7c5c('0x1e')]?_0x56a073['options'][_0x7c5c('0x26')]===undefined?!![]:![]:!![],'where':_0x56a073[_0x7c5c('0x1e')]?_0x56a073['options'][_0x7c5c('0x1f')]||null:null,'attributes':_0x56a073[_0x7c5c('0x1e')]?_0x56a073[_0x7c5c('0x1e')]['attributes']||null:null,'include':_0x56a073['options']?_0x56a073[_0x7c5c('0x1e')][_0x7c5c('0x22')]?_['map'](_0x56a073['options'][_0x7c5c('0x22')],function(_0x49e8ee){return{'model':db[_0x49e8ee[_0x7c5c('0x24')]],'as':_0x49e8ee['as'],'attributes':_0x49e8ee[_0x7c5c('0x20')],'include':_0x49e8ee[_0x7c5c('0x22')]?_[_0x7c5c('0x23')](_0x49e8ee[_0x7c5c('0x22')],function(_0x12c320){return{'model':db[_0x12c320['model']],'as':_0x12c320['as'],'attributes':_0x12c320[_0x7c5c('0x20')],'include':_0x12c320['include']?_[_0x7c5c('0x23')](_0x12c320[_0x7c5c('0x22')],function(_0x2490de){return{'model':db[_0x2490de['model']],'as':_0x2490de['as'],'attributes':_0x2490de[_0x7c5c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7c5c('0xf')](function(_0xf8bf29){logger[_0x7c5c('0x10')](_0x7c5c('0x25'),_0x56a073);logger[_0x7c5c('0x12')](_0x7c5c('0x25'),_0x56a073,JSON[_0x7c5c('0x15')](_0xf8bf29));_0x382215(_0xf8bf29);})['catch'](function(_0x46076e){logger[_0x7c5c('0x16')](_0x7c5c('0x25'),_0x46076e[_0x7c5c('0x18')],_0x56a073);_0x300e6c(_0x34b6a0[_0x7c5c('0x16')](0x1f4,_0x46076e[_0x7c5c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 84b2bb7..58a550f 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 60fdd71..9c024db 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(_0x13594e,_0x6f0ed0){var _0x1a4f42=function(_0x30b064){while(--_0x30b064){_0x13594e['push'](_0x13594e['shift']());}};_0x1a4f42(++_0x6f0ed0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x3b4b1d,_0x15029e){var _0x488c36=function(_0x56c8b3){while(--_0x56c8b3){_0x3b4b1d['push'](_0x3b4b1d['shift']());}};_0x488c36(++_0x15029e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index b1d12eb..66e5333 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 _0x46ee=['moment','sequelize','exports','STRING','DATE'];(function(_0x58175c,_0x2d9373){var _0x55b88f=function(_0x13ed84){while(--_0x13ed84){_0x58175c['push'](_0x58175c['shift']());}};_0x55b88f(++_0x2d9373);}(_0x46ee,0xdc));var _0xe46e=function(_0x6e26ee,_0x275ba3){_0x6e26ee=_0x6e26ee-0x0;var _0x26f1a1=_0x46ee[_0x6e26ee];return _0x26f1a1;};'use strict';var moment=require(_0xe46e('0x0'));var Sequelize=require(_0xe46e('0x1'));module[_0xe46e('0x2')]={'uniqueid':{'type':Sequelize[_0xe46e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe46e('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe46e('0x4')]},'exitAt':{'type':Sequelize[_0xe46e('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3129=['exports','STRING','DATE','sequelize'];(function(_0x49b166,_0x264c05){var _0x11ebeb=function(_0x360e77){while(--_0x360e77){_0x49b166['push'](_0x49b166['shift']());}};_0x11ebeb(++_0x264c05);}(_0x3129,0x16f));var _0x9312=function(_0x149162,_0x13e8f8){_0x149162=_0x149162-0x0;var _0x162ab5=_0x3129[_0x149162];return _0x162ab5;};'use strict';var moment=require('moment');var Sequelize=require(_0x9312('0x0'));module[_0x9312('0x1')]={'uniqueid':{'type':Sequelize[_0x9312('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9312('0x2')]},'joinAt':{'type':Sequelize[_0x9312('0x3')]},'leaveAt':{'type':Sequelize[_0x9312('0x3')]},'acceptAt':{'type':Sequelize[_0x9312('0x3')]},'exitAt':{'type':Sequelize[_0x9312('0x3')]},'reason':{'type':Sequelize[_0x9312('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index bd870d0..2f43d2a 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 _0xe347=['map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','status','set','apply','reject','save','then','destroy','error','stack','name','send','OpenchannelQueueReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','merge'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xe347,0x9c));var _0x7e34=function(_0x3145af,_0x53a1d5){_0x3145af=_0x3145af-0x0;var _0x37758a=_0xe347[_0x3145af];return _0x37758a;};'use strict';var pdf=require(_0x7e34('0x0'));var emlformat=require(_0x7e34('0x1'));var rimraf=require(_0x7e34('0x2'));var zipdir=require(_0x7e34('0x3'));var jsonpatch=require(_0x7e34('0x4'));var rp=require(_0x7e34('0x5'));var moment=require(_0x7e34('0x6'));var BPromise=require(_0x7e34('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7e34('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7e34('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7e34('0xa'));var crypto=require(_0x7e34('0xb'));var jsforce=require(_0x7e34('0xc'));var deskjs=require(_0x7e34('0xd'));var toCsv=require(_0x7e34('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x7e34('0xf'));var hardwareService=require(_0x7e34('0x10'));var Redis=require(_0x7e34('0x11'));var qs=require(_0x7e34('0x12'));var logger=require(_0x7e34('0x13'))(_0x7e34('0x14'));var utils=require(_0x7e34('0x15'));var config=require(_0x7e34('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f59d5,_0x5456da){_0x5456da=_0x5456da||0xcc;return function(_0x59f2e6){if(_0x59f2e6){return _0x3f59d5[_0x7e34('0x17')](_0x5456da);}return _0x3f59d5['status'](_0x5456da)[_0x7e34('0x18')]();};}function respondWithResult(_0x54f46c,_0x6629fa){_0x6629fa=_0x6629fa||0xc8;return function(_0x5381da){if(_0x5381da){return _0x54f46c['status'](_0x6629fa)[_0x7e34('0x19')](_0x5381da);}};}function respondWithFilteredResult(_0x7f5ee7,_0x592aed){return function(_0x32bd0f){if(_0x32bd0f){var _0x531e6a=_0x32bd0f[_0x7e34('0x1a')],_0xe41b4a=_0x592aed[_0x7e34('0x1b')],_0x47ca7e=_0x592aed['offset']+_0x592aed[_0x7e34('0x1c')],_0x6466a6;if(_0x47ca7e>=_0x531e6a){_0x47ca7e=_0x531e6a;_0x6466a6=0xc8;}else{_0x6466a6=0xce;}_0x7f5ee7[_0x7e34('0x1d')](_0x6466a6);return _0x7f5ee7[_0x7e34('0x1e')]('Content-Range',_0xe41b4a+'-'+_0x47ca7e+'/'+_0x531e6a)[_0x7e34('0x19')](_0x32bd0f);}return null;};}function patchUpdates(_0x27b6d6){return function(_0x22f605){try{jsonpatch[_0x7e34('0x1f')](_0x22f605,_0x27b6d6,!![]);}catch(_0x8648df){return BPromise[_0x7e34('0x20')](_0x8648df);}return _0x22f605[_0x7e34('0x21')]();};}function saveUpdates(_0x33357c,_0x4d93e8){return function(_0x1b88dc){if(_0x1b88dc){return _0x1b88dc['update'](_0x33357c)[_0x7e34('0x22')](function(_0x5e7538){return _0x5e7538;});}return null;};}function removeEntity(_0x487b4e,_0x27c90d){return function(_0x38e92a){if(_0x38e92a){return _0x38e92a[_0x7e34('0x23')]()[_0x7e34('0x22')](function(){_0x487b4e[_0x7e34('0x1d')](0xcc)[_0x7e34('0x18')]();});}};}function handleEntityNotFound(_0x33b828,_0x37327d){return function(_0x2e7a58){if(!_0x2e7a58){_0x33b828['sendStatus'](0x194);}return _0x2e7a58;};}function handleError(_0xe82b7d,_0x4ca7da){_0x4ca7da=_0x4ca7da||0x1f4;return function(_0x439d67){logger[_0x7e34('0x24')](_0x439d67[_0x7e34('0x25')]);if(_0x439d67[_0x7e34('0x26')]){delete _0x439d67['name'];}_0xe82b7d['status'](_0x4ca7da)[_0x7e34('0x27')](_0x439d67);};}exports['index']=function(_0x2ef3cd,_0x575514){var _0x12330e={},_0x419639={},_0x2c35df={'count':0x0,'rows':[]};var _0x1beba0=db[_0x7e34('0x28')][_0x7e34('0x29')];_0x419639['model']=_[_0x7e34('0x2a')](_0x1beba0);_0x419639[_0x7e34('0x2b')]=_[_0x7e34('0x2a')](_0x2ef3cd[_0x7e34('0x2b')]);_0x419639[_0x7e34('0x2c')]=_[_0x7e34('0x2d')](_0x419639[_0x7e34('0x2e')],_0x419639[_0x7e34('0x2b')]);_0x12330e[_0x7e34('0x2f')]=_[_0x7e34('0x2d')](_0x419639[_0x7e34('0x2e')],qs[_0x7e34('0x30')](_0x2ef3cd['query'][_0x7e34('0x30')]));_0x12330e[_0x7e34('0x2f')]=_0x12330e[_0x7e34('0x2f')]['length']?_0x12330e[_0x7e34('0x2f')]:_0x419639[_0x7e34('0x2e')];if(!_0x2ef3cd[_0x7e34('0x2b')][_0x7e34('0x31')]('nolimit')){_0x12330e[_0x7e34('0x1c')]=qs['limit'](_0x2ef3cd[_0x7e34('0x2b')][_0x7e34('0x1c')]);_0x12330e[_0x7e34('0x1b')]=qs[_0x7e34('0x1b')](_0x2ef3cd[_0x7e34('0x2b')]['offset']);}_0x12330e[_0x7e34('0x32')]=qs['sort'](_0x2ef3cd[_0x7e34('0x2b')][_0x7e34('0x33')]);_0x12330e['where']=qs[_0x7e34('0x2c')](_['pick'](_0x2ef3cd[_0x7e34('0x2b')],_0x419639[_0x7e34('0x2c')]));if(_0x2ef3cd['query']['filter']){_0x12330e[_0x7e34('0x34')]=_[_0x7e34('0x35')](_0x12330e[_0x7e34('0x34')],{'$or':_[_0x7e34('0x36')](_0x1beba0,function(_0x715771){if(_0x715771[_0x7e34('0x37')]['key']!==_0x7e34('0x38')){var _0x555edf={};_0x555edf[_0x715771['field']]={'$like':'%'+_0x2ef3cd[_0x7e34('0x2b')]['filter']+'%'};return _0x555edf;}})});}_0x12330e=_[_0x7e34('0x35')]({},_0x12330e,_0x2ef3cd[_0x7e34('0x39')]);var _0xb0e4c5={'where':_0x12330e[_0x7e34('0x34')]};return db[_0x7e34('0x28')][_0x7e34('0x1a')](_0xb0e4c5)['then'](function(_0x1a3628){_0x2c35df['count']=_0x1a3628;if(_0x2ef3cd['query'][_0x7e34('0x3a')]){_0x12330e[_0x7e34('0x3b')]=[{'all':!![]}];}return db[_0x7e34('0x28')][_0x7e34('0x3c')](_0x12330e);})[_0x7e34('0x22')](function(_0x205640){_0x2c35df[_0x7e34('0x3d')]=_0x205640;return _0x2c35df;})[_0x7e34('0x22')](respondWithFilteredResult(_0x575514,_0x12330e))[_0x7e34('0x3e')](handleError(_0x575514,null));};exports[_0x7e34('0x3f')]=function(_0x45d6a7,_0x567a1b){var _0x5d35d9={'raw':!![],'where':{'id':_0x45d6a7[_0x7e34('0x40')]['id']}},_0x39736d={};_0x39736d[_0x7e34('0x2e')]=_['keys'](db['OpenchannelQueueReport'][_0x7e34('0x29')]);_0x39736d[_0x7e34('0x2b')]=_[_0x7e34('0x2a')](_0x45d6a7[_0x7e34('0x2b')]);_0x39736d['filters']=_[_0x7e34('0x2d')](_0x39736d[_0x7e34('0x2e')],_0x39736d[_0x7e34('0x2b')]);_0x5d35d9[_0x7e34('0x2f')]=_[_0x7e34('0x2d')](_0x39736d[_0x7e34('0x2e')],qs['fields'](_0x45d6a7['query']['fields']));_0x5d35d9[_0x7e34('0x2f')]=_0x5d35d9[_0x7e34('0x2f')][_0x7e34('0x41')]?_0x5d35d9[_0x7e34('0x2f')]:_0x39736d['model'];if(_0x45d6a7[_0x7e34('0x2b')][_0x7e34('0x3a')]){_0x5d35d9[_0x7e34('0x3b')]=[{'all':!![]}];}_0x5d35d9=_[_0x7e34('0x35')]({},_0x5d35d9,_0x45d6a7[_0x7e34('0x39')]);return db['OpenchannelQueueReport']['find'](_0x5d35d9)[_0x7e34('0x22')](handleEntityNotFound(_0x567a1b,null))[_0x7e34('0x22')](respondWithResult(_0x567a1b,null))[_0x7e34('0x3e')](handleError(_0x567a1b,null));};exports[_0x7e34('0x42')]=function(_0x1f8e86,_0x3f055e){return db['OpenchannelQueueReport'][_0x7e34('0x42')](_0x1f8e86[_0x7e34('0x43')],{})['then'](respondWithResult(_0x3f055e,0xc9))['catch'](handleError(_0x3f055e,null));};exports['update']=function(_0x3d4240,_0x4e95e4){if(_0x3d4240[_0x7e34('0x43')]['id']){delete _0x3d4240[_0x7e34('0x43')]['id'];}return db[_0x7e34('0x28')]['find']({'where':{'id':_0x3d4240[_0x7e34('0x40')]['id']}})[_0x7e34('0x22')](handleEntityNotFound(_0x4e95e4,null))[_0x7e34('0x22')](saveUpdates(_0x3d4240[_0x7e34('0x43')],null))['then'](respondWithResult(_0x4e95e4,null))['catch'](handleError(_0x4e95e4,null));};exports[_0x7e34('0x23')]=function(_0x4044bc,_0x3b0f55){return db[_0x7e34('0x28')][_0x7e34('0x44')]({'where':{'id':_0x4044bc[_0x7e34('0x40')]['id']}})['then'](handleEntityNotFound(_0x3b0f55,null))[_0x7e34('0x22')](removeEntity(_0x3b0f55,null))[_0x7e34('0x3e')](handleError(_0x3b0f55,null));};exports[_0x7e34('0x45')]=function(_0x3338e5,_0x32cacf){return db['OpenchannelQueueReport'][_0x7e34('0x45')]()[_0x7e34('0x22')](respondWithResult(_0x32cacf,null))[_0x7e34('0x3e')](handleError(_0x32cacf,null));}; \ No newline at end of file +var _0x9b5c=['rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','describe','html-pdf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','stack','name','index','OpenchannelQueueReport'];(function(_0x69b0bf,_0x248a70){var _0x53a201=function(_0x5d1c3f){while(--_0x5d1c3f){_0x69b0bf['push'](_0x69b0bf['shift']());}};_0x53a201(++_0x248a70);}(_0x9b5c,0x1b0));var _0xc9b5=function(_0x3a94b5,_0x6c2384){_0x3a94b5=_0x3a94b5-0x0;var _0x4800a4=_0x9b5c[_0x3a94b5];return _0x4800a4;};'use strict';var pdf=require(_0xc9b5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc9b5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc9b5('0x2'));var BPromise=require(_0xc9b5('0x3'));var Mustache=require('mustache');var util=require(_0xc9b5('0x4'));var path=require(_0xc9b5('0x5'));var sox=require('sox');var csv=require(_0xc9b5('0x6'));var ejs=require(_0xc9b5('0x7'));var fs=require('fs');var _=require(_0xc9b5('0x8'));var squel=require(_0xc9b5('0x9'));var crypto=require(_0xc9b5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc9b5('0xb'));var toCsv=require(_0xc9b5('0x6'));var querystring=require(_0xc9b5('0xc'));var Papa=require(_0xc9b5('0xd'));var authService=require(_0xc9b5('0xe'));var hardwareService=require(_0xc9b5('0xf'));var Redis=require(_0xc9b5('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xc9b5('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xc9b5('0x12'));var db=require(_0xc9b5('0x13'))['db'];function respondWithStatusCode(_0x166457,_0xbcf343){_0xbcf343=_0xbcf343||0xcc;return function(_0x5ce227){if(_0x5ce227){return _0x166457[_0xc9b5('0x14')](_0xbcf343);}return _0x166457[_0xc9b5('0x15')](_0xbcf343)[_0xc9b5('0x16')]();};}function respondWithResult(_0x65a129,_0x2d0d16){_0x2d0d16=_0x2d0d16||0xc8;return function(_0x415836){if(_0x415836){return _0x65a129[_0xc9b5('0x15')](_0x2d0d16)['json'](_0x415836);}};}function respondWithFilteredResult(_0x892f9c,_0x5de758){return function(_0x389093){if(_0x389093){var _0x4b800b=_0x389093[_0xc9b5('0x17')],_0x11ce04=_0x5de758[_0xc9b5('0x18')],_0x3cbe2e=_0x5de758[_0xc9b5('0x18')]+_0x5de758[_0xc9b5('0x19')],_0x287b7b;if(_0x3cbe2e>=_0x4b800b){_0x3cbe2e=_0x4b800b;_0x287b7b=0xc8;}else{_0x287b7b=0xce;}_0x892f9c[_0xc9b5('0x15')](_0x287b7b);return _0x892f9c['set'](_0xc9b5('0x1a'),_0x11ce04+'-'+_0x3cbe2e+'/'+_0x4b800b)[_0xc9b5('0x1b')](_0x389093);}return null;};}function patchUpdates(_0x16fb75){return function(_0x3708cd){try{jsonpatch['apply'](_0x3708cd,_0x16fb75,!![]);}catch(_0x3cbeb7){return BPromise[_0xc9b5('0x1c')](_0x3cbeb7);}return _0x3708cd[_0xc9b5('0x1d')]();};}function saveUpdates(_0x5e4096,_0xc52598){return function(_0x5a73b7){if(_0x5a73b7){return _0x5a73b7[_0xc9b5('0x1e')](_0x5e4096)[_0xc9b5('0x1f')](function(_0x3eaebb){return _0x3eaebb;});}return null;};}function removeEntity(_0x585d58,_0x5bbf7f){return function(_0x432675){if(_0x432675){return _0x432675[_0xc9b5('0x20')]()[_0xc9b5('0x1f')](function(){_0x585d58[_0xc9b5('0x15')](0xcc)[_0xc9b5('0x16')]();});}};}function handleEntityNotFound(_0x1d627e,_0x403655){return function(_0x1b9ad3){if(!_0x1b9ad3){_0x1d627e[_0xc9b5('0x14')](0x194);}return _0x1b9ad3;};}function handleError(_0x223862,_0x4d52b4){_0x4d52b4=_0x4d52b4||0x1f4;return function(_0x3011ce){logger['error'](_0x3011ce[_0xc9b5('0x21')]);if(_0x3011ce[_0xc9b5('0x22')]){delete _0x3011ce[_0xc9b5('0x22')];}_0x223862['status'](_0x4d52b4)['send'](_0x3011ce);};}exports[_0xc9b5('0x23')]=function(_0x428ded,_0x58e5fb){var _0x483c67={},_0x19a346={},_0x126ea0={'count':0x0,'rows':[]};var _0x2026d5=db[_0xc9b5('0x24')][_0xc9b5('0x25')];_0x19a346[_0xc9b5('0x26')]=_[_0xc9b5('0x27')](_0x2026d5);_0x19a346[_0xc9b5('0x28')]=_[_0xc9b5('0x27')](_0x428ded[_0xc9b5('0x28')]);_0x19a346[_0xc9b5('0x29')]=_[_0xc9b5('0x2a')](_0x19a346['model'],_0x19a346['query']);_0x483c67[_0xc9b5('0x2b')]=_[_0xc9b5('0x2a')](_0x19a346[_0xc9b5('0x26')],qs[_0xc9b5('0x2c')](_0x428ded['query'][_0xc9b5('0x2c')]));_0x483c67[_0xc9b5('0x2b')]=_0x483c67[_0xc9b5('0x2b')][_0xc9b5('0x2d')]?_0x483c67[_0xc9b5('0x2b')]:_0x19a346[_0xc9b5('0x26')];if(!_0x428ded[_0xc9b5('0x28')][_0xc9b5('0x2e')](_0xc9b5('0x2f'))){_0x483c67[_0xc9b5('0x19')]=qs[_0xc9b5('0x19')](_0x428ded['query'][_0xc9b5('0x19')]);_0x483c67[_0xc9b5('0x18')]=qs['offset'](_0x428ded['query'][_0xc9b5('0x18')]);}_0x483c67[_0xc9b5('0x30')]=qs['sort'](_0x428ded[_0xc9b5('0x28')][_0xc9b5('0x31')]);_0x483c67['where']=qs[_0xc9b5('0x29')](_[_0xc9b5('0x32')](_0x428ded[_0xc9b5('0x28')],_0x19a346[_0xc9b5('0x29')]));if(_0x428ded['query'][_0xc9b5('0x33')]){_0x483c67[_0xc9b5('0x34')]=_[_0xc9b5('0x35')](_0x483c67[_0xc9b5('0x34')],{'$or':_['map'](_0x2026d5,function(_0x2b2a42){if(_0x2b2a42['type']['key']!==_0xc9b5('0x36')){var _0x2c7651={};_0x2c7651[_0x2b2a42['field']]={'$like':'%'+_0x428ded['query'][_0xc9b5('0x33')]+'%'};return _0x2c7651;}})});}_0x483c67=_[_0xc9b5('0x35')]({},_0x483c67,_0x428ded['options']);var _0x400838={'where':_0x483c67[_0xc9b5('0x34')]};return db['OpenchannelQueueReport'][_0xc9b5('0x17')](_0x400838)[_0xc9b5('0x1f')](function(_0x53aa97){_0x126ea0[_0xc9b5('0x17')]=_0x53aa97;if(_0x428ded[_0xc9b5('0x28')][_0xc9b5('0x37')]){_0x483c67[_0xc9b5('0x38')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xc9b5('0x39')](_0x483c67);})[_0xc9b5('0x1f')](function(_0x5e1f71){_0x126ea0[_0xc9b5('0x3a')]=_0x5e1f71;return _0x126ea0;})[_0xc9b5('0x1f')](respondWithFilteredResult(_0x58e5fb,_0x483c67))[_0xc9b5('0x3b')](handleError(_0x58e5fb,null));};exports[_0xc9b5('0x3c')]=function(_0x39004a,_0x24b308){var _0x4e61bf={'raw':!![],'where':{'id':_0x39004a[_0xc9b5('0x3d')]['id']}},_0x3fe7fd={};_0x3fe7fd[_0xc9b5('0x26')]=_[_0xc9b5('0x27')](db['OpenchannelQueueReport'][_0xc9b5('0x25')]);_0x3fe7fd['query']=_['keys'](_0x39004a[_0xc9b5('0x28')]);_0x3fe7fd[_0xc9b5('0x29')]=_[_0xc9b5('0x2a')](_0x3fe7fd['model'],_0x3fe7fd['query']);_0x4e61bf[_0xc9b5('0x2b')]=_[_0xc9b5('0x2a')](_0x3fe7fd[_0xc9b5('0x26')],qs[_0xc9b5('0x2c')](_0x39004a[_0xc9b5('0x28')][_0xc9b5('0x2c')]));_0x4e61bf['attributes']=_0x4e61bf[_0xc9b5('0x2b')][_0xc9b5('0x2d')]?_0x4e61bf[_0xc9b5('0x2b')]:_0x3fe7fd[_0xc9b5('0x26')];if(_0x39004a['query']['includeAll']){_0x4e61bf['include']=[{'all':!![]}];}_0x4e61bf=_[_0xc9b5('0x35')]({},_0x4e61bf,_0x39004a[_0xc9b5('0x3e')]);return db['OpenchannelQueueReport']['find'](_0x4e61bf)[_0xc9b5('0x1f')](handleEntityNotFound(_0x24b308,null))[_0xc9b5('0x1f')](respondWithResult(_0x24b308,null))['catch'](handleError(_0x24b308,null));};exports['create']=function(_0x10fc6c,_0x35c673){return db[_0xc9b5('0x24')][_0xc9b5('0x3f')](_0x10fc6c[_0xc9b5('0x40')],{})[_0xc9b5('0x1f')](respondWithResult(_0x35c673,0xc9))[_0xc9b5('0x3b')](handleError(_0x35c673,null));};exports[_0xc9b5('0x1e')]=function(_0x55fdd6,_0x42a8f1){if(_0x55fdd6[_0xc9b5('0x40')]['id']){delete _0x55fdd6[_0xc9b5('0x40')]['id'];}return db[_0xc9b5('0x24')][_0xc9b5('0x41')]({'where':{'id':_0x55fdd6[_0xc9b5('0x3d')]['id']}})[_0xc9b5('0x1f')](handleEntityNotFound(_0x42a8f1,null))[_0xc9b5('0x1f')](saveUpdates(_0x55fdd6[_0xc9b5('0x40')],null))[_0xc9b5('0x1f')](respondWithResult(_0x42a8f1,null))[_0xc9b5('0x3b')](handleError(_0x42a8f1,null));};exports[_0xc9b5('0x20')]=function(_0x1272fb,_0x2e4565){return db[_0xc9b5('0x24')][_0xc9b5('0x41')]({'where':{'id':_0x1272fb[_0xc9b5('0x3d')]['id']}})[_0xc9b5('0x1f')](handleEntityNotFound(_0x2e4565,null))[_0xc9b5('0x1f')](removeEntity(_0x2e4565,null))['catch'](handleError(_0x2e4565,null));};exports[_0xc9b5('0x42')]=function(_0xfc3eb8,_0x4e6fb4){return db['OpenchannelQueueReport'][_0xc9b5('0x42')]()[_0xc9b5('0x1f')](respondWithResult(_0x4e6fb4,null))[_0xc9b5('0x3b')](handleError(_0x4e6fb4,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 65ba512..e13b9fb 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 _0x77f2=['define','uniqueid','util','api','moment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x77f2,0x188));var _0x277f=function(_0x1b8d87,_0x4168fb){_0x1b8d87=_0x1b8d87-0x0;var _0x182b74=_0x77f2[_0x1b8d87];return _0x182b74;};'use strict';var _=require('lodash');var util=require(_0x277f('0x0'));var logger=require('../../config/logger')(_0x277f('0x1'));var moment=require(_0x277f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./openchannelQueueReport.attributes');module[_0x277f('0x3')]=function(_0x26bc5b,_0x59fd13){return _0x26bc5b[_0x277f('0x4')]('OpenchannelQueueReport',attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x277f('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc57c=['./openchannelQueueReport.attributes','exports','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1ad159,_0x12c5d7){var _0x27eb2c=function(_0x2e6433){while(--_0x2e6433){_0x1ad159['push'](_0x1ad159['shift']());}};_0x27eb2c(++_0x12c5d7);}(_0xc57c,0x9f));var _0xcc57=function(_0x316acc,_0x1e9637){_0x316acc=_0x316acc-0x0;var _0x24aa96=_0xc57c[_0x316acc];return _0x24aa96;};'use strict';var _=require(_0xcc57('0x0'));var util=require('util');var logger=require(_0xcc57('0x1'))(_0xcc57('0x2'));var moment=require(_0xcc57('0x3'));var BPromise=require(_0xcc57('0x4'));var rp=require(_0xcc57('0x5'));var attributes=require(_0xcc57('0x6'));module[_0xcc57('0x7')]=function(_0x217b01,_0x436b87){return _0x217b01['define'](_0xcc57('0x8'),attributes,{'tableName':_0xcc57('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcc57('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 75eabb7..f486941 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 _0x6dda=['body','raw','where','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0x6dda,0x125));var _0xa6dd=function(_0x2f1288,_0x261711){_0x2f1288=_0x2f1288-0x0;var _0x3ce20f=_0x6dda[_0x2f1288];return _0x3ce20f;};'use strict';var _=require(_0xa6dd('0x0'));var util=require(_0xa6dd('0x1'));var moment=require(_0xa6dd('0x2'));var BPromise=require(_0xa6dd('0x3'));var rs=require(_0xa6dd('0x4'));var fs=require('fs');var Redis=require(_0xa6dd('0x5'));var db=require(_0xa6dd('0x6'))['db'];var utils=require(_0xa6dd('0x7'));var logger=require('../../config/logger')(_0xa6dd('0x8'));var config=require(_0xa6dd('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa6dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42051c,_0x1e92a6,_0x45652f){return new BPromise(function(_0x2a6f11,_0x41c637){return client[_0xa6dd('0xb')](_0x42051c,_0x45652f)[_0xa6dd('0xc')](function(_0x260222){logger[_0xa6dd('0xd')](_0xa6dd('0xe'),_0x1e92a6,_0xa6dd('0xf'));logger[_0xa6dd('0x10')](_0xa6dd('0x11'),_0x1e92a6,_0xa6dd('0xf'),JSON[_0xa6dd('0x12')](_0x260222));if(_0x260222[_0xa6dd('0x13')]){if(_0x260222[_0xa6dd('0x13')]['code']===0x1f4){logger['error'](_0xa6dd('0xe'),_0x1e92a6,_0x260222[_0xa6dd('0x13')][_0xa6dd('0x14')]);return _0x41c637(_0x260222[_0xa6dd('0x13')][_0xa6dd('0x14')]);}logger[_0xa6dd('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1e92a6,_0x260222[_0xa6dd('0x13')][_0xa6dd('0x14')]);return _0x2a6f11(_0x260222[_0xa6dd('0x13')][_0xa6dd('0x14')]);}else{logger[_0xa6dd('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1e92a6,_0xa6dd('0xf'));_0x2a6f11(_0x260222[_0xa6dd('0x15')][_0xa6dd('0x14')]);}})[_0xa6dd('0x16')](function(_0x5545c0){logger[_0xa6dd('0x13')](_0xa6dd('0xe'),_0x1e92a6,_0x5545c0);_0x41c637(_0x5545c0);});});}exports[_0xa6dd('0x17')]=function(_0x564932){var _0x5d77c6=this;return new Promise(function(_0x2d91bc,_0x3245e2){return db[_0xa6dd('0x18')][_0xa6dd('0x19')](_0x564932['body'],{'raw':_0x564932[_0xa6dd('0x1a')]?_0x564932[_0xa6dd('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xa6dd('0xc')](function(_0x5bda18){logger[_0xa6dd('0xd')]('CreateOpenchannelQueueReport',_0x564932);logger[_0xa6dd('0x10')](_0xa6dd('0x17'),_0x564932,JSON['stringify'](_0x5bda18));_0x2d91bc(_0x5bda18);})[_0xa6dd('0x16')](function(_0x49a28a){logger['error'](_0xa6dd('0x17'),_0x49a28a[_0xa6dd('0x14')],_0x564932);_0x3245e2(_0x5d77c6[_0xa6dd('0x13')](0x1f4,_0x49a28a['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x48022a){var _0x526b6e=this;return new Promise(function(_0x9a2396,_0x58d25b){return db[_0xa6dd('0x18')]['update'](_0x48022a[_0xa6dd('0x1b')],{'raw':_0x48022a[_0xa6dd('0x1a')]?_0x48022a[_0xa6dd('0x1a')][_0xa6dd('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48022a[_0xa6dd('0x1a')]?_0x48022a[_0xa6dd('0x1a')][_0xa6dd('0x1d')]||null:null,'attributes':_0x48022a['options']?_0x48022a[_0xa6dd('0x1a')]['attributes']||null:null,'limit':_0x48022a['options']?_0x48022a['options'][_0xa6dd('0x1e')]||null:null})['then'](function(_0x1e33bd){logger[_0xa6dd('0xd')]('UpdateOpenchannelQueueReport',_0x48022a);logger[_0xa6dd('0x10')](_0xa6dd('0x1f'),_0x48022a,JSON[_0xa6dd('0x12')](_0x1e33bd));_0x9a2396(_0x1e33bd);})[_0xa6dd('0x16')](function(_0x14bae4){logger[_0xa6dd('0x13')](_0xa6dd('0x1f'),_0x14bae4[_0xa6dd('0x14')],_0x48022a);_0x58d25b(_0x526b6e[_0xa6dd('0x13')](0x1f4,_0x14bae4[_0xa6dd('0x14')]));});});}; \ No newline at end of file +var _0x1b61=['create','body','options','CreateOpenchannelQueueReport','stringify','UpdateOpenchannelQueueReport','update','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','OpenchannelQueueReport'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x1b61,0x11a));var _0x11b6=function(_0x2d48a2,_0x34ffa6){_0x2d48a2=_0x2d48a2-0x0;var _0x2ba1cb=_0x1b61[_0x2d48a2];return _0x2ba1cb;};'use strict';var _=require(_0x11b6('0x0'));var util=require(_0x11b6('0x1'));var moment=require(_0x11b6('0x2'));var BPromise=require(_0x11b6('0x3'));var rs=require(_0x11b6('0x4'));var fs=require('fs');var Redis=require(_0x11b6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x11b6('0x6'));var logger=require('../../config/logger')(_0x11b6('0x7'));var config=require(_0x11b6('0x8'));var jayson=require(_0x11b6('0x9'));var client=jayson[_0x11b6('0xa')][_0x11b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e3a19,_0x35768d,_0x3e9ab1){return new BPromise(function(_0x5b7c51,_0x5f47d3){return client[_0x11b6('0xc')](_0x1e3a19,_0x3e9ab1)[_0x11b6('0xd')](function(_0x36aa1b){logger['info'](_0x11b6('0xe'),_0x35768d,_0x11b6('0xf'));logger['debug'](_0x11b6('0x10'),_0x35768d,'request\x20sent',JSON['stringify'](_0x36aa1b));if(_0x36aa1b[_0x11b6('0x11')]){if(_0x36aa1b[_0x11b6('0x11')][_0x11b6('0x12')]===0x1f4){logger[_0x11b6('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x35768d,_0x36aa1b[_0x11b6('0x11')][_0x11b6('0x13')]);return _0x5f47d3(_0x36aa1b[_0x11b6('0x11')][_0x11b6('0x13')]);}logger[_0x11b6('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x35768d,_0x36aa1b[_0x11b6('0x11')][_0x11b6('0x13')]);return _0x5b7c51(_0x36aa1b[_0x11b6('0x11')][_0x11b6('0x13')]);}else{logger[_0x11b6('0x14')](_0x11b6('0xe'),_0x35768d,_0x11b6('0xf'));_0x5b7c51(_0x36aa1b[_0x11b6('0x15')][_0x11b6('0x13')]);}})[_0x11b6('0x16')](function(_0x528d3f){logger[_0x11b6('0x11')](_0x11b6('0xe'),_0x35768d,_0x528d3f);_0x5f47d3(_0x528d3f);});});}exports['CreateOpenchannelQueueReport']=function(_0x123c83){var _0xc41df3=this;return new Promise(function(_0x4b00ff,_0x3ad0bf){return db[_0x11b6('0x17')][_0x11b6('0x18')](_0x123c83[_0x11b6('0x19')],{'raw':_0x123c83[_0x11b6('0x1a')]?_0x123c83[_0x11b6('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5a4334){logger[_0x11b6('0x14')](_0x11b6('0x1b'),_0x123c83);logger['debug']('CreateOpenchannelQueueReport',_0x123c83,JSON[_0x11b6('0x1c')](_0x5a4334));_0x4b00ff(_0x5a4334);})[_0x11b6('0x16')](function(_0x5778e0){logger[_0x11b6('0x11')](_0x11b6('0x1b'),_0x5778e0[_0x11b6('0x13')],_0x123c83);_0x3ad0bf(_0xc41df3[_0x11b6('0x11')](0x1f4,_0x5778e0[_0x11b6('0x13')]));});});};exports[_0x11b6('0x1d')]=function(_0x234a56){var _0x404ac3=this;return new Promise(function(_0x46f560,_0x2d798d){return db['OpenchannelQueueReport'][_0x11b6('0x1e')](_0x234a56[_0x11b6('0x19')],{'raw':_0x234a56[_0x11b6('0x1a')]?_0x234a56[_0x11b6('0x1a')][_0x11b6('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x234a56[_0x11b6('0x1a')]?_0x234a56[_0x11b6('0x1a')][_0x11b6('0x20')]||null:null,'attributes':_0x234a56[_0x11b6('0x1a')]?_0x234a56[_0x11b6('0x1a')][_0x11b6('0x21')]||null:null,'limit':_0x234a56[_0x11b6('0x1a')]?_0x234a56[_0x11b6('0x1a')]['limit']||null:null})['then'](function(_0x47b51f){logger[_0x11b6('0x14')](_0x11b6('0x1d'),_0x234a56);logger['debug'](_0x11b6('0x1d'),_0x234a56,JSON[_0x11b6('0x1c')](_0x47b51f));_0x46f560(_0x47b51f);})[_0x11b6('0x16')](function(_0x175847){logger[_0x11b6('0x11')](_0x11b6('0x1d'),_0x175847[_0x11b6('0x13')],_0x234a56);_0x2d798d(_0x404ac3['error'](0x1f4,_0x175847['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 5304d68..4b9c725 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 _0x84e3=['Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x3d81ea,_0xe26c29){var _0x1b9c80=function(_0x529b58){while(--_0x529b58){_0x3d81ea['push'](_0x3d81ea['shift']());}};_0x1b9c80(++_0xe26c29);}(_0x84e3,0x1a0));var _0x384e=function(_0x36ed8a,_0x123397){_0x36ed8a=_0x36ed8a-0x0;var _0x2f2e4f=_0x84e3[_0x36ed8a];return _0x2f2e4f;};'use strict';var multer=require(_0x384e('0x0'));var util=require(_0x384e('0x1'));var path=require(_0x384e('0x2'));var timeout=require(_0x384e('0x3'));var express=require('express');var router=express[_0x384e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x384e('0x5'));var config=require(_0x384e('0x6'));var controller=require(_0x384e('0x7'));router[_0x384e('0x8')]('/',auth[_0x384e('0x9')](),controller[_0x384e('0xa')]);router['get'](_0x384e('0xb'),auth[_0x384e('0x9')](),controller[_0x384e('0xc')]);router[_0x384e('0x8')](_0x384e('0xd'),auth[_0x384e('0x9')](),controller[_0x384e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x384e('0xf')]);router[_0x384e('0x10')]('/:id',auth[_0x384e('0x9')](),controller[_0x384e('0x11')]);router[_0x384e('0x12')](_0x384e('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x384e('0x13')]=router; \ No newline at end of file +var _0x3d65=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','/describe','isAuthenticated','/:id','show','post','create','put','delete','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3d65,0x131));var _0x53d6=function(_0x3f8309,_0x38eb50){_0x3f8309=_0x3f8309-0x0;var _0xa496c7=_0x3d65[_0x3f8309];return _0xa496c7;};'use strict';var multer=require(_0x53d6('0x0'));var util=require(_0x53d6('0x1'));var path=require('path');var timeout=require(_0x53d6('0x2'));var express=require(_0x53d6('0x3'));var router=express[_0x53d6('0x4')]();var auth=require(_0x53d6('0x5'));var interaction=require(_0x53d6('0x6'));var config=require(_0x53d6('0x7'));var controller=require(_0x53d6('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x53d6('0x9'),auth[_0x53d6('0xa')](),controller['describe']);router['get'](_0x53d6('0xb'),auth[_0x53d6('0xa')](),controller[_0x53d6('0xc')]);router[_0x53d6('0xd')]('/',auth[_0x53d6('0xa')](),controller[_0x53d6('0xe')]);router[_0x53d6('0xf')]('/:id',auth[_0x53d6('0xa')](),controller['update']);router[_0x53d6('0x10')](_0x53d6('0xb'),auth['isAuthenticated'](),controller[_0x53d6('0x11')]);module[_0x53d6('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 c2a8f5b..ad07acd 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 _0xd18c=['sequelize','exports','ENUM','account','agent','queue','DATE','moment'];(function(_0x208af9,_0x428504){var _0x34e94b=function(_0x48aa03){while(--_0x48aa03){_0x208af9['push'](_0x208af9['shift']());}};_0x34e94b(++_0x428504);}(_0xd18c,0x87));var _0xcd18=function(_0x46c8fb,_0x253501){_0x46c8fb=_0x46c8fb-0x0;var _0x48f9eb=_0xd18c[_0x46c8fb];return _0x48f9eb;};'use strict';var moment=require(_0xcd18('0x0'));var Sequelize=require(_0xcd18('0x1'));module[_0xcd18('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xcd18('0x3')](_0xcd18('0x4'),_0xcd18('0x5'),_0xcd18('0x6')),'allowNull':![],'defaultValue':_0xcd18('0x6')},'transferredAt':{'type':Sequelize[_0xcd18('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x23d8=['moment','exports','ENUM','account','agent','DATE'];(function(_0x17279b,_0x4f50f8){var _0x1a5aa7=function(_0x11eef7){while(--_0x11eef7){_0x17279b['push'](_0x17279b['shift']());}};_0x1a5aa7(++_0x4f50f8);}(_0x23d8,0x174));var _0x823d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x23d8[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x823d('0x0'));var Sequelize=require('sequelize');module[_0x823d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x823d('0x2')](_0x823d('0x3'),_0x823d('0x4'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x823d('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 37953d6..7d6dc48 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 _0x4c4e=['model','keys','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','OpenchannelTransferReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','rawAttributes'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4c4e,0x152));var _0xe4c4=function(_0xc21276,_0xc51b54){_0xc21276=_0xc21276-0x0;var _0x234436=_0x4c4e[_0xc21276];return _0x234436;};'use strict';var pdf=require(_0xe4c4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe4c4('0x1'));var zipdir=require(_0xe4c4('0x2'));var jsonpatch=require(_0xe4c4('0x3'));var rp=require('request-promise');var moment=require(_0xe4c4('0x4'));var BPromise=require(_0xe4c4('0x5'));var Mustache=require(_0xe4c4('0x6'));var util=require('util');var path=require(_0xe4c4('0x7'));var sox=require('sox');var csv=require(_0xe4c4('0x8'));var ejs=require(_0xe4c4('0x9'));var fs=require('fs');var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xe4c4('0xf'));var hardwareService=require(_0xe4c4('0x10'));var Redis=require(_0xe4c4('0x11'));var qs=require(_0xe4c4('0x12'));var logger=require(_0xe4c4('0x13'))(_0xe4c4('0x14'));var utils=require('../../config/utils');var config=require(_0xe4c4('0x15'));var db=require(_0xe4c4('0x16'))['db'];function respondWithStatusCode(_0x3805c5,_0x2483d0){_0x2483d0=_0x2483d0||0xcc;return function(_0x50bfab){if(_0x50bfab){return _0x3805c5[_0xe4c4('0x17')](_0x2483d0);}return _0x3805c5[_0xe4c4('0x18')](_0x2483d0)['end']();};}function respondWithResult(_0xe485ca,_0x1a44e5){_0x1a44e5=_0x1a44e5||0xc8;return function(_0x5aa89b){if(_0x5aa89b){return _0xe485ca[_0xe4c4('0x18')](_0x1a44e5)[_0xe4c4('0x19')](_0x5aa89b);}};}function respondWithFilteredResult(_0x5e263c,_0x307aa8){return function(_0x465c9b){if(_0x465c9b){var _0x26ea05=_0x465c9b[_0xe4c4('0x1a')],_0x40a36e=_0x307aa8[_0xe4c4('0x1b')],_0x19e59b=_0x307aa8[_0xe4c4('0x1b')]+_0x307aa8[_0xe4c4('0x1c')],_0x882be2;if(_0x19e59b>=_0x26ea05){_0x19e59b=_0x26ea05;_0x882be2=0xc8;}else{_0x882be2=0xce;}_0x5e263c[_0xe4c4('0x18')](_0x882be2);return _0x5e263c[_0xe4c4('0x1d')](_0xe4c4('0x1e'),_0x40a36e+'-'+_0x19e59b+'/'+_0x26ea05)[_0xe4c4('0x19')](_0x465c9b);}return null;};}function patchUpdates(_0x376585){return function(_0x5a32b5){try{jsonpatch[_0xe4c4('0x1f')](_0x5a32b5,_0x376585,!![]);}catch(_0x24f946){return BPromise[_0xe4c4('0x20')](_0x24f946);}return _0x5a32b5[_0xe4c4('0x21')]();};}function saveUpdates(_0x5da165,_0x3d5856){return function(_0x1cad5d){if(_0x1cad5d){return _0x1cad5d[_0xe4c4('0x22')](_0x5da165)[_0xe4c4('0x23')](function(_0x2c5aea){return _0x2c5aea;});}return null;};}function removeEntity(_0x435940,_0x1d4597){return function(_0x393c96){if(_0x393c96){return _0x393c96[_0xe4c4('0x24')]()[_0xe4c4('0x23')](function(){_0x435940[_0xe4c4('0x18')](0xcc)[_0xe4c4('0x25')]();});}};}function handleEntityNotFound(_0x138ead,_0x1db719){return function(_0x15873e){if(!_0x15873e){_0x138ead['sendStatus'](0x194);}return _0x15873e;};}function handleError(_0x49cadc,_0x403a2c){_0x403a2c=_0x403a2c||0x1f4;return function(_0x4dc8cc){logger[_0xe4c4('0x26')](_0x4dc8cc['stack']);if(_0x4dc8cc[_0xe4c4('0x27')]){delete _0x4dc8cc['name'];}_0x49cadc[_0xe4c4('0x18')](_0x403a2c)['send'](_0x4dc8cc);};}exports[_0xe4c4('0x28')]=function(_0x4a0199,_0x5a2adb){var _0x4cea1f={},_0x5d66ab={},_0x3221cd={'count':0x0,'rows':[]};var _0x48cfe0=db['OpenchannelTransferReport'][_0xe4c4('0x29')];_0x5d66ab[_0xe4c4('0x2a')]=_['keys'](_0x48cfe0);_0x5d66ab['query']=_[_0xe4c4('0x2b')](_0x4a0199[_0xe4c4('0x2c')]);_0x5d66ab['filters']=_[_0xe4c4('0x2d')](_0x5d66ab[_0xe4c4('0x2a')],_0x5d66ab[_0xe4c4('0x2c')]);_0x4cea1f['attributes']=_['intersection'](_0x5d66ab[_0xe4c4('0x2a')],qs[_0xe4c4('0x2e')](_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x2e')]));_0x4cea1f['attributes']=_0x4cea1f['attributes'][_0xe4c4('0x2f')]?_0x4cea1f[_0xe4c4('0x30')]:_0x5d66ab['model'];if(!_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x31')](_0xe4c4('0x32'))){_0x4cea1f['limit']=qs[_0xe4c4('0x1c')](_0x4a0199['query'][_0xe4c4('0x1c')]);_0x4cea1f[_0xe4c4('0x1b')]=qs[_0xe4c4('0x1b')](_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x1b')]);}_0x4cea1f[_0xe4c4('0x33')]=qs[_0xe4c4('0x34')](_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x34')]);_0x4cea1f[_0xe4c4('0x35')]=qs[_0xe4c4('0x36')](_[_0xe4c4('0x37')](_0x4a0199['query'],_0x5d66ab[_0xe4c4('0x36')]));if(_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x38')]){_0x4cea1f['where']=_[_0xe4c4('0x39')](_0x4cea1f[_0xe4c4('0x35')],{'$or':_[_0xe4c4('0x3a')](_0x48cfe0,function(_0x53eb5b){if(_0x53eb5b[_0xe4c4('0x3b')][_0xe4c4('0x3c')]!==_0xe4c4('0x3d')){var _0x1de955={};_0x1de955[_0x53eb5b[_0xe4c4('0x3e')]]={'$like':'%'+_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x38')]+'%'};return _0x1de955;}})});}_0x4cea1f=_[_0xe4c4('0x39')]({},_0x4cea1f,_0x4a0199[_0xe4c4('0x3f')]);var _0x8b5bf3={'where':_0x4cea1f['where']};return db[_0xe4c4('0x40')][_0xe4c4('0x1a')](_0x8b5bf3)[_0xe4c4('0x23')](function(_0x3c16a5){_0x3221cd['count']=_0x3c16a5;if(_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x41')]){_0x4cea1f['include']=[{'all':!![]}];}return db[_0xe4c4('0x40')][_0xe4c4('0x42')](_0x4cea1f);})['then'](function(_0x433f0c){_0x3221cd[_0xe4c4('0x43')]=_0x433f0c;return _0x3221cd;})[_0xe4c4('0x23')](respondWithFilteredResult(_0x5a2adb,_0x4cea1f))[_0xe4c4('0x44')](handleError(_0x5a2adb,null));};exports[_0xe4c4('0x45')]=function(_0xe7a882,_0x96dd48){var _0x43201e={'raw':!![],'where':{'id':_0xe7a882[_0xe4c4('0x46')]['id']}},_0x1e457c={};_0x1e457c[_0xe4c4('0x2a')]=_[_0xe4c4('0x2b')](db['OpenchannelTransferReport'][_0xe4c4('0x29')]);_0x1e457c[_0xe4c4('0x2c')]=_[_0xe4c4('0x2b')](_0xe7a882[_0xe4c4('0x2c')]);_0x1e457c[_0xe4c4('0x36')]=_[_0xe4c4('0x2d')](_0x1e457c['model'],_0x1e457c[_0xe4c4('0x2c')]);_0x43201e['attributes']=_[_0xe4c4('0x2d')](_0x1e457c[_0xe4c4('0x2a')],qs[_0xe4c4('0x2e')](_0xe7a882[_0xe4c4('0x2c')][_0xe4c4('0x2e')]));_0x43201e['attributes']=_0x43201e['attributes'][_0xe4c4('0x2f')]?_0x43201e[_0xe4c4('0x30')]:_0x1e457c[_0xe4c4('0x2a')];if(_0xe7a882['query'][_0xe4c4('0x41')]){_0x43201e[_0xe4c4('0x47')]=[{'all':!![]}];}_0x43201e=_[_0xe4c4('0x39')]({},_0x43201e,_0xe7a882[_0xe4c4('0x3f')]);return db['OpenchannelTransferReport'][_0xe4c4('0x48')](_0x43201e)[_0xe4c4('0x23')](handleEntityNotFound(_0x96dd48,null))[_0xe4c4('0x23')](respondWithResult(_0x96dd48,null))[_0xe4c4('0x44')](handleError(_0x96dd48,null));};exports[_0xe4c4('0x49')]=function(_0x1e459e,_0x1eda5e){return db[_0xe4c4('0x40')][_0xe4c4('0x49')](_0x1e459e['body'],{})[_0xe4c4('0x23')](respondWithResult(_0x1eda5e,0xc9))['catch'](handleError(_0x1eda5e,null));};exports[_0xe4c4('0x22')]=function(_0x7a40c2,_0x396f7a){if(_0x7a40c2[_0xe4c4('0x4a')]['id']){delete _0x7a40c2[_0xe4c4('0x4a')]['id'];}return db[_0xe4c4('0x40')][_0xe4c4('0x48')]({'where':{'id':_0x7a40c2[_0xe4c4('0x46')]['id']}})[_0xe4c4('0x23')](handleEntityNotFound(_0x396f7a,null))[_0xe4c4('0x23')](saveUpdates(_0x7a40c2[_0xe4c4('0x4a')],null))[_0xe4c4('0x23')](respondWithResult(_0x396f7a,null))[_0xe4c4('0x44')](handleError(_0x396f7a,null));};exports[_0xe4c4('0x24')]=function(_0x535bcc,_0x4922f5){return db[_0xe4c4('0x40')][_0xe4c4('0x48')]({'where':{'id':_0x535bcc['params']['id']}})[_0xe4c4('0x23')](handleEntityNotFound(_0x4922f5,null))[_0xe4c4('0x23')](removeEntity(_0x4922f5,null))[_0xe4c4('0x44')](handleError(_0x4922f5,null));};exports[_0xe4c4('0x4b')]=function(_0x1f6d78,_0x5587b2){return db[_0xe4c4('0x40')][_0xe4c4('0x4b')]()['then'](respondWithResult(_0x5587b2,null))[_0xe4c4('0x44')](handleError(_0x5587b2,null));}; \ No newline at end of file +var _0xbec5=['length','hasOwnProperty','order','sort','filter','where','merge','map','type','VIRTUAL','options','OpenchannelTransferReport','count','includeAll','findAll','catch','show','params','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','apply','reject','save','update','then','destroy','error','stack','name','rawAttributes','model','keys','query','filters','intersection','fields','attributes'];(function(_0x1d0b8c,_0x29540e){var _0x366cfa=function(_0x1c110a){while(--_0x1c110a){_0x1d0b8c['push'](_0x1d0b8c['shift']());}};_0x366cfa(++_0x29540e);}(_0xbec5,0xe5));var _0x5bec=function(_0x402731,_0x43c115){_0x402731=_0x402731-0x0;var _0x111736=_0xbec5[_0x402731];return _0x111736;};'use strict';var pdf=require(_0x5bec('0x0'));var emlformat=require(_0x5bec('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5bec('0x2'));var jsonpatch=require(_0x5bec('0x3'));var rp=require(_0x5bec('0x4'));var moment=require(_0x5bec('0x5'));var BPromise=require(_0x5bec('0x6'));var Mustache=require('mustache');var util=require(_0x5bec('0x7'));var path=require(_0x5bec('0x8'));var sox=require(_0x5bec('0x9'));var csv=require('to-csv');var ejs=require(_0x5bec('0xa'));var fs=require('fs');var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x10'));var querystring=require(_0x5bec('0x11'));var Papa=require('papaparse');var authService=require(_0x5bec('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x5bec('0x13'));var qs=require(_0x5bec('0x14'));var logger=require(_0x5bec('0x15'))('api');var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var db=require(_0x5bec('0x18'))['db'];function respondWithStatusCode(_0x57ffc4,_0x6bee21){_0x6bee21=_0x6bee21||0xcc;return function(_0x1c888f){if(_0x1c888f){return _0x57ffc4['sendStatus'](_0x6bee21);}return _0x57ffc4[_0x5bec('0x19')](_0x6bee21)[_0x5bec('0x1a')]();};}function respondWithResult(_0x35393a,_0x6888a4){_0x6888a4=_0x6888a4||0xc8;return function(_0x3198e0){if(_0x3198e0){return _0x35393a[_0x5bec('0x19')](_0x6888a4)[_0x5bec('0x1b')](_0x3198e0);}};}function respondWithFilteredResult(_0x43fd2a,_0x259588){return function(_0x3ebc41){if(_0x3ebc41){var _0x31b9e4=_0x3ebc41['count'],_0x325daf=_0x259588[_0x5bec('0x1c')],_0x11fb8e=_0x259588[_0x5bec('0x1c')]+_0x259588[_0x5bec('0x1d')],_0x506639;if(_0x11fb8e>=_0x31b9e4){_0x11fb8e=_0x31b9e4;_0x506639=0xc8;}else{_0x506639=0xce;}_0x43fd2a[_0x5bec('0x19')](_0x506639);return _0x43fd2a['set']('Content-Range',_0x325daf+'-'+_0x11fb8e+'/'+_0x31b9e4)[_0x5bec('0x1b')](_0x3ebc41);}return null;};}function patchUpdates(_0x6c0d35){return function(_0x4e0191){try{jsonpatch[_0x5bec('0x1e')](_0x4e0191,_0x6c0d35,!![]);}catch(_0xa7e223){return BPromise[_0x5bec('0x1f')](_0xa7e223);}return _0x4e0191[_0x5bec('0x20')]();};}function saveUpdates(_0x554f9f,_0xab397b){return function(_0x5be91c){if(_0x5be91c){return _0x5be91c[_0x5bec('0x21')](_0x554f9f)[_0x5bec('0x22')](function(_0x3e1896){return _0x3e1896;});}return null;};}function removeEntity(_0x43a62d,_0xfed23){return function(_0x5e154e){if(_0x5e154e){return _0x5e154e[_0x5bec('0x23')]()['then'](function(){_0x43a62d[_0x5bec('0x19')](0xcc)[_0x5bec('0x1a')]();});}};}function handleEntityNotFound(_0x5b2636,_0xa414f8){return function(_0xbef70b){if(!_0xbef70b){_0x5b2636['sendStatus'](0x194);}return _0xbef70b;};}function handleError(_0x45afb7,_0x218c13){_0x218c13=_0x218c13||0x1f4;return function(_0x43d460){logger[_0x5bec('0x24')](_0x43d460[_0x5bec('0x25')]);if(_0x43d460[_0x5bec('0x26')]){delete _0x43d460[_0x5bec('0x26')];}_0x45afb7['status'](_0x218c13)['send'](_0x43d460);};}exports['index']=function(_0x2961bd,_0x2cdd2f){var _0x338c25={},_0x4939a5={},_0x2b3b2c={'count':0x0,'rows':[]};var _0x472e54=db['OpenchannelTransferReport'][_0x5bec('0x27')];_0x4939a5[_0x5bec('0x28')]=_['keys'](_0x472e54);_0x4939a5['query']=_[_0x5bec('0x29')](_0x2961bd[_0x5bec('0x2a')]);_0x4939a5[_0x5bec('0x2b')]=_[_0x5bec('0x2c')](_0x4939a5[_0x5bec('0x28')],_0x4939a5[_0x5bec('0x2a')]);_0x338c25['attributes']=_[_0x5bec('0x2c')](_0x4939a5['model'],qs[_0x5bec('0x2d')](_0x2961bd[_0x5bec('0x2a')][_0x5bec('0x2d')]));_0x338c25[_0x5bec('0x2e')]=_0x338c25['attributes'][_0x5bec('0x2f')]?_0x338c25[_0x5bec('0x2e')]:_0x4939a5[_0x5bec('0x28')];if(!_0x2961bd['query'][_0x5bec('0x30')]('nolimit')){_0x338c25[_0x5bec('0x1d')]=qs[_0x5bec('0x1d')](_0x2961bd[_0x5bec('0x2a')]['limit']);_0x338c25[_0x5bec('0x1c')]=qs[_0x5bec('0x1c')](_0x2961bd['query'][_0x5bec('0x1c')]);}_0x338c25[_0x5bec('0x31')]=qs[_0x5bec('0x32')](_0x2961bd[_0x5bec('0x2a')][_0x5bec('0x32')]);_0x338c25['where']=qs[_0x5bec('0x2b')](_['pick'](_0x2961bd[_0x5bec('0x2a')],_0x4939a5[_0x5bec('0x2b')]));if(_0x2961bd[_0x5bec('0x2a')][_0x5bec('0x33')]){_0x338c25[_0x5bec('0x34')]=_[_0x5bec('0x35')](_0x338c25['where'],{'$or':_[_0x5bec('0x36')](_0x472e54,function(_0xb515bb){if(_0xb515bb[_0x5bec('0x37')]['key']!==_0x5bec('0x38')){var _0x355707={};_0x355707[_0xb515bb['field']]={'$like':'%'+_0x2961bd[_0x5bec('0x2a')]['filter']+'%'};return _0x355707;}})});}_0x338c25=_[_0x5bec('0x35')]({},_0x338c25,_0x2961bd[_0x5bec('0x39')]);var _0x402e5d={'where':_0x338c25['where']};return db[_0x5bec('0x3a')][_0x5bec('0x3b')](_0x402e5d)[_0x5bec('0x22')](function(_0x139859){_0x2b3b2c[_0x5bec('0x3b')]=_0x139859;if(_0x2961bd[_0x5bec('0x2a')][_0x5bec('0x3c')]){_0x338c25['include']=[{'all':!![]}];}return db[_0x5bec('0x3a')][_0x5bec('0x3d')](_0x338c25);})[_0x5bec('0x22')](function(_0x414d59){_0x2b3b2c['rows']=_0x414d59;return _0x2b3b2c;})[_0x5bec('0x22')](respondWithFilteredResult(_0x2cdd2f,_0x338c25))[_0x5bec('0x3e')](handleError(_0x2cdd2f,null));};exports[_0x5bec('0x3f')]=function(_0x57e07c,_0x54ecf3){var _0x1a57e3={'raw':!![],'where':{'id':_0x57e07c[_0x5bec('0x40')]['id']}},_0x153d02={};_0x153d02[_0x5bec('0x28')]=_[_0x5bec('0x29')](db['OpenchannelTransferReport']['rawAttributes']);_0x153d02[_0x5bec('0x2a')]=_['keys'](_0x57e07c[_0x5bec('0x2a')]);_0x153d02[_0x5bec('0x2b')]=_[_0x5bec('0x2c')](_0x153d02['model'],_0x153d02[_0x5bec('0x2a')]);_0x1a57e3[_0x5bec('0x2e')]=_['intersection'](_0x153d02[_0x5bec('0x28')],qs[_0x5bec('0x2d')](_0x57e07c[_0x5bec('0x2a')][_0x5bec('0x2d')]));_0x1a57e3[_0x5bec('0x2e')]=_0x1a57e3[_0x5bec('0x2e')][_0x5bec('0x2f')]?_0x1a57e3['attributes']:_0x153d02['model'];if(_0x57e07c[_0x5bec('0x2a')]['includeAll']){_0x1a57e3['include']=[{'all':!![]}];}_0x1a57e3=_[_0x5bec('0x35')]({},_0x1a57e3,_0x57e07c['options']);return db['OpenchannelTransferReport']['find'](_0x1a57e3)[_0x5bec('0x22')](handleEntityNotFound(_0x54ecf3,null))[_0x5bec('0x22')](respondWithResult(_0x54ecf3,null))[_0x5bec('0x3e')](handleError(_0x54ecf3,null));};exports[_0x5bec('0x41')]=function(_0x48858a,_0x387ad9){return db[_0x5bec('0x3a')][_0x5bec('0x41')](_0x48858a[_0x5bec('0x42')],{})['then'](respondWithResult(_0x387ad9,0xc9))[_0x5bec('0x3e')](handleError(_0x387ad9,null));};exports[_0x5bec('0x21')]=function(_0x2bbb1a,_0x51a3f9){if(_0x2bbb1a[_0x5bec('0x42')]['id']){delete _0x2bbb1a['body']['id'];}return db[_0x5bec('0x3a')][_0x5bec('0x43')]({'where':{'id':_0x2bbb1a[_0x5bec('0x40')]['id']}})[_0x5bec('0x22')](handleEntityNotFound(_0x51a3f9,null))['then'](saveUpdates(_0x2bbb1a[_0x5bec('0x42')],null))[_0x5bec('0x22')](respondWithResult(_0x51a3f9,null))[_0x5bec('0x3e')](handleError(_0x51a3f9,null));};exports[_0x5bec('0x23')]=function(_0x35b250,_0x123758){return db[_0x5bec('0x3a')]['find']({'where':{'id':_0x35b250[_0x5bec('0x40')]['id']}})[_0x5bec('0x22')](handleEntityNotFound(_0x123758,null))['then'](removeEntity(_0x123758,null))[_0x5bec('0x3e')](handleError(_0x123758,null));};exports[_0x5bec('0x44')]=function(_0x34ee24,_0x43ddbf){return db[_0x5bec('0x3a')][_0x5bec('0x44')]()[_0x5bec('0x22')](respondWithResult(_0x43ddbf,null))['catch'](handleError(_0x43ddbf,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index d4f7775..06ef3ad 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 _0x5f2f=['bluebird','request-promise','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x143c1b,_0x1702a7){var _0x9d0bf2=function(_0x5f0223){while(--_0x5f0223){_0x143c1b['push'](_0x143c1b['shift']());}};_0x9d0bf2(++_0x1702a7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3cae9d,_0x310b1e){_0x3cae9d=_0x3cae9d-0x0;var _0x4b681d=_0x5f2f[_0x3cae9d];return _0x4b681d;};'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 +var _0x7a54=['report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','./openchannelTransferReport.attributes','exports','define'];(function(_0x4cd39c,_0x2220e0){var _0x197f67=function(_0x2fa2bc){while(--_0x2fa2bc){_0x4cd39c['push'](_0x4cd39c['shift']());}};_0x197f67(++_0x2220e0);}(_0x7a54,0x106));var _0x47a5=function(_0x161c63,_0xb68c10){_0x161c63=_0x161c63-0x0;var _0x1d64f5=_0x7a54[_0x161c63];return _0x1d64f5;};'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')]('OpenchannelTransferReport',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 9a81aa2..47d441c 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 _0xb201=['rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2932af,_0x2af964){var _0x32654e=function(_0x5406d5){while(--_0x5406d5){_0x2932af['push'](_0x2932af['shift']());}};_0x32654e(++_0x2af964);}(_0xb201,0x1b1));var _0x1b20=function(_0x1e218b,_0x1f7e6a){_0x1e218b=_0x1e218b-0x0;var _0x46df30=_0xb201[_0x1e218b];return _0x46df30;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var moment=require(_0x1b20('0x1'));var BPromise=require(_0x1b20('0x2'));var rs=require(_0x1b20('0x3'));var fs=require('fs');var Redis=require(_0x1b20('0x4'));var db=require(_0x1b20('0x5'))['db'];var utils=require(_0x1b20('0x6'));var logger=require('../../config/logger')(_0x1b20('0x7'));var config=require(_0x1b20('0x8'));var jayson=require(_0x1b20('0x9'));var client=jayson['client'][_0x1b20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50cdbc,_0x34304b,_0x2a184f){return new BPromise(function(_0x3cc600,_0x426ae9){return client['request'](_0x50cdbc,_0x2a184f)[_0x1b20('0xb')](function(_0x1f5ae4){logger[_0x1b20('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x34304b,_0x1b20('0xd'));logger['debug'](_0x1b20('0xe'),_0x34304b,'request\x20sent',JSON['stringify'](_0x1f5ae4));if(_0x1f5ae4[_0x1b20('0xf')]){if(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x10')]===0x1f4){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x426ae9(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x3cc600(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}else{logger['info'](_0x1b20('0x11'),_0x34304b,'request\x20sent');_0x3cc600(_0x1f5ae4[_0x1b20('0x13')][_0x1b20('0x12')]);}})['catch'](function(_0x44e713){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x44e713);_0x426ae9(_0x44e713);});});} \ No newline at end of file +var _0xdd51=['stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x401676,_0x3f1436){var _0x4f13fe=function(_0xd2f197){while(--_0xd2f197){_0x401676['push'](_0x401676['shift']());}};_0x4f13fe(++_0x3f1436);}(_0xdd51,0x8b));var _0x1dd5=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xdd51[_0x4fc9e6];return _0x551d28;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1dd5('0x0'));var BPromise=require(_0x1dd5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dd5('0x2'));var db=require(_0x1dd5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dd5('0x4'))('rpc');var config=require(_0x1dd5('0x5'));var jayson=require(_0x1dd5('0x6'));var client=jayson[_0x1dd5('0x7')][_0x1dd5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fce4d,_0x2122af,_0x3fb235){return new BPromise(function(_0x37de4b,_0xa56eb8){return client['request'](_0x4fce4d,_0x3fb235)[_0x1dd5('0x9')](function(_0x2569b8){logger[_0x1dd5('0xa')](_0x1dd5('0xb'),_0x2122af,_0x1dd5('0xc'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2122af,_0x1dd5('0xc'),JSON[_0x1dd5('0xd')](_0x2569b8));if(_0x2569b8['error']){if(_0x2569b8[_0x1dd5('0xe')][_0x1dd5('0xf')]===0x1f4){logger['error'](_0x1dd5('0xb'),_0x2122af,_0x2569b8[_0x1dd5('0xe')]['message']);return _0xa56eb8(_0x2569b8[_0x1dd5('0xe')][_0x1dd5('0x10')]);}logger[_0x1dd5('0xe')](_0x1dd5('0xb'),_0x2122af,_0x2569b8['error'][_0x1dd5('0x10')]);return _0x37de4b(_0x2569b8[_0x1dd5('0xe')][_0x1dd5('0x10')]);}else{logger[_0x1dd5('0xa')](_0x1dd5('0xb'),_0x2122af,'request\x20sent');_0x37de4b(_0x2569b8[_0x1dd5('0x11')]['message']);}})[_0x1dd5('0x12')](function(_0x697ff0){logger[_0x1dd5('0xe')](_0x1dd5('0xb'),_0x2122af,_0x697ff0);_0xa56eb8(_0x697ff0);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index c4ef7b1..9579d21 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 _0x477a=['put','update','multer','path','connect-timeout','Router','../../components/auth/service','./pause.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x27097a,_0x1f0a14){var _0x3380cb=function(_0x5c7304){while(--_0x5c7304){_0x27097a['push'](_0x27097a['shift']());}};_0x3380cb(++_0x1f0a14);}(_0x477a,0x1e2));var _0xa477=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x477a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa477('0x0'));var util=require('util');var path=require(_0xa477('0x1'));var timeout=require(_0xa477('0x2'));var express=require('express');var router=express[_0xa477('0x3')]();var auth=require(_0xa477('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa477('0x5'));router[_0xa477('0x6')]('/',auth['isAuthenticated'](),controller[_0xa477('0x7')]);router[_0xa477('0x6')](_0xa477('0x8'),auth[_0xa477('0x9')](),controller[_0xa477('0xa')]);router[_0xa477('0xb')]('/',auth[_0xa477('0x9')](),controller[_0xa477('0xc')]);router[_0xa477('0xd')]('/:id',auth[_0xa477('0x9')](),controller[_0xa477('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1ddc=['create','put','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./pause.controller','isAuthenticated','index','/:id'];(function(_0x13f2ec,_0x407206){var _0x389ca9=function(_0x43d7d6){while(--_0x43d7d6){_0x13f2ec['push'](_0x13f2ec['shift']());}};_0x389ca9(++_0x407206);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x158bd2,_0x244c08){_0x158bd2=_0x158bd2-0x0;var _0x53c3dc=_0x1ddc[_0x158bd2];return _0x53c3dc;};'use strict';var multer=require('multer');var util=require(_0xc1dd('0x0'));var path=require(_0xc1dd('0x1'));var timeout=require(_0xc1dd('0x2'));var express=require('express');var router=express[_0xc1dd('0x3')]();var auth=require(_0xc1dd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc1dd('0x5'));var controller=require(_0xc1dd('0x6'));router['get']('/',auth[_0xc1dd('0x7')](),controller[_0xc1dd('0x8')]);router['get'](_0xc1dd('0x9'),auth[_0xc1dd('0x7')](),controller['show']);router['post']('/',auth[_0xc1dd('0x7')](),controller[_0xc1dd('0xa')]);router[_0xc1dd('0xb')](_0xc1dd('0x9'),auth['isAuthenticated'](),controller[_0xc1dd('0xc')]);router[_0xc1dd('0xd')](_0xc1dd('0x9'),auth[_0xc1dd('0x7')](),controller['destroy']);module[_0xc1dd('0xe')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 3f21db9..946fbd3 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 _0x188d=['STRING','name','exports'];(function(_0x919a5b,_0x513426){var _0x51e7ed=function(_0x45fca2){while(--_0x45fca2){_0x919a5b['push'](_0x919a5b['shift']());}};_0x51e7ed(++_0x513426);}(_0x188d,0xd4));var _0xd188=function(_0x52096b,_0x20bab4){_0x52096b=_0x52096b-0x0;var _0x2b1cc7=_0x188d[_0x52096b];return _0x2b1cc7;};'use strict';var Sequelize=require('sequelize');module[_0xd188('0x0')]={'name':{'type':Sequelize[_0xd188('0x1')],'unique':_0xd188('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xd188('0x1')]}}; \ No newline at end of file +var _0x694c=['exports','STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x694c,0x103));var _0xc694=function(_0x14ff51,_0x14491b){_0x14ff51=_0x14ff51-0x0;var _0x4e0122=_0x694c[_0x14ff51];return _0x4e0122;};'use strict';var Sequelize=require(_0xc694('0x0'));module[_0xc694('0x1')]={'name':{'type':Sequelize[_0xc694('0x2')],'unique':_0xc694('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 340d388..0ff9006 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 _0xb8a5=['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','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','apply','reject','destroy','then','Pauses','UserProfileResource','error','name','send','index','Pause','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','catch','show','params','rawAttributes','options'];(function(_0x4d430d,_0x13b891){var _0x29d9aa=function(_0xb34a75){while(--_0xb34a75){_0x4d430d['push'](_0x4d430d['shift']());}};_0x29d9aa(++_0x13b891);}(_0xb8a5,0x102));var _0x5b8a=function(_0x29b0a1,_0x5d17fd){_0x29b0a1=_0x29b0a1-0x0;var _0x59de88=_0xb8a5[_0x29b0a1];return _0x59de88;};'use strict';var pdf=require(_0x5b8a('0x0'));var emlformat=require(_0x5b8a('0x1'));var rimraf=require(_0x5b8a('0x2'));var zipdir=require(_0x5b8a('0x3'));var jsonpatch=require(_0x5b8a('0x4'));var rp=require(_0x5b8a('0x5'));var moment=require(_0x5b8a('0x6'));var BPromise=require(_0x5b8a('0x7'));var Mustache=require('mustache');var util=require(_0x5b8a('0x8'));var path=require(_0x5b8a('0x9'));var sox=require(_0x5b8a('0xa'));var csv=require(_0x5b8a('0xb'));var ejs=require(_0x5b8a('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5b8a('0xd'));var crypto=require('crypto');var jsforce=require(_0x5b8a('0xe'));var deskjs=require(_0x5b8a('0xf'));var toCsv=require(_0x5b8a('0xb'));var querystring=require(_0x5b8a('0x10'));var Papa=require(_0x5b8a('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0x5b8a('0x12'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x5b8a('0x13'))(_0x5b8a('0x14'));var utils=require(_0x5b8a('0x15'));var config=require(_0x5b8a('0x16'));var db=require(_0x5b8a('0x17'))['db'];function respondWithStatusCode(_0x542974,_0x4a0dc3){_0x4a0dc3=_0x4a0dc3||0xcc;return function(_0x472dcd){if(_0x472dcd){return _0x542974[_0x5b8a('0x18')](_0x4a0dc3);}return _0x542974[_0x5b8a('0x19')](_0x4a0dc3)['end']();};}function respondWithResult(_0x24697f,_0x3950d3){_0x3950d3=_0x3950d3||0xc8;return function(_0x584671){if(_0x584671){return _0x24697f[_0x5b8a('0x19')](_0x3950d3)['json'](_0x584671);}};}function respondWithFilteredResult(_0x345b5f,_0x1acd0c){return function(_0xdeb2c4){if(_0xdeb2c4){var _0x448d47=_0xdeb2c4[_0x5b8a('0x1a')],_0x3431e2=_0x1acd0c['offset'],_0x35ed54=_0x1acd0c[_0x5b8a('0x1b')]+_0x1acd0c['limit'],_0x59d9b7;if(_0x35ed54>=_0x448d47){_0x35ed54=_0x448d47;_0x59d9b7=0xc8;}else{_0x59d9b7=0xce;}_0x345b5f[_0x5b8a('0x19')](_0x59d9b7);return _0x345b5f[_0x5b8a('0x1c')]('Content-Range',_0x3431e2+'-'+_0x35ed54+'/'+_0x448d47)['json'](_0xdeb2c4);}return null;};}function patchUpdates(_0x4689d4){return function(_0x395e86){try{jsonpatch[_0x5b8a('0x1d')](_0x395e86,_0x4689d4,!![]);}catch(_0x4104e7){return BPromise[_0x5b8a('0x1e')](_0x4104e7);}return _0x395e86['save']();};}function saveUpdates(_0x422914,_0x449e0f){return function(_0x29d01b){if(_0x29d01b){return _0x29d01b['update'](_0x422914)['then'](function(_0x3fdb45){return _0x3fdb45;});}return null;};}function removeEntity(_0x424c67,_0x4d0283){return function(_0x164d6c){if(_0x164d6c){return _0x164d6c[_0x5b8a('0x1f')]()[_0x5b8a('0x20')](function(){var _0x3dc9ab=_0x164d6c['get']({'plain':!![]});var _0x2166b6=_0x5b8a('0x21');return db[_0x5b8a('0x22')]['destroy']({'where':{'type':_0x2166b6,'resourceId':_0x3dc9ab['id']}})[_0x5b8a('0x20')](function(){return _0x164d6c;});})[_0x5b8a('0x20')](function(){_0x424c67['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x261e02,_0x31fdd1){return function(_0xda52a1){if(!_0xda52a1){_0x261e02[_0x5b8a('0x18')](0x194);}return _0xda52a1;};}function handleError(_0x24baa8,_0x49760b){_0x49760b=_0x49760b||0x1f4;return function(_0x550550){logger[_0x5b8a('0x23')](_0x550550['stack']);if(_0x550550[_0x5b8a('0x24')]){delete _0x550550['name'];}_0x24baa8[_0x5b8a('0x19')](_0x49760b)[_0x5b8a('0x25')](_0x550550);};}exports[_0x5b8a('0x26')]=function(_0x1842b1,_0x237c1b){var _0x2f999d={},_0x5d2d75={},_0x449127={'count':0x0,'rows':[]};var _0x3aa0b3=db[_0x5b8a('0x27')]['rawAttributes'];_0x5d2d75[_0x5b8a('0x28')]=_[_0x5b8a('0x29')](_0x3aa0b3);_0x5d2d75[_0x5b8a('0x2a')]=_[_0x5b8a('0x29')](_0x1842b1[_0x5b8a('0x2a')]);_0x5d2d75['filters']=_[_0x5b8a('0x2b')](_0x5d2d75[_0x5b8a('0x28')],_0x5d2d75[_0x5b8a('0x2a')]);_0x2f999d[_0x5b8a('0x2c')]=_[_0x5b8a('0x2b')](_0x5d2d75[_0x5b8a('0x28')],qs[_0x5b8a('0x2d')](_0x1842b1[_0x5b8a('0x2a')][_0x5b8a('0x2d')]));_0x2f999d[_0x5b8a('0x2c')]=_0x2f999d['attributes'][_0x5b8a('0x2e')]?_0x2f999d[_0x5b8a('0x2c')]:_0x5d2d75['model'];if(!_0x1842b1[_0x5b8a('0x2a')][_0x5b8a('0x2f')](_0x5b8a('0x30'))){_0x2f999d['limit']=qs[_0x5b8a('0x31')](_0x1842b1['query']['limit']);_0x2f999d[_0x5b8a('0x1b')]=qs[_0x5b8a('0x1b')](_0x1842b1[_0x5b8a('0x2a')][_0x5b8a('0x1b')]);}_0x2f999d[_0x5b8a('0x32')]=qs['sort'](_0x1842b1[_0x5b8a('0x2a')][_0x5b8a('0x33')]);_0x2f999d[_0x5b8a('0x34')]=qs[_0x5b8a('0x35')](_[_0x5b8a('0x36')](_0x1842b1[_0x5b8a('0x2a')],_0x5d2d75[_0x5b8a('0x35')]));if(_0x1842b1[_0x5b8a('0x2a')][_0x5b8a('0x37')]){_0x2f999d[_0x5b8a('0x34')]=_[_0x5b8a('0x38')](_0x2f999d[_0x5b8a('0x34')],{'$or':_[_0x5b8a('0x39')](_0x3aa0b3,function(_0x174527){if(_0x174527[_0x5b8a('0x3a')][_0x5b8a('0x3b')]!==_0x5b8a('0x3c')){var _0x1c079c={};_0x1c079c[_0x174527[_0x5b8a('0x3d')]]={'$like':'%'+_0x1842b1[_0x5b8a('0x2a')][_0x5b8a('0x37')]+'%'};return _0x1c079c;}})});}_0x2f999d=_[_0x5b8a('0x38')]({},_0x2f999d,_0x1842b1['options']);var _0x31dcf0={'where':_0x2f999d['where']};return db[_0x5b8a('0x27')][_0x5b8a('0x1a')](_0x31dcf0)[_0x5b8a('0x20')](function(_0x1bd41e){_0x449127[_0x5b8a('0x1a')]=_0x1bd41e;if(_0x1842b1['query'][_0x5b8a('0x3e')]){_0x2f999d[_0x5b8a('0x3f')]=[{'all':!![]}];}return db['Pause'][_0x5b8a('0x40')](_0x2f999d);})['then'](function(_0x5bacb1){_0x449127['rows']=_0x5bacb1;return _0x449127;})[_0x5b8a('0x20')](respondWithFilteredResult(_0x237c1b,_0x2f999d))[_0x5b8a('0x41')](handleError(_0x237c1b,null));};exports[_0x5b8a('0x42')]=function(_0x3fba9c,_0x21069e){var _0xc340e1={'raw':!![],'where':{'id':_0x3fba9c[_0x5b8a('0x43')]['id']}},_0x12d79d={};_0x12d79d[_0x5b8a('0x28')]=_['keys'](db[_0x5b8a('0x27')][_0x5b8a('0x44')]);_0x12d79d[_0x5b8a('0x2a')]=_[_0x5b8a('0x29')](_0x3fba9c[_0x5b8a('0x2a')]);_0x12d79d[_0x5b8a('0x35')]=_[_0x5b8a('0x2b')](_0x12d79d['model'],_0x12d79d['query']);_0xc340e1[_0x5b8a('0x2c')]=_[_0x5b8a('0x2b')](_0x12d79d[_0x5b8a('0x28')],qs['fields'](_0x3fba9c[_0x5b8a('0x2a')]['fields']));_0xc340e1['attributes']=_0xc340e1[_0x5b8a('0x2c')][_0x5b8a('0x2e')]?_0xc340e1[_0x5b8a('0x2c')]:_0x12d79d[_0x5b8a('0x28')];if(_0x3fba9c['query'][_0x5b8a('0x3e')]){_0xc340e1[_0x5b8a('0x3f')]=[{'all':!![]}];}_0xc340e1=_['merge']({},_0xc340e1,_0x3fba9c[_0x5b8a('0x45')]);return db['Pause'][_0x5b8a('0x46')](_0xc340e1)[_0x5b8a('0x20')](handleEntityNotFound(_0x21069e,null))[_0x5b8a('0x20')](respondWithResult(_0x21069e,null))[_0x5b8a('0x41')](handleError(_0x21069e,null));};exports[_0x5b8a('0x47')]=function(_0x4ad1d1,_0x3df7a8){return db[_0x5b8a('0x27')][_0x5b8a('0x47')](_0x4ad1d1['body'],{})[_0x5b8a('0x20')](function(_0x4810b4){var _0x3e1ef7=_0x4ad1d1[_0x5b8a('0x48')][_0x5b8a('0x49')]({'plain':!![]});if(!_0x3e1ef7)throw new Error(_0x5b8a('0x4a'));if(_0x3e1ef7[_0x5b8a('0x4b')]==='user'){var _0x591679=_0x4810b4[_0x5b8a('0x49')]({'plain':!![]});var _0x52a004=_0x5b8a('0x21');return db[_0x5b8a('0x4c')][_0x5b8a('0x46')]({'where':{'name':_0x52a004,'userProfileId':_0x3e1ef7[_0x5b8a('0x4d')]},'raw':!![]})[_0x5b8a('0x20')](function(_0x2b884c){if(_0x2b884c&&_0x2b884c[_0x5b8a('0x4e')]===0x0){return db[_0x5b8a('0x22')][_0x5b8a('0x47')]({'name':_0x591679[_0x5b8a('0x24')],'resourceId':_0x591679['id'],'type':_0x2b884c[_0x5b8a('0x24')],'sectionId':_0x2b884c['id']},{})[_0x5b8a('0x20')](function(){return _0x4810b4;});}else{return _0x4810b4;}})[_0x5b8a('0x41')](function(_0x67f3db){logger[_0x5b8a('0x23')](_0x5b8a('0x4f'),_0x67f3db);throw _0x67f3db;});}return _0x4810b4;})[_0x5b8a('0x20')](respondWithResult(_0x3df7a8,0xc9))[_0x5b8a('0x41')](handleError(_0x3df7a8,null));};exports[_0x5b8a('0x50')]=function(_0x2af9be,_0x372f9b){if(_0x2af9be[_0x5b8a('0x51')]['id']){delete _0x2af9be['body']['id'];}return db[_0x5b8a('0x27')][_0x5b8a('0x46')]({'where':{'id':_0x2af9be['params']['id']}})['then'](handleEntityNotFound(_0x372f9b,null))[_0x5b8a('0x20')](saveUpdates(_0x2af9be[_0x5b8a('0x51')],null))[_0x5b8a('0x20')](respondWithResult(_0x372f9b,null))[_0x5b8a('0x41')](handleError(_0x372f9b,null));};exports[_0x5b8a('0x1f')]=function(_0x351dfe,_0x204e77){return db['Pause'][_0x5b8a('0x46')]({'where':{'id':_0x351dfe[_0x5b8a('0x43')]['id']}})[_0x5b8a('0x20')](handleEntityNotFound(_0x204e77,null))[_0x5b8a('0x20')](removeEntity(_0x204e77,null))['catch'](handleError(_0x204e77,null));}; \ No newline at end of file +var _0x3418=['crypto','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','sendStatus','status','count','offset','set','Content-Range','save','then','destroy','get','Pauses','UserProfileResource','end','error','stack','name','send','index','Pause','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','where','map','type','key','VIRTUAL','merge','options','include','rows','show','params','rawAttributes','fields','length','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','lodash','squel'];(function(_0x1c908e,_0x39024e){var _0x592a8a=function(_0x3efa7a){while(--_0x3efa7a){_0x1c908e['push'](_0x1c908e['shift']());}};_0x592a8a(++_0x39024e);}(_0x3418,0x8d));var _0x8341=function(_0x2a6320,_0x31db15){_0x2a6320=_0x2a6320-0x0;var _0x42c239=_0x3418[_0x2a6320];return _0x42c239;};'use strict';var pdf=require(_0x8341('0x0'));var emlformat=require(_0x8341('0x1'));var rimraf=require(_0x8341('0x2'));var zipdir=require(_0x8341('0x3'));var jsonpatch=require(_0x8341('0x4'));var rp=require(_0x8341('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8341('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8341('0x7'));var csv=require(_0x8341('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8341('0x9'));var squel=require(_0x8341('0xa'));var crypto=require(_0x8341('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8341('0xc'));var toCsv=require(_0x8341('0x8'));var querystring=require('querystring');var Papa=require(_0x8341('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x8341('0xe'));var Redis=require(_0x8341('0xf'));var qs=require(_0x8341('0x10'));var logger=require(_0x8341('0x11'))(_0x8341('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d3478,_0x2bd291){_0x2bd291=_0x2bd291||0xcc;return function(_0x8746da){if(_0x8746da){return _0x4d3478[_0x8341('0x13')](_0x2bd291);}return _0x4d3478[_0x8341('0x14')](_0x2bd291)['end']();};}function respondWithResult(_0x1da2ff,_0x36249e){_0x36249e=_0x36249e||0xc8;return function(_0xee13db){if(_0xee13db){return _0x1da2ff['status'](_0x36249e)['json'](_0xee13db);}};}function respondWithFilteredResult(_0x1215e6,_0x14246c){return function(_0x4a3e3c){if(_0x4a3e3c){var _0x4c2737=_0x4a3e3c[_0x8341('0x15')],_0x49a19c=_0x14246c[_0x8341('0x16')],_0x53635a=_0x14246c[_0x8341('0x16')]+_0x14246c['limit'],_0x48b7cd;if(_0x53635a>=_0x4c2737){_0x53635a=_0x4c2737;_0x48b7cd=0xc8;}else{_0x48b7cd=0xce;}_0x1215e6[_0x8341('0x14')](_0x48b7cd);return _0x1215e6[_0x8341('0x17')](_0x8341('0x18'),_0x49a19c+'-'+_0x53635a+'/'+_0x4c2737)['json'](_0x4a3e3c);}return null;};}function patchUpdates(_0x18336d){return function(_0x52a171){try{jsonpatch['apply'](_0x52a171,_0x18336d,!![]);}catch(_0x7c8ab7){return BPromise['reject'](_0x7c8ab7);}return _0x52a171[_0x8341('0x19')]();};}function saveUpdates(_0x599c42,_0x305290){return function(_0x49c5ec){if(_0x49c5ec){return _0x49c5ec['update'](_0x599c42)[_0x8341('0x1a')](function(_0x252bb6){return _0x252bb6;});}return null;};}function removeEntity(_0x281047,_0x19bd6a){return function(_0x1875c8){if(_0x1875c8){return _0x1875c8[_0x8341('0x1b')]()[_0x8341('0x1a')](function(){var _0x1d4edd=_0x1875c8[_0x8341('0x1c')]({'plain':!![]});var _0x18db66=_0x8341('0x1d');return db[_0x8341('0x1e')][_0x8341('0x1b')]({'where':{'type':_0x18db66,'resourceId':_0x1d4edd['id']}})[_0x8341('0x1a')](function(){return _0x1875c8;});})[_0x8341('0x1a')](function(){_0x281047[_0x8341('0x14')](0xcc)[_0x8341('0x1f')]();});}};}function handleEntityNotFound(_0x1df429,_0x138c43){return function(_0x6e8c38){if(!_0x6e8c38){_0x1df429['sendStatus'](0x194);}return _0x6e8c38;};}function handleError(_0x111712,_0x8ebc4f){_0x8ebc4f=_0x8ebc4f||0x1f4;return function(_0x1cd26c){logger[_0x8341('0x20')](_0x1cd26c[_0x8341('0x21')]);if(_0x1cd26c['name']){delete _0x1cd26c[_0x8341('0x22')];}_0x111712['status'](_0x8ebc4f)[_0x8341('0x23')](_0x1cd26c);};}exports[_0x8341('0x24')]=function(_0x1d1c6d,_0xe5e23){var _0x489576={},_0x49e37a={},_0x329bf8={'count':0x0,'rows':[]};var _0x478c81=db[_0x8341('0x25')]['rawAttributes'];_0x49e37a[_0x8341('0x26')]=_[_0x8341('0x27')](_0x478c81);_0x49e37a['query']=_[_0x8341('0x27')](_0x1d1c6d[_0x8341('0x28')]);_0x49e37a[_0x8341('0x29')]=_[_0x8341('0x2a')](_0x49e37a['model'],_0x49e37a['query']);_0x489576[_0x8341('0x2b')]=_[_0x8341('0x2a')](_0x49e37a[_0x8341('0x26')],qs['fields'](_0x1d1c6d['query']['fields']));_0x489576['attributes']=_0x489576[_0x8341('0x2b')]['length']?_0x489576[_0x8341('0x2b')]:_0x49e37a[_0x8341('0x26')];if(!_0x1d1c6d[_0x8341('0x28')][_0x8341('0x2c')](_0x8341('0x2d'))){_0x489576[_0x8341('0x2e')]=qs[_0x8341('0x2e')](_0x1d1c6d[_0x8341('0x28')][_0x8341('0x2e')]);_0x489576[_0x8341('0x16')]=qs[_0x8341('0x16')](_0x1d1c6d[_0x8341('0x28')]['offset']);}_0x489576[_0x8341('0x2f')]=qs[_0x8341('0x30')](_0x1d1c6d[_0x8341('0x28')][_0x8341('0x30')]);_0x489576['where']=qs['filters'](_[_0x8341('0x31')](_0x1d1c6d['query'],_0x49e37a[_0x8341('0x29')]));if(_0x1d1c6d[_0x8341('0x28')]['filter']){_0x489576[_0x8341('0x32')]=_['merge'](_0x489576['where'],{'$or':_[_0x8341('0x33')](_0x478c81,function(_0x19c5bd){if(_0x19c5bd[_0x8341('0x34')][_0x8341('0x35')]!==_0x8341('0x36')){var _0x5d01c5={};_0x5d01c5[_0x19c5bd['field']]={'$like':'%'+_0x1d1c6d[_0x8341('0x28')]['filter']+'%'};return _0x5d01c5;}})});}_0x489576=_[_0x8341('0x37')]({},_0x489576,_0x1d1c6d[_0x8341('0x38')]);var _0x334922={'where':_0x489576[_0x8341('0x32')]};return db[_0x8341('0x25')]['count'](_0x334922)[_0x8341('0x1a')](function(_0xb94e2f){_0x329bf8[_0x8341('0x15')]=_0xb94e2f;if(_0x1d1c6d[_0x8341('0x28')]['includeAll']){_0x489576[_0x8341('0x39')]=[{'all':!![]}];}return db[_0x8341('0x25')]['findAll'](_0x489576);})['then'](function(_0xa45054){_0x329bf8[_0x8341('0x3a')]=_0xa45054;return _0x329bf8;})['then'](respondWithFilteredResult(_0xe5e23,_0x489576))['catch'](handleError(_0xe5e23,null));};exports[_0x8341('0x3b')]=function(_0x1db7fc,_0x106968){var _0x2b10f2={'raw':!![],'where':{'id':_0x1db7fc[_0x8341('0x3c')]['id']}},_0x4cd838={};_0x4cd838['model']=_[_0x8341('0x27')](db['Pause'][_0x8341('0x3d')]);_0x4cd838['query']=_[_0x8341('0x27')](_0x1db7fc['query']);_0x4cd838[_0x8341('0x29')]=_[_0x8341('0x2a')](_0x4cd838[_0x8341('0x26')],_0x4cd838[_0x8341('0x28')]);_0x2b10f2[_0x8341('0x2b')]=_[_0x8341('0x2a')](_0x4cd838[_0x8341('0x26')],qs[_0x8341('0x3e')](_0x1db7fc[_0x8341('0x28')]['fields']));_0x2b10f2['attributes']=_0x2b10f2[_0x8341('0x2b')][_0x8341('0x3f')]?_0x2b10f2[_0x8341('0x2b')]:_0x4cd838[_0x8341('0x26')];if(_0x1db7fc['query'][_0x8341('0x40')]){_0x2b10f2['include']=[{'all':!![]}];}_0x2b10f2=_[_0x8341('0x37')]({},_0x2b10f2,_0x1db7fc[_0x8341('0x38')]);return db['Pause']['find'](_0x2b10f2)[_0x8341('0x1a')](handleEntityNotFound(_0x106968,null))[_0x8341('0x1a')](respondWithResult(_0x106968,null))[_0x8341('0x41')](handleError(_0x106968,null));};exports['create']=function(_0x14404b,_0x3661ec){return db[_0x8341('0x25')][_0x8341('0x42')](_0x14404b[_0x8341('0x43')],{})[_0x8341('0x1a')](function(_0x2e47ea){var _0x3fce4b=_0x14404b[_0x8341('0x44')][_0x8341('0x1c')]({'plain':!![]});if(!_0x3fce4b)throw new Error(_0x8341('0x45'));if(_0x3fce4b[_0x8341('0x46')]===_0x8341('0x44')){var _0xdc96c2=_0x2e47ea[_0x8341('0x1c')]({'plain':!![]});var _0x29d310=_0x8341('0x1d');return db[_0x8341('0x47')][_0x8341('0x48')]({'where':{'name':_0x29d310,'userProfileId':_0x3fce4b['userProfileId']},'raw':!![]})[_0x8341('0x1a')](function(_0x420b27){if(_0x420b27&&_0x420b27[_0x8341('0x49')]===0x0){return db[_0x8341('0x1e')][_0x8341('0x42')]({'name':_0xdc96c2[_0x8341('0x22')],'resourceId':_0xdc96c2['id'],'type':_0x420b27[_0x8341('0x22')],'sectionId':_0x420b27['id']},{})[_0x8341('0x1a')](function(){return _0x2e47ea;});}else{return _0x2e47ea;}})[_0x8341('0x41')](function(_0x21857e){logger[_0x8341('0x20')](_0x8341('0x4a'),_0x21857e);throw _0x21857e;});}return _0x2e47ea;})['then'](respondWithResult(_0x3661ec,0xc9))[_0x8341('0x41')](handleError(_0x3661ec,null));};exports[_0x8341('0x4b')]=function(_0x41f351,_0x3d9e19){if(_0x41f351[_0x8341('0x43')]['id']){delete _0x41f351[_0x8341('0x43')]['id'];}return db['Pause'][_0x8341('0x48')]({'where':{'id':_0x41f351['params']['id']}})[_0x8341('0x1a')](handleEntityNotFound(_0x3d9e19,null))[_0x8341('0x1a')](saveUpdates(_0x41f351[_0x8341('0x43')],null))['then'](respondWithResult(_0x3d9e19,null))[_0x8341('0x41')](handleError(_0x3d9e19,null));};exports[_0x8341('0x1b')]=function(_0x59aea2,_0x12d6b6){return db['Pause'][_0x8341('0x48')]({'where':{'id':_0x59aea2[_0x8341('0x3c')]['id']}})[_0x8341('0x1a')](handleEntityNotFound(_0x12d6b6,null))['then'](removeEntity(_0x12d6b6,null))[_0x8341('0x41')](handleError(_0x12d6b6,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index c8d7e49..7cf5f02 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 _0x2034=['lodash','../../config/logger','moment','bluebird','./pause.attributes','exports','define','tools_pauses'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0x2034,0xb8));var _0x4203=function(_0x5a24b5,_0x4630cf){_0x5a24b5=_0x5a24b5-0x0;var _0x3e8b9c=_0x2034[_0x5a24b5];return _0x3e8b9c;};'use strict';var _=require(_0x4203('0x0'));var util=require('util');var logger=require(_0x4203('0x1'))('api');var moment=require(_0x4203('0x2'));var BPromise=require(_0x4203('0x3'));var rp=require('request-promise');var attributes=require(_0x4203('0x4'));module[_0x4203('0x5')]=function(_0x29ac45,_0x14bbe7){return _0x29ac45[_0x4203('0x6')]('Pause',attributes,{'tableName':_0x4203('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe330=['../../config/logger','moment','bluebird','request-promise','./pause.attributes','define','Pause','tools_pauses','lodash'];(function(_0x49b24a,_0x53f2d8){var _0x277f64=function(_0x3af795){while(--_0x3af795){_0x49b24a['push'](_0x49b24a['shift']());}};_0x277f64(++_0x53f2d8);}(_0xe330,0x1dc));var _0x0e33=function(_0x193bed,_0x50370c){_0x193bed=_0x193bed-0x0;var _0x403556=_0xe330[_0x193bed];return _0x403556;};'use strict';var _=require(_0x0e33('0x0'));var util=require('util');var logger=require(_0x0e33('0x1'))('api');var moment=require(_0x0e33('0x2'));var BPromise=require(_0x0e33('0x3'));var rp=require(_0x0e33('0x4'));var attributes=require(_0x0e33('0x5'));module['exports']=function(_0x519209,_0x267ab5){return _0x519209[_0x0e33('0x6')](_0x0e33('0x7'),attributes,{'tableName':_0x0e33('0x8'),'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 2ada09a..2548475 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 _0x9c89=['include','model','map','stringify','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Pause,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','ShowPause','Pause','options','raw','where','attributes'];(function(_0x96ad7d,_0x1017ba){var _0x32d63a=function(_0xb47ad9){while(--_0xb47ad9){_0x96ad7d['push'](_0x96ad7d['shift']());}};_0x32d63a(++_0x1017ba);}(_0x9c89,0x7c));var _0x99c8=function(_0x88135f,_0x1b5b96){_0x88135f=_0x88135f-0x0;var _0x2ef8c8=_0x9c89[_0x88135f];return _0x2ef8c8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x99c8('0x0'));var BPromise=require(_0x99c8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99c8('0x2'));var db=require(_0x99c8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x99c8('0x4'))('rpc');var config=require(_0x99c8('0x5'));var jayson=require(_0x99c8('0x6'));var client=jayson[_0x99c8('0x7')][_0x99c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e410e,_0x22340b,_0x19720a){return new BPromise(function(_0x60ef13,_0x469625){return client[_0x99c8('0x9')](_0x1e410e,_0x19720a)[_0x99c8('0xa')](function(_0x4c53c9){logger[_0x99c8('0xb')](_0x99c8('0xc'),_0x22340b,'request\x20sent');logger[_0x99c8('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x22340b,_0x99c8('0xe'),JSON['stringify'](_0x4c53c9));if(_0x4c53c9[_0x99c8('0xf')]){if(_0x4c53c9[_0x99c8('0xf')][_0x99c8('0x10')]===0x1f4){logger[_0x99c8('0xf')](_0x99c8('0xc'),_0x22340b,_0x4c53c9['error'][_0x99c8('0x11')]);return _0x469625(_0x4c53c9[_0x99c8('0xf')]['message']);}logger[_0x99c8('0xf')](_0x99c8('0xc'),_0x22340b,_0x4c53c9['error'][_0x99c8('0x11')]);return _0x60ef13(_0x4c53c9[_0x99c8('0xf')][_0x99c8('0x11')]);}else{logger[_0x99c8('0xb')](_0x99c8('0xc'),_0x22340b,_0x99c8('0xe'));_0x60ef13(_0x4c53c9[_0x99c8('0x12')]['message']);}})[_0x99c8('0x13')](function(_0x400a82){logger[_0x99c8('0xf')](_0x99c8('0xc'),_0x22340b,_0x400a82);_0x469625(_0x400a82);});});}exports[_0x99c8('0x14')]=function(_0x341a2d){var _0x5587c6=this;return new Promise(function(_0xb8ef6b,_0x49f8a8){return db[_0x99c8('0x15')]['find']({'raw':_0x341a2d[_0x99c8('0x16')]?_0x341a2d['options'][_0x99c8('0x17')]===undefined?!![]:![]:!![],'where':_0x341a2d[_0x99c8('0x16')]?_0x341a2d[_0x99c8('0x16')][_0x99c8('0x18')]||null:null,'attributes':_0x341a2d[_0x99c8('0x16')]?_0x341a2d[_0x99c8('0x16')][_0x99c8('0x19')]||null:null,'include':_0x341a2d['options']?_0x341a2d['options'][_0x99c8('0x1a')]?_['map'](_0x341a2d[_0x99c8('0x16')][_0x99c8('0x1a')],function(_0x162ce8){return{'model':db[_0x162ce8[_0x99c8('0x1b')]],'as':_0x162ce8['as'],'attributes':_0x162ce8[_0x99c8('0x19')],'include':_0x162ce8[_0x99c8('0x1a')]?_[_0x99c8('0x1c')](_0x162ce8[_0x99c8('0x1a')],function(_0x186742){return{'model':db[_0x186742[_0x99c8('0x1b')]],'as':_0x186742['as'],'attributes':_0x186742[_0x99c8('0x19')],'include':_0x186742[_0x99c8('0x1a')]?_[_0x99c8('0x1c')](_0x186742['include'],function(_0x4371b4){return{'model':db[_0x4371b4[_0x99c8('0x1b')]],'as':_0x4371b4['as'],'attributes':_0x4371b4[_0x99c8('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x124058){logger[_0x99c8('0xb')](_0x99c8('0x14'),_0x341a2d);logger[_0x99c8('0xd')](_0x99c8('0x14'),_0x341a2d,JSON[_0x99c8('0x1d')](_0x124058));_0xb8ef6b(_0x124058);})[_0x99c8('0x13')](function(_0x240838){logger[_0x99c8('0xf')](_0x99c8('0x14'),_0x240838['message'],_0x341a2d);_0x49f8a8(_0x5587c6['error'](0x1f4,_0x240838[_0x99c8('0x11')]));});});}; \ No newline at end of file +var _0x2308=['include','model','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify','error','Pause,\x20%s,\x20%s','message','info','result','ShowPause','Pause','options','where','attributes','map'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2308,0x108));var _0x8230=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x2308[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x8230('0x0'));var util=require('util');var moment=require(_0x8230('0x1'));var BPromise=require(_0x8230('0x2'));var rs=require(_0x8230('0x3'));var fs=require('fs');var Redis=require(_0x8230('0x4'));var db=require(_0x8230('0x5'))['db'];var utils=require(_0x8230('0x6'));var logger=require(_0x8230('0x7'))('rpc');var config=require(_0x8230('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8230('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19990d,_0x26ca48,_0x1938b6){return new BPromise(function(_0x2344b0,_0x1b89be){return client[_0x8230('0xa')](_0x19990d,_0x1938b6)[_0x8230('0xb')](function(_0x3885f3){logger['info']('Pause,\x20%s,\x20%s',_0x26ca48,_0x8230('0xc'));logger['debug'](_0x8230('0xd'),_0x26ca48,_0x8230('0xc'),JSON[_0x8230('0xe')](_0x3885f3));if(_0x3885f3[_0x8230('0xf')]){if(_0x3885f3[_0x8230('0xf')]['code']===0x1f4){logger[_0x8230('0xf')](_0x8230('0x10'),_0x26ca48,_0x3885f3[_0x8230('0xf')][_0x8230('0x11')]);return _0x1b89be(_0x3885f3[_0x8230('0xf')][_0x8230('0x11')]);}logger['error']('Pause,\x20%s,\x20%s',_0x26ca48,_0x3885f3[_0x8230('0xf')][_0x8230('0x11')]);return _0x2344b0(_0x3885f3[_0x8230('0xf')][_0x8230('0x11')]);}else{logger[_0x8230('0x12')](_0x8230('0x10'),_0x26ca48,_0x8230('0xc'));_0x2344b0(_0x3885f3[_0x8230('0x13')]['message']);}})['catch'](function(_0x317c66){logger[_0x8230('0xf')](_0x8230('0x10'),_0x26ca48,_0x317c66);_0x1b89be(_0x317c66);});});}exports[_0x8230('0x14')]=function(_0x293c54){var _0x2310b4=this;return new Promise(function(_0x33099c,_0x3da24e){return db[_0x8230('0x15')]['find']({'raw':_0x293c54['options']?_0x293c54[_0x8230('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x293c54[_0x8230('0x16')]?_0x293c54[_0x8230('0x16')][_0x8230('0x17')]||null:null,'attributes':_0x293c54[_0x8230('0x16')]?_0x293c54[_0x8230('0x16')][_0x8230('0x18')]||null:null,'include':_0x293c54['options']?_0x293c54[_0x8230('0x16')]['include']?_[_0x8230('0x19')](_0x293c54[_0x8230('0x16')][_0x8230('0x1a')],function(_0x338e94){return{'model':db[_0x338e94[_0x8230('0x1b')]],'as':_0x338e94['as'],'attributes':_0x338e94[_0x8230('0x18')],'include':_0x338e94[_0x8230('0x1a')]?_[_0x8230('0x19')](_0x338e94[_0x8230('0x1a')],function(_0x51604c){return{'model':db[_0x51604c[_0x8230('0x1b')]],'as':_0x51604c['as'],'attributes':_0x51604c[_0x8230('0x18')],'include':_0x51604c[_0x8230('0x1a')]?_['map'](_0x51604c[_0x8230('0x1a')],function(_0xae7f97){return{'model':db[_0xae7f97[_0x8230('0x1b')]],'as':_0xae7f97['as'],'attributes':_0xae7f97['attributes']};}):[]};}):[]};}):[]:[]})[_0x8230('0xb')](function(_0x1d3fb5){logger[_0x8230('0x12')](_0x8230('0x14'),_0x293c54);logger[_0x8230('0x1c')](_0x8230('0x14'),_0x293c54,JSON[_0x8230('0xe')](_0x1d3fb5));_0x33099c(_0x1d3fb5);})['catch'](function(_0x5d5014){logger[_0x8230('0xf')]('ShowPause',_0x5d5014['message'],_0x293c54);_0x3da24e(_0x2310b4[_0x8230('0xf')](0x1f4,_0x5d5014['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 8fbf56e..fd74e27 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 _0x0e38=['delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/webhook','webhookGet','/:id','isAuthenticated','/:id/download','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','update'];(function(_0x1a22d0,_0xbc1a43){var _0x4c34c1=function(_0x4ba94b){while(--_0x4ba94b){_0x1a22d0['push'](_0x1a22d0['shift']());}};_0x4c34c1(++_0xbc1a43);}(_0x0e38,0xe9));var _0x80e3=function(_0x2a5f77,_0x565cd1){_0x2a5f77=_0x2a5f77-0x0;var _0x571e17=_0x0e38[_0x2a5f77];return _0x571e17;};'use strict';var multer=require(_0x80e3('0x0'));var util=require(_0x80e3('0x1'));var path=require(_0x80e3('0x2'));var timeout=require('connect-timeout');var express=require(_0x80e3('0x3'));var router=express[_0x80e3('0x4')]();var auth=require(_0x80e3('0x5'));var interaction=require(_0x80e3('0x6'));var config=require(_0x80e3('0x7'));var controller=require('./plugin.controller');router[_0x80e3('0x8')]('/',auth['isAuthenticated'](),controller[_0x80e3('0x9')]);router[_0x80e3('0x8')](_0x80e3('0xa'),controller[_0x80e3('0xb')]);router[_0x80e3('0x8')](_0x80e3('0xc'),auth[_0x80e3('0xd')](),controller['show']);router['get'](_0x80e3('0xe'),auth[_0x80e3('0xd')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x212622,_0x5c8450,_0x27ab8d){_0x27ab8d(null,path['join'](config[_0x80e3('0xf')],_0x80e3('0x10')));},'filename':function(_0x3383b1,_0x2446a7,_0x12c467){_0x2446a7[_0x80e3('0x11')]=_0x2446a7[_0x80e3('0x11')][_0x80e3('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x12c467(null,util[_0x80e3('0x13')](_0x80e3('0x14'),path[_0x80e3('0x15')](_0x2446a7[_0x80e3('0x11')],path[_0x80e3('0x16')](_0x2446a7[_0x80e3('0x11')])),Date[_0x80e3('0x17')](),path[_0x80e3('0x16')](_0x2446a7[_0x80e3('0x11')])));}})});router[_0x80e3('0x18')]('/',upload[_0x80e3('0x19')](_0x80e3('0x1a')),controller[_0x80e3('0x1b')]);router[_0x80e3('0x18')](_0x80e3('0xa'),controller[_0x80e3('0x1c')]);router[_0x80e3('0x1d')](_0x80e3('0xc'),auth['isAuthenticated'](),controller[_0x80e3('0x1e')]);router[_0x80e3('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x80e3('0x1f')]);module[_0x80e3('0x20')]=router; \ No newline at end of file +var _0x9697=['post','single','file','upload','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','now'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9697,0x1b6));var _0x7969=function(_0x58c0a7,_0x4afc08){_0x58c0a7=_0x58c0a7-0x0;var _0x18f837=_0x9697[_0x58c0a7];return _0x18f837;};'use strict';var multer=require(_0x7969('0x0'));var util=require(_0x7969('0x1'));var path=require(_0x7969('0x2'));var timeout=require(_0x7969('0x3'));var express=require(_0x7969('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7969('0x5'));var config=require(_0x7969('0x6'));var controller=require(_0x7969('0x7'));router[_0x7969('0x8')]('/',auth[_0x7969('0x9')](),controller[_0x7969('0xa')]);router[_0x7969('0x8')](_0x7969('0xb'),controller[_0x7969('0xc')]);router[_0x7969('0x8')](_0x7969('0xd'),auth[_0x7969('0x9')](),controller['show']);router[_0x7969('0x8')](_0x7969('0xe'),auth['isAuthenticated'](),controller[_0x7969('0xf')]);var upload=multer({'storage':multer[_0x7969('0x10')]({'destination':function(_0x4cbb3a,_0x21eb29,_0x33f67f){_0x33f67f(null,path[_0x7969('0x11')](config[_0x7969('0x12')],_0x7969('0x13')));},'filename':function(_0x49ab10,_0x41e360,_0x510a12){_0x41e360[_0x7969('0x14')]=_0x41e360['originalname'][_0x7969('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x510a12(null,util[_0x7969('0x16')]('%s-%s%s',path['basename'](_0x41e360[_0x7969('0x14')],path['extname'](_0x41e360[_0x7969('0x14')])),Date[_0x7969('0x17')](),path['extname'](_0x41e360[_0x7969('0x14')])));}})});router[_0x7969('0x18')]('/',upload[_0x7969('0x19')](_0x7969('0x1a')),controller[_0x7969('0x1b')]);router[_0x7969('0x18')]('/webhook',controller[_0x7969('0x1c')]);router[_0x7969('0x1d')](_0x7969('0xd'),auth[_0x7969('0x9')](),controller[_0x7969('0x1e')]);router[_0x7969('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x7969('0x1f')]);module[_0x7969('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index bf79600..cdabf3f 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 _0x430c=['html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','ENUM'];(function(_0x1ff93f,_0x1b76bf){var _0x31290e=function(_0x327304){while(--_0x327304){_0x1ff93f['push'](_0x1ff93f['shift']());}};_0x31290e(++_0x1b76bf);}(_0x430c,0x177));var _0xc430=function(_0x337a10,_0x5191c7){_0x337a10=_0x337a10-0x0;var _0x575f98=_0x430c[_0x337a10];return _0x575f98;};'use strict';var Sequelize=require('sequelize');module[_0xc430('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc430('0x1')](_0xc430('0x2'),_0xc430('0x3'))},'description':{'type':Sequelize[_0xc430('0x4')]},'version':{'type':Sequelize[_0xc430('0x4')]},'path':{'type':Sequelize[_0xc430('0x5')],'comment':_0xc430('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc430('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0xc430('0x8'),_0xc430('0x9'),_0xc430('0xa'),_0xc430('0xb')),'defaultValue':'always','comment':_0xc430('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xc430('0x5')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xc430('0x5')]}}; \ No newline at end of file +var _0x6340=['BOOLEAN','agentOnly','always','never','sequelize','exports','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x6340,0x100));var _0x0634=function(_0x3f55de,_0x3ae98f){_0x3f55de=_0x3f55de-0x0;var _0x2698de=_0x6340[_0x3f55de];return _0x2698de;};'use strict';var Sequelize=require(_0x0634('0x0'));module[_0x0634('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0634('0x2')](_0x0634('0x3'),_0x0634('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x0634('0x5')]},'path':{'type':Sequelize[_0x0634('0x6')],'comment':_0x0634('0x7')},'active':{'type':Sequelize[_0x0634('0x8')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x0634('0x2')]('adminOnly',_0x0634('0x9'),_0x0634('0xa'),_0x0634('0xb')),'defaultValue':_0x0634('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x0634('0x6')]},'adminUrl':{'type':Sequelize[_0x0634('0x6')]},'agentUrl':{'type':Sequelize[_0x0634('0x6')]},'scriptName':{'type':Sequelize[_0x0634('0x6')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 1625799..f7703c9 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 _0x0eb5=['filter','merge','map','type','VIRTUAL','where','Plugin','includeAll','include','findAll','rows','catch','show','params','length','options','find','download','path','join','root','server/files/plugins','basename','createWriteStream','zip','ENOENT','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','**/*','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','manifest.json','Plugin\x20manifest\x20missing','readFileSync','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','views','parameters','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','format','%s%s','headers','content-length','set','statusCode','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','archiver','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort'];(function(_0x1bc3d7,_0x442794){var _0x276f8a=function(_0x363199){while(--_0x363199){_0x1bc3d7['push'](_0x1bc3d7['shift']());}};_0x276f8a(++_0x442794);}(_0x0eb5,0x6b));var _0x50eb=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0eb5[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0x50eb('0x0'));var emlformat=require(_0x50eb('0x1'));var rimraf=require(_0x50eb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50eb('0x3'));var rp=require(_0x50eb('0x4'));var moment=require(_0x50eb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x50eb('0x6'));var util=require(_0x50eb('0x7'));var path=require('path');var sox=require(_0x50eb('0x8'));var csv=require(_0x50eb('0x9'));var ejs=require(_0x50eb('0xa'));var fs=require('fs');var _=require(_0x50eb('0xb'));var squel=require('squel');var crypto=require(_0x50eb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x50eb('0xd'));var toCsv=require(_0x50eb('0x9'));var querystring=require(_0x50eb('0xe'));var Papa=require(_0x50eb('0xf'));var authService=require(_0x50eb('0x10'));var hardwareService=require(_0x50eb('0x11'));var Redis=require(_0x50eb('0x12'));var extract=require('extract-zip');var rimraf=require(_0x50eb('0x2'));var archiver=require(_0x50eb('0x13'));var qs=require(_0x50eb('0x14'));var logger=require('../../config/logger')(_0x50eb('0x15'));var utils=require(_0x50eb('0x16'));var config=require(_0x50eb('0x17'));var db=require(_0x50eb('0x18'))['db'];config[_0x50eb('0x19')]=_[_0x50eb('0x1a')](config[_0x50eb('0x19')],{'host':_0x50eb('0x1b'),'port':0x18eb});var socket=require(_0x50eb('0x1c'))(new Redis(config[_0x50eb('0x19')]));require(_0x50eb('0x1d'))[_0x50eb('0x1e')](socket);function respondWithStatusCode(_0x3900ac,_0x319231){_0x319231=_0x319231||0xcc;return function(_0x1d0964){if(_0x1d0964){return _0x3900ac[_0x50eb('0x1f')](_0x319231);}return _0x3900ac[_0x50eb('0x20')](_0x319231)[_0x50eb('0x21')]();};}function respondWithResult(_0x5047bb,_0x131ca1){_0x131ca1=_0x131ca1||0xc8;return function(_0x1e80b8){if(_0x1e80b8){return _0x5047bb['status'](_0x131ca1)[_0x50eb('0x22')](_0x1e80b8);}};}function respondWithFilteredResult(_0x51d659,_0x5d65ff){return function(_0x3de291){if(_0x3de291){var _0x4c5391=_0x3de291[_0x50eb('0x23')],_0x5acdce=_0x5d65ff[_0x50eb('0x24')],_0x347993=_0x5d65ff[_0x50eb('0x24')]+_0x5d65ff['limit'],_0xc0978b;if(_0x347993>=_0x4c5391){_0x347993=_0x4c5391;_0xc0978b=0xc8;}else{_0xc0978b=0xce;}_0x51d659[_0x50eb('0x20')](_0xc0978b);return _0x51d659['set'](_0x50eb('0x25'),_0x5acdce+'-'+_0x347993+'/'+_0x4c5391)['json'](_0x3de291);}return null;};}function patchUpdates(_0x7ee07b){return function(_0x30aeca){try{jsonpatch[_0x50eb('0x26')](_0x30aeca,_0x7ee07b,!![]);}catch(_0x40a359){return BPromise[_0x50eb('0x27')](_0x40a359);}return _0x30aeca[_0x50eb('0x28')]();};}function saveUpdates(_0x11fca7,_0x43f352){return function(_0x5c5eda){if(_0x5c5eda){return _0x5c5eda[_0x50eb('0x29')](_0x11fca7)[_0x50eb('0x2a')](function(_0x71b4af){return _0x71b4af;});}return null;};}function removeEntity(_0x490554,_0x46b266){return function(_0x3d4b7e){if(_0x3d4b7e){return _0x3d4b7e[_0x50eb('0x2b')]()[_0x50eb('0x2a')](function(){var _0x26086f=_0x3d4b7e[_0x50eb('0x2c')]({'plain':!![]});var _0x800294=_0x50eb('0x2d');return db[_0x50eb('0x2e')][_0x50eb('0x2b')]({'where':{'type':_0x800294,'resourceId':_0x26086f['id']}})[_0x50eb('0x2a')](function(){return _0x3d4b7e;});})[_0x50eb('0x2a')](function(){_0x490554[_0x50eb('0x20')](0xcc)[_0x50eb('0x21')]();});}};}function handleEntityNotFound(_0x2a2601,_0x3f0b7b){return function(_0x18eb2a){if(!_0x18eb2a){_0x2a2601[_0x50eb('0x1f')](0x194);}return _0x18eb2a;};}function handleError(_0x533e64,_0x3de98b){_0x3de98b=_0x3de98b||0x1f4;return function(_0x45f4df){logger['error'](_0x45f4df['stack']);if(_0x45f4df[_0x50eb('0x2f')]){delete _0x45f4df['name'];}_0x533e64['status'](_0x3de98b)[_0x50eb('0x30')](_0x45f4df);};}exports['index']=function(_0x2785af,_0x3d9d87){var _0x1f499e={},_0x112786={},_0x530a3b={'count':0x0,'rows':[]};var _0x1f8507=db['Plugin'][_0x50eb('0x31')];_0x112786[_0x50eb('0x32')]=_[_0x50eb('0x33')](_0x1f8507);_0x112786[_0x50eb('0x34')]=_[_0x50eb('0x33')](_0x2785af['query']);_0x112786[_0x50eb('0x35')]=_[_0x50eb('0x36')](_0x112786[_0x50eb('0x32')],_0x112786['query']);_0x1f499e[_0x50eb('0x37')]=_[_0x50eb('0x36')](_0x112786[_0x50eb('0x32')],qs[_0x50eb('0x38')](_0x2785af[_0x50eb('0x34')][_0x50eb('0x38')]));_0x1f499e[_0x50eb('0x37')]=_0x1f499e[_0x50eb('0x37')]['length']?_0x1f499e['attributes']:_0x112786[_0x50eb('0x32')];if(!_0x2785af['query'][_0x50eb('0x39')]('nolimit')){_0x1f499e[_0x50eb('0x3a')]=qs[_0x50eb('0x3a')](_0x2785af[_0x50eb('0x34')][_0x50eb('0x3a')]);_0x1f499e[_0x50eb('0x24')]=qs[_0x50eb('0x24')](_0x2785af[_0x50eb('0x34')][_0x50eb('0x24')]);}_0x1f499e[_0x50eb('0x3b')]=qs[_0x50eb('0x3c')](_0x2785af[_0x50eb('0x34')][_0x50eb('0x3c')]);_0x1f499e['where']=qs['filters'](_['pick'](_0x2785af[_0x50eb('0x34')],_0x112786['filters']));if(_0x2785af[_0x50eb('0x34')][_0x50eb('0x3d')]){_0x1f499e['where']=_[_0x50eb('0x3e')](_0x1f499e['where'],{'$or':_[_0x50eb('0x3f')](_0x1f8507,function(_0x2e292f){if(_0x2e292f[_0x50eb('0x40')]['key']!==_0x50eb('0x41')){var _0x1f85e3={};_0x1f85e3[_0x2e292f['field']]={'$like':'%'+_0x2785af[_0x50eb('0x34')][_0x50eb('0x3d')]+'%'};return _0x1f85e3;}})});}_0x1f499e=_[_0x50eb('0x3e')]({},_0x1f499e,_0x2785af['options']);var _0x431e2b={'where':_0x1f499e[_0x50eb('0x42')]};return db[_0x50eb('0x43')]['count'](_0x431e2b)['then'](function(_0x5d4f39){_0x530a3b[_0x50eb('0x23')]=_0x5d4f39;if(_0x2785af[_0x50eb('0x34')][_0x50eb('0x44')]){_0x1f499e[_0x50eb('0x45')]=[{'all':!![]}];}return db[_0x50eb('0x43')][_0x50eb('0x46')](_0x1f499e);})[_0x50eb('0x2a')](function(_0x3b2e85){_0x530a3b[_0x50eb('0x47')]=_0x3b2e85;return _0x530a3b;})['then'](respondWithFilteredResult(_0x3d9d87,_0x1f499e))[_0x50eb('0x48')](handleError(_0x3d9d87,null));};exports[_0x50eb('0x49')]=function(_0x76d779,_0xbfe734){var _0x7d4515={'raw':!![],'where':{'id':_0x76d779[_0x50eb('0x4a')]['id']}},_0x58da0c={};_0x58da0c[_0x50eb('0x32')]=_[_0x50eb('0x33')](db[_0x50eb('0x43')][_0x50eb('0x31')]);_0x58da0c[_0x50eb('0x34')]=_[_0x50eb('0x33')](_0x76d779['query']);_0x58da0c[_0x50eb('0x35')]=_[_0x50eb('0x36')](_0x58da0c['model'],_0x58da0c[_0x50eb('0x34')]);_0x7d4515[_0x50eb('0x37')]=_[_0x50eb('0x36')](_0x58da0c['model'],qs[_0x50eb('0x38')](_0x76d779['query'][_0x50eb('0x38')]));_0x7d4515[_0x50eb('0x37')]=_0x7d4515[_0x50eb('0x37')][_0x50eb('0x4b')]?_0x7d4515['attributes']:_0x58da0c[_0x50eb('0x32')];if(_0x76d779[_0x50eb('0x34')]['includeAll']){_0x7d4515[_0x50eb('0x45')]=[{'all':!![]}];}_0x7d4515=_[_0x50eb('0x3e')]({},_0x7d4515,_0x76d779[_0x50eb('0x4c')]);return db['Plugin'][_0x50eb('0x4d')](_0x7d4515)[_0x50eb('0x2a')](handleEntityNotFound(_0xbfe734,null))['then'](respondWithResult(_0xbfe734,null))['catch'](handleError(_0xbfe734,null));};exports[_0x50eb('0x4e')]=function(_0x563123,_0x55cf67,_0x5d8806){return db[_0x50eb('0x43')][_0x50eb('0x4d')]({'where':{'id':_0x563123[_0x50eb('0x4a')]['id']},'attributes':['name',_0x50eb('0x4f')],'raw':!![]})[_0x50eb('0x2a')](handleEntityNotFound(_0x55cf67,null))[_0x50eb('0x2a')](function(_0x48ba38){if(_0x48ba38){var _0x38d4d3=path[_0x50eb('0x50')](config[_0x50eb('0x51')],_0x50eb('0x52'),util['format']('%s.zip',path[_0x50eb('0x53')](_0x48ba38['path'])));var _0x352461=fs[_0x50eb('0x54')](_0x38d4d3);var _0x4ba84a=archiver(_0x50eb('0x55'),{'zlib':{'level':0x9}});_0x4ba84a['on']('warning',function(_0x539fdf){if(_0x539fdf['code']===_0x50eb('0x56')){logger[_0x50eb('0x57')](_0x539fdf);}else{throw new db[(_0x50eb('0x58'))]['Error'](_0x50eb('0x59'));}});_0x4ba84a['on'](_0x50eb('0x57'),function(_0x3ee296){throw new db[(_0x50eb('0x58'))][(_0x50eb('0x5a'))](_0x50eb('0x59'));});_0x4ba84a[_0x50eb('0x5b')](_0x352461);_0x4ba84a['glob'](_0x50eb('0x5c'),{'cwd':path[_0x50eb('0x50')](config['root'],_0x50eb('0x52'),path['dirname'](_0x48ba38[_0x50eb('0x4f')])),'ignore':[path['join'](path[_0x50eb('0x53')](_0x48ba38[_0x50eb('0x4f')]),_0x50eb('0x5d')),path['join'](path[_0x50eb('0x53')](_0x48ba38[_0x50eb('0x4f')]),_0x50eb('0x5e'))],'nodir':!![]})['finalize']();_0x352461['on'](_0x50eb('0x5f'),function(){if(!fs[_0x50eb('0x60')](_0x38d4d3)){throw new db['Sequelize'][(_0x50eb('0x5a'))](_0x50eb('0x61'));}return _0x55cf67[_0x50eb('0x4e')](_0x38d4d3,util['format']('%s.zip',path[_0x50eb('0x53')](_0x48ba38[_0x50eb('0x4f')])),function(_0x2c4e2f){if(_0x2c4e2f){throw new db[(_0x50eb('0x58'))][(_0x50eb('0x5a'))](_0x50eb('0x62'));}fs[_0x50eb('0x63')](_0x38d4d3);logger[_0x50eb('0x64')]('Download\x20completed');logger[_0x50eb('0x64')](_0x50eb('0x65'));});});}return null;})[_0x50eb('0x48')](handleError(_0x55cf67,null));};exports[_0x50eb('0x66')]=function(_0x47840c,_0x52cacd,_0x421c88){var _0x3b3aca=path[_0x50eb('0x53')](_0x47840c[_0x50eb('0x67')]['filename'],path['extname'](_0x47840c[_0x50eb('0x67')][_0x50eb('0x68')]));var _0x1b161b=path[_0x50eb('0x50')](config[_0x50eb('0x51')],_0x50eb('0x52'),_0x47840c[_0x50eb('0x67')][_0x50eb('0x68')]);var _0x1ce8ad=path[_0x50eb('0x50')](config[_0x50eb('0x51')],_0x50eb('0x52'),_0x3b3aca);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x1b161b);logger[_0x50eb('0x64')](_0x50eb('0x69'),_0x1ce8ad);try{fs[_0x50eb('0x6a')](_0x1b161b,parseInt(_0x50eb('0x6b'),0x8));extract(_0x1b161b,{'dir':_0x1ce8ad},function(_0x2aee1a){if(_0x2aee1a){logger['error'](_0x2aee1a);handleError(_0x2aee1a,!![]);};var _0x1a6ded=fs[_0x50eb('0x6c')](_0x1ce8ad);if(_0x1a6ded[_0x50eb('0x4b')]>0x1){removeReferences(_0x1b161b,_0x1ce8ad);logger[_0x50eb('0x57')]('Invalid\x20plugin\x20structure');return _0x421c88(new Error(_0x50eb('0x6d')));}var _0x10fb6d=fs[_0x50eb('0x6e')](path['join'](_0x1ce8ad,_0x1a6ded[0x0]));if(_0x10fb6d[_0x50eb('0x6f')]()){removeReferences(_0x1b161b,_0x1ce8ad);logger[_0x50eb('0x57')](_0x50eb('0x6d'));return _0x421c88(new Error(_0x50eb('0x6d')));}if(_0x10fb6d['isDirectory']()){var _0x495554=fs[_0x50eb('0x6c')](path[_0x50eb('0x50')](_0x1ce8ad,_0x1a6ded[0x0]));if(_0x495554[_0x50eb('0x4b')]===0x0){removeReferences(_0x1b161b,_0x1ce8ad);logger[_0x50eb('0x57')](_0x50eb('0x6d'));return _0x421c88(new Error(_0x50eb('0x6d')));}var _0x37a94d=_0x495554['some'](function(_0x5e13b4){return _0x5e13b4===_0x50eb('0x70');});if(!_0x37a94d){return _0x421c88(new Error(_0x50eb('0x71')));}var _0x1d67b9=fs[_0x50eb('0x72')](path[_0x50eb('0x50')](_0x1ce8ad,_0x1a6ded[0x0],'manifest.json'));var _0x4fa41c=JSON['parse'](_0x1d67b9);if(_0x50eb('0x73')==typeof _0x4fa41c[_0x50eb('0x2f')]){return _0x421c88(new Error(_0x50eb('0x74')));}if(_0x50eb('0x73')==typeof _0x4fa41c[_0x50eb('0x40')]){return _0x421c88(new Error(_0x50eb('0x75')));}if(_0x50eb('0x73')==typeof _0x4fa41c[_0x50eb('0x76')]){return _0x421c88(new Error(_0x50eb('0x77')));}if(_0x50eb('0x73')==typeof _0x4fa41c['parameters']){return _0x421c88(new Error(_0x50eb('0x78')));}if(_0x4fa41c[_0x50eb('0x40')]===_0x50eb('0x79')){if(_0x50eb('0x73')==typeof _0x4fa41c['parameters'][_0x50eb('0x7a')]){return _0x421c88(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x50eb('0x73')==typeof _0x4fa41c[_0x50eb('0x7b')][_0x50eb('0x7a')][_0x50eb('0x7c')]&&_0x50eb('0x73')==typeof _0x4fa41c['parameters'][_0x50eb('0x7a')]['agent']){return _0x421c88(new Error(_0x50eb('0x7d')));}}else if(_0x4fa41c[_0x50eb('0x40')]==='script'){if('undefined'==typeof _0x4fa41c[_0x50eb('0x7b')][_0x50eb('0x7e')]){return _0x421c88(new Error(_0x50eb('0x7f')));}if(_0x50eb('0x73')==typeof _0x4fa41c['parameters'][_0x50eb('0x80')]){return _0x421c88(new Error(_0x50eb('0x81')));}}else{return _0x421c88(new Error(_0x50eb('0x82')));}var _0x3a697b=_0x4fa41c[_0x50eb('0x2f')];var _0x370dee=_0x4fa41c[_0x50eb('0x83')];var _0x34fa29=_0x4fa41c['type'];var _0x4b137e=_0x4fa41c[_0x50eb('0x84')]?_0x4fa41c[_0x50eb('0x84')]:_0x50eb('0x85');var _0x269f8b=_0x4fa41c['icon']?_0x4fa41c[_0x50eb('0x86')]:_0x50eb('0x87');var _0x3b76b9='';var _0x218f79='';var _0x324ed4='';var _0x3e382a='';var _0x4830f6=_0x4fa41c['version'];if(_0x34fa29==='html'){if(_0x50eb('0x73')!=typeof _0x4fa41c['parameters'][_0x50eb('0x7a')][_0x50eb('0x7c')]){var _0x5314aa=_0x4fa41c[_0x50eb('0x7b')][_0x50eb('0x7a')][_0x50eb('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x50eb('0x88')](_0x5314aa)){_0x3b76b9=path['join'](_0x50eb('0x89'),_0x3b3aca,_0x1a6ded[0x0],_0x5314aa);}else{_0x3b76b9=_0x5314aa;}}else{logger[_0x50eb('0x64')](_0x50eb('0x8a'));}if(_0x50eb('0x73')!=typeof _0x4fa41c[_0x50eb('0x7b')][_0x50eb('0x7a')]['agent']){var _0x3940b5=_0x4fa41c[_0x50eb('0x7b')][_0x50eb('0x7a')][_0x50eb('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0x50eb('0x88')](_0x3940b5)){_0x218f79=path['join'](_0x50eb('0x89'),_0x3b3aca,_0x1a6ded[0x0],_0x3940b5);}else{_0x218f79=_0x3940b5;}}else{logger[_0x50eb('0x64')](_0x50eb('0x8c'));}}else if(_0x34fa29===_0x50eb('0x8d')){_0x324ed4=_0x4fa41c[_0x50eb('0x7b')][_0x50eb('0x7e')];_0x3e382a=_0x4fa41c[_0x50eb('0x7b')][_0x50eb('0x80')];if('undefined'!=typeof _0x4fa41c[_0x50eb('0x7b')][_0x50eb('0x7a')]){if(_0x50eb('0x73')!=typeof _0x4fa41c[_0x50eb('0x7b')][_0x50eb('0x7a')][_0x50eb('0x7c')]){var _0x5314aa=_0x4fa41c[_0x50eb('0x7b')][_0x50eb('0x7a')][_0x50eb('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5314aa)){_0x3b76b9=path[_0x50eb('0x50')](_0x50eb('0x89'),_0x3b3aca,_0x1a6ded[0x0],_0x5314aa);}else{_0x3b76b9=_0x5314aa;}}if('undefined'!=typeof _0x4fa41c['parameters'][_0x50eb('0x7a')]['agent']){var _0x3940b5=_0x4fa41c[_0x50eb('0x7b')][_0x50eb('0x7a')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x50eb('0x88')](_0x3940b5)){_0x218f79=path[_0x50eb('0x50')](_0x50eb('0x89'),_0x3b3aca,_0x1a6ded[0x0],_0x3940b5);}else{_0x218f79=_0x3940b5;}}}}var _0x3ac7fa={'name':_0x3a697b,'description':_0x370dee,'path':path['join'](_0x3b3aca,_0x1a6ded[0x0]),'type':_0x34fa29,'sidebar':_0x4b137e,'icon':_0x269f8b,'adminUrl':_0x3b76b9,'agentUrl':_0x218f79,'scriptName':_0x324ed4,'scriptPath':_0x3e382a,'version':_0x4830f6};removeReferences(_0x1b161b,null);return db['Plugin'][_0x50eb('0x8e')](_0x3ac7fa)['then'](function(_0x4e1260){var _0x476329={'role':_0x47840c[_0x50eb('0x8f')][_0x50eb('0x90')],'userProfileId':_0x47840c[_0x50eb('0x8f')]['userProfileId']};if(!_0x476329)throw new Error(_0x50eb('0x91'));if(_0x476329[_0x50eb('0x90')]===_0x50eb('0x92')){var _0x5cadee=_0x4e1260[_0x50eb('0x2c')]({'plain':!![]});return db[_0x50eb('0x93')]['find']({'where':{'name':_0x50eb('0x2d'),'userProfileId':_0x476329[_0x50eb('0x94')]},'raw':!![]})[_0x50eb('0x2a')](function(_0x5970c8){if(_0x5970c8&&_0x5970c8[_0x50eb('0x95')]===0x0){return db['UserProfileResource'][_0x50eb('0x8e')]({'name':_0x5cadee[_0x50eb('0x2f')],'resourceId':_0x5cadee['id'],'type':_0x5970c8[_0x50eb('0x2f')],'sectionId':_0x5970c8['id']},{})[_0x50eb('0x2a')](function(){return _0x4e1260;});}else{return _0x4e1260;}})['catch'](function(_0x4409db){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4409db);throw _0x4409db;});}return _0x4e1260;})[_0x50eb('0x2a')](respondWithResult(_0x52cacd,null))['catch'](handleError(_0x52cacd,null));}});}catch(_0x97e62c){_0x52cacd[_0x50eb('0x20')](0x1f4)[_0x50eb('0x30')](_0x97e62c);}};function removeReferences(_0x24003e,_0xa01476){try{if(_0x24003e){fs[_0x50eb('0x63')](_0x24003e);logger[_0x50eb('0x64')](_0x50eb('0x96'));}if(_0xa01476){rimraf(_0xa01476,function(){});logger[_0x50eb('0x64')](_0x50eb('0x97'));}}catch(_0x30dd8c){logger[_0x50eb('0x57')](_0x30dd8c);}}exports[_0x50eb('0x29')]=function(_0x577917,_0xef1ddd,_0x38bfa7){return db[_0x50eb('0x43')]['find']({'where':{'id':_0x577917[_0x50eb('0x4a')]['id']}})[_0x50eb('0x2a')](handleEntityNotFound(_0xef1ddd,null))['then'](saveUpdates(_0x577917[_0x50eb('0x8f')],null))[_0x50eb('0x2a')](respondWithResult(_0xef1ddd,null))[_0x50eb('0x48')](handleError(_0xef1ddd,null));};exports[_0x50eb('0x98')]=function(_0x537b8f,_0x184c23,_0x41da9e){return db[_0x50eb('0x43')][_0x50eb('0x4d')]({'where':{'id':_0x537b8f[_0x50eb('0x4a')]['id']}})[_0x50eb('0x2a')](function(_0x4d2cb4){if(_0x4d2cb4){return _0x4d2cb4[_0x50eb('0x2b')]();}})[_0x50eb('0x2a')](function(_0x4131d7){rimraf(path[_0x50eb('0x50')](config[_0x50eb('0x51')],'server/files/plugins',path['dirname'](_0x4131d7[_0x50eb('0x4f')])),function(){});return _0x4131d7;})[_0x50eb('0x2a')](handleEntityNotFound(_0x184c23,null))[_0x50eb('0x2a')](respondWithStatusCode(_0x184c23,null))[_0x50eb('0x48')](handleError(_0x184c23,null));};exports[_0x50eb('0x99')]=function(_0x2153c8,_0x144d92,_0x13bbb8){return BPromise[_0x50eb('0x9a')]()[_0x50eb('0x2a')](function(){if(!_0x2153c8[_0x50eb('0x34')][_0x50eb('0x4f')]){throw new Error(_0x50eb('0x9b'));}if(!_0x2153c8['query'][_0x50eb('0x9c')]){throw new Error(_0x50eb('0x9d'));}var _0x4b0604=_0x2153c8[_0x50eb('0x34')][_0x50eb('0x9e')]?_0x2153c8[_0x50eb('0x34')][_0x50eb('0x9e')]+':'+_0x2153c8['query'][_0x50eb('0x9c')]:_0x50eb('0x9f')+_0x2153c8[_0x50eb('0x34')]['port'];var _0x22a7d9=_0x2153c8[_0x50eb('0x34')][_0x50eb('0x22')]?_0x2153c8[_0x50eb('0x34')]['json']:!![];var _0x4150f6=_0x2153c8[_0x50eb('0x34')][_0x50eb('0xa0')]?_0x2153c8[_0x50eb('0x34')][_0x50eb('0xa0')]:null;var _0x448da0={'method':_0x2153c8[_0x50eb('0xa1')],'uri':util[_0x50eb('0xa2')](_0x50eb('0xa3'),_0x4b0604,_0x2153c8[_0x50eb('0x34')][_0x50eb('0x4f')]),'json':_0x22a7d9,'resolveWithFullResponse':!![],'encoding':_0x4150f6,'qs':_0x2153c8[_0x50eb('0x34')]};if(_0x2153c8['headers']){_0x448da0[_0x50eb('0xa4')]=_0x2153c8[_0x50eb('0xa4')];if(_0x448da0[_0x50eb('0xa4')]['content-length']){delete _0x448da0[_0x50eb('0xa4')][_0x50eb('0xa5')];}}return rp(_0x448da0);})[_0x50eb('0x2a')](function(_0x3ff9df){if(_0x3ff9df){_0x144d92[_0x50eb('0xa6')](_0x3ff9df[_0x50eb('0xa4')]);logger[_0x50eb('0x64')](_0x3ff9df['body']);if(_['endsWith'](_0x2153c8[_0x50eb('0x34')][_0x50eb('0x4f')],_0x50eb('0x4e'))&&_0x3ff9df[_0x50eb('0xa7')]==0x1f4){return _0x144d92[_0x50eb('0x1f')](_0x3ff9df[_0x50eb('0xa7')]);}else{return _0x144d92[_0x50eb('0x20')](_0x3ff9df[_0x50eb('0xa7')])[_0x50eb('0x30')](_0x3ff9df['body']);}}else{return _0x144d92[_0x50eb('0x1f')](0xc8);}})[_0x50eb('0x48')](handleError(_0x144d92,null));};exports['webhookPost']=function(_0x3d0d63,_0x52c659,_0x398f17){return BPromise[_0x50eb('0x9a')]()[_0x50eb('0x2a')](function(){if(!_0x3d0d63['query']['path']){throw new Error(_0x50eb('0x9b'));}if(!_0x3d0d63[_0x50eb('0x34')][_0x50eb('0x9c')]){throw new Error(_0x50eb('0x9d'));}var _0x5bb2dd=_0x3d0d63[_0x50eb('0x34')][_0x50eb('0x9e')]?_0x3d0d63[_0x50eb('0x34')]['hostname']+':'+_0x3d0d63[_0x50eb('0x34')][_0x50eb('0x9c')]:'http://localhost:'+_0x3d0d63[_0x50eb('0x34')][_0x50eb('0x9c')];var _0x2c91d1=_0x3d0d63[_0x50eb('0x34')][_0x50eb('0x22')]?_0x3d0d63[_0x50eb('0x34')][_0x50eb('0x22')]:!![];var _0x1fdbdc=_0x3d0d63[_0x50eb('0x34')][_0x50eb('0xa0')]?_0x3d0d63['query']['encoding']:null;var _0x72e429={'method':_0x3d0d63[_0x50eb('0xa1')],'uri':util[_0x50eb('0xa2')]('%s%s',_0x5bb2dd,_0x3d0d63[_0x50eb('0x34')]['path']),'json':_0x2c91d1,'resolveWithFullResponse':!![],'encoding':_0x1fdbdc,'body':_0x3d0d63[_0x50eb('0x8f')]};if(_0x3d0d63[_0x50eb('0xa4')]){_0x72e429['headers']=_0x3d0d63[_0x50eb('0xa4')];if(_0x72e429[_0x50eb('0xa4')][_0x50eb('0xa5')]){delete _0x72e429['headers'][_0x50eb('0xa5')];}}return rp(_0x72e429);})['then'](function(_0x285002){if(_0x285002){_0x52c659[_0x50eb('0xa6')](_0x285002[_0x50eb('0xa4')]);logger[_0x50eb('0x64')](_0x285002[_0x50eb('0x8f')]);return _0x52c659[_0x50eb('0x20')](_0x285002[_0x50eb('0xa7')])[_0x50eb('0x30')](_0x285002[_0x50eb('0x8f')]);}else{return _0x52c659['sendStatus'](0xc8);}})['catch'](handleError(_0x52c659,null));}; \ No newline at end of file +var _0x4f03=['extract-zip','archiver','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','get','Plugins','UserProfileResource','end','error','name','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','type','field','filter','options','Plugin','includeAll','include','findAll','rows','catch','show','params','find','download','root','format','%s.zip','basename','createWriteStream','warning','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','server/files/plugins','dirname','node_modules/**/*','join','finalize','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','parameters','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','scriptPath','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','method','%s%s','headers','content-length','endsWith','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4f03,0x8e));var _0x34f0=function(_0x5c38cd,_0x5a6b4e){_0x5c38cd=_0x5c38cd-0x0;var _0xc985ef=_0x4f03[_0x5c38cd];return _0xc985ef;};'use strict';var pdf=require(_0x34f0('0x0'));var emlformat=require(_0x34f0('0x1'));var rimraf=require(_0x34f0('0x2'));var zipdir=require(_0x34f0('0x3'));var jsonpatch=require(_0x34f0('0x4'));var rp=require('request-promise');var moment=require(_0x34f0('0x5'));var BPromise=require(_0x34f0('0x6'));var Mustache=require(_0x34f0('0x7'));var util=require('util');var path=require(_0x34f0('0x8'));var sox=require(_0x34f0('0x9'));var csv=require(_0x34f0('0xa'));var ejs=require(_0x34f0('0xb'));var fs=require('fs');var _=require(_0x34f0('0xc'));var squel=require(_0x34f0('0xd'));var crypto=require(_0x34f0('0xe'));var jsforce=require(_0x34f0('0xf'));var deskjs=require(_0x34f0('0x10'));var toCsv=require(_0x34f0('0xa'));var querystring=require(_0x34f0('0x11'));var Papa=require(_0x34f0('0x12'));var authService=require(_0x34f0('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x34f0('0x14'));var extract=require(_0x34f0('0x15'));var rimraf=require(_0x34f0('0x2'));var archiver=require(_0x34f0('0x16'));var qs=require(_0x34f0('0x17'));var logger=require(_0x34f0('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x34f0('0x19'))['db'];config['redis']=_['defaults'](config[_0x34f0('0x1a')],{'host':_0x34f0('0x1b'),'port':0x18eb});var socket=require(_0x34f0('0x1c'))(new Redis(config[_0x34f0('0x1a')]));require(_0x34f0('0x1d'))[_0x34f0('0x1e')](socket);function respondWithStatusCode(_0x2fc0d6,_0x3b8452){_0x3b8452=_0x3b8452||0xcc;return function(_0x50c8c7){if(_0x50c8c7){return _0x2fc0d6[_0x34f0('0x1f')](_0x3b8452);}return _0x2fc0d6[_0x34f0('0x20')](_0x3b8452)['end']();};}function respondWithResult(_0x3e1c73,_0x25e43c){_0x25e43c=_0x25e43c||0xc8;return function(_0x292938){if(_0x292938){return _0x3e1c73[_0x34f0('0x20')](_0x25e43c)[_0x34f0('0x21')](_0x292938);}};}function respondWithFilteredResult(_0x21a4fe,_0x13386b){return function(_0x57f548){if(_0x57f548){var _0x33060b=_0x57f548[_0x34f0('0x22')],_0x1b6135=_0x13386b[_0x34f0('0x23')],_0x1b1876=_0x13386b[_0x34f0('0x23')]+_0x13386b[_0x34f0('0x24')],_0x5ef091;if(_0x1b1876>=_0x33060b){_0x1b1876=_0x33060b;_0x5ef091=0xc8;}else{_0x5ef091=0xce;}_0x21a4fe[_0x34f0('0x20')](_0x5ef091);return _0x21a4fe[_0x34f0('0x25')](_0x34f0('0x26'),_0x1b6135+'-'+_0x1b1876+'/'+_0x33060b)['json'](_0x57f548);}return null;};}function patchUpdates(_0x1b69ff){return function(_0x44ec42){try{jsonpatch['apply'](_0x44ec42,_0x1b69ff,!![]);}catch(_0x45d1e0){return BPromise[_0x34f0('0x27')](_0x45d1e0);}return _0x44ec42['save']();};}function saveUpdates(_0x2ae0bd,_0x12aead){return function(_0x2d32e8){if(_0x2d32e8){return _0x2d32e8[_0x34f0('0x28')](_0x2ae0bd)[_0x34f0('0x29')](function(_0x46767e){return _0x46767e;});}return null;};}function removeEntity(_0x3b1298,_0x386dd6){return function(_0x507366){if(_0x507366){return _0x507366[_0x34f0('0x2a')]()[_0x34f0('0x29')](function(){var _0x20d615=_0x507366[_0x34f0('0x2b')]({'plain':!![]});var _0x409336=_0x34f0('0x2c');return db[_0x34f0('0x2d')][_0x34f0('0x2a')]({'where':{'type':_0x409336,'resourceId':_0x20d615['id']}})['then'](function(){return _0x507366;});})[_0x34f0('0x29')](function(){_0x3b1298[_0x34f0('0x20')](0xcc)[_0x34f0('0x2e')]();});}};}function handleEntityNotFound(_0x13df57,_0x1c5c49){return function(_0x46385e){if(!_0x46385e){_0x13df57['sendStatus'](0x194);}return _0x46385e;};}function handleError(_0x17b255,_0x2cdb19){_0x2cdb19=_0x2cdb19||0x1f4;return function(_0x15c2ee){logger[_0x34f0('0x2f')](_0x15c2ee['stack']);if(_0x15c2ee[_0x34f0('0x30')]){delete _0x15c2ee[_0x34f0('0x30')];}_0x17b255['status'](_0x2cdb19)['send'](_0x15c2ee);};}exports['index']=function(_0x287723,_0x4ba482){var _0x29b954={},_0x1bec12={},_0xc27bc7={'count':0x0,'rows':[]};var _0x1825ff=db['Plugin'][_0x34f0('0x31')];_0x1bec12[_0x34f0('0x32')]=_[_0x34f0('0x33')](_0x1825ff);_0x1bec12[_0x34f0('0x34')]=_[_0x34f0('0x33')](_0x287723[_0x34f0('0x34')]);_0x1bec12[_0x34f0('0x35')]=_[_0x34f0('0x36')](_0x1bec12['model'],_0x1bec12['query']);_0x29b954[_0x34f0('0x37')]=_[_0x34f0('0x36')](_0x1bec12['model'],qs[_0x34f0('0x38')](_0x287723[_0x34f0('0x34')]['fields']));_0x29b954[_0x34f0('0x37')]=_0x29b954[_0x34f0('0x37')][_0x34f0('0x39')]?_0x29b954[_0x34f0('0x37')]:_0x1bec12['model'];if(!_0x287723[_0x34f0('0x34')][_0x34f0('0x3a')](_0x34f0('0x3b'))){_0x29b954[_0x34f0('0x24')]=qs['limit'](_0x287723['query'][_0x34f0('0x24')]);_0x29b954[_0x34f0('0x23')]=qs['offset'](_0x287723[_0x34f0('0x34')][_0x34f0('0x23')]);}_0x29b954[_0x34f0('0x3c')]=qs[_0x34f0('0x3d')](_0x287723['query']['sort']);_0x29b954[_0x34f0('0x3e')]=qs[_0x34f0('0x35')](_['pick'](_0x287723[_0x34f0('0x34')],_0x1bec12[_0x34f0('0x35')]));if(_0x287723[_0x34f0('0x34')]['filter']){_0x29b954[_0x34f0('0x3e')]=_[_0x34f0('0x3f')](_0x29b954[_0x34f0('0x3e')],{'$or':_[_0x34f0('0x40')](_0x1825ff,function(_0x318f12){if(_0x318f12[_0x34f0('0x41')]['key']!=='VIRTUAL'){var _0x3b51f1={};_0x3b51f1[_0x318f12[_0x34f0('0x42')]]={'$like':'%'+_0x287723['query'][_0x34f0('0x43')]+'%'};return _0x3b51f1;}})});}_0x29b954=_[_0x34f0('0x3f')]({},_0x29b954,_0x287723[_0x34f0('0x44')]);var _0xa621f0={'where':_0x29b954[_0x34f0('0x3e')]};return db[_0x34f0('0x45')][_0x34f0('0x22')](_0xa621f0)['then'](function(_0x28df47){_0xc27bc7[_0x34f0('0x22')]=_0x28df47;if(_0x287723[_0x34f0('0x34')][_0x34f0('0x46')]){_0x29b954[_0x34f0('0x47')]=[{'all':!![]}];}return db[_0x34f0('0x45')][_0x34f0('0x48')](_0x29b954);})[_0x34f0('0x29')](function(_0x30d758){_0xc27bc7[_0x34f0('0x49')]=_0x30d758;return _0xc27bc7;})[_0x34f0('0x29')](respondWithFilteredResult(_0x4ba482,_0x29b954))[_0x34f0('0x4a')](handleError(_0x4ba482,null));};exports[_0x34f0('0x4b')]=function(_0x58d459,_0x2139b0){var _0x1369d3={'raw':!![],'where':{'id':_0x58d459[_0x34f0('0x4c')]['id']}},_0x8c996c={};_0x8c996c['model']=_[_0x34f0('0x33')](db[_0x34f0('0x45')][_0x34f0('0x31')]);_0x8c996c[_0x34f0('0x34')]=_['keys'](_0x58d459[_0x34f0('0x34')]);_0x8c996c[_0x34f0('0x35')]=_['intersection'](_0x8c996c['model'],_0x8c996c['query']);_0x1369d3[_0x34f0('0x37')]=_[_0x34f0('0x36')](_0x8c996c['model'],qs[_0x34f0('0x38')](_0x58d459[_0x34f0('0x34')][_0x34f0('0x38')]));_0x1369d3['attributes']=_0x1369d3[_0x34f0('0x37')][_0x34f0('0x39')]?_0x1369d3[_0x34f0('0x37')]:_0x8c996c[_0x34f0('0x32')];if(_0x58d459[_0x34f0('0x34')][_0x34f0('0x46')]){_0x1369d3['include']=[{'all':!![]}];}_0x1369d3=_[_0x34f0('0x3f')]({},_0x1369d3,_0x58d459['options']);return db['Plugin'][_0x34f0('0x4d')](_0x1369d3)[_0x34f0('0x29')](handleEntityNotFound(_0x2139b0,null))[_0x34f0('0x29')](respondWithResult(_0x2139b0,null))['catch'](handleError(_0x2139b0,null));};exports[_0x34f0('0x4e')]=function(_0x5a8e20,_0x284e3a,_0x4aedba){return db[_0x34f0('0x45')][_0x34f0('0x4d')]({'where':{'id':_0x5a8e20[_0x34f0('0x4c')]['id']},'attributes':[_0x34f0('0x30'),_0x34f0('0x8')],'raw':!![]})[_0x34f0('0x29')](handleEntityNotFound(_0x284e3a,null))[_0x34f0('0x29')](function(_0x1effb6){if(_0x1effb6){var _0x1c1960=path['join'](config[_0x34f0('0x4f')],'server/files/plugins',util[_0x34f0('0x50')](_0x34f0('0x51'),path[_0x34f0('0x52')](_0x1effb6[_0x34f0('0x8')])));var _0x3ea572=fs[_0x34f0('0x53')](_0x1c1960);var _0x562ddb=archiver('zip',{'zlib':{'level':0x9}});_0x562ddb['on'](_0x34f0('0x54'),function(_0x5682cd){if(_0x5682cd['code']===_0x34f0('0x55')){logger[_0x34f0('0x2f')](_0x5682cd);}else{throw new db['Sequelize'][(_0x34f0('0x56'))](_0x34f0('0x57'));}});_0x562ddb['on'](_0x34f0('0x2f'),function(_0x337228){throw new db[(_0x34f0('0x58'))][(_0x34f0('0x56'))](_0x34f0('0x57'));});_0x562ddb[_0x34f0('0x59')](_0x3ea572);_0x562ddb[_0x34f0('0x5a')](_0x34f0('0x5b'),{'cwd':path['join'](config['root'],_0x34f0('0x5c'),path[_0x34f0('0x5d')](_0x1effb6['path'])),'ignore':[path['join'](path[_0x34f0('0x52')](_0x1effb6[_0x34f0('0x8')]),_0x34f0('0x5e')),path[_0x34f0('0x5f')](path[_0x34f0('0x52')](_0x1effb6['path']),'attachments/**/*')],'nodir':!![]})[_0x34f0('0x60')]();_0x3ea572['on']('close',function(){if(!fs[_0x34f0('0x61')](_0x1c1960)){throw new db[(_0x34f0('0x58'))][(_0x34f0('0x56'))](_0x34f0('0x62'));}return _0x284e3a[_0x34f0('0x4e')](_0x1c1960,util[_0x34f0('0x50')](_0x34f0('0x51'),path['basename'](_0x1effb6[_0x34f0('0x8')])),function(_0x5ef868){if(_0x5ef868){throw new db[(_0x34f0('0x58'))][(_0x34f0('0x56'))](_0x34f0('0x63'));}fs['unlinkSync'](_0x1c1960);logger[_0x34f0('0x64')]('Download\x20completed');logger[_0x34f0('0x64')]('Temporary\x20file\x20removed');});});}return null;})[_0x34f0('0x4a')](handleError(_0x284e3a,null));};exports['upload']=function(_0x12851c,_0x88a54b,_0x1a78f6){var _0x33d64c=path['basename'](_0x12851c[_0x34f0('0x65')][_0x34f0('0x66')],path[_0x34f0('0x67')](_0x12851c[_0x34f0('0x65')][_0x34f0('0x66')]));var _0x45a428=path['join'](config[_0x34f0('0x4f')],_0x34f0('0x5c'),_0x12851c[_0x34f0('0x65')][_0x34f0('0x66')]);var _0x865e4a=path[_0x34f0('0x5f')](config[_0x34f0('0x4f')],_0x34f0('0x5c'),_0x33d64c);logger['info'](_0x34f0('0x68'),_0x45a428);logger['info'](_0x34f0('0x69'),_0x865e4a);try{fs[_0x34f0('0x6a')](_0x45a428,parseInt(_0x34f0('0x6b'),0x8));extract(_0x45a428,{'dir':_0x865e4a},function(_0x80fe32){if(_0x80fe32){logger[_0x34f0('0x2f')](_0x80fe32);handleError(_0x80fe32,!![]);};var _0x21fde0=fs[_0x34f0('0x6c')](_0x865e4a);if(_0x21fde0['length']>0x1){removeReferences(_0x45a428,_0x865e4a);logger[_0x34f0('0x2f')](_0x34f0('0x6d'));return _0x1a78f6(new Error(_0x34f0('0x6d')));}var _0x24e651=fs[_0x34f0('0x6e')](path[_0x34f0('0x5f')](_0x865e4a,_0x21fde0[0x0]));if(_0x24e651[_0x34f0('0x6f')]()){removeReferences(_0x45a428,_0x865e4a);logger[_0x34f0('0x2f')](_0x34f0('0x6d'));return _0x1a78f6(new Error(_0x34f0('0x6d')));}if(_0x24e651['isDirectory']()){var _0x581b27=fs[_0x34f0('0x6c')](path[_0x34f0('0x5f')](_0x865e4a,_0x21fde0[0x0]));if(_0x581b27[_0x34f0('0x39')]===0x0){removeReferences(_0x45a428,_0x865e4a);logger[_0x34f0('0x2f')](_0x34f0('0x6d'));return _0x1a78f6(new Error(_0x34f0('0x6d')));}var _0x70b92=_0x581b27[_0x34f0('0x70')](function(_0x426555){return _0x426555===_0x34f0('0x71');});if(!_0x70b92){return _0x1a78f6(new Error('Plugin\x20manifest\x20missing'));}var _0x27a659=fs[_0x34f0('0x72')](path[_0x34f0('0x5f')](_0x865e4a,_0x21fde0[0x0],'manifest.json'));var _0x2d551e=JSON[_0x34f0('0x73')](_0x27a659);if(_0x34f0('0x74')==typeof _0x2d551e[_0x34f0('0x30')]){return _0x1a78f6(new Error(_0x34f0('0x75')));}if(_0x34f0('0x74')==typeof _0x2d551e[_0x34f0('0x41')]){return _0x1a78f6(new Error(_0x34f0('0x76')));}if('undefined'==typeof _0x2d551e[_0x34f0('0x77')]){return _0x1a78f6(new Error(_0x34f0('0x78')));}if(_0x34f0('0x74')==typeof _0x2d551e['parameters']){return _0x1a78f6(new Error(_0x34f0('0x79')));}if(_0x2d551e[_0x34f0('0x41')]===_0x34f0('0x7a')){if(_0x34f0('0x74')==typeof _0x2d551e['parameters'][_0x34f0('0x7b')]){return _0x1a78f6(new Error(_0x34f0('0x7c')));}if('undefined'==typeof _0x2d551e[_0x34f0('0x7d')][_0x34f0('0x7b')]['admin']&&_0x34f0('0x74')==typeof _0x2d551e[_0x34f0('0x7d')][_0x34f0('0x7b')]['agent']){return _0x1a78f6(new Error(_0x34f0('0x7e')));}}else if(_0x2d551e[_0x34f0('0x41')]===_0x34f0('0x7f')){if('undefined'==typeof _0x2d551e[_0x34f0('0x7d')]['scriptName']){return _0x1a78f6(new Error(_0x34f0('0x80')));}if('undefined'==typeof _0x2d551e[_0x34f0('0x7d')]['scriptPath']){return _0x1a78f6(new Error(_0x34f0('0x81')));}}else{return _0x1a78f6(new Error(_0x34f0('0x82')));}var _0xf6c708=_0x2d551e[_0x34f0('0x30')];var _0x46bddd=_0x2d551e[_0x34f0('0x83')];var _0x15047f=_0x2d551e[_0x34f0('0x41')];var _0x1a925d=_0x2d551e[_0x34f0('0x84')]?_0x2d551e['sidebar']:_0x34f0('0x85');var _0x295f96=_0x2d551e['icon']?_0x2d551e[_0x34f0('0x86')]:_0x34f0('0x87');var _0x1c36b2='';var _0x811dc3='';var _0x1f4e32='';var _0x557d08='';var _0x3dfbac=_0x2d551e[_0x34f0('0x77')];if(_0x15047f==='html'){if(_0x34f0('0x74')!=typeof _0x2d551e[_0x34f0('0x7d')][_0x34f0('0x7b')][_0x34f0('0x88')]){var _0x542e67=_0x2d551e[_0x34f0('0x7d')][_0x34f0('0x7b')][_0x34f0('0x88')];if(!/^(f|ht)tps?:\/\//i[_0x34f0('0x89')](_0x542e67)){_0x1c36b2=path[_0x34f0('0x5f')](_0x34f0('0x8a'),_0x33d64c,_0x21fde0[0x0],_0x542e67);}else{_0x1c36b2=_0x542e67;}}else{logger['info'](_0x34f0('0x8b'));}if('undefined'!=typeof _0x2d551e[_0x34f0('0x7d')]['views']['agent']){var _0x503a97=_0x2d551e['parameters'][_0x34f0('0x7b')][_0x34f0('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x34f0('0x89')](_0x503a97)){_0x811dc3=path[_0x34f0('0x5f')](_0x34f0('0x8a'),_0x33d64c,_0x21fde0[0x0],_0x503a97);}else{_0x811dc3=_0x503a97;}}else{logger[_0x34f0('0x64')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x15047f===_0x34f0('0x7f')){_0x1f4e32=_0x2d551e['parameters']['scriptName'];_0x557d08=_0x2d551e[_0x34f0('0x7d')][_0x34f0('0x8d')];if(_0x34f0('0x74')!=typeof _0x2d551e[_0x34f0('0x7d')]['views']){if(_0x34f0('0x74')!=typeof _0x2d551e[_0x34f0('0x7d')][_0x34f0('0x7b')][_0x34f0('0x88')]){var _0x542e67=_0x2d551e[_0x34f0('0x7d')][_0x34f0('0x7b')][_0x34f0('0x88')];if(!/^(f|ht)tps?:\/\//i[_0x34f0('0x89')](_0x542e67)){_0x1c36b2=path[_0x34f0('0x5f')](_0x34f0('0x8a'),_0x33d64c,_0x21fde0[0x0],_0x542e67);}else{_0x1c36b2=_0x542e67;}}if(_0x34f0('0x74')!=typeof _0x2d551e[_0x34f0('0x7d')][_0x34f0('0x7b')][_0x34f0('0x8c')]){var _0x503a97=_0x2d551e[_0x34f0('0x7d')]['views'][_0x34f0('0x8c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x503a97)){_0x811dc3=path[_0x34f0('0x5f')](_0x34f0('0x8a'),_0x33d64c,_0x21fde0[0x0],_0x503a97);}else{_0x811dc3=_0x503a97;}}}}var _0x1c18e7={'name':_0xf6c708,'description':_0x46bddd,'path':path[_0x34f0('0x5f')](_0x33d64c,_0x21fde0[0x0]),'type':_0x15047f,'sidebar':_0x1a925d,'icon':_0x295f96,'adminUrl':_0x1c36b2,'agentUrl':_0x811dc3,'scriptName':_0x1f4e32,'scriptPath':_0x557d08,'version':_0x3dfbac};removeReferences(_0x45a428,null);return db[_0x34f0('0x45')][_0x34f0('0x8e')](_0x1c18e7)[_0x34f0('0x29')](function(_0x6d15f4){var _0x5e2869={'role':_0x12851c[_0x34f0('0x8f')][_0x34f0('0x90')],'userProfileId':_0x12851c['body']['userProfileId']};if(!_0x5e2869)throw new Error(_0x34f0('0x91'));if(_0x5e2869[_0x34f0('0x90')]==='user'){var _0x390b01=_0x6d15f4[_0x34f0('0x2b')]({'plain':!![]});return db[_0x34f0('0x92')][_0x34f0('0x4d')]({'where':{'name':_0x34f0('0x2c'),'userProfileId':_0x5e2869[_0x34f0('0x93')]},'raw':!![]})['then'](function(_0x154926){if(_0x154926&&_0x154926[_0x34f0('0x94')]===0x0){return db[_0x34f0('0x2d')][_0x34f0('0x8e')]({'name':_0x390b01[_0x34f0('0x30')],'resourceId':_0x390b01['id'],'type':_0x154926[_0x34f0('0x30')],'sectionId':_0x154926['id']},{})[_0x34f0('0x29')](function(){return _0x6d15f4;});}else{return _0x6d15f4;}})[_0x34f0('0x4a')](function(_0x54f965){logger['error'](_0x34f0('0x95'),_0x54f965);throw _0x54f965;});}return _0x6d15f4;})[_0x34f0('0x29')](respondWithResult(_0x88a54b,null))[_0x34f0('0x4a')](handleError(_0x88a54b,null));}});}catch(_0x56fc83){_0x88a54b['status'](0x1f4)[_0x34f0('0x96')](_0x56fc83);}};function removeReferences(_0x56ebeb,_0xf37057){try{if(_0x56ebeb){fs['unlinkSync'](_0x56ebeb);logger[_0x34f0('0x64')](_0x34f0('0x97'));}if(_0xf37057){rimraf(_0xf37057,function(){});logger[_0x34f0('0x64')](_0x34f0('0x98'));}}catch(_0x37cb85){logger[_0x34f0('0x2f')](_0x37cb85);}}exports[_0x34f0('0x28')]=function(_0xee08f6,_0x4acd4e,_0x103223){return db[_0x34f0('0x45')]['find']({'where':{'id':_0xee08f6[_0x34f0('0x4c')]['id']}})[_0x34f0('0x29')](handleEntityNotFound(_0x4acd4e,null))[_0x34f0('0x29')](saveUpdates(_0xee08f6[_0x34f0('0x8f')],null))[_0x34f0('0x29')](respondWithResult(_0x4acd4e,null))[_0x34f0('0x4a')](handleError(_0x4acd4e,null));};exports['delete']=function(_0x3d9b8e,_0x13182c,_0x45979e){return db['Plugin']['find']({'where':{'id':_0x3d9b8e[_0x34f0('0x4c')]['id']}})[_0x34f0('0x29')](function(_0x37ac9f){if(_0x37ac9f){return _0x37ac9f[_0x34f0('0x2a')]();}})[_0x34f0('0x29')](function(_0x483818){rimraf(path[_0x34f0('0x5f')](config[_0x34f0('0x4f')],_0x34f0('0x5c'),path[_0x34f0('0x5d')](_0x483818['path'])),function(){});return _0x483818;})[_0x34f0('0x29')](handleEntityNotFound(_0x13182c,null))[_0x34f0('0x29')](respondWithStatusCode(_0x13182c,null))[_0x34f0('0x4a')](handleError(_0x13182c,null));};exports['webhookGet']=function(_0x2b569c,_0x282e4c,_0x3c51a9){return BPromise[_0x34f0('0x99')]()[_0x34f0('0x29')](function(){if(!_0x2b569c[_0x34f0('0x34')][_0x34f0('0x8')]){throw new Error(_0x34f0('0x9a'));}if(!_0x2b569c[_0x34f0('0x34')][_0x34f0('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x27ec55=_0x2b569c[_0x34f0('0x34')][_0x34f0('0x9c')]?_0x2b569c[_0x34f0('0x34')]['hostname']+':'+_0x2b569c[_0x34f0('0x34')][_0x34f0('0x9b')]:'http://localhost:'+_0x2b569c[_0x34f0('0x34')][_0x34f0('0x9b')];var _0x55a453=_0x2b569c[_0x34f0('0x34')][_0x34f0('0x21')]?_0x2b569c[_0x34f0('0x34')][_0x34f0('0x21')]:!![];var _0x3950ed=_0x2b569c[_0x34f0('0x34')]['encoding']?_0x2b569c[_0x34f0('0x34')]['encoding']:null;var _0x4be45b={'method':_0x2b569c[_0x34f0('0x9d')],'uri':util[_0x34f0('0x50')](_0x34f0('0x9e'),_0x27ec55,_0x2b569c[_0x34f0('0x34')][_0x34f0('0x8')]),'json':_0x55a453,'resolveWithFullResponse':!![],'encoding':_0x3950ed,'qs':_0x2b569c[_0x34f0('0x34')]};if(_0x2b569c[_0x34f0('0x9f')]){_0x4be45b[_0x34f0('0x9f')]=_0x2b569c[_0x34f0('0x9f')];if(_0x4be45b[_0x34f0('0x9f')][_0x34f0('0xa0')]){delete _0x4be45b[_0x34f0('0x9f')][_0x34f0('0xa0')];}}return rp(_0x4be45b);})[_0x34f0('0x29')](function(_0x5daaaf){if(_0x5daaaf){_0x282e4c[_0x34f0('0x25')](_0x5daaaf['headers']);logger[_0x34f0('0x64')](_0x5daaaf[_0x34f0('0x8f')]);if(_[_0x34f0('0xa1')](_0x2b569c['query'][_0x34f0('0x8')],_0x34f0('0x4e'))&&_0x5daaaf[_0x34f0('0xa2')]==0x1f4){return _0x282e4c[_0x34f0('0x1f')](_0x5daaaf[_0x34f0('0xa2')]);}else{return _0x282e4c['status'](_0x5daaaf[_0x34f0('0xa2')])[_0x34f0('0x96')](_0x5daaaf['body']);}}else{return _0x282e4c[_0x34f0('0x1f')](0xc8);}})['catch'](handleError(_0x282e4c,null));};exports['webhookPost']=function(_0x548bd2,_0x923ee,_0x283ec3){return BPromise[_0x34f0('0x99')]()[_0x34f0('0x29')](function(){if(!_0x548bd2[_0x34f0('0x34')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x548bd2['query'][_0x34f0('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x303020=_0x548bd2[_0x34f0('0x34')][_0x34f0('0x9c')]?_0x548bd2[_0x34f0('0x34')][_0x34f0('0x9c')]+':'+_0x548bd2[_0x34f0('0x34')][_0x34f0('0x9b')]:'http://localhost:'+_0x548bd2[_0x34f0('0x34')][_0x34f0('0x9b')];var _0x4b4ef5=_0x548bd2[_0x34f0('0x34')][_0x34f0('0x21')]?_0x548bd2[_0x34f0('0x34')][_0x34f0('0x21')]:!![];var _0x413003=_0x548bd2['query']['encoding']?_0x548bd2['query']['encoding']:null;var _0x3452b3={'method':_0x548bd2[_0x34f0('0x9d')],'uri':util[_0x34f0('0x50')](_0x34f0('0x9e'),_0x303020,_0x548bd2['query'][_0x34f0('0x8')]),'json':_0x4b4ef5,'resolveWithFullResponse':!![],'encoding':_0x413003,'body':_0x548bd2[_0x34f0('0x8f')]};if(_0x548bd2[_0x34f0('0x9f')]){_0x3452b3['headers']=_0x548bd2[_0x34f0('0x9f')];if(_0x3452b3[_0x34f0('0x9f')]['content-length']){delete _0x3452b3[_0x34f0('0x9f')][_0x34f0('0xa0')];}}return rp(_0x3452b3);})[_0x34f0('0x29')](function(_0x250b8a){if(_0x250b8a){_0x923ee[_0x34f0('0x25')](_0x250b8a[_0x34f0('0x9f')]);logger[_0x34f0('0x64')](_0x250b8a['body']);return _0x923ee['status'](_0x250b8a[_0x34f0('0xa2')])[_0x34f0('0x96')](_0x250b8a[_0x34f0('0x8f')]);}else{return _0x923ee[_0x34f0('0x1f')](0xc8);}})[_0x34f0('0x4a')](handleError(_0x923ee,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 0cff7cd..6a5126c 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 _0x7a54=['Plugin','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1e9fe4,_0x50dcc4){var _0x3a1234=function(_0xd9f099){while(--_0xd9f099){_0x1e9fe4['push'](_0x1e9fe4['shift']());}};_0x3a1234(++_0x50dcc4);}(_0x7a54,0x106));var _0x47a5=function(_0x2b47bf,_0x5d3143){_0x2b47bf=_0x2b47bf-0x0;var _0x141ac8=_0x7a54[_0x2b47bf];return _0x141ac8;};'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 +var _0x7a54=['Plugin','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x467ee0,_0x1bead4){var _0x33e684=function(_0x14caf4){while(--_0x14caf4){_0x467ee0['push'](_0x467ee0['shift']());}};_0x33e684(++_0x1bead4);}(_0x7a54,0x106));var _0x47a5=function(_0x44f476,_0x158e43){_0x44f476=_0x44f476-0x0;var _0x156f62=_0x7a54[_0x44f476];return _0x156f62;};'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 e7e997f..99c75f9 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 _0xb5a0=['exports','define','Plugin','plugins','lodash','util','api','bluebird'];(function(_0x31d50f,_0x267d0b){var _0x55f7b7=function(_0x5cf806){while(--_0x5cf806){_0x31d50f['push'](_0x31d50f['shift']());}};_0x55f7b7(++_0x267d0b);}(_0xb5a0,0x15c));var _0x0b5a=function(_0x319fa0,_0x31377a){_0x319fa0=_0x319fa0-0x0;var _0x464fee=_0xb5a0[_0x319fa0];return _0x464fee;};'use strict';var _=require(_0x0b5a('0x0'));var util=require(_0x0b5a('0x1'));var logger=require('../../config/logger')(_0x0b5a('0x2'));var moment=require('moment');var BPromise=require(_0x0b5a('0x3'));var rp=require('request-promise');var attributes=require('./plugin.attributes');module[_0x0b5a('0x4')]=function(_0x33185c,_0x49e7bd){return _0x33185c[_0x0b5a('0x5')](_0x0b5a('0x6'),attributes,{'tableName':_0x0b5a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ee9=['plugins','lodash','util','moment','request-promise','./plugin.attributes','exports','Plugin'];(function(_0x509885,_0x51ccf0){var _0x33386a=function(_0x90ab0e){while(--_0x90ab0e){_0x509885['push'](_0x509885['shift']());}};_0x33386a(++_0x51ccf0);}(_0x7ee9,0xa9));var _0x97ee=function(_0x3198fd,_0x3729d8){_0x3198fd=_0x3198fd-0x0;var _0x2dd0b=_0x7ee9[_0x3198fd];return _0x2dd0b;};'use strict';var _=require(_0x97ee('0x0'));var util=require(_0x97ee('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x97ee('0x2'));var BPromise=require('bluebird');var rp=require(_0x97ee('0x3'));var attributes=require(_0x97ee('0x4'));module[_0x97ee('0x5')]=function(_0x1cc822,_0xfc5fd7){return _0x1cc822['define'](_0x97ee('0x6'),attributes,{'tableName':_0x97ee('0x7'),'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 2de25f9..b803b34 100644 --- a/server/api/plugin/plugin.rpc.js +++ b/server/api/plugin/plugin.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bd5=['options','raw','then','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','localhost','socket.io-emitter','./plugin.socket','register','request','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','body'];(function(_0xba9cee,_0x2e71ee){var _0x520b21=function(_0x20eee0){while(--_0x20eee0){_0xba9cee['push'](_0xba9cee['shift']());}};_0x520b21(++_0x2e71ee);}(_0x7bd5,0x14d));var _0x57bd=function(_0x35a49c,_0x2f741d){_0x35a49c=_0x35a49c-0x0;var _0x2cadf3=_0x7bd5[_0x35a49c];return _0x2cadf3;};'use strict';var _=require(_0x57bd('0x0'));var util=require(_0x57bd('0x1'));var moment=require(_0x57bd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57bd('0x3'))['db'];var utils=require(_0x57bd('0x4'));var logger=require(_0x57bd('0x5'))(_0x57bd('0x6'));var config=require('../../config/environment');var jayson=require(_0x57bd('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x57bd('0x8')]=_['defaults'](config[_0x57bd('0x8')],{'host':_0x57bd('0x9'),'port':0x18eb});var socket=require(_0x57bd('0xa'))(new Redis(config[_0x57bd('0x8')]));require(_0x57bd('0xb'))[_0x57bd('0xc')](socket);function respondWithRpcPromise(_0x4dd1ca,_0x50ab96,_0x227711){return new BPromise(function(_0x515247,_0x50c07d){return client[_0x57bd('0xd')](_0x4dd1ca,_0x227711)['then'](function(_0x1bd574){logger[_0x57bd('0xe')]('Plugin,\x20%s,\x20%s',_0x50ab96,_0x57bd('0xf'));logger[_0x57bd('0x10')](_0x57bd('0x11'),_0x50ab96,_0x57bd('0xf'),JSON['stringify'](_0x1bd574));if(_0x1bd574[_0x57bd('0x12')]){if(_0x1bd574[_0x57bd('0x12')][_0x57bd('0x13')]===0x1f4){logger['error'](_0x57bd('0x14'),_0x50ab96,_0x1bd574['error'][_0x57bd('0x15')]);return _0x50c07d(_0x1bd574[_0x57bd('0x12')][_0x57bd('0x15')]);}logger[_0x57bd('0x12')](_0x57bd('0x14'),_0x50ab96,_0x1bd574[_0x57bd('0x12')]['message']);return _0x515247(_0x1bd574[_0x57bd('0x12')][_0x57bd('0x15')]);}else{logger[_0x57bd('0xe')]('Plugin,\x20%s,\x20%s',_0x50ab96,_0x57bd('0xf'));_0x515247(_0x1bd574[_0x57bd('0x16')][_0x57bd('0x15')]);}})[_0x57bd('0x17')](function(_0x2536fe){logger['error']('Plugin,\x20%s,\x20%s',_0x50ab96,_0x2536fe);_0x50c07d(_0x2536fe);});});}exports[_0x57bd('0x18')]=function(_0x575396){var _0x478834=this;return new Promise(function(_0xfee50b,_0x277c31){return db[_0x57bd('0x19')]['create'](_0x575396[_0x57bd('0x1a')],{'raw':_0x575396[_0x57bd('0x1b')]?_0x575396['options'][_0x57bd('0x1c')]===undefined?!![]:![]:!![]})[_0x57bd('0x1d')](function(_0x5dc51b){logger[_0x57bd('0xe')]('CreatePlugin',_0x575396);logger[_0x57bd('0x10')](_0x57bd('0x18'),_0x575396,JSON['stringify'](_0x5dc51b));_0xfee50b(_0x5dc51b);})['catch'](function(_0x1312eb){logger[_0x57bd('0x12')](_0x57bd('0x18'),_0x1312eb[_0x57bd('0x15')],_0x575396);_0x277c31(_0x478834[_0x57bd('0x12')](0x1f4,_0x1312eb[_0x57bd('0x15')]));});});}; \ No newline at end of file +var _0x68fd=['Plugin,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info'];(function(_0x235e7e,_0x5079e9){var _0x30410e=function(_0x437257){while(--_0x437257){_0x235e7e['push'](_0x235e7e['shift']());}};_0x30410e(++_0x5079e9);}(_0x68fd,0x1e9));var _0xd68f=function(_0x56acb9,_0x490076){_0x56acb9=_0x56acb9-0x0;var _0x1b27cc=_0x68fd[_0x56acb9];return _0x1b27cc;};'use strict';var _=require(_0xd68f('0x0'));var util=require('util');var moment=require(_0xd68f('0x1'));var BPromise=require(_0xd68f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd68f('0x3'));var db=require(_0xd68f('0x4'))['db'];var utils=require(_0xd68f('0x5'));var logger=require(_0xd68f('0x6'))(_0xd68f('0x7'));var config=require(_0xd68f('0x8'));var jayson=require(_0xd68f('0x9'));var client=jayson[_0xd68f('0xa')][_0xd68f('0xb')]({'port':0x232a});config['redis']=_[_0xd68f('0xc')](config[_0xd68f('0xd')],{'host':_0xd68f('0xe'),'port':0x18eb});var socket=require(_0xd68f('0xf'))(new Redis(config[_0xd68f('0xd')]));require(_0xd68f('0x10'))[_0xd68f('0x11')](socket);function respondWithRpcPromise(_0x4ff4ee,_0x52514d,_0x1c397a){return new BPromise(function(_0x59ac71,_0x114bda){return client[_0xd68f('0x12')](_0x4ff4ee,_0x1c397a)[_0xd68f('0x13')](function(_0x27001e){logger[_0xd68f('0x14')](_0xd68f('0x15'),_0x52514d,_0xd68f('0x16'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x52514d,'request\x20sent',JSON['stringify'](_0x27001e));if(_0x27001e[_0xd68f('0x17')]){if(_0x27001e[_0xd68f('0x17')]['code']===0x1f4){logger[_0xd68f('0x17')](_0xd68f('0x15'),_0x52514d,_0x27001e[_0xd68f('0x17')][_0xd68f('0x18')]);return _0x114bda(_0x27001e[_0xd68f('0x17')][_0xd68f('0x18')]);}logger[_0xd68f('0x17')]('Plugin,\x20%s,\x20%s',_0x52514d,_0x27001e[_0xd68f('0x17')]['message']);return _0x59ac71(_0x27001e['error'][_0xd68f('0x18')]);}else{logger[_0xd68f('0x14')](_0xd68f('0x15'),_0x52514d,_0xd68f('0x16'));_0x59ac71(_0x27001e[_0xd68f('0x19')][_0xd68f('0x18')]);}})[_0xd68f('0x1a')](function(_0x47fdbc){logger['error'](_0xd68f('0x15'),_0x52514d,_0x47fdbc);_0x114bda(_0x47fdbc);});});}exports[_0xd68f('0x1b')]=function(_0x3722da){var _0x459452=this;return new Promise(function(_0x24065d,_0x4c192f){return db[_0xd68f('0x1c')][_0xd68f('0x1d')](_0x3722da[_0xd68f('0x1e')],{'raw':_0x3722da['options']?_0x3722da[_0xd68f('0x1f')][_0xd68f('0x20')]===undefined?!![]:![]:!![]})[_0xd68f('0x13')](function(_0x590e04){logger['info'](_0xd68f('0x1b'),_0x3722da);logger['debug']('CreatePlugin',_0x3722da,JSON[_0xd68f('0x21')](_0x590e04));_0x24065d(_0x590e04);})[_0xd68f('0x1a')](function(_0xde6c97){logger[_0xd68f('0x17')](_0xd68f('0x1b'),_0xde6c97[_0xd68f('0x18')],_0x3722da);_0x4c192f(_0x459452[_0xd68f('0x17')](0x1f4,_0xde6c97[_0xd68f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 8975ee9..ed2e9d5 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 _0x167c=['update','emit','register','length','plugin:','./plugin.events','remove'];(function(_0x21d697,_0x8f791d){var _0x35e6c2=function(_0x596471){while(--_0x596471){_0x21d697['push'](_0x21d697['shift']());}};_0x35e6c2(++_0x8f791d);}(_0x167c,0x11d));var _0xc167=function(_0x219988,_0x42c60d){_0x219988=_0x219988-0x0;var _0x216239=_0x167c[_0x219988];return _0x216239;};'use strict';var PluginEvents=require(_0xc167('0x0'));var events=['save',_0xc167('0x1'),_0xc167('0x2')];function createListener(_0x136020,_0x12c661){return function(_0x44b012){_0x12c661[_0xc167('0x3')](_0x136020,_0x44b012);};}function removeListener(_0x20e65d,_0x48d024){return function(){PluginEvents['removeListener'](_0x20e65d,_0x48d024);};}exports[_0xc167('0x4')]=function(_0x376feb){for(var _0x15878b=0x0,_0x50a5d7=events[_0xc167('0x5')];_0x15878b<_0x50a5d7;_0x15878b++){var _0xc3b2ab=events[_0x15878b];var _0x549a03=createListener(_0xc167('0x6')+_0xc3b2ab,_0x376feb);PluginEvents['on'](_0xc3b2ab,_0x549a03);}}; \ No newline at end of file +var _0x679f=['emit','register','length','plugin:','./plugin.events'];(function(_0x3271d2,_0x28b697){var _0x3415f9=function(_0x57b145){while(--_0x57b145){_0x3271d2['push'](_0x3271d2['shift']());}};_0x3415f9(++_0x28b697);}(_0x679f,0xc2));var _0xf679=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x679f[_0x59ee6f];return _0x4c0979;};'use strict';var PluginEvents=require(_0xf679('0x0'));var events=['save','remove','update'];function createListener(_0x1865e7,_0x30e414){return function(_0x57fa54){_0x30e414[_0xf679('0x1')](_0x1865e7,_0x57fa54);};}function removeListener(_0x1e37f8,_0x5518d5){return function(){PluginEvents['removeListener'](_0x1e37f8,_0x5518d5);};}exports[_0xf679('0x2')]=function(_0x256876){for(var _0x2e0bc7=0x0,_0x4ba21b=events[_0xf679('0x3')];_0x2e0bc7<_0x4ba21b;_0x2e0bc7++){var _0x8349fe=events[_0x2e0bc7];var _0x4a1afa=createListener(_0xf679('0x4')+_0x8349fe,_0x256876);PluginEvents['on'](_0x8349fe,_0x4a1afa);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 3597436..863e3e3 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(_0x5c3017,_0x408b24){var _0x216bd5=function(_0x228dec){while(--_0x228dec){_0x5c3017['push'](_0x5c3017['shift']());}};_0x216bd5(++_0x408b24);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x4ad264,_0x5922cd){var _0x1599e9=function(_0x56c167){while(--_0x56c167){_0x4ad264['push'](_0x4ad264['shift']());}};_0x1599e9(++_0x5922cd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 e98da72..e48be9c 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 _0x5f02=['npm\x20install','info','list','then','reject','express','motion2','catch','describe','params','body','join','../../files/plugins','script','cwd','dirname','chdir','start','dump','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/logger','path','exec','bluebird','error','name','status','send'];(function(_0x50acd5,_0x2c650c){var _0x50d759=function(_0x53219b){while(--_0x53219b){_0x50acd5['push'](_0x50acd5['shift']());}};_0x50d759(++_0x2c650c);}(_0x5f02,0xa6));var _0x25f0=function(_0x3dc3ca,_0x4a98b6){_0x3dc3ca=_0x3dc3ca-0x0;var _0xf65d3f=_0x5f02[_0x3dc3ca];return _0xf65d3f;};'use strict';var _=require(_0x25f0('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x25f0('0x1'))('api');var path=require(_0x25f0('0x2'));var exec=require('child_process')[_0x25f0('0x3')];var BPromise=require(_0x25f0('0x4'));function handleEntityNotFound(_0x127271,_0x2a4994){return function(_0x548a05){if(!_0x548a05){_0x127271['sendStatus'](0x194);;}return _0x548a05;};}function respondWithResult(_0x1fbd6a,_0xa33822){_0xa33822=_0xa33822||0xc8;return function(_0x164e2c){if(_0x164e2c){return _0x1fbd6a['status'](_0xa33822)['json'](_0x164e2c);}return null;};}function handleError(_0x58d564,_0x2c49b0){_0x2c49b0=_0x2c49b0||0x1f4;return function(_0x488cb9){logger[_0x25f0('0x5')](_0x488cb9['stack']);if(_0x488cb9[_0x25f0('0x6')]){delete _0x488cb9['name'];}_0x58d564[_0x25f0('0x7')](_0x2c49b0)[_0x25f0('0x8')](_0x488cb9);};}function execChildProcess(){return new BPromise(function(_0x513212,_0xbad749){exec(_0x25f0('0x9'),function(_0x4195b4,_0x2cfea8,_0x3678e3){logger[_0x25f0('0xa')](_0x2cfea8);logger[_0x25f0('0xa')](_0x3678e3);if(_0x4195b4){logger[_0x25f0('0x5')](_0x4195b4);return _0xbad749(_0x4195b4);}return _0x513212(_0x2cfea8);});});}exports['index']=function(_0x2d9deb,_0x22be50){return pm2[_0x25f0('0xb')]()[_0x25f0('0xc')](function(_0x19f688){if(_0x19f688){var _0x55e013=_[_0x25f0('0xd')](_0x19f688,function(_0x4678b6){return _0x4678b6[_0x25f0('0x6')]===_0x25f0('0xe')||_0x4678b6['name']===_0x25f0('0xf');});return{'rows':_0x55e013,'count':_0x55e013['length']};}return null;})['then'](respondWithResult(_0x22be50,null))[_0x25f0('0x10')](handleError(_0x22be50,null));};exports['show']=function(_0x44e13c,_0x39aee8){return pm2[_0x25f0('0x11')](_0x44e13c[_0x25f0('0x12')]['id'])['then'](respondWithResult(_0x39aee8,null))[_0x25f0('0xc')](handleEntityNotFound(_0x39aee8,null))[_0x25f0('0x10')](handleError(_0x39aee8,null));};exports['create']=function(_0x11db12,_0x2524db){if(_0x11db12[_0x25f0('0x13')][_0x25f0('0x6')]&&_0x11db12[_0x25f0('0x13')]['script']){var _0x488cc5=path[_0x25f0('0x14')](__dirname,_0x25f0('0x15'),_0x11db12[_0x25f0('0x13')][_0x25f0('0x16')]);var _0x350387=process[_0x25f0('0x17')]();process['chdir'](path[_0x25f0('0x18')](_0x488cc5));return execChildProcess()[_0x25f0('0xc')](function(_0x3c10c9){process[_0x25f0('0x19')](_0x350387);return pm2[_0x25f0('0x1a')]({'name':_0x11db12[_0x25f0('0x13')]['name'],'script':_0x488cc5});})[_0x25f0('0xc')](function(_0x38c3e8){pm2[_0x25f0('0x1b')]();return _0x38c3e8[0x0];})[_0x25f0('0xc')](respondWithResult(_0x2524db,0xc9))[_0x25f0('0x10')](handleError(_0x2524db,null));}else{return _0x2524db[_0x25f0('0x7')](0x1f4)[_0x25f0('0x8')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x453122,_0x170486){if(_0x453122[_0x25f0('0x13')]['id']){delete _0x453122[_0x25f0('0x13')]['id'];}var _0x34d2c6={'online':_0x25f0('0x1c'),'stopped':_0x25f0('0x1d')};if(_0x34d2c6[_0x25f0('0x1e')](_0x453122[_0x25f0('0x13')][_0x25f0('0x7')])){return pm2[_0x34d2c6[_0x453122[_0x25f0('0x13')][_0x25f0('0x7')]]](_0x453122[_0x25f0('0x12')]['id'])[_0x25f0('0xc')](respondWithResult(_0x170486,0xc8))['catch'](handleError(_0x170486,null));}else{return _0x170486['status'](0x1f4)['send']({'message':_0x25f0('0x1f')});}};exports[_0x25f0('0x20')]=function(_0x5336a2,_0x1fcfa1){if(_0x5336a2[_0x25f0('0x13')]['id']){delete _0x5336a2['body']['id'];}if(_0x5336a2[_0x25f0('0x12')]['id']){return pm2[_0x25f0('0x21')](_0x5336a2[_0x25f0('0x12')]['id'])['then'](function(_0x1844ef){pm2[_0x25f0('0x1b')]();return _0x1844ef[0x0];})[_0x25f0('0xc')](respondWithResult(_0x1fcfa1,null))['catch'](handleError(_0x1fcfa1,null));}else{return _0x1fcfa1['status'](0x1f4)[_0x25f0('0x8')]({'message':_0x25f0('0x22')});}}; \ No newline at end of file +var _0xc075=['name','send','list','then','reject','express','motion2','length','catch','show','describe','body','script','join','../../files/plugins','cwd','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','params','Unknown\x20status','destroy','lodash','api','path','child_process','exec','bluebird','sendStatus','status','json','stack'];(function(_0x4983f4,_0x2150a2){var _0x43551c=function(_0x33462a){while(--_0x33462a){_0x4983f4['push'](_0x4983f4['shift']());}};_0x43551c(++_0x2150a2);}(_0xc075,0x1a6));var _0x5c07=function(_0x307287,_0x2e63f4){_0x307287=_0x307287-0x0;var _0x36aea5=_0xc075[_0x307287];return _0x36aea5;};'use strict';var _=require(_0x5c07('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x5c07('0x1'));var path=require(_0x5c07('0x2'));var exec=require(_0x5c07('0x3'))[_0x5c07('0x4')];var BPromise=require(_0x5c07('0x5'));function handleEntityNotFound(_0x32ff87,_0x5a179c){return function(_0x2d72d4){if(!_0x2d72d4){_0x32ff87[_0x5c07('0x6')](0x194);;}return _0x2d72d4;};}function respondWithResult(_0x3ca549,_0x54d3d6){_0x54d3d6=_0x54d3d6||0xc8;return function(_0x1ca99f){if(_0x1ca99f){return _0x3ca549[_0x5c07('0x7')](_0x54d3d6)[_0x5c07('0x8')](_0x1ca99f);}return null;};}function handleError(_0x16121f,_0x462705){_0x462705=_0x462705||0x1f4;return function(_0x32005a){logger['error'](_0x32005a[_0x5c07('0x9')]);if(_0x32005a[_0x5c07('0xa')]){delete _0x32005a['name'];}_0x16121f[_0x5c07('0x7')](_0x462705)[_0x5c07('0xb')](_0x32005a);};}function execChildProcess(){return new BPromise(function(_0x331bb5,_0x5c5136){exec('npm\x20install',function(_0x467e22,_0x205eb6,_0x425e8f){logger['info'](_0x205eb6);logger['info'](_0x425e8f);if(_0x467e22){logger['error'](_0x467e22);return _0x5c5136(_0x467e22);}return _0x331bb5(_0x205eb6);});});}exports['index']=function(_0x289a0f,_0x4e3f87){return pm2[_0x5c07('0xc')]()[_0x5c07('0xd')](function(_0x5eb889){if(_0x5eb889){var _0x289c15=_[_0x5c07('0xe')](_0x5eb889,function(_0x139bc0){return _0x139bc0[_0x5c07('0xa')]===_0x5c07('0xf')||_0x139bc0[_0x5c07('0xa')]===_0x5c07('0x10');});return{'rows':_0x289c15,'count':_0x289c15[_0x5c07('0x11')]};}return null;})[_0x5c07('0xd')](respondWithResult(_0x4e3f87,null))[_0x5c07('0x12')](handleError(_0x4e3f87,null));};exports[_0x5c07('0x13')]=function(_0x166d42,_0x106e5d){return pm2[_0x5c07('0x14')](_0x166d42['params']['id'])['then'](respondWithResult(_0x106e5d,null))[_0x5c07('0xd')](handleEntityNotFound(_0x106e5d,null))[_0x5c07('0x12')](handleError(_0x106e5d,null));};exports['create']=function(_0x4774e4,_0x501ec1){if(_0x4774e4[_0x5c07('0x15')][_0x5c07('0xa')]&&_0x4774e4[_0x5c07('0x15')][_0x5c07('0x16')]){var _0x1a7716=path[_0x5c07('0x17')](__dirname,_0x5c07('0x18'),_0x4774e4[_0x5c07('0x15')][_0x5c07('0x16')]);var _0xddb9a9=process[_0x5c07('0x19')]();process['chdir'](path[_0x5c07('0x1a')](_0x1a7716));return execChildProcess()[_0x5c07('0xd')](function(_0x8801d8){process['chdir'](_0xddb9a9);return pm2['start']({'name':_0x4774e4[_0x5c07('0x15')][_0x5c07('0xa')],'script':_0x1a7716});})[_0x5c07('0xd')](function(_0x4d9696){pm2[_0x5c07('0x1b')]();return _0x4d9696[0x0];})[_0x5c07('0xd')](respondWithResult(_0x501ec1,0xc9))[_0x5c07('0x12')](handleError(_0x501ec1,null));}else{return _0x501ec1[_0x5c07('0x7')](0x1f4)[_0x5c07('0xb')]({'message':_0x5c07('0x1c')});}};exports[_0x5c07('0x1d')]=function(_0x1cc7e7,_0x375961){if(_0x1cc7e7[_0x5c07('0x15')]['id']){delete _0x1cc7e7[_0x5c07('0x15')]['id'];}var _0x4f7d17={'online':_0x5c07('0x1e'),'stopped':_0x5c07('0x1f')};if(_0x4f7d17[_0x5c07('0x20')](_0x1cc7e7['body'][_0x5c07('0x7')])){return pm2[_0x4f7d17[_0x1cc7e7[_0x5c07('0x15')][_0x5c07('0x7')]]](_0x1cc7e7[_0x5c07('0x21')]['id'])[_0x5c07('0xd')](respondWithResult(_0x375961,0xc8))['catch'](handleError(_0x375961,null));}else{return _0x375961[_0x5c07('0x7')](0x1f4)['send']({'message':_0x5c07('0x22')});}};exports[_0x5c07('0x23')]=function(_0x1933a7,_0x290593){if(_0x1933a7[_0x5c07('0x15')]['id']){delete _0x1933a7[_0x5c07('0x15')]['id'];}if(_0x1933a7[_0x5c07('0x21')]['id']){return pm2['delete'](_0x1933a7[_0x5c07('0x21')]['id'])[_0x5c07('0xd')](function(_0x2f3ecb){pm2[_0x5c07('0x1b')]();return _0x2f3ecb[0x0];})['then'](respondWithResult(_0x290593,null))[_0x5c07('0x12')](handleError(_0x290593,null));}else{return _0x290593[_0x5c07('0x7')](0x1f4)[_0x5c07('0xb')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 413712d..7baa495 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 _0xaf11=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x37e09b,_0x4c5ee9){var _0x26a1ed=function(_0x5c1d86){while(--_0x5c1d86){_0x37e09b['push'](_0x37e09b['shift']());}};_0x26a1ed(++_0x4c5ee9);}(_0xaf11,0x12f));var _0x1af1=function(_0x1acfb5,_0x502953){_0x1acfb5=_0x1acfb5-0x0;var _0x39f051=_0xaf11[_0x1acfb5];return _0x39f051;};'use strict';var multer=require(_0x1af1('0x0'));var util=require(_0x1af1('0x1'));var path=require(_0x1af1('0x2'));var timeout=require(_0x1af1('0x3'));var express=require('express');var router=express[_0x1af1('0x4')]();var auth=require(_0x1af1('0x5'));var interaction=require(_0x1af1('0x6'));var config=require('../../config/environment');module[_0x1af1('0x7')]=router; \ No newline at end of file +var _0x7f05=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','express'];(function(_0x254ef8,_0x1e60a0){var _0x5bb5b7=function(_0x48ecbe){while(--_0x48ecbe){_0x254ef8['push'](_0x254ef8['shift']());}};_0x5bb5b7(++_0x1e60a0);}(_0x7f05,0xdc));var _0x57f0=function(_0x466f14,_0x4de814){_0x466f14=_0x466f14-0x0;var _0x15ce28=_0x7f05[_0x466f14];return _0x15ce28;};'use strict';var multer=require(_0x57f0('0x0'));var util=require(_0x57f0('0x1'));var path=require(_0x57f0('0x2'));var timeout=require('connect-timeout');var express=require(_0x57f0('0x3'));var router=express['Router']();var auth=require(_0x57f0('0x4'));var interaction=require(_0x57f0('0x5'));var config=require('../../config/environment');module[_0x57f0('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 109c8d4..7e43fdc 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 _0x29cb=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x29cb,0x1ba));var _0xb29c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x29cb[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xb29c('0x0'));module[_0xb29c('0x1')]={'state':{'type':Sequelize[_0xb29c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb29c('0x3')]},'scheduledat':{'type':Sequelize[_0xb29c('0x4')]},'uniqueid':{'type':Sequelize[_0xb29c('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xb29c('0x4')]},'ringtime':{'type':Sequelize[_0xb29c('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xb29c('0x3')]},'campaigntype':{'type':Sequelize[_0xb29c('0x3')]},'membername':{'type':Sequelize[_0xb29c('0x3')]}}; \ No newline at end of file +var _0x18fd=['sequelize','INTEGER','STRING','DATE'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x18fd,0x188));var _0xd18f=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0x18fd[_0x1168a1];return _0xcc5ad8;};'use strict';var Sequelize=require(_0xd18f('0x0'));module['exports']={'state':{'type':Sequelize[_0xd18f('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xd18f('0x2')]},'scheduledat':{'type':Sequelize[_0xd18f('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd18f('0x3')]},'responsetime':{'type':Sequelize[_0xd18f('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xd18f('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd18f('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 8f2cf7b..ba3fb31 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 _0xbe7e=['bluebird','request-promise','exports','define','ReportAgentPreview','lodash','../../config/logger','moment'];(function(_0x220309,_0x1bb2f8){var _0x291cfb=function(_0x200ecb){while(--_0x200ecb){_0x220309['push'](_0x220309['shift']());}};_0x291cfb(++_0x1bb2f8);}(_0xbe7e,0x105));var _0xebe7=function(_0x42e7af,_0x35b83b){_0x42e7af=_0x42e7af-0x0;var _0x10f32e=_0xbe7e[_0x42e7af];return _0x10f32e;};'use strict';var _=require(_0xebe7('0x0'));var util=require('util');var logger=require(_0xebe7('0x1'))('api');var moment=require(_0xebe7('0x2'));var BPromise=require(_0xebe7('0x3'));var rp=require(_0xebe7('0x4'));var attributes=require('./reportAgentPreview.attributes');module[_0xebe7('0x5')]=function(_0x501fcd,_0x57b6c1){return _0x501fcd[_0xebe7('0x6')](_0xebe7('0x7'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x872b=['exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x872b,0x1cf));var _0xb872=function(_0x3062ff,_0x594115){_0x3062ff=_0x3062ff-0x0;var _0x2e9a17=_0x872b[_0x3062ff];return _0x2e9a17;};'use strict';var _=require(_0xb872('0x0'));var util=require(_0xb872('0x1'));var logger=require(_0xb872('0x2'))(_0xb872('0x3'));var moment=require(_0xb872('0x4'));var BPromise=require(_0xb872('0x5'));var rp=require(_0xb872('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0xb872('0x7')]=function(_0x24b407,_0x3ab217){return _0x24b407['define'](_0xb872('0x8'),attributes,{'tableName':_0xb872('0x9'),'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 a0c49f2..ff71957 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 _0xee1d=['options','raw','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body'];(function(_0x3dd644,_0x236622){var _0x19fdcf=function(_0x561081){while(--_0x561081){_0x3dd644['push'](_0x3dd644['shift']());}};_0x19fdcf(++_0x236622);}(_0xee1d,0x1b6));var _0xdee1=function(_0x5f3867,_0x24d3c3){_0x5f3867=_0x5f3867-0x0;var _0x1ab15d=_0xee1d[_0x5f3867];return _0x1ab15d;};'use strict';var _=require(_0xdee1('0x0'));var util=require('util');var moment=require(_0xdee1('0x1'));var BPromise=require(_0xdee1('0x2'));var rs=require(_0xdee1('0x3'));var fs=require('fs');var Redis=require(_0xdee1('0x4'));var db=require(_0xdee1('0x5'))['db'];var utils=require(_0xdee1('0x6'));var logger=require(_0xdee1('0x7'))(_0xdee1('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdee1('0x9')][_0xdee1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x332b5d,_0x314f01,_0x292a52){return new BPromise(function(_0x144610,_0x57b89e){return client['request'](_0x332b5d,_0x292a52)[_0xdee1('0xb')](function(_0x2f38bc){logger[_0xdee1('0xc')](_0xdee1('0xd'),_0x314f01,'request\x20sent');logger[_0xdee1('0xe')](_0xdee1('0xf'),_0x314f01,'request\x20sent',JSON['stringify'](_0x2f38bc));if(_0x2f38bc[_0xdee1('0x10')]){if(_0x2f38bc[_0xdee1('0x10')][_0xdee1('0x11')]===0x1f4){logger[_0xdee1('0x10')](_0xdee1('0xd'),_0x314f01,_0x2f38bc[_0xdee1('0x10')][_0xdee1('0x12')]);return _0x57b89e(_0x2f38bc[_0xdee1('0x10')][_0xdee1('0x12')]);}logger[_0xdee1('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x314f01,_0x2f38bc[_0xdee1('0x10')][_0xdee1('0x12')]);return _0x144610(_0x2f38bc[_0xdee1('0x10')][_0xdee1('0x12')]);}else{logger[_0xdee1('0xc')](_0xdee1('0xd'),_0x314f01,_0xdee1('0x13'));_0x144610(_0x2f38bc[_0xdee1('0x14')]['message']);}})[_0xdee1('0x15')](function(_0x392aed){logger[_0xdee1('0x10')](_0xdee1('0xd'),_0x314f01,_0x392aed);_0x57b89e(_0x392aed);});});}exports[_0xdee1('0x16')]=function(_0x13ef19){var _0x28df93=this;return new Promise(function(_0x314015,_0x52f600){return db[_0xdee1('0x17')][_0xdee1('0x18')](_0x13ef19[_0xdee1('0x19')],{'raw':_0x13ef19[_0xdee1('0x1a')]?_0x13ef19[_0xdee1('0x1a')][_0xdee1('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2fc63e){logger[_0xdee1('0xc')](_0xdee1('0x16'),_0x13ef19);logger[_0xdee1('0xe')](_0xdee1('0x16'),_0x13ef19,JSON[_0xdee1('0x1c')](_0x2fc63e));_0x314015(_0x2fc63e);})[_0xdee1('0x15')](function(_0x2ba803){logger['error'](_0xdee1('0x16'),_0x2ba803[_0xdee1('0x12')],_0x13ef19);_0x52f600(_0x28df93[_0xdee1('0x10')](0x1f4,_0x2ba803[_0xdee1('0x12')]));});});}; \ No newline at end of file +var _0x2f3c=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2f3c,0x11c));var _0xc2f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f3c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc2f3('0x0'));var util=require(_0xc2f3('0x1'));var moment=require('moment');var BPromise=require(_0xc2f3('0x2'));var rs=require(_0xc2f3('0x3'));var fs=require('fs');var Redis=require(_0xc2f3('0x4'));var db=require(_0xc2f3('0x5'))['db'];var utils=require(_0xc2f3('0x6'));var logger=require(_0xc2f3('0x7'))(_0xc2f3('0x8'));var config=require(_0xc2f3('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc2f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36cf9f,_0x311edc,_0x1cb957){return new BPromise(function(_0x1b7d3e,_0x300963){return client[_0xc2f3('0xb')](_0x36cf9f,_0x1cb957)[_0xc2f3('0xc')](function(_0x446cf6){logger[_0xc2f3('0xd')](_0xc2f3('0xe'),_0x311edc,_0xc2f3('0xf'));logger[_0xc2f3('0x10')](_0xc2f3('0x11'),_0x311edc,'request\x20sent',JSON['stringify'](_0x446cf6));if(_0x446cf6['error']){if(_0x446cf6[_0xc2f3('0x12')][_0xc2f3('0x13')]===0x1f4){logger['error'](_0xc2f3('0xe'),_0x311edc,_0x446cf6[_0xc2f3('0x12')][_0xc2f3('0x14')]);return _0x300963(_0x446cf6['error'][_0xc2f3('0x14')]);}logger[_0xc2f3('0x12')](_0xc2f3('0xe'),_0x311edc,_0x446cf6['error'][_0xc2f3('0x14')]);return _0x1b7d3e(_0x446cf6[_0xc2f3('0x12')][_0xc2f3('0x14')]);}else{logger[_0xc2f3('0xd')](_0xc2f3('0xe'),_0x311edc,_0xc2f3('0xf'));_0x1b7d3e(_0x446cf6['result'][_0xc2f3('0x14')]);}})[_0xc2f3('0x15')](function(_0x578d99){logger['error'](_0xc2f3('0xe'),_0x311edc,_0x578d99);_0x300963(_0x578d99);});});}exports[_0xc2f3('0x16')]=function(_0x76a509){var _0x2edb11=this;return new Promise(function(_0x276787,_0x6a0eae){return db[_0xc2f3('0x17')][_0xc2f3('0x18')](_0x76a509[_0xc2f3('0x19')],{'raw':_0x76a509[_0xc2f3('0x1a')]?_0x76a509['options'][_0xc2f3('0x1b')]===undefined?!![]:![]:!![]})[_0xc2f3('0xc')](function(_0x1079b0){logger['info'](_0xc2f3('0x16'),_0x76a509);logger[_0xc2f3('0x10')](_0xc2f3('0x16'),_0x76a509,JSON[_0xc2f3('0x1c')](_0x1079b0));_0x276787(_0x1079b0);})[_0xc2f3('0x15')](function(_0x33238c){logger['error'](_0xc2f3('0x16'),_0x33238c[_0xc2f3('0x14')],_0x76a509);_0x6a0eae(_0x2edb11[_0xc2f3('0x12')](0x1f4,_0x33238c[_0xc2f3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 193f70e..1bc40cf 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 _0xbb80=['showFaxQueues','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','agentNotify','exports','multer','path','express','../../components/auth/service','./rpc.controller','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelStopMixMonitor','voiceQueues','chatQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outboundChannels','agents','put','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xbb80,0x8c));var _0x0bb8=function(_0x35f27f,_0x3ca07a){_0x35f27f=_0x35f27f-0x0;var _0x3377c0=_0xbb80[_0x35f27f];return _0x3377c0;};'use strict';var multer=require(_0x0bb8('0x0'));var util=require('util');var path=require(_0x0bb8('0x1'));var express=require(_0x0bb8('0x2'));var router=express['Router']();var auth=require(_0x0bb8('0x3'));var controller=require(_0x0bb8('0x4'));router['get']('/voice/channels',auth[_0x0bb8('0x5')](),controller['voiceChannels']);router[_0x0bb8('0x6')](_0x0bb8('0x7'),auth[_0x0bb8('0x5')](),controller['voiceChannelMixMonitor']);router[_0x0bb8('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x8')]);router['get']('/voice/queues',auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x9')]);router[_0x0bb8('0x6')]('/chat/queues',auth['isAuthenticated'](),controller[_0x0bb8('0xa')]);router[_0x0bb8('0x6')]('/mail/queues',auth[_0x0bb8('0x5')](),controller['mailQueues']);router[_0x0bb8('0x6')](_0x0bb8('0xb'),auth['isAuthenticated'](),controller[_0x0bb8('0xc')]);router[_0x0bb8('0x6')]('/openchannel/queues',auth[_0x0bb8('0x5')](),controller[_0x0bb8('0xd')]);router['get'](_0x0bb8('0xe'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0xf')]);router['get']('/fax/queues',auth[_0x0bb8('0x5')](),controller['faxQueues']);router[_0x0bb8('0x6')](_0x0bb8('0x10'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0x0bb8('0x6')](_0x0bb8('0x11'),auth['isAuthenticated'](),controller[_0x0bb8('0x12')]);router[_0x0bb8('0x6')](_0x0bb8('0x13'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x14')]);router[_0x0bb8('0x6')](_0x0bb8('0x15'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x16')]);router[_0x0bb8('0x6')](_0x0bb8('0x17'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x18')]);router[_0x0bb8('0x6')](_0x0bb8('0x19'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x1a')]);router['get'](_0x0bb8('0x1b'),auth[_0x0bb8('0x5')](),controller['outbound']);router['get']('/outbound/channels',auth['isAuthenticated'](),controller[_0x0bb8('0x1c')]);router[_0x0bb8('0x6')]('/agents',auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x1d')]);router[_0x0bb8('0x1e')](_0x0bb8('0x1f'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x20')]);router[_0x0bb8('0x6')](_0x0bb8('0x21'),auth[_0x0bb8('0x5')](),controller['telephones']);router['get'](_0x0bb8('0x22'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x23')]);router[_0x0bb8('0x6')](_0x0bb8('0x24'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x25')]);router[_0x0bb8('0x6')](_0x0bb8('0x26'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x27')]);router[_0x0bb8('0x6')](_0x0bb8('0x28'),auth[_0x0bb8('0x5')](),controller['chatQueuesWaitingInteractions']);router[_0x0bb8('0x6')](_0x0bb8('0x29'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x2a')]);router[_0x0bb8('0x6')](_0x0bb8('0x2b'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router['get']('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x0bb8('0x2c')]);router['get'](_0x0bb8('0x2d'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x2e')]);router[_0x0bb8('0x2f')](_0x0bb8('0x30'),auth[_0x0bb8('0x5')](),controller['queueNotify'](_0x0bb8('0x31')));router[_0x0bb8('0x6')](_0x0bb8('0x32'),auth['isAuthenticated'](),controller[_0x0bb8('0x33')]);router[_0x0bb8('0x2f')](_0x0bb8('0x34'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x35')](_0x0bb8('0x36')));router[_0x0bb8('0x6')](_0x0bb8('0x37'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0x0bb8('0x2f')](_0x0bb8('0x38'),auth['isAuthenticated'](),controller[_0x0bb8('0x35')]('fax'));router['get'](_0x0bb8('0x39'),auth['isAuthenticated'](),controller[_0x0bb8('0x3a')]);router[_0x0bb8('0x2f')]('/openchannel/queues/:id/notify',auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x35')]('openchannel'));router['get'](_0x0bb8('0x3b'),auth[_0x0bb8('0x5')](),controller['showOpenchannelQueues']);router[_0x0bb8('0x2f')](_0x0bb8('0x3c'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x35')](_0x0bb8('0x3d')));router[_0x0bb8('0x6')](_0x0bb8('0x3e'),auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x3f')]);router['post']('/agents/:id/notify',auth[_0x0bb8('0x5')](),controller[_0x0bb8('0x40')]);module[_0x0bb8('0x41')]=router; \ No newline at end of file +var _0xf672=['util','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','/outbound','outbound','outboundChannels','/agents','put','/agents/:id/capacity','/telephones','telephones','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','exports','multer'];(function(_0x340ae3,_0x297191){var _0x3f230b=function(_0x59a938){while(--_0x59a938){_0x340ae3['push'](_0x340ae3['shift']());}};_0x3f230b(++_0x297191);}(_0xf672,0xc5));var _0x2f67=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xf672[_0x36eaaa];return _0x461349;};'use strict';var multer=require(_0x2f67('0x0'));var util=require(_0x2f67('0x1'));var path=require(_0x2f67('0x2'));var express=require(_0x2f67('0x3'));var router=express['Router']();var auth=require(_0x2f67('0x4'));var controller=require(_0x2f67('0x5'));router[_0x2f67('0x6')](_0x2f67('0x7'),auth['isAuthenticated'](),controller[_0x2f67('0x8')]);router[_0x2f67('0x6')](_0x2f67('0x9'),auth[_0x2f67('0xa')](),controller['voiceChannelMixMonitor']);router[_0x2f67('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x2f67('0xb')]);router['get'](_0x2f67('0xc'),auth[_0x2f67('0xa')](),controller[_0x2f67('0xd')]);router[_0x2f67('0x6')](_0x2f67('0xe'),auth[_0x2f67('0xa')](),controller[_0x2f67('0xf')]);router[_0x2f67('0x6')](_0x2f67('0x10'),auth[_0x2f67('0xa')](),controller[_0x2f67('0x11')]);router[_0x2f67('0x6')]('/mail/accounts',auth[_0x2f67('0xa')](),controller[_0x2f67('0x12')]);router['get'](_0x2f67('0x13'),auth['isAuthenticated'](),controller[_0x2f67('0x14')]);router['get'](_0x2f67('0x15'),auth[_0x2f67('0xa')](),controller[_0x2f67('0x16')]);router['get']('/fax/queues',auth[_0x2f67('0xa')](),controller[_0x2f67('0x17')]);router[_0x2f67('0x6')](_0x2f67('0x18'),auth[_0x2f67('0xa')](),controller[_0x2f67('0x19')]);router[_0x2f67('0x6')]('/voice/queues/channels',auth['isAuthenticated'](),controller['voiceQueuesChannels']);router['get']('/voice/queues/channels/:uniqueid',auth[_0x2f67('0xa')](),controller[_0x2f67('0x1a')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x2f67('0xa')](),controller[_0x2f67('0x1b')]);router[_0x2f67('0x6')](_0x2f67('0x1c'),auth[_0x2f67('0xa')](),controller['voiceQueuesChannelRedirect']);router['get'](_0x2f67('0x1d'),auth[_0x2f67('0xa')](),controller['showVoiceQueues']);router[_0x2f67('0x6')](_0x2f67('0x1e'),auth[_0x2f67('0xa')](),controller[_0x2f67('0x1f')]);router[_0x2f67('0x6')]('/outbound/channels',auth[_0x2f67('0xa')](),controller[_0x2f67('0x20')]);router[_0x2f67('0x6')](_0x2f67('0x21'),auth[_0x2f67('0xa')](),controller['agents']);router[_0x2f67('0x22')](_0x2f67('0x23'),auth[_0x2f67('0xa')](),controller['agentCapacity']);router['get'](_0x2f67('0x24'),auth[_0x2f67('0xa')](),controller[_0x2f67('0x25')]);router[_0x2f67('0x6')]('/trunks',auth[_0x2f67('0xa')](),controller[_0x2f67('0x26')]);router[_0x2f67('0x6')](_0x2f67('0x27'),auth['isAuthenticated'](),controller[_0x2f67('0x28')]);router[_0x2f67('0x6')]('/fax/accounts',auth[_0x2f67('0xa')](),controller[_0x2f67('0x29')]);router[_0x2f67('0x6')](_0x2f67('0x2a'),auth[_0x2f67('0xa')](),controller[_0x2f67('0x2b')]);router[_0x2f67('0x6')](_0x2f67('0x2c'),auth[_0x2f67('0xa')](),controller['mailQueuesWaitingInteractions']);router['get']('/openchannel/queues/waitinginteractions',auth[_0x2f67('0xa')](),controller[_0x2f67('0x2d')]);router['get']('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x2f67('0x2e')]);router[_0x2f67('0x6')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x2f67('0x2f')]);router[_0x2f67('0x30')](_0x2f67('0x31'),auth['isAuthenticated'](),controller[_0x2f67('0x32')]('mail'));router[_0x2f67('0x6')](_0x2f67('0x33'),auth[_0x2f67('0xa')](),controller[_0x2f67('0x34')]);router[_0x2f67('0x30')]('/chat/queues/:id/notify',auth[_0x2f67('0xa')](),controller[_0x2f67('0x32')]('chat'));router['get'](_0x2f67('0x35'),auth[_0x2f67('0xa')](),controller[_0x2f67('0x36')]);router[_0x2f67('0x30')](_0x2f67('0x37'),auth[_0x2f67('0xa')](),controller['queueNotify']('fax'));router['get']('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x2f67('0x38')]);router[_0x2f67('0x30')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0x2f67('0x32')](_0x2f67('0x39')));router[_0x2f67('0x6')](_0x2f67('0x3a'),auth[_0x2f67('0xa')](),controller[_0x2f67('0x3b')]);router[_0x2f67('0x30')](_0x2f67('0x3c'),auth[_0x2f67('0xa')](),controller[_0x2f67('0x32')](_0x2f67('0x3d')));router[_0x2f67('0x6')](_0x2f67('0x3e'),auth[_0x2f67('0xa')](),controller[_0x2f67('0x3f')]);router[_0x2f67('0x30')](_0x2f67('0x40'),auth[_0x2f67('0xa')](),controller['agentNotify']);module[_0x2f67('0x41')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 798c01a..77e2b27 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 _0x99d4=['OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','faxQueues','FaxQueues','faxAccounts','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','Website','Account','Queue','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','*,*,*,*','agentNotify','channel','capitalize','chat','User','findOne','agent','Agent\x20not\x20found','agentTransferTimeout','moment','lodash','../../mysqldb','api','jayson/promise','client','http','request','then','error','message','result','catch','status','json','sendStatus','isNil','rows','find','voiceChannels','VoiceChannels','query','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','VoiceQueuesPreview','merge','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','name','hasOwnProperty','MemberReport','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','length','INTERACTION','interface','SIP/%s','internal','capacity','telephones','Telephones','Trunks','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x99d4,0x10c));var _0x499d=function(_0x10c7b4,_0xf1e3ab){_0x10c7b4=_0x10c7b4-0x0;var _0x15eaa2=_0x99d4[_0x10c7b4];return _0x15eaa2;};'use strict';var BPromise=require('bluebird');var moment=require(_0x499d('0x0'));var _=require(_0x499d('0x1'));var util=require('util');var db=require(_0x499d('0x2'))['db'];var logger=require('../../config/logger')(_0x499d('0x3'));var jayson=require(_0x499d('0x4'));var amiClient=jayson[_0x499d('0x5')][_0x499d('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x499d('0x5')][_0x499d('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x5c5ad1,_0x57c995,_0x2c4040){return new BPromise(function(_0x117d6b,_0x3a9cfa){var _0x4a5313=_0x2c4040?_0x2c4040:amiClient;return _0x4a5313[_0x499d('0x7')](_0x5c5ad1,_0x57c995)[_0x499d('0x8')](function(_0x189280){if(_0x189280['error']){if(_0x189280['error']['code']===0x1f4){return _0x3a9cfa(_0x189280[_0x499d('0x9')][_0x499d('0xa')]);}return _0x117d6b(_0x189280['error']['message']);}else{_0x117d6b(_0x189280[_0x499d('0xb')]);}})[_0x499d('0xc')](function(_0x3204ac){_0x3a9cfa(_0x3204ac);});});}function respondWithResult(_0x5ae2bb,_0x375979){_0x375979=_0x375979||0xc8;return function(_0x41bb39){if(_0x41bb39){return _0x5ae2bb[_0x499d('0xd')](_0x375979)[_0x499d('0xe')](_0x41bb39);}return _0x5ae2bb[_0x499d('0xf')](0x194);};}function handleError(_0x2447b1,_0x91ff38){_0x91ff38=_0x91ff38||0x1f4;return function(_0x380416){logger[_0x499d('0x9')](_0x380416['stack']);if(_0x380416['name']){delete _0x380416['name'];}_0x2447b1['status'](_0x91ff38)['send'](_0x380416);};}function findById(_0x258568){return function(_0x266f19){if(!_[_0x499d('0x10')](_0x258568)&&!_[_0x499d('0x10')](_0x266f19)&&!_[_0x499d('0x10')](_0x266f19[_0x499d('0x11')])){return _[_0x499d('0x12')](_0x266f19['rows'],function(_0x34bb2b){return _0x34bb2b['id']==_0x258568;});}return null;};}exports[_0x499d('0x13')]=function(_0x2c0203,_0x4d24ca){return respondWithRpcPromise(_0x499d('0x14'),_0x2c0203[_0x499d('0x15')])[_0x499d('0x8')](respondWithResult(_0x4d24ca,null))[_0x499d('0xc')](handleError(_0x4d24ca,null));};exports['voiceChannelMixMonitor']=function(_0x2ed197,_0x89ff46){return respondWithRpcPromise(_0x499d('0x16'),_['merge'](_0x2ed197[_0x499d('0x15')],_0x2ed197[_0x499d('0x17')]))['then'](respondWithResult(_0x89ff46,null))[_0x499d('0xc')](handleError(_0x89ff46,null));};exports[_0x499d('0x18')]=function(_0x4770f9,_0x4aed36){return respondWithRpcPromise(_0x499d('0x19'),_['merge'](_0x4770f9[_0x499d('0x15')],_0x4770f9['params']))['then'](respondWithResult(_0x4aed36,null))['catch'](handleError(_0x4aed36,null));};exports[_0x499d('0x1a')]=function(_0x2c4d21,_0x31401e){return respondWithRpcPromise(_0x499d('0x1b'),_0x2c4d21[_0x499d('0x15')])[_0x499d('0x8')](respondWithResult(_0x31401e,null))['catch'](handleError(_0x31401e,null));};exports[_0x499d('0x1c')]=function(_0x24cc39,_0x405ec2){return respondWithRpcPromise(_0x499d('0x1b'),_0x24cc39['query'])['then'](findById(_0x24cc39[_0x499d('0x17')]['id']))['then'](respondWithResult(_0x405ec2,null))['catch'](handleError(_0x405ec2,null));};exports['voiceQueuesPreview']=function(_0xbc7f72,_0x2a0da6){return respondWithRpcPromise(_0x499d('0x1d'),_[_0x499d('0x1e')](_0xbc7f72['query'],_0xbc7f72['params']))['then'](respondWithResult(_0x2a0da6,null))[_0x499d('0xc')](handleError(_0x2a0da6,null));};exports[_0x499d('0x1f')]=function(_0x1b3a28,_0x55f4df){return respondWithRpcPromise(_0x499d('0x20'),_0x1b3a28[_0x499d('0x15')])[_0x499d('0x8')](respondWithResult(_0x55f4df,null))[_0x499d('0xc')](handleError(_0x55f4df,null));};exports[_0x499d('0x21')]=function(_0xa1a65b,_0x42ee7d){return respondWithRpcPromise(_0x499d('0x22'),_[_0x499d('0x1e')](_0xa1a65b[_0x499d('0x15')],_0xa1a65b['params']))[_0x499d('0x8')](respondWithResult(_0x42ee7d,null))['catch'](handleError(_0x42ee7d,null));};exports[_0x499d('0x23')]=function(_0x16d229,_0x5b1b3d){return respondWithRpcPromise(_0x499d('0x24'),_['merge'](_0x16d229['query'],_0x16d229[_0x499d('0x17')]))[_0x499d('0x8')](respondWithResult(_0x5b1b3d,null))[_0x499d('0xc')](handleError(_0x5b1b3d,null));};exports[_0x499d('0x25')]=function(_0x591dc1,_0x2e946b){return respondWithRpcPromise(_0x499d('0x26'),_[_0x499d('0x1e')](_0x591dc1[_0x499d('0x15')],_0x591dc1[_0x499d('0x17')]))[_0x499d('0x8')](respondWithResult(_0x2e946b,null))[_0x499d('0xc')](handleError(_0x2e946b,null));};exports[_0x499d('0x27')]=function(_0x2ebb4e,_0x2fee13){return respondWithRpcPromise(_0x499d('0x28'),_0x2ebb4e[_0x499d('0x15')])[_0x499d('0x8')](respondWithResult(_0x2fee13,null))[_0x499d('0xc')](handleError(_0x2fee13,null));};exports[_0x499d('0x29')]=function(_0x3cdb05,_0x28a603){return respondWithRpcPromise(_0x499d('0x2a'),_0x3cdb05[_0x499d('0x15')])[_0x499d('0x8')](respondWithResult(_0x28a603,null))[_0x499d('0xc')](handleError(_0x28a603,null));};exports[_0x499d('0x2b')]=function(_0xd4a414,_0x197b9e){var _0x5c39ed;return respondWithRpcPromise(_0x499d('0x2c'),_0xd4a414['query'])[_0x499d('0x8')](function(_0xf1506a){_0x5c39ed=_0xf1506a;return respondWithRpcPromise(_0x499d('0x2c'),_0xd4a414[_0x499d('0x15')],routingClient);})[_0x499d('0x8')](function(_0x24e28b){return _[_0x499d('0x1e')]({},_0x24e28b,_0x5c39ed);})[_0x499d('0x8')](respondWithResult(_0x197b9e,null))[_0x499d('0xc')](handleError(_0x197b9e,null));};exports[_0x499d('0x2d')]=function(_0x21a812,_0x54e477){if(_0x21a812[_0x499d('0x2e')]&&_0x21a812[_0x499d('0x2e')][_0x499d('0x2f')]&&_0x21a812[_0x499d('0x30')]&&_0x21a812['user'][_0x499d('0x31')]){for(var _0x41b105 in _0x21a812[_0x499d('0x2e')][_0x499d('0x2f')]){if(_0x21a812['body']['interaction'][_0x499d('0x32')](_0x41b105)){db[_0x499d('0x33')]['findAll']({'where':{'channel':_0x41b105,'membername':_0x21a812[_0x499d('0x30')][_0x499d('0x31')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x21a812[_0x499d('0x2e')][_0x499d('0x2f')][_0x41b105]&&_0x21a812[_0x499d('0x2e')][_0x499d('0x2f')][_0x41b105]['length']?{'$notIn':_0x21a812[_0x499d('0x2e')][_0x499d('0x2f')][_0x41b105]}:{'$ne':null}}})['then'](function(_0x1d7e45){var _0x9f6997=moment()[_0x499d('0x34')](_0x499d('0x35'));for(var _0x40afa5=0x0,_0x1d27c0=_0x1d7e45['length'];_0x40afa5<_0x1d27c0;_0x40afa5+=0x1){_0x1d7e45[_0x40afa5][_0x499d('0x36')]({'exitAt':_0x9f6997});}});for(var _0x245288=0x0;_0x245288<_0x21a812[_0x499d('0x2e')]['interaction'][_0x41b105][_0x499d('0x37')];_0x245288+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x41b105,'membername':_0x21a812[_0x499d('0x30')][_0x499d('0x31')],'type':_0x499d('0x38'),'uniqueid':_0x21a812[_0x499d('0x2e')]['interaction'][_0x41b105][_0x245288],'exitAt':null},'defaults':{'channel':_0x41b105,'membername':_0x21a812['user']['name'],'interface':_[_0x499d('0x10')](_0x21a812['user'][_0x499d('0x39')])?util[_0x499d('0x34')](_0x499d('0x3a'),_0x21a812[_0x499d('0x30')][_0x499d('0x31')]):_0x21a812[_0x499d('0x30')][_0x499d('0x39')],'type':_0x499d('0x38'),'enterAt':moment()['format'](_0x499d('0x35')),'role':'agent','internal':_0x21a812[_0x499d('0x30')][_0x499d('0x3b')],'uniqueid':_0x21a812[_0x499d('0x2e')][_0x499d('0x2f')][_0x41b105][_0x245288]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x21a812[_0x499d('0x17')]['id'],'capacity':_0x21a812['body'][_0x499d('0x3c')]},routingClient)[_0x499d('0x8')](respondWithResult(_0x54e477,null))[_0x499d('0xc')](handleError(_0x54e477,null));};exports[_0x499d('0x3d')]=function(_0x2cc0e6,_0x45b750){return respondWithRpcPromise(_0x499d('0x3e'),_0x2cc0e6[_0x499d('0x15')])[_0x499d('0x8')](respondWithResult(_0x45b750,null))[_0x499d('0xc')](handleError(_0x45b750,null));};exports['trunks']=function(_0x59c5d8,_0x3ad851){return respondWithRpcPromise(_0x499d('0x3f'),_0x59c5d8[_0x499d('0x15')])[_0x499d('0x8')](respondWithResult(_0x3ad851,null))['catch'](handleError(_0x3ad851,null));};exports['campaigns']=function(_0x2b951f,_0x4a3925){return respondWithRpcPromise('Campaigns',_0x2b951f[_0x499d('0x15')])['then'](respondWithResult(_0x4a3925,null))[_0x499d('0xc')](handleError(_0x4a3925,null));};exports['chatQueues']=function(_0x299783,_0x16a545){return respondWithRpcPromise(_0x499d('0x40'),_0x299783[_0x499d('0x15')],routingClient)[_0x499d('0x8')](respondWithResult(_0x16a545,null))['catch'](handleError(_0x16a545,null));};exports[_0x499d('0x41')]=function(_0x25d98c,_0x318e96){return respondWithRpcPromise(_0x499d('0x40'),_0x25d98c[_0x499d('0x15')],routingClient)[_0x499d('0x8')](findById(_0x25d98c[_0x499d('0x17')]['id']))[_0x499d('0x8')](respondWithResult(_0x318e96,null))['catch'](handleError(_0x318e96,null));};exports['mailQueues']=function(_0xce40a,_0x3ff398){return respondWithRpcPromise(_0x499d('0x42'),_0xce40a['query'],routingClient)[_0x499d('0x8')](respondWithResult(_0x3ff398,null))[_0x499d('0xc')](handleError(_0x3ff398,null));};exports[_0x499d('0x43')]=function(_0x1bda9c,_0xb67e77){return respondWithRpcPromise(_0x499d('0x42'),_0x1bda9c[_0x499d('0x15')],routingClient)[_0x499d('0x8')](findById(_0x1bda9c[_0x499d('0x17')]['id']))[_0x499d('0x8')](respondWithResult(_0xb67e77,null))[_0x499d('0xc')](handleError(_0xb67e77,null));};exports[_0x499d('0x44')]=function(_0x460289,_0x276e18){return respondWithRpcPromise(_0x499d('0x45'),_0x460289[_0x499d('0x15')],mailClient)['then'](respondWithResult(_0x276e18,null))[_0x499d('0xc')](handleError(_0x276e18,null));};exports[_0x499d('0x46')]=function(_0x632364,_0x198e28){return respondWithRpcPromise(_0x499d('0x47'),_0x632364[_0x499d('0x15')],routingClient)[_0x499d('0x8')](respondWithResult(_0x198e28,null))['catch'](handleError(_0x198e28,null));};exports[_0x499d('0x48')]=function(_0x34aa7a,_0xc1b1f9){return respondWithRpcPromise(_0x499d('0x47'),_0x34aa7a['query'],routingClient)[_0x499d('0x8')](findById(_0x34aa7a['params']['id']))['then'](respondWithResult(_0xc1b1f9,null))[_0x499d('0xc')](handleError(_0xc1b1f9,null));};exports[_0x499d('0x49')]=function(_0x4ca8e9,_0x521fcb){return respondWithRpcPromise('SmsQueues',_0x4ca8e9['query'],routingClient)[_0x499d('0x8')](respondWithResult(_0x521fcb,null))[_0x499d('0xc')](handleError(_0x521fcb,null));};exports[_0x499d('0x4a')]=function(_0x48babd,_0x3331e4){return respondWithRpcPromise(_0x499d('0x4b'),_0x48babd['query'],routingClient)[_0x499d('0x8')](findById(_0x48babd[_0x499d('0x17')]['id']))[_0x499d('0x8')](respondWithResult(_0x3331e4,null))[_0x499d('0xc')](handleError(_0x3331e4,null));};exports[_0x499d('0x4c')]=function(_0x1e2b7c,_0x432115){return respondWithRpcPromise(_0x499d('0x4d'),_0x1e2b7c[_0x499d('0x15')],routingClient)['then'](respondWithResult(_0x432115,null))[_0x499d('0xc')](handleError(_0x432115,null));};exports['showFaxQueues']=function(_0xbf854e,_0x28f687){return respondWithRpcPromise(_0x499d('0x4d'),_0xbf854e[_0x499d('0x15')],routingClient)[_0x499d('0x8')](findById(_0xbf854e['params']['id']))['then'](respondWithResult(_0x28f687,null))[_0x499d('0xc')](handleError(_0x28f687,null));};exports[_0x499d('0x4e')]=function(_0x2467c1,_0x35f6ce){return respondWithRpcPromise('FaxAccounts',_0x2467c1['query'])[_0x499d('0x8')](respondWithResult(_0x35f6ce,null))[_0x499d('0xc')](handleError(_0x35f6ce,null));};exports['chatQueuesWaitingInteractions']=function(_0x204f57,_0x25941e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x204f57['query'],routingClient)['then'](respondWithResult(_0x25941e,null))[_0x499d('0xc')](handleError(_0x25941e,null));};exports[_0x499d('0x4f')]=function(_0xfb6748,_0x124181){return respondWithRpcPromise(_0x499d('0x50'),_0xfb6748[_0x499d('0x15')],routingClient)[_0x499d('0x8')](respondWithResult(_0x124181,null))['catch'](handleError(_0x124181,null));};exports[_0x499d('0x51')]=function(_0x5dcd59,_0x1e959a){return respondWithRpcPromise(_0x499d('0x52'),_0x5dcd59[_0x499d('0x15')],routingClient)['then'](respondWithResult(_0x1e959a,null))[_0x499d('0xc')](handleError(_0x1e959a,null));};exports[_0x499d('0x53')]=function(_0x261a85,_0x5837b9){return respondWithRpcPromise(_0x499d('0x54'),_0x261a85[_0x499d('0x15')],routingClient)['then'](respondWithResult(_0x5837b9,null))[_0x499d('0xc')](handleError(_0x5837b9,null));};exports[_0x499d('0x55')]=function(_0x48bc57,_0x4dbb83){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x48bc57[_0x499d('0x15')],routingClient)[_0x499d('0x8')](respondWithResult(_0x4dbb83,null))['catch'](handleError(_0x4dbb83,null));};exports[_0x499d('0x56')]=function(_0x16d8a2){return function(_0x19c961,_0x5107ca){var _0x503cc6,_0x3ff773;var _0x20968f=_['capitalize'](_0x16d8a2);var _0x2279e1=_0x16d8a2==='chat'?_0x499d('0x57'):_0x499d('0x58');return db[_0x20968f+_0x499d('0x59')]['findOne']({'raw':!![],'where':{'id':_0x19c961[_0x499d('0x17')]['id']}})[_0x499d('0x8')](function(_0x124b31){if(_[_0x499d('0x10')](_0x124b31)){throw new Error(_0x20968f+_0x499d('0x5a'));}_0x503cc6=_0x124b31;return db[_0x20968f+'Message']['findOne']({'where':{'id':_0x19c961['body'][_0x499d('0x5b')]},'include':[{'model':db[_0x20968f+'Interaction'],'as':_0x499d('0x5c')},{'model':db[_0x20968f+_0x2279e1],'as':_0x499d('0x58')}]});})['then'](function(_0x53976b){if(_[_0x499d('0x10')](_0x53976b)){throw new Error(_0x20968f+_0x499d('0x5d'));}_0x3ff773=_0x53976b;return _0x53976b[_0x499d('0x5e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2677f3={'uniqueid':_0x16d8a2+'.'+_0x3ff773['id']+'.'+_0x3ff773['Interaction']['id'],'FromUserId':_0x19c961[_0x499d('0x30')]['id'],'type':_0x499d('0x5f')};_0x2677f3[_0x20968f+_0x499d('0x60')]=_0x3ff773['id'];_0x2677f3[_0x20968f+_0x499d('0x61')]=_0x3ff773[_0x499d('0x5c')]['id'];_0x2677f3[_0x499d('0x62')+_0x20968f+_0x2279e1+'Id']=_0x3ff773['Account']['id'];_0x2677f3['To'+_0x20968f+_0x499d('0x63')]=_0x503cc6['id'];return db[_0x20968f+_0x499d('0x64')][_0x499d('0x65')](_0x2677f3);})[_0x499d('0x8')](function(){return respondWithRpcPromise(_0x499d('0x66'),{'channel':_0x16d8a2,'interaction':_0x3ff773[_0x499d('0x5c')],'message':_0x3ff773,'account':_0x3ff773[_0x499d('0x58')],'applications':[{'id':0x0,'priority':0x1,'app':_0x499d('0x5f'),'appdata':_0x503cc6[_0x499d('0x31')]+','+(_0x3ff773[_0x499d('0x58')]['queueTransferTimeout']||0x12c),'interval':_0x499d('0x67')}]},routingClient);})['then'](respondWithResult(_0x5107ca,null))['catch'](handleError(_0x5107ca,null));};};exports[_0x499d('0x68')]=function(_0x1a8785,_0x231e11){var _0x18b9b6,_0x3556ab;if(_[_0x499d('0x10')](_0x1a8785[_0x499d('0x2e')][_0x499d('0x69')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x4c1e76=_0x1a8785['body']['channel'];var _0x444cef=_[_0x499d('0x6a')](_0x4c1e76);var _0x288943=_0x4c1e76===_0x499d('0x6b')?'Website':_0x499d('0x58');return db[_0x499d('0x6c')][_0x499d('0x6d')]({'raw':!![],'where':{'id':_0x1a8785[_0x499d('0x17')]['id'],'role':_0x499d('0x6e')}})[_0x499d('0x8')](function(_0x1575cc){if(_[_0x499d('0x10')](_0x1575cc)){throw new Error(_0x499d('0x6f'));}_0x18b9b6=_0x1575cc;return db[_0x444cef+'Message'][_0x499d('0x6d')]({'where':{'id':_0x1a8785[_0x499d('0x2e')][_0x499d('0x5b')]},'include':[{'model':db[_0x444cef+'Interaction'],'as':_0x499d('0x5c')},{'model':db[_0x444cef+_0x288943],'as':'Account'}]});})['then'](function(_0x4a1807){if(_[_0x499d('0x10')](_0x4a1807)){throw new Error(_0x444cef+_0x499d('0x5d'));}_0x3556ab=_0x4a1807;return _0x4a1807[_0x499d('0x5e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3f9b4c={'uniqueid':_0x4c1e76+'.'+_0x3556ab['id']+'.'+_0x3556ab['Interaction']['id'],'FromUserId':_0x1a8785[_0x499d('0x30')]['id'],'type':_0x499d('0x5f'),'ToUserId':_0x18b9b6['id']};_0x3f9b4c[_0x444cef+'MessageId']=_0x3556ab['id'];_0x3f9b4c[_0x444cef+_0x499d('0x61')]=_0x3556ab[_0x499d('0x5c')]['id'];_0x3f9b4c[_0x499d('0x62')+_0x444cef+_0x288943+'Id']=_0x3556ab[_0x499d('0x58')]['id'];return db[_0x444cef+'TransferReport'][_0x499d('0x65')](_0x3f9b4c);})['then'](function(){return respondWithRpcPromise(_0x499d('0x66'),{'channel':_0x4c1e76,'interaction':_0x3556ab[_0x499d('0x5c')],'message':_0x3556ab,'account':_0x3556ab[_0x499d('0x58')],'applications':[{'id':0x0,'priority':0x1,'app':_0x499d('0x6e'),'appdata':_0x18b9b6[_0x499d('0x31')]+','+(_0x3556ab['Account'][_0x499d('0x70')]||0x12c),'interval':_0x499d('0x67')}]},routingClient);})[_0x499d('0x8')](respondWithResult(_0x231e11,null))[_0x499d('0xc')](handleError(_0x231e11,null));}; \ No newline at end of file +var _0x555e=['agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','update','MessageId','Start','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','error','message','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','VoiceChannels','query','then','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','findAll','INTERACTION','length','format','updateAttributes','MemberReport','findOrCreate','SIP/%s','interface','agent','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','Campaigns','ChatQueues','MailQueues','mailAccounts','MailAccounts','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','InteractionId','From','QueueId','TransferReport','queue','*,*,*,*'];(function(_0x14d456,_0x5c81fa){var _0x236893=function(_0x10f5ee){while(--_0x10f5ee){_0x14d456['push'](_0x14d456['shift']());}};_0x236893(++_0x5c81fa);}(_0x555e,0x161));var _0xe555=function(_0x356f71,_0x759c4c){_0x356f71=_0x356f71-0x0;var _0x1ccf9f=_0x555e[_0x356f71];return _0x1ccf9f;};'use strict';var BPromise=require(_0xe555('0x0'));var moment=require(_0xe555('0x1'));var _=require(_0xe555('0x2'));var util=require(_0xe555('0x3'));var db=require(_0xe555('0x4'))['db'];var logger=require(_0xe555('0x5'))(_0xe555('0x6'));var jayson=require(_0xe555('0x7'));var amiClient=jayson['client'][_0xe555('0x8')]({'port':0x232a});var mailClient=jayson[_0xe555('0x9')][_0xe555('0x8')]({'port':0x232b});var routingClient=jayson[_0xe555('0x9')][_0xe555('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x389736,_0x3ad382,_0x31296f){return new BPromise(function(_0x24ed90,_0x4c78ea){var _0x5d5ceb=_0x31296f?_0x31296f:amiClient;return _0x5d5ceb[_0xe555('0xa')](_0x389736,_0x3ad382)['then'](function(_0x283ba3){if(_0x283ba3[_0xe555('0xb')]){if(_0x283ba3[_0xe555('0xb')]['code']===0x1f4){return _0x4c78ea(_0x283ba3[_0xe555('0xb')][_0xe555('0xc')]);}return _0x24ed90(_0x283ba3[_0xe555('0xb')][_0xe555('0xc')]);}else{_0x24ed90(_0x283ba3['result']);}})[_0xe555('0xd')](function(_0x471758){_0x4c78ea(_0x471758);});});}function respondWithResult(_0x237c23,_0x417900){_0x417900=_0x417900||0xc8;return function(_0xea2d69){if(_0xea2d69){return _0x237c23[_0xe555('0xe')](_0x417900)[_0xe555('0xf')](_0xea2d69);}return _0x237c23[_0xe555('0x10')](0x194);};}function handleError(_0x260021,_0x7abfb6){_0x7abfb6=_0x7abfb6||0x1f4;return function(_0x670aa6){logger[_0xe555('0xb')](_0x670aa6[_0xe555('0x11')]);if(_0x670aa6[_0xe555('0x12')]){delete _0x670aa6[_0xe555('0x12')];}_0x260021[_0xe555('0xe')](_0x7abfb6)[_0xe555('0x13')](_0x670aa6);};}function findById(_0x5cc25e){return function(_0x577ce2){if(!_[_0xe555('0x14')](_0x5cc25e)&&!_['isNil'](_0x577ce2)&&!_['isNil'](_0x577ce2[_0xe555('0x15')])){return _[_0xe555('0x16')](_0x577ce2[_0xe555('0x15')],function(_0x14050a){return _0x14050a['id']==_0x5cc25e;});}return null;};}exports['voiceChannels']=function(_0x573106,_0x83d8f3){return respondWithRpcPromise(_0xe555('0x17'),_0x573106[_0xe555('0x18')])[_0xe555('0x19')](respondWithResult(_0x83d8f3,null))[_0xe555('0xd')](handleError(_0x83d8f3,null));};exports['voiceChannelMixMonitor']=function(_0x4fd05d,_0x25fc0c){return respondWithRpcPromise(_0xe555('0x1a'),_[_0xe555('0x1b')](_0x4fd05d['query'],_0x4fd05d[_0xe555('0x1c')]))[_0xe555('0x19')](respondWithResult(_0x25fc0c,null))[_0xe555('0xd')](handleError(_0x25fc0c,null));};exports[_0xe555('0x1d')]=function(_0x25371a,_0x4098ba){return respondWithRpcPromise(_0xe555('0x1e'),_['merge'](_0x25371a[_0xe555('0x18')],_0x25371a[_0xe555('0x1c')]))[_0xe555('0x19')](respondWithResult(_0x4098ba,null))[_0xe555('0xd')](handleError(_0x4098ba,null));};exports[_0xe555('0x1f')]=function(_0x449f49,_0xe81a6e){return respondWithRpcPromise('VoiceQueues',_0x449f49[_0xe555('0x18')])[_0xe555('0x19')](respondWithResult(_0xe81a6e,null))[_0xe555('0xd')](handleError(_0xe81a6e,null));};exports['showVoiceQueues']=function(_0x476f0f,_0x24120c){return respondWithRpcPromise(_0xe555('0x20'),_0x476f0f[_0xe555('0x18')])[_0xe555('0x19')](findById(_0x476f0f['params']['id']))[_0xe555('0x19')](respondWithResult(_0x24120c,null))[_0xe555('0xd')](handleError(_0x24120c,null));};exports[_0xe555('0x21')]=function(_0x3dfc8f,_0x3e3f62){return respondWithRpcPromise(_0xe555('0x22'),_[_0xe555('0x1b')](_0x3dfc8f[_0xe555('0x18')],_0x3dfc8f['params']))[_0xe555('0x19')](respondWithResult(_0x3e3f62,null))['catch'](handleError(_0x3e3f62,null));};exports[_0xe555('0x23')]=function(_0x57470f,_0x68d15d){return respondWithRpcPromise(_0xe555('0x24'),_0x57470f['query'])[_0xe555('0x19')](respondWithResult(_0x68d15d,null))[_0xe555('0xd')](handleError(_0x68d15d,null));};exports[_0xe555('0x25')]=function(_0x561c8c,_0x4c282f){return respondWithRpcPromise(_0xe555('0x26'),_[_0xe555('0x1b')](_0x561c8c[_0xe555('0x18')],_0x561c8c['params']))[_0xe555('0x19')](respondWithResult(_0x4c282f,null))['catch'](handleError(_0x4c282f,null));};exports[_0xe555('0x27')]=function(_0x7bde65,_0x98f318){return respondWithRpcPromise(_0xe555('0x28'),_[_0xe555('0x1b')](_0x7bde65[_0xe555('0x18')],_0x7bde65[_0xe555('0x1c')]))['then'](respondWithResult(_0x98f318,null))[_0xe555('0xd')](handleError(_0x98f318,null));};exports[_0xe555('0x29')]=function(_0x29d8b9,_0x561fb5){return respondWithRpcPromise(_0xe555('0x2a'),_[_0xe555('0x1b')](_0x29d8b9[_0xe555('0x18')],_0x29d8b9[_0xe555('0x1c')]))[_0xe555('0x19')](respondWithResult(_0x561fb5,null))[_0xe555('0xd')](handleError(_0x561fb5,null));};exports['outbound']=function(_0x1bbaff,_0x49c031){return respondWithRpcPromise('Outbound',_0x1bbaff[_0xe555('0x18')])[_0xe555('0x19')](respondWithResult(_0x49c031,null))[_0xe555('0xd')](handleError(_0x49c031,null));};exports['outboundChannels']=function(_0x24b120,_0x3b2920){return respondWithRpcPromise(_0xe555('0x2b'),_0x24b120[_0xe555('0x18')])[_0xe555('0x19')](respondWithResult(_0x3b2920,null))[_0xe555('0xd')](handleError(_0x3b2920,null));};exports[_0xe555('0x2c')]=function(_0x2a300e,_0x240979){var _0x8b17da;return respondWithRpcPromise(_0xe555('0x2d'),_0x2a300e['query'])['then'](function(_0x55bfa6){_0x8b17da=_0x55bfa6;return respondWithRpcPromise('Agents',_0x2a300e[_0xe555('0x18')],routingClient);})['then'](function(_0x4b9aec){return _['merge']({},_0x4b9aec,_0x8b17da);})[_0xe555('0x19')](respondWithResult(_0x240979,null))[_0xe555('0xd')](handleError(_0x240979,null));};exports[_0xe555('0x2e')]=function(_0x5670e9,_0x1e686d){if(_0x5670e9[_0xe555('0x2f')]&&_0x5670e9[_0xe555('0x2f')]['interaction']&&_0x5670e9['user']&&_0x5670e9[_0xe555('0x30')][_0xe555('0x12')]){for(var _0x4b3381 in _0x5670e9[_0xe555('0x2f')]['interaction']){if(_0x5670e9[_0xe555('0x2f')][_0xe555('0x31')]['hasOwnProperty'](_0x4b3381)){db['MemberReport'][_0xe555('0x32')]({'where':{'channel':_0x4b3381,'membername':_0x5670e9['user'][_0xe555('0x12')],'type':_0xe555('0x33'),'exitAt':null,'uniqueid':_0x5670e9[_0xe555('0x2f')][_0xe555('0x31')][_0x4b3381]&&_0x5670e9['body'][_0xe555('0x31')][_0x4b3381][_0xe555('0x34')]?{'$notIn':_0x5670e9[_0xe555('0x2f')][_0xe555('0x31')][_0x4b3381]}:{'$ne':null}}})['then'](function(_0x16bfef){var _0x1e3219=moment()[_0xe555('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x23afc5=0x0,_0x7d2b78=_0x16bfef[_0xe555('0x34')];_0x23afc5<_0x7d2b78;_0x23afc5+=0x1){_0x16bfef[_0x23afc5][_0xe555('0x36')]({'exitAt':_0x1e3219});}});for(var _0xfa6878=0x0;_0xfa6878<_0x5670e9['body'][_0xe555('0x31')][_0x4b3381]['length'];_0xfa6878+=0x1){db[_0xe555('0x37')][_0xe555('0x38')]({'where':{'channel':_0x4b3381,'membername':_0x5670e9[_0xe555('0x30')]['name'],'type':_0xe555('0x33'),'uniqueid':_0x5670e9['body'][_0xe555('0x31')][_0x4b3381][_0xfa6878],'exitAt':null},'defaults':{'channel':_0x4b3381,'membername':_0x5670e9[_0xe555('0x30')][_0xe555('0x12')],'interface':_[_0xe555('0x14')](_0x5670e9[_0xe555('0x30')]['interface'])?util['format'](_0xe555('0x39'),_0x5670e9[_0xe555('0x30')][_0xe555('0x12')]):_0x5670e9[_0xe555('0x30')][_0xe555('0x3a')],'type':_0xe555('0x33'),'enterAt':moment()[_0xe555('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xe555('0x3b'),'internal':_0x5670e9['user'][_0xe555('0x3c')],'uniqueid':_0x5670e9[_0xe555('0x2f')][_0xe555('0x31')][_0x4b3381][_0xfa6878]}});}}}}return respondWithRpcPromise(_0xe555('0x3d'),{'id':_0x5670e9[_0xe555('0x1c')]['id'],'capacity':_0x5670e9['body'][_0xe555('0x3e')]},routingClient)[_0xe555('0x19')](respondWithResult(_0x1e686d,null))['catch'](handleError(_0x1e686d,null));};exports['telephones']=function(_0x34f5bc,_0x54006f){return respondWithRpcPromise(_0xe555('0x3f'),_0x34f5bc['query'])[_0xe555('0x19')](respondWithResult(_0x54006f,null))['catch'](handleError(_0x54006f,null));};exports[_0xe555('0x40')]=function(_0x157e46,_0x372243){return respondWithRpcPromise(_0xe555('0x41'),_0x157e46[_0xe555('0x18')])['then'](respondWithResult(_0x372243,null))[_0xe555('0xd')](handleError(_0x372243,null));};exports['campaigns']=function(_0x274bf7,_0x448ff2){return respondWithRpcPromise(_0xe555('0x42'),_0x274bf7[_0xe555('0x18')])[_0xe555('0x19')](respondWithResult(_0x448ff2,null))[_0xe555('0xd')](handleError(_0x448ff2,null));};exports['chatQueues']=function(_0x1b5325,_0x59e7c0){return respondWithRpcPromise(_0xe555('0x43'),_0x1b5325['query'],routingClient)['then'](respondWithResult(_0x59e7c0,null))['catch'](handleError(_0x59e7c0,null));};exports['showChatQueues']=function(_0x1dff30,_0x3efe8e){return respondWithRpcPromise(_0xe555('0x43'),_0x1dff30[_0xe555('0x18')],routingClient)[_0xe555('0x19')](findById(_0x1dff30[_0xe555('0x1c')]['id']))['then'](respondWithResult(_0x3efe8e,null))[_0xe555('0xd')](handleError(_0x3efe8e,null));};exports['mailQueues']=function(_0x86accd,_0xa2bf51){return respondWithRpcPromise(_0xe555('0x44'),_0x86accd[_0xe555('0x18')],routingClient)[_0xe555('0x19')](respondWithResult(_0xa2bf51,null))[_0xe555('0xd')](handleError(_0xa2bf51,null));};exports['showMailQueues']=function(_0x33c487,_0x47c9ba){return respondWithRpcPromise('MailQueues',_0x33c487[_0xe555('0x18')],routingClient)[_0xe555('0x19')](findById(_0x33c487[_0xe555('0x1c')]['id']))['then'](respondWithResult(_0x47c9ba,null))['catch'](handleError(_0x47c9ba,null));};exports[_0xe555('0x45')]=function(_0x5b9ec5,_0x382145){return respondWithRpcPromise(_0xe555('0x46'),_0x5b9ec5[_0xe555('0x18')],mailClient)[_0xe555('0x19')](respondWithResult(_0x382145,null))[_0xe555('0xd')](handleError(_0x382145,null));};exports['openchannelQueues']=function(_0x37cff0,_0x32845d){return respondWithRpcPromise('OpenchannelQueues',_0x37cff0[_0xe555('0x18')],routingClient)['then'](respondWithResult(_0x32845d,null))[_0xe555('0xd')](handleError(_0x32845d,null));};exports[_0xe555('0x47')]=function(_0x57b2e4,_0x2a6f4e){return respondWithRpcPromise(_0xe555('0x48'),_0x57b2e4[_0xe555('0x18')],routingClient)[_0xe555('0x19')](findById(_0x57b2e4[_0xe555('0x1c')]['id']))[_0xe555('0x19')](respondWithResult(_0x2a6f4e,null))[_0xe555('0xd')](handleError(_0x2a6f4e,null));};exports[_0xe555('0x49')]=function(_0x3929b3,_0x3c824f){return respondWithRpcPromise(_0xe555('0x4a'),_0x3929b3['query'],routingClient)[_0xe555('0x19')](respondWithResult(_0x3c824f,null))[_0xe555('0xd')](handleError(_0x3c824f,null));};exports[_0xe555('0x4b')]=function(_0x920344,_0x55e771){return respondWithRpcPromise(_0xe555('0x4a'),_0x920344['query'],routingClient)['then'](findById(_0x920344[_0xe555('0x1c')]['id']))[_0xe555('0x19')](respondWithResult(_0x55e771,null))['catch'](handleError(_0x55e771,null));};exports[_0xe555('0x4c')]=function(_0x17b312,_0x40691e){return respondWithRpcPromise('FaxQueues',_0x17b312[_0xe555('0x18')],routingClient)[_0xe555('0x19')](respondWithResult(_0x40691e,null))['catch'](handleError(_0x40691e,null));};exports['showFaxQueues']=function(_0x5dacd4,_0xcc7606){return respondWithRpcPromise(_0xe555('0x4d'),_0x5dacd4[_0xe555('0x18')],routingClient)[_0xe555('0x19')](findById(_0x5dacd4['params']['id']))[_0xe555('0x19')](respondWithResult(_0xcc7606,null))[_0xe555('0xd')](handleError(_0xcc7606,null));};exports[_0xe555('0x4e')]=function(_0x132685,_0x93ea1c){return respondWithRpcPromise('FaxAccounts',_0x132685['query'])[_0xe555('0x19')](respondWithResult(_0x93ea1c,null))[_0xe555('0xd')](handleError(_0x93ea1c,null));};exports[_0xe555('0x4f')]=function(_0x412206,_0x43b0f9){return respondWithRpcPromise(_0xe555('0x50'),_0x412206['query'],routingClient)[_0xe555('0x19')](respondWithResult(_0x43b0f9,null))[_0xe555('0xd')](handleError(_0x43b0f9,null));};exports[_0xe555('0x51')]=function(_0x28aad0,_0x24c0b8){return respondWithRpcPromise(_0xe555('0x52'),_0x28aad0[_0xe555('0x18')],routingClient)[_0xe555('0x19')](respondWithResult(_0x24c0b8,null))[_0xe555('0xd')](handleError(_0x24c0b8,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x1d1a61,_0x3db946){return respondWithRpcPromise(_0xe555('0x53'),_0x1d1a61[_0xe555('0x18')],routingClient)['then'](respondWithResult(_0x3db946,null))[_0xe555('0xd')](handleError(_0x3db946,null));};exports[_0xe555('0x54')]=function(_0x1b1e04,_0x346518){return respondWithRpcPromise(_0xe555('0x55'),_0x1b1e04[_0xe555('0x18')],routingClient)['then'](respondWithResult(_0x346518,null))[_0xe555('0xd')](handleError(_0x346518,null));};exports[_0xe555('0x56')]=function(_0x1d0eb1,_0x2a873d){return respondWithRpcPromise(_0xe555('0x57'),_0x1d0eb1['query'],routingClient)[_0xe555('0x19')](respondWithResult(_0x2a873d,null))[_0xe555('0xd')](handleError(_0x2a873d,null));};exports[_0xe555('0x58')]=function(_0x5a9765){return function(_0x2cc273,_0x4549bd){var _0x6663c3,_0x254fc3;var _0x50e63a=_[_0xe555('0x59')](_0x5a9765);var _0x5ecccb=_0x5a9765===_0xe555('0x5a')?'Website':_0xe555('0x5b');return db[_0x50e63a+_0xe555('0x5c')][_0xe555('0x5d')]({'raw':!![],'where':{'id':_0x2cc273['params']['id']}})[_0xe555('0x19')](function(_0x159321){if(_[_0xe555('0x14')](_0x159321)){throw new Error(_0x50e63a+_0xe555('0x5e'));}_0x6663c3=_0x159321;return db[_0x50e63a+_0xe555('0x5f')][_0xe555('0x5d')]({'where':{'id':_0x2cc273[_0xe555('0x2f')]['messageId']},'include':[{'model':db[_0x50e63a+_0xe555('0x60')],'as':'Interaction'},{'model':db[_0x50e63a+_0x5ecccb],'as':'Account'}]});})['then'](function(_0xd2af0c){if(_[_0xe555('0x14')](_0xd2af0c)){throw new Error(_0x50e63a+'\x20Message\x20not\x20found');}_0x254fc3=_0xd2af0c;return _0xd2af0c['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2cb760={'uniqueid':_0x5a9765+'.'+_0x254fc3['id']+'.'+_0x254fc3[_0xe555('0x60')]['id'],'FromUserId':_0x2cc273[_0xe555('0x30')]['id'],'type':'queue'};_0x2cb760[_0x50e63a+'MessageId']=_0x254fc3['id'];_0x2cb760[_0x50e63a+_0xe555('0x61')]=_0x254fc3[_0xe555('0x60')]['id'];_0x2cb760[_0xe555('0x62')+_0x50e63a+_0x5ecccb+'Id']=_0x254fc3[_0xe555('0x5b')]['id'];_0x2cb760['To'+_0x50e63a+_0xe555('0x63')]=_0x6663c3['id'];return db[_0x50e63a+_0xe555('0x64')]['create'](_0x2cb760);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x5a9765,'interaction':_0x254fc3['Interaction'],'message':_0x254fc3,'account':_0x254fc3[_0xe555('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe555('0x65'),'appdata':_0x6663c3[_0xe555('0x12')]+','+(_0x254fc3[_0xe555('0x5b')]['queueTransferTimeout']||0x12c),'interval':_0xe555('0x66')}]},routingClient);})['then'](respondWithResult(_0x4549bd,null))['catch'](handleError(_0x4549bd,null));};};exports[_0xe555('0x67')]=function(_0x1f5bf3,_0x29d5e2){var _0x39a4f3,_0x5472b9;if(_[_0xe555('0x14')](_0x1f5bf3[_0xe555('0x2f')][_0xe555('0x68')])){throw new Error(_0xe555('0x69'));}var _0x55fb54=_0x1f5bf3[_0xe555('0x2f')][_0xe555('0x68')];var _0x2ae428=_[_0xe555('0x59')](_0x55fb54);var _0x534175=_0x55fb54===_0xe555('0x5a')?_0xe555('0x6a'):_0xe555('0x5b');return db[_0xe555('0x6b')][_0xe555('0x5d')]({'raw':!![],'where':{'id':_0x1f5bf3[_0xe555('0x1c')]['id'],'role':_0xe555('0x3b')}})[_0xe555('0x19')](function(_0x1584db){if(_[_0xe555('0x14')](_0x1584db)){throw new Error(_0xe555('0x6c'));}_0x39a4f3=_0x1584db;return db[_0x2ae428+'Message']['findOne']({'where':{'id':_0x1f5bf3['body'][_0xe555('0x6d')]},'include':[{'model':db[_0x2ae428+_0xe555('0x60')],'as':_0xe555('0x60')},{'model':db[_0x2ae428+_0x534175],'as':_0xe555('0x5b')}]});})[_0xe555('0x19')](function(_0x3dd4f3){if(_[_0xe555('0x14')](_0x3dd4f3)){throw new Error(_0x2ae428+_0xe555('0x6e'));}_0x5472b9=_0x3dd4f3;return _0x3dd4f3[_0xe555('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe555('0x19')](function(){var _0x957699={'uniqueid':_0x55fb54+'.'+_0x5472b9['id']+'.'+_0x5472b9[_0xe555('0x60')]['id'],'FromUserId':_0x1f5bf3[_0xe555('0x30')]['id'],'type':_0xe555('0x65'),'ToUserId':_0x39a4f3['id']};_0x957699[_0x2ae428+_0xe555('0x70')]=_0x5472b9['id'];_0x957699[_0x2ae428+_0xe555('0x61')]=_0x5472b9[_0xe555('0x60')]['id'];_0x957699[_0xe555('0x62')+_0x2ae428+_0x534175+'Id']=_0x5472b9[_0xe555('0x5b')]['id'];return db[_0x2ae428+'TransferReport']['create'](_0x957699);})[_0xe555('0x19')](function(){return respondWithRpcPromise(_0xe555('0x71'),{'channel':_0x55fb54,'interaction':_0x5472b9[_0xe555('0x60')],'message':_0x5472b9,'account':_0x5472b9[_0xe555('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe555('0x3b'),'appdata':_0x39a4f3['name']+','+(_0x5472b9['Account']['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe555('0x19')](respondWithResult(_0x29d5e2,null))[_0xe555('0xd')](handleError(_0x29d5e2,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 13003c4..23cd832 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 _0x2ff2=['/:id/run','run','post','create','put','delete','multer','util','connect-timeout','express','Router','../../components/interaction/service','./schedule.controller','index','/:id','isAuthenticated','get'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2ff2,0x127));var _0x22ff=function(_0x24c178,_0x2e588b){_0x24c178=_0x24c178-0x0;var _0x35a2d8=_0x2ff2[_0x24c178];return _0x35a2d8;};'use strict';var multer=require(_0x22ff('0x0'));var util=require(_0x22ff('0x1'));var path=require('path');var timeout=require(_0x22ff('0x2'));var express=require(_0x22ff('0x3'));var router=express[_0x22ff('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x22ff('0x5'));var config=require('../../config/environment');var controller=require(_0x22ff('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x22ff('0x7')]);router['get'](_0x22ff('0x8'),auth[_0x22ff('0x9')](),controller['show']);router[_0x22ff('0xa')](_0x22ff('0xb'),auth[_0x22ff('0x9')](),controller[_0x22ff('0xc')]);router[_0x22ff('0xd')]('/',auth['isAuthenticated'](),controller[_0x22ff('0xe')]);router[_0x22ff('0xf')](_0x22ff('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x22ff('0x10')](_0x22ff('0x8'),auth[_0x22ff('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe2db=['show','get','/:id/run','run','create','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./schedule.controller','isAuthenticated','/:id'];(function(_0x4b1969,_0x1ae50e){var _0x4b53dc=function(_0x3e137c){while(--_0x3e137c){_0x4b1969['push'](_0x4b1969['shift']());}};_0x4b53dc(++_0x1ae50e);}(_0xe2db,0x1b6));var _0xbe2d=function(_0x34833a,_0x43894e){_0x34833a=_0x34833a-0x0;var _0x38b772=_0xe2db[_0x34833a];return _0x38b772;};'use strict';var multer=require(_0xbe2d('0x0'));var util=require(_0xbe2d('0x1'));var path=require(_0xbe2d('0x2'));var timeout=require(_0xbe2d('0x3'));var express=require('express');var router=express[_0xbe2d('0x4')]();var auth=require(_0xbe2d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbe2d('0x6'));var controller=require(_0xbe2d('0x7'));router['get']('/',auth[_0xbe2d('0x8')](),controller['index']);router['get'](_0xbe2d('0x9'),auth['isAuthenticated'](),controller[_0xbe2d('0xa')]);router[_0xbe2d('0xb')](_0xbe2d('0xc'),auth['isAuthenticated'](),controller[_0xbe2d('0xd')]);router['post']('/',auth[_0xbe2d('0x8')](),controller[_0xbe2d('0xe')]);router['put'](_0xbe2d('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xbe2d('0xf')](_0xbe2d('0x9'),auth[_0xbe2d('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index ca27e76..0083e46 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 _0x64d5=['hours','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','days'];(function(_0x4fe00c,_0x3db0f2){var _0x25ed0a=function(_0x39f9a1){while(--_0x39f9a1){_0x4fe00c['push'](_0x4fe00c['shift']());}};_0x25ed0a(++_0x3db0f2);}(_0x64d5,0xc5));var _0x564d=function(_0x183d46,_0x1b74c3){_0x183d46=_0x183d46-0x0;var _0x4a310e=_0x64d5[_0x183d46];return _0x4a310e;};'use strict';var Sequelize=require(_0x564d('0x0'));module[_0x564d('0x1')]={'name':{'type':Sequelize[_0x564d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x564d('0x2')]},'active':{'type':Sequelize[_0x564d('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x564d('0x2')],'allowNull':![],'defaultValue':_0x564d('0x4')},'startAt':{'type':Sequelize[_0x564d('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x564d('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x564d('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x564d('0x7')](_0x564d('0x8'),_0x564d('0x9'),_0x564d('0xa'),'weeks',_0x564d('0xb'),_0x564d('0xc'),'minutes'),'allowNull':![],'defaultValue':_0x564d('0xb')},'output':{'type':Sequelize['ENUM'](_0x564d('0xd'),_0x564d('0xe'),_0x564d('0xf')),'allowNull':![],'defaultValue':_0x564d('0xd')},'type':{'type':Sequelize[_0x564d('0x7')](_0x564d('0x10'),_0x564d('0x11')),'allowNull':![],'defaultValue':_0x564d('0x10')},'sendMail':{'type':Sequelize[_0x564d('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x564d('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xf6e0=['custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','days','hours','minutes','csv','xlsx'];(function(_0xb819a5,_0x40af38){var _0x27a3a0=function(_0x12d8ef){while(--_0x12d8ef){_0xb819a5['push'](_0xb819a5['shift']());}};_0x27a3a0(++_0x40af38);}(_0xf6e0,0x192));var _0x0f6e=function(_0x473b32,_0x28822d){_0x473b32=_0x473b32-0x0;var _0x1d6698=_0xf6e0[_0x473b32];return _0x1d6698;};'use strict';var Sequelize=require(_0x0f6e('0x0'));module[_0x0f6e('0x1')]={'name':{'type':Sequelize[_0x0f6e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0f6e('0x2')]},'active':{'type':Sequelize[_0x0f6e('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x0f6e('0x2')],'allowNull':![],'defaultValue':_0x0f6e('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x0f6e('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x0f6e('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x0f6e('0x7')](_0x0f6e('0x8'),_0x0f6e('0x9'),_0x0f6e('0xa'),'weeks',_0x0f6e('0xb'),_0x0f6e('0xc'),_0x0f6e('0xd')),'allowNull':![],'defaultValue':_0x0f6e('0xb')},'output':{'type':Sequelize[_0x0f6e('0x7')](_0x0f6e('0xe'),'pdf',_0x0f6e('0xf')),'allowNull':![],'defaultValue':_0x0f6e('0xe')},'type':{'type':Sequelize[_0x0f6e('0x7')](_0x0f6e('0x10'),_0x0f6e('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x0f6e('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x0f6e('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x0f6e('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x0f6e('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 84ae578..fa5d65a 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 _0xc39f=['key','VIRTUAL','field','Schedule','includeAll','include','findAll','rows','params','keys','fields','find','create','body','user','role','UserProfileSection','userProfileId','catch','run','../../config/schedule','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','get','Scheduler','error','stack','name','send','index','rawAttributes','model','query','intersection','attributes','length','hasOwnProperty','order','sort','pick','filters','filter','where','merge','type'];(function(_0x2cefed,_0x13e465){var _0x421a07=function(_0x44020a){while(--_0x44020a){_0x2cefed['push'](_0x2cefed['shift']());}};_0x421a07(++_0x13e465);}(_0xc39f,0xff));var _0xfc39=function(_0x1ef4d2,_0x272999){_0x1ef4d2=_0x1ef4d2-0x0;var _0x1a0b09=_0xc39f[_0x1ef4d2];return _0x1a0b09;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfc39('0x0'));var rimraf=require(_0xfc39('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc39('0x2'));var rp=require(_0xfc39('0x3'));var moment=require(_0xfc39('0x4'));var BPromise=require(_0xfc39('0x5'));var Mustache=require(_0xfc39('0x6'));var util=require(_0xfc39('0x7'));var path=require(_0xfc39('0x8'));var sox=require(_0xfc39('0x9'));var csv=require(_0xfc39('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfc39('0xb'));var crypto=require(_0xfc39('0xc'));var jsforce=require(_0xfc39('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfc39('0xa'));var querystring=require('querystring');var Papa=require(_0xfc39('0xe'));var authService=require(_0xfc39('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xfc39('0x10'));var qs=require(_0xfc39('0x11'));var logger=require('../../config/logger')(_0xfc39('0x12'));var utils=require(_0xfc39('0x13'));var config=require(_0xfc39('0x14'));var db=require(_0xfc39('0x15'))['db'];function respondWithStatusCode(_0x500429,_0xd8e81){_0xd8e81=_0xd8e81||0xcc;return function(_0x182590){if(_0x182590){return _0x500429[_0xfc39('0x16')](_0xd8e81);}return _0x500429['status'](_0xd8e81)[_0xfc39('0x17')]();};}function respondWithResult(_0x37072d,_0x35566f){_0x35566f=_0x35566f||0xc8;return function(_0x5321c5){if(_0x5321c5){return _0x37072d[_0xfc39('0x18')](_0x35566f)[_0xfc39('0x19')](_0x5321c5);}};}function respondWithFilteredResult(_0x221127,_0x18a6bb){return function(_0x102ddf){if(_0x102ddf){var _0x2ea973=_0x102ddf[_0xfc39('0x1a')],_0x3abeae=_0x18a6bb[_0xfc39('0x1b')],_0x45fbd5=_0x18a6bb[_0xfc39('0x1b')]+_0x18a6bb[_0xfc39('0x1c')],_0x4afc77;if(_0x45fbd5>=_0x2ea973){_0x45fbd5=_0x2ea973;_0x4afc77=0xc8;}else{_0x4afc77=0xce;}_0x221127['status'](_0x4afc77);return _0x221127['set'](_0xfc39('0x1d'),_0x3abeae+'-'+_0x45fbd5+'/'+_0x2ea973)[_0xfc39('0x19')](_0x102ddf);}return null;};}function patchUpdates(_0x5eb5d9){return function(_0x436a30){try{jsonpatch[_0xfc39('0x1e')](_0x436a30,_0x5eb5d9,!![]);}catch(_0x1efead){return BPromise[_0xfc39('0x1f')](_0x1efead);}return _0x436a30['save']();};}function saveUpdates(_0x10f27f,_0x2f3ab4){return function(_0x270106){if(_0x270106){return _0x270106[_0xfc39('0x20')](_0x10f27f)[_0xfc39('0x21')](function(_0x552cb2){return _0x552cb2;});}return null;};}function removeEntity(_0x14455a,_0x5c5e0a){return function(_0x644456){if(_0x644456){return _0x644456[_0xfc39('0x22')]()[_0xfc39('0x21')](function(){var _0x333678=_0x644456[_0xfc39('0x23')]({'plain':!![]});var _0x508fac=_0xfc39('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x508fac,'resourceId':_0x333678['id']}})['then'](function(){return _0x644456;});})[_0xfc39('0x21')](function(){_0x14455a[_0xfc39('0x18')](0xcc)[_0xfc39('0x17')]();});}};}function handleEntityNotFound(_0x171b71,_0x4f9d4d){return function(_0x27aefa){if(!_0x27aefa){_0x171b71['sendStatus'](0x194);}return _0x27aefa;};}function handleError(_0x4c2f7c,_0x1cf61e){_0x1cf61e=_0x1cf61e||0x1f4;return function(_0x545c33){logger[_0xfc39('0x25')](_0x545c33[_0xfc39('0x26')]);if(_0x545c33[_0xfc39('0x27')]){delete _0x545c33[_0xfc39('0x27')];}_0x4c2f7c['status'](_0x1cf61e)[_0xfc39('0x28')](_0x545c33);};}exports[_0xfc39('0x29')]=function(_0x485883,_0x25960f){var _0x51b7e7={},_0x197771={},_0x9408d5={'count':0x0,'rows':[]};var _0x59e3b5=db['Schedule'][_0xfc39('0x2a')];_0x197771[_0xfc39('0x2b')]=_['keys'](_0x59e3b5);_0x197771[_0xfc39('0x2c')]=_['keys'](_0x485883['query']);_0x197771['filters']=_[_0xfc39('0x2d')](_0x197771['model'],_0x197771[_0xfc39('0x2c')]);_0x51b7e7['attributes']=_[_0xfc39('0x2d')](_0x197771[_0xfc39('0x2b')],qs['fields'](_0x485883[_0xfc39('0x2c')]['fields']));_0x51b7e7[_0xfc39('0x2e')]=_0x51b7e7[_0xfc39('0x2e')][_0xfc39('0x2f')]?_0x51b7e7['attributes']:_0x197771['model'];if(!_0x485883[_0xfc39('0x2c')][_0xfc39('0x30')]('nolimit')){_0x51b7e7[_0xfc39('0x1c')]=qs[_0xfc39('0x1c')](_0x485883[_0xfc39('0x2c')][_0xfc39('0x1c')]);_0x51b7e7['offset']=qs['offset'](_0x485883[_0xfc39('0x2c')][_0xfc39('0x1b')]);}_0x51b7e7[_0xfc39('0x31')]=qs[_0xfc39('0x32')](_0x485883[_0xfc39('0x2c')][_0xfc39('0x32')]);_0x51b7e7['where']=qs['filters'](_[_0xfc39('0x33')](_0x485883[_0xfc39('0x2c')],_0x197771[_0xfc39('0x34')]));if(_0x485883[_0xfc39('0x2c')][_0xfc39('0x35')]){_0x51b7e7[_0xfc39('0x36')]=_[_0xfc39('0x37')](_0x51b7e7[_0xfc39('0x36')],{'$or':_['map'](_0x59e3b5,function(_0x2a3413){if(_0x2a3413[_0xfc39('0x38')][_0xfc39('0x39')]!==_0xfc39('0x3a')){var _0xf47a09={};_0xf47a09[_0x2a3413[_0xfc39('0x3b')]]={'$like':'%'+_0x485883[_0xfc39('0x2c')][_0xfc39('0x35')]+'%'};return _0xf47a09;}})});}_0x51b7e7=_[_0xfc39('0x37')]({},_0x51b7e7,_0x485883['options']);var _0x3e9c0b={'where':_0x51b7e7[_0xfc39('0x36')]};return db[_0xfc39('0x3c')]['count'](_0x3e9c0b)[_0xfc39('0x21')](function(_0x5757eb){_0x9408d5['count']=_0x5757eb;if(_0x485883[_0xfc39('0x2c')][_0xfc39('0x3d')]){_0x51b7e7[_0xfc39('0x3e')]=[{'all':!![]}];}return db[_0xfc39('0x3c')][_0xfc39('0x3f')](_0x51b7e7);})[_0xfc39('0x21')](function(_0x3cc11f){_0x9408d5[_0xfc39('0x40')]=_0x3cc11f;return _0x9408d5;})[_0xfc39('0x21')](respondWithFilteredResult(_0x25960f,_0x51b7e7))['catch'](handleError(_0x25960f,null));};exports['show']=function(_0x5c3282,_0x4cf382){var _0x3ddc3b={'raw':![],'where':{'id':_0x5c3282[_0xfc39('0x41')]['id']}},_0x2de453={};_0x2de453['model']=_[_0xfc39('0x42')](db[_0xfc39('0x3c')][_0xfc39('0x2a')]);_0x2de453[_0xfc39('0x2c')]=_[_0xfc39('0x42')](_0x5c3282[_0xfc39('0x2c')]);_0x2de453[_0xfc39('0x34')]=_[_0xfc39('0x2d')](_0x2de453[_0xfc39('0x2b')],_0x2de453['query']);_0x3ddc3b[_0xfc39('0x2e')]=_[_0xfc39('0x2d')](_0x2de453[_0xfc39('0x2b')],qs['fields'](_0x5c3282[_0xfc39('0x2c')][_0xfc39('0x43')]));_0x3ddc3b['attributes']=_0x3ddc3b[_0xfc39('0x2e')]['length']?_0x3ddc3b[_0xfc39('0x2e')]:_0x2de453['model'];if(_0x5c3282['query'][_0xfc39('0x3d')]){_0x3ddc3b[_0xfc39('0x3e')]=[{'all':!![]}];}_0x3ddc3b=_[_0xfc39('0x37')]({},_0x3ddc3b,_0x5c3282['options']);return db[_0xfc39('0x3c')][_0xfc39('0x44')](_0x3ddc3b)[_0xfc39('0x21')](handleEntityNotFound(_0x4cf382,null))[_0xfc39('0x21')](respondWithResult(_0x4cf382,null))['catch'](handleError(_0x4cf382,null));};exports[_0xfc39('0x45')]=function(_0x1729f1,_0x57c36d){return db[_0xfc39('0x3c')][_0xfc39('0x45')](_0x1729f1[_0xfc39('0x46')],{})[_0xfc39('0x21')](function(_0x3ee834){var _0x43d4b9=_0x1729f1[_0xfc39('0x47')][_0xfc39('0x23')]({'plain':!![]});if(!_0x43d4b9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43d4b9[_0xfc39('0x48')]==='user'){var _0x5f02f6=_0x3ee834[_0xfc39('0x23')]({'plain':!![]});var _0x564fc9=_0xfc39('0x24');return db[_0xfc39('0x49')][_0xfc39('0x44')]({'where':{'name':_0x564fc9,'userProfileId':_0x43d4b9[_0xfc39('0x4a')]},'raw':!![]})[_0xfc39('0x21')](function(_0x3d6461){if(_0x3d6461&&_0x3d6461['autoAssociation']===0x0){return db['UserProfileResource'][_0xfc39('0x45')]({'name':_0x5f02f6['name'],'resourceId':_0x5f02f6['id'],'type':_0x3d6461[_0xfc39('0x27')],'sectionId':_0x3d6461['id']},{})[_0xfc39('0x21')](function(){return _0x3ee834;});}else{return _0x3ee834;}})[_0xfc39('0x4b')](function(_0x409634){logger[_0xfc39('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x409634);throw _0x409634;});}return _0x3ee834;})['then'](respondWithResult(_0x57c36d,0xc9))[_0xfc39('0x4b')](handleError(_0x57c36d,null));};exports['update']=function(_0x4045e2,_0x5928fc){if(_0x4045e2['body']['id']){delete _0x4045e2[_0xfc39('0x46')]['id'];}return db[_0xfc39('0x3c')][_0xfc39('0x44')]({'where':{'id':_0x4045e2[_0xfc39('0x41')]['id']}})[_0xfc39('0x21')](handleEntityNotFound(_0x5928fc,null))['then'](saveUpdates(_0x4045e2['body'],null))[_0xfc39('0x21')](respondWithResult(_0x5928fc,null))[_0xfc39('0x4b')](handleError(_0x5928fc,null));};exports[_0xfc39('0x22')]=function(_0x536ee3,_0x1bb493){return db['Schedule'][_0xfc39('0x44')]({'where':{'id':_0x536ee3[_0xfc39('0x41')]['id']}})['then'](handleEntityNotFound(_0x1bb493,null))['then'](removeEntity(_0x1bb493,null))[_0xfc39('0x4b')](handleError(_0x1bb493,null));};exports[_0xfc39('0x4c')]=function(_0x3fc449,_0x28519b,_0x264f21){var _0x38c784=require(_0xfc39('0x4d'));return db['Schedule'][_0xfc39('0x44')]({'where':{'id':_0x3fc449[_0xfc39('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x28519b,null))[_0xfc39('0x21')](function(){_0x38c784[_0xfc39('0x4c')](_0x3fc449['params']['id']);})[_0xfc39('0x21')](respondWithStatusCode(_0x28519b,null))[_0xfc39('0x4b')](handleError(_0x28519b,null));}; \ No newline at end of file +var _0xbd21=['error','stack','name','send','index','Schedule','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','map','VIRTUAL','field','filter','merge','options','include','findAll','show','params','keys','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','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','sendStatus','status','end','count','limit','set','json','apply','reject','save','update','then','get','Scheduler','UserProfileResource','destroy'];(function(_0x55c4db,_0x293304){var _0x58ba84=function(_0xfc9c76){while(--_0xfc9c76){_0x55c4db['push'](_0x55c4db['shift']());}};_0x58ba84(++_0x293304);}(_0xbd21,0xd7));var _0x1bd2=function(_0x4a8342,_0x23f3a6){_0x4a8342=_0x4a8342-0x0;var _0x444b96=_0xbd21[_0x4a8342];return _0x444b96;};'use strict';var pdf=require(_0x1bd2('0x0'));var emlformat=require(_0x1bd2('0x1'));var rimraf=require(_0x1bd2('0x2'));var zipdir=require(_0x1bd2('0x3'));var jsonpatch=require(_0x1bd2('0x4'));var rp=require(_0x1bd2('0x5'));var moment=require(_0x1bd2('0x6'));var BPromise=require(_0x1bd2('0x7'));var Mustache=require(_0x1bd2('0x8'));var util=require('util');var path=require(_0x1bd2('0x9'));var sox=require(_0x1bd2('0xa'));var csv=require('to-csv');var ejs=require(_0x1bd2('0xb'));var fs=require('fs');var _=require(_0x1bd2('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1bd2('0xd'));var deskjs=require(_0x1bd2('0xe'));var toCsv=require(_0x1bd2('0xf'));var querystring=require(_0x1bd2('0x10'));var Papa=require(_0x1bd2('0x11'));var authService=require(_0x1bd2('0x12'));var hardwareService=require(_0x1bd2('0x13'));var Redis=require(_0x1bd2('0x14'));var qs=require(_0x1bd2('0x15'));var logger=require(_0x1bd2('0x16'))(_0x1bd2('0x17'));var utils=require(_0x1bd2('0x18'));var config=require(_0x1bd2('0x19'));var db=require(_0x1bd2('0x1a'))['db'];function respondWithStatusCode(_0x17772a,_0x4ba1b0){_0x4ba1b0=_0x4ba1b0||0xcc;return function(_0x3f9868){if(_0x3f9868){return _0x17772a[_0x1bd2('0x1b')](_0x4ba1b0);}return _0x17772a[_0x1bd2('0x1c')](_0x4ba1b0)[_0x1bd2('0x1d')]();};}function respondWithResult(_0x386013,_0x463402){_0x463402=_0x463402||0xc8;return function(_0x401555){if(_0x401555){return _0x386013[_0x1bd2('0x1c')](_0x463402)['json'](_0x401555);}};}function respondWithFilteredResult(_0x32bbda,_0x274345){return function(_0x29ca9f){if(_0x29ca9f){var _0x5db1ad=_0x29ca9f[_0x1bd2('0x1e')],_0x3abe3f=_0x274345['offset'],_0x11fe66=_0x274345['offset']+_0x274345[_0x1bd2('0x1f')],_0x2039b1;if(_0x11fe66>=_0x5db1ad){_0x11fe66=_0x5db1ad;_0x2039b1=0xc8;}else{_0x2039b1=0xce;}_0x32bbda[_0x1bd2('0x1c')](_0x2039b1);return _0x32bbda[_0x1bd2('0x20')]('Content-Range',_0x3abe3f+'-'+_0x11fe66+'/'+_0x5db1ad)[_0x1bd2('0x21')](_0x29ca9f);}return null;};}function patchUpdates(_0x299ee9){return function(_0x4a14e1){try{jsonpatch[_0x1bd2('0x22')](_0x4a14e1,_0x299ee9,!![]);}catch(_0x3b679a){return BPromise[_0x1bd2('0x23')](_0x3b679a);}return _0x4a14e1[_0x1bd2('0x24')]();};}function saveUpdates(_0x45d806,_0x351ea8){return function(_0x331362){if(_0x331362){return _0x331362[_0x1bd2('0x25')](_0x45d806)[_0x1bd2('0x26')](function(_0x2f0a3c){return _0x2f0a3c;});}return null;};}function removeEntity(_0x2c81ad,_0x409cc2){return function(_0x3727c7){if(_0x3727c7){return _0x3727c7['destroy']()[_0x1bd2('0x26')](function(){var _0x40d8f7=_0x3727c7[_0x1bd2('0x27')]({'plain':!![]});var _0x4b020a=_0x1bd2('0x28');return db[_0x1bd2('0x29')][_0x1bd2('0x2a')]({'where':{'type':_0x4b020a,'resourceId':_0x40d8f7['id']}})[_0x1bd2('0x26')](function(){return _0x3727c7;});})[_0x1bd2('0x26')](function(){_0x2c81ad[_0x1bd2('0x1c')](0xcc)[_0x1bd2('0x1d')]();});}};}function handleEntityNotFound(_0x6de324,_0x1686b5){return function(_0x20ae5a){if(!_0x20ae5a){_0x6de324[_0x1bd2('0x1b')](0x194);}return _0x20ae5a;};}function handleError(_0x19cc49,_0x3a7aae){_0x3a7aae=_0x3a7aae||0x1f4;return function(_0x2c2d8b){logger[_0x1bd2('0x2b')](_0x2c2d8b[_0x1bd2('0x2c')]);if(_0x2c2d8b[_0x1bd2('0x2d')]){delete _0x2c2d8b[_0x1bd2('0x2d')];}_0x19cc49[_0x1bd2('0x1c')](_0x3a7aae)[_0x1bd2('0x2e')](_0x2c2d8b);};}exports[_0x1bd2('0x2f')]=function(_0x36cc86,_0xd0b9bb){var _0x44fcf5={},_0x1bb1b8={},_0x57a083={'count':0x0,'rows':[]};var _0x5166ce=db[_0x1bd2('0x30')][_0x1bd2('0x31')];_0x1bb1b8[_0x1bd2('0x32')]=_['keys'](_0x5166ce);_0x1bb1b8[_0x1bd2('0x33')]=_['keys'](_0x36cc86[_0x1bd2('0x33')]);_0x1bb1b8[_0x1bd2('0x34')]=_[_0x1bd2('0x35')](_0x1bb1b8[_0x1bd2('0x32')],_0x1bb1b8['query']);_0x44fcf5[_0x1bd2('0x36')]=_[_0x1bd2('0x35')](_0x1bb1b8[_0x1bd2('0x32')],qs[_0x1bd2('0x37')](_0x36cc86['query'][_0x1bd2('0x37')]));_0x44fcf5[_0x1bd2('0x36')]=_0x44fcf5[_0x1bd2('0x36')][_0x1bd2('0x38')]?_0x44fcf5[_0x1bd2('0x36')]:_0x1bb1b8['model'];if(!_0x36cc86[_0x1bd2('0x33')][_0x1bd2('0x39')](_0x1bd2('0x3a'))){_0x44fcf5[_0x1bd2('0x1f')]=qs['limit'](_0x36cc86['query']['limit']);_0x44fcf5[_0x1bd2('0x3b')]=qs['offset'](_0x36cc86[_0x1bd2('0x33')][_0x1bd2('0x3b')]);}_0x44fcf5[_0x1bd2('0x3c')]=qs[_0x1bd2('0x3d')](_0x36cc86[_0x1bd2('0x33')][_0x1bd2('0x3d')]);_0x44fcf5[_0x1bd2('0x3e')]=qs['filters'](_['pick'](_0x36cc86[_0x1bd2('0x33')],_0x1bb1b8[_0x1bd2('0x34')]));if(_0x36cc86['query']['filter']){_0x44fcf5[_0x1bd2('0x3e')]=_['merge'](_0x44fcf5[_0x1bd2('0x3e')],{'$or':_[_0x1bd2('0x3f')](_0x5166ce,function(_0x460fee){if(_0x460fee['type']['key']!==_0x1bd2('0x40')){var _0x14607c={};_0x14607c[_0x460fee[_0x1bd2('0x41')]]={'$like':'%'+_0x36cc86[_0x1bd2('0x33')][_0x1bd2('0x42')]+'%'};return _0x14607c;}})});}_0x44fcf5=_[_0x1bd2('0x43')]({},_0x44fcf5,_0x36cc86[_0x1bd2('0x44')]);var _0x31302c={'where':_0x44fcf5[_0x1bd2('0x3e')]};return db[_0x1bd2('0x30')]['count'](_0x31302c)['then'](function(_0x339fee){_0x57a083[_0x1bd2('0x1e')]=_0x339fee;if(_0x36cc86[_0x1bd2('0x33')]['includeAll']){_0x44fcf5[_0x1bd2('0x45')]=[{'all':!![]}];}return db['Schedule'][_0x1bd2('0x46')](_0x44fcf5);})[_0x1bd2('0x26')](function(_0x47353f){_0x57a083['rows']=_0x47353f;return _0x57a083;})[_0x1bd2('0x26')](respondWithFilteredResult(_0xd0b9bb,_0x44fcf5))['catch'](handleError(_0xd0b9bb,null));};exports[_0x1bd2('0x47')]=function(_0x58c883,_0x35a553){var _0x1a7587={'raw':![],'where':{'id':_0x58c883[_0x1bd2('0x48')]['id']}},_0x1530f3={};_0x1530f3[_0x1bd2('0x32')]=_[_0x1bd2('0x49')](db['Schedule'][_0x1bd2('0x31')]);_0x1530f3[_0x1bd2('0x33')]=_[_0x1bd2('0x49')](_0x58c883[_0x1bd2('0x33')]);_0x1530f3[_0x1bd2('0x34')]=_['intersection'](_0x1530f3['model'],_0x1530f3[_0x1bd2('0x33')]);_0x1a7587[_0x1bd2('0x36')]=_[_0x1bd2('0x35')](_0x1530f3['model'],qs['fields'](_0x58c883[_0x1bd2('0x33')]['fields']));_0x1a7587[_0x1bd2('0x36')]=_0x1a7587[_0x1bd2('0x36')][_0x1bd2('0x38')]?_0x1a7587[_0x1bd2('0x36')]:_0x1530f3[_0x1bd2('0x32')];if(_0x58c883['query'][_0x1bd2('0x4a')]){_0x1a7587[_0x1bd2('0x45')]=[{'all':!![]}];}_0x1a7587=_[_0x1bd2('0x43')]({},_0x1a7587,_0x58c883['options']);return db[_0x1bd2('0x30')][_0x1bd2('0x4b')](_0x1a7587)[_0x1bd2('0x26')](handleEntityNotFound(_0x35a553,null))['then'](respondWithResult(_0x35a553,null))[_0x1bd2('0x4c')](handleError(_0x35a553,null));};exports[_0x1bd2('0x4d')]=function(_0x2e57b5,_0x69621){return db['Schedule']['create'](_0x2e57b5[_0x1bd2('0x4e')],{})[_0x1bd2('0x26')](function(_0x5b48d2){var _0x24831e=_0x2e57b5['user'][_0x1bd2('0x27')]({'plain':!![]});if(!_0x24831e)throw new Error(_0x1bd2('0x4f'));if(_0x24831e[_0x1bd2('0x50')]===_0x1bd2('0x51')){var _0x3ab85b=_0x5b48d2[_0x1bd2('0x27')]({'plain':!![]});var _0x2993ce='Scheduler';return db['UserProfileSection']['find']({'where':{'name':_0x2993ce,'userProfileId':_0x24831e[_0x1bd2('0x52')]},'raw':!![]})[_0x1bd2('0x26')](function(_0x4b17ab){if(_0x4b17ab&&_0x4b17ab[_0x1bd2('0x53')]===0x0){return db['UserProfileResource'][_0x1bd2('0x4d')]({'name':_0x3ab85b[_0x1bd2('0x2d')],'resourceId':_0x3ab85b['id'],'type':_0x4b17ab[_0x1bd2('0x2d')],'sectionId':_0x4b17ab['id']},{})['then'](function(){return _0x5b48d2;});}else{return _0x5b48d2;}})[_0x1bd2('0x4c')](function(_0x461760){logger[_0x1bd2('0x2b')](_0x1bd2('0x54'),_0x461760);throw _0x461760;});}return _0x5b48d2;})['then'](respondWithResult(_0x69621,0xc9))[_0x1bd2('0x4c')](handleError(_0x69621,null));};exports['update']=function(_0x1ff988,_0x5d7d13){if(_0x1ff988[_0x1bd2('0x4e')]['id']){delete _0x1ff988['body']['id'];}return db[_0x1bd2('0x30')][_0x1bd2('0x4b')]({'where':{'id':_0x1ff988[_0x1bd2('0x48')]['id']}})[_0x1bd2('0x26')](handleEntityNotFound(_0x5d7d13,null))[_0x1bd2('0x26')](saveUpdates(_0x1ff988[_0x1bd2('0x4e')],null))[_0x1bd2('0x26')](respondWithResult(_0x5d7d13,null))['catch'](handleError(_0x5d7d13,null));};exports[_0x1bd2('0x2a')]=function(_0xef9661,_0x464f89){return db[_0x1bd2('0x30')]['find']({'where':{'id':_0xef9661[_0x1bd2('0x48')]['id']}})[_0x1bd2('0x26')](handleEntityNotFound(_0x464f89,null))[_0x1bd2('0x26')](removeEntity(_0x464f89,null))[_0x1bd2('0x4c')](handleError(_0x464f89,null));};exports[_0x1bd2('0x55')]=function(_0x5c468b,_0x143fc8,_0x15bf4a){var _0x2b89af=require('../../config/schedule');return db[_0x1bd2('0x30')][_0x1bd2('0x4b')]({'where':{'id':_0x5c468b[_0x1bd2('0x48')]['id']},'raw':!![]})[_0x1bd2('0x26')](handleEntityNotFound(_0x143fc8,null))[_0x1bd2('0x26')](function(){_0x2b89af[_0x1bd2('0x55')](_0x5c468b['params']['id']);})[_0x1bd2('0x26')](respondWithStatusCode(_0x143fc8,null))[_0x1bd2('0x4c')](handleError(_0x143fc8,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 37909da..e6b72ae 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 _0xec41=['tools_schedules','lodash','../../config/logger','moment','bluebird','request-promise','./schedule.attributes','exports','define','Schedule'];(function(_0x1a3243,_0x201872){var _0x33f2ca=function(_0x59d32e){while(--_0x59d32e){_0x1a3243['push'](_0x1a3243['shift']());}};_0x33f2ca(++_0x201872);}(_0xec41,0xfb));var _0x1ec4=function(_0x5701ba,_0x2fb60f){_0x5701ba=_0x5701ba-0x0;var _0x3f1567=_0xec41[_0x5701ba];return _0x3f1567;};'use strict';var _=require(_0x1ec4('0x0'));var util=require('util');var logger=require(_0x1ec4('0x1'))('api');var moment=require(_0x1ec4('0x2'));var BPromise=require(_0x1ec4('0x3'));var rp=require(_0x1ec4('0x4'));var attributes=require(_0x1ec4('0x5'));module[_0x1ec4('0x6')]=function(_0x4f5cf2,_0x1302ab){return _0x4f5cf2[_0x1ec4('0x7')](_0x1ec4('0x8'),attributes,{'tableName':_0x1ec4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf58d=['./schedule.attributes','exports','Schedule','tools_schedules','lodash','moment','request-promise'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xf58d,0xd6));var _0xdf58=function(_0xf1b947,_0x8fed91){_0xf1b947=_0xf1b947-0x0;var _0x50bb78=_0xf58d[_0xf1b947];return _0x50bb78;};'use strict';var _=require(_0xdf58('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdf58('0x1'));var BPromise=require('bluebird');var rp=require(_0xdf58('0x2'));var attributes=require(_0xdf58('0x3'));module[_0xdf58('0x4')]=function(_0x48e2bd,_0x271a19){return _0x48e2bd['define'](_0xdf58('0x5'),attributes,{'tableName':_0xdf58('0x6'),'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 b27bd48..3ed6a12 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 _0x1d56=['Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x5b27ed,_0x526380){var _0x34ba54=function(_0x249cda){while(--_0x249cda){_0x5b27ed['push'](_0x5b27ed['shift']());}};_0x34ba54(++_0x526380);}(_0x1d56,0x6e));var _0x61d5=function(_0xced9f5,_0x1cfb20){_0xced9f5=_0xced9f5-0x0;var _0x2915a0=_0x1d56[_0xced9f5];return _0x2915a0;};'use strict';var _=require('lodash');var util=require(_0x61d5('0x0'));var moment=require('moment');var BPromise=require(_0x61d5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61d5('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x61d5('0x3'))('rpc');var config=require(_0x61d5('0x4'));var jayson=require(_0x61d5('0x5'));var client=jayson[_0x61d5('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7ec7be,_0xb91074,_0x91984){return new BPromise(function(_0x3970e9,_0x5ea5a6){return client[_0x61d5('0x7')](_0x7ec7be,_0x91984)[_0x61d5('0x8')](function(_0x27a348){logger[_0x61d5('0x9')](_0x61d5('0xa'),_0xb91074,_0x61d5('0xb'));logger[_0x61d5('0xc')](_0x61d5('0xd'),_0xb91074,_0x61d5('0xb'),JSON[_0x61d5('0xe')](_0x27a348));if(_0x27a348[_0x61d5('0xf')]){if(_0x27a348['error'][_0x61d5('0x10')]===0x1f4){logger[_0x61d5('0xf')](_0x61d5('0xa'),_0xb91074,_0x27a348['error']['message']);return _0x5ea5a6(_0x27a348[_0x61d5('0xf')][_0x61d5('0x11')]);}logger[_0x61d5('0xf')](_0x61d5('0xa'),_0xb91074,_0x27a348[_0x61d5('0xf')][_0x61d5('0x11')]);return _0x3970e9(_0x27a348['error']['message']);}else{logger[_0x61d5('0x9')](_0x61d5('0xa'),_0xb91074,'request\x20sent');_0x3970e9(_0x27a348[_0x61d5('0x12')][_0x61d5('0x11')]);}})[_0x61d5('0x13')](function(_0x543c88){logger[_0x61d5('0xf')](_0x61d5('0xa'),_0xb91074,_0x543c88);_0x5ea5a6(_0x543c88);});});} \ No newline at end of file +var _0x3e58=['message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s'];(function(_0x37e97f,_0x50191f){var _0x340877=function(_0x48425e){while(--_0x48425e){_0x37e97f['push'](_0x37e97f['shift']());}};_0x340877(++_0x50191f);}(_0x3e58,0x17c));var _0x83e5=function(_0x59c2cb,_0x671ebb){_0x59c2cb=_0x59c2cb-0x0;var _0x4d2910=_0x3e58[_0x59c2cb];return _0x4d2910;};'use strict';var _=require('lodash');var util=require(_0x83e5('0x0'));var moment=require('moment');var BPromise=require(_0x83e5('0x1'));var rs=require(_0x83e5('0x2'));var fs=require('fs');var Redis=require(_0x83e5('0x3'));var db=require(_0x83e5('0x4'))['db'];var utils=require(_0x83e5('0x5'));var logger=require(_0x83e5('0x6'))(_0x83e5('0x7'));var config=require('../../config/environment');var jayson=require(_0x83e5('0x8'));var client=jayson[_0x83e5('0x9')][_0x83e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a5121,_0x3b2a8e,_0x4e5ef1){return new BPromise(function(_0xc72af1,_0x4e0a7a){return client[_0x83e5('0xb')](_0x5a5121,_0x4e5ef1)['then'](function(_0x6acc18){logger[_0x83e5('0xc')]('Schedule,\x20%s,\x20%s',_0x3b2a8e,_0x83e5('0xd'));logger['debug'](_0x83e5('0xe'),_0x3b2a8e,_0x83e5('0xd'),JSON[_0x83e5('0xf')](_0x6acc18));if(_0x6acc18[_0x83e5('0x10')]){if(_0x6acc18[_0x83e5('0x10')][_0x83e5('0x11')]===0x1f4){logger[_0x83e5('0x10')](_0x83e5('0x12'),_0x3b2a8e,_0x6acc18[_0x83e5('0x10')][_0x83e5('0x13')]);return _0x4e0a7a(_0x6acc18[_0x83e5('0x10')][_0x83e5('0x13')]);}logger[_0x83e5('0x10')](_0x83e5('0x12'),_0x3b2a8e,_0x6acc18[_0x83e5('0x10')][_0x83e5('0x13')]);return _0xc72af1(_0x6acc18[_0x83e5('0x10')][_0x83e5('0x13')]);}else{logger[_0x83e5('0xc')](_0x83e5('0x12'),_0x3b2a8e,'request\x20sent');_0xc72af1(_0x6acc18['result'][_0x83e5('0x13')]);}})[_0x83e5('0x14')](function(_0xb3b21a){logger['error']('Schedule,\x20%s,\x20%s',_0x3b2a8e,_0xb3b21a);_0x4e0a7a(_0xb3b21a);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 6b33a03..012f246 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 _0xb956=['addLogo','addLogoLogin','server/files/images/logos/','/:id/preferred','addPreferred','put','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','diskStorage','join','root','format','%s%s','logo','extname','originalname','post','single','file'];(function(_0x1a20cb,_0x381685){var _0x112903=function(_0x55111f){while(--_0x55111f){_0x1a20cb['push'](_0x1a20cb['shift']());}};_0x112903(++_0x381685);}(_0xb956,0x7a));var _0x6b95=function(_0x1fbdd1,_0x17323f){_0x1fbdd1=_0x1fbdd1-0x0;var _0x3319a2=_0xb956[_0x1fbdd1];return _0x3319a2;};'use strict';var multer=require('multer');var util=require(_0x6b95('0x0'));var path=require(_0x6b95('0x1'));var timeout=require(_0x6b95('0x2'));var express=require(_0x6b95('0x3'));var router=express[_0x6b95('0x4')]();var auth=require(_0x6b95('0x5'));var interaction=require(_0x6b95('0x6'));var config=require(_0x6b95('0x7'));var controller=require(_0x6b95('0x8'));router[_0x6b95('0x9')]('/',auth[_0x6b95('0xa')](),controller[_0x6b95('0xb')]);router[_0x6b95('0x9')](_0x6b95('0xc'),controller[_0x6b95('0xd')]);router[_0x6b95('0x9')](_0x6b95('0xe'),controller['getLogo']);router[_0x6b95('0x9')](_0x6b95('0xf'),controller[_0x6b95('0x10')]);router[_0x6b95('0x9')](_0x6b95('0x11'),controller['gdpr']);router[_0x6b95('0x9')]('/:id/preferred',controller[_0x6b95('0x12')]);var upload=multer({'storage':multer[_0x6b95('0x13')]({'destination':function(_0x4029c5,_0x452b37,_0x23a009){_0x23a009(null,path[_0x6b95('0x14')](config[_0x6b95('0x15')],'server/files/images/logos/'));},'filename':function(_0x33a215,_0xb87bf5,_0x37b6ff){_0x37b6ff(null,util[_0x6b95('0x16')](_0x6b95('0x17'),_0x6b95('0x18'),path[_0x6b95('0x19')](_0xb87bf5[_0x6b95('0x1a')])));}})});router[_0x6b95('0x1b')](_0x6b95('0xe'),upload[_0x6b95('0x1c')](_0x6b95('0x1d')),controller[_0x6b95('0x1e')]);var upload=multer({'storage':multer[_0x6b95('0x13')]({'destination':function(_0x4a2e63,_0x3aedbb,_0x334471){_0x334471(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x5de04a,_0x53ee28,_0x3a0c6c){_0x3a0c6c(null,util[_0x6b95('0x16')](_0x6b95('0x17'),'logologin',path['extname'](_0x53ee28[_0x6b95('0x1a')])));}})});router['post']('/:id/logo_login',upload[_0x6b95('0x1c')](_0x6b95('0x1d')),controller[_0x6b95('0x1f')]);var upload=multer({'storage':multer[_0x6b95('0x13')]({'destination':function(_0x56d744,_0x4f36a2,_0x502c9f){_0x502c9f(null,path[_0x6b95('0x14')](config[_0x6b95('0x15')],_0x6b95('0x20')));},'filename':function(_0x484d60,_0x550745,_0x3a0af4){_0x3a0af4(null,util[_0x6b95('0x16')](_0x6b95('0x17'),'preferred',path[_0x6b95('0x19')](_0x550745['originalname'])));}})});router['post'](_0x6b95('0x21'),upload[_0x6b95('0x1c')](_0x6b95('0x1d')),controller[_0x6b95('0x22')]);router[_0x6b95('0x23')]('/:id',auth[_0x6b95('0xa')](),controller[_0x6b95('0x24')]);module[_0x6b95('0x25')]=router; \ No newline at end of file +var _0x034b=['extname','originalname','post','/:id/logo','single','file','addLogo','server/files/images/logos/','%s%s','logologin','addLogoLogin','preferred','put','/:id','update','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','show','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','diskStorage','join','root','format'];(function(_0x2264a5,_0x42a516){var _0x49f28b=function(_0x42c967){while(--_0x42c967){_0x2264a5['push'](_0x2264a5['shift']());}};_0x49f28b(++_0x42a516);}(_0x034b,0x191));var _0xb034=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x034b[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xb034('0x0'));var util=require('util');var path=require(_0xb034('0x1'));var timeout=require('connect-timeout');var express=require(_0xb034('0x2'));var router=express['Router']();var auth=require(_0xb034('0x3'));var interaction=require(_0xb034('0x4'));var config=require(_0xb034('0x5'));var controller=require(_0xb034('0x6'));router[_0xb034('0x7')]('/',auth[_0xb034('0x8')](),controller[_0xb034('0x9')]);router[_0xb034('0x7')]('/:id',controller[_0xb034('0xa')]);router[_0xb034('0x7')]('/:id/logo',controller['getLogo']);router[_0xb034('0x7')](_0xb034('0xb'),controller[_0xb034('0xc')]);router[_0xb034('0x7')](_0xb034('0xd'),controller['gdpr']);router[_0xb034('0x7')](_0xb034('0xe'),controller['getPreferred']);var upload=multer({'storage':multer[_0xb034('0xf')]({'destination':function(_0x17ad4b,_0x367973,_0x4eb74d){_0x4eb74d(null,path[_0xb034('0x10')](config[_0xb034('0x11')],'server/files/images/logos/'));},'filename':function(_0x2ffe76,_0x4d57e6,_0x215f0d){_0x215f0d(null,util[_0xb034('0x12')]('%s%s','logo',path[_0xb034('0x13')](_0x4d57e6[_0xb034('0x14')])));}})});router[_0xb034('0x15')](_0xb034('0x16'),upload[_0xb034('0x17')](_0xb034('0x18')),controller[_0xb034('0x19')]);var upload=multer({'storage':multer[_0xb034('0xf')]({'destination':function(_0x22178b,_0x5b8254,_0x2b82de){_0x2b82de(null,path[_0xb034('0x10')](config['root'],_0xb034('0x1a')));},'filename':function(_0x13017e,_0x1347f8,_0x457f25){_0x457f25(null,util[_0xb034('0x12')](_0xb034('0x1b'),_0xb034('0x1c'),path[_0xb034('0x13')](_0x1347f8['originalname'])));}})});router[_0xb034('0x15')]('/:id/logo_login',upload[_0xb034('0x17')]('file'),controller[_0xb034('0x1d')]);var upload=multer({'storage':multer[_0xb034('0xf')]({'destination':function(_0x780718,_0x4cd737,_0x279d73){_0x279d73(null,path[_0xb034('0x10')](config[_0xb034('0x11')],'server/files/images/logos/'));},'filename':function(_0x544002,_0x5010b2,_0x5fc35){_0x5fc35(null,util[_0xb034('0x12')](_0xb034('0x1b'),_0xb034('0x1e'),path[_0xb034('0x13')](_0x5010b2[_0xb034('0x14')])));}})});router[_0xb034('0x15')]('/:id/preferred',upload[_0xb034('0x17')]('file'),controller['addPreferred']);router[_0xb034('0x1f')](_0xb034('0x20'),auth[_0xb034('0x8')](),controller[_0xb034('0x21')]);module[_0xb034('0x22')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index c496655..5db9faa 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 _0xd096=['min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','INTEGER'];(function(_0x2a26ac,_0xe81bb6){var _0x27c0a2=function(_0x198e02){while(--_0x198e02){_0x2a26ac['push'](_0x2a26ac['shift']());}};_0x27c0a2(++_0xe81bb6);}(_0xd096,0xae));var _0x6d09=function(_0x52771d,_0x47d712){_0x52771d=_0x52771d-0x0;var _0x3ccf7a=_0xd096[_0x52771d];return _0x3ccf7a;};'use strict';var Sequelize=require('sequelize');module['exports']={'min_internal':{'type':Sequelize[_0x6d09('0x0')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x6d09('0x0')](0xb),'unique':_0x6d09('0x1'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x6d09('0x0')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x6d09('0x2')],'defaultValue':_0x6d09('0x3')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x6d09('0x4')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x6d09('0x2')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x6d09('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x6d09('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x6d09('0x2')]},'turnaddr':{'type':Sequelize[_0x6d09('0x2')]},'turnusername':{'type':Sequelize[_0x6d09('0x2')]},'turnpassword':{'type':Sequelize[_0x6d09('0x2')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x6d09('0x4')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x6d09('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x6d09('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x6d09('0x0')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x6d09('0x0')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x6d09('0x0')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x6d09('0x2')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x6d09('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x6d09('0x2')]},'defaultPreferred':{'type':Sequelize[_0x6d09('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf26b=['exports','INTEGER','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf26b,0x142));var _0xbf26=function(_0x2d99d4,_0x32db5a){_0x2d99d4=_0x2d99d4-0x0;var _0x137524=_0xf26b[_0x2d99d4];return _0x137524;};'use strict';var Sequelize=require('sequelize');module[_0xbf26('0x0')]={'min_internal':{'type':Sequelize[_0xbf26('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xbf26('0x1')](0xb),'unique':_0xbf26('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xbf26('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xbf26('0x3')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0xbf26('0x3')]},'defaultLogo':{'type':Sequelize[_0xbf26('0x4')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xbf26('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xbf26('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xbf26('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xbf26('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xbf26('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xbf26('0x3')]},'turnaddr':{'type':Sequelize[_0xbf26('0x3')]},'turnusername':{'type':Sequelize[_0xbf26('0x3')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xbf26('0x3')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xbf26('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xbf26('0x3')],'defaultValue':_0xbf26('0x5')},'enableEmailPreview':{'type':Sequelize[_0xbf26('0x4')],'defaultValue':![]},'split':{'type':Sequelize[_0xbf26('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xbf26('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xbf26('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xbf26('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xbf26('0x3')],'defaultValue':_0xbf26('0x6')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xbf26('0x3')]},'defaultPreferred':{'type':Sequelize[_0xbf26('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index bf5e3e7..b291f31 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 _0x5204=['api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','apply','reject','then','destroy','name','send','index','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','Setting','includeAll','include','findAll','rows','params','keys','find','catch','update','body','get','readFileSync','join','root','server/files/templates/stun.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_rtp_asterisk.so','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','getLicense','logo','preferred','defaultLogo','defaultLoginLogo','existsSync','toLower','default_logo.png','default','upperFirst','custom','ValidationError','Logo\x20not\x20found','download','getLogoLogin','server/files/images/logos','Sequelize','addPreferred','getPreferred','defaultPreferred','default_preferred.png','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','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger'];(function(_0x4429d2,_0x4ba094){var _0x516fd1=function(_0x47a5d5){while(--_0x47a5d5){_0x4429d2['push'](_0x4429d2['shift']());}};_0x516fd1(++_0x4ba094);}(_0x5204,0xdf));var _0x4520=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x5204[_0x36ed48];return _0x51c63a;};'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'];var jayson=require(_0x4520('0x19'));var client=jayson[_0x4520('0x1a')][_0x4520('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x508ea6,_0x2e3c64,_0x1626cb,_0x16737b){return new BPromise(function(_0x4677d7,_0x426836){var _0x34d383=_0x16737b||client;return _0x34d383[_0x4520('0x1c')](_0x508ea6,_0x1626cb)['then'](function(_0x3e53e5){logger[_0x4520('0x1d')](_0x4520('0x1e'),_0x2e3c64,_0x4520('0x1f'));logger[_0x4520('0x20')]('Setting,\x20%s,\x20%s,\x20%s',_0x2e3c64,_0x4520('0x1f'),JSON[_0x4520('0x21')](_0x3e53e5));if(_0x3e53e5[_0x4520('0x22')]){if(_0x3e53e5[_0x4520('0x22')][_0x4520('0x23')]===0x1f4){logger[_0x4520('0x22')](_0x4520('0x1e'),_0x2e3c64,_0x3e53e5[_0x4520('0x22')][_0x4520('0x24')]);return _0x426836(_0x3e53e5[_0x4520('0x22')][_0x4520('0x24')]);}logger[_0x4520('0x22')]('Setting,\x20%s,\x20%s',_0x2e3c64,_0x3e53e5[_0x4520('0x22')]['message']);return _0x4677d7(_0x3e53e5['error']['message']);}else{logger[_0x4520('0x1d')]('Setting,\x20%s,\x20%s',_0x2e3c64,_0x4520('0x1f'));_0x4677d7(_0x3e53e5[_0x4520('0x25')][_0x4520('0x24')]);}})['catch'](function(_0x3199a9){logger[_0x4520('0x22')](_0x4520('0x1e'),_0x2e3c64,_0x3199a9);_0x426836(_0x3199a9);});});}function respondWithStatusCode(_0x4b889a,_0x198c34){_0x198c34=_0x198c34||0xcc;return function(_0x847d15){if(_0x847d15){return _0x4b889a[_0x4520('0x26')](_0x198c34);}return _0x4b889a[_0x4520('0x27')](_0x198c34)[_0x4520('0x28')]();};}function respondWithResult(_0x552da1,_0x3774bd){_0x3774bd=_0x3774bd||0xc8;return function(_0x15987c){if(_0x15987c){return _0x552da1[_0x4520('0x27')](_0x3774bd)[_0x4520('0x29')](_0x15987c);}};}function respondWithFilteredResult(_0x57306b,_0x336c63){return function(_0x4602a4){if(_0x4602a4){var _0x92168b=_0x4602a4[_0x4520('0x2a')],_0x21e1f3=_0x336c63[_0x4520('0x2b')],_0xad9f8=_0x336c63[_0x4520('0x2b')]+_0x336c63[_0x4520('0x2c')],_0x2c95ea;if(_0xad9f8>=_0x92168b){_0xad9f8=_0x92168b;_0x2c95ea=0xc8;}else{_0x2c95ea=0xce;}_0x57306b['status'](_0x2c95ea);return _0x57306b[_0x4520('0x2d')]('Content-Range',_0x21e1f3+'-'+_0xad9f8+'/'+_0x92168b)[_0x4520('0x29')](_0x4602a4);}return null;};}function patchUpdates(_0x14778a){return function(_0x43b4a2){try{jsonpatch[_0x4520('0x2e')](_0x43b4a2,_0x14778a,!![]);}catch(_0x1da740){return BPromise[_0x4520('0x2f')](_0x1da740);}return _0x43b4a2['save']();};}function saveUpdates(_0x2c32ce,_0x508c05){return function(_0x2585eb){if(_0x2585eb){return _0x2585eb['update'](_0x2c32ce)[_0x4520('0x30')](function(_0x5c140c){return _0x5c140c;});}return null;};}function removeEntity(_0x460ef1,_0x4e6a5f){return function(_0x5087dc){if(_0x5087dc){return _0x5087dc[_0x4520('0x31')]()[_0x4520('0x30')](function(){_0x460ef1[_0x4520('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x369abb,_0x3556ca){return function(_0x2acb4e){if(!_0x2acb4e){_0x369abb[_0x4520('0x26')](0x194);}return _0x2acb4e;};}function handleError(_0x59b4ff,_0x4d2948){_0x4d2948=_0x4d2948||0x1f4;return function(_0x24ccb9){logger[_0x4520('0x22')](_0x24ccb9['stack']);if(_0x24ccb9[_0x4520('0x32')]){delete _0x24ccb9[_0x4520('0x32')];}_0x59b4ff[_0x4520('0x27')](_0x4d2948)[_0x4520('0x33')](_0x24ccb9);};}exports[_0x4520('0x34')]=function(_0x3b0a72,_0x550a0f){var _0x21e895={},_0x368644={},_0x53bba9={'count':0x0,'rows':[]};var _0x3acc82=db['Setting'][_0x4520('0x35')];_0x368644[_0x4520('0x36')]=_['keys'](_0x3acc82);_0x368644['query']=_['keys'](_0x3b0a72[_0x4520('0x37')]);_0x368644[_0x4520('0x38')]=_[_0x4520('0x39')](_0x368644[_0x4520('0x36')],_0x368644[_0x4520('0x37')]);_0x21e895[_0x4520('0x3a')]=_[_0x4520('0x39')](_0x368644['model'],qs[_0x4520('0x3b')](_0x3b0a72[_0x4520('0x37')][_0x4520('0x3b')]));_0x21e895['attributes']=_0x21e895[_0x4520('0x3a')][_0x4520('0x3c')]?_0x21e895['attributes']:_0x368644['model'];if(!_0x3b0a72[_0x4520('0x37')][_0x4520('0x3d')](_0x4520('0x3e'))){_0x21e895[_0x4520('0x2c')]=qs[_0x4520('0x2c')](_0x3b0a72['query']['limit']);_0x21e895['offset']=qs[_0x4520('0x2b')](_0x3b0a72['query'][_0x4520('0x2b')]);}_0x21e895['order']=qs['sort'](_0x3b0a72[_0x4520('0x37')][_0x4520('0x3f')]);_0x21e895[_0x4520('0x40')]=qs[_0x4520('0x38')](_[_0x4520('0x41')](_0x3b0a72['query'],_0x368644[_0x4520('0x38')]));if(_0x3b0a72[_0x4520('0x37')]['filter']){_0x21e895['where']=_[_0x4520('0x42')](_0x21e895[_0x4520('0x40')],{'$or':_['map'](_0x3acc82,function(_0x2978d5){if(_0x2978d5[_0x4520('0x43')][_0x4520('0x44')]!==_0x4520('0x45')){var _0x489f89={};_0x489f89[_0x2978d5[_0x4520('0x46')]]={'$like':'%'+_0x3b0a72[_0x4520('0x37')][_0x4520('0x47')]+'%'};return _0x489f89;}})});}_0x21e895=_[_0x4520('0x42')]({},_0x21e895,_0x3b0a72[_0x4520('0x48')]);var _0x16630c={'where':_0x21e895[_0x4520('0x40')]};return db[_0x4520('0x49')][_0x4520('0x2a')](_0x16630c)[_0x4520('0x30')](function(_0x1e6ac0){_0x53bba9[_0x4520('0x2a')]=_0x1e6ac0;if(_0x3b0a72[_0x4520('0x37')][_0x4520('0x4a')]){_0x21e895[_0x4520('0x4b')]=[{'all':!![]}];}return db[_0x4520('0x49')][_0x4520('0x4c')](_0x21e895);})['then'](function(_0x422b1c){_0x53bba9[_0x4520('0x4d')]=_0x422b1c;return _0x53bba9;})['then'](respondWithFilteredResult(_0x550a0f,_0x21e895))['catch'](handleError(_0x550a0f,null));};exports['show']=function(_0x4dce4f,_0x22e62d){var _0x5b96f8={'raw':![],'where':{'id':_0x4dce4f[_0x4520('0x4e')]['id']}},_0x2f16f4={};_0x2f16f4[_0x4520('0x36')]=_[_0x4520('0x4f')](db[_0x4520('0x49')][_0x4520('0x35')]);_0x2f16f4[_0x4520('0x37')]=_[_0x4520('0x4f')](_0x4dce4f[_0x4520('0x37')]);_0x2f16f4[_0x4520('0x38')]=_[_0x4520('0x39')](_0x2f16f4[_0x4520('0x36')],_0x2f16f4[_0x4520('0x37')]);_0x5b96f8[_0x4520('0x3a')]=_[_0x4520('0x39')](_0x2f16f4[_0x4520('0x36')],qs[_0x4520('0x3b')](_0x4dce4f[_0x4520('0x37')]['fields']));_0x5b96f8['attributes']=_0x5b96f8[_0x4520('0x3a')][_0x4520('0x3c')]?_0x5b96f8[_0x4520('0x3a')]:_0x2f16f4['model'];if(_0x4dce4f[_0x4520('0x37')][_0x4520('0x4a')]){_0x5b96f8[_0x4520('0x4b')]=[{'all':!![]}];}_0x5b96f8=_['merge']({},_0x5b96f8,_0x4dce4f[_0x4520('0x48')]);return db[_0x4520('0x49')][_0x4520('0x50')](_0x5b96f8)['then'](handleEntityNotFound(_0x22e62d,null))['then'](respondWithResult(_0x22e62d,null))[_0x4520('0x51')](handleError(_0x22e62d,null));};exports[_0x4520('0x52')]=function(_0x24269e,_0x379da4,_0x2d37ed){var _0x1549cc;return db[_0x4520('0x49')][_0x4520('0x50')]({'where':{'id':_0x24269e['params']['id']}})[_0x4520('0x30')](handleEntityNotFound(_0x379da4,null))[_0x4520('0x30')](saveUpdates(_0x24269e[_0x4520('0x53')],null))[_0x4520('0x30')](function(_0xff7d4b){if(_0xff7d4b){_0x1549cc=_0xff7d4b[_0x4520('0x54')]({'plain':!![]});var _0x2b09a1=fs[_0x4520('0x55')](path[_0x4520('0x56')](config[_0x4520('0x57')],_0x4520('0x58')),_0x4520('0x59'));var _0x2f11d9=ejs[_0x4520('0x5a')](_0x2b09a1,_0x1549cc);var _0x2d2e04=fs[_0x4520('0x55')](path[_0x4520('0x56')](config['root'],'server/files/templates/turn.ejs'),_0x4520('0x59'));var _0x35defa=ejs[_0x4520('0x5a')](_0x2d2e04,_0x1549cc);fs[_0x4520('0x5b')](_0x4520('0x5c'),_0x2f11d9);fs[_0x4520('0x5b')]('/etc/asterisk/turn_xcally.conf',_0x35defa);return respondWithRpcPromise(_0x4520('0x5d'),_0x4520('0x52'),{'module':'res_stun_monitor.so'});}})[_0x4520('0x30')](function(){return respondWithRpcPromise(_0x4520('0x5d'),_0x4520('0x52'),{'module':_0x4520('0x5e')});})['then'](function(){return _0x1549cc||null;})[_0x4520('0x30')](respondWithResult(_0x379da4,null))[_0x4520('0x51')](handleError(_0x379da4,null));};exports['addLogo']=function(_0x4c7172,_0x347130,_0x83cac1){if(_0x4c7172[_0x4520('0x5f')]&&_0x4c7172[_0x4520('0x5f')][_0x4520('0x60')]){_0x4c7172[_0x4520('0x53')]['logo']=_0x4c7172[_0x4520('0x5f')][_0x4520('0x60')];}return db[_0x4520('0x49')][_0x4520('0x50')]({'where':{'id':_0x4c7172['params']['id']}})[_0x4520('0x30')](handleEntityNotFound(_0x347130,null))[_0x4520('0x30')](saveUpdates(_0x4c7172['body'],null))[_0x4520('0x30')](respondWithResult(_0x347130,null))['catch'](handleError(_0x347130,null));};exports[_0x4520('0x61')]=function(_0xadedd0,_0x3b2992,_0x2db2b5){if(_0xadedd0['file']&&_0xadedd0[_0x4520('0x5f')][_0x4520('0x60')]){_0xadedd0[_0x4520('0x53')][_0x4520('0x62')]=_0xadedd0['file'][_0x4520('0x60')];}return db[_0x4520('0x49')][_0x4520('0x50')]({'where':{'id':_0xadedd0[_0x4520('0x4e')]['id']}})[_0x4520('0x30')](handleEntityNotFound(_0x3b2992,null))[_0x4520('0x30')](saveUpdates(_0xadedd0['body'],null))[_0x4520('0x30')](respondWithResult(_0x3b2992,null))['catch'](handleError(_0x3b2992,null));};var utilLicense=require(_0x4520('0x63'));exports[_0x4520('0x64')]=function(_0x243aeb,_0x22c06f,_0x393da3){var _0x41a204='server/files/images/logos';var _0x4d5085={'custom':![]};return utilLicense[_0x4520('0x65')]()['then'](function(_0x1aa804){if(_0x1aa804){_0x4d5085=_0x1aa804;}return db[_0x4520('0x49')][_0x4520('0x50')]({'where':{'id':_0x243aeb[_0x4520('0x4e')]['id']},'attributes':[_0x4520('0x66'),_0x4520('0x62'),_0x4520('0x67'),_0x4520('0x68'),_0x4520('0x69'),'defaultPreferred'],'raw':!![]});})[_0x4520('0x30')](handleEntityNotFound(_0x22c06f,null))['then'](function(_0x77f14e){if(_0x77f14e){var _0x116328=_0x77f14e[_0x4520('0x66')]&&fs[_0x4520('0x6a')](path[_0x4520('0x56')](config['root'],_0x41a204,_[_0x4520('0x6b')](_0x77f14e[_0x4520('0x66')])))?path[_0x4520('0x56')](config[_0x4520('0x57')],_0x41a204,_['toLower'](_0x77f14e['logo'])):path['join'](config[_0x4520('0x57')],_0x41a204,_[_0x4520('0x6b')](_0x4520('0x6c')));var _0x5cf8b9=_0x4520('0x6d')+_[_0x4520('0x6e')](_0x4520('0x66'));if(_0x77f14e[_0x5cf8b9]||!_0x4d5085[_0x4520('0x6f')]){_0x116328=path[_0x4520('0x56')](config['root'],_0x41a204,_[_0x4520('0x6b')](_0x4520('0x6c')));}if(!fs[_0x4520('0x6a')](_0x116328)){throw new db['Sequelize'][(_0x4520('0x70'))](_0x4520('0x71'));}return _0x22c06f[_0x4520('0x72')](_0x116328);}})[_0x4520('0x51')](handleError(_0x22c06f,null));};var utilLicense=require(_0x4520('0x63'));exports[_0x4520('0x73')]=function(_0x3a1630,_0x156118,_0x524942){var _0x5d7fc4=_0x4520('0x74');var _0x41020c={'custom':![]};return utilLicense['getLicense']()[_0x4520('0x30')](function(_0x502590){if(_0x502590){_0x41020c=_0x502590;}return db[_0x4520('0x49')][_0x4520('0x50')]({'where':{'id':_0x3a1630['params']['id']},'attributes':[_0x4520('0x66'),_0x4520('0x62'),'preferred',_0x4520('0x68'),_0x4520('0x69'),'defaultPreferred'],'raw':!![]});})[_0x4520('0x30')](handleEntityNotFound(_0x156118,null))[_0x4520('0x30')](function(_0x23011d){if(_0x23011d){var _0x4aebbf=_0x23011d[_0x4520('0x62')]&&fs[_0x4520('0x6a')](path[_0x4520('0x56')](config[_0x4520('0x57')],_0x5d7fc4,_[_0x4520('0x6b')](_0x23011d[_0x4520('0x62')])))?path[_0x4520('0x56')](config[_0x4520('0x57')],_0x5d7fc4,_[_0x4520('0x6b')](_0x23011d[_0x4520('0x62')])):path[_0x4520('0x56')](config[_0x4520('0x57')],_0x5d7fc4,_['toLower']('default_loginLogo.png'));var _0x3d4262='default'+_[_0x4520('0x6e')](_0x4520('0x62'));if(_0x23011d[_0x3d4262]||!_0x41020c[_0x4520('0x6f')]){_0x4aebbf=path[_0x4520('0x56')](config[_0x4520('0x57')],_0x5d7fc4,_['toLower']('default_loginLogo.png'));}if(!fs[_0x4520('0x6a')](_0x4aebbf)){throw new db[(_0x4520('0x75'))][(_0x4520('0x70'))](_0x4520('0x71'));}return _0x156118[_0x4520('0x72')](_0x4aebbf);}})[_0x4520('0x51')](handleError(_0x156118,null));};exports['gdpr']=function(_0x3f7e56,_0x271a16){return db['Setting'][_0x4520('0x50')]({'where':{'id':_0x3f7e56['params']['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x271a16,null))[_0x4520('0x51')](handleError(_0x271a16,null));};exports[_0x4520('0x76')]=function(_0x74297e,_0x454b8c,_0x422008){if(_0x74297e['file']&&_0x74297e[_0x4520('0x5f')][_0x4520('0x60')]){_0x74297e['body']['preferred']=_0x74297e[_0x4520('0x5f')][_0x4520('0x60')];}return db[_0x4520('0x49')]['find']({'where':{'id':_0x74297e[_0x4520('0x4e')]['id']}})[_0x4520('0x30')](handleEntityNotFound(_0x454b8c,null))[_0x4520('0x30')](saveUpdates(_0x74297e['body'],null))[_0x4520('0x30')](respondWithResult(_0x454b8c,null))[_0x4520('0x51')](handleError(_0x454b8c,null));};var utilLicense=require('../../config/license/util');exports[_0x4520('0x77')]=function(_0x5a8265,_0x14496a,_0x388177){var _0x3e53d7=_0x4520('0x74');var _0x45c0a0={'custom':![]};return utilLicense[_0x4520('0x65')]()[_0x4520('0x30')](function(_0x485a9a){if(_0x485a9a){_0x45c0a0=_0x485a9a;}return db[_0x4520('0x49')]['find']({'where':{'id':_0x5a8265[_0x4520('0x4e')]['id']},'attributes':[_0x4520('0x66'),'loginLogo',_0x4520('0x67'),_0x4520('0x68'),_0x4520('0x69'),_0x4520('0x78')],'raw':!![]});})[_0x4520('0x30')](handleEntityNotFound(_0x14496a,null))[_0x4520('0x30')](function(_0x1c7ce6){if(_0x1c7ce6){var _0x1044c6=_0x1c7ce6[_0x4520('0x67')]&&fs[_0x4520('0x6a')](path[_0x4520('0x56')](config['root'],_0x3e53d7,_['toLower'](_0x1c7ce6['preferred'])))?path['join'](config['root'],_0x3e53d7,_[_0x4520('0x6b')](_0x1c7ce6[_0x4520('0x67')])):path[_0x4520('0x56')](config[_0x4520('0x57')],_0x3e53d7,_['toLower'](_0x4520('0x79')));var _0x5f0d99=_0x4520('0x6d')+_['upperFirst'](_0x4520('0x67'));if(_0x1c7ce6[_0x5f0d99]||!_0x45c0a0['custom']||!_0x45c0a0[_0x4520('0x67')]){_0x1044c6=path[_0x4520('0x56')](config[_0x4520('0x57')],_0x3e53d7,_[_0x4520('0x6b')]('default_preferred.png'));}if(!fs[_0x4520('0x6a')](_0x1044c6)){throw new db['Sequelize'][(_0x4520('0x70'))](_0x4520('0x71'));}return _0x14496a[_0x4520('0x72')](_0x1044c6);}})[_0x4520('0x51')](handleError(_0x14496a,null));}; \ No newline at end of file +var _0x3cae=['root','server/files/templates/stun.ejs','render','readFileSync','server/files/templates/turn.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','filename','logo','file','body','addLogoLogin','loginLogo','../../config/license/util','getLicense','preferred','defaultLogo','defaultPreferred','existsSync','toLower','default_logo.png','upperFirst','custom','Sequelize','ValidationError','download','getLogoLogin','defaultLoginLogo','default_loginLogo.png','default','Logo\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','server/files/images/logos','default_preferred.png','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','save','update','stack','name','send','index','Setting','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','field','options','count','include','show','params','includeAll','find','get','join'];(function(_0x3dc9ca,_0x27d22d){var _0x34e736=function(_0x34cdad){while(--_0x34cdad){_0x3dc9ca['push'](_0x3dc9ca['shift']());}};_0x34e736(++_0x27d22d);}(_0x3cae,0x117));var _0xe3ca=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x3cae[_0x1e3c16];return _0x47a0c9;};'use strict';var pdf=require(_0xe3ca('0x0'));var emlformat=require(_0xe3ca('0x1'));var rimraf=require(_0xe3ca('0x2'));var zipdir=require(_0xe3ca('0x3'));var jsonpatch=require(_0xe3ca('0x4'));var rp=require(_0xe3ca('0x5'));var moment=require(_0xe3ca('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xe3ca('0x7'));var util=require(_0xe3ca('0x8'));var path=require('path');var sox=require(_0xe3ca('0x9'));var csv=require('to-csv');var ejs=require(_0xe3ca('0xa'));var fs=require('fs');var _=require(_0xe3ca('0xb'));var squel=require(_0xe3ca('0xc'));var crypto=require('crypto');var jsforce=require(_0xe3ca('0xd'));var deskjs=require(_0xe3ca('0xe'));var toCsv=require(_0xe3ca('0xf'));var querystring=require(_0xe3ca('0x10'));var Papa=require(_0xe3ca('0x11'));var authService=require(_0xe3ca('0x12'));var hardwareService=require(_0xe3ca('0x13'));var Redis=require('ioredis');var qs=require(_0xe3ca('0x14'));var logger=require('../../config/logger')(_0xe3ca('0x15'));var utils=require(_0xe3ca('0x16'));var config=require(_0xe3ca('0x17'));var db=require(_0xe3ca('0x18'))['db'];var jayson=require(_0xe3ca('0x19'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ff241,_0x5f1c02,_0x35b0f1,_0xb3af46){return new BPromise(function(_0x4857f0,_0x3d62e2){var _0x3a9455=_0xb3af46||client;return _0x3a9455[_0xe3ca('0x1a')](_0x3ff241,_0x35b0f1)[_0xe3ca('0x1b')](function(_0x9ef773){logger[_0xe3ca('0x1c')](_0xe3ca('0x1d'),_0x5f1c02,_0xe3ca('0x1e'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x5f1c02,_0xe3ca('0x1e'),JSON[_0xe3ca('0x1f')](_0x9ef773));if(_0x9ef773[_0xe3ca('0x20')]){if(_0x9ef773[_0xe3ca('0x20')][_0xe3ca('0x21')]===0x1f4){logger[_0xe3ca('0x20')]('Setting,\x20%s,\x20%s',_0x5f1c02,_0x9ef773[_0xe3ca('0x20')][_0xe3ca('0x22')]);return _0x3d62e2(_0x9ef773[_0xe3ca('0x20')]['message']);}logger['error']('Setting,\x20%s,\x20%s',_0x5f1c02,_0x9ef773[_0xe3ca('0x20')]['message']);return _0x4857f0(_0x9ef773['error'][_0xe3ca('0x22')]);}else{logger[_0xe3ca('0x1c')](_0xe3ca('0x1d'),_0x5f1c02,_0xe3ca('0x1e'));_0x4857f0(_0x9ef773[_0xe3ca('0x23')]['message']);}})[_0xe3ca('0x24')](function(_0x3ab26e){logger['error'](_0xe3ca('0x1d'),_0x5f1c02,_0x3ab26e);_0x3d62e2(_0x3ab26e);});});}function respondWithStatusCode(_0x2d732f,_0x33dc04){_0x33dc04=_0x33dc04||0xcc;return function(_0xd681a7){if(_0xd681a7){return _0x2d732f[_0xe3ca('0x25')](_0x33dc04);}return _0x2d732f[_0xe3ca('0x26')](_0x33dc04)[_0xe3ca('0x27')]();};}function respondWithResult(_0x25b39e,_0x477ec7){_0x477ec7=_0x477ec7||0xc8;return function(_0x2fafd9){if(_0x2fafd9){return _0x25b39e[_0xe3ca('0x26')](_0x477ec7)['json'](_0x2fafd9);}};}function respondWithFilteredResult(_0x16e1d6,_0x5740af){return function(_0x11ec88){if(_0x11ec88){var _0x2fffe4=_0x11ec88['count'],_0x3de0ef=_0x5740af[_0xe3ca('0x28')],_0x452096=_0x5740af[_0xe3ca('0x28')]+_0x5740af[_0xe3ca('0x29')],_0x576491;if(_0x452096>=_0x2fffe4){_0x452096=_0x2fffe4;_0x576491=0xc8;}else{_0x576491=0xce;}_0x16e1d6['status'](_0x576491);return _0x16e1d6[_0xe3ca('0x2a')](_0xe3ca('0x2b'),_0x3de0ef+'-'+_0x452096+'/'+_0x2fffe4)[_0xe3ca('0x2c')](_0x11ec88);}return null;};}function patchUpdates(_0x17d3c7){return function(_0x532662){try{jsonpatch['apply'](_0x532662,_0x17d3c7,!![]);}catch(_0xf90c19){return BPromise['reject'](_0xf90c19);}return _0x532662[_0xe3ca('0x2d')]();};}function saveUpdates(_0x5cf384,_0x5576b4){return function(_0xd5e714){if(_0xd5e714){return _0xd5e714[_0xe3ca('0x2e')](_0x5cf384)[_0xe3ca('0x1b')](function(_0x51c5b5){return _0x51c5b5;});}return null;};}function removeEntity(_0x12e51d,_0x5ee00b){return function(_0x11dd1d){if(_0x11dd1d){return _0x11dd1d['destroy']()['then'](function(){_0x12e51d[_0xe3ca('0x26')](0xcc)[_0xe3ca('0x27')]();});}};}function handleEntityNotFound(_0x896c0b,_0x2f0cb9){return function(_0x1143ca){if(!_0x1143ca){_0x896c0b[_0xe3ca('0x25')](0x194);}return _0x1143ca;};}function handleError(_0x1e8145,_0x4417d9){_0x4417d9=_0x4417d9||0x1f4;return function(_0x1b9931){logger[_0xe3ca('0x20')](_0x1b9931[_0xe3ca('0x2f')]);if(_0x1b9931[_0xe3ca('0x30')]){delete _0x1b9931['name'];}_0x1e8145[_0xe3ca('0x26')](_0x4417d9)[_0xe3ca('0x31')](_0x1b9931);};}exports[_0xe3ca('0x32')]=function(_0xf3a1d2,_0xdf7c28){var _0x3aeba2={},_0x59413d={},_0x125e03={'count':0x0,'rows':[]};var _0x2bc3fc=db[_0xe3ca('0x33')][_0xe3ca('0x34')];_0x59413d[_0xe3ca('0x35')]=_[_0xe3ca('0x36')](_0x2bc3fc);_0x59413d[_0xe3ca('0x37')]=_[_0xe3ca('0x36')](_0xf3a1d2[_0xe3ca('0x37')]);_0x59413d['filters']=_[_0xe3ca('0x38')](_0x59413d[_0xe3ca('0x35')],_0x59413d['query']);_0x3aeba2[_0xe3ca('0x39')]=_[_0xe3ca('0x38')](_0x59413d[_0xe3ca('0x35')],qs['fields'](_0xf3a1d2[_0xe3ca('0x37')][_0xe3ca('0x3a')]));_0x3aeba2['attributes']=_0x3aeba2[_0xe3ca('0x39')]['length']?_0x3aeba2['attributes']:_0x59413d[_0xe3ca('0x35')];if(!_0xf3a1d2[_0xe3ca('0x37')]['hasOwnProperty'](_0xe3ca('0x3b'))){_0x3aeba2[_0xe3ca('0x29')]=qs[_0xe3ca('0x29')](_0xf3a1d2[_0xe3ca('0x37')][_0xe3ca('0x29')]);_0x3aeba2[_0xe3ca('0x28')]=qs[_0xe3ca('0x28')](_0xf3a1d2[_0xe3ca('0x37')][_0xe3ca('0x28')]);}_0x3aeba2['order']=qs[_0xe3ca('0x3c')](_0xf3a1d2[_0xe3ca('0x37')][_0xe3ca('0x3c')]);_0x3aeba2[_0xe3ca('0x3d')]=qs[_0xe3ca('0x3e')](_[_0xe3ca('0x3f')](_0xf3a1d2[_0xe3ca('0x37')],_0x59413d[_0xe3ca('0x3e')]));if(_0xf3a1d2[_0xe3ca('0x37')][_0xe3ca('0x40')]){_0x3aeba2[_0xe3ca('0x3d')]=_[_0xe3ca('0x41')](_0x3aeba2[_0xe3ca('0x3d')],{'$or':_['map'](_0x2bc3fc,function(_0x275010){if(_0x275010[_0xe3ca('0x42')]['key']!==_0xe3ca('0x43')){var _0x312ee7={};_0x312ee7[_0x275010[_0xe3ca('0x44')]]={'$like':'%'+_0xf3a1d2[_0xe3ca('0x37')][_0xe3ca('0x40')]+'%'};return _0x312ee7;}})});}_0x3aeba2=_[_0xe3ca('0x41')]({},_0x3aeba2,_0xf3a1d2[_0xe3ca('0x45')]);var _0x210e45={'where':_0x3aeba2[_0xe3ca('0x3d')]};return db[_0xe3ca('0x33')][_0xe3ca('0x46')](_0x210e45)['then'](function(_0xe21aca){_0x125e03[_0xe3ca('0x46')]=_0xe21aca;if(_0xf3a1d2['query']['includeAll']){_0x3aeba2[_0xe3ca('0x47')]=[{'all':!![]}];}return db[_0xe3ca('0x33')]['findAll'](_0x3aeba2);})[_0xe3ca('0x1b')](function(_0x31b4f7){_0x125e03['rows']=_0x31b4f7;return _0x125e03;})['then'](respondWithFilteredResult(_0xdf7c28,_0x3aeba2))[_0xe3ca('0x24')](handleError(_0xdf7c28,null));};exports[_0xe3ca('0x48')]=function(_0xf8c0ad,_0x409c60){var _0x139c91={'raw':![],'where':{'id':_0xf8c0ad[_0xe3ca('0x49')]['id']}},_0x5242f6={};_0x5242f6[_0xe3ca('0x35')]=_[_0xe3ca('0x36')](db[_0xe3ca('0x33')][_0xe3ca('0x34')]);_0x5242f6[_0xe3ca('0x37')]=_[_0xe3ca('0x36')](_0xf8c0ad[_0xe3ca('0x37')]);_0x5242f6[_0xe3ca('0x3e')]=_['intersection'](_0x5242f6['model'],_0x5242f6['query']);_0x139c91[_0xe3ca('0x39')]=_[_0xe3ca('0x38')](_0x5242f6[_0xe3ca('0x35')],qs['fields'](_0xf8c0ad['query'][_0xe3ca('0x3a')]));_0x139c91[_0xe3ca('0x39')]=_0x139c91[_0xe3ca('0x39')]['length']?_0x139c91['attributes']:_0x5242f6[_0xe3ca('0x35')];if(_0xf8c0ad['query'][_0xe3ca('0x4a')]){_0x139c91[_0xe3ca('0x47')]=[{'all':!![]}];}_0x139c91=_[_0xe3ca('0x41')]({},_0x139c91,_0xf8c0ad[_0xe3ca('0x45')]);return db[_0xe3ca('0x33')][_0xe3ca('0x4b')](_0x139c91)[_0xe3ca('0x1b')](handleEntityNotFound(_0x409c60,null))[_0xe3ca('0x1b')](respondWithResult(_0x409c60,null))[_0xe3ca('0x24')](handleError(_0x409c60,null));};exports[_0xe3ca('0x2e')]=function(_0x187220,_0x51d29f,_0xf2cee7){var _0x466be2;return db['Setting'][_0xe3ca('0x4b')]({'where':{'id':_0x187220[_0xe3ca('0x49')]['id']}})[_0xe3ca('0x1b')](handleEntityNotFound(_0x51d29f,null))[_0xe3ca('0x1b')](saveUpdates(_0x187220['body'],null))['then'](function(_0x2e0a7c){if(_0x2e0a7c){_0x466be2=_0x2e0a7c[_0xe3ca('0x4c')]({'plain':!![]});var _0x45109f=fs['readFileSync'](path[_0xe3ca('0x4d')](config[_0xe3ca('0x4e')],_0xe3ca('0x4f')),'utf8');var _0x1b650e=ejs[_0xe3ca('0x50')](_0x45109f,_0x466be2);var _0x27cef9=fs[_0xe3ca('0x51')](path[_0xe3ca('0x4d')](config[_0xe3ca('0x4e')],_0xe3ca('0x52')),_0xe3ca('0x53'));var _0x402c92=ejs['render'](_0x27cef9,_0x466be2);fs[_0xe3ca('0x54')](_0xe3ca('0x55'),_0x1b650e);fs[_0xe3ca('0x54')](_0xe3ca('0x56'),_0x402c92);return respondWithRpcPromise(_0xe3ca('0x57'),_0xe3ca('0x2e'),{'module':_0xe3ca('0x58')});}})['then'](function(){return respondWithRpcPromise(_0xe3ca('0x57'),_0xe3ca('0x2e'),{'module':'res_rtp_asterisk.so'});})[_0xe3ca('0x1b')](function(){return _0x466be2||null;})[_0xe3ca('0x1b')](respondWithResult(_0x51d29f,null))['catch'](handleError(_0x51d29f,null));};exports['addLogo']=function(_0x213c59,_0x320665,_0xec2366){if(_0x213c59['file']&&_0x213c59['file'][_0xe3ca('0x59')]){_0x213c59['body'][_0xe3ca('0x5a')]=_0x213c59[_0xe3ca('0x5b')][_0xe3ca('0x59')];}return db[_0xe3ca('0x33')][_0xe3ca('0x4b')]({'where':{'id':_0x213c59[_0xe3ca('0x49')]['id']}})[_0xe3ca('0x1b')](handleEntityNotFound(_0x320665,null))[_0xe3ca('0x1b')](saveUpdates(_0x213c59[_0xe3ca('0x5c')],null))[_0xe3ca('0x1b')](respondWithResult(_0x320665,null))['catch'](handleError(_0x320665,null));};exports[_0xe3ca('0x5d')]=function(_0x223899,_0x28ccd6,_0x32c62a){if(_0x223899[_0xe3ca('0x5b')]&&_0x223899['file'][_0xe3ca('0x59')]){_0x223899[_0xe3ca('0x5c')][_0xe3ca('0x5e')]=_0x223899[_0xe3ca('0x5b')][_0xe3ca('0x59')];}return db[_0xe3ca('0x33')][_0xe3ca('0x4b')]({'where':{'id':_0x223899[_0xe3ca('0x49')]['id']}})[_0xe3ca('0x1b')](handleEntityNotFound(_0x28ccd6,null))[_0xe3ca('0x1b')](saveUpdates(_0x223899[_0xe3ca('0x5c')],null))['then'](respondWithResult(_0x28ccd6,null))['catch'](handleError(_0x28ccd6,null));};var utilLicense=require(_0xe3ca('0x5f'));exports['getLogo']=function(_0x395c08,_0x138285,_0x225fbf){var _0x2f3ddc='server/files/images/logos';var _0x30acba={'custom':![]};return utilLicense[_0xe3ca('0x60')]()['then'](function(_0x5e042b){if(_0x5e042b){_0x30acba=_0x5e042b;}return db[_0xe3ca('0x33')][_0xe3ca('0x4b')]({'where':{'id':_0x395c08[_0xe3ca('0x49')]['id']},'attributes':[_0xe3ca('0x5a'),_0xe3ca('0x5e'),_0xe3ca('0x61'),_0xe3ca('0x62'),'defaultLoginLogo',_0xe3ca('0x63')],'raw':!![]});})[_0xe3ca('0x1b')](handleEntityNotFound(_0x138285,null))[_0xe3ca('0x1b')](function(_0x26829c){if(_0x26829c){var _0x4da4f1=_0x26829c['logo']&&fs[_0xe3ca('0x64')](path[_0xe3ca('0x4d')](config[_0xe3ca('0x4e')],_0x2f3ddc,_[_0xe3ca('0x65')](_0x26829c[_0xe3ca('0x5a')])))?path['join'](config[_0xe3ca('0x4e')],_0x2f3ddc,_[_0xe3ca('0x65')](_0x26829c[_0xe3ca('0x5a')])):path[_0xe3ca('0x4d')](config[_0xe3ca('0x4e')],_0x2f3ddc,_[_0xe3ca('0x65')](_0xe3ca('0x66')));var _0x7c1f3a='default'+_[_0xe3ca('0x67')](_0xe3ca('0x5a'));if(_0x26829c[_0x7c1f3a]||!_0x30acba[_0xe3ca('0x68')]){_0x4da4f1=path[_0xe3ca('0x4d')](config[_0xe3ca('0x4e')],_0x2f3ddc,_[_0xe3ca('0x65')]('default_logo.png'));}if(!fs[_0xe3ca('0x64')](_0x4da4f1)){throw new db[(_0xe3ca('0x69'))][(_0xe3ca('0x6a'))]('Logo\x20not\x20found');}return _0x138285[_0xe3ca('0x6b')](_0x4da4f1);}})[_0xe3ca('0x24')](handleError(_0x138285,null));};var utilLicense=require('../../config/license/util');exports[_0xe3ca('0x6c')]=function(_0x3f12b9,_0x323af2,_0xf48d34){var _0x44d3e8='server/files/images/logos';var _0x405d8f={'custom':![]};return utilLicense[_0xe3ca('0x60')]()['then'](function(_0x126461){if(_0x126461){_0x405d8f=_0x126461;}return db[_0xe3ca('0x33')]['find']({'where':{'id':_0x3f12b9[_0xe3ca('0x49')]['id']},'attributes':[_0xe3ca('0x5a'),'loginLogo',_0xe3ca('0x61'),_0xe3ca('0x62'),_0xe3ca('0x6d'),_0xe3ca('0x63')],'raw':!![]});})[_0xe3ca('0x1b')](handleEntityNotFound(_0x323af2,null))[_0xe3ca('0x1b')](function(_0x18f212){if(_0x18f212){var _0x5a122b=_0x18f212['loginLogo']&&fs[_0xe3ca('0x64')](path[_0xe3ca('0x4d')](config[_0xe3ca('0x4e')],_0x44d3e8,_[_0xe3ca('0x65')](_0x18f212['loginLogo'])))?path[_0xe3ca('0x4d')](config['root'],_0x44d3e8,_[_0xe3ca('0x65')](_0x18f212[_0xe3ca('0x5e')])):path[_0xe3ca('0x4d')](config[_0xe3ca('0x4e')],_0x44d3e8,_[_0xe3ca('0x65')](_0xe3ca('0x6e')));var _0xc605d7=_0xe3ca('0x6f')+_[_0xe3ca('0x67')]('loginLogo');if(_0x18f212[_0xc605d7]||!_0x405d8f['custom']){_0x5a122b=path['join'](config[_0xe3ca('0x4e')],_0x44d3e8,_['toLower'](_0xe3ca('0x6e')));}if(!fs['existsSync'](_0x5a122b)){throw new db[(_0xe3ca('0x69'))]['ValidationError'](_0xe3ca('0x70'));}return _0x323af2[_0xe3ca('0x6b')](_0x5a122b);}})[_0xe3ca('0x24')](handleError(_0x323af2,null));};exports[_0xe3ca('0x71')]=function(_0x534cbc,_0x5dc26a){return db[_0xe3ca('0x33')][_0xe3ca('0x4b')]({'where':{'id':_0x534cbc[_0xe3ca('0x49')]['id']},'attributes':[_0xe3ca('0x72')]})[_0xe3ca('0x1b')](respondWithResult(_0x5dc26a,null))[_0xe3ca('0x24')](handleError(_0x5dc26a,null));};exports[_0xe3ca('0x73')]=function(_0x435e60,_0x3a22dd,_0x1c6959){if(_0x435e60['file']&&_0x435e60[_0xe3ca('0x5b')][_0xe3ca('0x59')]){_0x435e60[_0xe3ca('0x5c')][_0xe3ca('0x61')]=_0x435e60[_0xe3ca('0x5b')]['filename'];}return db[_0xe3ca('0x33')][_0xe3ca('0x4b')]({'where':{'id':_0x435e60[_0xe3ca('0x49')]['id']}})[_0xe3ca('0x1b')](handleEntityNotFound(_0x3a22dd,null))[_0xe3ca('0x1b')](saveUpdates(_0x435e60['body'],null))['then'](respondWithResult(_0x3a22dd,null))[_0xe3ca('0x24')](handleError(_0x3a22dd,null));};var utilLicense=require(_0xe3ca('0x5f'));exports[_0xe3ca('0x74')]=function(_0x201f1c,_0x17148d,_0x5e56e7){var _0x3b16df=_0xe3ca('0x75');var _0x8237dc={'custom':![]};return utilLicense[_0xe3ca('0x60')]()['then'](function(_0x1476de){if(_0x1476de){_0x8237dc=_0x1476de;}return db[_0xe3ca('0x33')]['find']({'where':{'id':_0x201f1c[_0xe3ca('0x49')]['id']},'attributes':[_0xe3ca('0x5a'),_0xe3ca('0x5e'),_0xe3ca('0x61'),'defaultLogo',_0xe3ca('0x6d'),'defaultPreferred'],'raw':!![]});})['then'](handleEntityNotFound(_0x17148d,null))['then'](function(_0x49028b){if(_0x49028b){var _0x5e7ad3=_0x49028b['preferred']&&fs[_0xe3ca('0x64')](path['join'](config[_0xe3ca('0x4e')],_0x3b16df,_[_0xe3ca('0x65')](_0x49028b[_0xe3ca('0x61')])))?path[_0xe3ca('0x4d')](config[_0xe3ca('0x4e')],_0x3b16df,_[_0xe3ca('0x65')](_0x49028b[_0xe3ca('0x61')])):path[_0xe3ca('0x4d')](config[_0xe3ca('0x4e')],_0x3b16df,_['toLower']('default_preferred.png'));var _0x19f7d3=_0xe3ca('0x6f')+_[_0xe3ca('0x67')](_0xe3ca('0x61'));if(_0x49028b[_0x19f7d3]||!_0x8237dc[_0xe3ca('0x68')]||!_0x8237dc[_0xe3ca('0x61')]){_0x5e7ad3=path[_0xe3ca('0x4d')](config[_0xe3ca('0x4e')],_0x3b16df,_[_0xe3ca('0x65')](_0xe3ca('0x76')));}if(!fs['existsSync'](_0x5e7ad3)){throw new db['Sequelize'][(_0xe3ca('0x6a'))](_0xe3ca('0x70'));}return _0x17148d[_0xe3ca('0x6b')](_0x5e7ad3);}})[_0xe3ca('0x24')](handleError(_0x17148d,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index d7449ff..03c1047 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 _0x8944=['request-promise','./setting.attributes','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5499fa,_0x3976a8){var _0x1cdd86=function(_0x1b1979){while(--_0x1b1979){_0x5499fa['push'](_0x5499fa['shift']());}};_0x1cdd86(++_0x3976a8);}(_0x8944,0xd7));var _0x4894=function(_0x40ecdc,_0x5e841c){_0x40ecdc=_0x40ecdc-0x0;var _0x496d04=_0x8944[_0x40ecdc];return _0x496d04;};'use strict';var _=require(_0x4894('0x0'));var util=require('util');var logger=require(_0x4894('0x1'))(_0x4894('0x2'));var moment=require(_0x4894('0x3'));var BPromise=require(_0x4894('0x4'));var rp=require(_0x4894('0x5'));var attributes=require(_0x4894('0x6'));module['exports']=function(_0x3fa502,_0x33f6e9){return _0x3fa502[_0x4894('0x7')](_0x4894('0x8'),attributes,{'tableName':_0x4894('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6cc=['./setting.attributes','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x149a9b,_0x5bb275){var _0x2c2bf6=function(_0xfe0c14){while(--_0xfe0c14){_0x149a9b['push'](_0x149a9b['shift']());}};_0x2c2bf6(++_0x5bb275);}(_0xd6cc,0x16c));var _0xcd6c=function(_0x17e74a,_0x26b6c1){_0x17e74a=_0x17e74a-0x0;var _0x3dd6c5=_0xd6cc[_0x17e74a];return _0x3dd6c5;};'use strict';var _=require(_0xcd6c('0x0'));var util=require('util');var logger=require(_0xcd6c('0x1'))(_0xcd6c('0x2'));var moment=require(_0xcd6c('0x3'));var BPromise=require(_0xcd6c('0x4'));var rp=require(_0xcd6c('0x5'));var attributes=require(_0xcd6c('0x6'));module['exports']=function(_0x1183e0,_0xc2b44a){return _0x1183e0[_0xcd6c('0x7')](_0xcd6c('0x8'),attributes,{'tableName':_0xcd6c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index b7e478d..394daaf 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 _0x2f9a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x3d4cec,_0x3f6bdb){var _0x59559f=function(_0x81f568){while(--_0x81f568){_0x3d4cec['push'](_0x3d4cec['shift']());}};_0x59559f(++_0x3f6bdb);}(_0x2f9a,0xdf));var _0xa2f9=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0x2f9a[_0x3f2228];return _0x285ae4;};'use strict';var _=require(_0xa2f9('0x0'));var util=require(_0xa2f9('0x1'));var moment=require(_0xa2f9('0x2'));var BPromise=require(_0xa2f9('0x3'));var rs=require(_0xa2f9('0x4'));var fs=require('fs');var Redis=require(_0xa2f9('0x5'));var db=require(_0xa2f9('0x6'))['db'];var utils=require(_0xa2f9('0x7'));var logger=require(_0xa2f9('0x8'))(_0xa2f9('0x9'));var config=require(_0xa2f9('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa2f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17eeed,_0xff76e9,_0x2ac335){return new BPromise(function(_0x4061e6,_0x3d46b1){return client[_0xa2f9('0xc')](_0x17eeed,_0x2ac335)[_0xa2f9('0xd')](function(_0x27d14c){logger[_0xa2f9('0xe')](_0xa2f9('0xf'),_0xff76e9,'request\x20sent');logger[_0xa2f9('0x10')](_0xa2f9('0x11'),_0xff76e9,_0xa2f9('0x12'),JSON[_0xa2f9('0x13')](_0x27d14c));if(_0x27d14c[_0xa2f9('0x14')]){if(_0x27d14c[_0xa2f9('0x14')][_0xa2f9('0x15')]===0x1f4){logger[_0xa2f9('0x14')](_0xa2f9('0xf'),_0xff76e9,_0x27d14c['error']['message']);return _0x3d46b1(_0x27d14c[_0xa2f9('0x14')][_0xa2f9('0x16')]);}logger[_0xa2f9('0x14')]('Setting,\x20%s,\x20%s',_0xff76e9,_0x27d14c[_0xa2f9('0x14')][_0xa2f9('0x16')]);return _0x4061e6(_0x27d14c[_0xa2f9('0x14')][_0xa2f9('0x16')]);}else{logger[_0xa2f9('0xe')](_0xa2f9('0xf'),_0xff76e9,_0xa2f9('0x12'));_0x4061e6(_0x27d14c[_0xa2f9('0x17')][_0xa2f9('0x16')]);}})[_0xa2f9('0x18')](function(_0x38d08c){logger[_0xa2f9('0x14')](_0xa2f9('0xf'),_0xff76e9,_0x38d08c);_0x3d46b1(_0x38d08c);});});} \ No newline at end of file +var _0xc8e6=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','Setting,\x20%s,\x20%s','message','info','catch'];(function(_0x540ecc,_0x3dab5d){var _0x1ad207=function(_0x17989d){while(--_0x17989d){_0x540ecc['push'](_0x540ecc['shift']());}};_0x1ad207(++_0x3dab5d);}(_0xc8e6,0xf2));var _0x6c8e=function(_0x115fc9,_0x22021c){_0x115fc9=_0x115fc9-0x0;var _0x2d4bc2=_0xc8e6[_0x115fc9];return _0x2d4bc2;};'use strict';var _=require(_0x6c8e('0x0'));var util=require(_0x6c8e('0x1'));var moment=require(_0x6c8e('0x2'));var BPromise=require(_0x6c8e('0x3'));var rs=require(_0x6c8e('0x4'));var fs=require('fs');var Redis=require(_0x6c8e('0x5'));var db=require(_0x6c8e('0x6'))['db'];var utils=require(_0x6c8e('0x7'));var logger=require(_0x6c8e('0x8'))(_0x6c8e('0x9'));var config=require('../../config/environment');var jayson=require(_0x6c8e('0xa'));var client=jayson[_0x6c8e('0xb')][_0x6c8e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4194e8,_0x42def4,_0x29ba48){return new BPromise(function(_0x50f695,_0xedd697){return client[_0x6c8e('0xd')](_0x4194e8,_0x29ba48)[_0x6c8e('0xe')](function(_0x5bbc07){logger['info']('Setting,\x20%s,\x20%s',_0x42def4,_0x6c8e('0xf'));logger['debug'](_0x6c8e('0x10'),_0x42def4,'request\x20sent',JSON['stringify'](_0x5bbc07));if(_0x5bbc07[_0x6c8e('0x11')]){if(_0x5bbc07[_0x6c8e('0x11')]['code']===0x1f4){logger['error'](_0x6c8e('0x12'),_0x42def4,_0x5bbc07[_0x6c8e('0x11')][_0x6c8e('0x13')]);return _0xedd697(_0x5bbc07[_0x6c8e('0x11')][_0x6c8e('0x13')]);}logger['error'](_0x6c8e('0x12'),_0x42def4,_0x5bbc07['error'][_0x6c8e('0x13')]);return _0x50f695(_0x5bbc07[_0x6c8e('0x11')][_0x6c8e('0x13')]);}else{logger[_0x6c8e('0x14')](_0x6c8e('0x12'),_0x42def4,'request\x20sent');_0x50f695(_0x5bbc07['result'][_0x6c8e('0x13')]);}})[_0x6c8e('0x15')](function(_0x5e3be3){logger[_0x6c8e('0x11')]('Setting,\x20%s,\x20%s',_0x42def4,_0x5e3be3);_0xedd697(_0x5e3be3);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 91d1a18..7451686 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 _0x2bbe=['/:id/send','status','/:id/users','put','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','getAgents','post','create','addAnswer','notify','addApplications'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0x2bbe,0x1dd));var _0xe2bb=function(_0x1fc4cb,_0x195103){_0x1fc4cb=_0x1fc4cb-0x0;var _0x1dec71=_0x2bbe[_0x1fc4cb];return _0x1dec71;};'use strict';var multer=require(_0xe2bb('0x0'));var util=require(_0xe2bb('0x1'));var path=require(_0xe2bb('0x2'));var timeout=require(_0xe2bb('0x3'));var express=require(_0xe2bb('0x4'));var router=express[_0xe2bb('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe2bb('0x6'));var controller=require('./smsAccount.controller');router[_0xe2bb('0x7')]('/',auth[_0xe2bb('0x8')](),controller[_0xe2bb('0x9')]);router[_0xe2bb('0x7')](_0xe2bb('0xa'),auth[_0xe2bb('0x8')](),controller[_0xe2bb('0xb')]);router[_0xe2bb('0x7')](_0xe2bb('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xe2bb('0xd'),auth[_0xe2bb('0x8')](),controller[_0xe2bb('0xe')]);router['get'](_0xe2bb('0xf'),auth['isAuthenticated'](),controller[_0xe2bb('0x10')]);router[_0xe2bb('0x7')](_0xe2bb('0x11'),auth['isAuthenticated'](),controller[_0xe2bb('0x12')]);router[_0xe2bb('0x7')](_0xe2bb('0x13'),auth[_0xe2bb('0x8')](),controller['getInteractions']);router[_0xe2bb('0x7')](_0xe2bb('0x14'),controller['statusGet']);router[_0xe2bb('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0xe2bb('0x15')]);router[_0xe2bb('0x16')]('/',auth[_0xe2bb('0x8')](),controller[_0xe2bb('0x17')]);router['post'](_0xe2bb('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xe2bb('0x16')]('/:id/canned_answers',auth[_0xe2bb('0x8')](),controller[_0xe2bb('0x18')]);router[_0xe2bb('0x16')]('/:id/notify',controller[_0xe2bb('0x19')]);router[_0xe2bb('0x16')](_0xe2bb('0x11'),auth[_0xe2bb('0x8')](),controller[_0xe2bb('0x1a')]);router[_0xe2bb('0x16')](_0xe2bb('0x1b'),auth[_0xe2bb('0x8')](),controller['send']);router[_0xe2bb('0x16')]('/:id/status',controller[_0xe2bb('0x1c')]);router[_0xe2bb('0x16')](_0xe2bb('0x1d'),auth[_0xe2bb('0x8')](),controller['addAgents']);router[_0xe2bb('0x1e')](_0xe2bb('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe2bb('0x1f')](_0xe2bb('0xc'),auth[_0xe2bb('0x8')](),controller[_0xe2bb('0x20')]);router['delete'](_0xe2bb('0xd'),auth[_0xe2bb('0x8')](),controller[_0xe2bb('0x21')]);router[_0xe2bb('0x1f')](_0xe2bb('0xf'),auth[_0xe2bb('0x8')](),controller['removeAnswers']);router[_0xe2bb('0x1f')](_0xe2bb('0x1d'),auth[_0xe2bb('0x8')](),controller[_0xe2bb('0x22')]);module[_0xe2bb('0x23')]=router; \ No newline at end of file +var _0x4743=['/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','addDisposition','/:id/notify','notify','addApplications','/:id/send','status','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications'];(function(_0xd766e0,_0x366027){var _0x31e7ca=function(_0x506ee9){while(--_0x506ee9){_0xd766e0['push'](_0xd766e0['shift']());}};_0x31e7ca(++_0x366027);}(_0x4743,0x173));var _0x3474=function(_0x12399a,_0x2462c2){_0x12399a=_0x12399a-0x0;var _0x590db3=_0x4743[_0x12399a];return _0x590db3;};'use strict';var multer=require(_0x3474('0x0'));var util=require(_0x3474('0x1'));var path=require(_0x3474('0x2'));var timeout=require(_0x3474('0x3'));var express=require(_0x3474('0x4'));var router=express[_0x3474('0x5')]();var auth=require(_0x3474('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3474('0x7'));var controller=require(_0x3474('0x8'));router['get']('/',auth[_0x3474('0x9')](),controller['index']);router[_0x3474('0xa')](_0x3474('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3474('0xa')](_0x3474('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x3474('0xa')](_0x3474('0xd'),auth[_0x3474('0x9')](),controller[_0x3474('0xe')]);router['get'](_0x3474('0xf'),auth[_0x3474('0x9')](),controller[_0x3474('0x10')]);router['get'](_0x3474('0x11'),auth['isAuthenticated'](),controller[_0x3474('0x12')]);router[_0x3474('0xa')](_0x3474('0x13'),auth[_0x3474('0x9')](),controller[_0x3474('0x14')]);router[_0x3474('0xa')](_0x3474('0x15'),controller[_0x3474('0x16')]);router[_0x3474('0xa')](_0x3474('0x17'),auth['isAuthenticated'](),controller['getAgents']);router[_0x3474('0x18')]('/',auth[_0x3474('0x9')](),controller[_0x3474('0x19')]);router[_0x3474('0x18')](_0x3474('0xd'),auth[_0x3474('0x9')](),controller[_0x3474('0x1a')]);router[_0x3474('0x18')](_0x3474('0xf'),auth[_0x3474('0x9')](),controller['addAnswer']);router[_0x3474('0x18')](_0x3474('0x1b'),controller[_0x3474('0x1c')]);router[_0x3474('0x18')](_0x3474('0x11'),auth[_0x3474('0x9')](),controller[_0x3474('0x1d')]);router[_0x3474('0x18')](_0x3474('0x1e'),auth[_0x3474('0x9')](),controller['send']);router[_0x3474('0x18')](_0x3474('0x15'),controller[_0x3474('0x1f')]);router[_0x3474('0x18')](_0x3474('0x17'),auth['isAuthenticated'](),controller[_0x3474('0x20')]);router[_0x3474('0x21')](_0x3474('0xc'),auth[_0x3474('0x9')](),controller[_0x3474('0x22')]);router[_0x3474('0x23')](_0x3474('0xc'),auth[_0x3474('0x9')](),controller[_0x3474('0x24')]);router['delete'](_0x3474('0xd'),auth[_0x3474('0x9')](),controller['removeDispositions']);router[_0x3474('0x23')](_0x3474('0xf'),auth[_0x3474('0x9')](),controller['removeAnswers']);router[_0x3474('0x23')](_0x3474('0x17'),auth[_0x3474('0x9')](),controller[_0x3474('0x25')]);module[_0x3474('0x26')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 7b7244b..8fea556 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 _0x4d50=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','generate','ENUM','skebby','connectel','clicksend','plivo','clickatell','infobip','intelepeer','BOOLEAN','INTEGER'];(function(_0x54afef,_0x36a843){var _0x23a9d0=function(_0x477178){while(--_0x477178){_0x54afef['push'](_0x54afef['shift']());}};_0x23a9d0(++_0x36a843);}(_0x4d50,0x10f));var _0x04d5=function(_0x4fc9ab,_0x587504){_0x4fc9ab=_0x4fc9ab-0x0;var _0x2e0dcf=_0x4d50[_0x4fc9ab];return _0x2e0dcf;};'use strict';var Sequelize=require(_0x04d5('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x04d5('0x1')],'unique':_0x04d5('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x04d5('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x04d5('0x3')]();}},'phone':{'type':Sequelize[_0x04d5('0x1')]},'type':{'type':Sequelize[_0x04d5('0x4')]('twilio',_0x04d5('0x5'),_0x04d5('0x6'),_0x04d5('0x7'),_0x04d5('0x8'),_0x04d5('0x9'),'csc',_0x04d5('0xa'),_0x04d5('0xb'))},'accountSid':{'type':Sequelize[_0x04d5('0x1')]},'authId':{'type':Sequelize[_0x04d5('0x1')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x04d5('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x04d5('0x1')]},'apiKey':{'type':Sequelize[_0x04d5('0x1')]},'senderString':{'type':Sequelize[_0x04d5('0x1')]},'deliveryReport':{'type':Sequelize[_0x04d5('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x04d5('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x04d5('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x04d5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x04d5('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x04d5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x04d5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x04d5('0xd')],'comment':_0x04d5('0xe')},'mandatoryDisposition':{'type':Sequelize[_0x04d5('0xc')],'defaultValue':![],'comment':_0x04d5('0xf'),'set':function(_0x10e7fd){if(!_0x10e7fd)this[_0x04d5('0x10')](_0x04d5('0x11'),null);this[_0x04d5('0x10')](_0x04d5('0x12'),_0x10e7fd);}}}; \ No newline at end of file +var _0x0f64=['BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','randomstring','exports','name','STRING','generate','ENUM','twilio','connectel','plivo','clickatell','csc','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x35acd8,_0x25e69){var _0x2d7fb9=function(_0x1d98fc){while(--_0x1d98fc){_0x35acd8['push'](_0x35acd8['shift']());}};_0x2d7fb9(++_0x25e69);}(_0x0f64,0x16b));var _0x40f6=function(_0x343b3f,_0x101674){_0x343b3f=_0x343b3f-0x0;var _0x4465a4=_0x0f64[_0x343b3f];return _0x4465a4;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x40f6('0x0'));module[_0x40f6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x40f6('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x40f6('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x40f6('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x40f6('0x3')],'defaultValue':function(){return rs[_0x40f6('0x4')]();}},'phone':{'type':Sequelize[_0x40f6('0x3')]},'type':{'type':Sequelize[_0x40f6('0x5')](_0x40f6('0x6'),'skebby',_0x40f6('0x7'),'clicksend',_0x40f6('0x8'),_0x40f6('0x9'),_0x40f6('0xa'),'infobip',_0x40f6('0xb'))},'accountSid':{'type':Sequelize[_0x40f6('0x3')]},'authId':{'type':Sequelize[_0x40f6('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x40f6('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x40f6('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x40f6('0x3')]},'senderString':{'type':Sequelize[_0x40f6('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x40f6('0x3')]},'notificationTemplate':{'type':Sequelize[_0x40f6('0xc')],'defaultValue':function(){return _0x40f6('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x40f6('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x40f6('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x40f6('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x40f6('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x40f6('0xe')],'comment':_0x40f6('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5906fa){if(!_0x5906fa)this['setDataValue'](_0x40f6('0x11'),null);this['setDataValue']('mandatoryDisposition',_0x5906fa);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 864d983..fb8c458 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 _0x0d5a=['received\x20delivery\x20report\x20from','skebby','skebby_dispatch_id','requestid','statusInt','DELIVERED','groupName','redif','inspect','connectel','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','apply','reject','update','destroy','then','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','includeAll','include','findAll','rows','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','getDispositions','findOne','Disposition','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','messageId','MessageSid','sender','clicksend','message_id','MessageUUID','infobip','results','text','csc','segmentedMessage','clickatell','fromNumber','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','CmList','CmContact','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','agent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','sequelize','transaction','getApplications','getInteractions','Owner','fullname','Tag','color','List','out','dataValues','Messages','log'];(function(_0x249920,_0x5c7273){var _0x19c650=function(_0xa25442){while(--_0xa25442){_0x249920['push'](_0x249920['shift']());}};_0x19c650(++_0x5c7273);}(_0x0d5a,0xe8));var _0xa0d5=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x0d5a[_0x1ac595];return _0x455fff;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa0d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa0d5('0x1'));var jsonpatch=require(_0xa0d5('0x2'));var rp=require(_0xa0d5('0x3'));var moment=require(_0xa0d5('0x4'));var BPromise=require(_0xa0d5('0x5'));var Mustache=require('mustache');var util=require(_0xa0d5('0x6'));var path=require(_0xa0d5('0x7'));var sox=require(_0xa0d5('0x8'));var csv=require(_0xa0d5('0x9'));var ejs=require(_0xa0d5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa0d5('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa0d5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa0d5('0xd'));var Papa=require(_0xa0d5('0xe'));var authService=require(_0xa0d5('0xf'));var hardwareService=require(_0xa0d5('0x10'));var Redis=require('ioredis');var qs=require(_0xa0d5('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa0d5('0x12'));var db=require(_0xa0d5('0x13'))['db'];config[_0xa0d5('0x14')]=_[_0xa0d5('0x15')](config['redis'],{'host':_0xa0d5('0x16'),'port':0x18eb});var socket=require(_0xa0d5('0x17'))(new Redis(config[_0xa0d5('0x14')]));require(_0xa0d5('0x18'))[_0xa0d5('0x19')](socket);var jayson=require(_0xa0d5('0x1a'));var client=jayson[_0xa0d5('0x1b')][_0xa0d5('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x184575,_0x511685,_0x5a5376,_0x230751){return new BPromise(function(_0x70c47a,_0x3b0b02){var _0x15a17b=_0x230751||client;return _0x15a17b['request'](_0x184575,_0x5a5376)['then'](function(_0x10d417){logger[_0xa0d5('0x1d')](_0xa0d5('0x1e'),_0x511685,_0xa0d5('0x1f'));logger[_0xa0d5('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x511685,_0xa0d5('0x1f'),JSON[_0xa0d5('0x21')](_0x10d417));if(_0x10d417['error']){if(_0x10d417['error'][_0xa0d5('0x22')]===0x1f4){logger[_0xa0d5('0x23')]('SmsAccount,\x20%s,\x20%s',_0x511685,_0x10d417[_0xa0d5('0x23')]['message']);return _0x3b0b02(_0x10d417[_0xa0d5('0x23')][_0xa0d5('0x24')]);}logger[_0xa0d5('0x23')]('SmsAccount,\x20%s,\x20%s',_0x511685,_0x10d417['error']['message']);return _0x70c47a(_0x10d417[_0xa0d5('0x23')][_0xa0d5('0x24')]);}else{logger[_0xa0d5('0x1d')](_0xa0d5('0x1e'),_0x511685,_0xa0d5('0x1f'));_0x70c47a(_0x10d417[_0xa0d5('0x25')][_0xa0d5('0x24')]);}})[_0xa0d5('0x26')](function(_0x111e24){logger['error'](_0xa0d5('0x1e'),_0x511685,_0x111e24);_0x3b0b02(_0x111e24);});});}function respondWithStatusCode(_0x407aaa,_0x506f9d){_0x506f9d=_0x506f9d||0xcc;return function(_0x1b61eb){if(_0x1b61eb){return _0x407aaa[_0xa0d5('0x27')](_0x506f9d);}return _0x407aaa['status'](_0x506f9d)[_0xa0d5('0x28')]();};}function respondWithResult(_0x52da4b,_0x4d83b1){_0x4d83b1=_0x4d83b1||0xc8;return function(_0x25662d){if(_0x25662d){return _0x52da4b[_0xa0d5('0x29')](_0x4d83b1)[_0xa0d5('0x2a')](_0x25662d);}};}function respondWithFilteredResult(_0x424e2f,_0x155873){return function(_0x44d0e5){if(_0x44d0e5){var _0x5a8b32=_0x44d0e5[_0xa0d5('0x2b')],_0x24a1b3=_0x155873[_0xa0d5('0x2c')],_0x196998=_0x155873[_0xa0d5('0x2c')]+_0x155873[_0xa0d5('0x2d')],_0x43decf;if(_0x196998>=_0x5a8b32){_0x196998=_0x5a8b32;_0x43decf=0xc8;}else{_0x43decf=0xce;}_0x424e2f['status'](_0x43decf);return _0x424e2f['set']('Content-Range',_0x24a1b3+'-'+_0x196998+'/'+_0x5a8b32)['json'](_0x44d0e5);}return null;};}function patchUpdates(_0x20d937){return function(_0xc90554){try{jsonpatch[_0xa0d5('0x2e')](_0xc90554,_0x20d937,!![]);}catch(_0x2a393c){return BPromise[_0xa0d5('0x2f')](_0x2a393c);}return _0xc90554['save']();};}function saveUpdates(_0x3aa164,_0x196444){return function(_0x5e57b9){if(_0x5e57b9){return _0x5e57b9[_0xa0d5('0x30')](_0x3aa164)['then'](function(_0x5d4007){return _0x5d4007;});}return null;};}function removeEntity(_0x36bd0b,_0x51bede){return function(_0x2a8517){if(_0x2a8517){return _0x2a8517[_0xa0d5('0x31')]()[_0xa0d5('0x32')](function(){var _0x3a783a=_0x2a8517[_0xa0d5('0x33')]({'plain':!![]});var _0x401587=_0xa0d5('0x34');return db[_0xa0d5('0x35')][_0xa0d5('0x31')]({'where':{'type':_0x401587,'resourceId':_0x3a783a['id']}})['then'](function(){return _0x2a8517;});})[_0xa0d5('0x32')](function(){_0x36bd0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x411a7a,_0x482464){return function(_0x15aecb){if(!_0x15aecb){_0x411a7a['sendStatus'](0x194);}return _0x15aecb;};}function handleError(_0x53cd3a,_0x28b56a){_0x28b56a=_0x28b56a||0x1f4;return function(_0x1a67ad){logger[_0xa0d5('0x23')](_0x1a67ad[_0xa0d5('0x36')]);if(_0x1a67ad['name']){delete _0x1a67ad[_0xa0d5('0x37')];}_0x53cd3a[_0xa0d5('0x29')](_0x28b56a)[_0xa0d5('0x38')](_0x1a67ad);};}exports[_0xa0d5('0x39')]=function(_0x3ca2f3,_0x512b97){var _0x4a492a={'include':[{'model':db[_0xa0d5('0x3a')],'as':_0xa0d5('0x3b')}]},_0x5a41f4={},_0x56fdc1={'count':0x0,'rows':[]};var _0x14ff28=db[_0xa0d5('0x3c')][_0xa0d5('0x3d')];_0x5a41f4['model']=_['keys'](_0x14ff28);_0x5a41f4[_0xa0d5('0x3e')]=_[_0xa0d5('0x3f')](_0x3ca2f3[_0xa0d5('0x3e')]);_0x5a41f4['filters']=_[_0xa0d5('0x40')](_0x5a41f4['model'],_0x5a41f4['query']);_0x4a492a[_0xa0d5('0x41')]=_[_0xa0d5('0x40')](_0x5a41f4[_0xa0d5('0x42')],qs[_0xa0d5('0x43')](_0x3ca2f3[_0xa0d5('0x3e')][_0xa0d5('0x43')]));_0x4a492a['attributes']=_0x4a492a['attributes'][_0xa0d5('0x44')]?_0x4a492a[_0xa0d5('0x41')]:_0x5a41f4[_0xa0d5('0x42')];if(!_0x3ca2f3[_0xa0d5('0x3e')][_0xa0d5('0x45')](_0xa0d5('0x46'))){_0x4a492a[_0xa0d5('0x2d')]=qs[_0xa0d5('0x2d')](_0x3ca2f3['query']['limit']);_0x4a492a[_0xa0d5('0x2c')]=qs[_0xa0d5('0x2c')](_0x3ca2f3[_0xa0d5('0x3e')]['offset']);}_0x4a492a[_0xa0d5('0x47')]=qs[_0xa0d5('0x48')](_0x3ca2f3[_0xa0d5('0x3e')][_0xa0d5('0x48')]);_0x4a492a[_0xa0d5('0x49')]=qs[_0xa0d5('0x4a')](_[_0xa0d5('0x4b')](_0x3ca2f3['query'],_0x5a41f4[_0xa0d5('0x4a')]));if(_0x3ca2f3[_0xa0d5('0x3e')][_0xa0d5('0x4c')]){_0x4a492a[_0xa0d5('0x49')]=_[_0xa0d5('0x4d')](_0x4a492a[_0xa0d5('0x49')],{'$or':_[_0xa0d5('0x4e')](_0x14ff28,function(_0x26fc97){if(_0x26fc97[_0xa0d5('0x4f')]['key']!=='VIRTUAL'){var _0x37d701={};_0x37d701[_0x26fc97['field']]={'$like':'%'+_0x3ca2f3[_0xa0d5('0x3e')]['filter']+'%'};return _0x37d701;}})});}_0x4a492a=_[_0xa0d5('0x4d')]({},_0x4a492a,_0x3ca2f3['options']);var _0xed370b={'where':_0x4a492a[_0xa0d5('0x49')]};return db[_0xa0d5('0x3c')][_0xa0d5('0x2b')](_0xed370b)[_0xa0d5('0x32')](function(_0x2fa30d){_0x56fdc1[_0xa0d5('0x2b')]=_0x2fa30d;if(_0x3ca2f3[_0xa0d5('0x3e')][_0xa0d5('0x50')]){_0x4a492a[_0xa0d5('0x51')]=[{'all':!![]}];}return db['SmsAccount'][_0xa0d5('0x52')](_0x4a492a);})[_0xa0d5('0x32')](function(_0x3f2454){_0x56fdc1[_0xa0d5('0x53')]=_0x3f2454;return _0x56fdc1;})[_0xa0d5('0x32')](respondWithFilteredResult(_0x512b97,_0x4a492a))[_0xa0d5('0x26')](handleError(_0x512b97,null));};exports['show']=function(_0x4f54d6,_0x5e91d1){var _0x187077={'raw':![],'where':{'id':_0x4f54d6[_0xa0d5('0x54')]['id']},'include':[{'model':db[_0xa0d5('0x3a')],'as':_0xa0d5('0x3b')}]},_0x5efbda={};_0x5efbda[_0xa0d5('0x42')]=_[_0xa0d5('0x3f')](db[_0xa0d5('0x3c')][_0xa0d5('0x3d')]);_0x5efbda[_0xa0d5('0x3e')]=_[_0xa0d5('0x3f')](_0x4f54d6[_0xa0d5('0x3e')]);_0x5efbda[_0xa0d5('0x4a')]=_[_0xa0d5('0x40')](_0x5efbda[_0xa0d5('0x42')],_0x5efbda[_0xa0d5('0x3e')]);_0x187077[_0xa0d5('0x41')]=_[_0xa0d5('0x40')](_0x5efbda[_0xa0d5('0x42')],qs[_0xa0d5('0x43')](_0x4f54d6[_0xa0d5('0x3e')][_0xa0d5('0x43')]));_0x187077[_0xa0d5('0x41')]=_0x187077[_0xa0d5('0x41')][_0xa0d5('0x44')]?_0x187077[_0xa0d5('0x41')]:_0x5efbda[_0xa0d5('0x42')];if(_0x4f54d6['query'][_0xa0d5('0x50')]){_0x187077[_0xa0d5('0x51')]=[{'all':!![]}];}_0x187077=_['merge']({},_0x187077,_0x4f54d6[_0xa0d5('0x55')]);return db['SmsAccount'][_0xa0d5('0x56')](_0x187077)[_0xa0d5('0x32')](handleEntityNotFound(_0x5e91d1,null))[_0xa0d5('0x32')](respondWithResult(_0x5e91d1,null))[_0xa0d5('0x26')](handleError(_0x5e91d1,null));};exports[_0xa0d5('0x57')]=function(_0x1b7a9e,_0x11398f){return db[_0xa0d5('0x3c')][_0xa0d5('0x57')](_0x1b7a9e[_0xa0d5('0x58')],{})[_0xa0d5('0x32')](function(_0x259ecb){var _0x19a60d=_0x1b7a9e['user']['get']({'plain':!![]});if(!_0x19a60d)throw new Error(_0xa0d5('0x59'));if(_0x19a60d[_0xa0d5('0x5a')]===_0xa0d5('0x5b')){var _0x1c0e37=_0x259ecb['get']({'plain':!![]});var _0x10cbc5=_0xa0d5('0x34');return db[_0xa0d5('0x5c')][_0xa0d5('0x56')]({'where':{'name':_0x10cbc5,'userProfileId':_0x19a60d[_0xa0d5('0x5d')]},'raw':!![]})['then'](function(_0x4de7b1){if(_0x4de7b1&&_0x4de7b1[_0xa0d5('0x5e')]===0x0){return db[_0xa0d5('0x35')]['create']({'name':_0x1c0e37[_0xa0d5('0x37')],'resourceId':_0x1c0e37['id'],'type':_0x4de7b1['name'],'sectionId':_0x4de7b1['id']},{})[_0xa0d5('0x32')](function(){return _0x259ecb;});}else{return _0x259ecb;}})['catch'](function(_0x156c37){logger[_0xa0d5('0x23')](_0xa0d5('0x5f'),_0x156c37);throw _0x156c37;});}return _0x259ecb;})[_0xa0d5('0x32')](respondWithResult(_0x11398f,0xc9))[_0xa0d5('0x26')](handleError(_0x11398f,null));};exports['update']=function(_0x1eb56b,_0x5448fe){if(_0x1eb56b[_0xa0d5('0x58')]['id']){delete _0x1eb56b[_0xa0d5('0x58')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x1eb56b[_0xa0d5('0x54')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xa0d5('0x32')](handleEntityNotFound(_0x5448fe,null))[_0xa0d5('0x32')](saveUpdates(_0x1eb56b['body'],null))['then'](function(_0x541d9b){if(_0x541d9b&&_0x1eb56b[_0xa0d5('0x58')][_0xa0d5('0x3b')]){return db[_0xa0d5('0x3a')][_0xa0d5('0x30')](_0x1eb56b[_0xa0d5('0x58')]['mandatoryDispositionPause'],{'where':{'SmsAccountId':_0x541d9b['id']}})[_0xa0d5('0x32')](function(){return _0x541d9b;});}return _0x541d9b;})[_0xa0d5('0x32')](respondWithResult(_0x5448fe,null))['catch'](handleError(_0x5448fe,null));};exports[_0xa0d5('0x31')]=function(_0x2c6ba9,_0x2296b4){return db[_0xa0d5('0x3c')][_0xa0d5('0x56')]({'where':{'id':_0x2c6ba9[_0xa0d5('0x54')]['id']}})[_0xa0d5('0x32')](handleEntityNotFound(_0x2296b4,null))[_0xa0d5('0x32')](removeEntity(_0x2296b4,null))[_0xa0d5('0x26')](handleError(_0x2296b4,null));};exports['describe']=function(_0x125a7f,_0x149255){return db[_0xa0d5('0x3c')][_0xa0d5('0x60')]()[_0xa0d5('0x32')](respondWithResult(_0x149255,null))['catch'](handleError(_0x149255,null));};exports['addDisposition']=function(_0x24ecd0,_0x41e17e,_0x5b07c7){if(_0x24ecd0[_0xa0d5('0x58')]['id']){delete _0x24ecd0[_0xa0d5('0x58')]['id'];}return db[_0xa0d5('0x3c')]['find']({'where':{'id':_0x24ecd0[_0xa0d5('0x54')]['id']}})[_0xa0d5('0x32')](handleEntityNotFound(_0x41e17e,null))['then'](function(_0xc5b195){if(_0xc5b195){_0x24ecd0[_0xa0d5('0x58')][_0xa0d5('0x61')]=_0xc5b195['id'];return db['Disposition'][_0xa0d5('0x57')](_0x24ecd0[_0xa0d5('0x58')]);}})[_0xa0d5('0x32')](respondWithResult(_0x41e17e,null))[_0xa0d5('0x26')](handleError(_0x41e17e,null));};exports[_0xa0d5('0x62')]=function(_0x22a0da,_0x53644,_0x29390f){var _0x165aa6={'raw':![],'where':{}};var _0x443718={};var _0x44dc48={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa0d5('0x63')]({'where':{'id':_0x22a0da[_0xa0d5('0x54')]['id']}})['then'](handleEntityNotFound(_0x53644,null))[_0xa0d5('0x32')](function(_0x3fce54){if(_0x3fce54){_0x443718[_0xa0d5('0x42')]=_[_0xa0d5('0x3f')](db['Disposition']['rawAttributes']);_0x443718[_0xa0d5('0x3e')]=_[_0xa0d5('0x3f')](_0x22a0da[_0xa0d5('0x3e')]);_0x443718['filters']=_['intersection'](_0x443718[_0xa0d5('0x42')],_0x443718[_0xa0d5('0x3e')]);_0x165aa6[_0xa0d5('0x41')]=_['intersection'](_0x443718[_0xa0d5('0x42')],qs[_0xa0d5('0x43')](_0x22a0da[_0xa0d5('0x3e')][_0xa0d5('0x43')]));_0x165aa6[_0xa0d5('0x41')]=_0x165aa6['attributes'][_0xa0d5('0x44')]?_0x165aa6[_0xa0d5('0x41')]:_0x443718[_0xa0d5('0x42')];if(!_0x22a0da[_0xa0d5('0x3e')][_0xa0d5('0x45')](_0xa0d5('0x46'))){_0x165aa6[_0xa0d5('0x2d')]=qs[_0xa0d5('0x2d')](_0x22a0da[_0xa0d5('0x3e')][_0xa0d5('0x2d')]);_0x165aa6[_0xa0d5('0x2c')]=qs[_0xa0d5('0x2c')](_0x22a0da[_0xa0d5('0x3e')][_0xa0d5('0x2c')]);}_0x165aa6['order']=qs[_0xa0d5('0x48')](_0x22a0da[_0xa0d5('0x3e')][_0xa0d5('0x48')]);_0x165aa6[_0xa0d5('0x49')]=qs['filters'](_[_0xa0d5('0x4b')](_0x22a0da[_0xa0d5('0x3e')],_0x443718[_0xa0d5('0x4a')]));_0x165aa6[_0xa0d5('0x49')][_0xa0d5('0x61')]=_0x3fce54['id'];if(_0x22a0da['query'][_0xa0d5('0x4c')]){_0x165aa6[_0xa0d5('0x49')]=_['merge'](_0x165aa6['where'],{'$or':_[_0xa0d5('0x4e')](_0x165aa6['attributes'],function(_0x26b1a1){var _0x4da69c={};_0x4da69c[_0x26b1a1]={'$like':'%'+_0x22a0da[_0xa0d5('0x3e')][_0xa0d5('0x4c')]+'%'};return _0x4da69c;})});}_0x165aa6=_[_0xa0d5('0x4d')]({},_0x165aa6,_0x22a0da[_0xa0d5('0x55')]);return db[_0xa0d5('0x64')]['count']({'where':_0x165aa6[_0xa0d5('0x49')]})['then'](function(_0x581871){_0x44dc48[_0xa0d5('0x2b')]=_0x581871;if(_0x22a0da[_0xa0d5('0x3e')][_0xa0d5('0x50')]){_0x165aa6['include']=[{'all':!![]}];}return db[_0xa0d5('0x64')]['findAll'](_0x165aa6);})['then'](function(_0x147702){_0x44dc48[_0xa0d5('0x53')]=_0x147702;return _0x44dc48;});}})[_0xa0d5('0x32')](respondWithFilteredResult(_0x53644,_0x165aa6))[_0xa0d5('0x26')](handleError(_0x53644,null));};exports['removeDispositions']=function(_0x546387,_0x15fd1e,_0x247a01){var _0x1d0878;return db[_0xa0d5('0x3c')][_0xa0d5('0x56')]({'where':{'id':_0x546387[_0xa0d5('0x54')]['id']}})[_0xa0d5('0x32')](handleEntityNotFound(_0x15fd1e,null))[_0xa0d5('0x32')](function(_0x4c2725){if(_0x4c2725){return _0x4c2725['removeDispositions'](_0x546387[_0xa0d5('0x3e')]['ids']);}})[_0xa0d5('0x32')](respondWithStatusCode(_0x15fd1e,null))[_0xa0d5('0x26')](handleError(_0x15fd1e,null));};exports[_0xa0d5('0x65')]=function(_0x435f24,_0x314e6c,_0x5ef2a9){if(_0x435f24[_0xa0d5('0x58')]['id']){delete _0x435f24[_0xa0d5('0x58')]['id'];}return db[_0xa0d5('0x3c')][_0xa0d5('0x56')]({'where':{'id':_0x435f24[_0xa0d5('0x54')]['id']}})[_0xa0d5('0x32')](handleEntityNotFound(_0x314e6c,null))['then'](function(_0x54d611){if(_0x54d611){_0x435f24[_0xa0d5('0x58')]['SmsAccountId']=_0x54d611['id'];return db[_0xa0d5('0x66')][_0xa0d5('0x57')](_0x435f24[_0xa0d5('0x58')]);}})['then'](respondWithResult(_0x314e6c,null))[_0xa0d5('0x26')](handleError(_0x314e6c,null));};exports[_0xa0d5('0x67')]=function(_0x561707,_0x21c513,_0x1f1369){var _0x323ad7={'raw':![],'where':{}};var _0x5a8b85={};var _0x7029db={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa0d5('0x63')]({'where':{'id':_0x561707['params']['id']}})['then'](handleEntityNotFound(_0x21c513,null))[_0xa0d5('0x32')](function(_0x523fc1){if(_0x523fc1){_0x5a8b85['model']=_[_0xa0d5('0x3f')](db[_0xa0d5('0x66')][_0xa0d5('0x3d')]);_0x5a8b85['query']=_[_0xa0d5('0x3f')](_0x561707[_0xa0d5('0x3e')]);_0x5a8b85[_0xa0d5('0x4a')]=_['intersection'](_0x5a8b85[_0xa0d5('0x42')],_0x5a8b85[_0xa0d5('0x3e')]);_0x323ad7[_0xa0d5('0x41')]=_[_0xa0d5('0x40')](_0x5a8b85[_0xa0d5('0x42')],qs[_0xa0d5('0x43')](_0x561707[_0xa0d5('0x3e')][_0xa0d5('0x43')]));_0x323ad7[_0xa0d5('0x41')]=_0x323ad7[_0xa0d5('0x41')][_0xa0d5('0x44')]?_0x323ad7[_0xa0d5('0x41')]:_0x5a8b85[_0xa0d5('0x42')];if(!_0x561707['query'][_0xa0d5('0x45')](_0xa0d5('0x46'))){_0x323ad7[_0xa0d5('0x2d')]=qs['limit'](_0x561707[_0xa0d5('0x3e')][_0xa0d5('0x2d')]);_0x323ad7[_0xa0d5('0x2c')]=qs['offset'](_0x561707[_0xa0d5('0x3e')][_0xa0d5('0x2c')]);}_0x323ad7['order']=qs[_0xa0d5('0x48')](_0x561707[_0xa0d5('0x3e')][_0xa0d5('0x48')]);_0x323ad7[_0xa0d5('0x49')]=qs[_0xa0d5('0x4a')](_['pick'](_0x561707[_0xa0d5('0x3e')],_0x5a8b85['filters']));_0x323ad7['where'][_0xa0d5('0x61')]=_0x523fc1['id'];if(_0x561707[_0xa0d5('0x3e')][_0xa0d5('0x4c')]){_0x323ad7[_0xa0d5('0x49')]=_[_0xa0d5('0x4d')](_0x323ad7[_0xa0d5('0x49')],{'$or':_[_0xa0d5('0x4e')](_0x323ad7[_0xa0d5('0x41')],function(_0x5d7d84){var _0xfb4780={};_0xfb4780[_0x5d7d84]={'$like':'%'+_0x561707[_0xa0d5('0x3e')][_0xa0d5('0x4c')]+'%'};return _0xfb4780;})});}_0x323ad7=_[_0xa0d5('0x4d')]({},_0x323ad7,_0x561707[_0xa0d5('0x55')]);return db[_0xa0d5('0x66')]['count']({'where':_0x323ad7['where']})[_0xa0d5('0x32')](function(_0x192c70){_0x7029db[_0xa0d5('0x2b')]=_0x192c70;if(_0x561707['query'][_0xa0d5('0x50')]){_0x323ad7[_0xa0d5('0x51')]=[{'all':!![]}];}return db[_0xa0d5('0x66')][_0xa0d5('0x52')](_0x323ad7);})[_0xa0d5('0x32')](function(_0x359317){_0x7029db[_0xa0d5('0x53')]=_0x359317;return _0x7029db;});}})[_0xa0d5('0x32')](respondWithFilteredResult(_0x21c513,_0x323ad7))[_0xa0d5('0x26')](handleError(_0x21c513,null));};exports[_0xa0d5('0x68')]=function(_0x212ba0,_0x587a38,_0x26411c){var _0x1325c6;return db['SmsAccount'][_0xa0d5('0x56')]({'where':{'id':_0x212ba0[_0xa0d5('0x54')]['id']}})[_0xa0d5('0x32')](handleEntityNotFound(_0x587a38,null))[_0xa0d5('0x32')](function(_0x3ebab8){if(_0x3ebab8){return _0x3ebab8[_0xa0d5('0x68')](_0x212ba0[_0xa0d5('0x3e')][_0xa0d5('0x69')]);}})[_0xa0d5('0x32')](respondWithStatusCode(_0x587a38,null))[_0xa0d5('0x26')](handleError(_0x587a38,null));};exports[_0xa0d5('0x6a')]=function(_0x4decf7,_0x10ca56,_0x27dfa9){var _0x479fed={'channel':_0xa0d5('0x6b')};var _0x92e1d2=[];var _0x475c1e=[];var _0x27eea1={};return db[_0xa0d5('0x3c')][_0xa0d5('0x56')]({'where':{'id':_0x4decf7[_0xa0d5('0x54')]['id']},'include':[{'model':db[_0xa0d5('0x6c')],'as':_0xa0d5('0x6d')}]})[_0xa0d5('0x32')](handleEntityNotFound(_0x10ca56,null))[_0xa0d5('0x32')](function(_0x35bcec){_0x479fed[_0xa0d5('0x6e')]=_0x35bcec;_0x479fed[_0xa0d5('0x6f')]=_[_0xa0d5('0x70')](_0x35bcec[_0xa0d5('0x6d')],[_0xa0d5('0x71')],['asc']);if(_0x479fed['account'][_0xa0d5('0x6d')]){delete _0x479fed[_0xa0d5('0x6e')][_0xa0d5('0x6d')];}return db['CmContact']['describe']();})[_0xa0d5('0x32')](function(_0x54c46b){if(!_0x54c46b){throw new db[(_0xa0d5('0x72'))][(_0xa0d5('0x73'))](_0xa0d5('0x74'));}_0x92e1d2=_[_0xa0d5('0x75')](_[_0xa0d5('0x3f')](_0x54c46b),[_0xa0d5('0x76'),'updatedAt']);_0x475c1e=_[_0xa0d5('0x75')](_[_0xa0d5('0x3f')](_0x54c46b),['createdAt',_0xa0d5('0x77'),_0xa0d5('0x78'),_0xa0d5('0x79')]);_0x479fed[_0xa0d5('0x58')]={'mapKey':_0xa0d5('0x7a')};if(_0x479fed[_0xa0d5('0x6e')][_0xa0d5('0x4f')]){switch(_0x479fed[_0xa0d5('0x6e')][_0xa0d5('0x4f')]){case _0xa0d5('0x7b'):_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7c')]=_0x4decf7[_0xa0d5('0x58')]['From'];_0x479fed[_0xa0d5('0x58')]['body']=_0x4decf7[_0xa0d5('0x58')]['Body'];_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7d')]=_0x4decf7[_0xa0d5('0x58')][_0xa0d5('0x7e')];break;case'skebby':_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7c')]='+'+_0x4decf7[_0xa0d5('0x58')][_0xa0d5('0x7f')];_0x479fed[_0xa0d5('0x58')]['body']=_0x4decf7[_0xa0d5('0x58')]['text'];break;case'connectel':_0x479fed['body']['from']=_0x4decf7[_0xa0d5('0x58')][_0xa0d5('0x7c')];_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x58')]=_0x4decf7[_0xa0d5('0x58')]['message'];break;case _0xa0d5('0x80'):_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7c')]=_0x4decf7[_0xa0d5('0x58')]['from'];_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x58')]=_0x4decf7[_0xa0d5('0x58')][_0xa0d5('0x58')];_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7d')]=_0x4decf7[_0xa0d5('0x58')][_0xa0d5('0x81')];break;case'plivo':_0x479fed['body'][_0xa0d5('0x7c')]=_0x4decf7[_0xa0d5('0x58')]['From'];_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x58')]=_0x4decf7['body']['Text'];_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7d')]=_0x4decf7[_0xa0d5('0x58')][_0xa0d5('0x82')];break;case _0xa0d5('0x83'):_0x479fed['body'][_0xa0d5('0x7c')]='+'+_0x4decf7[_0xa0d5('0x58')][_0xa0d5('0x84')][0x0][_0xa0d5('0x7c')];_0x479fed[_0xa0d5('0x58')]['body']=_0x4decf7[_0xa0d5('0x58')]['results'][0x0][_0xa0d5('0x85')];_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7d')]=_0x4decf7[_0xa0d5('0x58')][_0xa0d5('0x84')][0x0]['messageId'];break;case _0xa0d5('0x86'):_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7c')]=_0x4decf7[_0xa0d5('0x58')]['originatingAddress'];_0x479fed[_0xa0d5('0x58')]['body']=_0x4decf7[_0xa0d5('0x58')][_0xa0d5('0x87')][_0xa0d5('0x24')];break;case _0xa0d5('0x88'):_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7c')]=_0x4decf7[_0xa0d5('0x58')][_0xa0d5('0x89')];_0x479fed[_0xa0d5('0x58')]['body']=_0x4decf7[_0xa0d5('0x58')][_0xa0d5('0x85')];_0x479fed[_0xa0d5('0x58')]['messageId']=_0x4decf7['body']['replyMessageId'];break;case _0xa0d5('0x8a'):_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7c')]=_0x4decf7[_0xa0d5('0x58')][_0xa0d5('0x7c')];_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x58')]=_0x4decf7[_0xa0d5('0x58')][_0xa0d5('0x24')];_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7d')]=_0x4decf7[_0xa0d5('0x58')]['refid'];break;}}if(_0x479fed[_0xa0d5('0x58')]['id']){delete _0x479fed[_0xa0d5('0x58')]['id'];}if(_[_0xa0d5('0x8b')](_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7c')])){throw new db[(_0xa0d5('0x72'))]['ValidationError'](_0xa0d5('0x8c'));}if(_[_0xa0d5('0x8b')](_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x58')])||_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x58')]===''){throw new db[(_0xa0d5('0x72'))]['ValidationError'](_0xa0d5('0x8d'));}if(_[_0xa0d5('0x8b')](_0x479fed['body']['mapKey'])){throw new db[(_0xa0d5('0x72'))][(_0xa0d5('0x73'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x475c1e);}if(!_[_0xa0d5('0x8e')](_0x475c1e,_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x8f')])){throw new db[(_0xa0d5('0x72'))][(_0xa0d5('0x73'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x475c1e);}_0x27eea1[_0x479fed['body'][_0xa0d5('0x8f')]]=_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7c')];return db[_0xa0d5('0x90')][_0xa0d5('0x56')]({'where':{'id':_0x479fed[_0xa0d5('0x6e')][_0xa0d5('0x79')]},'include':[{'model':db[_0xa0d5('0x91')],'as':'Contacts','where':_0x27eea1,'limit':0x1,'order':[[_0xa0d5('0x77'),_0xa0d5('0x92')]]}]});})[_0xa0d5('0x32')](handleEntityNotFound(_0x10ca56,null))[_0xa0d5('0x32')](function(_0x2aa7a7){if(_0x2aa7a7){_0x479fed[_0xa0d5('0x93')]=_[_0xa0d5('0x94')](_0x2aa7a7,[_0xa0d5('0x95')]);if(_0x2aa7a7[_0xa0d5('0x95')][_0xa0d5('0x44')]){return _0x2aa7a7[_0xa0d5('0x95')][0x0];}var _0xb33781=_[_0xa0d5('0x15')](_0x479fed[_0xa0d5('0x58')],{'firstName':_0x479fed[_0xa0d5('0x58')]['from'],'ListId':_0x2aa7a7['id']});_0xb33781[_0x479fed[_0xa0d5('0x58')]['mapKey']]=_0x479fed[_0xa0d5('0x58')]['from'];return db[_0xa0d5('0x91')][_0xa0d5('0x57')](_0xb33781,{'fields':_0x92e1d2,'raw':!![]});}})['then'](handleEntityNotFound(_0x10ca56,null))[_0xa0d5('0x32')](function(_0x37327e){if(_0x37327e){_0x479fed[_0xa0d5('0x96')]=_0x37327e;var _0x1f6baa={'ContactId':_0x37327e['id'],'phone':_0x479fed['body'][_0xa0d5('0x7c')],'SmsAccountId':_0x4decf7[_0xa0d5('0x54')]['id']};var _0x4e3d8f={'ContactId':_0x37327e['id'],'SmsAccountId':_0x4decf7['params']['id'],'closed':![]};return db['SmsInteraction'][_0xa0d5('0x56')]({'where':_0x4e3d8f})[_0xa0d5('0x32')](function(_0x3fdf5a){if(_0x3fdf5a){return[_0x3fdf5a,![]];}return db[_0xa0d5('0x97')]['create'](_0x1f6baa)[_0xa0d5('0x32')](function(_0x58619c){return[_0x58619c,!![]];});});}})[_0xa0d5('0x98')](function(_0x2c6990,_0x14efb1){_0x479fed[_0xa0d5('0x99')]=_0x2c6990[_0xa0d5('0x33')]({'plain':!![]});_0x479fed['interaction'][_0xa0d5('0x9a')]=![];if(_0x14efb1){if(_0x479fed[_0xa0d5('0x6e')][_0xa0d5('0x9b')]){_0x479fed['applications'][_0xa0d5('0x9c')]({'id':0x0,'priority':_0x479fed[_0xa0d5('0x6f')][_0xa0d5('0x44')]+0x1,'app':'close','appdata':_0xa0d5('0x9d'),'interval':_0xa0d5('0x9e')});}_0x479fed[_0xa0d5('0x99')][_0xa0d5('0x9a')]=!![];}return db[_0xa0d5('0x9f')]['create']({'phone':_0x479fed[_0xa0d5('0x58')]['from'],'messageId':_0x479fed[_0xa0d5('0x58')][_0xa0d5('0x7d')],'body':_0x479fed['body'][_0xa0d5('0x58')],'SmsAccountId':_0x4decf7['params']['id'],'SmsInteractionId':_0x2c6990['id'],'direction':'in','ContactId':_0x2c6990['ContactId'],'AttachmentId':_0x479fed[_0xa0d5('0x58')][_0xa0d5('0xa0')]});})[_0xa0d5('0x32')](function(_0x2963f5){_0x479fed[_0xa0d5('0x24')]=_0x2963f5;if(_0x479fed[_0xa0d5('0x99')][_0xa0d5('0xa1')]){return db[_0xa0d5('0xa2')][_0xa0d5('0x56')]({'attributes':['id',_0xa0d5('0x37')],'where':{'id':_0x479fed[_0xa0d5('0x99')]['UserId']}})['then'](function(_0x340c09){if(_0x340c09){_0x479fed[_0xa0d5('0x6f')][_0xa0d5('0xa3')]({'id':0x0,'priority':0x0,'app':_0xa0d5('0xa4'),'appdata':_0x340c09[_0xa0d5('0x37')]+','+(_0x479fed[_0xa0d5('0x6e')]['waitForTheAssignedAgent']||0xa),'interval':_0xa0d5('0x9e')});}return respondWithRpcPromise(_0xa0d5('0xa5'),_0xa0d5('0xa6'),_0x479fed);});}return respondWithRpcPromise(_0xa0d5('0xa5'),_0xa0d5('0xa6'),_0x479fed);})[_0xa0d5('0x32')](function(_0x54ab44){if(_0x54ab44){var _0x3eeb61=0xc8;var _0x30451f='receiveMessage';logger[_0xa0d5('0x1d')](_0xa0d5('0xa7'),_0x30451f,_0x3eeb61,'entity\x20found');logger[_0xa0d5('0x20')](_0xa0d5('0xa8'),_0x30451f,_0x3eeb61,'entity\x20found',JSON['stringify'](_0x54ab44));if(_0x479fed['account'][_0xa0d5('0x4f')]==='twilio'){return _0x10ca56[_0xa0d5('0x29')](_0x3eeb61)[_0xa0d5('0xa9')](_0xa0d5('0xaa'),_0xa0d5('0xab'))[_0xa0d5('0x38')](_0xa0d5('0xac'));}else{return _0x10ca56[_0xa0d5('0x29')](_0x3eeb61)[_0xa0d5('0x2a')](_0x54ab44);}}})[_0xa0d5('0x26')](handleError(_0x10ca56,null));};exports['addApplications']=function(_0x39ebed,_0x320464,_0x264a6f){return db[_0xa0d5('0x3c')][_0xa0d5('0x63')]({'where':{'id':_0x39ebed['params']['id']}})[_0xa0d5('0x32')](handleEntityNotFound(_0x320464,null))[_0xa0d5('0x32')](function(_0x596075){if(_0x596075){return db[_0xa0d5('0xad')][_0xa0d5('0xae')](function(_0x1bd5de){return db[_0xa0d5('0x6c')][_0xa0d5('0x31')]({'where':{'SmsAccountId':_0x39ebed['params']['id']},'transaction':_0x1bd5de})['then'](function(_0x1af9f5){var _0x5f498b=_[_0xa0d5('0x4e')](_0x39ebed[_0xa0d5('0x58')],function(_0x461945){_0x461945[_0xa0d5('0x61')]=_0x39ebed[_0xa0d5('0x54')]['id'];return _0x461945;});return db[_0xa0d5('0x6c')]['bulkCreate'](_0x5f498b,{'transaction':_0x1bd5de});});})[_0xa0d5('0x32')](function(){return db[_0xa0d5('0x6c')]['findAndCountAll']({'where':{'SmsAccountId':_0x39ebed[_0xa0d5('0x54')]['id']},'order':_0xa0d5('0x71')});});}})[_0xa0d5('0x32')](respondWithResult(_0x320464,null))[_0xa0d5('0x26')](handleError(_0x320464,null));};exports[_0xa0d5('0xaf')]=function(_0x546dd1,_0x2fd02c,_0x269d45){var _0x5eb593={};var _0x4d30ae={};var _0x1f460f;var _0x69a6e1;return db[_0xa0d5('0x3c')][_0xa0d5('0x63')]({'where':{'id':_0x546dd1[_0xa0d5('0x54')]['id']}})[_0xa0d5('0x32')](handleEntityNotFound(_0x2fd02c,null))[_0xa0d5('0x32')](function(_0x2dfeb5){if(_0x2dfeb5){_0x1f460f=_0x2dfeb5;_0x4d30ae[_0xa0d5('0x42')]=_[_0xa0d5('0x3f')](db[_0xa0d5('0x6c')][_0xa0d5('0x3d')]);_0x4d30ae[_0xa0d5('0x3e')]=_[_0xa0d5('0x3f')](_0x546dd1['query']);_0x4d30ae[_0xa0d5('0x4a')]=_[_0xa0d5('0x40')](_0x4d30ae[_0xa0d5('0x42')],_0x4d30ae['query']);_0x5eb593[_0xa0d5('0x41')]=_['intersection'](_0x4d30ae[_0xa0d5('0x42')],qs[_0xa0d5('0x43')](_0x546dd1[_0xa0d5('0x3e')][_0xa0d5('0x43')]));_0x5eb593[_0xa0d5('0x41')]=_0x5eb593[_0xa0d5('0x41')]['length']?_0x5eb593[_0xa0d5('0x41')]:_0x4d30ae[_0xa0d5('0x42')];_0x5eb593[_0xa0d5('0x47')]=qs['sort'](_0x546dd1[_0xa0d5('0x3e')][_0xa0d5('0x48')]);_0x5eb593[_0xa0d5('0x49')]=qs[_0xa0d5('0x4a')](_[_0xa0d5('0x4b')](_0x546dd1['query'],_0x4d30ae['filters']));if(_0x546dd1[_0xa0d5('0x3e')]['filter']){_0x5eb593[_0xa0d5('0x49')]=_['merge'](_0x5eb593['where'],{'$or':_[_0xa0d5('0x4e')](_0x5eb593[_0xa0d5('0x41')],function(_0x409bb1){var _0xbe7bd3={};_0xbe7bd3[_0x409bb1]={'$like':'%'+_0x546dd1[_0xa0d5('0x3e')]['filter']+'%'};return _0xbe7bd3;})});}_0x5eb593=_['merge']({},_0x5eb593,_0x546dd1[_0xa0d5('0x55')]);return _0x1f460f[_0xa0d5('0xaf')](_0x5eb593);}})['then'](function(_0x2fe1de){if(_0x2fe1de){_0x69a6e1=_0x2fe1de['length'];if(!_0x546dd1[_0xa0d5('0x3e')][_0xa0d5('0x45')](_0xa0d5('0x46'))){_0x5eb593[_0xa0d5('0x2d')]=qs[_0xa0d5('0x2d')](_0x546dd1[_0xa0d5('0x3e')][_0xa0d5('0x2d')]);_0x5eb593[_0xa0d5('0x2c')]=qs['offset'](_0x546dd1[_0xa0d5('0x3e')]['offset']);}return _0x1f460f[_0xa0d5('0xaf')](_0x5eb593);}})['then'](function(_0x18502c){if(_0x18502c){return _0x18502c?{'count':_0x69a6e1,'rows':_0x18502c}:null;}})[_0xa0d5('0x32')](respondWithResult(_0x2fd02c,null))[_0xa0d5('0x26')](handleError(_0x2fd02c,null));};exports[_0xa0d5('0xb0')]=function(_0x1c9c31,_0x3456b6,_0x26b0d2){var _0x254f41={'raw':![],'where':{}};var _0x2f7a9d={};var _0x25b678={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa0d5('0x63')]({'where':{'id':_0x1c9c31[_0xa0d5('0x54')]['id']}})[_0xa0d5('0x32')](handleEntityNotFound(_0x3456b6,null))[_0xa0d5('0x32')](function(_0x5226cd){if(_0x5226cd){_0x2f7a9d[_0xa0d5('0x42')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x2f7a9d[_0xa0d5('0x3e')]=_[_0xa0d5('0x3f')](_0x1c9c31[_0xa0d5('0x3e')]);_0x2f7a9d[_0xa0d5('0x4a')]=_[_0xa0d5('0x40')](_0x2f7a9d[_0xa0d5('0x42')],_0x2f7a9d[_0xa0d5('0x3e')]);_0x254f41['attributes']=_[_0xa0d5('0x40')](_0x2f7a9d[_0xa0d5('0x42')],qs['fields'](_0x1c9c31[_0xa0d5('0x3e')][_0xa0d5('0x43')]));_0x254f41[_0xa0d5('0x41')]=_0x254f41[_0xa0d5('0x41')][_0xa0d5('0x44')]?_0x254f41[_0xa0d5('0x41')]:_0x2f7a9d[_0xa0d5('0x42')];if(!_0x1c9c31[_0xa0d5('0x3e')]['hasOwnProperty'](_0xa0d5('0x46'))){_0x254f41[_0xa0d5('0x2d')]=qs[_0xa0d5('0x2d')](_0x1c9c31[_0xa0d5('0x3e')]['limit']);_0x254f41[_0xa0d5('0x2c')]=qs[_0xa0d5('0x2c')](_0x1c9c31['query'][_0xa0d5('0x2c')]);}_0x254f41['order']=qs['sort'](_0x1c9c31[_0xa0d5('0x3e')][_0xa0d5('0x48')]);_0x254f41[_0xa0d5('0x49')]=qs[_0xa0d5('0x4a')](_['pick'](_0x1c9c31[_0xa0d5('0x3e')],_0x2f7a9d[_0xa0d5('0x4a')]));_0x254f41['where'][_0xa0d5('0x61')]=_0x5226cd['id'];if(_0x1c9c31[_0xa0d5('0x3e')][_0xa0d5('0x4c')]){_0x254f41[_0xa0d5('0x49')]=_[_0xa0d5('0x4d')](_0x254f41[_0xa0d5('0x49')],{'$or':_[_0xa0d5('0x4e')](_0x254f41[_0xa0d5('0x41')],function(_0xdec84){var _0x33618a={};_0x33618a[_0xdec84]={'$like':'%'+_0x1c9c31[_0xa0d5('0x3e')][_0xa0d5('0x4c')]+'%'};return _0x33618a;})});}_0x254f41=_['merge']({},_0x254f41,_0x1c9c31[_0xa0d5('0x55')]);return db[_0xa0d5('0x97')][_0xa0d5('0x2b')]({'where':_0x254f41[_0xa0d5('0x49')]})['then'](function(_0x32e4f1){_0x25b678[_0xa0d5('0x2b')]=_0x32e4f1;if(_0x1c9c31[_0xa0d5('0x3e')][_0xa0d5('0x50')]){_0x254f41[_0xa0d5('0x51')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xa0d5('0xa2')],'as':_0xa0d5('0xb1'),'attributes':[_0xa0d5('0x37'),_0xa0d5('0xb2'),'internal'],'required':![]},{'model':db[_0xa0d5('0xb3')],'as':'Tags','attributes':['id',_0xa0d5('0x37'),_0xa0d5('0xb4')],'where':_0x1c9c31[_0xa0d5('0x3e')]['tag']?{'id':_0x1c9c31['query']['tag']}:undefined,'required':_0x1c9c31['query']['tag']?!![]:![]}];}return db[_0xa0d5('0x97')][_0xa0d5('0x52')](_0x254f41);})[_0xa0d5('0x32')](function(_0x832bf6){_0x25b678[_0xa0d5('0x53')]=_0x832bf6;return _0x25b678;});}})[_0xa0d5('0x32')](respondWithFilteredResult(_0x3456b6,_0x254f41))[_0xa0d5('0x26')](handleError(_0x3456b6,null));};exports[_0xa0d5('0x38')]=function(_0x105166,_0xf2a53b,_0x4338ae){var _0x5e6cac,_0x5d883c,_0x313c97;if(_['isNil'](_0x105166[_0xa0d5('0x58')]['body'])||_0x105166['body'][_0xa0d5('0x58')]===''){throw new db[(_0xa0d5('0x72'))]['ValidationError'](_0xa0d5('0x8d'));}if(_[_0xa0d5('0x8b')](_0x105166[_0xa0d5('0x58')]['to'])){throw new db[(_0xa0d5('0x72'))]['ValidationError']('to\x20is\x20mandatory');}_0x5e6cac=_0x105166[_0xa0d5('0x58')]['to'];return db[_0xa0d5('0x3c')][_0xa0d5('0x56')]({'where':{'id':_0x105166[_0xa0d5('0x54')]['id']},'include':[{'model':db[_0xa0d5('0x90')],'as':_0xa0d5('0xb5'),'include':[{'model':db[_0xa0d5('0x91')],'as':_0xa0d5('0x95'),'where':{'mobile':_0x5e6cac},'limit':0x1,'order':[[_0xa0d5('0x77'),_0xa0d5('0x92')]]}]}]})[_0xa0d5('0x32')](handleEntityNotFound(_0xf2a53b,null))[_0xa0d5('0x32')](function(_0x32f4a9){if(_0x32f4a9&&_0x32f4a9['List']){_0x5d883c=_0x32f4a9[_0xa0d5('0x33')]({'plain':!![]});if(_0x5d883c[_0xa0d5('0xb5')]&&_0x5d883c[_0xa0d5('0xb5')][_0xa0d5('0x95')][_0xa0d5('0x44')]){return _0x5d883c['List']['Contacts'][0x0];}return db[_0xa0d5('0x91')][_0xa0d5('0x57')](_[_0xa0d5('0x15')](_0x105166['body'],{'firstName':_0x5e6cac,'mobile':_0x5e6cac,'phone':_0x5e6cac,'ListId':_0x5d883c[_0xa0d5('0x79')]}));}})['then'](handleEntityNotFound(_0xf2a53b,null))[_0xa0d5('0x32')](function(_0x9d2e08){if(_0x9d2e08){_0x313c97=_0x9d2e08;return db[_0xa0d5('0x97')][_0xa0d5('0x56')]({'where':{'ContactId':_0x313c97['id'],'closed':![],'SmsAccountId':_0x5d883c['id']}})[_0xa0d5('0x32')](function(_0x247121){if(_0x247121){return[_0x247121,![]];}return db['SmsInteraction'][_0xa0d5('0x57')]({'UserId':_0x105166['user']['id'],'ContactId':_0x313c97['id'],'SmsAccountId':_0x5d883c['id'],'phone':_0x5e6cac,'firstMsgDirection':_0xa0d5('0xb6'),'Messages':[_[_0xa0d5('0x4d')](_0x105166[_0xa0d5('0x58')],{'read':![],'body':_0x105166['body'][_0xa0d5('0x58')],'phone':_0x5e6cac,'SmsAccountId':_0x5d883c['id'],'UserId':_0x105166[_0xa0d5('0x5b')]['id'],'ContactId':_0x313c97['id']})]},{'include':[{'model':db[_0xa0d5('0x9f')],'as':'Messages'}]})[_0xa0d5('0x32')](function(_0x215115){return[_0x215115,!![]];});});}})[_0xa0d5('0x98')](function(_0x1498e0,_0x172730){if(_0x172730){return _0x1498e0;}return db['SmsMessage'][_0xa0d5('0x57')](_['merge'](_0x105166['body'],{'read':![],'body':_0x105166['body'][_0xa0d5('0x58')],'phone':_0x5e6cac,'SmsAccountId':_0x5d883c['id'],'SmsInteractionId':_0x1498e0['id'],'UserId':_0x105166[_0xa0d5('0x5b')]['id'],'ContactId':_0x313c97['id']}))[_0xa0d5('0x32')](function(_0x2a223a){_0x1498e0[_0xa0d5('0xb7')]['Messages']=[];_0x1498e0[_0xa0d5('0xb7')][_0xa0d5('0xb8')][_0xa0d5('0x9c')](_0x2a223a[_0xa0d5('0xb7')]);return _0x1498e0;});})[_0xa0d5('0x32')](respondWithResult(_0xf2a53b,null))['catch'](handleError(_0xf2a53b,null));};exports[_0xa0d5('0x29')]=function(_0x398a6f,_0x317974,_0x10fb70){if(_0x398a6f['body']['id']){delete _0x398a6f[_0xa0d5('0x58')]['id'];}console[_0xa0d5('0xb9')]('endpoint\x20/status\x20POST\x20/',_0x398a6f[_0xa0d5('0x58')]);var _0x3d7af5,_0x14695f,_0x4a6812;return db['SmsAccount']['find']({'where':{'id':_0x398a6f[_0xa0d5('0x54')]['id']}})[_0xa0d5('0x32')](handleEntityNotFound(_0x317974,null))[_0xa0d5('0x32')](function(_0x58353f){if(_0x58353f){_0x4a6812=_0x58353f;logger[_0xa0d5('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa0d5('0xba'),_0x58353f[_0xa0d5('0x4f')],util['inspect'](_0x398a6f[_0xa0d5('0x58')],{'showHidden':![],'depth':null}));switch(_0x58353f[_0xa0d5('0x4f')]){case _0xa0d5('0xbb'):if(_0x398a6f['body'][_0xa0d5('0xbc')]&&_0x398a6f['body'][_0xa0d5('0x29')]){_0x14695f=_0x398a6f[_0xa0d5('0x58')][_0xa0d5('0x29')];return db[_0xa0d5('0x9f')]['find']({'where':{'messageId':_0x398a6f[_0xa0d5('0x58')][_0xa0d5('0xbc')]}});}break;case'connectel':if(_0x398a6f[_0xa0d5('0x58')][_0xa0d5('0xbd')]&&_0x398a6f[_0xa0d5('0x58')][_0xa0d5('0xbe')]){_0x14695f=_0x398a6f[_0xa0d5('0x58')][_0xa0d5('0xbe')];return db[_0xa0d5('0x9f')][_0xa0d5('0x56')]({'where':{'messageId':_0x398a6f[_0xa0d5('0x58')]['requestid']}});}break;case _0xa0d5('0x80'):if(_0x398a6f[_0xa0d5('0x58')][_0xa0d5('0x81')]&&_0x398a6f['body']['status_code']){_0x14695f=_0x398a6f[_0xa0d5('0x58')]['status_code'];return db['SmsMessage'][_0xa0d5('0x56')]({'where':{'messageId':_0x398a6f[_0xa0d5('0x58')][_0xa0d5('0x81')]}});}break;case _0xa0d5('0x83'):var _0x2b77c6=_0x398a6f[_0xa0d5('0x58')][_0xa0d5('0x84')][0x0];if(_0x2b77c6[_0xa0d5('0x7d')]&&_0x2b77c6['status']['groupName']===_0xa0d5('0xbf')){_0x14695f=_0x2b77c6[_0xa0d5('0x29')][_0xa0d5('0xc0')];return db[_0xa0d5('0x9f')][_0xa0d5('0x56')]({'where':{'messageId':_0x2b77c6[_0xa0d5('0x7d')]}});}break;case _0xa0d5('0x88'):if(_0x398a6f[_0xa0d5('0x58')][_0xa0d5('0x7d')]&&_0x398a6f['body'][_0xa0d5('0x29')]){_0x14695f=_0x398a6f[_0xa0d5('0x58')][_0xa0d5('0x29')];return db[_0xa0d5('0x9f')][_0xa0d5('0x56')]({'where':{'messageId':_0x398a6f['body'][_0xa0d5('0x7d')]}});}break;case _0xa0d5('0x8a'):if(_0x398a6f['body'][_0xa0d5('0xc1')]&&_0x398a6f[_0xa0d5('0x58')][_0xa0d5('0x29')]){_0x14695f=_0x398a6f[_0xa0d5('0x58')][_0xa0d5('0x29')];return db[_0xa0d5('0x9f')][_0xa0d5('0x56')]({'where':{'messageId':_0x398a6f['body'][_0xa0d5('0xc1')]}});}break;}}})[_0xa0d5('0x32')](handleEntityNotFound(_0x317974,null))[_0xa0d5('0x32')](function(_0x18a239){if(_0x18a239){_0x3d7af5=_0x18a239;switch(_0x4a6812[_0xa0d5('0x4f')]){case'skebby':if(_0x14695f===_0xa0d5('0xbf')){return _0x3d7af5['update']({'read':!![]});}else{logger[_0xa0d5('0x23')](_0xa0d5('0xa7'),_0xa0d5('0x29'),_0xa0d5('0xbb'),util[_0xa0d5('0xc2')](_0x398a6f['body'],{'showHidden':![],'depth':null}));}break;case _0xa0d5('0xc3'):if(_0x14695f==='1'){return _0x3d7af5[_0xa0d5('0x30')]({'read':!![]});}else{logger[_0xa0d5('0x23')](_0xa0d5('0xa7'),'status','skebby',util[_0xa0d5('0xc2')](_0x398a6f[_0xa0d5('0x58')],{'showHidden':![],'depth':null}));}break;case _0xa0d5('0x80'):if(!_0x398a6f[_0xa0d5('0x58')][_0xa0d5('0xc4')]&&_0x14695f>=0xc8&&_0x14695f<=0xce){return _0x3d7af5[_0xa0d5('0x30')]({'read':!![]});}else{logger[_0xa0d5('0x23')](_0xa0d5('0xa7'),_0xa0d5('0x29'),'clicksend',util['inspect'](_0x398a6f[_0xa0d5('0x58')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4b67ed=_0x398a6f['body'][_0xa0d5('0x84')][0x0];if(_0x4b67ed[_0xa0d5('0x29')]['groupName']===_0xa0d5('0xbf')){return _0x3d7af5[_0xa0d5('0x30')]({'read':!![]});}else{logger['error'](_0xa0d5('0xa7'),_0xa0d5('0x29'),_0xa0d5('0x83'),util[_0xa0d5('0xc2')](_0x398a6f[_0xa0d5('0x58')],{'showHidden':![],'depth':null}));}break;case _0xa0d5('0x88'):if(_0x14695f==_0xa0d5('0xc5')||_0x14695f==_0xa0d5('0xc6')){return _0x3d7af5['update']({'read':!![]});}else{logger[_0xa0d5('0x23')](_0xa0d5('0xa7'),_0xa0d5('0x29'),'clickatell',util['inspect'](_0x398a6f[_0xa0d5('0x58')],{'showHidden':![],'depth':null}));}break;case _0xa0d5('0x8a'):if(_0x14695f==='DELIVRD'||_0x14695f===_0xa0d5('0xc7')){return _0x3d7af5['update']({'read':!![]});}else{logger[_0xa0d5('0x23')](_0xa0d5('0xa7'),'status',_0xa0d5('0x8a'),util[_0xa0d5('0xc2')](_0x398a6f['body'],{'showHidden':![],'depth':null}));}break;}return _0x3d7af5;}})[_0xa0d5('0x32')](respondWithResult(_0x317974,null))[_0xa0d5('0x26')](handleError(_0x317974,null));};exports['statusGet']=function(_0x47ab87,_0x20f316,_0x32e8c3){var _0x235740,_0xffc045,_0x47be46;return db['SmsAccount'][_0xa0d5('0x56')]({'where':{'id':_0x47ab87[_0xa0d5('0x54')]['id']}})['then'](handleEntityNotFound(_0x20f316,null))['then'](function(_0x17b0b2){if(_0x17b0b2){_0x47be46=_0x17b0b2;logger[_0xa0d5('0x20')](_0xa0d5('0xa7'),_0xa0d5('0x29'),_0xa0d5('0xba'),_0x17b0b2[_0xa0d5('0x4f')],util[_0xa0d5('0xc2')](_0x47ab87[_0xa0d5('0x3e')],{'showHidden':![],'depth':null}));switch(_0x17b0b2[_0xa0d5('0x4f')]){case _0xa0d5('0x86'):if(_0x47ab87[_0xa0d5('0x3e')]['message-id']&&_0x47ab87[_0xa0d5('0x3e')][_0xa0d5('0xc8')]){_0xffc045=_0x47ab87[_0xa0d5('0x3e')][_0xa0d5('0xc8')];return db['SmsMessage'][_0xa0d5('0x56')]({'where':{'messageId':_0x47ab87[_0xa0d5('0x3e')][_0xa0d5('0xc9')]}});}break;}}})[_0xa0d5('0x32')](handleEntityNotFound(_0x20f316,null))[_0xa0d5('0x32')](function(_0x5c162d){if(_0x5c162d){_0x235740=_0x5c162d;switch(_0x47be46[_0xa0d5('0x4f')]){case _0xa0d5('0x86'):if(_0xffc045==='2'||_0xffc045==='6'){return _0x235740[_0xa0d5('0x30')]({'read':!![]});}else{logger[_0xa0d5('0x23')](_0xa0d5('0xa7'),_0xa0d5('0x29'),'csc',util[_0xa0d5('0xc2')](_0x47ab87['query'],{'showHidden':![],'depth':null}));};break;}return _0x235740;}})[_0xa0d5('0x32')](respondWithResult(_0x20f316,null))[_0xa0d5('0x26')](handleError(_0x20f316,null));};exports[_0xa0d5('0xca')]=function(_0x117b31,_0x4ee3d0,_0x398a05){return db['SmsAccount'][_0xa0d5('0x56')]({'where':{'id':_0x117b31[_0xa0d5('0x54')]['id']}})[_0xa0d5('0x32')](handleEntityNotFound(_0x4ee3d0,null))['then'](function(_0x587ad2){if(_0x587ad2){return _0x587ad2[_0xa0d5('0xca')](_0x117b31['body'][_0xa0d5('0x69')],_[_0xa0d5('0x94')](_0x117b31[_0xa0d5('0x58')],[_0xa0d5('0x69'),'id'])||{})[_0xa0d5('0x98')](function(_0x2004c3){for(var _0x3f3c59=0x0;_0x3f3c59<_0x117b31[_0xa0d5('0x58')][_0xa0d5('0x69')][_0xa0d5('0x44')];_0x3f3c59+=0x1){socket[_0xa0d5('0xcb')](_0xa0d5('0xcc'),{'UserId':_0x117b31[_0xa0d5('0x58')][_0xa0d5('0x69')][_0x3f3c59],'SmsAccountId':_0x117b31[_0xa0d5('0x54')]['id']});}return _0x2004c3;});}})[_0xa0d5('0x32')](respondWithResult(_0x4ee3d0,null))['catch'](handleError(_0x4ee3d0,null));};exports[_0xa0d5('0xcd')]=function(_0x221b4c,_0x315226,_0x3495fc){var _0x427e7e;return db[_0xa0d5('0x3c')]['find']({'where':{'id':_0x221b4c[_0xa0d5('0x54')]['id']}})[_0xa0d5('0x32')](handleEntityNotFound(_0x315226,null))['then'](function(_0x396931){if(_0x396931){return _0x396931[_0xa0d5('0xcd')](_0x221b4c[_0xa0d5('0x3e')][_0xa0d5('0x69')])['then'](function(_0x424a31){if(_[_0xa0d5('0xce')](_0x221b4c[_0xa0d5('0x3e')]['ids'])){for(var _0x5d4bfe=0x0;_0x5d4bfe<_0x221b4c[_0xa0d5('0x3e')][_0xa0d5('0x69')]['length'];_0x5d4bfe+=0x1){socket[_0xa0d5('0xcb')](_0xa0d5('0xcf'),{'UserId':_0x221b4c['query'][_0xa0d5('0x69')][_0x5d4bfe],'SmsAccountId':_0x221b4c['params']['id']});}}else{socket[_0xa0d5('0xcb')](_0xa0d5('0xcf'),{'UserId':_0x221b4c[_0xa0d5('0x3e')]['ids'],'SmsAccountId':_0x221b4c['params']['id']});}});}})['then'](respondWithStatusCode(_0x315226,null))[_0xa0d5('0x26')](handleError(_0x315226,null));};exports[_0xa0d5('0xd0')]=function(_0x249963,_0x3f273e,_0x359077){var _0x6b67cb={};var _0x1d8fcb={};var _0x21b672;var _0x3daa99;return db[_0xa0d5('0x3c')][_0xa0d5('0x63')]({'where':{'id':_0x249963[_0xa0d5('0x54')]['id']}})[_0xa0d5('0x32')](handleEntityNotFound(_0x3f273e,null))['then'](function(_0x143b96){if(_0x143b96){_0x21b672=_0x143b96;_0x1d8fcb[_0xa0d5('0x42')]=_[_0xa0d5('0x3f')](db['User'][_0xa0d5('0x3d')]);_0x1d8fcb[_0xa0d5('0x3e')]=_[_0xa0d5('0x3f')](_0x249963[_0xa0d5('0x3e')]);_0x1d8fcb[_0xa0d5('0x4a')]=_[_0xa0d5('0x40')](_0x1d8fcb[_0xa0d5('0x42')],_0x1d8fcb[_0xa0d5('0x3e')]);_0x6b67cb[_0xa0d5('0x41')]=_[_0xa0d5('0x40')](_0x1d8fcb['model'],qs[_0xa0d5('0x43')](_0x249963['query'][_0xa0d5('0x43')]));_0x6b67cb[_0xa0d5('0x41')]=_0x6b67cb[_0xa0d5('0x41')][_0xa0d5('0x44')]?_0x6b67cb[_0xa0d5('0x41')]:_0x1d8fcb[_0xa0d5('0x42')];_0x6b67cb[_0xa0d5('0x47')]=qs[_0xa0d5('0x48')](_0x249963['query'][_0xa0d5('0x48')]);_0x6b67cb[_0xa0d5('0x49')]=qs[_0xa0d5('0x4a')](_['pick'](_0x249963[_0xa0d5('0x3e')],_0x1d8fcb[_0xa0d5('0x4a')]));if(_0x249963[_0xa0d5('0x3e')]['filter']){_0x6b67cb[_0xa0d5('0x49')]=_[_0xa0d5('0x4d')](_0x6b67cb[_0xa0d5('0x49')],{'$or':_[_0xa0d5('0x4e')](_0x6b67cb['attributes'],function(_0x1a246f){var _0x4c2109={};_0x4c2109[_0x1a246f]={'$like':'%'+_0x249963['query'][_0xa0d5('0x4c')]+'%'};return _0x4c2109;})});}_0x6b67cb=_[_0xa0d5('0x4d')]({},_0x6b67cb,_0x249963[_0xa0d5('0x55')]);return _0x21b672['getAgents'](_0x6b67cb);}})[_0xa0d5('0x32')](function(_0x3c7b17){if(_0x3c7b17){_0x3daa99=_0x3c7b17['length'];if(!_0x249963['query'][_0xa0d5('0x45')]('nolimit')){_0x6b67cb[_0xa0d5('0x2d')]=qs[_0xa0d5('0x2d')](_0x249963[_0xa0d5('0x3e')][_0xa0d5('0x2d')]);_0x6b67cb[_0xa0d5('0x2c')]=qs[_0xa0d5('0x2c')](_0x249963[_0xa0d5('0x3e')][_0xa0d5('0x2c')]);}return _0x21b672[_0xa0d5('0xd0')](_0x6b67cb);}})[_0xa0d5('0x32')](function(_0x5b8005){if(_0x5b8005){return _0x5b8005?{'count':_0x3daa99,'rows':_0x5b8005}:null;}})[_0xa0d5('0x32')](respondWithResult(_0x3f273e,null))[_0xa0d5('0x26')](handleError(_0x3f273e,null));}; \ No newline at end of file +var _0x1fe1=['replyMessageId','intelepeer','refid','Sequelize','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','omit','defaults','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','Messages','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','redif','DELIVRD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','findOne','pick','removeAnswers','notify','SmsApplication','account','applications','orderBy','priority','asc','Applications','CmContact','ValidationError','difference','createdAt','updatedAt','ListId','mobile','twilio','from','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fe1,0x128));var _0x11fe=function(_0x528c98,_0x3f58be){_0x528c98=_0x528c98-0x0;var _0x5c9ae6=_0x1fe1[_0x528c98];return _0x5c9ae6;};'use strict';var pdf=require(_0x11fe('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x11fe('0x1'));var jsonpatch=require(_0x11fe('0x2'));var rp=require(_0x11fe('0x3'));var moment=require('moment');var BPromise=require(_0x11fe('0x4'));var Mustache=require('mustache');var util=require(_0x11fe('0x5'));var path=require(_0x11fe('0x6'));var sox=require(_0x11fe('0x7'));var csv=require(_0x11fe('0x8'));var ejs=require(_0x11fe('0x9'));var fs=require('fs');var _=require(_0x11fe('0xa'));var squel=require(_0x11fe('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x11fe('0xc'));var toCsv=require(_0x11fe('0x8'));var querystring=require(_0x11fe('0xd'));var Papa=require('papaparse');var authService=require(_0x11fe('0xe'));var hardwareService=require(_0x11fe('0xf'));var Redis=require(_0x11fe('0x10'));var qs=require(_0x11fe('0x11'));var logger=require(_0x11fe('0x12'))(_0x11fe('0x13'));var utils=require(_0x11fe('0x14'));var config=require(_0x11fe('0x15'));var db=require('../../mysqldb')['db'];config[_0x11fe('0x16')]=_['defaults'](config[_0x11fe('0x16')],{'host':_0x11fe('0x17'),'port':0x18eb});var socket=require(_0x11fe('0x18'))(new Redis(config[_0x11fe('0x16')]));require('./smsAccount.socket')[_0x11fe('0x19')](socket);var jayson=require(_0x11fe('0x1a'));var client=jayson['client'][_0x11fe('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x31bf2c,_0x2166d9,_0xb0a33e,_0x4fcb7f){return new BPromise(function(_0x2d810f,_0x42f326){var _0x3b2205=_0x4fcb7f||client;return _0x3b2205[_0x11fe('0x1c')](_0x31bf2c,_0xb0a33e)[_0x11fe('0x1d')](function(_0x3140ca){logger[_0x11fe('0x1e')]('SmsAccount,\x20%s,\x20%s',_0x2166d9,_0x11fe('0x1f'));logger[_0x11fe('0x20')](_0x11fe('0x21'),_0x2166d9,_0x11fe('0x1f'),JSON[_0x11fe('0x22')](_0x3140ca));if(_0x3140ca[_0x11fe('0x23')]){if(_0x3140ca['error']['code']===0x1f4){logger[_0x11fe('0x23')](_0x11fe('0x24'),_0x2166d9,_0x3140ca['error'][_0x11fe('0x25')]);return _0x42f326(_0x3140ca[_0x11fe('0x23')][_0x11fe('0x25')]);}logger[_0x11fe('0x23')](_0x11fe('0x24'),_0x2166d9,_0x3140ca['error'][_0x11fe('0x25')]);return _0x2d810f(_0x3140ca[_0x11fe('0x23')][_0x11fe('0x25')]);}else{logger['info'](_0x11fe('0x24'),_0x2166d9,_0x11fe('0x1f'));_0x2d810f(_0x3140ca[_0x11fe('0x26')][_0x11fe('0x25')]);}})[_0x11fe('0x27')](function(_0x16dbaa){logger[_0x11fe('0x23')](_0x11fe('0x24'),_0x2166d9,_0x16dbaa);_0x42f326(_0x16dbaa);});});}function respondWithStatusCode(_0x2b3bb8,_0x3bd21e){_0x3bd21e=_0x3bd21e||0xcc;return function(_0x414f67){if(_0x414f67){return _0x2b3bb8[_0x11fe('0x28')](_0x3bd21e);}return _0x2b3bb8[_0x11fe('0x29')](_0x3bd21e)['end']();};}function respondWithResult(_0x26384c,_0x334561){_0x334561=_0x334561||0xc8;return function(_0x1d77bf){if(_0x1d77bf){return _0x26384c[_0x11fe('0x29')](_0x334561)[_0x11fe('0x2a')](_0x1d77bf);}};}function respondWithFilteredResult(_0x361b4d,_0x19f505){return function(_0x119891){if(_0x119891){var _0x3d03a5=_0x119891[_0x11fe('0x2b')],_0x1869c5=_0x19f505[_0x11fe('0x2c')],_0x5a16fa=_0x19f505[_0x11fe('0x2c')]+_0x19f505[_0x11fe('0x2d')],_0x3b07b0;if(_0x5a16fa>=_0x3d03a5){_0x5a16fa=_0x3d03a5;_0x3b07b0=0xc8;}else{_0x3b07b0=0xce;}_0x361b4d[_0x11fe('0x29')](_0x3b07b0);return _0x361b4d[_0x11fe('0x2e')]('Content-Range',_0x1869c5+'-'+_0x5a16fa+'/'+_0x3d03a5)[_0x11fe('0x2a')](_0x119891);}return null;};}function patchUpdates(_0x29368a){return function(_0x1183df){try{jsonpatch[_0x11fe('0x2f')](_0x1183df,_0x29368a,!![]);}catch(_0x285597){return BPromise[_0x11fe('0x30')](_0x285597);}return _0x1183df[_0x11fe('0x31')]();};}function saveUpdates(_0x4f090e,_0x4e52a4){return function(_0x4fc43a){if(_0x4fc43a){return _0x4fc43a[_0x11fe('0x32')](_0x4f090e)[_0x11fe('0x1d')](function(_0x5d9ba2){return _0x5d9ba2;});}return null;};}function removeEntity(_0x45b5bf,_0x16ba45){return function(_0x3ff47b){if(_0x3ff47b){return _0x3ff47b[_0x11fe('0x33')]()[_0x11fe('0x1d')](function(){var _0x5d85df=_0x3ff47b[_0x11fe('0x34')]({'plain':!![]});var _0xeeab9=_0x11fe('0x35');return db[_0x11fe('0x36')][_0x11fe('0x33')]({'where':{'type':_0xeeab9,'resourceId':_0x5d85df['id']}})['then'](function(){return _0x3ff47b;});})[_0x11fe('0x1d')](function(){_0x45b5bf[_0x11fe('0x29')](0xcc)[_0x11fe('0x37')]();});}};}function handleEntityNotFound(_0x3f51d1,_0x5afc4d){return function(_0x42c9c0){if(!_0x42c9c0){_0x3f51d1[_0x11fe('0x28')](0x194);}return _0x42c9c0;};}function handleError(_0x4ca5b0,_0x242278){_0x242278=_0x242278||0x1f4;return function(_0x54a8ce){logger['error'](_0x54a8ce[_0x11fe('0x38')]);if(_0x54a8ce[_0x11fe('0x39')]){delete _0x54a8ce['name'];}_0x4ca5b0[_0x11fe('0x29')](_0x242278)[_0x11fe('0x3a')](_0x54a8ce);};}exports[_0x11fe('0x3b')]=function(_0x26e4f5,_0x3f4ef3){var _0x266780={'include':[{'model':db[_0x11fe('0x3c')],'as':_0x11fe('0x3d')}]},_0x664621={},_0x279fa2={'count':0x0,'rows':[]};var _0x45e394=db[_0x11fe('0x3e')][_0x11fe('0x3f')];_0x664621[_0x11fe('0x40')]=_[_0x11fe('0x41')](_0x45e394);_0x664621[_0x11fe('0x42')]=_[_0x11fe('0x41')](_0x26e4f5[_0x11fe('0x42')]);_0x664621[_0x11fe('0x43')]=_[_0x11fe('0x44')](_0x664621[_0x11fe('0x40')],_0x664621[_0x11fe('0x42')]);_0x266780[_0x11fe('0x45')]=_['intersection'](_0x664621[_0x11fe('0x40')],qs['fields'](_0x26e4f5[_0x11fe('0x42')][_0x11fe('0x46')]));_0x266780[_0x11fe('0x45')]=_0x266780['attributes'][_0x11fe('0x47')]?_0x266780[_0x11fe('0x45')]:_0x664621[_0x11fe('0x40')];if(!_0x26e4f5['query'][_0x11fe('0x48')](_0x11fe('0x49'))){_0x266780[_0x11fe('0x2d')]=qs['limit'](_0x26e4f5[_0x11fe('0x42')]['limit']);_0x266780[_0x11fe('0x2c')]=qs[_0x11fe('0x2c')](_0x26e4f5[_0x11fe('0x42')][_0x11fe('0x2c')]);}_0x266780[_0x11fe('0x4a')]=qs[_0x11fe('0x4b')](_0x26e4f5[_0x11fe('0x42')]['sort']);_0x266780[_0x11fe('0x4c')]=qs[_0x11fe('0x43')](_['pick'](_0x26e4f5['query'],_0x664621[_0x11fe('0x43')]));if(_0x26e4f5['query'][_0x11fe('0x4d')]){_0x266780['where']=_[_0x11fe('0x4e')](_0x266780[_0x11fe('0x4c')],{'$or':_[_0x11fe('0x4f')](_0x45e394,function(_0x20564e){if(_0x20564e[_0x11fe('0x50')][_0x11fe('0x51')]!==_0x11fe('0x52')){var _0x2fb6be={};_0x2fb6be[_0x20564e[_0x11fe('0x53')]]={'$like':'%'+_0x26e4f5['query']['filter']+'%'};return _0x2fb6be;}})});}_0x266780=_[_0x11fe('0x4e')]({},_0x266780,_0x26e4f5[_0x11fe('0x54')]);var _0x4a29ba={'where':_0x266780['where']};return db[_0x11fe('0x3e')][_0x11fe('0x2b')](_0x4a29ba)[_0x11fe('0x1d')](function(_0x34e9fc){_0x279fa2['count']=_0x34e9fc;if(_0x26e4f5['query'][_0x11fe('0x55')]){_0x266780[_0x11fe('0x56')]=[{'all':!![]}];}return db[_0x11fe('0x3e')][_0x11fe('0x57')](_0x266780);})[_0x11fe('0x1d')](function(_0xaa6d1f){_0x279fa2[_0x11fe('0x58')]=_0xaa6d1f;return _0x279fa2;})['then'](respondWithFilteredResult(_0x3f4ef3,_0x266780))[_0x11fe('0x27')](handleError(_0x3f4ef3,null));};exports[_0x11fe('0x59')]=function(_0x1e979a,_0x42706a){var _0x294701={'raw':![],'where':{'id':_0x1e979a[_0x11fe('0x5a')]['id']},'include':[{'model':db[_0x11fe('0x3c')],'as':_0x11fe('0x3d')}]},_0x2448e7={};_0x2448e7[_0x11fe('0x40')]=_[_0x11fe('0x41')](db[_0x11fe('0x3e')][_0x11fe('0x3f')]);_0x2448e7[_0x11fe('0x42')]=_[_0x11fe('0x41')](_0x1e979a[_0x11fe('0x42')]);_0x2448e7[_0x11fe('0x43')]=_[_0x11fe('0x44')](_0x2448e7[_0x11fe('0x40')],_0x2448e7[_0x11fe('0x42')]);_0x294701[_0x11fe('0x45')]=_['intersection'](_0x2448e7[_0x11fe('0x40')],qs[_0x11fe('0x46')](_0x1e979a[_0x11fe('0x42')]['fields']));_0x294701[_0x11fe('0x45')]=_0x294701[_0x11fe('0x45')][_0x11fe('0x47')]?_0x294701[_0x11fe('0x45')]:_0x2448e7[_0x11fe('0x40')];if(_0x1e979a['query'][_0x11fe('0x55')]){_0x294701[_0x11fe('0x56')]=[{'all':!![]}];}_0x294701=_['merge']({},_0x294701,_0x1e979a['options']);return db[_0x11fe('0x3e')][_0x11fe('0x5b')](_0x294701)[_0x11fe('0x1d')](handleEntityNotFound(_0x42706a,null))[_0x11fe('0x1d')](respondWithResult(_0x42706a,null))[_0x11fe('0x27')](handleError(_0x42706a,null));};exports[_0x11fe('0x5c')]=function(_0x1f67f3,_0x40a9f4){return db[_0x11fe('0x3e')][_0x11fe('0x5c')](_0x1f67f3[_0x11fe('0x5d')],{})[_0x11fe('0x1d')](function(_0x183627){var _0x4f6325=_0x1f67f3[_0x11fe('0x5e')][_0x11fe('0x34')]({'plain':!![]});if(!_0x4f6325)throw new Error(_0x11fe('0x5f'));if(_0x4f6325[_0x11fe('0x60')]===_0x11fe('0x5e')){var _0x22995a=_0x183627['get']({'plain':!![]});var _0x2909a8=_0x11fe('0x35');return db[_0x11fe('0x61')][_0x11fe('0x5b')]({'where':{'name':_0x2909a8,'userProfileId':_0x4f6325[_0x11fe('0x62')]},'raw':!![]})[_0x11fe('0x1d')](function(_0x226a9e){if(_0x226a9e&&_0x226a9e[_0x11fe('0x63')]===0x0){return db[_0x11fe('0x36')][_0x11fe('0x5c')]({'name':_0x22995a[_0x11fe('0x39')],'resourceId':_0x22995a['id'],'type':_0x226a9e[_0x11fe('0x39')],'sectionId':_0x226a9e['id']},{})['then'](function(){return _0x183627;});}else{return _0x183627;}})[_0x11fe('0x27')](function(_0x1f6427){logger[_0x11fe('0x23')](_0x11fe('0x64'),_0x1f6427);throw _0x1f6427;});}return _0x183627;})[_0x11fe('0x1d')](respondWithResult(_0x40a9f4,0xc9))[_0x11fe('0x27')](handleError(_0x40a9f4,null));};exports[_0x11fe('0x32')]=function(_0x1d3e5e,_0x85df60){if(_0x1d3e5e[_0x11fe('0x5d')]['id']){delete _0x1d3e5e['body']['id'];}return db[_0x11fe('0x3e')][_0x11fe('0x5b')]({'where':{'id':_0x1d3e5e[_0x11fe('0x5a')]['id']},'include':[{'model':db[_0x11fe('0x3c')],'as':_0x11fe('0x3d')}]})['then'](handleEntityNotFound(_0x85df60,null))['then'](saveUpdates(_0x1d3e5e[_0x11fe('0x5d')],null))['then'](function(_0x318727){if(_0x318727&&_0x1d3e5e[_0x11fe('0x5d')][_0x11fe('0x3d')]){return db[_0x11fe('0x3c')][_0x11fe('0x32')](_0x1d3e5e[_0x11fe('0x5d')]['mandatoryDispositionPause'],{'where':{'SmsAccountId':_0x318727['id']}})[_0x11fe('0x1d')](function(){return _0x318727;});}return _0x318727;})[_0x11fe('0x1d')](respondWithResult(_0x85df60,null))[_0x11fe('0x27')](handleError(_0x85df60,null));};exports['destroy']=function(_0xb169f6,_0x2571b4){return db[_0x11fe('0x3e')][_0x11fe('0x5b')]({'where':{'id':_0xb169f6[_0x11fe('0x5a')]['id']}})[_0x11fe('0x1d')](handleEntityNotFound(_0x2571b4,null))['then'](removeEntity(_0x2571b4,null))['catch'](handleError(_0x2571b4,null));};exports[_0x11fe('0x65')]=function(_0x55dd93,_0x26d9be){return db[_0x11fe('0x3e')][_0x11fe('0x65')]()[_0x11fe('0x1d')](respondWithResult(_0x26d9be,null))[_0x11fe('0x27')](handleError(_0x26d9be,null));};exports['addDisposition']=function(_0x1d6ce0,_0x1ed979,_0x4a4190){if(_0x1d6ce0[_0x11fe('0x5d')]['id']){delete _0x1d6ce0['body']['id'];}return db[_0x11fe('0x3e')][_0x11fe('0x5b')]({'where':{'id':_0x1d6ce0['params']['id']}})[_0x11fe('0x1d')](handleEntityNotFound(_0x1ed979,null))[_0x11fe('0x1d')](function(_0x56969d){if(_0x56969d){_0x1d6ce0[_0x11fe('0x5d')][_0x11fe('0x66')]=_0x56969d['id'];return db[_0x11fe('0x67')][_0x11fe('0x5c')](_0x1d6ce0[_0x11fe('0x5d')]);}})[_0x11fe('0x1d')](respondWithResult(_0x1ed979,null))[_0x11fe('0x27')](handleError(_0x1ed979,null));};exports[_0x11fe('0x68')]=function(_0x3b13cd,_0x11f85e,_0x3bac4f){var _0x2731eb={'raw':![],'where':{}};var _0x444582={};var _0x3950be={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x3b13cd[_0x11fe('0x5a')]['id']}})[_0x11fe('0x1d')](handleEntityNotFound(_0x11f85e,null))[_0x11fe('0x1d')](function(_0x37e602){if(_0x37e602){_0x444582['model']=_['keys'](db['Disposition']['rawAttributes']);_0x444582[_0x11fe('0x42')]=_[_0x11fe('0x41')](_0x3b13cd[_0x11fe('0x42')]);_0x444582[_0x11fe('0x43')]=_['intersection'](_0x444582[_0x11fe('0x40')],_0x444582[_0x11fe('0x42')]);_0x2731eb['attributes']=_[_0x11fe('0x44')](_0x444582[_0x11fe('0x40')],qs['fields'](_0x3b13cd['query'][_0x11fe('0x46')]));_0x2731eb[_0x11fe('0x45')]=_0x2731eb[_0x11fe('0x45')][_0x11fe('0x47')]?_0x2731eb['attributes']:_0x444582[_0x11fe('0x40')];if(!_0x3b13cd[_0x11fe('0x42')][_0x11fe('0x48')]('nolimit')){_0x2731eb[_0x11fe('0x2d')]=qs[_0x11fe('0x2d')](_0x3b13cd[_0x11fe('0x42')][_0x11fe('0x2d')]);_0x2731eb[_0x11fe('0x2c')]=qs['offset'](_0x3b13cd['query']['offset']);}_0x2731eb[_0x11fe('0x4a')]=qs[_0x11fe('0x4b')](_0x3b13cd[_0x11fe('0x42')][_0x11fe('0x4b')]);_0x2731eb['where']=qs[_0x11fe('0x43')](_['pick'](_0x3b13cd[_0x11fe('0x42')],_0x444582[_0x11fe('0x43')]));_0x2731eb[_0x11fe('0x4c')][_0x11fe('0x66')]=_0x37e602['id'];if(_0x3b13cd[_0x11fe('0x42')][_0x11fe('0x4d')]){_0x2731eb[_0x11fe('0x4c')]=_[_0x11fe('0x4e')](_0x2731eb[_0x11fe('0x4c')],{'$or':_['map'](_0x2731eb[_0x11fe('0x45')],function(_0x2a254b){var _0x5cfcad={};_0x5cfcad[_0x2a254b]={'$like':'%'+_0x3b13cd['query'][_0x11fe('0x4d')]+'%'};return _0x5cfcad;})});}_0x2731eb=_[_0x11fe('0x4e')]({},_0x2731eb,_0x3b13cd[_0x11fe('0x54')]);return db[_0x11fe('0x67')][_0x11fe('0x2b')]({'where':_0x2731eb[_0x11fe('0x4c')]})[_0x11fe('0x1d')](function(_0x544254){_0x3950be[_0x11fe('0x2b')]=_0x544254;if(_0x3b13cd[_0x11fe('0x42')][_0x11fe('0x55')]){_0x2731eb[_0x11fe('0x56')]=[{'all':!![]}];}return db[_0x11fe('0x67')]['findAll'](_0x2731eb);})[_0x11fe('0x1d')](function(_0x78ee5d){_0x3950be['rows']=_0x78ee5d;return _0x3950be;});}})[_0x11fe('0x1d')](respondWithFilteredResult(_0x11f85e,_0x2731eb))[_0x11fe('0x27')](handleError(_0x11f85e,null));};exports[_0x11fe('0x69')]=function(_0x1ab650,_0x119012,_0x4713dc){var _0xd5c2c2;return db['SmsAccount'][_0x11fe('0x5b')]({'where':{'id':_0x1ab650['params']['id']}})['then'](handleEntityNotFound(_0x119012,null))[_0x11fe('0x1d')](function(_0x1c7b05){if(_0x1c7b05){return _0x1c7b05['removeDispositions'](_0x1ab650[_0x11fe('0x42')][_0x11fe('0x6a')]);}})[_0x11fe('0x1d')](respondWithStatusCode(_0x119012,null))[_0x11fe('0x27')](handleError(_0x119012,null));};exports[_0x11fe('0x6b')]=function(_0x5d8a76,_0x1b7b32,_0x215b12){if(_0x5d8a76['body']['id']){delete _0x5d8a76[_0x11fe('0x5d')]['id'];}return db['SmsAccount'][_0x11fe('0x5b')]({'where':{'id':_0x5d8a76[_0x11fe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1b7b32,null))['then'](function(_0x1ba42e){if(_0x1ba42e){_0x5d8a76[_0x11fe('0x5d')]['SmsAccountId']=_0x1ba42e['id'];return db[_0x11fe('0x6c')][_0x11fe('0x5c')](_0x5d8a76[_0x11fe('0x5d')]);}})[_0x11fe('0x1d')](respondWithResult(_0x1b7b32,null))[_0x11fe('0x27')](handleError(_0x1b7b32,null));};exports['getAnswers']=function(_0x5f0181,_0x643636,_0x44ea3b){var _0x4a458c={'raw':![],'where':{}};var _0x49f14a={};var _0x3d2933={'count':0x0,'rows':[]};return db['SmsAccount'][_0x11fe('0x6d')]({'where':{'id':_0x5f0181[_0x11fe('0x5a')]['id']}})[_0x11fe('0x1d')](handleEntityNotFound(_0x643636,null))[_0x11fe('0x1d')](function(_0x2f075a){if(_0x2f075a){_0x49f14a['model']=_['keys'](db['CannedAnswer']['rawAttributes']);_0x49f14a[_0x11fe('0x42')]=_[_0x11fe('0x41')](_0x5f0181[_0x11fe('0x42')]);_0x49f14a[_0x11fe('0x43')]=_[_0x11fe('0x44')](_0x49f14a[_0x11fe('0x40')],_0x49f14a['query']);_0x4a458c[_0x11fe('0x45')]=_[_0x11fe('0x44')](_0x49f14a['model'],qs[_0x11fe('0x46')](_0x5f0181['query'][_0x11fe('0x46')]));_0x4a458c['attributes']=_0x4a458c[_0x11fe('0x45')]['length']?_0x4a458c[_0x11fe('0x45')]:_0x49f14a[_0x11fe('0x40')];if(!_0x5f0181['query']['hasOwnProperty'](_0x11fe('0x49'))){_0x4a458c['limit']=qs[_0x11fe('0x2d')](_0x5f0181[_0x11fe('0x42')][_0x11fe('0x2d')]);_0x4a458c[_0x11fe('0x2c')]=qs['offset'](_0x5f0181[_0x11fe('0x42')][_0x11fe('0x2c')]);}_0x4a458c[_0x11fe('0x4a')]=qs['sort'](_0x5f0181[_0x11fe('0x42')][_0x11fe('0x4b')]);_0x4a458c[_0x11fe('0x4c')]=qs[_0x11fe('0x43')](_[_0x11fe('0x6e')](_0x5f0181[_0x11fe('0x42')],_0x49f14a[_0x11fe('0x43')]));_0x4a458c['where'][_0x11fe('0x66')]=_0x2f075a['id'];if(_0x5f0181[_0x11fe('0x42')][_0x11fe('0x4d')]){_0x4a458c['where']=_[_0x11fe('0x4e')](_0x4a458c[_0x11fe('0x4c')],{'$or':_[_0x11fe('0x4f')](_0x4a458c[_0x11fe('0x45')],function(_0x2491a7){var _0x85a390={};_0x85a390[_0x2491a7]={'$like':'%'+_0x5f0181[_0x11fe('0x42')][_0x11fe('0x4d')]+'%'};return _0x85a390;})});}_0x4a458c=_[_0x11fe('0x4e')]({},_0x4a458c,_0x5f0181[_0x11fe('0x54')]);return db['CannedAnswer'][_0x11fe('0x2b')]({'where':_0x4a458c[_0x11fe('0x4c')]})[_0x11fe('0x1d')](function(_0x8c1469){_0x3d2933[_0x11fe('0x2b')]=_0x8c1469;if(_0x5f0181[_0x11fe('0x42')][_0x11fe('0x55')]){_0x4a458c[_0x11fe('0x56')]=[{'all':!![]}];}return db[_0x11fe('0x6c')][_0x11fe('0x57')](_0x4a458c);})[_0x11fe('0x1d')](function(_0x491700){_0x3d2933[_0x11fe('0x58')]=_0x491700;return _0x3d2933;});}})[_0x11fe('0x1d')](respondWithFilteredResult(_0x643636,_0x4a458c))[_0x11fe('0x27')](handleError(_0x643636,null));};exports[_0x11fe('0x6f')]=function(_0x39ac61,_0x21fe7c,_0x5ee40f){var _0x1ed2e3;return db[_0x11fe('0x3e')]['find']({'where':{'id':_0x39ac61[_0x11fe('0x5a')]['id']}})[_0x11fe('0x1d')](handleEntityNotFound(_0x21fe7c,null))['then'](function(_0x2ac277){if(_0x2ac277){return _0x2ac277[_0x11fe('0x6f')](_0x39ac61[_0x11fe('0x42')][_0x11fe('0x6a')]);}})[_0x11fe('0x1d')](respondWithStatusCode(_0x21fe7c,null))[_0x11fe('0x27')](handleError(_0x21fe7c,null));};exports[_0x11fe('0x70')]=function(_0x1c04fb,_0x49c29f,_0x2c5104){var _0x5c76e3={'channel':'sms'};var _0x315e77=[];var _0x2ecaec=[];var _0x54b7ad={};return db['SmsAccount']['find']({'where':{'id':_0x1c04fb['params']['id']},'include':[{'model':db[_0x11fe('0x71')],'as':'Applications'}]})[_0x11fe('0x1d')](handleEntityNotFound(_0x49c29f,null))[_0x11fe('0x1d')](function(_0x5e63a5){_0x5c76e3[_0x11fe('0x72')]=_0x5e63a5;_0x5c76e3[_0x11fe('0x73')]=_[_0x11fe('0x74')](_0x5e63a5['Applications'],[_0x11fe('0x75')],[_0x11fe('0x76')]);if(_0x5c76e3['account'][_0x11fe('0x77')]){delete _0x5c76e3[_0x11fe('0x72')][_0x11fe('0x77')];}return db[_0x11fe('0x78')]['describe']();})['then'](function(_0x111ee5){if(!_0x111ee5){throw new db['Sequelize'][(_0x11fe('0x79'))]('no\x20available\x20attributes');}_0x315e77=_[_0x11fe('0x7a')](_[_0x11fe('0x41')](_0x111ee5),[_0x11fe('0x7b'),_0x11fe('0x7c')]);_0x2ecaec=_[_0x11fe('0x7a')](_[_0x11fe('0x41')](_0x111ee5),[_0x11fe('0x7b'),_0x11fe('0x7c'),'CompanyId',_0x11fe('0x7d')]);_0x5c76e3[_0x11fe('0x5d')]={'mapKey':_0x11fe('0x7e')};if(_0x5c76e3[_0x11fe('0x72')][_0x11fe('0x50')]){switch(_0x5c76e3[_0x11fe('0x72')]['type']){case _0x11fe('0x7f'):_0x5c76e3['body'][_0x11fe('0x80')]=_0x1c04fb['body']['From'];_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x5d')]=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x81')];_0x5c76e3['body'][_0x11fe('0x82')]=_0x1c04fb['body'][_0x11fe('0x83')];break;case _0x11fe('0x84'):_0x5c76e3['body'][_0x11fe('0x80')]='+'+_0x1c04fb[_0x11fe('0x5d')]['sender'];_0x5c76e3['body'][_0x11fe('0x5d')]=_0x1c04fb['body'][_0x11fe('0x85')];break;case _0x11fe('0x86'):_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x80')]=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x80')];_0x5c76e3[_0x11fe('0x5d')]['body']=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x25')];break;case _0x11fe('0x87'):_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x80')]=_0x1c04fb[_0x11fe('0x5d')]['from'];_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x5d')]=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x5d')];_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x82')]=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x88')];break;case _0x11fe('0x89'):_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x80')]=_0x1c04fb[_0x11fe('0x5d')]['From'];_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x5d')]=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x8a')];_0x5c76e3[_0x11fe('0x5d')]['messageId']=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x8b')];break;case _0x11fe('0x8c'):_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x80')]='+'+_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x8d')][0x0][_0x11fe('0x80')];_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x5d')]=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x8d')][0x0][_0x11fe('0x85')];_0x5c76e3['body'][_0x11fe('0x82')]=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x8d')][0x0][_0x11fe('0x82')];break;case _0x11fe('0x8e'):_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x80')]=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x8f')];_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x5d')]=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x90')]['message'];break;case'clickatell':_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x80')]=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x91')];_0x5c76e3[_0x11fe('0x5d')]['body']=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x85')];_0x5c76e3[_0x11fe('0x5d')]['messageId']=_0x1c04fb['body'][_0x11fe('0x92')];break;case _0x11fe('0x93'):_0x5c76e3[_0x11fe('0x5d')]['from']=_0x1c04fb[_0x11fe('0x5d')]['from'];_0x5c76e3[_0x11fe('0x5d')]['body']=_0x1c04fb[_0x11fe('0x5d')][_0x11fe('0x25')];_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x82')]=_0x1c04fb['body'][_0x11fe('0x94')];break;}}if(_0x5c76e3[_0x11fe('0x5d')]['id']){delete _0x5c76e3[_0x11fe('0x5d')]['id'];}if(_['isNil'](_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x80')])){throw new db[(_0x11fe('0x95'))][(_0x11fe('0x79'))]('from\x20is\x20mandatory');}if(_[_0x11fe('0x96')](_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x5d')])||_0x5c76e3[_0x11fe('0x5d')]['body']===''){throw new db[(_0x11fe('0x95'))][(_0x11fe('0x79'))](_0x11fe('0x97'));}if(_[_0x11fe('0x96')](_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x98')])){throw new db[(_0x11fe('0x95'))][(_0x11fe('0x79'))](_0x11fe('0x99')+_0x2ecaec);}if(!_[_0x11fe('0x9a')](_0x2ecaec,_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x98')])){throw new db[(_0x11fe('0x95'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2ecaec);}_0x54b7ad[_0x5c76e3[_0x11fe('0x5d')]['mapKey']]=_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x80')];return db[_0x11fe('0x9b')][_0x11fe('0x5b')]({'where':{'id':_0x5c76e3[_0x11fe('0x72')][_0x11fe('0x7d')]},'include':[{'model':db['CmContact'],'as':_0x11fe('0x9c'),'where':_0x54b7ad,'limit':0x1,'order':[[_0x11fe('0x7c'),_0x11fe('0x9d')]]}]});})['then'](handleEntityNotFound(_0x49c29f,null))['then'](function(_0x1bb0cc){if(_0x1bb0cc){_0x5c76e3[_0x11fe('0x9e')]=_[_0x11fe('0x9f')](_0x1bb0cc,[_0x11fe('0x9c')]);if(_0x1bb0cc[_0x11fe('0x9c')][_0x11fe('0x47')]){return _0x1bb0cc[_0x11fe('0x9c')][0x0];}var _0x1c308d=_[_0x11fe('0xa0')](_0x5c76e3[_0x11fe('0x5d')],{'firstName':_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x80')],'ListId':_0x1bb0cc['id']});_0x1c308d[_0x5c76e3['body']['mapKey']]=_0x5c76e3[_0x11fe('0x5d')]['from'];return db[_0x11fe('0x78')][_0x11fe('0x5c')](_0x1c308d,{'fields':_0x315e77,'raw':!![]});}})['then'](handleEntityNotFound(_0x49c29f,null))['then'](function(_0x1d5669){if(_0x1d5669){_0x5c76e3['contact']=_0x1d5669;var _0x2b8ede={'ContactId':_0x1d5669['id'],'phone':_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x80')],'SmsAccountId':_0x1c04fb[_0x11fe('0x5a')]['id']};var _0x229ebf={'ContactId':_0x1d5669['id'],'SmsAccountId':_0x1c04fb[_0x11fe('0x5a')]['id'],'closed':![]};return db[_0x11fe('0xa1')][_0x11fe('0x5b')]({'where':_0x229ebf})[_0x11fe('0x1d')](function(_0x1583b3){if(_0x1583b3){return[_0x1583b3,![]];}return db[_0x11fe('0xa1')][_0x11fe('0x5c')](_0x2b8ede)[_0x11fe('0x1d')](function(_0x11173e){return[_0x11173e,!![]];});});}})['spread'](function(_0x190462,_0x4018ba){_0x5c76e3[_0x11fe('0xa2')]=_0x190462[_0x11fe('0x34')]({'plain':!![]});_0x5c76e3[_0x11fe('0xa2')][_0x11fe('0xa3')]=![];if(_0x4018ba){if(_0x5c76e3[_0x11fe('0x72')][_0x11fe('0xa4')]){_0x5c76e3[_0x11fe('0x73')][_0x11fe('0xa5')]({'id':0x0,'priority':_0x5c76e3['applications'][_0x11fe('0x47')]+0x1,'app':_0x11fe('0xa6'),'appdata':_0x11fe('0xa7'),'interval':_0x11fe('0xa8')});}_0x5c76e3[_0x11fe('0xa2')]['created']=!![];}return db[_0x11fe('0xa9')]['create']({'phone':_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x80')],'messageId':_0x5c76e3[_0x11fe('0x5d')][_0x11fe('0x82')],'body':_0x5c76e3[_0x11fe('0x5d')]['body'],'SmsAccountId':_0x1c04fb[_0x11fe('0x5a')]['id'],'SmsInteractionId':_0x190462['id'],'direction':'in','ContactId':_0x190462[_0x11fe('0xaa')],'AttachmentId':_0x5c76e3['body'][_0x11fe('0xab')]});})[_0x11fe('0x1d')](function(_0x5969c3){_0x5c76e3[_0x11fe('0x25')]=_0x5969c3;if(_0x5c76e3[_0x11fe('0xa2')][_0x11fe('0xac')]){return db[_0x11fe('0xad')][_0x11fe('0x5b')]({'attributes':['id',_0x11fe('0x39')],'where':{'id':_0x5c76e3['interaction'][_0x11fe('0xac')]}})['then'](function(_0x5796f1){if(_0x5796f1){_0x5c76e3[_0x11fe('0x73')]['unshift']({'id':0x0,'priority':0x0,'app':_0x11fe('0xae'),'appdata':_0x5796f1[_0x11fe('0x39')]+','+(_0x5c76e3[_0x11fe('0x72')][_0x11fe('0xaf')]||0xa),'interval':_0x11fe('0xa8')});}return respondWithRpcPromise(_0x11fe('0xb0'),_0x11fe('0xb1'),_0x5c76e3);});}return respondWithRpcPromise(_0x11fe('0xb0'),_0x11fe('0xb1'),_0x5c76e3);})['then'](function(_0x402c46){if(_0x402c46){var _0xffd2a9=0xc8;var _0x44ac80='receiveMessage';logger[_0x11fe('0x1e')](_0x11fe('0x21'),_0x44ac80,_0xffd2a9,_0x11fe('0xb2'));logger[_0x11fe('0x20')](_0x11fe('0xb3'),_0x44ac80,_0xffd2a9,'entity\x20found',JSON['stringify'](_0x402c46));if(_0x5c76e3['account'][_0x11fe('0x50')]===_0x11fe('0x7f')){return _0x49c29f['status'](_0xffd2a9)['set']('Content-Type',_0x11fe('0xb4'))[_0x11fe('0x3a')](_0x11fe('0xb5'));}else{return _0x49c29f[_0x11fe('0x29')](_0xffd2a9)[_0x11fe('0x2a')](_0x402c46);}}})[_0x11fe('0x27')](handleError(_0x49c29f,null));};exports[_0x11fe('0xb6')]=function(_0x28a371,_0x2d080b,_0x45e2a2){return db[_0x11fe('0x3e')][_0x11fe('0x6d')]({'where':{'id':_0x28a371['params']['id']}})['then'](handleEntityNotFound(_0x2d080b,null))['then'](function(_0x3037ad){if(_0x3037ad){return db[_0x11fe('0xb7')]['transaction'](function(_0x5d4e2b){return db[_0x11fe('0x71')][_0x11fe('0x33')]({'where':{'SmsAccountId':_0x28a371[_0x11fe('0x5a')]['id']},'transaction':_0x5d4e2b})['then'](function(_0xefe635){var _0x161b97=_[_0x11fe('0x4f')](_0x28a371[_0x11fe('0x5d')],function(_0x2995c2){_0x2995c2[_0x11fe('0x66')]=_0x28a371[_0x11fe('0x5a')]['id'];return _0x2995c2;});return db[_0x11fe('0x71')][_0x11fe('0xb8')](_0x161b97,{'transaction':_0x5d4e2b});});})[_0x11fe('0x1d')](function(){return db[_0x11fe('0x71')][_0x11fe('0xb9')]({'where':{'SmsAccountId':_0x28a371[_0x11fe('0x5a')]['id']},'order':_0x11fe('0x75')});});}})[_0x11fe('0x1d')](respondWithResult(_0x2d080b,null))[_0x11fe('0x27')](handleError(_0x2d080b,null));};exports[_0x11fe('0xba')]=function(_0x147c89,_0x5415a2,_0x3a84d8){var _0x3c8d78={};var _0x2a1c62={};var _0x25ed01;var _0x1f0d35;return db[_0x11fe('0x3e')][_0x11fe('0x6d')]({'where':{'id':_0x147c89[_0x11fe('0x5a')]['id']}})[_0x11fe('0x1d')](handleEntityNotFound(_0x5415a2,null))[_0x11fe('0x1d')](function(_0x2a5704){if(_0x2a5704){_0x25ed01=_0x2a5704;_0x2a1c62[_0x11fe('0x40')]=_['keys'](db[_0x11fe('0x71')][_0x11fe('0x3f')]);_0x2a1c62['query']=_[_0x11fe('0x41')](_0x147c89[_0x11fe('0x42')]);_0x2a1c62[_0x11fe('0x43')]=_[_0x11fe('0x44')](_0x2a1c62[_0x11fe('0x40')],_0x2a1c62[_0x11fe('0x42')]);_0x3c8d78['attributes']=_[_0x11fe('0x44')](_0x2a1c62[_0x11fe('0x40')],qs[_0x11fe('0x46')](_0x147c89[_0x11fe('0x42')][_0x11fe('0x46')]));_0x3c8d78[_0x11fe('0x45')]=_0x3c8d78[_0x11fe('0x45')][_0x11fe('0x47')]?_0x3c8d78['attributes']:_0x2a1c62[_0x11fe('0x40')];_0x3c8d78[_0x11fe('0x4a')]=qs[_0x11fe('0x4b')](_0x147c89['query'][_0x11fe('0x4b')]);_0x3c8d78[_0x11fe('0x4c')]=qs['filters'](_[_0x11fe('0x6e')](_0x147c89[_0x11fe('0x42')],_0x2a1c62[_0x11fe('0x43')]));if(_0x147c89[_0x11fe('0x42')][_0x11fe('0x4d')]){_0x3c8d78[_0x11fe('0x4c')]=_[_0x11fe('0x4e')](_0x3c8d78[_0x11fe('0x4c')],{'$or':_[_0x11fe('0x4f')](_0x3c8d78[_0x11fe('0x45')],function(_0x21ff7c){var _0xf512a5={};_0xf512a5[_0x21ff7c]={'$like':'%'+_0x147c89['query']['filter']+'%'};return _0xf512a5;})});}_0x3c8d78=_[_0x11fe('0x4e')]({},_0x3c8d78,_0x147c89[_0x11fe('0x54')]);return _0x25ed01[_0x11fe('0xba')](_0x3c8d78);}})['then'](function(_0x241153){if(_0x241153){_0x1f0d35=_0x241153[_0x11fe('0x47')];if(!_0x147c89[_0x11fe('0x42')][_0x11fe('0x48')](_0x11fe('0x49'))){_0x3c8d78[_0x11fe('0x2d')]=qs[_0x11fe('0x2d')](_0x147c89[_0x11fe('0x42')]['limit']);_0x3c8d78[_0x11fe('0x2c')]=qs[_0x11fe('0x2c')](_0x147c89['query'][_0x11fe('0x2c')]);}return _0x25ed01[_0x11fe('0xba')](_0x3c8d78);}})[_0x11fe('0x1d')](function(_0x5add8b){if(_0x5add8b){return _0x5add8b?{'count':_0x1f0d35,'rows':_0x5add8b}:null;}})[_0x11fe('0x1d')](respondWithResult(_0x5415a2,null))[_0x11fe('0x27')](handleError(_0x5415a2,null));};exports[_0x11fe('0xbb')]=function(_0x245148,_0x577058,_0x4d5752){var _0x49485d={'raw':![],'where':{}};var _0x50ff45={};var _0x16d012={'count':0x0,'rows':[]};return db[_0x11fe('0x3e')]['findOne']({'where':{'id':_0x245148[_0x11fe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x577058,null))[_0x11fe('0x1d')](function(_0x5ed04e){if(_0x5ed04e){_0x50ff45[_0x11fe('0x40')]=_[_0x11fe('0x41')](db[_0x11fe('0xa1')]['rawAttributes']);_0x50ff45[_0x11fe('0x42')]=_[_0x11fe('0x41')](_0x245148[_0x11fe('0x42')]);_0x50ff45['filters']=_[_0x11fe('0x44')](_0x50ff45[_0x11fe('0x40')],_0x50ff45['query']);_0x49485d[_0x11fe('0x45')]=_['intersection'](_0x50ff45['model'],qs[_0x11fe('0x46')](_0x245148[_0x11fe('0x42')][_0x11fe('0x46')]));_0x49485d['attributes']=_0x49485d[_0x11fe('0x45')][_0x11fe('0x47')]?_0x49485d[_0x11fe('0x45')]:_0x50ff45[_0x11fe('0x40')];if(!_0x245148[_0x11fe('0x42')][_0x11fe('0x48')](_0x11fe('0x49'))){_0x49485d['limit']=qs['limit'](_0x245148[_0x11fe('0x42')][_0x11fe('0x2d')]);_0x49485d[_0x11fe('0x2c')]=qs[_0x11fe('0x2c')](_0x245148[_0x11fe('0x42')]['offset']);}_0x49485d['order']=qs[_0x11fe('0x4b')](_0x245148[_0x11fe('0x42')][_0x11fe('0x4b')]);_0x49485d[_0x11fe('0x4c')]=qs[_0x11fe('0x43')](_[_0x11fe('0x6e')](_0x245148['query'],_0x50ff45[_0x11fe('0x43')]));_0x49485d[_0x11fe('0x4c')][_0x11fe('0x66')]=_0x5ed04e['id'];if(_0x245148[_0x11fe('0x42')][_0x11fe('0x4d')]){_0x49485d['where']=_[_0x11fe('0x4e')](_0x49485d[_0x11fe('0x4c')],{'$or':_[_0x11fe('0x4f')](_0x49485d['attributes'],function(_0x1f1d76){var _0x41abeb={};_0x41abeb[_0x1f1d76]={'$like':'%'+_0x245148[_0x11fe('0x42')][_0x11fe('0x4d')]+'%'};return _0x41abeb;})});}_0x49485d=_[_0x11fe('0x4e')]({},_0x49485d,_0x245148[_0x11fe('0x54')]);return db[_0x11fe('0xa1')][_0x11fe('0x2b')]({'where':_0x49485d[_0x11fe('0x4c')]})[_0x11fe('0x1d')](function(_0x3ec29c){_0x16d012[_0x11fe('0x2b')]=_0x3ec29c;if(_0x245148[_0x11fe('0x42')][_0x11fe('0x55')]){_0x49485d[_0x11fe('0x56')]=[{'model':db[_0x11fe('0x78')],'as':_0x11fe('0xbc'),'required':![]},{'model':db[_0x11fe('0xad')],'as':'Owner','attributes':[_0x11fe('0x39'),_0x11fe('0xbd'),_0x11fe('0xbe')],'required':![]},{'model':db[_0x11fe('0xbf')],'as':_0x11fe('0xc0'),'attributes':['id',_0x11fe('0x39'),_0x11fe('0xc1')],'where':_0x245148[_0x11fe('0x42')][_0x11fe('0xc2')]?{'id':_0x245148[_0x11fe('0x42')][_0x11fe('0xc2')]}:undefined,'required':_0x245148[_0x11fe('0x42')]['tag']?!![]:![]}];}return db[_0x11fe('0xa1')][_0x11fe('0x57')](_0x49485d);})['then'](function(_0x41577e){_0x16d012['rows']=_0x41577e;return _0x16d012;});}})[_0x11fe('0x1d')](respondWithFilteredResult(_0x577058,_0x49485d))[_0x11fe('0x27')](handleError(_0x577058,null));};exports[_0x11fe('0x3a')]=function(_0xbf0b8b,_0x478573,_0x394d71){var _0x159e80,_0x55ea86,_0xe8869b;if(_[_0x11fe('0x96')](_0xbf0b8b[_0x11fe('0x5d')][_0x11fe('0x5d')])||_0xbf0b8b[_0x11fe('0x5d')]['body']===''){throw new db[(_0x11fe('0x95'))]['ValidationError'](_0x11fe('0x97'));}if(_[_0x11fe('0x96')](_0xbf0b8b[_0x11fe('0x5d')]['to'])){throw new db['Sequelize']['ValidationError'](_0x11fe('0xc3'));}_0x159e80=_0xbf0b8b[_0x11fe('0x5d')]['to'];return db['SmsAccount'][_0x11fe('0x5b')]({'where':{'id':_0xbf0b8b[_0x11fe('0x5a')]['id']},'include':[{'model':db[_0x11fe('0x9b')],'as':_0x11fe('0xc4'),'include':[{'model':db[_0x11fe('0x78')],'as':_0x11fe('0x9c'),'where':{'mobile':_0x159e80},'limit':0x1,'order':[['updatedAt',_0x11fe('0x9d')]]}]}]})[_0x11fe('0x1d')](handleEntityNotFound(_0x478573,null))['then'](function(_0x2166ee){if(_0x2166ee&&_0x2166ee[_0x11fe('0xc4')]){_0x55ea86=_0x2166ee[_0x11fe('0x34')]({'plain':!![]});if(_0x55ea86[_0x11fe('0xc4')]&&_0x55ea86[_0x11fe('0xc4')][_0x11fe('0x9c')][_0x11fe('0x47')]){return _0x55ea86[_0x11fe('0xc4')][_0x11fe('0x9c')][0x0];}return db[_0x11fe('0x78')][_0x11fe('0x5c')](_[_0x11fe('0xa0')](_0xbf0b8b[_0x11fe('0x5d')],{'firstName':_0x159e80,'mobile':_0x159e80,'phone':_0x159e80,'ListId':_0x55ea86['ListId']}));}})[_0x11fe('0x1d')](handleEntityNotFound(_0x478573,null))[_0x11fe('0x1d')](function(_0x361274){if(_0x361274){_0xe8869b=_0x361274;return db[_0x11fe('0xa1')][_0x11fe('0x5b')]({'where':{'ContactId':_0xe8869b['id'],'closed':![],'SmsAccountId':_0x55ea86['id']}})[_0x11fe('0x1d')](function(_0x4be3ce){if(_0x4be3ce){return[_0x4be3ce,![]];}return db[_0x11fe('0xa1')]['create']({'UserId':_0xbf0b8b['user']['id'],'ContactId':_0xe8869b['id'],'SmsAccountId':_0x55ea86['id'],'phone':_0x159e80,'firstMsgDirection':'out','Messages':[_[_0x11fe('0x4e')](_0xbf0b8b[_0x11fe('0x5d')],{'read':![],'body':_0xbf0b8b['body'][_0x11fe('0x5d')],'phone':_0x159e80,'SmsAccountId':_0x55ea86['id'],'UserId':_0xbf0b8b[_0x11fe('0x5e')]['id'],'ContactId':_0xe8869b['id']})]},{'include':[{'model':db[_0x11fe('0xa9')],'as':_0x11fe('0xc5')}]})[_0x11fe('0x1d')](function(_0x52b004){return[_0x52b004,!![]];});});}})['spread'](function(_0x46c1ba,_0x59affc){if(_0x59affc){return _0x46c1ba;}return db[_0x11fe('0xa9')][_0x11fe('0x5c')](_[_0x11fe('0x4e')](_0xbf0b8b[_0x11fe('0x5d')],{'read':![],'body':_0xbf0b8b['body'][_0x11fe('0x5d')],'phone':_0x159e80,'SmsAccountId':_0x55ea86['id'],'SmsInteractionId':_0x46c1ba['id'],'UserId':_0xbf0b8b[_0x11fe('0x5e')]['id'],'ContactId':_0xe8869b['id']}))['then'](function(_0x282448){_0x46c1ba[_0x11fe('0xc6')][_0x11fe('0xc5')]=[];_0x46c1ba[_0x11fe('0xc6')]['Messages']['push'](_0x282448['dataValues']);return _0x46c1ba;});})[_0x11fe('0x1d')](respondWithResult(_0x478573,null))['catch'](handleError(_0x478573,null));};exports['status']=function(_0x2bd442,_0x2c7be7,_0x4fa105){if(_0x2bd442[_0x11fe('0x5d')]['id']){delete _0x2bd442['body']['id'];}console[_0x11fe('0xc7')](_0x11fe('0xc8'),_0x2bd442[_0x11fe('0x5d')]);var _0x4c06b2,_0x30a0af,_0x483650;return db['SmsAccount'][_0x11fe('0x5b')]({'where':{'id':_0x2bd442[_0x11fe('0x5a')]['id']}})[_0x11fe('0x1d')](handleEntityNotFound(_0x2c7be7,null))[_0x11fe('0x1d')](function(_0x3f5890){if(_0x3f5890){_0x483650=_0x3f5890;logger[_0x11fe('0x20')](_0x11fe('0x21'),_0x11fe('0x29'),_0x11fe('0xc9'),_0x3f5890[_0x11fe('0x50')],util[_0x11fe('0xca')](_0x2bd442[_0x11fe('0x5d')],{'showHidden':![],'depth':null}));switch(_0x3f5890[_0x11fe('0x50')]){case _0x11fe('0x84'):if(_0x2bd442[_0x11fe('0x5d')][_0x11fe('0xcb')]&&_0x2bd442[_0x11fe('0x5d')]['status']){_0x30a0af=_0x2bd442[_0x11fe('0x5d')][_0x11fe('0x29')];return db['SmsMessage']['find']({'where':{'messageId':_0x2bd442[_0x11fe('0x5d')][_0x11fe('0xcb')]}});}break;case _0x11fe('0x86'):if(_0x2bd442[_0x11fe('0x5d')][_0x11fe('0xcc')]&&_0x2bd442[_0x11fe('0x5d')][_0x11fe('0xcd')]){_0x30a0af=_0x2bd442[_0x11fe('0x5d')][_0x11fe('0xcd')];return db[_0x11fe('0xa9')][_0x11fe('0x5b')]({'where':{'messageId':_0x2bd442[_0x11fe('0x5d')][_0x11fe('0xcc')]}});}break;case'clicksend':if(_0x2bd442[_0x11fe('0x5d')][_0x11fe('0x88')]&&_0x2bd442[_0x11fe('0x5d')]['status_code']){_0x30a0af=_0x2bd442[_0x11fe('0x5d')][_0x11fe('0xce')];return db[_0x11fe('0xa9')][_0x11fe('0x5b')]({'where':{'messageId':_0x2bd442[_0x11fe('0x5d')]['message_id']}});}break;case _0x11fe('0x8c'):var _0x4b43cf=_0x2bd442['body'][_0x11fe('0x8d')][0x0];if(_0x4b43cf[_0x11fe('0x82')]&&_0x4b43cf[_0x11fe('0x29')][_0x11fe('0xcf')]===_0x11fe('0xd0')){_0x30a0af=_0x4b43cf[_0x11fe('0x29')][_0x11fe('0xcf')];return db['SmsMessage']['find']({'where':{'messageId':_0x4b43cf['messageId']}});}break;case _0x11fe('0xd1'):if(_0x2bd442[_0x11fe('0x5d')][_0x11fe('0x82')]&&_0x2bd442[_0x11fe('0x5d')]['status']){_0x30a0af=_0x2bd442['body'][_0x11fe('0x29')];return db[_0x11fe('0xa9')][_0x11fe('0x5b')]({'where':{'messageId':_0x2bd442[_0x11fe('0x5d')]['messageId']}});}break;case'intelepeer':if(_0x2bd442[_0x11fe('0x5d')]['redif']&&_0x2bd442[_0x11fe('0x5d')][_0x11fe('0x29')]){_0x30a0af=_0x2bd442[_0x11fe('0x5d')][_0x11fe('0x29')];return db[_0x11fe('0xa9')][_0x11fe('0x5b')]({'where':{'messageId':_0x2bd442[_0x11fe('0x5d')][_0x11fe('0xd2')]}});}break;}}})[_0x11fe('0x1d')](handleEntityNotFound(_0x2c7be7,null))['then'](function(_0x3a23e4){if(_0x3a23e4){_0x4c06b2=_0x3a23e4;switch(_0x483650[_0x11fe('0x50')]){case _0x11fe('0x84'):if(_0x30a0af===_0x11fe('0xd0')){return _0x4c06b2[_0x11fe('0x32')]({'read':!![]});}else{logger['error'](_0x11fe('0x21'),_0x11fe('0x29'),'skebby',util[_0x11fe('0xca')](_0x2bd442['body'],{'showHidden':![],'depth':null}));}break;case _0x11fe('0x86'):if(_0x30a0af==='1'){return _0x4c06b2[_0x11fe('0x32')]({'read':!![]});}else{logger[_0x11fe('0x23')](_0x11fe('0x21'),_0x11fe('0x29'),'skebby',util[_0x11fe('0xca')](_0x2bd442[_0x11fe('0x5d')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x2bd442[_0x11fe('0x5d')]['error_code']&&_0x30a0af>=0xc8&&_0x30a0af<=0xce){return _0x4c06b2[_0x11fe('0x32')]({'read':!![]});}else{logger[_0x11fe('0x23')](_0x11fe('0x21'),_0x11fe('0x29'),_0x11fe('0x87'),util[_0x11fe('0xca')](_0x2bd442[_0x11fe('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x11fe('0x8c'):var _0x129a48=_0x2bd442[_0x11fe('0x5d')][_0x11fe('0x8d')][0x0];if(_0x129a48[_0x11fe('0x29')][_0x11fe('0xcf')]===_0x11fe('0xd0')){return _0x4c06b2[_0x11fe('0x32')]({'read':!![]});}else{logger[_0x11fe('0x23')](_0x11fe('0x21'),'status',_0x11fe('0x8c'),util[_0x11fe('0xca')](_0x2bd442[_0x11fe('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x11fe('0xd1'):if(_0x30a0af=='DELIVERED_TO_GATEWAY'||_0x30a0af=='RECEIVED_BY_RECIPIENT'){return _0x4c06b2[_0x11fe('0x32')]({'read':!![]});}else{logger[_0x11fe('0x23')](_0x11fe('0x21'),'status',_0x11fe('0xd1'),util[_0x11fe('0xca')](_0x2bd442[_0x11fe('0x5d')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x30a0af===_0x11fe('0xd3')||_0x30a0af==='ACCEPTD'){return _0x4c06b2['update']({'read':!![]});}else{logger[_0x11fe('0x23')](_0x11fe('0x21'),_0x11fe('0x29'),_0x11fe('0x93'),util[_0x11fe('0xca')](_0x2bd442[_0x11fe('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x4c06b2;}})[_0x11fe('0x1d')](respondWithResult(_0x2c7be7,null))[_0x11fe('0x27')](handleError(_0x2c7be7,null));};exports['statusGet']=function(_0x287d35,_0x311f42,_0x2a8c55){var _0x4c02de,_0x37b7b4,_0x51162d;return db[_0x11fe('0x3e')][_0x11fe('0x5b')]({'where':{'id':_0x287d35[_0x11fe('0x5a')]['id']}})[_0x11fe('0x1d')](handleEntityNotFound(_0x311f42,null))[_0x11fe('0x1d')](function(_0x40cc88){if(_0x40cc88){_0x51162d=_0x40cc88;logger[_0x11fe('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x11fe('0x29'),_0x11fe('0xc9'),_0x40cc88['type'],util[_0x11fe('0xca')](_0x287d35[_0x11fe('0x42')],{'showHidden':![],'depth':null}));switch(_0x40cc88[_0x11fe('0x50')]){case _0x11fe('0x8e'):if(_0x287d35['query'][_0x11fe('0xd4')]&&_0x287d35[_0x11fe('0x42')][_0x11fe('0xd5')]){_0x37b7b4=_0x287d35['query'][_0x11fe('0xd5')];return db[_0x11fe('0xa9')][_0x11fe('0x5b')]({'where':{'messageId':_0x287d35[_0x11fe('0x42')][_0x11fe('0xd4')]}});}break;}}})[_0x11fe('0x1d')](handleEntityNotFound(_0x311f42,null))[_0x11fe('0x1d')](function(_0xac55b4){if(_0xac55b4){_0x4c02de=_0xac55b4;switch(_0x51162d[_0x11fe('0x50')]){case _0x11fe('0x8e'):if(_0x37b7b4==='2'||_0x37b7b4==='6'){return _0x4c02de[_0x11fe('0x32')]({'read':!![]});}else{logger['error'](_0x11fe('0x21'),_0x11fe('0x29'),_0x11fe('0x8e'),util[_0x11fe('0xca')](_0x287d35[_0x11fe('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x4c02de;}})[_0x11fe('0x1d')](respondWithResult(_0x311f42,null))[_0x11fe('0x27')](handleError(_0x311f42,null));};exports[_0x11fe('0xd6')]=function(_0x43652f,_0x29af89,_0x2aa21e){return db['SmsAccount']['find']({'where':{'id':_0x43652f[_0x11fe('0x5a')]['id']}})[_0x11fe('0x1d')](handleEntityNotFound(_0x29af89,null))['then'](function(_0x382f3c){if(_0x382f3c){return _0x382f3c[_0x11fe('0xd6')](_0x43652f[_0x11fe('0x5d')][_0x11fe('0x6a')],_[_0x11fe('0x9f')](_0x43652f[_0x11fe('0x5d')],[_0x11fe('0x6a'),'id'])||{})['spread'](function(_0x20fd4a){for(var _0x1c528b=0x0;_0x1c528b<_0x43652f[_0x11fe('0x5d')][_0x11fe('0x6a')]['length'];_0x1c528b+=0x1){socket[_0x11fe('0xd7')](_0x11fe('0xd8'),{'UserId':_0x43652f[_0x11fe('0x5d')][_0x11fe('0x6a')][_0x1c528b],'SmsAccountId':_0x43652f['params']['id']});}return _0x20fd4a;});}})[_0x11fe('0x1d')](respondWithResult(_0x29af89,null))[_0x11fe('0x27')](handleError(_0x29af89,null));};exports[_0x11fe('0xd9')]=function(_0xe28d00,_0x278617,_0x4c5eed){var _0x4cf977;return db[_0x11fe('0x3e')][_0x11fe('0x5b')]({'where':{'id':_0xe28d00[_0x11fe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x278617,null))[_0x11fe('0x1d')](function(_0x4e666f){if(_0x4e666f){return _0x4e666f['removeAgents'](_0xe28d00['query'][_0x11fe('0x6a')])[_0x11fe('0x1d')](function(_0x346efd){if(_[_0x11fe('0xda')](_0xe28d00[_0x11fe('0x42')][_0x11fe('0x6a')])){for(var _0x745990=0x0;_0x745990<_0xe28d00[_0x11fe('0x42')]['ids'][_0x11fe('0x47')];_0x745990+=0x1){socket['emit'](_0x11fe('0xdb'),{'UserId':_0xe28d00[_0x11fe('0x42')][_0x11fe('0x6a')][_0x745990],'SmsAccountId':_0xe28d00[_0x11fe('0x5a')]['id']});}}else{socket[_0x11fe('0xd7')]('userSmsAccount:remove',{'UserId':_0xe28d00[_0x11fe('0x42')]['ids'],'SmsAccountId':_0xe28d00[_0x11fe('0x5a')]['id']});}});}})[_0x11fe('0x1d')](respondWithStatusCode(_0x278617,null))[_0x11fe('0x27')](handleError(_0x278617,null));};exports[_0x11fe('0xdc')]=function(_0x1efc92,_0x1c6ab8,_0x5edb68){var _0xc6bce5={};var _0xbfeb83={};var _0x368e14;var _0x5b5c64;return db[_0x11fe('0x3e')]['findOne']({'where':{'id':_0x1efc92['params']['id']}})['then'](handleEntityNotFound(_0x1c6ab8,null))[_0x11fe('0x1d')](function(_0x3fe660){if(_0x3fe660){_0x368e14=_0x3fe660;_0xbfeb83[_0x11fe('0x40')]=_[_0x11fe('0x41')](db[_0x11fe('0xad')]['rawAttributes']);_0xbfeb83[_0x11fe('0x42')]=_[_0x11fe('0x41')](_0x1efc92[_0x11fe('0x42')]);_0xbfeb83[_0x11fe('0x43')]=_['intersection'](_0xbfeb83['model'],_0xbfeb83[_0x11fe('0x42')]);_0xc6bce5[_0x11fe('0x45')]=_['intersection'](_0xbfeb83[_0x11fe('0x40')],qs[_0x11fe('0x46')](_0x1efc92[_0x11fe('0x42')][_0x11fe('0x46')]));_0xc6bce5['attributes']=_0xc6bce5[_0x11fe('0x45')][_0x11fe('0x47')]?_0xc6bce5[_0x11fe('0x45')]:_0xbfeb83[_0x11fe('0x40')];_0xc6bce5[_0x11fe('0x4a')]=qs[_0x11fe('0x4b')](_0x1efc92[_0x11fe('0x42')]['sort']);_0xc6bce5[_0x11fe('0x4c')]=qs['filters'](_[_0x11fe('0x6e')](_0x1efc92['query'],_0xbfeb83[_0x11fe('0x43')]));if(_0x1efc92[_0x11fe('0x42')]['filter']){_0xc6bce5['where']=_[_0x11fe('0x4e')](_0xc6bce5[_0x11fe('0x4c')],{'$or':_[_0x11fe('0x4f')](_0xc6bce5[_0x11fe('0x45')],function(_0x3d9d5b){var _0x31f670={};_0x31f670[_0x3d9d5b]={'$like':'%'+_0x1efc92[_0x11fe('0x42')][_0x11fe('0x4d')]+'%'};return _0x31f670;})});}_0xc6bce5=_[_0x11fe('0x4e')]({},_0xc6bce5,_0x1efc92['options']);return _0x368e14[_0x11fe('0xdc')](_0xc6bce5);}})[_0x11fe('0x1d')](function(_0x2e529f){if(_0x2e529f){_0x5b5c64=_0x2e529f[_0x11fe('0x47')];if(!_0x1efc92[_0x11fe('0x42')][_0x11fe('0x48')](_0x11fe('0x49'))){_0xc6bce5['limit']=qs[_0x11fe('0x2d')](_0x1efc92['query'][_0x11fe('0x2d')]);_0xc6bce5['offset']=qs[_0x11fe('0x2c')](_0x1efc92[_0x11fe('0x42')][_0x11fe('0x2c')]);}return _0x368e14['getAgents'](_0xc6bce5);}})[_0x11fe('0x1d')](function(_0x19f4f2){if(_0x19f4f2){return _0x19f4f2?{'count':_0x5b5c64,'rows':_0x19f4f2}:null;}})[_0x11fe('0x1d')](respondWithResult(_0x1c6ab8,null))[_0x11fe('0x27')](handleError(_0x1c6ab8,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 297bd93..cd03b0f 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 _0x0339=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','SmsAccount'];(function(_0x239cc7,_0x13579e){var _0x4dafd2=function(_0x308c6a){while(--_0x308c6a){_0x239cc7['push'](_0x239cc7['shift']());}};_0x4dafd2(++_0x13579e);}(_0x0339,0x133));var _0x9033=function(_0x385b03,_0x542016){_0x385b03=_0x385b03-0x0;var _0x255d76=_0x0339[_0x385b03];return _0x255d76;};'use strict';var EventEmitter=require(_0x9033('0x0'));var SmsAccount=require(_0x9033('0x1'))['db'][_0x9033('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9033('0x3')](0x0);var events={'afterCreate':_0x9033('0x4'),'afterUpdate':_0x9033('0x5'),'afterDestroy':_0x9033('0x6')};function emitEvent(_0x45a02c){return function(_0x40bb0a,_0x1ed463,_0x596684){SmsAccountEvents[_0x9033('0x7')](_0x45a02c+':'+_0x40bb0a['id'],_0x40bb0a);SmsAccountEvents[_0x9033('0x7')](_0x45a02c,_0x40bb0a);_0x596684(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x9033('0x8')](e,emitEvent(event));}}module[_0x9033('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0xf429=['hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x4f3cd4,_0x1cc196){var _0x596365=function(_0x4ef06c){while(--_0x4ef06c){_0x4f3cd4['push'](_0x4f3cd4['shift']());}};_0x596365(++_0x1cc196);}(_0xf429,0x138));var _0x9f42=function(_0x5c84a6,_0x321f95){_0x5c84a6=_0x5c84a6-0x0;var _0xb8c5f0=_0xf429[_0x5c84a6];return _0xb8c5f0;};'use strict';var EventEmitter=require(_0x9f42('0x0'));var SmsAccount=require(_0x9f42('0x1'))['db'][_0x9f42('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9f42('0x3')](0x0);var events={'afterCreate':_0x9f42('0x4'),'afterUpdate':_0x9f42('0x5'),'afterDestroy':_0x9f42('0x6')};function emitEvent(_0xfaf76b){return function(_0x840d59,_0x23b416,_0x45fa83){SmsAccountEvents['emit'](_0xfaf76b+':'+_0x840d59['id'],_0x840d59);SmsAccountEvents['emit'](_0xfaf76b,_0x840d59);_0x45fa83(null);};}for(var e in events){if(events[_0x9f42('0x7')](e)){var event=events[e];SmsAccount[_0x9f42('0x8')](e,emitEvent(event));}}module[_0x9f42('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index cead73a..862fdab 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 _0x0971=['api','moment','bluebird','request-promise','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash','util','../../config/logger'];(function(_0x4dda42,_0x1b4c4f){var _0x296d27=function(_0x2633d3){while(--_0x2633d3){_0x4dda42['push'](_0x4dda42['shift']());}};_0x296d27(++_0x1b4c4f);}(_0x0971,0xc3));var _0x1097=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x0971[_0x2ca2d0];return _0x521c23;};'use strict';var _=require(_0x1097('0x0'));var util=require(_0x1097('0x1'));var logger=require(_0x1097('0x2'))(_0x1097('0x3'));var moment=require(_0x1097('0x4'));var BPromise=require(_0x1097('0x5'));var rp=require(_0x1097('0x6'));var attributes=require(_0x1097('0x7'));module['exports']=function(_0x59b01c,_0x139af0){return _0x59b01c[_0x1097('0x8')](_0x1097('0x9'),attributes,{'tableName':_0x1097('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f8c=['sms_accounts','../../config/logger','api','moment','bluebird','define','SmsAccount'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3f8c,0x104));var _0xc3f8=function(_0x2ab03a,_0x17f399){_0x2ab03a=_0x2ab03a-0x0;var _0x5a7289=_0x3f8c[_0x2ab03a];return _0x5a7289;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc3f8('0x0'))(_0xc3f8('0x1'));var moment=require(_0xc3f8('0x2'));var BPromise=require(_0xc3f8('0x3'));var rp=require('request-promise');var attributes=require('./smsAccount.attributes');module['exports']=function(_0x4e5dbd,_0x51b8b5){return _0x4e5dbd[_0xc3f8('0x4')](_0xc3f8('0x5'),attributes,{'tableName':_0xc3f8('0x6'),'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 72f9179..a602165 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 _0xe072=['include','model','ShowSmsAccount','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','client','redis','defaults','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','SmsAccount','find','options','attributes','map'];(function(_0x242d17,_0x30a922){var _0x501a6d=function(_0x4227e4){while(--_0x4227e4){_0x242d17['push'](_0x242d17['shift']());}};_0x501a6d(++_0x30a922);}(_0xe072,0xfb));var _0x2e07=function(_0xb47a00,_0x14784e){_0xb47a00=_0xb47a00-0x0;var _0x35bb27=_0xe072[_0xb47a00];return _0x35bb27;};'use strict';var _=require(_0x2e07('0x0'));var util=require('util');var moment=require(_0x2e07('0x1'));var BPromise=require(_0x2e07('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e07('0x3'))['db'];var utils=require(_0x2e07('0x4'));var logger=require('../../config/logger')(_0x2e07('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2e07('0x6')]['http']({'port':0x232a});config[_0x2e07('0x7')]=_[_0x2e07('0x8')](config[_0x2e07('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x2e07('0x9'))(new Redis(config[_0x2e07('0x7')]));require(_0x2e07('0xa'))[_0x2e07('0xb')](socket);function respondWithRpcPromise(_0x150f51,_0x1d30b4,_0x62a6b7){return new BPromise(function(_0x4a5a53,_0x3ae467){return client[_0x2e07('0xc')](_0x150f51,_0x62a6b7)[_0x2e07('0xd')](function(_0x4aeaef){logger[_0x2e07('0xe')](_0x2e07('0xf'),_0x1d30b4,_0x2e07('0x10'));logger[_0x2e07('0x11')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1d30b4,'request\x20sent',JSON[_0x2e07('0x12')](_0x4aeaef));if(_0x4aeaef[_0x2e07('0x13')]){if(_0x4aeaef[_0x2e07('0x13')]['code']===0x1f4){logger[_0x2e07('0x13')](_0x2e07('0xf'),_0x1d30b4,_0x4aeaef['error']['message']);return _0x3ae467(_0x4aeaef[_0x2e07('0x13')][_0x2e07('0x14')]);}logger[_0x2e07('0x13')](_0x2e07('0xf'),_0x1d30b4,_0x4aeaef[_0x2e07('0x13')]['message']);return _0x4a5a53(_0x4aeaef[_0x2e07('0x13')]['message']);}else{logger[_0x2e07('0xe')](_0x2e07('0xf'),_0x1d30b4,'request\x20sent');_0x4a5a53(_0x4aeaef[_0x2e07('0x15')][_0x2e07('0x14')]);}})[_0x2e07('0x16')](function(_0x3105a9){logger['error'](_0x2e07('0xf'),_0x1d30b4,_0x3105a9);_0x3ae467(_0x3105a9);});});}exports['ShowSmsAccount']=function(_0x5c50e8){var _0xccfbd2=this;return new Promise(function(_0xb9f82f,_0x320d05){return db[_0x2e07('0x17')][_0x2e07('0x18')]({'raw':_0x5c50e8['options']?_0x5c50e8[_0x2e07('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5c50e8[_0x2e07('0x19')]?_0x5c50e8[_0x2e07('0x19')]['where']||null:null,'attributes':_0x5c50e8['options']?_0x5c50e8[_0x2e07('0x19')][_0x2e07('0x1a')]||null:null,'include':_0x5c50e8[_0x2e07('0x19')]?_0x5c50e8['options']['include']?_[_0x2e07('0x1b')](_0x5c50e8[_0x2e07('0x19')][_0x2e07('0x1c')],function(_0x26c49c){return{'model':db[_0x26c49c['model']],'as':_0x26c49c['as'],'attributes':_0x26c49c['attributes'],'include':_0x26c49c[_0x2e07('0x1c')]?_[_0x2e07('0x1b')](_0x26c49c[_0x2e07('0x1c')],function(_0x244583){return{'model':db[_0x244583[_0x2e07('0x1d')]],'as':_0x244583['as'],'attributes':_0x244583[_0x2e07('0x1a')],'include':_0x244583[_0x2e07('0x1c')]?_[_0x2e07('0x1b')](_0x244583['include'],function(_0xe9ab8f){return{'model':db[_0xe9ab8f[_0x2e07('0x1d')]],'as':_0xe9ab8f['as'],'attributes':_0xe9ab8f[_0x2e07('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b73d6){logger[_0x2e07('0xe')](_0x2e07('0x1e'),_0x5c50e8);logger[_0x2e07('0x11')](_0x2e07('0x1e'),_0x5c50e8,JSON['stringify'](_0x2b73d6));_0xb9f82f(_0x2b73d6);})[_0x2e07('0x16')](function(_0x4e95e7){logger[_0x2e07('0x13')](_0x2e07('0x1e'),_0x4e95e7[_0x2e07('0x14')],_0x5c50e8);_0x320d05(_0xccfbd2[_0x2e07('0x13')](0x1f4,_0x4e95e7[_0x2e07('0x14')]));});});}; \ No newline at end of file +var _0x9526=['defaults','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SmsAccount','find','options','raw','where','attributes','map','include','model','ShowSmsAccount','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x4bdd80,_0x5eaf07){var _0x3c4ecf=function(_0x53a8fd){while(--_0x53a8fd){_0x4bdd80['push'](_0x4bdd80['shift']());}};_0x3c4ecf(++_0x5eaf07);}(_0x9526,0xb2));var _0x6952=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x9526[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6952('0x0'));var BPromise=require(_0x6952('0x1'));var rs=require(_0x6952('0x2'));var fs=require('fs');var Redis=require(_0x6952('0x3'));var db=require(_0x6952('0x4'))['db'];var utils=require(_0x6952('0x5'));var logger=require(_0x6952('0x6'))(_0x6952('0x7'));var config=require(_0x6952('0x8'));var jayson=require(_0x6952('0x9'));var client=jayson[_0x6952('0xa')]['http']({'port':0x232a});config[_0x6952('0xb')]=_[_0x6952('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6952('0xd'))(new Redis(config[_0x6952('0xb')]));require(_0x6952('0xe'))['register'](socket);function respondWithRpcPromise(_0x58f3de,_0x30a851,_0x2e53e4){return new BPromise(function(_0x41ef65,_0x328c54){return client[_0x6952('0xf')](_0x58f3de,_0x2e53e4)[_0x6952('0x10')](function(_0x1a5d9a){logger[_0x6952('0x11')](_0x6952('0x12'),_0x30a851,_0x6952('0x13'));logger[_0x6952('0x14')](_0x6952('0x15'),_0x30a851,_0x6952('0x13'),JSON['stringify'](_0x1a5d9a));if(_0x1a5d9a[_0x6952('0x16')]){if(_0x1a5d9a[_0x6952('0x16')][_0x6952('0x17')]===0x1f4){logger[_0x6952('0x16')](_0x6952('0x12'),_0x30a851,_0x1a5d9a[_0x6952('0x16')][_0x6952('0x18')]);return _0x328c54(_0x1a5d9a[_0x6952('0x16')][_0x6952('0x18')]);}logger[_0x6952('0x16')](_0x6952('0x12'),_0x30a851,_0x1a5d9a[_0x6952('0x16')][_0x6952('0x18')]);return _0x41ef65(_0x1a5d9a[_0x6952('0x16')][_0x6952('0x18')]);}else{logger[_0x6952('0x11')](_0x6952('0x12'),_0x30a851,'request\x20sent');_0x41ef65(_0x1a5d9a[_0x6952('0x19')]['message']);}})[_0x6952('0x1a')](function(_0x58ce7e){logger[_0x6952('0x16')](_0x6952('0x12'),_0x30a851,_0x58ce7e);_0x328c54(_0x58ce7e);});});}exports['ShowSmsAccount']=function(_0x2cbe19){var _0x16b9eb=this;return new Promise(function(_0x1c9ccd,_0x32b86a){return db[_0x6952('0x1b')][_0x6952('0x1c')]({'raw':_0x2cbe19[_0x6952('0x1d')]?_0x2cbe19[_0x6952('0x1d')][_0x6952('0x1e')]===undefined?!![]:![]:!![],'where':_0x2cbe19[_0x6952('0x1d')]?_0x2cbe19[_0x6952('0x1d')][_0x6952('0x1f')]||null:null,'attributes':_0x2cbe19[_0x6952('0x1d')]?_0x2cbe19[_0x6952('0x1d')][_0x6952('0x20')]||null:null,'include':_0x2cbe19['options']?_0x2cbe19[_0x6952('0x1d')]['include']?_[_0x6952('0x21')](_0x2cbe19['options'][_0x6952('0x22')],function(_0x5a9474){return{'model':db[_0x5a9474[_0x6952('0x23')]],'as':_0x5a9474['as'],'attributes':_0x5a9474[_0x6952('0x20')],'include':_0x5a9474[_0x6952('0x22')]?_[_0x6952('0x21')](_0x5a9474[_0x6952('0x22')],function(_0x4a6ac3){return{'model':db[_0x4a6ac3[_0x6952('0x23')]],'as':_0x4a6ac3['as'],'attributes':_0x4a6ac3[_0x6952('0x20')],'include':_0x4a6ac3[_0x6952('0x22')]?_[_0x6952('0x21')](_0x4a6ac3[_0x6952('0x22')],function(_0x27381d){return{'model':db[_0x27381d['model']],'as':_0x27381d['as'],'attributes':_0x27381d[_0x6952('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4eda90){logger['info']('ShowSmsAccount',_0x2cbe19);logger[_0x6952('0x14')](_0x6952('0x24'),_0x2cbe19,JSON[_0x6952('0x25')](_0x4eda90));_0x1c9ccd(_0x4eda90);})[_0x6952('0x1a')](function(_0x14a8ee){logger[_0x6952('0x16')](_0x6952('0x24'),_0x14a8ee[_0x6952('0x18')],_0x2cbe19);_0x32b86a(_0x16b9eb[_0x6952('0x16')](0x1f4,_0x14a8ee[_0x6952('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index ccb5e8a..bf67b53 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 _0xb210=['save','remove','update','emit','removeListener','./smsAccount.events'];(function(_0x1790ae,_0xf3f5c2){var _0x2643d7=function(_0x58026f){while(--_0x58026f){_0x1790ae['push'](_0x1790ae['shift']());}};_0x2643d7(++_0xf3f5c2);}(_0xb210,0x1a3));var _0x0b21=function(_0x348915,_0x299bde){_0x348915=_0x348915-0x0;var _0x493c5c=_0xb210[_0x348915];return _0x493c5c;};'use strict';var SmsAccountEvents=require(_0x0b21('0x0'));var events=[_0x0b21('0x1'),_0x0b21('0x2'),_0x0b21('0x3')];function createListener(_0x3889eb,_0x5a4a2a){return function(_0xc77d8d){_0x5a4a2a[_0x0b21('0x4')](_0x3889eb,_0xc77d8d);};}function removeListener(_0x2b8e3b,_0x406d7d){return function(){SmsAccountEvents[_0x0b21('0x5')](_0x2b8e3b,_0x406d7d);};}exports['register']=function(_0x5bfc9d){for(var _0x5d39be=0x0,_0xc15687=events['length'];_0x5d39be<_0xc15687;_0x5d39be++){var _0x128ffd=events[_0x5d39be];var _0x16bc6c=createListener('smsAccount:'+_0x128ffd,_0x5bfc9d);SmsAccountEvents['on'](_0x128ffd,_0x16bc6c);}}; \ No newline at end of file +var _0xa86b=['emit','removeListener','smsAccount:','save','remove','update'];(function(_0x3334f7,_0x19f3b4){var _0x6a6455=function(_0x3d8f61){while(--_0x3d8f61){_0x3334f7['push'](_0x3334f7['shift']());}};_0x6a6455(++_0x19f3b4);}(_0xa86b,0x75));var _0xba86=function(_0x18d325,_0x40dc83){_0x18d325=_0x18d325-0x0;var _0x4abc7f=_0xa86b[_0x18d325];return _0x4abc7f;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0xba86('0x0'),_0xba86('0x1'),_0xba86('0x2')];function createListener(_0x228f1e,_0xe50b49){return function(_0x175a50){_0xe50b49[_0xba86('0x3')](_0x228f1e,_0x175a50);};}function removeListener(_0x40fcb7,_0x296dab){return function(){SmsAccountEvents[_0xba86('0x4')](_0x40fcb7,_0x296dab);};}exports['register']=function(_0xaf4f08){for(var _0x3f5051=0x0,_0x444879=events['length'];_0x3f5051<_0x444879;_0x3f5051++){var _0x6ab239=events[_0x3f5051];var _0x58855a=createListener(_0xba86('0x5')+_0x6ab239,_0xaf4f08);SmsAccountEvents['on'](_0x6ab239,_0x58855a);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 082457d..34bad6d 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 _0xd23d=['Router','../../components/auth/service','get','isAuthenticated','index','/:id','create','put','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x15dd31,_0x1f318e){var _0x520434=function(_0x2c761a){while(--_0x2c761a){_0x15dd31['push'](_0x15dd31['shift']());}};_0x520434(++_0x1f318e);}(_0xd23d,0xa0));var _0xdd23=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0xd23d[_0x4bacb6];return _0x58c029;};'use strict';var multer=require(_0xdd23('0x0'));var util=require(_0xdd23('0x1'));var path=require(_0xdd23('0x2'));var timeout=require(_0xdd23('0x3'));var express=require(_0xdd23('0x4'));var router=express[_0xdd23('0x5')]();var auth=require(_0xdd23('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsApplication.controller');router[_0xdd23('0x7')]('/',auth[_0xdd23('0x8')](),controller[_0xdd23('0x9')]);router[_0xdd23('0x7')](_0xdd23('0xa'),auth[_0xdd23('0x8')](),controller['show']);router['post']('/',auth[_0xdd23('0x8')](),controller[_0xdd23('0xb')]);router[_0xdd23('0xc')](_0xdd23('0xa'),auth[_0xdd23('0x8')](),controller['update']);router[_0xdd23('0xd')](_0xdd23('0xa'),auth[_0xdd23('0x8')](),controller['destroy']);module[_0xdd23('0xe')]=router; \ No newline at end of file +var _0x6cb4=['/:id','isAuthenticated','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x3570da,_0x5cb082){var _0xe9dcc7=function(_0x53dbd0){while(--_0x53dbd0){_0x3570da['push'](_0x3570da['shift']());}};_0xe9dcc7(++_0x5cb082);}(_0x6cb4,0xff));var _0x46cb=function(_0x49d0e7,_0xaf1ab5){_0x49d0e7=_0x49d0e7-0x0;var _0x5e5d13=_0x6cb4[_0x49d0e7];return _0x5e5d13;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var auth=require(_0x46cb('0x6'));var interaction=require(_0x46cb('0x7'));var config=require(_0x46cb('0x8'));var controller=require('./smsApplication.controller');router[_0x46cb('0x9')]('/',auth['isAuthenticated'](),controller[_0x46cb('0xa')]);router['get'](_0x46cb('0xb'),auth[_0x46cb('0xc')](),controller[_0x46cb('0xd')]);router[_0x46cb('0xe')]('/',auth[_0x46cb('0xc')](),controller[_0x46cb('0xf')]);router['put'](_0x46cb('0xb'),auth[_0x46cb('0xc')](),controller['update']);router[_0x46cb('0x10')](_0x46cb('0xb'),auth['isAuthenticated'](),controller[_0x46cb('0x11')]);module[_0x46cb('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 66a8353..2e00d30 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 _0x3e5c=['STRING','noop','exports'];(function(_0x4d7ae7,_0x42c05c){var _0x31f011=function(_0x3db6c8){while(--_0x3db6c8){_0x4d7ae7['push'](_0x4d7ae7['shift']());}};_0x31f011(++_0x42c05c);}(_0x3e5c,0x77));var _0xc3e5=function(_0xd25106,_0x3d2ffc){_0xd25106=_0xd25106-0x0;var _0x392ade=_0x3e5c[_0xd25106];return _0x392ade;};'use strict';var Sequelize=require('sequelize');module[_0xc3e5('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc3e5('0x1')],'allowNull':![],'defaultValue':_0xc3e5('0x2')},'appdata':{'type':Sequelize[_0xc3e5('0x1')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0xc3e5('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x42c7=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x42c7,0x12d));var _0x742c=function(_0x2f67cc,_0x5e41eb){_0x2f67cc=_0x2f67cc-0x0;var _0x3adf53=_0x42c7[_0x2f67cc];return _0x3adf53;};'use strict';var Sequelize=require(_0x742c('0x0'));module[_0x742c('0x1')]={'priority':{'type':Sequelize[_0x742c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x742c('0x3')],'allowNull':![],'defaultValue':_0x742c('0x4')},'appdata':{'type':Sequelize[_0x742c('0x3')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0x742c('0x3')]},'interval':{'type':Sequelize[_0x742c('0x3')],'defaultValue':_0x742c('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index e422e06..612e8ff 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 _0x73ac=['sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','count','Content-Range','json','apply','reject','save','update','then','error','name','send','index','SmsApplication','rawAttributes','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','find','create','body','params','destroy','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','path'];(function(_0x4c3c44,_0x1219ae){var _0x1a350f=function(_0x57d200){while(--_0x57d200){_0x4c3c44['push'](_0x4c3c44['shift']());}};_0x1a350f(++_0x1219ae);}(_0x73ac,0x87));var _0xc73a=function(_0x4f7adb,_0x208177){_0x4f7adb=_0x4f7adb-0x0;var _0x32b36d=_0x73ac[_0x4f7adb];return _0x32b36d;};'use strict';var pdf=require(_0xc73a('0x0'));var emlformat=require(_0xc73a('0x1'));var rimraf=require(_0xc73a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc73a('0x3'));var rp=require('request-promise');var moment=require(_0xc73a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc73a('0x5'));var util=require('util');var path=require(_0xc73a('0x6'));var sox=require(_0xc73a('0x7'));var csv=require(_0xc73a('0x8'));var ejs=require(_0xc73a('0x9'));var fs=require('fs');var _=require(_0xc73a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc73a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc73a('0x8'));var querystring=require(_0xc73a('0xc'));var Papa=require(_0xc73a('0xd'));var authService=require(_0xc73a('0xe'));var hardwareService=require(_0xc73a('0xf'));var Redis=require(_0xc73a('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xc73a('0x11'))(_0xc73a('0x12'));var utils=require(_0xc73a('0x13'));var config=require(_0xc73a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x250a64,_0x21fb31){_0x21fb31=_0x21fb31||0xcc;return function(_0x23fba4){if(_0x23fba4){return _0x250a64[_0xc73a('0x15')](_0x21fb31);}return _0x250a64['status'](_0x21fb31)[_0xc73a('0x16')]();};}function respondWithResult(_0x442379,_0xf250ec){_0xf250ec=_0xf250ec||0xc8;return function(_0x3846f9){if(_0x3846f9){return _0x442379[_0xc73a('0x17')](_0xf250ec)['json'](_0x3846f9);}};}function respondWithFilteredResult(_0x1c3711,_0x36f8a4){return function(_0x97dc3d){if(_0x97dc3d){var _0x43c045=_0x97dc3d[_0xc73a('0x18')],_0x5e165b=_0x36f8a4['offset'],_0x1d71ee=_0x36f8a4['offset']+_0x36f8a4['limit'],_0x285b4c;if(_0x1d71ee>=_0x43c045){_0x1d71ee=_0x43c045;_0x285b4c=0xc8;}else{_0x285b4c=0xce;}_0x1c3711['status'](_0x285b4c);return _0x1c3711['set'](_0xc73a('0x19'),_0x5e165b+'-'+_0x1d71ee+'/'+_0x43c045)[_0xc73a('0x1a')](_0x97dc3d);}return null;};}function patchUpdates(_0x2a1b6d){return function(_0x499366){try{jsonpatch[_0xc73a('0x1b')](_0x499366,_0x2a1b6d,!![]);}catch(_0x3696b9){return BPromise[_0xc73a('0x1c')](_0x3696b9);}return _0x499366[_0xc73a('0x1d')]();};}function saveUpdates(_0x16887e,_0x279db0){return function(_0x1e9527){if(_0x1e9527){return _0x1e9527[_0xc73a('0x1e')](_0x16887e)[_0xc73a('0x1f')](function(_0x308659){return _0x308659;});}return null;};}function removeEntity(_0x11acab,_0x305a7a){return function(_0x5f1a5b){if(_0x5f1a5b){return _0x5f1a5b['destroy']()[_0xc73a('0x1f')](function(){_0x11acab[_0xc73a('0x17')](0xcc)[_0xc73a('0x16')]();});}};}function handleEntityNotFound(_0x1aa58c,_0x484cda){return function(_0x105317){if(!_0x105317){_0x1aa58c[_0xc73a('0x15')](0x194);}return _0x105317;};}function handleError(_0x2da440,_0x522cab){_0x522cab=_0x522cab||0x1f4;return function(_0x12cefe){logger[_0xc73a('0x20')](_0x12cefe['stack']);if(_0x12cefe['name']){delete _0x12cefe[_0xc73a('0x21')];}_0x2da440[_0xc73a('0x17')](_0x522cab)[_0xc73a('0x22')](_0x12cefe);};}exports[_0xc73a('0x23')]=function(_0x2eece6,_0x39e534){var _0x318c07={},_0x18da4d={},_0x5153cb={'count':0x0,'rows':[]};var _0x2fa2b0=db[_0xc73a('0x24')][_0xc73a('0x25')];_0x18da4d['model']=_['keys'](_0x2fa2b0);_0x18da4d[_0xc73a('0x26')]=_[_0xc73a('0x27')](_0x2eece6['query']);_0x18da4d[_0xc73a('0x28')]=_[_0xc73a('0x29')](_0x18da4d[_0xc73a('0x2a')],_0x18da4d[_0xc73a('0x26')]);_0x318c07[_0xc73a('0x2b')]=_[_0xc73a('0x29')](_0x18da4d['model'],qs[_0xc73a('0x2c')](_0x2eece6[_0xc73a('0x26')][_0xc73a('0x2c')]));_0x318c07[_0xc73a('0x2b')]=_0x318c07[_0xc73a('0x2b')]['length']?_0x318c07[_0xc73a('0x2b')]:_0x18da4d[_0xc73a('0x2a')];if(!_0x2eece6[_0xc73a('0x26')][_0xc73a('0x2d')](_0xc73a('0x2e'))){_0x318c07['limit']=qs['limit'](_0x2eece6['query'][_0xc73a('0x2f')]);_0x318c07[_0xc73a('0x30')]=qs['offset'](_0x2eece6[_0xc73a('0x26')][_0xc73a('0x30')]);}_0x318c07[_0xc73a('0x31')]=qs[_0xc73a('0x32')](_0x2eece6[_0xc73a('0x26')][_0xc73a('0x32')]);_0x318c07[_0xc73a('0x33')]=qs[_0xc73a('0x28')](_[_0xc73a('0x34')](_0x2eece6['query'],_0x18da4d['filters']));if(_0x2eece6['query'][_0xc73a('0x35')]){_0x318c07[_0xc73a('0x33')]=_[_0xc73a('0x36')](_0x318c07[_0xc73a('0x33')],{'$or':_[_0xc73a('0x37')](_0x2fa2b0,function(_0xed6d01){if(_0xed6d01[_0xc73a('0x38')][_0xc73a('0x39')]!==_0xc73a('0x3a')){var _0xac477={};_0xac477[_0xed6d01['field']]={'$like':'%'+_0x2eece6['query'][_0xc73a('0x35')]+'%'};return _0xac477;}})});}_0x318c07=_[_0xc73a('0x36')]({},_0x318c07,_0x2eece6[_0xc73a('0x3b')]);var _0x37c3b0={'where':_0x318c07['where']};return db[_0xc73a('0x24')][_0xc73a('0x18')](_0x37c3b0)[_0xc73a('0x1f')](function(_0x4b7d31){_0x5153cb[_0xc73a('0x18')]=_0x4b7d31;if(_0x2eece6['query'][_0xc73a('0x3c')]){_0x318c07['include']=[{'all':!![]}];}return db[_0xc73a('0x24')][_0xc73a('0x3d')](_0x318c07);})[_0xc73a('0x1f')](function(_0x5e5359){_0x5153cb[_0xc73a('0x3e')]=_0x5e5359;return _0x5153cb;})[_0xc73a('0x1f')](respondWithFilteredResult(_0x39e534,_0x318c07))[_0xc73a('0x3f')](handleError(_0x39e534,null));};exports[_0xc73a('0x40')]=function(_0x53109d,_0x3a9c71){var _0x2ecb6e={'raw':!![],'where':{'id':_0x53109d['params']['id']}},_0x40311b={};_0x40311b[_0xc73a('0x2a')]=_[_0xc73a('0x27')](db['SmsApplication'][_0xc73a('0x25')]);_0x40311b[_0xc73a('0x26')]=_[_0xc73a('0x27')](_0x53109d[_0xc73a('0x26')]);_0x40311b['filters']=_[_0xc73a('0x29')](_0x40311b[_0xc73a('0x2a')],_0x40311b[_0xc73a('0x26')]);_0x2ecb6e[_0xc73a('0x2b')]=_[_0xc73a('0x29')](_0x40311b[_0xc73a('0x2a')],qs[_0xc73a('0x2c')](_0x53109d['query'][_0xc73a('0x2c')]));_0x2ecb6e[_0xc73a('0x2b')]=_0x2ecb6e[_0xc73a('0x2b')][_0xc73a('0x41')]?_0x2ecb6e[_0xc73a('0x2b')]:_0x40311b[_0xc73a('0x2a')];if(_0x53109d['query'][_0xc73a('0x3c')]){_0x2ecb6e['include']=[{'all':!![]}];}_0x2ecb6e=_[_0xc73a('0x36')]({},_0x2ecb6e,_0x53109d['options']);return db['SmsApplication'][_0xc73a('0x42')](_0x2ecb6e)[_0xc73a('0x1f')](handleEntityNotFound(_0x3a9c71,null))[_0xc73a('0x1f')](respondWithResult(_0x3a9c71,null))[_0xc73a('0x3f')](handleError(_0x3a9c71,null));};exports['create']=function(_0x29de85,_0x40be1f){return db[_0xc73a('0x24')][_0xc73a('0x43')](_0x29de85[_0xc73a('0x44')],{})['then'](respondWithResult(_0x40be1f,0xc9))['catch'](handleError(_0x40be1f,null));};exports[_0xc73a('0x1e')]=function(_0x52978a,_0x7086ce){if(_0x52978a[_0xc73a('0x44')]['id']){delete _0x52978a[_0xc73a('0x44')]['id'];}return db[_0xc73a('0x24')]['find']({'where':{'id':_0x52978a[_0xc73a('0x45')]['id']}})[_0xc73a('0x1f')](handleEntityNotFound(_0x7086ce,null))[_0xc73a('0x1f')](saveUpdates(_0x52978a[_0xc73a('0x44')],null))[_0xc73a('0x1f')](respondWithResult(_0x7086ce,null))[_0xc73a('0x3f')](handleError(_0x7086ce,null));};exports[_0xc73a('0x46')]=function(_0x4499d0,_0x30a734){return db['SmsApplication'][_0xc73a('0x42')]({'where':{'id':_0x4499d0[_0xc73a('0x45')]['id']}})[_0xc73a('0x1f')](handleEntityNotFound(_0x30a734,null))[_0xc73a('0x1f')](removeEntity(_0x30a734,null))['catch'](handleError(_0x30a734,null));}; \ No newline at end of file +var _0xba86=['util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','rawAttributes','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','SmsApplication','findAll','rows','show','params','find','catch','create','body','update','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x409bc3,_0x30f470){var _0xf9f0b5=function(_0x4392f8){while(--_0x4392f8){_0x409bc3['push'](_0x409bc3['shift']());}};_0xf9f0b5(++_0x30f470);}(_0xba86,0x175));var _0x6ba8=function(_0x1532da,_0x36caed){_0x1532da=_0x1532da-0x0;var _0x4654da=_0xba86[_0x1532da];return _0x4654da;};'use strict';var pdf=require(_0x6ba8('0x0'));var emlformat=require(_0x6ba8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6ba8('0x2'));var jsonpatch=require(_0x6ba8('0x3'));var rp=require(_0x6ba8('0x4'));var moment=require(_0x6ba8('0x5'));var BPromise=require(_0x6ba8('0x6'));var Mustache=require('mustache');var util=require(_0x6ba8('0x7'));var path=require(_0x6ba8('0x8'));var sox=require(_0x6ba8('0x9'));var csv=require(_0x6ba8('0xa'));var ejs=require(_0x6ba8('0xb'));var fs=require('fs');var _=require(_0x6ba8('0xc'));var squel=require(_0x6ba8('0xd'));var crypto=require(_0x6ba8('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6ba8('0xf'));var Papa=require(_0x6ba8('0x10'));var authService=require(_0x6ba8('0x11'));var hardwareService=require(_0x6ba8('0x12'));var Redis=require('ioredis');var qs=require(_0x6ba8('0x13'));var logger=require(_0x6ba8('0x14'))(_0x6ba8('0x15'));var utils=require(_0x6ba8('0x16'));var config=require(_0x6ba8('0x17'));var db=require(_0x6ba8('0x18'))['db'];function respondWithStatusCode(_0x4218b2,_0x3cbdd2){_0x3cbdd2=_0x3cbdd2||0xcc;return function(_0x964668){if(_0x964668){return _0x4218b2['sendStatus'](_0x3cbdd2);}return _0x4218b2[_0x6ba8('0x19')](_0x3cbdd2)[_0x6ba8('0x1a')]();};}function respondWithResult(_0x51b430,_0x196f4f){_0x196f4f=_0x196f4f||0xc8;return function(_0x2691a0){if(_0x2691a0){return _0x51b430[_0x6ba8('0x19')](_0x196f4f)[_0x6ba8('0x1b')](_0x2691a0);}};}function respondWithFilteredResult(_0x3fd530,_0x3a5cbe){return function(_0x57deb8){if(_0x57deb8){var _0x5ac7b0=_0x57deb8[_0x6ba8('0x1c')],_0x258877=_0x3a5cbe['offset'],_0xb2978b=_0x3a5cbe['offset']+_0x3a5cbe['limit'],_0x217e86;if(_0xb2978b>=_0x5ac7b0){_0xb2978b=_0x5ac7b0;_0x217e86=0xc8;}else{_0x217e86=0xce;}_0x3fd530[_0x6ba8('0x19')](_0x217e86);return _0x3fd530['set'](_0x6ba8('0x1d'),_0x258877+'-'+_0xb2978b+'/'+_0x5ac7b0)[_0x6ba8('0x1b')](_0x57deb8);}return null;};}function patchUpdates(_0x2a157e){return function(_0x82ff81){try{jsonpatch[_0x6ba8('0x1e')](_0x82ff81,_0x2a157e,!![]);}catch(_0x11ed21){return BPromise[_0x6ba8('0x1f')](_0x11ed21);}return _0x82ff81[_0x6ba8('0x20')]();};}function saveUpdates(_0x24a36a,_0x172d3e){return function(_0x2778a0){if(_0x2778a0){return _0x2778a0['update'](_0x24a36a)[_0x6ba8('0x21')](function(_0x31d732){return _0x31d732;});}return null;};}function removeEntity(_0x29d690,_0xc47b90){return function(_0x375b43){if(_0x375b43){return _0x375b43[_0x6ba8('0x22')]()[_0x6ba8('0x21')](function(){_0x29d690[_0x6ba8('0x19')](0xcc)[_0x6ba8('0x1a')]();});}};}function handleEntityNotFound(_0x4e1589,_0x3d592b){return function(_0x1d7208){if(!_0x1d7208){_0x4e1589[_0x6ba8('0x23')](0x194);}return _0x1d7208;};}function handleError(_0x46cf90,_0x3df549){_0x3df549=_0x3df549||0x1f4;return function(_0x4ecf7b){logger[_0x6ba8('0x24')](_0x4ecf7b['stack']);if(_0x4ecf7b[_0x6ba8('0x25')]){delete _0x4ecf7b[_0x6ba8('0x25')];}_0x46cf90['status'](_0x3df549)[_0x6ba8('0x26')](_0x4ecf7b);};}exports[_0x6ba8('0x27')]=function(_0x368a1a,_0x5496fd){var _0x47a4de={},_0x2f8c53={},_0x5d058b={'count':0x0,'rows':[]};var _0x342c84=db['SmsApplication'][_0x6ba8('0x28')];_0x2f8c53[_0x6ba8('0x29')]=_[_0x6ba8('0x2a')](_0x342c84);_0x2f8c53['query']=_[_0x6ba8('0x2a')](_0x368a1a['query']);_0x2f8c53[_0x6ba8('0x2b')]=_[_0x6ba8('0x2c')](_0x2f8c53[_0x6ba8('0x29')],_0x2f8c53['query']);_0x47a4de['attributes']=_[_0x6ba8('0x2c')](_0x2f8c53[_0x6ba8('0x29')],qs['fields'](_0x368a1a[_0x6ba8('0x2d')][_0x6ba8('0x2e')]));_0x47a4de['attributes']=_0x47a4de[_0x6ba8('0x2f')][_0x6ba8('0x30')]?_0x47a4de[_0x6ba8('0x2f')]:_0x2f8c53[_0x6ba8('0x29')];if(!_0x368a1a[_0x6ba8('0x2d')][_0x6ba8('0x31')](_0x6ba8('0x32'))){_0x47a4de['limit']=qs[_0x6ba8('0x33')](_0x368a1a[_0x6ba8('0x2d')]['limit']);_0x47a4de[_0x6ba8('0x34')]=qs[_0x6ba8('0x34')](_0x368a1a[_0x6ba8('0x2d')][_0x6ba8('0x34')]);}_0x47a4de[_0x6ba8('0x35')]=qs[_0x6ba8('0x36')](_0x368a1a[_0x6ba8('0x2d')][_0x6ba8('0x36')]);_0x47a4de[_0x6ba8('0x37')]=qs[_0x6ba8('0x2b')](_[_0x6ba8('0x38')](_0x368a1a[_0x6ba8('0x2d')],_0x2f8c53[_0x6ba8('0x2b')]));if(_0x368a1a[_0x6ba8('0x2d')][_0x6ba8('0x39')]){_0x47a4de[_0x6ba8('0x37')]=_[_0x6ba8('0x3a')](_0x47a4de[_0x6ba8('0x37')],{'$or':_[_0x6ba8('0x3b')](_0x342c84,function(_0x952aee){if(_0x952aee[_0x6ba8('0x3c')][_0x6ba8('0x3d')]!==_0x6ba8('0x3e')){var _0x21a76b={};_0x21a76b[_0x952aee['field']]={'$like':'%'+_0x368a1a[_0x6ba8('0x2d')][_0x6ba8('0x39')]+'%'};return _0x21a76b;}})});}_0x47a4de=_[_0x6ba8('0x3a')]({},_0x47a4de,_0x368a1a[_0x6ba8('0x3f')]);var _0x1e1e5f={'where':_0x47a4de['where']};return db['SmsApplication'][_0x6ba8('0x1c')](_0x1e1e5f)[_0x6ba8('0x21')](function(_0x163cb9){_0x5d058b[_0x6ba8('0x1c')]=_0x163cb9;if(_0x368a1a[_0x6ba8('0x2d')][_0x6ba8('0x40')]){_0x47a4de[_0x6ba8('0x41')]=[{'all':!![]}];}return db[_0x6ba8('0x42')][_0x6ba8('0x43')](_0x47a4de);})[_0x6ba8('0x21')](function(_0x213d20){_0x5d058b[_0x6ba8('0x44')]=_0x213d20;return _0x5d058b;})[_0x6ba8('0x21')](respondWithFilteredResult(_0x5496fd,_0x47a4de))['catch'](handleError(_0x5496fd,null));};exports[_0x6ba8('0x45')]=function(_0x4fe507,_0x2320bf){var _0x34c01e={'raw':!![],'where':{'id':_0x4fe507[_0x6ba8('0x46')]['id']}},_0xc34d19={};_0xc34d19[_0x6ba8('0x29')]=_[_0x6ba8('0x2a')](db[_0x6ba8('0x42')][_0x6ba8('0x28')]);_0xc34d19[_0x6ba8('0x2d')]=_[_0x6ba8('0x2a')](_0x4fe507[_0x6ba8('0x2d')]);_0xc34d19['filters']=_[_0x6ba8('0x2c')](_0xc34d19[_0x6ba8('0x29')],_0xc34d19[_0x6ba8('0x2d')]);_0x34c01e[_0x6ba8('0x2f')]=_['intersection'](_0xc34d19[_0x6ba8('0x29')],qs[_0x6ba8('0x2e')](_0x4fe507['query'][_0x6ba8('0x2e')]));_0x34c01e[_0x6ba8('0x2f')]=_0x34c01e['attributes']['length']?_0x34c01e['attributes']:_0xc34d19[_0x6ba8('0x29')];if(_0x4fe507[_0x6ba8('0x2d')][_0x6ba8('0x40')]){_0x34c01e[_0x6ba8('0x41')]=[{'all':!![]}];}_0x34c01e=_[_0x6ba8('0x3a')]({},_0x34c01e,_0x4fe507['options']);return db[_0x6ba8('0x42')][_0x6ba8('0x47')](_0x34c01e)[_0x6ba8('0x21')](handleEntityNotFound(_0x2320bf,null))['then'](respondWithResult(_0x2320bf,null))[_0x6ba8('0x48')](handleError(_0x2320bf,null));};exports['create']=function(_0x552f5e,_0x30113f){return db[_0x6ba8('0x42')][_0x6ba8('0x49')](_0x552f5e[_0x6ba8('0x4a')],{})[_0x6ba8('0x21')](respondWithResult(_0x30113f,0xc9))[_0x6ba8('0x48')](handleError(_0x30113f,null));};exports[_0x6ba8('0x4b')]=function(_0x32a1b1,_0x3dd01f){if(_0x32a1b1[_0x6ba8('0x4a')]['id']){delete _0x32a1b1[_0x6ba8('0x4a')]['id'];}return db[_0x6ba8('0x42')][_0x6ba8('0x47')]({'where':{'id':_0x32a1b1[_0x6ba8('0x46')]['id']}})['then'](handleEntityNotFound(_0x3dd01f,null))[_0x6ba8('0x21')](saveUpdates(_0x32a1b1[_0x6ba8('0x4a')],null))[_0x6ba8('0x21')](respondWithResult(_0x3dd01f,null))[_0x6ba8('0x48')](handleError(_0x3dd01f,null));};exports['destroy']=function(_0x4d1333,_0x3316c2){return db[_0x6ba8('0x42')][_0x6ba8('0x47')]({'where':{'id':_0x4d1333['params']['id']}})[_0x6ba8('0x21')](handleEntityNotFound(_0x3316c2,null))['then'](removeEntity(_0x3316c2,null))[_0x6ba8('0x48')](handleError(_0x3316c2,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 511e00e..21ea41b 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 _0x539b=['sms_applications','lodash','util','../../config/logger','moment','bluebird','request-promise','./smsApplication.attributes','define','SmsApplication'];(function(_0x4eb9e9,_0x1e0f58){var _0x7fef6f=function(_0x26f62d){while(--_0x26f62d){_0x4eb9e9['push'](_0x4eb9e9['shift']());}};_0x7fef6f(++_0x1e0f58);}(_0x539b,0x187));var _0xb539=function(_0x37ffcd,_0x43ba57){_0x37ffcd=_0x37ffcd-0x0;var _0x2ccc1e=_0x539b[_0x37ffcd];return _0x2ccc1e;};'use strict';var _=require(_0xb539('0x0'));var util=require(_0xb539('0x1'));var logger=require(_0xb539('0x2'))('api');var moment=require(_0xb539('0x3'));var BPromise=require(_0xb539('0x4'));var rp=require(_0xb539('0x5'));var attributes=require(_0xb539('0x6'));module['exports']=function(_0x3a8d90,_0x1db83a){return _0x3a8d90[_0xb539('0x7')](_0xb539('0x8'),attributes,{'tableName':_0xb539('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05a2=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./smsApplication.attributes','exports'];(function(_0x111e90,_0x246d1b){var _0x36ac16=function(_0x23c183){while(--_0x23c183){_0x111e90['push'](_0x111e90['shift']());}};_0x36ac16(++_0x246d1b);}(_0x05a2,0xab));var _0x205a=function(_0x2c774b,_0x1d030c){_0x2c774b=_0x2c774b-0x0;var _0x48ce46=_0x05a2[_0x2c774b];return _0x48ce46;};'use strict';var _=require(_0x205a('0x0'));var util=require(_0x205a('0x1'));var logger=require(_0x205a('0x2'))(_0x205a('0x3'));var moment=require(_0x205a('0x4'));var BPromise=require(_0x205a('0x5'));var rp=require(_0x205a('0x6'));var attributes=require(_0x205a('0x7'));module[_0x205a('0x8')]=function(_0x4e915c,_0xe5bf67){return _0x4e915c[_0x205a('0x9')]('SmsApplication',attributes,{'tableName':'sms_applications','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 063b6f3..7eff3fb 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 _0x5c90=['../../config/environment','jayson/promise','client','http','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xfb1c51,_0x42df23){var _0x3f69a1=function(_0x4cf75e){while(--_0x4cf75e){_0xfb1c51['push'](_0xfb1c51['shift']());}};_0x3f69a1(++_0x42df23);}(_0x5c90,0x6a));var _0x05c9=function(_0x22ce82,_0x574678){_0x22ce82=_0x22ce82-0x0;var _0x143aaf=_0x5c90[_0x22ce82];return _0x143aaf;};'use strict';var _=require(_0x05c9('0x0'));var util=require(_0x05c9('0x1'));var moment=require('moment');var BPromise=require(_0x05c9('0x2'));var rs=require(_0x05c9('0x3'));var fs=require('fs');var Redis=require(_0x05c9('0x4'));var db=require(_0x05c9('0x5'))['db'];var utils=require(_0x05c9('0x6'));var logger=require(_0x05c9('0x7'))(_0x05c9('0x8'));var config=require(_0x05c9('0x9'));var jayson=require(_0x05c9('0xa'));var client=jayson[_0x05c9('0xb')][_0x05c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12ebde,_0x57b15e,_0x381e59){return new BPromise(function(_0x19dd5e,_0x460441){return client['request'](_0x12ebde,_0x381e59)[_0x05c9('0xd')](function(_0x47f680){logger['info'](_0x05c9('0xe'),_0x57b15e,_0x05c9('0xf'));logger[_0x05c9('0x10')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x57b15e,_0x05c9('0xf'),JSON[_0x05c9('0x11')](_0x47f680));if(_0x47f680[_0x05c9('0x12')]){if(_0x47f680[_0x05c9('0x12')][_0x05c9('0x13')]===0x1f4){logger[_0x05c9('0x12')](_0x05c9('0xe'),_0x57b15e,_0x47f680['error']['message']);return _0x460441(_0x47f680['error'][_0x05c9('0x14')]);}logger[_0x05c9('0x12')](_0x05c9('0xe'),_0x57b15e,_0x47f680['error'][_0x05c9('0x14')]);return _0x19dd5e(_0x47f680['error'][_0x05c9('0x14')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x57b15e,_0x05c9('0xf'));_0x19dd5e(_0x47f680[_0x05c9('0x15')][_0x05c9('0x14')]);}})[_0x05c9('0x16')](function(_0x318e23){logger['error'](_0x05c9('0xe'),_0x57b15e,_0x318e23);_0x460441(_0x318e23);});});} \ No newline at end of file +var _0x8060=['stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xf6ec4,_0x51d880){var _0x2e794b=function(_0x238b83){while(--_0x238b83){_0xf6ec4['push'](_0xf6ec4['shift']());}};_0x2e794b(++_0x51d880);}(_0x8060,0x78));var _0x0806=function(_0x21d532,_0x4552a4){_0x21d532=_0x21d532-0x0;var _0x37bda1=_0x8060[_0x21d532];return _0x37bda1;};'use strict';var _=require(_0x0806('0x0'));var util=require('util');var moment=require(_0x0806('0x1'));var BPromise=require(_0x0806('0x2'));var rs=require(_0x0806('0x3'));var fs=require('fs');var Redis=require(_0x0806('0x4'));var db=require(_0x0806('0x5'))['db'];var utils=require(_0x0806('0x6'));var logger=require(_0x0806('0x7'))('rpc');var config=require(_0x0806('0x8'));var jayson=require(_0x0806('0x9'));var client=jayson[_0x0806('0xa')][_0x0806('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x554b83,_0xf1a8fc,_0x1e657f){return new BPromise(function(_0x42aef0,_0x3e967e){return client[_0x0806('0xc')](_0x554b83,_0x1e657f)[_0x0806('0xd')](function(_0x262777){logger[_0x0806('0xe')](_0x0806('0xf'),_0xf1a8fc,_0x0806('0x10'));logger[_0x0806('0x11')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0xf1a8fc,_0x0806('0x10'),JSON[_0x0806('0x12')](_0x262777));if(_0x262777[_0x0806('0x13')]){if(_0x262777[_0x0806('0x13')]['code']===0x1f4){logger['error'](_0x0806('0xf'),_0xf1a8fc,_0x262777['error']['message']);return _0x3e967e(_0x262777[_0x0806('0x13')][_0x0806('0x14')]);}logger[_0x0806('0x13')](_0x0806('0xf'),_0xf1a8fc,_0x262777[_0x0806('0x13')][_0x0806('0x14')]);return _0x42aef0(_0x262777[_0x0806('0x13')][_0x0806('0x14')]);}else{logger[_0x0806('0xe')](_0x0806('0xf'),_0xf1a8fc,_0x0806('0x10'));_0x42aef0(_0x262777[_0x0806('0x15')]['message']);}})[_0x0806('0x16')](function(_0x1ed17e){logger[_0x0806('0x13')](_0x0806('0xf'),_0xf1a8fc,_0x1ed17e);_0x3e967e(_0x1ed17e);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 21e8e19..32315eb 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 _0xc262=['create','/:id/tags','tracked','smsinteraction:addtags','addTags','sms','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x4abf16,_0x4d71ef){var _0x16c45c=function(_0x2c263d){while(--_0x2c263d){_0x4abf16['push'](_0x4abf16['shift']());}};_0x16c45c(++_0x4d71ef);}(_0xc262,0x111));var _0x2c26=function(_0x278e8f,_0x209759){_0x278e8f=_0x278e8f-0x0;var _0xb17c00=_0xc262[_0x278e8f];return _0xb17c00;};'use strict';var multer=require(_0x2c26('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2c26('0x1'));var express=require(_0x2c26('0x2'));var router=express['Router']();var auth=require(_0x2c26('0x3'));var interaction=require(_0x2c26('0x4'));var config=require('../../config/environment');var controller=require(_0x2c26('0x5'));router[_0x2c26('0x6')]('/',auth['isAuthenticated'](),controller[_0x2c26('0x7')]);router[_0x2c26('0x6')](_0x2c26('0x8'),auth[_0x2c26('0x9')](),controller[_0x2c26('0xa')]);router[_0x2c26('0x6')]('/:id',auth[_0x2c26('0x9')](),controller[_0x2c26('0xb')]);router[_0x2c26('0x6')](_0x2c26('0xc'),auth[_0x2c26('0x9')](),controller[_0x2c26('0xd')]);router[_0x2c26('0x6')](_0x2c26('0xe'),auth[_0x2c26('0x9')](),controller[_0x2c26('0xf')]);router[_0x2c26('0x10')]('/',auth[_0x2c26('0x9')](),controller[_0x2c26('0x11')]);router[_0x2c26('0x10')](_0x2c26('0xc'),auth[_0x2c26('0x9')](),controller['addMessage']);router[_0x2c26('0x10')](_0x2c26('0x12'),auth['isAuthenticated'](),interaction[_0x2c26('0x13')]('sms',_0x2c26('0x14')),controller[_0x2c26('0x15')]);router['put']('/:id',auth[_0x2c26('0x9')](),interaction[_0x2c26('0x13')](_0x2c26('0x16'),'smsinteraction:update'),controller[_0x2c26('0x17')]);router[_0x2c26('0x18')]('/:id',auth['isAuthenticated'](),interaction['tracked']('sms',_0x2c26('0x19')),controller[_0x2c26('0x1a')]);router['delete'](_0x2c26('0x12'),auth[_0x2c26('0x9')](),controller[_0x2c26('0x1b')]);module[_0x2c26('0x1c')]=router; \ No newline at end of file +var _0x70a2=['../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x230daa,_0x2d4dd0){var _0x210dc5=function(_0x455859){while(--_0x455859){_0x230daa['push'](_0x230daa['shift']());}};_0x210dc5(++_0x2d4dd0);}(_0x70a2,0xa2));var _0x270a=function(_0x544baa,_0x1b17fe){_0x544baa=_0x544baa-0x0;var _0x5e8cc1=_0x70a2[_0x544baa];return _0x5e8cc1;};'use strict';var multer=require(_0x270a('0x0'));var util=require('util');var path=require(_0x270a('0x1'));var timeout=require('connect-timeout');var express=require(_0x270a('0x2'));var router=express[_0x270a('0x3')]();var auth=require(_0x270a('0x4'));var interaction=require(_0x270a('0x5'));var config=require(_0x270a('0x6'));var controller=require('./smsInteraction.controller');router[_0x270a('0x7')]('/',auth[_0x270a('0x8')](),controller[_0x270a('0x9')]);router[_0x270a('0x7')](_0x270a('0xa'),auth[_0x270a('0x8')](),controller['describe']);router[_0x270a('0x7')](_0x270a('0xb'),auth[_0x270a('0x8')](),controller[_0x270a('0xc')]);router[_0x270a('0x7')](_0x270a('0xd'),auth[_0x270a('0x8')](),controller[_0x270a('0xe')]);router['get'](_0x270a('0xf'),auth[_0x270a('0x8')](),controller[_0x270a('0x10')]);router[_0x270a('0x11')]('/',auth[_0x270a('0x8')](),controller['create']);router[_0x270a('0x11')](_0x270a('0xd'),auth['isAuthenticated'](),controller[_0x270a('0x12')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x270a('0x13')](_0x270a('0x14'),_0x270a('0x15')),controller[_0x270a('0x16')]);router[_0x270a('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0x270a('0x13')](_0x270a('0x14'),_0x270a('0x18')),controller['update']);router[_0x270a('0x19')](_0x270a('0xb'),auth[_0x270a('0x8')](),interaction[_0x270a('0x13')](_0x270a('0x14'),_0x270a('0x1a')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x270a('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index c4dcf18..ad5d654 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 _0xffb5=['ENUM','out','moment','DATE','STRING'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xffb5,0x115));var _0x5ffb=function(_0x3f016a,_0x2d8065){_0x3f016a=_0x3f016a-0x0;var _0x254a57=_0xffb5[_0x3f016a];return _0x254a57;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5ffb('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5ffb('0x1')]},'disposition':{'type':Sequelize[_0x5ffb('0x2')]},'note':{'type':Sequelize[_0x5ffb('0x2')]},'phone':{'type':Sequelize[_0x5ffb('0x2')]},'read1stAt':{'type':Sequelize[_0x5ffb('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x5ffb('0x3')]('in',_0x5ffb('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5ffb('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x5ffb('0x3')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x9cc6=['out','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x9cc6,0xb0));var _0x69cc=function(_0x4e0026,_0x2b52b6){_0x4e0026=_0x4e0026-0x0;var _0x3f8ee7=_0x9cc6[_0x4e0026];return _0x3f8ee7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x69cc('0x0'));module[_0x69cc('0x1')]={'closed':{'type':Sequelize[_0x69cc('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x69cc('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x69cc('0x4')]},'phone':{'type':Sequelize[_0x69cc('0x4')]},'read1stAt':{'type':Sequelize[_0x69cc('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x69cc('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x69cc('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x69cc('0x5')]('in',_0x69cc('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 e0588f4..6010959 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 _0xbe45=['desk.js','querystring','papaparse','../../components/auth/service','ioredis','api','../../config/environment','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','end','json','offset','set','reject','save','then','destroy','stack','name','send','index','SmsInteraction','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','merge','map','type','key','field','filter','options','tag','include','push','Tag','read','SmsMessage','Messages','direction','createdAt','distinct','count','includeAll','Users','fullname','CmContact','Contact','User','Owner','SmsAccount','color','catch','show','params','rawAttributes','find','create','body','update','describe','addMessage','ids','getMessages','findOne','hasOwnProperty','pick','$gte','split','findAll','addTags','setTags','omit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','format','interaction-%s.zip','firstName','1cm','mkdirSync','

Date:\x20%s

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

','','interaction-','.pdf','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x1ef919,_0x1983ea){var _0x3524cc=function(_0x3aab72){while(--_0x3aab72){_0x1ef919['push'](_0x1ef919['shift']());}};_0x3524cc(++_0x1983ea);}(_0xbe45,0xf0));var _0x5be4=function(_0x31aac1,_0x543d1d){_0x31aac1=_0x31aac1-0x0;var _0xb3b51f=_0xbe45[_0x31aac1];return _0xb3b51f;};'use strict';var pdf=require(_0x5be4('0x0'));var emlformat=require(_0x5be4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5be4('0x2'));var jsonpatch=require(_0x5be4('0x3'));var rp=require(_0x5be4('0x4'));var moment=require(_0x5be4('0x5'));var BPromise=require(_0x5be4('0x6'));var Mustache=require(_0x5be4('0x7'));var util=require('util');var path=require(_0x5be4('0x8'));var sox=require(_0x5be4('0x9'));var csv=require(_0x5be4('0xa'));var ejs=require(_0x5be4('0xb'));var fs=require('fs');var _=require(_0x5be4('0xc'));var squel=require(_0x5be4('0xd'));var crypto=require(_0x5be4('0xe'));var jsforce=require(_0x5be4('0xf'));var deskjs=require(_0x5be4('0x10'));var toCsv=require(_0x5be4('0xa'));var querystring=require(_0x5be4('0x11'));var Papa=require(_0x5be4('0x12'));var authService=require(_0x5be4('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x5be4('0x14'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x5be4('0x15'));var utils=require('../../config/utils');var config=require(_0x5be4('0x16'));var db=require(_0x5be4('0x17'))['db'];config['redis']=_[_0x5be4('0x18')](config[_0x5be4('0x19')],{'host':_0x5be4('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5be4('0x19')]));require('./smsInteraction.socket')[_0x5be4('0x1b')](socket);function respondWithStatusCode(_0x2afee8,_0x2dd93e){_0x2dd93e=_0x2dd93e||0xcc;return function(_0x335842){if(_0x335842){return _0x2afee8[_0x5be4('0x1c')](_0x2dd93e);}return _0x2afee8[_0x5be4('0x1d')](_0x2dd93e)[_0x5be4('0x1e')]();};}function respondWithResult(_0x5ebe65,_0x3e830e){_0x3e830e=_0x3e830e||0xc8;return function(_0x8466a7){if(_0x8466a7){return _0x5ebe65[_0x5be4('0x1d')](_0x3e830e)[_0x5be4('0x1f')](_0x8466a7);}};}function respondWithFilteredResult(_0x139a46,_0xa03013){return function(_0x94f434){if(_0x94f434){var _0x2b704d=_0x94f434['count'],_0x51662a=_0xa03013[_0x5be4('0x20')],_0x175630=_0xa03013[_0x5be4('0x20')]+_0xa03013['limit'],_0x50b970;if(_0x175630>=_0x2b704d){_0x175630=_0x2b704d;_0x50b970=0xc8;}else{_0x50b970=0xce;}_0x139a46[_0x5be4('0x1d')](_0x50b970);return _0x139a46[_0x5be4('0x21')]('Content-Range',_0x51662a+'-'+_0x175630+'/'+_0x2b704d)['json'](_0x94f434);}return null;};}function patchUpdates(_0x2690be){return function(_0x207948){try{jsonpatch['apply'](_0x207948,_0x2690be,!![]);}catch(_0x553f59){return BPromise[_0x5be4('0x22')](_0x553f59);}return _0x207948[_0x5be4('0x23')]();};}function saveUpdates(_0x2843e3,_0x3ccd67){return function(_0xa20552){if(_0xa20552){return _0xa20552['update'](_0x2843e3)[_0x5be4('0x24')](function(_0x51d7a7){return _0x51d7a7;});}return null;};}function removeEntity(_0x242005,_0x12b9cd){return function(_0x4d6eff){if(_0x4d6eff){return _0x4d6eff[_0x5be4('0x25')]()[_0x5be4('0x24')](function(){_0x242005['status'](0xcc)[_0x5be4('0x1e')]();});}};}function handleEntityNotFound(_0x2b2e2c,_0x353a65){return function(_0x39cf54){if(!_0x39cf54){_0x2b2e2c[_0x5be4('0x1c')](0x194);}return _0x39cf54;};}function handleError(_0x13779f,_0x112728){_0x112728=_0x112728||0x1f4;return function(_0x5b49ea){logger['error'](_0x5b49ea[_0x5be4('0x26')]);if(_0x5b49ea[_0x5be4('0x27')]){delete _0x5b49ea[_0x5be4('0x27')];}_0x13779f['status'](_0x112728)[_0x5be4('0x28')](_0x5b49ea);};}exports[_0x5be4('0x29')]=function(_0x3bd842,_0x412ef6){var _0x16f3bf={},_0x1e0485={},_0x4b9029={'count':0x0,'rows':[]};var _0x1661c2=db[_0x5be4('0x2a')]['rawAttributes'];_0x1e0485[_0x5be4('0x2b')]=_['keys'](_0x1661c2);_0x1e0485[_0x5be4('0x2c')]=_[_0x5be4('0x2d')](_0x3bd842['query']);_0x1e0485[_0x5be4('0x2e')]=_['intersection'](_0x1e0485['model'],_0x1e0485[_0x5be4('0x2c')]);_0x16f3bf[_0x5be4('0x2f')]=_[_0x5be4('0x30')](_0x1e0485[_0x5be4('0x2b')],qs[_0x5be4('0x31')](_0x3bd842[_0x5be4('0x2c')][_0x5be4('0x31')]));_0x16f3bf[_0x5be4('0x2f')]=_0x16f3bf[_0x5be4('0x2f')][_0x5be4('0x32')]?_0x16f3bf[_0x5be4('0x2f')]:_0x1e0485[_0x5be4('0x2b')];if(!_0x3bd842['query']['hasOwnProperty'](_0x5be4('0x33'))){_0x16f3bf[_0x5be4('0x34')]=qs[_0x5be4('0x34')](_0x3bd842[_0x5be4('0x2c')]['limit']);_0x16f3bf[_0x5be4('0x20')]=qs['offset'](_0x3bd842[_0x5be4('0x2c')]['offset']);}_0x16f3bf[_0x5be4('0x35')]=qs[_0x5be4('0x36')](_0x3bd842['query']['sort']);_0x16f3bf[_0x5be4('0x37')]=qs['filters'](_['pick'](_0x3bd842[_0x5be4('0x2c')],_0x1e0485[_0x5be4('0x2e')]));if(_0x3bd842[_0x5be4('0x2c')]['filter']){_0x16f3bf[_0x5be4('0x37')]=_[_0x5be4('0x38')](_0x16f3bf['where'],{'$or':_[_0x5be4('0x39')](_0x1661c2,function(_0x46953c){if(_0x46953c[_0x5be4('0x3a')][_0x5be4('0x3b')]!=='VIRTUAL'){var _0x68cd9={};_0x68cd9[_0x46953c[_0x5be4('0x3c')]]={'$like':'%'+_0x3bd842[_0x5be4('0x2c')][_0x5be4('0x3d')]+'%'};return _0x68cd9;}})});}_0x16f3bf=_[_0x5be4('0x38')]({},_0x16f3bf,_0x3bd842[_0x5be4('0x3e')]);var _0x11d139={'where':_0x16f3bf[_0x5be4('0x37')]};_0x11d139['include']=[];if(_0x3bd842[_0x5be4('0x2c')][_0x5be4('0x3f')]){_0x11d139[_0x5be4('0x40')][_0x5be4('0x41')]({'model':db[_0x5be4('0x42')],'as':'Tags','attributes':['id'],'where':{'id':_0x3bd842[_0x5be4('0x2c')][_0x5be4('0x3f')]},'required':!![]});_0x11d139['distinct']=!![];}if(_0x3bd842[_0x5be4('0x2c')][_0x5be4('0x43')]){_0x11d139['include'][_0x5be4('0x41')]({'model':db[_0x5be4('0x44')],'as':_0x5be4('0x45'),'attributes':['id',_0x5be4('0x46'),_0x5be4('0x47'),_0x5be4('0x43')],'where':{'direction':'in','read':_0x3bd842[_0x5be4('0x2c')][_0x5be4('0x43')]||![]},'required':!![]});_0x11d139[_0x5be4('0x48')]=!![];}return db['SmsInteraction'][_0x5be4('0x49')](_0x11d139)['then'](function(_0x4265cf){_0x4b9029[_0x5be4('0x49')]=_0x4265cf;if(_0x3bd842['query'][_0x5be4('0x4a')]){_0x16f3bf['include']=[{'model':db['User'],'as':_0x5be4('0x4b'),'required':![],'attributes':['id',_0x5be4('0x27'),_0x5be4('0x4c')]},{'model':db[_0x5be4('0x4d')],'as':_0x5be4('0x4e'),'required':![]},{'model':db[_0x5be4('0x4f')],'as':_0x5be4('0x50'),'attributes':['name',_0x5be4('0x4c'),'internal'],'required':![]},{'model':db[_0x5be4('0x51')],'as':'Account','attributes':[_0x5be4('0x27'),_0x5be4('0x3b')],'required':![]},{'model':db['SmsMessage'],'as':_0x5be4('0x45'),'attributes':['id',_0x5be4('0x46'),_0x5be4('0x47'),'read'],'where':{'direction':'in','read':_0x3bd842[_0x5be4('0x2c')][_0x5be4('0x43')]||![]},'required':_0x3bd842['query'][_0x5be4('0x43')]||![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x5be4('0x27'),_0x5be4('0x52')],'required':_0x3bd842['query'][_0x5be4('0x3f')]?!![]:![]},{'model':db['Tag'],'as':'ThroughTags','attributes':['id',_0x5be4('0x27'),_0x5be4('0x52')],'through':_0x3bd842[_0x5be4('0x2c')]['tag']?{'attributes':[],'where':{'TagId':_0x3bd842['query'][_0x5be4('0x3f')]||undefined}}:{},'required':_0x3bd842[_0x5be4('0x2c')][_0x5be4('0x3f')]?!![]:![]}];}return db[_0x5be4('0x2a')]['findAll'](_0x16f3bf);})[_0x5be4('0x24')](function(_0x154fd7){_0x4b9029['rows']=_0x154fd7;return _0x4b9029;})[_0x5be4('0x24')](respondWithFilteredResult(_0x412ef6,_0x16f3bf))[_0x5be4('0x53')](handleError(_0x412ef6,null));};exports[_0x5be4('0x54')]=function(_0x5617af,_0x50beb3){var _0x3481c9={'raw':![],'where':{'id':_0x5617af[_0x5be4('0x55')]['id']}},_0xc9ca2f={};_0xc9ca2f[_0x5be4('0x2b')]=_[_0x5be4('0x2d')](db[_0x5be4('0x2a')][_0x5be4('0x56')]);_0xc9ca2f[_0x5be4('0x2c')]=_[_0x5be4('0x2d')](_0x5617af['query']);_0xc9ca2f[_0x5be4('0x2e')]=_['intersection'](_0xc9ca2f[_0x5be4('0x2b')],_0xc9ca2f[_0x5be4('0x2c')]);_0x3481c9[_0x5be4('0x2f')]=_[_0x5be4('0x30')](_0xc9ca2f[_0x5be4('0x2b')],qs[_0x5be4('0x31')](_0x5617af[_0x5be4('0x2c')][_0x5be4('0x31')]));_0x3481c9[_0x5be4('0x2f')]=_0x3481c9[_0x5be4('0x2f')][_0x5be4('0x32')]?_0x3481c9['attributes']:_0xc9ca2f[_0x5be4('0x2b')];if(_0x5617af[_0x5be4('0x2c')][_0x5be4('0x4a')]){_0x3481c9[_0x5be4('0x40')]=[{'all':!![]}];}_0x3481c9=_[_0x5be4('0x38')]({},_0x3481c9,_0x5617af['options']);return db[_0x5be4('0x2a')][_0x5be4('0x57')](_0x3481c9)[_0x5be4('0x24')](handleEntityNotFound(_0x50beb3,null))[_0x5be4('0x24')](respondWithResult(_0x50beb3,null))[_0x5be4('0x53')](handleError(_0x50beb3,null));};exports[_0x5be4('0x58')]=function(_0x7d2b3c,_0x5d603b){return db[_0x5be4('0x2a')]['create'](_0x7d2b3c[_0x5be4('0x59')],{})[_0x5be4('0x24')](respondWithResult(_0x5d603b,0xc9))['catch'](handleError(_0x5d603b,null));};exports[_0x5be4('0x5a')]=function(_0x35617e,_0x3c3ebb){if(_0x35617e[_0x5be4('0x59')]['id']){delete _0x35617e[_0x5be4('0x59')]['id'];}return db[_0x5be4('0x2a')][_0x5be4('0x57')]({'where':{'id':_0x35617e[_0x5be4('0x55')]['id']}})['then'](handleEntityNotFound(_0x3c3ebb,null))['then'](saveUpdates(_0x35617e[_0x5be4('0x59')],null))['then'](respondWithResult(_0x3c3ebb,null))[_0x5be4('0x53')](handleError(_0x3c3ebb,null));};exports['destroy']=function(_0x27c570,_0x2a5b4f){return db[_0x5be4('0x2a')][_0x5be4('0x57')]({'where':{'id':_0x27c570[_0x5be4('0x55')]['id']}})[_0x5be4('0x24')](handleEntityNotFound(_0x2a5b4f,null))[_0x5be4('0x24')](removeEntity(_0x2a5b4f,null))['catch'](handleError(_0x2a5b4f,null));};exports[_0x5be4('0x5b')]=function(_0x356e4d,_0x5058f3){return db[_0x5be4('0x2a')][_0x5be4('0x5b')]()[_0x5be4('0x24')](respondWithResult(_0x5058f3,null))[_0x5be4('0x53')](handleError(_0x5058f3,null));};exports[_0x5be4('0x5c')]=function(_0x5f2c83,_0x3d1ad3,_0x15c59f){return db[_0x5be4('0x44')][_0x5be4('0x57')]({'where':{'id':_0x5f2c83[_0x5be4('0x55')]['id']}})['then'](handleEntityNotFound(_0x3d1ad3,null))[_0x5be4('0x24')](function(_0x4ebe41){if(_0x4ebe41){return _0x4ebe41[_0x5be4('0x5c')](_0x5f2c83[_0x5be4('0x59')][_0x5be4('0x5d')],_['omit'](_0x5f2c83[_0x5be4('0x59')],[_0x5be4('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x3d1ad3,null))['catch'](handleError(_0x3d1ad3,null));};exports[_0x5be4('0x5e')]=function(_0xbaf63b,_0x48816f,_0x5d5fab){var _0x19398d={'raw':![],'where':{}};var _0x2d05d5={};var _0x51b6af={'count':0x0,'rows':[]};return db[_0x5be4('0x2a')][_0x5be4('0x5f')]({'where':{'id':_0xbaf63b[_0x5be4('0x55')]['id']}})[_0x5be4('0x24')](handleEntityNotFound(_0x48816f,null))[_0x5be4('0x24')](function(_0x2aa387){if(_0x2aa387){_0x2d05d5[_0x5be4('0x2b')]=_[_0x5be4('0x2d')](db[_0x5be4('0x44')][_0x5be4('0x56')]);_0x2d05d5[_0x5be4('0x2c')]=_[_0x5be4('0x2d')](_0xbaf63b[_0x5be4('0x2c')]);_0x2d05d5[_0x5be4('0x2e')]=_[_0x5be4('0x30')](_0x2d05d5[_0x5be4('0x2b')],_0x2d05d5[_0x5be4('0x2c')]);_0x19398d[_0x5be4('0x2f')]=_[_0x5be4('0x30')](_0x2d05d5[_0x5be4('0x2b')],qs['fields'](_0xbaf63b['query'][_0x5be4('0x31')]));_0x19398d[_0x5be4('0x2f')]=_0x19398d[_0x5be4('0x2f')]['length']?_0x19398d['attributes']:_0x2d05d5[_0x5be4('0x2b')];if(!_0xbaf63b[_0x5be4('0x2c')][_0x5be4('0x60')](_0x5be4('0x33'))){_0x19398d[_0x5be4('0x34')]=qs[_0x5be4('0x34')](_0xbaf63b[_0x5be4('0x2c')]['limit']);_0x19398d[_0x5be4('0x20')]=qs[_0x5be4('0x20')](_0xbaf63b['query'][_0x5be4('0x20')]);}_0x19398d['order']=qs[_0x5be4('0x36')](_0xbaf63b['query']['sort']);_0x19398d['where']=qs[_0x5be4('0x2e')](_[_0x5be4('0x61')](_0xbaf63b[_0x5be4('0x2c')],_0x2d05d5[_0x5be4('0x2e')]));_0x19398d['where']['SmsInteractionId']=_0x2aa387['id'];if(_0xbaf63b['query']['filter']){_0x19398d['where']=_[_0x5be4('0x38')](_0x19398d[_0x5be4('0x37')],{'$or':_['map'](_0x19398d['attributes'],function(_0x262ff0){var _0xd8ba0e={};_0xd8ba0e[_0x262ff0]={'$like':'%'+_0xbaf63b[_0x5be4('0x2c')][_0x5be4('0x3d')]+'%'};return _0xd8ba0e;})});}if(_0xbaf63b[_0x5be4('0x2c')][_0x5be4('0x62')]){var _0x254486=_0xbaf63b[_0x5be4('0x2c')]['$gte'][_0x5be4('0x63')](',');var _0x2e6ab4={};_0x2e6ab4[_0x254486[0x0]]={'$gte':moment(_0x254486[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x19398d[_0x5be4('0x37')]=_[_0x5be4('0x38')](_0x19398d['where'],_0x2e6ab4);}_0x19398d=_[_0x5be4('0x38')]({},_0x19398d,_0xbaf63b[_0x5be4('0x3e')]);return db[_0x5be4('0x44')][_0x5be4('0x49')]({'where':_0x19398d[_0x5be4('0x37')]})[_0x5be4('0x24')](function(_0x409f05){_0x51b6af[_0x5be4('0x49')]=_0x409f05;if(_0xbaf63b[_0x5be4('0x2c')]['includeAll']){_0x19398d[_0x5be4('0x40')]=[{'all':!![]}];}return db[_0x5be4('0x44')][_0x5be4('0x64')](_0x19398d);})[_0x5be4('0x24')](function(_0x2ee96c){_0x51b6af['rows']=_0x2ee96c;return _0x51b6af;});}})['then'](respondWithFilteredResult(_0x48816f,_0x19398d))[_0x5be4('0x53')](handleError(_0x48816f,null));};exports[_0x5be4('0x65')]=function(_0x322e2a,_0x6b3c86,_0x3c3515){return db[_0x5be4('0x2a')][_0x5be4('0x57')]({'where':{'id':_0x322e2a[_0x5be4('0x55')]['id']}})['then'](handleEntityNotFound(_0x6b3c86,null))[_0x5be4('0x24')](function(_0x14bedd){if(_0x14bedd){return _0x14bedd[_0x5be4('0x66')](_0x322e2a[_0x5be4('0x59')][_0x5be4('0x5d')],_[_0x5be4('0x67')](_0x322e2a[_0x5be4('0x59')],['ids','id'])||{})['spread'](function(){return db[_0x5be4('0x42')][_0x5be4('0x64')]({'attributes':['id',_0x5be4('0x27'),_0x5be4('0x52')],'where':{'id':_0x322e2a[_0x5be4('0x59')][_0x5be4('0x5d')]}});})[_0x5be4('0x24')](function(_0x2645c8){socket['emit'](_0x5be4('0x68'),{'id':Number(_0x322e2a[_0x5be4('0x55')]['id']),'tags':_0x2645c8||[]});return{'id':Number(_0x322e2a['params']['id']),'tags':_0x2645c8||[]};});}})['then'](respondWithResult(_0x6b3c86,null))[_0x5be4('0x53')](handleError(_0x6b3c86,null));};exports['removeTags']=function(_0x4ea749,_0x4a5c0f,_0x41fd91){var _0x382edd;return db[_0x5be4('0x2a')][_0x5be4('0x57')]({'where':{'id':_0x4ea749[_0x5be4('0x55')]['id']}})['then'](handleEntityNotFound(_0x4a5c0f,null))[_0x5be4('0x24')](function(_0x8088bd){if(_0x8088bd){return _0x8088bd[_0x5be4('0x69')](_0x4ea749['query'][_0x5be4('0x5d')]);}})[_0x5be4('0x24')](respondWithStatusCode(_0x4a5c0f,null))['catch'](handleError(_0x4a5c0f,null));};exports[_0x5be4('0x6a')]=function(_0x27a1bb,_0x459594){var _0x9ceacf=moment()[_0x5be4('0x6b')]()[_0x5be4('0x6c')]();var _0x10a0aa=path[_0x5be4('0x6d')](config[_0x5be4('0x6e')],'server',_0x5be4('0x6f'),_0x5be4('0x70'));var _0x34c2ef=path[_0x5be4('0x6d')](config[_0x5be4('0x6e')],_0x5be4('0x71'),_0x5be4('0x6f'),_0x5be4('0x72'));var _0xe3cf5d=path[_0x5be4('0x6d')](_0x10a0aa,_0x9ceacf);var _0x2fa25e=util[_0x5be4('0x73')](_0x5be4('0x74'),_0x9ceacf);var _0x3b60a6=path[_0x5be4('0x6d')](_0x10a0aa,_0x2fa25e);var _0x393081=![];return db[_0x5be4('0x2a')]['find']({'where':{'id':_0x27a1bb[_0x5be4('0x55')]['id']},'include':[{'model':db[_0x5be4('0x44')],'as':_0x5be4('0x45'),'attributes':['id',_0x5be4('0x59')],'include':[{'model':db[_0x5be4('0x4f')],'as':_0x5be4('0x4f'),'attributes':['id',_0x5be4('0x4c')],'raw':!![]},{'model':db[_0x5be4('0x4d')],'as':_0x5be4('0x4e'),'attributes':['id',_0x5be4('0x75')],'raw':!![]}]}]})[_0x5be4('0x24')](handleEntityNotFound(_0x459594,null))[_0x5be4('0x24')](function(_0x3a21dd){if(_0x3a21dd){_0x393081=!![];var _0x141c75='';var _0x598ab5={'format':'Letter','border':_0x5be4('0x76')};fs[_0x5be4('0x77')](_0xe3cf5d);_0x141c75+=util[_0x5be4('0x73')]('

Sms\x20Interaction:\x20#%d

',_0x3a21dd['id']);_0x141c75+=util[_0x5be4('0x73')](_0x5be4('0x78'),moment()['format'](_0x5be4('0x79'))[_0x5be4('0x6c')]());_0x141c75+=_0x5be4('0x7a');for(var _0x3f94ba=0x0;_0x3f94ba<_0x3a21dd[_0x5be4('0x45')][_0x5be4('0x32')];_0x3f94ba++){var _0x12db5f=_0x3a21dd['Messages'][_0x3f94ba];_0x141c75+=_0x5be4('0x7b');_0x141c75+=util[_0x5be4('0x73')](_0x5be4('0x7c'),_0x12db5f[_0x5be4('0x4f')]?_0x12db5f[_0x5be4('0x4f')]['fullname']:_0x12db5f['Contact']['firstName'],_0x12db5f['body']);_0x141c75+=_0x5be4('0x7d');}return new BPromise(function(_0x13de47,_0x3d4d17){pdf['create'](_0x141c75,_0x598ab5)['toFile'](path['join'](_0xe3cf5d,_0x5be4('0x7e')+_0x9ceacf+_0x5be4('0x7f')),function(_0x1ea216,_0x91ba56){if(_0x1ea216)return _0x3d4d17(_0x1ea216);_0x13de47(_0x91ba56);});});}})[_0x5be4('0x24')](function(){if(_0x393081){return new BPromise(function(_0x324c65,_0xe150fd){zipdir(_0xe3cf5d,{'saveTo':_0x3b60a6},function(_0x28941b,_0x29eac0){if(_0x28941b)return _0xe150fd(_0x28941b);return _0x324c65(_0x29eac0);});});}})[_0x5be4('0x24')](function(){if(_0x393081){return new BPromise(function(_0x27d4fa,_0x132320){rimraf(_0xe3cf5d,function(_0x182ee7){if(_0x182ee7)_0x132320(_0x182ee7);return _0x27d4fa();});});}})[_0x5be4('0x24')](function(){if(_0x393081){return _0x459594[_0x5be4('0x6a')](_0x3b60a6,_0x2fa25e,function(_0x3d86e3){if(_0x3d86e3){console['log']('err',_0x3d86e3);}else{fs['unlinkSync'](_0x3b60a6);}});}else{return _0x459594[_0x5be4('0x1c')](0xc8);}})[_0x5be4('0x53')](handleError(_0x459594,null));}; \ No newline at end of file +var _0x4986=['socket.io-emitter','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','offset','order','sort','filter','where','merge','map','key','VIRTUAL','field','options','include','push','Tag','Tags','tag','distinct','read','SmsMessage','SmsInteraction','includeAll','User','Users','fullname','CmContact','Owner','Account','Messages','direction','createdAt','color','ThroughTags','findAll','rows','catch','show','params','fields','find','create','body','update','describe','addMessage','ids','omit','getMessages','findOne','rawAttributes','length','pick','SmsInteractionId','$gte','format','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','files','tmp','root','server','attachments','Contact','firstName','Letter','1cm','mkdirSync','

Sms\x20Interaction:\x20#%d

','

Date:\x20%s

','
','','%s:\x20%s

','toFile','interaction-','.pdf','log','err','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../mysqldb','redis','defaults','localhost'];(function(_0x4222b5,_0x37422c){var _0x425d4c=function(_0x53e442){while(--_0x53e442){_0x4222b5['push'](_0x4222b5['shift']());}};_0x425d4c(++_0x37422c);}(_0x4986,0x6e));var _0x6498=function(_0x3b15d2,_0x4282f6){_0x3b15d2=_0x3b15d2-0x0;var _0x254c19=_0x4986[_0x3b15d2];return _0x254c19;};'use strict';var pdf=require(_0x6498('0x0'));var emlformat=require(_0x6498('0x1'));var rimraf=require(_0x6498('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6498('0x3'));var moment=require(_0x6498('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6498('0x5'));var util=require(_0x6498('0x6'));var path=require(_0x6498('0x7'));var sox=require(_0x6498('0x8'));var csv=require(_0x6498('0x9'));var ejs=require(_0x6498('0xa'));var fs=require('fs');var _=require(_0x6498('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6498('0xc'));var deskjs=require(_0x6498('0xd'));var toCsv=require(_0x6498('0x9'));var querystring=require(_0x6498('0xe'));var Papa=require(_0x6498('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x6498('0x10'));var Redis=require(_0x6498('0x11'));var qs=require(_0x6498('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x6498('0x13'));var config=require('../../config/environment');var db=require(_0x6498('0x14'))['db'];config[_0x6498('0x15')]=_[_0x6498('0x16')](config[_0x6498('0x15')],{'host':_0x6498('0x17'),'port':0x18eb});var socket=require(_0x6498('0x18'))(new Redis(config[_0x6498('0x15')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4769ab,_0xfde02b){_0xfde02b=_0xfde02b||0xcc;return function(_0x3ae8e5){if(_0x3ae8e5){return _0x4769ab[_0x6498('0x19')](_0xfde02b);}return _0x4769ab[_0x6498('0x1a')](_0xfde02b)['end']();};}function respondWithResult(_0x318b75,_0x2ab98d){_0x2ab98d=_0x2ab98d||0xc8;return function(_0x172b0e){if(_0x172b0e){return _0x318b75[_0x6498('0x1a')](_0x2ab98d)[_0x6498('0x1b')](_0x172b0e);}};}function respondWithFilteredResult(_0x1b4083,_0x3fa89d){return function(_0x500d3f){if(_0x500d3f){var _0x43ae3b=_0x500d3f[_0x6498('0x1c')],_0x8b41fe=_0x3fa89d['offset'],_0x2a1247=_0x3fa89d['offset']+_0x3fa89d[_0x6498('0x1d')],_0x2f8fdb;if(_0x2a1247>=_0x43ae3b){_0x2a1247=_0x43ae3b;_0x2f8fdb=0xc8;}else{_0x2f8fdb=0xce;}_0x1b4083[_0x6498('0x1a')](_0x2f8fdb);return _0x1b4083[_0x6498('0x1e')](_0x6498('0x1f'),_0x8b41fe+'-'+_0x2a1247+'/'+_0x43ae3b)[_0x6498('0x1b')](_0x500d3f);}return null;};}function patchUpdates(_0x46c830){return function(_0x32a297){try{jsonpatch[_0x6498('0x20')](_0x32a297,_0x46c830,!![]);}catch(_0x377aef){return BPromise[_0x6498('0x21')](_0x377aef);}return _0x32a297[_0x6498('0x22')]();};}function saveUpdates(_0x1ccaec,_0x39b8d0){return function(_0x87685c){if(_0x87685c){return _0x87685c['update'](_0x1ccaec)['then'](function(_0x2a34d0){return _0x2a34d0;});}return null;};}function removeEntity(_0x514544,_0x46c3f7){return function(_0x30d261){if(_0x30d261){return _0x30d261[_0x6498('0x23')]()[_0x6498('0x24')](function(){_0x514544['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43b1d2,_0x4f9d95){return function(_0x3e8dc7){if(!_0x3e8dc7){_0x43b1d2[_0x6498('0x19')](0x194);}return _0x3e8dc7;};}function handleError(_0x41d43f,_0x271048){_0x271048=_0x271048||0x1f4;return function(_0x1ce28d){logger[_0x6498('0x25')](_0x1ce28d[_0x6498('0x26')]);if(_0x1ce28d[_0x6498('0x27')]){delete _0x1ce28d[_0x6498('0x27')];}_0x41d43f[_0x6498('0x1a')](_0x271048)[_0x6498('0x28')](_0x1ce28d);};}exports[_0x6498('0x29')]=function(_0x64df19,_0x4be06f){var _0x12c9d2={},_0x383d8b={},_0x5eda63={'count':0x0,'rows':[]};var _0x4f78b7=db['SmsInteraction']['rawAttributes'];_0x383d8b[_0x6498('0x2a')]=_[_0x6498('0x2b')](_0x4f78b7);_0x383d8b[_0x6498('0x2c')]=_[_0x6498('0x2b')](_0x64df19['query']);_0x383d8b[_0x6498('0x2d')]=_['intersection'](_0x383d8b['model'],_0x383d8b['query']);_0x12c9d2['attributes']=_[_0x6498('0x2e')](_0x383d8b[_0x6498('0x2a')],qs['fields'](_0x64df19[_0x6498('0x2c')]['fields']));_0x12c9d2[_0x6498('0x2f')]=_0x12c9d2[_0x6498('0x2f')]['length']?_0x12c9d2['attributes']:_0x383d8b[_0x6498('0x2a')];if(!_0x64df19['query'][_0x6498('0x30')](_0x6498('0x31'))){_0x12c9d2['limit']=qs[_0x6498('0x1d')](_0x64df19['query'][_0x6498('0x1d')]);_0x12c9d2[_0x6498('0x32')]=qs[_0x6498('0x32')](_0x64df19[_0x6498('0x2c')][_0x6498('0x32')]);}_0x12c9d2[_0x6498('0x33')]=qs[_0x6498('0x34')](_0x64df19['query'][_0x6498('0x34')]);_0x12c9d2['where']=qs[_0x6498('0x2d')](_['pick'](_0x64df19[_0x6498('0x2c')],_0x383d8b['filters']));if(_0x64df19[_0x6498('0x2c')][_0x6498('0x35')]){_0x12c9d2[_0x6498('0x36')]=_[_0x6498('0x37')](_0x12c9d2[_0x6498('0x36')],{'$or':_[_0x6498('0x38')](_0x4f78b7,function(_0x152b1c){if(_0x152b1c['type'][_0x6498('0x39')]!==_0x6498('0x3a')){var _0x15fe90={};_0x15fe90[_0x152b1c[_0x6498('0x3b')]]={'$like':'%'+_0x64df19[_0x6498('0x2c')][_0x6498('0x35')]+'%'};return _0x15fe90;}})});}_0x12c9d2=_[_0x6498('0x37')]({},_0x12c9d2,_0x64df19[_0x6498('0x3c')]);var _0x5bce22={'where':_0x12c9d2[_0x6498('0x36')]};_0x5bce22[_0x6498('0x3d')]=[];if(_0x64df19[_0x6498('0x2c')]['tag']){_0x5bce22[_0x6498('0x3d')][_0x6498('0x3e')]({'model':db[_0x6498('0x3f')],'as':_0x6498('0x40'),'attributes':['id'],'where':{'id':_0x64df19[_0x6498('0x2c')][_0x6498('0x41')]},'required':!![]});_0x5bce22[_0x6498('0x42')]=!![];}if(_0x64df19[_0x6498('0x2c')][_0x6498('0x43')]){_0x5bce22[_0x6498('0x3d')][_0x6498('0x3e')]({'model':db[_0x6498('0x44')],'as':'Messages','attributes':['id','direction','createdAt',_0x6498('0x43')],'where':{'direction':'in','read':_0x64df19[_0x6498('0x2c')][_0x6498('0x43')]||![]},'required':!![]});_0x5bce22[_0x6498('0x42')]=!![];}return db[_0x6498('0x45')][_0x6498('0x1c')](_0x5bce22)[_0x6498('0x24')](function(_0x5033e3){_0x5eda63[_0x6498('0x1c')]=_0x5033e3;if(_0x64df19[_0x6498('0x2c')][_0x6498('0x46')]){_0x12c9d2[_0x6498('0x3d')]=[{'model':db[_0x6498('0x47')],'as':_0x6498('0x48'),'required':![],'attributes':['id','name',_0x6498('0x49')]},{'model':db[_0x6498('0x4a')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x6498('0x4b'),'attributes':[_0x6498('0x27'),_0x6498('0x49'),'internal'],'required':![]},{'model':db['SmsAccount'],'as':_0x6498('0x4c'),'attributes':['name',_0x6498('0x39')],'required':![]},{'model':db[_0x6498('0x44')],'as':_0x6498('0x4d'),'attributes':['id',_0x6498('0x4e'),_0x6498('0x4f'),_0x6498('0x43')],'where':{'direction':'in','read':_0x64df19['query'][_0x6498('0x43')]||![]},'required':_0x64df19[_0x6498('0x2c')][_0x6498('0x43')]||![]},{'model':db[_0x6498('0x3f')],'as':'Tags','attributes':['id',_0x6498('0x27'),_0x6498('0x50')],'required':_0x64df19[_0x6498('0x2c')][_0x6498('0x41')]?!![]:![]},{'model':db[_0x6498('0x3f')],'as':_0x6498('0x51'),'attributes':['id',_0x6498('0x27'),_0x6498('0x50')],'through':_0x64df19['query'][_0x6498('0x41')]?{'attributes':[],'where':{'TagId':_0x64df19[_0x6498('0x2c')][_0x6498('0x41')]||undefined}}:{},'required':_0x64df19[_0x6498('0x2c')][_0x6498('0x41')]?!![]:![]}];}return db[_0x6498('0x45')][_0x6498('0x52')](_0x12c9d2);})[_0x6498('0x24')](function(_0x2685aa){_0x5eda63[_0x6498('0x53')]=_0x2685aa;return _0x5eda63;})[_0x6498('0x24')](respondWithFilteredResult(_0x4be06f,_0x12c9d2))[_0x6498('0x54')](handleError(_0x4be06f,null));};exports[_0x6498('0x55')]=function(_0x15878d,_0x4650ea){var _0x14b1f9={'raw':![],'where':{'id':_0x15878d[_0x6498('0x56')]['id']}},_0x1ba879={};_0x1ba879[_0x6498('0x2a')]=_[_0x6498('0x2b')](db[_0x6498('0x45')]['rawAttributes']);_0x1ba879[_0x6498('0x2c')]=_[_0x6498('0x2b')](_0x15878d[_0x6498('0x2c')]);_0x1ba879[_0x6498('0x2d')]=_[_0x6498('0x2e')](_0x1ba879[_0x6498('0x2a')],_0x1ba879['query']);_0x14b1f9['attributes']=_[_0x6498('0x2e')](_0x1ba879['model'],qs[_0x6498('0x57')](_0x15878d[_0x6498('0x2c')][_0x6498('0x57')]));_0x14b1f9[_0x6498('0x2f')]=_0x14b1f9[_0x6498('0x2f')]['length']?_0x14b1f9[_0x6498('0x2f')]:_0x1ba879[_0x6498('0x2a')];if(_0x15878d[_0x6498('0x2c')][_0x6498('0x46')]){_0x14b1f9['include']=[{'all':!![]}];}_0x14b1f9=_['merge']({},_0x14b1f9,_0x15878d[_0x6498('0x3c')]);return db['SmsInteraction'][_0x6498('0x58')](_0x14b1f9)[_0x6498('0x24')](handleEntityNotFound(_0x4650ea,null))[_0x6498('0x24')](respondWithResult(_0x4650ea,null))[_0x6498('0x54')](handleError(_0x4650ea,null));};exports[_0x6498('0x59')]=function(_0x1af361,_0x192e8e){return db[_0x6498('0x45')]['create'](_0x1af361[_0x6498('0x5a')],{})[_0x6498('0x24')](respondWithResult(_0x192e8e,0xc9))[_0x6498('0x54')](handleError(_0x192e8e,null));};exports[_0x6498('0x5b')]=function(_0x5c25b3,_0xcc006c){if(_0x5c25b3['body']['id']){delete _0x5c25b3[_0x6498('0x5a')]['id'];}return db['SmsInteraction'][_0x6498('0x58')]({'where':{'id':_0x5c25b3[_0x6498('0x56')]['id']}})['then'](handleEntityNotFound(_0xcc006c,null))['then'](saveUpdates(_0x5c25b3['body'],null))[_0x6498('0x24')](respondWithResult(_0xcc006c,null))[_0x6498('0x54')](handleError(_0xcc006c,null));};exports['destroy']=function(_0x35a41a,_0x68ec4e){return db['SmsInteraction']['find']({'where':{'id':_0x35a41a[_0x6498('0x56')]['id']}})[_0x6498('0x24')](handleEntityNotFound(_0x68ec4e,null))[_0x6498('0x24')](removeEntity(_0x68ec4e,null))[_0x6498('0x54')](handleError(_0x68ec4e,null));};exports[_0x6498('0x5c')]=function(_0x33c930,_0xe61382){return db[_0x6498('0x45')][_0x6498('0x5c')]()['then'](respondWithResult(_0xe61382,null))['catch'](handleError(_0xe61382,null));};exports[_0x6498('0x5d')]=function(_0x112e7f,_0x4f47a5,_0x1e9643){return db[_0x6498('0x44')][_0x6498('0x58')]({'where':{'id':_0x112e7f[_0x6498('0x56')]['id']}})[_0x6498('0x24')](handleEntityNotFound(_0x4f47a5,null))[_0x6498('0x24')](function(_0x50bab7){if(_0x50bab7){return _0x50bab7['addMessage'](_0x112e7f['body'][_0x6498('0x5e')],_[_0x6498('0x5f')](_0x112e7f['body'],[_0x6498('0x5e'),'id'])||{});}})[_0x6498('0x24')](respondWithResult(_0x4f47a5,null))[_0x6498('0x54')](handleError(_0x4f47a5,null));};exports[_0x6498('0x60')]=function(_0x318573,_0xa5d0eb,_0x11f3f7){var _0x178085={'raw':![],'where':{}};var _0x1af28f={};var _0x11080a={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x6498('0x61')]({'where':{'id':_0x318573[_0x6498('0x56')]['id']}})['then'](handleEntityNotFound(_0xa5d0eb,null))['then'](function(_0x5cb912){if(_0x5cb912){_0x1af28f['model']=_[_0x6498('0x2b')](db[_0x6498('0x44')][_0x6498('0x62')]);_0x1af28f[_0x6498('0x2c')]=_['keys'](_0x318573[_0x6498('0x2c')]);_0x1af28f['filters']=_[_0x6498('0x2e')](_0x1af28f[_0x6498('0x2a')],_0x1af28f[_0x6498('0x2c')]);_0x178085[_0x6498('0x2f')]=_[_0x6498('0x2e')](_0x1af28f[_0x6498('0x2a')],qs[_0x6498('0x57')](_0x318573[_0x6498('0x2c')][_0x6498('0x57')]));_0x178085[_0x6498('0x2f')]=_0x178085['attributes'][_0x6498('0x63')]?_0x178085[_0x6498('0x2f')]:_0x1af28f['model'];if(!_0x318573['query']['hasOwnProperty'](_0x6498('0x31'))){_0x178085[_0x6498('0x1d')]=qs['limit'](_0x318573['query'][_0x6498('0x1d')]);_0x178085[_0x6498('0x32')]=qs[_0x6498('0x32')](_0x318573['query'][_0x6498('0x32')]);}_0x178085[_0x6498('0x33')]=qs[_0x6498('0x34')](_0x318573[_0x6498('0x2c')][_0x6498('0x34')]);_0x178085[_0x6498('0x36')]=qs[_0x6498('0x2d')](_[_0x6498('0x64')](_0x318573['query'],_0x1af28f[_0x6498('0x2d')]));_0x178085[_0x6498('0x36')][_0x6498('0x65')]=_0x5cb912['id'];if(_0x318573[_0x6498('0x2c')]['filter']){_0x178085[_0x6498('0x36')]=_[_0x6498('0x37')](_0x178085[_0x6498('0x36')],{'$or':_['map'](_0x178085[_0x6498('0x2f')],function(_0xfe3ed){var _0x13aad2={};_0x13aad2[_0xfe3ed]={'$like':'%'+_0x318573[_0x6498('0x2c')][_0x6498('0x35')]+'%'};return _0x13aad2;})});}if(_0x318573[_0x6498('0x2c')]['$gte']){var _0x1e7668=_0x318573[_0x6498('0x2c')][_0x6498('0x66')]['split'](',');var _0x154b28={};_0x154b28[_0x1e7668[0x0]]={'$gte':moment(_0x1e7668[0x1])[_0x6498('0x67')]('YYYY-MM-DD\x20HH:mm:ss')};_0x178085[_0x6498('0x36')]=_[_0x6498('0x37')](_0x178085[_0x6498('0x36')],_0x154b28);}_0x178085=_[_0x6498('0x37')]({},_0x178085,_0x318573['options']);return db[_0x6498('0x44')][_0x6498('0x1c')]({'where':_0x178085[_0x6498('0x36')]})[_0x6498('0x24')](function(_0x26a737){_0x11080a[_0x6498('0x1c')]=_0x26a737;if(_0x318573[_0x6498('0x2c')][_0x6498('0x46')]){_0x178085[_0x6498('0x3d')]=[{'all':!![]}];}return db['SmsMessage'][_0x6498('0x52')](_0x178085);})[_0x6498('0x24')](function(_0x2503f3){_0x11080a[_0x6498('0x53')]=_0x2503f3;return _0x11080a;});}})[_0x6498('0x24')](respondWithFilteredResult(_0xa5d0eb,_0x178085))[_0x6498('0x54')](handleError(_0xa5d0eb,null));};exports[_0x6498('0x68')]=function(_0x308802,_0x16181c,_0x3f18be){return db[_0x6498('0x45')][_0x6498('0x58')]({'where':{'id':_0x308802[_0x6498('0x56')]['id']}})[_0x6498('0x24')](handleEntityNotFound(_0x16181c,null))[_0x6498('0x24')](function(_0xbebe20){if(_0xbebe20){return _0xbebe20[_0x6498('0x69')](_0x308802[_0x6498('0x5a')][_0x6498('0x5e')],_[_0x6498('0x5f')](_0x308802[_0x6498('0x5a')],[_0x6498('0x5e'),'id'])||{})[_0x6498('0x6a')](function(){return db[_0x6498('0x3f')][_0x6498('0x52')]({'attributes':['id',_0x6498('0x27'),_0x6498('0x50')],'where':{'id':_0x308802['body']['ids']}});})[_0x6498('0x24')](function(_0x1c298b){socket[_0x6498('0x6b')](_0x6498('0x6c'),{'id':Number(_0x308802[_0x6498('0x56')]['id']),'tags':_0x1c298b||[]});return{'id':Number(_0x308802[_0x6498('0x56')]['id']),'tags':_0x1c298b||[]};});}})[_0x6498('0x24')](respondWithResult(_0x16181c,null))[_0x6498('0x54')](handleError(_0x16181c,null));};exports[_0x6498('0x6d')]=function(_0x12fc40,_0x4e8946,_0x40fa8b){var _0x3f9563;return db[_0x6498('0x45')][_0x6498('0x58')]({'where':{'id':_0x12fc40['params']['id']}})[_0x6498('0x24')](handleEntityNotFound(_0x4e8946,null))[_0x6498('0x24')](function(_0x476965){if(_0x476965){return _0x476965[_0x6498('0x6d')](_0x12fc40[_0x6498('0x2c')][_0x6498('0x5e')]);}})['then'](respondWithStatusCode(_0x4e8946,null))['catch'](handleError(_0x4e8946,null));};exports[_0x6498('0x6e')]=function(_0x7baa78,_0xe09cc9){var _0x4f3aab=moment()[_0x6498('0x6f')]()[_0x6498('0x70')]();var _0x28c0df=path[_0x6498('0x71')](config['root'],'server',_0x6498('0x72'),_0x6498('0x73'));var _0x35a168=path[_0x6498('0x71')](config[_0x6498('0x74')],_0x6498('0x75'),_0x6498('0x72'),_0x6498('0x76'));var _0x51f380=path[_0x6498('0x71')](_0x28c0df,_0x4f3aab);var _0x4da692=util[_0x6498('0x67')]('interaction-%s.zip',_0x4f3aab);var _0x56763f=path[_0x6498('0x71')](_0x28c0df,_0x4da692);var _0x5b4404=![];return db[_0x6498('0x45')][_0x6498('0x58')]({'where':{'id':_0x7baa78[_0x6498('0x56')]['id']},'include':[{'model':db[_0x6498('0x44')],'as':_0x6498('0x4d'),'attributes':['id',_0x6498('0x5a')],'include':[{'model':db[_0x6498('0x47')],'as':_0x6498('0x47'),'attributes':['id',_0x6498('0x49')],'raw':!![]},{'model':db[_0x6498('0x4a')],'as':_0x6498('0x77'),'attributes':['id',_0x6498('0x78')],'raw':!![]}]}]})[_0x6498('0x24')](handleEntityNotFound(_0xe09cc9,null))[_0x6498('0x24')](function(_0x394e2d){if(_0x394e2d){_0x5b4404=!![];var _0xa511e9='';var _0xff8015={'format':_0x6498('0x79'),'border':_0x6498('0x7a')};fs[_0x6498('0x7b')](_0x51f380);_0xa511e9+=util['format'](_0x6498('0x7c'),_0x394e2d['id']);_0xa511e9+=util[_0x6498('0x67')](_0x6498('0x7d'),moment()[_0x6498('0x67')]('MMMM\x20Do\x20YYYY,\x20HH:mm:ss')['toString']());_0xa511e9+=_0x6498('0x7e');for(var _0x30b025=0x0;_0x30b025<_0x394e2d['Messages'][_0x6498('0x63')];_0x30b025++){var _0x4a0d10=_0x394e2d[_0x6498('0x4d')][_0x30b025];_0xa511e9+=_0x6498('0x7f');_0xa511e9+=util['format'](_0x6498('0x80'),_0x4a0d10['User']?_0x4a0d10['User'][_0x6498('0x49')]:_0x4a0d10[_0x6498('0x77')][_0x6498('0x78')],_0x4a0d10[_0x6498('0x5a')]);_0xa511e9+='';}return new BPromise(function(_0x5234c9,_0x19588e){pdf['create'](_0xa511e9,_0xff8015)[_0x6498('0x81')](path[_0x6498('0x71')](_0x51f380,_0x6498('0x82')+_0x4f3aab+_0x6498('0x83')),function(_0x54e28c,_0x3116c5){if(_0x54e28c)return _0x19588e(_0x54e28c);_0x5234c9(_0x3116c5);});});}})[_0x6498('0x24')](function(){if(_0x5b4404){return new BPromise(function(_0x26526d,_0x313827){zipdir(_0x51f380,{'saveTo':_0x56763f},function(_0x20e566,_0x28c9ff){if(_0x20e566)return _0x313827(_0x20e566);return _0x26526d(_0x28c9ff);});});}})[_0x6498('0x24')](function(){if(_0x5b4404){return new BPromise(function(_0x3db8f8,_0x1a2476){rimraf(_0x51f380,function(_0x1fe977){if(_0x1fe977)_0x1a2476(_0x1fe977);return _0x3db8f8();});});}})[_0x6498('0x24')](function(){if(_0x5b4404){return _0xe09cc9[_0x6498('0x6e')](_0x56763f,_0x4da692,function(_0x134334){if(_0x134334){console[_0x6498('0x84')](_0x6498('0x85'),_0x134334);}else{fs['unlinkSync'](_0x56763f);}});}else{return _0xe09cc9[_0x6498('0x19')](0xc8);}})['catch'](handleError(_0xe09cc9,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 9aa7a01..d1e9738 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 _0x5cfb=['remove','emit','hook','events','SmsInteraction','setMaxListeners','update'];(function(_0x436905,_0x38254b){var _0x4cade4=function(_0x5a211a){while(--_0x5a211a){_0x436905['push'](_0x436905['shift']());}};_0x4cade4(++_0x38254b);}(_0x5cfb,0x1b5));var _0xb5cf=function(_0x14dcea,_0x577357){_0x14dcea=_0x14dcea-0x0;var _0x2d616e=_0x5cfb[_0x14dcea];return _0x2d616e;};'use strict';var EventEmitter=require(_0xb5cf('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xb5cf('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xb5cf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb5cf('0x3'),'afterDestroy':_0xb5cf('0x4')};function emitEvent(_0x20d4ed){return function(_0x341a9b,_0x168bde,_0xf23b8f){SmsInteractionEvents['emit'](_0x20d4ed+':'+_0x341a9b['id'],_0x341a9b);SmsInteractionEvents[_0xb5cf('0x5')](_0x20d4ed,_0x341a9b);_0xf23b8f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xb5cf('0x6')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x6bd9=['emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6bd9,0xd5));var _0x96bd=function(_0x1488c6,_0x1dc1b1){_0x1488c6=_0x1488c6-0x0;var _0x417664=_0x6bd9[_0x1488c6];return _0x417664;};'use strict';var EventEmitter=require(_0x96bd('0x0'));var SmsInteraction=require(_0x96bd('0x1'))['db']['SmsInteraction'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x96bd('0x2')](0x0);var events={'afterCreate':_0x96bd('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4a3114){return function(_0xa15506,_0x3f20da,_0x3754c1){SmsInteractionEvents['emit'](_0x4a3114+':'+_0xa15506['id'],_0xa15506);SmsInteractionEvents[_0x96bd('0x4')](_0x4a3114,_0xa15506);_0x3754c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x96bd('0x5')](e,emitEvent(event));}}module[_0x96bd('0x6')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 06dfa21..70143b6 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 _0x4e09=['api','moment','bluebird','request-promise','exports','define','SmsInteraction','sms_interactions','util','../../config/logger'];(function(_0x1c6a3e,_0x5c3938){var _0x3637da=function(_0x2186c7){while(--_0x2186c7){_0x1c6a3e['push'](_0x1c6a3e['shift']());}};_0x3637da(++_0x5c3938);}(_0x4e09,0x166));var _0x94e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4e09[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x94e0('0x0'));var logger=require(_0x94e0('0x1'))(_0x94e0('0x2'));var moment=require(_0x94e0('0x3'));var BPromise=require(_0x94e0('0x4'));var rp=require(_0x94e0('0x5'));var attributes=require('./smsInteraction.attributes');module[_0x94e0('0x6')]=function(_0x335c1a,_0x43807e){return _0x335c1a[_0x94e0('0x7')](_0x94e0('0x8'),attributes,{'tableName':_0x94e0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bee=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','define','SmsInteraction','sms_interactions'];(function(_0x4b8a5c,_0x2f7371){var _0x2e38f4=function(_0x155abc){while(--_0x155abc){_0x4b8a5c['push'](_0x4b8a5c['shift']());}};_0x2e38f4(++_0x2f7371);}(_0x7bee,0x168));var _0xe7be=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7bee[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xe7be('0x0'));var util=require(_0xe7be('0x1'));var logger=require(_0xe7be('0x2'))(_0xe7be('0x3'));var moment=require(_0xe7be('0x4'));var BPromise=require(_0xe7be('0x5'));var rp=require(_0xe7be('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x12b218,_0x373bf1){return _0x12b218[_0xe7be('0x7')](_0xe7be('0x8'),attributes,{'tableName':_0xe7be('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 9012515..a237107 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 _0xd5a9=['catch','find','then','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','request\x20sent','debug','stringify','error','SmsInteraction,\x20%s,\x20%s','message','info','result','UpdateSmsInteraction','SmsInteraction','options','where','attributes','limit'];(function(_0x3d4793,_0x37a97f){var _0x4a88cb=function(_0x4f9a29){while(--_0x4f9a29){_0x3d4793['push'](_0x3d4793['shift']());}};_0x4a88cb(++_0x37a97f);}(_0xd5a9,0x1e9));var _0x9d5a=function(_0x44878f,_0x318b51){_0x44878f=_0x44878f-0x0;var _0x12c603=_0xd5a9[_0x44878f];return _0x12c603;};'use strict';var _=require(_0x9d5a('0x0'));var util=require('util');var moment=require(_0x9d5a('0x1'));var BPromise=require(_0x9d5a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d5a('0x3'));var db=require(_0x9d5a('0x4'))['db'];var utils=require(_0x9d5a('0x5'));var logger=require('../../config/logger')(_0x9d5a('0x6'));var config=require(_0x9d5a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9d5a('0x8')][_0x9d5a('0x9')]({'port':0x232a});config[_0x9d5a('0xa')]=_[_0x9d5a('0xb')](config[_0x9d5a('0xa')],{'host':_0x9d5a('0xc'),'port':0x18eb});var socket=require(_0x9d5a('0xd'))(new Redis(config['redis']));require(_0x9d5a('0xe'))[_0x9d5a('0xf')](socket);function respondWithRpcPromise(_0x305e0c,_0x146245,_0x324b79){return new BPromise(function(_0x49ebfe,_0x586226){return client[_0x9d5a('0x10')](_0x305e0c,_0x324b79)['then'](function(_0x27e725){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x146245,_0x9d5a('0x11'));logger[_0x9d5a('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x146245,_0x9d5a('0x11'),JSON[_0x9d5a('0x13')](_0x27e725));if(_0x27e725['error']){if(_0x27e725['error']['code']===0x1f4){logger[_0x9d5a('0x14')](_0x9d5a('0x15'),_0x146245,_0x27e725[_0x9d5a('0x14')][_0x9d5a('0x16')]);return _0x586226(_0x27e725['error'][_0x9d5a('0x16')]);}logger[_0x9d5a('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x146245,_0x27e725['error'][_0x9d5a('0x16')]);return _0x49ebfe(_0x27e725[_0x9d5a('0x14')][_0x9d5a('0x16')]);}else{logger[_0x9d5a('0x17')](_0x9d5a('0x15'),_0x146245,_0x9d5a('0x11'));_0x49ebfe(_0x27e725[_0x9d5a('0x18')][_0x9d5a('0x16')]);}})['catch'](function(_0x2b082a){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x146245,_0x2b082a);_0x586226(_0x2b082a);});});}exports[_0x9d5a('0x19')]=function(_0x5ef487){var _0x5b254a=this;return new Promise(function(_0xbab3f3,_0x44138b){return db[_0x9d5a('0x1a')]['update'](_0x5ef487['body'],{'raw':_0x5ef487[_0x9d5a('0x1b')]?_0x5ef487[_0x9d5a('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ef487[_0x9d5a('0x1b')]?_0x5ef487['options'][_0x9d5a('0x1c')]||null:null,'attributes':_0x5ef487[_0x9d5a('0x1b')]?_0x5ef487[_0x9d5a('0x1b')][_0x9d5a('0x1d')]||null:null,'limit':_0x5ef487[_0x9d5a('0x1b')]?_0x5ef487[_0x9d5a('0x1b')][_0x9d5a('0x1e')]||null:null})['then'](function(_0x57ff00){logger[_0x9d5a('0x17')](_0x9d5a('0x19'),_0x5ef487);logger['debug'](_0x9d5a('0x19'),_0x5ef487,JSON['stringify'](_0x57ff00));_0xbab3f3(_0x57ff00);})[_0x9d5a('0x1f')](function(_0x38f04c){logger[_0x9d5a('0x14')]('UpdateSmsInteraction',_0x38f04c[_0x9d5a('0x16')],_0x5ef487);_0x44138b(_0x5b254a[_0x9d5a('0x14')](0x1f4,_0x38f04c['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x28818f){return new Promise(function(_0x4e5f28,_0xe76f34){return db['SmsInteraction'][_0x9d5a('0x20')]({'where':_0x28818f[_0x9d5a('0x1b')]?_0x28818f[_0x9d5a('0x1b')]['where']||null:null})[_0x9d5a('0x21')](function(_0x238bb6){if(_0x238bb6){return _0x238bb6[_0x9d5a('0x22')](_0x28818f[_0x9d5a('0x23')][_0x9d5a('0x24')],_[_0x9d5a('0x25')](_0x28818f[_0x9d5a('0x23')],['ids','id'])||{});}})[_0x9d5a('0x26')](function(_0x4a20a6){logger['info'](_0x9d5a('0x27'),_0x28818f);logger[_0x9d5a('0x12')](_0x9d5a('0x27'),_0x28818f,JSON[_0x9d5a('0x13')](_0x4a20a6));_0x4e5f28(_0x4a20a6);})[_0x9d5a('0x1f')](function(_0x43a520){logger[_0x9d5a('0x14')](_0x9d5a('0x27'),_0x43a520[_0x9d5a('0x16')],_0x28818f);_0xe76f34(_this[_0x9d5a('0x14')](0x1f4,_0x43a520['message']));});});}; \ No newline at end of file +var _0xc4e6=['debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateSmsInteraction','SmsInteraction','options','raw','attributes','stringify','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x4da022,_0x502afa){var _0x327d96=function(_0x11d7af){while(--_0x11d7af){_0x4da022['push'](_0x4da022['shift']());}};_0x327d96(++_0x502afa);}(_0xc4e6,0x66));var _0x6c4e=function(_0x770f7,_0x3af003){_0x770f7=_0x770f7-0x0;var _0xe797c6=_0xc4e6[_0x770f7];return _0xe797c6;};'use strict';var _=require(_0x6c4e('0x0'));var util=require(_0x6c4e('0x1'));var moment=require('moment');var BPromise=require(_0x6c4e('0x2'));var rs=require(_0x6c4e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c4e('0x4'))['db'];var utils=require(_0x6c4e('0x5'));var logger=require(_0x6c4e('0x6'))(_0x6c4e('0x7'));var config=require(_0x6c4e('0x8'));var jayson=require(_0x6c4e('0x9'));var client=jayson['client'][_0x6c4e('0xa')]({'port':0x232a});config[_0x6c4e('0xb')]=_[_0x6c4e('0xc')](config[_0x6c4e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c4e('0xd'))(new Redis(config['redis']));require(_0x6c4e('0xe'))[_0x6c4e('0xf')](socket);function respondWithRpcPromise(_0x11317b,_0x234840,_0x3da9a7){return new BPromise(function(_0x5e7abd,_0x3d4903){return client[_0x6c4e('0x10')](_0x11317b,_0x3da9a7)[_0x6c4e('0x11')](function(_0x44b1a9){logger[_0x6c4e('0x12')](_0x6c4e('0x13'),_0x234840,_0x6c4e('0x14'));logger[_0x6c4e('0x15')](_0x6c4e('0x16'),_0x234840,'request\x20sent',JSON['stringify'](_0x44b1a9));if(_0x44b1a9[_0x6c4e('0x17')]){if(_0x44b1a9[_0x6c4e('0x17')][_0x6c4e('0x18')]===0x1f4){logger[_0x6c4e('0x17')](_0x6c4e('0x13'),_0x234840,_0x44b1a9[_0x6c4e('0x17')][_0x6c4e('0x19')]);return _0x3d4903(_0x44b1a9[_0x6c4e('0x17')][_0x6c4e('0x19')]);}logger[_0x6c4e('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x234840,_0x44b1a9[_0x6c4e('0x17')]['message']);return _0x5e7abd(_0x44b1a9[_0x6c4e('0x17')][_0x6c4e('0x19')]);}else{logger[_0x6c4e('0x12')](_0x6c4e('0x13'),_0x234840,_0x6c4e('0x14'));_0x5e7abd(_0x44b1a9['result'][_0x6c4e('0x19')]);}})[_0x6c4e('0x1a')](function(_0xca7ab0){logger[_0x6c4e('0x17')](_0x6c4e('0x13'),_0x234840,_0xca7ab0);_0x3d4903(_0xca7ab0);});});}exports[_0x6c4e('0x1b')]=function(_0x417907){var _0x152ac9=this;return new Promise(function(_0x59e9d5,_0x317414){return db[_0x6c4e('0x1c')]['update'](_0x417907['body'],{'raw':_0x417907[_0x6c4e('0x1d')]?_0x417907[_0x6c4e('0x1d')][_0x6c4e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x417907[_0x6c4e('0x1d')]?_0x417907[_0x6c4e('0x1d')]['where']||null:null,'attributes':_0x417907[_0x6c4e('0x1d')]?_0x417907[_0x6c4e('0x1d')][_0x6c4e('0x1f')]||null:null,'limit':_0x417907[_0x6c4e('0x1d')]?_0x417907[_0x6c4e('0x1d')]['limit']||null:null})['then'](function(_0x6ad98){logger[_0x6c4e('0x12')]('UpdateSmsInteraction',_0x417907);logger[_0x6c4e('0x15')](_0x6c4e('0x1b'),_0x417907,JSON[_0x6c4e('0x20')](_0x6ad98));_0x59e9d5(_0x6ad98);})[_0x6c4e('0x1a')](function(_0x100b07){logger[_0x6c4e('0x17')](_0x6c4e('0x1b'),_0x100b07[_0x6c4e('0x19')],_0x417907);_0x317414(_0x152ac9[_0x6c4e('0x17')](0x1f4,_0x100b07['message']));});});};exports[_0x6c4e('0x21')]=function(_0x5578ce){return new Promise(function(_0x19b36b,_0x52e26b){return db['SmsInteraction'][_0x6c4e('0x22')]({'where':_0x5578ce[_0x6c4e('0x1d')]?_0x5578ce[_0x6c4e('0x1d')]['where']||null:null})[_0x6c4e('0x11')](function(_0x13d2c6){if(_0x13d2c6){return _0x13d2c6[_0x6c4e('0x23')](_0x5578ce[_0x6c4e('0x24')][_0x6c4e('0x25')],_[_0x6c4e('0x26')](_0x5578ce['body'],['ids','id'])||{});}})[_0x6c4e('0x27')](function(_0x37186e){logger[_0x6c4e('0x12')](_0x6c4e('0x28'),_0x5578ce);logger['debug'](_0x6c4e('0x28'),_0x5578ce,JSON[_0x6c4e('0x20')](_0x37186e));_0x19b36b(_0x37186e);})['catch'](function(_0xb3da39){logger[_0x6c4e('0x17')](_0x6c4e('0x28'),_0xb3da39[_0x6c4e('0x19')],_0x5578ce);_0x52e26b(_this[_0x6c4e('0x17')](0x1f4,_0xb3da39[_0x6c4e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 1839786..28d0186 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 _0x2e7f=['save','remove','update','emit','removeListener','register','./smsInteraction.events'];(function(_0x29d24a,_0xb8b373){var _0x18e611=function(_0x2c2a02){while(--_0x2c2a02){_0x29d24a['push'](_0x29d24a['shift']());}};_0x18e611(++_0xb8b373);}(_0x2e7f,0x110));var _0xf2e7=function(_0x45b92e,_0x3c32fa){_0x45b92e=_0x45b92e-0x0;var _0x5f4955=_0x2e7f[_0x45b92e];return _0x5f4955;};'use strict';var SmsInteractionEvents=require(_0xf2e7('0x0'));var events=[_0xf2e7('0x1'),_0xf2e7('0x2'),_0xf2e7('0x3')];function createListener(_0x2df78f,_0x5caf08){return function(_0x11a93c){_0x5caf08[_0xf2e7('0x4')](_0x2df78f,_0x11a93c);};}function removeListener(_0x531d04,_0x3a4548){return function(){SmsInteractionEvents[_0xf2e7('0x5')](_0x531d04,_0x3a4548);};}exports[_0xf2e7('0x6')]=function(_0x395a62){for(var _0xd03e29=0x0,_0x1d1777=events['length'];_0xd03e29<_0x1d1777;_0xd03e29++){var _0x555a10=events[_0xd03e29];var _0x59541f=createListener('smsInteraction:'+_0x555a10,_0x395a62);SmsInteractionEvents['on'](_0x555a10,_0x59541f);}}; \ No newline at end of file +var _0x02f2=['emit','register','length','smsInteraction:','./smsInteraction.events','save','update'];(function(_0x505820,_0x922251){var _0xe713c3=function(_0x5424ea){while(--_0x5424ea){_0x505820['push'](_0x505820['shift']());}};_0xe713c3(++_0x922251);}(_0x02f2,0x193));var _0x202f=function(_0x4a3ac5,_0x39816a){_0x4a3ac5=_0x4a3ac5-0x0;var _0x923f66=_0x02f2[_0x4a3ac5];return _0x923f66;};'use strict';var SmsInteractionEvents=require(_0x202f('0x0'));var events=[_0x202f('0x1'),'remove',_0x202f('0x2')];function createListener(_0x4db9ca,_0x3af23){return function(_0x450ebf){_0x3af23[_0x202f('0x3')](_0x4db9ca,_0x450ebf);};}function removeListener(_0x2d72e5,_0x1c6a01){return function(){SmsInteractionEvents['removeListener'](_0x2d72e5,_0x1c6a01);};}exports[_0x202f('0x4')]=function(_0x15f40a){for(var _0x3c5885=0x0,_0x57f63d=events[_0x202f('0x5')];_0x3c5885<_0x57f63d;_0x3c5885++){var _0x306d82=events[_0x3c5885];var _0x20eb11=createListener(_0x202f('0x6')+_0x306d82,_0x15f40a);SmsInteractionEvents['on'](_0x306d82,_0x20eb11);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index eb8d439..ecae57a 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 _0xc893=['show','post','tracked','smsmessage:create','create','/:id/status','status','put','update','accept','reject','delete','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x1283c9,_0x1db901){var _0x3fe521=function(_0x42929c){while(--_0x42929c){_0x1283c9['push'](_0x1283c9['shift']());}};_0x3fe521(++_0x1db901);}(_0xc893,0x1d4));var _0x3c89=function(_0xf1d1c1,_0x242845){_0xf1d1c1=_0xf1d1c1-0x0;var _0x50d951=_0xc893[_0xf1d1c1];return _0x50d951;};'use strict';var multer=require(_0x3c89('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3c89('0x1'));var express=require(_0x3c89('0x2'));var router=express[_0x3c89('0x3')]();var auth=require(_0x3c89('0x4'));var interaction=require(_0x3c89('0x5'));var config=require('../../config/environment');var controller=require(_0x3c89('0x6'));router[_0x3c89('0x7')]('/',auth[_0x3c89('0x8')](),controller['index']);router[_0x3c89('0x7')](_0x3c89('0x9'),auth[_0x3c89('0x8')](),controller[_0x3c89('0xa')]);router['get'](_0x3c89('0xb'),auth[_0x3c89('0x8')](),controller[_0x3c89('0xc')]);router[_0x3c89('0xd')]('/',auth['isAuthenticated'](),interaction[_0x3c89('0xe')]('sms',_0x3c89('0xf')),controller[_0x3c89('0x10')]);router[_0x3c89('0xd')](_0x3c89('0x11'),controller[_0x3c89('0x12')]);router[_0x3c89('0x13')](_0x3c89('0xb'),auth[_0x3c89('0x8')](),controller[_0x3c89('0x14')]);router[_0x3c89('0x13')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3c89('0x15')]);router[_0x3c89('0x13')]('/:id/reject',auth[_0x3c89('0x8')](),controller[_0x3c89('0x16')]);router[_0x3c89('0x17')](_0x3c89('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf544=['accept','/:id/reject','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','sms','smsmessage:create','/:id/status','status','put','update'];(function(_0x45dd25,_0x21df70){var _0x3ae21c=function(_0x1ec41f){while(--_0x1ec41f){_0x45dd25['push'](_0x45dd25['shift']());}};_0x3ae21c(++_0x21df70);}(_0xf544,0x99));var _0x4f54=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0xf544[_0xb3b452];return _0x238983;};'use strict';var multer=require(_0x4f54('0x0'));var util=require('util');var path=require(_0x4f54('0x1'));var timeout=require(_0x4f54('0x2'));var express=require(_0x4f54('0x3'));var router=express['Router']();var auth=require(_0x4f54('0x4'));var interaction=require(_0x4f54('0x5'));var config=require(_0x4f54('0x6'));var controller=require(_0x4f54('0x7'));router[_0x4f54('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4f54('0x8')](_0x4f54('0x9'),auth[_0x4f54('0xa')](),controller[_0x4f54('0xb')]);router[_0x4f54('0x8')](_0x4f54('0xc'),auth[_0x4f54('0xa')](),controller[_0x4f54('0xd')]);router[_0x4f54('0xe')]('/',auth[_0x4f54('0xa')](),interaction[_0x4f54('0xf')](_0x4f54('0x10'),_0x4f54('0x11')),controller['create']);router[_0x4f54('0xe')](_0x4f54('0x12'),controller[_0x4f54('0x13')]);router[_0x4f54('0x14')](_0x4f54('0xc'),auth[_0x4f54('0xa')](),controller[_0x4f54('0x15')]);router[_0x4f54('0x14')]('/:id/accept',auth['isAuthenticated'](),controller[_0x4f54('0x16')]);router[_0x4f54('0x14')](_0x4f54('0x17'),auth[_0x4f54('0xa')](),controller['reject']);router['delete'](_0x4f54('0xc'),auth[_0x4f54('0xa')](),controller['destroy']);module[_0x4f54('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 3c6687f..dc69646 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 _0xc73a=['DATE','BOOLEAN','exports','TEXT','medium','out','STRING'];(function(_0x30355a,_0x440018){var _0x141897=function(_0x3800e2){while(--_0x3800e2){_0x30355a['push'](_0x30355a['shift']());}};_0x141897(++_0x440018);}(_0xc73a,0x72));var _0xac73=function(_0x247f42,_0x40256f){_0x247f42=_0x247f42-0x0;var _0xac9eff=_0xc73a[_0x247f42];return _0xac9eff;};'use strict';var Sequelize=require('sequelize');module[_0xac73('0x0')]={'body':{'type':Sequelize[_0xac73('0x1')](_0xac73('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xac73('0x3')),'defaultValue':_0xac73('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xac73('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xac73('0x5')]},'secret':{'type':Sequelize[_0xac73('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x6379=['exports','TEXT','medium','BOOLEAN','out','DATE','sequelize'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x6379,0x84));var _0x9637=function(_0x34ea22,_0x1270b3){_0x34ea22=_0x34ea22-0x0;var _0x1ca470=_0x6379[_0x34ea22];return _0x1ca470;};'use strict';var Sequelize=require(_0x9637('0x0'));module[_0x9637('0x1')]={'body':{'type':Sequelize[_0x9637('0x2')](_0x9637('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9637('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9637('0x5')),'defaultValue':_0x9637('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x9637('0x6')]},'secret':{'type':Sequelize[_0x9637('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 9d1f7ed..2c0415a 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 _0xd117=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','redis','localhost','./smsMessage.socket','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','destroy','name','send','index','SmsMessage','rawAttributes','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','key','VIRTUAL','options','include','findAll','rows','show','params','merge','create','body','update','find','describe','sms-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','manual','interface','channel','event','EventManager','sms','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','SmsAccountId','debug','received\x20delivery\x20report\x20from','MessageSid','twilio','inspect','plivo','MessageUUID','messageId','indexOf','sent','Status','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x437b28,_0xa9b6a){var _0x3b945c=function(_0x1fb57e){while(--_0x1fb57e){_0x437b28['push'](_0x437b28['shift']());}};_0x3b945c(++_0xa9b6a);}(_0xd117,0x182));var _0x7d11=function(_0x2ed1a0,_0x36acd9){_0x2ed1a0=_0x2ed1a0-0x0;var _0x3d272e=_0xd117[_0x2ed1a0];return _0x3d272e;};'use strict';var pdf=require(_0x7d11('0x0'));var emlformat=require(_0x7d11('0x1'));var rimraf=require(_0x7d11('0x2'));var zipdir=require(_0x7d11('0x3'));var jsonpatch=require(_0x7d11('0x4'));var rp=require(_0x7d11('0x5'));var moment=require(_0x7d11('0x6'));var BPromise=require(_0x7d11('0x7'));var Mustache=require(_0x7d11('0x8'));var util=require(_0x7d11('0x9'));var path=require(_0x7d11('0xa'));var sox=require(_0x7d11('0xb'));var csv=require(_0x7d11('0xc'));var ejs=require(_0x7d11('0xd'));var fs=require('fs');var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xc'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var authService=require(_0x7d11('0x13'));var hardwareService=require(_0x7d11('0x14'));var Redis=require('ioredis');var qs=require(_0x7d11('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7d11('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7d11('0x17')]=_['defaults'](config[_0x7d11('0x17')],{'host':_0x7d11('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7d11('0x17')]));require(_0x7d11('0x19'))['register'](socket);var jayson=require(_0x7d11('0x1a'));var client=jayson[_0x7d11('0x1b')][_0x7d11('0x1c')]({'port':0x232c});var client9002=jayson[_0x7d11('0x1b')][_0x7d11('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xeae744,_0x2a269e,_0xb1669e,_0x4aa795){return new BPromise(function(_0x1db0df,_0x12c2ff){var _0x169733=_0x4aa795||client;return _0x169733[_0x7d11('0x1d')](_0xeae744,_0xb1669e)[_0x7d11('0x1e')](function(_0x528fdc){logger[_0x7d11('0x1f')](_0x7d11('0x20'),_0x2a269e,'request\x20sent');logger['debug'](_0x7d11('0x21'),_0x2a269e,'request\x20sent',JSON[_0x7d11('0x22')](_0x528fdc));if(_0x528fdc['error']){if(_0x528fdc[_0x7d11('0x23')][_0x7d11('0x24')]===0x1f4){logger[_0x7d11('0x23')](_0x7d11('0x20'),_0x2a269e,_0x528fdc[_0x7d11('0x23')][_0x7d11('0x25')]);return _0x12c2ff(_0x528fdc[_0x7d11('0x23')][_0x7d11('0x25')]);}logger['error'](_0x7d11('0x20'),_0x2a269e,_0x528fdc['error']['message']);return _0x1db0df(_0x528fdc['error'][_0x7d11('0x25')]);}else{logger[_0x7d11('0x1f')](_0x7d11('0x20'),_0x2a269e,_0x7d11('0x26'));_0x1db0df(_0x528fdc[_0x7d11('0x27')][_0x7d11('0x25')]);}})[_0x7d11('0x28')](function(_0x1c1edd){logger['error'](_0x7d11('0x20'),_0x2a269e,_0x1c1edd);_0x12c2ff(_0x1c1edd);});});}function respondWithStatusCode(_0x577ca9,_0x4bfa76){_0x4bfa76=_0x4bfa76||0xcc;return function(_0x5126cf){if(_0x5126cf){return _0x577ca9[_0x7d11('0x29')](_0x4bfa76);}return _0x577ca9['status'](_0x4bfa76)[_0x7d11('0x2a')]();};}function respondWithResult(_0x30e4c6,_0x328ab7){_0x328ab7=_0x328ab7||0xc8;return function(_0x47c794){if(_0x47c794){return _0x30e4c6[_0x7d11('0x2b')](_0x328ab7)[_0x7d11('0x2c')](_0x47c794);}};}function respondWithFilteredResult(_0x427200,_0x5d38dd){return function(_0x601650){if(_0x601650){var _0x35a789=_0x601650[_0x7d11('0x2d')],_0x18c049=_0x5d38dd['offset'],_0x38f1be=_0x5d38dd[_0x7d11('0x2e')]+_0x5d38dd['limit'],_0x4c7d6a;if(_0x38f1be>=_0x35a789){_0x38f1be=_0x35a789;_0x4c7d6a=0xc8;}else{_0x4c7d6a=0xce;}_0x427200[_0x7d11('0x2b')](_0x4c7d6a);return _0x427200[_0x7d11('0x2f')](_0x7d11('0x30'),_0x18c049+'-'+_0x38f1be+'/'+_0x35a789)['json'](_0x601650);}return null;};}function patchUpdates(_0x5e721f){return function(_0x8e0a53){try{jsonpatch[_0x7d11('0x31')](_0x8e0a53,_0x5e721f,!![]);}catch(_0x5d540e){return BPromise[_0x7d11('0x32')](_0x5d540e);}return _0x8e0a53[_0x7d11('0x33')]();};}function saveUpdates(_0x3eff9c,_0x53ec4c){return function(_0x9c6609){if(_0x9c6609){return _0x9c6609['update'](_0x3eff9c)['then'](function(_0x3a88c9){return _0x3a88c9;});}return null;};}function removeEntity(_0x56637d,_0x1d5d4e){return function(_0x38fbd3){if(_0x38fbd3){return _0x38fbd3[_0x7d11('0x34')]()[_0x7d11('0x1e')](function(){_0x56637d['status'](0xcc)[_0x7d11('0x2a')]();});}};}function handleEntityNotFound(_0x1f282b,_0x55a029){return function(_0x57aa8a){if(!_0x57aa8a){_0x1f282b[_0x7d11('0x29')](0x194);}return _0x57aa8a;};}function handleError(_0x21bac1,_0x5b7d3a){_0x5b7d3a=_0x5b7d3a||0x1f4;return function(_0x37beb0){logger['error'](_0x37beb0['stack']);if(_0x37beb0[_0x7d11('0x35')]){delete _0x37beb0['name'];}_0x21bac1['status'](_0x5b7d3a)[_0x7d11('0x36')](_0x37beb0);};}exports[_0x7d11('0x37')]=function(_0x1b96d8,_0x2e426b){var _0x2171b5={},_0x2ac5df={},_0x7c9516={'count':0x0,'rows':[]};var _0x3f8676=db[_0x7d11('0x38')][_0x7d11('0x39')];_0x2ac5df[_0x7d11('0x3a')]=_[_0x7d11('0x3b')](_0x3f8676);_0x2ac5df['query']=_[_0x7d11('0x3b')](_0x1b96d8['query']);_0x2ac5df[_0x7d11('0x3c')]=_[_0x7d11('0x3d')](_0x2ac5df[_0x7d11('0x3a')],_0x2ac5df[_0x7d11('0x3e')]);_0x2171b5['attributes']=_[_0x7d11('0x3d')](_0x2ac5df[_0x7d11('0x3a')],qs[_0x7d11('0x3f')](_0x1b96d8[_0x7d11('0x3e')]['fields']));_0x2171b5[_0x7d11('0x40')]=_0x2171b5['attributes'][_0x7d11('0x41')]?_0x2171b5['attributes']:_0x2ac5df[_0x7d11('0x3a')];if(!_0x1b96d8[_0x7d11('0x3e')][_0x7d11('0x42')](_0x7d11('0x43'))){_0x2171b5['limit']=qs['limit'](_0x1b96d8[_0x7d11('0x3e')][_0x7d11('0x44')]);_0x2171b5['offset']=qs[_0x7d11('0x2e')](_0x1b96d8[_0x7d11('0x3e')][_0x7d11('0x2e')]);}_0x2171b5[_0x7d11('0x45')]=qs[_0x7d11('0x46')](_0x1b96d8[_0x7d11('0x3e')]['sort']);_0x2171b5[_0x7d11('0x47')]=qs['filters'](_[_0x7d11('0x48')](_0x1b96d8[_0x7d11('0x3e')],_0x2ac5df[_0x7d11('0x3c')]));if(_0x1b96d8[_0x7d11('0x3e')][_0x7d11('0x49')]){_0x2171b5[_0x7d11('0x47')]=_['merge'](_0x2171b5['where'],{'$or':_['map'](_0x3f8676,function(_0x30469a){if(_0x30469a[_0x7d11('0x4a')][_0x7d11('0x4b')]!==_0x7d11('0x4c')){var _0x1343c9={};_0x1343c9[_0x30469a['field']]={'$like':'%'+_0x1b96d8[_0x7d11('0x3e')][_0x7d11('0x49')]+'%'};return _0x1343c9;}})});}_0x2171b5=_['merge']({},_0x2171b5,_0x1b96d8[_0x7d11('0x4d')]);var _0x1ec14b={'where':_0x2171b5[_0x7d11('0x47')]};return db['SmsMessage'][_0x7d11('0x2d')](_0x1ec14b)[_0x7d11('0x1e')](function(_0x258caa){_0x7c9516['count']=_0x258caa;if(_0x1b96d8[_0x7d11('0x3e')]['includeAll']){_0x2171b5[_0x7d11('0x4e')]=[{'all':!![]}];}return db[_0x7d11('0x38')][_0x7d11('0x4f')](_0x2171b5);})[_0x7d11('0x1e')](function(_0xee795){_0x7c9516[_0x7d11('0x50')]=_0xee795;return _0x7c9516;})[_0x7d11('0x1e')](respondWithFilteredResult(_0x2e426b,_0x2171b5))[_0x7d11('0x28')](handleError(_0x2e426b,null));};exports[_0x7d11('0x51')]=function(_0x4cc42d,_0x50d458){var _0x49a21c={'raw':!![],'where':{'id':_0x4cc42d[_0x7d11('0x52')]['id']}},_0x10c0e9={};_0x10c0e9[_0x7d11('0x3a')]=_[_0x7d11('0x3b')](db[_0x7d11('0x38')][_0x7d11('0x39')]);_0x10c0e9[_0x7d11('0x3e')]=_[_0x7d11('0x3b')](_0x4cc42d[_0x7d11('0x3e')]);_0x10c0e9[_0x7d11('0x3c')]=_[_0x7d11('0x3d')](_0x10c0e9[_0x7d11('0x3a')],_0x10c0e9['query']);_0x49a21c[_0x7d11('0x40')]=_[_0x7d11('0x3d')](_0x10c0e9[_0x7d11('0x3a')],qs['fields'](_0x4cc42d['query'][_0x7d11('0x3f')]));_0x49a21c[_0x7d11('0x40')]=_0x49a21c[_0x7d11('0x40')]['length']?_0x49a21c['attributes']:_0x10c0e9[_0x7d11('0x3a')];if(_0x4cc42d[_0x7d11('0x3e')]['includeAll']){_0x49a21c[_0x7d11('0x4e')]=[{'all':!![]}];}_0x49a21c=_[_0x7d11('0x53')]({},_0x49a21c,_0x4cc42d[_0x7d11('0x4d')]);return db[_0x7d11('0x38')]['find'](_0x49a21c)[_0x7d11('0x1e')](handleEntityNotFound(_0x50d458,null))[_0x7d11('0x1e')](respondWithResult(_0x50d458,null))[_0x7d11('0x28')](handleError(_0x50d458,null));};exports['create']=function(_0x4d0f77,_0x35dd29){return db[_0x7d11('0x38')][_0x7d11('0x54')](_0x4d0f77[_0x7d11('0x55')],{})[_0x7d11('0x1e')](respondWithResult(_0x35dd29,0xc9))['catch'](handleError(_0x35dd29,null));};exports[_0x7d11('0x56')]=function(_0x404e3e,_0x2f5d5a){if(_0x404e3e[_0x7d11('0x55')]['id']){delete _0x404e3e['body']['id'];}return db['SmsMessage'][_0x7d11('0x57')]({'where':{'id':_0x404e3e[_0x7d11('0x52')]['id']}})[_0x7d11('0x1e')](handleEntityNotFound(_0x2f5d5a,null))[_0x7d11('0x1e')](saveUpdates(_0x404e3e[_0x7d11('0x55')],null))[_0x7d11('0x1e')](respondWithResult(_0x2f5d5a,null))[_0x7d11('0x28')](handleError(_0x2f5d5a,null));};exports[_0x7d11('0x34')]=function(_0x3b3383,_0x37467f){return db['SmsMessage']['find']({'where':{'id':_0x3b3383['params']['id']}})[_0x7d11('0x1e')](handleEntityNotFound(_0x37467f,null))[_0x7d11('0x1e')](removeEntity(_0x37467f,null))[_0x7d11('0x28')](handleError(_0x37467f,null));};exports['describe']=function(_0x45918d,_0x222375){return db[_0x7d11('0x38')][_0x7d11('0x58')]()[_0x7d11('0x1e')](respondWithResult(_0x222375,null))[_0x7d11('0x28')](handleError(_0x222375,null));};var interaction_log=require('../../config/logger')(_0x7d11('0x59'));exports[_0x7d11('0x5a')]=function(_0x3c01d6,_0x4c072b,_0x5e5ac3){var _0x481a64={'channel':'sms'};if(_0x3c01d6[_0x7d11('0x55')]['id']){delete _0x3c01d6['body']['id'];}_0x3c01d6['body']['read']=!![];_0x3c01d6[_0x7d11('0x55')][_0x7d11('0x5b')]=moment()[_0x7d11('0x5c')](_0x7d11('0x5d'));_0x3c01d6[_0x7d11('0x55')][_0x7d11('0x5e')]=_0x3c01d6['body'][_0x7d11('0x5e')]||_0x3c01d6['user']['id'];return db[_0x7d11('0x38')]['find']({'where':{'id':_0x3c01d6[_0x7d11('0x52')]['id'],'UserId':null},'include':[{'model':db[_0x7d11('0x5f')],'as':'Contact'}]})[_0x7d11('0x1e')](handleEntityNotFound(_0x4c072b,null))[_0x7d11('0x1e')](saveUpdates(_0x3c01d6[_0x7d11('0x55')],null))[_0x7d11('0x1e')](function(_0x5581bb){if(_0x5581bb){_0x481a64['message']=_0x5581bb[_0x7d11('0x60')]({'plain':!![]});return db[_0x7d11('0x61')][_0x7d11('0x57')]({'where':{'id':_0x5581bb[_0x7d11('0x62')]}});}return null;})[_0x7d11('0x1e')](handleEntityNotFound(_0x4c072b,null))['then'](function(_0x2b9ba0){if(_0x2b9ba0){return _0x2b9ba0['update']({'UserId':_0x3c01d6[_0x7d11('0x55')][_0x7d11('0x5e')],'read1stAt':_[_0x7d11('0x63')](_0x2b9ba0[_0x7d11('0x64')])?moment()['format'](_0x7d11('0x5d')):undefined});}return null;})['then'](function(_0x2258dc){if(_0x2258dc){_0x481a64[_0x7d11('0x65')]=_0x2258dc[_0x7d11('0x60')]({'plain':!![]});interaction_log[_0x7d11('0x1f')](_0x7d11('0x66'),_0x3c01d6[_0x7d11('0x67')]['id'],_0x3c01d6[_0x7d11('0x67')][_0x7d11('0x35')],_0x3c01d6[_0x7d11('0x67')][_0x7d11('0x68')],_0x481a64[_0x7d11('0x65')]['id'],_0x3c01d6[_0x7d11('0x55')]?JSON[_0x7d11('0x22')](_0x3c01d6[_0x7d11('0x55')]):'null');return respondWithRpcPromise(_0x7d11('0x69'),'acceptMessage',_0x481a64);}return null;})[_0x7d11('0x1e')](function(_0x4c113b){if(_0x4c113b){if(_0x3c01d6[_0x7d11('0x55')][_0x7d11('0x6a')]){_0x481a64[_0x7d11('0x25')][_0x7d11('0x6b')]=util['format']('SIP/%s',_0x3c01d6[_0x7d11('0x67')][_0x7d11('0x35')]);_0x481a64[_0x7d11('0x25')]['channel']=_0x481a64[_0x7d11('0x6c')];_0x481a64[_0x7d11('0x25')][_0x7d11('0x6d')]=_0x7d11('0x5a');return respondWithRpcPromise(_0x7d11('0x6e'),_0x7d11('0x6e'),{'event':'acceptmessage','message':_0x481a64[_0x7d11('0x25')]},client9002)['then'](function(){return _0x481a64;});}return _0x481a64;}return null;})[_0x7d11('0x1e')](respondWithResult(_0x4c072b,null))['catch'](handleError(_0x4c072b,null));};var interaction_log=require('../../config/logger')(_0x7d11('0x59'));exports[_0x7d11('0x32')]=function(_0xeed31b,_0x14ee15,_0x119da7){var _0x2da548={'agent':{},'channel':_0x7d11('0x6f')};if(_0xeed31b[_0x7d11('0x55')]['id']){delete _0xeed31b[_0x7d11('0x55')]['id'];}_0xeed31b[_0x7d11('0x55')][_0x7d11('0x5e')]=_0xeed31b['body'][_0x7d11('0x5e')]||_0xeed31b['user']['id'];_0x2da548[_0x7d11('0x70')]['id']=_0xeed31b[_0x7d11('0x55')][_0x7d11('0x5e')];return db[_0x7d11('0x38')][_0x7d11('0x57')]({'where':{'id':_0xeed31b[_0x7d11('0x52')]['id'],'UserId':null}})[_0x7d11('0x1e')](handleEntityNotFound(_0x14ee15,null))['then'](function(_0x56ace7){if(_0x56ace7){_0x2da548[_0x7d11('0x25')]=_0x56ace7[_0x7d11('0x60')]({'plain':!![]});return db[_0x7d11('0x61')][_0x7d11('0x57')]({'where':{'id':_0x56ace7[_0x7d11('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x14ee15,null))[_0x7d11('0x1e')](function(_0x5bdd85){if(_0x5bdd85){_0x2da548[_0x7d11('0x65')]=_0x5bdd85[_0x7d11('0x60')]({'plain':!![]});interaction_log[_0x7d11('0x1f')](_0x7d11('0x71'),_0xeed31b[_0x7d11('0x67')]['id'],_0xeed31b[_0x7d11('0x67')][_0x7d11('0x35')],_0xeed31b[_0x7d11('0x67')]['role'],_0x2da548['interaction']['id'],_0xeed31b[_0x7d11('0x55')]?JSON[_0x7d11('0x22')](_0xeed31b[_0x7d11('0x55')]):'null');return respondWithRpcPromise('RejectMessage',_0x7d11('0x72'),_0x2da548);}return null;})['then'](function(_0x41c9b2){if(_0x41c9b2){_0x41c9b2[_0x7d11('0x25')][_0x7d11('0x6b')]=util[_0x7d11('0x5c')]('SIP/%s',_0xeed31b[_0x7d11('0x67')][_0x7d11('0x35')]);_0x41c9b2[_0x7d11('0x25')][_0x7d11('0x6c')]=_0x2da548[_0x7d11('0x6c')];_0x41c9b2[_0x7d11('0x25')][_0x7d11('0x6d')]=_0x7d11('0x32');respondWithRpcPromise('EventManager',_0x7d11('0x6e'),{'event':_0x7d11('0x73'),'message':_0x41c9b2[_0x7d11('0x25')]},client9002);return _0x2da548;}return null;})[_0x7d11('0x1e')](respondWithResult(_0x14ee15,null))[_0x7d11('0x28')](handleError(_0x14ee15,null));};exports['status']=function(_0x3d7029,_0x1fa4e6,_0xa4d2ad){if(_0x3d7029[_0x7d11('0x55')]['id']){delete _0x3d7029[_0x7d11('0x55')]['id'];}var _0x515427;return db['SmsMessage']['find']({'where':{'id':_0x3d7029[_0x7d11('0x52')]['id']}})['then'](handleEntityNotFound(_0x1fa4e6,null))[_0x7d11('0x1e')](function(_0x5459d1){if(_0x5459d1){_0x515427=_0x5459d1;return db['SmsAccount'][_0x7d11('0x57')]({'where':{'id':_0x5459d1[_0x7d11('0x74')]}});}})[_0x7d11('0x1e')](handleEntityNotFound(_0x1fa4e6,null))[_0x7d11('0x1e')](function(_0x345fb3){if(_0x345fb3){logger[_0x7d11('0x75')](_0x7d11('0x21'),_0x7d11('0x2b'),_0x7d11('0x76'),_0x345fb3[_0x7d11('0x4a')],util['inspect'](_0x3d7029[_0x7d11('0x55')],{'showHidden':![],'depth':null}));switch(_0x345fb3[_0x7d11('0x4a')]){case'twilio':if(_0x3d7029[_0x7d11('0x55')][_0x7d11('0x77')]&&_0x3d7029[_0x7d11('0x55')][_0x7d11('0x77')]===_0x515427['messageId']){return _0x515427['update']({'read':!![]});}else{logger[_0x7d11('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7d11('0x2b'),_0x7d11('0x78'),util[_0x7d11('0x79')](_0x3d7029[_0x7d11('0x55')],{'showHidden':![],'depth':null}));}break;case _0x7d11('0x7a'):if(_0x3d7029[_0x7d11('0x55')][_0x7d11('0x7b')]&&_0x3d7029['body'][_0x7d11('0x7b')]===_0x515427[_0x7d11('0x7c')]&&_[_0x7d11('0x7d')]([_0x7d11('0x7e'),'delivered'],_0x3d7029[_0x7d11('0x55')][_0x7d11('0x7f')])>=0x0){return _0x515427['update']({'read':!![]});}else{logger[_0x7d11('0x23')](_0x7d11('0x80'),_0x7d11('0x2b'),'plivio',util[_0x7d11('0x79')](_0x3d7029[_0x7d11('0x55')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xf089a4=_0x3d7029[_0x7d11('0x55')]['results'][0x0];if(_0xf089a4[_0x7d11('0x2b')]['groupName']==='DELIVERED'){return _0x515427['update']({'read':!![]});}else{logger['error'](_0x7d11('0x80'),_0x7d11('0x2b'),_0x7d11('0x81'),util[_0x7d11('0x79')](_0x3d7029[_0x7d11('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x515427;}})[_0x7d11('0x1e')](respondWithResult(_0x1fa4e6,null))[_0x7d11('0x28')](handleError(_0x1fa4e6,null));}; \ No newline at end of file +var _0x5496=['SmsMessage','rawAttributes','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','count','includeAll','include','rows','show','params','fields','find','create','body','destroy','describe','../../config/logger','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','interface','channel','event','accept','EventManager','acceptmessage','reject','agent','RejectMessage','rejectMessage','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','debug','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','stack','name','send','index'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x5496,0x175));var _0x6549=function(_0xf560c1,_0x104704){_0xf560c1=_0xf560c1-0x0;var _0x5501b4=_0x5496[_0xf560c1];return _0x5501b4;};'use strict';var pdf=require(_0x6549('0x0'));var emlformat=require(_0x6549('0x1'));var rimraf=require(_0x6549('0x2'));var zipdir=require(_0x6549('0x3'));var jsonpatch=require(_0x6549('0x4'));var rp=require('request-promise');var moment=require(_0x6549('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6549('0x6'));var util=require(_0x6549('0x7'));var path=require(_0x6549('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6549('0x9'));var fs=require('fs');var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var authService=require(_0x6549('0x10'));var hardwareService=require(_0x6549('0x11'));var Redis=require(_0x6549('0x12'));var qs=require(_0x6549('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6549('0x14'));var config=require(_0x6549('0x15'));var db=require(_0x6549('0x16'))['db'];config[_0x6549('0x17')]=_[_0x6549('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6549('0x19'))(new Redis(config[_0x6549('0x17')]));require('./smsMessage.socket')[_0x6549('0x1a')](socket);var jayson=require(_0x6549('0x1b'));var client=jayson[_0x6549('0x1c')][_0x6549('0x1d')]({'port':0x232c});var client9002=jayson[_0x6549('0x1c')][_0x6549('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x55c112,_0x5db86d,_0x384f75,_0x25da29){return new BPromise(function(_0x47a81a,_0x238a04){var _0x67acc0=_0x25da29||client;return _0x67acc0[_0x6549('0x1e')](_0x55c112,_0x384f75)[_0x6549('0x1f')](function(_0xffc8b9){logger['info']('SmsMessage,\x20%s,\x20%s',_0x5db86d,_0x6549('0x20'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5db86d,_0x6549('0x20'),JSON[_0x6549('0x21')](_0xffc8b9));if(_0xffc8b9[_0x6549('0x22')]){if(_0xffc8b9[_0x6549('0x22')][_0x6549('0x23')]===0x1f4){logger['error'](_0x6549('0x24'),_0x5db86d,_0xffc8b9['error'][_0x6549('0x25')]);return _0x238a04(_0xffc8b9[_0x6549('0x22')][_0x6549('0x25')]);}logger[_0x6549('0x22')](_0x6549('0x24'),_0x5db86d,_0xffc8b9[_0x6549('0x22')][_0x6549('0x25')]);return _0x47a81a(_0xffc8b9[_0x6549('0x22')][_0x6549('0x25')]);}else{logger[_0x6549('0x26')](_0x6549('0x24'),_0x5db86d,_0x6549('0x20'));_0x47a81a(_0xffc8b9[_0x6549('0x27')]['message']);}})[_0x6549('0x28')](function(_0x1bc8db){logger['error'](_0x6549('0x24'),_0x5db86d,_0x1bc8db);_0x238a04(_0x1bc8db);});});}function respondWithStatusCode(_0x29f89e,_0x3768cb){_0x3768cb=_0x3768cb||0xcc;return function(_0x583c7d){if(_0x583c7d){return _0x29f89e[_0x6549('0x29')](_0x3768cb);}return _0x29f89e[_0x6549('0x2a')](_0x3768cb)[_0x6549('0x2b')]();};}function respondWithResult(_0x2900cd,_0x442862){_0x442862=_0x442862||0xc8;return function(_0x3edf02){if(_0x3edf02){return _0x2900cd[_0x6549('0x2a')](_0x442862)[_0x6549('0x2c')](_0x3edf02);}};}function respondWithFilteredResult(_0x4c52f1,_0x1794bc){return function(_0x136518){if(_0x136518){var _0x17fdfb=_0x136518['count'],_0x4c605c=_0x1794bc['offset'],_0x3f1502=_0x1794bc[_0x6549('0x2d')]+_0x1794bc[_0x6549('0x2e')],_0x4acaf5;if(_0x3f1502>=_0x17fdfb){_0x3f1502=_0x17fdfb;_0x4acaf5=0xc8;}else{_0x4acaf5=0xce;}_0x4c52f1['status'](_0x4acaf5);return _0x4c52f1[_0x6549('0x2f')](_0x6549('0x30'),_0x4c605c+'-'+_0x3f1502+'/'+_0x17fdfb)[_0x6549('0x2c')](_0x136518);}return null;};}function patchUpdates(_0x102a21){return function(_0x2aec2c){try{jsonpatch[_0x6549('0x31')](_0x2aec2c,_0x102a21,!![]);}catch(_0x464adf){return BPromise['reject'](_0x464adf);}return _0x2aec2c[_0x6549('0x32')]();};}function saveUpdates(_0x3ebea6,_0x2d52fe){return function(_0x33bf79){if(_0x33bf79){return _0x33bf79[_0x6549('0x33')](_0x3ebea6)[_0x6549('0x1f')](function(_0x564c46){return _0x564c46;});}return null;};}function removeEntity(_0x6b9840,_0x5bb783){return function(_0x302694){if(_0x302694){return _0x302694['destroy']()[_0x6549('0x1f')](function(){_0x6b9840[_0x6549('0x2a')](0xcc)[_0x6549('0x2b')]();});}};}function handleEntityNotFound(_0x589f70,_0x3855ab){return function(_0x2b065d){if(!_0x2b065d){_0x589f70[_0x6549('0x29')](0x194);}return _0x2b065d;};}function handleError(_0x3040e3,_0x5b8624){_0x5b8624=_0x5b8624||0x1f4;return function(_0x54f971){logger['error'](_0x54f971[_0x6549('0x34')]);if(_0x54f971[_0x6549('0x35')]){delete _0x54f971['name'];}_0x3040e3[_0x6549('0x2a')](_0x5b8624)[_0x6549('0x36')](_0x54f971);};}exports[_0x6549('0x37')]=function(_0xcf6db5,_0x3741f5){var _0x4d3050={},_0x499898={},_0x1fcacf={'count':0x0,'rows':[]};var _0x663fec=db[_0x6549('0x38')][_0x6549('0x39')];_0x499898[_0x6549('0x3a')]=_[_0x6549('0x3b')](_0x663fec);_0x499898[_0x6549('0x3c')]=_[_0x6549('0x3b')](_0xcf6db5[_0x6549('0x3c')]);_0x499898[_0x6549('0x3d')]=_['intersection'](_0x499898[_0x6549('0x3a')],_0x499898[_0x6549('0x3c')]);_0x4d3050[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x499898[_0x6549('0x3a')],qs['fields'](_0xcf6db5['query']['fields']));_0x4d3050[_0x6549('0x3e')]=_0x4d3050[_0x6549('0x3e')][_0x6549('0x40')]?_0x4d3050[_0x6549('0x3e')]:_0x499898['model'];if(!_0xcf6db5['query'][_0x6549('0x41')](_0x6549('0x42'))){_0x4d3050[_0x6549('0x2e')]=qs['limit'](_0xcf6db5[_0x6549('0x3c')]['limit']);_0x4d3050[_0x6549('0x2d')]=qs[_0x6549('0x2d')](_0xcf6db5[_0x6549('0x3c')][_0x6549('0x2d')]);}_0x4d3050[_0x6549('0x43')]=qs[_0x6549('0x44')](_0xcf6db5[_0x6549('0x3c')]['sort']);_0x4d3050[_0x6549('0x45')]=qs[_0x6549('0x3d')](_[_0x6549('0x46')](_0xcf6db5[_0x6549('0x3c')],_0x499898[_0x6549('0x3d')]));if(_0xcf6db5[_0x6549('0x3c')][_0x6549('0x47')]){_0x4d3050[_0x6549('0x45')]=_[_0x6549('0x48')](_0x4d3050[_0x6549('0x45')],{'$or':_[_0x6549('0x49')](_0x663fec,function(_0x3d9351){if(_0x3d9351[_0x6549('0x4a')][_0x6549('0x4b')]!==_0x6549('0x4c')){var _0x1bc338={};_0x1bc338[_0x3d9351['field']]={'$like':'%'+_0xcf6db5[_0x6549('0x3c')][_0x6549('0x47')]+'%'};return _0x1bc338;}})});}_0x4d3050=_[_0x6549('0x48')]({},_0x4d3050,_0xcf6db5[_0x6549('0x4d')]);var _0x52e819={'where':_0x4d3050[_0x6549('0x45')]};return db['SmsMessage'][_0x6549('0x4e')](_0x52e819)[_0x6549('0x1f')](function(_0x4c7ada){_0x1fcacf[_0x6549('0x4e')]=_0x4c7ada;if(_0xcf6db5[_0x6549('0x3c')][_0x6549('0x4f')]){_0x4d3050[_0x6549('0x50')]=[{'all':!![]}];}return db[_0x6549('0x38')]['findAll'](_0x4d3050);})['then'](function(_0xa2acf5){_0x1fcacf[_0x6549('0x51')]=_0xa2acf5;return _0x1fcacf;})[_0x6549('0x1f')](respondWithFilteredResult(_0x3741f5,_0x4d3050))[_0x6549('0x28')](handleError(_0x3741f5,null));};exports[_0x6549('0x52')]=function(_0x49a4d7,_0x22370d){var _0x17e691={'raw':!![],'where':{'id':_0x49a4d7[_0x6549('0x53')]['id']}},_0x1e4f4f={};_0x1e4f4f[_0x6549('0x3a')]=_[_0x6549('0x3b')](db[_0x6549('0x38')][_0x6549('0x39')]);_0x1e4f4f['query']=_[_0x6549('0x3b')](_0x49a4d7['query']);_0x1e4f4f[_0x6549('0x3d')]=_[_0x6549('0x3f')](_0x1e4f4f[_0x6549('0x3a')],_0x1e4f4f['query']);_0x17e691[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x1e4f4f[_0x6549('0x3a')],qs['fields'](_0x49a4d7[_0x6549('0x3c')][_0x6549('0x54')]));_0x17e691[_0x6549('0x3e')]=_0x17e691[_0x6549('0x3e')][_0x6549('0x40')]?_0x17e691[_0x6549('0x3e')]:_0x1e4f4f['model'];if(_0x49a4d7[_0x6549('0x3c')]['includeAll']){_0x17e691[_0x6549('0x50')]=[{'all':!![]}];}_0x17e691=_[_0x6549('0x48')]({},_0x17e691,_0x49a4d7[_0x6549('0x4d')]);return db[_0x6549('0x38')][_0x6549('0x55')](_0x17e691)[_0x6549('0x1f')](handleEntityNotFound(_0x22370d,null))[_0x6549('0x1f')](respondWithResult(_0x22370d,null))[_0x6549('0x28')](handleError(_0x22370d,null));};exports[_0x6549('0x56')]=function(_0x105e0c,_0x3b7f1a){return db[_0x6549('0x38')]['create'](_0x105e0c[_0x6549('0x57')],{})[_0x6549('0x1f')](respondWithResult(_0x3b7f1a,0xc9))[_0x6549('0x28')](handleError(_0x3b7f1a,null));};exports[_0x6549('0x33')]=function(_0x260097,_0x1ffa23){if(_0x260097[_0x6549('0x57')]['id']){delete _0x260097[_0x6549('0x57')]['id'];}return db['SmsMessage'][_0x6549('0x55')]({'where':{'id':_0x260097[_0x6549('0x53')]['id']}})[_0x6549('0x1f')](handleEntityNotFound(_0x1ffa23,null))[_0x6549('0x1f')](saveUpdates(_0x260097[_0x6549('0x57')],null))[_0x6549('0x1f')](respondWithResult(_0x1ffa23,null))[_0x6549('0x28')](handleError(_0x1ffa23,null));};exports[_0x6549('0x58')]=function(_0x48eff0,_0x201554){return db[_0x6549('0x38')][_0x6549('0x55')]({'where':{'id':_0x48eff0[_0x6549('0x53')]['id']}})[_0x6549('0x1f')](handleEntityNotFound(_0x201554,null))[_0x6549('0x1f')](removeEntity(_0x201554,null))['catch'](handleError(_0x201554,null));};exports[_0x6549('0x59')]=function(_0xe0a696,_0x4bf996){return db[_0x6549('0x38')][_0x6549('0x59')]()[_0x6549('0x1f')](respondWithResult(_0x4bf996,null))['catch'](handleError(_0x4bf996,null));};var interaction_log=require(_0x6549('0x5a'))(_0x6549('0x5b'));exports['accept']=function(_0x407bb8,_0x509f69,_0x3dc12c){var _0x522cd3={'channel':_0x6549('0x5c')};if(_0x407bb8[_0x6549('0x57')]['id']){delete _0x407bb8[_0x6549('0x57')]['id'];}_0x407bb8[_0x6549('0x57')][_0x6549('0x5d')]=!![];_0x407bb8[_0x6549('0x57')][_0x6549('0x5e')]=moment()[_0x6549('0x5f')](_0x6549('0x60'));_0x407bb8[_0x6549('0x57')][_0x6549('0x61')]=_0x407bb8[_0x6549('0x57')][_0x6549('0x61')]||_0x407bb8[_0x6549('0x62')]['id'];return db['SmsMessage'][_0x6549('0x55')]({'where':{'id':_0x407bb8[_0x6549('0x53')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x6549('0x63')}]})[_0x6549('0x1f')](handleEntityNotFound(_0x509f69,null))[_0x6549('0x1f')](saveUpdates(_0x407bb8[_0x6549('0x57')],null))['then'](function(_0x6ff64d){if(_0x6ff64d){_0x522cd3[_0x6549('0x25')]=_0x6ff64d[_0x6549('0x64')]({'plain':!![]});return db[_0x6549('0x65')]['find']({'where':{'id':_0x6ff64d[_0x6549('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x509f69,null))[_0x6549('0x1f')](function(_0x16dc29){if(_0x16dc29){return _0x16dc29[_0x6549('0x33')]({'UserId':_0x407bb8[_0x6549('0x57')][_0x6549('0x61')],'read1stAt':_[_0x6549('0x67')](_0x16dc29[_0x6549('0x68')])?moment()[_0x6549('0x5f')](_0x6549('0x60')):undefined});}return null;})[_0x6549('0x1f')](function(_0x49427f){if(_0x49427f){_0x522cd3[_0x6549('0x69')]=_0x49427f[_0x6549('0x64')]({'plain':!![]});interaction_log[_0x6549('0x26')](_0x6549('0x6a'),_0x407bb8[_0x6549('0x62')]['id'],_0x407bb8[_0x6549('0x62')]['name'],_0x407bb8['user'][_0x6549('0x6b')],_0x522cd3[_0x6549('0x69')]['id'],_0x407bb8[_0x6549('0x57')]?JSON['stringify'](_0x407bb8[_0x6549('0x57')]):_0x6549('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x6549('0x6d'),_0x522cd3);}return null;})[_0x6549('0x1f')](function(_0x46026b){if(_0x46026b){if(_0x407bb8[_0x6549('0x57')][_0x6549('0x6e')]){_0x522cd3[_0x6549('0x25')][_0x6549('0x6f')]=util[_0x6549('0x5f')]('SIP/%s',_0x407bb8[_0x6549('0x62')]['name']);_0x522cd3[_0x6549('0x25')][_0x6549('0x70')]=_0x522cd3['channel'];_0x522cd3[_0x6549('0x25')][_0x6549('0x71')]=_0x6549('0x72');return respondWithRpcPromise('EventManager',_0x6549('0x73'),{'event':_0x6549('0x74'),'message':_0x522cd3[_0x6549('0x25')]},client9002)[_0x6549('0x1f')](function(){return _0x522cd3;});}return _0x522cd3;}return null;})[_0x6549('0x1f')](respondWithResult(_0x509f69,null))[_0x6549('0x28')](handleError(_0x509f69,null));};var interaction_log=require('../../config/logger')(_0x6549('0x5b'));exports[_0x6549('0x75')]=function(_0x1f022d,_0x5a996c,_0x5a860f){var _0x4bcd01={'agent':{},'channel':_0x6549('0x5c')};if(_0x1f022d[_0x6549('0x57')]['id']){delete _0x1f022d[_0x6549('0x57')]['id'];}_0x1f022d['body']['UserId']=_0x1f022d[_0x6549('0x57')]['UserId']||_0x1f022d[_0x6549('0x62')]['id'];_0x4bcd01[_0x6549('0x76')]['id']=_0x1f022d[_0x6549('0x57')][_0x6549('0x61')];return db[_0x6549('0x38')][_0x6549('0x55')]({'where':{'id':_0x1f022d[_0x6549('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5a996c,null))[_0x6549('0x1f')](function(_0x38b330){if(_0x38b330){_0x4bcd01[_0x6549('0x25')]=_0x38b330['get']({'plain':!![]});return db[_0x6549('0x65')][_0x6549('0x55')]({'where':{'id':_0x38b330[_0x6549('0x66')]}});}return null;})[_0x6549('0x1f')](handleEntityNotFound(_0x5a996c,null))[_0x6549('0x1f')](function(_0xf6b6da){if(_0xf6b6da){_0x4bcd01[_0x6549('0x69')]=_0xf6b6da['get']({'plain':!![]});interaction_log[_0x6549('0x26')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1f022d[_0x6549('0x62')]['id'],_0x1f022d[_0x6549('0x62')][_0x6549('0x35')],_0x1f022d[_0x6549('0x62')][_0x6549('0x6b')],_0x4bcd01[_0x6549('0x69')]['id'],_0x1f022d[_0x6549('0x57')]?JSON[_0x6549('0x21')](_0x1f022d['body']):_0x6549('0x6c'));return respondWithRpcPromise(_0x6549('0x77'),_0x6549('0x78'),_0x4bcd01);}return null;})[_0x6549('0x1f')](function(_0x1fa3a4){if(_0x1fa3a4){_0x1fa3a4[_0x6549('0x25')][_0x6549('0x6f')]=util[_0x6549('0x5f')](_0x6549('0x79'),_0x1f022d[_0x6549('0x62')]['name']);_0x1fa3a4[_0x6549('0x25')][_0x6549('0x70')]=_0x4bcd01[_0x6549('0x70')];_0x1fa3a4[_0x6549('0x25')][_0x6549('0x71')]=_0x6549('0x75');respondWithRpcPromise(_0x6549('0x73'),_0x6549('0x73'),{'event':_0x6549('0x7a'),'message':_0x1fa3a4[_0x6549('0x25')]},client9002);return _0x4bcd01;}return null;})[_0x6549('0x1f')](respondWithResult(_0x5a996c,null))[_0x6549('0x28')](handleError(_0x5a996c,null));};exports[_0x6549('0x2a')]=function(_0x44f005,_0x1495be,_0x14fb53){if(_0x44f005[_0x6549('0x57')]['id']){delete _0x44f005[_0x6549('0x57')]['id'];}var _0x4b1652;return db[_0x6549('0x38')][_0x6549('0x55')]({'where':{'id':_0x44f005[_0x6549('0x53')]['id']}})[_0x6549('0x1f')](handleEntityNotFound(_0x1495be,null))[_0x6549('0x1f')](function(_0xfde69e){if(_0xfde69e){_0x4b1652=_0xfde69e;return db[_0x6549('0x7b')][_0x6549('0x55')]({'where':{'id':_0xfde69e[_0x6549('0x7c')]}});}})[_0x6549('0x1f')](handleEntityNotFound(_0x1495be,null))[_0x6549('0x1f')](function(_0x1da2d7){if(_0x1da2d7){logger[_0x6549('0x7d')](_0x6549('0x7e'),_0x6549('0x2a'),_0x6549('0x7f'),_0x1da2d7[_0x6549('0x4a')],util['inspect'](_0x44f005[_0x6549('0x57')],{'showHidden':![],'depth':null}));switch(_0x1da2d7[_0x6549('0x4a')]){case _0x6549('0x80'):if(_0x44f005[_0x6549('0x57')][_0x6549('0x81')]&&_0x44f005[_0x6549('0x57')][_0x6549('0x81')]===_0x4b1652['messageId']){return _0x4b1652[_0x6549('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6549('0x2a'),'twilio',util[_0x6549('0x82')](_0x44f005[_0x6549('0x57')],{'showHidden':![],'depth':null}));}break;case _0x6549('0x83'):if(_0x44f005[_0x6549('0x57')][_0x6549('0x84')]&&_0x44f005['body'][_0x6549('0x84')]===_0x4b1652['messageId']&&_[_0x6549('0x85')]([_0x6549('0x86'),_0x6549('0x87')],_0x44f005['body'][_0x6549('0x88')])>=0x0){return _0x4b1652[_0x6549('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6549('0x2a'),_0x6549('0x89'),util[_0x6549('0x82')](_0x44f005[_0x6549('0x57')],{'showHidden':![],'depth':null}));}break;case _0x6549('0x8a'):var _0x1f5263=_0x44f005[_0x6549('0x57')][_0x6549('0x8b')][0x0];if(_0x1f5263[_0x6549('0x2a')][_0x6549('0x8c')]===_0x6549('0x8d')){return _0x4b1652[_0x6549('0x33')]({'read':!![]});}else{logger[_0x6549('0x22')](_0x6549('0x8e'),_0x6549('0x2a'),_0x6549('0x8a'),util[_0x6549('0x82')](_0x44f005[_0x6549('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x4b1652;}})[_0x6549('0x1f')](respondWithResult(_0x1495be,null))['catch'](handleError(_0x1495be,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 9a847be..631e061 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 _0x2203=['events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1e0d54,_0x46fbec){var _0x244204=function(_0x4d36bb){while(--_0x4d36bb){_0x1e0d54['push'](_0x1e0d54['shift']());}};_0x244204(++_0x46fbec);}(_0x2203,0x1b8));var _0x3220=function(_0x14d233,_0x4289f7){_0x14d233=_0x14d233-0x0;var _0x2d4c76=_0x2203[_0x14d233];return _0x2d4c76;};'use strict';var EventEmitter=require(_0x3220('0x0'));var SmsMessage=require(_0x3220('0x1'))['db'][_0x3220('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x3220('0x3')](0x0);var events={'afterCreate':_0x3220('0x4'),'afterUpdate':_0x3220('0x5'),'afterDestroy':_0x3220('0x6')};function emitEvent(_0x20bd53){return function(_0x4cf10b,_0x575210,_0x265940){SmsMessageEvents[_0x3220('0x7')](_0x20bd53+':'+_0x4cf10b['id'],_0x4cf10b);SmsMessageEvents['emit'](_0x20bd53,_0x4cf10b);_0x265940(null);};}for(var e in events){if(events[_0x3220('0x8')](e)){var event=events[e];SmsMessage[_0x3220('0x9')](e,emitEvent(event));}}module[_0x3220('0xa')]=SmsMessageEvents; \ No newline at end of file +var _0x95ca=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','update'];(function(_0x153cfd,_0x484f8d){var _0x563193=function(_0x1d75b9){while(--_0x1d75b9){_0x153cfd['push'](_0x153cfd['shift']());}};_0x563193(++_0x484f8d);}(_0x95ca,0x1ac));var _0xa95c=function(_0x5f47e0,_0x1481d2){_0x5f47e0=_0x5f47e0-0x0;var _0x4f031c=_0x95ca[_0x5f47e0];return _0x4f031c;};'use strict';var EventEmitter=require(_0xa95c('0x0'));var SmsMessage=require(_0xa95c('0x1'))['db'][_0xa95c('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa95c('0x3'),'afterDestroy':_0xa95c('0x4')};function emitEvent(_0x4e02d2){return function(_0x349017,_0x4e2f1c,_0x155335){SmsMessageEvents['emit'](_0x4e02d2+':'+_0x349017['id'],_0x349017);SmsMessageEvents['emit'](_0x4e02d2,_0x349017);_0x155335(null);};}for(var e in events){if(events[_0xa95c('0x5')](e)){var event=events[e];SmsMessage[_0xa95c('0x6')](e,emitEvent(event));}}module[_0xa95c('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 883810a..7c7cf4b 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 _0xf293=['body','login?username=','&password=','split','sms','session_key','total_sent','internal_order_id','smsMethod','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','deliveryReport','clickSend','plivo','authId','remote','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','length','createHash','digest','hex','signature=','https://sms.csc.lv/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','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','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','models','get','direction','toLowerCase','out','isNil','UserId','findOne','SmsInteractionId','then','update','createdAt','catch','error','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','username','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf293,0x13a));var _0x3f29=function(_0x1f01a9,_0x16531f){_0x1f01a9=_0x1f01a9-0x0;var _0x160063=_0xf293[_0x1f01a9];return _0x160063;};'use strict';var _=require('lodash');var util=require(_0x3f29('0x0'));var logger=require(_0x3f29('0x1'))(_0x3f29('0x2'));var moment=require(_0x3f29('0x3'));var BPromise=require(_0x3f29('0x4'));var rp=require(_0x3f29('0x5'));var attributes=require(_0x3f29('0x6'));module['exports']=function(_0x4103e9,_0x1024f1){return _0x4103e9[_0x3f29('0x7')](_0x3f29('0x8'),attributes,{'tableName':_0x3f29('0x9'),'paranoid':![],'indexes':[{'name':_0x3f29('0xa'),'fields':[_0x3f29('0xa')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ef0de,_0x4c390e,_0x4be558){var _0x4f59a5=_0x4103e9[_0x3f29('0xb')];var _0x52ba40=_0x2ef0de[_0x3f29('0xc')]({'plain':!![]});if(_0x52ba40[_0x3f29('0xd')][_0x3f29('0xe')]()==='in'||_0x52ba40[_0x3f29('0xd')][_0x3f29('0xe')]()===_0x3f29('0xf')&&!_0x52ba40['secret']&&!_[_0x3f29('0x10')](_0x52ba40[_0x3f29('0x11')])){_0x4f59a5['SmsInteraction'][_0x3f29('0x12')]({'where':{'id':_0x52ba40[_0x3f29('0x13')]}})[_0x3f29('0x14')](function(_0xdc685){if(_0xdc685){_0xdc685[_0x3f29('0x15')]({'lastMsgAt':_0x52ba40[_0x3f29('0x16')],'lastMsgDirection':_0x52ba40['direction'][_0x3f29('0xe')](),'lastMsgBody':_0x52ba40['body']});}})[_0x3f29('0x17')](function(_0x2fcffc){console[_0x3f29('0x18')](_0x2fcffc);});}if(_0x52ba40[_0x3f29('0xd')]===_0x3f29('0xf')&&!_0x52ba40['secret']){var _0x6c09e;_0x4f59a5['SmsAccount'][_0x3f29('0x19')]({'where':{'id':_0x52ba40[_0x3f29('0x1a')]},'raw':!![]})[_0x3f29('0x14')](function(_0x33f47b){_0x6c09e=_0x33f47b;if(_0x6c09e&&_0x6c09e['type']){switch(_0x6c09e[_0x3f29('0x1b')]){case _0x3f29('0x1c'):var _0xd90b37=require(_0x3f29('0x1c'));if(_0x6c09e[_0x3f29('0x1d')]&&_0x6c09e[_0x3f29('0x1e')]&&_0x6c09e[_0x3f29('0x1f')]){var _0x671ded=new _0xd90b37(_0x6c09e[_0x3f29('0x1d')],_0x6c09e[_0x3f29('0x1e')]);_0x671ded[_0x3f29('0x20')][_0x3f29('0x21')]({'body':_0x52ba40['body'],'to':_0x52ba40[_0x3f29('0x1f')],'from':_0x6c09e[_0x3f29('0x1f')],'statusCallback':_0x6c09e['remote']+_0x3f29('0x22')+_0x52ba40['id']+'/status?token='+_0x6c09e[_0x3f29('0x23')]})[_0x3f29('0x14')](function(_0x446737){if(_0x446737[_0x3f29('0x24')]){return _0x2ef0de[_0x3f29('0x15')]({'messageId':_0x446737[_0x3f29('0x24')]});}})[_0x3f29('0x17')](function(_0x34c286){logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x1c'),util[_0x3f29('0x27')](_0x34c286,{'showHidden':![],'depth':null}));});}else{logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),'twilio',_0x3f29('0x28'));}break;case'skebby':var _0x4adfd7='https://api.skebby.it/API/v1.0/REST/';if(_0x6c09e[_0x3f29('0x29')]&&_0x6c09e[_0x3f29('0x2a')]){var _0x2e3469={'recipient':[_0x52ba40[_0x3f29('0x1f')]],'message':_0x52ba40[_0x3f29('0x2b')],'message_type':_0x6c09e['smsMethod']};var _0x5e8d2d={'url':_0x4adfd7+_0x3f29('0x2c')+_0x6c09e[_0x3f29('0x29')]+_0x3f29('0x2d')+_0x6c09e[_0x3f29('0x2a')],'method':'GET'};rp(_0x5e8d2d)[_0x3f29('0x14')](function(_0x29cb9d){var _0x4d3ce6=_0x29cb9d[_0x3f29('0x2e')](';');var _0x557aa5={'user_key':_0x4d3ce6[0x0],'session_key':_0x4d3ce6[0x1]};_0x5e8d2d={'url':_0x4adfd7+_0x3f29('0x2f'),'method':'POST','headers':{'user_key':_0x557aa5['user_key'],'Session_key':_0x557aa5[_0x3f29('0x30')]},'json':!![],'body':_0x2e3469};return rp(_0x5e8d2d);})['then'](function(_0x4e5553){if(_0x4e5553[_0x3f29('0x31')]>=0x1){var _0x584c89={'messageId':_0x4e5553[_0x3f29('0x32')]};if(_0x6c09e[_0x3f29('0x33')]!=='GP'||!_0x6c09e['deliveryReport']){_0x584c89[_0x3f29('0x34')]=!![];}return _0x2ef0de[_0x3f29('0x15')](_0x584c89);}else{return logger[_0x3f29('0x18')](_0x3f29('0x25'),'afterCreate','skebby',util[_0x3f29('0x27')](_0x4e5553,{'showHidden':![],'depth':null}));}})['catch'](function(_0x87f132){return logger['error'](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x35'),util[_0x3f29('0x27')](_0x87f132,{'showHidden':![],'depth':null}));});}else{logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x35'),_0x3f29('0x36'));}break;case _0x3f29('0x37'):if(_0x6c09e[_0x3f29('0x1e')]){var _0x55753f={'recipient':_0x52ba40[_0x3f29('0x1f')],'message':_0x52ba40[_0x3f29('0x2b')],'sender':_0x6c09e[_0x3f29('0x38')]||_0x6c09e[_0x3f29('0x1f')],'authorization':_0x6c09e[_0x3f29('0x1e')]};var _0x4c390e={'method':_0x3f29('0x39'),'uri':_0x3f29('0x3a'),'body':_0x55753f,'json':!![]};rp(_0x4c390e)['then'](function(_0x4ac5b5){var _0x59b2b7={'messageId':_0x4ac5b5[_0x3f29('0x3b')]};if(!_0x6c09e['deliveryReport']){_0x59b2b7['read']=!![];}return _0x2ef0de[_0x3f29('0x15')](_0x59b2b7);})[_0x3f29('0x17')](function(_0x46f676){logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x37'),util['inspect'](_0x46f676,{'showHidden':![],'depth':null}));});}else{logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x37'),_0x3f29('0x3c'));}break;case _0x3f29('0x3d'):if(_0x6c09e[_0x3f29('0x29')]&&_0x6c09e[_0x3f29('0x2a')]){var _0x55753f={'messages':[{'source':_0x3f29('0x3e'),'to':_0x52ba40['phone'],'body':_0x52ba40[_0x3f29('0x2b')],'from':_0x6c09e['senderString']||_0x6c09e['phone']}]};var _0x4d708c=util[_0x3f29('0x3f')](_0x3f29('0x40'),_0x6c09e[_0x3f29('0x29')],_0x6c09e['password']);var _0x4c390e={'method':_0x3f29('0x39'),'uri':_0x3f29('0x41'),'body':_0x55753f,'headers':{'Authorization':util['format'](_0x3f29('0x42'),new Buffer(_0x4d708c)[_0x3f29('0x43')](_0x3f29('0x44')))},'json':!![]};rp(_0x4c390e)[_0x3f29('0x14')](function(_0x541a8e){if(_0x541a8e['http_code']>=0xc8&&_0x541a8e[_0x3f29('0x45')]<=0xce){if(_0x541a8e[_0x3f29('0x46')]&&_0x541a8e[_0x3f29('0x46')][_0x3f29('0x47')]>0x0){var _0x3e31ad=_['head'](_0x541a8e[_0x3f29('0x46')]['messages']);var _0x505d5c={'messageId':_0x3e31ad[_0x3f29('0x48')]};if(!_0x6c09e[_0x3f29('0x49')]){_0x505d5c[_0x3f29('0x34')]=!![];}return _0x2ef0de['update'](_0x505d5c);}else{logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x4a'),util[_0x3f29('0x27')](_0x541a8e,{'showHidden':![],'depth':null}));}}else{logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x4a'),util[_0x3f29('0x27')](_0x541a8e,{'showHidden':![],'depth':null}));}})[_0x3f29('0x17')](function(_0x424413){logger[_0x3f29('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3f29('0x26'),_0x3f29('0x4a'),util[_0x3f29('0x27')](_0x424413,{'showHidden':![],'depth':null}));});}else{logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x4a'),_0x3f29('0x36'));}break;case _0x3f29('0x4b'):if(_0x6c09e[_0x3f29('0x4c')]&&_0x6c09e[_0x3f29('0x1e')]){var _0x55753f={'dst':_0x52ba40[_0x3f29('0x1f')],'text':_0x52ba40[_0x3f29('0x2b')],'src':_0x6c09e['senderString']||_0x6c09e[_0x3f29('0x1f')],'url':_0x6c09e[_0x3f29('0x4d')]+_0x3f29('0x22')+_0x52ba40['id']+_0x3f29('0x4e')+_0x6c09e[_0x3f29('0x23')]};var _0x4d708c=util['format'](_0x3f29('0x40'),_0x6c09e['authId'],_0x6c09e['authToken']);var _0x4c390e={'method':_0x3f29('0x39'),'uri':util[_0x3f29('0x3f')](_0x3f29('0x4f'),_0x6c09e[_0x3f29('0x4c')]),'body':_0x55753f,'headers':{'Authorization':util[_0x3f29('0x3f')](_0x3f29('0x42'),new Buffer(_0x4d708c)['toString']('base64'))},'json':!![]};rp(_0x4c390e)[_0x3f29('0x14')](function(_0x1d424c){var _0x478cca={'messageId':_0x1d424c[_0x3f29('0x50')][0x0]};return _0x2ef0de[_0x3f29('0x15')](_0x478cca);})[_0x3f29('0x17')](function(_0x4ea094){logger['error'](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x4b'),util[_0x3f29('0x27')](_0x4ea094,{'showHidden':![],'depth':null}));});}else{logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),'plivo',_0x3f29('0x51'));}break;case _0x3f29('0x52'):if(_0x6c09e[_0x3f29('0x29')]&&_0x6c09e[_0x3f29('0x2a')]){if(_0x6c09e[_0x3f29('0x53')]){var _0x42aab7={'method':_0x3f29('0x39'),'uri':_0x6c09e['baseUrl']+_0x3f29('0x54'),'body':{'username':_0x6c09e[_0x3f29('0x29')],'password':_0x6c09e[_0x3f29('0x2a')]},'json':!![]};return rp(_0x42aab7)['then'](function(_0x4fa755){var _0x13d80c={'method':_0x3f29('0x39'),'uri':_0x6c09e[_0x3f29('0x53')]+_0x3f29('0x55'),'body':{'messages':[{'from':_0x6c09e[_0x3f29('0x1f')],'destinations':[{'to':_0x52ba40[_0x3f29('0x1f')]}],'text':_0x52ba40[_0x3f29('0x2b')],'notifyUrl':_0x6c09e[_0x3f29('0x4d')]+_0x3f29('0x22')+_0x52ba40['id']+'/status?token='+_0x6c09e[_0x3f29('0x23')],'notifyContentType':_0x3f29('0x56'),'callbackData':_0x6c09e['phone']+';'+_0x52ba40['body']}]},'headers':{'Authorization':_0x3f29('0x57')+_0x4fa755['token']},'json':!![]};return rp(_0x13d80c)['then'](function(_0x21e37b){if(_0x21e37b[_0x3f29('0x20')]){var _0x22c03b={'messageId':_0x21e37b[_0x3f29('0x20')][0x0][_0x3f29('0xa')]};if(!_0x6c09e[_0x3f29('0x49')]){_0x22c03b[_0x3f29('0x34')]=!![];}return _0x2ef0de[_0x3f29('0x15')](_0x22c03b);}else{return logger['error'](_0x3f29('0x25'),'afterCreate',_0x3f29('0x52'),util['inspect'](_0x21e37b,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x1e2dd2){return logger[_0x3f29('0x18')](_0x3f29('0x25'),'afterCreate',_0x3f29('0x52'),util[_0x3f29('0x27')](_0x1e2dd2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x52'),_0x3f29('0x58'));}}else{logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x52'),_0x3f29('0x36'));}case _0x3f29('0x59'):var _0x5e16ad=require(_0x3f29('0x5a'));if(_0x6c09e[_0x3f29('0x5b')]){var _0x458d2a={};_0x458d2a[_0x3f29('0x5c')]=_0x6c09e[_0x3f29('0x29')];_0x458d2a['phone']=_0x52ba40['phone'];_0x458d2a['sender']=_0x6c09e[_0x3f29('0x1f')];_0x458d2a[_0x3f29('0x5d')]=_0x52ba40[_0x3f29('0x2b')];_0x458d2a[_0x3f29('0x5e')]=+new Date();var _0x51a56a='';var _0x147a35='';var _0x30a903=Object['keys'](_0x458d2a);_0x30a903['sort']();for(var _0x4dd95e=0x0;_0x4dd95e<_0x30a903[_0x3f29('0x5f')];_0x4dd95e++){if(_0x51a56a!=''){_0x51a56a+='&';}_0x51a56a+=_0x30a903[_0x4dd95e]+'='+encodeURIComponent(_0x458d2a[_0x30a903[_0x4dd95e]]);_0x147a35+=_0x458d2a[_0x30a903[_0x4dd95e]];}_0x147a35+=_0x6c09e[_0x3f29('0x5b')];_0x147a35=_0x5e16ad[_0x3f29('0x60')]('md5')[_0x3f29('0x15')](_0x147a35)[_0x3f29('0x61')](_0x3f29('0x62'));if(_0x51a56a!==''){_0x51a56a+='&';}_0x51a56a+=_0x3f29('0x63')+_0x147a35;var _0x5e8d2d={'method':'GET','uri':_0x3f29('0x64')+_0x51a56a,'json':!![]};return rp(_0x5e8d2d)[_0x3f29('0x14')](function(_0x333f08){var _0x5ae72b=Object[_0x3f29('0x65')](_0x333f08);if(_0x333f08[_0x5ae72b[0x0]][_0x3f29('0x18')]&&parseInt(_0x333f08[_0x5ae72b[0x0]]['error'])===0x0){var _0x161e2d={'messageId':_0x333f08[_0x5ae72b[0x0]][_0x3f29('0x66')]};if(!_0x6c09e['deliveryReport']){_0x161e2d[_0x3f29('0x34')]=!![];}return _0x2ef0de[_0x3f29('0x15')](_0x161e2d);}else{return logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x59'),util[_0x3f29('0x27')](_0x333f08[_0x3f29('0x18')],{'showHidden':![],'depth':null}));}})[_0x3f29('0x17')](function(_0x4e9ace){return logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x59'),util[_0x3f29('0x27')](_0x4e9ace,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3f29('0x26'),_0x3f29('0x59'),_0x3f29('0x67'));}case _0x3f29('0x68'):if(_0x6c09e[_0x3f29('0x5b')]){var _0x4c6398={'method':_0x3f29('0x39'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x6c09e[_0x3f29('0x5b')]},'body':{'content':_0x52ba40['body'],'to':[_0x52ba40[_0x3f29('0x1f')]],'from':_0x6c09e[_0x3f29('0x1f')],'binary':![],'clientMessageId':'uuid','charset':_0x3f29('0x69')},'json':!![]};rp(_0x4c6398)['then'](function(_0x21f2a9){if(!_0x21f2a9[_0x3f29('0x18')]){var _0x20225d={'messageId':_0x21f2a9[_0x3f29('0x20')][0x0][_0x3f29('0x6a')]};if(!_0x6c09e[_0x3f29('0x49')]){_0x20225d[_0x3f29('0x34')]=!![];}return _0x2ef0de['update'](_0x20225d);}else{return logger[_0x3f29('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3f29('0x26'),'clickatell',util[_0x3f29('0x27')](_0x21f2a9[_0x3f29('0x18')],{'showHidden':![],'depth':null}));}})[_0x3f29('0x17')](function(_0x1c4e3e){return logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x68'),util['inspect'](_0x1c4e3e,{'showHidden':![],'depth':null}));});}else{logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x68'),_0x3f29('0x67'));}break;case _0x3f29('0x6b'):if(_0x6c09e[_0x3f29('0x5b')]){var _0x37abaf={};var _0x5e8d2d={'method':_0x3f29('0x39'),'uri':_0x3f29('0x6c'),'headers':{'Authorization':_0x3f29('0x6d')+_0x6c09e[_0x3f29('0x5b')],'Content-Type':'application/json'},'body':{'from':_0x6c09e[_0x3f29('0x1f')],'to':_0x52ba40[_0x3f29('0x1f')],'text':_0x52ba40[_0x3f29('0x2b')]},'json':!![]};return rp(_0x5e8d2d)[_0x3f29('0x14')](function(_0x31ded1){if(_0x31ded1[_0x3f29('0x6e')]==0xca){_0x37abaf[_0x3f29('0x6f')]=_0x31ded1;var _0x2a1274={'method':_0x3f29('0x39'),'uri':_0x3f29('0x70'),'headers':{'Authorization':_0x3f29('0x6d')+_0x6c09e[_0x3f29('0x5b')],'Content-Type':_0x3f29('0x56')},'body':{'refid':_0x37abaf[_0x3f29('0x6f')][_0x3f29('0x71')]},'json':!![]};return rp(_0x2a1274)[_0x3f29('0x14')](function(_0x4beb74){_0x37abaf[_0x3f29('0x72')]=_0x4beb74;var _0x4597b3={'messageId':_0x37abaf[_0x3f29('0x6f')][_0x3f29('0x71')],'read':!![]};return _0x2ef0de['update'](_0x4597b3);});}else{return logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x6b'),util['inspect'](_0x31ded1,{'showHidden':![],'depth':null}));}})[_0x3f29('0x17')](function(_0xd54483){return logger['error'](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x6b'),util[_0x3f29('0x27')](_0xd54483,{'showHidden':![],'depth':null}));});}else{return logger[_0x3f29('0x18')](_0x3f29('0x25'),_0x3f29('0x26'),_0x3f29('0x6b'),_0x3f29('0x73'));}break;}}})[_0x3f29('0x74')](function(){_0x4be558();});}else{_0x4be558();}}},'charset':_0x3f29('0x75'),'collate':_0x3f29('0x76')});}; \ No newline at end of file +var _0x5962=['Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','get','direction','toLowerCase','out','SmsInteraction','SmsInteractionId','update','createdAt','body','catch','secret','find','SmsAccountId','then','type','twilio','accountSid','phone','authToken','create','remote','/api/sms/messages/','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sms','POST','session_key','deliveryReport','read','senderString','requestid','connectel','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20username,\x20password','csc','crypto','apiKey','login','sender','timestamp','sort','length','createHash','hex','GET','https://sms.csc.lv/external/get/send.php?','keys'];(function(_0x16f539,_0x2276fe){var _0x39bbc5=function(_0x4ed4c0){while(--_0x4ed4c0){_0x16f539['push'](_0x16f539['shift']());}};_0x39bbc5(++_0x2276fe);}(_0x5962,0xec));var _0x2596=function(_0x210d7f,_0x2abe4f){_0x210d7f=_0x210d7f-0x0;var _0x42d687=_0x5962[_0x210d7f];return _0x42d687;};'use strict';var _=require(_0x2596('0x0'));var util=require('util');var logger=require(_0x2596('0x1'))(_0x2596('0x2'));var moment=require(_0x2596('0x3'));var BPromise=require(_0x2596('0x4'));var rp=require(_0x2596('0x5'));var attributes=require(_0x2596('0x6'));module[_0x2596('0x7')]=function(_0x432f55,_0x28051e){return _0x432f55[_0x2596('0x8')](_0x2596('0x9'),attributes,{'tableName':_0x2596('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x2596('0xb')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5418d1,_0x3b6be2,_0x3c656c){var _0x1c6d16=_0x432f55['models'];var _0x49eca3=_0x5418d1[_0x2596('0xc')]({'plain':!![]});if(_0x49eca3[_0x2596('0xd')][_0x2596('0xe')]()==='in'||_0x49eca3['direction']['toLowerCase']()===_0x2596('0xf')&&!_0x49eca3['secret']&&!_['isNil'](_0x49eca3['UserId'])){_0x1c6d16[_0x2596('0x10')]['findOne']({'where':{'id':_0x49eca3[_0x2596('0x11')]}})['then'](function(_0x578071){if(_0x578071){_0x578071[_0x2596('0x12')]({'lastMsgAt':_0x49eca3[_0x2596('0x13')],'lastMsgDirection':_0x49eca3[_0x2596('0xd')]['toLowerCase'](),'lastMsgBody':_0x49eca3[_0x2596('0x14')]});}})[_0x2596('0x15')](function(_0x18899f){console['error'](_0x18899f);});}if(_0x49eca3['direction']==='out'&&!_0x49eca3[_0x2596('0x16')]){var _0x43ffa2;_0x1c6d16['SmsAccount'][_0x2596('0x17')]({'where':{'id':_0x49eca3[_0x2596('0x18')]},'raw':!![]})[_0x2596('0x19')](function(_0x3ff8eb){_0x43ffa2=_0x3ff8eb;if(_0x43ffa2&&_0x43ffa2['type']){switch(_0x43ffa2[_0x2596('0x1a')]){case'twilio':var _0x275e39=require(_0x2596('0x1b'));if(_0x43ffa2[_0x2596('0x1c')]&&_0x43ffa2['authToken']&&_0x43ffa2[_0x2596('0x1d')]){var _0x5a2600=new _0x275e39(_0x43ffa2[_0x2596('0x1c')],_0x43ffa2[_0x2596('0x1e')]);_0x5a2600['messages'][_0x2596('0x1f')]({'body':_0x49eca3[_0x2596('0x14')],'to':_0x49eca3[_0x2596('0x1d')],'from':_0x43ffa2[_0x2596('0x1d')],'statusCallback':_0x43ffa2[_0x2596('0x20')]+_0x2596('0x21')+_0x49eca3['id']+_0x2596('0x22')+_0x43ffa2[_0x2596('0x23')]})[_0x2596('0x19')](function(_0x67c6a0){if(_0x67c6a0[_0x2596('0x24')]){return _0x5418d1[_0x2596('0x12')]({'messageId':_0x67c6a0[_0x2596('0x24')]});}})[_0x2596('0x15')](function(_0x5e8038){logger[_0x2596('0x25')](_0x2596('0x26'),_0x2596('0x27'),'twilio',util[_0x2596('0x28')](_0x5e8038,{'showHidden':![],'depth':null}));});}else{logger[_0x2596('0x25')](_0x2596('0x26'),_0x2596('0x27'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x2596('0x29'):var _0x57b48c=_0x2596('0x2a');if(_0x43ffa2[_0x2596('0x2b')]&&_0x43ffa2[_0x2596('0x2c')]){var _0x3340a6={'recipient':[_0x49eca3['phone']],'message':_0x49eca3[_0x2596('0x14')],'message_type':_0x43ffa2[_0x2596('0x2d')]};var _0xa28e9e={'url':_0x57b48c+'login?username='+_0x43ffa2['username']+'&password='+_0x43ffa2[_0x2596('0x2c')],'method':'GET'};rp(_0xa28e9e)[_0x2596('0x19')](function(_0x4251c6){var _0x290375=_0x4251c6['split'](';');var _0x20da15={'user_key':_0x290375[0x0],'session_key':_0x290375[0x1]};_0xa28e9e={'url':_0x57b48c+_0x2596('0x2e'),'method':_0x2596('0x2f'),'headers':{'user_key':_0x20da15['user_key'],'Session_key':_0x20da15[_0x2596('0x30')]},'json':!![],'body':_0x3340a6};return rp(_0xa28e9e);})[_0x2596('0x19')](function(_0x19e668){if(_0x19e668['total_sent']>=0x1){var _0x5a861a={'messageId':_0x19e668['internal_order_id']};if(_0x43ffa2['smsMethod']!=='GP'||!_0x43ffa2[_0x2596('0x31')]){_0x5a861a[_0x2596('0x32')]=!![];}return _0x5418d1[_0x2596('0x12')](_0x5a861a);}else{return logger[_0x2596('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby',util[_0x2596('0x28')](_0x19e668,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5b9aef){return logger[_0x2596('0x25')](_0x2596('0x26'),_0x2596('0x27'),_0x2596('0x29'),util[_0x2596('0x28')](_0x5b9aef,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2596('0x26'),_0x2596('0x27'),_0x2596('0x29'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x43ffa2[_0x2596('0x1e')]){var _0x517482={'recipient':_0x49eca3[_0x2596('0x1d')],'message':_0x49eca3[_0x2596('0x14')],'sender':_0x43ffa2[_0x2596('0x33')]||_0x43ffa2[_0x2596('0x1d')],'authorization':_0x43ffa2[_0x2596('0x1e')]};var _0x3b6be2={'method':_0x2596('0x2f'),'uri':'https://smsapi.connectel.se/api/send/','body':_0x517482,'json':!![]};rp(_0x3b6be2)['then'](function(_0x1d7bf2){var _0x4bb12c={'messageId':_0x1d7bf2[_0x2596('0x34')]};if(!_0x43ffa2['deliveryReport']){_0x4bb12c[_0x2596('0x32')]=!![];}return _0x5418d1[_0x2596('0x12')](_0x4bb12c);})[_0x2596('0x15')](function(_0x4e0583){logger[_0x2596('0x25')](_0x2596('0x26'),_0x2596('0x27'),_0x2596('0x35'),util[_0x2596('0x28')](_0x4e0583,{'showHidden':![],'depth':null}));});}else{logger[_0x2596('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2596('0x35'),'Missing\x20parameters:\x20authToken');}break;case _0x2596('0x36'):if(_0x43ffa2[_0x2596('0x2b')]&&_0x43ffa2[_0x2596('0x2c')]){var _0x517482={'messages':[{'source':_0x2596('0x37'),'to':_0x49eca3[_0x2596('0x1d')],'body':_0x49eca3[_0x2596('0x14')],'from':_0x43ffa2['senderString']||_0x43ffa2[_0x2596('0x1d')]}]};var _0x5da81b=util[_0x2596('0x38')](_0x2596('0x39'),_0x43ffa2['username'],_0x43ffa2[_0x2596('0x2c')]);var _0x3b6be2={'method':_0x2596('0x2f'),'uri':_0x2596('0x3a'),'body':_0x517482,'headers':{'Authorization':util[_0x2596('0x38')](_0x2596('0x3b'),new Buffer(_0x5da81b)[_0x2596('0x3c')](_0x2596('0x3d')))},'json':!![]};rp(_0x3b6be2)[_0x2596('0x19')](function(_0x27dd8c){if(_0x27dd8c[_0x2596('0x3e')]>=0xc8&&_0x27dd8c['http_code']<=0xce){if(_0x27dd8c[_0x2596('0x3f')]&&_0x27dd8c[_0x2596('0x3f')][_0x2596('0x40')]>0x0){var _0x31318=_[_0x2596('0x41')](_0x27dd8c[_0x2596('0x3f')][_0x2596('0x42')]);var _0x119a01={'messageId':_0x31318[_0x2596('0x43')]};if(!_0x43ffa2[_0x2596('0x31')]){_0x119a01['read']=!![];}return _0x5418d1[_0x2596('0x12')](_0x119a01);}else{logger[_0x2596('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2596('0x27'),_0x2596('0x44'),util[_0x2596('0x28')](_0x27dd8c,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x2596('0x26'),'afterCreate','clickSend',util[_0x2596('0x28')](_0x27dd8c,{'showHidden':![],'depth':null}));}})[_0x2596('0x15')](function(_0x26ae51){logger[_0x2596('0x25')](_0x2596('0x26'),'afterCreate','clickSend',util[_0x2596('0x28')](_0x26ae51,{'showHidden':![],'depth':null}));});}else{logger[_0x2596('0x25')](_0x2596('0x26'),_0x2596('0x27'),_0x2596('0x44'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x43ffa2[_0x2596('0x45')]&&_0x43ffa2['authToken']){var _0x517482={'dst':_0x49eca3[_0x2596('0x1d')],'text':_0x49eca3[_0x2596('0x14')],'src':_0x43ffa2[_0x2596('0x33')]||_0x43ffa2[_0x2596('0x1d')],'url':_0x43ffa2[_0x2596('0x20')]+_0x2596('0x21')+_0x49eca3['id']+_0x2596('0x22')+_0x43ffa2[_0x2596('0x23')]};var _0x5da81b=util[_0x2596('0x38')](_0x2596('0x39'),_0x43ffa2[_0x2596('0x45')],_0x43ffa2[_0x2596('0x1e')]);var _0x3b6be2={'method':_0x2596('0x2f'),'uri':util[_0x2596('0x38')](_0x2596('0x46'),_0x43ffa2['authId']),'body':_0x517482,'headers':{'Authorization':util[_0x2596('0x38')]('Basic\x20%s',new Buffer(_0x5da81b)['toString'](_0x2596('0x3d')))},'json':!![]};rp(_0x3b6be2)[_0x2596('0x19')](function(_0x3c54b7){var _0x1eeab2={'messageId':_0x3c54b7[_0x2596('0x47')][0x0]};return _0x5418d1[_0x2596('0x12')](_0x1eeab2);})[_0x2596('0x15')](function(_0x1bde81){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',util[_0x2596('0x28')](_0x1bde81,{'showHidden':![],'depth':null}));});}else{logger[_0x2596('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2596('0x27'),_0x2596('0x48'),_0x2596('0x49'));}break;case _0x2596('0x4a'):if(_0x43ffa2['username']&&_0x43ffa2[_0x2596('0x2c')]){if(_0x43ffa2[_0x2596('0x4b')]){var _0x22017f={'method':'POST','uri':_0x43ffa2['baseUrl']+_0x2596('0x4c'),'body':{'username':_0x43ffa2[_0x2596('0x2b')],'password':_0x43ffa2['password']},'json':!![]};return rp(_0x22017f)[_0x2596('0x19')](function(_0x1edeff){var _0x35b2bc={'method':_0x2596('0x2f'),'uri':_0x43ffa2[_0x2596('0x4b')]+_0x2596('0x4d'),'body':{'messages':[{'from':_0x43ffa2[_0x2596('0x1d')],'destinations':[{'to':_0x49eca3[_0x2596('0x1d')]}],'text':_0x49eca3[_0x2596('0x14')],'notifyUrl':_0x43ffa2[_0x2596('0x20')]+_0x2596('0x21')+_0x49eca3['id']+_0x2596('0x22')+_0x43ffa2[_0x2596('0x23')],'notifyContentType':_0x2596('0x4e'),'callbackData':_0x43ffa2['phone']+';'+_0x49eca3[_0x2596('0x14')]}]},'headers':{'Authorization':_0x2596('0x4f')+_0x1edeff[_0x2596('0x23')]},'json':!![]};return rp(_0x35b2bc)[_0x2596('0x19')](function(_0x117eee){if(_0x117eee[_0x2596('0x42')]){var _0xeeff71={'messageId':_0x117eee[_0x2596('0x42')][0x0][_0x2596('0xb')]};if(!_0x43ffa2[_0x2596('0x31')]){_0xeeff71[_0x2596('0x32')]=!![];}return _0x5418d1['update'](_0xeeff71);}else{return logger[_0x2596('0x25')](_0x2596('0x26'),_0x2596('0x27'),_0x2596('0x4a'),util[_0x2596('0x28')](_0x117eee,{'showHidden':![],'depth':null}));}});})[_0x2596('0x15')](function(_0x90eaea){return logger[_0x2596('0x25')](_0x2596('0x26'),_0x2596('0x27'),_0x2596('0x4a'),util[_0x2596('0x28')](_0x90eaea,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2596('0x26'),_0x2596('0x27'),_0x2596('0x4a'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0x2596('0x26'),_0x2596('0x27'),_0x2596('0x4a'),_0x2596('0x50'));}case _0x2596('0x51'):var _0xc2a98a=require(_0x2596('0x52'));if(_0x43ffa2[_0x2596('0x53')]){var _0xa71505={};_0xa71505[_0x2596('0x54')]=_0x43ffa2[_0x2596('0x2b')];_0xa71505[_0x2596('0x1d')]=_0x49eca3[_0x2596('0x1d')];_0xa71505[_0x2596('0x55')]=_0x43ffa2[_0x2596('0x1d')];_0xa71505['text']=_0x49eca3[_0x2596('0x14')];_0xa71505[_0x2596('0x56')]=+new Date();var _0x253465='';var _0x704b93='';var _0x317256=Object['keys'](_0xa71505);_0x317256[_0x2596('0x57')]();for(var _0x2fccb2=0x0;_0x2fccb2<_0x317256[_0x2596('0x58')];_0x2fccb2++){if(_0x253465!=''){_0x253465+='&';}_0x253465+=_0x317256[_0x2fccb2]+'='+encodeURIComponent(_0xa71505[_0x317256[_0x2fccb2]]);_0x704b93+=_0xa71505[_0x317256[_0x2fccb2]];}_0x704b93+=_0x43ffa2['apiKey'];_0x704b93=_0xc2a98a[_0x2596('0x59')]('md5')['update'](_0x704b93)['digest'](_0x2596('0x5a'));if(_0x253465!==''){_0x253465+='&';}_0x253465+='signature='+_0x704b93;var _0xa28e9e={'method':_0x2596('0x5b'),'uri':_0x2596('0x5c')+_0x253465,'json':!![]};return rp(_0xa28e9e)[_0x2596('0x19')](function(_0x585335){var _0x55e50d=Object[_0x2596('0x5d')](_0x585335);if(_0x585335[_0x55e50d[0x0]][_0x2596('0x25')]&&parseInt(_0x585335[_0x55e50d[0x0]][_0x2596('0x25')])===0x0){var _0x4132d3={'messageId':_0x585335[_0x55e50d[0x0]]['id_sms']};if(!_0x43ffa2[_0x2596('0x31')]){_0x4132d3[_0x2596('0x32')]=!![];}return _0x5418d1[_0x2596('0x12')](_0x4132d3);}else{return logger[_0x2596('0x25')](_0x2596('0x26'),_0x2596('0x27'),_0x2596('0x51'),util[_0x2596('0x28')](_0x585335[_0x2596('0x25')],{'showHidden':![],'depth':null}));}})[_0x2596('0x15')](function(_0x499d6c){return logger[_0x2596('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2596('0x27'),_0x2596('0x51'),util[_0x2596('0x28')](_0x499d6c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2596('0x26'),_0x2596('0x27'),'csc',_0x2596('0x5e'));}case _0x2596('0x5f'):if(_0x43ffa2[_0x2596('0x53')]){var _0x470c30={'method':_0x2596('0x2f'),'uri':_0x2596('0x60'),'headers':{'Authorization':_0x43ffa2['apiKey']},'body':{'content':_0x49eca3[_0x2596('0x14')],'to':[_0x49eca3['phone']],'from':_0x43ffa2[_0x2596('0x1d')],'binary':![],'clientMessageId':'uuid','charset':_0x2596('0x61')},'json':!![]};rp(_0x470c30)[_0x2596('0x19')](function(_0x45f27d){if(!_0x45f27d[_0x2596('0x25')]){var _0x3800e5={'messageId':_0x45f27d['messages'][0x0][_0x2596('0x62')]};if(!_0x43ffa2[_0x2596('0x31')]){_0x3800e5[_0x2596('0x32')]=!![];}return _0x5418d1['update'](_0x3800e5);}else{return logger[_0x2596('0x25')](_0x2596('0x26'),'afterCreate',_0x2596('0x5f'),util[_0x2596('0x28')](_0x45f27d[_0x2596('0x25')],{'showHidden':![],'depth':null}));}})[_0x2596('0x15')](function(_0x2c854f){return logger[_0x2596('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2596('0x5f'),util[_0x2596('0x28')](_0x2c854f,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2596('0x27'),'clickatell',_0x2596('0x5e'));}break;case'intelepeer':if(_0x43ffa2[_0x2596('0x53')]){var _0x7afaea={};var _0xa28e9e={'method':_0x2596('0x2f'),'uri':_0x2596('0x63'),'headers':{'Authorization':_0x2596('0x64')+_0x43ffa2[_0x2596('0x53')],'Content-Type':_0x2596('0x4e')},'body':{'from':_0x43ffa2[_0x2596('0x1d')],'to':_0x49eca3[_0x2596('0x1d')],'text':_0x49eca3[_0x2596('0x14')]},'json':!![]};return rp(_0xa28e9e)[_0x2596('0x19')](function(_0x34d2b2){if(_0x34d2b2[_0x2596('0x65')]==0xca){_0x7afaea['message']=_0x34d2b2;var _0x28a6ca={'method':_0x2596('0x2f'),'uri':_0x2596('0x66'),'headers':{'Authorization':_0x2596('0x64')+_0x43ffa2[_0x2596('0x53')],'Content-Type':_0x2596('0x4e')},'body':{'refid':_0x7afaea['message'][_0x2596('0x67')]},'json':!![]};return rp(_0x28a6ca)[_0x2596('0x19')](function(_0x3dffa8){_0x7afaea[_0x2596('0x68')]=_0x3dffa8;var _0x24a681={'messageId':_0x7afaea['message'][_0x2596('0x67')],'read':!![]};return _0x5418d1[_0x2596('0x12')](_0x24a681);});}else{return logger[_0x2596('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2596('0x27'),_0x2596('0x69'),util[_0x2596('0x28')](_0x34d2b2,{'showHidden':![],'depth':null}));}})[_0x2596('0x15')](function(_0x4327a3){return logger[_0x2596('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2596('0x27'),'intelepeer',util[_0x2596('0x28')](_0x4327a3,{'showHidden':![],'depth':null}));});}else{return logger[_0x2596('0x25')](_0x2596('0x26'),_0x2596('0x27'),_0x2596('0x69'),_0x2596('0x6a'));}break;}}})[_0x2596('0x6b')](function(){_0x3c656c();});}else{_0x3c656c();}}},'charset':_0x2596('0x6c'),'collate':_0x2596('0x6d')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index fa5ac05..e59f205 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 _0x1017=['body','options','raw','CreateSmsMessage','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create'];(function(_0x3ec510,_0x196121){var _0x30a8f7=function(_0x447e97){while(--_0x447e97){_0x3ec510['push'](_0x3ec510['shift']());}};_0x30a8f7(++_0x196121);}(_0x1017,0x18b));var _0x7101=function(_0x44f427,_0x27bf84){_0x44f427=_0x44f427-0x0;var _0x42c0b6=_0x1017[_0x44f427];return _0x42c0b6;};'use strict';var _=require(_0x7101('0x0'));var util=require('util');var moment=require(_0x7101('0x1'));var BPromise=require(_0x7101('0x2'));var rs=require(_0x7101('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7101('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7101('0x5'))('rpc');var config=require(_0x7101('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7101('0x7')][_0x7101('0x8')]({'port':0x232a});config[_0x7101('0x9')]=_[_0x7101('0xa')](config[_0x7101('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7101('0x9')]));require(_0x7101('0xb'))['register'](socket);function respondWithRpcPromise(_0x159275,_0x3900bb,_0x27f86f){return new BPromise(function(_0x4f97dc,_0x306529){return client[_0x7101('0xc')](_0x159275,_0x27f86f)[_0x7101('0xd')](function(_0x457401){logger[_0x7101('0xe')](_0x7101('0xf'),_0x3900bb,_0x7101('0x10'));logger['debug'](_0x7101('0x11'),_0x3900bb,_0x7101('0x10'),JSON[_0x7101('0x12')](_0x457401));if(_0x457401[_0x7101('0x13')]){if(_0x457401[_0x7101('0x13')][_0x7101('0x14')]===0x1f4){logger[_0x7101('0x13')](_0x7101('0xf'),_0x3900bb,_0x457401['error']['message']);return _0x306529(_0x457401['error'][_0x7101('0x15')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x3900bb,_0x457401[_0x7101('0x13')][_0x7101('0x15')]);return _0x4f97dc(_0x457401[_0x7101('0x13')][_0x7101('0x15')]);}else{logger[_0x7101('0xe')](_0x7101('0xf'),_0x3900bb,_0x7101('0x10'));_0x4f97dc(_0x457401[_0x7101('0x16')][_0x7101('0x15')]);}})[_0x7101('0x17')](function(_0x5343a8){logger[_0x7101('0x13')](_0x7101('0xf'),_0x3900bb,_0x5343a8);_0x306529(_0x5343a8);});});}exports['CreateSmsMessage']=function(_0x94375b){var _0xaa06ac=this;return new Promise(function(_0x52cff5,_0x21b6a7){return db['SmsMessage'][_0x7101('0x18')](_0x94375b[_0x7101('0x19')],{'raw':_0x94375b[_0x7101('0x1a')]?_0x94375b[_0x7101('0x1a')][_0x7101('0x1b')]===undefined?!![]:![]:!![]})[_0x7101('0xd')](function(_0x236b64){logger['info'](_0x7101('0x1c'),_0x94375b);logger[_0x7101('0x1d')](_0x7101('0x1c'),_0x94375b,JSON[_0x7101('0x12')](_0x236b64));_0x52cff5(_0x236b64);})[_0x7101('0x17')](function(_0xdd26d0){logger[_0x7101('0x13')](_0x7101('0x1c'),_0xdd26d0[_0x7101('0x15')],_0x94375b);_0x21b6a7(_0xaa06ac['error'](0x1f4,_0xdd26d0[_0x7101('0x15')]));});});}; \ No newline at end of file +var _0x7fe2=['then','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','info','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request'];(function(_0x5d705e,_0x112925){var _0x5054b2=function(_0x1d0447){while(--_0x1d0447){_0x5d705e['push'](_0x5d705e['shift']());}};_0x5054b2(++_0x112925);}(_0x7fe2,0xb5));var _0x27fe=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x7fe2[_0xaa0309];return _0x5de7ce;};'use strict';var _=require('lodash');var util=require(_0x27fe('0x0'));var moment=require(_0x27fe('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27fe('0x2'));var db=require(_0x27fe('0x3'))['db'];var utils=require(_0x27fe('0x4'));var logger=require(_0x27fe('0x5'))(_0x27fe('0x6'));var config=require(_0x27fe('0x7'));var jayson=require(_0x27fe('0x8'));var client=jayson[_0x27fe('0x9')]['http']({'port':0x232a});config[_0x27fe('0xa')]=_[_0x27fe('0xb')](config['redis'],{'host':_0x27fe('0xc'),'port':0x18eb});var socket=require(_0x27fe('0xd'))(new Redis(config[_0x27fe('0xa')]));require(_0x27fe('0xe'))[_0x27fe('0xf')](socket);function respondWithRpcPromise(_0x21d769,_0x86cd51,_0xe7b322){return new BPromise(function(_0x27bb65,_0x4ce56a){return client[_0x27fe('0x10')](_0x21d769,_0xe7b322)[_0x27fe('0x11')](function(_0xf01ad6){logger['info']('SmsMessage,\x20%s,\x20%s',_0x86cd51,'request\x20sent');logger[_0x27fe('0x12')](_0x27fe('0x13'),_0x86cd51,'request\x20sent',JSON[_0x27fe('0x14')](_0xf01ad6));if(_0xf01ad6[_0x27fe('0x15')]){if(_0xf01ad6[_0x27fe('0x15')][_0x27fe('0x16')]===0x1f4){logger[_0x27fe('0x15')](_0x27fe('0x17'),_0x86cd51,_0xf01ad6[_0x27fe('0x15')]['message']);return _0x4ce56a(_0xf01ad6[_0x27fe('0x15')][_0x27fe('0x18')]);}logger[_0x27fe('0x15')](_0x27fe('0x17'),_0x86cd51,_0xf01ad6[_0x27fe('0x15')]['message']);return _0x27bb65(_0xf01ad6[_0x27fe('0x15')][_0x27fe('0x18')]);}else{logger['info'](_0x27fe('0x17'),_0x86cd51,'request\x20sent');_0x27bb65(_0xf01ad6['result'][_0x27fe('0x18')]);}})[_0x27fe('0x19')](function(_0x6c3a32){logger[_0x27fe('0x15')](_0x27fe('0x17'),_0x86cd51,_0x6c3a32);_0x4ce56a(_0x6c3a32);});});}exports[_0x27fe('0x1a')]=function(_0x552a8a){var _0x121051=this;return new Promise(function(_0xa02a0,_0x4c61b9){return db[_0x27fe('0x1b')][_0x27fe('0x1c')](_0x552a8a[_0x27fe('0x1d')],{'raw':_0x552a8a['options']?_0x552a8a[_0x27fe('0x1e')][_0x27fe('0x1f')]===undefined?!![]:![]:!![]})[_0x27fe('0x11')](function(_0x5edf05){logger[_0x27fe('0x20')]('CreateSmsMessage',_0x552a8a);logger[_0x27fe('0x12')](_0x27fe('0x1a'),_0x552a8a,JSON['stringify'](_0x5edf05));_0xa02a0(_0x5edf05);})[_0x27fe('0x19')](function(_0x2d36b6){logger[_0x27fe('0x15')](_0x27fe('0x1a'),_0x2d36b6['message'],_0x552a8a);_0x4c61b9(_0x121051[_0x27fe('0x15')](0x1f4,_0x2d36b6[_0x27fe('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 1743cd4..c90f034 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 _0xc8bd=['update','emit','removeListener','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc8bd,0xe7));var _0xdc8b=function(_0x23d957,_0x5d2176){_0x23d957=_0x23d957-0x0;var _0x568ff2=_0xc8bd[_0x23d957];return _0x568ff2;};'use strict';var SmsMessageEvents=require(_0xdc8b('0x0'));var events=[_0xdc8b('0x1'),_0xdc8b('0x2'),_0xdc8b('0x3')];function createListener(_0x332abf,_0x1a559a){return function(_0xa859dd){_0x1a559a[_0xdc8b('0x4')](_0x332abf,_0xa859dd);};}function removeListener(_0xa614f7,_0x4d959d){return function(){SmsMessageEvents[_0xdc8b('0x5')](_0xa614f7,_0x4d959d);};}exports[_0xdc8b('0x6')]=function(_0x119e5e){for(var _0x379496=0x0,_0xa06429=events[_0xdc8b('0x7')];_0x379496<_0xa06429;_0x379496++){var _0x558ca4=events[_0x379496];var _0x365669=createListener(_0xdc8b('0x8')+_0x558ca4,_0x119e5e);SmsMessageEvents['on'](_0x558ca4,_0x365669);}}; \ No newline at end of file +var _0x5178=['save','update','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x2c4b84,_0x18bc7d){var _0x5b0888=function(_0x19d4c8){while(--_0x19d4c8){_0x2c4b84['push'](_0x2c4b84['shift']());}};_0x5b0888(++_0x18bc7d);}(_0x5178,0x195));var _0x8517=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5178[_0x397e5f];return _0x5302b8;};'use strict';var SmsMessageEvents=require(_0x8517('0x0'));var events=[_0x8517('0x1'),'remove',_0x8517('0x2')];function createListener(_0x2e12e8,_0xf62ebc){return function(_0x69ae2d){_0xf62ebc['emit'](_0x2e12e8,_0x69ae2d);};}function removeListener(_0x3f219e,_0x53a242){return function(){SmsMessageEvents[_0x8517('0x3')](_0x3f219e,_0x53a242);};}exports[_0x8517('0x4')]=function(_0xd6a8b){for(var _0x1a928a=0x0,_0x3a165c=events[_0x8517('0x5')];_0x1a928a<_0x3a165c;_0x1a928a++){var _0x598ab9=events[_0x1a928a];var _0x5d1ef2=createListener(_0x8517('0x6')+_0x598ab9,_0xd6a8b);SmsMessageEvents['on'](_0x598ab9,_0x5d1ef2);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 9860f1a..b5cc93c 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 _0x0f6f=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x1a6ca7,_0x36ee4b){var _0x2e4b1d=function(_0xbf80e4){while(--_0xbf80e4){_0x1a6ca7['push'](_0x1a6ca7['shift']());}};_0x2e4b1d(++_0x36ee4b);}(_0x0f6f,0x159));var _0xf0f6=function(_0x473b41,_0x1c320f){_0x473b41=_0x473b41-0x0;var _0x4e521d=_0x0f6f[_0x473b41];return _0x4e521d;};'use strict';var multer=require('multer');var util=require(_0xf0f6('0x0'));var path=require(_0xf0f6('0x1'));var timeout=require(_0xf0f6('0x2'));var express=require(_0xf0f6('0x3'));var router=express[_0xf0f6('0x4')]();var auth=require(_0xf0f6('0x5'));var interaction=require(_0xf0f6('0x6'));var config=require(_0xf0f6('0x7'));var controller=require(_0xf0f6('0x8'));router[_0xf0f6('0x9')]('/',auth[_0xf0f6('0xa')](),controller['index']);router[_0xf0f6('0x9')](_0xf0f6('0xb'),auth[_0xf0f6('0xa')](),controller[_0xf0f6('0xc')]);router[_0xf0f6('0x9')](_0xf0f6('0xd'),auth[_0xf0f6('0xa')](),controller[_0xf0f6('0xe')]);router['get'](_0xf0f6('0xf'),auth[_0xf0f6('0xa')](),controller[_0xf0f6('0x10')]);router['get'](_0xf0f6('0x11'),auth['isAuthenticated'](),controller[_0xf0f6('0x12')]);router[_0xf0f6('0x9')](_0xf0f6('0x13'),auth[_0xf0f6('0xa')](),controller[_0xf0f6('0x14')]);router[_0xf0f6('0x15')]('/',auth[_0xf0f6('0xa')](),controller[_0xf0f6('0x16')]);router[_0xf0f6('0x15')](_0xf0f6('0x11'),auth[_0xf0f6('0xa')](),controller[_0xf0f6('0x17')]);router[_0xf0f6('0x15')]('/:id/users',auth[_0xf0f6('0xa')](),controller[_0xf0f6('0x18')]);router[_0xf0f6('0x19')](_0xf0f6('0xd'),auth[_0xf0f6('0xa')](),controller[_0xf0f6('0x1a')]);router[_0xf0f6('0x1b')](_0xf0f6('0xd'),auth[_0xf0f6('0xa')](),controller[_0xf0f6('0x1c')]);router[_0xf0f6('0x1b')](_0xf0f6('0x11'),auth[_0xf0f6('0xa')](),controller['removeTeams']);router[_0xf0f6('0x1b')](_0xf0f6('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xf0f6('0x1d')]=router; \ No newline at end of file +var _0x50b3=['path','connect-timeout','express','Router','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','/:id/teams','removeTeams','delete','removeAgents','multer'];(function(_0x680b65,_0x5b2e9c){var _0x1c2053=function(_0x1128e0){while(--_0x1128e0){_0x680b65['push'](_0x680b65['shift']());}};_0x1c2053(++_0x5b2e9c);}(_0x50b3,0x133));var _0x350b=function(_0x54945e,_0x42f71a){_0x54945e=_0x54945e-0x0;var _0x36eabd=_0x50b3[_0x54945e];return _0x36eabd;};'use strict';var multer=require(_0x350b('0x0'));var util=require('util');var path=require(_0x350b('0x1'));var timeout=require(_0x350b('0x2'));var express=require(_0x350b('0x3'));var router=express[_0x350b('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x350b('0x5'));var controller=require('./smsQueue.controller');router[_0x350b('0x6')]('/',auth['isAuthenticated'](),controller[_0x350b('0x7')]);router[_0x350b('0x6')](_0x350b('0x8'),auth[_0x350b('0x9')](),controller[_0x350b('0xa')]);router['get'](_0x350b('0xb'),auth[_0x350b('0x9')](),controller[_0x350b('0xc')]);router[_0x350b('0x6')](_0x350b('0xd'),auth[_0x350b('0x9')](),controller[_0x350b('0xe')]);router['get']('/:id/teams',auth[_0x350b('0x9')](),controller[_0x350b('0xf')]);router[_0x350b('0x6')](_0x350b('0x10'),auth[_0x350b('0x9')](),controller[_0x350b('0x11')]);router[_0x350b('0x12')]('/',auth['isAuthenticated'](),controller[_0x350b('0x13')]);router[_0x350b('0x12')]('/:id/teams',auth[_0x350b('0x9')](),controller[_0x350b('0x14')]);router['post'](_0x350b('0x10'),auth[_0x350b('0x9')](),controller[_0x350b('0x15')]);router[_0x350b('0x16')]('/:id',auth[_0x350b('0x9')](),controller[_0x350b('0x17')]);router['delete'](_0x350b('0xb'),auth[_0x350b('0x9')](),controller['destroy']);router['delete'](_0x350b('0x18'),auth[_0x350b('0x9')](),controller[_0x350b('0x19')]);router[_0x350b('0x1a')](_0x350b('0x10'),auth['isAuthenticated'](),controller[_0x350b('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 081a6d4..ca1ac07 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 _0xb3fc=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3fc,0x130));var _0xcb3f=function(_0x24ddf6,_0x114e56){_0x24ddf6=_0x24ddf6-0x0;var _0x393d70=_0xb3fc[_0x24ddf6];return _0x393d70;};'use strict';var Sequelize=require(_0xcb3f('0x0'));module[_0xcb3f('0x1')]={'name':{'type':Sequelize[_0xcb3f('0x2')],'unique':_0xcb3f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcb3f('0x2')]},'timeout':{'type':Sequelize[_0xcb3f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcb3f('0x5')]('rrmemory',_0xcb3f('0x6'),_0xcb3f('0x7'))}}; \ No newline at end of file +var _0x4d53=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x4d53,0x1e3));var _0x34d5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4d53[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0x34d5('0x0')]={'name':{'type':Sequelize[_0x34d5('0x1')],'unique':_0x34d5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x34d5('0x1')]},'timeout':{'type':Sequelize[_0x34d5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x34d5('0x4')](_0x34d5('0x5'),_0x34d5('0x6'),_0x34d5('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 5020684..a18dc0b 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 _0xab79=['userSmsQueue:save','isArray','userSmsQueue:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','count','offset','Content-Range','apply','reject','save','then','destroy','get','SmsQueues','UserProfileResource','stack','name','send','index','SmsQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','map','type','key','field','filter','options','includeAll','include','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserSmsQueue','length','SmsQueueId','User','UserId','agent','smsPause','updatedAt','format','%s/%s','SIP','getTeams','addTeams','Team','ids','Agents','union','penalty','removeTeams','addAgents','omit','emit'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xab79,0x163));var _0x9ab7=function(_0x3c2753,_0x1455c7){_0x3c2753=_0x3c2753-0x0;var _0x30e10a=_0xab79[_0x3c2753];return _0x30e10a;};'use strict';var pdf=require(_0x9ab7('0x0'));var emlformat=require(_0x9ab7('0x1'));var rimraf=require(_0x9ab7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9ab7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9ab7('0x4'));var util=require(_0x9ab7('0x5'));var path=require(_0x9ab7('0x6'));var sox=require(_0x9ab7('0x7'));var csv=require(_0x9ab7('0x8'));var ejs=require(_0x9ab7('0x9'));var fs=require('fs');var _=require(_0x9ab7('0xa'));var squel=require('squel');var crypto=require(_0x9ab7('0xb'));var jsforce=require(_0x9ab7('0xc'));var deskjs=require(_0x9ab7('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9ab7('0xe'));var Papa=require(_0x9ab7('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x9ab7('0x10'));var Redis=require(_0x9ab7('0x11'));var qs=require(_0x9ab7('0x12'));var logger=require(_0x9ab7('0x13'))(_0x9ab7('0x14'));var utils=require(_0x9ab7('0x15'));var config=require(_0x9ab7('0x16'));var db=require(_0x9ab7('0x17'))['db'];config[_0x9ab7('0x18')]=_[_0x9ab7('0x19')](config['redis'],{'host':_0x9ab7('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9ab7('0x1b'))[_0x9ab7('0x1c')](socket);function respondWithStatusCode(_0x1c1b22,_0x58588a){_0x58588a=_0x58588a||0xcc;return function(_0x54c01c){if(_0x54c01c){return _0x1c1b22[_0x9ab7('0x1d')](_0x58588a);}return _0x1c1b22[_0x9ab7('0x1e')](_0x58588a)['end']();};}function respondWithResult(_0x359a0d,_0x68e510){_0x68e510=_0x68e510||0xc8;return function(_0x31745e){if(_0x31745e){return _0x359a0d['status'](_0x68e510)['json'](_0x31745e);}};}function respondWithFilteredResult(_0x510cbc,_0x1fdc8f){return function(_0x44ca5a){if(_0x44ca5a){var _0x3b5528=_0x44ca5a[_0x9ab7('0x1f')],_0x403def=_0x1fdc8f[_0x9ab7('0x20')],_0x48b6ff=_0x1fdc8f[_0x9ab7('0x20')]+_0x1fdc8f['limit'],_0x4ffbe1;if(_0x48b6ff>=_0x3b5528){_0x48b6ff=_0x3b5528;_0x4ffbe1=0xc8;}else{_0x4ffbe1=0xce;}_0x510cbc['status'](_0x4ffbe1);return _0x510cbc['set'](_0x9ab7('0x21'),_0x403def+'-'+_0x48b6ff+'/'+_0x3b5528)['json'](_0x44ca5a);}return null;};}function patchUpdates(_0x3d7be7){return function(_0x134b7f){try{jsonpatch[_0x9ab7('0x22')](_0x134b7f,_0x3d7be7,!![]);}catch(_0x58fa88){return BPromise[_0x9ab7('0x23')](_0x58fa88);}return _0x134b7f[_0x9ab7('0x24')]();};}function saveUpdates(_0x4bbc7f,_0x193d0b){return function(_0x4eac0){if(_0x4eac0){return _0x4eac0['update'](_0x4bbc7f)[_0x9ab7('0x25')](function(_0x18ceb4){return _0x18ceb4;});}return null;};}function removeEntity(_0x1e7db4,_0x524542){return function(_0x898663){if(_0x898663){return _0x898663[_0x9ab7('0x26')]()[_0x9ab7('0x25')](function(){var _0x1f3e82=_0x898663[_0x9ab7('0x27')]({'plain':!![]});var _0x568035=_0x9ab7('0x28');return db[_0x9ab7('0x29')]['destroy']({'where':{'type':_0x568035,'resourceId':_0x1f3e82['id']}})[_0x9ab7('0x25')](function(){return _0x898663;});})[_0x9ab7('0x25')](function(){_0x1e7db4[_0x9ab7('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db936,_0x3a7d9d){return function(_0x227fb3){if(!_0x227fb3){_0x4db936['sendStatus'](0x194);}return _0x227fb3;};}function handleError(_0x2e9828,_0x2d7992){_0x2d7992=_0x2d7992||0x1f4;return function(_0x62df83){logger['error'](_0x62df83[_0x9ab7('0x2a')]);if(_0x62df83[_0x9ab7('0x2b')]){delete _0x62df83[_0x9ab7('0x2b')];}_0x2e9828[_0x9ab7('0x1e')](_0x2d7992)[_0x9ab7('0x2c')](_0x62df83);};}exports[_0x9ab7('0x2d')]=function(_0x1eec73,_0x5da6ab){var _0x2c32d0={},_0xe6ec2b={},_0x1c883d={'count':0x0,'rows':[]};var _0xaed1b3=db[_0x9ab7('0x2e')][_0x9ab7('0x2f')];_0xe6ec2b[_0x9ab7('0x30')]=_[_0x9ab7('0x31')](_0xaed1b3);_0xe6ec2b[_0x9ab7('0x32')]=_[_0x9ab7('0x31')](_0x1eec73['query']);_0xe6ec2b[_0x9ab7('0x33')]=_[_0x9ab7('0x34')](_0xe6ec2b[_0x9ab7('0x30')],_0xe6ec2b[_0x9ab7('0x32')]);_0x2c32d0[_0x9ab7('0x35')]=_[_0x9ab7('0x34')](_0xe6ec2b[_0x9ab7('0x30')],qs[_0x9ab7('0x36')](_0x1eec73[_0x9ab7('0x32')][_0x9ab7('0x36')]));_0x2c32d0['attributes']=_0x2c32d0['attributes']['length']?_0x2c32d0[_0x9ab7('0x35')]:_0xe6ec2b[_0x9ab7('0x30')];if(!_0x1eec73[_0x9ab7('0x32')][_0x9ab7('0x37')](_0x9ab7('0x38'))){_0x2c32d0[_0x9ab7('0x39')]=qs[_0x9ab7('0x39')](_0x1eec73[_0x9ab7('0x32')]['limit']);_0x2c32d0[_0x9ab7('0x20')]=qs[_0x9ab7('0x20')](_0x1eec73[_0x9ab7('0x32')][_0x9ab7('0x20')]);}_0x2c32d0[_0x9ab7('0x3a')]=qs[_0x9ab7('0x3b')](_0x1eec73[_0x9ab7('0x32')][_0x9ab7('0x3b')]);_0x2c32d0['where']=qs[_0x9ab7('0x33')](_[_0x9ab7('0x3c')](_0x1eec73[_0x9ab7('0x32')],_0xe6ec2b[_0x9ab7('0x33')]));if(_0x1eec73[_0x9ab7('0x32')]['filter']){_0x2c32d0[_0x9ab7('0x3d')]=_[_0x9ab7('0x3e')](_0x2c32d0['where'],{'$or':_[_0x9ab7('0x3f')](_0xaed1b3,function(_0xa0639a){if(_0xa0639a[_0x9ab7('0x40')][_0x9ab7('0x41')]!=='VIRTUAL'){var _0x57df72={};_0x57df72[_0xa0639a[_0x9ab7('0x42')]]={'$like':'%'+_0x1eec73['query'][_0x9ab7('0x43')]+'%'};return _0x57df72;}})});}_0x2c32d0=_[_0x9ab7('0x3e')]({},_0x2c32d0,_0x1eec73[_0x9ab7('0x44')]);var _0x246647={'where':_0x2c32d0[_0x9ab7('0x3d')]};return db[_0x9ab7('0x2e')][_0x9ab7('0x1f')](_0x246647)[_0x9ab7('0x25')](function(_0x5a4d00){_0x1c883d[_0x9ab7('0x1f')]=_0x5a4d00;if(_0x1eec73[_0x9ab7('0x32')][_0x9ab7('0x45')]){_0x2c32d0[_0x9ab7('0x46')]=[{'all':!![]}];}return db[_0x9ab7('0x2e')][_0x9ab7('0x47')](_0x2c32d0);})[_0x9ab7('0x25')](function(_0x45a160){_0x1c883d[_0x9ab7('0x48')]=_0x45a160;return _0x1c883d;})[_0x9ab7('0x25')](respondWithFilteredResult(_0x5da6ab,_0x2c32d0))['catch'](handleError(_0x5da6ab,null));};exports[_0x9ab7('0x49')]=function(_0x3bea2c,_0x5a6440){var _0x4843ba={'raw':!![],'where':{'id':_0x3bea2c[_0x9ab7('0x4a')]['id']}},_0x30d1a2={};_0x30d1a2[_0x9ab7('0x30')]=_[_0x9ab7('0x31')](db['SmsQueue'][_0x9ab7('0x2f')]);_0x30d1a2[_0x9ab7('0x32')]=_[_0x9ab7('0x31')](_0x3bea2c[_0x9ab7('0x32')]);_0x30d1a2[_0x9ab7('0x33')]=_[_0x9ab7('0x34')](_0x30d1a2[_0x9ab7('0x30')],_0x30d1a2[_0x9ab7('0x32')]);_0x4843ba[_0x9ab7('0x35')]=_['intersection'](_0x30d1a2[_0x9ab7('0x30')],qs[_0x9ab7('0x36')](_0x3bea2c[_0x9ab7('0x32')][_0x9ab7('0x36')]));_0x4843ba[_0x9ab7('0x35')]=_0x4843ba['attributes']['length']?_0x4843ba[_0x9ab7('0x35')]:_0x30d1a2[_0x9ab7('0x30')];if(_0x3bea2c['query'][_0x9ab7('0x45')]){_0x4843ba[_0x9ab7('0x46')]=[{'all':!![]}];}_0x4843ba=_[_0x9ab7('0x3e')]({},_0x4843ba,_0x3bea2c[_0x9ab7('0x44')]);return db[_0x9ab7('0x2e')][_0x9ab7('0x4b')](_0x4843ba)[_0x9ab7('0x25')](handleEntityNotFound(_0x5a6440,null))[_0x9ab7('0x25')](respondWithResult(_0x5a6440,null))['catch'](handleError(_0x5a6440,null));};exports[_0x9ab7('0x4c')]=function(_0x318a33,_0x310526){return db[_0x9ab7('0x2e')]['create'](_0x318a33['body'],{})[_0x9ab7('0x25')](function(_0x353c9b){var _0x3cc7b5=_0x318a33[_0x9ab7('0x4d')]['get']({'plain':!![]});if(!_0x3cc7b5)throw new Error(_0x9ab7('0x4e'));if(_0x3cc7b5[_0x9ab7('0x4f')]===_0x9ab7('0x4d')){var _0x5f0117=_0x353c9b[_0x9ab7('0x27')]({'plain':!![]});var _0x53d192=_0x9ab7('0x28');return db[_0x9ab7('0x50')][_0x9ab7('0x4b')]({'where':{'name':_0x53d192,'userProfileId':_0x3cc7b5[_0x9ab7('0x51')]},'raw':!![]})[_0x9ab7('0x25')](function(_0x39049e){if(_0x39049e&&_0x39049e[_0x9ab7('0x52')]===0x0){return db[_0x9ab7('0x29')][_0x9ab7('0x4c')]({'name':_0x5f0117[_0x9ab7('0x2b')],'resourceId':_0x5f0117['id'],'type':_0x39049e[_0x9ab7('0x2b')],'sectionId':_0x39049e['id']},{})[_0x9ab7('0x25')](function(){return _0x353c9b;});}else{return _0x353c9b;}})[_0x9ab7('0x53')](function(_0x3286ba){logger[_0x9ab7('0x54')](_0x9ab7('0x55'),_0x3286ba);throw _0x3286ba;});}return _0x353c9b;})['then'](respondWithResult(_0x310526,0xc9))[_0x9ab7('0x53')](handleError(_0x310526,null));};exports[_0x9ab7('0x56')]=function(_0x25748d,_0x23822b){if(_0x25748d[_0x9ab7('0x57')]['id']){delete _0x25748d[_0x9ab7('0x57')]['id'];}return db[_0x9ab7('0x2e')][_0x9ab7('0x4b')]({'where':{'id':_0x25748d[_0x9ab7('0x4a')]['id']}})[_0x9ab7('0x25')](handleEntityNotFound(_0x23822b,null))['then'](saveUpdates(_0x25748d[_0x9ab7('0x57')],null))[_0x9ab7('0x25')](respondWithResult(_0x23822b,null))[_0x9ab7('0x53')](handleError(_0x23822b,null));};exports[_0x9ab7('0x26')]=function(_0x1742eb,_0x2b184e){return db['SmsQueue'][_0x9ab7('0x4b')]({'where':{'id':_0x1742eb[_0x9ab7('0x4a')]['id']}})[_0x9ab7('0x25')](handleEntityNotFound(_0x2b184e,null))['then'](removeEntity(_0x2b184e,null))[_0x9ab7('0x53')](handleError(_0x2b184e,null));};exports[_0x9ab7('0x58')]=function(_0x29e5ae,_0x434a92){return db['SmsQueue']['describe']()[_0x9ab7('0x25')](respondWithResult(_0x434a92,null))[_0x9ab7('0x53')](handleError(_0x434a92,null));};exports[_0x9ab7('0x59')]=function(_0x3c5d02,_0x421acc,_0x575108){var _0x3d60be={'raw':!![],'where':{}},_0x103822={},_0x5c3268;return db['SmsQueue'][_0x9ab7('0x5a')]({'where':{'id':_0x3c5d02[_0x9ab7('0x4a')]['id']}})[_0x9ab7('0x25')](handleEntityNotFound(_0x421acc,null))[_0x9ab7('0x25')](function(_0x76c753){if(_0x76c753){_0x5c3268=_0x76c753[_0x9ab7('0x27')]({'plain':!![]});_0x103822[_0x9ab7('0x30')]=_[_0x9ab7('0x31')](db[_0x9ab7('0x5b')][_0x9ab7('0x2f')]);_0x103822[_0x9ab7('0x32')]=_[_0x9ab7('0x31')](_0x3c5d02[_0x9ab7('0x32')]);_0x103822[_0x9ab7('0x33')]=_[_0x9ab7('0x34')](_0x103822[_0x9ab7('0x30')],_0x103822[_0x9ab7('0x32')]);_0x3d60be[_0x9ab7('0x35')]=_['intersection'](_0x103822[_0x9ab7('0x30')],qs[_0x9ab7('0x36')](_0x3c5d02[_0x9ab7('0x32')]['fields']));_0x3d60be[_0x9ab7('0x35')]=_0x3d60be['attributes'][_0x9ab7('0x5c')]?_0x3d60be[_0x9ab7('0x35')]:_0x103822[_0x9ab7('0x30')];if(!_0x3c5d02[_0x9ab7('0x32')][_0x9ab7('0x37')]('nolimit')){_0x3d60be[_0x9ab7('0x39')]=qs[_0x9ab7('0x39')](_0x3c5d02['query'][_0x9ab7('0x39')]);_0x3d60be[_0x9ab7('0x20')]=qs[_0x9ab7('0x20')](_0x3c5d02['query'][_0x9ab7('0x20')]);}_0x3d60be[_0x9ab7('0x3a')]=qs[_0x9ab7('0x3b')](_0x3c5d02[_0x9ab7('0x32')][_0x9ab7('0x3b')]);_0x3d60be[_0x9ab7('0x3d')]=qs[_0x9ab7('0x33')](_[_0x9ab7('0x3c')](_0x3c5d02[_0x9ab7('0x32')],_0x103822[_0x9ab7('0x33')]));_0x3d60be[_0x9ab7('0x3d')][_0x9ab7('0x5d')]=_0x76c753['id'];if(_0x3c5d02[_0x9ab7('0x32')][_0x9ab7('0x43')]){_0x3d60be[_0x9ab7('0x3d')]=_[_0x9ab7('0x3e')](_0x3d60be['where'],{'$or':_[_0x9ab7('0x3f')](_0x3d60be[_0x9ab7('0x35')],function(_0x155f24){var _0x509d4b={};_0x509d4b[_0x155f24]={'$like':'%'+_0x3c5d02[_0x9ab7('0x32')][_0x9ab7('0x43')]+'%'};return _0x509d4b;})});}_0x3d60be=_[_0x9ab7('0x3e')]({},_0x3d60be,_0x3c5d02['options']);return db[_0x9ab7('0x5b')][_0x9ab7('0x47')](_0x3d60be);}})[_0x9ab7('0x25')](function(_0x55f982){if(_0x55f982){return db[_0x9ab7('0x5e')]['findAndCountAll']({'where':{'id':_[_0x9ab7('0x3f')](_0x55f982,_0x9ab7('0x5f')),'role':_0x9ab7('0x60')},'attributes':['id',_0x9ab7('0x2b'),_0x9ab7('0x61'),_0x9ab7('0x62'),'createdAt']});}})[_0x9ab7('0x25')](function(_0x3dc104){if(_0x3dc104){return{'count':_0x3dc104[_0x9ab7('0x1f')],'rows':_[_0x9ab7('0x3f')](_0x3dc104[_0x9ab7('0x48')],function(_0x3b3b07){return{'membername':_0x3b3b07[_0x9ab7('0x2b')],'UserId':_0x3b3b07['id'],'queue_name':_0x5c3268[_0x9ab7('0x2b')],'SmsQueueId':_0x5c3268['id'],'interface':util[_0x9ab7('0x63')](_0x9ab7('0x64'),_0x9ab7('0x65'),_0x3b3b07[_0x9ab7('0x2b')]),'penalty':0x0,'paused':_0x3b3b07[_0x9ab7('0x61')],'createdAt':_0x3b3b07['createdAt'],'updatedAt':_0x3b3b07[_0x9ab7('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9ab7('0x25')](respondWithFilteredResult(_0x421acc,_0x3d60be))['catch'](handleError(_0x421acc,null));};exports['getTeams']=function(_0x857d2b,_0x1a5dc1,_0xc48a29){var _0x4763ec={};var _0x1b4442={};var _0x3c399f;var _0x19441e;return db['SmsQueue'][_0x9ab7('0x5a')]({'where':{'id':_0x857d2b[_0x9ab7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1a5dc1,null))['then'](function(_0x32bbeb){if(_0x32bbeb){_0x3c399f=_0x32bbeb;_0x1b4442[_0x9ab7('0x30')]=_[_0x9ab7('0x31')](db['Team'][_0x9ab7('0x2f')]);_0x1b4442[_0x9ab7('0x32')]=_['keys'](_0x857d2b[_0x9ab7('0x32')]);_0x1b4442[_0x9ab7('0x33')]=_[_0x9ab7('0x34')](_0x1b4442[_0x9ab7('0x30')],_0x1b4442['query']);_0x4763ec[_0x9ab7('0x35')]=_[_0x9ab7('0x34')](_0x1b4442['model'],qs[_0x9ab7('0x36')](_0x857d2b[_0x9ab7('0x32')][_0x9ab7('0x36')]));_0x4763ec[_0x9ab7('0x35')]=_0x4763ec[_0x9ab7('0x35')]['length']?_0x4763ec[_0x9ab7('0x35')]:_0x1b4442[_0x9ab7('0x30')];_0x4763ec[_0x9ab7('0x3a')]=qs[_0x9ab7('0x3b')](_0x857d2b[_0x9ab7('0x32')][_0x9ab7('0x3b')]);_0x4763ec[_0x9ab7('0x3d')]=qs[_0x9ab7('0x33')](_[_0x9ab7('0x3c')](_0x857d2b[_0x9ab7('0x32')],_0x1b4442[_0x9ab7('0x33')]));if(_0x857d2b[_0x9ab7('0x32')][_0x9ab7('0x43')]){_0x4763ec[_0x9ab7('0x3d')]=_['merge'](_0x4763ec['where'],{'$or':_[_0x9ab7('0x3f')](_0x4763ec[_0x9ab7('0x35')],function(_0x619072){var _0x3cdd22={};_0x3cdd22[_0x619072]={'$like':'%'+_0x857d2b[_0x9ab7('0x32')][_0x9ab7('0x43')]+'%'};return _0x3cdd22;})});}_0x4763ec=_['merge']({},_0x4763ec,_0x857d2b['options']);return _0x3c399f[_0x9ab7('0x66')](_0x4763ec);}})[_0x9ab7('0x25')](function(_0x1437f6){if(_0x1437f6){_0x19441e=_0x1437f6['length'];if(!_0x857d2b['query'][_0x9ab7('0x37')](_0x9ab7('0x38'))){_0x4763ec[_0x9ab7('0x39')]=qs[_0x9ab7('0x39')](_0x857d2b[_0x9ab7('0x32')][_0x9ab7('0x39')]);_0x4763ec[_0x9ab7('0x20')]=qs[_0x9ab7('0x20')](_0x857d2b[_0x9ab7('0x32')][_0x9ab7('0x20')]);}return _0x3c399f[_0x9ab7('0x66')](_0x4763ec);}})[_0x9ab7('0x25')](function(_0x116485){if(_0x116485){return _0x116485?{'count':_0x19441e,'rows':_0x116485}:null;}})['then'](respondWithResult(_0x1a5dc1,null))['catch'](handleError(_0x1a5dc1,null));};exports[_0x9ab7('0x67')]=function(_0x3c788d,_0x4aef75,_0x24c106){var _0x1d3cb6=[];var _0x1319af;return db[_0x9ab7('0x68')][_0x9ab7('0x47')]({'where':{'id':_0x3c788d[_0x9ab7('0x57')][_0x9ab7('0x69')]},'attributes':['id'],'include':[{'model':db[_0x9ab7('0x5e')],'as':_0x9ab7('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x9ab7('0x25')](function(_0x1241e5){if(_0x1241e5){for(var _0x171540=0x0;_0x171540<_0x1241e5[_0x9ab7('0x5c')];_0x171540+=0x1){for(var _0x4b611d=0x0;_0x4b611d<_0x1241e5[_0x171540][_0x9ab7('0x6a')][_0x9ab7('0x5c')];_0x4b611d+=0x1){_0x1d3cb6=_[_0x9ab7('0x6b')](_0x1d3cb6,[_0x1241e5[_0x171540]['Agents'][_0x4b611d]['id']]);}}return _0x1d3cb6;}})[_0x9ab7('0x25')](function(_0x3c1953){if(_0x3c1953){return db[_0x9ab7('0x2e')][_0x9ab7('0x4b')]({'where':{'id':_0x3c788d[_0x9ab7('0x4a')]['id']}});}})[_0x9ab7('0x25')](function(_0x400fbe){if(_0x400fbe){_0x1319af=_0x400fbe;return _0x1319af['addAgents'](_0x1d3cb6,{'penalty':_0x3c788d[_0x9ab7('0x57')][_0x9ab7('0x6c')]});}})[_0x9ab7('0x25')](function(_0x1dfb47){if(_0x1dfb47){return _0x1319af[_0x9ab7('0x67')](_0x3c788d['body'][_0x9ab7('0x69')]);}})['then'](handleEntityNotFound(_0x4aef75,null))['then'](respondWithStatusCode(_0x4aef75,null))[_0x9ab7('0x53')](handleError(_0x4aef75,null));};exports[_0x9ab7('0x6d')]=function(_0x25b827,_0xfc2a5c,_0x3da21b){var _0x1824f9=[];var _0xfea1ce;return db[_0x9ab7('0x68')][_0x9ab7('0x47')]({'where':{'id':_0x25b827[_0x9ab7('0x32')][_0x9ab7('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9ab7('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x9ab7('0x25')](function(_0x3e102d){if(_0x3e102d){for(var _0x4e9acb=0x0;_0x4e9acb<_0x3e102d['length'];_0x4e9acb+=0x1){for(var _0x508265=0x0;_0x508265<_0x3e102d[_0x4e9acb]['Agents'][_0x9ab7('0x5c')];_0x508265+=0x1){_0x1824f9=_[_0x9ab7('0x6b')](_0x1824f9,[_0x3e102d[_0x4e9acb][_0x9ab7('0x6a')][_0x508265]['id']]);}}return _0x1824f9;}})['then'](function(_0x28248b){if(_0x28248b){return db['SmsQueue'][_0x9ab7('0x4b')]({'where':{'id':_0x25b827['params']['id']}});}})[_0x9ab7('0x25')](function(_0x1935b5){if(_0x1935b5){_0xfea1ce=_0x1935b5;return _0xfea1ce['removeAgents'](_0x1824f9);}})['then'](function(_0x4a9e68){if(_0xfea1ce){return _0xfea1ce[_0x9ab7('0x6d')](_0x25b827[_0x9ab7('0x32')]['ids']);}})[_0x9ab7('0x25')](handleEntityNotFound(_0xfc2a5c,null))[_0x9ab7('0x25')](respondWithStatusCode(_0xfc2a5c,null))[_0x9ab7('0x53')](handleError(_0xfc2a5c,null));};exports['addAgents']=function(_0x530c2e,_0x29ae8b,_0x4249fd){return db['SmsQueue']['find']({'where':{'id':_0x530c2e[_0x9ab7('0x4a')]['id']}})[_0x9ab7('0x25')](handleEntityNotFound(_0x29ae8b,null))[_0x9ab7('0x25')](function(_0x6821b4){if(_0x6821b4){return _0x6821b4[_0x9ab7('0x6e')](_0x530c2e[_0x9ab7('0x57')]['ids'],_[_0x9ab7('0x6f')](_0x530c2e['body'],[_0x9ab7('0x69'),'id'])||{})['spread'](function(_0x3017bf){for(var _0x1be65c=0x0;_0x1be65c<_0x530c2e['body']['ids'][_0x9ab7('0x5c')];_0x1be65c+=0x1){socket[_0x9ab7('0x70')](_0x9ab7('0x71'),{'UserId':_0x530c2e['body'][_0x9ab7('0x69')][_0x1be65c],'SmsQueueId':_0x530c2e[_0x9ab7('0x4a')]['id']});}return _0x3017bf;});}})[_0x9ab7('0x25')](respondWithResult(_0x29ae8b,null))[_0x9ab7('0x53')](handleError(_0x29ae8b,null));};exports['removeAgents']=function(_0x1a0c41,_0x4f523f,_0x427287){var _0x33d508;return db[_0x9ab7('0x2e')][_0x9ab7('0x4b')]({'where':{'id':_0x1a0c41['params']['id']}})[_0x9ab7('0x25')](handleEntityNotFound(_0x4f523f,null))['then'](function(_0x200c4a){if(_0x200c4a){return _0x200c4a['removeAgents'](_0x1a0c41[_0x9ab7('0x32')][_0x9ab7('0x69')])['then'](function(_0x7ae50c){if(_[_0x9ab7('0x72')](_0x1a0c41[_0x9ab7('0x32')][_0x9ab7('0x69')])){for(var _0x562270=0x0;_0x562270<_0x1a0c41[_0x9ab7('0x32')][_0x9ab7('0x69')][_0x9ab7('0x5c')];_0x562270+=0x1){socket[_0x9ab7('0x70')](_0x9ab7('0x73'),{'UserId':_0x1a0c41[_0x9ab7('0x32')][_0x9ab7('0x69')][_0x562270],'SmsQueueId':_0x1a0c41['params']['id']});}}else{socket[_0x9ab7('0x70')](_0x9ab7('0x73'),{'UserId':_0x1a0c41[_0x9ab7('0x32')][_0x9ab7('0x69')],'SmsQueueId':_0x1a0c41[_0x9ab7('0x4a')]['id']});}});}})[_0x9ab7('0x25')](respondWithStatusCode(_0x4f523f,null))['catch'](handleError(_0x4f523f,null));};exports['getAgents']=function(_0x508177,_0x14afac,_0x3e36a5){var _0x4ec82c={};var _0x560f06={};var _0x531054;var _0x260015;return db[_0x9ab7('0x2e')][_0x9ab7('0x5a')]({'where':{'id':_0x508177[_0x9ab7('0x4a')]['id']}})[_0x9ab7('0x25')](handleEntityNotFound(_0x14afac,null))[_0x9ab7('0x25')](function(_0x2ffcfd){if(_0x2ffcfd){_0x531054=_0x2ffcfd;_0x560f06[_0x9ab7('0x30')]=_[_0x9ab7('0x31')](db['User'][_0x9ab7('0x2f')]);_0x560f06['query']=_[_0x9ab7('0x31')](_0x508177['query']);_0x560f06[_0x9ab7('0x33')]=_[_0x9ab7('0x34')](_0x560f06['model'],_0x560f06[_0x9ab7('0x32')]);_0x4ec82c[_0x9ab7('0x35')]=_[_0x9ab7('0x34')](_0x560f06[_0x9ab7('0x30')],qs[_0x9ab7('0x36')](_0x508177[_0x9ab7('0x32')][_0x9ab7('0x36')]));_0x4ec82c[_0x9ab7('0x35')]=_0x4ec82c[_0x9ab7('0x35')][_0x9ab7('0x5c')]?_0x4ec82c[_0x9ab7('0x35')]:_0x560f06[_0x9ab7('0x30')];_0x4ec82c[_0x9ab7('0x3a')]=qs[_0x9ab7('0x3b')](_0x508177[_0x9ab7('0x32')][_0x9ab7('0x3b')]);_0x4ec82c[_0x9ab7('0x3d')]=qs['filters'](_[_0x9ab7('0x3c')](_0x508177[_0x9ab7('0x32')],_0x560f06[_0x9ab7('0x33')]));if(_0x508177[_0x9ab7('0x32')]['filter']){_0x4ec82c[_0x9ab7('0x3d')]=_[_0x9ab7('0x3e')](_0x4ec82c[_0x9ab7('0x3d')],{'$or':_[_0x9ab7('0x3f')](_0x4ec82c[_0x9ab7('0x35')],function(_0x479bf1){var _0x5d5026={};_0x5d5026[_0x479bf1]={'$like':'%'+_0x508177[_0x9ab7('0x32')][_0x9ab7('0x43')]+'%'};return _0x5d5026;})});}_0x4ec82c=_[_0x9ab7('0x3e')]({},_0x4ec82c,_0x508177[_0x9ab7('0x44')]);return _0x531054[_0x9ab7('0x74')](_0x4ec82c);}})[_0x9ab7('0x25')](function(_0x18d7a3){if(_0x18d7a3){_0x260015=_0x18d7a3['length'];if(!_0x508177[_0x9ab7('0x32')][_0x9ab7('0x37')](_0x9ab7('0x38'))){_0x4ec82c[_0x9ab7('0x39')]=qs['limit'](_0x508177['query'][_0x9ab7('0x39')]);_0x4ec82c[_0x9ab7('0x20')]=qs['offset'](_0x508177['query']['offset']);}return _0x531054[_0x9ab7('0x74')](_0x4ec82c);}})['then'](function(_0x26f8c2){if(_0x26f8c2){return _0x26f8c2?{'count':_0x260015,'rows':_0x26f8c2}:null;}})['then'](respondWithResult(_0x14afac,null))['catch'](handleError(_0x14afac,null));}; \ No newline at end of file +var _0x5997=['sort','where','pick','filters','filter','merge','map','type','VIRTUAL','options','count','rows','params','includeAll','include','catch','create','body','role','user','SmsQueues','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserSmsQueue','nolimit','SmsQueueId','findAll','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','ids','Agents','union','addAgents','penalty','removeTeams','User','removeAgents','omit','userSmsQueue:save','isArray','emit','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','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','./smsQueue.socket','register','sendStatus','status','end','offset','limit','json','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','SmsQueue','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x5997,0xa8));var _0x7599=function(_0x11b5d5,_0x272aae){_0x11b5d5=_0x11b5d5-0x0;var _0xb632f9=_0x5997[_0x11b5d5];return _0xb632f9;};'use strict';var pdf=require(_0x7599('0x0'));var emlformat=require(_0x7599('0x1'));var rimraf=require(_0x7599('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7599('0x3'));var rp=require(_0x7599('0x4'));var moment=require(_0x7599('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7599('0x6'));var path=require(_0x7599('0x7'));var sox=require('sox');var csv=require(_0x7599('0x8'));var ejs=require(_0x7599('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7599('0xa'));var crypto=require(_0x7599('0xb'));var jsforce=require(_0x7599('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7599('0x8'));var querystring=require('querystring');var Papa=require(_0x7599('0xd'));var authService=require(_0x7599('0xe'));var hardwareService=require(_0x7599('0xf'));var Redis=require('ioredis');var qs=require(_0x7599('0x10'));var logger=require(_0x7599('0x11'))(_0x7599('0x12'));var utils=require(_0x7599('0x13'));var config=require(_0x7599('0x14'));var db=require(_0x7599('0x15'))['db'];config[_0x7599('0x16')]=_['defaults'](config[_0x7599('0x16')],{'host':_0x7599('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7599('0x16')]));require(_0x7599('0x18'))[_0x7599('0x19')](socket);function respondWithStatusCode(_0x4f5cae,_0x47c9ff){_0x47c9ff=_0x47c9ff||0xcc;return function(_0x25cfd1){if(_0x25cfd1){return _0x4f5cae[_0x7599('0x1a')](_0x47c9ff);}return _0x4f5cae[_0x7599('0x1b')](_0x47c9ff)[_0x7599('0x1c')]();};}function respondWithResult(_0x4c47d2,_0x63d2b7){_0x63d2b7=_0x63d2b7||0xc8;return function(_0x33ab60){if(_0x33ab60){return _0x4c47d2[_0x7599('0x1b')](_0x63d2b7)['json'](_0x33ab60);}};}function respondWithFilteredResult(_0xab644f,_0x23c695){return function(_0x325a31){if(_0x325a31){var _0x1e2e0a=_0x325a31['count'],_0xdb69a2=_0x23c695[_0x7599('0x1d')],_0x164795=_0x23c695[_0x7599('0x1d')]+_0x23c695[_0x7599('0x1e')],_0x1336e4;if(_0x164795>=_0x1e2e0a){_0x164795=_0x1e2e0a;_0x1336e4=0xc8;}else{_0x1336e4=0xce;}_0xab644f[_0x7599('0x1b')](_0x1336e4);return _0xab644f['set']('Content-Range',_0xdb69a2+'-'+_0x164795+'/'+_0x1e2e0a)[_0x7599('0x1f')](_0x325a31);}return null;};}function patchUpdates(_0x3f763f){return function(_0x5cedc4){try{jsonpatch[_0x7599('0x20')](_0x5cedc4,_0x3f763f,!![]);}catch(_0x1fde44){return BPromise[_0x7599('0x21')](_0x1fde44);}return _0x5cedc4[_0x7599('0x22')]();};}function saveUpdates(_0x2bb8f7,_0xd830e0){return function(_0x76baa0){if(_0x76baa0){return _0x76baa0[_0x7599('0x23')](_0x2bb8f7)[_0x7599('0x24')](function(_0x464bed){return _0x464bed;});}return null;};}function removeEntity(_0x598ff6,_0x190841){return function(_0x404650){if(_0x404650){return _0x404650['destroy']()[_0x7599('0x24')](function(){var _0x5d920f=_0x404650[_0x7599('0x25')]({'plain':!![]});var _0x458de8='SmsQueues';return db[_0x7599('0x26')][_0x7599('0x27')]({'where':{'type':_0x458de8,'resourceId':_0x5d920f['id']}})['then'](function(){return _0x404650;});})[_0x7599('0x24')](function(){_0x598ff6[_0x7599('0x1b')](0xcc)[_0x7599('0x1c')]();});}};}function handleEntityNotFound(_0x1de442,_0x4a6bd4){return function(_0x13db90){if(!_0x13db90){_0x1de442['sendStatus'](0x194);}return _0x13db90;};}function handleError(_0x5893c4,_0x2123a3){_0x2123a3=_0x2123a3||0x1f4;return function(_0x58505c){logger[_0x7599('0x28')](_0x58505c[_0x7599('0x29')]);if(_0x58505c[_0x7599('0x2a')]){delete _0x58505c[_0x7599('0x2a')];}_0x5893c4['status'](_0x2123a3)[_0x7599('0x2b')](_0x58505c);};}exports[_0x7599('0x2c')]=function(_0x144ecc,_0x38cece){var _0x592273={},_0x5b0dff={},_0x57daeb={'count':0x0,'rows':[]};var _0x38a6d7=db[_0x7599('0x2d')][_0x7599('0x2e')];_0x5b0dff[_0x7599('0x2f')]=_[_0x7599('0x30')](_0x38a6d7);_0x5b0dff[_0x7599('0x31')]=_['keys'](_0x144ecc[_0x7599('0x31')]);_0x5b0dff['filters']=_[_0x7599('0x32')](_0x5b0dff[_0x7599('0x2f')],_0x5b0dff['query']);_0x592273[_0x7599('0x33')]=_['intersection'](_0x5b0dff[_0x7599('0x2f')],qs[_0x7599('0x34')](_0x144ecc['query'][_0x7599('0x34')]));_0x592273[_0x7599('0x33')]=_0x592273[_0x7599('0x33')][_0x7599('0x35')]?_0x592273['attributes']:_0x5b0dff[_0x7599('0x2f')];if(!_0x144ecc[_0x7599('0x31')][_0x7599('0x36')]('nolimit')){_0x592273[_0x7599('0x1e')]=qs[_0x7599('0x1e')](_0x144ecc[_0x7599('0x31')][_0x7599('0x1e')]);_0x592273[_0x7599('0x1d')]=qs[_0x7599('0x1d')](_0x144ecc[_0x7599('0x31')][_0x7599('0x1d')]);}_0x592273[_0x7599('0x37')]=qs[_0x7599('0x38')](_0x144ecc[_0x7599('0x31')]['sort']);_0x592273[_0x7599('0x39')]=qs['filters'](_[_0x7599('0x3a')](_0x144ecc[_0x7599('0x31')],_0x5b0dff[_0x7599('0x3b')]));if(_0x144ecc['query'][_0x7599('0x3c')]){_0x592273[_0x7599('0x39')]=_[_0x7599('0x3d')](_0x592273[_0x7599('0x39')],{'$or':_[_0x7599('0x3e')](_0x38a6d7,function(_0x543998){if(_0x543998[_0x7599('0x3f')]['key']!==_0x7599('0x40')){var _0x487076={};_0x487076[_0x543998['field']]={'$like':'%'+_0x144ecc[_0x7599('0x31')][_0x7599('0x3c')]+'%'};return _0x487076;}})});}_0x592273=_['merge']({},_0x592273,_0x144ecc[_0x7599('0x41')]);var _0x119080={'where':_0x592273[_0x7599('0x39')]};return db[_0x7599('0x2d')][_0x7599('0x42')](_0x119080)[_0x7599('0x24')](function(_0x603411){_0x57daeb[_0x7599('0x42')]=_0x603411;if(_0x144ecc[_0x7599('0x31')]['includeAll']){_0x592273['include']=[{'all':!![]}];}return db[_0x7599('0x2d')]['findAll'](_0x592273);})['then'](function(_0x2c53cd){_0x57daeb[_0x7599('0x43')]=_0x2c53cd;return _0x57daeb;})[_0x7599('0x24')](respondWithFilteredResult(_0x38cece,_0x592273))['catch'](handleError(_0x38cece,null));};exports['show']=function(_0x15c2e3,_0x523c80){var _0x3bc983={'raw':!![],'where':{'id':_0x15c2e3[_0x7599('0x44')]['id']}},_0x3381e6={};_0x3381e6[_0x7599('0x2f')]=_[_0x7599('0x30')](db['SmsQueue'][_0x7599('0x2e')]);_0x3381e6[_0x7599('0x31')]=_[_0x7599('0x30')](_0x15c2e3[_0x7599('0x31')]);_0x3381e6[_0x7599('0x3b')]=_[_0x7599('0x32')](_0x3381e6[_0x7599('0x2f')],_0x3381e6[_0x7599('0x31')]);_0x3bc983[_0x7599('0x33')]=_[_0x7599('0x32')](_0x3381e6[_0x7599('0x2f')],qs[_0x7599('0x34')](_0x15c2e3[_0x7599('0x31')]['fields']));_0x3bc983['attributes']=_0x3bc983[_0x7599('0x33')]['length']?_0x3bc983[_0x7599('0x33')]:_0x3381e6['model'];if(_0x15c2e3[_0x7599('0x31')][_0x7599('0x45')]){_0x3bc983[_0x7599('0x46')]=[{'all':!![]}];}_0x3bc983=_[_0x7599('0x3d')]({},_0x3bc983,_0x15c2e3['options']);return db[_0x7599('0x2d')]['find'](_0x3bc983)[_0x7599('0x24')](handleEntityNotFound(_0x523c80,null))['then'](respondWithResult(_0x523c80,null))[_0x7599('0x47')](handleError(_0x523c80,null));};exports[_0x7599('0x48')]=function(_0x596612,_0x6d39f1){return db['SmsQueue'][_0x7599('0x48')](_0x596612[_0x7599('0x49')],{})[_0x7599('0x24')](function(_0xa19c61){var _0xb08a9b=_0x596612['user'][_0x7599('0x25')]({'plain':!![]});if(!_0xb08a9b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb08a9b[_0x7599('0x4a')]===_0x7599('0x4b')){var _0x4ddcfd=_0xa19c61[_0x7599('0x25')]({'plain':!![]});var _0xad549a=_0x7599('0x4c');return db[_0x7599('0x4d')][_0x7599('0x4e')]({'where':{'name':_0xad549a,'userProfileId':_0xb08a9b[_0x7599('0x4f')]},'raw':!![]})[_0x7599('0x24')](function(_0xbfa348){if(_0xbfa348&&_0xbfa348['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4ddcfd['name'],'resourceId':_0x4ddcfd['id'],'type':_0xbfa348[_0x7599('0x2a')],'sectionId':_0xbfa348['id']},{})['then'](function(){return _0xa19c61;});}else{return _0xa19c61;}})[_0x7599('0x47')](function(_0xcd5ad2){logger[_0x7599('0x28')](_0x7599('0x50'),_0xcd5ad2);throw _0xcd5ad2;});}return _0xa19c61;})['then'](respondWithResult(_0x6d39f1,0xc9))['catch'](handleError(_0x6d39f1,null));};exports['update']=function(_0x9412e3,_0x44e6fd){if(_0x9412e3[_0x7599('0x49')]['id']){delete _0x9412e3[_0x7599('0x49')]['id'];}return db[_0x7599('0x2d')][_0x7599('0x4e')]({'where':{'id':_0x9412e3[_0x7599('0x44')]['id']}})['then'](handleEntityNotFound(_0x44e6fd,null))['then'](saveUpdates(_0x9412e3[_0x7599('0x49')],null))[_0x7599('0x24')](respondWithResult(_0x44e6fd,null))[_0x7599('0x47')](handleError(_0x44e6fd,null));};exports[_0x7599('0x27')]=function(_0x2ffcc5,_0x26425c){return db[_0x7599('0x2d')][_0x7599('0x4e')]({'where':{'id':_0x2ffcc5[_0x7599('0x44')]['id']}})['then'](handleEntityNotFound(_0x26425c,null))[_0x7599('0x24')](removeEntity(_0x26425c,null))['catch'](handleError(_0x26425c,null));};exports[_0x7599('0x51')]=function(_0x256f75,_0x965ffe){return db[_0x7599('0x2d')][_0x7599('0x51')]()[_0x7599('0x24')](respondWithResult(_0x965ffe,null))[_0x7599('0x47')](handleError(_0x965ffe,null));};exports[_0x7599('0x52')]=function(_0x39bc26,_0x565f8b,_0x1ea6cc){var _0x109cd4={'raw':!![],'where':{}},_0x120ce2={},_0x36f87d;return db[_0x7599('0x2d')]['findOne']({'where':{'id':_0x39bc26['params']['id']}})[_0x7599('0x24')](handleEntityNotFound(_0x565f8b,null))['then'](function(_0x500248){if(_0x500248){_0x36f87d=_0x500248[_0x7599('0x25')]({'plain':!![]});_0x120ce2[_0x7599('0x2f')]=_[_0x7599('0x30')](db[_0x7599('0x53')][_0x7599('0x2e')]);_0x120ce2[_0x7599('0x31')]=_[_0x7599('0x30')](_0x39bc26[_0x7599('0x31')]);_0x120ce2['filters']=_[_0x7599('0x32')](_0x120ce2[_0x7599('0x2f')],_0x120ce2[_0x7599('0x31')]);_0x109cd4['attributes']=_[_0x7599('0x32')](_0x120ce2[_0x7599('0x2f')],qs[_0x7599('0x34')](_0x39bc26[_0x7599('0x31')][_0x7599('0x34')]));_0x109cd4[_0x7599('0x33')]=_0x109cd4[_0x7599('0x33')][_0x7599('0x35')]?_0x109cd4['attributes']:_0x120ce2[_0x7599('0x2f')];if(!_0x39bc26[_0x7599('0x31')][_0x7599('0x36')](_0x7599('0x54'))){_0x109cd4[_0x7599('0x1e')]=qs['limit'](_0x39bc26[_0x7599('0x31')]['limit']);_0x109cd4[_0x7599('0x1d')]=qs['offset'](_0x39bc26[_0x7599('0x31')][_0x7599('0x1d')]);}_0x109cd4[_0x7599('0x37')]=qs[_0x7599('0x38')](_0x39bc26[_0x7599('0x31')][_0x7599('0x38')]);_0x109cd4[_0x7599('0x39')]=qs['filters'](_[_0x7599('0x3a')](_0x39bc26['query'],_0x120ce2[_0x7599('0x3b')]));_0x109cd4[_0x7599('0x39')][_0x7599('0x55')]=_0x500248['id'];if(_0x39bc26[_0x7599('0x31')][_0x7599('0x3c')]){_0x109cd4[_0x7599('0x39')]=_['merge'](_0x109cd4['where'],{'$or':_[_0x7599('0x3e')](_0x109cd4[_0x7599('0x33')],function(_0x524d98){var _0x127644={};_0x127644[_0x524d98]={'$like':'%'+_0x39bc26[_0x7599('0x31')][_0x7599('0x3c')]+'%'};return _0x127644;})});}_0x109cd4=_['merge']({},_0x109cd4,_0x39bc26[_0x7599('0x41')]);return db['UserSmsQueue'][_0x7599('0x56')](_0x109cd4);}})[_0x7599('0x24')](function(_0x4216ca){if(_0x4216ca){return db['User'][_0x7599('0x57')]({'where':{'id':_[_0x7599('0x3e')](_0x4216ca,_0x7599('0x58')),'role':_0x7599('0x59')},'attributes':['id',_0x7599('0x2a'),_0x7599('0x5a'),_0x7599('0x5b'),_0x7599('0x5c')]});}})[_0x7599('0x24')](function(_0x1c9407){if(_0x1c9407){return{'count':_0x1c9407[_0x7599('0x42')],'rows':_['map'](_0x1c9407[_0x7599('0x43')],function(_0x125e6){return{'membername':_0x125e6[_0x7599('0x2a')],'UserId':_0x125e6['id'],'queue_name':_0x36f87d[_0x7599('0x2a')],'SmsQueueId':_0x36f87d['id'],'interface':util[_0x7599('0x5d')]('%s/%s',_0x7599('0x5e'),_0x125e6[_0x7599('0x2a')]),'penalty':0x0,'paused':_0x125e6[_0x7599('0x5a')],'createdAt':_0x125e6[_0x7599('0x5c')],'updatedAt':_0x125e6[_0x7599('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7599('0x24')](respondWithFilteredResult(_0x565f8b,_0x109cd4))[_0x7599('0x47')](handleError(_0x565f8b,null));};exports[_0x7599('0x5f')]=function(_0x1c31f9,_0x25d7cb,_0x5eacc1){var _0x4fb3c1={};var _0x2c2beb={};var _0x148aca;var _0x297332;return db[_0x7599('0x2d')][_0x7599('0x60')]({'where':{'id':_0x1c31f9[_0x7599('0x44')]['id']}})[_0x7599('0x24')](handleEntityNotFound(_0x25d7cb,null))[_0x7599('0x24')](function(_0x183591){if(_0x183591){_0x148aca=_0x183591;_0x2c2beb[_0x7599('0x2f')]=_[_0x7599('0x30')](db[_0x7599('0x61')]['rawAttributes']);_0x2c2beb['query']=_[_0x7599('0x30')](_0x1c31f9[_0x7599('0x31')]);_0x2c2beb['filters']=_['intersection'](_0x2c2beb[_0x7599('0x2f')],_0x2c2beb[_0x7599('0x31')]);_0x4fb3c1[_0x7599('0x33')]=_['intersection'](_0x2c2beb['model'],qs[_0x7599('0x34')](_0x1c31f9[_0x7599('0x31')]['fields']));_0x4fb3c1[_0x7599('0x33')]=_0x4fb3c1['attributes'][_0x7599('0x35')]?_0x4fb3c1['attributes']:_0x2c2beb[_0x7599('0x2f')];_0x4fb3c1[_0x7599('0x37')]=qs['sort'](_0x1c31f9[_0x7599('0x31')]['sort']);_0x4fb3c1[_0x7599('0x39')]=qs[_0x7599('0x3b')](_[_0x7599('0x3a')](_0x1c31f9[_0x7599('0x31')],_0x2c2beb[_0x7599('0x3b')]));if(_0x1c31f9['query'][_0x7599('0x3c')]){_0x4fb3c1[_0x7599('0x39')]=_[_0x7599('0x3d')](_0x4fb3c1[_0x7599('0x39')],{'$or':_[_0x7599('0x3e')](_0x4fb3c1[_0x7599('0x33')],function(_0x5abae5){var _0x23b09c={};_0x23b09c[_0x5abae5]={'$like':'%'+_0x1c31f9[_0x7599('0x31')]['filter']+'%'};return _0x23b09c;})});}_0x4fb3c1=_['merge']({},_0x4fb3c1,_0x1c31f9[_0x7599('0x41')]);return _0x148aca['getTeams'](_0x4fb3c1);}})[_0x7599('0x24')](function(_0x5bb7d1){if(_0x5bb7d1){_0x297332=_0x5bb7d1[_0x7599('0x35')];if(!_0x1c31f9[_0x7599('0x31')][_0x7599('0x36')](_0x7599('0x54'))){_0x4fb3c1[_0x7599('0x1e')]=qs[_0x7599('0x1e')](_0x1c31f9[_0x7599('0x31')][_0x7599('0x1e')]);_0x4fb3c1[_0x7599('0x1d')]=qs[_0x7599('0x1d')](_0x1c31f9[_0x7599('0x31')][_0x7599('0x1d')]);}return _0x148aca['getTeams'](_0x4fb3c1);}})[_0x7599('0x24')](function(_0x2b4fef){if(_0x2b4fef){return _0x2b4fef?{'count':_0x297332,'rows':_0x2b4fef}:null;}})[_0x7599('0x24')](respondWithResult(_0x25d7cb,null))['catch'](handleError(_0x25d7cb,null));};exports[_0x7599('0x62')]=function(_0x2680bd,_0x54a61c,_0x58b596){var _0x142320=[];var _0x2005db;return db[_0x7599('0x61')][_0x7599('0x56')]({'where':{'id':_0x2680bd[_0x7599('0x49')][_0x7599('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7599('0x64'),'attributes':['id'],'raw':!![]}]})[_0x7599('0x24')](function(_0x58af96){if(_0x58af96){for(var _0x2b0f40=0x0;_0x2b0f40<_0x58af96['length'];_0x2b0f40+=0x1){for(var _0x2c01d6=0x0;_0x2c01d6<_0x58af96[_0x2b0f40][_0x7599('0x64')][_0x7599('0x35')];_0x2c01d6+=0x1){_0x142320=_[_0x7599('0x65')](_0x142320,[_0x58af96[_0x2b0f40]['Agents'][_0x2c01d6]['id']]);}}return _0x142320;}})[_0x7599('0x24')](function(_0x517b45){if(_0x517b45){return db[_0x7599('0x2d')][_0x7599('0x4e')]({'where':{'id':_0x2680bd[_0x7599('0x44')]['id']}});}})[_0x7599('0x24')](function(_0x49d0de){if(_0x49d0de){_0x2005db=_0x49d0de;return _0x2005db[_0x7599('0x66')](_0x142320,{'penalty':_0x2680bd[_0x7599('0x49')][_0x7599('0x67')]});}})[_0x7599('0x24')](function(_0x234205){if(_0x234205){return _0x2005db[_0x7599('0x62')](_0x2680bd['body'][_0x7599('0x63')]);}})['then'](handleEntityNotFound(_0x54a61c,null))[_0x7599('0x24')](respondWithStatusCode(_0x54a61c,null))[_0x7599('0x47')](handleError(_0x54a61c,null));};exports[_0x7599('0x68')]=function(_0x5e84e5,_0x10514d,_0x4231bc){var _0x258592=[];var _0x4db9cd;return db[_0x7599('0x61')][_0x7599('0x56')]({'where':{'id':_0x5e84e5['query'][_0x7599('0x63')]},'attributes':['id'],'include':[{'model':db[_0x7599('0x69')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](function(_0x4fb5e3){if(_0x4fb5e3){for(var _0x3c19ec=0x0;_0x3c19ec<_0x4fb5e3[_0x7599('0x35')];_0x3c19ec+=0x1){for(var _0x5946e1=0x0;_0x5946e1<_0x4fb5e3[_0x3c19ec][_0x7599('0x64')][_0x7599('0x35')];_0x5946e1+=0x1){_0x258592=_['union'](_0x258592,[_0x4fb5e3[_0x3c19ec][_0x7599('0x64')][_0x5946e1]['id']]);}}return _0x258592;}})[_0x7599('0x24')](function(_0xbc1693){if(_0xbc1693){return db[_0x7599('0x2d')][_0x7599('0x4e')]({'where':{'id':_0x5e84e5['params']['id']}});}})['then'](function(_0x4127d3){if(_0x4127d3){_0x4db9cd=_0x4127d3;return _0x4db9cd[_0x7599('0x6a')](_0x258592);}})[_0x7599('0x24')](function(_0x3e6194){if(_0x4db9cd){return _0x4db9cd[_0x7599('0x68')](_0x5e84e5[_0x7599('0x31')][_0x7599('0x63')]);}})[_0x7599('0x24')](handleEntityNotFound(_0x10514d,null))[_0x7599('0x24')](respondWithStatusCode(_0x10514d,null))['catch'](handleError(_0x10514d,null));};exports['addAgents']=function(_0x31e4e8,_0x4a104f,_0x1798e7){return db['SmsQueue'][_0x7599('0x4e')]({'where':{'id':_0x31e4e8[_0x7599('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a104f,null))[_0x7599('0x24')](function(_0xda40f6){if(_0xda40f6){return _0xda40f6[_0x7599('0x66')](_0x31e4e8[_0x7599('0x49')][_0x7599('0x63')],_[_0x7599('0x6b')](_0x31e4e8[_0x7599('0x49')],[_0x7599('0x63'),'id'])||{})['spread'](function(_0x306574){for(var _0x58c37d=0x0;_0x58c37d<_0x31e4e8[_0x7599('0x49')][_0x7599('0x63')][_0x7599('0x35')];_0x58c37d+=0x1){socket['emit'](_0x7599('0x6c'),{'UserId':_0x31e4e8['body']['ids'][_0x58c37d],'SmsQueueId':_0x31e4e8[_0x7599('0x44')]['id']});}return _0x306574;});}})[_0x7599('0x24')](respondWithResult(_0x4a104f,null))['catch'](handleError(_0x4a104f,null));};exports[_0x7599('0x6a')]=function(_0xd41f0,_0x46624a,_0x3d28fa){var _0x55411d;return db[_0x7599('0x2d')]['find']({'where':{'id':_0xd41f0[_0x7599('0x44')]['id']}})['then'](handleEntityNotFound(_0x46624a,null))[_0x7599('0x24')](function(_0x27af85){if(_0x27af85){return _0x27af85[_0x7599('0x6a')](_0xd41f0[_0x7599('0x31')]['ids'])[_0x7599('0x24')](function(_0x56196b){if(_[_0x7599('0x6d')](_0xd41f0[_0x7599('0x31')][_0x7599('0x63')])){for(var _0x51a14d=0x0;_0x51a14d<_0xd41f0[_0x7599('0x31')][_0x7599('0x63')][_0x7599('0x35')];_0x51a14d+=0x1){socket[_0x7599('0x6e')]('userSmsQueue:remove',{'UserId':_0xd41f0[_0x7599('0x31')]['ids'][_0x51a14d],'SmsQueueId':_0xd41f0[_0x7599('0x44')]['id']});}}else{socket[_0x7599('0x6e')]('userSmsQueue:remove',{'UserId':_0xd41f0[_0x7599('0x31')][_0x7599('0x63')],'SmsQueueId':_0xd41f0['params']['id']});}});}})['then'](respondWithStatusCode(_0x46624a,null))[_0x7599('0x47')](handleError(_0x46624a,null));};exports[_0x7599('0x6f')]=function(_0x1cce1e,_0x6b336d,_0x411e4a){var _0x1ae7c2={};var _0x129ba2={};var _0x28ab57;var _0x1535b6;return db[_0x7599('0x2d')][_0x7599('0x60')]({'where':{'id':_0x1cce1e[_0x7599('0x44')]['id']}})[_0x7599('0x24')](handleEntityNotFound(_0x6b336d,null))[_0x7599('0x24')](function(_0x15a9f6){if(_0x15a9f6){_0x28ab57=_0x15a9f6;_0x129ba2[_0x7599('0x2f')]=_[_0x7599('0x30')](db[_0x7599('0x69')][_0x7599('0x2e')]);_0x129ba2['query']=_[_0x7599('0x30')](_0x1cce1e[_0x7599('0x31')]);_0x129ba2[_0x7599('0x3b')]=_['intersection'](_0x129ba2[_0x7599('0x2f')],_0x129ba2['query']);_0x1ae7c2[_0x7599('0x33')]=_[_0x7599('0x32')](_0x129ba2[_0x7599('0x2f')],qs[_0x7599('0x34')](_0x1cce1e[_0x7599('0x31')][_0x7599('0x34')]));_0x1ae7c2[_0x7599('0x33')]=_0x1ae7c2[_0x7599('0x33')]['length']?_0x1ae7c2['attributes']:_0x129ba2['model'];_0x1ae7c2['order']=qs[_0x7599('0x38')](_0x1cce1e[_0x7599('0x31')][_0x7599('0x38')]);_0x1ae7c2[_0x7599('0x39')]=qs[_0x7599('0x3b')](_['pick'](_0x1cce1e[_0x7599('0x31')],_0x129ba2[_0x7599('0x3b')]));if(_0x1cce1e[_0x7599('0x31')][_0x7599('0x3c')]){_0x1ae7c2['where']=_[_0x7599('0x3d')](_0x1ae7c2['where'],{'$or':_['map'](_0x1ae7c2[_0x7599('0x33')],function(_0x4d3732){var _0x376f36={};_0x376f36[_0x4d3732]={'$like':'%'+_0x1cce1e['query'][_0x7599('0x3c')]+'%'};return _0x376f36;})});}_0x1ae7c2=_['merge']({},_0x1ae7c2,_0x1cce1e[_0x7599('0x41')]);return _0x28ab57['getAgents'](_0x1ae7c2);}})['then'](function(_0x5cd8be){if(_0x5cd8be){_0x1535b6=_0x5cd8be[_0x7599('0x35')];if(!_0x1cce1e[_0x7599('0x31')][_0x7599('0x36')]('nolimit')){_0x1ae7c2[_0x7599('0x1e')]=qs[_0x7599('0x1e')](_0x1cce1e[_0x7599('0x31')]['limit']);_0x1ae7c2[_0x7599('0x1d')]=qs['offset'](_0x1cce1e[_0x7599('0x31')][_0x7599('0x1d')]);}return _0x28ab57[_0x7599('0x6f')](_0x1ae7c2);}})['then'](function(_0x367419){if(_0x367419){return _0x367419?{'count':_0x1535b6,'rows':_0x367419}:null;}})['then'](respondWithResult(_0x6b336d,null))[_0x7599('0x47')](handleError(_0x6b336d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index db27532..3085443 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 _0x149f=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x149f,0xcd));var _0xf149=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x149f[_0x1a36a5];return _0x746243;};'use strict';var EventEmitter=require(_0xf149('0x0'));var SmsQueue=require(_0xf149('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf149('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf149('0x3')};function emitEvent(_0x5405ab){return function(_0x2082f7,_0x397b9,_0x48547c){SmsQueueEvents[_0xf149('0x4')](_0x5405ab+':'+_0x2082f7['id'],_0x2082f7);SmsQueueEvents[_0xf149('0x4')](_0x5405ab,_0x2082f7);_0x48547c(null);};}for(var e in events){if(events[_0xf149('0x5')](e)){var event=events[e];SmsQueue[_0xf149('0x6')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x53dd=['SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3ada16,_0x3c84c1){var _0x34395a=function(_0x246020){while(--_0x246020){_0x3ada16['push'](_0x3ada16['shift']());}};_0x34395a(++_0x3c84c1);}(_0x53dd,0xc6));var _0xd53d=function(_0x3b5f65,_0x4c7b24){_0x3b5f65=_0x3b5f65-0x0;var _0x106028=_0x53dd[_0x3b5f65];return _0x106028;};'use strict';var EventEmitter=require(_0xd53d('0x0'));var SmsQueue=require(_0xd53d('0x1'))['db'][_0xd53d('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd53d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd53d('0x4'),'afterDestroy':_0xd53d('0x5')};function emitEvent(_0x2786d0){return function(_0x3c5f23,_0x506fbd,_0x780812){SmsQueueEvents[_0xd53d('0x6')](_0x2786d0+':'+_0x3c5f23['id'],_0x3c5f23);SmsQueueEvents[_0xd53d('0x6')](_0x2786d0,_0x3c5f23);_0x780812(null);};}for(var e in events){if(events[_0xd53d('0x7')](e)){var event=events[e];SmsQueue[_0xd53d('0x8')](e,emitEvent(event));}}module[_0xd53d('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 651cf3d..83f3170 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 _0x8c76=['./smsQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x26f00c,_0x36be08){var _0x185972=function(_0x5f31ad){while(--_0x5f31ad){_0x26f00c['push'](_0x26f00c['shift']());}};_0x185972(++_0x36be08);}(_0x8c76,0x17d));var _0x68c7=function(_0x446504,_0x4842e2){_0x446504=_0x446504-0x0;var _0x3365b3=_0x8c76[_0x446504];return _0x3365b3;};'use strict';var _=require(_0x68c7('0x0'));var util=require(_0x68c7('0x1'));var logger=require(_0x68c7('0x2'))(_0x68c7('0x3'));var moment=require(_0x68c7('0x4'));var BPromise=require(_0x68c7('0x5'));var rp=require('request-promise');var attributes=require(_0x68c7('0x6'));module[_0x68c7('0x7')]=function(_0x5225cf,_0x3d6b02){return _0x5225cf[_0x68c7('0x8')]('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e70=['define','SmsQueue','sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','exports'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0x6e70,0x143));var _0x06e7=function(_0x346adc,_0x594fe8){_0x346adc=_0x346adc-0x0;var _0x145200=_0x6e70[_0x346adc];return _0x145200;};'use strict';var _=require(_0x06e7('0x0'));var util=require(_0x06e7('0x1'));var logger=require(_0x06e7('0x2'))('api');var moment=require(_0x06e7('0x3'));var BPromise=require(_0x06e7('0x4'));var rp=require(_0x06e7('0x5'));var attributes=require('./smsQueue.attributes');module[_0x06e7('0x6')]=function(_0x3e8a75,_0xdeefca){return _0x3e8a75[_0x06e7('0x7')](_0x06e7('0x8'),attributes,{'tableName':_0x06e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 759a0b5..1001718 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 _0x5ecc=['include','map','model','find','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','./smsQueue.socket','request','then','SmsQueue,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit'];(function(_0xd3b527,_0x435140){var _0x25154b=function(_0x3121fb){while(--_0x3121fb){_0xd3b527['push'](_0xd3b527['shift']());}};_0x25154b(++_0x435140);}(_0x5ecc,0x177));var _0xc5ec=function(_0x102470,_0x199a01){_0x102470=_0x102470-0x0;var _0x558eaa=_0x5ecc[_0x102470];return _0x558eaa;};'use strict';var _=require(_0xc5ec('0x0'));var util=require(_0xc5ec('0x1'));var moment=require(_0xc5ec('0x2'));var BPromise=require(_0xc5ec('0x3'));var rs=require(_0xc5ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc5ec('0x5'));var logger=require(_0xc5ec('0x6'))(_0xc5ec('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc5ec('0x8')][_0xc5ec('0x9')]({'port':0x232a});config['redis']=_[_0xc5ec('0xa')](config[_0xc5ec('0xb')],{'host':_0xc5ec('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc5ec('0xb')]));require(_0xc5ec('0xd'))['register'](socket);function respondWithRpcPromise(_0x525fe2,_0x331a15,_0x7e0e7a){return new BPromise(function(_0x33d8b3,_0x34b393){return client[_0xc5ec('0xe')](_0x525fe2,_0x7e0e7a)[_0xc5ec('0xf')](function(_0x24d9e3){logger['info'](_0xc5ec('0x10'),_0x331a15,'request\x20sent');logger[_0xc5ec('0x11')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x331a15,'request\x20sent',JSON[_0xc5ec('0x12')](_0x24d9e3));if(_0x24d9e3['error']){if(_0x24d9e3[_0xc5ec('0x13')]['code']===0x1f4){logger[_0xc5ec('0x13')](_0xc5ec('0x10'),_0x331a15,_0x24d9e3[_0xc5ec('0x13')][_0xc5ec('0x14')]);return _0x34b393(_0x24d9e3['error'][_0xc5ec('0x14')]);}logger[_0xc5ec('0x13')]('SmsQueue,\x20%s,\x20%s',_0x331a15,_0x24d9e3['error'][_0xc5ec('0x14')]);return _0x33d8b3(_0x24d9e3['error']['message']);}else{logger[_0xc5ec('0x15')]('SmsQueue,\x20%s,\x20%s',_0x331a15,_0xc5ec('0x16'));_0x33d8b3(_0x24d9e3['result'][_0xc5ec('0x14')]);}})[_0xc5ec('0x17')](function(_0x583af3){logger['error'](_0xc5ec('0x10'),_0x331a15,_0x583af3);_0x34b393(_0x583af3);});});}exports[_0xc5ec('0x18')]=function(_0x449888){var _0x222c73=this;return new Promise(function(_0x28a63a,_0x214471){return db[_0xc5ec('0x19')][_0xc5ec('0x1a')]({'raw':_0x449888['options']?_0x449888[_0xc5ec('0x1b')][_0xc5ec('0x1c')]===undefined?!![]:![]:!![],'where':_0x449888['options']?_0x449888['options'][_0xc5ec('0x1d')]||null:null,'attributes':_0x449888[_0xc5ec('0x1b')]?_0x449888['options'][_0xc5ec('0x1e')]||null:null,'limit':_0x449888['options']?_0x449888[_0xc5ec('0x1b')][_0xc5ec('0x1f')]||null:null,'include':_0x449888[_0xc5ec('0x1b')]?_0x449888[_0xc5ec('0x1b')][_0xc5ec('0x20')]?_[_0xc5ec('0x21')](_0x449888[_0xc5ec('0x1b')]['include'],function(_0x1f7728){return{'model':db[_0x1f7728['model']],'as':_0x1f7728['as'],'attributes':_0x1f7728[_0xc5ec('0x1e')],'include':_0x1f7728[_0xc5ec('0x20')]?_['map'](_0x1f7728[_0xc5ec('0x20')],function(_0x19b212){return{'model':db[_0x19b212['model']],'as':_0x19b212['as'],'attributes':_0x19b212[_0xc5ec('0x1e')],'include':_0x19b212[_0xc5ec('0x20')]?_[_0xc5ec('0x21')](_0x19b212['include'],function(_0x34d556){return{'model':db[_0x34d556[_0xc5ec('0x22')]],'as':_0x34d556['as'],'attributes':_0x34d556['attributes']};}):[]};}):[]};}):[]:[]})[_0xc5ec('0xf')](function(_0x12dd52){logger[_0xc5ec('0x15')](_0xc5ec('0x18'),_0x449888);logger[_0xc5ec('0x11')](_0xc5ec('0x18'),_0x449888,JSON[_0xc5ec('0x12')](_0x12dd52));_0x28a63a(_0x12dd52);})['catch'](function(_0x2022e5){logger[_0xc5ec('0x13')](_0xc5ec('0x18'),_0x2022e5[_0xc5ec('0x14')],_0x449888);_0x214471(_0x222c73[_0xc5ec('0x13')](0x1f4,_0x2022e5[_0xc5ec('0x14')]));});});};exports['ShowSmsQueue']=function(_0x537d28){var _0x116538=this;return new Promise(function(_0x3fbb75,_0x5413ef){return db[_0xc5ec('0x19')][_0xc5ec('0x23')]({'raw':_0x537d28[_0xc5ec('0x1b')]?_0x537d28[_0xc5ec('0x1b')][_0xc5ec('0x1c')]===undefined?!![]:![]:!![],'where':_0x537d28[_0xc5ec('0x1b')]?_0x537d28[_0xc5ec('0x1b')][_0xc5ec('0x1d')]||null:null,'attributes':_0x537d28[_0xc5ec('0x1b')]?_0x537d28[_0xc5ec('0x1b')]['attributes']||null:null,'include':_0x537d28['options']?_0x537d28[_0xc5ec('0x1b')]['include']?_['map'](_0x537d28['options']['include'],function(_0x251f43){return{'model':db[_0x251f43[_0xc5ec('0x22')]],'as':_0x251f43['as'],'attributes':_0x251f43['attributes'],'include':_0x251f43[_0xc5ec('0x20')]?_[_0xc5ec('0x21')](_0x251f43[_0xc5ec('0x20')],function(_0x5aeb7a){return{'model':db[_0x5aeb7a[_0xc5ec('0x22')]],'as':_0x5aeb7a['as'],'attributes':_0x5aeb7a[_0xc5ec('0x1e')],'include':_0x5aeb7a[_0xc5ec('0x20')]?_[_0xc5ec('0x21')](_0x5aeb7a[_0xc5ec('0x20')],function(_0x26a490){return{'model':db[_0x26a490[_0xc5ec('0x22')]],'as':_0x26a490['as'],'attributes':_0x26a490[_0xc5ec('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc5ec('0xf')](function(_0xc2c016){logger['info'](_0xc5ec('0x24'),_0x537d28);logger['debug'](_0xc5ec('0x24'),_0x537d28,JSON[_0xc5ec('0x12')](_0xc2c016));_0x3fbb75(_0xc2c016);})['catch'](function(_0x1a9b0f){logger['error']('ShowSmsQueue',_0x1a9b0f[_0xc5ec('0x14')],_0x537d28);_0x5413ef(_0x116538['error'](0x1f4,_0x1a9b0f['message']));});});}; \ No newline at end of file +var _0xbc0e=['SmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','GetSmsQueue','debug','stringify','ShowSmsQueue','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch'];(function(_0x5722b5,_0x4c5f26){var _0x32ac18=function(_0x305226){while(--_0x305226){_0x5722b5['push'](_0x5722b5['shift']());}};_0x32ac18(++_0x4c5f26);}(_0xbc0e,0x104));var _0xebc0=function(_0x200af1,_0x4f3801){_0x200af1=_0x200af1-0x0;var _0x181431=_0xbc0e[_0x200af1];return _0x181431;};'use strict';var _=require(_0xebc0('0x0'));var util=require(_0xebc0('0x1'));var moment=require('moment');var BPromise=require(_0xebc0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebc0('0x3'))['db'];var utils=require(_0xebc0('0x4'));var logger=require(_0xebc0('0x5'))(_0xebc0('0x6'));var config=require(_0xebc0('0x7'));var jayson=require(_0xebc0('0x8'));var client=jayson[_0xebc0('0x9')][_0xebc0('0xa')]({'port':0x232a});config[_0xebc0('0xb')]=_[_0xebc0('0xc')](config['redis'],{'host':_0xebc0('0xd'),'port':0x18eb});var socket=require(_0xebc0('0xe'))(new Redis(config[_0xebc0('0xb')]));require(_0xebc0('0xf'))[_0xebc0('0x10')](socket);function respondWithRpcPromise(_0x26593d,_0x3b360a,_0x233cd7){return new BPromise(function(_0x47bd34,_0x3a3954){return client[_0xebc0('0x11')](_0x26593d,_0x233cd7)[_0xebc0('0x12')](function(_0x4601a4){logger[_0xebc0('0x13')](_0xebc0('0x14'),_0x3b360a,'request\x20sent');logger['debug'](_0xebc0('0x15'),_0x3b360a,_0xebc0('0x16'),JSON['stringify'](_0x4601a4));if(_0x4601a4[_0xebc0('0x17')]){if(_0x4601a4[_0xebc0('0x17')][_0xebc0('0x18')]===0x1f4){logger[_0xebc0('0x17')]('SmsQueue,\x20%s,\x20%s',_0x3b360a,_0x4601a4[_0xebc0('0x17')][_0xebc0('0x19')]);return _0x3a3954(_0x4601a4['error']['message']);}logger[_0xebc0('0x17')](_0xebc0('0x14'),_0x3b360a,_0x4601a4[_0xebc0('0x17')][_0xebc0('0x19')]);return _0x47bd34(_0x4601a4['error'][_0xebc0('0x19')]);}else{logger[_0xebc0('0x13')](_0xebc0('0x14'),_0x3b360a,_0xebc0('0x16'));_0x47bd34(_0x4601a4['result'][_0xebc0('0x19')]);}})[_0xebc0('0x1a')](function(_0x29a422){logger[_0xebc0('0x17')](_0xebc0('0x14'),_0x3b360a,_0x29a422);_0x3a3954(_0x29a422);});});}exports['GetSmsQueue']=function(_0xbf4c60){var _0x4b3d41=this;return new Promise(function(_0xdcdfd4,_0x3fe5d4){return db[_0xebc0('0x1b')][_0xebc0('0x1c')]({'raw':_0xbf4c60[_0xebc0('0x1d')]?_0xbf4c60[_0xebc0('0x1d')][_0xebc0('0x1e')]===undefined?!![]:![]:!![],'where':_0xbf4c60[_0xebc0('0x1d')]?_0xbf4c60[_0xebc0('0x1d')][_0xebc0('0x1f')]||null:null,'attributes':_0xbf4c60['options']?_0xbf4c60[_0xebc0('0x1d')][_0xebc0('0x20')]||null:null,'limit':_0xbf4c60[_0xebc0('0x1d')]?_0xbf4c60[_0xebc0('0x1d')][_0xebc0('0x21')]||null:null,'include':_0xbf4c60['options']?_0xbf4c60[_0xebc0('0x1d')]['include']?_[_0xebc0('0x22')](_0xbf4c60[_0xebc0('0x1d')]['include'],function(_0x48c897){return{'model':db[_0x48c897['model']],'as':_0x48c897['as'],'attributes':_0x48c897['attributes'],'include':_0x48c897[_0xebc0('0x23')]?_[_0xebc0('0x22')](_0x48c897[_0xebc0('0x23')],function(_0x1f6efd){return{'model':db[_0x1f6efd[_0xebc0('0x24')]],'as':_0x1f6efd['as'],'attributes':_0x1f6efd[_0xebc0('0x20')],'include':_0x1f6efd[_0xebc0('0x23')]?_[_0xebc0('0x22')](_0x1f6efd[_0xebc0('0x23')],function(_0x5b4c3b){return{'model':db[_0x5b4c3b[_0xebc0('0x24')]],'as':_0x5b4c3b['as'],'attributes':_0x5b4c3b[_0xebc0('0x20')]};}):[]};}):[]};}):[]:[]})[_0xebc0('0x12')](function(_0x4d9a42){logger[_0xebc0('0x13')](_0xebc0('0x25'),_0xbf4c60);logger[_0xebc0('0x26')](_0xebc0('0x25'),_0xbf4c60,JSON[_0xebc0('0x27')](_0x4d9a42));_0xdcdfd4(_0x4d9a42);})[_0xebc0('0x1a')](function(_0x403ae5){logger[_0xebc0('0x17')](_0xebc0('0x25'),_0x403ae5[_0xebc0('0x19')],_0xbf4c60);_0x3fe5d4(_0x4b3d41[_0xebc0('0x17')](0x1f4,_0x403ae5['message']));});});};exports[_0xebc0('0x28')]=function(_0x7c48a){var _0x10800c=this;return new Promise(function(_0x11169b,_0x1bc577){return db[_0xebc0('0x1b')]['find']({'raw':_0x7c48a[_0xebc0('0x1d')]?_0x7c48a[_0xebc0('0x1d')][_0xebc0('0x1e')]===undefined?!![]:![]:!![],'where':_0x7c48a[_0xebc0('0x1d')]?_0x7c48a[_0xebc0('0x1d')][_0xebc0('0x1f')]||null:null,'attributes':_0x7c48a[_0xebc0('0x1d')]?_0x7c48a[_0xebc0('0x1d')][_0xebc0('0x20')]||null:null,'include':_0x7c48a[_0xebc0('0x1d')]?_0x7c48a[_0xebc0('0x1d')][_0xebc0('0x23')]?_['map'](_0x7c48a[_0xebc0('0x1d')][_0xebc0('0x23')],function(_0x9d3c17){return{'model':db[_0x9d3c17[_0xebc0('0x24')]],'as':_0x9d3c17['as'],'attributes':_0x9d3c17[_0xebc0('0x20')],'include':_0x9d3c17[_0xebc0('0x23')]?_[_0xebc0('0x22')](_0x9d3c17[_0xebc0('0x23')],function(_0x3dca37){return{'model':db[_0x3dca37['model']],'as':_0x3dca37['as'],'attributes':_0x3dca37[_0xebc0('0x20')],'include':_0x3dca37[_0xebc0('0x23')]?_[_0xebc0('0x22')](_0x3dca37[_0xebc0('0x23')],function(_0x46f2aa){return{'model':db[_0x46f2aa[_0xebc0('0x24')]],'as':_0x46f2aa['as'],'attributes':_0x46f2aa['attributes']};}):[]};}):[]};}):[]:[]})[_0xebc0('0x12')](function(_0x21e1ba){logger[_0xebc0('0x13')](_0xebc0('0x28'),_0x7c48a);logger[_0xebc0('0x26')](_0xebc0('0x28'),_0x7c48a,JSON[_0xebc0('0x27')](_0x21e1ba));_0x11169b(_0x21e1ba);})[_0xebc0('0x1a')](function(_0x204bda){logger['error']('ShowSmsQueue',_0x204bda[_0xebc0('0x19')],_0x7c48a);_0x1bc577(_0x10800c[_0xebc0('0x17')](0x1f4,_0x204bda[_0xebc0('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 54f8354..5056e8e 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 _0x2178=['update','emit','removeListener','register','length','./smsQueue.events','remove'];(function(_0x56dd81,_0x11a149){var _0x5605a9=function(_0x26f720){while(--_0x26f720){_0x56dd81['push'](_0x56dd81['shift']());}};_0x5605a9(++_0x11a149);}(_0x2178,0x1b0));var _0x8217=function(_0xf83ffc,_0x37e10c){_0xf83ffc=_0xf83ffc-0x0;var _0x2509a4=_0x2178[_0xf83ffc];return _0x2509a4;};'use strict';var SmsQueueEvents=require(_0x8217('0x0'));var events=['save',_0x8217('0x1'),_0x8217('0x2')];function createListener(_0x450e40,_0x57d3ef){return function(_0x380de2){_0x57d3ef[_0x8217('0x3')](_0x450e40,_0x380de2);};}function removeListener(_0x4f5702,_0x3b4e8a){return function(){SmsQueueEvents[_0x8217('0x4')](_0x4f5702,_0x3b4e8a);};}exports[_0x8217('0x5')]=function(_0x16da6e){for(var _0x18f4bd=0x0,_0x6938ca=events[_0x8217('0x6')];_0x18f4bd<_0x6938ca;_0x18f4bd++){var _0x1cddd1=events[_0x18f4bd];var _0x67d6b2=createListener('smsQueue:'+_0x1cddd1,_0x16da6e);SmsQueueEvents['on'](_0x1cddd1,_0x67d6b2);}}; \ No newline at end of file +var _0xa9f3=['register','smsQueue:','./smsQueue.events','save','update','emit','removeListener'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xa9f3,0x1de));var _0x3a9f=function(_0x4f10a7,_0x1d52a7){_0x4f10a7=_0x4f10a7-0x0;var _0x33cf4a=_0xa9f3[_0x4f10a7];return _0x33cf4a;};'use strict';var SmsQueueEvents=require(_0x3a9f('0x0'));var events=[_0x3a9f('0x1'),'remove',_0x3a9f('0x2')];function createListener(_0xd925b9,_0x5af71e){return function(_0x5580e1){_0x5af71e[_0x3a9f('0x3')](_0xd925b9,_0x5580e1);};}function removeListener(_0x2b7836,_0x50d15e){return function(){SmsQueueEvents[_0x3a9f('0x4')](_0x2b7836,_0x50d15e);};}exports[_0x3a9f('0x5')]=function(_0x3700ab){for(var _0x502670=0x0,_0x4c5243=events['length'];_0x502670<_0x4c5243;_0x502670++){var _0xdfddfc=events[_0x502670];var _0x29e993=createListener(_0x3a9f('0x6')+_0xdfddfc,_0x3700ab);SmsQueueEvents['on'](_0xdfddfc,_0x29e993);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index b18d4cc..4d6f3b4 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 _0xee8f=['express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','util','connect-timeout'];(function(_0x5f3de3,_0x40f0f5){var _0x287e0d=function(_0x3189dc){while(--_0x3189dc){_0x5f3de3['push'](_0x5f3de3['shift']());}};_0x287e0d(++_0x40f0f5);}(_0xee8f,0x1ed));var _0xfee8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xee8f[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0xfee8('0x0'));var path=require('path');var timeout=require(_0xfee8('0x1'));var express=require(_0xfee8('0x2'));var router=express[_0xfee8('0x3')]();var auth=require(_0xfee8('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0xfee8('0x5')]('/',auth[_0xfee8('0x6')](),controller[_0xfee8('0x7')]);router['get'](_0xfee8('0x8'),auth[_0xfee8('0x6')](),controller['describe']);router['get'](_0xfee8('0x9'),auth[_0xfee8('0x6')](),controller[_0xfee8('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfee8('0xb')]);router[_0xfee8('0xc')](_0xfee8('0x9'),auth[_0xfee8('0x6')](),controller[_0xfee8('0xd')]);router[_0xfee8('0xe')](_0xfee8('0x9'),auth[_0xfee8('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x16ce=['path','connect-timeout','express','Router','../../components/auth/service','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','util'];(function(_0x54ff68,_0x419415){var _0x418e73=function(_0x5241fd){while(--_0x5241fd){_0x54ff68['push'](_0x54ff68['shift']());}};_0x418e73(++_0x419415);}(_0x16ce,0xfb));var _0xe16c=function(_0x1eb17b,_0x218215){_0x1eb17b=_0x1eb17b-0x0;var _0x2ec548=_0x16ce[_0x1eb17b];return _0x2ec548;};'use strict';var multer=require('multer');var util=require(_0xe16c('0x0'));var path=require(_0xe16c('0x1'));var timeout=require(_0xe16c('0x2'));var express=require(_0xe16c('0x3'));var router=express[_0xe16c('0x4')]();var auth=require(_0xe16c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0xe16c('0x6')]('/',auth['isAuthenticated'](),controller[_0xe16c('0x7')]);router[_0xe16c('0x6')](_0xe16c('0x8'),auth[_0xe16c('0x9')](),controller[_0xe16c('0xa')]);router[_0xe16c('0x6')](_0xe16c('0xb'),auth[_0xe16c('0x9')](),controller['show']);router[_0xe16c('0xc')]('/',auth[_0xe16c('0x9')](),controller[_0xe16c('0xd')]);router[_0xe16c('0xe')](_0xe16c('0xb'),auth[_0xe16c('0x9')](),controller[_0xe16c('0xf')]);router[_0xe16c('0x10')](_0xe16c('0xb'),auth[_0xe16c('0x9')](),controller[_0xe16c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 0a84a30..ba4e7bf 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 _0xb6ce=['STRING','sequelize','DATE'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb6ce,0x166));var _0xeb6c=function(_0x4e122e,_0x4a8ccc){_0x4e122e=_0x4e122e-0x0;var _0x37bda3=_0xb6ce[_0x4e122e];return _0x37bda3;};'use strict';var moment=require('moment');var Sequelize=require(_0xeb6c('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xeb6c('0x1')]},'leaveAt':{'type':Sequelize[_0xeb6c('0x1')]},'acceptAt':{'type':Sequelize[_0xeb6c('0x1')]},'exitAt':{'type':Sequelize[_0xeb6c('0x1')]},'reason':{'type':Sequelize[_0xeb6c('0x2')]}}; \ No newline at end of file +var _0xa42e=['sequelize','STRING','DATE'];(function(_0x101842,_0x4db31b){var _0x45ce04=function(_0x1754a3){while(--_0x1754a3){_0x101842['push'](_0x101842['shift']());}};_0x45ce04(++_0x4db31b);}(_0xa42e,0x144));var _0xea42=function(_0x12d9de,_0x585f37){_0x12d9de=_0x12d9de-0x0;var _0x47eea4=_0xa42e[_0x12d9de];return _0x47eea4;};'use strict';var moment=require('moment');var Sequelize=require(_0xea42('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xea42('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xea42('0x1')]},'joinAt':{'type':Sequelize[_0xea42('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xea42('0x2')]},'exitAt':{'type':Sequelize[_0xea42('0x2')]},'reason':{'type':Sequelize[_0xea42('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 0cab8d3..3f22051 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 _0xe6c1=['merge','map','key','VIRTUAL','field','filter','options','SmsQueueReport','includeAll','findAll','catch','show','include','create','body','update','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','apply','reject','then','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick'];(function(_0x4336c3,_0x2ea0fd){var _0x36c96b=function(_0x4db083){while(--_0x4db083){_0x4336c3['push'](_0x4336c3['shift']());}};_0x36c96b(++_0x2ea0fd);}(_0xe6c1,0x12b));var _0x1e6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6c1[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x1e6c('0x0'));var emlformat=require(_0x1e6c('0x1'));var rimraf=require(_0x1e6c('0x2'));var zipdir=require(_0x1e6c('0x3'));var jsonpatch=require(_0x1e6c('0x4'));var rp=require('request-promise');var moment=require(_0x1e6c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1e6c('0x6'));var util=require('util');var path=require(_0x1e6c('0x7'));var sox=require(_0x1e6c('0x8'));var csv=require(_0x1e6c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1e6c('0xa'));var squel=require('squel');var crypto=require(_0x1e6c('0xb'));var jsforce=require(_0x1e6c('0xc'));var deskjs=require(_0x1e6c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1e6c('0xe'));var Papa=require(_0x1e6c('0xf'));var authService=require(_0x1e6c('0x10'));var hardwareService=require(_0x1e6c('0x11'));var Redis=require('ioredis');var qs=require(_0x1e6c('0x12'));var logger=require(_0x1e6c('0x13'))(_0x1e6c('0x14'));var utils=require(_0x1e6c('0x15'));var config=require('../../config/environment');var db=require(_0x1e6c('0x16'))['db'];function respondWithStatusCode(_0x4a0a06,_0x36126a){_0x36126a=_0x36126a||0xcc;return function(_0x5d3abd){if(_0x5d3abd){return _0x4a0a06[_0x1e6c('0x17')](_0x36126a);}return _0x4a0a06[_0x1e6c('0x18')](_0x36126a)[_0x1e6c('0x19')]();};}function respondWithResult(_0x5df522,_0x4d43f9){_0x4d43f9=_0x4d43f9||0xc8;return function(_0x4c434e){if(_0x4c434e){return _0x5df522[_0x1e6c('0x18')](_0x4d43f9)['json'](_0x4c434e);}};}function respondWithFilteredResult(_0x310c3e,_0x4c51ad){return function(_0x53ae33){if(_0x53ae33){var _0x1276da=_0x53ae33[_0x1e6c('0x1a')],_0x35771b=_0x4c51ad[_0x1e6c('0x1b')],_0xadb39b=_0x4c51ad[_0x1e6c('0x1b')]+_0x4c51ad[_0x1e6c('0x1c')],_0x475a0f;if(_0xadb39b>=_0x1276da){_0xadb39b=_0x1276da;_0x475a0f=0xc8;}else{_0x475a0f=0xce;}_0x310c3e[_0x1e6c('0x18')](_0x475a0f);return _0x310c3e[_0x1e6c('0x1d')]('Content-Range',_0x35771b+'-'+_0xadb39b+'/'+_0x1276da)['json'](_0x53ae33);}return null;};}function patchUpdates(_0xa409fa){return function(_0x5eeafc){try{jsonpatch[_0x1e6c('0x1e')](_0x5eeafc,_0xa409fa,!![]);}catch(_0x3779ac){return BPromise[_0x1e6c('0x1f')](_0x3779ac);}return _0x5eeafc['save']();};}function saveUpdates(_0x4a2c04,_0x3ca42e){return function(_0x3c405d){if(_0x3c405d){return _0x3c405d['update'](_0x4a2c04)[_0x1e6c('0x20')](function(_0x456ee6){return _0x456ee6;});}return null;};}function removeEntity(_0x167ad6,_0x47f5f1){return function(_0x29ac7c){if(_0x29ac7c){return _0x29ac7c['destroy']()[_0x1e6c('0x20')](function(){_0x167ad6[_0x1e6c('0x18')](0xcc)[_0x1e6c('0x19')]();});}};}function handleEntityNotFound(_0x17f280,_0x141cd3){return function(_0x58fb88){if(!_0x58fb88){_0x17f280[_0x1e6c('0x17')](0x194);}return _0x58fb88;};}function handleError(_0xd33bda,_0xa5d799){_0xa5d799=_0xa5d799||0x1f4;return function(_0x44b093){logger[_0x1e6c('0x21')](_0x44b093[_0x1e6c('0x22')]);if(_0x44b093[_0x1e6c('0x23')]){delete _0x44b093[_0x1e6c('0x23')];}_0xd33bda['status'](_0xa5d799)[_0x1e6c('0x24')](_0x44b093);};}exports[_0x1e6c('0x25')]=function(_0x5b3938,_0x465f6e){var _0x54fa64={},_0x25c4be={},_0x2d6f9e={'count':0x0,'rows':[]};var _0x34e39a=db['SmsQueueReport'][_0x1e6c('0x26')];_0x25c4be[_0x1e6c('0x27')]=_[_0x1e6c('0x28')](_0x34e39a);_0x25c4be[_0x1e6c('0x29')]=_[_0x1e6c('0x28')](_0x5b3938[_0x1e6c('0x29')]);_0x25c4be[_0x1e6c('0x2a')]=_[_0x1e6c('0x2b')](_0x25c4be[_0x1e6c('0x27')],_0x25c4be[_0x1e6c('0x29')]);_0x54fa64[_0x1e6c('0x2c')]=_[_0x1e6c('0x2b')](_0x25c4be[_0x1e6c('0x27')],qs[_0x1e6c('0x2d')](_0x5b3938[_0x1e6c('0x29')][_0x1e6c('0x2d')]));_0x54fa64['attributes']=_0x54fa64[_0x1e6c('0x2c')][_0x1e6c('0x2e')]?_0x54fa64[_0x1e6c('0x2c')]:_0x25c4be[_0x1e6c('0x27')];if(!_0x5b3938[_0x1e6c('0x29')]['hasOwnProperty'](_0x1e6c('0x2f'))){_0x54fa64[_0x1e6c('0x1c')]=qs[_0x1e6c('0x1c')](_0x5b3938[_0x1e6c('0x29')][_0x1e6c('0x1c')]);_0x54fa64[_0x1e6c('0x1b')]=qs['offset'](_0x5b3938['query'][_0x1e6c('0x1b')]);}_0x54fa64[_0x1e6c('0x30')]=qs['sort'](_0x5b3938['query']['sort']);_0x54fa64[_0x1e6c('0x31')]=qs[_0x1e6c('0x2a')](_[_0x1e6c('0x32')](_0x5b3938[_0x1e6c('0x29')],_0x25c4be[_0x1e6c('0x2a')]));if(_0x5b3938[_0x1e6c('0x29')]['filter']){_0x54fa64[_0x1e6c('0x31')]=_[_0x1e6c('0x33')](_0x54fa64[_0x1e6c('0x31')],{'$or':_[_0x1e6c('0x34')](_0x34e39a,function(_0xb87abf){if(_0xb87abf['type'][_0x1e6c('0x35')]!==_0x1e6c('0x36')){var _0xc0612d={};_0xc0612d[_0xb87abf[_0x1e6c('0x37')]]={'$like':'%'+_0x5b3938[_0x1e6c('0x29')][_0x1e6c('0x38')]+'%'};return _0xc0612d;}})});}_0x54fa64=_['merge']({},_0x54fa64,_0x5b3938[_0x1e6c('0x39')]);var _0x5b782e={'where':_0x54fa64[_0x1e6c('0x31')]};return db[_0x1e6c('0x3a')][_0x1e6c('0x1a')](_0x5b782e)[_0x1e6c('0x20')](function(_0x331877){_0x2d6f9e[_0x1e6c('0x1a')]=_0x331877;if(_0x5b3938[_0x1e6c('0x29')][_0x1e6c('0x3b')]){_0x54fa64['include']=[{'all':!![]}];}return db[_0x1e6c('0x3a')][_0x1e6c('0x3c')](_0x54fa64);})[_0x1e6c('0x20')](function(_0x1cb257){_0x2d6f9e['rows']=_0x1cb257;return _0x2d6f9e;})['then'](respondWithFilteredResult(_0x465f6e,_0x54fa64))[_0x1e6c('0x3d')](handleError(_0x465f6e,null));};exports[_0x1e6c('0x3e')]=function(_0x13965b,_0x3339a8){var _0xb04345={'raw':!![],'where':{'id':_0x13965b['params']['id']}},_0x410aec={};_0x410aec[_0x1e6c('0x27')]=_['keys'](db[_0x1e6c('0x3a')][_0x1e6c('0x26')]);_0x410aec[_0x1e6c('0x29')]=_[_0x1e6c('0x28')](_0x13965b['query']);_0x410aec[_0x1e6c('0x2a')]=_[_0x1e6c('0x2b')](_0x410aec[_0x1e6c('0x27')],_0x410aec[_0x1e6c('0x29')]);_0xb04345[_0x1e6c('0x2c')]=_['intersection'](_0x410aec[_0x1e6c('0x27')],qs[_0x1e6c('0x2d')](_0x13965b['query']['fields']));_0xb04345[_0x1e6c('0x2c')]=_0xb04345[_0x1e6c('0x2c')][_0x1e6c('0x2e')]?_0xb04345[_0x1e6c('0x2c')]:_0x410aec[_0x1e6c('0x27')];if(_0x13965b['query'][_0x1e6c('0x3b')]){_0xb04345[_0x1e6c('0x3f')]=[{'all':!![]}];}_0xb04345=_[_0x1e6c('0x33')]({},_0xb04345,_0x13965b[_0x1e6c('0x39')]);return db[_0x1e6c('0x3a')]['find'](_0xb04345)[_0x1e6c('0x20')](handleEntityNotFound(_0x3339a8,null))[_0x1e6c('0x20')](respondWithResult(_0x3339a8,null))['catch'](handleError(_0x3339a8,null));};exports['create']=function(_0xf62d6b,_0x4757d3){return db[_0x1e6c('0x3a')][_0x1e6c('0x40')](_0xf62d6b[_0x1e6c('0x41')],{})[_0x1e6c('0x20')](respondWithResult(_0x4757d3,0xc9))[_0x1e6c('0x3d')](handleError(_0x4757d3,null));};exports[_0x1e6c('0x42')]=function(_0x1d3eb5,_0x44a90a){if(_0x1d3eb5[_0x1e6c('0x41')]['id']){delete _0x1d3eb5[_0x1e6c('0x41')]['id'];}return db[_0x1e6c('0x3a')]['find']({'where':{'id':_0x1d3eb5[_0x1e6c('0x43')]['id']}})['then'](handleEntityNotFound(_0x44a90a,null))[_0x1e6c('0x20')](saveUpdates(_0x1d3eb5['body'],null))['then'](respondWithResult(_0x44a90a,null))[_0x1e6c('0x3d')](handleError(_0x44a90a,null));};exports[_0x1e6c('0x44')]=function(_0x2fd641,_0x43d8ab){return db[_0x1e6c('0x3a')]['find']({'where':{'id':_0x2fd641[_0x1e6c('0x43')]['id']}})[_0x1e6c('0x20')](handleEntityNotFound(_0x43d8ab,null))[_0x1e6c('0x20')](removeEntity(_0x43d8ab,null))[_0x1e6c('0x3d')](handleError(_0x43d8ab,null));};exports['describe']=function(_0x41614b,_0x56b01){return db[_0x1e6c('0x3a')][_0x1e6c('0x45')]()[_0x1e6c('0x20')](respondWithResult(_0x56b01,null))['catch'](handleError(_0x56b01,null));}; \ No newline at end of file +var _0xd7b1=['sort','where','pick','filter','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','limit','json','reject','save','update','then','destroy','sendStatus','name','send','index','SmsQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0xd6165e,_0x2195e1){var _0x207e4f=function(_0xb5ac83){while(--_0xb5ac83){_0xd6165e['push'](_0xd6165e['shift']());}};_0x207e4f(++_0x2195e1);}(_0xd7b1,0x12d));var _0x1d7b=function(_0x76f83f,_0x4307b3){_0x76f83f=_0x76f83f-0x0;var _0x50bb57=_0xd7b1[_0x76f83f];return _0x50bb57;};'use strict';var pdf=require(_0x1d7b('0x0'));var emlformat=require(_0x1d7b('0x1'));var rimraf=require(_0x1d7b('0x2'));var zipdir=require(_0x1d7b('0x3'));var jsonpatch=require(_0x1d7b('0x4'));var rp=require(_0x1d7b('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1d7b('0x6'));var path=require(_0x1d7b('0x7'));var sox=require(_0x1d7b('0x8'));var csv=require(_0x1d7b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1d7b('0xa'));var crypto=require(_0x1d7b('0xb'));var jsforce=require(_0x1d7b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1d7b('0x9'));var querystring=require(_0x1d7b('0xd'));var Papa=require(_0x1d7b('0xe'));var authService=require(_0x1d7b('0xf'));var hardwareService=require(_0x1d7b('0x10'));var Redis=require(_0x1d7b('0x11'));var qs=require(_0x1d7b('0x12'));var logger=require(_0x1d7b('0x13'))('api');var utils=require(_0x1d7b('0x14'));var config=require(_0x1d7b('0x15'));var db=require(_0x1d7b('0x16'))['db'];function respondWithStatusCode(_0x1cfadc,_0x73ab0b){_0x73ab0b=_0x73ab0b||0xcc;return function(_0x266218){if(_0x266218){return _0x1cfadc['sendStatus'](_0x73ab0b);}return _0x1cfadc['status'](_0x73ab0b)[_0x1d7b('0x17')]();};}function respondWithResult(_0x378fb5,_0x494b2c){_0x494b2c=_0x494b2c||0xc8;return function(_0xa81127){if(_0xa81127){return _0x378fb5[_0x1d7b('0x18')](_0x494b2c)['json'](_0xa81127);}};}function respondWithFilteredResult(_0xe6fca5,_0x3a104c){return function(_0xdb223b){if(_0xdb223b){var _0x2e096d=_0xdb223b[_0x1d7b('0x19')],_0x417e49=_0x3a104c[_0x1d7b('0x1a')],_0x4a86e9=_0x3a104c[_0x1d7b('0x1a')]+_0x3a104c[_0x1d7b('0x1b')],_0x1dff3c;if(_0x4a86e9>=_0x2e096d){_0x4a86e9=_0x2e096d;_0x1dff3c=0xc8;}else{_0x1dff3c=0xce;}_0xe6fca5[_0x1d7b('0x18')](_0x1dff3c);return _0xe6fca5['set']('Content-Range',_0x417e49+'-'+_0x4a86e9+'/'+_0x2e096d)[_0x1d7b('0x1c')](_0xdb223b);}return null;};}function patchUpdates(_0x100a25){return function(_0xa803f6){try{jsonpatch['apply'](_0xa803f6,_0x100a25,!![]);}catch(_0x385436){return BPromise[_0x1d7b('0x1d')](_0x385436);}return _0xa803f6[_0x1d7b('0x1e')]();};}function saveUpdates(_0x35b295,_0x56c4a4){return function(_0x4551b9){if(_0x4551b9){return _0x4551b9[_0x1d7b('0x1f')](_0x35b295)[_0x1d7b('0x20')](function(_0x55afb8){return _0x55afb8;});}return null;};}function removeEntity(_0x3c3ec8,_0x2c4f8d){return function(_0x338b5b){if(_0x338b5b){return _0x338b5b[_0x1d7b('0x21')]()['then'](function(){_0x3c3ec8[_0x1d7b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f36e7,_0x3c1f3c){return function(_0x5f03f1){if(!_0x5f03f1){_0x5f36e7[_0x1d7b('0x22')](0x194);}return _0x5f03f1;};}function handleError(_0x3bcfa1,_0x247834){_0x247834=_0x247834||0x1f4;return function(_0x2bd91d){logger['error'](_0x2bd91d['stack']);if(_0x2bd91d[_0x1d7b('0x23')]){delete _0x2bd91d[_0x1d7b('0x23')];}_0x3bcfa1['status'](_0x247834)[_0x1d7b('0x24')](_0x2bd91d);};}exports[_0x1d7b('0x25')]=function(_0x3894f3,_0x162244){var _0x393cbe={},_0x113189={},_0x518888={'count':0x0,'rows':[]};var _0x4a13ce=db[_0x1d7b('0x26')][_0x1d7b('0x27')];_0x113189[_0x1d7b('0x28')]=_[_0x1d7b('0x29')](_0x4a13ce);_0x113189[_0x1d7b('0x2a')]=_['keys'](_0x3894f3[_0x1d7b('0x2a')]);_0x113189[_0x1d7b('0x2b')]=_[_0x1d7b('0x2c')](_0x113189['model'],_0x113189['query']);_0x393cbe[_0x1d7b('0x2d')]=_[_0x1d7b('0x2c')](_0x113189[_0x1d7b('0x28')],qs[_0x1d7b('0x2e')](_0x3894f3[_0x1d7b('0x2a')][_0x1d7b('0x2e')]));_0x393cbe['attributes']=_0x393cbe[_0x1d7b('0x2d')][_0x1d7b('0x2f')]?_0x393cbe[_0x1d7b('0x2d')]:_0x113189[_0x1d7b('0x28')];if(!_0x3894f3[_0x1d7b('0x2a')][_0x1d7b('0x30')]('nolimit')){_0x393cbe[_0x1d7b('0x1b')]=qs[_0x1d7b('0x1b')](_0x3894f3['query'][_0x1d7b('0x1b')]);_0x393cbe[_0x1d7b('0x1a')]=qs[_0x1d7b('0x1a')](_0x3894f3[_0x1d7b('0x2a')]['offset']);}_0x393cbe['order']=qs[_0x1d7b('0x31')](_0x3894f3[_0x1d7b('0x2a')]['sort']);_0x393cbe[_0x1d7b('0x32')]=qs[_0x1d7b('0x2b')](_[_0x1d7b('0x33')](_0x3894f3[_0x1d7b('0x2a')],_0x113189[_0x1d7b('0x2b')]));if(_0x3894f3[_0x1d7b('0x2a')][_0x1d7b('0x34')]){_0x393cbe[_0x1d7b('0x32')]=_['merge'](_0x393cbe[_0x1d7b('0x32')],{'$or':_[_0x1d7b('0x35')](_0x4a13ce,function(_0x406e1d){if(_0x406e1d[_0x1d7b('0x36')]['key']!==_0x1d7b('0x37')){var _0x59dbaa={};_0x59dbaa[_0x406e1d[_0x1d7b('0x38')]]={'$like':'%'+_0x3894f3[_0x1d7b('0x2a')][_0x1d7b('0x34')]+'%'};return _0x59dbaa;}})});}_0x393cbe=_['merge']({},_0x393cbe,_0x3894f3[_0x1d7b('0x39')]);var _0x55d751={'where':_0x393cbe[_0x1d7b('0x32')]};return db[_0x1d7b('0x26')]['count'](_0x55d751)[_0x1d7b('0x20')](function(_0x1adb77){_0x518888['count']=_0x1adb77;if(_0x3894f3['query'][_0x1d7b('0x3a')]){_0x393cbe[_0x1d7b('0x3b')]=[{'all':!![]}];}return db[_0x1d7b('0x26')][_0x1d7b('0x3c')](_0x393cbe);})[_0x1d7b('0x20')](function(_0x5da33a){_0x518888[_0x1d7b('0x3d')]=_0x5da33a;return _0x518888;})[_0x1d7b('0x20')](respondWithFilteredResult(_0x162244,_0x393cbe))[_0x1d7b('0x3e')](handleError(_0x162244,null));};exports[_0x1d7b('0x3f')]=function(_0x146deb,_0x4fcaaf){var _0x35e407={'raw':!![],'where':{'id':_0x146deb[_0x1d7b('0x40')]['id']}},_0x56695a={};_0x56695a['model']=_[_0x1d7b('0x29')](db['SmsQueueReport'][_0x1d7b('0x27')]);_0x56695a[_0x1d7b('0x2a')]=_[_0x1d7b('0x29')](_0x146deb[_0x1d7b('0x2a')]);_0x56695a[_0x1d7b('0x2b')]=_[_0x1d7b('0x2c')](_0x56695a['model'],_0x56695a[_0x1d7b('0x2a')]);_0x35e407['attributes']=_['intersection'](_0x56695a['model'],qs[_0x1d7b('0x2e')](_0x146deb['query']['fields']));_0x35e407[_0x1d7b('0x2d')]=_0x35e407[_0x1d7b('0x2d')][_0x1d7b('0x2f')]?_0x35e407[_0x1d7b('0x2d')]:_0x56695a[_0x1d7b('0x28')];if(_0x146deb[_0x1d7b('0x2a')]['includeAll']){_0x35e407[_0x1d7b('0x3b')]=[{'all':!![]}];}_0x35e407=_[_0x1d7b('0x41')]({},_0x35e407,_0x146deb[_0x1d7b('0x39')]);return db['SmsQueueReport'][_0x1d7b('0x42')](_0x35e407)[_0x1d7b('0x20')](handleEntityNotFound(_0x4fcaaf,null))['then'](respondWithResult(_0x4fcaaf,null))[_0x1d7b('0x3e')](handleError(_0x4fcaaf,null));};exports['create']=function(_0x387d61,_0x538085){return db['SmsQueueReport'][_0x1d7b('0x43')](_0x387d61[_0x1d7b('0x44')],{})['then'](respondWithResult(_0x538085,0xc9))['catch'](handleError(_0x538085,null));};exports['update']=function(_0x5a8997,_0x203cb4){if(_0x5a8997[_0x1d7b('0x44')]['id']){delete _0x5a8997['body']['id'];}return db[_0x1d7b('0x26')][_0x1d7b('0x42')]({'where':{'id':_0x5a8997[_0x1d7b('0x40')]['id']}})['then'](handleEntityNotFound(_0x203cb4,null))[_0x1d7b('0x20')](saveUpdates(_0x5a8997[_0x1d7b('0x44')],null))[_0x1d7b('0x20')](respondWithResult(_0x203cb4,null))['catch'](handleError(_0x203cb4,null));};exports[_0x1d7b('0x21')]=function(_0x271295,_0x2f561a){return db['SmsQueueReport'][_0x1d7b('0x42')]({'where':{'id':_0x271295[_0x1d7b('0x40')]['id']}})[_0x1d7b('0x20')](handleEntityNotFound(_0x2f561a,null))[_0x1d7b('0x20')](removeEntity(_0x2f561a,null))['catch'](handleError(_0x2f561a,null));};exports[_0x1d7b('0x45')]=function(_0x486cb0,_0x2cb5a2){return db[_0x1d7b('0x26')]['describe']()['then'](respondWithResult(_0x2cb5a2,null))[_0x1d7b('0x3e')](handleError(_0x2cb5a2,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 0bb4054..83ef97b 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 _0x69f7=['api','moment','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','lodash','util'];(function(_0x44e31e,_0x619493){var _0x356103=function(_0x3c06a3){while(--_0x3c06a3){_0x44e31e['push'](_0x44e31e['shift']());}};_0x356103(++_0x619493);}(_0x69f7,0x18a));var _0x769f=function(_0x5c8223,_0x1d7d9d){_0x5c8223=_0x5c8223-0x0;var _0x43c890=_0x69f7[_0x5c8223];return _0x43c890;};'use strict';var _=require(_0x769f('0x0'));var util=require(_0x769f('0x1'));var logger=require('../../config/logger')(_0x769f('0x2'));var moment=require(_0x769f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x769f('0x4'));module[_0x769f('0x5')]=function(_0x10e05c,_0x292c89){return _0x10e05c[_0x769f('0x6')]('SmsQueueReport',attributes,{'tableName':_0x769f('0x7'),'paranoid':![],'indexes':[{'name':_0x769f('0x8'),'fields':[_0x769f('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbed8=['./smsQueueReport.attributes','exports','SmsQueueReport','report_sms_queue','uniqueid','../../config/logger','moment','bluebird'];(function(_0x1847e6,_0x445c9e){var _0x411836=function(_0xb69b0f){while(--_0xb69b0f){_0x1847e6['push'](_0x1847e6['shift']());}};_0x411836(++_0x445c9e);}(_0xbed8,0x1b5));var _0x8bed=function(_0x575c75,_0x120aa9){_0x575c75=_0x575c75-0x0;var _0x436370=_0xbed8[_0x575c75];return _0x436370;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8bed('0x0'))('api');var moment=require(_0x8bed('0x1'));var BPromise=require(_0x8bed('0x2'));var rp=require('request-promise');var attributes=require(_0x8bed('0x3'));module[_0x8bed('0x4')]=function(_0x2a2863,_0x2e955b){return _0x2a2863['define'](_0x8bed('0x5'),attributes,{'tableName':_0x8bed('0x6'),'paranoid':![],'indexes':[{'name':_0x8bed('0x7'),'fields':[_0x8bed('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index ec9c3c9..261f78b 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 _0x951c=['update','where','limit','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','SmsQueueReport','create','body','options','then','CreateSmsQueueReport','catch','UpdateSmsQueueReport'];(function(_0x472e18,_0x13a5b0){var _0x507179=function(_0x218b8b){while(--_0x218b8b){_0x472e18['push'](_0x472e18['shift']());}};_0x507179(++_0x13a5b0);}(_0x951c,0xb7));var _0xc951=function(_0x5942e9,_0x42673a){_0x5942e9=_0x5942e9-0x0;var _0x5757b3=_0x951c[_0x5942e9];return _0x5757b3;};'use strict';var _=require(_0xc951('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc951('0x1'));var rs=require(_0xc951('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc951('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc951('0x4'))(_0xc951('0x5'));var config=require(_0xc951('0x6'));var jayson=require(_0xc951('0x7'));var client=jayson['client'][_0xc951('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a5595,_0x244fca,_0x17d733){return new BPromise(function(_0x23b5d2,_0x516141){return client['request'](_0x4a5595,_0x17d733)['then'](function(_0x457fa2){logger['info'](_0xc951('0x9'),_0x244fca,_0xc951('0xa'));logger[_0xc951('0xb')](_0xc951('0xc'),_0x244fca,'request\x20sent',JSON[_0xc951('0xd')](_0x457fa2));if(_0x457fa2[_0xc951('0xe')]){if(_0x457fa2[_0xc951('0xe')][_0xc951('0xf')]===0x1f4){logger[_0xc951('0xe')](_0xc951('0x9'),_0x244fca,_0x457fa2[_0xc951('0xe')][_0xc951('0x10')]);return _0x516141(_0x457fa2[_0xc951('0xe')]['message']);}logger[_0xc951('0xe')](_0xc951('0x9'),_0x244fca,_0x457fa2['error'][_0xc951('0x10')]);return _0x23b5d2(_0x457fa2[_0xc951('0xe')][_0xc951('0x10')]);}else{logger[_0xc951('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x244fca,'request\x20sent');_0x23b5d2(_0x457fa2[_0xc951('0x12')]['message']);}})['catch'](function(_0x196b7a){logger['error'](_0xc951('0x9'),_0x244fca,_0x196b7a);_0x516141(_0x196b7a);});});}exports['CreateSmsQueueReport']=function(_0x2c76f9){var _0x33b65=this;return new Promise(function(_0x105d4e,_0x176819){return db[_0xc951('0x13')][_0xc951('0x14')](_0x2c76f9[_0xc951('0x15')],{'raw':_0x2c76f9[_0xc951('0x16')]?_0x2c76f9['options']['raw']===undefined?!![]:![]:!![]})[_0xc951('0x17')](function(_0x422d32){logger[_0xc951('0x11')](_0xc951('0x18'),_0x2c76f9);logger[_0xc951('0xb')](_0xc951('0x18'),_0x2c76f9,JSON[_0xc951('0xd')](_0x422d32));_0x105d4e(_0x422d32);})[_0xc951('0x19')](function(_0x26baad){logger[_0xc951('0xe')](_0xc951('0x18'),_0x26baad[_0xc951('0x10')],_0x2c76f9);_0x176819(_0x33b65[_0xc951('0xe')](0x1f4,_0x26baad[_0xc951('0x10')]));});});};exports[_0xc951('0x1a')]=function(_0x3ed4c4){var _0x13f847=this;return new Promise(function(_0x4220f2,_0x3c00af){return db['SmsQueueReport'][_0xc951('0x1b')](_0x3ed4c4[_0xc951('0x15')],{'raw':_0x3ed4c4[_0xc951('0x16')]?_0x3ed4c4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ed4c4[_0xc951('0x16')]?_0x3ed4c4[_0xc951('0x16')][_0xc951('0x1c')]||null:null,'attributes':_0x3ed4c4[_0xc951('0x16')]?_0x3ed4c4['options']['attributes']||null:null,'limit':_0x3ed4c4[_0xc951('0x16')]?_0x3ed4c4[_0xc951('0x16')][_0xc951('0x1d')]||null:null})[_0xc951('0x17')](function(_0x9cf175){logger[_0xc951('0x11')](_0xc951('0x1a'),_0x3ed4c4);logger[_0xc951('0xb')]('UpdateSmsQueueReport',_0x3ed4c4,JSON[_0xc951('0xd')](_0x9cf175));_0x4220f2(_0x9cf175);})[_0xc951('0x19')](function(_0x22b86e){logger['error'](_0xc951('0x1a'),_0x22b86e['message'],_0x3ed4c4);_0x3c00af(_0x13f847['error'](0x1f4,_0x22b86e[_0xc951('0x10')]));});});}; \ No newline at end of file +var _0x14ee=['jayson/promise','client','request','then','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','result','catch','SmsQueueReport','options','CreateSmsQueueReport','UpdateSmsQueueReport','body','where','attributes','lodash','util','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x14ee,0xa2));var _0xe14e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x14ee[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe14e('0x0'));var util=require(_0xe14e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe14e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe14e('0x3'))(_0xe14e('0x4'));var config=require(_0xe14e('0x5'));var jayson=require(_0xe14e('0x6'));var client=jayson[_0xe14e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x262a14,_0x894229,_0x35b311){return new BPromise(function(_0x34157f,_0x5f1134){return client[_0xe14e('0x8')](_0x262a14,_0x35b311)[_0xe14e('0x9')](function(_0xe48c24){logger[_0xe14e('0xa')]('SmsQueueReport,\x20%s,\x20%s',_0x894229,_0xe14e('0xb'));logger[_0xe14e('0xc')](_0xe14e('0xd'),_0x894229,_0xe14e('0xb'),JSON[_0xe14e('0xe')](_0xe48c24));if(_0xe48c24[_0xe14e('0xf')]){if(_0xe48c24['error'][_0xe14e('0x10')]===0x1f4){logger['error'](_0xe14e('0x11'),_0x894229,_0xe48c24['error']['message']);return _0x5f1134(_0xe48c24[_0xe14e('0xf')][_0xe14e('0x12')]);}logger['error'](_0xe14e('0x11'),_0x894229,_0xe48c24[_0xe14e('0xf')][_0xe14e('0x12')]);return _0x34157f(_0xe48c24[_0xe14e('0xf')][_0xe14e('0x12')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x894229,_0xe14e('0xb'));_0x34157f(_0xe48c24[_0xe14e('0x13')][_0xe14e('0x12')]);}})[_0xe14e('0x14')](function(_0x3c4db7){logger[_0xe14e('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x894229,_0x3c4db7);_0x5f1134(_0x3c4db7);});});}exports['CreateSmsQueueReport']=function(_0xe90cb3){var _0x41def2=this;return new Promise(function(_0x1624cd,_0x46bbdf){return db[_0xe14e('0x15')]['create'](_0xe90cb3['body'],{'raw':_0xe90cb3[_0xe14e('0x16')]?_0xe90cb3['options']['raw']===undefined?!![]:![]:!![]})[_0xe14e('0x9')](function(_0x4b7bcd){logger[_0xe14e('0xa')]('CreateSmsQueueReport',_0xe90cb3);logger[_0xe14e('0xc')](_0xe14e('0x17'),_0xe90cb3,JSON[_0xe14e('0xe')](_0x4b7bcd));_0x1624cd(_0x4b7bcd);})[_0xe14e('0x14')](function(_0x31d838){logger[_0xe14e('0xf')](_0xe14e('0x17'),_0x31d838[_0xe14e('0x12')],_0xe90cb3);_0x46bbdf(_0x41def2[_0xe14e('0xf')](0x1f4,_0x31d838['message']));});});};exports[_0xe14e('0x18')]=function(_0x2620ec){var _0x223787=this;return new Promise(function(_0x1bea91,_0x2ee4eb){return db[_0xe14e('0x15')]['update'](_0x2620ec[_0xe14e('0x19')],{'raw':_0x2620ec['options']?_0x2620ec['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2620ec[_0xe14e('0x16')]?_0x2620ec[_0xe14e('0x16')][_0xe14e('0x1a')]||null:null,'attributes':_0x2620ec[_0xe14e('0x16')]?_0x2620ec['options'][_0xe14e('0x1b')]||null:null,'limit':_0x2620ec[_0xe14e('0x16')]?_0x2620ec[_0xe14e('0x16')]['limit']||null:null})[_0xe14e('0x9')](function(_0x209426){logger[_0xe14e('0xa')](_0xe14e('0x18'),_0x2620ec);logger[_0xe14e('0xc')](_0xe14e('0x18'),_0x2620ec,JSON[_0xe14e('0xe')](_0x209426));_0x1bea91(_0x209426);})[_0xe14e('0x14')](function(_0x4e3f1d){logger[_0xe14e('0xf')](_0xe14e('0x18'),_0x4e3f1d[_0xe14e('0x12')],_0x2620ec);_0x2ee4eb(_0x223787[_0xe14e('0xf')](0x1f4,_0x4e3f1d['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index e3e3e75..b3a5bca 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 _0x351c=['describe','/:id','post','create','update','delete','destroy','multer','path','connect-timeout','../../components/auth/service','./smsTransferReport.controller','get','isAuthenticated','index'];(function(_0x2bcdc1,_0x5bc65c){var _0x3bab8f=function(_0x47610a){while(--_0x47610a){_0x2bcdc1['push'](_0x2bcdc1['shift']());}};_0x3bab8f(++_0x5bc65c);}(_0x351c,0x17e));var _0xc351=function(_0x1addea,_0x257288){_0x1addea=_0x1addea-0x0;var _0x249c9f=_0x351c[_0x1addea];return _0x249c9f;};'use strict';var multer=require(_0xc351('0x0'));var util=require('util');var path=require(_0xc351('0x1'));var timeout=require(_0xc351('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xc351('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc351('0x4'));router[_0xc351('0x5')]('/',auth[_0xc351('0x6')](),controller[_0xc351('0x7')]);router[_0xc351('0x5')]('/describe',auth[_0xc351('0x6')](),controller[_0xc351('0x8')]);router[_0xc351('0x5')](_0xc351('0x9'),auth[_0xc351('0x6')](),controller['show']);router[_0xc351('0xa')]('/',auth['isAuthenticated'](),controller[_0xc351('0xb')]);router['put'](_0xc351('0x9'),auth[_0xc351('0x6')](),controller[_0xc351('0xc')]);router[_0xc351('0xd')](_0xc351('0x9'),auth[_0xc351('0x6')](),controller[_0xc351('0xe')]);module['exports']=router; \ No newline at end of file +var _0x51a6=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','multer','util'];(function(_0x3156e7,_0x3c7ae2){var _0x308e10=function(_0x1ed219){while(--_0x1ed219){_0x3156e7['push'](_0x3156e7['shift']());}};_0x308e10(++_0x3c7ae2);}(_0x51a6,0xc4));var _0x651a=function(_0x3b5f66,_0x1dbfc5){_0x3b5f66=_0x3b5f66-0x0;var _0x4aa1a8=_0x51a6[_0x3b5f66];return _0x4aa1a8;};'use strict';var multer=require(_0x651a('0x0'));var util=require(_0x651a('0x1'));var path=require(_0x651a('0x2'));var timeout=require(_0x651a('0x3'));var express=require(_0x651a('0x4'));var router=express[_0x651a('0x5')]();var auth=require(_0x651a('0x6'));var interaction=require(_0x651a('0x7'));var config=require(_0x651a('0x8'));var controller=require(_0x651a('0x9'));router[_0x651a('0xa')]('/',auth['isAuthenticated'](),controller[_0x651a('0xb')]);router[_0x651a('0xa')]('/describe',auth[_0x651a('0xc')](),controller[_0x651a('0xd')]);router['get'](_0x651a('0xe'),auth[_0x651a('0xc')](),controller[_0x651a('0xf')]);router[_0x651a('0x10')]('/',auth[_0x651a('0xc')](),controller[_0x651a('0x11')]);router[_0x651a('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x651a('0x13')]);router[_0x651a('0x14')]('/:id',auth[_0x651a('0xc')](),controller['destroy']);module[_0x651a('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 b61b4e4..d2a433c 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 _0x5e87=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x229ba0,_0x800f6){var _0x2a8af0=function(_0x511385){while(--_0x511385){_0x229ba0['push'](_0x229ba0['shift']());}};_0x2a8af0(++_0x800f6);}(_0x5e87,0xb2));var _0x75e8=function(_0x8a6386,_0x4463a9){_0x8a6386=_0x8a6386-0x0;var _0xb14ee=_0x5e87[_0x8a6386];return _0xb14ee;};'use strict';var moment=require(_0x75e8('0x0'));var Sequelize=require(_0x75e8('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x75e8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x75e8('0x3')](_0x75e8('0x4'),'agent',_0x75e8('0x5')),'allowNull':![],'defaultValue':_0x75e8('0x5')},'transferredAt':{'type':Sequelize[_0x75e8('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x75e8('0x7')]}}; \ No newline at end of file +var _0xc6a7=['queue','NOW','sequelize','exports','STRING','agent'];(function(_0x3ca6f6,_0x3e9153){var _0x5e24d6=function(_0x45078d){while(--_0x45078d){_0x3ca6f6['push'](_0x3ca6f6['shift']());}};_0x5e24d6(++_0x3e9153);}(_0xc6a7,0x15e));var _0x7c6a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc6a7[_0x565ed7];return _0x183ad7;};'use strict';var moment=require('moment');var Sequelize=require(_0x7c6a('0x0'));module[_0x7c6a('0x1')]={'uniqueid':{'type':Sequelize[_0x7c6a('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x7c6a('0x3'),'queue'),'allowNull':![],'defaultValue':_0x7c6a('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x7c6a('0x5')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index a212064..0b11008 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 _0x27d8=['key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','desk.js','querystring','../../components/auth/service','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','destroy','then','error','stack','name','send','SmsTransferReport','rawAttributes','keys','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','order','sort','where','filter','merge','type'];(function(_0x1cec93,_0x10bc21){var _0x3b9395=function(_0x4f871e){while(--_0x4f871e){_0x1cec93['push'](_0x1cec93['shift']());}};_0x3b9395(++_0x10bc21);}(_0x27d8,0x1b8));var _0x827d=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0x27d8[_0x121886];return _0x20ca01;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x827d('0x0'));var zipdir=require(_0x827d('0x1'));var jsonpatch=require(_0x827d('0x2'));var rp=require(_0x827d('0x3'));var moment=require(_0x827d('0x4'));var BPromise=require(_0x827d('0x5'));var Mustache=require(_0x827d('0x6'));var util=require(_0x827d('0x7'));var path=require('path');var sox=require(_0x827d('0x8'));var csv=require(_0x827d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x827d('0xa'));var squel=require('squel');var crypto=require(_0x827d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x827d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x827d('0xd'));var Papa=require('papaparse');var authService=require(_0x827d('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x827d('0xf'));var qs=require(_0x827d('0x10'));var logger=require(_0x827d('0x11'))(_0x827d('0x12'));var utils=require(_0x827d('0x13'));var config=require(_0x827d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a875d,_0x118298){_0x118298=_0x118298||0xcc;return function(_0x5305df){if(_0x5305df){return _0x3a875d[_0x827d('0x15')](_0x118298);}return _0x3a875d[_0x827d('0x16')](_0x118298)[_0x827d('0x17')]();};}function respondWithResult(_0x3c6473,_0x7f138d){_0x7f138d=_0x7f138d||0xc8;return function(_0x31c777){if(_0x31c777){return _0x3c6473[_0x827d('0x16')](_0x7f138d)[_0x827d('0x18')](_0x31c777);}};}function respondWithFilteredResult(_0x164481,_0x1833b8){return function(_0x49b653){if(_0x49b653){var _0x213879=_0x49b653[_0x827d('0x19')],_0x5baf94=_0x1833b8[_0x827d('0x1a')],_0xc6abc7=_0x1833b8['offset']+_0x1833b8[_0x827d('0x1b')],_0x3e010a;if(_0xc6abc7>=_0x213879){_0xc6abc7=_0x213879;_0x3e010a=0xc8;}else{_0x3e010a=0xce;}_0x164481[_0x827d('0x16')](_0x3e010a);return _0x164481[_0x827d('0x1c')](_0x827d('0x1d'),_0x5baf94+'-'+_0xc6abc7+'/'+_0x213879)['json'](_0x49b653);}return null;};}function patchUpdates(_0x2cbb48){return function(_0x4470bb){try{jsonpatch[_0x827d('0x1e')](_0x4470bb,_0x2cbb48,!![]);}catch(_0xeeba9){return BPromise[_0x827d('0x1f')](_0xeeba9);}return _0x4470bb[_0x827d('0x20')]();};}function saveUpdates(_0x40d599,_0x3139d3){return function(_0x53ebea){if(_0x53ebea){return _0x53ebea[_0x827d('0x21')](_0x40d599)['then'](function(_0x3e8404){return _0x3e8404;});}return null;};}function removeEntity(_0x15c014,_0x178aa0){return function(_0x4d9d99){if(_0x4d9d99){return _0x4d9d99[_0x827d('0x22')]()[_0x827d('0x23')](function(){_0x15c014['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c1e7e,_0x28d650){return function(_0x3a7323){if(!_0x3a7323){_0x1c1e7e['sendStatus'](0x194);}return _0x3a7323;};}function handleError(_0x5345df,_0x4841df){_0x4841df=_0x4841df||0x1f4;return function(_0x55815d){logger[_0x827d('0x24')](_0x55815d[_0x827d('0x25')]);if(_0x55815d[_0x827d('0x26')]){delete _0x55815d['name'];}_0x5345df[_0x827d('0x16')](_0x4841df)[_0x827d('0x27')](_0x55815d);};}exports['index']=function(_0x1d9a97,_0x1d6c02){var _0x32e747={},_0xdbffca={},_0x1416dc={'count':0x0,'rows':[]};var _0x33ce39=db[_0x827d('0x28')][_0x827d('0x29')];_0xdbffca['model']=_[_0x827d('0x2a')](_0x33ce39);_0xdbffca[_0x827d('0x2b')]=_[_0x827d('0x2a')](_0x1d9a97[_0x827d('0x2b')]);_0xdbffca[_0x827d('0x2c')]=_[_0x827d('0x2d')](_0xdbffca[_0x827d('0x2e')],_0xdbffca[_0x827d('0x2b')]);_0x32e747['attributes']=_[_0x827d('0x2d')](_0xdbffca[_0x827d('0x2e')],qs[_0x827d('0x2f')](_0x1d9a97[_0x827d('0x2b')][_0x827d('0x2f')]));_0x32e747['attributes']=_0x32e747['attributes'][_0x827d('0x30')]?_0x32e747[_0x827d('0x31')]:_0xdbffca[_0x827d('0x2e')];if(!_0x1d9a97[_0x827d('0x2b')][_0x827d('0x32')]('nolimit')){_0x32e747['limit']=qs[_0x827d('0x1b')](_0x1d9a97[_0x827d('0x2b')][_0x827d('0x1b')]);_0x32e747['offset']=qs['offset'](_0x1d9a97['query'][_0x827d('0x1a')]);}_0x32e747[_0x827d('0x33')]=qs[_0x827d('0x34')](_0x1d9a97[_0x827d('0x2b')][_0x827d('0x34')]);_0x32e747[_0x827d('0x35')]=qs[_0x827d('0x2c')](_['pick'](_0x1d9a97[_0x827d('0x2b')],_0xdbffca['filters']));if(_0x1d9a97[_0x827d('0x2b')][_0x827d('0x36')]){_0x32e747[_0x827d('0x35')]=_[_0x827d('0x37')](_0x32e747[_0x827d('0x35')],{'$or':_['map'](_0x33ce39,function(_0x4361b2){if(_0x4361b2[_0x827d('0x38')][_0x827d('0x39')]!==_0x827d('0x3a')){var _0x3bef4c={};_0x3bef4c[_0x4361b2[_0x827d('0x3b')]]={'$like':'%'+_0x1d9a97[_0x827d('0x2b')]['filter']+'%'};return _0x3bef4c;}})});}_0x32e747=_[_0x827d('0x37')]({},_0x32e747,_0x1d9a97[_0x827d('0x3c')]);var _0x2b2af7={'where':_0x32e747[_0x827d('0x35')]};return db['SmsTransferReport']['count'](_0x2b2af7)[_0x827d('0x23')](function(_0x21941d){_0x1416dc[_0x827d('0x19')]=_0x21941d;if(_0x1d9a97[_0x827d('0x2b')][_0x827d('0x3d')]){_0x32e747[_0x827d('0x3e')]=[{'all':!![]}];}return db[_0x827d('0x28')][_0x827d('0x3f')](_0x32e747);})[_0x827d('0x23')](function(_0xd7170){_0x1416dc[_0x827d('0x40')]=_0xd7170;return _0x1416dc;})[_0x827d('0x23')](respondWithFilteredResult(_0x1d6c02,_0x32e747))[_0x827d('0x41')](handleError(_0x1d6c02,null));};exports[_0x827d('0x42')]=function(_0x474d2d,_0x5303fa){var _0x2a615d={'raw':!![],'where':{'id':_0x474d2d[_0x827d('0x43')]['id']}},_0x33880d={};_0x33880d[_0x827d('0x2e')]=_[_0x827d('0x2a')](db[_0x827d('0x28')][_0x827d('0x29')]);_0x33880d[_0x827d('0x2b')]=_[_0x827d('0x2a')](_0x474d2d['query']);_0x33880d[_0x827d('0x2c')]=_['intersection'](_0x33880d['model'],_0x33880d[_0x827d('0x2b')]);_0x2a615d[_0x827d('0x31')]=_[_0x827d('0x2d')](_0x33880d['model'],qs[_0x827d('0x2f')](_0x474d2d[_0x827d('0x2b')]['fields']));_0x2a615d[_0x827d('0x31')]=_0x2a615d['attributes'][_0x827d('0x30')]?_0x2a615d[_0x827d('0x31')]:_0x33880d[_0x827d('0x2e')];if(_0x474d2d['query'][_0x827d('0x3d')]){_0x2a615d[_0x827d('0x3e')]=[{'all':!![]}];}_0x2a615d=_[_0x827d('0x37')]({},_0x2a615d,_0x474d2d['options']);return db[_0x827d('0x28')][_0x827d('0x44')](_0x2a615d)[_0x827d('0x23')](handleEntityNotFound(_0x5303fa,null))['then'](respondWithResult(_0x5303fa,null))[_0x827d('0x41')](handleError(_0x5303fa,null));};exports['create']=function(_0x10ac34,_0x4699f1){return db[_0x827d('0x28')]['create'](_0x10ac34['body'],{})[_0x827d('0x23')](respondWithResult(_0x4699f1,0xc9))['catch'](handleError(_0x4699f1,null));};exports[_0x827d('0x21')]=function(_0x3f21ca,_0x2bc5fb){if(_0x3f21ca[_0x827d('0x45')]['id']){delete _0x3f21ca[_0x827d('0x45')]['id'];}return db[_0x827d('0x28')]['find']({'where':{'id':_0x3f21ca[_0x827d('0x43')]['id']}})[_0x827d('0x23')](handleEntityNotFound(_0x2bc5fb,null))[_0x827d('0x23')](saveUpdates(_0x3f21ca[_0x827d('0x45')],null))['then'](respondWithResult(_0x2bc5fb,null))[_0x827d('0x41')](handleError(_0x2bc5fb,null));};exports['destroy']=function(_0x18d7ba,_0x2ed0ab){return db['SmsTransferReport'][_0x827d('0x44')]({'where':{'id':_0x18d7ba[_0x827d('0x43')]['id']}})[_0x827d('0x23')](handleEntityNotFound(_0x2ed0ab,null))[_0x827d('0x23')](removeEntity(_0x2ed0ab,null))[_0x827d('0x41')](handleError(_0x2ed0ab,null));};exports[_0x827d('0x46')]=function(_0x4b7ce7,_0x332cdf){return db[_0x827d('0x28')]['describe']()[_0x827d('0x23')](respondWithResult(_0x332cdf,null))[_0x827d('0x41')](handleError(_0x332cdf,null));}; \ No newline at end of file +var _0x4898=['send','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','SmsTransferReport','includeAll','include','rows','catch','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../config/environment','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name'];(function(_0x28a76a,_0x38bf87){var _0xa74f3f=function(_0x3b27d4){while(--_0x3b27d4){_0x28a76a['push'](_0x28a76a['shift']());}};_0xa74f3f(++_0x38bf87);}(_0x4898,0xb2));var _0x8489=function(_0x34f023,_0x12eb07){_0x34f023=_0x34f023-0x0;var _0xfb53c6=_0x4898[_0x34f023];return _0xfb53c6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8489('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8489('0x1'));var jsonpatch=require(_0x8489('0x2'));var rp=require(_0x8489('0x3'));var moment=require(_0x8489('0x4'));var BPromise=require(_0x8489('0x5'));var Mustache=require(_0x8489('0x6'));var util=require(_0x8489('0x7'));var path=require('path');var sox=require(_0x8489('0x8'));var csv=require('to-csv');var ejs=require(_0x8489('0x9'));var fs=require('fs');var _=require(_0x8489('0xa'));var squel=require(_0x8489('0xb'));var crypto=require(_0x8489('0xc'));var jsforce=require(_0x8489('0xd'));var deskjs=require(_0x8489('0xe'));var toCsv=require(_0x8489('0xf'));var querystring=require(_0x8489('0x10'));var Papa=require(_0x8489('0x11'));var authService=require(_0x8489('0x12'));var hardwareService=require(_0x8489('0x13'));var Redis=require('ioredis');var qs=require(_0x8489('0x14'));var logger=require(_0x8489('0x15'))(_0x8489('0x16'));var utils=require(_0x8489('0x17'));var config=require(_0x8489('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x518085,_0x203e61){_0x203e61=_0x203e61||0xcc;return function(_0x34ffa7){if(_0x34ffa7){return _0x518085[_0x8489('0x19')](_0x203e61);}return _0x518085['status'](_0x203e61)[_0x8489('0x1a')]();};}function respondWithResult(_0x19ba62,_0x21f6de){_0x21f6de=_0x21f6de||0xc8;return function(_0x1572f0){if(_0x1572f0){return _0x19ba62[_0x8489('0x1b')](_0x21f6de)[_0x8489('0x1c')](_0x1572f0);}};}function respondWithFilteredResult(_0x1ba8b3,_0xa03e5a){return function(_0x40c9cc){if(_0x40c9cc){var _0x390f46=_0x40c9cc[_0x8489('0x1d')],_0x5426f0=_0xa03e5a[_0x8489('0x1e')],_0x6d3216=_0xa03e5a[_0x8489('0x1e')]+_0xa03e5a['limit'],_0xa405b4;if(_0x6d3216>=_0x390f46){_0x6d3216=_0x390f46;_0xa405b4=0xc8;}else{_0xa405b4=0xce;}_0x1ba8b3[_0x8489('0x1b')](_0xa405b4);return _0x1ba8b3[_0x8489('0x1f')](_0x8489('0x20'),_0x5426f0+'-'+_0x6d3216+'/'+_0x390f46)['json'](_0x40c9cc);}return null;};}function patchUpdates(_0x4435aa){return function(_0x58b016){try{jsonpatch[_0x8489('0x21')](_0x58b016,_0x4435aa,!![]);}catch(_0x48b709){return BPromise[_0x8489('0x22')](_0x48b709);}return _0x58b016[_0x8489('0x23')]();};}function saveUpdates(_0x50f058,_0x28e83a){return function(_0x1390e5){if(_0x1390e5){return _0x1390e5[_0x8489('0x24')](_0x50f058)[_0x8489('0x25')](function(_0x4416b3){return _0x4416b3;});}return null;};}function removeEntity(_0xb533ba,_0x2394f3){return function(_0x2216dc){if(_0x2216dc){return _0x2216dc[_0x8489('0x26')]()[_0x8489('0x25')](function(){_0xb533ba[_0x8489('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27b407,_0xfef47e){return function(_0x26864b){if(!_0x26864b){_0x27b407[_0x8489('0x19')](0x194);}return _0x26864b;};}function handleError(_0x206091,_0x19bf42){_0x19bf42=_0x19bf42||0x1f4;return function(_0x5ca8ff){logger[_0x8489('0x27')](_0x5ca8ff['stack']);if(_0x5ca8ff[_0x8489('0x28')]){delete _0x5ca8ff['name'];}_0x206091[_0x8489('0x1b')](_0x19bf42)[_0x8489('0x29')](_0x5ca8ff);};}exports['index']=function(_0x3e9c47,_0x12a9ee){var _0x11597e={},_0x3a3087={},_0x59a4d4={'count':0x0,'rows':[]};var _0x3cde8e=db['SmsTransferReport'][_0x8489('0x2a')];_0x3a3087[_0x8489('0x2b')]=_['keys'](_0x3cde8e);_0x3a3087[_0x8489('0x2c')]=_['keys'](_0x3e9c47[_0x8489('0x2c')]);_0x3a3087[_0x8489('0x2d')]=_[_0x8489('0x2e')](_0x3a3087[_0x8489('0x2b')],_0x3a3087[_0x8489('0x2c')]);_0x11597e[_0x8489('0x2f')]=_[_0x8489('0x2e')](_0x3a3087[_0x8489('0x2b')],qs[_0x8489('0x30')](_0x3e9c47[_0x8489('0x2c')]['fields']));_0x11597e[_0x8489('0x2f')]=_0x11597e[_0x8489('0x2f')][_0x8489('0x31')]?_0x11597e[_0x8489('0x2f')]:_0x3a3087[_0x8489('0x2b')];if(!_0x3e9c47[_0x8489('0x2c')][_0x8489('0x32')](_0x8489('0x33'))){_0x11597e['limit']=qs[_0x8489('0x34')](_0x3e9c47['query'][_0x8489('0x34')]);_0x11597e[_0x8489('0x1e')]=qs[_0x8489('0x1e')](_0x3e9c47['query'][_0x8489('0x1e')]);}_0x11597e[_0x8489('0x35')]=qs[_0x8489('0x36')](_0x3e9c47[_0x8489('0x2c')][_0x8489('0x36')]);_0x11597e[_0x8489('0x37')]=qs[_0x8489('0x2d')](_[_0x8489('0x38')](_0x3e9c47[_0x8489('0x2c')],_0x3a3087['filters']));if(_0x3e9c47['query'][_0x8489('0x39')]){_0x11597e[_0x8489('0x37')]=_[_0x8489('0x3a')](_0x11597e[_0x8489('0x37')],{'$or':_[_0x8489('0x3b')](_0x3cde8e,function(_0x244ee0){if(_0x244ee0['type']['key']!==_0x8489('0x3c')){var _0x58efcf={};_0x58efcf[_0x244ee0['field']]={'$like':'%'+_0x3e9c47[_0x8489('0x2c')][_0x8489('0x39')]+'%'};return _0x58efcf;}})});}_0x11597e=_[_0x8489('0x3a')]({},_0x11597e,_0x3e9c47[_0x8489('0x3d')]);var _0x477d1e={'where':_0x11597e[_0x8489('0x37')]};return db[_0x8489('0x3e')][_0x8489('0x1d')](_0x477d1e)['then'](function(_0x11bd69){_0x59a4d4[_0x8489('0x1d')]=_0x11bd69;if(_0x3e9c47[_0x8489('0x2c')][_0x8489('0x3f')]){_0x11597e[_0x8489('0x40')]=[{'all':!![]}];}return db[_0x8489('0x3e')]['findAll'](_0x11597e);})['then'](function(_0x1652b6){_0x59a4d4[_0x8489('0x41')]=_0x1652b6;return _0x59a4d4;})[_0x8489('0x25')](respondWithFilteredResult(_0x12a9ee,_0x11597e))[_0x8489('0x42')](handleError(_0x12a9ee,null));};exports['show']=function(_0x4e0f09,_0x3932bd){var _0x178a2b={'raw':!![],'where':{'id':_0x4e0f09[_0x8489('0x43')]['id']}},_0xa75db={};_0xa75db['model']=_[_0x8489('0x44')](db[_0x8489('0x3e')][_0x8489('0x2a')]);_0xa75db['query']=_[_0x8489('0x44')](_0x4e0f09[_0x8489('0x2c')]);_0xa75db[_0x8489('0x2d')]=_[_0x8489('0x2e')](_0xa75db['model'],_0xa75db[_0x8489('0x2c')]);_0x178a2b[_0x8489('0x2f')]=_['intersection'](_0xa75db['model'],qs[_0x8489('0x30')](_0x4e0f09[_0x8489('0x2c')][_0x8489('0x30')]));_0x178a2b[_0x8489('0x2f')]=_0x178a2b[_0x8489('0x2f')][_0x8489('0x31')]?_0x178a2b['attributes']:_0xa75db['model'];if(_0x4e0f09[_0x8489('0x2c')][_0x8489('0x3f')]){_0x178a2b['include']=[{'all':!![]}];}_0x178a2b=_[_0x8489('0x3a')]({},_0x178a2b,_0x4e0f09[_0x8489('0x3d')]);return db[_0x8489('0x3e')][_0x8489('0x45')](_0x178a2b)[_0x8489('0x25')](handleEntityNotFound(_0x3932bd,null))[_0x8489('0x25')](respondWithResult(_0x3932bd,null))[_0x8489('0x42')](handleError(_0x3932bd,null));};exports[_0x8489('0x46')]=function(_0x2bd1b4,_0x9dc158){return db[_0x8489('0x3e')][_0x8489('0x46')](_0x2bd1b4[_0x8489('0x47')],{})[_0x8489('0x25')](respondWithResult(_0x9dc158,0xc9))[_0x8489('0x42')](handleError(_0x9dc158,null));};exports[_0x8489('0x24')]=function(_0x191c24,_0x35dbcb){if(_0x191c24[_0x8489('0x47')]['id']){delete _0x191c24[_0x8489('0x47')]['id'];}return db[_0x8489('0x3e')][_0x8489('0x45')]({'where':{'id':_0x191c24[_0x8489('0x43')]['id']}})['then'](handleEntityNotFound(_0x35dbcb,null))['then'](saveUpdates(_0x191c24[_0x8489('0x47')],null))[_0x8489('0x25')](respondWithResult(_0x35dbcb,null))['catch'](handleError(_0x35dbcb,null));};exports[_0x8489('0x26')]=function(_0x46241c,_0x16fe03){return db[_0x8489('0x3e')][_0x8489('0x45')]({'where':{'id':_0x46241c[_0x8489('0x43')]['id']}})[_0x8489('0x25')](handleEntityNotFound(_0x16fe03,null))[_0x8489('0x25')](removeEntity(_0x16fe03,null))['catch'](handleError(_0x16fe03,null));};exports[_0x8489('0x48')]=function(_0x21ca2b,_0xe0915b){return db[_0x8489('0x3e')][_0x8489('0x48')]()[_0x8489('0x25')](respondWithResult(_0xe0915b,null))[_0x8489('0x42')](handleError(_0xe0915b,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 1f2b3cc..0fcd77e 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 _0x6f0d=['./smsTransferReport.attributes','exports','SmsTransferReport','uniqueid','util','../../config/logger','api','moment','request-promise'];(function(_0x228a52,_0x26f1c9){var _0x634521=function(_0x2bc30a){while(--_0x2bc30a){_0x228a52['push'](_0x228a52['shift']());}};_0x634521(++_0x26f1c9);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x1c3857,_0x1d3831){_0x1c3857=_0x1c3857-0x0;var _0x17cc49=_0x6f0d[_0x1c3857];return _0x17cc49;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var attributes=require(_0xd6f0('0x5'));module[_0xd6f0('0x6')]=function(_0x25344b,_0x3a757f){return _0x25344b['define'](_0xd6f0('0x7'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xd6f0('0x8'),'fields':[_0xd6f0('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f62=['exports','define','report_sms_transfer','uniqueid','util','api','moment','bluebird'];(function(_0x2a0a02,_0x360fe7){var _0x4a970f=function(_0x289956){while(--_0x289956){_0x2a0a02['push'](_0x2a0a02['shift']());}};_0x4a970f(++_0x360fe7);}(_0x9f62,0x154));var _0x29f6=function(_0x3c1360,_0x4b610f){_0x3c1360=_0x3c1360-0x0;var _0x3b7932=_0x9f62[_0x3c1360];return _0x3b7932;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var attributes=require('./smsTransferReport.attributes');module[_0x29f6('0x4')]=function(_0x2f0420,_0xefa26c){return _0x2f0420[_0x29f6('0x5')]('SmsTransferReport',attributes,{'tableName':_0x29f6('0x6'),'paranoid':![],'indexes':[{'name':_0x29f6('0x7'),'fields':[_0x29f6('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index b16a7a8..5dbc5e7 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 _0x2b47=['result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xdba975,_0x34bee2){var _0x5a1975=function(_0x1f44c5){while(--_0x1f44c5){_0xdba975['push'](_0xdba975['shift']());}};_0x5a1975(++_0x34bee2);}(_0x2b47,0x177));var _0x72b4=function(_0x95725e,_0x678c5){_0x95725e=_0x95725e-0x0;var _0x484f73=_0x2b47[_0x95725e];return _0x484f73;};'use strict';var _=require(_0x72b4('0x0'));var util=require('util');var moment=require(_0x72b4('0x1'));var BPromise=require(_0x72b4('0x2'));var rs=require(_0x72b4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72b4('0x4'))['db'];var utils=require(_0x72b4('0x5'));var logger=require(_0x72b4('0x6'))(_0x72b4('0x7'));var config=require(_0x72b4('0x8'));var jayson=require(_0x72b4('0x9'));var client=jayson['client'][_0x72b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x480984,_0x104f08,_0x1c90aa){return new BPromise(function(_0xb1e42f,_0x1bdf7f){return client[_0x72b4('0xb')](_0x480984,_0x1c90aa)[_0x72b4('0xc')](function(_0x114a98){logger[_0x72b4('0xd')](_0x72b4('0xe'),_0x104f08,_0x72b4('0xf'));logger[_0x72b4('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x104f08,_0x72b4('0xf'),JSON[_0x72b4('0x11')](_0x114a98));if(_0x114a98[_0x72b4('0x12')]){if(_0x114a98[_0x72b4('0x12')][_0x72b4('0x13')]===0x1f4){logger[_0x72b4('0x12')](_0x72b4('0xe'),_0x104f08,_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);return _0x1bdf7f(_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);}logger['error'](_0x72b4('0xe'),_0x104f08,_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);return _0xb1e42f(_0x114a98[_0x72b4('0x12')]['message']);}else{logger['info'](_0x72b4('0xe'),_0x104f08,'request\x20sent');_0xb1e42f(_0x114a98[_0x72b4('0x15')][_0x72b4('0x14')]);}})['catch'](function(_0x2a9c37){logger[_0x72b4('0x12')](_0x72b4('0xe'),_0x104f08,_0x2a9c37);_0x1bdf7f(_0x2a9c37);});});} \ No newline at end of file +var _0x17a7=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0x17a7,0xc2));var _0x717a=function(_0x399380,_0x818b1e){_0x399380=_0x399380-0x0;var _0x778463=_0x17a7[_0x399380];return _0x778463;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x717a('0x0'));var rs=require(_0x717a('0x1'));var fs=require('fs');var Redis=require(_0x717a('0x2'));var db=require(_0x717a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x717a('0x4'))('rpc');var config=require(_0x717a('0x5'));var jayson=require(_0x717a('0x6'));var client=jayson['client'][_0x717a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ca7a6,_0xd7d2ce,_0x311738){return new BPromise(function(_0x536824,_0x1066d4){return client['request'](_0x1ca7a6,_0x311738)[_0x717a('0x8')](function(_0x567130){logger[_0x717a('0x9')](_0x717a('0xa'),_0xd7d2ce,_0x717a('0xb'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'),JSON[_0x717a('0xc')](_0x567130));if(_0x567130[_0x717a('0xd')]){if(_0x567130[_0x717a('0xd')][_0x717a('0xe')]===0x1f4){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x567130['error'][_0x717a('0xf')]);return _0x1066d4(_0x567130['error']['message']);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0xd7d2ce,_0x567130[_0x717a('0xd')]['message']);return _0x536824(_0x567130[_0x717a('0xd')]['message']);}else{logger[_0x717a('0x9')]('SmsTransferReport,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'));_0x536824(_0x567130[_0x717a('0x10')][_0x717a('0xf')]);}})['catch'](function(_0x186b4d){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x186b4d);_0x1066d4(_0x186b4d);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 51d4c24..303be72 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 _0xd2ae=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','download','diskStorage','join','server/files/sounds/original/','replace','format','%s-%s%s','basename','originalname','extname','post','single','file','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x309cbc,_0x543e8f){var _0x2ac832=function(_0xfe43bc){while(--_0xfe43bc){_0x309cbc['push'](_0x309cbc['shift']());}};_0x2ac832(++_0x543e8f);}(_0xd2ae,0x112));var _0xed2a=function(_0x595f81,_0x5aa969){_0x595f81=_0x595f81-0x0;var _0x3730df=_0xd2ae[_0x595f81];return _0x3730df;};'use strict';var multer=require(_0xed2a('0x0'));var util=require(_0xed2a('0x1'));var path=require(_0xed2a('0x2'));var timeout=require(_0xed2a('0x3'));var express=require(_0xed2a('0x4'));var router=express[_0xed2a('0x5')]();var auth=require(_0xed2a('0x6'));var interaction=require(_0xed2a('0x7'));var config=require(_0xed2a('0x8'));var controller=require('./sound.controller');router[_0xed2a('0x9')]('/',auth[_0xed2a('0xa')](),controller['index']);router[_0xed2a('0x9')]('/:id',auth[_0xed2a('0xa')](),controller[_0xed2a('0xb')]);router[_0xed2a('0x9')]('/:id/download',auth[_0xed2a('0xa')](),controller[_0xed2a('0xc')]);var upload=multer({'storage':multer[_0xed2a('0xd')]({'destination':function(_0x296f91,_0x46cb78,_0x36b612){_0x36b612(null,path[_0xed2a('0xe')](config['root'],_0xed2a('0xf')));},'filename':function(_0xe3c8,_0x4e4c04,_0x2139fe){_0x4e4c04['originalname']=_0x4e4c04['originalname'][_0xed2a('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2139fe(null,util[_0xed2a('0x11')](_0xed2a('0x12'),path[_0xed2a('0x13')](_0x4e4c04[_0xed2a('0x14')],path[_0xed2a('0x15')](_0x4e4c04[_0xed2a('0x14')])),Date['now'](),path[_0xed2a('0x15')](_0x4e4c04['originalname'])));}})});router[_0xed2a('0x16')]('/',upload[_0xed2a('0x17')](_0xed2a('0x18')),controller[_0xed2a('0x19')]);router[_0xed2a('0x1a')](_0xed2a('0x1b'),auth[_0xed2a('0xa')](),controller[_0xed2a('0x1c')]);router[_0xed2a('0x1d')](_0xed2a('0x1b'),auth[_0xed2a('0xa')](),controller['delete']);module[_0xed2a('0x1e')]=router; \ No newline at end of file +var _0xde34=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','/:id','show','download','diskStorage','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','create','put','update'];(function(_0x1e6d9c,_0x14f202){var _0x437359=function(_0x32e3b5){while(--_0x32e3b5){_0x1e6d9c['push'](_0x1e6d9c['shift']());}};_0x437359(++_0x14f202);}(_0xde34,0x1e2));var _0x4de3=function(_0x42ee35,_0x65953c){_0x42ee35=_0x42ee35-0x0;var _0x1bd2a4=_0xde34[_0x42ee35];return _0x1bd2a4;};'use strict';var multer=require(_0x4de3('0x0'));var util=require(_0x4de3('0x1'));var path=require(_0x4de3('0x2'));var timeout=require(_0x4de3('0x3'));var express=require(_0x4de3('0x4'));var router=express[_0x4de3('0x5')]();var auth=require(_0x4de3('0x6'));var interaction=require(_0x4de3('0x7'));var config=require('../../config/environment');var controller=require(_0x4de3('0x8'));router[_0x4de3('0x9')]('/',auth[_0x4de3('0xa')](),controller['index']);router['get'](_0x4de3('0xb'),auth[_0x4de3('0xa')](),controller[_0x4de3('0xc')]);router[_0x4de3('0x9')]('/:id/download',auth[_0x4de3('0xa')](),controller[_0x4de3('0xd')]);var upload=multer({'storage':multer[_0x4de3('0xe')]({'destination':function(_0x5b6caa,_0x621ba9,_0x1217c4){_0x1217c4(null,path['join'](config['root'],_0x4de3('0xf')));},'filename':function(_0x3e9afa,_0x26f67e,_0x3c0fc8){_0x26f67e[_0x4de3('0x10')]=_0x26f67e[_0x4de3('0x10')][_0x4de3('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3c0fc8(null,util['format'](_0x4de3('0x12'),path[_0x4de3('0x13')](_0x26f67e[_0x4de3('0x10')],path[_0x4de3('0x14')](_0x26f67e[_0x4de3('0x10')])),Date[_0x4de3('0x15')](),path[_0x4de3('0x14')](_0x26f67e[_0x4de3('0x10')])));}})});router[_0x4de3('0x16')]('/',upload[_0x4de3('0x17')](_0x4de3('0x18')),controller[_0x4de3('0x19')]);router[_0x4de3('0x1a')](_0x4de3('0xb'),auth[_0x4de3('0xa')](),controller[_0x4de3('0x1b')]);router[_0x4de3('0x1c')](_0x4de3('0xb'),auth['isAuthenticated'](),controller[_0x4de3('0x1c')]);module[_0x4de3('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 0c55703..3a59d8c 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 _0x833c=['name','FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x497e9c,_0x59ec56){var _0x4f6a28=function(_0x2dedcd){while(--_0x2dedcd){_0x497e9c['push'](_0x497e9c['shift']());}};_0x4f6a28(++_0x59ec56);}(_0x833c,0x10e));var _0xc833=function(_0x594482,_0x2590d2){_0x594482=_0x594482-0x0;var _0x1a9554=_0x833c[_0x594482];return _0x1a9554;};'use strict';var Sequelize=require(_0xc833('0x0'));module[_0xc833('0x1')]={'name':{'type':Sequelize[_0xc833('0x2')],'unique':_0xc833('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xc833('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xc833('0x2')]},'original_duration':{'type':Sequelize[_0xc833('0x4')]},'original_sampleCount':{'type':Sequelize[_0xc833('0x5')]},'original_channelCount':{'type':Sequelize[_0xc833('0x6')]},'original_bitRate':{'type':Sequelize[_0xc833('0x5')]},'original_sampleRate':{'type':Sequelize[_0xc833('0x6')]},'converted_format':{'type':Sequelize[_0xc833('0x2')]},'converted_duration':{'type':Sequelize[_0xc833('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xc833('0x5')]},'converted_channelCount':{'type':Sequelize[_0xc833('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xc833('0x6')]}}; \ No newline at end of file +var _0x602a=['STRING','name','FLOAT','INTEGER','BIGINT','sequelize','exports'];(function(_0x512974,_0x33e41c){var _0xf888b9=function(_0x3d6568){while(--_0x3d6568){_0x512974['push'](_0x512974['shift']());}};_0xf888b9(++_0x33e41c);}(_0x602a,0x194));var _0xa602=function(_0x559cb4,_0x1d282e){_0x559cb4=_0x559cb4-0x0;var _0x11f154=_0x602a[_0x559cb4];return _0x11f154;};'use strict';var Sequelize=require(_0xa602('0x0'));module[_0xa602('0x1')]={'name':{'type':Sequelize[_0xa602('0x2')],'unique':_0xa602('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xa602('0x2')]},'original_format':{'type':Sequelize[_0xa602('0x2')]},'original_duration':{'type':Sequelize[_0xa602('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xa602('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xa602('0x5')]},'converted_format':{'type':Sequelize[_0xa602('0x2')]},'converted_duration':{'type':Sequelize[_0xa602('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xa602('0x6')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xa602('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 87e5de4..cc1df08 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 _0xe2fe=['wav','server/files/sounds/original','join','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','duration','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_channelCount','converted_bitRate','bitRate','body','userProfileId','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','server/files/sounds/converted','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','querystring','../../components/auth/service','../../config/license/hardware','../../config/utils','sendStatus','status','end','json','offset','limit','apply','save','update','destroy','then','get','Sounds','UserProfileResource','name','send','index','Sound','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','map','type','VIRTUAL','field','options','count','findAll','rows','show','params','find','catch','download','existsSync','root','save_name','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xee2f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xee2f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee2f('0x2'));var moment=require(_0xee2f('0x3'));var BPromise=require(_0xee2f('0x4'));var Mustache=require(_0xee2f('0x5'));var util=require(_0xee2f('0x6'));var path=require('path');var sox=require(_0xee2f('0x7'));var csv=require(_0xee2f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x8'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var authService=require(_0xee2f('0xd'));var hardwareService=require(_0xee2f('0xe'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0xee2f('0xf'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53047d,_0x25ddf7){_0x25ddf7=_0x25ddf7||0xcc;return function(_0x346dbc){if(_0x346dbc){return _0x53047d[_0xee2f('0x10')](_0x25ddf7);}return _0x53047d[_0xee2f('0x11')](_0x25ddf7)[_0xee2f('0x12')]();};}function respondWithResult(_0x3ab91f,_0x4faa8f){_0x4faa8f=_0x4faa8f||0xc8;return function(_0x3861e6){if(_0x3861e6){return _0x3ab91f['status'](_0x4faa8f)[_0xee2f('0x13')](_0x3861e6);}};}function respondWithFilteredResult(_0x271c1d,_0x48b30c){return function(_0x445ba8){if(_0x445ba8){var _0x145241=_0x445ba8['count'],_0x28b614=_0x48b30c[_0xee2f('0x14')],_0x1bbf7d=_0x48b30c['offset']+_0x48b30c[_0xee2f('0x15')],_0x390c2c;if(_0x1bbf7d>=_0x145241){_0x1bbf7d=_0x145241;_0x390c2c=0xc8;}else{_0x390c2c=0xce;}_0x271c1d[_0xee2f('0x11')](_0x390c2c);return _0x271c1d['set']('Content-Range',_0x28b614+'-'+_0x1bbf7d+'/'+_0x145241)[_0xee2f('0x13')](_0x445ba8);}return null;};}function patchUpdates(_0x5a5078){return function(_0x69db88){try{jsonpatch[_0xee2f('0x16')](_0x69db88,_0x5a5078,!![]);}catch(_0x28549d){return BPromise['reject'](_0x28549d);}return _0x69db88[_0xee2f('0x17')]();};}function saveUpdates(_0x1e70aa,_0x4db2cc){return function(_0x21fdf4){if(_0x21fdf4){return _0x21fdf4[_0xee2f('0x18')](_0x1e70aa)['then'](function(_0x5e73ad){return _0x5e73ad;});}return null;};}function removeEntity(_0x40d1fd,_0x3a1852){return function(_0x1ea808){if(_0x1ea808){return _0x1ea808[_0xee2f('0x19')]()[_0xee2f('0x1a')](function(){var _0xf278cc=_0x1ea808[_0xee2f('0x1b')]({'plain':!![]});var _0x4d68d3=_0xee2f('0x1c');return db[_0xee2f('0x1d')][_0xee2f('0x19')]({'where':{'type':_0x4d68d3,'resourceId':_0xf278cc['id']}})[_0xee2f('0x1a')](function(){return _0x1ea808;});})[_0xee2f('0x1a')](function(){_0x40d1fd[_0xee2f('0x11')](0xcc)[_0xee2f('0x12')]();});}};}function handleEntityNotFound(_0x13013f,_0x382174){return function(_0x1e394f){if(!_0x1e394f){_0x13013f[_0xee2f('0x10')](0x194);}return _0x1e394f;};}function handleError(_0x168adc,_0x1c8454){_0x1c8454=_0x1c8454||0x1f4;return function(_0x45c4a0){logger['error'](_0x45c4a0['stack']);if(_0x45c4a0['name']){delete _0x45c4a0[_0xee2f('0x1e')];}_0x168adc[_0xee2f('0x11')](_0x1c8454)[_0xee2f('0x1f')](_0x45c4a0);};}exports[_0xee2f('0x20')]=function(_0x892a4e,_0x3737fd){var _0x4d8398={},_0x3d3806={},_0x52e1fa={'count':0x0,'rows':[]};var _0x235697=db[_0xee2f('0x21')][_0xee2f('0x22')];_0x3d3806[_0xee2f('0x23')]=_[_0xee2f('0x24')](_0x235697);_0x3d3806['query']=_[_0xee2f('0x24')](_0x892a4e[_0xee2f('0x25')]);_0x3d3806['filters']=_['intersection'](_0x3d3806[_0xee2f('0x23')],_0x3d3806['query']);_0x4d8398[_0xee2f('0x26')]=_[_0xee2f('0x27')](_0x3d3806['model'],qs[_0xee2f('0x28')](_0x892a4e['query']['fields']));_0x4d8398['attributes']=_0x4d8398[_0xee2f('0x26')][_0xee2f('0x29')]?_0x4d8398['attributes']:_0x3d3806[_0xee2f('0x23')];if(!_0x892a4e[_0xee2f('0x25')][_0xee2f('0x2a')](_0xee2f('0x2b'))){_0x4d8398[_0xee2f('0x15')]=qs['limit'](_0x892a4e[_0xee2f('0x25')]['limit']);_0x4d8398[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x892a4e[_0xee2f('0x25')]['offset']);}_0x4d8398[_0xee2f('0x2c')]=qs['sort'](_0x892a4e[_0xee2f('0x25')]['sort']);_0x4d8398[_0xee2f('0x2d')]=qs[_0xee2f('0x2e')](_[_0xee2f('0x2f')](_0x892a4e[_0xee2f('0x25')],_0x3d3806[_0xee2f('0x2e')]));if(_0x892a4e[_0xee2f('0x25')][_0xee2f('0x30')]){_0x4d8398[_0xee2f('0x2d')]=_[_0xee2f('0x31')](_0x4d8398[_0xee2f('0x2d')],{'$or':_[_0xee2f('0x32')](_0x235697,function(_0x5ad0a7){if(_0x5ad0a7[_0xee2f('0x33')]['key']!==_0xee2f('0x34')){var _0x3cbc01={};_0x3cbc01[_0x5ad0a7[_0xee2f('0x35')]]={'$like':'%'+_0x892a4e[_0xee2f('0x25')][_0xee2f('0x30')]+'%'};return _0x3cbc01;}})});}_0x4d8398=_[_0xee2f('0x31')]({},_0x4d8398,_0x892a4e[_0xee2f('0x36')]);var _0x130371={'where':_0x4d8398['where']};return db['Sound']['count'](_0x130371)[_0xee2f('0x1a')](function(_0x5483ae){_0x52e1fa[_0xee2f('0x37')]=_0x5483ae;if(_0x892a4e['query']['includeAll']){_0x4d8398['include']=[{'all':!![]}];}return db['Sound'][_0xee2f('0x38')](_0x4d8398);})[_0xee2f('0x1a')](function(_0x1ab34f){_0x52e1fa[_0xee2f('0x39')]=_0x1ab34f;return _0x52e1fa;})['then'](respondWithFilteredResult(_0x3737fd,_0x4d8398))['catch'](handleError(_0x3737fd,null));};exports[_0xee2f('0x3a')]=function(_0x5e12b7,_0x5a7825){var _0x8204dc={'raw':!![],'where':{'id':_0x5e12b7[_0xee2f('0x3b')]['id']}},_0x61d1c={};_0x61d1c['model']=_[_0xee2f('0x24')](db[_0xee2f('0x21')][_0xee2f('0x22')]);_0x61d1c['query']=_['keys'](_0x5e12b7[_0xee2f('0x25')]);_0x61d1c[_0xee2f('0x2e')]=_[_0xee2f('0x27')](_0x61d1c[_0xee2f('0x23')],_0x61d1c['query']);_0x8204dc[_0xee2f('0x26')]=_[_0xee2f('0x27')](_0x61d1c[_0xee2f('0x23')],qs[_0xee2f('0x28')](_0x5e12b7[_0xee2f('0x25')][_0xee2f('0x28')]));_0x8204dc[_0xee2f('0x26')]=_0x8204dc[_0xee2f('0x26')][_0xee2f('0x29')]?_0x8204dc[_0xee2f('0x26')]:_0x61d1c['model'];if(_0x5e12b7['query']['includeAll']){_0x8204dc['include']=[{'all':!![]}];}_0x8204dc=_[_0xee2f('0x31')]({},_0x8204dc,_0x5e12b7[_0xee2f('0x36')]);return db[_0xee2f('0x21')][_0xee2f('0x3c')](_0x8204dc)[_0xee2f('0x1a')](handleEntityNotFound(_0x5a7825,null))['then'](respondWithResult(_0x5a7825,null))[_0xee2f('0x3d')](handleError(_0x5a7825,null));};exports[_0xee2f('0x3e')]=function(_0x9aef4b,_0x3661e9,_0x57f493){return db['Sound']['find']({'where':{'id':_0x9aef4b[_0xee2f('0x3b')]['id']},'attributes':['name','save_name','converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x3661e9,null))[_0xee2f('0x1a')](function(_0x3ebb54){if(_0x3ebb54){if(!fs[_0xee2f('0x3f')](path['join'](config[_0xee2f('0x40')],'server/files/sounds/converted',_0x3ebb54[_0xee2f('0x41')]+'.'+_0x3ebb54[_0xee2f('0x42')]))){throw new db[(_0xee2f('0x43'))][(_0xee2f('0x44'))](_0xee2f('0x45'));}return _0x3661e9['download'](path['join'](config[_0xee2f('0x40')],'server/files/sounds/converted',util[_0xee2f('0x46')](_0xee2f('0x47'),_0x3ebb54[_0xee2f('0x41')],_0x3ebb54[_0xee2f('0x42')])),util['format']('%s.%s',_0x3ebb54[_0xee2f('0x1e')],_0x3ebb54[_0xee2f('0x42')]));}return null;})[_0xee2f('0x3d')](handleError(_0x3661e9,null));};exports[_0xee2f('0x48')]=function(_0x3acae6,_0x2a450f,_0x325d0e){var _0x4030c0={'name':path[_0xee2f('0x49')](_0x3acae6[_0xee2f('0x4a')][_0xee2f('0x4b')],path[_0xee2f('0x4c')](_0x3acae6['file'][_0xee2f('0x4b')])),'save_name':path[_0xee2f('0x49')](_0x3acae6[_0xee2f('0x4a')][_0xee2f('0x4d')],path['extname'](_0x3acae6[_0xee2f('0x4a')][_0xee2f('0x4d')])),'original_format':path[_0xee2f('0x4c')](_0x3acae6[_0xee2f('0x4a')][_0xee2f('0x4b')])['substring'](0x1),'converted_format':_0xee2f('0x4e')};var _0x5f456e=path['join'](config[_0xee2f('0x40')],_0xee2f('0x4f'),_0x3acae6[_0xee2f('0x4a')][_0xee2f('0x4d')]);var _0xabc876=path[_0xee2f('0x50')](config[_0xee2f('0x40')],'server/files/sounds/converted',util[_0xee2f('0x46')](_0xee2f('0x47'),path[_0xee2f('0x49')](_0x3acae6[_0xee2f('0x4a')][_0xee2f('0x4d')],path[_0xee2f('0x4c')](_0x3acae6[_0xee2f('0x4a')][_0xee2f('0x4d')])),_0x4030c0[_0xee2f('0x42')]));logger['info'](_0xee2f('0x51'),_0x5f456e);logger['info'](_0xee2f('0x52'),_0xabc876);try{fs[_0xee2f('0x53')](_0x5f456e,parseInt(_0xee2f('0x54'),0x8));var _0x11ba31=sox[_0xee2f('0x55')](_0x5f456e,_0xabc876,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x11ba31['on'](_0xee2f('0x56'),function(_0x42215c){fs[_0xee2f('0x57')](_0x5f456e);_0x2a450f[_0xee2f('0x11')](0x1f4)['send'](_0x42215c);});_0x11ba31['on']('src',function(_0x4fb159){_0x4030c0['original_duration']=isNaN(_0x4fb159['duration'])?null:_0x4fb159[_0xee2f('0x58')]*0x3e8;_0x4030c0['original_sampleCount']=isNaN(_0x4fb159[_0xee2f('0x59')])?null:_0x4fb159[_0xee2f('0x59')];_0x4030c0[_0xee2f('0x5a')]=isNaN(_0x4fb159[_0xee2f('0x5b')])?null:_0x4fb159[_0xee2f('0x5b')];_0x4030c0[_0xee2f('0x5c')]=isNaN(_0x4fb159['bitRate'])?null:_0x4fb159['bitRate'];_0x4030c0[_0xee2f('0x5d')]=isNaN(_0x4fb159['sampleRate'])?null:_0x4fb159[_0xee2f('0x5e')];});_0x11ba31['on']('dest',function(_0x7167f9){_0x4030c0['converted_duration']=isNaN(_0x7167f9[_0xee2f('0x58')])?null:_0x7167f9[_0xee2f('0x58')]*0x3e8;_0x4030c0[_0xee2f('0x5f')]=isNaN(_0x7167f9['sampleCount'])?null:_0x7167f9[_0xee2f('0x59')];_0x4030c0[_0xee2f('0x60')]=isNaN(_0x7167f9[_0xee2f('0x5b')])?null:_0x7167f9[_0xee2f('0x5b')];_0x4030c0[_0xee2f('0x61')]=isNaN(_0x7167f9[_0xee2f('0x62')])?null:_0x7167f9[_0xee2f('0x62')];_0x4030c0['converted_sampleRate']=isNaN(_0x7167f9[_0xee2f('0x5e')])?null:_0x7167f9[_0xee2f('0x5e')];});_0x11ba31['on'](_0xee2f('0x12'),function(){fs[_0xee2f('0x53')](_0xabc876,parseInt(_0xee2f('0x54'),0x8));return db[_0xee2f('0x21')][_0xee2f('0x48')](_0x4030c0)[_0xee2f('0x1a')](function(_0x191af8){var _0x35200d={'role':_0x3acae6[_0xee2f('0x63')]['role'],'userProfileId':_0x3acae6[_0xee2f('0x63')][_0xee2f('0x64')]};if(!_0x35200d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35200d[_0xee2f('0x65')]==='user'){var _0x4372cc=_0x191af8['get']({'plain':!![]});return db['UserProfileSection'][_0xee2f('0x3c')]({'where':{'name':_0xee2f('0x1c'),'userProfileId':_0x35200d[_0xee2f('0x64')]},'raw':!![]})[_0xee2f('0x1a')](function(_0x48c3fa){if(_0x48c3fa&&_0x48c3fa['autoAssociation']===0x0){return db[_0xee2f('0x1d')][_0xee2f('0x48')]({'name':_0x4372cc[_0xee2f('0x1e')],'resourceId':_0x4372cc['id'],'type':_0x48c3fa['name'],'sectionId':_0x48c3fa['id']},{})[_0xee2f('0x1a')](function(){return _0x191af8;});}else{return _0x191af8;}})[_0xee2f('0x3d')](function(_0x52aba3){logger[_0xee2f('0x56')](_0xee2f('0x66'),_0x52aba3);throw _0x52aba3;});}return _0x191af8;})[_0xee2f('0x1a')](respondWithResult(_0x2a450f,null))[_0xee2f('0x3d')](handleError(_0x2a450f,null));});_0x11ba31[_0xee2f('0x67')]();}catch(_0x2adcc6){_0x2a450f[_0xee2f('0x11')](0x1f4)[_0xee2f('0x1f')](_0x2adcc6);}};exports[_0xee2f('0x18')]=function(_0x4adcbe,_0x5cc502,_0x58d16e){return db[_0xee2f('0x21')][_0xee2f('0x3c')]({'where':{'id':_0x4adcbe[_0xee2f('0x3b')]['id']}})[_0xee2f('0x1a')](handleEntityNotFound(_0x5cc502,null))[_0xee2f('0x1a')](saveUpdates(_['pick'](_0x4adcbe[_0xee2f('0x63')],[_0xee2f('0x1e'),'description']),null))[_0xee2f('0x1a')](respondWithResult(_0x5cc502,null))[_0xee2f('0x3d')](handleError(_0x5cc502,null));};exports[_0xee2f('0x68')]=function(_0x5a7b6c,_0x3637cd,_0x4858a3){return db[_0xee2f('0x21')][_0xee2f('0x3c')]({'where':{'id':_0x5a7b6c['params']['id']}})[_0xee2f('0x1a')](function(_0x29b389){if(_0x29b389){return _0x29b389['destroy']();}})['then'](function(_0x48f0ff){var _0x2cee75=path['join'](config['root'],_0xee2f('0x4f'),util[_0xee2f('0x46')]('%s.%s',_0x48f0ff[_0xee2f('0x41')],_0x48f0ff['original_format']));var _0x25bba2=path[_0xee2f('0x50')](config[_0xee2f('0x40')],_0xee2f('0x69'),util[_0xee2f('0x46')](_0xee2f('0x47'),_0x48f0ff[_0xee2f('0x41')],_0x48f0ff['converted_format']));fs[_0xee2f('0x57')](_0x2cee75);fs[_0xee2f('0x57')](_0x25bba2);return _0x48f0ff;})[_0xee2f('0x1a')](function(_0x2613ba){if(_0x2613ba){return _0x3637cd[_0xee2f('0x11')](0xcc)['end']();}})[_0xee2f('0x1a')](handleEntityNotFound(_0x3637cd,null))[_0xee2f('0x3d')](handleError(_0x3637cd,null));}; \ No newline at end of file +var _0x6343=['channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','unlinkSync','rimraf','zip-dir','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','send','Sound','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','merge','options','includeAll','include','findAll','params','rawAttributes','find','catch','download','name','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','join','format','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','error','duration','original_sampleCount','sampleCount'];(function(_0x1a8552,_0x156992){var _0x122b78=function(_0x26a8aa){while(--_0x26a8aa){_0x1a8552['push'](_0x1a8552['shift']());}};_0x122b78(++_0x156992);}(_0x6343,0x168));var _0x3634=function(_0x4985a3,_0x59a9ac){_0x4985a3=_0x4985a3-0x0;var _0x26c857=_0x6343[_0x4985a3];return _0x26c857;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3634('0x0'));var zipdir=require(_0x3634('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3634('0x2'));var util=require(_0x3634('0x3'));var path=require('path');var sox=require(_0x3634('0x4'));var csv=require(_0x3634('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x5'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var authService=require(_0x3634('0xb'));var hardwareService=require(_0x3634('0xc'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x3634('0xd'))(_0x3634('0xe'));var utils=require('../../config/utils');var config=require(_0x3634('0xf'));var db=require(_0x3634('0x10'))['db'];function respondWithStatusCode(_0x242c24,_0x1d180f){_0x1d180f=_0x1d180f||0xcc;return function(_0x1e6a04){if(_0x1e6a04){return _0x242c24[_0x3634('0x11')](_0x1d180f);}return _0x242c24[_0x3634('0x12')](_0x1d180f)[_0x3634('0x13')]();};}function respondWithResult(_0x7f5aca,_0x36f54b){_0x36f54b=_0x36f54b||0xc8;return function(_0x299e53){if(_0x299e53){return _0x7f5aca[_0x3634('0x12')](_0x36f54b)[_0x3634('0x14')](_0x299e53);}};}function respondWithFilteredResult(_0x2ad793,_0x5a5063){return function(_0x167247){if(_0x167247){var _0x48787f=_0x167247[_0x3634('0x15')],_0x69609d=_0x5a5063[_0x3634('0x16')],_0x18285c=_0x5a5063['offset']+_0x5a5063[_0x3634('0x17')],_0x2fc628;if(_0x18285c>=_0x48787f){_0x18285c=_0x48787f;_0x2fc628=0xc8;}else{_0x2fc628=0xce;}_0x2ad793['status'](_0x2fc628);return _0x2ad793['set'](_0x3634('0x18'),_0x69609d+'-'+_0x18285c+'/'+_0x48787f)['json'](_0x167247);}return null;};}function patchUpdates(_0x2fac8b){return function(_0x32e3c6){try{jsonpatch[_0x3634('0x19')](_0x32e3c6,_0x2fac8b,!![]);}catch(_0x5603d2){return BPromise[_0x3634('0x1a')](_0x5603d2);}return _0x32e3c6[_0x3634('0x1b')]();};}function saveUpdates(_0x577a6c,_0xeb9231){return function(_0x506281){if(_0x506281){return _0x506281[_0x3634('0x1c')](_0x577a6c)[_0x3634('0x1d')](function(_0x5b77a7){return _0x5b77a7;});}return null;};}function removeEntity(_0x29a343,_0x3df472){return function(_0x206c8e){if(_0x206c8e){return _0x206c8e['destroy']()[_0x3634('0x1d')](function(){var _0x2c8874=_0x206c8e['get']({'plain':!![]});var _0x3936ee='Sounds';return db['UserProfileResource'][_0x3634('0x1e')]({'where':{'type':_0x3936ee,'resourceId':_0x2c8874['id']}})[_0x3634('0x1d')](function(){return _0x206c8e;});})['then'](function(){_0x29a343[_0x3634('0x12')](0xcc)[_0x3634('0x13')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x11')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x1f')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x20')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=db[_0x3634('0x21')]['rawAttributes'];_0x55a77f[_0x3634('0x22')]=_[_0x3634('0x23')](_0x5bd4e0);_0x55a77f[_0x3634('0x24')]=_[_0x3634('0x23')](_0x3bf28b[_0x3634('0x24')]);_0x55a77f[_0x3634('0x25')]=_[_0x3634('0x26')](_0x55a77f[_0x3634('0x22')],_0x55a77f['query']);_0x49804f['attributes']=_['intersection'](_0x55a77f[_0x3634('0x22')],qs['fields'](_0x3bf28b[_0x3634('0x24')][_0x3634('0x27')]));_0x49804f[_0x3634('0x28')]=_0x49804f[_0x3634('0x28')][_0x3634('0x29')]?_0x49804f[_0x3634('0x28')]:_0x55a77f['model'];if(!_0x3bf28b[_0x3634('0x24')][_0x3634('0x2a')](_0x3634('0x2b'))){_0x49804f[_0x3634('0x17')]=qs[_0x3634('0x17')](_0x3bf28b[_0x3634('0x24')][_0x3634('0x17')]);_0x49804f[_0x3634('0x16')]=qs[_0x3634('0x16')](_0x3bf28b['query'][_0x3634('0x16')]);}_0x49804f[_0x3634('0x2c')]=qs[_0x3634('0x2d')](_0x3bf28b[_0x3634('0x24')]['sort']);_0x49804f[_0x3634('0x2e')]=qs[_0x3634('0x25')](_[_0x3634('0x2f')](_0x3bf28b['query'],_0x55a77f['filters']));if(_0x3bf28b['query'][_0x3634('0x30')]){_0x49804f[_0x3634('0x2e')]=_['merge'](_0x49804f[_0x3634('0x2e')],{'$or':_[_0x3634('0x31')](_0x5bd4e0,function(_0x105507){if(_0x105507[_0x3634('0x32')][_0x3634('0x33')]!==_0x3634('0x34')){var _0x431619={};_0x431619[_0x105507['field']]={'$like':'%'+_0x3bf28b[_0x3634('0x24')]['filter']+'%'};return _0x431619;}})});}_0x49804f=_[_0x3634('0x35')]({},_0x49804f,_0x3bf28b[_0x3634('0x36')]);var _0x2f1744={'where':_0x49804f[_0x3634('0x2e')]};return db[_0x3634('0x21')]['count'](_0x2f1744)[_0x3634('0x1d')](function(_0x33af29){_0x282f73[_0x3634('0x15')]=_0x33af29;if(_0x3bf28b[_0x3634('0x24')][_0x3634('0x37')]){_0x49804f[_0x3634('0x38')]=[{'all':!![]}];}return db[_0x3634('0x21')][_0x3634('0x39')](_0x49804f);})[_0x3634('0x1d')](function(_0x523555){_0x282f73['rows']=_0x523555;return _0x282f73;})[_0x3634('0x1d')](respondWithFilteredResult(_0x12b80e,_0x49804f))['catch'](handleError(_0x12b80e,null));};exports['show']=function(_0x5948db,_0x80f1a2){var _0x4d06f9={'raw':!![],'where':{'id':_0x5948db[_0x3634('0x3a')]['id']}},_0x197d65={};_0x197d65['model']=_['keys'](db['Sound'][_0x3634('0x3b')]);_0x197d65[_0x3634('0x24')]=_['keys'](_0x5948db[_0x3634('0x24')]);_0x197d65[_0x3634('0x25')]=_[_0x3634('0x26')](_0x197d65[_0x3634('0x22')],_0x197d65[_0x3634('0x24')]);_0x4d06f9['attributes']=_['intersection'](_0x197d65[_0x3634('0x22')],qs[_0x3634('0x27')](_0x5948db[_0x3634('0x24')][_0x3634('0x27')]));_0x4d06f9[_0x3634('0x28')]=_0x4d06f9[_0x3634('0x28')]['length']?_0x4d06f9[_0x3634('0x28')]:_0x197d65[_0x3634('0x22')];if(_0x5948db[_0x3634('0x24')]['includeAll']){_0x4d06f9['include']=[{'all':!![]}];}_0x4d06f9=_[_0x3634('0x35')]({},_0x4d06f9,_0x5948db[_0x3634('0x36')]);return db[_0x3634('0x21')][_0x3634('0x3c')](_0x4d06f9)[_0x3634('0x1d')](handleEntityNotFound(_0x80f1a2,null))[_0x3634('0x1d')](respondWithResult(_0x80f1a2,null))[_0x3634('0x3d')](handleError(_0x80f1a2,null));};exports[_0x3634('0x3e')]=function(_0x52de40,_0xfb94f0,_0x3401b8){return db[_0x3634('0x21')][_0x3634('0x3c')]({'where':{'id':_0x52de40[_0x3634('0x3a')]['id']},'attributes':[_0x3634('0x3f'),_0x3634('0x40'),_0x3634('0x41')],'raw':!![]})[_0x3634('0x1d')](handleEntityNotFound(_0xfb94f0,null))['then'](function(_0x279d34){if(_0x279d34){if(!fs[_0x3634('0x42')](path['join'](config[_0x3634('0x43')],_0x3634('0x44'),_0x279d34[_0x3634('0x40')]+'.'+_0x279d34[_0x3634('0x41')]))){throw new db[(_0x3634('0x45'))][(_0x3634('0x46'))]('Sound\x20not\x20found');}return _0xfb94f0[_0x3634('0x3e')](path[_0x3634('0x47')](config[_0x3634('0x43')],_0x3634('0x44'),util[_0x3634('0x48')]('%s.%s',_0x279d34[_0x3634('0x40')],_0x279d34[_0x3634('0x41')])),util['format']('%s.%s',_0x279d34[_0x3634('0x3f')],_0x279d34['converted_format']));}return null;})[_0x3634('0x3d')](handleError(_0xfb94f0,null));};exports[_0x3634('0x49')]=function(_0x1943a5,_0x1834a3,_0x5a024e){var _0x274494={'name':path[_0x3634('0x4a')](_0x1943a5[_0x3634('0x4b')][_0x3634('0x4c')],path[_0x3634('0x4d')](_0x1943a5[_0x3634('0x4b')][_0x3634('0x4c')])),'save_name':path[_0x3634('0x4a')](_0x1943a5[_0x3634('0x4b')][_0x3634('0x4e')],path[_0x3634('0x4d')](_0x1943a5[_0x3634('0x4b')]['filename'])),'original_format':path[_0x3634('0x4d')](_0x1943a5[_0x3634('0x4b')][_0x3634('0x4c')])[_0x3634('0x4f')](0x1),'converted_format':_0x3634('0x50')};var _0x15f414=path[_0x3634('0x47')](config[_0x3634('0x43')],_0x3634('0x51'),_0x1943a5['file'][_0x3634('0x4e')]);var _0x2ea4b0=path['join'](config[_0x3634('0x43')],_0x3634('0x44'),util['format'](_0x3634('0x52'),path[_0x3634('0x4a')](_0x1943a5[_0x3634('0x4b')]['filename'],path[_0x3634('0x4d')](_0x1943a5['file'][_0x3634('0x4e')])),_0x274494['converted_format']));logger[_0x3634('0x53')](_0x3634('0x54'),_0x15f414);logger[_0x3634('0x53')]('Sound\x20upload\x20destination:\x20%s',_0x2ea4b0);try{fs[_0x3634('0x55')](_0x15f414,parseInt(_0x3634('0x56'),0x8));var _0x5df700=sox[_0x3634('0x57')](_0x15f414,_0x2ea4b0,{'sampleRate':0x1f40,'format':_0x3634('0x50'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5df700['on'](_0x3634('0x58'),function(_0x6781cb){fs['unlinkSync'](_0x15f414);_0x1834a3[_0x3634('0x12')](0x1f4)[_0x3634('0x20')](_0x6781cb);});_0x5df700['on']('src',function(_0x5b8db4){_0x274494['original_duration']=isNaN(_0x5b8db4[_0x3634('0x59')])?null:_0x5b8db4['duration']*0x3e8;_0x274494[_0x3634('0x5a')]=isNaN(_0x5b8db4[_0x3634('0x5b')])?null:_0x5b8db4[_0x3634('0x5b')];_0x274494['original_channelCount']=isNaN(_0x5b8db4[_0x3634('0x5c')])?null:_0x5b8db4[_0x3634('0x5c')];_0x274494['original_bitRate']=isNaN(_0x5b8db4[_0x3634('0x5d')])?null:_0x5b8db4[_0x3634('0x5d')];_0x274494[_0x3634('0x5e')]=isNaN(_0x5b8db4['sampleRate'])?null:_0x5b8db4[_0x3634('0x5f')];});_0x5df700['on'](_0x3634('0x60'),function(_0x897c0e){_0x274494[_0x3634('0x61')]=isNaN(_0x897c0e[_0x3634('0x59')])?null:_0x897c0e['duration']*0x3e8;_0x274494[_0x3634('0x62')]=isNaN(_0x897c0e[_0x3634('0x5b')])?null:_0x897c0e[_0x3634('0x5b')];_0x274494['converted_channelCount']=isNaN(_0x897c0e[_0x3634('0x5c')])?null:_0x897c0e['channelCount'];_0x274494[_0x3634('0x63')]=isNaN(_0x897c0e[_0x3634('0x5d')])?null:_0x897c0e['bitRate'];_0x274494[_0x3634('0x64')]=isNaN(_0x897c0e[_0x3634('0x5f')])?null:_0x897c0e[_0x3634('0x5f')];});_0x5df700['on']('end',function(){fs[_0x3634('0x55')](_0x2ea4b0,parseInt('0777',0x8));return db['Sound'][_0x3634('0x49')](_0x274494)['then'](function(_0x30fd12){var _0x70898e={'role':_0x1943a5[_0x3634('0x65')][_0x3634('0x66')],'userProfileId':_0x1943a5['body'][_0x3634('0x67')]};if(!_0x70898e)throw new Error(_0x3634('0x68'));if(_0x70898e['role']===_0x3634('0x69')){var _0x5328b3=_0x30fd12[_0x3634('0x6a')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x3634('0x6b'),'userProfileId':_0x70898e[_0x3634('0x67')]},'raw':!![]})[_0x3634('0x1d')](function(_0x55f9dc){if(_0x55f9dc&&_0x55f9dc[_0x3634('0x6c')]===0x0){return db['UserProfileResource'][_0x3634('0x49')]({'name':_0x5328b3[_0x3634('0x3f')],'resourceId':_0x5328b3['id'],'type':_0x55f9dc[_0x3634('0x3f')],'sectionId':_0x55f9dc['id']},{})[_0x3634('0x1d')](function(){return _0x30fd12;});}else{return _0x30fd12;}})[_0x3634('0x3d')](function(_0x11ecfb){logger[_0x3634('0x58')](_0x3634('0x6d'),_0x11ecfb);throw _0x11ecfb;});}return _0x30fd12;})[_0x3634('0x1d')](respondWithResult(_0x1834a3,null))[_0x3634('0x3d')](handleError(_0x1834a3,null));});_0x5df700[_0x3634('0x6e')]();}catch(_0x4bbfed){_0x1834a3['status'](0x1f4)[_0x3634('0x20')](_0x4bbfed);}};exports['update']=function(_0x465712,_0x352d98,_0x3376ef){return db[_0x3634('0x21')][_0x3634('0x3c')]({'where':{'id':_0x465712['params']['id']}})[_0x3634('0x1d')](handleEntityNotFound(_0x352d98,null))[_0x3634('0x1d')](saveUpdates(_[_0x3634('0x2f')](_0x465712[_0x3634('0x65')],[_0x3634('0x3f'),'description']),null))[_0x3634('0x1d')](respondWithResult(_0x352d98,null))[_0x3634('0x3d')](handleError(_0x352d98,null));};exports[_0x3634('0x6f')]=function(_0x363d8b,_0x505424,_0x5c0a54){return db[_0x3634('0x21')][_0x3634('0x3c')]({'where':{'id':_0x363d8b[_0x3634('0x3a')]['id']}})[_0x3634('0x1d')](function(_0x4a5dc1){if(_0x4a5dc1){return _0x4a5dc1[_0x3634('0x1e')]();}})['then'](function(_0x459f53){var _0x543328=path[_0x3634('0x47')](config[_0x3634('0x43')],_0x3634('0x51'),util[_0x3634('0x48')](_0x3634('0x52'),_0x459f53[_0x3634('0x40')],_0x459f53['original_format']));var _0x3007d1=path['join'](config[_0x3634('0x43')],_0x3634('0x44'),util[_0x3634('0x48')](_0x3634('0x52'),_0x459f53[_0x3634('0x40')],_0x459f53[_0x3634('0x41')]));fs[_0x3634('0x70')](_0x543328);fs[_0x3634('0x70')](_0x3007d1);return _0x459f53;})[_0x3634('0x1d')](function(_0x588133){if(_0x588133){return _0x505424[_0x3634('0x12')](0xcc)[_0x3634('0x13')]();}})[_0x3634('0x1d')](handleEntityNotFound(_0x505424,null))[_0x3634('0x3d')](handleError(_0x505424,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index a94d9bd..4487030 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 _0x30fb=['lodash','util','../../config/logger','api','moment','bluebird','./sound.attributes','exports','define','Sound'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x30fb,0x19a));var _0xb30f=function(_0x2fa46a,_0x28c267){_0x2fa46a=_0x2fa46a-0x0;var _0x29812c=_0x30fb[_0x2fa46a];return _0x29812c;};'use strict';var _=require(_0xb30f('0x0'));var util=require(_0xb30f('0x1'));var logger=require(_0xb30f('0x2'))(_0xb30f('0x3'));var moment=require(_0xb30f('0x4'));var BPromise=require(_0xb30f('0x5'));var rp=require('request-promise');var attributes=require(_0xb30f('0x6'));module[_0xb30f('0x7')]=function(_0xf9a49a,_0x225dce){return _0xf9a49a[_0xb30f('0x8')](_0xb30f('0x9'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8bf5=['request-promise','exports','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x290c65,_0x44249d){var _0x1d1661=function(_0x48bb41){while(--_0x48bb41){_0x290c65['push'](_0x290c65['shift']());}};_0x1d1661(++_0x44249d);}(_0x8bf5,0xe0));var _0x58bf=function(_0x3f01dd,_0x128e0f){_0x3f01dd=_0x3f01dd-0x0;var _0x4bae40=_0x8bf5[_0x3f01dd];return _0x4bae40;};'use strict';var _=require(_0x58bf('0x0'));var util=require(_0x58bf('0x1'));var logger=require(_0x58bf('0x2'))(_0x58bf('0x3'));var moment=require(_0x58bf('0x4'));var BPromise=require(_0x58bf('0x5'));var rp=require(_0x58bf('0x6'));var attributes=require('./sound.attributes');module[_0x58bf('0x7')]=function(_0x42331d,_0x126aab){return _0x42331d['define'](_0x58bf('0x8'),attributes,{'tableName':_0x58bf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 54445bf..59fb59e 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 _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x547de8,_0x31a7ac){var _0x57f686=function(_0x3a5133){while(--_0x3a5133){_0x547de8['push'](_0x547de8['shift']());}};_0x57f686(++_0x31a7ac);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var 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);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','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(_0x4b9273,_0x434262){var _0x1dbc00=function(_0xf86bd6){while(--_0xf86bd6){_0x4b9273['push'](_0x4b9273['shift']());}};_0x1dbc00(++_0x434262);}(_0xb10b,0x12a));var _0xbb10=function(_0x44f974,_0x4db616){_0x44f974=_0x44f974-0x0;var _0x805dbd=_0xb10b[_0x44f974];return _0x805dbd;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 8ffc8ec..16de23d 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 _0x6554=['create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','/:id','show','post'];(function(_0x849841,_0x49e844){var _0x47c4f7=function(_0x211e3c){while(--_0x211e3c){_0x849841['push'](_0x849841['shift']());}};_0x47c4f7(++_0x49e844);}(_0x6554,0x181));var _0x4655=function(_0x26ea7d,_0x3f6c0f){_0x26ea7d=_0x26ea7d-0x0;var _0x3f85fb=_0x6554[_0x26ea7d];return _0x3f85fb;};'use strict';var multer=require(_0x4655('0x0'));var util=require(_0x4655('0x1'));var path=require(_0x4655('0x2'));var timeout=require(_0x4655('0x3'));var express=require(_0x4655('0x4'));var router=express[_0x4655('0x5')]();var auth=require(_0x4655('0x6'));var interaction=require(_0x4655('0x7'));var config=require(_0x4655('0x8'));var controller=require(_0x4655('0x9'));router[_0x4655('0xa')]('/',auth[_0x4655('0xb')](),controller['index']);router[_0x4655('0xa')](_0x4655('0xc'),auth[_0x4655('0xb')](),controller[_0x4655('0xd')]);router[_0x4655('0xe')]('/',auth[_0x4655('0xb')](),controller[_0x4655('0xf')]);router[_0x4655('0x10')](_0x4655('0xc'),auth['isAuthenticated'](),controller[_0x4655('0x11')]);router[_0x4655('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x4655('0x13')]=router; \ No newline at end of file +var _0xb5c6=['put','/:id','delete','destroy','exports','util','path','connect-timeout','express','./squareMessage.controller','get','index','isAuthenticated','show','post','create'];(function(_0x3d4787,_0x425210){var _0xbeeb22=function(_0x28888e){while(--_0x28888e){_0x3d4787['push'](_0x3d4787['shift']());}};_0xbeeb22(++_0x425210);}(_0xb5c6,0xe5));var _0x6b5c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb5c6[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x6b5c('0x0'));var path=require(_0x6b5c('0x1'));var timeout=require(_0x6b5c('0x2'));var express=require(_0x6b5c('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(_0x6b5c('0x4'));router[_0x6b5c('0x5')]('/',auth['isAuthenticated'](),controller[_0x6b5c('0x6')]);router[_0x6b5c('0x5')]('/:id',auth[_0x6b5c('0x7')](),controller[_0x6b5c('0x8')]);router[_0x6b5c('0x9')]('/',auth[_0x6b5c('0x7')](),controller[_0x6b5c('0xa')]);router[_0x6b5c('0xb')](_0x6b5c('0xc'),auth[_0x6b5c('0x7')](),controller['update']);router[_0x6b5c('0xd')]('/:id',auth[_0x6b5c('0x7')](),controller[_0x6b5c('0xe')]);module[_0x6b5c('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 8b4e636..8ef44ec 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 _0xe2b4=['STRING','TEXT','ENUM','out','exports'];(function(_0xb1c5d5,_0x3a2038){var _0x3766dc=function(_0x12344b){while(--_0x12344b){_0xb1c5d5['push'](_0xb1c5d5['shift']());}};_0x3766dc(++_0x3a2038);}(_0xe2b4,0x68));var _0x4e2b=function(_0x401d05,_0x8a83f0){_0x401d05=_0x401d05-0x0;var _0x3679d7=_0xe2b4[_0x401d05];return _0x3679d7;};'use strict';var Sequelize=require('sequelize');module[_0x4e2b('0x0')]={'uniqueid':{'type':Sequelize[_0x4e2b('0x1')]},'body':{'type':Sequelize[_0x4e2b('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x4e2b('0x3')]('in','out'),'defaultValue':_0x4e2b('0x4'),'allowNull':![]}}; \ No newline at end of file +var _0x1ea1=['ENUM','out','sequelize','exports','STRING','TEXT','medium'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1ea1,0x198));var _0x11ea=function(_0x5961a3,_0x37ddd1){_0x5961a3=_0x5961a3-0x0;var _0x19cce1=_0x1ea1[_0x5961a3];return _0x19cce1;};'use strict';var Sequelize=require(_0x11ea('0x0'));module[_0x11ea('0x1')]={'uniqueid':{'type':Sequelize[_0x11ea('0x2')]},'body':{'type':Sequelize[_0x11ea('0x3')](_0x11ea('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x11ea('0x5')]('in',_0x11ea('0x6')),'defaultValue':_0x11ea('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 2cf7f81..7ab86af 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 _0x3d9c=['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/utils','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','reject','save','then','destroy','end','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','filter','options','SquareMessage','includeAll','include','findAll','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x93086d,_0x12e680){var _0x40405b=function(_0x234406){while(--_0x234406){_0x93086d['push'](_0x93086d['shift']());}};_0x40405b(++_0x12e680);}(_0x3d9c,0x1aa));var _0xc3d9=function(_0x3c1b20,_0xd4b152){_0x3c1b20=_0x3c1b20-0x0;var _0x20ae71=_0x3d9c[_0x3c1b20];return _0x20ae71;};'use strict';var pdf=require(_0xc3d9('0x0'));var emlformat=require(_0xc3d9('0x1'));var rimraf=require(_0xc3d9('0x2'));var zipdir=require(_0xc3d9('0x3'));var jsonpatch=require(_0xc3d9('0x4'));var rp=require(_0xc3d9('0x5'));var moment=require('moment');var BPromise=require(_0xc3d9('0x6'));var Mustache=require(_0xc3d9('0x7'));var util=require(_0xc3d9('0x8'));var path=require(_0xc3d9('0x9'));var sox=require(_0xc3d9('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc3d9('0xb'));var squel=require(_0xc3d9('0xc'));var crypto=require(_0xc3d9('0xd'));var jsforce=require(_0xc3d9('0xe'));var deskjs=require(_0xc3d9('0xf'));var toCsv=require(_0xc3d9('0x10'));var querystring=require(_0xc3d9('0x11'));var Papa=require(_0xc3d9('0x12'));var authService=require(_0xc3d9('0x13'));var hardwareService=require(_0xc3d9('0x14'));var Redis=require('ioredis');var qs=require(_0xc3d9('0x15'));var logger=require(_0xc3d9('0x16'))(_0xc3d9('0x17'));var utils=require(_0xc3d9('0x18'));var config=require('../../config/environment');var db=require(_0xc3d9('0x19'))['db'];function respondWithStatusCode(_0x655405,_0x36fb45){_0x36fb45=_0x36fb45||0xcc;return function(_0x330732){if(_0x330732){return _0x655405[_0xc3d9('0x1a')](_0x36fb45);}return _0x655405[_0xc3d9('0x1b')](_0x36fb45)['end']();};}function respondWithResult(_0x2ddbe6,_0x57f93f){_0x57f93f=_0x57f93f||0xc8;return function(_0x234342){if(_0x234342){return _0x2ddbe6[_0xc3d9('0x1b')](_0x57f93f)[_0xc3d9('0x1c')](_0x234342);}};}function respondWithFilteredResult(_0x34b422,_0xcff734){return function(_0x4c3ace){if(_0x4c3ace){var _0x22a660=_0x4c3ace['count'],_0x28e7f0=_0xcff734[_0xc3d9('0x1d')],_0x4b69b9=_0xcff734[_0xc3d9('0x1d')]+_0xcff734[_0xc3d9('0x1e')],_0x13e001;if(_0x4b69b9>=_0x22a660){_0x4b69b9=_0x22a660;_0x13e001=0xc8;}else{_0x13e001=0xce;}_0x34b422[_0xc3d9('0x1b')](_0x13e001);return _0x34b422[_0xc3d9('0x1f')]('Content-Range',_0x28e7f0+'-'+_0x4b69b9+'/'+_0x22a660)[_0xc3d9('0x1c')](_0x4c3ace);}return null;};}function patchUpdates(_0x362832){return function(_0x21fce5){try{jsonpatch[_0xc3d9('0x20')](_0x21fce5,_0x362832,!![]);}catch(_0x328b84){return BPromise[_0xc3d9('0x21')](_0x328b84);}return _0x21fce5[_0xc3d9('0x22')]();};}function saveUpdates(_0x309248,_0x5d361d){return function(_0x1a69ab){if(_0x1a69ab){return _0x1a69ab['update'](_0x309248)[_0xc3d9('0x23')](function(_0x5cc0cf){return _0x5cc0cf;});}return null;};}function removeEntity(_0x14e8fd,_0x506abc){return function(_0x46aec9){if(_0x46aec9){return _0x46aec9[_0xc3d9('0x24')]()['then'](function(){_0x14e8fd['status'](0xcc)[_0xc3d9('0x25')]();});}};}function handleEntityNotFound(_0x4b8442,_0x2a9f67){return function(_0x431792){if(!_0x431792){_0x4b8442['sendStatus'](0x194);}return _0x431792;};}function handleError(_0x100cfc,_0x45e749){_0x45e749=_0x45e749||0x1f4;return function(_0x2655eb){logger['error'](_0x2655eb[_0xc3d9('0x26')]);if(_0x2655eb[_0xc3d9('0x27')]){delete _0x2655eb['name'];}_0x100cfc[_0xc3d9('0x1b')](_0x45e749)[_0xc3d9('0x28')](_0x2655eb);};}exports['index']=function(_0x122195,_0x11013a){var _0x138df2={},_0x65e542={},_0xc6b060={'count':0x0,'rows':[]};var _0x1b6ebb=db['SquareMessage'][_0xc3d9('0x29')];_0x65e542[_0xc3d9('0x2a')]=_[_0xc3d9('0x2b')](_0x1b6ebb);_0x65e542[_0xc3d9('0x2c')]=_[_0xc3d9('0x2b')](_0x122195['query']);_0x65e542[_0xc3d9('0x2d')]=_[_0xc3d9('0x2e')](_0x65e542[_0xc3d9('0x2a')],_0x65e542['query']);_0x138df2['attributes']=_['intersection'](_0x65e542[_0xc3d9('0x2a')],qs[_0xc3d9('0x2f')](_0x122195[_0xc3d9('0x2c')]['fields']));_0x138df2[_0xc3d9('0x30')]=_0x138df2[_0xc3d9('0x30')][_0xc3d9('0x31')]?_0x138df2[_0xc3d9('0x30')]:_0x65e542[_0xc3d9('0x2a')];if(!_0x122195[_0xc3d9('0x2c')][_0xc3d9('0x32')](_0xc3d9('0x33'))){_0x138df2[_0xc3d9('0x1e')]=qs[_0xc3d9('0x1e')](_0x122195[_0xc3d9('0x2c')][_0xc3d9('0x1e')]);_0x138df2[_0xc3d9('0x1d')]=qs[_0xc3d9('0x1d')](_0x122195[_0xc3d9('0x2c')]['offset']);}_0x138df2[_0xc3d9('0x34')]=qs[_0xc3d9('0x35')](_0x122195['query'][_0xc3d9('0x35')]);_0x138df2[_0xc3d9('0x36')]=qs[_0xc3d9('0x2d')](_['pick'](_0x122195[_0xc3d9('0x2c')],_0x65e542[_0xc3d9('0x2d')]));if(_0x122195[_0xc3d9('0x2c')]['filter']){_0x138df2['where']=_[_0xc3d9('0x37')](_0x138df2[_0xc3d9('0x36')],{'$or':_[_0xc3d9('0x38')](_0x1b6ebb,function(_0x532934){if(_0x532934[_0xc3d9('0x39')][_0xc3d9('0x3a')]!==_0xc3d9('0x3b')){var _0x328350={};_0x328350[_0x532934['field']]={'$like':'%'+_0x122195[_0xc3d9('0x2c')][_0xc3d9('0x3c')]+'%'};return _0x328350;}})});}_0x138df2=_[_0xc3d9('0x37')]({},_0x138df2,_0x122195[_0xc3d9('0x3d')]);var _0x41d226={'where':_0x138df2['where']};return db[_0xc3d9('0x3e')]['count'](_0x41d226)[_0xc3d9('0x23')](function(_0x4568c0){_0xc6b060['count']=_0x4568c0;if(_0x122195['query'][_0xc3d9('0x3f')]){_0x138df2[_0xc3d9('0x40')]=[{'all':!![]}];}return db['SquareMessage'][_0xc3d9('0x41')](_0x138df2);})[_0xc3d9('0x23')](function(_0x7fdbba){_0xc6b060['rows']=_0x7fdbba;return _0xc6b060;})[_0xc3d9('0x23')](respondWithFilteredResult(_0x11013a,_0x138df2))[_0xc3d9('0x42')](handleError(_0x11013a,null));};exports[_0xc3d9('0x43')]=function(_0x15ff98,_0x4a4461){var _0x105d85={'raw':!![],'where':{'id':_0x15ff98['params']['id']}},_0x4039bc={};_0x4039bc[_0xc3d9('0x2a')]=_[_0xc3d9('0x2b')](db[_0xc3d9('0x3e')][_0xc3d9('0x29')]);_0x4039bc[_0xc3d9('0x2c')]=_[_0xc3d9('0x2b')](_0x15ff98[_0xc3d9('0x2c')]);_0x4039bc[_0xc3d9('0x2d')]=_[_0xc3d9('0x2e')](_0x4039bc[_0xc3d9('0x2a')],_0x4039bc[_0xc3d9('0x2c')]);_0x105d85[_0xc3d9('0x30')]=_[_0xc3d9('0x2e')](_0x4039bc[_0xc3d9('0x2a')],qs[_0xc3d9('0x2f')](_0x15ff98['query'][_0xc3d9('0x2f')]));_0x105d85[_0xc3d9('0x30')]=_0x105d85[_0xc3d9('0x30')]['length']?_0x105d85[_0xc3d9('0x30')]:_0x4039bc['model'];if(_0x15ff98[_0xc3d9('0x2c')]['includeAll']){_0x105d85[_0xc3d9('0x40')]=[{'all':!![]}];}_0x105d85=_[_0xc3d9('0x37')]({},_0x105d85,_0x15ff98[_0xc3d9('0x3d')]);return db[_0xc3d9('0x3e')][_0xc3d9('0x44')](_0x105d85)[_0xc3d9('0x23')](handleEntityNotFound(_0x4a4461,null))[_0xc3d9('0x23')](respondWithResult(_0x4a4461,null))['catch'](handleError(_0x4a4461,null));};exports[_0xc3d9('0x45')]=function(_0x1721f9,_0x37eb4b){return db[_0xc3d9('0x3e')][_0xc3d9('0x45')](_0x1721f9[_0xc3d9('0x46')],{})[_0xc3d9('0x23')](respondWithResult(_0x37eb4b,0xc9))[_0xc3d9('0x42')](handleError(_0x37eb4b,null));};exports['update']=function(_0x3f36a6,_0xf2215){if(_0x3f36a6[_0xc3d9('0x46')]['id']){delete _0x3f36a6[_0xc3d9('0x46')]['id'];}return db[_0xc3d9('0x3e')]['find']({'where':{'id':_0x3f36a6[_0xc3d9('0x47')]['id']}})['then'](handleEntityNotFound(_0xf2215,null))['then'](saveUpdates(_0x3f36a6[_0xc3d9('0x46')],null))[_0xc3d9('0x23')](respondWithResult(_0xf2215,null))[_0xc3d9('0x42')](handleError(_0xf2215,null));};exports[_0xc3d9('0x24')]=function(_0x1d1fd1,_0x17363c){return db[_0xc3d9('0x3e')]['find']({'where':{'id':_0x1d1fd1['params']['id']}})[_0xc3d9('0x23')](handleEntityNotFound(_0x17363c,null))[_0xc3d9('0x23')](removeEntity(_0x17363c,null))[_0xc3d9('0x42')](handleError(_0x17363c,null));}; \ No newline at end of file +var _0xcb1b=['send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','type','key','VIRTUAL','field','options','SquareMessage','includeAll','include','findAll','rows','show','params','merge','create','body','catch','update','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name'];(function(_0xb3b452,_0x582e8e){var _0x238983=function(_0x3bc866){while(--_0x3bc866){_0xb3b452['push'](_0xb3b452['shift']());}};_0x238983(++_0x582e8e);}(_0xcb1b,0x6e));var _0xbcb1=function(_0x15441b,_0x245843){_0x15441b=_0x15441b-0x0;var _0x51aa3f=_0xcb1b[_0x15441b];return _0x51aa3f;};'use strict';var pdf=require(_0xbcb1('0x0'));var emlformat=require(_0xbcb1('0x1'));var rimraf=require(_0xbcb1('0x2'));var zipdir=require(_0xbcb1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbcb1('0x4'));var moment=require(_0xbcb1('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbcb1('0x6'));var sox=require('sox');var csv=require(_0xbcb1('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbcb1('0x8'));var squel=require('squel');var crypto=require(_0xbcb1('0x9'));var jsforce=require(_0xbcb1('0xa'));var deskjs=require(_0xbcb1('0xb'));var toCsv=require(_0xbcb1('0x7'));var querystring=require(_0xbcb1('0xc'));var Papa=require(_0xbcb1('0xd'));var authService=require(_0xbcb1('0xe'));var hardwareService=require(_0xbcb1('0xf'));var Redis=require('ioredis');var qs=require(_0xbcb1('0x10'));var logger=require(_0xbcb1('0x11'))(_0xbcb1('0x12'));var utils=require(_0xbcb1('0x13'));var config=require(_0xbcb1('0x14'));var db=require(_0xbcb1('0x15'))['db'];function respondWithStatusCode(_0x33ed6d,_0x3e166b){_0x3e166b=_0x3e166b||0xcc;return function(_0x14400e){if(_0x14400e){return _0x33ed6d['sendStatus'](_0x3e166b);}return _0x33ed6d[_0xbcb1('0x16')](_0x3e166b)[_0xbcb1('0x17')]();};}function respondWithResult(_0x356785,_0x48c1be){_0x48c1be=_0x48c1be||0xc8;return function(_0x30b7a7){if(_0x30b7a7){return _0x356785[_0xbcb1('0x16')](_0x48c1be)[_0xbcb1('0x18')](_0x30b7a7);}};}function respondWithFilteredResult(_0x5a16c3,_0x267a33){return function(_0x170f8c){if(_0x170f8c){var _0x47ef37=_0x170f8c[_0xbcb1('0x19')],_0x27ae44=_0x267a33[_0xbcb1('0x1a')],_0x49e618=_0x267a33[_0xbcb1('0x1a')]+_0x267a33['limit'],_0x1918a0;if(_0x49e618>=_0x47ef37){_0x49e618=_0x47ef37;_0x1918a0=0xc8;}else{_0x1918a0=0xce;}_0x5a16c3['status'](_0x1918a0);return _0x5a16c3[_0xbcb1('0x1b')](_0xbcb1('0x1c'),_0x27ae44+'-'+_0x49e618+'/'+_0x47ef37)[_0xbcb1('0x18')](_0x170f8c);}return null;};}function patchUpdates(_0x2252eb){return function(_0xa8a046){try{jsonpatch[_0xbcb1('0x1d')](_0xa8a046,_0x2252eb,!![]);}catch(_0x287ad5){return BPromise[_0xbcb1('0x1e')](_0x287ad5);}return _0xa8a046[_0xbcb1('0x1f')]();};}function saveUpdates(_0x163fd7,_0x55fe09){return function(_0x34952b){if(_0x34952b){return _0x34952b['update'](_0x163fd7)[_0xbcb1('0x20')](function(_0x558913){return _0x558913;});}return null;};}function removeEntity(_0x1eeff2,_0x244f9a){return function(_0x3ac94f){if(_0x3ac94f){return _0x3ac94f[_0xbcb1('0x21')]()[_0xbcb1('0x20')](function(){_0x1eeff2['status'](0xcc)[_0xbcb1('0x17')]();});}};}function handleEntityNotFound(_0xe50071,_0x2c2131){return function(_0x1224db){if(!_0x1224db){_0xe50071[_0xbcb1('0x22')](0x194);}return _0x1224db;};}function handleError(_0x4329cb,_0x3a6f9b){_0x3a6f9b=_0x3a6f9b||0x1f4;return function(_0x3699fd){logger[_0xbcb1('0x23')](_0x3699fd[_0xbcb1('0x24')]);if(_0x3699fd[_0xbcb1('0x25')]){delete _0x3699fd[_0xbcb1('0x25')];}_0x4329cb['status'](_0x3a6f9b)[_0xbcb1('0x26')](_0x3699fd);};}exports['index']=function(_0x493e9f,_0x3f76c0){var _0x418a7d={},_0x1945da={},_0x571451={'count':0x0,'rows':[]};var _0x5ab1cf=db['SquareMessage'][_0xbcb1('0x27')];_0x1945da[_0xbcb1('0x28')]=_[_0xbcb1('0x29')](_0x5ab1cf);_0x1945da[_0xbcb1('0x2a')]=_[_0xbcb1('0x29')](_0x493e9f[_0xbcb1('0x2a')]);_0x1945da[_0xbcb1('0x2b')]=_[_0xbcb1('0x2c')](_0x1945da[_0xbcb1('0x28')],_0x1945da[_0xbcb1('0x2a')]);_0x418a7d[_0xbcb1('0x2d')]=_[_0xbcb1('0x2c')](_0x1945da[_0xbcb1('0x28')],qs[_0xbcb1('0x2e')](_0x493e9f[_0xbcb1('0x2a')][_0xbcb1('0x2e')]));_0x418a7d['attributes']=_0x418a7d[_0xbcb1('0x2d')][_0xbcb1('0x2f')]?_0x418a7d[_0xbcb1('0x2d')]:_0x1945da[_0xbcb1('0x28')];if(!_0x493e9f[_0xbcb1('0x2a')][_0xbcb1('0x30')](_0xbcb1('0x31'))){_0x418a7d[_0xbcb1('0x32')]=qs['limit'](_0x493e9f[_0xbcb1('0x2a')][_0xbcb1('0x32')]);_0x418a7d[_0xbcb1('0x1a')]=qs[_0xbcb1('0x1a')](_0x493e9f[_0xbcb1('0x2a')]['offset']);}_0x418a7d[_0xbcb1('0x33')]=qs[_0xbcb1('0x34')](_0x493e9f[_0xbcb1('0x2a')]['sort']);_0x418a7d[_0xbcb1('0x35')]=qs[_0xbcb1('0x2b')](_['pick'](_0x493e9f['query'],_0x1945da[_0xbcb1('0x2b')]));if(_0x493e9f[_0xbcb1('0x2a')][_0xbcb1('0x36')]){_0x418a7d['where']=_['merge'](_0x418a7d[_0xbcb1('0x35')],{'$or':_[_0xbcb1('0x37')](_0x5ab1cf,function(_0x5968d7){if(_0x5968d7[_0xbcb1('0x38')][_0xbcb1('0x39')]!==_0xbcb1('0x3a')){var _0x1689af={};_0x1689af[_0x5968d7[_0xbcb1('0x3b')]]={'$like':'%'+_0x493e9f[_0xbcb1('0x2a')][_0xbcb1('0x36')]+'%'};return _0x1689af;}})});}_0x418a7d=_['merge']({},_0x418a7d,_0x493e9f[_0xbcb1('0x3c')]);var _0x1e987b={'where':_0x418a7d['where']};return db[_0xbcb1('0x3d')][_0xbcb1('0x19')](_0x1e987b)[_0xbcb1('0x20')](function(_0x4bfd1a){_0x571451['count']=_0x4bfd1a;if(_0x493e9f[_0xbcb1('0x2a')][_0xbcb1('0x3e')]){_0x418a7d[_0xbcb1('0x3f')]=[{'all':!![]}];}return db[_0xbcb1('0x3d')][_0xbcb1('0x40')](_0x418a7d);})[_0xbcb1('0x20')](function(_0x2f5186){_0x571451[_0xbcb1('0x41')]=_0x2f5186;return _0x571451;})[_0xbcb1('0x20')](respondWithFilteredResult(_0x3f76c0,_0x418a7d))['catch'](handleError(_0x3f76c0,null));};exports[_0xbcb1('0x42')]=function(_0xba858e,_0x5be9a5){var _0x5e8451={'raw':!![],'where':{'id':_0xba858e[_0xbcb1('0x43')]['id']}},_0x385bc2={};_0x385bc2[_0xbcb1('0x28')]=_[_0xbcb1('0x29')](db[_0xbcb1('0x3d')][_0xbcb1('0x27')]);_0x385bc2[_0xbcb1('0x2a')]=_[_0xbcb1('0x29')](_0xba858e[_0xbcb1('0x2a')]);_0x385bc2[_0xbcb1('0x2b')]=_['intersection'](_0x385bc2[_0xbcb1('0x28')],_0x385bc2[_0xbcb1('0x2a')]);_0x5e8451[_0xbcb1('0x2d')]=_[_0xbcb1('0x2c')](_0x385bc2[_0xbcb1('0x28')],qs[_0xbcb1('0x2e')](_0xba858e[_0xbcb1('0x2a')][_0xbcb1('0x2e')]));_0x5e8451['attributes']=_0x5e8451['attributes'][_0xbcb1('0x2f')]?_0x5e8451[_0xbcb1('0x2d')]:_0x385bc2[_0xbcb1('0x28')];if(_0xba858e[_0xbcb1('0x2a')][_0xbcb1('0x3e')]){_0x5e8451[_0xbcb1('0x3f')]=[{'all':!![]}];}_0x5e8451=_[_0xbcb1('0x44')]({},_0x5e8451,_0xba858e['options']);return db['SquareMessage']['find'](_0x5e8451)[_0xbcb1('0x20')](handleEntityNotFound(_0x5be9a5,null))[_0xbcb1('0x20')](respondWithResult(_0x5be9a5,null))['catch'](handleError(_0x5be9a5,null));};exports[_0xbcb1('0x45')]=function(_0x40e2a4,_0x354390){return db[_0xbcb1('0x3d')][_0xbcb1('0x45')](_0x40e2a4[_0xbcb1('0x46')],{})[_0xbcb1('0x20')](respondWithResult(_0x354390,0xc9))[_0xbcb1('0x47')](handleError(_0x354390,null));};exports[_0xbcb1('0x48')]=function(_0x261b8d,_0x135175){if(_0x261b8d[_0xbcb1('0x46')]['id']){delete _0x261b8d['body']['id'];}return db[_0xbcb1('0x3d')][_0xbcb1('0x49')]({'where':{'id':_0x261b8d[_0xbcb1('0x43')]['id']}})[_0xbcb1('0x20')](handleEntityNotFound(_0x135175,null))[_0xbcb1('0x20')](saveUpdates(_0x261b8d[_0xbcb1('0x46')],null))[_0xbcb1('0x20')](respondWithResult(_0x135175,null))[_0xbcb1('0x47')](handleError(_0x135175,null));};exports[_0xbcb1('0x21')]=function(_0x6ec87c,_0x351126){return db[_0xbcb1('0x3d')][_0xbcb1('0x49')]({'where':{'id':_0x6ec87c[_0xbcb1('0x43')]['id']}})[_0xbcb1('0x20')](handleEntityNotFound(_0x351126,null))[_0xbcb1('0x20')](removeEntity(_0x351126,null))[_0xbcb1('0x47')](handleError(_0x351126,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index b2136e2..39b7785 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 _0xec15=['square_messages','util','api','moment','bluebird','request-promise','./squareMessage.attributes','exports','define','SquareMessage'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0xec15,0xc9));var _0x5ec1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec15[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x5ec1('0x0'));var logger=require('../../config/logger')(_0x5ec1('0x1'));var moment=require(_0x5ec1('0x2'));var BPromise=require(_0x5ec1('0x3'));var rp=require(_0x5ec1('0x4'));var attributes=require(_0x5ec1('0x5'));module[_0x5ec1('0x6')]=function(_0x8de459,_0x373226){return _0x8de459[_0x5ec1('0x7')](_0x5ec1('0x8'),attributes,{'tableName':_0x5ec1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd170=['request-promise','./squareMessage.attributes','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird'];(function(_0xdfb3c3,_0x59788d){var _0x4f9a74=function(_0x2f1544){while(--_0x2f1544){_0xdfb3c3['push'](_0xdfb3c3['shift']());}};_0x4f9a74(++_0x59788d);}(_0xd170,0x109));var _0x0d17=function(_0x2f4db3,_0x6b109d){_0x2f4db3=_0x2f4db3-0x0;var _0x39ce3e=_0xd170[_0x2f4db3];return _0x39ce3e;};'use strict';var _=require(_0x0d17('0x0'));var util=require('util');var logger=require(_0x0d17('0x1'))(_0x0d17('0x2'));var moment=require(_0x0d17('0x3'));var BPromise=require(_0x0d17('0x4'));var rp=require(_0x0d17('0x5'));var attributes=require(_0x0d17('0x6'));module['exports']=function(_0x18ccd6,_0x2c20b7){return _0x18ccd6[_0x0d17('0x7')](_0x0d17('0x8'),attributes,{'tableName':_0x0d17('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 2c47e27..47e75b5 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 _0x0c8c=['create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage'];(function(_0x2f83b6,_0x1f41db){var _0x4af740=function(_0x6175ff){while(--_0x6175ff){_0x2f83b6['push'](_0x2f83b6['shift']());}};_0x4af740(++_0x1f41db);}(_0x0c8c,0x16d));var _0xc0c8=function(_0x576620,_0x182ec3){_0x576620=_0x576620-0x0;var _0x557fb1=_0x0c8c[_0x576620];return _0x557fb1;};'use strict';var _=require(_0xc0c8('0x0'));var util=require(_0xc0c8('0x1'));var moment=require(_0xc0c8('0x2'));var BPromise=require(_0xc0c8('0x3'));var rs=require(_0xc0c8('0x4'));var fs=require('fs');var Redis=require(_0xc0c8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0c8('0x6'));var logger=require(_0xc0c8('0x7'))(_0xc0c8('0x8'));var config=require('../../config/environment');var jayson=require(_0xc0c8('0x9'));var client=jayson['client'][_0xc0c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58bc91,_0x432b03,_0x16b1f0){return new BPromise(function(_0xce1704,_0xfae079){return client[_0xc0c8('0xb')](_0x58bc91,_0x16b1f0)[_0xc0c8('0xc')](function(_0x162182){logger[_0xc0c8('0xd')]('SquareMessage,\x20%s,\x20%s',_0x432b03,_0xc0c8('0xe'));logger['debug'](_0xc0c8('0xf'),_0x432b03,'request\x20sent',JSON[_0xc0c8('0x10')](_0x162182));if(_0x162182[_0xc0c8('0x11')]){if(_0x162182[_0xc0c8('0x11')][_0xc0c8('0x12')]===0x1f4){logger['error'](_0xc0c8('0x13'),_0x432b03,_0x162182[_0xc0c8('0x11')][_0xc0c8('0x14')]);return _0xfae079(_0x162182[_0xc0c8('0x11')][_0xc0c8('0x14')]);}logger[_0xc0c8('0x11')](_0xc0c8('0x13'),_0x432b03,_0x162182[_0xc0c8('0x11')][_0xc0c8('0x14')]);return _0xce1704(_0x162182[_0xc0c8('0x11')][_0xc0c8('0x14')]);}else{logger[_0xc0c8('0xd')](_0xc0c8('0x13'),_0x432b03,_0xc0c8('0xe'));_0xce1704(_0x162182[_0xc0c8('0x15')][_0xc0c8('0x14')]);}})[_0xc0c8('0x16')](function(_0x23b4b3){logger[_0xc0c8('0x11')]('SquareMessage,\x20%s,\x20%s',_0x432b03,_0x23b4b3);_0xfae079(_0x23b4b3);});});}exports[_0xc0c8('0x17')]=function(_0x51fcfa){var _0x1af928=this;return new Promise(function(_0x4f432f,_0x527cd7){return db[_0xc0c8('0x18')][_0xc0c8('0x19')](_0x51fcfa[_0xc0c8('0x1a')],{'raw':_0x51fcfa[_0xc0c8('0x1b')]?_0x51fcfa['options'][_0xc0c8('0x1c')]===undefined?!![]:![]:!![]})[_0xc0c8('0xc')](function(_0x2cba64){logger['info']('CreateSquareMessage',_0x51fcfa);logger[_0xc0c8('0x1d')](_0xc0c8('0x17'),_0x51fcfa,JSON[_0xc0c8('0x10')](_0x2cba64));_0x4f432f(_0x2cba64);})[_0xc0c8('0x16')](function(_0x3e820d){logger['error'](_0xc0c8('0x17'),_0x3e820d[_0xc0c8('0x14')],_0x51fcfa);_0x527cd7(_0x1af928['error'](0x1f4,_0x3e820d[_0xc0c8('0x14')]));});});}; \ No newline at end of file +var _0x5b87=['SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage','body','options','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','debug'];(function(_0x11cd9d,_0x4918f3){var _0x571038=function(_0x5a6b07){while(--_0x5a6b07){_0x11cd9d['push'](_0x11cd9d['shift']());}};_0x571038(++_0x4918f3);}(_0x5b87,0x71));var _0x75b8=function(_0x41b12d,_0x2b74f5){_0x41b12d=_0x41b12d-0x0;var _0x5996d1=_0x5b87[_0x41b12d];return _0x5996d1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x75b8('0x0'));var BPromise=require(_0x75b8('0x1'));var rs=require(_0x75b8('0x2'));var fs=require('fs');var Redis=require(_0x75b8('0x3'));var db=require(_0x75b8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75b8('0x5'))('rpc');var config=require(_0x75b8('0x6'));var jayson=require(_0x75b8('0x7'));var client=jayson[_0x75b8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7831,_0x541060,_0x29d83a){return new BPromise(function(_0x1da3f9,_0x5f0aa9){return client['request'](_0x3f7831,_0x29d83a)[_0x75b8('0x9')](function(_0x1b1a5e){logger[_0x75b8('0xa')]('SquareMessage,\x20%s,\x20%s',_0x541060,'request\x20sent');logger[_0x75b8('0xb')](_0x75b8('0xc'),_0x541060,_0x75b8('0xd'),JSON[_0x75b8('0xe')](_0x1b1a5e));if(_0x1b1a5e[_0x75b8('0xf')]){if(_0x1b1a5e[_0x75b8('0xf')]['code']===0x1f4){logger['error'](_0x75b8('0x10'),_0x541060,_0x1b1a5e[_0x75b8('0xf')][_0x75b8('0x11')]);return _0x5f0aa9(_0x1b1a5e[_0x75b8('0xf')][_0x75b8('0x11')]);}logger[_0x75b8('0xf')](_0x75b8('0x10'),_0x541060,_0x1b1a5e[_0x75b8('0xf')]['message']);return _0x1da3f9(_0x1b1a5e[_0x75b8('0xf')][_0x75b8('0x11')]);}else{logger[_0x75b8('0xa')](_0x75b8('0x10'),_0x541060,_0x75b8('0xd'));_0x1da3f9(_0x1b1a5e[_0x75b8('0x12')][_0x75b8('0x11')]);}})[_0x75b8('0x13')](function(_0x22bdcc){logger['error'](_0x75b8('0x10'),_0x541060,_0x22bdcc);_0x5f0aa9(_0x22bdcc);});});}exports[_0x75b8('0x14')]=function(_0x1b985b){var _0x344a12=this;return new Promise(function(_0x2fbeed,_0x28b343){return db[_0x75b8('0x15')]['create'](_0x1b985b[_0x75b8('0x16')],{'raw':_0x1b985b[_0x75b8('0x17')]?_0x1b985b['options'][_0x75b8('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x33e013){logger[_0x75b8('0xa')](_0x75b8('0x14'),_0x1b985b);logger[_0x75b8('0xb')](_0x75b8('0x14'),_0x1b985b,JSON[_0x75b8('0xe')](_0x33e013));_0x2fbeed(_0x33e013);})[_0x75b8('0x13')](function(_0x514dd7){logger['error'](_0x75b8('0x14'),_0x514dd7[_0x75b8('0x11')],_0x1b985b);_0x28b343(_0x344a12[_0x75b8('0xf')](0x1f4,_0x514dd7[_0x75b8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 80a57b7..f730a0e 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 _0x238f=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id/test','15s','post','create','put','/:id','update','delete','exports','multer','util','path'];(function(_0x3de9d7,_0x21f552){var _0x66bf8d=function(_0x1f277b){while(--_0x1f277b){_0x3de9d7['push'](_0x3de9d7['shift']());}};_0x66bf8d(++_0x21f552);}(_0x238f,0xa5));var _0xf238=function(_0x5350cd,_0x2b8761){_0x5350cd=_0x5350cd-0x0;var _0x3ac360=_0x238f[_0x5350cd];return _0x3ac360;};'use strict';var multer=require(_0xf238('0x0'));var util=require(_0xf238('0x1'));var path=require(_0xf238('0x2'));var timeout=require('connect-timeout');var express=require(_0xf238('0x3'));var router=express[_0xf238('0x4')]();var auth=require(_0xf238('0x5'));var interaction=require(_0xf238('0x6'));var config=require(_0xf238('0x7'));var controller=require(_0xf238('0x8'));router['get']('/',auth[_0xf238('0x9')](),controller[_0xf238('0xa')]);router['get']('/:id',auth[_0xf238('0x9')](),controller['show']);router[_0xf238('0xb')](_0xf238('0xc'),auth[_0xf238('0x9')](),timeout(_0xf238('0xd')),controller['test']);router[_0xf238('0xe')]('/',auth['isAuthenticated'](),controller[_0xf238('0xf')]);router[_0xf238('0x10')](_0xf238('0x11'),auth[_0xf238('0x9')](),controller[_0xf238('0x12')]);router[_0xf238('0x13')](_0xf238('0x11'),auth[_0xf238('0x9')](),controller['destroy']);module[_0xf238('0x14')]=router; \ No newline at end of file +var _0xd110=['../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','/:id/test','15s','post','create','/:id','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service'];(function(_0x5e895f,_0x3167d7){var _0x1a6d33=function(_0x1a2c4c){while(--_0x1a2c4c){_0x5e895f['push'](_0x5e895f['shift']());}};_0x1a6d33(++_0x3167d7);}(_0xd110,0x1e8));var _0x0d11=function(_0x4af03c,_0x377a3b){_0x4af03c=_0x4af03c-0x0;var _0x51d938=_0xd110[_0x4af03c];return _0x51d938;};'use strict';var multer=require(_0x0d11('0x0'));var util=require(_0x0d11('0x1'));var path=require(_0x0d11('0x2'));var timeout=require('connect-timeout');var express=require(_0x0d11('0x3'));var router=express[_0x0d11('0x4')]();var auth=require(_0x0d11('0x5'));var interaction=require(_0x0d11('0x6'));var config=require(_0x0d11('0x7'));var controller=require(_0x0d11('0x8'));router[_0x0d11('0x9')]('/',auth[_0x0d11('0xa')](),controller['index']);router[_0x0d11('0x9')]('/:id',auth[_0x0d11('0xa')](),controller['show']);router['get'](_0x0d11('0xb'),auth[_0x0d11('0xa')](),timeout(_0x0d11('0xc')),controller['test']);router[_0x0d11('0xd')]('/',auth['isAuthenticated'](),controller[_0x0d11('0xe')]);router['put'](_0x0d11('0xf'),auth[_0x0d11('0xa')](),controller[_0x0d11('0x10')]);router[_0x0d11('0x11')]('/:id',auth[_0x0d11('0xa')](),controller[_0x0d11('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index e5c43f7..0eb4e6e 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 _0x3828=['exports','STRING','name','sequelize'];(function(_0x71435,_0x5627a7){var _0x40de4f=function(_0x383620){while(--_0x383620){_0x71435['push'](_0x71435['shift']());}};_0x40de4f(++_0x5627a7);}(_0x3828,0x1c7));var _0x8382=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x3828[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require(_0x8382('0x0'));module[_0x8382('0x1')]={'name':{'type':Sequelize[_0x8382('0x2')],'unique':_0x8382('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8382('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7734=['name','sequelize','STRING'];(function(_0xa59a59,_0x4dd9ce){var _0x36e5c3=function(_0x457f1e){while(--_0x457f1e){_0xa59a59['push'](_0xa59a59['shift']());}};_0x36e5c3(++_0x4dd9ce);}(_0x7734,0x1d5));var _0x4773=function(_0x42e9b8,_0x1f24ca){_0x42e9b8=_0x42e9b8-0x0;var _0x35dd16=_0x7734[_0x42e9b8];return _0x35dd16;};'use strict';var Sequelize=require(_0x4773('0x0'));module['exports']={'name':{'type':Sequelize[_0x4773('0x1')],'unique':_0x4773('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x4773('0x1')]},'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 c67ff4f..8b7c647 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 _0x1ac0=['model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','key','field','includeAll','include','SquareOdbc','findAll','rows','catch','params','fields','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../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','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','rawAttributes'];(function(_0x54d233,_0x52b055){var _0x35a7ce=function(_0x4f971a){while(--_0x4f971a){_0x54d233['push'](_0x54d233['shift']());}};_0x35a7ce(++_0x52b055);}(_0x1ac0,0x1bf));var _0x01ac=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1ac0[_0x432682];return _0x463d05;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x01ac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x01ac('0x1'));var jsonpatch=require(_0x01ac('0x2'));var rp=require(_0x01ac('0x3'));var moment=require('moment');var BPromise=require(_0x01ac('0x4'));var Mustache=require(_0x01ac('0x5'));var util=require(_0x01ac('0x6'));var path=require('path');var sox=require(_0x01ac('0x7'));var csv=require(_0x01ac('0x8'));var ejs=require(_0x01ac('0x9'));var fs=require('fs');var _=require(_0x01ac('0xa'));var squel=require(_0x01ac('0xb'));var crypto=require(_0x01ac('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x01ac('0xd'));var toCsv=require(_0x01ac('0x8'));var querystring=require(_0x01ac('0xe'));var Papa=require('papaparse');var authService=require(_0x01ac('0xf'));var hardwareService=require(_0x01ac('0x10'));var Redis=require(_0x01ac('0x11'));var qs=require(_0x01ac('0x12'));var logger=require(_0x01ac('0x13'))(_0x01ac('0x14'));var utils=require(_0x01ac('0x15'));var config=require(_0x01ac('0x16'));var db=require(_0x01ac('0x17'))['db'];function respondWithStatusCode(_0x403e4e,_0x515132){_0x515132=_0x515132||0xcc;return function(_0x3a1019){if(_0x3a1019){return _0x403e4e[_0x01ac('0x18')](_0x515132);}return _0x403e4e[_0x01ac('0x19')](_0x515132)[_0x01ac('0x1a')]();};}function respondWithResult(_0x18c175,_0x3529f0){_0x3529f0=_0x3529f0||0xc8;return function(_0x3d0d46){if(_0x3d0d46){return _0x18c175[_0x01ac('0x19')](_0x3529f0)[_0x01ac('0x1b')](_0x3d0d46);}};}function respondWithFilteredResult(_0x153dbc,_0x16dac7){return function(_0x31fc02){if(_0x31fc02){var _0x47c2bb=_0x31fc02[_0x01ac('0x1c')],_0x369551=_0x16dac7[_0x01ac('0x1d')],_0x572135=_0x16dac7[_0x01ac('0x1d')]+_0x16dac7[_0x01ac('0x1e')],_0x5d017a;if(_0x572135>=_0x47c2bb){_0x572135=_0x47c2bb;_0x5d017a=0xc8;}else{_0x5d017a=0xce;}_0x153dbc[_0x01ac('0x19')](_0x5d017a);return _0x153dbc[_0x01ac('0x1f')]('Content-Range',_0x369551+'-'+_0x572135+'/'+_0x47c2bb)[_0x01ac('0x1b')](_0x31fc02);}return null;};}function patchUpdates(_0x5053b3){return function(_0x479a6d){try{jsonpatch[_0x01ac('0x20')](_0x479a6d,_0x5053b3,!![]);}catch(_0x19ab76){return BPromise[_0x01ac('0x21')](_0x19ab76);}return _0x479a6d[_0x01ac('0x22')]();};}function saveUpdates(_0x183cd0,_0x1c3d9d){return function(_0x58a889){if(_0x58a889){return _0x58a889[_0x01ac('0x23')](_0x183cd0)[_0x01ac('0x24')](function(_0x2b18cd){return _0x2b18cd;});}return null;};}function removeEntity(_0x2bbe85,_0x190ea1){return function(_0x2db439){if(_0x2db439){return _0x2db439[_0x01ac('0x25')]()[_0x01ac('0x24')](function(){var _0x146b78=_0x2db439[_0x01ac('0x26')]({'plain':!![]});var _0x58cb4c=_0x01ac('0x27');return db[_0x01ac('0x28')][_0x01ac('0x25')]({'where':{'type':_0x58cb4c,'resourceId':_0x146b78['id']}})[_0x01ac('0x24')](function(){return _0x2db439;});})['then'](function(){_0x2bbe85[_0x01ac('0x19')](0xcc)[_0x01ac('0x1a')]();});}};}function handleEntityNotFound(_0x41a3f9,_0x45f38d){return function(_0x5193f9){if(!_0x5193f9){_0x41a3f9[_0x01ac('0x18')](0x194);}return _0x5193f9;};}function handleError(_0xde2f6e,_0x4aea14){_0x4aea14=_0x4aea14||0x1f4;return function(_0xf02b9f){logger[_0x01ac('0x29')](_0xf02b9f[_0x01ac('0x2a')]);if(_0xf02b9f[_0x01ac('0x2b')]){delete _0xf02b9f[_0x01ac('0x2b')];}_0xde2f6e[_0x01ac('0x19')](_0x4aea14)['send'](_0xf02b9f);};}exports['index']=function(_0x5743b6,_0x49f5cf){var _0x6c1cf9={},_0x521247={},_0x21dfe2={'count':0x0,'rows':[]};var _0x1f49d9=db['SquareOdbc'][_0x01ac('0x2c')];_0x521247[_0x01ac('0x2d')]=_[_0x01ac('0x2e')](_0x1f49d9);_0x521247[_0x01ac('0x2f')]=_[_0x01ac('0x2e')](_0x5743b6[_0x01ac('0x2f')]);_0x521247[_0x01ac('0x30')]=_[_0x01ac('0x31')](_0x521247[_0x01ac('0x2d')],_0x521247[_0x01ac('0x2f')]);_0x6c1cf9[_0x01ac('0x32')]=_[_0x01ac('0x31')](_0x521247['model'],qs['fields'](_0x5743b6[_0x01ac('0x2f')]['fields']));_0x6c1cf9[_0x01ac('0x32')]=_0x6c1cf9[_0x01ac('0x32')]['length']?_0x6c1cf9['attributes']:_0x521247[_0x01ac('0x2d')];if(!_0x5743b6[_0x01ac('0x2f')][_0x01ac('0x33')](_0x01ac('0x34'))){_0x6c1cf9[_0x01ac('0x1e')]=qs['limit'](_0x5743b6['query']['limit']);_0x6c1cf9[_0x01ac('0x1d')]=qs[_0x01ac('0x1d')](_0x5743b6[_0x01ac('0x2f')][_0x01ac('0x1d')]);}_0x6c1cf9[_0x01ac('0x35')]=qs[_0x01ac('0x36')](_0x5743b6['query']['sort']);_0x6c1cf9['where']=qs[_0x01ac('0x30')](_[_0x01ac('0x37')](_0x5743b6[_0x01ac('0x2f')],_0x521247[_0x01ac('0x30')]));if(_0x5743b6[_0x01ac('0x2f')][_0x01ac('0x38')]){_0x6c1cf9[_0x01ac('0x39')]=_[_0x01ac('0x3a')](_0x6c1cf9['where'],{'$or':_[_0x01ac('0x3b')](_0x1f49d9,function(_0x1204de){if(_0x1204de['type'][_0x01ac('0x3c')]!=='VIRTUAL'){var _0x3f52={};_0x3f52[_0x1204de[_0x01ac('0x3d')]]={'$like':'%'+_0x5743b6[_0x01ac('0x2f')][_0x01ac('0x38')]+'%'};return _0x3f52;}})});}_0x6c1cf9=_[_0x01ac('0x3a')]({},_0x6c1cf9,_0x5743b6['options']);var _0x55a15b={'where':_0x6c1cf9[_0x01ac('0x39')]};return db['SquareOdbc'][_0x01ac('0x1c')](_0x55a15b)[_0x01ac('0x24')](function(_0x517abf){_0x21dfe2['count']=_0x517abf;if(_0x5743b6['query'][_0x01ac('0x3e')]){_0x6c1cf9[_0x01ac('0x3f')]=[{'all':!![]}];}return db[_0x01ac('0x40')][_0x01ac('0x41')](_0x6c1cf9);})[_0x01ac('0x24')](function(_0x260fdc){_0x21dfe2[_0x01ac('0x42')]=_0x260fdc;return _0x21dfe2;})[_0x01ac('0x24')](respondWithFilteredResult(_0x49f5cf,_0x6c1cf9))[_0x01ac('0x43')](handleError(_0x49f5cf,null));};exports['show']=function(_0x3309a0,_0x42fc06){var _0x49341b={'raw':!![],'where':{'id':_0x3309a0[_0x01ac('0x44')]['id']}},_0xffb265={};_0xffb265['model']=_[_0x01ac('0x2e')](db['SquareOdbc'][_0x01ac('0x2c')]);_0xffb265[_0x01ac('0x2f')]=_['keys'](_0x3309a0[_0x01ac('0x2f')]);_0xffb265[_0x01ac('0x30')]=_['intersection'](_0xffb265[_0x01ac('0x2d')],_0xffb265[_0x01ac('0x2f')]);_0x49341b[_0x01ac('0x32')]=_[_0x01ac('0x31')](_0xffb265['model'],qs[_0x01ac('0x45')](_0x3309a0['query']['fields']));_0x49341b['attributes']=_0x49341b[_0x01ac('0x32')][_0x01ac('0x46')]?_0x49341b['attributes']:_0xffb265['model'];if(_0x3309a0[_0x01ac('0x2f')][_0x01ac('0x3e')]){_0x49341b[_0x01ac('0x3f')]=[{'all':!![]}];}_0x49341b=_[_0x01ac('0x3a')]({},_0x49341b,_0x3309a0['options']);return db['SquareOdbc']['find'](_0x49341b)[_0x01ac('0x24')](handleEntityNotFound(_0x42fc06,null))[_0x01ac('0x24')](respondWithResult(_0x42fc06,null))['catch'](handleError(_0x42fc06,null));};exports[_0x01ac('0x47')]=function(_0xd0b180,_0x2fa250){return db[_0x01ac('0x40')]['create'](_0xd0b180[_0x01ac('0x48')],{})['then'](function(_0x2fe8a3){var _0x17376c=_0xd0b180[_0x01ac('0x49')][_0x01ac('0x26')]({'plain':!![]});if(!_0x17376c)throw new Error(_0x01ac('0x4a'));if(_0x17376c['role']===_0x01ac('0x49')){var _0x12aa98=_0x2fe8a3[_0x01ac('0x26')]({'plain':!![]});var _0x1f8da3=_0x01ac('0x27');return db[_0x01ac('0x4b')][_0x01ac('0x4c')]({'where':{'name':_0x1f8da3,'userProfileId':_0x17376c[_0x01ac('0x4d')]},'raw':!![]})[_0x01ac('0x24')](function(_0x400b87){if(_0x400b87&&_0x400b87[_0x01ac('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x12aa98[_0x01ac('0x2b')],'resourceId':_0x12aa98['id'],'type':_0x400b87['name'],'sectionId':_0x400b87['id']},{})[_0x01ac('0x24')](function(){return _0x2fe8a3;});}else{return _0x2fe8a3;}})[_0x01ac('0x43')](function(_0x512a8b){logger[_0x01ac('0x29')](_0x01ac('0x4f'),_0x512a8b);throw _0x512a8b;});}return _0x2fe8a3;})['then'](respondWithResult(_0x2fa250,0xc9))[_0x01ac('0x43')](handleError(_0x2fa250,null));};exports[_0x01ac('0x23')]=function(_0x411390,_0x663dde){if(_0x411390['body']['id']){delete _0x411390[_0x01ac('0x48')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x411390[_0x01ac('0x44')]['id']}})[_0x01ac('0x24')](handleEntityNotFound(_0x663dde,null))[_0x01ac('0x24')](saveUpdates(_0x411390[_0x01ac('0x48')],null))[_0x01ac('0x24')](respondWithResult(_0x663dde,null))[_0x01ac('0x43')](handleError(_0x663dde,null));};exports[_0x01ac('0x25')]=function(_0x267197,_0x4b2980){return db[_0x01ac('0x40')][_0x01ac('0x4c')]({'where':{'id':_0x267197['params']['id']}})[_0x01ac('0x24')](handleEntityNotFound(_0x4b2980,null))[_0x01ac('0x24')](removeEntity(_0x4b2980,null))['catch'](handleError(_0x4b2980,null));};exports['test']=function(_0x4bc20f,_0x42d55f,_0x2b3b85){var _0x3fe88e;return db[_0x01ac('0x40')][_0x01ac('0x4c')]({'where':{'id':_0x4bc20f[_0x01ac('0x44')]['id']},'attributes':['id','dsn']})[_0x01ac('0x24')](handleEntityNotFound(_0x42d55f,null))[_0x01ac('0x24')](function(_0x5bb102){if(_0x5bb102){var _0x349718=require('odbc')();_0x349718['openSync'](_0x5bb102[_0x01ac('0x50')]);_0x349718[_0x01ac('0x51')]();return _0x5bb102;}})[_0x01ac('0x24')](respondWithResult(_0x42d55f,null))[_0x01ac('0x43')](handleError(_0x42d55f,null));}; \ No newline at end of file +var _0xc8cc=['catch','show','params','includeAll','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','test','dsn','odbc','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','ODBC','UserProfileResource','sendStatus','error','stack','name','send','SquareOdbc','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','map','type','key','VIRTUAL','field','filter','options','findAll','rows'];(function(_0x2a0453,_0x27d0c1){var _0x4b2533=function(_0x692c81){while(--_0x692c81){_0x2a0453['push'](_0x2a0453['shift']());}};_0x4b2533(++_0x27d0c1);}(_0xc8cc,0x112));var _0xcc8c=function(_0x447fc8,_0x4bc237){_0x447fc8=_0x447fc8-0x0;var _0x4d76dc=_0xc8cc[_0x447fc8];return _0x4d76dc;};'use strict';var pdf=require(_0xcc8c('0x0'));var emlformat=require(_0xcc8c('0x1'));var rimraf=require(_0xcc8c('0x2'));var zipdir=require(_0xcc8c('0x3'));var jsonpatch=require(_0xcc8c('0x4'));var rp=require(_0xcc8c('0x5'));var moment=require(_0xcc8c('0x6'));var BPromise=require(_0xcc8c('0x7'));var Mustache=require(_0xcc8c('0x8'));var util=require('util');var path=require(_0xcc8c('0x9'));var sox=require(_0xcc8c('0xa'));var csv=require(_0xcc8c('0xb'));var ejs=require(_0xcc8c('0xc'));var fs=require('fs');var _=require(_0xcc8c('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcc8c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcc8c('0xb'));var querystring=require(_0xcc8c('0xf'));var Papa=require(_0xcc8c('0x10'));var authService=require(_0xcc8c('0x11'));var hardwareService=require(_0xcc8c('0x12'));var Redis=require(_0xcc8c('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0xcc8c('0x14'))(_0xcc8c('0x15'));var utils=require(_0xcc8c('0x16'));var config=require('../../config/environment');var db=require(_0xcc8c('0x17'))['db'];function respondWithStatusCode(_0x3d8d66,_0x55bcd7){_0x55bcd7=_0x55bcd7||0xcc;return function(_0x46604e){if(_0x46604e){return _0x3d8d66['sendStatus'](_0x55bcd7);}return _0x3d8d66[_0xcc8c('0x18')](_0x55bcd7)[_0xcc8c('0x19')]();};}function respondWithResult(_0x164362,_0x261c37){_0x261c37=_0x261c37||0xc8;return function(_0x563d08){if(_0x563d08){return _0x164362[_0xcc8c('0x18')](_0x261c37)[_0xcc8c('0x1a')](_0x563d08);}};}function respondWithFilteredResult(_0x52394b,_0xd3b836){return function(_0xe21c35){if(_0xe21c35){var _0x2101c4=_0xe21c35[_0xcc8c('0x1b')],_0x1e3961=_0xd3b836[_0xcc8c('0x1c')],_0x14ea0f=_0xd3b836[_0xcc8c('0x1c')]+_0xd3b836[_0xcc8c('0x1d')],_0x18b45e;if(_0x14ea0f>=_0x2101c4){_0x14ea0f=_0x2101c4;_0x18b45e=0xc8;}else{_0x18b45e=0xce;}_0x52394b[_0xcc8c('0x18')](_0x18b45e);return _0x52394b[_0xcc8c('0x1e')](_0xcc8c('0x1f'),_0x1e3961+'-'+_0x14ea0f+'/'+_0x2101c4)['json'](_0xe21c35);}return null;};}function patchUpdates(_0x3a711c){return function(_0x521c04){try{jsonpatch[_0xcc8c('0x20')](_0x521c04,_0x3a711c,!![]);}catch(_0x324e49){return BPromise[_0xcc8c('0x21')](_0x324e49);}return _0x521c04[_0xcc8c('0x22')]();};}function saveUpdates(_0x136b27,_0x465f19){return function(_0x113bd6){if(_0x113bd6){return _0x113bd6[_0xcc8c('0x23')](_0x136b27)['then'](function(_0x5495ee){return _0x5495ee;});}return null;};}function removeEntity(_0x9cf56c,_0x3d9f0b){return function(_0x28fafc){if(_0x28fafc){return _0x28fafc[_0xcc8c('0x24')]()[_0xcc8c('0x25')](function(){var _0x2f7fa6=_0x28fafc[_0xcc8c('0x26')]({'plain':!![]});var _0xb9772f=_0xcc8c('0x27');return db[_0xcc8c('0x28')][_0xcc8c('0x24')]({'where':{'type':_0xb9772f,'resourceId':_0x2f7fa6['id']}})[_0xcc8c('0x25')](function(){return _0x28fafc;});})[_0xcc8c('0x25')](function(){_0x9cf56c[_0xcc8c('0x18')](0xcc)[_0xcc8c('0x19')]();});}};}function handleEntityNotFound(_0x2fde63,_0xb3d33b){return function(_0x16b0a5){if(!_0x16b0a5){_0x2fde63[_0xcc8c('0x29')](0x194);}return _0x16b0a5;};}function handleError(_0x2e00b3,_0x54fb37){_0x54fb37=_0x54fb37||0x1f4;return function(_0xbdc42a){logger[_0xcc8c('0x2a')](_0xbdc42a[_0xcc8c('0x2b')]);if(_0xbdc42a[_0xcc8c('0x2c')]){delete _0xbdc42a[_0xcc8c('0x2c')];}_0x2e00b3[_0xcc8c('0x18')](_0x54fb37)[_0xcc8c('0x2d')](_0xbdc42a);};}exports['index']=function(_0x120da2,_0x79aa8f){var _0x4af816={},_0x243d33={},_0x154ec7={'count':0x0,'rows':[]};var _0x39d11d=db[_0xcc8c('0x2e')][_0xcc8c('0x2f')];_0x243d33['model']=_['keys'](_0x39d11d);_0x243d33[_0xcc8c('0x30')]=_[_0xcc8c('0x31')](_0x120da2[_0xcc8c('0x30')]);_0x243d33['filters']=_[_0xcc8c('0x32')](_0x243d33[_0xcc8c('0x33')],_0x243d33[_0xcc8c('0x30')]);_0x4af816[_0xcc8c('0x34')]=_[_0xcc8c('0x32')](_0x243d33['model'],qs['fields'](_0x120da2['query'][_0xcc8c('0x35')]));_0x4af816[_0xcc8c('0x34')]=_0x4af816[_0xcc8c('0x34')][_0xcc8c('0x36')]?_0x4af816[_0xcc8c('0x34')]:_0x243d33[_0xcc8c('0x33')];if(!_0x120da2[_0xcc8c('0x30')][_0xcc8c('0x37')](_0xcc8c('0x38'))){_0x4af816[_0xcc8c('0x1d')]=qs['limit'](_0x120da2[_0xcc8c('0x30')]['limit']);_0x4af816['offset']=qs[_0xcc8c('0x1c')](_0x120da2[_0xcc8c('0x30')]['offset']);}_0x4af816[_0xcc8c('0x39')]=qs[_0xcc8c('0x3a')](_0x120da2[_0xcc8c('0x30')][_0xcc8c('0x3a')]);_0x4af816['where']=qs['filters'](_['pick'](_0x120da2[_0xcc8c('0x30')],_0x243d33[_0xcc8c('0x3b')]));if(_0x120da2[_0xcc8c('0x30')]['filter']){_0x4af816['where']=_['merge'](_0x4af816[_0xcc8c('0x3c')],{'$or':_[_0xcc8c('0x3d')](_0x39d11d,function(_0x487d9f){if(_0x487d9f[_0xcc8c('0x3e')][_0xcc8c('0x3f')]!==_0xcc8c('0x40')){var _0x1c7c3f={};_0x1c7c3f[_0x487d9f[_0xcc8c('0x41')]]={'$like':'%'+_0x120da2[_0xcc8c('0x30')][_0xcc8c('0x42')]+'%'};return _0x1c7c3f;}})});}_0x4af816=_['merge']({},_0x4af816,_0x120da2[_0xcc8c('0x43')]);var _0x161964={'where':_0x4af816[_0xcc8c('0x3c')]};return db[_0xcc8c('0x2e')]['count'](_0x161964)[_0xcc8c('0x25')](function(_0xf961db){_0x154ec7[_0xcc8c('0x1b')]=_0xf961db;if(_0x120da2['query']['includeAll']){_0x4af816['include']=[{'all':!![]}];}return db['SquareOdbc'][_0xcc8c('0x44')](_0x4af816);})[_0xcc8c('0x25')](function(_0x4336e8){_0x154ec7[_0xcc8c('0x45')]=_0x4336e8;return _0x154ec7;})[_0xcc8c('0x25')](respondWithFilteredResult(_0x79aa8f,_0x4af816))[_0xcc8c('0x46')](handleError(_0x79aa8f,null));};exports[_0xcc8c('0x47')]=function(_0x23c30c,_0xef7e8e){var _0x2b9c7d={'raw':!![],'where':{'id':_0x23c30c[_0xcc8c('0x48')]['id']}},_0x3e730e={};_0x3e730e[_0xcc8c('0x33')]=_['keys'](db[_0xcc8c('0x2e')][_0xcc8c('0x2f')]);_0x3e730e[_0xcc8c('0x30')]=_[_0xcc8c('0x31')](_0x23c30c['query']);_0x3e730e[_0xcc8c('0x3b')]=_[_0xcc8c('0x32')](_0x3e730e[_0xcc8c('0x33')],_0x3e730e['query']);_0x2b9c7d[_0xcc8c('0x34')]=_[_0xcc8c('0x32')](_0x3e730e[_0xcc8c('0x33')],qs[_0xcc8c('0x35')](_0x23c30c['query'][_0xcc8c('0x35')]));_0x2b9c7d[_0xcc8c('0x34')]=_0x2b9c7d['attributes'][_0xcc8c('0x36')]?_0x2b9c7d['attributes']:_0x3e730e[_0xcc8c('0x33')];if(_0x23c30c[_0xcc8c('0x30')][_0xcc8c('0x49')]){_0x2b9c7d[_0xcc8c('0x4a')]=[{'all':!![]}];}_0x2b9c7d=_[_0xcc8c('0x4b')]({},_0x2b9c7d,_0x23c30c['options']);return db[_0xcc8c('0x2e')][_0xcc8c('0x4c')](_0x2b9c7d)['then'](handleEntityNotFound(_0xef7e8e,null))[_0xcc8c('0x25')](respondWithResult(_0xef7e8e,null))[_0xcc8c('0x46')](handleError(_0xef7e8e,null));};exports[_0xcc8c('0x4d')]=function(_0xc6f9b7,_0x173b69){return db[_0xcc8c('0x2e')][_0xcc8c('0x4d')](_0xc6f9b7[_0xcc8c('0x4e')],{})[_0xcc8c('0x25')](function(_0x16e685){var _0x588b41=_0xc6f9b7[_0xcc8c('0x4f')]['get']({'plain':!![]});if(!_0x588b41)throw new Error(_0xcc8c('0x50'));if(_0x588b41[_0xcc8c('0x51')]==='user'){var _0xbbaf46=_0x16e685[_0xcc8c('0x26')]({'plain':!![]});var _0x5a1162=_0xcc8c('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x5a1162,'userProfileId':_0x588b41['userProfileId']},'raw':!![]})['then'](function(_0x15a826){if(_0x15a826&&_0x15a826['autoAssociation']===0x0){return db[_0xcc8c('0x28')][_0xcc8c('0x4d')]({'name':_0xbbaf46[_0xcc8c('0x2c')],'resourceId':_0xbbaf46['id'],'type':_0x15a826[_0xcc8c('0x2c')],'sectionId':_0x15a826['id']},{})['then'](function(){return _0x16e685;});}else{return _0x16e685;}})[_0xcc8c('0x46')](function(_0x550334){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x550334);throw _0x550334;});}return _0x16e685;})[_0xcc8c('0x25')](respondWithResult(_0x173b69,0xc9))[_0xcc8c('0x46')](handleError(_0x173b69,null));};exports[_0xcc8c('0x23')]=function(_0x21de5f,_0x2b7071){if(_0x21de5f[_0xcc8c('0x4e')]['id']){delete _0x21de5f[_0xcc8c('0x4e')]['id'];}return db[_0xcc8c('0x2e')]['find']({'where':{'id':_0x21de5f[_0xcc8c('0x48')]['id']}})[_0xcc8c('0x25')](handleEntityNotFound(_0x2b7071,null))[_0xcc8c('0x25')](saveUpdates(_0x21de5f['body'],null))[_0xcc8c('0x25')](respondWithResult(_0x2b7071,null))[_0xcc8c('0x46')](handleError(_0x2b7071,null));};exports['destroy']=function(_0x5c5e70,_0x4119ec){return db['SquareOdbc'][_0xcc8c('0x4c')]({'where':{'id':_0x5c5e70['params']['id']}})[_0xcc8c('0x25')](handleEntityNotFound(_0x4119ec,null))[_0xcc8c('0x25')](removeEntity(_0x4119ec,null))['catch'](handleError(_0x4119ec,null));};exports[_0xcc8c('0x52')]=function(_0x7cde54,_0x5eff54,_0x5bff91){var _0x2d6128;return db[_0xcc8c('0x2e')][_0xcc8c('0x4c')]({'where':{'id':_0x7cde54[_0xcc8c('0x48')]['id']},'attributes':['id',_0xcc8c('0x53')]})[_0xcc8c('0x25')](handleEntityNotFound(_0x5eff54,null))[_0xcc8c('0x25')](function(_0x571cd3){if(_0x571cd3){var _0x314e5b=require(_0xcc8c('0x54'))();_0x314e5b['openSync'](_0x571cd3[_0xcc8c('0x53')]);_0x314e5b[_0xcc8c('0x55')]();return _0x571cd3;}})['then'](respondWithResult(_0x5eff54,null))[_0xcc8c('0x46')](handleError(_0x5eff54,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index a1a08b6..c35652a 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 _0x5ff3=['define','SquareOdbc','square_odbc','util','api','bluebird','request-promise','./squareOdbc.attributes','exports'];(function(_0x106a2e,_0xcee5d0){var _0x35ce29=function(_0x210395){while(--_0x210395){_0x106a2e['push'](_0x106a2e['shift']());}};_0x35ce29(++_0xcee5d0);}(_0x5ff3,0x17d));var _0x35ff=function(_0x1db928,_0xd2701b){_0x1db928=_0x1db928-0x0;var _0xd54ebe=_0x5ff3[_0x1db928];return _0xd54ebe;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var attributes=require(_0x35ff('0x4'));module[_0x35ff('0x5')]=function(_0x551514,_0x2fcb74){return _0x551514[_0x35ff('0x6')](_0x35ff('0x7'),attributes,{'tableName':_0x35ff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1339=['define','SquareOdbc','square_odbc','../../config/logger','api','moment','bluebird','request-promise','./squareOdbc.attributes','exports'];(function(_0x3a634e,_0x273db2){var _0x2ecddb=function(_0x3a9d2d){while(--_0x3a9d2d){_0x3a634e['push'](_0x3a634e['shift']());}};_0x2ecddb(++_0x273db2);}(_0x1339,0x1ed));var _0x9133=function(_0x1b26bd,_0x5f2e46){_0x1b26bd=_0x1b26bd-0x0;var _0x1a5cf5=_0x1339[_0x1b26bd];return _0x1a5cf5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var attributes=require(_0x9133('0x5'));module[_0x9133('0x6')]=function(_0x110c51,_0x558345){return _0x110c51[_0x9133('0x7')](_0x9133('0x8'),attributes,{'tableName':_0x9133('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 422b57d..ab16f31 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 _0xf679=['request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','SquareOdbc','options','raw','attributes','include','ShowSquareOdbc','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa0600b,_0x7e0886){var _0xb59ffa=function(_0x3cdfaa){while(--_0x3cdfaa){_0xa0600b['push'](_0xa0600b['shift']());}};_0xb59ffa(++_0x7e0886);}(_0xf679,0x10d));var _0x9f67=function(_0x2a95be,_0x27bdc1){_0x2a95be=_0x2a95be-0x0;var _0x31712d=_0xf679[_0x2a95be];return _0x31712d;};'use strict';var _=require(_0x9f67('0x0'));var util=require(_0x9f67('0x1'));var moment=require(_0x9f67('0x2'));var BPromise=require(_0x9f67('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9f67('0x4'));var logger=require(_0x9f67('0x5'))(_0x9f67('0x6'));var config=require(_0x9f67('0x7'));var jayson=require(_0x9f67('0x8'));var client=jayson[_0x9f67('0x9')][_0x9f67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31d3ec,_0x442c07,_0x44a5c8){return new BPromise(function(_0x8915ef,_0x5b3e12){return client[_0x9f67('0xb')](_0x31d3ec,_0x44a5c8)['then'](function(_0x549ad4){logger[_0x9f67('0xc')](_0x9f67('0xd'),_0x442c07,_0x9f67('0xe'));logger[_0x9f67('0xf')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x442c07,_0x9f67('0xe'),JSON[_0x9f67('0x10')](_0x549ad4));if(_0x549ad4[_0x9f67('0x11')]){if(_0x549ad4[_0x9f67('0x11')][_0x9f67('0x12')]===0x1f4){logger[_0x9f67('0x11')](_0x9f67('0xd'),_0x442c07,_0x549ad4[_0x9f67('0x11')][_0x9f67('0x13')]);return _0x5b3e12(_0x549ad4['error']['message']);}logger['error'](_0x9f67('0xd'),_0x442c07,_0x549ad4[_0x9f67('0x11')][_0x9f67('0x13')]);return _0x8915ef(_0x549ad4[_0x9f67('0x11')][_0x9f67('0x13')]);}else{logger['info'](_0x9f67('0xd'),_0x442c07,_0x9f67('0xe'));_0x8915ef(_0x549ad4[_0x9f67('0x14')][_0x9f67('0x13')]);}})[_0x9f67('0x15')](function(_0x141afb){logger[_0x9f67('0x11')](_0x9f67('0xd'),_0x442c07,_0x141afb);_0x5b3e12(_0x141afb);});});}exports['ShowSquareOdbc']=function(_0x9af8e4){var _0x14feee=this;return new Promise(function(_0x568ca5,_0x4515e8){return db[_0x9f67('0x16')]['find']({'raw':_0x9af8e4[_0x9f67('0x17')]?_0x9af8e4[_0x9f67('0x17')][_0x9f67('0x18')]===undefined?!![]:![]:!![],'where':_0x9af8e4[_0x9f67('0x17')]?_0x9af8e4[_0x9f67('0x17')]['where']||null:null,'attributes':_0x9af8e4[_0x9f67('0x17')]?_0x9af8e4[_0x9f67('0x17')][_0x9f67('0x19')]||null:null,'include':_0x9af8e4[_0x9f67('0x17')]?_0x9af8e4[_0x9f67('0x17')][_0x9f67('0x1a')]?_['map'](_0x9af8e4[_0x9f67('0x17')][_0x9f67('0x1a')],function(_0x36a99d){return{'model':db[_0x36a99d['model']],'as':_0x36a99d['as'],'attributes':_0x36a99d[_0x9f67('0x19')],'include':_0x36a99d[_0x9f67('0x1a')]?_['map'](_0x36a99d[_0x9f67('0x1a')],function(_0x2914c9){return{'model':db[_0x2914c9['model']],'as':_0x2914c9['as'],'attributes':_0x2914c9['attributes'],'include':_0x2914c9[_0x9f67('0x1a')]?_['map'](_0x2914c9[_0x9f67('0x1a')],function(_0xf25065){return{'model':db[_0xf25065['model']],'as':_0xf25065['as'],'attributes':_0xf25065[_0x9f67('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f0d38){logger[_0x9f67('0xc')]('ShowSquareOdbc',_0x9af8e4);logger['debug']('ShowSquareOdbc',_0x9af8e4,JSON['stringify'](_0x1f0d38));_0x568ca5(_0x1f0d38);})[_0x9f67('0x15')](function(_0x4c3d2e){logger[_0x9f67('0x11')](_0x9f67('0x1b'),_0x4c3d2e[_0x9f67('0x13')],_0x9af8e4);_0x4515e8(_0x14feee[_0x9f67('0x11')](0x1f4,_0x4c3d2e[_0x9f67('0x13')]));});});}; \ No newline at end of file +var _0x5c5c=['info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareOdbc','find','options','raw','where','attributes','include','model','map','then','ShowSquareOdbc','debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x32b370,_0x1112f7){var _0x4d2a19=function(_0x40678b){while(--_0x40678b){_0x32b370['push'](_0x32b370['shift']());}};_0x4d2a19(++_0x1112f7);}(_0x5c5c,0x11e));var _0xc5c5=function(_0xf9a4d4,_0x92518f){_0xf9a4d4=_0xf9a4d4-0x0;var _0x44b4e7=_0x5c5c[_0xf9a4d4];return _0x44b4e7;};'use strict';var _=require(_0xc5c5('0x0'));var util=require('util');var moment=require(_0xc5c5('0x1'));var BPromise=require(_0xc5c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c5('0x3'));var db=require(_0xc5c5('0x4'))['db'];var utils=require(_0xc5c5('0x5'));var logger=require(_0xc5c5('0x6'))(_0xc5c5('0x7'));var config=require('../../config/environment');var jayson=require(_0xc5c5('0x8'));var client=jayson['client'][_0xc5c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x674329,_0xd8d781,_0xde5d2d){return new BPromise(function(_0x26cf9c,_0xdfd971){return client[_0xc5c5('0xa')](_0x674329,_0xde5d2d)['then'](function(_0x3bc2c1){logger[_0xc5c5('0xb')](_0xc5c5('0xc'),_0xd8d781,'request\x20sent');logger['debug'](_0xc5c5('0xd'),_0xd8d781,_0xc5c5('0xe'),JSON[_0xc5c5('0xf')](_0x3bc2c1));if(_0x3bc2c1[_0xc5c5('0x10')]){if(_0x3bc2c1[_0xc5c5('0x10')][_0xc5c5('0x11')]===0x1f4){logger['error'](_0xc5c5('0xc'),_0xd8d781,_0x3bc2c1[_0xc5c5('0x10')][_0xc5c5('0x12')]);return _0xdfd971(_0x3bc2c1[_0xc5c5('0x10')]['message']);}logger['error'](_0xc5c5('0xc'),_0xd8d781,_0x3bc2c1[_0xc5c5('0x10')]['message']);return _0x26cf9c(_0x3bc2c1[_0xc5c5('0x10')][_0xc5c5('0x12')]);}else{logger[_0xc5c5('0xb')]('SquareOdbc,\x20%s,\x20%s',_0xd8d781,_0xc5c5('0xe'));_0x26cf9c(_0x3bc2c1[_0xc5c5('0x13')][_0xc5c5('0x12')]);}})[_0xc5c5('0x14')](function(_0x28c058){logger[_0xc5c5('0x10')](_0xc5c5('0xc'),_0xd8d781,_0x28c058);_0xdfd971(_0x28c058);});});}exports['ShowSquareOdbc']=function(_0x342cf3){var _0x6540e7=this;return new Promise(function(_0x48d6e3,_0x2e1296){return db[_0xc5c5('0x15')][_0xc5c5('0x16')]({'raw':_0x342cf3[_0xc5c5('0x17')]?_0x342cf3[_0xc5c5('0x17')][_0xc5c5('0x18')]===undefined?!![]:![]:!![],'where':_0x342cf3[_0xc5c5('0x17')]?_0x342cf3['options'][_0xc5c5('0x19')]||null:null,'attributes':_0x342cf3[_0xc5c5('0x17')]?_0x342cf3[_0xc5c5('0x17')][_0xc5c5('0x1a')]||null:null,'include':_0x342cf3[_0xc5c5('0x17')]?_0x342cf3[_0xc5c5('0x17')][_0xc5c5('0x1b')]?_['map'](_0x342cf3[_0xc5c5('0x17')]['include'],function(_0x1cd535){return{'model':db[_0x1cd535[_0xc5c5('0x1c')]],'as':_0x1cd535['as'],'attributes':_0x1cd535['attributes'],'include':_0x1cd535[_0xc5c5('0x1b')]?_['map'](_0x1cd535[_0xc5c5('0x1b')],function(_0x2059ba){return{'model':db[_0x2059ba['model']],'as':_0x2059ba['as'],'attributes':_0x2059ba['attributes'],'include':_0x2059ba[_0xc5c5('0x1b')]?_[_0xc5c5('0x1d')](_0x2059ba[_0xc5c5('0x1b')],function(_0x72b64e){return{'model':db[_0x72b64e[_0xc5c5('0x1c')]],'as':_0x72b64e['as'],'attributes':_0x72b64e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc5c5('0x1e')](function(_0x4b8a1b){logger[_0xc5c5('0xb')](_0xc5c5('0x1f'),_0x342cf3);logger[_0xc5c5('0x20')](_0xc5c5('0x1f'),_0x342cf3,JSON[_0xc5c5('0xf')](_0x4b8a1b));_0x48d6e3(_0x4b8a1b);})[_0xc5c5('0x14')](function(_0x2bcb4f){logger[_0xc5c5('0x10')](_0xc5c5('0x1f'),_0x2bcb4f[_0xc5c5('0x12')],_0x342cf3);_0x2e1296(_0x6540e7['error'](0x1f4,_0x2bcb4f[_0xc5c5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index a7d269c..e123f65 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 _0x735b=['../../config/environment','get','isAuthenticated','index','show','/:id/users','post','addUsers','put','/:id','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4ab5a8,_0x46f7ec){var _0xe75242=function(_0x46e018){while(--_0x46e018){_0x4ab5a8['push'](_0x4ab5a8['shift']());}};_0xe75242(++_0x46f7ec);}(_0x735b,0x12d));var _0xb735=function(_0x23e6cc,_0x1292ad){_0x23e6cc=_0x23e6cc-0x0;var _0x80d49=_0x735b[_0x23e6cc];return _0x80d49;};'use strict';var multer=require(_0xb735('0x0'));var util=require('util');var path=require(_0xb735('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb735('0x2')]();var auth=require(_0xb735('0x3'));var interaction=require(_0xb735('0x4'));var config=require(_0xb735('0x5'));var controller=require('./squareProject.controller');router[_0xb735('0x6')]('/',auth[_0xb735('0x7')](),controller[_0xb735('0x8')]);router[_0xb735('0x6')]('/:id',auth[_0xb735('0x7')](),controller[_0xb735('0x9')]);router[_0xb735('0x6')](_0xb735('0xa'),auth[_0xb735('0x7')](),controller['getUsers']);router['post']('/',auth[_0xb735('0x7')](),controller['create']);router[_0xb735('0xb')](_0xb735('0xa'),auth[_0xb735('0x7')](),controller[_0xb735('0xc')]);router[_0xb735('0xd')](_0xb735('0xe'),auth[_0xb735('0x7')](),controller['update']);router[_0xb735('0xf')](_0xb735('0xe'),auth[_0xb735('0x7')](),controller[_0xb735('0x10')]);router['delete'](_0xb735('0xa'),auth[_0xb735('0x7')](),controller['removeUsers']);module[_0xb735('0x11')]=router; \ No newline at end of file +var _0xc866=['put','update','/:id','delete','removeUsers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','get','show','getUsers','post','/:id/users'];(function(_0x245ea0,_0x2a96b9){var _0x110ad6=function(_0x1824b9){while(--_0x1824b9){_0x245ea0['push'](_0x245ea0['shift']());}};_0x110ad6(++_0x2a96b9);}(_0xc866,0x141));var _0x6c86=function(_0x5d9f24,_0x5e849c){_0x5d9f24=_0x5d9f24-0x0;var _0x216546=_0xc866[_0x5d9f24];return _0x216546;};'use strict';var multer=require(_0x6c86('0x0'));var util=require(_0x6c86('0x1'));var path=require(_0x6c86('0x2'));var timeout=require(_0x6c86('0x3'));var express=require(_0x6c86('0x4'));var router=express['Router']();var auth=require(_0x6c86('0x5'));var interaction=require(_0x6c86('0x6'));var config=require(_0x6c86('0x7'));var controller=require(_0x6c86('0x8'));router['get']('/',auth[_0x6c86('0x9')](),controller['index']);router[_0x6c86('0xa')]('/:id',auth[_0x6c86('0x9')](),controller[_0x6c86('0xb')]);router[_0x6c86('0xa')]('/:id/users',auth[_0x6c86('0x9')](),controller[_0x6c86('0xc')]);router[_0x6c86('0xd')]('/',auth[_0x6c86('0x9')](),controller['create']);router['post'](_0x6c86('0xe'),auth[_0x6c86('0x9')](),controller['addUsers']);router[_0x6c86('0xf')]('/:id',auth[_0x6c86('0x9')](),controller[_0x6c86('0x10')]);router['delete'](_0x6c86('0x11'),auth[_0x6c86('0x9')](),controller['destroy']);router[_0x6c86('0x12')]('/:id/users',auth[_0x6c86('0x9')](),controller[_0x6c86('0x13')]);module[_0x6c86('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 e1b8c00..8105852 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 _0xe558=['preproduction','toString','utf8','production','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe558,0x70));var _0x8e55=function(_0x958912,_0x27cfe0){_0x958912=_0x958912-0x0;var _0x1344f4=_0xe558[_0x958912];return _0x1344f4;};'use strict';var Sequelize=require(_0x8e55('0x0'));module[_0x8e55('0x1')]={'name':{'type':Sequelize[_0x8e55('0x2')],'unique':_0x8e55('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x8e55('0x2')]},'notes':{'type':Sequelize[_0x8e55('0x4')]},'preproduction':{'type':Sequelize[_0x8e55('0x5')](_0x8e55('0x6')),'get':function(){if(this[_0x8e55('0x7')]('preproduction')){return this[_0x8e55('0x7')](_0x8e55('0x8'))[_0x8e55('0x9')](_0x8e55('0xa'));}}},'production':{'type':Sequelize[_0x8e55('0x5')](_0x8e55('0x6')),'get':function(){if(this['getDataValue'](_0x8e55('0xb'))){return this[_0x8e55('0x7')]('production')[_0x8e55('0x9')]('utf8');}}}}; \ No newline at end of file +var _0x714c=['production','exports','STRING','name','TEXT','long','getDataValue','preproduction','toString','utf8','BLOB'];(function(_0x328985,_0x16fe30){var _0x5ee9db=function(_0x2d5f11){while(--_0x2d5f11){_0x328985['push'](_0x328985['shift']());}};_0x5ee9db(++_0x16fe30);}(_0x714c,0x18d));var _0xc714=function(_0x5d72da,_0xb7ce32){_0x5d72da=_0x5d72da-0x0;var _0x43ebe7=_0x714c[_0x5d72da];return _0x43ebe7;};'use strict';var Sequelize=require('sequelize');module[_0xc714('0x0')]={'name':{'type':Sequelize[_0xc714('0x1')],'unique':_0xc714('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xc714('0x1')]},'notes':{'type':Sequelize[_0xc714('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0xc714('0x4')),'get':function(){if(this[_0xc714('0x5')]('preproduction')){return this['getDataValue'](_0xc714('0x6'))[_0xc714('0x7')](_0xc714('0x8'));}}},'production':{'type':Sequelize[_0xc714('0x9')]('long'),'get':function(){if(this['getDataValue'](_0xc714('0xa'))){return this[_0xc714('0x5')](_0xc714('0xa'))[_0xc714('0x7')](_0xc714('0x8'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 333568a..d4448aa 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 _0xdb28=['status','end','json','offset','limit','set','apply','save','update','then','get','SquareProjects','UserProfileResource','destroy','error','stack','name','index','SquareProject','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','map','type','VIRTUAL','field','filter','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','nolimit','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./squareProject.socket','register','sendStatus'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xdb28,0x106));var _0x8db2=function(_0x5bd31d,_0x37f4b7){_0x5bd31d=_0x5bd31d-0x0;var _0x84df9=_0xdb28[_0x5bd31d];return _0x84df9;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0x8db2('0x11'));var Redis=require(_0x8db2('0x12'));var qs=require(_0x8db2('0x13'));var logger=require('../../config/logger')(_0x8db2('0x14'));var utils=require(_0x8db2('0x15'));var config=require('../../config/environment');var db=require(_0x8db2('0x16'))['db'];config[_0x8db2('0x17')]=_[_0x8db2('0x18')](config[_0x8db2('0x17')],{'host':_0x8db2('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8db2('0x1a'))[_0x8db2('0x1b')](socket);function respondWithStatusCode(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xcc;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x1c')](_0x1d6a15);}return _0x350d61[_0x8db2('0x1d')](_0x1d6a15)[_0x8db2('0x1e')]();};}function respondWithResult(_0x131252,_0x16c8c2){_0x16c8c2=_0x16c8c2||0xc8;return function(_0x5489a9){if(_0x5489a9){return _0x131252[_0x8db2('0x1d')](_0x16c8c2)[_0x8db2('0x1f')](_0x5489a9);}};}function respondWithFilteredResult(_0x48101e,_0x2b3f73){return function(_0x44957d){if(_0x44957d){var _0x21db8c=_0x44957d['count'],_0x3fddc2=_0x2b3f73['offset'],_0x2efd06=_0x2b3f73[_0x8db2('0x20')]+_0x2b3f73[_0x8db2('0x21')],_0x46ce14;if(_0x2efd06>=_0x21db8c){_0x2efd06=_0x21db8c;_0x46ce14=0xc8;}else{_0x46ce14=0xce;}_0x48101e[_0x8db2('0x1d')](_0x46ce14);return _0x48101e[_0x8db2('0x22')]('Content-Range',_0x3fddc2+'-'+_0x2efd06+'/'+_0x21db8c)[_0x8db2('0x1f')](_0x44957d);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x23')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x24')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x25')](_0x3e30e6)[_0x8db2('0x26')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){var _0x4d923c=_0x4f6516[_0x8db2('0x27')]({'plain':!![]});var _0x29b5cd=_0x8db2('0x28');return db[_0x8db2('0x29')][_0x8db2('0x2a')]({'where':{'type':_0x29b5cd,'resourceId':_0x4d923c['id']}})[_0x8db2('0x26')](function(){return _0x4f6516;});})['then'](function(){_0x5c6614[_0x8db2('0x1d')](0xcc)[_0x8db2('0x1e')]();});}};}function handleEntityNotFound(_0x430dd5,_0x8b7cec){return function(_0x483aee){if(!_0x483aee){_0x430dd5[_0x8db2('0x1c')](0x194);}return _0x483aee;};}function handleError(_0x11f398,_0x241baf){_0x241baf=_0x241baf||0x1f4;return function(_0x1687ed){logger[_0x8db2('0x2b')](_0x1687ed[_0x8db2('0x2c')]);if(_0x1687ed[_0x8db2('0x2d')]){delete _0x1687ed[_0x8db2('0x2d')];}_0x11f398[_0x8db2('0x1d')](_0x241baf)['send'](_0x1687ed);};}exports[_0x8db2('0x2e')]=function(_0x50b28d,_0x59cb77){var _0x302188={},_0x25ed2c={},_0xcc8a66={'count':0x0,'rows':[]};var _0x49b2b3=db[_0x8db2('0x2f')]['rawAttributes'];_0x25ed2c[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x49b2b3);_0x25ed2c[_0x8db2('0x32')]=_['keys'](_0x50b28d['query']);_0x25ed2c[_0x8db2('0x33')]=_[_0x8db2('0x34')](_0x25ed2c['model'],_0x25ed2c['query']);_0x302188[_0x8db2('0x35')]=_[_0x8db2('0x34')](_0x25ed2c[_0x8db2('0x30')],qs[_0x8db2('0x36')](_0x50b28d[_0x8db2('0x32')][_0x8db2('0x36')]));_0x302188[_0x8db2('0x35')]=_0x302188[_0x8db2('0x35')][_0x8db2('0x37')]?_0x302188[_0x8db2('0x35')]:_0x25ed2c['model'];if(!_0x50b28d[_0x8db2('0x32')][_0x8db2('0x38')]('nolimit')){_0x302188[_0x8db2('0x21')]=qs[_0x8db2('0x21')](_0x50b28d['query']['limit']);_0x302188[_0x8db2('0x20')]=qs['offset'](_0x50b28d[_0x8db2('0x32')][_0x8db2('0x20')]);}_0x302188[_0x8db2('0x39')]=qs[_0x8db2('0x3a')](_0x50b28d['query'][_0x8db2('0x3a')]);_0x302188['where']=qs[_0x8db2('0x33')](_[_0x8db2('0x3b')](_0x50b28d[_0x8db2('0x32')],_0x25ed2c[_0x8db2('0x33')]));if(_0x50b28d['query']['filter']){_0x302188[_0x8db2('0x3c')]=_[_0x8db2('0x3d')](_0x302188['where'],{'$or':_[_0x8db2('0x3e')](_0x49b2b3,function(_0x24bcfe){if(_0x24bcfe[_0x8db2('0x3f')]['key']!==_0x8db2('0x40')){var _0x149186={};_0x149186[_0x24bcfe[_0x8db2('0x41')]]={'$like':'%'+_0x50b28d[_0x8db2('0x32')][_0x8db2('0x42')]+'%'};return _0x149186;}})});}_0x302188=_[_0x8db2('0x3d')]({},_0x302188,_0x50b28d[_0x8db2('0x43')]);var _0x1575ea={'where':_0x302188[_0x8db2('0x3c')]};return db[_0x8db2('0x2f')][_0x8db2('0x44')](_0x1575ea)[_0x8db2('0x26')](function(_0x1d9025){_0xcc8a66['count']=_0x1d9025;if(_0x50b28d[_0x8db2('0x32')][_0x8db2('0x45')]){_0x302188['include']=[{'all':!![]}];}return db['SquareProject'][_0x8db2('0x46')](_0x302188);})['then'](function(_0x130eb9){_0xcc8a66[_0x8db2('0x47')]=_0x130eb9;return _0xcc8a66;})[_0x8db2('0x26')](respondWithFilteredResult(_0x59cb77,_0x302188))[_0x8db2('0x48')](handleError(_0x59cb77,null));};exports[_0x8db2('0x49')]=function(_0x30d606,_0xa53fba){var _0x5c97ef={'raw':![],'where':{'id':_0x30d606[_0x8db2('0x4a')]['id']}},_0x2f86b1={};_0x2f86b1[_0x8db2('0x30')]=_[_0x8db2('0x31')](db['SquareProject'][_0x8db2('0x4b')]);_0x2f86b1[_0x8db2('0x32')]=_[_0x8db2('0x31')](_0x30d606[_0x8db2('0x32')]);_0x2f86b1['filters']=_[_0x8db2('0x34')](_0x2f86b1['model'],_0x2f86b1[_0x8db2('0x32')]);_0x5c97ef[_0x8db2('0x35')]=_[_0x8db2('0x34')](_0x2f86b1['model'],qs['fields'](_0x30d606[_0x8db2('0x32')]['fields']));_0x5c97ef[_0x8db2('0x35')]=_0x5c97ef[_0x8db2('0x35')][_0x8db2('0x37')]?_0x5c97ef[_0x8db2('0x35')]:_0x2f86b1[_0x8db2('0x30')];if(_0x30d606[_0x8db2('0x32')][_0x8db2('0x45')]){_0x5c97ef[_0x8db2('0x4c')]=[{'all':!![]}];}_0x5c97ef=_[_0x8db2('0x3d')]({},_0x5c97ef,_0x30d606[_0x8db2('0x43')]);return db[_0x8db2('0x2f')][_0x8db2('0x4d')](_0x5c97ef)['then'](handleEntityNotFound(_0xa53fba,null))[_0x8db2('0x26')](respondWithResult(_0xa53fba,null))[_0x8db2('0x48')](handleError(_0xa53fba,null));};exports[_0x8db2('0x4e')]=function(_0x3244db,_0x4f5018){return db['SquareProject'][_0x8db2('0x4e')](_0x3244db[_0x8db2('0x4f')],{})[_0x8db2('0x26')](function(_0x4c66e5){var _0x540d90=_0x3244db['user'][_0x8db2('0x27')]({'plain':!![]});if(!_0x540d90)throw new Error(_0x8db2('0x50'));if(_0x540d90[_0x8db2('0x51')]===_0x8db2('0x52')){var _0xaab731=_0x4c66e5[_0x8db2('0x27')]({'plain':!![]});var _0x2fa118='SquareProjects';return db['UserProfileSection'][_0x8db2('0x4d')]({'where':{'name':_0x2fa118,'userProfileId':_0x540d90[_0x8db2('0x53')]},'raw':!![]})[_0x8db2('0x26')](function(_0x2f0bd0){if(_0x2f0bd0&&_0x2f0bd0[_0x8db2('0x54')]===0x0){return db[_0x8db2('0x29')][_0x8db2('0x4e')]({'name':_0xaab731[_0x8db2('0x2d')],'resourceId':_0xaab731['id'],'type':_0x2f0bd0[_0x8db2('0x2d')],'sectionId':_0x2f0bd0['id']},{})[_0x8db2('0x26')](function(){return _0x4c66e5;});}else{return _0x4c66e5;}})[_0x8db2('0x48')](function(_0x319273){logger[_0x8db2('0x2b')](_0x8db2('0x55'),_0x319273);throw _0x319273;});}return _0x4c66e5;})[_0x8db2('0x26')](respondWithResult(_0x4f5018,0xc9))['catch'](handleError(_0x4f5018,null));};exports[_0x8db2('0x25')]=function(_0xb4b0a,_0x579317){if(_0xb4b0a[_0x8db2('0x4f')]['id']){delete _0xb4b0a[_0x8db2('0x4f')]['id'];}return db[_0x8db2('0x2f')]['find']({'where':{'id':_0xb4b0a[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x579317,null))[_0x8db2('0x26')](saveUpdates(_0xb4b0a[_0x8db2('0x4f')],null))[_0x8db2('0x26')](respondWithResult(_0x579317,null))['catch'](handleError(_0x579317,null));};exports[_0x8db2('0x2a')]=function(_0x159dcb,_0x469bc2){return db['SquareProject'][_0x8db2('0x4d')]({'where':{'id':_0x159dcb[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x469bc2,null))[_0x8db2('0x26')](removeEntity(_0x469bc2,null))[_0x8db2('0x48')](handleError(_0x469bc2,null));};exports[_0x8db2('0x56')]=function(_0x12a81a,_0x5ca295,_0x39ff90){return db[_0x8db2('0x2f')]['find']({'where':{'id':_0x12a81a[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x5ca295,null))['then'](function(_0x107bbe){if(_0x107bbe){return _0x107bbe[_0x8db2('0x56')](_0x12a81a[_0x8db2('0x4f')][_0x8db2('0x57')],_[_0x8db2('0x58')](_0x12a81a[_0x8db2('0x4f')],[_0x8db2('0x57'),'id'])||{});}})[_0x8db2('0x26')](respondWithResult(_0x5ca295,null))[_0x8db2('0x48')](handleError(_0x5ca295,null));};exports[_0x8db2('0x59')]=function(_0x12fd12,_0x447a47,_0x3272c6){var _0x1ce89f;return db[_0x8db2('0x2f')][_0x8db2('0x4d')]({'where':{'id':_0x12fd12['params']['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x447a47,null))[_0x8db2('0x26')](function(_0x44118a){if(_0x44118a){return _0x44118a[_0x8db2('0x59')](_0x12fd12[_0x8db2('0x32')]['ids'])[_0x8db2('0x26')](function(_0x2c3087){if(_[_0x8db2('0x5a')](_0x12fd12[_0x8db2('0x32')][_0x8db2('0x57')])){for(var _0x348da8=0x0;_0x348da8<_0x12fd12[_0x8db2('0x32')][_0x8db2('0x57')][_0x8db2('0x37')];_0x348da8+=0x1){socket[_0x8db2('0x5b')](_0x8db2('0x5c'),{'UserId':_0x12fd12[_0x8db2('0x32')][_0x8db2('0x57')][_0x348da8],'SquareProjectId':_0x12fd12[_0x8db2('0x4a')]['id']});}}else{socket[_0x8db2('0x5b')](_0x8db2('0x5c'),{'UserId':_0x12fd12[_0x8db2('0x32')][_0x8db2('0x57')],'SquareProjectId':_0x12fd12['params']['id']});}});}})[_0x8db2('0x26')](respondWithStatusCode(_0x447a47,null))['catch'](handleError(_0x447a47,null));};exports[_0x8db2('0x5d')]=function(_0x570c53,_0x3de11e,_0x39330c){var _0xe4fd6a={};var _0x1e2ccd={};var _0x1e812e;var _0x59a32e;return db['SquareProject'][_0x8db2('0x5e')]({'where':{'id':_0x570c53[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x3de11e,null))[_0x8db2('0x26')](function(_0x20b49c){if(_0x20b49c){_0x1e812e=_0x20b49c;_0x1e2ccd[_0x8db2('0x30')]=_[_0x8db2('0x31')](db[_0x8db2('0x5f')]['rawAttributes']);_0x1e2ccd[_0x8db2('0x32')]=_[_0x8db2('0x31')](_0x570c53[_0x8db2('0x32')]);_0x1e2ccd[_0x8db2('0x33')]=_[_0x8db2('0x34')](_0x1e2ccd[_0x8db2('0x30')],_0x1e2ccd[_0x8db2('0x32')]);_0xe4fd6a[_0x8db2('0x35')]=_['intersection'](_0x1e2ccd['model'],qs[_0x8db2('0x36')](_0x570c53[_0x8db2('0x32')][_0x8db2('0x36')]));_0xe4fd6a[_0x8db2('0x35')]=_0xe4fd6a[_0x8db2('0x35')]['length']?_0xe4fd6a['attributes']:_0x1e2ccd[_0x8db2('0x30')];_0xe4fd6a[_0x8db2('0x39')]=qs['sort'](_0x570c53[_0x8db2('0x32')][_0x8db2('0x3a')]);_0xe4fd6a[_0x8db2('0x3c')]=qs['filters'](_[_0x8db2('0x3b')](_0x570c53[_0x8db2('0x32')],_0x1e2ccd[_0x8db2('0x33')]));if(_0x570c53['query'][_0x8db2('0x42')]){_0xe4fd6a[_0x8db2('0x3c')]=_[_0x8db2('0x3d')](_0xe4fd6a[_0x8db2('0x3c')],{'$or':_[_0x8db2('0x3e')](_0xe4fd6a['attributes'],function(_0x3c9af4){var _0x3023fe={};_0x3023fe[_0x3c9af4]={'$like':'%'+_0x570c53[_0x8db2('0x32')]['filter']+'%'};return _0x3023fe;})});}_0xe4fd6a=_['merge']({},_0xe4fd6a,_0x570c53[_0x8db2('0x43')]);return _0x1e812e[_0x8db2('0x5d')](_0xe4fd6a);}})['then'](function(_0x1eecf1){if(_0x1eecf1){_0x59a32e=_0x1eecf1[_0x8db2('0x37')];if(!_0x570c53[_0x8db2('0x32')][_0x8db2('0x38')](_0x8db2('0x60'))){_0xe4fd6a[_0x8db2('0x21')]=qs[_0x8db2('0x21')](_0x570c53[_0x8db2('0x32')][_0x8db2('0x21')]);_0xe4fd6a[_0x8db2('0x20')]=qs[_0x8db2('0x20')](_0x570c53[_0x8db2('0x32')][_0x8db2('0x20')]);}return _0x1e812e['getUsers'](_0xe4fd6a);}})[_0x8db2('0x26')](function(_0x4f29f1){if(_0x4f29f1){return _0x4f29f1?{'count':_0x59a32e,'rows':_0x4f29f1}:null;}})[_0x8db2('0x26')](respondWithResult(_0x3de11e,null))[_0x8db2('0x48')](handleError(_0x3de11e,null));}; \ No newline at end of file +var _0xadb5=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./squareProject.socket','status','json','count','offset','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','sendStatus','name','send','index','SquareProject','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filters','map','key','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','body','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','findOne','sort','filter','merge','getUsers','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0xadb5,0xad));var _0x5adb=function(_0x4ed7fe,_0x1041ee){_0x4ed7fe=_0x4ed7fe-0x0;var _0x635ce5=_0xadb5[_0x4ed7fe];return _0x635ce5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var authService=require(_0x5adb('0x11'));var hardwareService=require(_0x5adb('0x12'));var Redis=require(_0x5adb('0x13'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x5adb('0x14'));var utils=require(_0x5adb('0x15'));var config=require(_0x5adb('0x16'));var db=require('../../mysqldb')['db'];config[_0x5adb('0x17')]=_['defaults'](config[_0x5adb('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x5adb('0x18'))(new Redis(config[_0x5adb('0x17')]));require(_0x5adb('0x19'))['register'](socket);function respondWithStatusCode(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xcc;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['sendStatus'](_0x34af2c);}return _0x2a545b[_0x5adb('0x1a')](_0x34af2c)['end']();};}function respondWithResult(_0x367d82,_0x42a482){_0x42a482=_0x42a482||0xc8;return function(_0x30614e){if(_0x30614e){return _0x367d82[_0x5adb('0x1a')](_0x42a482)[_0x5adb('0x1b')](_0x30614e);}};}function respondWithFilteredResult(_0x39d24d,_0xa29dc){return function(_0x42f4c6){if(_0x42f4c6){var _0xb953a6=_0x42f4c6[_0x5adb('0x1c')],_0x529b65=_0xa29dc['offset'],_0x3fff62=_0xa29dc[_0x5adb('0x1d')]+_0xa29dc['limit'],_0x5de028;if(_0x3fff62>=_0xb953a6){_0x3fff62=_0xb953a6;_0x5de028=0xc8;}else{_0x5de028=0xce;}_0x39d24d['status'](_0x5de028);return _0x39d24d[_0x5adb('0x1e')](_0x5adb('0x1f'),_0x529b65+'-'+_0x3fff62+'/'+_0xb953a6)[_0x5adb('0x1b')](_0x42f4c6);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x20')](_0x3754cc)[_0x5adb('0x21')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x22')]()[_0x5adb('0x21')](function(){var _0x3839fb=_0x4b1957[_0x5adb('0x23')]({'plain':!![]});var _0x49f203=_0x5adb('0x24');return db[_0x5adb('0x25')]['destroy']({'where':{'type':_0x49f203,'resourceId':_0x3839fb['id']}})[_0x5adb('0x21')](function(){return _0x4b1957;});})[_0x5adb('0x21')](function(){_0xfd9bb9[_0x5adb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13ad1d,_0xbe21b1){return function(_0x3a4fca){if(!_0x3a4fca){_0x13ad1d[_0x5adb('0x26')](0x194);}return _0x3a4fca;};}function handleError(_0x36459b,_0x1c06c4){_0x1c06c4=_0x1c06c4||0x1f4;return function(_0x4a5d46){logger['error'](_0x4a5d46['stack']);if(_0x4a5d46[_0x5adb('0x27')]){delete _0x4a5d46[_0x5adb('0x27')];}_0x36459b[_0x5adb('0x1a')](_0x1c06c4)[_0x5adb('0x28')](_0x4a5d46);};}exports[_0x5adb('0x29')]=function(_0x4de310,_0x11ec2a){var _0x34b793={},_0x372da1={},_0x3b1fed={'count':0x0,'rows':[]};var _0x450169=db[_0x5adb('0x2a')][_0x5adb('0x2b')];_0x372da1[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](_0x450169);_0x372da1[_0x5adb('0x2e')]=_['keys'](_0x4de310[_0x5adb('0x2e')]);_0x372da1['filters']=_[_0x5adb('0x2f')](_0x372da1[_0x5adb('0x2c')],_0x372da1['query']);_0x34b793[_0x5adb('0x30')]=_[_0x5adb('0x2f')](_0x372da1[_0x5adb('0x2c')],qs['fields'](_0x4de310[_0x5adb('0x2e')][_0x5adb('0x31')]));_0x34b793['attributes']=_0x34b793['attributes'][_0x5adb('0x32')]?_0x34b793['attributes']:_0x372da1[_0x5adb('0x2c')];if(!_0x4de310[_0x5adb('0x2e')][_0x5adb('0x33')](_0x5adb('0x34'))){_0x34b793[_0x5adb('0x35')]=qs['limit'](_0x4de310[_0x5adb('0x2e')][_0x5adb('0x35')]);_0x34b793[_0x5adb('0x1d')]=qs['offset'](_0x4de310['query'][_0x5adb('0x1d')]);}_0x34b793[_0x5adb('0x36')]=qs['sort'](_0x4de310[_0x5adb('0x2e')]['sort']);_0x34b793[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4de310['query'],_0x372da1[_0x5adb('0x39')]));if(_0x4de310[_0x5adb('0x2e')]['filter']){_0x34b793[_0x5adb('0x37')]=_['merge'](_0x34b793[_0x5adb('0x37')],{'$or':_[_0x5adb('0x3a')](_0x450169,function(_0xd5660c){if(_0xd5660c['type'][_0x5adb('0x3b')]!==_0x5adb('0x3c')){var _0xcdaf8e={};_0xcdaf8e[_0xd5660c[_0x5adb('0x3d')]]={'$like':'%'+_0x4de310[_0x5adb('0x2e')]['filter']+'%'};return _0xcdaf8e;}})});}_0x34b793=_['merge']({},_0x34b793,_0x4de310['options']);var _0x599999={'where':_0x34b793[_0x5adb('0x37')]};return db[_0x5adb('0x2a')][_0x5adb('0x1c')](_0x599999)[_0x5adb('0x21')](function(_0x130e18){_0x3b1fed[_0x5adb('0x1c')]=_0x130e18;if(_0x4de310[_0x5adb('0x2e')][_0x5adb('0x3e')]){_0x34b793['include']=[{'all':!![]}];}return db['SquareProject'][_0x5adb('0x3f')](_0x34b793);})['then'](function(_0xa9f72d){_0x3b1fed[_0x5adb('0x40')]=_0xa9f72d;return _0x3b1fed;})[_0x5adb('0x21')](respondWithFilteredResult(_0x11ec2a,_0x34b793))[_0x5adb('0x41')](handleError(_0x11ec2a,null));};exports[_0x5adb('0x42')]=function(_0x522ee5,_0x43d320){var _0x565b03={'raw':![],'where':{'id':_0x522ee5[_0x5adb('0x43')]['id']}},_0x508690={};_0x508690[_0x5adb('0x2c')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x2b')]);_0x508690[_0x5adb('0x2e')]=_[_0x5adb('0x2d')](_0x522ee5[_0x5adb('0x2e')]);_0x508690[_0x5adb('0x39')]=_[_0x5adb('0x2f')](_0x508690['model'],_0x508690['query']);_0x565b03[_0x5adb('0x30')]=_[_0x5adb('0x2f')](_0x508690[_0x5adb('0x2c')],qs[_0x5adb('0x31')](_0x522ee5['query']['fields']));_0x565b03[_0x5adb('0x30')]=_0x565b03[_0x5adb('0x30')][_0x5adb('0x32')]?_0x565b03[_0x5adb('0x30')]:_0x508690[_0x5adb('0x2c')];if(_0x522ee5['query'][_0x5adb('0x3e')]){_0x565b03[_0x5adb('0x44')]=[{'all':!![]}];}_0x565b03=_['merge']({},_0x565b03,_0x522ee5[_0x5adb('0x45')]);return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x565b03)[_0x5adb('0x21')](handleEntityNotFound(_0x43d320,null))[_0x5adb('0x21')](respondWithResult(_0x43d320,null))[_0x5adb('0x41')](handleError(_0x43d320,null));};exports[_0x5adb('0x47')]=function(_0x54252,_0x49e1a1){return db[_0x5adb('0x2a')]['create'](_0x54252['body'],{})['then'](function(_0x3cd211){var _0x3fbac8=_0x54252[_0x5adb('0x48')]['get']({'plain':!![]});if(!_0x3fbac8)throw new Error(_0x5adb('0x49'));if(_0x3fbac8['role']===_0x5adb('0x48')){var _0x2c3f21=_0x3cd211[_0x5adb('0x23')]({'plain':!![]});var _0x541537=_0x5adb('0x24');return db['UserProfileSection'][_0x5adb('0x46')]({'where':{'name':_0x541537,'userProfileId':_0x3fbac8[_0x5adb('0x4a')]},'raw':!![]})['then'](function(_0x2402a3){if(_0x2402a3&&_0x2402a3[_0x5adb('0x4b')]===0x0){return db[_0x5adb('0x25')][_0x5adb('0x47')]({'name':_0x2c3f21[_0x5adb('0x27')],'resourceId':_0x2c3f21['id'],'type':_0x2402a3['name'],'sectionId':_0x2402a3['id']},{})[_0x5adb('0x21')](function(){return _0x3cd211;});}else{return _0x3cd211;}})[_0x5adb('0x41')](function(_0x3bcf6f){logger[_0x5adb('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bcf6f);throw _0x3bcf6f;});}return _0x3cd211;})[_0x5adb('0x21')](respondWithResult(_0x49e1a1,0xc9))[_0x5adb('0x41')](handleError(_0x49e1a1,null));};exports[_0x5adb('0x20')]=function(_0x4d98d0,_0x2b34a8){if(_0x4d98d0[_0x5adb('0x4d')]['id']){delete _0x4d98d0[_0x5adb('0x4d')]['id'];}return db[_0x5adb('0x2a')]['find']({'where':{'id':_0x4d98d0[_0x5adb('0x43')]['id']}})[_0x5adb('0x21')](handleEntityNotFound(_0x2b34a8,null))[_0x5adb('0x21')](saveUpdates(_0x4d98d0[_0x5adb('0x4d')],null))[_0x5adb('0x21')](respondWithResult(_0x2b34a8,null))['catch'](handleError(_0x2b34a8,null));};exports[_0x5adb('0x22')]=function(_0x4b8d28,_0x2b790d){return db['SquareProject'][_0x5adb('0x46')]({'where':{'id':_0x4b8d28[_0x5adb('0x43')]['id']}})[_0x5adb('0x21')](handleEntityNotFound(_0x2b790d,null))[_0x5adb('0x21')](removeEntity(_0x2b790d,null))['catch'](handleError(_0x2b790d,null));};exports[_0x5adb('0x4e')]=function(_0x229ae2,_0x24b1f1,_0x53d262){return db['SquareProject']['find']({'where':{'id':_0x229ae2[_0x5adb('0x43')]['id']}})[_0x5adb('0x21')](handleEntityNotFound(_0x24b1f1,null))[_0x5adb('0x21')](function(_0x12a146){if(_0x12a146){return _0x12a146[_0x5adb('0x4e')](_0x229ae2[_0x5adb('0x4d')][_0x5adb('0x4f')],_[_0x5adb('0x50')](_0x229ae2[_0x5adb('0x4d')],[_0x5adb('0x4f'),'id'])||{});}})[_0x5adb('0x21')](respondWithResult(_0x24b1f1,null))[_0x5adb('0x41')](handleError(_0x24b1f1,null));};exports[_0x5adb('0x51')]=function(_0x511746,_0x49f4c8,_0x3d55c2){var _0x27a8e4;return db[_0x5adb('0x2a')][_0x5adb('0x46')]({'where':{'id':_0x511746['params']['id']}})[_0x5adb('0x21')](handleEntityNotFound(_0x49f4c8,null))[_0x5adb('0x21')](function(_0x5d2d2f){if(_0x5d2d2f){return _0x5d2d2f[_0x5adb('0x51')](_0x511746[_0x5adb('0x2e')][_0x5adb('0x4f')])['then'](function(_0x30d185){if(_[_0x5adb('0x52')](_0x511746[_0x5adb('0x2e')][_0x5adb('0x4f')])){for(var _0x330290=0x0;_0x330290<_0x511746[_0x5adb('0x2e')]['ids'][_0x5adb('0x32')];_0x330290+=0x1){socket[_0x5adb('0x53')](_0x5adb('0x54'),{'UserId':_0x511746['query'][_0x5adb('0x4f')][_0x330290],'SquareProjectId':_0x511746[_0x5adb('0x43')]['id']});}}else{socket[_0x5adb('0x53')]('userSquareProject:remove',{'UserId':_0x511746[_0x5adb('0x2e')]['ids'],'SquareProjectId':_0x511746[_0x5adb('0x43')]['id']});}});}})[_0x5adb('0x21')](respondWithStatusCode(_0x49f4c8,null))[_0x5adb('0x41')](handleError(_0x49f4c8,null));};exports['getUsers']=function(_0x192b1f,_0x3627d1,_0x539814){var _0x12711e={};var _0x432a3e={};var _0x248739;var _0x3fcad5;return db['SquareProject'][_0x5adb('0x55')]({'where':{'id':_0x192b1f[_0x5adb('0x43')]['id']}})[_0x5adb('0x21')](handleEntityNotFound(_0x3627d1,null))[_0x5adb('0x21')](function(_0x5b7556){if(_0x5b7556){_0x248739=_0x5b7556;_0x432a3e['model']=_[_0x5adb('0x2d')](db['User']['rawAttributes']);_0x432a3e['query']=_[_0x5adb('0x2d')](_0x192b1f[_0x5adb('0x2e')]);_0x432a3e['filters']=_[_0x5adb('0x2f')](_0x432a3e[_0x5adb('0x2c')],_0x432a3e[_0x5adb('0x2e')]);_0x12711e[_0x5adb('0x30')]=_[_0x5adb('0x2f')](_0x432a3e[_0x5adb('0x2c')],qs[_0x5adb('0x31')](_0x192b1f[_0x5adb('0x2e')]['fields']));_0x12711e['attributes']=_0x12711e['attributes'][_0x5adb('0x32')]?_0x12711e[_0x5adb('0x30')]:_0x432a3e[_0x5adb('0x2c')];_0x12711e[_0x5adb('0x36')]=qs[_0x5adb('0x56')](_0x192b1f[_0x5adb('0x2e')][_0x5adb('0x56')]);_0x12711e[_0x5adb('0x37')]=qs['filters'](_['pick'](_0x192b1f[_0x5adb('0x2e')],_0x432a3e[_0x5adb('0x39')]));if(_0x192b1f[_0x5adb('0x2e')][_0x5adb('0x57')]){_0x12711e[_0x5adb('0x37')]=_[_0x5adb('0x58')](_0x12711e[_0x5adb('0x37')],{'$or':_[_0x5adb('0x3a')](_0x12711e[_0x5adb('0x30')],function(_0x3b5ecf){var _0x484f3d={};_0x484f3d[_0x3b5ecf]={'$like':'%'+_0x192b1f[_0x5adb('0x2e')][_0x5adb('0x57')]+'%'};return _0x484f3d;})});}_0x12711e=_[_0x5adb('0x58')]({},_0x12711e,_0x192b1f['options']);return _0x248739[_0x5adb('0x59')](_0x12711e);}})[_0x5adb('0x21')](function(_0x4f7bd0){if(_0x4f7bd0){_0x3fcad5=_0x4f7bd0[_0x5adb('0x32')];if(!_0x192b1f['query'][_0x5adb('0x33')](_0x5adb('0x34'))){_0x12711e['limit']=qs[_0x5adb('0x35')](_0x192b1f[_0x5adb('0x2e')][_0x5adb('0x35')]);_0x12711e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x192b1f[_0x5adb('0x2e')][_0x5adb('0x1d')]);}return _0x248739[_0x5adb('0x59')](_0x12711e);}})['then'](function(_0x3786b4){if(_0x3786b4){return _0x3786b4?{'count':_0x3fcad5,'rows':_0x3786b4}:null;}})[_0x5adb('0x21')](respondWithResult(_0x3627d1,null))[_0x5adb('0x41')](handleError(_0x3627d1,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 27fb16d..6d44cf9 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 _0xc1d8=['update','emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0xb7176c,_0x22f5cc){var _0x8f93f6=function(_0x3d1d27){while(--_0x3d1d27){_0xb7176c['push'](_0xb7176c['shift']());}};_0x8f93f6(++_0x22f5cc);}(_0xc1d8,0xec));var _0x8c1d=function(_0x1e88ed,_0x242371){_0x1e88ed=_0x1e88ed-0x0;var _0x308183=_0xc1d8[_0x1e88ed];return _0x308183;};'use strict';var EventEmitter=require(_0x8c1d('0x0'));var SquareProject=require(_0x8c1d('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8c1d('0x2')](0x0);var events={'afterCreate':_0x8c1d('0x3'),'afterUpdate':_0x8c1d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x58e86f){return function(_0x1b72ef,_0x1e049b,_0x41e5e0){SquareProjectEvents[_0x8c1d('0x5')](_0x58e86f+':'+_0x1b72ef['id'],_0x1b72ef);SquareProjectEvents[_0x8c1d('0x5')](_0x58e86f,_0x1b72ef);_0x41e5e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x8c1d('0x6')](e,emitEvent(event));}}module[_0x8c1d('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x662a=['exports','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x48d8b5,_0x30639c){var _0x98f767=function(_0x596a32){while(--_0x596a32){_0x48d8b5['push'](_0x48d8b5['shift']());}};_0x98f767(++_0x30639c);}(_0x662a,0x1cf));var _0xa662=function(_0x10fcde,_0x4d806e){_0x10fcde=_0x10fcde-0x0;var _0x14eb61=_0x662a[_0x10fcde];return _0x14eb61;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa662('0x0'),'afterUpdate':_0xa662('0x1'),'afterDestroy':_0xa662('0x2')};function emitEvent(_0x33506d){return function(_0x1a0bc3,_0x1606cc,_0x46bc6b){SquareProjectEvents[_0xa662('0x3')](_0x33506d+':'+_0x1a0bc3['id'],_0x1a0bc3);SquareProjectEvents[_0xa662('0x3')](_0x33506d,_0x1a0bc3);_0x46bc6b(null);};}for(var e in events){if(events[_0xa662('0x4')](e)){var event=events[e];SquareProject[_0xa662('0x5')](e,emitEvent(event));}}module[_0xa662('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 03c1d18..88a8e1a 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 _0xca4e=['request-promise','./squareProject.attributes','exports','define','SquareProject','square_projects','lodash','api','moment','bluebird'];(function(_0x38b3b5,_0x43bb9f){var _0x5d49b4=function(_0x54f9cc){while(--_0x54f9cc){_0x38b3b5['push'](_0x38b3b5['shift']());}};_0x5d49b4(++_0x43bb9f);}(_0xca4e,0x1be));var _0xeca4=function(_0x14f5e8,_0xb4d61a){_0x14f5e8=_0x14f5e8-0x0;var _0x5d4b1b=_0xca4e[_0x14f5e8];return _0x5d4b1b;};'use strict';var _=require(_0xeca4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeca4('0x1'));var moment=require(_0xeca4('0x2'));var BPromise=require(_0xeca4('0x3'));var rp=require(_0xeca4('0x4'));var attributes=require(_0xeca4('0x5'));module[_0xeca4('0x6')]=function(_0x4a75a9,_0x4017f6){return _0x4a75a9[_0xeca4('0x7')](_0xeca4('0x8'),attributes,{'tableName':_0xeca4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb74=['exports','lodash','../../config/logger','moment','bluebird','request-promise','./squareProject.attributes'];(function(_0x1c6089,_0x3816e2){var _0x4d97c1=function(_0x3e631b){while(--_0x3e631b){_0x1c6089['push'](_0x1c6089['shift']());}};_0x4d97c1(++_0x3816e2);}(_0xeb74,0x1dd));var _0x4eb7=function(_0x2812fe,_0x29235f){_0x2812fe=_0x2812fe-0x0;var _0x19200f=_0xeb74[_0x2812fe];return _0x19200f;};'use strict';var _=require(_0x4eb7('0x0'));var util=require('util');var logger=require(_0x4eb7('0x1'))('api');var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var attributes=require(_0x4eb7('0x5'));module[_0x4eb7('0x6')]=function(_0x34ffb0,_0x4d932f){return _0x34ffb0['define']('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 824f722..a601100 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(_0x4ad394,_0x21e512){var _0xa38357=function(_0x16759f){while(--_0x16759f){_0x4ad394['push'](_0x4ad394['shift']());}};_0xa38357(++_0x21e512);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x1861d4,_0x295ec8){var _0x4df574=function(_0x3838bf){while(--_0x3838bf){_0x1861d4['push'](_0x1861d4['shift']());}};_0x4df574(++_0x295ec8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 0232041..4ff09b3 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 _0xe0b2=['update','emit','removeListener','register','squareProject:','save','remove'];(function(_0x7f8b61,_0x4fa837){var _0x16e761=function(_0x1872ee){while(--_0x1872ee){_0x7f8b61['push'](_0x7f8b61['shift']());}};_0x16e761(++_0x4fa837);}(_0xe0b2,0xec));var _0x2e0b=function(_0x2b56b5,_0x19c7e3){_0x2b56b5=_0x2b56b5-0x0;var _0x5d5118=_0xe0b2[_0x2b56b5];return _0x5d5118;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x2e0b('0x0'),_0x2e0b('0x1'),_0x2e0b('0x2')];function createListener(_0x1480b,_0x406b1c){return function(_0x187b65){_0x406b1c[_0x2e0b('0x3')](_0x1480b,_0x187b65);};}function removeListener(_0x56b694,_0x44e35e){return function(){SquareProjectEvents[_0x2e0b('0x4')](_0x56b694,_0x44e35e);};}exports[_0x2e0b('0x5')]=function(_0x2a3a82){for(var _0x1b8455=0x0,_0x264319=events['length'];_0x1b8455<_0x264319;_0x1b8455++){var _0x2e1e40=events[_0x1b8455];var _0x504ea6=createListener(_0x2e0b('0x6')+_0x2e1e40,_0x2a3a82);SquareProjectEvents['on'](_0x2e1e40,_0x504ea6);}}; \ No newline at end of file +var _0xf822=['update','emit','removeListener','register','length','squareProject:','./squareProject.events','remove'];(function(_0x131c67,_0x2b64db){var _0x370571=function(_0x4b6ab5){while(--_0x4b6ab5){_0x131c67['push'](_0x131c67['shift']());}};_0x370571(++_0x2b64db);}(_0xf822,0x19e));var _0x2f82=function(_0x2adef5,_0x651f53){_0x2adef5=_0x2adef5-0x0;var _0x2d667f=_0xf822[_0x2adef5];return _0x2d667f;};'use strict';var SquareProjectEvents=require(_0x2f82('0x0'));var events=['save',_0x2f82('0x1'),_0x2f82('0x2')];function createListener(_0x45ab5e,_0x1f9d70){return function(_0xfff58){_0x1f9d70[_0x2f82('0x3')](_0x45ab5e,_0xfff58);};}function removeListener(_0x48a05c,_0x12e2d7){return function(){SquareProjectEvents[_0x2f82('0x4')](_0x48a05c,_0x12e2d7);};}exports[_0x2f82('0x5')]=function(_0x5b73e5){for(var _0x360c8f=0x0,_0x50ec5d=events[_0x2f82('0x6')];_0x360c8f<_0x50ec5d;_0x360c8f++){var _0x236d70=events[_0x360c8f];var _0x24b313=createListener(_0x2f82('0x7')+_0x236d70,_0x5b73e5);SquareProjectEvents['on'](_0x236d70,_0x24b313);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 34247a7..34419f1 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 _0x1823=['/:id/download','download','post','put','update','destroy','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated'];(function(_0x2a4b12,_0x382a28){var _0x4a7290=function(_0x557fd9){while(--_0x557fd9){_0x2a4b12['push'](_0x2a4b12['shift']());}};_0x4a7290(++_0x382a28);}(_0x1823,0xe6));var _0x3182=function(_0x406cdb,_0xbb5ecb){_0x406cdb=_0x406cdb-0x0;var _0x3965a0=_0x1823[_0x406cdb];return _0x3965a0;};'use strict';var multer=require(_0x3182('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3182('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x3182('0x2'));var interaction=require(_0x3182('0x3'));var config=require(_0x3182('0x4'));var controller=require(_0x3182('0x5'));router[_0x3182('0x6')]('/',auth['isAuthenticated'](),controller[_0x3182('0x7')]);router[_0x3182('0x6')](_0x3182('0x8'),auth[_0x3182('0x9')](),controller['show']);router[_0x3182('0x6')](_0x3182('0xa'),auth[_0x3182('0x9')](),controller[_0x3182('0xb')]);router[_0x3182('0xc')]('/',auth[_0x3182('0x9')](),controller['create']);router[_0x3182('0xd')](_0x3182('0x8'),auth[_0x3182('0x9')](),controller[_0x3182('0xe')]);router['delete']('/:id',auth[_0x3182('0x9')](),controller[_0x3182('0xf')]);module['exports']=router; \ No newline at end of file +var _0x4172=['/:id/download','download','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id'];(function(_0x4c6647,_0x58ec36){var _0xb9d959=function(_0x392954){while(--_0x392954){_0x4c6647['push'](_0x4c6647['shift']());}};_0xb9d959(++_0x58ec36);}(_0x4172,0x1aa));var _0x2417=function(_0x315e40,_0x4c01ca){_0x315e40=_0x315e40-0x0;var _0x10ca43=_0x4172[_0x315e40];return _0x10ca43;};'use strict';var multer=require(_0x2417('0x0'));var util=require('util');var path=require(_0x2417('0x1'));var timeout=require(_0x2417('0x2'));var express=require(_0x2417('0x3'));var router=express[_0x2417('0x4')]();var auth=require(_0x2417('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2417('0x6'));router[_0x2417('0x7')]('/',auth[_0x2417('0x8')](),controller[_0x2417('0x9')]);router[_0x2417('0x7')](_0x2417('0xa'),auth[_0x2417('0x8')](),controller['show']);router[_0x2417('0x7')](_0x2417('0xb'),auth['isAuthenticated'](),controller[_0x2417('0xc')]);router[_0x2417('0xd')]('/',auth[_0x2417('0x8')](),controller['create']);router[_0x2417('0xe')](_0x2417('0xa'),auth[_0x2417('0x8')](),controller[_0x2417('0xf')]);router[_0x2417('0x10')]('/:id',auth[_0x2417('0x8')](),controller[_0x2417('0x11')]);module[_0x2417('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index f0679e2..3b5c105 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 _0x8e04=['STRING','sequelize'];(function(_0x3e56f6,_0xa7a02d){var _0x3a32f=function(_0xb83e52){while(--_0xb83e52){_0x3e56f6['push'](_0x3e56f6['shift']());}};_0x3a32f(++_0xa7a02d);}(_0x8e04,0x183));var _0x48e0=function(_0x162f4b,_0x31b569){_0x162f4b=_0x162f4b-0x0;var _0x57b00b=_0x8e04[_0x162f4b];return _0x57b00b;};'use strict';var Sequelize=require(_0x48e0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x48e0('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x48e0('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x48e0('0x1')]},'dnid':{'type':Sequelize[_0x48e0('0x1')]},'projectName':{'type':Sequelize[_0x48e0('0x1')]},'saveName':{'type':Sequelize[_0x48e0('0x1')]},'filename':{'type':Sequelize[_0x48e0('0x1')]},'savePath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x78d7=['STRING','sequelize','exports'];(function(_0xca70ef,_0x29f15d){var _0x3da0e4=function(_0x525de5){while(--_0x525de5){_0xca70ef['push'](_0xca70ef['shift']());}};_0x3da0e4(++_0x29f15d);}(_0x78d7,0x115));var _0x778d=function(_0x5ef4ba,_0x4a50cb){_0x5ef4ba=_0x5ef4ba-0x0;var _0x44e9ac=_0x78d7[_0x5ef4ba];return _0x44e9ac;};'use strict';var Sequelize=require(_0x778d('0x0'));module[_0x778d('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x778d('0x2')]},'calleridname':{'type':Sequelize[_0x778d('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x778d('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x778d('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x778d('0x2')]},'saveName':{'type':Sequelize[_0x778d('0x2')]},'filename':{'type':Sequelize[_0x778d('0x2')]},'savePath':{'type':Sequelize[_0x778d('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index c67103e..417c3b7 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 _0x424e=['extname','unlink','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','reject','save','destroy','stack','name','send','index','SquareRecording','keys','query','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','then','includeAll','include','rows','catch','params','rawAttributes','create','body','update','find','../../components/encryptor','type','uniqueid','savePath','filename','format','%s.cypher','value','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found'];(function(_0x4d12ec,_0x56440a){var _0x36df54=function(_0x2ef4a6){while(--_0x2ef4a6){_0x4d12ec['push'](_0x4d12ec['shift']());}};_0x36df54(++_0x56440a);}(_0x424e,0xa9));var _0xe424=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x424e[_0x4b73a2];return _0x383c66;};'use strict';var pdf=require(_0xe424('0x0'));var emlformat=require(_0xe424('0x1'));var rimraf=require(_0xe424('0x2'));var zipdir=require(_0xe424('0x3'));var jsonpatch=require(_0xe424('0x4'));var rp=require(_0xe424('0x5'));var moment=require(_0xe424('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xe424('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe424('0x8'));var csv=require(_0xe424('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe424('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe424('0xb'));var deskjs=require(_0xe424('0xc'));var toCsv=require(_0xe424('0x9'));var querystring=require(_0xe424('0xd'));var Papa=require(_0xe424('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xe424('0xf'));var Redis=require(_0xe424('0x10'));var qs=require(_0xe424('0x11'));var logger=require(_0xe424('0x12'))(_0xe424('0x13'));var utils=require(_0xe424('0x14'));var config=require('../../config/environment');var db=require(_0xe424('0x15'))['db'];function respondWithStatusCode(_0x50fc49,_0xbe2244){_0xbe2244=_0xbe2244||0xcc;return function(_0x4360ed){if(_0x4360ed){return _0x50fc49[_0xe424('0x16')](_0xbe2244);}return _0x50fc49[_0xe424('0x17')](_0xbe2244)[_0xe424('0x18')]();};}function respondWithResult(_0x3946ee,_0x46685f){_0x46685f=_0x46685f||0xc8;return function(_0x27eb5c){if(_0x27eb5c){return _0x3946ee[_0xe424('0x17')](_0x46685f)[_0xe424('0x19')](_0x27eb5c);}};}function respondWithFilteredResult(_0x4f6f2f,_0x517ce9){return function(_0x131ce2){if(_0x131ce2){var _0x39da68=_0x131ce2[_0xe424('0x1a')],_0x4b66ed=_0x517ce9['offset'],_0x34c2e1=_0x517ce9[_0xe424('0x1b')]+_0x517ce9[_0xe424('0x1c')],_0x44a7da;if(_0x34c2e1>=_0x39da68){_0x34c2e1=_0x39da68;_0x44a7da=0xc8;}else{_0x44a7da=0xce;}_0x4f6f2f[_0xe424('0x17')](_0x44a7da);return _0x4f6f2f['set']('Content-Range',_0x4b66ed+'-'+_0x34c2e1+'/'+_0x39da68)[_0xe424('0x19')](_0x131ce2);}return null;};}function patchUpdates(_0x53121d){return function(_0x5456ae){try{jsonpatch['apply'](_0x5456ae,_0x53121d,!![]);}catch(_0xb25aad){return BPromise[_0xe424('0x1d')](_0xb25aad);}return _0x5456ae[_0xe424('0x1e')]();};}function saveUpdates(_0xf81344,_0x2ad2dc){return function(_0x2e5eae){if(_0x2e5eae){return _0x2e5eae['update'](_0xf81344)['then'](function(_0x1726c0){return _0x1726c0;});}return null;};}function removeEntity(_0x10ec9e,_0x8aae4){return function(_0x387f47){if(_0x387f47){return _0x387f47[_0xe424('0x1f')]()['then'](function(){_0x10ec9e[_0xe424('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29c749,_0xd8d5e9){return function(_0x2eb72f){if(!_0x2eb72f){_0x29c749[_0xe424('0x16')](0x194);}return _0x2eb72f;};}function handleError(_0x5a348d,_0x3cccfe){_0x3cccfe=_0x3cccfe||0x1f4;return function(_0x50369a){logger['error'](_0x50369a[_0xe424('0x20')]);if(_0x50369a[_0xe424('0x21')]){delete _0x50369a[_0xe424('0x21')];}_0x5a348d['status'](_0x3cccfe)[_0xe424('0x22')](_0x50369a);};}exports[_0xe424('0x23')]=function(_0x24ccdf,_0x56c5f2){var _0x4c0f21={},_0x467e04={},_0x51f149={'count':0x0,'rows':[]};var _0x364036=db[_0xe424('0x24')]['rawAttributes'];_0x467e04['model']=_[_0xe424('0x25')](_0x364036);_0x467e04[_0xe424('0x26')]=_['keys'](_0x24ccdf[_0xe424('0x26')]);_0x467e04[_0xe424('0x27')]=_[_0xe424('0x28')](_0x467e04['model'],_0x467e04[_0xe424('0x26')]);_0x4c0f21[_0xe424('0x29')]=_[_0xe424('0x28')](_0x467e04['model'],qs[_0xe424('0x2a')](_0x24ccdf['query'][_0xe424('0x2a')]));_0x4c0f21['attributes']=_0x4c0f21['attributes'][_0xe424('0x2b')]?_0x4c0f21[_0xe424('0x29')]:_0x467e04[_0xe424('0x2c')];if(!_0x24ccdf[_0xe424('0x26')]['hasOwnProperty'](_0xe424('0x2d'))){_0x4c0f21[_0xe424('0x1c')]=qs['limit'](_0x24ccdf[_0xe424('0x26')][_0xe424('0x1c')]);_0x4c0f21[_0xe424('0x1b')]=qs[_0xe424('0x1b')](_0x24ccdf[_0xe424('0x26')][_0xe424('0x1b')]);}_0x4c0f21[_0xe424('0x2e')]=qs['sort'](_0x24ccdf['query'][_0xe424('0x2f')]);_0x4c0f21[_0xe424('0x30')]=qs[_0xe424('0x27')](_[_0xe424('0x31')](_0x24ccdf[_0xe424('0x26')],_0x467e04[_0xe424('0x27')]));if(_0x24ccdf[_0xe424('0x26')][_0xe424('0x32')]){_0x4c0f21[_0xe424('0x30')]=_['merge'](_0x4c0f21[_0xe424('0x30')],{'$or':_[_0xe424('0x33')](_0x364036,function(_0x3762a1){if(_0x3762a1['type']['key']!==_0xe424('0x34')){var _0x566184={};_0x566184[_0x3762a1['field']]={'$like':'%'+_0x24ccdf[_0xe424('0x26')][_0xe424('0x32')]+'%'};return _0x566184;}})});}_0x4c0f21=_[_0xe424('0x35')]({},_0x4c0f21,_0x24ccdf[_0xe424('0x36')]);var _0x82a1ae={'where':_0x4c0f21[_0xe424('0x30')]};return db[_0xe424('0x24')][_0xe424('0x1a')](_0x82a1ae)[_0xe424('0x37')](function(_0x42f292){_0x51f149[_0xe424('0x1a')]=_0x42f292;if(_0x24ccdf[_0xe424('0x26')][_0xe424('0x38')]){_0x4c0f21[_0xe424('0x39')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x4c0f21);})[_0xe424('0x37')](function(_0x218211){_0x51f149[_0xe424('0x3a')]=_0x218211;return _0x51f149;})[_0xe424('0x37')](respondWithFilteredResult(_0x56c5f2,_0x4c0f21))[_0xe424('0x3b')](handleError(_0x56c5f2,null));};exports['show']=function(_0x2e2313,_0x3f28bb){var _0x3bb90e={'raw':!![],'where':{'id':_0x2e2313[_0xe424('0x3c')]['id']}},_0x35e8a2={};_0x35e8a2[_0xe424('0x2c')]=_['keys'](db[_0xe424('0x24')][_0xe424('0x3d')]);_0x35e8a2[_0xe424('0x26')]=_[_0xe424('0x25')](_0x2e2313[_0xe424('0x26')]);_0x35e8a2[_0xe424('0x27')]=_[_0xe424('0x28')](_0x35e8a2[_0xe424('0x2c')],_0x35e8a2[_0xe424('0x26')]);_0x3bb90e['attributes']=_[_0xe424('0x28')](_0x35e8a2[_0xe424('0x2c')],qs[_0xe424('0x2a')](_0x2e2313['query'][_0xe424('0x2a')]));_0x3bb90e[_0xe424('0x29')]=_0x3bb90e[_0xe424('0x29')][_0xe424('0x2b')]?_0x3bb90e[_0xe424('0x29')]:_0x35e8a2['model'];if(_0x2e2313[_0xe424('0x26')]['includeAll']){_0x3bb90e[_0xe424('0x39')]=[{'all':!![]}];}_0x3bb90e=_[_0xe424('0x35')]({},_0x3bb90e,_0x2e2313[_0xe424('0x36')]);return db[_0xe424('0x24')]['find'](_0x3bb90e)[_0xe424('0x37')](handleEntityNotFound(_0x3f28bb,null))[_0xe424('0x37')](respondWithResult(_0x3f28bb,null))[_0xe424('0x3b')](handleError(_0x3f28bb,null));};exports[_0xe424('0x3e')]=function(_0x573bc7,_0x501883){return db['SquareRecording'][_0xe424('0x3e')](_0x573bc7[_0xe424('0x3f')],{})[_0xe424('0x37')](respondWithResult(_0x501883,0xc9))[_0xe424('0x3b')](handleError(_0x501883,null));};exports[_0xe424('0x40')]=function(_0x21133c,_0x35b9ca){if(_0x21133c['body']['id']){delete _0x21133c[_0xe424('0x3f')]['id'];}return db['SquareRecording'][_0xe424('0x41')]({'where':{'id':_0x21133c[_0xe424('0x3c')]['id']}})[_0xe424('0x37')](handleEntityNotFound(_0x35b9ca,null))[_0xe424('0x37')](saveUpdates(_0x21133c[_0xe424('0x3f')],null))[_0xe424('0x37')](respondWithResult(_0x35b9ca,null))['catch'](handleError(_0x35b9ca,null));};exports[_0xe424('0x1f')]=function(_0x448961,_0x30f866){return db['SquareRecording'][_0xe424('0x41')]({'where':{'id':_0x448961[_0xe424('0x3c')]['id']}})['then'](handleEntityNotFound(_0x30f866,null))['then'](removeEntity(_0x30f866,null))['catch'](handleError(_0x30f866,null));};exports['download']=function(_0x58a4fc,_0x52d56f,_0x47f8af){var _0x22c985=require(_0xe424('0x42'));var _0x5a46f5=![];var _0x5c0fb6={};if(_0x58a4fc[_0xe424('0x26')][_0xe424('0x43')]&&_0x58a4fc[_0xe424('0x26')]['type']===_0xe424('0x44')){_0x5c0fb6[_0xe424('0x44')]=_0x58a4fc[_0xe424('0x3c')]['id'];}else{_0x5c0fb6['id']=_0x58a4fc[_0xe424('0x3c')]['id'];}return db[_0xe424('0x24')][_0xe424('0x41')]({'where':_0x5c0fb6,'attributes':['id',_0xe424('0x45'),_0xe424('0x46')],'raw':!![]})[_0xe424('0x37')](handleEntityNotFound(_0x52d56f,null))[_0xe424('0x37')](function(_0x259075){if(_0x259075){var _0x3c5d47=util[_0xe424('0x47')](_0xe424('0x48'),_0x259075[_0xe424('0x49')]);if(fs[_0xe424('0x4a')](_0x3c5d47)){_0x5a46f5=!![];return _0x22c985[_0xe424('0x4b')](_0x3c5d47,_0x259075['savePath'],config[_0xe424('0x4c')][_0xe424('0x4d')])[_0xe424('0x37')](function(){return _0x259075;});}return _0x259075;}})[_0xe424('0x37')](function(_0x5014ec){if(_0x5014ec){if(!fs[_0xe424('0x4a')](_0x5014ec[_0xe424('0x45')])){throw new db['Sequelize'][(_0xe424('0x4e'))](_0xe424('0x4f'));}if(_0x5014ec[_0xe424('0x46')]){return _0x52d56f['download'](_0x5014ec['savePath'],_0x5014ec['filename']+path[_0xe424('0x50')](_0x5014ec[_0xe424('0x45')]),function(){if(_0x5a46f5){fs[_0xe424('0x51')](_0x5014ec[_0xe424('0x45')]);}});}else{return _0x52d56f[_0xe424('0x52')](_0x5014ec[_0xe424('0x45')],function(_0x282896){if(_0x5a46f5){fs['unlink'](_0x5014ec['savePath']);}});}}})[_0xe424('0x3b')](handleError(_0x52d56f,null));}; \ No newline at end of file +var _0xc7f5=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','SquareRecording','rawAttributes','keys','query','filters','intersection','attributes','model','fields','order','sort','where','pick','filter','type','key','VIRTUAL','field','options','includeAll','include','findAll','then','catch','length','merge','find','create','body','params','download','uniqueid','filename','format','%s.cypher','existsSync','decryptFile','savePath','secrets','recording','Sequelize','SquareRecording\x20not\x20found','unlink','html-pdf','eml-format','fast-json-patch','moment','util','path','to-csv','ejs'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc7f5,0x1de));var _0x5c7f=function(_0x4cec25,_0x530694){_0x4cec25=_0x4cec25-0x0;var _0x331ad2=_0xc7f5[_0x4cec25];return _0x331ad2;};'use strict';var pdf=require(_0x5c7f('0x0'));var emlformat=require(_0x5c7f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5c7f('0x2'));var rp=require('request-promise');var moment=require(_0x5c7f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5c7f('0x4'));var path=require(_0x5c7f('0x5'));var sox=require('sox');var csv=require(_0x5c7f('0x6'));var ejs=require(_0x5c7f('0x7'));var fs=require('fs');var _=require(_0x5c7f('0x8'));var squel=require(_0x5c7f('0x9'));var crypto=require(_0x5c7f('0xa'));var jsforce=require(_0x5c7f('0xb'));var deskjs=require(_0x5c7f('0xc'));var toCsv=require(_0x5c7f('0x6'));var querystring=require(_0x5c7f('0xd'));var Papa=require(_0x5c7f('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0x5c7f('0xf'));var Redis=require('ioredis');var qs=require(_0x5c7f('0x10'));var logger=require('../../config/logger')(_0x5c7f('0x11'));var utils=require('../../config/utils');var config=require(_0x5c7f('0x12'));var db=require(_0x5c7f('0x13'))['db'];function respondWithStatusCode(_0x709656,_0x5b2231){_0x5b2231=_0x5b2231||0xcc;return function(_0x5a87d4){if(_0x5a87d4){return _0x709656['sendStatus'](_0x5b2231);}return _0x709656[_0x5c7f('0x14')](_0x5b2231)[_0x5c7f('0x15')]();};}function respondWithResult(_0x2d1d89,_0x17ff21){_0x17ff21=_0x17ff21||0xc8;return function(_0x5a285a){if(_0x5a285a){return _0x2d1d89[_0x5c7f('0x14')](_0x17ff21)[_0x5c7f('0x16')](_0x5a285a);}};}function respondWithFilteredResult(_0x14c653,_0x38f0dd){return function(_0x4c0b69){if(_0x4c0b69){var _0x5d2b21=_0x4c0b69[_0x5c7f('0x17')],_0x565bf5=_0x38f0dd['offset'],_0x2a8c48=_0x38f0dd[_0x5c7f('0x18')]+_0x38f0dd[_0x5c7f('0x19')],_0x3302c5;if(_0x2a8c48>=_0x5d2b21){_0x2a8c48=_0x5d2b21;_0x3302c5=0xc8;}else{_0x3302c5=0xce;}_0x14c653[_0x5c7f('0x14')](_0x3302c5);return _0x14c653[_0x5c7f('0x1a')](_0x5c7f('0x1b'),_0x565bf5+'-'+_0x2a8c48+'/'+_0x5d2b21)['json'](_0x4c0b69);}return null;};}function patchUpdates(_0x342014){return function(_0x21a6c8){try{jsonpatch[_0x5c7f('0x1c')](_0x21a6c8,_0x342014,!![]);}catch(_0x317f61){return BPromise[_0x5c7f('0x1d')](_0x317f61);}return _0x21a6c8[_0x5c7f('0x1e')]();};}function saveUpdates(_0x51aa5d,_0x7c777){return function(_0x379ebd){if(_0x379ebd){return _0x379ebd[_0x5c7f('0x1f')](_0x51aa5d)['then'](function(_0x5ec74d){return _0x5ec74d;});}return null;};}function removeEntity(_0x5cbd65,_0x133d35){return function(_0x5e96c5){if(_0x5e96c5){return _0x5e96c5[_0x5c7f('0x20')]()['then'](function(){_0x5cbd65[_0x5c7f('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf7ff18,_0x49bb1c){return function(_0x26c35c){if(!_0x26c35c){_0xf7ff18['sendStatus'](0x194);}return _0x26c35c;};}function handleError(_0x5d8e4b,_0x138d61){_0x138d61=_0x138d61||0x1f4;return function(_0x11109a){logger[_0x5c7f('0x21')](_0x11109a[_0x5c7f('0x22')]);if(_0x11109a[_0x5c7f('0x23')]){delete _0x11109a[_0x5c7f('0x23')];}_0x5d8e4b[_0x5c7f('0x14')](_0x138d61)[_0x5c7f('0x24')](_0x11109a);};}exports[_0x5c7f('0x25')]=function(_0x544b78,_0x14022a){var _0x4c260f={},_0x535861={},_0x4e36eb={'count':0x0,'rows':[]};var _0x3d9169=db[_0x5c7f('0x26')][_0x5c7f('0x27')];_0x535861['model']=_[_0x5c7f('0x28')](_0x3d9169);_0x535861[_0x5c7f('0x29')]=_[_0x5c7f('0x28')](_0x544b78[_0x5c7f('0x29')]);_0x535861[_0x5c7f('0x2a')]=_[_0x5c7f('0x2b')](_0x535861['model'],_0x535861[_0x5c7f('0x29')]);_0x4c260f[_0x5c7f('0x2c')]=_['intersection'](_0x535861[_0x5c7f('0x2d')],qs[_0x5c7f('0x2e')](_0x544b78[_0x5c7f('0x29')][_0x5c7f('0x2e')]));_0x4c260f[_0x5c7f('0x2c')]=_0x4c260f['attributes']['length']?_0x4c260f[_0x5c7f('0x2c')]:_0x535861[_0x5c7f('0x2d')];if(!_0x544b78['query']['hasOwnProperty']('nolimit')){_0x4c260f[_0x5c7f('0x19')]=qs[_0x5c7f('0x19')](_0x544b78[_0x5c7f('0x29')]['limit']);_0x4c260f['offset']=qs[_0x5c7f('0x18')](_0x544b78['query'][_0x5c7f('0x18')]);}_0x4c260f[_0x5c7f('0x2f')]=qs[_0x5c7f('0x30')](_0x544b78[_0x5c7f('0x29')][_0x5c7f('0x30')]);_0x4c260f[_0x5c7f('0x31')]=qs['filters'](_[_0x5c7f('0x32')](_0x544b78[_0x5c7f('0x29')],_0x535861['filters']));if(_0x544b78['query'][_0x5c7f('0x33')]){_0x4c260f[_0x5c7f('0x31')]=_['merge'](_0x4c260f[_0x5c7f('0x31')],{'$or':_['map'](_0x3d9169,function(_0x19a719){if(_0x19a719[_0x5c7f('0x34')][_0x5c7f('0x35')]!==_0x5c7f('0x36')){var _0x2324c6={};_0x2324c6[_0x19a719[_0x5c7f('0x37')]]={'$like':'%'+_0x544b78[_0x5c7f('0x29')]['filter']+'%'};return _0x2324c6;}})});}_0x4c260f=_['merge']({},_0x4c260f,_0x544b78[_0x5c7f('0x38')]);var _0x4b935d={'where':_0x4c260f[_0x5c7f('0x31')]};return db['SquareRecording'][_0x5c7f('0x17')](_0x4b935d)['then'](function(_0x334b76){_0x4e36eb[_0x5c7f('0x17')]=_0x334b76;if(_0x544b78[_0x5c7f('0x29')][_0x5c7f('0x39')]){_0x4c260f[_0x5c7f('0x3a')]=[{'all':!![]}];}return db[_0x5c7f('0x26')][_0x5c7f('0x3b')](_0x4c260f);})[_0x5c7f('0x3c')](function(_0x4edaec){_0x4e36eb['rows']=_0x4edaec;return _0x4e36eb;})[_0x5c7f('0x3c')](respondWithFilteredResult(_0x14022a,_0x4c260f))[_0x5c7f('0x3d')](handleError(_0x14022a,null));};exports['show']=function(_0x1dc047,_0xea60bd){var _0xf18bd5={'raw':!![],'where':{'id':_0x1dc047['params']['id']}},_0x3d50ef={};_0x3d50ef[_0x5c7f('0x2d')]=_[_0x5c7f('0x28')](db[_0x5c7f('0x26')]['rawAttributes']);_0x3d50ef['query']=_['keys'](_0x1dc047[_0x5c7f('0x29')]);_0x3d50ef[_0x5c7f('0x2a')]=_[_0x5c7f('0x2b')](_0x3d50ef[_0x5c7f('0x2d')],_0x3d50ef[_0x5c7f('0x29')]);_0xf18bd5[_0x5c7f('0x2c')]=_[_0x5c7f('0x2b')](_0x3d50ef[_0x5c7f('0x2d')],qs[_0x5c7f('0x2e')](_0x1dc047[_0x5c7f('0x29')][_0x5c7f('0x2e')]));_0xf18bd5['attributes']=_0xf18bd5[_0x5c7f('0x2c')][_0x5c7f('0x3e')]?_0xf18bd5[_0x5c7f('0x2c')]:_0x3d50ef['model'];if(_0x1dc047[_0x5c7f('0x29')][_0x5c7f('0x39')]){_0xf18bd5['include']=[{'all':!![]}];}_0xf18bd5=_[_0x5c7f('0x3f')]({},_0xf18bd5,_0x1dc047[_0x5c7f('0x38')]);return db[_0x5c7f('0x26')][_0x5c7f('0x40')](_0xf18bd5)[_0x5c7f('0x3c')](handleEntityNotFound(_0xea60bd,null))[_0x5c7f('0x3c')](respondWithResult(_0xea60bd,null))['catch'](handleError(_0xea60bd,null));};exports[_0x5c7f('0x41')]=function(_0xd9594a,_0x3f0384){return db['SquareRecording'][_0x5c7f('0x41')](_0xd9594a[_0x5c7f('0x42')],{})[_0x5c7f('0x3c')](respondWithResult(_0x3f0384,0xc9))[_0x5c7f('0x3d')](handleError(_0x3f0384,null));};exports[_0x5c7f('0x1f')]=function(_0x11d7d8,_0x4e6837){if(_0x11d7d8[_0x5c7f('0x42')]['id']){delete _0x11d7d8['body']['id'];}return db['SquareRecording'][_0x5c7f('0x40')]({'where':{'id':_0x11d7d8[_0x5c7f('0x43')]['id']}})[_0x5c7f('0x3c')](handleEntityNotFound(_0x4e6837,null))['then'](saveUpdates(_0x11d7d8['body'],null))[_0x5c7f('0x3c')](respondWithResult(_0x4e6837,null))[_0x5c7f('0x3d')](handleError(_0x4e6837,null));};exports[_0x5c7f('0x20')]=function(_0x16b580,_0x46ade9){return db[_0x5c7f('0x26')][_0x5c7f('0x40')]({'where':{'id':_0x16b580[_0x5c7f('0x43')]['id']}})[_0x5c7f('0x3c')](handleEntityNotFound(_0x46ade9,null))[_0x5c7f('0x3c')](removeEntity(_0x46ade9,null))[_0x5c7f('0x3d')](handleError(_0x46ade9,null));};exports[_0x5c7f('0x44')]=function(_0x572fc9,_0x8b7827,_0xe88d25){var _0x540276=require('../../components/encryptor');var _0x5bd99c=![];var _0x2ed44e={};if(_0x572fc9['query'][_0x5c7f('0x34')]&&_0x572fc9['query']['type']===_0x5c7f('0x45')){_0x2ed44e[_0x5c7f('0x45')]=_0x572fc9[_0x5c7f('0x43')]['id'];}else{_0x2ed44e['id']=_0x572fc9['params']['id'];}return db[_0x5c7f('0x26')]['find']({'where':_0x2ed44e,'attributes':['id','savePath',_0x5c7f('0x46')],'raw':!![]})[_0x5c7f('0x3c')](handleEntityNotFound(_0x8b7827,null))[_0x5c7f('0x3c')](function(_0x3e577a){if(_0x3e577a){var _0x56f6d3=util[_0x5c7f('0x47')](_0x5c7f('0x48'),_0x3e577a['value']);if(fs[_0x5c7f('0x49')](_0x56f6d3)){_0x5bd99c=!![];return _0x540276[_0x5c7f('0x4a')](_0x56f6d3,_0x3e577a[_0x5c7f('0x4b')],config[_0x5c7f('0x4c')][_0x5c7f('0x4d')])[_0x5c7f('0x3c')](function(){return _0x3e577a;});}return _0x3e577a;}})[_0x5c7f('0x3c')](function(_0x3a9d2c){if(_0x3a9d2c){if(!fs['existsSync'](_0x3a9d2c[_0x5c7f('0x4b')])){throw new db[(_0x5c7f('0x4e'))]['ValidationError'](_0x5c7f('0x4f'));}if(_0x3a9d2c[_0x5c7f('0x46')]){return _0x8b7827[_0x5c7f('0x44')](_0x3a9d2c[_0x5c7f('0x4b')],_0x3a9d2c[_0x5c7f('0x46')]+path['extname'](_0x3a9d2c[_0x5c7f('0x4b')]),function(){if(_0x5bd99c){fs[_0x5c7f('0x50')](_0x3a9d2c[_0x5c7f('0x4b')]);}});}else{return _0x8b7827[_0x5c7f('0x44')](_0x3a9d2c[_0x5c7f('0x4b')],function(_0x4f69cf){if(_0x5bd99c){fs['unlink'](_0x3a9d2c[_0x5c7f('0x4b')]);}});}}})[_0x5c7f('0x3d')](handleError(_0x8b7827,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index a3a91c4..acacda2 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 _0x2427=['bluebird','./squareRecording.attributes','exports','define','square_recordings','lodash','util','api'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x2427,0x165));var _0x7242=function(_0x56c5d6,_0x4f1977){_0x56c5d6=_0x56c5d6-0x0;var _0x3b0001=_0x2427[_0x56c5d6];return _0x3b0001;};'use strict';var _=require(_0x7242('0x0'));var util=require(_0x7242('0x1'));var logger=require('../../config/logger')(_0x7242('0x2'));var moment=require('moment');var BPromise=require(_0x7242('0x3'));var rp=require('request-promise');var attributes=require(_0x7242('0x4'));module[_0x7242('0x5')]=function(_0x226e44,_0x5b70ea){return _0x226e44[_0x7242('0x6')]('SquareRecording',attributes,{'tableName':_0x7242('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3be=['../../config/logger','api','bluebird','define','square_recordings','lodash','util'];(function(_0x178511,_0x1098a6){var _0x4e8824=function(_0x2f04c4){while(--_0x2f04c4){_0x178511['push'](_0x178511['shift']());}};_0x4e8824(++_0x1098a6);}(_0xf3be,0x1e1));var _0xef3b=function(_0x437bff,_0x3bd612){_0x437bff=_0x437bff-0x0;var _0x239ae0=_0xf3be[_0x437bff];return _0x239ae0;};'use strict';var _=require(_0xef3b('0x0'));var util=require(_0xef3b('0x1'));var logger=require(_0xef3b('0x2'))(_0xef3b('0x3'));var moment=require('moment');var BPromise=require(_0xef3b('0x4'));var rp=require('request-promise');var attributes=require('./squareRecording.attributes');module['exports']=function(_0x4bfc98,_0x41dea3){return _0x4bfc98[_0xef3b('0x5')]('SquareRecording',attributes,{'tableName':_0xef3b('0x6'),'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 227753b..a4557d3 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 _0x66d7=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x350a01,_0x5ed763){var _0xc17c6b=function(_0x31aaec){while(--_0x31aaec){_0x350a01['push'](_0x350a01['shift']());}};_0xc17c6b(++_0x5ed763);}(_0x66d7,0x139));var _0x766d=function(_0x4f7341,_0x3df49f){_0x4f7341=_0x4f7341-0x0;var _0x4dd042=_0x66d7[_0x4f7341];return _0x4dd042;};'use strict';var _=require(_0x766d('0x0'));var util=require(_0x766d('0x1'));var moment=require(_0x766d('0x2'));var BPromise=require(_0x766d('0x3'));var rs=require(_0x766d('0x4'));var fs=require('fs');var Redis=require(_0x766d('0x5'));var db=require(_0x766d('0x6'))['db'];var utils=require(_0x766d('0x7'));var logger=require(_0x766d('0x8'))(_0x766d('0x9'));var config=require(_0x766d('0xa'));var jayson=require(_0x766d('0xb'));var client=jayson[_0x766d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7404d6,_0x210784,_0x2b2ace){return new BPromise(function(_0x2e661b,_0x1a1256){return client[_0x766d('0xd')](_0x7404d6,_0x2b2ace)[_0x766d('0xe')](function(_0x5c082f){logger[_0x766d('0xf')](_0x766d('0x10'),_0x210784,'request\x20sent');logger[_0x766d('0x11')](_0x766d('0x12'),_0x210784,_0x766d('0x13'),JSON[_0x766d('0x14')](_0x5c082f));if(_0x5c082f[_0x766d('0x15')]){if(_0x5c082f[_0x766d('0x15')][_0x766d('0x16')]===0x1f4){logger[_0x766d('0x15')](_0x766d('0x10'),_0x210784,_0x5c082f[_0x766d('0x15')][_0x766d('0x17')]);return _0x1a1256(_0x5c082f['error']['message']);}logger[_0x766d('0x15')](_0x766d('0x10'),_0x210784,_0x5c082f[_0x766d('0x15')][_0x766d('0x17')]);return _0x2e661b(_0x5c082f[_0x766d('0x15')][_0x766d('0x17')]);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x210784,_0x766d('0x13'));_0x2e661b(_0x5c082f[_0x766d('0x18')][_0x766d('0x17')]);}})[_0x766d('0x19')](function(_0x1fca7f){logger[_0x766d('0x15')](_0x766d('0x10'),_0x210784,_0x1fca7f);_0x1a1256(_0x1fca7f);});});}exports[_0x766d('0x1a')]=function(_0x189cfd){var _0x382959=this;return new Promise(function(_0x5e9d64,_0x1ffe07){return db[_0x766d('0x1b')][_0x766d('0x1c')](_0x189cfd[_0x766d('0x1d')],{'raw':_0x189cfd['options']?_0x189cfd[_0x766d('0x1e')][_0x766d('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x460f79){logger[_0x766d('0xf')](_0x766d('0x1a'),_0x189cfd);logger[_0x766d('0x11')](_0x766d('0x1a'),_0x189cfd,JSON[_0x766d('0x14')](_0x460f79));_0x5e9d64(_0x460f79);})[_0x766d('0x19')](function(_0x42a846){logger[_0x766d('0x15')](_0x766d('0x1a'),_0x42a846[_0x766d('0x17')],_0x189cfd);_0x1ffe07(_0x382959[_0x766d('0x15')](0x1f4,_0x42a846[_0x766d('0x17')]));});});}; \ No newline at end of file +var _0x81ab=['SquareRecording','create','body','options','raw','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareRecording,\x20%s,\x20%s','result','catch','CreateSquareRecording'];(function(_0x3f3f24,_0x5553ed){var _0x1e47e3=function(_0x50f315){while(--_0x50f315){_0x3f3f24['push'](_0x3f3f24['shift']());}};_0x1e47e3(++_0x5553ed);}(_0x81ab,0x17f));var _0xb81a=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x81ab[_0x5c2c7c];return _0xea7ffe;};'use strict';var _=require(_0xb81a('0x0'));var util=require('util');var moment=require(_0xb81a('0x1'));var BPromise=require(_0xb81a('0x2'));var rs=require(_0xb81a('0x3'));var fs=require('fs');var Redis=require(_0xb81a('0x4'));var db=require(_0xb81a('0x5'))['db'];var utils=require(_0xb81a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb81a('0x7'));var jayson=require(_0xb81a('0x8'));var client=jayson['client'][_0xb81a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe26e90,_0x407e83,_0x378254){return new BPromise(function(_0x165615,_0x540816){return client[_0xb81a('0xa')](_0xe26e90,_0x378254)['then'](function(_0x477e10){logger[_0xb81a('0xb')]('SquareRecording,\x20%s,\x20%s',_0x407e83,_0xb81a('0xc'));logger[_0xb81a('0xd')](_0xb81a('0xe'),_0x407e83,_0xb81a('0xc'),JSON[_0xb81a('0xf')](_0x477e10));if(_0x477e10[_0xb81a('0x10')]){if(_0x477e10[_0xb81a('0x10')][_0xb81a('0x11')]===0x1f4){logger[_0xb81a('0x10')]('SquareRecording,\x20%s,\x20%s',_0x407e83,_0x477e10['error'][_0xb81a('0x12')]);return _0x540816(_0x477e10[_0xb81a('0x10')][_0xb81a('0x12')]);}logger[_0xb81a('0x10')](_0xb81a('0x13'),_0x407e83,_0x477e10[_0xb81a('0x10')][_0xb81a('0x12')]);return _0x165615(_0x477e10[_0xb81a('0x10')][_0xb81a('0x12')]);}else{logger[_0xb81a('0xb')]('SquareRecording,\x20%s,\x20%s',_0x407e83,_0xb81a('0xc'));_0x165615(_0x477e10[_0xb81a('0x14')][_0xb81a('0x12')]);}})[_0xb81a('0x15')](function(_0x32b2e4){logger[_0xb81a('0x10')]('SquareRecording,\x20%s,\x20%s',_0x407e83,_0x32b2e4);_0x540816(_0x32b2e4);});});}exports[_0xb81a('0x16')]=function(_0x24282b){var _0x19cc8b=this;return new Promise(function(_0xde70aa,_0xa730f5){return db[_0xb81a('0x17')][_0xb81a('0x18')](_0x24282b[_0xb81a('0x19')],{'raw':_0x24282b['options']?_0x24282b[_0xb81a('0x1a')][_0xb81a('0x1b')]===undefined?!![]:![]:!![]})[_0xb81a('0x1c')](function(_0x8c8ef8){logger[_0xb81a('0xb')]('CreateSquareRecording',_0x24282b);logger[_0xb81a('0xd')]('CreateSquareRecording',_0x24282b,JSON[_0xb81a('0xf')](_0x8c8ef8));_0xde70aa(_0x8c8ef8);})[_0xb81a('0x15')](function(_0x40d8ee){logger[_0xb81a('0x10')]('CreateSquareRecording',_0x40d8ee[_0xb81a('0x12')],_0x24282b);_0xa730f5(_0x19cc8b[_0xb81a('0x10')](0x1f4,_0x40d8ee['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index d315ae7..ae20d4e 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 _0xa88d=['./squareReport.controller','get','isAuthenticated','describe','/:id','show','post','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xa88d,0x1db));var _0xda88=function(_0x2781ae,_0x19a275){_0x2781ae=_0x2781ae-0x0;var _0x10e1b9=_0xa88d[_0x2781ae];return _0x10e1b9;};'use strict';var multer=require(_0xda88('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xda88('0x1'));var express=require(_0xda88('0x2'));var router=express['Router']();var auth=require(_0xda88('0x3'));var interaction=require(_0xda88('0x4'));var config=require('../../config/environment');var controller=require(_0xda88('0x5'));router[_0xda88('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xda88('0x7')](),controller[_0xda88('0x8')]);router[_0xda88('0x6')](_0xda88('0x9'),auth[_0xda88('0x7')](),controller[_0xda88('0xa')]);router[_0xda88('0xb')]('/',auth[_0xda88('0x7')](),controller['create']);router['put'](_0xda88('0x9'),auth[_0xda88('0x7')](),controller[_0xda88('0xc')]);router[_0xda88('0xd')]('/:id',auth[_0xda88('0x7')](),controller[_0xda88('0xe')]);module[_0xda88('0xf')]=router; \ No newline at end of file +var _0x4efe=['multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','index','/describe','isAuthenticated','describe','post','create','/:id','update','delete','destroy','exports'];(function(_0x4e4ca5,_0x1413e8){var _0x27bfeb=function(_0x40337c){while(--_0x40337c){_0x4e4ca5['push'](_0x4e4ca5['shift']());}};_0x27bfeb(++_0x1413e8);}(_0x4efe,0xbb));var _0xe4ef=function(_0x35387d,_0x1ba72f){_0x35387d=_0x35387d-0x0;var _0x3aba56=_0x4efe[_0x35387d];return _0x3aba56;};'use strict';var multer=require(_0xe4ef('0x0'));var util=require('util');var path=require(_0xe4ef('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xe4ef('0x2'));var interaction=require(_0xe4ef('0x3'));var config=require(_0xe4ef('0x4'));var controller=require(_0xe4ef('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xe4ef('0x6')]);router['get'](_0xe4ef('0x7'),auth[_0xe4ef('0x8')](),controller[_0xe4ef('0x9')]);router['get']('/:id',auth[_0xe4ef('0x8')](),controller['show']);router[_0xe4ef('0xa')]('/',auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xb')]);router['put'](_0xe4ef('0xc'),auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xd')]);router[_0xe4ef('0xe')](_0xe4ef('0xc'),auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xf')]);module[_0xe4ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 0bab447..31aec28 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 _0x0fc8=['BOOLEAN','sequelize','exports','STRING'];(function(_0x319383,_0x13a539){var _0x1f62ca=function(_0x15c02f){while(--_0x15c02f){_0x319383['push'](_0x319383['shift']());}};_0x1f62ca(++_0x13a539);}(_0x0fc8,0x145));var _0x80fc=function(_0x2f9409,_0x35a38d){_0x2f9409=_0x2f9409-0x0;var _0x372cf5=_0x0fc8[_0x2f9409];return _0x372cf5;};'use strict';var Sequelize=require(_0x80fc('0x0'));module[_0x80fc('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x80fc('0x2')]},'language':{'type':Sequelize[_0x80fc('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x80fc('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x80fc('0x2')]},'callingpres':{'type':Sequelize[_0x80fc('0x2')]},'callingani2':{'type':Sequelize[_0x80fc('0x2')]},'callington':{'type':Sequelize[_0x80fc('0x2')]},'callingtns':{'type':Sequelize[_0x80fc('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x80fc('0x2')]},'context':{'type':Sequelize[_0x80fc('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x80fc('0x2')]},'enhanced':{'type':Sequelize[_0x80fc('0x2')]},'accountcode':{'type':Sequelize[_0x80fc('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x80fc('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x80fc('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xc577=['DATE','BOOLEAN','sequelize','STRING'];(function(_0x3dea7d,_0x2cd4ea){var _0x53919a=function(_0x1554e2){while(--_0x1554e2){_0x3dea7d['push'](_0x3dea7d['shift']());}};_0x53919a(++_0x2cd4ea);}(_0xc577,0x172));var _0x7c57=function(_0xaa0140,_0xd6c719){_0xaa0140=_0xaa0140-0x0;var _0x11ac88=_0xc577[_0xaa0140];return _0x11ac88;};'use strict';var Sequelize=require(_0x7c57('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x7c57('0x1')]},'request':{'type':Sequelize[_0x7c57('0x1')]},'channel':{'type':Sequelize[_0x7c57('0x1')]},'language':{'type':Sequelize[_0x7c57('0x1')]},'type':{'type':Sequelize[_0x7c57('0x1')]},'uniqueid':{'type':Sequelize[_0x7c57('0x1')]},'version':{'type':Sequelize[_0x7c57('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7c57('0x1')]},'callingpres':{'type':Sequelize[_0x7c57('0x1')]},'callingani2':{'type':Sequelize[_0x7c57('0x1')]},'callington':{'type':Sequelize[_0x7c57('0x1')]},'callingtns':{'type':Sequelize[_0x7c57('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x7c57('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x7c57('0x1')]},'accountcode':{'type':Sequelize[_0x7c57('0x1')]},'threadid':{'type':Sequelize[_0x7c57('0x1')]},'project_name':{'type':Sequelize[_0x7c57('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7c57('0x2')]},'bot':{'type':Sequelize[_0x7c57('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index e25f577..9b3c74f 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 _0x1d40=['json','count','offset','limit','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','SquareReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x599f96,_0x4cfdb9){var _0x5cb121=function(_0x24099c){while(--_0x24099c){_0x599f96['push'](_0x599f96['shift']());}};_0x5cb121(++_0x4cfdb9);}(_0x1d40,0xbc));var _0x01d4=function(_0x5be885,_0x396bdc){_0x5be885=_0x5be885-0x0;var _0x3a14ed=_0x1d40[_0x5be885];return _0x3a14ed;};'use strict';var pdf=require(_0x01d4('0x0'));var emlformat=require(_0x01d4('0x1'));var rimraf=require(_0x01d4('0x2'));var zipdir=require(_0x01d4('0x3'));var jsonpatch=require(_0x01d4('0x4'));var rp=require(_0x01d4('0x5'));var moment=require(_0x01d4('0x6'));var BPromise=require(_0x01d4('0x7'));var Mustache=require(_0x01d4('0x8'));var util=require(_0x01d4('0x9'));var path=require(_0x01d4('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x01d4('0xb'));var fs=require('fs');var _=require(_0x01d4('0xc'));var squel=require(_0x01d4('0xd'));var crypto=require('crypto');var jsforce=require(_0x01d4('0xe'));var deskjs=require(_0x01d4('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x01d4('0x10'));var authService=require(_0x01d4('0x11'));var hardwareService=require(_0x01d4('0x12'));var Redis=require(_0x01d4('0x13'));var qs=require(_0x01d4('0x14'));var logger=require(_0x01d4('0x15'))('api');var utils=require(_0x01d4('0x16'));var config=require(_0x01d4('0x17'));var db=require(_0x01d4('0x18'))['db'];function respondWithStatusCode(_0x1bbd72,_0x543cd0){_0x543cd0=_0x543cd0||0xcc;return function(_0x4e684e){if(_0x4e684e){return _0x1bbd72[_0x01d4('0x19')](_0x543cd0);}return _0x1bbd72[_0x01d4('0x1a')](_0x543cd0)[_0x01d4('0x1b')]();};}function respondWithResult(_0x98473b,_0x12ecfa){_0x12ecfa=_0x12ecfa||0xc8;return function(_0x51a0f2){if(_0x51a0f2){return _0x98473b['status'](_0x12ecfa)[_0x01d4('0x1c')](_0x51a0f2);}};}function respondWithFilteredResult(_0x29cb63,_0x39a349){return function(_0x26aec2){if(_0x26aec2){var _0x2d0011=_0x26aec2[_0x01d4('0x1d')],_0x597836=_0x39a349[_0x01d4('0x1e')],_0x56aff2=_0x39a349['offset']+_0x39a349[_0x01d4('0x1f')],_0x3d1014;if(_0x56aff2>=_0x2d0011){_0x56aff2=_0x2d0011;_0x3d1014=0xc8;}else{_0x3d1014=0xce;}_0x29cb63[_0x01d4('0x1a')](_0x3d1014);return _0x29cb63['set'](_0x01d4('0x20'),_0x597836+'-'+_0x56aff2+'/'+_0x2d0011)[_0x01d4('0x1c')](_0x26aec2);}return null;};}function patchUpdates(_0x4c3d3c){return function(_0x226904){try{jsonpatch[_0x01d4('0x21')](_0x226904,_0x4c3d3c,!![]);}catch(_0x4b9eb6){return BPromise[_0x01d4('0x22')](_0x4b9eb6);}return _0x226904['save']();};}function saveUpdates(_0xac2904,_0x53fd27){return function(_0x36f453){if(_0x36f453){return _0x36f453[_0x01d4('0x23')](_0xac2904)['then'](function(_0x96557){return _0x96557;});}return null;};}function removeEntity(_0x3d91ab,_0x190500){return function(_0x26ad02){if(_0x26ad02){return _0x26ad02[_0x01d4('0x24')]()[_0x01d4('0x25')](function(){_0x3d91ab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x194758,_0x4f4407){return function(_0x1090ef){if(!_0x1090ef){_0x194758[_0x01d4('0x19')](0x194);}return _0x1090ef;};}function handleError(_0x38caee,_0x1b1f6d){_0x1b1f6d=_0x1b1f6d||0x1f4;return function(_0x4f6e7b){logger[_0x01d4('0x26')](_0x4f6e7b[_0x01d4('0x27')]);if(_0x4f6e7b[_0x01d4('0x28')]){delete _0x4f6e7b[_0x01d4('0x28')];}_0x38caee[_0x01d4('0x1a')](_0x1b1f6d)['send'](_0x4f6e7b);};}exports[_0x01d4('0x29')]=function(_0x239233,_0x29858f){var _0x521f74={},_0x24e276={},_0x3cb8c9={'count':0x0,'rows':[]};var _0x588914=db[_0x01d4('0x2a')][_0x01d4('0x2b')];_0x24e276[_0x01d4('0x2c')]=_[_0x01d4('0x2d')](_0x588914);_0x24e276['query']=_[_0x01d4('0x2d')](_0x239233[_0x01d4('0x2e')]);_0x24e276[_0x01d4('0x2f')]=_[_0x01d4('0x30')](_0x24e276[_0x01d4('0x2c')],_0x24e276[_0x01d4('0x2e')]);_0x521f74[_0x01d4('0x31')]=_[_0x01d4('0x30')](_0x24e276[_0x01d4('0x2c')],qs[_0x01d4('0x32')](_0x239233[_0x01d4('0x2e')][_0x01d4('0x32')]));_0x521f74[_0x01d4('0x31')]=_0x521f74['attributes'][_0x01d4('0x33')]?_0x521f74[_0x01d4('0x31')]:_0x24e276[_0x01d4('0x2c')];if(!_0x239233[_0x01d4('0x2e')][_0x01d4('0x34')](_0x01d4('0x35'))){_0x521f74[_0x01d4('0x1f')]=qs['limit'](_0x239233[_0x01d4('0x2e')][_0x01d4('0x1f')]);_0x521f74[_0x01d4('0x1e')]=qs[_0x01d4('0x1e')](_0x239233['query'][_0x01d4('0x1e')]);}_0x521f74[_0x01d4('0x36')]=qs[_0x01d4('0x37')](_0x239233[_0x01d4('0x2e')]['sort']);_0x521f74[_0x01d4('0x38')]=qs[_0x01d4('0x2f')](_['pick'](_0x239233[_0x01d4('0x2e')],_0x24e276[_0x01d4('0x2f')]));if(_0x239233[_0x01d4('0x2e')][_0x01d4('0x39')]){_0x521f74[_0x01d4('0x38')]=_[_0x01d4('0x3a')](_0x521f74[_0x01d4('0x38')],{'$or':_['map'](_0x588914,function(_0x1c05a6){if(_0x1c05a6[_0x01d4('0x3b')][_0x01d4('0x3c')]!==_0x01d4('0x3d')){var _0x25790d={};_0x25790d[_0x1c05a6['field']]={'$like':'%'+_0x239233[_0x01d4('0x2e')][_0x01d4('0x39')]+'%'};return _0x25790d;}})});}_0x521f74=_[_0x01d4('0x3a')]({},_0x521f74,_0x239233['options']);var _0x4bd280={'where':_0x521f74[_0x01d4('0x38')]};return db[_0x01d4('0x2a')][_0x01d4('0x1d')](_0x4bd280)[_0x01d4('0x25')](function(_0x43bb03){_0x3cb8c9[_0x01d4('0x1d')]=_0x43bb03;if(_0x239233[_0x01d4('0x2e')][_0x01d4('0x3e')]){_0x521f74[_0x01d4('0x3f')]=[{'all':!![]}];}return db[_0x01d4('0x2a')][_0x01d4('0x40')](_0x521f74);})['then'](function(_0x173016){_0x3cb8c9['rows']=_0x173016;return _0x3cb8c9;})[_0x01d4('0x25')](respondWithFilteredResult(_0x29858f,_0x521f74))[_0x01d4('0x41')](handleError(_0x29858f,null));};exports[_0x01d4('0x42')]=function(_0x3093f6,_0x33302c){var _0x3e4134={'raw':!![],'where':{'id':_0x3093f6[_0x01d4('0x43')]['id']}},_0xc8f14a={};_0xc8f14a[_0x01d4('0x2c')]=_[_0x01d4('0x2d')](db[_0x01d4('0x2a')][_0x01d4('0x2b')]);_0xc8f14a[_0x01d4('0x2e')]=_[_0x01d4('0x2d')](_0x3093f6[_0x01d4('0x2e')]);_0xc8f14a[_0x01d4('0x2f')]=_[_0x01d4('0x30')](_0xc8f14a[_0x01d4('0x2c')],_0xc8f14a[_0x01d4('0x2e')]);_0x3e4134[_0x01d4('0x31')]=_[_0x01d4('0x30')](_0xc8f14a[_0x01d4('0x2c')],qs[_0x01d4('0x32')](_0x3093f6[_0x01d4('0x2e')][_0x01d4('0x32')]));_0x3e4134[_0x01d4('0x31')]=_0x3e4134[_0x01d4('0x31')]['length']?_0x3e4134[_0x01d4('0x31')]:_0xc8f14a['model'];if(_0x3093f6[_0x01d4('0x2e')][_0x01d4('0x3e')]){_0x3e4134[_0x01d4('0x3f')]=[{'all':!![]}];}_0x3e4134=_[_0x01d4('0x3a')]({},_0x3e4134,_0x3093f6[_0x01d4('0x44')]);return db['SquareReport']['find'](_0x3e4134)[_0x01d4('0x25')](handleEntityNotFound(_0x33302c,null))[_0x01d4('0x25')](respondWithResult(_0x33302c,null))[_0x01d4('0x41')](handleError(_0x33302c,null));};exports[_0x01d4('0x45')]=function(_0x111c89,_0x40ea09){return db[_0x01d4('0x2a')][_0x01d4('0x45')](_0x111c89[_0x01d4('0x46')],{})[_0x01d4('0x25')](respondWithResult(_0x40ea09,0xc9))[_0x01d4('0x41')](handleError(_0x40ea09,null));};exports[_0x01d4('0x23')]=function(_0x2fdf13,_0x39da7e){if(_0x2fdf13[_0x01d4('0x46')]['id']){delete _0x2fdf13[_0x01d4('0x46')]['id'];}return db[_0x01d4('0x2a')]['find']({'where':{'id':_0x2fdf13[_0x01d4('0x43')]['id']}})[_0x01d4('0x25')](handleEntityNotFound(_0x39da7e,null))[_0x01d4('0x25')](saveUpdates(_0x2fdf13[_0x01d4('0x46')],null))[_0x01d4('0x25')](respondWithResult(_0x39da7e,null))['catch'](handleError(_0x39da7e,null));};exports[_0x01d4('0x24')]=function(_0xf232a7,_0x17121c){return db['SquareReport']['find']({'where':{'id':_0xf232a7[_0x01d4('0x43')]['id']}})[_0x01d4('0x25')](handleEntityNotFound(_0x17121c,null))['then'](removeEntity(_0x17121c,null))[_0x01d4('0x41')](handleError(_0x17121c,null));};exports[_0x01d4('0x47')]=function(_0x4c313c,_0x567477){return db[_0x01d4('0x2a')]['describe']()[_0x01d4('0x25')](respondWithResult(_0x567477,null))[_0x01d4('0x41')](handleError(_0x567477,null));}; \ No newline at end of file +var _0x6dcd=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','field','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','catch','destroy','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','end','stack','name','send','SquareReport','model','keys','query','filters'];(function(_0x3680af,_0x24f4f2){var _0x282c21=function(_0x5d29b7){while(--_0x5d29b7){_0x3680af['push'](_0x3680af['shift']());}};_0x282c21(++_0x24f4f2);}(_0x6dcd,0x130));var _0xd6dc=function(_0xd16e6,_0x511776){_0xd16e6=_0xd16e6-0x0;var _0x3bb41e=_0x6dcd[_0xd16e6];return _0x3bb41e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd6dc('0x0'));var zipdir=require(_0xd6dc('0x1'));var jsonpatch=require(_0xd6dc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd6dc('0x3'));var Mustache=require(_0xd6dc('0x4'));var util=require(_0xd6dc('0x5'));var path=require('path');var sox=require(_0xd6dc('0x6'));var csv=require(_0xd6dc('0x7'));var ejs=require(_0xd6dc('0x8'));var fs=require('fs');var _=require(_0xd6dc('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd6dc('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd6dc('0xb'));var authService=require(_0xd6dc('0xc'));var hardwareService=require(_0xd6dc('0xd'));var Redis=require(_0xd6dc('0xe'));var qs=require(_0xd6dc('0xf'));var logger=require('../../config/logger')(_0xd6dc('0x10'));var utils=require(_0xd6dc('0x11'));var config=require(_0xd6dc('0x12'));var db=require(_0xd6dc('0x13'))['db'];function respondWithStatusCode(_0x1d418a,_0x1f879c){_0x1f879c=_0x1f879c||0xcc;return function(_0x59fe48){if(_0x59fe48){return _0x1d418a[_0xd6dc('0x14')](_0x1f879c);}return _0x1d418a['status'](_0x1f879c)['end']();};}function respondWithResult(_0x2b84e7,_0x2bd9f9){_0x2bd9f9=_0x2bd9f9||0xc8;return function(_0x535787){if(_0x535787){return _0x2b84e7[_0xd6dc('0x15')](_0x2bd9f9)[_0xd6dc('0x16')](_0x535787);}};}function respondWithFilteredResult(_0x41a102,_0x596c1e){return function(_0x48fe2b){if(_0x48fe2b){var _0x4e438a=_0x48fe2b[_0xd6dc('0x17')],_0x6a554c=_0x596c1e[_0xd6dc('0x18')],_0x417137=_0x596c1e['offset']+_0x596c1e[_0xd6dc('0x19')],_0x5f2a11;if(_0x417137>=_0x4e438a){_0x417137=_0x4e438a;_0x5f2a11=0xc8;}else{_0x5f2a11=0xce;}_0x41a102['status'](_0x5f2a11);return _0x41a102[_0xd6dc('0x1a')](_0xd6dc('0x1b'),_0x6a554c+'-'+_0x417137+'/'+_0x4e438a)[_0xd6dc('0x16')](_0x48fe2b);}return null;};}function patchUpdates(_0x42fa70){return function(_0x380298){try{jsonpatch['apply'](_0x380298,_0x42fa70,!![]);}catch(_0x442499){return BPromise[_0xd6dc('0x1c')](_0x442499);}return _0x380298[_0xd6dc('0x1d')]();};}function saveUpdates(_0x3b3b16,_0x1e035d){return function(_0x561db6){if(_0x561db6){return _0x561db6[_0xd6dc('0x1e')](_0x3b3b16)[_0xd6dc('0x1f')](function(_0x46ccbc){return _0x46ccbc;});}return null;};}function removeEntity(_0x101bd4,_0x257bf9){return function(_0x4a9fa3){if(_0x4a9fa3){return _0x4a9fa3['destroy']()[_0xd6dc('0x1f')](function(){_0x101bd4[_0xd6dc('0x15')](0xcc)[_0xd6dc('0x20')]();});}};}function handleEntityNotFound(_0x4d3b82,_0x2b6460){return function(_0xe89220){if(!_0xe89220){_0x4d3b82[_0xd6dc('0x14')](0x194);}return _0xe89220;};}function handleError(_0x183a46,_0xef553e){_0xef553e=_0xef553e||0x1f4;return function(_0x5531a8){logger['error'](_0x5531a8[_0xd6dc('0x21')]);if(_0x5531a8[_0xd6dc('0x22')]){delete _0x5531a8['name'];}_0x183a46[_0xd6dc('0x15')](_0xef553e)[_0xd6dc('0x23')](_0x5531a8);};}exports['index']=function(_0x339d05,_0x525460){var _0x5d24ed={},_0x1efb35={},_0x5c2a1c={'count':0x0,'rows':[]};var _0x5563e6=db[_0xd6dc('0x24')]['rawAttributes'];_0x1efb35[_0xd6dc('0x25')]=_[_0xd6dc('0x26')](_0x5563e6);_0x1efb35[_0xd6dc('0x27')]=_[_0xd6dc('0x26')](_0x339d05[_0xd6dc('0x27')]);_0x1efb35[_0xd6dc('0x28')]=_[_0xd6dc('0x29')](_0x1efb35[_0xd6dc('0x25')],_0x1efb35[_0xd6dc('0x27')]);_0x5d24ed['attributes']=_[_0xd6dc('0x29')](_0x1efb35[_0xd6dc('0x25')],qs[_0xd6dc('0x2a')](_0x339d05[_0xd6dc('0x27')][_0xd6dc('0x2a')]));_0x5d24ed['attributes']=_0x5d24ed[_0xd6dc('0x2b')][_0xd6dc('0x2c')]?_0x5d24ed[_0xd6dc('0x2b')]:_0x1efb35[_0xd6dc('0x25')];if(!_0x339d05[_0xd6dc('0x27')][_0xd6dc('0x2d')](_0xd6dc('0x2e'))){_0x5d24ed[_0xd6dc('0x19')]=qs[_0xd6dc('0x19')](_0x339d05['query'][_0xd6dc('0x19')]);_0x5d24ed[_0xd6dc('0x18')]=qs[_0xd6dc('0x18')](_0x339d05[_0xd6dc('0x27')][_0xd6dc('0x18')]);}_0x5d24ed[_0xd6dc('0x2f')]=qs[_0xd6dc('0x30')](_0x339d05[_0xd6dc('0x27')]['sort']);_0x5d24ed[_0xd6dc('0x31')]=qs[_0xd6dc('0x28')](_[_0xd6dc('0x32')](_0x339d05[_0xd6dc('0x27')],_0x1efb35[_0xd6dc('0x28')]));if(_0x339d05['query'][_0xd6dc('0x33')]){_0x5d24ed['where']=_[_0xd6dc('0x34')](_0x5d24ed[_0xd6dc('0x31')],{'$or':_[_0xd6dc('0x35')](_0x5563e6,function(_0x3b9280){if(_0x3b9280['type'][_0xd6dc('0x36')]!=='VIRTUAL'){var _0x3b0135={};_0x3b0135[_0x3b9280[_0xd6dc('0x37')]]={'$like':'%'+_0x339d05[_0xd6dc('0x27')][_0xd6dc('0x33')]+'%'};return _0x3b0135;}})});}_0x5d24ed=_['merge']({},_0x5d24ed,_0x339d05[_0xd6dc('0x38')]);var _0x36a2bf={'where':_0x5d24ed[_0xd6dc('0x31')]};return db['SquareReport']['count'](_0x36a2bf)['then'](function(_0x13d164){_0x5c2a1c['count']=_0x13d164;if(_0x339d05['query'][_0xd6dc('0x39')]){_0x5d24ed[_0xd6dc('0x3a')]=[{'all':!![]}];}return db[_0xd6dc('0x24')][_0xd6dc('0x3b')](_0x5d24ed);})[_0xd6dc('0x1f')](function(_0x5534ed){_0x5c2a1c[_0xd6dc('0x3c')]=_0x5534ed;return _0x5c2a1c;})[_0xd6dc('0x1f')](respondWithFilteredResult(_0x525460,_0x5d24ed))['catch'](handleError(_0x525460,null));};exports['show']=function(_0x13fa27,_0x394a0d){var _0x49ce71={'raw':!![],'where':{'id':_0x13fa27[_0xd6dc('0x3d')]['id']}},_0x353257={};_0x353257['model']=_[_0xd6dc('0x26')](db['SquareReport'][_0xd6dc('0x3e')]);_0x353257['query']=_[_0xd6dc('0x26')](_0x13fa27[_0xd6dc('0x27')]);_0x353257[_0xd6dc('0x28')]=_['intersection'](_0x353257['model'],_0x353257['query']);_0x49ce71[_0xd6dc('0x2b')]=_[_0xd6dc('0x29')](_0x353257[_0xd6dc('0x25')],qs[_0xd6dc('0x2a')](_0x13fa27[_0xd6dc('0x27')][_0xd6dc('0x2a')]));_0x49ce71[_0xd6dc('0x2b')]=_0x49ce71['attributes'][_0xd6dc('0x2c')]?_0x49ce71['attributes']:_0x353257['model'];if(_0x13fa27['query'][_0xd6dc('0x39')]){_0x49ce71[_0xd6dc('0x3a')]=[{'all':!![]}];}_0x49ce71=_['merge']({},_0x49ce71,_0x13fa27[_0xd6dc('0x38')]);return db[_0xd6dc('0x24')][_0xd6dc('0x3f')](_0x49ce71)[_0xd6dc('0x1f')](handleEntityNotFound(_0x394a0d,null))[_0xd6dc('0x1f')](respondWithResult(_0x394a0d,null))['catch'](handleError(_0x394a0d,null));};exports[_0xd6dc('0x40')]=function(_0x44b2b8,_0x7be9b0){return db[_0xd6dc('0x24')][_0xd6dc('0x40')](_0x44b2b8[_0xd6dc('0x41')],{})[_0xd6dc('0x1f')](respondWithResult(_0x7be9b0,0xc9))[_0xd6dc('0x42')](handleError(_0x7be9b0,null));};exports[_0xd6dc('0x1e')]=function(_0x5a80d7,_0x270c66){if(_0x5a80d7['body']['id']){delete _0x5a80d7['body']['id'];}return db['SquareReport'][_0xd6dc('0x3f')]({'where':{'id':_0x5a80d7[_0xd6dc('0x3d')]['id']}})[_0xd6dc('0x1f')](handleEntityNotFound(_0x270c66,null))[_0xd6dc('0x1f')](saveUpdates(_0x5a80d7[_0xd6dc('0x41')],null))[_0xd6dc('0x1f')](respondWithResult(_0x270c66,null))['catch'](handleError(_0x270c66,null));};exports[_0xd6dc('0x43')]=function(_0x1fd590,_0x2cd1a9){return db[_0xd6dc('0x24')][_0xd6dc('0x3f')]({'where':{'id':_0x1fd590[_0xd6dc('0x3d')]['id']}})[_0xd6dc('0x1f')](handleEntityNotFound(_0x2cd1a9,null))[_0xd6dc('0x1f')](removeEntity(_0x2cd1a9,null))[_0xd6dc('0x42')](handleError(_0x2cd1a9,null));};exports[_0xd6dc('0x44')]=function(_0x4ac18a,_0x2dfa11){return db['SquareReport'][_0xd6dc('0x44')]()[_0xd6dc('0x1f')](respondWithResult(_0x2dfa11,null))['catch'](handleError(_0x2dfa11,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 918476e..c523403 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 _0xc8eb=['define','SquareReport','report_square','uniqueid','leaveAt','lodash','../../config/logger','api','moment','bluebird','request-promise','./squareReport.attributes','exports'];(function(_0x584177,_0x309d20){var _0xb3a033=function(_0x17cfdf){while(--_0x17cfdf){_0x584177['push'](_0x584177['shift']());}};_0xb3a033(++_0x309d20);}(_0xc8eb,0xae));var _0xbc8e=function(_0x74892f,_0x1e981b){_0x74892f=_0x74892f-0x0;var _0x10ee61=_0xc8eb[_0x74892f];return _0x10ee61;};'use strict';var _=require(_0xbc8e('0x0'));var util=require('util');var logger=require(_0xbc8e('0x1'))(_0xbc8e('0x2'));var moment=require(_0xbc8e('0x3'));var BPromise=require(_0xbc8e('0x4'));var rp=require(_0xbc8e('0x5'));var attributes=require(_0xbc8e('0x6'));module[_0xbc8e('0x7')]=function(_0x4d16cb,_0x2616b0){return _0x4d16cb[_0xbc8e('0x8')](_0xbc8e('0x9'),attributes,{'tableName':_0xbc8e('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xbc8e('0xb'),'project_name']},{'name':'leaveAt','fields':[_0xbc8e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b3c=['define','report_square','project_name','leaveAt','lodash','util','../../config/logger','moment','bluebird','./squareReport.attributes','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7b3c,0x138));var _0xc7b3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7b3c[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xc7b3('0x0'));var util=require(_0xc7b3('0x1'));var logger=require(_0xc7b3('0x2'))('api');var moment=require(_0xc7b3('0x3'));var BPromise=require(_0xc7b3('0x4'));var rp=require('request-promise');var attributes=require(_0xc7b3('0x5'));module[_0xc7b3('0x6')]=function(_0x1c83be,_0x3b5f74){return _0x1c83be[_0xc7b3('0x7')]('SquareReport',attributes,{'tableName':_0xc7b3('0x8'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0xc7b3('0x9')]},{'name':_0xc7b3('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 c36c105..7642095 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 _0x503d=['SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x2f2606,_0x2bf0ed){var _0x561d6c=function(_0x41a5cd){while(--_0x41a5cd){_0x2f2606['push'](_0x2f2606['shift']());}};_0x561d6c(++_0x2bf0ed);}(_0x503d,0x1d2));var _0xd503=function(_0x190417,_0x54dc0d){_0x190417=_0x190417-0x0;var _0x110e9c=_0x503d[_0x190417];return _0x110e9c;};'use strict';var _=require('lodash');var util=require(_0xd503('0x0'));var moment=require(_0xd503('0x1'));var BPromise=require(_0xd503('0x2'));var rs=require(_0xd503('0x3'));var fs=require('fs');var Redis=require(_0xd503('0x4'));var db=require(_0xd503('0x5'))['db'];var utils=require(_0xd503('0x6'));var logger=require(_0xd503('0x7'))(_0xd503('0x8'));var config=require(_0xd503('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd503('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2416a6,_0x135612,_0x52f0c4){return new BPromise(function(_0x1a45ba,_0x4293d6){return client[_0xd503('0xb')](_0x2416a6,_0x52f0c4)[_0xd503('0xc')](function(_0x59428c){logger[_0xd503('0xd')](_0xd503('0xe'),_0x135612,_0xd503('0xf'));logger[_0xd503('0x10')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x135612,_0xd503('0xf'),JSON[_0xd503('0x11')](_0x59428c));if(_0x59428c[_0xd503('0x12')]){if(_0x59428c[_0xd503('0x12')]['code']===0x1f4){logger[_0xd503('0x12')](_0xd503('0xe'),_0x135612,_0x59428c[_0xd503('0x12')]['message']);return _0x4293d6(_0x59428c[_0xd503('0x12')]['message']);}logger['error'](_0xd503('0xe'),_0x135612,_0x59428c[_0xd503('0x12')][_0xd503('0x13')]);return _0x1a45ba(_0x59428c[_0xd503('0x12')][_0xd503('0x13')]);}else{logger[_0xd503('0xd')]('SquareReport,\x20%s,\x20%s',_0x135612,_0xd503('0xf'));_0x1a45ba(_0x59428c[_0xd503('0x14')][_0xd503('0x13')]);}})[_0xd503('0x15')](function(_0x1f2cfe){logger[_0xd503('0x12')](_0xd503('0xe'),_0x135612,_0x1f2cfe);_0x4293d6(_0x1f2cfe);});});}exports[_0xd503('0x16')]=function(_0x1b3179){var _0x29f39a=this;return new Promise(function(_0x332855,_0x42d214){return db[_0xd503('0x17')][_0xd503('0x18')](_0x1b3179[_0xd503('0x19')],{'raw':_0x1b3179[_0xd503('0x1a')]?_0x1b3179['options'][_0xd503('0x1b')]===undefined?!![]:![]:!![]})[_0xd503('0xc')](function(_0x27c09b){logger['info'](_0xd503('0x16'),_0x1b3179);logger[_0xd503('0x10')](_0xd503('0x16'),_0x1b3179,JSON[_0xd503('0x11')](_0x27c09b));_0x332855(_0x27c09b);})[_0xd503('0x15')](function(_0x12820d){logger[_0xd503('0x12')](_0xd503('0x16'),_0x12820d[_0xd503('0x13')],_0x1b3179);_0x42d214(_0x29f39a[_0xd503('0x12')](0x1f4,_0x12820d[_0xd503('0x13')]));});});};exports[_0xd503('0x1c')]=function(_0x52f025){var _0x424aa1=this;return new Promise(function(_0x55c4a9,_0x2e4a21){return db[_0xd503('0x17')]['update'](_0x52f025[_0xd503('0x19')],{'raw':_0x52f025['options']?_0x52f025[_0xd503('0x1a')][_0xd503('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52f025[_0xd503('0x1a')]?_0x52f025['options'][_0xd503('0x1d')]||null:null,'attributes':_0x52f025[_0xd503('0x1a')]?_0x52f025['options'][_0xd503('0x1e')]||null:null,'limit':_0x52f025[_0xd503('0x1a')]?_0x52f025[_0xd503('0x1a')][_0xd503('0x1f')]||null:null})[_0xd503('0xc')](function(_0x5dc10d){logger[_0xd503('0xd')](_0xd503('0x1c'),_0x52f025);logger[_0xd503('0x10')]('UpdateSquareReport',_0x52f025,JSON[_0xd503('0x11')](_0x5dc10d));_0x55c4a9(_0x5dc10d);})[_0xd503('0x15')](function(_0x5b75dc){logger[_0xd503('0x12')]('UpdateSquareReport',_0x5b75dc['message'],_0x52f025);_0x2e4a21(_0x424aa1[_0xd503('0x12')](0x1f4,_0x5b75dc[_0xd503('0x13')]));});});}; \ No newline at end of file +var _0x9675=['request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareReport,\x20%s,\x20%s','catch','CreateSquareReport','SquareReport','create','options','raw','then','UpdateSquareReport','update','attributes','limit','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x507881,_0x23cc61){var _0x2c2063=function(_0x3ddecc){while(--_0x3ddecc){_0x507881['push'](_0x507881['shift']());}};_0x2c2063(++_0x23cc61);}(_0x9675,0x8b));var _0x5967=function(_0x1e1193,_0x36654c){_0x1e1193=_0x1e1193-0x0;var _0x90d6b3=_0x9675[_0x1e1193];return _0x90d6b3;};'use strict';var _=require('lodash');var util=require(_0x5967('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5967('0x1'));var fs=require('fs');var Redis=require(_0x5967('0x2'));var db=require(_0x5967('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5967('0x4'))(_0x5967('0x5'));var config=require(_0x5967('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5967('0x7')][_0x5967('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcecaa4,_0x3f40c0,_0x581091){return new BPromise(function(_0x514ed1,_0x2a5b23){return client[_0x5967('0x9')](_0xcecaa4,_0x581091)['then'](function(_0x253af6){logger[_0x5967('0xa')]('SquareReport,\x20%s,\x20%s',_0x3f40c0,_0x5967('0xb'));logger[_0x5967('0xc')](_0x5967('0xd'),_0x3f40c0,_0x5967('0xb'),JSON[_0x5967('0xe')](_0x253af6));if(_0x253af6[_0x5967('0xf')]){if(_0x253af6[_0x5967('0xf')][_0x5967('0x10')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x3f40c0,_0x253af6['error'][_0x5967('0x11')]);return _0x2a5b23(_0x253af6[_0x5967('0xf')][_0x5967('0x11')]);}logger[_0x5967('0xf')](_0x5967('0x12'),_0x3f40c0,_0x253af6['error']['message']);return _0x514ed1(_0x253af6[_0x5967('0xf')][_0x5967('0x11')]);}else{logger[_0x5967('0xa')](_0x5967('0x12'),_0x3f40c0,_0x5967('0xb'));_0x514ed1(_0x253af6['result'][_0x5967('0x11')]);}})[_0x5967('0x13')](function(_0x8da288){logger[_0x5967('0xf')]('SquareReport,\x20%s,\x20%s',_0x3f40c0,_0x8da288);_0x2a5b23(_0x8da288);});});}exports[_0x5967('0x14')]=function(_0x42ee8a){var _0x4e2ec6=this;return new Promise(function(_0xa0b3ca,_0x46f614){return db[_0x5967('0x15')][_0x5967('0x16')](_0x42ee8a['body'],{'raw':_0x42ee8a['options']?_0x42ee8a[_0x5967('0x17')][_0x5967('0x18')]===undefined?!![]:![]:!![]})[_0x5967('0x19')](function(_0x964fa5){logger[_0x5967('0xa')](_0x5967('0x14'),_0x42ee8a);logger['debug'](_0x5967('0x14'),_0x42ee8a,JSON[_0x5967('0xe')](_0x964fa5));_0xa0b3ca(_0x964fa5);})['catch'](function(_0x4152f6){logger['error'](_0x5967('0x14'),_0x4152f6['message'],_0x42ee8a);_0x46f614(_0x4e2ec6[_0x5967('0xf')](0x1f4,_0x4152f6[_0x5967('0x11')]));});});};exports[_0x5967('0x1a')]=function(_0x5c34ea){var _0xd14495=this;return new Promise(function(_0x3541e0,_0x5360cc){return db[_0x5967('0x15')][_0x5967('0x1b')](_0x5c34ea['body'],{'raw':_0x5c34ea[_0x5967('0x17')]?_0x5c34ea[_0x5967('0x17')][_0x5967('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c34ea[_0x5967('0x17')]?_0x5c34ea[_0x5967('0x17')]['where']||null:null,'attributes':_0x5c34ea[_0x5967('0x17')]?_0x5c34ea[_0x5967('0x17')][_0x5967('0x1c')]||null:null,'limit':_0x5c34ea['options']?_0x5c34ea[_0x5967('0x17')][_0x5967('0x1d')]||null:null})[_0x5967('0x19')](function(_0x264039){logger[_0x5967('0xa')](_0x5967('0x1a'),_0x5c34ea);logger['debug'](_0x5967('0x1a'),_0x5c34ea,JSON[_0x5967('0xe')](_0x264039));_0x3541e0(_0x264039);})[_0x5967('0x13')](function(_0x533525){logger[_0x5967('0xf')]('UpdateSquareReport',_0x533525[_0x5967('0x11')],_0x5c34ea);_0x5360cc(_0xd14495[_0x5967('0xf')](0x1f4,_0x533525['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 22b29e9..d588e2d 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 _0xc8c2=['../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','create','/:id','exports','multer','util','path','express','Router'];(function(_0x2200d6,_0x12408d){var _0x208f24=function(_0x4f7f7a){while(--_0x4f7f7a){_0x2200d6['push'](_0x2200d6['shift']());}};_0x208f24(++_0x12408d);}(_0xc8c2,0x1ad));var _0x2c8c=function(_0x419b6a,_0x265b43){_0x419b6a=_0x419b6a-0x0;var _0x229232=_0xc8c2[_0x419b6a];return _0x229232;};'use strict';var multer=require(_0x2c8c('0x0'));var util=require(_0x2c8c('0x1'));var path=require(_0x2c8c('0x2'));var timeout=require('connect-timeout');var express=require(_0x2c8c('0x3'));var router=express[_0x2c8c('0x4')]();var auth=require(_0x2c8c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2c8c('0x6'));var controller=require(_0x2c8c('0x7'));router[_0x2c8c('0x8')]('/',auth[_0x2c8c('0x9')](),controller[_0x2c8c('0xa')]);router[_0x2c8c('0x8')]('/describe',auth[_0x2c8c('0x9')](),controller['describe']);router[_0x2c8c('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x2c8c('0x9')](),controller[_0x2c8c('0xb')]);router['put'](_0x2c8c('0xc'),auth[_0x2c8c('0x9')](),controller['update']);router['delete'](_0x2c8c('0xc'),auth[_0x2c8c('0x9')](),controller['destroy']);module[_0x2c8c('0xd')]=router; \ No newline at end of file +var _0x4962=['index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0x4962,0x1c5));var _0x2496=function(_0x9bfa21,_0x7df622){_0x9bfa21=_0x9bfa21-0x0;var _0x4afc1b=_0x4962[_0x9bfa21];return _0x4afc1b;};'use strict';var multer=require(_0x2496('0x0'));var util=require(_0x2496('0x1'));var path=require('path');var timeout=require(_0x2496('0x2'));var express=require(_0x2496('0x3'));var router=express[_0x2496('0x4')]();var auth=require(_0x2496('0x5'));var interaction=require(_0x2496('0x6'));var config=require('../../config/environment');var controller=require(_0x2496('0x7'));router[_0x2496('0x8')]('/',auth['isAuthenticated'](),controller[_0x2496('0x9')]);router['get'](_0x2496('0xa'),auth['isAuthenticated'](),controller[_0x2496('0xb')]);router[_0x2496('0x8')](_0x2496('0xc'),auth[_0x2496('0xd')](),controller[_0x2496('0xe')]);router[_0x2496('0xf')]('/',auth[_0x2496('0xd')](),controller[_0x2496('0x10')]);router[_0x2496('0x11')](_0x2496('0xc'),auth[_0x2496('0xd')](),controller[_0x2496('0x12')]);router[_0x2496('0x13')]('/:id',auth[_0x2496('0xd')](),controller[_0x2496('0x14')]);module[_0x2496('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 9496c9b..9469410 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 _0x9f07=['sequelize','exports','STRING','TEXT'];(function(_0x346dac,_0x374255){var _0x4352f5=function(_0x223b24){while(--_0x223b24){_0x346dac['push'](_0x346dac['shift']());}};_0x4352f5(++_0x374255);}(_0x9f07,0x13c));var _0x79f0=function(_0x710e00,_0x223d70){_0x710e00=_0x710e00-0x0;var _0x581ba7=_0x9f07[_0x710e00];return _0x581ba7;};'use strict';var Sequelize=require(_0x79f0('0x0'));module[_0x79f0('0x1')]={'uniqueid':{'type':Sequelize[_0x79f0('0x2')]},'node':{'type':Sequelize[_0x79f0('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x79f0('0x3')]},'project_name':{'type':Sequelize[_0x79f0('0x2')]},'callerid':{'type':Sequelize[_0x79f0('0x2')]}}; \ No newline at end of file +var _0x576a=['TEXT','STRING'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x576a,0x18d));var _0xa576=function(_0xfffb49,_0x24bcbe){_0xfffb49=_0xfffb49-0x0;var _0x4cca64=_0x576a[_0xfffb49];return _0x4cca64;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xa576('0x0')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xa576('0x1')]},'project_name':{'type':Sequelize[_0xa576('0x0')]},'callerid':{'type':Sequelize[_0xa576('0x0')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 77f9ea4..d1f9c97 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 _0xb575=['options','includeAll','include','findAll','catch','show','params','find','create','body','describe','html-pdf','eml-format','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','SquareDetailsReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xb575,0xda));var _0x5b57=function(_0x2b2713,_0x58dddf){_0x2b2713=_0x2b2713-0x0;var _0x19d05c=_0xb575[_0x2b2713];return _0x19d05c;};'use strict';var pdf=require(_0x5b57('0x0'));var emlformat=require(_0x5b57('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5b57('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5b57('0x3'));var Mustache=require(_0x5b57('0x4'));var util=require('util');var path=require(_0x5b57('0x5'));var sox=require(_0x5b57('0x6'));var csv=require(_0x5b57('0x7'));var ejs=require(_0x5b57('0x8'));var fs=require('fs');var _=require(_0x5b57('0x9'));var squel=require('squel');var crypto=require(_0x5b57('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5b57('0xb'));var toCsv=require(_0x5b57('0x7'));var querystring=require(_0x5b57('0xc'));var Papa=require('papaparse');var authService=require(_0x5b57('0xd'));var hardwareService=require(_0x5b57('0xe'));var Redis=require(_0x5b57('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x5b57('0x10'))(_0x5b57('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5b57('0x12'))['db'];function respondWithStatusCode(_0x4340d0,_0x30437b){_0x30437b=_0x30437b||0xcc;return function(_0xd897ba){if(_0xd897ba){return _0x4340d0[_0x5b57('0x13')](_0x30437b);}return _0x4340d0[_0x5b57('0x14')](_0x30437b)[_0x5b57('0x15')]();};}function respondWithResult(_0x309743,_0x3b728d){_0x3b728d=_0x3b728d||0xc8;return function(_0x42ba90){if(_0x42ba90){return _0x309743['status'](_0x3b728d)[_0x5b57('0x16')](_0x42ba90);}};}function respondWithFilteredResult(_0x3182cf,_0x297c96){return function(_0x4ba858){if(_0x4ba858){var _0x2a0a1b=_0x4ba858[_0x5b57('0x17')],_0x3b4631=_0x297c96[_0x5b57('0x18')],_0x132430=_0x297c96[_0x5b57('0x18')]+_0x297c96[_0x5b57('0x19')],_0x770fc3;if(_0x132430>=_0x2a0a1b){_0x132430=_0x2a0a1b;_0x770fc3=0xc8;}else{_0x770fc3=0xce;}_0x3182cf['status'](_0x770fc3);return _0x3182cf[_0x5b57('0x1a')](_0x5b57('0x1b'),_0x3b4631+'-'+_0x132430+'/'+_0x2a0a1b)[_0x5b57('0x16')](_0x4ba858);}return null;};}function patchUpdates(_0x137899){return function(_0x30f8d4){try{jsonpatch[_0x5b57('0x1c')](_0x30f8d4,_0x137899,!![]);}catch(_0x5f0dc6){return BPromise[_0x5b57('0x1d')](_0x5f0dc6);}return _0x30f8d4[_0x5b57('0x1e')]();};}function saveUpdates(_0x41df30,_0x412b62){return function(_0x53378c){if(_0x53378c){return _0x53378c[_0x5b57('0x1f')](_0x41df30)[_0x5b57('0x20')](function(_0x3cb5c0){return _0x3cb5c0;});}return null;};}function removeEntity(_0x4d8f86,_0xebf383){return function(_0xd8567a){if(_0xd8567a){return _0xd8567a[_0x5b57('0x21')]()[_0x5b57('0x20')](function(){_0x4d8f86[_0x5b57('0x14')](0xcc)[_0x5b57('0x15')]();});}};}function handleEntityNotFound(_0x4a4ed8,_0x139214){return function(_0x50ea5f){if(!_0x50ea5f){_0x4a4ed8[_0x5b57('0x13')](0x194);}return _0x50ea5f;};}function handleError(_0x38a3b3,_0x5a4961){_0x5a4961=_0x5a4961||0x1f4;return function(_0x52e4b0){logger[_0x5b57('0x22')](_0x52e4b0['stack']);if(_0x52e4b0[_0x5b57('0x23')]){delete _0x52e4b0[_0x5b57('0x23')];}_0x38a3b3[_0x5b57('0x14')](_0x5a4961)[_0x5b57('0x24')](_0x52e4b0);};}exports[_0x5b57('0x25')]=function(_0x17ac8b,_0x43a231){var _0x10ee0f={},_0xf0375b={},_0x31c4a5={'count':0x0,'rows':[]};var _0x39a007=db[_0x5b57('0x26')][_0x5b57('0x27')];_0xf0375b[_0x5b57('0x28')]=_[_0x5b57('0x29')](_0x39a007);_0xf0375b[_0x5b57('0x2a')]=_[_0x5b57('0x29')](_0x17ac8b['query']);_0xf0375b[_0x5b57('0x2b')]=_['intersection'](_0xf0375b[_0x5b57('0x28')],_0xf0375b[_0x5b57('0x2a')]);_0x10ee0f[_0x5b57('0x2c')]=_[_0x5b57('0x2d')](_0xf0375b[_0x5b57('0x28')],qs[_0x5b57('0x2e')](_0x17ac8b['query'][_0x5b57('0x2e')]));_0x10ee0f[_0x5b57('0x2c')]=_0x10ee0f[_0x5b57('0x2c')][_0x5b57('0x2f')]?_0x10ee0f[_0x5b57('0x2c')]:_0xf0375b['model'];if(!_0x17ac8b[_0x5b57('0x2a')]['hasOwnProperty'](_0x5b57('0x30'))){_0x10ee0f['limit']=qs[_0x5b57('0x19')](_0x17ac8b[_0x5b57('0x2a')][_0x5b57('0x19')]);_0x10ee0f[_0x5b57('0x18')]=qs[_0x5b57('0x18')](_0x17ac8b[_0x5b57('0x2a')][_0x5b57('0x18')]);}_0x10ee0f[_0x5b57('0x31')]=qs[_0x5b57('0x32')](_0x17ac8b[_0x5b57('0x2a')]['sort']);_0x10ee0f[_0x5b57('0x33')]=qs[_0x5b57('0x2b')](_[_0x5b57('0x34')](_0x17ac8b[_0x5b57('0x2a')],_0xf0375b[_0x5b57('0x2b')]));if(_0x17ac8b[_0x5b57('0x2a')][_0x5b57('0x35')]){_0x10ee0f[_0x5b57('0x33')]=_[_0x5b57('0x36')](_0x10ee0f[_0x5b57('0x33')],{'$or':_[_0x5b57('0x37')](_0x39a007,function(_0x457589){if(_0x457589[_0x5b57('0x38')][_0x5b57('0x39')]!=='VIRTUAL'){var _0x4155ac={};_0x4155ac[_0x457589['field']]={'$like':'%'+_0x17ac8b[_0x5b57('0x2a')][_0x5b57('0x35')]+'%'};return _0x4155ac;}})});}_0x10ee0f=_[_0x5b57('0x36')]({},_0x10ee0f,_0x17ac8b[_0x5b57('0x3a')]);var _0x6e1f94={'where':_0x10ee0f[_0x5b57('0x33')]};return db[_0x5b57('0x26')]['count'](_0x6e1f94)[_0x5b57('0x20')](function(_0x1ec1dc){_0x31c4a5[_0x5b57('0x17')]=_0x1ec1dc;if(_0x17ac8b['query'][_0x5b57('0x3b')]){_0x10ee0f[_0x5b57('0x3c')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x5b57('0x3d')](_0x10ee0f);})[_0x5b57('0x20')](function(_0xa417ce){_0x31c4a5['rows']=_0xa417ce;return _0x31c4a5;})['then'](respondWithFilteredResult(_0x43a231,_0x10ee0f))[_0x5b57('0x3e')](handleError(_0x43a231,null));};exports[_0x5b57('0x3f')]=function(_0x529d25,_0x1a20ef){var _0x545f92={'raw':!![],'where':{'id':_0x529d25[_0x5b57('0x40')]['id']}},_0xd6bda6={};_0xd6bda6['model']=_[_0x5b57('0x29')](db[_0x5b57('0x26')][_0x5b57('0x27')]);_0xd6bda6[_0x5b57('0x2a')]=_[_0x5b57('0x29')](_0x529d25[_0x5b57('0x2a')]);_0xd6bda6[_0x5b57('0x2b')]=_['intersection'](_0xd6bda6['model'],_0xd6bda6[_0x5b57('0x2a')]);_0x545f92['attributes']=_[_0x5b57('0x2d')](_0xd6bda6['model'],qs[_0x5b57('0x2e')](_0x529d25[_0x5b57('0x2a')][_0x5b57('0x2e')]));_0x545f92[_0x5b57('0x2c')]=_0x545f92[_0x5b57('0x2c')][_0x5b57('0x2f')]?_0x545f92[_0x5b57('0x2c')]:_0xd6bda6[_0x5b57('0x28')];if(_0x529d25[_0x5b57('0x2a')][_0x5b57('0x3b')]){_0x545f92[_0x5b57('0x3c')]=[{'all':!![]}];}_0x545f92=_[_0x5b57('0x36')]({},_0x545f92,_0x529d25[_0x5b57('0x3a')]);return db[_0x5b57('0x26')][_0x5b57('0x41')](_0x545f92)[_0x5b57('0x20')](handleEntityNotFound(_0x1a20ef,null))[_0x5b57('0x20')](respondWithResult(_0x1a20ef,null))[_0x5b57('0x3e')](handleError(_0x1a20ef,null));};exports[_0x5b57('0x42')]=function(_0x56dcb1,_0x3d50ef){return db[_0x5b57('0x26')][_0x5b57('0x42')](_0x56dcb1['body'],{})[_0x5b57('0x20')](respondWithResult(_0x3d50ef,0xc9))[_0x5b57('0x3e')](handleError(_0x3d50ef,null));};exports[_0x5b57('0x1f')]=function(_0x3f3f64,_0x53937e){if(_0x3f3f64['body']['id']){delete _0x3f3f64['body']['id'];}return db[_0x5b57('0x26')][_0x5b57('0x41')]({'where':{'id':_0x3f3f64['params']['id']}})[_0x5b57('0x20')](handleEntityNotFound(_0x53937e,null))[_0x5b57('0x20')](saveUpdates(_0x3f3f64[_0x5b57('0x43')],null))[_0x5b57('0x20')](respondWithResult(_0x53937e,null))[_0x5b57('0x3e')](handleError(_0x53937e,null));};exports[_0x5b57('0x21')]=function(_0x22ea65,_0x2027b4){return db[_0x5b57('0x26')][_0x5b57('0x41')]({'where':{'id':_0x22ea65[_0x5b57('0x40')]['id']}})[_0x5b57('0x20')](handleEntityNotFound(_0x2027b4,null))[_0x5b57('0x20')](removeEntity(_0x2027b4,null))[_0x5b57('0x3e')](handleError(_0x2027b4,null));};exports[_0x5b57('0x44')]=function(_0x3e32f5,_0x22b024){return db[_0x5b57('0x26')][_0x5b57('0x44')]()[_0x5b57('0x20')](respondWithResult(_0x22b024,null))[_0x5b57('0x3e')](handleError(_0x22b024,null));}; \ No newline at end of file +var _0xf394=['rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','type','key','VIRTUAL','rows','show','params','includeAll','include','find','catch','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','offset','limit','Content-Range','reject','update','then','end','sendStatus','error','name','index','SquareDetailsReport'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xf394,0xa9));var _0x4f39=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf394[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require(_0x4f39('0x0'));var emlformat=require(_0x4f39('0x1'));var rimraf=require(_0x4f39('0x2'));var zipdir=require(_0x4f39('0x3'));var jsonpatch=require(_0x4f39('0x4'));var rp=require(_0x4f39('0x5'));var moment=require(_0x4f39('0x6'));var BPromise=require(_0x4f39('0x7'));var Mustache=require(_0x4f39('0x8'));var util=require(_0x4f39('0x9'));var path=require(_0x4f39('0xa'));var sox=require(_0x4f39('0xb'));var csv=require('to-csv');var ejs=require(_0x4f39('0xc'));var fs=require('fs');var _=require(_0x4f39('0xd'));var squel=require(_0x4f39('0xe'));var crypto=require('crypto');var jsforce=require(_0x4f39('0xf'));var deskjs=require(_0x4f39('0x10'));var toCsv=require(_0x4f39('0x11'));var querystring=require(_0x4f39('0x12'));var Papa=require(_0x4f39('0x13'));var authService=require('../../components/auth/service');var hardwareService=require(_0x4f39('0x14'));var Redis=require(_0x4f39('0x15'));var qs=require('../../components/parsers/qs');var logger=require(_0x4f39('0x16'))(_0x4f39('0x17'));var utils=require(_0x4f39('0x18'));var config=require('../../config/environment');var db=require(_0x4f39('0x19'))['db'];function respondWithStatusCode(_0x401a4b,_0x2eda0b){_0x2eda0b=_0x2eda0b||0xcc;return function(_0x38f065){if(_0x38f065){return _0x401a4b['sendStatus'](_0x2eda0b);}return _0x401a4b[_0x4f39('0x1a')](_0x2eda0b)['end']();};}function respondWithResult(_0x1017a2,_0x1889c2){_0x1889c2=_0x1889c2||0xc8;return function(_0x258592){if(_0x258592){return _0x1017a2['status'](_0x1889c2)[_0x4f39('0x1b')](_0x258592);}};}function respondWithFilteredResult(_0xf660e2,_0x3ad97c){return function(_0x21c3d4){if(_0x21c3d4){var _0x5ef241=_0x21c3d4[_0x4f39('0x1c')],_0x22f61e=_0x3ad97c[_0x4f39('0x1d')],_0x466ecc=_0x3ad97c[_0x4f39('0x1d')]+_0x3ad97c[_0x4f39('0x1e')],_0x4e214d;if(_0x466ecc>=_0x5ef241){_0x466ecc=_0x5ef241;_0x4e214d=0xc8;}else{_0x4e214d=0xce;}_0xf660e2[_0x4f39('0x1a')](_0x4e214d);return _0xf660e2['set'](_0x4f39('0x1f'),_0x22f61e+'-'+_0x466ecc+'/'+_0x5ef241)[_0x4f39('0x1b')](_0x21c3d4);}return null;};}function patchUpdates(_0x1881cc){return function(_0x12c63b){try{jsonpatch['apply'](_0x12c63b,_0x1881cc,!![]);}catch(_0x10d8d9){return BPromise[_0x4f39('0x20')](_0x10d8d9);}return _0x12c63b['save']();};}function saveUpdates(_0x4f1c2f,_0x581ea4){return function(_0x564e38){if(_0x564e38){return _0x564e38[_0x4f39('0x21')](_0x4f1c2f)[_0x4f39('0x22')](function(_0x190c00){return _0x190c00;});}return null;};}function removeEntity(_0x51c441,_0x122f36){return function(_0x21f0c0){if(_0x21f0c0){return _0x21f0c0['destroy']()[_0x4f39('0x22')](function(){_0x51c441['status'](0xcc)[_0x4f39('0x23')]();});}};}function handleEntityNotFound(_0x5330ae,_0x47951c){return function(_0x387d73){if(!_0x387d73){_0x5330ae[_0x4f39('0x24')](0x194);}return _0x387d73;};}function handleError(_0x343dfc,_0x1bf096){_0x1bf096=_0x1bf096||0x1f4;return function(_0x384c9e){logger[_0x4f39('0x25')](_0x384c9e['stack']);if(_0x384c9e[_0x4f39('0x26')]){delete _0x384c9e[_0x4f39('0x26')];}_0x343dfc[_0x4f39('0x1a')](_0x1bf096)['send'](_0x384c9e);};}exports[_0x4f39('0x27')]=function(_0x580f54,_0x223a7c){var _0x13a19e={},_0x165950={},_0x5c595c={'count':0x0,'rows':[]};var _0x273f0c=db[_0x4f39('0x28')][_0x4f39('0x29')];_0x165950[_0x4f39('0x2a')]=_['keys'](_0x273f0c);_0x165950[_0x4f39('0x2b')]=_[_0x4f39('0x2c')](_0x580f54[_0x4f39('0x2b')]);_0x165950[_0x4f39('0x2d')]=_[_0x4f39('0x2e')](_0x165950[_0x4f39('0x2a')],_0x165950['query']);_0x13a19e['attributes']=_[_0x4f39('0x2e')](_0x165950[_0x4f39('0x2a')],qs[_0x4f39('0x2f')](_0x580f54[_0x4f39('0x2b')][_0x4f39('0x2f')]));_0x13a19e[_0x4f39('0x30')]=_0x13a19e[_0x4f39('0x30')]['length']?_0x13a19e['attributes']:_0x165950['model'];if(!_0x580f54[_0x4f39('0x2b')][_0x4f39('0x31')](_0x4f39('0x32'))){_0x13a19e[_0x4f39('0x1e')]=qs[_0x4f39('0x1e')](_0x580f54['query'][_0x4f39('0x1e')]);_0x13a19e['offset']=qs['offset'](_0x580f54[_0x4f39('0x2b')][_0x4f39('0x1d')]);}_0x13a19e[_0x4f39('0x33')]=qs[_0x4f39('0x34')](_0x580f54['query']['sort']);_0x13a19e['where']=qs[_0x4f39('0x2d')](_['pick'](_0x580f54[_0x4f39('0x2b')],_0x165950[_0x4f39('0x2d')]));if(_0x580f54[_0x4f39('0x2b')][_0x4f39('0x35')]){_0x13a19e[_0x4f39('0x36')]=_[_0x4f39('0x37')](_0x13a19e[_0x4f39('0x36')],{'$or':_[_0x4f39('0x38')](_0x273f0c,function(_0x22fdcc){if(_0x22fdcc[_0x4f39('0x39')][_0x4f39('0x3a')]!==_0x4f39('0x3b')){var _0x2a6bd7={};_0x2a6bd7[_0x22fdcc['field']]={'$like':'%'+_0x580f54[_0x4f39('0x2b')][_0x4f39('0x35')]+'%'};return _0x2a6bd7;}})});}_0x13a19e=_['merge']({},_0x13a19e,_0x580f54['options']);var _0x31850b={'where':_0x13a19e[_0x4f39('0x36')]};return db[_0x4f39('0x28')][_0x4f39('0x1c')](_0x31850b)['then'](function(_0x55ec96){_0x5c595c[_0x4f39('0x1c')]=_0x55ec96;if(_0x580f54[_0x4f39('0x2b')]['includeAll']){_0x13a19e['include']=[{'all':!![]}];}return db[_0x4f39('0x28')]['findAll'](_0x13a19e);})[_0x4f39('0x22')](function(_0x42c7d9){_0x5c595c[_0x4f39('0x3c')]=_0x42c7d9;return _0x5c595c;})['then'](respondWithFilteredResult(_0x223a7c,_0x13a19e))['catch'](handleError(_0x223a7c,null));};exports[_0x4f39('0x3d')]=function(_0x1795cd,_0x183275){var _0x4367d1={'raw':!![],'where':{'id':_0x1795cd[_0x4f39('0x3e')]['id']}},_0x36fbff={};_0x36fbff['model']=_[_0x4f39('0x2c')](db[_0x4f39('0x28')]['rawAttributes']);_0x36fbff[_0x4f39('0x2b')]=_[_0x4f39('0x2c')](_0x1795cd[_0x4f39('0x2b')]);_0x36fbff[_0x4f39('0x2d')]=_['intersection'](_0x36fbff[_0x4f39('0x2a')],_0x36fbff[_0x4f39('0x2b')]);_0x4367d1[_0x4f39('0x30')]=_['intersection'](_0x36fbff[_0x4f39('0x2a')],qs['fields'](_0x1795cd[_0x4f39('0x2b')][_0x4f39('0x2f')]));_0x4367d1[_0x4f39('0x30')]=_0x4367d1['attributes']['length']?_0x4367d1[_0x4f39('0x30')]:_0x36fbff['model'];if(_0x1795cd[_0x4f39('0x2b')][_0x4f39('0x3f')]){_0x4367d1[_0x4f39('0x40')]=[{'all':!![]}];}_0x4367d1=_['merge']({},_0x4367d1,_0x1795cd['options']);return db[_0x4f39('0x28')][_0x4f39('0x41')](_0x4367d1)['then'](handleEntityNotFound(_0x183275,null))[_0x4f39('0x22')](respondWithResult(_0x183275,null))[_0x4f39('0x42')](handleError(_0x183275,null));};exports['create']=function(_0x10a6b1,_0x4b2b1f){return db['SquareDetailsReport']['create'](_0x10a6b1[_0x4f39('0x43')],{})[_0x4f39('0x22')](respondWithResult(_0x4b2b1f,0xc9))[_0x4f39('0x42')](handleError(_0x4b2b1f,null));};exports[_0x4f39('0x21')]=function(_0x195df7,_0x49d76c){if(_0x195df7[_0x4f39('0x43')]['id']){delete _0x195df7[_0x4f39('0x43')]['id'];}return db['SquareDetailsReport'][_0x4f39('0x41')]({'where':{'id':_0x195df7['params']['id']}})[_0x4f39('0x22')](handleEntityNotFound(_0x49d76c,null))[_0x4f39('0x22')](saveUpdates(_0x195df7[_0x4f39('0x43')],null))[_0x4f39('0x22')](respondWithResult(_0x49d76c,null))['catch'](handleError(_0x49d76c,null));};exports[_0x4f39('0x44')]=function(_0x882e58,_0x4ebd18){return db[_0x4f39('0x28')][_0x4f39('0x41')]({'where':{'id':_0x882e58[_0x4f39('0x3e')]['id']}})[_0x4f39('0x22')](handleEntityNotFound(_0x4ebd18,null))['then'](removeEntity(_0x4ebd18,null))[_0x4f39('0x42')](handleError(_0x4ebd18,null));};exports[_0x4f39('0x45')]=function(_0x34e70d,_0x4e4dee){return db[_0x4f39('0x28')][_0x4f39('0x45')]()['then'](respondWithResult(_0x4e4dee,null))[_0x4f39('0x42')](handleError(_0x4e4dee,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 6870d42..dc5ae01 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 _0xb3c3=['exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','./squareReportDetail.attributes'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb3c3,0xe0));var _0x3b3c=function(_0xed3104,_0x1319ce){_0xed3104=_0xed3104-0x0;var _0x5d6b91=_0xb3c3[_0xed3104];return _0x5d6b91;};'use strict';var _=require(_0x3b3c('0x0'));var util=require(_0x3b3c('0x1'));var logger=require(_0x3b3c('0x2'))(_0x3b3c('0x3'));var moment=require(_0x3b3c('0x4'));var BPromise=require(_0x3b3c('0x5'));var rp=require('request-promise');var attributes=require(_0x3b3c('0x6'));module[_0x3b3c('0x7')]=function(_0x20bc66,_0x4f3eac){return _0x20bc66[_0x3b3c('0x8')](_0x3b3c('0x9'),attributes,{'tableName':_0x3b3c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa990=['request-promise','exports','define','SquareDetailsReport','report_square_details','lodash','util','api','moment'];(function(_0x3cddcb,_0x5e0bbd){var _0x3878e8=function(_0x12afc9){while(--_0x12afc9){_0x3cddcb['push'](_0x3cddcb['shift']());}};_0x3878e8(++_0x5e0bbd);}(_0xa990,0xb0));var _0x0a99=function(_0x2398a5,_0x1823e9){_0x2398a5=_0x2398a5-0x0;var _0x646ee9=_0xa990[_0x2398a5];return _0x646ee9;};'use strict';var _=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var logger=require('../../config/logger')(_0x0a99('0x2'));var moment=require(_0x0a99('0x3'));var BPromise=require('bluebird');var rp=require(_0x0a99('0x4'));var attributes=require('./squareReportDetail.attributes');module[_0x0a99('0x5')]=function(_0xa534e2,_0x3fe165){return _0xa534e2[_0x0a99('0x6')](_0x0a99('0x7'),attributes,{'tableName':_0x0a99('0x8'),'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 9f6fbcc..1fb661b 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 _0x861a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','SquareDetailsReport','body','options','raw','CreateSquareDetailsReport','catch','lodash'];(function(_0x55946d,_0x3e3b78){var _0x220c13=function(_0xdbb1b8){while(--_0xdbb1b8){_0x55946d['push'](_0x55946d['shift']());}};_0x220c13(++_0x3e3b78);}(_0x861a,0x194));var _0xa861=function(_0x5ec7b9,_0x2fdb1d){_0x5ec7b9=_0x5ec7b9-0x0;var _0x40ed6b=_0x861a[_0x5ec7b9];return _0x40ed6b;};'use strict';var _=require(_0xa861('0x0'));var util=require('util');var moment=require(_0xa861('0x1'));var BPromise=require(_0xa861('0x2'));var rs=require(_0xa861('0x3'));var fs=require('fs');var Redis=require(_0xa861('0x4'));var db=require(_0xa861('0x5'))['db'];var utils=require(_0xa861('0x6'));var logger=require('../../config/logger')(_0xa861('0x7'));var config=require(_0xa861('0x8'));var jayson=require(_0xa861('0x9'));var client=jayson[_0xa861('0xa')][_0xa861('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bc6cb,_0x2c9016,_0x410918){return new BPromise(function(_0x46e2ce,_0x300ab7){return client[_0xa861('0xc')](_0x5bc6cb,_0x410918)[_0xa861('0xd')](function(_0x24e3ad){logger[_0xa861('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x2c9016,'request\x20sent');logger[_0xa861('0xf')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x2c9016,'request\x20sent',JSON[_0xa861('0x10')](_0x24e3ad));if(_0x24e3ad[_0xa861('0x11')]){if(_0x24e3ad[_0xa861('0x11')]['code']===0x1f4){logger[_0xa861('0x11')](_0xa861('0x12'),_0x2c9016,_0x24e3ad[_0xa861('0x11')][_0xa861('0x13')]);return _0x300ab7(_0x24e3ad[_0xa861('0x11')]['message']);}logger['error'](_0xa861('0x12'),_0x2c9016,_0x24e3ad['error']['message']);return _0x46e2ce(_0x24e3ad[_0xa861('0x11')][_0xa861('0x13')]);}else{logger[_0xa861('0xe')](_0xa861('0x12'),_0x2c9016,'request\x20sent');_0x46e2ce(_0x24e3ad[_0xa861('0x14')]['message']);}})['catch'](function(_0x5503fd){logger[_0xa861('0x11')](_0xa861('0x12'),_0x2c9016,_0x5503fd);_0x300ab7(_0x5503fd);});});}exports['CreateSquareDetailsReport']=function(_0xc85eb3){var _0x270452=this;return new Promise(function(_0x2cbdae,_0xad0811){return db[_0xa861('0x15')]['create'](_0xc85eb3[_0xa861('0x16')],{'raw':_0xc85eb3[_0xa861('0x17')]?_0xc85eb3[_0xa861('0x17')][_0xa861('0x18')]===undefined?!![]:![]:!![]})[_0xa861('0xd')](function(_0x52ca65){logger[_0xa861('0xe')](_0xa861('0x19'),_0xc85eb3);logger[_0xa861('0xf')]('CreateSquareDetailsReport',_0xc85eb3,JSON[_0xa861('0x10')](_0x52ca65));_0x2cbdae(_0x52ca65);})[_0xa861('0x1a')](function(_0x58270d){logger[_0xa861('0x11')](_0xa861('0x19'),_0x58270d[_0xa861('0x13')],_0xc85eb3);_0xad0811(_0x270452['error'](0x1f4,_0x58270d[_0xa861('0x13')]));});});}; \ No newline at end of file +var _0x4b47=['create','body','options','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport'];(function(_0x158f54,_0x28bd12){var _0x2faf3c=function(_0x9457a6){while(--_0x9457a6){_0x158f54['push'](_0x158f54['shift']());}};_0x2faf3c(++_0x28bd12);}(_0x4b47,0x1b4));var _0x74b4=function(_0x560f55,_0x1372c1){_0x560f55=_0x560f55-0x0;var _0x499fa4=_0x4b47[_0x560f55];return _0x499fa4;};'use strict';var _=require(_0x74b4('0x0'));var util=require('util');var moment=require(_0x74b4('0x1'));var BPromise=require(_0x74b4('0x2'));var rs=require(_0x74b4('0x3'));var fs=require('fs');var Redis=require(_0x74b4('0x4'));var db=require(_0x74b4('0x5'))['db'];var utils=require(_0x74b4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x74b4('0x7'));var jayson=require(_0x74b4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x482278,_0x43b434,_0x75ea22){return new BPromise(function(_0x1ebbb8,_0x318a0a){return client[_0x74b4('0x9')](_0x482278,_0x75ea22)['then'](function(_0x531be6){logger[_0x74b4('0xa')](_0x74b4('0xb'),_0x43b434,'request\x20sent');logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x43b434,_0x74b4('0xc'),JSON[_0x74b4('0xd')](_0x531be6));if(_0x531be6[_0x74b4('0xe')]){if(_0x531be6[_0x74b4('0xe')]['code']===0x1f4){logger[_0x74b4('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x43b434,_0x531be6[_0x74b4('0xe')]['message']);return _0x318a0a(_0x531be6[_0x74b4('0xe')][_0x74b4('0xf')]);}logger[_0x74b4('0xe')](_0x74b4('0xb'),_0x43b434,_0x531be6['error'][_0x74b4('0xf')]);return _0x1ebbb8(_0x531be6[_0x74b4('0xe')]['message']);}else{logger[_0x74b4('0xa')](_0x74b4('0xb'),_0x43b434,_0x74b4('0xc'));_0x1ebbb8(_0x531be6[_0x74b4('0x10')]['message']);}})[_0x74b4('0x11')](function(_0x3906ad){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x43b434,_0x3906ad);_0x318a0a(_0x3906ad);});});}exports[_0x74b4('0x12')]=function(_0x9bbab0){var _0x100630=this;return new Promise(function(_0x4141bb,_0x11c268){return db[_0x74b4('0x13')][_0x74b4('0x14')](_0x9bbab0[_0x74b4('0x15')],{'raw':_0x9bbab0[_0x74b4('0x16')]?_0x9bbab0[_0x74b4('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3d74d4){logger[_0x74b4('0xa')]('CreateSquareDetailsReport',_0x9bbab0);logger[_0x74b4('0x17')]('CreateSquareDetailsReport',_0x9bbab0,JSON['stringify'](_0x3d74d4));_0x4141bb(_0x3d74d4);})[_0x74b4('0x11')](function(_0x437f79){logger[_0x74b4('0xe')](_0x74b4('0x12'),_0x437f79['message'],_0x9bbab0);_0x11c268(_0x100630['error'](0x1f4,_0x437f79[_0x74b4('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 4fb2ce9..5f719e2 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 _0x61f7=['get','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','./system.controller','isAuthenticated'];(function(_0x3b689d,_0x20f0f0){var _0x18ce54=function(_0x41622b){while(--_0x41622b){_0x3b689d['push'](_0x3b689d['shift']());}};_0x18ce54(++_0x20f0f0);}(_0x61f7,0x1bd));var _0x761f=function(_0x5c9071,_0x47fc9a){_0x5c9071=_0x5c9071-0x0;var _0x247145=_0x61f7[_0x5c9071];return _0x247145;};'use strict';var express=require(_0x761f('0x0'));var router=express[_0x761f('0x1')]();var auth=require(_0x761f('0x2'));var controller=require(_0x761f('0x3'));router['get']('/',auth[_0x761f('0x4')](),controller['index']);router[_0x761f('0x5')](_0x761f('0x6'),auth['isAuthenticated'](),controller[_0x761f('0x7')]);module[_0x761f('0x8')]=router; \ No newline at end of file +var _0x5007=['get','index','isAuthenticated','killProcess','exports','express','Router','../../components/auth/service','./system.controller'];(function(_0x6dda45,_0x132e99){var _0x3e8915=function(_0x2e7395){while(--_0x2e7395){_0x6dda45['push'](_0x6dda45['shift']());}};_0x3e8915(++_0x132e99);}(_0x5007,0xcb));var _0x7500=function(_0x4c9f24,_0x3caf4f){_0x4c9f24=_0x4c9f24-0x0;var _0x35391d=_0x5007[_0x4c9f24];return _0x35391d;};'use strict';var express=require(_0x7500('0x0'));var router=express[_0x7500('0x1')]();var auth=require(_0x7500('0x2'));var controller=require(_0x7500('0x3'));router[_0x7500('0x4')]('/',auth['isAuthenticated'](),controller[_0x7500('0x5')]);router[_0x7500('0x4')]('/process/:pid/kill',auth[_0x7500('0x6')](),controller[_0x7500('0x7')]);module[_0x7500('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index c0e2a28..19b2bf8 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 _0xd186=['ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','systeminformation','child_process','api','util','lodash','error','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format'];(function(_0x2eacc6,_0xb3e1f6){var _0x30c890=function(_0x1b3020){while(--_0x1b3020){_0x2eacc6['push'](_0x2eacc6['shift']());}};_0x30c890(++_0xb3e1f6);}(_0xd186,0x197));var _0x6d18=function(_0x715542,_0xba7a78){_0x715542=_0x715542-0x0;var _0x16ba3a=_0xd186[_0x715542];return _0x16ba3a;};'use strict';var info=require(_0x6d18('0x0'));var exec=require(_0x6d18('0x1'))['exec'];var logger=require('../../config/logger')(_0x6d18('0x2'));var util=require(_0x6d18('0x3'));var BPromise=require('bluebird');var _=require(_0x6d18('0x4'));function handleError(_0x19c41a,_0x150d80,_0x4b211c){_0x150d80=_0x150d80||0x1f4;return function(_0x595411){logger[_0x6d18('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x4b211c,_0x150d80,util[_0x6d18('0x6')](_0x595411,{'showHidden':![],'depth':null}));delete _0x595411[_0x6d18('0x7')];_0x19c41a[_0x6d18('0x8')](_0x150d80)[_0x6d18('0x9')](_0x595411);};}exports[_0x6d18('0xa')]=function(_0x1dff15,_0x23abb5){return info[_0x6d18('0xb')]()[_0x6d18('0xc')](function(_0x1c6c78){return _0x23abb5['status'](0xc8)[_0x6d18('0xd')](_0x1c6c78);})[_0x6d18('0xe')](function(_0x2ef93b){return _0x23abb5[_0x6d18('0x8')](0x1f4)[_0x6d18('0xd')](_0x2ef93b);});};exports[_0x6d18('0xf')]=function(_0x221b6f,_0x37444e){var _0x3dbdbb=[_0x6d18('0x10')];return new BPromise(function(_0x5f0a54,_0x344cbb){return exec(util[_0x6d18('0x11')](_0x6d18('0x12'),_0x221b6f[_0x6d18('0x13')][_0x6d18('0x14')]),function(_0x13a6cd,_0x27b5f0,_0xad1255){if(_0x13a6cd){return _0x344cbb(_0x13a6cd);}return _0x5f0a54(_0x27b5f0);});})[_0x6d18('0xc')](function(_0x130969){var _0x4240c6=![];var _0xadf1f8=_0x130969[_0x6d18('0x15')](/\n/);for(var _0xfd1267=0x0,_0x4c3b9b=_0x3dbdbb['length'];_0xfd1267<_0x4c3b9b,_0x4240c6===![];_0xfd1267+=0x1){if(_0x130969[_0x6d18('0x16')](_0x3dbdbb[_0xfd1267])>=0x0){_0x4240c6=!![];}}if(!_0x4240c6){throw new Error(util[_0x6d18('0x11')](_0x6d18('0x17'),_0x221b6f[_0x6d18('0x13')][_0x6d18('0x14')]));}process['kill'](_0x221b6f[_0x6d18('0x13')]['pid'],_0x6d18('0x18'));return _0x37444e['status'](0xc8)[_0x6d18('0xd')]({'message':util[_0x6d18('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x221b6f[_0x6d18('0x13')][_0x6d18('0x14')])});})[_0x6d18('0xe')](handleError(_0x37444e,null,'killProcess'));}; \ No newline at end of file +var _0x8b24=['bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','send','getAllData','then','json','killProcess','format','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','SIGINT','status','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','api','util'];(function(_0x22f7d1,_0x19996f){var _0x32967b=function(_0x516fc3){while(--_0x516fc3){_0x22f7d1['push'](_0x22f7d1['shift']());}};_0x32967b(++_0x19996f);}(_0x8b24,0x1e8));var _0x48b2=function(_0x477c6b,_0x73b37e){_0x477c6b=_0x477c6b-0x0;var _0x1ecdcc=_0x8b24[_0x477c6b];return _0x1ecdcc;};'use strict';var info=require(_0x48b2('0x0'));var exec=require(_0x48b2('0x1'))[_0x48b2('0x2')];var logger=require(_0x48b2('0x3'))(_0x48b2('0x4'));var util=require(_0x48b2('0x5'));var BPromise=require(_0x48b2('0x6'));var _=require('lodash');function handleError(_0x38ea4a,_0x3bd045,_0x5b5689){_0x3bd045=_0x3bd045||0x1f4;return function(_0x4b816c){logger[_0x48b2('0x7')](_0x48b2('0x8'),_0x5b5689,_0x3bd045,util['inspect'](_0x4b816c,{'showHidden':![],'depth':null}));delete _0x4b816c[_0x48b2('0x9')];_0x38ea4a['status'](_0x3bd045)[_0x48b2('0xa')](_0x4b816c);};}exports['index']=function(_0x31f943,_0x5a1e14){return info[_0x48b2('0xb')]()[_0x48b2('0xc')](function(_0x510fca){return _0x5a1e14['status'](0xc8)[_0x48b2('0xd')](_0x510fca);})['catch'](function(_0x299215){return _0x5a1e14['status'](0x1f4)['json'](_0x299215);});};exports[_0x48b2('0xe')]=function(_0x5df67e,_0x3fe976){var _0x50657f=['components/import/cm'];return new BPromise(function(_0x4d9dd9,_0x58d120){return exec(util[_0x48b2('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x5df67e['params'][_0x48b2('0x10')]),function(_0x3f9d5b,_0x456221,_0x293302){if(_0x3f9d5b){return _0x58d120(_0x3f9d5b);}return _0x4d9dd9(_0x456221);});})['then'](function(_0x40f9e6){var _0x5e841d=![];var _0x24f16c=_0x40f9e6[_0x48b2('0x11')](/\n/);for(var _0x5714f3=0x0,_0x431ecf=_0x50657f[_0x48b2('0x12')];_0x5714f3<_0x431ecf,_0x5e841d===![];_0x5714f3+=0x1){if(_0x40f9e6[_0x48b2('0x13')](_0x50657f[_0x5714f3])>=0x0){_0x5e841d=!![];}}if(!_0x5e841d){throw new Error(util[_0x48b2('0xf')](_0x48b2('0x14'),_0x5df67e[_0x48b2('0x15')][_0x48b2('0x10')]));}process['kill'](_0x5df67e[_0x48b2('0x15')][_0x48b2('0x10')],_0x48b2('0x16'));return _0x3fe976[_0x48b2('0x17')](0xc8)[_0x48b2('0xd')]({'message':util[_0x48b2('0xf')](_0x48b2('0x18'),_0x5df67e[_0x48b2('0x15')][_0x48b2('0x10')])});})[_0x48b2('0x19')](handleError(_0x3fe976,null,_0x48b2('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 1b47e4f..7c53b48 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 _0x2032=['get','isAuthenticated','index','/:id','show','post','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./tag.controller'];(function(_0x597dd1,_0x3799a8){var _0x19783c=function(_0x30993b){while(--_0x30993b){_0x597dd1['push'](_0x597dd1['shift']());}};_0x19783c(++_0x3799a8);}(_0x2032,0xd9));var _0x2203=function(_0xfd0146,_0x49f267){_0xfd0146=_0xfd0146-0x0;var _0x55dee7=_0x2032[_0xfd0146];return _0x55dee7;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var auth=require(_0x2203('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2203('0x5'));var controller=require(_0x2203('0x6'));router[_0x2203('0x7')]('/',auth[_0x2203('0x8')](),controller[_0x2203('0x9')]);router[_0x2203('0x7')](_0x2203('0xa'),auth[_0x2203('0x8')](),controller[_0x2203('0xb')]);router[_0x2203('0xc')]('/',auth[_0x2203('0x8')](),controller['create']);router['put'](_0x2203('0xa'),auth['isAuthenticated'](),controller[_0x2203('0xd')]);router[_0x2203('0xe')](_0x2203('0xa'),auth['isAuthenticated'](),controller[_0x2203('0xf')]);module['exports']=router; \ No newline at end of file +var _0x14a0=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','put','/:id','destroy','exports','util','path'];(function(_0x56fb3c,_0x3474f2){var _0x2261f8=function(_0x382b0e){while(--_0x382b0e){_0x56fb3c['push'](_0x56fb3c['shift']());}};_0x2261f8(++_0x3474f2);}(_0x14a0,0x8e));var _0x014a=function(_0x10572c,_0x33255c){_0x10572c=_0x10572c-0x0;var _0x2af024=_0x14a0[_0x10572c];return _0x2af024;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var auth=require(_0x014a('0x5'));var interaction=require(_0x014a('0x6'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0x014a('0x7')]('/',auth[_0x014a('0x8')](),controller[_0x014a('0x9')]);router['get']('/:id',auth[_0x014a('0x8')](),controller[_0x014a('0xa')]);router[_0x014a('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x014a('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x014a('0xd'),auth['isAuthenticated'](),controller[_0x014a('0xe')]);module[_0x014a('0xf')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 1229f2b..e866a4c 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 _0xe2c4=['exports','STRING','name','sequelize'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xe2c4,0xf3));var _0x4e2c=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xe2c4[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0x4e2c('0x0'));module[_0x4e2c('0x1')]={'name':{'type':Sequelize[_0x4e2c('0x2')],'unique':_0x4e2c('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xca86=['sequelize','exports','STRING','name','#0091EA'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xca86,0x7d));var _0x6ca8=function(_0x5a412e,_0x13a9e6){_0x5a412e=_0x5a412e-0x0;var _0x305d5d=_0xca86[_0x5a412e];return _0x305d5d;};'use strict';var Sequelize=require(_0x6ca8('0x0'));module[_0x6ca8('0x1')]={'name':{'type':Sequelize[_0x6ca8('0x2')],'unique':_0x6ca8('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x6ca8('0x2')],'defaultValue':_0x6ca8('0x4')},'description':{'type':Sequelize[_0x6ca8('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index ff4210b..d6a50c5 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 _0x0adf=['util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','get','Tags','UserProfileResource','status','error','stack','name','send','index','Tag','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','map','type','key','VIRTUAL','merge','options','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x280f93,_0x583726){var _0x572fcd=function(_0x3f76a6){while(--_0x3f76a6){_0x280f93['push'](_0x280f93['shift']());}};_0x572fcd(++_0x583726);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x22ad23,_0x23199f){_0x22ad23=_0x22ad23-0x0;var _0x4707b1=_0x0adf[_0x22ad23];return _0x4707b1;};'use strict';var pdf=require(_0xf0ad('0x0'));var emlformat=require(_0xf0ad('0x1'));var rimraf=require(_0xf0ad('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf0ad('0x3'));var rp=require(_0xf0ad('0x4'));var moment=require(_0xf0ad('0x5'));var BPromise=require(_0xf0ad('0x6'));var Mustache=require(_0xf0ad('0x7'));var util=require(_0xf0ad('0x8'));var path=require(_0xf0ad('0x9'));var sox=require('sox');var csv=require(_0xf0ad('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf0ad('0xb'));var squel=require(_0xf0ad('0xc'));var crypto=require(_0xf0ad('0xd'));var jsforce=require(_0xf0ad('0xe'));var deskjs=require(_0xf0ad('0xf'));var toCsv=require(_0xf0ad('0xa'));var querystring=require(_0xf0ad('0x10'));var Papa=require('papaparse');var authService=require(_0xf0ad('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xf0ad('0x12'));var qs=require(_0xf0ad('0x13'));var logger=require(_0xf0ad('0x14'))(_0xf0ad('0x15'));var utils=require(_0xf0ad('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13ed94,_0x19892c){_0x19892c=_0x19892c||0xcc;return function(_0x3646a2){if(_0x3646a2){return _0x13ed94[_0xf0ad('0x17')](_0x19892c);}return _0x13ed94['status'](_0x19892c)[_0xf0ad('0x18')]();};}function respondWithResult(_0x198cd8,_0x5f2cfa){_0x5f2cfa=_0x5f2cfa||0xc8;return function(_0x49df92){if(_0x49df92){return _0x198cd8['status'](_0x5f2cfa)[_0xf0ad('0x19')](_0x49df92);}};}function respondWithFilteredResult(_0x513237,_0x1dad7b){return function(_0x313ad6){if(_0x313ad6){var _0xfa544c=_0x313ad6[_0xf0ad('0x1a')],_0xfa829e=_0x1dad7b[_0xf0ad('0x1b')],_0x237dd9=_0x1dad7b[_0xf0ad('0x1b')]+_0x1dad7b[_0xf0ad('0x1c')],_0x5c23ff;if(_0x237dd9>=_0xfa544c){_0x237dd9=_0xfa544c;_0x5c23ff=0xc8;}else{_0x5c23ff=0xce;}_0x513237['status'](_0x5c23ff);return _0x513237['set'](_0xf0ad('0x1d'),_0xfa829e+'-'+_0x237dd9+'/'+_0xfa544c)[_0xf0ad('0x19')](_0x313ad6);}return null;};}function patchUpdates(_0x49f2ec){return function(_0x32d05c){try{jsonpatch[_0xf0ad('0x1e')](_0x32d05c,_0x49f2ec,!![]);}catch(_0x9a95bf){return BPromise[_0xf0ad('0x1f')](_0x9a95bf);}return _0x32d05c['save']();};}function saveUpdates(_0x57c570,_0x3f8cf3){return function(_0x2da425){if(_0x2da425){return _0x2da425[_0xf0ad('0x20')](_0x57c570)[_0xf0ad('0x21')](function(_0x2ac8ba){return _0x2ac8ba;});}return null;};}function removeEntity(_0x22d50f,_0x4e874a){return function(_0x33c95d){if(_0x33c95d){return _0x33c95d[_0xf0ad('0x22')]()[_0xf0ad('0x21')](function(){var _0x3ece1e=_0x33c95d[_0xf0ad('0x23')]({'plain':!![]});var _0x88b47b=_0xf0ad('0x24');return db[_0xf0ad('0x25')][_0xf0ad('0x22')]({'where':{'type':_0x88b47b,'resourceId':_0x3ece1e['id']}})[_0xf0ad('0x21')](function(){return _0x33c95d;});})[_0xf0ad('0x21')](function(){_0x22d50f[_0xf0ad('0x26')](0xcc)[_0xf0ad('0x18')]();});}};}function handleEntityNotFound(_0x456f81,_0x879f89){return function(_0x557f90){if(!_0x557f90){_0x456f81[_0xf0ad('0x17')](0x194);}return _0x557f90;};}function handleError(_0x1507a3,_0x248794){_0x248794=_0x248794||0x1f4;return function(_0x7377d7){logger[_0xf0ad('0x27')](_0x7377d7[_0xf0ad('0x28')]);if(_0x7377d7['name']){delete _0x7377d7[_0xf0ad('0x29')];}_0x1507a3[_0xf0ad('0x26')](_0x248794)[_0xf0ad('0x2a')](_0x7377d7);};}exports[_0xf0ad('0x2b')]=function(_0x1b6880,_0x1ac25c){var _0x267b7a={},_0x1bee71={},_0x2386e8={'count':0x0,'rows':[]};var _0x39c46c=db[_0xf0ad('0x2c')]['rawAttributes'];_0x1bee71[_0xf0ad('0x2d')]=_['keys'](_0x39c46c);_0x1bee71[_0xf0ad('0x2e')]=_['keys'](_0x1b6880[_0xf0ad('0x2e')]);_0x1bee71[_0xf0ad('0x2f')]=_[_0xf0ad('0x30')](_0x1bee71[_0xf0ad('0x2d')],_0x1bee71[_0xf0ad('0x2e')]);_0x267b7a[_0xf0ad('0x31')]=_[_0xf0ad('0x30')](_0x1bee71[_0xf0ad('0x2d')],qs['fields'](_0x1b6880['query'][_0xf0ad('0x32')]));_0x267b7a[_0xf0ad('0x31')]=_0x267b7a[_0xf0ad('0x31')][_0xf0ad('0x33')]?_0x267b7a['attributes']:_0x1bee71[_0xf0ad('0x2d')];if(!_0x1b6880['query'][_0xf0ad('0x34')]('nolimit')){_0x267b7a[_0xf0ad('0x1c')]=qs['limit'](_0x1b6880[_0xf0ad('0x2e')][_0xf0ad('0x1c')]);_0x267b7a[_0xf0ad('0x1b')]=qs[_0xf0ad('0x1b')](_0x1b6880[_0xf0ad('0x2e')][_0xf0ad('0x1b')]);}_0x267b7a[_0xf0ad('0x35')]=qs[_0xf0ad('0x36')](_0x1b6880['query'][_0xf0ad('0x36')]);_0x267b7a['where']=qs[_0xf0ad('0x2f')](_['pick'](_0x1b6880[_0xf0ad('0x2e')],_0x1bee71[_0xf0ad('0x2f')]));if(_0x1b6880[_0xf0ad('0x2e')][_0xf0ad('0x37')]){_0x267b7a[_0xf0ad('0x38')]=_['merge'](_0x267b7a[_0xf0ad('0x38')],{'$or':_[_0xf0ad('0x39')](_0x39c46c,function(_0x1d57d1){if(_0x1d57d1[_0xf0ad('0x3a')][_0xf0ad('0x3b')]!==_0xf0ad('0x3c')){var _0x3553b0={};_0x3553b0[_0x1d57d1['field']]={'$like':'%'+_0x1b6880[_0xf0ad('0x2e')][_0xf0ad('0x37')]+'%'};return _0x3553b0;}})});}_0x267b7a=_[_0xf0ad('0x3d')]({},_0x267b7a,_0x1b6880[_0xf0ad('0x3e')]);var _0x1b68aa={'where':_0x267b7a[_0xf0ad('0x38')]};return db[_0xf0ad('0x2c')][_0xf0ad('0x1a')](_0x1b68aa)[_0xf0ad('0x21')](function(_0x5dd631){_0x2386e8[_0xf0ad('0x1a')]=_0x5dd631;if(_0x1b6880[_0xf0ad('0x2e')][_0xf0ad('0x3f')]){_0x267b7a['include']=[{'all':!![]}];}return db['Tag']['findAll'](_0x267b7a);})[_0xf0ad('0x21')](function(_0x706a66){_0x2386e8[_0xf0ad('0x40')]=_0x706a66;return _0x2386e8;})[_0xf0ad('0x21')](respondWithFilteredResult(_0x1ac25c,_0x267b7a))[_0xf0ad('0x41')](handleError(_0x1ac25c,null));};exports[_0xf0ad('0x42')]=function(_0x39083d,_0x1dcbd0){var _0x3dfedd={'raw':!![],'where':{'id':_0x39083d[_0xf0ad('0x43')]['id']}},_0x38d90c={};_0x38d90c['model']=_['keys'](db['Tag'][_0xf0ad('0x44')]);_0x38d90c[_0xf0ad('0x2e')]=_['keys'](_0x39083d[_0xf0ad('0x2e')]);_0x38d90c[_0xf0ad('0x2f')]=_['intersection'](_0x38d90c[_0xf0ad('0x2d')],_0x38d90c[_0xf0ad('0x2e')]);_0x3dfedd[_0xf0ad('0x31')]=_[_0xf0ad('0x30')](_0x38d90c['model'],qs[_0xf0ad('0x32')](_0x39083d[_0xf0ad('0x2e')][_0xf0ad('0x32')]));_0x3dfedd[_0xf0ad('0x31')]=_0x3dfedd[_0xf0ad('0x31')][_0xf0ad('0x33')]?_0x3dfedd[_0xf0ad('0x31')]:_0x38d90c[_0xf0ad('0x2d')];if(_0x39083d[_0xf0ad('0x2e')][_0xf0ad('0x3f')]){_0x3dfedd[_0xf0ad('0x45')]=[{'all':!![]}];}_0x3dfedd=_['merge']({},_0x3dfedd,_0x39083d[_0xf0ad('0x3e')]);return db[_0xf0ad('0x2c')][_0xf0ad('0x46')](_0x3dfedd)['then'](handleEntityNotFound(_0x1dcbd0,null))['then'](respondWithResult(_0x1dcbd0,null))[_0xf0ad('0x41')](handleError(_0x1dcbd0,null));};exports[_0xf0ad('0x47')]=function(_0x12b76f,_0x36500c){return db[_0xf0ad('0x2c')][_0xf0ad('0x47')](_0x12b76f[_0xf0ad('0x48')],{})['then'](function(_0x1e35ce){var _0x587f07=_0x12b76f[_0xf0ad('0x49')][_0xf0ad('0x23')]({'plain':!![]});if(!_0x587f07)throw new Error(_0xf0ad('0x4a'));if(_0x587f07[_0xf0ad('0x4b')]===_0xf0ad('0x49')){var _0x5b18a7=_0x1e35ce['get']({'plain':!![]});var _0x28003c=_0xf0ad('0x24');return db[_0xf0ad('0x4c')][_0xf0ad('0x46')]({'where':{'name':_0x28003c,'userProfileId':_0x587f07[_0xf0ad('0x4d')]},'raw':!![]})[_0xf0ad('0x21')](function(_0x4733e0){if(_0x4733e0&&_0x4733e0['autoAssociation']===0x0){return db[_0xf0ad('0x25')][_0xf0ad('0x47')]({'name':_0x5b18a7[_0xf0ad('0x29')],'resourceId':_0x5b18a7['id'],'type':_0x4733e0[_0xf0ad('0x29')],'sectionId':_0x4733e0['id']},{})[_0xf0ad('0x21')](function(){return _0x1e35ce;});}else{return _0x1e35ce;}})['catch'](function(_0x39f358){logger[_0xf0ad('0x27')](_0xf0ad('0x4e'),_0x39f358);throw _0x39f358;});}return _0x1e35ce;})[_0xf0ad('0x21')](respondWithResult(_0x36500c,0xc9))[_0xf0ad('0x41')](handleError(_0x36500c,null));};exports[_0xf0ad('0x20')]=function(_0x3d156d,_0x5e75d0){if(_0x3d156d[_0xf0ad('0x48')]['id']){delete _0x3d156d[_0xf0ad('0x48')]['id'];}return db[_0xf0ad('0x2c')]['find']({'where':{'id':_0x3d156d[_0xf0ad('0x43')]['id']}})[_0xf0ad('0x21')](handleEntityNotFound(_0x5e75d0,null))[_0xf0ad('0x21')](saveUpdates(_0x3d156d[_0xf0ad('0x48')],null))[_0xf0ad('0x21')](respondWithResult(_0x5e75d0,null))[_0xf0ad('0x41')](handleError(_0x5e75d0,null));};exports[_0xf0ad('0x22')]=function(_0x46e655,_0x7e2a23){return db[_0xf0ad('0x2c')][_0xf0ad('0x46')]({'where':{'id':_0x46e655['params']['id']}})['then'](handleEntityNotFound(_0x7e2a23,null))[_0xf0ad('0x21')](removeEntity(_0x7e2a23,null))[_0xf0ad('0x41')](handleError(_0x7e2a23,null));}; \ No newline at end of file +var _0xd117=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','update','then','get','Tags','UserProfileResource','destroy','error','stack','name','send','rawAttributes','keys','query','intersection','model','attributes','hasOwnProperty','filters','pick','filter','where','merge','map','type','VIRTUAL','field','Tag','include','findAll','catch','params','fields','length','includeAll','options','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x10ff83,_0x385832){var _0xb99351=function(_0x5edcdf){while(--_0x5edcdf){_0x10ff83['push'](_0x10ff83['shift']());}};_0xb99351(++_0x385832);}(_0xd117,0x182));var _0x7d11=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0xd117[_0x3e0b8f];return _0x22f742;};'use strict';var pdf=require(_0x7d11('0x0'));var emlformat=require(_0x7d11('0x1'));var rimraf=require(_0x7d11('0x2'));var zipdir=require(_0x7d11('0x3'));var jsonpatch=require(_0x7d11('0x4'));var rp=require(_0x7d11('0x5'));var moment=require(_0x7d11('0x6'));var BPromise=require(_0x7d11('0x7'));var Mustache=require(_0x7d11('0x8'));var util=require(_0x7d11('0x9'));var path=require(_0x7d11('0xa'));var sox=require(_0x7d11('0xb'));var csv=require(_0x7d11('0xc'));var ejs=require(_0x7d11('0xd'));var fs=require('fs');var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xc'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var authService=require(_0x7d11('0x13'));var hardwareService=require(_0x7d11('0x14'));var Redis=require('ioredis');var qs=require(_0x7d11('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7d11('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc52a95,_0x48f576){_0x48f576=_0x48f576||0xcc;return function(_0x4767d5){if(_0x4767d5){return _0xc52a95[_0x7d11('0x17')](_0x48f576);}return _0xc52a95['status'](_0x48f576)[_0x7d11('0x18')]();};}function respondWithResult(_0x20f519,_0x4cda5d){_0x4cda5d=_0x4cda5d||0xc8;return function(_0x324de5){if(_0x324de5){return _0x20f519[_0x7d11('0x19')](_0x4cda5d)[_0x7d11('0x1a')](_0x324de5);}};}function respondWithFilteredResult(_0x2978da,_0x417e2d){return function(_0xeae744){if(_0xeae744){var _0x2a269e=_0xeae744[_0x7d11('0x1b')],_0xb1669e=_0x417e2d[_0x7d11('0x1c')],_0x4aa795=_0x417e2d[_0x7d11('0x1c')]+_0x417e2d[_0x7d11('0x1d')],_0x1db0df;if(_0x4aa795>=_0x2a269e){_0x4aa795=_0x2a269e;_0x1db0df=0xc8;}else{_0x1db0df=0xce;}_0x2978da['status'](_0x1db0df);return _0x2978da[_0x7d11('0x1e')](_0x7d11('0x1f'),_0xb1669e+'-'+_0x4aa795+'/'+_0x2a269e)['json'](_0xeae744);}return null;};}function patchUpdates(_0x5459df){return function(_0x2ca3a2){try{jsonpatch['apply'](_0x2ca3a2,_0x5459df,!![]);}catch(_0x1f9990){return BPromise['reject'](_0x1f9990);}return _0x2ca3a2[_0x7d11('0x20')]();};}function saveUpdates(_0x17e539,_0x328f8e){return function(_0x46f662){if(_0x46f662){return _0x46f662[_0x7d11('0x21')](_0x17e539)[_0x7d11('0x22')](function(_0x4297f8){return _0x4297f8;});}return null;};}function removeEntity(_0x3d2574,_0x5680cb){return function(_0x441917){if(_0x441917){return _0x441917['destroy']()['then'](function(){var _0x5c3898=_0x441917[_0x7d11('0x23')]({'plain':!![]});var _0x3545dc=_0x7d11('0x24');return db[_0x7d11('0x25')][_0x7d11('0x26')]({'where':{'type':_0x3545dc,'resourceId':_0x5c3898['id']}})[_0x7d11('0x22')](function(){return _0x441917;});})[_0x7d11('0x22')](function(){_0x3d2574[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x27')](_0x180e1e[_0x7d11('0x28')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x29')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x2a')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=db['Tag'][_0x7d11('0x2b')];_0x38f1be['model']=_[_0x7d11('0x2c')](_0x1a7745);_0x38f1be[_0x7d11('0x2d')]=_[_0x7d11('0x2c')](_0x601650['query']);_0x38f1be['filters']=_[_0x7d11('0x2e')](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049[_0x7d11('0x30')]=_[_0x7d11('0x2e')](_0x38f1be[_0x7d11('0x2f')],qs['fields'](_0x601650[_0x7d11('0x2d')]['fields']));_0x18c049['attributes']=_0x18c049[_0x7d11('0x30')]['length']?_0x18c049[_0x7d11('0x30')]:_0x38f1be[_0x7d11('0x2f')];if(!_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]('nolimit')){_0x18c049[_0x7d11('0x1d')]=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1c')]=qs[_0x7d11('0x1c')](_0x601650['query'][_0x7d11('0x1c')]);}_0x18c049['order']=qs['sort'](_0x601650[_0x7d11('0x2d')]['sort']);_0x18c049['where']=qs[_0x7d11('0x32')](_[_0x7d11('0x33')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x32')]));if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x34')]){_0x18c049[_0x7d11('0x35')]=_[_0x7d11('0x36')](_0x18c049[_0x7d11('0x35')],{'$or':_[_0x7d11('0x37')](_0x1a7745,function(_0x1a9f18){if(_0x1a9f18[_0x7d11('0x38')]['key']!==_0x7d11('0x39')){var _0x49d16b={};_0x49d16b[_0x1a9f18[_0x7d11('0x3a')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x34')]+'%'};return _0x49d16b;}})});}_0x18c049=_[_0x7d11('0x36')]({},_0x18c049,_0x601650['options']);var _0xd36cd3={'where':_0x18c049[_0x7d11('0x35')]};return db[_0x7d11('0x3b')][_0x7d11('0x1b')](_0xd36cd3)['then'](function(_0x22730e){_0x4c7d6a['count']=_0x22730e;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049[_0x7d11('0x3c')]=[{'all':!![]}];}return db[_0x7d11('0x3b')][_0x7d11('0x3d')](_0x18c049);})[_0x7d11('0x22')](function(_0x52c28b){_0x4c7d6a['rows']=_0x52c28b;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x3e')](handleError(_0x35a789,null));};exports['show']=function(_0x1caef9,_0x28c4ce){var _0x3563e7={'raw':!![],'where':{'id':_0x1caef9[_0x7d11('0x3f')]['id']}},_0x77e1e8={};_0x77e1e8[_0x7d11('0x2f')]=_['keys'](db[_0x7d11('0x3b')]['rawAttributes']);_0x77e1e8[_0x7d11('0x2d')]=_[_0x7d11('0x2c')](_0x1caef9[_0x7d11('0x2d')]);_0x77e1e8[_0x7d11('0x32')]=_[_0x7d11('0x2e')](_0x77e1e8[_0x7d11('0x2f')],_0x77e1e8['query']);_0x3563e7['attributes']=_['intersection'](_0x77e1e8[_0x7d11('0x2f')],qs[_0x7d11('0x40')](_0x1caef9[_0x7d11('0x2d')][_0x7d11('0x40')]));_0x3563e7[_0x7d11('0x30')]=_0x3563e7['attributes'][_0x7d11('0x41')]?_0x3563e7[_0x7d11('0x30')]:_0x77e1e8['model'];if(_0x1caef9[_0x7d11('0x2d')][_0x7d11('0x42')]){_0x3563e7[_0x7d11('0x3c')]=[{'all':!![]}];}_0x3563e7=_['merge']({},_0x3563e7,_0x1caef9[_0x7d11('0x43')]);return db[_0x7d11('0x3b')][_0x7d11('0x44')](_0x3563e7)['then'](handleEntityNotFound(_0x28c4ce,null))[_0x7d11('0x22')](respondWithResult(_0x28c4ce,null))['catch'](handleError(_0x28c4ce,null));};exports[_0x7d11('0x45')]=function(_0x69dbd1,_0x3f33d9){return db[_0x7d11('0x3b')][_0x7d11('0x45')](_0x69dbd1[_0x7d11('0x46')],{})[_0x7d11('0x22')](function(_0x193631){var _0x1da7a4=_0x69dbd1['user']['get']({'plain':!![]});if(!_0x1da7a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1da7a4[_0x7d11('0x47')]===_0x7d11('0x48')){var _0x20297a=_0x193631[_0x7d11('0x23')]({'plain':!![]});var _0x140acc=_0x7d11('0x24');return db[_0x7d11('0x49')][_0x7d11('0x44')]({'where':{'name':_0x140acc,'userProfileId':_0x1da7a4[_0x7d11('0x4a')]},'raw':!![]})[_0x7d11('0x22')](function(_0x46450e){if(_0x46450e&&_0x46450e[_0x7d11('0x4b')]===0x0){return db['UserProfileResource'][_0x7d11('0x45')]({'name':_0x20297a[_0x7d11('0x29')],'resourceId':_0x20297a['id'],'type':_0x46450e[_0x7d11('0x29')],'sectionId':_0x46450e['id']},{})['then'](function(){return _0x193631;});}else{return _0x193631;}})['catch'](function(_0x14db1c){logger[_0x7d11('0x27')](_0x7d11('0x4c'),_0x14db1c);throw _0x14db1c;});}return _0x193631;})['then'](respondWithResult(_0x3f33d9,0xc9))['catch'](handleError(_0x3f33d9,null));};exports[_0x7d11('0x21')]=function(_0x36af2b,_0x5e6234){if(_0x36af2b[_0x7d11('0x46')]['id']){delete _0x36af2b[_0x7d11('0x46')]['id'];}return db[_0x7d11('0x3b')][_0x7d11('0x44')]({'where':{'id':_0x36af2b['params']['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x5e6234,null))[_0x7d11('0x22')](saveUpdates(_0x36af2b[_0x7d11('0x46')],null))['then'](respondWithResult(_0x5e6234,null))['catch'](handleError(_0x5e6234,null));};exports[_0x7d11('0x26')]=function(_0x3f310b,_0x20a85c){return db[_0x7d11('0x3b')][_0x7d11('0x44')]({'where':{'id':_0x3f310b['params']['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x20a85c,null))[_0x7d11('0x22')](removeEntity(_0x20a85c,null))[_0x7d11('0x3e')](handleError(_0x20a85c,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 7c83b0e..151e448 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 _0x476c=['./tag.attributes','exports','define','Tag','util','api','moment','request-promise'];(function(_0xb63371,_0x438dbf){var _0x4f27c1=function(_0x280506){while(--_0x280506){_0xb63371['push'](_0xb63371['shift']());}};_0x4f27c1(++_0x438dbf);}(_0x476c,0xdc));var _0xc476=function(_0x23c513,_0x9ccaeb){_0x23c513=_0x23c513-0x0;var _0x4a4ae5=_0x476c[_0x23c513];return _0x4a4ae5;};'use strict';var _=require('lodash');var util=require(_0xc476('0x0'));var logger=require('../../config/logger')(_0xc476('0x1'));var moment=require(_0xc476('0x2'));var BPromise=require('bluebird');var rp=require(_0xc476('0x3'));var attributes=require(_0xc476('0x4'));module[_0xc476('0x5')]=function(_0x50093f,_0x162b73){return _0x50093f[_0xc476('0x6')](_0xc476('0x7'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe62e=['define','Tag','tools_tags','lodash','api','moment','bluebird','request-promise','./tag.attributes','exports'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0xe62e,0x1d9));var _0xee62=function(_0x4d4224,_0xae983e){_0x4d4224=_0x4d4224-0x0;var _0xa6f8e0=_0xe62e[_0x4d4224];return _0xa6f8e0;};'use strict';var _=require(_0xee62('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee62('0x1'));var moment=require(_0xee62('0x2'));var BPromise=require(_0xee62('0x3'));var rp=require(_0xee62('0x4'));var attributes=require(_0xee62('0x5'));module[_0xee62('0x6')]=function(_0xc70129,_0x1edaf5){return _0xc70129[_0xee62('0x7')](_0xee62('0x8'),attributes,{'tableName':_0xee62('0x9'),'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 2810ec2..4d7a773 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 _0xddab=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Tag,\x20%s,\x20%s','result','catch','lodash'];(function(_0x5bbab8,_0x3476f4){var _0x5aa4a5=function(_0x445a18){while(--_0x445a18){_0x5bbab8['push'](_0x5bbab8['shift']());}};_0x5aa4a5(++_0x3476f4);}(_0xddab,0xef));var _0xbdda=function(_0x31bea6,_0x39cf7e){_0x31bea6=_0x31bea6-0x0;var _0x6d3b6f=_0xddab[_0x31bea6];return _0x6d3b6f;};'use strict';var _=require(_0xbdda('0x0'));var util=require(_0xbdda('0x1'));var moment=require('moment');var BPromise=require(_0xbdda('0x2'));var rs=require(_0xbdda('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbdda('0x4'))['db'];var utils=require(_0xbdda('0x5'));var logger=require(_0xbdda('0x6'))(_0xbdda('0x7'));var config=require(_0xbdda('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbdda('0x9')][_0xbdda('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45aea2,_0x4ea60f,_0x63eaa8){return new BPromise(function(_0x129d77,_0x8e82ce){return client[_0xbdda('0xb')](_0x45aea2,_0x63eaa8)[_0xbdda('0xc')](function(_0x2150f3){logger[_0xbdda('0xd')]('Tag,\x20%s,\x20%s',_0x4ea60f,_0xbdda('0xe'));logger[_0xbdda('0xf')](_0xbdda('0x10'),_0x4ea60f,_0xbdda('0xe'),JSON[_0xbdda('0x11')](_0x2150f3));if(_0x2150f3[_0xbdda('0x12')]){if(_0x2150f3[_0xbdda('0x12')][_0xbdda('0x13')]===0x1f4){logger[_0xbdda('0x12')]('Tag,\x20%s,\x20%s',_0x4ea60f,_0x2150f3[_0xbdda('0x12')][_0xbdda('0x14')]);return _0x8e82ce(_0x2150f3['error']['message']);}logger['error'](_0xbdda('0x15'),_0x4ea60f,_0x2150f3[_0xbdda('0x12')][_0xbdda('0x14')]);return _0x129d77(_0x2150f3['error']['message']);}else{logger[_0xbdda('0xd')](_0xbdda('0x15'),_0x4ea60f,_0xbdda('0xe'));_0x129d77(_0x2150f3[_0xbdda('0x16')][_0xbdda('0x14')]);}})[_0xbdda('0x17')](function(_0xec8f0d){logger[_0xbdda('0x12')](_0xbdda('0x15'),_0x4ea60f,_0xec8f0d);_0x8e82ce(_0xec8f0d);});});} \ No newline at end of file +var _0xace2=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s'];(function(_0x5cd7a3,_0x1aa14f){var _0x21235d=function(_0x3152a9){while(--_0x3152a9){_0x5cd7a3['push'](_0x5cd7a3['shift']());}};_0x21235d(++_0x1aa14f);}(_0xace2,0x1a5));var _0x2ace=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0xace2[_0x2f1114];return _0x2fe856;};'use strict';var _=require(_0x2ace('0x0'));var util=require(_0x2ace('0x1'));var moment=require(_0x2ace('0x2'));var BPromise=require('bluebird');var rs=require(_0x2ace('0x3'));var fs=require('fs');var Redis=require(_0x2ace('0x4'));var db=require(_0x2ace('0x5'))['db'];var utils=require(_0x2ace('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2ace('0x7'));var client=jayson[_0x2ace('0x8')][_0x2ace('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd911c4,_0x3b4b11,_0xcdd648){return new BPromise(function(_0xc102dd,_0xa9847e){return client[_0x2ace('0xa')](_0xd911c4,_0xcdd648)[_0x2ace('0xb')](function(_0x571d04){logger[_0x2ace('0xc')]('Tag,\x20%s,\x20%s',_0x3b4b11,_0x2ace('0xd'));logger['debug'](_0x2ace('0xe'),_0x3b4b11,_0x2ace('0xd'),JSON[_0x2ace('0xf')](_0x571d04));if(_0x571d04[_0x2ace('0x10')]){if(_0x571d04[_0x2ace('0x10')][_0x2ace('0x11')]===0x1f4){logger[_0x2ace('0x10')](_0x2ace('0x12'),_0x3b4b11,_0x571d04[_0x2ace('0x10')][_0x2ace('0x13')]);return _0xa9847e(_0x571d04[_0x2ace('0x10')][_0x2ace('0x13')]);}logger[_0x2ace('0x10')](_0x2ace('0x12'),_0x3b4b11,_0x571d04[_0x2ace('0x10')][_0x2ace('0x13')]);return _0xc102dd(_0x571d04[_0x2ace('0x10')]['message']);}else{logger[_0x2ace('0xc')](_0x2ace('0x12'),_0x3b4b11,_0x2ace('0xd'));_0xc102dd(_0x571d04[_0x2ace('0x14')]['message']);}})[_0x2ace('0x15')](function(_0x5e7b1a){logger[_0x2ace('0x10')](_0x2ace('0x12'),_0x3b4b11,_0x5e7b1a);_0xa9847e(_0x5e7b1a);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index fc76ab4..62cecf4 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 _0x681a=['connect-timeout','express','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','index','/:id','show','/:id/queues','getQueues','getAgents','post','create','addQueues','addAgents','put','update','delete','destroy','removeQueues','removeAgents','exports','multer','util','path'];(function(_0x2dd752,_0x59b4fc){var _0x297823=function(_0x44a37f){while(--_0x44a37f){_0x2dd752['push'](_0x2dd752['shift']());}};_0x297823(++_0x59b4fc);}(_0x681a,0x1e3));var _0xa681=function(_0x216799,_0x44b817){_0x216799=_0x216799-0x0;var _0x3661c3=_0x681a[_0x216799];return _0x3661c3;};'use strict';var multer=require(_0xa681('0x0'));var util=require(_0xa681('0x1'));var path=require(_0xa681('0x2'));var timeout=require(_0xa681('0x3'));var express=require(_0xa681('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa681('0x5'));var config=require(_0xa681('0x6'));var controller=require(_0xa681('0x7'));router[_0xa681('0x8')]('/',auth[_0xa681('0x9')](),controller[_0xa681('0xa')]);router['get'](_0xa681('0xb'),auth[_0xa681('0x9')](),controller[_0xa681('0xc')]);router[_0xa681('0x8')](_0xa681('0xd'),auth[_0xa681('0x9')](),controller[_0xa681('0xe')]);router[_0xa681('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0xa681('0xf')]);router[_0xa681('0x10')]('/',auth['isAuthenticated'](),controller[_0xa681('0x11')]);router['post']('/:id/queues',auth['isAuthenticated'](),controller[_0xa681('0x12')]);router[_0xa681('0x10')]('/:id/users',auth[_0xa681('0x9')](),controller[_0xa681('0x13')]);router[_0xa681('0x14')](_0xa681('0xb'),auth[_0xa681('0x9')](),controller[_0xa681('0x15')]);router[_0xa681('0x16')](_0xa681('0xb'),auth[_0xa681('0x9')](),controller[_0xa681('0x17')]);router[_0xa681('0x16')](_0xa681('0xd'),auth[_0xa681('0x9')](),controller[_0xa681('0x18')]);router[_0xa681('0x16')]('/:id/users',auth[_0xa681('0x9')](),controller[_0xa681('0x19')]);module[_0xa681('0x1a')]=router; \ No newline at end of file +var _0xd2be=['/:id/users','getAgents','addQueues','addAgents','put','update','delete','/:id/queues','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','isAuthenticated'];(function(_0x3e1bf2,_0x121002){var _0x1de65a=function(_0x53a313){while(--_0x53a313){_0x3e1bf2['push'](_0x3e1bf2['shift']());}};_0x1de65a(++_0x121002);}(_0xd2be,0x86));var _0xed2b=function(_0x9e1faa,_0x425b76){_0x9e1faa=_0x9e1faa-0x0;var _0xdc2c21=_0xd2be[_0x9e1faa];return _0xdc2c21;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xed2b('0x0'));var timeout=require(_0xed2b('0x1'));var express=require(_0xed2b('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xed2b('0x3'));var config=require(_0xed2b('0x4'));var controller=require(_0xed2b('0x5'));router[_0xed2b('0x6')]('/',auth['isAuthenticated'](),controller[_0xed2b('0x7')]);router[_0xed2b('0x6')](_0xed2b('0x8'),auth[_0xed2b('0x9')](),controller['show']);router[_0xed2b('0x6')]('/:id/queues',auth['isAuthenticated'](),controller['getQueues']);router[_0xed2b('0x6')](_0xed2b('0xa'),auth[_0xed2b('0x9')](),controller[_0xed2b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0xed2b('0x9')](),controller[_0xed2b('0xc')]);router['post'](_0xed2b('0xa'),auth['isAuthenticated'](),controller[_0xed2b('0xd')]);router[_0xed2b('0xe')](_0xed2b('0x8'),auth[_0xed2b('0x9')](),controller[_0xed2b('0xf')]);router[_0xed2b('0x10')](_0xed2b('0x8'),auth[_0xed2b('0x9')](),controller['destroy']);router[_0xed2b('0x10')](_0xed2b('0x11'),auth['isAuthenticated'](),controller['removeQueues']);router[_0xed2b('0x10')](_0xed2b('0xa'),auth[_0xed2b('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index e15f743..e815a4b 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 _0x3803=['sequelize','exports','STRING','name'];(function(_0x47e14f,_0x341555){var _0x103a82=function(_0x4ff100){while(--_0x4ff100){_0x47e14f['push'](_0x47e14f['shift']());}};_0x103a82(++_0x341555);}(_0x3803,0x1b8));var _0x3380=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x3803[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x3380('0x0'));module[_0x3380('0x1')]={'name':{'type':Sequelize[_0x3380('0x2')],'allowNull':![],'unique':_0x3380('0x3')},'description':{'type':Sequelize[_0x3380('0x2')]}}; \ No newline at end of file +var _0xfb48=['sequelize','exports','STRING','name'];(function(_0x5af066,_0x1f26e6){var _0x31b7c6=function(_0x818958){while(--_0x818958){_0x5af066['push'](_0x5af066['shift']());}};_0x31b7c6(++_0x1f26e6);}(_0xfb48,0xd8));var _0x8fb4=function(_0x412547,_0x1eee49){_0x412547=_0x412547-0x0;var _0x16978e=_0xfb48[_0x412547];return _0x16978e;};'use strict';var Sequelize=require(_0x8fb4('0x0'));module[_0x8fb4('0x1')]={'name':{'type':Sequelize[_0x8fb4('0x2')],'allowNull':![],'unique':_0x8fb4('0x3')},'description':{'type':Sequelize[_0x8fb4('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index c8821c4..fa67d70 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(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 f25a640..229ff37 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 _0x56a0=['exports','events','../../mysqldb','Team','setMaxListeners','update','remove','emit','hook'];(function(_0x317813,_0x33688b){var _0xbb2f93=function(_0x2e904a){while(--_0x2e904a){_0x317813['push'](_0x317813['shift']());}};_0xbb2f93(++_0x33688b);}(_0x56a0,0x12a));var _0x056a=function(_0x4360c4,_0x2f8209){_0x4360c4=_0x4360c4-0x0;var _0x3168c8=_0x56a0[_0x4360c4];return _0x3168c8;};'use strict';var EventEmitter=require(_0x056a('0x0'));var Team=require(_0x056a('0x1'))['db'][_0x056a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x056a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x056a('0x4'),'afterDestroy':_0x056a('0x5')};function emitEvent(_0x58151a){return function(_0x2b09b7,_0x1cebc0,_0x1afdc5){TeamEvents[_0x056a('0x6')](_0x58151a+':'+_0x2b09b7['id'],_0x2b09b7);TeamEvents[_0x056a('0x6')](_0x58151a,_0x2b09b7);_0x1afdc5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x056a('0x7')](e,emitEvent(event));}}module[_0x056a('0x8')]=TeamEvents; \ No newline at end of file +var _0xde52=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x4d654c,_0x3f1ac7){var _0x5c47b7=function(_0x1a6045){while(--_0x1a6045){_0x4d654c['push'](_0x4d654c['shift']());}};_0x5c47b7(++_0x3f1ac7);}(_0xde52,0x1c9));var _0x2de5=function(_0x1a1667,_0x2224b1){_0x1a1667=_0x1a1667-0x0;var _0x45a134=_0xde52[_0x1a1667];return _0x45a134;};'use strict';var EventEmitter=require(_0x2de5('0x0'));var Team=require(_0x2de5('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x2de5('0x2')](0x0);var events={'afterCreate':_0x2de5('0x3'),'afterUpdate':_0x2de5('0x4'),'afterDestroy':_0x2de5('0x5')};function emitEvent(_0x4c7047){return function(_0x1cc3a3,_0x1e185d,_0x42a04d){TeamEvents[_0x2de5('0x6')](_0x4c7047+':'+_0x1cc3a3['id'],_0x1cc3a3);TeamEvents[_0x2de5('0x6')](_0x4c7047,_0x1cc3a3);_0x42a04d(null);};}for(var e in events){if(events[_0x2de5('0x7')](e)){var event=events[e];Team[_0x2de5('0x8')](e,emitEvent(event));}}module[_0x2de5('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index a7b8b92..de6ec51 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 _0xa9e0=['exports','define','teams','lodash','util','../../config/logger','bluebird','./team.attributes'];(function(_0x570995,_0x2dffdf){var _0x3b7ee9=function(_0x31652b){while(--_0x31652b){_0x570995['push'](_0x570995['shift']());}};_0x3b7ee9(++_0x2dffdf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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')]('Team',attributes,{'tableName':_0x0a9e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['../../config/logger','api','moment','bluebird','request-promise','./team.attributes','Team','teams'];(function(_0x32f332,_0x20fe03){var _0x47ccf0=function(_0x27896a){while(--_0x27896a){_0x32f332['push'](_0x32f332['shift']());}};_0x47ccf0(++_0x20fe03);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var attributes=require(_0x49c4('0x5'));module['exports']=function(_0x4941f1,_0x41a183){return _0x4941f1['define'](_0x49c4('0x6'),attributes,{'tableName':_0x49c4('0x7'),'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 3a01f97..2d18215 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 _0xa68b=['error','Team,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','then','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x13b3b5,_0x52d8d8){var _0x337cd0=function(_0x31fbdf){while(--_0x31fbdf){_0x13b3b5['push'](_0x13b3b5['shift']());}};_0x337cd0(++_0x52d8d8);}(_0xa68b,0xa8));var _0xba68=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0xa68b[_0x333798];return _0x389f4e;};'use strict';var _=require(_0xba68('0x0'));var util=require(_0xba68('0x1'));var moment=require(_0xba68('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba68('0x3'));var db=require(_0xba68('0x4'))['db'];var utils=require(_0xba68('0x5'));var logger=require(_0xba68('0x6'))(_0xba68('0x7'));var config=require(_0xba68('0x8'));var jayson=require(_0xba68('0x9'));var client=jayson[_0xba68('0xa')][_0xba68('0xb')]({'port':0x232a});config['redis']=_[_0xba68('0xc')](config[_0xba68('0xd')],{'host':_0xba68('0xe'),'port':0x18eb});var socket=require(_0xba68('0xf'))(new Redis(config['redis']));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x16263e,_0x16ad23,_0x3c4602){return new BPromise(function(_0x5ab4a1,_0x3420de){return client[_0xba68('0x10')](_0x16263e,_0x3c4602)[_0xba68('0x11')](function(_0x5af2df){logger['info']('Team,\x20%s,\x20%s',_0x16ad23,'request\x20sent');logger['debug'](_0xba68('0x12'),_0x16ad23,_0xba68('0x13'),JSON[_0xba68('0x14')](_0x5af2df));if(_0x5af2df['error']){if(_0x5af2df['error']['code']===0x1f4){logger[_0xba68('0x15')](_0xba68('0x16'),_0x16ad23,_0x5af2df[_0xba68('0x15')][_0xba68('0x17')]);return _0x3420de(_0x5af2df[_0xba68('0x15')][_0xba68('0x17')]);}logger[_0xba68('0x15')](_0xba68('0x16'),_0x16ad23,_0x5af2df[_0xba68('0x15')][_0xba68('0x17')]);return _0x5ab4a1(_0x5af2df[_0xba68('0x15')][_0xba68('0x17')]);}else{logger[_0xba68('0x18')](_0xba68('0x16'),_0x16ad23,_0xba68('0x13'));_0x5ab4a1(_0x5af2df[_0xba68('0x19')][_0xba68('0x17')]);}})[_0xba68('0x1a')](function(_0x56133b){logger[_0xba68('0x15')]('Team,\x20%s,\x20%s',_0x16ad23,_0x56133b);_0x3420de(_0x56133b);});});} \ No newline at end of file +var _0x7ffa=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','register','then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util'];(function(_0x54a878,_0x5d76ef){var _0x5cc349=function(_0x11fc41){while(--_0x11fc41){_0x54a878['push'](_0x54a878['shift']());}};_0x5cc349(++_0x5d76ef);}(_0x7ffa,0xc6));var _0xa7ff=function(_0x36424c,_0x62db50){_0x36424c=_0x36424c-0x0;var _0xebacee=_0x7ffa[_0x36424c];return _0xebacee;};'use strict';var _=require(_0xa7ff('0x0'));var util=require(_0xa7ff('0x1'));var moment=require(_0xa7ff('0x2'));var BPromise=require(_0xa7ff('0x3'));var rs=require(_0xa7ff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa7ff('0x5'));var logger=require(_0xa7ff('0x6'))(_0xa7ff('0x7'));var config=require('../../config/environment');var jayson=require(_0xa7ff('0x8'));var client=jayson[_0xa7ff('0x9')][_0xa7ff('0xa')]({'port':0x232a});config['redis']=_[_0xa7ff('0xb')](config[_0xa7ff('0xc')],{'host':_0xa7ff('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7ff('0xc')]));require('./team.socket')[_0xa7ff('0xe')](socket);function respondWithRpcPromise(_0x505183,_0x58da6d,_0x2837ba){return new BPromise(function(_0x176221,_0x376691){return client['request'](_0x505183,_0x2837ba)[_0xa7ff('0xf')](function(_0x18ceba){logger['info'](_0xa7ff('0x10'),_0x58da6d,_0xa7ff('0x11'));logger['debug'](_0xa7ff('0x12'),_0x58da6d,'request\x20sent',JSON[_0xa7ff('0x13')](_0x18ceba));if(_0x18ceba['error']){if(_0x18ceba[_0xa7ff('0x14')][_0xa7ff('0x15')]===0x1f4){logger['error'](_0xa7ff('0x10'),_0x58da6d,_0x18ceba[_0xa7ff('0x14')][_0xa7ff('0x16')]);return _0x376691(_0x18ceba[_0xa7ff('0x14')][_0xa7ff('0x16')]);}logger[_0xa7ff('0x14')](_0xa7ff('0x10'),_0x58da6d,_0x18ceba[_0xa7ff('0x14')][_0xa7ff('0x16')]);return _0x176221(_0x18ceba[_0xa7ff('0x14')]['message']);}else{logger[_0xa7ff('0x17')](_0xa7ff('0x10'),_0x58da6d,'request\x20sent');_0x176221(_0x18ceba['result'][_0xa7ff('0x16')]);}})[_0xa7ff('0x18')](function(_0x1defa5){logger[_0xa7ff('0x14')]('Team,\x20%s,\x20%s',_0x58da6d,_0x1defa5);_0x376691(_0x1defa5);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 93dd1d4..72e33f0 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 _0xb2bc=['removeListener','length','team:','./team.events','save','remove'];(function(_0x1bb3b4,_0x2a476e){var _0x4b9fab=function(_0x49c566){while(--_0x49c566){_0x1bb3b4['push'](_0x1bb3b4['shift']());}};_0x4b9fab(++_0x2a476e);}(_0xb2bc,0x153));var _0xcb2b=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0xb2bc[_0x37b3e5];return _0x207f20;};'use strict';var TeamEvents=require(_0xcb2b('0x0'));var events=[_0xcb2b('0x1'),_0xcb2b('0x2'),'update'];function createListener(_0xb0c1c3,_0xae5d12){return function(_0x34d480){_0xae5d12['emit'](_0xb0c1c3,_0x34d480);};}function removeListener(_0x540c87,_0x1bb4a8){return function(){TeamEvents[_0xcb2b('0x3')](_0x540c87,_0x1bb4a8);};}exports['register']=function(_0x3c8b5a){for(var _0x11911c=0x0,_0x508b39=events[_0xcb2b('0x4')];_0x11911c<_0x508b39;_0x11911c++){var _0x95e3da=events[_0x11911c];var _0xfb85d4=createListener(_0xcb2b('0x5')+_0x95e3da,_0x3c8b5a);TeamEvents['on'](_0x95e3da,_0xfb85d4);}}; \ No newline at end of file +var _0xddd8=['emit','removeListener','register','length','team:','save','remove','update'];(function(_0x362abb,_0x12504a){var _0x398e13=function(_0x287a95){while(--_0x287a95){_0x362abb['push'](_0x362abb['shift']());}};_0x398e13(++_0x12504a);}(_0xddd8,0x6d));var _0x8ddd=function(_0x50fcf0,_0x2bc9f9){_0x50fcf0=_0x50fcf0-0x0;var _0x4acd3c=_0xddd8[_0x50fcf0];return _0x4acd3c;};'use strict';var TeamEvents=require('./team.events');var events=[_0x8ddd('0x0'),_0x8ddd('0x1'),_0x8ddd('0x2')];function createListener(_0x27d934,_0x222e69){return function(_0x9568f7){_0x222e69[_0x8ddd('0x3')](_0x27d934,_0x9568f7);};}function removeListener(_0x2c0088,_0x39cf24){return function(){TeamEvents[_0x8ddd('0x4')](_0x2c0088,_0x39cf24);};}exports[_0x8ddd('0x5')]=function(_0x450ef6){for(var _0x1f346e=0x0,_0x46d156=events[_0x8ddd('0x6')];_0x1f346e<_0x46d156;_0x1f346e++){var _0x70c6a3=events[_0x1f346e];var _0x4315d3=createListener(_0x8ddd('0x7')+_0x70c6a3,_0x450ef6);TeamEvents['on'](_0x70c6a3,_0x4315d3);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 08f3702..e858f83 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 _0x3223=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2802a5,_0x4f2ca3){var _0x2174cc=function(_0x20b9f6){while(--_0x20b9f6){_0x2802a5['push'](_0x2802a5['shift']());}};_0x2174cc(++_0x4f2ca3);}(_0x3223,0x1ab));var _0x3322=function(_0xe5d7c6,_0x2779d4){_0xe5d7c6=_0xe5d7c6-0x0;var _0x35dfb8=_0x3223[_0xe5d7c6];return _0x35dfb8;};'use strict';var multer=require(_0x3322('0x0'));var util=require(_0x3322('0x1'));var path=require(_0x3322('0x2'));var timeout=require(_0x3322('0x3'));var express=require(_0x3322('0x4'));var router=express[_0x3322('0x5')]();var auth=require(_0x3322('0x6'));var interaction=require(_0x3322('0x7'));var config=require(_0x3322('0x8'));var controller=require('./template.controller');router[_0x3322('0x9')]('/',auth[_0x3322('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x3322('0xa')](),controller[_0x3322('0xb')]);router[_0x3322('0xc')](_0x3322('0xd'),auth[_0x3322('0xa')](),controller['update']);router['delete'](_0x3322('0xd'),auth['isAuthenticated'](),controller[_0x3322('0xe')]);module[_0x3322('0xf')]=router; \ No newline at end of file +var _0x8a6d=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2341f9,_0x4e20d0){var _0x58900b=function(_0x319838){while(--_0x319838){_0x2341f9['push'](_0x2341f9['shift']());}};_0x58900b(++_0x4e20d0);}(_0x8a6d,0xb0));var _0xd8a6=function(_0x25ec41,_0x280d74){_0x25ec41=_0x25ec41-0x0;var _0x75769=_0x8a6d[_0x25ec41];return _0x75769;};'use strict';var multer=require(_0xd8a6('0x0'));var util=require(_0xd8a6('0x1'));var path=require(_0xd8a6('0x2'));var timeout=require(_0xd8a6('0x3'));var express=require(_0xd8a6('0x4'));var router=express[_0xd8a6('0x5')]();var auth=require(_0xd8a6('0x6'));var interaction=require(_0xd8a6('0x7'));var config=require(_0xd8a6('0x8'));var controller=require('./template.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd8a6('0x9')]);router['get'](_0xd8a6('0xa'),auth[_0xd8a6('0xb')](),controller[_0xd8a6('0xc')]);router[_0xd8a6('0xd')]('/',auth[_0xd8a6('0xb')](),controller['create']);router[_0xd8a6('0xe')](_0xd8a6('0xa'),auth[_0xd8a6('0xb')](),controller[_0xd8a6('0xf')]);router['delete'](_0xd8a6('0xa'),auth[_0xd8a6('0xb')](),controller[_0xd8a6('0x10')]);module[_0xd8a6('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index da2494c..458063f 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 _0x068c=['STRING','TEXT','sequelize','exports'];(function(_0x288537,_0x58edc5){var _0x13f14=function(_0x4a02fb){while(--_0x4a02fb){_0x288537['push'](_0x288537['shift']());}};_0x13f14(++_0x58edc5);}(_0x068c,0x16e));var _0xc068=function(_0x5189c2,_0x1a4b3d){_0x5189c2=_0x5189c2-0x0;var _0xc7559a=_0x068c[_0x5189c2];return _0xc7559a;};'use strict';var Sequelize=require(_0xc068('0x0'));module[_0xc068('0x1')]={'name':{'type':Sequelize[_0xc068('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xc068('0x3')]}}; \ No newline at end of file +var _0x82d3=['sequelize','exports','STRING','TEXT'];(function(_0x2476e6,_0x47e762){var _0x6a2ebf=function(_0x25076f){while(--_0x25076f){_0x2476e6['push'](_0x2476e6['shift']());}};_0x6a2ebf(++_0x47e762);}(_0x82d3,0x90));var _0x382d=function(_0x231721,_0x3dd2a2){_0x231721=_0x231721-0x0;var _0x290e3a=_0x82d3[_0x231721];return _0x290e3a;};'use strict';var Sequelize=require(_0x382d('0x0'));module[_0x382d('0x1')]={'name':{'type':Sequelize[_0x382d('0x2')]},'description':{'type':Sequelize[_0x382d('0x2')]},'html':{'type':Sequelize[_0x382d('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 058cb2d..475be70 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 _0xf4e4=['to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','Template','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','includeAll','include','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','html-pdf','eml-format','request-promise','moment','bluebird','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4e4,0xe6));var _0x4f4e=function(_0x5469e1,_0x5c0a91){_0x5469e1=_0x5469e1-0x0;var _0x56de35=_0xf4e4[_0x5469e1];return _0x56de35;};'use strict';var pdf=require(_0x4f4e('0x0'));var emlformat=require(_0x4f4e('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4f4e('0x2'));var moment=require(_0x4f4e('0x3'));var BPromise=require(_0x4f4e('0x4'));var Mustache=require('mustache');var util=require(_0x4f4e('0x5'));var path=require(_0x4f4e('0x6'));var sox=require('sox');var csv=require(_0x4f4e('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f4e('0x8'));var squel=require(_0x4f4e('0x9'));var crypto=require(_0x4f4e('0xa'));var jsforce=require(_0x4f4e('0xb'));var deskjs=require(_0x4f4e('0xc'));var toCsv=require(_0x4f4e('0x7'));var querystring=require(_0x4f4e('0xd'));var Papa=require(_0x4f4e('0xe'));var authService=require(_0x4f4e('0xf'));var hardwareService=require(_0x4f4e('0x10'));var Redis=require(_0x4f4e('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x4f4e('0x12'))(_0x4f4e('0x13'));var utils=require(_0x4f4e('0x14'));var config=require(_0x4f4e('0x15'));var db=require(_0x4f4e('0x16'))['db'];function respondWithStatusCode(_0x4d5915,_0x544bf4){_0x544bf4=_0x544bf4||0xcc;return function(_0x3e1cc3){if(_0x3e1cc3){return _0x4d5915[_0x4f4e('0x17')](_0x544bf4);}return _0x4d5915['status'](_0x544bf4)[_0x4f4e('0x18')]();};}function respondWithResult(_0x162a44,_0x43fc48){_0x43fc48=_0x43fc48||0xc8;return function(_0x56bec4){if(_0x56bec4){return _0x162a44['status'](_0x43fc48)[_0x4f4e('0x19')](_0x56bec4);}};}function respondWithFilteredResult(_0x53e31c,_0x598b88){return function(_0x19e28e){if(_0x19e28e){var _0x4e8df9=_0x19e28e[_0x4f4e('0x1a')],_0x3dffa8=_0x598b88[_0x4f4e('0x1b')],_0x438e5d=_0x598b88[_0x4f4e('0x1b')]+_0x598b88[_0x4f4e('0x1c')],_0x34f13d;if(_0x438e5d>=_0x4e8df9){_0x438e5d=_0x4e8df9;_0x34f13d=0xc8;}else{_0x34f13d=0xce;}_0x53e31c[_0x4f4e('0x1d')](_0x34f13d);return _0x53e31c[_0x4f4e('0x1e')](_0x4f4e('0x1f'),_0x3dffa8+'-'+_0x438e5d+'/'+_0x4e8df9)[_0x4f4e('0x19')](_0x19e28e);}return null;};}function patchUpdates(_0x21bd8e){return function(_0x574518){try{jsonpatch[_0x4f4e('0x20')](_0x574518,_0x21bd8e,!![]);}catch(_0x4e0a5d){return BPromise['reject'](_0x4e0a5d);}return _0x574518[_0x4f4e('0x21')]();};}function saveUpdates(_0x3ea37e,_0x142f6c){return function(_0x41d25b){if(_0x41d25b){return _0x41d25b[_0x4f4e('0x22')](_0x3ea37e)[_0x4f4e('0x23')](function(_0x31fab4){return _0x31fab4;});}return null;};}function removeEntity(_0x58c22a,_0x1a265f){return function(_0xf4c74f){if(_0xf4c74f){return _0xf4c74f[_0x4f4e('0x24')]()[_0x4f4e('0x23')](function(){var _0x4bc5b0=_0xf4c74f[_0x4f4e('0x25')]({'plain':!![]});var _0x32433d=_0x4f4e('0x26');return db[_0x4f4e('0x27')][_0x4f4e('0x24')]({'where':{'type':_0x32433d,'resourceId':_0x4bc5b0['id']}})[_0x4f4e('0x23')](function(){return _0xf4c74f;});})[_0x4f4e('0x23')](function(){_0x58c22a['status'](0xcc)[_0x4f4e('0x18')]();});}};}function handleEntityNotFound(_0x316f54,_0x13863f){return function(_0x258fb8){if(!_0x258fb8){_0x316f54[_0x4f4e('0x17')](0x194);}return _0x258fb8;};}function handleError(_0x48d3b0,_0x32b529){_0x32b529=_0x32b529||0x1f4;return function(_0x5f567b){logger[_0x4f4e('0x28')](_0x5f567b[_0x4f4e('0x29')]);if(_0x5f567b[_0x4f4e('0x2a')]){delete _0x5f567b[_0x4f4e('0x2a')];}_0x48d3b0['status'](_0x32b529)[_0x4f4e('0x2b')](_0x5f567b);};}exports[_0x4f4e('0x2c')]=function(_0x41a2e5,_0x27b8af){var _0x3b498e={},_0x7cd0ea={},_0x3b7f26={'count':0x0,'rows':[]};var _0x248269=db[_0x4f4e('0x2d')][_0x4f4e('0x2e')];_0x7cd0ea[_0x4f4e('0x2f')]=_[_0x4f4e('0x30')](_0x248269);_0x7cd0ea[_0x4f4e('0x31')]=_[_0x4f4e('0x30')](_0x41a2e5['query']);_0x7cd0ea[_0x4f4e('0x32')]=_[_0x4f4e('0x33')](_0x7cd0ea[_0x4f4e('0x2f')],_0x7cd0ea[_0x4f4e('0x31')]);_0x3b498e[_0x4f4e('0x34')]=_[_0x4f4e('0x33')](_0x7cd0ea[_0x4f4e('0x2f')],qs[_0x4f4e('0x35')](_0x41a2e5['query'][_0x4f4e('0x35')]));_0x3b498e[_0x4f4e('0x34')]=_0x3b498e[_0x4f4e('0x34')][_0x4f4e('0x36')]?_0x3b498e[_0x4f4e('0x34')]:_0x7cd0ea[_0x4f4e('0x2f')];if(!_0x41a2e5[_0x4f4e('0x31')]['hasOwnProperty']('nolimit')){_0x3b498e['limit']=qs[_0x4f4e('0x1c')](_0x41a2e5[_0x4f4e('0x31')][_0x4f4e('0x1c')]);_0x3b498e[_0x4f4e('0x1b')]=qs[_0x4f4e('0x1b')](_0x41a2e5['query']['offset']);}_0x3b498e[_0x4f4e('0x37')]=qs[_0x4f4e('0x38')](_0x41a2e5[_0x4f4e('0x31')][_0x4f4e('0x38')]);_0x3b498e[_0x4f4e('0x39')]=qs[_0x4f4e('0x32')](_[_0x4f4e('0x3a')](_0x41a2e5['query'],_0x7cd0ea[_0x4f4e('0x32')]));if(_0x41a2e5['query']['filter']){_0x3b498e[_0x4f4e('0x39')]=_[_0x4f4e('0x3b')](_0x3b498e[_0x4f4e('0x39')],{'$or':_['map'](_0x248269,function(_0x48ee98){if(_0x48ee98[_0x4f4e('0x3c')][_0x4f4e('0x3d')]!==_0x4f4e('0x3e')){var _0xdae924={};_0xdae924[_0x48ee98[_0x4f4e('0x3f')]]={'$like':'%'+_0x41a2e5[_0x4f4e('0x31')][_0x4f4e('0x40')]+'%'};return _0xdae924;}})});}_0x3b498e=_[_0x4f4e('0x3b')]({},_0x3b498e,_0x41a2e5['options']);var _0x467dc7={'where':_0x3b498e[_0x4f4e('0x39')]};return db[_0x4f4e('0x2d')]['count'](_0x467dc7)[_0x4f4e('0x23')](function(_0xe43ab2){_0x3b7f26[_0x4f4e('0x1a')]=_0xe43ab2;if(_0x41a2e5[_0x4f4e('0x31')][_0x4f4e('0x41')]){_0x3b498e[_0x4f4e('0x42')]=[{'all':!![]}];}return db[_0x4f4e('0x2d')]['findAll'](_0x3b498e);})['then'](function(_0x5155a1){_0x3b7f26['rows']=_0x5155a1;return _0x3b7f26;})[_0x4f4e('0x23')](respondWithFilteredResult(_0x27b8af,_0x3b498e))[_0x4f4e('0x43')](handleError(_0x27b8af,null));};exports[_0x4f4e('0x44')]=function(_0x654aad,_0x283b74){var _0x2ff65a={'raw':!![],'where':{'id':_0x654aad[_0x4f4e('0x45')]['id']}},_0x1b98d0={};_0x1b98d0[_0x4f4e('0x2f')]=_[_0x4f4e('0x30')](db[_0x4f4e('0x2d')][_0x4f4e('0x2e')]);_0x1b98d0['query']=_['keys'](_0x654aad[_0x4f4e('0x31')]);_0x1b98d0['filters']=_['intersection'](_0x1b98d0[_0x4f4e('0x2f')],_0x1b98d0[_0x4f4e('0x31')]);_0x2ff65a[_0x4f4e('0x34')]=_[_0x4f4e('0x33')](_0x1b98d0[_0x4f4e('0x2f')],qs['fields'](_0x654aad['query']['fields']));_0x2ff65a[_0x4f4e('0x34')]=_0x2ff65a[_0x4f4e('0x34')][_0x4f4e('0x36')]?_0x2ff65a[_0x4f4e('0x34')]:_0x1b98d0[_0x4f4e('0x2f')];if(_0x654aad[_0x4f4e('0x31')][_0x4f4e('0x41')]){_0x2ff65a[_0x4f4e('0x42')]=[{'all':!![]}];}_0x2ff65a=_[_0x4f4e('0x3b')]({},_0x2ff65a,_0x654aad[_0x4f4e('0x46')]);return db[_0x4f4e('0x2d')][_0x4f4e('0x47')](_0x2ff65a)[_0x4f4e('0x23')](handleEntityNotFound(_0x283b74,null))['then'](respondWithResult(_0x283b74,null))[_0x4f4e('0x43')](handleError(_0x283b74,null));};exports[_0x4f4e('0x48')]=function(_0x15b9e0,_0x47714c){return db['Template'][_0x4f4e('0x48')](_0x15b9e0[_0x4f4e('0x49')],{})[_0x4f4e('0x23')](function(_0x1eda64){var _0xd9405b=_0x15b9e0['user'][_0x4f4e('0x25')]({'plain':!![]});if(!_0xd9405b)throw new Error(_0x4f4e('0x4a'));if(_0xd9405b[_0x4f4e('0x4b')]==='user'){var _0xc528ba=_0x1eda64[_0x4f4e('0x25')]({'plain':!![]});var _0x35f467='Templates';return db[_0x4f4e('0x4c')]['find']({'where':{'name':_0x35f467,'userProfileId':_0xd9405b[_0x4f4e('0x4d')]},'raw':!![]})[_0x4f4e('0x23')](function(_0x22aa28){if(_0x22aa28&&_0x22aa28[_0x4f4e('0x4e')]===0x0){return db[_0x4f4e('0x27')][_0x4f4e('0x48')]({'name':_0xc528ba[_0x4f4e('0x2a')],'resourceId':_0xc528ba['id'],'type':_0x22aa28['name'],'sectionId':_0x22aa28['id']},{})[_0x4f4e('0x23')](function(){return _0x1eda64;});}else{return _0x1eda64;}})[_0x4f4e('0x43')](function(_0x254bf2){logger[_0x4f4e('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x254bf2);throw _0x254bf2;});}return _0x1eda64;})[_0x4f4e('0x23')](respondWithResult(_0x47714c,0xc9))[_0x4f4e('0x43')](handleError(_0x47714c,null));};exports[_0x4f4e('0x22')]=function(_0x55018e,_0x489c65){if(_0x55018e['body']['id']){delete _0x55018e[_0x4f4e('0x49')]['id'];}return db[_0x4f4e('0x2d')]['find']({'where':{'id':_0x55018e[_0x4f4e('0x45')]['id']}})[_0x4f4e('0x23')](handleEntityNotFound(_0x489c65,null))['then'](saveUpdates(_0x55018e['body'],null))[_0x4f4e('0x23')](respondWithResult(_0x489c65,null))[_0x4f4e('0x43')](handleError(_0x489c65,null));};exports[_0x4f4e('0x24')]=function(_0x3a0788,_0x4179db){return db['Template']['find']({'where':{'id':_0x3a0788[_0x4f4e('0x45')]['id']}})[_0x4f4e('0x23')](handleEntityNotFound(_0x4179db,null))[_0x4f4e('0x23')](removeEntity(_0x4179db,null))[_0x4f4e('0x43')](handleError(_0x4179db,null));}; \ No newline at end of file +var _0x1813=['bluebird','mustache','util','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','../../mysqldb','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Templates','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','map','VIRTUAL','field','merge','options','Template','includeAll','include','findAll','rows','params','length','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x5b1f05,_0x2ce935){var _0x37b5ae=function(_0x4c1307){while(--_0x4c1307){_0x5b1f05['push'](_0x5b1f05['shift']());}};_0x37b5ae(++_0x2ce935);}(_0x1813,0xa6));var _0x3181=function(_0x4150c7,_0x283881){_0x4150c7=_0x4150c7-0x0;var _0x3a2c93=_0x1813[_0x4150c7];return _0x3a2c93;};'use strict';var pdf=require(_0x3181('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3181('0x1'));var zipdir=require(_0x3181('0x2'));var jsonpatch=require(_0x3181('0x3'));var rp=require(_0x3181('0x4'));var moment=require(_0x3181('0x5'));var BPromise=require(_0x3181('0x6'));var Mustache=require(_0x3181('0x7'));var util=require(_0x3181('0x8'));var path=require(_0x3181('0x9'));var sox=require(_0x3181('0xa'));var csv=require(_0x3181('0xb'));var ejs=require(_0x3181('0xc'));var fs=require('fs');var _=require(_0x3181('0xd'));var squel=require(_0x3181('0xe'));var crypto=require('crypto');var jsforce=require(_0x3181('0xf'));var deskjs=require(_0x3181('0x10'));var toCsv=require(_0x3181('0xb'));var querystring=require(_0x3181('0x11'));var Papa=require(_0x3181('0x12'));var authService=require(_0x3181('0x13'));var hardwareService=require(_0x3181('0x14'));var Redis=require(_0x3181('0x15'));var qs=require(_0x3181('0x16'));var logger=require(_0x3181('0x17'))(_0x3181('0x18'));var utils=require(_0x3181('0x19'));var config=require('../../config/environment');var db=require(_0x3181('0x1a'))['db'];function respondWithStatusCode(_0x1d5426,_0x598d56){_0x598d56=_0x598d56||0xcc;return function(_0x1d998f){if(_0x1d998f){return _0x1d5426['sendStatus'](_0x598d56);}return _0x1d5426['status'](_0x598d56)[_0x3181('0x1b')]();};}function respondWithResult(_0x4589b2,_0x2b00cd){_0x2b00cd=_0x2b00cd||0xc8;return function(_0x29a401){if(_0x29a401){return _0x4589b2[_0x3181('0x1c')](_0x2b00cd)['json'](_0x29a401);}};}function respondWithFilteredResult(_0x42ab92,_0x55852d){return function(_0x3534c4){if(_0x3534c4){var _0x2dc459=_0x3534c4[_0x3181('0x1d')],_0x45a0c0=_0x55852d['offset'],_0x537a2f=_0x55852d[_0x3181('0x1e')]+_0x55852d[_0x3181('0x1f')],_0x23fff9;if(_0x537a2f>=_0x2dc459){_0x537a2f=_0x2dc459;_0x23fff9=0xc8;}else{_0x23fff9=0xce;}_0x42ab92[_0x3181('0x1c')](_0x23fff9);return _0x42ab92[_0x3181('0x20')](_0x3181('0x21'),_0x45a0c0+'-'+_0x537a2f+'/'+_0x2dc459)[_0x3181('0x22')](_0x3534c4);}return null;};}function patchUpdates(_0x10a789){return function(_0x43f59a){try{jsonpatch[_0x3181('0x23')](_0x43f59a,_0x10a789,!![]);}catch(_0x336135){return BPromise[_0x3181('0x24')](_0x336135);}return _0x43f59a[_0x3181('0x25')]();};}function saveUpdates(_0x12563e,_0xc1c84c){return function(_0x441f95){if(_0x441f95){return _0x441f95[_0x3181('0x26')](_0x12563e)['then'](function(_0x13f508){return _0x13f508;});}return null;};}function removeEntity(_0x40ce99,_0x2f86fb){return function(_0x4f1648){if(_0x4f1648){return _0x4f1648[_0x3181('0x27')]()[_0x3181('0x28')](function(){var _0x4b0204=_0x4f1648[_0x3181('0x29')]({'plain':!![]});var _0x19b219=_0x3181('0x2a');return db[_0x3181('0x2b')][_0x3181('0x27')]({'where':{'type':_0x19b219,'resourceId':_0x4b0204['id']}})['then'](function(){return _0x4f1648;});})[_0x3181('0x28')](function(){_0x40ce99['status'](0xcc)[_0x3181('0x1b')]();});}};}function handleEntityNotFound(_0x3fcd6a,_0x2258eb){return function(_0x3698f6){if(!_0x3698f6){_0x3fcd6a[_0x3181('0x2c')](0x194);}return _0x3698f6;};}function handleError(_0x2ef4ff,_0x3b21a0){_0x3b21a0=_0x3b21a0||0x1f4;return function(_0x51d7f7){logger[_0x3181('0x2d')](_0x51d7f7[_0x3181('0x2e')]);if(_0x51d7f7[_0x3181('0x2f')]){delete _0x51d7f7['name'];}_0x2ef4ff['status'](_0x3b21a0)[_0x3181('0x30')](_0x51d7f7);};}exports[_0x3181('0x31')]=function(_0x20faa2,_0x1adb7c){var _0x12aa85={},_0x494e72={},_0x38fb87={'count':0x0,'rows':[]};var _0x5220d4=db['Template'][_0x3181('0x32')];_0x494e72[_0x3181('0x33')]=_[_0x3181('0x34')](_0x5220d4);_0x494e72[_0x3181('0x35')]=_[_0x3181('0x34')](_0x20faa2[_0x3181('0x35')]);_0x494e72[_0x3181('0x36')]=_[_0x3181('0x37')](_0x494e72[_0x3181('0x33')],_0x494e72['query']);_0x12aa85[_0x3181('0x38')]=_[_0x3181('0x37')](_0x494e72['model'],qs[_0x3181('0x39')](_0x20faa2[_0x3181('0x35')][_0x3181('0x39')]));_0x12aa85['attributes']=_0x12aa85['attributes']['length']?_0x12aa85[_0x3181('0x38')]:_0x494e72[_0x3181('0x33')];if(!_0x20faa2[_0x3181('0x35')][_0x3181('0x3a')]('nolimit')){_0x12aa85[_0x3181('0x1f')]=qs[_0x3181('0x1f')](_0x20faa2[_0x3181('0x35')]['limit']);_0x12aa85['offset']=qs[_0x3181('0x1e')](_0x20faa2[_0x3181('0x35')][_0x3181('0x1e')]);}_0x12aa85[_0x3181('0x3b')]=qs[_0x3181('0x3c')](_0x20faa2[_0x3181('0x35')][_0x3181('0x3c')]);_0x12aa85[_0x3181('0x3d')]=qs['filters'](_[_0x3181('0x3e')](_0x20faa2[_0x3181('0x35')],_0x494e72[_0x3181('0x36')]));if(_0x20faa2['query'][_0x3181('0x3f')]){_0x12aa85[_0x3181('0x3d')]=_['merge'](_0x12aa85[_0x3181('0x3d')],{'$or':_[_0x3181('0x40')](_0x5220d4,function(_0x11c77f){if(_0x11c77f['type']['key']!==_0x3181('0x41')){var _0x4a968f={};_0x4a968f[_0x11c77f[_0x3181('0x42')]]={'$like':'%'+_0x20faa2[_0x3181('0x35')]['filter']+'%'};return _0x4a968f;}})});}_0x12aa85=_[_0x3181('0x43')]({},_0x12aa85,_0x20faa2[_0x3181('0x44')]);var _0x421c19={'where':_0x12aa85['where']};return db[_0x3181('0x45')][_0x3181('0x1d')](_0x421c19)[_0x3181('0x28')](function(_0x1625b6){_0x38fb87[_0x3181('0x1d')]=_0x1625b6;if(_0x20faa2[_0x3181('0x35')][_0x3181('0x46')]){_0x12aa85[_0x3181('0x47')]=[{'all':!![]}];}return db[_0x3181('0x45')][_0x3181('0x48')](_0x12aa85);})[_0x3181('0x28')](function(_0x45836c){_0x38fb87[_0x3181('0x49')]=_0x45836c;return _0x38fb87;})[_0x3181('0x28')](respondWithFilteredResult(_0x1adb7c,_0x12aa85))['catch'](handleError(_0x1adb7c,null));};exports['show']=function(_0xf7208f,_0x244b3d){var _0x3909b8={'raw':!![],'where':{'id':_0xf7208f[_0x3181('0x4a')]['id']}},_0x1873d3={};_0x1873d3['model']=_[_0x3181('0x34')](db[_0x3181('0x45')][_0x3181('0x32')]);_0x1873d3[_0x3181('0x35')]=_[_0x3181('0x34')](_0xf7208f[_0x3181('0x35')]);_0x1873d3[_0x3181('0x36')]=_['intersection'](_0x1873d3[_0x3181('0x33')],_0x1873d3['query']);_0x3909b8[_0x3181('0x38')]=_[_0x3181('0x37')](_0x1873d3[_0x3181('0x33')],qs['fields'](_0xf7208f[_0x3181('0x35')]['fields']));_0x3909b8[_0x3181('0x38')]=_0x3909b8[_0x3181('0x38')][_0x3181('0x4b')]?_0x3909b8['attributes']:_0x1873d3['model'];if(_0xf7208f[_0x3181('0x35')][_0x3181('0x46')]){_0x3909b8[_0x3181('0x47')]=[{'all':!![]}];}_0x3909b8=_[_0x3181('0x43')]({},_0x3909b8,_0xf7208f[_0x3181('0x44')]);return db['Template'][_0x3181('0x4c')](_0x3909b8)['then'](handleEntityNotFound(_0x244b3d,null))[_0x3181('0x28')](respondWithResult(_0x244b3d,null))[_0x3181('0x4d')](handleError(_0x244b3d,null));};exports['create']=function(_0xfd5610,_0x71b262){return db[_0x3181('0x45')][_0x3181('0x4e')](_0xfd5610[_0x3181('0x4f')],{})[_0x3181('0x28')](function(_0x259e87){var _0x444d14=_0xfd5610['user'][_0x3181('0x29')]({'plain':!![]});if(!_0x444d14)throw new Error(_0x3181('0x50'));if(_0x444d14['role']===_0x3181('0x51')){var _0x252c98=_0x259e87[_0x3181('0x29')]({'plain':!![]});var _0x4eb462='Templates';return db[_0x3181('0x52')][_0x3181('0x4c')]({'where':{'name':_0x4eb462,'userProfileId':_0x444d14[_0x3181('0x53')]},'raw':!![]})[_0x3181('0x28')](function(_0x4c1b5f){if(_0x4c1b5f&&_0x4c1b5f[_0x3181('0x54')]===0x0){return db[_0x3181('0x2b')][_0x3181('0x4e')]({'name':_0x252c98[_0x3181('0x2f')],'resourceId':_0x252c98['id'],'type':_0x4c1b5f[_0x3181('0x2f')],'sectionId':_0x4c1b5f['id']},{})[_0x3181('0x28')](function(){return _0x259e87;});}else{return _0x259e87;}})[_0x3181('0x4d')](function(_0x1baddb){logger[_0x3181('0x2d')](_0x3181('0x55'),_0x1baddb);throw _0x1baddb;});}return _0x259e87;})[_0x3181('0x28')](respondWithResult(_0x71b262,0xc9))[_0x3181('0x4d')](handleError(_0x71b262,null));};exports[_0x3181('0x26')]=function(_0x4fbc00,_0x28dcf0){if(_0x4fbc00[_0x3181('0x4f')]['id']){delete _0x4fbc00[_0x3181('0x4f')]['id'];}return db[_0x3181('0x45')][_0x3181('0x4c')]({'where':{'id':_0x4fbc00[_0x3181('0x4a')]['id']}})[_0x3181('0x28')](handleEntityNotFound(_0x28dcf0,null))[_0x3181('0x28')](saveUpdates(_0x4fbc00[_0x3181('0x4f')],null))[_0x3181('0x28')](respondWithResult(_0x28dcf0,null))['catch'](handleError(_0x28dcf0,null));};exports[_0x3181('0x27')]=function(_0x20f842,_0x2edbae){return db[_0x3181('0x45')][_0x3181('0x4c')]({'where':{'id':_0x20f842[_0x3181('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2edbae,null))[_0x3181('0x28')](removeEntity(_0x2edbae,null))[_0x3181('0x4d')](handleError(_0x2edbae,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 0c941eb..870e902 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 _0x5788=['request-promise','exports','Template','tools_templates','lodash','util','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5788,0x14c));var _0x8578=function(_0x4390a6,_0x3cc5f1){_0x4390a6=_0x4390a6-0x0;var _0x1fa920=_0x5788[_0x4390a6];return _0x1fa920;};'use strict';var _=require(_0x8578('0x0'));var util=require(_0x8578('0x1'));var logger=require('../../config/logger')(_0x8578('0x2'));var moment=require(_0x8578('0x3'));var BPromise=require('bluebird');var rp=require(_0x8578('0x4'));var attributes=require('./template.attributes');module[_0x8578('0x5')]=function(_0x3444b6,_0x3e1643){return _0x3444b6['define'](_0x8578('0x6'),attributes,{'tableName':_0x8578('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5569=['bluebird','./template.attributes','Template','tools_templates','lodash','../../config/logger','api','moment'];(function(_0x3d297e,_0x3551ee){var _0x4f36cf=function(_0x44710d){while(--_0x44710d){_0x3d297e['push'](_0x3d297e['shift']());}};_0x4f36cf(++_0x3551ee);}(_0x5569,0x94));var _0x9556=function(_0x117994,_0x46bbbb){_0x117994=_0x117994-0x0;var _0x40814a=_0x5569[_0x117994];return _0x40814a;};'use strict';var _=require(_0x9556('0x0'));var util=require('util');var logger=require(_0x9556('0x1'))(_0x9556('0x2'));var moment=require(_0x9556('0x3'));var BPromise=require(_0x9556('0x4'));var rp=require('request-promise');var attributes=require(_0x9556('0x5'));module['exports']=function(_0x311086,_0x5be74d){return _0x311086['define'](_0x9556('0x6'),attributes,{'tableName':_0x9556('0x7'),'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 4d7f505..dcb1302 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 _0x45fc=['request\x20sent','debug','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s'];(function(_0x5c5060,_0x3dbb92){var _0x5c7a34=function(_0x3cdaa8){while(--_0x3cdaa8){_0x5c5060['push'](_0x5c5060['shift']());}};_0x5c7a34(++_0x3dbb92);}(_0x45fc,0x191));var _0xc45f=function(_0x5ec93a,_0x2a1519){_0x5ec93a=_0x5ec93a-0x0;var _0x3fac98=_0x45fc[_0x5ec93a];return _0x3fac98;};'use strict';var _=require(_0xc45f('0x0'));var util=require(_0xc45f('0x1'));var moment=require(_0xc45f('0x2'));var BPromise=require(_0xc45f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc45f('0x4'));var db=require(_0xc45f('0x5'))['db'];var utils=require(_0xc45f('0x6'));var logger=require(_0xc45f('0x7'))('rpc');var config=require(_0xc45f('0x8'));var jayson=require(_0xc45f('0x9'));var client=jayson['client'][_0xc45f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c42ee,_0x4b08fa,_0x120eba){return new BPromise(function(_0x1e02ce,_0x5611dc){return client[_0xc45f('0xb')](_0x5c42ee,_0x120eba)[_0xc45f('0xc')](function(_0x1acb52){logger[_0xc45f('0xd')](_0xc45f('0xe'),_0x4b08fa,_0xc45f('0xf'));logger[_0xc45f('0x10')]('Template,\x20%s,\x20%s,\x20%s',_0x4b08fa,_0xc45f('0xf'),JSON[_0xc45f('0x11')](_0x1acb52));if(_0x1acb52[_0xc45f('0x12')]){if(_0x1acb52[_0xc45f('0x12')][_0xc45f('0x13')]===0x1f4){logger[_0xc45f('0x12')]('Template,\x20%s,\x20%s',_0x4b08fa,_0x1acb52['error'][_0xc45f('0x14')]);return _0x5611dc(_0x1acb52['error'][_0xc45f('0x14')]);}logger[_0xc45f('0x12')](_0xc45f('0xe'),_0x4b08fa,_0x1acb52[_0xc45f('0x12')]['message']);return _0x1e02ce(_0x1acb52[_0xc45f('0x12')][_0xc45f('0x14')]);}else{logger[_0xc45f('0xd')](_0xc45f('0xe'),_0x4b08fa,_0xc45f('0xf'));_0x1e02ce(_0x1acb52[_0xc45f('0x15')][_0xc45f('0x14')]);}})[_0xc45f('0x16')](function(_0xdd1b56){logger[_0xc45f('0x12')](_0xc45f('0xe'),_0x4b08fa,_0xdd1b56);_0x5611dc(_0xdd1b56);});});}exports[_0xc45f('0x17')]=function(_0x3daa4e){var _0x897e13=this;return new Promise(function(_0x552c8c,_0x25c6af){return db[_0xc45f('0x18')][_0xc45f('0x19')]({'raw':_0x3daa4e[_0xc45f('0x1a')]?_0x3daa4e[_0xc45f('0x1a')][_0xc45f('0x1b')]===undefined?!![]:![]:!![],'where':_0x3daa4e[_0xc45f('0x1a')]?_0x3daa4e[_0xc45f('0x1a')]['where']||null:null,'attributes':_0x3daa4e[_0xc45f('0x1a')]?_0x3daa4e[_0xc45f('0x1a')][_0xc45f('0x1c')]||null:null,'limit':_0x3daa4e['options']?_0x3daa4e['options']['limit']||null:null,'include':_0x3daa4e['options']?_0x3daa4e[_0xc45f('0x1a')][_0xc45f('0x1d')]?_[_0xc45f('0x1e')](_0x3daa4e[_0xc45f('0x1a')][_0xc45f('0x1d')],function(_0x2fbc04){return{'model':db[_0x2fbc04[_0xc45f('0x1f')]],'as':_0x2fbc04['as'],'attributes':_0x2fbc04[_0xc45f('0x1c')],'include':_0x2fbc04[_0xc45f('0x1d')]?_[_0xc45f('0x1e')](_0x2fbc04[_0xc45f('0x1d')],function(_0x2a1378){return{'model':db[_0x2a1378[_0xc45f('0x1f')]],'as':_0x2a1378['as'],'attributes':_0x2a1378[_0xc45f('0x1c')],'include':_0x2a1378[_0xc45f('0x1d')]?_['map'](_0x2a1378[_0xc45f('0x1d')],function(_0x2a88dd){return{'model':db[_0x2a88dd['model']],'as':_0x2a88dd['as'],'attributes':_0x2a88dd['attributes']};}):[]};}):[]};}):[]:[]})[_0xc45f('0xc')](function(_0x995752){logger[_0xc45f('0xd')](_0xc45f('0x17'),_0x3daa4e);logger[_0xc45f('0x10')](_0xc45f('0x17'),_0x3daa4e,JSON[_0xc45f('0x11')](_0x995752));_0x552c8c(_0x995752);})[_0xc45f('0x16')](function(_0x12d0fd){logger[_0xc45f('0x12')]('GetTemplate',_0x12d0fd['message'],_0x3daa4e);_0x25c6af(_0x897e13['error'](0x1f4,_0x12d0fd['message']));});});}; \ No newline at end of file +var _0x4901=['http','request','then','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetTemplate','findAll','options','raw','where','limit','include','map','model','info','debug','lodash','util','moment','randomstring','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x4901,0x155));var _0x1490=function(_0x30d755,_0x188807){_0x30d755=_0x30d755-0x0;var _0xa16cea=_0x4901[_0x30d755];return _0xa16cea;};'use strict';var _=require(_0x1490('0x0'));var util=require(_0x1490('0x1'));var moment=require(_0x1490('0x2'));var BPromise=require('bluebird');var rs=require(_0x1490('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1490('0x4'))('rpc');var config=require(_0x1490('0x5'));var jayson=require(_0x1490('0x6'));var client=jayson['client'][_0x1490('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ee4b7,_0x556e54,_0x24c228){return new BPromise(function(_0x332321,_0x15bde8){return client[_0x1490('0x8')](_0x1ee4b7,_0x24c228)[_0x1490('0x9')](function(_0x398691){logger['info'](_0x1490('0xa'),_0x556e54,'request\x20sent');logger['debug'](_0x1490('0xb'),_0x556e54,_0x1490('0xc'),JSON['stringify'](_0x398691));if(_0x398691[_0x1490('0xd')]){if(_0x398691[_0x1490('0xd')][_0x1490('0xe')]===0x1f4){logger[_0x1490('0xd')](_0x1490('0xa'),_0x556e54,_0x398691[_0x1490('0xd')][_0x1490('0xf')]);return _0x15bde8(_0x398691[_0x1490('0xd')][_0x1490('0xf')]);}logger[_0x1490('0xd')](_0x1490('0xa'),_0x556e54,_0x398691[_0x1490('0xd')]['message']);return _0x332321(_0x398691[_0x1490('0xd')][_0x1490('0xf')]);}else{logger['info'](_0x1490('0xa'),_0x556e54,_0x1490('0xc'));_0x332321(_0x398691[_0x1490('0x10')][_0x1490('0xf')]);}})[_0x1490('0x11')](function(_0x5bc647){logger[_0x1490('0xd')]('Template,\x20%s,\x20%s',_0x556e54,_0x5bc647);_0x15bde8(_0x5bc647);});});}exports[_0x1490('0x12')]=function(_0x53e967){var _0x1fe196=this;return new Promise(function(_0x28a80f,_0x34f411){return db['Template'][_0x1490('0x13')]({'raw':_0x53e967[_0x1490('0x14')]?_0x53e967[_0x1490('0x14')][_0x1490('0x15')]===undefined?!![]:![]:!![],'where':_0x53e967[_0x1490('0x14')]?_0x53e967['options'][_0x1490('0x16')]||null:null,'attributes':_0x53e967['options']?_0x53e967[_0x1490('0x14')]['attributes']||null:null,'limit':_0x53e967['options']?_0x53e967[_0x1490('0x14')][_0x1490('0x17')]||null:null,'include':_0x53e967['options']?_0x53e967[_0x1490('0x14')][_0x1490('0x18')]?_['map'](_0x53e967[_0x1490('0x14')][_0x1490('0x18')],function(_0x4aa207){return{'model':db[_0x4aa207['model']],'as':_0x4aa207['as'],'attributes':_0x4aa207['attributes'],'include':_0x4aa207[_0x1490('0x18')]?_[_0x1490('0x19')](_0x4aa207[_0x1490('0x18')],function(_0xed6483){return{'model':db[_0xed6483[_0x1490('0x1a')]],'as':_0xed6483['as'],'attributes':_0xed6483['attributes'],'include':_0xed6483[_0x1490('0x18')]?_[_0x1490('0x19')](_0xed6483[_0x1490('0x18')],function(_0x2e96ab){return{'model':db[_0x2e96ab[_0x1490('0x1a')]],'as':_0x2e96ab['as'],'attributes':_0x2e96ab['attributes']};}):[]};}):[]};}):[]:[]})[_0x1490('0x9')](function(_0x2a3766){logger[_0x1490('0x1b')](_0x1490('0x12'),_0x53e967);logger[_0x1490('0x1c')](_0x1490('0x12'),_0x53e967,JSON['stringify'](_0x2a3766));_0x28a80f(_0x2a3766);})[_0x1490('0x11')](function(_0x185688){logger[_0x1490('0xd')](_0x1490('0x12'),_0x185688[_0x1490('0xf')],_0x53e967);_0x34f411(_0x1fe196[_0x1490('0xd')](0x1f4,_0x185688[_0x1490('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 1bd820b..123dc73 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 _0x74b1=['post','addAllCondition','addAnyCondition','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions'];(function(_0x542826,_0x1f5f02){var _0x4dc270=function(_0x4a6def){while(--_0x4a6def){_0x542826['push'](_0x542826['shift']());}};_0x4dc270(++_0x1f5f02);}(_0x74b1,0x1b0));var _0x174b=function(_0x30c2ae,_0x4c98a2){_0x30c2ae=_0x30c2ae-0x0;var _0x1ee1cc=_0x74b1[_0x30c2ae];return _0x1ee1cc;};'use strict';var multer=require(_0x174b('0x0'));var util=require(_0x174b('0x1'));var path=require(_0x174b('0x2'));var timeout=require(_0x174b('0x3'));var express=require(_0x174b('0x4'));var router=express[_0x174b('0x5')]();var auth=require(_0x174b('0x6'));var interaction=require(_0x174b('0x7'));var config=require(_0x174b('0x8'));var controller=require(_0x174b('0x9'));router[_0x174b('0xa')]('/',auth[_0x174b('0xb')](),controller['index']);router[_0x174b('0xa')](_0x174b('0xc'),auth[_0x174b('0xb')](),controller[_0x174b('0xd')]);router['get'](_0x174b('0xe'),auth[_0x174b('0xb')](),controller['getAllConditions']);router['get'](_0x174b('0xf'),auth[_0x174b('0xb')](),controller[_0x174b('0x10')]);router[_0x174b('0xa')](_0x174b('0x11'),auth[_0x174b('0xb')](),controller['getActions']);router[_0x174b('0x12')]('/',auth[_0x174b('0xb')](),controller['create']);router[_0x174b('0x12')](_0x174b('0xe'),auth[_0x174b('0xb')](),controller[_0x174b('0x13')]);router[_0x174b('0x12')](_0x174b('0xf'),auth[_0x174b('0xb')](),controller[_0x174b('0x14')]);router[_0x174b('0x12')](_0x174b('0x11'),auth['isAuthenticated'](),controller['addAction']);router['put'](_0x174b('0xc'),auth[_0x174b('0xb')](),controller[_0x174b('0x15')]);router[_0x174b('0x16')](_0x174b('0xc'),auth['isAuthenticated'](),controller[_0x174b('0x17')]);module[_0x174b('0x18')]=router; \ No newline at end of file +var _0xde0f=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','put','update','destroy'];(function(_0x4460c0,_0x125527){var _0x19da2b=function(_0x5db4f5){while(--_0x5db4f5){_0x4460c0['push'](_0x4460c0['shift']());}};_0x19da2b(++_0x125527);}(_0xde0f,0x1bb));var _0xfde0=function(_0x24b2de,_0x1f517b){_0x24b2de=_0x24b2de-0x0;var _0x54ad39=_0xde0f[_0x24b2de];return _0x54ad39;};'use strict';var multer=require('multer');var util=require(_0xfde0('0x0'));var path=require('path');var timeout=require(_0xfde0('0x1'));var express=require(_0xfde0('0x2'));var router=express[_0xfde0('0x3')]();var auth=require(_0xfde0('0x4'));var interaction=require(_0xfde0('0x5'));var config=require(_0xfde0('0x6'));var controller=require(_0xfde0('0x7'));router[_0xfde0('0x8')]('/',auth['isAuthenticated'](),controller[_0xfde0('0x9')]);router[_0xfde0('0x8')](_0xfde0('0xa'),auth[_0xfde0('0xb')](),controller['show']);router['get'](_0xfde0('0xc'),auth[_0xfde0('0xb')](),controller[_0xfde0('0xd')]);router[_0xfde0('0x8')](_0xfde0('0xe'),auth[_0xfde0('0xb')](),controller[_0xfde0('0xf')]);router[_0xfde0('0x8')](_0xfde0('0x10'),auth[_0xfde0('0xb')](),controller[_0xfde0('0x11')]);router[_0xfde0('0x12')]('/',auth[_0xfde0('0xb')](),controller[_0xfde0('0x13')]);router[_0xfde0('0x12')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0xfde0('0x14')]);router['post'](_0xfde0('0xe'),auth[_0xfde0('0xb')](),controller[_0xfde0('0x15')]);router[_0xfde0('0x12')](_0xfde0('0x10'),auth[_0xfde0('0xb')](),controller['addAction']);router[_0xfde0('0x16')](_0xfde0('0xa'),auth[_0xfde0('0xb')](),controller[_0xfde0('0x17')]);router['delete'](_0xfde0('0xa'),auth[_0xfde0('0xb')](),controller[_0xfde0('0x18')]);module[_0xfde0('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 031ba16..d7272e3 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 _0xba84=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3b71ab,_0x360487){var _0x13241c=function(_0x2e5f76){while(--_0x2e5f76){_0x3b71ab['push'](_0x3b71ab['shift']());}};_0x13241c(++_0x360487);}(_0xba84,0x1b3));var _0x4ba8=function(_0x140a02,_0x294cdd){_0x140a02=_0x140a02-0x0;var _0x3c1b8c=_0xba84[_0x140a02];return _0x3c1b8c;};'use strict';var Sequelize=require(_0x4ba8('0x0'));module[_0x4ba8('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4ba8('0x2')]},'description':{'type':Sequelize[_0x4ba8('0x2')]},'status':{'type':Sequelize[_0x4ba8('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x7116=['exports','STRING','BOOLEAN','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7116,0x153));var _0x6711=function(_0x16e68e,_0x22bed3){_0x16e68e=_0x16e68e-0x0;var _0x1ae45d=_0x7116[_0x16e68e];return _0x1ae45d;};'use strict';var Sequelize=require(_0x6711('0x0'));module[_0x6711('0x1')]={'name':{'type':Sequelize[_0x6711('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6711('0x2')]},'status':{'type':Sequelize[_0x6711('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 c7c312a..ba5af50 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 _0x1afa=['getAllConditions','order','getAnyConditions','findOne','map','addAction','TriggerId','Action','getActions','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Triggers','stack','name','index','Trigger','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','key','VIRTUAL','field','includeAll','findAll','rows','catch','show','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','params','Condition','addAnyCondition','TriggerAnyId'];(function(_0x22eda6,_0xf204a){var _0x57755f=function(_0x11c4f1){while(--_0x11c4f1){_0x22eda6['push'](_0x22eda6['shift']());}};_0x57755f(++_0xf204a);}(_0x1afa,0x65));var _0xa1af=function(_0x58b033,_0x1b0f7d){_0x58b033=_0x58b033-0x0;var _0x5d9f83=_0x1afa[_0x58b033];return _0x5d9f83;};'use strict';var pdf=require(_0xa1af('0x0'));var emlformat=require(_0xa1af('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa1af('0x2'));var jsonpatch=require(_0xa1af('0x3'));var rp=require('request-promise');var moment=require(_0xa1af('0x4'));var BPromise=require(_0xa1af('0x5'));var Mustache=require('mustache');var util=require(_0xa1af('0x6'));var path=require(_0xa1af('0x7'));var sox=require(_0xa1af('0x8'));var csv=require(_0xa1af('0x9'));var ejs=require(_0xa1af('0xa'));var fs=require('fs');var _=require(_0xa1af('0xb'));var squel=require(_0xa1af('0xc'));var crypto=require(_0xa1af('0xd'));var jsforce=require(_0xa1af('0xe'));var deskjs=require(_0xa1af('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa1af('0x10'));var Papa=require(_0xa1af('0x11'));var authService=require(_0xa1af('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xa1af('0x13'));var logger=require(_0xa1af('0x14'))(_0xa1af('0x15'));var utils=require(_0xa1af('0x16'));var config=require(_0xa1af('0x17'));var db=require(_0xa1af('0x18'))['db'];function respondWithStatusCode(_0x490ee5,_0x43a6d9){_0x43a6d9=_0x43a6d9||0xcc;return function(_0x285edf){if(_0x285edf){return _0x490ee5[_0xa1af('0x19')](_0x43a6d9);}return _0x490ee5[_0xa1af('0x1a')](_0x43a6d9)[_0xa1af('0x1b')]();};}function respondWithResult(_0x325470,_0x1fbcab){_0x1fbcab=_0x1fbcab||0xc8;return function(_0x1c3149){if(_0x1c3149){return _0x325470[_0xa1af('0x1a')](_0x1fbcab)[_0xa1af('0x1c')](_0x1c3149);}};}function respondWithFilteredResult(_0x3d0036,_0x709402){return function(_0x582b6b){if(_0x582b6b){var _0x10aa37=_0x582b6b[_0xa1af('0x1d')],_0x5cc261=_0x709402[_0xa1af('0x1e')],_0x1666a2=_0x709402[_0xa1af('0x1e')]+_0x709402[_0xa1af('0x1f')],_0x260985;if(_0x1666a2>=_0x10aa37){_0x1666a2=_0x10aa37;_0x260985=0xc8;}else{_0x260985=0xce;}_0x3d0036[_0xa1af('0x1a')](_0x260985);return _0x3d0036[_0xa1af('0x20')](_0xa1af('0x21'),_0x5cc261+'-'+_0x1666a2+'/'+_0x10aa37)['json'](_0x582b6b);}return null;};}function patchUpdates(_0x30c5fc){return function(_0x57b0e8){try{jsonpatch[_0xa1af('0x22')](_0x57b0e8,_0x30c5fc,!![]);}catch(_0x57ba3a){return BPromise[_0xa1af('0x23')](_0x57ba3a);}return _0x57b0e8['save']();};}function saveUpdates(_0x1acb40,_0x596dd5){return function(_0x132571){if(_0x132571){return _0x132571[_0xa1af('0x24')](_0x1acb40)[_0xa1af('0x25')](function(_0x21fa8b){return _0x21fa8b;});}return null;};}function removeEntity(_0x2757cf,_0x457142){return function(_0x405449){if(_0x405449){return _0x405449[_0xa1af('0x26')]()[_0xa1af('0x25')](function(){var _0x12f261=_0x405449[_0xa1af('0x27')]({'plain':!![]});var _0x4fe0bb=_0xa1af('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x4fe0bb,'resourceId':_0x12f261['id']}})[_0xa1af('0x25')](function(){return _0x405449;});})[_0xa1af('0x25')](function(){_0x2757cf[_0xa1af('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d18c8,_0x9a9187){return function(_0x835910){if(!_0x835910){_0x3d18c8[_0xa1af('0x19')](0x194);}return _0x835910;};}function handleError(_0x4cfa9e,_0x38a8ed){_0x38a8ed=_0x38a8ed||0x1f4;return function(_0x5260e2){logger['error'](_0x5260e2[_0xa1af('0x29')]);if(_0x5260e2[_0xa1af('0x2a')]){delete _0x5260e2['name'];}_0x4cfa9e[_0xa1af('0x1a')](_0x38a8ed)['send'](_0x5260e2);};}exports[_0xa1af('0x2b')]=function(_0xf51c11,_0x4a6ecf){var _0x1bdf99={},_0x21cdf5={},_0x482d50={'count':0x0,'rows':[]};var _0x356fcd=db[_0xa1af('0x2c')][_0xa1af('0x2d')];_0x21cdf5['model']=_['keys'](_0x356fcd);_0x21cdf5[_0xa1af('0x2e')]=_[_0xa1af('0x2f')](_0xf51c11[_0xa1af('0x2e')]);_0x21cdf5[_0xa1af('0x30')]=_[_0xa1af('0x31')](_0x21cdf5[_0xa1af('0x32')],_0x21cdf5[_0xa1af('0x2e')]);_0x1bdf99[_0xa1af('0x33')]=_[_0xa1af('0x31')](_0x21cdf5[_0xa1af('0x32')],qs[_0xa1af('0x34')](_0xf51c11[_0xa1af('0x2e')][_0xa1af('0x34')]));_0x1bdf99[_0xa1af('0x33')]=_0x1bdf99[_0xa1af('0x33')][_0xa1af('0x35')]?_0x1bdf99[_0xa1af('0x33')]:_0x21cdf5['model'];if(!_0xf51c11[_0xa1af('0x2e')][_0xa1af('0x36')](_0xa1af('0x37'))){_0x1bdf99[_0xa1af('0x1f')]=qs[_0xa1af('0x1f')](_0xf51c11[_0xa1af('0x2e')]['limit']);_0x1bdf99[_0xa1af('0x1e')]=qs[_0xa1af('0x1e')](_0xf51c11[_0xa1af('0x2e')][_0xa1af('0x1e')]);}_0x1bdf99['order']=qs[_0xa1af('0x38')](_0xf51c11[_0xa1af('0x2e')][_0xa1af('0x38')]);_0x1bdf99[_0xa1af('0x39')]=qs['filters'](_[_0xa1af('0x3a')](_0xf51c11['query'],_0x21cdf5['filters']));if(_0xf51c11[_0xa1af('0x2e')][_0xa1af('0x3b')]){_0x1bdf99[_0xa1af('0x39')]=_['merge'](_0x1bdf99[_0xa1af('0x39')],{'$or':_['map'](_0x356fcd,function(_0x359522){if(_0x359522['type'][_0xa1af('0x3c')]!==_0xa1af('0x3d')){var _0x30be5d={};_0x30be5d[_0x359522[_0xa1af('0x3e')]]={'$like':'%'+_0xf51c11[_0xa1af('0x2e')][_0xa1af('0x3b')]+'%'};return _0x30be5d;}})});}_0x1bdf99=_['merge']({},_0x1bdf99,_0xf51c11['options']);var _0x1a4319={'where':_0x1bdf99[_0xa1af('0x39')]};return db[_0xa1af('0x2c')][_0xa1af('0x1d')](_0x1a4319)[_0xa1af('0x25')](function(_0x327744){_0x482d50[_0xa1af('0x1d')]=_0x327744;if(_0xf51c11[_0xa1af('0x2e')][_0xa1af('0x3f')]){_0x1bdf99['include']=[{'all':!![]}];}return db['Trigger'][_0xa1af('0x40')](_0x1bdf99);})[_0xa1af('0x25')](function(_0x5a6cfa){_0x482d50[_0xa1af('0x41')]=_0x5a6cfa;return _0x482d50;})[_0xa1af('0x25')](respondWithFilteredResult(_0x4a6ecf,_0x1bdf99))[_0xa1af('0x42')](handleError(_0x4a6ecf,null));};exports[_0xa1af('0x43')]=function(_0x4f8696,_0x324037){var _0xcc5d1a={'raw':![],'where':{'id':_0x4f8696['params']['id']}},_0x571390={};_0x571390[_0xa1af('0x32')]=_[_0xa1af('0x2f')](db[_0xa1af('0x2c')][_0xa1af('0x2d')]);_0x571390[_0xa1af('0x2e')]=_[_0xa1af('0x2f')](_0x4f8696[_0xa1af('0x2e')]);_0x571390[_0xa1af('0x30')]=_[_0xa1af('0x31')](_0x571390['model'],_0x571390['query']);_0xcc5d1a['attributes']=_[_0xa1af('0x31')](_0x571390[_0xa1af('0x32')],qs[_0xa1af('0x34')](_0x4f8696[_0xa1af('0x2e')][_0xa1af('0x34')]));_0xcc5d1a['attributes']=_0xcc5d1a['attributes'][_0xa1af('0x35')]?_0xcc5d1a[_0xa1af('0x33')]:_0x571390[_0xa1af('0x32')];if(_0x4f8696[_0xa1af('0x2e')][_0xa1af('0x3f')]){_0xcc5d1a['include']=[{'all':!![]}];}_0xcc5d1a=_[_0xa1af('0x44')]({},_0xcc5d1a,_0x4f8696[_0xa1af('0x45')]);return db[_0xa1af('0x2c')][_0xa1af('0x46')](_0xcc5d1a)[_0xa1af('0x25')](handleEntityNotFound(_0x324037,null))[_0xa1af('0x25')](respondWithResult(_0x324037,null))[_0xa1af('0x42')](handleError(_0x324037,null));};exports[_0xa1af('0x47')]=function(_0x5aed83,_0x1b4059){return db[_0xa1af('0x2c')]['create'](_0x5aed83[_0xa1af('0x48')],{})[_0xa1af('0x25')](function(_0x3d16e7){var _0x4c7105=_0x5aed83[_0xa1af('0x49')][_0xa1af('0x27')]({'plain':!![]});if(!_0x4c7105)throw new Error(_0xa1af('0x4a'));if(_0x4c7105[_0xa1af('0x4b')]===_0xa1af('0x49')){var _0x2f2a76=_0x3d16e7[_0xa1af('0x27')]({'plain':!![]});var _0x198652=_0xa1af('0x28');return db[_0xa1af('0x4c')]['find']({'where':{'name':_0x198652,'userProfileId':_0x4c7105[_0xa1af('0x4d')]},'raw':!![]})[_0xa1af('0x25')](function(_0x6a1803){if(_0x6a1803&&_0x6a1803['autoAssociation']===0x0){return db[_0xa1af('0x4e')][_0xa1af('0x47')]({'name':_0x2f2a76[_0xa1af('0x2a')],'resourceId':_0x2f2a76['id'],'type':_0x6a1803['name'],'sectionId':_0x6a1803['id']},{})['then'](function(){return _0x3d16e7;});}else{return _0x3d16e7;}})['catch'](function(_0xc0c67a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc0c67a);throw _0xc0c67a;});}return _0x3d16e7;})[_0xa1af('0x25')](respondWithResult(_0x1b4059,0xc9))['catch'](handleError(_0x1b4059,null));};exports['update']=function(_0x366715,_0x4e750e){if(_0x366715[_0xa1af('0x48')]['id']){delete _0x366715['body']['id'];}return db[_0xa1af('0x2c')][_0xa1af('0x46')]({'where':{'id':_0x366715[_0xa1af('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4e750e,null))[_0xa1af('0x25')](saveUpdates(_0x366715[_0xa1af('0x48')],null))['then'](respondWithResult(_0x4e750e,null))[_0xa1af('0x42')](handleError(_0x4e750e,null));};exports['destroy']=function(_0x56aa70,_0x142efc){return db[_0xa1af('0x2c')][_0xa1af('0x46')]({'where':{'id':_0x56aa70['params']['id']}})[_0xa1af('0x25')](handleEntityNotFound(_0x142efc,null))[_0xa1af('0x25')](removeEntity(_0x142efc,null))[_0xa1af('0x42')](handleError(_0x142efc,null));};exports['addAllCondition']=function(_0x2e3817,_0xf1aedf,_0x1cf740){if(_0x2e3817[_0xa1af('0x48')]['id']){delete _0x2e3817[_0xa1af('0x48')]['id'];}return db[_0xa1af('0x2c')][_0xa1af('0x46')]({'where':{'id':_0x2e3817[_0xa1af('0x4f')]['id']}})['then'](handleEntityNotFound(_0xf1aedf,null))[_0xa1af('0x25')](function(_0x2a0a40){if(_0x2a0a40){_0x2e3817['body']['TriggerAllId']=_0x2a0a40['id'];return db[_0xa1af('0x50')][_0xa1af('0x47')](_0x2e3817[_0xa1af('0x48')]);}})[_0xa1af('0x25')](respondWithResult(_0xf1aedf,null))[_0xa1af('0x42')](handleError(_0xf1aedf,null));};exports[_0xa1af('0x51')]=function(_0x5c0169,_0x4cd0df,_0x18be1f){if(_0x5c0169[_0xa1af('0x48')]['id']){delete _0x5c0169['body']['id'];}return db[_0xa1af('0x2c')][_0xa1af('0x46')]({'where':{'id':_0x5c0169[_0xa1af('0x4f')]['id']}})[_0xa1af('0x25')](handleEntityNotFound(_0x4cd0df,null))[_0xa1af('0x25')](function(_0x507e21){if(_0x507e21){_0x5c0169[_0xa1af('0x48')][_0xa1af('0x52')]=_0x507e21['id'];return db[_0xa1af('0x50')][_0xa1af('0x47')](_0x5c0169[_0xa1af('0x48')]);}})['then'](respondWithResult(_0x4cd0df,null))[_0xa1af('0x42')](handleError(_0x4cd0df,null));};exports[_0xa1af('0x53')]=function(_0x271676,_0x4cb2f7,_0x3f83fa){var _0x5e301d={};var _0x1a8e13={};var _0x13b2a9;var _0x59edbe;return db[_0xa1af('0x2c')]['findOne']({'where':{'id':_0x271676[_0xa1af('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4cb2f7,null))[_0xa1af('0x25')](function(_0x325c9a){if(_0x325c9a){_0x13b2a9=_0x325c9a;_0x1a8e13[_0xa1af('0x32')]=_[_0xa1af('0x2f')](db['Condition'][_0xa1af('0x2d')]);_0x1a8e13['query']=_[_0xa1af('0x2f')](_0x271676[_0xa1af('0x2e')]);_0x1a8e13[_0xa1af('0x30')]=_[_0xa1af('0x31')](_0x1a8e13[_0xa1af('0x32')],_0x1a8e13[_0xa1af('0x2e')]);_0x5e301d[_0xa1af('0x33')]=_['intersection'](_0x1a8e13[_0xa1af('0x32')],qs['fields'](_0x271676[_0xa1af('0x2e')]['fields']));_0x5e301d[_0xa1af('0x33')]=_0x5e301d[_0xa1af('0x33')][_0xa1af('0x35')]?_0x5e301d[_0xa1af('0x33')]:_0x1a8e13['model'];_0x5e301d[_0xa1af('0x54')]=qs['sort'](_0x271676['query']['sort']);_0x5e301d[_0xa1af('0x39')]=qs[_0xa1af('0x30')](_[_0xa1af('0x3a')](_0x271676['query'],_0x1a8e13[_0xa1af('0x30')]));if(_0x271676[_0xa1af('0x2e')][_0xa1af('0x3b')]){_0x5e301d[_0xa1af('0x39')]=_[_0xa1af('0x44')](_0x5e301d[_0xa1af('0x39')],{'$or':_['map'](_0x5e301d[_0xa1af('0x33')],function(_0x111dec){var _0x4ea2d9={};_0x4ea2d9[_0x111dec]={'$like':'%'+_0x271676['query'][_0xa1af('0x3b')]+'%'};return _0x4ea2d9;})});}_0x5e301d=_['merge']({},_0x5e301d,_0x271676['options']);return _0x13b2a9['getAllConditions'](_0x5e301d);}})[_0xa1af('0x25')](function(_0x2b2e9f){if(_0x2b2e9f){_0x59edbe=_0x2b2e9f[_0xa1af('0x35')];if(!_0x271676['query']['hasOwnProperty'](_0xa1af('0x37'))){_0x5e301d[_0xa1af('0x1f')]=qs[_0xa1af('0x1f')](_0x271676[_0xa1af('0x2e')][_0xa1af('0x1f')]);_0x5e301d[_0xa1af('0x1e')]=qs['offset'](_0x271676[_0xa1af('0x2e')][_0xa1af('0x1e')]);}return _0x13b2a9[_0xa1af('0x53')](_0x5e301d);}})[_0xa1af('0x25')](function(_0xefae8d){if(_0xefae8d){return _0xefae8d?{'count':_0x59edbe,'rows':_0xefae8d}:null;}})[_0xa1af('0x25')](respondWithResult(_0x4cb2f7,null))[_0xa1af('0x42')](handleError(_0x4cb2f7,null));};exports[_0xa1af('0x55')]=function(_0x553f86,_0xd00e9b,_0x378efb){var _0x299b99={};var _0x50799e={};var _0x499e66;var _0x3ca07f;return db['Trigger'][_0xa1af('0x56')]({'where':{'id':_0x553f86[_0xa1af('0x4f')]['id']}})[_0xa1af('0x25')](handleEntityNotFound(_0xd00e9b,null))[_0xa1af('0x25')](function(_0x18ed60){if(_0x18ed60){_0x499e66=_0x18ed60;_0x50799e[_0xa1af('0x32')]=_[_0xa1af('0x2f')](db[_0xa1af('0x50')]['rawAttributes']);_0x50799e['query']=_[_0xa1af('0x2f')](_0x553f86[_0xa1af('0x2e')]);_0x50799e[_0xa1af('0x30')]=_[_0xa1af('0x31')](_0x50799e[_0xa1af('0x32')],_0x50799e[_0xa1af('0x2e')]);_0x299b99[_0xa1af('0x33')]=_['intersection'](_0x50799e['model'],qs['fields'](_0x553f86[_0xa1af('0x2e')][_0xa1af('0x34')]));_0x299b99[_0xa1af('0x33')]=_0x299b99[_0xa1af('0x33')]['length']?_0x299b99[_0xa1af('0x33')]:_0x50799e['model'];_0x299b99[_0xa1af('0x54')]=qs[_0xa1af('0x38')](_0x553f86[_0xa1af('0x2e')][_0xa1af('0x38')]);_0x299b99[_0xa1af('0x39')]=qs['filters'](_[_0xa1af('0x3a')](_0x553f86[_0xa1af('0x2e')],_0x50799e[_0xa1af('0x30')]));if(_0x553f86['query'][_0xa1af('0x3b')]){_0x299b99[_0xa1af('0x39')]=_[_0xa1af('0x44')](_0x299b99['where'],{'$or':_[_0xa1af('0x57')](_0x299b99[_0xa1af('0x33')],function(_0x33f829){var _0x39716e={};_0x39716e[_0x33f829]={'$like':'%'+_0x553f86[_0xa1af('0x2e')][_0xa1af('0x3b')]+'%'};return _0x39716e;})});}_0x299b99=_[_0xa1af('0x44')]({},_0x299b99,_0x553f86[_0xa1af('0x45')]);return _0x499e66[_0xa1af('0x55')](_0x299b99);}})[_0xa1af('0x25')](function(_0x54d904){if(_0x54d904){_0x3ca07f=_0x54d904['length'];if(!_0x553f86[_0xa1af('0x2e')]['hasOwnProperty'](_0xa1af('0x37'))){_0x299b99[_0xa1af('0x1f')]=qs[_0xa1af('0x1f')](_0x553f86[_0xa1af('0x2e')][_0xa1af('0x1f')]);_0x299b99[_0xa1af('0x1e')]=qs[_0xa1af('0x1e')](_0x553f86[_0xa1af('0x2e')][_0xa1af('0x1e')]);}return _0x499e66[_0xa1af('0x55')](_0x299b99);}})['then'](function(_0x22172b){if(_0x22172b){return _0x22172b?{'count':_0x3ca07f,'rows':_0x22172b}:null;}})[_0xa1af('0x25')](respondWithResult(_0xd00e9b,null))[_0xa1af('0x42')](handleError(_0xd00e9b,null));};exports[_0xa1af('0x58')]=function(_0x46368e,_0x4b4b4c,_0x32096b){if(_0x46368e[_0xa1af('0x48')]['id']){delete _0x46368e[_0xa1af('0x48')]['id'];}return db[_0xa1af('0x2c')]['find']({'where':{'id':_0x46368e['params']['id']}})[_0xa1af('0x25')](handleEntityNotFound(_0x4b4b4c,null))[_0xa1af('0x25')](function(_0x4f4c47){if(_0x4f4c47){_0x46368e['body'][_0xa1af('0x59')]=_0x4f4c47['id'];return db[_0xa1af('0x5a')]['create'](_0x46368e[_0xa1af('0x48')]);}})[_0xa1af('0x25')](respondWithResult(_0x4b4b4c,null))[_0xa1af('0x42')](handleError(_0x4b4b4c,null));};exports[_0xa1af('0x5b')]=function(_0x18dc6c,_0x6095e,_0x22455c){var _0x4e4b72={};var _0x27c349={};var _0x174a87;var _0x383fe3;return db[_0xa1af('0x2c')][_0xa1af('0x56')]({'where':{'id':_0x18dc6c[_0xa1af('0x4f')]['id']}})['then'](handleEntityNotFound(_0x6095e,null))[_0xa1af('0x25')](function(_0xc502ee){if(_0xc502ee){_0x174a87=_0xc502ee;_0x27c349[_0xa1af('0x32')]=_[_0xa1af('0x2f')](db[_0xa1af('0x5a')][_0xa1af('0x2d')]);_0x27c349[_0xa1af('0x2e')]=_[_0xa1af('0x2f')](_0x18dc6c['query']);_0x27c349[_0xa1af('0x30')]=_[_0xa1af('0x31')](_0x27c349['model'],_0x27c349[_0xa1af('0x2e')]);_0x4e4b72[_0xa1af('0x33')]=_[_0xa1af('0x31')](_0x27c349['model'],qs['fields'](_0x18dc6c[_0xa1af('0x2e')][_0xa1af('0x34')]));_0x4e4b72[_0xa1af('0x33')]=_0x4e4b72[_0xa1af('0x33')]['length']?_0x4e4b72[_0xa1af('0x33')]:_0x27c349['model'];_0x4e4b72[_0xa1af('0x54')]=qs[_0xa1af('0x38')](_0x18dc6c[_0xa1af('0x2e')][_0xa1af('0x38')]);_0x4e4b72[_0xa1af('0x39')]=qs['filters'](_[_0xa1af('0x3a')](_0x18dc6c[_0xa1af('0x2e')],_0x27c349['filters']));if(_0x18dc6c[_0xa1af('0x2e')][_0xa1af('0x3b')]){_0x4e4b72[_0xa1af('0x39')]=_['merge'](_0x4e4b72[_0xa1af('0x39')],{'$or':_[_0xa1af('0x57')](_0x4e4b72[_0xa1af('0x33')],function(_0x7df78){var _0x3b5f9b={};_0x3b5f9b[_0x7df78]={'$like':'%'+_0x18dc6c[_0xa1af('0x2e')][_0xa1af('0x3b')]+'%'};return _0x3b5f9b;})});}_0x4e4b72=_[_0xa1af('0x44')]({},_0x4e4b72,_0x18dc6c[_0xa1af('0x45')]);return _0x174a87[_0xa1af('0x5b')](_0x4e4b72);}})[_0xa1af('0x25')](function(_0x175a6d){if(_0x175a6d){_0x383fe3=_0x175a6d[_0xa1af('0x35')];if(!_0x18dc6c[_0xa1af('0x2e')][_0xa1af('0x36')]('nolimit')){_0x4e4b72[_0xa1af('0x1f')]=qs['limit'](_0x18dc6c['query'][_0xa1af('0x1f')]);_0x4e4b72['offset']=qs['offset'](_0x18dc6c['query'][_0xa1af('0x1e')]);}return _0x174a87[_0xa1af('0x5b')](_0x4e4b72);}})[_0xa1af('0x25')](function(_0x2281dd){if(_0x2281dd){return _0x2281dd?{'count':_0x383fe3,'rows':_0x2281dd}:null;}})[_0xa1af('0x25')](respondWithResult(_0x6095e,null))[_0xa1af('0x42')](handleError(_0x6095e,null));}; \ No newline at end of file +var _0xdf3f=['querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','save','update','then','destroy','Triggers','UserProfileResource','error','name','send','index','Trigger','rawAttributes','keys','query','model','intersection','fields','attributes','length','nolimit','limit','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','field','options','include','rows','catch','show','params','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','Condition','findOne','pick','getAllConditions','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','rimraf','fast-json-patch','bluebird','to-csv','ejs','lodash','jsforce','desk.js'];(function(_0x2ad1b0,_0x126c55){var _0xf3902c=function(_0x5c6496){while(--_0x5c6496){_0x2ad1b0['push'](_0x2ad1b0['shift']());}};_0xf3902c(++_0x126c55);}(_0xdf3f,0xa5));var _0xfdf3=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0xdf3f[_0x516ffb];return _0x319667;};'use strict';var pdf=require(_0xfdf3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfdf3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfdf3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfdf3('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfdf3('0x4'));var ejs=require(_0xfdf3('0x5'));var fs=require('fs');var _=require(_0xfdf3('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfdf3('0x7'));var deskjs=require(_0xfdf3('0x8'));var toCsv=require('to-csv');var querystring=require(_0xfdf3('0x9'));var Papa=require(_0xfdf3('0xa'));var authService=require('../../components/auth/service');var hardwareService=require(_0xfdf3('0xb'));var Redis=require('ioredis');var qs=require(_0xfdf3('0xc'));var logger=require(_0xfdf3('0xd'))(_0xfdf3('0xe'));var utils=require(_0xfdf3('0xf'));var config=require(_0xfdf3('0x10'));var db=require(_0xfdf3('0x11'))['db'];function respondWithStatusCode(_0x114f90,_0x4fcb57){_0x4fcb57=_0x4fcb57||0xcc;return function(_0x5bb703){if(_0x5bb703){return _0x114f90[_0xfdf3('0x12')](_0x4fcb57);}return _0x114f90[_0xfdf3('0x13')](_0x4fcb57)[_0xfdf3('0x14')]();};}function respondWithResult(_0x425dca,_0xce72b2){_0xce72b2=_0xce72b2||0xc8;return function(_0x3fb69c){if(_0x3fb69c){return _0x425dca[_0xfdf3('0x13')](_0xce72b2)[_0xfdf3('0x15')](_0x3fb69c);}};}function respondWithFilteredResult(_0x58be52,_0x2c1aec){return function(_0x34eadc){if(_0x34eadc){var _0x2169f2=_0x34eadc[_0xfdf3('0x16')],_0x81bfde=_0x2c1aec[_0xfdf3('0x17')],_0x6c074d=_0x2c1aec[_0xfdf3('0x17')]+_0x2c1aec['limit'],_0x21c995;if(_0x6c074d>=_0x2169f2){_0x6c074d=_0x2169f2;_0x21c995=0xc8;}else{_0x21c995=0xce;}_0x58be52[_0xfdf3('0x13')](_0x21c995);return _0x58be52['set'](_0xfdf3('0x18'),_0x81bfde+'-'+_0x6c074d+'/'+_0x2169f2)[_0xfdf3('0x15')](_0x34eadc);}return null;};}function patchUpdates(_0x1af84c){return function(_0xafd229){try{jsonpatch[_0xfdf3('0x19')](_0xafd229,_0x1af84c,!![]);}catch(_0x8a6451){return BPromise['reject'](_0x8a6451);}return _0xafd229[_0xfdf3('0x1a')]();};}function saveUpdates(_0x4f74a4,_0xed963e){return function(_0x3b520f){if(_0x3b520f){return _0x3b520f[_0xfdf3('0x1b')](_0x4f74a4)[_0xfdf3('0x1c')](function(_0xa56628){return _0xa56628;});}return null;};}function removeEntity(_0x2617de,_0x3ad532){return function(_0x2d94c2){if(_0x2d94c2){return _0x2d94c2[_0xfdf3('0x1d')]()[_0xfdf3('0x1c')](function(){var _0x2e8206=_0x2d94c2['get']({'plain':!![]});var _0x3258cf=_0xfdf3('0x1e');return db[_0xfdf3('0x1f')][_0xfdf3('0x1d')]({'where':{'type':_0x3258cf,'resourceId':_0x2e8206['id']}})[_0xfdf3('0x1c')](function(){return _0x2d94c2;});})[_0xfdf3('0x1c')](function(){_0x2617de['status'](0xcc)[_0xfdf3('0x14')]();});}};}function handleEntityNotFound(_0x3936f0,_0x15cb0b){return function(_0x5ab340){if(!_0x5ab340){_0x3936f0[_0xfdf3('0x12')](0x194);}return _0x5ab340;};}function handleError(_0x66e3d7,_0x3f05d8){_0x3f05d8=_0x3f05d8||0x1f4;return function(_0x59eac1){logger[_0xfdf3('0x20')](_0x59eac1['stack']);if(_0x59eac1[_0xfdf3('0x21')]){delete _0x59eac1[_0xfdf3('0x21')];}_0x66e3d7[_0xfdf3('0x13')](_0x3f05d8)[_0xfdf3('0x22')](_0x59eac1);};}exports[_0xfdf3('0x23')]=function(_0x391300,_0x121531){var _0x353ed8={},_0x5c2494={},_0x4be55d={'count':0x0,'rows':[]};var _0x2f56e9=db[_0xfdf3('0x24')][_0xfdf3('0x25')];_0x5c2494['model']=_[_0xfdf3('0x26')](_0x2f56e9);_0x5c2494[_0xfdf3('0x27')]=_[_0xfdf3('0x26')](_0x391300[_0xfdf3('0x27')]);_0x5c2494['filters']=_['intersection'](_0x5c2494[_0xfdf3('0x28')],_0x5c2494[_0xfdf3('0x27')]);_0x353ed8['attributes']=_[_0xfdf3('0x29')](_0x5c2494[_0xfdf3('0x28')],qs[_0xfdf3('0x2a')](_0x391300[_0xfdf3('0x27')]['fields']));_0x353ed8[_0xfdf3('0x2b')]=_0x353ed8[_0xfdf3('0x2b')][_0xfdf3('0x2c')]?_0x353ed8[_0xfdf3('0x2b')]:_0x5c2494[_0xfdf3('0x28')];if(!_0x391300['query']['hasOwnProperty'](_0xfdf3('0x2d'))){_0x353ed8[_0xfdf3('0x2e')]=qs[_0xfdf3('0x2e')](_0x391300[_0xfdf3('0x27')]['limit']);_0x353ed8[_0xfdf3('0x17')]=qs['offset'](_0x391300[_0xfdf3('0x27')][_0xfdf3('0x17')]);}_0x353ed8[_0xfdf3('0x2f')]=qs['sort'](_0x391300[_0xfdf3('0x27')][_0xfdf3('0x30')]);_0x353ed8['where']=qs[_0xfdf3('0x31')](_['pick'](_0x391300['query'],_0x5c2494[_0xfdf3('0x31')]));if(_0x391300[_0xfdf3('0x27')][_0xfdf3('0x32')]){_0x353ed8['where']=_[_0xfdf3('0x33')](_0x353ed8[_0xfdf3('0x34')],{'$or':_[_0xfdf3('0x35')](_0x2f56e9,function(_0x2c2a63){if(_0x2c2a63[_0xfdf3('0x36')][_0xfdf3('0x37')]!==_0xfdf3('0x38')){var _0x18acd7={};_0x18acd7[_0x2c2a63[_0xfdf3('0x39')]]={'$like':'%'+_0x391300[_0xfdf3('0x27')][_0xfdf3('0x32')]+'%'};return _0x18acd7;}})});}_0x353ed8=_[_0xfdf3('0x33')]({},_0x353ed8,_0x391300[_0xfdf3('0x3a')]);var _0x5ee424={'where':_0x353ed8['where']};return db['Trigger'][_0xfdf3('0x16')](_0x5ee424)[_0xfdf3('0x1c')](function(_0x38639d){_0x4be55d['count']=_0x38639d;if(_0x391300['query']['includeAll']){_0x353ed8[_0xfdf3('0x3b')]=[{'all':!![]}];}return db[_0xfdf3('0x24')]['findAll'](_0x353ed8);})[_0xfdf3('0x1c')](function(_0x2bb3b8){_0x4be55d[_0xfdf3('0x3c')]=_0x2bb3b8;return _0x4be55d;})[_0xfdf3('0x1c')](respondWithFilteredResult(_0x121531,_0x353ed8))[_0xfdf3('0x3d')](handleError(_0x121531,null));};exports[_0xfdf3('0x3e')]=function(_0xa0f777,_0x3c4c08){var _0x3bd26e={'raw':![],'where':{'id':_0xa0f777[_0xfdf3('0x3f')]['id']}},_0x89b752={};_0x89b752['model']=_[_0xfdf3('0x26')](db[_0xfdf3('0x24')][_0xfdf3('0x25')]);_0x89b752[_0xfdf3('0x27')]=_[_0xfdf3('0x26')](_0xa0f777[_0xfdf3('0x27')]);_0x89b752[_0xfdf3('0x31')]=_[_0xfdf3('0x29')](_0x89b752[_0xfdf3('0x28')],_0x89b752[_0xfdf3('0x27')]);_0x3bd26e[_0xfdf3('0x2b')]=_[_0xfdf3('0x29')](_0x89b752['model'],qs[_0xfdf3('0x2a')](_0xa0f777[_0xfdf3('0x27')]['fields']));_0x3bd26e[_0xfdf3('0x2b')]=_0x3bd26e['attributes'][_0xfdf3('0x2c')]?_0x3bd26e[_0xfdf3('0x2b')]:_0x89b752['model'];if(_0xa0f777['query'][_0xfdf3('0x40')]){_0x3bd26e[_0xfdf3('0x3b')]=[{'all':!![]}];}_0x3bd26e=_[_0xfdf3('0x33')]({},_0x3bd26e,_0xa0f777[_0xfdf3('0x3a')]);return db[_0xfdf3('0x24')][_0xfdf3('0x41')](_0x3bd26e)[_0xfdf3('0x1c')](handleEntityNotFound(_0x3c4c08,null))['then'](respondWithResult(_0x3c4c08,null))[_0xfdf3('0x3d')](handleError(_0x3c4c08,null));};exports[_0xfdf3('0x42')]=function(_0x43f072,_0x1a68ee){return db['Trigger'][_0xfdf3('0x42')](_0x43f072['body'],{})[_0xfdf3('0x1c')](function(_0x4ceb4c){var _0x4fe3d8=_0x43f072[_0xfdf3('0x43')][_0xfdf3('0x44')]({'plain':!![]});if(!_0x4fe3d8)throw new Error(_0xfdf3('0x45'));if(_0x4fe3d8[_0xfdf3('0x46')]===_0xfdf3('0x43')){var _0x48b3db=_0x4ceb4c[_0xfdf3('0x44')]({'plain':!![]});var _0x1ed8a2=_0xfdf3('0x1e');return db['UserProfileSection'][_0xfdf3('0x41')]({'where':{'name':_0x1ed8a2,'userProfileId':_0x4fe3d8[_0xfdf3('0x47')]},'raw':!![]})['then'](function(_0x4b594e){if(_0x4b594e&&_0x4b594e[_0xfdf3('0x48')]===0x0){return db[_0xfdf3('0x1f')][_0xfdf3('0x42')]({'name':_0x48b3db['name'],'resourceId':_0x48b3db['id'],'type':_0x4b594e[_0xfdf3('0x21')],'sectionId':_0x4b594e['id']},{})[_0xfdf3('0x1c')](function(){return _0x4ceb4c;});}else{return _0x4ceb4c;}})[_0xfdf3('0x3d')](function(_0x2442c1){logger[_0xfdf3('0x20')](_0xfdf3('0x49'),_0x2442c1);throw _0x2442c1;});}return _0x4ceb4c;})[_0xfdf3('0x1c')](respondWithResult(_0x1a68ee,0xc9))['catch'](handleError(_0x1a68ee,null));};exports['update']=function(_0x2b65f0,_0x128a0a){if(_0x2b65f0[_0xfdf3('0x4a')]['id']){delete _0x2b65f0[_0xfdf3('0x4a')]['id'];}return db['Trigger']['find']({'where':{'id':_0x2b65f0[_0xfdf3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x128a0a,null))[_0xfdf3('0x1c')](saveUpdates(_0x2b65f0[_0xfdf3('0x4a')],null))[_0xfdf3('0x1c')](respondWithResult(_0x128a0a,null))[_0xfdf3('0x3d')](handleError(_0x128a0a,null));};exports[_0xfdf3('0x1d')]=function(_0x40bb23,_0x31dc5e){return db[_0xfdf3('0x24')]['find']({'where':{'id':_0x40bb23[_0xfdf3('0x3f')]['id']}})[_0xfdf3('0x1c')](handleEntityNotFound(_0x31dc5e,null))[_0xfdf3('0x1c')](removeEntity(_0x31dc5e,null))[_0xfdf3('0x3d')](handleError(_0x31dc5e,null));};exports[_0xfdf3('0x4b')]=function(_0x101fdf,_0x423e73,_0x147fa3){if(_0x101fdf['body']['id']){delete _0x101fdf['body']['id'];}return db['Trigger'][_0xfdf3('0x41')]({'where':{'id':_0x101fdf[_0xfdf3('0x3f')]['id']}})[_0xfdf3('0x1c')](handleEntityNotFound(_0x423e73,null))['then'](function(_0x5a11f3){if(_0x5a11f3){_0x101fdf[_0xfdf3('0x4a')][_0xfdf3('0x4c')]=_0x5a11f3['id'];return db[_0xfdf3('0x4d')][_0xfdf3('0x42')](_0x101fdf[_0xfdf3('0x4a')]);}})[_0xfdf3('0x1c')](respondWithResult(_0x423e73,null))[_0xfdf3('0x3d')](handleError(_0x423e73,null));};exports['addAnyCondition']=function(_0x1e64d0,_0x312485,_0x25ed4f){if(_0x1e64d0[_0xfdf3('0x4a')]['id']){delete _0x1e64d0[_0xfdf3('0x4a')]['id'];}return db['Trigger'][_0xfdf3('0x41')]({'where':{'id':_0x1e64d0[_0xfdf3('0x3f')]['id']}})[_0xfdf3('0x1c')](handleEntityNotFound(_0x312485,null))[_0xfdf3('0x1c')](function(_0x1b0709){if(_0x1b0709){_0x1e64d0[_0xfdf3('0x4a')]['TriggerAnyId']=_0x1b0709['id'];return db[_0xfdf3('0x4d')]['create'](_0x1e64d0[_0xfdf3('0x4a')]);}})[_0xfdf3('0x1c')](respondWithResult(_0x312485,null))[_0xfdf3('0x3d')](handleError(_0x312485,null));};exports['getAllConditions']=function(_0x399d78,_0x35f22a,_0x53e890){var _0x231178={};var _0x4524fb={};var _0x79bb87;var _0x523301;return db['Trigger'][_0xfdf3('0x4e')]({'where':{'id':_0x399d78[_0xfdf3('0x3f')]['id']}})[_0xfdf3('0x1c')](handleEntityNotFound(_0x35f22a,null))['then'](function(_0x204ca4){if(_0x204ca4){_0x79bb87=_0x204ca4;_0x4524fb[_0xfdf3('0x28')]=_[_0xfdf3('0x26')](db[_0xfdf3('0x4d')]['rawAttributes']);_0x4524fb[_0xfdf3('0x27')]=_['keys'](_0x399d78[_0xfdf3('0x27')]);_0x4524fb[_0xfdf3('0x31')]=_[_0xfdf3('0x29')](_0x4524fb[_0xfdf3('0x28')],_0x4524fb['query']);_0x231178['attributes']=_[_0xfdf3('0x29')](_0x4524fb['model'],qs['fields'](_0x399d78[_0xfdf3('0x27')][_0xfdf3('0x2a')]));_0x231178[_0xfdf3('0x2b')]=_0x231178[_0xfdf3('0x2b')]['length']?_0x231178['attributes']:_0x4524fb[_0xfdf3('0x28')];_0x231178['order']=qs[_0xfdf3('0x30')](_0x399d78[_0xfdf3('0x27')][_0xfdf3('0x30')]);_0x231178[_0xfdf3('0x34')]=qs[_0xfdf3('0x31')](_[_0xfdf3('0x4f')](_0x399d78[_0xfdf3('0x27')],_0x4524fb[_0xfdf3('0x31')]));if(_0x399d78[_0xfdf3('0x27')][_0xfdf3('0x32')]){_0x231178['where']=_[_0xfdf3('0x33')](_0x231178[_0xfdf3('0x34')],{'$or':_[_0xfdf3('0x35')](_0x231178[_0xfdf3('0x2b')],function(_0x2ca2ca){var _0x2ca574={};_0x2ca574[_0x2ca2ca]={'$like':'%'+_0x399d78[_0xfdf3('0x27')]['filter']+'%'};return _0x2ca574;})});}_0x231178=_[_0xfdf3('0x33')]({},_0x231178,_0x399d78[_0xfdf3('0x3a')]);return _0x79bb87[_0xfdf3('0x50')](_0x231178);}})[_0xfdf3('0x1c')](function(_0x38feb5){if(_0x38feb5){_0x523301=_0x38feb5[_0xfdf3('0x2c')];if(!_0x399d78[_0xfdf3('0x27')][_0xfdf3('0x51')](_0xfdf3('0x2d'))){_0x231178[_0xfdf3('0x2e')]=qs[_0xfdf3('0x2e')](_0x399d78[_0xfdf3('0x27')]['limit']);_0x231178[_0xfdf3('0x17')]=qs['offset'](_0x399d78[_0xfdf3('0x27')][_0xfdf3('0x17')]);}return _0x79bb87[_0xfdf3('0x50')](_0x231178);}})['then'](function(_0x3d5034){if(_0x3d5034){return _0x3d5034?{'count':_0x523301,'rows':_0x3d5034}:null;}})['then'](respondWithResult(_0x35f22a,null))[_0xfdf3('0x3d')](handleError(_0x35f22a,null));};exports[_0xfdf3('0x52')]=function(_0x29565a,_0x58f085,_0x564017){var _0x4a1910={};var _0x5cd54b={};var _0x24a182;var _0x1347d2;return db[_0xfdf3('0x24')][_0xfdf3('0x4e')]({'where':{'id':_0x29565a[_0xfdf3('0x3f')]['id']}})[_0xfdf3('0x1c')](handleEntityNotFound(_0x58f085,null))[_0xfdf3('0x1c')](function(_0x55c721){if(_0x55c721){_0x24a182=_0x55c721;_0x5cd54b[_0xfdf3('0x28')]=_['keys'](db[_0xfdf3('0x4d')][_0xfdf3('0x25')]);_0x5cd54b[_0xfdf3('0x27')]=_[_0xfdf3('0x26')](_0x29565a[_0xfdf3('0x27')]);_0x5cd54b[_0xfdf3('0x31')]=_[_0xfdf3('0x29')](_0x5cd54b[_0xfdf3('0x28')],_0x5cd54b[_0xfdf3('0x27')]);_0x4a1910[_0xfdf3('0x2b')]=_[_0xfdf3('0x29')](_0x5cd54b[_0xfdf3('0x28')],qs[_0xfdf3('0x2a')](_0x29565a[_0xfdf3('0x27')][_0xfdf3('0x2a')]));_0x4a1910['attributes']=_0x4a1910['attributes']['length']?_0x4a1910[_0xfdf3('0x2b')]:_0x5cd54b[_0xfdf3('0x28')];_0x4a1910[_0xfdf3('0x2f')]=qs[_0xfdf3('0x30')](_0x29565a['query'][_0xfdf3('0x30')]);_0x4a1910[_0xfdf3('0x34')]=qs['filters'](_[_0xfdf3('0x4f')](_0x29565a[_0xfdf3('0x27')],_0x5cd54b[_0xfdf3('0x31')]));if(_0x29565a['query'][_0xfdf3('0x32')]){_0x4a1910[_0xfdf3('0x34')]=_[_0xfdf3('0x33')](_0x4a1910['where'],{'$or':_[_0xfdf3('0x35')](_0x4a1910[_0xfdf3('0x2b')],function(_0x1c3003){var _0x3d6b09={};_0x3d6b09[_0x1c3003]={'$like':'%'+_0x29565a['query'][_0xfdf3('0x32')]+'%'};return _0x3d6b09;})});}_0x4a1910=_[_0xfdf3('0x33')]({},_0x4a1910,_0x29565a[_0xfdf3('0x3a')]);return _0x24a182[_0xfdf3('0x52')](_0x4a1910);}})['then'](function(_0x46957b){if(_0x46957b){_0x1347d2=_0x46957b[_0xfdf3('0x2c')];if(!_0x29565a[_0xfdf3('0x27')][_0xfdf3('0x51')]('nolimit')){_0x4a1910[_0xfdf3('0x2e')]=qs[_0xfdf3('0x2e')](_0x29565a[_0xfdf3('0x27')][_0xfdf3('0x2e')]);_0x4a1910['offset']=qs[_0xfdf3('0x17')](_0x29565a[_0xfdf3('0x27')][_0xfdf3('0x17')]);}return _0x24a182[_0xfdf3('0x52')](_0x4a1910);}})[_0xfdf3('0x1c')](function(_0x2faf44){if(_0x2faf44){return _0x2faf44?{'count':_0x1347d2,'rows':_0x2faf44}:null;}})[_0xfdf3('0x1c')](respondWithResult(_0x58f085,null))['catch'](handleError(_0x58f085,null));};exports[_0xfdf3('0x53')]=function(_0x2908df,_0x4630a8,_0x400b6e){if(_0x2908df['body']['id']){delete _0x2908df[_0xfdf3('0x4a')]['id'];}return db[_0xfdf3('0x24')][_0xfdf3('0x41')]({'where':{'id':_0x2908df[_0xfdf3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4630a8,null))[_0xfdf3('0x1c')](function(_0x4bba47){if(_0x4bba47){_0x2908df[_0xfdf3('0x4a')][_0xfdf3('0x54')]=_0x4bba47['id'];return db[_0xfdf3('0x55')][_0xfdf3('0x42')](_0x2908df[_0xfdf3('0x4a')]);}})[_0xfdf3('0x1c')](respondWithResult(_0x4630a8,null))[_0xfdf3('0x3d')](handleError(_0x4630a8,null));};exports[_0xfdf3('0x56')]=function(_0x33cc04,_0x52e770,_0x392edc){var _0x22d65d={};var _0x1f9247={};var _0x4b0b53;var _0x14069e;return db[_0xfdf3('0x24')][_0xfdf3('0x4e')]({'where':{'id':_0x33cc04[_0xfdf3('0x3f')]['id']}})[_0xfdf3('0x1c')](handleEntityNotFound(_0x52e770,null))[_0xfdf3('0x1c')](function(_0x41312d){if(_0x41312d){_0x4b0b53=_0x41312d;_0x1f9247[_0xfdf3('0x28')]=_[_0xfdf3('0x26')](db[_0xfdf3('0x55')]['rawAttributes']);_0x1f9247[_0xfdf3('0x27')]=_[_0xfdf3('0x26')](_0x33cc04['query']);_0x1f9247[_0xfdf3('0x31')]=_[_0xfdf3('0x29')](_0x1f9247[_0xfdf3('0x28')],_0x1f9247[_0xfdf3('0x27')]);_0x22d65d[_0xfdf3('0x2b')]=_[_0xfdf3('0x29')](_0x1f9247[_0xfdf3('0x28')],qs['fields'](_0x33cc04[_0xfdf3('0x27')][_0xfdf3('0x2a')]));_0x22d65d[_0xfdf3('0x2b')]=_0x22d65d[_0xfdf3('0x2b')]['length']?_0x22d65d[_0xfdf3('0x2b')]:_0x1f9247['model'];_0x22d65d[_0xfdf3('0x2f')]=qs[_0xfdf3('0x30')](_0x33cc04[_0xfdf3('0x27')][_0xfdf3('0x30')]);_0x22d65d['where']=qs[_0xfdf3('0x31')](_[_0xfdf3('0x4f')](_0x33cc04[_0xfdf3('0x27')],_0x1f9247[_0xfdf3('0x31')]));if(_0x33cc04[_0xfdf3('0x27')][_0xfdf3('0x32')]){_0x22d65d[_0xfdf3('0x34')]=_[_0xfdf3('0x33')](_0x22d65d['where'],{'$or':_['map'](_0x22d65d['attributes'],function(_0x17f40d){var _0x50bda7={};_0x50bda7[_0x17f40d]={'$like':'%'+_0x33cc04['query'][_0xfdf3('0x32')]+'%'};return _0x50bda7;})});}_0x22d65d=_[_0xfdf3('0x33')]({},_0x22d65d,_0x33cc04['options']);return _0x4b0b53[_0xfdf3('0x56')](_0x22d65d);}})[_0xfdf3('0x1c')](function(_0x2aa8f8){if(_0x2aa8f8){_0x14069e=_0x2aa8f8['length'];if(!_0x33cc04['query'][_0xfdf3('0x51')](_0xfdf3('0x2d'))){_0x22d65d[_0xfdf3('0x2e')]=qs[_0xfdf3('0x2e')](_0x33cc04[_0xfdf3('0x27')][_0xfdf3('0x2e')]);_0x22d65d[_0xfdf3('0x17')]=qs['offset'](_0x33cc04[_0xfdf3('0x27')][_0xfdf3('0x17')]);}return _0x4b0b53[_0xfdf3('0x56')](_0x22d65d);}})[_0xfdf3('0x1c')](function(_0xdc89da){if(_0xdc89da){return _0xdc89da?{'count':_0x14069e,'rows':_0xdc89da}:null;}})[_0xfdf3('0x1c')](respondWithResult(_0x52e770,null))['catch'](handleError(_0x52e770,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 422d40d..5b1b514 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 _0xea00=['request-promise','define','tools_triggers','util','api','moment','bluebird'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0xea00,0x114));var _0x0ea0=function(_0x227b5c,_0x52a170){_0x227b5c=_0x227b5c-0x0;var _0x1eba10=_0xea00[_0x227b5c];return _0x1eba10;};'use strict';var _=require('lodash');var util=require(_0x0ea0('0x0'));var logger=require('../../config/logger')(_0x0ea0('0x1'));var moment=require(_0x0ea0('0x2'));var BPromise=require(_0x0ea0('0x3'));var rp=require(_0x0ea0('0x4'));var attributes=require('./trigger.attributes');module['exports']=function(_0x544355,_0x448b66){return _0x544355[_0x0ea0('0x5')]('Trigger',attributes,{'tableName':_0x0ea0('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7158=['util','../../config/logger','bluebird','request-promise','./trigger.attributes','exports','define','tools_triggers','lodash'];(function(_0x4941c6,_0x3ca9f8){var _0x4d3654=function(_0x5295c8){while(--_0x5295c8){_0x4941c6['push'](_0x4941c6['shift']());}};_0x4d3654(++_0x3ca9f8);}(_0x7158,0xc5));var _0x8715=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x7158[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0x8715('0x0'));var util=require(_0x8715('0x1'));var logger=require(_0x8715('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8715('0x3'));var rp=require(_0x8715('0x4'));var attributes=require(_0x8715('0x5'));module[_0x8715('0x6')]=function(_0x127bc7,_0xafd38f){return _0x127bc7[_0x8715('0x7')]('Trigger',attributes,{'tableName':_0x8715('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 4e526aa..e8ed370 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 _0x8c21=['../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','Trigger','options','raw','limit','include','map','model','attributes','GetTrigger','where','ShowTrigger','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8c21,0x1b3));var _0x18c2=function(_0x71fdbc,_0xc528f2){_0x71fdbc=_0x71fdbc-0x0;var _0x5ec9f8=_0x8c21[_0x71fdbc];return _0x5ec9f8;};'use strict';var _=require('lodash');var util=require(_0x18c2('0x0'));var moment=require(_0x18c2('0x1'));var BPromise=require(_0x18c2('0x2'));var rs=require(_0x18c2('0x3'));var fs=require('fs');var Redis=require(_0x18c2('0x4'));var db=require(_0x18c2('0x5'))['db'];var utils=require(_0x18c2('0x6'));var logger=require(_0x18c2('0x7'))(_0x18c2('0x8'));var config=require(_0x18c2('0x9'));var jayson=require(_0x18c2('0xa'));var client=jayson[_0x18c2('0xb')][_0x18c2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b72a8,_0x10e630,_0x22ab3e){return new BPromise(function(_0x4b369f,_0x2555b5){return client[_0x18c2('0xd')](_0x1b72a8,_0x22ab3e)[_0x18c2('0xe')](function(_0x33300a){logger[_0x18c2('0xf')](_0x18c2('0x10'),_0x10e630,'request\x20sent');logger['debug'](_0x18c2('0x11'),_0x10e630,'request\x20sent',JSON[_0x18c2('0x12')](_0x33300a));if(_0x33300a[_0x18c2('0x13')]){if(_0x33300a[_0x18c2('0x13')][_0x18c2('0x14')]===0x1f4){logger[_0x18c2('0x13')]('Trigger,\x20%s,\x20%s',_0x10e630,_0x33300a[_0x18c2('0x13')][_0x18c2('0x15')]);return _0x2555b5(_0x33300a[_0x18c2('0x13')][_0x18c2('0x15')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x10e630,_0x33300a[_0x18c2('0x13')][_0x18c2('0x15')]);return _0x4b369f(_0x33300a['error'][_0x18c2('0x15')]);}else{logger['info'](_0x18c2('0x10'),_0x10e630,_0x18c2('0x16'));_0x4b369f(_0x33300a[_0x18c2('0x17')][_0x18c2('0x15')]);}})[_0x18c2('0x18')](function(_0x5e2e7f){logger[_0x18c2('0x13')](_0x18c2('0x10'),_0x10e630,_0x5e2e7f);_0x2555b5(_0x5e2e7f);});});}exports['GetTrigger']=function(_0x236e67){var _0x5d94c5=this;return new Promise(function(_0x5766e9,_0x4cdc5f){return db[_0x18c2('0x19')]['findAll']({'raw':_0x236e67[_0x18c2('0x1a')]?_0x236e67[_0x18c2('0x1a')][_0x18c2('0x1b')]===undefined?!![]:![]:!![],'where':_0x236e67[_0x18c2('0x1a')]?_0x236e67[_0x18c2('0x1a')]['where']||null:null,'attributes':_0x236e67[_0x18c2('0x1a')]?_0x236e67[_0x18c2('0x1a')]['attributes']||null:null,'limit':_0x236e67['options']?_0x236e67[_0x18c2('0x1a')][_0x18c2('0x1c')]||null:null,'include':_0x236e67[_0x18c2('0x1a')]?_0x236e67[_0x18c2('0x1a')][_0x18c2('0x1d')]?_[_0x18c2('0x1e')](_0x236e67[_0x18c2('0x1a')][_0x18c2('0x1d')],function(_0x32d496){return{'model':db[_0x32d496[_0x18c2('0x1f')]],'as':_0x32d496['as'],'attributes':_0x32d496[_0x18c2('0x20')],'include':_0x32d496[_0x18c2('0x1d')]?_[_0x18c2('0x1e')](_0x32d496[_0x18c2('0x1d')],function(_0x3f9833){return{'model':db[_0x3f9833[_0x18c2('0x1f')]],'as':_0x3f9833['as'],'attributes':_0x3f9833['attributes'],'include':_0x3f9833[_0x18c2('0x1d')]?_[_0x18c2('0x1e')](_0x3f9833['include'],function(_0x183ef7){return{'model':db[_0x183ef7[_0x18c2('0x1f')]],'as':_0x183ef7['as'],'attributes':_0x183ef7[_0x18c2('0x20')]};}):[]};}):[]};}):[]:[]})[_0x18c2('0xe')](function(_0x64f898){logger[_0x18c2('0xf')]('GetTrigger',_0x236e67);logger['debug'](_0x18c2('0x21'),_0x236e67,JSON['stringify'](_0x64f898));_0x5766e9(_0x64f898);})['catch'](function(_0x2456b5){logger[_0x18c2('0x13')](_0x18c2('0x21'),_0x2456b5['message'],_0x236e67);_0x4cdc5f(_0x5d94c5[_0x18c2('0x13')](0x1f4,_0x2456b5[_0x18c2('0x15')]));});});};exports['ShowTrigger']=function(_0x5836d3){var _0x524b4f=this;return new Promise(function(_0x5109f2,_0x532a52){return db[_0x18c2('0x19')]['find']({'raw':_0x5836d3['options']?_0x5836d3[_0x18c2('0x1a')][_0x18c2('0x1b')]===undefined?!![]:![]:!![],'where':_0x5836d3[_0x18c2('0x1a')]?_0x5836d3['options'][_0x18c2('0x22')]||null:null,'attributes':_0x5836d3[_0x18c2('0x1a')]?_0x5836d3[_0x18c2('0x1a')][_0x18c2('0x20')]||null:null,'include':_0x5836d3[_0x18c2('0x1a')]?_0x5836d3[_0x18c2('0x1a')][_0x18c2('0x1d')]?_[_0x18c2('0x1e')](_0x5836d3[_0x18c2('0x1a')][_0x18c2('0x1d')],function(_0x814f49){return{'model':db[_0x814f49['model']],'as':_0x814f49['as'],'attributes':_0x814f49[_0x18c2('0x20')],'include':_0x814f49[_0x18c2('0x1d')]?_['map'](_0x814f49[_0x18c2('0x1d')],function(_0x1ee252){return{'model':db[_0x1ee252[_0x18c2('0x1f')]],'as':_0x1ee252['as'],'attributes':_0x1ee252[_0x18c2('0x20')],'include':_0x1ee252[_0x18c2('0x1d')]?_[_0x18c2('0x1e')](_0x1ee252[_0x18c2('0x1d')],function(_0xc790eb){return{'model':db[_0xc790eb[_0x18c2('0x1f')]],'as':_0xc790eb['as'],'attributes':_0xc790eb['attributes']};}):[]};}):[]};}):[]:[]})[_0x18c2('0xe')](function(_0x1de553){logger[_0x18c2('0xf')](_0x18c2('0x23'),_0x5836d3);logger[_0x18c2('0x24')](_0x18c2('0x23'),_0x5836d3,JSON['stringify'](_0x1de553));_0x5109f2(_0x1de553);})['catch'](function(_0x26d637){logger[_0x18c2('0x13')](_0x18c2('0x23'),_0x26d637[_0x18c2('0x15')],_0x5836d3);_0x532a52(_0x524b4f[_0x18c2('0x13')](0x1f4,_0x26d637[_0x18c2('0x15')]));});});}; \ No newline at end of file +var _0xeb33=['model','then','GetTrigger','debug','ShowTrigger','Trigger','find','where','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','attributes','limit','include','map'];(function(_0x2c9ec4,_0x67d4db){var _0x5610d0=function(_0x2a7498){while(--_0x2a7498){_0x2c9ec4['push'](_0x2c9ec4['shift']());}};_0x5610d0(++_0x67d4db);}(_0xeb33,0x17e));var _0x3eb3=function(_0x1bcbf7,_0x31bf2a){_0x1bcbf7=_0x1bcbf7-0x0;var _0x4aeb5b=_0xeb33[_0x1bcbf7];return _0x4aeb5b;};'use strict';var _=require(_0x3eb3('0x0'));var util=require(_0x3eb3('0x1'));var moment=require(_0x3eb3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3eb3('0x3'));var db=require(_0x3eb3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3eb3('0x5'))(_0x3eb3('0x6'));var config=require(_0x3eb3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3eb3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fa5b9,_0x82442f,_0x2c150b){return new BPromise(function(_0x45cf6b,_0x734a68){return client[_0x3eb3('0x9')](_0x2fa5b9,_0x2c150b)['then'](function(_0x2e43e0){logger[_0x3eb3('0xa')](_0x3eb3('0xb'),_0x82442f,_0x3eb3('0xc'));logger['debug'](_0x3eb3('0xd'),_0x82442f,_0x3eb3('0xc'),JSON[_0x3eb3('0xe')](_0x2e43e0));if(_0x2e43e0[_0x3eb3('0xf')]){if(_0x2e43e0[_0x3eb3('0xf')][_0x3eb3('0x10')]===0x1f4){logger[_0x3eb3('0xf')]('Trigger,\x20%s,\x20%s',_0x82442f,_0x2e43e0[_0x3eb3('0xf')][_0x3eb3('0x11')]);return _0x734a68(_0x2e43e0[_0x3eb3('0xf')][_0x3eb3('0x11')]);}logger[_0x3eb3('0xf')]('Trigger,\x20%s,\x20%s',_0x82442f,_0x2e43e0[_0x3eb3('0xf')][_0x3eb3('0x11')]);return _0x45cf6b(_0x2e43e0['error'][_0x3eb3('0x11')]);}else{logger[_0x3eb3('0xa')](_0x3eb3('0xb'),_0x82442f,_0x3eb3('0xc'));_0x45cf6b(_0x2e43e0[_0x3eb3('0x12')][_0x3eb3('0x11')]);}})[_0x3eb3('0x13')](function(_0x39ffc3){logger[_0x3eb3('0xf')](_0x3eb3('0xb'),_0x82442f,_0x39ffc3);_0x734a68(_0x39ffc3);});});}exports['GetTrigger']=function(_0x400942){var _0x4a55be=this;return new Promise(function(_0x407f5e,_0x12cdb2){return db['Trigger']['findAll']({'raw':_0x400942[_0x3eb3('0x14')]?_0x400942[_0x3eb3('0x14')][_0x3eb3('0x15')]===undefined?!![]:![]:!![],'where':_0x400942['options']?_0x400942[_0x3eb3('0x14')]['where']||null:null,'attributes':_0x400942[_0x3eb3('0x14')]?_0x400942[_0x3eb3('0x14')][_0x3eb3('0x16')]||null:null,'limit':_0x400942[_0x3eb3('0x14')]?_0x400942[_0x3eb3('0x14')][_0x3eb3('0x17')]||null:null,'include':_0x400942[_0x3eb3('0x14')]?_0x400942[_0x3eb3('0x14')][_0x3eb3('0x18')]?_[_0x3eb3('0x19')](_0x400942[_0x3eb3('0x14')]['include'],function(_0xa182b5){return{'model':db[_0xa182b5[_0x3eb3('0x1a')]],'as':_0xa182b5['as'],'attributes':_0xa182b5[_0x3eb3('0x16')],'include':_0xa182b5['include']?_[_0x3eb3('0x19')](_0xa182b5[_0x3eb3('0x18')],function(_0x440f8b){return{'model':db[_0x440f8b[_0x3eb3('0x1a')]],'as':_0x440f8b['as'],'attributes':_0x440f8b[_0x3eb3('0x16')],'include':_0x440f8b[_0x3eb3('0x18')]?_[_0x3eb3('0x19')](_0x440f8b[_0x3eb3('0x18')],function(_0x2a1ab6){return{'model':db[_0x2a1ab6[_0x3eb3('0x1a')]],'as':_0x2a1ab6['as'],'attributes':_0x2a1ab6[_0x3eb3('0x16')]};}):[]};}):[]};}):[]:[]})[_0x3eb3('0x1b')](function(_0x3f9a46){logger[_0x3eb3('0xa')](_0x3eb3('0x1c'),_0x400942);logger[_0x3eb3('0x1d')](_0x3eb3('0x1c'),_0x400942,JSON[_0x3eb3('0xe')](_0x3f9a46));_0x407f5e(_0x3f9a46);})[_0x3eb3('0x13')](function(_0x2af81d){logger[_0x3eb3('0xf')](_0x3eb3('0x1c'),_0x2af81d['message'],_0x400942);_0x12cdb2(_0x4a55be[_0x3eb3('0xf')](0x1f4,_0x2af81d['message']));});});};exports[_0x3eb3('0x1e')]=function(_0x444920){var _0x418332=this;return new Promise(function(_0x111943,_0x42a76d){return db[_0x3eb3('0x1f')][_0x3eb3('0x20')]({'raw':_0x444920[_0x3eb3('0x14')]?_0x444920[_0x3eb3('0x14')][_0x3eb3('0x15')]===undefined?!![]:![]:!![],'where':_0x444920[_0x3eb3('0x14')]?_0x444920[_0x3eb3('0x14')][_0x3eb3('0x21')]||null:null,'attributes':_0x444920[_0x3eb3('0x14')]?_0x444920[_0x3eb3('0x14')][_0x3eb3('0x16')]||null:null,'include':_0x444920[_0x3eb3('0x14')]?_0x444920['options'][_0x3eb3('0x18')]?_[_0x3eb3('0x19')](_0x444920[_0x3eb3('0x14')]['include'],function(_0x33901b){return{'model':db[_0x33901b[_0x3eb3('0x1a')]],'as':_0x33901b['as'],'attributes':_0x33901b[_0x3eb3('0x16')],'include':_0x33901b['include']?_[_0x3eb3('0x19')](_0x33901b[_0x3eb3('0x18')],function(_0xab42e9){return{'model':db[_0xab42e9[_0x3eb3('0x1a')]],'as':_0xab42e9['as'],'attributes':_0xab42e9[_0x3eb3('0x16')],'include':_0xab42e9['include']?_[_0x3eb3('0x19')](_0xab42e9[_0x3eb3('0x18')],function(_0x3e2625){return{'model':db[_0x3e2625[_0x3eb3('0x1a')]],'as':_0x3e2625['as'],'attributes':_0x3e2625['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x212aa6){logger['info'](_0x3eb3('0x1e'),_0x444920);logger['debug'](_0x3eb3('0x1e'),_0x444920,JSON['stringify'](_0x212aa6));_0x111943(_0x212aa6);})[_0x3eb3('0x13')](function(_0x1140d9){logger[_0x3eb3('0xf')](_0x3eb3('0x1e'),_0x1140d9[_0x3eb3('0x11')],_0x444920);_0x42a76d(_0x418332[_0x3eb3('0xf')](0x1f4,_0x1140d9[_0x3eb3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 5143691..b1c17bc 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 _0x9942=['../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','show','post','/:id/clone','clone','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router'];(function(_0x1cfe1f,_0x3e8555){var _0xb1dcf6=function(_0x59cf18){while(--_0x59cf18){_0x1cfe1f['push'](_0x1cfe1f['shift']());}};_0xb1dcf6(++_0x3e8555);}(_0x9942,0x187));var _0x2994=function(_0x2aa47b,_0x2d19f0){_0x2aa47b=_0x2aa47b-0x0;var _0x4b05d5=_0x9942[_0x2aa47b];return _0x4b05d5;};'use strict';var multer=require(_0x2994('0x0'));var util=require(_0x2994('0x1'));var path=require(_0x2994('0x2'));var timeout=require('connect-timeout');var express=require(_0x2994('0x3'));var router=express[_0x2994('0x4')]();var auth=require(_0x2994('0x5'));var interaction=require(_0x2994('0x6'));var config=require('../../config/environment');var controller=require(_0x2994('0x7'));router[_0x2994('0x8')]('/',auth[_0x2994('0x9')](),controller[_0x2994('0xa')]);router['get']('/:id',auth[_0x2994('0x9')](),controller[_0x2994('0xb')]);router[_0x2994('0xc')](_0x2994('0xd'),auth[_0x2994('0x9')](),controller[_0x2994('0xe')]);router[_0x2994('0xc')]('/',auth[_0x2994('0x9')](),controller[_0x2994('0xf')]);router[_0x2994('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2994('0x11')]);router[_0x2994('0x12')](_0x2994('0x13'),auth['isAuthenticated'](),controller[_0x2994('0x14')]);module[_0x2994('0x15')]=router; \ No newline at end of file +var _0x6fe2=['get','/:id','show','post','/:id/clone','clone','put','update','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./trunk.controller','isAuthenticated','index'];(function(_0x10bf74,_0x1c0ffd){var _0x27918e=function(_0x58a998){while(--_0x58a998){_0x10bf74['push'](_0x10bf74['shift']());}};_0x27918e(++_0x1c0ffd);}(_0x6fe2,0x14c));var _0x26fe=function(_0x1dffca,_0x13ccd0){_0x1dffca=_0x1dffca-0x0;var _0x368285=_0x6fe2[_0x1dffca];return _0x368285;};'use strict';var multer=require(_0x26fe('0x0'));var util=require(_0x26fe('0x1'));var path=require(_0x26fe('0x2'));var timeout=require(_0x26fe('0x3'));var express=require(_0x26fe('0x4'));var router=express['Router']();var auth=require(_0x26fe('0x5'));var interaction=require(_0x26fe('0x6'));var config=require('../../config/environment');var controller=require(_0x26fe('0x7'));router['get']('/',auth[_0x26fe('0x8')](),controller[_0x26fe('0x9')]);router[_0x26fe('0xa')](_0x26fe('0xb'),auth[_0x26fe('0x8')](),controller[_0x26fe('0xc')]);router[_0x26fe('0xd')](_0x26fe('0xe'),auth[_0x26fe('0x8')](),controller[_0x26fe('0xf')]);router[_0x26fe('0xd')]('/',auth[_0x26fe('0x8')](),controller['create']);router[_0x26fe('0x10')](_0x26fe('0xb'),auth[_0x26fe('0x8')](),controller[_0x26fe('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index ed10b2c..3f447bf 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(_0xd8e1c,_0x3b7a1b){var _0x467e1b=function(_0x44e025){while(--_0x44e025){_0xd8e1c['push'](_0xd8e1c['shift']());}};_0x467e1b(++_0x3b7a1b);}(_0xb10b,0x12a));var _0xbb10=function(_0x64c6e3,_0x3b5371){_0x64c6e3=_0x64c6e3-0x0;var _0x69c52f=_0xb10b[_0x64c6e3];return _0x69c52f;};'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 _0x2032=['all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','exports','STRING','name','friend','user','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','transport','getDataValue','rfc2833','inband','auto','yes','nonat','update','outgoing','setDataValue','join','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x3eb072,_0x2841bd){var _0x3f455e=function(_0x2ec96b){while(--_0x2ec96b){_0x3eb072['push'](_0x3eb072['shift']());}};_0x3f455e(++_0x2841bd);}(_0x2032,0xd9));var _0x2203=function(_0x50117a,_0x1e9ee1){_0x50117a=_0x50117a-0x0;var _0x2d3927=_0x2032[_0x50117a];return _0x2d3927;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x2203('0x3'),_0x2203('0x4'),'peer'),'allowNull':![],'defaultValue':_0x2203('0x3')},'context':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'defaultValue':_0x2203('0x5')},'callingpres':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x7'),_0x2203('0x8'),_0x2203('0x9'),_0x2203('0xa'),_0x2203('0xb'),_0x2203('0xc'),_0x2203('0xd'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x2203('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x2203('0x1')]},'remotesecret':{'type':Sequelize[_0x2203('0x1')]},'transport':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'udp','set':function(_0x849049){this['setDataValue'](_0x2203('0xe'),_0x849049?_0x849049['join'](','):null);},'get':function(){return this[_0x2203('0xf')](_0x2203('0xe'))?this['getDataValue']('transport')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x2203('0x10'),'info','shortinfo',_0x2203('0x11'),_0x2203('0x12')),'defaultValue':_0x2203('0x10')},'directmedia':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no',_0x2203('0x14'),_0x2203('0x15'),_0x2203('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x2203('0x1')]},'nat':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x3f9ef6){this[_0x2203('0x17')]('nat',_0x3f9ef6?_0x3f9ef6[_0x2203('0x18')](','):null);},'get':function(){return this['getDataValue'](_0x2203('0x19'))?this[_0x2203('0xf')](_0x2203('0x19'))[_0x2203('0x1a')](','):null;},'comment':_0x2203('0x1b')},'callgroup':{'type':Sequelize[_0x2203('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x2203('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2203('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x2203('0x1c')},'allow':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3ee25b){this['setDataValue']('allow',_0x3ee25b?_0x3ee25b[_0x2203('0x18')](';'):_0x2203('0x1d'));},'get':function(){return this[_0x2203('0xf')](_0x2203('0x1e'))?this[_0x2203('0xf')](_0x2203('0x1e'))[_0x2203('0x1a')](';'):null;},'comment':_0x2203('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no')},'insecure':{'type':Sequelize[_0x2203('0x1')],'defaultValue':_0x2203('0x20'),'set':function(_0x5f11bf){this[_0x2203('0x17')](_0x2203('0x21'),_0x5f11bf?_0x5f11bf['join'](','):null);},'get':function(){return this[_0x2203('0xf')](_0x2203('0x21'))?this[_0x2203('0xf')](_0x2203('0x21'))[_0x2203('0x1a')](','):null;},'comment':_0x2203('0x22')},'trustrpid':{'type':Sequelize[_0x2203('0x6')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no','never')},'promiscredir':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'useclientcode':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x2203('0x1')]},'callerid':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x2203('0x6')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x2203('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'allowsubscribe':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no')},'ignoresdpversion':{'type':Sequelize[_0x2203('0x6')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x2203('0x1')]},'template':{'type':Sequelize[_0x2203('0x1')]},'videosupport':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no',_0x2203('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2203('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'mailbox':{'type':Sequelize[_0x2203('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x2203('0x25'),_0x2203('0x26'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x2203('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x2203('0x27'),_0x2203('0x28')),'defaultValue':_0x2203('0x28')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x2203('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x2203('0x23')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2203('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x2203('0x1')]},'defaultuser':{'type':Sequelize[_0x2203('0x1')]},'rtptimeout':{'type':Sequelize[_0x2203('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2203('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x2203('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2203('0x1')]},'callbackextension':{'type':Sequelize[_0x2203('0x1')]},'timert1':{'type':Sequelize[_0x2203('0x23')](0xb)},'timerb':{'type':Sequelize[_0x2203('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0x2203('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x2203('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x2203('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x2203('0x1')]},'use_q850_reason':{'type':Sequelize[_0x2203('0x1')]},'maxforwards':{'type':Sequelize[_0x2203('0x23')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2203('0x6')]('yes','no')},'force_avp':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'icesupport':{'type':Sequelize[_0x2203('0x6')]('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no')},'dtlsverify':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no',_0x2203('0x2a'),_0x2203('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x2203('0x23')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x2203('0x1')]},'dtlscipher':{'type':Sequelize[_0x2203('0x1')]},'dtlscafile':{'type':Sequelize[_0x2203('0x1')]},'dtlscapath':{'type':Sequelize[_0x2203('0x1')]},'dtlssetup':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x2c'),_0x2203('0x2d'),_0x2203('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2203('0x1')]},'usereqphone':{'type':Sequelize[_0x2203('0x6')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2203('0x1')]},'recordofffeature':{'type':Sequelize[_0x2203('0x1')]},'call_limit':{'type':Sequelize[_0x2203('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2203('0x6')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x2203('0x1')]},'mohsuggest':{'type':Sequelize[_0x2203('0x1')]},'parkinglot':{'type':Sequelize[_0x2203('0x1')]},'description':{'type':Sequelize[_0x2203('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x2203('0x2f')},'canreinvite':{'type':Sequelize[_0x2203('0x6')]('yes','no',_0x2203('0x14'),_0x2203('0x15'),_0x2203('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x2203('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2203('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 e63b431..9c70ce0 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 _0x4d09=['readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','UserProfileSection','update','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','offset','limit','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','sendStatus','stack','name','send','index','Trunk','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','map','type','VIRTUAL','filter','merge','include','findAll','show','length','includeAll','find','clone','params','options','omit','createdAt','updatedAt','body','create','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3f061d,_0x15a673){var _0x58550b=function(_0x38d52c){while(--_0x38d52c){_0x3f061d['push'](_0x3f061d['shift']());}};_0x58550b(++_0x15a673);}(_0x4d09,0x79));var _0x94d0=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x4d09[_0x4e93a9];return _0x43013c;};'use strict';var pdf=require(_0x94d0('0x0'));var emlformat=require(_0x94d0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x94d0('0x2'));var jsonpatch=require(_0x94d0('0x3'));var rp=require(_0x94d0('0x4'));var moment=require('moment');var BPromise=require(_0x94d0('0x5'));var Mustache=require(_0x94d0('0x6'));var util=require(_0x94d0('0x7'));var path=require('path');var sox=require(_0x94d0('0x8'));var csv=require(_0x94d0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x94d0('0xa'));var crypto=require(_0x94d0('0xb'));var jsforce=require(_0x94d0('0xc'));var deskjs=require(_0x94d0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x94d0('0xe'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x94d0('0xf'));var Redis=require(_0x94d0('0x10'));var qs=require(_0x94d0('0x11'));var logger=require(_0x94d0('0x12'))(_0x94d0('0x13'));var utils=require(_0x94d0('0x14'));var config=require(_0x94d0('0x15'));var db=require(_0x94d0('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x94d0('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x730c61,_0xf5a5ba,_0x2f7366,_0x4e5f71){return new BPromise(function(_0x47e714,_0x243260){var _0x2a1a65=_0x4e5f71||client;return _0x2a1a65[_0x94d0('0x18')](_0x730c61,_0x2f7366)[_0x94d0('0x19')](function(_0x592f7a){logger[_0x94d0('0x1a')](_0x94d0('0x1b'),_0xf5a5ba,_0x94d0('0x1c'));logger[_0x94d0('0x1d')](_0x94d0('0x1e'),_0xf5a5ba,_0x94d0('0x1c'),JSON['stringify'](_0x592f7a));if(_0x592f7a[_0x94d0('0x1f')]){if(_0x592f7a[_0x94d0('0x1f')][_0x94d0('0x20')]===0x1f4){logger[_0x94d0('0x1f')]('Trunk,\x20%s,\x20%s',_0xf5a5ba,_0x592f7a[_0x94d0('0x1f')][_0x94d0('0x21')]);return _0x243260(_0x592f7a[_0x94d0('0x1f')]['message']);}logger['error'](_0x94d0('0x1b'),_0xf5a5ba,_0x592f7a[_0x94d0('0x1f')][_0x94d0('0x21')]);return _0x47e714(_0x592f7a[_0x94d0('0x1f')]['message']);}else{logger[_0x94d0('0x1a')](_0x94d0('0x1b'),_0xf5a5ba,_0x94d0('0x1c'));_0x47e714(_0x592f7a[_0x94d0('0x22')][_0x94d0('0x21')]);}})[_0x94d0('0x23')](function(_0x1d7438){logger[_0x94d0('0x1f')](_0x94d0('0x1b'),_0xf5a5ba,_0x1d7438);_0x243260(_0x1d7438);});});}function respondWithStatusCode(_0x15821a,_0x2ea302){_0x2ea302=_0x2ea302||0xcc;return function(_0x51c7e4){if(_0x51c7e4){return _0x15821a['sendStatus'](_0x2ea302);}return _0x15821a[_0x94d0('0x24')](_0x2ea302)[_0x94d0('0x25')]();};}function respondWithResult(_0x92ad85,_0x7aa716){_0x7aa716=_0x7aa716||0xc8;return function(_0x1fdd30){if(_0x1fdd30){return _0x92ad85['status'](_0x7aa716)[_0x94d0('0x26')](_0x1fdd30);}};}function respondWithFilteredResult(_0x3a0c32,_0x240daa){return function(_0x3d5e6b){if(_0x3d5e6b){var _0x325915=_0x3d5e6b['count'],_0x2de09d=_0x240daa[_0x94d0('0x27')],_0x49ee64=_0x240daa[_0x94d0('0x27')]+_0x240daa[_0x94d0('0x28')],_0x7257bf;if(_0x49ee64>=_0x325915){_0x49ee64=_0x325915;_0x7257bf=0xc8;}else{_0x7257bf=0xce;}_0x3a0c32[_0x94d0('0x24')](_0x7257bf);return _0x3a0c32['set'](_0x94d0('0x29'),_0x2de09d+'-'+_0x49ee64+'/'+_0x325915)[_0x94d0('0x26')](_0x3d5e6b);}return null;};}function patchUpdates(_0x3b7bf3){return function(_0x1d045d){try{jsonpatch[_0x94d0('0x2a')](_0x1d045d,_0x3b7bf3,!![]);}catch(_0x328647){return BPromise[_0x94d0('0x2b')](_0x328647);}return _0x1d045d[_0x94d0('0x2c')]();};}function saveUpdates(_0x45c1cc,_0x106738){return function(_0x559fe5){if(_0x559fe5){return _0x559fe5['update'](_0x45c1cc)[_0x94d0('0x19')](function(_0x21188a){return _0x21188a;});}return null;};}function removeEntity(_0x29d8fd,_0x201976){return function(_0x5b1389){if(_0x5b1389){return _0x5b1389[_0x94d0('0x2d')]()['then'](function(){var _0x549eeb=_0x5b1389[_0x94d0('0x2e')]({'plain':!![]});var _0x5d05e2=_0x94d0('0x2f');return db[_0x94d0('0x30')][_0x94d0('0x2d')]({'where':{'type':_0x5d05e2,'resourceId':_0x549eeb['id']}})[_0x94d0('0x19')](function(){return _0x5b1389;});})[_0x94d0('0x19')](function(){_0x29d8fd[_0x94d0('0x24')](0xcc)[_0x94d0('0x25')]();});}};}function handleEntityNotFound(_0x256d9c,_0x2d1c12){return function(_0x41977a){if(!_0x41977a){_0x256d9c[_0x94d0('0x31')](0x194);}return _0x41977a;};}function handleError(_0x43be55,_0x8564f4){_0x8564f4=_0x8564f4||0x1f4;return function(_0x3a034d){logger[_0x94d0('0x1f')](_0x3a034d[_0x94d0('0x32')]);if(_0x3a034d[_0x94d0('0x33')]){delete _0x3a034d[_0x94d0('0x33')];}_0x43be55[_0x94d0('0x24')](_0x8564f4)[_0x94d0('0x34')](_0x3a034d);};}exports[_0x94d0('0x35')]=function(_0x16bf19,_0x192e7d){var _0x46576e={},_0x5eb6cb={},_0x4b748f={'count':0x0,'rows':[]};var _0x573155=db[_0x94d0('0x36')][_0x94d0('0x37')];_0x5eb6cb[_0x94d0('0x38')]=_[_0x94d0('0x39')](_0x573155);_0x5eb6cb[_0x94d0('0x3a')]=_['keys'](_0x16bf19[_0x94d0('0x3a')]);_0x5eb6cb['filters']=_[_0x94d0('0x3b')](_0x5eb6cb[_0x94d0('0x38')],_0x5eb6cb['query']);_0x46576e[_0x94d0('0x3c')]=_[_0x94d0('0x3b')](_0x5eb6cb['model'],qs[_0x94d0('0x3d')](_0x16bf19[_0x94d0('0x3a')][_0x94d0('0x3d')]));_0x46576e[_0x94d0('0x3c')]=_0x46576e[_0x94d0('0x3c')]['length']?_0x46576e[_0x94d0('0x3c')]:_0x5eb6cb[_0x94d0('0x38')];if(!_0x16bf19['query'][_0x94d0('0x3e')](_0x94d0('0x3f'))){_0x46576e[_0x94d0('0x28')]=qs[_0x94d0('0x28')](_0x16bf19[_0x94d0('0x3a')][_0x94d0('0x28')]);_0x46576e[_0x94d0('0x27')]=qs[_0x94d0('0x27')](_0x16bf19['query'][_0x94d0('0x27')]);}_0x46576e[_0x94d0('0x40')]=qs[_0x94d0('0x41')](_0x16bf19[_0x94d0('0x3a')][_0x94d0('0x41')]);_0x46576e[_0x94d0('0x42')]=qs[_0x94d0('0x43')](_['pick'](_0x16bf19['query'],_0x5eb6cb[_0x94d0('0x43')]));if(_0x16bf19['query']['filter']){_0x46576e[_0x94d0('0x42')]=_['merge'](_0x46576e[_0x94d0('0x42')],{'$or':_[_0x94d0('0x44')](_0x573155,function(_0x40e89a){if(_0x40e89a[_0x94d0('0x45')]['key']!==_0x94d0('0x46')){var _0x4a711f={};_0x4a711f[_0x40e89a['field']]={'$like':'%'+_0x16bf19[_0x94d0('0x3a')][_0x94d0('0x47')]+'%'};return _0x4a711f;}})});}_0x46576e=_[_0x94d0('0x48')]({},_0x46576e,_0x16bf19['options']);var _0x4e0e4f={'where':_0x46576e[_0x94d0('0x42')]};return db[_0x94d0('0x36')]['count'](_0x4e0e4f)[_0x94d0('0x19')](function(_0x34a51a){_0x4b748f['count']=_0x34a51a;if(_0x16bf19[_0x94d0('0x3a')]['includeAll']){_0x46576e[_0x94d0('0x49')]=[{'all':!![]}];}return db[_0x94d0('0x36')][_0x94d0('0x4a')](_0x46576e);})['then'](function(_0x53be65){_0x4b748f['rows']=_0x53be65;return _0x4b748f;})[_0x94d0('0x19')](respondWithFilteredResult(_0x192e7d,_0x46576e))[_0x94d0('0x23')](handleError(_0x192e7d,null));};exports[_0x94d0('0x4b')]=function(_0x22c268,_0x46830f){var _0x53f199={'raw':![],'where':{'id':_0x22c268['params']['id']}},_0x259cf3={};_0x259cf3['model']=_[_0x94d0('0x39')](db[_0x94d0('0x36')]['rawAttributes']);_0x259cf3[_0x94d0('0x3a')]=_[_0x94d0('0x39')](_0x22c268[_0x94d0('0x3a')]);_0x259cf3[_0x94d0('0x43')]=_['intersection'](_0x259cf3[_0x94d0('0x38')],_0x259cf3[_0x94d0('0x3a')]);_0x53f199['attributes']=_[_0x94d0('0x3b')](_0x259cf3[_0x94d0('0x38')],qs[_0x94d0('0x3d')](_0x22c268[_0x94d0('0x3a')][_0x94d0('0x3d')]));_0x53f199[_0x94d0('0x3c')]=_0x53f199[_0x94d0('0x3c')][_0x94d0('0x4c')]?_0x53f199[_0x94d0('0x3c')]:_0x259cf3[_0x94d0('0x38')];if(_0x22c268[_0x94d0('0x3a')][_0x94d0('0x4d')]){_0x53f199[_0x94d0('0x49')]=[{'all':!![]}];}_0x53f199=_['merge']({},_0x53f199,_0x22c268['options']);return db[_0x94d0('0x36')][_0x94d0('0x4e')](_0x53f199)['then'](handleEntityNotFound(_0x46830f,null))['then'](respondWithResult(_0x46830f,null))[_0x94d0('0x23')](handleError(_0x46830f,null));};exports[_0x94d0('0x4f')]=function(_0x1eb29f,_0x20e866){var _0x216706={'raw':![],'where':{'id':_0x1eb29f[_0x94d0('0x50')]['id']}},_0x5e1f2f={};_0x5e1f2f[_0x94d0('0x38')]=_['keys'](db[_0x94d0('0x36')][_0x94d0('0x37')]);_0x216706[_0x94d0('0x3c')]=_[_0x94d0('0x3b')](_0x5e1f2f[_0x94d0('0x38')],qs[_0x94d0('0x3d')](_0x1eb29f[_0x94d0('0x3a')][_0x94d0('0x3d')]));_0x216706[_0x94d0('0x3c')]=_0x216706['attributes'][_0x94d0('0x4c')]?_0x216706[_0x94d0('0x3c')]:_0x5e1f2f['model'];if(_0x1eb29f[_0x94d0('0x3a')][_0x94d0('0x4d')]){_0x216706[_0x94d0('0x49')]=[{'all':!![]}];}_0x216706=_[_0x94d0('0x48')]({},_0x216706,_0x1eb29f[_0x94d0('0x51')]);return db['Trunk'][_0x94d0('0x4e')](_0x216706)[_0x94d0('0x19')](handleEntityNotFound(_0x20e866,null))[_0x94d0('0x19')](function(_0x4d3603){if(_0x4d3603){var _0x1c82e6=_0x4d3603[_0x94d0('0x2e')]({'plain':!![]});_0x1c82e6=qs[_0x94d0('0x52')](_0x1c82e6,['id',_0x94d0('0x53'),_0x94d0('0x54')]);_0x1eb29f[_0x94d0('0x55')]=_[_0x94d0('0x52')](_0x1eb29f[_0x94d0('0x55')],['id','createdAt','updatedAt']);return db[_0x94d0('0x36')][_0x94d0('0x56')](_[_0x94d0('0x48')](_0x1c82e6,_0x1eb29f[_0x94d0('0x55')]),{'include':_0x1eb29f[_0x94d0('0x3a')][_0x94d0('0x4d')]?[{'all':!![]}]:undefined})[_0x94d0('0x19')](function(_0x267d2a){var _0x4e4ef1=_0x1eb29f[_0x94d0('0x57')][_0x94d0('0x2e')]({'plain':!![]});if(!_0x4e4ef1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e4ef1['role']===_0x94d0('0x57')){var _0x11b37b=_0x267d2a[_0x94d0('0x2e')]({'plain':!![]});var _0xe66077=_0x94d0('0x2f');return db['UserProfileSection']['find']({'where':{'name':_0xe66077,'userProfileId':_0x4e4ef1[_0x94d0('0x58')]},'raw':!![]})[_0x94d0('0x19')](function(_0xebd9f1){if(_0xebd9f1&&_0xebd9f1[_0x94d0('0x59')]===0x0){return db[_0x94d0('0x30')][_0x94d0('0x56')]({'name':_0x11b37b[_0x94d0('0x33')],'resourceId':_0x11b37b['id'],'type':_0xebd9f1['name'],'sectionId':_0xebd9f1['id']},{})['then'](function(){return _0x267d2a;});}else{return _0x267d2a;}})[_0x94d0('0x23')](function(_0x4effd2){logger[_0x94d0('0x1f')](_0x94d0('0x5a'),_0x4effd2);throw _0x4effd2;});}return _0x267d2a;});}})[_0x94d0('0x19')](respondWithResult(_0x20e866,0xc9))['catch'](handleError(_0x20e866,null));};exports[_0x94d0('0x56')]=function(_0x2993a2,_0x2506a3,_0x22803b){var _0x36922c;return db[_0x94d0('0x36')][_0x94d0('0x56')](_0x2993a2[_0x94d0('0x55')],{'raw':!![]})[_0x94d0('0x19')](function(_0xce1951){_0x36922c=_0xce1951;return db[_0x94d0('0x36')][_0x94d0('0x4a')]({'raw':!![]});})[_0x94d0('0x19')](function(_0x470e58){var _0xd07793=fs[_0x94d0('0x5b')](path[_0x94d0('0x5c')](config[_0x94d0('0x5d')],_0x94d0('0x5e')),_0x94d0('0x5f'));var _0x4a72f9=fs[_0x94d0('0x5b')](path[_0x94d0('0x5c')](config['root'],_0x94d0('0x60')),'utf8');var _0x4c6468=ejs[_0x94d0('0x61')](_0xd07793,{'trunks':_0x470e58||[]});fs[_0x94d0('0x62')](_0x94d0('0x63'),_0x4c6468);if(_0x36922c['registry']){var _0x20f06f=ejs['render'](_0x4a72f9,{'trunks':_0x470e58||[]});fs[_0x94d0('0x62')](_0x94d0('0x64'),_0x20f06f);}})['then'](function(){return respondWithRpcPromise(_0x94d0('0x65'),_0x94d0('0x56'),{'module':_0x94d0('0x66')});})['then'](function(){var _0x18473c=_0x2993a2[_0x94d0('0x57')][_0x94d0('0x2e')]({'plain':!![]});if(!_0x18473c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18473c[_0x94d0('0x67')]===_0x94d0('0x57')){var _0x9f4b7c=_0x36922c[_0x94d0('0x2e')]({'plain':!![]});return db[_0x94d0('0x68')][_0x94d0('0x4e')]({'where':{'name':_0x94d0('0x2f'),'userProfileId':_0x18473c[_0x94d0('0x58')]},'raw':!![]})[_0x94d0('0x19')](function(_0x40f029){if(_0x40f029&&_0x40f029[_0x94d0('0x59')]===0x0){return db[_0x94d0('0x30')][_0x94d0('0x56')]({'name':_0x9f4b7c[_0x94d0('0x33')],'resourceId':_0x9f4b7c['id'],'type':_0x40f029[_0x94d0('0x33')],'sectionId':_0x40f029['id']},{})['then'](function(){return _0x36922c;});}else{return _0x36922c;}})[_0x94d0('0x23')](function(_0x558249){logger[_0x94d0('0x1f')](_0x94d0('0x5a'),_0x558249);throw _0x558249;});}return _0x36922c;})[_0x94d0('0x19')](respondWithResult(_0x2506a3,0xc9))[_0x94d0('0x23')](handleError(_0x2506a3,null));};exports[_0x94d0('0x69')]=function(_0x5c9f0f,_0x4ae45c,_0x3d3f54){var _0x121172;return db[_0x94d0('0x36')][_0x94d0('0x4e')]({'where':{'id':_0x5c9f0f[_0x94d0('0x50')]['id']}})['then'](handleEntityNotFound(_0x4ae45c,null))['then'](saveUpdates(_0x5c9f0f[_0x94d0('0x55')],null))['then'](function(_0x49390b){if(_0x49390b){_0x121172=_0x49390b;return db[_0x94d0('0x36')][_0x94d0('0x4a')]({'raw':!![]});}})[_0x94d0('0x19')](function(_0x2e9302){if(_0x2e9302){var _0x12b8a0=fs[_0x94d0('0x5b')](path[_0x94d0('0x5c')](config[_0x94d0('0x5d')],'server/files/templates/trunk.ejs'),_0x94d0('0x5f'));var _0x1fbcce=fs['readFileSync'](path['join'](config[_0x94d0('0x5d')],_0x94d0('0x60')),_0x94d0('0x5f'));var _0x2e253a=ejs[_0x94d0('0x61')](_0x12b8a0,{'trunks':_0x2e9302||[]});fs[_0x94d0('0x62')](_0x94d0('0x63'),_0x2e253a);var _0x53c15b=ejs['render'](_0x1fbcce,{'trunks':_0x2e9302||[]});fs[_0x94d0('0x62')](_0x94d0('0x64'),_0x53c15b);return respondWithRpcPromise(_0x94d0('0x65'),_0x94d0('0x69'),{'module':_0x94d0('0x66')});}return null;})[_0x94d0('0x19')](function(_0x219633){if(_0x219633){return _0x121172;}})[_0x94d0('0x19')](respondWithResult(_0x4ae45c,null))[_0x94d0('0x23')](handleError(_0x4ae45c,null));};exports[_0x94d0('0x2d')]=function(_0xdfc3f3,_0x5686a3,_0x3252af){var _0x4c051c;return db[_0x94d0('0x36')]['find']({'where':{'id':_0xdfc3f3[_0x94d0('0x50')]['id']}})[_0x94d0('0x19')](handleEntityNotFound(_0x5686a3,null))['then'](removeEntity(_0x5686a3,null))[_0x94d0('0x19')](function(){return db['Trunk'][_0x94d0('0x4a')]({'raw':!![]});})[_0x94d0('0x19')](function(_0x3a389a){var _0x2912a0=fs[_0x94d0('0x5b')](path[_0x94d0('0x5c')](config[_0x94d0('0x5d')],'server/files/templates/trunk.ejs'),'utf8');var _0xb3ac42=fs[_0x94d0('0x5b')](path[_0x94d0('0x5c')](config[_0x94d0('0x5d')],_0x94d0('0x60')),_0x94d0('0x5f'));var _0x35ae27=ejs[_0x94d0('0x61')](_0x2912a0,{'trunks':_0x3a389a});var _0x1f0184=ejs['render'](_0xb3ac42,{'trunks':_0x3a389a});fs[_0x94d0('0x62')](_0x94d0('0x63'),_0x35ae27);fs[_0x94d0('0x62')](_0x94d0('0x64'),_0x1f0184);return respondWithRpcPromise(_0x94d0('0x65'),_0x94d0('0x2d'),{'module':_0x94d0('0x66')});})[_0x94d0('0x23')](handleError(_0x5686a3,null));}; \ No newline at end of file +var _0xf288=['map','field','filter','options','includeAll','include','findAll','rows','show','params','length','find','get','omit','createdAt','body','updatedAt','create','user','UserProfileSection','userProfileId','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','utf8','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','update','server/files/templates/trunk.ejs','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../mysqldb','jayson/promise','client','http','request','info','request\x20sent','debug','error','message','Trunk,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','set','apply','reject','save','destroy','then','Trunks','stack','index','Trunk','rawAttributes','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','limit','sort','where','pick','merge'];(function(_0x390258,_0x449078){var _0x9a4f01=function(_0x1ede7e){while(--_0x1ede7e){_0x390258['push'](_0x390258['shift']());}};_0x9a4f01(++_0x449078);}(_0xf288,0xf7));var _0x8f28=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0xf288[_0x4017b0];return _0x5ed4f7;};'use strict';var pdf=require(_0x8f28('0x0'));var emlformat=require(_0x8f28('0x1'));var rimraf=require(_0x8f28('0x2'));var zipdir=require(_0x8f28('0x3'));var jsonpatch=require(_0x8f28('0x4'));var rp=require('request-promise');var moment=require(_0x8f28('0x5'));var BPromise=require(_0x8f28('0x6'));var Mustache=require('mustache');var util=require(_0x8f28('0x7'));var path=require('path');var sox=require(_0x8f28('0x8'));var csv=require(_0x8f28('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8f28('0xa'));var squel=require(_0x8f28('0xb'));var crypto=require(_0x8f28('0xc'));var jsforce=require(_0x8f28('0xd'));var deskjs=require(_0x8f28('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8f28('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x8f28('0x10'));var Redis=require('ioredis');var qs=require(_0x8f28('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x8f28('0x12'));var config=require('../../config/environment');var db=require(_0x8f28('0x13'))['db'];var jayson=require(_0x8f28('0x14'));var client=jayson[_0x8f28('0x15')][_0x8f28('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x717873,_0x46741b,_0x45fd7d,_0x4864e5){return new BPromise(function(_0x1de740,_0x5d9545){var _0xb6755b=_0x4864e5||client;return _0xb6755b[_0x8f28('0x17')](_0x717873,_0x45fd7d)['then'](function(_0x297a62){logger[_0x8f28('0x18')]('Trunk,\x20%s,\x20%s',_0x46741b,_0x8f28('0x19'));logger[_0x8f28('0x1a')]('Trunk,\x20%s,\x20%s,\x20%s',_0x46741b,'request\x20sent',JSON['stringify'](_0x297a62));if(_0x297a62['error']){if(_0x297a62[_0x8f28('0x1b')]['code']===0x1f4){logger[_0x8f28('0x1b')]('Trunk,\x20%s,\x20%s',_0x46741b,_0x297a62[_0x8f28('0x1b')][_0x8f28('0x1c')]);return _0x5d9545(_0x297a62['error'][_0x8f28('0x1c')]);}logger[_0x8f28('0x1b')](_0x8f28('0x1d'),_0x46741b,_0x297a62[_0x8f28('0x1b')][_0x8f28('0x1c')]);return _0x1de740(_0x297a62[_0x8f28('0x1b')][_0x8f28('0x1c')]);}else{logger[_0x8f28('0x18')]('Trunk,\x20%s,\x20%s',_0x46741b,_0x8f28('0x19'));_0x1de740(_0x297a62[_0x8f28('0x1e')]['message']);}})[_0x8f28('0x1f')](function(_0x46ff4b){logger[_0x8f28('0x1b')](_0x8f28('0x1d'),_0x46741b,_0x46ff4b);_0x5d9545(_0x46ff4b);});});}function respondWithStatusCode(_0x2e82a7,_0x4fa181){_0x4fa181=_0x4fa181||0xcc;return function(_0x1a6888){if(_0x1a6888){return _0x2e82a7[_0x8f28('0x20')](_0x4fa181);}return _0x2e82a7[_0x8f28('0x21')](_0x4fa181)[_0x8f28('0x22')]();};}function respondWithResult(_0x4d56ec,_0x2e3662){_0x2e3662=_0x2e3662||0xc8;return function(_0x5643ba){if(_0x5643ba){return _0x4d56ec[_0x8f28('0x21')](_0x2e3662)[_0x8f28('0x23')](_0x5643ba);}};}function respondWithFilteredResult(_0x582ac8,_0x4a2934){return function(_0x4f9bfe){if(_0x4f9bfe){var _0x466add=_0x4f9bfe[_0x8f28('0x24')],_0x36581c=_0x4a2934[_0x8f28('0x25')],_0x11a505=_0x4a2934[_0x8f28('0x25')]+_0x4a2934['limit'],_0x426fc4;if(_0x11a505>=_0x466add){_0x11a505=_0x466add;_0x426fc4=0xc8;}else{_0x426fc4=0xce;}_0x582ac8[_0x8f28('0x21')](_0x426fc4);return _0x582ac8[_0x8f28('0x26')]('Content-Range',_0x36581c+'-'+_0x11a505+'/'+_0x466add)[_0x8f28('0x23')](_0x4f9bfe);}return null;};}function patchUpdates(_0x35ad30){return function(_0x59fadf){try{jsonpatch[_0x8f28('0x27')](_0x59fadf,_0x35ad30,!![]);}catch(_0x3185ec){return BPromise[_0x8f28('0x28')](_0x3185ec);}return _0x59fadf[_0x8f28('0x29')]();};}function saveUpdates(_0x9282ab,_0x21f053){return function(_0x7e1c21){if(_0x7e1c21){return _0x7e1c21['update'](_0x9282ab)['then'](function(_0x4fcd8d){return _0x4fcd8d;});}return null;};}function removeEntity(_0x8c684f,_0x3925b7){return function(_0x27aa1f){if(_0x27aa1f){return _0x27aa1f[_0x8f28('0x2a')]()[_0x8f28('0x2b')](function(){var _0x2aa345=_0x27aa1f['get']({'plain':!![]});var _0x1b2170=_0x8f28('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x1b2170,'resourceId':_0x2aa345['id']}})['then'](function(){return _0x27aa1f;});})[_0x8f28('0x2b')](function(){_0x8c684f[_0x8f28('0x21')](0xcc)[_0x8f28('0x22')]();});}};}function handleEntityNotFound(_0x25d000,_0x4d406e){return function(_0x26a02f){if(!_0x26a02f){_0x25d000[_0x8f28('0x20')](0x194);}return _0x26a02f;};}function handleError(_0x4c2b27,_0x5a0911){_0x5a0911=_0x5a0911||0x1f4;return function(_0x2fd3ff){logger[_0x8f28('0x1b')](_0x2fd3ff[_0x8f28('0x2d')]);if(_0x2fd3ff['name']){delete _0x2fd3ff['name'];}_0x4c2b27[_0x8f28('0x21')](_0x5a0911)['send'](_0x2fd3ff);};}exports[_0x8f28('0x2e')]=function(_0x2b6b34,_0x5af3ff){var _0x88751a={},_0x12c68d={},_0x4dfb28={'count':0x0,'rows':[]};var _0x94e7f0=db[_0x8f28('0x2f')][_0x8f28('0x30')];_0x12c68d[_0x8f28('0x31')]=_[_0x8f28('0x32')](_0x94e7f0);_0x12c68d['query']=_[_0x8f28('0x32')](_0x2b6b34['query']);_0x12c68d[_0x8f28('0x33')]=_[_0x8f28('0x34')](_0x12c68d['model'],_0x12c68d[_0x8f28('0x35')]);_0x88751a[_0x8f28('0x36')]=_[_0x8f28('0x34')](_0x12c68d[_0x8f28('0x31')],qs[_0x8f28('0x37')](_0x2b6b34[_0x8f28('0x35')]['fields']));_0x88751a[_0x8f28('0x36')]=_0x88751a[_0x8f28('0x36')]['length']?_0x88751a[_0x8f28('0x36')]:_0x12c68d[_0x8f28('0x31')];if(!_0x2b6b34[_0x8f28('0x35')][_0x8f28('0x38')]('nolimit')){_0x88751a[_0x8f28('0x39')]=qs[_0x8f28('0x39')](_0x2b6b34['query'][_0x8f28('0x39')]);_0x88751a['offset']=qs[_0x8f28('0x25')](_0x2b6b34[_0x8f28('0x35')][_0x8f28('0x25')]);}_0x88751a['order']=qs[_0x8f28('0x3a')](_0x2b6b34[_0x8f28('0x35')][_0x8f28('0x3a')]);_0x88751a[_0x8f28('0x3b')]=qs['filters'](_[_0x8f28('0x3c')](_0x2b6b34[_0x8f28('0x35')],_0x12c68d[_0x8f28('0x33')]));if(_0x2b6b34[_0x8f28('0x35')]['filter']){_0x88751a[_0x8f28('0x3b')]=_[_0x8f28('0x3d')](_0x88751a[_0x8f28('0x3b')],{'$or':_[_0x8f28('0x3e')](_0x94e7f0,function(_0xd1a6eb){if(_0xd1a6eb['type']['key']!=='VIRTUAL'){var _0x3a75f6={};_0x3a75f6[_0xd1a6eb[_0x8f28('0x3f')]]={'$like':'%'+_0x2b6b34['query'][_0x8f28('0x40')]+'%'};return _0x3a75f6;}})});}_0x88751a=_['merge']({},_0x88751a,_0x2b6b34[_0x8f28('0x41')]);var _0x5710a0={'where':_0x88751a[_0x8f28('0x3b')]};return db[_0x8f28('0x2f')][_0x8f28('0x24')](_0x5710a0)['then'](function(_0x16ce3b){_0x4dfb28[_0x8f28('0x24')]=_0x16ce3b;if(_0x2b6b34[_0x8f28('0x35')][_0x8f28('0x42')]){_0x88751a[_0x8f28('0x43')]=[{'all':!![]}];}return db[_0x8f28('0x2f')][_0x8f28('0x44')](_0x88751a);})['then'](function(_0x59d8f6){_0x4dfb28[_0x8f28('0x45')]=_0x59d8f6;return _0x4dfb28;})[_0x8f28('0x2b')](respondWithFilteredResult(_0x5af3ff,_0x88751a))[_0x8f28('0x1f')](handleError(_0x5af3ff,null));};exports[_0x8f28('0x46')]=function(_0x2252b8,_0x5d2c9c){var _0x3dbe92={'raw':![],'where':{'id':_0x2252b8[_0x8f28('0x47')]['id']}},_0x32e96f={};_0x32e96f[_0x8f28('0x31')]=_['keys'](db['Trunk']['rawAttributes']);_0x32e96f[_0x8f28('0x35')]=_[_0x8f28('0x32')](_0x2252b8[_0x8f28('0x35')]);_0x32e96f['filters']=_[_0x8f28('0x34')](_0x32e96f[_0x8f28('0x31')],_0x32e96f['query']);_0x3dbe92[_0x8f28('0x36')]=_[_0x8f28('0x34')](_0x32e96f['model'],qs[_0x8f28('0x37')](_0x2252b8[_0x8f28('0x35')]['fields']));_0x3dbe92[_0x8f28('0x36')]=_0x3dbe92[_0x8f28('0x36')][_0x8f28('0x48')]?_0x3dbe92[_0x8f28('0x36')]:_0x32e96f[_0x8f28('0x31')];if(_0x2252b8['query']['includeAll']){_0x3dbe92['include']=[{'all':!![]}];}_0x3dbe92=_[_0x8f28('0x3d')]({},_0x3dbe92,_0x2252b8[_0x8f28('0x41')]);return db[_0x8f28('0x2f')]['find'](_0x3dbe92)[_0x8f28('0x2b')](handleEntityNotFound(_0x5d2c9c,null))[_0x8f28('0x2b')](respondWithResult(_0x5d2c9c,null))['catch'](handleError(_0x5d2c9c,null));};exports['clone']=function(_0x250094,_0x553623){var _0x1303c2={'raw':![],'where':{'id':_0x250094[_0x8f28('0x47')]['id']}},_0x174ee3={};_0x174ee3['model']=_[_0x8f28('0x32')](db[_0x8f28('0x2f')][_0x8f28('0x30')]);_0x1303c2[_0x8f28('0x36')]=_[_0x8f28('0x34')](_0x174ee3['model'],qs['fields'](_0x250094['query'][_0x8f28('0x37')]));_0x1303c2[_0x8f28('0x36')]=_0x1303c2[_0x8f28('0x36')]['length']?_0x1303c2[_0x8f28('0x36')]:_0x174ee3[_0x8f28('0x31')];if(_0x250094[_0x8f28('0x35')][_0x8f28('0x42')]){_0x1303c2['include']=[{'all':!![]}];}_0x1303c2=_[_0x8f28('0x3d')]({},_0x1303c2,_0x250094['options']);return db[_0x8f28('0x2f')][_0x8f28('0x49')](_0x1303c2)[_0x8f28('0x2b')](handleEntityNotFound(_0x553623,null))[_0x8f28('0x2b')](function(_0x9944a1){if(_0x9944a1){var _0x55005d=_0x9944a1[_0x8f28('0x4a')]({'plain':!![]});_0x55005d=qs[_0x8f28('0x4b')](_0x55005d,['id',_0x8f28('0x4c'),'updatedAt']);_0x250094[_0x8f28('0x4d')]=_[_0x8f28('0x4b')](_0x250094[_0x8f28('0x4d')],['id',_0x8f28('0x4c'),_0x8f28('0x4e')]);return db['Trunk'][_0x8f28('0x4f')](_['merge'](_0x55005d,_0x250094['body']),{'include':_0x250094['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x5931a6){var _0x56fa46=_0x250094[_0x8f28('0x50')]['get']({'plain':!![]});if(!_0x56fa46)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56fa46['role']===_0x8f28('0x50')){var _0x51a500=_0x5931a6[_0x8f28('0x4a')]({'plain':!![]});var _0x42cd08=_0x8f28('0x2c');return db[_0x8f28('0x51')][_0x8f28('0x49')]({'where':{'name':_0x42cd08,'userProfileId':_0x56fa46[_0x8f28('0x52')]},'raw':!![]})['then'](function(_0x20a1af){if(_0x20a1af&&_0x20a1af['autoAssociation']===0x0){return db[_0x8f28('0x53')][_0x8f28('0x4f')]({'name':_0x51a500[_0x8f28('0x54')],'resourceId':_0x51a500['id'],'type':_0x20a1af[_0x8f28('0x54')],'sectionId':_0x20a1af['id']},{})[_0x8f28('0x2b')](function(){return _0x5931a6;});}else{return _0x5931a6;}})[_0x8f28('0x1f')](function(_0x5ea241){logger[_0x8f28('0x1b')](_0x8f28('0x55'),_0x5ea241);throw _0x5ea241;});}return _0x5931a6;});}})[_0x8f28('0x2b')](respondWithResult(_0x553623,0xc9))[_0x8f28('0x1f')](handleError(_0x553623,null));};exports[_0x8f28('0x4f')]=function(_0x281a92,_0x56d347,_0x282b7c){var _0x349bc7;return db[_0x8f28('0x2f')]['create'](_0x281a92[_0x8f28('0x4d')],{'raw':!![]})['then'](function(_0x138727){_0x349bc7=_0x138727;return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x4d194d){var _0x345c4c=fs[_0x8f28('0x56')](path[_0x8f28('0x57')](config[_0x8f28('0x58')],'server/files/templates/trunk.ejs'),_0x8f28('0x59'));var _0x2e96ee=fs['readFileSync'](path[_0x8f28('0x57')](config[_0x8f28('0x58')],_0x8f28('0x5a')),_0x8f28('0x59'));var _0x57508c=ejs['render'](_0x345c4c,{'trunks':_0x4d194d||[]});fs[_0x8f28('0x5b')](_0x8f28('0x5c'),_0x57508c);if(_0x349bc7[_0x8f28('0x5d')]){var _0x49a7b4=ejs[_0x8f28('0x5e')](_0x2e96ee,{'trunks':_0x4d194d||[]});fs['writeFileSync'](_0x8f28('0x5f'),_0x49a7b4);}})[_0x8f28('0x2b')](function(){return respondWithRpcPromise(_0x8f28('0x60'),_0x8f28('0x4f'),{'module':_0x8f28('0x61')});})['then'](function(){var _0x604344=_0x281a92['user'][_0x8f28('0x4a')]({'plain':!![]});if(!_0x604344)throw new Error(_0x8f28('0x62'));if(_0x604344[_0x8f28('0x63')]===_0x8f28('0x50')){var _0x5349e1=_0x349bc7[_0x8f28('0x4a')]({'plain':!![]});return db['UserProfileSection'][_0x8f28('0x49')]({'where':{'name':_0x8f28('0x2c'),'userProfileId':_0x604344[_0x8f28('0x52')]},'raw':!![]})[_0x8f28('0x2b')](function(_0x4ab39d){if(_0x4ab39d&&_0x4ab39d[_0x8f28('0x64')]===0x0){return db['UserProfileResource'][_0x8f28('0x4f')]({'name':_0x5349e1[_0x8f28('0x54')],'resourceId':_0x5349e1['id'],'type':_0x4ab39d['name'],'sectionId':_0x4ab39d['id']},{})[_0x8f28('0x2b')](function(){return _0x349bc7;});}else{return _0x349bc7;}})[_0x8f28('0x1f')](function(_0x439d39){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x439d39);throw _0x439d39;});}return _0x349bc7;})[_0x8f28('0x2b')](respondWithResult(_0x56d347,0xc9))[_0x8f28('0x1f')](handleError(_0x56d347,null));};exports[_0x8f28('0x65')]=function(_0x5b55e7,_0x40af4c,_0xef624a){var _0xb0b7c2;return db[_0x8f28('0x2f')][_0x8f28('0x49')]({'where':{'id':_0x5b55e7[_0x8f28('0x47')]['id']}})['then'](handleEntityNotFound(_0x40af4c,null))[_0x8f28('0x2b')](saveUpdates(_0x5b55e7[_0x8f28('0x4d')],null))[_0x8f28('0x2b')](function(_0x12d9f1){if(_0x12d9f1){_0xb0b7c2=_0x12d9f1;return db['Trunk'][_0x8f28('0x44')]({'raw':!![]});}})['then'](function(_0x3cdcb7){if(_0x3cdcb7){var _0x33accc=fs[_0x8f28('0x56')](path[_0x8f28('0x57')](config[_0x8f28('0x58')],_0x8f28('0x66')),_0x8f28('0x59'));var _0x55be38=fs[_0x8f28('0x56')](path[_0x8f28('0x57')](config[_0x8f28('0x58')],_0x8f28('0x5a')),_0x8f28('0x59'));var _0x12f5da=ejs[_0x8f28('0x5e')](_0x33accc,{'trunks':_0x3cdcb7||[]});fs[_0x8f28('0x5b')](_0x8f28('0x5c'),_0x12f5da);var _0x598199=ejs[_0x8f28('0x5e')](_0x55be38,{'trunks':_0x3cdcb7||[]});fs['writeFileSync'](_0x8f28('0x5f'),_0x598199);return respondWithRpcPromise(_0x8f28('0x60'),'update',{'module':_0x8f28('0x61')});}return null;})['then'](function(_0x59ad0f){if(_0x59ad0f){return _0xb0b7c2;}})[_0x8f28('0x2b')](respondWithResult(_0x40af4c,null))[_0x8f28('0x1f')](handleError(_0x40af4c,null));};exports['destroy']=function(_0x1ba357,_0x547161,_0x1062a3){var _0x414627;return db[_0x8f28('0x2f')][_0x8f28('0x49')]({'where':{'id':_0x1ba357['params']['id']}})['then'](handleEntityNotFound(_0x547161,null))[_0x8f28('0x2b')](removeEntity(_0x547161,null))[_0x8f28('0x2b')](function(){return db[_0x8f28('0x2f')]['findAll']({'raw':!![]});})['then'](function(_0x5693f7){var _0x393d8b=fs[_0x8f28('0x56')](path['join'](config[_0x8f28('0x58')],_0x8f28('0x66')),_0x8f28('0x59'));var _0x31c3f2=fs[_0x8f28('0x56')](path['join'](config['root'],_0x8f28('0x5a')),_0x8f28('0x59'));var _0x496a23=ejs[_0x8f28('0x5e')](_0x393d8b,{'trunks':_0x5693f7});var _0x29b1b3=ejs[_0x8f28('0x5e')](_0x31c3f2,{'trunks':_0x5693f7});fs[_0x8f28('0x5b')]('/etc/asterisk/sip_xcally_trunks.conf',_0x496a23);fs[_0x8f28('0x5b')](_0x8f28('0x5f'),_0x29b1b3);return respondWithRpcPromise(_0x8f28('0x60'),'destroy',{'module':'chan_sip.so'});})[_0x8f28('0x1f')](handleError(_0x547161,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 9e7fe09..a30397d 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 _0xd69b=['request-promise','./trunk.attributes','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x470c21,_0x4575dc){var _0x4d80b5=function(_0x249e59){while(--_0x249e59){_0x470c21['push'](_0x470c21['shift']());}};_0x4d80b5(++_0x4575dc);}(_0xd69b,0x86));var _0xbd69=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xd69b[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xbd69('0x0'));var util=require(_0xbd69('0x1'));var logger=require(_0xbd69('0x2'))(_0xbd69('0x3'));var moment=require(_0xbd69('0x4'));var BPromise=require(_0xbd69('0x5'));var rp=require(_0xbd69('0x6'));var attributes=require(_0xbd69('0x7'));module['exports']=function(_0x127d48,_0x978e92){return _0x127d48['define'](_0xbd69('0x8'),attributes,{'tableName':_0xbd69('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e3d=['./trunk.attributes','exports','Trunk','tools_trunks','lodash','../../config/logger','api','bluebird'];(function(_0x575004,_0x16555b){var _0x12f572=function(_0x194429){while(--_0x194429){_0x575004['push'](_0x575004['shift']());}};_0x12f572(++_0x16555b);}(_0x1e3d,0x1a4));var _0xd1e3=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x1e3d[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0xd1e3('0x0'));var util=require('util');var logger=require(_0xd1e3('0x1'))(_0xd1e3('0x2'));var moment=require('moment');var BPromise=require(_0xd1e3('0x3'));var rp=require('request-promise');var attributes=require(_0xd1e3('0x4'));module[_0xd1e3('0x5')]=function(_0x14fbae,_0x342d34){return _0x14fbae['define'](_0xd1e3('0x6'),attributes,{'tableName':_0xd1e3('0x7'),'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 77ac3c8..d57a57a 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 _0x463b=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','options','where','attributes','limit','include','model','map','ShowTrunk','find','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x463b,0xfd));var _0xb463=function(_0x4e1c67,_0x200c02){_0x4e1c67=_0x4e1c67-0x0;var _0x3cc99d=_0x463b[_0x4e1c67];return _0x3cc99d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb463('0x0'));var BPromise=require(_0xb463('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb463('0x2'));var db=require(_0xb463('0x3'))['db'];var utils=require(_0xb463('0x4'));var logger=require(_0xb463('0x5'))(_0xb463('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb463('0x7')][_0xb463('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a6645,_0x28b544,_0xe8bd93){return new BPromise(function(_0x58d94e,_0x46f980){return client[_0xb463('0x9')](_0x2a6645,_0xe8bd93)[_0xb463('0xa')](function(_0x49ffe9){logger[_0xb463('0xb')](_0xb463('0xc'),_0x28b544,_0xb463('0xd'));logger[_0xb463('0xe')](_0xb463('0xf'),_0x28b544,'request\x20sent',JSON[_0xb463('0x10')](_0x49ffe9));if(_0x49ffe9[_0xb463('0x11')]){if(_0x49ffe9[_0xb463('0x11')][_0xb463('0x12')]===0x1f4){logger[_0xb463('0x11')]('Trunk,\x20%s,\x20%s',_0x28b544,_0x49ffe9[_0xb463('0x11')][_0xb463('0x13')]);return _0x46f980(_0x49ffe9[_0xb463('0x11')][_0xb463('0x13')]);}logger[_0xb463('0x11')](_0xb463('0xc'),_0x28b544,_0x49ffe9[_0xb463('0x11')][_0xb463('0x13')]);return _0x58d94e(_0x49ffe9[_0xb463('0x11')][_0xb463('0x13')]);}else{logger[_0xb463('0xb')](_0xb463('0xc'),_0x28b544,_0xb463('0xd'));_0x58d94e(_0x49ffe9[_0xb463('0x14')][_0xb463('0x13')]);}})[_0xb463('0x15')](function(_0x5090b4){logger[_0xb463('0x11')](_0xb463('0xc'),_0x28b544,_0x5090b4);_0x46f980(_0x5090b4);});});}exports[_0xb463('0x16')]=function(_0x132fc0){var _0x2bff84=this;return new Promise(function(_0x2b8308,_0xb6f06c){return db[_0xb463('0x17')]['findAll']({'raw':_0x132fc0[_0xb463('0x18')]?_0x132fc0['options']['raw']===undefined?!![]:![]:!![],'where':_0x132fc0[_0xb463('0x18')]?_0x132fc0[_0xb463('0x18')][_0xb463('0x19')]||null:null,'attributes':_0x132fc0[_0xb463('0x18')]?_0x132fc0['options'][_0xb463('0x1a')]||null:null,'limit':_0x132fc0[_0xb463('0x18')]?_0x132fc0['options'][_0xb463('0x1b')]||null:null,'include':_0x132fc0[_0xb463('0x18')]?_0x132fc0[_0xb463('0x18')][_0xb463('0x1c')]?_['map'](_0x132fc0[_0xb463('0x18')][_0xb463('0x1c')],function(_0x2cc31a){return{'model':db[_0x2cc31a[_0xb463('0x1d')]],'as':_0x2cc31a['as'],'attributes':_0x2cc31a[_0xb463('0x1a')],'include':_0x2cc31a[_0xb463('0x1c')]?_['map'](_0x2cc31a[_0xb463('0x1c')],function(_0x3fbcd5){return{'model':db[_0x3fbcd5['model']],'as':_0x3fbcd5['as'],'attributes':_0x3fbcd5[_0xb463('0x1a')],'include':_0x3fbcd5[_0xb463('0x1c')]?_[_0xb463('0x1e')](_0x3fbcd5[_0xb463('0x1c')],function(_0x38333f){return{'model':db[_0x38333f[_0xb463('0x1d')]],'as':_0x38333f['as'],'attributes':_0x38333f['attributes']};}):[]};}):[]};}):[]:[]})[_0xb463('0xa')](function(_0x48e195){logger[_0xb463('0xb')](_0xb463('0x16'),_0x132fc0);logger[_0xb463('0xe')](_0xb463('0x16'),_0x132fc0,JSON[_0xb463('0x10')](_0x48e195));_0x2b8308(_0x48e195);})[_0xb463('0x15')](function(_0x56e567){logger[_0xb463('0x11')](_0xb463('0x16'),_0x56e567[_0xb463('0x13')],_0x132fc0);_0xb6f06c(_0x2bff84[_0xb463('0x11')](0x1f4,_0x56e567['message']));});});};exports[_0xb463('0x1f')]=function(_0x5d8b94){var _0x57492f=this;return new Promise(function(_0x92e632,_0x36fffc){return db[_0xb463('0x17')][_0xb463('0x20')]({'raw':_0x5d8b94[_0xb463('0x18')]?_0x5d8b94[_0xb463('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5d8b94[_0xb463('0x18')]?_0x5d8b94[_0xb463('0x18')][_0xb463('0x19')]||null:null,'attributes':_0x5d8b94[_0xb463('0x18')]?_0x5d8b94['options']['attributes']||null:null,'include':_0x5d8b94[_0xb463('0x18')]?_0x5d8b94[_0xb463('0x18')][_0xb463('0x1c')]?_[_0xb463('0x1e')](_0x5d8b94['options'][_0xb463('0x1c')],function(_0x397934){return{'model':db[_0x397934['model']],'as':_0x397934['as'],'attributes':_0x397934[_0xb463('0x1a')],'include':_0x397934[_0xb463('0x1c')]?_[_0xb463('0x1e')](_0x397934[_0xb463('0x1c')],function(_0x17aa1b){return{'model':db[_0x17aa1b[_0xb463('0x1d')]],'as':_0x17aa1b['as'],'attributes':_0x17aa1b[_0xb463('0x1a')],'include':_0x17aa1b[_0xb463('0x1c')]?_[_0xb463('0x1e')](_0x17aa1b['include'],function(_0x4b284e){return{'model':db[_0x4b284e[_0xb463('0x1d')]],'as':_0x4b284e['as'],'attributes':_0x4b284e[_0xb463('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x301f24){logger[_0xb463('0xb')]('ShowTrunk',_0x5d8b94);logger[_0xb463('0xe')](_0xb463('0x1f'),_0x5d8b94,JSON[_0xb463('0x10')](_0x301f24));_0x92e632(_0x301f24);})[_0xb463('0x15')](function(_0x10a4b9){logger[_0xb463('0x11')](_0xb463('0x1f'),_0x10a4b9[_0xb463('0x13')],_0x5d8b94);_0x36fffc(_0x57492f['error'](0x1f4,_0x10a4b9[_0xb463('0x13')]));});});}; \ No newline at end of file +var _0x8a3f=['model','then','catch','ShowTrunk','find','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTrunk','findAll','options','raw','attributes','limit','include','map'];(function(_0x23d18e,_0x368c4c){var _0x5f48d1=function(_0x215c02){while(--_0x215c02){_0x23d18e['push'](_0x23d18e['shift']());}};_0x5f48d1(++_0x368c4c);}(_0x8a3f,0x116));var _0xf8a3=function(_0x282ebe,_0x2e0541){_0x282ebe=_0x282ebe-0x0;var _0x1d808a=_0x8a3f[_0x282ebe];return _0x1d808a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf8a3('0x0'));var BPromise=require(_0xf8a3('0x1'));var rs=require(_0xf8a3('0x2'));var fs=require('fs');var Redis=require(_0xf8a3('0x3'));var db=require(_0xf8a3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf8a3('0x5'));var jayson=require(_0xf8a3('0x6'));var client=jayson[_0xf8a3('0x7')][_0xf8a3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x179e9e,_0x16c832,_0x9e80b5){return new BPromise(function(_0x2363c7,_0x4dfa0a){return client[_0xf8a3('0x9')](_0x179e9e,_0x9e80b5)['then'](function(_0x286547){logger[_0xf8a3('0xa')](_0xf8a3('0xb'),_0x16c832,_0xf8a3('0xc'));logger[_0xf8a3('0xd')](_0xf8a3('0xe'),_0x16c832,_0xf8a3('0xc'),JSON[_0xf8a3('0xf')](_0x286547));if(_0x286547['error']){if(_0x286547[_0xf8a3('0x10')][_0xf8a3('0x11')]===0x1f4){logger[_0xf8a3('0x10')]('Trunk,\x20%s,\x20%s',_0x16c832,_0x286547[_0xf8a3('0x10')][_0xf8a3('0x12')]);return _0x4dfa0a(_0x286547[_0xf8a3('0x10')][_0xf8a3('0x12')]);}logger[_0xf8a3('0x10')](_0xf8a3('0xb'),_0x16c832,_0x286547[_0xf8a3('0x10')][_0xf8a3('0x12')]);return _0x2363c7(_0x286547[_0xf8a3('0x10')][_0xf8a3('0x12')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x16c832,'request\x20sent');_0x2363c7(_0x286547[_0xf8a3('0x13')]['message']);}})['catch'](function(_0xfa40a2){logger[_0xf8a3('0x10')](_0xf8a3('0xb'),_0x16c832,_0xfa40a2);_0x4dfa0a(_0xfa40a2);});});}exports[_0xf8a3('0x14')]=function(_0x1c070d){var _0x2d75c8=this;return new Promise(function(_0x3ba5fa,_0x2b58ac){return db['Trunk'][_0xf8a3('0x15')]({'raw':_0x1c070d[_0xf8a3('0x16')]?_0x1c070d[_0xf8a3('0x16')][_0xf8a3('0x17')]===undefined?!![]:![]:!![],'where':_0x1c070d[_0xf8a3('0x16')]?_0x1c070d[_0xf8a3('0x16')]['where']||null:null,'attributes':_0x1c070d[_0xf8a3('0x16')]?_0x1c070d[_0xf8a3('0x16')][_0xf8a3('0x18')]||null:null,'limit':_0x1c070d[_0xf8a3('0x16')]?_0x1c070d[_0xf8a3('0x16')][_0xf8a3('0x19')]||null:null,'include':_0x1c070d['options']?_0x1c070d['options'][_0xf8a3('0x1a')]?_[_0xf8a3('0x1b')](_0x1c070d[_0xf8a3('0x16')][_0xf8a3('0x1a')],function(_0x228185){return{'model':db[_0x228185[_0xf8a3('0x1c')]],'as':_0x228185['as'],'attributes':_0x228185['attributes'],'include':_0x228185[_0xf8a3('0x1a')]?_['map'](_0x228185[_0xf8a3('0x1a')],function(_0x27c624){return{'model':db[_0x27c624[_0xf8a3('0x1c')]],'as':_0x27c624['as'],'attributes':_0x27c624['attributes'],'include':_0x27c624[_0xf8a3('0x1a')]?_[_0xf8a3('0x1b')](_0x27c624[_0xf8a3('0x1a')],function(_0x5987a0){return{'model':db[_0x5987a0['model']],'as':_0x5987a0['as'],'attributes':_0x5987a0[_0xf8a3('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf8a3('0x1d')](function(_0x5186d5){logger[_0xf8a3('0xa')]('GetTrunk',_0x1c070d);logger[_0xf8a3('0xd')](_0xf8a3('0x14'),_0x1c070d,JSON[_0xf8a3('0xf')](_0x5186d5));_0x3ba5fa(_0x5186d5);})[_0xf8a3('0x1e')](function(_0x3e55d6){logger[_0xf8a3('0x10')](_0xf8a3('0x14'),_0x3e55d6[_0xf8a3('0x12')],_0x1c070d);_0x2b58ac(_0x2d75c8[_0xf8a3('0x10')](0x1f4,_0x3e55d6['message']));});});};exports[_0xf8a3('0x1f')]=function(_0x878799){var _0x464ec5=this;return new Promise(function(_0x4254ce,_0x46ef95){return db['Trunk'][_0xf8a3('0x20')]({'raw':_0x878799['options']?_0x878799['options']['raw']===undefined?!![]:![]:!![],'where':_0x878799[_0xf8a3('0x16')]?_0x878799[_0xf8a3('0x16')][_0xf8a3('0x21')]||null:null,'attributes':_0x878799[_0xf8a3('0x16')]?_0x878799[_0xf8a3('0x16')][_0xf8a3('0x18')]||null:null,'include':_0x878799[_0xf8a3('0x16')]?_0x878799[_0xf8a3('0x16')][_0xf8a3('0x1a')]?_[_0xf8a3('0x1b')](_0x878799['options']['include'],function(_0x2be312){return{'model':db[_0x2be312[_0xf8a3('0x1c')]],'as':_0x2be312['as'],'attributes':_0x2be312[_0xf8a3('0x18')],'include':_0x2be312[_0xf8a3('0x1a')]?_[_0xf8a3('0x1b')](_0x2be312['include'],function(_0x4277dc){return{'model':db[_0x4277dc[_0xf8a3('0x1c')]],'as':_0x4277dc['as'],'attributes':_0x4277dc[_0xf8a3('0x18')],'include':_0x4277dc['include']?_[_0xf8a3('0x1b')](_0x4277dc[_0xf8a3('0x1a')],function(_0x4ae57d){return{'model':db[_0x4ae57d[_0xf8a3('0x1c')]],'as':_0x4ae57d['as'],'attributes':_0x4ae57d[_0xf8a3('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf8a3('0x1d')](function(_0x224d9e){logger[_0xf8a3('0xa')](_0xf8a3('0x1f'),_0x878799);logger['debug']('ShowTrunk',_0x878799,JSON[_0xf8a3('0xf')](_0x224d9e));_0x4254ce(_0x224d9e);})[_0xf8a3('0x1e')](function(_0x419259){logger['error'](_0xf8a3('0x1f'),_0x419259[_0xf8a3('0x12')],_0x878799);_0x46ef95(_0x464ec5['error'](0x1f4,_0x419259[_0xf8a3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index d16b5b9..28c5f58 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 _0x6e5c=['removeSquareProjects','removeApiKey','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/avatar','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','addQueues','root','format','%s-%s','originalname','single','file','addAvatar','login','/:id/logout','logout','pause','/:id/unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addChatWebsites','addSquareProjects','createApiKey','put','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeChatWebsites'];(function(_0x13c994,_0x2e1c99){var _0x44110b=function(_0x1e2325){while(--_0x1e2325){_0x13c994['push'](_0x13c994['shift']());}};_0x44110b(++_0x2e1c99);}(_0x6e5c,0x123));var _0xc6e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e5c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xc6e5('0x0'));var path=require(_0xc6e5('0x1'));var timeout=require(_0xc6e5('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xc6e5('0x3'));var interaction=require(_0xc6e5('0x4'));var config=require(_0xc6e5('0x5'));var controller=require('./user.controller');router['get']('/',auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x7')]);router['get'](_0xc6e5('0x8'),auth['isAuthenticated'](),controller[_0xc6e5('0x9')]);router[_0xc6e5('0xa')](_0xc6e5('0xb'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0xc')]);router['get'](_0xc6e5('0xd'),controller['getAvatar']);router[_0xc6e5('0xa')](_0xc6e5('0xe'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0xf')]);router[_0xc6e5('0xa')](_0xc6e5('0x10'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x11')]);router[_0xc6e5('0xa')]('/:id/queues_rt',auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x12')]);router[_0xc6e5('0xa')](_0xc6e5('0x13'),auth[_0xc6e5('0x6')](),controller['getGroups']);router[_0xc6e5('0xa')](_0xc6e5('0x14'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x15')]);router[_0xc6e5('0xa')]('/:id/chat/interactions',auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x16')]);router[_0xc6e5('0xa')](_0xc6e5('0x17'),auth['isAuthenticated'](),controller[_0xc6e5('0x18')]);router[_0xc6e5('0xa')](_0xc6e5('0x19'),auth[_0xc6e5('0x6')](),controller['getMailInteractions']);router[_0xc6e5('0xa')](_0xc6e5('0x1a'),auth[_0xc6e5('0x6')](),controller['getSmsInteractions']);router[_0xc6e5('0xa')]('/:id/fax/interactions',auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x1b')]);router['get'](_0xc6e5('0x1c'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x1d')]);router['get'](_0xc6e5('0x1e'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x1f')]);router[_0xc6e5('0xa')](_0xc6e5('0x20'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x21')]);router[_0xc6e5('0xa')](_0xc6e5('0x22'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x23')]);router['get'](_0xc6e5('0x24'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x25')]);router[_0xc6e5('0xa')](_0xc6e5('0x26'),auth[_0xc6e5('0x6')](),controller['getMailAccounts']);router[_0xc6e5('0xa')](_0xc6e5('0x27'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x28')]);router[_0xc6e5('0xa')]('/:id/sms_accounts',auth[_0xc6e5('0x6')](),controller['getSmsAccounts']);router[_0xc6e5('0xa')](_0xc6e5('0x29'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x2a')]);router[_0xc6e5('0xa')](_0xc6e5('0x2b'),auth[_0xc6e5('0x6')](),controller['getSquareProjects']);router['get'](_0xc6e5('0x2c'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x2d')]);router[_0xc6e5('0xa')](_0xc6e5('0x2e'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x2f')]);router[_0xc6e5('0x30')](_0xc6e5('0x31'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x32')]);router[_0xc6e5('0x30')](_0xc6e5('0xe'),auth[_0xc6e5('0x6')](),controller['addContacts']);router[_0xc6e5('0x30')]('/',auth[_0xc6e5('0x6')](),controller['create']);router['post'](_0xc6e5('0x10'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x8780f3,_0x55b4de,_0x5c0624){_0x5c0624(null,path['join'](config[_0xc6e5('0x34')],'server/files/images/'));},'filename':function(_0x4879a0,_0x3fc493,_0x3aaeb9){_0x3aaeb9(null,util[_0xc6e5('0x35')](_0xc6e5('0x36'),Date['now'](),_0x3fc493[_0xc6e5('0x37')]));}})});router[_0xc6e5('0x30')](_0xc6e5('0xd'),upload[_0xc6e5('0x38')](_0xc6e5('0x39')),controller[_0xc6e5('0x3a')]);router[_0xc6e5('0x30')]('/:id/login',auth['isAuthenticated'](),controller[_0xc6e5('0x3b')]);router['post'](_0xc6e5('0x3c'),auth['isAuthenticated'](),controller[_0xc6e5('0x3d')]);router['post']('/:id/pause',auth['isAuthenticated'](),controller[_0xc6e5('0x3e')]);router['post'](_0xc6e5('0x3f'),auth['isAuthenticated'](),controller['unpause']);router[_0xc6e5('0x30')](_0xc6e5('0x1c'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x40')]);router[_0xc6e5('0x30')](_0xc6e5('0x41'),auth[_0xc6e5('0x6')](),controller['addChatInteractions']);router[_0xc6e5('0x30')](_0xc6e5('0x42'),auth['isAuthenticated'](),controller['addMailInteractions']);router['post']('/:id/fax_interactions',auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x43')]);router[_0xc6e5('0x30')](_0xc6e5('0x44'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x45')]);router['post'](_0xc6e5('0x46'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x47')]);router[_0xc6e5('0x30')](_0xc6e5('0x24'),auth[_0xc6e5('0x6')](),controller['addFaxAccounts']);router[_0xc6e5('0x30')](_0xc6e5('0x26'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x48')]);router['post']('/:id/openchannel_accounts',auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x49')]);router[_0xc6e5('0x30')](_0xc6e5('0x4a'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0xc6e5('0x30')]('/:id/chat_websites',auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x4b')]);router['post'](_0xc6e5('0x2b'),auth['isAuthenticated'](),controller[_0xc6e5('0x4c')]);router[_0xc6e5('0x30')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xc6e5('0x4d')]);router[_0xc6e5('0x4e')](_0xc6e5('0xb'),auth[_0xc6e5('0x6')](),controller['update']);router['put'](_0xc6e5('0x4f'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x50')]);router[_0xc6e5('0x51')](_0xc6e5('0x10'),auth[_0xc6e5('0x6')](),controller['removeQueues']);router['delete']('/:id/teams',auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x52')]);router[_0xc6e5('0x51')](_0xc6e5('0xb'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x53')]);router[_0xc6e5('0x51')](_0xc6e5('0x41'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x54')]);router[_0xc6e5('0x51')](_0xc6e5('0x42'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x55')]);router['delete'](_0xc6e5('0x56'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x57')]);router[_0xc6e5('0x51')](_0xc6e5('0x44'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x58')]);router[_0xc6e5('0x51')](_0xc6e5('0x46'),auth['isAuthenticated'](),controller[_0xc6e5('0x59')]);router[_0xc6e5('0x51')](_0xc6e5('0x24'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x5a')]);router[_0xc6e5('0x51')]('/:id/mail_accounts',auth[_0xc6e5('0x6')](),controller['removeMailAccounts']);router['delete'](_0xc6e5('0x27'),auth['isAuthenticated'](),controller[_0xc6e5('0x5b')]);router[_0xc6e5('0x51')](_0xc6e5('0x4a'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0xc6e5('0x51')](_0xc6e5('0x29'),auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x5c')]);router[_0xc6e5('0x51')]('/:id/square_projects',auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x5d')]);router[_0xc6e5('0x51')]('/:id/api_key',auth[_0xc6e5('0x6')](),controller[_0xc6e5('0x5e')]);module[_0xc6e5('0x5f')]=router; \ No newline at end of file +var _0x4fbe=['/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSquareProjects','createApiKey','update','put','/:id/password','changePassword','delete','removeQueues','destroy','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeSquareProjects','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','/describe','describe','/:id','show','get','/:id/avatar','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/chat/interactions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/teams','/:id/lists','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','bulkCreate','addContacts','create','diskStorage','root','server/files/images/','%s-%s','originalname','single','addAvatar','/:id/login','logout','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions'];(function(_0x4e5622,_0x4b41a0){var _0x1e9995=function(_0x612bbd){while(--_0x612bbd){_0x4e5622['push'](_0x4e5622['shift']());}};_0x1e9995(++_0x4b41a0);}(_0x4fbe,0x13c));var _0xe4fb=function(_0xf30a98,_0x4e36d1){_0xf30a98=_0xf30a98-0x0;var _0x5b53dc=_0x4fbe[_0xf30a98];return _0x5b53dc;};'use strict';var multer=require(_0xe4fb('0x0'));var util=require(_0xe4fb('0x1'));var path=require(_0xe4fb('0x2'));var timeout=require('connect-timeout');var express=require(_0xe4fb('0x3'));var router=express[_0xe4fb('0x4')]();var auth=require(_0xe4fb('0x5'));var interaction=require(_0xe4fb('0x6'));var config=require(_0xe4fb('0x7'));var controller=require(_0xe4fb('0x8'));router['get']('/',auth[_0xe4fb('0x9')](),controller[_0xe4fb('0xa')]);router['get'](_0xe4fb('0xb'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0xc')]);router['get'](_0xe4fb('0xd'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0xe')]);router[_0xe4fb('0xf')](_0xe4fb('0x10'),controller['getAvatar']);router[_0xe4fb('0xf')](_0xe4fb('0x11'),auth['isAuthenticated'](),controller[_0xe4fb('0x12')]);router[_0xe4fb('0xf')](_0xe4fb('0x13'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x14')]);router[_0xe4fb('0xf')]('/:id/queues_rt',auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x15')]);router[_0xe4fb('0xf')](_0xe4fb('0x16'),auth['isAuthenticated'](),controller[_0xe4fb('0x17')]);router['get'](_0xe4fb('0x18'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x19')]);router[_0xe4fb('0xf')](_0xe4fb('0x1a'),auth[_0xe4fb('0x9')](),controller['getChatInteractions']);router[_0xe4fb('0xf')](_0xe4fb('0x1b'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0xe4fb('0xf')](_0xe4fb('0x1c'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x1d')]);router['get'](_0xe4fb('0x1e'),auth[_0xe4fb('0x9')](),controller['getSmsInteractions']);router['get'](_0xe4fb('0x1f'),auth['isAuthenticated'](),controller[_0xe4fb('0x20')]);router[_0xe4fb('0xf')](_0xe4fb('0x21'),auth['isAuthenticated'](),controller['getTeams']);router[_0xe4fb('0xf')](_0xe4fb('0x22'),auth[_0xe4fb('0x9')](),controller['getLists']);router['get']('/:id/agents',auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x23')]);router[_0xe4fb('0xf')](_0xe4fb('0x24'),auth[_0xe4fb('0x9')](),controller['getVoicePrefixes']);router[_0xe4fb('0xf')](_0xe4fb('0x25'),auth['isAuthenticated'](),controller[_0xe4fb('0x26')]);router['get'](_0xe4fb('0x27'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x28')]);router[_0xe4fb('0xf')](_0xe4fb('0x29'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x2a')]);router[_0xe4fb('0xf')]('/:id/sms_accounts',auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x2b')]);router['get'](_0xe4fb('0x2c'),auth[_0xe4fb('0x9')](),controller['getChatWebsites']);router['get'](_0xe4fb('0x2d'),auth['isAuthenticated'](),controller[_0xe4fb('0x2e')]);router[_0xe4fb('0xf')](_0xe4fb('0x2f'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x30')]);router[_0xe4fb('0xf')](_0xe4fb('0x31'),auth[_0xe4fb('0x9')](),controller['getApiKey']);router[_0xe4fb('0x32')]('/create_many',auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x33')]);router[_0xe4fb('0x32')](_0xe4fb('0x11'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x34')]);router[_0xe4fb('0x32')]('/',auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x35')]);router[_0xe4fb('0x32')](_0xe4fb('0x13'),auth[_0xe4fb('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0xe4fb('0x36')]({'destination':function(_0x282902,_0x1e74a3,_0x5ea0bd){_0x5ea0bd(null,path['join'](config[_0xe4fb('0x37')],_0xe4fb('0x38')));},'filename':function(_0x4e31e8,_0x577af5,_0x46dc0e){_0x46dc0e(null,util['format'](_0xe4fb('0x39'),Date['now'](),_0x577af5[_0xe4fb('0x3a')]));}})});router[_0xe4fb('0x32')](_0xe4fb('0x10'),upload[_0xe4fb('0x3b')]('file'),controller[_0xe4fb('0x3c')]);router[_0xe4fb('0x32')](_0xe4fb('0x3d'),auth[_0xe4fb('0x9')](),controller['login']);router['post']('/:id/logout',auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x3e')]);router[_0xe4fb('0x32')]('/:id/pause',auth[_0xe4fb('0x9')](),controller['pause']);router[_0xe4fb('0x32')](_0xe4fb('0x3f'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x40')]);router['post'](_0xe4fb('0x21'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x41')]);router['post'](_0xe4fb('0x42'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x43')]);router[_0xe4fb('0x32')](_0xe4fb('0x44'),auth['isAuthenticated'](),controller[_0xe4fb('0x45')]);router['post']('/:id/fax_interactions',auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x46')]);router['post'](_0xe4fb('0x47'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x48')]);router[_0xe4fb('0x32')](_0xe4fb('0x49'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x4a')]);router[_0xe4fb('0x32')](_0xe4fb('0x25'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x4b')]);router[_0xe4fb('0x32')](_0xe4fb('0x27'),auth['isAuthenticated'](),controller[_0xe4fb('0x4c')]);router[_0xe4fb('0x32')](_0xe4fb('0x29'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x4d')]);router[_0xe4fb('0x32')](_0xe4fb('0x4e'),auth['isAuthenticated'](),controller['addSmsAccounts']);router['post'](_0xe4fb('0x2c'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0xe4fb('0x32')](_0xe4fb('0x2d'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x4f')]);router['post']('/:id/api_key',auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x50')]);router['put'](_0xe4fb('0xd'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x51')]);router[_0xe4fb('0x52')](_0xe4fb('0x53'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x54')]);router[_0xe4fb('0x55')](_0xe4fb('0x13'),auth['isAuthenticated'](),controller[_0xe4fb('0x56')]);router[_0xe4fb('0x55')](_0xe4fb('0x21'),auth[_0xe4fb('0x9')](),controller['removeTeams']);router[_0xe4fb('0x55')]('/:id',auth['isAuthenticated'](),controller[_0xe4fb('0x57')]);router[_0xe4fb('0x55')]('/:id/chat_interactions',auth[_0xe4fb('0x9')](),controller['removeChatInteractions']);router['delete']('/:id/mail_interactions',auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x58')]);router[_0xe4fb('0x55')](_0xe4fb('0x59'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x5a')]);router[_0xe4fb('0x55')](_0xe4fb('0x47'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x5b')]);router['delete']('/:id/openchannel_interactions',auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x5c')]);router[_0xe4fb('0x55')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xe4fb('0x5d')]);router[_0xe4fb('0x55')]('/:id/mail_accounts',auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x5e')]);router['delete']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0xe4fb('0x55')](_0xe4fb('0x4e'),auth[_0xe4fb('0x9')](),controller['removeSmsAccounts']);router[_0xe4fb('0x55')]('/:id/chat_websites',auth[_0xe4fb('0x9')](),controller['removeChatWebsites']);router['delete'](_0xe4fb('0x2d'),auth[_0xe4fb('0x9')](),controller[_0xe4fb('0x5f')]);router[_0xe4fb('0x55')](_0xe4fb('0x31'),auth[_0xe4fb('0x9')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 02e123f..d17ea8d 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 _0x05d6=['auto','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','update,nonat','DATE','showWebBar','get','wss','avpf','force_avp','dtlsenable','icesupport','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','moment','util','exports','STRING','setDataValue','name','defaultuser','fullname','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','user','agent','local','INTEGER','accountcode','format','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05d6,0x1bd));var _0x605d=function(_0x349e4e,_0x562f82){_0x349e4e=_0x349e4e-0x0;var _0x28aef4=_0x05d6[_0x349e4e];return _0x28aef4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x605d('0x0'));var util=require(_0x605d('0x1'));var _=require('lodash');module[_0x605d('0x2')]={'name':{'type':Sequelize[_0x605d('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x233277){this[_0x605d('0x4')](_0x605d('0x5'),_0x233277);this[_0x605d('0x4')](_0x605d('0x6'),_0x233277);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x605d('0x3')],'allowNull':![],'set':function(_0x5d8e43){this[_0x605d('0x4')](_0x605d('0x7'),_0x5d8e43);this[_0x605d('0x4')](_0x605d('0x8'),util['format'](_0x605d('0x9'),_0x5d8e43,this[_0x605d('0xa')](_0x605d('0xb'))));}},'alias':{'type':Sequelize[_0x605d('0x3')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x605d('0xc'),'validate':{'isEmail':!![]},'set':function(_0x47a0b5){if(_0x47a0b5){this[_0x605d('0x4')](_0x605d('0xc'),_0x47a0b5[_0x605d('0xd')]());}}},'role':{'type':Sequelize['ENUM'](_0x605d('0xe'),_0x605d('0xf'),_0x605d('0x10'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x605d('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x605d('0x3')],'defaultValue':_0x605d('0x11')},'internal':{'type':Sequelize[_0x605d('0x12')](0xb),'allowNull':![],'unique':_0x605d('0xb'),'set':function(_0x25adf1){this[_0x605d('0x4')]('internal',_0x25adf1);this[_0x605d('0x4')](_0x605d('0x13'),_0x25adf1);this[_0x605d('0x4')](_0x605d('0x8'),util[_0x605d('0x14')](_0x605d('0x9'),this[_0x605d('0xa')](_0x605d('0x7')),_0x25adf1));}},'salt':{'type':Sequelize[_0x605d('0x3')]},'phone':{'type':Sequelize[_0x605d('0x3')]},'mobile':{'type':Sequelize[_0x605d('0x3')]},'address':{'type':Sequelize[_0x605d('0x3')]},'zipcode':{'type':Sequelize[_0x605d('0x3')]},'userpic':{'type':Sequelize[_0x605d('0x3')]},'city':{'type':Sequelize[_0x605d('0x3')]},'country':{'type':Sequelize[_0x605d('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x605d('0x3')],'defaultValue':_0x605d('0x16')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x605d('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x605d('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x605d('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x605d('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x605d('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x605d('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x605d('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x605d('0x17')},'ipaddr':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x605d('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x605d('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x19'),'user',_0x605d('0x1a')),'allowNull':!![],'defaultValue':_0x605d('0x19')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x605d('0x1b')},'callingpres':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x1c'),_0x605d('0x1d'),'ALLOWED_FAILED_SCREEN',_0x605d('0x1e'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x605d('0x1f'),_0x605d('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![],'defaultValue':_0x605d('0x21'),'set':function(_0x53847d){this[_0x605d('0x4')](_0x605d('0x22'),_0x53847d?_0x53847d[_0x605d('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x605d('0xa')](_0x605d('0x22'))[_0x605d('0x24')](','):null;},'comment':_0x605d('0x25')},'dtmfmode':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x26'),'info',_0x605d('0x27'),_0x605d('0x28'),_0x605d('0x29')),'allowNull':!![],'defaultValue':_0x605d('0x26')},'directmedia':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no',_0x605d('0x2b'),_0x605d('0x2c'),_0x605d('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x605d('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x51924c){this[_0x605d('0x4')](_0x605d('0x2e'),_0x51924c?_0x51924c[_0x605d('0x23')](','):null);},'get':function(){return this['getDataValue'](_0x605d('0x2e'))?this[_0x605d('0xa')](_0x605d('0x2e'))[_0x605d('0x24')](','):null;},'comment':_0x605d('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x605d('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x605d('0x3')]},'language':{'type':Sequelize[_0x605d('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x605d('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x605d('0x3')],'allowNull':![],'defaultValue':_0x605d('0x30'),'set':function(_0x5ba8f9){this[_0x605d('0x4')](_0x605d('0x31'),_0x5ba8f9?_0x5ba8f9[_0x605d('0x23')](';'):_0x605d('0x30'));},'get':function(){return this[_0x605d('0xa')](_0x605d('0x31'))?this['getDataValue']('allow')['split'](';'):null;},'comment':_0x605d('0x32')},'autoframing':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![],'set':function(_0xe57b47){this[_0x605d('0x4')](_0x605d('0x33'),_0xe57b47?_0xe57b47['join'](','):null);},'get':function(){return this['getDataValue'](_0x605d('0x33'))?this[_0x605d('0xa')]('insecure')[_0x605d('0x24')](','):null;},'comment':_0x605d('0x34')},'trustrpid':{'type':Sequelize[_0x605d('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x605d('0x18')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x605d('0x18')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![],'defaultValue':_0x605d('0x35')},'amaflags':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x605d('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x605d('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x605d('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no',_0x605d('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x605d('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x605d('0x18')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x37'),_0x605d('0x38'),_0x605d('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x605d('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x605d('0x3a'),_0x605d('0x3b')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x605d('0x2a')},'keepalive':{'type':Sequelize[_0x605d('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x605d('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x605d('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x605d('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x605d('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x605d('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x605d('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x605d('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x605d('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x605d('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x605d('0x18')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no',_0x605d('0x3c'),_0x605d('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x605d('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x3e'),'passive',_0x605d('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x605d('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x605d('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x605d('0x18')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no',_0x605d('0x2b'),'update',_0x605d('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x605d('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x605d('0x41')]},'showWebBar':{'type':Sequelize[_0x605d('0x12')],'defaultValue':0x0,'set':function(_0x4ef1fa){this[_0x605d('0x4')](_0x605d('0x42'),_0x4ef1fa);var _0x58e3fb=this[_0x605d('0x43')]({'plain':!![]});switch(_0x4ef1fa){case 0x0:case 0x1:var _0x576c5f=_0x58e3fb['transport']?_['isArray'](_0x58e3fb['transport'])?_0x58e3fb['transport'][_0x605d('0x23')]():_0x58e3fb[_0x605d('0x22')]:_0x605d('0x21');if(_0x576c5f===_0x605d('0x44')){_0x576c5f='udp';}this[_0x605d('0x4')](_0x605d('0x22'),_0x576c5f);this[_0x605d('0x4')]('encryption','no');this[_0x605d('0x4')](_0x605d('0x45'),null);this[_0x605d('0x4')](_0x605d('0x46'),null);this['setDataValue']('icesupport',null);this['setDataValue'](_0x605d('0x47'),null);this[_0x605d('0x4')]('dtlsverify',null);this[_0x605d('0x4')]('dtlssetup',null);this[_0x605d('0x4')]('dtlscertfile',null);this[_0x605d('0x4')]('dtlsprivatekey',null);this[_0x605d('0x4')]('rtcp_mux','no');break;case 0x2:this[_0x605d('0x4')](_0x605d('0x22'),_0x605d('0x44'));this[_0x605d('0x4')]('encryption','yes');this['setDataValue']('avpf',_0x605d('0x2a'));this[_0x605d('0x4')](_0x605d('0x46'),_0x605d('0x2a'));this[_0x605d('0x4')](_0x605d('0x48'),_0x605d('0x2a'));this[_0x605d('0x4')](_0x605d('0x47'),'yes');this[_0x605d('0x4')]('dtlsverify','no');this[_0x605d('0x4')]('dtlssetup',_0x605d('0x3f'));this[_0x605d('0x4')](_0x605d('0x49'),_0x58e3fb[_0x605d('0x49')]||_0x605d('0x4a'));this[_0x605d('0x4')](_0x605d('0x4b'),_0x58e3fb[_0x605d('0x4b')]||_0x605d('0x4c'));this[_0x605d('0x4')](_0x605d('0x4d'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x605d('0x4e')],'set':function(_0xd8b3d7){this[_0x605d('0x4')](_0x605d('0x4f'),_0xd8b3d7?_0xd8b3d7[_0x605d('0x23')](','):[]);},'get':function(){return this[_0x605d('0xa')](_0x605d('0x4f'))?_[_0x605d('0x50')](this[_0x605d('0xa')]('permissions')[_0x605d('0x24')](','),function(_0x1ecae0){return parseInt(_0x1ecae0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x605d('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x605d('0x3')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x605d('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x605d('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x605d('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x605d('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x605d('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x605d('0x18')](_0x605d('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x605d('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x605d('0x3')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x605d('0x15')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x605d('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0x1fe4=['DEFAULT\x20PAUSE','DATE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','isArray','udp','encryption','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','avpf','dtlsenable','/etc/pki/tls/private/motion.key','TEXT','permissions','sequelize','moment','util','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','internal','STRING','email','toLowerCase','ENUM','admin','user','telephone','local','INTEGER','\x22%s\x22\x20<%s>','BOOLEAN'];(function(_0x286595,_0x29f350){var _0x3ea6b8=function(_0x157dc3){while(--_0x157dc3){_0x286595['push'](_0x286595['shift']());}};_0x3ea6b8(++_0x29f350);}(_0x1fe4,0xe9));var _0x41fe=function(_0x99facc,_0x548cd6){_0x99facc=_0x99facc-0x0;var _0xd39ed0=_0x1fe4[_0x99facc];return _0xd39ed0;};'use strict';var Sequelize=require(_0x41fe('0x0'));var moment=require(_0x41fe('0x1'));var util=require(_0x41fe('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x41fe('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x33a433){this[_0x41fe('0x4')]('name',_0x33a433);this['setDataValue']('defaultuser',_0x33a433);},'comment':_0x41fe('0x5')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x1df900){this[_0x41fe('0x4')](_0x41fe('0x6'),_0x1df900);this[_0x41fe('0x4')](_0x41fe('0x7'),util[_0x41fe('0x8')]('\x22%s\x22\x20<%s>',_0x1df900,this[_0x41fe('0x9')](_0x41fe('0xa'))));}},'alias':{'type':Sequelize[_0x41fe('0xb')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x41fe('0xc'),'validate':{'isEmail':!![]},'set':function(_0x3fba35){if(_0x3fba35){this[_0x41fe('0x4')]('email',_0x3fba35[_0x41fe('0xd')]());}}},'role':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0xf'),_0x41fe('0x10'),'agent',_0x41fe('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x41fe('0xb')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x41fe('0xb')],'defaultValue':_0x41fe('0x12')},'internal':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':![],'unique':_0x41fe('0xa'),'set':function(_0x50970a){this[_0x41fe('0x4')](_0x41fe('0xa'),_0x50970a);this[_0x41fe('0x4')]('accountcode',_0x50970a);this['setDataValue'](_0x41fe('0x7'),util['format'](_0x41fe('0x14'),this[_0x41fe('0x9')]('fullname'),_0x50970a));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x41fe('0xb')]},'mobile':{'type':Sequelize[_0x41fe('0xb')]},'address':{'type':Sequelize[_0x41fe('0xb')]},'zipcode':{'type':Sequelize[_0x41fe('0xb')]},'userpic':{'type':Sequelize[_0x41fe('0xb')]},'city':{'type':Sequelize[_0x41fe('0xb')]},'country':{'type':Sequelize[_0x41fe('0xb')]},'online':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x41fe('0xb')],'defaultValue':_0x41fe('0x16')},'lastPauseAt':{'type':Sequelize[_0x41fe('0x17')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x41fe('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x41fe('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x41fe('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x41fe('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x41fe('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x41fe('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x41fe('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'host':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![],'defaultValue':_0x41fe('0x18')},'ipaddr':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'port':{'type':Sequelize[_0x41fe('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x19'),_0x41fe('0x10'),_0x41fe('0x1a')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![],'defaultValue':_0x41fe('0x1b')},'callingpres':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x1c'),_0x41fe('0x1d'),_0x41fe('0x1e'),_0x41fe('0x1f'),_0x41fe('0x20'),'PROHIB_PASSED_SCREEN',_0x41fe('0x21'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'permit':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'secret':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'transport':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![],'defaultValue':'udp','set':function(_0x454eaf){this[_0x41fe('0x4')](_0x41fe('0x22'),_0x454eaf?_0x454eaf['join'](','):null);},'get':function(){return this[_0x41fe('0x9')](_0x41fe('0x22'))?this[_0x41fe('0x9')]('transport')[_0x41fe('0x23')](','):null;},'comment':_0x41fe('0x24')},'dtmfmode':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x25'),_0x41fe('0x26'),_0x41fe('0x27'),_0x41fe('0x28'),_0x41fe('0x29')),'allowNull':!![],'defaultValue':_0x41fe('0x25')},'directmedia':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no',_0x41fe('0x2b'),_0x41fe('0x2c'),_0x41fe('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'nat':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![],'defaultValue':_0x41fe('0x2e'),'set':function(_0x408007){this[_0x41fe('0x4')]('nat',_0x408007?_0x408007[_0x41fe('0x2f')](','):null);},'get':function(){return this[_0x41fe('0x9')]('nat')?this[_0x41fe('0x9')](_0x41fe('0x30'))[_0x41fe('0x23')](','):null;},'comment':_0x41fe('0x31')},'callgroup':{'type':Sequelize[_0x41fe('0xb')]},'namedcallgroup':{'type':Sequelize[_0x41fe('0xb')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x41fe('0xb')]},'language':{'type':Sequelize[_0x41fe('0xb')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x41fe('0xb')]},'disallow':{'type':Sequelize[_0x41fe('0xb')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x41fe('0x32'),'set':function(_0x4e6ca5){this[_0x41fe('0x4')](_0x41fe('0x33'),_0x4e6ca5?_0x4e6ca5['join'](';'):_0x41fe('0x32'));},'get':function(){return this['getDataValue'](_0x41fe('0x33'))?this[_0x41fe('0x9')](_0x41fe('0x33'))[_0x41fe('0x23')](';'):null;},'comment':_0x41fe('0x34')},'autoframing':{'type':Sequelize[_0x41fe('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x18bcf9){this['setDataValue'](_0x41fe('0x35'),_0x18bcf9?_0x18bcf9[_0x41fe('0x2f')](','):null);},'get':function(){return this[_0x41fe('0x9')](_0x41fe('0x35'))?this[_0x41fe('0x9')](_0x41fe('0x35'))[_0x41fe('0x23')](','):null;},'comment':_0x41fe('0x36')},'trustrpid':{'type':Sequelize['ENUM'](_0x41fe('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x41fe('0x2a'),'no',_0x41fe('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![],'defaultValue':_0x41fe('0x38')},'amaflags':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x41fe('0x2a')},'busylevel':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x41fe('0xe')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'template':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x41fe('0xe')]('yes','no',_0x41fe('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x41fe('0xe')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x41fe('0x3a'),_0x41fe('0x3b'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x3c'),'uas'),'allowNull':!![],'defaultValue':_0x41fe('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x41fe('0x2a')},'keepalive':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x41fe('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x41fe('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x41fe('0xe')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x41fe('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x41fe('0xe')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x41fe('0x2a'),'no',_0x41fe('0x3e'),_0x41fe('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x40'),_0x41fe('0x41'),_0x41fe('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x41fe('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no',_0x41fe('0x2b'),'update',_0x41fe('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x41fe('0xb')]},'resetPasswordExpires':{'type':Sequelize[_0x41fe('0x17')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0xf5f15e){this[_0x41fe('0x4')](_0x41fe('0x44'),_0xf5f15e);var _0x32f31d=this['get']({'plain':!![]});switch(_0xf5f15e){case 0x0:case 0x1:var _0x240d55=_0x32f31d['transport']?_[_0x41fe('0x45')](_0x32f31d[_0x41fe('0x22')])?_0x32f31d[_0x41fe('0x22')][_0x41fe('0x2f')]():_0x32f31d[_0x41fe('0x22')]:_0x41fe('0x46');if(_0x240d55==='wss'){_0x240d55='udp';}this[_0x41fe('0x4')]('transport',_0x240d55);this[_0x41fe('0x4')](_0x41fe('0x47'),'no');this[_0x41fe('0x4')]('avpf',null);this[_0x41fe('0x4')](_0x41fe('0x48'),null);this[_0x41fe('0x4')](_0x41fe('0x49'),null);this['setDataValue']('dtlsenable',null);this[_0x41fe('0x4')](_0x41fe('0x4a'),null);this[_0x41fe('0x4')](_0x41fe('0x4b'),null);this[_0x41fe('0x4')](_0x41fe('0x4c'),null);this[_0x41fe('0x4')](_0x41fe('0x4d'),null);this[_0x41fe('0x4')](_0x41fe('0x4e'),'no');break;case 0x2:this['setDataValue']('transport',_0x41fe('0x4f'));this[_0x41fe('0x4')](_0x41fe('0x47'),_0x41fe('0x2a'));this[_0x41fe('0x4')](_0x41fe('0x50'),'yes');this[_0x41fe('0x4')]('force_avp','yes');this['setDataValue'](_0x41fe('0x49'),_0x41fe('0x2a'));this[_0x41fe('0x4')](_0x41fe('0x51'),_0x41fe('0x2a'));this[_0x41fe('0x4')](_0x41fe('0x4a'),'no');this[_0x41fe('0x4')](_0x41fe('0x4b'),'actpass');this[_0x41fe('0x4')]('dtlscertfile',_0x32f31d[_0x41fe('0x4c')]||'/etc/pki/tls/certs/motion.crt');this[_0x41fe('0x4')](_0x41fe('0x4d'),_0x32f31d[_0x41fe('0x4d')]||_0x41fe('0x52'));this[_0x41fe('0x4')](_0x41fe('0x4e'),_0x41fe('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x41fe('0x53')],'set':function(_0xd26468){this['setDataValue']('permissions',_0xd26468?_0xd26468[_0x41fe('0x2f')](','):[]);},'get':function(){return this[_0x41fe('0x9')]('permissions')?_['map'](this['getDataValue'](_0x41fe('0x54'))[_0x41fe('0x23')](','),function(_0x5d13bd){return parseInt(_0x5d13bd,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x41fe('0xb')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x41fe('0xb')]},'phoneBarBusyNumber':{'type':Sequelize[_0x41fe('0xb')]},'phoneBarUnconditional':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x41fe('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x41fe('0xb')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x41fe('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x41fe('0xe')](_0x41fe('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x41fe('0xb')]},'passwordResetAt':{'type':Sequelize[_0x41fe('0x17')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x41fe('0xb')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x41fe('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x41fe('0xb')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 3834c32..190e457 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 _0x71c8=['$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','firstName','lastName','CmContact','Contact','getApiKey','retrieveApiKey','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','apiKeyNonce','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./user.socket','register','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','count','offset','limit','status','Content-Range','apply','reject','save','update','destroy','Telephones','telephone','filter','map','value','includes','role','name','stack','send','User','model','keys','salt','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','sequelize','lower','col','options','includeAll','include','findAll','rows','params','differenceBy','rawAttributes','password','find','bulkCreate','body','describe','addContacts','ids','omit','agent','agent\x20role','../../config/license/util','getLicense','users','License\x20limit\x20reached','format','create','internal','Setting','findById','min_internal','max','isNil','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','fullname','email','permissions','101','102','110','104','105','106','107','109','VoiceMail','user','get','Agents','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','newPassword','Sequelize','authenticate','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','admin','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','voicePause','interface','isValidChannel','channel','Unknown\x20channel','add','toLowerCase','spread','capitalize','QueueId','emit','Queue:save','voice','VoiceQueue','push','penalty','each','UserVoiceQueueRt','upsert','remove','Queues','Queue:remove','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','List','Tag','Tags','tag','hasOwnProperty','getContacts','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','findOne','ChatGroup','getRecordings','VoiceRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','login','phone','mobile','loginInPause','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','remoteAddress','socket','connection','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','device','PAUSE','LOGININPAUSE','logout','pause','QueuePause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','mail','fax','sms','openchannel','%s%s','manual','getTeams','Team','addTeams','removeTeams','getLists','CmList','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','concat'];(function(_0x327cea,_0x373ccb){var _0x34b10c=function(_0xd7587){while(--_0xd7587){_0x327cea['push'](_0x327cea['shift']());}};_0x34b10c(++_0x373ccb);}(_0x71c8,0x165));var _0x871c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x71c8[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x871c('0x0'));var emlformat=require(_0x871c('0x1'));var rimraf=require(_0x871c('0x2'));var zipdir=require(_0x871c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x871c('0x4'));var moment=require(_0x871c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x871c('0x6'));var util=require(_0x871c('0x7'));var path=require('path');var sox=require(_0x871c('0x8'));var csv=require(_0x871c('0x9'));var ejs=require(_0x871c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x871c('0xb'));var jsforce=require(_0x871c('0xc'));var deskjs=require(_0x871c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x871c('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0x871c('0xf'));var Redis=require(_0x871c('0x10'));var qs=require(_0x871c('0x11'));var logger=require(_0x871c('0x12'))(_0x871c('0x13'));var utils=require('../../config/utils');var config=require(_0x871c('0x14'));var db=require(_0x871c('0x15'))['db'];config[_0x871c('0x16')]=_[_0x871c('0x17')](config[_0x871c('0x16')],{'host':_0x871c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x871c('0x19'))[_0x871c('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x871c('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3addf9,_0x59404d,_0x140555,_0x15f9ae){return new BPromise(function(_0x390c72,_0x273e2d){var _0x2d4a32=_0x15f9ae||client;return _0x2d4a32[_0x871c('0x1c')](_0x3addf9,_0x140555)[_0x871c('0x1d')](function(_0x4dc979){logger[_0x871c('0x1e')](_0x871c('0x1f'),_0x59404d,_0x871c('0x20'));logger['debug'](_0x871c('0x21'),_0x59404d,_0x871c('0x20'),JSON[_0x871c('0x22')](_0x4dc979));if(_0x4dc979[_0x871c('0x23')]){if(_0x4dc979[_0x871c('0x23')][_0x871c('0x24')]===0x1f4){logger['error'](_0x871c('0x1f'),_0x59404d,_0x4dc979[_0x871c('0x23')][_0x871c('0x25')]);return _0x273e2d(_0x4dc979['error'][_0x871c('0x25')]);}logger[_0x871c('0x23')](_0x871c('0x1f'),_0x59404d,_0x4dc979[_0x871c('0x23')][_0x871c('0x25')]);return _0x390c72(_0x4dc979[_0x871c('0x23')][_0x871c('0x25')]);}else{logger[_0x871c('0x1e')](_0x871c('0x1f'),_0x59404d,_0x871c('0x20'));_0x390c72(_0x4dc979[_0x871c('0x26')]['message']);}})[_0x871c('0x27')](function(_0x2b7549){logger['error'](_0x871c('0x1f'),_0x59404d,_0x2b7549);_0x273e2d(_0x2b7549);});});}function respondWithStatusCode(_0x1cac77,_0x412538){_0x412538=_0x412538||0xcc;return function(_0x259d87){if(_0x259d87){return _0x1cac77[_0x871c('0x28')](_0x412538);}return _0x1cac77['status'](_0x412538)[_0x871c('0x29')]();};}function respondWithResult(_0x505d35,_0x2c6496){_0x2c6496=_0x2c6496||0xc8;return function(_0x3ee87d){if(_0x3ee87d){return _0x505d35['status'](_0x2c6496)[_0x871c('0x2a')](_0x3ee87d);}};}function respondWithFilteredResult(_0x388358,_0x505254){return function(_0x2a196e){if(_0x2a196e){var _0x3067b2=_0x2a196e[_0x871c('0x2b')],_0x253239=_0x505254[_0x871c('0x2c')],_0x2614cf=_0x505254[_0x871c('0x2c')]+_0x505254[_0x871c('0x2d')],_0x2bde49;if(_0x2614cf>=_0x3067b2){_0x2614cf=_0x3067b2;_0x2bde49=0xc8;}else{_0x2bde49=0xce;}_0x388358[_0x871c('0x2e')](_0x2bde49);return _0x388358['set'](_0x871c('0x2f'),_0x253239+'-'+_0x2614cf+'/'+_0x3067b2)['json'](_0x2a196e);}return null;};}function patchUpdates(_0x4c2884){return function(_0x30b539){try{jsonpatch[_0x871c('0x30')](_0x30b539,_0x4c2884,!![]);}catch(_0xb3aa4b){return BPromise[_0x871c('0x31')](_0xb3aa4b);}return _0x30b539[_0x871c('0x32')]();};}function saveUpdates(_0x3d5844,_0x47b69c){return function(_0x4f18be){if(_0x4f18be){return _0x4f18be[_0x871c('0x33')](_0x3d5844)[_0x871c('0x1d')](function(_0x18001f){return _0x18001f;});}return null;};}function removeEntity(_0xb8b8f7,_0x2a21e0){return function(_0x5c5b93){if(_0x5c5b93){return _0x5c5b93[_0x871c('0x34')]()['then'](function(){var _0x30776b=_0x5c5b93['get']({'plain':!![]});var _0x1c8da5=[{'name':'Users','value':'user','ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':_0x871c('0x35'),'value':_0x871c('0x36'),'ignore':![]}];var _0x3d8cbc=_(_0x1c8da5)[_0x871c('0x37')]('ignore')[_0x871c('0x38')](_0x871c('0x39'))['value']();if(_[_0x871c('0x3a')](_0x3d8cbc,_0x30776b['role'])){return;}var _0x2b634b=_['find'](_0x1c8da5,[_0x871c('0x39'),_0x30776b[_0x871c('0x3b')]])[_0x871c('0x3c')];return db['UserProfileResource'][_0x871c('0x34')]({'where':{'type':_0x2b634b,'resourceId':_0x30776b['id']}})['then'](function(){return _0x5c5b93;});})[_0x871c('0x1d')](function(){_0xb8b8f7[_0x871c('0x2e')](0xcc)[_0x871c('0x29')]();});}};}function handleEntityNotFound(_0x2e84fb,_0x4617ca){return function(_0x483e41){if(!_0x483e41){_0x2e84fb[_0x871c('0x28')](0x194);}return _0x483e41;};}function handleError(_0x336131,_0x26af4e){_0x26af4e=_0x26af4e||0x1f4;return function(_0x44e24e){logger[_0x871c('0x23')](_0x44e24e[_0x871c('0x3d')]);if(_0x44e24e['name']){delete _0x44e24e[_0x871c('0x3c')];}_0x336131[_0x871c('0x2e')](_0x26af4e)[_0x871c('0x3e')](_0x44e24e);};}exports['index']=function(_0xf35f60,_0x857254){var _0x4f1258={},_0x41ac94={},_0x5061ba={'count':0x0,'rows':[]};var _0x42d21c=db[_0x871c('0x3f')]['rawAttributes'];_0x41ac94[_0x871c('0x40')]=_['differenceBy'](_[_0x871c('0x41')](_0x42d21c),['password',_0x871c('0x42')]);_0x41ac94[_0x871c('0x43')]=_['keys'](_0xf35f60['query']);_0x41ac94[_0x871c('0x44')]=_[_0x871c('0x45')](_0x41ac94[_0x871c('0x40')],_0x41ac94[_0x871c('0x43')]);_0x4f1258[_0x871c('0x46')]=_['intersection'](_0x41ac94[_0x871c('0x40')],qs[_0x871c('0x47')](_0xf35f60[_0x871c('0x43')][_0x871c('0x47')]));_0x4f1258['attributes']=_0x4f1258[_0x871c('0x46')][_0x871c('0x48')]?_0x4f1258['attributes']:_0x41ac94[_0x871c('0x40')];if(!_0xf35f60[_0x871c('0x43')]['hasOwnProperty'](_0x871c('0x49'))){_0x4f1258[_0x871c('0x2d')]=qs[_0x871c('0x2d')](_0xf35f60[_0x871c('0x43')][_0x871c('0x2d')]);_0x4f1258[_0x871c('0x2c')]=qs['offset'](_0xf35f60[_0x871c('0x43')]['offset']);}_0x4f1258[_0x871c('0x4a')]=qs[_0x871c('0x4b')](_0xf35f60[_0x871c('0x43')][_0x871c('0x4b')]);_0x4f1258[_0x871c('0x4c')]=qs[_0x871c('0x44')](_[_0x871c('0x4d')](_0xf35f60[_0x871c('0x43')],_0x41ac94[_0x871c('0x44')]));if(_0xf35f60['query'][_0x871c('0x37')]){_0x4f1258[_0x871c('0x4c')]=_[_0x871c('0x4e')](_0x4f1258[_0x871c('0x4c')],{'$or':_[_0x871c('0x38')](_0x42d21c,function(_0xa60cc1){return db[_0x871c('0x4f')][_0x871c('0x4c')](db['sequelize']['fn'](_0x871c('0x50'),db[_0x871c('0x4f')][_0x871c('0x51')](_0xa60cc1['field'])),{'$like':db[_0x871c('0x4f')]['fn'](_0x871c('0x50'),'%'+_0xf35f60['query'][_0x871c('0x37')]+'%')});})});}_0x4f1258=_[_0x871c('0x4e')]({},_0x4f1258,_0xf35f60[_0x871c('0x52')]);var _0x56f8fa={'where':_0x4f1258[_0x871c('0x4c')]};return db[_0x871c('0x3f')][_0x871c('0x2b')](_0x56f8fa)[_0x871c('0x1d')](function(_0x19bc2e){_0x5061ba['count']=_0x19bc2e;if(_0xf35f60[_0x871c('0x43')][_0x871c('0x53')]){_0x4f1258[_0x871c('0x54')]=[{'all':!![]}];}return db[_0x871c('0x3f')][_0x871c('0x55')](_0x4f1258);})[_0x871c('0x1d')](function(_0x452946){_0x5061ba[_0x871c('0x56')]=_0x452946;return _0x5061ba;})[_0x871c('0x1d')](respondWithFilteredResult(_0x857254,_0x4f1258))[_0x871c('0x27')](handleError(_0x857254,null));};exports['show']=function(_0x582156,_0x4f1095){var _0x4007e1={'raw':![],'where':{'id':_0x582156[_0x871c('0x57')]['id']}},_0x4a179a={};_0x4a179a[_0x871c('0x40')]=_[_0x871c('0x58')](_['keys'](db[_0x871c('0x3f')][_0x871c('0x59')]),[_0x871c('0x5a'),_0x871c('0x42')]);_0x4a179a[_0x871c('0x43')]=_['keys'](_0x582156['query']);_0x4a179a[_0x871c('0x44')]=_[_0x871c('0x45')](_0x4a179a['model'],_0x4a179a[_0x871c('0x43')]);_0x4007e1['attributes']=_['intersection'](_0x4a179a['model'],qs[_0x871c('0x47')](_0x582156[_0x871c('0x43')]['fields']));_0x4007e1['attributes']=_0x4007e1['attributes']['length']?_0x4007e1[_0x871c('0x46')]:_0x4a179a['model'];if(_0x582156[_0x871c('0x43')][_0x871c('0x53')]){_0x4007e1['include']=[{'all':!![]}];}_0x4007e1=_[_0x871c('0x4e')]({},_0x4007e1,_0x582156['options']);return db[_0x871c('0x3f')][_0x871c('0x5b')](_0x4007e1)[_0x871c('0x1d')](handleEntityNotFound(_0x4f1095,null))[_0x871c('0x1d')](respondWithResult(_0x4f1095,null))[_0x871c('0x27')](handleError(_0x4f1095,null));};exports[_0x871c('0x5c')]=function(_0x4c7120,_0x6cca2d){return db[_0x871c('0x3f')][_0x871c('0x5c')](_0x4c7120['body'],{'raw':![],'individualHooks':!![]})[_0x871c('0x1d')](respondWithResult(_0x6cca2d,0xc9))['catch'](handleError(_0x6cca2d,null));};exports[_0x871c('0x33')]=function(_0x1fb58b,_0x16aa8c){if(_0x1fb58b[_0x871c('0x5d')]['id']){delete _0x1fb58b[_0x871c('0x5d')]['id'];}return db['User'][_0x871c('0x5b')]({'where':{'id':_0x1fb58b[_0x871c('0x57')]['id']}})[_0x871c('0x1d')](handleEntityNotFound(_0x16aa8c,null))[_0x871c('0x1d')](saveUpdates(_0x1fb58b[_0x871c('0x5d')],null))[_0x871c('0x1d')](respondWithResult(_0x16aa8c,null))['catch'](handleError(_0x16aa8c,null));};exports[_0x871c('0x5e')]=function(_0x306a05,_0x53131b){return db[_0x871c('0x3f')]['describe']()['then'](respondWithResult(_0x53131b,null))[_0x871c('0x27')](handleError(_0x53131b,null));};exports[_0x871c('0x5f')]=function(_0x4593f1,_0x466eb3,_0x573c10){return db['User'][_0x871c('0x5b')]({'where':{'id':_0x4593f1[_0x871c('0x57')]['id']}})[_0x871c('0x1d')](handleEntityNotFound(_0x466eb3,null))[_0x871c('0x1d')](function(_0x3f96bd){if(_0x3f96bd){return _0x3f96bd[_0x871c('0x5f')](_0x4593f1[_0x871c('0x5d')][_0x871c('0x60')],_[_0x871c('0x61')](_0x4593f1[_0x871c('0x5d')],[_0x871c('0x60'),'id'])||{});}})[_0x871c('0x1d')](respondWithResult(_0x466eb3,null))[_0x871c('0x27')](handleError(_0x466eb3,null));};var getLicense=function(_0x4736ae){return new BPromise(function(_0x440048,_0x2e973a){var _0x5d4a80=0x0;_0x4736ae['body']['role']===_0x871c('0x62')&&_0x440048(_0x871c('0x63'));return db[_0x871c('0x3f')]['count']({'where':{'$or':[{'role':_0x4736ae['body'][_0x871c('0x3b')]===_0x871c('0x36')?_0x871c('0x36'):['admin','user']}]}})['then'](function(_0xb7d5c7){_0x5d4a80=_0xb7d5c7;return require(_0x871c('0x64'))[_0x871c('0x65')]();})[_0x871c('0x1d')](function(_0xd06acf){var _0x35c539=_0x4736ae[_0x871c('0x5d')][_0x871c('0x3b')]==='telephone'?'telephones':_0x871c('0x66');if(!_['isNil'](_0xd06acf[_0x35c539])&&_0x5d4a80>=_0xd06acf[_0x35c539]){return _0x2e973a({'message':_0x871c('0x67')});}return _0x440048(util[_0x871c('0x68')]('count\x20%s:\x20%s',_0x35c539,_0x5d4a80));})['catch'](function(_0x34a34b){return _0x2e973a(_0x34a34b);});});};exports[_0x871c('0x69')]=function(_0x476f8f,_0x1d1dd7){return getLicense(_0x476f8f)[_0x871c('0x1d')](function(_0x6083f2){if(!_0x476f8f[_0x871c('0x5d')][_0x871c('0x6a')]){var _0x42548c;return db[_0x871c('0x6b')][_0x871c('0x6c')](0x1)[_0x871c('0x1d')](function(_0x30b6e0){_0x42548c=_0x30b6e0[_0x871c('0x6d')];return db[_0x871c('0x3f')][_0x871c('0x6e')](_0x871c('0x6a'));})[_0x871c('0x1d')](function(_0x49a450){if(_[_0x871c('0x6f')](_0x49a450)){if(_0x42548c){_0x476f8f[_0x871c('0x5d')][_0x871c('0x6a')]=_0x42548c;}else{_0x476f8f[_0x871c('0x5d')][_0x871c('0x6a')]=0x1;}}else{if(_[_0x871c('0x6f')](_0x42548c)||_0x42548c==_0x49a450){_0x476f8f[_0x871c('0x5d')][_0x871c('0x6a')]=_0x49a450+0x1;}else if(_0x42548c>_0x49a450){_0x476f8f['body'][_0x871c('0x6a')]=_0x42548c;}else{return db[_0x871c('0x4f')][_0x871c('0x43')](_0x871c('0x70'),{'type':db[_0x871c('0x4f')][_0x871c('0x71')]['SELECT']})[_0x871c('0x1d')](function(_0x2b459d){if(_0x2b459d&&_0x2b459d[_0x871c('0x48')]){for(var _0x127a3d=0x0,_0x1bc20d=_0x2b459d[_0x871c('0x48')];_0x127a3d<_0x1bc20d&&_['isNil'](_0x476f8f['body'][_0x871c('0x6a')]);_0x127a3d++){if(_0x42548c<=_0x2b459d[_0x127a3d][_0x871c('0x72')]){_0x476f8f[_0x871c('0x5d')]['internal']=_0x2b459d[_0x127a3d]['from'];}else if(_0x42548c>_0x2b459d[_0x127a3d]['from']&&_0x42548c<=_0x2b459d[_0x127a3d]['to']){_0x476f8f['body'][_0x871c('0x6a')]=_0x42548c;}}}if(_[_0x871c('0x6f')](_0x476f8f['body'][_0x871c('0x6a')])){_0x476f8f[_0x871c('0x5d')]['internal']=_0x49a450+0x1;}});}}});}})['then'](function(){if(_0x476f8f[_0x871c('0x5d')]['voicemail']){_0x476f8f[_0x871c('0x5d')]['mailbox']=_0x476f8f[_0x871c('0x5d')]['internal'];_0x476f8f[_0x871c('0x5d')]['VoiceMail']={'mailbox':_0x476f8f[_0x871c('0x5d')][_0x871c('0x6a')],'password':_0x476f8f['body']['password'],'fullname':_0x476f8f[_0x871c('0x5d')][_0x871c('0x73')],'email':_0x476f8f['body'][_0x871c('0x74')]};}if(_0x476f8f[_0x871c('0x5d')]&&_0x476f8f[_0x871c('0x5d')]['role']===_0x871c('0x62')){_0x476f8f['body'][_0x871c('0x75')]=[_0x871c('0x76'),_0x871c('0x77'),'103',_0x871c('0x78'),_0x871c('0x79'),_0x871c('0x7a'),_0x871c('0x7b'),_0x871c('0x7c'),'108',_0x871c('0x7d'),'100','111'];}return db['User']['create'](_0x476f8f[_0x871c('0x5d')],{'include':[{'model':db[_0x871c('0x7e')],'as':_0x871c('0x7e')}]});})[_0x871c('0x1d')](function(_0x87d0af){if(_0x476f8f['body'][_0x871c('0x3b')]===_0x871c('0x7f'))return _0x87d0af;var _0x58162f=_0x476f8f['user'][_0x871c('0x80')]({'plain':!![]});if(!_0x58162f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58162f[_0x871c('0x3b')]===_0x871c('0x7f')){var _0x16ccd0=_0x87d0af[_0x871c('0x80')]({'plain':!![]});var _0x2de7cb=[{'name':_0x871c('0x81'),'value':_0x871c('0x62')},{'name':'Telephones','value':'telephone'}];var _0x5e5f6a=_[_0x871c('0x5b')](_0x2de7cb,[_0x871c('0x39'),_0x16ccd0[_0x871c('0x3b')]])[_0x871c('0x3c')];return db[_0x871c('0x82')][_0x871c('0x5b')]({'where':{'name':_0x5e5f6a,'userProfileId':_0x58162f[_0x871c('0x83')]},'raw':!![]})[_0x871c('0x1d')](function(_0xc5911f){if(_0xc5911f&&_0xc5911f[_0x871c('0x84')]===0x0){return db[_0x871c('0x85')][_0x871c('0x69')]({'name':_0x16ccd0[_0x871c('0x3c')],'resourceId':_0x16ccd0['id'],'type':_0xc5911f['name'],'sectionId':_0xc5911f['id']},{})[_0x871c('0x1d')](function(){return _0x87d0af;});}else{return _0x87d0af;}})[_0x871c('0x27')](function(_0x995aac){logger[_0x871c('0x23')](_0x871c('0x86'),_0x995aac);throw _0x995aac;});}return _0x87d0af;})[_0x871c('0x1d')](respondWithResult(_0x1d1dd7,0xc9))['catch'](handleError(_0x1d1dd7,null));};exports[_0x871c('0x87')]=function(_0x262f0e,_0x32ffa9,_0x226d35){if(_0x262f0e[_0x871c('0x5d')]['id']){delete _0x262f0e[_0x871c('0x5d')]['id'];}return db[_0x871c('0x3f')][_0x871c('0x5b')]({'where':{'id':_0x262f0e[_0x871c('0x57')]['id']}})[_0x871c('0x1d')](function(_0x35bc9a){if(_0x35bc9a){if(_0x35bc9a['id']==_0x262f0e['user']['id']){if(!_0x262f0e[_0x871c('0x5d')]['oldPassword']||!_0x262f0e['body'][_0x871c('0x88')]){throw new db[(_0x871c('0x89'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x35bc9a[_0x871c('0x8a')](_0x262f0e[_0x871c('0x5d')]['oldPassword'])){throw new db['Sequelize'][(_0x871c('0x8b'))](_0x871c('0x8c'));}if(_0x262f0e[_0x871c('0x5d')]['oldPassword']==_0x262f0e[_0x871c('0x5d')]['newPassword']){throw new db['Sequelize'][(_0x871c('0x8b'))](_0x871c('0x8d'));}return _0x35bc9a;}else if(_0x262f0e['user'][_0x871c('0x3b')]==_0x871c('0x8e')){if(!_0x262f0e[_0x871c('0x5d')][_0x871c('0x88')]){throw new db[(_0x871c('0x89'))][(_0x871c('0x8b'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x35bc9a;}else if(_0x262f0e[_0x871c('0x7f')]['role']=='user'){if(!_0x262f0e['body'][_0x871c('0x88')]){throw new db[(_0x871c('0x89'))][(_0x871c('0x8b'))](_0x871c('0x8f'));}if(_0x35bc9a['role']!=_0x871c('0x62')){throw new db[(_0x871c('0x89'))][(_0x871c('0x8b'))](_0x871c('0x90'));}return _0x35bc9a;}else{throw new db[(_0x871c('0x89'))][(_0x871c('0x8b'))](_0x871c('0x90'));}}return null;})[_0x871c('0x1d')](handleEntityNotFound(_0x32ffa9,null))[_0x871c('0x1d')](saveUpdates({'password':_0x262f0e['body'][_0x871c('0x88')],'passwordResetAt':_0x262f0e[_0x871c('0x7f')]['id']==_0x262f0e['params']['id']?moment():null},null))[_0x871c('0x1d')](respondWithResult(_0x32ffa9,null))[_0x871c('0x27')](handleError(_0x32ffa9,null));};exports[_0x871c('0x91')]=function(_0x5b20b3,_0x5a457e,_0x28ac72){var _0x2b566a;return db[_0x871c('0x3f')]['find']({'where':{'id':_0x5b20b3['params']['id']},'attributes':['id',_0x871c('0x3c'),_0x871c('0x3b'),'loginInPause',_0x871c('0x92'),_0x871c('0x93')]})[_0x871c('0x1d')](handleEntityNotFound(_0x5a457e,null))[_0x871c('0x1d')](function(_0x47612c){if(_0x47612c){_0x2b566a=_0x47612c;if(!utils[_0x871c('0x94')](_0x5b20b3[_0x871c('0x5d')][_0x871c('0x95')])){throw new db[(_0x871c('0x89'))]['ValidationError'](_0x871c('0x96'));}return _0x47612c[_0x871c('0x97')+_['capitalize'](_0x5b20b3[_0x871c('0x5d')][_0x871c('0x95')][_0x871c('0x98')]())+'Queues'](_0x5b20b3[_0x871c('0x5d')][_0x871c('0x60')],{'penalty':_0x5b20b3[_0x871c('0x5d')]['penalty']||0x0});}})[_0x871c('0x99')](function(_0x5d059a){for(var _0x3b94b6=0x0;_0x3b94b6<_0x5b20b3[_0x871c('0x5d')][_0x871c('0x60')][_0x871c('0x48')];_0x3b94b6+=0x1){var _0x4b0ffa={'UserId':_0x5b20b3['params']['id']};_0x4b0ffa[_[_0x871c('0x9a')](_0x5b20b3[_0x871c('0x5d')][_0x871c('0x95')][_0x871c('0x98')]())+_0x871c('0x9b')]=_0x5b20b3[_0x871c('0x5d')][_0x871c('0x60')][_0x3b94b6];socket[_0x871c('0x9c')](_0x871c('0x7f')+_['capitalize'](_0x5b20b3[_0x871c('0x5d')]['channel'][_0x871c('0x98')]())+_0x871c('0x9d'),_0x4b0ffa);}return _0x5d059a;})[_0x871c('0x1d')](function(){if(_0x5b20b3[_0x871c('0x5d')][_0x871c('0x95')]===_0x871c('0x9e')){return db[_0x871c('0x9f')]['findAll']({'where':{'id':_0x5b20b3['body'][_0x871c('0x60')]||[]},'raw':!![],'attributes':['id',_0x871c('0x3c')]});}})['then'](function(_0x29f7fb){var _0x1e0750=[];if(_0x5b20b3[_0x871c('0x5d')]['channel']===_0x871c('0x9e')&&_0x2b566a[_0x871c('0x3b')]===_0x871c('0x62')){for(var _0x1615e3=0x0;_0x1615e3<_0x29f7fb['length'];_0x1615e3+=0x1){_0x1e0750[_0x871c('0xa0')]({'membername':_0x2b566a[_0x871c('0x3c')],'UserId':_0x2b566a['id'],'queue_name':_0x29f7fb[_0x1615e3][_0x871c('0x3c')],'VoiceQueueId':_0x29f7fb[_0x1615e3]['id'],'interface':_['isNil'](_0x2b566a[_0x871c('0x93')])?util[_0x871c('0x68')]('SIP/%s',_0x2b566a[_0x871c('0x3c')]):_0x2b566a[_0x871c('0x93')],'paused':_0x2b566a[_0x871c('0x92')]||![],'penalty':_0x5b20b3[_0x871c('0x5d')][_0x871c('0xa1')]||0x0});}return BPromise[_0x871c('0xa2')](_0x1e0750,function(_0xf99de){return db[_0x871c('0xa3')][_0x871c('0xa4')](_0xf99de);});}return _0x2b566a;})[_0x871c('0x1d')](respondWithStatusCode(_0x5a457e,null))[_0x871c('0x27')](handleError(_0x5a457e,null));};exports['removeQueues']=function(_0x2f0886,_0x4467e1,_0x59210b){var _0x3224b5;return db[_0x871c('0x3f')]['find']({'where':{'id':_0x2f0886[_0x871c('0x57')]['id']},'attributes':['id',_0x871c('0x3c'),_0x871c('0x3b')]})[_0x871c('0x1d')](handleEntityNotFound(_0x4467e1,null))[_0x871c('0x1d')](function(_0x4aa5c8){if(_0x4aa5c8){_0x3224b5=_0x4aa5c8;if(!_0x2f0886[_0x871c('0x43')][_0x871c('0x95')]||!utils[_0x871c('0x94')](_0x2f0886['query']['channel'])){throw new db[(_0x871c('0x89'))][(_0x871c('0x8b'))](_0x871c('0x96'));}return _0x4aa5c8[_0x871c('0xa5')+_[_0x871c('0x9a')](_0x2f0886[_0x871c('0x43')][_0x871c('0x95')][_0x871c('0x98')]())+_0x871c('0xa6')](_0x2f0886[_0x871c('0x43')]['ids']);}})['then'](function(_0x14f96a){for(var _0x49a7e2=0x0;_0x49a7e2<_0x2f0886[_0x871c('0x43')]['ids'][_0x871c('0x48')];_0x49a7e2+=0x1){var _0x124380={'UserId':_0x2f0886['params']['id']};_0x124380[_[_0x871c('0x9a')](_0x2f0886[_0x871c('0x43')]['channel']['toLowerCase']())+_0x871c('0x9b')]=_0x2f0886[_0x871c('0x43')][_0x871c('0x60')][_0x49a7e2];socket[_0x871c('0x9c')](_0x871c('0x7f')+_[_0x871c('0x9a')](_0x2f0886[_0x871c('0x43')][_0x871c('0x95')][_0x871c('0x98')]())+_0x871c('0xa7'),_0x124380);}return _0x14f96a;})[_0x871c('0x1d')](function(){if(_0x2f0886[_0x871c('0x43')]['channel']==='voice'){return db[_0x871c('0xa3')][_0x871c('0x34')]({'where':{'UserId':_0x2f0886[_0x871c('0x57')]['id'],'VoiceQueueId':_0x2f0886[_0x871c('0x43')][_0x871c('0x60')]},'individualHooks':!![]})[_0x871c('0x1d')](function(){return _0x3224b5;});}return _0x3224b5;})['then'](respondWithStatusCode(_0x4467e1,null))[_0x871c('0x27')](handleError(_0x4467e1,null));};exports['addAvatar']=function(_0x482aa8,_0x279a82,_0x502d2a){_0x482aa8[_0x871c('0x5d')][_0x871c('0xa8')]=_0x482aa8[_0x871c('0xa9')][_0x871c('0xaa')];return db['User'][_0x871c('0x5b')]({'where':{'id':_0x482aa8[_0x871c('0x57')]['id']}})[_0x871c('0x1d')](handleEntityNotFound(_0x279a82,null))[_0x871c('0x1d')](saveUpdates(_0x482aa8[_0x871c('0x5d')],null))[_0x871c('0x1d')](respondWithResult(_0x279a82,null))[_0x871c('0x27')](handleError(_0x279a82,null));};exports[_0x871c('0xab')]=function(_0x67368,_0x2e9e18,_0x52c942){var _0x233515=path[_0x871c('0xac')](config[_0x871c('0xad')],_0x871c('0xae'));return db['User'][_0x871c('0x5b')]({'where':{'id':_0x67368[_0x871c('0x57')]['id']},'attributes':['id',_0x871c('0xa8')],'raw':!![]})[_0x871c('0x1d')](handleEntityNotFound(_0x2e9e18,null))[_0x871c('0x1d')](function(_0x2facd5){if(_0x2facd5){if(_['isNil'](_0x2facd5['userpic'])){return _0x2e9e18[_0x871c('0xaf')](_0x233515);}else{if(!fs[_0x871c('0xb0')](path[_0x871c('0xac')](config['root'],_0x871c('0xb1'),_0x2facd5[_0x871c('0xa8')]))){return _0x2e9e18[_0x871c('0xaf')](_0x233515);}return _0x2e9e18[_0x871c('0xaf')](path[_0x871c('0xac')](config[_0x871c('0xad')],'server/files/images/',_0x2facd5[_0x871c('0xa8')]));}}})['catch'](handleError(_0x2e9e18,null));};exports['getContacts']=function(_0x4281cf,_0x5df7dd,_0x4af012){var _0x2a9b67={};var _0x35dea9={};var _0x5b6a34;var _0x500aea;return db['User']['findOne']({'where':{'id':_0x4281cf[_0x871c('0x57')]['id']}})['then'](handleEntityNotFound(_0x5df7dd,null))['then'](function(_0xd28ff3){if(_0xd28ff3){_0x5b6a34=_0xd28ff3;_0x35dea9['model']=_['keys'](db['CmContact'][_0x871c('0x59')]);_0x35dea9[_0x871c('0x43')]=_[_0x871c('0x41')](_0x4281cf[_0x871c('0x43')]);_0x35dea9[_0x871c('0x44')]=_[_0x871c('0x45')](_0x35dea9['model'],_0x35dea9[_0x871c('0x43')]);_0x2a9b67[_0x871c('0x46')]=_[_0x871c('0x45')](_0x35dea9[_0x871c('0x40')],qs[_0x871c('0x47')](_0x4281cf['query']['fields']));_0x2a9b67[_0x871c('0x46')]=_0x2a9b67[_0x871c('0x46')][_0x871c('0x48')]?_0x2a9b67[_0x871c('0x46')]:_0x35dea9['model'];_0x2a9b67[_0x871c('0x4a')]=qs['sort'](_0x4281cf[_0x871c('0x43')][_0x871c('0x4b')]);_0x2a9b67[_0x871c('0x4c')]=qs['filters'](_[_0x871c('0x4d')](_0x4281cf[_0x871c('0x43')],_0x35dea9[_0x871c('0x44')]));if(_0x4281cf[_0x871c('0x43')][_0x871c('0x37')]){_0x2a9b67['where']=_[_0x871c('0x4e')](_0x2a9b67[_0x871c('0x4c')],{'$or':_[_0x871c('0x38')](_0x2a9b67['attributes'],function(_0x478973){var _0x1507c9={};_0x1507c9[_0x478973]={'$like':'%'+_0x4281cf['query']['filter']+'%'};return _0x1507c9;})});}_0x2a9b67=_['merge']({},_0x2a9b67,_0x4281cf[_0x871c('0x52')]);return _0x5b6a34['getContacts'](_0x2a9b67);}})[_0x871c('0x1d')](function(_0x2ae3b8){if(_0x2ae3b8){_0x500aea=_0x2ae3b8[_0x871c('0x48')];if(_0x4281cf['query']['hasOwnProperty'](_0x871c('0x53'))){_0x2a9b67[_0x871c('0x54')]=[{'model':db['CmList'],'as':_0x871c('0xb2'),'required':![]},{'model':db[_0x871c('0xb3')],'as':_0x871c('0xb4'),'attributes':['id',_0x871c('0x3c'),'color'],'where':_0x4281cf[_0x871c('0x43')][_0x871c('0xb5')]?{'id':_0x4281cf[_0x871c('0x43')][_0x871c('0xb5')]}:undefined,'required':_0x4281cf['query'][_0x871c('0xb5')]?!![]:![]}];}if(!_0x4281cf['query'][_0x871c('0xb6')](_0x871c('0x49'))){_0x2a9b67[_0x871c('0x2d')]=qs[_0x871c('0x2d')](_0x4281cf[_0x871c('0x43')][_0x871c('0x2d')]);_0x2a9b67[_0x871c('0x2c')]=qs[_0x871c('0x2c')](_0x4281cf[_0x871c('0x43')][_0x871c('0x2c')]);}return _0x5b6a34[_0x871c('0xb7')](_0x2a9b67);}})[_0x871c('0x1d')](function(_0x5b7fa3){if(_0x5b7fa3){return _0x5b7fa3?{'count':_0x500aea,'rows':_0x5b7fa3}:null;}})[_0x871c('0x1d')](respondWithResult(_0x5df7dd,null))['catch'](handleError(_0x5df7dd,null));};exports['getQueues']=function(_0x1ff54f,_0x4ff8e0,_0x16b781){var _0x26cc5b;var _0x25f611;var _0x5ca9d3={};var _0x40e881;return db[_0x871c('0x3f')]['findOne']({'where':{'id':_0x1ff54f[_0x871c('0x57')]['id']},'attributes':['id',_0x871c('0x3c'),_0x871c('0x3b')]})[_0x871c('0x1d')](handleEntityNotFound(_0x4ff8e0,null))[_0x871c('0x1d')](function(_0x1c8d13){if(!utils['isValidChannel'](_0x1ff54f[_0x871c('0x43')]['channel'])){throw new db[(_0x871c('0x89'))][(_0x871c('0x8b'))]('Unknown\x20channel');}_0x26cc5b=_0x1c8d13;var _0x1fdc80={};_0x1fdc80[_0x871c('0x40')]=_[_0x871c('0x41')](db[_[_0x871c('0x9a')](_0x1ff54f[_0x871c('0x43')]['channel'])+_0x871c('0xb8')][_0x871c('0x59')]);_0x1fdc80[_0x871c('0x43')]=_[_0x871c('0x41')](_0x1ff54f[_0x871c('0x43')]);_0x1fdc80['filters']=_[_0x871c('0x45')](_0x1fdc80[_0x871c('0x40')],_0x1fdc80[_0x871c('0x43')]);_0x5ca9d3[_0x871c('0x46')]=_[_0x871c('0x45')](_0x1fdc80[_0x871c('0x40')],qs[_0x871c('0x47')](_0x1ff54f[_0x871c('0x43')]['fields']));_0x5ca9d3['attributes']=_0x5ca9d3[_0x871c('0x46')][_0x871c('0x48')]?_0x5ca9d3[_0x871c('0x46')]:_0x1fdc80['model'];_0x5ca9d3[_0x871c('0x4a')]=qs[_0x871c('0x4b')](_0x1ff54f[_0x871c('0x43')]['sort']);_0x5ca9d3[_0x871c('0x4c')]=qs[_0x871c('0x44')](_['pick'](_0x1ff54f[_0x871c('0x43')],_0x1fdc80[_0x871c('0x44')]));if(_0x1ff54f[_0x871c('0x43')][_0x871c('0x37')]){_0x5ca9d3[_0x871c('0x4c')]=_[_0x871c('0x4e')](_0x5ca9d3[_0x871c('0x4c')],{'$or':_['map'](_0x5ca9d3[_0x871c('0x46')],function(_0x271e47){var _0x399e72={};_0x399e72[_0x271e47]={'$like':'%'+_0x1ff54f['query'][_0x871c('0x37')]+'%'};return _0x399e72;})});}_0x5ca9d3=_['merge']({},_0x5ca9d3,_0x1ff54f['options']);switch(_0x26cc5b[_0x871c('0x3b')]){case _0x871c('0x8e'):return db[_[_0x871c('0x9a')](_0x1ff54f[_0x871c('0x43')][_0x871c('0x95')])+_0x871c('0xb8')][_0x871c('0x55')](_0x5ca9d3);case _0x871c('0x7f'):case _0x871c('0x62'):return _0x26cc5b[_0x871c('0x80')+_[_0x871c('0x9a')](_0x1ff54f[_0x871c('0x43')][_0x871c('0x95')])+_0x871c('0xa6')](_0x5ca9d3);default:throw new db[(_0x871c('0x89'))][(_0x871c('0x8b'))](_0x871c('0xb9'));}})[_0x871c('0x1d')](function(_0x9b7342){_0x40e881=_0x9b7342[_0x871c('0x48')];if(!_0x1ff54f[_0x871c('0x43')][_0x871c('0xb6')]('nolimit')){_0x5ca9d3[_0x871c('0x2d')]=qs['limit'](_0x1ff54f['query']['limit']);_0x5ca9d3['offset']=qs[_0x871c('0x2c')](_0x1ff54f[_0x871c('0x43')][_0x871c('0x2c')]);}switch(_0x26cc5b[_0x871c('0x3b')]){case _0x871c('0x8e'):return db[_['capitalize'](_0x1ff54f[_0x871c('0x43')][_0x871c('0x95')])+_0x871c('0xb8')][_0x871c('0x55')](_0x5ca9d3);case _0x871c('0x7f'):case _0x871c('0x62'):return _0x26cc5b[_0x871c('0x80')+_[_0x871c('0x9a')](_0x1ff54f[_0x871c('0x43')]['channel'])+_0x871c('0xa6')](_0x5ca9d3);}})['then'](function(_0x29eb71){return{'count':_0x40e881,'rows':_0x29eb71};})[_0x871c('0x1d')](respondWithResult(_0x4ff8e0,null))['catch'](handleError(_0x4ff8e0,null));};exports[_0x871c('0xba')]=function(_0x59bff4,_0x358ddc,_0x495e5f){var _0x336a43={};var _0xaf10a3={};var _0x54165b;var _0x501349;return db[_0x871c('0x3f')]['findOne']({'where':{'id':_0x59bff4[_0x871c('0x57')]['id']}})[_0x871c('0x1d')](handleEntityNotFound(_0x358ddc,null))[_0x871c('0x1d')](function(_0x1fdf48){if(_0x1fdf48){_0x54165b=_0x1fdf48;_0xaf10a3[_0x871c('0x40')]=_['keys'](db[_0x871c('0xa3')][_0x871c('0x59')]);_0xaf10a3[_0x871c('0x43')]=_[_0x871c('0x41')](_0x59bff4[_0x871c('0x43')]);_0xaf10a3['filters']=_['intersection'](_0xaf10a3[_0x871c('0x40')],_0xaf10a3['query']);_0x336a43['attributes']=_[_0x871c('0x45')](_0xaf10a3[_0x871c('0x40')],qs[_0x871c('0x47')](_0x59bff4['query'][_0x871c('0x47')]));_0x336a43[_0x871c('0x46')]=_0x336a43[_0x871c('0x46')][_0x871c('0x48')]?_0x336a43[_0x871c('0x46')]:_0xaf10a3['model'];_0x336a43[_0x871c('0x4a')]=qs[_0x871c('0x4b')](_0x59bff4[_0x871c('0x43')][_0x871c('0x4b')]);_0x336a43[_0x871c('0x4c')]=qs[_0x871c('0x44')](_[_0x871c('0x4d')](_0x59bff4[_0x871c('0x43')],_0xaf10a3['filters']));if(_0x59bff4[_0x871c('0x43')][_0x871c('0x37')]){_0x336a43[_0x871c('0x4c')]=_['merge'](_0x336a43['where'],{'$or':_[_0x871c('0x38')](_0x336a43[_0x871c('0x46')],function(_0xfa94c2){var _0x17597a={};_0x17597a[_0xfa94c2]={'$like':'%'+_0x59bff4['query'][_0x871c('0x37')]+'%'};return _0x17597a;})});}_0x336a43=_[_0x871c('0x4e')]({},_0x336a43,_0x59bff4[_0x871c('0x52')]);return _0x54165b[_0x871c('0xba')](_0x336a43);}})[_0x871c('0x1d')](function(_0x530c65){if(_0x530c65){_0x501349=_0x530c65['length'];if(!_0x59bff4[_0x871c('0x43')][_0x871c('0xb6')]('nolimit')){_0x336a43[_0x871c('0x2d')]=qs['limit'](_0x59bff4[_0x871c('0x43')]['limit']);_0x336a43[_0x871c('0x2c')]=qs[_0x871c('0x2c')](_0x59bff4[_0x871c('0x43')]['offset']);}return _0x54165b[_0x871c('0xba')](_0x336a43);}})[_0x871c('0x1d')](function(_0x5c1696){if(_0x5c1696){return _0x5c1696?{'count':_0x501349,'rows':_0x5c1696}:null;}})[_0x871c('0x1d')](respondWithResult(_0x358ddc,null))[_0x871c('0x27')](handleError(_0x358ddc,null));};exports[_0x871c('0xbb')]=function(_0x50e540,_0x59fecf,_0x23aaac){var _0x3c81a={};var _0x1f6c8f={};var _0x43af59;var _0xe15ab0;return db[_0x871c('0x3f')][_0x871c('0xbc')]({'where':{'id':_0x50e540[_0x871c('0x57')]['id']}})['then'](handleEntityNotFound(_0x59fecf,null))[_0x871c('0x1d')](function(_0x52461d){if(_0x52461d){_0x43af59=_0x52461d;_0x1f6c8f[_0x871c('0x40')]=_['keys'](db[_0x871c('0xbd')]['rawAttributes']);_0x1f6c8f[_0x871c('0x43')]=_[_0x871c('0x41')](_0x50e540[_0x871c('0x43')]);_0x1f6c8f[_0x871c('0x44')]=_[_0x871c('0x45')](_0x1f6c8f[_0x871c('0x40')],_0x1f6c8f[_0x871c('0x43')]);_0x3c81a[_0x871c('0x46')]=_['intersection'](_0x1f6c8f[_0x871c('0x40')],qs[_0x871c('0x47')](_0x50e540[_0x871c('0x43')]['fields']));_0x3c81a[_0x871c('0x46')]=_0x3c81a[_0x871c('0x46')][_0x871c('0x48')]?_0x3c81a['attributes']:_0x1f6c8f[_0x871c('0x40')];_0x3c81a[_0x871c('0x4a')]=qs[_0x871c('0x4b')](_0x50e540['query'][_0x871c('0x4b')]);_0x3c81a[_0x871c('0x4c')]=qs[_0x871c('0x44')](_['pick'](_0x50e540[_0x871c('0x43')],_0x1f6c8f[_0x871c('0x44')]));if(_0x50e540['query']['filter']){_0x3c81a[_0x871c('0x4c')]=_['merge'](_0x3c81a[_0x871c('0x4c')],{'$or':_[_0x871c('0x38')](_0x3c81a[_0x871c('0x46')],function(_0x3815af){var _0x27a331={};_0x27a331[_0x3815af]={'$like':'%'+_0x50e540[_0x871c('0x43')][_0x871c('0x37')]+'%'};return _0x27a331;})});}_0x3c81a=_[_0x871c('0x4e')]({},_0x3c81a,_0x50e540['options']);return _0x43af59[_0x871c('0xbb')](_0x3c81a);}})[_0x871c('0x1d')](function(_0x5aba80){if(_0x5aba80){_0xe15ab0=_0x5aba80[_0x871c('0x48')];if(!_0x50e540[_0x871c('0x43')]['hasOwnProperty'](_0x871c('0x49'))){_0x3c81a[_0x871c('0x2d')]=qs[_0x871c('0x2d')](_0x50e540[_0x871c('0x43')][_0x871c('0x2d')]);_0x3c81a[_0x871c('0x2c')]=qs[_0x871c('0x2c')](_0x50e540[_0x871c('0x43')][_0x871c('0x2c')]);}return _0x43af59['getGroups'](_0x3c81a);}})[_0x871c('0x1d')](function(_0xfd4ecd){if(_0xfd4ecd){return _0xfd4ecd?{'count':_0xe15ab0,'rows':_0xfd4ecd}:null;}})['then'](respondWithResult(_0x59fecf,null))[_0x871c('0x27')](handleError(_0x59fecf,null));};exports[_0x871c('0xbe')]=function(_0x5d2f37,_0x2c624e,_0x42438e){var _0x19f96d={'raw':!![],'where':{}};var _0x84ddfa={};var _0x3cf2d2={'count':0x0,'rows':[]};return db[_0x871c('0x3f')][_0x871c('0xbc')]({'where':{'id':_0x5d2f37['params']['id']}})[_0x871c('0x1d')](handleEntityNotFound(_0x2c624e,null))['then'](function(_0x17c18e){if(_0x17c18e){_0x84ddfa[_0x871c('0x40')]=_[_0x871c('0x41')](db[_0x871c('0xbf')][_0x871c('0x59')]);_0x84ddfa['query']=_[_0x871c('0x41')](_0x5d2f37['query']);_0x84ddfa[_0x871c('0x44')]=_[_0x871c('0x45')](_0x84ddfa[_0x871c('0x40')],_0x84ddfa[_0x871c('0x43')]);_0x19f96d[_0x871c('0x46')]=_[_0x871c('0x45')](_0x84ddfa[_0x871c('0x40')],qs[_0x871c('0x47')](_0x5d2f37['query']['fields']));_0x19f96d[_0x871c('0x46')]=_0x19f96d['attributes']['length']?_0x19f96d[_0x871c('0x46')]:_0x84ddfa['model'];if(!_0x5d2f37[_0x871c('0x43')][_0x871c('0xb6')]('nolimit')){_0x19f96d[_0x871c('0x2d')]=qs[_0x871c('0x2d')](_0x5d2f37[_0x871c('0x43')]['limit']);_0x19f96d[_0x871c('0x2c')]=qs[_0x871c('0x2c')](_0x5d2f37[_0x871c('0x43')][_0x871c('0x2c')]);}_0x19f96d[_0x871c('0x4a')]=qs[_0x871c('0x4b')](_0x5d2f37['query']['sort']);_0x19f96d[_0x871c('0x4c')]=qs[_0x871c('0x44')](_[_0x871c('0x4d')](_0x5d2f37['query'],_0x84ddfa[_0x871c('0x44')]));_0x19f96d[_0x871c('0x4c')][_0x871c('0xc0')]=_0x17c18e['id'];if(_0x5d2f37['query'][_0x871c('0x37')]){_0x19f96d['where']=_[_0x871c('0x4e')](_0x19f96d['where'],{'$or':_[_0x871c('0x38')](_0x19f96d[_0x871c('0x46')],function(_0x29b159){var _0x367a56={};_0x367a56[_0x29b159]={'$like':'%'+_0x5d2f37['query']['filter']+'%'};return _0x367a56;})});}_0x19f96d=_[_0x871c('0x4e')]({},_0x19f96d,_0x5d2f37[_0x871c('0x52')]);return db['VoiceRecording'][_0x871c('0x2b')]({'where':_0x19f96d[_0x871c('0x4c')]})[_0x871c('0x1d')](function(_0x460984){_0x3cf2d2[_0x871c('0x2b')]=_0x460984;if(_0x5d2f37[_0x871c('0x43')][_0x871c('0x53')]){_0x19f96d['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x871c('0x55')](_0x19f96d);})[_0x871c('0x1d')](function(_0x5e4a55){_0x3cf2d2[_0x871c('0x56')]=_0x5e4a55;return _0x3cf2d2;});}})[_0x871c('0x1d')](respondWithFilteredResult(_0x2c624e,_0x19f96d))[_0x871c('0x27')](handleError(_0x2c624e,null));};exports[_0x871c('0xc1')]=function(_0x3d1aca,_0x1daf13,_0x4709bf){var _0x59d7f8={};var _0x2c79ee={};var _0x309137;var _0x522350;return db[_0x871c('0x3f')][_0x871c('0xbc')]({'where':{'id':_0x3d1aca[_0x871c('0x57')]['id']}})[_0x871c('0x1d')](handleEntityNotFound(_0x1daf13,null))['then'](function(_0x4c911f){if(_0x4c911f){_0x309137=_0x4c911f;_0x2c79ee['model']=_[_0x871c('0x41')](db[_0x871c('0xc2')][_0x871c('0x59')]);_0x2c79ee[_0x871c('0x43')]=_[_0x871c('0x41')](_0x3d1aca[_0x871c('0x43')]);_0x2c79ee['filters']=_[_0x871c('0x45')](_0x2c79ee[_0x871c('0x40')],_0x2c79ee['query']);_0x59d7f8[_0x871c('0x46')]=_[_0x871c('0x45')](_0x2c79ee[_0x871c('0x40')],qs[_0x871c('0x47')](_0x3d1aca[_0x871c('0x43')][_0x871c('0x47')]));_0x59d7f8[_0x871c('0x46')]=_0x59d7f8[_0x871c('0x46')][_0x871c('0x48')]?_0x59d7f8[_0x871c('0x46')]:_0x2c79ee['model'];_0x59d7f8['order']=qs[_0x871c('0x4b')](_0x3d1aca[_0x871c('0x43')][_0x871c('0x4b')]);_0x59d7f8[_0x871c('0x4c')]=qs[_0x871c('0x44')](_[_0x871c('0x4d')](_0x3d1aca[_0x871c('0x43')],_0x2c79ee['filters']));if(_0x3d1aca[_0x871c('0x43')]['filter']){_0x59d7f8[_0x871c('0x4c')]=_[_0x871c('0x4e')](_0x59d7f8[_0x871c('0x4c')],{'$or':_[_0x871c('0x38')](_0x59d7f8[_0x871c('0x46')],function(_0x158156){var _0x7dd34f={};_0x7dd34f[_0x158156]={'$like':'%'+_0x3d1aca['query'][_0x871c('0x37')]+'%'};return _0x7dd34f;})});}_0x59d7f8=_[_0x871c('0x4e')]({},_0x59d7f8,_0x3d1aca['options']);return _0x309137[_0x871c('0xc1')](_0x59d7f8);}})['then'](function(_0x203d85){if(_0x203d85){_0x522350=_0x203d85['length'];if(!_0x3d1aca[_0x871c('0x43')]['hasOwnProperty'](_0x871c('0x49'))){_0x59d7f8[_0x871c('0x2d')]=qs[_0x871c('0x2d')](_0x3d1aca[_0x871c('0x43')][_0x871c('0x2d')]);_0x59d7f8[_0x871c('0x2c')]=qs[_0x871c('0x2c')](_0x3d1aca[_0x871c('0x43')][_0x871c('0x2c')]);}return _0x309137[_0x871c('0xc1')](_0x59d7f8);}})[_0x871c('0x1d')](function(_0x534f5){if(_0x534f5){return _0x534f5?{'count':_0x522350,'rows':_0x534f5}:null;}})['then'](respondWithResult(_0x1daf13,null))[_0x871c('0x27')](handleError(_0x1daf13,null));};exports['getOpenchannelInteractions']=function(_0x5534fc,_0x671674,_0x36eb86){var _0x59e006={};var _0xc24f31={};var _0x27e3bd;var _0x40baf3;return db[_0x871c('0x3f')][_0x871c('0xbc')]({'where':{'id':_0x5534fc['params']['id']}})['then'](handleEntityNotFound(_0x671674,null))[_0x871c('0x1d')](function(_0x129361){if(_0x129361){_0x27e3bd=_0x129361;_0xc24f31['model']=_['keys'](db['OpenchannelInteraction'][_0x871c('0x59')]);_0xc24f31[_0x871c('0x43')]=_['keys'](_0x5534fc['query']);_0xc24f31[_0x871c('0x44')]=_[_0x871c('0x45')](_0xc24f31['model'],_0xc24f31[_0x871c('0x43')]);_0x59e006[_0x871c('0x46')]=_[_0x871c('0x45')](_0xc24f31[_0x871c('0x40')],qs[_0x871c('0x47')](_0x5534fc['query'][_0x871c('0x47')]));_0x59e006[_0x871c('0x46')]=_0x59e006[_0x871c('0x46')][_0x871c('0x48')]?_0x59e006[_0x871c('0x46')]:_0xc24f31[_0x871c('0x40')];_0x59e006[_0x871c('0x4a')]=qs[_0x871c('0x4b')](_0x5534fc[_0x871c('0x43')][_0x871c('0x4b')]);_0x59e006[_0x871c('0x4c')]=qs[_0x871c('0x44')](_['pick'](_0x5534fc['query'],_0xc24f31[_0x871c('0x44')]));if(_0x5534fc[_0x871c('0x43')][_0x871c('0x37')]){_0x59e006[_0x871c('0x4c')]=_[_0x871c('0x4e')](_0x59e006['where'],{'$or':_[_0x871c('0x38')](_0x59e006[_0x871c('0x46')],function(_0xd9cc10){var _0x398d6c={};_0x398d6c[_0xd9cc10]={'$like':'%'+_0x5534fc['query'][_0x871c('0x37')]+'%'};return _0x398d6c;})});}_0x59e006=_['merge']({},_0x59e006,_0x5534fc[_0x871c('0x52')]);return _0x27e3bd[_0x871c('0xc3')](_0x59e006);}})['then'](function(_0x160ca7){if(_0x160ca7){_0x40baf3=_0x160ca7['length'];if(!_0x5534fc[_0x871c('0x43')][_0x871c('0xb6')](_0x871c('0x49'))){_0x59e006[_0x871c('0x2d')]=qs[_0x871c('0x2d')](_0x5534fc[_0x871c('0x43')][_0x871c('0x2d')]);_0x59e006[_0x871c('0x2c')]=qs[_0x871c('0x2c')](_0x5534fc[_0x871c('0x43')][_0x871c('0x2c')]);}return _0x27e3bd[_0x871c('0xc3')](_0x59e006);}})[_0x871c('0x1d')](function(_0x3b315d){if(_0x3b315d){return _0x3b315d?{'count':_0x40baf3,'rows':_0x3b315d}:null;}})[_0x871c('0x1d')](respondWithResult(_0x671674,null))[_0x871c('0x27')](handleError(_0x671674,null));};exports[_0x871c('0xc4')]=function(_0x10566a,_0x8a140,_0x180feb){var _0x4f4a01={'raw':!![],'where':{}};var _0x181530={};var _0x4f2377={'count':0x0,'rows':[]};return db[_0x871c('0x3f')][_0x871c('0xbc')]({'where':{'id':_0x10566a[_0x871c('0x57')]['id']}})[_0x871c('0x1d')](handleEntityNotFound(_0x8a140,null))[_0x871c('0x1d')](function(_0x2ae78e){if(_0x2ae78e){_0x181530[_0x871c('0x40')]=_['keys'](db[_0x871c('0xc5')][_0x871c('0x59')]);_0x181530[_0x871c('0x43')]=_[_0x871c('0x41')](_0x10566a[_0x871c('0x43')]);_0x181530['filters']=_[_0x871c('0x45')](_0x181530[_0x871c('0x40')],_0x181530[_0x871c('0x43')]);_0x4f4a01[_0x871c('0x46')]=_[_0x871c('0x45')](_0x181530[_0x871c('0x40')],qs[_0x871c('0x47')](_0x10566a[_0x871c('0x43')]['fields']));_0x4f4a01[_0x871c('0x46')]=_0x4f4a01[_0x871c('0x46')][_0x871c('0x48')]?_0x4f4a01[_0x871c('0x46')]:_0x181530['model'];if(!_0x10566a['query'][_0x871c('0xb6')](_0x871c('0x49'))){_0x4f4a01[_0x871c('0x2d')]=qs['limit'](_0x10566a[_0x871c('0x43')][_0x871c('0x2d')]);_0x4f4a01['offset']=qs[_0x871c('0x2c')](_0x10566a[_0x871c('0x43')][_0x871c('0x2c')]);}_0x4f4a01['order']=qs['sort'](_0x10566a[_0x871c('0x43')]['sort']);_0x4f4a01[_0x871c('0x4c')]=qs['filters'](_['pick'](_0x10566a[_0x871c('0x43')],_0x181530[_0x871c('0x44')]));_0x4f4a01[_0x871c('0x4c')][_0x871c('0xc0')]=_0x2ae78e['id'];if(_0x10566a[_0x871c('0x43')][_0x871c('0x37')]){_0x4f4a01['where']=_[_0x871c('0x4e')](_0x4f4a01[_0x871c('0x4c')],{'$or':_[_0x871c('0x38')](_0x4f4a01[_0x871c('0x46')],function(_0x25122c){var _0x5d0ad1={};_0x5d0ad1[_0x25122c]={'$like':'%'+_0x10566a[_0x871c('0x43')][_0x871c('0x37')]+'%'};return _0x5d0ad1;})});}_0x4f4a01=_[_0x871c('0x4e')]({},_0x4f4a01,_0x10566a['options']);return db[_0x871c('0xc5')][_0x871c('0x2b')]({'where':_0x4f4a01['where']})[_0x871c('0x1d')](function(_0x322a5e){_0x4f2377[_0x871c('0x2b')]=_0x322a5e;if(_0x10566a['query'][_0x871c('0x53')]){_0x4f4a01[_0x871c('0x54')]=[{'all':!![]}];}return db['MailInteraction'][_0x871c('0x55')](_0x4f4a01);})['then'](function(_0x3f6e26){_0x4f2377[_0x871c('0x56')]=_0x3f6e26;return _0x4f2377;});}})[_0x871c('0x1d')](respondWithFilteredResult(_0x8a140,_0x4f4a01))['catch'](handleError(_0x8a140,null));};exports['getSmsInteractions']=function(_0x5f3aff,_0x1e73d0,_0x3bf652){var _0x1b8746={};var _0x503b3d={};var _0x5afc31;var _0x3fbda3;return db[_0x871c('0x3f')][_0x871c('0xbc')]({'where':{'id':_0x5f3aff[_0x871c('0x57')]['id']}})['then'](handleEntityNotFound(_0x1e73d0,null))[_0x871c('0x1d')](function(_0x1c2a04){if(_0x1c2a04){_0x5afc31=_0x1c2a04;_0x503b3d[_0x871c('0x40')]=_[_0x871c('0x41')](db[_0x871c('0xc6')][_0x871c('0x59')]);_0x503b3d[_0x871c('0x43')]=_['keys'](_0x5f3aff[_0x871c('0x43')]);_0x503b3d[_0x871c('0x44')]=_[_0x871c('0x45')](_0x503b3d[_0x871c('0x40')],_0x503b3d[_0x871c('0x43')]);_0x1b8746['attributes']=_[_0x871c('0x45')](_0x503b3d[_0x871c('0x40')],qs[_0x871c('0x47')](_0x5f3aff[_0x871c('0x43')][_0x871c('0x47')]));_0x1b8746[_0x871c('0x46')]=_0x1b8746['attributes']['length']?_0x1b8746[_0x871c('0x46')]:_0x503b3d[_0x871c('0x40')];_0x1b8746[_0x871c('0x4a')]=qs[_0x871c('0x4b')](_0x5f3aff['query'][_0x871c('0x4b')]);_0x1b8746[_0x871c('0x4c')]=qs[_0x871c('0x44')](_[_0x871c('0x4d')](_0x5f3aff[_0x871c('0x43')],_0x503b3d[_0x871c('0x44')]));if(_0x5f3aff[_0x871c('0x43')][_0x871c('0x37')]){_0x1b8746[_0x871c('0x4c')]=_[_0x871c('0x4e')](_0x1b8746['where'],{'$or':_[_0x871c('0x38')](_0x1b8746[_0x871c('0x46')],function(_0x35979c){var _0x2985fb={};_0x2985fb[_0x35979c]={'$like':'%'+_0x5f3aff[_0x871c('0x43')][_0x871c('0x37')]+'%'};return _0x2985fb;})});}_0x1b8746=_[_0x871c('0x4e')]({},_0x1b8746,_0x5f3aff[_0x871c('0x52')]);return _0x5afc31['getSmsInteractions'](_0x1b8746);}})[_0x871c('0x1d')](function(_0x22d9bf){if(_0x22d9bf){_0x3fbda3=_0x22d9bf[_0x871c('0x48')];if(!_0x5f3aff['query'][_0x871c('0xb6')]('nolimit')){_0x1b8746[_0x871c('0x2d')]=qs[_0x871c('0x2d')](_0x5f3aff[_0x871c('0x43')][_0x871c('0x2d')]);_0x1b8746['offset']=qs[_0x871c('0x2c')](_0x5f3aff[_0x871c('0x43')]['offset']);}return _0x5afc31[_0x871c('0xc7')](_0x1b8746);}})[_0x871c('0x1d')](function(_0x4f18d9){if(_0x4f18d9){return _0x4f18d9?{'count':_0x3fbda3,'rows':_0x4f18d9}:null;}})[_0x871c('0x1d')](respondWithResult(_0x1e73d0,null))[_0x871c('0x27')](handleError(_0x1e73d0,null));};exports[_0x871c('0xc8')]=function(_0x1db0d1,_0x327356,_0x44fda8){var _0x36dffd={};var _0x49f5dd={};var _0x139309;var _0x14aeb6;return db[_0x871c('0x3f')][_0x871c('0xbc')]({'where':{'id':_0x1db0d1[_0x871c('0x57')]['id']}})[_0x871c('0x1d')](handleEntityNotFound(_0x327356,null))[_0x871c('0x1d')](function(_0x1b75b8){if(_0x1b75b8){_0x139309=_0x1b75b8;_0x49f5dd[_0x871c('0x40')]=_[_0x871c('0x41')](db['FaxInteraction'][_0x871c('0x59')]);_0x49f5dd[_0x871c('0x43')]=_[_0x871c('0x41')](_0x1db0d1[_0x871c('0x43')]);_0x49f5dd[_0x871c('0x44')]=_['intersection'](_0x49f5dd[_0x871c('0x40')],_0x49f5dd['query']);_0x36dffd[_0x871c('0x46')]=_[_0x871c('0x45')](_0x49f5dd[_0x871c('0x40')],qs[_0x871c('0x47')](_0x1db0d1[_0x871c('0x43')][_0x871c('0x47')]));_0x36dffd[_0x871c('0x46')]=_0x36dffd[_0x871c('0x46')][_0x871c('0x48')]?_0x36dffd[_0x871c('0x46')]:_0x49f5dd[_0x871c('0x40')];_0x36dffd[_0x871c('0x4a')]=qs[_0x871c('0x4b')](_0x1db0d1[_0x871c('0x43')][_0x871c('0x4b')]);_0x36dffd[_0x871c('0x4c')]=qs['filters'](_[_0x871c('0x4d')](_0x1db0d1[_0x871c('0x43')],_0x49f5dd['filters']));if(_0x1db0d1[_0x871c('0x43')][_0x871c('0x37')]){_0x36dffd[_0x871c('0x4c')]=_[_0x871c('0x4e')](_0x36dffd[_0x871c('0x4c')],{'$or':_[_0x871c('0x38')](_0x36dffd[_0x871c('0x46')],function(_0x31d33b){var _0x26f284={};_0x26f284[_0x31d33b]={'$like':'%'+_0x1db0d1[_0x871c('0x43')]['filter']+'%'};return _0x26f284;})});}_0x36dffd=_[_0x871c('0x4e')]({},_0x36dffd,_0x1db0d1[_0x871c('0x52')]);return _0x139309[_0x871c('0xc8')](_0x36dffd);}})['then'](function(_0x2a5c84){if(_0x2a5c84){_0x14aeb6=_0x2a5c84[_0x871c('0x48')];if(!_0x1db0d1[_0x871c('0x43')]['hasOwnProperty'](_0x871c('0x49'))){_0x36dffd[_0x871c('0x2d')]=qs[_0x871c('0x2d')](_0x1db0d1['query'][_0x871c('0x2d')]);_0x36dffd['offset']=qs[_0x871c('0x2c')](_0x1db0d1[_0x871c('0x43')]['offset']);}return _0x139309[_0x871c('0xc8')](_0x36dffd);}})[_0x871c('0x1d')](function(_0x5aa1a1){if(_0x5aa1a1){return _0x5aa1a1?{'count':_0x14aeb6,'rows':_0x5aa1a1}:null;}})[_0x871c('0x1d')](respondWithResult(_0x327356,null))[_0x871c('0x27')](handleError(_0x327356,null));};exports[_0x871c('0xc9')]=function(_0x5813b6,_0x416a59,_0x3339b4){var _0x59d094;var _0x77fd84;var _0x3c4413;return db[_0x871c('0x3f')][_0x871c('0x5b')]({'where':{'id':_0x5813b6[_0x871c('0x57')]['id'],'role':_0x871c('0x62')},'attributes':['id',_0x871c('0x3c'),_0x871c('0xca'),_0x871c('0xcb'),_0x871c('0x3b'),_0x871c('0x6a'),_0x871c('0xcc')]})[_0x871c('0x1d')](handleEntityNotFound(_0x416a59,null))[_0x871c('0x1d')](function(_0x1c5bae){if(_0x1c5bae){_0x59d094=_0x1c5bae;if(_0x5813b6[_0x871c('0x5d')][_0x871c('0x93')]){_0x3c4413=util[_0x871c('0x68')]('LOCAL/%s@from-sip/n',_0x59d094[_0x5813b6[_0x871c('0x5d')][_0x871c('0x93')]]);}else if(_0x5813b6['body'][_0x871c('0xcd')]){_0x3c4413=util[_0x871c('0x68')](_0x871c('0xce'),_0x5813b6['body'][_0x871c('0xcd')]);}else{_0x3c4413=util[_0x871c('0x68')](_0x871c('0xce'),_0x59d094[_0x871c('0x3c')]);}socket['to'](util[_0x871c('0x68')](_0x871c('0xcf'),_0x59d094[_0x871c('0x3c')]))[_0x871c('0x9c')](_0x871c('0xd0'),{'ip':_0x5813b6[_0x871c('0xd1')][_0x871c('0xd2')]||_0x5813b6['connection'][_0x871c('0xd3')]||_0x5813b6[_0x871c('0xd4')][_0x871c('0xd3')]||_0x5813b6[_0x871c('0xd5')][_0x871c('0xd4')][_0x871c('0xd3')]});return db[_0x871c('0xa3')]['destroy']({'where':{'membername':_0x59d094[_0x871c('0x3c')]},'individualHooks':!![]});}})[_0x871c('0x1d')](function(_0x1ffeae){if(_0x59d094){return _0x59d094['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x2fee31){var _0x7e3316=[];if(_0x2fee31){_0x77fd84=_0x2fee31;if(_0x77fd84[_0x871c('0x48')]){for(var _0x41c3d7=0x0;_0x41c3d7<_0x77fd84[_0x871c('0x48')];_0x41c3d7++){_0x7e3316[_0x871c('0xa0')]({'membername':_0x59d094[_0x871c('0x3c')],'UserId':_0x59d094['id'],'queue_name':_0x77fd84[_0x41c3d7][_0x871c('0x3c')],'VoiceQueueId':_0x77fd84[_0x41c3d7]['id'],'interface':_0x3c4413,'paused':_0x59d094[_0x871c('0xcc')]||![],'penalty':_0x77fd84[_0x41c3d7][_0x871c('0xd6')]||0x0});}return BPromise[_0x871c('0xa2')](_0x7e3316,function(_0xd40e9a){return db[_0x871c('0xa3')][_0x871c('0xa4')](_0xd40e9a);});}}})[_0x871c('0x1d')](function(){return db[_0x871c('0xd7')][_0x871c('0x55')]({'where':{'membername':_0x59d094['name'],'exitAt':null}});})[_0x871c('0x1d')](function(_0x38e1a8){var _0x3f2a4e=[];_0x38e1a8[_0x871c('0xd8')](function(_0x3e8241){_0x3f2a4e['push'](_0x3e8241['update']({'exitAt':moment()[_0x871c('0x68')](_0x871c('0xd9'))}));});return BPromise[_0x871c('0xda')](_0x3f2a4e);})[_0x871c('0x1d')](function(){var _0x20066c=[];var _0xf75174=[];var _0x750833=utils[_0x871c('0xdb')]();var _0x12f0ce={'membername':_0x59d094[_0x871c('0x3c')],'interface':_0x3c4413,'enterAt':moment()[_0x871c('0x68')](_0x871c('0xd9')),'role':_0x59d094[_0x871c('0x3b')],'internal':_0x59d094[_0x871c('0x6a')]};_0x750833[_0x871c('0xd8')](function(_0x1d547b){_0x20066c[_0x871c('0xa0')](_[_0x871c('0x4e')]({'channel':_0x1d547b,'type':'LOGIN','data1':_0x5813b6[_0x871c('0x5d')][_0x871c('0xdc')],'data2':_0x3c4413},_0x12f0ce));if(_0x59d094[_0x871c('0xcc')]){_0xf75174[_0x871c('0xa0')](_['merge']({'channel':_0x1d547b,'type':_0x871c('0xdd'),'data1':'LOGININPAUSE'},_0x12f0ce));}});return db[_0x871c('0xd7')]['bulkCreate'](_0x20066c['concat'](_0xf75174),{'individualHooks':!![]});})[_0x871c('0x1d')](function(){return _0x59d094['update']({'online':!![],'lastLoginAt':moment()[_0x871c('0x68')](_0x871c('0xd9')),'voicePause':_0x59d094[_0x871c('0xcc')]||![],'mailPause':_0x59d094[_0x871c('0xcc')]||![],'chatPause':_0x59d094[_0x871c('0xcc')]||![],'faxPause':_0x59d094[_0x871c('0xcc')]||![],'smsPause':_0x59d094[_0x871c('0xcc')]||![],'openchannelPause':_0x59d094[_0x871c('0xcc')]||![],'pauseType':_0x59d094[_0x871c('0xcc')]?_0x871c('0xde'):null,'interface':_0x3c4413,'lastPauseAt':moment()[_0x871c('0x68')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x871c('0x1d')](respondWithResult(_0x416a59,null))[_0x871c('0x27')](handleError(_0x416a59,null));};exports[_0x871c('0xdf')]=function(_0x3228c4,_0x30c504,_0x25ecb4){var _0x39b53f;return db['User'][_0x871c('0x5b')]({'where':{'id':_0x3228c4['params']['id'],'role':'agent'},'attributes':['id',_0x871c('0x3c'),_0x871c('0x3b')]})[_0x871c('0x1d')](handleEntityNotFound(_0x30c504,null))[_0x871c('0x1d')](function(_0x43a512){if(_0x43a512){_0x39b53f=_0x43a512;return db[_0x871c('0xa3')]['destroy']({'where':{'membername':_0x39b53f[_0x871c('0x3c')]},'individualHooks':!![]});}})[_0x871c('0x1d')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x39b53f[_0x871c('0x3c')],'exitAt':null}});})['then'](function(_0x50f3d2){var _0x2e6d23=[];_0x50f3d2['forEach'](function(_0x555c51){_0x2e6d23['push'](_0x555c51[_0x871c('0x33')]({'exitAt':moment()[_0x871c('0x68')](_0x871c('0xd9'))}));});return BPromise[_0x871c('0xda')](_0x2e6d23);})[_0x871c('0x1d')](function(){return _0x39b53f['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x871c('0x1d')](respondWithResult(_0x30c504,null))['catch'](handleError(_0x30c504,null));};exports[_0x871c('0xe0')]=function(_0x257006,_0x29f93f,_0x52669c){var _0x2eeea6;return db[_0x871c('0xa3')]['update']({'paused':0x1},{'where':{'UserId':_0x257006[_0x871c('0x57')]['id']},'individualHooks':!![]})[_0x871c('0x1d')](function(){return db[_0x871c('0x3f')][_0x871c('0x5b')]({'where':{'id':_0x257006[_0x871c('0x57')]['id'],'role':_0x871c('0x62')},'attributes':['id',_0x871c('0x3c'),_0x871c('0x3b'),_0x871c('0x6a'),_0x871c('0x93')]});})['then'](handleEntityNotFound(_0x29f93f,null))[_0x871c('0x1d')](function(_0x54bd73){if(_0x54bd73){_0x2eeea6=_0x54bd73;return respondWithRpcPromise(_0x871c('0xe1'),'pause',{'id':_0x2eeea6['id'],'name':_0x2eeea6[_0x871c('0x3c')],'pause':!![]});}})[_0x871c('0x1d')](function(){if(_0x2eeea6){return db[_0x871c('0xd7')]['findAll']({'where':{'membername':_0x2eeea6[_0x871c('0x3c')],'type':'PAUSE','exitAt':null}});}})[_0x871c('0x1d')](function(_0x3c35a8){if(_0x3c35a8[_0x871c('0x48')]){var _0x537300=moment()[_0x871c('0x68')](_0x871c('0xd9'));for(var _0x36d6de=0x0,_0x3635e3=_0x3c35a8[_0x871c('0x48')];_0x36d6de<_0x3635e3;_0x36d6de++){_0x3c35a8[_0x36d6de][_0x871c('0xe2')]({'exitAt':_0x537300});}}})[_0x871c('0x1d')](function(){var _0x131324=[];var _0x1ced5b=utils['getChannels']();_0x1ced5b[_0x871c('0xd8')](function(_0x126cfd){_0x131324[_0x871c('0xa0')]({'channel':_0x126cfd,'membername':_0x2eeea6[_0x871c('0x3c')],'interface':_[_0x871c('0x6f')](_0x2eeea6[_0x871c('0x93')])?util['format']('SIP/%s',_0x2eeea6[_0x871c('0x3c')]):_0x2eeea6[_0x871c('0x93')],'type':_0x871c('0xdd'),'enterAt':moment()[_0x871c('0x68')](_0x871c('0xd9')),'data1':_0x257006['body'][_0x871c('0xe3')]||_0x871c('0xe4'),'role':_0x2eeea6[_0x871c('0x3b')],'internal':_0x2eeea6[_0x871c('0x6a')]});});return db[_0x871c('0xd7')][_0x871c('0x5c')](_0x131324,{'individualHooks':!![]});})[_0x871c('0x1d')](function(){return _0x2eeea6['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x257006[_0x871c('0x5d')][_0x871c('0xe3')]||_0x871c('0xe4'),'lastPauseAt':moment()[_0x871c('0x68')](_0x871c('0xd9'))});})[_0x871c('0x1d')](respondWithResult(_0x29f93f,null))[_0x871c('0x27')](handleError(_0x29f93f,null));};exports[_0x871c('0xe5')]=function(_0x2c345c,_0x4fadab,_0x4ed5ad){var _0x3dc88a;return db[_0x871c('0x3f')][_0x871c('0x5b')]({'where':{'id':_0x2c345c['params']['id']},'attributes':['id','name','role','voicePause',_0x871c('0xe6'),_0x871c('0xe7'),_0x871c('0xe8'),_0x871c('0xe9'),_0x871c('0xea'),_0x871c('0xeb'),'lastPauseAt']})[_0x871c('0x1d')](handleEntityNotFound(_0x4fadab,null))[_0x871c('0x1d')](function(_0xf0f7f9){if(_0xf0f7f9){_0x3dc88a=_0xf0f7f9;if(_0x2c345c[_0x871c('0x5d')]['channel']&&!utils[_0x871c('0x94')](_0x2c345c[_0x871c('0x5d')]['channel'])){throw new db[(_0x871c('0x89'))]['ValidationError']('Unknown\x20channel');}switch(_0x2c345c[_0x871c('0x5d')][_0x871c('0x95')]){case _0x871c('0x9e'):return respondWithRpcPromise(_0x871c('0xe1'),_0x871c('0xe5'),{'id':_0x3dc88a['id'],'name':_0x3dc88a[_0x871c('0x3c')],'pause':![]})[_0x871c('0x1d')](function(){return db[_0x871c('0xa3')]['update']({'paused':0x0},{'where':{'UserId':_0x3dc88a['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport'][_0x871c('0x5b')]({'where':{'channel':_0x2c345c[_0x871c('0x5d')][_0x871c('0x95')],'membername':_0x3dc88a['name'],'type':_0x871c('0xdd'),'exitAt':null}});})[_0x871c('0x1d')](function(_0x146fa9){if(_0x146fa9){return _0x146fa9[_0x871c('0x33')]({'exitAt':moment()[_0x871c('0x68')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x871c('0x1d')](function(){return _0x3dc88a[_0x871c('0x33')]({'voicePause':![]});});case _0x871c('0xec'):case'chat':case _0x871c('0xed'):case _0x871c('0xee'):case _0x871c('0xef'):return db['MemberReport']['find']({'where':{'channel':_0x2c345c[_0x871c('0x5d')][_0x871c('0x95')],'membername':_0x3dc88a['name'],'type':_0x871c('0xdd'),'exitAt':null}})['then'](function(_0x4afcd8){if(_0x4afcd8){return _0x4afcd8[_0x871c('0x33')]({'exitAt':moment()[_0x871c('0x68')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x871c('0x1d')](function(){var _0x35f4bb={};_['set'](_0x35f4bb,util['format'](_0x871c('0xf0'),_0x2c345c[_0x871c('0x5d')][_0x871c('0x95')],'Pause'),![]);return _0x3dc88a[_0x871c('0x33')](_0x35f4bb);});default:return respondWithRpcPromise(_0x871c('0xe1'),_0x871c('0xe5'),{'id':_0x3dc88a['id'],'name':_0x3dc88a[_0x871c('0x3c')],'pause':![]})[_0x871c('0x1d')](function(){return db[_0x871c('0xa3')][_0x871c('0x33')]({'paused':0x0},{'where':{'UserId':_0x3dc88a['id']}});})[_0x871c('0x1d')](function(){return db[_0x871c('0xd7')][_0x871c('0x55')]({'where':{'membername':_0x3dc88a[_0x871c('0x3c')],'type':_0x871c('0xdd'),'exitAt':null}});})[_0x871c('0x1d')](function(_0x4eaa68){var _0x3a10eb=[];_0x4eaa68['forEach'](function(_0x25699c){_0x3a10eb[_0x871c('0xa0')](_0x25699c[_0x871c('0x33')]({'exitAt':moment()[_0x871c('0x68')](_0x871c('0xd9')),'data2':_0x871c('0xf1')}));});return BPromise[_0x871c('0xda')](_0x3a10eb);})['then'](function(){return _0x3dc88a[_0x871c('0x33')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x871c('0x1d')](respondWithResult(_0x4fadab,null))[_0x871c('0x27')](handleError(_0x4fadab,null));};exports[_0x871c('0xf2')]=function(_0x117f14,_0x5f04d0,_0x15bd64){var _0x3c50ab={};var _0x13b968={};var _0x4e9306;var _0x286326;return db[_0x871c('0x3f')][_0x871c('0xbc')]({'where':{'id':_0x117f14[_0x871c('0x57')]['id']}})[_0x871c('0x1d')](handleEntityNotFound(_0x5f04d0,null))['then'](function(_0x2e0b32){if(_0x2e0b32){_0x4e9306=_0x2e0b32;_0x13b968[_0x871c('0x40')]=_[_0x871c('0x41')](db[_0x871c('0xf3')]['rawAttributes']);_0x13b968[_0x871c('0x43')]=_['keys'](_0x117f14[_0x871c('0x43')]);_0x13b968['filters']=_['intersection'](_0x13b968[_0x871c('0x40')],_0x13b968[_0x871c('0x43')]);_0x3c50ab[_0x871c('0x46')]=_[_0x871c('0x45')](_0x13b968[_0x871c('0x40')],qs['fields'](_0x117f14[_0x871c('0x43')][_0x871c('0x47')]));_0x3c50ab[_0x871c('0x46')]=_0x3c50ab[_0x871c('0x46')]['length']?_0x3c50ab[_0x871c('0x46')]:_0x13b968[_0x871c('0x40')];_0x3c50ab['order']=qs[_0x871c('0x4b')](_0x117f14[_0x871c('0x43')][_0x871c('0x4b')]);_0x3c50ab[_0x871c('0x4c')]=qs[_0x871c('0x44')](_['pick'](_0x117f14[_0x871c('0x43')],_0x13b968['filters']));if(_0x117f14['query'][_0x871c('0x37')]){_0x3c50ab[_0x871c('0x4c')]=_[_0x871c('0x4e')](_0x3c50ab[_0x871c('0x4c')],{'$or':_[_0x871c('0x38')](_0x3c50ab['attributes'],function(_0x312d85){var _0x47a823={};_0x47a823[_0x312d85]={'$like':'%'+_0x117f14[_0x871c('0x43')][_0x871c('0x37')]+'%'};return _0x47a823;})});}_0x3c50ab=_[_0x871c('0x4e')]({},_0x3c50ab,_0x117f14[_0x871c('0x52')]);return _0x4e9306[_0x871c('0xf2')](_0x3c50ab);}})[_0x871c('0x1d')](function(_0x253d17){if(_0x253d17){_0x286326=_0x253d17[_0x871c('0x48')];if(!_0x117f14[_0x871c('0x43')][_0x871c('0xb6')]('nolimit')){_0x3c50ab[_0x871c('0x2d')]=qs[_0x871c('0x2d')](_0x117f14[_0x871c('0x43')][_0x871c('0x2d')]);_0x3c50ab[_0x871c('0x2c')]=qs['offset'](_0x117f14[_0x871c('0x43')][_0x871c('0x2c')]);}return _0x4e9306[_0x871c('0xf2')](_0x3c50ab);}})[_0x871c('0x1d')](function(_0x2dc02d){if(_0x2dc02d){return _0x2dc02d?{'count':_0x286326,'rows':_0x2dc02d}:null;}})['then'](respondWithResult(_0x5f04d0,null))[_0x871c('0x27')](handleError(_0x5f04d0,null));};exports[_0x871c('0xf4')]=function(_0x1d51c8,_0x535857,_0x4a8560){return db['User']['find']({'where':{'id':_0x1d51c8[_0x871c('0x57')]['id']}})[_0x871c('0x1d')](handleEntityNotFound(_0x535857,null))['then'](function(_0x359b21){if(_0x359b21){return _0x359b21['addTeams'](_0x1d51c8['body'][_0x871c('0x60')],_[_0x871c('0x61')](_0x1d51c8[_0x871c('0x5d')],['ids','id'])||{});}})[_0x871c('0x1d')](respondWithResult(_0x535857,null))[_0x871c('0x27')](handleError(_0x535857,null));};exports[_0x871c('0xf5')]=function(_0x2885e2,_0x344b5f,_0x51c971){var _0x5e60d7;return db[_0x871c('0x3f')][_0x871c('0x5b')]({'where':{'id':_0x2885e2[_0x871c('0x57')]['id']}})[_0x871c('0x1d')](handleEntityNotFound(_0x344b5f,null))['then'](function(_0x3fc93d){if(_0x3fc93d){return _0x3fc93d[_0x871c('0xf5')](_0x2885e2[_0x871c('0x43')][_0x871c('0x60')]);}})[_0x871c('0x1d')](respondWithStatusCode(_0x344b5f,null))[_0x871c('0x27')](handleError(_0x344b5f,null));};exports[_0x871c('0xf6')]=function(_0x5db2ff,_0x48f058,_0x5203a8){var _0x1f46dc={};var _0x46544d={};var _0x2797c7;var _0x4c166f;return db[_0x871c('0x3f')]['findOne']({'where':{'id':_0x5db2ff[_0x871c('0x57')]['id']}})[_0x871c('0x1d')](handleEntityNotFound(_0x48f058,null))[_0x871c('0x1d')](function(_0x2ea2d4){if(_0x2ea2d4){_0x2797c7=_0x2ea2d4;_0x46544d[_0x871c('0x40')]=_[_0x871c('0x41')](db[_0x871c('0xf7')][_0x871c('0x59')]);_0x46544d[_0x871c('0x43')]=_[_0x871c('0x41')](_0x5db2ff[_0x871c('0x43')]);_0x46544d[_0x871c('0x44')]=_[_0x871c('0x45')](_0x46544d[_0x871c('0x40')],_0x46544d['query']);_0x1f46dc['attributes']=_[_0x871c('0x45')](_0x46544d[_0x871c('0x40')],qs[_0x871c('0x47')](_0x5db2ff[_0x871c('0x43')]['fields']));_0x1f46dc['attributes']=_0x1f46dc[_0x871c('0x46')][_0x871c('0x48')]?_0x1f46dc[_0x871c('0x46')]:_0x46544d[_0x871c('0x40')];_0x1f46dc[_0x871c('0x4a')]=qs[_0x871c('0x4b')](_0x5db2ff[_0x871c('0x43')][_0x871c('0x4b')]);_0x1f46dc[_0x871c('0x4c')]=qs['filters'](_[_0x871c('0x4d')](_0x5db2ff[_0x871c('0x43')],_0x46544d[_0x871c('0x44')]));if(_0x5db2ff[_0x871c('0x43')][_0x871c('0x37')]){_0x1f46dc[_0x871c('0x4c')]=_[_0x871c('0x4e')](_0x1f46dc['where'],{'$or':_[_0x871c('0x38')](_0x1f46dc['attributes'],function(_0x2740){var _0x2fe7c2={};_0x2fe7c2[_0x2740]={'$like':'%'+_0x5db2ff[_0x871c('0x43')][_0x871c('0x37')]+'%'};return _0x2fe7c2;})});}_0x1f46dc=_[_0x871c('0x4e')]({},_0x1f46dc,_0x5db2ff[_0x871c('0x52')]);return _0x2797c7[_0x871c('0xf6')](_0x1f46dc);}})[_0x871c('0x1d')](function(_0x552afc){if(_0x552afc){_0x4c166f=_0x552afc[_0x871c('0x48')];if(!_0x5db2ff[_0x871c('0x43')][_0x871c('0xb6')](_0x871c('0x49'))){_0x1f46dc[_0x871c('0x2d')]=qs['limit'](_0x5db2ff[_0x871c('0x43')][_0x871c('0x2d')]);_0x1f46dc[_0x871c('0x2c')]=qs[_0x871c('0x2c')](_0x5db2ff[_0x871c('0x43')]['offset']);}return _0x2797c7[_0x871c('0xf6')](_0x1f46dc);}})[_0x871c('0x1d')](function(_0x464de5){if(_0x464de5){return _0x464de5?{'count':_0x4c166f,'rows':_0x464de5}:null;}})[_0x871c('0x1d')](respondWithResult(_0x48f058,null))[_0x871c('0x27')](handleError(_0x48f058,null));};exports[_0x871c('0xf8')]=function(_0x3a1337,_0x15d860,_0x2edc1b){var _0xa5f76c={};var _0x1b4cb7={};var _0x46821b;var _0x1dfe87;return db[_0x871c('0x3f')]['findOne']({'where':{'id':_0x3a1337[_0x871c('0x57')]['id']}})['then'](handleEntityNotFound(_0x15d860,null))[_0x871c('0x1d')](function(_0x4c2dde){if(_0x4c2dde){_0x46821b=_0x4c2dde;_0x1b4cb7[_0x871c('0x40')]=_[_0x871c('0x41')](db[_0x871c('0x3f')][_0x871c('0x59')]);_0x1b4cb7[_0x871c('0x43')]=_[_0x871c('0x41')](_0x3a1337['query']);_0x1b4cb7['filters']=_[_0x871c('0x45')](_0x1b4cb7['model'],_0x1b4cb7[_0x871c('0x43')]);_0xa5f76c['attributes']=_[_0x871c('0x45')](_0x1b4cb7[_0x871c('0x40')],qs['fields'](_0x3a1337[_0x871c('0x43')][_0x871c('0x47')]));_0xa5f76c[_0x871c('0x46')]=_0xa5f76c[_0x871c('0x46')][_0x871c('0x48')]?_0xa5f76c[_0x871c('0x46')]:_0x1b4cb7[_0x871c('0x40')];_0xa5f76c['order']=qs['sort'](_0x3a1337['query'][_0x871c('0x4b')]);_0xa5f76c[_0x871c('0x4c')]=qs[_0x871c('0x44')](_[_0x871c('0x4d')](_0x3a1337[_0x871c('0x43')],_0x1b4cb7[_0x871c('0x44')]));if(_0x3a1337[_0x871c('0x43')][_0x871c('0x37')]){_0xa5f76c[_0x871c('0x4c')]=_[_0x871c('0x4e')](_0xa5f76c[_0x871c('0x4c')],{'$or':_[_0x871c('0x38')](_0xa5f76c['attributes'],function(_0x592456){var _0x3b44a0={};_0x3b44a0[_0x592456]={'$like':'%'+_0x3a1337[_0x871c('0x43')][_0x871c('0x37')]+'%'};return _0x3b44a0;})});}_0xa5f76c[_0x871c('0x40')]=db[_0x871c('0x3f')];_0xa5f76c['as']=_0x871c('0x81');_0xa5f76c=_[_0x871c('0x4e')]({},_0xa5f76c,_0x3a1337[_0x871c('0x52')]);return _0x46821b['getVoiceQueues']({'include':[_0xa5f76c]});}})[_0x871c('0x1d')](function(_0x5f4b15){if(_0x5f4b15){var _0x358f1b={},_0x17bacd=[],_0x2cd72f=0x0;for(var _0x1cf022=0x0;_0x1cf022<_0x5f4b15[_0x871c('0x48')];_0x1cf022+=0x1){for(var _0x154a44=0x0,_0x40489a;_0x154a44<_0x5f4b15[_0x1cf022][_0x871c('0x81')][_0x871c('0x48')];_0x154a44+=0x1){_0x40489a=_0x5f4b15[_0x1cf022][_0x871c('0x81')][_0x154a44][_0x871c('0x80')]({'plain':!![]});_0x358f1b[_0x40489a['id']]=_0x40489a;}}_0x358f1b=_['values'](_0x358f1b);for(var _0x4d8794=qs['offset'](_0x3a1337[_0x871c('0x43')]['offset']);_0x4d8794<_0x358f1b['length']&&_0x17bacd['length']=_0x4a8fe7){_0x52803a=_0x4a8fe7;_0x388fc6=0xc8;}else{_0x388fc6=0xce;}_0xb35cf4[_0xb875('0x29')](_0x388fc6);return _0xb35cf4[_0xb875('0x2d')](_0xb875('0x2e'),_0x307186+'-'+_0x52803a+'/'+_0x4a8fe7)[_0xb875('0x2f')](_0x318476);}return null;};}function patchUpdates(_0x26c259){return function(_0x565f98){try{jsonpatch[_0xb875('0x30')](_0x565f98,_0x26c259,!![]);}catch(_0x3cbd45){return BPromise['reject'](_0x3cbd45);}return _0x565f98[_0xb875('0x31')]();};}function saveUpdates(_0x3d3f38,_0x3556b8){return function(_0x187237){if(_0x187237){return _0x187237['update'](_0x3d3f38)['then'](function(_0x2f1527){return _0x2f1527;});}return null;};}function removeEntity(_0x18db8e,_0x1fbb2d){return function(_0x4e0bd1){if(_0x4e0bd1){return _0x4e0bd1[_0xb875('0x32')]()[_0xb875('0x1e')](function(){var _0x4fff4f=_0x4e0bd1[_0xb875('0x33')]({'plain':!![]});var _0x140a8f=[{'name':_0xb875('0x34'),'value':_0xb875('0x35'),'ignore':!![]},{'name':_0xb875('0x36'),'value':_0xb875('0x37'),'ignore':![]},{'name':'Telephones','value':_0xb875('0x38'),'ignore':![]}];var _0x13f991=_(_0x140a8f)[_0xb875('0x39')](_0xb875('0x3a'))[_0xb875('0x3b')](_0xb875('0x3c'))[_0xb875('0x3c')]();if(_[_0xb875('0x3d')](_0x13f991,_0x4fff4f[_0xb875('0x3e')])){return;}var _0x1193f2=_[_0xb875('0x3f')](_0x140a8f,[_0xb875('0x3c'),_0x4fff4f[_0xb875('0x3e')]])[_0xb875('0x40')];return db['UserProfileResource']['destroy']({'where':{'type':_0x1193f2,'resourceId':_0x4fff4f['id']}})[_0xb875('0x1e')](function(){return _0x4e0bd1;});})[_0xb875('0x1e')](function(){_0x18db8e[_0xb875('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3751f0,_0x1e5eec){return function(_0x11b552){if(!_0x11b552){_0x3751f0[_0xb875('0x28')](0x194);}return _0x11b552;};}function handleError(_0x16261f,_0x1786a3){_0x1786a3=_0x1786a3||0x1f4;return function(_0x11799a){logger[_0xb875('0x24')](_0x11799a[_0xb875('0x41')]);if(_0x11799a[_0xb875('0x40')]){delete _0x11799a[_0xb875('0x40')];}_0x16261f[_0xb875('0x29')](_0x1786a3)[_0xb875('0x42')](_0x11799a);};}exports[_0xb875('0x43')]=function(_0x56239b,_0x4b7dd6){var _0x438b80={},_0x305233={},_0x4201e7={'count':0x0,'rows':[]};var _0x28000d=db['User'][_0xb875('0x44')];_0x305233[_0xb875('0x45')]=_[_0xb875('0x46')](_[_0xb875('0x47')](_0x28000d),[_0xb875('0x48'),'salt']);_0x305233[_0xb875('0x49')]=_['keys'](_0x56239b[_0xb875('0x49')]);_0x305233[_0xb875('0x4a')]=_[_0xb875('0x4b')](_0x305233[_0xb875('0x45')],_0x305233[_0xb875('0x49')]);_0x438b80[_0xb875('0x4c')]=_[_0xb875('0x4b')](_0x305233[_0xb875('0x45')],qs[_0xb875('0x4d')](_0x56239b[_0xb875('0x49')]['fields']));_0x438b80[_0xb875('0x4c')]=_0x438b80['attributes']['length']?_0x438b80[_0xb875('0x4c')]:_0x305233[_0xb875('0x45')];if(!_0x56239b[_0xb875('0x49')][_0xb875('0x4e')](_0xb875('0x4f'))){_0x438b80[_0xb875('0x2c')]=qs[_0xb875('0x2c')](_0x56239b[_0xb875('0x49')][_0xb875('0x2c')]);_0x438b80[_0xb875('0x2b')]=qs['offset'](_0x56239b[_0xb875('0x49')]['offset']);}_0x438b80[_0xb875('0x50')]=qs[_0xb875('0x51')](_0x56239b[_0xb875('0x49')][_0xb875('0x51')]);_0x438b80['where']=qs[_0xb875('0x4a')](_[_0xb875('0x52')](_0x56239b[_0xb875('0x49')],_0x305233[_0xb875('0x4a')]));if(_0x56239b[_0xb875('0x49')]['filter']){_0x438b80[_0xb875('0x53')]=_[_0xb875('0x54')](_0x438b80[_0xb875('0x53')],{'$or':_[_0xb875('0x3b')](_0x28000d,function(_0x557439){return db[_0xb875('0x55')][_0xb875('0x53')](db['sequelize']['fn'](_0xb875('0x56'),db[_0xb875('0x55')][_0xb875('0x57')](_0x557439[_0xb875('0x58')])),{'$like':db[_0xb875('0x55')]['fn']('lower','%'+_0x56239b[_0xb875('0x49')][_0xb875('0x39')]+'%')});})});}_0x438b80=_[_0xb875('0x54')]({},_0x438b80,_0x56239b[_0xb875('0x59')]);var _0x8d4b7d={'where':_0x438b80['where']};return db[_0xb875('0x5a')][_0xb875('0x5b')](_0x8d4b7d)[_0xb875('0x1e')](function(_0x1b15ae){_0x4201e7['count']=_0x1b15ae;if(_0x56239b[_0xb875('0x49')][_0xb875('0x5c')]){_0x438b80[_0xb875('0x5d')]=[{'all':!![]}];}return db[_0xb875('0x5a')][_0xb875('0x5e')](_0x438b80);})['then'](function(_0x34120b){_0x4201e7[_0xb875('0x5f')]=_0x34120b;return _0x4201e7;})[_0xb875('0x1e')](respondWithFilteredResult(_0x4b7dd6,_0x438b80))[_0xb875('0x27')](handleError(_0x4b7dd6,null));};exports[_0xb875('0x60')]=function(_0x217651,_0x4199d4){var _0x57c0bd={'raw':![],'where':{'id':_0x217651[_0xb875('0x61')]['id']}},_0x22732d={};_0x22732d[_0xb875('0x45')]=_[_0xb875('0x46')](_['keys'](db['User'][_0xb875('0x44')]),[_0xb875('0x48'),_0xb875('0x62')]);_0x22732d['query']=_[_0xb875('0x47')](_0x217651['query']);_0x22732d[_0xb875('0x4a')]=_['intersection'](_0x22732d[_0xb875('0x45')],_0x22732d[_0xb875('0x49')]);_0x57c0bd[_0xb875('0x4c')]=_[_0xb875('0x4b')](_0x22732d[_0xb875('0x45')],qs[_0xb875('0x4d')](_0x217651[_0xb875('0x49')][_0xb875('0x4d')]));_0x57c0bd[_0xb875('0x4c')]=_0x57c0bd[_0xb875('0x4c')][_0xb875('0x63')]?_0x57c0bd[_0xb875('0x4c')]:_0x22732d['model'];if(_0x217651[_0xb875('0x49')][_0xb875('0x5c')]){_0x57c0bd[_0xb875('0x5d')]=[{'all':!![]}];}_0x57c0bd=_[_0xb875('0x54')]({},_0x57c0bd,_0x217651['options']);return db['User']['find'](_0x57c0bd)[_0xb875('0x1e')](handleEntityNotFound(_0x4199d4,null))[_0xb875('0x1e')](respondWithResult(_0x4199d4,null))[_0xb875('0x27')](handleError(_0x4199d4,null));};exports[_0xb875('0x64')]=function(_0x5e49f9,_0x7e8ef2){return db[_0xb875('0x5a')][_0xb875('0x64')](_0x5e49f9[_0xb875('0x65')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x7e8ef2,0xc9))[_0xb875('0x27')](handleError(_0x7e8ef2,null));};exports['update']=function(_0x1a27af,_0x15c634){if(_0x1a27af[_0xb875('0x65')]['id']){delete _0x1a27af[_0xb875('0x65')]['id'];}return db[_0xb875('0x5a')][_0xb875('0x3f')]({'where':{'id':_0x1a27af[_0xb875('0x61')]['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x15c634,null))[_0xb875('0x1e')](saveUpdates(_0x1a27af[_0xb875('0x65')],null))[_0xb875('0x1e')](respondWithResult(_0x15c634,null))[_0xb875('0x27')](handleError(_0x15c634,null));};exports[_0xb875('0x66')]=function(_0xdc63dd,_0x542235){return db[_0xb875('0x5a')]['describe']()[_0xb875('0x1e')](respondWithResult(_0x542235,null))[_0xb875('0x27')](handleError(_0x542235,null));};exports[_0xb875('0x67')]=function(_0x1586d5,_0x23c630,_0x3a1663){return db['User']['find']({'where':{'id':_0x1586d5['params']['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x23c630,null))[_0xb875('0x1e')](function(_0x4e6f33){if(_0x4e6f33){return _0x4e6f33[_0xb875('0x67')](_0x1586d5[_0xb875('0x65')]['ids'],_['omit'](_0x1586d5[_0xb875('0x65')],[_0xb875('0x68'),'id'])||{});}})[_0xb875('0x1e')](respondWithResult(_0x23c630,null))[_0xb875('0x27')](handleError(_0x23c630,null));};var getLicense=function(_0xf0d275){return new BPromise(function(_0x4e1e20,_0x54b9c3){var _0x58adab=0x0;_0xf0d275[_0xb875('0x65')][_0xb875('0x3e')]===_0xb875('0x37')&&_0x4e1e20(_0xb875('0x69'));return db[_0xb875('0x5a')][_0xb875('0x5b')]({'where':{'$or':[{'role':_0xf0d275[_0xb875('0x65')][_0xb875('0x3e')]==='telephone'?_0xb875('0x38'):[_0xb875('0x6a'),_0xb875('0x35')]}]}})[_0xb875('0x1e')](function(_0x186688){_0x58adab=_0x186688;return require(_0xb875('0x6b'))[_0xb875('0x6c')]();})[_0xb875('0x1e')](function(_0x20d5e7){var _0x5b5826=_0xf0d275[_0xb875('0x65')][_0xb875('0x3e')]===_0xb875('0x38')?_0xb875('0x6d'):_0xb875('0x6e');if(!_[_0xb875('0x6f')](_0x20d5e7[_0x5b5826])&&_0x58adab>=_0x20d5e7[_0x5b5826]){return _0x54b9c3({'message':_0xb875('0x70')});}return _0x4e1e20(util[_0xb875('0x71')](_0xb875('0x72'),_0x5b5826,_0x58adab));})['catch'](function(_0x44fa93){return _0x54b9c3(_0x44fa93);});});};exports['create']=function(_0x4acd5c,_0x3453e9){return getLicense(_0x4acd5c)[_0xb875('0x1e')](function(_0x59d76e){if(!_0x4acd5c[_0xb875('0x65')][_0xb875('0x73')]){var _0x277b4a;return db['Setting']['findById'](0x1)['then'](function(_0x2006db){_0x277b4a=_0x2006db[_0xb875('0x74')];return db['User'][_0xb875('0x75')](_0xb875('0x73'));})['then'](function(_0x216a8f){if(_[_0xb875('0x6f')](_0x216a8f)){if(_0x277b4a){_0x4acd5c['body']['internal']=_0x277b4a;}else{_0x4acd5c[_0xb875('0x65')][_0xb875('0x73')]=0x1;}}else{if(_[_0xb875('0x6f')](_0x277b4a)||_0x277b4a==_0x216a8f){_0x4acd5c[_0xb875('0x65')]['internal']=_0x216a8f+0x1;}else if(_0x277b4a>_0x216a8f){_0x4acd5c['body'][_0xb875('0x73')]=_0x277b4a;}else{return db[_0xb875('0x55')]['query'](_0xb875('0x76'),{'type':db[_0xb875('0x55')]['QueryTypes'][_0xb875('0x77')]})[_0xb875('0x1e')](function(_0x104a04){if(_0x104a04&&_0x104a04[_0xb875('0x63')]){for(var _0x5555df=0x0,_0xde9900=_0x104a04[_0xb875('0x63')];_0x5555df<_0xde9900&&_[_0xb875('0x6f')](_0x4acd5c[_0xb875('0x65')][_0xb875('0x73')]);_0x5555df++){if(_0x277b4a<=_0x104a04[_0x5555df][_0xb875('0x78')]){_0x4acd5c[_0xb875('0x65')][_0xb875('0x73')]=_0x104a04[_0x5555df][_0xb875('0x78')];}else if(_0x277b4a>_0x104a04[_0x5555df][_0xb875('0x78')]&&_0x277b4a<=_0x104a04[_0x5555df]['to']){_0x4acd5c[_0xb875('0x65')][_0xb875('0x73')]=_0x277b4a;}}}if(_[_0xb875('0x6f')](_0x4acd5c[_0xb875('0x65')]['internal'])){_0x4acd5c[_0xb875('0x65')]['internal']=_0x216a8f+0x1;}});}}});}})['then'](function(){if(_0x4acd5c[_0xb875('0x65')]['voicemail']){_0x4acd5c[_0xb875('0x65')][_0xb875('0x79')]=_0x4acd5c[_0xb875('0x65')][_0xb875('0x73')];_0x4acd5c[_0xb875('0x65')][_0xb875('0x7a')]={'mailbox':_0x4acd5c['body'][_0xb875('0x73')],'password':_0x4acd5c[_0xb875('0x65')][_0xb875('0x48')],'fullname':_0x4acd5c['body'][_0xb875('0x7b')],'email':_0x4acd5c[_0xb875('0x65')][_0xb875('0x7c')]};}if(_0x4acd5c[_0xb875('0x65')]&&_0x4acd5c[_0xb875('0x65')][_0xb875('0x3e')]===_0xb875('0x37')){_0x4acd5c[_0xb875('0x65')][_0xb875('0x7d')]=['101','102',_0xb875('0x7e'),_0xb875('0x7f'),'104',_0xb875('0x80'),_0xb875('0x81'),_0xb875('0x82'),_0xb875('0x83'),_0xb875('0x84'),_0xb875('0x85'),'111'];}return db[_0xb875('0x5a')][_0xb875('0x86')](_0x4acd5c[_0xb875('0x65')],{'include':[{'model':db['VoiceMail'],'as':_0xb875('0x7a')}]});})[_0xb875('0x1e')](function(_0x3bf8fc){if(_0x4acd5c[_0xb875('0x65')][_0xb875('0x3e')]===_0xb875('0x35'))return _0x3bf8fc;var _0x3438a0=_0x4acd5c[_0xb875('0x35')][_0xb875('0x33')]({'plain':!![]});if(!_0x3438a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3438a0['role']===_0xb875('0x35')){var _0x3dd416=_0x3bf8fc['get']({'plain':!![]});var _0x1c766f=[{'name':_0xb875('0x36'),'value':_0xb875('0x37')},{'name':_0xb875('0x87'),'value':'telephone'}];var _0x284767=_['find'](_0x1c766f,[_0xb875('0x3c'),_0x3dd416[_0xb875('0x3e')]])[_0xb875('0x40')];return db[_0xb875('0x88')]['find']({'where':{'name':_0x284767,'userProfileId':_0x3438a0[_0xb875('0x89')]},'raw':!![]})['then'](function(_0x1e56b1){if(_0x1e56b1&&_0x1e56b1['autoAssociation']===0x0){return db[_0xb875('0x8a')][_0xb875('0x86')]({'name':_0x3dd416['name'],'resourceId':_0x3dd416['id'],'type':_0x1e56b1[_0xb875('0x40')],'sectionId':_0x1e56b1['id']},{})[_0xb875('0x1e')](function(){return _0x3bf8fc;});}else{return _0x3bf8fc;}})[_0xb875('0x27')](function(_0x30fa2d){logger[_0xb875('0x24')](_0xb875('0x8b'),_0x30fa2d);throw _0x30fa2d;});}return _0x3bf8fc;})[_0xb875('0x1e')](respondWithResult(_0x3453e9,0xc9))[_0xb875('0x27')](handleError(_0x3453e9,null));};exports[_0xb875('0x8c')]=function(_0x301955,_0x26045b,_0x2de9a1){if(_0x301955[_0xb875('0x65')]['id']){delete _0x301955[_0xb875('0x65')]['id'];}return db[_0xb875('0x5a')][_0xb875('0x3f')]({'where':{'id':_0x301955[_0xb875('0x61')]['id']}})[_0xb875('0x1e')](function(_0x5a70c2){if(_0x5a70c2){if(_0x5a70c2['id']==_0x301955['user']['id']){if(!_0x301955[_0xb875('0x65')][_0xb875('0x8d')]||!_0x301955[_0xb875('0x65')]['newPassword']){throw new db[(_0xb875('0x8e'))][(_0xb875('0x8f'))](_0xb875('0x90'));}if(!_0x5a70c2[_0xb875('0x91')](_0x301955[_0xb875('0x65')]['oldPassword'])){throw new db[(_0xb875('0x8e'))][(_0xb875('0x8f'))]('Wrong\x20credentials');}if(_0x301955['body'][_0xb875('0x8d')]==_0x301955[_0xb875('0x65')]['newPassword']){throw new db[(_0xb875('0x8e'))][(_0xb875('0x8f'))](_0xb875('0x92'));}return _0x5a70c2;}else if(_0x301955[_0xb875('0x35')][_0xb875('0x3e')]==_0xb875('0x6a')){if(!_0x301955[_0xb875('0x65')][_0xb875('0x93')]){throw new db['Sequelize'][(_0xb875('0x8f'))](_0xb875('0x94'));}return _0x5a70c2;}else if(_0x301955[_0xb875('0x35')][_0xb875('0x3e')]=='user'){if(!_0x301955[_0xb875('0x65')][_0xb875('0x93')]){throw new db['Sequelize'][(_0xb875('0x8f'))](_0xb875('0x94'));}if(_0x5a70c2[_0xb875('0x3e')]!=_0xb875('0x37')){throw new db['Sequelize'][(_0xb875('0x8f'))](_0xb875('0x95'));}return _0x5a70c2;}else{throw new db['Sequelize']['ValidationError'](_0xb875('0x95'));}}return null;})['then'](handleEntityNotFound(_0x26045b,null))[_0xb875('0x1e')](saveUpdates({'password':_0x301955[_0xb875('0x65')][_0xb875('0x93')],'passwordResetAt':_0x301955[_0xb875('0x35')]['id']==_0x301955[_0xb875('0x61')]['id']?moment():null},null))[_0xb875('0x1e')](respondWithResult(_0x26045b,null))[_0xb875('0x27')](handleError(_0x26045b,null));};exports[_0xb875('0x96')]=function(_0x36838f,_0xba1043,_0x2d0105){var _0x4d4df5;return db['User'][_0xb875('0x3f')]({'where':{'id':_0x36838f[_0xb875('0x61')]['id']},'attributes':['id',_0xb875('0x40'),_0xb875('0x3e'),'loginInPause','voicePause',_0xb875('0x97')]})[_0xb875('0x1e')](handleEntityNotFound(_0xba1043,null))[_0xb875('0x1e')](function(_0x31ff55){if(_0x31ff55){_0x4d4df5=_0x31ff55;if(!utils[_0xb875('0x98')](_0x36838f[_0xb875('0x65')][_0xb875('0x99')])){throw new db[(_0xb875('0x8e'))][(_0xb875('0x8f'))](_0xb875('0x9a'));}return _0x31ff55[_0xb875('0x9b')+_[_0xb875('0x9c')](_0x36838f[_0xb875('0x65')]['channel'][_0xb875('0x9d')]())+_0xb875('0x9e')](_0x36838f[_0xb875('0x65')][_0xb875('0x68')],{'penalty':_0x36838f[_0xb875('0x65')]['penalty']||0x0});}})[_0xb875('0x9f')](function(_0x36b115){for(var _0x301fbb=0x0;_0x301fbb<_0x36838f[_0xb875('0x65')][_0xb875('0x68')][_0xb875('0x63')];_0x301fbb+=0x1){var _0x1c4165={'UserId':_0x36838f[_0xb875('0x61')]['id']};_0x1c4165[_[_0xb875('0x9c')](_0x36838f[_0xb875('0x65')][_0xb875('0x99')]['toLowerCase']())+_0xb875('0xa0')]=_0x36838f[_0xb875('0x65')][_0xb875('0x68')][_0x301fbb];socket[_0xb875('0xa1')](_0xb875('0x35')+_[_0xb875('0x9c')](_0x36838f[_0xb875('0x65')]['channel'][_0xb875('0x9d')]())+_0xb875('0xa2'),_0x1c4165);}return _0x36b115;})[_0xb875('0x1e')](function(){if(_0x36838f[_0xb875('0x65')]['channel']===_0xb875('0xa3')){return db['VoiceQueue'][_0xb875('0x5e')]({'where':{'id':_0x36838f[_0xb875('0x65')][_0xb875('0x68')]||[]},'raw':!![],'attributes':['id',_0xb875('0x40')]});}})[_0xb875('0x1e')](function(_0x568819){var _0x47f90d=[];if(_0x36838f[_0xb875('0x65')]['channel']===_0xb875('0xa3')&&_0x4d4df5[_0xb875('0x3e')]===_0xb875('0x37')){for(var _0x40c8e9=0x0;_0x40c8e9<_0x568819[_0xb875('0x63')];_0x40c8e9+=0x1){_0x47f90d[_0xb875('0xa4')]({'membername':_0x4d4df5[_0xb875('0x40')],'UserId':_0x4d4df5['id'],'queue_name':_0x568819[_0x40c8e9]['name'],'VoiceQueueId':_0x568819[_0x40c8e9]['id'],'interface':_[_0xb875('0x6f')](_0x4d4df5['interface'])?util[_0xb875('0x71')]('SIP/%s',_0x4d4df5['name']):_0x4d4df5[_0xb875('0x97')],'paused':_0x4d4df5[_0xb875('0xa5')]||![],'penalty':_0x36838f[_0xb875('0x65')][_0xb875('0xa6')]||0x0});}return BPromise['each'](_0x47f90d,function(_0x5c2409){return db['UserVoiceQueueRt'][_0xb875('0xa7')](_0x5c2409);});}return _0x4d4df5;})['then'](respondWithStatusCode(_0xba1043,null))[_0xb875('0x27')](handleError(_0xba1043,null));};exports[_0xb875('0xa8')]=function(_0x59ac85,_0x1e9007,_0x188d87){var _0x2e7855;return db[_0xb875('0x5a')][_0xb875('0x3f')]({'where':{'id':_0x59ac85[_0xb875('0x61')]['id']},'attributes':['id',_0xb875('0x40'),_0xb875('0x3e')]})[_0xb875('0x1e')](handleEntityNotFound(_0x1e9007,null))['then'](function(_0x2e883f){if(_0x2e883f){_0x2e7855=_0x2e883f;if(!_0x59ac85['query'][_0xb875('0x99')]||!utils[_0xb875('0x98')](_0x59ac85[_0xb875('0x49')][_0xb875('0x99')])){throw new db[(_0xb875('0x8e'))][(_0xb875('0x8f'))](_0xb875('0x9a'));}return _0x2e883f[_0xb875('0xa9')+_[_0xb875('0x9c')](_0x59ac85['query'][_0xb875('0x99')]['toLowerCase']())+_0xb875('0x9e')](_0x59ac85[_0xb875('0x49')][_0xb875('0x68')]);}})['then'](function(_0x5c2a97){for(var _0x12c2b9=0x0;_0x12c2b9<_0x59ac85[_0xb875('0x49')][_0xb875('0x68')][_0xb875('0x63')];_0x12c2b9+=0x1){var _0x4a27d4={'UserId':_0x59ac85[_0xb875('0x61')]['id']};_0x4a27d4[_['capitalize'](_0x59ac85[_0xb875('0x49')][_0xb875('0x99')][_0xb875('0x9d')]())+_0xb875('0xa0')]=_0x59ac85[_0xb875('0x49')][_0xb875('0x68')][_0x12c2b9];socket[_0xb875('0xa1')]('user'+_[_0xb875('0x9c')](_0x59ac85[_0xb875('0x49')]['channel']['toLowerCase']())+'Queue:remove',_0x4a27d4);}return _0x5c2a97;})[_0xb875('0x1e')](function(){if(_0x59ac85[_0xb875('0x49')]['channel']===_0xb875('0xa3')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x59ac85[_0xb875('0x61')]['id'],'VoiceQueueId':_0x59ac85[_0xb875('0x49')][_0xb875('0x68')]},'individualHooks':!![]})[_0xb875('0x1e')](function(){return _0x2e7855;});}return _0x2e7855;})[_0xb875('0x1e')](respondWithStatusCode(_0x1e9007,null))[_0xb875('0x27')](handleError(_0x1e9007,null));};exports[_0xb875('0xaa')]=function(_0x1dab87,_0x58c492,_0x946bb5){_0x1dab87[_0xb875('0x65')]['userpic']=_0x1dab87[_0xb875('0xab')][_0xb875('0xac')];return db[_0xb875('0x5a')]['find']({'where':{'id':_0x1dab87[_0xb875('0x61')]['id']}})['then'](handleEntityNotFound(_0x58c492,null))[_0xb875('0x1e')](saveUpdates(_0x1dab87[_0xb875('0x65')],null))[_0xb875('0x1e')](respondWithResult(_0x58c492,null))['catch'](handleError(_0x58c492,null));};exports[_0xb875('0xad')]=function(_0x347f84,_0x2fe275,_0x1fc658){var _0x5eb6ca=path[_0xb875('0xae')](config[_0xb875('0xaf')],'server/files/images/logos/default_profile.png');return db[_0xb875('0x5a')][_0xb875('0x3f')]({'where':{'id':_0x347f84[_0xb875('0x61')]['id']},'attributes':['id',_0xb875('0xb0')],'raw':!![]})['then'](handleEntityNotFound(_0x2fe275,null))[_0xb875('0x1e')](function(_0x2ed8d3){if(_0x2ed8d3){if(_[_0xb875('0x6f')](_0x2ed8d3['userpic'])){return _0x2fe275['download'](_0x5eb6ca);}else{if(!fs[_0xb875('0xb1')](path[_0xb875('0xae')](config['root'],'server/files/images/',_0x2ed8d3[_0xb875('0xb0')]))){return _0x2fe275['download'](_0x5eb6ca);}return _0x2fe275['download'](path[_0xb875('0xae')](config[_0xb875('0xaf')],'server/files/images/',_0x2ed8d3[_0xb875('0xb0')]));}}})['catch'](handleError(_0x2fe275,null));};exports['getContacts']=function(_0x126da0,_0x5cf4e3,_0x3a2a79){var _0x20ff7c={};var _0x5dc7fc={};var _0x2b28e0;var _0x1b198a;return db[_0xb875('0x5a')]['findOne']({'where':{'id':_0x126da0[_0xb875('0x61')]['id']}})['then'](handleEntityNotFound(_0x5cf4e3,null))[_0xb875('0x1e')](function(_0x432e81){if(_0x432e81){_0x2b28e0=_0x432e81;_0x5dc7fc[_0xb875('0x45')]=_[_0xb875('0x47')](db[_0xb875('0xb2')][_0xb875('0x44')]);_0x5dc7fc[_0xb875('0x49')]=_[_0xb875('0x47')](_0x126da0[_0xb875('0x49')]);_0x5dc7fc[_0xb875('0x4a')]=_[_0xb875('0x4b')](_0x5dc7fc[_0xb875('0x45')],_0x5dc7fc[_0xb875('0x49')]);_0x20ff7c[_0xb875('0x4c')]=_[_0xb875('0x4b')](_0x5dc7fc[_0xb875('0x45')],qs[_0xb875('0x4d')](_0x126da0[_0xb875('0x49')][_0xb875('0x4d')]));_0x20ff7c['attributes']=_0x20ff7c[_0xb875('0x4c')][_0xb875('0x63')]?_0x20ff7c['attributes']:_0x5dc7fc[_0xb875('0x45')];_0x20ff7c[_0xb875('0x50')]=qs['sort'](_0x126da0[_0xb875('0x49')][_0xb875('0x51')]);_0x20ff7c[_0xb875('0x53')]=qs[_0xb875('0x4a')](_['pick'](_0x126da0[_0xb875('0x49')],_0x5dc7fc[_0xb875('0x4a')]));if(_0x126da0[_0xb875('0x49')][_0xb875('0x39')]){_0x20ff7c[_0xb875('0x53')]=_[_0xb875('0x54')](_0x20ff7c[_0xb875('0x53')],{'$or':_[_0xb875('0x3b')](_0x20ff7c[_0xb875('0x4c')],function(_0xf8ec9f){var _0x341d33={};_0x341d33[_0xf8ec9f]={'$like':'%'+_0x126da0[_0xb875('0x49')][_0xb875('0x39')]+'%'};return _0x341d33;})});}_0x20ff7c=_[_0xb875('0x54')]({},_0x20ff7c,_0x126da0['options']);return _0x2b28e0[_0xb875('0xb3')](_0x20ff7c);}})['then'](function(_0x397363){if(_0x397363){_0x1b198a=_0x397363[_0xb875('0x63')];if(_0x126da0[_0xb875('0x49')]['hasOwnProperty'](_0xb875('0x5c'))){_0x20ff7c['include']=[{'model':db[_0xb875('0xb4')],'as':_0xb875('0xb5'),'required':![]},{'model':db[_0xb875('0xb6')],'as':_0xb875('0xb7'),'attributes':['id',_0xb875('0x40'),_0xb875('0xb8')],'where':_0x126da0[_0xb875('0x49')]['tag']?{'id':_0x126da0[_0xb875('0x49')][_0xb875('0xb9')]}:undefined,'required':_0x126da0[_0xb875('0x49')][_0xb875('0xb9')]?!![]:![]}];}if(!_0x126da0[_0xb875('0x49')]['hasOwnProperty'](_0xb875('0x4f'))){_0x20ff7c[_0xb875('0x2c')]=qs[_0xb875('0x2c')](_0x126da0[_0xb875('0x49')][_0xb875('0x2c')]);_0x20ff7c[_0xb875('0x2b')]=qs['offset'](_0x126da0[_0xb875('0x49')][_0xb875('0x2b')]);}return _0x2b28e0['getContacts'](_0x20ff7c);}})[_0xb875('0x1e')](function(_0x2aa7df){if(_0x2aa7df){return _0x2aa7df?{'count':_0x1b198a,'rows':_0x2aa7df}:null;}})[_0xb875('0x1e')](respondWithResult(_0x5cf4e3,null))[_0xb875('0x27')](handleError(_0x5cf4e3,null));};exports['getQueues']=function(_0x2a7fd7,_0x28e82b,_0x3a1e1a){var _0x3450af;var _0xc8e1b6;var _0x17df7a={};var _0x9385f6;return db[_0xb875('0x5a')][_0xb875('0xba')]({'where':{'id':_0x2a7fd7[_0xb875('0x61')]['id']},'attributes':['id',_0xb875('0x40'),_0xb875('0x3e')]})['then'](handleEntityNotFound(_0x28e82b,null))[_0xb875('0x1e')](function(_0x5956e1){if(!utils['isValidChannel'](_0x2a7fd7['query']['channel'])){throw new db[(_0xb875('0x8e'))][(_0xb875('0x8f'))](_0xb875('0x9a'));}_0x3450af=_0x5956e1;var _0xccf4c2={};_0xccf4c2['model']=_[_0xb875('0x47')](db[_['capitalize'](_0x2a7fd7['query'][_0xb875('0x99')])+_0xb875('0xbb')][_0xb875('0x44')]);_0xccf4c2[_0xb875('0x49')]=_[_0xb875('0x47')](_0x2a7fd7[_0xb875('0x49')]);_0xccf4c2[_0xb875('0x4a')]=_[_0xb875('0x4b')](_0xccf4c2[_0xb875('0x45')],_0xccf4c2[_0xb875('0x49')]);_0x17df7a[_0xb875('0x4c')]=_[_0xb875('0x4b')](_0xccf4c2['model'],qs[_0xb875('0x4d')](_0x2a7fd7[_0xb875('0x49')][_0xb875('0x4d')]));_0x17df7a['attributes']=_0x17df7a['attributes']['length']?_0x17df7a['attributes']:_0xccf4c2['model'];_0x17df7a['order']=qs[_0xb875('0x51')](_0x2a7fd7[_0xb875('0x49')][_0xb875('0x51')]);_0x17df7a[_0xb875('0x53')]=qs['filters'](_[_0xb875('0x52')](_0x2a7fd7[_0xb875('0x49')],_0xccf4c2[_0xb875('0x4a')]));if(_0x2a7fd7[_0xb875('0x49')][_0xb875('0x39')]){_0x17df7a[_0xb875('0x53')]=_[_0xb875('0x54')](_0x17df7a[_0xb875('0x53')],{'$or':_['map'](_0x17df7a['attributes'],function(_0x4202c6){var _0x5de951={};_0x5de951[_0x4202c6]={'$like':'%'+_0x2a7fd7['query'][_0xb875('0x39')]+'%'};return _0x5de951;})});}_0x17df7a=_[_0xb875('0x54')]({},_0x17df7a,_0x2a7fd7[_0xb875('0x59')]);switch(_0x3450af[_0xb875('0x3e')]){case _0xb875('0x6a'):return db[_[_0xb875('0x9c')](_0x2a7fd7[_0xb875('0x49')][_0xb875('0x99')])+_0xb875('0xbb')][_0xb875('0x5e')](_0x17df7a);case'user':case _0xb875('0x37'):return _0x3450af[_0xb875('0x33')+_['capitalize'](_0x2a7fd7[_0xb875('0x49')]['channel'])+_0xb875('0x9e')](_0x17df7a);default:throw new db[(_0xb875('0x8e'))][(_0xb875('0x8f'))](_0xb875('0xbc'));}})[_0xb875('0x1e')](function(_0x26e122){_0x9385f6=_0x26e122[_0xb875('0x63')];if(!_0x2a7fd7[_0xb875('0x49')][_0xb875('0x4e')](_0xb875('0x4f'))){_0x17df7a[_0xb875('0x2c')]=qs[_0xb875('0x2c')](_0x2a7fd7[_0xb875('0x49')]['limit']);_0x17df7a[_0xb875('0x2b')]=qs[_0xb875('0x2b')](_0x2a7fd7[_0xb875('0x49')]['offset']);}switch(_0x3450af['role']){case _0xb875('0x6a'):return db[_[_0xb875('0x9c')](_0x2a7fd7[_0xb875('0x49')][_0xb875('0x99')])+_0xb875('0xbb')]['findAll'](_0x17df7a);case _0xb875('0x35'):case _0xb875('0x37'):return _0x3450af['get'+_[_0xb875('0x9c')](_0x2a7fd7['query'][_0xb875('0x99')])+_0xb875('0x9e')](_0x17df7a);}})[_0xb875('0x1e')](function(_0xc08028){return{'count':_0x9385f6,'rows':_0xc08028};})[_0xb875('0x1e')](respondWithResult(_0x28e82b,null))[_0xb875('0x27')](handleError(_0x28e82b,null));};exports[_0xb875('0xbd')]=function(_0xdc8cf7,_0x4cc795,_0x179ad0){var _0x199e64={};var _0x49657f={};var _0x19f09d;var _0x4a6131;return db[_0xb875('0x5a')][_0xb875('0xba')]({'where':{'id':_0xdc8cf7[_0xb875('0x61')]['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x4cc795,null))[_0xb875('0x1e')](function(_0x56f4f3){if(_0x56f4f3){_0x19f09d=_0x56f4f3;_0x49657f[_0xb875('0x45')]=_[_0xb875('0x47')](db[_0xb875('0xbe')]['rawAttributes']);_0x49657f[_0xb875('0x49')]=_['keys'](_0xdc8cf7['query']);_0x49657f[_0xb875('0x4a')]=_[_0xb875('0x4b')](_0x49657f[_0xb875('0x45')],_0x49657f[_0xb875('0x49')]);_0x199e64[_0xb875('0x4c')]=_[_0xb875('0x4b')](_0x49657f[_0xb875('0x45')],qs['fields'](_0xdc8cf7['query']['fields']));_0x199e64[_0xb875('0x4c')]=_0x199e64['attributes'][_0xb875('0x63')]?_0x199e64[_0xb875('0x4c')]:_0x49657f['model'];_0x199e64[_0xb875('0x50')]=qs[_0xb875('0x51')](_0xdc8cf7['query'][_0xb875('0x51')]);_0x199e64[_0xb875('0x53')]=qs[_0xb875('0x4a')](_[_0xb875('0x52')](_0xdc8cf7['query'],_0x49657f[_0xb875('0x4a')]));if(_0xdc8cf7[_0xb875('0x49')][_0xb875('0x39')]){_0x199e64[_0xb875('0x53')]=_[_0xb875('0x54')](_0x199e64['where'],{'$or':_[_0xb875('0x3b')](_0x199e64[_0xb875('0x4c')],function(_0x3d118e){var _0x5778ad={};_0x5778ad[_0x3d118e]={'$like':'%'+_0xdc8cf7[_0xb875('0x49')][_0xb875('0x39')]+'%'};return _0x5778ad;})});}_0x199e64=_[_0xb875('0x54')]({},_0x199e64,_0xdc8cf7[_0xb875('0x59')]);return _0x19f09d[_0xb875('0xbd')](_0x199e64);}})[_0xb875('0x1e')](function(_0x68a681){if(_0x68a681){_0x4a6131=_0x68a681[_0xb875('0x63')];if(!_0xdc8cf7['query'][_0xb875('0x4e')](_0xb875('0x4f'))){_0x199e64['limit']=qs[_0xb875('0x2c')](_0xdc8cf7['query'][_0xb875('0x2c')]);_0x199e64[_0xb875('0x2b')]=qs[_0xb875('0x2b')](_0xdc8cf7[_0xb875('0x49')]['offset']);}return _0x19f09d['getVoiceQueuesRt'](_0x199e64);}})[_0xb875('0x1e')](function(_0x49ae96){if(_0x49ae96){return _0x49ae96?{'count':_0x4a6131,'rows':_0x49ae96}:null;}})[_0xb875('0x1e')](respondWithResult(_0x4cc795,null))['catch'](handleError(_0x4cc795,null));};exports[_0xb875('0xbf')]=function(_0x1a8b6c,_0x231c09,_0x5142f9){var _0x108a06={};var _0x2d200a={};var _0xde85f3;var _0x1d4518;return db['User'][_0xb875('0xba')]({'where':{'id':_0x1a8b6c[_0xb875('0x61')]['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x231c09,null))[_0xb875('0x1e')](function(_0x4b5bde){if(_0x4b5bde){_0xde85f3=_0x4b5bde;_0x2d200a[_0xb875('0x45')]=_['keys'](db[_0xb875('0xc0')][_0xb875('0x44')]);_0x2d200a[_0xb875('0x49')]=_[_0xb875('0x47')](_0x1a8b6c['query']);_0x2d200a['filters']=_['intersection'](_0x2d200a[_0xb875('0x45')],_0x2d200a[_0xb875('0x49')]);_0x108a06['attributes']=_[_0xb875('0x4b')](_0x2d200a[_0xb875('0x45')],qs[_0xb875('0x4d')](_0x1a8b6c[_0xb875('0x49')][_0xb875('0x4d')]));_0x108a06[_0xb875('0x4c')]=_0x108a06['attributes']['length']?_0x108a06[_0xb875('0x4c')]:_0x2d200a[_0xb875('0x45')];_0x108a06['order']=qs[_0xb875('0x51')](_0x1a8b6c['query'][_0xb875('0x51')]);_0x108a06[_0xb875('0x53')]=qs['filters'](_[_0xb875('0x52')](_0x1a8b6c['query'],_0x2d200a['filters']));if(_0x1a8b6c[_0xb875('0x49')][_0xb875('0x39')]){_0x108a06[_0xb875('0x53')]=_[_0xb875('0x54')](_0x108a06[_0xb875('0x53')],{'$or':_[_0xb875('0x3b')](_0x108a06['attributes'],function(_0x2eac16){var _0x48057b={};_0x48057b[_0x2eac16]={'$like':'%'+_0x1a8b6c[_0xb875('0x49')]['filter']+'%'};return _0x48057b;})});}_0x108a06=_[_0xb875('0x54')]({},_0x108a06,_0x1a8b6c[_0xb875('0x59')]);return _0xde85f3[_0xb875('0xbf')](_0x108a06);}})['then'](function(_0x38e7e0){if(_0x38e7e0){_0x1d4518=_0x38e7e0['length'];if(!_0x1a8b6c[_0xb875('0x49')][_0xb875('0x4e')](_0xb875('0x4f'))){_0x108a06[_0xb875('0x2c')]=qs[_0xb875('0x2c')](_0x1a8b6c[_0xb875('0x49')]['limit']);_0x108a06[_0xb875('0x2b')]=qs[_0xb875('0x2b')](_0x1a8b6c[_0xb875('0x49')][_0xb875('0x2b')]);}return _0xde85f3[_0xb875('0xbf')](_0x108a06);}})[_0xb875('0x1e')](function(_0x1f65b0){if(_0x1f65b0){return _0x1f65b0?{'count':_0x1d4518,'rows':_0x1f65b0}:null;}})['then'](respondWithResult(_0x231c09,null))[_0xb875('0x27')](handleError(_0x231c09,null));};exports[_0xb875('0xc1')]=function(_0x3e04fc,_0x5358cb,_0x58c871){var _0x13290b={'raw':!![],'where':{}};var _0x535c4b={};var _0x41a39b={'count':0x0,'rows':[]};return db[_0xb875('0x5a')][_0xb875('0xba')]({'where':{'id':_0x3e04fc[_0xb875('0x61')]['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x5358cb,null))[_0xb875('0x1e')](function(_0x497162){if(_0x497162){_0x535c4b[_0xb875('0x45')]=_[_0xb875('0x47')](db[_0xb875('0xc2')][_0xb875('0x44')]);_0x535c4b[_0xb875('0x49')]=_[_0xb875('0x47')](_0x3e04fc[_0xb875('0x49')]);_0x535c4b['filters']=_[_0xb875('0x4b')](_0x535c4b[_0xb875('0x45')],_0x535c4b[_0xb875('0x49')]);_0x13290b[_0xb875('0x4c')]=_['intersection'](_0x535c4b[_0xb875('0x45')],qs['fields'](_0x3e04fc[_0xb875('0x49')][_0xb875('0x4d')]));_0x13290b['attributes']=_0x13290b[_0xb875('0x4c')][_0xb875('0x63')]?_0x13290b[_0xb875('0x4c')]:_0x535c4b['model'];if(!_0x3e04fc[_0xb875('0x49')]['hasOwnProperty'](_0xb875('0x4f'))){_0x13290b['limit']=qs['limit'](_0x3e04fc[_0xb875('0x49')]['limit']);_0x13290b[_0xb875('0x2b')]=qs['offset'](_0x3e04fc['query'][_0xb875('0x2b')]);}_0x13290b[_0xb875('0x50')]=qs['sort'](_0x3e04fc[_0xb875('0x49')][_0xb875('0x51')]);_0x13290b[_0xb875('0x53')]=qs[_0xb875('0x4a')](_[_0xb875('0x52')](_0x3e04fc[_0xb875('0x49')],_0x535c4b[_0xb875('0x4a')]));_0x13290b[_0xb875('0x53')]['UserId']=_0x497162['id'];if(_0x3e04fc[_0xb875('0x49')][_0xb875('0x39')]){_0x13290b[_0xb875('0x53')]=_[_0xb875('0x54')](_0x13290b['where'],{'$or':_[_0xb875('0x3b')](_0x13290b['attributes'],function(_0x556b2d){var _0x12ba2f={};_0x12ba2f[_0x556b2d]={'$like':'%'+_0x3e04fc['query'][_0xb875('0x39')]+'%'};return _0x12ba2f;})});}_0x13290b=_['merge']({},_0x13290b,_0x3e04fc[_0xb875('0x59')]);return db[_0xb875('0xc2')][_0xb875('0x5b')]({'where':_0x13290b[_0xb875('0x53')]})[_0xb875('0x1e')](function(_0x1c87cd){_0x41a39b[_0xb875('0x5b')]=_0x1c87cd;if(_0x3e04fc[_0xb875('0x49')][_0xb875('0x5c')]){_0x13290b['include']=[{'all':!![]}];}return db[_0xb875('0xc2')][_0xb875('0x5e')](_0x13290b);})[_0xb875('0x1e')](function(_0x361cdb){_0x41a39b['rows']=_0x361cdb;return _0x41a39b;});}})[_0xb875('0x1e')](respondWithFilteredResult(_0x5358cb,_0x13290b))['catch'](handleError(_0x5358cb,null));};exports[_0xb875('0xc3')]=function(_0x423ff5,_0x5263b7,_0x3df587){var _0x4fa900={};var _0x239d17={};var _0x62784b;var _0x3f04b5;return db['User'][_0xb875('0xba')]({'where':{'id':_0x423ff5[_0xb875('0x61')]['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x5263b7,null))['then'](function(_0x34cdf8){if(_0x34cdf8){_0x62784b=_0x34cdf8;_0x239d17['model']=_[_0xb875('0x47')](db[_0xb875('0xc4')]['rawAttributes']);_0x239d17[_0xb875('0x49')]=_['keys'](_0x423ff5[_0xb875('0x49')]);_0x239d17[_0xb875('0x4a')]=_[_0xb875('0x4b')](_0x239d17['model'],_0x239d17[_0xb875('0x49')]);_0x4fa900['attributes']=_[_0xb875('0x4b')](_0x239d17[_0xb875('0x45')],qs[_0xb875('0x4d')](_0x423ff5[_0xb875('0x49')][_0xb875('0x4d')]));_0x4fa900['attributes']=_0x4fa900[_0xb875('0x4c')]['length']?_0x4fa900[_0xb875('0x4c')]:_0x239d17[_0xb875('0x45')];_0x4fa900['order']=qs[_0xb875('0x51')](_0x423ff5[_0xb875('0x49')][_0xb875('0x51')]);_0x4fa900[_0xb875('0x53')]=qs[_0xb875('0x4a')](_[_0xb875('0x52')](_0x423ff5['query'],_0x239d17[_0xb875('0x4a')]));if(_0x423ff5[_0xb875('0x49')][_0xb875('0x39')]){_0x4fa900[_0xb875('0x53')]=_[_0xb875('0x54')](_0x4fa900[_0xb875('0x53')],{'$or':_['map'](_0x4fa900[_0xb875('0x4c')],function(_0xd55d38){var _0x3ba640={};_0x3ba640[_0xd55d38]={'$like':'%'+_0x423ff5[_0xb875('0x49')][_0xb875('0x39')]+'%'};return _0x3ba640;})});}_0x4fa900=_[_0xb875('0x54')]({},_0x4fa900,_0x423ff5[_0xb875('0x59')]);return _0x62784b['getChatInteractions'](_0x4fa900);}})[_0xb875('0x1e')](function(_0x12ae2d){if(_0x12ae2d){_0x3f04b5=_0x12ae2d[_0xb875('0x63')];if(!_0x423ff5['query'][_0xb875('0x4e')]('nolimit')){_0x4fa900['limit']=qs[_0xb875('0x2c')](_0x423ff5[_0xb875('0x49')][_0xb875('0x2c')]);_0x4fa900[_0xb875('0x2b')]=qs[_0xb875('0x2b')](_0x423ff5['query'][_0xb875('0x2b')]);}return _0x62784b[_0xb875('0xc3')](_0x4fa900);}})[_0xb875('0x1e')](function(_0x577e13){if(_0x577e13){return _0x577e13?{'count':_0x3f04b5,'rows':_0x577e13}:null;}})[_0xb875('0x1e')](respondWithResult(_0x5263b7,null))[_0xb875('0x27')](handleError(_0x5263b7,null));};exports[_0xb875('0xc5')]=function(_0x4c6d9d,_0x53288e,_0x2e3ea4){var _0x3d19f1={};var _0x652009={};var _0x312af8;var _0x2cd564;return db[_0xb875('0x5a')][_0xb875('0xba')]({'where':{'id':_0x4c6d9d[_0xb875('0x61')]['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x53288e,null))[_0xb875('0x1e')](function(_0x491221){if(_0x491221){_0x312af8=_0x491221;_0x652009[_0xb875('0x45')]=_[_0xb875('0x47')](db[_0xb875('0xc6')][_0xb875('0x44')]);_0x652009['query']=_['keys'](_0x4c6d9d[_0xb875('0x49')]);_0x652009[_0xb875('0x4a')]=_[_0xb875('0x4b')](_0x652009[_0xb875('0x45')],_0x652009[_0xb875('0x49')]);_0x3d19f1[_0xb875('0x4c')]=_['intersection'](_0x652009[_0xb875('0x45')],qs[_0xb875('0x4d')](_0x4c6d9d[_0xb875('0x49')][_0xb875('0x4d')]));_0x3d19f1[_0xb875('0x4c')]=_0x3d19f1['attributes'][_0xb875('0x63')]?_0x3d19f1[_0xb875('0x4c')]:_0x652009[_0xb875('0x45')];_0x3d19f1[_0xb875('0x50')]=qs[_0xb875('0x51')](_0x4c6d9d['query'][_0xb875('0x51')]);_0x3d19f1[_0xb875('0x53')]=qs[_0xb875('0x4a')](_[_0xb875('0x52')](_0x4c6d9d[_0xb875('0x49')],_0x652009['filters']));if(_0x4c6d9d['query'][_0xb875('0x39')]){_0x3d19f1[_0xb875('0x53')]=_[_0xb875('0x54')](_0x3d19f1[_0xb875('0x53')],{'$or':_[_0xb875('0x3b')](_0x3d19f1[_0xb875('0x4c')],function(_0x3026ff){var _0x3c2331={};_0x3c2331[_0x3026ff]={'$like':'%'+_0x4c6d9d['query'][_0xb875('0x39')]+'%'};return _0x3c2331;})});}_0x3d19f1=_[_0xb875('0x54')]({},_0x3d19f1,_0x4c6d9d[_0xb875('0x59')]);return _0x312af8[_0xb875('0xc5')](_0x3d19f1);}})[_0xb875('0x1e')](function(_0x43e726){if(_0x43e726){_0x2cd564=_0x43e726[_0xb875('0x63')];if(!_0x4c6d9d[_0xb875('0x49')][_0xb875('0x4e')](_0xb875('0x4f'))){_0x3d19f1[_0xb875('0x2c')]=qs['limit'](_0x4c6d9d[_0xb875('0x49')][_0xb875('0x2c')]);_0x3d19f1[_0xb875('0x2b')]=qs['offset'](_0x4c6d9d[_0xb875('0x49')][_0xb875('0x2b')]);}return _0x312af8[_0xb875('0xc5')](_0x3d19f1);}})[_0xb875('0x1e')](function(_0x4fbb27){if(_0x4fbb27){return _0x4fbb27?{'count':_0x2cd564,'rows':_0x4fbb27}:null;}})[_0xb875('0x1e')](respondWithResult(_0x53288e,null))['catch'](handleError(_0x53288e,null));};exports[_0xb875('0xc7')]=function(_0x3b8d66,_0x22192c,_0x4771a8){var _0xb3971e={'raw':!![],'where':{}};var _0x133853={};var _0x482676={'count':0x0,'rows':[]};return db['User'][_0xb875('0xba')]({'where':{'id':_0x3b8d66[_0xb875('0x61')]['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x22192c,null))['then'](function(_0x52052d){if(_0x52052d){_0x133853['model']=_[_0xb875('0x47')](db[_0xb875('0xc8')][_0xb875('0x44')]);_0x133853['query']=_[_0xb875('0x47')](_0x3b8d66[_0xb875('0x49')]);_0x133853[_0xb875('0x4a')]=_[_0xb875('0x4b')](_0x133853[_0xb875('0x45')],_0x133853['query']);_0xb3971e['attributes']=_[_0xb875('0x4b')](_0x133853[_0xb875('0x45')],qs['fields'](_0x3b8d66[_0xb875('0x49')][_0xb875('0x4d')]));_0xb3971e[_0xb875('0x4c')]=_0xb3971e[_0xb875('0x4c')][_0xb875('0x63')]?_0xb3971e[_0xb875('0x4c')]:_0x133853['model'];if(!_0x3b8d66[_0xb875('0x49')][_0xb875('0x4e')](_0xb875('0x4f'))){_0xb3971e[_0xb875('0x2c')]=qs[_0xb875('0x2c')](_0x3b8d66[_0xb875('0x49')][_0xb875('0x2c')]);_0xb3971e[_0xb875('0x2b')]=qs[_0xb875('0x2b')](_0x3b8d66[_0xb875('0x49')][_0xb875('0x2b')]);}_0xb3971e[_0xb875('0x50')]=qs[_0xb875('0x51')](_0x3b8d66[_0xb875('0x49')][_0xb875('0x51')]);_0xb3971e[_0xb875('0x53')]=qs[_0xb875('0x4a')](_[_0xb875('0x52')](_0x3b8d66[_0xb875('0x49')],_0x133853[_0xb875('0x4a')]));_0xb3971e[_0xb875('0x53')][_0xb875('0xc9')]=_0x52052d['id'];if(_0x3b8d66[_0xb875('0x49')]['filter']){_0xb3971e[_0xb875('0x53')]=_[_0xb875('0x54')](_0xb3971e[_0xb875('0x53')],{'$or':_[_0xb875('0x3b')](_0xb3971e['attributes'],function(_0x233a0d){var _0x126993={};_0x126993[_0x233a0d]={'$like':'%'+_0x3b8d66[_0xb875('0x49')][_0xb875('0x39')]+'%'};return _0x126993;})});}_0xb3971e=_[_0xb875('0x54')]({},_0xb3971e,_0x3b8d66[_0xb875('0x59')]);return db['MailInteraction'][_0xb875('0x5b')]({'where':_0xb3971e[_0xb875('0x53')]})[_0xb875('0x1e')](function(_0x1b1712){_0x482676[_0xb875('0x5b')]=_0x1b1712;if(_0x3b8d66[_0xb875('0x49')]['includeAll']){_0xb3971e[_0xb875('0x5d')]=[{'all':!![]}];}return db[_0xb875('0xc8')]['findAll'](_0xb3971e);})['then'](function(_0xb82893){_0x482676['rows']=_0xb82893;return _0x482676;});}})[_0xb875('0x1e')](respondWithFilteredResult(_0x22192c,_0xb3971e))['catch'](handleError(_0x22192c,null));};exports['getSmsInteractions']=function(_0x3919c5,_0x5055bc,_0x62e5af){var _0x301579={};var _0x1e8826={};var _0x4d6f83;var _0x5a8360;return db[_0xb875('0x5a')][_0xb875('0xba')]({'where':{'id':_0x3919c5['params']['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x5055bc,null))['then'](function(_0x4237db){if(_0x4237db){_0x4d6f83=_0x4237db;_0x1e8826[_0xb875('0x45')]=_[_0xb875('0x47')](db[_0xb875('0xca')][_0xb875('0x44')]);_0x1e8826[_0xb875('0x49')]=_['keys'](_0x3919c5[_0xb875('0x49')]);_0x1e8826[_0xb875('0x4a')]=_['intersection'](_0x1e8826['model'],_0x1e8826[_0xb875('0x49')]);_0x301579[_0xb875('0x4c')]=_[_0xb875('0x4b')](_0x1e8826[_0xb875('0x45')],qs['fields'](_0x3919c5['query'][_0xb875('0x4d')]));_0x301579[_0xb875('0x4c')]=_0x301579[_0xb875('0x4c')][_0xb875('0x63')]?_0x301579['attributes']:_0x1e8826[_0xb875('0x45')];_0x301579[_0xb875('0x50')]=qs['sort'](_0x3919c5[_0xb875('0x49')]['sort']);_0x301579[_0xb875('0x53')]=qs[_0xb875('0x4a')](_['pick'](_0x3919c5[_0xb875('0x49')],_0x1e8826[_0xb875('0x4a')]));if(_0x3919c5[_0xb875('0x49')][_0xb875('0x39')]){_0x301579['where']=_[_0xb875('0x54')](_0x301579[_0xb875('0x53')],{'$or':_[_0xb875('0x3b')](_0x301579[_0xb875('0x4c')],function(_0x3a534e){var _0x18259f={};_0x18259f[_0x3a534e]={'$like':'%'+_0x3919c5['query']['filter']+'%'};return _0x18259f;})});}_0x301579=_[_0xb875('0x54')]({},_0x301579,_0x3919c5[_0xb875('0x59')]);return _0x4d6f83[_0xb875('0xcb')](_0x301579);}})['then'](function(_0x57de27){if(_0x57de27){_0x5a8360=_0x57de27['length'];if(!_0x3919c5[_0xb875('0x49')][_0xb875('0x4e')](_0xb875('0x4f'))){_0x301579[_0xb875('0x2c')]=qs[_0xb875('0x2c')](_0x3919c5[_0xb875('0x49')][_0xb875('0x2c')]);_0x301579[_0xb875('0x2b')]=qs[_0xb875('0x2b')](_0x3919c5[_0xb875('0x49')][_0xb875('0x2b')]);}return _0x4d6f83[_0xb875('0xcb')](_0x301579);}})[_0xb875('0x1e')](function(_0x52f9f9){if(_0x52f9f9){return _0x52f9f9?{'count':_0x5a8360,'rows':_0x52f9f9}:null;}})['then'](respondWithResult(_0x5055bc,null))[_0xb875('0x27')](handleError(_0x5055bc,null));};exports[_0xb875('0xcc')]=function(_0x3313d0,_0x5e840e,_0xd13a4d){var _0xf48920={};var _0x44c5fa={};var _0x33608e;var _0x276450;return db[_0xb875('0x5a')][_0xb875('0xba')]({'where':{'id':_0x3313d0[_0xb875('0x61')]['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x5e840e,null))[_0xb875('0x1e')](function(_0xf9b5df){if(_0xf9b5df){_0x33608e=_0xf9b5df;_0x44c5fa[_0xb875('0x45')]=_[_0xb875('0x47')](db[_0xb875('0xcd')][_0xb875('0x44')]);_0x44c5fa[_0xb875('0x49')]=_[_0xb875('0x47')](_0x3313d0['query']);_0x44c5fa[_0xb875('0x4a')]=_[_0xb875('0x4b')](_0x44c5fa[_0xb875('0x45')],_0x44c5fa[_0xb875('0x49')]);_0xf48920['attributes']=_[_0xb875('0x4b')](_0x44c5fa[_0xb875('0x45')],qs[_0xb875('0x4d')](_0x3313d0['query'][_0xb875('0x4d')]));_0xf48920['attributes']=_0xf48920['attributes'][_0xb875('0x63')]?_0xf48920[_0xb875('0x4c')]:_0x44c5fa['model'];_0xf48920[_0xb875('0x50')]=qs[_0xb875('0x51')](_0x3313d0[_0xb875('0x49')][_0xb875('0x51')]);_0xf48920[_0xb875('0x53')]=qs[_0xb875('0x4a')](_['pick'](_0x3313d0[_0xb875('0x49')],_0x44c5fa[_0xb875('0x4a')]));if(_0x3313d0[_0xb875('0x49')][_0xb875('0x39')]){_0xf48920[_0xb875('0x53')]=_[_0xb875('0x54')](_0xf48920[_0xb875('0x53')],{'$or':_[_0xb875('0x3b')](_0xf48920[_0xb875('0x4c')],function(_0x4563bb){var _0xab91eb={};_0xab91eb[_0x4563bb]={'$like':'%'+_0x3313d0[_0xb875('0x49')][_0xb875('0x39')]+'%'};return _0xab91eb;})});}_0xf48920=_['merge']({},_0xf48920,_0x3313d0[_0xb875('0x59')]);return _0x33608e[_0xb875('0xcc')](_0xf48920);}})[_0xb875('0x1e')](function(_0xa7dad6){if(_0xa7dad6){_0x276450=_0xa7dad6[_0xb875('0x63')];if(!_0x3313d0['query'][_0xb875('0x4e')](_0xb875('0x4f'))){_0xf48920[_0xb875('0x2c')]=qs[_0xb875('0x2c')](_0x3313d0[_0xb875('0x49')][_0xb875('0x2c')]);_0xf48920['offset']=qs[_0xb875('0x2b')](_0x3313d0[_0xb875('0x49')][_0xb875('0x2b')]);}return _0x33608e[_0xb875('0xcc')](_0xf48920);}})[_0xb875('0x1e')](function(_0x2d75dc){if(_0x2d75dc){return _0x2d75dc?{'count':_0x276450,'rows':_0x2d75dc}:null;}})[_0xb875('0x1e')](respondWithResult(_0x5e840e,null))[_0xb875('0x27')](handleError(_0x5e840e,null));};exports[_0xb875('0xce')]=function(_0x22da23,_0x4cd74c,_0x1e0df1){var _0x2766cd;var _0x3807b7;var _0x5e0356;return db[_0xb875('0x5a')][_0xb875('0x3f')]({'where':{'id':_0x22da23[_0xb875('0x61')]['id'],'role':_0xb875('0x37')},'attributes':['id',_0xb875('0x40'),_0xb875('0xcf'),'mobile',_0xb875('0x3e'),_0xb875('0x73'),_0xb875('0xd0')]})['then'](handleEntityNotFound(_0x4cd74c,null))[_0xb875('0x1e')](function(_0x3ec369){if(_0x3ec369){_0x2766cd=_0x3ec369;if(_0x22da23[_0xb875('0x65')]['interface']){_0x5e0356=util[_0xb875('0x71')]('LOCAL/%s@from-sip/n',_0x2766cd[_0x22da23['body'][_0xb875('0x97')]]);}else if(_0x22da23[_0xb875('0x65')][_0xb875('0xd1')]){_0x5e0356=util[_0xb875('0x71')]('SIP/%s',_0x22da23[_0xb875('0x65')]['intrf']);}else{_0x5e0356=util['format']('SIP/%s',_0x2766cd['name']);}socket['to'](util['format'](_0xb875('0xd2'),_0x2766cd[_0xb875('0x40')]))[_0xb875('0xa1')](_0xb875('0xd3'),{'ip':_0x22da23[_0xb875('0xd4')][_0xb875('0xd5')]||_0x22da23[_0xb875('0xd6')][_0xb875('0xd7')]||_0x22da23[_0xb875('0xd8')][_0xb875('0xd7')]||_0x22da23[_0xb875('0xd6')]['socket']['remoteAddress']});return db[_0xb875('0xbe')][_0xb875('0x32')]({'where':{'membername':_0x2766cd['name']},'individualHooks':!![]});}})['then'](function(_0x511a6f){if(_0x2766cd){return _0x2766cd[_0xb875('0xd9')]({'raw':!![]});}})[_0xb875('0x1e')](function(_0x8987c6){var _0x541417=[];if(_0x8987c6){_0x3807b7=_0x8987c6;if(_0x3807b7['length']){for(var _0x1232b1=0x0;_0x1232b1<_0x3807b7['length'];_0x1232b1++){_0x541417['push']({'membername':_0x2766cd['name'],'UserId':_0x2766cd['id'],'queue_name':_0x3807b7[_0x1232b1][_0xb875('0x40')],'VoiceQueueId':_0x3807b7[_0x1232b1]['id'],'interface':_0x5e0356,'paused':_0x2766cd['loginInPause']||![],'penalty':_0x3807b7[_0x1232b1][_0xb875('0xda')]||0x0});}return BPromise[_0xb875('0xdb')](_0x541417,function(_0x41bfed){return db[_0xb875('0xbe')]['upsert'](_0x41bfed);});}}})[_0xb875('0x1e')](function(){return db[_0xb875('0xdc')][_0xb875('0x5e')]({'where':{'membername':_0x2766cd[_0xb875('0x40')],'exitAt':null}});})[_0xb875('0x1e')](function(_0x10fe7f){var _0x1698bc=[];_0x10fe7f['forEach'](function(_0x18badf){_0x1698bc['push'](_0x18badf[_0xb875('0xdd')]({'exitAt':moment()[_0xb875('0x71')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x1698bc);})[_0xb875('0x1e')](function(){var _0x17286f=[];var _0x3cb2ba=[];var _0x4eb0d6=utils[_0xb875('0xde')]();var _0x34bd85={'membername':_0x2766cd[_0xb875('0x40')],'interface':_0x5e0356,'enterAt':moment()[_0xb875('0x71')](_0xb875('0xdf')),'role':_0x2766cd[_0xb875('0x3e')],'internal':_0x2766cd[_0xb875('0x73')]};_0x4eb0d6[_0xb875('0xe0')](function(_0x52d6c1){_0x17286f[_0xb875('0xa4')](_[_0xb875('0x54')]({'channel':_0x52d6c1,'type':'LOGIN','data1':_0x22da23['body'][_0xb875('0xe1')],'data2':_0x5e0356},_0x34bd85));if(_0x2766cd[_0xb875('0xd0')]){_0x3cb2ba['push'](_[_0xb875('0x54')]({'channel':_0x52d6c1,'type':'PAUSE','data1':_0xb875('0xe2')},_0x34bd85));}});return db[_0xb875('0xdc')][_0xb875('0x64')](_0x17286f['concat'](_0x3cb2ba),{'individualHooks':!![]});})[_0xb875('0x1e')](function(){return _0x2766cd[_0xb875('0xdd')]({'online':!![],'lastLoginAt':moment()[_0xb875('0x71')](_0xb875('0xdf')),'voicePause':_0x2766cd[_0xb875('0xd0')]||![],'mailPause':_0x2766cd['loginInPause']||![],'chatPause':_0x2766cd[_0xb875('0xd0')]||![],'faxPause':_0x2766cd[_0xb875('0xd0')]||![],'smsPause':_0x2766cd[_0xb875('0xd0')]||![],'openchannelPause':_0x2766cd[_0xb875('0xd0')]||![],'pauseType':_0x2766cd[_0xb875('0xd0')]?_0xb875('0xe2'):null,'interface':_0x5e0356,'lastPauseAt':moment()['format'](_0xb875('0xdf'))});})[_0xb875('0x1e')](respondWithResult(_0x4cd74c,null))[_0xb875('0x27')](handleError(_0x4cd74c,null));};exports[_0xb875('0xe3')]=function(_0x27042a,_0xfe3374,_0x5c6d87){var _0x2f5303;return db['User'][_0xb875('0x3f')]({'where':{'id':_0x27042a[_0xb875('0x61')]['id'],'role':_0xb875('0x37')},'attributes':['id',_0xb875('0x40'),_0xb875('0x3e')]})[_0xb875('0x1e')](handleEntityNotFound(_0xfe3374,null))[_0xb875('0x1e')](function(_0x5520d6){if(_0x5520d6){_0x2f5303=_0x5520d6;return db[_0xb875('0xbe')][_0xb875('0x32')]({'where':{'membername':_0x2f5303['name']},'individualHooks':!![]});}})[_0xb875('0x1e')](function(){return db[_0xb875('0xdc')]['findAll']({'where':{'membername':_0x2f5303[_0xb875('0x40')],'exitAt':null}});})[_0xb875('0x1e')](function(_0x1a65b7){var _0x2c799d=[];_0x1a65b7['forEach'](function(_0x4713c7){_0x2c799d[_0xb875('0xa4')](_0x4713c7['update']({'exitAt':moment()[_0xb875('0x71')](_0xb875('0xdf'))}));});return BPromise[_0xb875('0xe4')](_0x2c799d);})[_0xb875('0x1e')](function(){return _0x2f5303[_0xb875('0xdd')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0xfe3374,null))['catch'](handleError(_0xfe3374,null));};exports['pause']=function(_0x943946,_0x397b4c,_0x3bd8f3){var _0xbee56f;return db['UserVoiceQueueRt'][_0xb875('0xdd')]({'paused':0x1},{'where':{'UserId':_0x943946[_0xb875('0x61')]['id']},'individualHooks':!![]})[_0xb875('0x1e')](function(){return db[_0xb875('0x5a')][_0xb875('0x3f')]({'where':{'id':_0x943946[_0xb875('0x61')]['id'],'role':'agent'},'attributes':['id',_0xb875('0x40'),_0xb875('0x3e'),_0xb875('0x73'),_0xb875('0x97')]});})['then'](handleEntityNotFound(_0x397b4c,null))[_0xb875('0x1e')](function(_0x3ae321){if(_0x3ae321){_0xbee56f=_0x3ae321;return respondWithRpcPromise('QueuePause',_0xb875('0xe5'),{'id':_0xbee56f['id'],'name':_0xbee56f[_0xb875('0x40')],'pause':!![]});}})['then'](function(){if(_0xbee56f){return db['MemberReport']['findAll']({'where':{'membername':_0xbee56f[_0xb875('0x40')],'type':_0xb875('0xe6'),'exitAt':null}});}})[_0xb875('0x1e')](function(_0x80573a){if(_0x80573a[_0xb875('0x63')]){var _0x4db79a=moment()[_0xb875('0x71')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x47f081=0x0,_0x5132d6=_0x80573a['length'];_0x47f081<_0x5132d6;_0x47f081++){_0x80573a[_0x47f081][_0xb875('0xe7')]({'exitAt':_0x4db79a});}}})['then'](function(){var _0x3430c8=[];var _0x2c11c9=utils['getChannels']();_0x2c11c9['forEach'](function(_0x1c5fac){_0x3430c8[_0xb875('0xa4')]({'channel':_0x1c5fac,'membername':_0xbee56f[_0xb875('0x40')],'interface':_[_0xb875('0x6f')](_0xbee56f['interface'])?util[_0xb875('0x71')](_0xb875('0xe8'),_0xbee56f[_0xb875('0x40')]):_0xbee56f[_0xb875('0x97')],'type':_0xb875('0xe6'),'enterAt':moment()['format'](_0xb875('0xdf')),'data1':_0x943946[_0xb875('0x65')][_0xb875('0xe9')]||'DEFAULT\x20PAUSE','role':_0xbee56f[_0xb875('0x3e')],'internal':_0xbee56f[_0xb875('0x73')]});});return db[_0xb875('0xdc')][_0xb875('0x64')](_0x3430c8,{'individualHooks':!![]});})[_0xb875('0x1e')](function(){return _0xbee56f['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x943946[_0xb875('0x65')][_0xb875('0xe9')]||_0xb875('0xea'),'lastPauseAt':moment()[_0xb875('0x71')](_0xb875('0xdf'))});})[_0xb875('0x1e')](respondWithResult(_0x397b4c,null))[_0xb875('0x27')](handleError(_0x397b4c,null));};exports[_0xb875('0xeb')]=function(_0x42f355,_0x138116,_0x16ad61){var _0x523278;return db['User'][_0xb875('0x3f')]({'where':{'id':_0x42f355[_0xb875('0x61')]['id']},'attributes':['id','name','role',_0xb875('0xa5'),_0xb875('0xec'),'chatPause',_0xb875('0xed'),'openchannelPause',_0xb875('0xee'),_0xb875('0xef'),_0xb875('0xf0')]})[_0xb875('0x1e')](handleEntityNotFound(_0x138116,null))[_0xb875('0x1e')](function(_0x30e19d){if(_0x30e19d){_0x523278=_0x30e19d;if(_0x42f355[_0xb875('0x65')][_0xb875('0x99')]&&!utils[_0xb875('0x98')](_0x42f355[_0xb875('0x65')][_0xb875('0x99')])){throw new db[(_0xb875('0x8e'))][(_0xb875('0x8f'))]('Unknown\x20channel');}switch(_0x42f355[_0xb875('0x65')][_0xb875('0x99')]){case _0xb875('0xa3'):return respondWithRpcPromise('QueuePause',_0xb875('0xeb'),{'id':_0x523278['id'],'name':_0x523278['name'],'pause':![]})[_0xb875('0x1e')](function(){return db[_0xb875('0xbe')][_0xb875('0xdd')]({'paused':0x0},{'where':{'UserId':_0x523278['id']},'individualHooks':!![]});})[_0xb875('0x1e')](function(){return db[_0xb875('0xdc')][_0xb875('0x3f')]({'where':{'channel':_0x42f355['body'][_0xb875('0x99')],'membername':_0x523278[_0xb875('0x40')],'type':_0xb875('0xe6'),'exitAt':null}});})[_0xb875('0x1e')](function(_0x4ce53e){if(_0x4ce53e){return _0x4ce53e[_0xb875('0xdd')]({'exitAt':moment()[_0xb875('0x71')](_0xb875('0xdf')),'data2':_0xb875('0xf1')},{'individualHooks':!![]});}return null;})[_0xb875('0x1e')](function(){return _0x523278['update']({'voicePause':![]});});case _0xb875('0xf2'):case _0xb875('0xf3'):case _0xb875('0xf4'):case _0xb875('0xf5'):case _0xb875('0xf6'):return db[_0xb875('0xdc')][_0xb875('0x3f')]({'where':{'channel':_0x42f355[_0xb875('0x65')][_0xb875('0x99')],'membername':_0x523278['name'],'type':_0xb875('0xe6'),'exitAt':null}})[_0xb875('0x1e')](function(_0x203bc5){if(_0x203bc5){return _0x203bc5[_0xb875('0xdd')]({'exitAt':moment()[_0xb875('0x71')](_0xb875('0xdf')),'data2':_0xb875('0xf1')},{'individualHooks':!![]});}return null;})[_0xb875('0x1e')](function(){var _0x5c3574={};_[_0xb875('0x2d')](_0x5c3574,util[_0xb875('0x71')](_0xb875('0xf7'),_0x42f355[_0xb875('0x65')][_0xb875('0x99')],'Pause'),![]);return _0x523278[_0xb875('0xdd')](_0x5c3574);});default:return respondWithRpcPromise(_0xb875('0xf8'),_0xb875('0xeb'),{'id':_0x523278['id'],'name':_0x523278['name'],'pause':![]})['then'](function(){return db[_0xb875('0xbe')][_0xb875('0xdd')]({'paused':0x0},{'where':{'UserId':_0x523278['id']}});})[_0xb875('0x1e')](function(){return db[_0xb875('0xdc')][_0xb875('0x5e')]({'where':{'membername':_0x523278['name'],'type':_0xb875('0xe6'),'exitAt':null}});})['then'](function(_0x37e5e7){var _0x66ab18=[];_0x37e5e7[_0xb875('0xe0')](function(_0x2a661c){_0x66ab18[_0xb875('0xa4')](_0x2a661c[_0xb875('0xdd')]({'exitAt':moment()[_0xb875('0x71')](_0xb875('0xdf')),'data2':_0xb875('0xf1')}));});return BPromise[_0xb875('0xe4')](_0x66ab18);})[_0xb875('0x1e')](function(){return _0x523278[_0xb875('0xdd')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xb875('0x1e')](respondWithResult(_0x138116,null))[_0xb875('0x27')](handleError(_0x138116,null));};exports[_0xb875('0xf9')]=function(_0x3d86dc,_0x28361b,_0x4f1d24){var _0xaedb45={};var _0xe6ae9d={};var _0x96b955;var _0x5ae843;return db[_0xb875('0x5a')][_0xb875('0xba')]({'where':{'id':_0x3d86dc['params']['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x28361b,null))[_0xb875('0x1e')](function(_0x184d7f){if(_0x184d7f){_0x96b955=_0x184d7f;_0xe6ae9d[_0xb875('0x45')]=_['keys'](db['Team']['rawAttributes']);_0xe6ae9d[_0xb875('0x49')]=_[_0xb875('0x47')](_0x3d86dc[_0xb875('0x49')]);_0xe6ae9d[_0xb875('0x4a')]=_[_0xb875('0x4b')](_0xe6ae9d[_0xb875('0x45')],_0xe6ae9d['query']);_0xaedb45[_0xb875('0x4c')]=_[_0xb875('0x4b')](_0xe6ae9d[_0xb875('0x45')],qs[_0xb875('0x4d')](_0x3d86dc['query']['fields']));_0xaedb45[_0xb875('0x4c')]=_0xaedb45[_0xb875('0x4c')][_0xb875('0x63')]?_0xaedb45[_0xb875('0x4c')]:_0xe6ae9d[_0xb875('0x45')];_0xaedb45[_0xb875('0x50')]=qs[_0xb875('0x51')](_0x3d86dc[_0xb875('0x49')]['sort']);_0xaedb45['where']=qs['filters'](_[_0xb875('0x52')](_0x3d86dc[_0xb875('0x49')],_0xe6ae9d[_0xb875('0x4a')]));if(_0x3d86dc['query']['filter']){_0xaedb45['where']=_[_0xb875('0x54')](_0xaedb45[_0xb875('0x53')],{'$or':_[_0xb875('0x3b')](_0xaedb45[_0xb875('0x4c')],function(_0x387a1c){var _0x1b6074={};_0x1b6074[_0x387a1c]={'$like':'%'+_0x3d86dc[_0xb875('0x49')][_0xb875('0x39')]+'%'};return _0x1b6074;})});}_0xaedb45=_[_0xb875('0x54')]({},_0xaedb45,_0x3d86dc[_0xb875('0x59')]);return _0x96b955[_0xb875('0xf9')](_0xaedb45);}})[_0xb875('0x1e')](function(_0x5f4d7a){if(_0x5f4d7a){_0x5ae843=_0x5f4d7a['length'];if(!_0x3d86dc[_0xb875('0x49')][_0xb875('0x4e')](_0xb875('0x4f'))){_0xaedb45['limit']=qs[_0xb875('0x2c')](_0x3d86dc[_0xb875('0x49')][_0xb875('0x2c')]);_0xaedb45[_0xb875('0x2b')]=qs[_0xb875('0x2b')](_0x3d86dc[_0xb875('0x49')]['offset']);}return _0x96b955['getTeams'](_0xaedb45);}})['then'](function(_0x2c6a77){if(_0x2c6a77){return _0x2c6a77?{'count':_0x5ae843,'rows':_0x2c6a77}:null;}})[_0xb875('0x1e')](respondWithResult(_0x28361b,null))[_0xb875('0x27')](handleError(_0x28361b,null));};exports['addTeams']=function(_0x6f83c0,_0x3b1b18,_0x38a5f0){return db[_0xb875('0x5a')][_0xb875('0x3f')]({'where':{'id':_0x6f83c0[_0xb875('0x61')]['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x3b1b18,null))[_0xb875('0x1e')](function(_0xd35a9f){if(_0xd35a9f){return _0xd35a9f['addTeams'](_0x6f83c0[_0xb875('0x65')][_0xb875('0x68')],_[_0xb875('0xfa')](_0x6f83c0[_0xb875('0x65')],['ids','id'])||{});}})[_0xb875('0x1e')](respondWithResult(_0x3b1b18,null))[_0xb875('0x27')](handleError(_0x3b1b18,null));};exports['removeTeams']=function(_0x333444,_0x474f06,_0x581c39){var _0x267628;return db[_0xb875('0x5a')][_0xb875('0x3f')]({'where':{'id':_0x333444[_0xb875('0x61')]['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x474f06,null))[_0xb875('0x1e')](function(_0x17e98d){if(_0x17e98d){return _0x17e98d['removeTeams'](_0x333444[_0xb875('0x49')]['ids']);}})[_0xb875('0x1e')](respondWithStatusCode(_0x474f06,null))[_0xb875('0x27')](handleError(_0x474f06,null));};exports[_0xb875('0xfb')]=function(_0x5e652f,_0x2f275c,_0x3f8734){var _0x44b10d={};var _0x206656={};var _0x2063f5;var _0x546615;return db[_0xb875('0x5a')][_0xb875('0xba')]({'where':{'id':_0x5e652f[_0xb875('0x61')]['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x2f275c,null))['then'](function(_0x469d6c){if(_0x469d6c){_0x2063f5=_0x469d6c;_0x206656['model']=_[_0xb875('0x47')](db[_0xb875('0xb4')][_0xb875('0x44')]);_0x206656[_0xb875('0x49')]=_[_0xb875('0x47')](_0x5e652f['query']);_0x206656[_0xb875('0x4a')]=_[_0xb875('0x4b')](_0x206656['model'],_0x206656[_0xb875('0x49')]);_0x44b10d[_0xb875('0x4c')]=_[_0xb875('0x4b')](_0x206656[_0xb875('0x45')],qs['fields'](_0x5e652f[_0xb875('0x49')][_0xb875('0x4d')]));_0x44b10d['attributes']=_0x44b10d[_0xb875('0x4c')][_0xb875('0x63')]?_0x44b10d[_0xb875('0x4c')]:_0x206656[_0xb875('0x45')];_0x44b10d[_0xb875('0x50')]=qs[_0xb875('0x51')](_0x5e652f[_0xb875('0x49')][_0xb875('0x51')]);_0x44b10d['where']=qs[_0xb875('0x4a')](_[_0xb875('0x52')](_0x5e652f[_0xb875('0x49')],_0x206656[_0xb875('0x4a')]));if(_0x5e652f[_0xb875('0x49')][_0xb875('0x39')]){_0x44b10d[_0xb875('0x53')]=_[_0xb875('0x54')](_0x44b10d[_0xb875('0x53')],{'$or':_[_0xb875('0x3b')](_0x44b10d[_0xb875('0x4c')],function(_0x547330){var _0x46ebd0={};_0x46ebd0[_0x547330]={'$like':'%'+_0x5e652f['query']['filter']+'%'};return _0x46ebd0;})});}_0x44b10d=_[_0xb875('0x54')]({},_0x44b10d,_0x5e652f['options']);return _0x2063f5[_0xb875('0xfb')](_0x44b10d);}})[_0xb875('0x1e')](function(_0x4e0635){if(_0x4e0635){_0x546615=_0x4e0635['length'];if(!_0x5e652f[_0xb875('0x49')]['hasOwnProperty'](_0xb875('0x4f'))){_0x44b10d['limit']=qs[_0xb875('0x2c')](_0x5e652f[_0xb875('0x49')][_0xb875('0x2c')]);_0x44b10d[_0xb875('0x2b')]=qs[_0xb875('0x2b')](_0x5e652f[_0xb875('0x49')][_0xb875('0x2b')]);}return _0x2063f5[_0xb875('0xfb')](_0x44b10d);}})[_0xb875('0x1e')](function(_0x484ad){if(_0x484ad){return _0x484ad?{'count':_0x546615,'rows':_0x484ad}:null;}})['then'](respondWithResult(_0x2f275c,null))[_0xb875('0x27')](handleError(_0x2f275c,null));};exports[_0xb875('0xfc')]=function(_0x210e62,_0x25f89b,_0x12e8fe){var _0x2915e0={};var _0x1ee49d={};var _0x198d48;var _0x57f0c3;return db[_0xb875('0x5a')][_0xb875('0xba')]({'where':{'id':_0x210e62['params']['id']}})[_0xb875('0x1e')](handleEntityNotFound(_0x25f89b,null))[_0xb875('0x1e')](function(_0x155539){if(_0x155539){_0x198d48=_0x155539;_0x1ee49d['model']=_[_0xb875('0x47')](db[_0xb875('0x5a')][_0xb875('0x44')]);_0x1ee49d[_0xb875('0x49')]=_['keys'](_0x210e62[_0xb875('0x49')]);_0x1ee49d[_0xb875('0x4a')]=_[_0xb875('0x4b')](_0x1ee49d[_0xb875('0x45')],_0x1ee49d[_0xb875('0x49')]);_0x2915e0[_0xb875('0x4c')]=_[_0xb875('0x4b')](_0x1ee49d[_0xb875('0x45')],qs[_0xb875('0x4d')](_0x210e62['query']['fields']));_0x2915e0[_0xb875('0x4c')]=_0x2915e0['attributes'][_0xb875('0x63')]?_0x2915e0[_0xb875('0x4c')]:_0x1ee49d[_0xb875('0x45')];_0x2915e0['order']=qs['sort'](_0x210e62[_0xb875('0x49')][_0xb875('0x51')]);_0x2915e0[_0xb875('0x53')]=qs[_0xb875('0x4a')](_[_0xb875('0x52')](_0x210e62[_0xb875('0x49')],_0x1ee49d[_0xb875('0x4a')]));if(_0x210e62[_0xb875('0x49')][_0xb875('0x39')]){_0x2915e0['where']=_[_0xb875('0x54')](_0x2915e0[_0xb875('0x53')],{'$or':_['map'](_0x2915e0['attributes'],function(_0x24b64d){var _0x27b8c9={};_0x27b8c9[_0x24b64d]={'$like':'%'+_0x210e62[_0xb875('0x49')][_0xb875('0x39')]+'%'};return _0x27b8c9;})});}_0x2915e0[_0xb875('0x45')]=db[_0xb875('0x5a')];_0x2915e0['as']=_0xb875('0x36');_0x2915e0=_[_0xb875('0x54')]({},_0x2915e0,_0x210e62[_0xb875('0x59')]);return _0x198d48[_0xb875('0xd9')]({'include':[_0x2915e0]});}})[_0xb875('0x1e')](function(_0x503340){if(_0x503340){var _0x35107e={},_0xb29f02=[],_0x14392e=0x0;for(var _0x3c33cd=0x0;_0x3c33cd<_0x503340[_0xb875('0x63')];_0x3c33cd+=0x1){for(var _0x6b10a4=0x0,_0x60145d;_0x6b10a4<_0x503340[_0x3c33cd][_0xb875('0x36')][_0xb875('0x63')];_0x6b10a4+=0x1){_0x60145d=_0x503340[_0x3c33cd][_0xb875('0x36')][_0x6b10a4]['get']({'plain':!![]});_0x35107e[_0x60145d['id']]=_0x60145d;}}_0x35107e=_[_0xb875('0xfd')](_0x35107e);for(var _0x332b4f=qs[_0xb875('0x2b')](_0x210e62[_0xb875('0x49')][_0xb875('0x2b')]);_0x332b4f<_0x35107e['length']&&_0xb29f02[_0xb875('0x63')]=_0x24f75[_0x0d8b('0x4e')]){throw new Error(_0x0d8b('0x4f'));}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x2b')]['destroy']({'where':{'membername':_0x156859[_0x0d8b('0x27')]},'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['getVoiceQueues']({'raw':!![]});}})[_0x0d8b('0xd')](function(_0x105df9){if(_0x156859){if(_0x105df9){var _0x303d6=[];_0x40d265=_0x105df9;if(_0x40d265[_0x0d8b('0x2d')]){for(var _0x16141a=0x0;_0x16141a<_0x40d265[_0x0d8b('0x2d')];_0x16141a++){_0x303d6[_0x0d8b('0x2f')](db[_0x0d8b('0x2b')][_0x0d8b('0x50')]({'membername':_0x156859[_0x0d8b('0x27')],'UserId':_0x156859['id'],'queue_name':_0x40d265[_0x16141a][_0x0d8b('0x27')],'VoiceQueueId':_0x40d265[_0x16141a]['id'],'interface':_0x1ca60c,'paused':_0x156859[_0x0d8b('0x4a')]||![],'penalty':_0x40d265[_0x16141a]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0d8b('0x47')](_0x303d6);}}}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x35')]['findAll']({'where':{'membername':_0x156859['name'],'exitAt':null}});}})[_0x0d8b('0xd')](function(_0x3aeb45){if(_0x156859){if(_0x3aeb45&&_0x3aeb45[_0x0d8b('0x2d')]){var _0x5b76af=[];_0x3aeb45['forEach'](function(_0x42de18){_0x5b76af[_0x0d8b('0x2f')](_0x42de18[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31'))}));});return BPromise[_0x0d8b('0x47')](_0x5b76af);}}})[_0x0d8b('0xd')](function(_0x2c826b){if(_0x156859){var _0x20a3dd=[];var _0x3a5aea=[];var _0x195901=utils[_0x0d8b('0x51')]();var _0x3b060e={'membername':_0x156859['name'],'interface':_0x1ca60c,'enterAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'role':_0x156859['role'],'internal':_0x156859['internal']};_0x195901[_0x0d8b('0x2e')](function(_0x1dad9f){_0x20a3dd[_0x0d8b('0x2f')](_[_0x0d8b('0x52')]({'channel':_0x1dad9f,'type':_0x0d8b('0x53'),'data1':_0x0d8b('0x54'),'data2':_0x1ca60c},_0x3b060e));if(_0x156859['loginInPause']){_0x3a5aea['push'](_['merge']({'channel':_0x1dad9f,'type':_0x0d8b('0x44'),'data1':_0x0d8b('0x55')},_0x3b060e));}});return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x20a3dd[_0x0d8b('0x56')](_0x3a5aea),{'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['update']({'online':!![],'lastLoginAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'voicePause':_0x156859['loginInPause']||![],'mailPause':_0x156859[_0x0d8b('0x4a')]||![],'chatPause':_0x156859['loginInPause']||![],'faxPause':_0x156859[_0x0d8b('0x4a')]||![],'smsPause':_0x156859[_0x0d8b('0x4a')]||![],'openchannelPause':_0x156859[_0x0d8b('0x4a')]||![],'pauseType':_0x156859[_0x0d8b('0x4a')]?_0x0d8b('0x55'):null,'lastPauseAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'interface':_0x1ca60c});}})[_0x0d8b('0xd')](function(_0x391121){_0x435090(_0x391121);})[_0x0d8b('0x18')](function(_0x276558){_0x2ab72b(_0x70e4b2[_0x0d8b('0x14')](0x1f4,_0x276558['message']));});});}; \ No newline at end of file +var _0x5f2f=['set','%s%s','Pause','all','LogoutUser','findOne','destroy','LoginUser','mobile','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','LOGIN','callysquare','merge','LOGININPAUSE','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','User','findAll','options','raw','where','attributes','limit','include','map','model','GetUser','find','ShowUser','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','MemberReport','bulkCreate','isValidChannel','channel','Unknown\x20channel','voice','system','mail','chat','fax','openchannel'];(function(_0x4abcf1,_0x52c2b9){var _0x335d0c=function(_0x52d1b2){while(--_0x52d1b2){_0x4abcf1['push'](_0x4abcf1['shift']());}};_0x335d0c(++_0x52c2b9);}(_0x5f2f,0x73));var _0xf5f2=function(_0xdb93c5,_0x2efa9b){_0xdb93c5=_0xdb93c5-0x0;var _0x384014=_0x5f2f[_0xdb93c5];return _0x384014;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./user.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['GetUser']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')]({'raw':_0x34706d['options']?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![],'where':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x21')]||null:null,'attributes':_0x34706d['options']?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x22')]||null:null,'limit':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x23')]||null:null,'include':_0x34706d['options']?_0x34706d['options'][_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x24')],function(_0xf6c58d){return{'model':db[_0xf6c58d[_0xf5f2('0x26')]],'as':_0xf6c58d['as'],'attributes':_0xf6c58d[_0xf5f2('0x22')],'include':_0xf6c58d[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0xf6c58d['include'],function(_0xaa2602){return{'model':db[_0xaa2602[_0xf5f2('0x26')]],'as':_0xaa2602['as'],'attributes':_0xaa2602[_0xf5f2('0x22')],'include':_0xaa2602[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0xaa2602[_0xf5f2('0x24')],function(_0x5b6672){return{'model':db[_0x5b6672['model']],'as':_0x5b6672['as'],'attributes':_0x5b6672[_0xf5f2('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x11')](function(_0x11c771){logger['info']('GetUser',_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x27'),_0x34706d,JSON[_0xf5f2('0x16')](_0x11c771));_0x49dac2(_0x11c771);})[_0xf5f2('0x1c')](function(_0x1b381e){logger['error']('GetUser',_0x1b381e[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e['error'](0x1f4,_0x1b381e[_0xf5f2('0x19')]));});});};exports['ShowUser']=function(_0x45b643){var _0x31087c=this;return new Promise(function(_0x7b6817,_0x428770){return db[_0xf5f2('0x1d')][_0xf5f2('0x28')]({'raw':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')][_0xf5f2('0x21')]||null:null,'attributes':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')][_0xf5f2('0x22')]||null:null,'include':_0x45b643[_0xf5f2('0x1f')]?_0x45b643['options'][_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x45b643['options'][_0xf5f2('0x24')],function(_0x4b8c42){return{'model':db[_0x4b8c42[_0xf5f2('0x26')]],'as':_0x4b8c42['as'],'attributes':_0x4b8c42[_0xf5f2('0x22')],'include':_0x4b8c42[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x4b8c42['include'],function(_0x5a98d7){return{'model':db[_0x5a98d7[_0xf5f2('0x26')]],'as':_0x5a98d7['as'],'attributes':_0x5a98d7[_0xf5f2('0x22')],'include':_0x5a98d7[_0xf5f2('0x24')]?_['map'](_0x5a98d7[_0xf5f2('0x24')],function(_0x4f7f80){return{'model':db[_0x4f7f80[_0xf5f2('0x26')]],'as':_0x4f7f80['as'],'attributes':_0x4f7f80['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x11')](function(_0x456764){logger['info'](_0xf5f2('0x29'),_0x45b643);logger[_0xf5f2('0x14')](_0xf5f2('0x29'),_0x45b643,JSON[_0xf5f2('0x16')](_0x456764));_0x7b6817(_0x456764);})['catch'](function(_0x5d2d82){logger[_0xf5f2('0x17')](_0xf5f2('0x29'),_0x5d2d82[_0xf5f2('0x19')],_0x45b643);_0x428770(_0x31087c[_0xf5f2('0x17')](0x1f4,_0x5d2d82[_0xf5f2('0x19')]));});});};exports[_0xf5f2('0x2a')]=function(_0x2bc20e){var _0x4c0ac7=this;return new Promise(function(_0x110fe5,_0x3b4ea6){var _0x536501;return db[_0xf5f2('0x1d')][_0xf5f2('0x28')]({'where':_0x2bc20e[_0xf5f2('0x1f')][_0xf5f2('0x21')]||{},'attributes':['id',_0xf5f2('0x2b'),_0xf5f2('0x2c'),_0xf5f2('0x2d'),_0xf5f2('0x2e')]})['then'](function(_0x31c3c){if(_0x31c3c){_0x536501=_0x31c3c;return db[_0xf5f2('0x2f')][_0xf5f2('0x30')]({'paused':0x1},{'where':{'UserId':_0x536501['id']},'individualHooks':!![]});}})['then'](function(){if(_0x536501){return db['MemberReport']['findAll']({'where':{'membername':_0x536501[_0xf5f2('0x2b')],'type':_0xf5f2('0x31'),'exitAt':null}});}})['then'](function(_0x106272){if(_0x536501){if(_0x106272&&_0x106272[_0xf5f2('0x32')]){var _0x28e33f=moment()[_0xf5f2('0x33')](_0xf5f2('0x34'));for(var _0x2b3b1c=0x0,_0x1a6ec1=_0x106272[_0xf5f2('0x32')];_0x2b3b1c<_0x1a6ec1;_0x2b3b1c++){_0x106272[_0x2b3b1c][_0xf5f2('0x35')]({'exitAt':_0x28e33f});}}}})[_0xf5f2('0x11')](function(){if(_0x536501){var _0x444317=[];var _0x4773cd=utils[_0xf5f2('0x36')]();_0x4773cd[_0xf5f2('0x37')](function(_0x4faeed){_0x444317[_0xf5f2('0x38')]({'channel':_0x4faeed,'membername':_0x536501['name'],'interface':_[_0xf5f2('0x39')](_0x536501[_0xf5f2('0x2e')])?util[_0xf5f2('0x33')](_0xf5f2('0x3a'),_0x536501[_0xf5f2('0x2b')]):_0x536501[_0xf5f2('0x2e')],'type':'PAUSE','enterAt':moment()[_0xf5f2('0x33')](_0xf5f2('0x34')),'data1':_0x2bc20e[_0xf5f2('0x3b')][_0xf5f2('0x3c')]||_0xf5f2('0x3d'),'role':_0x536501[_0xf5f2('0x2c')],'internal':_0x536501[_0xf5f2('0x2d')],'uniqueid':_0x2bc20e[_0xf5f2('0x3b')]['uniqueid']||null});});return db[_0xf5f2('0x3e')][_0xf5f2('0x3f')](_0x444317,{'individualHooks':!![]});}})[_0xf5f2('0x11')](function(){if(_0x536501){return _0x536501['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x2bc20e[_0xf5f2('0x3b')][_0xf5f2('0x3c')]||_0xf5f2('0x3d'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xf5f2('0x11')](function(_0x27c472){_0x110fe5(_0x27c472);})['catch'](function(_0x14aa81){_0x3b4ea6(_0x4c0ac7['error'](0x1f4,_0x14aa81[_0xf5f2('0x19')]));});});};exports['UnpauseUser']=function(_0x2cbd9d){var _0x5d9120=this;return new Promise(function(_0x2d9017,_0xb8ea3a){var _0xbb658c;return db[_0xf5f2('0x1d')]['findOne']({'where':_0x2cbd9d[_0xf5f2('0x1f')][_0xf5f2('0x21')]||{},'attributes':['id','name']})['then'](function(_0xc3d4f){if(_0xc3d4f){_0xbb658c=_0xc3d4f;if(_0x2cbd9d[_0xf5f2('0x3b')]['channel']&&!utils[_0xf5f2('0x40')](_0x2cbd9d[_0xf5f2('0x3b')][_0xf5f2('0x41')])){throw new Error(_0xf5f2('0x42'));}switch(_0x2cbd9d['body']['channel']){case _0xf5f2('0x43'):return db[_0xf5f2('0x2f')]['update']({'paused':0x0},{'where':{'UserId':_0xbb658c['id']}})[_0xf5f2('0x11')](function(){return db[_0xf5f2('0x3e')][_0xf5f2('0x28')]({'where':{'channel':_0x2cbd9d[_0xf5f2('0x3b')][_0xf5f2('0x41')],'membername':_0xbb658c[_0xf5f2('0x2b')],'type':_0xf5f2('0x31'),'exitAt':null}});})['then'](function(_0x59e8ef){if(_0x59e8ef){return _0x59e8ef[_0xf5f2('0x30')]({'exitAt':moment()[_0xf5f2('0x33')](_0xf5f2('0x34')),'data2':_0xf5f2('0x44')},{'individualHooks':!![]});}return null;})[_0xf5f2('0x11')](function(){return _0xbb658c['update']({'voicePause':![]});});case _0xf5f2('0x45'):case _0xf5f2('0x46'):case _0xf5f2('0x47'):case'sms':case _0xf5f2('0x48'):return db['MemberReport'][_0xf5f2('0x28')]({'where':{'channel':_0x2cbd9d[_0xf5f2('0x3b')][_0xf5f2('0x41')],'membername':_0xbb658c[_0xf5f2('0x2b')],'type':'PAUSE','exitAt':null}})['then'](function(_0x756f1f){return _0x756f1f['update']({'exitAt':moment()[_0xf5f2('0x33')](_0xf5f2('0x34')),'data2':'system'},{'individualHooks':!![]});})[_0xf5f2('0x11')](function(){var _0xa4c0be={};_[_0xf5f2('0x49')](_0xa4c0be,util['format'](_0xf5f2('0x4a'),_0x2cbd9d[_0xf5f2('0x3b')][_0xf5f2('0x41')],_0xf5f2('0x4b')),![]);return _0xbb658c['update'](_0xa4c0be);});default:return db[_0xf5f2('0x2f')]['update']({'paused':0x0},{'where':{'UserId':_0xbb658c['id']}})[_0xf5f2('0x11')](function(){return db[_0xf5f2('0x3e')][_0xf5f2('0x1e')]({'where':{'membername':_0xbb658c[_0xf5f2('0x2b')],'type':_0xf5f2('0x31'),'exitAt':null}});})['then'](function(_0xda8dda){var _0xacd80=[];_0xda8dda[_0xf5f2('0x37')](function(_0x212639){_0xacd80[_0xf5f2('0x38')](_0x212639['update']({'exitAt':moment()[_0xf5f2('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'}));});return BPromise[_0xf5f2('0x4c')](_0xacd80);})['then'](function(){return _0xbb658c[_0xf5f2('0x30')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xf5f2('0x11')](function(_0x420784){_0x2d9017(_0x420784);})[_0xf5f2('0x1c')](function(_0x5767fc){_0xb8ea3a(_0x5d9120[_0xf5f2('0x17')](0x1f4,_0x5767fc[_0xf5f2('0x19')]));});});};exports[_0xf5f2('0x4d')]=function(_0x18c41f){var _0x15b680=this;return new Promise(function(_0x35d868,_0x158768){var _0x4a7be9;return db[_0xf5f2('0x1d')][_0xf5f2('0x4e')]({'where':_0x18c41f[_0xf5f2('0x1f')][_0xf5f2('0x21')]||{},'attributes':['id','name']})[_0xf5f2('0x11')](function(_0x4cce08){if(_0x4cce08){_0x4a7be9=_0x4cce08;return db[_0xf5f2('0x2f')][_0xf5f2('0x4f')]({'where':{'membername':_0x4a7be9['name']},'individualHooks':!![]});}})[_0xf5f2('0x11')](function(){if(_0x4a7be9){return db[_0xf5f2('0x3e')][_0xf5f2('0x1e')]({'where':{'membername':_0x4a7be9[_0xf5f2('0x2b')],'exitAt':null}});}})[_0xf5f2('0x11')](function(_0x4bd113){if(_0x4a7be9){if(_0x4bd113&&_0x4bd113[_0xf5f2('0x32')]){var _0x21c107=[];_0x4bd113[_0xf5f2('0x37')](function(_0xbf9f55){_0x21c107[_0xf5f2('0x38')](_0xbf9f55[_0xf5f2('0x30')]({'exitAt':moment()['format'](_0xf5f2('0x34'))}));});return BPromise[_0xf5f2('0x4c')](_0x21c107);}}})['then'](function(){if(_0x4a7be9){return _0x4a7be9[_0xf5f2('0x30')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xf5f2('0x11')](function(_0x377aad){_0x35d868(_0x377aad);})['catch'](function(_0x551cc9){_0x158768(_0x15b680['error'](0x1f4,_0x551cc9[_0xf5f2('0x19')]));});});};exports[_0xf5f2('0x50')]=function(_0x35f6a2){var _0x450691=this;return new Promise(function(_0x55da4d,_0x4d878e){var _0x278b76;var _0x3a98b4;var _0xc10cf3;var _0xe8a9b7;return db[_0xf5f2('0x1d')][_0xf5f2('0x4e')]({'where':_0x35f6a2[_0xf5f2('0x1f')][_0xf5f2('0x21')]||{},'attributes':['id',_0xf5f2('0x2b'),_0xf5f2('0x2c'),_0xf5f2('0x51'),'phone','internal','loginInPause',_0xf5f2('0x2e')]})[_0xf5f2('0x11')](function(_0x3d3181){if(_0x3d3181){_0x278b76=_0x3d3181;_0xe8a9b7=_0x35f6a2[_0xf5f2('0x3b')][_0xf5f2('0x2e')]?_0x35f6a2['body'][_0xf5f2('0x2e')]:util[_0xf5f2('0x33')](_0xf5f2('0x3a'),_0x278b76[_0xf5f2('0x2b')]);return db[_0xf5f2('0x1d')]['count']({'where':{'role':_0xf5f2('0x52'),'online':!![],'id':{'$ne':_0x278b76['id']}}});}})[_0xf5f2('0x11')](function(_0x517c15){if(_0x517c15){_0xc10cf3=_0x517c15;return require(_0xf5f2('0x53'))[_0xf5f2('0x54')]();}})[_0xf5f2('0x11')](function(_0x30ac41){if(_0x30ac41&&_0x30ac41['agents']&&_0xc10cf3>=_0x30ac41[_0xf5f2('0x55')]){throw new Error(_0xf5f2('0x56'));}})[_0xf5f2('0x11')](function(){if(_0x278b76){return db[_0xf5f2('0x2f')][_0xf5f2('0x4f')]({'where':{'membername':_0x278b76['name']},'individualHooks':!![]});}})['then'](function(){if(_0x278b76){return _0x278b76[_0xf5f2('0x57')]({'raw':!![]});}})[_0xf5f2('0x11')](function(_0x17eb69){if(_0x278b76){if(_0x17eb69){var _0xe3ea1e=[];_0x3a98b4=_0x17eb69;if(_0x3a98b4['length']){for(var _0x5a2f9f=0x0;_0x5a2f9f<_0x3a98b4[_0xf5f2('0x32')];_0x5a2f9f++){_0xe3ea1e['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x278b76['name'],'UserId':_0x278b76['id'],'queue_name':_0x3a98b4[_0x5a2f9f][_0xf5f2('0x2b')],'VoiceQueueId':_0x3a98b4[_0x5a2f9f]['id'],'interface':_0xe8a9b7,'paused':_0x278b76[_0xf5f2('0x58')]||![],'penalty':_0x3a98b4[_0x5a2f9f][_0xf5f2('0x59')]||0x0}));}return BPromise[_0xf5f2('0x4c')](_0xe3ea1e);}}}})[_0xf5f2('0x11')](function(){if(_0x278b76){return db[_0xf5f2('0x3e')][_0xf5f2('0x1e')]({'where':{'membername':_0x278b76[_0xf5f2('0x2b')],'exitAt':null}});}})[_0xf5f2('0x11')](function(_0x26b251){if(_0x278b76){if(_0x26b251&&_0x26b251[_0xf5f2('0x32')]){var _0x2afeac=[];_0x26b251[_0xf5f2('0x37')](function(_0x1680a6){_0x2afeac[_0xf5f2('0x38')](_0x1680a6[_0xf5f2('0x30')]({'exitAt':moment()[_0xf5f2('0x33')](_0xf5f2('0x34'))}));});return BPromise['all'](_0x2afeac);}}})[_0xf5f2('0x11')](function(_0x35299d){if(_0x278b76){var _0x21043b=[];var _0x2811ad=[];var _0x18c353=utils[_0xf5f2('0x36')]();var _0x16491c={'membername':_0x278b76[_0xf5f2('0x2b')],'interface':_0xe8a9b7,'enterAt':moment()['format'](_0xf5f2('0x34')),'role':_0x278b76['role'],'internal':_0x278b76['internal']};_0x18c353['forEach'](function(_0x53449e){_0x21043b['push'](_['merge']({'channel':_0x53449e,'type':_0xf5f2('0x5a'),'data1':_0xf5f2('0x5b'),'data2':_0xe8a9b7},_0x16491c));if(_0x278b76[_0xf5f2('0x58')]){_0x2811ad[_0xf5f2('0x38')](_[_0xf5f2('0x5c')]({'channel':_0x53449e,'type':_0xf5f2('0x31'),'data1':'LOGININPAUSE'},_0x16491c));}});return db['MemberReport'][_0xf5f2('0x3f')](_0x21043b['concat'](_0x2811ad),{'individualHooks':!![]});}})[_0xf5f2('0x11')](function(){if(_0x278b76){return _0x278b76[_0xf5f2('0x30')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x278b76[_0xf5f2('0x58')]||![],'mailPause':_0x278b76[_0xf5f2('0x58')]||![],'chatPause':_0x278b76['loginInPause']||![],'faxPause':_0x278b76[_0xf5f2('0x58')]||![],'smsPause':_0x278b76[_0xf5f2('0x58')]||![],'openchannelPause':_0x278b76['loginInPause']||![],'pauseType':_0x278b76[_0xf5f2('0x58')]?_0xf5f2('0x5d'):null,'lastPauseAt':moment()[_0xf5f2('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0xe8a9b7});}})[_0xf5f2('0x11')](function(_0xc28adc){_0x55da4d(_0xc28adc);})[_0xf5f2('0x1c')](function(_0x3247c4){_0x4d878e(_0x450691[_0xf5f2('0x17')](0x1f4,_0x3247c4[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index ff4fd6a..3dc90fb 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 _0x5843=['user:','save','emit','length'];(function(_0x5268b2,_0x53cd27){var _0x140d15=function(_0x3fa532){while(--_0x3fa532){_0x5268b2['push'](_0x5268b2['shift']());}};_0x140d15(++_0x53cd27);}(_0x5843,0x1d5));var _0x3584=function(_0x769562,_0x478886){_0x769562=_0x769562-0x0;var _0x310906=_0x5843[_0x769562];return _0x310906;};'use strict';var UserEvents=require('./user.events');var events=[_0x3584('0x0'),'remove','update'];function createListener(_0x3ace27,_0x53dabc){return function(_0x12a38c){_0x53dabc[_0x3584('0x1')](_0x3ace27,_0x12a38c);};}function removeListener(_0x30a259,_0x3f14dd){return function(){UserEvents['removeListener'](_0x30a259,_0x3f14dd);};}exports['register']=function(_0x5a1fb3){for(var _0x151405=0x0,_0x5a7372=events[_0x3584('0x2')];_0x151405<_0x5a7372;_0x151405++){var _0x5d6e6f=events[_0x151405];var _0x4c5775=createListener(_0x3584('0x3')+_0x5d6e6f,_0x5a1fb3);UserEvents['on'](_0x5d6e6f,_0x4c5775);}}; \ No newline at end of file +var _0xbfed=['length','user:','remove','update','emit','register'];(function(_0x6b072e,_0x3ed7a9){var _0x49b8bf=function(_0x559487){while(--_0x559487){_0x6b072e['push'](_0x6b072e['shift']());}};_0x49b8bf(++_0x3ed7a9);}(_0xbfed,0x1b8));var _0xdbfe=function(_0x19a90e,_0xe14b0b){_0x19a90e=_0x19a90e-0x0;var _0xa49b11=_0xbfed[_0x19a90e];return _0xa49b11;};'use strict';var UserEvents=require('./user.events');var events=['save',_0xdbfe('0x0'),_0xdbfe('0x1')];function createListener(_0x11826e,_0x4a0f1a){return function(_0x104d0f){_0x4a0f1a[_0xdbfe('0x2')](_0x11826e,_0x104d0f);};}function removeListener(_0xcb7b31,_0x4ca3cc){return function(){UserEvents['removeListener'](_0xcb7b31,_0x4ca3cc);};}exports[_0xdbfe('0x3')]=function(_0x575b13){for(var _0x1705d5=0x0,_0x181a1a=events[_0xdbfe('0x4')];_0x1705d5<_0x181a1a;_0x1705d5++){var _0x28d36c=events[_0x1705d5];var _0x28228a=createListener(_0xdbfe('0x5')+_0x28d36c,_0x575b13);UserEvents['on'](_0x28d36c,_0x28228a);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 1dcee8e..91e374e 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 _0xb091=['util','path','connect-timeout','express','../../components/auth/service','exports'];(function(_0x1c78ed,_0x3a2cbe){var _0x3cf110=function(_0x3972c0){while(--_0x3972c0){_0x1c78ed['push'](_0x1c78ed['shift']());}};_0x3cf110(++_0x3a2cbe);}(_0xb091,0x16e));var _0x1b09=function(_0x1ba782,_0xc39af0){_0x1ba782=_0x1ba782-0x0;var _0x187378=_0xb091[_0x1ba782];return _0x187378;};'use strict';var multer=require('multer');var util=require(_0x1b09('0x0'));var path=require(_0x1b09('0x1'));var timeout=require(_0x1b09('0x2'));var express=require(_0x1b09('0x3'));var router=express['Router']();var auth=require(_0x1b09('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x1b09('0x5')]=router; \ No newline at end of file +var _0xb470=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','exports','multer','util','path'];(function(_0x155f58,_0x4d0489){var _0x51fb9d=function(_0x5d93ae){while(--_0x5d93ae){_0x155f58['push'](_0x155f58['shift']());}};_0x51fb9d(++_0x4d0489);}(_0xb470,0x75));var _0x0b47=function(_0x1e05b6,_0x2cf429){_0x1e05b6=_0x1e05b6-0x0;var _0x195b63=_0xb470[_0x1e05b6];return _0x195b63;};'use strict';var multer=require(_0x0b47('0x0'));var util=require(_0x0b47('0x1'));var path=require(_0x0b47('0x2'));var timeout=require(_0x0b47('0x3'));var express=require('express');var router=express[_0x0b47('0x4')]();var auth=require(_0x0b47('0x5'));var interaction=require(_0x0b47('0x6'));var config=require('../../config/environment');module[_0x0b47('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 76bc20f..60497b2 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 _0xf024=['sequelize','exports','INTEGER'];(function(_0x27b0e6,_0x5408e8){var _0x4fd0c2=function(_0x2196fd){while(--_0x2196fd){_0x27b0e6['push'](_0x27b0e6['shift']());}};_0x4fd0c2(++_0x5408e8);}(_0xf024,0x10e));var _0x4f02=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xf024[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0x4f02('0x0'));module[_0x4f02('0x1')]={'penalty':{'type':Sequelize[_0x4f02('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x961c=['exports','sequelize'];(function(_0x3bb962,_0x49cb14){var _0x2106b0=function(_0x4aba78){while(--_0x4aba78){_0x3bb962['push'](_0x3bb962['shift']());}};_0x2106b0(++_0x49cb14);}(_0x961c,0xe1));var _0xc961=function(_0x32dc42,_0x83a9dc){_0x32dc42=_0x32dc42-0x0;var _0x5af3d6=_0x961c[_0x32dc42];return _0x5af3d6;};'use strict';var Sequelize=require(_0xc961('0x0'));module[_0xc961('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 75a9860..a75da80 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 _0x02a7=['../../config/logger','api','moment','bluebird','request-promise','./userChatQueue.attributes','exports','user_has_chat_queues','util'];(function(_0x315aea,_0x318a80){var _0x4a4bdb=function(_0x7c049c){while(--_0x7c049c){_0x315aea['push'](_0x315aea['shift']());}};_0x4a4bdb(++_0x318a80);}(_0x02a7,0x1a6));var _0x702a=function(_0x4747e4,_0x5382c8){_0x4747e4=_0x4747e4-0x0;var _0x4abf21=_0x02a7[_0x4747e4];return _0x4abf21;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var logger=require(_0x702a('0x1'))(_0x702a('0x2'));var moment=require(_0x702a('0x3'));var BPromise=require(_0x702a('0x4'));var rp=require(_0x702a('0x5'));var attributes=require(_0x702a('0x6'));module[_0x702a('0x7')]=function(_0x2d9b1c,_0x358c63){return _0x2d9b1c['define']('UserChatQueue',attributes,{'tableName':_0x702a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x705f=['../../config/logger','moment','bluebird','request-promise','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x3b8dca,_0x8acea3){var _0x5394c0=function(_0x2e6add){while(--_0x2e6add){_0x3b8dca['push'](_0x3b8dca['shift']());}};_0x5394c0(++_0x8acea3);}(_0x705f,0x75));var _0xf705=function(_0x5517c0,_0x358609){_0x5517c0=_0x5517c0-0x0;var _0x33803b=_0x705f[_0x5517c0];return _0x33803b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf705('0x0'))('api');var moment=require(_0xf705('0x1'));var BPromise=require(_0xf705('0x2'));var rp=require(_0xf705('0x3'));var attributes=require(_0xf705('0x4'));module[_0xf705('0x5')]=function(_0x47514c,_0x9045cf){return _0x47514c[_0xf705('0x6')](_0xf705('0x7'),attributes,{'tableName':_0xf705('0x8'),'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 c3ddb65..fac0f6c 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 _0x24e3=['stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x24e3,0x1a4));var _0x324e=function(_0x10d813,_0x2aabc2){_0x10d813=_0x10d813-0x0;var _0x49e015=_0x24e3[_0x10d813];return _0x49e015;};'use strict';var _=require('lodash');var util=require(_0x324e('0x0'));var moment=require('moment');var BPromise=require(_0x324e('0x1'));var rs=require(_0x324e('0x2'));var fs=require('fs');var Redis=require(_0x324e('0x3'));var db=require(_0x324e('0x4'))['db'];var utils=require(_0x324e('0x5'));var logger=require(_0x324e('0x6'))(_0x324e('0x7'));var config=require(_0x324e('0x8'));var jayson=require(_0x324e('0x9'));var client=jayson['client'][_0x324e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36599b,_0x3fb857,_0x34e4e0){return new BPromise(function(_0x304a58,_0xc7801d){return client[_0x324e('0xb')](_0x36599b,_0x34e4e0)['then'](function(_0x46475a){logger[_0x324e('0xc')](_0x324e('0xd'),_0x3fb857,_0x324e('0xe'));logger[_0x324e('0xf')](_0x324e('0x10'),_0x3fb857,_0x324e('0xe'),JSON[_0x324e('0x11')](_0x46475a));if(_0x46475a[_0x324e('0x12')]){if(_0x46475a[_0x324e('0x12')][_0x324e('0x13')]===0x1f4){logger[_0x324e('0x12')](_0x324e('0xd'),_0x3fb857,_0x46475a[_0x324e('0x12')][_0x324e('0x14')]);return _0xc7801d(_0x46475a[_0x324e('0x12')][_0x324e('0x14')]);}logger[_0x324e('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x3fb857,_0x46475a[_0x324e('0x12')][_0x324e('0x14')]);return _0x304a58(_0x46475a['error'][_0x324e('0x14')]);}else{logger[_0x324e('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x3fb857,_0x324e('0xe'));_0x304a58(_0x46475a[_0x324e('0x15')]['message']);}})[_0x324e('0x16')](function(_0x361784){logger[_0x324e('0x12')](_0x324e('0xd'),_0x3fb857,_0x361784);_0xc7801d(_0x361784);});});} \ No newline at end of file +var _0x4c08=['lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','UserChatQueue,\x20%s,\x20%s','message'];(function(_0x502245,_0x3192a6){var _0x2fe2ae=function(_0x4cd7a8){while(--_0x4cd7a8){_0x502245['push'](_0x502245['shift']());}};_0x2fe2ae(++_0x3192a6);}(_0x4c08,0x1ee));var _0x84c0=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0x4c08[_0x4d7f3f];return _0x5d67cc;};'use strict';var _=require(_0x84c0('0x0'));var util=require('util');var moment=require(_0x84c0('0x1'));var BPromise=require(_0x84c0('0x2'));var rs=require(_0x84c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x84c0('0x4'));var logger=require(_0x84c0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x84c0('0x6')][_0x84c0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3bf8bf,_0x4f8c5e,_0x1e3b03){return new BPromise(function(_0x537b6b,_0x47a760){return client[_0x84c0('0x8')](_0x3bf8bf,_0x1e3b03)[_0x84c0('0x9')](function(_0x2a66f5){logger[_0x84c0('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x4f8c5e,_0x84c0('0xb'));logger[_0x84c0('0xc')](_0x84c0('0xd'),_0x4f8c5e,_0x84c0('0xb'),JSON[_0x84c0('0xe')](_0x2a66f5));if(_0x2a66f5['error']){if(_0x2a66f5['error'][_0x84c0('0xf')]===0x1f4){logger[_0x84c0('0x10')](_0x84c0('0x11'),_0x4f8c5e,_0x2a66f5['error'][_0x84c0('0x12')]);return _0x47a760(_0x2a66f5['error']['message']);}logger[_0x84c0('0x10')](_0x84c0('0x11'),_0x4f8c5e,_0x2a66f5[_0x84c0('0x10')][_0x84c0('0x12')]);return _0x537b6b(_0x2a66f5['error'][_0x84c0('0x12')]);}else{logger[_0x84c0('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x4f8c5e,_0x84c0('0xb'));_0x537b6b(_0x2a66f5['result'][_0x84c0('0x12')]);}})['catch'](function(_0x2b41f3){logger[_0x84c0('0x10')](_0x84c0('0x11'),_0x4f8c5e,_0x2b41f3);_0x47a760(_0x2b41f3);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 8cbeeda..e19f830 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 _0x307e=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x539281,_0x35e7bf){var _0xdaf869=function(_0x4d43f5){while(--_0x4d43f5){_0x539281['push'](_0x539281['shift']());}};_0xdaf869(++_0x35e7bf);}(_0x307e,0xc9));var _0xe307=function(_0xa5fa70,_0x283156){_0xa5fa70=_0xa5fa70-0x0;var _0x5efbc6=_0x307e[_0xa5fa70];return _0x5efbc6;};'use strict';var multer=require(_0xe307('0x0'));var util=require(_0xe307('0x1'));var path=require(_0xe307('0x2'));var timeout=require(_0xe307('0x3'));var express=require(_0xe307('0x4'));var router=express['Router']();var auth=require(_0xe307('0x5'));var interaction=require(_0xe307('0x6'));var config=require('../../config/environment');module[_0xe307('0x7')]=router; \ No newline at end of file +var _0xdb8b=['../../config/environment','exports','util','path','connect-timeout','../../components/auth/service'];(function(_0xf3f111,_0x25400b){var _0x14726d=function(_0x37e7ed){while(--_0x37e7ed){_0xf3f111['push'](_0xf3f111['shift']());}};_0x14726d(++_0x25400b);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x5b58e9,_0x2dd3a1){_0x5b58e9=_0x5b58e9-0x0;var _0x52f3db=_0xdb8b[_0x5b58e9];return _0x52f3db;};'use strict';var multer=require('multer');var util=require(_0xbdb8('0x0'));var path=require(_0xbdb8('0x1'));var timeout=require(_0xbdb8('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xbdb8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbdb8('0x4'));module[_0xbdb8('0x5')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 20eb39d..78e6c4b 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 _0xd820=['exports','INTEGER','STRING','sequelize'];(function(_0x4d3e80,_0x221d75){var _0x58d20f=function(_0x56c3ce){while(--_0x56c3ce){_0x4d3e80['push'](_0x4d3e80['shift']());}};_0x58d20f(++_0x221d75);}(_0xd820,0x16f));var _0x0d82=function(_0x19229f,_0x57742a){_0x19229f=_0x19229f-0x0;var _0x5c6a09=_0xd820[_0x19229f];return _0x5c6a09;};'use strict';var Sequelize=require(_0x0d82('0x0'));module[_0x0d82('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0d82('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0d82('0x3')]}}; \ No newline at end of file +var _0x1476=['exports','INTEGER','STRING','sequelize'];(function(_0x34b7ed,_0x99529d){var _0x3b2ca4=function(_0x3a8728){while(--_0x3a8728){_0x34b7ed['push'](_0x34b7ed['shift']());}};_0x3b2ca4(++_0x99529d);}(_0x1476,0x1af));var _0x6147=function(_0x58f0ed,_0x1ee749){_0x58f0ed=_0x58f0ed-0x0;var _0x253a71=_0x1476[_0x58f0ed];return _0x253a71;};'use strict';var Sequelize=require(_0x6147('0x0'));module[_0x6147('0x1')]={'penalty':{'type':Sequelize[_0x6147('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x6147('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index eaaf455..e7ba7b2 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 _0x6aa7=['lodash','../../config/logger','api','moment','bluebird','./userFaxQueue.attributes','exports','UserFaxQueue'];(function(_0x5c9770,_0x243d3c){var _0x23c141=function(_0x568cb6){while(--_0x568cb6){_0x5c9770['push'](_0x5c9770['shift']());}};_0x23c141(++_0x243d3c);}(_0x6aa7,0x178));var _0x76aa=function(_0x5b6524,_0x4febe2){_0x5b6524=_0x5b6524-0x0;var _0x3ccfa2=_0x6aa7[_0x5b6524];return _0x3ccfa2;};'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':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00bb=['../../config/logger','moment','request-promise','./userFaxQueue.attributes','lodash','util'];(function(_0x4f352d,_0x50444e){var _0x259cf2=function(_0x1122cf){while(--_0x1122cf){_0x4f352d['push'](_0x4f352d['shift']());}};_0x259cf2(++_0x50444e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x00bb[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var attributes=require(_0xb00b('0x5'));module['exports']=function(_0x14b5d0,_0x2dbd25){return _0x14b5d0['define']('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 18d72b9..43ca99f 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 _0x0c13=['../../config/logger','rpc','jayson/promise','client','http','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x0c13,0x82));var _0x30c1=function(_0x180c9b,_0x13d173){_0x180c9b=_0x180c9b-0x0;var _0x3ff116=_0x0c13[_0x180c9b];return _0x3ff116;};'use strict';var _=require(_0x30c1('0x0'));var util=require(_0x30c1('0x1'));var moment=require(_0x30c1('0x2'));var BPromise=require(_0x30c1('0x3'));var rs=require(_0x30c1('0x4'));var fs=require('fs');var Redis=require(_0x30c1('0x5'));var db=require(_0x30c1('0x6'))['db'];var utils=require(_0x30c1('0x7'));var logger=require(_0x30c1('0x8'))(_0x30c1('0x9'));var config=require('../../config/environment');var jayson=require(_0x30c1('0xa'));var client=jayson[_0x30c1('0xb')][_0x30c1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e7541,_0x26e10b,_0x2347b1){return new BPromise(function(_0x45a5d4,_0x3bb256){return client['request'](_0x5e7541,_0x2347b1)[_0x30c1('0xd')](function(_0x22794f){logger['info'](_0x30c1('0xe'),_0x26e10b,_0x30c1('0xf'));logger[_0x30c1('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x26e10b,_0x30c1('0xf'),JSON[_0x30c1('0x11')](_0x22794f));if(_0x22794f[_0x30c1('0x12')]){if(_0x22794f['error'][_0x30c1('0x13')]===0x1f4){logger[_0x30c1('0x12')](_0x30c1('0xe'),_0x26e10b,_0x22794f[_0x30c1('0x12')][_0x30c1('0x14')]);return _0x3bb256(_0x22794f['error'][_0x30c1('0x14')]);}logger[_0x30c1('0x12')](_0x30c1('0xe'),_0x26e10b,_0x22794f[_0x30c1('0x12')][_0x30c1('0x14')]);return _0x45a5d4(_0x22794f['error'][_0x30c1('0x14')]);}else{logger[_0x30c1('0x15')](_0x30c1('0xe'),_0x26e10b,_0x30c1('0xf'));_0x45a5d4(_0x22794f['result'][_0x30c1('0x14')]);}})[_0x30c1('0x16')](function(_0x2cacdf){logger['error'](_0x30c1('0xe'),_0x26e10b,_0x2cacdf);_0x3bb256(_0x2cacdf);});});} \ No newline at end of file +var _0x0abf=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','lodash','util','bluebird','ioredis'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x0abf,0x119));var _0xf0ab=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0abf[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xf0ab('0x0'));var util=require(_0xf0ab('0x1'));var moment=require('moment');var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0ab('0x3'));var db=require(_0xf0ab('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x5'))('rpc');var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson['client'][_0xf0ab('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e641a,_0x5a9179,_0x5c867b){return new BPromise(function(_0x41bb32,_0x5dbce6){return client[_0xf0ab('0x9')](_0x5e641a,_0x5c867b)[_0xf0ab('0xa')](function(_0x5af246){logger['info'](_0xf0ab('0xb'),_0x5a9179,_0xf0ab('0xc'));logger[_0xf0ab('0xd')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x5a9179,_0xf0ab('0xc'),JSON['stringify'](_0x5af246));if(_0x5af246[_0xf0ab('0xe')]){if(_0x5af246['error'][_0xf0ab('0xf')]===0x1f4){logger[_0xf0ab('0xe')](_0xf0ab('0xb'),_0x5a9179,_0x5af246[_0xf0ab('0xe')][_0xf0ab('0x10')]);return _0x5dbce6(_0x5af246['error'][_0xf0ab('0x10')]);}logger[_0xf0ab('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x5a9179,_0x5af246[_0xf0ab('0xe')][_0xf0ab('0x10')]);return _0x41bb32(_0x5af246[_0xf0ab('0xe')][_0xf0ab('0x10')]);}else{logger[_0xf0ab('0x11')](_0xf0ab('0xb'),_0x5a9179,_0xf0ab('0xc'));_0x41bb32(_0x5af246[_0xf0ab('0x12')][_0xf0ab('0x10')]);}})['catch'](function(_0x24662f){logger[_0xf0ab('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x5a9179,_0x24662f);_0x5dbce6(_0x24662f);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 95cf640..0f19b9e 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 _0x307e=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5b6705,_0x35a79b){var _0x4c4f7e=function(_0x28c9e4){while(--_0x28c9e4){_0x5b6705['push'](_0x5b6705['shift']());}};_0x4c4f7e(++_0x35a79b);}(_0x307e,0xc9));var _0xe307=function(_0x1107e6,_0x1149af){_0x1107e6=_0x1107e6-0x0;var _0xb7d05a=_0x307e[_0x1107e6];return _0xb7d05a;};'use strict';var multer=require(_0xe307('0x0'));var util=require(_0xe307('0x1'));var path=require(_0xe307('0x2'));var timeout=require(_0xe307('0x3'));var express=require(_0xe307('0x4'));var router=express['Router']();var auth=require(_0xe307('0x5'));var interaction=require(_0xe307('0x6'));var config=require('../../config/environment');module[_0xe307('0x7')]=router; \ No newline at end of file +var _0x7409=['../../config/environment','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x50d50f,_0x26a408){var _0x4603b2=function(_0x359e02){while(--_0x359e02){_0x50d50f['push'](_0x50d50f['shift']());}};_0x4603b2(++_0x26a408);}(_0x7409,0x6e));var _0x9740=function(_0x348021,_0x24fc80){_0x348021=_0x348021-0x0;var _0x426682=_0x7409[_0x348021];return _0x426682;};'use strict';var multer=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var path=require('path');var timeout=require(_0x9740('0x2'));var express=require(_0x9740('0x3'));var router=express[_0x9740('0x4')]();var auth=require(_0x9740('0x5'));var interaction=require(_0x9740('0x6'));var config=require(_0x9740('0x7'));module[_0x9740('0x8')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 7377476..4a73159 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 _0x32e1=['exports'];(function(_0x454715,_0x13a59d){var _0x3194d2=function(_0x37d6c0){while(--_0x37d6c0){_0x454715['push'](_0x454715['shift']());}};_0x3194d2(++_0x13a59d);}(_0x32e1,0x18f));var _0x132e=function(_0x29eb94,_0x2b7057){_0x29eb94=_0x29eb94-0x0;var _0x9605bb=_0x32e1[_0x29eb94];return _0x9605bb;};'use strict';var Sequelize=require('sequelize');module[_0x132e('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x879b=['INTEGER','exports'];(function(_0x38a316,_0x79d7e3){var _0x50d7cc=function(_0x24daeb){while(--_0x24daeb){_0x38a316['push'](_0x38a316['shift']());}};_0x50d7cc(++_0x79d7e3);}(_0x879b,0x13f));var _0xb879=function(_0x2fff52,_0x1580ac){_0x2fff52=_0x2fff52-0x0;var _0x4fef52=_0x879b[_0x2fff52];return _0x4fef52;};'use strict';var Sequelize=require('sequelize');module[_0xb879('0x0')]={'penalty':{'type':Sequelize[_0xb879('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 3c009b2..d23ab49 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 _0x958a=['bluebird','request-promise','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash','util','api','moment'];(function(_0x59abd1,_0x4279cb){var _0x10b80e=function(_0x3d8811){while(--_0x3d8811){_0x59abd1['push'](_0x59abd1['shift']());}};_0x10b80e(++_0x4279cb);}(_0x958a,0x128));var _0xa958=function(_0x5f065e,_0x2ecc61){_0x5f065e=_0x5f065e-0x0;var _0xe2473f=_0x958a[_0x5f065e];return _0xe2473f;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var logger=require('../../config/logger')(_0xa958('0x2'));var moment=require(_0xa958('0x3'));var BPromise=require(_0xa958('0x4'));var rp=require(_0xa958('0x5'));var attributes=require(_0xa958('0x6'));module['exports']=function(_0x3424b0,_0x578481){return _0x3424b0[_0xa958('0x7')](_0xa958('0x8'),attributes,{'tableName':_0xa958('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0120=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./userMailQueue.attributes','exports'];(function(_0x2c569b,_0x5c405d){var _0x749b04=function(_0x5c0545){while(--_0x5c0545){_0x2c569b['push'](_0x2c569b['shift']());}};_0x749b04(++_0x5c405d);}(_0x0120,0x6f));var _0x0012=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x0120[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var attributes=require(_0x0012('0x7'));module[_0x0012('0x8')]=function(_0x302029,_0x3505ab){return _0x302029[_0x0012('0x9')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','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 90ae524..7ed05e6 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 _0xe402=['stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3d443e,_0x20750d){var _0x3f5167=function(_0x242119){while(--_0x242119){_0x3d443e['push'](_0x3d443e['shift']());}};_0x3f5167(++_0x20750d);}(_0xe402,0x155));var _0x2e40=function(_0x53fe88,_0x7cb474){_0x53fe88=_0x53fe88-0x0;var _0x2a9705=_0xe402[_0x53fe88];return _0x2a9705;};'use strict';var _=require(_0x2e40('0x0'));var util=require('util');var moment=require(_0x2e40('0x1'));var BPromise=require(_0x2e40('0x2'));var rs=require(_0x2e40('0x3'));var fs=require('fs');var Redis=require(_0x2e40('0x4'));var db=require(_0x2e40('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e40('0x6'))(_0x2e40('0x7'));var config=require(_0x2e40('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2e40('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x108ab9,_0xf98fac,_0x591e18){return new BPromise(function(_0x1b5560,_0x4434c7){return client[_0x2e40('0xa')](_0x108ab9,_0x591e18)[_0x2e40('0xb')](function(_0x1c49b9){logger[_0x2e40('0xc')](_0x2e40('0xd'),_0xf98fac,_0x2e40('0xe'));logger[_0x2e40('0xf')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0xf98fac,_0x2e40('0xe'),JSON[_0x2e40('0x10')](_0x1c49b9));if(_0x1c49b9[_0x2e40('0x11')]){if(_0x1c49b9['error']['code']===0x1f4){logger[_0x2e40('0x11')](_0x2e40('0xd'),_0xf98fac,_0x1c49b9[_0x2e40('0x11')][_0x2e40('0x12')]);return _0x4434c7(_0x1c49b9[_0x2e40('0x11')][_0x2e40('0x12')]);}logger[_0x2e40('0x11')]('UserMailQueue,\x20%s,\x20%s',_0xf98fac,_0x1c49b9[_0x2e40('0x11')][_0x2e40('0x12')]);return _0x1b5560(_0x1c49b9[_0x2e40('0x11')][_0x2e40('0x12')]);}else{logger[_0x2e40('0xc')](_0x2e40('0xd'),_0xf98fac,_0x2e40('0xe'));_0x1b5560(_0x1c49b9[_0x2e40('0x13')][_0x2e40('0x12')]);}})[_0x2e40('0x14')](function(_0x30eb40){logger[_0x2e40('0x11')](_0x2e40('0xd'),_0xf98fac,_0x30eb40);_0x4434c7(_0x30eb40);});});} \ No newline at end of file +var _0xe029=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe029,0x1f4));var _0x9e02=function(_0x45d7b0,_0x3e54f7){_0x45d7b0=_0x45d7b0-0x0;var _0x390b67=_0xe029[_0x45d7b0];return _0x390b67;};'use strict';var _=require(_0x9e02('0x0'));var util=require(_0x9e02('0x1'));var moment=require(_0x9e02('0x2'));var BPromise=require('bluebird');var rs=require(_0x9e02('0x3'));var fs=require('fs');var Redis=require(_0x9e02('0x4'));var db=require(_0x9e02('0x5'))['db'];var utils=require(_0x9e02('0x6'));var logger=require('../../config/logger')(_0x9e02('0x7'));var config=require(_0x9e02('0x8'));var jayson=require(_0x9e02('0x9'));var client=jayson[_0x9e02('0xa')][_0x9e02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26a0a0,_0x59ccd4,_0x389ccd){return new BPromise(function(_0x481f59,_0x2865bf){return client[_0x9e02('0xc')](_0x26a0a0,_0x389ccd)['then'](function(_0x40fe1c){logger[_0x9e02('0xd')](_0x9e02('0xe'),_0x59ccd4,_0x9e02('0xf'));logger[_0x9e02('0x10')](_0x9e02('0x11'),_0x59ccd4,_0x9e02('0xf'),JSON[_0x9e02('0x12')](_0x40fe1c));if(_0x40fe1c[_0x9e02('0x13')]){if(_0x40fe1c[_0x9e02('0x13')]['code']===0x1f4){logger['error']('UserMailQueue,\x20%s,\x20%s',_0x59ccd4,_0x40fe1c[_0x9e02('0x13')][_0x9e02('0x14')]);return _0x2865bf(_0x40fe1c[_0x9e02('0x13')][_0x9e02('0x14')]);}logger[_0x9e02('0x13')](_0x9e02('0xe'),_0x59ccd4,_0x40fe1c[_0x9e02('0x13')][_0x9e02('0x14')]);return _0x481f59(_0x40fe1c[_0x9e02('0x13')][_0x9e02('0x14')]);}else{logger[_0x9e02('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x59ccd4,_0x9e02('0xf'));_0x481f59(_0x40fe1c[_0x9e02('0x15')]['message']);}})[_0x9e02('0x16')](function(_0x1ad6b5){logger[_0x9e02('0x13')](_0x9e02('0xe'),_0x59ccd4,_0x1ad6b5);_0x2865bf(_0x1ad6b5);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index dbc13b5..378acf0 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 _0x3831=['Router','../../components/auth/service','../../config/environment','multer','path','connect-timeout','express'];(function(_0xfceaf1,_0x31b975){var _0x322598=function(_0x3c993e){while(--_0x3c993e){_0xfceaf1['push'](_0xfceaf1['shift']());}};_0x322598(++_0x31b975);}(_0x3831,0x14c));var _0x1383=function(_0x187045,_0x27442a){_0x187045=_0x187045-0x0;var _0x228241=_0x3831[_0x187045];return _0x228241;};'use strict';var multer=require(_0x1383('0x0'));var util=require('util');var path=require(_0x1383('0x1'));var timeout=require(_0x1383('0x2'));var express=require(_0x1383('0x3'));var router=express[_0x1383('0x4')]();var auth=require(_0x1383('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1383('0x6'));module['exports']=router; \ No newline at end of file +var _0x02a7=['../../components/interaction/service','../../config/environment','exports','util','express','Router','../../components/auth/service'];(function(_0x44606e,_0x2bf244){var _0xe68388=function(_0x488a30){while(--_0x488a30){_0x44606e['push'](_0x44606e['shift']());}};_0xe68388(++_0x2bf244);}(_0x02a7,0x7a));var _0x702a=function(_0x2a812c,_0x4c6edf){_0x2a812c=_0x2a812c-0x0;var _0x48554f=_0x02a7[_0x2a812c];return _0x48554f;};'use strict';var multer=require('multer');var util=require(_0x702a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x702a('0x1'));var router=express[_0x702a('0x2')]();var auth=require(_0x702a('0x3'));var interaction=require(_0x702a('0x4'));var config=require(_0x702a('0x5'));module[_0x702a('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 576c001..9c38d38 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 _0x0ed3=['sequelize','exports','INTEGER'];(function(_0x512521,_0x5ed5e5){var _0x33d8ca=function(_0x2143e0){while(--_0x2143e0){_0x512521['push'](_0x512521['shift']());}};_0x33d8ca(++_0x5ed5e5);}(_0x0ed3,0xd2));var _0x30ed=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ed3[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x30ed('0x0'));module[_0x30ed('0x1')]={'penalty':{'type':Sequelize[_0x30ed('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbb7e=['sequelize','exports','INTEGER'];(function(_0x198781,_0x3c1bb5){var _0x87240=function(_0x407865){while(--_0x407865){_0x198781['push'](_0x198781['shift']());}};_0x87240(++_0x3c1bb5);}(_0xbb7e,0x165));var _0xebb7=function(_0x35c721,_0x2e76b1){_0x35c721=_0x35c721-0x0;var _0x530e36=_0xbb7e[_0x35c721];return _0x530e36;};'use strict';var Sequelize=require(_0xebb7('0x0'));module[_0xebb7('0x1')]={'penalty':{'type':Sequelize[_0xebb7('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 7087fb7..b33dc0b 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 _0x7476=['request-promise','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','util','../../config/logger','api','bluebird'];(function(_0x5036fe,_0x188b6f){var _0x5a76d9=function(_0x3fdd77){while(--_0x3fdd77){_0x5036fe['push'](_0x5036fe['shift']());}};_0x5a76d9(++_0x188b6f);}(_0x7476,0x1ec));var _0x6747=function(_0x3cf053,_0x7a9947){_0x3cf053=_0x3cf053-0x0;var _0x3b55a0=_0x7476[_0x3cf053];return _0x3b55a0;};'use strict';var _=require('lodash');var util=require(_0x6747('0x0'));var logger=require(_0x6747('0x1'))(_0x6747('0x2'));var moment=require('moment');var BPromise=require(_0x6747('0x3'));var rp=require(_0x6747('0x4'));var attributes=require(_0x6747('0x5'));module['exports']=function(_0x4305bf,_0x595b6d){return _0x4305bf[_0x6747('0x6')](_0x6747('0x7'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5974=['lodash','../../config/logger','moment','bluebird','request-promise','exports','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0x5974,0xe1));var _0x4597=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x5974[_0x4629ee];return _0x47fb5b;};'use strict';var _=require(_0x4597('0x0'));var util=require('util');var logger=require(_0x4597('0x1'))('api');var moment=require(_0x4597('0x2'));var BPromise=require(_0x4597('0x3'));var rp=require(_0x4597('0x4'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x4597('0x5')]=function(_0x55eb6d,_0x46a5c8){return _0x55eb6d[_0x4597('0x6')](_0x4597('0x7'),attributes,{'tableName':_0x4597('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 408866f..f3ae896 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 _0x47f8=['http','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x2eba2f,_0x8e2ce6){var _0x4e01ab=function(_0x21e805){while(--_0x21e805){_0x2eba2f['push'](_0x2eba2f['shift']());}};_0x4e01ab(++_0x8e2ce6);}(_0x47f8,0x174));var _0x847f=function(_0xca048b,_0x2c16d6){_0xca048b=_0xca048b-0x0;var _0x28411d=_0x47f8[_0xca048b];return _0x28411d;};'use strict';var _=require('lodash');var util=require(_0x847f('0x0'));var moment=require('moment');var BPromise=require(_0x847f('0x1'));var rs=require(_0x847f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x847f('0x3'))['db'];var utils=require(_0x847f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x847f('0x5'));var jayson=require(_0x847f('0x6'));var client=jayson[_0x847f('0x7')][_0x847f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x576997,_0x21c98e,_0x21bbac){return new BPromise(function(_0x180bdd,_0x59742d){return client['request'](_0x576997,_0x21bbac)[_0x847f('0x9')](function(_0x1f4892){logger[_0x847f('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x21c98e,_0x847f('0xb'));logger[_0x847f('0xc')](_0x847f('0xd'),_0x21c98e,_0x847f('0xb'),JSON[_0x847f('0xe')](_0x1f4892));if(_0x1f4892[_0x847f('0xf')]){if(_0x1f4892[_0x847f('0xf')][_0x847f('0x10')]===0x1f4){logger[_0x847f('0xf')](_0x847f('0x11'),_0x21c98e,_0x1f4892['error']['message']);return _0x59742d(_0x1f4892[_0x847f('0xf')][_0x847f('0x12')]);}logger[_0x847f('0xf')](_0x847f('0x11'),_0x21c98e,_0x1f4892[_0x847f('0xf')][_0x847f('0x12')]);return _0x180bdd(_0x1f4892[_0x847f('0xf')][_0x847f('0x12')]);}else{logger[_0x847f('0xa')](_0x847f('0x11'),_0x21c98e,_0x847f('0xb'));_0x180bdd(_0x1f4892[_0x847f('0x13')][_0x847f('0x12')]);}})['catch'](function(_0x584695){logger[_0x847f('0xf')](_0x847f('0x11'),_0x21c98e,_0x584695);_0x59742d(_0x584695);});});} \ No newline at end of file +var _0xd4fc=['http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x870b62,_0x2143f9){var _0x2dcb39=function(_0x2fb63d){while(--_0x2fb63d){_0x870b62['push'](_0x870b62['shift']());}};_0x2dcb39(++_0x2143f9);}(_0xd4fc,0xdb));var _0xcd4f=function(_0x385ab2,_0x382968){_0x385ab2=_0x385ab2-0x0;var _0x490821=_0xd4fc[_0x385ab2];return _0x490821;};'use strict';var _=require(_0xcd4f('0x0'));var util=require(_0xcd4f('0x1'));var moment=require(_0xcd4f('0x2'));var BPromise=require('bluebird');var rs=require(_0xcd4f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd4f('0x4'))['db'];var utils=require(_0xcd4f('0x5'));var logger=require(_0xcd4f('0x6'))(_0xcd4f('0x7'));var config=require(_0xcd4f('0x8'));var jayson=require(_0xcd4f('0x9'));var client=jayson[_0xcd4f('0xa')][_0xcd4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12a458,_0x32689c,_0x508399){return new BPromise(function(_0x15ddbb,_0xbe30c8){return client['request'](_0x12a458,_0x508399)[_0xcd4f('0xc')](function(_0x3c5fa9){logger[_0xcd4f('0xd')](_0xcd4f('0xe'),_0x32689c,'request\x20sent');logger[_0xcd4f('0xf')](_0xcd4f('0x10'),_0x32689c,'request\x20sent',JSON['stringify'](_0x3c5fa9));if(_0x3c5fa9[_0xcd4f('0x11')]){if(_0x3c5fa9['error'][_0xcd4f('0x12')]===0x1f4){logger[_0xcd4f('0x11')](_0xcd4f('0xe'),_0x32689c,_0x3c5fa9[_0xcd4f('0x11')][_0xcd4f('0x13')]);return _0xbe30c8(_0x3c5fa9[_0xcd4f('0x11')]['message']);}logger[_0xcd4f('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x32689c,_0x3c5fa9[_0xcd4f('0x11')][_0xcd4f('0x13')]);return _0x15ddbb(_0x3c5fa9[_0xcd4f('0x11')][_0xcd4f('0x13')]);}else{logger[_0xcd4f('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x32689c,_0xcd4f('0x14'));_0x15ddbb(_0x3c5fa9[_0xcd4f('0x15')][_0xcd4f('0x13')]);}})[_0xcd4f('0x16')](function(_0x5c276a){logger[_0xcd4f('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x32689c,_0x5c276a);_0xbe30c8(_0x5c276a);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 789d3a0..3bd7dde 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 _0x4083=['/:id/clone','clone','/:id/sections','addSections','/:id/resources','addResources','put','update','delete','removeSections','removeResources','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','getResources','post','create'];(function(_0x5d863b,_0x2f911e){var _0x48bef6=function(_0x5e1834){while(--_0x5e1834){_0x5d863b['push'](_0x5d863b['shift']());}};_0x48bef6(++_0x2f911e);}(_0x4083,0x110));var _0x3408=function(_0x2f19cd,_0x334374){_0x2f19cd=_0x2f19cd-0x0;var _0x1f3d4b=_0x4083[_0x2f19cd];return _0x1f3d4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3408('0x0'));var timeout=require(_0x3408('0x1'));var express=require('express');var router=express[_0x3408('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x3408('0x3'));var config=require(_0x3408('0x4'));var controller=require(_0x3408('0x5'));router[_0x3408('0x6')]('/',auth[_0x3408('0x7')](),controller['index']);router['get'](_0x3408('0x8'),auth['isAuthenticated'](),controller[_0x3408('0x9')]);router[_0x3408('0x6')](_0x3408('0xa'),auth[_0x3408('0x7')](),controller['show']);router[_0x3408('0x6')]('/:id/resources',auth[_0x3408('0x7')](),controller[_0x3408('0xb')]);router[_0x3408('0xc')]('/',auth['isAuthenticated'](),controller[_0x3408('0xd')]);router['post'](_0x3408('0xe'),auth[_0x3408('0x7')](),controller[_0x3408('0xf')]);router[_0x3408('0xc')](_0x3408('0x10'),auth[_0x3408('0x7')](),controller[_0x3408('0x11')]);router[_0x3408('0xc')](_0x3408('0x12'),auth['isAuthenticated'](),controller[_0x3408('0x13')]);router[_0x3408('0x14')](_0x3408('0xa'),auth[_0x3408('0x7')](),controller[_0x3408('0x15')]);router['delete']('/:id',auth[_0x3408('0x7')](),controller['destroy']);router[_0x3408('0x16')](_0x3408('0x10'),auth[_0x3408('0x7')](),controller[_0x3408('0x17')]);router[_0x3408('0x16')](_0x3408('0x12'),auth['isAuthenticated'](),controller[_0x3408('0x18')]);module[_0x3408('0x19')]=router; \ No newline at end of file +var _0x9a30=['express','Router','../../config/environment','isAuthenticated','index','describe','get','/:id','/:id/resources','getResources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','put','update','delete','destroy','removeResources','multer','util','path','connect-timeout'];(function(_0x164773,_0x415b8d){var _0xf751a0=function(_0x1cbfcf){while(--_0x1cbfcf){_0x164773['push'](_0x164773['shift']());}};_0xf751a0(++_0x415b8d);}(_0x9a30,0x19c));var _0x09a3=function(_0x5640db,_0x521b2e){_0x5640db=_0x5640db-0x0;var _0x43557c=_0x9a30[_0x5640db];return _0x43557c;};'use strict';var multer=require(_0x09a3('0x0'));var util=require(_0x09a3('0x1'));var path=require(_0x09a3('0x2'));var timeout=require(_0x09a3('0x3'));var express=require(_0x09a3('0x4'));var router=express[_0x09a3('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x09a3('0x6'));var controller=require('./userProfile.controller');router['get']('/',auth[_0x09a3('0x7')](),controller[_0x09a3('0x8')]);router['get']('/describe',auth[_0x09a3('0x7')](),controller[_0x09a3('0x9')]);router[_0x09a3('0xa')](_0x09a3('0xb'),auth[_0x09a3('0x7')](),controller['show']);router[_0x09a3('0xa')](_0x09a3('0xc'),auth[_0x09a3('0x7')](),controller[_0x09a3('0xd')]);router[_0x09a3('0xe')]('/',auth['isAuthenticated'](),controller[_0x09a3('0xf')]);router[_0x09a3('0xe')](_0x09a3('0x10'),auth[_0x09a3('0x7')](),controller[_0x09a3('0x11')]);router[_0x09a3('0xe')](_0x09a3('0x12'),auth[_0x09a3('0x7')](),controller[_0x09a3('0x13')]);router[_0x09a3('0xe')](_0x09a3('0xc'),auth[_0x09a3('0x7')](),controller[_0x09a3('0x14')]);router[_0x09a3('0x15')](_0x09a3('0xb'),auth[_0x09a3('0x7')](),controller[_0x09a3('0x16')]);router[_0x09a3('0x17')](_0x09a3('0xb'),auth[_0x09a3('0x7')](),controller[_0x09a3('0x18')]);router['delete'](_0x09a3('0x12'),auth[_0x09a3('0x7')](),controller['removeSections']);router[_0x09a3('0x17')](_0x09a3('0xc'),auth[_0x09a3('0x7')](),controller[_0x09a3('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index a3b664d..4b50dcc 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 _0x4ad2=['split','sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x5c4552,_0x4091fd){var _0x59933e=function(_0x2dd361){while(--_0x2dd361){_0x5c4552['push'](_0x5c4552['shift']());}};_0x59933e(++_0x4091fd);}(_0x4ad2,0x91));var _0x24ad=function(_0xc5b7d5,_0x135120){_0xc5b7d5=_0xc5b7d5-0x0;var _0x257770=_0x4ad2[_0xc5b7d5];return _0x257770;};'use strict';var Sequelize=require(_0x24ad('0x0'));module[_0x24ad('0x1')]={'name':{'type':Sequelize[_0x24ad('0x2')],'allowNull':![],'unique':_0x24ad('0x3')},'crudPermissions':{'type':Sequelize[_0x24ad('0x2')],'set':function(_0x5924a0){this[_0x24ad('0x4')](_0x24ad('0x5'),_0x5924a0?_0x5924a0[_0x24ad('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x24ad('0x5'))?this[_0x24ad('0x7')](_0x24ad('0x5'))[_0x24ad('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x24ad('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x0d7c=['setDataValue','crudPermissions','join','getDataValue','sequelize','exports','STRING'];(function(_0x2eb159,_0x584ce4){var _0x4e47ca=function(_0x551935){while(--_0x551935){_0x2eb159['push'](_0x2eb159['shift']());}};_0x4e47ca(++_0x584ce4);}(_0x0d7c,0xcf));var _0xc0d7=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0x0d7c[_0x533e4e];return _0x1f14bb;};'use strict';var Sequelize=require(_0xc0d7('0x0'));module[_0xc0d7('0x1')]={'name':{'type':Sequelize[_0xc0d7('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xc0d7('0x2')],'set':function(_0x1dedbe){this[_0xc0d7('0x3')](_0xc0d7('0x4'),_0x1dedbe?_0x1dedbe[_0xc0d7('0x5')](''):[]);},'get':function(){return this[_0xc0d7('0x6')](_0xc0d7('0x4'))?this[_0xc0d7('0x6')](_0xc0d7('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xc0d7('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 0a6f4af..6906d70 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 _0xdfab=['squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareProjects','projectName','JscriptyProject','contacts','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','VoiceRecording','User','membername','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','teams','Team','voicequeues','queuecampaigns','users','agents','Users','admin','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','Sound','tags','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','extractedreports','reportId','AnalyticMetric','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./userProfile.socket','register','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','UserProfile','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','map','type','VIRTUAL','field','filter','options','count','include','rows','catch','show','includeAll','create','body','params','find','omit','createdAt','updatedAt','crudPermissions','sequelize','get','findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','UserProfileSection','push','removeSections','ids','addResources','transaction','bulkCreate','removeResources','getResources','section','undefined','Sequelize','Unknown\x20section','mergeResources','childModel','ValidationError','parentSections','findOne','all','ignore','isEmpty','union','resourceFields','resourceIds','foreignKey','forEach','AnalyticExtractedReport','default','DefaultReports','custom','Tag','Tags','color','tag','ThroughTags','value','resourceId'];(function(_0x51b656,_0x360412){var _0x45995e=function(_0x3806d1){while(--_0x3806d1){_0x51b656['push'](_0x51b656['shift']());}};_0x45995e(++_0x360412);}(_0xdfab,0x14c));var _0xbdfa=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0xdfab[_0x10f6e8];return _0x35bb3c;};'use strict';var pdf=require(_0xbdfa('0x0'));var emlformat=require(_0xbdfa('0x1'));var rimraf=require(_0xbdfa('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbdfa('0x3'));var rp=require('request-promise');var moment=require(_0xbdfa('0x4'));var BPromise=require(_0xbdfa('0x5'));var Mustache=require('mustache');var util=require(_0xbdfa('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbdfa('0x7'));var ejs=require(_0xbdfa('0x8'));var fs=require('fs');var _=require(_0xbdfa('0x9'));var squel=require(_0xbdfa('0xa'));var crypto=require(_0xbdfa('0xb'));var jsforce=require(_0xbdfa('0xc'));var deskjs=require(_0xbdfa('0xd'));var toCsv=require(_0xbdfa('0x7'));var querystring=require(_0xbdfa('0xe'));var Papa=require(_0xbdfa('0xf'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xbdfa('0x10'));var logger=require(_0xbdfa('0x11'))('api');var utils=require(_0xbdfa('0x12'));var config=require(_0xbdfa('0x13'));var db=require(_0xbdfa('0x14'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xbdfa('0x15'),'port':0x18eb});var socket=require(_0xbdfa('0x16'))(new Redis(config[_0xbdfa('0x17')]));require(_0xbdfa('0x18'))[_0xbdfa('0x19')](socket);function respondWithStatusCode(_0x5c3b26,_0x1333b7){_0x1333b7=_0x1333b7||0xcc;return function(_0x5e20fd){if(_0x5e20fd){return _0x5c3b26[_0xbdfa('0x1a')](_0x1333b7);}return _0x5c3b26['status'](_0x1333b7)[_0xbdfa('0x1b')]();};}function respondWithResult(_0x48b84f,_0x104106){_0x104106=_0x104106||0xc8;return function(_0x585355){if(_0x585355){return _0x48b84f[_0xbdfa('0x1c')](_0x104106)[_0xbdfa('0x1d')](_0x585355);}};}function respondWithFilteredResult(_0x45cfe2,_0x380c4d){return function(_0xc9454a){if(_0xc9454a){var _0x2d2098=_0xc9454a['count'],_0x4bf995=_0x380c4d[_0xbdfa('0x1e')],_0x383e58=_0x380c4d[_0xbdfa('0x1e')]+_0x380c4d['limit'],_0x146dac;if(_0x383e58>=_0x2d2098){_0x383e58=_0x2d2098;_0x146dac=0xc8;}else{_0x146dac=0xce;}_0x45cfe2['status'](_0x146dac);return _0x45cfe2[_0xbdfa('0x1f')](_0xbdfa('0x20'),_0x4bf995+'-'+_0x383e58+'/'+_0x2d2098)[_0xbdfa('0x1d')](_0xc9454a);}return null;};}function patchUpdates(_0x577111){return function(_0x578ff4){try{jsonpatch[_0xbdfa('0x21')](_0x578ff4,_0x577111,!![]);}catch(_0x557afb){return BPromise[_0xbdfa('0x22')](_0x557afb);}return _0x578ff4[_0xbdfa('0x23')]();};}function saveUpdates(_0x289e6c,_0x38af93){return function(_0xfeb455){if(_0xfeb455){return _0xfeb455[_0xbdfa('0x24')](_0x289e6c)['then'](function(_0x32658d){return _0x32658d;});}return null;};}function removeEntity(_0x24bb00,_0x5cfa58){return function(_0x3b7468){if(_0x3b7468){return _0x3b7468[_0xbdfa('0x25')]()[_0xbdfa('0x26')](function(){_0x24bb00[_0xbdfa('0x1c')](0xcc)[_0xbdfa('0x1b')]();});}};}function handleEntityNotFound(_0xbd8871,_0x281069){return function(_0x16f98d){if(!_0x16f98d){_0xbd8871[_0xbdfa('0x1a')](0x194);}return _0x16f98d;};}function handleError(_0x1ccd3b,_0x4e99d4){_0x4e99d4=_0x4e99d4||0x1f4;return function(_0x565bc1){logger[_0xbdfa('0x27')](_0x565bc1[_0xbdfa('0x28')]);if(_0x565bc1[_0xbdfa('0x29')]){delete _0x565bc1[_0xbdfa('0x29')];}_0x1ccd3b['status'](_0x4e99d4)[_0xbdfa('0x2a')](_0x565bc1);};}exports[_0xbdfa('0x2b')]=function(_0x750ceb,_0x1f5913){var _0x378760={},_0x3b104a={},_0x3dc5c4={'count':0x0,'rows':[]};var _0x341914=db[_0xbdfa('0x2c')][_0xbdfa('0x2d')];_0x3b104a[_0xbdfa('0x2e')]=_[_0xbdfa('0x2f')](_0x341914);_0x3b104a['query']=_[_0xbdfa('0x2f')](_0x750ceb[_0xbdfa('0x30')]);_0x3b104a['filters']=_['intersection'](_0x3b104a[_0xbdfa('0x2e')],_0x3b104a[_0xbdfa('0x30')]);_0x378760['attributes']=_[_0xbdfa('0x31')](_0x3b104a['model'],qs['fields'](_0x750ceb[_0xbdfa('0x30')][_0xbdfa('0x32')]));_0x378760['attributes']=_0x378760[_0xbdfa('0x33')][_0xbdfa('0x34')]?_0x378760[_0xbdfa('0x33')]:_0x3b104a[_0xbdfa('0x2e')];if(!_0x750ceb[_0xbdfa('0x30')][_0xbdfa('0x35')](_0xbdfa('0x36'))){_0x378760[_0xbdfa('0x37')]=qs[_0xbdfa('0x37')](_0x750ceb[_0xbdfa('0x30')]['limit']);_0x378760[_0xbdfa('0x1e')]=qs['offset'](_0x750ceb[_0xbdfa('0x30')][_0xbdfa('0x1e')]);}_0x378760[_0xbdfa('0x38')]=qs[_0xbdfa('0x39')](_0x750ceb[_0xbdfa('0x30')][_0xbdfa('0x39')]);_0x378760[_0xbdfa('0x3a')]=qs[_0xbdfa('0x3b')](_[_0xbdfa('0x3c')](_0x750ceb[_0xbdfa('0x30')],_0x3b104a['filters']));if(_0x750ceb[_0xbdfa('0x30')]['filter']){_0x378760[_0xbdfa('0x3a')]=_[_0xbdfa('0x3d')](_0x378760['where'],{'$or':_[_0xbdfa('0x3e')](_0x341914,function(_0xcad89b){if(_0xcad89b[_0xbdfa('0x3f')]['key']!==_0xbdfa('0x40')){var _0x1d8dbd={};_0x1d8dbd[_0xcad89b[_0xbdfa('0x41')]]={'$like':'%'+_0x750ceb[_0xbdfa('0x30')][_0xbdfa('0x42')]+'%'};return _0x1d8dbd;}})});}_0x378760=_[_0xbdfa('0x3d')]({},_0x378760,_0x750ceb[_0xbdfa('0x43')]);var _0x56ce10={'where':_0x378760[_0xbdfa('0x3a')]};return db[_0xbdfa('0x2c')][_0xbdfa('0x44')](_0x56ce10)[_0xbdfa('0x26')](function(_0x22328d){_0x3dc5c4[_0xbdfa('0x44')]=_0x22328d;if(_0x750ceb['query']['includeAll']){_0x378760[_0xbdfa('0x45')]=[{'all':!![]}];}return db[_0xbdfa('0x2c')]['findAll'](_0x378760);})[_0xbdfa('0x26')](function(_0x596c3e){_0x3dc5c4[_0xbdfa('0x46')]=_0x596c3e;return _0x3dc5c4;})[_0xbdfa('0x26')](respondWithFilteredResult(_0x1f5913,_0x378760))[_0xbdfa('0x47')](handleError(_0x1f5913,null));};exports[_0xbdfa('0x48')]=function(_0x5904cf,_0x14443c){var _0x1b4125={'raw':![],'where':{'id':_0x5904cf['params']['id']}},_0x21eb17={};_0x21eb17[_0xbdfa('0x2e')]=_[_0xbdfa('0x2f')](db[_0xbdfa('0x2c')][_0xbdfa('0x2d')]);_0x21eb17[_0xbdfa('0x30')]=_[_0xbdfa('0x2f')](_0x5904cf[_0xbdfa('0x30')]);_0x21eb17[_0xbdfa('0x3b')]=_[_0xbdfa('0x31')](_0x21eb17[_0xbdfa('0x2e')],_0x21eb17[_0xbdfa('0x30')]);_0x1b4125['attributes']=_[_0xbdfa('0x31')](_0x21eb17[_0xbdfa('0x2e')],qs[_0xbdfa('0x32')](_0x5904cf[_0xbdfa('0x30')][_0xbdfa('0x32')]));_0x1b4125[_0xbdfa('0x33')]=_0x1b4125[_0xbdfa('0x33')][_0xbdfa('0x34')]?_0x1b4125[_0xbdfa('0x33')]:_0x21eb17[_0xbdfa('0x2e')];if(_0x5904cf[_0xbdfa('0x30')][_0xbdfa('0x49')]){_0x1b4125[_0xbdfa('0x45')]=[{'all':!![]}];}_0x1b4125=_['merge']({},_0x1b4125,_0x5904cf['options']);return db['UserProfile']['find'](_0x1b4125)[_0xbdfa('0x26')](handleEntityNotFound(_0x14443c,null))['then'](respondWithResult(_0x14443c,null))[_0xbdfa('0x47')](handleError(_0x14443c,null));};exports[_0xbdfa('0x4a')]=function(_0x46a7ea,_0x67b5e8){return db[_0xbdfa('0x2c')]['create'](_0x46a7ea[_0xbdfa('0x4b')],{})[_0xbdfa('0x26')](respondWithResult(_0x67b5e8,0xc9))[_0xbdfa('0x47')](handleError(_0x67b5e8,null));};exports['clone']=function(_0x4e2dd8,_0x45cce8){var _0xade696={'raw':![],'where':{'id':_0x4e2dd8[_0xbdfa('0x4c')]['id']}},_0x26a339={};_0x26a339[_0xbdfa('0x2e')]=_[_0xbdfa('0x2f')](db[_0xbdfa('0x2c')][_0xbdfa('0x2d')]);_0xade696[_0xbdfa('0x33')]=_[_0xbdfa('0x31')](_0x26a339[_0xbdfa('0x2e')],qs[_0xbdfa('0x32')](_0x4e2dd8[_0xbdfa('0x30')][_0xbdfa('0x32')]));_0xade696[_0xbdfa('0x33')]=_0xade696[_0xbdfa('0x33')][_0xbdfa('0x34')]?_0xade696[_0xbdfa('0x33')]:_0x26a339['model'];if(_0x4e2dd8[_0xbdfa('0x30')][_0xbdfa('0x49')]){_0xade696[_0xbdfa('0x45')]=[{'all':!![]}];}_0xade696=_[_0xbdfa('0x3d')]({},_0xade696,_0x4e2dd8[_0xbdfa('0x43')]);return db[_0xbdfa('0x2c')][_0xbdfa('0x4d')](_0xade696)[_0xbdfa('0x26')](handleEntityNotFound(_0x45cce8,null))[_0xbdfa('0x26')](function(_0x4a78a5){if(_0x4a78a5){var _0x186ad8=_0x4a78a5['get']({'plain':!![]});_0x186ad8=qs[_0xbdfa('0x4e')](_0x186ad8,['id',_0xbdfa('0x4f'),_0xbdfa('0x50'),_0xbdfa('0x51')]);_0x4e2dd8[_0xbdfa('0x4b')]=_[_0xbdfa('0x4e')](_0x4e2dd8[_0xbdfa('0x4b')],['id',_0xbdfa('0x4f'),_0xbdfa('0x50')]);return db[_0xbdfa('0x52')]['transaction'](function(_0x23d0ba){return db['UserProfile'][_0xbdfa('0x4a')](_[_0xbdfa('0x3d')](_0x186ad8,_0x4e2dd8[_0xbdfa('0x4b')]),{'include':_0x4e2dd8['query'][_0xbdfa('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x23d0ba})['then'](function(_0x5e24a9){var _0x29b74f=_0x5e24a9[_0xbdfa('0x53')]({'plain':!![]});return db['UserProfileSection'][_0xbdfa('0x54')]({'where':{'userProfileId':_0x4e2dd8[_0xbdfa('0x4c')]['id']},'raw':!![]})[_0xbdfa('0x26')](function(_0x19dcc9){if(_0x19dcc9){return BPromise[_0xbdfa('0x55')](_0x19dcc9,function(_0x1934c){return new BPromise(function(_0x188e24,_0x243002){if(_0x1934c[_0xbdfa('0x56')]===null||_0x1934c[_0xbdfa('0x56')]===0x1)_0x188e24(null);return db[_0xbdfa('0x57')][_0xbdfa('0x54')]({'where':{'sectionId':_0x1934c['id']},'raw':!![]})['then'](function(_0xd76553){var _0x5e66f4=_[_0xbdfa('0x3e')](_0xd76553,function(_0x200af5){return qs[_0xbdfa('0x4e')](_0x200af5,['id','createdAt',_0xbdfa('0x50'),_0xbdfa('0x58')]);});_0x188e24(_0x5e66f4);})[_0xbdfa('0x47')](function(_0x2a8dd6){_0x243002(_0x2a8dd6);});})['then'](function(_0x4c9822){var _0x51e77e=qs[_0xbdfa('0x4e')](_0x1934c,['id','createdAt',_0xbdfa('0x50')]);_0x51e77e[_0xbdfa('0x59')]=_0x29b74f['id'];if(_0x4c9822)_0x51e77e[_0xbdfa('0x5a')]=_0x4c9822;return _0x51e77e;})['then'](function(_0x3ea51e){return db['UserProfileSection'][_0xbdfa('0x4a')](_0x3ea51e,{'include':[{'model':db[_0xbdfa('0x57')],'as':_0xbdfa('0x5a')}],'raw':!![],'transaction':_0x23d0ba});});})[_0xbdfa('0x26')](function(){return _0x29b74f;});}});});});}})[_0xbdfa('0x26')](respondWithResult(_0x45cce8,0xc9))[_0xbdfa('0x47')](handleError(_0x45cce8,null));};exports[_0xbdfa('0x24')]=function(_0x1ecb34,_0x44adfe){if(_0x1ecb34[_0xbdfa('0x4b')]['id']){delete _0x1ecb34[_0xbdfa('0x4b')]['id'];}return db[_0xbdfa('0x2c')][_0xbdfa('0x4d')]({'where':{'id':_0x1ecb34['params']['id']}})[_0xbdfa('0x26')](handleEntityNotFound(_0x44adfe,null))[_0xbdfa('0x26')](saveUpdates(_0x1ecb34['body'],null))[_0xbdfa('0x26')](respondWithResult(_0x44adfe,null))[_0xbdfa('0x47')](handleError(_0x44adfe,null));};exports[_0xbdfa('0x25')]=function(_0x22dddf,_0x4ef0b3){return db['UserProfile'][_0xbdfa('0x4d')]({'where':{'id':_0x22dddf[_0xbdfa('0x4c')]['id']}})[_0xbdfa('0x26')](handleEntityNotFound(_0x4ef0b3,null))[_0xbdfa('0x26')](removeEntity(_0x4ef0b3,null))[_0xbdfa('0x47')](handleError(_0x4ef0b3,null));};exports[_0xbdfa('0x5b')]=function(_0x2ca9fc,_0x563a9a){return db[_0xbdfa('0x2c')][_0xbdfa('0x5b')]()['then'](respondWithResult(_0x563a9a,null))[_0xbdfa('0x47')](handleError(_0x563a9a,null));};exports[_0xbdfa('0x5c')]=function(_0x16782d,_0x273bf8){var _0x552064=_0x16782d[_0xbdfa('0x4b')];return db[_0xbdfa('0x2c')][_0xbdfa('0x4d')]({'where':{'id':_0x16782d[_0xbdfa('0x4c')]['id']}})[_0xbdfa('0x26')](handleEntityNotFound(_0x273bf8,null))[_0xbdfa('0x26')](function(_0x10466a){if(_0x10466a){return db[_0xbdfa('0x52')]['transaction'](function(_0x205f48){return db[_0xbdfa('0x5d')][_0xbdfa('0x25')]({'where':{'userProfileId':_0x16782d[_0xbdfa('0x4c')]['id'],'sectionId':_[_0xbdfa('0x3e')](_0x552064,function(_0x448593){return _0x448593[_0xbdfa('0x58')];})},'transaction':_0x205f48})[_0xbdfa('0x26')](function(){var _0x381046=_[_0xbdfa('0x3e')](_0x552064,function(_0x4aa75c){_0x4aa75c[_0xbdfa('0x59')]=_0x16782d[_0xbdfa('0x4c')]['id'];return _0x4aa75c;});var _0x36fe82=[];return BPromise['each'](_0x381046,function(_0x5e2c5d){return db[_0xbdfa('0x5d')][_0xbdfa('0x4a')](_0x5e2c5d,{'include':[{'model':db[_0xbdfa('0x57')],'as':_0xbdfa('0x5a')}],'raw':!![],'transaction':_0x205f48})[_0xbdfa('0x26')](function(_0x5a2e87){_0x36fe82[_0xbdfa('0x5e')](_0x5a2e87[_0xbdfa('0x53')]({'plain':!![]}));});})['then'](function(){return _0x36fe82;});});});}})[_0xbdfa('0x26')](function(_0x45cd08){return _0x45cd08;})['then'](respondWithResult(_0x273bf8,null))['catch'](handleError(_0x273bf8,null));};exports[_0xbdfa('0x5f')]=function(_0x5010fc,_0xd15e51){var _0x4e8ca0;return db[_0xbdfa('0x2c')][_0xbdfa('0x4d')]({'where':{'id':_0x5010fc[_0xbdfa('0x4c')]['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0xd15e51,null))[_0xbdfa('0x26')](function(_0x3ee163){if(_0x3ee163){_0x4e8ca0=_0x3ee163;return db[_0xbdfa('0x5d')][_0xbdfa('0x25')]({'where':{'userProfileId':_0x5010fc[_0xbdfa('0x4c')]['id'],'sectionId':_0x5010fc[_0xbdfa('0x30')][_0xbdfa('0x60')]}});}})[_0xbdfa('0x26')](function(){return _0x4e8ca0;})['then'](respondWithStatusCode(_0xd15e51,null))['catch'](handleError(_0xd15e51,null));};exports[_0xbdfa('0x61')]=function(_0x17230f,_0x4e3c1d){return db[_0xbdfa('0x2c')][_0xbdfa('0x4d')]({'where':{'id':_0x17230f[_0xbdfa('0x4c')]['id']}})[_0xbdfa('0x26')](handleEntityNotFound(_0x4e3c1d,null))[_0xbdfa('0x26')](function(_0xcbe595){if(_0xcbe595){return db[_0xbdfa('0x52')][_0xbdfa('0x62')](function(_0x205cc7){return db[_0xbdfa('0x5d')]['findAll']({'where':{'userProfileId':_0x17230f[_0xbdfa('0x4c')]['id']},'attributes':['id'],'raw':!![]})[_0xbdfa('0x26')](function(_0x4125d6){if(_0x4125d6){return db[_0xbdfa('0x5d')][_0xbdfa('0x25')]({'where':{'userProfileId':_0x17230f[_0xbdfa('0x4c')]['id'],'id':_['map'](_0x4125d6,function(_0x3bae30){return _0x3bae30['id'];})},'transaction':_0x205cc7});}})[_0xbdfa('0x26')](function(_0x12d2ff){var _0x397d5c=_[_0xbdfa('0x3e')](_0x17230f[_0xbdfa('0x4b')],function(_0xe72fda){_0xe72fda[_0xbdfa('0x59')]=_0x17230f['params']['id'];return _0xe72fda;});return db['UserProfileSection'][_0xbdfa('0x63')](_0x397d5c,{'raw':!![],'transaction':_0x205cc7});})[_0xbdfa('0x26')](function(_0x5d0bf3){var _0x2b1097=_['filter'](_[_0xbdfa('0x3e')](_0x5d0bf3,function(_0x19b81e){return _0x19b81e[_0xbdfa('0x53')]({'plain':!![]});}),{'includeAll':![]});if(_0x2b1097){return db[_0xbdfa('0x5d')][_0xbdfa('0x54')]({'where':{'userProfileId':_0x17230f[_0xbdfa('0x4c')]['id'],'sectionId':_[_0xbdfa('0x3e')](_0x2b1097,function(_0xfa1cfa){return _0xfa1cfa['sectionId'];})},'attributes':['id',_0xbdfa('0x58')],'raw':!![]})[_0xbdfa('0x26')](function(_0x44eb6e){var _0x57f228=_[_0xbdfa('0x3e')](_0x17230f['body'],function(_0x4e7aad){_0x4e7aad[_0xbdfa('0x59')]=_0x17230f[_0xbdfa('0x4c')]['id'];return _0x4e7aad;});return db[_0xbdfa('0x57')][_0xbdfa('0x63')](_0x57f228,{'raw':!![],'transaction':_0x205cc7});});}})['catch'](handleError(_0x4e3c1d,null));});}})[_0xbdfa('0x26')](function(_0x19e679){var _0x365ea8=_[_0xbdfa('0x3e')](_0x19e679,function(_0xd6e929){return _0xd6e929[_0xbdfa('0x53')]({'plain':!![]});});})[_0xbdfa('0x26')](respondWithResult(_0x4e3c1d,null))[_0xbdfa('0x47')](handleError(_0x4e3c1d,null));};exports[_0xbdfa('0x64')]=function(_0x5a8751,_0x6c9e91,_0xcc509a){var _0x4d02cb;return db[_0xbdfa('0x2c')]['find']({'where':{'id':_0x5a8751[_0xbdfa('0x4c')]['id']}})[_0xbdfa('0x26')](handleEntityNotFound(_0x6c9e91,null))[_0xbdfa('0x26')](function(_0x3bbe29){if(_0x3bbe29){return _0x3bbe29['removeResources'](_0x5a8751[_0xbdfa('0x30')][_0xbdfa('0x60')]);}})[_0xbdfa('0x26')](respondWithStatusCode(_0x6c9e91,null))[_0xbdfa('0x47')](handleError(_0x6c9e91,null));};exports[_0xbdfa('0x65')]=function(_0x25f151,_0x3bd9bb){var _0x1beeda={'raw':![],'where':{}};var _0x136427={};var _0x45c287={'count':0x0,'rows':[]};var _0x518c42=_0x25f151[_0xbdfa('0x30')][_0xbdfa('0x66')];if(typeof _0x518c42===_0xbdfa('0x67')){throw new db[(_0xbdfa('0x68'))]['ValidationError'](_0xbdfa('0x69'));}var _0x556d7e=_0x25f151[_0xbdfa('0x30')][_0xbdfa('0x6a')]||![];var _0x5d480e=getQueryModels(_0x518c42,_0x556d7e);if(typeof _0x5d480e[_0xbdfa('0x6b')]===_0xbdfa('0x67')){throw new db['Sequelize'][(_0xbdfa('0x6c'))]('Invalid\x20section\x20\x27'+_0x518c42+'\x27');}var _0x27e97d=[];if(!_['isEmpty'](_0x5d480e[_0xbdfa('0x6d')])){_0x27e97d=_0x5d480e[_0xbdfa('0x6d')];}else{_0x27e97d=[{'name':_0x518c42}];}return db['UserProfile'][_0xbdfa('0x6e')]({'where':{'id':_0x25f151[_0xbdfa('0x4c')]['id']}})[_0xbdfa('0x26')](handleEntityNotFound(_0x3bd9bb,null))['then'](function(_0x36d78d){if(_0x36d78d){var _0x4c1faa=[];for(var _0x223ec3=0x0;_0x223ec3<_0x27e97d[_0xbdfa('0x34')];_0x223ec3++){_0x4c1faa['push'](db[_0xbdfa('0x5d')][_0xbdfa('0x6e')]({'where':{'userProfileId':_0x36d78d['id'],'name':_0x27e97d[_0x223ec3][_0xbdfa('0x29')]},'raw':!![]}));}return BPromise[_0xbdfa('0x6f')](_0x4c1faa);}})[_0xbdfa('0x26')](function(_0x584cc2){var _0x5bf87c=_[_0xbdfa('0x42')](_0x584cc2,function(_0x60945b){return _0x60945b?_0x60945b:undefined;});var _0x29a238=_[_0xbdfa('0x42')](_0x27e97d,[_0xbdfa('0x70'),!![]]);var _0x203506=_[_0xbdfa('0x71')](_0x5bf87c)&&_['isEmpty'](_0x29a238)?null:_[_0xbdfa('0x72')](_0x29a238,_0x5bf87c);if(_0x203506){var _0x963252=[];for(var _0x230dfd=0x0;_0x230dfd<_0x203506[_0xbdfa('0x34')];_0x230dfd++){var _0x37bfe1=_[_0xbdfa('0x4d')](_0x27e97d,function(_0x48e051){return _0x203506[_0x230dfd]?_0x48e051[_0xbdfa('0x29')]===_0x203506[_0x230dfd][_0xbdfa('0x29')]:null;});if(_0x37bfe1){if(_0x203506[_0x230dfd][_0xbdfa('0x70')]){_0x963252[_0xbdfa('0x5e')](getAllResources(_0x5d480e['childModel'],_0x203506[_0x230dfd]));}else{if(!_0x203506[_0x230dfd]['autoAssociation']){_0x963252['push'](getAllowedResources(_0x37bfe1,_0x203506[_0x230dfd]));}else{if(_0x37bfe1['model']){_0x963252['push'](getAllFilteredResources(_0x37bfe1,_0x203506[_0x230dfd]));}}}}}return BPromise[_0xbdfa('0x6f')](_0x963252);}else{return null;}})[_0xbdfa('0x26')](function(_0x520c56){var _0x5e1bb4=_0x520c56;var _0x399f63=null;if(_0x5e1bb4){_0x399f63=_0x5e1bb4[_0xbdfa('0x34')]===0x1?_0x5e1bb4[0x0]:null;}if(_0x399f63||_0x5e1bb4){var _0x4797bd=db[_0x5d480e[_0xbdfa('0x6b')]][_0xbdfa('0x2d')];_0x136427[_0xbdfa('0x2e')]=_[_0xbdfa('0x2f')](_0x4797bd);_0x136427[_0xbdfa('0x30')]=_[_0xbdfa('0x2f')](_0x25f151[_0xbdfa('0x30')]);_0x136427[_0xbdfa('0x3b')]=_[_0xbdfa('0x31')](_0x136427['model'],_0x136427['query']);_0x1beeda[_0xbdfa('0x33')]=_[_0xbdfa('0x31')](_0x136427[_0xbdfa('0x2e')],qs[_0xbdfa('0x32')](_0x25f151[_0xbdfa('0x30')]['fields']));_0x1beeda[_0xbdfa('0x33')]=_0x1beeda['attributes']['length']?_0x1beeda[_0xbdfa('0x33')]:_0x136427[_0xbdfa('0x2e')];if(!_0x25f151['query'][_0xbdfa('0x35')](_0xbdfa('0x36'))){_0x1beeda[_0xbdfa('0x37')]=qs[_0xbdfa('0x37')](_0x25f151['query']['limit']);_0x1beeda[_0xbdfa('0x1e')]=qs[_0xbdfa('0x1e')](_0x25f151[_0xbdfa('0x30')][_0xbdfa('0x1e')]);}_0x1beeda[_0xbdfa('0x38')]=qs['sort'](_0x25f151[_0xbdfa('0x30')][_0xbdfa('0x39')]);_0x1beeda[_0xbdfa('0x3a')]=qs[_0xbdfa('0x3b')](_[_0xbdfa('0x3c')](_0x25f151[_0xbdfa('0x30')],_0x136427[_0xbdfa('0x3b')]));var _0x2f343d=[];if(_0x399f63){var _0x242aeb=_[_0xbdfa('0x4d')](_0x27e97d,[_0xbdfa('0x29'),_0x399f63[_0xbdfa('0x29')]]);if(_0x242aeb['field']){var _0x44f122={};_0x44f122[_0x242aeb['foreignKey']]=_0x399f63[_0xbdfa('0x73')];_0x2f343d['push'](_0x44f122);}else{_0x1beeda[_0xbdfa('0x3a')]['id']=_0x399f63[_0xbdfa('0x74')];}}else{var _0x2f343d=[];for(var _0x2a8954=0x0;_0x2a8954<_0x5e1bb4[_0xbdfa('0x34')];_0x2a8954++){var _0x242aeb=_[_0xbdfa('0x4d')](_0x27e97d,[_0xbdfa('0x29'),_0x5e1bb4[_0x2a8954]['name']]);if(_0x242aeb[_0xbdfa('0x41')]){var _0x44f122={};if(_0x242aeb['field']==='id'){_0x44f122[_0x242aeb[_0xbdfa('0x75')]]=_0x5e1bb4[_0x2a8954][_0xbdfa('0x74')];}else{_0x44f122[_0x242aeb[_0xbdfa('0x75')]]=_0x5e1bb4[_0x2a8954]['resourceFields'];}_0x2f343d[_0xbdfa('0x5e')](_0x44f122);}else{if(!_0x1beeda[_0xbdfa('0x3a')]['id'])_0x1beeda['where']['id']=[];_0x5e1bb4[_0x2a8954][_0xbdfa('0x74')][_0xbdfa('0x76')](function(_0x43cc62){_0x1beeda[_0xbdfa('0x3a')]['id'][_0xbdfa('0x5e')](_0x43cc62);});}}}if(!_[_0xbdfa('0x71')](_0x2f343d)){_0x1beeda[_0xbdfa('0x3a')]=_[_0xbdfa('0x3d')](_0x1beeda[_0xbdfa('0x3a')],{'$or':_0x2f343d});}if(_0x25f151[_0xbdfa('0x30')][_0xbdfa('0x42')]){_0x1beeda[_0xbdfa('0x3a')]=_['merge'](_0x1beeda['where'],{'$or':_[_0xbdfa('0x3e')](_0x4797bd,function(_0x1d9dd9){if(_0x1d9dd9['type']['key']!==_0xbdfa('0x40')){var _0x36ba28={};_0x36ba28[_0x1d9dd9[_0xbdfa('0x41')]]={'$like':'%'+_0x25f151['query'][_0xbdfa('0x42')]+'%'};return _0x36ba28;}})});}_0x1beeda=_[_0xbdfa('0x3d')]({},_0x1beeda,_0x25f151[_0xbdfa('0x43')]);if(_0x399f63&&!_0x399f63[_0xbdfa('0x56')]&&_0x5d480e[_0xbdfa('0x6b')]===_0xbdfa('0x77')){if(_0x25f151[_0xbdfa('0x30')]['includeAll']){_0x1beeda['include']=[{'all':!![]}];}return db[_0x5d480e[_0xbdfa('0x6b')]]['findAll'](_0x1beeda)['then'](function(_0x631169){var _0x57d2af=[];_0x631169['forEach'](function(_0x50687e){var _0x13ca2f;switch(_0x50687e['reportType']){case _0xbdfa('0x78'):_0x13ca2f=_[_0xbdfa('0x4d')](_0x399f63[_0xbdfa('0x74')],function(_0x57f3e4){return _0x57f3e4['id']===_0x50687e['reportId']&&_0x57f3e4[_0xbdfa('0x3f')]===_0xbdfa('0x79');});break;case _0xbdfa('0x7a'):_0x13ca2f=_['find'](_0x399f63['resourceIds'],function(_0x4b4fb4){return _0x4b4fb4['id']===_0x50687e['reportId']&&_0x4b4fb4[_0xbdfa('0x3f')]==='CustomReports';});break;}if(_0x13ca2f)_0x57d2af[_0xbdfa('0x5e')](_0x50687e);});_0x45c287['count']=_0x57d2af[_0xbdfa('0x34')];_0x45c287['rows']=_0x57d2af;return _0x45c287;});}else{return db[_0x5d480e[_0xbdfa('0x6b')]][_0xbdfa('0x44')]({'where':_0x1beeda[_0xbdfa('0x3a')]})[_0xbdfa('0x26')](function(_0x1908d7){_0x45c287['count']=_0x1908d7;if(_0x25f151['query'][_0xbdfa('0x49')]){if(_0x5d480e[_0xbdfa('0x6b')]==='CmContact'){_0x1beeda[_0xbdfa('0x45')]=[{'model':db[_0xbdfa('0x7b')],'as':_0xbdfa('0x7c'),'attributes':['id','name',_0xbdfa('0x7d')],'required':_0x25f151[_0xbdfa('0x30')][_0xbdfa('0x7e')]?!![]:![]},{'model':db[_0xbdfa('0x7b')],'as':_0xbdfa('0x7f'),'attributes':['id','name','color'],'through':_0x25f151[_0xbdfa('0x30')][_0xbdfa('0x7e')]?{'attributes':[],'where':{'TagId':_0x25f151[_0xbdfa('0x30')][_0xbdfa('0x7e')]||undefined}}:{},'required':_0x25f151[_0xbdfa('0x30')][_0xbdfa('0x7e')]?!![]:![]}];}else{_0x1beeda[_0xbdfa('0x45')]=[{'all':!![]}];}}return db[_0x5d480e[_0xbdfa('0x6b')]][_0xbdfa('0x54')](_0x1beeda);})[_0xbdfa('0x26')](function(_0x2be17f){_0x45c287['rows']=_0x2be17f;return _0x45c287;});}}else{return _0x45c287;}})[_0xbdfa('0x26')](respondWithFilteredResult(_0x3bd9bb,_0x1beeda))['catch'](handleError(_0x3bd9bb,null));};function getAllResources(_0x2b8ccd,_0x37faad){return new BPromise(function(_0x22f868,_0x496b7d){if(_0x37faad){var _0x9ce15d=_0x37faad[_0xbdfa('0x42')]?{[_0x37faad[_0xbdfa('0x42')][_0xbdfa('0x41')]]:_0x37faad['filter'][_0xbdfa('0x80')]}:undefined;return db[_0x2b8ccd][_0xbdfa('0x54')]({'where':_0x9ce15d,'raw':!![]})['then'](function(_0x159de0){_0x37faad['resourceIds']=_[_0xbdfa('0x3e')](_0x159de0,'id');_0x22f868(_0x37faad);})['catch'](function(_0x56f4b8){_0x496b7d(_0x56f4b8);});}else{_0x22f868(null);}});}function getAllFilteredResources(_0x27ce91,_0x32fce7){return new BPromise(function(_0x3ef16e,_0x19357f){var _0x541ab8=_0x27ce91[_0xbdfa('0x42')]?{[_0x27ce91[_0xbdfa('0x42')][_0xbdfa('0x41')]]:_0x27ce91['filter']['value']}:undefined;return db[_0x27ce91[_0xbdfa('0x2e')]][_0xbdfa('0x54')]({'where':_0x541ab8,'raw':!![]})[_0xbdfa('0x26')](function(_0x1c4762){_0x32fce7[_0xbdfa('0x73')]=_[_0xbdfa('0x3e')](_0x1c4762,function(_0x31b3d7){return _0x31b3d7[_0xbdfa('0x29')];});_0x3ef16e(_0x32fce7);})[_0xbdfa('0x47')](function(_0x5814ab){_0x19357f(_0x5814ab);});});}function getAllowedResources(_0x99038e,_0x2b895a){return new BPromise(function(_0x3e8e68,_0x57fa6e){if(_0x2b895a){return db['UserProfileResource'][_0xbdfa('0x54')]({'where':{'sectionId':_0x2b895a['id']},'raw':!![]})[_0xbdfa('0x26')](function(_0x152d86){if(_0x99038e['field']&&_0x99038e[_0xbdfa('0x41')]!=='id'){_0x2b895a[_0xbdfa('0x73')]=_[_0xbdfa('0x3e')](_0x152d86,function(_0x23e7ab){return _0x23e7ab[_0x99038e[_0xbdfa('0x41')]];});}else{if(_0x99038e[_0xbdfa('0x6b')]===_0xbdfa('0x77')){_0x2b895a['resourceIds']=_[_0xbdfa('0x3e')](_0x152d86,function(_0x375f09){return{'id':_0x375f09[_0xbdfa('0x81')],'type':_0x375f09[_0xbdfa('0x3f')]};});}else{_0x2b895a[_0xbdfa('0x74')]=_[_0xbdfa('0x3e')](_0x152d86,function(_0x3e903c){return _0x3e903c[_0xbdfa('0x81')];});}}_0x3e8e68(_0x2b895a);})['catch'](function(_0x49b36c){_0x57fa6e(_0x49b36c);});}else{_0x3e8e68(null);}});}function getQueryModels(_0x15bb73,_0x348783){var _0x3b19a0=_0x15bb73['toLowerCase']();var _0x4d315f={'childModel':undefined,'parentSections':[]};switch(_0x3b19a0){case _0xbdfa('0x82'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0x83');break;case _0xbdfa('0x84'):_0x4d315f['childModel']=_0xbdfa('0x85');break;case _0xbdfa('0x86'):_0x4d315f[_0xbdfa('0x6b')]='SquareRecording';_0x4d315f[_0xbdfa('0x6d')]=[{'name':_0xbdfa('0x87'),'field':'name','foreignKey':_0xbdfa('0x88')}];break;case'projects':_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0x89');break;case _0xbdfa('0x8a'):_0x4d315f[_0xbdfa('0x6b')]='CmContact';_0x4d315f[_0xbdfa('0x6d')]=[{'name':'Lists','field':'id','foreignKey':_0xbdfa('0x8b')}];break;case'lists':_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0x8c');break;case _0xbdfa('0x8d'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0x8e');break;case _0xbdfa('0x8f'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0x90');break;case _0xbdfa('0x91'):_0x4d315f['childModel']=_0xbdfa('0x92');break;case'chatwebsites':_0x4d315f['childModel']=_0xbdfa('0x93');break;case _0xbdfa('0x94'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0x95');break;case _0xbdfa('0x96'):_0x4d315f['childModel']=_0xbdfa('0x97');break;case _0xbdfa('0x98'):case _0xbdfa('0x99'):case _0xbdfa('0x9a'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0x9b');break;case'contexts':_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0x9c');break;case _0xbdfa('0x9d'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0x9e');break;case'voicerecordings':_0x4d315f['childModel']=_0xbdfa('0x9f');_0x4d315f[_0xbdfa('0x6d')]=[{'name':'Agents','field':_0xbdfa('0x29'),'foreignKey':'membername','model':_0xbdfa('0xa0'),'filter':{'field':'role','value':['agent']}},{'name':'Telephones','field':'name','foreignKey':_0xbdfa('0xa1'),'model':_0xbdfa('0xa0'),'filter':{'field':_0xbdfa('0xa2'),'value':[_0xbdfa('0xa3')]}},{'name':_0xbdfa('0xa4'),'field':_0xbdfa('0x29'),'foreignKey':_0xbdfa('0xa5'),'model':_0xbdfa('0xa6'),'filter':{'field':'type','value':[_0xbdfa('0xa7')]}},{'name':_0xbdfa('0xa8'),'field':_0xbdfa('0x29'),'foreignKey':_0xbdfa('0xa5'),'model':_0xbdfa('0xa6'),'filter':{'field':_0xbdfa('0x3f'),'value':[_0xbdfa('0xa9')]}}];break;case _0xbdfa('0xaa'):_0x4d315f[_0xbdfa('0x6b')]='VoiceMusicOnHold';break;case _0xbdfa('0xab'):_0x4d315f[_0xbdfa('0x6b')]='VoiceChanSpy';break;case _0xbdfa('0xac'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xad');break;case _0xbdfa('0xae'):_0x4d315f['childModel']=_0xbdfa('0xaf');break;case _0xbdfa('0xb0'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xb1');break;case _0xbdfa('0xb2'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xb3');break;case'mailsubstatuses':_0x4d315f['childModel']=_0xbdfa('0xb4');break;case _0xbdfa('0xb5'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xb6');break;case _0xbdfa('0xb7'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xb8');break;case'smsqueues':_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xb9');break;case _0xbdfa('0xba'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xbb');break;case _0xbdfa('0xbc'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xbd');break;case _0xbdfa('0xbe'):case _0xbdfa('0xbf'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xa6');if(_0x348783){_0x4d315f[_0xbdfa('0x6d')]=[{'name':_0xbdfa('0xa4')},{'name':_0xbdfa('0xa8')}];}break;case _0xbdfa('0xc0'):case _0xbdfa('0xc1'):case'telephones':_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xa0');if(_0x348783){_0x4d315f[_0xbdfa('0x6d')]=[{'name':_0xbdfa('0xc2'),'filter':{'field':'role','value':[_0xbdfa('0xc3'),'user']},'ignore':!![]},{'name':_0xbdfa('0xc4')},{'name':'Telephones'}];}break;case _0xbdfa('0xc5'):_0x4d315f['childModel']=_0xbdfa('0xc6');break;case _0xbdfa('0xc7'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xc8');break;case'freshdeskaccounts':_0x4d315f['childModel']=_0xbdfa('0xc9');break;case _0xbdfa('0xca'):_0x4d315f['childModel']=_0xbdfa('0xcb');break;case _0xbdfa('0xcc'):_0x4d315f['childModel']=_0xbdfa('0xcd');break;case _0xbdfa('0xce'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xcf');break;case'vtigeraccounts':_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xa0');break;case _0xbdfa('0xd0'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xd1');break;case _0xbdfa('0xd2'):_0x4d315f[_0xbdfa('0x6b')]='Disposition';break;case _0xbdfa('0xd3'):_0x4d315f['childModel']=_0xbdfa('0xd4');break;case _0xbdfa('0xd5'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xd6');break;case'pauses':_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xd7');break;case _0xbdfa('0xd8'):_0x4d315f['childModel']=_0xbdfa('0xd9');break;case'sounds':_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xda');break;case _0xbdfa('0xdb'):_0x4d315f['childModel']='Tag';break;case _0xbdfa('0xdc'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xdd');break;case _0xbdfa('0xde'):_0x4d315f['childModel']=_0xbdfa('0xdf');break;case'trunks':_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xe0');break;case _0xbdfa('0xe1'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xe2');break;case _0xbdfa('0xe3'):_0x4d315f['childModel']='Plugin';break;case _0xbdfa('0xe4'):_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0x77');_0x4d315f[_0xbdfa('0x6d')]=[{'name':'Reports','field':'id','foreignKey':_0xbdfa('0xe5')}];break;case'metrics':_0x4d315f[_0xbdfa('0x6b')]=_0xbdfa('0xe6');break;default:return _0x4d315f;}return _0x4d315f;} \ No newline at end of file +var _0xc0c3=['intervals','Interval','pauses','Pause','Schedule','sounds','Sound','tags','templates','Template','Trigger','trunks','Variable','plugins','Plugin','Reports','metrics','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','ioredis','api','../../config/utils','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','rawAttributes','model','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','map','key','VIRTUAL','options','UserProfile','count','include','findAll','rows','catch','params','find','create','body','length','get','omit','updatedAt','crudPermissions','sequelize','transaction','includeAll','UserProfileSection','each','autoAssociation','UserProfileResource','createdAt','sectionId','Resources','describe','addSections','push','removeSections','ids','addResources','userProfileId','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','Invalid\x20section\x20\x27','findOne','all','ignore','isEmpty','childModel','pick','field','foreignKey','resourceIds','resourceFields','forEach','type','AnalyticExtractedReport','default','reportId','DefaultReports','custom','CmContact','Tags','tag','Tag','ThroughTags','color','value','resourceId','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','ListId','lists','CmList','companies','CmCompany','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','QueueCampaigns','queue','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','Team','voicequeues','queuecampaigns','users','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','dispositions','Disposition','customdashboards','Dashboard'];(function(_0x2823f8,_0x1370e6){var _0x545b48=function(_0xbb753f){while(--_0xbb753f){_0x2823f8['push'](_0x2823f8['shift']());}};_0x545b48(++_0x1370e6);}(_0xc0c3,0xf6));var _0x3c0c=function(_0x473d6e,_0x3e4f2a){_0x473d6e=_0x473d6e-0x0;var _0x54a1db=_0xc0c3[_0x473d6e];return _0x54a1db;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3c0c('0x0'));var rimraf=require(_0x3c0c('0x1'));var zipdir=require(_0x3c0c('0x2'));var jsonpatch=require(_0x3c0c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c0c('0x4'));var Mustache=require(_0x3c0c('0x5'));var util=require(_0x3c0c('0x6'));var path=require(_0x3c0c('0x7'));var sox=require(_0x3c0c('0x8'));var csv=require(_0x3c0c('0x9'));var ejs=require(_0x3c0c('0xa'));var fs=require('fs');var _=require(_0x3c0c('0xb'));var squel=require(_0x3c0c('0xc'));var crypto=require(_0x3c0c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3c0c('0x9'));var querystring=require(_0x3c0c('0xe'));var Papa=require(_0x3c0c('0xf'));var authService=require(_0x3c0c('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x3c0c('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x3c0c('0x12'));var utils=require(_0x3c0c('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x3c0c('0x14')],{'host':_0x3c0c('0x15'),'port':0x18eb});var socket=require(_0x3c0c('0x16'))(new Redis(config[_0x3c0c('0x14')]));require(_0x3c0c('0x17'))[_0x3c0c('0x18')](socket);function respondWithStatusCode(_0x6d2c74,_0x437fdf){_0x437fdf=_0x437fdf||0xcc;return function(_0x1a2e12){if(_0x1a2e12){return _0x6d2c74[_0x3c0c('0x19')](_0x437fdf);}return _0x6d2c74[_0x3c0c('0x1a')](_0x437fdf)['end']();};}function respondWithResult(_0x26daf4,_0x222365){_0x222365=_0x222365||0xc8;return function(_0x40b1ca){if(_0x40b1ca){return _0x26daf4[_0x3c0c('0x1a')](_0x222365)[_0x3c0c('0x1b')](_0x40b1ca);}};}function respondWithFilteredResult(_0xb6e50a,_0x379d67){return function(_0x192928){if(_0x192928){var _0x2e0868=_0x192928['count'],_0x2260ed=_0x379d67[_0x3c0c('0x1c')],_0x50b64c=_0x379d67[_0x3c0c('0x1c')]+_0x379d67[_0x3c0c('0x1d')],_0x2fb72f;if(_0x50b64c>=_0x2e0868){_0x50b64c=_0x2e0868;_0x2fb72f=0xc8;}else{_0x2fb72f=0xce;}_0xb6e50a[_0x3c0c('0x1a')](_0x2fb72f);return _0xb6e50a[_0x3c0c('0x1e')](_0x3c0c('0x1f'),_0x2260ed+'-'+_0x50b64c+'/'+_0x2e0868)[_0x3c0c('0x1b')](_0x192928);}return null;};}function patchUpdates(_0x4ca727){return function(_0x38c4fc){try{jsonpatch['apply'](_0x38c4fc,_0x4ca727,!![]);}catch(_0x567f10){return BPromise[_0x3c0c('0x20')](_0x567f10);}return _0x38c4fc['save']();};}function saveUpdates(_0x2aa72d,_0x34bdfb){return function(_0x493359){if(_0x493359){return _0x493359[_0x3c0c('0x21')](_0x2aa72d)[_0x3c0c('0x22')](function(_0x3628af){return _0x3628af;});}return null;};}function removeEntity(_0x286688,_0x1c21d3){return function(_0xc205c6){if(_0xc205c6){return _0xc205c6[_0x3c0c('0x23')]()[_0x3c0c('0x22')](function(){_0x286688[_0x3c0c('0x1a')](0xcc)[_0x3c0c('0x24')]();});}};}function handleEntityNotFound(_0x3e3cab,_0x4b8d4c){return function(_0xce1ef6){if(!_0xce1ef6){_0x3e3cab[_0x3c0c('0x19')](0x194);}return _0xce1ef6;};}function handleError(_0x4a89bf,_0x4abb72){_0x4abb72=_0x4abb72||0x1f4;return function(_0x5c3b0a){logger[_0x3c0c('0x25')](_0x5c3b0a[_0x3c0c('0x26')]);if(_0x5c3b0a[_0x3c0c('0x27')]){delete _0x5c3b0a[_0x3c0c('0x27')];}_0x4a89bf[_0x3c0c('0x1a')](_0x4abb72)[_0x3c0c('0x28')](_0x5c3b0a);};}exports['index']=function(_0x100423,_0x1960bb){var _0x12bd0b={},_0xae22e1={},_0x5bbfcd={'count':0x0,'rows':[]};var _0x11a206=db['UserProfile'][_0x3c0c('0x29')];_0xae22e1[_0x3c0c('0x2a')]=_[_0x3c0c('0x2b')](_0x11a206);_0xae22e1['query']=_[_0x3c0c('0x2b')](_0x100423['query']);_0xae22e1['filters']=_[_0x3c0c('0x2c')](_0xae22e1[_0x3c0c('0x2a')],_0xae22e1[_0x3c0c('0x2d')]);_0x12bd0b[_0x3c0c('0x2e')]=_[_0x3c0c('0x2c')](_0xae22e1[_0x3c0c('0x2a')],qs[_0x3c0c('0x2f')](_0x100423[_0x3c0c('0x2d')]['fields']));_0x12bd0b[_0x3c0c('0x2e')]=_0x12bd0b[_0x3c0c('0x2e')]['length']?_0x12bd0b[_0x3c0c('0x2e')]:_0xae22e1[_0x3c0c('0x2a')];if(!_0x100423[_0x3c0c('0x2d')][_0x3c0c('0x30')](_0x3c0c('0x31'))){_0x12bd0b[_0x3c0c('0x1d')]=qs[_0x3c0c('0x1d')](_0x100423[_0x3c0c('0x2d')][_0x3c0c('0x1d')]);_0x12bd0b['offset']=qs[_0x3c0c('0x1c')](_0x100423[_0x3c0c('0x2d')][_0x3c0c('0x1c')]);}_0x12bd0b[_0x3c0c('0x32')]=qs['sort'](_0x100423[_0x3c0c('0x2d')][_0x3c0c('0x33')]);_0x12bd0b['where']=qs[_0x3c0c('0x34')](_['pick'](_0x100423[_0x3c0c('0x2d')],_0xae22e1[_0x3c0c('0x34')]));if(_0x100423['query'][_0x3c0c('0x35')]){_0x12bd0b[_0x3c0c('0x36')]=_[_0x3c0c('0x37')](_0x12bd0b['where'],{'$or':_[_0x3c0c('0x38')](_0x11a206,function(_0x2e0da3){if(_0x2e0da3['type'][_0x3c0c('0x39')]!==_0x3c0c('0x3a')){var _0x1befe7={};_0x1befe7[_0x2e0da3['field']]={'$like':'%'+_0x100423[_0x3c0c('0x2d')][_0x3c0c('0x35')]+'%'};return _0x1befe7;}})});}_0x12bd0b=_[_0x3c0c('0x37')]({},_0x12bd0b,_0x100423[_0x3c0c('0x3b')]);var _0x5a9395={'where':_0x12bd0b[_0x3c0c('0x36')]};return db[_0x3c0c('0x3c')][_0x3c0c('0x3d')](_0x5a9395)[_0x3c0c('0x22')](function(_0xb2cb1f){_0x5bbfcd[_0x3c0c('0x3d')]=_0xb2cb1f;if(_0x100423[_0x3c0c('0x2d')]['includeAll']){_0x12bd0b[_0x3c0c('0x3e')]=[{'all':!![]}];}return db[_0x3c0c('0x3c')][_0x3c0c('0x3f')](_0x12bd0b);})[_0x3c0c('0x22')](function(_0x10bd22){_0x5bbfcd[_0x3c0c('0x40')]=_0x10bd22;return _0x5bbfcd;})[_0x3c0c('0x22')](respondWithFilteredResult(_0x1960bb,_0x12bd0b))[_0x3c0c('0x41')](handleError(_0x1960bb,null));};exports['show']=function(_0x3510c6,_0x48b582){var _0xce611a={'raw':![],'where':{'id':_0x3510c6[_0x3c0c('0x42')]['id']}},_0x583007={};_0x583007[_0x3c0c('0x2a')]=_[_0x3c0c('0x2b')](db[_0x3c0c('0x3c')][_0x3c0c('0x29')]);_0x583007[_0x3c0c('0x2d')]=_[_0x3c0c('0x2b')](_0x3510c6[_0x3c0c('0x2d')]);_0x583007[_0x3c0c('0x34')]=_[_0x3c0c('0x2c')](_0x583007['model'],_0x583007['query']);_0xce611a[_0x3c0c('0x2e')]=_[_0x3c0c('0x2c')](_0x583007[_0x3c0c('0x2a')],qs[_0x3c0c('0x2f')](_0x3510c6[_0x3c0c('0x2d')][_0x3c0c('0x2f')]));_0xce611a['attributes']=_0xce611a[_0x3c0c('0x2e')]['length']?_0xce611a[_0x3c0c('0x2e')]:_0x583007[_0x3c0c('0x2a')];if(_0x3510c6[_0x3c0c('0x2d')]['includeAll']){_0xce611a['include']=[{'all':!![]}];}_0xce611a=_[_0x3c0c('0x37')]({},_0xce611a,_0x3510c6['options']);return db['UserProfile'][_0x3c0c('0x43')](_0xce611a)[_0x3c0c('0x22')](handleEntityNotFound(_0x48b582,null))['then'](respondWithResult(_0x48b582,null))[_0x3c0c('0x41')](handleError(_0x48b582,null));};exports[_0x3c0c('0x44')]=function(_0x253881,_0xc70e7e){return db[_0x3c0c('0x3c')][_0x3c0c('0x44')](_0x253881[_0x3c0c('0x45')],{})[_0x3c0c('0x22')](respondWithResult(_0xc70e7e,0xc9))[_0x3c0c('0x41')](handleError(_0xc70e7e,null));};exports['clone']=function(_0x35f42b,_0x27f484){var _0x2ba87c={'raw':![],'where':{'id':_0x35f42b[_0x3c0c('0x42')]['id']}},_0x2e0bdd={};_0x2e0bdd[_0x3c0c('0x2a')]=_[_0x3c0c('0x2b')](db[_0x3c0c('0x3c')][_0x3c0c('0x29')]);_0x2ba87c[_0x3c0c('0x2e')]=_[_0x3c0c('0x2c')](_0x2e0bdd[_0x3c0c('0x2a')],qs[_0x3c0c('0x2f')](_0x35f42b[_0x3c0c('0x2d')][_0x3c0c('0x2f')]));_0x2ba87c['attributes']=_0x2ba87c[_0x3c0c('0x2e')][_0x3c0c('0x46')]?_0x2ba87c[_0x3c0c('0x2e')]:_0x2e0bdd[_0x3c0c('0x2a')];if(_0x35f42b['query']['includeAll']){_0x2ba87c[_0x3c0c('0x3e')]=[{'all':!![]}];}_0x2ba87c=_[_0x3c0c('0x37')]({},_0x2ba87c,_0x35f42b[_0x3c0c('0x3b')]);return db[_0x3c0c('0x3c')][_0x3c0c('0x43')](_0x2ba87c)[_0x3c0c('0x22')](handleEntityNotFound(_0x27f484,null))[_0x3c0c('0x22')](function(_0x491826){if(_0x491826){var _0x67e43d=_0x491826[_0x3c0c('0x47')]({'plain':!![]});_0x67e43d=qs[_0x3c0c('0x48')](_0x67e43d,['id','createdAt',_0x3c0c('0x49'),_0x3c0c('0x4a')]);_0x35f42b[_0x3c0c('0x45')]=_['omit'](_0x35f42b[_0x3c0c('0x45')],['id','createdAt',_0x3c0c('0x49')]);return db[_0x3c0c('0x4b')][_0x3c0c('0x4c')](function(_0x3d7ee0){return db[_0x3c0c('0x3c')][_0x3c0c('0x44')](_[_0x3c0c('0x37')](_0x67e43d,_0x35f42b['body']),{'include':_0x35f42b[_0x3c0c('0x2d')][_0x3c0c('0x4d')]?[{'all':!![]}]:undefined,'transaction':_0x3d7ee0})[_0x3c0c('0x22')](function(_0x4303cb){var _0x523de4=_0x4303cb['get']({'plain':!![]});return db[_0x3c0c('0x4e')][_0x3c0c('0x3f')]({'where':{'userProfileId':_0x35f42b['params']['id']},'raw':!![]})['then'](function(_0x91798){if(_0x91798){return BPromise[_0x3c0c('0x4f')](_0x91798,function(_0x5aee8e){return new BPromise(function(_0x18d403,_0x33f015){if(_0x5aee8e[_0x3c0c('0x50')]===null||_0x5aee8e[_0x3c0c('0x50')]===0x1)_0x18d403(null);return db[_0x3c0c('0x51')][_0x3c0c('0x3f')]({'where':{'sectionId':_0x5aee8e['id']},'raw':!![]})[_0x3c0c('0x22')](function(_0x17483f){var _0x5dc4c5=_[_0x3c0c('0x38')](_0x17483f,function(_0x2fa6f6){return qs['omit'](_0x2fa6f6,['id',_0x3c0c('0x52'),'updatedAt',_0x3c0c('0x53')]);});_0x18d403(_0x5dc4c5);})[_0x3c0c('0x41')](function(_0x5f2fc1){_0x33f015(_0x5f2fc1);});})[_0x3c0c('0x22')](function(_0x503584){var _0x450639=qs['omit'](_0x5aee8e,['id',_0x3c0c('0x52'),_0x3c0c('0x49')]);_0x450639['userProfileId']=_0x523de4['id'];if(_0x503584)_0x450639[_0x3c0c('0x54')]=_0x503584;return _0x450639;})[_0x3c0c('0x22')](function(_0x2d2199){return db[_0x3c0c('0x4e')][_0x3c0c('0x44')](_0x2d2199,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x3d7ee0});});})[_0x3c0c('0x22')](function(){return _0x523de4;});}});});});}})[_0x3c0c('0x22')](respondWithResult(_0x27f484,0xc9))[_0x3c0c('0x41')](handleError(_0x27f484,null));};exports['update']=function(_0x164913,_0x3f9e07){if(_0x164913[_0x3c0c('0x45')]['id']){delete _0x164913[_0x3c0c('0x45')]['id'];}return db[_0x3c0c('0x3c')][_0x3c0c('0x43')]({'where':{'id':_0x164913[_0x3c0c('0x42')]['id']}})[_0x3c0c('0x22')](handleEntityNotFound(_0x3f9e07,null))['then'](saveUpdates(_0x164913[_0x3c0c('0x45')],null))[_0x3c0c('0x22')](respondWithResult(_0x3f9e07,null))['catch'](handleError(_0x3f9e07,null));};exports[_0x3c0c('0x23')]=function(_0x5802f2,_0x92dc22){return db['UserProfile'][_0x3c0c('0x43')]({'where':{'id':_0x5802f2[_0x3c0c('0x42')]['id']}})['then'](handleEntityNotFound(_0x92dc22,null))[_0x3c0c('0x22')](removeEntity(_0x92dc22,null))[_0x3c0c('0x41')](handleError(_0x92dc22,null));};exports[_0x3c0c('0x55')]=function(_0x5b2a60,_0x1363ed){return db[_0x3c0c('0x3c')][_0x3c0c('0x55')]()[_0x3c0c('0x22')](respondWithResult(_0x1363ed,null))['catch'](handleError(_0x1363ed,null));};exports[_0x3c0c('0x56')]=function(_0x104f9f,_0x22a807){var _0x34a4b2=_0x104f9f['body'];return db['UserProfile'][_0x3c0c('0x43')]({'where':{'id':_0x104f9f[_0x3c0c('0x42')]['id']}})[_0x3c0c('0x22')](handleEntityNotFound(_0x22a807,null))[_0x3c0c('0x22')](function(_0x54f72d){if(_0x54f72d){return db[_0x3c0c('0x4b')]['transaction'](function(_0x163440){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x104f9f[_0x3c0c('0x42')]['id'],'sectionId':_['map'](_0x34a4b2,function(_0x14fb4b){return _0x14fb4b[_0x3c0c('0x53')];})},'transaction':_0x163440})[_0x3c0c('0x22')](function(){var _0x1169af=_[_0x3c0c('0x38')](_0x34a4b2,function(_0x51bdc8){_0x51bdc8['userProfileId']=_0x104f9f[_0x3c0c('0x42')]['id'];return _0x51bdc8;});var _0x20d94f=[];return BPromise[_0x3c0c('0x4f')](_0x1169af,function(_0x283a69){return db[_0x3c0c('0x4e')][_0x3c0c('0x44')](_0x283a69,{'include':[{'model':db[_0x3c0c('0x51')],'as':_0x3c0c('0x54')}],'raw':!![],'transaction':_0x163440})[_0x3c0c('0x22')](function(_0x146efd){_0x20d94f[_0x3c0c('0x57')](_0x146efd['get']({'plain':!![]}));});})[_0x3c0c('0x22')](function(){return _0x20d94f;});});});}})[_0x3c0c('0x22')](function(_0x2c5974){return _0x2c5974;})[_0x3c0c('0x22')](respondWithResult(_0x22a807,null))[_0x3c0c('0x41')](handleError(_0x22a807,null));};exports[_0x3c0c('0x58')]=function(_0x493741,_0x4f3c7d){var _0x5c3e83;return db[_0x3c0c('0x3c')]['find']({'where':{'id':_0x493741[_0x3c0c('0x42')]['id']},'attributes':['id',_0x3c0c('0x27')]})[_0x3c0c('0x22')](handleEntityNotFound(_0x4f3c7d,null))[_0x3c0c('0x22')](function(_0x597b3d){if(_0x597b3d){_0x5c3e83=_0x597b3d;return db[_0x3c0c('0x4e')][_0x3c0c('0x23')]({'where':{'userProfileId':_0x493741[_0x3c0c('0x42')]['id'],'sectionId':_0x493741['query'][_0x3c0c('0x59')]}});}})['then'](function(){return _0x5c3e83;})[_0x3c0c('0x22')](respondWithStatusCode(_0x4f3c7d,null))[_0x3c0c('0x41')](handleError(_0x4f3c7d,null));};exports[_0x3c0c('0x5a')]=function(_0x3dc342,_0xdf1b83){return db[_0x3c0c('0x3c')]['find']({'where':{'id':_0x3dc342[_0x3c0c('0x42')]['id']}})['then'](handleEntityNotFound(_0xdf1b83,null))[_0x3c0c('0x22')](function(_0x35084e){if(_0x35084e){return db['sequelize'][_0x3c0c('0x4c')](function(_0x4904ff){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3dc342[_0x3c0c('0x42')]['id']},'attributes':['id'],'raw':!![]})[_0x3c0c('0x22')](function(_0x5e51cc){if(_0x5e51cc){return db[_0x3c0c('0x4e')][_0x3c0c('0x23')]({'where':{'userProfileId':_0x3dc342['params']['id'],'id':_[_0x3c0c('0x38')](_0x5e51cc,function(_0x9d1e62){return _0x9d1e62['id'];})},'transaction':_0x4904ff});}})[_0x3c0c('0x22')](function(_0x5d01a8){var _0xa54497=_[_0x3c0c('0x38')](_0x3dc342[_0x3c0c('0x45')],function(_0x5d87f7){_0x5d87f7[_0x3c0c('0x5b')]=_0x3dc342[_0x3c0c('0x42')]['id'];return _0x5d87f7;});return db[_0x3c0c('0x4e')]['bulkCreate'](_0xa54497,{'raw':!![],'transaction':_0x4904ff});})[_0x3c0c('0x22')](function(_0x48473a){var _0x484c7b=_[_0x3c0c('0x35')](_[_0x3c0c('0x38')](_0x48473a,function(_0x5ea94a){return _0x5ea94a[_0x3c0c('0x47')]({'plain':!![]});}),{'includeAll':![]});if(_0x484c7b){return db[_0x3c0c('0x4e')][_0x3c0c('0x3f')]({'where':{'userProfileId':_0x3dc342[_0x3c0c('0x42')]['id'],'sectionId':_[_0x3c0c('0x38')](_0x484c7b,function(_0x54e63b){return _0x54e63b[_0x3c0c('0x53')];})},'attributes':['id',_0x3c0c('0x53')],'raw':!![]})[_0x3c0c('0x22')](function(_0x575156){var _0x1ab756=_[_0x3c0c('0x38')](_0x3dc342[_0x3c0c('0x45')],function(_0x469e10){_0x469e10[_0x3c0c('0x5b')]=_0x3dc342[_0x3c0c('0x42')]['id'];return _0x469e10;});return db[_0x3c0c('0x51')][_0x3c0c('0x5c')](_0x1ab756,{'raw':!![],'transaction':_0x4904ff});});}})[_0x3c0c('0x41')](handleError(_0xdf1b83,null));});}})['then'](function(_0x43ade1){var _0x283b82=_[_0x3c0c('0x38')](_0x43ade1,function(_0x472f28){return _0x472f28[_0x3c0c('0x47')]({'plain':!![]});});})[_0x3c0c('0x22')](respondWithResult(_0xdf1b83,null))['catch'](handleError(_0xdf1b83,null));};exports[_0x3c0c('0x5d')]=function(_0xe9db1f,_0x253a0f,_0x2587b0){var _0x443f6f;return db[_0x3c0c('0x3c')][_0x3c0c('0x43')]({'where':{'id':_0xe9db1f['params']['id']}})[_0x3c0c('0x22')](handleEntityNotFound(_0x253a0f,null))['then'](function(_0x12472c){if(_0x12472c){return _0x12472c[_0x3c0c('0x5d')](_0xe9db1f[_0x3c0c('0x2d')]['ids']);}})['then'](respondWithStatusCode(_0x253a0f,null))['catch'](handleError(_0x253a0f,null));};exports[_0x3c0c('0x5e')]=function(_0x4deb23,_0x512bb7){var _0x5138a3={'raw':![],'where':{}};var _0x4cdbde={};var _0xad9c49={'count':0x0,'rows':[]};var _0x33a9f9=_0x4deb23[_0x3c0c('0x2d')][_0x3c0c('0x5f')];if(typeof _0x33a9f9===_0x3c0c('0x60')){throw new db[(_0x3c0c('0x61'))][(_0x3c0c('0x62'))](_0x3c0c('0x63'));}var _0xacd24e=_0x4deb23[_0x3c0c('0x2d')][_0x3c0c('0x64')]||![];var _0x133deb=getQueryModels(_0x33a9f9,_0xacd24e);if(typeof _0x133deb['childModel']===_0x3c0c('0x60')){throw new db['Sequelize'][(_0x3c0c('0x62'))](_0x3c0c('0x65')+_0x33a9f9+'\x27');}var _0x56897f=[];if(!_['isEmpty'](_0x133deb['parentSections'])){_0x56897f=_0x133deb['parentSections'];}else{_0x56897f=[{'name':_0x33a9f9}];}return db['UserProfile']['findOne']({'where':{'id':_0x4deb23['params']['id']}})['then'](handleEntityNotFound(_0x512bb7,null))[_0x3c0c('0x22')](function(_0x4b86b7){if(_0x4b86b7){var _0xf6a7b7=[];for(var _0x1135aa=0x0;_0x1135aa<_0x56897f[_0x3c0c('0x46')];_0x1135aa++){_0xf6a7b7[_0x3c0c('0x57')](db[_0x3c0c('0x4e')][_0x3c0c('0x66')]({'where':{'userProfileId':_0x4b86b7['id'],'name':_0x56897f[_0x1135aa]['name']},'raw':!![]}));}return BPromise[_0x3c0c('0x67')](_0xf6a7b7);}})[_0x3c0c('0x22')](function(_0x31d4e6){var _0x139416=_[_0x3c0c('0x35')](_0x31d4e6,function(_0x4251bc){return _0x4251bc?_0x4251bc:undefined;});var _0x1619c2=_[_0x3c0c('0x35')](_0x56897f,[_0x3c0c('0x68'),!![]]);var _0x4f0d0d=_[_0x3c0c('0x69')](_0x139416)&&_[_0x3c0c('0x69')](_0x1619c2)?null:_['union'](_0x1619c2,_0x139416);if(_0x4f0d0d){var _0x2a281d=[];for(var _0x168470=0x0;_0x168470<_0x4f0d0d[_0x3c0c('0x46')];_0x168470++){var _0x33349f=_[_0x3c0c('0x43')](_0x56897f,function(_0x5010b7){return _0x4f0d0d[_0x168470]?_0x5010b7[_0x3c0c('0x27')]===_0x4f0d0d[_0x168470][_0x3c0c('0x27')]:null;});if(_0x33349f){if(_0x4f0d0d[_0x168470][_0x3c0c('0x68')]){_0x2a281d['push'](getAllResources(_0x133deb[_0x3c0c('0x6a')],_0x4f0d0d[_0x168470]));}else{if(!_0x4f0d0d[_0x168470][_0x3c0c('0x50')]){_0x2a281d[_0x3c0c('0x57')](getAllowedResources(_0x33349f,_0x4f0d0d[_0x168470]));}else{if(_0x33349f[_0x3c0c('0x2a')]){_0x2a281d[_0x3c0c('0x57')](getAllFilteredResources(_0x33349f,_0x4f0d0d[_0x168470]));}}}}}return BPromise['all'](_0x2a281d);}else{return null;}})[_0x3c0c('0x22')](function(_0x2dfac6){var _0x5b385a=_0x2dfac6;var _0x5da06a=null;if(_0x5b385a){_0x5da06a=_0x5b385a[_0x3c0c('0x46')]===0x1?_0x5b385a[0x0]:null;}if(_0x5da06a||_0x5b385a){var _0x15790a=db[_0x133deb[_0x3c0c('0x6a')]][_0x3c0c('0x29')];_0x4cdbde[_0x3c0c('0x2a')]=_['keys'](_0x15790a);_0x4cdbde[_0x3c0c('0x2d')]=_[_0x3c0c('0x2b')](_0x4deb23['query']);_0x4cdbde[_0x3c0c('0x34')]=_[_0x3c0c('0x2c')](_0x4cdbde[_0x3c0c('0x2a')],_0x4cdbde['query']);_0x5138a3['attributes']=_[_0x3c0c('0x2c')](_0x4cdbde[_0x3c0c('0x2a')],qs[_0x3c0c('0x2f')](_0x4deb23[_0x3c0c('0x2d')][_0x3c0c('0x2f')]));_0x5138a3['attributes']=_0x5138a3[_0x3c0c('0x2e')][_0x3c0c('0x46')]?_0x5138a3['attributes']:_0x4cdbde[_0x3c0c('0x2a')];if(!_0x4deb23['query'][_0x3c0c('0x30')](_0x3c0c('0x31'))){_0x5138a3[_0x3c0c('0x1d')]=qs[_0x3c0c('0x1d')](_0x4deb23[_0x3c0c('0x2d')]['limit']);_0x5138a3[_0x3c0c('0x1c')]=qs[_0x3c0c('0x1c')](_0x4deb23[_0x3c0c('0x2d')]['offset']);}_0x5138a3[_0x3c0c('0x32')]=qs['sort'](_0x4deb23[_0x3c0c('0x2d')][_0x3c0c('0x33')]);_0x5138a3[_0x3c0c('0x36')]=qs[_0x3c0c('0x34')](_[_0x3c0c('0x6b')](_0x4deb23['query'],_0x4cdbde[_0x3c0c('0x34')]));var _0x1ed604=[];if(_0x5da06a){var _0x1d9555=_['find'](_0x56897f,[_0x3c0c('0x27'),_0x5da06a[_0x3c0c('0x27')]]);if(_0x1d9555[_0x3c0c('0x6c')]){var _0x319039={};_0x319039[_0x1d9555[_0x3c0c('0x6d')]]=_0x5da06a['resourceFields'];_0x1ed604[_0x3c0c('0x57')](_0x319039);}else{_0x5138a3['where']['id']=_0x5da06a[_0x3c0c('0x6e')];}}else{var _0x1ed604=[];for(var _0x72cbe2=0x0;_0x72cbe2<_0x5b385a[_0x3c0c('0x46')];_0x72cbe2++){var _0x1d9555=_[_0x3c0c('0x43')](_0x56897f,['name',_0x5b385a[_0x72cbe2][_0x3c0c('0x27')]]);if(_0x1d9555['field']){var _0x319039={};if(_0x1d9555[_0x3c0c('0x6c')]==='id'){_0x319039[_0x1d9555[_0x3c0c('0x6d')]]=_0x5b385a[_0x72cbe2][_0x3c0c('0x6e')];}else{_0x319039[_0x1d9555[_0x3c0c('0x6d')]]=_0x5b385a[_0x72cbe2][_0x3c0c('0x6f')];}_0x1ed604[_0x3c0c('0x57')](_0x319039);}else{if(!_0x5138a3[_0x3c0c('0x36')]['id'])_0x5138a3['where']['id']=[];_0x5b385a[_0x72cbe2][_0x3c0c('0x6e')][_0x3c0c('0x70')](function(_0x5bb145){_0x5138a3[_0x3c0c('0x36')]['id']['push'](_0x5bb145);});}}}if(!_[_0x3c0c('0x69')](_0x1ed604)){_0x5138a3[_0x3c0c('0x36')]=_[_0x3c0c('0x37')](_0x5138a3['where'],{'$or':_0x1ed604});}if(_0x4deb23['query'][_0x3c0c('0x35')]){_0x5138a3[_0x3c0c('0x36')]=_['merge'](_0x5138a3[_0x3c0c('0x36')],{'$or':_[_0x3c0c('0x38')](_0x15790a,function(_0x493341){if(_0x493341[_0x3c0c('0x71')][_0x3c0c('0x39')]!=='VIRTUAL'){var _0x1056f8={};_0x1056f8[_0x493341[_0x3c0c('0x6c')]]={'$like':'%'+_0x4deb23[_0x3c0c('0x2d')][_0x3c0c('0x35')]+'%'};return _0x1056f8;}})});}_0x5138a3=_[_0x3c0c('0x37')]({},_0x5138a3,_0x4deb23[_0x3c0c('0x3b')]);if(_0x5da06a&&!_0x5da06a['autoAssociation']&&_0x133deb['childModel']===_0x3c0c('0x72')){if(_0x4deb23[_0x3c0c('0x2d')]['includeAll']){_0x5138a3[_0x3c0c('0x3e')]=[{'all':!![]}];}return db[_0x133deb[_0x3c0c('0x6a')]]['findAll'](_0x5138a3)[_0x3c0c('0x22')](function(_0x248c19){var _0x39c46=[];_0x248c19[_0x3c0c('0x70')](function(_0x4ba8ed){var _0x192299;switch(_0x4ba8ed['reportType']){case _0x3c0c('0x73'):_0x192299=_[_0x3c0c('0x43')](_0x5da06a['resourceIds'],function(_0x45f88f){return _0x45f88f['id']===_0x4ba8ed[_0x3c0c('0x74')]&&_0x45f88f[_0x3c0c('0x71')]===_0x3c0c('0x75');});break;case _0x3c0c('0x76'):_0x192299=_[_0x3c0c('0x43')](_0x5da06a['resourceIds'],function(_0x3428c2){return _0x3428c2['id']===_0x4ba8ed[_0x3c0c('0x74')]&&_0x3428c2['type']==='CustomReports';});break;}if(_0x192299)_0x39c46[_0x3c0c('0x57')](_0x4ba8ed);});_0xad9c49['count']=_0x39c46[_0x3c0c('0x46')];_0xad9c49[_0x3c0c('0x40')]=_0x39c46;return _0xad9c49;});}else{return db[_0x133deb[_0x3c0c('0x6a')]][_0x3c0c('0x3d')]({'where':_0x5138a3[_0x3c0c('0x36')]})[_0x3c0c('0x22')](function(_0x28d455){_0xad9c49[_0x3c0c('0x3d')]=_0x28d455;if(_0x4deb23[_0x3c0c('0x2d')][_0x3c0c('0x4d')]){if(_0x133deb[_0x3c0c('0x6a')]===_0x3c0c('0x77')){_0x5138a3[_0x3c0c('0x3e')]=[{'model':db['Tag'],'as':_0x3c0c('0x78'),'attributes':['id','name','color'],'required':_0x4deb23[_0x3c0c('0x2d')][_0x3c0c('0x79')]?!![]:![]},{'model':db[_0x3c0c('0x7a')],'as':_0x3c0c('0x7b'),'attributes':['id',_0x3c0c('0x27'),_0x3c0c('0x7c')],'through':_0x4deb23[_0x3c0c('0x2d')]['tag']?{'attributes':[],'where':{'TagId':_0x4deb23[_0x3c0c('0x2d')][_0x3c0c('0x79')]||undefined}}:{},'required':_0x4deb23[_0x3c0c('0x2d')][_0x3c0c('0x79')]?!![]:![]}];}else{_0x5138a3[_0x3c0c('0x3e')]=[{'all':!![]}];}}return db[_0x133deb[_0x3c0c('0x6a')]][_0x3c0c('0x3f')](_0x5138a3);})[_0x3c0c('0x22')](function(_0x1b7fcc){_0xad9c49[_0x3c0c('0x40')]=_0x1b7fcc;return _0xad9c49;});}}else{return _0xad9c49;}})[_0x3c0c('0x22')](respondWithFilteredResult(_0x512bb7,_0x5138a3))[_0x3c0c('0x41')](handleError(_0x512bb7,null));};function getAllResources(_0x31dd2e,_0xdda0e){return new BPromise(function(_0x56c70f,_0x4bafe8){if(_0xdda0e){var _0x4f805b=_0xdda0e[_0x3c0c('0x35')]?{[_0xdda0e[_0x3c0c('0x35')]['field']]:_0xdda0e[_0x3c0c('0x35')][_0x3c0c('0x7d')]}:undefined;return db[_0x31dd2e][_0x3c0c('0x3f')]({'where':_0x4f805b,'raw':!![]})['then'](function(_0x3ea730){_0xdda0e['resourceIds']=_[_0x3c0c('0x38')](_0x3ea730,'id');_0x56c70f(_0xdda0e);})['catch'](function(_0x18930e){_0x4bafe8(_0x18930e);});}else{_0x56c70f(null);}});}function getAllFilteredResources(_0x39540a,_0x31a0fd){return new BPromise(function(_0x2e551a,_0x53e141){var _0x373948=_0x39540a[_0x3c0c('0x35')]?{[_0x39540a[_0x3c0c('0x35')][_0x3c0c('0x6c')]]:_0x39540a['filter']['value']}:undefined;return db[_0x39540a[_0x3c0c('0x2a')]][_0x3c0c('0x3f')]({'where':_0x373948,'raw':!![]})['then'](function(_0x10451b){_0x31a0fd[_0x3c0c('0x6f')]=_[_0x3c0c('0x38')](_0x10451b,function(_0x5a8874){return _0x5a8874[_0x3c0c('0x27')];});_0x2e551a(_0x31a0fd);})[_0x3c0c('0x41')](function(_0x3aa3da){_0x53e141(_0x3aa3da);});});}function getAllowedResources(_0x4f73bc,_0x991cb0){return new BPromise(function(_0x3e1d47,_0x3df8fa){if(_0x991cb0){return db['UserProfileResource'][_0x3c0c('0x3f')]({'where':{'sectionId':_0x991cb0['id']},'raw':!![]})[_0x3c0c('0x22')](function(_0x3d1a19){if(_0x4f73bc[_0x3c0c('0x6c')]&&_0x4f73bc['field']!=='id'){_0x991cb0['resourceFields']=_[_0x3c0c('0x38')](_0x3d1a19,function(_0x1badd0){return _0x1badd0[_0x4f73bc['field']];});}else{if(_0x4f73bc['childModel']===_0x3c0c('0x72')){_0x991cb0[_0x3c0c('0x6e')]=_['map'](_0x3d1a19,function(_0x3d6744){return{'id':_0x3d6744[_0x3c0c('0x7e')],'type':_0x3d6744[_0x3c0c('0x71')]};});}else{_0x991cb0[_0x3c0c('0x6e')]=_[_0x3c0c('0x38')](_0x3d1a19,function(_0x2b2cdb){return _0x2b2cdb[_0x3c0c('0x7e')];});}}_0x3e1d47(_0x991cb0);})[_0x3c0c('0x41')](function(_0x54b5b3){_0x3df8fa(_0x54b5b3);});}else{_0x3e1d47(null);}});}function getQueryModels(_0x260c6d,_0x3afdc8){var _0x4a9354=_0x260c6d[_0x3c0c('0x7f')]();var _0x3ca022={'childModel':undefined,'parentSections':[]};switch(_0x4a9354){case _0x3c0c('0x80'):_0x3ca022['childModel']=_0x3c0c('0x81');break;case _0x3c0c('0x82'):_0x3ca022['childModel']=_0x3c0c('0x83');break;case _0x3c0c('0x84'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0x85');_0x3ca022[_0x3c0c('0x86')]=[{'name':_0x3c0c('0x87'),'field':_0x3c0c('0x27'),'foreignKey':_0x3c0c('0x88')}];break;case _0x3c0c('0x89'):_0x3ca022[_0x3c0c('0x6a')]='JscriptyProject';break;case'contacts':_0x3ca022['childModel']=_0x3c0c('0x77');_0x3ca022[_0x3c0c('0x86')]=[{'name':'Lists','field':'id','foreignKey':_0x3c0c('0x8a')}];break;case _0x3c0c('0x8b'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0x8c');break;case _0x3c0c('0x8d'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0x8e');break;case'globalcustomfields':_0x3ca022[_0x3c0c('0x6a')]='CmCustomField';break;case'chatqueues':_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0x8f');break;case _0x3c0c('0x90'):_0x3ca022[_0x3c0c('0x6a')]='ChatWebsite';break;case _0x3c0c('0x91'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0x92');break;case _0x3c0c('0x93'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0x94');break;case _0x3c0c('0x95'):case _0x3c0c('0x96'):case _0x3c0c('0x97'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0x98');break;case _0x3c0c('0x99'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0x9a');break;case _0x3c0c('0x9b'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0x9c');break;case _0x3c0c('0x9d'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0x9e');_0x3ca022[_0x3c0c('0x86')]=[{'name':_0x3c0c('0x9f'),'field':_0x3c0c('0x27'),'foreignKey':_0x3c0c('0xa0'),'model':_0x3c0c('0xa1'),'filter':{'field':'role','value':[_0x3c0c('0xa2')]}},{'name':_0x3c0c('0xa3'),'field':_0x3c0c('0x27'),'foreignKey':_0x3c0c('0xa0'),'model':_0x3c0c('0xa1'),'filter':{'field':_0x3c0c('0xa4'),'value':[_0x3c0c('0xa5')]}},{'name':_0x3c0c('0xa6'),'field':_0x3c0c('0x27'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x3c0c('0x71'),'value':['inbound']}},{'name':_0x3c0c('0xa7'),'field':'name','foreignKey':_0x3c0c('0xa8'),'model':_0x3c0c('0xa9'),'filter':{'field':_0x3c0c('0x71'),'value':[_0x3c0c('0xaa')]}}];break;case _0x3c0c('0xab'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xac');break;case _0x3c0c('0xad'):_0x3ca022['childModel']=_0x3c0c('0xae');break;case'voiceprefixes':_0x3ca022['childModel']=_0x3c0c('0xaf');break;case _0x3c0c('0xb0'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xb1');break;case _0x3c0c('0xb2'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xb3');break;case _0x3c0c('0xb4'):_0x3ca022['childModel']=_0x3c0c('0xb5');break;case _0x3c0c('0xb6'):_0x3ca022[_0x3c0c('0x6a')]='MailSubstatus';break;case _0x3c0c('0xb7'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xb8');break;case _0x3c0c('0xb9'):_0x3ca022['childModel']='OpenchannelAccount';break;case _0x3c0c('0xba'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xbb');break;case _0x3c0c('0xbc'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xbd');break;case _0x3c0c('0xbe'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xbf');break;case _0x3c0c('0xc0'):case _0x3c0c('0xc1'):_0x3ca022['childModel']='VoiceQueue';if(_0x3afdc8){_0x3ca022[_0x3c0c('0x86')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x3c0c('0xc2'):case'agents':case'telephones':_0x3ca022['childModel']=_0x3c0c('0xa1');if(_0x3afdc8){_0x3ca022[_0x3c0c('0x86')]=[{'name':_0x3c0c('0xc3'),'filter':{'field':'role','value':[_0x3c0c('0xc4'),'user']},'ignore':!![]},{'name':_0x3c0c('0x9f')},{'name':_0x3c0c('0xa3')}];}break;case _0x3c0c('0xc5'):_0x3ca022['childModel']=_0x3c0c('0xc6');break;case _0x3c0c('0xc7'):_0x3ca022[_0x3c0c('0x6a')]='SalesforceAccount';break;case _0x3c0c('0xc8'):_0x3ca022[_0x3c0c('0x6a')]='FreshdeskAccount';break;case _0x3c0c('0xc9'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xca');break;case _0x3c0c('0xcb'):_0x3ca022['childModel']=_0x3c0c('0xcc');break;case _0x3c0c('0xcd'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xce');break;case _0x3c0c('0xcf'):_0x3ca022[_0x3c0c('0x6a')]='User';break;case'cannedanswers':_0x3ca022[_0x3c0c('0x6a')]='CannedAnswer';break;case _0x3c0c('0xd0'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xd1');break;case _0x3c0c('0xd2'):_0x3ca022['childModel']=_0x3c0c('0xd3');break;case _0x3c0c('0xd4'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xd5');break;case _0x3c0c('0xd6'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xd7');break;case'scheduler':_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xd8');break;case _0x3c0c('0xd9'):_0x3ca022['childModel']=_0x3c0c('0xda');break;case _0x3c0c('0xdb'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0x7a');break;case _0x3c0c('0xdc'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xdd');break;case'triggers':_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xde');break;case _0x3c0c('0xdf'):_0x3ca022[_0x3c0c('0x6a')]='Trunk';break;case'variables':_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xe0');break;case _0x3c0c('0xe1'):_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0xe2');break;case'extractedreports':_0x3ca022[_0x3c0c('0x6a')]=_0x3c0c('0x72');_0x3ca022[_0x3c0c('0x86')]=[{'name':_0x3c0c('0xe3'),'field':'id','foreignKey':_0x3c0c('0x74')}];break;case _0x3c0c('0xe4'):_0x3ca022[_0x3c0c('0x6a')]='AnalyticMetric';break;default:return _0x3ca022;}return _0x3ca022;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index f23f03d..cbef370 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 _0x6439=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x174f15,_0x93467c){var _0x1c6707=function(_0x473bfb){while(--_0x473bfb){_0x174f15['push'](_0x174f15['shift']());}};_0x1c6707(++_0x93467c);}(_0x6439,0x1ce));var _0x9643=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x6439[_0x45d55e];return _0x29812a;};'use strict';var EventEmitter=require(_0x9643('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x9643('0x1')](0x0);var events={'afterCreate':_0x9643('0x2'),'afterUpdate':_0x9643('0x3'),'afterDestroy':_0x9643('0x4')};function emitEvent(_0x3c428b){return function(_0x2bfe74,_0x52590b,_0xe4deb9){UserProfileEvents['emit'](_0x3c428b+':'+_0x2bfe74['id'],_0x2bfe74);UserProfileEvents[_0x9643('0x5')](_0x3c428b,_0x2bfe74);_0xe4deb9(null);};}for(var e in events){if(events[_0x9643('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xeb5d=['hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x2ad9ed,_0x1e083b){var _0x526d09=function(_0x5c1951){while(--_0x5c1951){_0x2ad9ed['push'](_0x2ad9ed['shift']());}};_0x526d09(++_0x1e083b);}(_0xeb5d,0x174));var _0xdeb5=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xeb5d[_0x178e48];return _0x440d7e;};'use strict';var EventEmitter=require(_0xdeb5('0x0'));var UserProfile=require(_0xdeb5('0x1'))['db'][_0xdeb5('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xdeb5('0x3')](0x0);var events={'afterCreate':_0xdeb5('0x4'),'afterUpdate':'update','afterDestroy':_0xdeb5('0x5')};function emitEvent(_0x40456d){return function(_0x3a7a0d,_0x158500,_0x531731){UserProfileEvents[_0xdeb5('0x6')](_0x40456d+':'+_0x3a7a0d['id'],_0x3a7a0d);UserProfileEvents['emit'](_0x40456d,_0x3a7a0d);_0x531731(null);};}for(var e in events){if(events[_0xdeb5('0x7')](e)){var event=events[e];UserProfile[_0xdeb5('0x8')](e,emitEvent(event));}}module[_0xdeb5('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 7a2d85f..1da319d 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 _0xec35=['lodash','util','../../config/logger','api','moment','request-promise','exports','define','UserProfile','user_profiles'];(function(_0x1de04f,_0xd7623a){var _0x238b01=function(_0x196d5f){while(--_0x196d5f){_0x1de04f['push'](_0x1de04f['shift']());}};_0x238b01(++_0xd7623a);}(_0xec35,0x15e));var _0x5ec3=function(_0x230e14,_0x903cc4){_0x230e14=_0x230e14-0x0;var _0x7b04ce=_0xec35[_0x230e14];return _0x7b04ce;};'use strict';var _=require(_0x5ec3('0x0'));var util=require(_0x5ec3('0x1'));var logger=require(_0x5ec3('0x2'))(_0x5ec3('0x3'));var moment=require(_0x5ec3('0x4'));var BPromise=require('bluebird');var rp=require(_0x5ec3('0x5'));var attributes=require('./userProfile.attributes');module[_0x5ec3('0x6')]=function(_0x5bfd80,_0x160981){return _0x5bfd80[_0x5ec3('0x7')](_0x5ec3('0x8'),attributes,{'tableName':_0x5ec3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb012=['define','UserProfile','lodash','../../config/logger','api','bluebird','request-promise','./userProfile.attributes','exports'];(function(_0x49fcfc,_0x104175){var _0x4ab162=function(_0x2fb28b){while(--_0x2fb28b){_0x49fcfc['push'](_0x49fcfc['shift']());}};_0x4ab162(++_0x104175);}(_0xb012,0x13d));var _0x2b01=function(_0x49dc43,_0x25d6d2){_0x49dc43=_0x49dc43-0x0;var _0x3e7d23=_0xb012[_0x49dc43];return _0x3e7d23;};'use strict';var _=require(_0x2b01('0x0'));var util=require('util');var logger=require(_0x2b01('0x1'))(_0x2b01('0x2'));var moment=require('moment');var BPromise=require(_0x2b01('0x3'));var rp=require(_0x2b01('0x4'));var attributes=require(_0x2b01('0x5'));module[_0x2b01('0x6')]=function(_0x3f3c8f,_0x331bdb){return _0x3f3c8f[_0x2b01('0x7')](_0x2b01('0x8'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 89c27ad..b45b3c9 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 _0x1ad8=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ad8,0x179));var _0x81ad=function(_0x5cd791,_0x39d21b){_0x5cd791=_0x5cd791-0x0;var _0x46ea9b=_0x1ad8[_0x5cd791];return _0x46ea9b;};'use strict';var _=require(_0x81ad('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x81ad('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x81ad('0x2'));var logger=require(_0x81ad('0x3'))(_0x81ad('0x4'));var config=require('../../config/environment');var jayson=require(_0x81ad('0x5'));var client=jayson[_0x81ad('0x6')][_0x81ad('0x7')]({'port':0x232a});config[_0x81ad('0x8')]=_[_0x81ad('0x9')](config[_0x81ad('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x81ad('0xa'))(new Redis(config[_0x81ad('0x8')]));require(_0x81ad('0xb'))['register'](socket);function respondWithRpcPromise(_0x8cf68d,_0x5000f0,_0x3ac5a0){return new BPromise(function(_0x556d6a,_0x1ff63a){return client[_0x81ad('0xc')](_0x8cf68d,_0x3ac5a0)[_0x81ad('0xd')](function(_0x30dc9c){logger[_0x81ad('0xe')](_0x81ad('0xf'),_0x5000f0,_0x81ad('0x10'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x5000f0,_0x81ad('0x10'),JSON['stringify'](_0x30dc9c));if(_0x30dc9c[_0x81ad('0x11')]){if(_0x30dc9c[_0x81ad('0x11')][_0x81ad('0x12')]===0x1f4){logger[_0x81ad('0x11')](_0x81ad('0xf'),_0x5000f0,_0x30dc9c['error'][_0x81ad('0x13')]);return _0x1ff63a(_0x30dc9c['error']['message']);}logger[_0x81ad('0x11')](_0x81ad('0xf'),_0x5000f0,_0x30dc9c[_0x81ad('0x11')][_0x81ad('0x13')]);return _0x556d6a(_0x30dc9c[_0x81ad('0x11')]['message']);}else{logger[_0x81ad('0xe')](_0x81ad('0xf'),_0x5000f0,'request\x20sent');_0x556d6a(_0x30dc9c[_0x81ad('0x14')]['message']);}})['catch'](function(_0x26001a){logger['error'](_0x81ad('0xf'),_0x5000f0,_0x26001a);_0x1ff63a(_0x26001a);});});} \ No newline at end of file +var _0xc3cc=['catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x16b667,_0xadec02){var _0x58620e=function(_0x5db60b){while(--_0x5db60b){_0x16b667['push'](_0x16b667['shift']());}};_0x58620e(++_0xadec02);}(_0xc3cc,0x1c9));var _0xcc3c=function(_0x2665a3,_0x3bac99){_0x2665a3=_0x2665a3-0x0;var _0x586de6=_0xc3cc[_0x2665a3];return _0x586de6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcc3c('0x0'));var BPromise=require('bluebird');var rs=require(_0xcc3c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc3c('0x2'))['db'];var utils=require(_0xcc3c('0x3'));var logger=require(_0xcc3c('0x4'))('rpc');var config=require(_0xcc3c('0x5'));var jayson=require(_0xcc3c('0x6'));var client=jayson[_0xcc3c('0x7')][_0xcc3c('0x8')]({'port':0x232a});config[_0xcc3c('0x9')]=_[_0xcc3c('0xa')](config[_0xcc3c('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc3c('0x9')]));require('./userProfile.socket')[_0xcc3c('0xb')](socket);function respondWithRpcPromise(_0x119ed3,_0x3d89df,_0x3eb055){return new BPromise(function(_0x3d7832,_0x31966f){return client[_0xcc3c('0xc')](_0x119ed3,_0x3eb055)[_0xcc3c('0xd')](function(_0x3320cd){logger[_0xcc3c('0xe')](_0xcc3c('0xf'),_0x3d89df,_0xcc3c('0x10'));logger['debug'](_0xcc3c('0x11'),_0x3d89df,_0xcc3c('0x10'),JSON[_0xcc3c('0x12')](_0x3320cd));if(_0x3320cd[_0xcc3c('0x13')]){if(_0x3320cd[_0xcc3c('0x13')][_0xcc3c('0x14')]===0x1f4){logger[_0xcc3c('0x13')](_0xcc3c('0xf'),_0x3d89df,_0x3320cd[_0xcc3c('0x13')][_0xcc3c('0x15')]);return _0x31966f(_0x3320cd[_0xcc3c('0x13')]['message']);}logger['error'](_0xcc3c('0xf'),_0x3d89df,_0x3320cd[_0xcc3c('0x13')][_0xcc3c('0x15')]);return _0x3d7832(_0x3320cd[_0xcc3c('0x13')][_0xcc3c('0x15')]);}else{logger['info'](_0xcc3c('0xf'),_0x3d89df,_0xcc3c('0x10'));_0x3d7832(_0x3320cd[_0xcc3c('0x16')][_0xcc3c('0x15')]);}})[_0xcc3c('0x17')](function(_0x3b53e9){logger['error']('UserProfile,\x20%s,\x20%s',_0x3d89df,_0x3b53e9);_0x31966f(_0x3b53e9);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 28dc361..63c19d0 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 _0xb91a=['remove','emit','removeListener','register','./userProfile.events','save'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xb91a,0xf4));var _0xab91=function(_0x49c686,_0x1a374f){_0x49c686=_0x49c686-0x0;var _0x1861a8=_0xb91a[_0x49c686];return _0x1861a8;};'use strict';var UserProfileEvents=require(_0xab91('0x0'));var events=[_0xab91('0x1'),_0xab91('0x2'),'update'];function createListener(_0x59b921,_0x36ffe5){return function(_0x37cd1e){_0x36ffe5[_0xab91('0x3')](_0x59b921,_0x37cd1e);};}function removeListener(_0x439eb2,_0x1afca9){return function(){UserProfileEvents[_0xab91('0x4')](_0x439eb2,_0x1afca9);};}exports[_0xab91('0x5')]=function(_0x429933){for(var _0x290af9=0x0,_0x34932f=events['length'];_0x290af9<_0x34932f;_0x290af9++){var _0x1729f6=events[_0x290af9];var _0x1e8d52=createListener('userProfile:'+_0x1729f6,_0x429933);UserProfileEvents['on'](_0x1729f6,_0x1e8d52);}}; \ No newline at end of file +var _0x16cc=['userProfile:','save','remove','update','emit','removeListener','register'];(function(_0x461b52,_0x20b9ed){var _0x2c3811=function(_0xba555c){while(--_0xba555c){_0x461b52['push'](_0x461b52['shift']());}};_0x2c3811(++_0x20b9ed);}(_0x16cc,0x120));var _0xc16c=function(_0x3415b5,_0x8dfe24){_0x3415b5=_0x3415b5-0x0;var _0x193501=_0x16cc[_0x3415b5];return _0x193501;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xc16c('0x0'),_0xc16c('0x1'),_0xc16c('0x2')];function createListener(_0x29c693,_0x203166){return function(_0xef5c6){_0x203166[_0xc16c('0x3')](_0x29c693,_0xef5c6);};}function removeListener(_0x5b0f8b,_0x10c787){return function(){UserProfileEvents[_0xc16c('0x4')](_0x5b0f8b,_0x10c787);};}exports[_0xc16c('0x5')]=function(_0x1019ec){for(var _0x5ea82b=0x0,_0x3492da=events['length'];_0x5ea82b<_0x3492da;_0x5ea82b++){var _0x828798=events[_0x5ea82b];var _0x14d607=createListener(_0xc16c('0x6')+_0x828798,_0x1019ec);UserProfileEvents['on'](_0x828798,_0x14d607);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index e960562..3a0de30 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 _0x530f=['delete','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','/:id','show','post','put','update'];(function(_0x2e8763,_0x2dd77a){var _0x3e2f44=function(_0x18bfc9){while(--_0x18bfc9){_0x2e8763['push'](_0x2e8763['shift']());}};_0x3e2f44(++_0x2dd77a);}(_0x530f,0x167));var _0xf530=function(_0x1d5a32,_0x47974a){_0x1d5a32=_0x1d5a32-0x0;var _0x361ca0=_0x530f[_0x1d5a32];return _0x361ca0;};'use strict';var multer=require('multer');var util=require(_0xf530('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf530('0x1'));var router=express[_0xf530('0x2')]();var auth=require(_0xf530('0x3'));var interaction=require(_0xf530('0x4'));var config=require(_0xf530('0x5'));var controller=require(_0xf530('0x6'));router[_0xf530('0x7')]('/',auth[_0xf530('0x8')](),controller['index']);router[_0xf530('0x7')](_0xf530('0x9'),auth[_0xf530('0x8')](),controller['describe']);router[_0xf530('0x7')](_0xf530('0xa'),auth[_0xf530('0x8')](),controller[_0xf530('0xb')]);router[_0xf530('0xc')]('/',auth[_0xf530('0x8')](),controller['create']);router[_0xf530('0xd')](_0xf530('0xa'),auth[_0xf530('0x8')](),controller[_0xf530('0xe')]);router[_0xf530('0xf')](_0xf530('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xf530('0x10')]=router; \ No newline at end of file +var _0xba37=['delete','destroy','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0xba37,0xb6));var _0x7ba3=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xba37[_0x411017];return _0x2adeea;};'use strict';var multer=require(_0x7ba3('0x0'));var util=require('util');var path=require(_0x7ba3('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ba3('0x2'));var router=express['Router']();var auth=require(_0x7ba3('0x3'));var interaction=require(_0x7ba3('0x4'));var config=require(_0x7ba3('0x5'));var controller=require(_0x7ba3('0x6'));router[_0x7ba3('0x7')]('/',auth['isAuthenticated'](),controller[_0x7ba3('0x8')]);router['get']('/describe',auth[_0x7ba3('0x9')](),controller[_0x7ba3('0xa')]);router['get'](_0x7ba3('0xb'),auth[_0x7ba3('0x9')](),controller[_0x7ba3('0xc')]);router[_0x7ba3('0xd')]('/',auth[_0x7ba3('0x9')](),controller[_0x7ba3('0xe')]);router[_0x7ba3('0xf')](_0x7ba3('0xb'),auth[_0x7ba3('0x9')](),controller['update']);router[_0x7ba3('0x10')](_0x7ba3('0xb'),auth[_0x7ba3('0x9')](),controller[_0x7ba3('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 f089074..ce108c4 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 _0x9d4e=['STRING','sequelize','INTEGER'];(function(_0xe7f5b1,_0x264aea){var _0xdb5169=function(_0x40c182){while(--_0x40c182){_0xe7f5b1['push'](_0xe7f5b1['shift']());}};_0xdb5169(++_0x264aea);}(_0x9d4e,0x8b));var _0xe9d4=function(_0x955747,_0xd1ab29){_0x955747=_0x955747-0x0;var _0x3ff6d5=_0x9d4e[_0x955747];return _0x3ff6d5;};'use strict';var Sequelize=require(_0xe9d4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xe9d4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe9d4('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x43ae=['INTEGER','sequelize','exports','STRING'];(function(_0x5ba9e2,_0x11c3c1){var _0x2dcb53=function(_0x3ebbb2){while(--_0x3ebbb2){_0x5ba9e2['push'](_0x5ba9e2['shift']());}};_0x2dcb53(++_0x11c3c1);}(_0x43ae,0x175));var _0xe43a=function(_0x5e1f45,_0x2a79d5){_0x5e1f45=_0x5e1f45-0x0;var _0x52e85a=_0x43ae[_0x5e1f45];return _0x52e85a;};'use strict';var Sequelize=require(_0xe43a('0x0'));module[_0xe43a('0x1')]={'name':{'type':Sequelize[_0xe43a('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xe43a('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xe43a('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 6a5d680..c49bfea 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(_0x36735a,_0xb7e58a){var _0x11322f=function(_0x294366){while(--_0x294366){_0x36735a['push'](_0x36735a['shift']());}};_0x11322f(++_0xb7e58a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 _0xb10b=['includeAll','findAll','catch','params','model','options','find','create','body','describe','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','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','UserProfileResource','rawAttributes','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','count'];(function(_0x31cfc6,_0x4df1e2){var _0x20c752=function(_0x2fa208){while(--_0x2fa208){_0x31cfc6['push'](_0x31cfc6['shift']());}};_0x20c752(++_0x4df1e2);}(_0xb10b,0x12a));var _0xbb10=function(_0x42aabd,_0x217ade){_0x42aabd=_0x42aabd-0x0;var _0x2e83fb=_0xb10b[_0x42aabd];return _0x2e83fb;};'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'];function respondWithStatusCode(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xcc;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x18')](_0x44fb19);}return _0x5be7e0[_0xbb10('0x19')](_0x44fb19)[_0xbb10('0x1a')]();};}function respondWithResult(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xc8;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x19')](_0x58a612)[_0xbb10('0x1b')](_0x26e021);}};}function respondWithFilteredResult(_0x17fd46,_0x3df17b){return function(_0x2f2ebf){if(_0x2f2ebf){var _0x24a57b=_0x2f2ebf['count'],_0x36b5e8=_0x3df17b[_0xbb10('0x1c')],_0x3e26f4=_0x3df17b[_0xbb10('0x1c')]+_0x3df17b[_0xbb10('0x1d')],_0x2b184e;if(_0x3e26f4>=_0x24a57b){_0x3e26f4=_0x24a57b;_0x2b184e=0xc8;}else{_0x2b184e=0xce;}_0x17fd46[_0xbb10('0x19')](_0x2b184e);return _0x17fd46[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x36b5e8+'-'+_0x3e26f4+'/'+_0x24a57b)[_0xbb10('0x1b')](_0x2f2ebf);}return null;};}function patchUpdates(_0x30efc6){return function(_0xbf2906){try{jsonpatch[_0xbb10('0x20')](_0xbf2906,_0x30efc6,!![]);}catch(_0x48b6e9){return BPromise[_0xbb10('0x21')](_0x48b6e9);}return _0xbf2906[_0xbb10('0x22')]();};}function saveUpdates(_0x388fab,_0x109908){return function(_0xdf237d){if(_0xdf237d){return _0xdf237d[_0xbb10('0x23')](_0x388fab)['then'](function(_0x12f888){return _0x12f888;});}return null;};}function removeEntity(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x24')]()[_0xbb10('0x25')](function(){_0x12ef77[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x445761,_0x1824b7){return function(_0x407cb4){if(!_0x407cb4){_0x445761[_0xbb10('0x18')](0x194);}return _0x407cb4;};}function handleError(_0x7f2377,_0x395404){_0x395404=_0x395404||0x1f4;return function(_0x3ba6cd){logger[_0xbb10('0x26')](_0x3ba6cd['stack']);if(_0x3ba6cd['name']){delete _0x3ba6cd['name'];}_0x7f2377[_0xbb10('0x19')](_0x395404)[_0xbb10('0x27')](_0x3ba6cd);};}exports[_0xbb10('0x28')]=function(_0x4e25ff,_0x2fdde9){var _0x24d586={},_0x6ed43b={},_0x1d5e95={'count':0x0,'rows':[]};var _0x1acce9=db[_0xbb10('0x29')][_0xbb10('0x2a')];_0x6ed43b['model']=_[_0xbb10('0x2b')](_0x1acce9);_0x6ed43b[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0x4e25ff[_0xbb10('0x2c')]);_0x6ed43b[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x6ed43b['model'],_0x6ed43b[_0xbb10('0x2c')]);_0x24d586['attributes']=_[_0xbb10('0x2e')](_0x6ed43b['model'],qs[_0xbb10('0x2f')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x2f')]));_0x24d586['attributes']=_0x24d586['attributes'][_0xbb10('0x30')]?_0x24d586[_0xbb10('0x31')]:_0x6ed43b['model'];if(!_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x32')](_0xbb10('0x33'))){_0x24d586[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1d')]);_0x24d586['offset']=qs[_0xbb10('0x1c')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1c')]);}_0x24d586[_0xbb10('0x34')]=qs[_0xbb10('0x35')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x35')]);_0x24d586[_0xbb10('0x36')]=qs[_0xbb10('0x2d')](_['pick'](_0x4e25ff[_0xbb10('0x2c')],_0x6ed43b[_0xbb10('0x2d')]));if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x37')]){_0x24d586['where']=_[_0xbb10('0x38')](_0x24d586['where'],{'$or':_['map'](_0x1acce9,function(_0x3eb3cc){if(_0x3eb3cc[_0xbb10('0x39')][_0xbb10('0x3a')]!==_0xbb10('0x3b')){var _0x15d895={};_0x15d895[_0x3eb3cc[_0xbb10('0x3c')]]={'$like':'%'+_0x4e25ff['query'][_0xbb10('0x37')]+'%'};return _0x15d895;}})});}_0x24d586=_[_0xbb10('0x38')]({},_0x24d586,_0x4e25ff['options']);var _0x5e3fbd={'where':_0x24d586['where']};return db[_0xbb10('0x29')][_0xbb10('0x3d')](_0x5e3fbd)[_0xbb10('0x25')](function(_0x4d5a9b){_0x1d5e95[_0xbb10('0x3d')]=_0x4d5a9b;if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x24d586['include']=[{'all':!![]}];}return db[_0xbb10('0x29')][_0xbb10('0x3f')](_0x24d586);})[_0xbb10('0x25')](function(_0x446f49){_0x1d5e95['rows']=_0x446f49;return _0x1d5e95;})[_0xbb10('0x25')](respondWithFilteredResult(_0x2fdde9,_0x24d586))[_0xbb10('0x40')](handleError(_0x2fdde9,null));};exports['show']=function(_0xe2040f,_0x2e3214){var _0x44d6ae={'raw':![],'where':{'id':_0xe2040f[_0xbb10('0x41')]['id']}},_0x3a9934={};_0x3a9934[_0xbb10('0x42')]=_['keys'](db[_0xbb10('0x29')][_0xbb10('0x2a')]);_0x3a9934[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0xe2040f['query']);_0x3a9934[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],_0x3a9934[_0xbb10('0x2c')]);_0x44d6ae['attributes']=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],qs['fields'](_0xe2040f['query'][_0xbb10('0x2f')]));_0x44d6ae['attributes']=_0x44d6ae[_0xbb10('0x31')][_0xbb10('0x30')]?_0x44d6ae['attributes']:_0x3a9934[_0xbb10('0x42')];if(_0xe2040f[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x44d6ae['include']=[{'all':!![]}];}_0x44d6ae=_[_0xbb10('0x38')]({},_0x44d6ae,_0xe2040f[_0xbb10('0x43')]);return db[_0xbb10('0x29')][_0xbb10('0x44')](_0x44d6ae)[_0xbb10('0x25')](handleEntityNotFound(_0x2e3214,null))[_0xbb10('0x25')](respondWithResult(_0x2e3214,null))[_0xbb10('0x40')](handleError(_0x2e3214,null));};exports[_0xbb10('0x45')]=function(_0x205bb4,_0x43b948){return db[_0xbb10('0x29')][_0xbb10('0x45')](_0x205bb4['body'],{})[_0xbb10('0x25')](respondWithResult(_0x43b948,0xc9))[_0xbb10('0x40')](handleError(_0x43b948,null));};exports['update']=function(_0x14e1cb,_0x2f5027){if(_0x14e1cb[_0xbb10('0x46')]['id']){delete _0x14e1cb[_0xbb10('0x46')]['id'];}return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x14e1cb[_0xbb10('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f5027,null))['then'](saveUpdates(_0x14e1cb[_0xbb10('0x46')],null))[_0xbb10('0x25')](respondWithResult(_0x2f5027,null))[_0xbb10('0x40')](handleError(_0x2f5027,null));};exports['destroy']=function(_0x5f0c12,_0x3cd6f3){return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x5f0c12[_0xbb10('0x41')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x3cd6f3,null))[_0xbb10('0x25')](removeEntity(_0x3cd6f3,null))[_0xbb10('0x40')](handleError(_0x3cd6f3,null));};exports[_0xbb10('0x47')]=function(_0x2626d8,_0x3d7e7e){return db['UserProfileResource']['describe']()[_0xbb10('0x25')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x40')](handleError(_0x3d7e7e,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index e275751..2b0ec47 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 _0xa691=['resourceId','sectionId','lodash','api','moment','bluebird','request-promise','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex'];(function(_0x41de3c,_0x284168){var _0x468351=function(_0x4ff72d){while(--_0x4ff72d){_0x41de3c['push'](_0x41de3c['shift']());}};_0x468351(++_0x284168);}(_0xa691,0xb6));var _0x1a69=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa691[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x1a69('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1a69('0x1'));var moment=require(_0x1a69('0x2'));var BPromise=require(_0x1a69('0x3'));var rp=require(_0x1a69('0x4'));var attributes=require(_0x1a69('0x5'));module[_0x1a69('0x6')]=function(_0xe5ec2f,_0x36ab2f){return _0xe5ec2f['define'](_0x1a69('0x7'),attributes,{'tableName':_0x1a69('0x8'),'paranoid':![],'indexes':[{'name':_0x1a69('0x9'),'fields':[_0x1a69('0xa'),_0x1a69('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x38db=['../../config/logger','request-promise','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash'];(function(_0x1e7159,_0x15e3ed){var _0x2e0dd8=function(_0x7b088f){while(--_0x7b088f){_0x1e7159['push'](_0x1e7159['shift']());}};_0x2e0dd8(++_0x15e3ed);}(_0x38db,0x1cb));var _0xb38d=function(_0x4b1305,_0x548ac3){_0x4b1305=_0x4b1305-0x0;var _0x12d9f9=_0x38db[_0x4b1305];return _0x12d9f9;};'use strict';var _=require(_0xb38d('0x0'));var util=require('util');var logger=require(_0xb38d('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb38d('0x2'));var attributes=require('./userProfileResource.attributes');module[_0xb38d('0x3')]=function(_0x447f81,_0x45257a){return _0x447f81[_0xb38d('0x4')](_0xb38d('0x5'),attributes,{'tableName':_0xb38d('0x6'),'paranoid':![],'indexes':[{'name':_0xb38d('0x7'),'fields':[_0xb38d('0x8'),_0xb38d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 0b48bbf..965a9fe 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x53ec,0x192));var _0xc53e=function(_0xe1269d,_0x57b7c3){_0xe1269d=_0xe1269d-0x0;var _0x261ca1=_0x53ec[_0xe1269d];return _0x261ca1;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4137,0xf8));var _0x7413=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4137[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 1643bda..27b9290 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 _0x475b=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','/describe','describe','get','post','create','put','/:id','delete','destroy','exports','multer','util'];(function(_0x1d6394,_0x45c8b6){var _0x14fcdd=function(_0x302fee){while(--_0x302fee){_0x1d6394['push'](_0x1d6394['shift']());}};_0x14fcdd(++_0x45c8b6);}(_0x475b,0xe5));var _0xb475=function(_0x22eab8,_0xfe54f9){_0x22eab8=_0x22eab8-0x0;var _0x40195b=_0x475b[_0x22eab8];return _0x40195b;};'use strict';var multer=require(_0xb475('0x0'));var util=require(_0xb475('0x1'));var path=require(_0xb475('0x2'));var timeout=require('connect-timeout');var express=require(_0xb475('0x3'));var router=express[_0xb475('0x4')]();var auth=require(_0xb475('0x5'));var interaction=require(_0xb475('0x6'));var config=require(_0xb475('0x7'));var controller=require(_0xb475('0x8'));router['get']('/',auth[_0xb475('0x9')](),controller[_0xb475('0xa')]);router['get'](_0xb475('0xb'),auth[_0xb475('0x9')](),controller[_0xb475('0xc')]);router[_0xb475('0xd')]('/:id',auth[_0xb475('0x9')](),controller['show']);router[_0xb475('0xe')]('/',auth[_0xb475('0x9')](),controller[_0xb475('0xf')]);router[_0xb475('0x10')](_0xb475('0x11'),auth[_0xb475('0x9')](),controller['update']);router[_0xb475('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb475('0x13')]);module[_0xb475('0x14')]=router; \ No newline at end of file +var _0x4dc6=['isAuthenticated','describe','/:id','post','put','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x4dc6,0xcb));var _0x64dc=function(_0x2aa3ec,_0x1ce125){_0x2aa3ec=_0x2aa3ec-0x0;var _0x5eaeac=_0x4dc6[_0x2aa3ec];return _0x5eaeac;};'use strict';var multer=require(_0x64dc('0x0'));var util=require('util');var path=require(_0x64dc('0x1'));var timeout=require('connect-timeout');var express=require(_0x64dc('0x2'));var router=express['Router']();var auth=require(_0x64dc('0x3'));var interaction=require(_0x64dc('0x4'));var config=require(_0x64dc('0x5'));var controller=require('./userProfileSection.controller');router[_0x64dc('0x6')]('/',auth[_0x64dc('0x7')](),controller['index']);router[_0x64dc('0x6')]('/describe',auth[_0x64dc('0x7')](),controller[_0x64dc('0x8')]);router[_0x64dc('0x6')](_0x64dc('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x64dc('0xa')]('/',auth[_0x64dc('0x7')](),controller['create']);router[_0x64dc('0xb')]('/:id',auth[_0x64dc('0x7')](),controller['update']);router['delete'](_0x64dc('0x9'),auth['isAuthenticated'](),controller[_0x64dc('0xc')]);module[_0x64dc('0xd')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 6a58d2b..9721c62 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(_0x2d061c,_0x48e86c){var _0x2f1dfd=function(_0x38238c){while(--_0x38238c){_0x2d061c['push'](_0x2d061c['shift']());}};_0x2f1dfd(++_0x48e86c);}(_0x008c,0x188));var _0xc008=function(_0x19ef32,_0x3b78ff){_0x19ef32=_0x19ef32-0x0;var _0x20034e=_0x008c[_0x19ef32];return _0x20034e;};'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(_0x3cf98f,_0x1c1740){var _0x3ab1d9=function(_0x1f60c5){while(--_0x1f60c5){_0x3cf98f['push'](_0x3cf98f['shift']());}};_0x3ab1d9(++_0x1c1740);}(_0xedd9,0xfc));var _0x9edd=function(_0x507552,_0xf25887){_0x507552=_0x507552-0x0;var _0x358510=_0xedd9[_0x507552];return _0x358510;};'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 3488082..7baeb3d 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 _0xba00=['filters','intersection','attributes','length','hasOwnProperty','sort','pick','where','merge','key','field','filter','UserProfileSection','includeAll','include','catch','show','params','fields','options','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','json','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','rawAttributes','model','keys','query'];(function(_0x34f869,_0x19f270){var _0x2d8dec=function(_0x3b221d){while(--_0x3b221d){_0x34f869['push'](_0x34f869['shift']());}};_0x2d8dec(++_0x19f270);}(_0xba00,0x167));var _0x0ba0=function(_0xb858d3,_0x3693ee){_0xb858d3=_0xb858d3-0x0;var _0x49fb5b=_0xba00[_0xb858d3];return _0x49fb5b;};'use strict';var pdf=require(_0x0ba0('0x0'));var emlformat=require(_0x0ba0('0x1'));var rimraf=require(_0x0ba0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ba0('0x3'));var rp=require(_0x0ba0('0x4'));var moment=require('moment');var BPromise=require(_0x0ba0('0x5'));var Mustache=require(_0x0ba0('0x6'));var util=require(_0x0ba0('0x7'));var path=require(_0x0ba0('0x8'));var sox=require(_0x0ba0('0x9'));var csv=require(_0x0ba0('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0ba0('0xb'));var squel=require(_0x0ba0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0ba0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0ba0('0xe'));var Papa=require('papaparse');var authService=require(_0x0ba0('0xf'));var hardwareService=require(_0x0ba0('0x10'));var Redis=require(_0x0ba0('0x11'));var qs=require(_0x0ba0('0x12'));var logger=require(_0x0ba0('0x13'))(_0x0ba0('0x14'));var utils=require('../../config/utils');var config=require(_0x0ba0('0x15'));var db=require(_0x0ba0('0x16'))['db'];function respondWithStatusCode(_0x10a229,_0x4af9c5){_0x4af9c5=_0x4af9c5||0xcc;return function(_0x1420fd){if(_0x1420fd){return _0x10a229['sendStatus'](_0x4af9c5);}return _0x10a229[_0x0ba0('0x17')](_0x4af9c5)[_0x0ba0('0x18')]();};}function respondWithResult(_0x293aa7,_0x383e1c){_0x383e1c=_0x383e1c||0xc8;return function(_0x5ba7fd){if(_0x5ba7fd){return _0x293aa7['status'](_0x383e1c)['json'](_0x5ba7fd);}};}function respondWithFilteredResult(_0x452752,_0x332e5e){return function(_0x149d2d){if(_0x149d2d){var _0x1ded04=_0x149d2d[_0x0ba0('0x19')],_0x57537f=_0x332e5e[_0x0ba0('0x1a')],_0x1cccc0=_0x332e5e[_0x0ba0('0x1a')]+_0x332e5e[_0x0ba0('0x1b')],_0x31dda4;if(_0x1cccc0>=_0x1ded04){_0x1cccc0=_0x1ded04;_0x31dda4=0xc8;}else{_0x31dda4=0xce;}_0x452752[_0x0ba0('0x17')](_0x31dda4);return _0x452752['set']('Content-Range',_0x57537f+'-'+_0x1cccc0+'/'+_0x1ded04)[_0x0ba0('0x1c')](_0x149d2d);}return null;};}function patchUpdates(_0x4e185e){return function(_0x8ea706){try{jsonpatch[_0x0ba0('0x1d')](_0x8ea706,_0x4e185e,!![]);}catch(_0x43fea8){return BPromise[_0x0ba0('0x1e')](_0x43fea8);}return _0x8ea706[_0x0ba0('0x1f')]();};}function saveUpdates(_0x519b7d,_0x4111f0){return function(_0x20705c){if(_0x20705c){return _0x20705c[_0x0ba0('0x20')](_0x519b7d)['then'](function(_0x718917){return _0x718917;});}return null;};}function removeEntity(_0x37b56e,_0x5d2f96){return function(_0x9ce3c9){if(_0x9ce3c9){return _0x9ce3c9[_0x0ba0('0x21')]()[_0x0ba0('0x22')](function(){_0x37b56e[_0x0ba0('0x17')](0xcc)[_0x0ba0('0x18')]();});}};}function handleEntityNotFound(_0x4cac0e,_0x157e9e){return function(_0x37e994){if(!_0x37e994){_0x4cac0e[_0x0ba0('0x23')](0x194);}return _0x37e994;};}function handleError(_0x44c71d,_0x2a7176){_0x2a7176=_0x2a7176||0x1f4;return function(_0x2921d1){logger['error'](_0x2921d1[_0x0ba0('0x24')]);if(_0x2921d1['name']){delete _0x2921d1[_0x0ba0('0x25')];}_0x44c71d[_0x0ba0('0x17')](_0x2a7176)[_0x0ba0('0x26')](_0x2921d1);};}exports['index']=function(_0x2ba328,_0x3a1c50){var _0x1fa5e9={},_0x58d618={},_0x3d1cf0={'count':0x0,'rows':[]};var _0x2dbde9=db['UserProfileSection'][_0x0ba0('0x27')];_0x58d618[_0x0ba0('0x28')]=_[_0x0ba0('0x29')](_0x2dbde9);_0x58d618[_0x0ba0('0x2a')]=_['keys'](_0x2ba328[_0x0ba0('0x2a')]);_0x58d618[_0x0ba0('0x2b')]=_[_0x0ba0('0x2c')](_0x58d618[_0x0ba0('0x28')],_0x58d618['query']);_0x1fa5e9[_0x0ba0('0x2d')]=_[_0x0ba0('0x2c')](_0x58d618[_0x0ba0('0x28')],qs['fields'](_0x2ba328[_0x0ba0('0x2a')]['fields']));_0x1fa5e9[_0x0ba0('0x2d')]=_0x1fa5e9[_0x0ba0('0x2d')][_0x0ba0('0x2e')]?_0x1fa5e9['attributes']:_0x58d618[_0x0ba0('0x28')];if(!_0x2ba328[_0x0ba0('0x2a')][_0x0ba0('0x2f')]('nolimit')){_0x1fa5e9[_0x0ba0('0x1b')]=qs[_0x0ba0('0x1b')](_0x2ba328['query'][_0x0ba0('0x1b')]);_0x1fa5e9[_0x0ba0('0x1a')]=qs[_0x0ba0('0x1a')](_0x2ba328['query'][_0x0ba0('0x1a')]);}_0x1fa5e9['order']=qs[_0x0ba0('0x30')](_0x2ba328[_0x0ba0('0x2a')][_0x0ba0('0x30')]);_0x1fa5e9['where']=qs[_0x0ba0('0x2b')](_[_0x0ba0('0x31')](_0x2ba328[_0x0ba0('0x2a')],_0x58d618['filters']));if(_0x2ba328['query']['filter']){_0x1fa5e9[_0x0ba0('0x32')]=_[_0x0ba0('0x33')](_0x1fa5e9[_0x0ba0('0x32')],{'$or':_['map'](_0x2dbde9,function(_0x59d282){if(_0x59d282['type'][_0x0ba0('0x34')]!=='VIRTUAL'){var _0x3b0779={};_0x3b0779[_0x59d282[_0x0ba0('0x35')]]={'$like':'%'+_0x2ba328['query'][_0x0ba0('0x36')]+'%'};return _0x3b0779;}})});}_0x1fa5e9=_[_0x0ba0('0x33')]({},_0x1fa5e9,_0x2ba328['options']);var _0x179038={'where':_0x1fa5e9['where']};return db[_0x0ba0('0x37')][_0x0ba0('0x19')](_0x179038)[_0x0ba0('0x22')](function(_0x59be9){_0x3d1cf0[_0x0ba0('0x19')]=_0x59be9;if(_0x2ba328[_0x0ba0('0x2a')][_0x0ba0('0x38')]){_0x1fa5e9[_0x0ba0('0x39')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x1fa5e9);})['then'](function(_0x3437ff){_0x3d1cf0['rows']=_0x3437ff;return _0x3d1cf0;})['then'](respondWithFilteredResult(_0x3a1c50,_0x1fa5e9))[_0x0ba0('0x3a')](handleError(_0x3a1c50,null));};exports[_0x0ba0('0x3b')]=function(_0x15cdb3,_0x3ceed9){var _0x4b5f50={'raw':![],'where':{'id':_0x15cdb3[_0x0ba0('0x3c')]['id']}},_0x1699e8={};_0x1699e8[_0x0ba0('0x28')]=_[_0x0ba0('0x29')](db[_0x0ba0('0x37')][_0x0ba0('0x27')]);_0x1699e8[_0x0ba0('0x2a')]=_[_0x0ba0('0x29')](_0x15cdb3[_0x0ba0('0x2a')]);_0x1699e8['filters']=_[_0x0ba0('0x2c')](_0x1699e8[_0x0ba0('0x28')],_0x1699e8['query']);_0x4b5f50[_0x0ba0('0x2d')]=_['intersection'](_0x1699e8[_0x0ba0('0x28')],qs[_0x0ba0('0x3d')](_0x15cdb3['query'][_0x0ba0('0x3d')]));_0x4b5f50[_0x0ba0('0x2d')]=_0x4b5f50[_0x0ba0('0x2d')][_0x0ba0('0x2e')]?_0x4b5f50[_0x0ba0('0x2d')]:_0x1699e8[_0x0ba0('0x28')];if(_0x15cdb3[_0x0ba0('0x2a')]['includeAll']){_0x4b5f50[_0x0ba0('0x39')]=[{'all':!![]}];}_0x4b5f50=_[_0x0ba0('0x33')]({},_0x4b5f50,_0x15cdb3[_0x0ba0('0x3e')]);return db[_0x0ba0('0x37')][_0x0ba0('0x3f')](_0x4b5f50)[_0x0ba0('0x22')](handleEntityNotFound(_0x3ceed9,null))['then'](respondWithResult(_0x3ceed9,null))[_0x0ba0('0x3a')](handleError(_0x3ceed9,null));};exports[_0x0ba0('0x40')]=function(_0x1c25ca,_0x21e2d1){return db[_0x0ba0('0x37')][_0x0ba0('0x40')](_0x1c25ca[_0x0ba0('0x41')],{})[_0x0ba0('0x22')](respondWithResult(_0x21e2d1,0xc9))[_0x0ba0('0x3a')](handleError(_0x21e2d1,null));};exports[_0x0ba0('0x20')]=function(_0x2780fc,_0x2826d6){if(_0x2780fc['body']['id']){delete _0x2780fc[_0x0ba0('0x41')]['id'];}return db[_0x0ba0('0x37')][_0x0ba0('0x3f')]({'where':{'id':_0x2780fc[_0x0ba0('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2826d6,null))[_0x0ba0('0x22')](saveUpdates(_0x2780fc[_0x0ba0('0x41')],null))['then'](respondWithResult(_0x2826d6,null))[_0x0ba0('0x3a')](handleError(_0x2826d6,null));};exports[_0x0ba0('0x21')]=function(_0x23c56a,_0x15cbae){return db[_0x0ba0('0x37')][_0x0ba0('0x3f')]({'where':{'id':_0x23c56a[_0x0ba0('0x3c')]['id']}})[_0x0ba0('0x22')](handleEntityNotFound(_0x15cbae,null))[_0x0ba0('0x22')](removeEntity(_0x15cbae,null))[_0x0ba0('0x3a')](handleError(_0x15cbae,null));};exports[_0x0ba0('0x42')]=function(_0x12a6f3,_0xee3748){return db[_0x0ba0('0x37')]['describe']()[_0x0ba0('0x22')](respondWithResult(_0xee3748,null))[_0x0ba0('0x3a')](handleError(_0xee3748,null));}; \ No newline at end of file +var _0x19a5=['key','VIRTUAL','field','options','UserProfileSection','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','body','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type'];(function(_0x25e905,_0x42f080){var _0x4d1f16=function(_0x575f79){while(--_0x575f79){_0x25e905['push'](_0x25e905['shift']());}};_0x4d1f16(++_0x42f080);}(_0x19a5,0x132));var _0x519a=function(_0x1d4636,_0x22cfe5){_0x1d4636=_0x1d4636-0x0;var _0x2eba57=_0x19a5[_0x1d4636];return _0x2eba57;};'use strict';var pdf=require(_0x519a('0x0'));var emlformat=require(_0x519a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x519a('0x2'));var jsonpatch=require(_0x519a('0x3'));var rp=require(_0x519a('0x4'));var moment=require('moment');var BPromise=require(_0x519a('0x5'));var Mustache=require(_0x519a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x519a('0x7'));var csv=require(_0x519a('0x8'));var ejs=require(_0x519a('0x9'));var fs=require('fs');var _=require(_0x519a('0xa'));var squel=require(_0x519a('0xb'));var crypto=require('crypto');var jsforce=require(_0x519a('0xc'));var deskjs=require(_0x519a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x519a('0xe'));var Papa=require(_0x519a('0xf'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x519a('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x519a('0x11'))(_0x519a('0x12'));var utils=require(_0x519a('0x13'));var config=require('../../config/environment');var db=require(_0x519a('0x14'))['db'];function respondWithStatusCode(_0xa779b9,_0x5739ff){_0x5739ff=_0x5739ff||0xcc;return function(_0x65048c){if(_0x65048c){return _0xa779b9[_0x519a('0x15')](_0x5739ff);}return _0xa779b9[_0x519a('0x16')](_0x5739ff)[_0x519a('0x17')]();};}function respondWithResult(_0xf9b04,_0x2944e2){_0x2944e2=_0x2944e2||0xc8;return function(_0xd15bea){if(_0xd15bea){return _0xf9b04[_0x519a('0x16')](_0x2944e2)[_0x519a('0x18')](_0xd15bea);}};}function respondWithFilteredResult(_0xec8df8,_0x468078){return function(_0x7cade){if(_0x7cade){var _0x110558=_0x7cade['count'],_0x5ee2a8=_0x468078['offset'],_0x5e5347=_0x468078[_0x519a('0x19')]+_0x468078[_0x519a('0x1a')],_0x8f4269;if(_0x5e5347>=_0x110558){_0x5e5347=_0x110558;_0x8f4269=0xc8;}else{_0x8f4269=0xce;}_0xec8df8[_0x519a('0x16')](_0x8f4269);return _0xec8df8[_0x519a('0x1b')](_0x519a('0x1c'),_0x5ee2a8+'-'+_0x5e5347+'/'+_0x110558)[_0x519a('0x18')](_0x7cade);}return null;};}function patchUpdates(_0x23a8f2){return function(_0x962f15){try{jsonpatch[_0x519a('0x1d')](_0x962f15,_0x23a8f2,!![]);}catch(_0x2ffc51){return BPromise[_0x519a('0x1e')](_0x2ffc51);}return _0x962f15[_0x519a('0x1f')]();};}function saveUpdates(_0x3af1a4,_0x3bff8e){return function(_0x14cde1){if(_0x14cde1){return _0x14cde1[_0x519a('0x20')](_0x3af1a4)['then'](function(_0x25ea68){return _0x25ea68;});}return null;};}function removeEntity(_0x3838bd,_0x40bd7b){return function(_0x548fc2){if(_0x548fc2){return _0x548fc2['destroy']()[_0x519a('0x21')](function(){_0x3838bd['status'](0xcc)[_0x519a('0x17')]();});}};}function handleEntityNotFound(_0x6da8e2,_0x36d13b){return function(_0x1b8a36){if(!_0x1b8a36){_0x6da8e2[_0x519a('0x15')](0x194);}return _0x1b8a36;};}function handleError(_0x1e36c0,_0x57f5b6){_0x57f5b6=_0x57f5b6||0x1f4;return function(_0x59e0eb){logger[_0x519a('0x22')](_0x59e0eb['stack']);if(_0x59e0eb[_0x519a('0x23')]){delete _0x59e0eb['name'];}_0x1e36c0[_0x519a('0x16')](_0x57f5b6)['send'](_0x59e0eb);};}exports['index']=function(_0x2811e0,_0x487ef8){var _0x40b181={},_0x10ffa3={},_0x3f93ac={'count':0x0,'rows':[]};var _0x319a94=db['UserProfileSection']['rawAttributes'];_0x10ffa3['model']=_[_0x519a('0x24')](_0x319a94);_0x10ffa3[_0x519a('0x25')]=_[_0x519a('0x24')](_0x2811e0[_0x519a('0x25')]);_0x10ffa3[_0x519a('0x26')]=_[_0x519a('0x27')](_0x10ffa3[_0x519a('0x28')],_0x10ffa3[_0x519a('0x25')]);_0x40b181['attributes']=_[_0x519a('0x27')](_0x10ffa3[_0x519a('0x28')],qs['fields'](_0x2811e0[_0x519a('0x25')][_0x519a('0x29')]));_0x40b181['attributes']=_0x40b181[_0x519a('0x2a')][_0x519a('0x2b')]?_0x40b181['attributes']:_0x10ffa3['model'];if(!_0x2811e0[_0x519a('0x25')][_0x519a('0x2c')](_0x519a('0x2d'))){_0x40b181[_0x519a('0x1a')]=qs[_0x519a('0x1a')](_0x2811e0[_0x519a('0x25')]['limit']);_0x40b181[_0x519a('0x19')]=qs[_0x519a('0x19')](_0x2811e0[_0x519a('0x25')][_0x519a('0x19')]);}_0x40b181[_0x519a('0x2e')]=qs[_0x519a('0x2f')](_0x2811e0[_0x519a('0x25')][_0x519a('0x2f')]);_0x40b181['where']=qs[_0x519a('0x26')](_[_0x519a('0x30')](_0x2811e0[_0x519a('0x25')],_0x10ffa3[_0x519a('0x26')]));if(_0x2811e0['query'][_0x519a('0x31')]){_0x40b181[_0x519a('0x32')]=_[_0x519a('0x33')](_0x40b181[_0x519a('0x32')],{'$or':_[_0x519a('0x34')](_0x319a94,function(_0x128ed3){if(_0x128ed3[_0x519a('0x35')][_0x519a('0x36')]!==_0x519a('0x37')){var _0x2ad3c0={};_0x2ad3c0[_0x128ed3[_0x519a('0x38')]]={'$like':'%'+_0x2811e0['query'][_0x519a('0x31')]+'%'};return _0x2ad3c0;}})});}_0x40b181=_[_0x519a('0x33')]({},_0x40b181,_0x2811e0[_0x519a('0x39')]);var _0x8711b2={'where':_0x40b181[_0x519a('0x32')]};return db[_0x519a('0x3a')][_0x519a('0x3b')](_0x8711b2)[_0x519a('0x21')](function(_0x36c92){_0x3f93ac[_0x519a('0x3b')]=_0x36c92;if(_0x2811e0[_0x519a('0x25')][_0x519a('0x3c')]){_0x40b181[_0x519a('0x3d')]=[{'all':!![]}];}return db[_0x519a('0x3a')][_0x519a('0x3e')](_0x40b181);})[_0x519a('0x21')](function(_0x272fe3){_0x3f93ac[_0x519a('0x3f')]=_0x272fe3;return _0x3f93ac;})[_0x519a('0x21')](respondWithFilteredResult(_0x487ef8,_0x40b181))['catch'](handleError(_0x487ef8,null));};exports[_0x519a('0x40')]=function(_0x8295fc,_0x304c31){var _0x169d75={'raw':![],'where':{'id':_0x8295fc[_0x519a('0x41')]['id']}},_0x240f11={};_0x240f11[_0x519a('0x28')]=_[_0x519a('0x24')](db[_0x519a('0x3a')][_0x519a('0x42')]);_0x240f11[_0x519a('0x25')]=_[_0x519a('0x24')](_0x8295fc[_0x519a('0x25')]);_0x240f11[_0x519a('0x26')]=_[_0x519a('0x27')](_0x240f11['model'],_0x240f11[_0x519a('0x25')]);_0x169d75[_0x519a('0x2a')]=_[_0x519a('0x27')](_0x240f11[_0x519a('0x28')],qs[_0x519a('0x29')](_0x8295fc[_0x519a('0x25')][_0x519a('0x29')]));_0x169d75[_0x519a('0x2a')]=_0x169d75[_0x519a('0x2a')][_0x519a('0x2b')]?_0x169d75[_0x519a('0x2a')]:_0x240f11['model'];if(_0x8295fc[_0x519a('0x25')][_0x519a('0x3c')]){_0x169d75['include']=[{'all':!![]}];}_0x169d75=_[_0x519a('0x33')]({},_0x169d75,_0x8295fc[_0x519a('0x39')]);return db[_0x519a('0x3a')][_0x519a('0x43')](_0x169d75)[_0x519a('0x21')](handleEntityNotFound(_0x304c31,null))[_0x519a('0x21')](respondWithResult(_0x304c31,null))[_0x519a('0x44')](handleError(_0x304c31,null));};exports['create']=function(_0x4a40e9,_0x80585f){return db['UserProfileSection']['create'](_0x4a40e9['body'],{})[_0x519a('0x21')](respondWithResult(_0x80585f,0xc9))[_0x519a('0x44')](handleError(_0x80585f,null));};exports[_0x519a('0x20')]=function(_0x5cf6e0,_0x26036f){if(_0x5cf6e0[_0x519a('0x45')]['id']){delete _0x5cf6e0[_0x519a('0x45')]['id'];}return db[_0x519a('0x3a')]['find']({'where':{'id':_0x5cf6e0[_0x519a('0x41')]['id']}})[_0x519a('0x21')](handleEntityNotFound(_0x26036f,null))[_0x519a('0x21')](saveUpdates(_0x5cf6e0[_0x519a('0x45')],null))['then'](respondWithResult(_0x26036f,null))[_0x519a('0x44')](handleError(_0x26036f,null));};exports[_0x519a('0x46')]=function(_0x41eeb4,_0x31721a){return db['UserProfileSection'][_0x519a('0x43')]({'where':{'id':_0x41eeb4[_0x519a('0x41')]['id']}})[_0x519a('0x21')](handleEntityNotFound(_0x31721a,null))[_0x519a('0x21')](removeEntity(_0x31721a,null))[_0x519a('0x44')](handleError(_0x31721a,null));};exports[_0x519a('0x47')]=function(_0x161122,_0x2f96a3){return db[_0x519a('0x3a')][_0x519a('0x47')]()['then'](respondWithResult(_0x2f96a3,null))['catch'](handleError(_0x2f96a3,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index e30a8d5..14e74a3 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 _0x30be=['user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','moment','bluebird','./userProfileSection.attributes','exports','define','UserProfileSection'];(function(_0x5a74cb,_0x36217c){var _0x563740=function(_0x287168){while(--_0x287168){_0x5a74cb['push'](_0x5a74cb['shift']());}};_0x563740(++_0x36217c);}(_0x30be,0xe1));var _0xe30b=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x30be[_0x1ae5ab];return _0x1ce001;};'use strict';var _=require(_0xe30b('0x0'));var util=require(_0xe30b('0x1'));var logger=require(_0xe30b('0x2'))('api');var moment=require(_0xe30b('0x3'));var BPromise=require(_0xe30b('0x4'));var rp=require('request-promise');var attributes=require(_0xe30b('0x5'));module[_0xe30b('0x6')]=function(_0x33a4c2,_0x12025b){return _0x33a4c2[_0xe30b('0x7')](_0xe30b('0x8'),attributes,{'tableName':_0xe30b('0x9'),'paranoid':![],'indexes':[{'name':_0xe30b('0xa'),'fields':[_0xe30b('0xb'),_0xe30b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8c0=['api','bluebird','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8c0,0x76));var _0x0d8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd8c0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0d8c('0x0'));var util=require(_0x0d8c('0x1'));var logger=require('../../config/logger')(_0x0d8c('0x2'));var moment=require('moment');var BPromise=require(_0x0d8c('0x3'));var rp=require('request-promise');var attributes=require(_0x0d8c('0x4'));module[_0x0d8c('0x5')]=function(_0x4f0f67,_0x30d918){return _0x4f0f67['define'](_0x0d8c('0x6'),attributes,{'tableName':_0x0d8c('0x7'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x0d8c('0x8'),_0x0d8c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index b7bc9b9..01752dc 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 _0xbbfe=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x2b8810,_0x55efdb){var _0x4c0f41=function(_0x3104cd){while(--_0x3104cd){_0x2b8810['push'](_0x2b8810['shift']());}};_0x4c0f41(++_0x55efdb);}(_0xbbfe,0x1e6));var _0xebbf=function(_0x56e583,_0x21253a){_0x56e583=_0x56e583-0x0;var _0x32361e=_0xbbfe[_0x56e583];return _0x32361e;};'use strict';var _=require('lodash');var util=require(_0xebbf('0x0'));var moment=require(_0xebbf('0x1'));var BPromise=require(_0xebbf('0x2'));var rs=require(_0xebbf('0x3'));var fs=require('fs');var Redis=require(_0xebbf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xebbf('0x5'));var logger=require(_0xebbf('0x6'))('rpc');var config=require(_0xebbf('0x7'));var jayson=require(_0xebbf('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x149965,_0x5a9439,_0xbba365){return new BPromise(function(_0x27f341,_0x12ac91){return client[_0xebbf('0x9')](_0x149965,_0xbba365)['then'](function(_0x4491ef){logger[_0xebbf('0xa')](_0xebbf('0xb'),_0x5a9439,_0xebbf('0xc'));logger['debug'](_0xebbf('0xd'),_0x5a9439,_0xebbf('0xc'),JSON[_0xebbf('0xe')](_0x4491ef));if(_0x4491ef[_0xebbf('0xf')]){if(_0x4491ef['error'][_0xebbf('0x10')]===0x1f4){logger[_0xebbf('0xf')](_0xebbf('0xb'),_0x5a9439,_0x4491ef[_0xebbf('0xf')][_0xebbf('0x11')]);return _0x12ac91(_0x4491ef['error'][_0xebbf('0x11')]);}logger[_0xebbf('0xf')](_0xebbf('0xb'),_0x5a9439,_0x4491ef[_0xebbf('0xf')][_0xebbf('0x11')]);return _0x27f341(_0x4491ef[_0xebbf('0xf')][_0xebbf('0x11')]);}else{logger[_0xebbf('0xa')](_0xebbf('0xb'),_0x5a9439,_0xebbf('0xc'));_0x27f341(_0x4491ef[_0xebbf('0x12')][_0xebbf('0x11')]);}})[_0xebbf('0x13')](function(_0x493581){logger[_0xebbf('0xf')](_0xebbf('0xb'),_0x5a9439,_0x493581);_0x12ac91(_0x493581);});});} \ No newline at end of file +var _0x3adf=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x3adf,0x1a6));var _0xf3ad=function(_0x334672,_0x42f550){_0x334672=_0x334672-0x0;var _0x7cb6dc=_0x3adf[_0x334672];return _0x7cb6dc;};'use strict';var _=require(_0xf3ad('0x0'));var util=require(_0xf3ad('0x1'));var moment=require(_0xf3ad('0x2'));var BPromise=require(_0xf3ad('0x3'));var rs=require(_0xf3ad('0x4'));var fs=require('fs');var Redis=require(_0xf3ad('0x5'));var db=require(_0xf3ad('0x6'))['db'];var utils=require(_0xf3ad('0x7'));var logger=require(_0xf3ad('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23d40f,_0x5c7928,_0x271a91){return new BPromise(function(_0x54a71b,_0x3f5d1c){return client[_0xf3ad('0x9')](_0x23d40f,_0x271a91)[_0xf3ad('0xa')](function(_0xec5ffa){logger[_0xf3ad('0xb')](_0xf3ad('0xc'),_0x5c7928,_0xf3ad('0xd'));logger[_0xf3ad('0xe')](_0xf3ad('0xf'),_0x5c7928,_0xf3ad('0xd'),JSON['stringify'](_0xec5ffa));if(_0xec5ffa[_0xf3ad('0x10')]){if(_0xec5ffa[_0xf3ad('0x10')][_0xf3ad('0x11')]===0x1f4){logger[_0xf3ad('0x10')](_0xf3ad('0xc'),_0x5c7928,_0xec5ffa[_0xf3ad('0x10')][_0xf3ad('0x12')]);return _0x3f5d1c(_0xec5ffa['error'][_0xf3ad('0x12')]);}logger[_0xf3ad('0x10')](_0xf3ad('0xc'),_0x5c7928,_0xec5ffa[_0xf3ad('0x10')][_0xf3ad('0x12')]);return _0x54a71b(_0xec5ffa[_0xf3ad('0x10')][_0xf3ad('0x12')]);}else{logger[_0xf3ad('0xb')](_0xf3ad('0xc'),_0x5c7928,_0xf3ad('0xd'));_0x54a71b(_0xec5ffa[_0xf3ad('0x13')][_0xf3ad('0x12')]);}})[_0xf3ad('0x14')](function(_0x4df05e){logger[_0xf3ad('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x5c7928,_0x4df05e);_0x3f5d1c(_0x4df05e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 895d69b..aaf9ae7 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 _0x2eb2=['../../components/auth/service','../../config/environment','util','path','connect-timeout','express','Router'];(function(_0x2ee261,_0x210cd8){var _0x37a4fc=function(_0x332fe1){while(--_0x332fe1){_0x2ee261['push'](_0x2ee261['shift']());}};_0x37a4fc(++_0x210cd8);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x2eb2[_0x5416db];return _0x243e35;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var auth=require(_0x22eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x22eb('0x6'));module['exports']=router; \ No newline at end of file +var _0x7b84=['../../config/environment','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x7b84,0x17c));var _0x47b8=function(_0x10c2c8,_0x214e47){_0x10c2c8=_0x10c2c8-0x0;var _0x2946ef=_0x7b84[_0x10c2c8];return _0x2946ef;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var auth=require(_0x47b8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x47b8('0x7'));module[_0x47b8('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 5527690..630e4b3 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 _0x5ab9=['exports','INTEGER','sequelize'];(function(_0x35bc27,_0x12c74d){var _0x147269=function(_0x1af74e){while(--_0x1af74e){_0x35bc27['push'](_0x35bc27['shift']());}};_0x147269(++_0x12c74d);}(_0x5ab9,0x107));var _0x95ab=function(_0x1a4a06,_0x36a5c2){_0x1a4a06=_0x1a4a06-0x0;var _0x49ec08=_0x5ab9[_0x1a4a06];return _0x49ec08;};'use strict';var Sequelize=require(_0x95ab('0x0'));module[_0x95ab('0x1')]={'penalty':{'type':Sequelize[_0x95ab('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe130=['INTEGER','sequelize','exports'];(function(_0x8e8ca7,_0x5a5e07){var _0x561381=function(_0x2f4bda){while(--_0x2f4bda){_0x8e8ca7['push'](_0x8e8ca7['shift']());}};_0x561381(++_0x5a5e07);}(_0xe130,0x1db));var _0x0e13=function(_0x495994,_0x21ba58){_0x495994=_0x495994-0x0;var _0x13b6c9=_0xe130[_0x495994];return _0x13b6c9;};'use strict';var Sequelize=require(_0x0e13('0x0'));module[_0x0e13('0x1')]={'penalty':{'type':Sequelize[_0x0e13('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index af7ea84..6d016a8 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 _0x39e6=['define','UserSmsQueue','lodash','util','../../config/logger','bluebird','request-promise','./userSmsQueue.attributes'];(function(_0x4954fc,_0x4f6963){var _0x409d43=function(_0x3af36c){while(--_0x3af36c){_0x4954fc['push'](_0x4954fc['shift']());}};_0x409d43(++_0x4f6963);}(_0x39e6,0xe2));var _0x639e=function(_0x3bfb38,_0xb4062a){_0x3bfb38=_0x3bfb38-0x0;var _0x3453f8=_0x39e6[_0x3bfb38];return _0x3453f8;};'use strict';var _=require(_0x639e('0x0'));var util=require(_0x639e('0x1'));var logger=require(_0x639e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x639e('0x3'));var rp=require(_0x639e('0x4'));var attributes=require(_0x639e('0x5'));module['exports']=function(_0x521b1d,_0x582d58){return _0x521b1d[_0x639e('0x6')](_0x639e('0x7'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x930a=['UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','./userSmsQueue.attributes','exports'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x930a,0x13a));var _0xa930=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x930a[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require(_0xa930('0x0'));var logger=require(_0xa930('0x1'))(_0xa930('0x2'));var moment=require(_0xa930('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xa930('0x4'));module[_0xa930('0x5')]=function(_0x2656d2,_0x23c52e){return _0x2656d2['define'](_0xa930('0x6'),attributes,{'tableName':_0xa930('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 07a4ecd..1785be1 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 _0x0824=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x206d05,_0x518459){var _0x2251b4=function(_0x19535d){while(--_0x19535d){_0x206d05['push'](_0x206d05['shift']());}};_0x2251b4(++_0x518459);}(_0x0824,0x6f));var _0x4082=function(_0x52577f,_0x27aa13){_0x52577f=_0x52577f-0x0;var _0x4dd2e5=_0x0824[_0x52577f];return _0x4dd2e5;};'use strict';var _=require(_0x4082('0x0'));var util=require(_0x4082('0x1'));var moment=require('moment');var BPromise=require(_0x4082('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4082('0x3'))['db'];var utils=require(_0x4082('0x4'));var logger=require('../../config/logger')(_0x4082('0x5'));var config=require('../../config/environment');var jayson=require(_0x4082('0x6'));var client=jayson[_0x4082('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x619f11,_0x320dab,_0x84f4c4){return new BPromise(function(_0x35aa8b,_0x53a4ac){return client['request'](_0x619f11,_0x84f4c4)[_0x4082('0x8')](function(_0x42db11){logger[_0x4082('0x9')]('UserSmsQueue,\x20%s,\x20%s',_0x320dab,_0x4082('0xa'));logger['debug'](_0x4082('0xb'),_0x320dab,_0x4082('0xa'),JSON[_0x4082('0xc')](_0x42db11));if(_0x42db11[_0x4082('0xd')]){if(_0x42db11['error'][_0x4082('0xe')]===0x1f4){logger['error'](_0x4082('0xf'),_0x320dab,_0x42db11['error'][_0x4082('0x10')]);return _0x53a4ac(_0x42db11[_0x4082('0xd')]['message']);}logger[_0x4082('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x320dab,_0x42db11[_0x4082('0xd')][_0x4082('0x10')]);return _0x35aa8b(_0x42db11['error'][_0x4082('0x10')]);}else{logger[_0x4082('0x9')](_0x4082('0xf'),_0x320dab,_0x4082('0xa'));_0x35aa8b(_0x42db11[_0x4082('0x11')][_0x4082('0x10')]);}})[_0x4082('0x12')](function(_0x3cc693){logger[_0x4082('0xd')](_0x4082('0xf'),_0x320dab,_0x3cc693);_0x53a4ac(_0x3cc693);});});} \ No newline at end of file +var _0x6469=['UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6469,0x1ab));var _0x9646=function(_0xdd7388,_0x343813){_0xdd7388=_0xdd7388-0x0;var _0x21c968=_0x6469[_0xdd7388];return _0x21c968;};'use strict';var _=require('lodash');var util=require(_0x9646('0x0'));var moment=require(_0x9646('0x1'));var BPromise=require(_0x9646('0x2'));var rs=require(_0x9646('0x3'));var fs=require('fs');var Redis=require(_0x9646('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9646('0x5'));var logger=require(_0x9646('0x6'))('rpc');var config=require(_0x9646('0x7'));var jayson=require(_0x9646('0x8'));var client=jayson[_0x9646('0x9')][_0x9646('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a4ee2,_0x319e8d,_0x52e4bc){return new BPromise(function(_0x5509bd,_0x465377){return client[_0x9646('0xb')](_0x3a4ee2,_0x52e4bc)[_0x9646('0xc')](function(_0x5e1f9d){logger[_0x9646('0xd')](_0x9646('0xe'),_0x319e8d,_0x9646('0xf'));logger[_0x9646('0x10')](_0x9646('0x11'),_0x319e8d,_0x9646('0xf'),JSON['stringify'](_0x5e1f9d));if(_0x5e1f9d['error']){if(_0x5e1f9d[_0x9646('0x12')]['code']===0x1f4){logger[_0x9646('0x12')](_0x9646('0xe'),_0x319e8d,_0x5e1f9d['error'][_0x9646('0x13')]);return _0x465377(_0x5e1f9d[_0x9646('0x12')]['message']);}logger[_0x9646('0x12')](_0x9646('0xe'),_0x319e8d,_0x5e1f9d['error'][_0x9646('0x13')]);return _0x5509bd(_0x5e1f9d[_0x9646('0x12')][_0x9646('0x13')]);}else{logger[_0x9646('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x319e8d,_0x9646('0xf'));_0x5509bd(_0x5e1f9d[_0x9646('0x14')][_0x9646('0x13')]);}})['catch'](function(_0x3306f1){logger[_0x9646('0x12')](_0x9646('0xe'),_0x319e8d,_0x3306f1);_0x465377(_0x3306f1);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 8294dd3..8fadb5f 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 _0xc43c=['multer','util','path','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc43c,0xd4));var _0xcc43=function(_0x3dee94,_0x572b01){_0x3dee94=_0x3dee94-0x0;var _0x35783c=_0xc43c[_0x3dee94];return _0x35783c;};'use strict';var multer=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var path=require(_0xcc43('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xcc43('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x0650=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0650,0xed));var _0x0065=function(_0x21363f,_0x41a233){_0x21363f=_0x21363f-0x0;var _0x3a6aad=_0x0650[_0x21363f];return _0x3a6aad;};'use strict';var multer=require(_0x0065('0x0'));var util=require('util');var path=require(_0x0065('0x1'));var timeout=require(_0x0065('0x2'));var express=require('express');var router=express[_0x0065('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0065('0x4'));var config=require(_0x0065('0x5'));module[_0x0065('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index adefc01..50764f5 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 _0x40cc=['INTEGER'];(function(_0x2c10a2,_0x50e082){var _0xc8726e=function(_0x46dd29){while(--_0x46dd29){_0x2c10a2['push'](_0x2c10a2['shift']());}};_0xc8726e(++_0x50e082);}(_0x40cc,0x105));var _0xc40c=function(_0x3a544a,_0x73a217){_0x3a544a=_0x3a544a-0x0;var _0x342f1e=_0x40cc[_0x3a544a];return _0x342f1e;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xc40c('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2252=['INTEGER','sequelize'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x2252,0x9b));var _0x2225=function(_0x309e20,_0x4f1ff3){_0x309e20=_0x309e20-0x0;var _0x2af783=_0x2252[_0x309e20];return _0x2af783;};'use strict';var Sequelize=require(_0x2225('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x2225('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 a6d9108..0f39a27 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 _0xb0c9=['define','UserVoiceQueue','user_has_voice_queues','lodash','util','moment','bluebird','request-promise','./userVoiceQueue.attributes'];(function(_0x3e6141,_0x4e159d){var _0x3d207=function(_0x2dee64){while(--_0x2dee64){_0x3e6141['push'](_0x3e6141['shift']());}};_0x3d207(++_0x4e159d);}(_0xb0c9,0x111));var _0x9b0c=function(_0xd0baae,_0x3020f4){_0xd0baae=_0xd0baae-0x0;var _0x538549=_0xb0c9[_0xd0baae];return _0x538549;};'use strict';var _=require(_0x9b0c('0x0'));var util=require(_0x9b0c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9b0c('0x2'));var BPromise=require(_0x9b0c('0x3'));var rp=require(_0x9b0c('0x4'));var attributes=require(_0x9b0c('0x5'));module['exports']=function(_0x1f2299,_0x3c1d04){return _0x1f2299[_0x9b0c('0x6')](_0x9b0c('0x7'),attributes,{'tableName':_0x9b0c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fad=['../../config/logger','api','moment','bluebird','request-promise','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','util'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x5fad,0x171));var _0xd5fa=function(_0x21cc45,_0x22eff2){_0x21cc45=_0x21cc45-0x0;var _0x169c76=_0x5fad[_0x21cc45];return _0x169c76;};'use strict';var _=require('lodash');var util=require(_0xd5fa('0x0'));var logger=require(_0xd5fa('0x1'))(_0xd5fa('0x2'));var moment=require(_0xd5fa('0x3'));var BPromise=require(_0xd5fa('0x4'));var rp=require(_0xd5fa('0x5'));var attributes=require(_0xd5fa('0x6'));module[_0xd5fa('0x7')]=function(_0x3548d5,_0x15122e){return _0x3548d5[_0xd5fa('0x8')](_0xd5fa('0x9'),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 7b5c882..9038411 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 _0xfdda=['info','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','UserVoiceQueue,\x20%s,\x20%s','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x381a28,_0x4eb359){var _0x5e572d=function(_0x46b8bf){while(--_0x46b8bf){_0x381a28['push'](_0x381a28['shift']());}};_0x5e572d(++_0x4eb359);}(_0xfdda,0xff));var _0xafdd=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0xfdda[_0x375492];return _0x18ba5b;};'use strict';var _=require(_0xafdd('0x0'));var util=require(_0xafdd('0x1'));var moment=require(_0xafdd('0x2'));var BPromise=require(_0xafdd('0x3'));var rs=require(_0xafdd('0x4'));var fs=require('fs');var Redis=require(_0xafdd('0x5'));var db=require(_0xafdd('0x6'))['db'];var utils=require(_0xafdd('0x7'));var logger=require('../../config/logger')(_0xafdd('0x8'));var config=require(_0xafdd('0x9'));var jayson=require(_0xafdd('0xa'));var client=jayson[_0xafdd('0xb')][_0xafdd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a9230,_0x55bbc0,_0x4d39f2){return new BPromise(function(_0x2a5404,_0x4232){return client['request'](_0x4a9230,_0x4d39f2)['then'](function(_0x21a561){logger['info'](_0xafdd('0xd'),_0x55bbc0,'request\x20sent');logger['debug'](_0xafdd('0xe'),_0x55bbc0,'request\x20sent',JSON['stringify'](_0x21a561));if(_0x21a561[_0xafdd('0xf')]){if(_0x21a561[_0xafdd('0xf')][_0xafdd('0x10')]===0x1f4){logger[_0xafdd('0xf')](_0xafdd('0xd'),_0x55bbc0,_0x21a561[_0xafdd('0xf')]['message']);return _0x4232(_0x21a561['error'][_0xafdd('0x11')]);}logger['error'](_0xafdd('0xd'),_0x55bbc0,_0x21a561['error']['message']);return _0x2a5404(_0x21a561[_0xafdd('0xf')]['message']);}else{logger[_0xafdd('0x12')](_0xafdd('0xd'),_0x55bbc0,_0xafdd('0x13'));_0x2a5404(_0x21a561[_0xafdd('0x14')][_0xafdd('0x11')]);}})['catch'](function(_0x1af806){logger[_0xafdd('0xf')](_0xafdd('0xd'),_0x55bbc0,_0x1af806);_0x4232(_0x1af806);});});} \ No newline at end of file +var _0xc34c=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring'];(function(_0x23a673,_0x31e4bc){var _0x2213b7=function(_0x3c5dcc){while(--_0x3c5dcc){_0x23a673['push'](_0x23a673['shift']());}};_0x2213b7(++_0x31e4bc);}(_0xc34c,0x131));var _0xcc34=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc34c[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xcc34('0x0'));var util=require('util');var moment=require(_0xcc34('0x1'));var BPromise=require('bluebird');var rs=require(_0xcc34('0x2'));var fs=require('fs');var Redis=require(_0xcc34('0x3'));var db=require(_0xcc34('0x4'))['db'];var utils=require(_0xcc34('0x5'));var logger=require('../../config/logger')(_0xcc34('0x6'));var config=require(_0xcc34('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcc34('0x8')][_0xcc34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b8f1d,_0x9b5180,_0x2b94f6){return new BPromise(function(_0x5e3ebc,_0x43b74d){return client['request'](_0x4b8f1d,_0x2b94f6)[_0xcc34('0xa')](function(_0x558194){logger[_0xcc34('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x9b5180,_0xcc34('0xc'));logger[_0xcc34('0xd')](_0xcc34('0xe'),_0x9b5180,_0xcc34('0xc'),JSON[_0xcc34('0xf')](_0x558194));if(_0x558194[_0xcc34('0x10')]){if(_0x558194[_0xcc34('0x10')][_0xcc34('0x11')]===0x1f4){logger[_0xcc34('0x10')](_0xcc34('0x12'),_0x9b5180,_0x558194[_0xcc34('0x10')][_0xcc34('0x13')]);return _0x43b74d(_0x558194['error'][_0xcc34('0x13')]);}logger[_0xcc34('0x10')](_0xcc34('0x12'),_0x9b5180,_0x558194[_0xcc34('0x10')][_0xcc34('0x13')]);return _0x5e3ebc(_0x558194[_0xcc34('0x10')][_0xcc34('0x13')]);}else{logger[_0xcc34('0xb')](_0xcc34('0x12'),_0x9b5180,'request\x20sent');_0x5e3ebc(_0x558194[_0xcc34('0x14')][_0xcc34('0x13')]);}})[_0xcc34('0x15')](function(_0xedb424){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x9b5180,_0xedb424);_0x43b74d(_0xedb424);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 75af522..0ce5125 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 _0x4f0d=['../../components/interaction/service','exports','Router','../../components/auth/service'];(function(_0xf44d98,_0x12a472){var _0x5ebb04=function(_0x930c33){while(--_0x930c33){_0xf44d98['push'](_0xf44d98['shift']());}};_0x5ebb04(++_0x12a472);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x20936e,_0x4d5283){_0x20936e=_0x20936e-0x0;var _0x50a212=_0x4f0d[_0x20936e];return _0x50a212;};'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[_0xd4f0('0x0')]();var auth=require(_0xd4f0('0x1'));var interaction=require(_0xd4f0('0x2'));var config=require('../../config/environment');module[_0xd4f0('0x3')]=router; \ No newline at end of file +var _0x2525=['../../config/environment','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x241d88,_0x44b2ea){var _0x1028fc=function(_0x4a7bb1){while(--_0x4a7bb1){_0x241d88['push'](_0x241d88['shift']());}};_0x1028fc(++_0x44b2ea);}(_0x2525,0x1f0));var _0x5252=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x2525[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x5252('0x0'));var util=require(_0x5252('0x1'));var path=require(_0x5252('0x2'));var timeout=require(_0x5252('0x3'));var express=require(_0x5252('0x4'));var router=express[_0x5252('0x5')]();var auth=require(_0x5252('0x6'));var interaction=require(_0x5252('0x7'));var config=require(_0x5252('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 a627be2..e692c26 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 _0xfa0b=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x166979,_0xca0f6){var _0x420af7=function(_0x163618){while(--_0x163618){_0x166979['push'](_0x166979['shift']());}};_0x420af7(++_0xca0f6);}(_0xfa0b,0x107));var _0xbfa0=function(_0x290c31,_0x534b8a){_0x290c31=_0x290c31-0x0;var _0x2eb0ac=_0xfa0b[_0x290c31];return _0x2eb0ac;};'use strict';var Sequelize=require(_0xbfa0('0x0'));module[_0xbfa0('0x1')]={'uniqueid':{'type':Sequelize[_0xbfa0('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xbfa0('0x3')},'membername':{'type':Sequelize[_0xbfa0('0x4')],'allowNull':![],'comment':_0xbfa0('0x3')},'UserId':{'type':Sequelize[_0xbfa0('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xbfa0('0x4')],'allowNull':![],'unique':_0xbfa0('0x5'),'comment':_0xbfa0('0x3')},'VoiceQueueId':{'type':Sequelize[_0xbfa0('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xbfa0('0x4')],'allowNull':![],'unique':_0xbfa0('0x5'),'comment':_0xbfa0('0x3')},'penalty':{'type':Sequelize[_0xbfa0('0x2')](0xb),'defaultValue':0x0,'comment':_0xbfa0('0x3')},'paused':{'type':Sequelize[_0xbfa0('0x2')](0xb),'defaultValue':0x0,'comment':_0xbfa0('0x3')}}; \ No newline at end of file +var _0x2b0c=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports','INTEGER'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2b0c,0x1a1));var _0xc2b0=function(_0x2134b7,_0x1eb5e2){_0x2134b7=_0x2134b7-0x0;var _0x6c5914=_0x2b0c[_0x2134b7];return _0x6c5914;};'use strict';var Sequelize=require(_0xc2b0('0x0'));module[_0xc2b0('0x1')]={'uniqueid':{'type':Sequelize[_0xc2b0('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xc2b0('0x3')},'membername':{'type':Sequelize[_0xc2b0('0x4')],'allowNull':![],'comment':_0xc2b0('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xc2b0('0x4')],'allowNull':![],'unique':_0xc2b0('0x5'),'comment':_0xc2b0('0x3')},'VoiceQueueId':{'type':Sequelize[_0xc2b0('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xc2b0('0x4')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xc2b0('0x2')](0xb),'defaultValue':0x0,'comment':_0xc2b0('0x3')},'paused':{'type':Sequelize[_0xc2b0('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 50f283e..842abf1 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 _0x3d55=['../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x3d55,0xab));var _0x53d5=function(_0x254ea6,_0x2666fc){_0x254ea6=_0x254ea6-0x0;var _0x64cebc=_0x3d55[_0x254ea6];return _0x64cebc;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x53d5('0x0'))['db'][_0x53d5('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x53d5('0x2')](0x0);var events={'afterCreate':_0x53d5('0x3'),'afterUpdate':_0x53d5('0x4'),'afterDestroy':_0x53d5('0x5')};function emitEvent(_0x105eb3){return function(_0x42c44a,_0x3cf9d0,_0x400ba9){UserVoiceQueueRtEvents[_0x53d5('0x6')](_0x105eb3+':'+_0x42c44a['id'],_0x42c44a);UserVoiceQueueRtEvents['emit'](_0x105eb3,_0x42c44a);_0x400ba9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x53d5('0x7')](e,emitEvent(event));}}module[_0x53d5('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x25b1=['emit','hook','events','../../mysqldb','UserVoiceQueueRt','save','update','remove'];(function(_0x50ec47,_0x6b2ba4){var _0x4274a1=function(_0x5e0909){while(--_0x5e0909){_0x50ec47['push'](_0x50ec47['shift']());}};_0x4274a1(++_0x6b2ba4);}(_0x25b1,0x1da));var _0x125b=function(_0x256057,_0x164e78){_0x256057=_0x256057-0x0;var _0xe7f4d3=_0x25b1[_0x256057];return _0xe7f4d3;};'use strict';var EventEmitter=require(_0x125b('0x0'));var UserVoiceQueueRt=require(_0x125b('0x1'))['db'][_0x125b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x125b('0x3'),'afterUpdate':_0x125b('0x4'),'afterDestroy':_0x125b('0x5')};function emitEvent(_0x2307a6){return function(_0x250fc7,_0x216029,_0x2da6a1){UserVoiceQueueRtEvents['emit'](_0x2307a6+':'+_0x250fc7['id'],_0x250fc7);UserVoiceQueueRtEvents[_0x125b('0x6')](_0x2307a6,_0x250fc7);_0x2da6a1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x125b('0x7')](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 d5bb2f7..b5f2f12 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 _0xea87=['./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x32da6e,_0x5c3182){var _0x2ddbb9=function(_0xc67eb3){while(--_0xc67eb3){_0x32da6e['push'](_0x32da6e['shift']());}};_0x2ddbb9(++_0x5c3182);}(_0xea87,0x90));var _0x7ea8=function(_0x328cda,_0x329816){_0x328cda=_0x328cda-0x0;var _0x24e18e=_0xea87[_0x328cda];return _0x24e18e;};'use strict';var _=require(_0x7ea8('0x0'));var util=require(_0x7ea8('0x1'));var logger=require(_0x7ea8('0x2'))(_0x7ea8('0x3'));var moment=require('moment');var BPromise=require(_0x7ea8('0x4'));var rp=require(_0x7ea8('0x5'));var attributes=require(_0x7ea8('0x6'));module[_0x7ea8('0x7')]=function(_0x265fbc,_0x40a913){return _0x265fbc[_0x7ea8('0x8')]('UserVoiceQueueRt',attributes,{'tableName':_0x7ea8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x455a=['util','api','moment','request-promise','exports','define','user_has_voice_queues_rt','lodash'];(function(_0x5beb86,_0x10db7c){var _0x2aeb7d=function(_0x1472f3){while(--_0x1472f3){_0x5beb86['push'](_0x5beb86['shift']());}};_0x2aeb7d(++_0x10db7c);}(_0x455a,0x7f));var _0xa455=function(_0x534817,_0x55cc0a){_0x534817=_0x534817-0x0;var _0x4e3ecb=_0x455a[_0x534817];return _0x4e3ecb;};'use strict';var _=require(_0xa455('0x0'));var util=require(_0xa455('0x1'));var logger=require('../../config/logger')(_0xa455('0x2'));var moment=require(_0xa455('0x3'));var BPromise=require('bluebird');var rp=require(_0xa455('0x4'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xa455('0x5')]=function(_0x37c75e,_0x1987e4){return _0x37c75e[_0xa455('0x6')]('UserVoiceQueueRt',attributes,{'tableName':_0xa455('0x7'),'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 7af584b..2a1181c 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 _0x6cc7=['result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','COUNT','sequelize','literal','outboundQueuePauses','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x2fc8df,_0x272613){var _0x33d19e=function(_0x3bf74d){while(--_0x3bf74d){_0x2fc8df['push'](_0x2fc8df['shift']());}};_0x33d19e(++_0x272613);}(_0x6cc7,0x7d));var _0x76cc=function(_0x2440fe,_0x281a11){_0x2440fe=_0x2440fe-0x0;var _0x5cf734=_0x6cc7[_0x2440fe];return _0x5cf734;};'use strict';var _=require(_0x76cc('0x0'));var util=require(_0x76cc('0x1'));var moment=require(_0x76cc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76cc('0x3'));var db=require(_0x76cc('0x4'))['db'];var utils=require(_0x76cc('0x5'));var logger=require(_0x76cc('0x6'))('rpc');var config=require(_0x76cc('0x7'));var jayson=require(_0x76cc('0x8'));var client=jayson[_0x76cc('0x9')][_0x76cc('0xa')]({'port':0x232a});config[_0x76cc('0xb')]=_[_0x76cc('0xc')](config[_0x76cc('0xb')],{'host':_0x76cc('0xd'),'port':0x18eb});var socket=require(_0x76cc('0xe'))(new Redis(config[_0x76cc('0xb')]));require(_0x76cc('0xf'))[_0x76cc('0x10')](socket);function respondWithRpcPromise(_0xe4ee5b,_0x67d2cf,_0x33b1ba){return new BPromise(function(_0x2a2385,_0x4ec654){return client[_0x76cc('0x11')](_0xe4ee5b,_0x33b1ba)[_0x76cc('0x12')](function(_0x531a20){logger[_0x76cc('0x13')](_0x76cc('0x14'),_0x67d2cf,'request\x20sent');logger[_0x76cc('0x15')](_0x76cc('0x16'),_0x67d2cf,_0x76cc('0x17'),JSON[_0x76cc('0x18')](_0x531a20));if(_0x531a20[_0x76cc('0x19')]){if(_0x531a20[_0x76cc('0x19')]['code']===0x1f4){logger[_0x76cc('0x19')](_0x76cc('0x14'),_0x67d2cf,_0x531a20['error'][_0x76cc('0x1a')]);return _0x4ec654(_0x531a20[_0x76cc('0x19')][_0x76cc('0x1a')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x67d2cf,_0x531a20[_0x76cc('0x19')]['message']);return _0x2a2385(_0x531a20[_0x76cc('0x19')]['message']);}else{logger[_0x76cc('0x13')](_0x76cc('0x14'),_0x67d2cf,_0x76cc('0x17'));_0x2a2385(_0x531a20[_0x76cc('0x1b')]['message']);}})[_0x76cc('0x1c')](function(_0x426f33){logger[_0x76cc('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x67d2cf,_0x426f33);_0x4ec654(_0x426f33);});});}exports[_0x76cc('0x1d')]=function(_0xd9f447){var _0x1596f1=this;return new Promise(function(_0x59c0fd,_0x13b008){return db[_0x76cc('0x1e')][_0x76cc('0x1f')]({'raw':_0xd9f447[_0x76cc('0x20')]?_0xd9f447[_0x76cc('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0xd9f447['options']?_0xd9f447[_0x76cc('0x20')][_0x76cc('0x21')]||null:null,'attributes':[[db['sequelize']['fn'](_0x76cc('0x22'),db[_0x76cc('0x23')]['fn']('IF',db['sequelize'][_0x76cc('0x24')]('`paused`\x20=\x201,\x201,\x20null'))),_0x76cc('0x25')]]})[_0x76cc('0x12')](function(_0x2dc214){logger['info'](_0x76cc('0x1d'),_0xd9f447);logger[_0x76cc('0x15')](_0x76cc('0x1d'),_0xd9f447,JSON[_0x76cc('0x18')](_0x2dc214));_0x59c0fd(_0x2dc214);})[_0x76cc('0x1c')](function(_0x2cf8b3){logger['error'](_0x76cc('0x1d'),_0x2cf8b3[_0x76cc('0x1a')],_0xd9f447);_0x13b008(_0x1596f1[_0x76cc('0x19')](0x1f4,_0x2cf8b3[_0x76cc('0x1a')]));});});}; \ No newline at end of file +var _0x5c25=['GetVoiceQueueRtPauses','findAll','options','raw','where','COUNT','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','catch','lodash','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','UserVoiceQueueRt,\x20%s,\x20%s','info','result'];(function(_0x5b3820,_0x51889c){var _0x442af8=function(_0x597ee1){while(--_0x597ee1){_0x5b3820['push'](_0x5b3820['shift']());}};_0x442af8(++_0x51889c);}(_0x5c25,0x181));var _0x55c2=function(_0x498e1c,_0xd545ca){_0x498e1c=_0x498e1c-0x0;var _0xb11ed3=_0x5c25[_0x498e1c];return _0xb11ed3;};'use strict';var _=require(_0x55c2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55c2('0x1'));var db=require(_0x55c2('0x2'))['db'];var utils=require(_0x55c2('0x3'));var logger=require('../../config/logger')(_0x55c2('0x4'));var config=require(_0x55c2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x55c2('0x6')][_0x55c2('0x7')]({'port':0x232a});config[_0x55c2('0x8')]=_[_0x55c2('0x9')](config[_0x55c2('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x55c2('0xa'))(new Redis(config[_0x55c2('0x8')]));require('./userVoiceQueueRt.socket')[_0x55c2('0xb')](socket);function respondWithRpcPromise(_0x26c0ba,_0x48999c,_0x294528){return new BPromise(function(_0x1ebaf3,_0x5a850c){return client[_0x55c2('0xc')](_0x26c0ba,_0x294528)[_0x55c2('0xd')](function(_0x41c4d0){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x48999c,'request\x20sent');logger[_0x55c2('0xe')](_0x55c2('0xf'),_0x48999c,_0x55c2('0x10'),JSON['stringify'](_0x41c4d0));if(_0x41c4d0['error']){if(_0x41c4d0['error'][_0x55c2('0x11')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x48999c,_0x41c4d0[_0x55c2('0x12')][_0x55c2('0x13')]);return _0x5a850c(_0x41c4d0[_0x55c2('0x12')][_0x55c2('0x13')]);}logger[_0x55c2('0x12')](_0x55c2('0x14'),_0x48999c,_0x41c4d0[_0x55c2('0x12')]['message']);return _0x1ebaf3(_0x41c4d0[_0x55c2('0x12')][_0x55c2('0x13')]);}else{logger[_0x55c2('0x15')](_0x55c2('0x14'),_0x48999c,_0x55c2('0x10'));_0x1ebaf3(_0x41c4d0[_0x55c2('0x16')]['message']);}})['catch'](function(_0x1a5955){logger[_0x55c2('0x12')](_0x55c2('0x14'),_0x48999c,_0x1a5955);_0x5a850c(_0x1a5955);});});}exports[_0x55c2('0x17')]=function(_0x427c81){var _0x13a8c2=this;return new Promise(function(_0x5e180d,_0x90ecd1){return db['UserVoiceQueueRt'][_0x55c2('0x18')]({'raw':_0x427c81[_0x55c2('0x19')]?_0x427c81[_0x55c2('0x19')][_0x55c2('0x1a')]===undefined?!![]:![]:!![],'where':_0x427c81[_0x55c2('0x19')]?_0x427c81[_0x55c2('0x19')][_0x55c2('0x1b')]||null:null,'attributes':[[db['sequelize']['fn'](_0x55c2('0x1c'),db[_0x55c2('0x1d')]['fn']('IF',db[_0x55c2('0x1d')]['literal'](_0x55c2('0x1e')))),_0x55c2('0x1f')]]})['then'](function(_0x1e2881){logger[_0x55c2('0x15')]('GetVoiceQueueRtPauses',_0x427c81);logger[_0x55c2('0xe')](_0x55c2('0x17'),_0x427c81,JSON[_0x55c2('0x20')](_0x1e2881));_0x5e180d(_0x1e2881);})[_0x55c2('0x21')](function(_0xe18847){logger[_0x55c2('0x12')]('GetVoiceQueueRtPauses',_0xe18847[_0x55c2('0x13')],_0x427c81);_0x90ecd1(_0x13a8c2[_0x55c2('0x12')](0x1f4,_0xe18847[_0x55c2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index fac2889..2282dbe 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 _0xa630=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x22542e,_0x5ac018){var _0x2cc928=function(_0x520a4a){while(--_0x520a4a){_0x22542e['push'](_0x22542e['shift']());}};_0x2cc928(++_0x5ac018);}(_0xa630,0xbe));var _0x0a63=function(_0x529346,_0x52b84b){_0x529346=_0x529346-0x0;var _0x143d83=_0xa630[_0x529346];return _0x143d83;};'use strict';var UserVoiceQueueRtEvents=require(_0x0a63('0x0'));var events=[_0x0a63('0x1'),'remove','update'];function createListener(_0x1a9586,_0x4f6b34){return function(_0xd0a045){_0x4f6b34['emit'](_0x1a9586,_0xd0a045);};}function removeListener(_0x91a747,_0x3bcb90){return function(){UserVoiceQueueRtEvents[_0x0a63('0x2')](_0x91a747,_0x3bcb90);};}exports[_0x0a63('0x3')]=function(_0x37b4c9){for(var _0x4b7474=0x0,_0x2760b0=events[_0x0a63('0x4')];_0x4b7474<_0x2760b0;_0x4b7474++){var _0xc2dcd7=events[_0x4b7474];var _0x41d21d=createListener(_0x0a63('0x5')+_0xc2dcd7,_0x37b4c9);UserVoiceQueueRtEvents['on'](_0xc2dcd7,_0x41d21d);}}; \ No newline at end of file +var _0x8f9d=['removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','emit'];(function(_0x53ee9a,_0x1db711){var _0x443611=function(_0x5534bf){while(--_0x5534bf){_0x53ee9a['push'](_0x53ee9a['shift']());}};_0x443611(++_0x1db711);}(_0x8f9d,0x93));var _0xd8f9=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8f9d[_0xfae23b];return _0x200640;};'use strict';var UserVoiceQueueRtEvents=require(_0xd8f9('0x0'));var events=['save',_0xd8f9('0x1'),'update'];function createListener(_0x682953,_0x421dcb){return function(_0x119296){_0x421dcb[_0xd8f9('0x2')](_0x682953,_0x119296);};}function removeListener(_0x1f9331,_0x1b82b8){return function(){UserVoiceQueueRtEvents[_0xd8f9('0x3')](_0x1f9331,_0x1b82b8);};}exports['register']=function(_0x1c37be){for(var _0x24dd1e=0x0,_0x25d417=events[_0xd8f9('0x4')];_0x24dd1e<_0x25d417;_0x24dd1e++){var _0xf6105=events[_0x24dd1e];var _0x5c410f=createListener(_0xd8f9('0x5')+_0xf6105,_0x1c37be);UserVoiceQueueRtEvents['on'](_0xf6105,_0x5c410f);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 2e6a42d..5a6fb66 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 _0x878f=['update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','create'];(function(_0x2b4635,_0x5a007a){var _0x2896c7=function(_0x436cff){while(--_0x436cff){_0x2b4635['push'](_0x2b4635['shift']());}};_0x2896c7(++_0x5a007a);}(_0x878f,0x173));var _0xf878=function(_0x2eca84,_0x12c1ab){_0x2eca84=_0x2eca84-0x0;var _0x56d8b2=_0x878f[_0x2eca84];return _0x56d8b2;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var auth=require(_0xf878('0x5'));var interaction=require(_0xf878('0x6'));var config=require(_0xf878('0x7'));var controller=require(_0xf878('0x8'));router[_0xf878('0x9')]('/',auth[_0xf878('0xa')](),controller['index']);router['get'](_0xf878('0xb'),auth[_0xf878('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf878('0xc')]);router['put']('/:id',auth[_0xf878('0xa')](),controller[_0xf878('0xd')]);router[_0xf878('0xe')]('/:id',auth[_0xf878('0xa')](),controller[_0xf878('0xf')]);module['exports']=router; \ No newline at end of file +var _0xe706=['update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0xe706,0xa3));var _0x6e70=function(_0x461c9e,_0x9a67cd){_0x461c9e=_0x461c9e-0x0;var _0x144e35=_0xe706[_0x461c9e];return _0x144e35;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0xe')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x10')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x12')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index ef46816..21b6fdf 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 _0x912e=['name','STRING'];(function(_0x1bb15f,_0x30fc18){var _0x474b90=function(_0x862eb9){while(--_0x862eb9){_0x1bb15f['push'](_0x1bb15f['shift']());}};_0x474b90(++_0x30fc18);}(_0x912e,0xe5));var _0xe912=function(_0x1e2b9,_0x1c46ff){_0x1e2b9=_0x1e2b9-0x0;var _0x577bb4=_0x912e[_0x1e2b9];return _0x577bb4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe912('0x0')],'unique':_0xe912('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe912('0x0')]}}; \ No newline at end of file +var _0x1bb2=['exports','STRING','name'];(function(_0x4c6111,_0x5f5b50){var _0x1e119b=function(_0xd92098){while(--_0xd92098){_0x4c6111['push'](_0x4c6111['shift']());}};_0x1e119b(++_0x5f5b50);}(_0x1bb2,0xc6));var _0x21bb=function(_0x18e4e8,_0x2f85db){_0x18e4e8=_0x18e4e8-0x0;var _0x64449b=_0x1bb2[_0x18e4e8];return _0x64449b;};'use strict';var Sequelize=require('sequelize');module[_0x21bb('0x0')]={'name':{'type':Sequelize[_0x21bb('0x1')],'unique':_0x21bb('0x2'),'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 1a1b91f..feaf2d4 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 _0xf1c4=['limit','set','Content-Range','apply','save','update','then','destroy','get','Variables','UserProfileResource','end','sendStatus','error','stack','name','send','index','Variable','rawAttributes','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','key','VIRTUAL','field','options','include','rows','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','catch','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xf1c4,0x129));var _0x4f1c=function(_0x4278a0,_0x3df698){_0x4278a0=_0x4278a0-0x0;var _0x476d5c=_0xf1c4[_0x4278a0];return _0x476d5c;};'use strict';var pdf=require(_0x4f1c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4f1c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f1c('0x2'));var rp=require(_0x4f1c('0x3'));var moment=require(_0x4f1c('0x4'));var BPromise=require(_0x4f1c('0x5'));var Mustache=require(_0x4f1c('0x6'));var util=require(_0x4f1c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4f1c('0x8'));var ejs=require(_0x4f1c('0x9'));var fs=require('fs');var _=require(_0x4f1c('0xa'));var squel=require(_0x4f1c('0xb'));var crypto=require(_0x4f1c('0xc'));var jsforce=require(_0x4f1c('0xd'));var deskjs=require(_0x4f1c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4f1c('0xf'));var Papa=require(_0x4f1c('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x4f1c('0x11'));var qs=require(_0x4f1c('0x12'));var logger=require('../../config/logger')(_0x4f1c('0x13'));var utils=require(_0x4f1c('0x14'));var config=require(_0x4f1c('0x15'));var db=require(_0x4f1c('0x16'))['db'];function respondWithStatusCode(_0xfe1ae2,_0x49e772){_0x49e772=_0x49e772||0xcc;return function(_0x30a7f6){if(_0x30a7f6){return _0xfe1ae2['sendStatus'](_0x49e772);}return _0xfe1ae2[_0x4f1c('0x17')](_0x49e772)['end']();};}function respondWithResult(_0x219508,_0x8949bf){_0x8949bf=_0x8949bf||0xc8;return function(_0x34fecd){if(_0x34fecd){return _0x219508[_0x4f1c('0x17')](_0x8949bf)[_0x4f1c('0x18')](_0x34fecd);}};}function respondWithFilteredResult(_0x3b69d0,_0x4bacbf){return function(_0x22a4ac){if(_0x22a4ac){var _0x25b971=_0x22a4ac[_0x4f1c('0x19')],_0x41c5e8=_0x4bacbf[_0x4f1c('0x1a')],_0x5de269=_0x4bacbf['offset']+_0x4bacbf[_0x4f1c('0x1b')],_0x5412f4;if(_0x5de269>=_0x25b971){_0x5de269=_0x25b971;_0x5412f4=0xc8;}else{_0x5412f4=0xce;}_0x3b69d0[_0x4f1c('0x17')](_0x5412f4);return _0x3b69d0[_0x4f1c('0x1c')](_0x4f1c('0x1d'),_0x41c5e8+'-'+_0x5de269+'/'+_0x25b971)[_0x4f1c('0x18')](_0x22a4ac);}return null;};}function patchUpdates(_0x2c0cee){return function(_0x38dda7){try{jsonpatch[_0x4f1c('0x1e')](_0x38dda7,_0x2c0cee,!![]);}catch(_0x21e3b4){return BPromise['reject'](_0x21e3b4);}return _0x38dda7[_0x4f1c('0x1f')]();};}function saveUpdates(_0x174fad,_0x205fca){return function(_0x280620){if(_0x280620){return _0x280620[_0x4f1c('0x20')](_0x174fad)[_0x4f1c('0x21')](function(_0x15610d){return _0x15610d;});}return null;};}function removeEntity(_0x16f51c,_0x5e3231){return function(_0x3a9cd9){if(_0x3a9cd9){return _0x3a9cd9[_0x4f1c('0x22')]()[_0x4f1c('0x21')](function(){var _0x258f96=_0x3a9cd9[_0x4f1c('0x23')]({'plain':!![]});var _0x3398b6=_0x4f1c('0x24');return db[_0x4f1c('0x25')]['destroy']({'where':{'type':_0x3398b6,'resourceId':_0x258f96['id']}})['then'](function(){return _0x3a9cd9;});})[_0x4f1c('0x21')](function(){_0x16f51c[_0x4f1c('0x17')](0xcc)[_0x4f1c('0x26')]();});}};}function handleEntityNotFound(_0x11b32f,_0x4c20d7){return function(_0x423140){if(!_0x423140){_0x11b32f[_0x4f1c('0x27')](0x194);}return _0x423140;};}function handleError(_0x4f086b,_0x125fcb){_0x125fcb=_0x125fcb||0x1f4;return function(_0x290786){logger[_0x4f1c('0x28')](_0x290786[_0x4f1c('0x29')]);if(_0x290786['name']){delete _0x290786[_0x4f1c('0x2a')];}_0x4f086b[_0x4f1c('0x17')](_0x125fcb)[_0x4f1c('0x2b')](_0x290786);};}exports[_0x4f1c('0x2c')]=function(_0x195d14,_0x45b7e6){var _0x49b9b2={},_0x593346={},_0x54aeea={'count':0x0,'rows':[]};var _0x47a10f=db[_0x4f1c('0x2d')][_0x4f1c('0x2e')];_0x593346['model']=_[_0x4f1c('0x2f')](_0x47a10f);_0x593346[_0x4f1c('0x30')]=_['keys'](_0x195d14[_0x4f1c('0x30')]);_0x593346['filters']=_[_0x4f1c('0x31')](_0x593346['model'],_0x593346[_0x4f1c('0x30')]);_0x49b9b2[_0x4f1c('0x32')]=_[_0x4f1c('0x31')](_0x593346[_0x4f1c('0x33')],qs[_0x4f1c('0x34')](_0x195d14[_0x4f1c('0x30')][_0x4f1c('0x34')]));_0x49b9b2['attributes']=_0x49b9b2[_0x4f1c('0x32')][_0x4f1c('0x35')]?_0x49b9b2[_0x4f1c('0x32')]:_0x593346[_0x4f1c('0x33')];if(!_0x195d14[_0x4f1c('0x30')][_0x4f1c('0x36')](_0x4f1c('0x37'))){_0x49b9b2[_0x4f1c('0x1b')]=qs[_0x4f1c('0x1b')](_0x195d14[_0x4f1c('0x30')]['limit']);_0x49b9b2['offset']=qs['offset'](_0x195d14['query'][_0x4f1c('0x1a')]);}_0x49b9b2['order']=qs[_0x4f1c('0x38')](_0x195d14[_0x4f1c('0x30')]['sort']);_0x49b9b2[_0x4f1c('0x39')]=qs[_0x4f1c('0x3a')](_[_0x4f1c('0x3b')](_0x195d14[_0x4f1c('0x30')],_0x593346[_0x4f1c('0x3a')]));if(_0x195d14[_0x4f1c('0x30')][_0x4f1c('0x3c')]){_0x49b9b2[_0x4f1c('0x39')]=_[_0x4f1c('0x3d')](_0x49b9b2[_0x4f1c('0x39')],{'$or':_['map'](_0x47a10f,function(_0xf79a75){if(_0xf79a75['type'][_0x4f1c('0x3e')]!==_0x4f1c('0x3f')){var _0x46e051={};_0x46e051[_0xf79a75[_0x4f1c('0x40')]]={'$like':'%'+_0x195d14['query']['filter']+'%'};return _0x46e051;}})});}_0x49b9b2=_[_0x4f1c('0x3d')]({},_0x49b9b2,_0x195d14[_0x4f1c('0x41')]);var _0x2f56f2={'where':_0x49b9b2[_0x4f1c('0x39')]};return db[_0x4f1c('0x2d')][_0x4f1c('0x19')](_0x2f56f2)['then'](function(_0x1fcd75){_0x54aeea[_0x4f1c('0x19')]=_0x1fcd75;if(_0x195d14[_0x4f1c('0x30')]['includeAll']){_0x49b9b2[_0x4f1c('0x42')]=[{'all':!![]}];}return db[_0x4f1c('0x2d')]['findAll'](_0x49b9b2);})[_0x4f1c('0x21')](function(_0x68cd21){_0x54aeea[_0x4f1c('0x43')]=_0x68cd21;return _0x54aeea;})[_0x4f1c('0x21')](respondWithFilteredResult(_0x45b7e6,_0x49b9b2))['catch'](handleError(_0x45b7e6,null));};exports[_0x4f1c('0x44')]=function(_0x2774b1,_0x11531b){var _0x4a197d={'raw':!![],'where':{'id':_0x2774b1[_0x4f1c('0x45')]['id']}},_0x42fdfe={};_0x42fdfe['model']=_[_0x4f1c('0x2f')](db[_0x4f1c('0x2d')][_0x4f1c('0x2e')]);_0x42fdfe[_0x4f1c('0x30')]=_[_0x4f1c('0x2f')](_0x2774b1[_0x4f1c('0x30')]);_0x42fdfe[_0x4f1c('0x3a')]=_[_0x4f1c('0x31')](_0x42fdfe['model'],_0x42fdfe[_0x4f1c('0x30')]);_0x4a197d['attributes']=_['intersection'](_0x42fdfe[_0x4f1c('0x33')],qs[_0x4f1c('0x34')](_0x2774b1['query'][_0x4f1c('0x34')]));_0x4a197d['attributes']=_0x4a197d['attributes']['length']?_0x4a197d[_0x4f1c('0x32')]:_0x42fdfe[_0x4f1c('0x33')];if(_0x2774b1[_0x4f1c('0x30')][_0x4f1c('0x46')]){_0x4a197d[_0x4f1c('0x42')]=[{'all':!![]}];}_0x4a197d=_[_0x4f1c('0x3d')]({},_0x4a197d,_0x2774b1[_0x4f1c('0x41')]);return db[_0x4f1c('0x2d')]['find'](_0x4a197d)[_0x4f1c('0x21')](handleEntityNotFound(_0x11531b,null))['then'](respondWithResult(_0x11531b,null))['catch'](handleError(_0x11531b,null));};exports['create']=function(_0x2d1035,_0x295d05){return db[_0x4f1c('0x2d')][_0x4f1c('0x47')](_0x2d1035[_0x4f1c('0x48')],{})[_0x4f1c('0x21')](function(_0x4add2d){var _0x2f5c1d=_0x2d1035[_0x4f1c('0x49')][_0x4f1c('0x23')]({'plain':!![]});if(!_0x2f5c1d)throw new Error(_0x4f1c('0x4a'));if(_0x2f5c1d[_0x4f1c('0x4b')]===_0x4f1c('0x49')){var _0x1ccc89=_0x4add2d[_0x4f1c('0x23')]({'plain':!![]});var _0x117a93='Variables';return db[_0x4f1c('0x4c')]['find']({'where':{'name':_0x117a93,'userProfileId':_0x2f5c1d['userProfileId']},'raw':!![]})[_0x4f1c('0x21')](function(_0x5b9464){if(_0x5b9464&&_0x5b9464[_0x4f1c('0x4d')]===0x0){return db[_0x4f1c('0x25')][_0x4f1c('0x47')]({'name':_0x1ccc89[_0x4f1c('0x2a')],'resourceId':_0x1ccc89['id'],'type':_0x5b9464[_0x4f1c('0x2a')],'sectionId':_0x5b9464['id']},{})[_0x4f1c('0x21')](function(){return _0x4add2d;});}else{return _0x4add2d;}})['catch'](function(_0x52f687){logger[_0x4f1c('0x28')](_0x4f1c('0x4e'),_0x52f687);throw _0x52f687;});}return _0x4add2d;})['then'](respondWithResult(_0x295d05,0xc9))['catch'](handleError(_0x295d05,null));};exports[_0x4f1c('0x20')]=function(_0x5d02c9,_0x4e7f30){if(_0x5d02c9[_0x4f1c('0x48')]['id']){delete _0x5d02c9[_0x4f1c('0x48')]['id'];}return db[_0x4f1c('0x2d')][_0x4f1c('0x4f')]({'where':{'id':_0x5d02c9[_0x4f1c('0x45')]['id']}})[_0x4f1c('0x21')](handleEntityNotFound(_0x4e7f30,null))[_0x4f1c('0x21')](saveUpdates(_0x5d02c9[_0x4f1c('0x48')],null))['then'](respondWithResult(_0x4e7f30,null))['catch'](handleError(_0x4e7f30,null));};exports[_0x4f1c('0x22')]=function(_0x139611,_0x1d15b9){return db[_0x4f1c('0x2d')][_0x4f1c('0x4f')]({'where':{'id':_0x139611[_0x4f1c('0x45')]['id']}})[_0x4f1c('0x21')](handleEntityNotFound(_0x1d15b9,null))['then'](removeEntity(_0x1d15b9,null))[_0x4f1c('0x50')](handleError(_0x1d15b9,null));}; \ No newline at end of file +var _0x742a=['lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','Variables','UserProfileResource','destroy','error','stack','name','send','index','Variable','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters','filter','where','merge','type','key','VIRTUAL','field','then','include','findAll','catch','show','params','includeAll','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x5cbcfd,_0xde8cf7){var _0x30daf1=function(_0x421880){while(--_0x421880){_0x5cbcfd['push'](_0x5cbcfd['shift']());}};_0x30daf1(++_0xde8cf7);}(_0x742a,0x1eb));var _0xa742=function(_0x4d94db,_0x5a2d71){_0x4d94db=_0x4d94db-0x0;var _0x41d157=_0x742a[_0x4d94db];return _0x41d157;};'use strict';var pdf=require(_0xa742('0x0'));var emlformat=require(_0xa742('0x1'));var rimraf=require(_0xa742('0x2'));var zipdir=require(_0xa742('0x3'));var jsonpatch=require(_0xa742('0x4'));var rp=require(_0xa742('0x5'));var moment=require(_0xa742('0x6'));var BPromise=require(_0xa742('0x7'));var Mustache=require(_0xa742('0x8'));var util=require(_0xa742('0x9'));var path=require(_0xa742('0xa'));var sox=require(_0xa742('0xb'));var csv=require(_0xa742('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa742('0xd'));var squel=require(_0xa742('0xe'));var crypto=require('crypto');var jsforce=require(_0xa742('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa742('0xc'));var querystring=require(_0xa742('0x10'));var Papa=require(_0xa742('0x11'));var authService=require(_0xa742('0x12'));var hardwareService=require(_0xa742('0x13'));var Redis=require('ioredis');var qs=require(_0xa742('0x14'));var logger=require(_0xa742('0x15'))(_0xa742('0x16'));var utils=require(_0xa742('0x17'));var config=require(_0xa742('0x18'));var db=require(_0xa742('0x19'))['db'];function respondWithStatusCode(_0x4ea9be,_0x3750bd){_0x3750bd=_0x3750bd||0xcc;return function(_0x35424c){if(_0x35424c){return _0x4ea9be[_0xa742('0x1a')](_0x3750bd);}return _0x4ea9be[_0xa742('0x1b')](_0x3750bd)[_0xa742('0x1c')]();};}function respondWithResult(_0x21b805,_0x54e9be){_0x54e9be=_0x54e9be||0xc8;return function(_0x2189a8){if(_0x2189a8){return _0x21b805[_0xa742('0x1b')](_0x54e9be)[_0xa742('0x1d')](_0x2189a8);}};}function respondWithFilteredResult(_0x5a6ab9,_0x2bb6c6){return function(_0x51da4e){if(_0x51da4e){var _0x3e9149=_0x51da4e[_0xa742('0x1e')],_0x3bf050=_0x2bb6c6['offset'],_0x13e226=_0x2bb6c6['offset']+_0x2bb6c6[_0xa742('0x1f')],_0x4103a0;if(_0x13e226>=_0x3e9149){_0x13e226=_0x3e9149;_0x4103a0=0xc8;}else{_0x4103a0=0xce;}_0x5a6ab9[_0xa742('0x1b')](_0x4103a0);return _0x5a6ab9[_0xa742('0x20')](_0xa742('0x21'),_0x3bf050+'-'+_0x13e226+'/'+_0x3e9149)[_0xa742('0x1d')](_0x51da4e);}return null;};}function patchUpdates(_0x3226fa){return function(_0x425bc6){try{jsonpatch[_0xa742('0x22')](_0x425bc6,_0x3226fa,!![]);}catch(_0x8c4b79){return BPromise[_0xa742('0x23')](_0x8c4b79);}return _0x425bc6[_0xa742('0x24')]();};}function saveUpdates(_0x396dcc,_0x353057){return function(_0x3b1b7a){if(_0x3b1b7a){return _0x3b1b7a['update'](_0x396dcc)['then'](function(_0x270f6c){return _0x270f6c;});}return null;};}function removeEntity(_0x5af4cb,_0x64a430){return function(_0x377cca){if(_0x377cca){return _0x377cca['destroy']()['then'](function(){var _0xa597af=_0x377cca['get']({'plain':!![]});var _0x215fa9=_0xa742('0x25');return db[_0xa742('0x26')][_0xa742('0x27')]({'where':{'type':_0x215fa9,'resourceId':_0xa597af['id']}})['then'](function(){return _0x377cca;});})['then'](function(){_0x5af4cb[_0xa742('0x1b')](0xcc)[_0xa742('0x1c')]();});}};}function handleEntityNotFound(_0x5219cc,_0x340bb7){return function(_0x4b241d){if(!_0x4b241d){_0x5219cc[_0xa742('0x1a')](0x194);}return _0x4b241d;};}function handleError(_0x5cc154,_0x576668){_0x576668=_0x576668||0x1f4;return function(_0x573a9a){logger[_0xa742('0x28')](_0x573a9a[_0xa742('0x29')]);if(_0x573a9a['name']){delete _0x573a9a[_0xa742('0x2a')];}_0x5cc154[_0xa742('0x1b')](_0x576668)[_0xa742('0x2b')](_0x573a9a);};}exports[_0xa742('0x2c')]=function(_0x2abd35,_0x29491a){var _0x1608a7={},_0x1cae3e={},_0x5074db={'count':0x0,'rows':[]};var _0x3d05ad=db[_0xa742('0x2d')][_0xa742('0x2e')];_0x1cae3e[_0xa742('0x2f')]=_[_0xa742('0x30')](_0x3d05ad);_0x1cae3e[_0xa742('0x31')]=_[_0xa742('0x30')](_0x2abd35[_0xa742('0x31')]);_0x1cae3e['filters']=_[_0xa742('0x32')](_0x1cae3e['model'],_0x1cae3e[_0xa742('0x31')]);_0x1608a7[_0xa742('0x33')]=_['intersection'](_0x1cae3e[_0xa742('0x2f')],qs['fields'](_0x2abd35[_0xa742('0x31')][_0xa742('0x34')]));_0x1608a7[_0xa742('0x33')]=_0x1608a7[_0xa742('0x33')][_0xa742('0x35')]?_0x1608a7['attributes']:_0x1cae3e[_0xa742('0x2f')];if(!_0x2abd35[_0xa742('0x31')][_0xa742('0x36')](_0xa742('0x37'))){_0x1608a7[_0xa742('0x1f')]=qs[_0xa742('0x1f')](_0x2abd35[_0xa742('0x31')][_0xa742('0x1f')]);_0x1608a7[_0xa742('0x38')]=qs[_0xa742('0x38')](_0x2abd35[_0xa742('0x31')][_0xa742('0x38')]);}_0x1608a7[_0xa742('0x39')]=qs[_0xa742('0x3a')](_0x2abd35[_0xa742('0x31')][_0xa742('0x3a')]);_0x1608a7['where']=qs[_0xa742('0x3b')](_['pick'](_0x2abd35['query'],_0x1cae3e['filters']));if(_0x2abd35[_0xa742('0x31')][_0xa742('0x3c')]){_0x1608a7[_0xa742('0x3d')]=_[_0xa742('0x3e')](_0x1608a7[_0xa742('0x3d')],{'$or':_['map'](_0x3d05ad,function(_0x312613){if(_0x312613[_0xa742('0x3f')][_0xa742('0x40')]!==_0xa742('0x41')){var _0xae84cc={};_0xae84cc[_0x312613[_0xa742('0x42')]]={'$like':'%'+_0x2abd35[_0xa742('0x31')][_0xa742('0x3c')]+'%'};return _0xae84cc;}})});}_0x1608a7=_['merge']({},_0x1608a7,_0x2abd35['options']);var _0x4fb77f={'where':_0x1608a7[_0xa742('0x3d')]};return db[_0xa742('0x2d')][_0xa742('0x1e')](_0x4fb77f)[_0xa742('0x43')](function(_0x448c4a){_0x5074db['count']=_0x448c4a;if(_0x2abd35[_0xa742('0x31')]['includeAll']){_0x1608a7[_0xa742('0x44')]=[{'all':!![]}];}return db[_0xa742('0x2d')][_0xa742('0x45')](_0x1608a7);})[_0xa742('0x43')](function(_0x59e52c){_0x5074db['rows']=_0x59e52c;return _0x5074db;})[_0xa742('0x43')](respondWithFilteredResult(_0x29491a,_0x1608a7))[_0xa742('0x46')](handleError(_0x29491a,null));};exports[_0xa742('0x47')]=function(_0xd4fc47,_0x4f0804){var _0x1da088={'raw':!![],'where':{'id':_0xd4fc47[_0xa742('0x48')]['id']}},_0x3925d9={};_0x3925d9[_0xa742('0x2f')]=_[_0xa742('0x30')](db[_0xa742('0x2d')]['rawAttributes']);_0x3925d9[_0xa742('0x31')]=_[_0xa742('0x30')](_0xd4fc47[_0xa742('0x31')]);_0x3925d9[_0xa742('0x3b')]=_[_0xa742('0x32')](_0x3925d9['model'],_0x3925d9['query']);_0x1da088[_0xa742('0x33')]=_[_0xa742('0x32')](_0x3925d9['model'],qs[_0xa742('0x34')](_0xd4fc47[_0xa742('0x31')]['fields']));_0x1da088['attributes']=_0x1da088['attributes'][_0xa742('0x35')]?_0x1da088['attributes']:_0x3925d9[_0xa742('0x2f')];if(_0xd4fc47[_0xa742('0x31')][_0xa742('0x49')]){_0x1da088['include']=[{'all':!![]}];}_0x1da088=_[_0xa742('0x3e')]({},_0x1da088,_0xd4fc47[_0xa742('0x4a')]);return db[_0xa742('0x2d')][_0xa742('0x4b')](_0x1da088)[_0xa742('0x43')](handleEntityNotFound(_0x4f0804,null))[_0xa742('0x43')](respondWithResult(_0x4f0804,null))['catch'](handleError(_0x4f0804,null));};exports[_0xa742('0x4c')]=function(_0x11b32a,_0xdccda1){return db['Variable'][_0xa742('0x4c')](_0x11b32a['body'],{})['then'](function(_0x56b30c){var _0x52b28b=_0x11b32a[_0xa742('0x4d')][_0xa742('0x4e')]({'plain':!![]});if(!_0x52b28b)throw new Error(_0xa742('0x4f'));if(_0x52b28b['role']===_0xa742('0x4d')){var _0xcc21ff=_0x56b30c['get']({'plain':!![]});var _0x54a670='Variables';return db[_0xa742('0x50')][_0xa742('0x4b')]({'where':{'name':_0x54a670,'userProfileId':_0x52b28b['userProfileId']},'raw':!![]})[_0xa742('0x43')](function(_0x15795b){if(_0x15795b&&_0x15795b[_0xa742('0x51')]===0x0){return db[_0xa742('0x26')][_0xa742('0x4c')]({'name':_0xcc21ff[_0xa742('0x2a')],'resourceId':_0xcc21ff['id'],'type':_0x15795b[_0xa742('0x2a')],'sectionId':_0x15795b['id']},{})['then'](function(){return _0x56b30c;});}else{return _0x56b30c;}})[_0xa742('0x46')](function(_0x5498dd){logger[_0xa742('0x28')](_0xa742('0x52'),_0x5498dd);throw _0x5498dd;});}return _0x56b30c;})[_0xa742('0x43')](respondWithResult(_0xdccda1,0xc9))[_0xa742('0x46')](handleError(_0xdccda1,null));};exports['update']=function(_0x2c7f72,_0xba1a62){if(_0x2c7f72['body']['id']){delete _0x2c7f72[_0xa742('0x53')]['id'];}return db[_0xa742('0x2d')][_0xa742('0x4b')]({'where':{'id':_0x2c7f72[_0xa742('0x48')]['id']}})[_0xa742('0x43')](handleEntityNotFound(_0xba1a62,null))[_0xa742('0x43')](saveUpdates(_0x2c7f72[_0xa742('0x53')],null))[_0xa742('0x43')](respondWithResult(_0xba1a62,null))['catch'](handleError(_0xba1a62,null));};exports[_0xa742('0x27')]=function(_0x4516a6,_0x10732a){return db[_0xa742('0x2d')][_0xa742('0x4b')]({'where':{'id':_0x4516a6[_0xa742('0x48')]['id']}})[_0xa742('0x43')](handleEntityNotFound(_0x10732a,null))[_0xa742('0x43')](removeEntity(_0x10732a,null))[_0xa742('0x46')](handleError(_0x10732a,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index d35c386..ef27165 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 _0x4975=['./variable.attributes','exports','define','tools_variables','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x8a6b13,_0x33e2fa){var _0x2fc362=function(_0x2b682a){while(--_0x2b682a){_0x8a6b13['push'](_0x8a6b13['shift']());}};_0x2fc362(++_0x33e2fa);}(_0x4975,0x86));var _0x5497=function(_0x35f708,_0x39ead0){_0x35f708=_0x35f708-0x0;var _0x16f5c8=_0x4975[_0x35f708];return _0x16f5c8;};'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')]('Variable',attributes,{'tableName':_0x5497('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['define','Variable','lodash','api','moment','bluebird','request-promise','./variable.attributes','exports'];(function(_0x2723d2,_0x49c1d2){var _0x5d667c=function(_0x59a3f8){while(--_0x59a3f8){_0x2723d2['push'](_0x2723d2['shift']());}};_0x5d667c(++_0x49c1d2);}(_0x326f,0xd1));var _0xf326=function(_0x444f4a,_0x4e1bdc){_0x444f4a=_0x444f4a-0x0;var _0x65e013=_0x326f[_0x444f4a];return _0x65e013;};'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 diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index b6176f7..85770db 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 _0xdbea=['bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','stringify','error','Variable,\x20%s,\x20%s','message','info','request\x20sent','ShowVariable','Variable','find','options','raw','attributes','include','model','map','debug','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdbea,0x1cd));var _0xadbe=function(_0x48a032,_0x1f92e8){_0x48a032=_0x48a032-0x0;var _0xb7cb07=_0xdbea[_0x48a032];return _0xb7cb07;};'use strict';var _=require(_0xadbe('0x0'));var util=require(_0xadbe('0x1'));var moment=require(_0xadbe('0x2'));var BPromise=require(_0xadbe('0x3'));var rs=require(_0xadbe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadbe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xadbe('0x6'))('rpc');var config=require(_0xadbe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xadbe('0x8')][_0xadbe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a53df,_0x27e7f8,_0x835a13){return new BPromise(function(_0x645120,_0x209fdd){return client[_0xadbe('0xa')](_0x4a53df,_0x835a13)[_0xadbe('0xb')](function(_0x14e9e8){logger['info']('Variable,\x20%s,\x20%s',_0x27e7f8,'request\x20sent');logger['debug']('Variable,\x20%s,\x20%s,\x20%s',_0x27e7f8,'request\x20sent',JSON[_0xadbe('0xc')](_0x14e9e8));if(_0x14e9e8[_0xadbe('0xd')]){if(_0x14e9e8[_0xadbe('0xd')]['code']===0x1f4){logger['error'](_0xadbe('0xe'),_0x27e7f8,_0x14e9e8[_0xadbe('0xd')][_0xadbe('0xf')]);return _0x209fdd(_0x14e9e8[_0xadbe('0xd')][_0xadbe('0xf')]);}logger[_0xadbe('0xd')]('Variable,\x20%s,\x20%s',_0x27e7f8,_0x14e9e8[_0xadbe('0xd')]['message']);return _0x645120(_0x14e9e8[_0xadbe('0xd')][_0xadbe('0xf')]);}else{logger[_0xadbe('0x10')](_0xadbe('0xe'),_0x27e7f8,_0xadbe('0x11'));_0x645120(_0x14e9e8['result']['message']);}})['catch'](function(_0x19c0c9){logger[_0xadbe('0xd')]('Variable,\x20%s,\x20%s',_0x27e7f8,_0x19c0c9);_0x209fdd(_0x19c0c9);});});}exports[_0xadbe('0x12')]=function(_0x57b9f1){var _0x3411c6=this;return new Promise(function(_0x1b7a76,_0x1cd859){return db[_0xadbe('0x13')][_0xadbe('0x14')]({'raw':_0x57b9f1[_0xadbe('0x15')]?_0x57b9f1[_0xadbe('0x15')][_0xadbe('0x16')]===undefined?!![]:![]:!![],'where':_0x57b9f1[_0xadbe('0x15')]?_0x57b9f1[_0xadbe('0x15')]['where']||null:null,'attributes':_0x57b9f1[_0xadbe('0x15')]?_0x57b9f1['options'][_0xadbe('0x17')]||null:null,'include':_0x57b9f1[_0xadbe('0x15')]?_0x57b9f1[_0xadbe('0x15')][_0xadbe('0x18')]?_['map'](_0x57b9f1[_0xadbe('0x15')]['include'],function(_0x4a3c5a){return{'model':db[_0x4a3c5a[_0xadbe('0x19')]],'as':_0x4a3c5a['as'],'attributes':_0x4a3c5a['attributes'],'include':_0x4a3c5a[_0xadbe('0x18')]?_[_0xadbe('0x1a')](_0x4a3c5a[_0xadbe('0x18')],function(_0x58b457){return{'model':db[_0x58b457[_0xadbe('0x19')]],'as':_0x58b457['as'],'attributes':_0x58b457['attributes'],'include':_0x58b457[_0xadbe('0x18')]?_[_0xadbe('0x1a')](_0x58b457[_0xadbe('0x18')],function(_0xd53b6c){return{'model':db[_0xd53b6c[_0xadbe('0x19')]],'as':_0xd53b6c['as'],'attributes':_0xd53b6c[_0xadbe('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb1e460){logger[_0xadbe('0x10')](_0xadbe('0x12'),_0x57b9f1);logger[_0xadbe('0x1b')](_0xadbe('0x12'),_0x57b9f1,JSON[_0xadbe('0xc')](_0xb1e460));_0x1b7a76(_0xb1e460);})[_0xadbe('0x1c')](function(_0x4718c2){logger[_0xadbe('0xd')](_0xadbe('0x12'),_0x4718c2[_0xadbe('0xf')],_0x57b9f1);_0x1cd859(_0x3411c6[_0xadbe('0xd')](0x1f4,_0x4718c2[_0xadbe('0xf')]));});});}; \ No newline at end of file +var _0xac8e=['client','http','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowVariable','Variable','options','raw','attributes','map','include','model','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x261a49,_0x5db17f){var _0x56f4fa=function(_0x2bd325){while(--_0x2bd325){_0x261a49['push'](_0x261a49['shift']());}};_0x56f4fa(++_0x5db17f);}(_0xac8e,0x1d6));var _0xeac8=function(_0x267bbc,_0xa208b9){_0x267bbc=_0x267bbc-0x0;var _0x388895=_0xac8e[_0x267bbc];return _0x388895;};'use strict';var _=require(_0xeac8('0x0'));var util=require(_0xeac8('0x1'));var moment=require(_0xeac8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeac8('0x3'));var db=require(_0xeac8('0x4'))['db'];var utils=require(_0xeac8('0x5'));var logger=require(_0xeac8('0x6'))(_0xeac8('0x7'));var config=require(_0xeac8('0x8'));var jayson=require(_0xeac8('0x9'));var client=jayson[_0xeac8('0xa')][_0xeac8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23eb91,_0xa6e5e8,_0x37841a){return new BPromise(function(_0x46229d,_0xdd46f7){return client['request'](_0x23eb91,_0x37841a)[_0xeac8('0xc')](function(_0xe2d53e){logger[_0xeac8('0xd')](_0xeac8('0xe'),_0xa6e5e8,'request\x20sent');logger[_0xeac8('0xf')](_0xeac8('0x10'),_0xa6e5e8,_0xeac8('0x11'),JSON[_0xeac8('0x12')](_0xe2d53e));if(_0xe2d53e[_0xeac8('0x13')]){if(_0xe2d53e[_0xeac8('0x13')][_0xeac8('0x14')]===0x1f4){logger[_0xeac8('0x13')](_0xeac8('0xe'),_0xa6e5e8,_0xe2d53e[_0xeac8('0x13')]['message']);return _0xdd46f7(_0xe2d53e[_0xeac8('0x13')][_0xeac8('0x15')]);}logger[_0xeac8('0x13')](_0xeac8('0xe'),_0xa6e5e8,_0xe2d53e[_0xeac8('0x13')][_0xeac8('0x15')]);return _0x46229d(_0xe2d53e[_0xeac8('0x13')][_0xeac8('0x15')]);}else{logger[_0xeac8('0xd')](_0xeac8('0xe'),_0xa6e5e8,_0xeac8('0x11'));_0x46229d(_0xe2d53e[_0xeac8('0x16')][_0xeac8('0x15')]);}})[_0xeac8('0x17')](function(_0x1385e5){logger[_0xeac8('0x13')](_0xeac8('0xe'),_0xa6e5e8,_0x1385e5);_0xdd46f7(_0x1385e5);});});}exports[_0xeac8('0x18')]=function(_0x30b2d2){var _0x1512bb=this;return new Promise(function(_0x3d20ee,_0x3c3450){return db[_0xeac8('0x19')]['find']({'raw':_0x30b2d2[_0xeac8('0x1a')]?_0x30b2d2['options'][_0xeac8('0x1b')]===undefined?!![]:![]:!![],'where':_0x30b2d2['options']?_0x30b2d2['options']['where']||null:null,'attributes':_0x30b2d2['options']?_0x30b2d2[_0xeac8('0x1a')][_0xeac8('0x1c')]||null:null,'include':_0x30b2d2[_0xeac8('0x1a')]?_0x30b2d2[_0xeac8('0x1a')]['include']?_[_0xeac8('0x1d')](_0x30b2d2[_0xeac8('0x1a')][_0xeac8('0x1e')],function(_0x36e24b){return{'model':db[_0x36e24b[_0xeac8('0x1f')]],'as':_0x36e24b['as'],'attributes':_0x36e24b[_0xeac8('0x1c')],'include':_0x36e24b[_0xeac8('0x1e')]?_['map'](_0x36e24b['include'],function(_0x1ee171){return{'model':db[_0x1ee171['model']],'as':_0x1ee171['as'],'attributes':_0x1ee171[_0xeac8('0x1c')],'include':_0x1ee171[_0xeac8('0x1e')]?_[_0xeac8('0x1d')](_0x1ee171[_0xeac8('0x1e')],function(_0x32e2db){return{'model':db[_0x32e2db[_0xeac8('0x1f')]],'as':_0x32e2db['as'],'attributes':_0x32e2db['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x488d96){logger['info'](_0xeac8('0x18'),_0x30b2d2);logger[_0xeac8('0xf')](_0xeac8('0x18'),_0x30b2d2,JSON[_0xeac8('0x12')](_0x488d96));_0x3d20ee(_0x488d96);})[_0xeac8('0x17')](function(_0x181077){logger['error'](_0xeac8('0x18'),_0x181077[_0xeac8('0x15')],_0x30b2d2);_0x3c3450(_0x1512bb[_0xeac8('0x13')](0x1f4,_0x181077[_0xeac8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 0e1b5b8..d6f819c 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 _0x83ed=['reset','canUpdate','/restart','restart','Router','../../components/auth/service','./version.controller','get','index','/fetch','/reset','isAuthenticated'];(function(_0x396530,_0x1f14eb){var _0x23021b=function(_0x37d511){while(--_0x37d511){_0x396530['push'](_0x396530['shift']());}};_0x23021b(++_0x1f14eb);}(_0x83ed,0x1cc));var _0xd83e=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x83ed[_0x3826ad];return _0x17b900;};'use strict';var express=require('express');var router=express[_0xd83e('0x0')]();var auth=require(_0xd83e('0x1'));var controller=require(_0xd83e('0x2'));router[_0xd83e('0x3')]('/',controller[_0xd83e('0x4')]);router[_0xd83e('0x3')](_0xd83e('0x5'),auth['isAuthenticated'](),auth['canUpdate'](),controller['fetch']);router[_0xd83e('0x3')](_0xd83e('0x6'),auth[_0xd83e('0x7')](),auth['canUpdate'](),controller[_0xd83e('0x8')]);router[_0xd83e('0x3')]('/pull',auth[_0xd83e('0x7')](),auth[_0xd83e('0x9')](),controller['pull']);router[_0xd83e('0x3')](_0xd83e('0xa'),auth[_0xd83e('0x7')](),controller[_0xd83e('0xb')]);router[_0xd83e('0x3')]('/migrations',controller['migrations']);module['exports']=router; \ No newline at end of file +var _0x8b59=['canUpdate','fetch','/reset','reset','/pull','pull','/restart','/migrations','exports','express','get','isAuthenticated'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x8b59,0x99));var _0x98b5=function(_0x318f7c,_0x1b55b6){_0x318f7c=_0x318f7c-0x0;var _0x46819f=_0x8b59[_0x318f7c];return _0x46819f;};'use strict';var express=require(_0x98b5('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0x98b5('0x1')]('/',controller['index']);router[_0x98b5('0x1')]('/fetch',auth[_0x98b5('0x2')](),auth[_0x98b5('0x3')](),controller[_0x98b5('0x4')]);router[_0x98b5('0x1')](_0x98b5('0x5'),auth[_0x98b5('0x2')](),auth[_0x98b5('0x3')](),controller[_0x98b5('0x6')]);router['get'](_0x98b5('0x7'),auth[_0x98b5('0x2')](),auth[_0x98b5('0x3')](),controller[_0x98b5('0x8')]);router[_0x98b5('0x1')](_0x98b5('0x9'),auth[_0x98b5('0x2')](),controller['restart']);router[_0x98b5('0x1')](_0x98b5('0xa'),controller['migrations']);module[_0x98b5('0xb')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 0330055..7e836c9 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(_0x404a93,_0x111456){var _0x3578b3=function(_0x598b33){while(--_0x598b33){_0x404a93['push'](_0x404a93['shift']());}};_0x3578b3(++_0x111456);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 _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(_0x5ccf87,_0x21b407){var _0x5ab929=function(_0x299f55){while(--_0x299f55){_0x5ccf87['push'](_0x5ccf87['shift']());}};_0x5ab929(++_0x21b407);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 96b5b0f..8dc90b0 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 _0x187d=['../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x2dbcef,_0x1cfecb){var _0x5a90ea=function(_0x189054){while(--_0x189054){_0x2dbcef['push'](_0x2dbcef['shift']());}};_0x5a90ea(++_0x1cfecb);}(_0x187d,0x93));var _0xd187=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x187d[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var auth=require(_0xd187('0x5'));var interaction=require(_0xd187('0x6'));var config=require('../../config/environment');var controller=require(_0xd187('0x7'));router[_0xd187('0x8')]('/',auth['isAuthenticated'](),controller[_0xd187('0x9')]);router[_0xd187('0x8')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xc')]);router[_0xd187('0x8')](_0xd187('0xd'),auth[_0xd187('0xb')](),controller['show']);router[_0xd187('0xe')]('/',auth[_0xd187('0xb')](),controller[_0xd187('0xf')]);router[_0xd187('0x10')](_0xd187('0xd'),auth[_0xd187('0xb')](),controller['update']);router[_0xd187('0x11')](_0xd187('0xd'),auth[_0xd187('0xb')](),controller['destroy']);module[_0xd187('0x12')]=router; \ No newline at end of file +var _0x5430=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','post','put','update','delete'];(function(_0x1eee57,_0x32ecd2){var _0x280af6=function(_0x2d8a64){while(--_0x2d8a64){_0x1eee57['push'](_0x1eee57['shift']());}};_0x280af6(++_0x32ecd2);}(_0x5430,0x10c));var _0x0543=function(_0x48e01b,_0x6b323d){_0x48e01b=_0x48e01b-0x0;var _0x40e989=_0x5430[_0x48e01b];return _0x40e989;};'use strict';var multer=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var path=require(_0x0543('0x2'));var timeout=require(_0x0543('0x3'));var express=require(_0x0543('0x4'));var router=express[_0x0543('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0543('0x6'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0x0543('0x7')](),controller[_0x0543('0x8')]);router[_0x0543('0x9')](_0x0543('0xa'),auth[_0x0543('0x7')](),controller['describe']);router[_0x0543('0x9')](_0x0543('0xb'),auth[_0x0543('0x7')](),controller[_0x0543('0xc')]);router[_0x0543('0xd')]('/',auth[_0x0543('0x7')](),controller['create']);router[_0x0543('0xe')](_0x0543('0xb'),auth['isAuthenticated'](),controller[_0x0543('0xf')]);router[_0x0543('0x10')](_0x0543('0xb'),auth[_0x0543('0x7')](),controller[_0x0543('0x11')]);module[_0x0543('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 712890b..f988e3e 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 _0x1847=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x2bb2c6,_0xbb71b){var _0x153358=function(_0x48286a){while(--_0x48286a){_0x2bb2c6['push'](_0x2bb2c6['shift']());}};_0x153358(++_0xbb71b);}(_0x1847,0x76));var _0x7184=function(_0x41cb4b,_0x200468){_0x41cb4b=_0x41cb4b-0x0;var _0x1719c1=_0x1847[_0x41cb4b];return _0x1719c1;};'use strict';var Sequelize=require(_0x7184('0x0'));module[_0x7184('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7184('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x7184('0x2')]},'interface':{'type':Sequelize[_0x7184('0x2')]},'membername':{'type':Sequelize[_0x7184('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x7184('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x7184('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x7184('0x3')]},'holdtime':{'type':Sequelize[_0x7184('0x4')]},'agentcomplete':{'type':Sequelize[_0x7184('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x7184('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x7184('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x7184('0x4')]},'agentacw':{'type':Sequelize[_0x7184('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7184('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x7184('0x2')]},'channel':{'type':Sequelize[_0x7184('0x2')]},'channelstate':{'type':Sequelize[_0x7184('0x4')]},'channelstatedesc':{'type':Sequelize[_0x7184('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7184('0x2')]},'connectedlinename':{'type':Sequelize[_0x7184('0x2')]},'language':{'type':Sequelize[_0x7184('0x2')]},'accountcode':{'type':Sequelize[_0x7184('0x2')]},'context':{'type':Sequelize[_0x7184('0x2')]},'exten':{'type':Sequelize[_0x7184('0x2')]},'priority':{'type':Sequelize[_0x7184('0x2')]},'destchannel':{'type':Sequelize[_0x7184('0x2')]},'destchannelstate':{'type':Sequelize[_0x7184('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7184('0x2')]},'destcalleridname':{'type':Sequelize[_0x7184('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x7184('0x2')]},'destlanguage':{'type':Sequelize[_0x7184('0x2')]},'destaccountcode':{'type':Sequelize[_0x7184('0x2')]},'destcontext':{'type':Sequelize[_0x7184('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x7184('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x7184('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x7184('0x2')]}}; \ No newline at end of file +var _0xb9b1=['BOOLEAN','INTEGER','sequelize','exports','STRING','DATE'];(function(_0x2468b5,_0x506b9e){var _0x1056e4=function(_0x26da1c){while(--_0x26da1c){_0x2468b5['push'](_0x2468b5['shift']());}};_0x1056e4(++_0x506b9e);}(_0xb9b1,0x128));var _0x1b9b=function(_0x36b502,_0x2ffe34){_0x36b502=_0x36b502-0x0;var _0x5018af=_0xb9b1[_0x36b502];return _0x5018af;};'use strict';var Sequelize=require(_0x1b9b('0x0'));module[_0x1b9b('0x1')]={'type':{'type':Sequelize[_0x1b9b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1b9b('0x2')]},'calleridname':{'type':Sequelize[_0x1b9b('0x2')]},'queue':{'type':Sequelize[_0x1b9b('0x2')]},'interface':{'type':Sequelize[_0x1b9b('0x2')]},'membername':{'type':Sequelize[_0x1b9b('0x2')]},'agentcalledAt':{'type':Sequelize[_0x1b9b('0x3')]},'agentconnectAt':{'type':Sequelize[_0x1b9b('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x1b9b('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x1b9b('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x1b9b('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x1b9b('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x1b9b('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x1b9b('0x5')]},'agentacw':{'type':Sequelize[_0x1b9b('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x1b9b('0x2')]},'lastevent':{'type':Sequelize[_0x1b9b('0x2')]},'channel':{'type':Sequelize[_0x1b9b('0x2')]},'channelstate':{'type':Sequelize[_0x1b9b('0x5')]},'channelstatedesc':{'type':Sequelize[_0x1b9b('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1b9b('0x2')]},'connectedlinename':{'type':Sequelize[_0x1b9b('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1b9b('0x2')]},'context':{'type':Sequelize[_0x1b9b('0x2')]},'exten':{'type':Sequelize[_0x1b9b('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x1b9b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x1b9b('0x2')]},'destcalleridnum':{'type':Sequelize[_0x1b9b('0x2')]},'destcalleridname':{'type':Sequelize[_0x1b9b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x1b9b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x1b9b('0x2')]},'destlanguage':{'type':Sequelize[_0x1b9b('0x2')]},'destaccountcode':{'type':Sequelize[_0x1b9b('0x2')]},'destcontext':{'type':Sequelize[_0x1b9b('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x1b9b('0x2')]},'destuniqueid':{'type':Sequelize[_0x1b9b('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x1b9b('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index fe37595..0938c17 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 _0x0711=['count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','key','VIRTUAL','field','options','VoiceAgentReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','end','status'];(function(_0x4811ab,_0x3bf626){var _0x5ca955=function(_0x2831b3){while(--_0x2831b3){_0x4811ab['push'](_0x4811ab['shift']());}};_0x5ca955(++_0x3bf626);}(_0x0711,0x1e5));var _0x1071=function(_0x7ed555,_0x338db7){_0x7ed555=_0x7ed555-0x0;var _0x3bd4f2=_0x0711[_0x7ed555];return _0x3bd4f2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1071('0x0'));var rimraf=require(_0x1071('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1071('0x2'));var rp=require(_0x1071('0x3'));var moment=require(_0x1071('0x4'));var BPromise=require(_0x1071('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1071('0x6'));var sox=require(_0x1071('0x7'));var csv=require('to-csv');var ejs=require(_0x1071('0x8'));var fs=require('fs');var _=require(_0x1071('0x9'));var squel=require(_0x1071('0xa'));var crypto=require(_0x1071('0xb'));var jsforce=require(_0x1071('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1071('0xd'));var querystring=require(_0x1071('0xe'));var Papa=require(_0x1071('0xf'));var authService=require(_0x1071('0x10'));var hardwareService=require(_0x1071('0x11'));var Redis=require(_0x1071('0x12'));var qs=require(_0x1071('0x13'));var logger=require('../../config/logger')(_0x1071('0x14'));var utils=require(_0x1071('0x15'));var config=require(_0x1071('0x16'));var db=require(_0x1071('0x17'))['db'];function respondWithStatusCode(_0x28b041,_0x451ea0){_0x451ea0=_0x451ea0||0xcc;return function(_0x3b0a11){if(_0x3b0a11){return _0x28b041['sendStatus'](_0x451ea0);}return _0x28b041['status'](_0x451ea0)[_0x1071('0x18')]();};}function respondWithResult(_0x511d38,_0x41192d){_0x41192d=_0x41192d||0xc8;return function(_0x283358){if(_0x283358){return _0x511d38[_0x1071('0x19')](_0x41192d)['json'](_0x283358);}};}function respondWithFilteredResult(_0x9495dc,_0x2da763){return function(_0x22f01a){if(_0x22f01a){var _0x5318cd=_0x22f01a[_0x1071('0x1a')],_0x32ed04=_0x2da763[_0x1071('0x1b')],_0x3882d2=_0x2da763[_0x1071('0x1b')]+_0x2da763[_0x1071('0x1c')],_0x26eb97;if(_0x3882d2>=_0x5318cd){_0x3882d2=_0x5318cd;_0x26eb97=0xc8;}else{_0x26eb97=0xce;}_0x9495dc[_0x1071('0x19')](_0x26eb97);return _0x9495dc[_0x1071('0x1d')](_0x1071('0x1e'),_0x32ed04+'-'+_0x3882d2+'/'+_0x5318cd)['json'](_0x22f01a);}return null;};}function patchUpdates(_0x574cfe){return function(_0x5d3562){try{jsonpatch['apply'](_0x5d3562,_0x574cfe,!![]);}catch(_0x5db523){return BPromise['reject'](_0x5db523);}return _0x5d3562[_0x1071('0x1f')]();};}function saveUpdates(_0x2ef8fe,_0x302e45){return function(_0x4a1fc8){if(_0x4a1fc8){return _0x4a1fc8[_0x1071('0x20')](_0x2ef8fe)[_0x1071('0x21')](function(_0x29e211){return _0x29e211;});}return null;};}function removeEntity(_0x4fe87d,_0x231302){return function(_0x2f4ffa){if(_0x2f4ffa){return _0x2f4ffa[_0x1071('0x22')]()[_0x1071('0x21')](function(){_0x4fe87d['status'](0xcc)[_0x1071('0x18')]();});}};}function handleEntityNotFound(_0x38a571,_0x413d73){return function(_0xb8e017){if(!_0xb8e017){_0x38a571['sendStatus'](0x194);}return _0xb8e017;};}function handleError(_0x2724a8,_0x5aa536){_0x5aa536=_0x5aa536||0x1f4;return function(_0x3d5434){logger[_0x1071('0x23')](_0x3d5434[_0x1071('0x24')]);if(_0x3d5434[_0x1071('0x25')]){delete _0x3d5434['name'];}_0x2724a8[_0x1071('0x19')](_0x5aa536)[_0x1071('0x26')](_0x3d5434);};}exports['index']=function(_0x56ce33,_0x4b63ac){var _0x2d7750={},_0x486865={},_0x5e1750={'count':0x0,'rows':[]};var _0x541707=db['VoiceAgentReport']['rawAttributes'];_0x486865[_0x1071('0x27')]=_[_0x1071('0x28')](_0x541707);_0x486865[_0x1071('0x29')]=_[_0x1071('0x28')](_0x56ce33['query']);_0x486865[_0x1071('0x2a')]=_[_0x1071('0x2b')](_0x486865['model'],_0x486865[_0x1071('0x29')]);_0x2d7750[_0x1071('0x2c')]=_[_0x1071('0x2b')](_0x486865[_0x1071('0x27')],qs[_0x1071('0x2d')](_0x56ce33['query']['fields']));_0x2d7750[_0x1071('0x2c')]=_0x2d7750['attributes'][_0x1071('0x2e')]?_0x2d7750['attributes']:_0x486865[_0x1071('0x27')];if(!_0x56ce33[_0x1071('0x29')][_0x1071('0x2f')](_0x1071('0x30'))){_0x2d7750[_0x1071('0x1c')]=qs['limit'](_0x56ce33[_0x1071('0x29')][_0x1071('0x1c')]);_0x2d7750[_0x1071('0x1b')]=qs['offset'](_0x56ce33[_0x1071('0x29')]['offset']);}_0x2d7750[_0x1071('0x31')]=qs[_0x1071('0x32')](_0x56ce33['query'][_0x1071('0x32')]);_0x2d7750['where']=qs[_0x1071('0x2a')](_[_0x1071('0x33')](_0x56ce33['query'],_0x486865[_0x1071('0x2a')]));if(_0x56ce33[_0x1071('0x29')][_0x1071('0x34')]){_0x2d7750[_0x1071('0x35')]=_[_0x1071('0x36')](_0x2d7750[_0x1071('0x35')],{'$or':_['map'](_0x541707,function(_0x5ef493){if(_0x5ef493[_0x1071('0x37')][_0x1071('0x38')]!==_0x1071('0x39')){var _0x2e0a87={};_0x2e0a87[_0x5ef493[_0x1071('0x3a')]]={'$like':'%'+_0x56ce33[_0x1071('0x29')][_0x1071('0x34')]+'%'};return _0x2e0a87;}})});}_0x2d7750=_[_0x1071('0x36')]({},_0x2d7750,_0x56ce33[_0x1071('0x3b')]);var _0x5c8835={'where':_0x2d7750[_0x1071('0x35')]};return db[_0x1071('0x3c')]['count'](_0x5c8835)['then'](function(_0x5739cb){_0x5e1750[_0x1071('0x1a')]=_0x5739cb;if(_0x56ce33[_0x1071('0x29')][_0x1071('0x3d')]){_0x2d7750[_0x1071('0x3e')]=[{'all':!![]}];}return db[_0x1071('0x3c')][_0x1071('0x3f')](_0x2d7750);})[_0x1071('0x21')](function(_0x5d458c){_0x5e1750[_0x1071('0x40')]=_0x5d458c;return _0x5e1750;})['then'](respondWithFilteredResult(_0x4b63ac,_0x2d7750))[_0x1071('0x41')](handleError(_0x4b63ac,null));};exports[_0x1071('0x42')]=function(_0x34b625,_0xd96d1b){var _0x2c2b65={'raw':![],'where':{'id':_0x34b625[_0x1071('0x43')]['id']}},_0x11c298={};_0x11c298[_0x1071('0x27')]=_[_0x1071('0x28')](db['VoiceAgentReport'][_0x1071('0x44')]);_0x11c298[_0x1071('0x29')]=_['keys'](_0x34b625['query']);_0x11c298['filters']=_[_0x1071('0x2b')](_0x11c298[_0x1071('0x27')],_0x11c298[_0x1071('0x29')]);_0x2c2b65[_0x1071('0x2c')]=_[_0x1071('0x2b')](_0x11c298[_0x1071('0x27')],qs[_0x1071('0x2d')](_0x34b625['query'][_0x1071('0x2d')]));_0x2c2b65['attributes']=_0x2c2b65[_0x1071('0x2c')][_0x1071('0x2e')]?_0x2c2b65[_0x1071('0x2c')]:_0x11c298[_0x1071('0x27')];if(_0x34b625['query'][_0x1071('0x3d')]){_0x2c2b65[_0x1071('0x3e')]=[{'all':!![]}];}_0x2c2b65=_['merge']({},_0x2c2b65,_0x34b625['options']);return db[_0x1071('0x3c')][_0x1071('0x45')](_0x2c2b65)['then'](handleEntityNotFound(_0xd96d1b,null))[_0x1071('0x21')](respondWithResult(_0xd96d1b,null))['catch'](handleError(_0xd96d1b,null));};exports[_0x1071('0x46')]=function(_0x417bf8,_0x418a0b){return db[_0x1071('0x3c')]['create'](_0x417bf8[_0x1071('0x47')],{})[_0x1071('0x21')](respondWithResult(_0x418a0b,0xc9))[_0x1071('0x41')](handleError(_0x418a0b,null));};exports[_0x1071('0x20')]=function(_0x39dfbe,_0x40af02){if(_0x39dfbe[_0x1071('0x47')]['id']){delete _0x39dfbe[_0x1071('0x47')]['id'];}return db[_0x1071('0x3c')][_0x1071('0x45')]({'where':{'id':_0x39dfbe[_0x1071('0x43')]['id']}})['then'](handleEntityNotFound(_0x40af02,null))['then'](saveUpdates(_0x39dfbe['body'],null))['then'](respondWithResult(_0x40af02,null))[_0x1071('0x41')](handleError(_0x40af02,null));};exports[_0x1071('0x22')]=function(_0x52f218,_0x27ab8e){return db['VoiceAgentReport']['find']({'where':{'id':_0x52f218[_0x1071('0x43')]['id']}})['then'](handleEntityNotFound(_0x27ab8e,null))[_0x1071('0x21')](removeEntity(_0x27ab8e,null))[_0x1071('0x41')](handleError(_0x27ab8e,null));};exports[_0x1071('0x48')]=function(_0xfb1b47,_0x2e47e5){return db[_0x1071('0x3c')]['describe']()['then'](respondWithResult(_0x2e47e5,null))['catch'](handleError(_0x2e47e5,null));}; \ No newline at end of file +var _0x2c54=['show','params','rawAttributes','length','options','find','create','catch','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','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','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','index','VoiceAgentReport','model','keys','query','intersection','attributes','fields','hasOwnProperty','limit','order','where','filters','filter','merge','type','key','VIRTUAL','count','includeAll','include','findAll','rows'];(function(_0x1cd1ef,_0x49a3bb){var _0x43b467=function(_0x4660ce){while(--_0x4660ce){_0x1cd1ef['push'](_0x1cd1ef['shift']());}};_0x43b467(++_0x49a3bb);}(_0x2c54,0x136));var _0x42c5=function(_0x6a7dea,_0x59ee84){_0x6a7dea=_0x6a7dea-0x0;var _0x249ec8=_0x2c54[_0x6a7dea];return _0x249ec8;};'use strict';var pdf=require(_0x42c5('0x0'));var emlformat=require(_0x42c5('0x1'));var rimraf=require(_0x42c5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42c5('0x3'));var rp=require(_0x42c5('0x4'));var moment=require(_0x42c5('0x5'));var BPromise=require(_0x42c5('0x6'));var Mustache=require(_0x42c5('0x7'));var util=require(_0x42c5('0x8'));var path=require('path');var sox=require(_0x42c5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x42c5('0xa'));var squel=require(_0x42c5('0xb'));var crypto=require(_0x42c5('0xc'));var jsforce=require(_0x42c5('0xd'));var deskjs=require(_0x42c5('0xe'));var toCsv=require(_0x42c5('0xf'));var querystring=require(_0x42c5('0x10'));var Papa=require(_0x42c5('0x11'));var authService=require(_0x42c5('0x12'));var hardwareService=require(_0x42c5('0x13'));var Redis=require(_0x42c5('0x14'));var qs=require(_0x42c5('0x15'));var logger=require(_0x42c5('0x16'))(_0x42c5('0x17'));var utils=require(_0x42c5('0x18'));var config=require(_0x42c5('0x19'));var db=require(_0x42c5('0x1a'))['db'];function respondWithStatusCode(_0x3a4e16,_0xb5c314){_0xb5c314=_0xb5c314||0xcc;return function(_0x43793e){if(_0x43793e){return _0x3a4e16[_0x42c5('0x1b')](_0xb5c314);}return _0x3a4e16[_0x42c5('0x1c')](_0xb5c314)['end']();};}function respondWithResult(_0x5d02a3,_0x1b1db5){_0x1b1db5=_0x1b1db5||0xc8;return function(_0xc17623){if(_0xc17623){return _0x5d02a3[_0x42c5('0x1c')](_0x1b1db5)[_0x42c5('0x1d')](_0xc17623);}};}function respondWithFilteredResult(_0x47affc,_0x374218){return function(_0x22d052){if(_0x22d052){var _0x5c9ac2=_0x22d052['count'],_0x4efb1a=_0x374218[_0x42c5('0x1e')],_0x323705=_0x374218['offset']+_0x374218['limit'],_0x4967b4;if(_0x323705>=_0x5c9ac2){_0x323705=_0x5c9ac2;_0x4967b4=0xc8;}else{_0x4967b4=0xce;}_0x47affc[_0x42c5('0x1c')](_0x4967b4);return _0x47affc[_0x42c5('0x1f')](_0x42c5('0x20'),_0x4efb1a+'-'+_0x323705+'/'+_0x5c9ac2)[_0x42c5('0x1d')](_0x22d052);}return null;};}function patchUpdates(_0x431f4e){return function(_0xac2a76){try{jsonpatch[_0x42c5('0x21')](_0xac2a76,_0x431f4e,!![]);}catch(_0x34f31b){return BPromise[_0x42c5('0x22')](_0x34f31b);}return _0xac2a76[_0x42c5('0x23')]();};}function saveUpdates(_0x156209,_0x51023){return function(_0x11c6e8){if(_0x11c6e8){return _0x11c6e8[_0x42c5('0x24')](_0x156209)['then'](function(_0x102294){return _0x102294;});}return null;};}function removeEntity(_0x233841,_0x401083){return function(_0x56fc64){if(_0x56fc64){return _0x56fc64[_0x42c5('0x25')]()[_0x42c5('0x26')](function(){_0x233841['status'](0xcc)[_0x42c5('0x27')]();});}};}function handleEntityNotFound(_0xd577c8,_0x2d8143){return function(_0x3166b5){if(!_0x3166b5){_0xd577c8[_0x42c5('0x1b')](0x194);}return _0x3166b5;};}function handleError(_0x4119bf,_0x5cca39){_0x5cca39=_0x5cca39||0x1f4;return function(_0x2d319d){logger['error'](_0x2d319d[_0x42c5('0x28')]);if(_0x2d319d[_0x42c5('0x29')]){delete _0x2d319d['name'];}_0x4119bf[_0x42c5('0x1c')](_0x5cca39)['send'](_0x2d319d);};}exports[_0x42c5('0x2a')]=function(_0x45e9bf,_0x1058dc){var _0x4096c0={},_0x2cb126={},_0x4431ff={'count':0x0,'rows':[]};var _0x4d852b=db[_0x42c5('0x2b')]['rawAttributes'];_0x2cb126[_0x42c5('0x2c')]=_[_0x42c5('0x2d')](_0x4d852b);_0x2cb126[_0x42c5('0x2e')]=_[_0x42c5('0x2d')](_0x45e9bf['query']);_0x2cb126['filters']=_[_0x42c5('0x2f')](_0x2cb126[_0x42c5('0x2c')],_0x2cb126['query']);_0x4096c0[_0x42c5('0x30')]=_['intersection'](_0x2cb126[_0x42c5('0x2c')],qs['fields'](_0x45e9bf[_0x42c5('0x2e')][_0x42c5('0x31')]));_0x4096c0[_0x42c5('0x30')]=_0x4096c0['attributes']['length']?_0x4096c0[_0x42c5('0x30')]:_0x2cb126[_0x42c5('0x2c')];if(!_0x45e9bf[_0x42c5('0x2e')][_0x42c5('0x32')]('nolimit')){_0x4096c0['limit']=qs[_0x42c5('0x33')](_0x45e9bf[_0x42c5('0x2e')][_0x42c5('0x33')]);_0x4096c0[_0x42c5('0x1e')]=qs[_0x42c5('0x1e')](_0x45e9bf['query'][_0x42c5('0x1e')]);}_0x4096c0[_0x42c5('0x34')]=qs['sort'](_0x45e9bf[_0x42c5('0x2e')]['sort']);_0x4096c0[_0x42c5('0x35')]=qs[_0x42c5('0x36')](_['pick'](_0x45e9bf['query'],_0x2cb126['filters']));if(_0x45e9bf['query'][_0x42c5('0x37')]){_0x4096c0[_0x42c5('0x35')]=_[_0x42c5('0x38')](_0x4096c0[_0x42c5('0x35')],{'$or':_['map'](_0x4d852b,function(_0xc12705){if(_0xc12705[_0x42c5('0x39')][_0x42c5('0x3a')]!==_0x42c5('0x3b')){var _0x481202={};_0x481202[_0xc12705['field']]={'$like':'%'+_0x45e9bf[_0x42c5('0x2e')]['filter']+'%'};return _0x481202;}})});}_0x4096c0=_['merge']({},_0x4096c0,_0x45e9bf['options']);var _0x189d0d={'where':_0x4096c0[_0x42c5('0x35')]};return db[_0x42c5('0x2b')][_0x42c5('0x3c')](_0x189d0d)[_0x42c5('0x26')](function(_0x19c854){_0x4431ff[_0x42c5('0x3c')]=_0x19c854;if(_0x45e9bf[_0x42c5('0x2e')][_0x42c5('0x3d')]){_0x4096c0[_0x42c5('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x42c5('0x3f')](_0x4096c0);})[_0x42c5('0x26')](function(_0x6b53ee){_0x4431ff[_0x42c5('0x40')]=_0x6b53ee;return _0x4431ff;})[_0x42c5('0x26')](respondWithFilteredResult(_0x1058dc,_0x4096c0))['catch'](handleError(_0x1058dc,null));};exports[_0x42c5('0x41')]=function(_0x52a853,_0x9692f1){var _0x3b4d4c={'raw':![],'where':{'id':_0x52a853[_0x42c5('0x42')]['id']}},_0x116cbf={};_0x116cbf[_0x42c5('0x2c')]=_[_0x42c5('0x2d')](db[_0x42c5('0x2b')][_0x42c5('0x43')]);_0x116cbf[_0x42c5('0x2e')]=_[_0x42c5('0x2d')](_0x52a853[_0x42c5('0x2e')]);_0x116cbf[_0x42c5('0x36')]=_[_0x42c5('0x2f')](_0x116cbf[_0x42c5('0x2c')],_0x116cbf[_0x42c5('0x2e')]);_0x3b4d4c[_0x42c5('0x30')]=_[_0x42c5('0x2f')](_0x116cbf[_0x42c5('0x2c')],qs[_0x42c5('0x31')](_0x52a853[_0x42c5('0x2e')][_0x42c5('0x31')]));_0x3b4d4c['attributes']=_0x3b4d4c[_0x42c5('0x30')][_0x42c5('0x44')]?_0x3b4d4c['attributes']:_0x116cbf[_0x42c5('0x2c')];if(_0x52a853[_0x42c5('0x2e')]['includeAll']){_0x3b4d4c[_0x42c5('0x3e')]=[{'all':!![]}];}_0x3b4d4c=_[_0x42c5('0x38')]({},_0x3b4d4c,_0x52a853[_0x42c5('0x45')]);return db[_0x42c5('0x2b')][_0x42c5('0x46')](_0x3b4d4c)[_0x42c5('0x26')](handleEntityNotFound(_0x9692f1,null))[_0x42c5('0x26')](respondWithResult(_0x9692f1,null))['catch'](handleError(_0x9692f1,null));};exports['create']=function(_0x45c6ed,_0x91085){return db[_0x42c5('0x2b')][_0x42c5('0x47')](_0x45c6ed['body'],{})['then'](respondWithResult(_0x91085,0xc9))[_0x42c5('0x48')](handleError(_0x91085,null));};exports[_0x42c5('0x24')]=function(_0x4539a3,_0x39f9cf){if(_0x4539a3[_0x42c5('0x49')]['id']){delete _0x4539a3['body']['id'];}return db[_0x42c5('0x2b')][_0x42c5('0x46')]({'where':{'id':_0x4539a3[_0x42c5('0x42')]['id']}})[_0x42c5('0x26')](handleEntityNotFound(_0x39f9cf,null))['then'](saveUpdates(_0x4539a3[_0x42c5('0x49')],null))[_0x42c5('0x26')](respondWithResult(_0x39f9cf,null))[_0x42c5('0x48')](handleError(_0x39f9cf,null));};exports[_0x42c5('0x25')]=function(_0x20cac2,_0x11f594){return db[_0x42c5('0x2b')][_0x42c5('0x46')]({'where':{'id':_0x20cac2[_0x42c5('0x42')]['id']}})[_0x42c5('0x26')](handleEntityNotFound(_0x11f594,null))['then'](removeEntity(_0x11f594,null))[_0x42c5('0x48')](handleError(_0x11f594,null));};exports[_0x42c5('0x4a')]=function(_0x175323,_0x5176d7){return db[_0x42c5('0x2b')][_0x42c5('0x4a')]()['then'](respondWithResult(_0x5176d7,null))[_0x42c5('0x48')](handleError(_0x5176d7,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 4d4a01e..1b4b3c7 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 _0xf93d=['../../config/logger','api','moment','bluebird','request-promise','exports','define','VoiceAgentReport','lodash','util'];(function(_0x415a8a,_0x22cd25){var _0x2c9351=function(_0x2b8812){while(--_0x2b8812){_0x415a8a['push'](_0x415a8a['shift']());}};_0x2c9351(++_0x22cd25);}(_0xf93d,0x1ca));var _0xdf93=function(_0x32392d,_0x15c525){_0x32392d=_0x32392d-0x0;var _0x5f3472=_0xf93d[_0x32392d];return _0x5f3472;};'use strict';var _=require(_0xdf93('0x0'));var util=require(_0xdf93('0x1'));var logger=require(_0xdf93('0x2'))(_0xdf93('0x3'));var moment=require(_0xdf93('0x4'));var BPromise=require(_0xdf93('0x5'));var rp=require(_0xdf93('0x6'));var attributes=require('./voiceAgentReport.attributes');module[_0xdf93('0x7')]=function(_0x4f306c,_0x50dfb4){return _0x4f306c[_0xdf93('0x8')](_0xdf93('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8348=['uniqueid','bluebird','request-promise','./voiceAgentReport.attributes','define','VoiceAgentReport'];(function(_0x378386,_0x5caab9){var _0x40dffb=function(_0x2b2e54){while(--_0x2b2e54){_0x378386['push'](_0x378386['shift']());}};_0x40dffb(++_0x5caab9);}(_0x8348,0xd3));var _0x8834=function(_0x5e8141,_0x12f928){_0x5e8141=_0x5e8141-0x0;var _0x277ef1=_0x8348[_0x5e8141];return _0x277ef1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8834('0x0'));var rp=require(_0x8834('0x1'));var attributes=require(_0x8834('0x2'));module['exports']=function(_0x17ba53,_0x287269){return _0x17ba53[_0x8834('0x3')](_0x8834('0x4'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x8834('0x5'),'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 6b60dbc..8c855c2 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 _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(_0x4a4d88,_0x2be95a){var _0x479329=function(_0x37bb8e){while(--_0x37bb8e){_0x4a4d88['push'](_0x4a4d88['shift']());}};_0x479329(++_0x2be95a);}(_0x814b,0x1a2));var _0xb814=function(_0x47d7ec,_0x17f197){_0x47d7ec=_0x47d7ec-0x0;var _0x98674a=_0x814b[_0x47d7ec];return _0x98674a;};'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 +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(_0xf35ae7,_0x419928){var _0x4f9e45=function(_0x54f644){while(--_0x54f644){_0xf35ae7['push'](_0xf35ae7['shift']());}};_0x4f9e45(++_0x419928);}(_0x7a54,0x106));var _0x47a5=function(_0x59afc1,_0x530e07){_0x59afc1=_0x59afc1-0x0;var _0x5e77d6=_0x7a54[_0x59afc1];return _0x5e77d6;};'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 diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 646e461..e8bb713 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 _0x39fd=['../../config/environment','./voiceCallReport.controller','get','isAuthenticated','/describe','/:id','show','put','delete','destroy','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5e3dfc,_0x2d45bc){var _0x229ff8=function(_0x2518ae){while(--_0x2518ae){_0x5e3dfc['push'](_0x5e3dfc['shift']());}};_0x229ff8(++_0x2d45bc);}(_0x39fd,0xdc));var _0xd39f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x39fd[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd39f('0x0'));var timeout=require('connect-timeout');var express=require(_0xd39f('0x1'));var router=express['Router']();var auth=require(_0xd39f('0x2'));var interaction=require(_0xd39f('0x3'));var config=require(_0xd39f('0x4'));var controller=require(_0xd39f('0x5'));router[_0xd39f('0x6')]('/',auth[_0xd39f('0x7')](),controller['index']);router[_0xd39f('0x6')](_0xd39f('0x8'),auth[_0xd39f('0x7')](),controller['describe']);router[_0xd39f('0x6')](_0xd39f('0x9'),auth[_0xd39f('0x7')](),controller[_0xd39f('0xa')]);router['post']('/',auth[_0xd39f('0x7')](),controller['create']);router[_0xd39f('0xb')]('/:id',auth[_0xd39f('0x7')](),controller['update']);router[_0xd39f('0xc')](_0xd39f('0x9'),auth[_0xd39f('0x7')](),controller[_0xd39f('0xd')]);module['exports']=router; \ No newline at end of file +var _0x70ac=['Router','../../config/environment','get','/describe','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x70ac,0x1a5));var _0xc70a=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x70ac[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0xc70a('0x0'));var util=require(_0xc70a('0x1'));var path=require(_0xc70a('0x2'));var timeout=require('connect-timeout');var express=require(_0xc70a('0x3'));var router=express[_0xc70a('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc70a('0x5'));var controller=require('./voiceCallReport.controller');router[_0xc70a('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc70a('0x6')](_0xc70a('0x7'),auth[_0xc70a('0x8')](),controller['describe']);router[_0xc70a('0x6')](_0xc70a('0x9'),auth[_0xc70a('0x8')](),controller['show']);router[_0xc70a('0xa')]('/',auth[_0xc70a('0x8')](),controller[_0xc70a('0xb')]);router[_0xc70a('0xc')](_0xc70a('0x9'),auth[_0xc70a('0x8')](),controller[_0xc70a('0xd')]);router[_0xc70a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xc70a('0xf')]);module[_0xc70a('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index a8cb91c..7609393 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 _0x5c30=['TEXT','DATE','INTEGER','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax'];(function(_0x4968c8,_0x4f6c91){var _0x473071=function(_0x172da6){while(--_0x172da6){_0x4968c8['push'](_0x4968c8['shift']());}};_0x473071(++_0x4f6c91);}(_0x5c30,0x93));var _0x05c3=function(_0x2d19a3,_0x5db164){_0x2d19a3=_0x2d19a3-0x0;var _0x4ac8a8=_0x5c30[_0x2d19a3];return _0x4ac8a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x05c3('0x0')]},'type':{'type':Sequelize[_0x05c3('0x1')](_0x05c3('0x2'),_0x05c3('0x3'),'outbound',_0x05c3('0x4'),_0x05c3('0x5'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x05c3('0x0')]},'destinationcontext':{'type':Sequelize[_0x05c3('0x0')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x05c3('0x0')]},'destinationchannel':{'type':Sequelize[_0x05c3('0x0')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x05c3('0x6')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x05c3('0x7')]},'endtime':{'type':Sequelize[_0x05c3('0x7')]},'duration':{'type':Sequelize[_0x05c3('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x05c3('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x05c3('0x0')]},'amaflags':{'type':Sequelize[_0x05c3('0x0')]},'userfield':{'type':Sequelize[_0x05c3('0x0')]},'userDisposition':{'type':Sequelize[_0x05c3('0x0')]},'note':{'type':Sequelize[_0x05c3('0x0')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x05c3('0x8')]}}; \ No newline at end of file +var _0x3ea2=['inbound','outbound','outbound-fax','dialer','DATE','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x1b165e,_0x26b02b){var _0x2d6dde=function(_0x539c22){while(--_0x539c22){_0x1b165e['push'](_0x1b165e['shift']());}};_0x2d6dde(++_0x26b02b);}(_0x3ea2,0x16e));var _0x23ea=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0x3ea2[_0x163040];return _0x364667;};'use strict';var Sequelize=require(_0x23ea('0x0'));module[_0x23ea('0x1')]={'uniqueid':{'type':Sequelize[_0x23ea('0x2')]},'type':{'type':Sequelize[_0x23ea('0x3')](_0x23ea('0x4'),'internal',_0x23ea('0x5'),'inbound-fax',_0x23ea('0x6'),_0x23ea('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x23ea('0x2')]},'source':{'type':Sequelize[_0x23ea('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x23ea('0x2')]},'channel':{'type':Sequelize[_0x23ea('0x2')]},'destinationchannel':{'type':Sequelize[_0x23ea('0x2')]},'lastapplication':{'type':Sequelize[_0x23ea('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x23ea('0x8')]},'answertime':{'type':Sequelize[_0x23ea('0x8')]},'endtime':{'type':Sequelize[_0x23ea('0x8')]},'duration':{'type':Sequelize[_0x23ea('0x9')]},'billableseconds':{'type':Sequelize[_0x23ea('0x9')]},'mohtime':{'type':Sequelize[_0x23ea('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x23ea('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x23ea('0x2')]},'userDisposition':{'type':Sequelize[_0x23ea('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x23ea('0x2')]},'routeid':{'type':Sequelize[_0x23ea('0x9')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index ebec874..6000102 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 _0x6493=['hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','field','merge','options','include','fullname','alias','User','findAll','rows','catch','params','includeAll','find','create','body','destroy','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','error','name','send','VoiceCallReport','rawAttributes','model','keys','query','intersection','fields','attributes','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6493,0x64));var _0x3649=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x6493[_0x6a0266];return _0x309e00;};'use strict';var pdf=require(_0x3649('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3649('0x1'));var zipdir=require(_0x3649('0x2'));var jsonpatch=require(_0x3649('0x3'));var rp=require('request-promise');var moment=require(_0x3649('0x4'));var BPromise=require(_0x3649('0x5'));var Mustache=require(_0x3649('0x6'));var util=require(_0x3649('0x7'));var path=require(_0x3649('0x8'));var sox=require('sox');var csv=require(_0x3649('0x9'));var ejs=require(_0x3649('0xa'));var fs=require('fs');var _=require(_0x3649('0xb'));var squel=require('squel');var crypto=require(_0x3649('0xc'));var jsforce=require(_0x3649('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3649('0xe'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x3649('0xf'));var Redis=require(_0x3649('0x10'));var qs=require(_0x3649('0x11'));var logger=require(_0x3649('0x12'))(_0x3649('0x13'));var utils=require(_0x3649('0x14'));var config=require(_0x3649('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f6317,_0x4421cf){_0x4421cf=_0x4421cf||0xcc;return function(_0x3642eb){if(_0x3642eb){return _0x1f6317[_0x3649('0x16')](_0x4421cf);}return _0x1f6317[_0x3649('0x17')](_0x4421cf)[_0x3649('0x18')]();};}function respondWithResult(_0x3f4933,_0x3bba30){_0x3bba30=_0x3bba30||0xc8;return function(_0x144767){if(_0x144767){return _0x3f4933['status'](_0x3bba30)[_0x3649('0x19')](_0x144767);}};}function respondWithFilteredResult(_0x4e80a9,_0x4fbca9){return function(_0x635253){if(_0x635253){var _0x524ba7=_0x635253[_0x3649('0x1a')],_0x20e5bf=_0x4fbca9[_0x3649('0x1b')],_0x1e7eec=_0x4fbca9['offset']+_0x4fbca9[_0x3649('0x1c')],_0x5c3c78;if(_0x1e7eec>=_0x524ba7){_0x1e7eec=_0x524ba7;_0x5c3c78=0xc8;}else{_0x5c3c78=0xce;}_0x4e80a9[_0x3649('0x17')](_0x5c3c78);return _0x4e80a9[_0x3649('0x1d')](_0x3649('0x1e'),_0x20e5bf+'-'+_0x1e7eec+'/'+_0x524ba7)[_0x3649('0x19')](_0x635253);}return null;};}function patchUpdates(_0x36d970){return function(_0x4d83c4){try{jsonpatch['apply'](_0x4d83c4,_0x36d970,!![]);}catch(_0x348391){return BPromise['reject'](_0x348391);}return _0x4d83c4[_0x3649('0x1f')]();};}function saveUpdates(_0x2c345c,_0x243d5a){return function(_0x28db70){if(_0x28db70){return _0x28db70[_0x3649('0x20')](_0x2c345c)[_0x3649('0x21')](function(_0x46f7b0){return _0x46f7b0;});}return null;};}function removeEntity(_0x3c0b66,_0x3c95e3){return function(_0x4fc86c){if(_0x4fc86c){return _0x4fc86c['destroy']()[_0x3649('0x21')](function(){_0x3c0b66[_0x3649('0x17')](0xcc)[_0x3649('0x18')]();});}};}function handleEntityNotFound(_0x3446f4,_0x1779d4){return function(_0x489f09){if(!_0x489f09){_0x3446f4['sendStatus'](0x194);}return _0x489f09;};}function handleError(_0x246c0a,_0xbda245){_0xbda245=_0xbda245||0x1f4;return function(_0x4ca5c2){logger[_0x3649('0x22')](_0x4ca5c2['stack']);if(_0x4ca5c2[_0x3649('0x23')]){delete _0x4ca5c2[_0x3649('0x23')];}_0x246c0a[_0x3649('0x17')](_0xbda245)[_0x3649('0x24')](_0x4ca5c2);};}exports['index']=function(_0x35c10a,_0x4c245d){var _0x1ed55a={},_0x795c1e={},_0x287d98={'count':0x0,'rows':[]};var _0x13367e=db[_0x3649('0x25')][_0x3649('0x26')];_0x795c1e[_0x3649('0x27')]=_[_0x3649('0x28')](_0x13367e);_0x795c1e[_0x3649('0x29')]=_[_0x3649('0x28')](_0x35c10a[_0x3649('0x29')]);_0x795c1e['filters']=_[_0x3649('0x2a')](_0x795c1e[_0x3649('0x27')],_0x795c1e[_0x3649('0x29')]);_0x1ed55a['attributes']=_[_0x3649('0x2a')](_0x795c1e['model'],qs[_0x3649('0x2b')](_0x35c10a[_0x3649('0x29')][_0x3649('0x2b')]));_0x1ed55a[_0x3649('0x2c')]=_0x1ed55a[_0x3649('0x2c')][_0x3649('0x2d')]?_0x1ed55a['attributes']:_0x795c1e[_0x3649('0x27')];if(!_0x35c10a['query'][_0x3649('0x2e')](_0x3649('0x2f'))){_0x1ed55a[_0x3649('0x1c')]=qs[_0x3649('0x1c')](_0x35c10a[_0x3649('0x29')][_0x3649('0x1c')]);_0x1ed55a[_0x3649('0x1b')]=qs['offset'](_0x35c10a[_0x3649('0x29')][_0x3649('0x1b')]);}_0x1ed55a[_0x3649('0x30')]=qs[_0x3649('0x31')](_0x35c10a[_0x3649('0x29')][_0x3649('0x31')]);_0x1ed55a[_0x3649('0x32')]=qs[_0x3649('0x33')](_[_0x3649('0x34')](_0x35c10a[_0x3649('0x29')],_0x795c1e[_0x3649('0x33')]));if(_0x35c10a[_0x3649('0x29')][_0x3649('0x35')]){_0x1ed55a[_0x3649('0x32')]=_['merge'](_0x1ed55a[_0x3649('0x32')],{'$or':_[_0x3649('0x36')](_0x13367e,function(_0x5f0830){if(_0x5f0830[_0x3649('0x37')]['key']!=='VIRTUAL'){var _0x2f424f={};_0x2f424f[_0x5f0830[_0x3649('0x38')]]={'$like':'%'+_0x35c10a[_0x3649('0x29')][_0x3649('0x35')]+'%'};return _0x2f424f;}})});}_0x1ed55a=_[_0x3649('0x39')]({},_0x1ed55a,_0x35c10a[_0x3649('0x3a')]);var _0x30d373={'where':_0x1ed55a['where']};return db[_0x3649('0x25')][_0x3649('0x1a')](_0x30d373)['then'](function(_0x7676d3){_0x287d98[_0x3649('0x1a')]=_0x7676d3;if(_0x35c10a[_0x3649('0x29')]['includeAll']){_0x1ed55a[_0x3649('0x3b')]=[{'attributes':['id',_0x3649('0x23'),_0x3649('0x3c'),_0x3649('0x3d')],'model':db['User'],'as':_0x3649('0x3e')}];}return db[_0x3649('0x25')][_0x3649('0x3f')](_0x1ed55a);})[_0x3649('0x21')](function(_0x1cae8f){_0x287d98[_0x3649('0x40')]=_0x1cae8f;return _0x287d98;})[_0x3649('0x21')](respondWithFilteredResult(_0x4c245d,_0x1ed55a))[_0x3649('0x41')](handleError(_0x4c245d,null));};exports['show']=function(_0x1aabd2,_0x168729){var _0xa1d574={'raw':!![],'where':{'id':_0x1aabd2[_0x3649('0x42')]['id']}},_0x307c61={};_0x307c61[_0x3649('0x27')]=_['keys'](db['VoiceCallReport'][_0x3649('0x26')]);_0x307c61[_0x3649('0x29')]=_[_0x3649('0x28')](_0x1aabd2['query']);_0x307c61[_0x3649('0x33')]=_[_0x3649('0x2a')](_0x307c61[_0x3649('0x27')],_0x307c61[_0x3649('0x29')]);_0xa1d574[_0x3649('0x2c')]=_['intersection'](_0x307c61[_0x3649('0x27')],qs[_0x3649('0x2b')](_0x1aabd2[_0x3649('0x29')][_0x3649('0x2b')]));_0xa1d574[_0x3649('0x2c')]=_0xa1d574[_0x3649('0x2c')][_0x3649('0x2d')]?_0xa1d574[_0x3649('0x2c')]:_0x307c61[_0x3649('0x27')];if(_0x1aabd2[_0x3649('0x29')][_0x3649('0x43')]){_0xa1d574['include']=[{'all':!![]}];}_0xa1d574=_['merge']({},_0xa1d574,_0x1aabd2['options']);return db['VoiceCallReport'][_0x3649('0x44')](_0xa1d574)[_0x3649('0x21')](handleEntityNotFound(_0x168729,null))[_0x3649('0x21')](respondWithResult(_0x168729,null))['catch'](handleError(_0x168729,null));};exports[_0x3649('0x45')]=function(_0x2ac88b,_0x545d6e){return db[_0x3649('0x25')][_0x3649('0x45')](_0x2ac88b[_0x3649('0x46')],{})['then'](respondWithResult(_0x545d6e,0xc9))[_0x3649('0x41')](handleError(_0x545d6e,null));};exports[_0x3649('0x47')]=function(_0x515054,_0x1f1ccb){return db['VoiceCallReport'][_0x3649('0x44')]({'where':{'id':_0x515054[_0x3649('0x42')]['id']}})['then'](handleEntityNotFound(_0x1f1ccb,null))[_0x3649('0x21')](removeEntity(_0x1f1ccb,null))[_0x3649('0x41')](handleError(_0x1f1ccb,null));};exports[_0x3649('0x48')]=function(_0x43c95e,_0x15de90){return db[_0x3649('0x25')][_0x3649('0x48')]()[_0x3649('0x21')](respondWithResult(_0x15de90,null))[_0x3649('0x41')](handleError(_0x15de90,null));};exports['update']=function(_0x21d01d,_0x3a2c15){if(_0x21d01d['body']['uniqueid']){delete _0x21d01d[_0x3649('0x46')]['uniqueid'];}return db[_0x3649('0x25')]['find']({'where':{'uniqueid':_0x21d01d[_0x3649('0x42')]['id'],'UserId':{'$or':[null,_0x21d01d['user']['id']]}}})['then'](handleEntityNotFound(_0x3a2c15,null))['then'](saveUpdates(_0x21d01d[_0x3649('0x46')],null))[_0x3649('0x21')](respondWithResult(_0x3a2c15,null))['catch'](handleError(_0x3a2c15,null));}; \ No newline at end of file +var _0x143b=['json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','VoiceCallReport','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','map','key','VIRTUAL','field','merge','where','includeAll','include','fullname','User','findAll','catch','params','length','options','find','body','describe','uniqueid','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','ioredis','../../config/utils','sendStatus','status','end'];(function(_0x20df6,_0x4018b9){var _0x2e1133=function(_0x4e2b7d){while(--_0x4e2b7d){_0x20df6['push'](_0x20df6['shift']());}};_0x2e1133(++_0x4018b9);}(_0x143b,0x77));var _0xb143=function(_0xba4a60,_0x1961cf){_0xba4a60=_0xba4a60-0x0;var _0x227640=_0x143b[_0xba4a60];return _0x227640;};'use strict';var pdf=require(_0xb143('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb143('0x1'));var zipdir=require(_0xb143('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb143('0x3'));var moment=require('moment');var BPromise=require(_0xb143('0x4'));var Mustache=require(_0xb143('0x5'));var util=require('util');var path=require(_0xb143('0x6'));var sox=require(_0xb143('0x7'));var csv=require(_0xb143('0x8'));var ejs=require(_0xb143('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb143('0xa'));var crypto=require(_0xb143('0xb'));var jsforce=require(_0xb143('0xc'));var deskjs=require(_0xb143('0xd'));var toCsv=require(_0xb143('0x8'));var querystring=require(_0xb143('0xe'));var Papa=require('papaparse');var authService=require(_0xb143('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xb143('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0xb143('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a08ef,_0x30c48f){_0x30c48f=_0x30c48f||0xcc;return function(_0x14fcd3){if(_0x14fcd3){return _0x5a08ef[_0xb143('0x12')](_0x30c48f);}return _0x5a08ef[_0xb143('0x13')](_0x30c48f)[_0xb143('0x14')]();};}function respondWithResult(_0x233a95,_0x48335b){_0x48335b=_0x48335b||0xc8;return function(_0x19080f){if(_0x19080f){return _0x233a95[_0xb143('0x13')](_0x48335b)[_0xb143('0x15')](_0x19080f);}};}function respondWithFilteredResult(_0x3b207a,_0x521685){return function(_0x45f175){if(_0x45f175){var _0x324dba=_0x45f175[_0xb143('0x16')],_0x2d8a27=_0x521685[_0xb143('0x17')],_0x5d17e2=_0x521685[_0xb143('0x17')]+_0x521685[_0xb143('0x18')],_0x39d16d;if(_0x5d17e2>=_0x324dba){_0x5d17e2=_0x324dba;_0x39d16d=0xc8;}else{_0x39d16d=0xce;}_0x3b207a[_0xb143('0x13')](_0x39d16d);return _0x3b207a[_0xb143('0x19')](_0xb143('0x1a'),_0x2d8a27+'-'+_0x5d17e2+'/'+_0x324dba)[_0xb143('0x15')](_0x45f175);}return null;};}function patchUpdates(_0x238c01){return function(_0x49df02){try{jsonpatch[_0xb143('0x1b')](_0x49df02,_0x238c01,!![]);}catch(_0x185dcb){return BPromise[_0xb143('0x1c')](_0x185dcb);}return _0x49df02[_0xb143('0x1d')]();};}function saveUpdates(_0x4e4dbf,_0x576645){return function(_0x3bd96c){if(_0x3bd96c){return _0x3bd96c['update'](_0x4e4dbf)[_0xb143('0x1e')](function(_0xa7bc35){return _0xa7bc35;});}return null;};}function removeEntity(_0x1d0435,_0x15cfc4){return function(_0x427337){if(_0x427337){return _0x427337[_0xb143('0x1f')]()[_0xb143('0x1e')](function(){_0x1d0435[_0xb143('0x13')](0xcc)[_0xb143('0x14')]();});}};}function handleEntityNotFound(_0x41a1cf,_0x2bd963){return function(_0x6494cb){if(!_0x6494cb){_0x41a1cf[_0xb143('0x12')](0x194);}return _0x6494cb;};}function handleError(_0x3014cf,_0x48bde1){_0x48bde1=_0x48bde1||0x1f4;return function(_0x1a064e){logger[_0xb143('0x20')](_0x1a064e[_0xb143('0x21')]);if(_0x1a064e[_0xb143('0x22')]){delete _0x1a064e[_0xb143('0x22')];}_0x3014cf[_0xb143('0x13')](_0x48bde1)[_0xb143('0x23')](_0x1a064e);};}exports[_0xb143('0x24')]=function(_0x4fe287,_0x2bcc8b){var _0x59aea2={},_0x27914d={},_0x35891a={'count':0x0,'rows':[]};var _0xfb9994=db[_0xb143('0x25')][_0xb143('0x26')];_0x27914d[_0xb143('0x27')]=_[_0xb143('0x28')](_0xfb9994);_0x27914d[_0xb143('0x29')]=_[_0xb143('0x28')](_0x4fe287['query']);_0x27914d['filters']=_[_0xb143('0x2a')](_0x27914d[_0xb143('0x27')],_0x27914d['query']);_0x59aea2[_0xb143('0x2b')]=_['intersection'](_0x27914d[_0xb143('0x27')],qs[_0xb143('0x2c')](_0x4fe287[_0xb143('0x29')]['fields']));_0x59aea2[_0xb143('0x2b')]=_0x59aea2[_0xb143('0x2b')]['length']?_0x59aea2[_0xb143('0x2b')]:_0x27914d['model'];if(!_0x4fe287['query'][_0xb143('0x2d')](_0xb143('0x2e'))){_0x59aea2[_0xb143('0x18')]=qs[_0xb143('0x18')](_0x4fe287[_0xb143('0x29')][_0xb143('0x18')]);_0x59aea2[_0xb143('0x17')]=qs['offset'](_0x4fe287[_0xb143('0x29')]['offset']);}_0x59aea2[_0xb143('0x2f')]=qs[_0xb143('0x30')](_0x4fe287[_0xb143('0x29')][_0xb143('0x30')]);_0x59aea2['where']=qs[_0xb143('0x31')](_['pick'](_0x4fe287[_0xb143('0x29')],_0x27914d[_0xb143('0x31')]));if(_0x4fe287[_0xb143('0x29')][_0xb143('0x32')]){_0x59aea2['where']=_['merge'](_0x59aea2['where'],{'$or':_[_0xb143('0x33')](_0xfb9994,function(_0x21eb5c){if(_0x21eb5c['type'][_0xb143('0x34')]!==_0xb143('0x35')){var _0x13b1e2={};_0x13b1e2[_0x21eb5c[_0xb143('0x36')]]={'$like':'%'+_0x4fe287[_0xb143('0x29')]['filter']+'%'};return _0x13b1e2;}})});}_0x59aea2=_[_0xb143('0x37')]({},_0x59aea2,_0x4fe287['options']);var _0x3dffc8={'where':_0x59aea2[_0xb143('0x38')]};return db['VoiceCallReport']['count'](_0x3dffc8)[_0xb143('0x1e')](function(_0x133b02){_0x35891a[_0xb143('0x16')]=_0x133b02;if(_0x4fe287[_0xb143('0x29')][_0xb143('0x39')]){_0x59aea2[_0xb143('0x3a')]=[{'attributes':['id',_0xb143('0x22'),_0xb143('0x3b'),'alias'],'model':db[_0xb143('0x3c')],'as':_0xb143('0x3c')}];}return db[_0xb143('0x25')][_0xb143('0x3d')](_0x59aea2);})[_0xb143('0x1e')](function(_0x4332a1){_0x35891a['rows']=_0x4332a1;return _0x35891a;})[_0xb143('0x1e')](respondWithFilteredResult(_0x2bcc8b,_0x59aea2))[_0xb143('0x3e')](handleError(_0x2bcc8b,null));};exports['show']=function(_0x3c016c,_0x5deacb){var _0x5b1314={'raw':!![],'where':{'id':_0x3c016c[_0xb143('0x3f')]['id']}},_0x59e00e={};_0x59e00e['model']=_[_0xb143('0x28')](db[_0xb143('0x25')][_0xb143('0x26')]);_0x59e00e['query']=_[_0xb143('0x28')](_0x3c016c[_0xb143('0x29')]);_0x59e00e[_0xb143('0x31')]=_[_0xb143('0x2a')](_0x59e00e[_0xb143('0x27')],_0x59e00e[_0xb143('0x29')]);_0x5b1314['attributes']=_[_0xb143('0x2a')](_0x59e00e[_0xb143('0x27')],qs['fields'](_0x3c016c['query'][_0xb143('0x2c')]));_0x5b1314[_0xb143('0x2b')]=_0x5b1314['attributes'][_0xb143('0x40')]?_0x5b1314[_0xb143('0x2b')]:_0x59e00e[_0xb143('0x27')];if(_0x3c016c['query'][_0xb143('0x39')]){_0x5b1314['include']=[{'all':!![]}];}_0x5b1314=_[_0xb143('0x37')]({},_0x5b1314,_0x3c016c[_0xb143('0x41')]);return db[_0xb143('0x25')][_0xb143('0x42')](_0x5b1314)[_0xb143('0x1e')](handleEntityNotFound(_0x5deacb,null))[_0xb143('0x1e')](respondWithResult(_0x5deacb,null))[_0xb143('0x3e')](handleError(_0x5deacb,null));};exports['create']=function(_0x3ad6af,_0x2a0476){return db['VoiceCallReport']['create'](_0x3ad6af[_0xb143('0x43')],{})[_0xb143('0x1e')](respondWithResult(_0x2a0476,0xc9))[_0xb143('0x3e')](handleError(_0x2a0476,null));};exports[_0xb143('0x1f')]=function(_0x2a3fe5,_0x576a02){return db[_0xb143('0x25')]['find']({'where':{'id':_0x2a3fe5['params']['id']}})[_0xb143('0x1e')](handleEntityNotFound(_0x576a02,null))[_0xb143('0x1e')](removeEntity(_0x576a02,null))[_0xb143('0x3e')](handleError(_0x576a02,null));};exports['describe']=function(_0x4ea910,_0x35aea5){return db[_0xb143('0x25')][_0xb143('0x44')]()[_0xb143('0x1e')](respondWithResult(_0x35aea5,null))['catch'](handleError(_0x35aea5,null));};exports['update']=function(_0x506484,_0x298b92){if(_0x506484[_0xb143('0x43')][_0xb143('0x45')]){delete _0x506484[_0xb143('0x43')][_0xb143('0x45')];}return db[_0xb143('0x25')][_0xb143('0x42')]({'where':{'uniqueid':_0x506484[_0xb143('0x3f')]['id'],'UserId':{'$or':[null,_0x506484['user']['id']]}}})[_0xb143('0x1e')](handleEntityNotFound(_0x298b92,null))[_0xb143('0x1e')](saveUpdates(_0x506484[_0xb143('0x43')],null))[_0xb143('0x1e')](respondWithResult(_0x298b92,null))[_0xb143('0x3e')](handleError(_0x298b92,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 451a081..0e8db07 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 _0x430a=['VoiceCallReport','uniqueid','lodash','../../config/logger','moment','exports'];(function(_0x375894,_0x4c9c3b){var _0x4df24d=function(_0x19a525){while(--_0x19a525){_0x375894['push'](_0x375894['shift']());}};_0x4df24d(++_0x4c9c3b);}(_0x430a,0xfe));var _0xa430=function(_0x272dff,_0x5cf78f){_0x272dff=_0x272dff-0x0;var _0x3ddb18=_0x430a[_0x272dff];return _0x3ddb18;};'use strict';var _=require(_0xa430('0x0'));var util=require('util');var logger=require(_0xa430('0x1'))('api');var moment=require(_0xa430('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./voiceCallReport.attributes');module[_0xa430('0x3')]=function(_0x41e9b5,_0x29a685){return _0x41e9b5['define'](_0xa430('0x4'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xa430('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4a8=['uniqueid','util','../../config/logger','api','request-promise','./voiceCallReport.attributes','exports','define','VoiceCallReport'];(function(_0x19e0ec,_0x3afd18){var _0x4ebc69=function(_0x2b3bc5){while(--_0x2b3bc5){_0x19e0ec['push'](_0x19e0ec['shift']());}};_0x4ebc69(++_0x3afd18);}(_0xc4a8,0x160));var _0x8c4a=function(_0x4a9df3,_0x243a32){_0x4a9df3=_0x4a9df3-0x0;var _0x3a06d0=_0xc4a8[_0x4a9df3];return _0x3a06d0;};'use strict';var _=require('lodash');var util=require(_0x8c4a('0x0'));var logger=require(_0x8c4a('0x1'))(_0x8c4a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8c4a('0x3'));var attributes=require(_0x8c4a('0x4'));module[_0x8c4a('0x5')]=function(_0x1a26aa,_0x3397c0){return _0x1a26aa[_0x8c4a('0x6')](_0x8c4a('0x7'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x8c4a('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 6a1f9d4..9d1d48b 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 _0x80b2=['rpc','../../config/environment','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','findAll','options','raw','where','attributes','include','map','model','GetVoiceCallReport','debug','stringify','CreateVoiceCallReport','VoiceCallReport','create','body','update','UpdateVoiceCallReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5517c0,_0x358609){var _0x33803b=function(_0x513c18){while(--_0x513c18){_0x5517c0['push'](_0x5517c0['shift']());}};_0x33803b(++_0x358609);}(_0x80b2,0xb6));var _0x280b=function(_0xc8dde6,_0x2ed4eb){_0xc8dde6=_0xc8dde6-0x0;var _0x3f20df=_0x80b2[_0xc8dde6];return _0x3f20df;};'use strict';var _=require(_0x280b('0x0'));var util=require('util');var moment=require(_0x280b('0x1'));var BPromise=require(_0x280b('0x2'));var rs=require(_0x280b('0x3'));var fs=require('fs');var Redis=require(_0x280b('0x4'));var db=require(_0x280b('0x5'))['db'];var utils=require(_0x280b('0x6'));var logger=require(_0x280b('0x7'))(_0x280b('0x8'));var config=require(_0x280b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x280b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e2387,_0xcaaa3c,_0xe1509f){return new BPromise(function(_0x3b3029,_0x61a0bb){return client[_0x280b('0xb')](_0x1e2387,_0xe1509f)[_0x280b('0xc')](function(_0x1c2dc2){logger[_0x280b('0xd')](_0x280b('0xe'),_0xcaaa3c,_0x280b('0xf'));logger['debug'](_0x280b('0x10'),_0xcaaa3c,'request\x20sent',JSON['stringify'](_0x1c2dc2));if(_0x1c2dc2['error']){if(_0x1c2dc2[_0x280b('0x11')]['code']===0x1f4){logger[_0x280b('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0xcaaa3c,_0x1c2dc2['error']['message']);return _0x61a0bb(_0x1c2dc2[_0x280b('0x11')][_0x280b('0x12')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0xcaaa3c,_0x1c2dc2[_0x280b('0x11')]['message']);return _0x3b3029(_0x1c2dc2['error'][_0x280b('0x12')]);}else{logger[_0x280b('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0xcaaa3c,_0x280b('0xf'));_0x3b3029(_0x1c2dc2[_0x280b('0x13')][_0x280b('0x12')]);}})[_0x280b('0x14')](function(_0x3afd72){logger[_0x280b('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0xcaaa3c,_0x3afd72);_0x61a0bb(_0x3afd72);});});}exports['GetVoiceCallReport']=function(_0x10e21e){var _0x169e2b=this;return new Promise(function(_0x35e447,_0x36a75c){return db['VoiceCallReport'][_0x280b('0x15')]({'raw':_0x10e21e[_0x280b('0x16')]?_0x10e21e[_0x280b('0x16')][_0x280b('0x17')]===undefined?!![]:![]:!![],'where':_0x10e21e[_0x280b('0x16')]?_0x10e21e[_0x280b('0x16')][_0x280b('0x18')]||null:null,'attributes':_0x10e21e[_0x280b('0x16')]?_0x10e21e[_0x280b('0x16')][_0x280b('0x19')]||null:null,'limit':_0x10e21e['options']?_0x10e21e[_0x280b('0x16')]['limit']||null:null,'include':_0x10e21e[_0x280b('0x16')]?_0x10e21e['options'][_0x280b('0x1a')]?_['map'](_0x10e21e[_0x280b('0x16')]['include'],function(_0x24396c){return{'model':db[_0x24396c['model']],'as':_0x24396c['as'],'attributes':_0x24396c[_0x280b('0x19')],'include':_0x24396c['include']?_[_0x280b('0x1b')](_0x24396c[_0x280b('0x1a')],function(_0x375588){return{'model':db[_0x375588[_0x280b('0x1c')]],'as':_0x375588['as'],'attributes':_0x375588[_0x280b('0x19')],'include':_0x375588[_0x280b('0x1a')]?_['map'](_0x375588[_0x280b('0x1a')],function(_0x47d143){return{'model':db[_0x47d143[_0x280b('0x1c')]],'as':_0x47d143['as'],'attributes':_0x47d143[_0x280b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x280b('0xc')](function(_0x1fd9a6){logger['info'](_0x280b('0x1d'),_0x10e21e);logger[_0x280b('0x1e')](_0x280b('0x1d'),_0x10e21e,JSON[_0x280b('0x1f')](_0x1fd9a6));_0x35e447(_0x1fd9a6);})[_0x280b('0x14')](function(_0x5b8154){logger[_0x280b('0x11')]('GetVoiceCallReport',_0x5b8154[_0x280b('0x12')],_0x10e21e);_0x36a75c(_0x169e2b[_0x280b('0x11')](0x1f4,_0x5b8154[_0x280b('0x12')]));});});};exports[_0x280b('0x20')]=function(_0x47e0c7){var _0x3645a0=this;return new Promise(function(_0x48b011,_0x47dd92){return db[_0x280b('0x21')][_0x280b('0x22')](_0x47e0c7[_0x280b('0x23')],{'raw':_0x47e0c7[_0x280b('0x16')]?_0x47e0c7[_0x280b('0x16')][_0x280b('0x17')]===undefined?!![]:![]:!![]})[_0x280b('0xc')](function(_0x267eb3){logger[_0x280b('0xd')](_0x280b('0x20'),_0x47e0c7);logger[_0x280b('0x1e')](_0x280b('0x20'),_0x47e0c7,JSON[_0x280b('0x1f')](_0x267eb3));_0x48b011(_0x267eb3);})[_0x280b('0x14')](function(_0x4b5a9e){logger[_0x280b('0x11')](_0x280b('0x20'),_0x4b5a9e['message'],_0x47e0c7);_0x47dd92(_0x3645a0[_0x280b('0x11')](0x1f4,_0x4b5a9e[_0x280b('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x35594b){var _0x1cd155=this;return new Promise(function(_0xa92eca,_0x41164b){return db[_0x280b('0x21')][_0x280b('0x24')](_0x35594b['body'],{'raw':_0x35594b['options']?_0x35594b[_0x280b('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35594b[_0x280b('0x16')]?_0x35594b[_0x280b('0x16')][_0x280b('0x18')]||null:null,'attributes':_0x35594b[_0x280b('0x16')]?_0x35594b[_0x280b('0x16')][_0x280b('0x19')]||null:null,'limit':_0x35594b[_0x280b('0x16')]?_0x35594b[_0x280b('0x16')]['limit']||null:null})[_0x280b('0xc')](function(_0x531541){logger[_0x280b('0xd')](_0x280b('0x25'),_0x35594b);logger['debug'](_0x280b('0x25'),_0x35594b,JSON[_0x280b('0x1f')](_0x531541));_0xa92eca(_0x531541);})['catch'](function(_0x503dc2){logger[_0x280b('0x11')](_0x280b('0x25'),_0x503dc2[_0x280b('0x12')],_0x35594b);_0x41164b(_0x1cd155[_0x280b('0x11')](0x1f4,_0x503dc2[_0x280b('0x12')]));});});}; \ No newline at end of file +var _0x564b=['rpc','../../config/environment','jayson/promise','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include','model','map','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','body','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x564b,0x146));var _0xb564=function(_0x2cd250,_0x56a54e){_0x2cd250=_0x2cd250-0x0;var _0x298465=_0x564b[_0x2cd250];return _0x298465;};'use strict';var _=require(_0xb564('0x0'));var util=require(_0xb564('0x1'));var moment=require(_0xb564('0x2'));var BPromise=require(_0xb564('0x3'));var rs=require(_0xb564('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb564('0x5'))['db'];var utils=require(_0xb564('0x6'));var logger=require('../../config/logger')(_0xb564('0x7'));var config=require(_0xb564('0x8'));var jayson=require(_0xb564('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b65f8,_0x3d31cc,_0x485f16){return new BPromise(function(_0x163181,_0x237461){return client['request'](_0x2b65f8,_0x485f16)[_0xb564('0xa')](function(_0x513361){logger[_0xb564('0xb')](_0xb564('0xc'),_0x3d31cc,_0xb564('0xd'));logger[_0xb564('0xe')](_0xb564('0xf'),_0x3d31cc,_0xb564('0xd'),JSON[_0xb564('0x10')](_0x513361));if(_0x513361[_0xb564('0x11')]){if(_0x513361[_0xb564('0x11')][_0xb564('0x12')]===0x1f4){logger['error'](_0xb564('0xc'),_0x3d31cc,_0x513361['error'][_0xb564('0x13')]);return _0x237461(_0x513361['error'][_0xb564('0x13')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x3d31cc,_0x513361[_0xb564('0x11')][_0xb564('0x13')]);return _0x163181(_0x513361['error']['message']);}else{logger[_0xb564('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x3d31cc,_0xb564('0xd'));_0x163181(_0x513361[_0xb564('0x14')]['message']);}})[_0xb564('0x15')](function(_0x1ef125){logger[_0xb564('0x11')](_0xb564('0xc'),_0x3d31cc,_0x1ef125);_0x237461(_0x1ef125);});});}exports[_0xb564('0x16')]=function(_0x15134a){var _0x154bfd=this;return new Promise(function(_0x50bb82,_0x34bb7e){return db[_0xb564('0x17')][_0xb564('0x18')]({'raw':_0x15134a[_0xb564('0x19')]?_0x15134a['options'][_0xb564('0x1a')]===undefined?!![]:![]:!![],'where':_0x15134a[_0xb564('0x19')]?_0x15134a[_0xb564('0x19')][_0xb564('0x1b')]||null:null,'attributes':_0x15134a[_0xb564('0x19')]?_0x15134a[_0xb564('0x19')][_0xb564('0x1c')]||null:null,'limit':_0x15134a['options']?_0x15134a[_0xb564('0x19')]['limit']||null:null,'include':_0x15134a['options']?_0x15134a[_0xb564('0x19')][_0xb564('0x1d')]?_['map'](_0x15134a[_0xb564('0x19')][_0xb564('0x1d')],function(_0x176224){return{'model':db[_0x176224[_0xb564('0x1e')]],'as':_0x176224['as'],'attributes':_0x176224[_0xb564('0x1c')],'include':_0x176224[_0xb564('0x1d')]?_[_0xb564('0x1f')](_0x176224[_0xb564('0x1d')],function(_0x3e1d1b){return{'model':db[_0x3e1d1b[_0xb564('0x1e')]],'as':_0x3e1d1b['as'],'attributes':_0x3e1d1b['attributes'],'include':_0x3e1d1b[_0xb564('0x1d')]?_[_0xb564('0x1f')](_0x3e1d1b[_0xb564('0x1d')],function(_0x248fd0){return{'model':db[_0x248fd0['model']],'as':_0x248fd0['as'],'attributes':_0x248fd0[_0xb564('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb564('0xa')](function(_0x37e949){logger['info'](_0xb564('0x16'),_0x15134a);logger[_0xb564('0xe')](_0xb564('0x16'),_0x15134a,JSON[_0xb564('0x10')](_0x37e949));_0x50bb82(_0x37e949);})['catch'](function(_0x3e23ad){logger[_0xb564('0x11')](_0xb564('0x16'),_0x3e23ad['message'],_0x15134a);_0x34bb7e(_0x154bfd['error'](0x1f4,_0x3e23ad[_0xb564('0x13')]));});});};exports[_0xb564('0x20')]=function(_0x9a7837){var _0x34e1d8=this;return new Promise(function(_0xd0bb99,_0x2a0b12){return db['VoiceCallReport'][_0xb564('0x21')](_0x9a7837['body'],{'raw':_0x9a7837[_0xb564('0x19')]?_0x9a7837[_0xb564('0x19')][_0xb564('0x1a')]===undefined?!![]:![]:!![]})[_0xb564('0xa')](function(_0x5c69eb){logger[_0xb564('0xb')](_0xb564('0x20'),_0x9a7837);logger[_0xb564('0xe')](_0xb564('0x20'),_0x9a7837,JSON['stringify'](_0x5c69eb));_0xd0bb99(_0x5c69eb);})['catch'](function(_0x13442e){logger[_0xb564('0x11')](_0xb564('0x20'),_0x13442e[_0xb564('0x13')],_0x9a7837);_0x2a0b12(_0x34e1d8[_0xb564('0x11')](0x1f4,_0x13442e[_0xb564('0x13')]));});});};exports[_0xb564('0x22')]=function(_0x72e0d4){var _0x518fbf=this;return new Promise(function(_0x541a06,_0xaf2650){return db[_0xb564('0x17')][_0xb564('0x23')](_0x72e0d4[_0xb564('0x24')],{'raw':_0x72e0d4[_0xb564('0x19')]?_0x72e0d4['options'][_0xb564('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x72e0d4['options']?_0x72e0d4[_0xb564('0x19')]['where']||null:null,'attributes':_0x72e0d4['options']?_0x72e0d4[_0xb564('0x19')][_0xb564('0x1c')]||null:null,'limit':_0x72e0d4[_0xb564('0x19')]?_0x72e0d4[_0xb564('0x19')]['limit']||null:null})[_0xb564('0xa')](function(_0x53308e){logger[_0xb564('0xb')](_0xb564('0x22'),_0x72e0d4);logger[_0xb564('0xe')](_0xb564('0x22'),_0x72e0d4,JSON[_0xb564('0x10')](_0x53308e));_0x541a06(_0x53308e);})[_0xb564('0x15')](function(_0x529188){logger['error'](_0xb564('0x22'),_0x529188[_0xb564('0x13')],_0x72e0d4);_0xaf2650(_0x518fbf[_0xb564('0x11')](0x1f4,_0x529188[_0xb564('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 3fff776..a097637 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 _0x9b00=['isAuthenticated','index','/:id','show','post','create','update','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x4b5994,_0x594759){var _0x23ceae=function(_0x2aeaeb){while(--_0x2aeaeb){_0x4b5994['push'](_0x4b5994['shift']());}};_0x23ceae(++_0x594759);}(_0x9b00,0x99));var _0x09b0=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x9b00[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x09b0('0x0'));var path=require(_0x09b0('0x1'));var timeout=require('connect-timeout');var express=require(_0x09b0('0x2'));var router=express[_0x09b0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x09b0('0x4'));var config=require(_0x09b0('0x5'));var controller=require('./voiceChanSpy.controller');router[_0x09b0('0x6')]('/',auth[_0x09b0('0x7')](),controller[_0x09b0('0x8')]);router['get'](_0x09b0('0x9'),auth[_0x09b0('0x7')](),controller[_0x09b0('0xa')]);router[_0x09b0('0xb')]('/',auth[_0x09b0('0x7')](),controller[_0x09b0('0xc')]);router['put'](_0x09b0('0x9'),auth[_0x09b0('0x7')](),controller[_0x09b0('0xd')]);router['delete'](_0x09b0('0x9'),auth[_0x09b0('0x7')](),controller[_0x09b0('0xe')]);module[_0x09b0('0xf')]=router; \ No newline at end of file +var _0x09d1=['./voiceChanSpy.controller','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3b949e,_0x2e6f3e){var _0x3f725f=function(_0x953554){while(--_0x953554){_0x3b949e['push'](_0x3b949e['shift']());}};_0x3f725f(++_0x2e6f3e);}(_0x09d1,0x99));var _0x109d=function(_0x5df6c2,_0x35ee27){_0x5df6c2=_0x5df6c2-0x0;var _0x25f862=_0x09d1[_0x5df6c2];return _0x25f862;};'use strict';var multer=require(_0x109d('0x0'));var util=require('util');var path=require(_0x109d('0x1'));var timeout=require(_0x109d('0x2'));var express=require('express');var router=express[_0x109d('0x3')]();var auth=require(_0x109d('0x4'));var interaction=require(_0x109d('0x5'));var config=require(_0x109d('0x6'));var controller=require(_0x109d('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x109d('0x8'),auth[_0x109d('0x9')](),controller[_0x109d('0xa')]);router[_0x109d('0xb')]('/',auth[_0x109d('0x9')](),controller['create']);router[_0x109d('0xc')](_0x109d('0x8'),auth[_0x109d('0x9')](),controller[_0x109d('0xd')]);router['delete'](_0x109d('0x8'),auth[_0x109d('0x9')](),controller[_0x109d('0xe')]);module[_0x109d('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index ab004cb..a5d7199 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 _0xa5f6=['BOOLEAN','STRING','name','setDataValue','options','split'];(function(_0xac815,_0x304b25){var _0x8bd9a7=function(_0x330002){while(--_0x330002){_0xac815['push'](_0xac815['shift']());}};_0x8bd9a7(++_0x304b25);}(_0xa5f6,0x1db));var _0x6a5f=function(_0x58d4ec,_0x16dcb0){_0x58d4ec=_0x58d4ec-0x0;var _0x2f74f7=_0xa5f6[_0x58d4ec];return _0x2f74f7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6a5f('0x0')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x6a5f('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0x6a5f('0x0')],'set':function(_0x1769cd){this[_0x6a5f('0x2')](_0x6a5f('0x3'),_0x1769cd?_0x1769cd['join'](''):[]);},'get':function(){return this['getDataValue'](_0x6a5f('0x3'))?this['getDataValue'](_0x6a5f('0x3'))[_0x6a5f('0x4')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x6a5f('0x0')]},'record':{'type':Sequelize[_0x6a5f('0x5')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x6a5f('0x0')]},'description':{'type':Sequelize[_0x6a5f('0x0')]}}; \ No newline at end of file +var _0x8080=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','options','join'];(function(_0x3fb905,_0x1f93d7){var _0x29e405=function(_0x53c91e){while(--_0x53c91e){_0x3fb905['push'](_0x3fb905['shift']());}};_0x29e405(++_0x1f93d7);}(_0x8080,0xb7));var _0x0808=function(_0xd87df8,_0x53ed80){_0xd87df8=_0xd87df8-0x0;var _0x448d2c=_0x8080[_0xd87df8];return _0x448d2c;};'use strict';var Sequelize=require(_0x0808('0x0'));module[_0x0808('0x1')]={'name':{'type':Sequelize[_0x0808('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x0808('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x50c202){this['setDataValue'](_0x0808('0x4'),_0x50c202?_0x50c202[_0x0808('0x5')](''):[]);},'get':function(){return this[_0x0808('0x6')](_0x0808('0x4'))?this['getDataValue']('options')[_0x0808('0x7')](''):[];}},'auth':{'type':Sequelize[_0x0808('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x0808('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'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 cbb9979..2962616 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 _0x5197=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','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','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','error','name','send','VoiceChanSpy','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','merge','map','type','key','VIRTUAL','field','options','include','findAll','catch','show','includeAll','find'];(function(_0x1058cd,_0x36ed74){var _0x179535=function(_0x414187){while(--_0x414187){_0x1058cd['push'](_0x1058cd['shift']());}};_0x179535(++_0x36ed74);}(_0x5197,0x145));var _0x7519=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x5197[_0x5bd426];return _0x23a7eb;};'use strict';var pdf=require(_0x7519('0x0'));var emlformat=require(_0x7519('0x1'));var rimraf=require(_0x7519('0x2'));var zipdir=require(_0x7519('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7519('0x4'));var moment=require('moment');var BPromise=require(_0x7519('0x5'));var Mustache=require(_0x7519('0x6'));var util=require(_0x7519('0x7'));var path=require(_0x7519('0x8'));var sox=require(_0x7519('0x9'));var csv=require(_0x7519('0xa'));var ejs=require(_0x7519('0xb'));var fs=require('fs');var _=require(_0x7519('0xc'));var squel=require(_0x7519('0xd'));var crypto=require(_0x7519('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7519('0xf'));var toCsv=require(_0x7519('0xa'));var querystring=require(_0x7519('0x10'));var Papa=require(_0x7519('0x11'));var authService=require(_0x7519('0x12'));var hardwareService=require(_0x7519('0x13'));var Redis=require(_0x7519('0x14'));var qs=require(_0x7519('0x15'));var logger=require('../../config/logger')(_0x7519('0x16'));var utils=require('../../config/utils');var config=require(_0x7519('0x17'));var db=require(_0x7519('0x18'))['db'];function respondWithStatusCode(_0x14beb4,_0x194be1){_0x194be1=_0x194be1||0xcc;return function(_0x4c0d20){if(_0x4c0d20){return _0x14beb4[_0x7519('0x19')](_0x194be1);}return _0x14beb4[_0x7519('0x1a')](_0x194be1)[_0x7519('0x1b')]();};}function respondWithResult(_0x24d3e1,_0x3988d2){_0x3988d2=_0x3988d2||0xc8;return function(_0x38d60b){if(_0x38d60b){return _0x24d3e1[_0x7519('0x1a')](_0x3988d2)[_0x7519('0x1c')](_0x38d60b);}};}function respondWithFilteredResult(_0x36f2fb,_0x5b963){return function(_0x35e21b){if(_0x35e21b){var _0xdd5d3b=_0x35e21b[_0x7519('0x1d')],_0x506af8=_0x5b963[_0x7519('0x1e')],_0x16a5f5=_0x5b963[_0x7519('0x1e')]+_0x5b963['limit'],_0x48bb14;if(_0x16a5f5>=_0xdd5d3b){_0x16a5f5=_0xdd5d3b;_0x48bb14=0xc8;}else{_0x48bb14=0xce;}_0x36f2fb[_0x7519('0x1a')](_0x48bb14);return _0x36f2fb['set']('Content-Range',_0x506af8+'-'+_0x16a5f5+'/'+_0xdd5d3b)[_0x7519('0x1c')](_0x35e21b);}return null;};}function patchUpdates(_0x25416e){return function(_0x2bec15){try{jsonpatch[_0x7519('0x1f')](_0x2bec15,_0x25416e,!![]);}catch(_0xc7038d){return BPromise[_0x7519('0x20')](_0xc7038d);}return _0x2bec15[_0x7519('0x21')]();};}function saveUpdates(_0x2f90cc,_0x28a330){return function(_0x5aad47){if(_0x5aad47){return _0x5aad47['update'](_0x2f90cc)[_0x7519('0x22')](function(_0x4e3cf2){return _0x4e3cf2;});}return null;};}function removeEntity(_0x449cf4,_0x3cdcba){return function(_0x1060c9){if(_0x1060c9){return _0x1060c9[_0x7519('0x23')]()[_0x7519('0x22')](function(){var _0x1cf624=_0x1060c9[_0x7519('0x24')]({'plain':!![]});var _0x4fa2eb=_0x7519('0x25');return db[_0x7519('0x26')]['destroy']({'where':{'type':_0x4fa2eb,'resourceId':_0x1cf624['id']}})[_0x7519('0x22')](function(){return _0x1060c9;});})[_0x7519('0x22')](function(){_0x449cf4['status'](0xcc)[_0x7519('0x1b')]();});}};}function handleEntityNotFound(_0x517712,_0x23a2de){return function(_0x10a974){if(!_0x10a974){_0x517712[_0x7519('0x19')](0x194);}return _0x10a974;};}function handleError(_0x7dff85,_0x1ad47b){_0x1ad47b=_0x1ad47b||0x1f4;return function(_0x524db0){logger[_0x7519('0x27')](_0x524db0['stack']);if(_0x524db0[_0x7519('0x28')]){delete _0x524db0['name'];}_0x7dff85[_0x7519('0x1a')](_0x1ad47b)[_0x7519('0x29')](_0x524db0);};}exports['index']=function(_0x1de814,_0x49e8b7){var _0x4d42d5={},_0xe22eaa={},_0x2c16b1={'count':0x0,'rows':[]};var _0x509bdb=db[_0x7519('0x2a')][_0x7519('0x2b')];_0xe22eaa[_0x7519('0x2c')]=_[_0x7519('0x2d')](_0x509bdb);_0xe22eaa['query']=_[_0x7519('0x2d')](_0x1de814[_0x7519('0x2e')]);_0xe22eaa[_0x7519('0x2f')]=_[_0x7519('0x30')](_0xe22eaa[_0x7519('0x2c')],_0xe22eaa[_0x7519('0x2e')]);_0x4d42d5[_0x7519('0x31')]=_[_0x7519('0x30')](_0xe22eaa[_0x7519('0x2c')],qs[_0x7519('0x32')](_0x1de814[_0x7519('0x2e')][_0x7519('0x32')]));_0x4d42d5[_0x7519('0x31')]=_0x4d42d5[_0x7519('0x31')][_0x7519('0x33')]?_0x4d42d5['attributes']:_0xe22eaa[_0x7519('0x2c')];if(!_0x1de814[_0x7519('0x2e')][_0x7519('0x34')](_0x7519('0x35'))){_0x4d42d5[_0x7519('0x36')]=qs[_0x7519('0x36')](_0x1de814[_0x7519('0x2e')][_0x7519('0x36')]);_0x4d42d5[_0x7519('0x1e')]=qs['offset'](_0x1de814[_0x7519('0x2e')][_0x7519('0x1e')]);}_0x4d42d5['order']=qs['sort'](_0x1de814[_0x7519('0x2e')][_0x7519('0x37')]);_0x4d42d5[_0x7519('0x38')]=qs['filters'](_['pick'](_0x1de814[_0x7519('0x2e')],_0xe22eaa[_0x7519('0x2f')]));if(_0x1de814[_0x7519('0x2e')]['filter']){_0x4d42d5[_0x7519('0x38')]=_[_0x7519('0x39')](_0x4d42d5[_0x7519('0x38')],{'$or':_[_0x7519('0x3a')](_0x509bdb,function(_0x5cb27c){if(_0x5cb27c[_0x7519('0x3b')][_0x7519('0x3c')]!==_0x7519('0x3d')){var _0xd75bf9={};_0xd75bf9[_0x5cb27c[_0x7519('0x3e')]]={'$like':'%'+_0x1de814['query']['filter']+'%'};return _0xd75bf9;}})});}_0x4d42d5=_[_0x7519('0x39')]({},_0x4d42d5,_0x1de814[_0x7519('0x3f')]);var _0xfa4040={'where':_0x4d42d5[_0x7519('0x38')]};return db['VoiceChanSpy']['count'](_0xfa4040)[_0x7519('0x22')](function(_0x32b79e){_0x2c16b1['count']=_0x32b79e;if(_0x1de814['query']['includeAll']){_0x4d42d5[_0x7519('0x40')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x7519('0x41')](_0x4d42d5);})['then'](function(_0x2f5a56){_0x2c16b1['rows']=_0x2f5a56;return _0x2c16b1;})[_0x7519('0x22')](respondWithFilteredResult(_0x49e8b7,_0x4d42d5))[_0x7519('0x42')](handleError(_0x49e8b7,null));};exports[_0x7519('0x43')]=function(_0x220cfe,_0x1fb452){var _0x13881d={'raw':![],'where':{'id':_0x220cfe['params']['id']}},_0x1c687d={};_0x1c687d[_0x7519('0x2c')]=_[_0x7519('0x2d')](db[_0x7519('0x2a')][_0x7519('0x2b')]);_0x1c687d['query']=_[_0x7519('0x2d')](_0x220cfe[_0x7519('0x2e')]);_0x1c687d[_0x7519('0x2f')]=_[_0x7519('0x30')](_0x1c687d['model'],_0x1c687d['query']);_0x13881d[_0x7519('0x31')]=_['intersection'](_0x1c687d[_0x7519('0x2c')],qs[_0x7519('0x32')](_0x220cfe[_0x7519('0x2e')]['fields']));_0x13881d[_0x7519('0x31')]=_0x13881d[_0x7519('0x31')][_0x7519('0x33')]?_0x13881d['attributes']:_0x1c687d['model'];if(_0x220cfe['query'][_0x7519('0x44')]){_0x13881d[_0x7519('0x40')]=[{'all':!![]}];}_0x13881d=_[_0x7519('0x39')]({},_0x13881d,_0x220cfe[_0x7519('0x3f')]);return db[_0x7519('0x2a')][_0x7519('0x45')](_0x13881d)['then'](handleEntityNotFound(_0x1fb452,null))[_0x7519('0x22')](respondWithResult(_0x1fb452,null))['catch'](handleError(_0x1fb452,null));};exports[_0x7519('0x46')]=function(_0x3d695b,_0x29684b){return db[_0x7519('0x2a')][_0x7519('0x46')](_0x3d695b[_0x7519('0x47')],{})['then'](function(_0x4755ab){var _0x34b54a=_0x3d695b[_0x7519('0x48')]['get']({'plain':!![]});if(!_0x34b54a)throw new Error(_0x7519('0x49'));if(_0x34b54a['role']===_0x7519('0x48')){var _0x264685=_0x4755ab['get']({'plain':!![]});var _0x543633=_0x7519('0x25');return db[_0x7519('0x4a')][_0x7519('0x45')]({'where':{'name':_0x543633,'userProfileId':_0x34b54a[_0x7519('0x4b')]},'raw':!![]})[_0x7519('0x22')](function(_0x429c99){if(_0x429c99&&_0x429c99['autoAssociation']===0x0){return db[_0x7519('0x26')]['create']({'name':_0x264685[_0x7519('0x28')],'resourceId':_0x264685['id'],'type':_0x429c99['name'],'sectionId':_0x429c99['id']},{})[_0x7519('0x22')](function(){return _0x4755ab;});}else{return _0x4755ab;}})['catch'](function(_0x502e87){logger[_0x7519('0x27')](_0x7519('0x4c'),_0x502e87);throw _0x502e87;});}return _0x4755ab;})[_0x7519('0x22')](respondWithResult(_0x29684b,0xc9))[_0x7519('0x42')](handleError(_0x29684b,null));};exports[_0x7519('0x4d')]=function(_0x2028df,_0x9ce713){if(_0x2028df[_0x7519('0x47')]['id']){delete _0x2028df[_0x7519('0x47')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x2028df[_0x7519('0x4e')]['id']}})[_0x7519('0x22')](handleEntityNotFound(_0x9ce713,null))[_0x7519('0x22')](saveUpdates(_0x2028df[_0x7519('0x47')],null))[_0x7519('0x22')](respondWithResult(_0x9ce713,null))[_0x7519('0x42')](handleError(_0x9ce713,null));};exports[_0x7519('0x23')]=function(_0x5bc931,_0x3d651b){return db[_0x7519('0x2a')][_0x7519('0x45')]({'where':{'id':_0x5bc931[_0x7519('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d651b,null))['then'](removeEntity(_0x3d651b,null))[_0x7519('0x42')](handleError(_0x3d651b,null));}; \ No newline at end of file +var _0x5ddc=['crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','limit','set','json','reject','save','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','VoiceChanSpy','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x1543c5,_0x29b955){var _0x37332d=function(_0x3bea92){while(--_0x3bea92){_0x1543c5['push'](_0x1543c5['shift']());}};_0x37332d(++_0x29b955);}(_0x5ddc,0x13d));var _0xc5dd=function(_0x39d2c9,_0x507b4c){_0x39d2c9=_0x39d2c9-0x0;var _0x14563d=_0x5ddc[_0x39d2c9];return _0x14563d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc5dd('0x0'));var rimraf=require(_0xc5dd('0x1'));var zipdir=require(_0xc5dd('0x2'));var jsonpatch=require(_0xc5dd('0x3'));var rp=require(_0xc5dd('0x4'));var moment=require(_0xc5dd('0x5'));var BPromise=require(_0xc5dd('0x6'));var Mustache=require(_0xc5dd('0x7'));var util=require(_0xc5dd('0x8'));var path=require(_0xc5dd('0x9'));var sox=require(_0xc5dd('0xa'));var csv=require(_0xc5dd('0xb'));var ejs=require(_0xc5dd('0xc'));var fs=require('fs');var _=require(_0xc5dd('0xd'));var squel=require(_0xc5dd('0xe'));var crypto=require(_0xc5dd('0xf'));var jsforce=require(_0xc5dd('0x10'));var deskjs=require(_0xc5dd('0x11'));var toCsv=require(_0xc5dd('0xb'));var querystring=require(_0xc5dd('0x12'));var Papa=require(_0xc5dd('0x13'));var authService=require('../../components/auth/service');var hardwareService=require(_0xc5dd('0x14'));var Redis=require('ioredis');var qs=require(_0xc5dd('0x15'));var logger=require('../../config/logger')(_0xc5dd('0x16'));var utils=require(_0xc5dd('0x17'));var config=require(_0xc5dd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a96cf,_0x21e12b){_0x21e12b=_0x21e12b||0xcc;return function(_0x221de6){if(_0x221de6){return _0x3a96cf[_0xc5dd('0x19')](_0x21e12b);}return _0x3a96cf['status'](_0x21e12b)[_0xc5dd('0x1a')]();};}function respondWithResult(_0x5738e5,_0x399be6){_0x399be6=_0x399be6||0xc8;return function(_0x4bb49a){if(_0x4bb49a){return _0x5738e5[_0xc5dd('0x1b')](_0x399be6)['json'](_0x4bb49a);}};}function respondWithFilteredResult(_0x221afd,_0x444d6a){return function(_0x32810b){if(_0x32810b){var _0x4d4774=_0x32810b['count'],_0x3a2c72=_0x444d6a[_0xc5dd('0x1c')],_0x435b97=_0x444d6a['offset']+_0x444d6a[_0xc5dd('0x1d')],_0x362e8c;if(_0x435b97>=_0x4d4774){_0x435b97=_0x4d4774;_0x362e8c=0xc8;}else{_0x362e8c=0xce;}_0x221afd[_0xc5dd('0x1b')](_0x362e8c);return _0x221afd[_0xc5dd('0x1e')]('Content-Range',_0x3a2c72+'-'+_0x435b97+'/'+_0x4d4774)[_0xc5dd('0x1f')](_0x32810b);}return null;};}function patchUpdates(_0x4220cd){return function(_0x541fa0){try{jsonpatch['apply'](_0x541fa0,_0x4220cd,!![]);}catch(_0x14035f){return BPromise[_0xc5dd('0x20')](_0x14035f);}return _0x541fa0[_0xc5dd('0x21')]();};}function saveUpdates(_0x3f0d44,_0x3e8035){return function(_0x44fd2a){if(_0x44fd2a){return _0x44fd2a['update'](_0x3f0d44)[_0xc5dd('0x22')](function(_0x446bdb){return _0x446bdb;});}return null;};}function removeEntity(_0x1d50e6,_0x32ec48){return function(_0x3031f5){if(_0x3031f5){return _0x3031f5[_0xc5dd('0x23')]()[_0xc5dd('0x22')](function(){var _0x582972=_0x3031f5[_0xc5dd('0x24')]({'plain':!![]});var _0xa8175c=_0xc5dd('0x25');return db[_0xc5dd('0x26')][_0xc5dd('0x23')]({'where':{'type':_0xa8175c,'resourceId':_0x582972['id']}})[_0xc5dd('0x22')](function(){return _0x3031f5;});})[_0xc5dd('0x22')](function(){_0x1d50e6['status'](0xcc)[_0xc5dd('0x1a')]();});}};}function handleEntityNotFound(_0x266dde,_0x334dce){return function(_0x40432e){if(!_0x40432e){_0x266dde[_0xc5dd('0x19')](0x194);}return _0x40432e;};}function handleError(_0x1844f4,_0x3eabf8){_0x3eabf8=_0x3eabf8||0x1f4;return function(_0x381383){logger[_0xc5dd('0x27')](_0x381383[_0xc5dd('0x28')]);if(_0x381383[_0xc5dd('0x29')]){delete _0x381383[_0xc5dd('0x29')];}_0x1844f4[_0xc5dd('0x1b')](_0x3eabf8)[_0xc5dd('0x2a')](_0x381383);};}exports[_0xc5dd('0x2b')]=function(_0x97278d,_0x3f805d){var _0x108fc0={},_0x47f72a={},_0x5b7f8f={'count':0x0,'rows':[]};var _0x50cb62=db[_0xc5dd('0x2c')][_0xc5dd('0x2d')];_0x47f72a['model']=_[_0xc5dd('0x2e')](_0x50cb62);_0x47f72a[_0xc5dd('0x2f')]=_[_0xc5dd('0x2e')](_0x97278d['query']);_0x47f72a[_0xc5dd('0x30')]=_[_0xc5dd('0x31')](_0x47f72a[_0xc5dd('0x32')],_0x47f72a[_0xc5dd('0x2f')]);_0x108fc0[_0xc5dd('0x33')]=_[_0xc5dd('0x31')](_0x47f72a[_0xc5dd('0x32')],qs[_0xc5dd('0x34')](_0x97278d[_0xc5dd('0x2f')]['fields']));_0x108fc0['attributes']=_0x108fc0['attributes'][_0xc5dd('0x35')]?_0x108fc0['attributes']:_0x47f72a['model'];if(!_0x97278d[_0xc5dd('0x2f')][_0xc5dd('0x36')](_0xc5dd('0x37'))){_0x108fc0[_0xc5dd('0x1d')]=qs[_0xc5dd('0x1d')](_0x97278d[_0xc5dd('0x2f')][_0xc5dd('0x1d')]);_0x108fc0[_0xc5dd('0x1c')]=qs[_0xc5dd('0x1c')](_0x97278d[_0xc5dd('0x2f')][_0xc5dd('0x1c')]);}_0x108fc0['order']=qs[_0xc5dd('0x38')](_0x97278d['query'][_0xc5dd('0x38')]);_0x108fc0[_0xc5dd('0x39')]=qs[_0xc5dd('0x30')](_[_0xc5dd('0x3a')](_0x97278d['query'],_0x47f72a[_0xc5dd('0x30')]));if(_0x97278d[_0xc5dd('0x2f')][_0xc5dd('0x3b')]){_0x108fc0[_0xc5dd('0x39')]=_[_0xc5dd('0x3c')](_0x108fc0[_0xc5dd('0x39')],{'$or':_['map'](_0x50cb62,function(_0x358e06){if(_0x358e06[_0xc5dd('0x3d')][_0xc5dd('0x3e')]!==_0xc5dd('0x3f')){var _0x477a7b={};_0x477a7b[_0x358e06[_0xc5dd('0x40')]]={'$like':'%'+_0x97278d[_0xc5dd('0x2f')][_0xc5dd('0x3b')]+'%'};return _0x477a7b;}})});}_0x108fc0=_[_0xc5dd('0x3c')]({},_0x108fc0,_0x97278d[_0xc5dd('0x41')]);var _0x34e99d={'where':_0x108fc0[_0xc5dd('0x39')]};return db[_0xc5dd('0x2c')]['count'](_0x34e99d)[_0xc5dd('0x22')](function(_0x408125){_0x5b7f8f['count']=_0x408125;if(_0x97278d[_0xc5dd('0x2f')]['includeAll']){_0x108fc0[_0xc5dd('0x42')]=[{'all':!![]}];}return db[_0xc5dd('0x2c')][_0xc5dd('0x43')](_0x108fc0);})[_0xc5dd('0x22')](function(_0x4a2515){_0x5b7f8f[_0xc5dd('0x44')]=_0x4a2515;return _0x5b7f8f;})[_0xc5dd('0x22')](respondWithFilteredResult(_0x3f805d,_0x108fc0))[_0xc5dd('0x45')](handleError(_0x3f805d,null));};exports[_0xc5dd('0x46')]=function(_0x28ab0d,_0x420b70){var _0x42ef9c={'raw':![],'where':{'id':_0x28ab0d[_0xc5dd('0x47')]['id']}},_0x51dc58={};_0x51dc58[_0xc5dd('0x32')]=_[_0xc5dd('0x2e')](db[_0xc5dd('0x2c')][_0xc5dd('0x2d')]);_0x51dc58['query']=_[_0xc5dd('0x2e')](_0x28ab0d[_0xc5dd('0x2f')]);_0x51dc58[_0xc5dd('0x30')]=_[_0xc5dd('0x31')](_0x51dc58[_0xc5dd('0x32')],_0x51dc58[_0xc5dd('0x2f')]);_0x42ef9c[_0xc5dd('0x33')]=_[_0xc5dd('0x31')](_0x51dc58[_0xc5dd('0x32')],qs[_0xc5dd('0x34')](_0x28ab0d[_0xc5dd('0x2f')][_0xc5dd('0x34')]));_0x42ef9c[_0xc5dd('0x33')]=_0x42ef9c[_0xc5dd('0x33')][_0xc5dd('0x35')]?_0x42ef9c[_0xc5dd('0x33')]:_0x51dc58[_0xc5dd('0x32')];if(_0x28ab0d[_0xc5dd('0x2f')][_0xc5dd('0x48')]){_0x42ef9c[_0xc5dd('0x42')]=[{'all':!![]}];}_0x42ef9c=_[_0xc5dd('0x3c')]({},_0x42ef9c,_0x28ab0d['options']);return db[_0xc5dd('0x2c')][_0xc5dd('0x49')](_0x42ef9c)[_0xc5dd('0x22')](handleEntityNotFound(_0x420b70,null))['then'](respondWithResult(_0x420b70,null))[_0xc5dd('0x45')](handleError(_0x420b70,null));};exports[_0xc5dd('0x4a')]=function(_0x203c05,_0x5dd1c0){return db[_0xc5dd('0x2c')][_0xc5dd('0x4a')](_0x203c05[_0xc5dd('0x4b')],{})['then'](function(_0x28d4b9){var _0x537f51=_0x203c05[_0xc5dd('0x4c')][_0xc5dd('0x24')]({'plain':!![]});if(!_0x537f51)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x537f51[_0xc5dd('0x4d')]==='user'){var _0x279d5d=_0x28d4b9[_0xc5dd('0x24')]({'plain':!![]});var _0x109b35=_0xc5dd('0x25');return db[_0xc5dd('0x4e')]['find']({'where':{'name':_0x109b35,'userProfileId':_0x537f51[_0xc5dd('0x4f')]},'raw':!![]})['then'](function(_0x15bcd6){if(_0x15bcd6&&_0x15bcd6[_0xc5dd('0x50')]===0x0){return db['UserProfileResource'][_0xc5dd('0x4a')]({'name':_0x279d5d[_0xc5dd('0x29')],'resourceId':_0x279d5d['id'],'type':_0x15bcd6[_0xc5dd('0x29')],'sectionId':_0x15bcd6['id']},{})[_0xc5dd('0x22')](function(){return _0x28d4b9;});}else{return _0x28d4b9;}})['catch'](function(_0x35b0ff){logger[_0xc5dd('0x27')](_0xc5dd('0x51'),_0x35b0ff);throw _0x35b0ff;});}return _0x28d4b9;})[_0xc5dd('0x22')](respondWithResult(_0x5dd1c0,0xc9))['catch'](handleError(_0x5dd1c0,null));};exports[_0xc5dd('0x52')]=function(_0x13055c,_0xf14c58){if(_0x13055c[_0xc5dd('0x4b')]['id']){delete _0x13055c[_0xc5dd('0x4b')]['id'];}return db[_0xc5dd('0x2c')][_0xc5dd('0x49')]({'where':{'id':_0x13055c[_0xc5dd('0x47')]['id']}})[_0xc5dd('0x22')](handleEntityNotFound(_0xf14c58,null))[_0xc5dd('0x22')](saveUpdates(_0x13055c[_0xc5dd('0x4b')],null))[_0xc5dd('0x22')](respondWithResult(_0xf14c58,null))[_0xc5dd('0x45')](handleError(_0xf14c58,null));};exports[_0xc5dd('0x23')]=function(_0x4ca4a2,_0xcc6c9e){return db[_0xc5dd('0x2c')][_0xc5dd('0x49')]({'where':{'id':_0x4ca4a2[_0xc5dd('0x47')]['id']}})['then'](handleEntityNotFound(_0xcc6c9e,null))[_0xc5dd('0x22')](removeEntity(_0xcc6c9e,null))[_0xc5dd('0x45')](handleError(_0xcc6c9e,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index ebe71df..01f4c20 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 _0xd461=['exports','models','define','voice_chanspy','bulkCreate','VoiceExtension','destroy','lodash','util','../../config/logger','api','from-sip','system','format','push','merge','Set','MixMonitor','recordingFormat','password','ChanSpy','name','options','join','record','StopMixMonitor','length','concat','findAll','internal','agent','then','catch'];(function(_0x12e68b,_0x12cd3e){var _0x377a9d=function(_0x1c4ded){while(--_0x1c4ded){_0x12e68b['push'](_0x12e68b['shift']());}};_0x377a9d(++_0x12cd3e);}(_0xd461,0xcd));var _0x1d46=function(_0x3f4018,_0x1a98f0){_0x3f4018=_0x3f4018-0x0;var _0x3a7324=_0xd461[_0x3f4018];return _0x3a7324;};'use strict';var _=require(_0x1d46('0x0'));var util=require(_0x1d46('0x1'));var BPromise=require('bluebird');var logger=require(_0x1d46('0x2'))(_0x1d46('0x3'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x2bcca8,_0x5c41dd,_0x3ed3cd){var _0x5260e6=0x1;var _0x49ef4b=[];var _0x1918d9={'context':_0x1d46('0x4'),'type':_0x1d46('0x5'),'isApp':![]};var _0x434e3f={'exten':util[_0x1d46('0x6')]('%s%s',_0x2bcca8['prefix'],_0x3ed3cd),'ChanSpyId':_0x2bcca8['id'],'UserId':_0x5c41dd['id']};_0x49ef4b[_0x1d46('0x7')](_[_0x1d46('0x8')]({'app':_0x1d46('0x9'),'appdata':util[_0x1d46('0x6')]('CDR(type)=%s','chanspy'),'priority':_0x5260e6++},_0x1918d9,_0x434e3f));if(_0x2bcca8['record']){_0x49ef4b[_0x1d46('0x7')](_[_0x1d46('0x8')]({'app':_0x1d46('0xa'),'appdata':util[_0x1d46('0x6')]('${UNIQUEID}.%s,ab',_0x2bcca8[_0x1d46('0xb')]),'priority':_0x5260e6++},_0x1918d9,_0x434e3f));}if(_0x2bcca8['auth']){_0x49ef4b[_0x1d46('0x7')](_[_0x1d46('0x8')]({'app':'Authenticate','appdata':_0x2bcca8[_0x1d46('0xc')],'priority':_0x5260e6++},_0x1918d9,_0x434e3f));}_0x49ef4b['push'](_['merge']({'app':_0x1d46('0xd'),'appdata':util[_0x1d46('0x6')]('SIP/%s,%s',_0x5c41dd[_0x1d46('0xe')],_0x2bcca8[_0x1d46('0xf')]?_0x2bcca8[_0x1d46('0xf')][_0x1d46('0x10')](''):''),'priority':_0x5260e6++},_0x1918d9,_0x434e3f));if(_0x2bcca8[_0x1d46('0x11')]){_0x49ef4b[_0x1d46('0x7')](_[_0x1d46('0x8')]({'app':_0x1d46('0x12'),'priority':_0x5260e6++},_0x1918d9,_0x434e3f));}return _0x49ef4b;};var getChanSpyApplications=function(_0x5c8219,_0x135f96){var _0x319494=[];for(var _0x1aa816=0x0,_0x2b81a5=0x1;_0x1aa816<_0x135f96[_0x1d46('0x13')];_0x1aa816++,_0x2b81a5=0x1){var _0x3c4a7f=getUserApplications(_0x5c8219,_0x135f96[_0x1aa816],_0x135f96[_0x1aa816]['internal']);var _0xf621f1=getUserApplications(_0x5c8219,_0x135f96[_0x1aa816],_0x135f96[_0x1aa816]['name']);_0x319494=_0x319494[_0x1d46('0x14')](_0x3c4a7f,_0xf621f1);}return _0x319494;};var getChanSpyPromise=function(_0x52f688,_0x4ed651){return new BPromise(function(_0x5ed265,_0x54cc6c){return _0x52f688['User'][_0x1d46('0x15')]({'attributes':['id',_0x1d46('0xe'),_0x1d46('0x16')],'where':{'role':_0x1d46('0x17'),'chanspy':!![]},'raw':!![]})[_0x1d46('0x18')](function(_0x44f3e6){if(_0x44f3e6){return _0x5ed265(getChanSpyApplications(_0x4ed651,_0x44f3e6));}return _0x5ed265([]);})[_0x1d46('0x19')](function(_0x321ce0){_0x54cc6c(_0x321ce0);});});};module[_0x1d46('0x1a')]=function(_0x27a383,_0x516b76){var _0x4ec6b6=_0x27a383[_0x1d46('0x1b')];return _0x27a383[_0x1d46('0x1c')]('VoiceChanSpy',attributes,{'tableName':_0x1d46('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a6e43,_0x42a887,_0x51df0a){return getChanSpyPromise(_0x4ec6b6,_0x2a6e43)[_0x1d46('0x18')](function(_0x56b585){if(_0x56b585&&_0x56b585[_0x1d46('0x13')]){return _0x4ec6b6['VoiceExtension'][_0x1d46('0x1e')](_0x56b585);}})['then'](function(){_0x51df0a();})[_0x1d46('0x19')](function(_0x159b07){_0x51df0a(_0x159b07);});},'afterUpdate':function(_0x1b0b3f,_0x18fdc0,_0x484fca){return _0x4ec6b6[_0x1d46('0x1f')][_0x1d46('0x20')]({'where':{'ChanSpyId':_0x1b0b3f['id']}})['then'](function(){return getChanSpyPromise(_0x4ec6b6,_0x1b0b3f);})[_0x1d46('0x18')](function(_0xec38c1){if(_0xec38c1&&_0xec38c1[_0x1d46('0x13')]){return _0x4ec6b6[_0x1d46('0x1f')][_0x1d46('0x1e')](_0xec38c1);}})[_0x1d46('0x18')](function(){_0x484fca();})[_0x1d46('0x19')](function(_0x11ccae){_0x484fca(_0x11ccae);});},'afterDestroy':function(_0x53e78a,_0x13031b,_0x346795){return _0x4ec6b6[_0x1d46('0x1f')][_0x1d46('0x20')]({'where':{'ChanSpyId':_0x53e78a['id']}})['then'](function(){_0x346795();})[_0x1d46('0x19')](function(_0x538b4f){_0x346795(_0x538b4f);});}}});}; \ No newline at end of file +var _0xd6e9=['recordingFormat','auth','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','internal','findAll','agent','then','exports','models','define','VoiceChanSpy','length','VoiceExtension','bulkCreate','catch','destroy','util','bluebird','./voiceChanSpy.attributes','from-sip','system','%s%s','prefix','push','merge','Set','format','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab'];(function(_0x419bcd,_0x34ef80){var _0x1f96db=function(_0x1c886f){while(--_0x1c886f){_0x419bcd['push'](_0x419bcd['shift']());}};_0x1f96db(++_0x34ef80);}(_0xd6e9,0x88));var _0x9d6e=function(_0x50bb3c,_0x36e308){_0x50bb3c=_0x50bb3c-0x0;var _0x121de3=_0xd6e9[_0x50bb3c];return _0x121de3;};'use strict';var _=require('lodash');var util=require(_0x9d6e('0x0'));var BPromise=require(_0x9d6e('0x1'));var logger=require('../../config/logger')('api');var attributes=require(_0x9d6e('0x2'));var getUserApplications=function(_0x51c007,_0x524ec2,_0x5b380e){var _0xe754f2=0x1;var _0x1fa0ef=[];var _0x1d9f3c={'context':_0x9d6e('0x3'),'type':_0x9d6e('0x4'),'isApp':![]};var _0x412d84={'exten':util['format'](_0x9d6e('0x5'),_0x51c007[_0x9d6e('0x6')],_0x5b380e),'ChanSpyId':_0x51c007['id'],'UserId':_0x524ec2['id']};_0x1fa0ef[_0x9d6e('0x7')](_[_0x9d6e('0x8')]({'app':_0x9d6e('0x9'),'appdata':util[_0x9d6e('0xa')](_0x9d6e('0xb'),_0x9d6e('0xc')),'priority':_0xe754f2++},_0x1d9f3c,_0x412d84));if(_0x51c007[_0x9d6e('0xd')]){_0x1fa0ef[_0x9d6e('0x7')](_['merge']({'app':_0x9d6e('0xe'),'appdata':util[_0x9d6e('0xa')](_0x9d6e('0xf'),_0x51c007[_0x9d6e('0x10')]),'priority':_0xe754f2++},_0x1d9f3c,_0x412d84));}if(_0x51c007[_0x9d6e('0x11')]){_0x1fa0ef[_0x9d6e('0x7')](_['merge']({'app':'Authenticate','appdata':_0x51c007[_0x9d6e('0x12')],'priority':_0xe754f2++},_0x1d9f3c,_0x412d84));}_0x1fa0ef['push'](_[_0x9d6e('0x8')]({'app':_0x9d6e('0x13'),'appdata':util['format'](_0x9d6e('0x14'),_0x524ec2[_0x9d6e('0x15')],_0x51c007[_0x9d6e('0x16')]?_0x51c007['options'][_0x9d6e('0x17')](''):''),'priority':_0xe754f2++},_0x1d9f3c,_0x412d84));if(_0x51c007[_0x9d6e('0xd')]){_0x1fa0ef[_0x9d6e('0x7')](_[_0x9d6e('0x8')]({'app':_0x9d6e('0x18'),'priority':_0xe754f2++},_0x1d9f3c,_0x412d84));}return _0x1fa0ef;};var getChanSpyApplications=function(_0x1805e5,_0x1c410c){var _0x5bd751=[];for(var _0x4e6b7c=0x0,_0x18c24b=0x1;_0x4e6b7c<_0x1c410c['length'];_0x4e6b7c++,_0x18c24b=0x1){var _0x451aa2=getUserApplications(_0x1805e5,_0x1c410c[_0x4e6b7c],_0x1c410c[_0x4e6b7c][_0x9d6e('0x19')]);var _0x27f777=getUserApplications(_0x1805e5,_0x1c410c[_0x4e6b7c],_0x1c410c[_0x4e6b7c][_0x9d6e('0x15')]);_0x5bd751=_0x5bd751['concat'](_0x451aa2,_0x27f777);}return _0x5bd751;};var getChanSpyPromise=function(_0x489f36,_0x4a494f){return new BPromise(function(_0x58a586,_0x34e837){return _0x489f36['User'][_0x9d6e('0x1a')]({'attributes':['id',_0x9d6e('0x15'),_0x9d6e('0x19')],'where':{'role':_0x9d6e('0x1b'),'chanspy':!![]},'raw':!![]})[_0x9d6e('0x1c')](function(_0x2aa16e){if(_0x2aa16e){return _0x58a586(getChanSpyApplications(_0x4a494f,_0x2aa16e));}return _0x58a586([]);})['catch'](function(_0x5e471f){_0x34e837(_0x5e471f);});});};module[_0x9d6e('0x1d')]=function(_0x527d03,_0x2d7455){var _0x19968b=_0x527d03[_0x9d6e('0x1e')];return _0x527d03[_0x9d6e('0x1f')](_0x9d6e('0x20'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x24bf05,_0x2b999f,_0x3df6c0){return getChanSpyPromise(_0x19968b,_0x24bf05)[_0x9d6e('0x1c')](function(_0x56d0a8){if(_0x56d0a8&&_0x56d0a8[_0x9d6e('0x21')]){return _0x19968b[_0x9d6e('0x22')][_0x9d6e('0x23')](_0x56d0a8);}})[_0x9d6e('0x1c')](function(){_0x3df6c0();})[_0x9d6e('0x24')](function(_0x8abaaa){_0x3df6c0(_0x8abaaa);});},'afterUpdate':function(_0x2cf473,_0x4fe649,_0xb7043d){return _0x19968b['VoiceExtension'][_0x9d6e('0x25')]({'where':{'ChanSpyId':_0x2cf473['id']}})[_0x9d6e('0x1c')](function(){return getChanSpyPromise(_0x19968b,_0x2cf473);})[_0x9d6e('0x1c')](function(_0x3f060f){if(_0x3f060f&&_0x3f060f[_0x9d6e('0x21')]){return _0x19968b[_0x9d6e('0x22')][_0x9d6e('0x23')](_0x3f060f);}})['then'](function(){_0xb7043d();})['catch'](function(_0xd3408a){_0xb7043d(_0xd3408a);});},'afterDestroy':function(_0x3be76a,_0x33ae82,_0x6f15bd){return _0x19968b[_0x9d6e('0x22')][_0x9d6e('0x25')]({'where':{'ChanSpyId':_0x3be76a['id']}})[_0x9d6e('0x1c')](function(){_0x6f15bd();})[_0x9d6e('0x24')](function(_0x498479){_0x6f15bd(_0x498479);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 7390838..3a6fe41 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 _0xef4c=['code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5d3e4d,_0x7fa5cc){var _0x4e430b=function(_0x4bc90d){while(--_0x4bc90d){_0x5d3e4d['push'](_0x5d3e4d['shift']());}};_0x4e430b(++_0x7fa5cc);}(_0xef4c,0xd5));var _0xcef4=function(_0x15b09a,_0xc0c535){_0x15b09a=_0x15b09a-0x0;var _0x28bd3f=_0xef4c[_0x15b09a];return _0x28bd3f;};'use strict';var _=require('lodash');var util=require(_0xcef4('0x0'));var moment=require(_0xcef4('0x1'));var BPromise=require(_0xcef4('0x2'));var rs=require(_0xcef4('0x3'));var fs=require('fs');var Redis=require(_0xcef4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcef4('0x5'));var logger=require(_0xcef4('0x6'))(_0xcef4('0x7'));var config=require(_0xcef4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcef4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52dec9,_0x43dc6b,_0x5975c2){return new BPromise(function(_0x2c76d5,_0x376191){return client[_0xcef4('0xa')](_0x52dec9,_0x5975c2)['then'](function(_0x4b7698){logger[_0xcef4('0xb')](_0xcef4('0xc'),_0x43dc6b,'request\x20sent');logger[_0xcef4('0xd')](_0xcef4('0xe'),_0x43dc6b,_0xcef4('0xf'),JSON[_0xcef4('0x10')](_0x4b7698));if(_0x4b7698[_0xcef4('0x11')]){if(_0x4b7698[_0xcef4('0x11')][_0xcef4('0x12')]===0x1f4){logger[_0xcef4('0x11')](_0xcef4('0xc'),_0x43dc6b,_0x4b7698[_0xcef4('0x11')][_0xcef4('0x13')]);return _0x376191(_0x4b7698['error'][_0xcef4('0x13')]);}logger[_0xcef4('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x43dc6b,_0x4b7698['error']['message']);return _0x2c76d5(_0x4b7698['error'][_0xcef4('0x13')]);}else{logger[_0xcef4('0xb')](_0xcef4('0xc'),_0x43dc6b,_0xcef4('0xf'));_0x2c76d5(_0x4b7698[_0xcef4('0x14')][_0xcef4('0x13')]);}})['catch'](function(_0x3a59dc){logger[_0xcef4('0x11')](_0xcef4('0xc'),_0x43dc6b,_0x3a59dc);_0x376191(_0x3a59dc);});});} \ No newline at end of file +var _0xe2d4=['request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','VoiceChanSpy,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','then'];(function(_0x1b2b02,_0x3e3c49){var _0x173b44=function(_0xc70b8d){while(--_0xc70b8d){_0x1b2b02['push'](_0x1b2b02['shift']());}};_0x173b44(++_0x3e3c49);}(_0xe2d4,0xd9));var _0x4e2d=function(_0x32252e,_0x4e18d2){_0x32252e=_0x32252e-0x0;var _0x1dc521=_0xe2d4[_0x32252e];return _0x1dc521;};'use strict';var _=require(_0x4e2d('0x0'));var util=require(_0x4e2d('0x1'));var moment=require(_0x4e2d('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e2d('0x3'));var fs=require('fs');var Redis=require(_0x4e2d('0x4'));var db=require(_0x4e2d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e2d('0x6'))('rpc');var config=require(_0x4e2d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4e2d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x463d66,_0x5ad952,_0x38ec9b){return new BPromise(function(_0xa0ddf0,_0x2f2623){return client[_0x4e2d('0x9')](_0x463d66,_0x38ec9b)[_0x4e2d('0xa')](function(_0x3e5814){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x5ad952,_0x4e2d('0xb'));logger['debug'](_0x4e2d('0xc'),_0x5ad952,'request\x20sent',JSON['stringify'](_0x3e5814));if(_0x3e5814[_0x4e2d('0xd')]){if(_0x3e5814[_0x4e2d('0xd')][_0x4e2d('0xe')]===0x1f4){logger[_0x4e2d('0xd')](_0x4e2d('0xf'),_0x5ad952,_0x3e5814[_0x4e2d('0xd')][_0x4e2d('0x10')]);return _0x2f2623(_0x3e5814[_0x4e2d('0xd')][_0x4e2d('0x10')]);}logger[_0x4e2d('0xd')](_0x4e2d('0xf'),_0x5ad952,_0x3e5814[_0x4e2d('0xd')][_0x4e2d('0x10')]);return _0xa0ddf0(_0x3e5814['error'][_0x4e2d('0x10')]);}else{logger[_0x4e2d('0x11')](_0x4e2d('0xf'),_0x5ad952,_0x4e2d('0xb'));_0xa0ddf0(_0x3e5814['result'][_0x4e2d('0x10')]);}})[_0x4e2d('0x12')](function(_0x162709){logger[_0x4e2d('0xd')](_0x4e2d('0xf'),_0x5ad952,_0x162709);_0x2f2623(_0x162709);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 832a9e4..e0d20f2 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 _0x6d11=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','put','update','destroy','exports','multer','util','path','express'];(function(_0x5c4739,_0x447246){var _0x57e7b6=function(_0x4e8175){while(--_0x4e8175){_0x5c4739['push'](_0x5c4739['shift']());}};_0x57e7b6(++_0x447246);}(_0x6d11,0xbf));var _0x16d1=function(_0x3f1403,_0x2cfd1a){_0x3f1403=_0x3f1403-0x0;var _0xb8103d=_0x6d11[_0x3f1403];return _0xb8103d;};'use strict';var multer=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var path=require(_0x16d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x16d1('0x3'));var router=express['Router']();var auth=require(_0x16d1('0x4'));var interaction=require(_0x16d1('0x5'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0x16d1('0x6')]('/',auth[_0x16d1('0x7')](),controller[_0x16d1('0x8')]);router[_0x16d1('0x6')](_0x16d1('0x9'),auth[_0x16d1('0x7')](),controller[_0x16d1('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x16d1('0xb')](_0x16d1('0x9'),auth[_0x16d1('0x7')](),controller[_0x16d1('0xc')]);router['delete'](_0x16d1('0x9'),auth[_0x16d1('0x7')](),controller[_0x16d1('0xd')]);module[_0x16d1('0xe')]=router; \ No newline at end of file +var _0xbd8e=['show','create','put','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd8e,0x1b5));var _0xebd8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xbd8e[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xebd8('0x0'));var util=require(_0xebd8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xebd8('0x2'));var router=express['Router']();var auth=require(_0xebd8('0x3'));var interaction=require(_0xebd8('0x4'));var config=require(_0xebd8('0x5'));var controller=require(_0xebd8('0x6'));router[_0xebd8('0x7')]('/',auth['isAuthenticated'](),controller[_0xebd8('0x8')]);router[_0xebd8('0x7')](_0xebd8('0x9'),auth[_0xebd8('0xa')](),controller[_0xebd8('0xb')]);router['post']('/',auth[_0xebd8('0xa')](),controller[_0xebd8('0xc')]);router[_0xebd8('0xd')](_0xebd8('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xebd8('0x9'),auth[_0xebd8('0xa')](),controller[_0xebd8('0xe')]);module[_0xebd8('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 3bc35ad..1582290 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 _0xd5c6=['sequelize','STRING','name','BOOLEAN'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0xd5c6,0x194));var _0x6d5c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd5c6[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x6d5c('0x0'));module['exports']={'name':{'type':Sequelize[_0x6d5c('0x1')],'unique':_0x6d5c('0x2')},'description':{'type':Sequelize[_0x6d5c('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x6d5c('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x55af=['STRING','name'];(function(_0x31e682,_0x38fc10){var _0x79641f=function(_0x445810){while(--_0x445810){_0x31e682['push'](_0x31e682['shift']());}};_0x79641f(++_0x38fc10);}(_0x55af,0x10c));var _0xf55a=function(_0x96c6ea,_0x56bfc0){_0x96c6ea=_0x96c6ea-0x0;var _0x1324d5=_0x55af[_0x96c6ea];return _0x1324d5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf55a('0x0')],'unique':_0xf55a('0x1')},'description':{'type':Sequelize[_0xf55a('0x0')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 5be0995..7149ecc 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 _0xa936=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','include','findAll','show','params','includeAll','create','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','body','utf8','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','VoiceContext','keys','query'];(function(_0x18c530,_0x1ef42a){var _0x560b6d=function(_0x56b3c){while(--_0x56b3c){_0x18c530['push'](_0x18c530['shift']());}};_0x560b6d(++_0x1ef42a);}(_0xa936,0x15e));var _0x6a93=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xa936[_0x1b2ff7];return _0x31656a;};'use strict';var pdf=require(_0x6a93('0x0'));var emlformat=require(_0x6a93('0x1'));var rimraf=require(_0x6a93('0x2'));var zipdir=require(_0x6a93('0x3'));var jsonpatch=require(_0x6a93('0x4'));var rp=require('request-promise');var moment=require(_0x6a93('0x5'));var BPromise=require(_0x6a93('0x6'));var Mustache=require(_0x6a93('0x7'));var util=require(_0x6a93('0x8'));var path=require(_0x6a93('0x9'));var sox=require(_0x6a93('0xa'));var csv=require(_0x6a93('0xb'));var ejs=require(_0x6a93('0xc'));var fs=require('fs');var _=require(_0x6a93('0xd'));var squel=require(_0x6a93('0xe'));var crypto=require('crypto');var jsforce=require(_0x6a93('0xf'));var deskjs=require(_0x6a93('0x10'));var toCsv=require(_0x6a93('0xb'));var querystring=require(_0x6a93('0x11'));var Papa=require('papaparse');var authService=require(_0x6a93('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x6a93('0x13'));var qs=require(_0x6a93('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6a93('0x15'));var db=require(_0x6a93('0x16'))['db'];var jayson=require(_0x6a93('0x17'));var client=jayson[_0x6a93('0x18')][_0x6a93('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x38f279,_0x178d12,_0x918708,_0x201ea9){return new BPromise(function(_0x2d4877,_0x3226cb){var _0x27fcaa=_0x201ea9||client;return _0x27fcaa[_0x6a93('0x1a')](_0x38f279,_0x918708)[_0x6a93('0x1b')](function(_0x2fc7c4){logger[_0x6a93('0x1c')](_0x6a93('0x1d'),_0x178d12,_0x6a93('0x1e'));logger[_0x6a93('0x1f')](_0x6a93('0x20'),_0x178d12,_0x6a93('0x1e'),JSON[_0x6a93('0x21')](_0x2fc7c4));if(_0x2fc7c4[_0x6a93('0x22')]){if(_0x2fc7c4[_0x6a93('0x22')]['code']===0x1f4){logger[_0x6a93('0x22')](_0x6a93('0x1d'),_0x178d12,_0x2fc7c4['error'][_0x6a93('0x23')]);return _0x3226cb(_0x2fc7c4[_0x6a93('0x22')]['message']);}logger[_0x6a93('0x22')](_0x6a93('0x1d'),_0x178d12,_0x2fc7c4['error']['message']);return _0x2d4877(_0x2fc7c4['error'][_0x6a93('0x23')]);}else{logger[_0x6a93('0x1c')](_0x6a93('0x1d'),_0x178d12,_0x6a93('0x1e'));_0x2d4877(_0x2fc7c4['result'][_0x6a93('0x23')]);}})['catch'](function(_0x39c8a9){logger['error'](_0x6a93('0x1d'),_0x178d12,_0x39c8a9);_0x3226cb(_0x39c8a9);});});}function respondWithStatusCode(_0x1c9157,_0x4dc401){_0x4dc401=_0x4dc401||0xcc;return function(_0x17d112){if(_0x17d112){return _0x1c9157[_0x6a93('0x24')](_0x4dc401);}return _0x1c9157[_0x6a93('0x25')](_0x4dc401)['end']();};}function respondWithResult(_0xd9515a,_0x6ef50d){_0x6ef50d=_0x6ef50d||0xc8;return function(_0x8bc0b1){if(_0x8bc0b1){return _0xd9515a['status'](_0x6ef50d)[_0x6a93('0x26')](_0x8bc0b1);}};}function respondWithFilteredResult(_0x52c749,_0x435108){return function(_0x50fafc){if(_0x50fafc){var _0x3bf71b=_0x50fafc[_0x6a93('0x27')],_0x4f8c2d=_0x435108[_0x6a93('0x28')],_0x456659=_0x435108['offset']+_0x435108[_0x6a93('0x29')],_0x19e5de;if(_0x456659>=_0x3bf71b){_0x456659=_0x3bf71b;_0x19e5de=0xc8;}else{_0x19e5de=0xce;}_0x52c749[_0x6a93('0x25')](_0x19e5de);return _0x52c749[_0x6a93('0x2a')](_0x6a93('0x2b'),_0x4f8c2d+'-'+_0x456659+'/'+_0x3bf71b)[_0x6a93('0x26')](_0x50fafc);}return null;};}function patchUpdates(_0x23ca58){return function(_0x53303d){try{jsonpatch[_0x6a93('0x2c')](_0x53303d,_0x23ca58,!![]);}catch(_0x973d4f){return BPromise[_0x6a93('0x2d')](_0x973d4f);}return _0x53303d['save']();};}function saveUpdates(_0x4bcb64,_0x5ed604){return function(_0x5f008a){if(_0x5f008a){return _0x5f008a[_0x6a93('0x2e')](_0x4bcb64)['then'](function(_0x242253){return _0x242253;});}return null;};}function removeEntity(_0x3e016b,_0x41c48f){return function(_0x554d89){if(_0x554d89){return _0x554d89[_0x6a93('0x2f')]()[_0x6a93('0x1b')](function(){var _0x1820c6=_0x554d89[_0x6a93('0x30')]({'plain':!![]});var _0x2af4d8=_0x6a93('0x31');return db[_0x6a93('0x32')]['destroy']({'where':{'type':_0x2af4d8,'resourceId':_0x1820c6['id']}})[_0x6a93('0x1b')](function(){return _0x554d89;});})['then'](function(){_0x3e016b[_0x6a93('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x446407,_0x541621){return function(_0x3b8716){if(!_0x3b8716){_0x446407[_0x6a93('0x24')](0x194);}return _0x3b8716;};}function handleError(_0x1946e7,_0x44bee2){_0x44bee2=_0x44bee2||0x1f4;return function(_0x557710){logger[_0x6a93('0x22')](_0x557710[_0x6a93('0x33')]);if(_0x557710[_0x6a93('0x34')]){delete _0x557710[_0x6a93('0x34')];}_0x1946e7['status'](_0x44bee2)[_0x6a93('0x35')](_0x557710);};}exports[_0x6a93('0x36')]=function(_0x59e8ef,_0x57134b){var _0xe3004e={},_0x59bc69={},_0x1eb9be={'count':0x0,'rows':[]};var _0x16d1fe=db[_0x6a93('0x37')]['rawAttributes'];_0x59bc69['model']=_[_0x6a93('0x38')](_0x16d1fe);_0x59bc69[_0x6a93('0x39')]=_[_0x6a93('0x38')](_0x59e8ef[_0x6a93('0x39')]);_0x59bc69[_0x6a93('0x3a')]=_[_0x6a93('0x3b')](_0x59bc69[_0x6a93('0x3c')],_0x59bc69['query']);_0xe3004e[_0x6a93('0x3d')]=_[_0x6a93('0x3b')](_0x59bc69[_0x6a93('0x3c')],qs['fields'](_0x59e8ef[_0x6a93('0x39')][_0x6a93('0x3e')]));_0xe3004e[_0x6a93('0x3d')]=_0xe3004e['attributes'][_0x6a93('0x3f')]?_0xe3004e['attributes']:_0x59bc69[_0x6a93('0x3c')];if(!_0x59e8ef[_0x6a93('0x39')][_0x6a93('0x40')](_0x6a93('0x41'))){_0xe3004e[_0x6a93('0x29')]=qs['limit'](_0x59e8ef[_0x6a93('0x39')]['limit']);_0xe3004e[_0x6a93('0x28')]=qs[_0x6a93('0x28')](_0x59e8ef['query']['offset']);}_0xe3004e[_0x6a93('0x42')]=qs[_0x6a93('0x43')](_0x59e8ef[_0x6a93('0x39')][_0x6a93('0x43')]);_0xe3004e[_0x6a93('0x44')]=qs[_0x6a93('0x3a')](_['pick'](_0x59e8ef[_0x6a93('0x39')],_0x59bc69['filters']));if(_0x59e8ef[_0x6a93('0x39')][_0x6a93('0x45')]){_0xe3004e[_0x6a93('0x44')]=_['merge'](_0xe3004e[_0x6a93('0x44')],{'$or':_[_0x6a93('0x46')](_0x16d1fe,function(_0x5671ad){if(_0x5671ad[_0x6a93('0x47')][_0x6a93('0x48')]!==_0x6a93('0x49')){var _0x464379={};_0x464379[_0x5671ad[_0x6a93('0x4a')]]={'$like':'%'+_0x59e8ef[_0x6a93('0x39')]['filter']+'%'};return _0x464379;}})});}_0xe3004e=_[_0x6a93('0x4b')]({},_0xe3004e,_0x59e8ef[_0x6a93('0x4c')]);var _0x27d4ba={'where':_0xe3004e[_0x6a93('0x44')]};return db[_0x6a93('0x37')]['count'](_0x27d4ba)[_0x6a93('0x1b')](function(_0x4fb4c0){_0x1eb9be[_0x6a93('0x27')]=_0x4fb4c0;if(_0x59e8ef['query']['includeAll']){_0xe3004e[_0x6a93('0x4d')]=[{'all':!![]}];}return db[_0x6a93('0x37')][_0x6a93('0x4e')](_0xe3004e);})[_0x6a93('0x1b')](function(_0x182cdd){_0x1eb9be['rows']=_0x182cdd;return _0x1eb9be;})[_0x6a93('0x1b')](respondWithFilteredResult(_0x57134b,_0xe3004e))['catch'](handleError(_0x57134b,null));};exports[_0x6a93('0x4f')]=function(_0x2f35b8,_0x3e44ef){var _0x5ca42c={'raw':![],'where':{'id':_0x2f35b8[_0x6a93('0x50')]['id']}},_0x5ca0aa={};_0x5ca0aa[_0x6a93('0x3c')]=_['keys'](db['VoiceContext']['rawAttributes']);_0x5ca0aa[_0x6a93('0x39')]=_[_0x6a93('0x38')](_0x2f35b8['query']);_0x5ca0aa[_0x6a93('0x3a')]=_[_0x6a93('0x3b')](_0x5ca0aa['model'],_0x5ca0aa[_0x6a93('0x39')]);_0x5ca42c['attributes']=_[_0x6a93('0x3b')](_0x5ca0aa[_0x6a93('0x3c')],qs[_0x6a93('0x3e')](_0x2f35b8[_0x6a93('0x39')][_0x6a93('0x3e')]));_0x5ca42c[_0x6a93('0x3d')]=_0x5ca42c[_0x6a93('0x3d')][_0x6a93('0x3f')]?_0x5ca42c[_0x6a93('0x3d')]:_0x5ca0aa[_0x6a93('0x3c')];if(_0x2f35b8[_0x6a93('0x39')][_0x6a93('0x51')]){_0x5ca42c[_0x6a93('0x4d')]=[{'all':!![]}];}_0x5ca42c=_[_0x6a93('0x4b')]({},_0x5ca42c,_0x2f35b8[_0x6a93('0x4c')]);return db[_0x6a93('0x37')]['find'](_0x5ca42c)[_0x6a93('0x1b')](handleEntityNotFound(_0x3e44ef,null))['then'](respondWithResult(_0x3e44ef,null))['catch'](handleError(_0x3e44ef,null));};exports[_0x6a93('0x52')]=function(_0x47216b,_0x5bffdd,_0x1ea2de){var _0x5de768;return db['VoiceContext']['create'](_0x47216b['body'],{'raw':!![]})['then'](function(_0x38f1c1){_0x5de768=_0x38f1c1;return db[_0x6a93('0x37')][_0x6a93('0x4e')]({'raw':!![]});})[_0x6a93('0x1b')](function(_0x3c2153){var _0x116e46=fs[_0x6a93('0x53')](path[_0x6a93('0x54')](config[_0x6a93('0x55')],_0x6a93('0x56')),'utf8');var _0x6b982=ejs[_0x6a93('0x57')](_0x116e46,{'contexts':_0x3c2153||[]});fs[_0x6a93('0x58')](_0x6a93('0x59'),_0x6b982);})[_0x6a93('0x1b')](function(){return respondWithRpcPromise(_0x6a93('0x5a'),'create',{'module':_0x6a93('0x5b')});})[_0x6a93('0x1b')](function(){var _0x3c9595=_0x47216b[_0x6a93('0x5c')][_0x6a93('0x30')]({'plain':!![]});if(!_0x3c9595)throw new Error(_0x6a93('0x5d'));if(_0x3c9595[_0x6a93('0x5e')]===_0x6a93('0x5c')){var _0x444afd=_0x5de768[_0x6a93('0x30')]({'plain':!![]});return db[_0x6a93('0x5f')][_0x6a93('0x60')]({'where':{'name':_0x6a93('0x31'),'userProfileId':_0x3c9595['userProfileId']},'raw':!![]})[_0x6a93('0x1b')](function(_0x5de36e){if(_0x5de36e&&_0x5de36e[_0x6a93('0x61')]===0x0){return db[_0x6a93('0x32')]['create']({'name':_0x444afd[_0x6a93('0x34')],'resourceId':_0x444afd['id'],'type':_0x5de36e[_0x6a93('0x34')],'sectionId':_0x5de36e['id']},{})[_0x6a93('0x1b')](function(){return _0x5de768;});}else{return _0x5de768;}})['catch'](function(_0x3f285f){logger[_0x6a93('0x22')](_0x6a93('0x62'),_0x3f285f);throw _0x3f285f;});}return _0x5de768;})[_0x6a93('0x1b')](respondWithResult(_0x5bffdd,0xc9))[_0x6a93('0x63')](handleError(_0x5bffdd,null));};exports[_0x6a93('0x2e')]=function(_0x421f8e,_0x43fffa,_0x56c7a5){var _0x1df445;return db['VoiceContext'][_0x6a93('0x60')]({'where':{'id':_0x421f8e[_0x6a93('0x50')]['id']}})[_0x6a93('0x1b')](handleEntityNotFound(_0x43fffa,null))[_0x6a93('0x1b')](saveUpdates(_0x421f8e[_0x6a93('0x64')],null))['then'](function(_0x4453ad){if(_0x4453ad){_0x1df445=_0x4453ad;return db[_0x6a93('0x37')][_0x6a93('0x4e')]({'raw':!![]});}})['then'](function(_0x49672a){var _0x41d91d=fs[_0x6a93('0x53')](path['join'](config[_0x6a93('0x55')],_0x6a93('0x56')),_0x6a93('0x65'));var _0x277af8=ejs[_0x6a93('0x57')](_0x41d91d,{'contexts':_0x49672a||[]});fs[_0x6a93('0x58')](_0x6a93('0x59'),_0x277af8);})[_0x6a93('0x1b')](function(){return respondWithRpcPromise(_0x6a93('0x5a'),_0x6a93('0x2e'),{'module':_0x6a93('0x5b')});})[_0x6a93('0x1b')](function(){return _0x1df445;})[_0x6a93('0x1b')](respondWithResult(_0x43fffa,null))['catch'](handleError(_0x43fffa,null));};exports[_0x6a93('0x2f')]=function(_0x4b6c36,_0x4e1e95,_0x495411){var _0x9d0417;return db[_0x6a93('0x37')]['find']({'where':{'id':_0x4b6c36['params']['id']}})['then'](handleEntityNotFound(_0x4e1e95,null))[_0x6a93('0x1b')](removeEntity(_0x4e1e95,null))['then'](function(){return db['VoiceContext'][_0x6a93('0x4e')]({'raw':!![]});})[_0x6a93('0x1b')](function(_0x1cf961){var _0x1809c2=fs[_0x6a93('0x53')](path['join'](config[_0x6a93('0x55')],_0x6a93('0x56')),_0x6a93('0x65'));var _0x7c9172=ejs[_0x6a93('0x57')](_0x1809c2,{'contexts':_0x1cf961});fs[_0x6a93('0x58')](_0x6a93('0x59'),_0x7c9172);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});})[_0x6a93('0x63')](handleError(_0x4e1e95,null));}; \ No newline at end of file +var _0x53f8=['rows','show','params','VoiceContext','length','options','find','create','body','readFileSync','join','root','utf8','writeFileSync','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','json','count','offset','limit','set','Content-Range','reject','destroy','get','Contexts','UserProfileResource','status','stack','name','send','rawAttributes','model','keys','query','attributes','intersection','fields','nolimit','sort','where','filters','pick','merge','map','type','key','field','filter','includeAll','include','findAll'];(function(_0x4341cf,_0x171f57){var _0xccbbdf=function(_0x4a1858){while(--_0x4a1858){_0x4341cf['push'](_0x4341cf['shift']());}};_0xccbbdf(++_0x171f57);}(_0x53f8,0x7a));var _0x853f=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x53f8[_0x20c9b2];return _0x2c6030;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x853f('0x0'));var rimraf=require(_0x853f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x853f('0x2'));var rp=require(_0x853f('0x3'));var moment=require('moment');var BPromise=require(_0x853f('0x4'));var Mustache=require(_0x853f('0x5'));var util=require(_0x853f('0x6'));var path=require(_0x853f('0x7'));var sox=require('sox');var csv=require(_0x853f('0x8'));var ejs=require(_0x853f('0x9'));var fs=require('fs');var _=require(_0x853f('0xa'));var squel=require(_0x853f('0xb'));var crypto=require('crypto');var jsforce=require(_0x853f('0xc'));var deskjs=require(_0x853f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x853f('0xe'));var Papa=require(_0x853f('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x853f('0x10'));var Redis=require('ioredis');var qs=require(_0x853f('0x11'));var logger=require(_0x853f('0x12'))(_0x853f('0x13'));var utils=require(_0x853f('0x14'));var config=require(_0x853f('0x15'));var db=require(_0x853f('0x16'))['db'];var jayson=require(_0x853f('0x17'));var client=jayson['client'][_0x853f('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x500c8b,_0x20e3a3,_0x22705a,_0x202741){return new BPromise(function(_0x42a03d,_0x362d59){var _0x3f90c0=_0x202741||client;return _0x3f90c0['request'](_0x500c8b,_0x22705a)[_0x853f('0x19')](function(_0x8e8d9e){logger[_0x853f('0x1a')](_0x853f('0x1b'),_0x20e3a3,_0x853f('0x1c'));logger[_0x853f('0x1d')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x20e3a3,'request\x20sent',JSON[_0x853f('0x1e')](_0x8e8d9e));if(_0x8e8d9e[_0x853f('0x1f')]){if(_0x8e8d9e['error'][_0x853f('0x20')]===0x1f4){logger[_0x853f('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x20e3a3,_0x8e8d9e['error'][_0x853f('0x21')]);return _0x362d59(_0x8e8d9e[_0x853f('0x1f')][_0x853f('0x21')]);}logger[_0x853f('0x1f')](_0x853f('0x1b'),_0x20e3a3,_0x8e8d9e[_0x853f('0x1f')][_0x853f('0x21')]);return _0x42a03d(_0x8e8d9e['error'][_0x853f('0x21')]);}else{logger[_0x853f('0x1a')](_0x853f('0x1b'),_0x20e3a3,_0x853f('0x1c'));_0x42a03d(_0x8e8d9e[_0x853f('0x22')]['message']);}})[_0x853f('0x23')](function(_0x42469f){logger[_0x853f('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x20e3a3,_0x42469f);_0x362d59(_0x42469f);});});}function respondWithStatusCode(_0x46eec6,_0x202308){_0x202308=_0x202308||0xcc;return function(_0x63d0e7){if(_0x63d0e7){return _0x46eec6[_0x853f('0x24')](_0x202308);}return _0x46eec6['status'](_0x202308)[_0x853f('0x25')]();};}function respondWithResult(_0x38c4ba,_0x49a3a4){_0x49a3a4=_0x49a3a4||0xc8;return function(_0x2df4d8){if(_0x2df4d8){return _0x38c4ba['status'](_0x49a3a4)[_0x853f('0x26')](_0x2df4d8);}};}function respondWithFilteredResult(_0x409dab,_0x20ae1f){return function(_0x31a5e5){if(_0x31a5e5){var _0x3b75ae=_0x31a5e5[_0x853f('0x27')],_0x5cdd3b=_0x20ae1f[_0x853f('0x28')],_0x37d047=_0x20ae1f[_0x853f('0x28')]+_0x20ae1f[_0x853f('0x29')],_0x13f796;if(_0x37d047>=_0x3b75ae){_0x37d047=_0x3b75ae;_0x13f796=0xc8;}else{_0x13f796=0xce;}_0x409dab['status'](_0x13f796);return _0x409dab[_0x853f('0x2a')](_0x853f('0x2b'),_0x5cdd3b+'-'+_0x37d047+'/'+_0x3b75ae)[_0x853f('0x26')](_0x31a5e5);}return null;};}function patchUpdates(_0x3b9012){return function(_0x337407){try{jsonpatch['apply'](_0x337407,_0x3b9012,!![]);}catch(_0xdd136f){return BPromise[_0x853f('0x2c')](_0xdd136f);}return _0x337407['save']();};}function saveUpdates(_0x4d6d56,_0x5b74b0){return function(_0x20b27a){if(_0x20b27a){return _0x20b27a['update'](_0x4d6d56)[_0x853f('0x19')](function(_0x4d8c2d){return _0x4d8c2d;});}return null;};}function removeEntity(_0x251217,_0x287858){return function(_0x17b283){if(_0x17b283){return _0x17b283[_0x853f('0x2d')]()[_0x853f('0x19')](function(){var _0x2c1ee2=_0x17b283[_0x853f('0x2e')]({'plain':!![]});var _0x45a034=_0x853f('0x2f');return db[_0x853f('0x30')][_0x853f('0x2d')]({'where':{'type':_0x45a034,'resourceId':_0x2c1ee2['id']}})[_0x853f('0x19')](function(){return _0x17b283;});})['then'](function(){_0x251217[_0x853f('0x31')](0xcc)[_0x853f('0x25')]();});}};}function handleEntityNotFound(_0x27562c,_0x247d8c){return function(_0xd9cb44){if(!_0xd9cb44){_0x27562c['sendStatus'](0x194);}return _0xd9cb44;};}function handleError(_0x29a6cc,_0x3a204a){_0x3a204a=_0x3a204a||0x1f4;return function(_0x1aede8){logger[_0x853f('0x1f')](_0x1aede8[_0x853f('0x32')]);if(_0x1aede8[_0x853f('0x33')]){delete _0x1aede8['name'];}_0x29a6cc[_0x853f('0x31')](_0x3a204a)[_0x853f('0x34')](_0x1aede8);};}exports['index']=function(_0xe756b9,_0x1b0591){var _0x856040={},_0x4dd507={},_0x46924a={'count':0x0,'rows':[]};var _0x340392=db['VoiceContext'][_0x853f('0x35')];_0x4dd507[_0x853f('0x36')]=_['keys'](_0x340392);_0x4dd507['query']=_[_0x853f('0x37')](_0xe756b9['query']);_0x4dd507['filters']=_['intersection'](_0x4dd507['model'],_0x4dd507[_0x853f('0x38')]);_0x856040[_0x853f('0x39')]=_[_0x853f('0x3a')](_0x4dd507['model'],qs[_0x853f('0x3b')](_0xe756b9['query'][_0x853f('0x3b')]));_0x856040['attributes']=_0x856040['attributes']['length']?_0x856040[_0x853f('0x39')]:_0x4dd507[_0x853f('0x36')];if(!_0xe756b9[_0x853f('0x38')]['hasOwnProperty'](_0x853f('0x3c'))){_0x856040['limit']=qs[_0x853f('0x29')](_0xe756b9[_0x853f('0x38')][_0x853f('0x29')]);_0x856040[_0x853f('0x28')]=qs[_0x853f('0x28')](_0xe756b9[_0x853f('0x38')][_0x853f('0x28')]);}_0x856040['order']=qs['sort'](_0xe756b9[_0x853f('0x38')][_0x853f('0x3d')]);_0x856040[_0x853f('0x3e')]=qs[_0x853f('0x3f')](_[_0x853f('0x40')](_0xe756b9[_0x853f('0x38')],_0x4dd507[_0x853f('0x3f')]));if(_0xe756b9['query']['filter']){_0x856040[_0x853f('0x3e')]=_[_0x853f('0x41')](_0x856040['where'],{'$or':_[_0x853f('0x42')](_0x340392,function(_0x2e0090){if(_0x2e0090[_0x853f('0x43')][_0x853f('0x44')]!=='VIRTUAL'){var _0x5c955e={};_0x5c955e[_0x2e0090[_0x853f('0x45')]]={'$like':'%'+_0xe756b9[_0x853f('0x38')][_0x853f('0x46')]+'%'};return _0x5c955e;}})});}_0x856040=_['merge']({},_0x856040,_0xe756b9['options']);var _0x39b65e={'where':_0x856040[_0x853f('0x3e')]};return db['VoiceContext'][_0x853f('0x27')](_0x39b65e)['then'](function(_0x1bc906){_0x46924a[_0x853f('0x27')]=_0x1bc906;if(_0xe756b9['query'][_0x853f('0x47')]){_0x856040[_0x853f('0x48')]=[{'all':!![]}];}return db['VoiceContext'][_0x853f('0x49')](_0x856040);})[_0x853f('0x19')](function(_0x448e75){_0x46924a[_0x853f('0x4a')]=_0x448e75;return _0x46924a;})[_0x853f('0x19')](respondWithFilteredResult(_0x1b0591,_0x856040))['catch'](handleError(_0x1b0591,null));};exports[_0x853f('0x4b')]=function(_0x42f7dc,_0xf895a5){var _0x4bae0e={'raw':![],'where':{'id':_0x42f7dc[_0x853f('0x4c')]['id']}},_0x46fe1f={};_0x46fe1f[_0x853f('0x36')]=_[_0x853f('0x37')](db[_0x853f('0x4d')][_0x853f('0x35')]);_0x46fe1f[_0x853f('0x38')]=_[_0x853f('0x37')](_0x42f7dc[_0x853f('0x38')]);_0x46fe1f[_0x853f('0x3f')]=_[_0x853f('0x3a')](_0x46fe1f['model'],_0x46fe1f['query']);_0x4bae0e[_0x853f('0x39')]=_[_0x853f('0x3a')](_0x46fe1f[_0x853f('0x36')],qs['fields'](_0x42f7dc['query']['fields']));_0x4bae0e[_0x853f('0x39')]=_0x4bae0e[_0x853f('0x39')][_0x853f('0x4e')]?_0x4bae0e[_0x853f('0x39')]:_0x46fe1f[_0x853f('0x36')];if(_0x42f7dc['query']['includeAll']){_0x4bae0e['include']=[{'all':!![]}];}_0x4bae0e=_['merge']({},_0x4bae0e,_0x42f7dc[_0x853f('0x4f')]);return db[_0x853f('0x4d')][_0x853f('0x50')](_0x4bae0e)[_0x853f('0x19')](handleEntityNotFound(_0xf895a5,null))[_0x853f('0x19')](respondWithResult(_0xf895a5,null))['catch'](handleError(_0xf895a5,null));};exports[_0x853f('0x51')]=function(_0x5924d8,_0x18de4a,_0xe32c90){var _0x4836f8;return db[_0x853f('0x4d')][_0x853f('0x51')](_0x5924d8[_0x853f('0x52')],{'raw':!![]})[_0x853f('0x19')](function(_0x5b8449){_0x4836f8=_0x5b8449;return db[_0x853f('0x4d')][_0x853f('0x49')]({'raw':!![]});})['then'](function(_0x51f290){var _0x31f50b=fs[_0x853f('0x53')](path[_0x853f('0x54')](config[_0x853f('0x55')],'server/files/templates/context.ejs'),_0x853f('0x56'));var _0x5d9070=ejs['render'](_0x31f50b,{'contexts':_0x51f290||[]});fs[_0x853f('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5d9070);})['then'](function(){return respondWithRpcPromise(_0x853f('0x58'),_0x853f('0x51'),{'module':_0x853f('0x59')});})[_0x853f('0x19')](function(){var _0x39fa07=_0x5924d8['user']['get']({'plain':!![]});if(!_0x39fa07)throw new Error(_0x853f('0x5a'));if(_0x39fa07['role']==='user'){var _0x2435c6=_0x4836f8[_0x853f('0x2e')]({'plain':!![]});return db[_0x853f('0x5b')][_0x853f('0x50')]({'where':{'name':_0x853f('0x2f'),'userProfileId':_0x39fa07[_0x853f('0x5c')]},'raw':!![]})[_0x853f('0x19')](function(_0x13d41f){if(_0x13d41f&&_0x13d41f['autoAssociation']===0x0){return db[_0x853f('0x30')][_0x853f('0x51')]({'name':_0x2435c6[_0x853f('0x33')],'resourceId':_0x2435c6['id'],'type':_0x13d41f[_0x853f('0x33')],'sectionId':_0x13d41f['id']},{})[_0x853f('0x19')](function(){return _0x4836f8;});}else{return _0x4836f8;}})[_0x853f('0x23')](function(_0x3adc46){logger[_0x853f('0x1f')](_0x853f('0x5d'),_0x3adc46);throw _0x3adc46;});}return _0x4836f8;})['then'](respondWithResult(_0x18de4a,0xc9))[_0x853f('0x23')](handleError(_0x18de4a,null));};exports[_0x853f('0x5e')]=function(_0x271279,_0x563361,_0xa02598){var _0x2ef70f;return db['VoiceContext'][_0x853f('0x50')]({'where':{'id':_0x271279[_0x853f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x563361,null))[_0x853f('0x19')](saveUpdates(_0x271279[_0x853f('0x52')],null))[_0x853f('0x19')](function(_0x539a7f){if(_0x539a7f){_0x2ef70f=_0x539a7f;return db[_0x853f('0x4d')][_0x853f('0x49')]({'raw':!![]});}})[_0x853f('0x19')](function(_0x354136){var _0x56d8d4=fs[_0x853f('0x53')](path[_0x853f('0x54')](config['root'],_0x853f('0x5f')),'utf8');var _0x7d2919=ejs[_0x853f('0x60')](_0x56d8d4,{'contexts':_0x354136||[]});fs[_0x853f('0x57')](_0x853f('0x61'),_0x7d2919);})['then'](function(){return respondWithRpcPromise(_0x853f('0x58'),_0x853f('0x5e'),{'module':_0x853f('0x59')});})['then'](function(){return _0x2ef70f;})[_0x853f('0x19')](respondWithResult(_0x563361,null))[_0x853f('0x23')](handleError(_0x563361,null));};exports[_0x853f('0x2d')]=function(_0x114791,_0x43ee3b,_0x38206b){var _0x3358e0;return db[_0x853f('0x4d')][_0x853f('0x50')]({'where':{'id':_0x114791[_0x853f('0x4c')]['id']}})[_0x853f('0x19')](handleEntityNotFound(_0x43ee3b,null))[_0x853f('0x19')](removeEntity(_0x43ee3b,null))['then'](function(){return db[_0x853f('0x4d')][_0x853f('0x49')]({'raw':!![]});})[_0x853f('0x19')](function(_0x12e1d2){var _0x4a21b8=fs[_0x853f('0x53')](path['join'](config[_0x853f('0x55')],_0x853f('0x5f')),'utf8');var _0xdef35f=ejs['render'](_0x4a21b8,{'contexts':_0x12e1d2});fs[_0x853f('0x57')](_0x853f('0x61'),_0xdef35f);return respondWithRpcPromise(_0x853f('0x58'),_0x853f('0x2d'),{'module':_0x853f('0x59')});})[_0x853f('0x23')](handleError(_0x43ee3b,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index e2be416..460b9c9 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 _0xdfb6=['./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','util','../../config/logger','api'];(function(_0x4b2251,_0x393f10){var _0x5d22fb=function(_0x10992c){while(--_0x10992c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5d22fb(++_0x393f10);}(_0xdfb6,0xd5));var _0x6dfb=function(_0x26ba3e,_0x362a6a){_0x26ba3e=_0x26ba3e-0x0;var _0x280eaa=_0xdfb6[_0x26ba3e];return _0x280eaa;};'use strict';var _=require('lodash');var util=require(_0x6dfb('0x0'));var logger=require(_0x6dfb('0x1'))(_0x6dfb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x6dfb('0x3'));module[_0x6dfb('0x4')]=function(_0x567707,_0x1e4f74){return _0x567707[_0x6dfb('0x5')](_0x6dfb('0x6'),attributes,{'tableName':_0x6dfb('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa78=['VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','request-promise','exports'];(function(_0x20efe6,_0x2d6285){var _0x2680c2=function(_0x1c969b){while(--_0x1c969b){_0x20efe6['push'](_0x20efe6['shift']());}};_0x2680c2(++_0x2d6285);}(_0xaa78,0x158));var _0x8aa7=function(_0x4cdcdc,_0x34eac7){_0x4cdcdc=_0x4cdcdc-0x0;var _0x4704ce=_0xaa78[_0x4cdcdc];return _0x4704ce;};'use strict';var _=require(_0x8aa7('0x0'));var util=require(_0x8aa7('0x1'));var logger=require(_0x8aa7('0x2'))(_0x8aa7('0x3'));var moment=require(_0x8aa7('0x4'));var BPromise=require('bluebird');var rp=require(_0x8aa7('0x5'));var attributes=require('./voiceContext.attributes');module[_0x8aa7('0x6')]=function(_0x4065ad,_0xe80611){return _0x4065ad['define'](_0x8aa7('0x7'),attributes,{'tableName':_0x8aa7('0x8'),'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 9f34fc8..b9ab076 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 _0xeac8=['catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result'];(function(_0x12a95b,_0x354b4a){var _0x1d6472=function(_0x40bfab){while(--_0x40bfab){_0x12a95b['push'](_0x12a95b['shift']());}};_0x1d6472(++_0x354b4a);}(_0xeac8,0xf1));var _0x8eac=function(_0x1fa722,_0x3ea18b){_0x1fa722=_0x1fa722-0x0;var _0x1925de=_0xeac8[_0x1fa722];return _0x1925de;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8eac('0x0'));var BPromise=require(_0x8eac('0x1'));var rs=require(_0x8eac('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8eac('0x3'))['db'];var utils=require(_0x8eac('0x4'));var logger=require(_0x8eac('0x5'))(_0x8eac('0x6'));var config=require(_0x8eac('0x7'));var jayson=require(_0x8eac('0x8'));var client=jayson[_0x8eac('0x9')][_0x8eac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42dca5,_0xa57700,_0x1d21a8){return new BPromise(function(_0x469b52,_0x3281f0){return client[_0x8eac('0xb')](_0x42dca5,_0x1d21a8)[_0x8eac('0xc')](function(_0x4eb539){logger[_0x8eac('0xd')]('VoiceContext,\x20%s,\x20%s',_0xa57700,_0x8eac('0xe'));logger[_0x8eac('0xf')](_0x8eac('0x10'),_0xa57700,'request\x20sent',JSON[_0x8eac('0x11')](_0x4eb539));if(_0x4eb539[_0x8eac('0x12')]){if(_0x4eb539[_0x8eac('0x12')][_0x8eac('0x13')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0xa57700,_0x4eb539[_0x8eac('0x12')]['message']);return _0x3281f0(_0x4eb539['error'][_0x8eac('0x14')]);}logger['error'](_0x8eac('0x15'),_0xa57700,_0x4eb539[_0x8eac('0x12')][_0x8eac('0x14')]);return _0x469b52(_0x4eb539[_0x8eac('0x12')]['message']);}else{logger['info'](_0x8eac('0x15'),_0xa57700,_0x8eac('0xe'));_0x469b52(_0x4eb539[_0x8eac('0x16')][_0x8eac('0x14')]);}})[_0x8eac('0x17')](function(_0x27b1c0){logger['error'](_0x8eac('0x15'),_0xa57700,_0x27b1c0);_0x3281f0(_0x27b1c0);});});} \ No newline at end of file +var _0xd133=['http','request','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x50c8e4,_0x5d5a6f){var _0x49911a=function(_0x4f048c){while(--_0x4f048c){_0x50c8e4['push'](_0x50c8e4['shift']());}};_0x49911a(++_0x5d5a6f);}(_0xd133,0x1ef));var _0x3d13=function(_0x239cee,_0xf786c8){_0x239cee=_0x239cee-0x0;var _0x4fe6b6=_0xd133[_0x239cee];return _0x4fe6b6;};'use strict';var _=require(_0x3d13('0x0'));var util=require(_0x3d13('0x1'));var moment=require(_0x3d13('0x2'));var BPromise=require(_0x3d13('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d13('0x4'));var db=require(_0x3d13('0x5'))['db'];var utils=require(_0x3d13('0x6'));var logger=require(_0x3d13('0x7'))(_0x3d13('0x8'));var config=require('../../config/environment');var jayson=require(_0x3d13('0x9'));var client=jayson[_0x3d13('0xa')][_0x3d13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x330bfc,_0x19f5ec,_0x4b68ab){return new BPromise(function(_0x4e92db,_0x94d8df){return client[_0x3d13('0xc')](_0x330bfc,_0x4b68ab)['then'](function(_0x248a98){logger[_0x3d13('0xd')](_0x3d13('0xe'),_0x19f5ec,'request\x20sent');logger['debug'](_0x3d13('0xf'),_0x19f5ec,_0x3d13('0x10'),JSON[_0x3d13('0x11')](_0x248a98));if(_0x248a98[_0x3d13('0x12')]){if(_0x248a98['error'][_0x3d13('0x13')]===0x1f4){logger['error'](_0x3d13('0xe'),_0x19f5ec,_0x248a98[_0x3d13('0x12')]['message']);return _0x94d8df(_0x248a98[_0x3d13('0x12')][_0x3d13('0x14')]);}logger[_0x3d13('0x12')](_0x3d13('0xe'),_0x19f5ec,_0x248a98['error']['message']);return _0x4e92db(_0x248a98['error'][_0x3d13('0x14')]);}else{logger[_0x3d13('0xd')](_0x3d13('0xe'),_0x19f5ec,_0x3d13('0x10'));_0x4e92db(_0x248a98['result'][_0x3d13('0x14')]);}})[_0x3d13('0x15')](function(_0x2f2ba5){logger['error'](_0x3d13('0xe'),_0x19f5ec,_0x2f2ba5);_0x94d8df(_0x2f2ba5);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index dfa21a6..1c9b9ac 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 _0x7afd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','express','Router'];(function(_0x19db15,_0x5c0095){var _0x3d40f2=function(_0x11438b){while(--_0x11438b){_0x19db15['push'](_0x19db15['shift']());}};_0x3d40f2(++_0x5c0095);}(_0x7afd,0x137));var _0xd7af=function(_0x558e1e,_0x3fd803){_0x558e1e=_0x558e1e-0x0;var _0x5ba193=_0x7afd[_0x558e1e];return _0x5ba193;};'use strict';var multer=require(_0xd7af('0x0'));var util=require(_0xd7af('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd7af('0x2'));var router=express[_0xd7af('0x3')]();var auth=require(_0xd7af('0x4'));var interaction=require(_0xd7af('0x5'));var config=require(_0xd7af('0x6'));var controller=require(_0xd7af('0x7'));router[_0xd7af('0x8')]('/',auth['isAuthenticated'](),controller[_0xd7af('0x9')]);router['get'](_0xd7af('0xa'),auth[_0xd7af('0xb')](),controller[_0xd7af('0xc')]);router[_0xd7af('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd7af('0xd')]);router[_0xd7af('0xe')]('/',auth[_0xd7af('0xb')](),controller[_0xd7af('0xf')]);router[_0xd7af('0x10')](_0xd7af('0x11'),auth[_0xd7af('0xb')](),controller['update']);router[_0xd7af('0x12')]('/:id',auth[_0xd7af('0xb')](),controller[_0xd7af('0x13')]);module[_0xd7af('0x14')]=router; \ No newline at end of file +var _0xa37c=['../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa37c,0x163));var _0xca37=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0xa37c[_0x7791d5];return _0x5ce288;};'use strict';var multer=require(_0xca37('0x0'));var util=require(_0xca37('0x1'));var path=require('path');var timeout=require(_0xca37('0x2'));var express=require('express');var router=express[_0xca37('0x3')]();var auth=require(_0xca37('0x4'));var interaction=require(_0xca37('0x5'));var config=require(_0xca37('0x6'));var controller=require(_0xca37('0x7'));router[_0xca37('0x8')]('/',auth[_0xca37('0x9')](),controller['index']);router[_0xca37('0x8')](_0xca37('0xa'),auth[_0xca37('0x9')](),controller[_0xca37('0xb')]);router['get'](_0xca37('0xc'),auth[_0xca37('0x9')](),controller[_0xca37('0xd')]);router[_0xca37('0xe')]('/',auth['isAuthenticated'](),controller[_0xca37('0xf')]);router[_0xca37('0x10')](_0xca37('0xc'),auth[_0xca37('0x9')](),controller[_0xca37('0x11')]);router[_0xca37('0x12')]('/:id',auth[_0xca37('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index d754ac1..306ca74 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 _0x3fff=['STRING','INTEGER','DATE','called,connect,complete','exports'];(function(_0x551aef,_0x3a75be){var _0x4b5526=function(_0x486c73){while(--_0x486c73){_0x551aef['push'](_0x551aef['shift']());}};_0x4b5526(++_0x3a75be);}(_0x3fff,0x68));var _0xf3ff=function(_0x5301b9,_0x438dd2){_0x5301b9=_0x5301b9-0x0;var _0xe1fe8c=_0x3fff[_0x5301b9];return _0xe1fe8c;};'use strict';var Sequelize=require('sequelize');module[_0xf3ff('0x0')]={'privilege':{'type':Sequelize[_0xf3ff('0x1')]},'channel':{'type':Sequelize[_0xf3ff('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf3ff('0x1')]},'calleridname':{'type':Sequelize[_0xf3ff('0x1')]},'connectedlinenum':{'type':Sequelize[_0xf3ff('0x1')]},'connectedlinename':{'type':Sequelize[_0xf3ff('0x1')]},'language':{'type':Sequelize[_0xf3ff('0x1')]},'accountcode':{'type':Sequelize[_0xf3ff('0x1')]},'context':{'type':Sequelize[_0xf3ff('0x1')]},'exten':{'type':Sequelize[_0xf3ff('0x1')]},'priority':{'type':Sequelize[_0xf3ff('0x2')]},'uniqueid':{'type':Sequelize[_0xf3ff('0x1')]},'linkedid':{'type':Sequelize[_0xf3ff('0x1')]},'destchannel':{'type':Sequelize[_0xf3ff('0x1')]},'destchannelstate':{'type':Sequelize[_0xf3ff('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf3ff('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xf3ff('0x1')]},'destlanguage':{'type':Sequelize[_0xf3ff('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xf3ff('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xf3ff('0x1')]},'destlinkedid':{'type':Sequelize[_0xf3ff('0x1')]},'dialstring':{'type':Sequelize[_0xf3ff('0x1')]},'dialstatus':{'type':Sequelize[_0xf3ff('0x1')]},'starttime':{'type':Sequelize[_0xf3ff('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf3ff('0x3')]},'lastevent':{'type':Sequelize[_0xf3ff('0x1')],'comment':_0xf3ff('0x4')},'routeId':{'type':Sequelize[_0xf3ff('0x2')]},'duration':{'type':Sequelize[_0xf3ff('0x2')]},'holdtime':{'type':Sequelize[_0xf3ff('0x2')]},'billableseconds':{'type':Sequelize[_0xf3ff('0x2')]}}; \ No newline at end of file +var _0x45f7=['INTEGER','DATE','called,connect,complete','exports','STRING'];(function(_0x3792e6,_0x32bd91){var _0x441e44=function(_0x357478){while(--_0x357478){_0x3792e6['push'](_0x3792e6['shift']());}};_0x441e44(++_0x32bd91);}(_0x45f7,0x148));var _0x745f=function(_0x1e172a,_0x52102b){_0x1e172a=_0x1e172a-0x0;var _0x96338b=_0x45f7[_0x1e172a];return _0x96338b;};'use strict';var Sequelize=require('sequelize');module[_0x745f('0x0')]={'privilege':{'type':Sequelize[_0x745f('0x1')]},'channel':{'type':Sequelize[_0x745f('0x1')]},'channelstate':{'type':Sequelize[_0x745f('0x2')]},'channelstatedesc':{'type':Sequelize[_0x745f('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x745f('0x1')]},'language':{'type':Sequelize[_0x745f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x745f('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x745f('0x2')]},'uniqueid':{'type':Sequelize[_0x745f('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x745f('0x1')]},'destchannelstate':{'type':Sequelize[_0x745f('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x745f('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x745f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x745f('0x1')]},'destlanguage':{'type':Sequelize[_0x745f('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x745f('0x1')]},'destexten':{'type':Sequelize[_0x745f('0x1')]},'destpriority':{'type':Sequelize[_0x745f('0x2')]},'destuniqueid':{'type':Sequelize[_0x745f('0x1')]},'destlinkedid':{'type':Sequelize[_0x745f('0x1')]},'dialstring':{'type':Sequelize[_0x745f('0x1')]},'dialstatus':{'type':Sequelize[_0x745f('0x1')]},'starttime':{'type':Sequelize[_0x745f('0x3')]},'answertime':{'type':Sequelize[_0x745f('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x745f('0x1')],'comment':_0x745f('0x4')},'routeId':{'type':Sequelize[_0x745f('0x2')]},'duration':{'type':Sequelize[_0x745f('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 70ed1ec..9c36093 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 _0xdb44=['rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','field','options','includeAll','include','rows','catch','params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','VoiceDialReport'];(function(_0x476b00,_0x250877){var _0x44ec8e=function(_0xec6b23){while(--_0xec6b23){_0x476b00['push'](_0x476b00['shift']());}};_0x44ec8e(++_0x250877);}(_0xdb44,0x146));var _0x4db4=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xdb44[_0x7e2eb0];return _0xd92de4;};'use strict';var pdf=require(_0x4db4('0x0'));var emlformat=require(_0x4db4('0x1'));var rimraf=require(_0x4db4('0x2'));var zipdir=require(_0x4db4('0x3'));var jsonpatch=require(_0x4db4('0x4'));var rp=require(_0x4db4('0x5'));var moment=require(_0x4db4('0x6'));var BPromise=require(_0x4db4('0x7'));var Mustache=require('mustache');var util=require(_0x4db4('0x8'));var path=require('path');var sox=require(_0x4db4('0x9'));var csv=require(_0x4db4('0xa'));var ejs=require(_0x4db4('0xb'));var fs=require('fs');var _=require(_0x4db4('0xc'));var squel=require(_0x4db4('0xd'));var crypto=require(_0x4db4('0xe'));var jsforce=require(_0x4db4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4db4('0xa'));var querystring=require(_0x4db4('0x10'));var Papa=require(_0x4db4('0x11'));var authService=require(_0x4db4('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x4db4('0x13'));var logger=require(_0x4db4('0x14'))('api');var utils=require(_0x4db4('0x15'));var config=require(_0x4db4('0x16'));var db=require(_0x4db4('0x17'))['db'];function respondWithStatusCode(_0x4eb762,_0x569733){_0x569733=_0x569733||0xcc;return function(_0x330b83){if(_0x330b83){return _0x4eb762[_0x4db4('0x18')](_0x569733);}return _0x4eb762[_0x4db4('0x19')](_0x569733)[_0x4db4('0x1a')]();};}function respondWithResult(_0xb325fa,_0x188861){_0x188861=_0x188861||0xc8;return function(_0x3a52c2){if(_0x3a52c2){return _0xb325fa[_0x4db4('0x19')](_0x188861)[_0x4db4('0x1b')](_0x3a52c2);}};}function respondWithFilteredResult(_0x24210f,_0x2cc22d){return function(_0x5b665c){if(_0x5b665c){var _0x4c01f8=_0x5b665c[_0x4db4('0x1c')],_0x3fc540=_0x2cc22d[_0x4db4('0x1d')],_0x4e2600=_0x2cc22d[_0x4db4('0x1d')]+_0x2cc22d[_0x4db4('0x1e')],_0x1e2e56;if(_0x4e2600>=_0x4c01f8){_0x4e2600=_0x4c01f8;_0x1e2e56=0xc8;}else{_0x1e2e56=0xce;}_0x24210f[_0x4db4('0x19')](_0x1e2e56);return _0x24210f[_0x4db4('0x1f')](_0x4db4('0x20'),_0x3fc540+'-'+_0x4e2600+'/'+_0x4c01f8)[_0x4db4('0x1b')](_0x5b665c);}return null;};}function patchUpdates(_0x5a4671){return function(_0x334853){try{jsonpatch[_0x4db4('0x21')](_0x334853,_0x5a4671,!![]);}catch(_0x431057){return BPromise[_0x4db4('0x22')](_0x431057);}return _0x334853[_0x4db4('0x23')]();};}function saveUpdates(_0x355c5d,_0x16adf1){return function(_0x120729){if(_0x120729){return _0x120729[_0x4db4('0x24')](_0x355c5d)[_0x4db4('0x25')](function(_0x375d9a){return _0x375d9a;});}return null;};}function removeEntity(_0x895837,_0x19a726){return function(_0x2e33c5){if(_0x2e33c5){return _0x2e33c5[_0x4db4('0x26')]()['then'](function(){_0x895837[_0x4db4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x574760,_0x6dc6a9){return function(_0x51bfa4){if(!_0x51bfa4){_0x574760[_0x4db4('0x18')](0x194);}return _0x51bfa4;};}function handleError(_0x111bce,_0x30296f){_0x30296f=_0x30296f||0x1f4;return function(_0x2ab2f9){logger[_0x4db4('0x27')](_0x2ab2f9[_0x4db4('0x28')]);if(_0x2ab2f9[_0x4db4('0x29')]){delete _0x2ab2f9['name'];}_0x111bce[_0x4db4('0x19')](_0x30296f)[_0x4db4('0x2a')](_0x2ab2f9);};}exports['index']=function(_0x585c6,_0x4f73e8){var _0x3e4cf7={},_0x4bd2bf={},_0x39fb42={'count':0x0,'rows':[]};var _0x229521=db[_0x4db4('0x2b')][_0x4db4('0x2c')];_0x4bd2bf[_0x4db4('0x2d')]=_['keys'](_0x229521);_0x4bd2bf[_0x4db4('0x2e')]=_['keys'](_0x585c6[_0x4db4('0x2e')]);_0x4bd2bf['filters']=_[_0x4db4('0x2f')](_0x4bd2bf[_0x4db4('0x2d')],_0x4bd2bf[_0x4db4('0x2e')]);_0x3e4cf7['attributes']=_['intersection'](_0x4bd2bf[_0x4db4('0x2d')],qs[_0x4db4('0x30')](_0x585c6[_0x4db4('0x2e')][_0x4db4('0x30')]));_0x3e4cf7['attributes']=_0x3e4cf7[_0x4db4('0x31')][_0x4db4('0x32')]?_0x3e4cf7['attributes']:_0x4bd2bf[_0x4db4('0x2d')];if(!_0x585c6['query'][_0x4db4('0x33')](_0x4db4('0x34'))){_0x3e4cf7['limit']=qs[_0x4db4('0x1e')](_0x585c6[_0x4db4('0x2e')][_0x4db4('0x1e')]);_0x3e4cf7[_0x4db4('0x1d')]=qs[_0x4db4('0x1d')](_0x585c6[_0x4db4('0x2e')]['offset']);}_0x3e4cf7[_0x4db4('0x35')]=qs[_0x4db4('0x36')](_0x585c6[_0x4db4('0x2e')][_0x4db4('0x36')]);_0x3e4cf7[_0x4db4('0x37')]=qs[_0x4db4('0x38')](_[_0x4db4('0x39')](_0x585c6[_0x4db4('0x2e')],_0x4bd2bf[_0x4db4('0x38')]));if(_0x585c6[_0x4db4('0x2e')][_0x4db4('0x3a')]){_0x3e4cf7[_0x4db4('0x37')]=_[_0x4db4('0x3b')](_0x3e4cf7[_0x4db4('0x37')],{'$or':_[_0x4db4('0x3c')](_0x229521,function(_0x588ff8){if(_0x588ff8[_0x4db4('0x3d')]['key']!=='VIRTUAL'){var _0x3647b4={};_0x3647b4[_0x588ff8[_0x4db4('0x3e')]]={'$like':'%'+_0x585c6['query'][_0x4db4('0x3a')]+'%'};return _0x3647b4;}})});}_0x3e4cf7=_['merge']({},_0x3e4cf7,_0x585c6[_0x4db4('0x3f')]);var _0x604ae4={'where':_0x3e4cf7[_0x4db4('0x37')]};return db[_0x4db4('0x2b')]['count'](_0x604ae4)[_0x4db4('0x25')](function(_0x4589f5){_0x39fb42['count']=_0x4589f5;if(_0x585c6['query'][_0x4db4('0x40')]){_0x3e4cf7[_0x4db4('0x41')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x3e4cf7);})[_0x4db4('0x25')](function(_0x4ad6c0){_0x39fb42[_0x4db4('0x42')]=_0x4ad6c0;return _0x39fb42;})[_0x4db4('0x25')](respondWithFilteredResult(_0x4f73e8,_0x3e4cf7))[_0x4db4('0x43')](handleError(_0x4f73e8,null));};exports['show']=function(_0x4329f3,_0x1de510){var _0x5a8b19={'raw':!![],'where':{'id':_0x4329f3[_0x4db4('0x44')]['id']}},_0x1c64a8={};_0x1c64a8['model']=_['keys'](db[_0x4db4('0x2b')]['rawAttributes']);_0x1c64a8[_0x4db4('0x2e')]=_[_0x4db4('0x45')](_0x4329f3[_0x4db4('0x2e')]);_0x1c64a8[_0x4db4('0x38')]=_[_0x4db4('0x2f')](_0x1c64a8[_0x4db4('0x2d')],_0x1c64a8[_0x4db4('0x2e')]);_0x5a8b19[_0x4db4('0x31')]=_['intersection'](_0x1c64a8[_0x4db4('0x2d')],qs[_0x4db4('0x30')](_0x4329f3['query'][_0x4db4('0x30')]));_0x5a8b19[_0x4db4('0x31')]=_0x5a8b19[_0x4db4('0x31')][_0x4db4('0x32')]?_0x5a8b19['attributes']:_0x1c64a8[_0x4db4('0x2d')];if(_0x4329f3[_0x4db4('0x2e')][_0x4db4('0x40')]){_0x5a8b19['include']=[{'all':!![]}];}_0x5a8b19=_[_0x4db4('0x3b')]({},_0x5a8b19,_0x4329f3['options']);return db[_0x4db4('0x2b')][_0x4db4('0x46')](_0x5a8b19)['then'](handleEntityNotFound(_0x1de510,null))[_0x4db4('0x25')](respondWithResult(_0x1de510,null))[_0x4db4('0x43')](handleError(_0x1de510,null));};exports[_0x4db4('0x47')]=function(_0x42a537,_0x17bc87){return db[_0x4db4('0x2b')][_0x4db4('0x47')](_0x42a537[_0x4db4('0x48')],{})[_0x4db4('0x25')](respondWithResult(_0x17bc87,0xc9))['catch'](handleError(_0x17bc87,null));};exports[_0x4db4('0x24')]=function(_0x5265e2,_0x195e78){if(_0x5265e2[_0x4db4('0x48')]['id']){delete _0x5265e2[_0x4db4('0x48')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x5265e2[_0x4db4('0x44')]['id']}})[_0x4db4('0x25')](handleEntityNotFound(_0x195e78,null))[_0x4db4('0x25')](saveUpdates(_0x5265e2[_0x4db4('0x48')],null))['then'](respondWithResult(_0x195e78,null))[_0x4db4('0x43')](handleError(_0x195e78,null));};exports[_0x4db4('0x26')]=function(_0x4709bb,_0x346e87){return db[_0x4db4('0x2b')][_0x4db4('0x46')]({'where':{'id':_0x4709bb[_0x4db4('0x44')]['id']}})[_0x4db4('0x25')](handleEntityNotFound(_0x346e87,null))[_0x4db4('0x25')](removeEntity(_0x346e87,null))['catch'](handleError(_0x346e87,null));};exports[_0x4db4('0x49')]=function(_0x365443,_0xa5307e){return db[_0x4db4('0x2b')]['describe']()[_0x4db4('0x25')](respondWithResult(_0xa5307e,null))[_0x4db4('0x43')](handleError(_0xa5307e,null));}; \ No newline at end of file +var _0x10e2=['index','VoiceDialReport','rawAttributes','keys','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','field','include','rows','catch','show','fields','includeAll','options','find','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name'];(function(_0x2844d3,_0x5cdcc5){var _0x227364=function(_0x44b7b7){while(--_0x44b7b7){_0x2844d3['push'](_0x2844d3['shift']());}};_0x227364(++_0x5cdcc5);}(_0x10e2,0x100));var _0x210e=function(_0x3df1c2,_0x1d32db){_0x3df1c2=_0x3df1c2-0x0;var _0x70d3e8=_0x10e2[_0x3df1c2];return _0x70d3e8;};'use strict';var pdf=require(_0x210e('0x0'));var emlformat=require(_0x210e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x210e('0x2'));var jsonpatch=require(_0x210e('0x3'));var rp=require(_0x210e('0x4'));var moment=require(_0x210e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x210e('0x6'));var util=require(_0x210e('0x7'));var path=require('path');var sox=require(_0x210e('0x8'));var csv=require('to-csv');var ejs=require(_0x210e('0x9'));var fs=require('fs');var _=require(_0x210e('0xa'));var squel=require(_0x210e('0xb'));var crypto=require(_0x210e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x210e('0xd'));var toCsv=require(_0x210e('0xe'));var querystring=require(_0x210e('0xf'));var Papa=require(_0x210e('0x10'));var authService=require(_0x210e('0x11'));var hardwareService=require(_0x210e('0x12'));var Redis=require('ioredis');var qs=require(_0x210e('0x13'));var logger=require('../../config/logger')(_0x210e('0x14'));var utils=require('../../config/utils');var config=require(_0x210e('0x15'));var db=require(_0x210e('0x16'))['db'];function respondWithStatusCode(_0x5a44ca,_0x506837){_0x506837=_0x506837||0xcc;return function(_0x52f4b3){if(_0x52f4b3){return _0x5a44ca[_0x210e('0x17')](_0x506837);}return _0x5a44ca[_0x210e('0x18')](_0x506837)[_0x210e('0x19')]();};}function respondWithResult(_0x5017db,_0x33aed5){_0x33aed5=_0x33aed5||0xc8;return function(_0x225882){if(_0x225882){return _0x5017db[_0x210e('0x18')](_0x33aed5)[_0x210e('0x1a')](_0x225882);}};}function respondWithFilteredResult(_0x53f8ed,_0x55d9bb){return function(_0x264268){if(_0x264268){var _0x16eec5=_0x264268[_0x210e('0x1b')],_0x66b39c=_0x55d9bb['offset'],_0x53c901=_0x55d9bb[_0x210e('0x1c')]+_0x55d9bb[_0x210e('0x1d')],_0x326a2f;if(_0x53c901>=_0x16eec5){_0x53c901=_0x16eec5;_0x326a2f=0xc8;}else{_0x326a2f=0xce;}_0x53f8ed[_0x210e('0x18')](_0x326a2f);return _0x53f8ed[_0x210e('0x1e')](_0x210e('0x1f'),_0x66b39c+'-'+_0x53c901+'/'+_0x16eec5)[_0x210e('0x1a')](_0x264268);}return null;};}function patchUpdates(_0x1d36b0){return function(_0x475617){try{jsonpatch[_0x210e('0x20')](_0x475617,_0x1d36b0,!![]);}catch(_0x4038c2){return BPromise[_0x210e('0x21')](_0x4038c2);}return _0x475617['save']();};}function saveUpdates(_0x27ea10,_0x56d376){return function(_0x2ef7c0){if(_0x2ef7c0){return _0x2ef7c0[_0x210e('0x22')](_0x27ea10)[_0x210e('0x23')](function(_0x433eef){return _0x433eef;});}return null;};}function removeEntity(_0x104231,_0x502b23){return function(_0x222e20){if(_0x222e20){return _0x222e20[_0x210e('0x24')]()[_0x210e('0x23')](function(){_0x104231['status'](0xcc)[_0x210e('0x19')]();});}};}function handleEntityNotFound(_0x2d3fbc,_0x20de4b){return function(_0x4b0d6d){if(!_0x4b0d6d){_0x2d3fbc[_0x210e('0x17')](0x194);}return _0x4b0d6d;};}function handleError(_0x477579,_0x19ae5c){_0x19ae5c=_0x19ae5c||0x1f4;return function(_0x2f868e){logger[_0x210e('0x25')](_0x2f868e[_0x210e('0x26')]);if(_0x2f868e[_0x210e('0x27')]){delete _0x2f868e[_0x210e('0x27')];}_0x477579[_0x210e('0x18')](_0x19ae5c)['send'](_0x2f868e);};}exports[_0x210e('0x28')]=function(_0xb7d135,_0x5b17e7){var _0x3622b9={},_0x5d6ade={},_0x3952b2={'count':0x0,'rows':[]};var _0x4a708b=db[_0x210e('0x29')][_0x210e('0x2a')];_0x5d6ade['model']=_['keys'](_0x4a708b);_0x5d6ade['query']=_[_0x210e('0x2b')](_0xb7d135[_0x210e('0x2c')]);_0x5d6ade['filters']=_[_0x210e('0x2d')](_0x5d6ade[_0x210e('0x2e')],_0x5d6ade[_0x210e('0x2c')]);_0x3622b9[_0x210e('0x2f')]=_[_0x210e('0x2d')](_0x5d6ade[_0x210e('0x2e')],qs['fields'](_0xb7d135[_0x210e('0x2c')]['fields']));_0x3622b9[_0x210e('0x2f')]=_0x3622b9[_0x210e('0x2f')][_0x210e('0x30')]?_0x3622b9[_0x210e('0x2f')]:_0x5d6ade['model'];if(!_0xb7d135[_0x210e('0x2c')][_0x210e('0x31')](_0x210e('0x32'))){_0x3622b9[_0x210e('0x1d')]=qs[_0x210e('0x1d')](_0xb7d135[_0x210e('0x2c')]['limit']);_0x3622b9['offset']=qs['offset'](_0xb7d135['query'][_0x210e('0x1c')]);}_0x3622b9[_0x210e('0x33')]=qs[_0x210e('0x34')](_0xb7d135[_0x210e('0x2c')]['sort']);_0x3622b9[_0x210e('0x35')]=qs[_0x210e('0x36')](_[_0x210e('0x37')](_0xb7d135['query'],_0x5d6ade[_0x210e('0x36')]));if(_0xb7d135['query'][_0x210e('0x38')]){_0x3622b9[_0x210e('0x35')]=_[_0x210e('0x39')](_0x3622b9[_0x210e('0x35')],{'$or':_[_0x210e('0x3a')](_0x4a708b,function(_0x5c8956){if(_0x5c8956[_0x210e('0x3b')]['key']!==_0x210e('0x3c')){var _0x3aa6df={};_0x3aa6df[_0x5c8956[_0x210e('0x3d')]]={'$like':'%'+_0xb7d135[_0x210e('0x2c')][_0x210e('0x38')]+'%'};return _0x3aa6df;}})});}_0x3622b9=_[_0x210e('0x39')]({},_0x3622b9,_0xb7d135['options']);var _0x1350c8={'where':_0x3622b9[_0x210e('0x35')]};return db['VoiceDialReport'][_0x210e('0x1b')](_0x1350c8)[_0x210e('0x23')](function(_0x1ec636){_0x3952b2[_0x210e('0x1b')]=_0x1ec636;if(_0xb7d135['query']['includeAll']){_0x3622b9[_0x210e('0x3e')]=[{'all':!![]}];}return db[_0x210e('0x29')]['findAll'](_0x3622b9);})[_0x210e('0x23')](function(_0x2c7857){_0x3952b2[_0x210e('0x3f')]=_0x2c7857;return _0x3952b2;})['then'](respondWithFilteredResult(_0x5b17e7,_0x3622b9))[_0x210e('0x40')](handleError(_0x5b17e7,null));};exports[_0x210e('0x41')]=function(_0x54356a,_0x5927ea){var _0x3f30ec={'raw':!![],'where':{'id':_0x54356a['params']['id']}},_0x349f10={};_0x349f10[_0x210e('0x2e')]=_['keys'](db['VoiceDialReport'][_0x210e('0x2a')]);_0x349f10[_0x210e('0x2c')]=_[_0x210e('0x2b')](_0x54356a[_0x210e('0x2c')]);_0x349f10['filters']=_[_0x210e('0x2d')](_0x349f10[_0x210e('0x2e')],_0x349f10[_0x210e('0x2c')]);_0x3f30ec[_0x210e('0x2f')]=_[_0x210e('0x2d')](_0x349f10[_0x210e('0x2e')],qs[_0x210e('0x42')](_0x54356a[_0x210e('0x2c')][_0x210e('0x42')]));_0x3f30ec['attributes']=_0x3f30ec[_0x210e('0x2f')]['length']?_0x3f30ec[_0x210e('0x2f')]:_0x349f10[_0x210e('0x2e')];if(_0x54356a[_0x210e('0x2c')][_0x210e('0x43')]){_0x3f30ec[_0x210e('0x3e')]=[{'all':!![]}];}_0x3f30ec=_[_0x210e('0x39')]({},_0x3f30ec,_0x54356a[_0x210e('0x44')]);return db[_0x210e('0x29')][_0x210e('0x45')](_0x3f30ec)[_0x210e('0x23')](handleEntityNotFound(_0x5927ea,null))['then'](respondWithResult(_0x5927ea,null))['catch'](handleError(_0x5927ea,null));};exports[_0x210e('0x46')]=function(_0x514a97,_0x3eb2d1){return db[_0x210e('0x29')]['create'](_0x514a97['body'],{})[_0x210e('0x23')](respondWithResult(_0x3eb2d1,0xc9))[_0x210e('0x40')](handleError(_0x3eb2d1,null));};exports['update']=function(_0x5d3975,_0x1f7717){if(_0x5d3975[_0x210e('0x47')]['id']){delete _0x5d3975[_0x210e('0x47')]['id'];}return db[_0x210e('0x29')][_0x210e('0x45')]({'where':{'id':_0x5d3975['params']['id']}})['then'](handleEntityNotFound(_0x1f7717,null))[_0x210e('0x23')](saveUpdates(_0x5d3975[_0x210e('0x47')],null))[_0x210e('0x23')](respondWithResult(_0x1f7717,null))['catch'](handleError(_0x1f7717,null));};exports['destroy']=function(_0x330785,_0x4ecf4a){return db[_0x210e('0x29')][_0x210e('0x45')]({'where':{'id':_0x330785[_0x210e('0x48')]['id']}})[_0x210e('0x23')](handleEntityNotFound(_0x4ecf4a,null))[_0x210e('0x23')](removeEntity(_0x4ecf4a,null))[_0x210e('0x40')](handleError(_0x4ecf4a,null));};exports['describe']=function(_0x3411f0,_0x1389c1){return db[_0x210e('0x29')][_0x210e('0x49')]()['then'](respondWithResult(_0x1389c1,null))[_0x210e('0x40')](handleError(_0x1389c1,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 94949e6..3af5b8d 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 _0x46ec=['./voiceDialReport.attributes','define','report_dial','util','moment','bluebird','request-promise'];(function(_0x5af362,_0x42a27d){var _0x1e1469=function(_0x33d7fc){while(--_0x33d7fc){_0x5af362['push'](_0x5af362['shift']());}};_0x1e1469(++_0x42a27d);}(_0x46ec,0x13e));var _0xc46e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x46ec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc46e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc46e('0x1'));var BPromise=require(_0xc46e('0x2'));var rp=require(_0xc46e('0x3'));var attributes=require(_0xc46e('0x4'));module['exports']=function(_0x460151,_0x2bd7e7){return _0x460151[_0xc46e('0x5')]('VoiceDialReport',attributes,{'tableName':_0xc46e('0x6'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6642=['bluebird','request-promise','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid','lodash','api'];(function(_0x3f64cc,_0x23eb9f){var _0x25eb35=function(_0x5ef08c){while(--_0x5ef08c){_0x3f64cc['push'](_0x3f64cc['shift']());}};_0x25eb35(++_0x23eb9f);}(_0x6642,0x193));var _0x2664=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6642[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2664('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2664('0x1'));var moment=require('moment');var BPromise=require(_0x2664('0x2'));var rp=require(_0x2664('0x3'));var attributes=require(_0x2664('0x4'));module['exports']=function(_0x594695,_0x1bdab7){return _0x594695[_0x2664('0x5')](_0x2664('0x6'),attributes,{'tableName':_0x2664('0x7'),'paranoid':![],'indexes':[{'fields':[_0x2664('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 7253198..d4853aa 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 _0x8f1f=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceDialReport','body','options','raw','CreateVoiceDialReport','debug','UpdateVoiceDialReport','update','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3f347c,_0x3a5e41){var _0x706cb4=function(_0x2b8418){while(--_0x2b8418){_0x3f347c['push'](_0x3f347c['shift']());}};_0x706cb4(++_0x3a5e41);}(_0x8f1f,0xe1));var _0xf8f1=function(_0x5499ab,_0x4c1128){_0x5499ab=_0x5499ab-0x0;var _0x344478=_0x8f1f[_0x5499ab];return _0x344478;};'use strict';var _=require(_0xf8f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf8f1('0x1'));var rs=require(_0xf8f1('0x2'));var fs=require('fs');var Redis=require(_0xf8f1('0x3'));var db=require(_0xf8f1('0x4'))['db'];var utils=require(_0xf8f1('0x5'));var logger=require(_0xf8f1('0x6'))(_0xf8f1('0x7'));var config=require(_0xf8f1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf8f1('0x9')][_0xf8f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x122134,_0x19ccf6,_0x9609e9){return new BPromise(function(_0x4bd078,_0x1ece01){return client[_0xf8f1('0xb')](_0x122134,_0x9609e9)[_0xf8f1('0xc')](function(_0x24e592){logger[_0xf8f1('0xd')](_0xf8f1('0xe'),_0x19ccf6,_0xf8f1('0xf'));logger['debug'](_0xf8f1('0x10'),_0x19ccf6,_0xf8f1('0xf'),JSON[_0xf8f1('0x11')](_0x24e592));if(_0x24e592[_0xf8f1('0x12')]){if(_0x24e592[_0xf8f1('0x12')][_0xf8f1('0x13')]===0x1f4){logger['error'](_0xf8f1('0xe'),_0x19ccf6,_0x24e592[_0xf8f1('0x12')][_0xf8f1('0x14')]);return _0x1ece01(_0x24e592[_0xf8f1('0x12')][_0xf8f1('0x14')]);}logger['error'](_0xf8f1('0xe'),_0x19ccf6,_0x24e592[_0xf8f1('0x12')][_0xf8f1('0x14')]);return _0x4bd078(_0x24e592[_0xf8f1('0x12')][_0xf8f1('0x14')]);}else{logger[_0xf8f1('0xd')](_0xf8f1('0xe'),_0x19ccf6,'request\x20sent');_0x4bd078(_0x24e592[_0xf8f1('0x15')][_0xf8f1('0x14')]);}})['catch'](function(_0x39350e){logger[_0xf8f1('0x12')](_0xf8f1('0xe'),_0x19ccf6,_0x39350e);_0x1ece01(_0x39350e);});});}exports['CreateVoiceDialReport']=function(_0x3bd8ba){var _0x3bcb06=this;return new Promise(function(_0x410299,_0x448f5b){return db[_0xf8f1('0x16')]['create'](_0x3bd8ba[_0xf8f1('0x17')],{'raw':_0x3bd8ba['options']?_0x3bd8ba[_0xf8f1('0x18')][_0xf8f1('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3aaa1c){logger[_0xf8f1('0xd')](_0xf8f1('0x1a'),_0x3bd8ba);logger[_0xf8f1('0x1b')](_0xf8f1('0x1a'),_0x3bd8ba,JSON[_0xf8f1('0x11')](_0x3aaa1c));_0x410299(_0x3aaa1c);})['catch'](function(_0x23cf7f){logger['error'](_0xf8f1('0x1a'),_0x23cf7f[_0xf8f1('0x14')],_0x3bd8ba);_0x448f5b(_0x3bcb06[_0xf8f1('0x12')](0x1f4,_0x23cf7f[_0xf8f1('0x14')]));});});};exports[_0xf8f1('0x1c')]=function(_0x842ecb){var _0x29b0f7=this;return new Promise(function(_0x565dd8,_0x526f73){return db[_0xf8f1('0x16')][_0xf8f1('0x1d')](_0x842ecb['body'],{'raw':_0x842ecb[_0xf8f1('0x18')]?_0x842ecb[_0xf8f1('0x18')][_0xf8f1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x842ecb[_0xf8f1('0x18')]?_0x842ecb[_0xf8f1('0x18')][_0xf8f1('0x1e')]||null:null,'attributes':_0x842ecb[_0xf8f1('0x18')]?_0x842ecb['options'][_0xf8f1('0x1f')]||null:null,'limit':_0x842ecb['options']?_0x842ecb[_0xf8f1('0x18')][_0xf8f1('0x20')]||null:null})[_0xf8f1('0xc')](function(_0x5e4755){logger[_0xf8f1('0xd')](_0xf8f1('0x1c'),_0x842ecb);logger[_0xf8f1('0x1b')]('UpdateVoiceDialReport',_0x842ecb,JSON['stringify'](_0x5e4755));_0x565dd8(_0x5e4755);})['catch'](function(_0x2e26a0){logger[_0xf8f1('0x12')](_0xf8f1('0x1c'),_0x2e26a0[_0xf8f1('0x14')],_0x842ecb);_0x526f73(_0x29b0f7['error'](0x1f4,_0x2e26a0[_0xf8f1('0x14')]));});});}; \ No newline at end of file +var _0x59ce=['update','where','attributes','limit','UpdateVoiceDialReport','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','create','body','options','raw','VoiceDialReport'];(function(_0xc7ade3,_0x1e46c3){var _0x198d52=function(_0x17085e){while(--_0x17085e){_0xc7ade3['push'](_0xc7ade3['shift']());}};_0x198d52(++_0x1e46c3);}(_0x59ce,0x92));var _0xe59c=function(_0x1f8b8b,_0x51a891){_0x1f8b8b=_0x1f8b8b-0x0;var _0x2aaa1e=_0x59ce[_0x1f8b8b];return _0x2aaa1e;};'use strict';var _=require(_0xe59c('0x0'));var util=require(_0xe59c('0x1'));var moment=require(_0xe59c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe59c('0x3'));var fs=require('fs');var Redis=require(_0xe59c('0x4'));var db=require(_0xe59c('0x5'))['db'];var utils=require(_0xe59c('0x6'));var logger=require(_0xe59c('0x7'))(_0xe59c('0x8'));var config=require(_0xe59c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe59c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x534601,_0x4f07e9,_0x2c1d11){return new BPromise(function(_0x101a79,_0x206753){return client[_0xe59c('0xb')](_0x534601,_0x2c1d11)[_0xe59c('0xc')](function(_0x3981be){logger[_0xe59c('0xd')](_0xe59c('0xe'),_0x4f07e9,_0xe59c('0xf'));logger[_0xe59c('0x10')](_0xe59c('0x11'),_0x4f07e9,_0xe59c('0xf'),JSON[_0xe59c('0x12')](_0x3981be));if(_0x3981be[_0xe59c('0x13')]){if(_0x3981be[_0xe59c('0x13')][_0xe59c('0x14')]===0x1f4){logger[_0xe59c('0x13')](_0xe59c('0xe'),_0x4f07e9,_0x3981be['error'][_0xe59c('0x15')]);return _0x206753(_0x3981be[_0xe59c('0x13')][_0xe59c('0x15')]);}logger[_0xe59c('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x4f07e9,_0x3981be['error'][_0xe59c('0x15')]);return _0x101a79(_0x3981be[_0xe59c('0x13')][_0xe59c('0x15')]);}else{logger[_0xe59c('0xd')](_0xe59c('0xe'),_0x4f07e9,'request\x20sent');_0x101a79(_0x3981be[_0xe59c('0x16')]['message']);}})['catch'](function(_0xee38fc){logger[_0xe59c('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x4f07e9,_0xee38fc);_0x206753(_0xee38fc);});});}exports[_0xe59c('0x17')]=function(_0x38f4b0){var _0x32bfd7=this;return new Promise(function(_0x529c0d,_0xe9f0a1){return db['VoiceDialReport'][_0xe59c('0x18')](_0x38f4b0[_0xe59c('0x19')],{'raw':_0x38f4b0[_0xe59c('0x1a')]?_0x38f4b0['options'][_0xe59c('0x1b')]===undefined?!![]:![]:!![]})[_0xe59c('0xc')](function(_0x28a8da){logger[_0xe59c('0xd')](_0xe59c('0x17'),_0x38f4b0);logger[_0xe59c('0x10')](_0xe59c('0x17'),_0x38f4b0,JSON[_0xe59c('0x12')](_0x28a8da));_0x529c0d(_0x28a8da);})['catch'](function(_0x1c9170){logger[_0xe59c('0x13')](_0xe59c('0x17'),_0x1c9170[_0xe59c('0x15')],_0x38f4b0);_0xe9f0a1(_0x32bfd7[_0xe59c('0x13')](0x1f4,_0x1c9170[_0xe59c('0x15')]));});});};exports['UpdateVoiceDialReport']=function(_0x4d3605){var _0x1f9766=this;return new Promise(function(_0x923e8a,_0x481c52){return db[_0xe59c('0x1c')][_0xe59c('0x1d')](_0x4d3605['body'],{'raw':_0x4d3605['options']?_0x4d3605[_0xe59c('0x1a')][_0xe59c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d3605[_0xe59c('0x1a')]?_0x4d3605[_0xe59c('0x1a')][_0xe59c('0x1e')]||null:null,'attributes':_0x4d3605[_0xe59c('0x1a')]?_0x4d3605[_0xe59c('0x1a')][_0xe59c('0x1f')]||null:null,'limit':_0x4d3605[_0xe59c('0x1a')]?_0x4d3605[_0xe59c('0x1a')][_0xe59c('0x20')]||null:null})[_0xe59c('0xc')](function(_0x2f844a){logger['info'](_0xe59c('0x21'),_0x4d3605);logger[_0xe59c('0x10')](_0xe59c('0x21'),_0x4d3605,JSON[_0xe59c('0x12')](_0x2f844a));_0x923e8a(_0x2f844a);})[_0xe59c('0x22')](function(_0x480ed9){logger[_0xe59c('0x13')](_0xe59c('0x21'),_0x480ed9[_0xe59c('0x15')],_0x4d3605);_0x481c52(_0x1f9766[_0xe59c('0x13')](0x1f4,_0x480ed9['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 82d5bbe..3c2f6e3 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 _0x8e3f=['./voiceExtension.controller','isAuthenticated','index','get','/:id','show','post','create','/:id/applications','addApplications','put','update','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x534ae9,_0x5735c1){var _0x2dc1e7=function(_0x58048a){while(--_0x58048a){_0x534ae9['push'](_0x534ae9['shift']());}};_0x2dc1e7(++_0x5735c1);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8e3f[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var path=require(_0xf8e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xf8e3('0x3'));var router=express[_0xf8e3('0x4')]();var auth=require(_0xf8e3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf8e3('0x6'));var controller=require(_0xf8e3('0x7'));router['get']('/',auth[_0xf8e3('0x8')](),controller[_0xf8e3('0x9')]);router[_0xf8e3('0xa')](_0xf8e3('0xb'),auth['isAuthenticated'](),controller[_0xf8e3('0xc')]);router[_0xf8e3('0xd')]('/',auth[_0xf8e3('0x8')](),controller[_0xf8e3('0xe')]);router[_0xf8e3('0xd')](_0xf8e3('0xf'),auth[_0xf8e3('0x8')](),controller[_0xf8e3('0x10')]);router[_0xf8e3('0x11')](_0xf8e3('0xb'),auth[_0xf8e3('0x8')](),controller[_0xf8e3('0x12')]);router['delete'](_0xf8e3('0xb'),auth[_0xf8e3('0x8')](),controller[_0xf8e3('0x13')]);module['exports']=router; \ No newline at end of file +var _0x317b=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','/:id/applications','addApplications','put','update','delete','exports','multer'];(function(_0x6bbb11,_0x44e6b5){var _0x4c4dc3=function(_0x1307e8){while(--_0x1307e8){_0x6bbb11['push'](_0x6bbb11['shift']());}};_0x4c4dc3(++_0x44e6b5);}(_0x317b,0x1c7));var _0xb317=function(_0x569bc2,_0x23539e){_0x569bc2=_0x569bc2-0x0;var _0x4013fa=_0x317b[_0x569bc2];return _0x4013fa;};'use strict';var multer=require(_0xb317('0x0'));var util=require(_0xb317('0x1'));var path=require('path');var timeout=require(_0xb317('0x2'));var express=require(_0xb317('0x3'));var router=express['Router']();var auth=require(_0xb317('0x4'));var interaction=require(_0xb317('0x5'));var config=require(_0xb317('0x6'));var controller=require(_0xb317('0x7'));router[_0xb317('0x8')]('/',auth[_0xb317('0x9')](),controller[_0xb317('0xa')]);router[_0xb317('0x8')](_0xb317('0xb'),auth[_0xb317('0x9')](),controller['show']);router[_0xb317('0xc')]('/',auth[_0xb317('0x9')](),controller['create']);router[_0xb317('0xc')](_0xb317('0xd'),auth[_0xb317('0x9')](),controller[_0xb317('0xe')]);router[_0xb317('0xf')](_0xb317('0xb'),auth['isAuthenticated'](),controller[_0xb317('0x10')]);router[_0xb317('0x11')]('/:id',auth[_0xb317('0x9')](),controller['destroy']);module[_0xb317('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 45038ad..143d3d2 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 _0xdb94=['INTEGER','BOOLEAN','wav','sequelize','exports','STRING','compositeIndex','NoOp','inbound','internal','outbound-fax','system','any','*,*,*,*'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xdb94,0xab));var _0x4db9=function(_0x4a006a,_0x3cd29d){_0x4a006a=_0x4a006a-0x0;var _0x49bb5f=_0xdb94[_0x4a006a];return _0x49bb5f;};'use strict';var Sequelize=require(_0x4db9('0x0'));module[_0x4db9('0x1')]={'context':{'type':Sequelize[_0x4db9('0x2')],'allowNull':![],'unique':_0x4db9('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4db9('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x4db9('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x4db9('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4db9('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x4db9('0x5'),'outbound',_0x4db9('0x6'),'inbound-fax',_0x4db9('0x7'),_0x4db9('0x8'),_0x4db9('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x4db9('0x2')]},'interval':{'type':Sequelize[_0x4db9('0x2')],'allowNull':![],'defaultValue':_0x4db9('0xa')},'IntervalId':{'type':Sequelize[_0x4db9('0xb')]},'isApp':{'type':Sequelize[_0x4db9('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4db9('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x4db9('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x4db9('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x4db9('0x2')],'defaultValue':_0x4db9('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x31222b){return this['getDataValue']('exten');}}}; \ No newline at end of file +var _0x91a7=['*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','exten','exports','STRING','compositeIndex','NoOp','inbound','internal','inbound-fax','system','any'];(function(_0x3a0919,_0x204aa6){var _0x147278=function(_0x1e7de9){while(--_0x1e7de9){_0x3a0919['push'](_0x3a0919['shift']());}};_0x147278(++_0x204aa6);}(_0x91a7,0xe7));var _0x791a=function(_0x480b88,_0x436bb4){_0x480b88=_0x480b88-0x0;var _0x4e4f60=_0x91a7[_0x480b88];return _0x4e4f60;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'context':{'type':Sequelize[_0x791a('0x1')],'allowNull':![],'unique':_0x791a('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x791a('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x791a('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x791a('0x3')},'appdata':{'type':Sequelize[_0x791a('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x791a('0x4'),'outbound',_0x791a('0x5'),_0x791a('0x6'),'outbound-fax',_0x791a('0x7'),_0x791a('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x791a('0x1')]},'interval':{'type':Sequelize[_0x791a('0x1')],'allowNull':![],'defaultValue':_0x791a('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x791a('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x791a('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x791a('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x791a('0xb')]},'recordingFormat':{'type':Sequelize[_0x791a('0x1')],'defaultValue':_0x791a('0xc')},'answer':{'type':Sequelize[_0x791a('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x791a('0xd')],'get':function(_0x53dc41){return this['getDataValue'](_0x791a('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index a763e45..d5a6b5d 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 _0xb76d=['count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','ignore','map','value','type','find','name','UserProfileResource','end','VoiceExtension','rawAttributes','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','key','field','options','include','findAll','rows','catch','show','params','includeAll','merge','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','internal','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','bulkCreate','cast(priority\x20as\x20unsigned)','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','sendStatus','status','json'];(function(_0x399333,_0xbcfa38){var _0x8733a=function(_0x509d14){while(--_0x509d14){_0x399333['push'](_0x399333['shift']());}};_0x8733a(++_0xbcfa38);}(_0xb76d,0x119));var _0xdb76=function(_0x396748,_0x11e472){_0x396748=_0x396748-0x0;var _0x13f770=_0xb76d[_0x396748];return _0x13f770;};'use strict';var pdf=require(_0xdb76('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdb76('0x1'));var zipdir=require(_0xdb76('0x2'));var jsonpatch=require(_0xdb76('0x3'));var rp=require('request-promise');var moment=require(_0xdb76('0x4'));var BPromise=require(_0xdb76('0x5'));var Mustache=require(_0xdb76('0x6'));var util=require(_0xdb76('0x7'));var path=require(_0xdb76('0x8'));var sox=require(_0xdb76('0x9'));var csv=require('to-csv');var ejs=require(_0xdb76('0xa'));var fs=require('fs');var _=require(_0xdb76('0xb'));var squel=require(_0xdb76('0xc'));var crypto=require(_0xdb76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdb76('0xe'));var toCsv=require(_0xdb76('0xf'));var querystring=require('querystring');var Papa=require(_0xdb76('0x10'));var authService=require(_0xdb76('0x11'));var hardwareService=require(_0xdb76('0x12'));var Redis=require(_0xdb76('0x13'));var qs=require(_0xdb76('0x14'));var logger=require(_0xdb76('0x15'))(_0xdb76('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xdb76('0x17'))['db'];config[_0xdb76('0x18')]=_[_0xdb76('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdb76('0x1a'))(new Redis(config['redis']));require(_0xdb76('0x1b'))['register'](socket);function respondWithStatusCode(_0x4d2970,_0xcc589e){_0xcc589e=_0xcc589e||0xcc;return function(_0x28d3a5){if(_0x28d3a5){return _0x4d2970[_0xdb76('0x1c')](_0xcc589e);}return _0x4d2970[_0xdb76('0x1d')](_0xcc589e)['end']();};}function respondWithResult(_0x7fd0ef,_0x2f1e41){_0x2f1e41=_0x2f1e41||0xc8;return function(_0x5a1017){if(_0x5a1017){return _0x7fd0ef[_0xdb76('0x1d')](_0x2f1e41)[_0xdb76('0x1e')](_0x5a1017);}};}function respondWithFilteredResult(_0x39329f,_0x3cd8fe){return function(_0x388fb0){if(_0x388fb0){var _0x1e3c5e=_0x388fb0[_0xdb76('0x1f')],_0x557649=_0x3cd8fe['offset'],_0x175567=_0x3cd8fe[_0xdb76('0x20')]+_0x3cd8fe[_0xdb76('0x21')],_0x11ae59;if(_0x175567>=_0x1e3c5e){_0x175567=_0x1e3c5e;_0x11ae59=0xc8;}else{_0x11ae59=0xce;}_0x39329f[_0xdb76('0x1d')](_0x11ae59);return _0x39329f['set'](_0xdb76('0x22'),_0x557649+'-'+_0x175567+'/'+_0x1e3c5e)[_0xdb76('0x1e')](_0x388fb0);}return null;};}function patchUpdates(_0x3c786c){return function(_0x468cd1){try{jsonpatch[_0xdb76('0x23')](_0x468cd1,_0x3c786c,!![]);}catch(_0xa574d4){return BPromise[_0xdb76('0x24')](_0xa574d4);}return _0x468cd1[_0xdb76('0x25')]();};}function saveUpdates(_0x54706a,_0x389668){return function(_0x3718e1){if(_0x3718e1){return _0x3718e1[_0xdb76('0x26')](_0x54706a)[_0xdb76('0x27')](function(_0x560433){return _0x560433;});}return null;};}function removeEntity(_0xd3f54f,_0x5cbf51){return function(_0x12f479){if(_0x12f479){return _0x12f479[_0xdb76('0x28')]()[_0xdb76('0x27')](function(){var _0x402a53=_0x12f479[_0xdb76('0x29')]({'plain':!![]});var _0x25d904=[{'name':_0xdb76('0x2a'),'value':_0xdb76('0x2b'),'ignore':![]},{'name':_0xdb76('0x2c'),'value':_0xdb76('0x2d'),'ignore':![]},{'name':_0xdb76('0x2e'),'value':'internal','ignore':![]}];var _0xc0498=_(_0x25d904)['filter'](_0xdb76('0x2f'))[_0xdb76('0x30')](_0xdb76('0x31'))['value']();if(_['includes'](_0xc0498,_0x402a53[_0xdb76('0x32')])){return;}var _0xa68943=_[_0xdb76('0x33')](_0x25d904,['value',_0x402a53[_0xdb76('0x32')]])[_0xdb76('0x34')];return db[_0xdb76('0x35')][_0xdb76('0x28')]({'where':{'type':_0xa68943,'resourceId':_0x402a53['id']}})[_0xdb76('0x27')](function(){return _0x12f479;});})[_0xdb76('0x27')](function(){_0xd3f54f[_0xdb76('0x1d')](0xcc)[_0xdb76('0x36')]();});}};}function handleEntityNotFound(_0x155494,_0x1c34f0){return function(_0x51a00e){if(!_0x51a00e){_0x155494[_0xdb76('0x1c')](0x194);}return _0x51a00e;};}function handleError(_0x3a469b,_0x10719d){_0x10719d=_0x10719d||0x1f4;return function(_0xfcf102){logger['error'](_0xfcf102['stack']);if(_0xfcf102[_0xdb76('0x34')]){delete _0xfcf102[_0xdb76('0x34')];}_0x3a469b[_0xdb76('0x1d')](_0x10719d)['send'](_0xfcf102);};}exports['index']=function(_0x1119dc,_0x4a02c7){var _0x5629eb={},_0x31118a={},_0x1b3228={'count':0x0,'rows':[]};var _0x4b656c=db[_0xdb76('0x37')][_0xdb76('0x38')];_0x31118a['model']=_['keys'](_0x4b656c);_0x31118a[_0xdb76('0x39')]=_[_0xdb76('0x3a')](_0x1119dc[_0xdb76('0x39')]);_0x31118a['filters']=_['intersection'](_0x31118a[_0xdb76('0x3b')],_0x31118a[_0xdb76('0x39')]);_0x5629eb[_0xdb76('0x3c')]=_[_0xdb76('0x3d')](_0x31118a[_0xdb76('0x3b')],qs[_0xdb76('0x3e')](_0x1119dc[_0xdb76('0x39')][_0xdb76('0x3e')]));_0x5629eb[_0xdb76('0x3c')]=_0x5629eb['attributes'][_0xdb76('0x3f')]?_0x5629eb[_0xdb76('0x3c')]:_0x31118a['model'];if(!_0x1119dc[_0xdb76('0x39')][_0xdb76('0x40')](_0xdb76('0x41'))){_0x5629eb[_0xdb76('0x21')]=qs[_0xdb76('0x21')](_0x1119dc[_0xdb76('0x39')][_0xdb76('0x21')]);_0x5629eb['offset']=qs['offset'](_0x1119dc[_0xdb76('0x39')][_0xdb76('0x20')]);}_0x5629eb['order']=qs[_0xdb76('0x42')](_0x1119dc['query'][_0xdb76('0x42')]);_0x5629eb[_0xdb76('0x43')]=qs['filters'](_[_0xdb76('0x44')](_0x1119dc[_0xdb76('0x39')],_0x31118a[_0xdb76('0x45')]));if(_0x1119dc[_0xdb76('0x39')][_0xdb76('0x46')]){_0x5629eb[_0xdb76('0x43')]=_['merge'](_0x5629eb['where'],{'$or':_['map'](_0x4b656c,function(_0x254a13){if(_0x254a13[_0xdb76('0x32')][_0xdb76('0x47')]!=='VIRTUAL'){var _0x58c283={};_0x58c283[_0x254a13[_0xdb76('0x48')]]={'$like':'%'+_0x1119dc['query']['filter']+'%'};return _0x58c283;}})});}_0x5629eb=_['merge']({},_0x5629eb,_0x1119dc[_0xdb76('0x49')]);var _0x92f567={'where':_0x5629eb[_0xdb76('0x43')]};return db[_0xdb76('0x37')]['count'](_0x92f567)[_0xdb76('0x27')](function(_0x46cc59){_0x1b3228[_0xdb76('0x1f')]=_0x46cc59;if(_0x1119dc['query']['includeAll']){_0x5629eb[_0xdb76('0x4a')]=[{'all':!![]}];}return db[_0xdb76('0x37')][_0xdb76('0x4b')](_0x5629eb);})['then'](function(_0x5bb81d){_0x1b3228[_0xdb76('0x4c')]=_0x5bb81d;return _0x1b3228;})[_0xdb76('0x27')](respondWithFilteredResult(_0x4a02c7,_0x5629eb))[_0xdb76('0x4d')](handleError(_0x4a02c7,null));};exports[_0xdb76('0x4e')]=function(_0x37ee26,_0x2ad47e){var _0x54304c={'raw':![],'where':{'id':_0x37ee26[_0xdb76('0x4f')]['id']}},_0x50383b={};_0x50383b['model']=_[_0xdb76('0x3a')](db[_0xdb76('0x37')][_0xdb76('0x38')]);_0x50383b['query']=_[_0xdb76('0x3a')](_0x37ee26[_0xdb76('0x39')]);_0x50383b['filters']=_['intersection'](_0x50383b[_0xdb76('0x3b')],_0x50383b[_0xdb76('0x39')]);_0x54304c[_0xdb76('0x3c')]=_['intersection'](_0x50383b[_0xdb76('0x3b')],qs[_0xdb76('0x3e')](_0x37ee26[_0xdb76('0x39')]['fields']));_0x54304c[_0xdb76('0x3c')]=_0x54304c[_0xdb76('0x3c')][_0xdb76('0x3f')]?_0x54304c[_0xdb76('0x3c')]:_0x50383b[_0xdb76('0x3b')];if(_0x37ee26['query'][_0xdb76('0x50')]){_0x54304c[_0xdb76('0x4a')]=[{'all':!![]}];}_0x54304c=_[_0xdb76('0x51')]({},_0x54304c,_0x37ee26[_0xdb76('0x49')]);return db[_0xdb76('0x37')]['find'](_0x54304c)[_0xdb76('0x27')](handleEntityNotFound(_0x2ad47e,null))[_0xdb76('0x27')](respondWithResult(_0x2ad47e,null))[_0xdb76('0x4d')](handleError(_0x2ad47e,null));};exports[_0xdb76('0x28')]=function(_0x14a780,_0x199186){return db['VoiceExtension'][_0xdb76('0x33')]({'where':{'id':_0x14a780[_0xdb76('0x4f')]['id']}})[_0xdb76('0x27')](handleEntityNotFound(_0x199186,null))[_0xdb76('0x27')](removeEntity(_0x199186,null))[_0xdb76('0x4d')](handleError(_0x199186,null));};exports[_0xdb76('0x52')]=function(_0x323b11,_0xb648a3){if(_0x323b11[_0xdb76('0x53')][_0xdb76('0x32')]===_0xdb76('0x2d')&&!_[_0xdb76('0x54')](_0x323b11[_0xdb76('0x53')]['exten'],'_')){_0x323b11[_0xdb76('0x53')][_0xdb76('0x55')]='_'[_0xdb76('0x56')](_0x323b11['body'][_0xdb76('0x55')]);}return db['VoiceExtension']['create'](_0x323b11[_0xdb76('0x53')],{'raw':![]})[_0xdb76('0x27')](function(_0x5a9935){var _0x27db2c=_0x323b11[_0xdb76('0x57')]['get']({'plain':!![]});if(!_0x27db2c)throw new Error(_0xdb76('0x58'));if(_0x27db2c['role']===_0xdb76('0x57')){var _0x2ea33c=_0x5a9935[_0xdb76('0x29')]({'plain':!![]});var _0x15fef5=[{'name':_0xdb76('0x2a'),'value':'inbound'},{'name':_0xdb76('0x2c'),'value':_0xdb76('0x2d')},{'name':_0xdb76('0x2e'),'value':_0xdb76('0x59')}];var _0x52a7d1=_[_0xdb76('0x33')](_0x15fef5,[_0xdb76('0x31'),_0x2ea33c['type']])[_0xdb76('0x34')];return db[_0xdb76('0x5a')][_0xdb76('0x33')]({'where':{'name':_0x52a7d1,'userProfileId':_0x27db2c[_0xdb76('0x5b')]},'raw':!![]})[_0xdb76('0x27')](function(_0x2eb209){if(_0x2eb209&&_0x2eb209['autoAssociation']===0x0){return db[_0xdb76('0x35')]['create']({'name':_0x2ea33c[_0xdb76('0x34')],'resourceId':_0x2ea33c['id'],'type':_0x2eb209[_0xdb76('0x34')],'sectionId':_0x2eb209['id']},{})['then'](function(){return _0x5a9935;});}else{return _0x5a9935;}})[_0xdb76('0x4d')](function(_0x4fb10c){logger[_0xdb76('0x5c')](_0xdb76('0x5d'),_0x4fb10c);throw _0x4fb10c;});}return _0x5a9935;})[_0xdb76('0x27')](respondWithResult(_0xb648a3,0xc9))[_0xdb76('0x4d')](handleError(_0xb648a3,null));};exports[_0xdb76('0x26')]=function(_0x1aacfa,_0x4922ad){if(_0x1aacfa[_0xdb76('0x53')]['id']){delete _0x1aacfa['body']['id'];}return db[_0xdb76('0x37')][_0xdb76('0x33')]({'where':{'id':_0x1aacfa[_0xdb76('0x4f')]['id']}})[_0xdb76('0x27')](handleEntityNotFound(_0x4922ad,null))[_0xdb76('0x27')](function(_0x2f8fc3){if(_0x2f8fc3){return db['VoiceExtension'][_0xdb76('0x26')](_['pick'](_0x1aacfa['body'],[_0xdb76('0x55'),_0xdb76('0x5e'),_0xdb76('0x5f'),_0xdb76('0x60'),_0xdb76('0x61'),_0xdb76('0x62')]),{'where':{'context':_0x2f8fc3[_0xdb76('0x5e')],'exten':_0x2f8fc3['exten']},'individualHooks':!![]})[_0xdb76('0x27')](function(_0x582dd9){return _0x582dd9;});}return null;})[_0xdb76('0x27')](respondWithStatusCode(_0x4922ad,null))['catch'](handleError(_0x4922ad,null));};exports[_0xdb76('0x63')]=function(_0x10e32,_0x2380e2,_0x53050a){return db[_0xdb76('0x37')][_0xdb76('0x64')]({'where':{'id':_0x10e32['params']['id']}})[_0xdb76('0x27')](handleEntityNotFound(_0x2380e2,null))[_0xdb76('0x27')](function(_0x5974dc){if(_0x5974dc){return db[_0xdb76('0x65')]['transaction'](function(_0x16b40b){return db[_0xdb76('0x37')][_0xdb76('0x28')]({'where':{'VoiceExtensionId':_0x10e32['params']['id']},'transaction':_0x16b40b})[_0xdb76('0x27')](function(_0x3aa400){var _0x510a30=_[_0xdb76('0x30')](_0x10e32[_0xdb76('0x53')],function(_0x4795d1){_0x4795d1['VoiceExtensionId']=_0x10e32['params']['id'];return _0x4795d1;});return db[_0xdb76('0x37')][_0xdb76('0x66')](_0x510a30,{'transaction':_0x16b40b});});})['then'](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x10e32['params']['id']},'order':_0xdb76('0x67')});});}})[_0xdb76('0x27')](respondWithResult(_0x2380e2,null))['catch'](handleError(_0x2380e2,null));}; \ No newline at end of file +var _0x9417=['reject','save','update','then','destroy','InboundRoutes','inbound','InternalRoutes','internal','filter','ignore','value','includes','type','find','name','UserProfileResource','error','send','index','VoiceExtension','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','show','params','options','body','outbound','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','description','recordingFormat','mandatoryDisposition','context','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','set','apply'];(function(_0x54e229,_0x5cffa3){var _0x2ecee3=function(_0x5774ce){while(--_0x5774ce){_0x54e229['push'](_0x54e229['shift']());}};_0x2ecee3(++_0x5cffa3);}(_0x9417,0xb4));var _0x7941=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9417[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0x7941('0x0'));var emlformat=require(_0x7941('0x1'));var rimraf=require(_0x7941('0x2'));var zipdir=require(_0x7941('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7941('0x4'));var moment=require(_0x7941('0x5'));var BPromise=require(_0x7941('0x6'));var Mustache=require(_0x7941('0x7'));var util=require(_0x7941('0x8'));var path=require(_0x7941('0x9'));var sox=require(_0x7941('0xa'));var csv=require(_0x7941('0xb'));var ejs=require(_0x7941('0xc'));var fs=require('fs');var _=require(_0x7941('0xd'));var squel=require('squel');var crypto=require(_0x7941('0xe'));var jsforce=require(_0x7941('0xf'));var deskjs=require(_0x7941('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7941('0x11'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x7941('0x12'));var Redis=require(_0x7941('0x13'));var qs=require(_0x7941('0x14'));var logger=require(_0x7941('0x15'))(_0x7941('0x16'));var utils=require(_0x7941('0x17'));var config=require(_0x7941('0x18'));var db=require(_0x7941('0x19'))['db'];config['redis']=_[_0x7941('0x1a')](config['redis'],{'host':_0x7941('0x1b'),'port':0x18eb});var socket=require(_0x7941('0x1c'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x7941('0x1d')](socket);function respondWithStatusCode(_0x59f371,_0x18936d){_0x18936d=_0x18936d||0xcc;return function(_0x45c08f){if(_0x45c08f){return _0x59f371[_0x7941('0x1e')](_0x18936d);}return _0x59f371[_0x7941('0x1f')](_0x18936d)[_0x7941('0x20')]();};}function respondWithResult(_0x41b098,_0x55320b){_0x55320b=_0x55320b||0xc8;return function(_0x11623c){if(_0x11623c){return _0x41b098[_0x7941('0x1f')](_0x55320b)[_0x7941('0x21')](_0x11623c);}};}function respondWithFilteredResult(_0x22dc49,_0x37af11){return function(_0x256f45){if(_0x256f45){var _0x4172a7=_0x256f45['count'],_0x573b44=_0x37af11[_0x7941('0x22')],_0x2941e1=_0x37af11['offset']+_0x37af11[_0x7941('0x23')],_0x533559;if(_0x2941e1>=_0x4172a7){_0x2941e1=_0x4172a7;_0x533559=0xc8;}else{_0x533559=0xce;}_0x22dc49[_0x7941('0x1f')](_0x533559);return _0x22dc49[_0x7941('0x24')]('Content-Range',_0x573b44+'-'+_0x2941e1+'/'+_0x4172a7)['json'](_0x256f45);}return null;};}function patchUpdates(_0x645e4c){return function(_0x4d3b28){try{jsonpatch[_0x7941('0x25')](_0x4d3b28,_0x645e4c,!![]);}catch(_0x57809b){return BPromise[_0x7941('0x26')](_0x57809b);}return _0x4d3b28[_0x7941('0x27')]();};}function saveUpdates(_0x42ff1f,_0x45ae78){return function(_0x3c2ae5){if(_0x3c2ae5){return _0x3c2ae5[_0x7941('0x28')](_0x42ff1f)[_0x7941('0x29')](function(_0x5287e0){return _0x5287e0;});}return null;};}function removeEntity(_0x20dd64,_0x531f20){return function(_0x36ff77){if(_0x36ff77){return _0x36ff77[_0x7941('0x2a')]()[_0x7941('0x29')](function(){var _0x1b8a27=_0x36ff77['get']({'plain':!![]});var _0x55f679=[{'name':_0x7941('0x2b'),'value':_0x7941('0x2c'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0x7941('0x2d'),'value':_0x7941('0x2e'),'ignore':![]}];var _0x2cf10d=_(_0x55f679)[_0x7941('0x2f')](_0x7941('0x30'))['map'](_0x7941('0x31'))[_0x7941('0x31')]();if(_[_0x7941('0x32')](_0x2cf10d,_0x1b8a27[_0x7941('0x33')])){return;}var _0x23f617=_[_0x7941('0x34')](_0x55f679,[_0x7941('0x31'),_0x1b8a27['type']])[_0x7941('0x35')];return db[_0x7941('0x36')][_0x7941('0x2a')]({'where':{'type':_0x23f617,'resourceId':_0x1b8a27['id']}})['then'](function(){return _0x36ff77;});})[_0x7941('0x29')](function(){_0x20dd64['status'](0xcc)[_0x7941('0x20')]();});}};}function handleEntityNotFound(_0x2856c8,_0x179449){return function(_0x56d577){if(!_0x56d577){_0x2856c8[_0x7941('0x1e')](0x194);}return _0x56d577;};}function handleError(_0x330b0c,_0x5d5c3c){_0x5d5c3c=_0x5d5c3c||0x1f4;return function(_0x372051){logger[_0x7941('0x37')](_0x372051['stack']);if(_0x372051[_0x7941('0x35')]){delete _0x372051[_0x7941('0x35')];}_0x330b0c['status'](_0x5d5c3c)[_0x7941('0x38')](_0x372051);};}exports[_0x7941('0x39')]=function(_0xfbaf95,_0x3592d9){var _0x2a18e2={},_0x442fa2={},_0x42c588={'count':0x0,'rows':[]};var _0x5143ec=db[_0x7941('0x3a')][_0x7941('0x3b')];_0x442fa2['model']=_[_0x7941('0x3c')](_0x5143ec);_0x442fa2[_0x7941('0x3d')]=_[_0x7941('0x3c')](_0xfbaf95[_0x7941('0x3d')]);_0x442fa2[_0x7941('0x3e')]=_[_0x7941('0x3f')](_0x442fa2['model'],_0x442fa2[_0x7941('0x3d')]);_0x2a18e2[_0x7941('0x40')]=_[_0x7941('0x3f')](_0x442fa2[_0x7941('0x41')],qs[_0x7941('0x42')](_0xfbaf95[_0x7941('0x3d')][_0x7941('0x42')]));_0x2a18e2['attributes']=_0x2a18e2[_0x7941('0x40')][_0x7941('0x43')]?_0x2a18e2['attributes']:_0x442fa2['model'];if(!_0xfbaf95[_0x7941('0x3d')][_0x7941('0x44')](_0x7941('0x45'))){_0x2a18e2[_0x7941('0x23')]=qs[_0x7941('0x23')](_0xfbaf95[_0x7941('0x3d')][_0x7941('0x23')]);_0x2a18e2[_0x7941('0x22')]=qs['offset'](_0xfbaf95[_0x7941('0x3d')]['offset']);}_0x2a18e2[_0x7941('0x46')]=qs[_0x7941('0x47')](_0xfbaf95[_0x7941('0x3d')][_0x7941('0x47')]);_0x2a18e2[_0x7941('0x48')]=qs['filters'](_['pick'](_0xfbaf95[_0x7941('0x3d')],_0x442fa2[_0x7941('0x3e')]));if(_0xfbaf95['query']['filter']){_0x2a18e2['where']=_[_0x7941('0x49')](_0x2a18e2['where'],{'$or':_[_0x7941('0x4a')](_0x5143ec,function(_0x1137a5){if(_0x1137a5[_0x7941('0x33')]['key']!==_0x7941('0x4b')){var _0x4c7b04={};_0x4c7b04[_0x1137a5[_0x7941('0x4c')]]={'$like':'%'+_0xfbaf95['query'][_0x7941('0x2f')]+'%'};return _0x4c7b04;}})});}_0x2a18e2=_['merge']({},_0x2a18e2,_0xfbaf95['options']);var _0x42abb7={'where':_0x2a18e2[_0x7941('0x48')]};return db[_0x7941('0x3a')][_0x7941('0x4d')](_0x42abb7)[_0x7941('0x29')](function(_0x1d8b67){_0x42c588[_0x7941('0x4d')]=_0x1d8b67;if(_0xfbaf95[_0x7941('0x3d')][_0x7941('0x4e')]){_0x2a18e2[_0x7941('0x4f')]=[{'all':!![]}];}return db[_0x7941('0x3a')][_0x7941('0x50')](_0x2a18e2);})[_0x7941('0x29')](function(_0x5ec111){_0x42c588[_0x7941('0x51')]=_0x5ec111;return _0x42c588;})[_0x7941('0x29')](respondWithFilteredResult(_0x3592d9,_0x2a18e2))[_0x7941('0x52')](handleError(_0x3592d9,null));};exports[_0x7941('0x53')]=function(_0x2849f7,_0x52d54f){var _0x5eff6a={'raw':![],'where':{'id':_0x2849f7[_0x7941('0x54')]['id']}},_0x53cd59={};_0x53cd59[_0x7941('0x41')]=_['keys'](db[_0x7941('0x3a')][_0x7941('0x3b')]);_0x53cd59[_0x7941('0x3d')]=_['keys'](_0x2849f7[_0x7941('0x3d')]);_0x53cd59[_0x7941('0x3e')]=_[_0x7941('0x3f')](_0x53cd59[_0x7941('0x41')],_0x53cd59[_0x7941('0x3d')]);_0x5eff6a['attributes']=_[_0x7941('0x3f')](_0x53cd59[_0x7941('0x41')],qs['fields'](_0x2849f7['query'][_0x7941('0x42')]));_0x5eff6a[_0x7941('0x40')]=_0x5eff6a['attributes'][_0x7941('0x43')]?_0x5eff6a[_0x7941('0x40')]:_0x53cd59[_0x7941('0x41')];if(_0x2849f7[_0x7941('0x3d')][_0x7941('0x4e')]){_0x5eff6a[_0x7941('0x4f')]=[{'all':!![]}];}_0x5eff6a=_[_0x7941('0x49')]({},_0x5eff6a,_0x2849f7[_0x7941('0x55')]);return db[_0x7941('0x3a')]['find'](_0x5eff6a)[_0x7941('0x29')](handleEntityNotFound(_0x52d54f,null))['then'](respondWithResult(_0x52d54f,null))[_0x7941('0x52')](handleError(_0x52d54f,null));};exports[_0x7941('0x2a')]=function(_0x29df60,_0x18e14b){return db[_0x7941('0x3a')][_0x7941('0x34')]({'where':{'id':_0x29df60['params']['id']}})[_0x7941('0x29')](handleEntityNotFound(_0x18e14b,null))[_0x7941('0x29')](removeEntity(_0x18e14b,null))[_0x7941('0x52')](handleError(_0x18e14b,null));};exports['create']=function(_0x2b9301,_0x66d3b4){if(_0x2b9301[_0x7941('0x56')][_0x7941('0x33')]===_0x7941('0x57')&&!_[_0x7941('0x58')](_0x2b9301[_0x7941('0x56')][_0x7941('0x59')],'_')){_0x2b9301[_0x7941('0x56')][_0x7941('0x59')]='_'[_0x7941('0x5a')](_0x2b9301['body'][_0x7941('0x59')]);}return db['VoiceExtension']['create'](_0x2b9301[_0x7941('0x56')],{'raw':![]})[_0x7941('0x29')](function(_0x529fbf){var _0x241e6d=_0x2b9301[_0x7941('0x5b')]['get']({'plain':!![]});if(!_0x241e6d)throw new Error(_0x7941('0x5c'));if(_0x241e6d['role']==='user'){var _0x388c08=_0x529fbf[_0x7941('0x5d')]({'plain':!![]});var _0x9177c4=[{'name':_0x7941('0x2b'),'value':_0x7941('0x2c')},{'name':'OutboundRoutes','value':_0x7941('0x57')},{'name':'InternalRoutes','value':_0x7941('0x2e')}];var _0xa0d635=_[_0x7941('0x34')](_0x9177c4,[_0x7941('0x31'),_0x388c08[_0x7941('0x33')]])[_0x7941('0x35')];return db[_0x7941('0x5e')][_0x7941('0x34')]({'where':{'name':_0xa0d635,'userProfileId':_0x241e6d[_0x7941('0x5f')]},'raw':!![]})[_0x7941('0x29')](function(_0x84fdc7){if(_0x84fdc7&&_0x84fdc7['autoAssociation']===0x0){return db[_0x7941('0x36')]['create']({'name':_0x388c08[_0x7941('0x35')],'resourceId':_0x388c08['id'],'type':_0x84fdc7[_0x7941('0x35')],'sectionId':_0x84fdc7['id']},{})[_0x7941('0x29')](function(){return _0x529fbf;});}else{return _0x529fbf;}})[_0x7941('0x52')](function(_0x4c3f32){logger[_0x7941('0x37')](_0x7941('0x60'),_0x4c3f32);throw _0x4c3f32;});}return _0x529fbf;})[_0x7941('0x29')](respondWithResult(_0x66d3b4,0xc9))[_0x7941('0x52')](handleError(_0x66d3b4,null));};exports[_0x7941('0x28')]=function(_0x2a3086,_0x118f02){if(_0x2a3086[_0x7941('0x56')]['id']){delete _0x2a3086[_0x7941('0x56')]['id'];}return db[_0x7941('0x3a')][_0x7941('0x34')]({'where':{'id':_0x2a3086[_0x7941('0x54')]['id']}})['then'](handleEntityNotFound(_0x118f02,null))[_0x7941('0x29')](function(_0x1d9444){if(_0x1d9444){return db[_0x7941('0x3a')][_0x7941('0x28')](_[_0x7941('0x61')](_0x2a3086[_0x7941('0x56')],[_0x7941('0x59'),'context',_0x7941('0x62'),_0x7941('0x63'),'cutdigits',_0x7941('0x64')]),{'where':{'context':_0x1d9444[_0x7941('0x65')],'exten':_0x1d9444[_0x7941('0x59')]},'individualHooks':!![]})[_0x7941('0x29')](function(_0x2fd43a){return _0x2fd43a;});}return null;})[_0x7941('0x29')](respondWithStatusCode(_0x118f02,null))['catch'](handleError(_0x118f02,null));};exports['addApplications']=function(_0x63318e,_0x21e31,_0x88523d){return db[_0x7941('0x3a')][_0x7941('0x66')]({'where':{'id':_0x63318e['params']['id']}})[_0x7941('0x29')](handleEntityNotFound(_0x21e31,null))[_0x7941('0x29')](function(_0x34e822){if(_0x34e822){return db[_0x7941('0x67')][_0x7941('0x68')](function(_0x1d6dd3){return db[_0x7941('0x3a')]['destroy']({'where':{'VoiceExtensionId':_0x63318e[_0x7941('0x54')]['id']},'transaction':_0x1d6dd3})[_0x7941('0x29')](function(_0x48705d){var _0x27deaf=_[_0x7941('0x4a')](_0x63318e[_0x7941('0x56')],function(_0x3dfd74){_0x3dfd74[_0x7941('0x69')]=_0x63318e[_0x7941('0x54')]['id'];return _0x3dfd74;});return db[_0x7941('0x3a')][_0x7941('0x6a')](_0x27deaf,{'transaction':_0x1d6dd3});});})[_0x7941('0x29')](function(){return db['VoiceExtension'][_0x7941('0x6b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x63318e[_0x7941('0x54')]['id']},'order':_0x7941('0x6c')});});}})[_0x7941('0x29')](respondWithResult(_0x21e31,null))['catch'](handleError(_0x21e31,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 31eeccc..e5c3b74 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 _0x015e=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','remove','emit'];(function(_0xe503ed,_0x3c6bb4){var _0x25bf8b=function(_0x323f02){while(--_0x323f02){_0xe503ed['push'](_0xe503ed['shift']());}};_0x25bf8b(++_0x3c6bb4);}(_0x015e,0xe4));var _0xe015=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x015e[_0x5d2803];return _0xdcad2c;};'use strict';var EventEmitter=require(_0xe015('0x0'));var VoiceExtension=require(_0xe015('0x1'))['db'][_0xe015('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe015('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe015('0x4')};function emitEvent(_0x42fed8){return function(_0x53ddf9,_0xf3a589,_0x2e60c6){VoiceExtensionEvents[_0xe015('0x5')](_0x42fed8+':'+_0x53ddf9['id'],_0x53ddf9);VoiceExtensionEvents[_0xe015('0x5')](_0x42fed8,_0x53ddf9);_0x2e60c6(null);};}for(var e in events){if(events[_0xe015('0x6')](e)){var event=events[e];VoiceExtension[_0xe015('0x7')](e,emitEvent(event));}}module[_0xe015('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xbc12=['../../mysqldb','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x8036e9,_0xb2a199){var _0x34a8eb=function(_0xa35740){while(--_0xa35740){_0x8036e9['push'](_0x8036e9['shift']());}};_0x34a8eb(++_0xb2a199);}(_0xbc12,0xa8));var _0x2bc1=function(_0x1d8b9c,_0xc2cdd3){_0x1d8b9c=_0x1d8b9c-0x0;var _0x459bf4=_0xbc12[_0x1d8b9c];return _0x459bf4;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x2bc1('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2bc1('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2bc1('0x2'),'afterDestroy':_0x2bc1('0x3')};function emitEvent(_0x106b7e){return function(_0xce613f,_0x5dde78,_0x4e4820){VoiceExtensionEvents[_0x2bc1('0x4')](_0x106b7e+':'+_0xce613f['id'],_0xce613f);VoiceExtensionEvents['emit'](_0x106b7e,_0xce613f);_0x4e4820(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x2bc1('0x5')](e,emitEvent(event));}}module[_0x2bc1('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 2bcb7f9..a316c7d 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 _0x68ea=['./voiceExtension.attributes','exports','VoiceExtension','voice_extensions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a24fb,_0x59ac99){var _0x524a73=function(_0x92aa25){while(--_0x92aa25){_0x1a24fb['push'](_0x1a24fb['shift']());}};_0x524a73(++_0x59ac99);}(_0x68ea,0x7d));var _0xa68e=function(_0x44e5d7,_0x1b78b5){_0x44e5d7=_0x44e5d7-0x0;var _0x5d1d9a=_0x68ea[_0x44e5d7];return _0x5d1d9a;};'use strict';var _=require(_0xa68e('0x0'));var util=require(_0xa68e('0x1'));var logger=require(_0xa68e('0x2'))(_0xa68e('0x3'));var moment=require(_0xa68e('0x4'));var BPromise=require(_0xa68e('0x5'));var rp=require(_0xa68e('0x6'));var attributes=require(_0xa68e('0x7'));module[_0xa68e('0x8')]=function(_0x21e702,_0x500cc0){return _0x21e702['define'](_0xa68e('0x9'),attributes,{'tableName':_0xa68e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7827=['api','moment','bluebird','request-promise','exports','define','voice_extensions','lodash'];(function(_0x179093,_0x4c46b1){var _0x4d573e=function(_0x1ff960){while(--_0x1ff960){_0x179093['push'](_0x179093['shift']());}};_0x4d573e(++_0x4c46b1);}(_0x7827,0x13f));var _0x7782=function(_0x570496,_0x26a150){_0x570496=_0x570496-0x0;var _0x1d4204=_0x7827[_0x570496];return _0x1d4204;};'use strict';var _=require(_0x7782('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7782('0x1'));var moment=require(_0x7782('0x2'));var BPromise=require(_0x7782('0x3'));var rp=require(_0x7782('0x4'));var attributes=require('./voiceExtension.attributes');module[_0x7782('0x5')]=function(_0x1208f1,_0x42162e){return _0x1208f1[_0x7782('0x6')]('VoiceExtension',attributes,{'tableName':_0x7782('0x7'),'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 cf33401..0edb8c1 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 _0xa9e0=['map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceExtension','findAll','options','raw','where','attributes','limit','include'];(function(_0x2f81e8,_0xeac67c){var _0x8d068=function(_0x56b906){while(--_0x56b906){_0x2f81e8['push'](_0x2f81e8['shift']());}};_0x8d068(++_0xeac67c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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('./voiceExtension.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')]('VoiceExtension,\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['VoiceExtension'][_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')]('GetVoiceExtension',_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')]));});});}; \ No newline at end of file +var _0xaa88=['where','limit','include','map','model','attributes','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceExtension,\x20%s,\x20%s','catch','GetVoiceExtension','VoiceExtension','findAll','options'];(function(_0x380f24,_0x4ed3f6){var _0x47c8dd=function(_0x4261fc){while(--_0x4261fc){_0x380f24['push'](_0x380f24['shift']());}};_0x47c8dd(++_0x4ed3f6);}(_0xaa88,0x137));var _0x8aa8=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xaa88[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});config['redis']=_[_0x8aa8('0xb')](config[_0x8aa8('0xc')],{'host':_0x8aa8('0xd'),'port':0x18eb});var socket=require(_0x8aa8('0xe'))(new Redis(config['redis']));require(_0x8aa8('0xf'))[_0x8aa8('0x10')](socket);function respondWithRpcPromise(_0x224f25,_0x5c94d4,_0x4702ab){return new BPromise(function(_0x9f78f5,_0x357e05){return client[_0x8aa8('0x11')](_0x224f25,_0x4702ab)['then'](function(_0x3f8100){logger[_0x8aa8('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x5c94d4,_0x8aa8('0x13'));logger[_0x8aa8('0x14')](_0x8aa8('0x15'),_0x5c94d4,'request\x20sent',JSON[_0x8aa8('0x16')](_0x3f8100));if(_0x3f8100[_0x8aa8('0x17')]){if(_0x3f8100[_0x8aa8('0x17')]['code']===0x1f4){logger[_0x8aa8('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x5c94d4,_0x3f8100['error'][_0x8aa8('0x18')]);return _0x357e05(_0x3f8100[_0x8aa8('0x17')][_0x8aa8('0x18')]);}logger[_0x8aa8('0x17')](_0x8aa8('0x19'),_0x5c94d4,_0x3f8100[_0x8aa8('0x17')][_0x8aa8('0x18')]);return _0x9f78f5(_0x3f8100[_0x8aa8('0x17')][_0x8aa8('0x18')]);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x5c94d4,_0x8aa8('0x13'));_0x9f78f5(_0x3f8100['result']['message']);}})[_0x8aa8('0x1a')](function(_0x5ac0d9){logger[_0x8aa8('0x17')](_0x8aa8('0x19'),_0x5c94d4,_0x5ac0d9);_0x357e05(_0x5ac0d9);});});}exports[_0x8aa8('0x1b')]=function(_0x2d5c1b){var _0x502547=this;return new Promise(function(_0xcc2c19,_0x36c445){return db[_0x8aa8('0x1c')][_0x8aa8('0x1d')]({'raw':_0x2d5c1b[_0x8aa8('0x1e')]?_0x2d5c1b[_0x8aa8('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2d5c1b[_0x8aa8('0x1e')]?_0x2d5c1b['options'][_0x8aa8('0x1f')]||null:null,'attributes':_0x2d5c1b['options']?_0x2d5c1b[_0x8aa8('0x1e')]['attributes']||null:null,'limit':_0x2d5c1b[_0x8aa8('0x1e')]?_0x2d5c1b[_0x8aa8('0x1e')][_0x8aa8('0x20')]||null:null,'include':_0x2d5c1b['options']?_0x2d5c1b[_0x8aa8('0x1e')][_0x8aa8('0x21')]?_[_0x8aa8('0x22')](_0x2d5c1b['options']['include'],function(_0x2d1508){return{'model':db[_0x2d1508[_0x8aa8('0x23')]],'as':_0x2d1508['as'],'attributes':_0x2d1508[_0x8aa8('0x24')],'include':_0x2d1508[_0x8aa8('0x21')]?_[_0x8aa8('0x22')](_0x2d1508['include'],function(_0x2bc34a){return{'model':db[_0x2bc34a['model']],'as':_0x2bc34a['as'],'attributes':_0x2bc34a[_0x8aa8('0x24')],'include':_0x2bc34a[_0x8aa8('0x21')]?_[_0x8aa8('0x22')](_0x2bc34a['include'],function(_0x4c5c5c){return{'model':db[_0x4c5c5c[_0x8aa8('0x23')]],'as':_0x4c5c5c['as'],'attributes':_0x4c5c5c['attributes']};}):[]};}):[]};}):[]:[]})[_0x8aa8('0x25')](function(_0x14be8b){logger[_0x8aa8('0x12')](_0x8aa8('0x1b'),_0x2d5c1b);logger[_0x8aa8('0x14')]('GetVoiceExtension',_0x2d5c1b,JSON[_0x8aa8('0x16')](_0x14be8b));_0xcc2c19(_0x14be8b);})[_0x8aa8('0x1a')](function(_0x4b67f5){logger[_0x8aa8('0x17')](_0x8aa8('0x1b'),_0x4b67f5[_0x8aa8('0x18')],_0x2d5c1b);_0x36c445(_0x502547['error'](0x1f4,_0x4b67f5[_0x8aa8('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 410c23b..62d7063 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 _0xde36=['voiceExtension:','./voiceExtension.events','save','remove','update','removeListener','register','length'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xde36,0x101));var _0x6de3=function(_0x3d73dd,_0x12e953){_0x3d73dd=_0x3d73dd-0x0;var _0x4e1126=_0xde36[_0x3d73dd];return _0x4e1126;};'use strict';var VoiceExtensionEvents=require(_0x6de3('0x0'));var events=[_0x6de3('0x1'),_0x6de3('0x2'),_0x6de3('0x3')];function createListener(_0x2ddccc,_0x4867c2){return function(_0x5047b9){_0x4867c2['emit'](_0x2ddccc,_0x5047b9);};}function removeListener(_0x17b869,_0x5cb0f5){return function(){VoiceExtensionEvents[_0x6de3('0x4')](_0x17b869,_0x5cb0f5);};}exports[_0x6de3('0x5')]=function(_0x12d2b7){for(var _0x3fb93d=0x0,_0x2b7a33=events[_0x6de3('0x6')];_0x3fb93d<_0x2b7a33;_0x3fb93d++){var _0x30eb65=events[_0x3fb93d];var _0x3fd1dd=createListener(_0x6de3('0x7')+_0x30eb65,_0x12d2b7);VoiceExtensionEvents['on'](_0x30eb65,_0x3fd1dd);}}; \ No newline at end of file +var _0x1698=['length','voiceExtension:','update','emit','removeListener'];(function(_0x150d5e,_0x5a86fb){var _0x23b9a1=function(_0x3e6cb2){while(--_0x3e6cb2){_0x150d5e['push'](_0x150d5e['shift']());}};_0x23b9a1(++_0x5a86fb);}(_0x1698,0x1c4));var _0x8169=function(_0x4fa291,_0x56e289){_0x4fa291=_0x4fa291-0x0;var _0x506d9b=_0x1698[_0x4fa291];return _0x506d9b;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=['save','remove',_0x8169('0x0')];function createListener(_0x3f509f,_0x5aaed7){return function(_0x58b69e){_0x5aaed7[_0x8169('0x1')](_0x3f509f,_0x58b69e);};}function removeListener(_0x1a6bcc,_0x4aed65){return function(){VoiceExtensionEvents[_0x8169('0x2')](_0x1a6bcc,_0x4aed65);};}exports['register']=function(_0x443782){for(var _0x1efbbc=0x0,_0x1c7e16=events[_0x8169('0x3')];_0x1efbbc<_0x1c7e16;_0x1efbbc++){var _0x42d312=events[_0x1efbbc];var _0x14ef1c=createListener(_0x8169('0x4')+_0x42d312,_0x443782);VoiceExtensionEvents['on'](_0x42d312,_0x14ef1c);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index a98cfc4..211d61e 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 _0xe750=['multer','util','path','connect-timeout','express','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','post','create','put','update','delete','exports'];(function(_0x105278,_0x774ed2){var _0x47b1f=function(_0xf8a100){while(--_0xf8a100){_0x105278['push'](_0x105278['shift']());}};_0x47b1f(++_0x774ed2);}(_0xe750,0x18f));var _0x0e75=function(_0x542e97,_0x353639){_0x542e97=_0x542e97-0x0;var _0x104245=_0xe750[_0x542e97];return _0x104245;};'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['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e75('0x5'));var controller=require(_0x0e75('0x6'));router[_0x0e75('0x7')]('/',auth[_0x0e75('0x8')](),controller[_0x0e75('0x9')]);router[_0x0e75('0x7')](_0x0e75('0xa'),auth[_0x0e75('0x8')](),controller[_0x0e75('0xb')]);router[_0x0e75('0x7')](_0x0e75('0xc'),auth[_0x0e75('0x8')](),controller['getMessages']);router[_0x0e75('0xd')]('/',auth[_0x0e75('0x8')](),controller[_0x0e75('0xe')]);router[_0x0e75('0xf')](_0x0e75('0xa'),auth[_0x0e75('0x8')](),controller[_0x0e75('0x10')]);router[_0x0e75('0x11')](_0x0e75('0xa'),auth[_0x0e75('0x8')](),controller['destroy']);module[_0x0e75('0x12')]=router; \ No newline at end of file +var _0xae60=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','/:id/messages','getMessages','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2af353,_0x418430){var _0x3f3f4e=function(_0x186bb5){while(--_0x186bb5){_0x2af353['push'](_0x2af353['shift']());}};_0x3f3f4e(++_0x418430);}(_0xae60,0xd4));var _0x0ae6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xae60[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0ae6('0x0'));var util=require('util');var path=require(_0x0ae6('0x1'));var timeout=require(_0x0ae6('0x2'));var express=require(_0x0ae6('0x3'));var router=express[_0x0ae6('0x4')]();var auth=require(_0x0ae6('0x5'));var interaction=require(_0x0ae6('0x6'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x0ae6('0x7')]('/',auth[_0x0ae6('0x8')](),controller['index']);router['get'](_0x0ae6('0x9'),auth[_0x0ae6('0x8')](),controller['show']);router['get'](_0x0ae6('0xa'),auth[_0x0ae6('0x8')](),controller[_0x0ae6('0xb')]);router['post']('/',auth[_0x0ae6('0x8')](),controller[_0x0ae6('0xc')]);router[_0x0ae6('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x0ae6('0xe')]);router[_0x0ae6('0xf')](_0x0ae6('0x9'),auth[_0x0ae6('0x8')](),controller[_0x0ae6('0x10')]);module[_0x0ae6('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index a2014c2..d56c100 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 _0x12fa=['setDataValue','trim','central','yes','ENUM','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','exports','STRING','from-voicemail','contest_mailbox'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x12fa,0x122));var _0xa12f=function(_0xcf4260,_0xe48af6){_0xcf4260=_0xcf4260-0x0;var _0x5ad781=_0x12fa[_0xcf4260];return _0x5ad781;};'use strict';var Sequelize=require('sequelize');module[_0xa12f('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa12f('0x1')],'defaultValue':_0xa12f('0x2'),'unique':_0xa12f('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xa12f('0x3')},'password':{'type':Sequelize[_0xa12f('0x1')]},'fullname':{'type':Sequelize[_0xa12f('0x1')]},'email':{'type':Sequelize[_0xa12f('0x1')],'validate':{'isEmail':!![]},'set':function(_0x3e5aad){this[_0xa12f('0x4')]('email',typeof _0x3e5aad==='string'&&_0x3e5aad[_0xa12f('0x5')]()?_0x3e5aad[_0xa12f('0x5')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xa12f('0x1')],'defaultValue':_0xa12f('0x6')},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xa12f('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0xa12f('0x8')]('yes','no'),'defaultValue':_0xa12f('0x7'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xa12f('0x1')]},'review':{'type':Sequelize['ENUM'](_0xa12f('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xa12f('0x8')](_0xa12f('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xa12f('0x8')](_0xa12f('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xa12f('0x8')](_0xa12f('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xa12f('0x8')](_0xa12f('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xa12f('0x8')](_0xa12f('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xa12f('0x7'),'no'),'defaultValue':_0xa12f('0x7'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xa12f('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xa12f('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xa12f('0x7'),'no'),'defaultValue':_0xa12f('0x7'),'allowNull':![]},'stamp':{'type':_0xa12f('0x9')},'emailsubject':{'type':Sequelize[_0xa12f('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xa12f('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xa12f('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xa12f('0xb')](_0xa12f('0xc'))+_0xa12f('0xd')+this[_0xa12f('0xb')]('mailbox');}}}; \ No newline at end of file +var _0xf9ed=['string','trim','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','sequelize','exports','STRING','from-voicemail','setDataValue','email'];(function(_0x54827d,_0x293f1c){var _0x19bf0f=function(_0x1dd837){while(--_0x1dd837){_0x54827d['push'](_0x54827d['shift']());}};_0x19bf0f(++_0x293f1c);}(_0xf9ed,0x10a));var _0xdf9e=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xf9ed[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0xdf9e('0x0'));module[_0xdf9e('0x1')]={'customer_id':{'type':Sequelize[_0xdf9e('0x2')]},'context':{'type':Sequelize[_0xdf9e('0x2')],'defaultValue':_0xdf9e('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xdf9e('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xdf9e('0x2')]},'fullname':{'type':Sequelize[_0xdf9e('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x202769){this[_0xdf9e('0x4')](_0xdf9e('0x5'),typeof _0x202769===_0xdf9e('0x6')&&_0x202769[_0xdf9e('0x7')]()?_0x202769['trim']():null);}},'pager':{'type':Sequelize[_0xdf9e('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0xdf9e('0x8')](_0xdf9e('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xdf9e('0x8')](_0xdf9e('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xdf9e('0x2')]},'callback':{'type':Sequelize[_0xdf9e('0x2')]},'review':{'type':Sequelize[_0xdf9e('0x8')](_0xdf9e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xdf9e('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xdf9e('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xdf9e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xdf9e('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xdf9e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xdf9e('0x8')](_0xdf9e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xdf9e('0x8')](_0xdf9e('0x9'),'no'),'defaultValue':_0xdf9e('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xdf9e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xdf9e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xdf9e('0x8')]('yes','no'),'defaultValue':_0xdf9e('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xdf9e('0x2')]},'emailbody':{'type':Sequelize[_0xdf9e('0x2')]},'maxsecs':{'type':Sequelize[_0xdf9e('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xdf9e('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xdf9e('0xc')],'get':function(){return this['getDataValue'](_0xdf9e('0xd'))+_0xdf9e('0xe')+this[_0xdf9e('0xf')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 033f07b..5fcf107 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 _0xfac9=['rimraf','fast-json-patch','request-promise','moment','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','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','update','then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','send','index','VoiceMail','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','filters','filter','where','merge','map','type','includeAll','include','findAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','nolimit','pick','VoiceMailMessage','findAndCountAll','eml-format'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0xfac9,0xa3));var _0x9fac=function(_0x542949,_0x44b5cc){_0x542949=_0x542949-0x0;var _0x1f6fca=_0xfac9[_0x542949];return _0x1f6fca;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9fac('0x0'));var rimraf=require(_0x9fac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9fac('0x2'));var rp=require(_0x9fac('0x3'));var moment=require(_0x9fac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9fac('0x5'));var util=require(_0x9fac('0x6'));var path=require(_0x9fac('0x7'));var sox=require(_0x9fac('0x8'));var csv=require(_0x9fac('0x9'));var ejs=require(_0x9fac('0xa'));var fs=require('fs');var _=require(_0x9fac('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9fac('0xc'));var deskjs=require(_0x9fac('0xd'));var toCsv=require(_0x9fac('0x9'));var querystring=require(_0x9fac('0xe'));var Papa=require(_0x9fac('0xf'));var authService=require(_0x9fac('0x10'));var hardwareService=require(_0x9fac('0x11'));var Redis=require(_0x9fac('0x12'));var qs=require(_0x9fac('0x13'));var logger=require(_0x9fac('0x14'))(_0x9fac('0x15'));var utils=require(_0x9fac('0x16'));var config=require('../../config/environment');var db=require(_0x9fac('0x17'))['db'];function respondWithStatusCode(_0x54dd33,_0x1a5755){_0x1a5755=_0x1a5755||0xcc;return function(_0x5efe54){if(_0x5efe54){return _0x54dd33[_0x9fac('0x18')](_0x1a5755);}return _0x54dd33[_0x9fac('0x19')](_0x1a5755)['end']();};}function respondWithResult(_0x1b3b0a,_0x37a73e){_0x37a73e=_0x37a73e||0xc8;return function(_0x3fa1be){if(_0x3fa1be){return _0x1b3b0a[_0x9fac('0x19')](_0x37a73e)[_0x9fac('0x1a')](_0x3fa1be);}};}function respondWithFilteredResult(_0x203178,_0x597f43){return function(_0x29dee3){if(_0x29dee3){var _0x4dbab3=_0x29dee3[_0x9fac('0x1b')],_0x1b7910=_0x597f43[_0x9fac('0x1c')],_0x5a65f3=_0x597f43['offset']+_0x597f43['limit'],_0x44ca18;if(_0x5a65f3>=_0x4dbab3){_0x5a65f3=_0x4dbab3;_0x44ca18=0xc8;}else{_0x44ca18=0xce;}_0x203178[_0x9fac('0x19')](_0x44ca18);return _0x203178['set'](_0x9fac('0x1d'),_0x1b7910+'-'+_0x5a65f3+'/'+_0x4dbab3)['json'](_0x29dee3);}return null;};}function patchUpdates(_0x5830d2){return function(_0x49db85){try{jsonpatch[_0x9fac('0x1e')](_0x49db85,_0x5830d2,!![]);}catch(_0x11669a){return BPromise[_0x9fac('0x1f')](_0x11669a);}return _0x49db85['save']();};}function saveUpdates(_0x5f3cdd,_0x4f0336){return function(_0x2ded45){if(_0x2ded45){return _0x2ded45[_0x9fac('0x20')](_0x5f3cdd)[_0x9fac('0x21')](function(_0x17d0a3){return _0x17d0a3;});}return null;};}function removeEntity(_0x24950f,_0x170c7d){return function(_0x4f0563){if(_0x4f0563){return _0x4f0563[_0x9fac('0x22')]()['then'](function(){var _0x47b9b2=_0x4f0563[_0x9fac('0x23')]({'plain':!![]});var _0x3090ca=_0x9fac('0x24');return db[_0x9fac('0x25')][_0x9fac('0x22')]({'where':{'type':_0x3090ca,'resourceId':_0x47b9b2['id']}})[_0x9fac('0x21')](function(){return _0x4f0563;});})[_0x9fac('0x21')](function(){_0x24950f[_0x9fac('0x19')](0xcc)[_0x9fac('0x26')]();});}};}function handleEntityNotFound(_0x492a68,_0x1845c1){return function(_0x3ef300){if(!_0x3ef300){_0x492a68[_0x9fac('0x18')](0x194);}return _0x3ef300;};}function handleError(_0x56353c,_0x3dc1d6){_0x3dc1d6=_0x3dc1d6||0x1f4;return function(_0x1a96b9){logger[_0x9fac('0x27')](_0x1a96b9[_0x9fac('0x28')]);if(_0x1a96b9[_0x9fac('0x29')]){delete _0x1a96b9[_0x9fac('0x29')];}_0x56353c[_0x9fac('0x19')](_0x3dc1d6)[_0x9fac('0x2a')](_0x1a96b9);};}exports[_0x9fac('0x2b')]=function(_0x5a1fe8,_0x331b02){var _0x10dc50={},_0x5eb2bd={},_0x352645={'count':0x0,'rows':[]};var _0x35e0a8=db[_0x9fac('0x2c')][_0x9fac('0x2d')];_0x5eb2bd[_0x9fac('0x2e')]=_[_0x9fac('0x2f')](_0x35e0a8);_0x5eb2bd[_0x9fac('0x30')]=_['keys'](_0x5a1fe8[_0x9fac('0x30')]);_0x5eb2bd['filters']=_['intersection'](_0x5eb2bd[_0x9fac('0x2e')],_0x5eb2bd[_0x9fac('0x30')]);_0x10dc50['attributes']=_[_0x9fac('0x31')](_0x5eb2bd[_0x9fac('0x2e')],qs[_0x9fac('0x32')](_0x5a1fe8['query'][_0x9fac('0x32')]));_0x10dc50[_0x9fac('0x33')]=_0x10dc50[_0x9fac('0x33')][_0x9fac('0x34')]?_0x10dc50['attributes']:_0x5eb2bd[_0x9fac('0x2e')];if(!_0x5a1fe8[_0x9fac('0x30')][_0x9fac('0x35')]('nolimit')){_0x10dc50[_0x9fac('0x36')]=qs[_0x9fac('0x36')](_0x5a1fe8[_0x9fac('0x30')][_0x9fac('0x36')]);_0x10dc50['offset']=qs[_0x9fac('0x1c')](_0x5a1fe8[_0x9fac('0x30')][_0x9fac('0x1c')]);}_0x10dc50[_0x9fac('0x37')]=qs['sort'](_0x5a1fe8[_0x9fac('0x30')][_0x9fac('0x38')]);_0x10dc50['where']=qs[_0x9fac('0x39')](_['pick'](_0x5a1fe8[_0x9fac('0x30')],_0x5eb2bd[_0x9fac('0x39')]));if(_0x5a1fe8[_0x9fac('0x30')][_0x9fac('0x3a')]){_0x10dc50[_0x9fac('0x3b')]=_[_0x9fac('0x3c')](_0x10dc50[_0x9fac('0x3b')],{'$or':_[_0x9fac('0x3d')](_0x35e0a8,function(_0x18ef82){if(_0x18ef82[_0x9fac('0x3e')]['key']!=='VIRTUAL'){var _0x530a66={};_0x530a66[_0x18ef82['field']]={'$like':'%'+_0x5a1fe8[_0x9fac('0x30')][_0x9fac('0x3a')]+'%'};return _0x530a66;}})});}_0x10dc50=_[_0x9fac('0x3c')]({},_0x10dc50,_0x5a1fe8['options']);var _0x3c74c3={'where':_0x10dc50[_0x9fac('0x3b')]};return db[_0x9fac('0x2c')][_0x9fac('0x1b')](_0x3c74c3)[_0x9fac('0x21')](function(_0x34b7f9){_0x352645[_0x9fac('0x1b')]=_0x34b7f9;if(_0x5a1fe8['query'][_0x9fac('0x3f')]){_0x10dc50[_0x9fac('0x40')]=[{'all':!![]}];}return db[_0x9fac('0x2c')][_0x9fac('0x41')](_0x10dc50);})[_0x9fac('0x21')](function(_0x4f252e){_0x352645['rows']=_0x4f252e;return _0x352645;})[_0x9fac('0x21')](respondWithFilteredResult(_0x331b02,_0x10dc50))['catch'](handleError(_0x331b02,null));};exports['show']=function(_0x4a4adc,_0x47d447){var _0xb07c7c={'raw':!![],'where':{'id':_0x4a4adc['params']['id']}},_0x43e083={};_0x43e083[_0x9fac('0x2e')]=_['keys'](db[_0x9fac('0x2c')][_0x9fac('0x2d')]);_0x43e083[_0x9fac('0x30')]=_[_0x9fac('0x2f')](_0x4a4adc['query']);_0x43e083[_0x9fac('0x39')]=_[_0x9fac('0x31')](_0x43e083[_0x9fac('0x2e')],_0x43e083[_0x9fac('0x30')]);_0xb07c7c[_0x9fac('0x33')]=_[_0x9fac('0x31')](_0x43e083[_0x9fac('0x2e')],qs['fields'](_0x4a4adc['query']['fields']));_0xb07c7c['attributes']=_0xb07c7c[_0x9fac('0x33')][_0x9fac('0x34')]?_0xb07c7c[_0x9fac('0x33')]:_0x43e083['model'];if(_0x4a4adc[_0x9fac('0x30')][_0x9fac('0x3f')]){_0xb07c7c[_0x9fac('0x40')]=[{'all':!![]}];}_0xb07c7c=_[_0x9fac('0x3c')]({},_0xb07c7c,_0x4a4adc[_0x9fac('0x42')]);return db[_0x9fac('0x2c')][_0x9fac('0x43')](_0xb07c7c)[_0x9fac('0x21')](handleEntityNotFound(_0x47d447,null))['then'](respondWithResult(_0x47d447,null))[_0x9fac('0x44')](handleError(_0x47d447,null));};exports[_0x9fac('0x45')]=function(_0x2f9c51,_0x552130){return db[_0x9fac('0x2c')][_0x9fac('0x45')](_0x2f9c51[_0x9fac('0x46')],{})['then'](function(_0x44d844){var _0xfaf271=_0x2f9c51[_0x9fac('0x47')][_0x9fac('0x23')]({'plain':!![]});if(!_0xfaf271)throw new Error(_0x9fac('0x48'));if(_0xfaf271['role']===_0x9fac('0x47')){var _0x45693e=_0x44d844[_0x9fac('0x23')]({'plain':!![]});var _0x5e007d='Voicemails';return db[_0x9fac('0x49')]['find']({'where':{'name':_0x5e007d,'userProfileId':_0xfaf271[_0x9fac('0x4a')]},'raw':!![]})[_0x9fac('0x21')](function(_0x387952){if(_0x387952&&_0x387952[_0x9fac('0x4b')]===0x0){return db[_0x9fac('0x25')]['create']({'name':_0x45693e[_0x9fac('0x29')],'resourceId':_0x45693e['id'],'type':_0x387952[_0x9fac('0x29')],'sectionId':_0x387952['id']},{})[_0x9fac('0x21')](function(){return _0x44d844;});}else{return _0x44d844;}})[_0x9fac('0x44')](function(_0x1f55b7){logger[_0x9fac('0x27')](_0x9fac('0x4c'),_0x1f55b7);throw _0x1f55b7;});}return _0x44d844;})[_0x9fac('0x21')](respondWithResult(_0x552130,0xc9))['catch'](handleError(_0x552130,null));};exports[_0x9fac('0x20')]=function(_0x52f14d,_0x598d6a){if(_0x52f14d['body']['id']){delete _0x52f14d[_0x9fac('0x46')]['id'];}return db['VoiceMail'][_0x9fac('0x43')]({'where':{'id':_0x52f14d[_0x9fac('0x4d')]['id']}})[_0x9fac('0x21')](handleEntityNotFound(_0x598d6a,null))['then'](saveUpdates(_0x52f14d['body'],null))['then'](respondWithResult(_0x598d6a,null))['catch'](handleError(_0x598d6a,null));};exports[_0x9fac('0x22')]=function(_0x2b94de,_0x44bf2a){return db[_0x9fac('0x2c')]['find']({'where':{'id':_0x2b94de[_0x9fac('0x4d')]['id']}})['then'](handleEntityNotFound(_0x44bf2a,null))[_0x9fac('0x21')](removeEntity(_0x44bf2a,null))[_0x9fac('0x44')](handleError(_0x44bf2a,null));};exports['getMessages']=function(_0x4e1e87,_0x59649d,_0x183291){return db['VoiceMail']['findOne']({'where':{'id':_0x4e1e87[_0x9fac('0x4d')]['id']}})[_0x9fac('0x21')](handleEntityNotFound(_0x59649d,null))[_0x9fac('0x21')](function(_0xed441){var _0x1e57bb;var _0x45db0e={},_0x52bf4a={};_0x52bf4a[_0x9fac('0x2e')]=_[_0x9fac('0x2f')](db['VoiceMailMessage'][_0x9fac('0x2d')]);_0x52bf4a[_0x9fac('0x30')]=_[_0x9fac('0x2f')](_0x4e1e87[_0x9fac('0x30')]);_0x52bf4a['filters']=_['intersection'](_0x52bf4a[_0x9fac('0x2e')],_0x52bf4a[_0x9fac('0x30')]);_0x45db0e[_0x9fac('0x33')]=_[_0x9fac('0x31')](_0x52bf4a[_0x9fac('0x2e')],qs['fields'](_0x4e1e87['query'][_0x9fac('0x32')]));_0x45db0e[_0x9fac('0x33')]=_0x45db0e[_0x9fac('0x33')][_0x9fac('0x34')]?_0x45db0e[_0x9fac('0x33')]:_0x52bf4a[_0x9fac('0x2e')];if(!_0x4e1e87[_0x9fac('0x30')][_0x9fac('0x35')](_0x9fac('0x4e'))){_0x45db0e[_0x9fac('0x36')]=qs[_0x9fac('0x36')](_0x4e1e87['query'][_0x9fac('0x36')]);_0x45db0e[_0x9fac('0x1c')]=qs[_0x9fac('0x1c')](_0x4e1e87[_0x9fac('0x30')][_0x9fac('0x1c')]);}_0x45db0e[_0x9fac('0x37')]=qs['sort'](_0x4e1e87[_0x9fac('0x30')]['sort']);_0x45db0e[_0x9fac('0x3b')]=qs['filters'](_[_0x9fac('0x4f')](_0x4e1e87['query'],_0x52bf4a[_0x9fac('0x39')]));if(_0x4e1e87['query'][_0x9fac('0x3a')]){_0x45db0e[_0x9fac('0x3b')]=_[_0x9fac('0x3c')](_0x45db0e['where'],{'$or':_[_0x9fac('0x3d')](_0x45db0e[_0x9fac('0x33')],function(_0x372227){var _0x165725={};_0x165725[_0x372227]={'$like':'%'+_0x4e1e87[_0x9fac('0x30')][_0x9fac('0x3a')]+'%'};return _0x165725;})});}_0x45db0e[_0x9fac('0x3b')]=_[_0x9fac('0x3c')](_0x45db0e['where'],{'mailboxuser':_0xed441['mailbox']});_0x45db0e=_[_0x9fac('0x3c')]({},_0x45db0e,_0x4e1e87['options']);return db[_0x9fac('0x50')][_0x9fac('0x51')](_0x45db0e)['then'](respondWithFilteredResult(_0x59649d,_0x45db0e));})['catch'](handleError(_0x59649d,null));}; \ No newline at end of file +var _0xdf93=['Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','send','index','VoiceMail','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','VoiceMailMessage','order','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set'];(function(_0x192851,_0x598494){var _0x515ac0=function(_0x1aff30){while(--_0x1aff30){_0x192851['push'](_0x192851['shift']());}};_0x515ac0(++_0x598494);}(_0xdf93,0x192));var _0x3df9=function(_0xdc5e5e,_0x124f3c){_0xdc5e5e=_0xdc5e5e-0x0;var _0x20af19=_0xdf93[_0xdc5e5e];return _0x20af19;};'use strict';var pdf=require(_0x3df9('0x0'));var emlformat=require(_0x3df9('0x1'));var rimraf=require(_0x3df9('0x2'));var zipdir=require(_0x3df9('0x3'));var jsonpatch=require(_0x3df9('0x4'));var rp=require(_0x3df9('0x5'));var moment=require(_0x3df9('0x6'));var BPromise=require(_0x3df9('0x7'));var Mustache=require(_0x3df9('0x8'));var util=require(_0x3df9('0x9'));var path=require(_0x3df9('0xa'));var sox=require(_0x3df9('0xb'));var csv=require(_0x3df9('0xc'));var ejs=require(_0x3df9('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3df9('0xe'));var crypto=require(_0x3df9('0xf'));var jsforce=require(_0x3df9('0x10'));var deskjs=require(_0x3df9('0x11'));var toCsv=require(_0x3df9('0xc'));var querystring=require(_0x3df9('0x12'));var Papa=require(_0x3df9('0x13'));var authService=require('../../components/auth/service');var hardwareService=require(_0x3df9('0x14'));var Redis=require(_0x3df9('0x15'));var qs=require(_0x3df9('0x16'));var logger=require('../../config/logger')(_0x3df9('0x17'));var utils=require('../../config/utils');var config=require(_0x3df9('0x18'));var db=require(_0x3df9('0x19'))['db'];function respondWithStatusCode(_0x280d6e,_0x243df1){_0x243df1=_0x243df1||0xcc;return function(_0x39fa80){if(_0x39fa80){return _0x280d6e[_0x3df9('0x1a')](_0x243df1);}return _0x280d6e[_0x3df9('0x1b')](_0x243df1)[_0x3df9('0x1c')]();};}function respondWithResult(_0x59cabb,_0x409326){_0x409326=_0x409326||0xc8;return function(_0xc0ae3a){if(_0xc0ae3a){return _0x59cabb[_0x3df9('0x1b')](_0x409326)['json'](_0xc0ae3a);}};}function respondWithFilteredResult(_0x4d68ba,_0x1efd7f){return function(_0x42cd04){if(_0x42cd04){var _0x16d872=_0x42cd04[_0x3df9('0x1d')],_0x10e30f=_0x1efd7f[_0x3df9('0x1e')],_0x5e99ef=_0x1efd7f['offset']+_0x1efd7f[_0x3df9('0x1f')],_0x40a8d5;if(_0x5e99ef>=_0x16d872){_0x5e99ef=_0x16d872;_0x40a8d5=0xc8;}else{_0x40a8d5=0xce;}_0x4d68ba[_0x3df9('0x1b')](_0x40a8d5);return _0x4d68ba[_0x3df9('0x20')](_0x3df9('0x21'),_0x10e30f+'-'+_0x5e99ef+'/'+_0x16d872)['json'](_0x42cd04);}return null;};}function patchUpdates(_0x362bbe){return function(_0x9360d3){try{jsonpatch[_0x3df9('0x22')](_0x9360d3,_0x362bbe,!![]);}catch(_0x5dc44e){return BPromise[_0x3df9('0x23')](_0x5dc44e);}return _0x9360d3[_0x3df9('0x24')]();};}function saveUpdates(_0x367121,_0x1a02d4){return function(_0x115b56){if(_0x115b56){return _0x115b56[_0x3df9('0x25')](_0x367121)[_0x3df9('0x26')](function(_0x55f7d3){return _0x55f7d3;});}return null;};}function removeEntity(_0x40c835,_0xa8858d){return function(_0x1bc885){if(_0x1bc885){return _0x1bc885[_0x3df9('0x27')]()['then'](function(){var _0x267d96=_0x1bc885[_0x3df9('0x28')]({'plain':!![]});var _0x51b0e0=_0x3df9('0x29');return db[_0x3df9('0x2a')][_0x3df9('0x27')]({'where':{'type':_0x51b0e0,'resourceId':_0x267d96['id']}})['then'](function(){return _0x1bc885;});})[_0x3df9('0x26')](function(){_0x40c835[_0x3df9('0x1b')](0xcc)[_0x3df9('0x1c')]();});}};}function handleEntityNotFound(_0x37d56d,_0x11c7e9){return function(_0x3bc67e){if(!_0x3bc67e){_0x37d56d['sendStatus'](0x194);}return _0x3bc67e;};}function handleError(_0x55ea76,_0x251162){_0x251162=_0x251162||0x1f4;return function(_0x52f988){logger[_0x3df9('0x2b')](_0x52f988['stack']);if(_0x52f988[_0x3df9('0x2c')]){delete _0x52f988[_0x3df9('0x2c')];}_0x55ea76['status'](_0x251162)[_0x3df9('0x2d')](_0x52f988);};}exports[_0x3df9('0x2e')]=function(_0x38d1b6,_0x46de58){var _0x6718e7={},_0x5bef2b={},_0x102290={'count':0x0,'rows':[]};var _0x1d278c=db[_0x3df9('0x2f')][_0x3df9('0x30')];_0x5bef2b[_0x3df9('0x31')]=_['keys'](_0x1d278c);_0x5bef2b[_0x3df9('0x32')]=_[_0x3df9('0x33')](_0x38d1b6[_0x3df9('0x32')]);_0x5bef2b[_0x3df9('0x34')]=_[_0x3df9('0x35')](_0x5bef2b[_0x3df9('0x31')],_0x5bef2b[_0x3df9('0x32')]);_0x6718e7['attributes']=_['intersection'](_0x5bef2b[_0x3df9('0x31')],qs[_0x3df9('0x36')](_0x38d1b6[_0x3df9('0x32')][_0x3df9('0x36')]));_0x6718e7[_0x3df9('0x37')]=_0x6718e7[_0x3df9('0x37')][_0x3df9('0x38')]?_0x6718e7[_0x3df9('0x37')]:_0x5bef2b[_0x3df9('0x31')];if(!_0x38d1b6[_0x3df9('0x32')][_0x3df9('0x39')]('nolimit')){_0x6718e7[_0x3df9('0x1f')]=qs[_0x3df9('0x1f')](_0x38d1b6[_0x3df9('0x32')][_0x3df9('0x1f')]);_0x6718e7['offset']=qs[_0x3df9('0x1e')](_0x38d1b6['query'][_0x3df9('0x1e')]);}_0x6718e7['order']=qs[_0x3df9('0x3a')](_0x38d1b6['query'][_0x3df9('0x3a')]);_0x6718e7[_0x3df9('0x3b')]=qs[_0x3df9('0x34')](_[_0x3df9('0x3c')](_0x38d1b6[_0x3df9('0x32')],_0x5bef2b[_0x3df9('0x34')]));if(_0x38d1b6[_0x3df9('0x32')][_0x3df9('0x3d')]){_0x6718e7['where']=_[_0x3df9('0x3e')](_0x6718e7[_0x3df9('0x3b')],{'$or':_[_0x3df9('0x3f')](_0x1d278c,function(_0x5b9eeb){if(_0x5b9eeb[_0x3df9('0x40')][_0x3df9('0x41')]!==_0x3df9('0x42')){var _0x32e457={};_0x32e457[_0x5b9eeb[_0x3df9('0x43')]]={'$like':'%'+_0x38d1b6[_0x3df9('0x32')][_0x3df9('0x3d')]+'%'};return _0x32e457;}})});}_0x6718e7=_[_0x3df9('0x3e')]({},_0x6718e7,_0x38d1b6[_0x3df9('0x44')]);var _0x52d7fe={'where':_0x6718e7[_0x3df9('0x3b')]};return db[_0x3df9('0x2f')][_0x3df9('0x1d')](_0x52d7fe)[_0x3df9('0x26')](function(_0x5287e0){_0x102290[_0x3df9('0x1d')]=_0x5287e0;if(_0x38d1b6[_0x3df9('0x32')][_0x3df9('0x45')]){_0x6718e7[_0x3df9('0x46')]=[{'all':!![]}];}return db[_0x3df9('0x2f')][_0x3df9('0x47')](_0x6718e7);})[_0x3df9('0x26')](function(_0xf3da8b){_0x102290['rows']=_0xf3da8b;return _0x102290;})[_0x3df9('0x26')](respondWithFilteredResult(_0x46de58,_0x6718e7))[_0x3df9('0x48')](handleError(_0x46de58,null));};exports['show']=function(_0x270cd8,_0x4417ed){var _0x5f0389={'raw':!![],'where':{'id':_0x270cd8[_0x3df9('0x49')]['id']}},_0x13f032={};_0x13f032[_0x3df9('0x31')]=_[_0x3df9('0x33')](db[_0x3df9('0x2f')][_0x3df9('0x30')]);_0x13f032[_0x3df9('0x32')]=_[_0x3df9('0x33')](_0x270cd8[_0x3df9('0x32')]);_0x13f032[_0x3df9('0x34')]=_[_0x3df9('0x35')](_0x13f032['model'],_0x13f032[_0x3df9('0x32')]);_0x5f0389[_0x3df9('0x37')]=_['intersection'](_0x13f032[_0x3df9('0x31')],qs[_0x3df9('0x36')](_0x270cd8[_0x3df9('0x32')]['fields']));_0x5f0389[_0x3df9('0x37')]=_0x5f0389[_0x3df9('0x37')]['length']?_0x5f0389[_0x3df9('0x37')]:_0x13f032[_0x3df9('0x31')];if(_0x270cd8[_0x3df9('0x32')][_0x3df9('0x45')]){_0x5f0389[_0x3df9('0x46')]=[{'all':!![]}];}_0x5f0389=_[_0x3df9('0x3e')]({},_0x5f0389,_0x270cd8[_0x3df9('0x44')]);return db['VoiceMail'][_0x3df9('0x4a')](_0x5f0389)[_0x3df9('0x26')](handleEntityNotFound(_0x4417ed,null))[_0x3df9('0x26')](respondWithResult(_0x4417ed,null))[_0x3df9('0x48')](handleError(_0x4417ed,null));};exports[_0x3df9('0x4b')]=function(_0x7818bd,_0x745ae6){return db['VoiceMail'][_0x3df9('0x4b')](_0x7818bd[_0x3df9('0x4c')],{})[_0x3df9('0x26')](function(_0x53e80a){var _0x485113=_0x7818bd['user'][_0x3df9('0x28')]({'plain':!![]});if(!_0x485113)throw new Error(_0x3df9('0x4d'));if(_0x485113[_0x3df9('0x4e')]===_0x3df9('0x4f')){var _0x2adeb5=_0x53e80a[_0x3df9('0x28')]({'plain':!![]});var _0x5dc0c1=_0x3df9('0x29');return db[_0x3df9('0x50')][_0x3df9('0x4a')]({'where':{'name':_0x5dc0c1,'userProfileId':_0x485113['userProfileId']},'raw':!![]})[_0x3df9('0x26')](function(_0x5a4679){if(_0x5a4679&&_0x5a4679[_0x3df9('0x51')]===0x0){return db[_0x3df9('0x2a')][_0x3df9('0x4b')]({'name':_0x2adeb5[_0x3df9('0x2c')],'resourceId':_0x2adeb5['id'],'type':_0x5a4679['name'],'sectionId':_0x5a4679['id']},{})[_0x3df9('0x26')](function(){return _0x53e80a;});}else{return _0x53e80a;}})['catch'](function(_0x57a919){logger['error'](_0x3df9('0x52'),_0x57a919);throw _0x57a919;});}return _0x53e80a;})[_0x3df9('0x26')](respondWithResult(_0x745ae6,0xc9))[_0x3df9('0x48')](handleError(_0x745ae6,null));};exports[_0x3df9('0x25')]=function(_0x38d0b6,_0x5e1d24){if(_0x38d0b6[_0x3df9('0x4c')]['id']){delete _0x38d0b6['body']['id'];}return db[_0x3df9('0x2f')][_0x3df9('0x4a')]({'where':{'id':_0x38d0b6['params']['id']}})[_0x3df9('0x26')](handleEntityNotFound(_0x5e1d24,null))['then'](saveUpdates(_0x38d0b6[_0x3df9('0x4c')],null))[_0x3df9('0x26')](respondWithResult(_0x5e1d24,null))[_0x3df9('0x48')](handleError(_0x5e1d24,null));};exports[_0x3df9('0x27')]=function(_0x414f4b,_0x5ce22a){return db[_0x3df9('0x2f')]['find']({'where':{'id':_0x414f4b[_0x3df9('0x49')]['id']}})[_0x3df9('0x26')](handleEntityNotFound(_0x5ce22a,null))['then'](removeEntity(_0x5ce22a,null))[_0x3df9('0x48')](handleError(_0x5ce22a,null));};exports['getMessages']=function(_0x7f8783,_0x443bfd,_0x1c796c){return db[_0x3df9('0x2f')]['findOne']({'where':{'id':_0x7f8783['params']['id']}})[_0x3df9('0x26')](handleEntityNotFound(_0x443bfd,null))[_0x3df9('0x26')](function(_0x10d58d){var _0x14e1f1;var _0x3e096f={},_0x2a1d31={};_0x2a1d31[_0x3df9('0x31')]=_[_0x3df9('0x33')](db[_0x3df9('0x53')][_0x3df9('0x30')]);_0x2a1d31[_0x3df9('0x32')]=_[_0x3df9('0x33')](_0x7f8783[_0x3df9('0x32')]);_0x2a1d31[_0x3df9('0x34')]=_[_0x3df9('0x35')](_0x2a1d31['model'],_0x2a1d31[_0x3df9('0x32')]);_0x3e096f[_0x3df9('0x37')]=_[_0x3df9('0x35')](_0x2a1d31['model'],qs[_0x3df9('0x36')](_0x7f8783['query'][_0x3df9('0x36')]));_0x3e096f['attributes']=_0x3e096f[_0x3df9('0x37')]['length']?_0x3e096f['attributes']:_0x2a1d31[_0x3df9('0x31')];if(!_0x7f8783[_0x3df9('0x32')]['hasOwnProperty']('nolimit')){_0x3e096f[_0x3df9('0x1f')]=qs[_0x3df9('0x1f')](_0x7f8783[_0x3df9('0x32')][_0x3df9('0x1f')]);_0x3e096f['offset']=qs['offset'](_0x7f8783['query']['offset']);}_0x3e096f[_0x3df9('0x54')]=qs['sort'](_0x7f8783['query'][_0x3df9('0x3a')]);_0x3e096f['where']=qs[_0x3df9('0x34')](_[_0x3df9('0x3c')](_0x7f8783[_0x3df9('0x32')],_0x2a1d31[_0x3df9('0x34')]));if(_0x7f8783[_0x3df9('0x32')]['filter']){_0x3e096f[_0x3df9('0x3b')]=_['merge'](_0x3e096f[_0x3df9('0x3b')],{'$or':_[_0x3df9('0x3f')](_0x3e096f[_0x3df9('0x37')],function(_0x3f63f1){var _0x3297a8={};_0x3297a8[_0x3f63f1]={'$like':'%'+_0x7f8783[_0x3df9('0x32')][_0x3df9('0x3d')]+'%'};return _0x3297a8;})});}_0x3e096f[_0x3df9('0x3b')]=_[_0x3df9('0x3e')](_0x3e096f['where'],{'mailboxuser':_0x10d58d[_0x3df9('0x55')]});_0x3e096f=_[_0x3df9('0x3e')]({},_0x3e096f,_0x7f8783[_0x3df9('0x44')]);return db[_0x3df9('0x53')][_0x3df9('0x56')](_0x3e096f)[_0x3df9('0x26')](respondWithFilteredResult(_0x443bfd,_0x3e096f));})[_0x3df9('0x48')](handleError(_0x443bfd,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 20b8815..eed9cba 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 _0xb91c=['./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x431e02,_0x4079d8){var _0x317960=function(_0x25bf2f){while(--_0x25bf2f){_0x431e02['push'](_0x431e02['shift']());}};_0x317960(++_0x4079d8);}(_0xb91c,0xe8));var _0xcb91=function(_0x357a13,_0x268a2e){_0x357a13=_0x357a13-0x0;var _0x43e4b7=_0xb91c[_0x357a13];return _0x43e4b7;};'use strict';var _=require(_0xcb91('0x0'));var util=require(_0xcb91('0x1'));var logger=require(_0xcb91('0x2'))(_0xcb91('0x3'));var moment=require(_0xcb91('0x4'));var BPromise=require('bluebird');var rp=require(_0xcb91('0x5'));var attributes=require(_0xcb91('0x6'));module[_0xcb91('0x7')]=function(_0x745c3d,_0xfb8fcc){return _0x745c3d[_0xcb91('0x8')](_0xcb91('0x9'),attributes,{'tableName':_0xcb91('0xa'),'paranoid':![],'indexes':[{'name':_0xcb91('0xb'),'fields':[_0xcb91('0xc'),_0xcb91('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0071=['voice_voicemail','mailbox_context','mailbox','context','lodash','../../config/logger','api','moment','bluebird','request-promise','exports','define'];(function(_0x46f6d1,_0x145a9f){var _0x451480=function(_0x41708a){while(--_0x41708a){_0x46f6d1['push'](_0x46f6d1['shift']());}};_0x451480(++_0x145a9f);}(_0x0071,0xac));var _0x1007=function(_0x5d1ac8,_0x977cd9){_0x5d1ac8=_0x5d1ac8-0x0;var _0x9caf80=_0x0071[_0x5d1ac8];return _0x9caf80;};'use strict';var _=require(_0x1007('0x0'));var util=require('util');var logger=require(_0x1007('0x1'))(_0x1007('0x2'));var moment=require(_0x1007('0x3'));var BPromise=require(_0x1007('0x4'));var rp=require(_0x1007('0x5'));var attributes=require('./voiceMail.attributes');module[_0x1007('0x6')]=function(_0x51996a,_0x34301a){return _0x51996a[_0x1007('0x7')]('VoiceMail',attributes,{'tableName':_0x1007('0x8'),'paranoid':![],'indexes':[{'name':_0x1007('0x9'),'fields':[_0x1007('0xa'),_0x1007('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 58470b9..5b5fb64 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 _0x5938=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5938,0x1cc));var _0x8593=function(_0x5503a4,_0xe274be){_0x5503a4=_0x5503a4-0x0;var _0x2222c6=_0x5938[_0x5503a4];return _0x2222c6;};'use strict';var _=require(_0x8593('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8593('0x1'));var rs=require(_0x8593('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8593('0x3'))['db'];var utils=require(_0x8593('0x4'));var logger=require(_0x8593('0x5'))('rpc');var config=require(_0x8593('0x6'));var jayson=require(_0x8593('0x7'));var client=jayson[_0x8593('0x8')][_0x8593('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10b6f2,_0x3b36da,_0xd6e0c1){return new BPromise(function(_0x373ff9,_0x201c8c){return client[_0x8593('0xa')](_0x10b6f2,_0xd6e0c1)[_0x8593('0xb')](function(_0x18bc4f){logger[_0x8593('0xc')](_0x8593('0xd'),_0x3b36da,'request\x20sent');logger[_0x8593('0xe')](_0x8593('0xf'),_0x3b36da,'request\x20sent',JSON[_0x8593('0x10')](_0x18bc4f));if(_0x18bc4f[_0x8593('0x11')]){if(_0x18bc4f[_0x8593('0x11')][_0x8593('0x12')]===0x1f4){logger['error'](_0x8593('0xd'),_0x3b36da,_0x18bc4f[_0x8593('0x11')][_0x8593('0x13')]);return _0x201c8c(_0x18bc4f[_0x8593('0x11')][_0x8593('0x13')]);}logger[_0x8593('0x11')]('VoiceMail,\x20%s,\x20%s',_0x3b36da,_0x18bc4f[_0x8593('0x11')][_0x8593('0x13')]);return _0x373ff9(_0x18bc4f['error'][_0x8593('0x13')]);}else{logger[_0x8593('0xc')](_0x8593('0xd'),_0x3b36da,_0x8593('0x14'));_0x373ff9(_0x18bc4f[_0x8593('0x15')][_0x8593('0x13')]);}})['catch'](function(_0x1277a1){logger['error']('VoiceMail,\x20%s,\x20%s',_0x3b36da,_0x1277a1);_0x201c8c(_0x1277a1);});});} \ No newline at end of file +var _0xce93=['result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x21f9c2,_0x2b3d2a){var _0x3da17f=function(_0x57e2b9){while(--_0x57e2b9){_0x21f9c2['push'](_0x21f9c2['shift']());}};_0x3da17f(++_0x2b3d2a);}(_0xce93,0x1a5));var _0x3ce9=function(_0x1e830c,_0x31776b){_0x1e830c=_0x1e830c-0x0;var _0x3196e9=_0xce93[_0x1e830c];return _0x3196e9;};'use strict';var _=require(_0x3ce9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3ce9('0x1'));var rs=require(_0x3ce9('0x2'));var fs=require('fs');var Redis=require(_0x3ce9('0x3'));var db=require(_0x3ce9('0x4'))['db'];var utils=require(_0x3ce9('0x5'));var logger=require('../../config/logger')(_0x3ce9('0x6'));var config=require(_0x3ce9('0x7'));var jayson=require(_0x3ce9('0x8'));var client=jayson['client'][_0x3ce9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11d2b5,_0x274a05,_0x3c3aa1){return new BPromise(function(_0x442bdc,_0x4366a9){return client[_0x3ce9('0xa')](_0x11d2b5,_0x3c3aa1)[_0x3ce9('0xb')](function(_0x53549b){logger[_0x3ce9('0xc')](_0x3ce9('0xd'),_0x274a05,_0x3ce9('0xe'));logger[_0x3ce9('0xf')](_0x3ce9('0x10'),_0x274a05,'request\x20sent',JSON['stringify'](_0x53549b));if(_0x53549b[_0x3ce9('0x11')]){if(_0x53549b[_0x3ce9('0x11')][_0x3ce9('0x12')]===0x1f4){logger['error'](_0x3ce9('0xd'),_0x274a05,_0x53549b[_0x3ce9('0x11')][_0x3ce9('0x13')]);return _0x4366a9(_0x53549b[_0x3ce9('0x11')][_0x3ce9('0x13')]);}logger[_0x3ce9('0x11')](_0x3ce9('0xd'),_0x274a05,_0x53549b[_0x3ce9('0x11')][_0x3ce9('0x13')]);return _0x442bdc(_0x53549b[_0x3ce9('0x11')][_0x3ce9('0x13')]);}else{logger[_0x3ce9('0xc')](_0x3ce9('0xd'),_0x274a05,_0x3ce9('0xe'));_0x442bdc(_0x53549b[_0x3ce9('0x14')][_0x3ce9('0x13')]);}})['catch'](function(_0xbd1faa){logger[_0x3ce9('0x11')](_0x3ce9('0xd'),_0x274a05,_0xbd1faa);_0x4366a9(_0xbd1faa);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index d88e3fc..cf40aa3 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 _0xd9da=['isAuthenticated','show','post','create','update','delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id'];(function(_0x557c07,_0x2e979e){var _0x21cb4d=function(_0x44e8e1){while(--_0x44e8e1){_0x557c07['push'](_0x557c07['shift']());}};_0x21cb4d(++_0x2e979e);}(_0xd9da,0xc7));var _0xad9d=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xd9da[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0xad9d('0x0'));var util=require('util');var path=require(_0xad9d('0x1'));var timeout=require('connect-timeout');var express=require(_0xad9d('0x2'));var router=express[_0xad9d('0x3')]();var auth=require(_0xad9d('0x4'));var interaction=require(_0xad9d('0x5'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0xad9d('0x6')]('/',auth['isAuthenticated'](),controller[_0xad9d('0x7')]);router[_0xad9d('0x6')](_0xad9d('0x8'),auth[_0xad9d('0x9')](),controller[_0xad9d('0xa')]);router[_0xad9d('0x6')]('/:id/download',auth[_0xad9d('0x9')](),controller['download']);router[_0xad9d('0xb')]('/',auth[_0xad9d('0x9')](),controller[_0xad9d('0xc')]);router['put'](_0xad9d('0x8'),auth[_0xad9d('0x9')](),controller[_0xad9d('0xd')]);router[_0xad9d('0xe')](_0xad9d('0x8'),auth[_0xad9d('0x9')](),controller[_0xad9d('0xf')]);module['exports']=router; \ No newline at end of file +var _0x5fc4=['download','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x4caf9b,_0x3607ec){var _0x57d8b9=function(_0x1c5332){while(--_0x1c5332){_0x4caf9b['push'](_0x4caf9b['shift']());}};_0x57d8b9(++_0x3607ec);}(_0x5fc4,0x1eb));var _0x45fc=function(_0xecfdc6,_0x10fcf5){_0xecfdc6=_0xecfdc6-0x0;var _0x9eb75b=_0x5fc4[_0xecfdc6];return _0x9eb75b;};'use strict';var multer=require(_0x45fc('0x0'));var util=require(_0x45fc('0x1'));var path=require(_0x45fc('0x2'));var timeout=require(_0x45fc('0x3'));var express=require(_0x45fc('0x4'));var router=express[_0x45fc('0x5')]();var auth=require(_0x45fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x45fc('0x7'));var controller=require(_0x45fc('0x8'));router[_0x45fc('0x9')]('/',auth[_0x45fc('0xa')](),controller[_0x45fc('0xb')]);router['get'](_0x45fc('0xc'),auth[_0x45fc('0xa')](),controller[_0x45fc('0xd')]);router[_0x45fc('0x9')](_0x45fc('0xe'),auth[_0x45fc('0xa')](),controller[_0x45fc('0xf')]);router[_0x45fc('0x10')]('/',auth[_0x45fc('0xa')](),controller[_0x45fc('0x11')]);router[_0x45fc('0x12')](_0x45fc('0xc'),auth[_0x45fc('0xa')](),controller[_0x45fc('0x13')]);router['delete']('/:id',auth[_0x45fc('0xa')](),controller[_0x45fc('0x14')]);module[_0x45fc('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index be4f55a..3e5f982 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 _0xf68a=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','exports','VIRTUAL'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf68a,0x11e));var _0xaf68=function(_0x208e01,_0x1a1f72){_0x208e01=_0x208e01-0x0;var _0x12d755=_0xf68a[_0x208e01];return _0x12d755;};'use strict';var Sequelize=require('sequelize');module[_0xaf68('0x0')]={'name':{'type':Sequelize[_0xaf68('0x1')],'get':function(_0x5f5d14){return this[_0xaf68('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xaf68('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xaf68('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xaf68('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xaf68('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xaf68('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xaf68('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xaf68('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xaf68('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xaf68('0x5')](_0xaf68('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xaf68('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xaf68('0x4')],'defaultValue':''},'stamp':{'type':_0xaf68('0x7'),'allowNull':![]}}; \ No newline at end of file +var _0x3470=['sequelize','exports','VIRTUAL','STRING','BLOB','long','TIMESTAMP'];(function(_0x50ccaf,_0x45cbee){var _0xfabc4b=function(_0xb7d41a){while(--_0xb7d41a){_0x50ccaf['push'](_0x50ccaf['shift']());}};_0xfabc4b(++_0x45cbee);}(_0x3470,0xc4));var _0x0347=function(_0x21aae3,_0x5ca332){_0x21aae3=_0x21aae3-0x0;var _0x350f86=_0x3470[_0x21aae3];return _0x350f86;};'use strict';var Sequelize=require(_0x0347('0x0'));module[_0x0347('0x1')]={'name':{'type':Sequelize[_0x0347('0x2')],'get':function(_0x5d2189){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x0347('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x0347('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x0347('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x0347('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x0347('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x0347('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x0347('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x0347('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x0347('0x4')](_0x0347('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x0347('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x0347('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 1d7ddc3..a15575c 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 _0x50a5=['../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','stack','name','index','VoiceMailMessage','differenceBy','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','key','VIRTUAL','includeAll','include','show','params','rawAttributes','create','body','catch','find','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','.wav\x22','set','html-pdf','eml-format','moment','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/environment'];(function(_0x2c1d42,_0x368d06){var _0x14e6b0=function(_0x510223){while(--_0x510223){_0x2c1d42['push'](_0x2c1d42['shift']());}};_0x14e6b0(++_0x368d06);}(_0x50a5,0xd1));var _0x550a=function(_0x49f192,_0x3a982a){_0x49f192=_0x49f192-0x0;var _0x4a6d36=_0x50a5[_0x49f192];return _0x4a6d36;};'use strict';var pdf=require(_0x550a('0x0'));var emlformat=require(_0x550a('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x550a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x550a('0x3'));var util=require(_0x550a('0x4'));var path=require(_0x550a('0x5'));var sox=require(_0x550a('0x6'));var csv=require(_0x550a('0x7'));var ejs=require(_0x550a('0x8'));var fs=require('fs');var _=require(_0x550a('0x9'));var squel=require(_0x550a('0xa'));var crypto=require(_0x550a('0xb'));var jsforce=require(_0x550a('0xc'));var deskjs=require(_0x550a('0xd'));var toCsv=require(_0x550a('0x7'));var querystring=require(_0x550a('0xe'));var Papa=require('papaparse');var authService=require(_0x550a('0xf'));var hardwareService=require(_0x550a('0x10'));var Redis=require(_0x550a('0x11'));var qs=require(_0x550a('0x12'));var logger=require(_0x550a('0x13'))(_0x550a('0x14'));var utils=require('../../config/utils');var config=require(_0x550a('0x15'));var db=require(_0x550a('0x16'))['db'];function respondWithStatusCode(_0x229a16,_0x16b5ba){_0x16b5ba=_0x16b5ba||0xcc;return function(_0x2fb177){if(_0x2fb177){return _0x229a16[_0x550a('0x17')](_0x16b5ba);}return _0x229a16[_0x550a('0x18')](_0x16b5ba)[_0x550a('0x19')]();};}function respondWithResult(_0x55713e,_0x2b53bd){_0x2b53bd=_0x2b53bd||0xc8;return function(_0x4d22ea){if(_0x4d22ea){return _0x55713e['status'](_0x2b53bd)[_0x550a('0x1a')](_0x4d22ea);}};}function respondWithFilteredResult(_0x1c2e7a,_0x4aee75){return function(_0x23d2db){if(_0x23d2db){var _0x4d1cb8=_0x23d2db[_0x550a('0x1b')],_0x388aaa=_0x4aee75[_0x550a('0x1c')],_0x4fa030=_0x4aee75[_0x550a('0x1c')]+_0x4aee75[_0x550a('0x1d')],_0x2a9f66;if(_0x4fa030>=_0x4d1cb8){_0x4fa030=_0x4d1cb8;_0x2a9f66=0xc8;}else{_0x2a9f66=0xce;}_0x1c2e7a[_0x550a('0x18')](_0x2a9f66);return _0x1c2e7a['set'](_0x550a('0x1e'),_0x388aaa+'-'+_0x4fa030+'/'+_0x4d1cb8)['json'](_0x23d2db);}return null;};}function patchUpdates(_0x2e2912){return function(_0x142a9f){try{jsonpatch[_0x550a('0x1f')](_0x142a9f,_0x2e2912,!![]);}catch(_0x31c19b){return BPromise[_0x550a('0x20')](_0x31c19b);}return _0x142a9f['save']();};}function saveUpdates(_0x54b07,_0x154174){return function(_0x252242){if(_0x252242){return _0x252242[_0x550a('0x21')](_0x54b07)[_0x550a('0x22')](function(_0x4bb936){return _0x4bb936;});}return null;};}function removeEntity(_0x2b2ee8,_0xb1b040){return function(_0x3d1c2d){if(_0x3d1c2d){return _0x3d1c2d[_0x550a('0x23')]()['then'](function(){_0x2b2ee8[_0x550a('0x18')](0xcc)[_0x550a('0x19')]();});}};}function handleEntityNotFound(_0xc48d09,_0x512517){return function(_0x2d03e5){if(!_0x2d03e5){_0xc48d09[_0x550a('0x17')](0x194);}return _0x2d03e5;};}function handleError(_0x4ab61d,_0x1d9a2f){_0x1d9a2f=_0x1d9a2f||0x1f4;return function(_0x5f2b67){logger['error'](_0x5f2b67[_0x550a('0x24')]);if(_0x5f2b67['name']){delete _0x5f2b67[_0x550a('0x25')];}_0x4ab61d['status'](_0x1d9a2f)['send'](_0x5f2b67);};}exports[_0x550a('0x26')]=function(_0x19b2cf,_0x19cbca){var _0x1eadba={},_0x288187={},_0x13b611={'count':0x0,'rows':[]};var _0x1996a4=db[_0x550a('0x27')]['rawAttributes'];_0x288187['model']=_[_0x550a('0x28')](_[_0x550a('0x29')](_0x1996a4),[_0x550a('0x25')]);_0x288187['query']=_[_0x550a('0x29')](_0x19b2cf['query']);_0x288187[_0x550a('0x2a')]=_[_0x550a('0x2b')](_0x288187[_0x550a('0x2c')],_0x288187[_0x550a('0x2d')]);_0x1eadba[_0x550a('0x2e')]=_[_0x550a('0x2b')](_0x288187[_0x550a('0x2c')],qs[_0x550a('0x2f')](_0x19b2cf[_0x550a('0x2d')][_0x550a('0x2f')]));_0x1eadba[_0x550a('0x2e')]=_0x1eadba['attributes'][_0x550a('0x30')]?_0x1eadba[_0x550a('0x2e')]:_0x288187['model'];if(!_0x19b2cf[_0x550a('0x2d')][_0x550a('0x31')]('nolimit')){_0x1eadba[_0x550a('0x1d')]=qs['limit'](_0x19b2cf[_0x550a('0x2d')][_0x550a('0x1d')]);_0x1eadba[_0x550a('0x1c')]=qs['offset'](_0x19b2cf[_0x550a('0x2d')]['offset']);}_0x1eadba[_0x550a('0x32')]=qs[_0x550a('0x33')](_0x19b2cf[_0x550a('0x2d')][_0x550a('0x33')]);_0x1eadba[_0x550a('0x34')]=qs[_0x550a('0x2a')](_[_0x550a('0x35')](_0x19b2cf[_0x550a('0x2d')],_0x288187[_0x550a('0x2a')]));if(_0x19b2cf[_0x550a('0x2d')][_0x550a('0x36')]){_0x1eadba[_0x550a('0x34')]=_[_0x550a('0x37')](_0x1eadba[_0x550a('0x34')],{'$or':_['map'](_0x1996a4,function(_0x3f8685){if(_0x3f8685['type'][_0x550a('0x38')]!==_0x550a('0x39')){var _0x3c26f9={};_0x3c26f9[_0x3f8685['field']]={'$like':'%'+_0x19b2cf['query']['filter']+'%'};return _0x3c26f9;}})});}_0x1eadba=_[_0x550a('0x37')]({},_0x1eadba,_0x19b2cf['options']);var _0x3a07a9={'where':_0x1eadba[_0x550a('0x34')]};return db[_0x550a('0x27')]['count'](_0x3a07a9)[_0x550a('0x22')](function(_0x2fc459){_0x13b611[_0x550a('0x1b')]=_0x2fc459;if(_0x19b2cf[_0x550a('0x2d')][_0x550a('0x3a')]){_0x1eadba[_0x550a('0x3b')]=[{'all':!![]}];}return db[_0x550a('0x27')]['findAll'](_0x1eadba);})[_0x550a('0x22')](function(_0x48f3f9){_0x13b611['rows']=_0x48f3f9;return _0x13b611;})[_0x550a('0x22')](respondWithFilteredResult(_0x19cbca,_0x1eadba))['catch'](handleError(_0x19cbca,null));};exports[_0x550a('0x3c')]=function(_0x49c681,_0x4cf05f){var _0x2d1c46={'raw':!![],'where':{'id':_0x49c681[_0x550a('0x3d')]['id']}},_0x272940={};_0x272940[_0x550a('0x2c')]=_[_0x550a('0x29')](db[_0x550a('0x27')][_0x550a('0x3e')]);_0x272940[_0x550a('0x2d')]=_[_0x550a('0x29')](_0x49c681[_0x550a('0x2d')]);_0x272940['filters']=_['intersection'](_0x272940[_0x550a('0x2c')],_0x272940[_0x550a('0x2d')]);_0x2d1c46['attributes']=_[_0x550a('0x2b')](_0x272940[_0x550a('0x2c')],qs[_0x550a('0x2f')](_0x49c681[_0x550a('0x2d')][_0x550a('0x2f')]));_0x2d1c46[_0x550a('0x2e')]=_0x2d1c46[_0x550a('0x2e')][_0x550a('0x30')]?_0x2d1c46['attributes']:_0x272940['model'];if(_0x49c681[_0x550a('0x2d')]['includeAll']){_0x2d1c46[_0x550a('0x3b')]=[{'all':!![]}];}_0x2d1c46=_[_0x550a('0x37')]({},_0x2d1c46,_0x49c681['options']);return db[_0x550a('0x27')]['find'](_0x2d1c46)[_0x550a('0x22')](handleEntityNotFound(_0x4cf05f,null))[_0x550a('0x22')](respondWithResult(_0x4cf05f,null))['catch'](handleError(_0x4cf05f,null));};exports[_0x550a('0x3f')]=function(_0xe8dde,_0x56ce11){return db['VoiceMailMessage'][_0x550a('0x3f')](_0xe8dde[_0x550a('0x40')],{})[_0x550a('0x22')](respondWithResult(_0x56ce11,0xc9))[_0x550a('0x41')](handleError(_0x56ce11,null));};exports['update']=function(_0x1f9acf,_0x1e019f){if(_0x1f9acf[_0x550a('0x40')]['id']){delete _0x1f9acf['body']['id'];}return db[_0x550a('0x27')]['find']({'where':{'id':_0x1f9acf['params']['id']}})['then'](handleEntityNotFound(_0x1e019f,null))[_0x550a('0x22')](saveUpdates(_0x1f9acf[_0x550a('0x40')],null))[_0x550a('0x22')](respondWithResult(_0x1e019f,null))[_0x550a('0x41')](handleError(_0x1e019f,null));};exports[_0x550a('0x23')]=function(_0x299e36,_0x53f97f){return db[_0x550a('0x27')][_0x550a('0x42')]({'where':{'id':_0x299e36['params']['id']}})[_0x550a('0x22')](handleEntityNotFound(_0x53f97f,null))['then'](removeEntity(_0x53f97f,null))[_0x550a('0x41')](handleError(_0x53f97f,null));};exports[_0x550a('0x43')]=function(_0x34b8c6,_0x36e840,_0x15d32c){return db[_0x550a('0x27')][_0x550a('0x42')]({'where':{'id':_0x34b8c6['params']['id']},'attributes':['id',_0x550a('0x44'),'msg_id']})[_0x550a('0x22')](handleEntityNotFound(_0x36e840,null))['then'](function(_0xdf404e){if(_0xdf404e){if(!_0xdf404e[_0x550a('0x44')]){throw new db[(_0x550a('0x45'))][(_0x550a('0x46'))](_0x550a('0x47'));}var _0x5e41a1={'Content-Type':_0x550a('0x48'),'Content-Disposition':_0x550a('0x49')};if(_0xdf404e['msg_id']){_0x5e41a1['Content-Disposition']='attachment;\x20filename=\x22'+_0xdf404e[_0x550a('0x4a')]+_0x550a('0x4b');}_0x36e840[_0x550a('0x4c')](_0x5e41a1);return _0x36e840['send'](new Buffer(_0xdf404e[_0x550a('0x44')]));}})[_0x550a('0x41')](handleError(_0x36e840,null));}; \ No newline at end of file +var _0xe2fe=['end','json','offset','limit','apply','save','update','destroy','then','error','stack','name','send','index','VoiceMailMessage','rawAttributes','model','differenceBy','keys','query','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','show','fields','length','includeAll','include','catch','create','body','find','params','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','set','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','querystring','../../components/auth/service','../../config/license/hardware','../../config/utils','sendStatus','status'];(function(_0x51136c,_0x3786b6){var _0x352a65=function(_0x26270a){while(--_0x26270a){_0x51136c['push'](_0x51136c['shift']());}};_0x352a65(++_0x3786b6);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xee2f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xee2f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee2f('0x2'));var moment=require(_0xee2f('0x3'));var BPromise=require(_0xee2f('0x4'));var Mustache=require(_0xee2f('0x5'));var util=require(_0xee2f('0x6'));var path=require('path');var sox=require(_0xee2f('0x7'));var csv=require(_0xee2f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x8'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var authService=require(_0xee2f('0xd'));var hardwareService=require(_0xee2f('0xe'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0xee2f('0xf'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53047d,_0x25ddf7){_0x25ddf7=_0x25ddf7||0xcc;return function(_0x346dbc){if(_0x346dbc){return _0x53047d[_0xee2f('0x10')](_0x25ddf7);}return _0x53047d[_0xee2f('0x11')](_0x25ddf7)[_0xee2f('0x12')]();};}function respondWithResult(_0x3ab91f,_0x4faa8f){_0x4faa8f=_0x4faa8f||0xc8;return function(_0x3861e6){if(_0x3861e6){return _0x3ab91f['status'](_0x4faa8f)[_0xee2f('0x13')](_0x3861e6);}};}function respondWithFilteredResult(_0x271c1d,_0x48b30c){return function(_0x445ba8){if(_0x445ba8){var _0x145241=_0x445ba8['count'],_0x28b614=_0x48b30c[_0xee2f('0x14')],_0x1bbf7d=_0x48b30c['offset']+_0x48b30c[_0xee2f('0x15')],_0x390c2c;if(_0x1bbf7d>=_0x145241){_0x1bbf7d=_0x145241;_0x390c2c=0xc8;}else{_0x390c2c=0xce;}_0x271c1d[_0xee2f('0x11')](_0x390c2c);return _0x271c1d['set']('Content-Range',_0x28b614+'-'+_0x1bbf7d+'/'+_0x145241)[_0xee2f('0x13')](_0x445ba8);}return null;};}function patchUpdates(_0x5a5078){return function(_0x69db88){try{jsonpatch[_0xee2f('0x16')](_0x69db88,_0x5a5078,!![]);}catch(_0x28549d){return BPromise['reject'](_0x28549d);}return _0x69db88[_0xee2f('0x17')]();};}function saveUpdates(_0x1e70aa,_0x4db2cc){return function(_0x21fdf4){if(_0x21fdf4){return _0x21fdf4[_0xee2f('0x18')](_0x1e70aa)['then'](function(_0x5e73ad){return _0x5e73ad;});}return null;};}function removeEntity(_0x40d1fd,_0x3a1852){return function(_0x1ea808){if(_0x1ea808){return _0x1ea808[_0xee2f('0x19')]()[_0xee2f('0x1a')](function(){_0x40d1fd[_0xee2f('0x11')](0xcc)[_0xee2f('0x12')]();});}};}function handleEntityNotFound(_0x4d68d3,_0x250399){return function(_0x2c47c5){if(!_0x2c47c5){_0x4d68d3[_0xee2f('0x10')](0x194);}return _0x2c47c5;};}function handleError(_0x70e308,_0x820101){_0x820101=_0x820101||0x1f4;return function(_0xf77cf5){logger[_0xee2f('0x1b')](_0xf77cf5[_0xee2f('0x1c')]);if(_0xf77cf5[_0xee2f('0x1d')]){delete _0xf77cf5[_0xee2f('0x1d')];}_0x70e308[_0xee2f('0x11')](_0x820101)[_0xee2f('0x1e')](_0xf77cf5);};}exports[_0xee2f('0x1f')]=function(_0x45c4a0,_0x53f6ed){var _0x4ef690={},_0x58ba65={},_0x18bdbb={'count':0x0,'rows':[]};var _0x18ff19=db[_0xee2f('0x20')][_0xee2f('0x21')];_0x58ba65[_0xee2f('0x22')]=_[_0xee2f('0x23')](_['keys'](_0x18ff19),[_0xee2f('0x1d')]);_0x58ba65['query']=_[_0xee2f('0x24')](_0x45c4a0[_0xee2f('0x25')]);_0x58ba65[_0xee2f('0x26')]=_[_0xee2f('0x27')](_0x58ba65[_0xee2f('0x22')],_0x58ba65['query']);_0x4ef690[_0xee2f('0x28')]=_[_0xee2f('0x27')](_0x58ba65['model'],qs['fields'](_0x45c4a0[_0xee2f('0x25')]['fields']));_0x4ef690[_0xee2f('0x28')]=_0x4ef690[_0xee2f('0x28')]['length']?_0x4ef690[_0xee2f('0x28')]:_0x58ba65['model'];if(!_0x45c4a0['query']['hasOwnProperty'](_0xee2f('0x29'))){_0x4ef690[_0xee2f('0x15')]=qs['limit'](_0x45c4a0[_0xee2f('0x25')][_0xee2f('0x15')]);_0x4ef690[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x45c4a0[_0xee2f('0x25')]['offset']);}_0x4ef690[_0xee2f('0x2a')]=qs['sort'](_0x45c4a0[_0xee2f('0x25')][_0xee2f('0x2b')]);_0x4ef690[_0xee2f('0x2c')]=qs['filters'](_[_0xee2f('0x2d')](_0x45c4a0['query'],_0x58ba65[_0xee2f('0x26')]));if(_0x45c4a0['query'][_0xee2f('0x2e')]){_0x4ef690[_0xee2f('0x2c')]=_[_0xee2f('0x2f')](_0x4ef690[_0xee2f('0x2c')],{'$or':_[_0xee2f('0x30')](_0x18ff19,function(_0x21b802){if(_0x21b802[_0xee2f('0x31')][_0xee2f('0x32')]!==_0xee2f('0x33')){var _0x252e91={};_0x252e91[_0x21b802[_0xee2f('0x34')]]={'$like':'%'+_0x45c4a0['query'][_0xee2f('0x2e')]+'%'};return _0x252e91;}})});}_0x4ef690=_['merge']({},_0x4ef690,_0x45c4a0[_0xee2f('0x35')]);var _0x3cbc01={'where':_0x4ef690[_0xee2f('0x2c')]};return db[_0xee2f('0x20')][_0xee2f('0x36')](_0x3cbc01)[_0xee2f('0x1a')](function(_0x694950){_0x18bdbb[_0xee2f('0x36')]=_0x694950;if(_0x45c4a0['query']['includeAll']){_0x4ef690['include']=[{'all':!![]}];}return db[_0xee2f('0x20')]['findAll'](_0x4ef690);})[_0xee2f('0x1a')](function(_0x51daf5){_0x18bdbb['rows']=_0x51daf5;return _0x18bdbb;})['then'](respondWithFilteredResult(_0x53f6ed,_0x4ef690))['catch'](handleError(_0x53f6ed,null));};exports[_0xee2f('0x37')]=function(_0x692686,_0x1ab34f){var _0x268775={'raw':!![],'where':{'id':_0x692686['params']['id']}},_0x4823a7={};_0x4823a7[_0xee2f('0x22')]=_['keys'](db['VoiceMailMessage'][_0xee2f('0x21')]);_0x4823a7[_0xee2f('0x25')]=_[_0xee2f('0x24')](_0x692686['query']);_0x4823a7[_0xee2f('0x26')]=_[_0xee2f('0x27')](_0x4823a7[_0xee2f('0x22')],_0x4823a7['query']);_0x268775['attributes']=_[_0xee2f('0x27')](_0x4823a7[_0xee2f('0x22')],qs[_0xee2f('0x38')](_0x692686[_0xee2f('0x25')]['fields']));_0x268775[_0xee2f('0x28')]=_0x268775[_0xee2f('0x28')][_0xee2f('0x39')]?_0x268775[_0xee2f('0x28')]:_0x4823a7[_0xee2f('0x22')];if(_0x692686[_0xee2f('0x25')][_0xee2f('0x3a')]){_0x268775[_0xee2f('0x3b')]=[{'all':!![]}];}_0x268775=_[_0xee2f('0x2f')]({},_0x268775,_0x692686[_0xee2f('0x35')]);return db['VoiceMailMessage']['find'](_0x268775)['then'](handleEntityNotFound(_0x1ab34f,null))['then'](respondWithResult(_0x1ab34f,null))[_0xee2f('0x3c')](handleError(_0x1ab34f,null));};exports[_0xee2f('0x3d')]=function(_0x34ce9c,_0x12aaa0){return db[_0xee2f('0x20')]['create'](_0x34ce9c[_0xee2f('0x3e')],{})[_0xee2f('0x1a')](respondWithResult(_0x12aaa0,0xc9))[_0xee2f('0x3c')](handleError(_0x12aaa0,null));};exports[_0xee2f('0x18')]=function(_0x57f493,_0x5c887b){if(_0x57f493['body']['id']){delete _0x57f493[_0xee2f('0x3e')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x57f493['params']['id']}})['then'](handleEntityNotFound(_0x5c887b,null))[_0xee2f('0x1a')](saveUpdates(_0x57f493[_0xee2f('0x3e')],null))[_0xee2f('0x1a')](respondWithResult(_0x5c887b,null))['catch'](handleError(_0x5c887b,null));};exports[_0xee2f('0x19')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x20')][_0xee2f('0x3f')]({'where':{'id':_0x57f65d[_0xee2f('0x40')]['id']}})[_0xee2f('0x1a')](handleEntityNotFound(_0x3d95b8,null))['then'](removeEntity(_0x3d95b8,null))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x41')]=function(_0x59bd48,_0x2b6beb,_0x282e89){return db[_0xee2f('0x20')][_0xee2f('0x3f')]({'where':{'id':_0x59bd48['params']['id']},'attributes':['id','recording',_0xee2f('0x42')]})[_0xee2f('0x1a')](handleEntityNotFound(_0x2b6beb,null))[_0xee2f('0x1a')](function(_0x2189ff){if(_0x2189ff){if(!_0x2189ff[_0xee2f('0x43')]){throw new db[(_0xee2f('0x44'))][(_0xee2f('0x45'))](_0xee2f('0x46'));}var _0x3bf2b6={'Content-Type':_0xee2f('0x47'),'Content-Disposition':_0xee2f('0x48')};if(_0x2189ff[_0xee2f('0x42')]){_0x3bf2b6['Content-Disposition']=_0xee2f('0x49')+_0x2189ff[_0xee2f('0x42')]+_0xee2f('0x4a');}_0x2b6beb[_0xee2f('0x4b')](_0x3bf2b6);return _0x2b6beb['send'](new Buffer(_0x2189ff[_0xee2f('0x43')]));}})[_0xee2f('0x3c')](handleError(_0x2b6beb,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index c891b78..24b92bc 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 _0x1ea8=['VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','./voiceMailMessage.attributes','exports','define'];(function(_0x575934,_0x4a6760){var _0x109a3d=function(_0x1c20a1){while(--_0x1c20a1){_0x575934['push'](_0x575934['shift']());}};_0x109a3d(++_0x4a6760);}(_0x1ea8,0x19b));var _0x81ea=function(_0x2cbb64,_0x13a2fb){_0x2cbb64=_0x2cbb64-0x0;var _0x280cf2=_0x1ea8[_0x2cbb64];return _0x280cf2;};'use strict';var _=require(_0x81ea('0x0'));var util=require(_0x81ea('0x1'));var logger=require(_0x81ea('0x2'))(_0x81ea('0x3'));var moment=require(_0x81ea('0x4'));var BPromise=require(_0x81ea('0x5'));var rp=require('request-promise');var attributes=require(_0x81ea('0x6'));module[_0x81ea('0x7')]=function(_0x35392b,_0xecd584){return _0x35392b[_0x81ea('0x8')](_0x81ea('0x9'),attributes,{'tableName':_0x81ea('0xa'),'paranoid':![],'indexes':[{'name':_0x81ea('0xb'),'fields':[_0x81ea('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd5fb=['util','../../config/logger','moment','bluebird','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash'];(function(_0x813f30,_0x140254){var _0x4048d9=function(_0x541996){while(--_0x541996){_0x813f30['push'](_0x813f30['shift']());}};_0x4048d9(++_0x140254);}(_0xd5fb,0xb3));var _0xbd5f=function(_0x5454e2,_0x576f66){_0x5454e2=_0x5454e2-0x0;var _0x5b9409=_0xd5fb[_0x5454e2];return _0x5b9409;};'use strict';var _=require(_0xbd5f('0x0'));var util=require(_0xbd5f('0x1'));var logger=require(_0xbd5f('0x2'))('api');var moment=require(_0xbd5f('0x3'));var BPromise=require(_0xbd5f('0x4'));var rp=require('request-promise');var attributes=require('./voiceMailMessage.attributes');module[_0xbd5f('0x5')]=function(_0x44f2f1,_0x48d988){return _0x44f2f1[_0xbd5f('0x6')](_0xbd5f('0x7'),attributes,{'tableName':_0xbd5f('0x8'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xbd5f('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 6ba53bb..5d75124 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 _0x9be6=['message','VoiceMailMessage,\x20%s,\x20%s','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x52786a,_0x16fe83){var _0x4e917a=function(_0x4a959f){while(--_0x4a959f){_0x52786a['push'](_0x52786a['shift']());}};_0x4e917a(++_0x16fe83);}(_0x9be6,0x17e));var _0x69be=function(_0x971723,_0x57265a){_0x971723=_0x971723-0x0;var _0x578f25=_0x9be6[_0x971723];return _0x578f25;};'use strict';var _=require(_0x69be('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x69be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69be('0x2'));var db=require(_0x69be('0x3'))['db'];var utils=require(_0x69be('0x4'));var logger=require(_0x69be('0x5'))(_0x69be('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x69be('0x7')][_0x69be('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c4c29,_0x519cc2,_0x47c66c){return new BPromise(function(_0x60d7fa,_0x3bb852){return client[_0x69be('0x9')](_0x5c4c29,_0x47c66c)[_0x69be('0xa')](function(_0x12ec25){logger[_0x69be('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x519cc2,_0x69be('0xc'));logger[_0x69be('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x519cc2,_0x69be('0xc'),JSON[_0x69be('0xe')](_0x12ec25));if(_0x12ec25[_0x69be('0xf')]){if(_0x12ec25[_0x69be('0xf')][_0x69be('0x10')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x519cc2,_0x12ec25[_0x69be('0xf')][_0x69be('0x11')]);return _0x3bb852(_0x12ec25[_0x69be('0xf')][_0x69be('0x11')]);}logger[_0x69be('0xf')](_0x69be('0x12'),_0x519cc2,_0x12ec25[_0x69be('0xf')][_0x69be('0x11')]);return _0x60d7fa(_0x12ec25['error'][_0x69be('0x11')]);}else{logger[_0x69be('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x519cc2,_0x69be('0xc'));_0x60d7fa(_0x12ec25[_0x69be('0x13')]['message']);}})[_0x69be('0x14')](function(_0x9616bd){logger[_0x69be('0xf')](_0x69be('0x12'),_0x519cc2,_0x9616bd);_0x3bb852(_0x9616bd);});});} \ No newline at end of file +var _0xa7c5=['jayson/promise','client','http','request','info','request\x20sent','debug','error','message','VoiceMailMessage,\x20%s,\x20%s','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3fb5c3,_0x5b134d){var _0x2f3dbc=function(_0x49066d){while(--_0x49066d){_0x3fb5c3['push'](_0x3fb5c3['shift']());}};_0x2f3dbc(++_0x5b134d);}(_0xa7c5,0x8a));var _0x5a7c=function(_0xffe87b,_0x3daf3f){_0xffe87b=_0xffe87b-0x0;var _0xfdcc47=_0xa7c5[_0xffe87b];return _0xfdcc47;};'use strict';var _=require(_0x5a7c('0x0'));var util=require(_0x5a7c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5a7c('0x2'));var fs=require('fs');var Redis=require(_0x5a7c('0x3'));var db=require(_0x5a7c('0x4'))['db'];var utils=require(_0x5a7c('0x5'));var logger=require(_0x5a7c('0x6'))(_0x5a7c('0x7'));var config=require(_0x5a7c('0x8'));var jayson=require(_0x5a7c('0x9'));var client=jayson[_0x5a7c('0xa')][_0x5a7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4573c7,_0x57ec6c,_0x45992b){return new BPromise(function(_0x4d4cd0,_0xc9ab25){return client[_0x5a7c('0xc')](_0x4573c7,_0x45992b)['then'](function(_0x1e89c2){logger[_0x5a7c('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x57ec6c,_0x5a7c('0xe'));logger[_0x5a7c('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x57ec6c,'request\x20sent',JSON['stringify'](_0x1e89c2));if(_0x1e89c2[_0x5a7c('0x10')]){if(_0x1e89c2[_0x5a7c('0x10')]['code']===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x57ec6c,_0x1e89c2[_0x5a7c('0x10')]['message']);return _0xc9ab25(_0x1e89c2[_0x5a7c('0x10')][_0x5a7c('0x11')]);}logger[_0x5a7c('0x10')](_0x5a7c('0x12'),_0x57ec6c,_0x1e89c2[_0x5a7c('0x10')][_0x5a7c('0x11')]);return _0x4d4cd0(_0x1e89c2['error']['message']);}else{logger[_0x5a7c('0xd')](_0x5a7c('0x12'),_0x57ec6c,_0x5a7c('0xe'));_0x4d4cd0(_0x1e89c2[_0x5a7c('0x13')][_0x5a7c('0x11')]);}})[_0x5a7c('0x14')](function(_0x1c96da){logger[_0x5a7c('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x57ec6c,_0x1c96da);_0xc9ab25(_0x1c96da);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index ad6ef9a..797971e 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 _0x6737=['../../components/interaction/service','./voiceMusicOnHold.controller','get','index','/:id/sounds','getSounds','post','create','put','isAuthenticated','update','delete','/:id','destroy','/:id/sounds/:id2','removeSound','util','path','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6737,0xe2));var _0x7673=function(_0x4d7038,_0x21b1d8){_0x4d7038=_0x4d7038-0x0;var _0x425e2a=_0x6737[_0x4d7038];return _0x425e2a;};'use strict';var multer=require('multer');var util=require(_0x7673('0x0'));var path=require(_0x7673('0x1'));var timeout=require('connect-timeout');var express=require(_0x7673('0x2'));var router=express[_0x7673('0x3')]();var auth=require(_0x7673('0x4'));var interaction=require(_0x7673('0x5'));var config=require('../../config/environment');var controller=require(_0x7673('0x6'));router[_0x7673('0x7')]('/',auth['isAuthenticated'](),controller[_0x7673('0x8')]);router[_0x7673('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x7673('0x9'),auth['isAuthenticated'](),controller[_0x7673('0xa')]);router[_0x7673('0xb')]('/',auth['isAuthenticated'](),controller[_0x7673('0xc')]);router[_0x7673('0xb')](_0x7673('0x9'),auth['isAuthenticated'](),controller['addSound']);router[_0x7673('0xd')]('/:id',auth[_0x7673('0xe')](),controller[_0x7673('0xf')]);router[_0x7673('0x10')](_0x7673('0x11'),auth[_0x7673('0xe')](),controller[_0x7673('0x12')]);router[_0x7673('0x10')](_0x7673('0x13'),auth[_0x7673('0xe')](),controller[_0x7673('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd404=['create','post','/:id/sounds','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show'];(function(_0x149db3,_0x4a0a32){var _0x1b4d54=function(_0x24e355){while(--_0x24e355){_0x149db3['push'](_0x149db3['shift']());}};_0x1b4d54(++_0x4a0a32);}(_0xd404,0x15b));var _0x4d40=function(_0x3df7ed,_0x22ac04){_0x3df7ed=_0x3df7ed-0x0;var _0x2b2819=_0xd404[_0x3df7ed];return _0x2b2819;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var auth=require(_0x4d40('0x4'));var interaction=require(_0x4d40('0x5'));var config=require(_0x4d40('0x6'));var controller=require(_0x4d40('0x7'));router[_0x4d40('0x8')]('/',auth[_0x4d40('0x9')](),controller[_0x4d40('0xa')]);router[_0x4d40('0x8')](_0x4d40('0xb'),auth['isAuthenticated'](),controller[_0x4d40('0xc')]);router[_0x4d40('0x8')]('/:id/sounds',auth[_0x4d40('0x9')](),controller['getSounds']);router['post']('/',auth[_0x4d40('0x9')](),controller[_0x4d40('0xd')]);router[_0x4d40('0xe')](_0x4d40('0xf'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x10')]);router[_0x4d40('0x11')](_0x4d40('0xb'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x12')]);router[_0x4d40('0x13')](_0x4d40('0xb'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x14')]);router['delete'](_0x4d40('0x15'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x16')]);module[_0x4d40('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 40a25d7..eac876a 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 _0x776b=['files','mp3nb','quietmp3','mp3','alpha','BOOLEAN','sequelize','STRING','name','custom'];(function(_0x3d71a7,_0x80cb68){var _0x46c046=function(_0x50e7d3){while(--_0x50e7d3){_0x3d71a7['push'](_0x3d71a7['shift']());}};_0x46c046(++_0x80cb68);}(_0x776b,0x9c));var _0xb776=function(_0xff7a59,_0x21a03d){_0xff7a59=_0xff7a59-0x0;var _0x4176ba=_0x776b[_0xff7a59];return _0x4176ba;};'use strict';var Sequelize=require(_0xb776('0x0'));module['exports']={'name':{'type':Sequelize[_0xb776('0x1')],'allowNull':![],'unique':_0xb776('0x2')},'mode':{'type':Sequelize['ENUM'](_0xb776('0x3'),_0xb776('0x4'),_0xb776('0x5'),'quietmp3nb',_0xb776('0x6'),_0xb776('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xb776('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xb776('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb776('0x1')],'allowNull':!![],'defaultValue':_0xb776('0x8')},'format':{'type':Sequelize[_0xb776('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xb776('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5d71=['alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','name','custom','files','mp3nb','mp3'];(function(_0x2e43d4,_0x188315){var _0x144cf9=function(_0x1ecf14){while(--_0x1ecf14){_0x2e43d4['push'](_0x2e43d4['shift']());}};_0x144cf9(++_0x188315);}(_0x5d71,0x175));var _0x15d7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d71[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x15d7('0x0'));module['exports']={'name':{'type':Sequelize[_0x15d7('0x1')],'allowNull':![],'unique':_0x15d7('0x2')},'mode':{'type':Sequelize['ENUM'](_0x15d7('0x3'),_0x15d7('0x4'),_0x15d7('0x5'),'quietmp3nb','quietmp3',_0x15d7('0x6')),'allowNull':!![],'defaultValue':_0x15d7('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x15d7('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x15d7('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x15d7('0x1')],'allowNull':!![],'defaultValue':_0x15d7('0x7')},'format':{'type':Sequelize[_0x15d7('0x1')],'allowNull':!![]},'stamp':{'type':_0x15d7('0x8')},'defaultEntry':{'type':Sequelize[_0x15d7('0x9')],'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 1559719..3605918 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 _0xc95f=['format','basename','save_name','extname','%s.%s','symlinkSync','removeSound','id2','Sound','message','getSounds','order','options','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','VoiceMusicOnHold','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','body','create','sequelize','transaction','root','server/files/moh','files','mkdirSync','directory','user','role','UserProfileSection','userProfileId','autoAssociation','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','findOne','converted_format','createdAt','join'];(function(_0x19a0af,_0x5ecca3){var _0x3903bc=function(_0x23a576){while(--_0x23a576){_0x19a0af['push'](_0x19a0af['shift']());}};_0x3903bc(++_0x5ecca3);}(_0xc95f,0x157));var _0xfc95=function(_0x972b32,_0x56ea80){_0x972b32=_0x972b32-0x0;var _0x6e8e75=_0xc95f[_0x972b32];return _0x6e8e75;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfc95('0x0'));var jsonpatch=require(_0xfc95('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfc95('0x2'));var Mustache=require(_0xfc95('0x3'));var util=require(_0xfc95('0x4'));var path=require(_0xfc95('0x5'));var sox=require(_0xfc95('0x6'));var csv=require(_0xfc95('0x7'));var ejs=require(_0xfc95('0x8'));var fs=require('fs');var _=require(_0xfc95('0x9'));var squel=require(_0xfc95('0xa'));var crypto=require(_0xfc95('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfc95('0xc'));var toCsv=require(_0xfc95('0x7'));var querystring=require('querystring');var Papa=require(_0xfc95('0xd'));var authService=require(_0xfc95('0xe'));var hardwareService=require(_0xfc95('0xf'));var Redis=require('ioredis');var qs=require(_0xfc95('0x10'));var logger=require(_0xfc95('0x11'))(_0xfc95('0x12'));var utils=require(_0xfc95('0x13'));var config=require(_0xfc95('0x14'));var db=require(_0xfc95('0x15'))['db'];function respondWithStatusCode(_0x151c8a,_0x2b86a3){_0x2b86a3=_0x2b86a3||0xcc;return function(_0x588fb1){if(_0x588fb1){return _0x151c8a[_0xfc95('0x16')](_0x2b86a3);}return _0x151c8a['status'](_0x2b86a3)[_0xfc95('0x17')]();};}function respondWithResult(_0x241898,_0x3f1e2b){_0x3f1e2b=_0x3f1e2b||0xc8;return function(_0x38a2b4){if(_0x38a2b4){return _0x241898[_0xfc95('0x18')](_0x3f1e2b)[_0xfc95('0x19')](_0x38a2b4);}};}function respondWithFilteredResult(_0x45620b,_0x31951a){return function(_0x40cd03){if(_0x40cd03){var _0x250551=_0x40cd03[_0xfc95('0x1a')],_0x51872f=_0x31951a[_0xfc95('0x1b')],_0x81104b=_0x31951a[_0xfc95('0x1b')]+_0x31951a['limit'],_0x1f32d3;if(_0x81104b>=_0x250551){_0x81104b=_0x250551;_0x1f32d3=0xc8;}else{_0x1f32d3=0xce;}_0x45620b[_0xfc95('0x18')](_0x1f32d3);return _0x45620b[_0xfc95('0x1c')](_0xfc95('0x1d'),_0x51872f+'-'+_0x81104b+'/'+_0x250551)['json'](_0x40cd03);}return null;};}function patchUpdates(_0x4d6e2c){return function(_0x5aa042){try{jsonpatch['apply'](_0x5aa042,_0x4d6e2c,!![]);}catch(_0xf7202f){return BPromise[_0xfc95('0x1e')](_0xf7202f);}return _0x5aa042[_0xfc95('0x1f')]();};}function saveUpdates(_0x24f034,_0x3b50b6){return function(_0x3ff75d){if(_0x3ff75d){return _0x3ff75d[_0xfc95('0x20')](_0x24f034)[_0xfc95('0x21')](function(_0x135835){return _0x135835;});}return null;};}function removeEntity(_0x45bdd5,_0x5e1eb0){return function(_0x56cb58){if(_0x56cb58){return _0x56cb58[_0xfc95('0x22')]()[_0xfc95('0x21')](function(){var _0x127b0d=_0x56cb58[_0xfc95('0x23')]({'plain':!![]});var _0x2411b5=_0xfc95('0x24');return db[_0xfc95('0x25')][_0xfc95('0x22')]({'where':{'type':_0x2411b5,'resourceId':_0x127b0d['id']}})[_0xfc95('0x21')](function(){return _0x56cb58;});})[_0xfc95('0x21')](function(){_0x45bdd5[_0xfc95('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f8d1,_0x479a9c){return function(_0x353fcb){if(!_0x353fcb){_0x40f8d1[_0xfc95('0x16')](0x194);}return _0x353fcb;};}function handleError(_0x2b683e,_0x23ebe5){_0x23ebe5=_0x23ebe5||0x1f4;return function(_0xa57934){logger[_0xfc95('0x26')](_0xa57934[_0xfc95('0x27')]);if(_0xa57934['name']){delete _0xa57934[_0xfc95('0x28')];}_0x2b683e['status'](_0x23ebe5)[_0xfc95('0x29')](_0xa57934);};}exports['index']=function(_0x521ee3,_0x1d817c){var _0x536e72={},_0x20170b={},_0x5ec5c9={'count':0x0,'rows':[]};var _0x1ce28d=db[_0xfc95('0x2a')][_0xfc95('0x2b')];_0x20170b[_0xfc95('0x2c')]=_[_0xfc95('0x2d')](_0x1ce28d);_0x20170b[_0xfc95('0x2e')]=_[_0xfc95('0x2d')](_0x521ee3[_0xfc95('0x2e')]);_0x20170b[_0xfc95('0x2f')]=_[_0xfc95('0x30')](_0x20170b[_0xfc95('0x2c')],_0x20170b[_0xfc95('0x2e')]);_0x536e72[_0xfc95('0x31')]=_[_0xfc95('0x30')](_0x20170b[_0xfc95('0x2c')],qs[_0xfc95('0x32')](_0x521ee3[_0xfc95('0x2e')][_0xfc95('0x32')]));_0x536e72[_0xfc95('0x31')]=_0x536e72[_0xfc95('0x31')][_0xfc95('0x33')]?_0x536e72[_0xfc95('0x31')]:_0x20170b[_0xfc95('0x2c')];if(!_0x521ee3['query'][_0xfc95('0x34')](_0xfc95('0x35'))){_0x536e72['limit']=qs[_0xfc95('0x36')](_0x521ee3['query'][_0xfc95('0x36')]);_0x536e72[_0xfc95('0x1b')]=qs[_0xfc95('0x1b')](_0x521ee3['query'][_0xfc95('0x1b')]);}_0x536e72['order']=qs[_0xfc95('0x37')](_0x521ee3[_0xfc95('0x2e')][_0xfc95('0x37')]);_0x536e72[_0xfc95('0x38')]=qs[_0xfc95('0x2f')](_[_0xfc95('0x39')](_0x521ee3[_0xfc95('0x2e')],_0x20170b['filters']));if(_0x521ee3[_0xfc95('0x2e')][_0xfc95('0x3a')]){_0x536e72['where']=_[_0xfc95('0x3b')](_0x536e72[_0xfc95('0x38')],{'$or':_[_0xfc95('0x3c')](_0x1ce28d,function(_0x36999f){if(_0x36999f[_0xfc95('0x3d')][_0xfc95('0x3e')]!==_0xfc95('0x3f')){var _0xe62c71={};_0xe62c71[_0x36999f['field']]={'$like':'%'+_0x521ee3[_0xfc95('0x2e')][_0xfc95('0x3a')]+'%'};return _0xe62c71;}})});}_0x536e72=_[_0xfc95('0x3b')]({},_0x536e72,_0x521ee3['options']);var _0x361c94={'where':_0x536e72[_0xfc95('0x38')]};return db[_0xfc95('0x2a')][_0xfc95('0x1a')](_0x361c94)['then'](function(_0x32a199){_0x5ec5c9[_0xfc95('0x1a')]=_0x32a199;if(_0x521ee3['query']['includeAll']){_0x536e72[_0xfc95('0x40')]=[{'all':!![]}];}return db[_0xfc95('0x2a')][_0xfc95('0x41')](_0x536e72);})[_0xfc95('0x21')](function(_0x1828df){_0x5ec5c9[_0xfc95('0x42')]=_0x1828df;return _0x5ec5c9;})[_0xfc95('0x21')](respondWithFilteredResult(_0x1d817c,_0x536e72))[_0xfc95('0x43')](handleError(_0x1d817c,null));};exports[_0xfc95('0x44')]=function(_0x65ca2f,_0xd4465b){var _0x12e75c={'raw':![],'where':{'id':_0x65ca2f[_0xfc95('0x45')]['id']}},_0x5ec8b4={};_0x5ec8b4[_0xfc95('0x2c')]=_[_0xfc95('0x2d')](db['VoiceMusicOnHold']['rawAttributes']);_0x5ec8b4[_0xfc95('0x2e')]=_[_0xfc95('0x2d')](_0x65ca2f[_0xfc95('0x2e')]);_0x5ec8b4[_0xfc95('0x2f')]=_[_0xfc95('0x30')](_0x5ec8b4[_0xfc95('0x2c')],_0x5ec8b4['query']);_0x12e75c[_0xfc95('0x31')]=_[_0xfc95('0x30')](_0x5ec8b4[_0xfc95('0x2c')],qs[_0xfc95('0x32')](_0x65ca2f[_0xfc95('0x2e')][_0xfc95('0x32')]));_0x12e75c[_0xfc95('0x31')]=_0x12e75c[_0xfc95('0x31')][_0xfc95('0x33')]?_0x12e75c[_0xfc95('0x31')]:_0x5ec8b4['model'];if(_0x65ca2f[_0xfc95('0x2e')][_0xfc95('0x46')]){_0x12e75c[_0xfc95('0x40')]=[{'all':!![]}];}_0x12e75c=_['merge']({},_0x12e75c,_0x65ca2f['options']);return db[_0xfc95('0x2a')][_0xfc95('0x47')](_0x12e75c)[_0xfc95('0x21')](handleEntityNotFound(_0xd4465b,null))[_0xfc95('0x21')](respondWithResult(_0xd4465b,null))[_0xfc95('0x43')](handleError(_0xd4465b,null));};exports[_0xfc95('0x20')]=function(_0x112321,_0x5cb21e){if(_0x112321[_0xfc95('0x48')]['id']){delete _0x112321[_0xfc95('0x48')]['id'];}return db['VoiceMusicOnHold'][_0xfc95('0x47')]({'where':{'id':_0x112321[_0xfc95('0x45')]['id']}})[_0xfc95('0x21')](handleEntityNotFound(_0x5cb21e,null))[_0xfc95('0x21')](saveUpdates(_0x112321[_0xfc95('0x48')],null))[_0xfc95('0x21')](respondWithResult(_0x5cb21e,null))['catch'](handleError(_0x5cb21e,null));};exports[_0xfc95('0x49')]=function(_0x3aeded,_0x19b4c1,_0x383aa9){return db[_0xfc95('0x4a')][_0xfc95('0x4b')](function(_0x213f5a){if(_0x3aeded['body']['mode']==='files'){_0x3aeded['body']['directory']=path['join'](config[_0xfc95('0x4c')],_0xfc95('0x4d'),_0x3aeded[_0xfc95('0x48')][_0xfc95('0x28')]);}return db[_0xfc95('0x2a')][_0xfc95('0x49')](_0x3aeded['body'],{'transaction':_0x213f5a})[_0xfc95('0x21')](function(_0x59d4ee){if(_0x3aeded['body']['mode']===_0xfc95('0x4e')){fs[_0xfc95('0x4f')](_0x59d4ee[_0xfc95('0x50')],parseInt('0777',0x8));}var _0x43ad51=_0x3aeded[_0xfc95('0x51')][_0xfc95('0x23')]({'plain':!![]});if(!_0x43ad51)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43ad51[_0xfc95('0x52')]===_0xfc95('0x51')){var _0x25e054=_0x59d4ee[_0xfc95('0x23')]({'plain':!![]});return db[_0xfc95('0x53')][_0xfc95('0x47')]({'where':{'name':_0xfc95('0x24'),'userProfileId':_0x43ad51[_0xfc95('0x54')]},'raw':!![]})[_0xfc95('0x21')](function(_0x3ebd67){if(_0x3ebd67&&_0x3ebd67[_0xfc95('0x55')]===0x0){return db[_0xfc95('0x25')][_0xfc95('0x49')]({'name':_0x25e054[_0xfc95('0x28')],'resourceId':_0x25e054['id'],'type':_0x3ebd67[_0xfc95('0x28')],'sectionId':_0x3ebd67['id']},{})[_0xfc95('0x21')](function(){return _0x59d4ee;});}else{return _0x59d4ee;}})[_0xfc95('0x43')](function(_0x2c1444){logger[_0xfc95('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c1444);});}return _0x59d4ee;});})[_0xfc95('0x21')](respondWithResult(_0x19b4c1,0xc9))[_0xfc95('0x43')](handleError(_0x19b4c1,null));};exports[_0xfc95('0x22')]=function(_0x554c07,_0x16f938,_0xb91fe4){var _0x5c2648;return db['VoiceMusicOnHold'][_0xfc95('0x47')]({'where':{'id':_0x554c07['params']['id']}})[_0xfc95('0x21')](function(_0x30216d){if(_0x30216d){return db[_0xfc95('0x4a')][_0xfc95('0x4b')](function(_0x1b4085){return _0x30216d[_0xfc95('0x22')]({'transaction':_0x1b4085,'raw':!![]})['then'](function(_0x5b0140){if(_0x5b0140[_0xfc95('0x50')]){fs[_0xfc95('0x56')](_0x5b0140[_0xfc95('0x50')])[_0xfc95('0x57')](function(_0x3efed4){fs[_0xfc95('0x58')](path['join'](_0x5b0140[_0xfc95('0x50')],_0x3efed4));});fs[_0xfc95('0x59')](_0x5b0140[_0xfc95('0x50')]);}return _0x5b0140;});})[_0xfc95('0x43')](function(_0x1b95f3){throw new db[(_0xfc95('0x5a'))][(_0xfc95('0x5b'))](_0x1b95f3['message']);});}})[_0xfc95('0x21')](handleEntityNotFound(_0x16f938,null))[_0xfc95('0x21')](removeEntity(_0x16f938,null))[_0xfc95('0x43')](handleError(_0x16f938,null));};exports[_0xfc95('0x5c')]=function(_0x1a3aba,_0x7d470c,_0x63c1){return db['sequelize'][_0xfc95('0x4b')](function(_0x4063e0){var _0x41ef1e;return db[_0xfc95('0x2a')][_0xfc95('0x47')]({'where':{'id':_0x1a3aba[_0xfc95('0x45')]['id']}})['then'](function(_0x8e819e){if(_0x8e819e){_0x41ef1e=_0x8e819e;return _0x8e819e[_0xfc95('0x5c')](_0x1a3aba[_0xfc95('0x48')]['id'],{'transaction':_0x4063e0});}})[_0xfc95('0x21')](function(_0x42c52e){if(_0x42c52e){return db['Sound'][_0xfc95('0x5d')]({'where':{'id':_0x1a3aba['body']['id']},'attributes':['id','name','save_name',_0xfc95('0x5e'),_0xfc95('0x5f')],'raw':!![]});}})['then'](function(_0x3538cd){if(_0x3538cd){var _0x159db4=path[_0xfc95('0x60')](config[_0xfc95('0x4c')],'server/files/sounds/converted',util[_0xfc95('0x61')]('%s.%s',path[_0xfc95('0x62')](_0x3538cd[_0xfc95('0x63')],path[_0xfc95('0x64')](_0x3538cd[_0xfc95('0x63')])),_0x3538cd[_0xfc95('0x5e')]));var _0x1e66f7=path[_0xfc95('0x60')](config['root'],_0xfc95('0x4d'),_0x41ef1e['name'],util['format'](_0xfc95('0x65'),_0x3538cd[_0xfc95('0x28')],_0x3538cd[_0xfc95('0x5e')]));fs[_0xfc95('0x66')](_0x159db4,_0x1e66f7);return _0x3538cd;}})['catch'](function(_0x2ee16e){throw new db[(_0xfc95('0x5a'))][(_0xfc95('0x5b'))](_0x2ee16e['message']);});})[_0xfc95('0x21')](handleEntityNotFound(_0x7d470c,null))['then'](respondWithResult(_0x7d470c,0xc9))['catch'](handleError(_0x7d470c,null));};exports[_0xfc95('0x67')]=function(_0x5d277b,_0x115133,_0x58b6d0){return db[_0xfc95('0x4a')]['transaction'](function(_0x3690dd){var _0xe10ce9;return db[_0xfc95('0x2a')][_0xfc95('0x5d')]({'where':{'id':_0x5d277b[_0xfc95('0x45')]['id']}})[_0xfc95('0x21')](handleEntityNotFound(_0x115133,null))['then'](function(_0x276695){if(_0x276695){_0xe10ce9=_0x276695;return _0x276695[_0xfc95('0x67')](_0x5d277b['params'][_0xfc95('0x68')]);}})[_0xfc95('0x21')](function(_0x25755b){if(_0x25755b){return db[_0xfc95('0x69')]['findOne']({'where':{'id':_0x5d277b[_0xfc95('0x45')][_0xfc95('0x68')]},'attributes':['id',_0xfc95('0x28'),'save_name','converted_format',_0xfc95('0x5f')],'raw':!![]});}})[_0xfc95('0x21')](function(_0x4080d6){if(_0x4080d6){fs[_0xfc95('0x58')](path[_0xfc95('0x60')](_0xe10ce9[_0xfc95('0x50')],util['format'](_0xfc95('0x65'),_0x4080d6[_0xfc95('0x28')],_0x4080d6['converted_format'])));return _0x4080d6;}})[_0xfc95('0x43')](function(_0x4d5ca8){throw new db[(_0xfc95('0x5a'))]['ValidationError'](_0x4d5ca8[_0xfc95('0x6a')]);});})[_0xfc95('0x21')](handleEntityNotFound(_0x115133,null))[_0xfc95('0x21')](respondWithStatusCode(_0x115133,0xcc))['catch'](handleError(_0x115133,null));};exports[_0xfc95('0x6b')]=function(_0x1eff88,_0x246f65,_0x5d9a64){var _0x36066f={};var _0x231d58={};var _0xa22a38;var _0x225794;return db[_0xfc95('0x2a')]['findOne']({'where':{'id':_0x1eff88[_0xfc95('0x45')]['id']}})['then'](handleEntityNotFound(_0x246f65,null))[_0xfc95('0x21')](function(_0x1d66fa){if(_0x1d66fa){_0xa22a38=_0x1d66fa;_0x231d58[_0xfc95('0x2c')]=_[_0xfc95('0x2d')](db[_0xfc95('0x69')][_0xfc95('0x2b')]);_0x231d58['query']=_[_0xfc95('0x2d')](_0x1eff88[_0xfc95('0x2e')]);_0x231d58['filters']=_[_0xfc95('0x30')](_0x231d58['model'],_0x231d58[_0xfc95('0x2e')]);_0x36066f[_0xfc95('0x31')]=_['intersection'](_0x231d58[_0xfc95('0x2c')],qs[_0xfc95('0x32')](_0x1eff88['query']['fields']));_0x36066f['attributes']=_0x36066f[_0xfc95('0x31')][_0xfc95('0x33')]?_0x36066f[_0xfc95('0x31')]:_0x231d58[_0xfc95('0x2c')];_0x36066f[_0xfc95('0x6c')]=qs[_0xfc95('0x37')](_0x1eff88[_0xfc95('0x2e')][_0xfc95('0x37')]);_0x36066f[_0xfc95('0x38')]=qs['filters'](_[_0xfc95('0x39')](_0x1eff88[_0xfc95('0x2e')],_0x231d58['filters']));if(_0x1eff88[_0xfc95('0x2e')][_0xfc95('0x3a')]){_0x36066f[_0xfc95('0x38')]=_[_0xfc95('0x3b')](_0x36066f[_0xfc95('0x38')],{'$or':_['map'](_0x36066f[_0xfc95('0x31')],function(_0x52165c){var _0x2cc952={};_0x2cc952[_0x52165c]={'$like':'%'+_0x1eff88['query'][_0xfc95('0x3a')]+'%'};return _0x2cc952;})});}_0x36066f=_[_0xfc95('0x3b')]({},_0x36066f,_0x1eff88[_0xfc95('0x6d')]);return _0xa22a38[_0xfc95('0x6b')](_0x36066f);}})[_0xfc95('0x21')](function(_0x504d23){if(_0x504d23){_0x225794=_0x504d23['length'];if(!_0x1eff88[_0xfc95('0x2e')][_0xfc95('0x34')]('nolimit')){_0x36066f[_0xfc95('0x36')]=qs[_0xfc95('0x36')](_0x1eff88['query'][_0xfc95('0x36')]);_0x36066f[_0xfc95('0x1b')]=qs[_0xfc95('0x1b')](_0x1eff88[_0xfc95('0x2e')][_0xfc95('0x1b')]);}return _0xa22a38[_0xfc95('0x6b')](_0x36066f);}})[_0xfc95('0x21')](function(_0x408dc5){if(_0x408dc5){return _0x408dc5?{'count':_0x225794,'rows':_0x408dc5}:null;}})[_0xfc95('0x21')](respondWithResult(_0x246f65,null))['catch'](handleError(_0x246f65,null));}; \ No newline at end of file +var _0x8523=['symlinkSync','Sequelize','ValidationError','removeSound','findOne','getSounds','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','send','index','VoiceMusicOnHold','rawAttributes','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','map','type','key','field','count','includeAll','include','findAll','rows','catch','params','options','find','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','name','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','message','addSound','Sound','save_name','converted_format','createdAt','%s.%s','basename','extname','format'];(function(_0x1cb376,_0xc56ab3){var _0x30bd31=function(_0x4a765c){while(--_0x4a765c){_0x1cb376['push'](_0x1cb376['shift']());}};_0x30bd31(++_0xc56ab3);}(_0x8523,0x160));var _0x3852=function(_0x1217cf,_0x1171dc){_0x1217cf=_0x1217cf-0x0;var _0x280148=_0x8523[_0x1217cf];return _0x280148;};'use strict';var pdf=require(_0x3852('0x0'));var emlformat=require(_0x3852('0x1'));var rimraf=require(_0x3852('0x2'));var zipdir=require(_0x3852('0x3'));var jsonpatch=require(_0x3852('0x4'));var rp=require(_0x3852('0x5'));var moment=require(_0x3852('0x6'));var BPromise=require(_0x3852('0x7'));var Mustache=require(_0x3852('0x8'));var util=require(_0x3852('0x9'));var path=require(_0x3852('0xa'));var sox=require(_0x3852('0xb'));var csv=require(_0x3852('0xc'));var ejs=require(_0x3852('0xd'));var fs=require('fs');var _=require(_0x3852('0xe'));var squel=require('squel');var crypto=require(_0x3852('0xf'));var jsforce=require(_0x3852('0x10'));var deskjs=require(_0x3852('0x11'));var toCsv=require(_0x3852('0xc'));var querystring=require(_0x3852('0x12'));var Papa=require(_0x3852('0x13'));var authService=require(_0x3852('0x14'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x3852('0x15'));var qs=require(_0x3852('0x16'));var logger=require(_0x3852('0x17'))(_0x3852('0x18'));var utils=require(_0x3852('0x19'));var config=require(_0x3852('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bf94a,_0x23d8e6){_0x23d8e6=_0x23d8e6||0xcc;return function(_0x2ec042){if(_0x2ec042){return _0x5bf94a['sendStatus'](_0x23d8e6);}return _0x5bf94a[_0x3852('0x1b')](_0x23d8e6)[_0x3852('0x1c')]();};}function respondWithResult(_0x173195,_0x46ff20){_0x46ff20=_0x46ff20||0xc8;return function(_0x5b91ac){if(_0x5b91ac){return _0x173195[_0x3852('0x1b')](_0x46ff20)[_0x3852('0x1d')](_0x5b91ac);}};}function respondWithFilteredResult(_0x44224a,_0x362e7b){return function(_0x39933b){if(_0x39933b){var _0x32b319=_0x39933b['count'],_0x126bb9=_0x362e7b[_0x3852('0x1e')],_0x4c7a31=_0x362e7b[_0x3852('0x1e')]+_0x362e7b[_0x3852('0x1f')],_0x239e65;if(_0x4c7a31>=_0x32b319){_0x4c7a31=_0x32b319;_0x239e65=0xc8;}else{_0x239e65=0xce;}_0x44224a['status'](_0x239e65);return _0x44224a[_0x3852('0x20')](_0x3852('0x21'),_0x126bb9+'-'+_0x4c7a31+'/'+_0x32b319)[_0x3852('0x1d')](_0x39933b);}return null;};}function patchUpdates(_0x4fbfd5){return function(_0x168284){try{jsonpatch[_0x3852('0x22')](_0x168284,_0x4fbfd5,!![]);}catch(_0x19406b){return BPromise[_0x3852('0x23')](_0x19406b);}return _0x168284['save']();};}function saveUpdates(_0x149c0e,_0x2310db){return function(_0x372ee7){if(_0x372ee7){return _0x372ee7[_0x3852('0x24')](_0x149c0e)[_0x3852('0x25')](function(_0xc41fe7){return _0xc41fe7;});}return null;};}function removeEntity(_0x2d5240,_0x4e4ebd){return function(_0x4df98e){if(_0x4df98e){return _0x4df98e[_0x3852('0x26')]()[_0x3852('0x25')](function(){var _0x547332=_0x4df98e[_0x3852('0x27')]({'plain':!![]});var _0x27796e='MusicOnHolds';return db[_0x3852('0x28')][_0x3852('0x26')]({'where':{'type':_0x27796e,'resourceId':_0x547332['id']}})[_0x3852('0x25')](function(){return _0x4df98e;});})[_0x3852('0x25')](function(){_0x2d5240[_0x3852('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57e6c1,_0x15a875){return function(_0xf9ff35){if(!_0xf9ff35){_0x57e6c1[_0x3852('0x29')](0x194);}return _0xf9ff35;};}function handleError(_0x1f488e,_0x191c0e){_0x191c0e=_0x191c0e||0x1f4;return function(_0x90c8c){logger[_0x3852('0x2a')](_0x90c8c[_0x3852('0x2b')]);if(_0x90c8c['name']){delete _0x90c8c['name'];}_0x1f488e[_0x3852('0x1b')](_0x191c0e)[_0x3852('0x2c')](_0x90c8c);};}exports[_0x3852('0x2d')]=function(_0x1eb608,_0x2338d0){var _0x5990b2={},_0x48f0c9={},_0x5b5357={'count':0x0,'rows':[]};var _0x531d6e=db[_0x3852('0x2e')][_0x3852('0x2f')];_0x48f0c9[_0x3852('0x30')]=_[_0x3852('0x31')](_0x531d6e);_0x48f0c9[_0x3852('0x32')]=_[_0x3852('0x31')](_0x1eb608[_0x3852('0x32')]);_0x48f0c9['filters']=_['intersection'](_0x48f0c9[_0x3852('0x30')],_0x48f0c9['query']);_0x5990b2[_0x3852('0x33')]=_[_0x3852('0x34')](_0x48f0c9[_0x3852('0x30')],qs[_0x3852('0x35')](_0x1eb608[_0x3852('0x32')][_0x3852('0x35')]));_0x5990b2[_0x3852('0x33')]=_0x5990b2[_0x3852('0x33')][_0x3852('0x36')]?_0x5990b2[_0x3852('0x33')]:_0x48f0c9[_0x3852('0x30')];if(!_0x1eb608[_0x3852('0x32')]['hasOwnProperty'](_0x3852('0x37'))){_0x5990b2['limit']=qs[_0x3852('0x1f')](_0x1eb608['query'][_0x3852('0x1f')]);_0x5990b2[_0x3852('0x1e')]=qs['offset'](_0x1eb608[_0x3852('0x32')]['offset']);}_0x5990b2[_0x3852('0x38')]=qs[_0x3852('0x39')](_0x1eb608[_0x3852('0x32')][_0x3852('0x39')]);_0x5990b2['where']=qs[_0x3852('0x3a')](_[_0x3852('0x3b')](_0x1eb608[_0x3852('0x32')],_0x48f0c9['filters']));if(_0x1eb608['query'][_0x3852('0x3c')]){_0x5990b2[_0x3852('0x3d')]=_[_0x3852('0x3e')](_0x5990b2[_0x3852('0x3d')],{'$or':_[_0x3852('0x3f')](_0x531d6e,function(_0x3b528f){if(_0x3b528f[_0x3852('0x40')][_0x3852('0x41')]!=='VIRTUAL'){var _0x363ffc={};_0x363ffc[_0x3b528f[_0x3852('0x42')]]={'$like':'%'+_0x1eb608[_0x3852('0x32')][_0x3852('0x3c')]+'%'};return _0x363ffc;}})});}_0x5990b2=_[_0x3852('0x3e')]({},_0x5990b2,_0x1eb608['options']);var _0x247cb7={'where':_0x5990b2[_0x3852('0x3d')]};return db[_0x3852('0x2e')]['count'](_0x247cb7)['then'](function(_0x13ce88){_0x5b5357[_0x3852('0x43')]=_0x13ce88;if(_0x1eb608[_0x3852('0x32')][_0x3852('0x44')]){_0x5990b2[_0x3852('0x45')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x3852('0x46')](_0x5990b2);})[_0x3852('0x25')](function(_0x132ad6){_0x5b5357[_0x3852('0x47')]=_0x132ad6;return _0x5b5357;})[_0x3852('0x25')](respondWithFilteredResult(_0x2338d0,_0x5990b2))[_0x3852('0x48')](handleError(_0x2338d0,null));};exports['show']=function(_0xbbca67,_0x3591e0){var _0x493344={'raw':![],'where':{'id':_0xbbca67[_0x3852('0x49')]['id']}},_0x4c457d={};_0x4c457d['model']=_[_0x3852('0x31')](db[_0x3852('0x2e')][_0x3852('0x2f')]);_0x4c457d[_0x3852('0x32')]=_[_0x3852('0x31')](_0xbbca67[_0x3852('0x32')]);_0x4c457d[_0x3852('0x3a')]=_[_0x3852('0x34')](_0x4c457d['model'],_0x4c457d[_0x3852('0x32')]);_0x493344[_0x3852('0x33')]=_['intersection'](_0x4c457d['model'],qs[_0x3852('0x35')](_0xbbca67['query'][_0x3852('0x35')]));_0x493344[_0x3852('0x33')]=_0x493344[_0x3852('0x33')][_0x3852('0x36')]?_0x493344['attributes']:_0x4c457d[_0x3852('0x30')];if(_0xbbca67[_0x3852('0x32')][_0x3852('0x44')]){_0x493344[_0x3852('0x45')]=[{'all':!![]}];}_0x493344=_[_0x3852('0x3e')]({},_0x493344,_0xbbca67[_0x3852('0x4a')]);return db[_0x3852('0x2e')][_0x3852('0x4b')](_0x493344)[_0x3852('0x25')](handleEntityNotFound(_0x3591e0,null))[_0x3852('0x25')](respondWithResult(_0x3591e0,null))['catch'](handleError(_0x3591e0,null));};exports[_0x3852('0x24')]=function(_0x1ead32,_0x2be1b4){if(_0x1ead32[_0x3852('0x4c')]['id']){delete _0x1ead32['body']['id'];}return db['VoiceMusicOnHold'][_0x3852('0x4b')]({'where':{'id':_0x1ead32[_0x3852('0x49')]['id']}})[_0x3852('0x25')](handleEntityNotFound(_0x2be1b4,null))[_0x3852('0x25')](saveUpdates(_0x1ead32[_0x3852('0x4c')],null))[_0x3852('0x25')](respondWithResult(_0x2be1b4,null))[_0x3852('0x48')](handleError(_0x2be1b4,null));};exports[_0x3852('0x4d')]=function(_0xcfb6ef,_0x533d39,_0x33e2c5){return db[_0x3852('0x4e')][_0x3852('0x4f')](function(_0x41eb16){if(_0xcfb6ef[_0x3852('0x4c')][_0x3852('0x50')]===_0x3852('0x51')){_0xcfb6ef[_0x3852('0x4c')][_0x3852('0x52')]=path[_0x3852('0x53')](config[_0x3852('0x54')],_0x3852('0x55'),_0xcfb6ef[_0x3852('0x4c')][_0x3852('0x56')]);}return db['VoiceMusicOnHold'][_0x3852('0x4d')](_0xcfb6ef['body'],{'transaction':_0x41eb16})[_0x3852('0x25')](function(_0x4fa5f3){if(_0xcfb6ef[_0x3852('0x4c')][_0x3852('0x50')]==='files'){fs['mkdirSync'](_0x4fa5f3['directory'],parseInt(_0x3852('0x57'),0x8));}var _0x50c26d=_0xcfb6ef[_0x3852('0x58')][_0x3852('0x27')]({'plain':!![]});if(!_0x50c26d)throw new Error(_0x3852('0x59'));if(_0x50c26d[_0x3852('0x5a')]===_0x3852('0x58')){var _0x59afab=_0x4fa5f3['get']({'plain':!![]});return db[_0x3852('0x5b')][_0x3852('0x4b')]({'where':{'name':'MusicOnHolds','userProfileId':_0x50c26d[_0x3852('0x5c')]},'raw':!![]})[_0x3852('0x25')](function(_0x1a3542){if(_0x1a3542&&_0x1a3542[_0x3852('0x5d')]===0x0){return db[_0x3852('0x28')][_0x3852('0x4d')]({'name':_0x59afab[_0x3852('0x56')],'resourceId':_0x59afab['id'],'type':_0x1a3542[_0x3852('0x56')],'sectionId':_0x1a3542['id']},{})[_0x3852('0x25')](function(){return _0x4fa5f3;});}else{return _0x4fa5f3;}})[_0x3852('0x48')](function(_0x5c8df9){logger[_0x3852('0x2a')](_0x3852('0x5e'),_0x5c8df9);});}return _0x4fa5f3;});})['then'](respondWithResult(_0x533d39,0xc9))['catch'](handleError(_0x533d39,null));};exports[_0x3852('0x26')]=function(_0x5dc471,_0x1098b7,_0x406f2e){var _0x30a57a;return db['VoiceMusicOnHold'][_0x3852('0x4b')]({'where':{'id':_0x5dc471[_0x3852('0x49')]['id']}})[_0x3852('0x25')](function(_0x148c85){if(_0x148c85){return db['sequelize'][_0x3852('0x4f')](function(_0x45ec83){return _0x148c85[_0x3852('0x26')]({'transaction':_0x45ec83,'raw':!![]})[_0x3852('0x25')](function(_0x1b34a4){if(_0x1b34a4[_0x3852('0x52')]){fs['readdirSync'](_0x1b34a4[_0x3852('0x52')])[_0x3852('0x5f')](function(_0x40eb03){fs[_0x3852('0x60')](path[_0x3852('0x53')](_0x1b34a4[_0x3852('0x52')],_0x40eb03));});fs[_0x3852('0x61')](_0x1b34a4['directory']);}return _0x1b34a4;});})['catch'](function(_0x5b0267){throw new db['Sequelize']['ValidationError'](_0x5b0267[_0x3852('0x62')]);});}})[_0x3852('0x25')](handleEntityNotFound(_0x1098b7,null))['then'](removeEntity(_0x1098b7,null))['catch'](handleError(_0x1098b7,null));};exports[_0x3852('0x63')]=function(_0x4959ca,_0x212f0f,_0x2bdc86){return db[_0x3852('0x4e')][_0x3852('0x4f')](function(_0x5e4633){var _0x9affa5;return db[_0x3852('0x2e')][_0x3852('0x4b')]({'where':{'id':_0x4959ca[_0x3852('0x49')]['id']}})[_0x3852('0x25')](function(_0x3b2b4b){if(_0x3b2b4b){_0x9affa5=_0x3b2b4b;return _0x3b2b4b[_0x3852('0x63')](_0x4959ca[_0x3852('0x4c')]['id'],{'transaction':_0x5e4633});}})[_0x3852('0x25')](function(_0x51c17b){if(_0x51c17b){return db[_0x3852('0x64')]['findOne']({'where':{'id':_0x4959ca['body']['id']},'attributes':['id','name',_0x3852('0x65'),_0x3852('0x66'),_0x3852('0x67')],'raw':!![]});}})['then'](function(_0x12d54c){if(_0x12d54c){var _0x2d4e14=path[_0x3852('0x53')](config[_0x3852('0x54')],'server/files/sounds/converted',util['format'](_0x3852('0x68'),path[_0x3852('0x69')](_0x12d54c[_0x3852('0x65')],path[_0x3852('0x6a')](_0x12d54c[_0x3852('0x65')])),_0x12d54c[_0x3852('0x66')]));var _0x25ddb5=path[_0x3852('0x53')](config[_0x3852('0x54')],'server/files/moh',_0x9affa5[_0x3852('0x56')],util[_0x3852('0x6b')](_0x3852('0x68'),_0x12d54c[_0x3852('0x56')],_0x12d54c['converted_format']));fs[_0x3852('0x6c')](_0x2d4e14,_0x25ddb5);return _0x12d54c;}})[_0x3852('0x48')](function(_0x2786a5){throw new db[(_0x3852('0x6d'))][(_0x3852('0x6e'))](_0x2786a5['message']);});})[_0x3852('0x25')](handleEntityNotFound(_0x212f0f,null))['then'](respondWithResult(_0x212f0f,0xc9))[_0x3852('0x48')](handleError(_0x212f0f,null));};exports[_0x3852('0x6f')]=function(_0x182461,_0x38ee2b,_0x24ab78){return db[_0x3852('0x4e')][_0x3852('0x4f')](function(_0x2ae49e){var _0x2341c6;return db['VoiceMusicOnHold'][_0x3852('0x70')]({'where':{'id':_0x182461[_0x3852('0x49')]['id']}})['then'](handleEntityNotFound(_0x38ee2b,null))[_0x3852('0x25')](function(_0xc58875){if(_0xc58875){_0x2341c6=_0xc58875;return _0xc58875['removeSound'](_0x182461['params']['id2']);}})['then'](function(_0x35ef63){if(_0x35ef63){return db[_0x3852('0x64')][_0x3852('0x70')]({'where':{'id':_0x182461[_0x3852('0x49')]['id2']},'attributes':['id',_0x3852('0x56'),_0x3852('0x65'),_0x3852('0x66'),_0x3852('0x67')],'raw':!![]});}})[_0x3852('0x25')](function(_0x27b757){if(_0x27b757){fs['unlinkSync'](path[_0x3852('0x53')](_0x2341c6[_0x3852('0x52')],util[_0x3852('0x6b')](_0x3852('0x68'),_0x27b757['name'],_0x27b757['converted_format'])));return _0x27b757;}})[_0x3852('0x48')](function(_0x35541b){throw new db['Sequelize'][(_0x3852('0x6e'))](_0x35541b[_0x3852('0x62')]);});})[_0x3852('0x25')](handleEntityNotFound(_0x38ee2b,null))[_0x3852('0x25')](respondWithStatusCode(_0x38ee2b,0xcc))[_0x3852('0x48')](handleError(_0x38ee2b,null));};exports[_0x3852('0x71')]=function(_0x9a7ace,_0x2bfe3b,_0x4f3173){var _0x58cac5={};var _0x403ecc={};var _0x21d029;var _0x424e4b;return db[_0x3852('0x2e')]['findOne']({'where':{'id':_0x9a7ace[_0x3852('0x49')]['id']}})[_0x3852('0x25')](handleEntityNotFound(_0x2bfe3b,null))['then'](function(_0x226a74){if(_0x226a74){_0x21d029=_0x226a74;_0x403ecc[_0x3852('0x30')]=_[_0x3852('0x31')](db[_0x3852('0x64')]['rawAttributes']);_0x403ecc[_0x3852('0x32')]=_[_0x3852('0x31')](_0x9a7ace[_0x3852('0x32')]);_0x403ecc[_0x3852('0x3a')]=_[_0x3852('0x34')](_0x403ecc[_0x3852('0x30')],_0x403ecc['query']);_0x58cac5['attributes']=_[_0x3852('0x34')](_0x403ecc[_0x3852('0x30')],qs[_0x3852('0x35')](_0x9a7ace[_0x3852('0x32')]['fields']));_0x58cac5[_0x3852('0x33')]=_0x58cac5[_0x3852('0x33')][_0x3852('0x36')]?_0x58cac5['attributes']:_0x403ecc['model'];_0x58cac5[_0x3852('0x38')]=qs[_0x3852('0x39')](_0x9a7ace[_0x3852('0x32')][_0x3852('0x39')]);_0x58cac5['where']=qs['filters'](_[_0x3852('0x3b')](_0x9a7ace[_0x3852('0x32')],_0x403ecc['filters']));if(_0x9a7ace[_0x3852('0x32')]['filter']){_0x58cac5[_0x3852('0x3d')]=_[_0x3852('0x3e')](_0x58cac5[_0x3852('0x3d')],{'$or':_[_0x3852('0x3f')](_0x58cac5[_0x3852('0x33')],function(_0x55a1f0){var _0x3b0e36={};_0x3b0e36[_0x55a1f0]={'$like':'%'+_0x9a7ace[_0x3852('0x32')][_0x3852('0x3c')]+'%'};return _0x3b0e36;})});}_0x58cac5=_[_0x3852('0x3e')]({},_0x58cac5,_0x9a7ace[_0x3852('0x4a')]);return _0x21d029[_0x3852('0x71')](_0x58cac5);}})[_0x3852('0x25')](function(_0x3f7179){if(_0x3f7179){_0x424e4b=_0x3f7179[_0x3852('0x36')];if(!_0x9a7ace[_0x3852('0x32')][_0x3852('0x72')](_0x3852('0x37'))){_0x58cac5[_0x3852('0x1f')]=qs[_0x3852('0x1f')](_0x9a7ace[_0x3852('0x32')][_0x3852('0x1f')]);_0x58cac5[_0x3852('0x1e')]=qs[_0x3852('0x1e')](_0x9a7ace['query'][_0x3852('0x1e')]);}return _0x21d029[_0x3852('0x71')](_0x58cac5);}})['then'](function(_0x4628be){if(_0x4628be){return _0x4628be?{'count':_0x424e4b,'rows':_0x4628be}:null;}})['then'](respondWithResult(_0x2bfe3b,null))[_0x3852('0x48')](handleError(_0x2bfe3b,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index e3c879d..1715578 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 _0x1ece=['moment','bluebird','request-promise','exports','VoiceMusicOnHold','voice_musiconhold','lodash','api'];(function(_0x416412,_0x23d936){var _0x43473f=function(_0x295f91){while(--_0x295f91){_0x416412['push'](_0x416412['shift']());}};_0x43473f(++_0x23d936);}(_0x1ece,0x8e));var _0xe1ec=function(_0xfde46c,_0x1a9190){_0xfde46c=_0xfde46c-0x0;var _0x5958d8=_0x1ece[_0xfde46c];return _0x5958d8;};'use strict';var _=require(_0xe1ec('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe1ec('0x1'));var moment=require(_0xe1ec('0x2'));var BPromise=require(_0xe1ec('0x3'));var rp=require(_0xe1ec('0x4'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xe1ec('0x5')]=function(_0x464db1,_0x51e1fb){return _0x464db1['define'](_0xe1ec('0x6'),attributes,{'tableName':_0xe1ec('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10fa=['moment','bluebird','request-promise','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api'];(function(_0x48e20e,_0x4a3a73){var _0x4c115d=function(_0x15506a){while(--_0x15506a){_0x48e20e['push'](_0x48e20e['shift']());}};_0x4c115d(++_0x4a3a73);}(_0x10fa,0x105));var _0xa10f=function(_0x23e90a,_0x504041){_0x23e90a=_0x23e90a-0x0;var _0x2f471a=_0x10fa[_0x23e90a];return _0x2f471a;};'use strict';var _=require('lodash');var util=require(_0xa10f('0x0'));var logger=require(_0xa10f('0x1'))(_0xa10f('0x2'));var moment=require(_0xa10f('0x3'));var BPromise=require(_0xa10f('0x4'));var rp=require(_0xa10f('0x5'));var attributes=require(_0xa10f('0x6'));module[_0xa10f('0x7')]=function(_0x4b3345,_0x138080){return _0x4b3345[_0xa10f('0x8')](_0xa10f('0x9'),attributes,{'tableName':_0xa10f('0xa'),'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 b964edb..a1d2366 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 _0xe700=['request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x4bb38c,_0xf9a8b5){var _0x147fb=function(_0x4e0f1a){while(--_0x4e0f1a){_0x4bb38c['push'](_0x4bb38c['shift']());}};_0x147fb(++_0xf9a8b5);}(_0xe700,0x16a));var _0x0e70=function(_0x4e6ba5,_0x4ccf17){_0x4e6ba5=_0x4e6ba5-0x0;var _0x41122b=_0xe700[_0x4e6ba5];return _0x41122b;};'use strict';var _=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var moment=require(_0x0e70('0x2'));var BPromise=require(_0x0e70('0x3'));var rs=require(_0x0e70('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e70('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e70('0x6'))(_0x0e70('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0e70('0x8')][_0x0e70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4415bb,_0x65a900,_0x51382d){return new BPromise(function(_0x33f0c3,_0x37da83){return client[_0x0e70('0xa')](_0x4415bb,_0x51382d)[_0x0e70('0xb')](function(_0x151c76){logger[_0x0e70('0xc')](_0x0e70('0xd'),_0x65a900,'request\x20sent');logger[_0x0e70('0xe')](_0x0e70('0xf'),_0x65a900,_0x0e70('0x10'),JSON['stringify'](_0x151c76));if(_0x151c76[_0x0e70('0x11')]){if(_0x151c76[_0x0e70('0x11')][_0x0e70('0x12')]===0x1f4){logger[_0x0e70('0x11')](_0x0e70('0xd'),_0x65a900,_0x151c76[_0x0e70('0x11')]['message']);return _0x37da83(_0x151c76[_0x0e70('0x11')][_0x0e70('0x13')]);}logger[_0x0e70('0x11')](_0x0e70('0xd'),_0x65a900,_0x151c76[_0x0e70('0x11')][_0x0e70('0x13')]);return _0x33f0c3(_0x151c76['error']['message']);}else{logger[_0x0e70('0xc')](_0x0e70('0xd'),_0x65a900,_0x0e70('0x10'));_0x33f0c3(_0x151c76['result'][_0x0e70('0x13')]);}})[_0x0e70('0x14')](function(_0x3c9545){logger[_0x0e70('0x11')](_0x0e70('0xd'),_0x65a900,_0x3c9545);_0x37da83(_0x3c9545);});});} \ No newline at end of file +var _0x7ee1=['http','request','then','info','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','VoiceMusicOnHold,\x20%s,\x20%s','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x49d5a6,_0x3a1f12){var _0x56d4fa=function(_0x1faeb8){while(--_0x1faeb8){_0x49d5a6['push'](_0x49d5a6['shift']());}};_0x56d4fa(++_0x3a1f12);}(_0x7ee1,0x1c5));var _0x17ee=function(_0x350c47,_0x549ee3){_0x350c47=_0x350c47-0x0;var _0xfb3fa9=_0x7ee1[_0x350c47];return _0xfb3fa9;};'use strict';var _=require('lodash');var util=require(_0x17ee('0x0'));var moment=require(_0x17ee('0x1'));var BPromise=require(_0x17ee('0x2'));var rs=require(_0x17ee('0x3'));var fs=require('fs');var Redis=require(_0x17ee('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x17ee('0x5'));var logger=require(_0x17ee('0x6'))(_0x17ee('0x7'));var config=require('../../config/environment');var jayson=require(_0x17ee('0x8'));var client=jayson['client'][_0x17ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b423,_0x2159f5,_0x3981a4){return new BPromise(function(_0x356a22,_0x5baa29){return client[_0x17ee('0xa')](_0x36b423,_0x3981a4)[_0x17ee('0xb')](function(_0x3fcf2b){logger[_0x17ee('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2159f5,_0x17ee('0xd'));logger[_0x17ee('0xe')](_0x17ee('0xf'),_0x2159f5,_0x17ee('0xd'),JSON['stringify'](_0x3fcf2b));if(_0x3fcf2b['error']){if(_0x3fcf2b[_0x17ee('0x10')][_0x17ee('0x11')]===0x1f4){logger[_0x17ee('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2159f5,_0x3fcf2b[_0x17ee('0x10')][_0x17ee('0x12')]);return _0x5baa29(_0x3fcf2b[_0x17ee('0x10')][_0x17ee('0x12')]);}logger[_0x17ee('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2159f5,_0x3fcf2b[_0x17ee('0x10')][_0x17ee('0x12')]);return _0x356a22(_0x3fcf2b[_0x17ee('0x10')]['message']);}else{logger['info'](_0x17ee('0x13'),_0x2159f5,_0x17ee('0xd'));_0x356a22(_0x3fcf2b['result'][_0x17ee('0x12')]);}})[_0x17ee('0x14')](function(_0x15efe9){logger[_0x17ee('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2159f5,_0x15efe9);_0x5baa29(_0x15efe9);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 70f8508..d74be06 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 _0x619d=['getAgents','post','addAgents','put','destroy','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','/:id/users'];(function(_0x4f4375,_0x3b6867){var _0x38090c=function(_0xf991b7){while(--_0xf991b7){_0x4f4375['push'](_0x4f4375['shift']());}};_0x38090c(++_0x3b6867);}(_0x619d,0xd9));var _0xd619=function(_0x29a89a,_0x228ef7){_0x29a89a=_0x29a89a-0x0;var _0x566966=_0x619d[_0x29a89a];return _0x566966;};'use strict';var multer=require(_0xd619('0x0'));var util=require(_0xd619('0x1'));var path=require(_0xd619('0x2'));var timeout=require('connect-timeout');var express=require(_0xd619('0x3'));var router=express[_0xd619('0x4')]();var auth=require(_0xd619('0x5'));var interaction=require(_0xd619('0x6'));var config=require(_0xd619('0x7'));var controller=require('./voicePrefix.controller');router[_0xd619('0x8')]('/',auth[_0xd619('0x9')](),controller[_0xd619('0xa')]);router[_0xd619('0x8')]('/describe',auth[_0xd619('0x9')](),controller[_0xd619('0xb')]);router[_0xd619('0x8')](_0xd619('0xc'),auth[_0xd619('0x9')](),controller['show']);router['get'](_0xd619('0xd'),auth[_0xd619('0x9')](),controller[_0xd619('0xe')]);router[_0xd619('0xf')]('/',auth[_0xd619('0x9')](),controller['create']);router[_0xd619('0xf')](_0xd619('0xd'),auth[_0xd619('0x9')](),controller[_0xd619('0x10')]);router[_0xd619('0x11')](_0xd619('0xc'),auth[_0xd619('0x9')](),controller['update']);router['delete']('/:id',auth[_0xd619('0x9')](),controller[_0xd619('0x12')]);router[_0xd619('0x13')](_0xd619('0xd'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xd619('0x14')]=router; \ No newline at end of file +var _0xf149=['getAgents','create','post','addAgents','update','delete','destroy','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','/describe','isAuthenticated','describe','/:id','/:id/users'];(function(_0xf95f11,_0x209601){var _0x12b4a7=function(_0x5e6f9a){while(--_0x5e6f9a){_0xf95f11['push'](_0xf95f11['shift']());}};_0x12b4a7(++_0x209601);}(_0xf149,0xe1));var _0x9f14=function(_0x3e9b06,_0x417393){_0x3e9b06=_0x3e9b06-0x0;var _0x442af8=_0xf149[_0x3e9b06];return _0x442af8;};'use strict';var multer=require(_0x9f14('0x0'));var util=require(_0x9f14('0x1'));var path=require(_0x9f14('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f14('0x3'));var router=express[_0x9f14('0x4')]();var auth=require(_0x9f14('0x5'));var interaction=require(_0x9f14('0x6'));var config=require(_0x9f14('0x7'));var controller=require(_0x9f14('0x8'));router[_0x9f14('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9f14('0x9')](_0x9f14('0xa'),auth[_0x9f14('0xb')](),controller[_0x9f14('0xc')]);router[_0x9f14('0x9')](_0x9f14('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x9f14('0xe'),auth[_0x9f14('0xb')](),controller[_0x9f14('0xf')]);router['post']('/',auth[_0x9f14('0xb')](),controller[_0x9f14('0x10')]);router[_0x9f14('0x11')](_0x9f14('0xe'),auth[_0x9f14('0xb')](),controller[_0x9f14('0x12')]);router['put'](_0x9f14('0xd'),auth[_0x9f14('0xb')](),controller[_0x9f14('0x13')]);router[_0x9f14('0x14')](_0x9f14('0xd'),auth[_0x9f14('0xb')](),controller[_0x9f14('0x15')]);router[_0x9f14('0x14')](_0x9f14('0xe'),auth[_0x9f14('0xb')](),controller[_0x9f14('0x16')]);module[_0x9f14('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 4fe0463..7d61276 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 _0xb46f=['system-','INTEGER','sequelize','exports','STRING','name'];(function(_0x18e7e5,_0x5ad463){var _0x30c78a=function(_0x473e33){while(--_0x473e33){_0x18e7e5['push'](_0x18e7e5['shift']());}};_0x30c78a(++_0x5ad463);}(_0xb46f,0x152));var _0xfb46=function(_0x459177,_0x3e563a){_0x459177=_0x459177-0x0;var _0x13ae23=_0xb46f[_0x459177];return _0x13ae23;};'use strict';var Sequelize=require(_0xfb46('0x0'));module[_0xfb46('0x1')]={'name':{'type':Sequelize[_0xfb46('0x2')],'allowNull':![],'unique':_0xfb46('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x462006){return _0xfb46('0x4')+this['getDataValue'](_0xfb46('0x3'))+'-';}},'description':{'type':Sequelize[_0xfb46('0x2')]},'callerIdAll':{'type':Sequelize[_0xfb46('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xfb46('0x5')]}}; \ No newline at end of file +var _0xbcdf=['getDataValue','INTEGER','sequelize','STRING','name','VIRTUAL','system-'];(function(_0x370906,_0x45a105){var _0x149216=function(_0xe17761){while(--_0xe17761){_0x370906['push'](_0x370906['shift']());}};_0x149216(++_0x45a105);}(_0xbcdf,0x8e));var _0xfbcd=function(_0x5e8eae,_0x4f81e0){_0x5e8eae=_0x5e8eae-0x0;var _0xdd09cd=_0xbcdf[_0x5e8eae];return _0xdd09cd;};'use strict';var Sequelize=require(_0xfbcd('0x0'));module['exports']={'name':{'type':Sequelize[_0xfbcd('0x1')],'allowNull':![],'unique':_0xfbcd('0x2')},'prefix':{'type':Sequelize[_0xfbcd('0x3')],'get':function(_0xbd6cde){return _0xfbcd('0x4')+this[_0xfbcd('0x5')](_0xfbcd('0x2'))+'-';}},'description':{'type':Sequelize[_0xfbcd('0x1')]},'callerIdAll':{'type':Sequelize[_0xfbcd('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xfbcd('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 0d15008..949ffcb 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(_0xb8be0a,_0x1bb497){var _0x473fd9=function(_0x570704){while(--_0x570704){_0xb8be0a['push'](_0xb8be0a['shift']());}};_0x473fd9(++_0x1bb497);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var 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(_0x49cf39,_0x2bd2be){var _0xe9be4c=function(_0x126bf6){while(--_0x126bf6){_0x49cf39['push'](_0x49cf39['shift']());}};_0xe9be4c(++_0x2bd2be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 187bdf3..e348a95 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 _0x1cc7=['emit','hook','exports','events','../../mysqldb','VoicePrefix','remove'];(function(_0x431770,_0x51536e){var _0x3ff60b=function(_0x4700d4){while(--_0x4700d4){_0x431770['push'](_0x431770['shift']());}};_0x3ff60b(++_0x51536e);}(_0x1cc7,0x15a));var _0x71cc=function(_0x13660d,_0x1b1b0a){_0x13660d=_0x13660d-0x0;var _0x5cb47=_0x1cc7[_0x13660d];return _0x5cb47;};'use strict';var EventEmitter=require(_0x71cc('0x0'));var VoicePrefix=require(_0x71cc('0x1'))['db'][_0x71cc('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x71cc('0x3')};function emitEvent(_0x1fac93){return function(_0x402191,_0x5431e1,_0x5dfed9){VoicePrefixEvents['emit'](_0x1fac93+':'+_0x402191['id'],_0x402191);VoicePrefixEvents[_0x71cc('0x4')](_0x1fac93,_0x402191);_0x5dfed9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x71cc('0x5')](e,emitEvent(event));}}module[_0x71cc('0x6')]=VoicePrefixEvents; \ No newline at end of file +var _0x0faf=['update','remove','emit','hasOwnProperty','hook','exports','events','VoicePrefix','setMaxListeners','save'];(function(_0x2fa7d8,_0x1f8dd7){var _0x2fbecf=function(_0x1c3171){while(--_0x1c3171){_0x2fa7d8['push'](_0x2fa7d8['shift']());}};_0x2fbecf(++_0x1f8dd7);}(_0x0faf,0x132));var _0xf0fa=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x0faf[_0x75f869];return _0x10af8b;};'use strict';var EventEmitter=require(_0xf0fa('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xf0fa('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xf0fa('0x2')](0x0);var events={'afterCreate':_0xf0fa('0x3'),'afterUpdate':_0xf0fa('0x4'),'afterDestroy':_0xf0fa('0x5')};function emitEvent(_0xdc9ce3){return function(_0x515b12,_0xc83253,_0x283f04){VoicePrefixEvents['emit'](_0xdc9ce3+':'+_0x515b12['id'],_0x515b12);VoicePrefixEvents[_0xf0fa('0x6')](_0xdc9ce3,_0x515b12);_0x283f04(null);};}for(var e in events){if(events[_0xf0fa('0x7')](e)){var event=events[e];VoicePrefix[_0xf0fa('0x8')](e,emitEvent(event));}}module[_0xf0fa('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index a2f11ba..c6a5d09 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 _0x4a9c=['./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2d19d7,_0xe73cc8){var _0x5d89d6=function(_0x72d72e){while(--_0x72d72e){_0x2d19d7['push'](_0x2d19d7['shift']());}};_0x5d89d6(++_0xe73cc8);}(_0x4a9c,0xcc));var _0xc4a9=function(_0x566765,_0x5aff76){_0x566765=_0x566765-0x0;var _0x12305b=_0x4a9c[_0x566765];return _0x12305b;};'use strict';var _=require(_0xc4a9('0x0'));var util=require(_0xc4a9('0x1'));var logger=require(_0xc4a9('0x2'))(_0xc4a9('0x3'));var moment=require(_0xc4a9('0x4'));var BPromise=require(_0xc4a9('0x5'));var rp=require('request-promise');var attributes=require(_0xc4a9('0x6'));module[_0xc4a9('0x7')]=function(_0x129b6f,_0x5e8057){return _0x129b6f['define'](_0xc4a9('0x8'),attributes,{'tableName':_0xc4a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf40=['bluebird','request-promise','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment'];(function(_0x336181,_0x337221){var _0x1a4f51=function(_0x483e05){while(--_0x483e05){_0x336181['push'](_0x336181['shift']());}};_0x1a4f51(++_0x337221);}(_0xaf40,0x75));var _0x0af4=function(_0x55cd7f,_0x42e92d){_0x55cd7f=_0x55cd7f-0x0;var _0x26a7ce=_0xaf40[_0x55cd7f];return _0x26a7ce;};'use strict';var _=require('lodash');var util=require(_0x0af4('0x0'));var logger=require(_0x0af4('0x1'))(_0x0af4('0x2'));var moment=require(_0x0af4('0x3'));var BPromise=require(_0x0af4('0x4'));var rp=require(_0x0af4('0x5'));var attributes=require(_0x0af4('0x6'));module[_0x0af4('0x7')]=function(_0x18ca82,_0x2b432d){return _0x18ca82[_0x0af4('0x8')](_0x0af4('0x9'),attributes,{'tableName':_0x0af4('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 fe21ae2..3ec7950 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 _0x6344=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./voicePrefix.socket','register','then','info','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','message','VoicePrefix,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x105414,_0xd62f4b){var _0x5b779f=function(_0x29380e){while(--_0x29380e){_0x105414['push'](_0x105414['shift']());}};_0x5b779f(++_0xd62f4b);}(_0x6344,0x19c));var _0x4634=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x6344[_0x231e16];return _0x570a7c;};'use strict';var _=require(_0x4634('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4634('0x1'));var rs=require(_0x4634('0x2'));var fs=require('fs');var Redis=require(_0x4634('0x3'));var db=require(_0x4634('0x4'))['db'];var utils=require(_0x4634('0x5'));var logger=require(_0x4634('0x6'))('rpc');var config=require(_0x4634('0x7'));var jayson=require(_0x4634('0x8'));var client=jayson[_0x4634('0x9')][_0x4634('0xa')]({'port':0x232a});config['redis']=_[_0x4634('0xb')](config[_0x4634('0xc')],{'host':_0x4634('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4634('0xc')]));require(_0x4634('0xe'))[_0x4634('0xf')](socket);function respondWithRpcPromise(_0x22420e,_0x14213a,_0x433910){return new BPromise(function(_0x4dfbb5,_0x548889){return client['request'](_0x22420e,_0x433910)[_0x4634('0x10')](function(_0x57e349){logger[_0x4634('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x14213a,_0x4634('0x12'));logger[_0x4634('0x13')](_0x4634('0x14'),_0x14213a,'request\x20sent',JSON['stringify'](_0x57e349));if(_0x57e349[_0x4634('0x15')]){if(_0x57e349[_0x4634('0x15')]['code']===0x1f4){logger[_0x4634('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x14213a,_0x57e349[_0x4634('0x15')][_0x4634('0x16')]);return _0x548889(_0x57e349['error'][_0x4634('0x16')]);}logger[_0x4634('0x15')](_0x4634('0x17'),_0x14213a,_0x57e349[_0x4634('0x15')]['message']);return _0x4dfbb5(_0x57e349[_0x4634('0x15')]['message']);}else{logger[_0x4634('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x14213a,_0x4634('0x12'));_0x4dfbb5(_0x57e349[_0x4634('0x18')][_0x4634('0x16')]);}})[_0x4634('0x19')](function(_0x2735c7){logger[_0x4634('0x15')](_0x4634('0x17'),_0x14213a,_0x2735c7);_0x548889(_0x2735c7);});});} \ No newline at end of file +var _0x581a=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x581a,0x79));var _0xa581=function(_0x126e94,_0x41f6f4){_0x126e94=_0x126e94-0x0;var _0x4b8d9e=_0x581a[_0x126e94];return _0x4b8d9e;};'use strict';var _=require(_0xa581('0x0'));var util=require(_0xa581('0x1'));var moment=require(_0xa581('0x2'));var BPromise=require(_0xa581('0x3'));var rs=require(_0xa581('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa581('0x5'))['db'];var utils=require(_0xa581('0x6'));var logger=require(_0xa581('0x7'))(_0xa581('0x8'));var config=require(_0xa581('0x9'));var jayson=require(_0xa581('0xa'));var client=jayson[_0xa581('0xb')][_0xa581('0xc')]({'port':0x232a});config[_0xa581('0xd')]=_[_0xa581('0xe')](config[_0xa581('0xd')],{'host':_0xa581('0xf'),'port':0x18eb});var socket=require(_0xa581('0x10'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xa581('0x11')](socket);function respondWithRpcPromise(_0x567c9c,_0x1c2023,_0x4fa0fd){return new BPromise(function(_0x7ee7ac,_0x36c381){return client[_0xa581('0x12')](_0x567c9c,_0x4fa0fd)[_0xa581('0x13')](function(_0x193267){logger[_0xa581('0x14')](_0xa581('0x15'),_0x1c2023,_0xa581('0x16'));logger[_0xa581('0x17')](_0xa581('0x18'),_0x1c2023,_0xa581('0x16'),JSON[_0xa581('0x19')](_0x193267));if(_0x193267[_0xa581('0x1a')]){if(_0x193267[_0xa581('0x1a')][_0xa581('0x1b')]===0x1f4){logger['error'](_0xa581('0x15'),_0x1c2023,_0x193267[_0xa581('0x1a')][_0xa581('0x1c')]);return _0x36c381(_0x193267[_0xa581('0x1a')]['message']);}logger[_0xa581('0x1a')](_0xa581('0x15'),_0x1c2023,_0x193267['error'][_0xa581('0x1c')]);return _0x7ee7ac(_0x193267[_0xa581('0x1a')][_0xa581('0x1c')]);}else{logger[_0xa581('0x14')](_0xa581('0x15'),_0x1c2023,_0xa581('0x16'));_0x7ee7ac(_0x193267[_0xa581('0x1d')][_0xa581('0x1c')]);}})[_0xa581('0x1e')](function(_0x3bfb62){logger[_0xa581('0x1a')](_0xa581('0x15'),_0x1c2023,_0x3bfb62);_0x36c381(_0x3bfb62);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 8e52c23..5a118f1 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 _0x4e6d=['voicePrefix:','./voicePrefix.events','save','remove','update','emit','length'];(function(_0x484e7d,_0x11359f){var _0x725108=function(_0x3e64ca){while(--_0x3e64ca){_0x484e7d['push'](_0x484e7d['shift']());}};_0x725108(++_0x11359f);}(_0x4e6d,0x1a5));var _0xd4e6=function(_0x50f0e9,_0x2f9300){_0x50f0e9=_0x50f0e9-0x0;var _0x12dae4=_0x4e6d[_0x50f0e9];return _0x12dae4;};'use strict';var VoicePrefixEvents=require(_0xd4e6('0x0'));var events=[_0xd4e6('0x1'),_0xd4e6('0x2'),_0xd4e6('0x3')];function createListener(_0x1b7700,_0x5dbf89){return function(_0x4668e0){_0x5dbf89[_0xd4e6('0x4')](_0x1b7700,_0x4668e0);};}function removeListener(_0x65bf3,_0x3d34b3){return function(){VoicePrefixEvents['removeListener'](_0x65bf3,_0x3d34b3);};}exports['register']=function(_0x3dcd49){for(var _0x3fcde9=0x0,_0x5f19e1=events[_0xd4e6('0x5')];_0x3fcde9<_0x5f19e1;_0x3fcde9++){var _0x36c16f=events[_0x3fcde9];var _0x1cf238=createListener(_0xd4e6('0x6')+_0x36c16f,_0x3dcd49);VoicePrefixEvents['on'](_0x36c16f,_0x1cf238);}}; \ No newline at end of file +var _0x2f3b=['./voicePrefix.events','remove','update','length'];(function(_0x3a3e30,_0x5996b5){var _0x19f849=function(_0xc6e736){while(--_0xc6e736){_0x3a3e30['push'](_0x3a3e30['shift']());}};_0x19f849(++_0x5996b5);}(_0x2f3b,0x19c));var _0xb2f3=function(_0x1d271a,_0x9e110d){_0x1d271a=_0x1d271a-0x0;var _0x3a8137=_0x2f3b[_0x1d271a];return _0x3a8137;};'use strict';var VoicePrefixEvents=require(_0xb2f3('0x0'));var events=['save',_0xb2f3('0x1'),_0xb2f3('0x2')];function createListener(_0x41c87d,_0xd9d22b){return function(_0x2deb55){_0xd9d22b['emit'](_0x41c87d,_0x2deb55);};}function removeListener(_0x247f3c,_0x2ab70a){return function(){VoicePrefixEvents['removeListener'](_0x247f3c,_0x2ab70a);};}exports['register']=function(_0x51f471){for(var _0x98c204=0x0,_0x41bd6a=events[_0xb2f3('0x3')];_0x98c204<_0x41bd6a;_0x98c204++){var _0x49bb50=events[_0x98c204];var _0x4a5d6d=createListener('voicePrefix:'+_0x49bb50,_0x51f471);VoicePrefixEvents['on'](_0x49bb50,_0x4a5d6d);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 2f04fd9..909bafe 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 _0x0bde=['Router','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getLists','/:id/blacklists','post','/:id/clone','clone','addTeams','addAgents','/:id/lists','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','util','connect-timeout','express'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xe0bd('0x0'));var path=require('path');var timeout=require(_0xe0bd('0x1'));var express=require(_0xe0bd('0x2'));var router=express[_0xe0bd('0x3')]();var auth=require(_0xe0bd('0x4'));var interaction=require(_0xe0bd('0x5'));var config=require('../../config/environment');var controller=require(_0xe0bd('0x6'));router[_0xe0bd('0x7')]('/',auth[_0xe0bd('0x8')](),controller[_0xe0bd('0x9')]);router[_0xe0bd('0x7')](_0xe0bd('0xa'),auth[_0xe0bd('0x8')](),controller['show']);router[_0xe0bd('0x7')](_0xe0bd('0xb'),auth[_0xe0bd('0x8')](),controller[_0xe0bd('0xc')]);router[_0xe0bd('0x7')](_0xe0bd('0xd'),auth[_0xe0bd('0x8')](),controller[_0xe0bd('0xe')]);router['get']('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xe0bd('0xf')]);router['get']('/:id/hopper_black',auth[_0xe0bd('0x8')](),controller[_0xe0bd('0x10')]);router['get'](_0xe0bd('0x11'),auth['isAuthenticated'](),controller[_0xe0bd('0x12')]);router[_0xe0bd('0x7')](_0xe0bd('0x13'),auth[_0xe0bd('0x8')](),controller[_0xe0bd('0x14')]);router[_0xe0bd('0x7')](_0xe0bd('0x15'),auth[_0xe0bd('0x8')](),controller['getMembers']);router['get']('/:id/lists',auth[_0xe0bd('0x8')](),controller[_0xe0bd('0x16')]);router[_0xe0bd('0x7')](_0xe0bd('0x17'),auth[_0xe0bd('0x8')](),controller['getBlackLists']);router['post']('/',auth[_0xe0bd('0x8')](),controller['create']);router[_0xe0bd('0x18')](_0xe0bd('0x19'),auth[_0xe0bd('0x8')](),controller[_0xe0bd('0x1a')]);router['post'](_0xe0bd('0x11'),auth[_0xe0bd('0x8')](),controller[_0xe0bd('0x1b')]);router['post'](_0xe0bd('0x13'),auth[_0xe0bd('0x8')](),controller[_0xe0bd('0x1c')]);router['post'](_0xe0bd('0x1d'),auth[_0xe0bd('0x8')](),controller[_0xe0bd('0x1e')]);router['post'](_0xe0bd('0x17'),auth['isAuthenticated'](),controller[_0xe0bd('0x1f')]);router[_0xe0bd('0x20')]('/:id',auth[_0xe0bd('0x8')](),controller[_0xe0bd('0x21')]);router[_0xe0bd('0x22')](_0xe0bd('0xa'),auth[_0xe0bd('0x8')](),controller[_0xe0bd('0x23')]);router[_0xe0bd('0x22')](_0xe0bd('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xe0bd('0x22')](_0xe0bd('0x13'),auth['isAuthenticated'](),controller['removeAgents']);router[_0xe0bd('0x22')](_0xe0bd('0x1d'),auth[_0xe0bd('0x8')](),controller[_0xe0bd('0x24')]);router['delete'](_0xe0bd('0x17'),auth['isAuthenticated'](),controller[_0xe0bd('0x25')]);module[_0xe0bd('0x26')]=router; \ No newline at end of file +var _0x303a=['/:id/blacklists','post','create','/:id/clone','clone','addTeams','addAgents','addBlackLists','put','update','delete','destroy','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists'];(function(_0xaf0d91,_0xdc98c8){var _0xa3747e=function(_0x35233c){while(--_0x35233c){_0xaf0d91['push'](_0xaf0d91['shift']());}};_0xa3747e(++_0xdc98c8);}(_0x303a,0x1a0));var _0xa303=function(_0x54fbff,_0x53470e){_0x54fbff=_0x54fbff-0x0;var _0x5cf619=_0x303a[_0x54fbff];return _0x5cf619;};'use strict';var multer=require(_0xa303('0x0'));var util=require('util');var path=require(_0xa303('0x1'));var timeout=require(_0xa303('0x2'));var express=require(_0xa303('0x3'));var router=express[_0xa303('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa303('0x5'));var config=require(_0xa303('0x6'));var controller=require(_0xa303('0x7'));router[_0xa303('0x8')]('/',auth[_0xa303('0x9')](),controller[_0xa303('0xa')]);router[_0xa303('0x8')](_0xa303('0xb'),auth[_0xa303('0x9')](),controller['show']);router['get']('/:id/hoppers',auth[_0xa303('0x9')](),controller[_0xa303('0xc')]);router['get'](_0xa303('0xd'),auth['isAuthenticated'](),controller[_0xa303('0xe')]);router['get'](_0xa303('0xf'),auth[_0xa303('0x9')](),controller[_0xa303('0x10')]);router[_0xa303('0x8')]('/:id/hopper_black',auth[_0xa303('0x9')](),controller['getHopperBlacks']);router[_0xa303('0x8')](_0xa303('0x11'),auth[_0xa303('0x9')](),controller['getTeams']);router[_0xa303('0x8')](_0xa303('0x12'),auth[_0xa303('0x9')](),controller[_0xa303('0x13')]);router[_0xa303('0x8')](_0xa303('0x14'),auth[_0xa303('0x9')](),controller[_0xa303('0x15')]);router['get'](_0xa303('0x16'),auth[_0xa303('0x9')](),controller[_0xa303('0x17')]);router[_0xa303('0x8')](_0xa303('0x18'),auth[_0xa303('0x9')](),controller['getBlackLists']);router[_0xa303('0x19')]('/',auth['isAuthenticated'](),controller[_0xa303('0x1a')]);router['post'](_0xa303('0x1b'),auth['isAuthenticated'](),controller[_0xa303('0x1c')]);router[_0xa303('0x19')](_0xa303('0x11'),auth['isAuthenticated'](),controller[_0xa303('0x1d')]);router[_0xa303('0x19')](_0xa303('0x12'),auth['isAuthenticated'](),controller[_0xa303('0x1e')]);router[_0xa303('0x19')](_0xa303('0x16'),auth[_0xa303('0x9')](),controller['addLists']);router[_0xa303('0x19')](_0xa303('0x18'),auth['isAuthenticated'](),controller[_0xa303('0x1f')]);router[_0xa303('0x20')](_0xa303('0xb'),auth[_0xa303('0x9')](),controller[_0xa303('0x21')]);router[_0xa303('0x22')](_0xa303('0xb'),auth[_0xa303('0x9')](),controller[_0xa303('0x23')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0xa303('0x12'),auth[_0xa303('0x9')](),controller[_0xa303('0x24')]);router[_0xa303('0x22')](_0xa303('0x16'),auth['isAuthenticated'](),controller[_0xa303('0x25')]);router[_0xa303('0x22')]('/:id/blacklists',auth[_0xa303('0x9')](),controller[_0xa303('0x26')]);module[_0xa303('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index b698e3c..8482686 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 _0x3bff=['setDataValue','strategy','rrmemory','type','dialMethod','getDataValue','booked','progressive','predictive','power','INTEGER','ENUM','yes','all','once','periodic_announce','split','joinempty','join','leavewhenempty','acw','wrapuptime','preview','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','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)','#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)','07:00-22:00,*,*,*','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','inbound','outbound','ringall','leastrecent','fewestcalls','random','linear','rrordered'];(function(_0xc20fca,_0x45c8ee){var _0x3a0488=function(_0x11faa5){while(--_0x11faa5){_0xc20fca['push'](_0xc20fca['shift']());}};_0x3a0488(++_0x45c8ee);}(_0x3bff,0xd0));var _0xf3bf=function(_0x25346f,_0x3cc663){_0x25346f=_0x25346f-0x0;var _0x1b9d38=_0x3bff[_0x25346f];return _0x1b9d38;};'use strict';var Sequelize=require(_0xf3bf('0x0'));module['exports']={'name':{'type':Sequelize[_0xf3bf('0x1')],'allowNull':![],'unique':_0xf3bf('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xf3bf('0x3'),_0xf3bf('0x4')),'allowNull':![],'defaultValue':_0xf3bf('0x3')},'musiconhold':{'type':Sequelize[_0xf3bf('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xf3bf('0x1')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xf3bf('0x5'),_0xf3bf('0x6'),_0xf3bf('0x7'),_0xf3bf('0x8'),'rrmemory',_0xf3bf('0x9'),'wrandom',_0xf3bf('0xa')),'allowNull':![],'defaultValue':_0xf3bf('0x5'),'set':function(_0x5b7dcd){this[_0xf3bf('0xb')](_0xf3bf('0xc'),_0x5b7dcd?_0x5b7dcd:_0xf3bf('0xd'));},'get':function(){var _0x1a6b43=this['getDataValue'](_0xf3bf('0xe'));var _0x6d2d80=this['getDataValue'](_0xf3bf('0xf'));var _0x627515=this[_0xf3bf('0x10')](_0xf3bf('0xc'));if(_0x1a6b43==='inbound'){return _0x627515;}if(_0x6d2d80===_0xf3bf('0x11')&&_0x627515===_0xf3bf('0xd')||_0x6d2d80===_0xf3bf('0x11')&&_0x627515==='roundrobin'){return _0x627515;}if(_0x6d2d80===_0xf3bf('0x12')||_0x6d2d80===_0xf3bf('0x13')||_0x6d2d80===_0xf3bf('0x14')){return _0x627515;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xf3bf('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xf3bf('0x15')](0xb)},'timeout':{'type':Sequelize[_0xf3bf('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xf3bf('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xf3bf('0x16')](_0xf3bf('0x17'),'no'),'defaultValue':_0xf3bf('0x17')},'autopause':{'type':Sequelize[_0xf3bf('0x16')](_0xf3bf('0x17'),'no',_0xf3bf('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xf3bf('0x16')](_0xf3bf('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xf3bf('0x16')](_0xf3bf('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xf3bf('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xf3bf('0x16')](_0xf3bf('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xf3bf('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xf3bf('0x16')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xf3bf('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xf3bf('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xf3bf('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xf3bf('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xf3bf('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xf3bf('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xf3bf('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xf3bf('0x17'),'no'),'defaultValue':_0xf3bf('0x17')},'announce_holdtime':{'type':Sequelize[_0xf3bf('0x16')](_0xf3bf('0x17'),'no',_0xf3bf('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xf3bf('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xf3bf('0x16')](_0xf3bf('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xf3bf('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xf3bf('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xf3bf('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xf3bf('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xf3bf('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xf3bf('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xf3bf('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xf3bf('0x1')]},'queue_quantity1':{'type':Sequelize[_0xf3bf('0x1')]},'queue_quantity2':{'type':Sequelize[_0xf3bf('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xf3bf('0x1')]},'queue_less_than':{'type':Sequelize[_0xf3bf('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x31541f){this[_0xf3bf('0xb')](_0xf3bf('0x1a'),_0x31541f?_0x31541f['join'](','):[]);},'get':function(){return this[_0xf3bf('0x10')](_0xf3bf('0x1a'))?this['getDataValue'](_0xf3bf('0x1a'))[_0xf3bf('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0xf3bf('0x1')],'defaultValue':_0xf3bf('0x17'),'set':function(_0xe15525){this['setDataValue'](_0xf3bf('0x1c'),_0xe15525?_0xe15525[_0xf3bf('0x1d')](','):[]);},'get':function(){return this[_0xf3bf('0x10')](_0xf3bf('0x1c'))?this[_0xf3bf('0x10')]('joinempty')[_0xf3bf('0x1b')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xf3bf('0x1')],'defaultValue':'no','set':function(_0x3b7b52){this[_0xf3bf('0xb')](_0xf3bf('0x1e'),_0x3b7b52?_0x3b7b52['join'](','):[]);},'get':function(){return this['getDataValue'](_0xf3bf('0x1e'))?this['getDataValue'](_0xf3bf('0x1e'))[_0xf3bf('0x1b')](','):[];}},'reportholdtime':{'type':Sequelize['ENUM'](_0xf3bf('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xf3bf('0x16')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xf3bf('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xf3bf('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xf3bf('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x3d88d7){this[_0xf3bf('0xb')](_0xf3bf('0x1f'),_0x3d88d7);if(_0x3d88d7){if(this[_0xf3bf('0x10')]('wrapuptime')<0x2){this['setDataValue'](_0xf3bf('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xf3bf('0x16')](_0xf3bf('0x21'),_0xf3bf('0x12'),_0xf3bf('0x14'),_0xf3bf('0x13'),_0xf3bf('0x11')),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xf3bf('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf3bf('0x22')},'dialLimitQueue':{'type':Sequelize[_0xf3bf('0x15')](0x4)[_0xf3bf('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf3bf('0x24')},'dialPowerLevel':{'type':Sequelize[_0xf3bf('0x25')](0x2)[_0xf3bf('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xf3bf('0x26')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xf3bf('0x27'),_0xf3bf('0x28')),'defaultValue':_0xf3bf('0x28'),'comment':_0xf3bf('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xf3bf('0x25')](0x2)[_0xf3bf('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xf3bf('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xf3bf('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xf3bf('0x15')](0x3)[_0xf3bf('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf3bf('0x2a')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xf3bf('0x2b'),'comment':_0xf3bf('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0xf3bf('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf3bf('0x2d')},'dialQueueProject':{'type':Sequelize[_0xf3bf('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xf3bf('0x15')](0x3)[_0xf3bf('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf3bf('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf3bf('0x15')](0x5)[_0xf3bf('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf3bf('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0xf3bf('0x15')](0x3)[_0xf3bf('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf3bf('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf3bf('0x15')](0x5)[_0xf3bf('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf3bf('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf3bf('0x15')](0x3)[_0xf3bf('0x23')],'defaultValue':0x3,'comment':_0xf3bf('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf3bf('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf3bf('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf3bf('0x34')},'dialTimezone':{'type':Sequelize[_0xf3bf('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf3bf('0x1')],'defaultValue':_0xf3bf('0x35')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xf3bf('0x16')](_0xf3bf('0x36'),'never',_0xf3bf('0x37')),'defaultValue':_0xf3bf('0x36')},'dialAMDActive':{'type':Sequelize[_0xf3bf('0x38')],'defaultValue':0x0,'comment':_0xf3bf('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0xf3bf('0x15')](0x9)[_0xf3bf('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf3bf('0x3a')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xf3bf('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf3bf('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf3bf('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf3bf('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf3bf('0x15')](0x9)[_0xf3bf('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf3bf('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0xf3bf('0x15')](0x9)[_0xf3bf('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf3bf('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf3bf('0x15')](0x9)[_0xf3bf('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf3bf('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf3bf('0x15')](0x9)[_0xf3bf('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf3bf('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf3bf('0x15')](0x5)[_0xf3bf('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf3bf('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf3bf('0x15')](0x9)[_0xf3bf('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xf3bf('0x15')](0x5)[_0xf3bf('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xf3bf('0x38')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xf3bf('0x16')](_0xf3bf('0x42'),_0xf3bf('0x43')),'defaultValue':_0xf3bf('0x42')},'dialQueueProject2':{'type':Sequelize[_0xf3bf('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xf3bf('0x38')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xf3bf('0x38')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf3bf('0x15')](0x3)[_0xf3bf('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf3bf('0x44')},'dialCutDigit':{'type':Sequelize[_0xf3bf('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf3bf('0x45')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf3bf('0x15')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf3bf('0x38')],'defaultValue':![],'comment':_0xf3bf('0x46'),'set':function(_0xd5b2d4){if(!_0xd5b2d4)this[_0xf3bf('0xb')](_0xf3bf('0x47'),null);this['setDataValue'](_0xf3bf('0x48'),_0xd5b2d4);}}}; \ No newline at end of file +var _0xd540=['leavewhenempty','join','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','progressive','predictive','INTEGER','yes','all','TEXT','periodic_announce','split','joinempty'];(function(_0x32de06,_0x43472a){var _0x4d04fe=function(_0x2e75c8){while(--_0x2e75c8){_0x32de06['push'](_0x32de06['shift']());}};_0x4d04fe(++_0x43472a);}(_0xd540,0x7d));var _0x0d54=function(_0x1c9fc4,_0x1654cb){_0x1c9fc4=_0x1c9fc4-0x0;var _0x5b9763=_0xd540[_0x1c9fc4];return _0x5b9763;};'use strict';var Sequelize=require(_0x0d54('0x0'));module[_0x0d54('0x1')]={'name':{'type':Sequelize[_0x0d54('0x2')],'allowNull':![],'unique':_0x0d54('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x5'),_0x0d54('0x6')),'allowNull':![],'defaultValue':_0x0d54('0x5')},'musiconhold':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':_0x0d54('0x7')},'announce':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0d54('0x4')]('rr',_0x0d54('0x8'),_0x0d54('0x9'),_0x0d54('0xa'),'random',_0x0d54('0xb'),'linear',_0x0d54('0xc'),_0x0d54('0xd')),'allowNull':![],'defaultValue':'ringall','set':function(_0x821c30){this[_0x0d54('0xe')](_0x0d54('0xf'),_0x821c30?_0x821c30:_0x0d54('0xb'));},'get':function(){var _0x5f25b3=this[_0x0d54('0x10')](_0x0d54('0x11'));var _0x27fbbf=this['getDataValue'](_0x0d54('0x12'));var _0x28d02e=this[_0x0d54('0x10')](_0x0d54('0xf'));if(_0x5f25b3===_0x0d54('0x5')){return _0x28d02e;}if(_0x27fbbf===_0x0d54('0x13')&&_0x28d02e==='rrmemory'||_0x27fbbf==='booked'&&_0x28d02e==='roundrobin'){return _0x28d02e;}if(_0x27fbbf===_0x0d54('0x14')||_0x27fbbf===_0x0d54('0x15')||_0x27fbbf==='power'){return _0x28d02e;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0d54('0x16')](0xb)},'timeout':{'type':Sequelize[_0x0d54('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x0d54('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0d54('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0d54('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x17'),'no',_0x0d54('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0d54('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0d54('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0d54('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0d54('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0d54('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x17'),'no'),'defaultValue':_0x0d54('0x17')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x0d54('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x0d54('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0d54('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0d54('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0d54('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0d54('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0d54('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0d54('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0d54('0x2')]},'queue_less_than':{'type':Sequelize[_0x0d54('0x2')]},'periodic_announce':{'type':Sequelize[_0x0d54('0x19')],'set':function(_0x98f97d){this[_0x0d54('0xe')]('periodic_announce',_0x98f97d?_0x98f97d['join'](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0x0d54('0x10')](_0x0d54('0x1a'))[_0x0d54('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':_0x0d54('0x17'),'set':function(_0x3dbf5b){this[_0x0d54('0xe')]('joinempty',_0x3dbf5b?_0x3dbf5b['join'](','):[]);},'get':function(){return this[_0x0d54('0x10')](_0x0d54('0x1c'))?this['getDataValue'](_0x0d54('0x1c'))[_0x0d54('0x1b')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':'no','set':function(_0x36c28f){this[_0x0d54('0xe')](_0x0d54('0x1d'),_0x36c28f?_0x36c28f[_0x0d54('0x1e')](','):[]);},'get':function(){return this['getDataValue'](_0x0d54('0x1d'))?this[_0x0d54('0x10')](_0x0d54('0x1d'))[_0x0d54('0x1b')](','):[];}},'reportholdtime':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0d54('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0d54('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0d54('0x2')]},'acw':{'type':Sequelize[_0x0d54('0x1f')],'defaultValue':0x0,'set':function(_0x41fe04){this[_0x0d54('0xe')](_0x0d54('0x20'),_0x41fe04);if(_0x41fe04){if(this[_0x0d54('0x10')](_0x0d54('0x21'))<0x2){this[_0x0d54('0xe')](_0x0d54('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0d54('0x1f')],'defaultValue':0x0,'comment':_0x0d54('0x22')},'dialMethod':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x23'),_0x0d54('0x14'),_0x0d54('0x24'),_0x0d54('0x15'),'booked'),'defaultValue':_0x0d54('0x14'),'comment':_0x0d54('0x25')},'dialLimitChannel':{'type':Sequelize[_0x0d54('0x16')](0x4)[_0x0d54('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0d54('0x27')},'dialLimitQueue':{'type':Sequelize[_0x0d54('0x16')](0x4)[_0x0d54('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0d54('0x28')},'dialPowerLevel':{'type':Sequelize[_0x0d54('0x29')](0x2)[_0x0d54('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0d54('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x2b'),_0x0d54('0x2c')),'defaultValue':'dropRate','comment':_0x0d54('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0d54('0x29')](0x2)[_0x0d54('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0d54('0x2e')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x0d54('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0d54('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0d54('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0d54('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0d54('0x16')](0x3)[_0x0d54('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d54('0x30')},'dialQueueOptions':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':_0x0d54('0x31'),'comment':_0x0d54('0x32')},'dialQueueTimeout':{'type':Sequelize[_0x0d54('0x16')](0x3)[_0x0d54('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d54('0x33')},'dialQueueProject':{'type':Sequelize[_0x0d54('0x2')],'comment':_0x0d54('0x34')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0d54('0x16')](0x3)[_0x0d54('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0d54('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d54('0x35')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d54('0x36')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0d54('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d54('0x37')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0d54('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0d54('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d54('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0d54('0x16')](0x3)[_0x0d54('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0d54('0x39')},'dialTimezone':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0d54('0x2')],'defaultValue':_0x0d54('0x3a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x3b'),_0x0d54('0x3c'),_0x0d54('0x3d')),'defaultValue':_0x0d54('0x3b')},'dialAMDActive':{'type':Sequelize[_0x0d54('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0d54('0x16')](0x9)[_0x0d54('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0d54('0x3e')},'dialAMDGreeting':{'type':Sequelize[_0x0d54('0x16')](0x9)[_0x0d54('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0d54('0x3f')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0d54('0x16')](0x9)[_0x0d54('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0d54('0x16')](0x9)[_0x0d54('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0d54('0x40')},'dialAMDMinWordLength':{'type':Sequelize[_0x0d54('0x16')](0x9)[_0x0d54('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0d54('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0d54('0x16')](0x9)[_0x0d54('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0d54('0x42')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x0d54('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0d54('0x43')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0d54('0x16')](0x9)[_0x0d54('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0d54('0x44')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0d54('0x45')},'dialRecallInQueue':{'type':Sequelize[_0x0d54('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x0d54('0x4')](_0x0d54('0x46'),_0x0d54('0x47')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x0d54('0x2')],'comment':_0x0d54('0x34')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0d54('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0d54('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0d54('0x16')](0x3)[_0x0d54('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0d54('0x48')},'dialCutDigit':{'type':Sequelize[_0x0d54('0x16')](0x3)[_0x0d54('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0d54('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0d54('0x16')],'allowNull':!![],'comment':_0x0d54('0x4a')},'mandatoryDisposition':{'type':Sequelize[_0x0d54('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x361643){if(!_0x361643)this[_0x0d54('0xe')](_0x0d54('0x4b'),null);this[_0x0d54('0xe')](_0x0d54('0x4c'),_0x361643);}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 9f5d4ee..a9afd4f 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 _0x10a8=['register','status','end','count','offset','set','Content-Range','json','apply','reject','save','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','find','UserProfileResource','destroy','then','error','stack','send','index','VoiceQueue','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','key','VIRTUAL','options','includeAll','include','findAll','rows','params','catch','create','body','user','name','UserProfileSection','userProfileId','autoAssociation','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','ids','User','Agents','union','penalty','removeTeams','removeAgents','addAgents','spread','emit','userVoiceQueue:save','voicePause','interface','push','UserVoiceQueueRt','upsert','format','SIP/%s','all','isArray','userVoiceQueue:remove','realtime','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','field','toString','cm_contacts','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','from','cm_hopper_final','VoiceQueueId\x20=\x20?','insert','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./voiceQueue.socket'];(function(_0x452c6e,_0x5d35ee){var _0x25302e=function(_0xa23bbe){while(--_0xa23bbe){_0x452c6e['push'](_0x452c6e['shift']());}};_0x25302e(++_0x5d35ee);}(_0x10a8,0x1dd));var _0x810a=function(_0x538bc6,_0x155023){_0x538bc6=_0x538bc6-0x0;var _0xead21b=_0x10a8[_0x538bc6];return _0xead21b;};'use strict';var pdf=require(_0x810a('0x0'));var emlformat=require(_0x810a('0x1'));var rimraf=require(_0x810a('0x2'));var zipdir=require(_0x810a('0x3'));var jsonpatch=require(_0x810a('0x4'));var rp=require('request-promise');var moment=require(_0x810a('0x5'));var BPromise=require(_0x810a('0x6'));var Mustache=require('mustache');var util=require(_0x810a('0x7'));var path=require(_0x810a('0x8'));var sox=require(_0x810a('0x9'));var csv=require('to-csv');var ejs=require(_0x810a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x810a('0xb'));var crypto=require('crypto');var jsforce=require(_0x810a('0xc'));var deskjs=require(_0x810a('0xd'));var toCsv=require(_0x810a('0xe'));var querystring=require(_0x810a('0xf'));var Papa=require(_0x810a('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0x810a('0x11'));var Redis=require(_0x810a('0x12'));var qs=require(_0x810a('0x13'));var logger=require('../../config/logger')(_0x810a('0x14'));var utils=require(_0x810a('0x15'));var config=require(_0x810a('0x16'));var db=require('../../mysqldb')['db'];config[_0x810a('0x17')]=_[_0x810a('0x18')](config[_0x810a('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x810a('0x19'))(new Redis(config[_0x810a('0x17')]));require(_0x810a('0x1a'))[_0x810a('0x1b')](socket);function respondWithStatusCode(_0x3a31ff,_0x5c41dd){_0x5c41dd=_0x5c41dd||0xcc;return function(_0x290089){if(_0x290089){return _0x3a31ff['sendStatus'](_0x5c41dd);}return _0x3a31ff[_0x810a('0x1c')](_0x5c41dd)[_0x810a('0x1d')]();};}function respondWithResult(_0x488f15,_0x5668b8){_0x5668b8=_0x5668b8||0xc8;return function(_0x3d3d03){if(_0x3d3d03){return _0x488f15[_0x810a('0x1c')](_0x5668b8)['json'](_0x3d3d03);}};}function respondWithFilteredResult(_0x5a239,_0x1d142b){return function(_0x177390){if(_0x177390){var _0x31aad3=_0x177390[_0x810a('0x1e')],_0x4c20a0=_0x1d142b['offset'],_0x24f9cb=_0x1d142b[_0x810a('0x1f')]+_0x1d142b['limit'],_0x2bbc4a;if(_0x24f9cb>=_0x31aad3){_0x24f9cb=_0x31aad3;_0x2bbc4a=0xc8;}else{_0x2bbc4a=0xce;}_0x5a239[_0x810a('0x1c')](_0x2bbc4a);return _0x5a239[_0x810a('0x20')](_0x810a('0x21'),_0x4c20a0+'-'+_0x24f9cb+'/'+_0x31aad3)[_0x810a('0x22')](_0x177390);}return null;};}function patchUpdates(_0xb5bf0a){return function(_0x1d55bc){try{jsonpatch[_0x810a('0x23')](_0x1d55bc,_0xb5bf0a,!![]);}catch(_0x57ee80){return BPromise[_0x810a('0x24')](_0x57ee80);}return _0x1d55bc[_0x810a('0x25')]();};}function saveUpdates(_0x21ea5d,_0x5f1c37){return function(_0x581e0f){if(_0x581e0f){return _0x581e0f['update'](_0x21ea5d)['then'](function(_0x24c91d){return _0x24c91d;});}return null;};}function removeEntity(_0x2038d9,_0x4585ab){return function(_0xeafbb2){if(_0xeafbb2){return _0xeafbb2['destroy']()['then'](function(){var _0x388fd7=_0xeafbb2[_0x810a('0x26')]({'plain':!![]});var _0xecb08f=[{'name':_0x810a('0x27'),'value':_0x810a('0x28'),'ignore':![]},{'name':_0x810a('0x29'),'value':_0x810a('0x2a'),'ignore':![]}];var _0x2e0b79=_(_0xecb08f)[_0x810a('0x2b')](_0x810a('0x2c'))['map'](_0x810a('0x2d'))[_0x810a('0x2d')]();if(_[_0x810a('0x2e')](_0x2e0b79,_0x388fd7[_0x810a('0x2f')])){return;}var _0x3f1b63=_[_0x810a('0x30')](_0xecb08f,[_0x810a('0x2d'),_0x388fd7[_0x810a('0x2f')]])['name'];return db[_0x810a('0x31')][_0x810a('0x32')]({'where':{'type':_0x3f1b63,'resourceId':_0x388fd7['id']}})['then'](function(){return _0xeafbb2;});})[_0x810a('0x33')](function(){_0x2038d9[_0x810a('0x1c')](0xcc)[_0x810a('0x1d')]();});}};}function handleEntityNotFound(_0x565f15,_0x373f95){return function(_0x1a007e){if(!_0x1a007e){_0x565f15['sendStatus'](0x194);}return _0x1a007e;};}function handleError(_0x125045,_0x2ecc5f){_0x2ecc5f=_0x2ecc5f||0x1f4;return function(_0x3b9879){logger[_0x810a('0x34')](_0x3b9879[_0x810a('0x35')]);if(_0x3b9879['name']){delete _0x3b9879['name'];}_0x125045[_0x810a('0x1c')](_0x2ecc5f)[_0x810a('0x36')](_0x3b9879);};}exports[_0x810a('0x37')]=function(_0x2466ca,_0xc630e3){var _0x5b4c17={},_0x886d64={},_0x2cd92a={'count':0x0,'rows':[]};var _0x457767=db[_0x810a('0x38')][_0x810a('0x39')];_0x886d64[_0x810a('0x3a')]=_[_0x810a('0x3b')](_0x457767);_0x886d64[_0x810a('0x3c')]=_[_0x810a('0x3b')](_0x2466ca[_0x810a('0x3c')]);_0x886d64[_0x810a('0x3d')]=_['intersection'](_0x886d64['model'],_0x886d64[_0x810a('0x3c')]);_0x5b4c17['attributes']=_[_0x810a('0x3e')](_0x886d64[_0x810a('0x3a')],qs['fields'](_0x2466ca['query'][_0x810a('0x3f')]));_0x5b4c17[_0x810a('0x40')]=_0x5b4c17[_0x810a('0x40')][_0x810a('0x41')]?_0x5b4c17['attributes']:_0x886d64['model'];if(!_0x2466ca[_0x810a('0x3c')][_0x810a('0x42')](_0x810a('0x43'))){_0x5b4c17['limit']=qs[_0x810a('0x44')](_0x2466ca[_0x810a('0x3c')][_0x810a('0x44')]);_0x5b4c17[_0x810a('0x1f')]=qs['offset'](_0x2466ca[_0x810a('0x3c')][_0x810a('0x1f')]);}_0x5b4c17[_0x810a('0x45')]=qs[_0x810a('0x46')](_0x2466ca[_0x810a('0x3c')]['sort']);_0x5b4c17[_0x810a('0x47')]=qs['filters'](_[_0x810a('0x48')](_0x2466ca[_0x810a('0x3c')],_0x886d64[_0x810a('0x3d')]));if(_0x2466ca['query']['filter']){_0x5b4c17[_0x810a('0x47')]=_[_0x810a('0x49')](_0x5b4c17[_0x810a('0x47')],{'$or':_[_0x810a('0x4a')](_0x457767,function(_0x34ea1c){if(_0x34ea1c[_0x810a('0x2f')][_0x810a('0x4b')]!==_0x810a('0x4c')){var _0x12e212={};_0x12e212[_0x34ea1c['field']]={'$like':'%'+_0x2466ca['query'][_0x810a('0x2b')]+'%'};return _0x12e212;}})});}_0x5b4c17=_['merge']({},_0x5b4c17,_0x2466ca[_0x810a('0x4d')]);var _0x4b0b57={'where':_0x5b4c17['where']};return db[_0x810a('0x38')]['count'](_0x4b0b57)[_0x810a('0x33')](function(_0x322af1){_0x2cd92a[_0x810a('0x1e')]=_0x322af1;if(_0x2466ca[_0x810a('0x3c')][_0x810a('0x4e')]){_0x5b4c17[_0x810a('0x4f')]=[{'all':!![]}];}return db['VoiceQueue'][_0x810a('0x50')](_0x5b4c17);})[_0x810a('0x33')](function(_0x53f74f){_0x2cd92a[_0x810a('0x51')]=_0x53f74f;return _0x2cd92a;})['then'](respondWithFilteredResult(_0xc630e3,_0x5b4c17))['catch'](handleError(_0xc630e3,null));};exports['show']=function(_0x284370,_0x3228a6){var _0x495bec={'raw':![],'where':{'id':_0x284370[_0x810a('0x52')]['id']}},_0x7aa445={};_0x7aa445[_0x810a('0x3a')]=_['keys'](db['VoiceQueue'][_0x810a('0x39')]);_0x7aa445[_0x810a('0x3c')]=_[_0x810a('0x3b')](_0x284370[_0x810a('0x3c')]);_0x7aa445[_0x810a('0x3d')]=_['intersection'](_0x7aa445[_0x810a('0x3a')],_0x7aa445[_0x810a('0x3c')]);_0x495bec[_0x810a('0x40')]=_[_0x810a('0x3e')](_0x7aa445['model'],qs['fields'](_0x284370[_0x810a('0x3c')]['fields']));_0x495bec[_0x810a('0x40')]=_0x495bec['attributes'][_0x810a('0x41')]?_0x495bec[_0x810a('0x40')]:_0x7aa445['model'];if(_0x284370[_0x810a('0x3c')]['includeAll']){_0x495bec[_0x810a('0x4f')]=[{'all':!![]}];}_0x495bec=_['merge']({},_0x495bec,_0x284370['options']);return db['VoiceQueue'][_0x810a('0x30')](_0x495bec)['then'](handleEntityNotFound(_0x3228a6,null))[_0x810a('0x33')](respondWithResult(_0x3228a6,null))[_0x810a('0x53')](handleError(_0x3228a6,null));};exports[_0x810a('0x54')]=function(_0x4e94a7,_0x4fadd1){return db[_0x810a('0x38')]['create'](_0x4e94a7[_0x810a('0x55')],{})[_0x810a('0x33')](function(_0x3315dd){var _0x446ffd=_0x4e94a7[_0x810a('0x56')][_0x810a('0x26')]({'plain':!![]});if(!_0x446ffd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x446ffd['role']===_0x810a('0x56')){var _0x255083=_0x3315dd[_0x810a('0x26')]({'plain':!![]});var _0xff7fd4=[{'name':_0x810a('0x27'),'value':_0x810a('0x28')},{'name':'QueueCampaigns','value':'outbound'}];var _0x3e3e1f=_[_0x810a('0x30')](_0xff7fd4,[_0x810a('0x2d'),_0x255083[_0x810a('0x2f')]])[_0x810a('0x57')];return db[_0x810a('0x58')][_0x810a('0x30')]({'where':{'name':_0x3e3e1f,'userProfileId':_0x446ffd[_0x810a('0x59')]},'raw':!![]})['then'](function(_0x4f7aa5){if(_0x4f7aa5&&_0x4f7aa5[_0x810a('0x5a')]===0x0){return db[_0x810a('0x31')]['create']({'name':_0x255083[_0x810a('0x57')],'resourceId':_0x255083['id'],'type':_0x4f7aa5[_0x810a('0x57')],'sectionId':_0x4f7aa5['id']},{})[_0x810a('0x33')](function(){return _0x3315dd;});}else{return _0x3315dd;}})[_0x810a('0x53')](function(_0x3acf80){logger[_0x810a('0x34')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3acf80);throw _0x3acf80;});}return _0x3315dd;})[_0x810a('0x33')](respondWithResult(_0x4fadd1,0xc9))['catch'](handleError(_0x4fadd1,null));};exports[_0x810a('0x5b')]=function(_0x597e99,_0x5e302e){var _0x1b26ad={'raw':![],'where':{'id':_0x597e99[_0x810a('0x52')]['id']}},_0x471f39={};_0x471f39[_0x810a('0x3a')]=_[_0x810a('0x3b')](db['VoiceQueue'][_0x810a('0x39')]);_0x1b26ad['attributes']=_['intersection'](_0x471f39['model'],qs['fields'](_0x597e99['query'][_0x810a('0x3f')]));_0x1b26ad[_0x810a('0x40')]=_0x1b26ad[_0x810a('0x40')][_0x810a('0x41')]?_0x1b26ad[_0x810a('0x40')]:_0x471f39['model'];if(_0x597e99[_0x810a('0x3c')][_0x810a('0x4e')]){_0x1b26ad['include']=[{'all':!![]}];}_0x1b26ad=_['merge']({},_0x1b26ad,_0x597e99['options']);return db[_0x810a('0x38')][_0x810a('0x30')](_0x1b26ad)[_0x810a('0x33')](handleEntityNotFound(_0x5e302e,null))['then'](function(_0x392b51){if(_0x392b51){var _0x24adc1=_0x392b51[_0x810a('0x26')]({'plain':!![]});_0x24adc1=qs[_0x810a('0x5c')](_0x24adc1,['id','createdAt',_0x810a('0x5d')]);_0x597e99[_0x810a('0x55')]=_[_0x810a('0x5c')](_0x597e99[_0x810a('0x55')],['id',_0x810a('0x5e'),_0x810a('0x5d')]);return db['VoiceQueue'][_0x810a('0x54')](_[_0x810a('0x49')](_0x24adc1,_0x597e99[_0x810a('0x55')]),{'include':_0x597e99[_0x810a('0x3c')][_0x810a('0x4e')]?[{'all':!![]}]:undefined})[_0x810a('0x33')](function(_0x156473){var _0x5df41f=_0x597e99[_0x810a('0x56')][_0x810a('0x26')]({'plain':!![]});if(!_0x5df41f)throw new Error(_0x810a('0x5f'));if(_0x5df41f[_0x810a('0x60')]==='user'){var _0x2b74ea=_0x156473[_0x810a('0x26')]({'plain':!![]});var _0xf62fd7=[{'name':_0x810a('0x27'),'value':_0x810a('0x28')},{'name':_0x810a('0x29'),'value':'outbound'}];var _0x24c41f=_[_0x810a('0x30')](_0xf62fd7,[_0x810a('0x2d'),_0x2b74ea[_0x810a('0x2f')]])[_0x810a('0x57')];return db['UserProfileSection'][_0x810a('0x30')]({'where':{'name':_0x24c41f,'userProfileId':_0x5df41f[_0x810a('0x59')]},'raw':!![]})[_0x810a('0x33')](function(_0x201872){if(_0x201872&&_0x201872[_0x810a('0x5a')]===0x0){return db[_0x810a('0x31')][_0x810a('0x54')]({'name':_0x2b74ea[_0x810a('0x57')],'resourceId':_0x2b74ea['id'],'type':_0x201872[_0x810a('0x57')],'sectionId':_0x201872['id']},{})['then'](function(){return _0x156473;});}else{return _0x156473;}})[_0x810a('0x53')](function(_0x5592d0){logger[_0x810a('0x34')](_0x810a('0x61'),_0x5592d0);throw _0x5592d0;});}return _0x156473;});}})[_0x810a('0x33')](respondWithResult(_0x5e302e,0xc9))[_0x810a('0x53')](handleError(_0x5e302e,null));};exports[_0x810a('0x62')]=function(_0x461737,_0x4ff5de){if(_0x461737[_0x810a('0x55')]['id']){delete _0x461737[_0x810a('0x55')]['id'];}return db[_0x810a('0x38')][_0x810a('0x30')]({'where':{'id':_0x461737[_0x810a('0x52')]['id']}})[_0x810a('0x33')](handleEntityNotFound(_0x4ff5de,null))[_0x810a('0x33')](saveUpdates(_0x461737['body'],null))[_0x810a('0x33')](respondWithResult(_0x4ff5de,null))[_0x810a('0x53')](handleError(_0x4ff5de,null));};exports[_0x810a('0x32')]=function(_0x4682d1,_0x54d36f){return db[_0x810a('0x38')][_0x810a('0x30')]({'where':{'id':_0x4682d1['params']['id']}})['then'](handleEntityNotFound(_0x54d36f,null))[_0x810a('0x33')](removeEntity(_0x54d36f,null))[_0x810a('0x53')](handleError(_0x54d36f,null));};exports[_0x810a('0x63')]=function(_0x52570e,_0xc24c04,_0x41e473){var _0x1abbbf={'raw':![],'where':{}};var _0x100f97={};var _0x46d72d={'count':0x0,'rows':[]};return db[_0x810a('0x38')][_0x810a('0x64')]({'where':{'id':_0x52570e[_0x810a('0x52')]['id']}})[_0x810a('0x33')](handleEntityNotFound(_0xc24c04,null))[_0x810a('0x33')](function(_0x225b92){if(_0x225b92){_0x100f97['model']=_[_0x810a('0x3b')](db[_0x810a('0x65')]['rawAttributes']);_0x100f97['query']=_['keys'](_0x52570e[_0x810a('0x3c')]);_0x100f97['filters']=_[_0x810a('0x3e')](_0x100f97[_0x810a('0x3a')],_0x100f97[_0x810a('0x3c')]);_0x1abbbf[_0x810a('0x40')]=_[_0x810a('0x3e')](_0x100f97['model'],qs[_0x810a('0x3f')](_0x52570e[_0x810a('0x3c')]['fields']));_0x1abbbf[_0x810a('0x40')]=_0x1abbbf[_0x810a('0x40')][_0x810a('0x41')]?_0x1abbbf['attributes']:_0x100f97[_0x810a('0x3a')];if(!_0x52570e[_0x810a('0x3c')][_0x810a('0x42')](_0x810a('0x43'))){_0x1abbbf[_0x810a('0x44')]=qs[_0x810a('0x44')](_0x52570e[_0x810a('0x3c')]['limit']);_0x1abbbf[_0x810a('0x1f')]=qs[_0x810a('0x1f')](_0x52570e['query'][_0x810a('0x1f')]);}_0x1abbbf['order']=qs[_0x810a('0x46')](_0x52570e[_0x810a('0x3c')][_0x810a('0x46')]);_0x1abbbf['where']=qs['filters'](_[_0x810a('0x48')](_0x52570e[_0x810a('0x3c')],_0x100f97[_0x810a('0x3d')]));_0x1abbbf[_0x810a('0x47')][_0x810a('0x66')]=_0x225b92['id'];if(_0x52570e[_0x810a('0x3c')][_0x810a('0x2b')]){_0x1abbbf[_0x810a('0x47')]=_[_0x810a('0x49')](_0x1abbbf['where'],{'$or':_[_0x810a('0x4a')](_0x1abbbf['attributes'],function(_0x1b8683){var _0x55a359={};_0x55a359[_0x1b8683]={'$like':'%'+_0x52570e[_0x810a('0x3c')][_0x810a('0x2b')]+'%'};return _0x55a359;})});}_0x1abbbf=_[_0x810a('0x49')]({},_0x1abbbf,_0x52570e[_0x810a('0x4d')]);return db[_0x810a('0x65')]['count']({'where':_0x1abbbf[_0x810a('0x47')]})[_0x810a('0x33')](function(_0x40d681){_0x46d72d[_0x810a('0x1e')]=_0x40d681;if(_0x52570e[_0x810a('0x3c')][_0x810a('0x4e')]){_0x1abbbf[_0x810a('0x4f')]=[{'all':!![]}];}return db[_0x810a('0x65')][_0x810a('0x50')](_0x1abbbf);})[_0x810a('0x33')](function(_0x14607c){_0x46d72d[_0x810a('0x51')]=_0x14607c;return _0x46d72d;});}})[_0x810a('0x33')](respondWithFilteredResult(_0xc24c04,_0x1abbbf))[_0x810a('0x53')](handleError(_0xc24c04,null));};exports[_0x810a('0x67')]=function(_0xe86fd9,_0x4c9828,_0x2c37b0){var _0x29de20={'raw':!![],'where':{}};var _0x47824c={};var _0x17f171={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x810a('0x64')]({'where':{'id':_0xe86fd9['params']['id']}})['then'](handleEntityNotFound(_0x4c9828,null))[_0x810a('0x33')](function(_0x470d8c){if(_0x470d8c){_0x47824c[_0x810a('0x3a')]=_[_0x810a('0x3b')](db[_0x810a('0x68')]['rawAttributes']);_0x47824c['query']=_[_0x810a('0x3b')](_0xe86fd9[_0x810a('0x3c')]);_0x47824c[_0x810a('0x3d')]=_[_0x810a('0x3e')](_0x47824c['model'],_0x47824c[_0x810a('0x3c')]);_0x29de20[_0x810a('0x40')]=_[_0x810a('0x3e')](_0x47824c[_0x810a('0x3a')],qs[_0x810a('0x3f')](_0xe86fd9[_0x810a('0x3c')][_0x810a('0x3f')]));_0x29de20[_0x810a('0x40')]=_0x29de20[_0x810a('0x40')]['length']?_0x29de20['attributes']:_0x47824c['model'];if(!_0xe86fd9[_0x810a('0x3c')][_0x810a('0x42')]('nolimit')){_0x29de20[_0x810a('0x44')]=qs[_0x810a('0x44')](_0xe86fd9[_0x810a('0x3c')][_0x810a('0x44')]);_0x29de20[_0x810a('0x1f')]=qs['offset'](_0xe86fd9[_0x810a('0x3c')]['offset']);}_0x29de20[_0x810a('0x45')]=qs[_0x810a('0x46')](_0xe86fd9[_0x810a('0x3c')][_0x810a('0x46')]);_0x29de20[_0x810a('0x47')]=qs[_0x810a('0x3d')](_[_0x810a('0x48')](_0xe86fd9[_0x810a('0x3c')],_0x47824c[_0x810a('0x3d')]));_0x29de20[_0x810a('0x47')]['VoiceQueueId']=_0x470d8c['id'];if(_0xe86fd9[_0x810a('0x3c')][_0x810a('0x2b')]){_0x29de20[_0x810a('0x47')]=_[_0x810a('0x49')](_0x29de20[_0x810a('0x47')],{'$or':_[_0x810a('0x4a')](_0x29de20[_0x810a('0x40')],function(_0xc40b10){var _0x150caa={};_0x150caa[_0xc40b10]={'$like':'%'+_0xe86fd9['query'][_0x810a('0x2b')]+'%'};return _0x150caa;})});}_0x29de20=_[_0x810a('0x49')]({},_0x29de20,_0xe86fd9[_0x810a('0x4d')]);return db[_0x810a('0x68')]['count']({'where':_0x29de20['where']})[_0x810a('0x33')](function(_0x1cb829){_0x17f171['count']=_0x1cb829;if(_0xe86fd9[_0x810a('0x3c')][_0x810a('0x4e')]){_0x29de20[_0x810a('0x4f')]=[{'all':!![]}];}return db[_0x810a('0x68')][_0x810a('0x50')](_0x29de20);})[_0x810a('0x33')](function(_0x3d60b2){_0x17f171[_0x810a('0x51')]=_0x3d60b2;return _0x17f171;});}})['then'](respondWithFilteredResult(_0x4c9828,_0x29de20))['catch'](handleError(_0x4c9828,null));};exports[_0x810a('0x69')]=function(_0x17dd0c,_0x41209d,_0x1a29ad){var _0x4721e0={'raw':!![],'where':{}};var _0x18d78a={};var _0x119a39={'count':0x0,'rows':[]};return db[_0x810a('0x38')]['findOne']({'where':{'id':_0x17dd0c[_0x810a('0x52')]['id']}})['then'](handleEntityNotFound(_0x41209d,null))[_0x810a('0x33')](function(_0x222070){if(_0x222070){_0x18d78a[_0x810a('0x3a')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x18d78a['query']=_[_0x810a('0x3b')](_0x17dd0c[_0x810a('0x3c')]);_0x18d78a['filters']=_[_0x810a('0x3e')](_0x18d78a[_0x810a('0x3a')],_0x18d78a[_0x810a('0x3c')]);_0x4721e0[_0x810a('0x40')]=_[_0x810a('0x3e')](_0x18d78a[_0x810a('0x3a')],qs['fields'](_0x17dd0c[_0x810a('0x3c')][_0x810a('0x3f')]));_0x4721e0[_0x810a('0x40')]=_0x4721e0[_0x810a('0x40')][_0x810a('0x41')]?_0x4721e0[_0x810a('0x40')]:_0x18d78a[_0x810a('0x3a')];if(!_0x17dd0c[_0x810a('0x3c')]['hasOwnProperty'](_0x810a('0x43'))){_0x4721e0[_0x810a('0x44')]=qs[_0x810a('0x44')](_0x17dd0c['query']['limit']);_0x4721e0[_0x810a('0x1f')]=qs[_0x810a('0x1f')](_0x17dd0c[_0x810a('0x3c')][_0x810a('0x1f')]);}_0x4721e0[_0x810a('0x45')]=qs[_0x810a('0x46')](_0x17dd0c[_0x810a('0x3c')][_0x810a('0x46')]);_0x4721e0[_0x810a('0x47')]=qs['filters'](_[_0x810a('0x48')](_0x17dd0c[_0x810a('0x3c')],_0x18d78a[_0x810a('0x3d')]));_0x4721e0[_0x810a('0x47')][_0x810a('0x66')]=_0x222070['id'];if(_0x17dd0c['query'][_0x810a('0x2b')]){_0x4721e0[_0x810a('0x47')]=_[_0x810a('0x49')](_0x4721e0['where'],{'$or':_[_0x810a('0x4a')](_0x4721e0[_0x810a('0x40')],function(_0x294a1b){var _0x2e65b8={};_0x2e65b8[_0x294a1b]={'$like':'%'+_0x17dd0c[_0x810a('0x3c')][_0x810a('0x2b')]+'%'};return _0x2e65b8;})});}_0x4721e0=_[_0x810a('0x49')]({},_0x4721e0,_0x17dd0c[_0x810a('0x4d')]);return db[_0x810a('0x6a')][_0x810a('0x1e')]({'where':_0x4721e0['where']})[_0x810a('0x33')](function(_0x4f4fab){_0x119a39[_0x810a('0x1e')]=_0x4f4fab;if(_0x17dd0c[_0x810a('0x3c')][_0x810a('0x4e')]){_0x4721e0[_0x810a('0x4f')]=[{'all':!![]}];}return db[_0x810a('0x6a')][_0x810a('0x50')](_0x4721e0);})[_0x810a('0x33')](function(_0x2452da){_0x119a39[_0x810a('0x51')]=_0x2452da;return _0x119a39;});}})[_0x810a('0x33')](respondWithFilteredResult(_0x41209d,_0x4721e0))[_0x810a('0x53')](handleError(_0x41209d,null));};exports[_0x810a('0x6b')]=function(_0x37d249,_0x17285e,_0x300549){var _0x27361a={'raw':!![],'where':{}};var _0x117975={};var _0x4e66f8={'count':0x0,'rows':[]};return db[_0x810a('0x38')]['findOne']({'where':{'id':_0x37d249['params']['id']}})['then'](handleEntityNotFound(_0x17285e,null))[_0x810a('0x33')](function(_0x19ce69){if(_0x19ce69){_0x117975[_0x810a('0x3a')]=_[_0x810a('0x3b')](db[_0x810a('0x6c')][_0x810a('0x39')]);_0x117975[_0x810a('0x3c')]=_['keys'](_0x37d249['query']);_0x117975[_0x810a('0x3d')]=_[_0x810a('0x3e')](_0x117975[_0x810a('0x3a')],_0x117975[_0x810a('0x3c')]);_0x27361a[_0x810a('0x40')]=_[_0x810a('0x3e')](_0x117975[_0x810a('0x3a')],qs[_0x810a('0x3f')](_0x37d249[_0x810a('0x3c')][_0x810a('0x3f')]));_0x27361a[_0x810a('0x40')]=_0x27361a[_0x810a('0x40')][_0x810a('0x41')]?_0x27361a[_0x810a('0x40')]:_0x117975[_0x810a('0x3a')];if(!_0x37d249[_0x810a('0x3c')][_0x810a('0x42')]('nolimit')){_0x27361a[_0x810a('0x44')]=qs['limit'](_0x37d249[_0x810a('0x3c')]['limit']);_0x27361a[_0x810a('0x1f')]=qs['offset'](_0x37d249['query'][_0x810a('0x1f')]);}_0x27361a['order']=qs[_0x810a('0x46')](_0x37d249['query'][_0x810a('0x46')]);_0x27361a['where']=qs[_0x810a('0x3d')](_[_0x810a('0x48')](_0x37d249[_0x810a('0x3c')],_0x117975[_0x810a('0x3d')]));_0x27361a[_0x810a('0x47')]['VoiceQueueId']=_0x19ce69['id'];if(_0x37d249['query'][_0x810a('0x2b')]){_0x27361a[_0x810a('0x47')]=_[_0x810a('0x49')](_0x27361a[_0x810a('0x47')],{'$or':_['map'](_0x27361a[_0x810a('0x40')],function(_0x4b5761){var _0x4b7d23={};_0x4b7d23[_0x4b5761]={'$like':'%'+_0x37d249[_0x810a('0x3c')][_0x810a('0x2b')]+'%'};return _0x4b7d23;})});}_0x27361a=_[_0x810a('0x49')]({},_0x27361a,_0x37d249['options']);return db[_0x810a('0x6c')][_0x810a('0x1e')]({'where':_0x27361a[_0x810a('0x47')]})[_0x810a('0x33')](function(_0x55763d){_0x4e66f8[_0x810a('0x1e')]=_0x55763d;if(_0x37d249['query'][_0x810a('0x4e')]){_0x27361a[_0x810a('0x4f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x810a('0x50')](_0x27361a);})[_0x810a('0x33')](function(_0x5a5576){_0x4e66f8['rows']=_0x5a5576;return _0x4e66f8;});}})[_0x810a('0x33')](respondWithFilteredResult(_0x17285e,_0x27361a))[_0x810a('0x53')](handleError(_0x17285e,null));};exports[_0x810a('0x6d')]=function(_0x51215d,_0x252757,_0x27eea5){var _0x1eeac2={};var _0x4f9857={};var _0x2d6c19;var _0x39e809;return db[_0x810a('0x38')][_0x810a('0x64')]({'where':{'id':_0x51215d[_0x810a('0x52')]['id']}})[_0x810a('0x33')](handleEntityNotFound(_0x252757,null))[_0x810a('0x33')](function(_0x2f5c55){if(_0x2f5c55){_0x2d6c19=_0x2f5c55;_0x4f9857[_0x810a('0x3a')]=_['keys'](db[_0x810a('0x6e')]['rawAttributes']);_0x4f9857['query']=_[_0x810a('0x3b')](_0x51215d[_0x810a('0x3c')]);_0x4f9857[_0x810a('0x3d')]=_[_0x810a('0x3e')](_0x4f9857['model'],_0x4f9857['query']);_0x1eeac2['attributes']=_[_0x810a('0x3e')](_0x4f9857[_0x810a('0x3a')],qs[_0x810a('0x3f')](_0x51215d['query'][_0x810a('0x3f')]));_0x1eeac2[_0x810a('0x40')]=_0x1eeac2[_0x810a('0x40')][_0x810a('0x41')]?_0x1eeac2[_0x810a('0x40')]:_0x4f9857[_0x810a('0x3a')];_0x1eeac2[_0x810a('0x45')]=qs[_0x810a('0x46')](_0x51215d[_0x810a('0x3c')][_0x810a('0x46')]);_0x1eeac2[_0x810a('0x47')]=qs[_0x810a('0x3d')](_['pick'](_0x51215d[_0x810a('0x3c')],_0x4f9857[_0x810a('0x3d')]));if(_0x51215d[_0x810a('0x3c')]['filter']){_0x1eeac2[_0x810a('0x47')]=_['merge'](_0x1eeac2[_0x810a('0x47')],{'$or':_[_0x810a('0x4a')](_0x1eeac2['attributes'],function(_0x5c9ad1){var _0x2c8e05={};_0x2c8e05[_0x5c9ad1]={'$like':'%'+_0x51215d[_0x810a('0x3c')][_0x810a('0x2b')]+'%'};return _0x2c8e05;})});}_0x1eeac2=_[_0x810a('0x49')]({},_0x1eeac2,_0x51215d['options']);return _0x2d6c19[_0x810a('0x6d')](_0x1eeac2);}})[_0x810a('0x33')](function(_0x2942d2){if(_0x2942d2){_0x39e809=_0x2942d2[_0x810a('0x41')];if(!_0x51215d['query'][_0x810a('0x42')](_0x810a('0x43'))){_0x1eeac2['limit']=qs[_0x810a('0x44')](_0x51215d[_0x810a('0x3c')]['limit']);_0x1eeac2['offset']=qs['offset'](_0x51215d[_0x810a('0x3c')][_0x810a('0x1f')]);}return _0x2d6c19[_0x810a('0x6d')](_0x1eeac2);}})[_0x810a('0x33')](function(_0x35f651){if(_0x35f651){return _0x35f651?{'count':_0x39e809,'rows':_0x35f651}:null;}})[_0x810a('0x33')](respondWithResult(_0x252757,null))['catch'](handleError(_0x252757,null));};exports[_0x810a('0x6f')]=function(_0x5eba59,_0xaaf759,_0x286de6){var _0x1a316d=[];var _0x59fbbd;return db['Team']['findAll']({'where':{'id':_0x5eba59['body'][_0x810a('0x70')]},'attributes':['id'],'include':[{'model':db[_0x810a('0x71')],'as':_0x810a('0x72'),'attributes':['id'],'raw':!![]}]})[_0x810a('0x33')](function(_0x177af1){if(_0x177af1){for(var _0x5a2fba=0x0;_0x5a2fba<_0x177af1[_0x810a('0x41')];_0x5a2fba+=0x1){for(var _0x142a22=0x0;_0x142a22<_0x177af1[_0x5a2fba][_0x810a('0x72')][_0x810a('0x41')];_0x142a22+=0x1){_0x1a316d=_[_0x810a('0x73')](_0x1a316d,[_0x177af1[_0x5a2fba][_0x810a('0x72')][_0x142a22]['id']]);}}return _0x1a316d;}})[_0x810a('0x33')](function(_0xa1f2ad){if(_0xa1f2ad){return db[_0x810a('0x38')][_0x810a('0x30')]({'where':{'id':_0x5eba59[_0x810a('0x52')]['id']}});}})[_0x810a('0x33')](function(_0x24114d){if(_0x24114d){_0x59fbbd=_0x24114d;return _0x59fbbd['addAgents'](_0x1a316d,{'penalty':_0x5eba59['body'][_0x810a('0x74')]});}})[_0x810a('0x33')](function(_0x260480){if(_0x260480){return _0x59fbbd[_0x810a('0x6f')](_0x5eba59[_0x810a('0x55')][_0x810a('0x70')]);}})[_0x810a('0x33')](handleEntityNotFound(_0xaaf759,null))[_0x810a('0x33')](respondWithStatusCode(_0xaaf759,null))[_0x810a('0x53')](handleError(_0xaaf759,null));};exports[_0x810a('0x75')]=function(_0x1fc1a4,_0xffbc45,_0x3ab477){var _0x2c7227=[];var _0xc00404;return db[_0x810a('0x6e')][_0x810a('0x50')]({'where':{'id':_0x1fc1a4[_0x810a('0x3c')][_0x810a('0x70')]},'attributes':['id'],'include':[{'model':db[_0x810a('0x71')],'as':_0x810a('0x72'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x1cbace){if(_0x1cbace){for(var _0x20e382=0x0;_0x20e382<_0x1cbace[_0x810a('0x41')];_0x20e382+=0x1){for(var _0x24c160=0x0;_0x24c160<_0x1cbace[_0x20e382][_0x810a('0x72')]['length'];_0x24c160+=0x1){_0x2c7227=_[_0x810a('0x73')](_0x2c7227,[_0x1cbace[_0x20e382][_0x810a('0x72')][_0x24c160]['id']]);}}return _0x2c7227;}})[_0x810a('0x33')](function(_0x2a353b){if(_0x2a353b){return db[_0x810a('0x38')]['find']({'where':{'id':_0x1fc1a4[_0x810a('0x52')]['id']}});}})[_0x810a('0x33')](function(_0x555f37){if(_0x555f37){_0xc00404=_0x555f37;return _0xc00404[_0x810a('0x76')](_0x2c7227);}})[_0x810a('0x33')](function(_0x1f9fcd){if(_0xc00404){return _0xc00404['removeTeams'](_0x1fc1a4[_0x810a('0x3c')][_0x810a('0x70')]);}})[_0x810a('0x33')](handleEntityNotFound(_0xffbc45,null))[_0x810a('0x33')](respondWithStatusCode(_0xffbc45,null))[_0x810a('0x53')](handleError(_0xffbc45,null));};exports[_0x810a('0x77')]=function(_0x359d42,_0x451ec9,_0xe9ef53){var _0x291e8a,_0x11872b;return db[_0x810a('0x38')]['find']({'where':{'id':_0x359d42[_0x810a('0x52')]['id']}})[_0x810a('0x33')](handleEntityNotFound(_0x451ec9,null))['then'](function(_0x31001f){if(_0x31001f){_0x11872b=_0x31001f;return _0x31001f[_0x810a('0x77')](_0x359d42[_0x810a('0x55')]['ids'],_[_0x810a('0x5c')](_0x359d42[_0x810a('0x55')],['ids','id'])||{})[_0x810a('0x78')](function(_0x4cbb9c){for(var _0x2bd4ff=0x0;_0x2bd4ff<_0x359d42['body'][_0x810a('0x70')]['length'];_0x2bd4ff+=0x1){socket[_0x810a('0x79')](_0x810a('0x7a'),{'UserId':_0x359d42[_0x810a('0x55')][_0x810a('0x70')][_0x2bd4ff],'VoiceQueueId':_0x359d42[_0x810a('0x52')]['id']});}return _0x4cbb9c;});}})[_0x810a('0x33')](function(_0x144a61){_0x291e8a=_0x144a61||[];if(_0x11872b){return db['User'][_0x810a('0x50')]({'where':{'id':_0x359d42[_0x810a('0x55')]['ids']},'attributes':['id',_0x810a('0x57'),'loginInPause',_0x810a('0x7b'),_0x810a('0x7c')],'raw':!![]});}})['then'](function(_0x459353){if(_0x459353&&_0x459353[_0x810a('0x41')]){var _0x469f75=[];for(var _0xe213b5=0x0;_0xe213b5<_0x459353[_0x810a('0x41')];_0xe213b5++){_0x469f75[_0x810a('0x7d')](db[_0x810a('0x7e')][_0x810a('0x7f')]({'membername':_0x459353[_0xe213b5][_0x810a('0x57')],'UserId':_0x459353[_0xe213b5]['id'],'queue_name':_0x11872b[_0x810a('0x57')],'VoiceQueueId':_0x11872b['id'],'interface':_['isNil'](_0x459353[_0xe213b5]['interface'])?util[_0x810a('0x80')](_0x810a('0x81'),_0x459353[_0xe213b5][_0x810a('0x57')]):_0x459353[_0xe213b5][_0x810a('0x7c')],'paused':_0x459353[_0xe213b5][_0x810a('0x7b')]||![],'penalty':_0x359d42[_0x810a('0x55')][_0x810a('0x74')]||0x0}));}return BPromise[_0x810a('0x82')](_0x469f75);}})['then'](function(_0x492468){return _0x291e8a;})[_0x810a('0x33')](respondWithResult(_0x451ec9,null))[_0x810a('0x53')](handleError(_0x451ec9,null));};exports['removeAgents']=function(_0x2fb268,_0x2c055d,_0x3f148e){var _0x4c380e;return db['VoiceQueue'][_0x810a('0x30')]({'where':{'id':_0x2fb268[_0x810a('0x52')]['id']}})['then'](handleEntityNotFound(_0x2c055d,null))[_0x810a('0x33')](function(_0x5440de){if(_0x5440de){return _0x5440de[_0x810a('0x76')](_0x2fb268[_0x810a('0x3c')][_0x810a('0x70')])[_0x810a('0x33')](function(_0x53dc47){if(_[_0x810a('0x83')](_0x2fb268[_0x810a('0x3c')][_0x810a('0x70')])){for(var _0x19affc=0x0;_0x19affc<_0x2fb268[_0x810a('0x3c')]['ids'][_0x810a('0x41')];_0x19affc+=0x1){socket[_0x810a('0x79')]('userVoiceQueue:remove',{'UserId':_0x2fb268[_0x810a('0x3c')][_0x810a('0x70')][_0x19affc],'VoiceQueueId':_0x2fb268['params']['id']});}}else{socket[_0x810a('0x79')](_0x810a('0x84'),{'UserId':_0x2fb268[_0x810a('0x3c')][_0x810a('0x70')],'VoiceQueueId':_0x2fb268[_0x810a('0x52')]['id']});}});}})['then'](function(_0x5ae6fe){if(_0x2fb268['query'][_0x810a('0x85')]){_0x4c380e=_0x5ae6fe;return db[_0x810a('0x7e')][_0x810a('0x32')]({'where':{'VoiceQueueId':_0x2fb268[_0x810a('0x52')]['id'],'UserId':_0x2fb268[_0x810a('0x3c')][_0x810a('0x70')]}})[_0x810a('0x33')](function(){return _0x4c380e;});}})[_0x810a('0x33')](respondWithStatusCode(_0x2c055d,null))[_0x810a('0x53')](handleError(_0x2c055d,null));};exports[_0x810a('0x86')]=function(_0x22bf1e,_0x477e60,_0x440805){var _0x2921d3={};var _0x3b8055={};var _0x53e9ed;var _0x4e2442;return db[_0x810a('0x38')]['findOne']({'where':{'id':_0x22bf1e[_0x810a('0x52')]['id']}})[_0x810a('0x33')](handleEntityNotFound(_0x477e60,null))[_0x810a('0x33')](function(_0x58e43a){if(_0x58e43a){_0x53e9ed=_0x58e43a;_0x3b8055[_0x810a('0x3a')]=_[_0x810a('0x3b')](db[_0x810a('0x71')][_0x810a('0x39')]);_0x3b8055[_0x810a('0x3c')]=_[_0x810a('0x3b')](_0x22bf1e[_0x810a('0x3c')]);_0x3b8055[_0x810a('0x3d')]=_[_0x810a('0x3e')](_0x3b8055['model'],_0x3b8055[_0x810a('0x3c')]);_0x2921d3['attributes']=_[_0x810a('0x3e')](_0x3b8055[_0x810a('0x3a')],qs[_0x810a('0x3f')](_0x22bf1e['query']['fields']));_0x2921d3[_0x810a('0x40')]=_0x2921d3['attributes'][_0x810a('0x41')]?_0x2921d3[_0x810a('0x40')]:_0x3b8055[_0x810a('0x3a')];_0x2921d3[_0x810a('0x45')]=qs[_0x810a('0x46')](_0x22bf1e[_0x810a('0x3c')][_0x810a('0x46')]);_0x2921d3['where']=qs['filters'](_[_0x810a('0x48')](_0x22bf1e[_0x810a('0x3c')],_0x3b8055[_0x810a('0x3d')]));if(_0x22bf1e[_0x810a('0x3c')][_0x810a('0x2b')]){_0x2921d3['where']=_[_0x810a('0x49')](_0x2921d3['where'],{'$or':_[_0x810a('0x4a')](_0x2921d3[_0x810a('0x40')],function(_0x5c0a39){var _0x4938e3={};_0x4938e3[_0x5c0a39]={'$like':'%'+_0x22bf1e['query'][_0x810a('0x2b')]+'%'};return _0x4938e3;})});}_0x2921d3=_[_0x810a('0x49')]({},_0x2921d3,_0x22bf1e[_0x810a('0x4d')]);return _0x53e9ed[_0x810a('0x86')](_0x2921d3);}})[_0x810a('0x33')](function(_0x42ca15){if(_0x42ca15){_0x4e2442=_0x42ca15['length'];if(!_0x22bf1e['query'][_0x810a('0x42')](_0x810a('0x43'))){_0x2921d3[_0x810a('0x44')]=qs['limit'](_0x22bf1e['query'][_0x810a('0x44')]);_0x2921d3[_0x810a('0x1f')]=qs['offset'](_0x22bf1e[_0x810a('0x3c')][_0x810a('0x1f')]);}return _0x53e9ed['getAgents'](_0x2921d3);}})[_0x810a('0x33')](function(_0x5d715e){if(_0x5d715e){return _0x5d715e?{'count':_0x4e2442,'rows':_0x5d715e}:null;}})[_0x810a('0x33')](respondWithResult(_0x477e60,null))['catch'](handleError(_0x477e60,null));};exports[_0x810a('0x87')]=function(_0x1dc91d,_0x57e9a6,_0x50d672){var _0x350280={};var _0x4b7e29={};var _0x5779fa;var _0x246a5e;return db[_0x810a('0x38')][_0x810a('0x64')]({'where':{'id':_0x1dc91d[_0x810a('0x52')]['id']}})[_0x810a('0x33')](handleEntityNotFound(_0x57e9a6,null))[_0x810a('0x33')](function(_0x3aec9f){if(_0x3aec9f){_0x5779fa=_0x3aec9f;_0x4b7e29[_0x810a('0x3a')]=_[_0x810a('0x3b')](db[_0x810a('0x7e')][_0x810a('0x39')]);_0x4b7e29[_0x810a('0x3c')]=_[_0x810a('0x3b')](_0x1dc91d[_0x810a('0x3c')]);_0x4b7e29[_0x810a('0x3d')]=_[_0x810a('0x3e')](_0x4b7e29[_0x810a('0x3a')],_0x4b7e29['query']);_0x350280[_0x810a('0x40')]=_[_0x810a('0x3e')](_0x4b7e29[_0x810a('0x3a')],qs[_0x810a('0x3f')](_0x1dc91d[_0x810a('0x3c')][_0x810a('0x3f')]));_0x350280[_0x810a('0x40')]=_0x350280[_0x810a('0x40')][_0x810a('0x41')]?_0x350280[_0x810a('0x40')]:_0x4b7e29['model'];_0x350280[_0x810a('0x45')]=qs['sort'](_0x1dc91d[_0x810a('0x3c')][_0x810a('0x46')]);_0x350280[_0x810a('0x47')]=qs[_0x810a('0x3d')](_[_0x810a('0x48')](_0x1dc91d['query'],_0x4b7e29[_0x810a('0x3d')]));if(_0x1dc91d[_0x810a('0x3c')][_0x810a('0x2b')]){_0x350280[_0x810a('0x47')]=_['merge'](_0x350280[_0x810a('0x47')],{'$or':_['map'](_0x350280[_0x810a('0x40')],function(_0x3ef8da){var _0xba0e74={};_0xba0e74[_0x3ef8da]={'$like':'%'+_0x1dc91d[_0x810a('0x3c')][_0x810a('0x2b')]+'%'};return _0xba0e74;})});}_0x350280=_['merge']({},_0x350280,_0x1dc91d[_0x810a('0x4d')]);return _0x5779fa[_0x810a('0x87')](_0x350280);}})['then'](function(_0x2abda2){if(_0x2abda2){_0x246a5e=_0x2abda2[_0x810a('0x41')];if(!_0x1dc91d[_0x810a('0x3c')][_0x810a('0x42')](_0x810a('0x43'))){_0x350280['limit']=qs[_0x810a('0x44')](_0x1dc91d[_0x810a('0x3c')]['limit']);_0x350280[_0x810a('0x1f')]=qs[_0x810a('0x1f')](_0x1dc91d[_0x810a('0x3c')]['offset']);}return _0x5779fa[_0x810a('0x87')](_0x350280);}})[_0x810a('0x33')](function(_0x153381){return _0x153381?{'count':_0x246a5e,'rows':_0x153381}:null;})[_0x810a('0x33')](respondWithResult(_0x57e9a6,null))[_0x810a('0x53')](handleError(_0x57e9a6,null));};exports[_0x810a('0x88')]=function(_0x5a47c7,_0x3f3ba0,_0x57d3ff){var _0x1982d0={};var _0xd225c8={};var _0x557509;var _0x27463d;return db[_0x810a('0x38')][_0x810a('0x64')]({'where':{'id':_0x5a47c7[_0x810a('0x52')]['id']}})['then'](handleEntityNotFound(_0x3f3ba0,null))[_0x810a('0x33')](function(_0x1324ae){if(_0x1324ae){_0x557509=_0x1324ae;_0xd225c8[_0x810a('0x3a')]=_[_0x810a('0x3b')](db[_0x810a('0x89')][_0x810a('0x39')]);_0xd225c8['query']=_[_0x810a('0x3b')](_0x5a47c7[_0x810a('0x3c')]);_0xd225c8[_0x810a('0x3d')]=_[_0x810a('0x3e')](_0xd225c8[_0x810a('0x3a')],_0xd225c8[_0x810a('0x3c')]);_0x1982d0['attributes']=_['intersection'](_0xd225c8['model'],qs[_0x810a('0x3f')](_0x5a47c7[_0x810a('0x3c')][_0x810a('0x3f')]));_0x1982d0[_0x810a('0x40')]=_0x1982d0[_0x810a('0x40')][_0x810a('0x41')]?_0x1982d0['attributes']:_0xd225c8[_0x810a('0x3a')];_0x1982d0['order']=qs[_0x810a('0x46')](_0x5a47c7[_0x810a('0x3c')][_0x810a('0x46')]);_0x1982d0['where']=qs['filters'](_[_0x810a('0x48')](_0x5a47c7[_0x810a('0x3c')],_0xd225c8['filters']));if(_0x5a47c7[_0x810a('0x3c')][_0x810a('0x2b')]){_0x1982d0[_0x810a('0x47')]=_[_0x810a('0x49')](_0x1982d0[_0x810a('0x47')],{'$or':_[_0x810a('0x4a')](_0x1982d0[_0x810a('0x40')],function(_0x1229fc){var _0x3a15be={};_0x3a15be[_0x1229fc]={'$like':'%'+_0x5a47c7['query']['filter']+'%'};return _0x3a15be;})});}_0x1982d0=_[_0x810a('0x49')]({},_0x1982d0,_0x5a47c7[_0x810a('0x4d')]);return _0x557509[_0x810a('0x88')](_0x1982d0);}})[_0x810a('0x33')](function(_0x1b5c34){if(_0x1b5c34){_0x27463d=_0x1b5c34[_0x810a('0x41')];if(!_0x5a47c7['query'][_0x810a('0x42')](_0x810a('0x43'))){_0x1982d0[_0x810a('0x44')]=qs[_0x810a('0x44')](_0x5a47c7[_0x810a('0x3c')]['limit']);_0x1982d0[_0x810a('0x1f')]=qs[_0x810a('0x1f')](_0x5a47c7['query'][_0x810a('0x1f')]);}return _0x557509[_0x810a('0x88')](_0x1982d0);}})[_0x810a('0x33')](function(_0x54a080){if(_0x54a080){return _0x54a080?{'count':_0x27463d,'rows':_0x54a080}:null;}})[_0x810a('0x33')](respondWithResult(_0x3f3ba0,null))[_0x810a('0x53')](handleError(_0x3f3ba0,null));};exports['addLists']=function(_0x24fd75,_0x297d8b,_0xcd7f7c){var _0x1f49a0,_0x5a6d95;return db[_0x810a('0x38')]['find']({'where':{'id':_0x24fd75[_0x810a('0x52')]['id']}})[_0x810a('0x33')](handleEntityNotFound(_0x297d8b,null))[_0x810a('0x33')](function(_0x43534a){if(_0x43534a){_0x5a6d95=_0x43534a;return _0x43534a[_0x810a('0x8a')](_0x24fd75[_0x810a('0x55')][_0x810a('0x70')],_[_0x810a('0x5c')](_0x24fd75['body'],[_0x810a('0x70'),'id'])||{});}return null;})[_0x810a('0x78')](function(_0x209cdb){var _0x55deb0;_0x1f49a0=_0x209cdb||[];var _0x5d8cc4=[];if(_0x209cdb){for(var _0x12f0a2=0x0;_0x12f0a2<_0x209cdb[_0x810a('0x41')];_0x12f0a2+=0x1){var _0x29fce2=_0x209cdb[_0x12f0a2][_0x810a('0x26')]({'plain':!![]});_0x5a6d95[_0x810a('0x8b')]=_0x24fd75[_0x810a('0x55')][_0x810a('0x8b')]?_0x24fd75[_0x810a('0x55')][_0x810a('0x8b')]:_0x5a6d95['dialCheckDuplicateType'];switch(_0x5a6d95[_0x810a('0x8b')]){case'always':_0x55deb0=squel['insert']()[_0x810a('0x8c')](_0x810a('0x8d'))[_0x810a('0x8e')]([_0x810a('0x8f'),_0x810a('0x90'),_0x810a('0x91'),_0x810a('0x92'),_0x810a('0x66'),_0x810a('0x5e'),'updatedAt'],squel[_0x810a('0x93')]()['field'](_0x810a('0x8f'),_0x810a('0x8f'))['field'](_0x810a('0x94'),_0x810a('0x90'))[_0x810a('0x95')]('id','ContactId')[_0x810a('0x95')](_0x29fce2['CmListId'][_0x810a('0x96')](),_0x810a('0x92'))[_0x810a('0x95')](_0x24fd75[_0x810a('0x52')]['id'][_0x810a('0x96')](),_0x810a('0x66'))[_0x810a('0x95')](_0x810a('0x94'),_0x810a('0x5e'))[_0x810a('0x95')](_0x810a('0x94'),_0x810a('0x5d'))['from'](_0x810a('0x97'))[_0x810a('0x47')]('deletedAt\x20IS\x20NULL')[_0x810a('0x47')]('ListId\x20=\x20?',_0x29fce2[_0x810a('0x98')][_0x810a('0x96')]())[_0x810a('0x47')](_0x810a('0x99'))[_0x810a('0x47')](_0x810a('0x9a'),squel['select']()[_0x810a('0x95')](_0x810a('0x9b'))[_0x810a('0x9c')](_0x810a('0x9d'))[_0x810a('0x47')](_0x810a('0x9e'),_0x24fd75['params']['id'][_0x810a('0x96')]()))['where'](_0x810a('0x9a'),squel['select']()[_0x810a('0x95')](_0x810a('0x8f'))[_0x810a('0x9c')](_0x810a('0x8d'))[_0x810a('0x47')](_0x810a('0x9e'),_0x24fd75[_0x810a('0x52')]['id'][_0x810a('0x96')]())))[_0x810a('0x96')]();break;case'onlyIfOpen':_0x55deb0=squel[_0x810a('0x9f')]()[_0x810a('0x8c')](_0x810a('0x8d'))[_0x810a('0x8e')](['phone','scheduledAt',_0x810a('0x91'),_0x810a('0x92'),_0x810a('0x66'),'createdAt',_0x810a('0x5d')],squel[_0x810a('0x93')]()[_0x810a('0x95')](_0x810a('0x8f'),'phone')[_0x810a('0x95')](_0x810a('0x94'),'scheduledAt')['field']('id',_0x810a('0x91'))['field'](_0x29fce2[_0x810a('0x98')]['toString'](),_0x810a('0x92'))[_0x810a('0x95')](_0x24fd75['params']['id']['toString'](),_0x810a('0x66'))[_0x810a('0x95')]('NOW()','createdAt')[_0x810a('0x95')](_0x810a('0x94'),_0x810a('0x5d'))[_0x810a('0x9c')](_0x810a('0x97'))[_0x810a('0x47')](_0x810a('0xa0'))['where'](_0x810a('0xa1'),_0x29fce2[_0x810a('0x98')][_0x810a('0x96')]())[_0x810a('0x47')](_0x810a('0x99'))[_0x810a('0x47')](_0x810a('0x9a'),squel[_0x810a('0x93')]()[_0x810a('0x95')]('phone')['from'](_0x810a('0x8d'))['where'](_0x810a('0x9e'),_0x24fd75[_0x810a('0x52')]['id'][_0x810a('0x96')]())))[_0x810a('0x96')]();break;default:_0x55deb0=squel[_0x810a('0x9f')]()['into']('cm_hopper')[_0x810a('0x8e')]([_0x810a('0x8f'),_0x810a('0x90'),_0x810a('0x91'),_0x810a('0x92'),_0x810a('0x66'),'createdAt',_0x810a('0x5d')],squel[_0x810a('0x93')]()[_0x810a('0x95')](_0x810a('0x8f'),'phone')[_0x810a('0x95')]('NOW()','scheduledAt')[_0x810a('0x95')]('id','ContactId')[_0x810a('0x95')](_0x29fce2['CmListId'][_0x810a('0x96')](),'ListId')[_0x810a('0x95')](_0x24fd75[_0x810a('0x52')]['id'][_0x810a('0x96')](),'VoiceQueueId')[_0x810a('0x95')]('NOW()',_0x810a('0x5e'))[_0x810a('0x95')](_0x810a('0x94'),'updatedAt')[_0x810a('0x9c')](_0x810a('0x97'))['where'](_0x810a('0xa0'))['where']('ListId\x20=\x20?',_0x29fce2[_0x810a('0x98')][_0x810a('0x96')]())[_0x810a('0x47')](_0x810a('0x99')))[_0x810a('0x96')]();}_0x5d8cc4[_0x810a('0x7d')](db['sequelize'][_0x810a('0x3c')](_0x55deb0));}return BPromise[_0x810a('0x82')](_0x5d8cc4);}})[_0x810a('0x33')](function(){return _0x1f49a0;})[_0x810a('0x33')](respondWithResult(_0x297d8b,null))[_0x810a('0x53')](handleError(_0x297d8b,null));};exports[_0x810a('0xa2')]=function(_0x5ed0c7,_0x33c719,_0x3c17b9){var _0x53c7b8;return db[_0x810a('0x38')][_0x810a('0x30')]({'where':{'id':_0x5ed0c7['params']['id']}})[_0x810a('0x33')](handleEntityNotFound(_0x33c719,null))['then'](function(_0x38d2d0){if(_0x38d2d0){return _0x38d2d0[_0x810a('0xa2')](_0x5ed0c7[_0x810a('0x3c')][_0x810a('0x70')]);}})[_0x810a('0x33')](function(_0x1db2c7){if(_0x1db2c7){_0x53c7b8=_0x1db2c7;return db[_0x810a('0x65')]['destroy']({'where':{'ListId':_0x5ed0c7[_0x810a('0x3c')]['ids'],'VoiceQueueId':_0x5ed0c7[_0x810a('0x52')]['id']}})[_0x810a('0x33')](function(){return _0x53c7b8;});}})[_0x810a('0x33')](respondWithStatusCode(_0x33c719,null))[_0x810a('0x53')](handleError(_0x33c719,null));};exports[_0x810a('0xa3')]=function(_0x555999,_0x133d4b,_0x111892){var _0x333df4={};var _0x123631={};var _0x451740;var _0x44634a;return db['VoiceQueue'][_0x810a('0x64')]({'where':{'id':_0x555999['params']['id']}})['then'](handleEntityNotFound(_0x133d4b,null))[_0x810a('0x33')](function(_0x88d712){if(_0x88d712){_0x451740=_0x88d712;_0x123631['model']=_[_0x810a('0x3b')](db[_0x810a('0x89')][_0x810a('0x39')]);_0x123631[_0x810a('0x3c')]=_['keys'](_0x555999[_0x810a('0x3c')]);_0x123631['filters']=_[_0x810a('0x3e')](_0x123631['model'],_0x123631[_0x810a('0x3c')]);_0x333df4[_0x810a('0x40')]=_['intersection'](_0x123631['model'],qs[_0x810a('0x3f')](_0x555999['query'][_0x810a('0x3f')]));_0x333df4[_0x810a('0x40')]=_0x333df4[_0x810a('0x40')]['length']?_0x333df4[_0x810a('0x40')]:_0x123631[_0x810a('0x3a')];_0x333df4[_0x810a('0x45')]=qs[_0x810a('0x46')](_0x555999[_0x810a('0x3c')][_0x810a('0x46')]);_0x333df4[_0x810a('0x47')]=qs['filters'](_[_0x810a('0x48')](_0x555999[_0x810a('0x3c')],_0x123631[_0x810a('0x3d')]));if(_0x555999['query'][_0x810a('0x2b')]){_0x333df4[_0x810a('0x47')]=_[_0x810a('0x49')](_0x333df4['where'],{'$or':_[_0x810a('0x4a')](_0x333df4[_0x810a('0x40')],function(_0x5b0a58){var _0x1b3ab1={};_0x1b3ab1[_0x5b0a58]={'$like':'%'+_0x555999['query'][_0x810a('0x2b')]+'%'};return _0x1b3ab1;})});}_0x333df4=_['merge']({},_0x333df4,_0x555999[_0x810a('0x4d')]);return _0x451740[_0x810a('0xa3')](_0x333df4);}})[_0x810a('0x33')](function(_0x2c1685){if(_0x2c1685){_0x44634a=_0x2c1685[_0x810a('0x41')];if(!_0x555999['query']['hasOwnProperty'](_0x810a('0x43'))){_0x333df4[_0x810a('0x44')]=qs[_0x810a('0x44')](_0x555999[_0x810a('0x3c')][_0x810a('0x44')]);_0x333df4[_0x810a('0x1f')]=qs[_0x810a('0x1f')](_0x555999['query']['offset']);}return _0x451740[_0x810a('0xa3')](_0x333df4);}})[_0x810a('0x33')](function(_0x46d5da){if(_0x46d5da){return _0x46d5da?{'count':_0x44634a,'rows':_0x46d5da}:null;}})['then'](respondWithResult(_0x133d4b,null))[_0x810a('0x53')](handleError(_0x133d4b,null));};exports[_0x810a('0xa4')]=function(_0x2c28d3,_0x475883,_0x72addd){var _0x501279,_0x111c9a;return db[_0x810a('0x38')][_0x810a('0x30')]({'where':{'id':_0x2c28d3[_0x810a('0x52')]['id']}})['then'](handleEntityNotFound(_0x475883,null))['then'](function(_0x2a6771){if(_0x2a6771){_0x111c9a=_0x2a6771;return _0x2a6771[_0x810a('0xa4')](_0x2c28d3[_0x810a('0x55')][_0x810a('0x70')],_[_0x810a('0x5c')](_0x2c28d3[_0x810a('0x55')],['ids','id'])||{});}return null;})['spread'](function(_0xc54559){var _0x517c47;_0x501279=_0xc54559||[];var _0x422bef=[];if(_0xc54559){for(var _0x3c42d5=0x0;_0x3c42d5<_0xc54559[_0x810a('0x41')];_0x3c42d5+=0x1){var _0x7d93e8=_0xc54559[_0x3c42d5][_0x810a('0x26')]({'plain':!![]});_0x517c47=squel[_0x810a('0x9f')]()[_0x810a('0x8c')](_0x810a('0xa5'))[_0x810a('0x8e')]([_0x810a('0x8f'),_0x810a('0x91'),_0x810a('0x92'),_0x810a('0x66'),'createdAt',_0x810a('0x5d')],squel['select']()[_0x810a('0x95')](_0x810a('0x8f'),_0x810a('0x8f'))[_0x810a('0x95')]('id',_0x810a('0x91'))[_0x810a('0x95')](_0x7d93e8['CmListId'][_0x810a('0x96')](),_0x810a('0x92'))[_0x810a('0x95')](_0x2c28d3[_0x810a('0x52')]['id'][_0x810a('0x96')](),_0x810a('0x66'))[_0x810a('0x95')]('NOW()',_0x810a('0x5e'))[_0x810a('0x95')](_0x810a('0x94'),_0x810a('0x5d'))[_0x810a('0x9c')](_0x810a('0x97'))[_0x810a('0x47')](_0x810a('0xa0'))['where'](_0x810a('0xa1'),_0x7d93e8[_0x810a('0x98')]['toString']())[_0x810a('0x47')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x422bef[_0x810a('0x7d')](db[_0x810a('0xa6')][_0x810a('0x3c')](_0x517c47));}return BPromise[_0x810a('0x82')](_0x422bef);}})[_0x810a('0x33')](function(){return _0x501279;})['then'](respondWithResult(_0x475883,null))[_0x810a('0x53')](handleError(_0x475883,null));};exports[_0x810a('0xa7')]=function(_0x50e35d,_0x1f20c5,_0x101f25){var _0x2f1cde;return db['VoiceQueue'][_0x810a('0x30')]({'where':{'id':_0x50e35d[_0x810a('0x52')]['id']}})[_0x810a('0x33')](handleEntityNotFound(_0x1f20c5,null))[_0x810a('0x33')](function(_0x4f032c){if(_0x4f032c){return _0x4f032c[_0x810a('0xa7')](_0x50e35d['query']['ids']);}})['then'](function(_0x3d43bb){if(_0x3d43bb){_0x2f1cde=_0x3d43bb;return db[_0x810a('0x6c')][_0x810a('0x32')]({'where':{'ListId':_0x50e35d[_0x810a('0x3c')][_0x810a('0x70')],'VoiceQueueId':_0x50e35d[_0x810a('0x52')]['id']}})[_0x810a('0x33')](function(){return _0x2f1cde;});}})['then'](respondWithStatusCode(_0x1f20c5,null))[_0x810a('0x53')](handleError(_0x1f20c5,null));}; \ No newline at end of file +var _0x8817=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','VoiceQueues','QueueCampaigns','filter','map','value','find','type','name','UserProfileResource','error','stack','send','index','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','filters','pick','merge','key','VIRTUAL','field','VoiceQueue','count','rows','catch','params','length','include','create','user','get','role','inbound','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','CmHopper','VoiceQueueId','options','findAll','getHopperHistories','order','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','User','Agents','union','addAgents','penalty','ids','removeTeams','removeAgents','spread','emit','userVoiceQueue:save','loginInPause','voicePause','interface','push','UserVoiceQueueRt','upsert','isNil','format','all','isArray','userVoiceQueue:remove','realtime','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','cm_hopper','fromQuery','scheduledAt','ListId','createdAt','phone','NOW()','ContactId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','select','calleridnum','phone\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','into','ListId\x20=\x20?','sequelize','removeLists','getBlackLists','addBlackLists','removeBlackLists','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x8817,0x1ee));var _0x7881=function(_0x5256bf,_0x4a0864){_0x5256bf=_0x5256bf-0x0;var _0x66410a=_0x8817[_0x5256bf];return _0x66410a;};'use strict';var pdf=require(_0x7881('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7881('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7881('0x2'));var rp=require(_0x7881('0x3'));var moment=require('moment');var BPromise=require(_0x7881('0x4'));var Mustache=require(_0x7881('0x5'));var util=require(_0x7881('0x6'));var path=require(_0x7881('0x7'));var sox=require(_0x7881('0x8'));var csv=require(_0x7881('0x9'));var ejs=require(_0x7881('0xa'));var fs=require('fs');var _=require(_0x7881('0xb'));var squel=require(_0x7881('0xc'));var crypto=require(_0x7881('0xd'));var jsforce=require(_0x7881('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7881('0x9'));var querystring=require(_0x7881('0xf'));var Papa=require(_0x7881('0x10'));var authService=require(_0x7881('0x11'));var hardwareService=require(_0x7881('0x12'));var Redis=require(_0x7881('0x13'));var qs=require(_0x7881('0x14'));var logger=require(_0x7881('0x15'))(_0x7881('0x16'));var utils=require('../../config/utils');var config=require(_0x7881('0x17'));var db=require(_0x7881('0x18'))['db'];config[_0x7881('0x19')]=_[_0x7881('0x1a')](config[_0x7881('0x19')],{'host':_0x7881('0x1b'),'port':0x18eb});var socket=require(_0x7881('0x1c'))(new Redis(config[_0x7881('0x19')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x259d17,_0xfe5668){_0xfe5668=_0xfe5668||0xcc;return function(_0x15a1c4){if(_0x15a1c4){return _0x259d17[_0x7881('0x1d')](_0xfe5668);}return _0x259d17[_0x7881('0x1e')](_0xfe5668)[_0x7881('0x1f')]();};}function respondWithResult(_0x177ccc,_0x1177dc){_0x1177dc=_0x1177dc||0xc8;return function(_0x46d860){if(_0x46d860){return _0x177ccc[_0x7881('0x1e')](_0x1177dc)[_0x7881('0x20')](_0x46d860);}};}function respondWithFilteredResult(_0x680e87,_0x129b8b){return function(_0x36644d){if(_0x36644d){var _0x29ca1b=_0x36644d['count'],_0x16073c=_0x129b8b[_0x7881('0x21')],_0xa276c3=_0x129b8b[_0x7881('0x21')]+_0x129b8b['limit'],_0x44f378;if(_0xa276c3>=_0x29ca1b){_0xa276c3=_0x29ca1b;_0x44f378=0xc8;}else{_0x44f378=0xce;}_0x680e87[_0x7881('0x1e')](_0x44f378);return _0x680e87[_0x7881('0x22')](_0x7881('0x23'),_0x16073c+'-'+_0xa276c3+'/'+_0x29ca1b)['json'](_0x36644d);}return null;};}function patchUpdates(_0x1c25bc){return function(_0x21acf4){try{jsonpatch[_0x7881('0x24')](_0x21acf4,_0x1c25bc,!![]);}catch(_0x42dd1){return BPromise[_0x7881('0x25')](_0x42dd1);}return _0x21acf4[_0x7881('0x26')]();};}function saveUpdates(_0x35fd30,_0x3ef50b){return function(_0xf2594f){if(_0xf2594f){return _0xf2594f[_0x7881('0x27')](_0x35fd30)[_0x7881('0x28')](function(_0x2173e3){return _0x2173e3;});}return null;};}function removeEntity(_0x4765af,_0x1a8d21){return function(_0x47a452){if(_0x47a452){return _0x47a452[_0x7881('0x29')]()['then'](function(){var _0x5e58e2=_0x47a452['get']({'plain':!![]});var _0x1a65b3=[{'name':_0x7881('0x2a'),'value':'inbound','ignore':![]},{'name':_0x7881('0x2b'),'value':'outbound','ignore':![]}];var _0x37289c=_(_0x1a65b3)[_0x7881('0x2c')]('ignore')[_0x7881('0x2d')](_0x7881('0x2e'))[_0x7881('0x2e')]();if(_['includes'](_0x37289c,_0x5e58e2['type'])){return;}var _0x51d59b=_[_0x7881('0x2f')](_0x1a65b3,[_0x7881('0x2e'),_0x5e58e2[_0x7881('0x30')]])[_0x7881('0x31')];return db[_0x7881('0x32')][_0x7881('0x29')]({'where':{'type':_0x51d59b,'resourceId':_0x5e58e2['id']}})[_0x7881('0x28')](function(){return _0x47a452;});})[_0x7881('0x28')](function(){_0x4765af['status'](0xcc)[_0x7881('0x1f')]();});}};}function handleEntityNotFound(_0x29a9e6,_0x732ced){return function(_0x4c2149){if(!_0x4c2149){_0x29a9e6['sendStatus'](0x194);}return _0x4c2149;};}function handleError(_0xb4c2dd,_0x2e74ce){_0x2e74ce=_0x2e74ce||0x1f4;return function(_0x110066){logger[_0x7881('0x33')](_0x110066[_0x7881('0x34')]);if(_0x110066[_0x7881('0x31')]){delete _0x110066[_0x7881('0x31')];}_0xb4c2dd[_0x7881('0x1e')](_0x2e74ce)[_0x7881('0x35')](_0x110066);};}exports[_0x7881('0x36')]=function(_0x5c7294,_0x253fa0){var _0x5f0139={},_0x2a87c1={},_0x2a1b59={'count':0x0,'rows':[]};var _0x3fa19a=db['VoiceQueue'][_0x7881('0x37')];_0x2a87c1[_0x7881('0x38')]=_[_0x7881('0x39')](_0x3fa19a);_0x2a87c1[_0x7881('0x3a')]=_[_0x7881('0x39')](_0x5c7294['query']);_0x2a87c1['filters']=_['intersection'](_0x2a87c1['model'],_0x2a87c1['query']);_0x5f0139['attributes']=_[_0x7881('0x3b')](_0x2a87c1[_0x7881('0x38')],qs['fields'](_0x5c7294[_0x7881('0x3a')][_0x7881('0x3c')]));_0x5f0139[_0x7881('0x3d')]=_0x5f0139['attributes']['length']?_0x5f0139['attributes']:_0x2a87c1[_0x7881('0x38')];if(!_0x5c7294[_0x7881('0x3a')][_0x7881('0x3e')](_0x7881('0x3f'))){_0x5f0139['limit']=qs[_0x7881('0x40')](_0x5c7294[_0x7881('0x3a')][_0x7881('0x40')]);_0x5f0139[_0x7881('0x21')]=qs['offset'](_0x5c7294['query'][_0x7881('0x21')]);}_0x5f0139['order']=qs[_0x7881('0x41')](_0x5c7294[_0x7881('0x3a')]['sort']);_0x5f0139[_0x7881('0x42')]=qs[_0x7881('0x43')](_[_0x7881('0x44')](_0x5c7294[_0x7881('0x3a')],_0x2a87c1['filters']));if(_0x5c7294[_0x7881('0x3a')]['filter']){_0x5f0139[_0x7881('0x42')]=_[_0x7881('0x45')](_0x5f0139[_0x7881('0x42')],{'$or':_['map'](_0x3fa19a,function(_0x3897b2){if(_0x3897b2['type'][_0x7881('0x46')]!==_0x7881('0x47')){var _0x43e190={};_0x43e190[_0x3897b2[_0x7881('0x48')]]={'$like':'%'+_0x5c7294['query'][_0x7881('0x2c')]+'%'};return _0x43e190;}})});}_0x5f0139=_['merge']({},_0x5f0139,_0x5c7294['options']);var _0x4f8f63={'where':_0x5f0139[_0x7881('0x42')]};return db[_0x7881('0x49')][_0x7881('0x4a')](_0x4f8f63)[_0x7881('0x28')](function(_0x344261){_0x2a1b59[_0x7881('0x4a')]=_0x344261;if(_0x5c7294[_0x7881('0x3a')]['includeAll']){_0x5f0139['include']=[{'all':!![]}];}return db[_0x7881('0x49')]['findAll'](_0x5f0139);})[_0x7881('0x28')](function(_0x519169){_0x2a1b59[_0x7881('0x4b')]=_0x519169;return _0x2a1b59;})['then'](respondWithFilteredResult(_0x253fa0,_0x5f0139))[_0x7881('0x4c')](handleError(_0x253fa0,null));};exports['show']=function(_0x3b1cfe,_0x4ce5e9){var _0x27a5d3={'raw':![],'where':{'id':_0x3b1cfe[_0x7881('0x4d')]['id']}},_0x553056={};_0x553056[_0x7881('0x38')]=_[_0x7881('0x39')](db[_0x7881('0x49')][_0x7881('0x37')]);_0x553056[_0x7881('0x3a')]=_['keys'](_0x3b1cfe['query']);_0x553056[_0x7881('0x43')]=_[_0x7881('0x3b')](_0x553056['model'],_0x553056['query']);_0x27a5d3[_0x7881('0x3d')]=_[_0x7881('0x3b')](_0x553056[_0x7881('0x38')],qs[_0x7881('0x3c')](_0x3b1cfe[_0x7881('0x3a')][_0x7881('0x3c')]));_0x27a5d3['attributes']=_0x27a5d3[_0x7881('0x3d')][_0x7881('0x4e')]?_0x27a5d3['attributes']:_0x553056[_0x7881('0x38')];if(_0x3b1cfe[_0x7881('0x3a')]['includeAll']){_0x27a5d3[_0x7881('0x4f')]=[{'all':!![]}];}_0x27a5d3=_[_0x7881('0x45')]({},_0x27a5d3,_0x3b1cfe['options']);return db[_0x7881('0x49')][_0x7881('0x2f')](_0x27a5d3)[_0x7881('0x28')](handleEntityNotFound(_0x4ce5e9,null))[_0x7881('0x28')](respondWithResult(_0x4ce5e9,null))[_0x7881('0x4c')](handleError(_0x4ce5e9,null));};exports[_0x7881('0x50')]=function(_0x4e6f82,_0x5ebd12){return db[_0x7881('0x49')][_0x7881('0x50')](_0x4e6f82['body'],{})[_0x7881('0x28')](function(_0x20ffc7){var _0x21c372=_0x4e6f82[_0x7881('0x51')][_0x7881('0x52')]({'plain':!![]});if(!_0x21c372)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21c372[_0x7881('0x53')]===_0x7881('0x51')){var _0x18b3f0=_0x20ffc7['get']({'plain':!![]});var _0x2a13fb=[{'name':_0x7881('0x2a'),'value':_0x7881('0x54')},{'name':_0x7881('0x2b'),'value':_0x7881('0x55')}];var _0x1dee58=_[_0x7881('0x2f')](_0x2a13fb,[_0x7881('0x2e'),_0x18b3f0[_0x7881('0x30')]])[_0x7881('0x31')];return db[_0x7881('0x56')][_0x7881('0x2f')]({'where':{'name':_0x1dee58,'userProfileId':_0x21c372[_0x7881('0x57')]},'raw':!![]})[_0x7881('0x28')](function(_0x199ef4){if(_0x199ef4&&_0x199ef4[_0x7881('0x58')]===0x0){return db[_0x7881('0x32')][_0x7881('0x50')]({'name':_0x18b3f0[_0x7881('0x31')],'resourceId':_0x18b3f0['id'],'type':_0x199ef4['name'],'sectionId':_0x199ef4['id']},{})[_0x7881('0x28')](function(){return _0x20ffc7;});}else{return _0x20ffc7;}})[_0x7881('0x4c')](function(_0x355268){logger[_0x7881('0x33')](_0x7881('0x59'),_0x355268);throw _0x355268;});}return _0x20ffc7;})[_0x7881('0x28')](respondWithResult(_0x5ebd12,0xc9))['catch'](handleError(_0x5ebd12,null));};exports[_0x7881('0x5a')]=function(_0x247edd,_0x574b61){var _0x26dc94={'raw':![],'where':{'id':_0x247edd[_0x7881('0x4d')]['id']}},_0x519cc3={};_0x519cc3['model']=_[_0x7881('0x39')](db[_0x7881('0x49')][_0x7881('0x37')]);_0x26dc94[_0x7881('0x3d')]=_[_0x7881('0x3b')](_0x519cc3[_0x7881('0x38')],qs[_0x7881('0x3c')](_0x247edd[_0x7881('0x3a')][_0x7881('0x3c')]));_0x26dc94['attributes']=_0x26dc94[_0x7881('0x3d')][_0x7881('0x4e')]?_0x26dc94[_0x7881('0x3d')]:_0x519cc3[_0x7881('0x38')];if(_0x247edd[_0x7881('0x3a')][_0x7881('0x5b')]){_0x26dc94[_0x7881('0x4f')]=[{'all':!![]}];}_0x26dc94=_[_0x7881('0x45')]({},_0x26dc94,_0x247edd['options']);return db[_0x7881('0x49')][_0x7881('0x2f')](_0x26dc94)[_0x7881('0x28')](handleEntityNotFound(_0x574b61,null))[_0x7881('0x28')](function(_0x579a1c){if(_0x579a1c){var _0x1b1017=_0x579a1c['get']({'plain':!![]});_0x1b1017=qs[_0x7881('0x5c')](_0x1b1017,['id','createdAt',_0x7881('0x5d')]);_0x247edd['body']=_[_0x7881('0x5c')](_0x247edd[_0x7881('0x5e')],['id','createdAt','updatedAt']);return db['VoiceQueue'][_0x7881('0x50')](_[_0x7881('0x45')](_0x1b1017,_0x247edd[_0x7881('0x5e')]),{'include':_0x247edd[_0x7881('0x3a')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x4a7565){var _0x105484=_0x247edd[_0x7881('0x51')][_0x7881('0x52')]({'plain':!![]});if(!_0x105484)throw new Error(_0x7881('0x5f'));if(_0x105484[_0x7881('0x53')]==='user'){var _0x3d8db0=_0x4a7565[_0x7881('0x52')]({'plain':!![]});var _0x52db05=[{'name':_0x7881('0x2a'),'value':_0x7881('0x54')},{'name':_0x7881('0x2b'),'value':_0x7881('0x55')}];var _0x5e9024=_[_0x7881('0x2f')](_0x52db05,[_0x7881('0x2e'),_0x3d8db0[_0x7881('0x30')]])[_0x7881('0x31')];return db[_0x7881('0x56')][_0x7881('0x2f')]({'where':{'name':_0x5e9024,'userProfileId':_0x105484[_0x7881('0x57')]},'raw':!![]})[_0x7881('0x28')](function(_0x42badb){if(_0x42badb&&_0x42badb[_0x7881('0x58')]===0x0){return db[_0x7881('0x32')][_0x7881('0x50')]({'name':_0x3d8db0[_0x7881('0x31')],'resourceId':_0x3d8db0['id'],'type':_0x42badb[_0x7881('0x31')],'sectionId':_0x42badb['id']},{})['then'](function(){return _0x4a7565;});}else{return _0x4a7565;}})['catch'](function(_0x1cac3e){logger[_0x7881('0x33')](_0x7881('0x59'),_0x1cac3e);throw _0x1cac3e;});}return _0x4a7565;});}})[_0x7881('0x28')](respondWithResult(_0x574b61,0xc9))[_0x7881('0x4c')](handleError(_0x574b61,null));};exports[_0x7881('0x27')]=function(_0x198dbd,_0x316a3a){if(_0x198dbd[_0x7881('0x5e')]['id']){delete _0x198dbd[_0x7881('0x5e')]['id'];}return db[_0x7881('0x49')][_0x7881('0x2f')]({'where':{'id':_0x198dbd['params']['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x316a3a,null))[_0x7881('0x28')](saveUpdates(_0x198dbd[_0x7881('0x5e')],null))[_0x7881('0x28')](respondWithResult(_0x316a3a,null))['catch'](handleError(_0x316a3a,null));};exports[_0x7881('0x29')]=function(_0x1e99ff,_0x17a0b6){return db[_0x7881('0x49')][_0x7881('0x2f')]({'where':{'id':_0x1e99ff[_0x7881('0x4d')]['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x17a0b6,null))[_0x7881('0x28')](removeEntity(_0x17a0b6,null))[_0x7881('0x4c')](handleError(_0x17a0b6,null));};exports[_0x7881('0x60')]=function(_0x5e7631,_0x2d9535,_0x1f9367){var _0x300a8c={'raw':![],'where':{}};var _0x3b0792={};var _0x4a23cc={'count':0x0,'rows':[]};return db[_0x7881('0x49')][_0x7881('0x61')]({'where':{'id':_0x5e7631[_0x7881('0x4d')]['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x2d9535,null))[_0x7881('0x28')](function(_0x24424e){if(_0x24424e){_0x3b0792[_0x7881('0x38')]=_[_0x7881('0x39')](db[_0x7881('0x62')][_0x7881('0x37')]);_0x3b0792[_0x7881('0x3a')]=_[_0x7881('0x39')](_0x5e7631['query']);_0x3b0792[_0x7881('0x43')]=_['intersection'](_0x3b0792['model'],_0x3b0792[_0x7881('0x3a')]);_0x300a8c[_0x7881('0x3d')]=_['intersection'](_0x3b0792[_0x7881('0x38')],qs['fields'](_0x5e7631[_0x7881('0x3a')][_0x7881('0x3c')]));_0x300a8c['attributes']=_0x300a8c[_0x7881('0x3d')][_0x7881('0x4e')]?_0x300a8c['attributes']:_0x3b0792[_0x7881('0x38')];if(!_0x5e7631[_0x7881('0x3a')][_0x7881('0x3e')](_0x7881('0x3f'))){_0x300a8c[_0x7881('0x40')]=qs[_0x7881('0x40')](_0x5e7631[_0x7881('0x3a')][_0x7881('0x40')]);_0x300a8c[_0x7881('0x21')]=qs[_0x7881('0x21')](_0x5e7631[_0x7881('0x3a')][_0x7881('0x21')]);}_0x300a8c['order']=qs[_0x7881('0x41')](_0x5e7631[_0x7881('0x3a')][_0x7881('0x41')]);_0x300a8c['where']=qs[_0x7881('0x43')](_[_0x7881('0x44')](_0x5e7631[_0x7881('0x3a')],_0x3b0792[_0x7881('0x43')]));_0x300a8c['where'][_0x7881('0x63')]=_0x24424e['id'];if(_0x5e7631[_0x7881('0x3a')][_0x7881('0x2c')]){_0x300a8c[_0x7881('0x42')]=_[_0x7881('0x45')](_0x300a8c[_0x7881('0x42')],{'$or':_['map'](_0x300a8c[_0x7881('0x3d')],function(_0x59324d){var _0x1f0387={};_0x1f0387[_0x59324d]={'$like':'%'+_0x5e7631[_0x7881('0x3a')][_0x7881('0x2c')]+'%'};return _0x1f0387;})});}_0x300a8c=_[_0x7881('0x45')]({},_0x300a8c,_0x5e7631[_0x7881('0x64')]);return db[_0x7881('0x62')][_0x7881('0x4a')]({'where':_0x300a8c[_0x7881('0x42')]})[_0x7881('0x28')](function(_0x46a633){_0x4a23cc['count']=_0x46a633;if(_0x5e7631[_0x7881('0x3a')]['includeAll']){_0x300a8c[_0x7881('0x4f')]=[{'all':!![]}];}return db['CmHopper'][_0x7881('0x65')](_0x300a8c);})[_0x7881('0x28')](function(_0x738776){_0x4a23cc[_0x7881('0x4b')]=_0x738776;return _0x4a23cc;});}})[_0x7881('0x28')](respondWithFilteredResult(_0x2d9535,_0x300a8c))[_0x7881('0x4c')](handleError(_0x2d9535,null));};exports[_0x7881('0x66')]=function(_0x3f95b8,_0x2b6c52,_0xa1a7be){var _0xbb032c={'raw':!![],'where':{}};var _0x40754b={};var _0x1aba82={'count':0x0,'rows':[]};return db[_0x7881('0x49')][_0x7881('0x61')]({'where':{'id':_0x3f95b8[_0x7881('0x4d')]['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x2b6c52,null))['then'](function(_0x335434){if(_0x335434){_0x40754b[_0x7881('0x38')]=_[_0x7881('0x39')](db['CmHopperHistory'][_0x7881('0x37')]);_0x40754b[_0x7881('0x3a')]=_[_0x7881('0x39')](_0x3f95b8[_0x7881('0x3a')]);_0x40754b[_0x7881('0x43')]=_[_0x7881('0x3b')](_0x40754b[_0x7881('0x38')],_0x40754b[_0x7881('0x3a')]);_0xbb032c['attributes']=_[_0x7881('0x3b')](_0x40754b['model'],qs[_0x7881('0x3c')](_0x3f95b8[_0x7881('0x3a')][_0x7881('0x3c')]));_0xbb032c[_0x7881('0x3d')]=_0xbb032c[_0x7881('0x3d')][_0x7881('0x4e')]?_0xbb032c['attributes']:_0x40754b[_0x7881('0x38')];if(!_0x3f95b8[_0x7881('0x3a')][_0x7881('0x3e')](_0x7881('0x3f'))){_0xbb032c[_0x7881('0x40')]=qs['limit'](_0x3f95b8['query'][_0x7881('0x40')]);_0xbb032c['offset']=qs['offset'](_0x3f95b8[_0x7881('0x3a')][_0x7881('0x21')]);}_0xbb032c[_0x7881('0x67')]=qs['sort'](_0x3f95b8[_0x7881('0x3a')][_0x7881('0x41')]);_0xbb032c[_0x7881('0x42')]=qs[_0x7881('0x43')](_[_0x7881('0x44')](_0x3f95b8['query'],_0x40754b['filters']));_0xbb032c[_0x7881('0x42')]['VoiceQueueId']=_0x335434['id'];if(_0x3f95b8[_0x7881('0x3a')][_0x7881('0x2c')]){_0xbb032c[_0x7881('0x42')]=_[_0x7881('0x45')](_0xbb032c['where'],{'$or':_[_0x7881('0x2d')](_0xbb032c[_0x7881('0x3d')],function(_0x11fd9a){var _0x317b20={};_0x317b20[_0x11fd9a]={'$like':'%'+_0x3f95b8[_0x7881('0x3a')]['filter']+'%'};return _0x317b20;})});}_0xbb032c=_[_0x7881('0x45')]({},_0xbb032c,_0x3f95b8[_0x7881('0x64')]);return db[_0x7881('0x68')]['count']({'where':_0xbb032c[_0x7881('0x42')]})[_0x7881('0x28')](function(_0x24b56b){_0x1aba82[_0x7881('0x4a')]=_0x24b56b;if(_0x3f95b8[_0x7881('0x3a')]['includeAll']){_0xbb032c['include']=[{'all':!![]}];}return db[_0x7881('0x68')][_0x7881('0x65')](_0xbb032c);})[_0x7881('0x28')](function(_0x4d426c){_0x1aba82[_0x7881('0x4b')]=_0x4d426c;return _0x1aba82;});}})['then'](respondWithFilteredResult(_0x2b6c52,_0xbb032c))['catch'](handleError(_0x2b6c52,null));};exports[_0x7881('0x69')]=function(_0x5cd78a,_0x12a6c6,_0x568c2a){var _0x14afc5={'raw':!![],'where':{}};var _0x2ed71b={};var _0x564dce={'count':0x0,'rows':[]};return db[_0x7881('0x49')][_0x7881('0x61')]({'where':{'id':_0x5cd78a[_0x7881('0x4d')]['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x12a6c6,null))[_0x7881('0x28')](function(_0x4d85a4){if(_0x4d85a4){_0x2ed71b['model']=_['keys'](db[_0x7881('0x6a')][_0x7881('0x37')]);_0x2ed71b['query']=_['keys'](_0x5cd78a['query']);_0x2ed71b[_0x7881('0x43')]=_[_0x7881('0x3b')](_0x2ed71b[_0x7881('0x38')],_0x2ed71b[_0x7881('0x3a')]);_0x14afc5[_0x7881('0x3d')]=_[_0x7881('0x3b')](_0x2ed71b['model'],qs[_0x7881('0x3c')](_0x5cd78a['query'][_0x7881('0x3c')]));_0x14afc5[_0x7881('0x3d')]=_0x14afc5[_0x7881('0x3d')][_0x7881('0x4e')]?_0x14afc5[_0x7881('0x3d')]:_0x2ed71b[_0x7881('0x38')];if(!_0x5cd78a['query'][_0x7881('0x3e')](_0x7881('0x3f'))){_0x14afc5[_0x7881('0x40')]=qs['limit'](_0x5cd78a[_0x7881('0x3a')][_0x7881('0x40')]);_0x14afc5[_0x7881('0x21')]=qs[_0x7881('0x21')](_0x5cd78a[_0x7881('0x3a')][_0x7881('0x21')]);}_0x14afc5[_0x7881('0x67')]=qs[_0x7881('0x41')](_0x5cd78a[_0x7881('0x3a')][_0x7881('0x41')]);_0x14afc5[_0x7881('0x42')]=qs[_0x7881('0x43')](_[_0x7881('0x44')](_0x5cd78a[_0x7881('0x3a')],_0x2ed71b[_0x7881('0x43')]));_0x14afc5[_0x7881('0x42')]['VoiceQueueId']=_0x4d85a4['id'];if(_0x5cd78a[_0x7881('0x3a')][_0x7881('0x2c')]){_0x14afc5['where']=_[_0x7881('0x45')](_0x14afc5[_0x7881('0x42')],{'$or':_['map'](_0x14afc5[_0x7881('0x3d')],function(_0x25638d){var _0x4ee293={};_0x4ee293[_0x25638d]={'$like':'%'+_0x5cd78a[_0x7881('0x3a')][_0x7881('0x2c')]+'%'};return _0x4ee293;})});}_0x14afc5=_['merge']({},_0x14afc5,_0x5cd78a[_0x7881('0x64')]);return db[_0x7881('0x6a')][_0x7881('0x4a')]({'where':_0x14afc5[_0x7881('0x42')]})[_0x7881('0x28')](function(_0x2c5896){_0x564dce[_0x7881('0x4a')]=_0x2c5896;if(_0x5cd78a[_0x7881('0x3a')][_0x7881('0x5b')]){_0x14afc5[_0x7881('0x4f')]=[{'all':!![]}];}return db[_0x7881('0x6a')][_0x7881('0x65')](_0x14afc5);})[_0x7881('0x28')](function(_0x32baa5){_0x564dce[_0x7881('0x4b')]=_0x32baa5;return _0x564dce;});}})['then'](respondWithFilteredResult(_0x12a6c6,_0x14afc5))[_0x7881('0x4c')](handleError(_0x12a6c6,null));};exports[_0x7881('0x6b')]=function(_0x53b4d5,_0x5efe04,_0x58254f){var _0xdfc050={'raw':!![],'where':{}};var _0x5c0ab5={};var _0x23ecb9={'count':0x0,'rows':[]};return db[_0x7881('0x49')][_0x7881('0x61')]({'where':{'id':_0x53b4d5[_0x7881('0x4d')]['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x5efe04,null))['then'](function(_0x3243ad){if(_0x3243ad){_0x5c0ab5[_0x7881('0x38')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x5c0ab5['query']=_['keys'](_0x53b4d5['query']);_0x5c0ab5[_0x7881('0x43')]=_['intersection'](_0x5c0ab5['model'],_0x5c0ab5[_0x7881('0x3a')]);_0xdfc050[_0x7881('0x3d')]=_['intersection'](_0x5c0ab5[_0x7881('0x38')],qs[_0x7881('0x3c')](_0x53b4d5[_0x7881('0x3a')][_0x7881('0x3c')]));_0xdfc050[_0x7881('0x3d')]=_0xdfc050[_0x7881('0x3d')]['length']?_0xdfc050[_0x7881('0x3d')]:_0x5c0ab5[_0x7881('0x38')];if(!_0x53b4d5[_0x7881('0x3a')][_0x7881('0x3e')](_0x7881('0x3f'))){_0xdfc050['limit']=qs['limit'](_0x53b4d5[_0x7881('0x3a')]['limit']);_0xdfc050[_0x7881('0x21')]=qs[_0x7881('0x21')](_0x53b4d5['query'][_0x7881('0x21')]);}_0xdfc050['order']=qs['sort'](_0x53b4d5[_0x7881('0x3a')][_0x7881('0x41')]);_0xdfc050[_0x7881('0x42')]=qs[_0x7881('0x43')](_[_0x7881('0x44')](_0x53b4d5[_0x7881('0x3a')],_0x5c0ab5['filters']));_0xdfc050[_0x7881('0x42')][_0x7881('0x63')]=_0x3243ad['id'];if(_0x53b4d5['query']['filter']){_0xdfc050['where']=_[_0x7881('0x45')](_0xdfc050[_0x7881('0x42')],{'$or':_[_0x7881('0x2d')](_0xdfc050[_0x7881('0x3d')],function(_0x48026e){var _0x13e950={};_0x13e950[_0x48026e]={'$like':'%'+_0x53b4d5['query'][_0x7881('0x2c')]+'%'};return _0x13e950;})});}_0xdfc050=_['merge']({},_0xdfc050,_0x53b4d5[_0x7881('0x64')]);return db[_0x7881('0x6c')][_0x7881('0x4a')]({'where':_0xdfc050[_0x7881('0x42')]})[_0x7881('0x28')](function(_0x220836){_0x23ecb9['count']=_0x220836;if(_0x53b4d5[_0x7881('0x3a')]['includeAll']){_0xdfc050[_0x7881('0x4f')]=[{'all':!![]}];}return db[_0x7881('0x6c')][_0x7881('0x65')](_0xdfc050);})[_0x7881('0x28')](function(_0x47fe0c){_0x23ecb9[_0x7881('0x4b')]=_0x47fe0c;return _0x23ecb9;});}})[_0x7881('0x28')](respondWithFilteredResult(_0x5efe04,_0xdfc050))['catch'](handleError(_0x5efe04,null));};exports['getTeams']=function(_0x1c7074,_0x144a87,_0x241a99){var _0x1fbfb5={};var _0x3eceb8={};var _0x34ca23;var _0xb7ba71;return db[_0x7881('0x49')][_0x7881('0x61')]({'where':{'id':_0x1c7074[_0x7881('0x4d')]['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x144a87,null))[_0x7881('0x28')](function(_0x52ebee){if(_0x52ebee){_0x34ca23=_0x52ebee;_0x3eceb8[_0x7881('0x38')]=_['keys'](db[_0x7881('0x6d')][_0x7881('0x37')]);_0x3eceb8[_0x7881('0x3a')]=_[_0x7881('0x39')](_0x1c7074[_0x7881('0x3a')]);_0x3eceb8[_0x7881('0x43')]=_[_0x7881('0x3b')](_0x3eceb8['model'],_0x3eceb8[_0x7881('0x3a')]);_0x1fbfb5['attributes']=_[_0x7881('0x3b')](_0x3eceb8[_0x7881('0x38')],qs[_0x7881('0x3c')](_0x1c7074[_0x7881('0x3a')]['fields']));_0x1fbfb5[_0x7881('0x3d')]=_0x1fbfb5[_0x7881('0x3d')]['length']?_0x1fbfb5['attributes']:_0x3eceb8[_0x7881('0x38')];_0x1fbfb5[_0x7881('0x67')]=qs[_0x7881('0x41')](_0x1c7074['query']['sort']);_0x1fbfb5[_0x7881('0x42')]=qs[_0x7881('0x43')](_[_0x7881('0x44')](_0x1c7074[_0x7881('0x3a')],_0x3eceb8[_0x7881('0x43')]));if(_0x1c7074[_0x7881('0x3a')][_0x7881('0x2c')]){_0x1fbfb5[_0x7881('0x42')]=_[_0x7881('0x45')](_0x1fbfb5['where'],{'$or':_[_0x7881('0x2d')](_0x1fbfb5['attributes'],function(_0x3ec4bd){var _0x314e6f={};_0x314e6f[_0x3ec4bd]={'$like':'%'+_0x1c7074['query']['filter']+'%'};return _0x314e6f;})});}_0x1fbfb5=_[_0x7881('0x45')]({},_0x1fbfb5,_0x1c7074['options']);return _0x34ca23[_0x7881('0x6e')](_0x1fbfb5);}})[_0x7881('0x28')](function(_0x25a9ec){if(_0x25a9ec){_0xb7ba71=_0x25a9ec[_0x7881('0x4e')];if(!_0x1c7074[_0x7881('0x3a')][_0x7881('0x3e')]('nolimit')){_0x1fbfb5[_0x7881('0x40')]=qs[_0x7881('0x40')](_0x1c7074[_0x7881('0x3a')][_0x7881('0x40')]);_0x1fbfb5[_0x7881('0x21')]=qs['offset'](_0x1c7074[_0x7881('0x3a')]['offset']);}return _0x34ca23[_0x7881('0x6e')](_0x1fbfb5);}})[_0x7881('0x28')](function(_0x431c08){if(_0x431c08){return _0x431c08?{'count':_0xb7ba71,'rows':_0x431c08}:null;}})[_0x7881('0x28')](respondWithResult(_0x144a87,null))[_0x7881('0x4c')](handleError(_0x144a87,null));};exports[_0x7881('0x6f')]=function(_0x5e1227,_0x11203f,_0x924b3b){var _0x5bfea2=[];var _0x4fc8ae;return db[_0x7881('0x6d')][_0x7881('0x65')]({'where':{'id':_0x5e1227[_0x7881('0x5e')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7881('0x70')],'as':_0x7881('0x71'),'attributes':['id'],'raw':!![]}]})[_0x7881('0x28')](function(_0x19a0d0){if(_0x19a0d0){for(var _0x6930e7=0x0;_0x6930e7<_0x19a0d0[_0x7881('0x4e')];_0x6930e7+=0x1){for(var _0x5a7f99=0x0;_0x5a7f99<_0x19a0d0[_0x6930e7][_0x7881('0x71')][_0x7881('0x4e')];_0x5a7f99+=0x1){_0x5bfea2=_[_0x7881('0x72')](_0x5bfea2,[_0x19a0d0[_0x6930e7][_0x7881('0x71')][_0x5a7f99]['id']]);}}return _0x5bfea2;}})[_0x7881('0x28')](function(_0x4ffe8a){if(_0x4ffe8a){return db['VoiceQueue'][_0x7881('0x2f')]({'where':{'id':_0x5e1227[_0x7881('0x4d')]['id']}});}})['then'](function(_0x58a464){if(_0x58a464){_0x4fc8ae=_0x58a464;return _0x4fc8ae[_0x7881('0x73')](_0x5bfea2,{'penalty':_0x5e1227[_0x7881('0x5e')][_0x7881('0x74')]});}})[_0x7881('0x28')](function(_0x4c598b){if(_0x4c598b){return _0x4fc8ae[_0x7881('0x6f')](_0x5e1227[_0x7881('0x5e')][_0x7881('0x75')]);}})[_0x7881('0x28')](handleEntityNotFound(_0x11203f,null))[_0x7881('0x28')](respondWithStatusCode(_0x11203f,null))[_0x7881('0x4c')](handleError(_0x11203f,null));};exports[_0x7881('0x76')]=function(_0x8f25f1,_0x2e22a5,_0x599f57){var _0x417597=[];var _0x182fbd;return db[_0x7881('0x6d')]['findAll']({'where':{'id':_0x8f25f1[_0x7881('0x3a')][_0x7881('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7881('0x71'),'attributes':['id'],'raw':!![]}]})[_0x7881('0x28')](function(_0x35bb62){if(_0x35bb62){for(var _0x4b23c3=0x0;_0x4b23c3<_0x35bb62[_0x7881('0x4e')];_0x4b23c3+=0x1){for(var _0x559f92=0x0;_0x559f92<_0x35bb62[_0x4b23c3][_0x7881('0x71')][_0x7881('0x4e')];_0x559f92+=0x1){_0x417597=_[_0x7881('0x72')](_0x417597,[_0x35bb62[_0x4b23c3][_0x7881('0x71')][_0x559f92]['id']]);}}return _0x417597;}})['then'](function(_0x734f5a){if(_0x734f5a){return db[_0x7881('0x49')][_0x7881('0x2f')]({'where':{'id':_0x8f25f1['params']['id']}});}})[_0x7881('0x28')](function(_0x521f1a){if(_0x521f1a){_0x182fbd=_0x521f1a;return _0x182fbd[_0x7881('0x77')](_0x417597);}})[_0x7881('0x28')](function(_0x30c20e){if(_0x182fbd){return _0x182fbd[_0x7881('0x76')](_0x8f25f1[_0x7881('0x3a')]['ids']);}})[_0x7881('0x28')](handleEntityNotFound(_0x2e22a5,null))[_0x7881('0x28')](respondWithStatusCode(_0x2e22a5,null))[_0x7881('0x4c')](handleError(_0x2e22a5,null));};exports['addAgents']=function(_0x23260e,_0x44748e,_0x1c9466){var _0x2c6d61,_0x5dc796;return db[_0x7881('0x49')][_0x7881('0x2f')]({'where':{'id':_0x23260e[_0x7881('0x4d')]['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x44748e,null))['then'](function(_0x121956){if(_0x121956){_0x5dc796=_0x121956;return _0x121956[_0x7881('0x73')](_0x23260e[_0x7881('0x5e')][_0x7881('0x75')],_[_0x7881('0x5c')](_0x23260e['body'],[_0x7881('0x75'),'id'])||{})[_0x7881('0x78')](function(_0x4c7e8d){for(var _0x38067f=0x0;_0x38067f<_0x23260e[_0x7881('0x5e')]['ids'][_0x7881('0x4e')];_0x38067f+=0x1){socket[_0x7881('0x79')](_0x7881('0x7a'),{'UserId':_0x23260e['body']['ids'][_0x38067f],'VoiceQueueId':_0x23260e[_0x7881('0x4d')]['id']});}return _0x4c7e8d;});}})[_0x7881('0x28')](function(_0x15377d){_0x2c6d61=_0x15377d||[];if(_0x5dc796){return db['User'][_0x7881('0x65')]({'where':{'id':_0x23260e[_0x7881('0x5e')][_0x7881('0x75')]},'attributes':['id',_0x7881('0x31'),_0x7881('0x7b'),_0x7881('0x7c'),_0x7881('0x7d')],'raw':!![]});}})[_0x7881('0x28')](function(_0x17daeb){if(_0x17daeb&&_0x17daeb['length']){var _0x217f28=[];for(var _0x11f47a=0x0;_0x11f47a<_0x17daeb[_0x7881('0x4e')];_0x11f47a++){_0x217f28[_0x7881('0x7e')](db[_0x7881('0x7f')][_0x7881('0x80')]({'membername':_0x17daeb[_0x11f47a][_0x7881('0x31')],'UserId':_0x17daeb[_0x11f47a]['id'],'queue_name':_0x5dc796[_0x7881('0x31')],'VoiceQueueId':_0x5dc796['id'],'interface':_[_0x7881('0x81')](_0x17daeb[_0x11f47a]['interface'])?util[_0x7881('0x82')]('SIP/%s',_0x17daeb[_0x11f47a]['name']):_0x17daeb[_0x11f47a][_0x7881('0x7d')],'paused':_0x17daeb[_0x11f47a][_0x7881('0x7c')]||![],'penalty':_0x23260e[_0x7881('0x5e')][_0x7881('0x74')]||0x0}));}return BPromise[_0x7881('0x83')](_0x217f28);}})['then'](function(_0x5c02c5){return _0x2c6d61;})[_0x7881('0x28')](respondWithResult(_0x44748e,null))['catch'](handleError(_0x44748e,null));};exports['removeAgents']=function(_0x1911f7,_0x2f9c9f,_0x5dffc6){var _0x3f62c1;return db[_0x7881('0x49')]['find']({'where':{'id':_0x1911f7['params']['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x2f9c9f,null))[_0x7881('0x28')](function(_0x5ed0bd){if(_0x5ed0bd){return _0x5ed0bd[_0x7881('0x77')](_0x1911f7[_0x7881('0x3a')]['ids'])[_0x7881('0x28')](function(_0x3871de){if(_[_0x7881('0x84')](_0x1911f7[_0x7881('0x3a')][_0x7881('0x75')])){for(var _0x4ad6aa=0x0;_0x4ad6aa<_0x1911f7[_0x7881('0x3a')]['ids'][_0x7881('0x4e')];_0x4ad6aa+=0x1){socket[_0x7881('0x79')]('userVoiceQueue:remove',{'UserId':_0x1911f7['query'][_0x7881('0x75')][_0x4ad6aa],'VoiceQueueId':_0x1911f7[_0x7881('0x4d')]['id']});}}else{socket[_0x7881('0x79')](_0x7881('0x85'),{'UserId':_0x1911f7[_0x7881('0x3a')][_0x7881('0x75')],'VoiceQueueId':_0x1911f7[_0x7881('0x4d')]['id']});}});}})[_0x7881('0x28')](function(_0x37e979){if(_0x1911f7[_0x7881('0x3a')][_0x7881('0x86')]){_0x3f62c1=_0x37e979;return db[_0x7881('0x7f')][_0x7881('0x29')]({'where':{'VoiceQueueId':_0x1911f7[_0x7881('0x4d')]['id'],'UserId':_0x1911f7['query']['ids']}})['then'](function(){return _0x3f62c1;});}})[_0x7881('0x28')](respondWithStatusCode(_0x2f9c9f,null))[_0x7881('0x4c')](handleError(_0x2f9c9f,null));};exports['getAgents']=function(_0x2dbaf8,_0x3ed493,_0x3ecca1){var _0x54b03a={};var _0x290f7d={};var _0x25c69e;var _0x4d90b5;return db['VoiceQueue'][_0x7881('0x61')]({'where':{'id':_0x2dbaf8[_0x7881('0x4d')]['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x3ed493,null))['then'](function(_0x2e0e57){if(_0x2e0e57){_0x25c69e=_0x2e0e57;_0x290f7d[_0x7881('0x38')]=_[_0x7881('0x39')](db['User'][_0x7881('0x37')]);_0x290f7d[_0x7881('0x3a')]=_[_0x7881('0x39')](_0x2dbaf8[_0x7881('0x3a')]);_0x290f7d[_0x7881('0x43')]=_['intersection'](_0x290f7d[_0x7881('0x38')],_0x290f7d['query']);_0x54b03a[_0x7881('0x3d')]=_[_0x7881('0x3b')](_0x290f7d['model'],qs[_0x7881('0x3c')](_0x2dbaf8['query'][_0x7881('0x3c')]));_0x54b03a[_0x7881('0x3d')]=_0x54b03a[_0x7881('0x3d')][_0x7881('0x4e')]?_0x54b03a[_0x7881('0x3d')]:_0x290f7d[_0x7881('0x38')];_0x54b03a['order']=qs[_0x7881('0x41')](_0x2dbaf8[_0x7881('0x3a')]['sort']);_0x54b03a[_0x7881('0x42')]=qs[_0x7881('0x43')](_['pick'](_0x2dbaf8[_0x7881('0x3a')],_0x290f7d['filters']));if(_0x2dbaf8[_0x7881('0x3a')]['filter']){_0x54b03a['where']=_[_0x7881('0x45')](_0x54b03a['where'],{'$or':_[_0x7881('0x2d')](_0x54b03a[_0x7881('0x3d')],function(_0x517eac){var _0x2b86b6={};_0x2b86b6[_0x517eac]={'$like':'%'+_0x2dbaf8[_0x7881('0x3a')][_0x7881('0x2c')]+'%'};return _0x2b86b6;})});}_0x54b03a=_[_0x7881('0x45')]({},_0x54b03a,_0x2dbaf8[_0x7881('0x64')]);return _0x25c69e['getAgents'](_0x54b03a);}})[_0x7881('0x28')](function(_0x3a739f){if(_0x3a739f){_0x4d90b5=_0x3a739f[_0x7881('0x4e')];if(!_0x2dbaf8[_0x7881('0x3a')]['hasOwnProperty'](_0x7881('0x3f'))){_0x54b03a[_0x7881('0x40')]=qs[_0x7881('0x40')](_0x2dbaf8['query'][_0x7881('0x40')]);_0x54b03a[_0x7881('0x21')]=qs['offset'](_0x2dbaf8[_0x7881('0x3a')][_0x7881('0x21')]);}return _0x25c69e[_0x7881('0x87')](_0x54b03a);}})['then'](function(_0x529796){if(_0x529796){return _0x529796?{'count':_0x4d90b5,'rows':_0x529796}:null;}})[_0x7881('0x28')](respondWithResult(_0x3ed493,null))[_0x7881('0x4c')](handleError(_0x3ed493,null));};exports[_0x7881('0x88')]=function(_0x189652,_0x297775,_0x16beca){var _0x26d2fb={};var _0x68bf72={};var _0x27c67f;var _0x18067b;return db[_0x7881('0x49')][_0x7881('0x61')]({'where':{'id':_0x189652[_0x7881('0x4d')]['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x297775,null))[_0x7881('0x28')](function(_0x5c5a50){if(_0x5c5a50){_0x27c67f=_0x5c5a50;_0x68bf72[_0x7881('0x38')]=_[_0x7881('0x39')](db[_0x7881('0x7f')][_0x7881('0x37')]);_0x68bf72['query']=_['keys'](_0x189652['query']);_0x68bf72[_0x7881('0x43')]=_[_0x7881('0x3b')](_0x68bf72[_0x7881('0x38')],_0x68bf72[_0x7881('0x3a')]);_0x26d2fb[_0x7881('0x3d')]=_[_0x7881('0x3b')](_0x68bf72[_0x7881('0x38')],qs['fields'](_0x189652[_0x7881('0x3a')][_0x7881('0x3c')]));_0x26d2fb[_0x7881('0x3d')]=_0x26d2fb['attributes'][_0x7881('0x4e')]?_0x26d2fb[_0x7881('0x3d')]:_0x68bf72[_0x7881('0x38')];_0x26d2fb[_0x7881('0x67')]=qs[_0x7881('0x41')](_0x189652[_0x7881('0x3a')][_0x7881('0x41')]);_0x26d2fb['where']=qs[_0x7881('0x43')](_[_0x7881('0x44')](_0x189652[_0x7881('0x3a')],_0x68bf72[_0x7881('0x43')]));if(_0x189652[_0x7881('0x3a')][_0x7881('0x2c')]){_0x26d2fb[_0x7881('0x42')]=_[_0x7881('0x45')](_0x26d2fb[_0x7881('0x42')],{'$or':_[_0x7881('0x2d')](_0x26d2fb[_0x7881('0x3d')],function(_0xb6d857){var _0x54f241={};_0x54f241[_0xb6d857]={'$like':'%'+_0x189652[_0x7881('0x3a')]['filter']+'%'};return _0x54f241;})});}_0x26d2fb=_['merge']({},_0x26d2fb,_0x189652[_0x7881('0x64')]);return _0x27c67f[_0x7881('0x88')](_0x26d2fb);}})['then'](function(_0x93e935){if(_0x93e935){_0x18067b=_0x93e935[_0x7881('0x4e')];if(!_0x189652[_0x7881('0x3a')][_0x7881('0x3e')]('nolimit')){_0x26d2fb['limit']=qs['limit'](_0x189652[_0x7881('0x3a')]['limit']);_0x26d2fb[_0x7881('0x21')]=qs[_0x7881('0x21')](_0x189652[_0x7881('0x3a')][_0x7881('0x21')]);}return _0x27c67f['getMembers'](_0x26d2fb);}})[_0x7881('0x28')](function(_0x5196e9){return _0x5196e9?{'count':_0x18067b,'rows':_0x5196e9}:null;})[_0x7881('0x28')](respondWithResult(_0x297775,null))[_0x7881('0x4c')](handleError(_0x297775,null));};exports[_0x7881('0x89')]=function(_0x3fedee,_0x2b16d0,_0x196841){var _0x1cb804={};var _0x5d6c48={};var _0x24ba6d;var _0x534b08;return db['VoiceQueue']['findOne']({'where':{'id':_0x3fedee[_0x7881('0x4d')]['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x2b16d0,null))[_0x7881('0x28')](function(_0x610f7f){if(_0x610f7f){_0x24ba6d=_0x610f7f;_0x5d6c48[_0x7881('0x38')]=_['keys'](db[_0x7881('0x8a')]['rawAttributes']);_0x5d6c48['query']=_[_0x7881('0x39')](_0x3fedee[_0x7881('0x3a')]);_0x5d6c48['filters']=_['intersection'](_0x5d6c48[_0x7881('0x38')],_0x5d6c48['query']);_0x1cb804[_0x7881('0x3d')]=_[_0x7881('0x3b')](_0x5d6c48['model'],qs['fields'](_0x3fedee['query']['fields']));_0x1cb804['attributes']=_0x1cb804['attributes'][_0x7881('0x4e')]?_0x1cb804[_0x7881('0x3d')]:_0x5d6c48[_0x7881('0x38')];_0x1cb804['order']=qs[_0x7881('0x41')](_0x3fedee[_0x7881('0x3a')][_0x7881('0x41')]);_0x1cb804['where']=qs[_0x7881('0x43')](_[_0x7881('0x44')](_0x3fedee['query'],_0x5d6c48[_0x7881('0x43')]));if(_0x3fedee[_0x7881('0x3a')]['filter']){_0x1cb804[_0x7881('0x42')]=_[_0x7881('0x45')](_0x1cb804['where'],{'$or':_['map'](_0x1cb804[_0x7881('0x3d')],function(_0x268c77){var _0x35eccb={};_0x35eccb[_0x268c77]={'$like':'%'+_0x3fedee['query'][_0x7881('0x2c')]+'%'};return _0x35eccb;})});}_0x1cb804=_['merge']({},_0x1cb804,_0x3fedee[_0x7881('0x64')]);return _0x24ba6d['getLists'](_0x1cb804);}})[_0x7881('0x28')](function(_0x354a81){if(_0x354a81){_0x534b08=_0x354a81[_0x7881('0x4e')];if(!_0x3fedee[_0x7881('0x3a')][_0x7881('0x3e')]('nolimit')){_0x1cb804['limit']=qs['limit'](_0x3fedee['query'][_0x7881('0x40')]);_0x1cb804[_0x7881('0x21')]=qs[_0x7881('0x21')](_0x3fedee[_0x7881('0x3a')][_0x7881('0x21')]);}return _0x24ba6d[_0x7881('0x89')](_0x1cb804);}})['then'](function(_0x163071){if(_0x163071){return _0x163071?{'count':_0x534b08,'rows':_0x163071}:null;}})[_0x7881('0x28')](respondWithResult(_0x2b16d0,null))[_0x7881('0x4c')](handleError(_0x2b16d0,null));};exports[_0x7881('0x8b')]=function(_0x18751e,_0x2f0dd4,_0x3a23e3){var _0x4cf8e5,_0x3b3327;return db['VoiceQueue'][_0x7881('0x2f')]({'where':{'id':_0x18751e[_0x7881('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2f0dd4,null))[_0x7881('0x28')](function(_0x4b1b2f){if(_0x4b1b2f){_0x3b3327=_0x4b1b2f;return _0x4b1b2f[_0x7881('0x8b')](_0x18751e['body'][_0x7881('0x75')],_['omit'](_0x18751e[_0x7881('0x5e')],[_0x7881('0x75'),'id'])||{});}return null;})[_0x7881('0x78')](function(_0x37e594){var _0x3ae366;_0x4cf8e5=_0x37e594||[];var _0x253150=[];if(_0x37e594){for(var _0x4dbade=0x0;_0x4dbade<_0x37e594[_0x7881('0x4e')];_0x4dbade+=0x1){var _0x8917d6=_0x37e594[_0x4dbade][_0x7881('0x52')]({'plain':!![]});_0x3b3327[_0x7881('0x8c')]=_0x18751e[_0x7881('0x5e')][_0x7881('0x8c')]?_0x18751e[_0x7881('0x5e')][_0x7881('0x8c')]:_0x3b3327[_0x7881('0x8c')];switch(_0x3b3327[_0x7881('0x8c')]){case'always':_0x3ae366=squel[_0x7881('0x8d')]()['into'](_0x7881('0x8e'))[_0x7881('0x8f')](['phone',_0x7881('0x90'),'ContactId',_0x7881('0x91'),_0x7881('0x63'),_0x7881('0x92'),_0x7881('0x5d')],squel['select']()['field']('phone',_0x7881('0x93'))[_0x7881('0x48')](_0x7881('0x94'),'scheduledAt')[_0x7881('0x48')]('id',_0x7881('0x95'))[_0x7881('0x48')](_0x8917d6['CmListId']['toString'](),_0x7881('0x91'))[_0x7881('0x48')](_0x18751e['params']['id'][_0x7881('0x96')](),_0x7881('0x63'))['field'](_0x7881('0x94'),_0x7881('0x92'))[_0x7881('0x48')](_0x7881('0x94'),_0x7881('0x5d'))[_0x7881('0x97')](_0x7881('0x98'))[_0x7881('0x42')](_0x7881('0x99'))[_0x7881('0x42')]('ListId\x20=\x20?',_0x8917d6[_0x7881('0x9a')][_0x7881('0x96')]())[_0x7881('0x42')](_0x7881('0x9b'))[_0x7881('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7881('0x9c')]()[_0x7881('0x48')](_0x7881('0x9d'))[_0x7881('0x97')]('cm_hopper_final')[_0x7881('0x42')]('VoiceQueueId\x20=\x20?',_0x18751e[_0x7881('0x4d')]['id']['toString']()))[_0x7881('0x42')](_0x7881('0x9e'),squel[_0x7881('0x9c')]()[_0x7881('0x48')](_0x7881('0x93'))['from']('cm_hopper')[_0x7881('0x42')](_0x7881('0x9f'),_0x18751e['params']['id']['toString']())))['toString']();break;case'onlyIfOpen':_0x3ae366=squel[_0x7881('0x8d')]()[_0x7881('0xa0')](_0x7881('0x8e'))['fromQuery']([_0x7881('0x93'),_0x7881('0x90'),_0x7881('0x95'),_0x7881('0x91'),_0x7881('0x63'),'createdAt',_0x7881('0x5d')],squel[_0x7881('0x9c')]()['field'](_0x7881('0x93'),'phone')[_0x7881('0x48')](_0x7881('0x94'),_0x7881('0x90'))[_0x7881('0x48')]('id',_0x7881('0x95'))[_0x7881('0x48')](_0x8917d6[_0x7881('0x9a')][_0x7881('0x96')](),_0x7881('0x91'))['field'](_0x18751e[_0x7881('0x4d')]['id'][_0x7881('0x96')](),_0x7881('0x63'))['field'](_0x7881('0x94'),_0x7881('0x92'))['field'](_0x7881('0x94'),_0x7881('0x5d'))['from']('cm_contacts')[_0x7881('0x42')](_0x7881('0x99'))['where'](_0x7881('0xa1'),_0x8917d6[_0x7881('0x9a')][_0x7881('0x96')]())['where'](_0x7881('0x9b'))[_0x7881('0x42')](_0x7881('0x9e'),squel[_0x7881('0x9c')]()[_0x7881('0x48')]('phone')[_0x7881('0x97')](_0x7881('0x8e'))[_0x7881('0x42')](_0x7881('0x9f'),_0x18751e[_0x7881('0x4d')]['id'][_0x7881('0x96')]())))['toString']();break;default:_0x3ae366=squel[_0x7881('0x8d')]()[_0x7881('0xa0')](_0x7881('0x8e'))['fromQuery']([_0x7881('0x93'),_0x7881('0x90'),_0x7881('0x95'),'ListId',_0x7881('0x63'),'createdAt',_0x7881('0x5d')],squel[_0x7881('0x9c')]()[_0x7881('0x48')]('phone',_0x7881('0x93'))[_0x7881('0x48')]('NOW()','scheduledAt')[_0x7881('0x48')]('id',_0x7881('0x95'))[_0x7881('0x48')](_0x8917d6[_0x7881('0x9a')][_0x7881('0x96')](),_0x7881('0x91'))[_0x7881('0x48')](_0x18751e[_0x7881('0x4d')]['id'][_0x7881('0x96')](),_0x7881('0x63'))[_0x7881('0x48')](_0x7881('0x94'),_0x7881('0x92'))[_0x7881('0x48')](_0x7881('0x94'),_0x7881('0x5d'))[_0x7881('0x97')](_0x7881('0x98'))['where'](_0x7881('0x99'))[_0x7881('0x42')](_0x7881('0xa1'),_0x8917d6[_0x7881('0x9a')][_0x7881('0x96')]())['where'](_0x7881('0x9b')))[_0x7881('0x96')]();}_0x253150[_0x7881('0x7e')](db[_0x7881('0xa2')]['query'](_0x3ae366));}return BPromise[_0x7881('0x83')](_0x253150);}})[_0x7881('0x28')](function(){return _0x4cf8e5;})[_0x7881('0x28')](respondWithResult(_0x2f0dd4,null))[_0x7881('0x4c')](handleError(_0x2f0dd4,null));};exports[_0x7881('0xa3')]=function(_0x287a15,_0x3d69ca,_0x5bc17f){var _0x1caa64;return db['VoiceQueue']['find']({'where':{'id':_0x287a15['params']['id']}})['then'](handleEntityNotFound(_0x3d69ca,null))['then'](function(_0x53497f){if(_0x53497f){return _0x53497f['removeLists'](_0x287a15['query'][_0x7881('0x75')]);}})[_0x7881('0x28')](function(_0x139399){if(_0x139399){_0x1caa64=_0x139399;return db['CmHopper'][_0x7881('0x29')]({'where':{'ListId':_0x287a15[_0x7881('0x3a')][_0x7881('0x75')],'VoiceQueueId':_0x287a15[_0x7881('0x4d')]['id']}})[_0x7881('0x28')](function(){return _0x1caa64;});}})[_0x7881('0x28')](respondWithStatusCode(_0x3d69ca,null))[_0x7881('0x4c')](handleError(_0x3d69ca,null));};exports[_0x7881('0xa4')]=function(_0x208891,_0x2012f1,_0x50ea4b){var _0x276d79={};var _0x4f07bf={};var _0x2be14d;var _0x13b77a;return db['VoiceQueue'][_0x7881('0x61')]({'where':{'id':_0x208891['params']['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x2012f1,null))[_0x7881('0x28')](function(_0x56c142){if(_0x56c142){_0x2be14d=_0x56c142;_0x4f07bf[_0x7881('0x38')]=_[_0x7881('0x39')](db[_0x7881('0x8a')]['rawAttributes']);_0x4f07bf[_0x7881('0x3a')]=_[_0x7881('0x39')](_0x208891[_0x7881('0x3a')]);_0x4f07bf[_0x7881('0x43')]=_[_0x7881('0x3b')](_0x4f07bf['model'],_0x4f07bf['query']);_0x276d79[_0x7881('0x3d')]=_[_0x7881('0x3b')](_0x4f07bf[_0x7881('0x38')],qs[_0x7881('0x3c')](_0x208891[_0x7881('0x3a')][_0x7881('0x3c')]));_0x276d79[_0x7881('0x3d')]=_0x276d79[_0x7881('0x3d')][_0x7881('0x4e')]?_0x276d79[_0x7881('0x3d')]:_0x4f07bf[_0x7881('0x38')];_0x276d79['order']=qs['sort'](_0x208891[_0x7881('0x3a')][_0x7881('0x41')]);_0x276d79['where']=qs['filters'](_[_0x7881('0x44')](_0x208891[_0x7881('0x3a')],_0x4f07bf[_0x7881('0x43')]));if(_0x208891['query']['filter']){_0x276d79['where']=_[_0x7881('0x45')](_0x276d79[_0x7881('0x42')],{'$or':_['map'](_0x276d79[_0x7881('0x3d')],function(_0x53cf7d){var _0x1b0594={};_0x1b0594[_0x53cf7d]={'$like':'%'+_0x208891[_0x7881('0x3a')][_0x7881('0x2c')]+'%'};return _0x1b0594;})});}_0x276d79=_[_0x7881('0x45')]({},_0x276d79,_0x208891[_0x7881('0x64')]);return _0x2be14d[_0x7881('0xa4')](_0x276d79);}})['then'](function(_0x56bf0e){if(_0x56bf0e){_0x13b77a=_0x56bf0e[_0x7881('0x4e')];if(!_0x208891[_0x7881('0x3a')][_0x7881('0x3e')](_0x7881('0x3f'))){_0x276d79[_0x7881('0x40')]=qs[_0x7881('0x40')](_0x208891[_0x7881('0x3a')][_0x7881('0x40')]);_0x276d79['offset']=qs[_0x7881('0x21')](_0x208891[_0x7881('0x3a')][_0x7881('0x21')]);}return _0x2be14d['getBlackLists'](_0x276d79);}})[_0x7881('0x28')](function(_0x4ef0b4){if(_0x4ef0b4){return _0x4ef0b4?{'count':_0x13b77a,'rows':_0x4ef0b4}:null;}})['then'](respondWithResult(_0x2012f1,null))[_0x7881('0x4c')](handleError(_0x2012f1,null));};exports[_0x7881('0xa5')]=function(_0x357dd8,_0x37e8e4,_0x34be3e){var _0x51c938,_0x48485f;return db[_0x7881('0x49')][_0x7881('0x2f')]({'where':{'id':_0x357dd8[_0x7881('0x4d')]['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x37e8e4,null))[_0x7881('0x28')](function(_0x57b4cc){if(_0x57b4cc){_0x48485f=_0x57b4cc;return _0x57b4cc[_0x7881('0xa5')](_0x357dd8[_0x7881('0x5e')][_0x7881('0x75')],_[_0x7881('0x5c')](_0x357dd8[_0x7881('0x5e')],[_0x7881('0x75'),'id'])||{});}return null;})[_0x7881('0x78')](function(_0x59c5c8){var _0xb2b6f1;_0x51c938=_0x59c5c8||[];var _0x103773=[];if(_0x59c5c8){for(var _0x15463f=0x0;_0x15463f<_0x59c5c8[_0x7881('0x4e')];_0x15463f+=0x1){var _0x1ca088=_0x59c5c8[_0x15463f][_0x7881('0x52')]({'plain':!![]});_0xb2b6f1=squel[_0x7881('0x8d')]()[_0x7881('0xa0')]('cm_hopper_black')[_0x7881('0x8f')]([_0x7881('0x93'),'ContactId',_0x7881('0x91'),_0x7881('0x63'),_0x7881('0x92'),'updatedAt'],squel[_0x7881('0x9c')]()[_0x7881('0x48')](_0x7881('0x93'),'phone')[_0x7881('0x48')]('id',_0x7881('0x95'))[_0x7881('0x48')](_0x1ca088['CmListId'][_0x7881('0x96')](),'ListId')['field'](_0x357dd8[_0x7881('0x4d')]['id']['toString'](),_0x7881('0x63'))[_0x7881('0x48')](_0x7881('0x94'),_0x7881('0x92'))['field'](_0x7881('0x94'),'updatedAt')[_0x7881('0x97')]('cm_contacts')[_0x7881('0x42')](_0x7881('0x99'))['where'](_0x7881('0xa1'),_0x1ca088[_0x7881('0x9a')]['toString']())[_0x7881('0x42')](_0x7881('0x9b')))[_0x7881('0x96')]();_0x103773[_0x7881('0x7e')](db[_0x7881('0xa2')][_0x7881('0x3a')](_0xb2b6f1));}return BPromise['all'](_0x103773);}})[_0x7881('0x28')](function(){return _0x51c938;})[_0x7881('0x28')](respondWithResult(_0x37e8e4,null))[_0x7881('0x4c')](handleError(_0x37e8e4,null));};exports[_0x7881('0xa6')]=function(_0x20a5e4,_0x316c92,_0x5c5eb8){var _0x445b9f;return db[_0x7881('0x49')][_0x7881('0x2f')]({'where':{'id':_0x20a5e4[_0x7881('0x4d')]['id']}})[_0x7881('0x28')](handleEntityNotFound(_0x316c92,null))[_0x7881('0x28')](function(_0x20f88a){if(_0x20f88a){return _0x20f88a[_0x7881('0xa6')](_0x20a5e4[_0x7881('0x3a')][_0x7881('0x75')]);}})[_0x7881('0x28')](function(_0xe2a521){if(_0xe2a521){_0x445b9f=_0xe2a521;return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x20a5e4[_0x7881('0x3a')][_0x7881('0x75')],'VoiceQueueId':_0x20a5e4['params']['id']}})['then'](function(){return _0x445b9f;});}})['then'](respondWithStatusCode(_0x316c92,null))['catch'](handleError(_0x316c92,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 948a01f..0317774 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 _0x8e30=['save','update','emit','hook','events','../../mysqldb'];(function(_0xfccfa3,_0x5e563d){var _0xf7f7bd=function(_0x2fff5b){while(--_0x2fff5b){_0xfccfa3['push'](_0xfccfa3['shift']());}};_0xf7f7bd(++_0x5e563d);}(_0x8e30,0xa0));var _0x08e3=function(_0x37b339,_0x1d50aa){_0x37b339=_0x37b339-0x0;var _0x35d00c=_0x8e30[_0x37b339];return _0x35d00c;};'use strict';var EventEmitter=require(_0x08e3('0x0'));var VoiceQueue=require(_0x08e3('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x08e3('0x2'),'afterUpdate':_0x08e3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x375e26){return function(_0x4060b8,_0x3abb14,_0x551c2c){VoiceQueueEvents[_0x08e3('0x4')](_0x375e26+':'+_0x4060b8['id'],_0x4060b8);VoiceQueueEvents[_0x08e3('0x4')](_0x375e26,_0x4060b8);_0x551c2c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x08e3('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x6b7b=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueue'];(function(_0x228641,_0x25d636){var _0x5d5d78=function(_0x4d5c6c){while(--_0x4d5c6c){_0x228641['push'](_0x228641['shift']());}};_0x5d5d78(++_0x25d636);}(_0x6b7b,0xe7));var _0xb6b7=function(_0x32efa2,_0x57e59b){_0x32efa2=_0x32efa2-0x0;var _0x2d603d=_0x6b7b[_0x32efa2];return _0x2d603d;};'use strict';var EventEmitter=require(_0xb6b7('0x0'));var VoiceQueue=require(_0xb6b7('0x1'))['db'][_0xb6b7('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xb6b7('0x3')](0x0);var events={'afterCreate':_0xb6b7('0x4'),'afterUpdate':'update','afterDestroy':_0xb6b7('0x5')};function emitEvent(_0x53d507){return function(_0x35db2d,_0x43a736,_0x12a5cc){VoiceQueueEvents[_0xb6b7('0x6')](_0x53d507+':'+_0x35db2d['id'],_0x35db2d);VoiceQueueEvents[_0xb6b7('0x6')](_0x53d507,_0x35db2d);_0x12a5cc(null);};}for(var e in events){if(events[_0xb6b7('0x7')](e)){var event=events[e];VoiceQueue[_0xb6b7('0x8')](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 3798d12..dc25682 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 _0xa91b=['bluebird','./voiceQueue.attributes','define','VoiceQueue','lodash','util','../../config/logger','api'];(function(_0xfa1177,_0x4d88b3){var _0x5dc04a=function(_0x3fee4c){while(--_0x3fee4c){_0xfa1177['push'](_0xfa1177['shift']());}};_0x5dc04a(++_0x4d88b3);}(_0xa91b,0x194));var _0xba91=function(_0x3bbbce,_0x1f141d){_0x3bbbce=_0x3bbbce-0x0;var _0x254741=_0xa91b[_0x3bbbce];return _0x254741;};'use strict';var _=require(_0xba91('0x0'));var util=require(_0xba91('0x1'));var logger=require(_0xba91('0x2'))(_0xba91('0x3'));var moment=require('moment');var BPromise=require(_0xba91('0x4'));var rp=require('request-promise');var attributes=require(_0xba91('0x5'));module['exports']=function(_0x259491,_0x1640e2){return _0x259491[_0xba91('0x6')](_0xba91('0x7'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3006=['util','../../config/logger','request-promise','./voiceQueue.attributes','define','VoiceQueue','voice_queues','lodash'];(function(_0x5d37dc,_0x5af6c5){var _0x25dc61=function(_0x268a0b){while(--_0x268a0b){_0x5d37dc['push'](_0x5d37dc['shift']());}};_0x25dc61(++_0x5af6c5);}(_0x3006,0xd7));var _0x6300=function(_0x1a7522,_0x4f3c03){_0x1a7522=_0x1a7522-0x0;var _0x4580dc=_0x3006[_0x1a7522];return _0x4580dc;};'use strict';var _=require(_0x6300('0x0'));var util=require(_0x6300('0x1'));var logger=require(_0x6300('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6300('0x3'));var attributes=require(_0x6300('0x4'));module['exports']=function(_0x37b96d,_0x3e6108){return _0x37b96d[_0x6300('0x5')](_0x6300('0x6'),attributes,{'tableName':_0x6300('0x7'),'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 8fa6540..44ac5f2 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 _0x9957=['register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','options','raw','where','attributes','limit','include','model','map','catch','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x3a062d,_0x503f80){var _0x2c5410=function(_0x1a5d54){while(--_0x1a5d54){_0x3a062d['push'](_0x3a062d['shift']());}};_0x2c5410(++_0x503f80);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['GetVoiceQueue']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['VoiceQueue']['findAll']({'raw':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1e')]||null:null,'attributes':_0x3ec178['options']?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1f')]||null:null,'limit':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x20')]||null:null,'include':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')]?_['map'](_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')],function(_0x401dc3){return{'model':db[_0x401dc3[_0x7995('0x22')]],'as':_0x401dc3['as'],'attributes':_0x401dc3[_0x7995('0x1f')],'include':_0x401dc3[_0x7995('0x21')]?_['map'](_0x401dc3[_0x7995('0x21')],function(_0x5911c3){return{'model':db[_0x5911c3[_0x7995('0x22')]],'as':_0x5911c3['as'],'attributes':_0x5911c3[_0x7995('0x1f')],'include':_0x5911c3[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5911c3[_0x7995('0x21')],function(_0x4b6f99){return{'model':db[_0x4b6f99[_0x7995('0x22')]],'as':_0x4b6f99['as'],'attributes':_0x4b6f99['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x3250e0){logger[_0x7995('0x1a')]('GetVoiceQueue',_0x3ec178);logger['debug']('GetVoiceQueue',_0x3ec178,JSON[_0x7995('0x17')](_0x3250e0));_0x4cbe10(_0x3250e0);})[_0x7995('0x24')](function(_0x327a81){logger[_0x7995('0x18')](_0x7995('0x25'),_0x327a81[_0x7995('0x19')],_0x3ec178);_0x3a9b54(_0x3d463e['error'](0x1f4,_0x327a81['message']));});});};exports[_0x7995('0x26')]=function(_0x5524af){var _0x553671=this;return new Promise(function(_0x3eb566,_0x29fac5){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':_0x5524af['options']?_0x5524af[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x5524af['options']?_0x5524af['options']['where']||null:null,'attributes':_0x5524af[_0x7995('0x1c')]?_0x5524af[_0x7995('0x1c')]['attributes']||null:null,'include':_0x5524af[_0x7995('0x1c')]?_0x5524af['options'][_0x7995('0x21')]?_[_0x7995('0x23')](_0x5524af[_0x7995('0x1c')]['include'],function(_0x52d76d){return{'model':db[_0x52d76d[_0x7995('0x22')]],'as':_0x52d76d['as'],'attributes':_0x52d76d['attributes'],'include':_0x52d76d['include']?_[_0x7995('0x23')](_0x52d76d[_0x7995('0x21')],function(_0x5212ff){return{'model':db[_0x5212ff[_0x7995('0x22')]],'as':_0x5212ff['as'],'attributes':_0x5212ff[_0x7995('0x1f')],'include':_0x5212ff[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5212ff[_0x7995('0x21')],function(_0x53002a){return{'model':db[_0x53002a[_0x7995('0x22')]],'as':_0x53002a['as'],'attributes':_0x53002a[_0x7995('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x1d60b8){logger['info'](_0x7995('0x26'),_0x5524af);logger[_0x7995('0x15')](_0x7995('0x26'),_0x5524af,JSON[_0x7995('0x17')](_0x1d60b8));_0x3eb566(_0x1d60b8);})[_0x7995('0x24')](function(_0x1035dc){logger['error'](_0x7995('0x26'),_0x1035dc[_0x7995('0x19')],_0x5524af);_0x29fac5(_0x553671[_0x7995('0x18')](0x1f4,_0x1035dc[_0x7995('0x19')]));});});}; \ 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(_0x549987,_0x1f5fe7){var _0x2535f7=function(_0x4fb5c7){while(--_0x4fb5c7){_0x549987['push'](_0x549987['shift']());}};_0x2535f7(++_0x1f5fe7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 8299ad4..d4ed492 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 _0x2cb2=['remove','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2cb2,0x141));var _0x22cb=function(_0x2441dc,_0x468683){_0x2441dc=_0x2441dc-0x0;var _0x221325=_0x2cb2[_0x2441dc];return _0x221325;};'use strict';var VoiceQueueEvents=require(_0x22cb('0x0'));var events=['save',_0x22cb('0x1'),'update'];function createListener(_0x4b7ff2,_0x2d298f){return function(_0x1d22f3){_0x2d298f[_0x22cb('0x2')](_0x4b7ff2,_0x1d22f3);};}function removeListener(_0xa57f83,_0x27bc9d){return function(){VoiceQueueEvents[_0x22cb('0x3')](_0xa57f83,_0x27bc9d);};}exports[_0x22cb('0x4')]=function(_0x3feb1a){for(var _0xc90d01=0x0,_0x1f2b6b=events[_0x22cb('0x5')];_0xc90d01<_0x1f2b6b;_0xc90d01++){var _0x1744a4=events[_0xc90d01];var _0x28651e=createListener(_0x22cb('0x6')+_0x1744a4,_0x3feb1a);VoiceQueueEvents['on'](_0x1744a4,_0x28651e);}}; \ No newline at end of file +var _0x8396=['./voiceQueue.events','save','remove','emit','removeListener','register','voiceQueue:'];(function(_0xbd6e0f,_0x58fb03){var _0x3f5e97=function(_0x1d66dd){while(--_0x1d66dd){_0xbd6e0f['push'](_0xbd6e0f['shift']());}};_0x3f5e97(++_0x58fb03);}(_0x8396,0x134));var _0x6839=function(_0x478973,_0x24f842){_0x478973=_0x478973-0x0;var _0x33d3e5=_0x8396[_0x478973];return _0x33d3e5;};'use strict';var VoiceQueueEvents=require(_0x6839('0x0'));var events=[_0x6839('0x1'),_0x6839('0x2'),'update'];function createListener(_0x4e1988,_0x4bafa0){return function(_0x2378f5){_0x4bafa0[_0x6839('0x3')](_0x4e1988,_0x2378f5);};}function removeListener(_0x146c45,_0x9942f6){return function(){VoiceQueueEvents[_0x6839('0x4')](_0x146c45,_0x9942f6);};}exports[_0x6839('0x5')]=function(_0x2e57ac){for(var _0x5d5c70=0x0,_0x6e784a=events['length'];_0x5d5c70<_0x6e784a;_0x5d5c70++){var _0x212db7=events[_0x5d5c70];var _0x208077=createListener(_0x6839('0x6')+_0x212db7,_0x2e57ac);VoiceQueueEvents['on'](_0x212db7,_0x208077);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index fe127cf..cb60ec1 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 _0x4386=['delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','/index','/:id','put','update'];(function(_0x423b10,_0x36cad4){var _0x1338d9=function(_0xeb09ac){while(--_0xeb09ac){_0x423b10['push'](_0x423b10['shift']());}};_0x1338d9(++_0x36cad4);}(_0x4386,0x142));var _0x6438=function(_0x4c29f9,_0x5bddd4){_0x4c29f9=_0x4c29f9-0x0;var _0x4e17b8=_0x4386[_0x4c29f9];return _0x4e17b8;};'use strict';var multer=require(_0x6438('0x0'));var util=require(_0x6438('0x1'));var path=require(_0x6438('0x2'));var timeout=require(_0x6438('0x3'));var express=require(_0x6438('0x4'));var router=express['Router']();var auth=require(_0x6438('0x5'));var interaction=require(_0x6438('0x6'));var config=require(_0x6438('0x7'));var controller=require(_0x6438('0x8'));router['get']('/',auth[_0x6438('0x9')](),controller[_0x6438('0xa')]);router[_0x6438('0xb')](_0x6438('0xc'),auth['isAuthenticated'](),controller[_0x6438('0xd')]);router[_0x6438('0xb')](_0x6438('0xe'),auth[_0x6438('0x9')](),controller['getVoiceQueuesReport']);router[_0x6438('0xb')](_0x6438('0xf'),auth[_0x6438('0x9')](),controller['show']);router['post']('/',auth[_0x6438('0x9')](),controller['create']);router[_0x6438('0x10')](_0x6438('0xf'),auth[_0x6438('0x9')](),controller[_0x6438('0x11')]);router[_0x6438('0x12')]('/:id',auth[_0x6438('0x9')](),controller['destroy']);module[_0x6438('0x13')]=router; \ No newline at end of file +var _0x516b=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/index','getVoiceQueuesReport','/:id','show','post'];(function(_0x57d00b,_0x547797){var _0x4c6c90=function(_0x4904fe){while(--_0x4904fe){_0x57d00b['push'](_0x57d00b['shift']());}};_0x4c6c90(++_0x547797);}(_0x516b,0x166));var _0xb516=function(_0x487e8e,_0x452414){_0x487e8e=_0x487e8e-0x0;var _0x4678db=_0x516b[_0x487e8e];return _0x4678db;};'use strict';var multer=require(_0xb516('0x0'));var util=require(_0xb516('0x1'));var path=require(_0xb516('0x2'));var timeout=require(_0xb516('0x3'));var express=require('express');var router=express[_0xb516('0x4')]();var auth=require(_0xb516('0x5'));var interaction=require(_0xb516('0x6'));var config=require(_0xb516('0x7'));var controller=require(_0xb516('0x8'));router[_0xb516('0x9')]('/',auth[_0xb516('0xa')](),controller['index']);router[_0xb516('0x9')]('/describe',auth[_0xb516('0xa')](),controller['describe']);router[_0xb516('0x9')](_0xb516('0xb'),auth[_0xb516('0xa')](),controller[_0xb516('0xc')]);router['get'](_0xb516('0xd'),auth[_0xb516('0xa')](),controller[_0xb516('0xe')]);router[_0xb516('0xf')]('/',auth[_0xb516('0xa')](),controller[_0xb516('0x10')]);router[_0xb516('0x11')](_0xb516('0xd'),auth[_0xb516('0xa')](),controller[_0xb516('0x12')]);router[_0xb516('0x13')](_0xb516('0xd'),auth[_0xb516('0xa')](),controller[_0xb516('0x14')]);module[_0xb516('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 6090ef0..b313d76 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 _0x5ae1=['seconds','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5ae1,0x111));var _0x15ae=function(_0x407330,_0x39f6ac){_0x407330=_0x407330-0x0;var _0x208762=_0x5ae1[_0x407330];return _0x208762;};'use strict';var Sequelize=require(_0x15ae('0x0'));var moment=require(_0x15ae('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x15ae('0x2')]},'calleridnum':{'type':Sequelize[_0x15ae('0x2')]},'calleridname':{'type':Sequelize[_0x15ae('0x2')]},'queue':{'type':Sequelize[_0x15ae('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x15ae('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x242f5e){var _0x4283f2=moment(_0x242f5e);var _0x11bb8c=moment(this['getDataValue'](_0x15ae('0x4')))[_0x15ae('0x5')](_0x15ae('0x6'));var _0x50e730=_0x4283f2['diff'](_0x11bb8c,_0x15ae('0x7'));this['setDataValue'](_0x15ae('0x8'),_0x242f5e);this['setDataValue'](_0x15ae('0x9'),_0x50e730||null);}},'position':{'type':Sequelize[_0x15ae('0xa')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x15ae('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x15ae('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x15ae('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x15ae('0x3')]},'queuecallerexit':{'type':Sequelize[_0x15ae('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x15ae('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x15ae('0x2')],'comment':_0x15ae('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x15ae('0x2')]},'accountcode':{'type':Sequelize[_0x15ae('0x2')]},'context':{'type':Sequelize[_0x15ae('0x2')]},'exten':{'type':Sequelize[_0x15ae('0x2')]},'priority':{'type':Sequelize[_0x15ae('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x15ae('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x15ae('0x2')]},'transfer':{'type':Sequelize[_0x15ae('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x15ae('0xd')},'transferexten':{'type':Sequelize[_0x15ae('0x2')]},'transferuniqueid':{'type':Sequelize[_0x15ae('0x2')]},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x15ae('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfc39=['YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','getDataValue'];(function(_0x2a0fc4,_0x2eaf74){var _0x531d00=function(_0xa4388f){while(--_0xa4388f){_0x2a0fc4['push'](_0x2a0fc4['shift']());}};_0x531d00(++_0x2eaf74);}(_0xfc39,0xf3));var _0x9fc3=function(_0x221e15,_0x770f6b){_0x221e15=_0x221e15-0x0;var _0x21a550=_0xfc39[_0x221e15];return _0x21a550;};'use strict';var Sequelize=require(_0x9fc3('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x9fc3('0x1')]},'uniqueid':{'type':Sequelize[_0x9fc3('0x1')]},'calleridnum':{'type':Sequelize[_0x9fc3('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9fc3('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x9fc3('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x9fc3('0x2')],'set':function(_0x2fef39){var _0x478639=moment(_0x2fef39);var _0xa215ba=moment(this[_0x9fc3('0x3')]('queuecallerjoinAt'))['format'](_0x9fc3('0x4'));var _0x2638be=_0x478639[_0x9fc3('0x5')](_0xa215ba,'seconds');this[_0x9fc3('0x6')](_0x9fc3('0x7'),_0x2fef39);this[_0x9fc3('0x6')](_0x9fc3('0x8'),_0x2638be||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x9fc3('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9fc3('0x2')]},'queuecallercomplete':{'type':Sequelize[_0x9fc3('0x9')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x9fc3('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x9fc3('0x1')],'comment':_0x9fc3('0xa')},'originalposition':{'type':Sequelize[_0x9fc3('0xb')]},'channel':{'type':Sequelize[_0x9fc3('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9fc3('0x1')]},'connectedlinename':{'type':Sequelize[_0x9fc3('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x9fc3('0x1')]},'priority':{'type':Sequelize[_0x9fc3('0x1')]},'holdtime':{'type':Sequelize[_0x9fc3('0xb')]},'mohtime':{'type':Sequelize[_0x9fc3('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9fc3('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9fc3('0x1')]},'transfer':{'type':Sequelize[_0x9fc3('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9fc3('0x1')],'comment':_0x9fc3('0xc')},'transferexten':{'type':Sequelize[_0x9fc3('0x1')]},'transferuniqueid':{'type':Sequelize[_0x9fc3('0x1')]},'disposition':{'type':Sequelize[_0x9fc3('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x9fc3('0xb')],'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 14b433f..0a9b992 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 _0x8107=['attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','VoiceQueueReport','count','includeAll','rows','catch','params','rawAttributes','length','find','create','body','describe','options','include','findAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/logger','defaults','localhost','redis','./voiceQueueReport.socket','register','status','end','json','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','model','keys','query','intersection'];(function(_0x10f705,_0x5457d0){var _0x2b8126=function(_0x2a5dd7){while(--_0x2a5dd7){_0x10f705['push'](_0x10f705['shift']());}};_0x2b8126(++_0x5457d0);}(_0x8107,0x192));var _0x7810=function(_0x40c499,_0x38a649){_0x40c499=_0x40c499-0x0;var _0x12a5bc=_0x8107[_0x40c499];return _0x12a5bc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7810('0x0'));var rimraf=require(_0x7810('0x1'));var zipdir=require(_0x7810('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7810('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7810('0x4'));var util=require(_0x7810('0x5'));var path=require(_0x7810('0x6'));var sox=require(_0x7810('0x7'));var csv=require(_0x7810('0x8'));var ejs=require(_0x7810('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7810('0xa'));var crypto=require(_0x7810('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7810('0xc'));var toCsv=require(_0x7810('0x8'));var querystring=require('querystring');var Papa=require(_0x7810('0xd'));var authService=require(_0x7810('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x7810('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x7810('0x10')](config['redis'],{'host':_0x7810('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7810('0x12')]));require(_0x7810('0x13'))[_0x7810('0x14')](socket);function respondWithStatusCode(_0x914897,_0x1fe117){_0x1fe117=_0x1fe117||0xcc;return function(_0x3d7181){if(_0x3d7181){return _0x914897['sendStatus'](_0x1fe117);}return _0x914897[_0x7810('0x15')](_0x1fe117)[_0x7810('0x16')]();};}function respondWithResult(_0x512a1f,_0x20a0b2){_0x20a0b2=_0x20a0b2||0xc8;return function(_0x2720a5){if(_0x2720a5){return _0x512a1f[_0x7810('0x15')](_0x20a0b2)[_0x7810('0x17')](_0x2720a5);}};}function respondWithFilteredResult(_0x2c2349,_0x104b49){return function(_0x3e98be){if(_0x3e98be){var _0x471430=_0x3e98be['count'],_0x24c88f=_0x104b49[_0x7810('0x18')],_0x584c9e=_0x104b49[_0x7810('0x18')]+_0x104b49['limit'],_0x1f9e97;if(_0x584c9e>=_0x471430){_0x584c9e=_0x471430;_0x1f9e97=0xc8;}else{_0x1f9e97=0xce;}_0x2c2349[_0x7810('0x15')](_0x1f9e97);return _0x2c2349[_0x7810('0x19')](_0x7810('0x1a'),_0x24c88f+'-'+_0x584c9e+'/'+_0x471430)['json'](_0x3e98be);}return null;};}function patchUpdates(_0x1333a4){return function(_0x5cd491){try{jsonpatch[_0x7810('0x1b')](_0x5cd491,_0x1333a4,!![]);}catch(_0x5bc6c5){return BPromise[_0x7810('0x1c')](_0x5bc6c5);}return _0x5cd491['save']();};}function saveUpdates(_0x6ad80f,_0x347fed){return function(_0x537911){if(_0x537911){return _0x537911[_0x7810('0x1d')](_0x6ad80f)[_0x7810('0x1e')](function(_0xca0d9b){return _0xca0d9b;});}return null;};}function removeEntity(_0x5369ba,_0x4714ad){return function(_0x3d6ba7){if(_0x3d6ba7){return _0x3d6ba7[_0x7810('0x1f')]()[_0x7810('0x1e')](function(){_0x5369ba[_0x7810('0x15')](0xcc)[_0x7810('0x16')]();});}};}function handleEntityNotFound(_0x19c37a,_0x2030ef){return function(_0x35f115){if(!_0x35f115){_0x19c37a[_0x7810('0x20')](0x194);}return _0x35f115;};}function handleError(_0x2f2a58,_0x4937f8){_0x4937f8=_0x4937f8||0x1f4;return function(_0x12d5bb){logger[_0x7810('0x21')](_0x12d5bb[_0x7810('0x22')]);if(_0x12d5bb[_0x7810('0x23')]){delete _0x12d5bb[_0x7810('0x23')];}_0x2f2a58[_0x7810('0x15')](_0x4937f8)[_0x7810('0x24')](_0x12d5bb);};}exports[_0x7810('0x25')]=function(_0x550457,_0x15857d){var _0x5b938c={},_0x16e289={},_0x547b81={'count':0x0,'rows':[]};var _0x44d166=db['VoiceQueueReport']['rawAttributes'];_0x16e289[_0x7810('0x26')]=_[_0x7810('0x27')](_0x44d166);_0x16e289['query']=_[_0x7810('0x27')](_0x550457[_0x7810('0x28')]);_0x16e289['filters']=_[_0x7810('0x29')](_0x16e289[_0x7810('0x26')],_0x16e289[_0x7810('0x28')]);_0x5b938c[_0x7810('0x2a')]=_[_0x7810('0x29')](_0x16e289[_0x7810('0x26')],qs[_0x7810('0x2b')](_0x550457['query']['fields']));_0x5b938c[_0x7810('0x2a')]=_0x5b938c[_0x7810('0x2a')]['length']?_0x5b938c['attributes']:_0x16e289[_0x7810('0x26')];if(!_0x550457[_0x7810('0x28')][_0x7810('0x2c')](_0x7810('0x2d'))){_0x5b938c[_0x7810('0x2e')]=qs[_0x7810('0x2e')](_0x550457[_0x7810('0x28')][_0x7810('0x2e')]);_0x5b938c['offset']=qs[_0x7810('0x18')](_0x550457[_0x7810('0x28')][_0x7810('0x18')]);}_0x5b938c[_0x7810('0x2f')]=qs[_0x7810('0x30')](_0x550457['query']['sort']);_0x5b938c[_0x7810('0x31')]=qs[_0x7810('0x32')](_[_0x7810('0x33')](_0x550457[_0x7810('0x28')],_0x16e289[_0x7810('0x32')]));if(_0x550457[_0x7810('0x28')][_0x7810('0x34')]){_0x5b938c[_0x7810('0x31')]=_[_0x7810('0x35')](_0x5b938c[_0x7810('0x31')],{'$or':_[_0x7810('0x36')](_0x44d166,function(_0xdc5345){if(_0xdc5345['type'][_0x7810('0x37')]!==_0x7810('0x38')){var _0x5628a0={};_0x5628a0[_0xdc5345[_0x7810('0x39')]]={'$like':'%'+_0x550457[_0x7810('0x28')][_0x7810('0x34')]+'%'};return _0x5628a0;}})});}_0x5b938c=_[_0x7810('0x35')]({},_0x5b938c,_0x550457['options']);var _0x5e2a9a={'where':_0x5b938c[_0x7810('0x31')]};return db[_0x7810('0x3a')][_0x7810('0x3b')](_0x5e2a9a)[_0x7810('0x1e')](function(_0x2e8b20){_0x547b81[_0x7810('0x3b')]=_0x2e8b20;if(_0x550457['query'][_0x7810('0x3c')]){_0x5b938c['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x5b938c);})['then'](function(_0x2fdd5d){_0x547b81[_0x7810('0x3d')]=_0x2fdd5d;return _0x547b81;})[_0x7810('0x1e')](respondWithFilteredResult(_0x15857d,_0x5b938c))[_0x7810('0x3e')](handleError(_0x15857d,null));};exports['show']=function(_0x12c9bf,_0x3dae6e){var _0x402a74={'raw':![],'where':{'id':_0x12c9bf[_0x7810('0x3f')]['id']}},_0x3931a9={};_0x3931a9[_0x7810('0x26')]=_['keys'](db[_0x7810('0x3a')][_0x7810('0x40')]);_0x3931a9[_0x7810('0x28')]=_[_0x7810('0x27')](_0x12c9bf[_0x7810('0x28')]);_0x3931a9[_0x7810('0x32')]=_[_0x7810('0x29')](_0x3931a9[_0x7810('0x26')],_0x3931a9['query']);_0x402a74[_0x7810('0x2a')]=_[_0x7810('0x29')](_0x3931a9[_0x7810('0x26')],qs[_0x7810('0x2b')](_0x12c9bf[_0x7810('0x28')]['fields']));_0x402a74['attributes']=_0x402a74[_0x7810('0x2a')][_0x7810('0x41')]?_0x402a74[_0x7810('0x2a')]:_0x3931a9[_0x7810('0x26')];if(_0x12c9bf[_0x7810('0x28')][_0x7810('0x3c')]){_0x402a74['include']=[{'all':!![]}];}_0x402a74=_[_0x7810('0x35')]({},_0x402a74,_0x12c9bf['options']);return db[_0x7810('0x3a')][_0x7810('0x42')](_0x402a74)[_0x7810('0x1e')](handleEntityNotFound(_0x3dae6e,null))['then'](respondWithResult(_0x3dae6e,null))[_0x7810('0x3e')](handleError(_0x3dae6e,null));};exports[_0x7810('0x43')]=function(_0x49b5ca,_0x55dd92){return db[_0x7810('0x3a')][_0x7810('0x43')](_0x49b5ca[_0x7810('0x44')],{})[_0x7810('0x1e')](respondWithResult(_0x55dd92,0xc9))['catch'](handleError(_0x55dd92,null));};exports[_0x7810('0x1d')]=function(_0x58c0c8,_0x1a6477){if(_0x58c0c8['body']['id']){delete _0x58c0c8[_0x7810('0x44')]['id'];}return db[_0x7810('0x3a')]['find']({'where':{'id':_0x58c0c8[_0x7810('0x3f')]['id']}})[_0x7810('0x1e')](handleEntityNotFound(_0x1a6477,null))['then'](saveUpdates(_0x58c0c8[_0x7810('0x44')],null))[_0x7810('0x1e')](respondWithResult(_0x1a6477,null))[_0x7810('0x3e')](handleError(_0x1a6477,null));};exports[_0x7810('0x1f')]=function(_0x554cc2,_0x517b71){return db[_0x7810('0x3a')]['find']({'where':{'id':_0x554cc2['params']['id']}})[_0x7810('0x1e')](handleEntityNotFound(_0x517b71,null))[_0x7810('0x1e')](removeEntity(_0x517b71,null))[_0x7810('0x3e')](handleError(_0x517b71,null));};exports[_0x7810('0x45')]=function(_0x159473,_0x490879){return db['VoiceQueueReport'][_0x7810('0x45')]()[_0x7810('0x1e')](respondWithResult(_0x490879,null))[_0x7810('0x3e')](handleError(_0x490879,null));};exports['getVoiceQueuesReport']=function(_0x2c443e,_0x2023f7){var _0x2574e0={},_0x53be71={},_0x90a80={'count':0x0,'rows':[]};_0x53be71['model']=_['keys'](db[_0x7810('0x3a')][_0x7810('0x40')]);_0x53be71['query']=_[_0x7810('0x27')](_0x2c443e[_0x7810('0x28')]);_0x53be71[_0x7810('0x32')]=_['intersection'](_0x53be71[_0x7810('0x26')],_0x53be71[_0x7810('0x28')]);_0x2574e0[_0x7810('0x2a')]=_[_0x7810('0x29')](_0x53be71['model'],qs[_0x7810('0x2b')](_0x2c443e['query']['fields']));_0x2574e0['attributes']=_0x2574e0['attributes']['length']?_0x2574e0[_0x7810('0x2a')]:_0x53be71['model'];if(!_0x2c443e[_0x7810('0x28')]['hasOwnProperty'](_0x7810('0x2d'))){_0x2574e0[_0x7810('0x2e')]=qs['limit'](_0x2c443e[_0x7810('0x28')]['limit']);_0x2574e0[_0x7810('0x18')]=qs[_0x7810('0x18')](_0x2c443e[_0x7810('0x28')][_0x7810('0x18')]);}_0x2574e0[_0x7810('0x2f')]=qs[_0x7810('0x30')](_0x2c443e['query'][_0x7810('0x30')]);_0x2574e0[_0x7810('0x31')]=qs['filters'](_[_0x7810('0x33')](_0x2c443e[_0x7810('0x28')],_0x53be71[_0x7810('0x32')]));if(_0x2c443e['query'][_0x7810('0x34')]){_0x2574e0[_0x7810('0x31')]=_[_0x7810('0x35')](_0x2574e0[_0x7810('0x31')],{'$or':_[_0x7810('0x36')](_0x2574e0[_0x7810('0x2a')],function(_0x1e65f8){var _0xb6a8d4={};_0xb6a8d4[_0x1e65f8]={'$like':'%'+_0x2c443e[_0x7810('0x28')][_0x7810('0x34')]+'%'};return _0xb6a8d4;})});}_0x2574e0=_[_0x7810('0x35')]({},_0x2574e0,_0x2c443e[_0x7810('0x46')]);var _0x4b9f5f={'where':_0x2574e0[_0x7810('0x31')]};return db[_0x7810('0x3a')][_0x7810('0x3b')](_0x4b9f5f)[_0x7810('0x1e')](function(_0x525591){_0x90a80['count']=_0x525591;if(_0x2c443e[_0x7810('0x28')][_0x7810('0x3c')]){_0x2574e0[_0x7810('0x47')]=[{'all':!![]}];}return db[_0x7810('0x3a')][_0x7810('0x48')](_0x2574e0);})[_0x7810('0x1e')](function(_0x357782){_0x90a80[_0x7810('0x3d')]=_0x357782;return _0x90a80;})[_0x7810('0x1e')](respondWithFilteredResult(_0x2023f7,_0x2574e0,_0x7810('0x49')))[_0x7810('0x3e')](handleError(_0x2023f7,null,_0x7810('0x49')));}; \ No newline at end of file +var _0xfcac=['catch','show','rawAttributes','length','find','body','params','describe','getVoiceQueuesReport','includeAll','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','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','./voiceQueueReport.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','VoiceQueueReport','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','where','filters','pick','filter','merge','map','type','key','field','options','include','findAll','rows'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0xfcac,0xfd));var _0xcfca=function(_0x56abc9,_0x4403e7){_0x56abc9=_0x56abc9-0x0;var _0x47956f=_0xfcac[_0x56abc9];return _0x47956f;};'use strict';var pdf=require(_0xcfca('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcfca('0x1'));var zipdir=require(_0xcfca('0x2'));var jsonpatch=require(_0xcfca('0x3'));var rp=require(_0xcfca('0x4'));var moment=require('moment');var BPromise=require(_0xcfca('0x5'));var Mustache=require(_0xcfca('0x6'));var util=require(_0xcfca('0x7'));var path=require(_0xcfca('0x8'));var sox=require(_0xcfca('0x9'));var csv=require(_0xcfca('0xa'));var ejs=require(_0xcfca('0xb'));var fs=require('fs');var _=require(_0xcfca('0xc'));var squel=require('squel');var crypto=require(_0xcfca('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcfca('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcfca('0xf'));var authService=require(_0xcfca('0x10'));var hardwareService=require(_0xcfca('0x11'));var Redis=require(_0xcfca('0x12'));var qs=require(_0xcfca('0x13'));var logger=require(_0xcfca('0x14'))(_0xcfca('0x15'));var utils=require(_0xcfca('0x16'));var config=require(_0xcfca('0x17'));var db=require(_0xcfca('0x18'))['db'];config[_0xcfca('0x19')]=_['defaults'](config[_0xcfca('0x19')],{'host':_0xcfca('0x1a'),'port':0x18eb});var socket=require(_0xcfca('0x1b'))(new Redis(config['redis']));require(_0xcfca('0x1c'))[_0xcfca('0x1d')](socket);function respondWithStatusCode(_0x2edb2f,_0x4451cc){_0x4451cc=_0x4451cc||0xcc;return function(_0x1334a9){if(_0x1334a9){return _0x2edb2f['sendStatus'](_0x4451cc);}return _0x2edb2f[_0xcfca('0x1e')](_0x4451cc)[_0xcfca('0x1f')]();};}function respondWithResult(_0x35f647,_0x5811c9){_0x5811c9=_0x5811c9||0xc8;return function(_0x3703f5){if(_0x3703f5){return _0x35f647[_0xcfca('0x1e')](_0x5811c9)[_0xcfca('0x20')](_0x3703f5);}};}function respondWithFilteredResult(_0xb12dd4,_0x12c0f1){return function(_0x440382){if(_0x440382){var _0x6f2bb0=_0x440382[_0xcfca('0x21')],_0x30382e=_0x12c0f1[_0xcfca('0x22')],_0x5f5037=_0x12c0f1[_0xcfca('0x22')]+_0x12c0f1[_0xcfca('0x23')],_0x54d10a;if(_0x5f5037>=_0x6f2bb0){_0x5f5037=_0x6f2bb0;_0x54d10a=0xc8;}else{_0x54d10a=0xce;}_0xb12dd4[_0xcfca('0x1e')](_0x54d10a);return _0xb12dd4[_0xcfca('0x24')](_0xcfca('0x25'),_0x30382e+'-'+_0x5f5037+'/'+_0x6f2bb0)['json'](_0x440382);}return null;};}function patchUpdates(_0x4eae01){return function(_0x288a03){try{jsonpatch[_0xcfca('0x26')](_0x288a03,_0x4eae01,!![]);}catch(_0x168b19){return BPromise[_0xcfca('0x27')](_0x168b19);}return _0x288a03[_0xcfca('0x28')]();};}function saveUpdates(_0x41a020,_0x7425f3){return function(_0x8f650e){if(_0x8f650e){return _0x8f650e['update'](_0x41a020)[_0xcfca('0x29')](function(_0x2592dd){return _0x2592dd;});}return null;};}function removeEntity(_0x53a2f3,_0x227a3e){return function(_0x230e26){if(_0x230e26){return _0x230e26[_0xcfca('0x2a')]()[_0xcfca('0x29')](function(){_0x53a2f3[_0xcfca('0x1e')](0xcc)[_0xcfca('0x1f')]();});}};}function handleEntityNotFound(_0x170a5c,_0x18cd49){return function(_0x28c88d){if(!_0x28c88d){_0x170a5c[_0xcfca('0x2b')](0x194);}return _0x28c88d;};}function handleError(_0xbd275b,_0x547965){_0x547965=_0x547965||0x1f4;return function(_0x14f6ee){logger[_0xcfca('0x2c')](_0x14f6ee[_0xcfca('0x2d')]);if(_0x14f6ee[_0xcfca('0x2e')]){delete _0x14f6ee[_0xcfca('0x2e')];}_0xbd275b[_0xcfca('0x1e')](_0x547965)[_0xcfca('0x2f')](_0x14f6ee);};}exports[_0xcfca('0x30')]=function(_0xc41926,_0x350924){var _0x249ff5={},_0x274aef={},_0x3b86dc={'count':0x0,'rows':[]};var _0x29942a=db[_0xcfca('0x31')]['rawAttributes'];_0x274aef[_0xcfca('0x32')]=_[_0xcfca('0x33')](_0x29942a);_0x274aef[_0xcfca('0x34')]=_[_0xcfca('0x33')](_0xc41926[_0xcfca('0x34')]);_0x274aef['filters']=_[_0xcfca('0x35')](_0x274aef['model'],_0x274aef[_0xcfca('0x34')]);_0x249ff5[_0xcfca('0x36')]=_['intersection'](_0x274aef[_0xcfca('0x32')],qs[_0xcfca('0x37')](_0xc41926[_0xcfca('0x34')][_0xcfca('0x37')]));_0x249ff5['attributes']=_0x249ff5[_0xcfca('0x36')]['length']?_0x249ff5[_0xcfca('0x36')]:_0x274aef[_0xcfca('0x32')];if(!_0xc41926[_0xcfca('0x34')][_0xcfca('0x38')]('nolimit')){_0x249ff5[_0xcfca('0x23')]=qs[_0xcfca('0x23')](_0xc41926[_0xcfca('0x34')]['limit']);_0x249ff5[_0xcfca('0x22')]=qs[_0xcfca('0x22')](_0xc41926[_0xcfca('0x34')][_0xcfca('0x22')]);}_0x249ff5[_0xcfca('0x39')]=qs['sort'](_0xc41926[_0xcfca('0x34')]['sort']);_0x249ff5[_0xcfca('0x3a')]=qs[_0xcfca('0x3b')](_[_0xcfca('0x3c')](_0xc41926['query'],_0x274aef[_0xcfca('0x3b')]));if(_0xc41926[_0xcfca('0x34')][_0xcfca('0x3d')]){_0x249ff5['where']=_[_0xcfca('0x3e')](_0x249ff5[_0xcfca('0x3a')],{'$or':_[_0xcfca('0x3f')](_0x29942a,function(_0xc581fc){if(_0xc581fc[_0xcfca('0x40')][_0xcfca('0x41')]!=='VIRTUAL'){var _0x32409f={};_0x32409f[_0xc581fc[_0xcfca('0x42')]]={'$like':'%'+_0xc41926[_0xcfca('0x34')][_0xcfca('0x3d')]+'%'};return _0x32409f;}})});}_0x249ff5=_['merge']({},_0x249ff5,_0xc41926[_0xcfca('0x43')]);var _0x17ef20={'where':_0x249ff5[_0xcfca('0x3a')]};return db['VoiceQueueReport']['count'](_0x17ef20)[_0xcfca('0x29')](function(_0x2a10c1){_0x3b86dc[_0xcfca('0x21')]=_0x2a10c1;if(_0xc41926[_0xcfca('0x34')]['includeAll']){_0x249ff5[_0xcfca('0x44')]=[{'all':!![]}];}return db[_0xcfca('0x31')][_0xcfca('0x45')](_0x249ff5);})[_0xcfca('0x29')](function(_0x71eb45){_0x3b86dc[_0xcfca('0x46')]=_0x71eb45;return _0x3b86dc;})['then'](respondWithFilteredResult(_0x350924,_0x249ff5))[_0xcfca('0x47')](handleError(_0x350924,null));};exports[_0xcfca('0x48')]=function(_0x91c3c7,_0x1634f7){var _0x47545c={'raw':![],'where':{'id':_0x91c3c7['params']['id']}},_0x293d15={};_0x293d15[_0xcfca('0x32')]=_[_0xcfca('0x33')](db[_0xcfca('0x31')][_0xcfca('0x49')]);_0x293d15[_0xcfca('0x34')]=_[_0xcfca('0x33')](_0x91c3c7[_0xcfca('0x34')]);_0x293d15[_0xcfca('0x3b')]=_['intersection'](_0x293d15[_0xcfca('0x32')],_0x293d15['query']);_0x47545c[_0xcfca('0x36')]=_[_0xcfca('0x35')](_0x293d15['model'],qs[_0xcfca('0x37')](_0x91c3c7[_0xcfca('0x34')][_0xcfca('0x37')]));_0x47545c[_0xcfca('0x36')]=_0x47545c[_0xcfca('0x36')][_0xcfca('0x4a')]?_0x47545c['attributes']:_0x293d15['model'];if(_0x91c3c7[_0xcfca('0x34')]['includeAll']){_0x47545c[_0xcfca('0x44')]=[{'all':!![]}];}_0x47545c=_[_0xcfca('0x3e')]({},_0x47545c,_0x91c3c7[_0xcfca('0x43')]);return db[_0xcfca('0x31')][_0xcfca('0x4b')](_0x47545c)[_0xcfca('0x29')](handleEntityNotFound(_0x1634f7,null))[_0xcfca('0x29')](respondWithResult(_0x1634f7,null))[_0xcfca('0x47')](handleError(_0x1634f7,null));};exports['create']=function(_0x190c37,_0x2f08d0){return db[_0xcfca('0x31')]['create'](_0x190c37[_0xcfca('0x4c')],{})['then'](respondWithResult(_0x2f08d0,0xc9))[_0xcfca('0x47')](handleError(_0x2f08d0,null));};exports['update']=function(_0xa5e889,_0x5182fa){if(_0xa5e889[_0xcfca('0x4c')]['id']){delete _0xa5e889[_0xcfca('0x4c')]['id'];}return db['VoiceQueueReport'][_0xcfca('0x4b')]({'where':{'id':_0xa5e889['params']['id']}})[_0xcfca('0x29')](handleEntityNotFound(_0x5182fa,null))['then'](saveUpdates(_0xa5e889[_0xcfca('0x4c')],null))[_0xcfca('0x29')](respondWithResult(_0x5182fa,null))[_0xcfca('0x47')](handleError(_0x5182fa,null));};exports[_0xcfca('0x2a')]=function(_0x45019b,_0x17d10f){return db[_0xcfca('0x31')]['find']({'where':{'id':_0x45019b[_0xcfca('0x4d')]['id']}})['then'](handleEntityNotFound(_0x17d10f,null))[_0xcfca('0x29')](removeEntity(_0x17d10f,null))[_0xcfca('0x47')](handleError(_0x17d10f,null));};exports['describe']=function(_0x22e89d,_0x14f098){return db[_0xcfca('0x31')][_0xcfca('0x4e')]()[_0xcfca('0x29')](respondWithResult(_0x14f098,null))[_0xcfca('0x47')](handleError(_0x14f098,null));};exports[_0xcfca('0x4f')]=function(_0x161d86,_0x1fd5f6){var _0x2a5847={},_0x15ae8c={},_0xa5d6bb={'count':0x0,'rows':[]};_0x15ae8c[_0xcfca('0x32')]=_[_0xcfca('0x33')](db['VoiceQueueReport'][_0xcfca('0x49')]);_0x15ae8c[_0xcfca('0x34')]=_['keys'](_0x161d86['query']);_0x15ae8c[_0xcfca('0x3b')]=_[_0xcfca('0x35')](_0x15ae8c[_0xcfca('0x32')],_0x15ae8c[_0xcfca('0x34')]);_0x2a5847[_0xcfca('0x36')]=_[_0xcfca('0x35')](_0x15ae8c[_0xcfca('0x32')],qs[_0xcfca('0x37')](_0x161d86['query']['fields']));_0x2a5847[_0xcfca('0x36')]=_0x2a5847[_0xcfca('0x36')][_0xcfca('0x4a')]?_0x2a5847['attributes']:_0x15ae8c[_0xcfca('0x32')];if(!_0x161d86[_0xcfca('0x34')]['hasOwnProperty']('nolimit')){_0x2a5847[_0xcfca('0x23')]=qs['limit'](_0x161d86[_0xcfca('0x34')][_0xcfca('0x23')]);_0x2a5847[_0xcfca('0x22')]=qs['offset'](_0x161d86[_0xcfca('0x34')][_0xcfca('0x22')]);}_0x2a5847['order']=qs['sort'](_0x161d86['query']['sort']);_0x2a5847[_0xcfca('0x3a')]=qs[_0xcfca('0x3b')](_['pick'](_0x161d86[_0xcfca('0x34')],_0x15ae8c[_0xcfca('0x3b')]));if(_0x161d86['query'][_0xcfca('0x3d')]){_0x2a5847['where']=_[_0xcfca('0x3e')](_0x2a5847[_0xcfca('0x3a')],{'$or':_['map'](_0x2a5847[_0xcfca('0x36')],function(_0x3d0cae){var _0x11adf9={};_0x11adf9[_0x3d0cae]={'$like':'%'+_0x161d86[_0xcfca('0x34')][_0xcfca('0x3d')]+'%'};return _0x11adf9;})});}_0x2a5847=_[_0xcfca('0x3e')]({},_0x2a5847,_0x161d86[_0xcfca('0x43')]);var _0x25ef8f={'where':_0x2a5847[_0xcfca('0x3a')]};return db[_0xcfca('0x31')][_0xcfca('0x21')](_0x25ef8f)[_0xcfca('0x29')](function(_0x32a226){_0xa5d6bb[_0xcfca('0x21')]=_0x32a226;if(_0x161d86[_0xcfca('0x34')][_0xcfca('0x50')]){_0x2a5847[_0xcfca('0x44')]=[{'all':!![]}];}return db[_0xcfca('0x31')]['findAll'](_0x2a5847);})[_0xcfca('0x29')](function(_0x22cf96){_0xa5d6bb[_0xcfca('0x46')]=_0x22cf96;return _0xa5d6bb;})[_0xcfca('0x29')](respondWithFilteredResult(_0x1fd5f6,_0x2a5847,_0xcfca('0x4f')))[_0xcfca('0x47')](handleError(_0x1fd5f6,null,_0xcfca('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 4274e67..0162705 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 _0x630c=['exports','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hook'];(function(_0x5255a8,_0x574be7){var _0x13b6f1=function(_0x117ed6){while(--_0x117ed6){_0x5255a8['push'](_0x5255a8['shift']());}};_0x13b6f1(++_0x574be7);}(_0x630c,0x76));var _0xc630=function(_0x4858fc,_0x4626c3){_0x4858fc=_0x4858fc-0x0;var _0xf56a44=_0x630c[_0x4858fc];return _0xf56a44;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xc630('0x0'))['db'][_0xc630('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xc630('0x2')](0x0);var events={'afterCreate':_0xc630('0x3'),'afterUpdate':_0xc630('0x4'),'afterDestroy':_0xc630('0x5')};function emitEvent(_0x19e95b){return function(_0x59c7d9,_0x403ce1,_0xdf06b5){VoiceQueueReportEvents[_0xc630('0x6')](_0x19e95b+':'+_0x59c7d9['id'],_0x59c7d9);VoiceQueueReportEvents[_0xc630('0x6')](_0x19e95b,_0x59c7d9);_0xdf06b5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xc630('0x7')](e,emitEvent(event));}}module[_0xc630('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x85b1=['emit','hasOwnProperty','hook','../../mysqldb','save'];(function(_0x1b87a6,_0x4b11a0){var _0x3f2b76=function(_0xb685ec){while(--_0xb685ec){_0x1b87a6['push'](_0x1b87a6['shift']());}};_0x3f2b76(++_0x4b11a0);}(_0x85b1,0x10c));var _0x185b=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x85b1[_0x1a72f3];return _0x57ef47;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x185b('0x0'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x185b('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x49fc1b){return function(_0x1a8526,_0x155523,_0x560f7f){VoiceQueueReportEvents['emit'](_0x49fc1b+':'+_0x1a8526['id'],_0x1a8526);VoiceQueueReportEvents[_0x185b('0x2')](_0x49fc1b,_0x1a8526);_0x560f7f(null);};}for(var e in events){if(events[_0x185b('0x3')](e)){var event=events[e];VoiceQueueReport[_0x185b('0x4')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 9fd1ef1..4f76ee0 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 _0xd7f7=['api','moment','bluebird','define','VoiceQueueReport','report_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xd7f7,0x101));var _0x7d7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd7f7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d7f('0x0'));var util=require(_0x7d7f('0x1'));var logger=require(_0x7d7f('0x2'))(_0x7d7f('0x3'));var moment=require(_0x7d7f('0x4'));var BPromise=require(_0x7d7f('0x5'));var rp=require('request-promise');var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x3a680e,_0x52dcb0){return _0x3a680e[_0x7d7f('0x6')](_0x7d7f('0x7'),attributes,{'tableName':_0x7d7f('0x8'),'paranoid':![],'indexes':[{'fields':[_0x7d7f('0x9')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4308=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./voiceQueueReport.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4308,0x87));var _0x8430=function(_0x4a4b57,_0x337a39){_0x4a4b57=_0x4a4b57-0x0;var _0x565a7c=_0x4308[_0x4a4b57];return _0x565a7c;};'use strict';var _=require(_0x8430('0x0'));var util=require(_0x8430('0x1'));var logger=require(_0x8430('0x2'))(_0x8430('0x3'));var moment=require(_0x8430('0x4'));var BPromise=require(_0x8430('0x5'));var rp=require(_0x8430('0x6'));var attributes=require(_0x8430('0x7'));module[_0x8430('0x8')]=function(_0x18a76a,_0x206041){return _0x18a76a['define']('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 5566e37..db97555 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 _0xfdf0=['register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','map','model','attributes','include','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','where','limit','stringify','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost'];(function(_0x474d1c,_0x7c5d8b){var _0x566cd2=function(_0x5de84e){while(--_0x5de84e){_0x474d1c['push'](_0x474d1c['shift']());}};_0x566cd2(++_0x7c5d8b);}(_0xfdf0,0xde));var _0x0fdf=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0xfdf0[_0x2af29a];return _0x5ef02f;};'use strict';var _=require('lodash');var util=require(_0x0fdf('0x0'));var moment=require('moment');var BPromise=require(_0x0fdf('0x1'));var rs=require(_0x0fdf('0x2'));var fs=require('fs');var Redis=require(_0x0fdf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0fdf('0x4'));var logger=require(_0x0fdf('0x5'))(_0x0fdf('0x6'));var config=require(_0x0fdf('0x7'));var jayson=require(_0x0fdf('0x8'));var client=jayson[_0x0fdf('0x9')]['http']({'port':0x232a});config[_0x0fdf('0xa')]=_['defaults'](config['redis'],{'host':_0x0fdf('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x0fdf('0xc')](socket);function respondWithRpcPromise(_0x5d375a,_0x18f26f,_0xbec894){return new BPromise(function(_0x4da3b0,_0x1865db){return client['request'](_0x5d375a,_0xbec894)[_0x0fdf('0xd')](function(_0x44b610){logger[_0x0fdf('0xe')](_0x0fdf('0xf'),_0x18f26f,_0x0fdf('0x10'));logger[_0x0fdf('0x11')](_0x0fdf('0x12'),_0x18f26f,_0x0fdf('0x10'),JSON['stringify'](_0x44b610));if(_0x44b610['error']){if(_0x44b610[_0x0fdf('0x13')]['code']===0x1f4){logger[_0x0fdf('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x18f26f,_0x44b610[_0x0fdf('0x13')][_0x0fdf('0x14')]);return _0x1865db(_0x44b610[_0x0fdf('0x13')][_0x0fdf('0x14')]);}logger[_0x0fdf('0x13')](_0x0fdf('0xf'),_0x18f26f,_0x44b610[_0x0fdf('0x13')][_0x0fdf('0x14')]);return _0x4da3b0(_0x44b610[_0x0fdf('0x13')][_0x0fdf('0x14')]);}else{logger[_0x0fdf('0xe')](_0x0fdf('0xf'),_0x18f26f,'request\x20sent');_0x4da3b0(_0x44b610[_0x0fdf('0x15')][_0x0fdf('0x14')]);}})[_0x0fdf('0x16')](function(_0x545aa4){logger[_0x0fdf('0x13')](_0x0fdf('0xf'),_0x18f26f,_0x545aa4);_0x1865db(_0x545aa4);});});}exports[_0x0fdf('0x17')]=function(_0x46458a){var _0x32cca3=this;return new Promise(function(_0x27d9c9,_0x329e23){return db[_0x0fdf('0x18')]['findAll']({'raw':_0x46458a[_0x0fdf('0x19')]?_0x46458a[_0x0fdf('0x19')][_0x0fdf('0x1a')]===undefined?!![]:![]:!![],'where':_0x46458a[_0x0fdf('0x19')]?_0x46458a[_0x0fdf('0x19')]['where']||null:null,'attributes':_0x46458a[_0x0fdf('0x19')]?_0x46458a[_0x0fdf('0x19')]['attributes']||null:null,'limit':_0x46458a[_0x0fdf('0x19')]?_0x46458a[_0x0fdf('0x19')]['limit']||null:null,'include':_0x46458a['options']?_0x46458a['options']['include']?_[_0x0fdf('0x1b')](_0x46458a['options']['include'],function(_0x39632c){return{'model':db[_0x39632c[_0x0fdf('0x1c')]],'as':_0x39632c['as'],'attributes':_0x39632c[_0x0fdf('0x1d')],'include':_0x39632c['include']?_[_0x0fdf('0x1b')](_0x39632c[_0x0fdf('0x1e')],function(_0x3f0379){return{'model':db[_0x3f0379['model']],'as':_0x3f0379['as'],'attributes':_0x3f0379[_0x0fdf('0x1d')],'include':_0x3f0379['include']?_[_0x0fdf('0x1b')](_0x3f0379[_0x0fdf('0x1e')],function(_0x25cdb6){return{'model':db[_0x25cdb6['model']],'as':_0x25cdb6['as'],'attributes':_0x25cdb6[_0x0fdf('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42d0bc){logger[_0x0fdf('0xe')]('GetVoiceQueueReport',_0x46458a);logger[_0x0fdf('0x11')](_0x0fdf('0x17'),_0x46458a,JSON['stringify'](_0x42d0bc));_0x27d9c9(_0x42d0bc);})[_0x0fdf('0x16')](function(_0x1ec96b){logger[_0x0fdf('0x13')](_0x0fdf('0x17'),_0x1ec96b[_0x0fdf('0x14')],_0x46458a);_0x329e23(_0x32cca3[_0x0fdf('0x13')](0x1f4,_0x1ec96b['message']));});});};exports[_0x0fdf('0x1f')]=function(_0x1bae25){var _0x2b42b6=this;return new Promise(function(_0x46a6dd,_0x39d1ef){return db['VoiceQueueReport'][_0x0fdf('0x20')](_0x1bae25[_0x0fdf('0x21')],{'raw':_0x1bae25[_0x0fdf('0x19')]?_0x1bae25[_0x0fdf('0x19')][_0x0fdf('0x1a')]===undefined?!![]:![]:!![]})[_0x0fdf('0xd')](function(_0x53b432){logger['info'](_0x0fdf('0x1f'),_0x1bae25);logger[_0x0fdf('0x11')](_0x0fdf('0x1f'),_0x1bae25,JSON['stringify'](_0x53b432));_0x46a6dd(_0x53b432);})['catch'](function(_0x41d769){logger[_0x0fdf('0x13')](_0x0fdf('0x1f'),_0x41d769[_0x0fdf('0x14')],_0x1bae25);_0x39d1ef(_0x2b42b6[_0x0fdf('0x13')](0x1f4,_0x41d769[_0x0fdf('0x14')]));});});};exports[_0x0fdf('0x22')]=function(_0xcad49){var _0x1eb8e3=this;return new Promise(function(_0x69cc1b,_0x18045d){return db[_0x0fdf('0x18')][_0x0fdf('0x23')](_0xcad49['body'],{'raw':_0xcad49[_0x0fdf('0x19')]?_0xcad49[_0x0fdf('0x19')][_0x0fdf('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcad49[_0x0fdf('0x19')]?_0xcad49['options'][_0x0fdf('0x24')]||null:null,'attributes':_0xcad49['options']?_0xcad49[_0x0fdf('0x19')][_0x0fdf('0x1d')]||null:null,'limit':_0xcad49[_0x0fdf('0x19')]?_0xcad49[_0x0fdf('0x19')][_0x0fdf('0x25')]||null:null})[_0x0fdf('0xd')](function(_0x636e1b){logger[_0x0fdf('0xe')]('UpdateVoiceQueueReport',_0xcad49);logger[_0x0fdf('0x11')]('UpdateVoiceQueueReport',_0xcad49,JSON[_0x0fdf('0x26')](_0x636e1b));_0x69cc1b(_0x636e1b);})[_0x0fdf('0x16')](function(_0x206c92){logger[_0x0fdf('0x13')](_0x0fdf('0x22'),_0x206c92['message'],_0xcad49);_0x18045d(_0x1eb8e3[_0x0fdf('0x13')](0x1f4,_0x206c92[_0x0fdf('0x14')]));});});}; \ No newline at end of file +var _0x7307=['VoiceQueueReport','findAll','options','map','include','model','attributes','CreateVoiceQueueReport','create','body','raw','stringify','update','where','limit','UpdateVoiceQueueReport','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','defaults','localhost','register','request','then','info','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport'];(function(_0x453bc4,_0x1a31a0){var _0x55476c=function(_0x52e2b3){while(--_0x52e2b3){_0x453bc4['push'](_0x453bc4['shift']());}};_0x55476c(++_0x1a31a0);}(_0x7307,0x85));var _0x7730=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x7307[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x7730('0x0'));var util=require('util');var moment=require(_0x7730('0x1'));var BPromise=require('bluebird');var rs=require(_0x7730('0x2'));var fs=require('fs');var Redis=require(_0x7730('0x3'));var db=require(_0x7730('0x4'))['db'];var utils=require(_0x7730('0x5'));var logger=require(_0x7730('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x7730('0x7')](config['redis'],{'host':_0x7730('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x7730('0x9')](socket);function respondWithRpcPromise(_0x5cb52f,_0x169962,_0x470298){return new BPromise(function(_0x4b4163,_0x57f41c){return client[_0x7730('0xa')](_0x5cb52f,_0x470298)[_0x7730('0xb')](function(_0x366717){logger[_0x7730('0xc')]('VoiceQueueReport,\x20%s,\x20%s',_0x169962,'request\x20sent');logger[_0x7730('0xd')](_0x7730('0xe'),_0x169962,_0x7730('0xf'),JSON['stringify'](_0x366717));if(_0x366717['error']){if(_0x366717['error'][_0x7730('0x10')]===0x1f4){logger[_0x7730('0x11')](_0x7730('0x12'),_0x169962,_0x366717[_0x7730('0x11')][_0x7730('0x13')]);return _0x57f41c(_0x366717[_0x7730('0x11')][_0x7730('0x13')]);}logger[_0x7730('0x11')](_0x7730('0x12'),_0x169962,_0x366717['error'][_0x7730('0x13')]);return _0x4b4163(_0x366717[_0x7730('0x11')][_0x7730('0x13')]);}else{logger[_0x7730('0xc')]('VoiceQueueReport,\x20%s,\x20%s',_0x169962,_0x7730('0xf'));_0x4b4163(_0x366717[_0x7730('0x14')][_0x7730('0x13')]);}})[_0x7730('0x15')](function(_0x25f3ea){logger[_0x7730('0x11')](_0x7730('0x12'),_0x169962,_0x25f3ea);_0x57f41c(_0x25f3ea);});});}exports[_0x7730('0x16')]=function(_0x308eb2){var _0x17c7f6=this;return new Promise(function(_0x2eb24f,_0x4b5539){return db[_0x7730('0x17')][_0x7730('0x18')]({'raw':_0x308eb2[_0x7730('0x19')]?_0x308eb2['options']['raw']===undefined?!![]:![]:!![],'where':_0x308eb2[_0x7730('0x19')]?_0x308eb2[_0x7730('0x19')]['where']||null:null,'attributes':_0x308eb2[_0x7730('0x19')]?_0x308eb2[_0x7730('0x19')]['attributes']||null:null,'limit':_0x308eb2['options']?_0x308eb2[_0x7730('0x19')]['limit']||null:null,'include':_0x308eb2[_0x7730('0x19')]?_0x308eb2['options']['include']?_[_0x7730('0x1a')](_0x308eb2[_0x7730('0x19')][_0x7730('0x1b')],function(_0x37868c){return{'model':db[_0x37868c[_0x7730('0x1c')]],'as':_0x37868c['as'],'attributes':_0x37868c[_0x7730('0x1d')],'include':_0x37868c[_0x7730('0x1b')]?_[_0x7730('0x1a')](_0x37868c['include'],function(_0x48c954){return{'model':db[_0x48c954[_0x7730('0x1c')]],'as':_0x48c954['as'],'attributes':_0x48c954[_0x7730('0x1d')],'include':_0x48c954[_0x7730('0x1b')]?_['map'](_0x48c954[_0x7730('0x1b')],function(_0x450ee3){return{'model':db[_0x450ee3[_0x7730('0x1c')]],'as':_0x450ee3['as'],'attributes':_0x450ee3[_0x7730('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7730('0xb')](function(_0x33dc65){logger['info'](_0x7730('0x16'),_0x308eb2);logger[_0x7730('0xd')]('GetVoiceQueueReport',_0x308eb2,JSON['stringify'](_0x33dc65));_0x2eb24f(_0x33dc65);})[_0x7730('0x15')](function(_0x10c50d){logger[_0x7730('0x11')]('GetVoiceQueueReport',_0x10c50d['message'],_0x308eb2);_0x4b5539(_0x17c7f6['error'](0x1f4,_0x10c50d[_0x7730('0x13')]));});});};exports[_0x7730('0x1e')]=function(_0x462f5c){var _0x5a9595=this;return new Promise(function(_0x54d58d,_0x3f5d1f){return db[_0x7730('0x17')][_0x7730('0x1f')](_0x462f5c[_0x7730('0x20')],{'raw':_0x462f5c[_0x7730('0x19')]?_0x462f5c[_0x7730('0x19')][_0x7730('0x21')]===undefined?!![]:![]:!![]})[_0x7730('0xb')](function(_0xd485e9){logger[_0x7730('0xc')](_0x7730('0x1e'),_0x462f5c);logger[_0x7730('0xd')](_0x7730('0x1e'),_0x462f5c,JSON[_0x7730('0x22')](_0xd485e9));_0x54d58d(_0xd485e9);})[_0x7730('0x15')](function(_0x30e836){logger[_0x7730('0x11')](_0x7730('0x1e'),_0x30e836['message'],_0x462f5c);_0x3f5d1f(_0x5a9595[_0x7730('0x11')](0x1f4,_0x30e836['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x96f85e){var _0x5ca10d=this;return new Promise(function(_0x530670,_0x49f9dc){return db['VoiceQueueReport'][_0x7730('0x23')](_0x96f85e[_0x7730('0x20')],{'raw':_0x96f85e[_0x7730('0x19')]?_0x96f85e[_0x7730('0x19')][_0x7730('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x96f85e[_0x7730('0x19')]?_0x96f85e[_0x7730('0x19')][_0x7730('0x24')]||null:null,'attributes':_0x96f85e[_0x7730('0x19')]?_0x96f85e[_0x7730('0x19')][_0x7730('0x1d')]||null:null,'limit':_0x96f85e[_0x7730('0x19')]?_0x96f85e[_0x7730('0x19')][_0x7730('0x25')]||null:null})[_0x7730('0xb')](function(_0x32440b){logger[_0x7730('0xc')](_0x7730('0x26'),_0x96f85e);logger[_0x7730('0xd')](_0x7730('0x26'),_0x96f85e,JSON[_0x7730('0x22')](_0x32440b));_0x530670(_0x32440b);})['catch'](function(_0x50807f){logger[_0x7730('0x11')](_0x7730('0x26'),_0x50807f['message'],_0x96f85e);_0x49f9dc(_0x5ca10d['error'](0x1f4,_0x50807f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 020cede..cd174a1 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 _0x3a40=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit'];(function(_0x333d4d,_0x50440f){var _0x21b5ca=function(_0x1c7080){while(--_0x1c7080){_0x333d4d['push'](_0x333d4d['shift']());}};_0x21b5ca(++_0x50440f);}(_0x3a40,0x1ab));var _0x03a4=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x3a40[_0x45d3f0];return _0x314b79;};'use strict';var VoiceQueueReportEvents=require(_0x03a4('0x0'));var events=[_0x03a4('0x1'),_0x03a4('0x2'),_0x03a4('0x3')];function createListener(_0x1c085b,_0x10c978){return function(_0xdfe205){_0x10c978[_0x03a4('0x4')](_0x1c085b,_0xdfe205);};}function removeListener(_0x318937,_0x2e15b0){return function(){VoiceQueueReportEvents[_0x03a4('0x5')](_0x318937,_0x2e15b0);};}exports[_0x03a4('0x6')]=function(_0xa10c61){for(var _0xb5b49b=0x0,_0x3480e7=events[_0x03a4('0x7')];_0xb5b49b<_0x3480e7;_0xb5b49b++){var _0x435a44=events[_0xb5b49b];var _0x258213=createListener(_0x03a4('0x8')+_0x435a44,_0xa10c61);VoiceQueueReportEvents['on'](_0x435a44,_0x258213);}}; \ No newline at end of file +var _0xe070=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','register'];(function(_0x2f15ef,_0x45e669){var _0x461234=function(_0x40ea87){while(--_0x40ea87){_0x2f15ef['push'](_0x2f15ef['shift']());}};_0x461234(++_0x45e669);}(_0xe070,0x167));var _0x0e07=function(_0x54cef6,_0x146b0e){_0x54cef6=_0x54cef6-0x0;var _0x39aacf=_0xe070[_0x54cef6];return _0x39aacf;};'use strict';var VoiceQueueReportEvents=require(_0x0e07('0x0'));var events=[_0x0e07('0x1'),_0x0e07('0x2'),_0x0e07('0x3')];function createListener(_0x4529ee,_0x3b6b10){return function(_0x20a8cc){_0x3b6b10['emit'](_0x4529ee,_0x20a8cc);};}function removeListener(_0x4a9411,_0x32c778){return function(){VoiceQueueReportEvents['removeListener'](_0x4a9411,_0x32c778);};}exports[_0x0e07('0x4')]=function(_0x25eda2){for(var _0x2426ea=0x0,_0x161dcb=events[_0x0e07('0x5')];_0x2426ea<_0x161dcb;_0x2426ea++){var _0x202584=events[_0x2426ea];var _0x20c35a=createListener(_0x0e07('0x6')+_0x202584,_0x25eda2);VoiceQueueReportEvents['on'](_0x202584,_0x20c35a);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 4be914e..8a2c9c1 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 _0x3646=['isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get'];(function(_0x4bb2bb,_0x2a87ff){var _0x563c1d=function(_0x6fe167){while(--_0x6fe167){_0x4bb2bb['push'](_0x4bb2bb['shift']());}};_0x563c1d(++_0x2a87ff);}(_0x3646,0x15f));var _0x6364=function(_0x4e2d39,_0x8937b3){_0x4e2d39=_0x4e2d39-0x0;var _0x373c55=_0x3646[_0x4e2d39];return _0x373c55;};'use strict';var multer=require(_0x6364('0x0'));var util=require(_0x6364('0x1'));var path=require(_0x6364('0x2'));var timeout=require(_0x6364('0x3'));var express=require('express');var router=express[_0x6364('0x4')]();var auth=require(_0x6364('0x5'));var interaction=require(_0x6364('0x6'));var config=require(_0x6364('0x7'));var controller=require(_0x6364('0x8'));router[_0x6364('0x9')]('/',auth[_0x6364('0xa')](),controller[_0x6364('0xb')]);router[_0x6364('0x9')](_0x6364('0xc'),auth[_0x6364('0xa')](),controller['show']);router[_0x6364('0xd')]('/',auth[_0x6364('0xa')](),controller[_0x6364('0xe')]);router[_0x6364('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6364('0x10')](_0x6364('0xc'),auth[_0x6364('0xa')](),controller[_0x6364('0x11')]);module[_0x6364('0x12')]=router; \ No newline at end of file +var _0x4d87=['put','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','create'];(function(_0x527cce,_0x5cfd75){var _0x2800e5=function(_0x2c6f81){while(--_0x2c6f81){_0x527cce['push'](_0x527cce['shift']());}};_0x2800e5(++_0x5cfd75);}(_0x4d87,0xf0));var _0x74d8=function(_0xdaf36c,_0x49e21a){_0xdaf36c=_0xdaf36c-0x0;var _0x4f3572=_0x4d87[_0xdaf36c];return _0x4f3572;};'use strict';var multer=require('multer');var util=require(_0x74d8('0x0'));var path=require(_0x74d8('0x1'));var timeout=require(_0x74d8('0x2'));var express=require('express');var router=express[_0x74d8('0x3')]();var auth=require(_0x74d8('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x74d8('0x5'));router[_0x74d8('0x6')]('/',auth[_0x74d8('0x7')](),controller[_0x74d8('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x74d8('0x9')]);router[_0x74d8('0xa')]('/',auth[_0x74d8('0x7')](),controller[_0x74d8('0xb')]);router[_0x74d8('0xc')](_0x74d8('0xd'),auth['isAuthenticated'](),controller[_0x74d8('0xe')]);router[_0x74d8('0xf')](_0x74d8('0xd'),auth[_0x74d8('0x7')](),controller[_0x74d8('0x10')]);module[_0x74d8('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index d18bf88..558ba5f 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 _0xac31=['moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x4523c2,_0x2fa13c){var _0x453dc2=function(_0x308913){while(--_0x308913){_0x4523c2['push'](_0x4523c2['shift']());}};_0x453dc2(++_0x2fa13c);}(_0xac31,0xca));var _0x1ac3=function(_0x12c23b,_0x22afdb){_0x12c23b=_0x12c23b-0x0;var _0x59d491=_0xac31[_0x12c23b];return _0x59d491;};'use strict';var Sequelize=require(_0x1ac3('0x0'));var moment=require(_0x1ac3('0x1'));module[_0x1ac3('0x2')]={'time':{'type':Sequelize[_0x1ac3('0x3')]},'callid':{'type':Sequelize[_0x1ac3('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x1ac3('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x1ac3('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x1ac3('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x1ac3('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x1ac3('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x1ac3('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x1ac3('0x4')],'allowNull':![],'defaultValue':moment()[_0x1ac3('0x5')](_0x1ac3('0x6'))}}; \ No newline at end of file +var _0x425d=['sequelize','exports','STRING','DATE','format'];(function(_0x53645c,_0x3f2dde){var _0x5a22ed=function(_0x1754fa){while(--_0x1754fa){_0x53645c['push'](_0x53645c['shift']());}};_0x5a22ed(++_0x3f2dde);}(_0x425d,0x1e0));var _0xd425=function(_0xad921d,_0x4e852b){_0xad921d=_0xad921d-0x0;var _0x50a737=_0x425d[_0xad921d];return _0x50a737;};'use strict';var Sequelize=require(_0xd425('0x0'));var moment=require('moment');module[_0xd425('0x1')]={'time':{'type':Sequelize[_0xd425('0x2')]},'callid':{'type':Sequelize[_0xd425('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd425('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd425('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xd425('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd425('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xd425('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xd425('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xd425('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd425('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd425('0x3')],'allowNull':![],'defaultValue':moment()[_0xd425('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 8fda84d..358469c 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 _0x90dd=['name','index','model','keys','query','attributes','fields','length','order','sort','where','filters','pick','merge','type','key','VIRTUAL','field','options','VoiceQueuesLog','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','stack'];(function(_0x1706c1,_0x4a31b5){var _0xbf92f9=function(_0x85497e){while(--_0x85497e){_0x1706c1['push'](_0x1706c1['shift']());}};_0xbf92f9(++_0x4a31b5);}(_0x90dd,0x19e));var _0xd90d=function(_0xec4050,_0x25b1dc){_0xec4050=_0xec4050-0x0;var _0x2d3ed7=_0x90dd[_0xec4050];return _0x2d3ed7;};'use strict';var pdf=require(_0xd90d('0x0'));var emlformat=require(_0xd90d('0x1'));var rimraf=require(_0xd90d('0x2'));var zipdir=require(_0xd90d('0x3'));var jsonpatch=require(_0xd90d('0x4'));var rp=require(_0xd90d('0x5'));var moment=require(_0xd90d('0x6'));var BPromise=require(_0xd90d('0x7'));var Mustache=require(_0xd90d('0x8'));var util=require(_0xd90d('0x9'));var path=require(_0xd90d('0xa'));var sox=require(_0xd90d('0xb'));var csv=require(_0xd90d('0xc'));var ejs=require(_0xd90d('0xd'));var fs=require('fs');var _=require(_0xd90d('0xe'));var squel=require(_0xd90d('0xf'));var crypto=require(_0xd90d('0x10'));var jsforce=require(_0xd90d('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xd90d('0xc'));var querystring=require(_0xd90d('0x12'));var Papa=require(_0xd90d('0x13'));var authService=require(_0xd90d('0x14'));var hardwareService=require(_0xd90d('0x15'));var Redis=require('ioredis');var qs=require(_0xd90d('0x16'));var logger=require(_0xd90d('0x17'))(_0xd90d('0x18'));var utils=require(_0xd90d('0x19'));var config=require(_0xd90d('0x1a'));var db=require(_0xd90d('0x1b'))['db'];function respondWithStatusCode(_0x274cf6,_0x2abbdd){_0x2abbdd=_0x2abbdd||0xcc;return function(_0x3aec05){if(_0x3aec05){return _0x274cf6[_0xd90d('0x1c')](_0x2abbdd);}return _0x274cf6[_0xd90d('0x1d')](_0x2abbdd)[_0xd90d('0x1e')]();};}function respondWithResult(_0xcbc9b7,_0x49e1e4){_0x49e1e4=_0x49e1e4||0xc8;return function(_0x5ca460){if(_0x5ca460){return _0xcbc9b7[_0xd90d('0x1d')](_0x49e1e4)['json'](_0x5ca460);}};}function respondWithFilteredResult(_0x2499ae,_0x34ae9f){return function(_0x5943cd){if(_0x5943cd){var _0x4aff53=_0x5943cd[_0xd90d('0x1f')],_0x2e3448=_0x34ae9f[_0xd90d('0x20')],_0x431714=_0x34ae9f['offset']+_0x34ae9f[_0xd90d('0x21')],_0x365196;if(_0x431714>=_0x4aff53){_0x431714=_0x4aff53;_0x365196=0xc8;}else{_0x365196=0xce;}_0x2499ae[_0xd90d('0x1d')](_0x365196);return _0x2499ae[_0xd90d('0x22')](_0xd90d('0x23'),_0x2e3448+'-'+_0x431714+'/'+_0x4aff53)[_0xd90d('0x24')](_0x5943cd);}return null;};}function patchUpdates(_0x413172){return function(_0x46c199){try{jsonpatch[_0xd90d('0x25')](_0x46c199,_0x413172,!![]);}catch(_0x292277){return BPromise[_0xd90d('0x26')](_0x292277);}return _0x46c199[_0xd90d('0x27')]();};}function saveUpdates(_0x3d0ce5,_0x5bf794){return function(_0x407809){if(_0x407809){return _0x407809[_0xd90d('0x28')](_0x3d0ce5)['then'](function(_0x31477d){return _0x31477d;});}return null;};}function removeEntity(_0x2bb7f6,_0xe13fa5){return function(_0x2e5ede){if(_0x2e5ede){return _0x2e5ede['destroy']()['then'](function(){_0x2bb7f6[_0xd90d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a58b3,_0xde437){return function(_0x44edde){if(!_0x44edde){_0x6a58b3[_0xd90d('0x1c')](0x194);}return _0x44edde;};}function handleError(_0x274405,_0x3c5d98){_0x3c5d98=_0x3c5d98||0x1f4;return function(_0x950ab9){logger['error'](_0x950ab9[_0xd90d('0x29')]);if(_0x950ab9[_0xd90d('0x2a')]){delete _0x950ab9[_0xd90d('0x2a')];}_0x274405[_0xd90d('0x1d')](_0x3c5d98)['send'](_0x950ab9);};}exports[_0xd90d('0x2b')]=function(_0x1c93d5,_0x2cde43){var _0x33bed8={},_0x394492={},_0x3674c1={'count':0x0,'rows':[]};var _0x2d8982=db['VoiceQueuesLog']['rawAttributes'];_0x394492[_0xd90d('0x2c')]=_[_0xd90d('0x2d')](_0x2d8982);_0x394492[_0xd90d('0x2e')]=_[_0xd90d('0x2d')](_0x1c93d5[_0xd90d('0x2e')]);_0x394492['filters']=_['intersection'](_0x394492[_0xd90d('0x2c')],_0x394492[_0xd90d('0x2e')]);_0x33bed8[_0xd90d('0x2f')]=_['intersection'](_0x394492['model'],qs[_0xd90d('0x30')](_0x1c93d5['query'][_0xd90d('0x30')]));_0x33bed8[_0xd90d('0x2f')]=_0x33bed8[_0xd90d('0x2f')][_0xd90d('0x31')]?_0x33bed8[_0xd90d('0x2f')]:_0x394492[_0xd90d('0x2c')];if(!_0x1c93d5['query']['hasOwnProperty']('nolimit')){_0x33bed8['limit']=qs[_0xd90d('0x21')](_0x1c93d5['query'][_0xd90d('0x21')]);_0x33bed8[_0xd90d('0x20')]=qs[_0xd90d('0x20')](_0x1c93d5['query']['offset']);}_0x33bed8[_0xd90d('0x32')]=qs[_0xd90d('0x33')](_0x1c93d5['query'][_0xd90d('0x33')]);_0x33bed8[_0xd90d('0x34')]=qs[_0xd90d('0x35')](_[_0xd90d('0x36')](_0x1c93d5[_0xd90d('0x2e')],_0x394492[_0xd90d('0x35')]));if(_0x1c93d5[_0xd90d('0x2e')]['filter']){_0x33bed8[_0xd90d('0x34')]=_[_0xd90d('0x37')](_0x33bed8['where'],{'$or':_['map'](_0x2d8982,function(_0x196a40){if(_0x196a40[_0xd90d('0x38')][_0xd90d('0x39')]!==_0xd90d('0x3a')){var _0x5193de={};_0x5193de[_0x196a40[_0xd90d('0x3b')]]={'$like':'%'+_0x1c93d5[_0xd90d('0x2e')]['filter']+'%'};return _0x5193de;}})});}_0x33bed8=_[_0xd90d('0x37')]({},_0x33bed8,_0x1c93d5[_0xd90d('0x3c')]);var _0x581ae3={'where':_0x33bed8['where']};return db[_0xd90d('0x3d')][_0xd90d('0x1f')](_0x581ae3)[_0xd90d('0x3e')](function(_0x5d53cc){_0x3674c1[_0xd90d('0x1f')]=_0x5d53cc;if(_0x1c93d5[_0xd90d('0x2e')][_0xd90d('0x3f')]){_0x33bed8[_0xd90d('0x40')]=[{'all':!![]}];}return db[_0xd90d('0x3d')][_0xd90d('0x41')](_0x33bed8);})[_0xd90d('0x3e')](function(_0x395214){_0x3674c1[_0xd90d('0x42')]=_0x395214;return _0x3674c1;})[_0xd90d('0x3e')](respondWithFilteredResult(_0x2cde43,_0x33bed8))[_0xd90d('0x43')](handleError(_0x2cde43,null));};exports[_0xd90d('0x44')]=function(_0x5c5d21,_0x302237){var _0x4636c6={'raw':!![],'where':{'id':_0x5c5d21[_0xd90d('0x45')]['id']}},_0x488165={};_0x488165[_0xd90d('0x2c')]=_['keys'](db['VoiceQueuesLog'][_0xd90d('0x46')]);_0x488165[_0xd90d('0x2e')]=_[_0xd90d('0x2d')](_0x5c5d21[_0xd90d('0x2e')]);_0x488165[_0xd90d('0x35')]=_[_0xd90d('0x47')](_0x488165[_0xd90d('0x2c')],_0x488165[_0xd90d('0x2e')]);_0x4636c6[_0xd90d('0x2f')]=_[_0xd90d('0x47')](_0x488165[_0xd90d('0x2c')],qs[_0xd90d('0x30')](_0x5c5d21[_0xd90d('0x2e')][_0xd90d('0x30')]));_0x4636c6[_0xd90d('0x2f')]=_0x4636c6['attributes']['length']?_0x4636c6[_0xd90d('0x2f')]:_0x488165[_0xd90d('0x2c')];if(_0x5c5d21[_0xd90d('0x2e')][_0xd90d('0x3f')]){_0x4636c6['include']=[{'all':!![]}];}_0x4636c6=_[_0xd90d('0x37')]({},_0x4636c6,_0x5c5d21[_0xd90d('0x3c')]);return db[_0xd90d('0x3d')][_0xd90d('0x48')](_0x4636c6)['then'](handleEntityNotFound(_0x302237,null))[_0xd90d('0x3e')](respondWithResult(_0x302237,null))['catch'](handleError(_0x302237,null));};exports['create']=function(_0x412ae0,_0x5e94f8){return db[_0xd90d('0x3d')][_0xd90d('0x49')](_0x412ae0[_0xd90d('0x4a')],{})['then'](respondWithResult(_0x5e94f8,0xc9))[_0xd90d('0x43')](handleError(_0x5e94f8,null));};exports[_0xd90d('0x28')]=function(_0x163f99,_0x70a560){if(_0x163f99[_0xd90d('0x4a')]['id']){delete _0x163f99[_0xd90d('0x4a')]['id'];}return db[_0xd90d('0x3d')][_0xd90d('0x48')]({'where':{'id':_0x163f99[_0xd90d('0x45')]['id']}})['then'](handleEntityNotFound(_0x70a560,null))[_0xd90d('0x3e')](saveUpdates(_0x163f99['body'],null))[_0xd90d('0x3e')](respondWithResult(_0x70a560,null))[_0xd90d('0x43')](handleError(_0x70a560,null));};exports[_0xd90d('0x4b')]=function(_0x5e3261,_0x4e9d42){return db[_0xd90d('0x3d')][_0xd90d('0x48')]({'where':{'id':_0x5e3261['params']['id']}})[_0xd90d('0x3e')](handleEntityNotFound(_0x4e9d42,null))[_0xd90d('0x3e')](removeEntity(_0x4e9d42,null))[_0xd90d('0x43')](handleError(_0x4e9d42,null));}; \ No newline at end of file +var _0x0e4c=['order','sort','pick','filter','where','merge','map','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','html-pdf','rimraf','path','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','status','end','json','offset','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','VoiceQueuesLog','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0e4c,0x147));var _0xc0e4=function(_0x9deaba,_0x3ef688){_0x9deaba=_0x9deaba-0x0;var _0x438d83=_0x0e4c[_0x9deaba];return _0x438d83;};'use strict';var pdf=require(_0xc0e4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc0e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc0e4('0x2'));var sox=require('sox');var csv=require(_0xc0e4('0x3'));var ejs=require(_0xc0e4('0x4'));var fs=require('fs');var _=require(_0xc0e4('0x5'));var squel=require(_0xc0e4('0x6'));var crypto=require(_0xc0e4('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc0e4('0x8'));var authService=require(_0xc0e4('0x9'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xc0e4('0xa'));var logger=require(_0xc0e4('0xb'))('api');var utils=require(_0xc0e4('0xc'));var config=require(_0xc0e4('0xd'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1381e3,_0x111c95){_0x111c95=_0x111c95||0xcc;return function(_0x5be137){if(_0x5be137){return _0x1381e3['sendStatus'](_0x111c95);}return _0x1381e3[_0xc0e4('0xe')](_0x111c95)[_0xc0e4('0xf')]();};}function respondWithResult(_0x56c767,_0x38b0d4){_0x38b0d4=_0x38b0d4||0xc8;return function(_0x3ba550){if(_0x3ba550){return _0x56c767['status'](_0x38b0d4)[_0xc0e4('0x10')](_0x3ba550);}};}function respondWithFilteredResult(_0x281130,_0x46b9de){return function(_0x3e3e84){if(_0x3e3e84){var _0x3dae58=_0x3e3e84['count'],_0x28c151=_0x46b9de[_0xc0e4('0x11')],_0x5099e6=_0x46b9de[_0xc0e4('0x11')]+_0x46b9de['limit'],_0x3a5269;if(_0x5099e6>=_0x3dae58){_0x5099e6=_0x3dae58;_0x3a5269=0xc8;}else{_0x3a5269=0xce;}_0x281130[_0xc0e4('0xe')](_0x3a5269);return _0x281130['set']('Content-Range',_0x28c151+'-'+_0x5099e6+'/'+_0x3dae58)[_0xc0e4('0x10')](_0x3e3e84);}return null;};}function patchUpdates(_0xffa9d8){return function(_0x14c43b){try{jsonpatch[_0xc0e4('0x12')](_0x14c43b,_0xffa9d8,!![]);}catch(_0x1f7cc2){return BPromise[_0xc0e4('0x13')](_0x1f7cc2);}return _0x14c43b['save']();};}function saveUpdates(_0x57a6ff,_0xa40c6a){return function(_0x5eb8e4){if(_0x5eb8e4){return _0x5eb8e4[_0xc0e4('0x14')](_0x57a6ff)[_0xc0e4('0x15')](function(_0x1bdfe0){return _0x1bdfe0;});}return null;};}function removeEntity(_0x3756ab,_0x4d4dd4){return function(_0x57ce14){if(_0x57ce14){return _0x57ce14[_0xc0e4('0x16')]()[_0xc0e4('0x15')](function(){_0x3756ab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x380b14,_0xa44c6a){return function(_0x191fc6){if(!_0x191fc6){_0x380b14[_0xc0e4('0x17')](0x194);}return _0x191fc6;};}function handleError(_0x1ceff3,_0xf939f3){_0xf939f3=_0xf939f3||0x1f4;return function(_0x43fa11){logger[_0xc0e4('0x18')](_0x43fa11[_0xc0e4('0x19')]);if(_0x43fa11[_0xc0e4('0x1a')]){delete _0x43fa11[_0xc0e4('0x1a')];}_0x1ceff3['status'](_0xf939f3)['send'](_0x43fa11);};}exports[_0xc0e4('0x1b')]=function(_0x4e09b7,_0x32e252){var _0x1a3675={},_0x1310b0={},_0x50de49={'count':0x0,'rows':[]};var _0x185584=db[_0xc0e4('0x1c')]['rawAttributes'];_0x1310b0[_0xc0e4('0x1d')]=_[_0xc0e4('0x1e')](_0x185584);_0x1310b0[_0xc0e4('0x1f')]=_[_0xc0e4('0x1e')](_0x4e09b7[_0xc0e4('0x1f')]);_0x1310b0[_0xc0e4('0x20')]=_[_0xc0e4('0x21')](_0x1310b0[_0xc0e4('0x1d')],_0x1310b0['query']);_0x1a3675[_0xc0e4('0x22')]=_[_0xc0e4('0x21')](_0x1310b0[_0xc0e4('0x1d')],qs[_0xc0e4('0x23')](_0x4e09b7['query']['fields']));_0x1a3675['attributes']=_0x1a3675[_0xc0e4('0x22')]['length']?_0x1a3675[_0xc0e4('0x22')]:_0x1310b0[_0xc0e4('0x1d')];if(!_0x4e09b7['query'][_0xc0e4('0x24')](_0xc0e4('0x25'))){_0x1a3675[_0xc0e4('0x26')]=qs['limit'](_0x4e09b7[_0xc0e4('0x1f')][_0xc0e4('0x26')]);_0x1a3675['offset']=qs[_0xc0e4('0x11')](_0x4e09b7['query'][_0xc0e4('0x11')]);}_0x1a3675[_0xc0e4('0x27')]=qs[_0xc0e4('0x28')](_0x4e09b7[_0xc0e4('0x1f')][_0xc0e4('0x28')]);_0x1a3675['where']=qs[_0xc0e4('0x20')](_[_0xc0e4('0x29')](_0x4e09b7['query'],_0x1310b0['filters']));if(_0x4e09b7[_0xc0e4('0x1f')][_0xc0e4('0x2a')]){_0x1a3675[_0xc0e4('0x2b')]=_[_0xc0e4('0x2c')](_0x1a3675[_0xc0e4('0x2b')],{'$or':_[_0xc0e4('0x2d')](_0x185584,function(_0x25b7e3){if(_0x25b7e3['type']['key']!==_0xc0e4('0x2e')){var _0x5d6d1b={};_0x5d6d1b[_0x25b7e3[_0xc0e4('0x2f')]]={'$like':'%'+_0x4e09b7[_0xc0e4('0x1f')][_0xc0e4('0x2a')]+'%'};return _0x5d6d1b;}})});}_0x1a3675=_['merge']({},_0x1a3675,_0x4e09b7[_0xc0e4('0x30')]);var _0x1b2d7a={'where':_0x1a3675[_0xc0e4('0x2b')]};return db['VoiceQueuesLog'][_0xc0e4('0x31')](_0x1b2d7a)['then'](function(_0x3b6120){_0x50de49[_0xc0e4('0x31')]=_0x3b6120;if(_0x4e09b7[_0xc0e4('0x1f')][_0xc0e4('0x32')]){_0x1a3675['include']=[{'all':!![]}];}return db[_0xc0e4('0x1c')][_0xc0e4('0x33')](_0x1a3675);})['then'](function(_0x5944af){_0x50de49[_0xc0e4('0x34')]=_0x5944af;return _0x50de49;})['then'](respondWithFilteredResult(_0x32e252,_0x1a3675))[_0xc0e4('0x35')](handleError(_0x32e252,null));};exports[_0xc0e4('0x36')]=function(_0x3b0b4b,_0x1bca20){var _0x3cec8a={'raw':!![],'where':{'id':_0x3b0b4b['params']['id']}},_0x1c78f8={};_0x1c78f8[_0xc0e4('0x1d')]=_['keys'](db[_0xc0e4('0x1c')]['rawAttributes']);_0x1c78f8[_0xc0e4('0x1f')]=_[_0xc0e4('0x1e')](_0x3b0b4b[_0xc0e4('0x1f')]);_0x1c78f8[_0xc0e4('0x20')]=_['intersection'](_0x1c78f8[_0xc0e4('0x1d')],_0x1c78f8[_0xc0e4('0x1f')]);_0x3cec8a[_0xc0e4('0x22')]=_[_0xc0e4('0x21')](_0x1c78f8[_0xc0e4('0x1d')],qs[_0xc0e4('0x23')](_0x3b0b4b[_0xc0e4('0x1f')][_0xc0e4('0x23')]));_0x3cec8a[_0xc0e4('0x22')]=_0x3cec8a['attributes'][_0xc0e4('0x37')]?_0x3cec8a['attributes']:_0x1c78f8[_0xc0e4('0x1d')];if(_0x3b0b4b[_0xc0e4('0x1f')][_0xc0e4('0x32')]){_0x3cec8a[_0xc0e4('0x38')]=[{'all':!![]}];}_0x3cec8a=_[_0xc0e4('0x2c')]({},_0x3cec8a,_0x3b0b4b[_0xc0e4('0x30')]);return db['VoiceQueuesLog'][_0xc0e4('0x39')](_0x3cec8a)[_0xc0e4('0x15')](handleEntityNotFound(_0x1bca20,null))[_0xc0e4('0x15')](respondWithResult(_0x1bca20,null))[_0xc0e4('0x35')](handleError(_0x1bca20,null));};exports['create']=function(_0x57e967,_0x86712a){return db[_0xc0e4('0x1c')][_0xc0e4('0x3a')](_0x57e967[_0xc0e4('0x3b')],{})[_0xc0e4('0x15')](respondWithResult(_0x86712a,0xc9))[_0xc0e4('0x35')](handleError(_0x86712a,null));};exports[_0xc0e4('0x14')]=function(_0x42c122,_0x364ba8){if(_0x42c122[_0xc0e4('0x3b')]['id']){delete _0x42c122[_0xc0e4('0x3b')]['id'];}return db[_0xc0e4('0x1c')]['find']({'where':{'id':_0x42c122[_0xc0e4('0x3c')]['id']}})[_0xc0e4('0x15')](handleEntityNotFound(_0x364ba8,null))[_0xc0e4('0x15')](saveUpdates(_0x42c122['body'],null))[_0xc0e4('0x15')](respondWithResult(_0x364ba8,null))['catch'](handleError(_0x364ba8,null));};exports['destroy']=function(_0x3e6150,_0x56860f){return db['VoiceQueuesLog'][_0xc0e4('0x39')]({'where':{'id':_0x3e6150['params']['id']}})['then'](handleEntityNotFound(_0x56860f,null))[_0xc0e4('0x15')](removeEntity(_0x56860f,null))[_0xc0e4('0x35')](handleError(_0x56860f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 4d31de3..3eb0dac 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 _0x3d74=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','define','voice_queues_log','event_dtm','dtm'];(function(_0x135a4f,_0x433ee2){var _0x3399fb=function(_0x5a2e4f){while(--_0x5a2e4f){_0x135a4f['push'](_0x135a4f['shift']());}};_0x3399fb(++_0x433ee2);}(_0x3d74,0x6c));var _0x43d7=function(_0x1ac702,_0x44b5a6){_0x1ac702=_0x1ac702-0x0;var _0x527d33=_0x3d74[_0x1ac702];return _0x527d33;};'use strict';var _=require(_0x43d7('0x0'));var util=require(_0x43d7('0x1'));var logger=require(_0x43d7('0x2'))(_0x43d7('0x3'));var moment=require(_0x43d7('0x4'));var BPromise=require(_0x43d7('0x5'));var rp=require(_0x43d7('0x6'));var attributes=require('./voiceQueuesLog.attributes');module[_0x43d7('0x7')]=function(_0x2fd5ae,_0x27994b){return _0x2fd5ae[_0x43d7('0x8')]('VoiceQueuesLog',attributes,{'tableName':_0x43d7('0x9'),'paranoid':![],'indexes':[{'name':_0x43d7('0xa'),'fields':['event',_0x43d7('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe36e=['VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','../../config/logger','api','moment','bluebird','request-promise','./voiceQueuesLog.attributes','exports'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0xe36e,0xbb));var _0xee36=function(_0x68a5f6,_0x449395){_0x68a5f6=_0x68a5f6-0x0;var _0x37c018=_0xe36e[_0x68a5f6];return _0x37c018;};'use strict';var _=require(_0xee36('0x0'));var util=require('util');var logger=require(_0xee36('0x1'))(_0xee36('0x2'));var moment=require(_0xee36('0x3'));var BPromise=require(_0xee36('0x4'));var rp=require(_0xee36('0x5'));var attributes=require(_0xee36('0x6'));module[_0xee36('0x7')]=function(_0x2320b0,_0x3e269a){return _0x2320b0['define'](_0xee36('0x8'),attributes,{'tableName':_0xee36('0x9'),'paranoid':![],'indexes':[{'name':_0xee36('0xa'),'fields':[_0xee36('0xb'),_0xee36('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 0244c20..d74a5cd 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 _0x6212=['stringify','error','code','message','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x5891a7,_0x300d29){var _0x4c7ffb=function(_0x9330e0){while(--_0x9330e0){_0x5891a7['push'](_0x5891a7['shift']());}};_0x4c7ffb(++_0x300d29);}(_0x6212,0x1d2));var _0x2621=function(_0x2f9b5a,_0x59950a){_0x2f9b5a=_0x2f9b5a-0x0;var _0x95dce2=_0x6212[_0x2f9b5a];return _0x95dce2;};'use strict';var _=require('lodash');var util=require(_0x2621('0x0'));var moment=require(_0x2621('0x1'));var BPromise=require(_0x2621('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2621('0x3'));var db=require(_0x2621('0x4'))['db'];var utils=require(_0x2621('0x5'));var logger=require(_0x2621('0x6'))(_0x2621('0x7'));var config=require(_0x2621('0x8'));var jayson=require(_0x2621('0x9'));var client=jayson[_0x2621('0xa')][_0x2621('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b592e,_0x2b4e5f,_0x6f5719){return new BPromise(function(_0x2ff86d,_0x1e4010){return client[_0x2621('0xc')](_0x4b592e,_0x6f5719)[_0x2621('0xd')](function(_0x3583d5){logger[_0x2621('0xe')](_0x2621('0xf'),_0x2b4e5f,_0x2621('0x10'));logger['debug'](_0x2621('0x11'),_0x2b4e5f,_0x2621('0x10'),JSON[_0x2621('0x12')](_0x3583d5));if(_0x3583d5[_0x2621('0x13')]){if(_0x3583d5[_0x2621('0x13')][_0x2621('0x14')]===0x1f4){logger[_0x2621('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2b4e5f,_0x3583d5['error'][_0x2621('0x15')]);return _0x1e4010(_0x3583d5[_0x2621('0x13')][_0x2621('0x15')]);}logger['error'](_0x2621('0xf'),_0x2b4e5f,_0x3583d5['error']['message']);return _0x2ff86d(_0x3583d5[_0x2621('0x13')][_0x2621('0x15')]);}else{logger[_0x2621('0xe')](_0x2621('0xf'),_0x2b4e5f,'request\x20sent');_0x2ff86d(_0x3583d5['result'][_0x2621('0x15')]);}})['catch'](function(_0x4defc9){logger[_0x2621('0x13')](_0x2621('0xf'),_0x2b4e5f,_0x4defc9);_0x1e4010(_0x4defc9);});});} \ No newline at end of file +var _0x5eef=['error','message','result','catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x5eef,0x9c));var _0xf5ee=function(_0x1f45ed,_0x5b682a){_0x1f45ed=_0x1f45ed-0x0;var _0xf6f0d3=_0x5eef[_0x1f45ed];return _0xf6f0d3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf5ee('0x0'));var BPromise=require('bluebird');var rs=require(_0xf5ee('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5ee('0x2'))['db'];var utils=require(_0xf5ee('0x3'));var logger=require(_0xf5ee('0x4'))(_0xf5ee('0x5'));var config=require(_0xf5ee('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ae819,_0x24e3a5,_0x4f0e34){return new BPromise(function(_0x31c9d8,_0x2e4224){return client[_0xf5ee('0x7')](_0x3ae819,_0x4f0e34)[_0xf5ee('0x8')](function(_0x125def){logger[_0xf5ee('0x9')](_0xf5ee('0xa'),_0x24e3a5,_0xf5ee('0xb'));logger[_0xf5ee('0xc')](_0xf5ee('0xd'),_0x24e3a5,'request\x20sent',JSON[_0xf5ee('0xe')](_0x125def));if(_0x125def['error']){if(_0x125def[_0xf5ee('0xf')]['code']===0x1f4){logger[_0xf5ee('0xf')](_0xf5ee('0xa'),_0x24e3a5,_0x125def[_0xf5ee('0xf')][_0xf5ee('0x10')]);return _0x2e4224(_0x125def['error'][_0xf5ee('0x10')]);}logger[_0xf5ee('0xf')](_0xf5ee('0xa'),_0x24e3a5,_0x125def[_0xf5ee('0xf')]['message']);return _0x31c9d8(_0x125def['error'][_0xf5ee('0x10')]);}else{logger[_0xf5ee('0x9')](_0xf5ee('0xa'),_0x24e3a5,_0xf5ee('0xb'));_0x31c9d8(_0x125def[_0xf5ee('0x11')]['message']);}})[_0xf5ee('0x12')](function(_0x21a35c){logger['error'](_0xf5ee('0xa'),_0x24e3a5,_0x21a35c);_0x2e4224(_0x21a35c);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 0191a53..b936037 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 _0xd404=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id/download','download','/:id/downloads','downloads','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0xd404,0x15b));var _0x4d40=function(_0x19cf99,_0x2e2acd){_0x19cf99=_0x19cf99-0x0;var _0x42898b=_0xd404[_0x19cf99];return _0x42898b;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var auth=require(_0x4d40('0x4'));var interaction=require(_0x4d40('0x5'));var config=require(_0x4d40('0x6'));var controller=require(_0x4d40('0x7'));router[_0x4d40('0x8')]('/',auth[_0x4d40('0x9')](),controller[_0x4d40('0xa')]);router[_0x4d40('0x8')](_0x4d40('0xb'),auth['isAuthenticated'](),controller[_0x4d40('0xc')]);router[_0x4d40('0x8')]('/:id',auth[_0x4d40('0x9')](),controller['show']);router['get'](_0x4d40('0xd'),auth[_0x4d40('0x9')](),controller[_0x4d40('0xe')]);router[_0x4d40('0x8')](_0x4d40('0xf'),controller[_0x4d40('0x10')]);router[_0x4d40('0x11')]('/',auth[_0x4d40('0x9')](),controller[_0x4d40('0x12')]);router[_0x4d40('0x13')](_0x4d40('0x14'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x15')]);router[_0x4d40('0x16')]('/:id',auth[_0x4d40('0x9')](),controller[_0x4d40('0x17')]);module[_0x4d40('0x18')]=router; \ No newline at end of file +var _0x2750=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/downloads','downloads','post','put','destroy','exports'];(function(_0x40379a,_0x15434b){var _0x480494=function(_0x1ae411){while(--_0x1ae411){_0x40379a['push'](_0x40379a['shift']());}};_0x480494(++_0x15434b);}(_0x2750,0x13b));var _0x0275=function(_0x3ff1a2,_0xeae663){_0x3ff1a2=_0x3ff1a2-0x0;var _0x4ac537=_0x2750[_0x3ff1a2];return _0x4ac537;};'use strict';var multer=require(_0x0275('0x0'));var util=require('util');var path=require(_0x0275('0x1'));var timeout=require(_0x0275('0x2'));var express=require(_0x0275('0x3'));var router=express[_0x0275('0x4')]();var auth=require(_0x0275('0x5'));var interaction=require(_0x0275('0x6'));var config=require(_0x0275('0x7'));var controller=require(_0x0275('0x8'));router[_0x0275('0x9')]('/',auth[_0x0275('0xa')](),controller['index']);router[_0x0275('0x9')](_0x0275('0xb'),auth[_0x0275('0xa')](),controller[_0x0275('0xc')]);router['get'](_0x0275('0xd'),auth[_0x0275('0xa')](),controller[_0x0275('0xe')]);router['get']('/:id/download',auth[_0x0275('0xa')](),controller['download']);router[_0x0275('0x9')](_0x0275('0xf'),controller[_0x0275('0x10')]);router[_0x0275('0x11')]('/',auth[_0x0275('0xa')](),controller['create']);router[_0x0275('0x12')](_0x0275('0xd'),auth[_0x0275('0xa')](),controller['update']);router['delete'](_0x0275('0xd'),auth[_0x0275('0xa')](),controller[_0x0275('0x13')]);module[_0x0275('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 9843eb3..139b696 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 _0xae85=['DATE','createdAt','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','path','exports','getDataValue','value','extname','STRING','setDataValue','membername','split'];(function(_0x13dd42,_0xa348e2){var _0x4ce234=function(_0x5e349f){while(--_0x5e349f){_0x13dd42['push'](_0x13dd42['shift']());}};_0x4ce234(++_0xa348e2);}(_0xae85,0x104));var _0x5ae8=function(_0x272166,_0xcd9a1a){_0x272166=_0x272166-0x0;var _0x395e1a=_0xae85[_0x272166];return _0x395e1a;};'use strict';var Sequelize=require(_0x5ae8('0x0'));var moment=require('moment');var path=require(_0x5ae8('0x1'));module[_0x5ae8('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x5ae8('0x3')](_0x5ae8('0x4'))?path[_0x5ae8('0x5')](this[_0x5ae8('0x3')](_0x5ae8('0x4'))):undefined;}},'uniqueid':{'type':Sequelize[_0x5ae8('0x6')]},'channel':{'type':Sequelize[_0x5ae8('0x6')],'set':function(_0xa5586c){if(_0xa5586c){this['setDataValue']('channel',_0xa5586c);this[_0x5ae8('0x7')](_0x5ae8('0x8'),_0xa5586c[_0x5ae8('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x5ae8('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5ae8('0x6')]},'connectedlinenum':{'type':Sequelize[_0x5ae8('0x6')]},'connectedlinename':{'type':Sequelize[_0x5ae8('0x6')]},'accountcode':{'type':Sequelize[_0x5ae8('0x6')]},'context':{'type':Sequelize[_0x5ae8('0x6')]},'exten':{'type':Sequelize[_0x5ae8('0x6')]},'value':{'type':Sequelize[_0x5ae8('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x5ae8('0x6')]},'userDisposition':{'type':Sequelize[_0x5ae8('0x6')]},'createdAt':{'type':Sequelize[_0x5ae8('0xa')],'get':function(){return moment(this[_0x5ae8('0x3')](_0x5ae8('0xb')))['format'](_0x5ae8('0xc'))[_0x5ae8('0xd')]();}},'updatedAt':{'type':Sequelize[_0x5ae8('0xa')],'get':function(){return moment(this[_0x5ae8('0x3')](_0x5ae8('0xe')))['format'](_0x5ae8('0xc'))[_0x5ae8('0xd')]();}}}; \ No newline at end of file +var _0xe30f=['createdAt','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','sequelize','moment','path','exports','VIRTUAL','extname','getDataValue','value','STRING','setDataValue','membername','split','INTEGER'];(function(_0x333707,_0x30b5a1){var _0x1538ea=function(_0x5df00e){while(--_0x5df00e){_0x333707['push'](_0x333707['shift']());}};_0x1538ea(++_0x30b5a1);}(_0xe30f,0x1bb));var _0xfe30=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe30f[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xfe30('0x0'));var moment=require(_0xfe30('0x1'));var path=require(_0xfe30('0x2'));module[_0xfe30('0x3')]={'format':{'type':Sequelize[_0xfe30('0x4')],'get':function(){return this['getDataValue']('value')?path[_0xfe30('0x5')](this[_0xfe30('0x6')](_0xfe30('0x7'))):undefined;}},'uniqueid':{'type':Sequelize[_0xfe30('0x8')]},'channel':{'type':Sequelize[_0xfe30('0x8')],'set':function(_0x5c9257){if(_0x5c9257){this[_0xfe30('0x9')]('channel',_0x5c9257);this[_0xfe30('0x9')](_0xfe30('0xa'),_0x5c9257[_0xfe30('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xfe30('0x8')]},'calleridnum':{'type':Sequelize[_0xfe30('0x8')]},'calleridname':{'type':Sequelize[_0xfe30('0x8')]},'connectedlinenum':{'type':Sequelize[_0xfe30('0x8')]},'connectedlinename':{'type':Sequelize[_0xfe30('0x8')]},'accountcode':{'type':Sequelize[_0xfe30('0x8')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xfe30('0x8')]},'type':{'type':Sequelize[_0xfe30('0x8')]},'rating':{'type':Sequelize[_0xfe30('0xc')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xfe30('0x8')]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xfe30('0xd')))[_0xfe30('0xe')](_0xfe30('0xf'))[_0xfe30('0x10')]();}},'updatedAt':{'type':Sequelize[_0xfe30('0x11')],'get':function(){return moment(this[_0xfe30('0x6')](_0xfe30('0x12')))[_0xfe30('0xe')](_0xfe30('0xf'))[_0xfe30('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 1bfc9c0..904577c 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 _0x01c8=['ValidationError','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','VoiceRecording','rawAttributes','model','differenceBy','format','query','keys','filters','fields','attributes','length','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','recording','Sequelize','VoiceRecording\x20not\x20found','filename','download','extname','unlink','downloads','sequelize','MD5','col','token','$and','push','decryptFile'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x01c8,0x189));var _0x801c=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x01c8[_0x36dfbd];return _0x4ecad9;};'use strict';var pdf=require(_0x801c('0x0'));var emlformat=require(_0x801c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x801c('0x2'));var jsonpatch=require(_0x801c('0x3'));var rp=require('request-promise');var moment=require(_0x801c('0x4'));var BPromise=require(_0x801c('0x5'));var Mustache=require(_0x801c('0x6'));var util=require('util');var path=require(_0x801c('0x7'));var sox=require('sox');var csv=require(_0x801c('0x8'));var ejs=require(_0x801c('0x9'));var fs=require('fs');var _=require(_0x801c('0xa'));var squel=require(_0x801c('0xb'));var crypto=require(_0x801c('0xc'));var jsforce=require(_0x801c('0xd'));var deskjs=require(_0x801c('0xe'));var toCsv=require(_0x801c('0x8'));var querystring=require(_0x801c('0xf'));var Papa=require(_0x801c('0x10'));var authService=require(_0x801c('0x11'));var hardwareService=require(_0x801c('0x12'));var Redis=require(_0x801c('0x13'));var qs=require(_0x801c('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x801c('0x15'));var config=require(_0x801c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51334c,_0x24d15f){_0x24d15f=_0x24d15f||0xcc;return function(_0x1d895b){if(_0x1d895b){return _0x51334c[_0x801c('0x17')](_0x24d15f);}return _0x51334c[_0x801c('0x18')](_0x24d15f)[_0x801c('0x19')]();};}function respondWithResult(_0x2bdd0c,_0x5d174d){_0x5d174d=_0x5d174d||0xc8;return function(_0x586cc0){if(_0x586cc0){return _0x2bdd0c[_0x801c('0x18')](_0x5d174d)[_0x801c('0x1a')](_0x586cc0);}};}function respondWithFilteredResult(_0x368da0,_0x525b05){return function(_0xf5d080){if(_0xf5d080){var _0x545987=_0xf5d080['count'],_0x145cdb=_0x525b05[_0x801c('0x1b')],_0x2ca870=_0x525b05[_0x801c('0x1b')]+_0x525b05['limit'],_0x37fe40;if(_0x2ca870>=_0x545987){_0x2ca870=_0x545987;_0x37fe40=0xc8;}else{_0x37fe40=0xce;}_0x368da0[_0x801c('0x18')](_0x37fe40);return _0x368da0[_0x801c('0x1c')]('Content-Range',_0x145cdb+'-'+_0x2ca870+'/'+_0x545987)[_0x801c('0x1a')](_0xf5d080);}return null;};}function patchUpdates(_0x4c46d8){return function(_0x3265f7){try{jsonpatch[_0x801c('0x1d')](_0x3265f7,_0x4c46d8,!![]);}catch(_0x4f2377){return BPromise[_0x801c('0x1e')](_0x4f2377);}return _0x3265f7[_0x801c('0x1f')]();};}function saveUpdates(_0x37a24c,_0x4ea835){return function(_0x7e4b91){if(_0x7e4b91){return _0x7e4b91[_0x801c('0x20')](_0x37a24c)[_0x801c('0x21')](function(_0x1548a9){return _0x1548a9;});}return null;};}function removeEntity(_0x2f9d7d,_0x2f8d47){return function(_0x5436a5){if(_0x5436a5){return _0x5436a5[_0x801c('0x22')]()[_0x801c('0x21')](function(){_0x2f9d7d['status'](0xcc)[_0x801c('0x19')]();});}};}function handleEntityNotFound(_0x319fa6,_0x316a51){return function(_0x5db1ea){if(!_0x5db1ea){_0x319fa6[_0x801c('0x17')](0x194);}return _0x5db1ea;};}function handleError(_0x1413fe,_0x466d7e){_0x466d7e=_0x466d7e||0x1f4;return function(_0x41ca20){logger[_0x801c('0x23')](_0x41ca20[_0x801c('0x24')]);if(_0x41ca20[_0x801c('0x25')]){delete _0x41ca20[_0x801c('0x25')];}_0x1413fe['status'](_0x466d7e)[_0x801c('0x26')](_0x41ca20);};}exports['index']=function(_0x55acf7,_0x31ba40){var _0x433970={},_0x2a8059={},_0x3fda9b={'count':0x0,'rows':[]};var _0x3d54c7=db[_0x801c('0x27')][_0x801c('0x28')];_0x2a8059[_0x801c('0x29')]=_[_0x801c('0x2a')](_['keys'](_0x3d54c7),[_0x801c('0x2b')]);_0x2a8059[_0x801c('0x2c')]=_[_0x801c('0x2d')](_0x55acf7['query']);_0x2a8059[_0x801c('0x2e')]=_['intersection'](_0x2a8059['model'],_0x2a8059['query']);_0x433970['attributes']=_['intersection'](_0x2a8059['model'],qs[_0x801c('0x2f')](_0x55acf7[_0x801c('0x2c')][_0x801c('0x2f')]));_0x433970['attributes']=_0x433970[_0x801c('0x30')][_0x801c('0x31')]?_0x433970[_0x801c('0x30')]:_0x2a8059['model'];if(!_0x55acf7['query']['hasOwnProperty'](_0x801c('0x32'))){_0x433970[_0x801c('0x33')]=qs[_0x801c('0x33')](_0x55acf7[_0x801c('0x2c')]['limit']);_0x433970[_0x801c('0x1b')]=qs[_0x801c('0x1b')](_0x55acf7[_0x801c('0x2c')][_0x801c('0x1b')]);}_0x433970[_0x801c('0x34')]=qs['sort'](_0x55acf7['query'][_0x801c('0x35')]);_0x433970['where']=qs['filters'](_[_0x801c('0x36')](_0x55acf7[_0x801c('0x2c')],_0x2a8059[_0x801c('0x2e')]));if(_0x55acf7[_0x801c('0x2c')][_0x801c('0x37')]){_0x433970[_0x801c('0x38')]=_[_0x801c('0x39')](_0x433970['where'],{'$or':_[_0x801c('0x3a')](_0x3d54c7,function(_0x41c4c8){if(_0x41c4c8[_0x801c('0x3b')][_0x801c('0x3c')]!==_0x801c('0x3d')){var _0x238a02={};_0x238a02[_0x41c4c8[_0x801c('0x3e')]]={'$like':'%'+_0x55acf7[_0x801c('0x2c')]['filter']+'%'};return _0x238a02;}})});}_0x433970=_[_0x801c('0x39')]({},_0x433970,_0x55acf7[_0x801c('0x3f')]);var _0x16934b={'where':_0x433970['where']};return db['VoiceRecording'][_0x801c('0x40')](_0x16934b)[_0x801c('0x21')](function(_0x58f162){_0x3fda9b[_0x801c('0x40')]=_0x58f162;if(_0x55acf7['query'][_0x801c('0x41')]){_0x433970[_0x801c('0x42')]=[{'all':!![]}];}return db[_0x801c('0x27')][_0x801c('0x43')](_0x433970);})[_0x801c('0x21')](function(_0x181e58){_0x3fda9b[_0x801c('0x44')]=_0x181e58;return _0x3fda9b;})['then'](respondWithFilteredResult(_0x31ba40,_0x433970))[_0x801c('0x45')](handleError(_0x31ba40,null));};exports[_0x801c('0x46')]=function(_0x1155a3,_0x2f9476){var _0x3bc033={'raw':![],'where':{'id':_0x1155a3[_0x801c('0x47')]['id']}},_0x20169e={};_0x20169e[_0x801c('0x29')]=_[_0x801c('0x2d')](db[_0x801c('0x27')][_0x801c('0x28')]);_0x20169e[_0x801c('0x2c')]=_[_0x801c('0x2d')](_0x1155a3[_0x801c('0x2c')]);_0x20169e[_0x801c('0x2e')]=_[_0x801c('0x48')](_0x20169e['model'],_0x20169e[_0x801c('0x2c')]);_0x3bc033[_0x801c('0x30')]=_[_0x801c('0x48')](_0x20169e['model'],qs[_0x801c('0x2f')](_0x1155a3[_0x801c('0x2c')]['fields']));_0x3bc033['attributes']=_0x3bc033[_0x801c('0x30')]['length']?_0x3bc033[_0x801c('0x30')]:_0x20169e['model'];if(_0x1155a3[_0x801c('0x2c')][_0x801c('0x41')]){_0x3bc033[_0x801c('0x42')]=[{'all':!![]}];}_0x3bc033=_['merge']({},_0x3bc033,_0x1155a3[_0x801c('0x3f')]);return db[_0x801c('0x27')][_0x801c('0x49')](_0x3bc033)[_0x801c('0x21')](handleEntityNotFound(_0x2f9476,null))['then'](respondWithResult(_0x2f9476,null))[_0x801c('0x45')](handleError(_0x2f9476,null));};exports['create']=function(_0x337756,_0x118fc1){return db[_0x801c('0x27')][_0x801c('0x4a')](_0x337756[_0x801c('0x4b')],{})[_0x801c('0x21')](respondWithResult(_0x118fc1,0xc9))['catch'](handleError(_0x118fc1,null));};exports['update']=function(_0x37d892,_0x259773){if(_0x37d892[_0x801c('0x4b')]['id']){delete _0x37d892['body']['id'];}return db[_0x801c('0x27')]['find']({'where':{'id':_0x37d892[_0x801c('0x47')]['id']}})['then'](handleEntityNotFound(_0x259773,null))[_0x801c('0x21')](saveUpdates(_0x37d892[_0x801c('0x4b')],null))['then'](respondWithResult(_0x259773,null))[_0x801c('0x45')](handleError(_0x259773,null));};exports[_0x801c('0x22')]=function(_0x26bdc2,_0x66af29){return db[_0x801c('0x27')]['find']({'where':{'id':_0x26bdc2[_0x801c('0x47')]['id']}})[_0x801c('0x21')](handleEntityNotFound(_0x66af29,null))[_0x801c('0x21')](removeEntity(_0x66af29,null))[_0x801c('0x45')](handleError(_0x66af29,null));};exports[_0x801c('0x4c')]=function(_0xff0901,_0x4232aa){return db[_0x801c('0x27')][_0x801c('0x4c')]()[_0x801c('0x21')](respondWithResult(_0x4232aa,null))[_0x801c('0x45')](handleError(_0x4232aa,null));};exports['download']=function(_0x1241b7,_0x3b18db,_0x121e8a){var _0x524e94=require(_0x801c('0x4d'));var _0xd2b1b7=![];var _0x3e4f5a={};if(_0x1241b7[_0x801c('0x2c')]['type']&&_0x1241b7['query']['type']===_0x801c('0x4e')){_0x3e4f5a[_0x801c('0x4e')]=_0x1241b7[_0x801c('0x47')]['id'];}else{_0x3e4f5a['id']=_0x1241b7[_0x801c('0x47')]['id'];}return db[_0x801c('0x27')][_0x801c('0x49')]({'where':_0x3e4f5a,'attributes':['id',_0x801c('0x4f')],'raw':!![]})[_0x801c('0x21')](handleEntityNotFound(_0x3b18db,null))[_0x801c('0x21')](function(_0x4b1a9f){if(_0x4b1a9f){var _0xcefd3c=util[_0x801c('0x2b')](_0x801c('0x50'),_0x4b1a9f[_0x801c('0x4f')]);if(fs[_0x801c('0x51')](_0xcefd3c)){_0xd2b1b7=!![];return _0x524e94['decryptFile'](_0xcefd3c,_0x4b1a9f[_0x801c('0x4f')],config['secrets'][_0x801c('0x52')])[_0x801c('0x21')](function(){return _0x4b1a9f;});}return _0x4b1a9f;}})[_0x801c('0x21')](function(_0x27f8c4){if(_0x27f8c4){if(!fs[_0x801c('0x51')](_0x27f8c4['value'])){throw new db[(_0x801c('0x53'))]['ValidationError'](_0x801c('0x54'));}if(_0x27f8c4[_0x801c('0x55')]){return _0x3b18db[_0x801c('0x56')](_0x27f8c4[_0x801c('0x4f')],_0x27f8c4[_0x801c('0x55')]+path[_0x801c('0x57')](_0x27f8c4[_0x801c('0x4f')]),function(){if(_0xd2b1b7){fs[_0x801c('0x58')](_0x27f8c4[_0x801c('0x4f')]);}});}else{return _0x3b18db['download'](_0x27f8c4[_0x801c('0x4f')],function(_0x8f4d96){if(_0xd2b1b7){fs[_0x801c('0x58')](_0x27f8c4[_0x801c('0x4f')]);}});}}})[_0x801c('0x45')](handleError(_0x3b18db,null));};exports[_0x801c('0x59')]=function(_0x1833bc,_0xcc54b3,_0x4de912){var _0x39692d=require(_0x801c('0x4d'));var _0x4dbe08=![];var _0x7c1d4f={'$and':[db[_0x801c('0x5a')][_0x801c('0x38')](db['sequelize']['fn'](_0x801c('0x5b'),db[_0x801c('0x5a')][_0x801c('0x5c')](_0x801c('0x4e'))),_0x1833bc['query'][_0x801c('0x5d')])]};if(_0x1833bc[_0x801c('0x2c')][_0x801c('0x3b')]&&_0x1833bc[_0x801c('0x2c')][_0x801c('0x3b')]===_0x801c('0x4e')){_0x7c1d4f[_0x801c('0x5e')][_0x801c('0x5f')]({'uniqueid':_0x1833bc['params']['id']});}else{_0x7c1d4f[_0x801c('0x5e')][_0x801c('0x5f')]({'id':_0x1833bc[_0x801c('0x47')]['id']});}return db['VoiceRecording'][_0x801c('0x49')]({'where':_0x7c1d4f,'attributes':['id','value'],'raw':!![]})[_0x801c('0x21')](handleEntityNotFound(_0xcc54b3,null))[_0x801c('0x21')](function(_0x27eebb){if(_0x27eebb){var _0x98f107=util[_0x801c('0x2b')]('%s.cypher',_0x27eebb['value']);if(fs[_0x801c('0x51')](_0x98f107)){_0x4dbe08=!![];return _0x39692d[_0x801c('0x60')](_0x98f107,_0x27eebb[_0x801c('0x4f')],config['secrets'][_0x801c('0x52')])[_0x801c('0x21')](function(){return _0x27eebb;});}return _0x27eebb;}})['then'](function(_0x198a09){if(_0x198a09){if(!fs[_0x801c('0x51')](_0x198a09[_0x801c('0x4f')])){throw new db[(_0x801c('0x53'))][(_0x801c('0x61'))](_0x801c('0x54'));}if(_0x198a09[_0x801c('0x55')]){return _0xcc54b3['download'](_0x198a09['value'],_0x198a09['filename']+path[_0x801c('0x57')](_0x198a09[_0x801c('0x4f')]),function(){if(_0x4dbe08){fs[_0x801c('0x58')](_0x198a09[_0x801c('0x4f')]);}});}else{return _0xcc54b3[_0x801c('0x56')](_0x198a09[_0x801c('0x4f')],function(_0x57243f){if(_0x4dbe08){fs[_0x801c('0x58')](_0x198a09['value']);}});}}})[_0x801c('0x45')](handleError(_0xcc54b3,null));}; \ No newline at end of file +var _0xda01=['decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','downloads','sequelize','col','uniqueid','token','push','$and','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','error','name','send','index','VoiceRecording','rawAttributes','model','differenceBy','keys','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','download','../../components/encryptor','value','%s.cypher'];(function(_0x2af4e5,_0x422895){var _0x1fdbec=function(_0x4cdade){while(--_0x4cdade){_0x2af4e5['push'](_0x2af4e5['shift']());}};_0x1fdbec(++_0x422895);}(_0xda01,0x12e));var _0x1da0=function(_0x2e9afb,_0x405cfb){_0x2e9afb=_0x2e9afb-0x0;var _0x49a943=_0xda01[_0x2e9afb];return _0x49a943;};'use strict';var pdf=require(_0x1da0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1da0('0x1'));var zipdir=require(_0x1da0('0x2'));var jsonpatch=require(_0x1da0('0x3'));var rp=require('request-promise');var moment=require(_0x1da0('0x4'));var BPromise=require(_0x1da0('0x5'));var Mustache=require(_0x1da0('0x6'));var util=require(_0x1da0('0x7'));var path=require(_0x1da0('0x8'));var sox=require('sox');var csv=require(_0x1da0('0x9'));var ejs=require(_0x1da0('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1da0('0xb'));var jsforce=require(_0x1da0('0xc'));var deskjs=require(_0x1da0('0xd'));var toCsv=require(_0x1da0('0x9'));var querystring=require('querystring');var Papa=require(_0x1da0('0xe'));var authService=require(_0x1da0('0xf'));var hardwareService=require(_0x1da0('0x10'));var Redis=require(_0x1da0('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x1da0('0x12'))(_0x1da0('0x13'));var utils=require(_0x1da0('0x14'));var config=require('../../config/environment');var db=require(_0x1da0('0x15'))['db'];function respondWithStatusCode(_0x14ca4c,_0xe406a0){_0xe406a0=_0xe406a0||0xcc;return function(_0x3b7f40){if(_0x3b7f40){return _0x14ca4c[_0x1da0('0x16')](_0xe406a0);}return _0x14ca4c[_0x1da0('0x17')](_0xe406a0)[_0x1da0('0x18')]();};}function respondWithResult(_0x3369ce,_0x31fc41){_0x31fc41=_0x31fc41||0xc8;return function(_0x1189e6){if(_0x1189e6){return _0x3369ce[_0x1da0('0x17')](_0x31fc41)[_0x1da0('0x19')](_0x1189e6);}};}function respondWithFilteredResult(_0x420f14,_0x4af859){return function(_0x2f1ea5){if(_0x2f1ea5){var _0x29a3e4=_0x2f1ea5[_0x1da0('0x1a')],_0x4c501b=_0x4af859[_0x1da0('0x1b')],_0x4133fc=_0x4af859[_0x1da0('0x1b')]+_0x4af859[_0x1da0('0x1c')],_0x1b7600;if(_0x4133fc>=_0x29a3e4){_0x4133fc=_0x29a3e4;_0x1b7600=0xc8;}else{_0x1b7600=0xce;}_0x420f14['status'](_0x1b7600);return _0x420f14[_0x1da0('0x1d')](_0x1da0('0x1e'),_0x4c501b+'-'+_0x4133fc+'/'+_0x29a3e4)['json'](_0x2f1ea5);}return null;};}function patchUpdates(_0xba7f0a){return function(_0x25fbe8){try{jsonpatch[_0x1da0('0x1f')](_0x25fbe8,_0xba7f0a,!![]);}catch(_0xa0270){return BPromise[_0x1da0('0x20')](_0xa0270);}return _0x25fbe8['save']();};}function saveUpdates(_0x77aef8,_0x57d2ed){return function(_0x7018f7){if(_0x7018f7){return _0x7018f7[_0x1da0('0x21')](_0x77aef8)[_0x1da0('0x22')](function(_0x3cafd0){return _0x3cafd0;});}return null;};}function removeEntity(_0x5c03e1,_0x3534cf){return function(_0x40ee41){if(_0x40ee41){return _0x40ee41['destroy']()[_0x1da0('0x22')](function(){_0x5c03e1[_0x1da0('0x17')](0xcc)[_0x1da0('0x18')]();});}};}function handleEntityNotFound(_0x43ba58,_0x103f74){return function(_0xd0f0ab){if(!_0xd0f0ab){_0x43ba58[_0x1da0('0x16')](0x194);}return _0xd0f0ab;};}function handleError(_0x485830,_0x17759a){_0x17759a=_0x17759a||0x1f4;return function(_0x57d79d){logger[_0x1da0('0x23')](_0x57d79d['stack']);if(_0x57d79d[_0x1da0('0x24')]){delete _0x57d79d[_0x1da0('0x24')];}_0x485830['status'](_0x17759a)[_0x1da0('0x25')](_0x57d79d);};}exports[_0x1da0('0x26')]=function(_0x2ea60c,_0x2e13bf){var _0x2e561f={},_0x2271f6={},_0x914436={'count':0x0,'rows':[]};var _0x397a0b=db[_0x1da0('0x27')][_0x1da0('0x28')];_0x2271f6[_0x1da0('0x29')]=_[_0x1da0('0x2a')](_[_0x1da0('0x2b')](_0x397a0b),[_0x1da0('0x2c')]);_0x2271f6[_0x1da0('0x2d')]=_[_0x1da0('0x2b')](_0x2ea60c[_0x1da0('0x2d')]);_0x2271f6[_0x1da0('0x2e')]=_[_0x1da0('0x2f')](_0x2271f6[_0x1da0('0x29')],_0x2271f6[_0x1da0('0x2d')]);_0x2e561f[_0x1da0('0x30')]=_[_0x1da0('0x2f')](_0x2271f6[_0x1da0('0x29')],qs[_0x1da0('0x31')](_0x2ea60c['query'][_0x1da0('0x31')]));_0x2e561f['attributes']=_0x2e561f[_0x1da0('0x30')][_0x1da0('0x32')]?_0x2e561f[_0x1da0('0x30')]:_0x2271f6['model'];if(!_0x2ea60c[_0x1da0('0x2d')][_0x1da0('0x33')](_0x1da0('0x34'))){_0x2e561f[_0x1da0('0x1c')]=qs['limit'](_0x2ea60c[_0x1da0('0x2d')][_0x1da0('0x1c')]);_0x2e561f[_0x1da0('0x1b')]=qs['offset'](_0x2ea60c['query'][_0x1da0('0x1b')]);}_0x2e561f[_0x1da0('0x35')]=qs['sort'](_0x2ea60c['query'][_0x1da0('0x36')]);_0x2e561f[_0x1da0('0x37')]=qs[_0x1da0('0x2e')](_[_0x1da0('0x38')](_0x2ea60c[_0x1da0('0x2d')],_0x2271f6[_0x1da0('0x2e')]));if(_0x2ea60c[_0x1da0('0x2d')][_0x1da0('0x39')]){_0x2e561f[_0x1da0('0x37')]=_[_0x1da0('0x3a')](_0x2e561f['where'],{'$or':_[_0x1da0('0x3b')](_0x397a0b,function(_0x41571a){if(_0x41571a['type'][_0x1da0('0x3c')]!==_0x1da0('0x3d')){var _0x43bc04={};_0x43bc04[_0x41571a['field']]={'$like':'%'+_0x2ea60c[_0x1da0('0x2d')][_0x1da0('0x39')]+'%'};return _0x43bc04;}})});}_0x2e561f=_[_0x1da0('0x3a')]({},_0x2e561f,_0x2ea60c[_0x1da0('0x3e')]);var _0x47ebe4={'where':_0x2e561f[_0x1da0('0x37')]};return db[_0x1da0('0x27')][_0x1da0('0x1a')](_0x47ebe4)[_0x1da0('0x22')](function(_0xe9bdd0){_0x914436[_0x1da0('0x1a')]=_0xe9bdd0;if(_0x2ea60c['query'][_0x1da0('0x3f')]){_0x2e561f[_0x1da0('0x40')]=[{'all':!![]}];}return db[_0x1da0('0x27')][_0x1da0('0x41')](_0x2e561f);})[_0x1da0('0x22')](function(_0x2502ca){_0x914436[_0x1da0('0x42')]=_0x2502ca;return _0x914436;})[_0x1da0('0x22')](respondWithFilteredResult(_0x2e13bf,_0x2e561f))[_0x1da0('0x43')](handleError(_0x2e13bf,null));};exports[_0x1da0('0x44')]=function(_0x53938c,_0xd7b9b1){var _0x401a84={'raw':![],'where':{'id':_0x53938c[_0x1da0('0x45')]['id']}},_0x2153f5={};_0x2153f5[_0x1da0('0x29')]=_['keys'](db[_0x1da0('0x27')][_0x1da0('0x28')]);_0x2153f5[_0x1da0('0x2d')]=_[_0x1da0('0x2b')](_0x53938c[_0x1da0('0x2d')]);_0x2153f5[_0x1da0('0x2e')]=_[_0x1da0('0x2f')](_0x2153f5[_0x1da0('0x29')],_0x2153f5[_0x1da0('0x2d')]);_0x401a84[_0x1da0('0x30')]=_[_0x1da0('0x2f')](_0x2153f5[_0x1da0('0x29')],qs[_0x1da0('0x31')](_0x53938c['query'][_0x1da0('0x31')]));_0x401a84[_0x1da0('0x30')]=_0x401a84[_0x1da0('0x30')]['length']?_0x401a84[_0x1da0('0x30')]:_0x2153f5['model'];if(_0x53938c[_0x1da0('0x2d')][_0x1da0('0x3f')]){_0x401a84[_0x1da0('0x40')]=[{'all':!![]}];}_0x401a84=_[_0x1da0('0x3a')]({},_0x401a84,_0x53938c[_0x1da0('0x3e')]);return db[_0x1da0('0x27')]['find'](_0x401a84)[_0x1da0('0x22')](handleEntityNotFound(_0xd7b9b1,null))[_0x1da0('0x22')](respondWithResult(_0xd7b9b1,null))[_0x1da0('0x43')](handleError(_0xd7b9b1,null));};exports[_0x1da0('0x46')]=function(_0x2cf78a,_0x35b4d1){return db['VoiceRecording'][_0x1da0('0x46')](_0x2cf78a[_0x1da0('0x47')],{})[_0x1da0('0x22')](respondWithResult(_0x35b4d1,0xc9))[_0x1da0('0x43')](handleError(_0x35b4d1,null));};exports[_0x1da0('0x21')]=function(_0x1bf1a4,_0x2ea9bb){if(_0x1bf1a4['body']['id']){delete _0x1bf1a4[_0x1da0('0x47')]['id'];}return db[_0x1da0('0x27')]['find']({'where':{'id':_0x1bf1a4[_0x1da0('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ea9bb,null))[_0x1da0('0x22')](saveUpdates(_0x1bf1a4['body'],null))[_0x1da0('0x22')](respondWithResult(_0x2ea9bb,null))[_0x1da0('0x43')](handleError(_0x2ea9bb,null));};exports['destroy']=function(_0x273a6a,_0x10d1ed){return db[_0x1da0('0x27')][_0x1da0('0x48')]({'where':{'id':_0x273a6a['params']['id']}})[_0x1da0('0x22')](handleEntityNotFound(_0x10d1ed,null))[_0x1da0('0x22')](removeEntity(_0x10d1ed,null))[_0x1da0('0x43')](handleError(_0x10d1ed,null));};exports[_0x1da0('0x49')]=function(_0x3e92d1,_0x12167d){return db['VoiceRecording'][_0x1da0('0x49')]()['then'](respondWithResult(_0x12167d,null))[_0x1da0('0x43')](handleError(_0x12167d,null));};exports[_0x1da0('0x4a')]=function(_0x37a91b,_0x48f60f,_0x51564b){var _0xd6ab5c=require(_0x1da0('0x4b'));var _0x507810=![];var _0xc0da3e={};if(_0x37a91b[_0x1da0('0x2d')]['type']&&_0x37a91b[_0x1da0('0x2d')]['type']==='uniqueid'){_0xc0da3e['uniqueid']=_0x37a91b[_0x1da0('0x45')]['id'];}else{_0xc0da3e['id']=_0x37a91b['params']['id'];}return db['VoiceRecording'][_0x1da0('0x48')]({'where':_0xc0da3e,'attributes':['id',_0x1da0('0x4c')],'raw':!![]})[_0x1da0('0x22')](handleEntityNotFound(_0x48f60f,null))[_0x1da0('0x22')](function(_0x3dd53c){if(_0x3dd53c){var _0x2c810b=util['format'](_0x1da0('0x4d'),_0x3dd53c[_0x1da0('0x4c')]);if(fs['existsSync'](_0x2c810b)){_0x507810=!![];return _0xd6ab5c[_0x1da0('0x4e')](_0x2c810b,_0x3dd53c[_0x1da0('0x4c')],config[_0x1da0('0x4f')][_0x1da0('0x50')])[_0x1da0('0x22')](function(){return _0x3dd53c;});}return _0x3dd53c;}})[_0x1da0('0x22')](function(_0xb30555){if(_0xb30555){if(!fs[_0x1da0('0x51')](_0xb30555[_0x1da0('0x4c')])){throw new db[(_0x1da0('0x52'))][(_0x1da0('0x53'))](_0x1da0('0x54'));}if(_0xb30555[_0x1da0('0x55')]){return _0x48f60f[_0x1da0('0x4a')](_0xb30555['value'],_0xb30555[_0x1da0('0x55')]+path[_0x1da0('0x56')](_0xb30555[_0x1da0('0x4c')]),function(){if(_0x507810){fs[_0x1da0('0x57')](_0xb30555[_0x1da0('0x4c')]);}});}else{return _0x48f60f['download'](_0xb30555[_0x1da0('0x4c')],function(_0x5317e2){if(_0x507810){fs[_0x1da0('0x57')](_0xb30555[_0x1da0('0x4c')]);}});}}})[_0x1da0('0x43')](handleError(_0x48f60f,null));};exports[_0x1da0('0x58')]=function(_0x175d00,_0x54d812,_0x2da0de){var _0x2d13de=require(_0x1da0('0x4b'));var _0x5698c7=![];var _0x564332={'$and':[db[_0x1da0('0x59')]['where'](db[_0x1da0('0x59')]['fn']('MD5',db[_0x1da0('0x59')][_0x1da0('0x5a')](_0x1da0('0x5b'))),_0x175d00[_0x1da0('0x2d')][_0x1da0('0x5c')])]};if(_0x175d00[_0x1da0('0x2d')]['type']&&_0x175d00['query']['type']===_0x1da0('0x5b')){_0x564332['$and'][_0x1da0('0x5d')]({'uniqueid':_0x175d00[_0x1da0('0x45')]['id']});}else{_0x564332[_0x1da0('0x5e')]['push']({'id':_0x175d00[_0x1da0('0x45')]['id']});}return db[_0x1da0('0x27')][_0x1da0('0x48')]({'where':_0x564332,'attributes':['id',_0x1da0('0x4c')],'raw':!![]})[_0x1da0('0x22')](handleEntityNotFound(_0x54d812,null))[_0x1da0('0x22')](function(_0x3f28c8){if(_0x3f28c8){var _0xb8c016=util[_0x1da0('0x2c')](_0x1da0('0x4d'),_0x3f28c8['value']);if(fs[_0x1da0('0x51')](_0xb8c016)){_0x5698c7=!![];return _0x2d13de[_0x1da0('0x4e')](_0xb8c016,_0x3f28c8[_0x1da0('0x4c')],config['secrets'][_0x1da0('0x50')])[_0x1da0('0x22')](function(){return _0x3f28c8;});}return _0x3f28c8;}})[_0x1da0('0x22')](function(_0x107ccf){if(_0x107ccf){if(!fs[_0x1da0('0x51')](_0x107ccf[_0x1da0('0x4c')])){throw new db[(_0x1da0('0x52'))][(_0x1da0('0x53'))]('VoiceRecording\x20not\x20found');}if(_0x107ccf[_0x1da0('0x55')]){return _0x54d812[_0x1da0('0x4a')](_0x107ccf['value'],_0x107ccf[_0x1da0('0x55')]+path['extname'](_0x107ccf[_0x1da0('0x4c')]),function(){if(_0x5698c7){fs[_0x1da0('0x57')](_0x107ccf[_0x1da0('0x4c')]);}});}else{return _0x54d812[_0x1da0('0x4a')](_0x107ccf[_0x1da0('0x4c')],function(_0x4efae1){if(_0x5698c7){fs[_0x1da0('0x57')](_0x107ccf['value']);}});}}})['catch'](handleError(_0x54d812,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 4ab79da..cea72df 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 _0xaa72=['exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xd422b8,_0x2e2db7){var _0x172168=function(_0x281581){while(--_0x281581){_0xd422b8['push'](_0xd422b8['shift']());}};_0x172168(++_0x2e2db7);}(_0xaa72,0xe1));var _0x2aa7=function(_0x2867dc,_0x54fda2){_0x2867dc=_0x2867dc-0x0;var _0x302dbe=_0xaa72[_0x2867dc];return _0x302dbe;};'use strict';var _=require(_0x2aa7('0x0'));var util=require(_0x2aa7('0x1'));var logger=require(_0x2aa7('0x2'))(_0x2aa7('0x3'));var moment=require('moment');var BPromise=require(_0x2aa7('0x4'));var rp=require(_0x2aa7('0x5'));var attributes=require('./voiceRecording.attributes');module[_0x2aa7('0x6')]=function(_0x50cbde,_0x318f8d){return _0x50cbde[_0x2aa7('0x7')](_0x2aa7('0x8'),attributes,{'tableName':_0x2aa7('0x9'),'paranoid':![],'indexes':[{'name':_0x2aa7('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xccb2=['uniqueid','lodash','api','request-promise','./voiceRecording.attributes','exports','define','voice_recordings'];(function(_0x18fce8,_0x390211){var _0x1da9d7=function(_0x3ef1d0){while(--_0x3ef1d0){_0x18fce8['push'](_0x18fce8['shift']());}};_0x1da9d7(++_0x390211);}(_0xccb2,0x181));var _0x2ccb=function(_0x1670d9,_0x3e0f5c){_0x1670d9=_0x1670d9-0x0;var _0x2647ab=_0xccb2[_0x1670d9];return _0x2647ab;};'use strict';var _=require(_0x2ccb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2ccb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2ccb('0x2'));var attributes=require(_0x2ccb('0x3'));module[_0x2ccb('0x4')]=function(_0x111c15,_0x12a2d0){return _0x111c15[_0x2ccb('0x5')]('VoiceRecording',attributes,{'tableName':_0x2ccb('0x6'),'paranoid':![],'indexes':[{'name':_0x2ccb('0x7'),'fields':[_0x2ccb('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index fe89cdb..cd32f27 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 _0xea3f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','limit','../../components/encryptor','Setting','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording'];(function(_0x4bd39c,_0x494e05){var _0x114411=function(_0x4574ba){while(--_0x4574ba){_0x4bd39c['push'](_0x4bd39c['shift']());}};_0x114411(++_0x494e05);}(_0xea3f,0xb4));var _0xfea3=function(_0x55e1d1,_0x3c9376){_0x55e1d1=_0x55e1d1-0x0;var _0x1165db=_0xea3f[_0x55e1d1];return _0x1165db;};'use strict';var _=require(_0xfea3('0x0'));var util=require(_0xfea3('0x1'));var moment=require(_0xfea3('0x2'));var BPromise=require(_0xfea3('0x3'));var rs=require(_0xfea3('0x4'));var fs=require('fs');var Redis=require(_0xfea3('0x5'));var db=require(_0xfea3('0x6'))['db'];var utils=require(_0xfea3('0x7'));var logger=require('../../config/logger')(_0xfea3('0x8'));var config=require(_0xfea3('0x9'));var jayson=require(_0xfea3('0xa'));var client=jayson[_0xfea3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x427328,_0x1285db,_0xffb963){return new BPromise(function(_0x1ce856,_0x468902){return client['request'](_0x427328,_0xffb963)[_0xfea3('0xc')](function(_0x3f3150){logger[_0xfea3('0xd')](_0xfea3('0xe'),_0x1285db,'request\x20sent');logger[_0xfea3('0xf')](_0xfea3('0x10'),_0x1285db,_0xfea3('0x11'),JSON[_0xfea3('0x12')](_0x3f3150));if(_0x3f3150[_0xfea3('0x13')]){if(_0x3f3150[_0xfea3('0x13')][_0xfea3('0x14')]===0x1f4){logger['error'](_0xfea3('0xe'),_0x1285db,_0x3f3150[_0xfea3('0x13')][_0xfea3('0x15')]);return _0x468902(_0x3f3150['error']['message']);}logger[_0xfea3('0x13')](_0xfea3('0xe'),_0x1285db,_0x3f3150[_0xfea3('0x13')][_0xfea3('0x15')]);return _0x1ce856(_0x3f3150['error'][_0xfea3('0x15')]);}else{logger[_0xfea3('0xd')](_0xfea3('0xe'),_0x1285db,_0xfea3('0x11'));_0x1ce856(_0x3f3150[_0xfea3('0x16')][_0xfea3('0x15')]);}})[_0xfea3('0x17')](function(_0x4f2561){logger[_0xfea3('0x13')](_0xfea3('0xe'),_0x1285db,_0x4f2561);_0x468902(_0x4f2561);});});}exports[_0xfea3('0x18')]=function(_0x5f1bb7){var _0x3feb1d=this;return new Promise(function(_0x36f62c,_0x149392){return db[_0xfea3('0x19')]['update'](_0x5f1bb7[_0xfea3('0x1a')],{'raw':_0x5f1bb7[_0xfea3('0x1b')]?_0x5f1bb7[_0xfea3('0x1b')][_0xfea3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f1bb7['options']?_0x5f1bb7[_0xfea3('0x1b')][_0xfea3('0x1d')]||null:null,'attributes':_0x5f1bb7[_0xfea3('0x1b')]?_0x5f1bb7[_0xfea3('0x1b')]['attributes']||null:null,'limit':_0x5f1bb7[_0xfea3('0x1b')]?_0x5f1bb7[_0xfea3('0x1b')][_0xfea3('0x1e')]||null:null})['then'](function(_0x5ab7f6){logger[_0xfea3('0xd')](_0xfea3('0x18'),_0x5f1bb7);logger[_0xfea3('0xf')](_0xfea3('0x18'),_0x5f1bb7,JSON[_0xfea3('0x12')](_0x5ab7f6));_0x36f62c(_0x5ab7f6);})[_0xfea3('0x17')](function(_0x541469){logger['error']('UpdateVoiceRecording',_0x541469[_0xfea3('0x15')],_0x5f1bb7);_0x149392(_0x3feb1d['error'](0x1f4,_0x541469['message']));});});};exports['CreateVoiceRecording']=function(_0x5e407d){var _0x5b9fb7=this;return new Promise(function(_0x33d69f,_0x38b677){var _0x431071=require(_0xfea3('0x1f'));var _0x4a3369;return db[_0xfea3('0x20')]['findOne']({'attributes':['id',_0xfea3('0x21')],'where':{'id':0x1},'raw':!![]})[_0xfea3('0xc')](function(_0x11a18e){_0x4a3369=_0x11a18e;return db[_0xfea3('0x19')][_0xfea3('0x22')](_0x5e407d[_0xfea3('0x1a')]);})[_0xfea3('0xc')](function(_0x2d2d2f){if(_0x4a3369[_0xfea3('0x21')]&&fs[_0xfea3('0x23')](_0x2d2d2f[_0xfea3('0x24')])){var _0x31be5e=util[_0xfea3('0x25')](_0xfea3('0x26'),_0x2d2d2f[_0xfea3('0x24')]);return _0x431071[_0xfea3('0x27')](_0x2d2d2f[_0xfea3('0x24')],_0x31be5e,config[_0xfea3('0x28')][_0xfea3('0x29')])[_0xfea3('0xc')](function(){fs[_0xfea3('0x2a')](_0x2d2d2f[_0xfea3('0x24')]);logger[_0xfea3('0xd')](_0xfea3('0x2b'));return _0x2d2d2f;});}return _0x2d2d2f;})[_0xfea3('0xc')](function(_0x2cbe14){logger[_0xfea3('0xd')](_0xfea3('0x2c'),_0x5e407d);logger[_0xfea3('0xf')](_0xfea3('0x2c'),_0x5e407d,JSON['stringify'](_0x2cbe14));_0x33d69f(_0x2cbe14);})['catch'](function(_0x207d13){logger['error'](_0xfea3('0x2c'),_0x207d13[_0xfea3('0x15')],_0x5e407d);_0x38b677(_0x5b9fb7['error'](0x1f4,_0x207d13[_0xfea3('0x15')]));});});}; \ No newline at end of file +var _0xe63c=['VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','catch','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x2543d6,_0x3a5e78){var _0x55213c=function(_0x292768){while(--_0x292768){_0x2543d6['push'](_0x2543d6['shift']());}};_0x55213c(++_0x3a5e78);}(_0xe63c,0x133));var _0xce63=function(_0x4f3b4b,_0x590f08){_0x4f3b4b=_0x4f3b4b-0x0;var _0x1249e0=_0xe63c[_0x4f3b4b];return _0x1249e0;};'use strict';var _=require(_0xce63('0x0'));var util=require(_0xce63('0x1'));var moment=require(_0xce63('0x2'));var BPromise=require('bluebird');var rs=require(_0xce63('0x3'));var fs=require('fs');var Redis=require(_0xce63('0x4'));var db=require(_0xce63('0x5'))['db'];var utils=require(_0xce63('0x6'));var logger=require('../../config/logger')(_0xce63('0x7'));var config=require(_0xce63('0x8'));var jayson=require(_0xce63('0x9'));var client=jayson[_0xce63('0xa')][_0xce63('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x166ef6,_0x221f1a,_0x1cc9ea){return new BPromise(function(_0x5638e7,_0x3aa5de){return client['request'](_0x166ef6,_0x1cc9ea)[_0xce63('0xc')](function(_0x39687e){logger[_0xce63('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x221f1a,_0xce63('0xe'));logger['debug'](_0xce63('0xf'),_0x221f1a,'request\x20sent',JSON[_0xce63('0x10')](_0x39687e));if(_0x39687e['error']){if(_0x39687e[_0xce63('0x11')][_0xce63('0x12')]===0x1f4){logger[_0xce63('0x11')](_0xce63('0x13'),_0x221f1a,_0x39687e[_0xce63('0x11')]['message']);return _0x3aa5de(_0x39687e[_0xce63('0x11')][_0xce63('0x14')]);}logger[_0xce63('0x11')](_0xce63('0x13'),_0x221f1a,_0x39687e[_0xce63('0x11')][_0xce63('0x14')]);return _0x5638e7(_0x39687e['error'][_0xce63('0x14')]);}else{logger[_0xce63('0xd')](_0xce63('0x13'),_0x221f1a,_0xce63('0xe'));_0x5638e7(_0x39687e[_0xce63('0x15')]['message']);}})['catch'](function(_0x21c59a){logger[_0xce63('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x221f1a,_0x21c59a);_0x3aa5de(_0x21c59a);});});}exports[_0xce63('0x16')]=function(_0x4991c2){var _0x4782fd=this;return new Promise(function(_0x41968d,_0x3b9a34){return db[_0xce63('0x17')][_0xce63('0x18')](_0x4991c2[_0xce63('0x19')],{'raw':_0x4991c2['options']?_0x4991c2[_0xce63('0x1a')][_0xce63('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4991c2[_0xce63('0x1a')]?_0x4991c2[_0xce63('0x1a')][_0xce63('0x1c')]||null:null,'attributes':_0x4991c2[_0xce63('0x1a')]?_0x4991c2['options'][_0xce63('0x1d')]||null:null,'limit':_0x4991c2[_0xce63('0x1a')]?_0x4991c2['options'][_0xce63('0x1e')]||null:null})[_0xce63('0xc')](function(_0x383ef8){logger[_0xce63('0xd')]('UpdateVoiceRecording',_0x4991c2);logger['debug']('UpdateVoiceRecording',_0x4991c2,JSON[_0xce63('0x10')](_0x383ef8));_0x41968d(_0x383ef8);})[_0xce63('0x1f')](function(_0x1d1f09){logger[_0xce63('0x11')](_0xce63('0x16'),_0x1d1f09[_0xce63('0x14')],_0x4991c2);_0x3b9a34(_0x4782fd['error'](0x1f4,_0x1d1f09[_0xce63('0x14')]));});});};exports['CreateVoiceRecording']=function(_0x2daaa4){var _0x440e3b=this;return new Promise(function(_0x32a76b,_0x519cc0){var _0x476ec2=require(_0xce63('0x20'));var _0x27f920;return db[_0xce63('0x21')][_0xce63('0x22')]({'attributes':['id',_0xce63('0x23')],'where':{'id':0x1},'raw':!![]})[_0xce63('0xc')](function(_0x202430){_0x27f920=_0x202430;return db[_0xce63('0x17')][_0xce63('0x24')](_0x2daaa4[_0xce63('0x19')]);})['then'](function(_0x51d98f){if(_0x27f920[_0xce63('0x23')]&&fs[_0xce63('0x25')](_0x51d98f[_0xce63('0x26')])){var _0x39bda8=util['format'](_0xce63('0x27'),_0x51d98f[_0xce63('0x26')]);return _0x476ec2[_0xce63('0x28')](_0x51d98f['value'],_0x39bda8,config[_0xce63('0x29')][_0xce63('0x2a')])['then'](function(){fs[_0xce63('0x2b')](_0x51d98f['value']);logger[_0xce63('0xd')](_0xce63('0x2c'));return _0x51d98f;});}return _0x51d98f;})[_0xce63('0xc')](function(_0x16af70){logger['info'](_0xce63('0x2d'),_0x2daaa4);logger['debug'](_0xce63('0x2d'),_0x2daaa4,JSON[_0xce63('0x10')](_0x16af70));_0x32a76b(_0x16af70);})['catch'](function(_0x5cb009){logger[_0xce63('0x11')](_0xce63('0x2d'),_0x5cb009['message'],_0x2daaa4);_0x519cc0(_0x440e3b[_0xce63('0x11')](0x1f4,_0x5cb009[_0xce63('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 2c7250e..b3ff61b 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 _0xfc3f=['isAuthenticated','create','put','update','delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','post'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0xfc3f,0x1b9));var _0xffc3=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xfc3f[_0x5b561d];return _0x431060;};'use strict';var multer=require('multer');var util=require(_0xffc3('0x0'));var path=require(_0xffc3('0x1'));var timeout=require('connect-timeout');var express=require(_0xffc3('0x2'));var router=express[_0xffc3('0x3')]();var auth=require(_0xffc3('0x4'));var interaction=require(_0xffc3('0x5'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0xffc3('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xffc3('0x6')](_0xffc3('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xffc3('0x8')]('/',auth[_0xffc3('0x9')](),controller[_0xffc3('0xa')]);router[_0xffc3('0xb')](_0xffc3('0x7'),auth[_0xffc3('0x9')](),controller[_0xffc3('0xc')]);router[_0xffc3('0xd')]('/:id',auth[_0xffc3('0x9')](),controller[_0xffc3('0xe')]);module['exports']=router; \ No newline at end of file +var _0x37b7=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','show','post','update','exports','util'];(function(_0x35a04b,_0x331fe4){var _0x2157f9=function(_0x57e5b1){while(--_0x57e5b1){_0x35a04b['push'](_0x35a04b['shift']());}};_0x2157f9(++_0x331fe4);}(_0x37b7,0x12b));var _0x737b=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x37b7[_0xe73080];return _0x12cbc4;};'use strict';var multer=require('multer');var util=require(_0x737b('0x0'));var path=require(_0x737b('0x1'));var timeout=require(_0x737b('0x2'));var express=require('express');var router=express[_0x737b('0x3')]();var auth=require(_0x737b('0x4'));var interaction=require(_0x737b('0x5'));var config=require('../../config/environment');var controller=require(_0x737b('0x6'));router[_0x737b('0x7')]('/',auth[_0x737b('0x8')](),controller[_0x737b('0x9')]);router[_0x737b('0x7')](_0x737b('0xa'),auth[_0x737b('0x8')](),controller[_0x737b('0xb')]);router[_0x737b('0xc')]('/',auth[_0x737b('0x8')](),controller['create']);router['put'](_0x737b('0xa'),auth[_0x737b('0x8')](),controller[_0x737b('0xd')]);router['delete'](_0x737b('0xa'),auth[_0x737b('0x8')](),controller['destroy']);module[_0x737b('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 8be5944..3b31c3c 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 _0xe677=['blind','attended','STRING','Yes','moment','exports','ENUM'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0xe677,0x1a8));var _0x7e67=function(_0x28e74e,_0x53fdf1){_0x28e74e=_0x28e74e-0x0;var _0xb45ac1=_0xe677[_0x28e74e];return _0xb45ac1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7e67('0x0'));module[_0x7e67('0x1')]={'type':{'type':Sequelize[_0x7e67('0x2')](_0x7e67('0x3'),_0x7e67('0x4'))},'result':{'type':Sequelize[_0x7e67('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x7e67('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x7e67('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x7e67('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x7e67('0x5')]},'transferercontext':{'type':Sequelize[_0x7e67('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x7e67('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x7e67('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x7e67('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x7e67('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x7e67('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x7e67('0x5')]},'transfereecontext':{'type':Sequelize[_0x7e67('0x5')]},'transfereeexten':{'type':Sequelize[_0x7e67('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x7e67('0x6'),'No')},'context':{'type':Sequelize[_0x7e67('0x5')]},'extension':{'type':Sequelize[_0x7e67('0x5')]}}; \ No newline at end of file +var _0x2b7f=['ENUM','STRING','Yes'];(function(_0x331298,_0x12341a){var _0x3824bc=function(_0x19449f){while(--_0x19449f){_0x331298['push'](_0x331298['shift']());}};_0x3824bc(++_0x12341a);}(_0x2b7f,0x120));var _0xf2b7=function(_0x484818,_0x24f768){_0x484818=_0x484818-0x0;var _0x3f3e6b=_0x2b7f[_0x484818];return _0x3f3e6b;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0xf2b7('0x0')]('blind','attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xf2b7('0x1')]},'transferercalleridnum':{'type':Sequelize[_0xf2b7('0x1')]},'transferercalleridname':{'type':Sequelize[_0xf2b7('0x1')]},'transfererconnectedlinenum':{'type':Sequelize[_0xf2b7('0x1')]},'transfererconnectedlinename':{'type':Sequelize[_0xf2b7('0x1')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xf2b7('0x1')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xf2b7('0x1')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xf2b7('0x1')]},'transfereecalleridname':{'type':Sequelize[_0xf2b7('0x1')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xf2b7('0x1')]},'transfereeaccountcode':{'type':Sequelize[_0xf2b7('0x1')]},'transfereecontext':{'type':Sequelize[_0xf2b7('0x1')]},'transfereeexten':{'type':Sequelize[_0xf2b7('0x1')]},'transfereelinkedid':{'type':Sequelize[_0xf2b7('0x1')]},'isexternal':{'type':Sequelize['ENUM'](_0xf2b7('0x2'),'No')},'context':{'type':Sequelize[_0xf2b7('0x1')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index a2117e6..1281fce 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 _0x4385=['crypto','desk.js','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','VoiceTransferReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','map','type','key','options','where','includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x3f842d,_0x119a89){var _0x14759c=function(_0x475209){while(--_0x475209){_0x3f842d['push'](_0x3f842d['shift']());}};_0x14759c(++_0x119a89);}(_0x4385,0x168));var _0x5438=function(_0x3a02cb,_0x27a3bb){_0x3a02cb=_0x3a02cb-0x0;var _0x539e60=_0x4385[_0x3a02cb];return _0x539e60;};'use strict';var pdf=require(_0x5438('0x0'));var emlformat=require(_0x5438('0x1'));var rimraf=require(_0x5438('0x2'));var zipdir=require(_0x5438('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5438('0x4'));var moment=require(_0x5438('0x5'));var BPromise=require(_0x5438('0x6'));var Mustache=require(_0x5438('0x7'));var util=require(_0x5438('0x8'));var path=require(_0x5438('0x9'));var sox=require(_0x5438('0xa'));var csv=require(_0x5438('0xb'));var ejs=require(_0x5438('0xc'));var fs=require('fs');var _=require(_0x5438('0xd'));var squel=require(_0x5438('0xe'));var crypto=require(_0x5438('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x5438('0x10'));var toCsv=require(_0x5438('0xb'));var querystring=require(_0x5438('0x11'));var Papa=require(_0x5438('0x12'));var authService=require('../../components/auth/service');var hardwareService=require(_0x5438('0x13'));var Redis=require('ioredis');var qs=require(_0x5438('0x14'));var logger=require(_0x5438('0x15'))(_0x5438('0x16'));var utils=require('../../config/utils');var config=require(_0x5438('0x17'));var db=require(_0x5438('0x18'))['db'];function respondWithStatusCode(_0xa7d3db,_0x3adb24){_0x3adb24=_0x3adb24||0xcc;return function(_0x4649f8){if(_0x4649f8){return _0xa7d3db[_0x5438('0x19')](_0x3adb24);}return _0xa7d3db[_0x5438('0x1a')](_0x3adb24)[_0x5438('0x1b')]();};}function respondWithResult(_0x23f662,_0x3ee7d0){_0x3ee7d0=_0x3ee7d0||0xc8;return function(_0x25daa9){if(_0x25daa9){return _0x23f662[_0x5438('0x1a')](_0x3ee7d0)['json'](_0x25daa9);}};}function respondWithFilteredResult(_0x3010a3,_0x52ee74){return function(_0x10831b){if(_0x10831b){var _0xedbc06=_0x10831b['count'],_0x517a7d=_0x52ee74[_0x5438('0x1c')],_0x55919d=_0x52ee74['offset']+_0x52ee74[_0x5438('0x1d')],_0x1483d5;if(_0x55919d>=_0xedbc06){_0x55919d=_0xedbc06;_0x1483d5=0xc8;}else{_0x1483d5=0xce;}_0x3010a3[_0x5438('0x1a')](_0x1483d5);return _0x3010a3[_0x5438('0x1e')](_0x5438('0x1f'),_0x517a7d+'-'+_0x55919d+'/'+_0xedbc06)[_0x5438('0x20')](_0x10831b);}return null;};}function patchUpdates(_0x2279e9){return function(_0x70532a){try{jsonpatch[_0x5438('0x21')](_0x70532a,_0x2279e9,!![]);}catch(_0x391e8f){return BPromise[_0x5438('0x22')](_0x391e8f);}return _0x70532a['save']();};}function saveUpdates(_0xcd2391,_0xe6845c){return function(_0x9c322){if(_0x9c322){return _0x9c322[_0x5438('0x23')](_0xcd2391)[_0x5438('0x24')](function(_0x4f13fa){return _0x4f13fa;});}return null;};}function removeEntity(_0x43c4f1,_0x433b16){return function(_0x528609){if(_0x528609){return _0x528609[_0x5438('0x25')]()[_0x5438('0x24')](function(){_0x43c4f1[_0x5438('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbbf322,_0x54cb23){return function(_0x17b2c8){if(!_0x17b2c8){_0xbbf322[_0x5438('0x19')](0x194);}return _0x17b2c8;};}function handleError(_0xe8a3dd,_0x3d3372){_0x3d3372=_0x3d3372||0x1f4;return function(_0x4b0194){logger[_0x5438('0x26')](_0x4b0194[_0x5438('0x27')]);if(_0x4b0194[_0x5438('0x28')]){delete _0x4b0194[_0x5438('0x28')];}_0xe8a3dd[_0x5438('0x1a')](_0x3d3372)[_0x5438('0x29')](_0x4b0194);};}exports[_0x5438('0x2a')]=function(_0x51fb84,_0x51faf9){var _0x225c19={},_0x184a87={},_0x2cd095={'count':0x0,'rows':[]};var _0x5399cd=db[_0x5438('0x2b')][_0x5438('0x2c')];_0x184a87[_0x5438('0x2d')]=_[_0x5438('0x2e')](_0x5399cd);_0x184a87[_0x5438('0x2f')]=_[_0x5438('0x2e')](_0x51fb84[_0x5438('0x2f')]);_0x184a87['filters']=_[_0x5438('0x30')](_0x184a87[_0x5438('0x2d')],_0x184a87[_0x5438('0x2f')]);_0x225c19[_0x5438('0x31')]=_[_0x5438('0x30')](_0x184a87[_0x5438('0x2d')],qs[_0x5438('0x32')](_0x51fb84['query'][_0x5438('0x32')]));_0x225c19[_0x5438('0x31')]=_0x225c19['attributes'][_0x5438('0x33')]?_0x225c19[_0x5438('0x31')]:_0x184a87['model'];if(!_0x51fb84[_0x5438('0x2f')][_0x5438('0x34')](_0x5438('0x35'))){_0x225c19[_0x5438('0x1d')]=qs[_0x5438('0x1d')](_0x51fb84[_0x5438('0x2f')][_0x5438('0x1d')]);_0x225c19[_0x5438('0x1c')]=qs[_0x5438('0x1c')](_0x51fb84[_0x5438('0x2f')]['offset']);}_0x225c19[_0x5438('0x36')]=qs[_0x5438('0x37')](_0x51fb84['query'][_0x5438('0x37')]);_0x225c19['where']=qs[_0x5438('0x38')](_[_0x5438('0x39')](_0x51fb84[_0x5438('0x2f')],_0x184a87[_0x5438('0x38')]));if(_0x51fb84[_0x5438('0x2f')][_0x5438('0x3a')]){_0x225c19['where']=_[_0x5438('0x3b')](_0x225c19['where'],{'$or':_[_0x5438('0x3c')](_0x5399cd,function(_0x2684b8){if(_0x2684b8[_0x5438('0x3d')][_0x5438('0x3e')]!=='VIRTUAL'){var _0xee957c={};_0xee957c[_0x2684b8['field']]={'$like':'%'+_0x51fb84[_0x5438('0x2f')][_0x5438('0x3a')]+'%'};return _0xee957c;}})});}_0x225c19=_[_0x5438('0x3b')]({},_0x225c19,_0x51fb84[_0x5438('0x3f')]);var _0x44f160={'where':_0x225c19[_0x5438('0x40')]};return db['VoiceTransferReport']['count'](_0x44f160)[_0x5438('0x24')](function(_0x3e3a0c){_0x2cd095['count']=_0x3e3a0c;if(_0x51fb84[_0x5438('0x2f')][_0x5438('0x41')]){_0x225c19['include']=[{'all':!![]}];}return db[_0x5438('0x2b')][_0x5438('0x42')](_0x225c19);})[_0x5438('0x24')](function(_0x4bcdde){_0x2cd095[_0x5438('0x43')]=_0x4bcdde;return _0x2cd095;})[_0x5438('0x24')](respondWithFilteredResult(_0x51faf9,_0x225c19))[_0x5438('0x44')](handleError(_0x51faf9,null));};exports[_0x5438('0x45')]=function(_0x1b517a,_0xfe5d4d){var _0xd4e522={'raw':!![],'where':{'id':_0x1b517a[_0x5438('0x46')]['id']}},_0x23fab2={};_0x23fab2[_0x5438('0x2d')]=_[_0x5438('0x2e')](db[_0x5438('0x2b')][_0x5438('0x2c')]);_0x23fab2[_0x5438('0x2f')]=_[_0x5438('0x2e')](_0x1b517a[_0x5438('0x2f')]);_0x23fab2['filters']=_['intersection'](_0x23fab2[_0x5438('0x2d')],_0x23fab2[_0x5438('0x2f')]);_0xd4e522['attributes']=_['intersection'](_0x23fab2[_0x5438('0x2d')],qs[_0x5438('0x32')](_0x1b517a['query'][_0x5438('0x32')]));_0xd4e522['attributes']=_0xd4e522[_0x5438('0x31')][_0x5438('0x33')]?_0xd4e522[_0x5438('0x31')]:_0x23fab2[_0x5438('0x2d')];if(_0x1b517a[_0x5438('0x2f')]['includeAll']){_0xd4e522[_0x5438('0x47')]=[{'all':!![]}];}_0xd4e522=_[_0x5438('0x3b')]({},_0xd4e522,_0x1b517a[_0x5438('0x3f')]);return db['VoiceTransferReport'][_0x5438('0x48')](_0xd4e522)[_0x5438('0x24')](handleEntityNotFound(_0xfe5d4d,null))['then'](respondWithResult(_0xfe5d4d,null))[_0x5438('0x44')](handleError(_0xfe5d4d,null));};exports[_0x5438('0x49')]=function(_0x10d542,_0x4c61d2){return db[_0x5438('0x2b')][_0x5438('0x49')](_0x10d542[_0x5438('0x4a')],{})['then'](respondWithResult(_0x4c61d2,0xc9))[_0x5438('0x44')](handleError(_0x4c61d2,null));};exports[_0x5438('0x23')]=function(_0x3fe7a4,_0x23c743){if(_0x3fe7a4['body']['id']){delete _0x3fe7a4['body']['id'];}return db['VoiceTransferReport'][_0x5438('0x48')]({'where':{'id':_0x3fe7a4['params']['id']}})[_0x5438('0x24')](handleEntityNotFound(_0x23c743,null))[_0x5438('0x24')](saveUpdates(_0x3fe7a4[_0x5438('0x4a')],null))[_0x5438('0x24')](respondWithResult(_0x23c743,null))['catch'](handleError(_0x23c743,null));};exports[_0x5438('0x25')]=function(_0x85d21a,_0x4514c3){return db[_0x5438('0x2b')][_0x5438('0x48')]({'where':{'id':_0x85d21a[_0x5438('0x46')]['id']}})[_0x5438('0x24')](handleEntityNotFound(_0x4514c3,null))['then'](removeEntity(_0x4514c3,null))[_0x5438('0x44')](handleError(_0x4514c3,null));}; \ No newline at end of file +var _0xeed7=['findAll','rows','catch','show','params','includeAll','create','update','body','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','VoiceTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','offset','sort','filter','where','merge','map','type','key','VIRTUAL','field','options','count','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeed7,0xdf));var _0x7eed=function(_0x33afc1,_0x5c3d69){_0x33afc1=_0x33afc1-0x0;var _0xeddda6=_0xeed7[_0x33afc1];return _0xeddda6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7eed('0x0'));var zipdir=require(_0x7eed('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7eed('0x2'));var moment=require(_0x7eed('0x3'));var BPromise=require(_0x7eed('0x4'));var Mustache=require(_0x7eed('0x5'));var util=require('util');var path=require(_0x7eed('0x6'));var sox=require(_0x7eed('0x7'));var csv=require('to-csv');var ejs=require(_0x7eed('0x8'));var fs=require('fs');var _=require(_0x7eed('0x9'));var squel=require(_0x7eed('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7eed('0xb'));var toCsv=require(_0x7eed('0xc'));var querystring=require(_0x7eed('0xd'));var Papa=require('papaparse');var authService=require(_0x7eed('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x7eed('0xf'));var logger=require(_0x7eed('0x10'))(_0x7eed('0x11'));var utils=require(_0x7eed('0x12'));var config=require(_0x7eed('0x13'));var db=require(_0x7eed('0x14'))['db'];function respondWithStatusCode(_0xd0d166,_0x23a44c){_0x23a44c=_0x23a44c||0xcc;return function(_0x9e5978){if(_0x9e5978){return _0xd0d166['sendStatus'](_0x23a44c);}return _0xd0d166[_0x7eed('0x15')](_0x23a44c)[_0x7eed('0x16')]();};}function respondWithResult(_0x54ae73,_0x5cd866){_0x5cd866=_0x5cd866||0xc8;return function(_0x5a9490){if(_0x5a9490){return _0x54ae73[_0x7eed('0x15')](_0x5cd866)[_0x7eed('0x17')](_0x5a9490);}};}function respondWithFilteredResult(_0xe64c1,_0xdcfc59){return function(_0x431738){if(_0x431738){var _0x55426b=_0x431738['count'],_0x55db88=_0xdcfc59['offset'],_0x598165=_0xdcfc59['offset']+_0xdcfc59[_0x7eed('0x18')],_0xdcfd1;if(_0x598165>=_0x55426b){_0x598165=_0x55426b;_0xdcfd1=0xc8;}else{_0xdcfd1=0xce;}_0xe64c1[_0x7eed('0x15')](_0xdcfd1);return _0xe64c1[_0x7eed('0x19')](_0x7eed('0x1a'),_0x55db88+'-'+_0x598165+'/'+_0x55426b)[_0x7eed('0x17')](_0x431738);}return null;};}function patchUpdates(_0x13df98){return function(_0x222f33){try{jsonpatch[_0x7eed('0x1b')](_0x222f33,_0x13df98,!![]);}catch(_0x2c9dea){return BPromise[_0x7eed('0x1c')](_0x2c9dea);}return _0x222f33[_0x7eed('0x1d')]();};}function saveUpdates(_0x27b873,_0x458ba9){return function(_0x45357c){if(_0x45357c){return _0x45357c['update'](_0x27b873)[_0x7eed('0x1e')](function(_0x5e9835){return _0x5e9835;});}return null;};}function removeEntity(_0x289d64,_0x50f58c){return function(_0x3252aa){if(_0x3252aa){return _0x3252aa[_0x7eed('0x1f')]()['then'](function(){_0x289d64['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bd3f6,_0x451e71){return function(_0x1a2736){if(!_0x1a2736){_0x2bd3f6[_0x7eed('0x20')](0x194);}return _0x1a2736;};}function handleError(_0xfe3c86,_0x811eeb){_0x811eeb=_0x811eeb||0x1f4;return function(_0x329e5f){logger[_0x7eed('0x21')](_0x329e5f[_0x7eed('0x22')]);if(_0x329e5f[_0x7eed('0x23')]){delete _0x329e5f[_0x7eed('0x23')];}_0xfe3c86[_0x7eed('0x15')](_0x811eeb)[_0x7eed('0x24')](_0x329e5f);};}exports[_0x7eed('0x25')]=function(_0x19c47d,_0x79d72){var _0x10ac28={},_0x34c4ac={},_0x1ee2e5={'count':0x0,'rows':[]};var _0x40d9a0=db[_0x7eed('0x26')][_0x7eed('0x27')];_0x34c4ac[_0x7eed('0x28')]=_[_0x7eed('0x29')](_0x40d9a0);_0x34c4ac[_0x7eed('0x2a')]=_[_0x7eed('0x29')](_0x19c47d[_0x7eed('0x2a')]);_0x34c4ac[_0x7eed('0x2b')]=_[_0x7eed('0x2c')](_0x34c4ac[_0x7eed('0x28')],_0x34c4ac[_0x7eed('0x2a')]);_0x10ac28[_0x7eed('0x2d')]=_[_0x7eed('0x2c')](_0x34c4ac[_0x7eed('0x28')],qs[_0x7eed('0x2e')](_0x19c47d[_0x7eed('0x2a')]['fields']));_0x10ac28[_0x7eed('0x2d')]=_0x10ac28[_0x7eed('0x2d')][_0x7eed('0x2f')]?_0x10ac28[_0x7eed('0x2d')]:_0x34c4ac[_0x7eed('0x28')];if(!_0x19c47d['query']['hasOwnProperty']('nolimit')){_0x10ac28[_0x7eed('0x18')]=qs[_0x7eed('0x18')](_0x19c47d[_0x7eed('0x2a')][_0x7eed('0x18')]);_0x10ac28['offset']=qs[_0x7eed('0x30')](_0x19c47d[_0x7eed('0x2a')]['offset']);}_0x10ac28['order']=qs[_0x7eed('0x31')](_0x19c47d[_0x7eed('0x2a')][_0x7eed('0x31')]);_0x10ac28['where']=qs[_0x7eed('0x2b')](_['pick'](_0x19c47d[_0x7eed('0x2a')],_0x34c4ac[_0x7eed('0x2b')]));if(_0x19c47d[_0x7eed('0x2a')][_0x7eed('0x32')]){_0x10ac28[_0x7eed('0x33')]=_[_0x7eed('0x34')](_0x10ac28[_0x7eed('0x33')],{'$or':_[_0x7eed('0x35')](_0x40d9a0,function(_0x57c89e){if(_0x57c89e[_0x7eed('0x36')][_0x7eed('0x37')]!==_0x7eed('0x38')){var _0x112703={};_0x112703[_0x57c89e[_0x7eed('0x39')]]={'$like':'%'+_0x19c47d[_0x7eed('0x2a')][_0x7eed('0x32')]+'%'};return _0x112703;}})});}_0x10ac28=_[_0x7eed('0x34')]({},_0x10ac28,_0x19c47d[_0x7eed('0x3a')]);var _0x3e25a1={'where':_0x10ac28[_0x7eed('0x33')]};return db['VoiceTransferReport'][_0x7eed('0x3b')](_0x3e25a1)[_0x7eed('0x1e')](function(_0xfd99ab){_0x1ee2e5['count']=_0xfd99ab;if(_0x19c47d[_0x7eed('0x2a')]['includeAll']){_0x10ac28[_0x7eed('0x3c')]=[{'all':!![]}];}return db[_0x7eed('0x26')][_0x7eed('0x3d')](_0x10ac28);})[_0x7eed('0x1e')](function(_0x23d50b){_0x1ee2e5[_0x7eed('0x3e')]=_0x23d50b;return _0x1ee2e5;})[_0x7eed('0x1e')](respondWithFilteredResult(_0x79d72,_0x10ac28))[_0x7eed('0x3f')](handleError(_0x79d72,null));};exports[_0x7eed('0x40')]=function(_0x438dd3,_0x32b400){var _0x5e8c17={'raw':!![],'where':{'id':_0x438dd3[_0x7eed('0x41')]['id']}},_0x1ca060={};_0x1ca060['model']=_[_0x7eed('0x29')](db[_0x7eed('0x26')][_0x7eed('0x27')]);_0x1ca060[_0x7eed('0x2a')]=_[_0x7eed('0x29')](_0x438dd3[_0x7eed('0x2a')]);_0x1ca060[_0x7eed('0x2b')]=_[_0x7eed('0x2c')](_0x1ca060[_0x7eed('0x28')],_0x1ca060[_0x7eed('0x2a')]);_0x5e8c17['attributes']=_[_0x7eed('0x2c')](_0x1ca060[_0x7eed('0x28')],qs[_0x7eed('0x2e')](_0x438dd3[_0x7eed('0x2a')][_0x7eed('0x2e')]));_0x5e8c17[_0x7eed('0x2d')]=_0x5e8c17[_0x7eed('0x2d')][_0x7eed('0x2f')]?_0x5e8c17[_0x7eed('0x2d')]:_0x1ca060[_0x7eed('0x28')];if(_0x438dd3[_0x7eed('0x2a')][_0x7eed('0x42')]){_0x5e8c17[_0x7eed('0x3c')]=[{'all':!![]}];}_0x5e8c17=_[_0x7eed('0x34')]({},_0x5e8c17,_0x438dd3[_0x7eed('0x3a')]);return db['VoiceTransferReport']['find'](_0x5e8c17)[_0x7eed('0x1e')](handleEntityNotFound(_0x32b400,null))[_0x7eed('0x1e')](respondWithResult(_0x32b400,null))[_0x7eed('0x3f')](handleError(_0x32b400,null));};exports['create']=function(_0x5d1cb4,_0x2291c3){return db[_0x7eed('0x26')][_0x7eed('0x43')](_0x5d1cb4['body'],{})[_0x7eed('0x1e')](respondWithResult(_0x2291c3,0xc9))[_0x7eed('0x3f')](handleError(_0x2291c3,null));};exports[_0x7eed('0x44')]=function(_0x306b26,_0x31acad){if(_0x306b26['body']['id']){delete _0x306b26[_0x7eed('0x45')]['id'];}return db[_0x7eed('0x26')]['find']({'where':{'id':_0x306b26['params']['id']}})['then'](handleEntityNotFound(_0x31acad,null))[_0x7eed('0x1e')](saveUpdates(_0x306b26['body'],null))[_0x7eed('0x1e')](respondWithResult(_0x31acad,null))[_0x7eed('0x3f')](handleError(_0x31acad,null));};exports[_0x7eed('0x1f')]=function(_0x2c508c,_0x208da4){return db[_0x7eed('0x26')][_0x7eed('0x46')]({'where':{'id':_0x2c508c[_0x7eed('0x41')]['id']}})[_0x7eed('0x1e')](handleEntityNotFound(_0x208da4,null))[_0x7eed('0x1e')](removeEntity(_0x208da4,null))[_0x7eed('0x3f')](handleError(_0x208da4,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 647a726..60fc231 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 _0x2976=['bluebird','request-promise','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','util','../../config/logger','api','moment'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x2976,0xa0));var _0x6297=function(_0x32ed7c,_0x5d69f7){_0x32ed7c=_0x32ed7c-0x0;var _0x1e2ff4=_0x2976[_0x32ed7c];return _0x1e2ff4;};'use strict';var _=require(_0x6297('0x0'));var util=require(_0x6297('0x1'));var logger=require(_0x6297('0x2'))(_0x6297('0x3'));var moment=require(_0x6297('0x4'));var BPromise=require(_0x6297('0x5'));var rp=require(_0x6297('0x6'));var attributes=require(_0x6297('0x7'));module[_0x6297('0x8')]=function(_0xdb5ef1,_0xcbb0c8){return _0xdb5ef1[_0x6297('0x9')](_0x6297('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5197=['bluebird','request-promise','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','util','../../config/logger','api','moment'];(function(_0x9cae6d,_0x2af429){var _0x5341bd=function(_0x3db1f9){while(--_0x3db1f9){_0x9cae6d['push'](_0x9cae6d['shift']());}};_0x5341bd(++_0x2af429);}(_0x5197,0x1b3));var _0x7519=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x5197[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0x7519('0x0'));var util=require(_0x7519('0x1'));var logger=require(_0x7519('0x2'))(_0x7519('0x3'));var moment=require(_0x7519('0x4'));var BPromise=require(_0x7519('0x5'));var rp=require(_0x7519('0x6'));var attributes=require(_0x7519('0x7'));module[_0x7519('0x8')]=function(_0x831d27,_0x4aca63){return _0x831d27[_0x7519('0x9')](_0x7519('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 4408c71..eaa1066 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 _0xf0e1=['catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x11752c,_0x30d0a3){var _0x258f6b=function(_0x46fbbb){while(--_0x46fbbb){_0x11752c['push'](_0x11752c['shift']());}};_0x258f6b(++_0x30d0a3);}(_0xf0e1,0xd3));var _0x1f0e=function(_0x44dba1,_0x270ad5){_0x44dba1=_0x44dba1-0x0;var _0x2fbd3f=_0xf0e1[_0x44dba1];return _0x2fbd3f;};'use strict';var _=require(_0x1f0e('0x0'));var util=require(_0x1f0e('0x1'));var moment=require(_0x1f0e('0x2'));var BPromise=require(_0x1f0e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f0e('0x4'));var db=require(_0x1f0e('0x5'))['db'];var utils=require(_0x1f0e('0x6'));var logger=require('../../config/logger')(_0x1f0e('0x7'));var config=require(_0x1f0e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1f0e('0x9')][_0x1f0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dd962,_0x1b13a9,_0x510357){return new BPromise(function(_0x2faf45,_0x142578){return client[_0x1f0e('0xb')](_0x4dd962,_0x510357)[_0x1f0e('0xc')](function(_0x3b8ced){logger[_0x1f0e('0xd')](_0x1f0e('0xe'),_0x1b13a9,'request\x20sent');logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x1b13a9,_0x1f0e('0xf'),JSON[_0x1f0e('0x10')](_0x3b8ced));if(_0x3b8ced[_0x1f0e('0x11')]){if(_0x3b8ced[_0x1f0e('0x11')][_0x1f0e('0x12')]===0x1f4){logger[_0x1f0e('0x11')](_0x1f0e('0xe'),_0x1b13a9,_0x3b8ced[_0x1f0e('0x11')]['message']);return _0x142578(_0x3b8ced[_0x1f0e('0x11')][_0x1f0e('0x13')]);}logger[_0x1f0e('0x11')](_0x1f0e('0xe'),_0x1b13a9,_0x3b8ced[_0x1f0e('0x11')][_0x1f0e('0x13')]);return _0x2faf45(_0x3b8ced['error'][_0x1f0e('0x13')]);}else{logger[_0x1f0e('0xd')](_0x1f0e('0xe'),_0x1b13a9,_0x1f0e('0xf'));_0x2faf45(_0x3b8ced[_0x1f0e('0x14')][_0x1f0e('0x13')]);}})[_0x1f0e('0x15')](function(_0x102f84){logger[_0x1f0e('0x11')](_0x1f0e('0xe'),_0x1b13a9,_0x102f84);_0x142578(_0x102f84);});});}exports[_0x1f0e('0x16')]=function(_0x497ff2){var _0x2724d3=this;return new Promise(function(_0x537974,_0x50c66d){return db[_0x1f0e('0x17')][_0x1f0e('0x18')](_0x497ff2[_0x1f0e('0x19')],{'raw':_0x497ff2[_0x1f0e('0x1a')]?_0x497ff2[_0x1f0e('0x1a')][_0x1f0e('0x1b')]===undefined?!![]:![]:!![]})[_0x1f0e('0xc')](function(_0x1e79d6){logger[_0x1f0e('0xd')](_0x1f0e('0x16'),_0x497ff2);logger[_0x1f0e('0x1c')](_0x1f0e('0x16'),_0x497ff2,JSON[_0x1f0e('0x10')](_0x1e79d6));_0x537974(_0x1e79d6);})[_0x1f0e('0x15')](function(_0x4061ef){logger[_0x1f0e('0x11')](_0x1f0e('0x16'),_0x4061ef[_0x1f0e('0x13')],_0x497ff2);_0x50c66d(_0x2724d3[_0x1f0e('0x11')](0x1f4,_0x4061ef[_0x1f0e('0x13')]));});});}; \ No newline at end of file +var _0x2e19=['request','info','VoiceTransferReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','CreateVoiceTransferReport','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3e4db1,_0x385cd6){var _0x33ecd5=function(_0x1213ad){while(--_0x1213ad){_0x3e4db1['push'](_0x3e4db1['shift']());}};_0x33ecd5(++_0x385cd6);}(_0x2e19,0xc6));var _0x92e1=function(_0x16abe6,_0x41110e){_0x16abe6=_0x16abe6-0x0;var _0x4233cf=_0x2e19[_0x16abe6];return _0x4233cf;};'use strict';var _=require(_0x92e1('0x0'));var util=require(_0x92e1('0x1'));var moment=require(_0x92e1('0x2'));var BPromise=require(_0x92e1('0x3'));var rs=require(_0x92e1('0x4'));var fs=require('fs');var Redis=require(_0x92e1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x92e1('0x6'));var logger=require(_0x92e1('0x7'))(_0x92e1('0x8'));var config=require('../../config/environment');var jayson=require(_0x92e1('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a1310,_0x46dd4e,_0x9dfe70){return new BPromise(function(_0x1d0019,_0x166421){return client[_0x92e1('0xa')](_0x4a1310,_0x9dfe70)['then'](function(_0x4e2fe0){logger[_0x92e1('0xb')](_0x92e1('0xc'),_0x46dd4e,'request\x20sent');logger[_0x92e1('0xd')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x46dd4e,'request\x20sent',JSON[_0x92e1('0xe')](_0x4e2fe0));if(_0x4e2fe0[_0x92e1('0xf')]){if(_0x4e2fe0[_0x92e1('0xf')][_0x92e1('0x10')]===0x1f4){logger[_0x92e1('0xf')](_0x92e1('0xc'),_0x46dd4e,_0x4e2fe0[_0x92e1('0xf')][_0x92e1('0x11')]);return _0x166421(_0x4e2fe0[_0x92e1('0xf')][_0x92e1('0x11')]);}logger[_0x92e1('0xf')](_0x92e1('0xc'),_0x46dd4e,_0x4e2fe0[_0x92e1('0xf')][_0x92e1('0x11')]);return _0x1d0019(_0x4e2fe0[_0x92e1('0xf')]['message']);}else{logger[_0x92e1('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x46dd4e,_0x92e1('0x12'));_0x1d0019(_0x4e2fe0['result'][_0x92e1('0x11')]);}})[_0x92e1('0x13')](function(_0x4245d6){logger[_0x92e1('0xf')](_0x92e1('0xc'),_0x46dd4e,_0x4245d6);_0x166421(_0x4245d6);});});}exports[_0x92e1('0x14')]=function(_0x46ff5f){var _0x21fcb7=this;return new Promise(function(_0x55ee7c,_0x240f37){return db['VoiceTransferReport'][_0x92e1('0x15')](_0x46ff5f[_0x92e1('0x16')],{'raw':_0x46ff5f[_0x92e1('0x17')]?_0x46ff5f[_0x92e1('0x17')][_0x92e1('0x18')]===undefined?!![]:![]:!![]})[_0x92e1('0x19')](function(_0x5d5ee6){logger[_0x92e1('0xb')](_0x92e1('0x14'),_0x46ff5f);logger[_0x92e1('0xd')]('CreateVoiceTransferReport',_0x46ff5f,JSON[_0x92e1('0xe')](_0x5d5ee6));_0x55ee7c(_0x5d5ee6);})['catch'](function(_0x561e38){logger[_0x92e1('0xf')](_0x92e1('0x14'),_0x561e38[_0x92e1('0x11')],_0x46ff5f);_0x240f37(_0x21fcb7[_0x92e1('0xf')](0x1f4,_0x561e38[_0x92e1('0x11')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index b60e4f9..339f061 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x158c=['./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','sequelize','then','start','info','Online\x20apps:','map','filter','name','join','Offline\x20apps:','status','online','None','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash'];(function(_0x916ccc,_0x19734f){var _0xfd449b=function(_0xa31c4b){while(--_0xa31c4b){_0x916ccc['push'](_0x916ccc['shift']());}};_0xfd449b(++_0x19734f);}(_0x158c,0xc3));var _0xc158=function(_0xa4fbc6,_0x2abf38){_0xa4fbc6=_0xa4fbc6-0x0;var _0x319315=_0x158c[_0xa4fbc6];return _0x319315;};'use strict';var _=require(_0xc158('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xc158('0x1'));var config=require(_0xc158('0x2'));var logger=require(_0xc158('0x3'))(_0xc158('0x4'));var pm2=require(_0xc158('0x5'));var pm2Config=require(_0xc158('0x6'));var schedule=require(_0xc158('0x7'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0xc158('0x8')]['sync']()[_0xc158('0x9')](function(){return rpc['listen']();})[_0xc158('0x9')](function(_0xecfeb4){logger['info'](_0xecfeb4);return chat[_0xc158('0xa')]();})['then'](function(){return schedule[_0xc158('0xa')]();})['then'](function(_0x240a9c){logger['info'](_0x240a9c);return pm2['start'](pm2Config);})[_0xc158('0x9')](function(_0x3dc2f2){logger[_0xc158('0xb')](_0xc158('0xc'),_[_0xc158('0xd')](_[_0xc158('0xe')](_0x3dc2f2,{'status':'online'}),_0xc158('0xf'))[_0xc158('0x10')]());logger[_0xc158('0xb')](_0xc158('0x11'),_[_0xc158('0xd')](_[_0xc158('0xe')](_0x3dc2f2,function(_0x5168ae){return _0x5168ae[_0xc158('0x12')]!==_0xc158('0x13');}),_0xc158('0xf'))[_0xc158('0x10')]()||_0xc158('0x14'));config[_0xc158('0x15')]&&require(_0xc158('0x16'))[_0xc158('0x17')]();require(_0xc158('0x18'))['default']();})[_0xc158('0x19')](function(_0x52ebe0){logger['error'](_0xc158('0x1a'),_0x52ebe0);process[_0xc158('0x1b')](0x1);});}main(); \ No newline at end of file +var _0x00dd=['seedDB','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sync','then','info','start','filter','online','name','map','status','join','None'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x00dd,0xe9));var _0xd00d=function(_0x11c872,_0x110eb1){_0x11c872=_0x11c872-0x0;var _0x92a55a=_0x00dd[_0x11c872];return _0x92a55a;};'use strict';var _=require(_0xd00d('0x0'));var mysqldb=require(_0xd00d('0x1'));var rpc=require('./rpc');var config=require(_0xd00d('0x2'));var logger=require(_0xd00d('0x3'))(_0xd00d('0x4'));var pm2=require(_0xd00d('0x5'));var pm2Config=require(_0xd00d('0x6'));var schedule=require(_0xd00d('0x7'));var chat=require(_0xd00d('0x8'));function main(){return mysqldb['db']['sequelize'][_0xd00d('0x9')]()[_0xd00d('0xa')](function(){return rpc['listen']();})[_0xd00d('0xa')](function(_0x1febcd){logger[_0xd00d('0xb')](_0x1febcd);return chat[_0xd00d('0xc')]();})['then'](function(){return schedule[_0xd00d('0xc')]();})[_0xd00d('0xa')](function(_0x44952e){logger[_0xd00d('0xb')](_0x44952e);return pm2['start'](pm2Config);})['then'](function(_0x278be7){logger[_0xd00d('0xb')]('Online\x20apps:',_['map'](_[_0xd00d('0xd')](_0x278be7,{'status':_0xd00d('0xe')}),_0xd00d('0xf'))['join']());logger[_0xd00d('0xb')]('Offline\x20apps:',_[_0xd00d('0x10')](_['filter'](_0x278be7,function(_0x4a100b){return _0x4a100b[_0xd00d('0x11')]!==_0xd00d('0xe');}),_0xd00d('0xf'))[_0xd00d('0x12')]()||_0xd00d('0x13'));config[_0xd00d('0x14')]&&require('./config/seedDB')['default']();require('./config/license')['default']();})[_0xd00d('0x15')](function(_0x175a09){logger['error'](_0xd00d('0x16'),_0x175a09);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index a2e607f..df46685 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 _0x310f=['generateApiKey','randomBytes','toString','hex','now','regenerateApiKey','verify','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','HS512','../../mysqldb','../../config/environment','jsonwebtoken','express-jwt','basic-auth','crypto','ipaddr.js','session','role','fullname','name','internal','email','userpic','permissions','voicePause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControl','interface','userProfileId','use','ChatInteraction','findOne','params','disposition','then','json','unmanaged','Unmanaged.','catch','headers','authorization','startsWith','Basic','authenticate','pass','status','Wrong\x20credentials.','query','apikey','secrets','getUuid','User','find','sub','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','user','Unrecognized\x20API\x20access\x20key','Not\x20Authorized','User\x20object\x20not\x20found.','isAuthenticated','../../config/license/util','getLicense','update','Forbidden','canUpdate','sign','signToken','userRoles','indexOf','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','cookie','motion.user','stringify','pick','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x310f,0x10b));var _0xf310=function(_0x9af01f,_0x5df661){_0x9af01f=_0x9af01f-0x0;var _0x239fa3=_0x310f[_0x9af01f];return _0x239fa3;};'use strict';var db=require(_0xf310('0x0'))['db'];var config=require(_0xf310('0x1'));var hardwareConf=require('../../config/license/hardware');var _=require('lodash');var jwt=require(_0xf310('0x2'));var expressJwt=require(_0xf310('0x3'));var compose=require('composable-middleware');var basicAuth=require(_0xf310('0x4'));var crypto=require(_0xf310('0x5'));var ipaddr=require(_0xf310('0x6'));var validateJwt=expressJwt({'secret':config['secrets'][_0xf310('0x7')]});var userAttributes=['id',_0xf310('0x8'),_0xf310('0x9'),_0xf310('0xa'),_0xf310('0xb'),_0xf310('0xc'),_0xf310('0xd'),_0xf310('0xe'),_0xf310('0xf'),'chatPause','mailPause',_0xf310('0x10'),_0xf310('0x11'),_0xf310('0x12'),_0xf310('0x13'),_0xf310('0x14'),'phoneBarRemoteControlPort',_0xf310('0x15'),_0xf310('0x16'),_0xf310('0x17')];exports['isChatInteractionAuthorized']=function(){return isAuthenticated(!![])[_0xf310('0x18')](function(_0x2f37bf,_0x441273,_0x4b3c15){if(_0x2f37bf['user']){_0x4b3c15();}else{return db[_0xf310('0x19')][_0xf310('0x1a')]({'where':{'id':_0x2f37bf[_0xf310('0x1b')]['id']},'attributes':['id','closed',_0xf310('0x1c')],'raw':!![]})[_0xf310('0x1d')](function(_0x1fad82){if(_0x1fad82&&_0x1fad82['closed']){return _0x441273['status'](_0x1fad82[_0xf310('0x1c')]==='unmanaged'?0x195:0x193)[_0xf310('0x1e')]({'message':_0x1fad82[_0xf310('0x1c')]===_0xf310('0x1f')?_0xf310('0x20'):'Forbidden.'});}else{_0x4b3c15();}})[_0xf310('0x21')](function(_0x1e7f6f){_0x4b3c15(_0x1e7f6f);});}});};function isAuthenticated(_0x4f57b5){return compose()[_0xf310('0x18')](function(_0x181cd1,_0x4796dc,_0x26e9de){if(_0x181cd1[_0xf310('0x22')][_0xf310('0x23')]){if(_[_0xf310('0x24')](_0x181cd1[_0xf310('0x22')][_0xf310('0x23')],_0xf310('0x25'))){var _0x329d38=basicAuth(_0x181cd1);db['User']['find']({'where':{'name':_0x329d38[_0xf310('0xa')]}})['then'](function(_0x39ab63){if(!_0x39ab63||!_0x39ab63[_0xf310('0x26')](_0x329d38[_0xf310('0x27')])){return _0x4796dc[_0xf310('0x28')](0x191)[_0xf310('0x1e')]({'message':_0xf310('0x29')});}_0x181cd1['user']={'id':_0x39ab63['id']};_0x26e9de();})[_0xf310('0x21')](function(_0x424307){_0x26e9de(_0x424307);});}else if(_['startsWith'](_0x181cd1[_0xf310('0x22')][_0xf310('0x23')],'Bearer')){validateJwt(_0x181cd1,_0x4796dc,_0x26e9de);}else{if(_0x4f57b5){_0x26e9de();}else{return _0x4796dc['status'](0x193)[_0xf310('0x1e')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x181cd1[_0xf310('0x2a')][_0xf310('0x2b')]){try{var _0x45b7b0=jwt['verify'](_0x181cd1[_0xf310('0x2a')][_0xf310('0x2b')],config[_0xf310('0x2c')][_0xf310('0x7')],{'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xf310('0x2d')]()});db[_0xf310('0x2e')][_0xf310('0x2f')]({'where':{'id':_0x45b7b0[_0xf310('0x30')]}})[_0xf310('0x1d')](function(_0x17f271){if(!_0x17f271||!_['isEqual'](_0x17f271[_0xf310('0x31')],_0x45b7b0[_0xf310('0x32')])){return _0x4796dc['status'](0x193)[_0xf310('0x1e')]({'message':_0xf310('0x33')});}_0x181cd1[_0xf310('0x34')]={'id':_0x17f271['id']};_0x26e9de();})[_0xf310('0x21')](function(_0x2188c9){_0x26e9de(_0x2188c9);});}catch(_0x28d39f){console['log'](_0x28d39f);return _0x4796dc[_0xf310('0x28')](0x193)[_0xf310('0x1e')]({'message':_0xf310('0x35')});}}else{return _0x4796dc[_0xf310('0x28')](0x193)['json']({'message':_0xf310('0x36')});}})[_0xf310('0x18')](function(_0x88f926,_0x263a3f,_0x480a51){if(_0x88f926[_0xf310('0x34')]){db[_0xf310('0x2e')][_0xf310('0x2f')]({'where':{'id':_0x88f926[_0xf310('0x34')]['id']},'attributes':userAttributes})[_0xf310('0x1d')](function(_0x151d7d){if(!_0x151d7d){return _0x263a3f[_0xf310('0x28')](0x194)[_0xf310('0x1e')]({'message':'User\x20not\x20found.'});}_0x88f926['user']=_0x151d7d;_0x480a51();})[_0xf310('0x21')](function(_0x5e901c){_0x480a51(_0x5e901c);});}else if(_0x4f57b5){_0x480a51();}else{return _0x263a3f[_0xf310('0x28')](0x194)['json']({'message':_0xf310('0x37')});}});}exports[_0xf310('0x38')]=isAuthenticated;function canUpdate(){return compose()[_0xf310('0x18')](function(_0x7d09f3,_0x4c9e9b,_0x34556c){return require(_0xf310('0x39'))[_0xf310('0x3a')]()[_0xf310('0x1d')](function(_0x594515){if(_0x594515[_0xf310('0x3b')]){_0x34556c();}else{return _0x4c9e9b[_0xf310('0x28')](0x193)[_0xf310('0x1e')]({'message':_0xf310('0x3c')});}})[_0xf310('0x21')](function(_0x41ae16){_0x34556c(_0x41ae16);});});}exports[_0xf310('0x3d')]=canUpdate;function signToken(_0x30e107,_0x5e6673){return jwt[_0xf310('0x3e')]({'id':_0x30e107,'role':_0x5e6673},config['secrets'][_0xf310('0x7')],{'expiresIn':0x15180});}exports[_0xf310('0x3f')]=signToken;exports['hasRole']=function(_0x5a0df1){if(!_0x5a0df1){throw new Error('Required\x20role\x20needs\x20to\x20be\x20set');}return compose()[_0xf310('0x18')](isAuthenticated())[_0xf310('0x18')](function meetsRequirements(_0xe3ee3a,_0x3d8948,_0x50c212){if(config[_0xf310('0x40')][_0xf310('0x41')](_0xe3ee3a[_0xf310('0x34')]['role'])>=config[_0xf310('0x40')][_0xf310('0x41')](_0x5a0df1)){return _0x50c212();}else{return _0x3d8948[_0xf310('0x28')](0x193)[_0xf310('0x1e')]({'message':_0xf310('0x3c')});}});};exports['setTokenCookie']=function(_0x400734,_0x2ce97a){if(!_0x400734[_0xf310('0x34')]){return _0x2ce97a[_0xf310('0x28')](0x194)[_0xf310('0x1e')]({'message':_0xf310('0x42')});}var _0x5d4f89=signToken(_0x400734[_0xf310('0x34')]['id'],_0x400734[_0xf310('0x34')][_0xf310('0x8')]);_0x2ce97a['cookie'](_0xf310('0x43'),_0x5d4f89);_0x2ce97a[_0xf310('0x44')](_0xf310('0x45'),JSON[_0xf310('0x46')](_[_0xf310('0x47')](_0x400734[_0xf310('0x34')],userAttributes)));_0x2ce97a[_0xf310('0x48')](_0xf310('0x49'));};exports[_0xf310('0x4a')]=function(_0x489a14){if(_[_0xf310('0x4b')](_0x489a14[_0xf310('0x31')])||_[_0xf310('0x4b')](_0x489a14[_0xf310('0x4c')]))return null;else return createJwt(_0x489a14);};exports[_0xf310('0x4d')]=function(_0x153785){_0x153785[_0xf310('0x31')]=crypto[_0xf310('0x4e')](0x10)[_0xf310('0x4f')](_0xf310('0x50'));_0x153785['apiKeyIat']=Math['floor'](Date[_0xf310('0x51')]()/0x3e8)[_0xf310('0x4f')]();return createJwt(_0x153785);};exports[_0xf310('0x52')]=function(_0x524abd,_0x45bc7a){if(_0x524abd[_0xf310('0x2a')][_0xf310('0x2b')]){jwt[_0xf310('0x53')](_0x524abd['query'][_0xf310('0x2b')],config['secrets'][_0xf310('0x7')],{'nonce':_0x45bc7a[_0xf310('0x31')],'iat':_0x45bc7a[_0xf310('0x4c')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xf310('0x2d')]()});return generateApiKey(_0x45bc7a);}else{throw{'message':_0xf310('0x54')};}};function createJwt(_0x56eb3d){return jwt[_0xf310('0x3e')]({'iat':_0x56eb3d[_0xf310('0x4c')],'nonce':_0x56eb3d[_0xf310('0x31')]},config[_0xf310('0x2c')][_0xf310('0x7')],{'algorithm':_0xf310('0x55'),'subject':_0x56eb3d['id'][_0xf310('0x4f')](),'issuer':hardwareConf[_0xf310('0x2d')](),'audience':hardwareConf[_0xf310('0x2d')]()});} \ No newline at end of file +var _0x32a6=['redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','randomBytes','hex','floor','now','toString','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','composable-middleware','crypto','ipaddr.js','secrets','session','role','name','internal','userpic','permissions','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','phoneBarRemoteControlPort','interface','userProfileId','isChatInteractionAuthorized','use','ChatInteraction','findOne','closed','disposition','unmanaged','json','Forbidden.','catch','headers','authorization','startsWith','User','find','Wrong\x20credentials.','user','Bearer','status','query','apikey','verify','getUuid','sub','isEqual','nonce','log','Unrecognized\x20API\x20access\x20key','Unknown\x20authorization\x20format','then','User\x20not\x20found.','User\x20object\x20not\x20found.','isAuthenticated','../../config/license/util','getLicense','Forbidden','sign','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','indexOf','userRoles','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.user','stringify','pick'];(function(_0x38436b,_0x2f03ec){var _0x7407d0=function(_0x30b9f2){while(--_0x30b9f2){_0x38436b['push'](_0x38436b['shift']());}};_0x7407d0(++_0x2f03ec);}(_0x32a6,0x162));var _0x632a=function(_0xce2ebf,_0x25fa94){_0xce2ebf=_0xce2ebf-0x0;var _0x12e790=_0x32a6[_0xce2ebf];return _0x12e790;};'use strict';var db=require(_0x632a('0x0'))['db'];var config=require(_0x632a('0x1'));var hardwareConf=require(_0x632a('0x2'));var _=require(_0x632a('0x3'));var jwt=require(_0x632a('0x4'));var expressJwt=require('express-jwt');var compose=require(_0x632a('0x5'));var basicAuth=require('basic-auth');var crypto=require(_0x632a('0x6'));var ipaddr=require(_0x632a('0x7'));var validateJwt=expressJwt({'secret':config[_0x632a('0x8')][_0x632a('0x9')]});var userAttributes=['id',_0x632a('0xa'),'fullname',_0x632a('0xb'),_0x632a('0xc'),'email',_0x632a('0xd'),_0x632a('0xe'),_0x632a('0xf'),_0x632a('0x10'),_0x632a('0x11'),'faxPause',_0x632a('0x12'),_0x632a('0x13'),_0x632a('0x14'),'showWebBar',_0x632a('0x15'),'phoneBarRemoteControl',_0x632a('0x16'),_0x632a('0x17')];exports[_0x632a('0x18')]=function(){return isAuthenticated(!![])[_0x632a('0x19')](function(_0x19bd64,_0x27de80,_0x500036){if(_0x19bd64['user']){_0x500036();}else{return db[_0x632a('0x1a')][_0x632a('0x1b')]({'where':{'id':_0x19bd64['params']['id']},'attributes':['id',_0x632a('0x1c'),_0x632a('0x1d')],'raw':!![]})['then'](function(_0x5d7cd9){if(_0x5d7cd9&&_0x5d7cd9[_0x632a('0x1c')]){return _0x27de80['status'](_0x5d7cd9[_0x632a('0x1d')]===_0x632a('0x1e')?0x195:0x193)[_0x632a('0x1f')]({'message':_0x5d7cd9['disposition']===_0x632a('0x1e')?'Unmanaged.':_0x632a('0x20')});}else{_0x500036();}})[_0x632a('0x21')](function(_0x49d378){_0x500036(_0x49d378);});}});};function isAuthenticated(_0x55aa9e){return compose()[_0x632a('0x19')](function(_0x37c210,_0x3ad007,_0x4f7eb4){if(_0x37c210[_0x632a('0x22')][_0x632a('0x23')]){if(_[_0x632a('0x24')](_0x37c210[_0x632a('0x22')][_0x632a('0x23')],'Basic')){var _0x2a5d3e=basicAuth(_0x37c210);db[_0x632a('0x25')][_0x632a('0x26')]({'where':{'name':_0x2a5d3e[_0x632a('0xb')]}})['then'](function(_0xbe45e2){if(!_0xbe45e2||!_0xbe45e2['authenticate'](_0x2a5d3e['pass'])){return _0x3ad007['status'](0x191)[_0x632a('0x1f')]({'message':_0x632a('0x27')});}_0x37c210[_0x632a('0x28')]={'id':_0xbe45e2['id']};_0x4f7eb4();})[_0x632a('0x21')](function(_0x1ae0f9){_0x4f7eb4(_0x1ae0f9);});}else if(_[_0x632a('0x24')](_0x37c210[_0x632a('0x22')][_0x632a('0x23')],_0x632a('0x29'))){validateJwt(_0x37c210,_0x3ad007,_0x4f7eb4);}else{if(_0x55aa9e){_0x4f7eb4();}else{return _0x3ad007[_0x632a('0x2a')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x37c210[_0x632a('0x2b')][_0x632a('0x2c')]){try{var _0x4e146c=jwt[_0x632a('0x2d')](_0x37c210[_0x632a('0x2b')][_0x632a('0x2c')],config[_0x632a('0x8')][_0x632a('0x9')],{'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x632a('0x2e')]()});db[_0x632a('0x25')]['find']({'where':{'id':_0x4e146c[_0x632a('0x2f')]}})['then'](function(_0x20567f){if(!_0x20567f||!_[_0x632a('0x30')](_0x20567f['apiKeyNonce'],_0x4e146c[_0x632a('0x31')])){return _0x3ad007[_0x632a('0x2a')](0x193)[_0x632a('0x1f')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0x37c210[_0x632a('0x28')]={'id':_0x20567f['id']};_0x4f7eb4();})['catch'](function(_0x234a4c){_0x4f7eb4(_0x234a4c);});}catch(_0x1ee145){console[_0x632a('0x32')](_0x1ee145);return _0x3ad007[_0x632a('0x2a')](0x193)[_0x632a('0x1f')]({'message':_0x632a('0x33')});}}else if(_0x55aa9e){_0x4f7eb4();}else{return _0x3ad007[_0x632a('0x2a')](0x193)[_0x632a('0x1f')]({'message':_0x632a('0x34')});}})[_0x632a('0x19')](function(_0x137913,_0x2c0487,_0x176fbe){if(_0x137913[_0x632a('0x28')]){db['User']['find']({'where':{'id':_0x137913[_0x632a('0x28')]['id']},'attributes':userAttributes})[_0x632a('0x35')](function(_0x39a0da){if(!_0x39a0da){return _0x2c0487[_0x632a('0x2a')](0x194)['json']({'message':_0x632a('0x36')});}_0x137913['user']=_0x39a0da;_0x176fbe();})[_0x632a('0x21')](function(_0x3c9b1f){_0x176fbe(_0x3c9b1f);});}else if(_0x55aa9e){_0x176fbe();}else{return _0x2c0487[_0x632a('0x2a')](0x194)[_0x632a('0x1f')]({'message':_0x632a('0x37')});}});}exports[_0x632a('0x38')]=isAuthenticated;function canUpdate(){return compose()[_0x632a('0x19')](function(_0x4c43db,_0x3e1e32,_0x193678){return require(_0x632a('0x39'))[_0x632a('0x3a')]()[_0x632a('0x35')](function(_0xc49565){if(_0xc49565['update']){_0x193678();}else{return _0x3e1e32['status'](0x193)['json']({'message':_0x632a('0x3b')});}})[_0x632a('0x21')](function(_0x4d8a36){_0x193678(_0x4d8a36);});});}exports['canUpdate']=canUpdate;function signToken(_0x41cce4,_0x4fea62){return jwt[_0x632a('0x3c')]({'id':_0x41cce4,'role':_0x4fea62},config[_0x632a('0x8')]['session'],{'expiresIn':0x15180});}exports['signToken']=signToken;exports[_0x632a('0x3d')]=function(_0x297300){if(!_0x297300){throw new Error(_0x632a('0x3e'));}return compose()[_0x632a('0x19')](isAuthenticated())[_0x632a('0x19')](function meetsRequirements(_0x235ab5,_0x4a6dad,_0xdb9ac2){if(config['userRoles'][_0x632a('0x3f')](_0x235ab5[_0x632a('0x28')][_0x632a('0xa')])>=config[_0x632a('0x40')]['indexOf'](_0x297300)){return _0xdb9ac2();}else{return _0x4a6dad[_0x632a('0x2a')](0x193)['json']({'message':_0x632a('0x3b')});}});};exports[_0x632a('0x41')]=function(_0x514bb1,_0x144de2){if(!_0x514bb1[_0x632a('0x28')]){return _0x144de2[_0x632a('0x2a')](0x194)[_0x632a('0x1f')]({'message':_0x632a('0x42')});}var _0x59444a=signToken(_0x514bb1[_0x632a('0x28')]['id'],_0x514bb1['user']['role']);_0x144de2[_0x632a('0x43')]('motion.token',_0x59444a);_0x144de2['cookie'](_0x632a('0x44'),JSON[_0x632a('0x45')](_[_0x632a('0x46')](_0x514bb1[_0x632a('0x28')],userAttributes)));_0x144de2[_0x632a('0x47')](_0x632a('0x48'));};exports[_0x632a('0x49')]=function(_0x4cd717){if(_[_0x632a('0x4a')](_0x4cd717[_0x632a('0x4b')])||_[_0x632a('0x4a')](_0x4cd717[_0x632a('0x4c')]))return null;else return createJwt(_0x4cd717);};exports['generateApiKey']=function(_0x253c76){_0x253c76['apiKeyNonce']=crypto[_0x632a('0x4d')](0x10)['toString'](_0x632a('0x4e'));_0x253c76[_0x632a('0x4c')]=Math[_0x632a('0x4f')](Date[_0x632a('0x50')]()/0x3e8)[_0x632a('0x51')]();return createJwt(_0x253c76);};exports[_0x632a('0x52')]=function(_0x1cb434,_0x463773){if(_0x1cb434[_0x632a('0x2b')][_0x632a('0x2c')]){jwt[_0x632a('0x2d')](_0x1cb434[_0x632a('0x2b')][_0x632a('0x2c')],config[_0x632a('0x8')]['session'],{'nonce':_0x463773['apiKeyNonce'],'iat':_0x463773[_0x632a('0x4c')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x632a('0x2e')]()});return generateApiKey(_0x463773);}else{throw{'message':_0x632a('0x53')};}};function createJwt(_0x289b12){return jwt[_0x632a('0x3c')]({'iat':_0x289b12[_0x632a('0x4c')],'nonce':_0x289b12[_0x632a('0x4b')]},config[_0x632a('0x8')][_0x632a('0x9')],{'algorithm':_0x632a('0x54'),'subject':_0x289b12['id'][_0x632a('0x51')](),'issuer':hardwareConf[_0x632a('0x2e')](),'audience':hardwareConf['getUuid']()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index e4e8556..5bc05d6 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 _0x8db8=['unlink','createDecipher','final','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','binary','write','end','close'];(function(_0x21adba,_0x75e017){var _0x35dcd2=function(_0x4a2b52){while(--_0x4a2b52){_0x21adba['push'](_0x21adba['shift']());}};_0x35dcd2(++_0x75e017);}(_0x8db8,0x7b));var _0x88db=function(_0x1b4032,_0x589ab){_0x1b4032=_0x1b4032-0x0;var _0x31b944=_0x8db8[_0x1b4032];return _0x31b944;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x88db('0x0'));var defaultOptions={'algorithm':_0x88db('0x1')};function combineOptions(_0x35c993){var _0x22897c={};for(var _0x8b91aa in defaultOptions){if(defaultOptions[_0x88db('0x2')](_0x8b91aa)){_0x22897c[_0x8b91aa]=defaultOptions[_0x8b91aa];}}if(_0x35c993){for(var _0x272654 in _0x35c993){if(_0x35c993[_0x88db('0x2')](_0x272654)){_0x22897c[_0x272654]=_0x35c993[_0x272654];}}}return _0x22897c;}exports[_0x88db('0x3')]=function(_0x12552b,_0x17ddaf,_0x4c4c55,_0xcd2753){return new BPromise(function(_0x359d8a,_0x105664){_0xcd2753=combineOptions(_0xcd2753);var _0xc34af2=new Buffer(_0x4c4c55);var _0x5c15db=fs[_0x88db('0x4')](_0x12552b);var _0x4b4c9d=fs[_0x88db('0x5')](_0x17ddaf);var _0x38c856=crypto[_0x88db('0x6')](_0xcd2753[_0x88db('0x7')],_0xc34af2);_0x5c15db['on']('data',function(_0x27d687){var _0x4a1a76=new Buffer(_0x38c856['update'](_0x27d687),_0x88db('0x8'));_0x4b4c9d[_0x88db('0x9')](_0x4a1a76);});_0x5c15db['on']('end',function(){try{var _0x5ea6f1=new Buffer(_0x38c856['final'](_0x88db('0x8')),_0x88db('0x8'));_0x4b4c9d[_0x88db('0x9')](_0x5ea6f1);_0x4b4c9d[_0x88db('0xa')]();_0x4b4c9d['on'](_0x88db('0xb'),function(){return _0x359d8a(_0x17ddaf);});}catch(_0x1cdc7d){fs[_0x88db('0xc')](_0x17ddaf);return _0x105664(_0x1cdc7d);}});});};exports['decryptFile']=function(_0x1b5c2e,_0x3cee8f,_0x32596d,_0x231992){return new BPromise(function(_0x403d94,_0x464d46){_0x231992=combineOptions(_0x231992);var _0xedd010=new Buffer(_0x32596d);var _0x3508be=fs['createReadStream'](_0x1b5c2e);var _0x55bf98=fs[_0x88db('0x5')](_0x3cee8f);var _0x3609c4=crypto[_0x88db('0xd')](_0x231992[_0x88db('0x7')],_0xedd010);_0x3508be['on']('data',function(_0x5629){var _0x8bbdb3=new Buffer(_0x3609c4['update'](_0x5629),_0x88db('0x8'));_0x55bf98[_0x88db('0x9')](_0x8bbdb3);});_0x3508be['on'](_0x88db('0xa'),function(){try{var _0x3e86a5=new Buffer(_0x3609c4[_0x88db('0xe')]('binary'),_0x88db('0x8'));_0x55bf98[_0x88db('0x9')](_0x3e86a5);_0x55bf98[_0x88db('0xa')]();_0x55bf98['on'](_0x88db('0xb'),function(){return _0x403d94(_0x3cee8f);});}catch(_0x3d07b3){fs[_0x88db('0xc')](_0x3cee8f);return _0x464d46(_0x3d07b3);}});});}; \ No newline at end of file +var _0x36b8=['close','unlink','hasOwnProperty','createReadStream','createCipher','algorithm','update','write','end','final','binary','data'];(function(_0x5e00ed,_0x13bc91){var _0x3af0cb=function(_0x763885){while(--_0x763885){_0x5e00ed['push'](_0x5e00ed['shift']());}};_0x3af0cb(++_0x13bc91);}(_0x36b8,0x1ca));var _0x836b=function(_0x524d6b,_0x143a0d){_0x524d6b=_0x524d6b-0x0;var _0x5233d3=_0x36b8[_0x524d6b];return _0x5233d3;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x294866){var _0x5c5744={};for(var _0x2aa116 in defaultOptions){if(defaultOptions[_0x836b('0x0')](_0x2aa116)){_0x5c5744[_0x2aa116]=defaultOptions[_0x2aa116];}}if(_0x294866){for(var _0x1f630c in _0x294866){if(_0x294866['hasOwnProperty'](_0x1f630c)){_0x5c5744[_0x1f630c]=_0x294866[_0x1f630c];}}}return _0x5c5744;}exports['encryptFile']=function(_0x1906b6,_0x2b9dd1,_0x1f0d95,_0x22c280){return new BPromise(function(_0x2a03db,_0x325466){_0x22c280=combineOptions(_0x22c280);var _0x3c3bef=new Buffer(_0x1f0d95);var _0x8178f4=fs[_0x836b('0x1')](_0x1906b6);var _0x18e65d=fs['createWriteStream'](_0x2b9dd1);var _0xc79eee=crypto[_0x836b('0x2')](_0x22c280[_0x836b('0x3')],_0x3c3bef);_0x8178f4['on']('data',function(_0x15df08){var _0x5474ba=new Buffer(_0xc79eee[_0x836b('0x4')](_0x15df08),'binary');_0x18e65d[_0x836b('0x5')](_0x5474ba);});_0x8178f4['on'](_0x836b('0x6'),function(){try{var _0xff70d8=new Buffer(_0xc79eee[_0x836b('0x7')](_0x836b('0x8')),_0x836b('0x8'));_0x18e65d[_0x836b('0x5')](_0xff70d8);_0x18e65d[_0x836b('0x6')]();_0x18e65d['on']('close',function(){return _0x2a03db(_0x2b9dd1);});}catch(_0x348856){fs['unlink'](_0x2b9dd1);return _0x325466(_0x348856);}});});};exports['decryptFile']=function(_0x11ec5f,_0x42c9ed,_0x1633db,_0x1ba750){return new BPromise(function(_0x2465e2,_0x570899){_0x1ba750=combineOptions(_0x1ba750);var _0x2816b6=new Buffer(_0x1633db);var _0x286c43=fs['createReadStream'](_0x11ec5f);var _0x5e228c=fs['createWriteStream'](_0x42c9ed);var _0x58b924=crypto['createDecipher'](_0x1ba750['algorithm'],_0x2816b6);_0x286c43['on'](_0x836b('0x9'),function(_0x159646){var _0x3091a8=new Buffer(_0x58b924['update'](_0x159646),_0x836b('0x8'));_0x5e228c[_0x836b('0x5')](_0x3091a8);});_0x286c43['on'](_0x836b('0x6'),function(){try{var _0x5c5620=new Buffer(_0x58b924[_0x836b('0x7')]('binary'),_0x836b('0x8'));_0x5e228c[_0x836b('0x5')](_0x5c5620);_0x5e228c[_0x836b('0x6')]();_0x5e228c['on'](_0x836b('0xa'),function(){return _0x2465e2(_0x42c9ed);});}catch(_0x16d9da){fs[_0x836b('0xb')](_0x42c9ed);return _0x570899(_0x16d9da);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index dd8b688..4eedde4 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 _0x6c09=['CSV','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','query','dirname','basename','.csv','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x6c09,0x18f));var _0x96c0=function(_0x137d15,_0x35add9){_0x137d15=_0x137d15-0x0;var _0x3dbd3e=_0x6c09[_0x137d15];return _0x3dbd3e;};'use strict';var util=require('util');var path=require(_0x96c0('0x0'));var _=require('lodash');var csv=require(_0x96c0('0x1'));var fs=require('fs');var BPromise=require(_0x96c0('0x2'));var zipdir=require(_0x96c0('0x3'));var rimraf=require(_0x96c0('0x4'));var db=require(_0x96c0('0x5'))['db'];var dbH=require(_0x96c0('0x5'))[_0x96c0('0x6')];var logger=require(_0x96c0('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x96c0('0x8')][0x2]);var QUERY=process[_0x96c0('0x8')][0x3];var PATH=process[_0x96c0('0x8')][0x4];function analyticExtractedReport(_0x28731d,_0x23d442){var _0x3b5400={'status':_0x28731d};var _0x5bf8f6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x23d442){_0x3b5400[_0x96c0('0x9')]=_0x23d442;}return db[_0x96c0('0xa')][_0x96c0('0xb')](_0x3b5400,_0x5bf8f6);}function main(){var _0x30d920=0x1388;var _0x3e15ad;logger[_0x96c0('0xc')](util[_0x96c0('0xd')](_0x96c0('0xe'),EXTRACTED_REPORT_ID,_0x96c0('0xf')));return db['Setting'][_0x96c0('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x96c0('0x11'),_0x96c0('0x12')]})[_0x96c0('0x13')](function(_0xf8c4b0){if(_0xf8c4b0){_0x3e15ad=_0xf8c4b0;_0x30d920=_0x3e15ad['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x96c0('0x14')]['query'](util[_0x96c0('0xd')](_0x96c0('0x15'),QUERY),{'type':dbH[_0x96c0('0x14')][_0x96c0('0x16')]['SELECT']});})[_0x96c0('0x13')](function(_0x36fc6f){if(!_0x36fc6f[0x0][_0x96c0('0x17')]){return analyticExtractedReport(_0x96c0('0x18'));}var _0x3aa0f8=[];var _0x5d444d=0x0;var _0x4e6abd=!![];if(_0x36fc6f&&_0x36fc6f[_0x96c0('0x19')]){var _0x26c6f8=_0x36fc6f[0x0][_0x96c0('0x17')]%(_0x5d444d+_0x30d920);if(_0x3e15ad[_0x96c0('0x11')]){for(;_0x4e6abd;_0x5d444d+=_0x30d920,_0x26c6f8=_0x36fc6f[0x0][_0x96c0('0x17')]%(_0x5d444d+_0x30d920)){if(_0x26c6f8==0x0||_0x26c6f8==_0x36fc6f[0x0]['num']){_0x4e6abd=![];}_0x3aa0f8[_0x96c0('0x1a')](dbH[_0x96c0('0x14')]['query'](util[_0x96c0('0xd')](_0x96c0('0x1b'),QUERY,_0x30d920,_0x5d444d),{'type':dbH[_0x96c0('0x14')][_0x96c0('0x16')][_0x96c0('0x1c')]}));}}else{_0x3aa0f8['push'](dbH[_0x96c0('0x14')][_0x96c0('0x1d')](QUERY,{'type':dbH[_0x96c0('0x14')][_0x96c0('0x16')]['SELECT']}));}}var _0x59f854=path[_0x96c0('0x1e')](PATH);var _0x236376=path[_0x96c0('0x1f')](PATH,_0x96c0('0x20'));var _0x6c76a4=_0x3e15ad[_0x96c0('0x11')]&&_0x3aa0f8['length']>0x1;var _0x331a32=[];if(!fs[_0x96c0('0x21')](path[_0x96c0('0x22')](_0x59f854,_0x236376))&&_0x6c76a4){fs[_0x96c0('0x23')](path['join'](_0x59f854,_0x236376));}return BPromise['each'](_0x3aa0f8,function(_0x1c5fb0){_0x331a32[_0x96c0('0x1a')](_0x1c5fb0);})['then'](function(){for(var _0x30e83e=0x0;_0x30e83e<_0x331a32[_0x96c0('0x19')];_0x30e83e+=0x1){var _0x31106b;var _0x2cab9d=_0x331a32[_0x30e83e];if(_0x6c76a4){_0x31106b=path[_0x96c0('0x22')](_0x59f854,_0x236376,util[_0x96c0('0xd')](_0x96c0('0x24'),_0x236376,_0x30e83e,_0x96c0('0x25')));}else{_0x31106b=path[_0x96c0('0x22')](_0x59f854,util[_0x96c0('0xd')](_0x96c0('0x26'),_0x236376,_0x96c0('0x25')));}fs[_0x96c0('0x27')](_0x31106b,csv(_0x2cab9d));}})[_0x96c0('0x13')](function(){if(_0x6c76a4){zipdir(path[_0x96c0('0x22')](_0x59f854,_0x236376),{'saveTo':path[_0x96c0('0x22')](_0x59f854,util[_0x96c0('0xd')]('%s.%s',_0x236376,_0x96c0('0x28')))},function(_0x5702f5,_0x58e0e2){});rimraf(path[_0x96c0('0x22')](_0x59f854,_0x236376),function(){});}})[_0x96c0('0x13')](function(){logger[_0x96c0('0xc')](util[_0x96c0('0xd')](_0x96c0('0x29'),EXTRACTED_REPORT_ID,_0x96c0('0xf')));return analyticExtractedReport(_0x96c0('0x2a'),_0x6c76a4?util[_0x96c0('0xd')](_0x96c0('0x26'),_0x236376,_0x6c76a4?_0x96c0('0x28'):_0x96c0('0x25')):null);});})[_0x96c0('0x2b')](function(_0x4e79ba){logger[_0x96c0('0xc')](util[_0x96c0('0xd')](_0x96c0('0x2c'),EXTRACTED_REPORT_ID,_0x96c0('0xf')),util[_0x96c0('0x2d')](_0x4e79ba,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x8737=['num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','join','mkdirSync','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','bluebird','rimraf','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes'];(function(_0x59312d,_0x52bb25){var _0x13ca66=function(_0x2d4a0c){while(--_0x2d4a0c){_0x59312d['push'](_0x59312d['shift']());}};_0x13ca66(++_0x52bb25);}(_0x8737,0x175));var _0x7873=function(_0x18cd2f,_0x431dc5){_0x18cd2f=_0x18cd2f-0x0;var _0x13a9f4=_0x8737[_0x18cd2f];return _0x13a9f4;};'use strict';var util=require(_0x7873('0x0'));var path=require(_0x7873('0x1'));var _=require(_0x7873('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x7873('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x7873('0x4'));var db=require(_0x7873('0x5'))['db'];var dbH=require(_0x7873('0x5'))['dbH'];var logger=require('../../config/logger')(_0x7873('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x7873('0x7')][0x3];var PATH=process[_0x7873('0x7')][0x4];function analyticExtractedReport(_0xf6b7a0,_0x3f301c){var _0x3a6241={'status':_0xf6b7a0};var _0x250611={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f301c){_0x3a6241[_0x7873('0x8')]=_0x3f301c;}return db[_0x7873('0x9')]['update'](_0x3a6241,_0x250611);}function main(){var _0x13b2ac=0x1388;var _0x52abad;logger[_0x7873('0xa')](util[_0x7873('0xb')](_0x7873('0xc'),EXTRACTED_REPORT_ID,_0x7873('0xd')));return db[_0x7873('0xe')][_0x7873('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7873('0x10'),_0x7873('0x11')]})[_0x7873('0x12')](function(_0xb16fc1){if(_0xb16fc1){_0x52abad=_0xb16fc1;_0x13b2ac=_0x52abad['splitSizeCsv']||0x1388;}})[_0x7873('0x12')](function(){return dbH['sequelize'][_0x7873('0x13')](util[_0x7873('0xb')](_0x7873('0x14'),QUERY),{'type':dbH[_0x7873('0x15')][_0x7873('0x16')]['SELECT']});})[_0x7873('0x12')](function(_0x43a2ae){if(!_0x43a2ae[0x0][_0x7873('0x17')]){return analyticExtractedReport(_0x7873('0x18'));}var _0x56d9d5=[];var _0x2e727a=0x0;var _0x2b87c1=!![];if(_0x43a2ae&&_0x43a2ae[_0x7873('0x19')]){var _0x5925a4=_0x43a2ae[0x0][_0x7873('0x17')]%(_0x2e727a+_0x13b2ac);if(_0x52abad[_0x7873('0x10')]){for(;_0x2b87c1;_0x2e727a+=_0x13b2ac,_0x5925a4=_0x43a2ae[0x0][_0x7873('0x17')]%(_0x2e727a+_0x13b2ac)){if(_0x5925a4==0x0||_0x5925a4==_0x43a2ae[0x0][_0x7873('0x17')]){_0x2b87c1=![];}_0x56d9d5[_0x7873('0x1a')](dbH[_0x7873('0x15')][_0x7873('0x13')](util[_0x7873('0xb')](_0x7873('0x1b'),QUERY,_0x13b2ac,_0x2e727a),{'type':dbH[_0x7873('0x15')]['QueryTypes'][_0x7873('0x1c')]}));}}else{_0x56d9d5['push'](dbH['sequelize'][_0x7873('0x13')](QUERY,{'type':dbH[_0x7873('0x15')]['QueryTypes'][_0x7873('0x1c')]}));}}var _0x532313=path[_0x7873('0x1d')](PATH);var _0x494bf0=path[_0x7873('0x1e')](PATH,_0x7873('0x1f'));var _0x313e94=_0x52abad['split']&&_0x56d9d5['length']>0x1;var _0x1c434d=[];if(!fs['existsSync'](path[_0x7873('0x20')](_0x532313,_0x494bf0))&&_0x313e94){fs[_0x7873('0x21')](path['join'](_0x532313,_0x494bf0));}return BPromise['each'](_0x56d9d5,function(_0x3c9b9d){_0x1c434d[_0x7873('0x1a')](_0x3c9b9d);})[_0x7873('0x12')](function(){for(var _0x300ccf=0x0;_0x300ccf<_0x1c434d[_0x7873('0x19')];_0x300ccf+=0x1){var _0x3c2436;var _0x5555bc=_0x1c434d[_0x300ccf];if(_0x313e94){_0x3c2436=path['join'](_0x532313,_0x494bf0,util[_0x7873('0xb')](_0x7873('0x22'),_0x494bf0,_0x300ccf,_0x7873('0x23')));}else{_0x3c2436=path[_0x7873('0x20')](_0x532313,util[_0x7873('0xb')](_0x7873('0x24'),_0x494bf0,'csv'));}fs[_0x7873('0x25')](_0x3c2436,csv(_0x5555bc));}})[_0x7873('0x12')](function(){if(_0x313e94){zipdir(path['join'](_0x532313,_0x494bf0),{'saveTo':path[_0x7873('0x20')](_0x532313,util[_0x7873('0xb')](_0x7873('0x24'),_0x494bf0,_0x7873('0x26')))},function(_0x363a0e,_0x2abd7d){});rimraf(path[_0x7873('0x20')](_0x532313,_0x494bf0),function(){});}})[_0x7873('0x12')](function(){logger[_0x7873('0xa')](util[_0x7873('0xb')](_0x7873('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x313e94?util[_0x7873('0xb')]('%s.%s',_0x494bf0,_0x313e94?_0x7873('0x26'):_0x7873('0x23')):null);});})[_0x7873('0x28')](function(_0x1d2417){logger[_0x7873('0xa')](util['format'](_0x7873('0x29'),EXTRACTED_REPORT_ID,'CSV'),util[_0x7873('0x2a')](_0x1d2417,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x7873('0x2b'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 2aab82a..2c73c4c 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 _0x1d06=['basename','.pdf','Setting','split','splitSizePdf','then','length','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','existsSync','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','landscape','header','body','toString','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','pdf','join','%s.%s','pipe','createWriteStream','finish','error','log','end','zip','info','CSV','Completed','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','util','path','moment','pdfmake/src/printer','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','hasOwnProperty','push','tableHeader','num','dirname'];(function(_0x483fd7,_0x30dbdc){var _0x2f4244=function(_0x324157){while(--_0x324157){_0x483fd7['push'](_0x483fd7['shift']());}};_0x2f4244(++_0x30dbdc);}(_0x1d06,0x72));var _0x61d0=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x1d06[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x61d0('0x0'));var fs=require('fs');var BPromise=require(_0x61d0('0x1'));var util=require(_0x61d0('0x2'));var path=require(_0x61d0('0x3'));var moment=require(_0x61d0('0x4'));var PdfPrinter=require(_0x61d0('0x5'));var zipdir=require('zip-dir');var rimraf=require(_0x61d0('0x6'));var db=require(_0x61d0('0x7'))['db'];var dbH=require('../../mysqldb')[_0x61d0('0x8')];var logger=require(_0x61d0('0x9'))(_0x61d0('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x61d0('0xb')][0x2]);var QUERY=process[_0x61d0('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x61d0('0xb')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var _extractedReport;function analyticExtractedReport(_0x173d9b,_0x1ad15c){var _0x3bd342={'status':_0x173d9b};var _0x271d34={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1ad15c){_0x3bd342[_0x61d0('0xc')]=_0x1ad15c;}return db[_0x61d0('0xd')][_0x61d0('0xe')](_0x3bd342,_0x271d34);}function getHeader(_0x25dfc3){var _0x5c5f2a=[];for(var _0x8d1f6d in _0x25dfc3){if(_0x25dfc3[_0x61d0('0xf')](_0x8d1f6d)){_0x5c5f2a[_0x61d0('0x10')]({'text':_0x8d1f6d,'style':_0x61d0('0x11')});}}return _0x5c5f2a;}function extractReport(_0x4d6040){var _0x462a2e=0x1388;var _0x3da2a4;if(!_0x4d6040[0x0][_0x61d0('0x12')]){return analyticExtractedReport('Empty');}var _0x2ca34c=[];var _0x3e4c86=0x0;var _0x3eebc5=!![];var _0x2422ae=path[_0x61d0('0x13')](PATH);var _0x5cc1b3=path[_0x61d0('0x14')](PATH,_0x61d0('0x15'));var _0x5308b3=![];var _0x4d860d=[];return db[_0x61d0('0x16')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x61d0('0x17'),_0x61d0('0x18')]})['then'](function(_0x4ce410){if(_0x4ce410){_0x3da2a4=_0x4ce410;_0x462a2e=_0x3da2a4[_0x61d0('0x18')]||0x3e8;}})[_0x61d0('0x19')](function(){if(_0x4d6040&&_0x4d6040[_0x61d0('0x1a')]){var _0xd953e7=_0x4d6040[0x0][_0x61d0('0x12')]%(_0x3e4c86+_0x462a2e);if(_0x3da2a4[_0x61d0('0x17')]){for(;_0x3eebc5;_0x3e4c86+=_0x462a2e,_0xd953e7=_0x4d6040[0x0][_0x61d0('0x12')]%(_0x3e4c86+_0x462a2e)){if(_0xd953e7==0x0||_0xd953e7==_0x4d6040[0x0][_0x61d0('0x12')]){_0x3eebc5=![];}_0x2ca34c[_0x61d0('0x10')](dbH[_0x61d0('0x1b')][_0x61d0('0x1c')](util[_0x61d0('0x1d')](_0x61d0('0x1e'),QUERY,_0x462a2e,_0x3e4c86),{'type':dbH[_0x61d0('0x1b')]['QueryTypes'][_0x61d0('0x1f')]}));}}else{_0x2ca34c[_0x61d0('0x10')](dbH[_0x61d0('0x1b')][_0x61d0('0x1c')](QUERY,{'type':dbH[_0x61d0('0x1b')][_0x61d0('0x20')][_0x61d0('0x1f')]}));}}_0x5308b3=_0x3da2a4['split']&&_0x2ca34c[_0x61d0('0x1a')]>0x1;if(!fs[_0x61d0('0x21')](path['join'](_0x2422ae,_0x5cc1b3))&&_0x5308b3){fs[_0x61d0('0x22')](path['join'](_0x2422ae,_0x5cc1b3));}return BPromise[_0x61d0('0x23')](_0x2ca34c,function(_0x5c27d9){_0x4d860d[_0x61d0('0x10')](_0x5c27d9);});})[_0x61d0('0x19')](function(){return BPromise[_0x61d0('0x23')](_0x2ca34c,function(_0x567162,_0x46bb7e){var _0x270589;var _0x40f456=util['format'](_0x61d0('0x24'),NAME,_extractedReport[_0x61d0('0x25')],moment(_extractedReport[_0x61d0('0x26')])[_0x61d0('0x1d')](FORMAT),moment(_extractedReport[_0x61d0('0x27')])[_0x61d0('0x1d')](FORMAT));var _0x2441c8={'pageSize':'A4','pageOrientation':_0x61d0('0x28'),'content':[{'text':_0x40f456,'style':_0x61d0('0x29')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x1a766e={'headerRows':0x1,'body':[]};_0x1a766e[_0x61d0('0x2a')][_0x61d0('0x10')](getHeader(_0x567162[0x0]));var _0x32e0bb;for(var _0x1c268a=0x0;_0x1c268a<_0x567162[_0x61d0('0x1a')];_0x1c268a+=0x1){_0x32e0bb=[];for(var _0x155325 in _0x567162[_0x1c268a]){if(_0x567162[_0x1c268a][_0x61d0('0xf')](_0x155325)){_0x32e0bb['push'](_0x567162[_0x1c268a][_0x155325]?_[_0x61d0('0x2b')](_0x567162[_0x1c268a][_0x155325]):'');}}_0x1a766e[_0x61d0('0x2a')][_0x61d0('0x10')](_0x32e0bb);}_0x2441c8['content']['push']({'table':_0x1a766e});return new BPromise(function(_0x198048,_0x6efe1d){var _0x345ddb=new PdfPrinter({'Roboto':{'normal':__dirname+_0x61d0('0x2c'),'bold':__dirname+_0x61d0('0x2d'),'italics':__dirname+_0x61d0('0x2e'),'bolditalics':__dirname+_0x61d0('0x2f')}});var _0xa4909c=_0x345ddb['createPdfKitDocument'](_0x2441c8);if(_0x5308b3){_0x270589=path['join'](_0x2422ae,_0x5cc1b3,util[_0x61d0('0x1d')]('%s%d.%s',_0x5cc1b3,_0x46bb7e,_0x61d0('0x30')));}else{_0x270589=path[_0x61d0('0x31')](_0x2422ae,util['format'](_0x61d0('0x32'),_0x5cc1b3,_0x61d0('0x30')));}var _0x5bf9c7=_0xa4909c[_0x61d0('0x33')](fs[_0x61d0('0x34')](_0x270589));_0x5bf9c7['on'](_0x61d0('0x35'),function(){_0x198048();});_0x5bf9c7['on'](_0x61d0('0x36'),function(_0x3056bf){console[_0x61d0('0x37')]('err',_0x3056bf);_0x6efe1d(_0x3056bf);});_0xa4909c[_0x61d0('0x38')]();});});})['then'](function(){if(_0x5308b3){return new BPromise(function(_0x176aa2,_0x3ffdd4){zipdir(path[_0x61d0('0x31')](_0x2422ae,_0x5cc1b3),{'saveTo':path['join'](_0x2422ae,util[_0x61d0('0x1d')](_0x61d0('0x32'),_0x5cc1b3,_0x61d0('0x39')))},function(_0x12d56d){if(_0x12d56d){_0x3ffdd4(_0x12d56d);}else{_0x176aa2();}});});}})['then'](function(){if(_0x5308b3){rimraf(path['join'](_0x2422ae,_0x5cc1b3),function(){});}})[_0x61d0('0x19')](function(){logger[_0x61d0('0x3a')](util[_0x61d0('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x61d0('0x3b')));return analyticExtractedReport(_0x61d0('0x3c'),_0x5308b3?util[_0x61d0('0x1d')](_0x61d0('0x32'),_0x5cc1b3,_0x5308b3?_0x61d0('0x39'):_0x61d0('0x30')):null);});}function main(){logger['info'](util[_0x61d0('0x1d')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x61d0('0x3d')));return db[_0x61d0('0xd')][_0x61d0('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x40cd89){_extractedReport=_0x40cd89;return dbH[_0x61d0('0x1b')][_0x61d0('0x1c')](util[_0x61d0('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x61d0('0x1b')]['QueryTypes']['SELECT']});})['then'](extractReport)[_0x61d0('0x3f')](function(_0x49b821){logger['info'](util[_0x61d0('0x1d')](_0x61d0('0x40'),EXTRACTED_REPORT_ID,'PDF'),util[_0x61d0('0x41')](_0x49b821,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x61d0('0x42'));});}main(); \ No newline at end of file +var _0x7b13=['PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','bluebird','util','path','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','num','dirname','.pdf','Setting','find','splitSizePdf','then','length','split','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','existsSync','join','mkdirSync','each','push','format','name','startDate','endDate','landscape','header','black','body','/fonts/Roboto-Regular.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','pipe','finish','end','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x7b13,0xc0));var _0x37b1=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7b13[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var fs=require('fs');var BPromise=require(_0x37b1('0x0'));var util=require(_0x37b1('0x1'));var path=require(_0x37b1('0x2'));var moment=require('moment');var PdfPrinter=require(_0x37b1('0x3'));var zipdir=require(_0x37b1('0x4'));var rimraf=require(_0x37b1('0x5'));var db=require(_0x37b1('0x6'))['db'];var dbH=require(_0x37b1('0x6'))[_0x37b1('0x7')];var logger=require(_0x37b1('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x37b1('0x9')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x37b1('0xa');var _extractedReport;function analyticExtractedReport(_0x27cb91,_0x59e389){var _0x4fc828={'status':_0x27cb91};var _0x2d3a12={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x59e389){_0x4fc828[_0x37b1('0xb')]=_0x59e389;}return db[_0x37b1('0xc')]['update'](_0x4fc828,_0x2d3a12);}function getHeader(_0x10b344){var _0x3e9b73=[];for(var _0x2b4017 in _0x10b344){if(_0x10b344[_0x37b1('0xd')](_0x2b4017)){_0x3e9b73['push']({'text':_0x2b4017,'style':'tableHeader'});}}return _0x3e9b73;}function extractReport(_0xfdbfaf){var _0x56483f=0x1388;var _0x5e1b0e;if(!_0xfdbfaf[0x0][_0x37b1('0xe')]){return analyticExtractedReport('Empty');}var _0x413c37=[];var _0x45d467=0x0;var _0x5cebb2=!![];var _0x6aef6e=path[_0x37b1('0xf')](PATH);var _0x45b917=path['basename'](PATH,_0x37b1('0x10'));var _0x2a292d=![];var _0x3c06fb=[];return db[_0x37b1('0x11')][_0x37b1('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x37b1('0x13')]})[_0x37b1('0x14')](function(_0x39716f){if(_0x39716f){_0x5e1b0e=_0x39716f;_0x56483f=_0x5e1b0e[_0x37b1('0x13')]||0x3e8;}})[_0x37b1('0x14')](function(){if(_0xfdbfaf&&_0xfdbfaf[_0x37b1('0x15')]){var _0x9ba1b7=_0xfdbfaf[0x0]['num']%(_0x45d467+_0x56483f);if(_0x5e1b0e[_0x37b1('0x16')]){for(;_0x5cebb2;_0x45d467+=_0x56483f,_0x9ba1b7=_0xfdbfaf[0x0][_0x37b1('0xe')]%(_0x45d467+_0x56483f)){if(_0x9ba1b7==0x0||_0x9ba1b7==_0xfdbfaf[0x0][_0x37b1('0xe')]){_0x5cebb2=![];}_0x413c37['push'](dbH[_0x37b1('0x17')][_0x37b1('0x18')](util['format'](_0x37b1('0x19'),QUERY,_0x56483f,_0x45d467),{'type':dbH[_0x37b1('0x17')]['QueryTypes'][_0x37b1('0x1a')]}));}}else{_0x413c37['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x37b1('0x17')][_0x37b1('0x1b')][_0x37b1('0x1a')]}));}}_0x2a292d=_0x5e1b0e[_0x37b1('0x16')]&&_0x413c37['length']>0x1;if(!fs[_0x37b1('0x1c')](path[_0x37b1('0x1d')](_0x6aef6e,_0x45b917))&&_0x2a292d){fs[_0x37b1('0x1e')](path[_0x37b1('0x1d')](_0x6aef6e,_0x45b917));}return BPromise[_0x37b1('0x1f')](_0x413c37,function(_0x501e8f){_0x3c06fb[_0x37b1('0x20')](_0x501e8f);});})[_0x37b1('0x14')](function(){return BPromise[_0x37b1('0x1f')](_0x413c37,function(_0x22db8e,_0x1ae017){var _0x1b3c16;var _0x31146b=util[_0x37b1('0x21')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0x37b1('0x22')],moment(_extractedReport[_0x37b1('0x23')])['format'](FORMAT),moment(_extractedReport[_0x37b1('0x24')])['format'](FORMAT));var _0x4717fa={'pageSize':'A4','pageOrientation':_0x37b1('0x25'),'content':[{'text':_0x31146b,'style':_0x37b1('0x26')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x37b1('0x27')}}};var _0xf77eb7={'headerRows':0x1,'body':[]};_0xf77eb7[_0x37b1('0x28')][_0x37b1('0x20')](getHeader(_0x22db8e[0x0]));var _0x3cb683;for(var _0x4c24fb=0x0;_0x4c24fb<_0x22db8e['length'];_0x4c24fb+=0x1){_0x3cb683=[];for(var _0x16338c in _0x22db8e[_0x4c24fb]){if(_0x22db8e[_0x4c24fb][_0x37b1('0xd')](_0x16338c)){_0x3cb683['push'](_0x22db8e[_0x4c24fb][_0x16338c]?_['toString'](_0x22db8e[_0x4c24fb][_0x16338c]):'');}}_0xf77eb7['body'][_0x37b1('0x20')](_0x3cb683);}_0x4717fa['content'][_0x37b1('0x20')]({'table':_0xf77eb7});return new BPromise(function(_0x79665d,_0xbb4afd){var _0x497571=new PdfPrinter({'Roboto':{'normal':__dirname+_0x37b1('0x29'),'bold':__dirname+'/fonts/Roboto-Medium.ttf','italics':__dirname+'/fonts/Roboto-Italic.ttf','bolditalics':__dirname+_0x37b1('0x2a')}});var _0x46ddfe=_0x497571[_0x37b1('0x2b')](_0x4717fa);if(_0x2a292d){_0x1b3c16=path['join'](_0x6aef6e,_0x45b917,util[_0x37b1('0x21')](_0x37b1('0x2c'),_0x45b917,_0x1ae017,_0x37b1('0x2d')));}else{_0x1b3c16=path[_0x37b1('0x1d')](_0x6aef6e,util[_0x37b1('0x21')](_0x37b1('0x2e'),_0x45b917,_0x37b1('0x2d')));}var _0x328a86=_0x46ddfe[_0x37b1('0x2f')](fs['createWriteStream'](_0x1b3c16));_0x328a86['on'](_0x37b1('0x30'),function(){_0x79665d();});_0x328a86['on']('error',function(_0x3ad13f){console['log']('err',_0x3ad13f);_0xbb4afd(_0x3ad13f);});_0x46ddfe[_0x37b1('0x31')]();});});})[_0x37b1('0x14')](function(){if(_0x2a292d){return new BPromise(function(_0x3fc013,_0x404f98){zipdir(path[_0x37b1('0x1d')](_0x6aef6e,_0x45b917),{'saveTo':path['join'](_0x6aef6e,util['format'](_0x37b1('0x2e'),_0x45b917,_0x37b1('0x32')))},function(_0x4767fd){if(_0x4767fd){_0x404f98(_0x4767fd);}else{_0x3fc013();}});});}})[_0x37b1('0x14')](function(){if(_0x2a292d){rimraf(path[_0x37b1('0x1d')](_0x6aef6e,_0x45b917),function(){});}})[_0x37b1('0x14')](function(){logger[_0x37b1('0x33')](util[_0x37b1('0x21')](_0x37b1('0x34'),EXTRACTED_REPORT_ID,_0x37b1('0x35')));return analyticExtractedReport(_0x37b1('0x36'),_0x2a292d?util[_0x37b1('0x21')](_0x37b1('0x2e'),_0x45b917,_0x2a292d?_0x37b1('0x32'):_0x37b1('0x2d')):null);});}function main(){logger['info'](util[_0x37b1('0x21')](_0x37b1('0x37'),EXTRACTED_REPORT_ID,_0x37b1('0x38')));return db[_0x37b1('0xc')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x37b1('0x14')](function(_0x23c875){_extractedReport=_0x23c875;return dbH['sequelize'][_0x37b1('0x18')](util[_0x37b1('0x21')](_0x37b1('0x39'),QUERY),{'type':dbH['sequelize'][_0x37b1('0x1b')][_0x37b1('0x1a')]});})[_0x37b1('0x14')](extractReport)[_0x37b1('0x3a')](function(_0x3e3ebd){logger[_0x37b1('0x33')](util[_0x37b1('0x21')](_0x37b1('0x3b'),EXTRACTED_REPORT_ID,'PDF'),util[_0x37b1('0x3c')](_0x3e3ebd,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x37b1('0x3d'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 63e8b29..8fbd961 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 _0x6f15=['Failed','util','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','then','num','split','length','push','SELECT','dirname','basename','.xlsx','existsSync','mkdirSync','each','join','%s%d.%s','xlsx','writeFileSync','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect'];(function(_0x3b979,_0x4dc0f1){var _0x165e49=function(_0x19fa67){while(--_0x19fa67){_0x3b979['push'](_0x3b979['shift']());}};_0x165e49(++_0x4dc0f1);}(_0x6f15,0x19f));var _0x56f1=function(_0xdedab4,_0x2fd353){_0xdedab4=_0xdedab4-0x0;var _0x262896=_0x6f15[_0xdedab4];return _0x262896;};'use strict';var util=require(_0x56f1('0x0'));var path=require(_0x56f1('0x1'));var _=require(_0x56f1('0x2'));var fs=require('fs');var json2xls=require(_0x56f1('0x3'));var BPromise=require(_0x56f1('0x4'));var zipdir=require(_0x56f1('0x5'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x56f1('0x6'))[_0x56f1('0x7')];var logger=require(_0x56f1('0x8'))(_0x56f1('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x56f1('0xa')][0x2]);var QUERY=process[_0x56f1('0xa')][0x3];var PATH=process[_0x56f1('0xa')][0x4];function analyticExtractedReport(_0xa8d79,_0xf17600){var _0x3bbfdc={'status':_0xa8d79};var _0x50e13c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xf17600){_0x3bbfdc[_0x56f1('0xb')]=_0xf17600;}return db['AnalyticExtractedReport']['update'](_0x3bbfdc,_0x50e13c);}function main(){var _0x5c43a8=0x1388;var _0x163f82;logger['info'](util[_0x56f1('0xc')](_0x56f1('0xd'),EXTRACTED_REPORT_ID,_0x56f1('0xe')));return db[_0x56f1('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x56f1('0x10')]})['then'](function(_0x40a004){if(_0x40a004){_0x163f82=_0x40a004;_0x5c43a8=_0x163f82[_0x56f1('0x10')]||0x1388;}})['then'](function(){return dbH[_0x56f1('0x11')][_0x56f1('0x12')](util['format'](_0x56f1('0x13'),QUERY),{'type':dbH['sequelize'][_0x56f1('0x14')]['SELECT']});})[_0x56f1('0x15')](function(_0x4a0141){if(!_0x4a0141[0x0][_0x56f1('0x16')]){return analyticExtractedReport('Empty');}var _0x8aa3b3=[];var _0x9f3e63=0x0;var _0x55c5a2=!![];if(_0x163f82[_0x56f1('0x17')]){if(_0x4a0141&&_0x4a0141[_0x56f1('0x18')]){var _0xe50f11=_0x4a0141[0x0][_0x56f1('0x16')]%(_0x9f3e63+_0x5c43a8);for(;_0x55c5a2;_0x9f3e63+=_0x5c43a8,_0xe50f11=_0x4a0141[0x0][_0x56f1('0x16')]%(_0x9f3e63+_0x5c43a8)){if(_0xe50f11==0x0||_0xe50f11==_0x4a0141[0x0]['num']){_0x55c5a2=![];}_0x8aa3b3[_0x56f1('0x19')](dbH[_0x56f1('0x11')][_0x56f1('0x12')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5c43a8,_0x9f3e63),{'type':dbH[_0x56f1('0x11')]['QueryTypes'][_0x56f1('0x1a')]}));}}}else{_0x8aa3b3['push'](dbH[_0x56f1('0x11')][_0x56f1('0x12')](QUERY,{'type':dbH[_0x56f1('0x11')][_0x56f1('0x14')]['SELECT']}));}var _0x357158=path[_0x56f1('0x1b')](PATH);var _0x1020d5=path[_0x56f1('0x1c')](PATH,_0x56f1('0x1d'));var _0x179f23=_0x163f82[_0x56f1('0x17')]&&_0x8aa3b3[_0x56f1('0x18')]>0x1;var _0x57cb80=[];if(!fs[_0x56f1('0x1e')](path['join'](_0x357158,_0x1020d5))&&_0x179f23){fs[_0x56f1('0x1f')](path['join'](_0x357158,_0x1020d5));}return BPromise[_0x56f1('0x20')](_0x8aa3b3,function(_0x55d94b){_0x57cb80['push'](_0x55d94b);})[_0x56f1('0x15')](function(){for(var _0x18f4fd=0x0;_0x18f4fd<_0x57cb80['length'];_0x18f4fd+=0x1){var _0x4ccd98;var _0x4c2e57=_0x57cb80[_0x18f4fd];if(_0x179f23){_0x4ccd98=path[_0x56f1('0x21')](_0x357158,_0x1020d5,util[_0x56f1('0xc')](_0x56f1('0x22'),_0x1020d5,_0x18f4fd,_0x56f1('0x23')));}else{_0x4ccd98=path[_0x56f1('0x21')](_0x357158,util[_0x56f1('0xc')]('%s.%s',_0x1020d5,_0x56f1('0x23')));}fs[_0x56f1('0x24')](_0x4ccd98,json2xls(_0x4c2e57),'binary');}})[_0x56f1('0x15')](function(){if(_0x179f23){zipdir(path[_0x56f1('0x21')](_0x357158,_0x1020d5),{'saveTo':path[_0x56f1('0x21')](_0x357158,util['format'](_0x56f1('0x25'),_0x1020d5,_0x56f1('0x26')))},function(_0x5989d6,_0x41cd96){});rimraf(path['join'](_0x357158,_0x1020d5),function(){});}})[_0x56f1('0x15')](function(){logger[_0x56f1('0x27')](util[_0x56f1('0xc')](_0x56f1('0x28'),EXTRACTED_REPORT_ID,_0x56f1('0xe')));return analyticExtractedReport(_0x56f1('0x29'),_0x179f23?util[_0x56f1('0xc')](_0x56f1('0x25'),_0x1020d5,_0x179f23?_0x56f1('0x26'):'xlsx'):null);});})[_0x56f1('0x2a')](function(_0x2a44b6){logger['info'](util[_0x56f1('0xc')](_0x56f1('0x2b'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x56f1('0x2c')](_0x2a44b6,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x56f1('0x2d'));});}main(); \ No newline at end of file +var _0x9652=['%s%d.%s','xlsx','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','util','lodash','bluebird','zip-dir','dbH','../../config/logger','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.xlsx','length','existsSync','join','mkdirSync','each'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x9652,0x198));var _0x2965=function(_0x48783c,_0x1f986b){_0x48783c=_0x48783c-0x0;var _0x2ce586=_0x9652[_0x48783c];return _0x2ce586;};'use strict';var util=require(_0x2965('0x0'));var path=require('path');var _=require(_0x2965('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x2965('0x2'));var zipdir=require(_0x2965('0x3'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x2965('0x4')];var logger=require(_0x2965('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x2965('0x6')][0x3];var PATH=process[_0x2965('0x6')][0x4];function analyticExtractedReport(_0x5374cf,_0xba36ae){var _0x2f788c={'status':_0x5374cf};var _0x6eec43={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xba36ae){_0x2f788c[_0x2965('0x7')]=_0xba36ae;}return db['AnalyticExtractedReport']['update'](_0x2f788c,_0x6eec43);}function main(){var _0xc964ec=0x1388;var _0x13d5f1;logger[_0x2965('0x8')](util[_0x2965('0x9')](_0x2965('0xa'),EXTRACTED_REPORT_ID,_0x2965('0xb')));return db[_0x2965('0xc')][_0x2965('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2965('0xe'),_0x2965('0xf')]})[_0x2965('0x10')](function(_0x36ea5b){if(_0x36ea5b){_0x13d5f1=_0x36ea5b;_0xc964ec=_0x13d5f1[_0x2965('0xf')]||0x1388;}})[_0x2965('0x10')](function(){return dbH['sequelize']['query'](util[_0x2965('0x9')](_0x2965('0x11'),QUERY),{'type':dbH[_0x2965('0x12')][_0x2965('0x13')][_0x2965('0x14')]});})[_0x2965('0x10')](function(_0x3fea95){if(!_0x3fea95[0x0][_0x2965('0x15')]){return analyticExtractedReport('Empty');}var _0x163eaf=[];var _0x5b213c=0x0;var _0x8e0d10=!![];if(_0x13d5f1[_0x2965('0xe')]){if(_0x3fea95&&_0x3fea95['length']){var _0x3f1a56=_0x3fea95[0x0]['num']%(_0x5b213c+_0xc964ec);for(;_0x8e0d10;_0x5b213c+=_0xc964ec,_0x3f1a56=_0x3fea95[0x0][_0x2965('0x15')]%(_0x5b213c+_0xc964ec)){if(_0x3f1a56==0x0||_0x3f1a56==_0x3fea95[0x0][_0x2965('0x15')]){_0x8e0d10=![];}_0x163eaf['push'](dbH[_0x2965('0x12')]['query'](util[_0x2965('0x9')](_0x2965('0x16'),QUERY,_0xc964ec,_0x5b213c),{'type':dbH[_0x2965('0x12')][_0x2965('0x13')]['SELECT']}));}}}else{_0x163eaf[_0x2965('0x17')](dbH[_0x2965('0x12')]['query'](QUERY,{'type':dbH[_0x2965('0x12')]['QueryTypes'][_0x2965('0x14')]}));}var _0x3aad06=path[_0x2965('0x18')](PATH);var _0x3237e1=path[_0x2965('0x19')](PATH,_0x2965('0x1a'));var _0x43e58b=_0x13d5f1[_0x2965('0xe')]&&_0x163eaf[_0x2965('0x1b')]>0x1;var _0x22bf91=[];if(!fs[_0x2965('0x1c')](path[_0x2965('0x1d')](_0x3aad06,_0x3237e1))&&_0x43e58b){fs[_0x2965('0x1e')](path[_0x2965('0x1d')](_0x3aad06,_0x3237e1));}return BPromise[_0x2965('0x1f')](_0x163eaf,function(_0x1f83d1){_0x22bf91[_0x2965('0x17')](_0x1f83d1);})['then'](function(){for(var _0x9735ba=0x0;_0x9735ba<_0x22bf91[_0x2965('0x1b')];_0x9735ba+=0x1){var _0x223ccc;var _0xe2f5fe=_0x22bf91[_0x9735ba];if(_0x43e58b){_0x223ccc=path['join'](_0x3aad06,_0x3237e1,util[_0x2965('0x9')](_0x2965('0x20'),_0x3237e1,_0x9735ba,_0x2965('0x21')));}else{_0x223ccc=path[_0x2965('0x1d')](_0x3aad06,util['format'](_0x2965('0x22'),_0x3237e1,_0x2965('0x21')));}fs['writeFileSync'](_0x223ccc,json2xls(_0xe2f5fe),'binary');}})[_0x2965('0x10')](function(){if(_0x43e58b){zipdir(path[_0x2965('0x1d')](_0x3aad06,_0x3237e1),{'saveTo':path[_0x2965('0x1d')](_0x3aad06,util[_0x2965('0x9')](_0x2965('0x22'),_0x3237e1,'zip'))},function(_0x164a65,_0x49d8cb){});rimraf(path[_0x2965('0x1d')](_0x3aad06,_0x3237e1),function(){});}})[_0x2965('0x10')](function(){logger[_0x2965('0x8')](util[_0x2965('0x9')](_0x2965('0x23'),EXTRACTED_REPORT_ID,_0x2965('0xb')));return analyticExtractedReport(_0x2965('0x24'),_0x43e58b?util[_0x2965('0x9')](_0x2965('0x22'),_0x3237e1,_0x43e58b?_0x2965('0x25'):_0x2965('0x21')):null);});})[_0x2965('0x26')](function(_0x16853b){logger[_0x2965('0x8')](util[_0x2965('0x9')](_0x2965('0x27'),EXTRACTED_REPORT_ID,_0x2965('0xb')),util['inspect'](_0x16853b,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 84f645d..cc5754f 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 _0x3c8a=['map','filter','IntervalId','tag','type','Set','CDR(tag)=','callerID','push','CALLERID(all)=','answer','toLowerCase','appType','custom','Answer','Progress','record','recordingFormat','MixMonitor','${UNIQUEID}.','StopMixMonitor','GotoIfTime','last','concat','Hangup','transaction','destroy','bulkCreate','catch','error','rewrite','lodash','util','Interval','findAll','intervals','VoiceExtension','then','models','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','groupBy','queue','playback','hasOwnProperty','progress','priority','extensions','context','format','CDR(type)=%s','VoiceExtensionId','length','updatedAt','interval','*,*,*,*'];(function(_0x14b98b,_0x15428c){var _0x3961f1=function(_0x4d9b97){while(--_0x4d9b97){_0x14b98b['push'](_0x14b98b['shift']());}};_0x3961f1(++_0x15428c);}(_0x3c8a,0x1ae));var _0xa3c8=function(_0x5d6814,_0x1dfdc5){_0x5d6814=_0x5d6814-0x0;var _0x271a00=_0x3c8a[_0x5d6814];return _0x271a00;};'use strict';var _=require(_0xa3c8('0x0'));var util=require(_0xa3c8('0x1'));function rewrite(_0x49edec,_0x1d727f){var _0x3d33f7=this;return _0x49edec['models'][_0xa3c8('0x2')][_0xa3c8('0x3')]({'raw':!![]})['then'](function(_0x173690){_0x3d33f7[_0xa3c8('0x4')]=_0x173690;return _0x49edec['models'][_0xa3c8('0x5')][_0xa3c8('0x3')]({'where':{'IntervalId':_0x1d727f['IntervalId']},'raw':!![]});})[_0xa3c8('0x6')](function(_0x2d0926){return _0x49edec[_0xa3c8('0x7')][_0xa3c8('0x5')][_0xa3c8('0x3')]({'where':{'exten':{'$in':_[_0xa3c8('0x8')](_['map'](_0x2d0926,_0xa3c8('0x9')))},'isApp':!![]},'order':[{'raw':_0xa3c8('0xa')}],'raw':!![]});})[_0xa3c8('0x6')](function(_0x2ab76d){var _0x356c0a=_[_0xa3c8('0xb')](_0x2ab76d,'exten');var _0x14b79a=[_0xa3c8('0xc'),_0xa3c8('0xd')];var _0x379ee5=[];var _0x105e7b=[];for(var _0x5384e6 in _0x356c0a){if(_0x356c0a[_0xa3c8('0xe')](_0x5384e6)){_0x3d33f7['answer']=![];_0x3d33f7[_0xa3c8('0xf')]=![];_0x3d33f7[_0xa3c8('0x10')]=0x2;_0x3d33f7[_0xa3c8('0x11')]=[];_0x3d33f7['extensions']['push']({'type':_0x356c0a[_0x5384e6][0x0]['type'],'context':_0x356c0a[_0x5384e6][0x0][_0xa3c8('0x12')],'exten':_0x356c0a[_0x5384e6][0x0][_0xa3c8('0x9')],'priority':_0x3d33f7[_0xa3c8('0x10')]++,'app':'Set','appdata':util[_0xa3c8('0x13')](_0xa3c8('0x14'),_0x356c0a[_0x5384e6][0x0]['type']),'VoiceExtensionId':_0x356c0a[_0x5384e6][0x0][_0xa3c8('0x15')]});for(var _0x575dda=0x0,_0xa0b23=0x0;_0x575dda<_0x356c0a[_0x5384e6][_0xa3c8('0x16')];_0x575dda+=0x1,_0xa0b23=0x0){var _0x2755b4=_0x356c0a[_0x5384e6][_0x575dda];var _0x590f6a=[];var _0x424cf8=[];delete _0x2755b4['id'];delete _0x2755b4['createdAt'];delete _0x2755b4[_0xa3c8('0x17')];var _0x47bd07=_0x2755b4[_0xa3c8('0x18')]!==_0xa3c8('0x19')?[_0x2755b4['interval']]:_0x2755b4['IntervalId']?_[_0xa3c8('0x1a')](_[_0xa3c8('0x1b')](_0x3d33f7['intervals'],{'IntervalId':_0x2755b4[_0xa3c8('0x1c')]}),_0xa3c8('0x18')):[];if(_0x2755b4[_0xa3c8('0xe')](_0xa3c8('0x1d'))){if(_0x2755b4[_0xa3c8('0x1d')]&&_0x2755b4[_0xa3c8('0x1d')]!=='--'){_0x590f6a['push']({'type':_0x2755b4[_0xa3c8('0x1e')],'app':_0xa3c8('0x1f'),'appdata':_0xa3c8('0x20')+_0x2755b4[_0xa3c8('0x1d')],'context':_0x2755b4[_0xa3c8('0x12')],'exten':_0x2755b4['exten'],'priority':_0x47bd07[_0xa3c8('0x16')]+_0x3d33f7[_0xa3c8('0x10')]+_0xa0b23++,'VoiceExtensionId':_0x356c0a[_0x5384e6][0x0][_0xa3c8('0x15')]});}}if(_0x2755b4[_0xa3c8('0xe')](_0xa3c8('0x21'))){if(_0x2755b4[_0xa3c8('0x21')]){_0x590f6a[_0xa3c8('0x22')]({'type':_0x2755b4[_0xa3c8('0x1e')],'app':_0xa3c8('0x1f'),'appdata':_0xa3c8('0x23')+_0x2755b4[_0xa3c8('0x21')],'context':_0x2755b4[_0xa3c8('0x12')],'exten':_0x2755b4[_0xa3c8('0x9')],'priority':_0x47bd07[_0xa3c8('0x16')]+_0x3d33f7['priority']+_0xa0b23++,'VoiceExtensionId':_0x356c0a[_0x5384e6][0x0]['VoiceExtensionId']});}}if(_0x2755b4[_0xa3c8('0xe')](_0xa3c8('0x24'))){if(_0x14b79a['indexOf'](_0x2755b4['app'][_0xa3c8('0x25')]())>=0x0&&_0x2755b4[_0xa3c8('0x26')]!==_0xa3c8('0x27')){if(!_0x3d33f7[_0xa3c8('0x24')]&&_0x2755b4[_0xa3c8('0x24')]){_0x3d33f7[_0xa3c8('0x24')]=!![];_0x590f6a[_0xa3c8('0x22')]({'type':_0x2755b4['type'],'app':_0xa3c8('0x28'),'context':_0x2755b4[_0xa3c8('0x12')],'exten':_0x2755b4[_0xa3c8('0x9')],'priority':_0x47bd07['length']+_0x3d33f7[_0xa3c8('0x10')]+_0xa0b23++,'VoiceExtensionId':_0x356c0a[_0x5384e6][0x0][_0xa3c8('0x15')]});}if(!_0x3d33f7['answer']&&!_0x3d33f7[_0xa3c8('0xf')]&&!_0x2755b4[_0xa3c8('0x24')]){_0x3d33f7[_0xa3c8('0xf')]=!![];_0x590f6a[_0xa3c8('0x22')]({'type':_0x2755b4[_0xa3c8('0x1e')],'app':_0xa3c8('0x29'),'context':_0x2755b4['context'],'exten':_0x2755b4[_0xa3c8('0x9')],'priority':_0x47bd07['length']+_0x3d33f7[_0xa3c8('0x10')]+_0xa0b23++,'VoiceExtensionId':_0x356c0a[_0x5384e6][0x0]['VoiceExtensionId']});}}}if(_0x2755b4[_0xa3c8('0xe')](_0xa3c8('0x2a'))&&_0x2755b4[_0xa3c8('0xe')](_0xa3c8('0x2b'))){if(_0x2755b4[_0xa3c8('0x2a')]){_0x590f6a[_0xa3c8('0x22')]({'type':_0x2755b4[_0xa3c8('0x1e')],'app':_0xa3c8('0x2c'),'appdata':_0xa3c8('0x2d')+_0x2755b4[_0xa3c8('0x2b')]+',ab','context':_0x2755b4[_0xa3c8('0x12')],'exten':_0x2755b4[_0xa3c8('0x9')],'priority':_0x47bd07[_0xa3c8('0x16')]+_0x3d33f7[_0xa3c8('0x10')]+_0xa0b23++,'VoiceExtensionId':_0x356c0a[_0x5384e6][0x0][_0xa3c8('0x15')]});}}if(_0x2755b4[_0xa3c8('0xe')]('record')&&_0x2755b4[_0xa3c8('0xe')](_0xa3c8('0x2b'))){if(_0x2755b4[_0xa3c8('0x2a')]){_0x424cf8[_0xa3c8('0x22')]({'type':_0x2755b4[_0xa3c8('0x1e')],'app':_0xa3c8('0x2e'),'appdata':null,'context':_0x2755b4['context'],'exten':_0x2755b4['exten'],'priority':_0x47bd07[_0xa3c8('0x16')]+_0x3d33f7[_0xa3c8('0x10')]+_0xa0b23++ +0x1,'VoiceExtensionId':_0x356c0a[_0x5384e6][0x0][_0xa3c8('0x15')]});}}for(var _0x59b2f9=0x0;_0x59b2f9<_0x47bd07[_0xa3c8('0x16')];_0x59b2f9+=0x1){var _0x431097=_0x3d33f7[_0xa3c8('0x10')]+_0x47bd07[_0xa3c8('0x16')];var _0x4dbcf1=_0x59b2f9===_0x47bd07['length']-0x1?_0x3d33f7[_0xa3c8('0x10')]+_0x590f6a[_0xa3c8('0x16')]+_0x424cf8[_0xa3c8('0x16')]+0x2:_0x3d33f7['priority']+_0x59b2f9+0x1;_0x590f6a['splice'](_0x59b2f9,0x0,{'type':_0x2755b4[_0xa3c8('0x1e')],'app':_0xa3c8('0x2f'),'appdata':_0x47bd07[_0x59b2f9]+'?'+_0x2755b4[_0xa3c8('0x12')]+',${EXTEN},'+_0x431097+':'+_0x2755b4[_0xa3c8('0x12')]+',${EXTEN},'+_0x4dbcf1,'exten':_0x2755b4[_0xa3c8('0x9')],'context':_0x2755b4['context'],'priority':_0x3d33f7[_0xa3c8('0x10')]+_0x59b2f9,'VoiceExtensionId':_0x356c0a[_0x5384e6][0x0][_0xa3c8('0x15')]});}_0x2755b4[_0xa3c8('0x10')]=_0x590f6a[_0xa3c8('0x16')]?_[_0xa3c8('0x30')](_0x590f6a)[_0xa3c8('0x10')]+0x1:_0x3d33f7[_0xa3c8('0x10')];_0x3d33f7['priority']=(_0x424cf8[_0xa3c8('0x16')]?_['last'](_0x424cf8)[_0xa3c8('0x10')]:_0x2755b4[_0xa3c8('0x10')])+0x1;_0x3d33f7[_0xa3c8('0x11')]=_[_0xa3c8('0x31')](_0x3d33f7[_0xa3c8('0x11')],_0x590f6a,[_0x2755b4],_0x424cf8);}_0x3d33f7[_0xa3c8('0x11')][_0xa3c8('0x22')]({'type':_0x356c0a[_0x5384e6][0x0]['type'],'app':_0xa3c8('0x32'),'exten':_0x356c0a[_0x5384e6][0x0]['exten'],'context':_0x356c0a[_0x5384e6][0x0][_0xa3c8('0x12')],'priority':_0x3d33f7['priority'],'VoiceExtensionId':_0x356c0a[_0x5384e6][0x0]['VoiceExtensionId']});_0x379ee5[_0xa3c8('0x22')](_0x356c0a[_0x5384e6][0x0][_0xa3c8('0x15')]);_0x105e7b=_[_0xa3c8('0x31')](_0x105e7b,_0x3d33f7[_0xa3c8('0x11')]);}}return _0x49edec[_0xa3c8('0x33')](function(_0x1b402d){return _0x49edec[_0xa3c8('0x7')][_0xa3c8('0x5')][_0xa3c8('0x34')]({'where':{'VoiceExtensionId':{'$in':_0x379ee5}},'transaction':_0x1b402d})[_0xa3c8('0x6')](function(_0x391c44){return _0x49edec[_0xa3c8('0x7')][_0xa3c8('0x5')][_0xa3c8('0x35')](_['sortBy'](_0x105e7b,_0xa3c8('0x10')),{'transaction':_0x1b402d});});});})[_0xa3c8('0x36')](function(_0x3f1ac9){console[_0xa3c8('0x37')](_0x3f1ac9);});}exports[_0xa3c8('0x38')]=rewrite; \ No newline at end of file +var _0x85b5=['*,*,*,*','IntervalId','filter','tag','push','CDR(tag)=','callerID','CALLERID(all)=','answer','indexOf','app','appType','Answer','VoiceExtensionId','record','recordingFormat','MixMonitor',',ab','length','GotoIfTime','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','rewrite','lodash','util','models','findAll','then','intervals','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','groupBy','exten','playback','hasOwnProperty','progress','extensions','type','context','priority','Set','format','CDR(type)=%s','createdAt','interval'];(function(_0x1375c3,_0x297d00){var _0x1f26d6=function(_0x6555){while(--_0x6555){_0x1375c3['push'](_0x1375c3['shift']());}};_0x1f26d6(++_0x297d00);}(_0x85b5,0x120));var _0x585b=function(_0xe30585,_0x25ba1b){_0xe30585=_0xe30585-0x0;var _0x1c3d86=_0x85b5[_0xe30585];return _0x1c3d86;};'use strict';var _=require(_0x585b('0x0'));var util=require(_0x585b('0x1'));function rewrite(_0x5128fb,_0x153d33){var _0x2d8ad6=this;return _0x5128fb[_0x585b('0x2')]['Interval'][_0x585b('0x3')]({'raw':!![]})[_0x585b('0x4')](function(_0x2b5ec2){_0x2d8ad6[_0x585b('0x5')]=_0x2b5ec2;return _0x5128fb[_0x585b('0x2')][_0x585b('0x6')][_0x585b('0x3')]({'where':{'IntervalId':_0x153d33['IntervalId']},'raw':!![]});})['then'](function(_0x29343a){return _0x5128fb[_0x585b('0x2')][_0x585b('0x6')][_0x585b('0x3')]({'where':{'exten':{'$in':_[_0x585b('0x7')](_[_0x585b('0x8')](_0x29343a,'exten'))},'isApp':!![]},'order':[{'raw':_0x585b('0x9')}],'raw':!![]});})[_0x585b('0x4')](function(_0x5f4a9b){var _0xefa1f5=_[_0x585b('0xa')](_0x5f4a9b,_0x585b('0xb'));var _0x7f8b08=['queue',_0x585b('0xc')];var _0x3e89cc=[];var _0x388f4b=[];for(var _0x3dd5ae in _0xefa1f5){if(_0xefa1f5[_0x585b('0xd')](_0x3dd5ae)){_0x2d8ad6['answer']=![];_0x2d8ad6[_0x585b('0xe')]=![];_0x2d8ad6['priority']=0x2;_0x2d8ad6[_0x585b('0xf')]=[];_0x2d8ad6['extensions']['push']({'type':_0xefa1f5[_0x3dd5ae][0x0][_0x585b('0x10')],'context':_0xefa1f5[_0x3dd5ae][0x0][_0x585b('0x11')],'exten':_0xefa1f5[_0x3dd5ae][0x0][_0x585b('0xb')],'priority':_0x2d8ad6[_0x585b('0x12')]++,'app':_0x585b('0x13'),'appdata':util[_0x585b('0x14')](_0x585b('0x15'),_0xefa1f5[_0x3dd5ae][0x0][_0x585b('0x10')]),'VoiceExtensionId':_0xefa1f5[_0x3dd5ae][0x0]['VoiceExtensionId']});for(var _0x1c7599=0x0,_0x54fabb=0x0;_0x1c7599<_0xefa1f5[_0x3dd5ae]['length'];_0x1c7599+=0x1,_0x54fabb=0x0){var _0x391b22=_0xefa1f5[_0x3dd5ae][_0x1c7599];var _0x506413=[];var _0x36f139=[];delete _0x391b22['id'];delete _0x391b22[_0x585b('0x16')];delete _0x391b22['updatedAt'];var _0x3a779b=_0x391b22[_0x585b('0x17')]!==_0x585b('0x18')?[_0x391b22[_0x585b('0x17')]]:_0x391b22[_0x585b('0x19')]?_['map'](_[_0x585b('0x1a')](_0x2d8ad6[_0x585b('0x5')],{'IntervalId':_0x391b22[_0x585b('0x19')]}),'interval'):[];if(_0x391b22[_0x585b('0xd')](_0x585b('0x1b'))){if(_0x391b22[_0x585b('0x1b')]&&_0x391b22[_0x585b('0x1b')]!=='--'){_0x506413[_0x585b('0x1c')]({'type':_0x391b22[_0x585b('0x10')],'app':_0x585b('0x13'),'appdata':_0x585b('0x1d')+_0x391b22[_0x585b('0x1b')],'context':_0x391b22[_0x585b('0x11')],'exten':_0x391b22['exten'],'priority':_0x3a779b['length']+_0x2d8ad6[_0x585b('0x12')]+_0x54fabb++,'VoiceExtensionId':_0xefa1f5[_0x3dd5ae][0x0]['VoiceExtensionId']});}}if(_0x391b22[_0x585b('0xd')]('callerID')){if(_0x391b22[_0x585b('0x1e')]){_0x506413[_0x585b('0x1c')]({'type':_0x391b22[_0x585b('0x10')],'app':_0x585b('0x13'),'appdata':_0x585b('0x1f')+_0x391b22[_0x585b('0x1e')],'context':_0x391b22[_0x585b('0x11')],'exten':_0x391b22[_0x585b('0xb')],'priority':_0x3a779b['length']+_0x2d8ad6[_0x585b('0x12')]+_0x54fabb++,'VoiceExtensionId':_0xefa1f5[_0x3dd5ae][0x0]['VoiceExtensionId']});}}if(_0x391b22['hasOwnProperty'](_0x585b('0x20'))){if(_0x7f8b08[_0x585b('0x21')](_0x391b22[_0x585b('0x22')]['toLowerCase']())>=0x0&&_0x391b22[_0x585b('0x23')]!=='custom'){if(!_0x2d8ad6['answer']&&_0x391b22[_0x585b('0x20')]){_0x2d8ad6[_0x585b('0x20')]=!![];_0x506413[_0x585b('0x1c')]({'type':_0x391b22[_0x585b('0x10')],'app':_0x585b('0x24'),'context':_0x391b22[_0x585b('0x11')],'exten':_0x391b22['exten'],'priority':_0x3a779b['length']+_0x2d8ad6[_0x585b('0x12')]+_0x54fabb++,'VoiceExtensionId':_0xefa1f5[_0x3dd5ae][0x0][_0x585b('0x25')]});}if(!_0x2d8ad6['answer']&&!_0x2d8ad6[_0x585b('0xe')]&&!_0x391b22[_0x585b('0x20')]){_0x2d8ad6[_0x585b('0xe')]=!![];_0x506413[_0x585b('0x1c')]({'type':_0x391b22[_0x585b('0x10')],'app':'Progress','context':_0x391b22['context'],'exten':_0x391b22[_0x585b('0xb')],'priority':_0x3a779b['length']+_0x2d8ad6['priority']+_0x54fabb++,'VoiceExtensionId':_0xefa1f5[_0x3dd5ae][0x0]['VoiceExtensionId']});}}}if(_0x391b22[_0x585b('0xd')](_0x585b('0x26'))&&_0x391b22[_0x585b('0xd')](_0x585b('0x27'))){if(_0x391b22['record']){_0x506413[_0x585b('0x1c')]({'type':_0x391b22['type'],'app':_0x585b('0x28'),'appdata':'${UNIQUEID}.'+_0x391b22[_0x585b('0x27')]+_0x585b('0x29'),'context':_0x391b22['context'],'exten':_0x391b22[_0x585b('0xb')],'priority':_0x3a779b[_0x585b('0x2a')]+_0x2d8ad6['priority']+_0x54fabb++,'VoiceExtensionId':_0xefa1f5[_0x3dd5ae][0x0][_0x585b('0x25')]});}}if(_0x391b22['hasOwnProperty'](_0x585b('0x26'))&&_0x391b22[_0x585b('0xd')]('recordingFormat')){if(_0x391b22['record']){_0x36f139[_0x585b('0x1c')]({'type':_0x391b22[_0x585b('0x10')],'app':'StopMixMonitor','appdata':null,'context':_0x391b22[_0x585b('0x11')],'exten':_0x391b22['exten'],'priority':_0x3a779b[_0x585b('0x2a')]+_0x2d8ad6[_0x585b('0x12')]+_0x54fabb++ +0x1,'VoiceExtensionId':_0xefa1f5[_0x3dd5ae][0x0][_0x585b('0x25')]});}}for(var _0x2587df=0x0;_0x2587df<_0x3a779b[_0x585b('0x2a')];_0x2587df+=0x1){var _0x317f2e=_0x2d8ad6[_0x585b('0x12')]+_0x3a779b[_0x585b('0x2a')];var _0x3153bc=_0x2587df===_0x3a779b[_0x585b('0x2a')]-0x1?_0x2d8ad6['priority']+_0x506413[_0x585b('0x2a')]+_0x36f139['length']+0x2:_0x2d8ad6[_0x585b('0x12')]+_0x2587df+0x1;_0x506413['splice'](_0x2587df,0x0,{'type':_0x391b22[_0x585b('0x10')],'app':_0x585b('0x2b'),'appdata':_0x3a779b[_0x2587df]+'?'+_0x391b22['context']+',${EXTEN},'+_0x317f2e+':'+_0x391b22[_0x585b('0x11')]+',${EXTEN},'+_0x3153bc,'exten':_0x391b22[_0x585b('0xb')],'context':_0x391b22[_0x585b('0x11')],'priority':_0x2d8ad6['priority']+_0x2587df,'VoiceExtensionId':_0xefa1f5[_0x3dd5ae][0x0][_0x585b('0x25')]});}_0x391b22[_0x585b('0x12')]=_0x506413[_0x585b('0x2a')]?_[_0x585b('0x2c')](_0x506413)[_0x585b('0x12')]+0x1:_0x2d8ad6[_0x585b('0x12')];_0x2d8ad6[_0x585b('0x12')]=(_0x36f139[_0x585b('0x2a')]?_[_0x585b('0x2c')](_0x36f139)[_0x585b('0x12')]:_0x391b22['priority'])+0x1;_0x2d8ad6[_0x585b('0xf')]=_[_0x585b('0x2d')](_0x2d8ad6['extensions'],_0x506413,[_0x391b22],_0x36f139);}_0x2d8ad6[_0x585b('0xf')][_0x585b('0x1c')]({'type':_0xefa1f5[_0x3dd5ae][0x0][_0x585b('0x10')],'app':_0x585b('0x2e'),'exten':_0xefa1f5[_0x3dd5ae][0x0][_0x585b('0xb')],'context':_0xefa1f5[_0x3dd5ae][0x0][_0x585b('0x11')],'priority':_0x2d8ad6[_0x585b('0x12')],'VoiceExtensionId':_0xefa1f5[_0x3dd5ae][0x0][_0x585b('0x25')]});_0x3e89cc[_0x585b('0x1c')](_0xefa1f5[_0x3dd5ae][0x0][_0x585b('0x25')]);_0x388f4b=_[_0x585b('0x2d')](_0x388f4b,_0x2d8ad6[_0x585b('0xf')]);}}return _0x5128fb[_0x585b('0x2f')](function(_0x242435){return _0x5128fb[_0x585b('0x2')][_0x585b('0x6')][_0x585b('0x30')]({'where':{'VoiceExtensionId':{'$in':_0x3e89cc}},'transaction':_0x242435})['then'](function(_0xfbb708){return _0x5128fb[_0x585b('0x2')][_0x585b('0x6')][_0x585b('0x31')](_[_0x585b('0x32')](_0x388f4b,'priority'),{'transaction':_0x242435});});});})['catch'](function(_0x40ada8){console['error'](_0x40ada8);});}exports[_0x585b('0x33')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 61a0b71..9b4c959 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 _0x1db8=['register','argv','null','Missing\x20filepath\x20parameter!','undefined','contact','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','fromQuery','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','CmList','push','sequelize','VoiceQueueId','onlyIfOpen','query','findAll','BlackLists','all','Campaign','Lists','get','always','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter'];(function(_0x553a34,_0x4d7070){var _0x217fe3=function(_0x46e496){while(--_0x46e496){_0x553a34['push'](_0x553a34['shift']());}};_0x217fe3(++_0x4d7070);}(_0x1db8,0x120));var _0x81db=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x1db8[_0x486f4a];return _0x135d99;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x81db('0x0'));var Redis=require('ioredis');var db=require(_0x81db('0x1'))['db'];var config=require(_0x81db('0x2'));var logger=require(_0x81db('0x3'))(_0x81db('0x4'));config[_0x81db('0x5')]=_[_0x81db('0x6')](config[_0x81db('0x5')],{'host':_0x81db('0x7'),'port':0x18eb});var socket=require(_0x81db('0x8'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0x81db('0x9')](socket);try{if(!process[_0x81db('0xa')][0x2]||process[_0x81db('0xa')][0x2]==='undefined'||process[_0x81db('0xa')][0x2]===_0x81db('0xb')){throw new Error(_0x81db('0xc'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x81db('0xa')][0x3]===_0x81db('0xd')||process[_0x81db('0xa')][0x3]===_0x81db('0xb')||!process[_0x81db('0xa')][0x4]||process[_0x81db('0xa')][0x4]===_0x81db('0xd')||process[_0x81db('0xa')][0x4]===_0x81db('0xb')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_['zipObject'](process[_0x81db('0xa')][0x3]['split'](','),process[_0x81db('0xa')][0x4]['split'](','));if(!process[_0x81db('0xa')][0x5]||process[_0x81db('0xa')][0x5]===_0x81db('0xd')||process['argv'][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x81db('0xa')][0x6]&&process[_0x81db('0xa')][0x6]!==_0x81db('0xd')&&process[_0x81db('0xa')][0x6]!==_0x81db('0xb')?process[_0x81db('0xa')][0x6]:null;var DUPLICATES=process[_0x81db('0xa')][0x7]&&process[_0x81db('0xa')][0x7]!==_0x81db('0xd')&&process['argv'][0x7]!==_0x81db('0xb')?process[_0x81db('0xa')][0x7]:null;if(!process[_0x81db('0xa')][0x8]||process[_0x81db('0xa')][0x8]===_0x81db('0xd')||process[_0x81db('0xa')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x81db('0xa')][0x8];}catch(_0x2aa06e){logger['error'](_0x2aa06e);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(_0x1d4bfa,_0x5a7599,_0x3e1055,_0x3509be){var _0x389a6f={'message':_0x5a7599};_0x389a6f[_0x1d4bfa]=!![];if(_0x3e1055){_0x389a6f[_0x81db('0xe')]=_0x3e1055;}if(_0x3509be){_0x389a6f['index']=_0x3509be;}return _0x389a6f;}function isEmail(_0x486b27){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))*$/[_0x81db('0xf')](_0x486b27);}function checkRow(_0x4e77aa,_0x4e6878,_0x2c399c){return new BPromise(function(_0x55517c,_0x244177){if(_['isNil'](_0x4e77aa)){return _0x244177(handleCheckRowError(_0x81db('0x10'),_0x81db('0x11'),null,_0x2c399c));}if(_0x4e77aa[_0x81db('0x12')]&&_0x4e77aa[_0x81db('0x12')][_0x81db('0x13')]){var _0x2a9877=_['map'](_0x4e77aa[_0x81db('0x12')],_0x81db('0x14'))['join'](';');return _0x244177(handleCheckRowError(_0x81db('0x10'),_0x2a9877,null,_0x2c399c));}var _0x961204={};for(var _0x8d00c3 in FIELDS){if(FIELDS[_0x81db('0x15')](_0x8d00c3)&&FIELDS[_0x8d00c3]){_0x961204[_0x8d00c3]=_0x4e77aa[_0x81db('0x16')][0x0][FIELDS[_0x8d00c3]]||_0x4e77aa[_0x81db('0x16')][0x0]['\ufeff'+FIELDS[_0x8d00c3]];}}if(!_0x961204[_0x81db('0x17')]){return _0x244177(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x2c399c));}if(!_0x961204[_0x81db('0x18')]){return _0x244177(handleCheckRowError('error',_0x81db('0x19'),null,_0x2c399c));}if(_0x961204[_0x81db('0x1a')]){var _0x3d21ab=moment(_0x961204[_0x81db('0x1a')],'YYYY-MM-DD');if(!_0x3d21ab['isValid']()){return _0x244177(handleCheckRowError('error',_0x81db('0x1b'),null,_0x2c399c));}}if(_0x961204[_0x81db('0x1c')]){if(!isEmail(_0x961204[_0x81db('0x1c')])){return _0x244177(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x2c399c));}}_0x961204[_0x81db('0x1d')]=LISTID;_0x961204[_0x81db('0x1e')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x81db('0x13')]&&_0x4e6878){var _0x3b905f={};for(var _0xc3ea58=0x0,_0x3b1b1d=DUPLICATES[_0x81db('0x13')];_0xc3ea58<_0x3b1b1d;_0xc3ea58+=0x1){_0x3b905f[DUPLICATES[_0xc3ea58]]=_0x961204[DUPLICATES[_0xc3ea58]];}var _0x184c07=_[_0x81db('0x1f')](_0x4e6878,_0x3b905f);if(_0x184c07){return _0x244177(handleCheckRowError(_0x81db('0x20'),_0x81db('0x21'),_0x184c07,_0x2c399c));}}return db[_0x81db('0x22')][_0x81db('0x23')](_0x961204,{'raw':!![],'hooks':![],'fields':_[_0x81db('0x24')](_0x961204)})[_0x81db('0x25')](function(_0xfdb566){if(DUPLICATES&&DUPLICATES[_0x81db('0x13')]&&_0x4e6878){_0x4e6878['push'](_['pick'](_0x961204,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xfdb566['id'];return _0x55517c();})[_0x81db('0x26')](function(_0x3c504a){return _0x244177(handleCheckRowError(_0x81db('0x10'),_0x81db('0x27')+(_0x3c504a['message']||JSON[_0x81db('0x28')](_0x3c504a)),null,_0x2c399c));});});}function checkHopper(){function _0x5dde1e(){return function(_0x3f949d){logger[_0x81db('0x10')](_0x81db('0x29'),'checkHopper',util[_0x81db('0x2a')](_0x3f949d,{'showHidden':![],'depth':null}));};}var _0x262cfb=function(_0x4c3435,_0x5f2bfa){var _0x4b1e34=squel[_0x81db('0x2b')]()[_0x81db('0x2c')]('cm_hopper')[_0x81db('0x2d')]([_0x81db('0x18'),'scheduledAt',_0x81db('0x2e'),_0x81db('0x1d'),_0x5f2bfa,_0x81db('0x2f'),_0x81db('0x30')],squel[_0x81db('0x31')]()[_0x81db('0x32')](_0x81db('0x18'),_0x81db('0x18'))[_0x81db('0x32')](_0x81db('0x33'),_0x81db('0x34'))['field']('id',_0x81db('0x2e'))[_0x81db('0x32')](LISTID[_0x81db('0x35')](),_0x81db('0x1d'))[_0x81db('0x32')](_0x4c3435['id'][_0x81db('0x35')](),_0x5f2bfa)['field'](_0x81db('0x33'),_0x81db('0x2f'))['field'](_0x81db('0x33'),_0x81db('0x30'))[_0x81db('0x36')](_0x81db('0x37'))['where'](_0x81db('0x38'))['where'](_0x81db('0x39'),LISTID[_0x81db('0x35')]())[_0x81db('0x3a')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x81db('0x3b'),squel[_0x81db('0x31')]()[_0x81db('0x32')](_0x81db('0x18'))[_0x81db('0x36')](_0x81db('0x3c'))[_0x81db('0x3a')](_0x5f2bfa+_0x81db('0x3d'),_0x4c3435['id'][_0x81db('0x35')]())))[_0x81db('0x35')]();return _0x4b1e34;};var _0x1f14f1=function(_0x518c8d,_0x4da150){var _0x36295c=squel[_0x81db('0x2b')]()[_0x81db('0x2c')]('cm_hopper')['fromQuery']([_0x81db('0x18'),_0x81db('0x34'),'ContactId',_0x81db('0x1d'),_0x4da150,_0x81db('0x2f'),'updatedAt'],squel[_0x81db('0x31')]()[_0x81db('0x32')]('phone',_0x81db('0x18'))[_0x81db('0x32')](_0x81db('0x33'),_0x81db('0x34'))['field']('id',_0x81db('0x2e'))[_0x81db('0x32')](LISTID[_0x81db('0x35')](),_0x81db('0x1d'))[_0x81db('0x32')](_0x518c8d['id'][_0x81db('0x35')](),_0x4da150)[_0x81db('0x32')](_0x81db('0x33'),_0x81db('0x2f'))[_0x81db('0x32')](_0x81db('0x33'),_0x81db('0x30'))[_0x81db('0x36')](_0x81db('0x37'))['where'](_0x81db('0x38'))[_0x81db('0x3a')](_0x81db('0x39'),LISTID['toString']())[_0x81db('0x3a')](_0x81db('0x3e'),squel[_0x81db('0x3f')](hopperContacts))[_0x81db('0x3a')](_0x81db('0x40'))[_0x81db('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x81db('0x32')](_0x81db('0x41'))['from'](_0x81db('0x42'))[_0x81db('0x3a')](_0x4da150+_0x81db('0x3d'),_0x518c8d['id'][_0x81db('0x35')]()))[_0x81db('0x3a')](_0x81db('0x3b'),squel[_0x81db('0x31')]()[_0x81db('0x32')](_0x81db('0x18'))[_0x81db('0x36')]('cm_hopper')[_0x81db('0x3a')](_0x4da150+_0x81db('0x3d'),_0x518c8d['id'][_0x81db('0x35')]())))['toString']();return _0x36295c;};function _0x4e00b6(_0xfd04ff,_0x52a35f){var _0x34ccf0=squel['insert']()['into'](_0x81db('0x3c'))[_0x81db('0x2d')]([_0x81db('0x18'),_0x81db('0x34'),_0x81db('0x2e'),'ListId',_0x52a35f,'createdAt','updatedAt'],squel[_0x81db('0x31')]()[_0x81db('0x32')](_0x81db('0x18'),_0x81db('0x18'))[_0x81db('0x32')](_0x81db('0x33'),_0x81db('0x34'))['field']('id',_0x81db('0x2e'))[_0x81db('0x32')](LISTID['toString'](),_0x81db('0x1d'))['field'](_0xfd04ff['id'][_0x81db('0x35')](),_0x52a35f)[_0x81db('0x32')](_0x81db('0x33'),'createdAt')[_0x81db('0x32')](_0x81db('0x33'),_0x81db('0x30'))[_0x81db('0x36')](_0x81db('0x37'))[_0x81db('0x3a')](_0x81db('0x38'))[_0x81db('0x3a')](_0x81db('0x39'),LISTID[_0x81db('0x35')]())['where']('id\x20IN\x20?',squel[_0x81db('0x3f')](hopperContacts))[_0x81db('0x3a')](_0x81db('0x40')))[_0x81db('0x35')]();return _0x34ccf0;}function _0x3805a8(_0x2293b8,_0x89abf2){var _0x34c99a=squel[_0x81db('0x2b')]()[_0x81db('0x2c')](_0x81db('0x43'))[_0x81db('0x2d')]([_0x81db('0x18'),'ContactId',_0x81db('0x1d'),_0x89abf2,_0x81db('0x2f'),_0x81db('0x30')],squel[_0x81db('0x31')]()[_0x81db('0x32')](_0x81db('0x18'),'phone')[_0x81db('0x32')]('id',_0x81db('0x2e'))[_0x81db('0x32')](LISTID['toString'](),_0x81db('0x1d'))['field'](_0x2293b8['id'][_0x81db('0x35')](),_0x89abf2)[_0x81db('0x32')](_0x81db('0x33'),'createdAt')[_0x81db('0x32')](_0x81db('0x33'),_0x81db('0x30'))[_0x81db('0x36')](_0x81db('0x37'))[_0x81db('0x3a')](_0x81db('0x38'))[_0x81db('0x3a')]('ListId\x20=\x20?',LISTID[_0x81db('0x35')]())[_0x81db('0x3a')](_0x81db('0x3e'),squel['str'](hopperContacts))[_0x81db('0x3a')](_0x81db('0x40')))[_0x81db('0x35')]();return _0x34c99a;}return db[_0x81db('0x44')]['findAll']({'where':{'type':_0x81db('0x45')},'attributes':['id',_0x81db('0x46')],'include':[{'model':db[_0x81db('0x47')],'as':'Lists','where':{'id':LISTID}}]})[_0x81db('0x25')](function(_0x50091c){var _0x2c03f9=[];if(_0x50091c){var _0x560235;for(var _0xabc803=0x0,_0x336e37;_0xabc803<_0x50091c['length'];_0xabc803+=0x1){_0x336e37=_0x50091c[_0xabc803]['get']({'plain':!![]});switch(_0x336e37[_0x81db('0x46')]){case'always':_0x2c03f9[_0x81db('0x48')](db[_0x81db('0x49')]['query'](_0x1f14f1(_0x336e37,_0x81db('0x4a')))['then'](function(){})[_0x81db('0x26')](_0x5dde1e()));break;case _0x81db('0x4b'):_0x2c03f9[_0x81db('0x48')](db['sequelize'][_0x81db('0x4c')](_0x262cfb(_0x336e37,'VoiceQueueId'))[_0x81db('0x25')](function(){})[_0x81db('0x26')](_0x5dde1e()));break;default:_0x2c03f9[_0x81db('0x48')](db['sequelize']['query'](_0x4e00b6(_0x336e37,_0x81db('0x4a')))[_0x81db('0x25')](function(){})['catch'](_0x5dde1e()));}}}return _0x2c03f9;})['all']()[_0x81db('0x25')](function(){return db['VoiceQueue'][_0x81db('0x4d')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x81db('0x47')],'as':_0x81db('0x4e'),'where':{'id':LISTID}}]})[_0x81db('0x25')](function(_0x117fd0){var _0x5ba84f=[];if(_0x117fd0){var _0x4054d4;for(var _0x4efa49=0x0,_0x2f3c70;_0x4efa49<_0x117fd0[_0x81db('0x13')];_0x4efa49+=0x1){_0x2f3c70=_0x117fd0[_0x4efa49]['get']({'plain':!![]});_0x5ba84f[_0x81db('0x48')](db[_0x81db('0x49')][_0x81db('0x4c')](_0x3805a8(_0x2f3c70,_0x81db('0x4a')))[_0x81db('0x25')](function(){})['catch'](_0x5dde1e()));}}return _0x5ba84f;})[_0x81db('0x4f')]();})[_0x81db('0x25')](function(){return db[_0x81db('0x50')][_0x81db('0x4d')]({'attributes':['id',_0x81db('0x46')],'include':[{'model':db[_0x81db('0x47')],'as':_0x81db('0x51'),'where':{'id':LISTID}}]})[_0x81db('0x25')](function(_0x1a8fcd){var _0x44ba22=[];if(_0x1a8fcd){for(var _0x5016e4=0x0,_0x8d1f3d;_0x5016e4<_0x1a8fcd[_0x81db('0x13')];_0x5016e4+=0x1){_0x8d1f3d=_0x1a8fcd[_0x5016e4][_0x81db('0x52')]({'plain':!![]});switch(_0x8d1f3d[_0x81db('0x46')]){case _0x81db('0x53'):_0x44ba22[_0x81db('0x48')](db[_0x81db('0x49')]['query'](_0x1f14f1(_0x8d1f3d,_0x81db('0x54')))[_0x81db('0x25')](function(){})[_0x81db('0x26')](_0x5dde1e()));break;case _0x81db('0x4b'):_0x44ba22[_0x81db('0x48')](db[_0x81db('0x49')]['query'](_0x262cfb(_0x8d1f3d,_0x81db('0x54')))[_0x81db('0x25')](function(){})[_0x81db('0x26')](_0x5dde1e()));break;default:_0x44ba22[_0x81db('0x48')](db['sequelize']['query'](_0x4e00b6(_0x8d1f3d,'CampaignId'))[_0x81db('0x25')](function(){})[_0x81db('0x26')](_0x5dde1e()));}}}return _0x44ba22;})[_0x81db('0x4f')]();})[_0x81db('0x25')](function(){return db['Campaign'][_0x81db('0x4d')]({'attributes':['id'],'include':[{'model':db[_0x81db('0x47')],'as':_0x81db('0x4e'),'where':{'id':LISTID}}]})[_0x81db('0x25')](function(_0x3fa199){var _0x59c576=[];if(_0x3fa199){for(var _0x320c54=0x0,_0x2cb9e5;_0x320c54<_0x3fa199[_0x81db('0x13')];_0x320c54+=0x1){_0x2cb9e5=_0x3fa199[_0x320c54]['get']({'plain':!![]});_0x59c576[_0x81db('0x48')](db['sequelize']['query'](_0x3805a8(_0x2cb9e5,_0x81db('0x54')))[_0x81db('0x25')](function(){})[_0x81db('0x26')](_0x5dde1e()));}}return _0x59c576;})['all']();})['catch'](function(_0xd22293){logger[_0x81db('0x10')](_0x81db('0x55'),'generalCheckHopper',_0xd22293['message']);});}var processPromises=function(_0x5e4128){return BPromise['all'](promises)['then'](function(_0x4b6d16){})[_0x81db('0x26')](function(_0x2bb060){logger[_0x81db('0x10')](_0x81db('0x56'),JSON[_0x81db('0x28')](_0x2bb060));})[_0x81db('0x57')](function(){socket[_0x81db('0x58')](_0x81db('0x59')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5e4128){return _0x5e4128[_0x81db('0x5a')]();}});};var endCsv=function(){return BPromise[_0x81db('0x5b')]()[_0x81db('0x25')](function(){if(hopperContacts){return checkHopper();}})[_0x81db('0x25')](function(){socket['emit'](_0x81db('0x59')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x139e2b){logger[_0x81db('0x10')](_0x81db('0x5c'),JSON[_0x81db('0x28')](_0x139e2b));}finally{process[_0x81db('0x5d')](0x0);}});};process['on']('SIGINT',function(){logger[_0x81db('0x5e')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x81db('0x5b')]()[_0x81db('0x25')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x81db('0x22')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x5db1cd){var _0x2920c5=fs[_0x81db('0x5f')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x81db('0x60')](_0x2920c5,{'header':!![],'skipEmptyLines':!![],'step':function(_0x14bd71,_0x4ceb64){total+=0x1;var _0x44cf43=total;promises[_0x81db('0x48')](checkRow(_0x14bd71,_0x5db1cd,_0x44cf43)[_0x81db('0x25')](function(){success+=0x1;})[_0x81db('0x26')](function(_0x3a7208){if(_0x3a7208['error']){errors+=0x1;delete _0x3a7208[_0x81db('0x10')];}else if(_0x3a7208['duplicate']){duplicates+=0x1;delete _0x3a7208[_0x81db('0x20')];}rows[_0x81db('0x48')](_0x3a7208);}));if(total%0xc8===0x0){_0x4ceb64[_0x81db('0x61')]();return processPromises(_0x4ceb64);}},'complete':function(){return processPromises()['then'](function(){logger[_0x81db('0x5e')](_0x81db('0x62'));endCsv();});},'error':function(_0x77e8db,_0x4d9707){logger[_0x81db('0x5e')]('CSV\x20parse\x20error',JSON[_0x81db('0x28')](_0x77e8db));endCsv();}});})[_0x81db('0x26')](function(_0x52effc){logger[_0x81db('0x10')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x52effc));});}main(); \ No newline at end of file +var _0x4a80=['null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','create','keys','then','push','pick','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','cm_hopper_final','deletedAt\x20IS\x20NULL','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','get','always','sequelize','query','VoiceQueueId','catch','onlyIfOpen','all','BlackLists','Campaign','Lists','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','ioredis','../../../mysqldb','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined'];(function(_0x5e3e9c,_0x555b44){var _0x1d7fbe=function(_0x5016db){while(--_0x5016db){_0x5e3e9c['push'](_0x5e3e9c['shift']());}};_0x1d7fbe(++_0x555b44);}(_0x4a80,0xd0));var _0x04a8=function(_0x1afdfb,_0x56696d){_0x1afdfb=_0x1afdfb-0x0;var _0x4fe9a5=_0x4a80[_0x1afdfb];return _0x4fe9a5;};'use strict';var BPromise=require(_0x04a8('0x0'));var util=require(_0x04a8('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x04a8('0x2'));var db=require(_0x04a8('0x3'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x04a8('0x4'));config[_0x04a8('0x5')]=_[_0x04a8('0x6')](config['redis'],{'host':_0x04a8('0x7'),'port':0x18eb});var socket=require(_0x04a8('0x8'))(new Redis(config[_0x04a8('0x5')]));require(_0x04a8('0x9'))['register'](socket);try{if(!process[_0x04a8('0xa')][0x2]||process[_0x04a8('0xa')][0x2]===_0x04a8('0xb')||process[_0x04a8('0xa')][0x2]===_0x04a8('0xc')){throw new Error(_0x04a8('0xd'));}var FILEPATH=process['argv'][0x2];if(!process[_0x04a8('0xa')][0x3]||process['argv'][0x3]==='undefined'||process[_0x04a8('0xa')][0x3]==='null'||!process[_0x04a8('0xa')][0x4]||process['argv'][0x4]===_0x04a8('0xb')||process[_0x04a8('0xa')][0x4]===_0x04a8('0xc')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x04a8('0xe')](process['argv'][0x3][_0x04a8('0xf')](','),process[_0x04a8('0xa')][0x4][_0x04a8('0xf')](','));if(!process['argv'][0x5]||process[_0x04a8('0xa')][0x5]===_0x04a8('0xb')||process[_0x04a8('0xa')][0x5]===_0x04a8('0xc')){throw new Error(_0x04a8('0x10'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x04a8('0xa')][0x6]&&process['argv'][0x6]!==_0x04a8('0xb')&&process[_0x04a8('0xa')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0x04a8('0xa')][0x7]&&process[_0x04a8('0xa')][0x7]!=='undefined'&&process[_0x04a8('0xa')][0x7]!==_0x04a8('0xc')?process['argv'][0x7]:null;if(!process[_0x04a8('0xa')][0x8]||process['argv'][0x8]===_0x04a8('0xb')||process[_0x04a8('0xa')][0x8]===_0x04a8('0xc')){throw new Error(_0x04a8('0x11'));}var SOCKET_TIMESTAMP=process[_0x04a8('0xa')][0x8];}catch(_0x39a822){logger[_0x04a8('0x12')](_0x39a822);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(_0xd4fec2,_0x262336,_0x3c4519,_0x327809){var _0x1d001d={'message':_0x262336};_0x1d001d[_0xd4fec2]=!![];if(_0x3c4519){_0x1d001d[_0x04a8('0x13')]=_0x3c4519;}if(_0x327809){_0x1d001d[_0x04a8('0x14')]=_0x327809;}return _0x1d001d;}function isEmail(_0x99455e){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'](_0x99455e);}function checkRow(_0x46b603,_0x294242,_0x3a09d0){return new BPromise(function(_0x4d700c,_0x578cf6){if(_[_0x04a8('0x15')](_0x46b603)){return _0x578cf6(handleCheckRowError(_0x04a8('0x12'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3a09d0));}if(_0x46b603[_0x04a8('0x16')]&&_0x46b603[_0x04a8('0x16')][_0x04a8('0x17')]){var _0x79b664=_[_0x04a8('0x18')](_0x46b603[_0x04a8('0x16')],_0x04a8('0x19'))[_0x04a8('0x1a')](';');return _0x578cf6(handleCheckRowError('error',_0x79b664,null,_0x3a09d0));}var _0x560d1c={};for(var _0x158798 in FIELDS){if(FIELDS[_0x04a8('0x1b')](_0x158798)&&FIELDS[_0x158798]){_0x560d1c[_0x158798]=_0x46b603[_0x04a8('0x1c')][0x0][FIELDS[_0x158798]]||_0x46b603[_0x04a8('0x1c')][0x0]['\ufeff'+FIELDS[_0x158798]];}}if(!_0x560d1c[_0x04a8('0x1d')]){return _0x578cf6(handleCheckRowError(_0x04a8('0x12'),_0x04a8('0x1e'),null,_0x3a09d0));}if(!_0x560d1c['phone']){return _0x578cf6(handleCheckRowError(_0x04a8('0x12'),_0x04a8('0x1f'),null,_0x3a09d0));}if(_0x560d1c[_0x04a8('0x20')]){var _0x465d77=moment(_0x560d1c['birthDate'],_0x04a8('0x21'));if(!_0x465d77[_0x04a8('0x22')]()){return _0x578cf6(handleCheckRowError(_0x04a8('0x12'),_0x04a8('0x23'),null,_0x3a09d0));}}if(_0x560d1c['email']){if(!isEmail(_0x560d1c[_0x04a8('0x24')])){return _0x578cf6(handleCheckRowError(_0x04a8('0x12'),_0x04a8('0x25'),null,_0x3a09d0));}}_0x560d1c[_0x04a8('0x26')]=LISTID;_0x560d1c[_0x04a8('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x04a8('0x17')]&&_0x294242){var _0x4a138f={};for(var _0x222f26=0x0,_0x32e92e=DUPLICATES[_0x04a8('0x17')];_0x222f26<_0x32e92e;_0x222f26+=0x1){_0x4a138f[DUPLICATES[_0x222f26]]=_0x560d1c[DUPLICATES[_0x222f26]];}var _0x462f02=_[_0x04a8('0x28')](_0x294242,_0x4a138f);if(_0x462f02){return _0x578cf6(handleCheckRowError(_0x04a8('0x29'),_0x04a8('0x2a'),_0x462f02,_0x3a09d0));}}return db['CmContact'][_0x04a8('0x2b')](_0x560d1c,{'raw':!![],'hooks':![],'fields':_[_0x04a8('0x2c')](_0x560d1c)})[_0x04a8('0x2d')](function(_0x1569f9){if(DUPLICATES&&DUPLICATES[_0x04a8('0x17')]&&_0x294242){_0x294242[_0x04a8('0x2e')](_[_0x04a8('0x2f')](_0x560d1c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1569f9['id'];return _0x4d700c();})['catch'](function(_0x5118db){return _0x578cf6(handleCheckRowError(_0x04a8('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x5118db['message']||JSON[_0x04a8('0x30')](_0x5118db)),null,_0x3a09d0));});});}function checkHopper(){function _0x53668f(){return function(_0x11bb95){logger['error'](_0x04a8('0x31'),'checkHopper',util[_0x04a8('0x32')](_0x11bb95,{'showHidden':![],'depth':null}));};}var _0x5928c1=function(_0x58c805,_0x25fb1e){var _0x4d5ee5=squel[_0x04a8('0x33')]()[_0x04a8('0x34')](_0x04a8('0x35'))[_0x04a8('0x36')]([_0x04a8('0x37'),_0x04a8('0x38'),_0x04a8('0x39'),_0x04a8('0x26'),_0x25fb1e,_0x04a8('0x3a'),_0x04a8('0x3b')],squel[_0x04a8('0x3c')]()[_0x04a8('0x3d')](_0x04a8('0x37'),'phone')[_0x04a8('0x3d')](_0x04a8('0x3e'),_0x04a8('0x38'))[_0x04a8('0x3d')]('id',_0x04a8('0x39'))[_0x04a8('0x3d')](LISTID[_0x04a8('0x3f')](),'ListId')[_0x04a8('0x3d')](_0x58c805['id'][_0x04a8('0x3f')](),_0x25fb1e)[_0x04a8('0x3d')]('NOW()',_0x04a8('0x3a'))[_0x04a8('0x3d')](_0x04a8('0x3e'),_0x04a8('0x3b'))[_0x04a8('0x40')](_0x04a8('0x41'))[_0x04a8('0x42')]('deletedAt\x20IS\x20NULL')['where'](_0x04a8('0x43'),LISTID[_0x04a8('0x3f')]())[_0x04a8('0x42')](_0x04a8('0x44'))[_0x04a8('0x42')](_0x04a8('0x45'),squel[_0x04a8('0x3c')]()[_0x04a8('0x3d')](_0x04a8('0x37'))[_0x04a8('0x40')](_0x04a8('0x35'))[_0x04a8('0x42')](_0x25fb1e+_0x04a8('0x46'),_0x58c805['id'][_0x04a8('0x3f')]())))['toString']();return _0x4d5ee5;};var _0x2f8bc4=function(_0x1d32c1,_0xd218c3){var _0x2b484a=squel[_0x04a8('0x33')]()[_0x04a8('0x34')](_0x04a8('0x35'))[_0x04a8('0x36')]([_0x04a8('0x37'),'scheduledAt',_0x04a8('0x39'),'ListId',_0xd218c3,'createdAt','updatedAt'],squel[_0x04a8('0x3c')]()[_0x04a8('0x3d')](_0x04a8('0x37'),_0x04a8('0x37'))[_0x04a8('0x3d')](_0x04a8('0x3e'),_0x04a8('0x38'))[_0x04a8('0x3d')]('id','ContactId')[_0x04a8('0x3d')](LISTID['toString'](),_0x04a8('0x26'))[_0x04a8('0x3d')](_0x1d32c1['id']['toString'](),_0xd218c3)[_0x04a8('0x3d')](_0x04a8('0x3e'),_0x04a8('0x3a'))['field'](_0x04a8('0x3e'),_0x04a8('0x3b'))[_0x04a8('0x40')](_0x04a8('0x41'))[_0x04a8('0x42')]('deletedAt\x20IS\x20NULL')['where'](_0x04a8('0x43'),LISTID[_0x04a8('0x3f')]())[_0x04a8('0x42')](_0x04a8('0x47'),squel[_0x04a8('0x48')](hopperContacts))[_0x04a8('0x42')](_0x04a8('0x44'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x04a8('0x3d')]('calleridnum')[_0x04a8('0x40')](_0x04a8('0x49'))[_0x04a8('0x42')](_0xd218c3+_0x04a8('0x46'),_0x1d32c1['id'][_0x04a8('0x3f')]()))[_0x04a8('0x42')](_0x04a8('0x45'),squel['select']()[_0x04a8('0x3d')](_0x04a8('0x37'))[_0x04a8('0x40')](_0x04a8('0x35'))[_0x04a8('0x42')](_0xd218c3+_0x04a8('0x46'),_0x1d32c1['id'][_0x04a8('0x3f')]())))[_0x04a8('0x3f')]();return _0x2b484a;};function _0x4d6adb(_0x57b788,_0x3d59a0){var _0x474486=squel['insert']()[_0x04a8('0x34')](_0x04a8('0x35'))['fromQuery']([_0x04a8('0x37'),'scheduledAt',_0x04a8('0x39'),'ListId',_0x3d59a0,'createdAt',_0x04a8('0x3b')],squel[_0x04a8('0x3c')]()[_0x04a8('0x3d')]('phone',_0x04a8('0x37'))[_0x04a8('0x3d')](_0x04a8('0x3e'),'scheduledAt')[_0x04a8('0x3d')]('id',_0x04a8('0x39'))[_0x04a8('0x3d')](LISTID[_0x04a8('0x3f')](),_0x04a8('0x26'))[_0x04a8('0x3d')](_0x57b788['id'][_0x04a8('0x3f')](),_0x3d59a0)[_0x04a8('0x3d')]('NOW()',_0x04a8('0x3a'))['field'](_0x04a8('0x3e'),_0x04a8('0x3b'))[_0x04a8('0x40')](_0x04a8('0x41'))[_0x04a8('0x42')](_0x04a8('0x4a'))['where']('ListId\x20=\x20?',LISTID[_0x04a8('0x3f')]())[_0x04a8('0x42')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x04a8('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x04a8('0x3f')]();return _0x474486;}function _0x1e6787(_0xafd551,_0x434d75){var _0x5bd722=squel[_0x04a8('0x33')]()[_0x04a8('0x34')](_0x04a8('0x4b'))[_0x04a8('0x36')]([_0x04a8('0x37'),'ContactId',_0x04a8('0x26'),_0x434d75,'createdAt',_0x04a8('0x3b')],squel[_0x04a8('0x3c')]()['field'](_0x04a8('0x37'),_0x04a8('0x37'))[_0x04a8('0x3d')]('id',_0x04a8('0x39'))[_0x04a8('0x3d')](LISTID['toString'](),_0x04a8('0x26'))[_0x04a8('0x3d')](_0xafd551['id'][_0x04a8('0x3f')](),_0x434d75)['field'](_0x04a8('0x3e'),_0x04a8('0x3a'))['field'](_0x04a8('0x3e'),_0x04a8('0x3b'))['from'](_0x04a8('0x41'))['where'](_0x04a8('0x4a'))[_0x04a8('0x42')](_0x04a8('0x43'),LISTID['toString']())[_0x04a8('0x42')](_0x04a8('0x47'),squel['str'](hopperContacts))[_0x04a8('0x42')](_0x04a8('0x44')))[_0x04a8('0x3f')]();return _0x5bd722;}return db['VoiceQueue'][_0x04a8('0x4c')]({'where':{'type':_0x04a8('0x4d')},'attributes':['id',_0x04a8('0x4e')],'include':[{'model':db[_0x04a8('0x4f')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x2d8bb6){var _0x543bd6=[];if(_0x2d8bb6){var _0x28679a;for(var _0x349ecd=0x0,_0x2104b8;_0x349ecd<_0x2d8bb6[_0x04a8('0x17')];_0x349ecd+=0x1){_0x2104b8=_0x2d8bb6[_0x349ecd][_0x04a8('0x50')]({'plain':!![]});switch(_0x2104b8[_0x04a8('0x4e')]){case _0x04a8('0x51'):_0x543bd6['push'](db[_0x04a8('0x52')][_0x04a8('0x53')](_0x2f8bc4(_0x2104b8,_0x04a8('0x54')))['then'](function(){})[_0x04a8('0x55')](_0x53668f()));break;case _0x04a8('0x56'):_0x543bd6['push'](db[_0x04a8('0x52')][_0x04a8('0x53')](_0x5928c1(_0x2104b8,_0x04a8('0x54')))[_0x04a8('0x2d')](function(){})[_0x04a8('0x55')](_0x53668f()));break;default:_0x543bd6[_0x04a8('0x2e')](db[_0x04a8('0x52')][_0x04a8('0x53')](_0x4d6adb(_0x2104b8,_0x04a8('0x54')))['then'](function(){})[_0x04a8('0x55')](_0x53668f()));}}}return _0x543bd6;})[_0x04a8('0x57')]()[_0x04a8('0x2d')](function(){return db['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x04a8('0x4f')],'as':_0x04a8('0x58'),'where':{'id':LISTID}}]})[_0x04a8('0x2d')](function(_0x58bf1f){var _0x258512=[];if(_0x58bf1f){var _0x1db9b9;for(var _0x5dac71=0x0,_0x35cf0c;_0x5dac71<_0x58bf1f[_0x04a8('0x17')];_0x5dac71+=0x1){_0x35cf0c=_0x58bf1f[_0x5dac71][_0x04a8('0x50')]({'plain':!![]});_0x258512[_0x04a8('0x2e')](db[_0x04a8('0x52')][_0x04a8('0x53')](_0x1e6787(_0x35cf0c,_0x04a8('0x54')))['then'](function(){})[_0x04a8('0x55')](_0x53668f()));}}return _0x258512;})['all']();})[_0x04a8('0x2d')](function(){return db[_0x04a8('0x59')][_0x04a8('0x4c')]({'attributes':['id',_0x04a8('0x4e')],'include':[{'model':db[_0x04a8('0x4f')],'as':_0x04a8('0x5a'),'where':{'id':LISTID}}]})[_0x04a8('0x2d')](function(_0x41b95d){var _0x4802a8=[];if(_0x41b95d){for(var _0x275562=0x0,_0x58cc5e;_0x275562<_0x41b95d[_0x04a8('0x17')];_0x275562+=0x1){_0x58cc5e=_0x41b95d[_0x275562][_0x04a8('0x50')]({'plain':!![]});switch(_0x58cc5e[_0x04a8('0x4e')]){case'always':_0x4802a8[_0x04a8('0x2e')](db[_0x04a8('0x52')][_0x04a8('0x53')](_0x2f8bc4(_0x58cc5e,_0x04a8('0x5b')))[_0x04a8('0x2d')](function(){})['catch'](_0x53668f()));break;case'onlyIfOpen':_0x4802a8['push'](db['sequelize']['query'](_0x5928c1(_0x58cc5e,'CampaignId'))[_0x04a8('0x2d')](function(){})[_0x04a8('0x55')](_0x53668f()));break;default:_0x4802a8['push'](db['sequelize'][_0x04a8('0x53')](_0x4d6adb(_0x58cc5e,'CampaignId'))[_0x04a8('0x2d')](function(){})[_0x04a8('0x55')](_0x53668f()));}}}return _0x4802a8;})[_0x04a8('0x57')]();})['then'](function(){return db[_0x04a8('0x59')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x04a8('0x4f')],'as':_0x04a8('0x58'),'where':{'id':LISTID}}]})[_0x04a8('0x2d')](function(_0x10112a){var _0x212b1d=[];if(_0x10112a){for(var _0x13def2=0x0,_0x3ae342;_0x13def2<_0x10112a[_0x04a8('0x17')];_0x13def2+=0x1){_0x3ae342=_0x10112a[_0x13def2]['get']({'plain':!![]});_0x212b1d[_0x04a8('0x2e')](db[_0x04a8('0x52')][_0x04a8('0x53')](_0x1e6787(_0x3ae342,_0x04a8('0x5b')))[_0x04a8('0x2d')](function(){})['catch'](_0x53668f()));}}return _0x212b1d;})[_0x04a8('0x57')]();})[_0x04a8('0x55')](function(_0x19f538){logger['error']('cmContact,\x20%s,\x20%s',_0x04a8('0x5c'),_0x19f538[_0x04a8('0x19')]);});}var processPromises=function(_0x47de93){return BPromise[_0x04a8('0x57')](promises)[_0x04a8('0x2d')](function(_0x290301){})[_0x04a8('0x55')](function(_0x2a98a0){logger[_0x04a8('0x12')](_0x04a8('0x5d'),JSON[_0x04a8('0x30')](_0x2a98a0));})[_0x04a8('0x5e')](function(){socket[_0x04a8('0x5f')](_0x04a8('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x47de93){return _0x47de93[_0x04a8('0x61')]();}});};var endCsv=function(){return BPromise[_0x04a8('0x62')]()[_0x04a8('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x04a8('0x2d')](function(){socket[_0x04a8('0x5f')](_0x04a8('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x04a8('0x63')](FILEPATH);}catch(_0x557bd8){logger['error'](_0x04a8('0x64'),JSON[_0x04a8('0x30')](_0x557bd8));}finally{process[_0x04a8('0x65')](0x0);}});};process['on']('SIGINT',function(){logger[_0x04a8('0x66')](_0x04a8('0x67'));endCsv();});function main(){return BPromise[_0x04a8('0x62')]()[_0x04a8('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x04a8('0xf')](',');return db[_0x04a8('0x68')][_0x04a8('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x4993d2){var _0x222c05=fs[_0x04a8('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x04a8('0x6a')](_0x222c05,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3e3db9,_0x4f4ad0){total+=0x1;var _0x3bc12d=total;promises[_0x04a8('0x2e')](checkRow(_0x3e3db9,_0x4993d2,_0x3bc12d)[_0x04a8('0x2d')](function(){success+=0x1;})[_0x04a8('0x55')](function(_0x5052f4){if(_0x5052f4[_0x04a8('0x12')]){errors+=0x1;delete _0x5052f4['error'];}else if(_0x5052f4[_0x04a8('0x29')]){duplicates+=0x1;delete _0x5052f4[_0x04a8('0x29')];}rows['push'](_0x5052f4);}));if(total%0xc8===0x0){_0x4f4ad0[_0x04a8('0x6b')]();return processPromises(_0x4f4ad0);}},'complete':function(){return processPromises()['then'](function(){logger[_0x04a8('0x66')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x4be280,_0x1a3aea){logger[_0x04a8('0x66')](_0x04a8('0x6c'),JSON[_0x04a8('0x30')](_0x4be280));endCsv();}});})[_0x04a8('0x55')](function(_0x43d940){logger[_0x04a8('0x12')](_0x04a8('0x6d'),JSON[_0x04a8('0x30')](_0x43d940));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 9ada90c..3d9563e 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 _0x44c5=['voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','complete','argv','existsSync','parse','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','path','papaparse','moment','squel','ioredis','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','test','field','phone','from','join','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.ListId','cm_contacts.updatedAt','cm_hopper_black','fromQuery','ContactId','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','query','spread','catch','main','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','writeFileSync','createReadStream','data','length','rows','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','push','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()'];(function(_0x55e204,_0x2aea71){var _0x2c205d=function(_0x8fd9e){while(--_0x8fd9e){_0x55e204['push'](_0x55e204['shift']());}};_0x2c205d(++_0x2aea71);}(_0x44c5,0x124));var _0x544c=function(_0x301dab,_0x38050a){_0x301dab=_0x301dab-0x0;var _0x2500a2=_0x44c5[_0x301dab];return _0x2500a2;};'use strict';var fs=require('fs');var path=require(_0x544c('0x0'));var _=require('lodash');var Papa=require(_0x544c('0x1'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x544c('0x2'));var squel=require(_0x544c('0x3'));var Redis=require(_0x544c('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x544c('0x5'));var logger=require(_0x544c('0x6'))(_0x544c('0x7'));config[_0x544c('0x8')]=_[_0x544c('0x9')](config['redis'],{'host':_0x544c('0xa'),'port':0x18eb});var socket=require(_0x544c('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x544c('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x38bfd1){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))*$/[_0x544c('0xd')](_0x38bfd1);}function selectNotIn(_0xaed3aa,_0x55798a,_0x5aa511,_0xbdda2d,_0x2acdc4){return squel['select']()[_0x544c('0xe')](_0x544c('0xf'))[_0x544c('0x10')](_0xbdda2d)[_0x544c('0x11')](_0x55798a,null,_0x55798a+'.id\x20=\x20'+_0xbdda2d+'.'+_0x5aa511)['where'](_0xbdda2d+'.'+_0x5aa511+_0x544c('0x12')+_0xaed3aa+'.'+_0x5aa511)[_0x544c('0x13')](_0x55798a+_0x544c('0x14')+_0x2acdc4[_0x544c('0x11')]()+')');}function insertCmHopper(_0x1ac348,_0x52b31a,_0x43912c,_0x4fef14,_0x13babe){var _0x3e4e48=['cm_contacts.phone',_0x544c('0x15'),_0x544c('0x16'),'cm_contacts.ListId',_0x52b31a+'.'+_0x4fef14,_0x544c('0x17'),'cm_contacts.updatedAt',_0x544c('0x18'),_0x544c('0x19'),'\x22'+_0x13babe+'\x22'];return squel[_0x544c('0x1a')]()[_0x544c('0x1b')](_0x544c('0x1c'))['fromQuery'](['phone',_0x544c('0x1d'),'ContactId',_0x544c('0x1e'),_0x4fef14,_0x544c('0x1f'),_0x544c('0x20'),_0x544c('0x21'),_0x544c('0x22'),_0x544c('0x23')],squel[_0x544c('0x24')]()[_0x544c('0x25')](_0x3e4e48)[_0x544c('0x10')](_0x52b31a)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x52b31a+'.CmListId')[_0x544c('0x11')](_0x43912c,null,_0x43912c+_0x544c('0x26')+_0x52b31a+'.'+_0x4fef14)['where'](_0x52b31a+_0x544c('0x27'),_0x1ac348)['where'](_0x544c('0x28'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x52b31a,_0x43912c,_0x4fef14,_0x544c('0x1c'),[_0x544c('0x29'),_0x544c('0x2a')]))[_0x544c('0x13')](_0x544c('0x2b'),selectNotIn(_0x52b31a,_0x43912c,_0x4fef14,'cm_hopper',[_0x544c('0x29')])))[_0x544c('0x2c')]();}function insertCmHopperBlack(_0x14bc28,_0x3d0b8f,_0x4fde5a,_0xd6a40){var _0x525108=['cm_contacts.phone',_0x544c('0x16'),_0x544c('0x2d'),_0x3d0b8f+'.'+_0xd6a40,'cm_contacts.createdAt',_0x544c('0x2e')];return squel[_0x544c('0x1a')]()[_0x544c('0x1b')](_0x544c('0x2f'))[_0x544c('0x30')]([_0x544c('0xf'),_0x544c('0x31'),'ListId',_0xd6a40,_0x544c('0x1f'),_0x544c('0x20')],squel[_0x544c('0x24')]()['fields'](_0x525108)[_0x544c('0x10')](_0x3d0b8f)[_0x544c('0x11')](_0x544c('0x32'),null,_0x544c('0x33')+_0x3d0b8f+_0x544c('0x34'))[_0x544c('0x11')](_0x4fde5a,null,_0x4fde5a+_0x544c('0x26')+_0x3d0b8f+'.'+_0xd6a40)[_0x544c('0x13')](_0x3d0b8f+'.CmListId\x20=\x20?',_0x14bc28)[_0x544c('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x544c('0x13')](_0x544c('0x2b'),squel['select']()[_0x544c('0xe')](_0x544c('0xf'))['from'](_0x544c('0x2f'))[_0x544c('0x13')](_0x544c('0x35'),_0x14bc28)['where'](_0xd6a40+_0x544c('0x36'),_0x3d0b8f+'.'+_0xd6a40)))[_0x544c('0x2c')]();}function insertCmContact(_0xcd1a8e,_0x4b0256,_0x31c4d5,_0x394bac){var _0x49128f=_[_0x544c('0x37')](_[_0x544c('0x38')](_0x394bac),[_0x544c('0x1e'),_0x544c('0x39'),_0x544c('0x1f'),_0x544c('0x20')]);return squel[_0x544c('0x1a')]()[_0x544c('0x1b')]('cm_contacts')[_0x544c('0x30')](_0x49128f,squel[_0x544c('0x24')]()[_0x544c('0x25')](_0x49128f)[_0x544c('0x10')](_0x4b0256)['where']('('+_0x31c4d5[_0x544c('0x11')](',')+_0x544c('0x3a'),squel[_0x544c('0x24')]()['fields'](_0x31c4d5)[_0x544c('0x10')](_0x544c('0x32'))[_0x544c('0x13')](_0x544c('0x35'),_0xcd1a8e))['where'](_0x544c('0x3b'),squel[_0x544c('0x24')]()['field'](_0x544c('0x3c'),_0x544c('0x3d'))[_0x544c('0x10')](_0x4b0256)[_0x544c('0x3e')](_0x31c4d5[_0x544c('0x11')](','))))['toString']();}function handleStop(){logger[_0x544c('0x3f')](_0x544c('0x40'));stopped=!![];}function handleUncaughtException(_0x1fca98){logger[_0x544c('0x41')](_0x1fca98[_0x544c('0x42')]);process[_0x544c('0x43')](0x1);}function handleError(_0x28ba58,_0x3a99f1){stats[_0x544c('0x44')]['push']({'name':_0x3a99f1['code'],'message':_0x3a99f1['message'],'row':_0x28ba58});}function handleQuery(_0x41c31e){logger[_0x544c('0x3f')](_0x41c31e);return db['sequelize'][_0x544c('0x45')](_0x41c31e)[_0x544c('0x46')](function(_0x373bab){results['push'](_0x373bab);})[_0x544c('0x47')](function(_0xbd179a){logger[_0x544c('0x41')](_0xbd179a[_0x544c('0x42')]);});}function main(_0x45a097,_0x596415,_0x142766,_0x1d76d0){logger[_0x544c('0x3f')](_0x544c('0x48'),_0x45a097,JSON['stringify'](_0x596415));process[_0x544c('0x49')](_0x544c('0x4a'));var _0x293c8b=_0x596415[_0x544c('0x4b')];var _0x123fd2=_0x596415[_0x544c('0x4c')];var _0xab2c2=path[_0x544c('0x11')](config[_0x544c('0x4d')],_0x544c('0x4e'),_0x123fd2+_0x544c('0x4f'));var _0x2b17b9=_[_0x544c('0x38')](_0x293c8b)[_0x544c('0x11')]();logger[_0x544c('0x3f')]('header',_0x2b17b9);fs[_0x544c('0x50')](_0xab2c2,_0x2b17b9+'\x0a');Papa['parse'](fs[_0x544c('0x51')](_0x45a097),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2d3494,_0x23c439){try{for(var _0x5a46d9=0x0,_0xff0615=[];_0x5a46d9<_0x2d3494[_0x544c('0x52')][_0x544c('0x53')];_0x5a46d9++){stats[_0x544c('0x54')]+=0x1;if(_0x2d3494[_0x544c('0x44')][_0x5a46d9]){handleError(_0x2d3494['data'][_0x5a46d9],_0x2d3494[_0x544c('0x44')][_0x5a46d9]);}else{var _0x27e1c3=[];for(var _0x227267 in _0x293c8b){if(_0x293c8b['hasOwnProperty'](_0x227267)){if(_0x2d3494[_0x544c('0x52')][_0x5a46d9][_0x293c8b[_0x227267]]){var _0x4c2037=_[_0x544c('0x55')](_0x2d3494[_0x544c('0x52')][_0x5a46d9][_0x293c8b[_0x227267]][_0x544c('0x56')](/"/g,'\x27'));switch(_0x227267){case _0x544c('0x1d'):var _0x51f261=moment(_0x4c2037,_0x544c('0x57'),!![]);if(_0x51f261[_0x544c('0x58')]()){_0xff0615[_0x544c('0x59')]('\x22'+_0x4c2037+'\x22');}else{_0x27e1c3[_0x544c('0x59')](_0x544c('0x5a'));}break;case _0x544c('0x21'):var _0x397fcd=parseInt(_0x4c2037);_0x4c2037=_[_0x544c('0x5b')](_0x397fcd)||_0x397fcd<0x0||_0x397fcd>0x4?_0x1d76d0?0x3:0x2:_0x397fcd;_0xff0615['push']('\x22'+_0x4c2037+'\x22');break;case _0x544c('0x22'):var _0x4c7764=parseInt(_0x4c2037);if(_['isNumber'](_0x4c7764)&&_[_0x544c('0x5c')](_0x142766,_0x4c7764)){_0xff0615[_0x544c('0x59')]('\x22'+_0x4c7764+'\x22');}else{_0x27e1c3['push'](_0x544c('0x5d'));}break;case _0x544c('0x5e'):if(isEmail(_0x4c2037)){_0xff0615['push']('\x22'+_0x4c2037+'\x22');}else{_0x27e1c3[_0x544c('0x59')](_0x544c('0x5f'));}break;case _0x544c('0x60'):var _0x2f9f23=moment(_0x4c2037,'YYYY-MM-DD',!![]);if(_0x2f9f23['isValid']()){_0xff0615['push']('\x22'+_0x4c2037+'\x22');}else{_0x27e1c3[_0x544c('0x59')](_0x544c('0x61'));}break;default:_0xff0615[_0x544c('0x59')]('\x22'+_0x4c2037+'\x22');}}else{switch(_0x227267){case'firstName':case _0x544c('0xf'):_0x27e1c3[_0x544c('0x59')](_0x227267+'\x20not\x20specified');break;default:_0xff0615['push']('\x22\x22');}}}}if(_0x27e1c3['length']){handleError(_0x2d3494['data'][_0x5a46d9],{'code':_0x544c('0x62'),'message':_0x27e1c3['join']()});}else{fs[_0x544c('0x63')](_0xab2c2,_0xff0615['join']()+'\x0a');}_0xff0615=[];}if(!(stats[_0x544c('0x54')]%0xc8)){socket[_0x544c('0x64')](_0x544c('0x65')+_0x123fd2,stats);stats[_0x544c('0x44')]=[];}}if(stopped){logger[_0x544c('0x3f')](_0x544c('0x66'));_0x23c439[_0x544c('0x67')]();}}catch(_0x165484){handleError(_0x2d3494[_0x544c('0x52')][_0x5a46d9],{'code':_0x544c('0x68'),'message':_0x165484[_0x544c('0x42')]});logger[_0x544c('0x41')](_0x544c('0x69'),_0x165484[_0x544c('0x42')]);}},'complete':function(){try{var _0x25df56=[];var _0x20c7be=_0x544c('0x32');if(_0x596415[_0x544c('0x6a')]&&_0x596415[_0x544c('0x6a')]['length']){_0x20c7be=_0x544c('0x6b')+_0x123fd2;_0x25df56[_0x544c('0x59')](_0x544c('0x6c')+_0x20c7be+_0x544c('0x6d'));}var _0x25d82c=util[_0x544c('0xc')](_0x544c('0x6e'),_0xab2c2,_0x20c7be,_0x2b17b9,_0x596415[_0x544c('0x1e')],_0x596415[_0x544c('0x39')]||null,NOW,NOW);if(_[_0x544c('0x6f')](_0x293c8b[_0x544c('0x1d')])){_0x25d82c+=_0x544c('0x70');}_0x25df56['push'](_0x25d82c);if(_0x596415[_0x544c('0x6a')]&&_0x596415['duplicates'][_0x544c('0x53')]){_0x25df56[_0x544c('0x59')](insertCmContact(_0x596415[_0x544c('0x1e')],_0x20c7be,_0x596415[_0x544c('0x6a')],_0x293c8b));_0x25df56['push']('DROP\x20TABLE\x20'+_0x20c7be+';');}_0x25df56[_0x544c('0x59')](insertCmHopper(_0x596415[_0x544c('0x1e')],_0x544c('0x71'),_0x544c('0x72'),_0x544c('0x73'),_0x1d76d0));_0x25df56[_0x544c('0x59')](insertCmHopperBlack(_0x596415['ListId'],_0x544c('0x74'),_0x544c('0x72'),_0x544c('0x73')));_0x25df56[_0x544c('0x59')](insertCmHopper(_0x596415[_0x544c('0x1e')],_0x544c('0x75'),_0x544c('0x76'),_0x544c('0x77'),_0x1d76d0));_0x25df56[_0x544c('0x59')](insertCmHopperBlack(_0x596415['ListId'],_0x544c('0x78'),_0x544c('0x76'),'CampaignId'));BPromise[_0x544c('0x79')](_0x25df56,handleQuery)[_0x544c('0x7a')](function(_0x2dec54){stats[_0x544c('0x7b')]=!![];stats[_0x544c('0x7c')]=_0x596415[_0x544c('0x6a')]&&_0x596415[_0x544c('0x6a')][_0x544c('0x53')]?results[0x2][_0x544c('0x7c')]:results[0x0]['affectedRows'];socket[_0x544c('0x64')](_0x544c('0x65')+_0x123fd2,stats);fs[_0x544c('0x7d')](_0x45a097);fs['unlink'](_0xab2c2);process[_0x544c('0x43')](0x0);})[_0x544c('0x47')](function(_0x2ef2df){logger[_0x544c('0x41')](_0x2ef2df[_0x544c('0x42')]);process[_0x544c('0x43')](0x1);});}catch(_0x22e1d7){logger[_0x544c('0x41')](_0x544c('0x7e'),_0x22e1d7['message']);process['exit'](0x1);}},'error':function(_0x458fd2,_0x37485a,_0x262027,_0x39f757){throw new Error(_0x39f757);}});}function validate(){if(process['argv']&&process[_0x544c('0x7f')][_0x544c('0x53')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x4cca0e=path['join'](config[_0x544c('0x4d')],_0x544c('0x4e'),process['argv'][0x2]);if(!fs[_0x544c('0x80')](_0x4cca0e)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x704635={};try{_0x704635=JSON[_0x544c('0x81')](process[_0x544c('0x7f')][0x3]);if(!_0x704635['binding']){throw new Error(_0x544c('0x82'));}if(!_0x704635[_0x544c('0x4b')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x704635[_0x544c('0x4b')]['firstName']){throw new Error(_0x544c('0x83'));}var _0x31016c=0x0;if(_0x704635[_0x544c('0x4b')]['UserId']){_0x31016c=0x1;}if(!_0x704635[_0x544c('0x1e')]){throw new Error(_0x544c('0x84'));}}catch(_0x5f2fb5){throw new Error(_0x544c('0x85'));}var _0x4b230a=[];try{_0x4b230a=_['map'](JSON[_0x544c('0x81')](process['argv'][0x4]),'id');}catch(_0x2e39a7){logger['info']('No\x20agent\x20available');}main(_0x4cca0e,_0x704635,_0x4b230a,_0x31016c);}validate();process['on'](_0x544c('0x86'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x21c4=['../../../mysqldb','../../../config/environment','import','redis','localhost','socket.io-emitter','format','test','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','createdAt','updatedAt','priority','recallme','select','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','fromQuery','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','concat','keys','ListId','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','exit','errors','push','sequelize','query','spread','stringify','send','start','socket_timestamp','root','server/files/tmp','writeFileSync','parse','data','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','UserId','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','\x20not\x20specified','length','SystemRow','appendFileSync','rows','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','then','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','squel','ioredis'];(function(_0x27895f,_0x5ce3f6){var _0x5d9a52=function(_0x32b9a0){while(--_0x32b9a0){_0x27895f['push'](_0x27895f['shift']());}};_0x5d9a52(++_0x5ce3f6);}(_0x21c4,0x102));var _0x421c=function(_0x20006a,_0x30e3a9){_0x20006a=_0x20006a-0x0;var _0x5e26ac=_0x21c4[_0x20006a];return _0x5e26ac;};'use strict';var fs=require('fs');var path=require(_0x421c('0x0'));var _=require(_0x421c('0x1'));var Papa=require(_0x421c('0x2'));var util=require('util');var BPromise=require(_0x421c('0x3'));var moment=require('moment');var squel=require(_0x421c('0x4'));var Redis=require(_0x421c('0x5'));var db=require(_0x421c('0x6'))['db'];var config=require(_0x421c('0x7'));var logger=require('../../../config/logger')(_0x421c('0x8'));config[_0x421c('0x9')]=_['defaults'](config[_0x421c('0x9')],{'host':_0x421c('0xa'),'port':0x18eb});var socket=require(_0x421c('0xb'))(new Redis(config[_0x421c('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x421c('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x4b4bd1){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))*$/[_0x421c('0xd')](_0x4b4bd1);}function selectNotIn(_0x2a1710,_0x256b16,_0x4fb06e,_0x103163,_0x1ae7fb){return squel['select']()[_0x421c('0xe')](_0x421c('0xf'))[_0x421c('0x10')](_0x103163)[_0x421c('0x11')](_0x256b16,null,_0x256b16+_0x421c('0x12')+_0x103163+'.'+_0x4fb06e)['where'](_0x103163+'.'+_0x4fb06e+_0x421c('0x13')+_0x2a1710+'.'+_0x4fb06e)[_0x421c('0x14')](_0x256b16+_0x421c('0x15')+_0x1ae7fb[_0x421c('0x11')]()+')');}function insertCmHopper(_0x5e607f,_0x1cc96e,_0xc5f454,_0xe32106,_0x484d86){var _0x46ccdb=[_0x421c('0x16'),_0x421c('0x17'),'cm_contacts.id','cm_contacts.ListId',_0x1cc96e+'.'+_0xe32106,'cm_contacts.createdAt',_0x421c('0x18'),'cm_contacts.priority',_0x421c('0x19'),'\x22'+_0x484d86+'\x22'];return squel[_0x421c('0x1a')]()[_0x421c('0x1b')](_0x421c('0x1c'))['fromQuery']([_0x421c('0xf'),_0x421c('0x1d'),_0x421c('0x1e'),'ListId',_0xe32106,_0x421c('0x1f'),_0x421c('0x20'),_0x421c('0x21'),'UserId',_0x421c('0x22')],squel[_0x421c('0x23')]()[_0x421c('0x24')](_0x46ccdb)['from'](_0x1cc96e)[_0x421c('0x11')](_0x421c('0x25'),null,'cm_contacts.ListId\x20=\x20'+_0x1cc96e+_0x421c('0x26'))[_0x421c('0x11')](_0xc5f454,null,_0xc5f454+_0x421c('0x12')+_0x1cc96e+'.'+_0xe32106)[_0x421c('0x14')](_0x1cc96e+_0x421c('0x27'),_0x5e607f)['where'](_0x421c('0x28'),NOW)[_0x421c('0x14')](_0x421c('0x29'),selectNotIn(_0x1cc96e,_0xc5f454,_0xe32106,'cm_hopper',[_0x421c('0x2a'),_0x421c('0x2b')]))['where'](_0x421c('0x29'),selectNotIn(_0x1cc96e,_0xc5f454,_0xe32106,'cm_hopper',['\x22always\x22'])))[_0x421c('0x2c')]();}function insertCmHopperBlack(_0x21fe3f,_0x220d37,_0x525536,_0x1337ad){var _0x3b8b02=[_0x421c('0x16'),_0x421c('0x2d'),_0x421c('0x2e'),_0x220d37+'.'+_0x1337ad,_0x421c('0x2f'),_0x421c('0x18')];return squel[_0x421c('0x1a')]()['into']('cm_hopper_black')[_0x421c('0x30')]([_0x421c('0xf'),_0x421c('0x1e'),'ListId',_0x1337ad,_0x421c('0x1f'),_0x421c('0x20')],squel['select']()[_0x421c('0x24')](_0x3b8b02)[_0x421c('0x10')](_0x220d37)[_0x421c('0x11')](_0x421c('0x25'),null,'cm_contacts.ListId\x20=\x20'+_0x220d37+_0x421c('0x26'))[_0x421c('0x11')](_0x525536,null,_0x525536+'.id\x20=\x20'+_0x220d37+'.'+_0x1337ad)[_0x421c('0x14')](_0x220d37+_0x421c('0x27'),_0x21fe3f)[_0x421c('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x421c('0x29'),squel['select']()[_0x421c('0xe')]('phone')[_0x421c('0x10')](_0x421c('0x31'))[_0x421c('0x14')](_0x421c('0x32'),_0x21fe3f)[_0x421c('0x14')](_0x1337ad+_0x421c('0x33'),_0x220d37+'.'+_0x1337ad)))[_0x421c('0x2c')]();}function insertCmContact(_0x594735,_0x1ef437,_0x24597a,_0x23bd98){var _0x4d0ee6=_[_0x421c('0x34')](_[_0x421c('0x35')](_0x23bd98),[_0x421c('0x36'),_0x421c('0x37'),_0x421c('0x1f'),_0x421c('0x20')]);return squel[_0x421c('0x1a')]()['into'](_0x421c('0x25'))[_0x421c('0x30')](_0x4d0ee6,squel[_0x421c('0x23')]()[_0x421c('0x24')](_0x4d0ee6)[_0x421c('0x10')](_0x1ef437)[_0x421c('0x14')]('('+_0x24597a[_0x421c('0x11')](',')+_0x421c('0x38'),squel[_0x421c('0x23')]()['fields'](_0x24597a)['from']('cm_contacts')[_0x421c('0x14')](_0x421c('0x32'),_0x594735))[_0x421c('0x14')](_0x421c('0x39'),squel[_0x421c('0x23')]()[_0x421c('0xe')](_0x421c('0x3a'),'min_id')[_0x421c('0x10')](_0x1ef437)[_0x421c('0x3b')](_0x24597a[_0x421c('0x11')](','))))['toString']();}function handleStop(){logger[_0x421c('0x3c')](_0x421c('0x3d'));stopped=!![];}function handleUncaughtException(_0x5629d7){logger[_0x421c('0x3e')](_0x5629d7[_0x421c('0x3f')]);process[_0x421c('0x40')](0x1);}function handleError(_0x4527ce,_0x102d6b){stats[_0x421c('0x41')][_0x421c('0x42')]({'name':_0x102d6b['code'],'message':_0x102d6b[_0x421c('0x3f')],'row':_0x4527ce});}function handleQuery(_0x16397b){logger[_0x421c('0x3c')](_0x16397b);return db[_0x421c('0x43')][_0x421c('0x44')](_0x16397b)[_0x421c('0x45')](function(_0x43f2d1){results['push'](_0x43f2d1);})['catch'](function(_0x11ca1d){logger[_0x421c('0x3e')](_0x11ca1d[_0x421c('0x3f')]);});}function main(_0x4e3386,_0x78242b,_0x33d069,_0x43c512){logger[_0x421c('0x3c')]('main',_0x4e3386,JSON[_0x421c('0x46')](_0x78242b));process[_0x421c('0x47')](_0x421c('0x48'));var _0x3c9594=_0x78242b['binding'];var _0x37f580=_0x78242b[_0x421c('0x49')];var _0x374d31=path[_0x421c('0x11')](config[_0x421c('0x4a')],_0x421c('0x4b'),_0x37f580+'.csv');var _0x276793=_[_0x421c('0x35')](_0x3c9594)[_0x421c('0x11')]();logger[_0x421c('0x3c')]('header',_0x276793);fs[_0x421c('0x4c')](_0x374d31,_0x276793+'\x0a');Papa[_0x421c('0x4d')](fs['createReadStream'](_0x4e3386),{'header':!![],'skipEmptyLines':!![],'step':function(_0x18910e,_0x4c92d0){try{for(var _0x3ef44d=0x0,_0x4d30ff=[];_0x3ef44d<_0x18910e[_0x421c('0x4e')]['length'];_0x3ef44d++){stats['rows']+=0x1;if(_0x18910e[_0x421c('0x41')][_0x3ef44d]){handleError(_0x18910e[_0x421c('0x4e')][_0x3ef44d],_0x18910e['errors'][_0x3ef44d]);}else{var _0x174348=[];for(var _0x1bb1f8 in _0x3c9594){if(_0x3c9594['hasOwnProperty'](_0x1bb1f8)){if(_0x18910e[_0x421c('0x4e')][_0x3ef44d][_0x3c9594[_0x1bb1f8]]){var _0x357c54=_['trim'](_0x18910e['data'][_0x3ef44d][_0x3c9594[_0x1bb1f8]][_0x421c('0x4f')](/"/g,'\x27'));switch(_0x1bb1f8){case'scheduledat':var _0x5d8c0e=moment(_0x357c54,_0x421c('0x50'),!![]);if(_0x5d8c0e[_0x421c('0x51')]()){_0x4d30ff[_0x421c('0x42')]('\x22'+_0x357c54+'\x22');}else{_0x174348[_0x421c('0x42')](_0x421c('0x52'));}break;case _0x421c('0x21'):var _0x2561b3=parseInt(_0x357c54);_0x357c54=_['isNaN'](_0x2561b3)||_0x2561b3<0x0||_0x2561b3>0x4?_0x43c512?0x3:0x2:_0x2561b3;_0x4d30ff[_0x421c('0x42')]('\x22'+_0x357c54+'\x22');break;case _0x421c('0x53'):var _0x33a13f=parseInt(_0x357c54);if(_[_0x421c('0x54')](_0x33a13f)&&_[_0x421c('0x55')](_0x33d069,_0x33a13f)){_0x4d30ff[_0x421c('0x42')]('\x22'+_0x33a13f+'\x22');}else{_0x174348['push'](_0x421c('0x56'));}break;case'email':if(isEmail(_0x357c54)){_0x4d30ff['push']('\x22'+_0x357c54+'\x22');}else{_0x174348[_0x421c('0x42')](_0x421c('0x57'));}break;case'dateOfBirth':var _0x3a71a8=moment(_0x357c54,_0x421c('0x58'),!![]);if(_0x3a71a8[_0x421c('0x51')]()){_0x4d30ff[_0x421c('0x42')]('\x22'+_0x357c54+'\x22');}else{_0x174348[_0x421c('0x42')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x4d30ff['push']('\x22'+_0x357c54+'\x22');}}else{switch(_0x1bb1f8){case'firstName':case _0x421c('0xf'):_0x174348[_0x421c('0x42')](_0x1bb1f8+_0x421c('0x59'));break;default:_0x4d30ff[_0x421c('0x42')]('\x22\x22');}}}}if(_0x174348[_0x421c('0x5a')]){handleError(_0x18910e[_0x421c('0x4e')][_0x3ef44d],{'code':_0x421c('0x5b'),'message':_0x174348[_0x421c('0x11')]()});}else{fs[_0x421c('0x5c')](_0x374d31,_0x4d30ff[_0x421c('0x11')]()+'\x0a');}_0x4d30ff=[];}if(!(stats[_0x421c('0x5d')]%0xc8)){socket[_0x421c('0x5e')]('contact:import:'+_0x37f580,stats);stats[_0x421c('0x41')]=[];}}if(stopped){logger[_0x421c('0x3c')](_0x421c('0x5f'));_0x4c92d0[_0x421c('0x60')]();}}catch(_0x4df14d){handleError(_0x18910e[_0x421c('0x4e')][_0x3ef44d],{'code':_0x421c('0x61'),'message':_0x4df14d[_0x421c('0x3f')]});logger[_0x421c('0x3e')](_0x421c('0x62'),_0x4df14d['message']);}},'complete':function(){try{var _0x1bd20e=[];var _0x4f61cc='cm_contacts';if(_0x78242b[_0x421c('0x63')]&&_0x78242b['duplicates'][_0x421c('0x5a')]){_0x4f61cc=_0x421c('0x64')+_0x37f580;_0x1bd20e['push'](_0x421c('0x65')+_0x4f61cc+_0x421c('0x66'));}var _0x3c9b32=util[_0x421c('0xc')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x374d31,_0x4f61cc,_0x276793,_0x78242b[_0x421c('0x36')],_0x78242b[_0x421c('0x37')]||null,NOW,NOW);if(_['isNil'](_0x3c9594['scheduledat'])){_0x3c9b32+=_0x421c('0x67');}_0x1bd20e['push'](_0x3c9b32);if(_0x78242b[_0x421c('0x63')]&&_0x78242b[_0x421c('0x63')][_0x421c('0x5a')]){_0x1bd20e[_0x421c('0x42')](insertCmContact(_0x78242b[_0x421c('0x36')],_0x4f61cc,_0x78242b[_0x421c('0x63')],_0x3c9594));_0x1bd20e[_0x421c('0x42')](_0x421c('0x68')+_0x4f61cc+';');}_0x1bd20e[_0x421c('0x42')](insertCmHopper(_0x78242b[_0x421c('0x36')],_0x421c('0x69'),_0x421c('0x6a'),_0x421c('0x6b'),_0x43c512));_0x1bd20e['push'](insertCmHopperBlack(_0x78242b[_0x421c('0x36')],_0x421c('0x6c'),'voice_queues',_0x421c('0x6b')));_0x1bd20e[_0x421c('0x42')](insertCmHopper(_0x78242b['ListId'],_0x421c('0x6d'),_0x421c('0x6e'),_0x421c('0x6f'),_0x43c512));_0x1bd20e[_0x421c('0x42')](insertCmHopperBlack(_0x78242b[_0x421c('0x36')],_0x421c('0x70'),'campaigns',_0x421c('0x6f')));BPromise['each'](_0x1bd20e,handleQuery)[_0x421c('0x71')](function(_0x2d0673){stats[_0x421c('0x72')]=!![];stats[_0x421c('0x73')]=_0x78242b[_0x421c('0x63')]&&_0x78242b[_0x421c('0x63')]['length']?results[0x2]['affectedRows']:results[0x0][_0x421c('0x73')];socket[_0x421c('0x5e')](_0x421c('0x74')+_0x37f580,stats);fs[_0x421c('0x75')](_0x4e3386);fs[_0x421c('0x75')](_0x374d31);process[_0x421c('0x40')](0x0);})['catch'](function(_0x438e2a){logger[_0x421c('0x3e')](_0x438e2a[_0x421c('0x3f')]);process[_0x421c('0x40')](0x1);});}catch(_0x1c6936){logger[_0x421c('0x3e')](_0x421c('0x76'),_0x1c6936[_0x421c('0x3f')]);process[_0x421c('0x40')](0x1);}},'error':function(_0x1706a1,_0x570a5e,_0x3e0cd7,_0x5041fc){throw new Error(_0x5041fc);}});}function validate(){if(process['argv']&&process[_0x421c('0x77')][_0x421c('0x5a')]<0x4){throw new Error(_0x421c('0x78'));}var _0x3721a8=path['join'](config[_0x421c('0x4a')],_0x421c('0x4b'),process['argv'][0x2]);if(!fs[_0x421c('0x79')](_0x3721a8)){throw new Error(_0x421c('0x7a'));}var _0x3ba7bd={};try{_0x3ba7bd=JSON[_0x421c('0x4d')](process['argv'][0x3]);if(!_0x3ba7bd[_0x421c('0x7b')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x3ba7bd[_0x421c('0x7b')]['phone']){throw new Error(_0x421c('0x7c'));}if(!_0x3ba7bd[_0x421c('0x7b')][_0x421c('0x7d')]){throw new Error(_0x421c('0x7e'));}var _0x1ae518=0x0;if(_0x3ba7bd[_0x421c('0x7b')][_0x421c('0x53')]){_0x1ae518=0x1;}if(!_0x3ba7bd[_0x421c('0x36')]){throw new Error(_0x421c('0x7f'));}}catch(_0x13d57e){throw new Error(_0x421c('0x80'));}var _0x2a948c=[];try{_0x2a948c=_['map'](JSON[_0x421c('0x4d')](process['argv'][0x4]),'id');}catch(_0x5a7efd){logger['info'](_0x421c('0x81'));}main(_0x3721a8,_0x3ba7bd,_0x2a948c,_0x1ae518);}validate();process['on'](_0x421c('0x82'),handleStop);process['on'](_0x421c('0x83'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 6adcf74..73ed350 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 _0x0e85=['Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','membername','uniqueid','starttime','Answer\x20Time','Complete\x20Time','getSubjects','string','toLowerCase','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','Call\x20To','Queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt'];(function(_0xb578ff,_0x3e51e8){var _0x233a81=function(_0x163fc7){while(--_0x163fc7){_0xb578ff['push'](_0xb578ff['shift']());}};_0x233a81(++_0x3e51e8);}(_0x0e85,0x7c));var _0x50e8=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x0e85[_0x368fb9];return _0x4892fb;};'use strict';exports[_0x50e8('0x0')]=function(_0x42347b,_0x5a568b){var _0x11a13a=[{'type':_0x50e8('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x42347b['toLowerCase']()){case'voice':switch(_0x5a568b[_0x50e8('0x2')]()){case'inbound':_0x11a13a[_0x50e8('0x3')]({'type':_0x50e8('0x4'),'content':'','variableName':_0x50e8('0x5')});_0x11a13a[_0x50e8('0x3')]({'type':'variable','content':'','variableName':_0x50e8('0x6')});break;case _0x50e8('0x7'):_0x11a13a[_0x50e8('0x3')]({'type':_0x50e8('0x1'),'content':_0x50e8('0x8'),'variableName':null});_0x11a13a[_0x50e8('0x3')]({'type':'variable','content':'','variableName':_0x50e8('0x9')});break;}}return _0x11a13a;};exports[_0x50e8('0xa')]=function(_0x19d1bc,_0x2d4750){var _0x154b9e=[];switch(_0x19d1bc[_0x50e8('0x2')]()){case _0x50e8('0xb'):switch(_0x2d4750[_0x50e8('0x2')]()){case'inbound':_0x154b9e=[{'type':'string','content':_0x50e8('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x50e8('0xd'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0x50e8('0x6')},{'type':_0x50e8('0xd'),'content':'','key':_0x50e8('0xe'),'keyType':_0x50e8('0x4'),'variableName':'calleridname'},{'type':_0x50e8('0xd'),'content':'','key':_0x50e8('0xf'),'keyType':_0x50e8('0x4'),'variableName':'destexten'},{'type':'keyValue','content':'','key':_0x50e8('0x10'),'keyType':_0x50e8('0x4'),'variableName':_0x50e8('0x5')},{'type':_0x50e8('0xd'),'content':'','key':_0x50e8('0x11'),'keyType':_0x50e8('0x4'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0x50e8('0x12'),'keyType':_0x50e8('0x4'),'variableName':_0x50e8('0x13')},{'type':_0x50e8('0x1'),'content':_0x50e8('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x50e8('0xd'),'content':'','key':_0x50e8('0x15'),'keyType':'variable','variableName':_0x50e8('0x16')},{'type':'keyValue','content':'','key':_0x50e8('0x17'),'keyType':_0x50e8('0x4'),'variableName':_0x50e8('0x9')},{'type':_0x50e8('0x1'),'content':_0x50e8('0x18'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x50e8('0x19'),'keyType':_0x50e8('0x4'),'variableName':'agentcalledAt'},{'type':_0x50e8('0xd'),'content':'','key':_0x50e8('0x1a'),'keyType':'variable','variableName':_0x50e8('0x1b')},{'type':_0x50e8('0xd'),'content':'','key':'Agent\x20Complete','keyType':'variable','variableName':'agentcompleteAt'},{'type':_0x50e8('0xd'),'content':'','key':_0x50e8('0x1c'),'keyType':_0x50e8('0x4'),'variableName':_0x50e8('0x1d')},{'type':_0x50e8('0xd'),'content':'','key':_0x50e8('0x1e'),'keyType':'variable','variableName':_0x50e8('0x1f')}];break;case _0x50e8('0x7'):_0x154b9e=[{'type':'string','content':_0x50e8('0xc'),'variableName':null},{'type':_0x50e8('0xd'),'content':'','key':_0x50e8('0x20'),'keyType':_0x50e8('0x4'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x50e8('0xd'),'content':'','key':'Member\x20Name','keyType':_0x50e8('0x4'),'keyContent':'','variableName':_0x50e8('0x21')},{'type':_0x50e8('0xd'),'content':'','key':'UniqueId','keyType':_0x50e8('0x4'),'keyContent':'','variableName':_0x50e8('0x22')},{'type':_0x50e8('0xd'),'content':'','key':_0x50e8('0x12'),'keyType':_0x50e8('0x4'),'keyContent':'','variableName':_0x50e8('0x23')},{'type':_0x50e8('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x50e8('0xd'),'content':'','key':_0x50e8('0x24'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0x50e8('0xd'),'content':'','key':_0x50e8('0x25'),'keyType':_0x50e8('0x4'),'keyContent':'','variableName':'endtime'}];break;}}return _0x154b9e;}; \ No newline at end of file +var _0xa9e0=['toLowerCase','inbound','push','variable','calleridnum','string','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','talktime','outbound','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','getSubjects','[xCALLY\x20Ticket]','voice'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';exports[_0x0a9e('0x0')]=function(_0x948b6c,_0x29929c){var _0x5dd881=[{'type':'string','content':_0x0a9e('0x1'),'variableName':null}];switch(_0x948b6c['toLowerCase']()){case _0x0a9e('0x2'):switch(_0x29929c[_0x0a9e('0x3')]()){case _0x0a9e('0x4'):_0x5dd881[_0x0a9e('0x5')]({'type':_0x0a9e('0x6'),'content':'','variableName':'queue'});_0x5dd881[_0x0a9e('0x5')]({'type':_0x0a9e('0x6'),'content':'','variableName':_0x0a9e('0x7')});break;case'outbound':_0x5dd881['push']({'type':_0x0a9e('0x8'),'content':'Outbound\x20Call','variableName':null});_0x5dd881['push']({'type':_0x0a9e('0x6'),'content':'','variableName':_0x0a9e('0x9')});break;}}return _0x5dd881;};exports[_0x0a9e('0xa')]=function(_0x3ab53f,_0xfeb75b){var _0xbd1168=[];switch(_0x3ab53f['toLowerCase']()){case'voice':switch(_0xfeb75b['toLowerCase']()){case'inbound':_0xbd1168=[{'type':_0x0a9e('0x8'),'content':_0x0a9e('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0x0a9e('0xc'),'content':'','key':_0x0a9e('0xd'),'keyType':_0x0a9e('0x6'),'variableName':_0x0a9e('0x7')},{'type':'keyValue','content':'','key':_0x0a9e('0xe'),'keyType':_0x0a9e('0x6'),'variableName':_0x0a9e('0xf')},{'type':_0x0a9e('0xc'),'content':'','key':_0x0a9e('0x10'),'keyType':_0x0a9e('0x6'),'variableName':'destexten'},{'type':_0x0a9e('0xc'),'content':'','key':'Queue','keyType':_0x0a9e('0x6'),'variableName':'queue'},{'type':_0x0a9e('0xc'),'content':'','key':_0x0a9e('0x11'),'keyType':'variable','variableName':_0x0a9e('0x12')},{'type':'keyValue','content':'','key':_0x0a9e('0x13'),'keyType':_0x0a9e('0x6'),'variableName':_0x0a9e('0x14')},{'type':_0x0a9e('0x8'),'content':_0x0a9e('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0x0a9e('0xc'),'content':'','key':_0x0a9e('0x16'),'keyType':_0x0a9e('0x6'),'variableName':_0x0a9e('0x17')},{'type':_0x0a9e('0xc'),'content':'','key':_0x0a9e('0x18'),'keyType':_0x0a9e('0x6'),'variableName':'destcalleridnum'},{'type':_0x0a9e('0x8'),'content':_0x0a9e('0x19'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x0a9e('0x1a'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0x0a9e('0xc'),'content':'','key':_0x0a9e('0x1b'),'keyType':_0x0a9e('0x6'),'variableName':_0x0a9e('0x1c')},{'type':'keyValue','content':'','key':_0x0a9e('0x1d'),'keyType':_0x0a9e('0x6'),'variableName':_0x0a9e('0x1e')},{'type':_0x0a9e('0xc'),'content':'','key':_0x0a9e('0x1f'),'keyType':_0x0a9e('0x6'),'variableName':_0x0a9e('0x20')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0x0a9e('0x6'),'variableName':_0x0a9e('0x21')}];break;case _0x0a9e('0x22'):_0xbd1168=[{'type':_0x0a9e('0x8'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x0a9e('0xc'),'content':'','key':'Called\x20Number','keyType':_0x0a9e('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x0a9e('0xc'),'content':'','key':_0x0a9e('0x23'),'keyType':_0x0a9e('0x6'),'keyContent':'','variableName':_0x0a9e('0x24')},{'type':_0x0a9e('0xc'),'content':'','key':_0x0a9e('0x11'),'keyType':_0x0a9e('0x6'),'keyContent':'','variableName':_0x0a9e('0x12')},{'type':'keyValue','content':'','key':_0x0a9e('0x13'),'keyType':_0x0a9e('0x6'),'keyContent':'','variableName':_0x0a9e('0x25')},{'type':_0x0a9e('0x8'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x0a9e('0xc'),'content':'','key':_0x0a9e('0x26'),'keyType':_0x0a9e('0x6'),'keyContent':'','variableName':_0x0a9e('0x27')},{'type':_0x0a9e('0xc'),'content':'','key':_0x0a9e('0x28'),'keyType':_0x0a9e('0x6'),'keyContent':'','variableName':_0x0a9e('0x29')}];break;}}return _0xbd1168;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 41ca702..70807fe 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 _0x2fda=['name','role','then','update','info','catch','error','user','query','clone','body','omit','html','phone','fax','lodash','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','chat-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x2a9ddf,_0x263c67){var _0x34d716=function(_0x44c6e0){while(--_0x44c6e0){_0x2a9ddf['push'](_0x2a9ddf['shift']());}};_0x34d716(++_0x263c67);}(_0x2fda,0x186));var _0xa2fd=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x2fda[_0xbe200f];return _0x192597;};'use strict';var _=require(_0xa2fd('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0xa2fd('0x1')),'mail':require(_0xa2fd('0x2'))(_0xa2fd('0x3')),'fax':require(_0xa2fd('0x2'))(_0xa2fd('0x4')),'sms':require('../../config/logger')('sms-interactions'),'chat':require('../../config/logger')(_0xa2fd('0x5'))};function getInteractionId(_0x1bab5a,_0x4c6b0b,_0x11994b){if(_0x1bab5a&&_0x1bab5a[_[_0xa2fd('0x6')](_0x11994b)+_0xa2fd('0x7')]){return _0x1bab5a[_['upperFirst'](_0x11994b)+_0xa2fd('0x7')];}else if(_0x1bab5a&&_0x1bab5a['id']){return _0x1bab5a['id'];}else if(_0x4c6b0b&&_0x4c6b0b['id']){return _0x4c6b0b['id'];}else{return _0xa2fd('0x8');}}function log(_0x21e946,_0x2683fc,_0x345115,_0x420baf,_0x5987f1,_0x5ceb1f){loggers[_0x5987f1['toLowerCase']()][_0x21e946](_0xa2fd('0x9'),_0x5ceb1f['toUpperCase'](),_0x2683fc?_0x2683fc['id']:null,_0x2683fc?_0x2683fc[_0xa2fd('0xa')]:null,_0x2683fc?_0x2683fc[_0xa2fd('0xb')]:null,getInteractionId(_0x345115,_0x420baf,_0x5987f1),_0x345115?JSON['stringify'](_0x345115):'null');}function updateUser(_0x10e8a5,_0x295780,_0x71c59a,_0x325f35,_0x2e9eb8){db[_[_0xa2fd('0x6')](_0x325f35)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x295780,_0x71c59a,_0x325f35)}})[_0xa2fd('0xc')](function(_0x4c75e5){if(_0x4c75e5){return _0x4c75e5[_0xa2fd('0xd')]({'UserId':_0x10e8a5?_0x10e8a5['id']:null});}})['then'](function(_0xcf45fb){if(_0xcf45fb){log(_0xa2fd('0xe'),_0x10e8a5,_0x295780,_0x71c59a,_0x325f35,_0x2e9eb8);}})[_0xa2fd('0xf')](function(){log(_0xa2fd('0x10'),_0x10e8a5,_0x295780,_0x71c59a,_0x325f35,_0x2e9eb8);});}exports['tracked']=function(_0x1a64a4,_0x2ea614){return function(_0xda62d5,_0x195d32,_0x39f7b2){var _0x5c0697=_0xda62d5[_0xa2fd('0x11')];var _0x22a3aa={};var _0x2940dd=_0xda62d5[_0xa2fd('0x12')];if(_0x22a3aa){_0x22a3aa=_[_0xa2fd('0x13')](_0xda62d5[_0xa2fd('0x14')]);_0x22a3aa=_[_0xa2fd('0x15')](_0x22a3aa,[_0xa2fd('0x14'),_0xa2fd('0x16'),_0xa2fd('0x17'),_0xa2fd('0x18'),'mobile']);}updateUser(_0x5c0697,_0x22a3aa,_0x2940dd,_0x1a64a4,_0x2ea614);_0x39f7b2(null);};}; \ No newline at end of file +var _0xfd75=['phone','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','Interaction','then','info','catch','tracked','user','query','clone','body','omit','html'];(function(_0x28ade9,_0x1596bf){var _0x124832=function(_0x171b9e){while(--_0x171b9e){_0x28ade9['push'](_0x28ade9['shift']());}};_0x124832(++_0x1596bf);}(_0xfd75,0x12b));var _0x5fd7=function(_0x45be7a,_0x150ca7){_0x45be7a=_0x45be7a-0x0;var _0x4a9234=_0xfd75[_0x45be7a];return _0x4a9234;};'use strict';var _=require(_0x5fd7('0x0'));var db=require(_0x5fd7('0x1'))['db'];var loggers={'openchannel':require(_0x5fd7('0x2'))(_0x5fd7('0x3')),'mail':require(_0x5fd7('0x2'))(_0x5fd7('0x4')),'fax':require(_0x5fd7('0x2'))(_0x5fd7('0x5')),'sms':require('../../config/logger')(_0x5fd7('0x6')),'chat':require('../../config/logger')(_0x5fd7('0x7'))};function getInteractionId(_0x192421,_0x2c720b,_0x59912a){if(_0x192421&&_0x192421[_[_0x5fd7('0x8')](_0x59912a)+'InteractionId']){return _0x192421[_['upperFirst'](_0x59912a)+'InteractionId'];}else if(_0x192421&&_0x192421['id']){return _0x192421['id'];}else if(_0x2c720b&&_0x2c720b['id']){return _0x2c720b['id'];}else{return _0x5fd7('0x9');}}function log(_0x2f5916,_0x402c64,_0x1b0317,_0x38343e,_0x15306c,_0x2c2bbc){loggers[_0x15306c[_0x5fd7('0xa')]()][_0x2f5916](_0x5fd7('0xb'),_0x2c2bbc['toUpperCase'](),_0x402c64?_0x402c64['id']:null,_0x402c64?_0x402c64[_0x5fd7('0xc')]:null,_0x402c64?_0x402c64[_0x5fd7('0xd')]:null,getInteractionId(_0x1b0317,_0x38343e,_0x15306c),_0x1b0317?JSON['stringify'](_0x1b0317):'null');}function updateUser(_0x4f4ef9,_0x5da92a,_0x53c193,_0x5297d5,_0x3b5a8d){db[_['upperFirst'](_0x5297d5)+_0x5fd7('0xe')]['findOne']({'where':{'id':getInteractionId(_0x5da92a,_0x53c193,_0x5297d5)}})[_0x5fd7('0xf')](function(_0x4b73fa){if(_0x4b73fa){return _0x4b73fa['update']({'UserId':_0x4f4ef9?_0x4f4ef9['id']:null});}})[_0x5fd7('0xf')](function(_0x3bda7b){if(_0x3bda7b){log(_0x5fd7('0x10'),_0x4f4ef9,_0x5da92a,_0x53c193,_0x5297d5,_0x3b5a8d);}})[_0x5fd7('0x11')](function(){log('error',_0x4f4ef9,_0x5da92a,_0x53c193,_0x5297d5,_0x3b5a8d);});}exports[_0x5fd7('0x12')]=function(_0xca6437,_0x288ef2){return function(_0xcc9c1c,_0x5b2d7c,_0x12fead){var _0x47ce03=_0xcc9c1c[_0x5fd7('0x13')];var _0xe8594={};var _0x4d3f8f=_0xcc9c1c[_0x5fd7('0x14')];if(_0xe8594){_0xe8594=_[_0x5fd7('0x15')](_0xcc9c1c[_0x5fd7('0x16')]);_0xe8594=_[_0x5fd7('0x17')](_0xe8594,[_0x5fd7('0x16'),_0x5fd7('0x18'),_0x5fd7('0x19'),'fax',_0x5fd7('0x1a')]);}updateUser(_0x47ce03,_0xe8594,_0x4d3f8f,_0xca6437,_0x288ef2);_0x12fead(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index e0b1c19..0b66548 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 _0x39b8=['%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format'];(function(_0x84a85,_0x54e55c){var _0x1c2943=function(_0x99a250){while(--_0x99a250){_0x84a85['push'](_0x84a85['shift']());}};_0x1c2943(++_0x54e55c);}(_0x39b8,0x12b));var _0x839b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x39b8[_0x5b644e];return _0x49c6bf;};'use strict';var crypto=require('crypto');var util=require(_0x839b('0x0'));var compose=require(_0x839b('0x1'));var db=require(_0x839b('0x2'))['db'];var config=require(_0x839b('0x3'));function getValueFromLicense(_0x5ea6a9,_0x136b8b){if(_0x5ea6a9&&_0x136b8b){if(_0x136b8b[_0x839b('0x4')]&&_0x136b8b['license']){var _0x204d12=_0x136b8b['data1'];var _0x3690b9=_0x136b8b[_0x839b('0x5')];var _0x368cdb=_0x204d12[_0x839b('0x6')]('-')[0x4];var _0x2b31f3=_0x204d12['split']('-')[0x0];var _0x54cc15=crypto['createDecipher'](_0x839b('0x7'),util[_0x839b('0x8')](_0x839b('0x9'),_0x368cdb,_0x204d12,_0x2b31f3));var _0x49cc34=_0x54cc15[_0x839b('0xa')](_0x3690b9,_0x839b('0xb'),_0x839b('0xc'));_0x49cc34+=_0x54cc15[_0x839b('0xd')]('utf8');var _0x32fa37=JSON[_0x839b('0xe')](_0x49cc34);return _0x32fa37[_0x839b('0xf')](_0x5ea6a9)?_0x32fa37[_0x5ea6a9]:null;}}return null;}function isLimit(_0x504fb4,_0x5aa044,_0x1609bf,_0x20b62b){var _0x2b9df1=_0x5aa044;return compose()[_0x839b('0x10')](function(_0x4f9638,_0x47c2af,_0x1115f7){return db[_0x839b('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x839b('0x12')](function(_0x5132d2){var _0x50ae7b=getValueFromLicense(_0x504fb4,_0x5132d2);return _0x50ae7b?_0x50ae7b:_0x2b9df1;})[_0x839b('0x12')](function(_0x17be5d){_0x2b9df1=_0x17be5d;return _0x1609bf[_0x839b('0x13')](_0x20b62b);})['then'](function(_0x43542e){if(_0x43542e>=_0x2b9df1){return _0x47c2af['status'](0x193)[_0x839b('0x14')]({'message':util[_0x839b('0x8')](_0x839b('0x15'),_0x504fb4)});}_0x1115f7();})[_0x839b('0x16')](function(_0x1acadd){_0x1115f7(_0x1acadd);});});}function isUserLimit(){return isLimit(_0x839b('0x17'),0x1,db[_0x839b('0x18')],{'where':{'$or':[{'role':_0x839b('0x19')},{'role':_0x839b('0x1a')}]}});}exports[_0x839b('0x1b')]=isUserLimit; \ No newline at end of file +var _0x8ad3=['hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse'];(function(_0x454fe2,_0x2a082b){var _0x3d6157=function(_0x1bf6b0){while(--_0x1bf6b0){_0x454fe2['push'](_0x454fe2['shift']());}};_0x3d6157(++_0x2a082b);}(_0x8ad3,0xe8));var _0x38ad=function(_0x1e6599,_0x2bd717){_0x1e6599=_0x1e6599-0x0;var _0x132b01=_0x8ad3[_0x1e6599];return _0x132b01;};'use strict';var crypto=require(_0x38ad('0x0'));var util=require('util');var compose=require(_0x38ad('0x1'));var db=require(_0x38ad('0x2'))['db'];var config=require(_0x38ad('0x3'));function getValueFromLicense(_0x540d8c,_0x4fe1e9){if(_0x540d8c&&_0x4fe1e9){if(_0x4fe1e9['data1']&&_0x4fe1e9['license']){var _0x4ce30a=_0x4fe1e9[_0x38ad('0x4')];var _0x5840f5=_0x4fe1e9[_0x38ad('0x5')];var _0x4c3ac8=_0x4ce30a['split']('-')[0x4];var _0x25d1d1=_0x4ce30a[_0x38ad('0x6')]('-')[0x0];var _0x1fb994=crypto[_0x38ad('0x7')](_0x38ad('0x8'),util[_0x38ad('0x9')](_0x38ad('0xa'),_0x4c3ac8,_0x4ce30a,_0x25d1d1));var _0x201ee5=_0x1fb994[_0x38ad('0xb')](_0x5840f5,_0x38ad('0xc'),_0x38ad('0xd'));_0x201ee5+=_0x1fb994[_0x38ad('0xe')]('utf8');var _0x217eea=JSON[_0x38ad('0xf')](_0x201ee5);return _0x217eea[_0x38ad('0x10')](_0x540d8c)?_0x217eea[_0x540d8c]:null;}}return null;}function isLimit(_0x190bc6,_0x52b74e,_0x18ec09,_0x33e3cb){var _0x566e12=_0x52b74e;return compose()[_0x38ad('0x11')](function(_0x328b5e,_0x26d0f6,_0x214888){return db[_0x38ad('0x12')][_0x38ad('0x13')]({'where':{'id':0x1},'raw':!![]})[_0x38ad('0x14')](function(_0x29c2ae){var _0x138ba4=getValueFromLicense(_0x190bc6,_0x29c2ae);return _0x138ba4?_0x138ba4:_0x566e12;})[_0x38ad('0x14')](function(_0x85cac3){_0x566e12=_0x85cac3;return _0x18ec09[_0x38ad('0x15')](_0x33e3cb);})[_0x38ad('0x14')](function(_0x1436f2){if(_0x1436f2>=_0x566e12){return _0x26d0f6[_0x38ad('0x16')](0x193)[_0x38ad('0x17')]({'message':util['format'](_0x38ad('0x18'),_0x190bc6)});}_0x214888();})[_0x38ad('0x19')](function(_0x373539){_0x214888(_0x373539);});});}function isUserLimit(){return isLimit(_0x38ad('0x1a'),0x1,db[_0x38ad('0x1b')],{'where':{'$or':[{'role':_0x38ad('0x1c')},{'role':_0x38ad('0x1d')}]}});}exports[_0x38ad('0x1e')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 1aa779e..2104632 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 _0x33f4=['filters','forOwn','limit','offset','map','priority','cast','col','unsigned','ASC','omit','isEmpty','isArray','length','isObject','isString','lodash','sequelize','fields','split'];(function(_0x3e9582,_0x5ef882){var _0xdf59d7=function(_0xfdf61c){while(--_0xfdf61c){_0x3e9582['push'](_0x3e9582['shift']());}};_0xdf59d7(++_0x5ef882);}(_0x33f4,0x1c8));var _0x433f=function(_0x47bcb9,_0x461713){_0x47bcb9=_0x47bcb9-0x0;var _0x34c37c=_0x33f4[_0x47bcb9];return _0x34c37c;};'use strict';var _=require(_0x433f('0x0'));var sequelize=require(_0x433f('0x1'));var LIMIT_VALUE=0xfa;exports[_0x433f('0x2')]=function(_0x3b6dc6){var _0x2d4ab5=null;if(_0x3b6dc6){_0x2d4ab5=_0x3b6dc6[_0x433f('0x3')](',');}return _0x2d4ab5;};exports[_0x433f('0x4')]=function(_0x1e659b){var _0x53af7d={};if(!_['isEmpty'](_0x1e659b)){_0x53af7d={};_[_0x433f('0x5')](_0x1e659b,function(_0x2b95b8,_0x26abc3){try{_0x53af7d[_0x26abc3]=JSON['parse'](_0x2b95b8);}catch(_0x43a9c5){_0x53af7d[_0x26abc3]=_0x2b95b8[_0x433f('0x3')](',');}});}return _0x53af7d;};exports[_0x433f('0x6')]=function(_0x59b649){_0x59b649=parseInt(_0x59b649,0xa);if(!_0x59b649||_0x59b649<0x0){_0x59b649=LIMIT_VALUE;}return _0x59b649;};exports[_0x433f('0x7')]=function(_0x495e22){_0x495e22=parseInt(_0x495e22,0xa);if(!_0x495e22||_0x495e22<0x0){_0x495e22=0x0;}return _0x495e22;};exports['sort']=function(_0xccd45f){var _0x4f23df,_0x3c20fa=null;if(_0xccd45f){_0x4f23df=_0xccd45f[_0x433f('0x3')](',');_0x3c20fa=_[_0x433f('0x8')](_0x4f23df,function(_0x3416b5){if(_0x3416b5['indexOf']('-')===0x0){return[_0x3416b5===_0x433f('0x9')?sequelize[_0x433f('0xa')](sequelize[_0x433f('0xb')](_0x433f('0x9')),_0x433f('0xc')):_0x3416b5['substr'](0x1),'DESC'];}else{return[_0x3416b5===_0x433f('0x9')?sequelize[_0x433f('0xa')](sequelize[_0x433f('0xb')](_0x433f('0x9')),'unsigned'):_0x3416b5,_0x433f('0xd')];}});}return _0x3c20fa;};exports[_0x433f('0xe')]=function(_0x2fcfc2,_0x32acd6){if(_[_0x433f('0xf')](_0x2fcfc2)){return _0x2fcfc2;}if(_[_0x433f('0x10')](_0x2fcfc2)){for(var _0x11ab69=0x0;_0x11ab69<_0x2fcfc2[_0x433f('0x11')];_0x11ab69+=0x1){_0x2fcfc2[_0x11ab69]=this[_0x433f('0xe')](_0x2fcfc2[_0x11ab69],_0x32acd6);}return _0x2fcfc2;}if(!_[_0x433f('0x12')](_0x2fcfc2)){return _0x2fcfc2;}if(_[_0x433f('0x13')](_0x32acd6)){_0x32acd6=[_0x32acd6];}if(!_['isArray'](_0x32acd6)){return _0x2fcfc2;}for(var _0x3b77f5=0x0;_0x3b77f5<_0x32acd6[_0x433f('0x11')];_0x3b77f5+=0x1){_['unset'](_0x2fcfc2,_0x32acd6[_0x3b77f5]);}for(var _0x21fdb4 in _0x2fcfc2){if(_0x2fcfc2['hasOwnProperty'](_0x21fdb4)){_0x2fcfc2[_0x21fdb4]=this[_0x433f('0xe')](_0x2fcfc2[_0x21fdb4],_0x32acd6);}}return _0x2fcfc2;}; \ No newline at end of file +var _0x310f=['unset','hasOwnProperty','split','isEmpty','limit','offset','sort','map','indexOf','cast','substr','col','priority','unsigned','ASC','omit','isArray','isObject','isString','length'];(function(_0x1abca2,_0x444332){var _0x371a55=function(_0x43b34b){while(--_0x43b34b){_0x1abca2['push'](_0x1abca2['shift']());}};_0x371a55(++_0x444332);}(_0x310f,0x17e));var _0xf310=function(_0x2d7a1c,_0x31c057){_0x2d7a1c=_0x2d7a1c-0x0;var _0x1c2e34=_0x310f[_0x2d7a1c];return _0x1c2e34;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports['fields']=function(_0x422182){var _0x43d08a=null;if(_0x422182){_0x43d08a=_0x422182[_0xf310('0x0')](',');}return _0x43d08a;};exports['filters']=function(_0x130018){var _0xae267a={};if(!_[_0xf310('0x1')](_0x130018)){_0xae267a={};_['forOwn'](_0x130018,function(_0x22b9aa,_0x16c2ff){try{_0xae267a[_0x16c2ff]=JSON['parse'](_0x22b9aa);}catch(_0x1e1962){_0xae267a[_0x16c2ff]=_0x22b9aa[_0xf310('0x0')](',');}});}return _0xae267a;};exports[_0xf310('0x2')]=function(_0x2ae2e2){_0x2ae2e2=parseInt(_0x2ae2e2,0xa);if(!_0x2ae2e2||_0x2ae2e2<0x0){_0x2ae2e2=LIMIT_VALUE;}return _0x2ae2e2;};exports[_0xf310('0x3')]=function(_0x181102){_0x181102=parseInt(_0x181102,0xa);if(!_0x181102||_0x181102<0x0){_0x181102=0x0;}return _0x181102;};exports[_0xf310('0x4')]=function(_0xa82ebc){var _0x355987,_0x35699d=null;if(_0xa82ebc){_0x355987=_0xa82ebc[_0xf310('0x0')](',');_0x35699d=_[_0xf310('0x5')](_0x355987,function(_0x482996){if(_0x482996[_0xf310('0x6')]('-')===0x0){return[_0x482996==='priority'?sequelize[_0xf310('0x7')](sequelize['col']('priority'),'unsigned'):_0x482996[_0xf310('0x8')](0x1),'DESC'];}else{return[_0x482996==='priority'?sequelize[_0xf310('0x7')](sequelize[_0xf310('0x9')](_0xf310('0xa')),_0xf310('0xb')):_0x482996,_0xf310('0xc')];}});}return _0x35699d;};exports[_0xf310('0xd')]=function(_0x4d0686,_0x41a4b1){if(_['isEmpty'](_0x4d0686)){return _0x4d0686;}if(_[_0xf310('0xe')](_0x4d0686)){for(var _0x518d72=0x0;_0x518d72<_0x4d0686['length'];_0x518d72+=0x1){_0x4d0686[_0x518d72]=this[_0xf310('0xd')](_0x4d0686[_0x518d72],_0x41a4b1);}return _0x4d0686;}if(!_[_0xf310('0xf')](_0x4d0686)){return _0x4d0686;}if(_[_0xf310('0x10')](_0x41a4b1)){_0x41a4b1=[_0x41a4b1];}if(!_[_0xf310('0xe')](_0x41a4b1)){return _0x4d0686;}for(var _0x30932e=0x0;_0x30932e<_0x41a4b1[_0xf310('0x11')];_0x30932e+=0x1){_[_0xf310('0x12')](_0x4d0686,_0x41a4b1[_0x30932e]);}for(var _0x15b89c in _0x4d0686){if(_0x4d0686[_0xf310('0x13')](_0x15b89c)){_0x4d0686[_0x15b89c]=this[_0xf310('0xd')](_0x4d0686[_0x15b89c],_0x41a4b1);}}return _0x4d0686;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 64347ca..d9d4b04 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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(_0x58adff,_0x50e75c){var _0x37bbc9=function(_0x63ea1d){while(--_0x63ea1d){_0x58adff['push'](_0x58adff['shift']());}};_0x37bbc9(++_0x50e75c);}(_0x70e0,0x17b));var _0x070e=function(_0x58e342,_0x1455e9){_0x58e342=_0x58e342-0x0;var _0x24377f=_0x70e0[_0x58e342];return _0x24377f;};'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 +var _0x9c44=['appPath','development','favicon.ico','set','client','json\x20replacer','split','static','views','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','body-parser','method-override','cookie-parser','errorhandler','path','passport','./environment','default','get','env','use','join','root','public'];(function(_0x2dc5b7,_0x3837ba){var _0x4edb5b=function(_0x3ed644){while(--_0x3ed644){_0x2dc5b7['push'](_0x2dc5b7['shift']());}};_0x4edb5b(++_0x3837ba);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x49c4('0x0'));var methodOverride=require(_0x49c4('0x1'));var cookieParser=require(_0x49c4('0x2'));var errorHandler=require(_0x49c4('0x3'));var path=require(_0x49c4('0x4'));var passport=require(_0x49c4('0x5'));var cors=require('cors');var moment=require('moment');var config=require(_0x49c4('0x6'));var db=require('../mysqldb')['db'];exports[_0x49c4('0x7')]=function(_0x6030ae){var _0x69bc41=_0x6030ae[_0x49c4('0x8')](_0x49c4('0x9'));if(_0x69bc41==='production'){_0x6030ae[_0x49c4('0xa')](favicon(path[_0x49c4('0xb')](config[_0x49c4('0xc')],_0x49c4('0xd'),'favicon.ico')));_0x6030ae['set'](_0x49c4('0xe'),path[_0x49c4('0xb')](config['root'],_0x49c4('0xd')));}if(_0x69bc41===_0x49c4('0xf')||_0x69bc41==='test'){_0x6030ae['use'](favicon(path[_0x49c4('0xb')](config[_0x49c4('0xc')],'client',_0x49c4('0x10'))));_0x6030ae[_0x49c4('0x11')]('appPath',path[_0x49c4('0xb')](config[_0x49c4('0xc')],_0x49c4('0x12')));_0x6030ae[_0x49c4('0xa')](errorHandler());}_0x6030ae[_0x49c4('0x11')](_0x49c4('0x13'),function(_0x75ea8,_0x3de397){if(this[_0x75ea8]instanceof Date){_0x3de397=this[_0x75ea8]['toISOString']()[_0x49c4('0x14')]('.')[0x0]+'Z';}return _0x3de397;});_0x6030ae[_0x49c4('0xa')](express[_0x49c4('0x15')](_0x6030ae[_0x49c4('0x8')](_0x49c4('0xe'))));_0x6030ae['set'](_0x49c4('0x16'),config[_0x49c4('0xc')]+'/server/views');_0x6030ae['engine'](_0x49c4('0x17'),require(_0x49c4('0x18'))[_0x49c4('0x19')]);_0x6030ae['set'](_0x49c4('0x1a'),'html');_0x6030ae[_0x49c4('0xa')](bodyParser[_0x49c4('0x1b')]({'limit':_0x49c4('0x1c'),'extended':!![]}));_0x6030ae[_0x49c4('0xa')](bodyParser[_0x49c4('0x1d')]({'limit':_0x49c4('0x1c')}));_0x6030ae[_0x49c4('0xa')](cors());_0x6030ae[_0x49c4('0xa')](methodOverride());_0x6030ae[_0x49c4('0xa')](cookieParser());_0x6030ae['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index df1dee6..32035d5 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 _0xd5d2=['getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','hex','substring','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','join','createHash','md5','update'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xd5d2,0x154));var _0x2d5d=function(_0x4b1e32,_0x296231){_0x4b1e32=_0x4b1e32-0x0;var _0x2a31ea=_0xd5d2[_0x4b1e32];return _0x2a31ea;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x2d5d('0x0'));var machine=require(_0x2d5d('0x1'));var exec=require(_0x2d5d('0x2'))[_0x2d5d('0x3')];function getInterfaces(){var _0x3c201a=[];var _0x158141=os['networkInterfaces']();var _0x461c74=_[_0x2d5d('0x4')](_[_0x2d5d('0x5')](_0x158141));for(var _0x37e620=0x0;_0x37e620<_0x461c74[_0x2d5d('0x6')];_0x37e620++){var _0x1d1af=_0x158141[_0x461c74[_0x37e620]][_0x2d5d('0x7')](function(_0x2299a7){return _0x2299a7['family']===_0x2d5d('0x8')&&_0x2299a7[_0x2d5d('0x9')]===![];});_0x3c201a=_0x3c201a[_0x2d5d('0xa')](_0x1d1af);}return _0x3c201a;}function getFirstInterface(){var _0x1fa5b8=_[_0x2d5d('0xb')](getInterfaces());return{'macAddress':_0x1fa5b8&&_0x1fa5b8[_0x2d5d('0xc')]?_0x1fa5b8[_0x2d5d('0xc')]:_0x2d5d('0xd'),'ipAddress':_0x1fa5b8&&_0x1fa5b8['address']?_0x1fa5b8[_0x2d5d('0xe')]:_0x2d5d('0xf')};}exports[_0x2d5d('0x10')]=getFirstInterface;function getCPUhash(){var _0x33985f=_[_0x2d5d('0x4')](os['cpus']()[_0x2d5d('0x11')](function(_0x364d99){return _0x364d99[_0x2d5d('0x12')];}))[_0x2d5d('0x13')](':');return crypto[_0x2d5d('0x14')](_0x2d5d('0x15'))[_0x2d5d('0x16')](_0x33985f)['digest']('hex');}exports[_0x2d5d('0x17')]=function(){switch(os[_0x2d5d('0x18')]()){case _0x2d5d('0x19'):return exec(_0x2d5d('0x1a'),{'encoding':_0x2d5d('0x1b')})[_0x2d5d('0x1c')]('\x0d\x0a','');default:var _0x11a96c=getFirstInterface();var _0x230fd0=getCPUhash();var _0x510e20=_0x230fd0+'|'+os['hostname']()+'|'+_0x11a96c[_0x2d5d('0x1d')]+'|'+_0x11a96c[_0x2d5d('0x1e')];var _0x96f019=crypto[_0x2d5d('0x14')](_0x2d5d('0x15'))[_0x2d5d('0x16')](_0x510e20)['digest'](_0x2d5d('0x1f'));return _0x96f019[_0x2d5d('0x20')](0x0,0x8)+'-'+_0x96f019[_0x2d5d('0x20')](0x8,0xc)+'-'+_0x96f019['substring'](0xc,0x10)+'-'+_0x96f019[_0x2d5d('0x20')](0x10,0x14)+'-'+_0x96f019['substring'](0x14);}}; \ No newline at end of file +var _0xd694=['digest','getUuid','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','hex','substring','lodash','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','IPv4','concat','head','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd694,0x11b));var _0x4d69=function(_0x4ac24c,_0x2791b9){_0x4ac24c=_0x4ac24c-0x0;var _0x3961b0=_0xd694[_0x4ac24c];return _0x3961b0;};'use strict';var _=require(_0x4d69('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x4d69('0x1'));var exec=require(_0x4d69('0x2'))[_0x4d69('0x3')];function getInterfaces(){var _0x25a783=[];var _0x49042c=os[_0x4d69('0x4')]();var _0x49b1d8=_[_0x4d69('0x5')](_[_0x4d69('0x6')](_0x49042c));for(var _0x5ba6c1=0x0;_0x5ba6c1<_0x49b1d8[_0x4d69('0x7')];_0x5ba6c1++){var _0x3e4906=_0x49042c[_0x49b1d8[_0x5ba6c1]][_0x4d69('0x8')](function(_0x27cb5b){return _0x27cb5b['family']===_0x4d69('0x9')&&_0x27cb5b['internal']===![];});_0x25a783=_0x25a783[_0x4d69('0xa')](_0x3e4906);}return _0x25a783;}function getFirstInterface(){var _0xda5704=_[_0x4d69('0xb')](getInterfaces());return{'macAddress':_0xda5704&&_0xda5704['mac']?_0xda5704['mac']:_0x4d69('0xc'),'ipAddress':_0xda5704&&_0xda5704[_0x4d69('0xd')]?_0xda5704[_0x4d69('0xd')]:_0x4d69('0xe')};}exports[_0x4d69('0xf')]=getFirstInterface;function getCPUhash(){var _0x1f22f1=_[_0x4d69('0x5')](os[_0x4d69('0x10')]()[_0x4d69('0x11')](function(_0x5e7321){return _0x5e7321[_0x4d69('0x12')];}))[_0x4d69('0x13')](':');return crypto[_0x4d69('0x14')](_0x4d69('0x15'))[_0x4d69('0x16')](_0x1f22f1)[_0x4d69('0x17')]('hex');}exports[_0x4d69('0x18')]=function(){switch(os['platform']()){case _0x4d69('0x19'):return exec(_0x4d69('0x1a'),{'encoding':_0x4d69('0x1b')})[_0x4d69('0x1c')]('\x0d\x0a','');default:var _0x33ca9b=getFirstInterface();var _0x4bc693=getCPUhash();var _0x190940=_0x4bc693+'|'+os[_0x4d69('0x1d')]()+'|'+_0x33ca9b[_0x4d69('0x1e')]+'|'+_0x33ca9b[_0x4d69('0x1f')];var _0x29bd12=crypto[_0x4d69('0x14')](_0x4d69('0x15'))[_0x4d69('0x16')](_0x190940)[_0x4d69('0x17')](_0x4d69('0x20'));return _0x29bd12[_0x4d69('0x21')](0x0,0x8)+'-'+_0x29bd12['substring'](0x8,0xc)+'-'+_0x29bd12[_0x4d69('0x21')](0xc,0x10)+'-'+_0x29bd12[_0x4d69('0x21')](0x10,0x14)+'-'+_0x29bd12['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 6c18b02..3ad7ec5 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 _0xd287=['base64','final','createDecipher','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','then','|reason|','|machineUuid|','|name|','|email|','openIssue','MOTLICENSE','get','active','license','data2','info','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','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','spread','https','crypto','pkginfo','version','../../mysqldb','../environment','./hardware','../logger','../../api/jira/jira.controller','www.xcallymotion.com','format','/api/servers/%s/check?version=%s','exports','request','setEncoding','utf8','data','end','parse','error','aes-256-ctr','session','update'];(function(_0x441c36,_0x35660c){var _0x15eebc=function(_0x5a7406){while(--_0x5a7406){_0x441c36['push'](_0x441c36['shift']());}};_0x15eebc(++_0x35660c);}(_0xd287,0x115));var _0x7d28=function(_0xa175d3,_0x2ff8a9){_0xa175d3=_0xa175d3-0x0;var _0x1629a3=_0xd287[_0xa175d3];return _0x1629a3;};'use strict';var util=require('util');var https=require(_0x7d28('0x0'));var crypto=require(_0x7d28('0x1'));var moment=require('moment');var BPromise=require('bluebird');var pkginfo=require(_0x7d28('0x2'))(module,_0x7d28('0x3'));var db=require(_0x7d28('0x4'))['db'];var config=require(_0x7d28('0x5'));var hardware=require(_0x7d28('0x6'));var logger=require(_0x7d28('0x7'))('license');var jira=require(_0x7d28('0x8'));var HOST=_0x7d28('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;function httpRequest(_0x3c41f4){return new BPromise(function(_0xd67e9b,_0x525775){var _0x3dfe07={'host':HOST,'port':0x1bb,'path':util[_0x7d28('0xa')](_0x7d28('0xb'),_0x3c41f4,module[_0x7d28('0xc')][_0x7d28('0x3')]),'method':'GET','timeout':0xea60,'headers':{'Content-Type':'application/json'}};var _0x7d328e=https[_0x7d28('0xd')](_0x3dfe07,function(_0x340aaf){_0x340aaf[_0x7d28('0xe')](_0x7d28('0xf'));var _0x502708='';_0x340aaf['on'](_0x7d28('0x10'),function(_0xb1fd8d){_0x502708+=_0xb1fd8d;});_0x340aaf['on'](_0x7d28('0x11'),function(){try{_0xd67e9b(JSON[_0x7d28('0x12')](_0x502708));}catch(_0x292a3f){_0x525775(_0x292a3f);}});});_0x7d328e['on'](_0x7d28('0x13'),_0x525775);_0x7d328e[_0x7d28('0x11')]();});}function encryptDate(_0x29391d){var _0x1e96e7=crypto['createCipher'](_0x7d28('0x14'),config['secrets'][_0x7d28('0x15')]);var _0x427f3f=_0x1e96e7[_0x7d28('0x16')](_0x29391d,'utf8',_0x7d28('0x17'));_0x427f3f+=_0x1e96e7[_0x7d28('0x18')]('base64');return _0x427f3f;}function decryptDate(_0x4f70e4){var _0x50630c=crypto[_0x7d28('0x19')](_0x7d28('0x14'),config['secrets'][_0x7d28('0x15')]);var _0x3c9a3e=_0x50630c[_0x7d28('0x16')](_0x4f70e4,_0x7d28('0x17'),_0x7d28('0xf'));_0x3c9a3e+=_0x50630c[_0x7d28('0x18')](_0x7d28('0xf'));return _0x3c9a3e;}function sendJiraAlert(_0x111abc,_0x336322,_0x1d8252){var _0x134b72=_0x7d28('0x1a');return db[_0x7d28('0x1b')][_0x7d28('0x1c')]({'where':{'role':_0x7d28('0x1d')},'attributes':[_0x7d28('0x1e'),_0x7d28('0x1f')],'raw':!![]})[_0x7d28('0x20')](function(_0x39e3c2){ADMIN=_0x39e3c2;_0x134b72+=_0x7d28('0x21')+_0x1d8252+'|\x0a';_0x134b72+='|uuid|'+_0x111abc+'|\x0a';_0x134b72+=_0x7d28('0x22')+_0x336322+'|\x0a';_0x134b72+=_0x7d28('0x23')+ADMIN[_0x7d28('0x1e')]+'|\x0a';_0x134b72+=_0x7d28('0x24')+ADMIN[_0x7d28('0x1f')]+'|\x0a';return _0x134b72;})[_0x7d28('0x20')](function(_0x35629a){var _0x491d80=hardware['getFirstInterface']()['ipAddress'];return jira[_0x7d28('0x25')]({'key':_0x7d28('0x26'),'summary':'Motion\x20License\x20Alert','description':_0x35629a,'issuetype':'Alert','oldToken':_0x111abc,'newToken':_0x336322,'email':ADMIN[_0x7d28('0x1f')],'name':ADMIN[_0x7d28('0x1e')],'reason':GRAY_PERIOD_REASON,'ip':_0x491d80});});}function manageLicense(_0x159069,_0x1fdb7c){var _0x135633=_0x1fdb7c[_0x7d28('0x27')]({'plain':!![]});httpRequest(_0x159069)[_0x7d28('0x20')](function(_0x5ef44){if(_0x5ef44[_0x7d28('0x28')]){if(!_0x135633[_0x7d28('0x29')]&&_0x135633['license']!=_0x5ef44[_0x7d28('0x29')]||_0x135633[_0x7d28('0x29')]&&_0x135633[_0x7d28('0x2a')]){logger[_0x7d28('0x2b')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x135633[_0x7d28('0x29')]&&!_0x135633[_0x7d28('0x2a')]&&_0x135633[_0x7d28('0x29')]!=_0x5ef44[_0x7d28('0x29')]){logger[_0x7d28('0x2b')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x135633[_0x7d28('0x29')]&&!_0x135633['data2']&&_0x135633[_0x7d28('0x29')]==_0x5ef44[_0x7d28('0x29')]){return _0x1fdb7c;}return _0x1fdb7c['update']({'data1':_0x159069,'data2':null,'license':_0x5ef44[_0x7d28('0x29')]});}else{if(_0x5ef44[_0x7d28('0x29')]||_0x135633[_0x7d28('0x29')]){if(!_0x135633[_0x7d28('0x2a')]){if(_0x135633['data1']==_0x159069){GRAY_PERIOD_REASON='Disabled';logger['info'](_0x7d28('0x2c'));}else{GRAY_PERIOD_REASON=_0x7d28('0x2d');logger['info'](_0x7d28('0x2e'),_0x135633['data1'],_0x159069);}sendJiraAlert(_0x135633[_0x7d28('0x2f')],_0x5ef44[_0x7d28('0x30')],GRAY_PERIOD_REASON);logger[_0x7d28('0x2b')](_0x7d28('0x31'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x7d28('0xa')](_0x7d28('0x32')));return _0x1fdb7c[_0x7d28('0x16')]({'data2':encryptDate(moment()[_0x7d28('0xa')](_0x7d28('0x32')))});}else{if(moment()[_0x7d28('0x33')](decryptDate(_0x135633[_0x7d28('0x2a')]),_0x7d28('0x34'))>DAYS){logger[_0x7d28('0x2b')](_0x7d28('0x35'),moment()[_0x7d28('0xa')](_0x7d28('0x32')));return _0x1fdb7c[_0x7d28('0x16')]({'data1':_0x159069,'data2':null,'license':null});}}}else{if(_0x135633[_0x7d28('0x2f')]!=_0x159069){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x135633['data1'],_0x159069);return _0x1fdb7c[_0x7d28('0x16')]({'data1':_0x159069,'data2':null,'license':null});}}}return _0x1fdb7c;})[_0x7d28('0x20')](function(_0xeae7a7){_0x1fdb7c=_0xeae7a7;})['catch'](function(_0x325792){logger[_0x7d28('0x13')](_0x325792[_0x7d28('0x36')]);})[_0x7d28('0x37')](function(){setTimeout(function(){manageLicense(hardware[_0x7d28('0x38')](),_0x1fdb7c);},TIME);});}function defaultLicense(){var _0x39ecb1=hardware['getUuid']();if(_0x39ecb1){return db[_0x7d28('0x39')][_0x7d28('0x3a')]({'where':{'id':0x1},'defaults':{'data1':_0x39ecb1}})[_0x7d28('0x3b')](function(_0x40c792,_0x58890e){logger[_0x7d28('0x2b')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x39ecb1);manageLicense(_0x39ecb1,_0x40c792);})['catch'](function(_0x4e3136){logger[_0x7d28('0x13')](_0x4e3136[_0x7d28('0x36')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0xd7c9=['base64','utf8','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','then','|reason|','|uuid|','|machineUuid|','|name|','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','license','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','days','catch','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','https','crypto','bluebird','pkginfo','version','../environment','./hardware','www.xcallymotion.com','format','/api/servers/%s/check?version=%s','GET','application/json','request','setEncoding','data','end','parse','aes-256-ctr','secrets','session','update'];(function(_0x3e30a8,_0x257732){var _0x5d5d1d=function(_0x2987f1){while(--_0x2987f1){_0x3e30a8['push'](_0x3e30a8['shift']());}};_0x5d5d1d(++_0x257732);}(_0xd7c9,0xf2));var _0x9d7c=function(_0x53807d,_0x4a90a8){_0x53807d=_0x53807d-0x0;var _0x501207=_0xd7c9[_0x53807d];return _0x501207;};'use strict';var util=require(_0x9d7c('0x0'));var https=require(_0x9d7c('0x1'));var crypto=require(_0x9d7c('0x2'));var moment=require('moment');var BPromise=require(_0x9d7c('0x3'));var pkginfo=require(_0x9d7c('0x4'))(module,_0x9d7c('0x5'));var db=require('../../mysqldb')['db'];var config=require(_0x9d7c('0x6'));var hardware=require(_0x9d7c('0x7'));var logger=require('../logger')('license');var jira=require('../../api/jira/jira.controller');var HOST=_0x9d7c('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;function httpRequest(_0x3c26c8){return new BPromise(function(_0x4522e6,_0x559b5e){var _0x5e17e9={'host':HOST,'port':0x1bb,'path':util[_0x9d7c('0x9')](_0x9d7c('0xa'),_0x3c26c8,module['exports'][_0x9d7c('0x5')]),'method':_0x9d7c('0xb'),'timeout':0xea60,'headers':{'Content-Type':_0x9d7c('0xc')}};var _0xab58f7=https[_0x9d7c('0xd')](_0x5e17e9,function(_0xa13687){_0xa13687[_0x9d7c('0xe')]('utf8');var _0x5e5093='';_0xa13687['on'](_0x9d7c('0xf'),function(_0x2d2c35){_0x5e5093+=_0x2d2c35;});_0xa13687['on'](_0x9d7c('0x10'),function(){try{_0x4522e6(JSON[_0x9d7c('0x11')](_0x5e5093));}catch(_0x1f39eb){_0x559b5e(_0x1f39eb);}});});_0xab58f7['on']('error',_0x559b5e);_0xab58f7[_0x9d7c('0x10')]();});}function encryptDate(_0x43f0d4){var _0x3c0aed=crypto['createCipher'](_0x9d7c('0x12'),config[_0x9d7c('0x13')][_0x9d7c('0x14')]);var _0x4a2509=_0x3c0aed[_0x9d7c('0x15')](_0x43f0d4,'utf8',_0x9d7c('0x16'));_0x4a2509+=_0x3c0aed['final']('base64');return _0x4a2509;}function decryptDate(_0x2aad06){var _0x4f9ed2=crypto['createDecipher'](_0x9d7c('0x12'),config[_0x9d7c('0x13')][_0x9d7c('0x14')]);var _0x215b9d=_0x4f9ed2[_0x9d7c('0x15')](_0x2aad06,_0x9d7c('0x16'),_0x9d7c('0x17'));_0x215b9d+=_0x4f9ed2['final'](_0x9d7c('0x17'));return _0x215b9d;}function sendJiraAlert(_0x5643b2,_0x1bb0ad,_0x3826b0){var _0x21d7d8=_0x9d7c('0x18');return db[_0x9d7c('0x19')][_0x9d7c('0x1a')]({'where':{'role':_0x9d7c('0x1b')},'attributes':[_0x9d7c('0x1c'),_0x9d7c('0x1d')],'raw':!![]})[_0x9d7c('0x1e')](function(_0x31be17){ADMIN=_0x31be17;_0x21d7d8+=_0x9d7c('0x1f')+_0x3826b0+'|\x0a';_0x21d7d8+=_0x9d7c('0x20')+_0x5643b2+'|\x0a';_0x21d7d8+=_0x9d7c('0x21')+_0x1bb0ad+'|\x0a';_0x21d7d8+=_0x9d7c('0x22')+ADMIN[_0x9d7c('0x1c')]+'|\x0a';_0x21d7d8+=_0x9d7c('0x23')+ADMIN[_0x9d7c('0x1d')]+'|\x0a';return _0x21d7d8;})[_0x9d7c('0x1e')](function(_0x9d0319){var _0x27c308=hardware[_0x9d7c('0x24')]()[_0x9d7c('0x25')];return jira[_0x9d7c('0x26')]({'key':_0x9d7c('0x27'),'summary':_0x9d7c('0x28'),'description':_0x9d0319,'issuetype':_0x9d7c('0x29'),'oldToken':_0x5643b2,'newToken':_0x1bb0ad,'email':ADMIN[_0x9d7c('0x1d')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x27c308});});}function manageLicense(_0x5572b6,_0x5134f8){var _0x421bf3=_0x5134f8[_0x9d7c('0x2a')]({'plain':!![]});httpRequest(_0x5572b6)['then'](function(_0x316151){if(_0x316151[_0x9d7c('0x2b')]){if(!_0x421bf3[_0x9d7c('0x2c')]&&_0x421bf3['license']!=_0x316151[_0x9d7c('0x2c')]||_0x421bf3[_0x9d7c('0x2c')]&&_0x421bf3[_0x9d7c('0x2d')]){logger['info'](_0x9d7c('0x2e'));}if(_0x421bf3[_0x9d7c('0x2c')]&&!_0x421bf3[_0x9d7c('0x2d')]&&_0x421bf3[_0x9d7c('0x2c')]!=_0x316151[_0x9d7c('0x2c')]){logger[_0x9d7c('0x2f')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x421bf3['license']&&!_0x421bf3[_0x9d7c('0x2d')]&&_0x421bf3[_0x9d7c('0x2c')]==_0x316151[_0x9d7c('0x2c')]){return _0x5134f8;}return _0x5134f8['update']({'data1':_0x5572b6,'data2':null,'license':_0x316151[_0x9d7c('0x2c')]});}else{if(_0x316151[_0x9d7c('0x2c')]||_0x421bf3['license']){if(!_0x421bf3[_0x9d7c('0x2d')]){if(_0x421bf3[_0x9d7c('0x30')]==_0x5572b6){GRAY_PERIOD_REASON=_0x9d7c('0x31');logger['info'](_0x9d7c('0x32'));}else{GRAY_PERIOD_REASON=_0x9d7c('0x33');logger[_0x9d7c('0x2f')](_0x9d7c('0x34'),_0x421bf3[_0x9d7c('0x30')],_0x5572b6);}sendJiraAlert(_0x421bf3[_0x9d7c('0x30')],_0x316151['uuid'],GRAY_PERIOD_REASON);logger['info'](_0x9d7c('0x35'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x9d7c('0x9')](_0x9d7c('0x36')));return _0x5134f8[_0x9d7c('0x15')]({'data2':encryptDate(moment()[_0x9d7c('0x9')](_0x9d7c('0x36')))});}else{if(moment()['diff'](decryptDate(_0x421bf3['data2']),_0x9d7c('0x37'))>DAYS){logger[_0x9d7c('0x2f')]('DEMO\x20START\x20AT\x20%s',moment()[_0x9d7c('0x9')](_0x9d7c('0x36')));return _0x5134f8['update']({'data1':_0x5572b6,'data2':null,'license':null});}}}else{if(_0x421bf3['data1']!=_0x5572b6){logger[_0x9d7c('0x2f')](_0x9d7c('0x34'),_0x421bf3[_0x9d7c('0x30')],_0x5572b6);return _0x5134f8[_0x9d7c('0x15')]({'data1':_0x5572b6,'data2':null,'license':null});}}}return _0x5134f8;})[_0x9d7c('0x1e')](function(_0x30a88e){_0x5134f8=_0x30a88e;})[_0x9d7c('0x38')](function(_0x23035b){logger['error'](_0x23035b[_0x9d7c('0x39')]);})[_0x9d7c('0x3a')](function(){setTimeout(function(){manageLicense(hardware[_0x9d7c('0x3b')](),_0x5134f8);},TIME);});}function defaultLicense(){var _0x4a8aa5=hardware[_0x9d7c('0x3b')]();if(_0x4a8aa5){return db[_0x9d7c('0x3c')][_0x9d7c('0x3d')]({'where':{'id':0x1},'defaults':{'data1':_0x4a8aa5}})[_0x9d7c('0x3e')](function(_0x22e750,_0x5ce32a){logger[_0x9d7c('0x2f')](_0x9d7c('0x3f'),_0x4a8aa5);manageLicense(_0x4a8aa5,_0x22e750);})[_0x9d7c('0x38')](function(_0x36bf52){logger[_0x9d7c('0x40')](_0x36bf52[_0x9d7c('0x39')]);});}}exports[_0x9d7c('0x41')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index fc99b4c..ee5e259 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 _0xd1e2=['parse','demo','uuid','getUuid','aes-256-ctr','secrets','session','deadline','days','format','grayReason','machineUuid','changed','disabled','Breaking\x20license','data1','Demo\x20license','getLicense','License','defaults','checkLicense','crypto','util','lodash','./hardware','../environment','../../mysqldb','license','isEmpty','createDecipher','update','base64','utf8','final'];(function(_0x21b066,_0x542981){var _0x4d1c9a=function(_0x574077){while(--_0x574077){_0x21b066['push'](_0x21b066['shift']());}};_0x4d1c9a(++_0x542981);}(_0xd1e2,0x1cf));var _0x2d1e=function(_0xaa6983,_0x5bc2f2){_0xaa6983=_0xaa6983-0x0;var _0x880b29=_0xd1e2[_0xaa6983];return _0x880b29;};'use strict';var crypto=require(_0x2d1e('0x0'));var util=require(_0x2d1e('0x1'));var _=require(_0x2d1e('0x2'));var moment=require('moment');var hardware=require(_0x2d1e('0x3'));var config=require(_0x2d1e('0x4'));var db=require(_0x2d1e('0x5'))['db'];function checkLicense(_0x44a28d,_0xa704e6){if(_0x44a28d){try{var _0x45f9fe=_0xa704e6||_0x44a28d[_0x2d1e('0x6')];if(_[_0x2d1e('0x7')](_0x45f9fe)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x134cc3=_0x44a28d['data1'];var _0x16039f=_0x44a28d['data2'];var _0x29456a=_0x134cc3['split']('-')[0x4];var _0x181a87=_0x134cc3['split']('-')[0x0];var _0x1b9105=crypto[_0x2d1e('0x8')]('aes-256-ctr',util['format']('%s:%s:%s',_0x29456a,_0x134cc3,_0x181a87));var _0xe6becc=_0x1b9105[_0x2d1e('0x9')](_0x45f9fe,_0x2d1e('0xa'),_0x2d1e('0xb'));_0xe6becc+=_0x1b9105[_0x2d1e('0xc')]('utf8');var _0x3e936c=JSON[_0x2d1e('0xd')](_0xe6becc);_0x3e936c[_0x2d1e('0xe')]=![];_0x3e936c[_0x2d1e('0xf')]=_0x134cc3;_0x3e936c['machineUuid']=hardware[_0x2d1e('0x10')]();if(_0x16039f){var _0xc246f1=crypto['createDecipher'](_0x2d1e('0x11'),config[_0x2d1e('0x12')][_0x2d1e('0x13')]);var _0x46d8a3=_0xc246f1[_0x2d1e('0x9')](_0x16039f,'base64',_0x2d1e('0xb'));_0x46d8a3+=_0xc246f1[_0x2d1e('0xc')](_0x2d1e('0xb'));_0x3e936c['gray']=_0x46d8a3;_0x3e936c[_0x2d1e('0x14')]=moment(_0x46d8a3)['add'](0x7,_0x2d1e('0x15'))[_0x2d1e('0x16')]();_0x3e936c[_0x2d1e('0x17')]=_0x3e936c[_0x2d1e('0xf')]!=_0x3e936c[_0x2d1e('0x18')]?_0x2d1e('0x19'):_0x2d1e('0x1a');}return _0x3e936c;}catch(_0x2d1209){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2d1e('0x1b'),'uuid':_0x44a28d[_0x2d1e('0x1c')],'machineUuid':hardware[_0x2d1e('0x10')](),'message':_0x2d1209['message'],'virtual':0x0,'voice':!![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2d1e('0x1d'),'uuid':_0x44a28d[_0x2d1e('0x1c')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'preferred':![]};}exports[_0x2d1e('0x1e')]=function(_0x35f5c6){return db[_0x2d1e('0x1f')]['find'](_[_0x2d1e('0x20')](_0x35f5c6,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2e2ccf){return checkLicense(_0x2e2ccf,null);});};exports[_0x2d1e('0x21')]=checkLicense; \ No newline at end of file +var _0xcec5=['license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','parse','uuid','machineUuid','secrets','base64','gray','add','days','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','getUuid','getLicense','License','find','then','checkLicense','crypto','util','lodash','./hardware','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcec5,0xd3));var _0x5cec=function(_0x1fe825,_0x557443){_0x1fe825=_0x1fe825-0x0;var _0x452879=_0xcec5[_0x1fe825];return _0x452879;};'use strict';var crypto=require(_0x5cec('0x0'));var util=require(_0x5cec('0x1'));var _=require(_0x5cec('0x2'));var moment=require('moment');var hardware=require(_0x5cec('0x3'));var config=require('../environment');var db=require(_0x5cec('0x4'))['db'];function checkLicense(_0x43b6e2,_0x386fa5){if(_0x43b6e2){try{var _0x1fb4b4=_0x386fa5||_0x43b6e2[_0x5cec('0x5')];if(_[_0x5cec('0x6')](_0x1fb4b4)){throw new Error(_0x5cec('0x7'));}var _0x284617=_0x43b6e2[_0x5cec('0x8')];var _0x4e0919=_0x43b6e2[_0x5cec('0x9')];var _0x56b32e=_0x284617[_0x5cec('0xa')]('-')[0x4];var _0x568368=_0x284617['split']('-')[0x0];var _0x39bd31=crypto[_0x5cec('0xb')](_0x5cec('0xc'),util[_0x5cec('0xd')](_0x5cec('0xe'),_0x56b32e,_0x284617,_0x568368));var _0x5547ce=_0x39bd31[_0x5cec('0xf')](_0x1fb4b4,'base64',_0x5cec('0x10'));_0x5547ce+=_0x39bd31['final'](_0x5cec('0x10'));var _0x1da5f3=JSON[_0x5cec('0x11')](_0x5547ce);_0x1da5f3['demo']=![];_0x1da5f3[_0x5cec('0x12')]=_0x284617;_0x1da5f3[_0x5cec('0x13')]=hardware['getUuid']();if(_0x4e0919){var _0x207f08=crypto[_0x5cec('0xb')](_0x5cec('0xc'),config[_0x5cec('0x14')]['session']);var _0x4034ea=_0x207f08['update'](_0x4e0919,_0x5cec('0x15'),'utf8');_0x4034ea+=_0x207f08['final'](_0x5cec('0x10'));_0x1da5f3[_0x5cec('0x16')]=_0x4034ea;_0x1da5f3['deadline']=moment(_0x4034ea)[_0x5cec('0x17')](0x7,_0x5cec('0x18'))[_0x5cec('0xd')]();_0x1da5f3['grayReason']=_0x1da5f3['uuid']!=_0x1da5f3['machineUuid']?_0x5cec('0x19'):_0x5cec('0x1a');}return _0x1da5f3;}catch(_0x208260){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5cec('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x5cec('0x1c'),'uuid':_0x43b6e2[_0x5cec('0x8')],'machineUuid':hardware['getUuid'](),'message':_0x208260[_0x5cec('0x1d')],'virtual':0x0,'voice':!![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5cec('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Demo\x20license','uuid':_0x43b6e2['data1'],'machineUuid':hardware[_0x5cec('0x1e')](),'virtual':0x0,'voice':!![],'preferred':![]};}exports[_0x5cec('0x1f')]=function(_0x58068e){return db[_0x5cec('0x20')][_0x5cec('0x21')](_['defaults'](_0x58068e,{'raw':!![],'where':{'id':0x1}}))[_0x5cec('0x22')](function(_0x1ad335){return checkLicense(_0x1ad335,null);});};exports[_0x5cec('0x23')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index aa29791..a1202ed 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 _0x5d70=['secret','exports','http://localhost:9000','app-id'];(function(_0x3b6f58,_0x5870de){var _0x987c61=function(_0x3a9281){while(--_0x3a9281){_0x3b6f58['push'](_0x3b6f58['shift']());}};_0x987c61(++_0x5870de);}(_0x5d70,0x8d));var _0x05d7=function(_0x19718a,_0x43c96a){_0x19718a=_0x19718a-0x0;var _0x5934ba=_0x5d70[_0x19718a];return _0x5934ba;};'use strict';module[_0x05d7('0x0')]={'DOMAIN':_0x05d7('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x05d7('0x2'),'GOOGLE_SECRET':_0x05d7('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x195e=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x3bd9bc,_0x40bc57){var _0x3ad356=function(_0xef3a80){while(--_0xef3a80){_0x3bd9bc['push'](_0x3bd9bc['shift']());}};_0x3ad356(++_0x40bc57);}(_0x195e,0xfb));var _0xe195=function(_0x10b7c8,_0x1a369c){_0x10b7c8=_0x10b7c8-0x0;var _0x3151c4=_0x195e[_0x10b7c8];return _0x3151c4;};'use strict';module[_0xe195('0x0')]={'DOMAIN':_0xe195('0x1'),'SESSION_SECRET':_0xe195('0x2'),'GOOGLE_ID':_0xe195('0x3'),'GOOGLE_SECRET':_0xe195('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index d3e300d..594e89e 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4724=['util','path','INFO','join','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','File','error','%s-%s','info','Console','env','debugLevel','moment','winston'];(function(_0x472f7f,_0x3ad552){var _0x294981=function(_0x38dd1f){while(--_0x38dd1f){_0x472f7f['push'](_0x472f7f['shift']());}};_0x294981(++_0x3ad552);}(_0x4724,0x178));var _0x4472=function(_0x3d8502,_0x5b23b4){_0x3d8502=_0x3d8502-0x0;var _0x2e8073=_0x4724[_0x3d8502];return _0x2e8073;};'use strict';var moment=require(_0x4472('0x0'));var winston=require(_0x4472('0x1'));var util=require(_0x4472('0x2'));var path=require(_0x4472('0x3'));var debugLevel=_0x4472('0x4');function filename(_0x489f2c,_0x5ed358){return path[_0x4472('0x5')]('/var',_0x4472('0x6'),_0x4472('0x7'),util[_0x4472('0x8')](_0x4472('0x9'),_0x489f2c,_0x5ed358));}function formatter(_0x19ba2f,_0x3cf8e5){return util['format'](_0x4472('0xa'),moment()['format'](_0x4472('0xb')),_0x3cf8e5['level']['toUpperCase'](),_0x19ba2f,_0x3cf8e5['message']);}module['exports']=function(_0xcaf536){return new winston[(_0x4472('0xc'))]({'transports':[new winston[(_0x4472('0xd'))][(_0x4472('0xe'))]({'name':util[_0x4472('0x8')]('%s-%s',_0xcaf536,'error'),'filename':filename(_0xcaf536,_0x4472('0xf')),'level':_0x4472('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x513b80){return formatter(_0xcaf536,_0x513b80);}}),new winston[(_0x4472('0xd'))][(_0x4472('0xe'))]({'name':util[_0x4472('0x8')](_0x4472('0x10'),_0xcaf536,_0x4472('0x11')),'filename':filename(_0xcaf536,'info'),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x150b52){return formatter(_0xcaf536,_0x150b52);}}),new winston[(_0x4472('0xd'))][(_0x4472('0x12'))]({'level':process[_0x4472('0x13')][_0x4472('0x14')]||debugLevel,'json':![],'formatter':function(_0x9b165a){return formatter(_0xcaf536,_0x9b165a);}})]});}; \ No newline at end of file +var _0x7582=['info','env','debugLevel','moment','winston','join','log','format','%s-%s.log','YYYY-MM-DD\x20HH:mm:ss','message','exports','File','%s-%s','error','transports'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0x7582,0xe3));var _0x2758=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0x7582[_0x4b4638];return _0x59e92b;};'use strict';var moment=require(_0x2758('0x0'));var winston=require(_0x2758('0x1'));var util=require('util');var path=require('path');var debugLevel='INFO';function filename(_0x2e7b66,_0x438eb4){return path[_0x2758('0x2')]('/var',_0x2758('0x3'),'xcally',util[_0x2758('0x4')](_0x2758('0x5'),_0x2e7b66,_0x438eb4));}function formatter(_0x3e6945,_0x3a8e2c){return util[_0x2758('0x4')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x2758('0x4')](_0x2758('0x6')),_0x3a8e2c['level']['toUpperCase'](),_0x3e6945,_0x3a8e2c[_0x2758('0x7')]);}module[_0x2758('0x8')]=function(_0x383934){return new winston['Logger']({'transports':[new winston['transports'][(_0x2758('0x9'))]({'name':util[_0x2758('0x4')](_0x2758('0xa'),_0x383934,'error'),'filename':filename(_0x383934,_0x2758('0xb')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x11de0c){return formatter(_0x383934,_0x11de0c);}}),new winston[(_0x2758('0xc'))][(_0x2758('0x9'))]({'name':util[_0x2758('0x4')]('%s-%s',_0x383934,'info'),'filename':filename(_0x383934,_0x2758('0xd')),'level':_0x2758('0xd'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1e81fe){return formatter(_0x383934,_0x1e81fe);}}),new winston['transports']['Console']({'level':process[_0x2758('0xe')][_0x2758('0xf')]||debugLevel,'json':![],'formatter':function(_0x11a75b){return formatter(_0x383934,_0x11a75b);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 7d0d53c..781b12d 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 _0xb9bc=['../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','../../services/express/index.js','join','../../services/ami/index.js','agi'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9bc,0x1c2));var _0xcb9b=function(_0x4d934b,_0x52f8e9){_0x4d934b=_0x4d934b-0x0;var _0xc0338b=_0xb9bc[_0x4d934b];return _0xc0338b;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xcb9b('0x0'),'script':path['join'](__dirname,_0xcb9b('0x1'))},{'name':'ami','script':path[_0xcb9b('0x2')](__dirname,_0xcb9b('0x3'))},{'name':_0xcb9b('0x4'),'script':path[_0xcb9b('0x2')](__dirname,_0xcb9b('0x5'))},{'name':_0xcb9b('0x6'),'script':path['join'](__dirname,_0xcb9b('0x7'))},{'name':_0xcb9b('0x8'),'script':path[_0xcb9b('0x2')](__dirname,_0xcb9b('0x9'))},{'name':_0xcb9b('0xa'),'script':path[_0xcb9b('0x2')](__dirname,_0xcb9b('0xb'))}]};module[_0xcb9b('0xc')]=config; \ No newline at end of file +var _0xb0d9=['../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','agi','../../services/email/index.js','routing'];(function(_0x4cfa2e,_0x5752b5){var _0x279b50=function(_0x3f817b){while(--_0x3f817b){_0x4cfa2e['push'](_0x4cfa2e['shift']());}};_0x279b50(++_0x5752b5);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x55816d,_0x4e1f3d){_0x55816d=_0x55816d-0x0;var _0x1d4255=_0xb0d9[_0x55816d];return _0x1d4255;};'use strict';var path=require(_0x9b0d('0x0'));var os=require('os');var config={'apps':[{'name':_0x9b0d('0x1'),'script':path[_0x9b0d('0x2')](__dirname,_0x9b0d('0x3'))},{'name':_0x9b0d('0x4'),'script':path[_0x9b0d('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x9b0d('0x5'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':'email','script':path[_0x9b0d('0x2')](__dirname,_0x9b0d('0x6'))},{'name':_0x9b0d('0x7'),'script':path[_0x9b0d('0x2')](__dirname,_0x9b0d('0x8'))},{'name':_0x9b0d('0x9'),'script':path[_0x9b0d('0x2')](__dirname,_0x9b0d('0xa'))}]};module[_0x9b0d('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 48a41a1..de4a14a 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 _0x34e8=['stop','restart','list','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','then','disconnect'];(function(_0x1f820b,_0x1edcee){var _0x27c6a6=function(_0x530427){while(--_0x530427){_0x1f820b['push'](_0x1f820b['shift']());}};_0x27c6a6(++_0x1edcee);}(_0x34e8,0x12c));var _0x834e=function(_0x92d0c,_0x5c2d72){_0x92d0c=_0x92d0c-0x0;var _0xb51464=_0x34e8[_0x92d0c];return _0xb51464;};'use strict';var pm2=require(_0x834e('0x0'));var BPromise=require(_0x834e('0x1'));var config=require(_0x834e('0x2'));function connect(){return new BPromise(function(_0x35e6fb,_0x530939){return pm2[_0x834e('0x3')](function(_0x21e2e0){if(_0x21e2e0){return _0x530939(_0x21e2e0);}return _0x35e6fb(_0x834e('0x4'));});});};exports[_0x834e('0x5')]=function(_0x289ef2){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x398bee,_0x4a2018){return pm2[_0x834e('0x5')](_0x289ef2,function(_0x52056d,_0x3e16d2){if(_0x52056d){return _0x4a2018(_0x52056d);}pm2[_0x834e('0x7')]();return _0x398bee(_0x3e16d2);});});});};exports[_0x834e('0x8')]=function(_0x2e69e2){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x23501c,_0x363786){return pm2[_0x834e('0x8')](_0x2e69e2,function(_0x3bdda9,_0x186b3b){if(_0x3bdda9){return _0x363786(_0x3bdda9);}pm2[_0x834e('0x7')]();return _0x23501c(_0x186b3b);});});});};exports[_0x834e('0x9')]=function(_0x14038b){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x293514,_0x1e00de){return pm2[_0x834e('0x9')](_0x14038b,function(_0x538bb3,_0x5e5b6d){if(_0x538bb3){return _0x1e00de(_0x538bb3);}pm2[_0x834e('0x7')]();return _0x293514(_0x5e5b6d);});});});};exports['list']=function(){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x2d95f2,_0x28e659){return pm2[_0x834e('0xa')](function(_0x50e860,_0x43156c){if(_0x50e860){return _0x28e659(_0x50e860);}pm2[_0x834e('0x7')]();return _0x2d95f2(_0x43156c);});});});};exports['describe']=function(_0x316205){return connect()['then'](function(){return new BPromise(function(_0x38a8cd,_0x36d443){return pm2['describe'](_0x316205,function(_0x43ac41,_0x22106e){if(_0x43ac41){return _0x36d443(_0x43ac41);}pm2[_0x834e('0x7')]();return _0x38a8cd(_0x22106e);});});});};exports['delete']=function(_0x283e56){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x34e41a,_0xb993a1){return pm2[_0x834e('0xb')](_0x283e56,function(_0x254677,_0x1dd214){if(_0x254677){return _0xb993a1(_0x254677);}pm2['disconnect']();return _0x34e41a(_0x1dd214);});});});};exports[_0x834e('0xc')]=function(){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x113ff4,_0x325a99){return pm2['dump'](function(_0x45a630){if(_0x45a630){return _0x325a99(_0x45a630);}return _0x113ff4(_0x834e('0xd'));});});});}; \ No newline at end of file +var _0x34e8=['stop','restart','list','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','then','disconnect'];(function(_0x16068b,_0x3c2737){var _0x55fa62=function(_0x15bdc5){while(--_0x15bdc5){_0x16068b['push'](_0x16068b['shift']());}};_0x55fa62(++_0x3c2737);}(_0x34e8,0x12c));var _0x834e=function(_0x198791,_0x5b6bea){_0x198791=_0x198791-0x0;var _0x212123=_0x34e8[_0x198791];return _0x212123;};'use strict';var pm2=require(_0x834e('0x0'));var BPromise=require(_0x834e('0x1'));var config=require(_0x834e('0x2'));function connect(){return new BPromise(function(_0x35e6fb,_0x530939){return pm2[_0x834e('0x3')](function(_0x21e2e0){if(_0x21e2e0){return _0x530939(_0x21e2e0);}return _0x35e6fb(_0x834e('0x4'));});});};exports[_0x834e('0x5')]=function(_0x289ef2){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x398bee,_0x4a2018){return pm2[_0x834e('0x5')](_0x289ef2,function(_0x52056d,_0x3e16d2){if(_0x52056d){return _0x4a2018(_0x52056d);}pm2[_0x834e('0x7')]();return _0x398bee(_0x3e16d2);});});});};exports[_0x834e('0x8')]=function(_0x2e69e2){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x23501c,_0x363786){return pm2[_0x834e('0x8')](_0x2e69e2,function(_0x3bdda9,_0x186b3b){if(_0x3bdda9){return _0x363786(_0x3bdda9);}pm2[_0x834e('0x7')]();return _0x23501c(_0x186b3b);});});});};exports[_0x834e('0x9')]=function(_0x14038b){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x293514,_0x1e00de){return pm2[_0x834e('0x9')](_0x14038b,function(_0x538bb3,_0x5e5b6d){if(_0x538bb3){return _0x1e00de(_0x538bb3);}pm2[_0x834e('0x7')]();return _0x293514(_0x5e5b6d);});});});};exports['list']=function(){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x2d95f2,_0x28e659){return pm2[_0x834e('0xa')](function(_0x50e860,_0x43156c){if(_0x50e860){return _0x28e659(_0x50e860);}pm2[_0x834e('0x7')]();return _0x2d95f2(_0x43156c);});});});};exports['describe']=function(_0x316205){return connect()['then'](function(){return new BPromise(function(_0x38a8cd,_0x36d443){return pm2['describe'](_0x316205,function(_0x43ac41,_0x22106e){if(_0x43ac41){return _0x36d443(_0x43ac41);}pm2[_0x834e('0x7')]();return _0x38a8cd(_0x22106e);});});});};exports['delete']=function(_0x283e56){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x34e41a,_0xb993a1){return pm2[_0x834e('0xb')](_0x283e56,function(_0x254677,_0x1dd214){if(_0x254677){return _0xb993a1(_0x254677);}pm2['disconnect']();return _0x34e41a(_0x1dd214);});});});};exports[_0x834e('0xc')]=function(){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x113ff4,_0x325a99){return pm2['dump'](function(_0x45a630){if(_0x45a630){return _0x325a99(_0x45a630);}return _0x113ff4(_0x834e('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 725c89e..b2a4c95 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 _0x15b7=['../../config/environment','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','system','timeout','YYYY-MM-DD\x20HH:mm:ss','map','emit','catch','start','ioredis'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x15b7,0x13a));var _0x715b=function(_0x46023d,_0x2b8aff){_0x46023d=_0x46023d-0x0;var _0x1c1923=_0x15b7[_0x46023d];return _0x1c1923;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x715b('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x715b('0x1'));config[_0x715b('0x2')]=_[_0x715b('0x3')](config['redis'],{'host':_0x715b('0x4'),'port':0x18eb});var io=require(_0x715b('0x5'))(new Redis(config[_0x715b('0x2')]));function closeInteractions(){var _0x5ddad0=0x0;var _0x4fefd8=[];return db[_0x715b('0x6')][_0x715b('0x7')]({'raw':!![],'attributes':['id',_0x715b('0x8')],'where':{'id':0x1}})[_0x715b('0x9')](function(_0x59fc8d){_0x5ddad0=_0x59fc8d['chatTimeout'];if(_0x5ddad0){return db[_0x715b('0xa')]['findAll']({'raw':!![],'attributes':['id',_0x715b('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x715b('0xc')](_0x59fc8d['chatTimeout'],_0x715b('0xd'))}}});}else{return[];}})[_0x715b('0x9')](function(_0x1d333c){_0x4fefd8=_0x1d333c;if(_0x5ddad0){return db[_0x715b('0xa')]['update']({'closeReason':_0x715b('0xe'),'disposition':_0x715b('0xf'),'closed':!![],'closedAt':moment()['format'](_0x715b('0x10'))},{'where':{'id':_[_0x715b('0x11')](_0x4fefd8||[],'id')}});}})[_0x715b('0x9')](function(_0x429c05){for(var _0x304c40=0x0;_0x304c40<_0x4fefd8['length'];_0x304c40++){io[_0x715b('0x12')]('chatInteraction:update',{'id':_0x4fefd8[_0x304c40]['id'],'closed':!![]});}})[_0x715b('0x13')](function(_0x1b1267){console['error'](_0x1b1267);});}exports[_0x715b('0x14')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xee6e=['../../config/environment','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','minutes','ChatInteraction','timeout','format','length','emit','chatInteraction:update','catch','error','start','lodash','ioredis','../../mysqldb'];(function(_0x5a6f41,_0x3f0149){var _0x59b058=function(_0x55b8e9){while(--_0x55b8e9){_0x5a6f41['push'](_0x5a6f41['shift']());}};_0x59b058(++_0x3f0149);}(_0xee6e,0x128));var _0xeee6=function(_0x40fdfb,_0x2f6546){_0x40fdfb=_0x40fdfb-0x0;var _0x429630=_0xee6e[_0x40fdfb];return _0x429630;};'use strict';var _=require(_0xeee6('0x0'));var moment=require('moment');var Redis=require(_0xeee6('0x1'));var db=require(_0xeee6('0x2'))['db'];var config=require(_0xeee6('0x3'));config[_0xeee6('0x4')]=_['defaults'](config[_0xeee6('0x4')],{'host':_0xeee6('0x5'),'port':0x18eb});var io=require(_0xeee6('0x6'))(new Redis(config[_0xeee6('0x4')]));function closeInteractions(){var _0x23ec13=0x0;var _0x484868=[];return db[_0xeee6('0x7')][_0xeee6('0x8')]({'raw':!![],'attributes':['id',_0xeee6('0x9')],'where':{'id':0x1}})[_0xeee6('0xa')](function(_0x2a8227){_0x23ec13=_0x2a8227[_0xeee6('0x9')];if(_0x23ec13){return db['ChatInteraction'][_0xeee6('0xb')]({'raw':!![],'attributes':['id',_0xeee6('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x2a8227[_0xeee6('0x9')],_0xeee6('0xd'))}}});}else{return[];}})[_0xeee6('0xa')](function(_0x62d53e){_0x484868=_0x62d53e;if(_0x23ec13){return db[_0xeee6('0xe')]['update']({'closeReason':'system','disposition':_0xeee6('0xf'),'closed':!![],'closedAt':moment()[_0xeee6('0x10')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_['map'](_0x484868||[],'id')}});}})[_0xeee6('0xa')](function(_0x3fb096){for(var _0x5f4ecc=0x0;_0x5f4ecc<_0x484868[_0xeee6('0x11')];_0x5f4ecc++){io[_0xeee6('0x12')](_0xeee6('0x13'),{'id':_0x484868[_0x5f4ecc]['id'],'closed':!![]});}})[_0xeee6('0x14')](function(_0x2a45b7){console[_0xeee6('0x15')](_0x2a45b7);});}exports[_0xeee6('0x16')]=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 1a38cef..a418e20 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 _0xa330=['lodash','cron-job-manager','jayson/promise','bluebird','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','Smtp','host','port','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','basename','savename','zip','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','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','MailServerOut','map','intersection','difference','length','toString','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','active','update','update\x20cron','run','path'];(function(_0x462a3c,_0x178d22){var _0x394246=function(_0x5d0374){while(--_0x5d0374){_0x462a3c['push'](_0x462a3c['shift']());}};_0x394246(++_0x178d22);}(_0xa330,0x10d));var _0x0a33=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xa330[_0x11005e];return _0x29338f;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x0a33('0x0'));var _=require(_0x0a33('0x1'));var moment=require('moment');var CronJobManager=require(_0x0a33('0x2'));var jayson=require(_0x0a33('0x3'));var BPromise=require(_0x0a33('0x4'));var logger=require('../logger')(_0x0a33('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x0a33('0x6'));var analyticDefaultReportController=require(_0x0a33('0x7'));var client=jayson[_0x0a33('0x8')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x316b84,_0x33a20b){return function(){logger['info'](_0x0a33('0x9'),_0x316b84[_0x0a33('0xa')]);var _0x90c55b=!![];var _0x166082={'tls':{'rejectUnauthorized':![]}};if(_0x316b84[_0x0a33('0xb')]['Smtp'][_0x0a33('0xc')]){_0x166082[_0x0a33('0xc')]=_0x316b84['MailAccount'][_0x0a33('0xd')]['service'];}else{_0x166082['host']=_0x316b84[_0x0a33('0xb')][_0x0a33('0xd')][_0x0a33('0xe')];_0x166082[_0x0a33('0xf')]=_0x316b84[_0x0a33('0xb')][_0x0a33('0xd')][_0x0a33('0xf')];_0x166082['secure']=_0x316b84[_0x0a33('0xb')][_0x0a33('0xd')]['secure'];}if(_0x316b84['MailAccount'][_0x0a33('0xd')][_0x0a33('0x10')]){_0x166082[_0x0a33('0x11')]={'user':_0x316b84[_0x0a33('0xb')]['Smtp'][_0x0a33('0x12')],'pass':_0x316b84['MailAccount']['Smtp'][_0x0a33('0x13')]};}var _0x4aafd4={'account':_0x166082,'message':{'from':util[_0x0a33('0x14')](_0x0a33('0x15'),_0x316b84[_0x0a33('0xb')]['name'],_0x316b84[_0x0a33('0xb')][_0x0a33('0xa')]||_0x316b84[_0x0a33('0xb')][_0x0a33('0xd')]['user']),'to':_0x316b84['email'],'cc':_0x316b84['cc'],'bcc':_0x316b84[_0x0a33('0x16')],'subject':util[_0x0a33('0x14')](_0x0a33('0x17'),_0x33a20b[_0x0a33('0x18')],_0x316b84[_0x0a33('0x19')],_0x316b84[_0x0a33('0x1a')])}};var _0x4af830=path[_0x0a33('0x1b')](__dirname,_0x0a33('0x1c'));var _0x3eb7fd=_0x33a20b['savename'];var _0x545e21=util[_0x0a33('0x14')]('%s.%s',path[_0x0a33('0x1d')](_0x33a20b['savename'],path['extname'](_0x33a20b[_0x0a33('0x1e')])),_0x0a33('0x1f'));var _0x3f9749=path[_0x0a33('0x1b')](_0x4af830,_0x3eb7fd);var _0x3c1e46=path[_0x0a33('0x1b')](_0x4af830,_0x545e21);if(fs['existsSync'](_0x3f9749)){_0x33a20b[_0x0a33('0x20')]=_0x0a33('0x21');_0x4aafd4[_0x0a33('0x22')][_0x0a33('0x23')]=[{'filename':_0x3eb7fd,'path':_0x3f9749}];_0x4aafd4[_0x0a33('0x22')][_0x0a33('0x24')]=util[_0x0a33('0x14')](_0x0a33('0x25'),JSON[_0x0a33('0x26')](_0x33a20b,null,0x2));}else if(fs[_0x0a33('0x27')](_0x3c1e46)){_0x33a20b['status']='Sent';_0x4aafd4['message'][_0x0a33('0x23')]=[{'filename':_0x545e21,'path':_0x3c1e46}];}else{_0x4aafd4[_0x0a33('0x22')]['text']=_0x0a33('0x28');if(!_0x316b84[_0x0a33('0x29')]){_0x90c55b=![];logger[_0x0a33('0x2a')](_0x0a33('0x2b'));}}if(_0x90c55b){return client[_0x0a33('0x2c')](_0x0a33('0x2d'),_0x4aafd4)[_0x0a33('0x2e')](function(_0x229adc){if(_0x229adc[_0x0a33('0x2f')]){return logger[_0x0a33('0x2f')](_0x0a33('0x30'),JSON['stringify'](_0x229adc));}return logger[_0x0a33('0x2a')](_0x0a33('0x31'));})[_0x0a33('0x32')](function(_0xd7d56){return logger['error']('error\x20mail',JSON[_0x0a33('0x26')](_0xd7d56));});}};}function handleError(){return function(_0x29d50e){return logger['error'](JSON['stringify'](_0x29d50e));};}function handleResult(_0x18289b){return function(_0xb1cf8d){logger[_0x0a33('0x2a')](_0x0a33('0x33'),JSON[_0x0a33('0x26')](_0xb1cf8d));if(_0x18289b[_0x0a33('0xb')]&&_0x18289b['MailAccount'][_0x0a33('0xd')]&&!_[_0x0a33('0x34')](_0x18289b[_0x0a33('0xa')])){setTimeout(handleSendEmail(_0x18289b,_0xb1cf8d),0x3c*0x3e8);}};}function handleJob(_0x236a0d){return function(){try{if(_[_0x0a33('0x34')](_0x236a0d[_0x0a33('0x19')])){return logger[_0x0a33('0x2a')](_0x0a33('0x35'));}if(_[_0x0a33('0x34')](_0x236a0d[_0x0a33('0x1a')])){return logger[_0x0a33('0x2a')](_0x0a33('0x36'));}var _0xb1940e={'startDate':moment()['subtract'](_0x236a0d[_0x0a33('0x19')],_0x236a0d[_0x0a33('0x1a')])['format'](_0x0a33('0x37')),'endDate':moment()[_0x0a33('0x14')](_0x0a33('0x37')),'type':_0x0a33('0x38'),'output':_0x236a0d[_0x0a33('0x39')],'name':_0x236a0d[_0x0a33('0x18')]};if(!_[_0x0a33('0x34')](_0x236a0d[_0x0a33('0x3a')])){logger[_0x0a33('0x2a')](_0x0a33('0x3b'),_0x236a0d[_0x0a33('0x3a')]);return analyticDefaultReportController[_0x0a33('0x3c')]({'id':_0x236a0d[_0x0a33('0x3a')]},_0xb1940e)[_0x0a33('0x2e')](handleResult(_0x236a0d))[_0x0a33('0x32')](handleError());}if(!_[_0x0a33('0x34')](_0x236a0d[_0x0a33('0x3d')])){logger[_0x0a33('0x2a')]('exec\x20custom\x20report\x20id:%s',_0x236a0d[_0x0a33('0x3d')]);return analyticCustomReportController[_0x0a33('0x3c')]({'id':_0x236a0d['CustomReportId']},_0xb1940e)[_0x0a33('0x2e')](handleResult(_0x236a0d))[_0x0a33('0x32')](handleError());}}catch(_0xd90a33){logger['error'](JSON[_0x0a33('0x26')](_0xd90a33));}return logger['info'](_0x0a33('0x3e'));};}function getJobs(_0x16c55b){var _0x5a5a4f={};if(_0x16c55b){_0x5a5a4f['id']=_0x16c55b;}return db[_0x0a33('0x3f')]['findAll']({'where':_0x5a5a4f,'include':[{'model':db[_0x0a33('0xb')],'attributes':['id',_0x0a33('0x18'),_0x0a33('0xa')],'include':[{'model':db[_0x0a33('0x40')],'as':_0x0a33('0xd')}]}]})[_0x0a33('0x2e')](function(_0xea210d){var _0x4085f6=_['keys'](manager['jobs']);var _0x146bcf=_[_0x0a33('0x41')](_0xea210d,function(_0x25f332){return _0x25f332['id']['toString']();});var _0x5b24a0=_['keyBy'](_0xea210d,function(_0x37ec49){return _0x37ec49['id']['toString']();});var _0x50a8e4=_0x16c55b?_0x146bcf:_['difference'](_0x146bcf,_0x4085f6);var _0xdec5c8=_[_0x0a33('0x42')](_0x146bcf,_0x4085f6);var _0x54a3a9=_[_0x0a33('0x43')](_0x4085f6,_0x146bcf);var _0x45924f;var _0x1ced4e;for(_0x45924f=0x0;_0x45924f<_0x54a3a9[_0x0a33('0x44')]&&!_0x16c55b;_0x45924f+=0x1){_0x1ced4e=_0x54a3a9[_0x45924f][_0x0a33('0x45')]();if(manager[_0x0a33('0x46')](_0x1ced4e)){manager[_0x0a33('0x47')](_0x1ced4e);manager[_0x0a33('0x48')](_0x1ced4e);logger['info'](_0x0a33('0x49'),_0x1ced4e);}}logger[_0x0a33('0x2a')](_0x0a33('0x4a'),JSON['stringify'](_0x50a8e4));for(_0x45924f=0x0;_0x45924f<_0x50a8e4[_0x0a33('0x44')];_0x45924f+=0x1){_0x1ced4e=_0x50a8e4[_0x45924f]['toString']();logger[_0x0a33('0x2a')]('index',_0x1ced4e);if(_0x16c55b){logger['info'](_0x0a33('0x4b'),_0x16c55b);logger[_0x0a33('0x2a')](JSON[_0x0a33('0x26')](_0x5b24a0[_0x1ced4e]));BPromise[_0x0a33('0x4c')]()[_0x0a33('0x2e')](handleJob(_0x5b24a0[_0x1ced4e]));logger['info'](_0x0a33('0x4d'),_0x5b24a0[_0x1ced4e][_0x0a33('0x18')],_0x5b24a0[_0x1ced4e][_0x0a33('0x4e')]);}else if(_0x5b24a0[_0x1ced4e]['cron']&&_0x5b24a0[_0x1ced4e]['active']&&moment()[_0x0a33('0x4f')](_0x5b24a0[_0x1ced4e][_0x0a33('0x50')],_0x5b24a0[_0x1ced4e][_0x0a33('0x51')])){manager[_0x0a33('0x52')](_0x1ced4e,_0x5b24a0[_0x1ced4e][_0x0a33('0x4e')],handleJob(_0x5b24a0[_0x1ced4e]));manager[_0x0a33('0x53')](_0x1ced4e);logger[_0x0a33('0x2a')](_0x0a33('0x54'),_0x5b24a0[_0x1ced4e][_0x0a33('0x18')],_0x5b24a0[_0x1ced4e]['cron']);}else if(manager[_0x0a33('0x46')](_0x1ced4e)){manager[_0x0a33('0x47')](_0x1ced4e);manager[_0x0a33('0x48')](_0x1ced4e);logger[_0x0a33('0x2a')](_0x0a33('0x55'),_0x5b24a0[_0x1ced4e][_0x0a33('0x18')],_0x5b24a0[_0x1ced4e]['cron']);}}for(_0x45924f=0x0,_0x1ced4e;_0x45924f<_0xdec5c8[_0x0a33('0x44')]&&!_0x16c55b;_0x45924f+=0x1){_0x1ced4e=_0xdec5c8[_0x45924f][_0x0a33('0x45')]();if(manager[_0x0a33('0x46')](_0x1ced4e)){if(_0x5b24a0[_0x1ced4e][_0x0a33('0x4e')]&&_0x5b24a0[_0x1ced4e][_0x0a33('0x56')]&&moment()[_0x0a33('0x4f')](_0x5b24a0[_0x1ced4e][_0x0a33('0x50')],_0x5b24a0[_0x1ced4e][_0x0a33('0x51')])){manager[_0x0a33('0x57')](_0x1ced4e,_0x5b24a0[_0x1ced4e][_0x0a33('0x4e')],handleJob(_0x5b24a0[_0x1ced4e]));logger[_0x0a33('0x2a')](_0x0a33('0x58'),_0x5b24a0[_0x1ced4e]['name'],_0x5b24a0[_0x1ced4e][_0x0a33('0x4e')]);}else{manager[_0x0a33('0x47')](_0x1ced4e);manager[_0x0a33('0x48')](_0x1ced4e);logger['info']('stop\x20cron',_0x5b24a0[_0x1ced4e]['name'],_0x5b24a0[_0x1ced4e][_0x0a33('0x4e')]);}}}})[_0x0a33('0x32')](function(_0x1f1263){logger['error'](JSON['stringify'](_0x1f1263));});}exports[_0x0a33('0x59')]=function(_0x353194){return getJobs(_0x353194);};exports[_0x0a33('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x1778=['deleteJob','delete\x20cron','length','my\x20id','resolve','run\x20job','cron','isBetween','startAt','add','active','endAt','update\x20cron','run','start','util','lodash','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','\x22%s\x22\x20<%s>','name','email','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','zip','join','existsSync','status','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','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\x20mail','email\x20sent','catch','error','stringify','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','exists','stop'];(function(_0x35387d,_0x1ba72f){var _0x3aba56=function(_0x42cd08){while(--_0x42cd08){_0x35387d['push'](_0x35387d['shift']());}};_0x3aba56(++_0x1ba72f);}(_0x1778,0xc7));var _0x8177=function(_0x1e6773,_0x138124){_0x1e6773=_0x1e6773-0x0;var _0x4c81a0=_0x1778[_0x1e6773];return _0x4c81a0;};'use strict';var fs=require('fs');var util=require(_0x8177('0x0'));var path=require('path');var _=require(_0x8177('0x1'));var moment=require('moment');var CronJobManager=require(_0x8177('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0x8177('0x3'));var logger=require(_0x8177('0x4'))(_0x8177('0x5'));var db=require(_0x8177('0x6'))['db'];var analyticCustomReportController=require(_0x8177('0x7'));var analyticDefaultReportController=require(_0x8177('0x8'));var client=jayson['client'][_0x8177('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x52d555,_0x301383){return function(){logger[_0x8177('0xa')](_0x8177('0xb'),_0x52d555['email']);var _0xfdef7c=!![];var _0x5a9ece={'tls':{'rejectUnauthorized':![]}};if(_0x52d555[_0x8177('0xc')][_0x8177('0xd')][_0x8177('0xe')]){_0x5a9ece[_0x8177('0xe')]=_0x52d555[_0x8177('0xc')][_0x8177('0xd')][_0x8177('0xe')];}else{_0x5a9ece[_0x8177('0xf')]=_0x52d555['MailAccount'][_0x8177('0xd')]['host'];_0x5a9ece[_0x8177('0x10')]=_0x52d555[_0x8177('0xc')][_0x8177('0xd')][_0x8177('0x10')];_0x5a9ece[_0x8177('0x11')]=_0x52d555[_0x8177('0xc')]['Smtp']['secure'];}if(_0x52d555['MailAccount'][_0x8177('0xd')][_0x8177('0x12')]){_0x5a9ece[_0x8177('0x13')]={'user':_0x52d555['MailAccount'][_0x8177('0xd')][_0x8177('0x14')],'pass':_0x52d555[_0x8177('0xc')]['Smtp'][_0x8177('0x15')]};}var _0x1743e3={'account':_0x5a9ece,'message':{'from':util['format'](_0x8177('0x16'),_0x52d555[_0x8177('0xc')][_0x8177('0x17')],_0x52d555[_0x8177('0xc')][_0x8177('0x18')]||_0x52d555['MailAccount'][_0x8177('0xd')][_0x8177('0x14')]),'to':_0x52d555[_0x8177('0x18')],'cc':_0x52d555['cc'],'bcc':_0x52d555['bcc'],'subject':util[_0x8177('0x19')](_0x8177('0x1a'),_0x301383[_0x8177('0x17')],_0x52d555[_0x8177('0x1b')],_0x52d555[_0x8177('0x1c')])}};var _0x56fc09=path['join'](__dirname,_0x8177('0x1d'));var _0x4ff7ac=_0x301383[_0x8177('0x1e')];var _0x44f273=util['format'](_0x8177('0x1f'),path[_0x8177('0x20')](_0x301383[_0x8177('0x1e')],path['extname'](_0x301383['savename'])),_0x8177('0x21'));var _0x3243c6=path['join'](_0x56fc09,_0x4ff7ac);var _0x113193=path[_0x8177('0x22')](_0x56fc09,_0x44f273);if(fs[_0x8177('0x23')](_0x3243c6)){_0x301383[_0x8177('0x24')]='Sent';_0x1743e3[_0x8177('0x25')][_0x8177('0x26')]=[{'filename':_0x4ff7ac,'path':_0x3243c6}];_0x1743e3[_0x8177('0x25')][_0x8177('0x27')]=util[_0x8177('0x19')](_0x8177('0x28'),JSON['stringify'](_0x301383,null,0x2));}else if(fs[_0x8177('0x23')](_0x113193)){_0x301383[_0x8177('0x24')]='Sent';_0x1743e3[_0x8177('0x25')][_0x8177('0x26')]=[{'filename':_0x44f273,'path':_0x113193}];}else{_0x1743e3['message']['text']=_0x8177('0x29');if(!_0x52d555[_0x8177('0x2a')]){_0xfdef7c=![];logger[_0x8177('0xa')](_0x8177('0x2b'));}}if(_0xfdef7c){return client[_0x8177('0x2c')](_0x8177('0x2d'),_0x1743e3)[_0x8177('0x2e')](function(_0x1f3586){if(_0x1f3586['error']){return logger['error'](_0x8177('0x2f'),JSON['stringify'](_0x1f3586));}return logger['info'](_0x8177('0x30'));})[_0x8177('0x31')](function(_0x1a1930){return logger[_0x8177('0x32')](_0x8177('0x2f'),JSON['stringify'](_0x1a1930));});}};}function handleError(){return function(_0xe2746){return logger[_0x8177('0x32')](JSON[_0x8177('0x33')](_0xe2746));};}function handleResult(_0x504f00){return function(_0x38f134){logger[_0x8177('0xa')](_0x8177('0x34'),JSON[_0x8177('0x33')](_0x38f134));if(_0x504f00[_0x8177('0xc')]&&_0x504f00[_0x8177('0xc')][_0x8177('0xd')]&&!_[_0x8177('0x35')](_0x504f00[_0x8177('0x18')])){setTimeout(handleSendEmail(_0x504f00,_0x38f134),0x3c*0x3e8);}};}function handleJob(_0x1fbf61){return function(){try{if(_[_0x8177('0x35')](_0x1fbf61['subtractNumber'])){return logger[_0x8177('0xa')](_0x8177('0x36'));}if(_[_0x8177('0x35')](_0x1fbf61[_0x8177('0x1c')])){return logger[_0x8177('0xa')](_0x8177('0x37'));}var _0xaca1bd={'startDate':moment()[_0x8177('0x38')](_0x1fbf61['subtractNumber'],_0x1fbf61[_0x8177('0x1c')])['format'](_0x8177('0x39')),'endDate':moment()[_0x8177('0x19')](_0x8177('0x39')),'type':'scheduled','output':_0x1fbf61[_0x8177('0x3a')],'name':_0x1fbf61[_0x8177('0x17')]};if(!_[_0x8177('0x35')](_0x1fbf61[_0x8177('0x3b')])){logger['info'](_0x8177('0x3c'),_0x1fbf61[_0x8177('0x3b')]);return analyticDefaultReportController[_0x8177('0x3d')]({'id':_0x1fbf61[_0x8177('0x3b')]},_0xaca1bd)[_0x8177('0x2e')](handleResult(_0x1fbf61))['catch'](handleError());}if(!_['isNil'](_0x1fbf61[_0x8177('0x3e')])){logger['info'](_0x8177('0x3f'),_0x1fbf61[_0x8177('0x3e')]);return analyticCustomReportController[_0x8177('0x3d')]({'id':_0x1fbf61[_0x8177('0x3e')]},_0xaca1bd)[_0x8177('0x2e')](handleResult(_0x1fbf61))[_0x8177('0x31')](handleError());}}catch(_0x4a6381){logger[_0x8177('0x32')](JSON[_0x8177('0x33')](_0x4a6381));}return logger[_0x8177('0xa')](_0x8177('0x40'));};}function getJobs(_0x497c12){var _0x509486={};if(_0x497c12){_0x509486['id']=_0x497c12;}return db[_0x8177('0x41')][_0x8177('0x42')]({'where':_0x509486,'include':[{'model':db[_0x8177('0xc')],'attributes':['id',_0x8177('0x17'),'email'],'include':[{'model':db[_0x8177('0x43')],'as':'Smtp'}]}]})[_0x8177('0x2e')](function(_0x2a1e43){var _0x99a5ad=_[_0x8177('0x44')](manager[_0x8177('0x45')]);var _0x5b2b85=_[_0x8177('0x46')](_0x2a1e43,function(_0x380dc4){return _0x380dc4['id'][_0x8177('0x47')]();});var _0x5e8589=_[_0x8177('0x48')](_0x2a1e43,function(_0x2ae1eb){return _0x2ae1eb['id']['toString']();});var _0x68c0cd=_0x497c12?_0x5b2b85:_[_0x8177('0x49')](_0x5b2b85,_0x99a5ad);var _0x34027e=_[_0x8177('0x4a')](_0x5b2b85,_0x99a5ad);var _0x41c90f=_[_0x8177('0x49')](_0x99a5ad,_0x5b2b85);var _0x258dd0;var _0x584cc9;for(_0x258dd0=0x0;_0x258dd0<_0x41c90f['length']&&!_0x497c12;_0x258dd0+=0x1){_0x584cc9=_0x41c90f[_0x258dd0][_0x8177('0x47')]();if(manager[_0x8177('0x4b')](_0x584cc9)){manager[_0x8177('0x4c')](_0x584cc9);manager[_0x8177('0x4d')](_0x584cc9);logger['info'](_0x8177('0x4e'),_0x584cc9);}}logger[_0x8177('0xa')]('toRun',JSON[_0x8177('0x33')](_0x68c0cd));for(_0x258dd0=0x0;_0x258dd0<_0x68c0cd[_0x8177('0x4f')];_0x258dd0+=0x1){_0x584cc9=_0x68c0cd[_0x258dd0][_0x8177('0x47')]();logger[_0x8177('0xa')]('index',_0x584cc9);if(_0x497c12){logger['info'](_0x8177('0x50'),_0x497c12);logger[_0x8177('0xa')](JSON[_0x8177('0x33')](_0x5e8589[_0x584cc9]));BPromise[_0x8177('0x51')]()[_0x8177('0x2e')](handleJob(_0x5e8589[_0x584cc9]));logger[_0x8177('0xa')](_0x8177('0x52'),_0x5e8589[_0x584cc9]['name'],_0x5e8589[_0x584cc9][_0x8177('0x53')]);}else if(_0x5e8589[_0x584cc9][_0x8177('0x53')]&&_0x5e8589[_0x584cc9]['active']&&moment()[_0x8177('0x54')](_0x5e8589[_0x584cc9][_0x8177('0x55')],_0x5e8589[_0x584cc9]['endAt'])){manager[_0x8177('0x56')](_0x584cc9,_0x5e8589[_0x584cc9][_0x8177('0x53')],handleJob(_0x5e8589[_0x584cc9]));manager['start'](_0x584cc9);logger[_0x8177('0xa')]('add\x20cron',_0x5e8589[_0x584cc9][_0x8177('0x17')],_0x5e8589[_0x584cc9]['cron']);}else if(manager[_0x8177('0x4b')](_0x584cc9)){manager[_0x8177('0x4c')](_0x584cc9);manager[_0x8177('0x4d')](_0x584cc9);logger[_0x8177('0xa')]('stop\x20cron',_0x5e8589[_0x584cc9]['name'],_0x5e8589[_0x584cc9][_0x8177('0x53')]);}}for(_0x258dd0=0x0,_0x584cc9;_0x258dd0<_0x34027e['length']&&!_0x497c12;_0x258dd0+=0x1){_0x584cc9=_0x34027e[_0x258dd0][_0x8177('0x47')]();if(manager[_0x8177('0x4b')](_0x584cc9)){if(_0x5e8589[_0x584cc9][_0x8177('0x53')]&&_0x5e8589[_0x584cc9][_0x8177('0x57')]&&moment()['isBetween'](_0x5e8589[_0x584cc9]['startAt'],_0x5e8589[_0x584cc9][_0x8177('0x58')])){manager['update'](_0x584cc9,_0x5e8589[_0x584cc9][_0x8177('0x53')],handleJob(_0x5e8589[_0x584cc9]));logger[_0x8177('0xa')](_0x8177('0x59'),_0x5e8589[_0x584cc9][_0x8177('0x17')],_0x5e8589[_0x584cc9][_0x8177('0x53')]);}else{manager['stop'](_0x584cc9);manager[_0x8177('0x4d')](_0x584cc9);logger['info']('stop\x20cron',_0x5e8589[_0x584cc9][_0x8177('0x17')],_0x5e8589[_0x584cc9][_0x8177('0x53')]);}}}})[_0x8177('0x31')](function(_0x25a362){logger[_0x8177('0x32')](JSON[_0x8177('0x33')](_0x25a362));});}exports[_0x8177('0x5a')]=function(_0xf452dd){return getJobs(_0xf452dd);};exports[_0x8177('0x5b')]=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 fb2f3d0..c3c442c 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3241=['now','@xcally.com','CmContact','destroy','then','bulkCreate','contacts1','CmHopper','log','finished\x20populating','hopper1','contacts2','hopper2','catch','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','push'];(function(_0x170f9d,_0xba5fad){var _0x44d5f5=function(_0x1a165f){while(--_0x1a165f){_0x170f9d['push'](_0x170f9d['shift']());}};_0x44d5f5(++_0xba5fad);}(_0x3241,0x112));var _0x1324=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3241[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x1324('0x0'));var db=require(_0x1324('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x1324('0x2')+i,'lastName':_0x1324('0x3')+i,'phone':0xf879fb460+i,'email':_0x1324('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x1324('0x5')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1324('0x6')](),'updatedAt':Date[_0x1324('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x1324('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1324('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x1324('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1324('0x6')](),'updatedAt':Date['now']()});}db[_0x1324('0x8')][_0x1324('0x9')]({'where':{}})[_0x1324('0xa')](function(){return db[_0x1324('0x8')][_0x1324('0xb')](contacts);})[_0x1324('0xa')](function(){console['log']('finished\x20populating',_0x1324('0xc'));return db[_0x1324('0xd')]['destroy']({'where':{}});})[_0x1324('0xa')](function(){return db[_0x1324('0xd')][_0x1324('0xb')](hopper);})[_0x1324('0xa')](function(){console[_0x1324('0xe')](_0x1324('0xf'),_0x1324('0x10'));return db[_0x1324('0x8')][_0x1324('0xb')](contacts2);})[_0x1324('0xa')](function(){console[_0x1324('0xe')](_0x1324('0xf'),_0x1324('0x11'));return db[_0x1324('0xd')][_0x1324('0xb')](hopper2);})[_0x1324('0xa')](function(){console[_0x1324('0xe')]('finished\x20populating',_0x1324('0x12'));})[_0x1324('0x13')](function(_0x32e73a){console[_0x1324('0xe')](_0x32e73a);}); \ No newline at end of file +var _0x0385=['bulkCreate','contacts2','finished\x20populating','hopper2','catch','util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','log','contacts1','CmHopper','hopper1'];(function(_0x379373,_0x225e73){var _0x12597d=function(_0x17601b){while(--_0x17601b){_0x379373['push'](_0x379373['shift']());}};_0x12597d(++_0x225e73);}(_0x0385,0x181));var _0x5038=function(_0x4887b7,_0x3f541b){_0x4887b7=_0x4887b7-0x0;var _0x5168dd=_0x0385[_0x4887b7];return _0x5168dd;};'use strict';var util=require(_0x5038('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5038('0x1')]({'id':i,'firstName':_0x5038('0x2')+i,'lastName':_0x5038('0x3')+i,'phone':0xf879fb460+i,'email':_0x5038('0x4')+i+_0x5038('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5038('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x5038('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5038('0x6')](),'updatedAt':Date[_0x5038('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x5038('0x3')+i,'phone':0xf879fb460+i,'email':_0x5038('0x4')+i+_0x5038('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5038('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x5038('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5038('0x6')](),'updatedAt':Date['now']()});}db[_0x5038('0x7')][_0x5038('0x8')]({'where':{}})[_0x5038('0x9')](function(){return db['CmContact']['bulkCreate'](contacts);})['then'](function(){console[_0x5038('0xa')]('finished\x20populating',_0x5038('0xb'));return db[_0x5038('0xc')][_0x5038('0x8')]({'where':{}});})[_0x5038('0x9')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x5038('0x9')](function(){console[_0x5038('0xa')]('finished\x20populating',_0x5038('0xd'));return db[_0x5038('0x7')][_0x5038('0xe')](contacts2);})[_0x5038('0x9')](function(){console[_0x5038('0xa')]('finished\x20populating',_0x5038('0xf'));return db[_0x5038('0xc')][_0x5038('0xe')](hopper2);})[_0x5038('0x9')](function(){console[_0x5038('0xa')](_0x5038('0x10'),_0x5038('0x11'));})[_0x5038('0x12')](function(_0x3113b9){console['log'](_0x3113b9);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index c41d9af..ec51721 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5bc8=['/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','%s%s','User','then','log','add\x20user','catch','push','format','agent','password','friend','udp','all','ulaw','yes'];(function(_0x5bb21a,_0x16355d){var _0x48f697=function(_0x5abe56){while(--_0x5abe56){_0x5bb21a['push'](_0x5bb21a['shift']());}};_0x48f697(++_0x16355d);}(_0x5bc8,0xbd));var _0x85bc=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0x5bc8[_0x393500];return _0x120d3b;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x85bc('0x0')]({'name':util[_0x85bc('0x1')]('%s%s',_0x85bc('0x2'),i),'fullname':util['format']('%s%s',_0x85bc('0x2'),i),'email':util[_0x85bc('0x1')]('%s%s@xcally.com',_0x85bc('0x2'),i),'role':_0x85bc('0x2'),'password':_0x85bc('0x3'),'internal':0xfa0+i,'type':_0x85bc('0x4'),'transport':[_0x85bc('0x5'),'ws','wss'],'disallow':[_0x85bc('0x6')],'allow':[_0x85bc('0x7')],'defaultuser':util['format']('%s%s',_0x85bc('0x2'),i),'encryption':_0x85bc('0x8'),'avpf':_0x85bc('0x8'),'force_avp':_0x85bc('0x8'),'icesupport':_0x85bc('0x8'),'dtlsenable':_0x85bc('0x8'),'dtlsverify':'no','dtlscertfile':_0x85bc('0x9'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x85bc('0xa'),'callerid':util[_0x85bc('0x1')](_0x85bc('0xb'),util[_0x85bc('0x1')](_0x85bc('0xc'),'agent',i),0xfa0+i)});}db[_0x85bc('0xd')]['bulkCreate'](users)[_0x85bc('0xe')](function(){console[_0x85bc('0xf')](_0x85bc('0x10'));})[_0x85bc('0x11')](function(_0x4379bd){console[_0x85bc('0xf')](_0x4379bd);}); \ No newline at end of file +var _0x8ff3=['password','friend','wss','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','add\x20user','catch','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x8ff3,0x1b1));var _0x38ff=function(_0x5d9a85,_0x55221e){_0x5d9a85=_0x5d9a85-0x0;var _0x1ef8aa=_0x8ff3[_0x5d9a85];return _0x1ef8aa;};'use strict';var util=require(_0x38ff('0x0'));var db=require(_0x38ff('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x38ff('0x2')]({'name':util[_0x38ff('0x3')](_0x38ff('0x4'),'agent',i),'fullname':util[_0x38ff('0x3')](_0x38ff('0x4'),_0x38ff('0x5'),i),'email':util['format'](_0x38ff('0x6'),'agent',i),'role':_0x38ff('0x5'),'password':_0x38ff('0x7'),'internal':0xfa0+i,'type':_0x38ff('0x8'),'transport':['udp','ws',_0x38ff('0x9')],'disallow':['all'],'allow':[_0x38ff('0xa')],'defaultuser':util[_0x38ff('0x3')](_0x38ff('0x4'),'agent',i),'encryption':'yes','avpf':_0x38ff('0xb'),'force_avp':_0x38ff('0xb'),'icesupport':_0x38ff('0xb'),'dtlsenable':_0x38ff('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x38ff('0xc'),'dtlssetup':_0x38ff('0xd'),'callerid':util[_0x38ff('0x3')](_0x38ff('0xe'),util[_0x38ff('0x3')]('%s%s',_0x38ff('0x5'),i),0xfa0+i)});}db[_0x38ff('0xf')][_0x38ff('0x10')](users)['then'](function(){console['log'](_0x38ff('0x11'));})[_0x38ff('0x12')](function(_0x42727e){console[_0x38ff('0x13')](_0x42727e);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 5c29695..6949168 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0470=['join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','role','agent','telephone','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','User','Campaign','where','ivr','%s:queue:%s','Agents','length','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','voice:inbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','SmsQueue','OpenchannelQueue','Trunk','user','voice:outbound','ChatQueue','Trunks','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','openchannel','telephone:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','emit','user_has_fax_interactions:remove','removeSmsInteractions','user_has_openchannel_interactions:remove','log'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x0470,0x6b));var _0x0047=function(_0x116103,_0x2a9f9e){_0x116103=_0x116103-0x0;var _0xa5ceed=_0x0470[_0x116103];return _0xa5ceed;};'use strict';var _=require(_0x0047('0x0'));var util=require(_0x0047('0x1'));var BPromise=require(_0x0047('0x2'));var db=require(_0x0047('0x3'))['db'];var config=require(_0x0047('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x0047('0x5'),_0x0047('0x6')],'raw':!![],'where':{'role':_0x0047('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x0047('0x5')],'where':{'role':_0x0047('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x0047('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x0047('0x5')],'where':{'role':_0x0047('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x0047('0x5'),_0x0047('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x360f48,_0x40faf0,_0x4a746a){return db[_0x0047('0xa')][_0x0047('0xb')]({'where':{'name':_0x360f48,'userProfileId':_0x40faf0},'raw':!![]})[_0x0047('0xc')](function(_0x272f59){if(_0x272f59){if(_0x272f59[_0x0047('0xd')]){switch(_0x360f48){case _0x0047('0xe'):case _0x0047('0xf'):case _0x0047('0x10'):case _0x0047('0x11'):case _0x0047('0x12'):case _0x0047('0x13'):return db[_0x4a746a][_0x0047('0x14')](queryQueues);case _0x0047('0x15'):return db[_0x4a746a][_0x0047('0x14')](queryTelephones);case'Trunks':return db[_0x4a746a][_0x0047('0x14')](queryTrunks);case _0x0047('0x16'):return db[_0x4a746a][_0x0047('0x14')](queryCampaigns);}}else{return db[_0x0047('0x17')][_0x0047('0x14')]({'attributes':[_0x0047('0x18')],'where':{'sectionId':_0x272f59['id']},'raw':!![]})[_0x0047('0xc')](function(_0x335fee){if(_0x335fee){var _0x4edaf2={'where':{'id':_[_0x0047('0x19')](_0x335fee,_0x0047('0x18'))},'raw':!![]};switch(_0x4a746a){case _0x0047('0x1a'):_0x4edaf2['where'][_0x0047('0x6')]=_0x0047('0x8');break;case _0x0047('0x1b'):_0x4edaf2[_0x0047('0x1c')]['type']=_0x0047('0x1d');break;}return db[_0x4a746a][_0x0047('0x14')](_0x4edaf2);}else{return[];}});}}else{return[];}})['then'](function(_0xe24403){return _0xe24403;});}function joinOrLeaveQueues(_0x3c7f83,_0x406c0e,_0x1dc8d4,_0x532631){_0x3c7f83[_0x406c0e](util['format'](_0x0047('0x1e'),_0x1dc8d4,_0x532631[_0x0047('0x5')]));if(_0x532631['Agents']){for(var _0x1ed0ec=0x0;_0x1ed0ec<_0x532631[_0x0047('0x1f')][_0x0047('0x20')];_0x1ed0ec+=0x1){_0x3c7f83[_0x406c0e](util[_0x0047('0x21')](_0x0047('0x22'),_0x532631['Agents'][_0x1ed0ec]['name']));}}}function joinOrLeave(_0x3d3473,_0x45af2b,_0x3f7fdd){var _0x56abaa;if(_0x3d3473[_0x0047('0x23')][_0x0047('0x24')]['id']){db['User'][_0x0047('0x25')]({'attributes':['id',_0x0047('0x5'),_0x0047('0x6'),_0x0047('0x26')],'where':{'id':_0x3d3473[_0x0047('0x23')][_0x0047('0x24')]['id']},'include':[{'model':db[_0x0047('0x27')],'as':_0x0047('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x0047('0x29')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x0047('0x2a')],'as':_0x0047('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x0047('0x2c')],'as':_0x0047('0x2d'),'attributes':['id'],'raw':!![]},{'model':db[_0x0047('0x2e')],'as':_0x0047('0x2f'),'attributes':['id'],'raw':!![]}]})[_0x0047('0xc')](function(_0x5a1651){if(_0x5a1651){_0x56abaa=_0x5a1651;_0x3d3473[_0x45af2b](util[_0x0047('0x21')](_0x0047('0x22'),_0x5a1651[_0x0047('0x5')]));var _0x4d50b6=[];switch(_0x5a1651[_0x0047('0x6')]){case'admin':_0x3d3473[_0x45af2b](_0x0047('0x30'));_0x3d3473[_0x45af2b]('voice:outbound');if(queryQueues[_0x0047('0x31')](_0x0047('0x32'))){delete queryQueues[_0x0047('0x32')];}_0x4d50b6[_0x0047('0x33')](db[_0x0047('0x34')][_0x0047('0x14')](queryQueues));_0x4d50b6[_0x0047('0x33')](db['ChatQueue']['findAll'](queryQueues));_0x4d50b6[_0x0047('0x33')](db[_0x0047('0x35')][_0x0047('0x14')](queryQueues));_0x4d50b6[_0x0047('0x33')](db[_0x0047('0x36')][_0x0047('0x14')](queryQueues));_0x4d50b6[_0x0047('0x33')](db['MailQueue']['findAll'](queryQueues));_0x4d50b6[_0x0047('0x33')](db[_0x0047('0x37')][_0x0047('0x14')](queryQueues));_0x4d50b6[_0x0047('0x33')](db[_0x0047('0x1a')][_0x0047('0x14')](queryTelephones));_0x4d50b6['push'](db[_0x0047('0x38')][_0x0047('0x14')](queryTrunks));_0x4d50b6[_0x0047('0x33')](db[_0x0047('0x1b')][_0x0047('0x14')](queryCampaigns));_0x4d50b6[_0x0047('0x33')](db[_0x0047('0x1a')][_0x0047('0x14')](queryAgents));break;case _0x0047('0x39'):_0x3d3473[_0x45af2b](_0x0047('0x30'));_0x3d3473[_0x45af2b](_0x0047('0x3a'));_0x4d50b6['push'](getAssociatedResources(_0x0047('0xe'),_0x5a1651['userProfileId'],_0x0047('0x34')));_0x4d50b6['push'](getAssociatedResources(_0x0047('0xf'),_0x5a1651['userProfileId'],_0x0047('0x3b')));_0x4d50b6[_0x0047('0x33')](getAssociatedResources('FaxQueues',_0x5a1651[_0x0047('0x26')],_0x0047('0x35')));_0x4d50b6[_0x0047('0x33')](getAssociatedResources('SmsQueues',_0x5a1651[_0x0047('0x26')],_0x0047('0x36')));_0x4d50b6[_0x0047('0x33')](getAssociatedResources(_0x0047('0x12'),_0x5a1651['userProfileId'],'MailQueue'));_0x4d50b6[_0x0047('0x33')](getAssociatedResources(_0x0047('0x13'),_0x5a1651[_0x0047('0x26')],'OpenchannelQueue'));_0x4d50b6['push'](getAssociatedResources('Telephones',_0x5a1651[_0x0047('0x26')],_0x0047('0x1a')));_0x4d50b6['push'](getAssociatedResources(_0x0047('0x3c'),_0x5a1651['userProfileId'],_0x0047('0x38')));_0x4d50b6[_0x0047('0x33')](getAssociatedResources(_0x0047('0x16'),_0x5a1651['userProfileId'],_0x0047('0x1b')));_0x4d50b6[_0x0047('0x33')](db[_0x0047('0x1a')][_0x0047('0x14')](queryAgents));break;case _0x0047('0x7'):_0x3d3473[_0x45af2b](_0x0047('0x30'));_0x3d3473[_0x45af2b]('voice:outbound');_0x4d50b6[_0x0047('0x33')](_0x5a1651[_0x0047('0x3d')]({'attributes':['id',_0x0047('0x5')]}));_0x4d50b6[_0x0047('0x33')](_0x5a1651[_0x0047('0x3e')]({'attributes':['id','name']}));_0x4d50b6[_0x0047('0x33')](_0x5a1651['getFaxQueues']({'attributes':['id','name']}));_0x4d50b6[_0x0047('0x33')](_0x5a1651[_0x0047('0x3f')]({'attributes':['id','name']}));_0x4d50b6['push'](_0x5a1651[_0x0047('0x40')]({'attributes':['id',_0x0047('0x5')]}));_0x4d50b6['push'](_0x5a1651[_0x0047('0x41')]({'attributes':['id','name']}));break;}return BPromise[_0x0047('0x42')](_0x4d50b6);}})[_0x0047('0xc')](function(_0xeb4fe0){if(_0xeb4fe0&&_0xeb4fe0[_0x0047('0x20')]){for(var _0xebaeba=0x0;_0xebaeba<_0xeb4fe0[_0x0047('0x20')];_0xebaeba+=0x1){for(var _0x569132=0x0;_0x569132<_0xeb4fe0[_0xebaeba]['length'];_0x569132+=0x1){switch(_0xebaeba){case 0x0:joinOrLeaveQueues(_0x3d3473,_0x45af2b,_0x0047('0x43'),_0xeb4fe0[_0xebaeba][_0x569132]);break;case 0x1:joinOrLeaveQueues(_0x3d3473,_0x45af2b,_0x0047('0x44'),_0xeb4fe0[_0xebaeba][_0x569132]);break;case 0x2:joinOrLeaveQueues(_0x3d3473,_0x45af2b,'fax',_0xeb4fe0[_0xebaeba][_0x569132]);break;case 0x3:joinOrLeaveQueues(_0x3d3473,_0x45af2b,'sms',_0xeb4fe0[_0xebaeba][_0x569132]);break;case 0x4:joinOrLeaveQueues(_0x3d3473,_0x45af2b,'mail',_0xeb4fe0[_0xebaeba][_0x569132]);break;case 0x5:joinOrLeaveQueues(_0x3d3473,_0x45af2b,_0x0047('0x45'),_0xeb4fe0[_0xebaeba][_0x569132]);break;case 0x6:_0x3d3473[_0x45af2b](util[_0x0047('0x21')](_0x0047('0x46'),_0xeb4fe0[_0xebaeba][_0x569132][_0x0047('0x5')]));break;case 0x7:_0x3d3473[_0x45af2b](util[_0x0047('0x21')]('trunk:%s',_0xeb4fe0[_0xebaeba][_0x569132][_0x0047('0x5')]));break;case 0x8:_0x3d3473[_0x45af2b](util['format']('campaign:%s:%s',_0xeb4fe0[_0xebaeba][_0x569132][_0x0047('0x9')],_0xeb4fe0[_0xebaeba][_0x569132][_0x0047('0x5')]));break;case 0x9:_0x3d3473[_0x45af2b](util[_0x0047('0x21')](_0x0047('0x22'),_0xeb4fe0[_0xebaeba][_0x569132]['name']));break;}}}}})[_0x0047('0xc')](function(){if(_0x45af2b===_0x0047('0x47')){var _0x59d51d=_[_0x0047('0x19')](_0x56abaa[_0x0047('0x28')],'id');return _0x56abaa[_0x0047('0x48')](_0x59d51d)[_0x0047('0xc')](function(){for(var _0x5459e9=0x0;_0x5459e9<_0x59d51d[_0x0047('0x20')];_0x5459e9+=0x1){_0x3f7fdd['emit'](_0x0047('0x49'),{'ChatInteractionId':Number(_0x59d51d[_0x5459e9]),'UserId':Number(_0x56abaa['id'])});}});}})['then'](function(){if(_0x45af2b===_0x0047('0x47')){var _0x2c9157=_[_0x0047('0x19')](_0x56abaa[_0x0047('0x4a')],'id');return _0x56abaa[_0x0047('0x4b')](_0x2c9157)['then'](function(){for(var _0x2507f6=0x0;_0x2507f6<_0x2c9157[_0x0047('0x20')];_0x2507f6+=0x1){_0x3f7fdd['emit'](_0x0047('0x4c'),{'MailInteractionId':Number(_0x2c9157[_0x2507f6]),'UserId':Number(_0x56abaa['id'])});}});}})[_0x0047('0xc')](function(){if(_0x45af2b===_0x0047('0x47')){var _0x33aa0e=_[_0x0047('0x19')](_0x56abaa[_0x0047('0x2b')],'id');return _0x56abaa[_0x0047('0x4d')](_0x33aa0e)[_0x0047('0xc')](function(){for(var _0x20eb15=0x0;_0x20eb15<_0x33aa0e[_0x0047('0x20')];_0x20eb15+=0x1){_0x3f7fdd[_0x0047('0x4e')](_0x0047('0x4f'),{'FaxInteractionId':Number(_0x33aa0e[_0x20eb15]),'UserId':Number(_0x56abaa['id'])});}});}})[_0x0047('0xc')](function(){if(_0x45af2b===_0x0047('0x47')){var _0x443fba=_[_0x0047('0x19')](_0x56abaa[_0x0047('0x2d')],'id');return _0x56abaa[_0x0047('0x50')](_0x443fba)[_0x0047('0xc')](function(){for(var _0xd719b1=0x0;_0xd719b1<_0x443fba[_0x0047('0x20')];_0xd719b1+=0x1){_0x3f7fdd[_0x0047('0x4e')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x443fba[_0xd719b1]),'UserId':Number(_0x56abaa['id'])});}});}})[_0x0047('0xc')](function(){if(_0x45af2b==='leave'){var _0x968d06=_['map'](_0x56abaa[_0x0047('0x2f')],'id');return _0x56abaa['removeOpenchannelInteractions'](_0x968d06)[_0x0047('0xc')](function(){for(var _0x177f60=0x0;_0x177f60<_0x968d06[_0x0047('0x20')];_0x177f60+=0x1){_0x3f7fdd[_0x0047('0x4e')](_0x0047('0x51'),{'OpenchannelInteractionId':Number(_0x968d06[_0x177f60]),'UserId':Number(_0x56abaa['id'])});}});}})['catch'](function(_0x22283d){_0x3d3473[_0x0047('0x52')](_0x22283d);});}}function onDisconnect(_0x3d9389,_0x2b0c46){joinOrLeave(_0x3d9389,_0x0047('0x47'),_0x2b0c46);}function onConnect(_0x24664c){joinOrLeave(_0x24664c,_0x0047('0x53'));}exports[_0x0047('0x54')]=function(_0x1f8d42){_0x1f8d42['on'](_0x0047('0x55'),function(_0x3017ae){_0x3017ae[_0x0047('0x56')](0x0);_0x3017ae[_0x0047('0x57')]=_0x3017ae[_0x0047('0x58')][_0x0047('0x55')][_0x0047('0x59')]+':'+_0x3017ae['request'][_0x0047('0x55')][_0x0047('0x5a')];_0x3017ae[_0x0047('0x5b')]=new Date();_0x3017ae[_0x0047('0x52')]=function(_0x6e6b04){console['log']('SocketIO\x20'+_0x3017ae[_0x0047('0x5c')][_0x0047('0x5')]+'['+_0x3017ae[_0x0047('0x57')]+']',_0x6e6b04);};_0x3017ae['on']('disconnect',function(){onDisconnect(_0x3017ae,_0x1f8d42);_0x3017ae['log'](_0x0047('0x5d'));});onConnect(_0x3017ae);_0x3017ae['log'](_0x0047('0x5e'));});}; \ No newline at end of file +var _0x661a=['agent','telephone','ivr','UserProfileSection','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','then','map','where','Campaign','type','format','%s:queue:%s','Agents','length','user:%s','query','find','userProfileId','handshake','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','Trunk','user','FaxQueues','FaxQueue','MailQueue','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms','openchannel','trunk:%s','leave','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','nsp','disconnect','bluebird','../mysqldb','./environment','name','User','role'];(function(_0x2e5370,_0x33cb32){var _0x5d21d1=function(_0x451c8e){while(--_0x451c8e){_0x2e5370['push'](_0x2e5370['shift']());}};_0x5d21d1(++_0x33cb32);}(_0x661a,0x10b));var _0xa661=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0x661a[_0x3a07c1];return _0x2bbe15;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0xa661('0x0'));var db=require(_0xa661('0x1'))['db'];var config=require(_0xa661('0x2'));var queryQueues={'attributes':['id',_0xa661('0x3')],'include':[{'as':'Agents','model':db[_0xa661('0x4')],'attributes':['id','name',_0xa661('0x5')],'raw':!![],'where':{'role':_0xa661('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xa661('0x3')],'where':{'role':_0xa661('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0xa661('0x3')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xa661('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xa661('0x3'),'type'],'where':{'type':_0xa661('0x8')}};function getAssociatedResources(_0xd6e4f2,_0x2f43cd,_0x1031bb){return db[_0xa661('0x9')]['findOne']({'where':{'name':_0xd6e4f2,'userProfileId':_0x2f43cd},'raw':!![]})['then'](function(_0x426b3c){if(_0x426b3c){if(_0x426b3c[_0xa661('0xa')]){switch(_0xd6e4f2){case _0xa661('0xb'):case _0xa661('0xc'):case'FaxQueues':case _0xa661('0xd'):case _0xa661('0xe'):case _0xa661('0xf'):return db[_0x1031bb][_0xa661('0x10')](queryQueues);case _0xa661('0x11'):return db[_0x1031bb][_0xa661('0x10')](queryTelephones);case _0xa661('0x12'):return db[_0x1031bb][_0xa661('0x10')](queryTrunks);case _0xa661('0x13'):return db[_0x1031bb][_0xa661('0x10')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0xa661('0x14')],'where':{'sectionId':_0x426b3c['id']},'raw':!![]})[_0xa661('0x15')](function(_0x395250){if(_0x395250){var _0x44c1c4={'where':{'id':_[_0xa661('0x16')](_0x395250,'resourceId')},'raw':!![]};switch(_0x1031bb){case _0xa661('0x4'):_0x44c1c4[_0xa661('0x17')][_0xa661('0x5')]=_0xa661('0x7');break;case _0xa661('0x18'):_0x44c1c4[_0xa661('0x17')][_0xa661('0x19')]=_0xa661('0x8');break;}return db[_0x1031bb][_0xa661('0x10')](_0x44c1c4);}else{return[];}});}}else{return[];}})[_0xa661('0x15')](function(_0x4f46ac){return _0x4f46ac;});}function joinOrLeaveQueues(_0x16c327,_0x1ff1b4,_0x2a0c43,_0x4b2870){_0x16c327[_0x1ff1b4](util[_0xa661('0x1a')](_0xa661('0x1b'),_0x2a0c43,_0x4b2870['name']));if(_0x4b2870[_0xa661('0x1c')]){for(var _0x3b9d89=0x0;_0x3b9d89<_0x4b2870[_0xa661('0x1c')][_0xa661('0x1d')];_0x3b9d89+=0x1){_0x16c327[_0x1ff1b4](util['format'](_0xa661('0x1e'),_0x4b2870[_0xa661('0x1c')][_0x3b9d89][_0xa661('0x3')]));}}}function joinOrLeave(_0x4796b9,_0x2d1b9a,_0xd804db){var _0x50be7f;if(_0x4796b9['handshake'][_0xa661('0x1f')]['id']){db[_0xa661('0x4')][_0xa661('0x20')]({'attributes':['id','name',_0xa661('0x5'),_0xa661('0x21')],'where':{'id':_0x4796b9[_0xa661('0x22')][_0xa661('0x1f')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xa661('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xa661('0x24')],'as':_0xa661('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xa661('0x26')],'as':_0xa661('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xa661('0x28')],'as':_0xa661('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xa661('0x2a')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0xa661('0x15')](function(_0x48cd8d){if(_0x48cd8d){_0x50be7f=_0x48cd8d;_0x4796b9[_0x2d1b9a](util[_0xa661('0x1a')](_0xa661('0x1e'),_0x48cd8d[_0xa661('0x3')]));var _0x1f842f=[];switch(_0x48cd8d['role']){case _0xa661('0x2b'):_0x4796b9[_0x2d1b9a](_0xa661('0x2c'));_0x4796b9[_0x2d1b9a](_0xa661('0x2d'));if(queryQueues['hasOwnProperty'](_0xa661('0x2e'))){delete queryQueues[_0xa661('0x2e')];}_0x1f842f[_0xa661('0x2f')](db[_0xa661('0x30')][_0xa661('0x10')](queryQueues));_0x1f842f[_0xa661('0x2f')](db[_0xa661('0x31')]['findAll'](queryQueues));_0x1f842f['push'](db['FaxQueue'][_0xa661('0x10')](queryQueues));_0x1f842f['push'](db[_0xa661('0x32')][_0xa661('0x10')](queryQueues));_0x1f842f['push'](db['MailQueue'][_0xa661('0x10')](queryQueues));_0x1f842f[_0xa661('0x2f')](db[_0xa661('0x33')][_0xa661('0x10')](queryQueues));_0x1f842f[_0xa661('0x2f')](db[_0xa661('0x4')][_0xa661('0x10')](queryTelephones));_0x1f842f['push'](db[_0xa661('0x34')][_0xa661('0x10')](queryTrunks));_0x1f842f['push'](db[_0xa661('0x18')][_0xa661('0x10')](queryCampaigns));_0x1f842f[_0xa661('0x2f')](db[_0xa661('0x4')][_0xa661('0x10')](queryAgents));break;case _0xa661('0x35'):_0x4796b9[_0x2d1b9a](_0xa661('0x2c'));_0x4796b9[_0x2d1b9a]('voice:outbound');_0x1f842f[_0xa661('0x2f')](getAssociatedResources(_0xa661('0xb'),_0x48cd8d[_0xa661('0x21')],'VoiceQueue'));_0x1f842f[_0xa661('0x2f')](getAssociatedResources('ChatQueues',_0x48cd8d[_0xa661('0x21')],_0xa661('0x31')));_0x1f842f[_0xa661('0x2f')](getAssociatedResources(_0xa661('0x36'),_0x48cd8d[_0xa661('0x21')],_0xa661('0x37')));_0x1f842f[_0xa661('0x2f')](getAssociatedResources(_0xa661('0xd'),_0x48cd8d[_0xa661('0x21')],'SmsQueue'));_0x1f842f[_0xa661('0x2f')](getAssociatedResources(_0xa661('0xe'),_0x48cd8d[_0xa661('0x21')],_0xa661('0x38')));_0x1f842f['push'](getAssociatedResources(_0xa661('0xf'),_0x48cd8d[_0xa661('0x21')],_0xa661('0x33')));_0x1f842f[_0xa661('0x2f')](getAssociatedResources('Telephones',_0x48cd8d['userProfileId'],_0xa661('0x4')));_0x1f842f[_0xa661('0x2f')](getAssociatedResources(_0xa661('0x12'),_0x48cd8d[_0xa661('0x21')],_0xa661('0x34')));_0x1f842f[_0xa661('0x2f')](getAssociatedResources(_0xa661('0x13'),_0x48cd8d[_0xa661('0x21')],_0xa661('0x18')));_0x1f842f[_0xa661('0x2f')](db[_0xa661('0x4')]['findAll'](queryAgents));break;case _0xa661('0x6'):_0x4796b9[_0x2d1b9a](_0xa661('0x2c'));_0x4796b9[_0x2d1b9a]('voice:outbound');_0x1f842f[_0xa661('0x2f')](_0x48cd8d['getVoiceQueues']({'attributes':['id',_0xa661('0x3')]}));_0x1f842f[_0xa661('0x2f')](_0x48cd8d[_0xa661('0x39')]({'attributes':['id',_0xa661('0x3')]}));_0x1f842f[_0xa661('0x2f')](_0x48cd8d[_0xa661('0x3a')]({'attributes':['id',_0xa661('0x3')]}));_0x1f842f[_0xa661('0x2f')](_0x48cd8d['getSmsQueues']({'attributes':['id',_0xa661('0x3')]}));_0x1f842f[_0xa661('0x2f')](_0x48cd8d[_0xa661('0x3b')]({'attributes':['id','name']}));_0x1f842f[_0xa661('0x2f')](_0x48cd8d[_0xa661('0x3c')]({'attributes':['id',_0xa661('0x3')]}));break;}return BPromise[_0xa661('0x3d')](_0x1f842f);}})[_0xa661('0x15')](function(_0x373034){if(_0x373034&&_0x373034[_0xa661('0x1d')]){for(var _0x1c051a=0x0;_0x1c051a<_0x373034['length'];_0x1c051a+=0x1){for(var _0x22ddbb=0x0;_0x22ddbb<_0x373034[_0x1c051a]['length'];_0x22ddbb+=0x1){switch(_0x1c051a){case 0x0:joinOrLeaveQueues(_0x4796b9,_0x2d1b9a,_0xa661('0x3e'),_0x373034[_0x1c051a][_0x22ddbb]);break;case 0x1:joinOrLeaveQueues(_0x4796b9,_0x2d1b9a,_0xa661('0x3f'),_0x373034[_0x1c051a][_0x22ddbb]);break;case 0x2:joinOrLeaveQueues(_0x4796b9,_0x2d1b9a,_0xa661('0x40'),_0x373034[_0x1c051a][_0x22ddbb]);break;case 0x3:joinOrLeaveQueues(_0x4796b9,_0x2d1b9a,_0xa661('0x41'),_0x373034[_0x1c051a][_0x22ddbb]);break;case 0x4:joinOrLeaveQueues(_0x4796b9,_0x2d1b9a,'mail',_0x373034[_0x1c051a][_0x22ddbb]);break;case 0x5:joinOrLeaveQueues(_0x4796b9,_0x2d1b9a,_0xa661('0x42'),_0x373034[_0x1c051a][_0x22ddbb]);break;case 0x6:_0x4796b9[_0x2d1b9a](util[_0xa661('0x1a')]('telephone:%s',_0x373034[_0x1c051a][_0x22ddbb]['name']));break;case 0x7:_0x4796b9[_0x2d1b9a](util['format'](_0xa661('0x43'),_0x373034[_0x1c051a][_0x22ddbb][_0xa661('0x3')]));break;case 0x8:_0x4796b9[_0x2d1b9a](util[_0xa661('0x1a')]('campaign:%s:%s',_0x373034[_0x1c051a][_0x22ddbb][_0xa661('0x19')],_0x373034[_0x1c051a][_0x22ddbb][_0xa661('0x3')]));break;case 0x9:_0x4796b9[_0x2d1b9a](util[_0xa661('0x1a')](_0xa661('0x1e'),_0x373034[_0x1c051a][_0x22ddbb][_0xa661('0x3')]));break;}}}}})[_0xa661('0x15')](function(){if(_0x2d1b9a===_0xa661('0x44')){var _0xb15ed2=_[_0xa661('0x16')](_0x50be7f[_0xa661('0x23')],'id');return _0x50be7f[_0xa661('0x45')](_0xb15ed2)[_0xa661('0x15')](function(){for(var _0x4da5de=0x0;_0x4da5de<_0xb15ed2[_0xa661('0x1d')];_0x4da5de+=0x1){_0xd804db[_0xa661('0x46')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0xb15ed2[_0x4da5de]),'UserId':Number(_0x50be7f['id'])});}});}})['then'](function(){if(_0x2d1b9a===_0xa661('0x44')){var _0x22ea75=_[_0xa661('0x16')](_0x50be7f[_0xa661('0x25')],'id');return _0x50be7f[_0xa661('0x47')](_0x22ea75)[_0xa661('0x15')](function(){for(var _0x1c3106=0x0;_0x1c3106<_0x22ea75[_0xa661('0x1d')];_0x1c3106+=0x1){_0xd804db['emit'](_0xa661('0x48'),{'MailInteractionId':Number(_0x22ea75[_0x1c3106]),'UserId':Number(_0x50be7f['id'])});}});}})[_0xa661('0x15')](function(){if(_0x2d1b9a==='leave'){var _0x1442a5=_['map'](_0x50be7f['FaxInteractions'],'id');return _0x50be7f[_0xa661('0x49')](_0x1442a5)[_0xa661('0x15')](function(){for(var _0xb574b7=0x0;_0xb574b7<_0x1442a5[_0xa661('0x1d')];_0xb574b7+=0x1){_0xd804db[_0xa661('0x46')](_0xa661('0x4a'),{'FaxInteractionId':Number(_0x1442a5[_0xb574b7]),'UserId':Number(_0x50be7f['id'])});}});}})[_0xa661('0x15')](function(){if(_0x2d1b9a===_0xa661('0x44')){var _0x1d8b66=_[_0xa661('0x16')](_0x50be7f['SmsInteractions'],'id');return _0x50be7f['removeSmsInteractions'](_0x1d8b66)[_0xa661('0x15')](function(){for(var _0x5781b3=0x0;_0x5781b3<_0x1d8b66['length'];_0x5781b3+=0x1){_0xd804db['emit'](_0xa661('0x4b'),{'SmsInteractionId':Number(_0x1d8b66[_0x5781b3]),'UserId':Number(_0x50be7f['id'])});}});}})[_0xa661('0x15')](function(){if(_0x2d1b9a===_0xa661('0x44')){var _0x8ec5e8=_['map'](_0x50be7f['OpenchannelInteractions'],'id');return _0x50be7f[_0xa661('0x4c')](_0x8ec5e8)[_0xa661('0x15')](function(){for(var _0x104191=0x0;_0x104191<_0x8ec5e8[_0xa661('0x1d')];_0x104191+=0x1){_0xd804db[_0xa661('0x46')](_0xa661('0x4d'),{'OpenchannelInteractionId':Number(_0x8ec5e8[_0x104191]),'UserId':Number(_0x50be7f['id'])});}});}})[_0xa661('0x4e')](function(_0x173905){_0x4796b9[_0xa661('0x4f')](_0x173905);});}}function onDisconnect(_0x475c2a,_0x20dd4e){joinOrLeave(_0x475c2a,_0xa661('0x44'),_0x20dd4e);}function onConnect(_0x3a926d){joinOrLeave(_0x3a926d,_0xa661('0x50'));}exports[_0xa661('0x51')]=function(_0x996cc){_0x996cc['on']('connection',function(_0x58e4e4){_0x58e4e4[_0xa661('0x52')](0x0);_0x58e4e4[_0xa661('0x53')]=_0x58e4e4[_0xa661('0x54')][_0xa661('0x55')][_0xa661('0x56')]+':'+_0x58e4e4[_0xa661('0x54')]['connection'][_0xa661('0x57')];_0x58e4e4[_0xa661('0x58')]=new Date();_0x58e4e4[_0xa661('0x4f')]=function(_0x8efda9){console[_0xa661('0x4f')]('SocketIO\x20'+_0x58e4e4[_0xa661('0x59')][_0xa661('0x3')]+'['+_0x58e4e4[_0xa661('0x53')]+']',_0x8efda9);};_0x58e4e4['on'](_0xa661('0x5a'),function(){onDisconnect(_0x58e4e4,_0x996cc);_0x58e4e4['log']('DISCONNECTED');});onConnect(_0x58e4e4);_0x58e4e4['log']('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 2a3afa9..e18f0b5 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 _0x554d=['closedinteraction','ChatMessage','afterCreate','SmsInteraction','newinteraction','Sms','newmessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','channel','event','UserId','User','find','format','SIP/%s','incomingmessage','outgoingmessage','get','opened','changed','closed','name','interface','default','length','hasOwnProperty','model','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','http','Chat','ChatInteraction','afterUpdate'];(function(_0x35451e,_0x43b932){var _0x330752=function(_0x304cfd){while(--_0x304cfd){_0x35451e['push'](_0x35451e['shift']());}};_0x330752(++_0x43b932);}(_0x554d,0x171));var _0xd554=function(_0x127afe,_0x49fa41){_0x127afe=_0x127afe-0x0;var _0x4334d1=_0x554d[_0x127afe];return _0x4334d1;};'use strict';var util=require(_0xd554('0x0'));var db=require(_0xd554('0x1'))['db'];var jayson=require(_0xd554('0x2'));var logger=require(_0xd554('0x3'))(_0xd554('0x4'));var client=jayson['client'][_0xd554('0x5')]({'port':0x232a});var triggers=[{'channel':_0xd554('0x6'),'model':'ChatInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xd554('0x6'),'model':_0xd554('0x7'),'event':_0xd554('0x8'),'condition':_0xd554('0x9'),'callback':afterUpdate},{'channel':_0xd554('0x6'),'model':_0xd554('0xa'),'event':_0xd554('0xb'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Sms','model':_0xd554('0xc'),'event':_0xd554('0xb'),'condition':_0xd554('0xd'),'callback':afterCreate},{'channel':_0xd554('0xe'),'model':'SmsInteraction','event':_0xd554('0x8'),'condition':_0xd554('0x9'),'callback':afterUpdate},{'channel':_0xd554('0xe'),'model':'SmsMessage','event':_0xd554('0xb'),'condition':_0xd554('0xf'),'callback':afterCreateMessage},{'channel':_0xd554('0x10'),'model':_0xd554('0x11'),'event':_0xd554('0xb'),'condition':_0xd554('0xd'),'callback':afterCreate},{'channel':_0xd554('0x10'),'model':_0xd554('0x11'),'event':_0xd554('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd554('0x10'),'model':'FaxMessage','event':_0xd554('0xb'),'condition':_0xd554('0xf'),'callback':afterCreateMessage},{'channel':_0xd554('0x12'),'model':_0xd554('0x13'),'event':_0xd554('0xb'),'condition':_0xd554('0xd'),'callback':afterCreate},{'channel':_0xd554('0x12'),'model':_0xd554('0x13'),'event':_0xd554('0x8'),'condition':_0xd554('0x9'),'callback':afterUpdate},{'channel':_0xd554('0x12'),'model':_0xd554('0x14'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xd554('0x15'),'model':_0xd554('0x16'),'event':_0xd554('0xb'),'condition':_0xd554('0xd'),'callback':afterCreate},{'channel':_0xd554('0x15'),'model':_0xd554('0x16'),'event':_0xd554('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd554('0x15'),'model':_0xd554('0x17'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x26cd31){return client[_0xd554('0x18')](_0xd554('0x19'),_0x26cd31)[_0xd554('0x1a')](function(_0xda912c){logger[_0xd554('0x1b')](_0xd554('0x1c'),_0xd554('0x19'),_0xda912c);if(_0xda912c[_0xd554('0x1d')]){if(_0xda912c[_0xd554('0x1d')][_0xd554('0x1e')]===0x1f4){logger['error'](_0xd554('0x1c'),_0xd554('0x19'),_0xda912c[_0xd554('0x1d')]);}}})[_0xd554('0x1f')](function(_0xc3bf1d){logger[_0xd554('0x1d')](_0xd554('0x1c'),_0xd554('0x19'),_0xc3bf1d);});}function afterCreateMessage(_0x221260,_0x5d5ae2){return function(_0xfc9630,_0x4651b5){_0xfc9630=_0xfc9630['get']({'plain':!![]});_0xfc9630[_0xd554('0x20')]=_0x221260;_0xfc9630[_0xd554('0x21')]=_0xfc9630['direction'];if(_0xfc9630[_0xd554('0x22')]){return db[_0xd554('0x23')][_0xd554('0x24')]({'where':{'id':_0xfc9630[_0xd554('0x22')]},'attributes':['id','name'],'raw':!![]})[_0xd554('0x1a')](function(_0xd75828){_0xfc9630['interface']=util[_0xd554('0x25')](_0xd554('0x26'),_0xd75828['name']);_0xfc9630['channel']=_0x221260;return request({'event':_0xd554('0x27'),'message':_0xfc9630});})[_0xd554('0x1f')](function(_0x3377d1){console[_0xd554('0x1d')](_0x3377d1);});}else{return request({'event':_0xd554('0x28'),'message':_0xfc9630});}};}function afterCreate(_0x513db1,_0x4779aa){return function(_0x5a7d5b,_0x324558){_0x5a7d5b=_0x5a7d5b[_0xd554('0x29')]({'plain':!![]});_0x5a7d5b[_0xd554('0x20')]=_0x513db1;_0x5a7d5b[_0xd554('0x21')]=_0xd554('0x2a');return request({'event':_0x4779aa,'message':_0x5a7d5b});};}function afterUpdate(_0x10687b,_0x5d2cc8){return function(_0x3e7bfd,_0x3becfc){if(_0x3e7bfd[_0xd554('0x2b')](_0xd554('0x2c'))&&_0x3e7bfd['closed']){_0x3e7bfd=_0x3e7bfd['get']({'plain':!![]});_0x3e7bfd[_0xd554('0x20')]=_0x10687b;_0x3e7bfd[_0xd554('0x21')]=_0xd554('0x2c');if(_0x3e7bfd[_0xd554('0x22')]){return db[_0xd554('0x23')][_0xd554('0x24')]({'where':{'id':_0x3e7bfd[_0xd554('0x22')]},'attributes':['id',_0xd554('0x2d')],'raw':!![]})[_0xd554('0x1a')](function(_0x3ab16e){_0x3e7bfd[_0xd554('0x2e')]=util['format']('SIP/%s',_0x3ab16e['name']);return request({'event':_0x5d2cc8,'message':_0x3e7bfd});})['catch'](function(_0x419b20){console['error'](_0x419b20);});}else{return request({'event':_0x5d2cc8,'message':_0x3e7bfd});}}};}exports[_0xd554('0x2f')]=function(){for(var _0x245039=0x0;_0x2450390x3){var _0x23bc7e=/\((.+)\)/;var _0x5b86b9=_0x49c1fe['rx']['match'](_0x23bc7e);if(_0x5b86b9){_0x2089f6=_0x5b86b9[0x1];}else{_0x2089f6=null;}}else{_0x2089f6=null;}_0x49c1fe['cb'](null,{'code':_0x2a28a0,'result':_0x3bd6fb,'extra':_0x2089f6});}});_0x558e0f['on'](_0x1ed6('0x16'),function(_0x1bc9a0){_0x3a4d18[_0x1ed6('0x9')](_0x1ed6('0x16'),new AGIError(_0x1ed6('0x17'),_0x1bc9a0[_0x1ed6('0x18')]));});_0x558e0f['on'](_0x1ed6('0x19'),function(){_0x3a4d18['emit'](_0x1ed6('0x19'),new AGIError(_0x1ed6('0x1a')));});_0x558e0f['on']('timeout',function(){_0x3a4d18[_0x1ed6('0x9')]('timeout',new AGIError(_0x1ed6('0x1b')));_0x558e0f[_0x1ed6('0x1c')]();});_0x558e0f['pipe'](_0x5b8743);this[_0x1ed6('0x1d')]=function(_0x3ed0ed,_0x13d290){var _0x3ed0ed=_0x3ed0ed||'',_0x13d290=typeof _0x13d290==_0x1ed6('0xe')?_0x13d290:new Function();_0x49c1fe={'tx':_0x3ed0ed,'rx':'','cb':_0x13d290};_0x558e0f['write'](_0x3ed0ed+'\x0a');},this['close']=function(){_0x558e0f['destroy']();};}util[_0x1ed6('0x1e')](AGIChannel,EventEmitter);AGIChannel[_0x1ed6('0x1f')][_0x1ed6('0x20')]=function(_0x57fb9a){return this[_0x1ed6('0x1d')][_0x1ed6('0x21')](this,_0x57fb9a);};AGIChannel[_0x1ed6('0x1f')]['answer']=function(){return this[_0x1ed6('0x20')](_0x1ed6('0x22'));};AGIChannel[_0x1ed6('0x1f')]['getData']=function(_0x2c0f2d,_0x3822cb,_0x3f712a){_0x2c0f2d=_0x2c0f2d===undefined?'beep':_0x2c0f2d;_0x3822cb=_0x3822cb===undefined?'5':_0x3822cb;_0x3f712a=_0x3f712a===undefined?'1':_0x3f712a;return this[_0x1ed6('0x20')](util[_0x1ed6('0x23')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x2c0f2d,_0x3822cb*0x3e8,_0x3f712a));};AGIChannel[_0x1ed6('0x1f')]['noop']=function(_0x50b791){_0x50b791=_0x50b791||_0x1ed6('0x24');return this[_0x1ed6('0x20')](util[_0x1ed6('0x23')](_0x1ed6('0x25'),_0x50b791));};AGIChannel[_0x1ed6('0x1f')]['exec']=function(_0x52f1e4,_0x863bc5){if(_[_0x1ed6('0x26')](_0x863bc5)){return this[_0x1ed6('0x20')](util['format'](_0x1ed6('0x27'),_0x52f1e4,_0x863bc5[_0x1ed6('0x28')](',')));}return this['sendRequest'](util[_0x1ed6('0x23')]('EXEC\x20%s\x20%s',_0x52f1e4,_0x863bc5));};AGIChannel[_0x1ed6('0x1f')][_0x1ed6('0x29')]=function(_0x36c958){return this[_0x1ed6('0x20')](util[_0x1ed6('0x23')](_0x1ed6('0x2a'),_0x36c958));};AGIChannel[_0x1ed6('0x1f')][_0x1ed6('0x2b')]=function(_0x2a81c7){return this[_0x1ed6('0x20')](util[_0x1ed6('0x23')](_0x1ed6('0x2c'),_0x2a81c7));};AGIChannel['prototype'][_0x1ed6('0x2d')]=function(_0x8f86e4){return this[_0x1ed6('0x20')](util['format']('SET\x20PRIORITY\x20%s',_0x8f86e4));};AGIChannel[_0x1ed6('0x1f')][_0x1ed6('0xb')]=function(){return this[_0x1ed6('0x20')](_0x1ed6('0x2e'));};AGIChannel['prototype'][_0x1ed6('0x2f')]=function(_0x2fe487,_0xa1ff7f){return this[_0x1ed6('0x20')](util[_0x1ed6('0x23')](_0x1ed6('0x30'),_0x2fe487,_0xa1ff7f?_0xa1ff7f[_0x1ed6('0x31')]()[_0x1ed6('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1ed6('0x1f')]['sayNumber']=function(_0x1fd698,_0x1e2382){return this[_0x1ed6('0x20')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x1fd698,_0x1e2382));};AGIChannel[_0x1ed6('0x1f')][_0x1ed6('0x32')]=function(_0x46cb0e,_0x4124f8){return this[_0x1ed6('0x20')](util[_0x1ed6('0x23')](_0x1ed6('0x33'),_0x46cb0e,_0x4124f8));};AGIChannel[_0x1ed6('0x1f')][_0x1ed6('0x34')]=function(_0x24164a,_0x58dbb4){return this[_0x1ed6('0x20')](util['format'](_0x1ed6('0x35'),_0x24164a,_0x58dbb4));};AGIChannel[_0x1ed6('0x1f')]['continueAt']=function(_0x356bea,_0xad577c,_0x1314b0){_0xad577c=_0xad577c||this['extension'];_0x1314b0=_0x1314b0||0x1;this[_0x1ed6('0x29')](_0x356bea);this[_0x1ed6('0x2b')](_0xad577c);this['setPriority'](_0x1314b0);return this[_0x1ed6('0x36')](util[_0x1ed6('0x23')](_0x1ed6('0x37'),_0x356bea,_0xad577c,_0x1314b0));};AGIChannel['prototype']['getVariable']=function(_0xd79a6c){return this[_0x1ed6('0x20')](util[_0x1ed6('0x23')](_0x1ed6('0x38'),_0xd79a6c));};AGIChannel['prototype'][_0x1ed6('0x39')]=function(_0x553ed1,_0x49a6f6,_0x299dc5,_0x9f0c9d,_0x245027,_0x4cc3e2){_0x49a6f6=_0x49a6f6||_0x1ed6('0x3a');_0x299dc5=_0x299dc5||'';_0x9f0c9d=_0x9f0c9d===undefined?-0x1:_0x9f0c9d==='-1'?-0x1:_0x9f0c9d*0x3e8;_0x245027=_0x245027===undefined?'':'s='+_0x245027;_0x4cc3e2=_0x4cc3e2?_0x1ed6('0x3b'):'';return this['sendRequest'](util[_0x1ed6('0x23')](_0x1ed6('0x3c'),_0x553ed1,_0x49a6f6,_0x299dc5,_0x9f0c9d,_0x4cc3e2,_0x245027));};AGIChannel[_0x1ed6('0x1f')][_0x1ed6('0x3d')]=function(_0x245c63,_0x42f474){_0x42f474=_0x42f474||'';return this['sendRequest'](util[_0x1ed6('0x23')](_0x1ed6('0x3e'),_0x245c63,_0x42f474));};AGIChannel[_0x1ed6('0x1f')][_0x1ed6('0x3f')]=function(_0xfc389){return this[_0x1ed6('0x40')]('AGI',_0xfc389);};AGIChannel[_0x1ed6('0x1f')][_0x1ed6('0x41')]=function(_0x444025){return this[_0x1ed6('0x40')](_0x1ed6('0x42'),_0x444025);};AGIChannel['prototype'][_0x1ed6('0x16')]=function(_0x7fe748,_0x1e43af){this[_0x1ed6('0x36')](util[_0x1ed6('0x23')](_0x1ed6('0x43'),_0x7fe748['id'],_0x7fe748[_0x1ed6('0x44')],_0x1e43af));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1ed6('0x45')]=AGIChannel; \ No newline at end of file +var _0x91f2=['function','prototype','sync','answer','sendRequest','ANSWER','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','isArray','join','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','GOTO\x20%s\x20%s\x20%s','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','headers','emit','line','toLowerCase','hangup','substring','520-Invalid','search','replace','result=','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command'];(function(_0x23840e,_0x2fb0cb){var _0x277300=function(_0x246e5a){while(--_0x246e5a){_0x23840e['push'](_0x23840e['shift']());}};_0x277300(++_0x2fb0cb);}(_0x91f2,0x73));var _0x291f=function(_0x31ae70,_0x50ab0f){_0x31ae70=_0x31ae70-0x0;var _0x5760dc=_0x91f2[_0x31ae70];return _0x5760dc;};'use strict';var util=require(_0x291f('0x0'));var _=require(_0x291f('0x1'));var EventEmitter=require(_0x291f('0x2'))['EventEmitter'];var AGIReply=require(_0x291f('0x3'));var AGIError=require(_0x291f('0x4'));function AGIChannel(_0x44ba97){var _0x299b0e=this,_0x47eb15=new AGIReply(),_0x3a06fa=![],_0x27fd6e={};EventEmitter[_0x291f('0x5')](_0x299b0e);_0x44ba97[_0x291f('0x6')](_0x291f('0x7'));_0x44ba97['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x47eb15[_0x291f('0x6')](_0x291f('0x7'));_0x47eb15['on'](_0x291f('0x8'),function(_0x2211a3){for(var _0x4f9896 in _0x2211a3){_0x299b0e[_0x4f9896]=_0x2211a3[_0x4f9896];}_0x299b0e[_0x291f('0x9')]('ready');});_0x47eb15['on'](_0x291f('0xa'),function(_0x254df2){if(_0x254df2[_0x291f('0xb')]()==_0x291f('0xc')){_0x299b0e[_0x291f('0x9')]('hangup');return;}if(_0x254df2[_0x291f('0xd')](0x0,0xb)==_0x291f('0xe')){_0x3a06fa=!![];}if(_0x3a06fa){_0x27fd6e['rx']+=_0x254df2+'\x0a';if(_0x254df2[_0x291f('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x3a06fa=![];}}else{_0x27fd6e['rx']=_0x254df2;}if(_0x3a06fa){return;}if(typeof _0x27fd6e['cb']=='function'){var _0x2f7438=_0x27fd6e['rx'][_0x291f('0xd')](0x0,0x3),_0x166d29=null,_0x2f0564=null;_0x2f7438=parseInt(_0x2f7438);if(isNaN(_0x2f7438)){_0x27fd6e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2f7438!=0xc8){_0x27fd6e['cb'](null,{'code':_0x2f7438,'result':-0x1,'extra':'KO'});return;}_0x166d29=_0x27fd6e['rx']['substring'](0x4)[_0x291f('0x10')](_0x291f('0x11'),'');if(_0x166d29['indexOf']('\x20')!=-0x1){_0x166d29=_0x166d29['substr'](0x0,_0x166d29['indexOf']('\x20'));}if(_[_0x291f('0x12')](_0x166d29,'-1')){_0x166d29=parseInt(_0x166d29);}_0x2f0564=_0x27fd6e['rx']['split']('\x20');if(_0x2f0564[_0x291f('0x13')]==0x3){_0x2f0564=_0x2f0564[0x2][_0x291f('0xd')](0x1,_0x2f0564[0x2][_0x291f('0x13')]-0x1);}else if(_0x2f0564[_0x291f('0x13')]>0x3){var _0x2785bf=/\((.+)\)/;var _0x167356=_0x27fd6e['rx'][_0x291f('0x14')](_0x2785bf);if(_0x167356){_0x2f0564=_0x167356[0x1];}else{_0x2f0564=null;}}else{_0x2f0564=null;}_0x27fd6e['cb'](null,{'code':_0x2f7438,'result':_0x166d29,'extra':_0x2f0564});}});_0x44ba97['on']('error',function(_0x51dfcf){_0x299b0e[_0x291f('0x9')](_0x291f('0x15'),new AGIError(_0x291f('0x16'),_0x51dfcf[_0x291f('0x17')]));});_0x44ba97['on']('close',function(){_0x299b0e[_0x291f('0x9')](_0x291f('0x18'),new AGIError(_0x291f('0x19')));});_0x44ba97['on'](_0x291f('0x1a'),function(){_0x299b0e[_0x291f('0x9')](_0x291f('0x1a'),new AGIError(_0x291f('0x1b')));_0x44ba97[_0x291f('0x1c')]();});_0x44ba97[_0x291f('0x1d')](_0x47eb15);this[_0x291f('0x1e')]=function(_0x407c34,_0x4a5fea){var _0x407c34=_0x407c34||'',_0x4a5fea=typeof _0x4a5fea==_0x291f('0x1f')?_0x4a5fea:new Function();_0x27fd6e={'tx':_0x407c34,'rx':'','cb':_0x4a5fea};_0x44ba97['write'](_0x407c34+'\x0a');},this['close']=function(){_0x44ba97[_0x291f('0x1c')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x291f('0x20')]['sendRequest']=function(_0x2d1f41){return this['command'][_0x291f('0x21')](this,_0x2d1f41);};AGIChannel[_0x291f('0x20')][_0x291f('0x22')]=function(){return this[_0x291f('0x23')](_0x291f('0x24'));};AGIChannel['prototype']['getData']=function(_0x26d793,_0x81d6dd,_0x4a9bf3){_0x26d793=_0x26d793===undefined?'beep':_0x26d793;_0x81d6dd=_0x81d6dd===undefined?'5':_0x81d6dd;_0x4a9bf3=_0x4a9bf3===undefined?'1':_0x4a9bf3;return this[_0x291f('0x23')](util[_0x291f('0x25')](_0x291f('0x26'),_0x26d793,_0x81d6dd*0x3e8,_0x4a9bf3));};AGIChannel[_0x291f('0x20')][_0x291f('0x27')]=function(_0x2064df){_0x2064df=_0x2064df||'NO\x20MESSAGE';return this[_0x291f('0x23')](util[_0x291f('0x25')](_0x291f('0x28'),_0x2064df));};AGIChannel['prototype']['exec']=function(_0x539512,_0x42f00e){if(_[_0x291f('0x29')](_0x42f00e)){return this[_0x291f('0x23')](util['format']('EXEC\x20%s\x20%s',_0x539512,_0x42f00e[_0x291f('0x2a')](',')));}return this[_0x291f('0x23')](util[_0x291f('0x25')](_0x291f('0x2b'),_0x539512,_0x42f00e));};AGIChannel[_0x291f('0x20')]['setContext']=function(_0x395345){return this[_0x291f('0x23')](util[_0x291f('0x25')](_0x291f('0x2c'),_0x395345));};AGIChannel['prototype'][_0x291f('0x2d')]=function(_0x2853f3){return this['sendRequest'](util[_0x291f('0x25')](_0x291f('0x2e'),_0x2853f3));};AGIChannel[_0x291f('0x20')][_0x291f('0x2f')]=function(_0x4bf398){return this['sendRequest'](util[_0x291f('0x25')](_0x291f('0x30'),_0x4bf398));};AGIChannel[_0x291f('0x20')][_0x291f('0xc')]=function(){return this['sendRequest'](_0x291f('0x31'));};AGIChannel[_0x291f('0x20')]['setVariable']=function(_0x1b72f7,_0x299255){return this[_0x291f('0x23')](util[_0x291f('0x25')](_0x291f('0x32'),_0x1b72f7,_0x299255?_0x299255[_0x291f('0x33')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x291f('0x34')]=function(_0x57ea4d,_0x4d376c){return this[_0x291f('0x23')](util[_0x291f('0x25')](_0x291f('0x35'),_0x57ea4d,_0x4d376c));};AGIChannel[_0x291f('0x20')][_0x291f('0x36')]=function(_0x3a4f87,_0x161333){return this[_0x291f('0x23')](util[_0x291f('0x25')](_0x291f('0x37'),_0x3a4f87,_0x161333));};AGIChannel[_0x291f('0x20')][_0x291f('0x38')]=function(_0x19c5c4,_0x16f9ed){return this[_0x291f('0x23')](util[_0x291f('0x25')](_0x291f('0x39'),_0x19c5c4,_0x16f9ed));};AGIChannel[_0x291f('0x20')][_0x291f('0x3a')]=function(_0x2a50aa,_0x493424,_0x52e97e){_0x493424=_0x493424||this[_0x291f('0x3b')];_0x52e97e=_0x52e97e||0x1;this[_0x291f('0x3c')](_0x2a50aa);this[_0x291f('0x2d')](_0x493424);this[_0x291f('0x2f')](_0x52e97e);return this[_0x291f('0x27')](util[_0x291f('0x25')](_0x291f('0x3d'),_0x2a50aa,_0x493424,_0x52e97e));};AGIChannel[_0x291f('0x20')]['getVariable']=function(_0x52c525){return this['sendRequest'](util[_0x291f('0x25')]('GET\x20VARIABLE\x20\x22%s\x22',_0x52c525));};AGIChannel[_0x291f('0x20')]['recordFile']=function(_0x242ad4,_0x16b711,_0x4d372c,_0x22fc17,_0x1a61ea,_0x4a7b08){_0x16b711=_0x16b711||'wav';_0x4d372c=_0x4d372c||'';_0x22fc17=_0x22fc17===undefined?-0x1:_0x22fc17==='-1'?-0x1:_0x22fc17*0x3e8;_0x1a61ea=_0x1a61ea===undefined?'':'s='+_0x1a61ea;_0x4a7b08=_0x4a7b08?_0x291f('0x3e'):'';return this['sendRequest'](util[_0x291f('0x25')](_0x291f('0x3f'),_0x242ad4,_0x16b711,_0x4d372c,_0x22fc17,_0x4a7b08,_0x1a61ea));};AGIChannel['prototype'][_0x291f('0x40')]=function(_0x1bf8f1,_0xbd0010){_0xbd0010=_0xbd0010||'';return this[_0x291f('0x23')](util[_0x291f('0x25')](_0x291f('0x41'),_0x1bf8f1,_0xbd0010));};AGIChannel[_0x291f('0x20')][_0x291f('0x42')]=function(_0x1c061f){return this[_0x291f('0x43')](_0x291f('0x44'),_0x1c061f);};AGIChannel[_0x291f('0x20')][_0x291f('0x45')]=function(_0x4da85d){return this['exec'](_0x291f('0x46'),_0x4da85d);};AGIChannel[_0x291f('0x20')][_0x291f('0x15')]=function(_0xa91fe0,_0x2f9f01){this[_0x291f('0x27')](util[_0x291f('0x25')](_0x291f('0x47'),_0xa91fe0['id'],_0xa91fe0['label'],_0x2f9f01));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x291f('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index dd4b4e8..79a0785 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 _0x3a80=['exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name'];(function(_0x149ce5,_0x3fad8c){var _0x91fb83=function(_0x313202){while(--_0x313202){_0x149ce5['push'](_0x149ce5['shift']());}};_0x91fb83(++_0x3fad8c);}(_0x3a80,0x1b4));var _0x03a8=function(_0xbf1798,_0x3b9839){_0xbf1798=_0xbf1798-0x0;var _0x4c6511=_0x3a80[_0xbf1798];return _0x4c6511;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x03a8('0x0'),'E_AGI_ARGUMENT_PORT':_0x03a8('0x1'),'E_AGI_SERVER_ERROR':_0x03a8('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x03a8('0x3'),'E_AGI_SOCKET_CLOSE':_0x03a8('0x4'),'E_AGI_SOCKET_TIMEOUT':_0x03a8('0x5'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x03a8('0x6'),'E_AGI_IVR_ENTRY':_0x03a8('0x7')};function AGIError(_0x511900){var _0x511900=_0x511900||null,_0x2eb564=_0x2eb564||[],_0x418f23=0x1,_0x26282d='';if(!error[_0x511900]){_0x511900=_0x03a8('0x8');}_0x2eb564[_0x03a8('0x9')](error[_0x511900]);while(arguments[_0x418f23]){_0x2eb564[_0x03a8('0x9')](arguments[_0x418f23]);_0x418f23++;}_0x26282d=util[_0x03a8('0xa')][_0x03a8('0xb')](util,_0x2eb564);this[_0x03a8('0xc')]=_0x26282d;this[_0x03a8('0xd')]=_0x511900;}module[_0x03a8('0xe')]=AGIError; \ No newline at end of file +var _0xa21f=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','format','message','name','exports','util','Undefined\x20error.'];(function(_0x228f83,_0x5357f6){var _0x210665=function(_0x103aa6){while(--_0x103aa6){_0x228f83['push'](_0x228f83['shift']());}};_0x210665(++_0x5357f6);}(_0xa21f,0x14e));var _0xfa21=function(_0x1932ea,_0x49ee67){_0x1932ea=_0x1932ea-0x0;var _0x3e37bb=_0xa21f[_0x1932ea];return _0x3e37bb;};'use strict';var util=require(_0xfa21('0x0'));var error={'E_AGI_UNDEFINED':_0xfa21('0x1'),'E_AGI_ARGUMENT_PORT':_0xfa21('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xfa21('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xfa21('0x4'),'E_AGI_SOCKET_ERROR':_0xfa21('0x5'),'E_AGI_SOCKET_CLOSE':_0xfa21('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xfa21('0x7'),'E_AGI_COMMAND_EMPTY':_0xfa21('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xfa21('0x9'),'E_AGI_IVR_ENTRY':_0xfa21('0xa')};function AGIError(_0x1fdad7){var _0x1fdad7=_0x1fdad7||null,_0x2c18ff=_0x2c18ff||[],_0x216191=0x1,_0x495bc5='';if(!error[_0x1fdad7]){_0x1fdad7=_0xfa21('0xb');}_0x2c18ff['push'](error[_0x1fdad7]);while(arguments[_0x216191]){_0x2c18ff['push'](arguments[_0x216191]);_0x216191++;}_0x495bc5=util[_0xfa21('0xc')]['apply'](util,_0x2c18ff);this[_0xfa21('0xd')]=_0x495bc5;this[_0xfa21('0xe')]=_0x1fdad7;}module[_0xfa21('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index f49ecf8..d2b4613 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 _0xdd4f=['edges','numberOfEdges','prototype','vertices','addEdge','push','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','menu','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','getdigits','getsecretdigits'];(function(_0x1e0846,_0x4aea1b){var _0x57e5d7=function(_0x2f9fb3){while(--_0x2f9fb3){_0x1e0846['push'](_0x1e0846['shift']());}};_0x57e5d7(++_0x4aea1b);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x44c2c8,_0x46dcd0){_0x44c2c8=_0x44c2c8-0x0;var _0x136b8c=_0xdd4f[_0x44c2c8];return _0x136b8c;};'use strict';var _=require(_0xfdd4('0x0'));var logger=require('../../../config/logger')('agi');var verticesWithRetry=['menu',_0xfdd4('0x1'),_0xfdd4('0x2')];var Graph=function(){this['vertices']={};this[_0xfdd4('0x3')]={};this[_0xfdd4('0x4')]=0x0;};Graph[_0xfdd4('0x5')]['addVertex']=function(_0x398015){this[_0xfdd4('0x6')][_0x398015['id']]=_0x398015;this[_0xfdd4('0x3')][_0x398015['id']]=[];};Graph[_0xfdd4('0x5')][_0xfdd4('0x7')]=function(_0x51acd6,_0x3cd8e6,_0x563ae6){this[_0xfdd4('0x3')][_0x51acd6][_0xfdd4('0x8')]({'target':_0x3cd8e6,'condition':_0x563ae6});this[_0xfdd4('0x4')]+=0x1;};Graph['prototype'][_0xfdd4('0x9')]=function(){return _['size'](this[_0xfdd4('0x6')]);};Graph[_0xfdd4('0x5')][_0xfdd4('0xa')]=function(){return this[_0xfdd4('0x4')];};Graph[_0xfdd4('0x5')][_0xfdd4('0xb')]=function(_0x1e21ca){return this[_0xfdd4('0x6')][_0x1e21ca];};Graph[_0xfdd4('0x5')][_0xfdd4('0xc')]=function(_0x1bf37b,_0x59a126){if(!this[_0xfdd4('0x6')][_0x1bf37b]){return logger[_0xfdd4('0xd')](_0xfdd4('0xe'));}var _0x57b21f=_0x59a126(this[_0xfdd4('0x6')][_0x1bf37b]);if(!_0x57b21f){return logger['info'](_0xfdd4('0xf'));}if(this[_0xfdd4('0x3')][_0x1bf37b][_0xfdd4('0x10')]===0x0){return logger[_0xfdd4('0xd')](_0xfdd4('0x11'));}for(var _0x52cf2c=0x0,_0x47ed1d=[],_0x559c77=![];_0x52cf2c\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','value','getSquareProject','then','createSquareReport','inspect','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','evtHangup','production','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense'];(function(_0x3a4824,_0x305e15){var _0x3df1cc=function(_0x3dc488){while(--_0x3dc488){_0x3a4824['push'](_0x3a4824['shift']());}};_0x3df1cc(++_0x305e15);}(_0xfc76,0xb5));var _0x6fc7=function(_0x4ce777,_0x3c8a0b){_0x4ce777=_0x4ce777-0x0;var _0x489399=_0xfc76[_0x4ce777];return _0x489399;};'use strict';var parser=require('xml2json');var _=require(_0x6fc7('0x0'));var syncho=require(_0x6fc7('0x1'));var util=require(_0x6fc7('0x2'));var moment=require(_0x6fc7('0x3'));var config=require(_0x6fc7('0x4'));var logger=require('../../config/logger')(_0x6fc7('0x5'));var utilLicense=require(_0x6fc7('0x6'));var rpc=require('./rpc');var mailRpc=require(_0x6fc7('0x7'));var Graph=require('./graph');var Vertices=require(_0x6fc7('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x6fc7('0x5')]=_[_0x6fc7('0x9')](config['agi'],{'ip':_0x6fc7('0xa'),'port':0x11dd});function connectionHandler(_0x407b0a){process[_0x6fc7('0xb')](function(){syncho(function(){try{setChannelVariables(_0x407b0a);agiHandler(_0x407b0a);}catch(_0x1d4fee){logger[_0x6fc7('0xc')](_0x1d4fee[_0x6fc7('0xd')]);}});});}function listeningHandler(){console['log'](_0x6fc7('0xe'),config[_0x6fc7('0x5')][_0x6fc7('0xf')]);logger[_0x6fc7('0x10')](util[_0x6fc7('0x11')](_0x6fc7('0x12'),config['agi']['ip'],config[_0x6fc7('0x5')][_0x6fc7('0xf')]));}function errorHandler(_0x5cd139){if(_0x5cd139&&_0x5cd139[_0x6fc7('0x13')]&&_0x5cd139[_0x6fc7('0x14')]){logger['error'](util[_0x6fc7('0x11')](_0x6fc7('0x15'),_0x5cd139['name'],_0x5cd139[_0x6fc7('0x14')]));}else{logger[_0x6fc7('0xc')](util[_0x6fc7('0x11')]('[ERROR]\x20%s',_0x5cd139['stack']));}}function closeHandler(){logger[_0x6fc7('0x10')](util[_0x6fc7('0x11')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x6fc7('0x16')],this[_0x6fc7('0x17')],this[_0x6fc7('0x18')],this[_0x6fc7('0x19')],this['uniqueid']));try{createSquareReport(this);}catch(_0x816704){logger[_0x6fc7('0xc')](_0x816704[_0x6fc7('0xd')]);}}function timeoutHandler(){logger[_0x6fc7('0x10')](util[_0x6fc7('0x11')](_0x6fc7('0x1a'),this['arg_1'],this[_0x6fc7('0x17')],this[_0x6fc7('0x18')],this[_0x6fc7('0x19')],this[_0x6fc7('0x1b')]));}function hangupHandler(){logger[_0x6fc7('0x10')](util['format'](_0x6fc7('0x1c'),this[_0x6fc7('0x16')],this['calleridname'],this[_0x6fc7('0x18')],this['dnid'],this[_0x6fc7('0x1b')]));this['evtHangup']=!![];}function getRoot(_0x11b359){return parser[_0x6fc7('0x1d')](_0x11b359,{'object':!![]})[_0x6fc7('0x1e')]['root'];}function addVertex(_0x45e53e,_0x4a4cdf,_0x2dd21a){_0x4a4cdf[_0x6fc7('0x1f')]=_0x2dd21a;if(_0x4a4cdf[_0x6fc7('0x20')](_0x6fc7('0x21'))){_0x4a4cdf[_0x6fc7('0x22')]=parseInt(_0x4a4cdf[_0x6fc7('0x21')],0xa);}_0x45e53e[_0x6fc7('0x23')](_[_0x6fc7('0x24')](_0x4a4cdf,_0x6fc7('0x25')));}function initGraph(_0x2759ad,_0xaa2687){var _0x426872=new Graph();for(var _0x4612d4 in _0x2759ad){if(_0x2759ad[_0x6fc7('0x20')](_0x4612d4)){if(_[_0x6fc7('0x26')](_0x2759ad[_0x4612d4])){for(var _0x5880cc=0x0;_0x5880cc<_0x2759ad[_0x4612d4][_0x6fc7('0x27')];_0x5880cc+=0x1){addVertex(_0x426872,_0x2759ad[_0x4612d4][_0x5880cc],_0x4612d4);}}else{addVertex(_0x426872,_0x2759ad[_0x4612d4],_0x4612d4);}}}for(var _0x3053b1=0x0;_0x3053b1<_0xaa2687[_0x6fc7('0x27')];_0x3053b1+=0x1){if(_0xaa2687[_0x3053b1][_0x6fc7('0x28')]&&_0xaa2687[_0x3053b1]['target']){_0x426872[_0x6fc7('0x29')](_0xaa2687[_0x3053b1][_0x6fc7('0x28')],_0xaa2687[_0x3053b1][_0x6fc7('0x2a')],_0xaa2687[_0x3053b1][_0x6fc7('0x2b')]);}}return _0x426872;}function getSquareProject(_0x34bf7f,_0x1465a7){rpc[_0x6fc7('0x2c')](_0x34bf7f)[_0x6fc7('0x2d')](function(_0x59a70e){_0x1465a7(null,_0x59a70e);})['catch'](function(_0x15a856){_0x1465a7(null,_0x15a856);});}function createSquareReport(_0x17ddfe,_0x3e796a){rpc[_0x6fc7('0x2e')](_0x17ddfe)[_0x6fc7('0x2d')](function(_0x3185ee){if(_0x3e796a){_0x3e796a(null,_0x3185ee);}})['catch'](function(_0x278f8f){if(_0x3e796a){_0x3e796a(null,_0x278f8f);}});}function setChannelVariables(_0xbf7528){for(var _0x16c514 in _0xbf7528){if(_0xbf7528[_0x6fc7('0x20')](_0x16c514)){if(_0x16c514['indexOf']('agi_')===0x0){_0xbf7528[_0x16c514['substring'](0x4)]=_0xbf7528[_0x16c514];delete _0xbf7528[_0x16c514];}}}}function getLogFromObject(_0xb80178){return util[_0x6fc7('0x2f')](_0xb80178,{'showHidden':![],'depth':null});}function agiHandler(_0x2fd248){var _0x4673d9,_0x129672,_0x241da7,_0x46aad4,_0x141898;logger[_0x6fc7('0x30')]('variables',JSON[_0x6fc7('0x31')](_0x2fd248,null,0x2));logger['info'](util[_0x6fc7('0x11')](_0x6fc7('0x32'),_0x2fd248[_0x6fc7('0x16')],_0x2fd248[_0x6fc7('0x17')],_0x2fd248['callerid'],_0x2fd248[_0x6fc7('0x19')],_0x2fd248[_0x6fc7('0x1b')]));_0x2fd248['on'](_0x6fc7('0xc'),errorHandler);_0x2fd248['on'](_0x6fc7('0x33'),closeHandler);_0x2fd248['on']('timeout',timeoutHandler);_0x2fd248[_0x6fc7('0x34')]=![];_0x2fd248['on']('hangup',hangupHandler);var _0xec700a=getSquareProject['sync'](null,_0x2fd248['arg_1']);if(_0xec700a){if(_0xec700a['production']){_0x4673d9=getRoot(_0xec700a[_0x6fc7('0x35')]);if(_0x4673d9&&_0x4673d9['start']){logger[_0x6fc7('0x30')](_0x6fc7('0x36'),JSON[_0x6fc7('0x31')](_0x4673d9,null,0x2));_0x2fd248[_0x6fc7('0x37')]=moment()[_0x6fc7('0x11')](_0x6fc7('0x38'));_0x129672=initGraph(_[_0x6fc7('0x24')](_0x4673d9,_0x6fc7('0x25')),_0x4673d9[_0x6fc7('0x25')]);_0x241da7=new Vertices(_0x2fd248,rpc,mailRpc);logger[_0x6fc7('0x10')](util[_0x6fc7('0x11')](_0x6fc7('0x39'),_0x2fd248[_0x6fc7('0x16')],_0x2fd248[_0x6fc7('0x17')],_0x2fd248[_0x6fc7('0x18')],_0x2fd248[_0x6fc7('0x19')],_0x2fd248[_0x6fc7('0x1b')]));_0x129672[_0x6fc7('0x3a')](_0x4673d9['start']['id'],function(_0x490f2e){try{_0x490f2e=_0x241da7[_0x6fc7('0x3b')](_0x490f2e);logger[_0x6fc7('0x30')](_0x6fc7('0x3c'),JSON[_0x6fc7('0x31')](_0x490f2e,null,0x2));if(_0x490f2e['agicommand']===_0x6fc7('0x3d')){logger[_0x6fc7('0x10')](_0x6fc7('0x3e'));_0x2fd248[_0x6fc7('0x3f')]=_0x490f2e[_0x6fc7('0x3f')]||_0x2fd248[_0x6fc7('0x3f')];_0x2fd248[_0x6fc7('0x40')]=_0x490f2e[_0x6fc7('0x40')];_0x2fd248[_0x6fc7('0x41')]=_0x490f2e[_0x6fc7('0x41')]?_0x490f2e[_0x6fc7('0x41')]-0x1:0x1;return null;}else if(_0x490f2e&&_0x241da7[_0x490f2e[_0x6fc7('0x1f')]]){_0x141898=_0x241da7[_0x490f2e['agicommand']](_0x490f2e);logger[_0x6fc7('0x10')](_0x6fc7('0x42'),JSON['stringify'](_0x141898,null,0x2));if(_0x141898&&_0x141898[_0x6fc7('0x43')]===AGI_CODE_SUCCESS&&_0x141898[_0x6fc7('0x44')]!==AGI_RESULT_ERROR&&!_0x2fd248[_0x6fc7('0x34')]){logger[_0x6fc7('0x30')](_0x6fc7('0x42'),getLogFromObject(_0x141898));return _[_0x6fc7('0x45')](_0x141898[_0x6fc7('0x44')])?null:_0x141898[_0x6fc7('0x44')][_0x6fc7('0x46')]();}else{logger[_0x6fc7('0xc')]('response',getLogFromObject(_0x141898));return null;}}else{logger[_0x6fc7('0xc')](_0x6fc7('0x47'));return null;}}catch(_0x494380){logger['error'](_0x494380[_0x6fc7('0xd')]);return null;}});if(_0x4673d9[_0x6fc7('0x48')]){logger[_0x6fc7('0x10')](util['format'](_0x6fc7('0x49'),_0x2fd248[_0x6fc7('0x16')],_0x2fd248['calleridname'],_0x2fd248[_0x6fc7('0x18')],_0x2fd248[_0x6fc7('0x19')],_0x2fd248[_0x6fc7('0x1b')]));_0x129672[_0x6fc7('0x3a')](_0x4673d9[_0x6fc7('0x48')]['id'],function(_0x2b24e8){try{_0x2b24e8=_0x241da7[_0x6fc7('0x3b')](_0x2b24e8);logger[_0x6fc7('0x30')](_0x6fc7('0x3c'),JSON[_0x6fc7('0x31')](_0x2b24e8,null,0x2));if(_0x2b24e8&&_0x241da7[_0x2b24e8[_0x6fc7('0x1f')]]){_0x141898=_0x241da7[_0x2b24e8['agicommand']](_0x2b24e8);if(_0x141898){logger['debug']('response',getLogFromObject(_0x141898));return _['isUndefined'](_0x141898[_0x6fc7('0x44')])?null:_0x141898['result'][_0x6fc7('0x46')]();}else{logger[_0x6fc7('0xc')](_0x6fc7('0x42'),getLogFromObject(_0x141898));return null;}}else{logger[_0x6fc7('0xc')](_0x6fc7('0x47'));return null;}}catch(_0x297146){logger['error'](_0x297146[_0x6fc7('0xd')]);return null;}});}logger[_0x6fc7('0x10')](util['format'](_0x6fc7('0x4a'),_0x2fd248[_0x6fc7('0x16')],_0x2fd248[_0x6fc7('0x17')],_0x2fd248[_0x6fc7('0x18')],_0x2fd248[_0x6fc7('0x19')],_0x2fd248[_0x6fc7('0x1b')]));logger[_0x6fc7('0x10')](util[_0x6fc7('0x11')](_0x6fc7('0x4b'),_0x2fd248[_0x6fc7('0x3f')],_0x2fd248['extension'],parseInt(_0x2fd248[_0x6fc7('0x41')],0xa)+0x1));_0x2fd248[_0x6fc7('0x4c')](_0x2fd248[_0x6fc7('0x3f')],_0x2fd248['extension'],parseInt(_0x2fd248[_0x6fc7('0x41')],0xa)+0x1);_0x2fd248['close']();}}else{logger[_0x6fc7('0xc')](util['format'](_0x6fc7('0x4d'),_0x2fd248[_0x6fc7('0x16')]));_0x2fd248[_0x6fc7('0x4c')](_0x2fd248[_0x6fc7('0x3f')],_0x2fd248[_0x6fc7('0x40')],parseInt(_0x2fd248[_0x6fc7('0x41')],0xa)+0x1);_0x2fd248[_0x6fc7('0x33')]();}}else{logger[_0x6fc7('0xc')](util['format'](_0x6fc7('0x4e'),_0x2fd248[_0x6fc7('0x16')]));_0x2fd248[_0x6fc7('0x4c')](_0x2fd248[_0x6fc7('0x3f')],_0x2fd248[_0x6fc7('0x40')],parseInt(_0x2fd248['priority'],0xa)+0x1);_0x2fd248[_0x6fc7('0x33')]();}}function main(){var _0x118f81;return utilLicense[_0x6fc7('0x4f')]()[_0x6fc7('0x2d')](function(_0x1927d6){if(_0x1927d6){if(_0x1927d6[_0x6fc7('0x50')]){if(_0x1927d6[_0x6fc7('0x51')]&&_0x1927d6[_0x6fc7('0x51')]>0x0){logger[_0x6fc7('0x10')](util[_0x6fc7('0x11')](_0x6fc7('0x52'),_0x1927d6['callysquare']));_0x118f81=_0x1927d6[_0x6fc7('0x51')];}else{logger[_0x6fc7('0x10')](_0x6fc7('0x53'));}}else{logger[_0x6fc7('0x10')](_0x6fc7('0x54'));_0x118f81=-0x1;}}})[_0x6fc7('0x55')](function(_0x39ae2f){logger[_0x6fc7('0xc')]('[LICENSE]',_0x39ae2f[_0x6fc7('0xd')]);})['finally'](function(){var _0x5da61c=require('./server')(config[_0x6fc7('0x5')][_0x6fc7('0xf')],config[_0x6fc7('0x5')]['ip'],_0x118f81);_0x5da61c['on']('error',errorHandler);_0x5da61c['on']('listening',listeningHandler);_0x5da61c['on'](_0x6fc7('0x56'),connectionHandler);_0x5da61c['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x29d4=['[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','evtHangup','toJson','mxGraphModel','root','agicommand','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','hasOwnProperty','indexOf','debug','close','timeout','sync','production','start','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','traverseBFS','clear','context','extension','priority','response','code','isUndefined','result','toString','finally','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','agi','defaults','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','[%s]\x20%s','message'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x29d4,0x1a1));var _0x429d=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x29d4[_0x2b10c6];return _0x3789d2;};'use strict';var parser=require(_0x429d('0x0'));var _=require('lodash');var syncho=require(_0x429d('0x1'));var util=require(_0x429d('0x2'));var moment=require(_0x429d('0x3'));var config=require(_0x429d('0x4'));var logger=require(_0x429d('0x5'))('agi');var utilLicense=require(_0x429d('0x6'));var rpc=require(_0x429d('0x7'));var mailRpc=require(_0x429d('0x8'));var Graph=require(_0x429d('0x9'));var Vertices=require(_0x429d('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x429d('0xb')]=_[_0x429d('0xc')](config[_0x429d('0xb')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x9fc337){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x9fc337);agiHandler(_0x9fc337);}catch(_0x471129){logger[_0x429d('0xd')](_0x471129[_0x429d('0xe')]);}});});}function listeningHandler(){console['log'](_0x429d('0xf'),config[_0x429d('0xb')]['port']);logger[_0x429d('0x10')](util[_0x429d('0x11')](_0x429d('0x12'),config['agi']['ip'],config[_0x429d('0xb')][_0x429d('0x13')]));}function errorHandler(_0x1d933b){if(_0x1d933b&&_0x1d933b[_0x429d('0x14')]&&_0x1d933b['message']){logger[_0x429d('0xd')](util[_0x429d('0x11')](_0x429d('0x15'),_0x1d933b['name'],_0x1d933b[_0x429d('0x16')]));}else{logger[_0x429d('0xd')](util['format'](_0x429d('0x17'),_0x1d933b[_0x429d('0xe')]));}}function closeHandler(){logger[_0x429d('0x10')](util[_0x429d('0x11')](_0x429d('0x18'),this[_0x429d('0x19')],this['calleridname'],this[_0x429d('0x1a')],this['dnid'],this[_0x429d('0x1b')]));try{createSquareReport(this);}catch(_0x35830e){logger[_0x429d('0xd')](_0x35830e[_0x429d('0xe')]);}}function timeoutHandler(){logger['info'](util[_0x429d('0x11')](_0x429d('0x1c'),this[_0x429d('0x19')],this['calleridname'],this[_0x429d('0x1a')],this[_0x429d('0x1d')],this[_0x429d('0x1b')]));}function hangupHandler(){logger[_0x429d('0x10')](util[_0x429d('0x11')](_0x429d('0x1e'),this['arg_1'],this[_0x429d('0x1f')],this[_0x429d('0x1a')],this[_0x429d('0x1d')],this['uniqueid']));this[_0x429d('0x20')]=!![];}function getRoot(_0x13fc71){return parser[_0x429d('0x21')](_0x13fc71,{'object':!![]})[_0x429d('0x22')][_0x429d('0x23')];}function addVertex(_0x1023e6,_0x4c6d89,_0x28f84e){_0x4c6d89[_0x429d('0x24')]=_0x28f84e;if(_0x4c6d89['hasOwnProperty'](_0x429d('0x25'))){_0x4c6d89[_0x429d('0x26')]=parseInt(_0x4c6d89[_0x429d('0x25')],0xa);}_0x1023e6[_0x429d('0x27')](_['omit'](_0x4c6d89,_0x429d('0x28')));}function initGraph(_0x415b92,_0x387639){var _0x3896ee=new Graph();for(var _0x3e4e73 in _0x415b92){if(_0x415b92['hasOwnProperty'](_0x3e4e73)){if(_[_0x429d('0x29')](_0x415b92[_0x3e4e73])){for(var _0x2209aa=0x0;_0x2209aa<_0x415b92[_0x3e4e73][_0x429d('0x2a')];_0x2209aa+=0x1){addVertex(_0x3896ee,_0x415b92[_0x3e4e73][_0x2209aa],_0x3e4e73);}}else{addVertex(_0x3896ee,_0x415b92[_0x3e4e73],_0x3e4e73);}}}for(var _0x1cba36=0x0;_0x1cba36<_0x387639[_0x429d('0x2a')];_0x1cba36+=0x1){if(_0x387639[_0x1cba36][_0x429d('0x2b')]&&_0x387639[_0x1cba36][_0x429d('0x2c')]){_0x3896ee[_0x429d('0x2d')](_0x387639[_0x1cba36][_0x429d('0x2b')],_0x387639[_0x1cba36]['target'],_0x387639[_0x1cba36][_0x429d('0x2e')]);}}return _0x3896ee;}function getSquareProject(_0x3ca640,_0x5bdb2d){rpc[_0x429d('0x2f')](_0x3ca640)[_0x429d('0x30')](function(_0x2e95b5){_0x5bdb2d(null,_0x2e95b5);})[_0x429d('0x31')](function(_0x3394a8){_0x5bdb2d(null,_0x3394a8);});}function createSquareReport(_0x481122,_0x3b51ae){rpc[_0x429d('0x32')](_0x481122)[_0x429d('0x30')](function(_0x1dae60){if(_0x3b51ae){_0x3b51ae(null,_0x1dae60);}})[_0x429d('0x31')](function(_0x1b98ad){if(_0x3b51ae){_0x3b51ae(null,_0x1b98ad);}});}function setChannelVariables(_0x4dcacd){for(var _0x559bd5 in _0x4dcacd){if(_0x4dcacd[_0x429d('0x33')](_0x559bd5)){if(_0x559bd5[_0x429d('0x34')]('agi_')===0x0){_0x4dcacd[_0x559bd5['substring'](0x4)]=_0x4dcacd[_0x559bd5];delete _0x4dcacd[_0x559bd5];}}}}function getLogFromObject(_0x21dc7e){return util['inspect'](_0x21dc7e,{'showHidden':![],'depth':null});}function agiHandler(_0x1992ca){var _0x3ba3aa,_0x20e11a,_0x1b223e,_0x5484b3,_0x10c023;logger[_0x429d('0x35')]('variables',JSON['stringify'](_0x1992ca,null,0x2));logger['info'](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1992ca[_0x429d('0x19')],_0x1992ca['calleridname'],_0x1992ca['callerid'],_0x1992ca[_0x429d('0x1d')],_0x1992ca[_0x429d('0x1b')]));_0x1992ca['on'](_0x429d('0xd'),errorHandler);_0x1992ca['on'](_0x429d('0x36'),closeHandler);_0x1992ca['on'](_0x429d('0x37'),timeoutHandler);_0x1992ca[_0x429d('0x20')]=![];_0x1992ca['on']('hangup',hangupHandler);var _0x423dc8=getSquareProject[_0x429d('0x38')](null,_0x1992ca[_0x429d('0x19')]);if(_0x423dc8){if(_0x423dc8[_0x429d('0x39')]){_0x3ba3aa=getRoot(_0x423dc8[_0x429d('0x39')]);if(_0x3ba3aa&&_0x3ba3aa[_0x429d('0x3a')]){logger[_0x429d('0x35')](_0x429d('0x23'),JSON[_0x429d('0x3b')](_0x3ba3aa,null,0x2));_0x1992ca[_0x429d('0x3c')]=moment()[_0x429d('0x11')](_0x429d('0x3d'));_0x20e11a=initGraph(_[_0x429d('0x3e')](_0x3ba3aa,_0x429d('0x28')),_0x3ba3aa[_0x429d('0x28')]);_0x1b223e=new Vertices(_0x1992ca,rpc,mailRpc);logger[_0x429d('0x10')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1992ca[_0x429d('0x19')],_0x1992ca[_0x429d('0x1f')],_0x1992ca['callerid'],_0x1992ca[_0x429d('0x1d')],_0x1992ca[_0x429d('0x1b')]));_0x20e11a[_0x429d('0x3f')](_0x3ba3aa['start']['id'],function(_0x50a907){try{_0x50a907=_0x1b223e[_0x429d('0x40')](_0x50a907);logger[_0x429d('0x35')]('vertex',JSON[_0x429d('0x3b')](_0x50a907,null,0x2));if(_0x50a907[_0x429d('0x24')]==='gotoc'){logger[_0x429d('0x10')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x1992ca[_0x429d('0x41')]=_0x50a907[_0x429d('0x41')]||_0x1992ca[_0x429d('0x41')];_0x1992ca[_0x429d('0x42')]=_0x50a907['extension'];_0x1992ca[_0x429d('0x43')]=_0x50a907[_0x429d('0x43')]?_0x50a907[_0x429d('0x43')]-0x1:0x1;return null;}else if(_0x50a907&&_0x1b223e[_0x50a907['agicommand']]){_0x10c023=_0x1b223e[_0x50a907['agicommand']](_0x50a907);logger[_0x429d('0x10')](_0x429d('0x44'),JSON[_0x429d('0x3b')](_0x10c023,null,0x2));if(_0x10c023&&_0x10c023[_0x429d('0x45')]===AGI_CODE_SUCCESS&&_0x10c023['result']!==AGI_RESULT_ERROR&&!_0x1992ca[_0x429d('0x20')]){logger[_0x429d('0x35')](_0x429d('0x44'),getLogFromObject(_0x10c023));return _[_0x429d('0x46')](_0x10c023[_0x429d('0x47')])?null:_0x10c023[_0x429d('0x47')][_0x429d('0x48')]();}else{logger[_0x429d('0xd')](_0x429d('0x44'),getLogFromObject(_0x10c023));return null;}}else{logger[_0x429d('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x2de550){logger['error'](_0x2de550['stack']);return null;}});if(_0x3ba3aa['finally']){logger[_0x429d('0x10')](util[_0x429d('0x11')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1992ca[_0x429d('0x19')],_0x1992ca[_0x429d('0x1f')],_0x1992ca['callerid'],_0x1992ca[_0x429d('0x1d')],_0x1992ca[_0x429d('0x1b')]));_0x20e11a[_0x429d('0x3f')](_0x3ba3aa[_0x429d('0x49')]['id'],function(_0x49d5ff){try{_0x49d5ff=_0x1b223e['clear'](_0x49d5ff);logger[_0x429d('0x35')](_0x429d('0x4a'),JSON[_0x429d('0x3b')](_0x49d5ff,null,0x2));if(_0x49d5ff&&_0x1b223e[_0x49d5ff[_0x429d('0x24')]]){_0x10c023=_0x1b223e[_0x49d5ff['agicommand']](_0x49d5ff);if(_0x10c023){logger[_0x429d('0x35')](_0x429d('0x44'),getLogFromObject(_0x10c023));return _[_0x429d('0x46')](_0x10c023['result'])?null:_0x10c023[_0x429d('0x47')]['toString']();}else{logger[_0x429d('0xd')](_0x429d('0x44'),getLogFromObject(_0x10c023));return null;}}else{logger[_0x429d('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x4aa914){logger[_0x429d('0xd')](_0x4aa914['stack']);return null;}});}logger[_0x429d('0x10')](util[_0x429d('0x11')](_0x429d('0x4b'),_0x1992ca[_0x429d('0x19')],_0x1992ca[_0x429d('0x1f')],_0x1992ca[_0x429d('0x1a')],_0x1992ca[_0x429d('0x1d')],_0x1992ca[_0x429d('0x1b')]));logger['info'](util['format'](_0x429d('0x4c'),_0x1992ca[_0x429d('0x41')],_0x1992ca[_0x429d('0x42')],parseInt(_0x1992ca[_0x429d('0x43')],0xa)+0x1));_0x1992ca['continueAt'](_0x1992ca[_0x429d('0x41')],_0x1992ca[_0x429d('0x42')],parseInt(_0x1992ca[_0x429d('0x43')],0xa)+0x1);_0x1992ca[_0x429d('0x36')]();}}else{logger[_0x429d('0xd')](util[_0x429d('0x11')](_0x429d('0x4d'),_0x1992ca[_0x429d('0x19')]));_0x1992ca[_0x429d('0x4e')](_0x1992ca[_0x429d('0x41')],_0x1992ca['extension'],parseInt(_0x1992ca[_0x429d('0x43')],0xa)+0x1);_0x1992ca[_0x429d('0x36')]();}}else{logger[_0x429d('0xd')](util[_0x429d('0x11')](_0x429d('0x4f'),_0x1992ca[_0x429d('0x19')]));_0x1992ca[_0x429d('0x4e')](_0x1992ca['context'],_0x1992ca[_0x429d('0x42')],parseInt(_0x1992ca[_0x429d('0x43')],0xa)+0x1);_0x1992ca[_0x429d('0x36')]();}}function main(){var _0x473119;return utilLicense['getLicense']()[_0x429d('0x30')](function(_0x4aee2d){if(_0x4aee2d){if(_0x4aee2d[_0x429d('0x50')]){if(_0x4aee2d['callysquare']&&_0x4aee2d['callysquare']>0x0){logger[_0x429d('0x10')](util[_0x429d('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4aee2d[_0x429d('0x51')]));_0x473119=_0x4aee2d[_0x429d('0x51')];}else{logger['info'](_0x429d('0x52'));}}else{logger[_0x429d('0x10')](_0x429d('0x53'));_0x473119=-0x1;}}})[_0x429d('0x31')](function(_0x57f307){logger[_0x429d('0xd')](_0x429d('0x54'),_0x57f307[_0x429d('0xe')]);})[_0x429d('0x49')](function(){var _0x2a32e3=require(_0x429d('0x55'))(config[_0x429d('0xb')][_0x429d('0x13')],config[_0x429d('0xb')]['ip'],_0x473119);_0x2a32e3['on'](_0x429d('0xd'),errorHandler);_0x2a32e3['on'](_0x429d('0x56'),listeningHandler);_0x2a32e3['on'](_0x429d('0x57'),connectionHandler);_0x2a32e3['on'](_0x429d('0x36'),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 1925862..6766b58 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(_0x55b93b,_0x2a3e8a){var _0x1cabf8=function(_0x1716c1){while(--_0x1716c1){_0x55b93b['push'](_0x55b93b['shift']());}};_0x1cabf8(++_0x2a3e8a);}(_0x814b,0x1a2));var _0xb814=function(_0x3aeb36,_0x312dc9){_0x3aeb36=_0x3aeb36-0x0;var _0xa2ef21=_0x814b[_0x3aeb36];return _0xa2ef21;};'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(_0x215379,_0x580364){var _0x4e880e=function(_0xe0a029){while(--_0xe0a029){_0x215379['push'](_0x215379['shift']());}};_0x4e880e(++_0x580364);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 abd00a5..15afa7c 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 _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0x7a54,0x106));var _0x47a5=function(_0x5c6c30,_0x244756){_0x5c6c30=_0x5c6c30-0x0;var _0x2e8300=_0x7a54[_0x5c6c30];return _0x2e8300;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=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(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3f6a25,_0x720812){_0x3f6a25=_0x3f6a25-0x0;var _0x5ed674=_0x5f2f[_0x3f6a25];return _0x5ed674;};'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 ae95be7..212bf82 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 _0xaa10=['format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','ShowPause','LoginUser','UnpauseUser','LogoutUser','bluebird','moment','lodash','util','jayson/promise','http','then','error','message','catch','getSquareProject','ShowSquareProject','ShowMailAccount','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2'];(function(_0x23cf96,_0x5aca03){var _0x3ae189=function(_0x3167a5){while(--_0x3167a5){_0x23cf96['push'](_0x23cf96['shift']());}};_0x3ae189(++_0x5aca03);}(_0xaa10,0x1ac));var _0x0aa1=function(_0xe5dbb9,_0x3244a7){_0xe5dbb9=_0xe5dbb9-0x0;var _0x40ce37=_0xaa10[_0xe5dbb9];return _0x40ce37;};'use strict';var BPromise=require(_0x0aa1('0x0'));var moment=require(_0x0aa1('0x1'));var _=require(_0x0aa1('0x2'));var util=require(_0x0aa1('0x3'));var jayson=require(_0x0aa1('0x4'));var client=jayson['client'][_0x0aa1('0x5')]({'port':0x2329});function request(_0x1cd989,_0x5ae858){return new BPromise(function(_0x2f9c28,_0x474801){return client['request'](_0x1cd989,_0x5ae858)[_0x0aa1('0x6')](function(_0x73f4ec){if(_0x73f4ec[_0x0aa1('0x7')]){return _0x474801(_0x73f4ec[_0x0aa1('0x7')][_0x0aa1('0x8')]);}else{return _0x2f9c28(_0x73f4ec['result']);}})[_0x0aa1('0x9')](function(_0x54bb0c){return _0x474801(_0x54bb0c);});});}exports[_0x0aa1('0xa')]=function(_0x1c803d){return request(_0x0aa1('0xb'),{'options':{'raw':![],'where':{'name':_0x1c803d},'attributes':['production']}});};exports['getMailAccountById']=function(_0xd6205c){return request(_0x0aa1('0xc'),{'options':{'raw':![],'where':{'id':_0xd6205c},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x0aa1('0xd'),_0x0aa1('0xe')]}});};exports[_0x0aa1('0xf')]=function(_0x3b17b2){return request('ShowSquareProject',{'options':{'where':{'id':_0x3b17b2},'attributes':[_0x0aa1('0xd')]}});};exports[_0x0aa1('0x10')]=function(_0x142f45){return request(_0x0aa1('0x11'),{'options':{'where':{'id':_0x142f45},'attributes':[_0x0aa1('0xd')]}});};exports['getVariableById']=function(_0x478711){return request('ShowVariable',{'options':{'where':{'id':_0x478711},'attributes':[_0x0aa1('0xd')]}});};exports[_0x0aa1('0x12')]=function(_0x2ef160){return request(_0x0aa1('0x13'),{'options':{'where':{'id':_0x2ef160},'attributes':[_0x0aa1('0x14')]}});};exports[_0x0aa1('0x15')]=function(_0x275073){return request(_0x0aa1('0x16'),{'options':{'where':{'id':_0x275073},'attributes':['name']}});};exports[_0x0aa1('0x17')]=function(_0x5b04f0){return request(_0x0aa1('0x18'),{'options':{'where':{'id':_0x5b04f0},'attributes':[_0x0aa1('0xd')]}});};exports[_0x0aa1('0x19')]=function(_0x23f89d){return request(_0x0aa1('0x1a'),{'options':{'where':{'id':_0x23f89d},'attributes':[_0x0aa1('0x1b')]}});};exports['getIntervalById']=function(_0x2a5912){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x2a5912},'include':[{'model':_0x0aa1('0x1c'),'as':'Intervals'}]}});};exports[_0x0aa1('0x1d')]=function(_0x78794c){return request(_0x0aa1('0x1e'),{'options':{'where':{'id':_0x78794c},'attributes':['id',_0x0aa1('0xd')]}});};exports[_0x0aa1('0x1f')]=function(_0x193785){return request(_0x0aa1('0x20'),{'body':_0x193785});};exports[_0x0aa1('0x21')]=function(_0xe1280f){return request(_0x0aa1('0x22'),{'body':_0xe1280f});};exports[_0x0aa1('0x23')]=function(_0x1e8b59){return request(_0x0aa1('0x24'),{'body':_[_0x0aa1('0x25')](_0x1e8b59,{'project_name':_0x1e8b59[_0x0aa1('0x26')],'prev_project_name':_0x1e8b59[_0x0aa1('0x27')]||'','is_subproject':_0x1e8b59[_0x0aa1('0x27')]?!![]:![],'leaveAt':moment()[_0x0aa1('0x28')](_0x0aa1('0x29'))})});};exports['createSquareRecording']=function(_0x20e6f6){return request(_0x0aa1('0x2a'),{'body':_0x20e6f6});};exports[_0x0aa1('0x2b')]=function(_0x2c9941){return request('CreateSquareMessage',{'body':_0x2c9941});};exports[_0x0aa1('0x2c')]=function(_0x477e9f){return request(_0x0aa1('0x2d'),{'options':{'raw':![],'where':{'phone':_0x477e9f['phone'],'ListId':_0x477e9f[_0x0aa1('0x2e')]}}})['then'](function(_0x3550db){if(_0x3550db){return _0x3550db;}return request(_0x0aa1('0x2f'),{'body':_0x477e9f});});};exports['getPauseById']=function(_0x3a72d4){return request(_0x0aa1('0x30'),{'options':{'where':{'id':_0x3a72d4},'attributes':[_0x0aa1('0xd')]}});};exports['agentLogin']=function(_0x46a743,_0x15ca6d){return request(_0x0aa1('0x31'),{'body':{'interface':_0x15ca6d},'options':{'where':_0x46a743}});};exports['agentPause']=function(_0x597dee,_0x3f26a0,_0x1ca383){return request('PauseUser',{'body':{'type':_0x3f26a0,'uniqueid':_0x1ca383},'options':{'where':_0x597dee}});};exports['agentUnpause']=function(_0x5959a7){return request(_0x0aa1('0x32'),{'body':{},'options':{'where':_0x5959a7}});};exports['agentLogout']=function(_0x2bfb08){return request(_0x0aa1('0x33'),{'body':{},'options':{'where':_0x2bfb08}});}; \ No newline at end of file +var _0x060a=['phone','CreateCmContact','getPauseById','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','lodash','util','jayson/promise','http','request','then','error','message','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','save_name','getIntervalById','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0x060a,0x192));var _0xa060=function(_0x3afe1e,_0x1436b9){_0x3afe1e=_0x3afe1e-0x0;var _0x191f3e=_0x060a[_0x3afe1e];return _0x191f3e;};'use strict';var BPromise=require('bluebird');var moment=require(_0xa060('0x0'));var _=require(_0xa060('0x1'));var util=require(_0xa060('0x2'));var jayson=require(_0xa060('0x3'));var client=jayson['client'][_0xa060('0x4')]({'port':0x2329});function request(_0x562df1,_0x201517){return new BPromise(function(_0x15897e,_0x5146a7){return client[_0xa060('0x5')](_0x562df1,_0x201517)[_0xa060('0x6')](function(_0x13813c){if(_0x13813c[_0xa060('0x7')]){return _0x5146a7(_0x13813c['error'][_0xa060('0x8')]);}else{return _0x15897e(_0x13813c['result']);}})['catch'](function(_0x29aebf){return _0x5146a7(_0x29aebf);});});}exports['getSquareProject']=function(_0x1a604a){return request(_0xa060('0x9'),{'options':{'raw':![],'where':{'name':_0x1a604a},'attributes':[_0xa060('0xa')]}});};exports[_0xa060('0xb')]=function(_0x4c0b42){return request(_0xa060('0xc'),{'options':{'raw':![],'where':{'id':_0x4c0b42},'include':[{'model':'MailServerOut','as':_0xa060('0xd')}],'attributes':['id',_0xa060('0xe'),_0xa060('0xf')]}});};exports[_0xa060('0x10')]=function(_0x2567a6){return request('ShowSquareProject',{'options':{'where':{'id':_0x2567a6},'attributes':[_0xa060('0xe')]}});};exports[_0xa060('0x11')]=function(_0x4850ae){return request(_0xa060('0x12'),{'options':{'where':{'id':_0x4850ae},'attributes':[_0xa060('0xe')]}});};exports[_0xa060('0x13')]=function(_0x9599b7){return request(_0xa060('0x14'),{'options':{'where':{'id':_0x9599b7},'attributes':[_0xa060('0xe')]}});};exports[_0xa060('0x15')]=function(_0x33d58b){return request(_0xa060('0x16'),{'options':{'where':{'id':_0x33d58b},'attributes':[_0xa060('0x17')]}});};exports[_0xa060('0x18')]=function(_0x246a4a){return request(_0xa060('0x19'),{'options':{'where':{'id':_0x246a4a},'attributes':[_0xa060('0xe')]}});};exports['getTrunkById']=function(_0x5c9f70){return request(_0xa060('0x1a'),{'options':{'where':{'id':_0x5c9f70},'attributes':[_0xa060('0xe')]}});};exports[_0xa060('0x1b')]=function(_0x19465a){return request('ShowSound',{'options':{'where':{'id':_0x19465a},'attributes':[_0xa060('0x1c')]}});};exports[_0xa060('0x1d')]=function(_0x1041da){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1041da},'include':[{'model':'Interval','as':_0xa060('0x1e')}]}});};exports[_0xa060('0x1f')]=function(_0x4e0b36){return request(_0xa060('0x20'),{'options':{'where':{'id':_0x4e0b36},'attributes':['id','name']}});};exports[_0xa060('0x21')]=function(_0x50bf7b){return request('CreateSmsMessage',{'body':_0x50bf7b});};exports[_0xa060('0x22')]=function(_0x58a2a0){return request('CreateSquareDetailsReport',{'body':_0x58a2a0});};exports[_0xa060('0x23')]=function(_0x23ee86){return request('CreateSquareReport',{'body':_[_0xa060('0x24')](_0x23ee86,{'project_name':_0x23ee86[_0xa060('0x25')],'prev_project_name':_0x23ee86[_0xa060('0x26')]||'','is_subproject':_0x23ee86[_0xa060('0x26')]?!![]:![],'leaveAt':moment()[_0xa060('0x27')](_0xa060('0x28'))})});};exports[_0xa060('0x29')]=function(_0x2b7249){return request(_0xa060('0x2a'),{'body':_0x2b7249});};exports[_0xa060('0x2b')]=function(_0x2ef293){return request('CreateSquareMessage',{'body':_0x2ef293});};exports[_0xa060('0x2c')]=function(_0xc2bdbd){return request(_0xa060('0x2d'),{'options':{'raw':![],'where':{'phone':_0xc2bdbd[_0xa060('0x2e')],'ListId':_0xc2bdbd['ListId']}}})['then'](function(_0x28f14b){if(_0x28f14b){return _0x28f14b;}return request(_0xa060('0x2f'),{'body':_0xc2bdbd});});};exports[_0xa060('0x30')]=function(_0x5a407b){return request('ShowPause',{'options':{'where':{'id':_0x5a407b},'attributes':[_0xa060('0xe')]}});};exports['agentLogin']=function(_0x5519df,_0x5e69cf){return request(_0xa060('0x31'),{'body':{'interface':_0x5e69cf},'options':{'where':_0x5519df}});};exports[_0xa060('0x32')]=function(_0x512407,_0x4a657d,_0x34cc8a){return request(_0xa060('0x33'),{'body':{'type':_0x4a657d,'uniqueid':_0x34cc8a},'options':{'where':_0x512407}});};exports[_0xa060('0x34')]=function(_0xddf18f){return request(_0xa060('0x35'),{'body':{},'options':{'where':_0xddf18f}});};exports[_0xa060('0x36')]=function(_0x4b12b1){return request(_0xa060('0x37'),{'body':{},'options':{'where':_0x4b12b1}});}; \ 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 67f799c..d273558 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 _0x3be7=['./lex','exports','./polly'];(function(_0x57da06,_0x4c9d35){var _0x118c39=function(_0x501a24){while(--_0x501a24){_0x57da06['push'](_0x57da06['shift']());}};_0x118c39(++_0x4c9d35);}(_0x3be7,0xf2));var _0x73be=function(_0x26cb07,_0x8a88a2){_0x26cb07=_0x26cb07-0x0;var _0x55df82=_0x3be7[_0x26cb07];return _0x55df82;};var polly=require(_0x73be('0x0'));var lex=require(_0x73be('0x1'));module[_0x73be('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xff90=['./polly','exports'];(function(_0x4da801,_0x413809){var _0x5c7c67=function(_0x394ac2){while(--_0x394ac2){_0x4da801['push'](_0x4da801['shift']());}};_0x5c7c67(++_0x413809);}(_0xff90,0xde));var _0x0ff9=function(_0x102789,_0x24217f){_0x102789=_0x102789-0x0;var _0x4aeb4f=_0xff90[_0x102789];return _0x4aeb4f;};var polly=require(_0x0ff9('0x0'));var lex=require('./lex');module[_0x0ff9('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index ac39a15..34cd753 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa631=['exports'];(function(_0xe7216a,_0x536abc){var _0x54a729=function(_0xddf890){while(--_0xddf890){_0xe7216a['push'](_0xe7216a['shift']());}};_0x54a729(++_0x536abc);}(_0xa631,0xe4));var _0x1a63=function(_0x228c38,_0x4479c6){_0x228c38=_0x228c38-0x0;var _0x351d65=_0xa631[_0x228c38];return _0x351d65;};'use strict';var lex=require('./lib/api');module[_0x1a63('0x0')]=function(_0x1e771b,_0x17d7a7,_0x53c6fb,_0x265d0d,_0x584ab0,_0x536c8d){return lex(_0x1e771b,_0x17d7a7,_0x53c6fb,_0x265d0d,_0x584ab0,_0x536c8d);}; \ No newline at end of file +var _0x544a=['exports','./lib/api'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x544a,0xbd));var _0xa544=function(_0x5d9f5c,_0x189d90){_0x5d9f5c=_0x5d9f5c-0x0;var _0x171fba=_0x544a[_0x5d9f5c];return _0x171fba;};'use strict';var lex=require(_0xa544('0x0'));module[_0xa544('0x1')]=function(_0x311c86,_0x5d759f,_0x544b38,_0x46d7b6,_0x5026f6,_0x42b8f1){return lex(_0x311c86,_0x5d759f,_0x544b38,_0x46d7b6,_0x5026f6,_0x42b8f1);}; \ 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 5846bee..1b816cd 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 _0xabaf=['aws-sdk','postText','slots','LexRuntime','$LATEST','bluebird'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xabaf,0xdd));var _0xfaba=function(_0x5c31c7,_0x57f49d){_0x5c31c7=_0x5c31c7-0x0;var _0x3c8418=_0xabaf[_0x5c31c7];return _0x3c8418;};'use strict';var BPromise=require(_0xfaba('0x0'));var AWS=require(_0xfaba('0x1'));function lexResult(_0x35271e,_0xb01b65){return new BPromise(function(_0x457014,_0x114c4b){_0x35271e[_0xfaba('0x2')](_0xb01b65,function(_0x1ffcf4,_0x536264){if(_0x1ffcf4){_0x114c4b(_0x1ffcf4);}if(_0x536264['slots']){for(const _0x19e83c in _0x536264['slots']){if(_0x536264[_0xfaba('0x3')]['hasOwnProperty'](_0x19e83c)){var _0x5c52d9=_0x536264[_0xfaba('0x3')][_0x19e83c];_0x536264['slot_'+_0x19e83c]=_0x5c52d9;}}}_0x457014(_0x536264);});});}module['exports']=function(_0x39a6c7,_0x191619,_0x130ffe,_0x2b435f,_0x1c3dc4,_0x306c89){var _0x3ca0d3=new AWS[(_0xfaba('0x4'))]({'accessKeyId':_0x191619,'secretAccessKey':_0x130ffe,'region':_0x2b435f});var _0x3e2860={'botAlias':_0xfaba('0x5'),'botName':_0x306c89,'inputText':_0x1c3dc4,'userId':_0x39a6c7};return lexResult(_0x3ca0d3,_0x3e2860);}; \ No newline at end of file +var _0xc1b8=['hasOwnProperty','exports','LexRuntime','$LATEST','bluebird','aws-sdk','postText','slots'];(function(_0x3400ca,_0x27c04d){var _0x26e8d1=function(_0x2284e9){while(--_0x2284e9){_0x3400ca['push'](_0x3400ca['shift']());}};_0x26e8d1(++_0x27c04d);}(_0xc1b8,0x164));var _0x8c1b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xc1b8[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0x8c1b('0x0'));var AWS=require(_0x8c1b('0x1'));function lexResult(_0x5a4089,_0x348c79){return new BPromise(function(_0x3852c5,_0x464dc0){_0x5a4089[_0x8c1b('0x2')](_0x348c79,function(_0x4dd899,_0x547233){if(_0x4dd899){_0x464dc0(_0x4dd899);}if(_0x547233['slots']){for(const _0x360521 in _0x547233['slots']){if(_0x547233[_0x8c1b('0x3')][_0x8c1b('0x4')](_0x360521)){var _0xa845ca=_0x547233[_0x8c1b('0x3')][_0x360521];_0x547233['slot_'+_0x360521]=_0xa845ca;}}}_0x3852c5(_0x547233);});});}module[_0x8c1b('0x5')]=function(_0x435319,_0x18e209,_0x228c22,_0x545f98,_0x3b5f51,_0x1c846b){var _0x446f40=new AWS[(_0x8c1b('0x6'))]({'accessKeyId':_0x18e209,'secretAccessKey':_0x228c22,'region':_0x545f98});var _0x416449={'botAlias':_0x8c1b('0x7'),'botName':_0x1c846b,'inputText':_0x3b5f51,'userId':_0x435319};return lexResult(_0x446f40,_0x416449);}; \ 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 1018b7a..b795884 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 _0xa019=['exports','./lib/api'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xa019,0x10d));var _0x9a01=function(_0x22bf2a,_0x501463){_0x22bf2a=_0x22bf2a-0x0;var _0x27b629=_0xa019[_0x22bf2a];return _0x27b629;};'use strict';var polly=require(_0x9a01('0x0'));module[_0x9a01('0x1')]=function(_0xa0f7bf,_0x251e8a,_0x22e484,_0x2100bf,_0x57e18c,_0x247627,_0x1224ae){return polly(_0xa0f7bf,_0x251e8a,_0x22e484,_0x2100bf,_0x57e18c,_0x247627,_0x1224ae);}; \ No newline at end of file +'use strict';var polly=require('./lib/api');module['exports']=function(_0x51e789,_0x240501,_0x4a208e,_0x749520,_0x58aa53,_0x1cb9c0,_0x4c0d2c){return polly(_0x51e789,_0x240501,_0x4a208e,_0x749520,_0x58aa53,_0x1cb9c0,_0x4c0d2c);}; \ 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 38cc42b..1f71d0e 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 _0xeca9=['exports','Polly','text','mp3','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x16b51e,_0x30cb17){var _0x27b91a=function(_0x131411){while(--_0x131411){_0x16b51e['push'](_0x16b51e['shift']());}};_0x27b91a(++_0x30cb17);}(_0xeca9,0x12d));var _0x9eca=function(_0x24f721,_0x5710c6){_0x24f721=_0x24f721-0x0;var _0x22e0e5=_0xeca9[_0x24f721];return _0x22e0e5;};'use strict';var fs=require('fs');var path=require(_0x9eca('0x0'));var BPromise=require('bluebird');var rs=require(_0x9eca('0x1'));var AWS=require(_0x9eca('0x2'));function pollyResult(_0x4c4b5b,_0x2810eb,_0x2124a2){return new BPromise(function(_0x438666,_0x4e6920){_0x4c4b5b[_0x9eca('0x3')](_0x2810eb,function(_0x264b6f,_0x13fe33){if(_0x264b6f){_0x4e6920(_0x264b6f);}else if(_0x13fe33){if(_0x13fe33[_0x9eca('0x4')]instanceof Buffer){fs['writeFile'](_0x2124a2,_0x13fe33['AudioStream'],function(_0x25fa54){if(_0x25fa54){_0x4e6920(_0x25fa54);}else{_0x438666();}});}else{_0x4e6920(new Error(_0x9eca('0x5')));}}else{_0x4e6920(new Error(_0x9eca('0x6')));}});});}module[_0x9eca('0x7')]=function(_0x4ce896,_0x4077db,_0x545ae1,_0x2e8afb,_0x3bd334,_0x13ba4a,_0x1d857a){var _0x4ebe0a=new AWS[(_0x9eca('0x8'))]({'accessKeyId':_0x4ce896,'secretAccessKey':_0x4077db,'region':_0x545ae1});var _0x3785e1={'Text':_0x3bd334,'TextType':_0x13ba4a||_0x9eca('0x9'),'OutputFormat':_0x9eca('0xa'),'VoiceId':_0x2e8afb};return pollyResult(_0x4ebe0a,_0x3785e1,_0x1d857a);}; \ No newline at end of file +var _0x274b=['aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','text','path','randomstring'];(function(_0x435c2c,_0x2678ca){var _0x30795f=function(_0x41d522){while(--_0x41d522){_0x435c2c['push'](_0x435c2c['shift']());}};_0x30795f(++_0x2678ca);}(_0x274b,0xde));var _0xb274=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x274b[_0x618414];return _0x21c19a;};'use strict';var fs=require('fs');var path=require(_0xb274('0x0'));var BPromise=require('bluebird');var rs=require(_0xb274('0x1'));var AWS=require(_0xb274('0x2'));function pollyResult(_0x483368,_0x676104,_0x49fb85){return new BPromise(function(_0x48cebf,_0x2f7a38){_0x483368['synthesizeSpeech'](_0x676104,function(_0x6da195,_0x4d2ed1){if(_0x6da195){_0x2f7a38(_0x6da195);}else if(_0x4d2ed1){if(_0x4d2ed1[_0xb274('0x3')]instanceof Buffer){fs[_0xb274('0x4')](_0x49fb85,_0x4d2ed1[_0xb274('0x3')],function(_0x57c718){if(_0x57c718){_0x2f7a38(_0x57c718);}else{_0x48cebf();}});}else{_0x2f7a38(new Error(_0xb274('0x5')));}}else{_0x2f7a38(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x4d13ff,_0x4ca4be,_0x38c4f7,_0xb9a81e,_0xe6511c,_0x4eae87,_0x4bf032){var _0x4b6356=new AWS['Polly']({'accessKeyId':_0x4d13ff,'secretAccessKey':_0x4ca4be,'region':_0x38c4f7});var _0x3035c4={'Text':_0xe6511c,'TextType':_0x4eae87||_0xb274('0x6'),'OutputFormat':'mp3','VoiceId':_0xb9a81e};return pollyResult(_0x4b6356,_0x3035c4,_0x4bf032);}; \ 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 ce53843..b75b15d 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 _0x32d4=['exports'];(function(_0xfa8472,_0x3c4438){var _0x36e26f=function(_0x1c8d35){while(--_0x1c8d35){_0xfa8472['push'](_0xfa8472['shift']());}};_0x36e26f(++_0x3c4438);}(_0x32d4,0x82));var _0x432d=function(_0x3c8575,_0x34dcd8){_0x3c8575=_0x3c8575-0x0;var _0x52a2b1=_0x32d4[_0x3c8575];return _0x52a2b1;};'use strict';var asr=require('./lib/api');module[_0x432d('0x0')]=function(_0x5d3d4a,_0x3d39aa,_0x4063d6,_0x2a8dfd){return asr(_0x5d3d4a,_0x3d39aa,_0x4063d6);}; \ No newline at end of file +var _0xbfcc=['./lib/api'];(function(_0x1d1e7b,_0xc89492){var _0x3917b5=function(_0x37b0b8){while(--_0x37b0b8){_0x1d1e7b['push'](_0x1d1e7b['shift']());}};_0x3917b5(++_0xc89492);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0xbfcc[_0x5cbf0e];return _0x1c76f8;};'use strict';var asr=require(_0xcbfc('0x0'));module['exports']=function(_0x5c0fe4,_0x1a2fe0,_0x2d1386,_0x72a76d){return asr(_0x5c0fe4,_0x1a2fe0,_0x2d1386);}; \ 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 198e5bb..293db27 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 _0x4ae2=['exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4ae2,0x178));var _0x24ae=function(_0x38eb22,_0x458a8c){_0x38eb22=_0x38eb22-0x0;var _0x49553e=_0x4ae2[_0x38eb22];return _0x49553e;};'use strict';var url=require('url');var BPromise=require(_0x24ae('0x0'));var fs=require('fs');var host=_0x24ae('0x1');module[_0x24ae('0x2')]=function(_0x5f8f81,_0x2a0a08,_0x1a1cfb){return new BPromise(function(_0x4ce93b,_0x6db36a){var _0xaa7c9d;if(typeof _0x5f8f81!==_0x24ae('0x3')||_0x5f8f81[_0x24ae('0x4')]===0x0){return _0x6db36a(_0x24ae('0x5'));}if(typeof _0x2a0a08!==_0x24ae('0x3')||_0x2a0a08[_0x24ae('0x4')]===0x0){return _0x6db36a('key\x20should\x20be\x20a\x20string');}if(typeof _0x1a1cfb!==_0x24ae('0x6')&&(typeof _0x1a1cfb!==_0x24ae('0x3')||_0x1a1cfb[_0x24ae('0x4')]===0x0)){return _0x6db36a(_0x24ae('0x7'));}try{_0xaa7c9d=fs[_0x24ae('0x8')](_0x5f8f81)[_0x24ae('0x9')](_0x24ae('0xa'));}catch(_0x507c2e){return _0x6db36a(_0x507c2e);}return _0x4ce93b({'method':'POST','uri':host+_0x24ae('0xb')+_0x2a0a08,'body':{'config':{'encoding':_0x24ae('0xc'),'sampleRateHertz':_0x24ae('0xd'),'languageCode':_0x1a1cfb},'audio':{'content':_0xaa7c9d}},'json':!![]});});}; \ No newline at end of file +var _0xb642=['lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined'];(function(_0x569231,_0x2c1e64){var _0x7f1ec6=function(_0x1d0a65){while(--_0x1d0a65){_0x569231['push'](_0x569231['shift']());}};_0x7f1ec6(++_0x2c1e64);}(_0xb642,0xd1));var _0x2b64=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xb642[_0x6c993a];return _0x27f547;};'use strict';var url=require(_0x2b64('0x0'));var BPromise=require(_0x2b64('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x414a95,_0x5df32c,_0x296583){return new BPromise(function(_0x2e2168,_0x248fa6){var _0x13eae3;if(typeof _0x414a95!==_0x2b64('0x2')||_0x414a95[_0x2b64('0x3')]===0x0){return _0x248fa6(_0x2b64('0x4'));}if(typeof _0x5df32c!==_0x2b64('0x2')||_0x5df32c[_0x2b64('0x3')]===0x0){return _0x248fa6(_0x2b64('0x5'));}if(typeof _0x296583!==_0x2b64('0x6')&&(typeof _0x296583!==_0x2b64('0x2')||_0x296583['length']===0x0)){return _0x248fa6(_0x2b64('0x7'));}try{_0x13eae3=fs['readFileSync'](_0x414a95)[_0x2b64('0x8')]('base64');}catch(_0x2ddbc5){return _0x248fa6(_0x2ddbc5);}return _0x2e2168({'method':_0x2b64('0x9'),'uri':host+_0x2b64('0xa')+_0x5df32c,'body':{'config':{'encoding':_0x2b64('0xb'),'sampleRateHertz':'8000','languageCode':_0x296583},'audio':{'content':_0x13eae3}},'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 9fa1b93..316381c 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 _0xa9e0=['exports','./asr'];(function(_0x325078,_0x158a4b){var _0xf8338c=function(_0x2aba2c){while(--_0x2aba2c){_0x325078['push'](_0x325078['shift']());}};_0xf8338c(++_0x158a4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};var asr=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'asr':asr}; \ No newline at end of file +var _0x34e8=['./asr','exports'];(function(_0x28678d,_0x54324f){var _0x1643e9=function(_0x873a6c){while(--_0x873a6c){_0x28678d['push'](_0x28678d['shift']());}};_0x1643e9(++_0x54324f);}(_0x34e8,0x12c));var _0x834e=function(_0x229cd2,_0x416351){_0x229cd2=_0x229cd2-0x0;var _0x3e2f8c=_0x34e8[_0x229cd2];return _0x3e2f8c;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 9fb48ab..2e0c782 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 _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(_0x50c440,_0x3cdf32){var _0x1e7400=function(_0xbf686a){while(--_0xbf686a){_0x50c440['push'](_0x50c440['shift']());}};_0x1e7400(++_0x3cdf32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 +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(_0x2da8ee,_0x511a45){var _0x3a0eef=function(_0x3ac6fa){while(--_0x3ac6fa){_0x2da8ee['push'](_0x2da8ee['shift']());}};_0x3a0eef(++_0x511a45);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 7556375..4b3cd2a 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 _0x070b=['./nda','exports'];(function(_0x441307,_0x241821){var _0x22b7f8=function(_0x5ed7d2){while(--_0x5ed7d2){_0x441307['push'](_0x441307['shift']());}};_0x22b7f8(++_0x241821);}(_0x070b,0x124));var _0xb070=function(_0x23f426,_0x464d21){_0x23f426=_0x23f426-0x0;var _0x73f1aa=_0x070b[_0x23f426];return _0x73f1aa;};var nda=require(_0xb070('0x0'));module[_0xb070('0x1')]={'nda':nda}; \ No newline at end of file +var _0x9527=['exports'];(function(_0x28c5d9,_0x5a308d){var _0x5396b5=function(_0x1fff0f){while(--_0x1fff0f){_0x28c5d9['push'](_0x28c5d9['shift']());}};_0x5396b5(++_0x5a308d);}(_0x9527,0xa8));var _0x7952=function(_0x5a4add,_0x4c1e89){_0x5a4add=_0x5a4add-0x0;var _0x333382=_0x9527[_0x5a4add];return _0x333382;};var nda=require('./nda');module[_0x7952('0x0')]={'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 fa58697..7ba68c8 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 _0x8aef=['body','channelData','audio/wav','CustomAction','custom_action','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','exports','resolve','/token','username','then','POST','ndaactivity_type','Nda','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project'];(function(_0x3ef2d8,_0x4fdf2e){var _0x5c86a5=function(_0x29b702){while(--_0x29b702){_0x3ef2d8['push'](_0x3ef2d8['shift']());}};_0x5c86a5(++_0x4fdf2e);}(_0x8aef,0x14c));var _0xf8ae=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x8aef[_0x2283dc];return _0x16db90;};'use strict';var rp=require(_0xf8ae('0x0'));var url=require(_0xf8ae('0x1'));var logger=require(_0xf8ae('0x2'))('agi');module[_0xf8ae('0x3')]=function(_0x574f51,_0x1abbae){var _0x484531={'method':'POST','uri':url[_0xf8ae('0x4')](_0x1abbae['ndauth_url'],_0xf8ae('0x5')),'form':{'grant_type':'password','username':_0x1abbae[_0xf8ae('0x6')],'password':_0x1abbae['password']},'json':!![]};return rp(_0x484531)[_0xf8ae('0x7')](function(_0x1d55ad){var _0x599280={'method':_0xf8ae('0x8'),'uri':url['resolve'](_0x1abbae['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x1abbae[_0xf8ae('0x9')]||'message','channelId':_0xf8ae('0xa'),'conversation':{'id':_0x574f51['uniqueid']},'from':{'id':_0x574f51[_0xf8ae('0xb')],'name':_0x574f51[_0xf8ae('0xc')]},'recipient':{'id':_0x574f51[_0xf8ae('0xd')],'name':_0x574f51[_0xf8ae('0xe')]},'text':_0x1abbae[_0xf8ae('0xf')],'channelData':{}},'headers':{'Authorization':_0xf8ae('0x10')+_0x1d55ad[_0xf8ae('0x11')]},'json':!![]};if(_0x1abbae[_0xf8ae('0x12')]){_0x599280[_0xf8ae('0x13')][_0xf8ae('0x14')]['ProjectName']=_0x1abbae[_0xf8ae('0x12')];}if(_0x1abbae['ndagenerate_audio']=='1'){_0x599280[_0xf8ae('0x13')][_0xf8ae('0x14')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf8ae('0x15')};}if(_0x1abbae['custom_action']){_0x599280[_0xf8ae('0x13')]['channelData'][_0xf8ae('0x16')]=_0x1abbae[_0xf8ae('0x17')];if(_0x1abbae[_0xf8ae('0x18')]){_0x599280[_0xf8ae('0x13')][_0xf8ae('0x14')]['CustomActionData']=_0x1abbae[_0xf8ae('0x18')];}}logger[_0xf8ae('0x19')](JSON[_0xf8ae('0x1a')](_0x599280));return rp(_0x599280);});}; \ No newline at end of file +var _0x997c=['calleridname','dnid','extension','text','access_token','project','body','ProjectName','AudioOutputSettings','audio/wav','custom_action','channelData','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','callerid'];(function(_0xaae5cc,_0x46d786){var _0x236171=function(_0x14a33c){while(--_0x14a33c){_0xaae5cc['push'](_0xaae5cc['shift']());}};_0x236171(++_0x46d786);}(_0x997c,0x14f));var _0xc997=function(_0x59d1be,_0x2ee674){_0x59d1be=_0x59d1be-0x0;var _0x381ad1=_0x997c[_0x59d1be];return _0x381ad1;};'use strict';var rp=require(_0xc997('0x0'));var url=require(_0xc997('0x1'));var logger=require(_0xc997('0x2'))(_0xc997('0x3'));module[_0xc997('0x4')]=function(_0x26d22c,_0x5f4398){var _0x5b22bf={'method':'POST','uri':url[_0xc997('0x5')](_0x5f4398[_0xc997('0x6')],'/token'),'form':{'grant_type':'password','username':_0x5f4398['username'],'password':_0x5f4398[_0xc997('0x7')]},'json':!![]};return rp(_0x5b22bf)['then'](function(_0x6627d4){var _0x5dbe58={'method':'POST','uri':url[_0xc997('0x5')](_0x5f4398[_0xc997('0x8')],_0xc997('0x9')),'body':{'type':_0x5f4398[_0xc997('0xa')]||_0xc997('0xb'),'channelId':'Nda','conversation':{'id':_0x26d22c['uniqueid']},'from':{'id':_0x26d22c[_0xc997('0xc')],'name':_0x26d22c[_0xc997('0xd')]},'recipient':{'id':_0x26d22c[_0xc997('0xe')],'name':_0x26d22c[_0xc997('0xf')]},'text':_0x5f4398[_0xc997('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x6627d4[_0xc997('0x11')]},'json':!![]};if(_0x5f4398[_0xc997('0x12')]){_0x5dbe58[_0xc997('0x13')]['channelData'][_0xc997('0x14')]=_0x5f4398['project'];}if(_0x5f4398['ndagenerate_audio']=='1'){_0x5dbe58[_0xc997('0x13')]['channelData'][_0xc997('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xc997('0x16')};}if(_0x5f4398[_0xc997('0x17')]){_0x5dbe58[_0xc997('0x13')][_0xc997('0x18')][_0xc997('0x19')]=_0x5f4398[_0xc997('0x17')];if(_0x5f4398[_0xc997('0x1a')]){_0x5dbe58['body']['channelData'][_0xc997('0x1b')]=_0x5f4398[_0xc997('0x1a')];}}logger[_0xc997('0x1c')](JSON['stringify'](_0x5dbe58));return rp(_0x5dbe58);});}; \ 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 a1fc934..c1df9de 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 _0x4f2a=['./lib/api','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f2a,0x14e));var _0xa4f2=function(_0x239b31,_0x44a64d){_0x239b31=_0x239b31-0x0;var _0x41c8be=_0x4f2a[_0x239b31];return _0x41c8be;};'use strict';var asr=require(_0xa4f2('0x0'));module[_0xa4f2('0x1')]=function(_0x316768,_0x388e33,_0x15dc85,_0x56a5b4){return asr(_0x316768,_0x388e33,_0x15dc85,_0x56a5b4);}; \ No newline at end of file +var _0x53f0=['exports','./lib/api'];(function(_0x2a94cf,_0x2b970d){var _0x22147f=function(_0xfc71ab){while(--_0xfc71ab){_0x2a94cf['push'](_0x2a94cf['shift']());}};_0x22147f(++_0x2b970d);}(_0x53f0,0x187));var _0x053f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x53f0[_0x3ab51d];return _0x29a04e;};'use strict';var asr=require(_0x053f('0x0'));module[_0x053f('0x1')]=function(_0xaf0159,_0x1e0516,_0x25b143,_0xf5b4b2){return asr(_0xaf0159,_0x1e0516,_0x25b143,_0xf5b4b2);}; \ 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 06a33b2..d0d5913 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 _0x1359=['open','message','lodash','moment','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','transcript','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','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.','error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket'];(function(_0x1af98d,_0x3c608e){var _0x3553ea=function(_0x5668a4){while(--_0x5668a4){_0x1af98d['push'](_0x1af98d['shift']());}};_0x3553ea(++_0x3c608e);}(_0x1359,0xda));var _0x9135=function(_0x36b347,_0x137d9a){_0x36b347=_0x36b347-0x0;var _0x14e123=_0x1359[_0x36b347];return _0x14e123;};'use strict';var BPromise=require('bluebird');var _=require(_0x9135('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x9135('0x1'));var crypto=require(_0x9135('0x2'));var logger=require(_0x9135('0x3'))(_0x9135('0x4'));module['exports']=function(_0x2970b9,_0x54eed8,_0x12ecf1,_0x1e2268){return new BPromise(function(_0x996576,_0x44fc6e){logger[_0x9135('0x5')](_0x9135('0x6'),_0x1e2268||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x15e9de=new WebSocket(_0x1e2268||_0x9135('0x7'),{'perMessageDeflate':![]});var _0x27485f='';var _0x19f0af='0';var _0x3eac16='1';var _0x2e4885='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x90f89f(_0x69db81){var _0x199379=crypto[_0x9135('0x8')]('sha1');_0x199379[_0x9135('0x9')](_0x69db81);return _0x199379[_0x9135('0xa')](_0x9135('0xb'));}function _0x56987e(){try{logger[_0x9135('0x5')](_0x9135('0xc'));var _0x5d1f0e=moment()[_0x9135('0xd')]();var _0x2f2a9e=_0x90f89f(_0x5d1f0e+_0x54eed8+_0x12ecf1);_0x15e9de[_0x9135('0xe')](JSON[_0x9135('0xf')]({'appID':_0x54eed8,'timestamp':_0x5d1f0e,'appKey':_0x2f2a9e}));var _0x30e5ef=fs['createReadStream'](_0x2970b9);_0x30e5ef['on'](_0x9135('0x10'),function(_0x3ce3e1){_0x15e9de['send'](_0x3ce3e1);});_0x30e5ef['on'](_0x9135('0x11'),function(){_0x15e9de['send']('EOS');});}catch(_0x2c86d7){logger['error'](_0x9135('0x12'),JSON[_0x9135('0xf')](_0x2c86d7));_0x15e9de[_0x9135('0x13')]();}}function _0x473b46(_0x2b1ba2){try{if(_0x2b1ba2){var _0x167cf2=JSON[_0x9135('0x14')](_0x2b1ba2);switch(_0x167cf2[_0x9135('0x15')]){case 0x0:if(_0x167cf2['result']){if(_0x167cf2[_0x9135('0x16')][_0x9135('0x17')]){logger[_0x9135('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0x9135('0xf')](_0x167cf2[_0x9135('0x16')][_0x9135('0x18')]));_0x27485f=_0x167cf2[_0x9135('0x16')]['hypotheses'][0x0][_0x9135('0x19')];_0x19f0af=_0x167cf2[_0x9135('0x16')][_0x9135('0x18')][0x0]['likelihood'];_0x3eac16='0';_0x2e4885='Success.';_0x15e9de[_0x9135('0x13')]();}}break;case 0x1:logger[_0x9135('0x5')](_0x9135('0x1a'));_0x3eac16='1';_0x2e4885=_0x9135('0x1a');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x3eac16='2';_0x2e4885=_0x9135('0x1b');break;case 0x9:logger[_0x9135('0x5')](_0x9135('0x1c'));_0x3eac16='9';_0x2e4885=_0x9135('0x1c');break;case 0xa:logger['info'](_0x9135('0x1d'));_0x3eac16='10';_0x2e4885=_0x9135('0x1d');break;case 0xb:logger[_0x9135('0x5')](_0x9135('0x1e'));_0x3eac16='11';_0x2e4885='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x2f5f9e){logger[_0x9135('0x1f')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x9135('0xf')](_0x2f5f9e));_0x15e9de['terminate']();}}function _0xe3d4de(){logger[_0x9135('0x5')](_0x9135('0x20'));_0x996576({'transcript':_0x27485f,'confidence':_0x19f0af,'status':_0x3eac16,'status_message':_0x2e4885});}function _0x169cec(_0x6e3ad4){logger[_0x9135('0x1f')](_0x9135('0x21'));if(!_['isNil'](_0x6e3ad4)){logger[_0x9135('0x1f')](_['isObject'](_0x6e3ad4)?JSON[_0x9135('0xf')](_0x6e3ad4):_0x6e3ad4);}}_0x15e9de['on'](_0x9135('0x22'),_0x56987e);_0x15e9de['on'](_0x9135('0x23'),_0x473b46);_0x15e9de['on'](_0x9135('0x11'),_0xe3d4de);_0x15e9de['on'](_0x9135('0x1f'),_0x169cec);});}; \ No newline at end of file +var _0xc847=['../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc847,0x19f));var _0x7c84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc847[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x7c84('0x0'));var _=require(_0x7c84('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7c84('0x2'));var crypto=require('crypto');var logger=require(_0x7c84('0x3'))(_0x7c84('0x4'));module[_0x7c84('0x5')]=function(_0x220b97,_0x539445,_0x234f5d,_0x3e8c1d){return new BPromise(function(_0x5af30f,_0x515f6e){logger[_0x7c84('0x6')](_0x7c84('0x7'),_0x3e8c1d||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x212a93=new WebSocket(_0x3e8c1d||_0x7c84('0x8'),{'perMessageDeflate':![]});var _0x1edad2='';var _0x37dc41='0';var _0x2f70da='1';var _0x1a0bb5='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x850d19(_0x3c4bfe){var _0x4373e8=crypto['createHash'](_0x7c84('0x9'));_0x4373e8['update'](_0x3c4bfe);return _0x4373e8[_0x7c84('0xa')](_0x7c84('0xb'));}function _0x3ee931(){try{logger[_0x7c84('0x6')](_0x7c84('0xc'));var _0x1c0b5f=moment()[_0x7c84('0xd')]();var _0x3a97f6=_0x850d19(_0x1c0b5f+_0x539445+_0x234f5d);_0x212a93[_0x7c84('0xe')](JSON[_0x7c84('0xf')]({'appID':_0x539445,'timestamp':_0x1c0b5f,'appKey':_0x3a97f6}));var _0x5eb42a=fs['createReadStream'](_0x220b97);_0x5eb42a['on'](_0x7c84('0x10'),function(_0x139e26){_0x212a93[_0x7c84('0xe')](_0x139e26);});_0x5eb42a['on'](_0x7c84('0x11'),function(){_0x212a93['send'](_0x7c84('0x12'));});}catch(_0x13159b){logger[_0x7c84('0x13')](_0x7c84('0x14'),JSON['stringify'](_0x13159b));_0x212a93[_0x7c84('0x15')]();}}function _0x5cb642(_0x3ed6cf){try{if(_0x3ed6cf){var _0x45911b=JSON['parse'](_0x3ed6cf);switch(_0x45911b[_0x7c84('0x16')]){case 0x0:if(_0x45911b[_0x7c84('0x17')]){if(_0x45911b['result'][_0x7c84('0x18')]){logger['info'](_0x7c84('0x19'),JSON[_0x7c84('0xf')](_0x45911b[_0x7c84('0x17')]['hypotheses']));_0x1edad2=_0x45911b[_0x7c84('0x17')][_0x7c84('0x1a')][0x0][_0x7c84('0x1b')];_0x37dc41=_0x45911b[_0x7c84('0x17')][_0x7c84('0x1a')][0x0][_0x7c84('0x1c')];_0x2f70da='0';_0x1a0bb5='Success.';_0x212a93[_0x7c84('0x15')]();}}break;case 0x1:logger[_0x7c84('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x2f70da='1';_0x1a0bb5='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x7c84('0x6')](_0x7c84('0x1d'));_0x2f70da='2';_0x1a0bb5=_0x7c84('0x1d');break;case 0x9:logger[_0x7c84('0x6')](_0x7c84('0x1e'));_0x2f70da='9';_0x1a0bb5=_0x7c84('0x1e');break;case 0xa:logger[_0x7c84('0x6')](_0x7c84('0x1f'));_0x2f70da='10';_0x1a0bb5=_0x7c84('0x1f');break;case 0xb:logger[_0x7c84('0x6')](_0x7c84('0x20'));_0x2f70da='11';_0x1a0bb5='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x2ec8fe){logger[_0x7c84('0x13')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x7c84('0xf')](_0x2ec8fe));_0x212a93[_0x7c84('0x15')]();}}function _0x21f2ce(){logger[_0x7c84('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0x5af30f({'transcript':_0x1edad2,'confidence':_0x37dc41,'status':_0x2f70da,'status_message':_0x1a0bb5});}function _0x43ed0c(_0x571ff9){logger[_0x7c84('0x13')](_0x7c84('0x21'));if(!_[_0x7c84('0x22')](_0x571ff9)){logger[_0x7c84('0x13')](_[_0x7c84('0x23')](_0x571ff9)?JSON['stringify'](_0x571ff9):_0x571ff9);}}_0x212a93['on'](_0x7c84('0x24'),_0x3ee931);_0x212a93['on'](_0x7c84('0x25'),_0x5cb642);_0x212a93['on'](_0x7c84('0x11'),_0x21f2ce);_0x212a93['on'](_0x7c84('0x13'),_0x43ed0c);});}; \ 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 dff00d0..7219baa 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 _0x3e74=['./asr'];(function(_0x1fc831,_0x45692a){var _0xb7690d=function(_0x350b28){while(--_0x350b28){_0x1fc831['push'](_0x1fc831['shift']());}};_0xb7690d(++_0x45692a);}(_0x3e74,0x175));var _0x43e7=function(_0x4408a5,_0x1e874d){_0x4408a5=_0x4408a5-0x0;var _0x45b48f=_0x3e74[_0x4408a5];return _0x45b48f;};var asr=require(_0x43e7('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x70e0=['exports','./asr'];(function(_0x3eb713,_0x437874){var _0x1d7128=function(_0x2b9cea){while(--_0x2b9cea){_0x3eb713['push'](_0x3eb713['shift']());}};_0x1d7128(++_0x437874);}(_0x70e0,0x17b));var _0x070e=function(_0x3dd71c,_0x3d541c){_0x3dd71c=_0x3dd71c-0x0;var _0x235da5=_0x70e0[_0x3dd71c];return _0x235da5;};var asr=require(_0x070e('0x0'));module[_0x070e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 294740f..5ecfb9f 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 _0xc7ea=['E_AGI_SERVER_VOICE_DISABLED','destroy','error','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','inherits','util','net','EventEmitter','./error','./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR'];(function(_0x5c06fe,_0x12193a){var _0xf8ec9a=function(_0x3a7026){while(--_0x3a7026){_0x5c06fe['push'](_0x5c06fe['shift']());}};_0xf8ec9a(++_0x12193a);}(_0xc7ea,0x171));var _0xac7e=function(_0x2ff022,_0x183a9c){_0x2ff022=_0x2ff022-0x0;var _0x1cbaa5=_0xc7ea[_0x2ff022];return _0x1cbaa5;};'use strict';var util=require(_0xac7e('0x0'));var net=require(_0xac7e('0x1'));var EventEmitter=require('events')[_0xac7e('0x2')];var AGIError=require(_0xac7e('0x3'));var AGIChannel=require(_0xac7e('0x4'));var AGIServer=function(_0x52bdd9,_0x55f3a5,_0x134a3d){var _0x39bf60=this,_0x52bdd9=_0x52bdd9||0x11dd,_0x55f3a5=_0x55f3a5||_0xac7e('0x5'),_0x26b1c5=null,_0x45e73f=0x0;EventEmitter[_0xac7e('0x6')](_0x39bf60);function _0x1612f3(){if(!_0x52bdd9){_0x39bf60[_0xac7e('0x7')]('error',new AGIError(_0xac7e('0x8')));return![];}_0x26b1c5=net[_0xac7e('0x9')]();_0x26b1c5[_0xac7e('0xa')](_0x52bdd9,_0x55f3a5);_0x26b1c5['on'](_0xac7e('0xb'),function(){_0x39bf60[_0xac7e('0x7')](_0xac7e('0xb'));});_0x26b1c5['on'](_0xac7e('0xc'),function(_0x240869){_0x26b1c5[_0xac7e('0xd')](function(_0x209e91,_0x404fc0){if(_0x209e91){_0x39bf60[_0xac7e('0x7')]('error',new AGIError(_0xac7e('0xe'),_0x209e91));}else if(_0x134a3d&&_0x134a3d<0x0){_0x39bf60[_0xac7e('0x7')]('error',new AGIError(_0xac7e('0xf')));_0x240869[_0xac7e('0x10')]();}else if(_0x134a3d&&_0x134a3d>0x0&&_0x134a3d<_0x404fc0){_0x45e73f+=0x1;_0x39bf60[_0xac7e('0x7')](_0xac7e('0x11'),new AGIError(_0xac7e('0x12'),_0x45e73f));_0x240869['destroy']();}else{var _0x3486ac=new AGIChannel(_0x240869);_0x3486ac['on'](_0xac7e('0x13'),function(){_0x39bf60[_0xac7e('0x7')](_0xac7e('0xc'),_0x3486ac);});}});});_0x26b1c5['on'](_0xac7e('0x11'),function(_0x232ce5){_0x39bf60[_0xac7e('0x7')](_0xac7e('0x11'),new AGIError('E_AGI_SERVER_ERROR',_0x232ce5[_0xac7e('0x14')]));});_0x26b1c5['on'](_0xac7e('0x15'),function(){_0x39bf60[_0xac7e('0x7')](_0xac7e('0x15'),new AGIError(_0xac7e('0x16')));});}process['nextTick'](function(){_0x1612f3();});};util[_0xac7e('0x17')](AGIServer,EventEmitter);module['exports']=function(_0xba3d01,_0x5e89f1,_0xa048e9){return new AGIServer(_0xba3d01,_0x5e89f1,_0xa048e9);}; \ No newline at end of file +var _0x7c93=['call','error','E_AGI_ARGUMENT_PORT','listen','emit','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','net','EventEmitter','./error','127.0.0.1'];(function(_0x509cd4,_0x20a8bb){var _0x3e424f=function(_0x4e05ad){while(--_0x4e05ad){_0x509cd4['push'](_0x509cd4['shift']());}};_0x3e424f(++_0x20a8bb);}(_0x7c93,0xb9));var _0x37c9=function(_0x1cae5d,_0x4cf08d){_0x1cae5d=_0x1cae5d-0x0;var _0x357425=_0x7c93[_0x1cae5d];return _0x357425;};'use strict';var util=require('util');var net=require(_0x37c9('0x0'));var EventEmitter=require('events')[_0x37c9('0x1')];var AGIError=require(_0x37c9('0x2'));var AGIChannel=require('./channel');var AGIServer=function(_0x12ae04,_0x407b54,_0x3bbccf){var _0x884652=this,_0x12ae04=_0x12ae04||0x11dd,_0x407b54=_0x407b54||_0x37c9('0x3'),_0x6b62ea=null,_0x298fd5=0x0;EventEmitter[_0x37c9('0x4')](_0x884652);function _0x518549(){if(!_0x12ae04){_0x884652['emit'](_0x37c9('0x5'),new AGIError(_0x37c9('0x6')));return![];}_0x6b62ea=net['createServer']();_0x6b62ea[_0x37c9('0x7')](_0x12ae04,_0x407b54);_0x6b62ea['on']('listening',function(){_0x884652[_0x37c9('0x8')](_0x37c9('0x9'));});_0x6b62ea['on'](_0x37c9('0xa'),function(_0x1fa240){_0x6b62ea['getConnections'](function(_0x165174,_0x35a3e5){if(_0x165174){_0x884652[_0x37c9('0x8')](_0x37c9('0x5'),new AGIError(_0x37c9('0xb'),_0x165174));}else if(_0x3bbccf&&_0x3bbccf<0x0){_0x884652[_0x37c9('0x8')](_0x37c9('0x5'),new AGIError(_0x37c9('0xc')));_0x1fa240[_0x37c9('0xd')]();}else if(_0x3bbccf&&_0x3bbccf>0x0&&_0x3bbccf<_0x35a3e5){_0x298fd5+=0x1;_0x884652[_0x37c9('0x8')]('error',new AGIError(_0x37c9('0xe'),_0x298fd5));_0x1fa240[_0x37c9('0xd')]();}else{var _0xcc2a56=new AGIChannel(_0x1fa240);_0xcc2a56['on'](_0x37c9('0xf'),function(){_0x884652[_0x37c9('0x8')]('connection',_0xcc2a56);});}});});_0x6b62ea['on'](_0x37c9('0x5'),function(_0x5c5db4){_0x884652[_0x37c9('0x8')](_0x37c9('0x5'),new AGIError(_0x37c9('0xb'),_0x5c5db4['code']));});_0x6b62ea['on'](_0x37c9('0x10'),function(){_0x884652['emit'](_0x37c9('0x10'),new AGIError(_0x37c9('0x11')));});}process[_0x37c9('0x12')](function(){_0x518549();});};util[_0x37c9('0x13')](AGIServer,EventEmitter);module[_0x37c9('0x14')]=function(_0x81ced5,_0x57e0f0,_0xc63a0){return new AGIServer(_0x81ced5,_0x57e0f0,_0xc63a0);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 03c98e1..6a8b27b 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 _0xf8ed=['no\x20file\x20audio\x20found','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','QUEUE','url','macro','gosub','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','service','host','port','secure','authentication','auth','user','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','getSmsAccount','sms_account_id','sms_text','sendSMS\x20message','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','menu','getdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','isEmpty','lastName','phone','list_id','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','trim','replace','googleTTS','text','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','en-US','model','awsPolly','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_access_key_id','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','clone','isString','replaceAllVariables','split','length','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','delay','add','minutes','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','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','sip_id','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','hasOwnProperty','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','stringify','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','message','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s.%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','continueAt','extension','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','false','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','no\x20find\x20by\x20configured','math','no\x20operation\x20configured','math\x20%s','operation','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block'];(function(_0x408a5b,_0x2ebe32){var _0x4e6a10=function(_0x594cf5){while(--_0x594cf5){_0x408a5b['push'](_0x408a5b['shift']());}};_0x4e6a10(++_0x2ebe32);}(_0xf8ed,0x1e1));var _0xdf8e=function(_0x53cce3,_0x50d245){_0x53cce3=_0x53cce3-0x0;var _0x3f4742=_0xf8ed[_0x53cce3];return _0x3f4742;};'use strict';var fs=require('fs');var path=require(_0xdf8e('0x0'));var util=require(_0xdf8e('0x1'));var _=require('lodash');var sh=require(_0xdf8e('0x2'));var odbc=require(_0xdf8e('0x3'))();var rs=require(_0xdf8e('0x4'));var moment=require(_0xdf8e('0x5'));var Mustache=require(_0xdf8e('0x6'));var logger=require(_0xdf8e('0x7'))(_0xdf8e('0x8'));var config=require(_0xdf8e('0x9'));var scripts=require(_0xdf8e('0xa'));var FILES_PATH='/var/opt/motion2/server/files';var verticesWithRetry=[_0xdf8e('0xb'),_0xdf8e('0xc'),'getsecretdigits'];var AGIVertices=function(_0x2673b0,_0x161305,_0x5e7a8a){this[_0xdf8e('0xd')]=_0x2673b0;this['rpc']=_0x161305;this[_0xdf8e('0xe')]=_0x5e7a8a;};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x10')]=function(_0x53c602,_0x1a9edf){this[_0xdf8e('0x11')][_0xdf8e('0x12')](_0x53c602)[_0xdf8e('0x13')](function(_0x3eb6a0){_0x1a9edf(null,_0x3eb6a0?_0x3eb6a0[_0xdf8e('0x14')]:![]);})[_0xdf8e('0x15')](function(_0x4d781f){_0x1a9edf(_0x4d781f);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x16')]=function(_0x5692fe,_0x195104){this[_0xdf8e('0x11')][_0xdf8e('0x17')](_0x5692fe)[_0xdf8e('0x13')](function(_0x133059){_0x195104(null,_0x133059?_0x133059[_0xdf8e('0x14')]:![]);})[_0xdf8e('0x15')](function(_0x320a9e){_0x195104(_0x320a9e);});};AGIVertices['prototype'][_0xdf8e('0x18')]=function(_0x4bb364,_0x484c39){this['rpc'][_0xdf8e('0x19')](_0x4bb364)[_0xdf8e('0x13')](function(_0x1f34be){_0x484c39(null,_0x1f34be?_0x1f34be[_0xdf8e('0x14')]:![]);})[_0xdf8e('0x15')](function(_0x4d0d0a){_0x484c39(_0x4d0d0a);});};AGIVertices['prototype'][_0xdf8e('0x1a')]=function(_0xa6ed1c,_0x181b4b){this[_0xdf8e('0x11')][_0xdf8e('0x1b')](_0xa6ed1c)[_0xdf8e('0x13')](function(_0x179f59){_0x181b4b(null,_0x179f59?_0x179f59['dsn']:![]);})['catch'](function(_0x2a5a3c){_0x181b4b(_0x2a5a3c);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x1c')]=function(_0x5dd9a4,_0x55fe19){this[_0xdf8e('0x11')][_0xdf8e('0x1d')](_0x5dd9a4)[_0xdf8e('0x13')](function(_0x1e130d){_0x55fe19(null,_0x1e130d?_0x1e130d[_0xdf8e('0x14')]:![]);})[_0xdf8e('0x15')](function(_0x2f20ad){_0x55fe19(_0x2f20ad);});};AGIVertices['prototype'][_0xdf8e('0x1e')]=function(_0xeea0d7,_0x42a5fc){this['rpc'][_0xdf8e('0x1f')](_0xeea0d7)[_0xdf8e('0x13')](function(_0x5864d8){_0x42a5fc(null,_0x5864d8?_0x5864d8[_0xdf8e('0x14')]:![]);})[_0xdf8e('0x15')](function(_0x13530d){_0x42a5fc(_0x13530d);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x20')]=function(_0x6551aa,_0x592198){var _0x414b34=this;this[_0xdf8e('0x11')][_0xdf8e('0x21')](_0x6551aa)[_0xdf8e('0x13')](function(_0x2702a1){_0x592198(null,_0x2702a1?_0x414b34[_0xdf8e('0x22')](_0x2702a1[_0xdf8e('0x23')]):![]);})['catch'](function(_0x3a1dd6){_0x592198(_0x3a1dd6);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x24')]=function(_0x114b0c,_0x181dc9){this[_0xdf8e('0x11')][_0xdf8e('0x25')](_0x114b0c)[_0xdf8e('0x13')](function(_0x49578b){_0x181dc9(null,_0x49578b?_0x49578b:![]);})['catch'](function(_0x408c54){_0x181dc9(_0x408c54);});};AGIVertices['prototype'][_0xdf8e('0x26')]=function(_0x327be1,_0x30bd6c,_0x159ca8){this[_0xdf8e('0xe')][_0xdf8e('0x26')](_0x327be1,_0x30bd6c)['then'](function(){_0x159ca8(null);})['catch'](function(_0x128b19){_0x159ca8(_0x128b19);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x27')]=function(_0x52af7b,_0xada97f){this[_0xdf8e('0x11')][_0xdf8e('0x28')](_0x52af7b)['then'](function(_0xd64f0f){if(_0xd64f0f){if(_0xd64f0f[_0xdf8e('0x29')]){_0xada97f(null,[_0xd64f0f[_0xdf8e('0x2a')]]);}else{_0xada97f(null,_['map'](_0xd64f0f[_0xdf8e('0x2b')],_0xdf8e('0x2a')));}}else{_0xada97f(null,![]);}})[_0xdf8e('0x15')](function(_0x1f0e12){_0xada97f(_0x1f0e12);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x22')]=function(_0x2de88b){return util[_0xdf8e('0x2c')](_0xdf8e('0x2d'),FILES_PATH,_0x2de88b);};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x2e')]=function(_0x2e602d,_0x2ffdbe,_0x4725cd){odbc[_0xdf8e('0x2f')](_0x2e602d,function(_0x3eef9c){if(_0x3eef9c){logger[_0xdf8e('0x30')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x3eef9c);_0x4725cd(_0x3eef9c);}else{logger[_0xdf8e('0x31')](_0xdf8e('0x32'));odbc[_0xdf8e('0x33')](_0x2ffdbe,function(_0x5d81c2,_0x533305){if(_0x5d81c2){logger[_0xdf8e('0x31')](_0xdf8e('0x34'),_0x2ffdbe);_0x4725cd(_0x5d81c2);}else{logger[_0xdf8e('0x31')]('Query\x20executed\x20correctly\x20%s',_0x2ffdbe);odbc[_0xdf8e('0x35')](function(_0x379c1f){if(_0x379c1f){logger[_0xdf8e('0x30')](_0xdf8e('0x36'),_0x379c1f);}_0x4725cd(null,_0x533305);});}});}});};AGIVertices[_0xdf8e('0xf')]['getSmsAccount']=function(_0x31d0b5,_0x12172e){this[_0xdf8e('0x11')][_0xdf8e('0x37')](_0x31d0b5)[_0xdf8e('0x13')](function(_0x4129e2){_0x12172e(null,_0x4129e2?_0x4129e2:![]);})[_0xdf8e('0x15')](function(_0x27099c){_0x12172e(_0x27099c);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x38')]=function(_0x1cdd01,_0x3fcfe9){this[_0xdf8e('0x11')][_0xdf8e('0x38')](_0x1cdd01)[_0xdf8e('0x13')](function(_0x5044c4){_0x3fcfe9(null,_0x5044c4);})[_0xdf8e('0x15')](function(_0x116539){_0x3fcfe9(_0x116539);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x39')]=function(_0x279d1e,_0x3d2304,_0x3764a7){this['rpc'][_0xdf8e('0x39')]({'uniqueid':this[_0xdf8e('0xd')][_0xdf8e('0x3a')],'node':_0x279d1e[_0xdf8e('0x3b')],'application':_0x279d1e[_0xdf8e('0x3c')],'data':_0x3d2304||null,'project_name':this[_0xdf8e('0xd')][_0xdf8e('0x3d')],'callerid':this[_0xdf8e('0xd')][_0xdf8e('0x3e')]})[_0xdf8e('0x13')](function(_0x8c04f3){if(_0x3764a7){_0x3764a7(null,_0x8c04f3);}})[_0xdf8e('0x15')](function(_0x25b21c){if(_0x3764a7){_0x3764a7(_0x25b21c);}});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x3f')]=function(_0x29eade,_0x1ddffe,_0x212e8b,_0x510794){this[_0xdf8e('0x11')][_0xdf8e('0x3f')]({'uniqueid':this[_0xdf8e('0xd')]['uniqueid'],'callerid':this[_0xdf8e('0xd')]['callerid'],'calleridname':this[_0xdf8e('0xd')][_0xdf8e('0x40')],'context':this[_0xdf8e('0xd')][_0xdf8e('0x41')],'extension':this[_0xdf8e('0xd')]['extension'],'priority':this['channel']['priority'],'accountcode':this['channel'][_0xdf8e('0x42')],'dnid':this[_0xdf8e('0xd')][_0xdf8e('0x43')],'projectName':this[_0xdf8e('0xd')]['arg_1'],'saveName':_0x1ddffe,'filename':_0x29eade[_0xdf8e('0x44')]||_0x1ddffe,'savePath':_0x212e8b})['then'](function(_0x450773){_0x510794(null,_0x450773);})[_0xdf8e('0x15')](function(_0x4d42ce){_0x510794(_0x4d42ce);});};AGIVertices[_0xdf8e('0xf')]['createSquareMessage']=function(_0x26072c,_0x441060,_0x3a91ca){this[_0xdf8e('0x11')][_0xdf8e('0x45')]({'uniqueid':this[_0xdf8e('0xd')]['uniqueid'],'body':_0x26072c,'direction':_0x441060})['then'](function(_0x515500){if(_0x3a91ca){_0x3a91ca(null,_0x515500);}})[_0xdf8e('0x15')](function(_0x4951fd){if(_0x3a91ca){_0x3a91ca(_0x4951fd);}});};AGIVertices['prototype'][_0xdf8e('0x46')]=function(_0x3b54dc,_0x50937e){this['rpc'][_0xdf8e('0x46')]({'firstName':_['isEmpty'](_0x3b54dc['name'])||_[_0xdf8e('0x47')](_0x3b54dc['name'])?'callback_'+Math['random']():_0x3b54dc[_0xdf8e('0x14')],'lastName':_[_0xdf8e('0x48')](_0x3b54dc['lastName'])||_[_0xdf8e('0x47')](_0x3b54dc[_0xdf8e('0x49')])?null:_0x3b54dc['lastName'],'phone':_0x3b54dc[_0xdf8e('0x4a')],'ListId':_0x3b54dc[_0xdf8e('0x4b')],'scheduledAt':_0x3b54dc[_0xdf8e('0x4c')],'callbackUniqueid':this[_0xdf8e('0xd')][_0xdf8e('0x3a')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x3b54dc[_0xdf8e('0x4c')][_0xdf8e('0x4d')](),'priority':_0x3b54dc[_0xdf8e('0x4e')]})[_0xdf8e('0x13')](function(_0x12b791){_0x50937e(null,_0x12b791);})[_0xdf8e('0x15')](function(_0x2c8e27){_0x50937e(_0x2c8e27);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x4f')]=function(_0x27087a,_0x2e6142){this['rpc'][_0xdf8e('0x50')](_0x27087a)[_0xdf8e('0x13')](function(_0x43e17a){_0x2e6142(null,_0x43e17a?_0x43e17a['name']:![]);})[_0xdf8e('0x15')](function(_0x1ad00d){_0x2e6142(_0x1ad00d);});};AGIVertices['prototype'][_0xdf8e('0x51')]=function(_0x557311,_0x5bae77,_0x1f87a7){var _0x11e6ba={'role':_0xdf8e('0x52')};_0x11e6ba[_0x557311]=this[_0xdf8e('0xd')]['callerid'];this[_0xdf8e('0x11')][_0xdf8e('0x51')](_0x11e6ba,_0x5bae77,this['channel'][_0xdf8e('0x3a')])['then'](function(_0x460372){_0x1f87a7(null,_[_0xdf8e('0x47')](_0x460372)?![]:!![]);})['catch'](function(_0x5c4637){logger[_0xdf8e('0x30')](_0x5c4637);_0x1f87a7(null,![]);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x53')]=function(_0x44f8b6,_0x7c36f8){var _0x3a18f6={'role':_0xdf8e('0x52')};_0x3a18f6[_0x44f8b6]=this[_0xdf8e('0xd')][_0xdf8e('0x3e')];this['rpc'][_0xdf8e('0x53')](_0x3a18f6)[_0xdf8e('0x13')](function(_0x4772df){_0x7c36f8(null,_[_0xdf8e('0x47')](_0x4772df)?![]:!![]);})['catch'](function(_0x19609e){logger[_0xdf8e('0x30')](_0x19609e);_0x7c36f8(null,![]);});};AGIVertices[_0xdf8e('0xf')]['agentLogout']=function(_0x468df6,_0x12f75a){var _0x533d9e={'role':_0xdf8e('0x52')};_0x533d9e[_0x468df6]=this[_0xdf8e('0xd')][_0xdf8e('0x3e')];this[_0xdf8e('0x11')][_0xdf8e('0x54')](_0x533d9e)[_0xdf8e('0x13')](function(_0x131893){_0x12f75a(null,_[_0xdf8e('0x47')](_0x131893)?![]:!![]);})[_0xdf8e('0x15')](function(_0x2bbcd8){logger[_0xdf8e('0x30')](_0x2bbcd8);_0x12f75a(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x17cd2e,_0x4f4232){var _0x220fdd={'role':_0xdf8e('0x52')};_0x220fdd[_0x17cd2e]=this[_0xdf8e('0xd')][_0xdf8e('0x3e')];var _0x49d3a4=_0x17cd2e!=_0xdf8e('0x55')?util[_0xdf8e('0x2c')](_0xdf8e('0x56'),_0xdf8e('0x57'),this[_0xdf8e('0xd')][_0xdf8e('0x3e')]):undefined;this[_0xdf8e('0x11')][_0xdf8e('0x58')](_0x220fdd,_0x49d3a4)[_0xdf8e('0x13')](function(_0x2b11f5){_0x4f4232(null,_[_0xdf8e('0x47')](_0x2b11f5)?![]:!![]);})['catch'](function(_0x1a1979){logger[_0xdf8e('0x30')](_0x1a1979);_0x4f4232(null,![]);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x59')]=function(_0x547d4c,_0x54f202){sh['exec'](_[_0xdf8e('0x5a')](_0x547d4c),function(_0x2a49fe,_0x2f1e08){var _0x565ddf=_0x2f1e08[_0xdf8e('0x5b')](/(\r\n|\n|\r)/gm,'');_0x54f202(null,_0x565ddf);});};AGIVertices['prototype'][_0xdf8e('0x5c')]=function(_0x55a9a8,_0x13f26d){scripts[_0xdf8e('0x5c')](_0x55a9a8[_0xdf8e('0x5d')],_0x55a9a8[_0xdf8e('0x5e')]||'en',0x1)[_0xdf8e('0x13')](function(_0x1714cb){_0x13f26d(null,_0x1714cb);})[_0xdf8e('0x15')](function(_0x3e58d0){_0x13f26d(_0x3e58d0);});};AGIVertices['prototype'][_0xdf8e('0x5f')]=function(_0x2a2c14,_0x216c1f){scripts[_0xdf8e('0x5f')](this[_0xdf8e('0xd')][_0xdf8e('0x3a')],_0x2a2c14[_0xdf8e('0x60')],_0x2a2c14[_0xdf8e('0x5d')],_0x2a2c14[_0xdf8e('0x61')]||'en')[_0xdf8e('0x13')](function(_0x13045c){_0x216c1f(null,_0x13045c);})['catch'](function(_0x179fce){_0x216c1f(_0x179fce);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x62')]=function(_0x8f9361,_0x595cf6){scripts['sestekNDA'](this[_0xdf8e('0xd')],_0x8f9361)['then'](function(_0x459bfc){_0x595cf6(null,_0x459bfc);})['catch'](function(_0x224aba){_0x595cf6(_0x224aba);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x63')]=function(_0x1588a2,_0x1f0881){scripts[_0xdf8e('0x63')](_0x1588a2[_0xdf8e('0x60')],_0x1588a2[_0xdf8e('0x5d')],_0x1588a2[_0xdf8e('0x64')]||'en-US',_0x1588a2['speed'])[_0xdf8e('0x13')](function(_0x4e605f){_0x1f0881(null,_0x4e605f);})['catch'](function(_0x4c811d){_0x1f0881(_0x4c811d);});};AGIVertices['prototype'][_0xdf8e('0x65')]=function(_0x234636,_0xd1396e,_0x236625){scripts[_0xdf8e('0x65')](_0xd1396e,_0x234636[_0xdf8e('0x60')],_0x234636[_0xdf8e('0x66')]||_0xdf8e('0x67'),this['isConfigured'](_0x234636[_0xdf8e('0x68')])?_0x234636[_0xdf8e('0x68')]:undefined)[_0xdf8e('0x13')](function(_0x5a3e63){_0x236625(null,_0x5a3e63);})[_0xdf8e('0x15')](function(_0x4f7355){_0x236625(_0x4f7355);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x69')]=function(_0x18c31e,_0x217f83){scripts[_0xdf8e('0x69')](_0x18c31e['aws_access_key_id'],_0x18c31e[_0xdf8e('0x6a')],_0x18c31e[_0xdf8e('0x6b')],_0x18c31e['aws_polly_voice']||_0xdf8e('0x6c'),_0x18c31e[_0xdf8e('0x5d')],_0x18c31e[_0xdf8e('0x6d')]||_0xdf8e('0x5d'))['then'](function(_0x11d832){_0x217f83(null,_0x11d832);})[_0xdf8e('0x15')](function(_0x2af184){_0x217f83(_0x2af184);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x6e')]=function(_0x5598eb,_0x2f384a){scripts['awsLex'](this[_0xdf8e('0xd')][_0xdf8e('0x3a')],_0x5598eb[_0xdf8e('0x6f')],_0x5598eb['aws_secret_access_key'],_0x5598eb['aws_lex_region'],_0x5598eb[_0xdf8e('0x5d')],_0x5598eb['aws_bot_name'])[_0xdf8e('0x13')](function(_0x5337c7){_0x2f384a(null,_0x5337c7);})['catch'](function(_0x1cacb1){_0x2f384a(_0x1cacb1);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x70')]=function(_0x5e926b,_0x5e893f,_0x3fcbae){scripts[_0xdf8e('0x70')](_0x5e893f,_0x5e926b[_0xdf8e('0x60')],_0x5e926b[_0xdf8e('0x71')]||_0xdf8e('0x67'))[_0xdf8e('0x13')](function(_0x390e16){_0x3fcbae(null,_0x390e16);})['catch'](function(_0x3413c7){_0x3fcbae(_0x3413c7);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x72')]=function(_0x30c176,_0x4eeb2e,_0x134e00){scripts[_0xdf8e('0x72')](_0x4eeb2e,_0x30c176[_0xdf8e('0x73')],_0x30c176[_0xdf8e('0x74')],_0x30c176[_0xdf8e('0x75')])[_0xdf8e('0x13')](function(_0x40bb79){_0x134e00(null,_0x40bb79);})['catch'](function(_0x4c976a){_0x134e00(_0x4c976a);});};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x76')]=function(_0x325db7){var _0x5a91e3=_[_0xdf8e('0x77')](verticesWithRetry,_0x325db7[_0xdf8e('0x3c')])?_0x325db7:_[_0xdf8e('0x78')](_0x325db7);for(var _0x5a63fa in _0x5a91e3){if(_0x5a91e3['hasOwnProperty'](_0x5a63fa)){if(_0x5a91e3[_0x5a63fa]&&_[_0xdf8e('0x79')](_0x5a91e3[_0x5a63fa])){_0x5a91e3[_0x5a63fa]=this['replaceAllVariables'](_0x5a91e3[_0x5a63fa]);}}}return _0x5a91e3;};AGIVertices['prototype'][_0xdf8e('0x7a')]=function(_0x52fb27){var _0x10496d=_0x52fb27[_0xdf8e('0x7b')]('{');for(var _0xaea235=0x1;_0xaea235<_0x10496d[_0xdf8e('0x7c')];_0xaea235+=0x1){var _0x2f484a=_0x10496d[_0xaea235][_0xdf8e('0x7b')]('}');if(_0x2f484a['length']>0x1){_0x52fb27=_0x52fb27[_0xdf8e('0x7d')]('{'+_0x2f484a[0x0]+'}',this[_0xdf8e('0xd')][_0xdf8e('0x10')](_0x2f484a[0x0])[_0xdf8e('0x7e')]||_0x2f484a[0x0]);}}if(_0x10496d[_0xdf8e('0x7c')]===0x1){return _0x52fb27[_0xdf8e('0x4d')]();}return this['replaceAllVariables'](_0x52fb27);};AGIVertices['prototype'][_0xdf8e('0x7f')]=function(_0x9be5e5,_0x235a9a){var _0x100ecc=this[_0xdf8e('0xd')][_0xdf8e('0x10')](_0x9be5e5);if(_0x100ecc[_0xdf8e('0x80')]===-0x1){return _0x100ecc;}logger[_0xdf8e('0x31')](util['format'](_0xdf8e('0x81'),_0x235a9a,_0x100ecc[_0xdf8e('0x7e')]));return this[_0xdf8e('0xd')][_0xdf8e('0x82')](_0x235a9a,_0x100ecc['extra']);};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x83')]=function(_0x5551fc){return _0x5551fc&&_0x5551fc!=='0'&&_0x5551fc!=='-1'&&_0x5551fc!=='';};AGIVertices['prototype'][_0xdf8e('0x84')]=function(_0x37b40a){this[_0xdf8e('0x39')][_0xdf8e('0x85')](this,_0x37b40a,'-');_0x37b40a[_0xdf8e('0x86')]=_0x37b40a[_0xdf8e('0x84')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x8')]=function(_0x25b42f){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x87'),_0x25b42f[_0xdf8e('0x3b')]));return this[_0xdf8e('0xd')][_0xdf8e('0x8')]([_0x25b42f[_0xdf8e('0x88')],_0x25b42f[_0xdf8e('0x89')]]);};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x8a')]=function(_0x295e9d){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x295e9d[_0xdf8e('0x3b')]));if(this[_0xdf8e('0x83')](_0x295e9d[_0xdf8e('0x8b')])){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x8c'),_0x295e9d[_0xdf8e('0x8b')]));var _0x4dd4b5=this['channel'][_0xdf8e('0x8d')](_0x295e9d['timeout']);if(_0x4dd4b5['result']===-0x1){return _0x4dd4b5;}}return this[_0xdf8e('0xd')][_0xdf8e('0x8a')]();};AGIVertices[_0xdf8e('0xf')]['callback']=function(_0x18e6cf){logger[_0xdf8e('0x31')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x18e6cf['label']));if(!this[_0xdf8e('0x83')](_0x18e6cf['list_id'])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x18e6cf,_0xdf8e('0x8e'));}_0x18e6cf[_0xdf8e('0x4c')]=moment();if(this['isConfigured'](_0x18e6cf[_0xdf8e('0x8f')])){_0x18e6cf['scheduledAt']=moment()[_0xdf8e('0x90')](_0x18e6cf[_0xdf8e('0x8f')],_0xdf8e('0x91'));}if(!this[_0xdf8e('0x83')](_0x18e6cf[_0xdf8e('0x4e')])){_0x18e6cf[_0xdf8e('0x4e')]=0x2;}this[_0xdf8e('0x46')][_0xdf8e('0x85')](this,_0x18e6cf);return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x93'),_0x18e6cf[_0xdf8e('0x4a')],_0x18e6cf[_0xdf8e('0x4b')],_0x18e6cf[_0xdf8e('0x4c')]));};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x94')]=function(_0x1c8a06){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x95'),_0x1c8a06[_0xdf8e('0x3b')]));var _0x3ab834=this['channel']['exec'](_0x1c8a06[_0xdf8e('0x96')],_0x1c8a06[_0xdf8e('0x97')]);if(_0x3ab834['result']===-0x1){return _0x3ab834;}return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x98'),_0x1c8a06[_0xdf8e('0x96')],_0x1c8a06[_0xdf8e('0x97')]));};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x99')]=function(_0x919181){logger['info'](util[_0xdf8e('0x2c')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x919181['label']));if(!this['isConfigured'](_0x919181[_0xdf8e('0x5d')])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')]('no\x20text\x20configured');}var _0x4d58de='\x22'+_0x919181[_0xdf8e('0x5d')]+'\x22';if(this[_0xdf8e('0x83')](_0x919181[_0xdf8e('0x97')])){_0x4d58de+=','+_0x919181[_0xdf8e('0x97')];}var _0x236f05=this[_0xdf8e('0xd')][_0xdf8e('0x9a')](_0xdf8e('0x9b'),_0x4d58de);if(_0x236f05[_0xdf8e('0x80')]===-0x1){return _0x236f05;}return this[_0xdf8e('0xd')]['noop'](util['format'](_0xdf8e('0x9c'),_0x4d58de));};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x9d')]=function(_0xd3d162){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0xd3d162[_0xdf8e('0x3b')]));if(!this[_0xdf8e('0x83')](_0xd3d162['text'])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0x9e'));}var _0x1c7f4b='\x22'+_0xd3d162[_0xdf8e('0x5d')]+'\x22';if(this[_0xdf8e('0x83')](_0xd3d162['options'])){_0x1c7f4b+=','+_0xd3d162['options'];}var _0x483533=this['channel']['exec'](_0xdf8e('0x9b'),_0x1c7f4b);if(_0x483533[_0xdf8e('0x80')]===-0x1){return _0x483533;}return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x9c'),_0x1c7f4b));};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x9f')]=function(_0x29c7ee){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0xa0'),_0x29c7ee[_0xdf8e('0x3b')]));if(!this[_0xdf8e('0x83')](_0x29c7ee[_0xdf8e('0xa1')])){return this[_0xdf8e('0xd')]['noop'](_0xdf8e('0xa2'));}var _0x365f4c=_0x29c7ee[_0xdf8e('0xa1')];if(this[_0xdf8e('0x83')](_0x29c7ee['options'])){_0x365f4c+=','+_0x29c7ee[_0xdf8e('0x97')];}var _0x391e02=this[_0xdf8e('0xd')][_0xdf8e('0x9a')](_0xdf8e('0xa3'),_0x365f4c);if(_0x391e02[_0xdf8e('0x80')]===-0x1){return _0x391e02;}var _0x276829=this[_0xdf8e('0x7f')](_0xdf8e('0xa4'),_0xdf8e('0xa5'));if(_0x276829[_0xdf8e('0x80')]===-0x1){return _0x276829;}var _0x3ae111=this['getAndSetVariable'](_0xdf8e('0xa6'),_0xdf8e('0xa7'));if(_0x3ae111[_0xdf8e('0x80')]===-0x1){return _0x3ae111;}var _0x5867a3=this[_0xdf8e('0x7f')](_0xdf8e('0xa8'),_0xdf8e('0xa9'));if(_0x5867a3['result']===-0x1){return _0x5867a3;}return this['channel'][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0xaa'),_0x365f4c));};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0xab')]=function(_0x3aaa78){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0xac'),_0x3aaa78[_0xdf8e('0x3b')]));if(!this['isConfigured'](_0x3aaa78[_0xdf8e('0xa1')])){return this[_0xdf8e('0xd')]['noop']('no\x20grammar\x20configured');}var _0x49cc3c=_0x3aaa78['grammar'];if(this[_0xdf8e('0x83')](_0x3aaa78[_0xdf8e('0x97')])){_0x49cc3c+=','+_0x3aaa78[_0xdf8e('0x97')];}var _0x56819d=this[_0xdf8e('0xd')]['exec']('MRCPRecog',_0x49cc3c);if(_0x56819d[_0xdf8e('0x80')]===-0x1){return _0x56819d;}var _0x14b1a9=this['getAndSetVariable'](_0xdf8e('0xa4'),_0xdf8e('0xad'));if(_0x14b1a9[_0xdf8e('0x80')]===-0x1){return _0x14b1a9;}var _0x1a5ddf=this[_0xdf8e('0x7f')](_0xdf8e('0xa6'),_0xdf8e('0xae'));if(_0x1a5ddf[_0xdf8e('0x80')]===-0x1){return _0x1a5ddf;}var _0xd03aaf=this[_0xdf8e('0x7f')](_0xdf8e('0xa8'),_0xdf8e('0xaf'));if(_0xd03aaf[_0xdf8e('0x80')]===-0x1){return _0xd03aaf;}return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')]('Executed\x20command\x20MRCPRecog\x20%s',_0x49cc3c));};AGIVertices['prototype']['database']=function(_0x467adf){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x467adf[_0xdf8e('0x3b')]));if(!this[_0xdf8e('0x83')](_0x467adf['odbc_id'])){return this['channel']['error'](_0x467adf,'no\x20database\x20selected');}var _0x593379=this[_0xdf8e('0x1a')][_0xdf8e('0x85')](this,_0x467adf[_0xdf8e('0xb0')]);if(!_0x593379){return this['channel'][_0xdf8e('0x30')](_0x467adf,_0xdf8e('0xb1'));}if(!this[_0xdf8e('0x83')](_0x467adf[_0xdf8e('0x33')])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x467adf,_0xdf8e('0xb2'));}var _0x3c975a=_0x467adf[_0xdf8e('0x33')][_0xdf8e('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0xb3'),_0x3c975a));var _0x5aea46=this[_0xdf8e('0x2e')]['sync'](this,_0x593379,_0x3c975a);this['createSquareDetailsReport'][_0xdf8e('0x85')](this,_0x467adf,_0x3c975a);if(!this[_0xdf8e('0x83')](_0x467adf[_0xdf8e('0xb4')])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0xb5'));}var _0x2fc3cd=this[_0xdf8e('0x10')]['sync'](this,_0x467adf[_0xdf8e('0xb4')]);if(!_0x2fc3cd){return this['channel'][_0xdf8e('0x30')](_0x467adf,_0xdf8e('0xb6'));}var _0x5c384c=this;_0x5aea46[_0xdf8e('0xb7')](function(_0x16b7f5,_0x5dfb84){Object[_0xdf8e('0xb8')](_0x16b7f5)['forEach'](function(_0x6409a8){_0x5c384c[_0xdf8e('0xd')][_0xdf8e('0x82')](util[_0xdf8e('0x2c')](_0xdf8e('0xb9'),_0x2fc3cd,_0x5dfb84,_0x6409a8),_0x16b7f5[_0x6409a8]);});});this['channel'][_0xdf8e('0x82')](util[_0xdf8e('0x2c')](_0xdf8e('0xba'),_0x2fc3cd),_0x5aea46[_0xdf8e('0x7c')]);return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0xbb'),_0x2fc3cd));};AGIVertices[_0xdf8e('0xf')]['dial']=function(_0x14a40d){logger[_0xdf8e('0xbc')](util[_0xdf8e('0x2c')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x14a40d[_0xdf8e('0x3b')]));if(!this['isConfigured'](_0x14a40d[_0xdf8e('0xbd')])){return this['channel'][_0xdf8e('0x30')](_0x14a40d,'no\x20user\x20selected');}var _0x7eade6=this[_0xdf8e('0x1c')][_0xdf8e('0x85')](this,_0x14a40d[_0xdf8e('0xbd')]);if(!_0x7eade6){return this['channel'][_0xdf8e('0x30')](_0x14a40d,'no\x20user\x20found');}var _0x466951=this['channel'][_0xdf8e('0x9a')](_0xdf8e('0xbe'),[util[_0xdf8e('0x2c')](_0xdf8e('0xbf'),_0x7eade6),_0x14a40d[_0xdf8e('0x8b')],_0x14a40d[_0xdf8e('0xc0')],_0x14a40d['url']]);if(_0x466951[_0xdf8e('0x80')]===-0x1){return _0x466951;}return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util['format'](_0xdf8e('0xc1'),_0xdf8e('0xbe')));};AGIVertices['prototype'][_0xdf8e('0xc2')]=function(_0x5c42b5){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0xc3'),_0x5c42b5[_0xdf8e('0x3b')]));if(!this[_0xdf8e('0x83')](_0x5c42b5[_0xdf8e('0x60')])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')]('no\x20key\x20configured');}if(!this[_0xdf8e('0x83')](_0x5c42b5['text'])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0x9e'));}this[_0xdf8e('0xd')][_0xdf8e('0xc4')]=!![];this[_0xdf8e('0x39')](_0x5c42b5);this['createSquareMessage'](_0x5c42b5['text'],'in');this[_0xdf8e('0xd')]['noop'](util[_0xdf8e('0x2c')](_0xdf8e('0xc5'),_0x5c42b5['text']));var _0x14d946=this[_0xdf8e('0x5f')][_0xdf8e('0x85')](this,_0x5c42b5);if(_0x14d946){for(var _0x22bef5 in _0x14d946){if(_0x14d946[_0xdf8e('0xc6')](_0x22bef5)){this['channel'][_0xdf8e('0x82')](util[_0xdf8e('0x2c')]('DIALOGFLOW_%s',_0x22bef5[_0xdf8e('0xc7')]()),_0x14d946[_0x22bef5]);}}this['createSquareMessage'](_0x14d946[_0xdf8e('0xc8')],_0xdf8e('0xc9'));return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util['format'](_0xdf8e('0xca'),_0x14d946[_0xdf8e('0xc8')]));}return this[_0xdf8e('0xd')]['error'](_0x5c42b5,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xdf8e('0xf')]['sesteknda']=function(_0x53e4e0){logger['info'](util[_0xdf8e('0x2c')](_0xdf8e('0xcb'),_0x53e4e0[_0xdf8e('0x3b')]));if(!this[_0xdf8e('0x83')](_0x53e4e0[_0xdf8e('0xcc')])){return this['channel'][_0xdf8e('0x92')](_0xdf8e('0xcd'));}if(!this[_0xdf8e('0x83')](_0x53e4e0['username'])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0xce'));}if(!this[_0xdf8e('0x83')](_0x53e4e0[_0xdf8e('0xcf')])){return this['channel']['noop'](_0xdf8e('0xd0'));}if(!this[_0xdf8e('0x83')](_0x53e4e0[_0xdf8e('0xd1')])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0x9e'));}this[_0xdf8e('0xd')][_0xdf8e('0xc4')]=!![];this[_0xdf8e('0x39')](_0x53e4e0);this['createSquareMessage'](_0x53e4e0[_0xdf8e('0x5d')],'in');this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0xd2'),_0x53e4e0[_0xdf8e('0x5d')]));var _0x4e3fec=this[_0xdf8e('0x62')][_0xdf8e('0x85')](this,_0x53e4e0);if(_0x4e3fec){for(var _0x1a9ebe in _0x4e3fec){if(_0x4e3fec[_0xdf8e('0xc6')](_0x1a9ebe)){this[_0xdf8e('0xd')][_0xdf8e('0x82')](util[_0xdf8e('0x2c')]('SESTEK_NDA_%s',_0x1a9ebe[_0xdf8e('0xc7')]()),_0x4e3fec[_0x1a9ebe]);}}this[_0xdf8e('0x45')](_0x4e3fec[_0xdf8e('0xc8')],_0xdf8e('0xc9'));if(_0x4e3fec[_0xdf8e('0xd3')]){this['channel']['noop'](util[_0xdf8e('0x2c')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x4e3fec[_0xdf8e('0xd3')]));var _0x2b5d41=this[_0xdf8e('0xd')][_0xdf8e('0xd4')](_0x4e3fec[_0xdf8e('0xd3')]);try{fs[_0xdf8e('0xd5')](_0x4e3fec['audiofile']+_0xdf8e('0xd6'));}catch(_0x1b9612){logger[_0xdf8e('0x30')](_0x1b9612);}return _0x2b5d41;}else{return this['channel']['noop'](util[_0xdf8e('0x2c')](_0xdf8e('0xd7'),_0x4e3fec[_0xdf8e('0xc8')]));}}return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x53e4e0,_0xdf8e('0xd8'));};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0xd9')]=function(_0x5ef190){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0xda'),_0x5ef190[_0xdf8e('0x3b')]));return this['channel'][_0xdf8e('0x92')]('end');};AGIVertices['prototype'][_0xdf8e('0xdb')]=function(_0x3450e0){logger[_0xdf8e('0x31')](util['format'](_0xdf8e('0xdc'),_0x3450e0[_0xdf8e('0x3b')]));var _0xd88f00='';if(_0x3450e0['trunk_id']){if(!this[_0xdf8e('0x83')](_0x3450e0[_0xdf8e('0xdd')])){return this[_0xdf8e('0xd')]['error'](_0x3450e0,_0xdf8e('0xde'));}else{var _0x34626d=parseInt(_0x3450e0[_0xdf8e('0xdd')],0xa);if(isNaN(_0x34626d)){_0xd88f00=_0x3450e0['trunk_id'];}else{_0xd88f00=this['getTrunk']['sync'](this,_0x3450e0[_0xdf8e('0xdd')]);if(!_0xd88f00){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x3450e0,_0xdf8e('0xdf'));}}}}else if(_0x3450e0[_0xdf8e('0xe0')]){_0xd88f00=_0x3450e0['trunk_name'];}else{return this[_0xdf8e('0xd')]['error'](_0x3450e0,_0xdf8e('0xde'));}var _0x15ad0d=this[_0xdf8e('0xd')][_0xdf8e('0x9a')]('DIAL',[util[_0xdf8e('0x2c')](_0xdf8e('0xe1'),_0xd88f00,_0x3450e0[_0xdf8e('0x4a')]),_0x3450e0[_0xdf8e('0x8b')],_0x3450e0[_0xdf8e('0xc0')],_0x3450e0['url']]);if(_0x15ad0d[_0xdf8e('0x80')]===-0x1){return _0x15ad0d;}return this[_0xdf8e('0xd')]['noop'](util[_0xdf8e('0x2c')](_0xdf8e('0xc1'),'DIAL'));};AGIVertices['prototype'][_0xdf8e('0xe2')]=function(_0x31ab2a){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x31ab2a[_0xdf8e('0x3b')]));return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0xe2'));};AGIVertices[_0xdf8e('0xf')]['getdigits']=function(_0x2fa44a){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0xe3'),_0x2fa44a[_0xdf8e('0x3b')]));if(_0x2fa44a[_0xdf8e('0x86')]===0x0){return this[_0xdf8e('0x84')](_0x2fa44a);}_0x2fa44a[_0xdf8e('0x86')]-=0x1;if(!this['isConfigured'](_0x2fa44a[_0xdf8e('0xe4')])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x2fa44a,_0xdf8e('0xe5'));}var _0x35cdc1=this['getSound'][_0xdf8e('0x85')](this,_0x2fa44a[_0xdf8e('0xe4')]);if(!_0x35cdc1){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x2fa44a,'no\x20file\x20audio\x20found');}if(!this[_0xdf8e('0x83')](_0x2fa44a[_0xdf8e('0xb4')])){return this[_0xdf8e('0xd')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x341a95=this[_0xdf8e('0xd')][_0xdf8e('0xe6')](_0x35cdc1,_0x2fa44a[_0xdf8e('0xe7')],_0x2fa44a[_0xdf8e('0xe8')]);var _0x50d559=_0x341a95['result']?_0x341a95[_0xdf8e('0x80')][_0xdf8e('0x4d')]():'';logger['info'](_0xdf8e('0xe9'),JSON[_0xdf8e('0xea')](_0x341a95));if(_0x341a95[_0xdf8e('0x80')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x2fa44a,_0x50d559);return _0x341a95;}else if(_0x341a95[_0xdf8e('0x7e')]===_0xdf8e('0x8b')){_0x341a95['result']=_0x50d559[_0xdf8e('0x7c')]>=parseInt(_0x2fa44a['mindigit'])?'x':'i';}else{_0x341a95[_0xdf8e('0x80')]=_0x50d559['length']>=parseInt(_0x2fa44a[_0xdf8e('0xeb')])&&_0x50d559['length']<=parseInt(_0x2fa44a[_0xdf8e('0xe8')])?'x':'i';}var _0x1d37bc=this[_0xdf8e('0x10')]['sync'](this,_0x2fa44a['variable_id']);if(!_0x1d37bc){return this[_0xdf8e('0xd')]['error'](_0x2fa44a,_0xdf8e('0xb6'));}this[_0xdf8e('0xd')]['setVariable'](_0x1d37bc,_0x50d559);if(this[_0xdf8e('0x83')](_0x2fa44a['hiddendigitsnum'])){var _0x4fd021=parseInt(_0x2fa44a[_0xdf8e('0xec')],0xa);var _0x3e9a0a=rs[_0xdf8e('0xed')]({'charset':'*','length':_0x4fd021});var _0x413ad1=_0x50d559[_0xdf8e('0x7c')];if(_0x413ad1>0x0){if(_0x413ad1>_0x4fd021){this[_0xdf8e('0x39')][_0xdf8e('0x85')](this,_0x2fa44a,_0x2fa44a[_0xdf8e('0xee')]===_0xdf8e('0xef')?_0x3e9a0a+_0x50d559[_0xdf8e('0xf0')](_0x4fd021):_0x50d559[_0xdf8e('0xf0')](0x0,_0x413ad1-_0x4fd021)+_0x3e9a0a);}else{this[_0xdf8e('0x39')]['sync'](this,_0x2fa44a,rs['generate']({'charset':'*','length':_0x413ad1}));}}else{this[_0xdf8e('0x39')][_0xdf8e('0x85')](this,_0x2fa44a,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x2fa44a,_0x50d559);}return _0x341a95;};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0xf1')]=function(_0x21cabf){logger['info'](util['format'](_0xdf8e('0xf2'),_0x21cabf[_0xdf8e('0x3b')]));return this[_0xdf8e('0xc')](_0x21cabf);};AGIVertices['prototype']['goal']=function(_0x4cdd3d){logger[_0xdf8e('0x31')](util['format'](_0xdf8e('0xf3'),_0x4cdd3d[_0xdf8e('0x3b')]));this[_0xdf8e('0x39')]['sync'](this,_0x4cdd3d,_0x4cdd3d[_0xdf8e('0xf4')]);return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0xf5'),_0x4cdd3d[_0xdf8e('0xf4')]));};AGIVertices['prototype']['awspolly']=function(_0x4326b0){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0xf6'),_0x4326b0['label']));if(!this[_0xdf8e('0x83')](_0x4326b0[_0xdf8e('0x6f')])||!this[_0xdf8e('0x83')](_0x4326b0[_0xdf8e('0x6a')])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0xf7'));}if(!this['isConfigured'](_0x4326b0['text'])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0x9e'));}this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')]('Trying\x20aws\x20Polly\x20%s',_0x4326b0['text']));var _0x3ede0=this['awsPolly'][_0xdf8e('0x85')](this,_0x4326b0);if(_0x3ede0){this[_0xdf8e('0xd')]['noop'](util[_0xdf8e('0x2c')]('aws\x20Polly\x20%s\x20file\x20created',_0x3ede0));var _0x4cd0b6=this[_0xdf8e('0xd')][_0xdf8e('0xd4')](_0x3ede0);try{fs['unlink'](_0x3ede0+'.wav');}catch(_0x2ddb60){logger[_0xdf8e('0x30')](_0x2ddb60);}return _0x4cd0b6;}return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x4326b0,_0xdf8e('0xf8'));};AGIVertices['prototype'][_0xdf8e('0xf9')]=function(_0x3692ca){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0xfa'),_0x3692ca[_0xdf8e('0x3b')]));if(!this['isConfigured'](_0x3692ca[_0xdf8e('0x6f')])||!this[_0xdf8e('0x83')](_0x3692ca[_0xdf8e('0x6a')])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x3692ca['aws_bot_name'])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0xfb'));}if(!this[_0xdf8e('0x83')](_0x3692ca[_0xdf8e('0x5d')])){return this['channel'][_0xdf8e('0x92')](_0xdf8e('0x9e'));}this[_0xdf8e('0xd')][_0xdf8e('0xc4')]=!![];this[_0xdf8e('0x39')](_0x3692ca);this['createSquareMessage'](_0x3692ca[_0xdf8e('0x5d')],'in');this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0xfc'),_0x3692ca['text']));var _0x66f59d=this[_0xdf8e('0x6e')][_0xdf8e('0x85')](this,_0x3692ca);if(_0x66f59d){for(var _0x42df67 in _0x66f59d){if(_0x66f59d[_0xdf8e('0xc6')](_0x42df67)&&_[_0xdf8e('0x79')](_0x66f59d[_0x42df67])){this[_0xdf8e('0xd')][_0xdf8e('0x82')](util['format'](_0xdf8e('0xfd'),_0x42df67['toUpperCase']()),_0x66f59d[_0x42df67]);}}if(_[_0xdf8e('0x47')](_0x66f59d['message'])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0xfe'));}else{this[_0xdf8e('0x45')](_0x66f59d[_0xdf8e('0xff')],'out');return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')]('Amazon\x20Lex\x20Result\x20%s',_0x66f59d[_0xdf8e('0xff')]));}}return this['channel'][_0xdf8e('0x30')](_0x3692ca,_0xdf8e('0x100'));};AGIVertices['prototype'][_0xdf8e('0x101')]=function(_0x41e09f){logger['info'](util['format'](_0xdf8e('0x102'),_0x41e09f['label'],_0x41e09f[_0xdf8e('0x8b')]));if(!this[_0xdf8e('0x83')](_0x41e09f[_0xdf8e('0x60')])){return this['channel'][_0xdf8e('0x92')](_0xdf8e('0x103'));}var _0xbdfb4f=_0xdf8e('0x104');var _0x4ec0a0=util[_0xdf8e('0x2c')]('%s/recordings/%s',FILES_PATH,rs[_0xdf8e('0xed')](0x4));var _0x55a3e0=util[_0xdf8e('0x2c')](_0xdf8e('0x105'),_0x4ec0a0,_0xbdfb4f);var _0x5b8745=!![];if(_0x41e09f['beep']===_0xdf8e('0x106')){_0x5b8745=![];}var _0x307c66=this['channel'][_0xdf8e('0x107')](_0x4ec0a0,_0xbdfb4f,_0x41e09f[_0xdf8e('0x108')],_0x41e09f['timeout'],undefined,_0x5b8745);if(_0x307c66[_0xdf8e('0x80')]!==-0x1){this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x109'),_0x55a3e0));var _0x1308af=this[_0xdf8e('0x70')][_0xdf8e('0x85')](this,_0x41e09f,_0x55a3e0);if(_0x1308af){for(var _0x5117a7 in _0x1308af){if(_0x1308af[_0xdf8e('0xc6')](_0x5117a7)){this[_0xdf8e('0xd')][_0xdf8e('0x82')](util[_0xdf8e('0x2c')](_0xdf8e('0x10a'),_0x5117a7['toUpperCase']()),_0x1308af[_0x5117a7]);}}return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x10b'),JSON[_0xdf8e('0xea')](_0x1308af)));}}return _0x307c66;};AGIVertices[_0xdf8e('0xf')]['tildeasr']=function(_0x40b91e){logger[_0xdf8e('0x31')](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x40b91e[_0xdf8e('0x3b')]));if(!this['isConfigured'](_0x40b91e[_0xdf8e('0x73')])){return this[_0xdf8e('0xd')]['noop']('no\x20appid\x20configured');}if(!this['isConfigured'](_0x40b91e[_0xdf8e('0x74')])){return this[_0xdf8e('0xd')]['noop']('no\x20appsecret\x20configured');}var _0xbca686=_0xdf8e('0x104');var _0x1e7198=util['format'](_0xdf8e('0x10c'),FILES_PATH,rs[_0xdf8e('0xed')](0x4));var _0x2c5f79=util['format'](_0xdf8e('0x105'),_0x1e7198,_0xbca686);var _0x1a7b33=!![];if(_0x40b91e['beep']===_0xdf8e('0x106')){_0x1a7b33=![];}var _0x348e08=this[_0xdf8e('0xd')][_0xdf8e('0x107')](_0x1e7198,_0xbca686,_0x40b91e[_0xdf8e('0x108')],_0x40b91e[_0xdf8e('0x8b')],undefined,_0x1a7b33);if(_0x348e08[_0xdf8e('0x80')]!==-0x1){this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x10d'),_0x2c5f79));var _0x50ec5c=this[_0xdf8e('0x72')][_0xdf8e('0x85')](this,_0x40b91e,_0x2c5f79);if(_0x50ec5c){for(var _0x1e9125 in _0x50ec5c){if(_0x50ec5c[_0xdf8e('0xc6')](_0x1e9125)){this[_0xdf8e('0xd')][_0xdf8e('0x82')](util['format'](_0xdf8e('0x10e'),_0x1e9125[_0xdf8e('0xc7')]()),_0x50ec5c[_0x1e9125]);}}return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')]('TildeASR\x20Result\x20%s',JSON[_0xdf8e('0xea')](_0x50ec5c)));}}return _0x348e08;};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x10f')]=function(_0x13e4ab){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x13e4ab[_0xdf8e('0x3b')]));return this['channel'][_0xdf8e('0x110')](_0x13e4ab[_0xdf8e('0x41')],_0x13e4ab[_0xdf8e('0x111')],_0x13e4ab[_0xdf8e('0x112')]);};AGIVertices['prototype'][_0xdf8e('0x113')]=function(_0x540d24){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x114'),_0x540d24[_0xdf8e('0x3b')]));if(!this['isConfigured'](_0x540d24[_0xdf8e('0x115')])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x540d24,'no\x20condition\x20configured');}try{var _0x571720=eval(_0x540d24[_0xdf8e('0x115')])?_0xdf8e('0x116'):'false';this[_0xdf8e('0xd')]['noop'](util[_0xdf8e('0x2c')](_0xdf8e('0x117'),_0x540d24[_0xdf8e('0x115')],_0x571720));return{'code':0xc8,'result':_0x571720};}catch(_0x4abdcc){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xdf8e('0xf')]['gotoiftime']=function(_0x421329){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x118'),_0x421329[_0xdf8e('0x3b')]));if(!this[_0xdf8e('0x83')](_0x421329[_0xdf8e('0x119')])){return this['channel'][_0xdf8e('0x30')](_0x421329,'no\x20interval\x20configured');}var _0x2e2d83=this[_0xdf8e('0x27')][_0xdf8e('0x85')](this,_0x421329[_0xdf8e('0x119')]);if(!_0x2e2d83){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x421329,_0xdf8e('0x11a'));}for(var _0xb42d10=0x0;_0xb42d10<_0x2e2d83[_0xdf8e('0x7c')];_0xb42d10+=0x1){var _0x36baaa=this[_0xdf8e('0xd')][_0xdf8e('0x10')](util[_0xdf8e('0x2c')]('IFTIME(%s?true:false)',_0x2e2d83[_0xb42d10]));if(_0x36baaa[_0xdf8e('0x80')]===-0x1){return _0x36baaa;}logger[_0xdf8e('0x31')](util['format'](_0xdf8e('0x11b'),_0x2e2d83[_0xb42d10],_0x36baaa[_0xdf8e('0x7e')]));if(_0x36baaa[_0xdf8e('0x7e')]===_0xdf8e('0x116')){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x11b'),_0x2e2d83[_0xb42d10],_0xdf8e('0x116')));this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x11b'),_0x2e2d83[_0xb42d10],_0xdf8e('0x116')));return{'code':0xc8,'result':_0xdf8e('0x116')};}else{logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x11b'),_0x2e2d83[_0xb42d10],_0xdf8e('0x11c')));this[_0xdf8e('0xd')]['noop'](util[_0xdf8e('0x2c')](_0xdf8e('0x11b'),_0x2e2d83[_0xb42d10],_0xdf8e('0x11c')));}}return{'code':0xc8,'result':_0xdf8e('0x11c')};};AGIVertices[_0xdf8e('0xf')]['hangup']=function(_0x1a90b0){logger[_0xdf8e('0x31')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x1a90b0[_0xdf8e('0x3b')]));return this[_0xdf8e('0xd')][_0xdf8e('0x11d')]();};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x11e')]=function(_0x235cfd){logger['info'](util['format'](_0xdf8e('0x11f'),_0x235cfd[_0xdf8e('0x3b')]));if(!this['isConfigured'](_0x235cfd[_0xdf8e('0x60')])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0x103'));}var _0x4a78b4=_0xdf8e('0x104');var _0x877fb9=util[_0xdf8e('0x2c')](_0xdf8e('0x10c'),FILES_PATH,rs['generate'](0x4));var _0x26c32d=util[_0xdf8e('0x2c')]('%s.%s',_0x877fb9,_0x4a78b4);var _0x57f6ec=!![];if(_0x235cfd['beep']===_0xdf8e('0x106')){_0x57f6ec=![];}var _0x446e10=this[_0xdf8e('0xd')]['recordFile'](_0x877fb9,_0x4a78b4,_0x235cfd['intKey'],_0x235cfd[_0xdf8e('0x8b')],undefined,_0x57f6ec);if(_0x446e10[_0xdf8e('0x80')]!==-0x1){this['channel'][_0xdf8e('0x92')](util['format'](_0xdf8e('0x120'),_0x26c32d));var _0x2ac64e=this['ispeechASR'][_0xdf8e('0x85')](this,_0x235cfd,_0x26c32d);if(_0x2ac64e){for(var _0x114bef in _0x2ac64e){if(_0x2ac64e[_0xdf8e('0xc6')](_0x114bef)){this[_0xdf8e('0xd')]['setVariable'](util['format']('ISPEECH_ASR_%s',_0x114bef[_0xdf8e('0xc7')]()),_0x2ac64e[_0x114bef]);}}return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x121'),JSON['stringify'](_0x2ac64e)));}}return _0x446e10;};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x122')]=function(_0x5dd6c4){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x5dd6c4['label']));if(!this[_0xdf8e('0x83')](_0x5dd6c4[_0xdf8e('0x60')])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0x103'));}if(!this['isConfigured'](_0x5dd6c4[_0xdf8e('0x5d')])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0x9e'));}this['channel'][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x123'),_0x5dd6c4[_0xdf8e('0x5d')]));var _0x594761=this[_0xdf8e('0x63')][_0xdf8e('0x85')](this,_0x5dd6c4);if(_0x594761){this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x120'),_0x594761));var _0x2b4f8a=this[_0xdf8e('0xd')][_0xdf8e('0xd4')](_0x594761,_0x5dd6c4[_0xdf8e('0x108')]);try{fs['unlink'](_0x594761+_0xdf8e('0xd6'));}catch(_0x367849){logger[_0xdf8e('0x30')](_0x367849);}return _0x2b4f8a;}return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x5dd6c4,_0xdf8e('0x124'));};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x125')]=function(_0xd6bd46){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x126'),_0xd6bd46[_0xdf8e('0x3b')]));if(!this['isConfigured'](_0xd6bd46['findBy'])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0xd6bd46,'no\x20find\x20by\x20configured');}logger['info'](util[_0xdf8e('0x2c')](_0xdf8e('0x127'),this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0xd6bd46[_0xdf8e('0x128')]));var _0x3233d1=this[_0xdf8e('0x58')]['sync'](this,_0xd6bd46[_0xdf8e('0x128')]);if(_0x3233d1){logger['info'](util['format'](_0xdf8e('0x129'),this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0xd6bd46[_0xdf8e('0x128')]));this[_0xdf8e('0xd')]['noop'](util[_0xdf8e('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0xd6bd46[_0xdf8e('0x128')]));return{'code':0xc8,'result':_0xdf8e('0x12a')};}else{logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x12b'),this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0xd6bd46[_0xdf8e('0x128')]));this[_0xdf8e('0xd')]['noop'](util[_0xdf8e('0x2c')](_0xdf8e('0x12b'),this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0xd6bd46[_0xdf8e('0x128')]));return{'code':0xc8,'result':_0xdf8e('0x12c')};}};AGIVertices[_0xdf8e('0xf')]['logout']=function(_0x2f0e1c){logger['info'](util[_0xdf8e('0x2c')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x2f0e1c[_0xdf8e('0x3b')]));if(!this[_0xdf8e('0x83')](_0x2f0e1c[_0xdf8e('0x128')])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x2f0e1c,_0xdf8e('0x12d'));}logger[_0xdf8e('0x31')](util['format'](_0xdf8e('0x127'),this['channel'][_0xdf8e('0x3e')],_0x2f0e1c[_0xdf8e('0x128')]));var _0x43c529=this[_0xdf8e('0x54')][_0xdf8e('0x85')](this,_0x2f0e1c[_0xdf8e('0x128')]);if(_0x43c529){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x129'),this[_0xdf8e('0xd')]['callerid'],_0x2f0e1c['findBy']));this[_0xdf8e('0xd')]['noop'](util[_0xdf8e('0x2c')](_0xdf8e('0x129'),this[_0xdf8e('0xd')]['callerid'],_0x2f0e1c[_0xdf8e('0x128')]));return{'code':0xc8,'result':_0xdf8e('0x12a')};}else{logger['info'](util[_0xdf8e('0x2c')](_0xdf8e('0x12b'),this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0x2f0e1c[_0xdf8e('0x128')]));this[_0xdf8e('0xd')]['noop'](util[_0xdf8e('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0x2f0e1c['findBy']));return{'code':0xc8,'result':_0xdf8e('0x12c')};}};AGIVertices['prototype'][_0xdf8e('0x12e')]=function(_0x1d14d9){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1d14d9[_0xdf8e('0x3b')]));if(!this[_0xdf8e('0x83')](_0x1d14d9['operation'])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x1d14d9,_0xdf8e('0x12f'));}this['channel'][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x130'),_0x1d14d9[_0xdf8e('0x131')]));var _0xfcf07c=eval(_0x1d14d9[_0xdf8e('0x131')]);if(!this[_0xdf8e('0x83')](_0x1d14d9[_0xdf8e('0xb4')])){return this['channel'][_0xdf8e('0x92')](_0xdf8e('0xb5'));}var _0x5cb648=this[_0xdf8e('0x10')]['sync'](this,_0x1d14d9[_0xdf8e('0xb4')]);if(!_0x5cb648){return this['channel'][_0xdf8e('0x30')](_0x1d14d9,_0xdf8e('0xb6'));}if(_[_0xdf8e('0x132')](_0xfcf07c)){var _0xb4d006=this;_0xfcf07c[_0xdf8e('0xb7')](function(_0x51080f,_0xe7714){_0xb4d006[_0xdf8e('0xd')]['setVariable'](util[_0xdf8e('0x2c')](_0xdf8e('0x133'),_0x5cb648,_0xe7714),_0x51080f);});return this['channel'][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x134'),_0x5cb648));}else{return this[_0xdf8e('0xd')][_0xdf8e('0x82')](_0x5cb648,_0xfcf07c);}};AGIVertices[_0xdf8e('0xf')]['menu']=function(_0x141ab2){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x135'),_0x141ab2['label']));if(_0x141ab2[_0xdf8e('0x86')]===0x0){return this['maxRetry'](_0x141ab2);}_0x141ab2['retry']-=0x1;if(!this[_0xdf8e('0x83')](_0x141ab2['file_id'])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x141ab2,_0xdf8e('0xe5'));}var _0x4db754=this[_0xdf8e('0x20')][_0xdf8e('0x85')](this,_0x141ab2['file_id']);if(!_0x4db754){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x141ab2,'no\x20file\x20audio\x20found');}var _0x4f617f=this[_0xdf8e('0xd')]['getData'](_0x4db754,_0x141ab2[_0xdf8e('0xe7')],_0x141ab2[_0xdf8e('0x136')]);var _0x1b0bfc=_0x4f617f['result'];if(_0x4f617f[_0xdf8e('0x80')]===-0x1){this[_0xdf8e('0x39')][_0xdf8e('0x85')](this,_0x141ab2,'-1');return _0x4f617f;}else if(_0x4f617f[_0xdf8e('0x7e')]==='timeout'){_0x4f617f['result']=_0x4f617f['result']['length']>0x0?_0x4f617f[_0xdf8e('0x80')]:'t';}else if(_['isEmpty'](_0x4f617f[_0xdf8e('0x80')])){_0x4f617f[_0xdf8e('0x80')]='#';_0x1b0bfc='#';}if(!this[_0xdf8e('0x83')](_0x141ab2[_0xdf8e('0xb4')])){this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0xb5'));}else{var _0x49a851=this[_0xdf8e('0x10')][_0xdf8e('0x85')](this,_0x141ab2[_0xdf8e('0xb4')]);if(!_0x49a851){return this[_0xdf8e('0xd')]['error'](_0x141ab2,_0xdf8e('0xb6'));}this[_0xdf8e('0xd')][_0xdf8e('0x82')](_0x49a851,_0x1b0bfc);}this['createSquareDetailsReport'][_0xdf8e('0x85')](this,_0x141ab2,_0x1b0bfc);return _0x4f617f;};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x92')]=function(_0x36c882){logger['info'](util[_0xdf8e('0x2c')](_0xdf8e('0x137'),_0x36c882[_0xdf8e('0x3b')]));return this['channel'][_0xdf8e('0x92')](_0x36c882[_0xdf8e('0x138')]||_0x36c882[_0xdf8e('0x3b')]);};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x139')]=function(_0x1aae75){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x13a'),_0x1aae75['label']));if(!this['isConfigured'](_0x1aae75[_0xdf8e('0x128')])){return this[_0xdf8e('0xd')]['error'](_0x1aae75,_0xdf8e('0x12d'));}logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0x1aae75[_0xdf8e('0x128')]));var _0x4f27fb=this['getPause'][_0xdf8e('0x85')](this,_0x1aae75['pause_id']);var _0x1bba55=this[_0xdf8e('0x51')][_0xdf8e('0x85')](this,_0x1aae75[_0xdf8e('0x128')],_0x4f27fb);if(_0x1bba55){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0x1aae75[_0xdf8e('0x128')]));this['channel'][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x129'),this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0x1aae75[_0xdf8e('0x128')]));return{'code':0xc8,'result':'success'};}else{logger[_0xdf8e('0x31')](util['format'](_0xdf8e('0x12b'),this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0x1aae75['findBy']));this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x129'),this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0x1aae75[_0xdf8e('0x128')]));return{'code':0xc8,'result':_0xdf8e('0x12c')};}};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x13b')]=function(_0x50eb8d){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x13c'),_0x50eb8d[_0xdf8e('0x3b')]));if(!this['isConfigured'](_0x50eb8d['file_id'])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x50eb8d,'no\x20file\x20audio\x20selected');}var _0x47b45=this['getSound']['sync'](this,_0x50eb8d[_0xdf8e('0xe4')]);if(!_0x47b45){return this['channel'][_0xdf8e('0x30')](_0x50eb8d,_0xdf8e('0x13d'));}var _0x4a6253=this[_0xdf8e('0xd')]['exec']('PLAYBACK',[_0x47b45,_0x50eb8d[_0xdf8e('0xc0')]]);if(_0x4a6253[_0xdf8e('0x80')]===-0x1){return _0x4a6253;}return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util['format'](_0xdf8e('0x98'),_0xdf8e('0x13e'),_0x47b45));};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x13f')]=function(_0x18c352){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x140'),_0x18c352['label']));if(!this[_0xdf8e('0x83')](_0x18c352['queue_id'])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x18c352,_0xdf8e('0x141'));}var _0x4cd8d9='';var _0x3acc2c=parseInt(_0x18c352[_0xdf8e('0x142')],0xa);if(isNaN(_0x3acc2c)){_0x4cd8d9=_0x18c352['queue_id'];}else{_0x4cd8d9=this[_0xdf8e('0x16')][_0xdf8e('0x85')](this,_0x18c352[_0xdf8e('0x142')]);if(!_0x4cd8d9){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x18c352,'no\x20queue\x20found');}}var _0x4fc876='';if(this[_0xdf8e('0x83')](_0x18c352[_0xdf8e('0xe4')])){var _0x186bb4=this['getSound'][_0xdf8e('0x85')](this,_0x18c352[_0xdf8e('0xe4')]);if(_0x186bb4){_0x4fc876=_0x186bb4;}}this['createSquareDetailsReport']['sync'](this,_0x18c352,_0x4cd8d9);if(_0x18c352['opts'][_0xdf8e('0x143')]('x')<0x0){_0x18c352[_0xdf8e('0xc0')]+='x';}if(_0x18c352[_0xdf8e('0xc0')]['indexOf']('X')<0x0){_0x18c352[_0xdf8e('0xc0')]+='X';}this[_0xdf8e('0xd')][_0xdf8e('0x82')](_0xdf8e('0x144'),_0x4cd8d9?_0x4cd8d9['toLowerCase']():'');var _0x2229e3=this['channel']['exec'](_0xdf8e('0x145'),[_0x4cd8d9,_0x18c352[_0xdf8e('0xc0')],_0x18c352[_0xdf8e('0x146')],_0x4fc876,_0x18c352[_0xdf8e('0x8b')],_0x18c352[_0xdf8e('0x8')],_0x18c352[_0xdf8e('0x147')],_0x18c352[_0xdf8e('0x148')],'',_0x18c352['position']]);if(_0x2229e3[_0xdf8e('0x80')]===-0x1){return _0x2229e3;}return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')]('Executed\x20command\x20%s\x20%s',_0xdf8e('0x145'),_0x4cd8d9));};AGIVertices[_0xdf8e('0xf')]['record']=function(_0xde9395){logger[_0xdf8e('0x31')](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0xde9395['label']));var _0x45730b=_0xde9395['recordingFormat']||_0xdf8e('0x104');var _0x301d51=util['format'](_0xdf8e('0x149'),this[_0xdf8e('0xd')][_0xdf8e('0x3a')],rs[_0xdf8e('0xed')](0x5));var _0x3b007f=util[_0xdf8e('0x2c')]('%s/recordings/%s.%s',FILES_PATH,_0x301d51,_0x45730b);var _0x5b2f4d=util[_0xdf8e('0x2c')]('%s/recordings/%s',FILES_PATH,_0x301d51);this[_0xdf8e('0x3f')][_0xdf8e('0x85')](this,_0xde9395,_0x301d51,_0x3b007f);this[_0xdf8e('0xd')][_0xdf8e('0x82')](_0xdf8e('0x14a'),_0x301d51);logger[_0xdf8e('0x31')](_0xdf8e('0x14b'),_0x5b2f4d,_0x45730b,_0xde9395[_0xdf8e('0x14c')],_0xde9395['timeout']);return this[_0xdf8e('0xd')][_0xdf8e('0x107')](_0x5b2f4d,_0x45730b,_0xde9395[_0xdf8e('0x14c')],_0xde9395[_0xdf8e('0x8b')],undefined,!![]);};AGIVertices['prototype']['saydigits']=function(_0x56d697){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x14d'),_0x56d697[_0xdf8e('0x3b')]));return this[_0xdf8e('0xd')][_0xdf8e('0x14e')](_0x56d697[_0xdf8e('0x14f')][_0xdf8e('0x5b')](/\s+/g,''),_0x56d697['escape_digits']);};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x150')]=function(_0x13fd49){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x13fd49[_0xdf8e('0x3b')]));return this[_0xdf8e('0xd')][_0xdf8e('0x151')](_0x13fd49['number']['replace'](/\s+/g,''),_0x13fd49[_0xdf8e('0x14c')]);};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x152')]=function(_0x2fb21a){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x153'),_0x2fb21a[_0xdf8e('0x3b')]));return this[_0xdf8e('0xd')][_0xdf8e('0x154')](_0x2fb21a[_0xdf8e('0x5d')],_0x2fb21a['escape_digits']);};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x155')]=function(_0x27194d){logger[_0xdf8e('0x31')](util['format'](_0xdf8e('0x156'),_0x27194d[_0xdf8e('0x3b')]));if(!this[_0xdf8e('0x83')](_0x27194d[_0xdf8e('0x157')])){return this[_0xdf8e('0xd')][_0xdf8e('0x92')]('no\x20mail\x20account\x20configured');}var _0x59d755=this[_0xdf8e('0x24')][_0xdf8e('0x85')](this,_0x27194d[_0xdf8e('0x157')]);if(!_0x59d755||!_0x59d755[_0xdf8e('0x158')]){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x27194d,_0xdf8e('0x159'));}var _0x555545={'from':util[_0xdf8e('0x2c')](_0xdf8e('0x15a'),_0x59d755['name'],_0x59d755[_0xdf8e('0x15b')]||_0x59d755[_0xdf8e('0x158')]['user']),'to':_0x27194d['to']||'','cc':_0x27194d['cc']||'','bcc':_0x27194d[_0xdf8e('0x15c')]||'','subject':_0x27194d[_0xdf8e('0x15d')],'html':_0x27194d[_0xdf8e('0x5d')],'text':_0x27194d[_0xdf8e('0x5d')]};var _0x1d1ef8={'tls':{'rejectUnauthorized':![]}};if(_0x59d755[_0xdf8e('0x158')]['service']){_0x1d1ef8['service']=_0x59d755['Smtp'][_0xdf8e('0x15e')];}else{_0x1d1ef8[_0xdf8e('0x15f')]=_0x59d755[_0xdf8e('0x158')][_0xdf8e('0x15f')];_0x1d1ef8[_0xdf8e('0x160')]=_0x59d755[_0xdf8e('0x158')][_0xdf8e('0x160')];_0x1d1ef8[_0xdf8e('0x161')]=_0x59d755[_0xdf8e('0x158')][_0xdf8e('0x161')];}if(_0x59d755[_0xdf8e('0x158')][_0xdf8e('0x162')]){_0x1d1ef8[_0xdf8e('0x163')]={'user':_0x59d755['Smtp'][_0xdf8e('0x164')],'pass':_0x59d755[_0xdf8e('0x158')]['pass']};}if(this[_0xdf8e('0x83')](_0x27194d[_0xdf8e('0x165')])){}logger['debug']('sendMail\x20message',JSON['stringify'](_0x555545));this[_0xdf8e('0x39')][_0xdf8e('0x85')](this,_0x27194d,_0x27194d[_0xdf8e('0x157')]);this[_0xdf8e('0xd')][_0xdf8e('0x92')](util['format'](_0xdf8e('0x166'),_0x59d755[_0xdf8e('0x14')]));this[_0xdf8e('0x26')][_0xdf8e('0x85')](this,_0x1d1ef8,_0x555545);return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0x167'));};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x168')]=function(_0x459c56){logger['info'](util[_0xdf8e('0x2c')](_0xdf8e('0x169'),_0x459c56[_0xdf8e('0x3b')]));return this[_0xdf8e('0xd')][_0xdf8e('0x92')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x16a')]=function(_0x3b92ab){logger['info'](util[_0xdf8e('0x2c')](_0xdf8e('0x16b'),_0x3b92ab[_0xdf8e('0x3b')]));if(!this['isConfigured'](_0x3b92ab['sms_account_id'])){return this['channel'][_0xdf8e('0x92')](_0xdf8e('0x16c'));}var _0x3c6eab=this[_0xdf8e('0x16d')][_0xdf8e('0x85')](this,_0x3b92ab[_0xdf8e('0x16e')]);if(!_0x3c6eab){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x3b92ab,'no\x20sms\x20account\x20found');}var _0x4e20ce={'body':_0x3b92ab[_0xdf8e('0x16f')],'phone':_0x3b92ab['to']||'','SmsAccountId':_0x3c6eab['id']};logger['debug'](_0xdf8e('0x170'),JSON[_0xdf8e('0xea')](_0x4e20ce));this[_0xdf8e('0x39')][_0xdf8e('0x85')](this,_0x3b92ab,_0x3b92ab['sms_account_id']);this[_0xdf8e('0xd')]['noop'](util[_0xdf8e('0x2c')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x3c6eab['name']));this[_0xdf8e('0x38')][_0xdf8e('0x85')](this,_0x4e20ce);return this[_0xdf8e('0xd')][_0xdf8e('0x92')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x171')]=function(_0x4eac3b){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x172'),_0x4eac3b[_0xdf8e('0x3b')]));if(!this[_0xdf8e('0x83')](_0x4eac3b[_0xdf8e('0xb4')])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x4eac3b,_0xdf8e('0x173'));}var _0x27f47d=this[_0xdf8e('0x10')]['sync'](this,_0x4eac3b[_0xdf8e('0xb4')]);if(!_0x27f47d){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x4eac3b,_0xdf8e('0xb6'));}return this[_0xdf8e('0xd')]['setVariable'](_0x27f47d,_0x4eac3b[_0xdf8e('0x174')]);};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x175')]=function(_0x4918be){logger[_0xdf8e('0x31')](util['format'](_0xdf8e('0x176'),_0x4918be[_0xdf8e('0x3b')]));this[_0xdf8e('0xd')][_0xdf8e('0x92')]('START\x20CALLY\x20SQUARE');if(_0x4918be[_0xdf8e('0x8a')]===_0xdf8e('0x177')){this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0x178'));return this['channel'][_0xdf8e('0x8a')]();}return this[_0xdf8e('0xd')][_0xdf8e('0x92')](_0xdf8e('0x179'));};AGIVertices['prototype']['subproject']=function(_0x2fadee){logger[_0xdf8e('0x31')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x2fadee[_0xdf8e('0x3b')]));if(!this[_0xdf8e('0x83')](_0x2fadee[_0xdf8e('0x17a')])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x2fadee,_0xdf8e('0x17b'));}var _0x5629c4=this[_0xdf8e('0x18')][_0xdf8e('0x85')](this,_0x2fadee[_0xdf8e('0x17a')]);if(!this['isConfigured'](_0x5629c4)){return this[_0xdf8e('0xd')]['error'](_0x2fadee,util[_0xdf8e('0x2c')](_0xdf8e('0x17c'),_0x2fadee[_0xdf8e('0x17a')]));}if(_0x5629c4===this['channel']['arg_1']){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x2fadee,_0xdf8e('0x17d'));}this[_0xdf8e('0x39')][_0xdf8e('0x85')](this,_0x2fadee,_0x5629c4);var _0x18e323=this[_0xdf8e('0xd')][_0xdf8e('0x9a')](_0xdf8e('0x17e'),util['format'](_0xdf8e('0x17f'),config[_0xdf8e('0x8')][_0xdf8e('0x15f')]||'127.0.0.1',_0x5629c4,this[_0xdf8e('0xd')][_0xdf8e('0x3d')]));if(_0x18e323['result']===-0x1){return _0x18e323;}return this['channel']['noop'](util[_0xdf8e('0x2c')]('Executed\x20command\x20%s\x20%s',_0xdf8e('0x17e'),_0x5629c4));};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x180')]=function(_0x3ccdd7){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x3ccdd7[_0xdf8e('0x3b')]));var _0x12bcc7=this['shellCommand'][_0xdf8e('0x85')](this,_0x3ccdd7[_0xdf8e('0x88')]);this[_0xdf8e('0x39')][_0xdf8e('0x85')](this,_0x3ccdd7,_0x3ccdd7['command']);if(this['isConfigured'](_0x3ccdd7[_0xdf8e('0xb4')])){var _0x14acfe=this[_0xdf8e('0x10')][_0xdf8e('0x85')](this,_0x3ccdd7[_0xdf8e('0xb4')]);if(_0x14acfe){this['channel']['setVariable'](_0x14acfe,_0x12bcc7);return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x181'),_0x3ccdd7[_0xdf8e('0x88')],_0x14acfe));}}return this['channel'][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x182'),_0x3ccdd7['command']));};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x183')]=function(_0x16a603){logger['info'](util[_0xdf8e('0x2c')](_0xdf8e('0x184'),_0x16a603[_0xdf8e('0x3b')]));if(!this['isConfigured'](_0x16a603[_0xdf8e('0x5d')])){return this[_0xdf8e('0xd')]['noop'](_0xdf8e('0x9e'));}this[_0xdf8e('0xd')][_0xdf8e('0x92')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x16a603[_0xdf8e('0x5d')]));var _0x3ddf7e=this['googleTTS'][_0xdf8e('0x85')](this,_0x16a603);if(_0x3ddf7e){this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')]('Google\x20TTS\x20%s\x20file\x20created',_0x3ddf7e));var _0x38a26f=this[_0xdf8e('0xd')][_0xdf8e('0xd4')](_0x3ddf7e);try{fs['unlink'](_0x3ddf7e+_0xdf8e('0xd6'));}catch(_0x156fad){logger[_0xdf8e('0x30')](_0x156fad);}return _0x38a26f;}return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x16a603,_0xdf8e('0x185'));};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x186')]=function(_0x42a53d){logger[_0xdf8e('0x31')](util['format'](_0xdf8e('0x187'),_0x42a53d[_0xdf8e('0x3b')]));if(!this[_0xdf8e('0x83')](_0x42a53d[_0xdf8e('0x128')])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x42a53d,_0xdf8e('0x12d'));}logger[_0xdf8e('0x31')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0x42a53d['findBy']));var _0x5a21b9=this[_0xdf8e('0x53')][_0xdf8e('0x85')](this,_0x42a53d[_0xdf8e('0x128')]);if(_0x5a21b9){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x129'),this[_0xdf8e('0xd')]['callerid'],_0x42a53d[_0xdf8e('0x128')]));this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x129'),this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0x42a53d['findBy']));return{'code':0xc8,'result':_0xdf8e('0x12a')};}else{logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x12b'),this[_0xdf8e('0xd')]['callerid'],_0x42a53d['findBy']));this[_0xdf8e('0xd')][_0xdf8e('0x92')](util[_0xdf8e('0x2c')](_0xdf8e('0x12b'),this[_0xdf8e('0xd')][_0xdf8e('0x3e')],_0x42a53d[_0xdf8e('0x128')]));return{'code':0xc8,'result':_0xdf8e('0x12c')};}};AGIVertices[_0xdf8e('0xf')][_0xdf8e('0x188')]=function(_0x232abd){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x232abd['label']));var _0x5220fa=this[_0xdf8e('0xd')][_0xdf8e('0x9a')](_0xdf8e('0x189'),[_0x232abd[_0xdf8e('0x18a')],_0x232abd['options']]);if(_0x5220fa[_0xdf8e('0x80')]===-0x1){return _0x5220fa;}return this[_0xdf8e('0xd')][_0xdf8e('0x92')](util['format'](_0xdf8e('0x98'),_0xdf8e('0x189'),_0x232abd[_0xdf8e('0x18a')]));};AGIVertices['prototype'][_0xdf8e('0x18b')]=function(_0x2cbc68){logger[_0xdf8e('0x31')](util[_0xdf8e('0x2c')](_0xdf8e('0x18c'),_0x2cbc68[_0xdf8e('0x3b')]));if(!this[_0xdf8e('0x83')](_0x2cbc68['variable_id'])){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x2cbc68,_0xdf8e('0x173'));}var _0xd2657f=this['getVariable']['sync'](this,_0x2cbc68['variable_id']);if(!_0xd2657f){return this[_0xdf8e('0xd')][_0xdf8e('0x30')](_0x2cbc68,'no\x20variable\x20found');}var _0x3bdc03=this[_0xdf8e('0xd')]['getVariable'](_0xd2657f);return{'code':0xc8,'result':_0x3bdc03[_0xdf8e('0x7e')]?_0x3bdc03[_0xdf8e('0x7e')]:'-'};};String[_0xdf8e('0xf')][_0xdf8e('0x7d')]=function(_0x2f1652,_0x5d33cf){return this['split'](_0x2f1652)[_0xdf8e('0x18d')](_0x5d33cf);};module[_0xdf8e('0x18e')]=AGIVertices; \ No newline at end of file +var _0xf24d=['ispeech_tts_language','en-US','speed','ispeechASR','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','includes','clone','replaceAllVariables','split','length','replaceAll','extra','getAndSetVariable','setVariable','maxRetry','retry','Enter\x20in\x20AGI\x20(%s)\x20block','answer','timeout','wait','result','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','sync','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','url','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','hasOwnProperty','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','toUpperCase','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','maxdigit','test','stringify','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','isString','message','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','%s.%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','wav','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','true','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','unlink','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','no\x20operation\x20configured','isArray','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','getPause','pause_id','failure','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','gosub','QUEUE','record','recordingFormat','%s_%s','%s/recordings/%s.%s','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','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','subject','service','host','port','secure','authentication','auth','user','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','sendMailMessage','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','path','util','lodash','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUserById','getTrunk','getSoundPath','getMailAccount','getMailAccountById','getIntervalById','IntervalId','interval','map','format','%s/sounds/converted/%s','open','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','file','createSquareMessage','createCmContact','isEmpty','random','lastName','isNil','phone','list_id','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','shellCommand','exec','trim','replace','text','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS'];(function(_0x5a2f2c,_0x5e02a9){var _0xf464d6=function(_0x4f8de4){while(--_0x4f8de4){_0x5a2f2c['push'](_0x5a2f2c['shift']());}};_0xf464d6(++_0x5e02a9);}(_0xf24d,0x13c));var _0xdf24=function(_0x3dd266,_0x4d919f){_0x3dd266=_0x3dd266-0x0;var _0x320665=_0xf24d[_0x3dd266];return _0x320665;};'use strict';var fs=require('fs');var path=require(_0xdf24('0x0'));var util=require(_0xdf24('0x1'));var _=require(_0xdf24('0x2'));var sh=require('shelljs');var odbc=require(_0xdf24('0x3'))();var rs=require(_0xdf24('0x4'));var moment=require(_0xdf24('0x5'));var Mustache=require(_0xdf24('0x6'));var logger=require(_0xdf24('0x7'))(_0xdf24('0x8'));var config=require(_0xdf24('0x9'));var scripts=require('./scripts');var FILES_PATH=_0xdf24('0xa');var verticesWithRetry=[_0xdf24('0xb'),_0xdf24('0xc'),_0xdf24('0xd')];var AGIVertices=function(_0x344784,_0x51b139,_0x13bdae){this['channel']=_0x344784;this[_0xdf24('0xe')]=_0x51b139;this[_0xdf24('0xf')]=_0x13bdae;};AGIVertices[_0xdf24('0x10')][_0xdf24('0x11')]=function(_0x14433a,_0x596478){this['rpc'][_0xdf24('0x12')](_0x14433a)[_0xdf24('0x13')](function(_0x2c8b47){_0x596478(null,_0x2c8b47?_0x2c8b47['name']:![]);})[_0xdf24('0x14')](function(_0x3a0f43){_0x596478(_0x3a0f43);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x15')]=function(_0x1fc8ae,_0x25a6d6){this[_0xdf24('0xe')][_0xdf24('0x16')](_0x1fc8ae)[_0xdf24('0x13')](function(_0x277c6d){_0x25a6d6(null,_0x277c6d?_0x277c6d[_0xdf24('0x17')]:![]);})['catch'](function(_0x31c087){_0x25a6d6(_0x31c087);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x18')]=function(_0x432c13,_0x295cfd){this[_0xdf24('0xe')][_0xdf24('0x19')](_0x432c13)[_0xdf24('0x13')](function(_0x4fcefa){_0x295cfd(null,_0x4fcefa?_0x4fcefa[_0xdf24('0x17')]:![]);})[_0xdf24('0x14')](function(_0x536cfc){_0x295cfd(_0x536cfc);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x1a')]=function(_0x27adff,_0x954473){this[_0xdf24('0xe')]['getSquareOdbcById'](_0x27adff)['then'](function(_0x4221a5){_0x954473(null,_0x4221a5?_0x4221a5[_0xdf24('0x1b')]:![]);})[_0xdf24('0x14')](function(_0x369bf9){_0x954473(_0x369bf9);});};AGIVertices['prototype']['getUser']=function(_0x2d9a6d,_0x15fb2f){this[_0xdf24('0xe')][_0xdf24('0x1c')](_0x2d9a6d)[_0xdf24('0x13')](function(_0x1ec6e7){_0x15fb2f(null,_0x1ec6e7?_0x1ec6e7[_0xdf24('0x17')]:![]);})[_0xdf24('0x14')](function(_0x3fd52b){_0x15fb2f(_0x3fd52b);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x1d')]=function(_0x2fb03d,_0x1dd4da){this[_0xdf24('0xe')]['getTrunkById'](_0x2fb03d)['then'](function(_0x494830){_0x1dd4da(null,_0x494830?_0x494830['name']:![]);})['catch'](function(_0x3f12a5){_0x1dd4da(_0x3f12a5);});};AGIVertices[_0xdf24('0x10')]['getSound']=function(_0xde8ea8,_0x2a85fb){var _0x2d1ede=this;this['rpc']['getSoundById'](_0xde8ea8)[_0xdf24('0x13')](function(_0x9ca267){_0x2a85fb(null,_0x9ca267?_0x2d1ede[_0xdf24('0x1e')](_0x9ca267['save_name']):![]);})['catch'](function(_0x58977c){_0x2a85fb(_0x58977c);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x1f')]=function(_0x1cadc8,_0x40ed74){this[_0xdf24('0xe')][_0xdf24('0x20')](_0x1cadc8)[_0xdf24('0x13')](function(_0x20a9bd){_0x40ed74(null,_0x20a9bd?_0x20a9bd:![]);})[_0xdf24('0x14')](function(_0x362340){_0x40ed74(_0x362340);});};AGIVertices[_0xdf24('0x10')]['sendMailMessage']=function(_0x46ebc3,_0x1c31d1,_0x598bfe){this[_0xdf24('0xf')]['sendMailMessage'](_0x46ebc3,_0x1c31d1)[_0xdf24('0x13')](function(){_0x598bfe(null);})[_0xdf24('0x14')](function(_0x5eaa5e){_0x598bfe(_0x5eaa5e);});};AGIVertices['prototype']['getIntervals']=function(_0x57dda9,_0x87e79c){this[_0xdf24('0xe')][_0xdf24('0x21')](_0x57dda9)[_0xdf24('0x13')](function(_0x4dda72){if(_0x4dda72){if(_0x4dda72[_0xdf24('0x22')]){_0x87e79c(null,[_0x4dda72[_0xdf24('0x23')]]);}else{_0x87e79c(null,_[_0xdf24('0x24')](_0x4dda72['Intervals'],'interval'));}}else{_0x87e79c(null,![]);}})[_0xdf24('0x14')](function(_0x32908e){_0x87e79c(_0x32908e);});};AGIVertices['prototype'][_0xdf24('0x1e')]=function(_0x3056a0){return util[_0xdf24('0x25')](_0xdf24('0x26'),FILES_PATH,_0x3056a0);};AGIVertices[_0xdf24('0x10')]['getQueryOdbc']=function(_0x5b2138,_0x3ba764,_0x13f84b){odbc[_0xdf24('0x27')](_0x5b2138,function(_0x39f8b4){if(_0x39f8b4){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x39f8b4);_0x13f84b(_0x39f8b4);}else{logger[_0xdf24('0x28')](_0xdf24('0x29'));odbc[_0xdf24('0x2a')](_0x3ba764,function(_0x169156,_0x110684){if(_0x169156){logger[_0xdf24('0x28')](_0xdf24('0x2b'),_0x3ba764);_0x13f84b(_0x169156);}else{logger[_0xdf24('0x28')](_0xdf24('0x2c'),_0x3ba764);odbc[_0xdf24('0x2d')](function(_0x57bff4){if(_0x57bff4){logger[_0xdf24('0x2e')](_0xdf24('0x2f'),_0x57bff4);}_0x13f84b(null,_0x110684);});}});}});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x30')]=function(_0x282bbc,_0x1fc8f0){this[_0xdf24('0xe')][_0xdf24('0x31')](_0x282bbc)[_0xdf24('0x13')](function(_0x1daf6e){_0x1fc8f0(null,_0x1daf6e?_0x1daf6e:![]);})['catch'](function(_0x4dc712){_0x1fc8f0(_0x4dc712);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x32')]=function(_0x4a4c8d,_0x216ac1){this[_0xdf24('0xe')][_0xdf24('0x32')](_0x4a4c8d)[_0xdf24('0x13')](function(_0x2dd762){_0x216ac1(null,_0x2dd762);})['catch'](function(_0x48fa70){_0x216ac1(_0x48fa70);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x29b237,_0x526df3,_0x583414){this['rpc'][_0xdf24('0x33')]({'uniqueid':this[_0xdf24('0x34')][_0xdf24('0x35')],'node':_0x29b237[_0xdf24('0x36')],'application':_0x29b237[_0xdf24('0x37')],'data':_0x526df3||null,'project_name':this[_0xdf24('0x34')][_0xdf24('0x38')],'callerid':this[_0xdf24('0x34')][_0xdf24('0x39')]})[_0xdf24('0x13')](function(_0x11f528){if(_0x583414){_0x583414(null,_0x11f528);}})['catch'](function(_0x32bbda){if(_0x583414){_0x583414(_0x32bbda);}});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x3a')]=function(_0x2c3e01,_0x22a05d,_0x87c363,_0x224ab1){this[_0xdf24('0xe')][_0xdf24('0x3a')]({'uniqueid':this[_0xdf24('0x34')][_0xdf24('0x35')],'callerid':this[_0xdf24('0x34')][_0xdf24('0x39')],'calleridname':this[_0xdf24('0x34')][_0xdf24('0x3b')],'context':this[_0xdf24('0x34')][_0xdf24('0x3c')],'extension':this[_0xdf24('0x34')][_0xdf24('0x3d')],'priority':this[_0xdf24('0x34')][_0xdf24('0x3e')],'accountcode':this[_0xdf24('0x34')]['accountcode'],'dnid':this[_0xdf24('0x34')]['dnid'],'projectName':this['channel'][_0xdf24('0x38')],'saveName':_0x22a05d,'filename':_0x2c3e01[_0xdf24('0x3f')]||_0x22a05d,'savePath':_0x87c363})['then'](function(_0x1ea911){_0x224ab1(null,_0x1ea911);})[_0xdf24('0x14')](function(_0x174e2f){_0x224ab1(_0x174e2f);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x40')]=function(_0x123b7a,_0x5b6e46,_0x47ec57){this['rpc']['createSquareMessage']({'uniqueid':this[_0xdf24('0x34')]['uniqueid'],'body':_0x123b7a,'direction':_0x5b6e46})[_0xdf24('0x13')](function(_0x4bd77b){if(_0x47ec57){_0x47ec57(null,_0x4bd77b);}})[_0xdf24('0x14')](function(_0x56f871){if(_0x47ec57){_0x47ec57(_0x56f871);}});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x41')]=function(_0x13e21d,_0x1898b0){this[_0xdf24('0xe')][_0xdf24('0x41')]({'firstName':_[_0xdf24('0x42')](_0x13e21d[_0xdf24('0x17')])||_['isNil'](_0x13e21d[_0xdf24('0x17')])?'callback_'+Math[_0xdf24('0x43')]():_0x13e21d[_0xdf24('0x17')],'lastName':_[_0xdf24('0x42')](_0x13e21d[_0xdf24('0x44')])||_[_0xdf24('0x45')](_0x13e21d[_0xdf24('0x44')])?null:_0x13e21d['lastName'],'phone':_0x13e21d[_0xdf24('0x46')],'ListId':_0x13e21d[_0xdf24('0x47')],'scheduledAt':_0x13e21d['scheduledAt'],'callbackUniqueid':this['channel'][_0xdf24('0x35')],'tags':'callback','description':_0xdf24('0x48')+_0x13e21d[_0xdf24('0x49')][_0xdf24('0x4a')](),'priority':_0x13e21d[_0xdf24('0x4b')]})[_0xdf24('0x13')](function(_0x3cee65){_0x1898b0(null,_0x3cee65);})[_0xdf24('0x14')](function(_0x35c5f3){_0x1898b0(_0x35c5f3);});};AGIVertices['prototype']['getPause']=function(_0x312f48,_0x579eb1){this[_0xdf24('0xe')]['getPauseById'](_0x312f48)[_0xdf24('0x13')](function(_0x1fd384){_0x579eb1(null,_0x1fd384?_0x1fd384[_0xdf24('0x17')]:![]);})['catch'](function(_0x2bd49a){_0x579eb1(_0x2bd49a);});};AGIVertices['prototype'][_0xdf24('0x4c')]=function(_0x2c8c82,_0x516ab7,_0x5d3232){var _0x47370e={'role':_0xdf24('0x4d')};_0x47370e[_0x2c8c82]=this[_0xdf24('0x34')][_0xdf24('0x39')];this[_0xdf24('0xe')][_0xdf24('0x4c')](_0x47370e,_0x516ab7,this[_0xdf24('0x34')][_0xdf24('0x35')])[_0xdf24('0x13')](function(_0x21f81f){_0x5d3232(null,_[_0xdf24('0x45')](_0x21f81f)?![]:!![]);})['catch'](function(_0x2b72cb){logger['error'](_0x2b72cb);_0x5d3232(null,![]);});};AGIVertices['prototype'][_0xdf24('0x4e')]=function(_0x598ab3,_0x3aa681){var _0xb274be={'role':_0xdf24('0x4d')};_0xb274be[_0x598ab3]=this['channel']['callerid'];this['rpc'][_0xdf24('0x4e')](_0xb274be)[_0xdf24('0x13')](function(_0x2597c3){_0x3aa681(null,_[_0xdf24('0x45')](_0x2597c3)?![]:!![]);})[_0xdf24('0x14')](function(_0x34c205){logger[_0xdf24('0x2e')](_0x34c205);_0x3aa681(null,![]);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x4f')]=function(_0x3833bb,_0x5dab28){var _0x32df9a={'role':_0xdf24('0x4d')};_0x32df9a[_0x3833bb]=this['channel'][_0xdf24('0x39')];this[_0xdf24('0xe')]['agentLogout'](_0x32df9a)[_0xdf24('0x13')](function(_0x2f539a){_0x5dab28(null,_[_0xdf24('0x45')](_0x2f539a)?![]:!![]);})['catch'](function(_0x519f60){logger[_0xdf24('0x2e')](_0x519f60);_0x5dab28(null,![]);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x50')]=function(_0x56fa10,_0x26a4a2){var _0xe3cd8={'role':_0xdf24('0x4d')};_0xe3cd8[_0x56fa10]=this[_0xdf24('0x34')][_0xdf24('0x39')];var _0x495167=_0x56fa10!=_0xdf24('0x51')?util[_0xdf24('0x25')]('%s/%s@from-sip/n','LOCAL',this[_0xdf24('0x34')]['callerid']):undefined;this[_0xdf24('0xe')][_0xdf24('0x50')](_0xe3cd8,_0x495167)['then'](function(_0x3bc0d8){_0x26a4a2(null,_[_0xdf24('0x45')](_0x3bc0d8)?![]:!![]);})[_0xdf24('0x14')](function(_0x19a995){logger[_0xdf24('0x2e')](_0x19a995);_0x26a4a2(null,![]);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x52')]=function(_0x3fcc7a,_0x548a84){sh[_0xdf24('0x53')](_[_0xdf24('0x54')](_0x3fcc7a),function(_0x354c06,_0x4f8c4a){var _0x128100=_0x4f8c4a[_0xdf24('0x55')](/(\r\n|\n|\r)/gm,'');_0x548a84(null,_0x128100);});};AGIVertices[_0xdf24('0x10')]['googleTTS']=function(_0x346793,_0x4f4f80){scripts['googleTTS'](_0x346793[_0xdf24('0x56')],_0x346793[_0xdf24('0x57')]||'en',0x1)[_0xdf24('0x13')](function(_0xc5baf2){_0x4f4f80(null,_0xc5baf2);})[_0xdf24('0x14')](function(_0x1b83d5){_0x4f4f80(_0x1b83d5);});};AGIVertices['prototype'][_0xdf24('0x58')]=function(_0x1f5e86,_0x1a00bd){scripts['googleDialogflow'](this[_0xdf24('0x34')][_0xdf24('0x35')],_0x1f5e86[_0xdf24('0x59')],_0x1f5e86[_0xdf24('0x56')],_0x1f5e86[_0xdf24('0x5a')]||'en')['then'](function(_0x73e947){_0x1a00bd(null,_0x73e947);})[_0xdf24('0x14')](function(_0x4e1fc1){_0x1a00bd(_0x4e1fc1);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x5b')]=function(_0x57fd26,_0x57bdd2){scripts['sestekNDA'](this[_0xdf24('0x34')],_0x57fd26)['then'](function(_0x2752a8){_0x57bdd2(null,_0x2752a8);})[_0xdf24('0x14')](function(_0x4d16d3){_0x57bdd2(_0x4d16d3);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x5c')]=function(_0x584a12,_0x5dcbaa){scripts[_0xdf24('0x5c')](_0x584a12['key'],_0x584a12[_0xdf24('0x56')],_0x584a12[_0xdf24('0x5d')]||_0xdf24('0x5e'),_0x584a12[_0xdf24('0x5f')])['then'](function(_0x374e31){_0x5dcbaa(null,_0x374e31);})[_0xdf24('0x14')](function(_0x32b874){_0x5dcbaa(_0x32b874);});};AGIVertices[_0xdf24('0x10')]['ispeechASR']=function(_0x256cc1,_0x5e035e,_0x38e4ab){scripts[_0xdf24('0x60')](_0x5e035e,_0x256cc1[_0xdf24('0x59')],_0x256cc1['ispeech_asr_language']||_0xdf24('0x5e'),this[_0xdf24('0x61')](_0x256cc1[_0xdf24('0x62')])?_0x256cc1[_0xdf24('0x62')]:undefined)[_0xdf24('0x13')](function(_0x1a27e0){_0x38e4ab(null,_0x1a27e0);})['catch'](function(_0x341140){_0x38e4ab(_0x341140);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x63')]=function(_0x1a589a,_0x5990e2){scripts[_0xdf24('0x63')](_0x1a589a[_0xdf24('0x64')],_0x1a589a[_0xdf24('0x65')],_0x1a589a['aws_polly_region'],_0x1a589a[_0xdf24('0x66')]||_0xdf24('0x67'),_0x1a589a[_0xdf24('0x56')],_0x1a589a[_0xdf24('0x68')]||_0xdf24('0x56'))[_0xdf24('0x13')](function(_0x2cd586){_0x5990e2(null,_0x2cd586);})['catch'](function(_0x133428){_0x5990e2(_0x133428);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x69')]=function(_0x56dba9,_0x26008d){scripts[_0xdf24('0x69')](this['channel']['uniqueid'],_0x56dba9[_0xdf24('0x64')],_0x56dba9[_0xdf24('0x65')],_0x56dba9[_0xdf24('0x6a')],_0x56dba9[_0xdf24('0x56')],_0x56dba9['aws_bot_name'])['then'](function(_0x684f7b){_0x26008d(null,_0x684f7b);})['catch'](function(_0xeed2f6){_0x26008d(_0xeed2f6);});};AGIVertices['prototype'][_0xdf24('0x6b')]=function(_0x14520f,_0x115362,_0x23bbcc){scripts[_0xdf24('0x6b')](_0x115362,_0x14520f['key'],_0x14520f[_0xdf24('0x6c')]||_0xdf24('0x5e'))[_0xdf24('0x13')](function(_0x3644ba){_0x23bbcc(null,_0x3644ba);})['catch'](function(_0x5f3111){_0x23bbcc(_0x5f3111);});};AGIVertices[_0xdf24('0x10')][_0xdf24('0x6d')]=function(_0x1bb5b7,_0xd50abb,_0x499c36){scripts[_0xdf24('0x6d')](_0xd50abb,_0x1bb5b7[_0xdf24('0x6e')],_0x1bb5b7[_0xdf24('0x6f')],_0x1bb5b7[_0xdf24('0x70')])[_0xdf24('0x13')](function(_0x135e4d){_0x499c36(null,_0x135e4d);})['catch'](function(_0x2cd5ee){_0x499c36(_0x2cd5ee);});};AGIVertices['prototype']['clear']=function(_0x1eebcf){var _0x41b9b5=_[_0xdf24('0x71')](verticesWithRetry,_0x1eebcf[_0xdf24('0x37')])?_0x1eebcf:_[_0xdf24('0x72')](_0x1eebcf);for(var _0x513a25 in _0x41b9b5){if(_0x41b9b5['hasOwnProperty'](_0x513a25)){if(_0x41b9b5[_0x513a25]&&_['isString'](_0x41b9b5[_0x513a25])){_0x41b9b5[_0x513a25]=this['replaceAllVariables'](_0x41b9b5[_0x513a25]);}}}return _0x41b9b5;};AGIVertices['prototype'][_0xdf24('0x73')]=function(_0x4a04b5){var _0x1bd4b9=_0x4a04b5[_0xdf24('0x74')]('{');for(var _0x5a128f=0x1;_0x5a128f<_0x1bd4b9[_0xdf24('0x75')];_0x5a128f+=0x1){var _0x2868d1=_0x1bd4b9[_0x5a128f][_0xdf24('0x74')]('}');if(_0x2868d1[_0xdf24('0x75')]>0x1){_0x4a04b5=_0x4a04b5[_0xdf24('0x76')]('{'+_0x2868d1[0x0]+'}',this[_0xdf24('0x34')][_0xdf24('0x11')](_0x2868d1[0x0])[_0xdf24('0x77')]||_0x2868d1[0x0]);}}if(_0x1bd4b9[_0xdf24('0x75')]===0x1){return _0x4a04b5['toString']();}return this[_0xdf24('0x73')](_0x4a04b5);};AGIVertices[_0xdf24('0x10')][_0xdf24('0x78')]=function(_0x2c4bad,_0x3852ae){var _0x2e3489=this['channel']['getVariable'](_0x2c4bad);if(_0x2e3489['result']===-0x1){return _0x2e3489;}logger[_0xdf24('0x28')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x3852ae,_0x2e3489[_0xdf24('0x77')]));return this[_0xdf24('0x34')][_0xdf24('0x79')](_0x3852ae,_0x2e3489[_0xdf24('0x77')]);};AGIVertices[_0xdf24('0x10')][_0xdf24('0x61')]=function(_0xc778e2){return _0xc778e2&&_0xc778e2!=='0'&&_0xc778e2!=='-1'&&_0xc778e2!=='';};AGIVertices[_0xdf24('0x10')][_0xdf24('0x7a')]=function(_0x18b74f){this[_0xdf24('0x33')]['sync'](this,_0x18b74f,'-');_0x18b74f[_0xdf24('0x7b')]=_0x18b74f[_0xdf24('0x7a')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xdf24('0x8')]=function(_0x494f33){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x7c'),_0x494f33[_0xdf24('0x36')]));return this[_0xdf24('0x34')][_0xdf24('0x8')]([_0x494f33['command'],_0x494f33['args']]);};AGIVertices[_0xdf24('0x10')][_0xdf24('0x7d')]=function(_0x47e051){logger[_0xdf24('0x28')](util[_0xdf24('0x25')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x47e051[_0xdf24('0x36')]));if(this[_0xdf24('0x61')](_0x47e051[_0xdf24('0x7e')])){logger[_0xdf24('0x28')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x47e051[_0xdf24('0x7e')]));var _0x5cbf6d=this[_0xdf24('0x34')][_0xdf24('0x7f')](_0x47e051['timeout']);if(_0x5cbf6d[_0xdf24('0x80')]===-0x1){return _0x5cbf6d;}}return this[_0xdf24('0x34')]['answer']();};AGIVertices[_0xdf24('0x10')][_0xdf24('0x81')]=function(_0x50ec07){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x82'),_0x50ec07[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x50ec07[_0xdf24('0x47')])){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x50ec07,_0xdf24('0x83'));}_0x50ec07['scheduledAt']=moment();if(this[_0xdf24('0x61')](_0x50ec07[_0xdf24('0x84')])){_0x50ec07[_0xdf24('0x49')]=moment()[_0xdf24('0x85')](_0x50ec07['delay'],'minutes');}if(!this[_0xdf24('0x61')](_0x50ec07[_0xdf24('0x4b')])){_0x50ec07['callback_priority']=0x2;}this['createCmContact'][_0xdf24('0x86')](this,_0x50ec07);return this['channel'][_0xdf24('0x87')](util['format'](_0xdf24('0x88'),_0x50ec07[_0xdf24('0x46')],_0x50ec07[_0xdf24('0x47')],_0x50ec07['scheduledAt']));};AGIVertices[_0xdf24('0x10')][_0xdf24('0x89')]=function(_0x2a9709){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x8a'),_0x2a9709[_0xdf24('0x36')]));var _0x3c88bf=this[_0xdf24('0x34')][_0xdf24('0x53')](_0x2a9709[_0xdf24('0x8b')],_0x2a9709['options']);if(_0x3c88bf[_0xdf24('0x80')]===-0x1){return _0x3c88bf;}return this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')]('Executed\x20command\x20%s\x20%s',_0x2a9709[_0xdf24('0x8b')],_0x2a9709[_0xdf24('0x8c')]));};AGIVertices[_0xdf24('0x10')]['lumenvoxtts']=function(_0x726ead){logger[_0xdf24('0x28')](util['format'](_0xdf24('0x8d'),_0x726ead[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x726ead[_0xdf24('0x56')])){return this['channel'][_0xdf24('0x87')](_0xdf24('0x8e'));}var _0x4f91df='\x22'+_0x726ead[_0xdf24('0x56')]+'\x22';if(this[_0xdf24('0x61')](_0x726ead[_0xdf24('0x8c')])){_0x4f91df+=','+_0x726ead['options'];}var _0x1f270a=this[_0xdf24('0x34')]['exec'](_0xdf24('0x8f'),_0x4f91df);if(_0x1f270a[_0xdf24('0x80')]===-0x1){return _0x1f270a;}return this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x90'),_0x4f91df));};AGIVertices[_0xdf24('0x10')][_0xdf24('0x91')]=function(_0xffa4c){logger[_0xdf24('0x28')](util['format'](_0xdf24('0x92'),_0xffa4c[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0xffa4c[_0xdf24('0x56')])){return this['channel'][_0xdf24('0x87')]('no\x20text\x20configured');}var _0x133c0b='\x22'+_0xffa4c[_0xdf24('0x56')]+'\x22';if(this[_0xdf24('0x61')](_0xffa4c[_0xdf24('0x8c')])){_0x133c0b+=','+_0xffa4c[_0xdf24('0x8c')];}var _0x1ac56b=this[_0xdf24('0x34')][_0xdf24('0x53')](_0xdf24('0x8f'),_0x133c0b);if(_0x1ac56b[_0xdf24('0x80')]===-0x1){return _0x1ac56b;}return this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x90'),_0x133c0b));};AGIVertices[_0xdf24('0x10')][_0xdf24('0x93')]=function(_0x3d0c9a){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x94'),_0x3d0c9a[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x3d0c9a[_0xdf24('0x95')])){return this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0x96'));}var _0x252488=_0x3d0c9a['grammar'];if(this[_0xdf24('0x61')](_0x3d0c9a[_0xdf24('0x8c')])){_0x252488+=','+_0x3d0c9a['options'];}var _0x19f5a4=this[_0xdf24('0x34')][_0xdf24('0x53')](_0xdf24('0x97'),_0x252488);if(_0x19f5a4[_0xdf24('0x80')]===-0x1){return _0x19f5a4;}var _0x3d71d8=this[_0xdf24('0x78')](_0xdf24('0x98'),_0xdf24('0x99'));if(_0x3d71d8[_0xdf24('0x80')]===-0x1){return _0x3d71d8;}var _0x4232c1=this[_0xdf24('0x78')](_0xdf24('0x9a'),_0xdf24('0x9b'));if(_0x4232c1[_0xdf24('0x80')]===-0x1){return _0x4232c1;}var _0x12565a=this[_0xdf24('0x78')](_0xdf24('0x9c'),_0xdf24('0x9d'));if(_0x12565a[_0xdf24('0x80')]===-0x1){return _0x12565a;}return this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')]('Executed\x20command\x20MRCPRecog\x20%s',_0x252488));};AGIVertices['prototype']['sestekasr']=function(_0x1b6be6){logger[_0xdf24('0x28')](util[_0xdf24('0x25')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x1b6be6[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x1b6be6[_0xdf24('0x95')])){return this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0x96'));}var _0x200868=_0x1b6be6[_0xdf24('0x95')];if(this[_0xdf24('0x61')](_0x1b6be6[_0xdf24('0x8c')])){_0x200868+=','+_0x1b6be6[_0xdf24('0x8c')];}var _0x2bb1a2=this['channel'][_0xdf24('0x53')](_0xdf24('0x97'),_0x200868);if(_0x2bb1a2[_0xdf24('0x80')]===-0x1){return _0x2bb1a2;}var _0x469ad4=this['getAndSetVariable'](_0xdf24('0x98'),_0xdf24('0x9e'));if(_0x469ad4[_0xdf24('0x80')]===-0x1){return _0x469ad4;}var _0x266752=this[_0xdf24('0x78')](_0xdf24('0x9a'),_0xdf24('0x9f'));if(_0x266752[_0xdf24('0x80')]===-0x1){return _0x266752;}var _0x116c73=this[_0xdf24('0x78')]('RECOG_INSTANCE()',_0xdf24('0xa0'));if(_0x116c73[_0xdf24('0x80')]===-0x1){return _0x116c73;}return this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')]('Executed\x20command\x20MRCPRecog\x20%s',_0x200868));};AGIVertices[_0xdf24('0x10')]['database']=function(_0x395cf6){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0xa1'),_0x395cf6[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x395cf6[_0xdf24('0xa2')])){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x395cf6,_0xdf24('0xa3'));}var _0x55c429=this[_0xdf24('0x1a')]['sync'](this,_0x395cf6[_0xdf24('0xa2')]);if(!_0x55c429){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x395cf6,_0xdf24('0xa4'));}if(!this['isConfigured'](_0x395cf6[_0xdf24('0x2a')])){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x395cf6,_0xdf24('0xa5'));}var _0x31ae3c=_0x395cf6[_0xdf24('0x2a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0xa6'),_0x31ae3c));var _0x1ca6d5=this[_0xdf24('0xa7')][_0xdf24('0x86')](this,_0x55c429,_0x31ae3c);this['createSquareDetailsReport'][_0xdf24('0x86')](this,_0x395cf6,_0x31ae3c);if(!this['isConfigured'](_0x395cf6[_0xdf24('0xa8')])){return this['channel']['noop'](_0xdf24('0xa9'));}var _0x3ec9f1=this[_0xdf24('0x11')]['sync'](this,_0x395cf6[_0xdf24('0xa8')]);if(!_0x3ec9f1){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x395cf6,_0xdf24('0xaa'));}var _0x822a1e=this;_0x1ca6d5[_0xdf24('0xab')](function(_0xb1ac62,_0x550ef8){Object[_0xdf24('0xac')](_0xb1ac62)['forEach'](function(_0x2dd2af){_0x822a1e[_0xdf24('0x34')][_0xdf24('0x79')](util[_0xdf24('0x25')]('%s[%s][%s]',_0x3ec9f1,_0x550ef8,_0x2dd2af),_0xb1ac62[_0x2dd2af]);});});this[_0xdf24('0x34')]['setVariable'](util[_0xdf24('0x25')]('%s_ROWS_COUNT',_0x3ec9f1),_0x1ca6d5[_0xdf24('0x75')]);return this[_0xdf24('0x34')]['noop'](util[_0xdf24('0x25')]('variable\x20%s\x20set',_0x3ec9f1));};AGIVertices['prototype']['dial']=function(_0x35435e){logger[_0xdf24('0xad')](util[_0xdf24('0x25')](_0xdf24('0xae'),_0x35435e[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x35435e[_0xdf24('0xaf')])){return this[_0xdf24('0x34')]['error'](_0x35435e,_0xdf24('0xb0'));}var _0xfe91aa=this[_0xdf24('0xb1')]['sync'](this,_0x35435e[_0xdf24('0xaf')]);if(!_0xfe91aa){return this['channel'][_0xdf24('0x2e')](_0x35435e,_0xdf24('0xb2'));}var _0x354996=this[_0xdf24('0x34')]['exec'](_0xdf24('0xb3'),[util[_0xdf24('0x25')](_0xdf24('0xb4'),_0xfe91aa),_0x35435e['timeout'],_0x35435e['opts'],_0x35435e[_0xdf24('0xb5')]]);if(_0x354996['result']===-0x1){return _0x354996;}return this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0xb6'),'DIAL'));};AGIVertices[_0xdf24('0x10')][_0xdf24('0xb7')]=function(_0xdb16fa){logger[_0xdf24('0x28')](util['format'](_0xdf24('0xb8'),_0xdb16fa[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0xdb16fa[_0xdf24('0x59')])){return this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0xb9'));}if(!this[_0xdf24('0x61')](_0xdb16fa[_0xdf24('0x56')])){return this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0x8e'));}this['channel'][_0xdf24('0xba')]=!![];this[_0xdf24('0x33')](_0xdb16fa);this[_0xdf24('0x40')](_0xdb16fa[_0xdf24('0x56')],'in');this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')]('Trying\x20Dialogflow:\x20%s',_0xdb16fa[_0xdf24('0x56')]));var _0x20519a=this[_0xdf24('0x58')]['sync'](this,_0xdb16fa);if(_0x20519a){for(var _0x6d72ee in _0x20519a){if(_0x20519a[_0xdf24('0xbb')](_0x6d72ee)){this['channel'][_0xdf24('0x79')](util[_0xdf24('0x25')](_0xdf24('0xbc'),_0x6d72ee['toUpperCase']()),_0x20519a[_0x6d72ee]);}}this[_0xdf24('0x40')](_0x20519a[_0xdf24('0xbd')],_0xdf24('0xbe'));return this[_0xdf24('0x34')]['noop'](util[_0xdf24('0x25')](_0xdf24('0xbf'),_0x20519a[_0xdf24('0xbd')]));}return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0xdb16fa,_0xdf24('0xc0'));};AGIVertices[_0xdf24('0x10')][_0xdf24('0xc1')]=function(_0x8a9c22){logger[_0xdf24('0x28')](util[_0xdf24('0x25')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x8a9c22[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x8a9c22[_0xdf24('0xc2')])){return this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0xc3'));}if(!this['isConfigured'](_0x8a9c22[_0xdf24('0xc4')])){return this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0xc5'));}if(!this[_0xdf24('0x61')](_0x8a9c22[_0xdf24('0xc6')])){return this[_0xdf24('0x34')]['noop']('no\x20password\x20configured');}if(!this['isConfigured'](_0x8a9c22[_0xdf24('0xc7')])){return this[_0xdf24('0x34')]['noop'](_0xdf24('0x8e'));}this[_0xdf24('0x34')][_0xdf24('0xba')]=!![];this[_0xdf24('0x33')](_0x8a9c22);this[_0xdf24('0x40')](_0x8a9c22['text'],'in');this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0xc8'),_0x8a9c22[_0xdf24('0x56')]));var _0x15ed2b=this['sestekNDA']['sync'](this,_0x8a9c22);if(_0x15ed2b){for(var _0x46f0a5 in _0x15ed2b){if(_0x15ed2b['hasOwnProperty'](_0x46f0a5)){this[_0xdf24('0x34')][_0xdf24('0x79')](util[_0xdf24('0x25')](_0xdf24('0xc9'),_0x46f0a5[_0xdf24('0xca')]()),_0x15ed2b[_0x46f0a5]);}}this[_0xdf24('0x40')](_0x15ed2b['speech'],_0xdf24('0xbe'));if(_0x15ed2b[_0xdf24('0xcb')]){this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0xcc'),_0x15ed2b[_0xdf24('0xcb')]));var _0x200ad4=this['channel']['streamFile'](_0x15ed2b['audiofile']);try{fs['unlink'](_0x15ed2b[_0xdf24('0xcb')]+_0xdf24('0xcd'));}catch(_0x77c7b4){logger['error'](_0x77c7b4);}return _0x200ad4;}else{return this['channel']['noop'](util[_0xdf24('0x25')](_0xdf24('0xce'),_0x15ed2b[_0xdf24('0xbd')]));}}return this['channel']['error'](_0x8a9c22,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0xdf24('0xcf')]=function(_0x2a3da6){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0xd0'),_0x2a3da6['label']));return this[_0xdf24('0x34')]['noop']('end');};AGIVertices[_0xdf24('0x10')][_0xdf24('0xd1')]=function(_0x7cd7b5){logger['info'](util[_0xdf24('0x25')](_0xdf24('0xd2'),_0x7cd7b5[_0xdf24('0x36')]));var _0x47d63a='';if(_0x7cd7b5[_0xdf24('0xd3')]){if(!this[_0xdf24('0x61')](_0x7cd7b5[_0xdf24('0xd3')])){return this[_0xdf24('0x34')]['error'](_0x7cd7b5,_0xdf24('0xd4'));}else{var _0x52321a=parseInt(_0x7cd7b5[_0xdf24('0xd3')],0xa);if(isNaN(_0x52321a)){_0x47d63a=_0x7cd7b5[_0xdf24('0xd3')];}else{_0x47d63a=this[_0xdf24('0x1d')][_0xdf24('0x86')](this,_0x7cd7b5[_0xdf24('0xd3')]);if(!_0x47d63a){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x7cd7b5,_0xdf24('0xd5'));}}}}else if(_0x7cd7b5[_0xdf24('0xd6')]){_0x47d63a=_0x7cd7b5[_0xdf24('0xd6')];}else{return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x7cd7b5,_0xdf24('0xd4'));}var _0x4bb576=this[_0xdf24('0x34')][_0xdf24('0x53')](_0xdf24('0xb3'),[util[_0xdf24('0x25')]('SIP/%s/%s',_0x47d63a,_0x7cd7b5[_0xdf24('0x46')]),_0x7cd7b5['timeout'],_0x7cd7b5[_0xdf24('0xd7')],_0x7cd7b5[_0xdf24('0xb5')]]);if(_0x4bb576[_0xdf24('0x80')]===-0x1){return _0x4bb576;}return this['channel'][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0xb6'),'DIAL'));};AGIVertices[_0xdf24('0x10')][_0xdf24('0xd8')]=function(_0x73bc3a){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0xd9'),_0x73bc3a[_0xdf24('0x36')]));return this['channel']['noop'](_0xdf24('0xd8'));};AGIVertices[_0xdf24('0x10')]['getdigits']=function(_0x2ceafc){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0xda'),_0x2ceafc[_0xdf24('0x36')]));if(_0x2ceafc[_0xdf24('0x7b')]===0x0){return this[_0xdf24('0x7a')](_0x2ceafc);}_0x2ceafc[_0xdf24('0x7b')]-=0x1;if(!this['isConfigured'](_0x2ceafc[_0xdf24('0xdb')])){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x2ceafc,_0xdf24('0xdc'));}var _0x1eed02=this[_0xdf24('0xdd')]['sync'](this,_0x2ceafc[_0xdf24('0xdb')]);if(!_0x1eed02){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x2ceafc,_0xdf24('0xde'));}if(!this[_0xdf24('0x61')](_0x2ceafc[_0xdf24('0xa8')])){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0xdf24('0xa9'));}var _0x41d5bd=this[_0xdf24('0x34')][_0xdf24('0xdf')](_0x1eed02,_0x2ceafc['response'],_0x2ceafc[_0xdf24('0xe0')]);var _0x217431=_0x41d5bd['result']?_0x41d5bd['result']['toString']():'';logger[_0xdf24('0x28')](_0xdf24('0xe1'),JSON[_0xdf24('0xe2')](_0x41d5bd));if(_0x41d5bd[_0xdf24('0x80')]===-0x1){this['createSquareDetailsReport'][_0xdf24('0x86')](this,_0x2ceafc,_0x217431);return _0x41d5bd;}else if(_0x41d5bd[_0xdf24('0x77')]===_0xdf24('0x7e')){_0x41d5bd[_0xdf24('0x80')]=_0x217431['length']>=parseInt(_0x2ceafc[_0xdf24('0xe3')])?'x':'i';}else{_0x41d5bd[_0xdf24('0x80')]=_0x217431[_0xdf24('0x75')]>=parseInt(_0x2ceafc[_0xdf24('0xe3')])&&_0x217431['length']<=parseInt(_0x2ceafc['maxdigit'])?'x':'i';}var _0x3381e5=this['getVariable']['sync'](this,_0x2ceafc[_0xdf24('0xa8')]);if(!_0x3381e5){return this['channel'][_0xdf24('0x2e')](_0x2ceafc,'no\x20variable\x20found');}this[_0xdf24('0x34')][_0xdf24('0x79')](_0x3381e5,_0x217431);if(this[_0xdf24('0x61')](_0x2ceafc[_0xdf24('0xe4')])){var _0xa81760=parseInt(_0x2ceafc['hiddendigitsnum'],0xa);var _0x5b2740=rs[_0xdf24('0xe5')]({'charset':'*','length':_0xa81760});var _0x55260d=_0x217431[_0xdf24('0x75')];if(_0x55260d>0x0){if(_0x55260d>_0xa81760){this['createSquareDetailsReport'][_0xdf24('0x86')](this,_0x2ceafc,_0x2ceafc[_0xdf24('0xe6')]===_0xdf24('0xe7')?_0x5b2740+_0x217431[_0xdf24('0xe8')](_0xa81760):_0x217431['substr'](0x0,_0x55260d-_0xa81760)+_0x5b2740);}else{this[_0xdf24('0x33')][_0xdf24('0x86')](this,_0x2ceafc,rs[_0xdf24('0xe5')]({'charset':'*','length':_0x55260d}));}}else{this['createSquareDetailsReport']['sync'](this,_0x2ceafc,'');}}else{this[_0xdf24('0x33')]['sync'](this,_0x2ceafc,_0x217431);}return _0x41d5bd;};AGIVertices[_0xdf24('0x10')]['getsecretdigits']=function(_0x2dcc6f){logger[_0xdf24('0x28')](util[_0xdf24('0x25')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x2dcc6f[_0xdf24('0x36')]));return this[_0xdf24('0xc')](_0x2dcc6f);};AGIVertices[_0xdf24('0x10')][_0xdf24('0xe9')]=function(_0x2a4bb1){logger[_0xdf24('0x28')](util['format'](_0xdf24('0xea'),_0x2a4bb1[_0xdf24('0x36')]));this[_0xdf24('0x33')][_0xdf24('0x86')](this,_0x2a4bb1,_0x2a4bb1[_0xdf24('0xeb')]);return this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')]('GOAL\x20%s',_0x2a4bb1[_0xdf24('0xeb')]));};AGIVertices[_0xdf24('0x10')][_0xdf24('0xec')]=function(_0x20fd5e){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0xed'),_0x20fd5e[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x20fd5e[_0xdf24('0x64')])||!this[_0xdf24('0x61')](_0x20fd5e['aws_secret_access_key'])){return this['channel'][_0xdf24('0x87')](_0xdf24('0xee'));}if(!this['isConfigured'](_0x20fd5e[_0xdf24('0x56')])){return this['channel'][_0xdf24('0x87')]('no\x20text\x20configured');}this['channel']['noop'](util[_0xdf24('0x25')](_0xdf24('0xef'),_0x20fd5e[_0xdf24('0x56')]));var _0x5a10cb=this[_0xdf24('0x63')]['sync'](this,_0x20fd5e);if(_0x5a10cb){this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0xf0'),_0x5a10cb));var _0x357b4f=this['channel'][_0xdf24('0xf1')](_0x5a10cb);try{fs['unlink'](_0x5a10cb+_0xdf24('0xcd'));}catch(_0x5a7b44){logger[_0xdf24('0x2e')](_0x5a7b44);}return _0x357b4f;}return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x20fd5e,_0xdf24('0xf2'));};AGIVertices[_0xdf24('0x10')][_0xdf24('0xf3')]=function(_0x1bac75){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0xf4'),_0x1bac75[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x1bac75[_0xdf24('0x64')])||!this[_0xdf24('0x61')](_0x1bac75['aws_secret_access_key'])){return this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0xee'));}if(!this[_0xdf24('0x61')](_0x1bac75['aws_bot_name'])){return this[_0xdf24('0x34')]['noop'](_0xdf24('0xf5'));}if(!this[_0xdf24('0x61')](_0x1bac75[_0xdf24('0x56')])){return this[_0xdf24('0x34')][_0xdf24('0x87')]('no\x20text\x20configured');}this[_0xdf24('0x34')]['bot']=!![];this['createSquareDetailsReport'](_0x1bac75);this[_0xdf24('0x40')](_0x1bac75[_0xdf24('0x56')],'in');this[_0xdf24('0x34')]['noop'](util[_0xdf24('0x25')]('Trying\x20Amazon\x20Lex:\x20%s',_0x1bac75[_0xdf24('0x56')]));var _0x53ee4d=this[_0xdf24('0x69')][_0xdf24('0x86')](this,_0x1bac75);if(_0x53ee4d){for(var _0x3686fe in _0x53ee4d){if(_0x53ee4d[_0xdf24('0xbb')](_0x3686fe)&&_[_0xdf24('0xf6')](_0x53ee4d[_0x3686fe])){this[_0xdf24('0x34')][_0xdf24('0x79')](util[_0xdf24('0x25')]('AWS_LEX_%s',_0x3686fe['toUpperCase']()),_0x53ee4d[_0x3686fe]);}}if(_[_0xdf24('0x45')](_0x53ee4d['message'])){return this[_0xdf24('0x34')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xdf24('0x40')](_0x53ee4d[_0xdf24('0xf7')],_0xdf24('0xbe'));return this['channel']['noop'](util[_0xdf24('0x25')](_0xdf24('0xf8'),_0x53ee4d[_0xdf24('0xf7')]));}}return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x1bac75,_0xdf24('0xf9'));};AGIVertices[_0xdf24('0x10')][_0xdf24('0xfa')]=function(_0x3ab85e){logger['info'](util[_0xdf24('0x25')](_0xdf24('0xfb'),_0x3ab85e[_0xdf24('0x36')],_0x3ab85e[_0xdf24('0x7e')]));if(!this[_0xdf24('0x61')](_0x3ab85e[_0xdf24('0x59')])){return this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0xb9'));}var _0xe99fd2='wav';var _0x1dc0e8=util[_0xdf24('0x25')](_0xdf24('0xfc'),FILES_PATH,rs['generate'](0x4));var _0x52b4f4=util[_0xdf24('0x25')](_0xdf24('0xfd'),_0x1dc0e8,_0xe99fd2);var _0x4584fe=!![];if(_0x3ab85e[_0xdf24('0xfe')]===_0xdf24('0xff')){_0x4584fe=![];}var _0x45c4c4=this[_0xdf24('0x34')][_0xdf24('0x100')](_0x1dc0e8,_0xe99fd2,_0x3ab85e[_0xdf24('0x101')],_0x3ab85e['timeout'],undefined,_0x4584fe);if(_0x45c4c4[_0xdf24('0x80')]!==-0x1){this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')]('google\x20%s\x20file\x20created',_0x52b4f4));var _0x37e561=this[_0xdf24('0x6b')][_0xdf24('0x86')](this,_0x3ab85e,_0x52b4f4);if(_0x37e561){for(var _0x34c965 in _0x37e561){if(_0x37e561[_0xdf24('0xbb')](_0x34c965)){this[_0xdf24('0x34')]['setVariable'](util[_0xdf24('0x25')](_0xdf24('0x102'),_0x34c965[_0xdf24('0xca')]()),_0x37e561[_0x34c965]);}}return this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x103'),JSON['stringify'](_0x37e561)));}}return _0x45c4c4;};AGIVertices[_0xdf24('0x10')][_0xdf24('0x104')]=function(_0xdf77b9){logger['info'](util[_0xdf24('0x25')](_0xdf24('0x105'),_0xdf77b9[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0xdf77b9[_0xdf24('0x6e')])){return this['channel'][_0xdf24('0x87')](_0xdf24('0x106'));}if(!this[_0xdf24('0x61')](_0xdf77b9[_0xdf24('0x6f')])){return this['channel'][_0xdf24('0x87')]('no\x20appsecret\x20configured');}var _0x2a1e23=_0xdf24('0x107');var _0x4752eb=util[_0xdf24('0x25')](_0xdf24('0xfc'),FILES_PATH,rs['generate'](0x4));var _0x1d9281=util[_0xdf24('0x25')](_0xdf24('0xfd'),_0x4752eb,_0x2a1e23);var _0x113c2f=!![];if(_0xdf77b9['beep']===_0xdf24('0xff')){_0x113c2f=![];}var _0x499cf5=this[_0xdf24('0x34')][_0xdf24('0x100')](_0x4752eb,_0x2a1e23,_0xdf77b9[_0xdf24('0x101')],_0xdf77b9[_0xdf24('0x7e')],undefined,_0x113c2f);if(_0x499cf5[_0xdf24('0x80')]!==-0x1){this['channel']['noop'](util['format'](_0xdf24('0x108'),_0x1d9281));var _0x249d9d=this[_0xdf24('0x6d')]['sync'](this,_0xdf77b9,_0x1d9281);if(_0x249d9d){for(var _0x4decc7 in _0x249d9d){if(_0x249d9d[_0xdf24('0xbb')](_0x4decc7)){this[_0xdf24('0x34')][_0xdf24('0x79')](util[_0xdf24('0x25')](_0xdf24('0x109'),_0x4decc7[_0xdf24('0xca')]()),_0x249d9d[_0x4decc7]);}}return this[_0xdf24('0x34')]['noop'](util[_0xdf24('0x25')](_0xdf24('0x10a'),JSON[_0xdf24('0xe2')](_0x249d9d)));}}return _0x499cf5;};AGIVertices[_0xdf24('0x10')][_0xdf24('0x10b')]=function(_0x5476fd){logger['info'](util['format'](_0xdf24('0x10c'),_0x5476fd['label']));return this[_0xdf24('0x34')][_0xdf24('0x10d')](_0x5476fd[_0xdf24('0x3c')],_0x5476fd[_0xdf24('0x3d')],_0x5476fd['priority']);};AGIVertices['prototype']['gotoif']=function(_0x39579b){logger['info'](util['format'](_0xdf24('0x10e'),_0x39579b[_0xdf24('0x36')]));if(!this['isConfigured'](_0x39579b['condition'])){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x39579b,'no\x20condition\x20configured');}try{var _0x37e272=eval(_0x39579b[_0xdf24('0x10f')])?'true':'false';this['channel'][_0xdf24('0x87')](util['format'](_0xdf24('0x110'),_0x39579b[_0xdf24('0x10f')],_0x37e272));return{'code':0xc8,'result':_0x37e272};}catch(_0x23f13c){return{'code':0xc8,'result':_0xdf24('0x111')};}};AGIVertices['prototype'][_0xdf24('0x112')]=function(_0xfdefde){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x113'),_0xfdefde['label']));if(!this[_0xdf24('0x61')](_0xfdefde[_0xdf24('0x114')])){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0xfdefde,_0xdf24('0x115'));}var _0x3bd7b3=this['getIntervals']['sync'](this,_0xfdefde[_0xdf24('0x114')]);if(!_0x3bd7b3){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0xfdefde,_0xdf24('0x116'));}for(var _0x210bdf=0x0;_0x210bdf<_0x3bd7b3['length'];_0x210bdf+=0x1){var _0xccc58b=this['channel'][_0xdf24('0x11')](util[_0xdf24('0x25')]('IFTIME(%s?true:false)',_0x3bd7b3[_0x210bdf]));if(_0xccc58b[_0xdf24('0x80')]===-0x1){return _0xccc58b;}logger['info'](util['format'](_0xdf24('0x117'),_0x3bd7b3[_0x210bdf],_0xccc58b[_0xdf24('0x77')]));if(_0xccc58b[_0xdf24('0x77')]==='true'){logger[_0xdf24('0x28')](util['format'](_0xdf24('0x117'),_0x3bd7b3[_0x210bdf],'true'));this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x117'),_0x3bd7b3[_0x210bdf],_0xdf24('0x118')));return{'code':0xc8,'result':_0xdf24('0x118')};}else{logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x117'),_0x3bd7b3[_0x210bdf],'false'));this[_0xdf24('0x34')]['noop'](util[_0xdf24('0x25')]('IFTIME\x20%s\x20%s',_0x3bd7b3[_0x210bdf],_0xdf24('0x111')));}}return{'code':0xc8,'result':_0xdf24('0x111')};};AGIVertices['prototype']['hangup']=function(_0x512d56){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x119'),_0x512d56[_0xdf24('0x36')]));return this['channel'][_0xdf24('0x11a')]();};AGIVertices['prototype'][_0xdf24('0x11b')]=function(_0x3a733d){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x11c'),_0x3a733d[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x3a733d[_0xdf24('0x59')])){return this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0xb9'));}var _0x52ceb0='wav';var _0xcdce48=util['format'](_0xdf24('0xfc'),FILES_PATH,rs[_0xdf24('0xe5')](0x4));var _0x2da163=util[_0xdf24('0x25')](_0xdf24('0xfd'),_0xcdce48,_0x52ceb0);var _0x414f2f=!![];if(_0x3a733d[_0xdf24('0xfe')]===_0xdf24('0xff')){_0x414f2f=![];}var _0x364d74=this['channel'][_0xdf24('0x100')](_0xcdce48,_0x52ceb0,_0x3a733d[_0xdf24('0x101')],_0x3a733d[_0xdf24('0x7e')],undefined,_0x414f2f);if(_0x364d74[_0xdf24('0x80')]!==-0x1){this[_0xdf24('0x34')][_0xdf24('0x87')](util['format']('ispeech\x20%s\x20file\x20created',_0x2da163));var _0x469c1a=this['ispeechASR'][_0xdf24('0x86')](this,_0x3a733d,_0x2da163);if(_0x469c1a){for(var _0xd142c9 in _0x469c1a){if(_0x469c1a['hasOwnProperty'](_0xd142c9)){this[_0xdf24('0x34')][_0xdf24('0x79')](util[_0xdf24('0x25')](_0xdf24('0x11d'),_0xd142c9[_0xdf24('0xca')]()),_0x469c1a[_0xd142c9]);}}return this['channel'][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x11e'),JSON['stringify'](_0x469c1a)));}}return _0x364d74;};AGIVertices[_0xdf24('0x10')][_0xdf24('0x11f')]=function(_0x5931f9){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x120'),_0x5931f9[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x5931f9['key'])){return this['channel'][_0xdf24('0x87')](_0xdf24('0xb9'));}if(!this[_0xdf24('0x61')](_0x5931f9[_0xdf24('0x56')])){return this['channel'][_0xdf24('0x87')](_0xdf24('0x8e'));}this['channel'][_0xdf24('0x87')](util['format'](_0xdf24('0x121'),_0x5931f9[_0xdf24('0x56')]));var _0x31217e=this[_0xdf24('0x5c')][_0xdf24('0x86')](this,_0x5931f9);if(_0x31217e){this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x122'),_0x31217e));var _0x1fe55b=this['channel'][_0xdf24('0xf1')](_0x31217e,_0x5931f9['intKey']);try{fs[_0xdf24('0x123')](_0x31217e+'.wav');}catch(_0x8be3ed){logger[_0xdf24('0x2e')](_0x8be3ed);}return _0x1fe55b;}return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x5931f9,_0xdf24('0x124'));};AGIVertices['prototype']['login']=function(_0x4902f6){logger['info'](util['format'](_0xdf24('0x125'),_0x4902f6[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x4902f6[_0xdf24('0x126')])){return this['channel']['error'](_0x4902f6,_0xdf24('0x127'));}logger['info'](util['format'](_0xdf24('0x128'),this[_0xdf24('0x34')][_0xdf24('0x39')],_0x4902f6['findBy']));var _0x49b72a=this[_0xdf24('0x50')][_0xdf24('0x86')](this,_0x4902f6['findBy']);if(_0x49b72a){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x129'),this[_0xdf24('0x34')][_0xdf24('0x39')],_0x4902f6[_0xdf24('0x126')]));this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xdf24('0x34')][_0xdf24('0x39')],_0x4902f6[_0xdf24('0x126')]));return{'code':0xc8,'result':_0xdf24('0x12a')};}else{logger['info'](util['format'](_0xdf24('0x12b'),this[_0xdf24('0x34')]['callerid'],_0x4902f6['findBy']));this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x12b'),this['channel']['callerid'],_0x4902f6['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xdf24('0x10')][_0xdf24('0x12c')]=function(_0x5d7f92){logger['info'](util[_0xdf24('0x25')](_0xdf24('0x12d'),_0x5d7f92[_0xdf24('0x36')]));if(!this['isConfigured'](_0x5d7f92['findBy'])){return this[_0xdf24('0x34')]['error'](_0x5d7f92,_0xdf24('0x127'));}logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x128'),this[_0xdf24('0x34')][_0xdf24('0x39')],_0x5d7f92[_0xdf24('0x126')]));var _0x376104=this[_0xdf24('0x4f')][_0xdf24('0x86')](this,_0x5d7f92[_0xdf24('0x126')]);if(_0x376104){logger[_0xdf24('0x28')](util[_0xdf24('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xdf24('0x34')][_0xdf24('0x39')],_0x5d7f92[_0xdf24('0x126')]));this[_0xdf24('0x34')][_0xdf24('0x87')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xdf24('0x34')]['callerid'],_0x5d7f92[_0xdf24('0x126')]));return{'code':0xc8,'result':_0xdf24('0x12a')};}else{logger[_0xdf24('0x28')](util['format'](_0xdf24('0x12b'),this['channel'][_0xdf24('0x39')],_0x5d7f92['findBy']));this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x12b'),this[_0xdf24('0x34')][_0xdf24('0x39')],_0x5d7f92[_0xdf24('0x126')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xdf24('0x10')][_0xdf24('0x12e')]=function(_0x241111){logger[_0xdf24('0x28')](util[_0xdf24('0x25')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x241111[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x241111['operation'])){return this[_0xdf24('0x34')]['error'](_0x241111,_0xdf24('0x12f'));}this[_0xdf24('0x34')]['noop'](util[_0xdf24('0x25')]('math\x20%s',_0x241111['operation']));var _0x3f38c5=eval(_0x241111['operation']);if(!this[_0xdf24('0x61')](_0x241111[_0xdf24('0xa8')])){return this['channel'][_0xdf24('0x87')](_0xdf24('0xa9'));}var _0x228b42=this[_0xdf24('0x11')]['sync'](this,_0x241111[_0xdf24('0xa8')]);if(!_0x228b42){return this['channel'][_0xdf24('0x2e')](_0x241111,'no\x20variable\x20found');}if(_[_0xdf24('0x130')](_0x3f38c5)){var _0x4b171f=this;_0x3f38c5['forEach'](function(_0xe1c7a7,_0x2473fc){_0x4b171f[_0xdf24('0x34')][_0xdf24('0x79')](util[_0xdf24('0x25')](_0xdf24('0x131'),_0x228b42,_0x2473fc),_0xe1c7a7);});return this[_0xdf24('0x34')]['noop'](util[_0xdf24('0x25')]('variable\x20%s[key]\x20set',_0x228b42));}else{return this[_0xdf24('0x34')][_0xdf24('0x79')](_0x228b42,_0x3f38c5);}};AGIVertices[_0xdf24('0x10')]['menu']=function(_0x3d28ee){logger[_0xdf24('0x28')](util['format'](_0xdf24('0x132'),_0x3d28ee[_0xdf24('0x36')]));if(_0x3d28ee[_0xdf24('0x7b')]===0x0){return this[_0xdf24('0x7a')](_0x3d28ee);}_0x3d28ee[_0xdf24('0x7b')]-=0x1;if(!this['isConfigured'](_0x3d28ee[_0xdf24('0xdb')])){return this['channel'][_0xdf24('0x2e')](_0x3d28ee,'no\x20file\x20audio\x20selected');}var _0x9f49d4=this[_0xdf24('0xdd')][_0xdf24('0x86')](this,_0x3d28ee['file_id']);if(!_0x9f49d4){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x3d28ee,_0xdf24('0xde'));}var _0x32d354=this[_0xdf24('0x34')]['getData'](_0x9f49d4,_0x3d28ee[_0xdf24('0x133')],_0x3d28ee[_0xdf24('0x134')]);var _0x1d7d2c=_0x32d354[_0xdf24('0x80')];if(_0x32d354['result']===-0x1){this[_0xdf24('0x33')][_0xdf24('0x86')](this,_0x3d28ee,'-1');return _0x32d354;}else if(_0x32d354[_0xdf24('0x77')]===_0xdf24('0x7e')){_0x32d354[_0xdf24('0x80')]=_0x32d354['result'][_0xdf24('0x75')]>0x0?_0x32d354[_0xdf24('0x80')]:'t';}else if(_[_0xdf24('0x42')](_0x32d354['result'])){_0x32d354[_0xdf24('0x80')]='#';_0x1d7d2c='#';}if(!this[_0xdf24('0x61')](_0x3d28ee['variable_id'])){this[_0xdf24('0x34')][_0xdf24('0x87')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x3f560f=this[_0xdf24('0x11')][_0xdf24('0x86')](this,_0x3d28ee['variable_id']);if(!_0x3f560f){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x3d28ee,_0xdf24('0xaa'));}this[_0xdf24('0x34')][_0xdf24('0x79')](_0x3f560f,_0x1d7d2c);}this[_0xdf24('0x33')]['sync'](this,_0x3d28ee,_0x1d7d2c);return _0x32d354;};AGIVertices[_0xdf24('0x10')]['noop']=function(_0x1d5d8b){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x135'),_0x1d5d8b[_0xdf24('0x36')]));return this[_0xdf24('0x34')][_0xdf24('0x87')](_0x1d5d8b[_0xdf24('0x136')]||_0x1d5d8b[_0xdf24('0x36')]);};AGIVertices[_0xdf24('0x10')][_0xdf24('0x137')]=function(_0x305c4){logger[_0xdf24('0x28')](util[_0xdf24('0x25')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x305c4[_0xdf24('0x36')]));if(!this['isConfigured'](_0x305c4[_0xdf24('0x126')])){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x305c4,_0xdf24('0x127'));}logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x128'),this[_0xdf24('0x34')][_0xdf24('0x39')],_0x305c4['findBy']));var _0x2c8f3e=this[_0xdf24('0x138')][_0xdf24('0x86')](this,_0x305c4[_0xdf24('0x139')]);var _0x16bd98=this[_0xdf24('0x4c')][_0xdf24('0x86')](this,_0x305c4[_0xdf24('0x126')],_0x2c8f3e);if(_0x16bd98){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x129'),this[_0xdf24('0x34')][_0xdf24('0x39')],_0x305c4[_0xdf24('0x126')]));this[_0xdf24('0x34')][_0xdf24('0x87')](util['format'](_0xdf24('0x129'),this[_0xdf24('0x34')][_0xdf24('0x39')],_0x305c4[_0xdf24('0x126')]));return{'code':0xc8,'result':_0xdf24('0x12a')};}else{logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x12b'),this[_0xdf24('0x34')][_0xdf24('0x39')],_0x305c4['findBy']));this['channel'][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x129'),this[_0xdf24('0x34')]['callerid'],_0x305c4[_0xdf24('0x126')]));return{'code':0xc8,'result':_0xdf24('0x13a')};}};AGIVertices[_0xdf24('0x10')]['playback']=function(_0x471b08){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x13b'),_0x471b08[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x471b08[_0xdf24('0xdb')])){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x471b08,_0xdf24('0xdc'));}var _0x3dc422=this['getSound'][_0xdf24('0x86')](this,_0x471b08[_0xdf24('0xdb')]);if(!_0x3dc422){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x471b08,_0xdf24('0xde'));}var _0x55a463=this[_0xdf24('0x34')]['exec'](_0xdf24('0x13c'),[_0x3dc422,_0x471b08[_0xdf24('0xd7')]]);if(_0x55a463[_0xdf24('0x80')]===-0x1){return _0x55a463;}return this[_0xdf24('0x34')][_0xdf24('0x87')](util['format'](_0xdf24('0x13d'),_0xdf24('0x13c'),_0x3dc422));};AGIVertices['prototype'][_0xdf24('0x13e')]=function(_0xfabebe){logger[_0xdf24('0x28')](util['format'](_0xdf24('0x13f'),_0xfabebe[_0xdf24('0x36')]));if(!this['isConfigured'](_0xfabebe['queue_id'])){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0xfabebe,_0xdf24('0x140'));}var _0x229c80='';var _0x5af731=parseInt(_0xfabebe['queue_id'],0xa);if(isNaN(_0x5af731)){_0x229c80=_0xfabebe[_0xdf24('0x141')];}else{_0x229c80=this[_0xdf24('0x15')][_0xdf24('0x86')](this,_0xfabebe['queue_id']);if(!_0x229c80){return this['channel'][_0xdf24('0x2e')](_0xfabebe,_0xdf24('0x142'));}}var _0x2b49ec='';if(this[_0xdf24('0x61')](_0xfabebe[_0xdf24('0xdb')])){var _0x2155ed=this[_0xdf24('0xdd')][_0xdf24('0x86')](this,_0xfabebe['file_id']);if(_0x2155ed){_0x2b49ec=_0x2155ed;}}this[_0xdf24('0x33')][_0xdf24('0x86')](this,_0xfabebe,_0x229c80);if(_0xfabebe[_0xdf24('0xd7')][_0xdf24('0x143')]('x')<0x0){_0xfabebe['opts']+='x';}if(_0xfabebe['opts'][_0xdf24('0x143')]('X')<0x0){_0xfabebe[_0xdf24('0xd7')]+='X';}this[_0xdf24('0x34')][_0xdf24('0x79')](_0xdf24('0x144'),_0x229c80?_0x229c80[_0xdf24('0x145')]():'');var _0x32390e=this[_0xdf24('0x34')][_0xdf24('0x53')]('QUEUE',[_0x229c80,_0xfabebe['opts'],_0xfabebe[_0xdf24('0xb5')],_0x2b49ec,_0xfabebe[_0xdf24('0x7e')],_0xfabebe[_0xdf24('0x8')],_0xfabebe['macro'],_0xfabebe[_0xdf24('0x146')],'',_0xfabebe['position']]);if(_0x32390e[_0xdf24('0x80')]===-0x1){return _0x32390e;}return this['channel'][_0xdf24('0x87')](util[_0xdf24('0x25')]('Executed\x20command\x20%s\x20%s',_0xdf24('0x147'),_0x229c80));};AGIVertices[_0xdf24('0x10')][_0xdf24('0x148')]=function(_0x1abce0){logger[_0xdf24('0x28')](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x1abce0[_0xdf24('0x36')]));var _0x95805f=_0x1abce0[_0xdf24('0x149')]||_0xdf24('0x107');var _0xc51926=util[_0xdf24('0x25')](_0xdf24('0x14a'),this[_0xdf24('0x34')][_0xdf24('0x35')],rs[_0xdf24('0xe5')](0x5));var _0x345d33=util[_0xdf24('0x25')](_0xdf24('0x14b'),FILES_PATH,_0xc51926,_0x95805f);var _0x4909cd=util[_0xdf24('0x25')](_0xdf24('0xfc'),FILES_PATH,_0xc51926);this['createSquareRecording'][_0xdf24('0x86')](this,_0x1abce0,_0xc51926,_0x345d33);this[_0xdf24('0x34')][_0xdf24('0x79')]('RECORDING_SAVENAME',_0xc51926);logger[_0xdf24('0x28')](_0xdf24('0x14c'),_0x4909cd,_0x95805f,_0x1abce0[_0xdf24('0x14d')],_0x1abce0[_0xdf24('0x7e')]);return this[_0xdf24('0x34')][_0xdf24('0x100')](_0x4909cd,_0x95805f,_0x1abce0[_0xdf24('0x14d')],_0x1abce0['timeout'],undefined,!![]);};AGIVertices[_0xdf24('0x10')][_0xdf24('0x14e')]=function(_0x14ed4e){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x14f'),_0x14ed4e[_0xdf24('0x36')]));return this[_0xdf24('0x34')][_0xdf24('0x150')](_0x14ed4e[_0xdf24('0x151')][_0xdf24('0x55')](/\s+/g,''),_0x14ed4e[_0xdf24('0x14d')]);};AGIVertices[_0xdf24('0x10')][_0xdf24('0x152')]=function(_0x1f4ad2){logger['info'](util[_0xdf24('0x25')](_0xdf24('0x153'),_0x1f4ad2[_0xdf24('0x36')]));return this[_0xdf24('0x34')][_0xdf24('0x154')](_0x1f4ad2[_0xdf24('0x155')][_0xdf24('0x55')](/\s+/g,''),_0x1f4ad2['escape_digits']);};AGIVertices[_0xdf24('0x10')][_0xdf24('0x156')]=function(_0x4d65f9){logger[_0xdf24('0x28')](util['format'](_0xdf24('0x157'),_0x4d65f9[_0xdf24('0x36')]));return this['channel'][_0xdf24('0x158')](_0x4d65f9[_0xdf24('0x56')],_0x4d65f9['escape_digits']);};AGIVertices['prototype'][_0xdf24('0x159')]=function(_0x22e2ba){logger[_0xdf24('0x28')](util[_0xdf24('0x25')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x22e2ba[_0xdf24('0x36')]));if(!this['isConfigured'](_0x22e2ba[_0xdf24('0x15a')])){return this['channel'][_0xdf24('0x87')](_0xdf24('0x15b'));}var _0x2c8a13=this[_0xdf24('0x1f')]['sync'](this,_0x22e2ba['account_id']);if(!_0x2c8a13||!_0x2c8a13[_0xdf24('0x15c')]){return this[_0xdf24('0x34')]['error'](_0x22e2ba,_0xdf24('0x15d'));}var _0x166fe4={'from':util[_0xdf24('0x25')](_0xdf24('0x15e'),_0x2c8a13['name'],_0x2c8a13[_0xdf24('0x15f')]||_0x2c8a13[_0xdf24('0x15c')]['user']),'to':_0x22e2ba['to']||'','cc':_0x22e2ba['cc']||'','bcc':_0x22e2ba['bcc']||'','subject':_0x22e2ba[_0xdf24('0x160')],'html':_0x22e2ba[_0xdf24('0x56')],'text':_0x22e2ba[_0xdf24('0x56')]};var _0x4d9f1c={'tls':{'rejectUnauthorized':![]}};if(_0x2c8a13['Smtp'][_0xdf24('0x161')]){_0x4d9f1c[_0xdf24('0x161')]=_0x2c8a13[_0xdf24('0x15c')][_0xdf24('0x161')];}else{_0x4d9f1c['host']=_0x2c8a13[_0xdf24('0x15c')][_0xdf24('0x162')];_0x4d9f1c[_0xdf24('0x163')]=_0x2c8a13[_0xdf24('0x15c')]['port'];_0x4d9f1c[_0xdf24('0x164')]=_0x2c8a13[_0xdf24('0x15c')][_0xdf24('0x164')];}if(_0x2c8a13[_0xdf24('0x15c')][_0xdf24('0x165')]){_0x4d9f1c[_0xdf24('0x166')]={'user':_0x2c8a13[_0xdf24('0x15c')][_0xdf24('0x167')],'pass':_0x2c8a13[_0xdf24('0x15c')][_0xdf24('0x168')]};}if(this['isConfigured'](_0x22e2ba[_0xdf24('0x169')])){}logger[_0xdf24('0xad')]('sendMail\x20message',JSON[_0xdf24('0xe2')](_0x166fe4));this[_0xdf24('0x33')][_0xdf24('0x86')](this,_0x22e2ba,_0x22e2ba['account_id']);this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x16a'),_0x2c8a13[_0xdf24('0x17')]));this[_0xdf24('0x16b')][_0xdf24('0x86')](this,_0x4d9f1c,_0x166fe4);return this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0x16c'));};AGIVertices[_0xdf24('0x10')][_0xdf24('0x16d')]=function(_0x201f1f){logger[_0xdf24('0x28')](util['format'](_0xdf24('0x16e'),_0x201f1f['label']));return this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0x16f'));};AGIVertices['prototype'][_0xdf24('0x170')]=function(_0xf342ed){logger['info'](util[_0xdf24('0x25')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0xf342ed[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0xf342ed['sms_account_id'])){return this['channel'][_0xdf24('0x87')]('no\x20sms\x20account\x20configured');}var _0x17215e=this[_0xdf24('0x30')]['sync'](this,_0xf342ed[_0xdf24('0x171')]);if(!_0x17215e){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0xf342ed,_0xdf24('0x172'));}var _0x388299={'body':_0xf342ed[_0xdf24('0x173')],'phone':_0xf342ed['to']||'','SmsAccountId':_0x17215e['id']};logger[_0xdf24('0xad')](_0xdf24('0x174'),JSON[_0xdf24('0xe2')](_0x388299));this[_0xdf24('0x33')][_0xdf24('0x86')](this,_0xf342ed,_0xf342ed[_0xdf24('0x171')]);this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x175'),_0x17215e[_0xdf24('0x17')]));this[_0xdf24('0x32')]['sync'](this,_0x388299);return this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0x176'));};AGIVertices['prototype'][_0xdf24('0x177')]=function(_0x24596f){logger['info'](util[_0xdf24('0x25')](_0xdf24('0x178'),_0x24596f[_0xdf24('0x36')]));if(!this[_0xdf24('0x61')](_0x24596f[_0xdf24('0xa8')])){return this[_0xdf24('0x34')]['error'](_0x24596f,'no\x20variable\x20selected');}var _0x28bf05=this[_0xdf24('0x11')]['sync'](this,_0x24596f[_0xdf24('0xa8')]);if(!_0x28bf05){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x24596f,_0xdf24('0xaa'));}return this['channel'][_0xdf24('0x79')](_0x28bf05,_0x24596f['variable_value']);};AGIVertices[_0xdf24('0x10')][_0xdf24('0x179')]=function(_0x45093f){logger['info'](util[_0xdf24('0x25')](_0xdf24('0x17a'),_0x45093f[_0xdf24('0x36')]));this[_0xdf24('0x34')]['noop'](_0xdf24('0x17b'));if(_0x45093f['answer']===_0xdf24('0x17c')){this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0x17d'));return this[_0xdf24('0x34')][_0xdf24('0x7d')]();}return this[_0xdf24('0x34')][_0xdf24('0x87')](_0xdf24('0x17e'));};AGIVertices['prototype'][_0xdf24('0x17f')]=function(_0x18c906){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x180'),_0x18c906[_0xdf24('0x36')]));if(!this['isConfigured'](_0x18c906['project_id'])){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x18c906,'no\x20subproject\x20selected');}var _0x5f53bc=this[_0xdf24('0x18')]['sync'](this,_0x18c906[_0xdf24('0x181')]);if(!this[_0xdf24('0x61')](_0x5f53bc)){return this[_0xdf24('0x34')]['error'](_0x18c906,util['format'](_0xdf24('0x182'),_0x18c906['project_id']));}if(_0x5f53bc===this['channel']['arg_1']){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x18c906,_0xdf24('0x183'));}this[_0xdf24('0x33')][_0xdf24('0x86')](this,_0x18c906,_0x5f53bc);var _0x59bae1=this['channel'][_0xdf24('0x53')](_0xdf24('0x184'),util['format'](_0xdf24('0x185'),config[_0xdf24('0x8')][_0xdf24('0x162')]||_0xdf24('0x186'),_0x5f53bc,this[_0xdf24('0x34')][_0xdf24('0x38')]));if(_0x59bae1[_0xdf24('0x80')]===-0x1){return _0x59bae1;}return this[_0xdf24('0x34')]['noop'](util[_0xdf24('0x25')]('Executed\x20command\x20%s\x20%s',_0xdf24('0x184'),_0x5f53bc));};AGIVertices[_0xdf24('0x10')]['system']=function(_0x532b02){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x187'),_0x532b02[_0xdf24('0x36')]));var _0x198c78=this['shellCommand']['sync'](this,_0x532b02[_0xdf24('0x188')]);this[_0xdf24('0x33')][_0xdf24('0x86')](this,_0x532b02,_0x532b02[_0xdf24('0x188')]);if(this[_0xdf24('0x61')](_0x532b02[_0xdf24('0xa8')])){var _0x53913c=this['getVariable'][_0xdf24('0x86')](this,_0x532b02[_0xdf24('0xa8')]);if(_0x53913c){this[_0xdf24('0x34')][_0xdf24('0x79')](_0x53913c,_0x198c78);return this[_0xdf24('0x34')][_0xdf24('0x87')](util['format'](_0xdf24('0x189'),_0x532b02[_0xdf24('0x188')],_0x53913c));}}return this['channel'][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x18a'),_0x532b02[_0xdf24('0x188')]));};AGIVertices[_0xdf24('0x10')]['tts']=function(_0x1de4ce){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x18b'),_0x1de4ce[_0xdf24('0x36')]));if(!this['isConfigured'](_0x1de4ce[_0xdf24('0x56')])){return this[_0xdf24('0x34')]['noop'](_0xdf24('0x8e'));}this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x18c'),_0x1de4ce['text']));var _0x1a50e3=this['googleTTS'][_0xdf24('0x86')](this,_0x1de4ce);if(_0x1a50e3){this[_0xdf24('0x34')][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x18d'),_0x1a50e3));var _0x49aab1=this[_0xdf24('0x34')][_0xdf24('0xf1')](_0x1a50e3);try{fs[_0xdf24('0x123')](_0x1a50e3+_0xdf24('0xcd'));}catch(_0x449586){logger[_0xdf24('0x2e')](_0x449586);}return _0x49aab1;}return this['channel'][_0xdf24('0x2e')](_0x1de4ce,_0xdf24('0x18e'));};AGIVertices[_0xdf24('0x10')][_0xdf24('0x18f')]=function(_0x295d51){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x190'),_0x295d51[_0xdf24('0x36')]));if(!this['isConfigured'](_0x295d51[_0xdf24('0x126')])){return this[_0xdf24('0x34')][_0xdf24('0x2e')](_0x295d51,_0xdf24('0x127'));}logger[_0xdf24('0x28')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x295d51[_0xdf24('0x126')]));var _0x12e149=this[_0xdf24('0x4e')][_0xdf24('0x86')](this,_0x295d51[_0xdf24('0x126')]);if(_0x12e149){logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x129'),this['channel']['callerid'],_0x295d51[_0xdf24('0x126')]));this['channel'][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x129'),this[_0xdf24('0x34')][_0xdf24('0x39')],_0x295d51[_0xdf24('0x126')]));return{'code':0xc8,'result':_0xdf24('0x12a')};}else{logger[_0xdf24('0x28')](util[_0xdf24('0x25')](_0xdf24('0x12b'),this[_0xdf24('0x34')][_0xdf24('0x39')],_0x295d51[_0xdf24('0x126')]));this[_0xdf24('0x34')][_0xdf24('0x87')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xdf24('0x34')][_0xdf24('0x39')],_0x295d51['findBy']));return{'code':0xc8,'result':_0xdf24('0x13a')};}};AGIVertices[_0xdf24('0x10')][_0xdf24('0x191')]=function(_0x5f4260){logger['info'](util[_0xdf24('0x25')](_0xdf24('0x192'),_0x5f4260[_0xdf24('0x36')]));var _0x5cf0f7=this[_0xdf24('0x34')][_0xdf24('0x53')](_0xdf24('0x193'),[_0x5f4260['mailbox'],_0x5f4260[_0xdf24('0x8c')]]);if(_0x5cf0f7[_0xdf24('0x80')]===-0x1){return _0x5cf0f7;}return this['channel'][_0xdf24('0x87')](util[_0xdf24('0x25')](_0xdf24('0x13d'),'VOICEMAIL',_0x5f4260[_0xdf24('0x194')]));};AGIVertices[_0xdf24('0x10')][_0xdf24('0x195')]=function(_0x2e5fca){logger['info'](util[_0xdf24('0x25')](_0xdf24('0x196'),_0x2e5fca['label']));if(!this[_0xdf24('0x61')](_0x2e5fca[_0xdf24('0xa8')])){return this[_0xdf24('0x34')]['error'](_0x2e5fca,_0xdf24('0x197'));}var _0x5c3fdf=this[_0xdf24('0x11')][_0xdf24('0x86')](this,_0x2e5fca[_0xdf24('0xa8')]);if(!_0x5c3fdf){return this[_0xdf24('0x34')]['error'](_0x2e5fca,_0xdf24('0xaa'));}var _0x20a779=this[_0xdf24('0x34')][_0xdf24('0x11')](_0x5c3fdf);return{'code':0xc8,'result':_0x20a779[_0xdf24('0x77')]?_0x20a779[_0xdf24('0x77')]:'-'};};String['prototype'][_0xdf24('0x76')]=function(_0x44272e,_0x18a83a){return this[_0xdf24('0x74')](_0x44272e)[_0xdf24('0x198')](_0x18a83a);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index f4b8697..3c28194 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 _0xfcb2=['uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','acw','../rpc/user','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','milliseconds','seconds','prototype','startAcw','queue','ACW','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','savePause','voiceQueues','acwTimeout','timer','stopAcw','lastPauseAt'];(function(_0x37d9f1,_0x560ffd){var _0x4d83e3=function(_0x42f7f7){while(--_0x42f7f7){_0x37d9f1['push'](_0x37d9f1['shift']());}};_0x4d83e3(++_0x560ffd);}(_0xfcb2,0x171));var _0x2fcb=function(_0xc4a0e7,_0x2d814a){_0xc4a0e7=_0xc4a0e7-0x0;var _0x276bae=_0xfcb2[_0xc4a0e7];return _0x276bae;};'use strict';var util=require(_0x2fcb('0x0'));var _=require('lodash');var moment=require(_0x2fcb('0x1'));var ami=require(_0x2fcb('0x2'));var logger=require('../../../config/logger')(_0x2fcb('0x3'));var RpcUser=require(_0x2fcb('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1a1a6c){this['voiceQueues']=_0x1a1a6c['voiceQueues'];this[_0x2fcb('0x5')]=_0x1a1a6c['agents'];this[_0x2fcb('0x6')]=_0x1a1a6c[_0x2fcb('0x6')];this[_0x2fcb('0x7')]={};ami['on']('agentconnect',this[_0x2fcb('0x8')][_0x2fcb('0x9')](this));ami['on'](_0x2fcb('0xa'),this[_0x2fcb('0xb')][_0x2fcb('0x9')](this));ami['on'](_0x2fcb('0xc'),this['syncHangup'][_0x2fcb('0x9')](this));ami['on'](_0x2fcb('0xd'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x2fcb('0xe'),this[_0x2fcb('0xf')][_0x2fcb('0x9')](this));ami['on'](_0x2fcb('0x10'),this['syncBlindTransfer'][_0x2fcb('0x9')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x2fcb('0x9')](this));}function getDiff(_0x3a14a9){var _0x3faa92=moment()[_0x2fcb('0x11')](0x0);var _0x42c962=moment(_0x3a14a9)[_0x2fcb('0x11')](0x0);return _0x3faa92['diff'](_0x42c962,_0x2fcb('0x12'));}Acw[_0x2fcb('0x13')][_0x2fcb('0x14')]=function(_0x4b0559){try{var _0x2deccc=this;var _0x3029b9=this[_0x2fcb('0x7')][_0x4b0559]['interface'];var _0x769ffd=this[_0x2fcb('0x7')][_0x4b0559][_0x2fcb('0x15')];var _0x19741f=this['voiceQueues'][_0x769ffd];var _0x3c1d81=![];var _0x33af6a=_0x2fcb('0x16');if(_0x19741f['mandatoryDisposition']){if(_0x19741f[_0x2fcb('0x17')][_0x2fcb('0x18')]){_0x3c1d81=!![];_0x33af6a=_0x19741f[_0x2fcb('0x17')]['name'];}}ami[_0x2fcb('0x19')]({'action':_0x2fcb('0x1a'),'interface':_0x3029b9,'paused':!![],'reason':_0x33af6a})[_0x2fcb('0x1b')](function(_0x1b6baf){if(_0x2deccc[_0x2fcb('0x5')][_0x3029b9]){return RpcUser['getAgent'](_0x2deccc['agents'][_0x3029b9]['id'])[_0x2fcb('0x1b')](function(_0x25fe4e){if(_0x25fe4e&&!_0x25fe4e[_0x2fcb('0x1c')]){logger[_0x2fcb('0x1d')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x4b0559,_0x3029b9,_0x769ffd);return RpcUser[_0x2fcb('0x1e')](_0x2deccc[_0x2fcb('0x5')][_0x3029b9],_0x33af6a,_0x4b0559)['then'](function(_0x419c18){if(!_0x3c1d81){_0x2deccc[_0x2fcb('0x6')][_0x3029b9]={};logger[_0x2fcb('0x1d')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4b0559,_0x2deccc[_0x2fcb('0x1f')][_0x769ffd][_0x2fcb('0x20')],_0x3029b9,_0x769ffd);_0x2deccc[_0x2fcb('0x6')][_0x3029b9][_0x2fcb('0x21')]=setTimeout(_0x2deccc[_0x2fcb('0x22')][_0x2fcb('0x9')](_0x2deccc,_0x3029b9),_0x2deccc[_0x2fcb('0x1f')][_0x769ffd][_0x2fcb('0x20')]*0x3e8);_0x2deccc[_0x2fcb('0x6')][_0x3029b9][_0x2fcb('0x23')]=_0x419c18[_0x2fcb('0x23')];_0x2deccc[_0x2fcb('0x6')][_0x3029b9][_0x2fcb('0x24')]=_0x4b0559;_0x2deccc[_0x2fcb('0x6')][_0x3029b9]['queue']=_0x769ffd;_0x2deccc['timers'][_0x3029b9][_0x2fcb('0x25')]=function(){var _0x103978=getDiff(_0x2deccc[_0x2fcb('0x6')][_0x3029b9][_0x2fcb('0x23')]);clearTimeout(_0x2deccc[_0x2fcb('0x6')][_0x3029b9]['timer']);RpcVoiceAgentReport[_0x2fcb('0x26')]({'acwtime':_0x103978},_0x2deccc['timers'][_0x3029b9][_0x2fcb('0x24')],_0x3029b9)[_0x2fcb('0x1b')](function(_0x4a8dc1){logger['info'](_0x2fcb('0x27'),_0x4b0559,_0x103978,_0x4a8dc1);})[_0x2fcb('0x28')](function(_0x130c2f){logger[_0x2fcb('0x29')]('[%s][UPDATE][ERRORS:%s]',_0x4b0559,_0x130c2f);});delete _0x2deccc[_0x2fcb('0x6')][_0x3029b9];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x4b0559,_0x3029b9,_0x769ffd);}});}})[_0x2fcb('0x28')](function(_0x231b78){logger[_0x2fcb('0x29')](_0x2fcb('0x2a'),_0x4b0559,_0x2deccc['voiceQueues'][_0x769ffd][_0x2fcb('0x20')],_0x3029b9,_0x769ffd);})[_0x2fcb('0x2b')](function(){delete _0x2deccc[_0x2fcb('0x7')][_0x4b0559];});}catch(_0x488dc2){logger[_0x2fcb('0x29')](_0x2fcb('0x2c'),_0x488dc2['message']);}};Acw['prototype'][_0x2fcb('0x22')]=function(_0x3cd793){try{var _0x562e1e=this;if(_0x562e1e[_0x2fcb('0x6')][_0x3cd793]){var _0x200379=_0x562e1e[_0x2fcb('0x6')][_0x3cd793][_0x2fcb('0x24')];var _0x334664=_0x562e1e[_0x2fcb('0x6')][_0x3cd793][_0x2fcb('0x15')];var _0x5b7b55=_0x562e1e['voiceQueues'][_0x334664][_0x2fcb('0x20')];logger[_0x2fcb('0x1d')](_0x2fcb('0x2d'),_0x3cd793);RpcUser[_0x2fcb('0x2e')](this[_0x2fcb('0x5')][_0x3cd793]);RpcVoiceAgentReport[_0x2fcb('0x26')]({'acwtime':_0x5b7b55,'agentacw':!![]},_0x200379,_0x3cd793)[_0x2fcb('0x1b')](function(_0x674abb){logger[_0x2fcb('0x1d')](_0x2fcb('0x27'),_0x200379,_0x5b7b55,_0x674abb);})['catch'](function(_0x2cf5f4){logger[_0x2fcb('0x29')](_0x2fcb('0x2f'),_0x200379,_0x2cf5f4);});}else{logger[_0x2fcb('0x29')](_0x2fcb('0x30'),_0x3cd793);if(_0x562e1e[_0x2fcb('0x6')]){logger[_0x2fcb('0x1d')](_0x2fcb('0x31'),JSON[_0x2fcb('0x32')](_0x562e1e[_0x2fcb('0x6')]));}}}catch(_0x18a4b8){logger[_0x2fcb('0x29')](_0x2fcb('0x33'),_0x18a4b8[_0x2fcb('0x34')]);}};Acw[_0x2fcb('0x13')]['syncAgentConnect']=function(_0x35725d){try{if(this[_0x2fcb('0x1f')][_0x35725d[_0x2fcb('0x15')]]&&(this[_0x2fcb('0x1f')][_0x35725d[_0x2fcb('0x15')]][_0x2fcb('0x3')]||this['voiceQueues'][_0x35725d[_0x2fcb('0x15')]][_0x2fcb('0x35')])){if(this['agents'][_0x35725d['interface']]){this[_0x2fcb('0x7')][_0x35725d[_0x2fcb('0x24')]]={'queue':_0x35725d[_0x2fcb('0x15')],'interface':_0x35725d[_0x2fcb('0x36')]};}}}catch(_0x760a32){logger[_0x2fcb('0x29')](_0x2fcb('0x37'),_0x760a32['message']);}};Acw[_0x2fcb('0x13')]['syncAgentConnectPreview']=function(_0x4908a2){try{if(this[_0x2fcb('0x1f')][_0x4908a2[_0x2fcb('0x15')]]&&(this[_0x2fcb('0x1f')][_0x4908a2[_0x2fcb('0x15')]][_0x2fcb('0x3')]||this['voiceQueues'][_0x4908a2[_0x2fcb('0x15')]][_0x2fcb('0x35')])){if(this[_0x2fcb('0x5')][_0x4908a2[_0x2fcb('0x36')]]){this[_0x2fcb('0x7')][_0x4908a2['uniqueid']]={'queue':_0x4908a2[_0x2fcb('0x15')],'interface':_0x4908a2[_0x2fcb('0x36')]};}}}catch(_0x1e90ca){logger[_0x2fcb('0x29')](_0x2fcb('0x38'),_0x1e90ca[_0x2fcb('0x34')]);}};Acw[_0x2fcb('0x13')][_0x2fcb('0xb')]=function(_0x707b15){try{if(this[_0x2fcb('0x7')][_0x707b15[_0x2fcb('0x24')]]&&_[_0x2fcb('0x39')](this[_0x2fcb('0x7')][_0x707b15[_0x2fcb('0x24')]][_0x2fcb('0x3a')])){logger[_0x2fcb('0x1d')](_0x2fcb('0x3b'),_0x707b15['uniqueid']);this[_0x2fcb('0x14')](_0x707b15['uniqueid']);}else if(this[_0x2fcb('0x7')][_0x707b15[_0x2fcb('0x3c')]]&&_[_0x2fcb('0x39')](this[_0x2fcb('0x7')][_0x707b15[_0x2fcb('0x3c')]][_0x2fcb('0x3a')])){logger[_0x2fcb('0x1d')]('[%s][HANGUP:LINKEDID]',_0x707b15[_0x2fcb('0x3c')]);this['startAcw'](_0x707b15[_0x2fcb('0x3c')]);}}catch(_0x454ad0){logger[_0x2fcb('0x29')](_0x2fcb('0x3d'),_0x454ad0[_0x2fcb('0x34')]);}};Acw[_0x2fcb('0x13')]['syncHangup']=function(_0x3337bf){try{if(this[_0x2fcb('0x7')][_0x3337bf['uniqueid']]&&this[_0x2fcb('0x7')][_0x3337bf['uniqueid']]['attended']){logger['info'](_0x2fcb('0x3e'),_0x3337bf['uniqueid']);this[_0x2fcb('0x14')](_0x3337bf[_0x2fcb('0x24')]);}else if(this[_0x2fcb('0x7')][_0x3337bf[_0x2fcb('0x3c')]]&&this['channels'][_0x3337bf[_0x2fcb('0x3c')]][_0x2fcb('0x3a')]){logger[_0x2fcb('0x1d')](_0x2fcb('0x3f'),_0x3337bf[_0x2fcb('0x3c')]);this[_0x2fcb('0x14')](_0x3337bf[_0x2fcb('0x3c')]);}}catch(_0x115c21){logger[_0x2fcb('0x29')](_0x2fcb('0x40'),_0x115c21[_0x2fcb('0x34')]);}};Acw[_0x2fcb('0x13')][_0x2fcb('0xf')]=function(_0x4b8d2c){try{if(!_[_0x2fcb('0x41')](this[_0x2fcb('0x7')][_0x4b8d2c[_0x2fcb('0x42')]])){this[_0x2fcb('0x14')](_0x4b8d2c[_0x2fcb('0x42')]);if(this[_0x2fcb('0x7')][_0x4b8d2c[_0x2fcb('0x43')]]){this[_0x2fcb('0x7')][_0x4b8d2c['secondtransfereruniqueid']][_0x2fcb('0x3a')]=!![];this[_0x2fcb('0x7')][_0x4b8d2c[_0x2fcb('0x44')]]=this[_0x2fcb('0x7')][_0x4b8d2c[_0x2fcb('0x43')]];delete this[_0x2fcb('0x7')][_0x4b8d2c[_0x2fcb('0x43')]];}}else if(!_['isNil'](this['channels'][_0x4b8d2c[_0x2fcb('0x44')]])){this[_0x2fcb('0x14')](_0x4b8d2c[_0x2fcb('0x44')]);if(this[_0x2fcb('0x7')][_0x4b8d2c[_0x2fcb('0x45')]]){this['channels'][_0x4b8d2c['origtransfereruniqueid']][_0x2fcb('0x3a')]=!![];this[_0x2fcb('0x7')][_0x4b8d2c[_0x2fcb('0x42')]]=this[_0x2fcb('0x7')][_0x4b8d2c['origtransfereruniqueid']];delete this[_0x2fcb('0x7')][_0x4b8d2c[_0x2fcb('0x45')]];}}}catch(_0x486db7){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x486db7['message']);}};Acw[_0x2fcb('0x13')][_0x2fcb('0x46')]=function(_0x756f39){try{if(this[_0x2fcb('0x7')][_0x756f39[_0x2fcb('0x47')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x2fcb('0x32')](_0x756f39['transfereruniqueid']));this[_0x2fcb('0x14')](_0x756f39[_0x2fcb('0x47')]);}else if(this[_0x2fcb('0x7')][_0x756f39[_0x2fcb('0x48')]]){logger['info'](_0x2fcb('0x49'),JSON[_0x2fcb('0x32')](_0x756f39[_0x2fcb('0x48')]));this[_0x2fcb('0x14')](_0x756f39[_0x2fcb('0x48')]);}}catch(_0xf1744a){logger['error'](_0x2fcb('0x4a'),_0xf1744a[_0x2fcb('0x34')]);}};Acw[_0x2fcb('0x13')]['syncAgentRingNoAnswer']=function(_0x43bf0a){try{if(this[_0x2fcb('0x1f')][_0x43bf0a[_0x2fcb('0x15')]]&&this[_0x2fcb('0x1f')][_0x43bf0a['queue']][_0x2fcb('0x4b')]===_0x2fcb('0x4c')){if(this[_0x2fcb('0x5')][_0x43bf0a[_0x2fcb('0x36')]]){logger[_0x2fcb('0x1d')](_0x2fcb('0x4d'),_0x43bf0a[_0x2fcb('0x24')],_0x43bf0a[_0x2fcb('0x36')],_0x43bf0a[_0x2fcb('0x15')]);return RpcUser['savePause'](this[_0x2fcb('0x5')][_0x43bf0a[_0x2fcb('0x36')]],_0x2fcb('0x4e'),_0x43bf0a[_0x2fcb('0x24')]);}}}catch(_0x415bfb){logger['error'](_0x2fcb('0x4f'),_0x415bfb['message']);}};module[_0x2fcb('0x50')]=Acw; \ No newline at end of file +var _0xdefb=['transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','bind','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','stopAcw','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','prototype','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','attended','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid'];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0xdefb,0x154));var _0xbdef=function(_0x48fefe,_0x341c3f){_0x48fefe=_0x48fefe-0x0;var _0x5dd63b=_0xdefb[_0x48fefe];return _0x5dd63b;};'use strict';var util=require(_0xbdef('0x0'));var _=require(_0xbdef('0x1'));var moment=require('moment');var ami=require(_0xbdef('0x2'));var logger=require(_0xbdef('0x3'))(_0xbdef('0x4'));var RpcUser=require(_0xbdef('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x470b39){this[_0xbdef('0x6')]=_0x470b39[_0xbdef('0x6')];this[_0xbdef('0x7')]=_0x470b39[_0xbdef('0x7')];this[_0xbdef('0x8')]=_0x470b39['timers'];this[_0xbdef('0x9')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xbdef('0xa')](this));ami['on']('hanguprequest',this[_0xbdef('0xb')][_0xbdef('0xa')](this));ami['on'](_0xbdef('0xc'),this[_0xbdef('0xd')][_0xbdef('0xa')](this));ami['on']('agentringnoanswer',this[_0xbdef('0xe')][_0xbdef('0xa')](this));ami['on'](_0xbdef('0xf'),this[_0xbdef('0x10')]['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));ami['on']('custom:agentConnectPreview',this[_0xbdef('0x11')][_0xbdef('0xa')](this));}function getDiff(_0x31b264){var _0x35ebf9=moment()['milliseconds'](0x0);var _0x408f37=moment(_0x31b264)[_0xbdef('0x12')](0x0);return _0x35ebf9[_0xbdef('0x13')](_0x408f37,_0xbdef('0x14'));}Acw['prototype'][_0xbdef('0x15')]=function(_0x273b0b){try{var _0x5f4545=this;var _0xb2fb9b=this[_0xbdef('0x9')][_0x273b0b][_0xbdef('0x16')];var _0x1b3e2b=this[_0xbdef('0x9')][_0x273b0b][_0xbdef('0x17')];var _0x4e5536=this[_0xbdef('0x6')][_0x1b3e2b];var _0x468016=![];var _0x57424f=_0xbdef('0x18');if(_0x4e5536[_0xbdef('0x19')]){if(_0x4e5536[_0xbdef('0x1a')][_0xbdef('0x1b')]){_0x468016=!![];_0x57424f=_0x4e5536[_0xbdef('0x1a')][_0xbdef('0x1b')];}}ami['Action']({'action':'QueuePause','interface':_0xb2fb9b,'paused':!![],'reason':_0x57424f})[_0xbdef('0x1c')](function(_0x2a479f){if(_0x5f4545[_0xbdef('0x7')][_0xb2fb9b]){return RpcUser[_0xbdef('0x1d')](_0x5f4545[_0xbdef('0x7')][_0xb2fb9b]['id'])[_0xbdef('0x1c')](function(_0x14aac8){if(_0x14aac8&&!_0x14aac8[_0xbdef('0x1e')]){logger[_0xbdef('0x1f')](_0xbdef('0x20'),_0x273b0b,_0xb2fb9b,_0x1b3e2b);return RpcUser[_0xbdef('0x21')](_0x5f4545[_0xbdef('0x7')][_0xb2fb9b],_0x57424f,_0x273b0b)[_0xbdef('0x1c')](function(_0x4889d5){if(!_0x468016){_0x5f4545[_0xbdef('0x8')][_0xb2fb9b]={};logger['info'](_0xbdef('0x22'),_0x273b0b,_0x5f4545['voiceQueues'][_0x1b3e2b][_0xbdef('0x23')],_0xb2fb9b,_0x1b3e2b);_0x5f4545['timers'][_0xb2fb9b][_0xbdef('0x24')]=setTimeout(_0x5f4545['stopAcw'][_0xbdef('0xa')](_0x5f4545,_0xb2fb9b),_0x5f4545['voiceQueues'][_0x1b3e2b][_0xbdef('0x23')]*0x3e8);_0x5f4545['timers'][_0xb2fb9b][_0xbdef('0x25')]=_0x4889d5[_0xbdef('0x25')];_0x5f4545[_0xbdef('0x8')][_0xb2fb9b][_0xbdef('0x26')]=_0x273b0b;_0x5f4545['timers'][_0xb2fb9b][_0xbdef('0x17')]=_0x1b3e2b;_0x5f4545[_0xbdef('0x8')][_0xb2fb9b][_0xbdef('0x27')]=function(){var _0x474dfc=getDiff(_0x5f4545[_0xbdef('0x8')][_0xb2fb9b][_0xbdef('0x25')]);clearTimeout(_0x5f4545[_0xbdef('0x8')][_0xb2fb9b][_0xbdef('0x24')]);RpcVoiceAgentReport[_0xbdef('0x28')]({'acwtime':_0x474dfc},_0x5f4545[_0xbdef('0x8')][_0xb2fb9b][_0xbdef('0x26')],_0xb2fb9b)['then'](function(_0x751299){logger[_0xbdef('0x1f')](_0xbdef('0x29'),_0x273b0b,_0x474dfc,_0x751299);})[_0xbdef('0x2a')](function(_0x259e15){logger[_0xbdef('0x2b')]('[%s][UPDATE][ERRORS:%s]',_0x273b0b,_0x259e15);});delete _0x5f4545[_0xbdef('0x8')][_0xb2fb9b];};}});}else{logger['info'](_0xbdef('0x2c'),_0x273b0b,_0xb2fb9b,_0x1b3e2b);}});}})[_0xbdef('0x2a')](function(_0x3c61d6){logger[_0xbdef('0x2b')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x273b0b,_0x5f4545[_0xbdef('0x6')][_0x1b3e2b]['acwTimeout'],_0xb2fb9b,_0x1b3e2b);})[_0xbdef('0x2d')](function(){delete _0x5f4545[_0xbdef('0x9')][_0x273b0b];});}catch(_0x4af7ae){logger[_0xbdef('0x2b')](_0xbdef('0x2e'),_0x4af7ae['message']);}};Acw['prototype'][_0xbdef('0x2f')]=function(_0x361752){try{var _0x5ad843=this;if(_0x5ad843[_0xbdef('0x8')][_0x361752]){var _0x1fbc34=_0x5ad843['timers'][_0x361752][_0xbdef('0x26')];var _0x55f1aa=_0x5ad843[_0xbdef('0x8')][_0x361752][_0xbdef('0x17')];var _0x43b0d3=_0x5ad843[_0xbdef('0x6')][_0x55f1aa]['acwTimeout'];logger[_0xbdef('0x1f')](_0xbdef('0x30'),_0x361752);RpcUser[_0xbdef('0x31')](this[_0xbdef('0x7')][_0x361752]);RpcVoiceAgentReport[_0xbdef('0x28')]({'acwtime':_0x43b0d3,'agentacw':!![]},_0x1fbc34,_0x361752)['then'](function(_0x7596b7){logger[_0xbdef('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x1fbc34,_0x43b0d3,_0x7596b7);})[_0xbdef('0x2a')](function(_0x187c3a){logger['error'](_0xbdef('0x32'),_0x1fbc34,_0x187c3a);});}else{logger[_0xbdef('0x2b')](_0xbdef('0x33'),_0x361752);if(_0x5ad843[_0xbdef('0x8')]){logger[_0xbdef('0x1f')](_0xbdef('0x34'),JSON[_0xbdef('0x35')](_0x5ad843[_0xbdef('0x8')]));}}}catch(_0x2840a1){logger[_0xbdef('0x2b')](_0xbdef('0x36'),_0x2840a1[_0xbdef('0x37')]);}};Acw['prototype'][_0xbdef('0x38')]=function(_0x20a63e){try{if(this[_0xbdef('0x6')][_0x20a63e['queue']]&&(this[_0xbdef('0x6')][_0x20a63e[_0xbdef('0x17')]]['acw']||this[_0xbdef('0x6')][_0x20a63e[_0xbdef('0x17')]]['mandatoryDisposition'])){if(this[_0xbdef('0x7')][_0x20a63e['interface']]){this[_0xbdef('0x9')][_0x20a63e[_0xbdef('0x26')]]={'queue':_0x20a63e['queue'],'interface':_0x20a63e['interface']};}}}catch(_0x50d2a0){logger['error'](_0xbdef('0x39'),_0x50d2a0[_0xbdef('0x37')]);}};Acw['prototype'][_0xbdef('0x11')]=function(_0x4936db){try{if(this[_0xbdef('0x6')][_0x4936db[_0xbdef('0x17')]]&&(this[_0xbdef('0x6')][_0x4936db[_0xbdef('0x17')]]['acw']||this[_0xbdef('0x6')][_0x4936db[_0xbdef('0x17')]][_0xbdef('0x19')])){if(this['agents'][_0x4936db[_0xbdef('0x16')]]){this['channels'][_0x4936db['uniqueid']]={'queue':_0x4936db['queue'],'interface':_0x4936db['interface']};}}}catch(_0x243720){logger['error'](_0xbdef('0x3a'),_0x243720[_0xbdef('0x37')]);}};Acw[_0xbdef('0x3b')][_0xbdef('0xb')]=function(_0x21d6d2){try{if(this['channels'][_0x21d6d2['uniqueid']]&&_[_0xbdef('0x3c')](this[_0xbdef('0x9')][_0x21d6d2[_0xbdef('0x26')]]['attended'])){logger[_0xbdef('0x1f')](_0xbdef('0x3d'),_0x21d6d2[_0xbdef('0x26')]);this[_0xbdef('0x15')](_0x21d6d2[_0xbdef('0x26')]);}else if(this[_0xbdef('0x9')][_0x21d6d2[_0xbdef('0x3e')]]&&_[_0xbdef('0x3c')](this[_0xbdef('0x9')][_0x21d6d2[_0xbdef('0x3e')]][_0xbdef('0x3f')])){logger[_0xbdef('0x1f')]('[%s][HANGUP:LINKEDID]',_0x21d6d2[_0xbdef('0x3e')]);this[_0xbdef('0x15')](_0x21d6d2[_0xbdef('0x3e')]);}}catch(_0x524a67){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x524a67['message']);}};Acw['prototype'][_0xbdef('0xd')]=function(_0x399474){try{if(this[_0xbdef('0x9')][_0x399474[_0xbdef('0x26')]]&&this[_0xbdef('0x9')][_0x399474[_0xbdef('0x26')]]['attended']){logger['info'](_0xbdef('0x40'),_0x399474[_0xbdef('0x26')]);this[_0xbdef('0x15')](_0x399474[_0xbdef('0x26')]);}else if(this[_0xbdef('0x9')][_0x399474[_0xbdef('0x3e')]]&&this[_0xbdef('0x9')][_0x399474[_0xbdef('0x3e')]][_0xbdef('0x3f')]){logger[_0xbdef('0x1f')](_0xbdef('0x41'),_0x399474[_0xbdef('0x3e')]);this[_0xbdef('0x15')](_0x399474[_0xbdef('0x3e')]);}}catch(_0x250e14){logger[_0xbdef('0x2b')](_0xbdef('0x42'),_0x250e14[_0xbdef('0x37')]);}};Acw[_0xbdef('0x3b')][_0xbdef('0x10')]=function(_0x41fa6c){try{if(!_[_0xbdef('0x43')](this['channels'][_0x41fa6c[_0xbdef('0x44')]])){this[_0xbdef('0x15')](_0x41fa6c['transfereeuniqueid']);if(this[_0xbdef('0x9')][_0x41fa6c[_0xbdef('0x45')]]){this[_0xbdef('0x9')][_0x41fa6c[_0xbdef('0x45')]][_0xbdef('0x3f')]=!![];this[_0xbdef('0x9')][_0x41fa6c['transfertargetuniqueid']]=this[_0xbdef('0x9')][_0x41fa6c[_0xbdef('0x45')]];delete this[_0xbdef('0x9')][_0x41fa6c[_0xbdef('0x45')]];}}else if(!_[_0xbdef('0x43')](this[_0xbdef('0x9')][_0x41fa6c[_0xbdef('0x46')]])){this[_0xbdef('0x15')](_0x41fa6c[_0xbdef('0x46')]);if(this[_0xbdef('0x9')][_0x41fa6c[_0xbdef('0x47')]]){this[_0xbdef('0x9')][_0x41fa6c['origtransfereruniqueid']][_0xbdef('0x3f')]=!![];this[_0xbdef('0x9')][_0x41fa6c['transfereeuniqueid']]=this['channels'][_0x41fa6c[_0xbdef('0x47')]];delete this[_0xbdef('0x9')][_0x41fa6c['origtransfereruniqueid']];}}}catch(_0x5b152f){logger[_0xbdef('0x2b')](_0xbdef('0x48'),_0x5b152f[_0xbdef('0x37')]);}};Acw['prototype']['syncBlindTransfer']=function(_0xe8090c){try{if(this[_0xbdef('0x9')][_0xe8090c['transfereruniqueid']]){logger[_0xbdef('0x1f')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0xe8090c['transfereruniqueid']));this['startAcw'](_0xe8090c['transfereruniqueid']);}else if(this[_0xbdef('0x9')][_0xe8090c[_0xbdef('0x49')]]){logger[_0xbdef('0x1f')](_0xbdef('0x4a'),JSON[_0xbdef('0x35')](_0xe8090c[_0xbdef('0x49')]));this[_0xbdef('0x15')](_0xe8090c[_0xbdef('0x49')]);}}catch(_0x3f0313){logger['error'](_0xbdef('0x4b'),_0x3f0313[_0xbdef('0x37')]);}};Acw[_0xbdef('0x3b')]['syncAgentRingNoAnswer']=function(_0x2622cf){try{if(this['voiceQueues'][_0x2622cf[_0xbdef('0x17')]]&&this[_0xbdef('0x6')][_0x2622cf[_0xbdef('0x17')]][_0xbdef('0x4c')]===_0xbdef('0x4d')){if(this[_0xbdef('0x7')][_0x2622cf['interface']]){logger[_0xbdef('0x1f')](_0xbdef('0x4e'),_0x2622cf[_0xbdef('0x26')],_0x2622cf[_0xbdef('0x16')],_0x2622cf[_0xbdef('0x17')]);return RpcUser[_0xbdef('0x21')](this[_0xbdef('0x7')][_0x2622cf[_0xbdef('0x16')]],_0xbdef('0x4f'),_0x2622cf[_0xbdef('0x26')]);}}}catch(_0x181ce2){logger[_0xbdef('0x2b')](_0xbdef('0x50'),_0x181ce2['message']);}};module[_0xbdef('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index aec7cba..d1adc4b 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 _0xf1ea=['actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','log','exports','asterisk-manager','bluebird','moment','lodash','../../config/logger','ami','../../config/environment','asterisk','username','password','keepConnected','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary'];(function(_0x487d6e,_0x590ce7){var _0x3d0a2e=function(_0x4d559f){while(--_0x4d559f){_0x487d6e['push'](_0x487d6e['shift']());}};_0x3d0a2e(++_0x590ce7);}(_0xf1ea,0xf2));var _0xaf1e=function(_0x5b973c,_0x1e592f){_0x5b973c=_0x5b973c-0x0;var _0x21627a=_0xf1ea[_0x5b973c];return _0x21627a;};'use strict';var Manager=require(_0xaf1e('0x0'));var BPromise=require(_0xaf1e('0x1'));var moment=require(_0xaf1e('0x2'));var util=require('util');var _=require(_0xaf1e('0x3'));var logger=require(_0xaf1e('0x4'))(_0xaf1e('0x5'));var config=require(_0xaf1e('0x6'));var ami=new Manager(config[_0xaf1e('0x7')]['port'],config[_0xaf1e('0x7')]['ip'],config[_0xaf1e('0x7')][_0xaf1e('0x8')],config['asterisk'][_0xaf1e('0x9')],!![]);ami[_0xaf1e('0xa')]();ami['Action']=BPromise[_0xaf1e('0xb')](ami['action']);function error(_0x409eac){logger[_0xaf1e('0xc')](util[_0xaf1e('0xd')](_0xaf1e('0xe'),config[_0xaf1e('0x7')]['username'],config[_0xaf1e('0x7')]['ip'],config[_0xaf1e('0x7')][_0xaf1e('0xf')],util['inspect'](_0x409eac,![],null)));}function close(){logger[_0xaf1e('0xc')](util['format'](_0xaf1e('0x10'),config[_0xaf1e('0x7')]['username'],config['asterisk']['ip'],config[_0xaf1e('0x7')][_0xaf1e('0xf')]));}ami[_0xaf1e('0x11')]=function(){return function(){return ami[_0xaf1e('0x12')]({'action':_0xaf1e('0x13')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xaf1e('0x12')]({'action':_0xaf1e('0x14')});};};ami[_0xaf1e('0x15')]=function(){return function(){return ami[_0xaf1e('0x12')]({'action':_0xaf1e('0x16')});};};ami[_0xaf1e('0x17')]=function(){return function(){return ami[_0xaf1e('0x12')]({'action':'queuesummary'});};};ami[_0xaf1e('0x18')]=function(){return function(){return ami['Action']({'action':_0xaf1e('0x19')});};};function connect(_0x1c14a2){logger[_0xaf1e('0x1a')](util[_0xaf1e('0xd')](_0xaf1e('0x1b'),config[_0xaf1e('0x7')][_0xaf1e('0x8')],config[_0xaf1e('0x7')]['ip'],config['asterisk']['port']));ami[_0xaf1e('0x1c')](_0xaf1e('0xc'),error);ami[_0xaf1e('0x1c')](_0xaf1e('0x1d'),close);}ami['on']('connect',connect);ami['on'](_0xaf1e('0x1e'),function(_0x4f9542){logger[_0xaf1e('0x1a')](util['format'](_0xaf1e('0x1f'),config[_0xaf1e('0x7')][_0xaf1e('0x8')],config[_0xaf1e('0x7')]['ip'],config[_0xaf1e('0x7')][_0xaf1e('0xf')],util['inspect'](_0x4f9542,![],null)));});ami['on']('fullybooted',function(_0x24c2c3){logger[_0xaf1e('0x1a')](util[_0xaf1e('0xd')](_0xaf1e('0x20'),config[_0xaf1e('0x7')][_0xaf1e('0x8')],config[_0xaf1e('0x7')]['ip'],config[_0xaf1e('0x7')]['port']));return BPromise[_0xaf1e('0x21')]()[_0xaf1e('0x22')](ami['actionSipShowRegistry']())['then'](ami['actionDeviceStateList']())[_0xaf1e('0x22')](ami['actionSipPeerStatus']())[_0xaf1e('0x22')](ami['actionQueueSummary']())[_0xaf1e('0x22')](ami[_0xaf1e('0x18')]())[_0xaf1e('0x23')](function(_0x3c1ccb){console[_0xaf1e('0x24')](_0x3c1ccb);});});ami['once']('error',error);ami[_0xaf1e('0x1c')](_0xaf1e('0x1d'),close);module[_0xaf1e('0x25')]=ami; \ No newline at end of file +var _0x2a23=['Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','then','actionDeviceStateList','actionQueueSummary','catch','log','exports','bluebird','moment','util','lodash','ami','../../config/environment','port','asterisk','username','Action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','error'];(function(_0x3c51d8,_0x13d156){var _0x1affa6=function(_0x61f0e0){while(--_0x61f0e0){_0x3c51d8['push'](_0x3c51d8['shift']());}};_0x1affa6(++_0x13d156);}(_0x2a23,0x11c));var _0x32a2=function(_0x4c1f64,_0x5cea53){_0x4c1f64=_0x4c1f64-0x0;var _0x5a5959=_0x2a23[_0x4c1f64];return _0x5a5959;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x32a2('0x0'));var moment=require(_0x32a2('0x1'));var util=require(_0x32a2('0x2'));var _=require(_0x32a2('0x3'));var logger=require('../../config/logger')(_0x32a2('0x4'));var config=require(_0x32a2('0x5'));var ami=new Manager(config['asterisk'][_0x32a2('0x6')],config[_0x32a2('0x7')]['ip'],config['asterisk'][_0x32a2('0x8')],config[_0x32a2('0x7')]['password'],!![]);ami['keepConnected']();ami[_0x32a2('0x9')]=BPromise['promisify'](ami['action']);function error(_0x11c711){logger['error'](util[_0x32a2('0xa')](_0x32a2('0xb'),config[_0x32a2('0x7')][_0x32a2('0x8')],config[_0x32a2('0x7')]['ip'],config[_0x32a2('0x7')]['port'],util['inspect'](_0x11c711,![],null)));}function close(){logger[_0x32a2('0xc')](util['format'](_0x32a2('0xd'),config[_0x32a2('0x7')][_0x32a2('0x8')],config[_0x32a2('0x7')]['ip'],config['asterisk']['port']));}ami[_0x32a2('0xe')]=function(){return function(){return ami[_0x32a2('0x9')]({'action':_0x32a2('0xf')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x32a2('0x9')]({'action':'devicestatelist'});};};ami[_0x32a2('0x10')]=function(){return function(){return ami[_0x32a2('0x9')]({'action':_0x32a2('0x11')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x32a2('0x9')]({'action':_0x32a2('0x12')});};};ami[_0x32a2('0x13')]=function(){return function(){return ami[_0x32a2('0x9')]({'action':_0x32a2('0x14')});};};function connect(_0x45226f){logger[_0x32a2('0x15')](util[_0x32a2('0xa')](_0x32a2('0x16'),config[_0x32a2('0x7')][_0x32a2('0x8')],config['asterisk']['ip'],config[_0x32a2('0x7')][_0x32a2('0x6')]));ami[_0x32a2('0x17')](_0x32a2('0xc'),error);ami[_0x32a2('0x17')]('close',close);}ami['on']('connect',connect);ami['on'](_0x32a2('0x18'),function(_0x3cec66){logger[_0x32a2('0x15')](util[_0x32a2('0xa')](_0x32a2('0x19'),config[_0x32a2('0x7')][_0x32a2('0x8')],config['asterisk']['ip'],config[_0x32a2('0x7')][_0x32a2('0x6')],util['inspect'](_0x3cec66,![],null)));});ami['on'](_0x32a2('0x1a'),function(_0x1bb6cd){logger[_0x32a2('0x15')](util[_0x32a2('0xa')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x32a2('0x7')]['username'],config[_0x32a2('0x7')]['ip'],config[_0x32a2('0x7')][_0x32a2('0x6')]));return BPromise['resolve']()[_0x32a2('0x1b')](ami['actionSipShowRegistry']())[_0x32a2('0x1b')](ami[_0x32a2('0x1c')]())[_0x32a2('0x1b')](ami[_0x32a2('0x10')]())['then'](ami[_0x32a2('0x1d')]())[_0x32a2('0x1b')](ami[_0x32a2('0x13')]())[_0x32a2('0x1e')](function(_0x34fdc6){console[_0x32a2('0x1f')](_0x34fdc6);});});ami['once'](_0x32a2('0xc'),error);ami[_0x32a2('0x17')]('close',close);module[_0x32a2('0x20')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 7a82a14..7353015 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 _0x9e0f=['memberReport','error','message','result','exports','jayson/promise','bluebird','../../config/logger','ami','client','http','request','then','debug','rpc'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x9e0f,0x14f));var _0xf9e0=function(_0x417810,_0x558e62){_0x417810=_0x417810-0x0;var _0x5a7c48=_0x9e0f[_0x417810];return _0x5a7c48;};'use strict';var jayson=require(_0xf9e0('0x0'));var BPromise=require(_0xf9e0('0x1'));var logger=require(_0xf9e0('0x2'))(_0xf9e0('0x3'));var client=jayson[_0xf9e0('0x4')][_0xf9e0('0x5')]({'port':0x2329});client['Request']=function(_0x15f44a,_0x4acaf6){return new BPromise(function(_0x27723c,_0x5b1083){return client[_0xf9e0('0x6')](_0x15f44a,_0x4acaf6)[_0xf9e0('0x7')](function(_0x5b9d90){logger[_0xf9e0('0x8')](_0xf9e0('0x9'),_0xf9e0('0xa'),_0x15f44a,_0x4acaf6,_0x5b9d90);if(_0x5b9d90[_0xf9e0('0xb')]){logger[_0xf9e0('0xb')](_0xf9e0('0x9'),'memberReport',_0x15f44a,_0x5b9d90[_0xf9e0('0xb')][_0xf9e0('0xc')],_0x4acaf6);return _0x5b1083(_0x5b9d90[_0xf9e0('0xb')][_0xf9e0('0xc')]);}else{return _0x27723c(_0x5b9d90[_0xf9e0('0xd')]);}})['catch'](function(_0x40823b){logger[_0xf9e0('0xb')](_0xf9e0('0x9'),'memberReport',_0x15f44a,_0x40823b,_0x4acaf6);return _0x5b1083(_0x40823b);});});};module[_0xf9e0('0xe')]=client; \ No newline at end of file +var _0x6570=['exports','jayson/promise','bluebird','client','http','Request','then','debug','rpc','error','memberReport','message','result','catch'];(function(_0x30381c,_0x17a45a){var _0x24fcc2=function(_0x2af3c1){while(--_0x2af3c1){_0x30381c['push'](_0x30381c['shift']());}};_0x24fcc2(++_0x17a45a);}(_0x6570,0xa9));var _0x0657=function(_0x239422,_0x353de1){_0x239422=_0x239422-0x0;var _0x155cf2=_0x6570[_0x239422];return _0x155cf2;};'use strict';var jayson=require(_0x0657('0x0'));var BPromise=require(_0x0657('0x1'));var logger=require('../../config/logger')('ami');var client=jayson[_0x0657('0x2')][_0x0657('0x3')]({'port':0x2329});client[_0x0657('0x4')]=function(_0xd6c5d2,_0xf3578d){return new BPromise(function(_0x66f8a6,_0x15e6b9){return client['request'](_0xd6c5d2,_0xf3578d)[_0x0657('0x5')](function(_0x2cd924){logger[_0x0657('0x6')](_0x0657('0x7'),'memberReport',_0xd6c5d2,_0xf3578d,_0x2cd924);if(_0x2cd924[_0x0657('0x8')]){logger[_0x0657('0x8')]('rpc',_0x0657('0x9'),_0xd6c5d2,_0x2cd924[_0x0657('0x8')][_0x0657('0xa')],_0xf3578d);return _0x15e6b9(_0x2cd924[_0x0657('0x8')][_0x0657('0xa')]);}else{return _0x66f8a6(_0x2cd924[_0x0657('0xb')]);}})[_0x0657('0xc')](function(_0x5aa8e3){logger['error'](_0x0657('0x7'),_0x0657('0x9'),_0xd6c5d2,_0x5aa8e3,_0xf3578d);return _0x15e6b9(_0x5aa8e3);});});};module[_0x0657('0xd')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index fb8a2db..110ca04 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 _0x8f1d=['name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','prototype','getQueue','exports','util','lodash','isNil','string','voiceQueue','uniqueid'];(function(_0x1321b7,_0x1e782e){var _0x5c40d5=function(_0x1f30ed){while(--_0x1f30ed){_0x1321b7['push'](_0x1321b7['shift']());}};_0x5c40d5(++_0x1e782e);}(_0x8f1d,0x72));var _0xd8f1=function(_0x1dab5f,_0x10cd21){_0x1dab5f=_0x1dab5f-0x0;var _0x40c2f3=_0x8f1d[_0x1dab5f];return _0x40c2f3;};'use strict';var util=require(_0xd8f1('0x0'));var _=require(_0xd8f1('0x1'));var moment=require('moment');function checkNameSurname(_0x235e73,_0x2a193f,_0xcec63f){var _0x3155bd='';if(!_[_0xd8f1('0x2')](_0x2a193f)&&'string'===typeof _0x2a193f){_0x3155bd+=_0x2a193f;}if(!_[_0xd8f1('0x2')](_0xcec63f)&&_0xd8f1('0x3')===typeof _0xcec63f){_0x3155bd+='\x20'+_0xcec63f;}if(_0x3155bd!==''){return _0x3155bd;}return _0x235e73;}function Action(_0x2cc0bf,_0x103610,_0x5ef96f){this[_0xd8f1('0x4')]=_0x2cc0bf;this[_0xd8f1('0x5')]=_0x5ef96f||undefined;this[_0xd8f1('0x6')]=checkNameSurname(_0x103610[_0xd8f1('0x7')][_0xd8f1('0x8')],_0x103610['Contact'][_0xd8f1('0x9')],_0x103610[_0xd8f1('0x7')][_0xd8f1('0xa')]);this[_0xd8f1('0xb')]=_0x103610[_0xd8f1('0x7')][_0xd8f1('0x8')];this[_0xd8f1('0xc')]=_0x2cc0bf[_0xd8f1('0x6')];this['active']=_0x103610[_0xd8f1('0xd')]||![];this['type']=_0x2cc0bf[_0xd8f1('0xe')];this[_0xd8f1('0xf')]=_0x2cc0bf['dialQueueTimeout']||0x3;this[_0xd8f1('0x10')]=_0x103610[_0xd8f1('0x10')];this[_0xd8f1('0x11')]=_0x103610[_0xd8f1('0x11')];this[_0xd8f1('0x12')]=_0x103610[_0xd8f1('0x12')];this[_0xd8f1('0x13')]=_0x103610[_0xd8f1('0x13')];this['ContactId']=_0x103610[_0xd8f1('0x14')];this[_0xd8f1('0x15')]=_0x103610[_0xd8f1('0x15')];this['UserId']=_0x103610[_0xd8f1('0x16')];this[_0xd8f1('0x17')]=_0x103610['VoiceQueueId'];this[_0xd8f1('0x18')]=_0x103610[_0xd8f1('0x18')];this[_0xd8f1('0x19')]=_0x103610['id'];this['ContactFirstName']=_0x103610['Contact'][_0xd8f1('0x9')]||'';this[_0xd8f1('0x1a')]=moment()[_0xd8f1('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd8f1('0x1c')]=_0x103610[_0xd8f1('0x1c')];this[_0xd8f1('0x1d')]=_0x103610[_0xd8f1('0x1d')];this[_0xd8f1('0x1e')]=_0x103610['callbackat'];this[_0xd8f1('0x1f')]=_0x103610[_0xd8f1('0x1f')];this[_0xd8f1('0x20')]='';this[_0xd8f1('0x21')]='';}Action['prototype'][_0xd8f1('0x22')]=function(){return util[_0xd8f1('0x1b')](_0xd8f1('0x23'),this[_0xd8f1('0x6')],this[_0xd8f1('0x4')][_0xd8f1('0x24')]>0x0?this[_0xd8f1('0xb')]['substring'](this[_0xd8f1('0x4')][_0xd8f1('0x24')]):this[_0xd8f1('0xb')]);};Action[_0xd8f1('0x25')][_0xd8f1('0x26')]=function(){return this[_0xd8f1('0xc')];};module[_0xd8f1('0x27')]=Action; \ No newline at end of file +var _0xcd3c=['ListId','UserId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','voiceQueue','name','Contact','phone','firstName','lastName','number','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x4d5558,_0x42e92f){var _0x2679d5=function(_0x42439b){while(--_0x42439b){_0x4d5558['push'](_0x4d5558['shift']());}};_0x2679d5(++_0x42e92f);}(_0xcd3c,0x1b7));var _0xccd3=function(_0x53c100,_0x3f4d3b){_0x53c100=_0x53c100-0x0;var _0x9b8574=_0xcd3c[_0x53c100];return _0x9b8574;};'use strict';var util=require(_0xccd3('0x0'));var _=require(_0xccd3('0x1'));var moment=require(_0xccd3('0x2'));function checkNameSurname(_0x995168,_0x28731d,_0x35f7f7){var _0x4c7e58='';if(!_[_0xccd3('0x3')](_0x28731d)&&'string'===typeof _0x28731d){_0x4c7e58+=_0x28731d;}if(!_[_0xccd3('0x3')](_0x35f7f7)&&'string'===typeof _0x35f7f7){_0x4c7e58+='\x20'+_0x35f7f7;}if(_0x4c7e58!==''){return _0x4c7e58;}return _0x995168;}function Action(_0x360fbd,_0x2ec924,_0x1f0b8b){this[_0xccd3('0x4')]=_0x360fbd;this['uniqueid']=_0x1f0b8b||undefined;this[_0xccd3('0x5')]=checkNameSurname(_0x2ec924[_0xccd3('0x6')][_0xccd3('0x7')],_0x2ec924[_0xccd3('0x6')][_0xccd3('0x8')],_0x2ec924[_0xccd3('0x6')][_0xccd3('0x9')]);this[_0xccd3('0xa')]=_0x2ec924['Contact']['phone'];this['queue']=_0x360fbd[_0xccd3('0x5')];this[_0xccd3('0xb')]=_0x2ec924[_0xccd3('0xb')]||![];this['type']=_0x360fbd['type'];this['dialQueueTimeout']=_0x360fbd['dialQueueTimeout']||0x3;this[_0xccd3('0xc')]=_0x2ec924[_0xccd3('0xc')];this[_0xccd3('0xd')]=_0x2ec924[_0xccd3('0xd')];this[_0xccd3('0xe')]=_0x2ec924[_0xccd3('0xe')];this[_0xccd3('0xf')]=_0x2ec924[_0xccd3('0xf')];this['ContactId']=_0x2ec924['ContactId'];this[_0xccd3('0x10')]=_0x2ec924[_0xccd3('0x10')];this[_0xccd3('0x11')]=_0x2ec924['UserId'];this['VoiceQueueId']=_0x2ec924['VoiceQueueId'];this[_0xccd3('0x12')]=_0x2ec924[_0xccd3('0x12')];this[_0xccd3('0x13')]=_0x2ec924['id'];this['ContactFirstName']=_0x2ec924[_0xccd3('0x6')][_0xccd3('0x8')]||'';this[_0xccd3('0x14')]=moment()[_0xccd3('0x15')](_0xccd3('0x16'));this[_0xccd3('0x17')]=_0x2ec924['callback'];this[_0xccd3('0x18')]=_0x2ec924['callbackuniqueid'];this[_0xccd3('0x19')]=_0x2ec924[_0xccd3('0x19')];this['recallme']=_0x2ec924[_0xccd3('0x1a')];this[_0xccd3('0x1b')]='';this[_0xccd3('0x1c')]='';}Action[_0xccd3('0x1d')][_0xccd3('0x1e')]=function(){return util[_0xccd3('0x15')]('\x22%s\x22\x20<%s>',this[_0xccd3('0x5')],this[_0xccd3('0x4')][_0xccd3('0x1f')]>0x0?this['number'][_0xccd3('0x20')](this[_0xccd3('0x4')]['dialCutDigit']):this[_0xccd3('0xa')]);};Action[_0xccd3('0x1d')][_0xccd3('0x21')]=function(){return this['queue'];};module[_0xccd3('0x22')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index db76803..9f305fd 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 _0x8436=['outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype'];(function(_0x7e64b8,_0x16c0cd){var _0x1a09cf=function(_0x3f3044){while(--_0x3f3044){_0x7e64b8['push'](_0x7e64b8['shift']());}};_0x1a09cf(++_0x16c0cd);}(_0x8436,0xf7));var _0x6843=function(_0x1e9e55,_0x317c3b){_0x1e9e55=_0x1e9e55-0x0;var _0x3e2c6a=_0x8436[_0x1e9e55];return _0x3e2c6a;};'use strict';var util=require('util');var _=require(_0x6843('0x0'));var moment=require(_0x6843('0x1'));function getSeconds(_0xa16f7b,_0x2349a6){var _0xafc602=moment(_0xa16f7b)[_0x6843('0x2')](0x0);var _0x1c8df5=moment(_0x2349a6)[_0x6843('0x2')](0x0);return _0xafc602[_0x6843('0x3')](_0x1c8df5,_0x6843('0x4'));}function AgentComplete(_0x51dc19,_0x159c88){this[_0x6843('0x5')]=0x4;this[_0x6843('0x6')]=_0x6843('0x7');this['scheduledat']=_0x51dc19[_0x6843('0x8')];this[_0x6843('0x9')]=_0x51dc19[_0x6843('0x9')];this[_0x6843('0xa')]=_0x51dc19[_0x6843('0x9')]===_0x6843('0xb')?_0x6843('0xc'):_0x51dc19[_0x6843('0x9')];this[_0x6843('0xd')]=_0x51dc19[_0x6843('0xd')];this[_0x6843('0xe')]=_0x51dc19[_0x6843('0xe')];this['countnoanswerretry']=_0x51dc19[_0x6843('0xf')];this[_0x6843('0x10')]=_0x51dc19[_0x6843('0xd')]+_0x51dc19[_0x6843('0xe')]+_0x51dc19[_0x6843('0xf')];this[_0x6843('0x11')]=_0x159c88[_0x6843('0x11')];this[_0x6843('0x12')]=_0x51dc19[_0x6843('0x13')];this[_0x6843('0x14')]=_0x51dc19[_0x6843('0x15')];this[_0x6843('0x16')]=_0x51dc19[_0x6843('0x16')];this[_0x6843('0x17')]=_0x51dc19['responsetime'];this[_0x6843('0x18')]=_0x51dc19[_0x6843('0x18')];this[_0x6843('0x19')]=moment()['format'](_0x6843('0x1a'));this[_0x6843('0x1b')]=getSeconds(_0x51dc19[_0x6843('0x17')],_0x51dc19[_0x6843('0x16')]);this['holdtime']=getSeconds(_0x51dc19[_0x6843('0x18')],_0x51dc19[_0x6843('0x17')]);this[_0x6843('0x1c')]=getSeconds(this[_0x6843('0x19')],_0x51dc19[_0x6843('0x18')]);this[_0x6843('0xc')]=_0x159c88[_0x6843('0xc')];this[_0x6843('0x1d')]=_0x159c88[_0x6843('0x1d')];this[_0x6843('0x1e')]=_0x159c88['reason'];this[_0x6843('0x1f')]=_0x51dc19['callback'];this[_0x6843('0x20')]=_0x51dc19[_0x6843('0x20')];this[_0x6843('0x21')]=_0x51dc19[_0x6843('0x21')];this[_0x6843('0x22')]=_0x51dc19['recallme'];this[_0x6843('0x23')]=_0x51dc19[_0x6843('0x23')];this[_0x6843('0x24')]=_0x51dc19['ListId'];this[_0x6843('0x25')]=_0x51dc19[_0x6843('0x25')];this[_0x6843('0x26')]=_0x51dc19[_0x6843('0x26')];this[_0x6843('0x27')]=_0x51dc19[_0x6843('0x27')];this[_0x6843('0x28')]=_0x51dc19[_0x6843('0x28')]||'';this['originatecalleridname']=_0x51dc19[_0x6843('0x29')]||'';}module[_0x6843('0x2a')]=AgentComplete; \ No newline at end of file +var _0xed8b=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime'];(function(_0x24a7c9,_0x2b6615){var _0x31566d=function(_0xc8bbd1){while(--_0xc8bbd1){_0x24a7c9['push'](_0x24a7c9['shift']());}};_0x31566d(++_0x2b6615);}(_0xed8b,0x11b));var _0xbed8=function(_0x492028,_0x38c95c){_0x492028=_0x492028-0x0;var _0x3fc883=_0xed8b[_0x492028];return _0x3fc883;};'use strict';var util=require('util');var _=require(_0xbed8('0x0'));var moment=require('moment');function getSeconds(_0x2f2681,_0x572b72){var _0x34b9ad=moment(_0x2f2681)[_0xbed8('0x1')](0x0);var _0x12abdb=moment(_0x572b72)['milliseconds'](0x0);return _0x34b9ad[_0xbed8('0x2')](_0x12abdb,'seconds');}function AgentComplete(_0xcf96df,_0x44bed0){this['state']=0x4;this[_0xbed8('0x3')]=_0xbed8('0x4');this['scheduledat']=_0xcf96df[_0xbed8('0x5')];this['type']=_0xcf96df[_0xbed8('0x6')];this[_0xbed8('0x7')]=_0xcf96df['type']===_0xbed8('0x8')?_0xbed8('0x9'):_0xcf96df[_0xbed8('0x6')];this[_0xbed8('0xa')]=_0xcf96df[_0xbed8('0xa')];this['countcongestionretry']=_0xcf96df[_0xbed8('0xb')];this[_0xbed8('0xc')]=_0xcf96df[_0xbed8('0xc')];this[_0xbed8('0xd')]=_0xcf96df[_0xbed8('0xa')]+_0xcf96df['countcongestionretry']+_0xcf96df['countnoanswerretry'];this[_0xbed8('0xe')]=_0x44bed0[_0xbed8('0xe')];this[_0xbed8('0xf')]=_0xcf96df[_0xbed8('0x10')];this[_0xbed8('0x11')]=_0xcf96df['number'];this[_0xbed8('0x12')]=_0xcf96df[_0xbed8('0x12')];this[_0xbed8('0x13')]=_0xcf96df[_0xbed8('0x13')];this['answertime']=_0xcf96df[_0xbed8('0x14')];this[_0xbed8('0x15')]=moment()[_0xbed8('0x16')](_0xbed8('0x17'));this['ringtime']=getSeconds(_0xcf96df[_0xbed8('0x13')],_0xcf96df[_0xbed8('0x12')]);this['holdtime']=getSeconds(_0xcf96df[_0xbed8('0x14')],_0xcf96df[_0xbed8('0x13')]);this[_0xbed8('0x18')]=getSeconds(this['endtime'],_0xcf96df[_0xbed8('0x14')]);this[_0xbed8('0x9')]=_0x44bed0[_0xbed8('0x9')];this[_0xbed8('0x19')]=_0x44bed0[_0xbed8('0x19')];this['reason']=_0x44bed0[_0xbed8('0x1a')];this['callback']=_0xcf96df['callback'];this[_0xbed8('0x1b')]=_0xcf96df[_0xbed8('0x1b')];this[_0xbed8('0x1c')]=_0xcf96df['callbackat'];this['recallme']=_0xcf96df[_0xbed8('0x1d')];this[_0xbed8('0x1e')]=_0xcf96df[_0xbed8('0x1e')];this[_0xbed8('0x1f')]=_0xcf96df[_0xbed8('0x1f')];this['UserId']=_0xcf96df[_0xbed8('0x20')];this[_0xbed8('0x21')]=_0xcf96df[_0xbed8('0x21')];this[_0xbed8('0x22')]=_0xcf96df[_0xbed8('0x22')];this[_0xbed8('0x23')]=_0xcf96df[_0xbed8('0x23')]||'';this[_0xbed8('0x24')]=_0xcf96df[_0xbed8('0x24')]||'';}module[_0xbed8('0x25')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 16f4f44..9839c3d 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 _0xb7f0=['exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x592198,_0x5548b4){var _0x504b22=function(_0x3dee50){while(--_0x3dee50){_0x592198['push'](_0x592198['shift']());}};_0x504b22(++_0x5548b4);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x358881,_0x1b748c){_0x358881=_0x358881-0x0;var _0x76792d=_0xb7f0[_0x358881];return _0x76792d;};'use strict';var util=require(_0x0b7f('0x0'));var _=require(_0x0b7f('0x1'));var moment=require(_0x0b7f('0x2'));function getSeconds(_0x405325,_0x4d30e5){var _0x47efe2=moment(_0x405325)[_0x0b7f('0x3')](0x0);var _0xa1285e=moment(_0x4d30e5)[_0x0b7f('0x3')](0x0);return _0x47efe2[_0x0b7f('0x4')](_0xa1285e,_0x0b7f('0x5'));}function Final(_0x15ea82){this[_0x0b7f('0x6')]=_0x15ea82[_0x0b7f('0x6')];this[_0x0b7f('0x7')]=_0x15ea82[_0x0b7f('0x7')];this['type']=_0x15ea82[_0x0b7f('0x8')];this[_0x0b7f('0x9')]=_0x15ea82['type']===_0x0b7f('0xa')?_0x0b7f('0xb'):_0x15ea82['type'];this['countbusyretry']=_0x15ea82['countbusyretry'];this[_0x0b7f('0xc')]=_0x15ea82[_0x0b7f('0xc')];this[_0x0b7f('0xd')]=_0x15ea82[_0x0b7f('0xd')];this[_0x0b7f('0xe')]=_0x15ea82[_0x0b7f('0xf')]+_0x15ea82[_0x0b7f('0xc')]+_0x15ea82[_0x0b7f('0xd')];this[_0x0b7f('0xb')]=_0x15ea82[_0x0b7f('0xb')];this[_0x0b7f('0x10')]=_0x15ea82['calleridname'];this[_0x0b7f('0x11')]=_0x15ea82[_0x0b7f('0x11')];this[_0x0b7f('0x12')]=_0x15ea82[_0x0b7f('0x12')];this[_0x0b7f('0x13')]=_0x15ea82[_0x0b7f('0x13')];this[_0x0b7f('0x14')]=_0x15ea82[_0x0b7f('0x13')];this['ringtime']=_0x15ea82[_0x0b7f('0x15')]||0x0;this[_0x0b7f('0x16')]=_0x15ea82[_0x0b7f('0x16')]||0x0;this[_0x0b7f('0x17')]=_0x15ea82['talktime']||0x0;this[_0x0b7f('0x18')]=_0x15ea82[_0x0b7f('0x18')];this[_0x0b7f('0x19')]=_0x15ea82[_0x0b7f('0x19')];this[_0x0b7f('0x1a')]=_0x15ea82['callbackat'];this[_0x0b7f('0x1b')]=_0x15ea82['recallme'];this['ContactId']=_0x15ea82[_0x0b7f('0x1c')];this[_0x0b7f('0x1d')]=_0x15ea82[_0x0b7f('0x1d')];this[_0x0b7f('0x1e')]=_0x15ea82[_0x0b7f('0x1e')];this['VoiceQueueId']=_0x15ea82['VoiceQueueId'];this[_0x0b7f('0x1f')]=_0x15ea82[_0x0b7f('0x1f')];this[_0x0b7f('0x20')]=_0x15ea82['originatecalleridnum']||'';this[_0x0b7f('0x21')]=_0x15ea82[_0x0b7f('0x21')]||'';}module[_0x0b7f('0x22')]=Final; \ No newline at end of file +var _0x1115=['uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff'];(function(_0xc52482,_0x57c7f9){var _0xe49f8f=function(_0xb91c6f){while(--_0xb91c6f){_0xc52482['push'](_0xc52482['shift']());}};_0xe49f8f(++_0x57c7f9);}(_0x1115,0x1b6));var _0x5111=function(_0x4faf73,_0x5e6a0a){_0x4faf73=_0x4faf73-0x0;var _0x169a51=_0x1115[_0x4faf73];return _0x169a51;};'use strict';var util=require('util');var _=require(_0x5111('0x0'));var moment=require(_0x5111('0x1'));function getSeconds(_0x352000,_0x20e2ee){var _0x39a422=moment(_0x352000)[_0x5111('0x2')](0x0);var _0x301d43=moment(_0x20e2ee)[_0x5111('0x2')](0x0);return _0x39a422[_0x5111('0x3')](_0x301d43,'seconds');}function Final(_0x5981cb){this[_0x5111('0x4')]=_0x5981cb[_0x5111('0x4')];this['scheduledat']=_0x5981cb[_0x5111('0x5')];this[_0x5111('0x6')]=_0x5981cb['type'];this[_0x5111('0x7')]=_0x5981cb['type']===_0x5111('0x8')?_0x5111('0x9'):_0x5981cb['type'];this['countbusyretry']=_0x5981cb[_0x5111('0xa')];this['countcongestionretry']=_0x5981cb[_0x5111('0xb')];this['countnoanswerretry']=_0x5981cb[_0x5111('0xc')];this[_0x5111('0xd')]=_0x5981cb[_0x5111('0xa')]+_0x5981cb[_0x5111('0xb')]+_0x5981cb[_0x5111('0xc')];this[_0x5111('0x9')]=_0x5981cb[_0x5111('0x9')];this[_0x5111('0xe')]=_0x5981cb[_0x5111('0xe')];this[_0x5111('0xf')]=_0x5981cb[_0x5111('0xf')];this[_0x5111('0x10')]=_0x5981cb[_0x5111('0x10')];this[_0x5111('0x11')]=_0x5981cb[_0x5111('0x11')];this[_0x5111('0x12')]=_0x5981cb[_0x5111('0x11')];this[_0x5111('0x13')]=_0x5981cb['ringtime']||0x0;this[_0x5111('0x14')]=_0x5981cb['holdtime']||0x0;this['talktime']=_0x5981cb[_0x5111('0x15')]||0x0;this[_0x5111('0x16')]=_0x5981cb[_0x5111('0x16')];this['callbackuniqueid']=_0x5981cb[_0x5111('0x17')];this[_0x5111('0x18')]=_0x5981cb['callbackat'];this[_0x5111('0x19')]=_0x5981cb[_0x5111('0x19')];this[_0x5111('0x1a')]=_0x5981cb[_0x5111('0x1a')];this['ListId']=_0x5981cb[_0x5111('0x1b')];this[_0x5111('0x1c')]=_0x5981cb[_0x5111('0x1c')];this[_0x5111('0x1d')]=_0x5981cb[_0x5111('0x1d')];this[_0x5111('0x1e')]=_0x5981cb[_0x5111('0x1e')];this[_0x5111('0x1f')]=_0x5981cb[_0x5111('0x1f')]||'';this[_0x5111('0x20')]=_0x5981cb['originatecalleridname']||'';}module[_0x5111('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 0fd1151..9ad1a3b 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(_0x4a17a7,_0x2caa4e){var _0x1095e2=function(_0x1fc462){while(--_0x1fc462){_0x4a17a7['push'](_0x4a17a7['shift']());}};_0x1095e2(++_0x2caa4e);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 681d319..3a92eec 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 _0x885a=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','queue','calleridname','number','starttime','responsetime','endtime','ringtime'];(function(_0x2f7df8,_0xc56318){var _0x17d76e=function(_0x5cc608){while(--_0x5cc608){_0x2f7df8['push'](_0x2f7df8['shift']());}};_0x17d76e(++_0xc56318);}(_0x885a,0xcc));var _0xa885=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x885a[_0x2be8c2];return _0x97f531;};'use strict';var util=require(_0xa885('0x0'));var _=require(_0xa885('0x1'));var moment=require(_0xa885('0x2'));function getSeconds(_0x2cc145,_0x5db898){var _0x3b9551=moment(_0x2cc145)[_0xa885('0x3')](0x0);var _0xea5c29=moment(_0x5db898)['milliseconds'](0x0);return _0x3b9551['diff'](_0xea5c29,_0xa885('0x4'));}function History(_0x3200b1){this[_0xa885('0x5')]=_0x3200b1[_0xa885('0x5')];this[_0xa885('0x6')]=_0x3200b1['scheduledat']||undefined;this['type']=_0x3200b1['type'];this['campaigntype']=_0x3200b1[_0xa885('0x7')]===_0xa885('0x8')?'queue':_0x3200b1['type'];this[_0xa885('0x9')]=_0x3200b1[_0xa885('0x9')];this['countcongestionretry']=_0x3200b1[_0xa885('0xa')];this[_0xa885('0xb')]=_0x3200b1[_0xa885('0xb')];this[_0xa885('0xc')]=_0x3200b1[_0xa885('0x9')]+_0x3200b1[_0xa885('0xa')]+_0x3200b1[_0xa885('0xb')];this[_0xa885('0xd')]=_0x3200b1['queue'];this[_0xa885('0xe')]=_0x3200b1['name'];this['calleridnum']=_0x3200b1[_0xa885('0xf')];this[_0xa885('0x10')]=_0x3200b1['starttime'];this['responsetime']=_0x3200b1[_0xa885('0x11')];this[_0xa885('0x12')]=_0x3200b1[_0xa885('0x11')];this[_0xa885('0x13')]=getSeconds(_0x3200b1[_0xa885('0x11')],_0x3200b1[_0xa885('0x10')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0xa885('0x14')]=_0x3200b1[_0xa885('0x14')];this['callbackuniqueid']=_0x3200b1[_0xa885('0x15')];this[_0xa885('0x16')]=_0x3200b1[_0xa885('0x16')];this[_0xa885('0x17')]=_0x3200b1[_0xa885('0x17')];this['ContactId']=_0x3200b1[_0xa885('0x18')];this[_0xa885('0x19')]=_0x3200b1[_0xa885('0x19')];this[_0xa885('0x1a')]=_0x3200b1['UserId'];this['VoiceQueueId']=_0x3200b1[_0xa885('0x1b')];this['CampaignId']=_0x3200b1[_0xa885('0x1c')];this[_0xa885('0x1d')]=_0x3200b1[_0xa885('0x1d')]||'';this['originatecalleridname']=_0x3200b1[_0xa885('0x1e')]||'';}module[_0xa885('0x1f')]=History; \ No newline at end of file +var _0x919d=['scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x919d,0xc1));var _0xd919=function(_0x4da772,_0x33bb8e){_0x4da772=_0x4da772-0x0;var _0x24fd35=_0x919d[_0x4da772];return _0x24fd35;};'use strict';var util=require(_0xd919('0x0'));var _=require(_0xd919('0x1'));var moment=require('moment');function getSeconds(_0x36a890,_0x4b26dc){var _0x305525=moment(_0x36a890)[_0xd919('0x2')](0x0);var _0x517725=moment(_0x4b26dc)[_0xd919('0x2')](0x0);return _0x305525[_0xd919('0x3')](_0x517725,'seconds');}function History(_0x46c416){this[_0xd919('0x4')]=_0x46c416['uniqueid'];this[_0xd919('0x5')]=_0x46c416['scheduledat']||undefined;this[_0xd919('0x6')]=_0x46c416[_0xd919('0x6')];this[_0xd919('0x7')]=_0x46c416[_0xd919('0x6')]==='outbound'?_0xd919('0x8'):_0x46c416[_0xd919('0x6')];this[_0xd919('0x9')]=_0x46c416['countbusyretry'];this[_0xd919('0xa')]=_0x46c416[_0xd919('0xa')];this[_0xd919('0xb')]=_0x46c416['countnoanswerretry'];this[_0xd919('0xc')]=_0x46c416['countbusyretry']+_0x46c416[_0xd919('0xa')]+_0x46c416[_0xd919('0xb')];this[_0xd919('0x8')]=_0x46c416[_0xd919('0x8')];this[_0xd919('0xd')]=_0x46c416[_0xd919('0xe')];this[_0xd919('0xf')]=_0x46c416['number'];this['starttime']=_0x46c416[_0xd919('0x10')];this[_0xd919('0x11')]=_0x46c416[_0xd919('0x11')];this[_0xd919('0x12')]=_0x46c416[_0xd919('0x11')];this[_0xd919('0x13')]=getSeconds(_0x46c416[_0xd919('0x11')],_0x46c416[_0xd919('0x10')]);this[_0xd919('0x14')]=0x0;this[_0xd919('0x15')]=0x0;this['callback']=_0x46c416[_0xd919('0x16')];this[_0xd919('0x17')]=_0x46c416[_0xd919('0x17')];this[_0xd919('0x18')]=_0x46c416[_0xd919('0x18')];this[_0xd919('0x19')]=_0x46c416[_0xd919('0x19')];this[_0xd919('0x1a')]=_0x46c416[_0xd919('0x1a')];this[_0xd919('0x1b')]=_0x46c416[_0xd919('0x1b')];this[_0xd919('0x1c')]=_0x46c416[_0xd919('0x1c')];this['VoiceQueueId']=_0x46c416[_0xd919('0x1d')];this['CampaignId']=_0x46c416[_0xd919('0x1e')];this[_0xd919('0x1f')]=_0x46c416[_0xd919('0x1f')]||'';this['originatecalleridname']=_0x46c416[_0xd919('0x20')]||'';}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 ac29856..7c374ab 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(_0x4f9576,_0x2f1182){var _0x25c1da=function(_0x13b0e5){while(--_0x13b0e5){_0x4f9576['push'](_0x4f9576['shift']());}};_0x25c1da(++_0x2f1182);}(_0x4213,0x77));var _0x3421=function(_0x1e3188,_0x52c502){_0x1e3188=_0x1e3188-0x0;var _0x598d62=_0x4213[_0x1e3188];return _0x598d62;};'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 _0x1a85=['dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalPauses','originated','Trunk','active','callerid','md5','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','predictiveIntervalTotalCalls','predictiveIntervalAvgTalktime','info','[checkGetDataPredictive][avgTalktime]','[checkGetDataPredictive][avgHoldtime]','[checkGetDataPredictive][totalCalls]','[checkGetDataPredictive][objIsEmpty]','[checkGetDataPredictive][obj]','[ErlangB]','merge','seconds','startProgressive','[freeVariablesPredictive]','handlePredictive','string','\x22%s\x22\x20<%s>','error','inspect','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','endtime','[uniqueid]','clearZombieChannels','hasOwnProperty','enqueue','isNil','Action','status','channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','catch','[averageHandleTime]\x20','rescheduleContact','[getContactDialer]\x20','getContactDialerIvr','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','statedesc','HangupInAMD','membername','AMD','outboundAnswerCallsDay','state','Machine','amd','[syncMachine][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','[syncHangupIvr][createHistory]','cause-txt','Unknow','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','YYYY-MM-DD\x20HH:mm:ss','responsetime','Drop','dropreason','TIMEOUT','queueCallerAbandonCreateState','Abandoned','CALLEREXIT','actionid','locked','paused','stateinterface','queueBooked','pick','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','idHopper','[Catch][Preview][syncQueueStatusComplete]','CampaignId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','ContactId','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','Failure','timezones','TIMEZONE_UNKNOW','push','command','interval','content','indexOf','true','iftime\x20%s,%s','all','some','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','checkDialMethod','[syncQueueSummary]','checkIfTime','[syncCampaigns]','pow','replace','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialQueueTimeout','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','starttime','[originate][error]','getQueue','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','minutes','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','callProgressDetecting','[callProgressDetecting]','evt\x20is\x20undefine','reason','dialGlobalMaxRetry','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','erlangAbandonmentRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','[startMethodPredictive][StartProgressive][Date]','[startMethodPredictive][StartProgressive][Loop]','erlangCalls','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','dialPredictiveInterval','[startMethodPredictive][StartPredictive][Repeat]','startMethodPredictive','getDataPredictive','getVoiceQueueRtPauses','[CatchErlangB]','dialPredictiveOptimization','outboundQueuePauses','busyFactor','[getDataPredictive]','check\x20failure','floor','erlangCallToSecond','[startMethodPredictive]','[startMethodPredictive][milliseconds]\x20','Failure\x20','checkContactBlack','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','dialOrderByScheduledAt','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','RUNNING','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','[abandonmentRate]','\x20m\x20=\x20','\x20Ts\x20=\x20','\x20Amax\x20=\x20','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','[busyFactor]','\x20interval\x20=\x20','\x20p\x20=\x20','\x20Umin\x20=\x20','exports','bluebird','uuid','moment','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','name','Interval','INTERVAL_IS_NULL','isEmpty','Intervals','Error','stringify','milliseconds','diff','emit','outbound','strategy','available','loggedIn','pTalking','sumDuration','talking','total','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x1a85,0x178));var _0x51a8=function(_0x1f120c,_0x22cd8f){_0x1f120c=_0x1f120c-0x0;var _0x3f43f5=_0x1a85[_0x1f120c];return _0x3f43f5;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x51a8('0x0'));var uuid=require(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var config=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var loggerBooked=require('../../../config/logger')(_0x51a8('0x6'));var loggerPredictive=require('../../../config/logger')(_0x51a8('0x7'));var loggerPredictiveCalls=require('../../../config/logger')(_0x51a8('0x8'));var loggerSyncQueueSummary=require(_0x51a8('0x4'))('syncQueueSummary');var ami=require(_0x51a8('0x9'));config['redis']=_['defaults'](config[_0x51a8('0xa')],{'host':_0x51a8('0xb'),'port':0x18eb});var io=require(_0x51a8('0xc'))(new Redis(config[_0x51a8('0xa')]));var cmHopper=require(_0x51a8('0xd'));var cmHopperFinal=require(_0x51a8('0xe'));var cmHopperHistory=require(_0x51a8('0xf'));var cmHopperBlack=require(_0x51a8('0x10'));var voiceQueueRt=require(_0x51a8('0x11'));var Action=require(_0x51a8('0x12'));var History=require(_0x51a8('0x13'));var Final=require(_0x51a8('0x14'));var AgentComplete=require(_0x51a8('0x15'));var QueueCallerAbandon=require(_0x51a8('0x16'));var Hangup=require(_0x51a8('0x17'));var ipAgi=process[_0x51a8('0x18')][_0x51a8('0x19')]||'127.0.0.1';var strategy={'rrmemory':_0x51a8('0x1a'),'roundrobin':_0x51a8('0x1b')};var Sequence=function(){};Sequence[_0x51a8('0x1c')]['enqueue']=function(_0xf4eb6e){this['tail']=this[_0x51a8('0x1d')]?this[_0x51a8('0x1d')][_0x51a8('0x1e')](_0xf4eb6e):_0xf4eb6e();};function Dialer(_0x2b0521,_0x3fbd02){this[_0x51a8('0x1f')]=new Sequence();this[_0x51a8('0x20')]=_0x3fbd02;this['voiceQueues']=_0x2b0521[_0x51a8('0x21')];this[_0x51a8('0x22')]=_0x2b0521[_0x51a8('0x22')];this[_0x51a8('0x23')]=_0x2b0521[_0x51a8('0x23')];this[_0x51a8('0x24')]=_0x2b0521['trunks'];this[_0x51a8('0x25')]=config[_0x51a8('0x25')]||0x2;this[_0x51a8('0x26')]={};this[_0x51a8('0x27')]={};this[_0x51a8('0x28')]={};this[_0x51a8('0x29')]={};this[_0x51a8('0x2a')]={};this[_0x51a8('0x2b')]={};this['startProgressive']={};this[_0x51a8('0x2c')]={};this['queueBooked']={};this[_0x51a8('0x2d')]={};ami['on'](_0x51a8('0x2e'),this[_0x51a8('0x2f')][_0x51a8('0x30')](this));ami['on']('queuecallerabandon',this[_0x51a8('0x31')]['bind'](this));ami['on']('originateresponse',this[_0x51a8('0x32')]['bind'](this));ami['on'](_0x51a8('0x33'),this[_0x51a8('0x34')][_0x51a8('0x30')](this));ami['on'](_0x51a8('0x35'),this[_0x51a8('0x36')][_0x51a8('0x30')](this));ami['on'](_0x51a8('0x37'),this[_0x51a8('0x38')]['bind'](this));ami['on'](_0x51a8('0x39'),this[_0x51a8('0x3a')][_0x51a8('0x30')](this));ami['on'](_0x51a8('0x3b'),this[_0x51a8('0x3c')][_0x51a8('0x30')](this));ami['on'](_0x51a8('0x3d'),this[_0x51a8('0x3e')][_0x51a8('0x30')](this));ami['on'](_0x51a8('0x3f'),this[_0x51a8('0x40')][_0x51a8('0x30')](this));this['loopCampaigns']();this[_0x51a8('0x41')]();}function isNotNull(_0x58cba0){return _0x58cba0!==null&&!_[_0x51a8('0x42')](_0x58cba0);}function checkIsLoggedIn(_0x3bc19a,_0x143f46){return function(){if(_0x143f46<=0x0){_0x3bc19a[_0x51a8('0x43')]=_0x51a8('0x44');throw _0x3bc19a['name']+_0x51a8('0x45');}};}function isActive(_0x4c67ff){return _0x4c67ff;}function checkIsActive(_0x41c4de,_0x24b39a){return function(){if(!isActive(_0x24b39a)){_0x41c4de[_0x51a8('0x43')]='NOT_ACTIVE';throw _0x41c4de[_0x51a8('0x46')]+'\x20NOT\x20Active';}};}function checkInterval(_0x25a858){return function(){if(!isNotNull(_0x25a858[_0x51a8('0x47')])){_0x25a858[_0x51a8('0x43')]=_0x51a8('0x48');throw _0x25a858[_0x51a8('0x46')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x25a858[_0x51a8('0x47')]['Intervals'])){_0x25a858[_0x51a8('0x43')]=_0x51a8('0x48');throw _0x25a858[_0x51a8('0x46')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x51a8('0x49')](_0x25a858[_0x51a8('0x47')][_0x51a8('0x4a')]))){_0x25a858[_0x51a8('0x43')]=_0x51a8('0x48');throw _0x25a858['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x4d3114,_0x21b871,_0x299001){return{'action':_0x4d3114,'response':_0x21b871,'message':_0x299001};}function myreject(_0x4ec1db){return function(_0x35d7a1){return _0x4ec1db(msgResponse('[ifTime][Action]',_0x51a8('0x4b'),JSON[_0x51a8('0x4c')](_0x35d7a1)));};}function getSeconds(_0x433853,_0x1eef9d){var _0x256cda=moment(_0x433853)[_0x51a8('0x4d')](0x0);var _0x4e88cc=moment(_0x1eef9d)['milliseconds'](0x0);return _0x256cda[_0x51a8('0x4e')](_0x4e88cc,'seconds');}function emit(_0x5d7214,_0x5df144,_0x1d775e){io['to'](_0x5d7214)[_0x51a8('0x4f')](_0x5df144,_0x1d775e);}function emitVoiceQueueSummary(_0x3cbf97){if(_0x3cbf97['type']===_0x51a8('0x50')){var _0x25d772={'id':_0x3cbf97['id'],'name':_0x3cbf97[_0x51a8('0x46')],'strategy':_0x3cbf97[_0x51a8('0x51')],'answered':_0x3cbf97['answered'],'available':_0x3cbf97[_0x51a8('0x52')],'loggedIn':_0x3cbf97[_0x51a8('0x53')],'pTalking':_0x3cbf97[_0x51a8('0x54')],'sumBillable':_0x3cbf97['sumBillable'],'sumDuration':_0x3cbf97[_0x51a8('0x55')],'sumHoldTime':_0x3cbf97['sumHoldTime']||0x0,'talking':_0x3cbf97[_0x51a8('0x56')],'total':_0x3cbf97[_0x51a8('0x57')],'type':_0x3cbf97[_0x51a8('0x58')],'unmanaged':_0x3cbf97[_0x51a8('0x59')],'abandoned':_0x3cbf97['abandoned'],'waiting':_0x3cbf97[_0x51a8('0x5a')],'loggedInDb':_0x3cbf97[_0x51a8('0x5b')],'dialActive':_0x3cbf97[_0x51a8('0x5c')],'dialMethod':_0x3cbf97[_0x51a8('0x5d')],'dialOriginateCallerIdName':_0x3cbf97[_0x51a8('0x5e')],'dialOriginateCallerIdNumber':_0x3cbf97[_0x51a8('0x5f')],'dialOriginateTimeout':_0x3cbf97[_0x51a8('0x60')],'dialPrefix':_0x3cbf97[_0x51a8('0x61')],'outboundAnswerAgiCallsDay':_0x3cbf97[_0x51a8('0x62')],'outboundAnswerCallsDay':_0x3cbf97['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x3cbf97[_0x51a8('0x63')],'outboundBusyCallsDay':_0x3cbf97[_0x51a8('0x64')],'outboundCongestionCallsDay':_0x3cbf97['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3cbf97['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3cbf97[_0x51a8('0x65')],'outboundDropCallsDayTimeout':_0x3cbf97[_0x51a8('0x66')],'outboundNoAnswerCallsDay':_0x3cbf97[_0x51a8('0x67')],'outboundNoSuchCallsDay':_0x3cbf97[_0x51a8('0x68')],'outboundOriginateFailureCallsDay':_0x3cbf97[_0x51a8('0x69')],'outboundReCallsDay':_0x3cbf97[_0x51a8('0x6a')],'outboundRejectCallsDay':_0x3cbf97[_0x51a8('0x6b')],'outboundUnknownCallsDay':_0x3cbf97[_0x51a8('0x6c')],'predictiveIntervalAnsweredCalls':_0x3cbf97[_0x51a8('0x6d')],'predictiveIntervalAvgHoldtime':_0x3cbf97[_0x51a8('0x6e')],'predictiveIntervalAvgTalktime':_0x3cbf97['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3cbf97[_0x51a8('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x3cbf97[_0x51a8('0x70')],'predictiveIntervalErlangCalls':_0x3cbf97[_0x51a8('0x71')],'predictiveIntervalErlangCallsDroppedCalls':_0x3cbf97[_0x51a8('0x72')],'predictiveIntervalHitRate':_0x3cbf97[_0x51a8('0x73')],'predictiveIntervalLowerLimit':_0x3cbf97[_0x51a8('0x74')],'predictiveIntervalMultiplicativeFactor':_0x3cbf97['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3cbf97[_0x51a8('0x75')],'predictiveIntervalTotalCalls':_0x3cbf97['predictiveIntervalTotalCalls'],'message':_0x3cbf97[_0x51a8('0x43')],'originated':_0x3cbf97[_0x51a8('0x76')]};if(_0x3cbf97[_0x51a8('0x77')]){_0x25d772[_0x51a8('0x77')]={'id':_0x3cbf97[_0x51a8('0x77')]['id'],'name':_0x3cbf97['Trunk']['name'],'active':_0x3cbf97[_0x51a8('0x77')][_0x51a8('0x78')],'callerid':_0x3cbf97[_0x51a8('0x77')][_0x51a8('0x79')]};}if(_0x3cbf97[_0x51a8('0x47')]){_0x25d772['Interval']={'id':_0x3cbf97['Interval']['id'],'name':_0x3cbf97[_0x51a8('0x47')][_0x51a8('0x46')]};}var _0x24b205=md5(JSON[_0x51a8('0x4c')](_0x25d772));if(_0x3cbf97[_0x51a8('0x7a')]!==_0x24b205){_0x3cbf97[_0x51a8('0x7a')]=_0x24b205;emit(util[_0x51a8('0x7b')](_0x51a8('0x7c'),_0x25d772[_0x51a8('0x46')]),'voice_queue:save',_0x25d772);}}}function emitCampaignSummary(_0x5cb2cf){if(_0x5cb2cf['type']===_0x51a8('0x7d')){emit(util[_0x51a8('0x7b')](_0x51a8('0x7e'),_0x5cb2cf['name']),_0x51a8('0x7f'),_0x5cb2cf);}}function checkGetDataPredictive(_0x3d6cd7){if(isNotNull(_0x3d6cd7)){if(!_['isEmpty'](_0x3d6cd7)){if(_0x3d6cd7[_0x51a8('0x80')]>0x0){if(!_['isUndefined'](_0x3d6cd7['predictiveIntervalAvgTalktime'])&&_0x3d6cd7[_0x51a8('0x81')]>0x0){return!![];}else{loggerPredictive[_0x51a8('0x82')](_0x51a8('0x83'),JSON['stringify'](_0x3d6cd7));}if(!_['isUndefined'](_0x3d6cd7[_0x51a8('0x6e')])&&_0x3d6cd7['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive[_0x51a8('0x82')](_0x51a8('0x84'),JSON[_0x51a8('0x4c')](_0x3d6cd7));}}else{loggerPredictive[_0x51a8('0x82')](_0x51a8('0x85'),JSON[_0x51a8('0x4c')](_0x3d6cd7));}}else{loggerPredictive[_0x51a8('0x82')](_0x51a8('0x86'),JSON[_0x51a8('0x4c')](_0x3d6cd7));}}else{loggerPredictive['info'](_0x51a8('0x87'),JSON[_0x51a8('0x4c')](_0x3d6cd7));}return![];}function mergeDataErlangB(_0x823d14){return function(_0xd3c4){loggerPredictive['info'](_0x51a8('0x88'),JSON['stringify'](_0xd3c4));_[_0x51a8('0x89')](_0x823d14,_0xd3c4);};}function getDiff(_0x252c20){var _0x5c66e8=moment()['milliseconds'](0x0);var _0x2628d4=moment(_0x252c20)[_0x51a8('0x4d')](0x0);return _0x5c66e8[_0x51a8('0x4e')](_0x2628d4,_0x51a8('0x8a'));}function ifInterval(_0x269a01,_0x52f60f){if(_[_0x51a8('0x42')](_0x52f60f)){return![];}if(getDiff(_0x52f60f)<_0x269a01*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0xd1ddd5){if(isNotNull(_0xd1ddd5)){if(!_[_0x51a8('0x42')](_0xd1ddd5[_0x51a8('0x8b')])){_0xd1ddd5[_0x51a8('0x8b')]=undefined;loggerPredictive['info'](_0x51a8('0x8c'),_0x51a8('0x8b'),_0xd1ddd5[_0x51a8('0x46')]);}if(!_[_0x51a8('0x42')](_0xd1ddd5[_0x51a8('0x2b')])){_0xd1ddd5[_0x51a8('0x2b')]=undefined;loggerPredictive['info']('[freeVariablesPredictive]','startPredictive',_0xd1ddd5['name']);}if(!_[_0x51a8('0x42')](_0xd1ddd5[_0x51a8('0x8d')])){clearInterval(_0xd1ddd5['handlePredictive']);_0xd1ddd5[_0x51a8('0x8d')]=undefined;loggerPredictive['info'](_0x51a8('0x8c'),'handlePredictive',_0xd1ddd5[_0x51a8('0x46')]);}}}function erlangb(_0x472fdb,_0x53ed73){if(_0x53ed73===0x0){return 0x0;}var _0x4af9ab=0x1;for(var _0x5eb540=0x1;_0x5eb540<=_0x53ed73;_0x5eb540+=0x1){_0x4af9ab=0x1+_0x4af9ab*_0x5eb540/_0x472fdb;}return 0x1/_0x4af9ab;}function isVoiceQueueOutbound(_0x44d67a){return _0x44d67a===_0x51a8('0x50');}function isNotPreview(_0x283c8f){return _0x283c8f!==_0x51a8('0x20');}function isCampaignIvr(_0x149047){return _0x149047===_0x51a8('0x7d');}function getCallerId(_0x3fd347,_0x259153,_0x494e11){if(!_[_0x51a8('0x42')](_0x494e11)&&_0x51a8('0x8e')===typeof _0x494e11&&!_['isEmpty'](_0x494e11)){if(!_[_0x51a8('0x42')](_0x259153)&&_0x51a8('0x8e')===typeof _0x259153&&!_[_0x51a8('0x49')](_0x259153)){return util[_0x51a8('0x7b')](_0x51a8('0x8f'),_0x259153,_0x494e11);}return util[_0x51a8('0x7b')]('\x22%s\x22\x20<%s>',_0x494e11,_0x494e11);}if(!_['isUndefined'](_0x3fd347)&&_0x51a8('0x8e')===typeof _0x3fd347&&!_['isEmpty'](_0x3fd347)){return _0x3fd347;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x50a6ad,_0x4ec2ee){return function(_0x483a5a){freeVariablesPredictive(_0x4ec2ee);emitVoiceQueueSummary(_0x4ec2ee);emitCampaignSummary(_0x4ec2ee);loggerSyncQueueSummary[_0x51a8('0x90')](_0x50a6ad,util['inspect'](_0x483a5a,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1477af,_0x4772cd){return function(_0x1e7135){loggerPredictive[_0x51a8('0x90')](_0x1477af,JSON[_0x51a8('0x4c')](_0x1e7135));freeVariablesPredictive(_0x4772cd);};}function loggerCatch(_0x2d8b9b){return function(_0x28c539){logger[_0x51a8('0x90')](_0x2d8b9b,util[_0x51a8('0x91')](_0x28c539,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3d558d){return _0x3d558d&&!_['isUndefined'](_0x3d558d)&&_0x3d558d[_0x51a8('0x92')]>0x0;}function decremetOriginate(_0x220886){if(!_[_0x51a8('0x42')](_0x220886)&&_0x220886!==null){if(_0x220886['hasOwnProperty']('originated')){if(_0x220886['originated']>0x0){_0x220886[_0x51a8('0x76')]-=0x1;}else{logger[_0x51a8('0x90')](_0x51a8('0x93'));}}}else{logger[_0x51a8('0x90')](_0x51a8('0x94'));}}function checkContactLowerLimitOriginate(_0x1462b4,_0x351c22,_0x418445){if(_0x351c22>_0x418445){for(var _0x2813eb=0x0;_0x2813eb<_0x351c22-_0x418445;_0x2813eb+=0x1){decremetOriginate(_0x1462b4);}}}function loggerGetContactDialer(_0x462555,_0x45aabc,_0x3ba418){return function(_0x934ea9){checkContactLowerLimitOriginate(_0x45aabc,_0x3ba418,0x0);logger['error'](_0x462555,util[_0x51a8('0x91')](_0x934ea9,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x8b9b1b){return function(_0x52077e){if(isNotNull(_0x52077e)&&isNotNull(_0x52077e[0x0])){if(_0x52077e[0x0][_0x51a8('0x95')]>0x0){_0x8b9b1b['message']='RESCHEDULED_CONTACTS';logger['info'](_0x51a8('0x96')+_0x8b9b1b[_0x51a8('0x46')],_0x52077e[0x0][_0x51a8('0x95')],_0x51a8('0x97'));}else{_0x8b9b1b[_0x51a8('0x43')]=_0x51a8('0x98');logger[_0x51a8('0x82')]('[getContactDialer2][Empty]'+_0x8b9b1b['name']);}}};}function notSendMessagesQueue(_0x51b004){if(_0x51b004[_0x51a8('0x99')]){freeVariablesPredictive(_0x51b004);if(_0x51b004[_0x51a8('0x76')]===0x0&&_0x51b004[_0x51a8('0x56')]===0x0&&_0x51b004[_0x51a8('0x5a')]===0x0&&(_0x51b004[_0x51a8('0x54')]||0x0)===0x0){_0x51b004[_0x51a8('0x99')]=![];_0x51b004['available']=0x0;_0x51b004[_0x51a8('0x43')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x51a8('0x90')](_0x51a8('0x9a'),_0x51b004[_0x51a8('0x46')],_0x51a8('0x9b'));}else{_0x51b004[_0x51a8('0x43')]=_0x51a8('0x9c');loggerSyncQueueSummary[_0x51a8('0x90')](_0x51a8('0x9a'),_0x51b004[_0x51a8('0x46')],_0x51a8('0x9d'));}emitVoiceQueueSummary(_0x51b004);}}function notSendMessagesCampaign(_0x2289d9){if(_0x2289d9['sendMessageOneNotActive']){if(_0x2289d9['originated']===0x0){_0x2289d9[_0x51a8('0x99')]=![];_0x2289d9[_0x51a8('0x43')]=_0x51a8('0x9e');loggerSyncQueueSummary[_0x51a8('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2289d9[_0x51a8('0x46')],'is\x20not\x20active');}else{_0x2289d9[_0x51a8('0x43')]=_0x51a8('0x9c');loggerSyncQueueSummary[_0x51a8('0x90')](_0x51a8('0x9f'),_0x2289d9[_0x51a8('0x46')],_0x51a8('0x9d'));}emitCampaignSummary(_0x2289d9);}}function createObjHistory(_0x19e12b,_0x3c623f,_0x379028,_0x53fc80,_0x15f2fc){_0x19e12b[_0x51a8('0x43')]=_0x379028;var _0x3e80db=new Action(_0x19e12b,_0x3c623f);var _0x353e90=new History(_0x3e80db);_0x353e90['state']=_0x53fc80;_0x353e90['statedesc']=_0x15f2fc;_0x353e90[_0x51a8('0xa0')]=_0x3e80db['starttime'];return _0x353e90;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0xeb5d67=this;setInterval(function(){_0xeb5d67['clearZombieChannels'](_0xeb5d67['uniqueId'],_0x51a8('0xa1'));_0xeb5d67[_0x51a8('0xa2')](_0xeb5d67[_0x51a8('0x27')],'[actions]');},0x32c8);};Dialer[_0x51a8('0x1c')][_0x51a8('0xa2')]=function(_0x43f6f0,_0x5f20f7){var _0x3ac9c8=this;for(var _0x2a0fc6 in _0x43f6f0){if(_0x43f6f0[_0x51a8('0xa3')](_0x2a0fc6)){this[_0x51a8('0x1f')][_0x51a8('0xa4')](function(){if(!_[_0x51a8('0xa5')](_0x43f6f0[_0x2a0fc6])){return ami[_0x51a8('0xa6')]({'action':_0x51a8('0xa7'),'channel':_0x43f6f0[_0x2a0fc6][_0x51a8('0xa8')]})['catch'](function(_0x1da2ea){if(_0x1da2ea[_0x51a8('0x43')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x43f6f0[_0x2a0fc6]&&_0x43f6f0[_0x2a0fc6][_0x51a8('0x58')]!==_0x51a8('0x7d')){_0x3ac9c8['updateOriginated'](_0x3ac9c8[_0x51a8('0x21')][_0x43f6f0[_0x2a0fc6][_0x51a8('0xa9')]]);logger[_0x51a8('0x90')](_0x51a8('0xaa'),_0x5f20f7,_0x2a0fc6,_0x43f6f0[_0x2a0fc6][_0x51a8('0xa9')]);delete _0x43f6f0[_0x2a0fc6];}if(_0x43f6f0[_0x2a0fc6]&&_0x43f6f0[_0x2a0fc6]['type']===_0x51a8('0x7d')){_0x3ac9c8[_0x51a8('0xab')](_0x3ac9c8[_0x51a8('0x22')][_0x43f6f0[_0x2a0fc6][_0x51a8('0xa9')]]);logger['error'](_0x51a8('0xac'),_0x5f20f7,_0x2a0fc6,_0x43f6f0[_0x2a0fc6][_0x51a8('0xa9')]);delete _0x43f6f0[_0x2a0fc6];}},0x2328);}});}});}}};Dialer[_0x51a8('0x1c')][_0x51a8('0xad')]=function(_0x6cd464){return BPromise[_0x51a8('0xae')]()[_0x51a8('0xaf')](cmHopper[_0x51a8('0xad')](_0x6cd464))['catch'](loggerCatch(_0x51a8('0xb0')));};Dialer[_0x51a8('0x1c')]['checkIsBlackList']=function(_0x723274){return BPromise[_0x51a8('0xae')]()['then'](cmHopperBlack[_0x51a8('0xb1')](_0x723274))['catch'](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x51a8('0x1c')][_0x51a8('0xb2')]=function(_0x41e0b9){return BPromise['resolve']()['then'](cmHopperBlack[_0x51a8('0xb2')](_0x41e0b9))['catch'](loggerCatch(_0x51a8('0xb3')));};Dialer[_0x51a8('0x1c')][_0x51a8('0xb4')]=function(_0x3b737b){return BPromise[_0x51a8('0xae')]()[_0x51a8('0xaf')](cmHopperHistory[_0x51a8('0xb5')](_0x3b737b))[_0x51a8('0xb6')](loggerCatch(_0x51a8('0xb7')));};Dialer[_0x51a8('0x1c')][_0x51a8('0xb8')]=function(_0x195fa3){return BPromise[_0x51a8('0xae')]()[_0x51a8('0xaf')](cmHopper[_0x51a8('0xb8')](_0x195fa3))['catch'](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x51a8('0x1c')]['getContactDialer']=function(_0x4ea753,_0x59c5ba,_0x3dd98c,_0x4cac59){return BPromise[_0x51a8('0xae')]()[_0x51a8('0xaf')](cmHopper['getContactDialer'](_0x4ea753,_0x59c5ba,_0x3dd98c,_0x4cac59))[_0x51a8('0xb6')](loggerCatch(_0x51a8('0xb9')));};Dialer['prototype'][_0x51a8('0xba')]=function(_0x37a542,_0x50c5cf,_0x5ce141){return BPromise[_0x51a8('0xae')]()[_0x51a8('0xaf')](cmHopper[_0x51a8('0xba')](_0x37a542,_0x50c5cf,_0x5ce141))[_0x51a8('0xb6')](loggerCatch(_0x51a8('0xb9')));};Dialer[_0x51a8('0x1c')]['getVoiceQueueRtPauses']=function(_0x13dab3){return BPromise[_0x51a8('0xae')]()[_0x51a8('0xaf')](voiceQueueRt['getVoiceQueueRtPauses'](_0x13dab3))[_0x51a8('0xb6')](loggerCatch(_0x51a8('0xbb')));};Dialer[_0x51a8('0x1c')]['moveContactManagedDialer']=function(_0x149fa4){return BPromise[_0x51a8('0xae')]()['then'](cmHopper[_0x51a8('0xbc')](_0x149fa4))['catch'](loggerCatch(_0x51a8('0xbd')));};Dialer[_0x51a8('0x1c')][_0x51a8('0xbe')]=function(_0x1ab629){return BPromise[_0x51a8('0xae')]()[_0x51a8('0xaf')](cmHopperHistory[_0x51a8('0xbe')](_0x1ab629))[_0x51a8('0xb6')](loggerCatch('[createHistory]\x20'));};Dialer[_0x51a8('0x1c')][_0x51a8('0xab')]=function(_0x2de6b5){if(!_[_0x51a8('0x42')](_0x2de6b5)&&_0x2de6b5!==null){if(_0x2de6b5[_0x51a8('0xa3')]('originated')){if(_0x2de6b5['originated']>0x0){_0x2de6b5[_0x51a8('0x76')]-=0x1;}else{logger[_0x51a8('0x90')](_0x51a8('0xbf'));}}}else{logger[_0x51a8('0x90')](_0x51a8('0xc0'));}};Dialer['prototype'][_0x51a8('0xc1')]=function(_0x4ac423,_0x292949){var _0x1a0f3f=this;return function(_0x4d03c7){_0x1a0f3f[_0x51a8('0xab')](_0x292949);logger['error'](_0x4ac423,util[_0x51a8('0x91')](_0x4d03c7,{'showHidden':![],'depth':null}));};};Dialer[_0x51a8('0x1c')][_0x51a8('0xc2')]=function(_0x29563a,_0x35b703,_0x5243fd){var _0x145243={'state':0x19,'statedesc':_0x51a8('0xc3')};this['updateOriginated'](_0x35b703);this[_0x51a8('0xc4')](_[_0x51a8('0x89')](_0x145243,_['pick'](_0x5243fd,['ContactId',_0x51a8('0xc5'),_0x51a8('0xc6'),_0x51a8('0xc7'),'CampaignId'])),_0x51a8('0xc8'),_0x51a8('0xc9'));logger[_0x51a8('0x90')](_0x29563a);};Dialer[_0x51a8('0x1c')][_0x51a8('0xca')]=function(_0x21f861){return _0x21f861===_0x51a8('0xcb');};Dialer['prototype'][_0x51a8('0xcc')]=function(_0xa5074c){return!_[_0x51a8('0x42')](_0xa5074c)&&_0xa5074c&&!_[_0x51a8('0x42')](_0xa5074c['name'])&&!_['isUndefined'](_0xa5074c[_0x51a8('0x78')])&&_0xa5074c[_0x51a8('0x78')]&&(this['trunks'][util['format']('SIP/%s',_0xa5074c[_0x51a8('0x46')])]['status']==='reachable'||this['trunks'][util[_0x51a8('0x7b')]('SIP/%s',_0xa5074c[_0x51a8('0x46')])][_0x51a8('0xa7')]==='unmonitored');};Dialer['prototype'][_0x51a8('0xc4')]=function(_0x5ab6b2,_0x1f1171,_0x1ec771){this['createHistory'](_0x5ab6b2)[_0x51a8('0xb6')](loggerCatch(_0x1f1171));this[_0x51a8('0xbc')](_0x5ab6b2)['catch'](loggerCatch(_0x1ec771));};Dialer[_0x51a8('0x1c')][_0x51a8('0x3c')]=function(_0x223bd7){var _0x5d2e4f=this[_0x51a8('0x29')][_0x223bd7[_0x51a8('0xcd')]];var _0x19a773;if(!_['isNil'](_0x223bd7)&&!_['isNil'](_0x223bd7[_0x51a8('0xce')])&&!_[_0x51a8('0xa5')](_0x223bd7[_0x51a8('0xce')][_0x51a8('0xcf')])&&_0x223bd7[_0x51a8('0xd0')]===_0x51a8('0xd1')&&_0x5d2e4f){if(_0x5d2e4f[_0x51a8('0x58')]!==_0x51a8('0x7d')&&this[_0x51a8('0x21')][_0x5d2e4f[_0x51a8('0xa9')]][_0x51a8('0xd2')]&&_0x223bd7[_0x51a8('0xd3')]===_0x51a8('0xd4')){delete this['uniqueId'][_0x223bd7['uniqueid']];this[_0x51a8('0xab')](this[_0x51a8('0x21')][_0x5d2e4f[_0x51a8('0xa9')]]);this[_0x51a8('0x21')][_0x5d2e4f[_0x51a8('0xa9')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x5d2e4f[_0x51a8('0xa9')]][_0x51a8('0x62')]+=0x1;_0x19a773=new Hangup(_0x5d2e4f,_0x223bd7);_0x19a773['state']=0x12;_0x19a773[_0x51a8('0xd5')]=_0x51a8('0xd6');_0x19a773[_0x51a8('0xd7')]=_0x51a8('0xd8');this[_0x51a8('0xc4')](_0x19a773,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x5d2e4f[_0x51a8('0x58')]!=='ivr'&&this[_0x51a8('0x21')][_0x5d2e4f['queue']][_0x51a8('0xd2')]&&_0x223bd7[_0x51a8('0xd3')]==='MACHINE'){delete this[_0x51a8('0x29')][_0x223bd7[_0x51a8('0xcd')]];this[_0x51a8('0xab')](this[_0x51a8('0x21')][_0x5d2e4f['queue']]);this['voiceQueues'][_0x5d2e4f[_0x51a8('0xa9')]][_0x51a8('0xd9')]+=0x1;this[_0x51a8('0x21')][_0x5d2e4f[_0x51a8('0xa9')]]['outboundAnswerAgiCallsDay']+=0x1;_0x19a773=new Hangup(_0x5d2e4f,_0x223bd7);_0x19a773[_0x51a8('0xda')]=0x13;_0x19a773['statedesc']=_0x51a8('0xdb');_0x19a773['membername']=_0x51a8('0xd8');_0x19a773[_0x51a8('0xdc')]=!![];this[_0x51a8('0xc4')](_0x19a773,_0x51a8('0xdd'),'[syncMachine]');}if(_0x5d2e4f[_0x51a8('0x58')]==='ivr'&&this[_0x51a8('0x22')][_0x5d2e4f[_0x51a8('0xa9')]][_0x51a8('0xd2')]&&_0x223bd7['value']===_0x51a8('0xd4')){delete this[_0x51a8('0x29')][_0x223bd7[_0x51a8('0xcd')]];this['updateOriginated'](this['campaigns'][_0x5d2e4f[_0x51a8('0xa9')]]);_0x19a773=new Hangup(_0x5d2e4f,_0x223bd7);_0x19a773[_0x51a8('0xda')]=0x12;_0x19a773[_0x51a8('0xd5')]=_0x51a8('0xd6');_0x19a773['membername']='AMD';this[_0x51a8('0xc4')](_0x19a773,'[syncHangupInAMDIvr][createHistory]',_0x51a8('0xde'));}if(_0x5d2e4f[_0x51a8('0x58')]===_0x51a8('0x7d')&&this[_0x51a8('0x22')][_0x5d2e4f[_0x51a8('0xa9')]][_0x51a8('0xd2')]&&_0x223bd7[_0x51a8('0xd3')]==='MACHINE'){delete this['uniqueId'][_0x223bd7['uniqueid']];this[_0x51a8('0xab')](this[_0x51a8('0x22')][_0x5d2e4f[_0x51a8('0xa9')]]);_0x19a773=new Hangup(_0x5d2e4f,_0x223bd7);_0x19a773[_0x51a8('0xda')]=0x13;_0x19a773[_0x51a8('0xd5')]='Machine';_0x19a773[_0x51a8('0xd7')]='AMD';_0x19a773[_0x51a8('0xdc')]=!![];this[_0x51a8('0xc4')](_0x19a773,_0x51a8('0xdf'),_0x51a8('0xe0'));}}};Dialer['prototype']['syncHangup']=function(_0x35899e){var _0x542cc4=this[_0x51a8('0x29')][_0x35899e[_0x51a8('0xcd')]];var _0x292f74=this;var _0x3bced1;if(_0x542cc4&&_0x542cc4['type']===_0x51a8('0x7d')){delete this[_0x51a8('0x29')][_0x35899e[_0x51a8('0xcd')]];this[_0x51a8('0xab')](this[_0x51a8('0x22')][_0x542cc4[_0x51a8('0xa9')]]);this[_0x51a8('0x22')][_0x542cc4[_0x51a8('0xa9')]][_0x51a8('0xe1')]+=0x1;_0x3bced1=new Hangup(_0x542cc4,_0x35899e);this[_0x51a8('0xbe')](_0x3bced1)[_0x51a8('0xb6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x51a8('0xbc')](_0x3bced1)[_0x51a8('0xb6')](loggerCatch(_0x51a8('0xe2')));}if(_0x542cc4&&_0x542cc4[_0x51a8('0x58')]!==_0x51a8('0x7d')&&isNotNull(this['voiceQueues'][_0x542cc4[_0x51a8('0xa9')]][_0x51a8('0xe3')])){delete this[_0x51a8('0x29')][_0x35899e['uniqueid']];this[_0x51a8('0xab')](this[_0x51a8('0x21')][_0x542cc4[_0x51a8('0xa9')]]);this['voiceQueues'][_0x542cc4[_0x51a8('0xa9')]][_0x51a8('0xd9')]+=0x1;this[_0x51a8('0x21')][_0x542cc4[_0x51a8('0xa9')]]['outboundAnswerAgiCallsDay']+=0x1;_0x3bced1=new Hangup(_0x542cc4,_0x35899e);_0x3bced1['state']=0x10;_0x3bced1['statedesc']=_0x51a8('0xe4');_0x3bced1['membername']='AGI';this[_0x51a8('0xbe')](_0x3bced1)[_0x51a8('0xb6')](loggerCatch(_0x51a8('0xe5')));this[_0x51a8('0xbc')](_0x3bced1)[_0x51a8('0xb6')](loggerCatch(_0x51a8('0xe2')));}if(_0x542cc4&&_0x542cc4['type']!==_0x51a8('0x7d')&&!isNotNull(this[_0x51a8('0x21')][_0x542cc4['queue']]['dialQueueProject'])){delete this[_0x51a8('0x29')][_0x35899e[_0x51a8('0xcd')]];this['updateOriginated'](this[_0x51a8('0x21')][_0x542cc4[_0x51a8('0xa9')]]);this[_0x51a8('0x21')][_0x542cc4[_0x51a8('0xa9')]][_0x51a8('0x6c')]+=0x1;_0x3bced1=new Hangup(_0x542cc4,_0x35899e);_0x3bced1[_0x51a8('0xda')]=0xc;_0x3bced1[_0x51a8('0xd5')]=_0x35899e[_0x51a8('0xe6')];_0x3bced1[_0x51a8('0xd7')]=_0x51a8('0xe7');this[_0x51a8('0xbe')](_0x3bced1)[_0x51a8('0xb6')](loggerCatch(_0x51a8('0xe5')));this[_0x51a8('0xbc')](_0x3bced1)[_0x51a8('0xb6')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x51a8('0x1c')][_0x51a8('0x34')]=function(_0x4ede29){var _0xbc8168=this[_0x51a8('0x29')][_0x4ede29['uniqueid']];var _0x2acb6f=this;if(this['voiceQueues'][_0x4ede29['queue']]){if(_0xbc8168&&_0xbc8168[_0x51a8('0x58')]!=='ivr'){delete this[_0x51a8('0x29')][_0x4ede29[_0x51a8('0xcd')]];this[_0x51a8('0x21')][_0x4ede29[_0x51a8('0xa9')]]['outboundAnswerCallsDay']+=0x1;var _0x47b8dd=new AgentComplete(_0xbc8168,_0x4ede29);if(_0x4ede29['reason']==='agent'){_0x47b8dd[_0x51a8('0xe8')]=this[_0x51a8('0x21')][_0x4ede29[_0x51a8('0xa9')]][_0x51a8('0xe9')]&&this[_0x51a8('0x21')][_0x4ede29[_0x51a8('0xa9')]][_0x51a8('0xea')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x51a8('0xbe')](_0x47b8dd)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x51a8('0xbc')](_0x47b8dd)[_0x51a8('0xb6')](loggerCatch(_0x51a8('0xeb')));}}};Dialer[_0x51a8('0x1c')][_0x51a8('0x2f')]=function(_0x3c76e4){if(this[_0x51a8('0x21')][_0x3c76e4[_0x51a8('0xa9')]]){if(this[_0x51a8('0x29')][_0x3c76e4['uniqueid']]&&this['uniqueId'][_0x3c76e4[_0x51a8('0xcd')]][_0x51a8('0x58')]!==_0x51a8('0x7d')){this[_0x51a8('0xab')](this[_0x51a8('0x21')][_0x3c76e4[_0x51a8('0xa9')]]);this[_0x51a8('0x29')][_0x3c76e4[_0x51a8('0xcd')]][_0x51a8('0xec')]=moment()[_0x51a8('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x27e0fe){this[_0x51a8('0xbe')](_0x27e0fe)[_0x51a8('0xb6')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x51a8('0xbc')](_0x27e0fe)[_0x51a8('0xb6')](loggerCatch(_0x51a8('0xed')));};Dialer[_0x51a8('0x1c')]['syncQueueCallerAbandon']=function(_0x3ea407){var _0x226c98=this['uniqueId'][_0x3ea407[_0x51a8('0xcd')]];var _0x538e86=this;if(this[_0x51a8('0x21')][_0x3ea407[_0x51a8('0xa9')]]){if(_0x226c98&&_0x226c98[_0x51a8('0x58')]!==_0x51a8('0x7d')){delete this['uniqueId'][_0x3ea407[_0x51a8('0xcd')]];this['updateOriginated'](this['voiceQueues'][_0x3ea407[_0x51a8('0xa9')]]);_0x226c98[_0x51a8('0xee')]=moment()[_0x51a8('0x7b')](_0x51a8('0xef'));var _0x396c7f=new QueueCallerAbandon(_0x226c98,_0x3ea407);if(getSeconds(_0x226c98[_0x51a8('0xee')],_0x226c98[_0x51a8('0xf0')])>=_0x226c98['dialQueueTimeout']){this[_0x51a8('0x21')][_0x3ea407[_0x51a8('0xa9')]][_0x51a8('0x70')]+=0x1;this[_0x51a8('0x21')][_0x3ea407['queue']][_0x51a8('0x66')]+=0x1;this[_0x51a8('0x21')][_0x3ea407[_0x51a8('0xa9')]][_0x51a8('0x72')]+=0x1;_0x396c7f['state']=0xa;_0x396c7f[_0x51a8('0xd5')]=_0x51a8('0xf1');_0x396c7f[_0x51a8('0xf2')]=_0x51a8('0xf3');_0x396c7f['agiafterat']=this[_0x51a8('0x21')][_0x3ea407[_0x51a8('0xa9')]][_0x51a8('0xe9')]?moment()[_0x51a8('0x7b')](_0x51a8('0xef')):undefined;this[_0x51a8('0xf4')](_0x396c7f);}else{this[_0x51a8('0x21')][_0x3ea407[_0x51a8('0xa9')]][_0x51a8('0x6f')]+=0x1;this[_0x51a8('0x21')][_0x3ea407['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x396c7f[_0x51a8('0xda')]=0xb;_0x396c7f['statedesc']=_0x51a8('0xf5');_0x396c7f[_0x51a8('0xf2')]=_0x51a8('0xf6');this[_0x51a8('0xf4')](_0x396c7f);}}}};Dialer[_0x51a8('0x1c')][_0x51a8('0x3a')]=function(_0xa6c131){if(this['actions'][_0xa6c131['uniqueid']]){this[_0x51a8('0x27')][_0xa6c131[_0x51a8('0xcd')]][_0x51a8('0xa8')]=_0xa6c131[_0x51a8('0xa8')];}if(this[_0x51a8('0x29')][_0xa6c131[_0x51a8('0xcd')]]){this[_0x51a8('0x29')][_0xa6c131[_0x51a8('0xcd')]][_0x51a8('0xa8')]=_0xa6c131[_0x51a8('0xa8')];}};Dialer[_0x51a8('0x1c')]['syncQueueMember']=function(_0x49b426){if(strategy[this[_0x51a8('0x21')][this[_0x51a8('0x27')][_0x49b426[_0x51a8('0xf7')]][_0x51a8('0xa9')]][_0x51a8('0x51')]]===_0x51a8('0x1b')){if(this['actions'][_0x49b426[_0x51a8('0xf7')]]&&_[_0x51a8('0xa5')](this['actions'][_0x49b426[_0x51a8('0xf7')]][_0x51a8('0xf8')])&&_0x49b426[_0x51a8('0xa7')]==='1'&&_0x49b426[_0x51a8('0xf9')]==='0'){if(this['agents'][_0x49b426[_0x51a8('0xfa')]]){if(!this[_0x51a8('0x23')][_0x49b426['stateinterface']]['locked']){this[_0x51a8('0x23')][_0x49b426[_0x51a8('0xfa')]][_0x51a8('0xf8')]=!![];this[_0x51a8('0x27')][_0x49b426[_0x51a8('0xf7')]][_0x51a8('0xf8')]=!![];this['actions'][_0x49b426[_0x51a8('0xf7')]]['stateinterface']=_0x49b426[_0x51a8('0xfa')];}}}}else if((strategy[this[_0x51a8('0x21')][this[_0x51a8('0x27')][_0x49b426['actionid']][_0x51a8('0xa9')]]['strategy']]||_0x51a8('0x1a'))===_0x51a8('0x1a')){if(this[_0x51a8('0x27')][_0x49b426['actionid']]){if(this[_0x51a8('0x23')][_0x49b426[_0x51a8('0xfa')]]){this[_0x51a8('0x27')][_0x49b426[_0x51a8('0xf7')]][_0x51a8('0xfa')]=_0x49b426[_0x51a8('0xfa')];if(_['isNil'](this['queueBooked'][this[_0x51a8('0x27')][_0x49b426[_0x51a8('0xf7')]][_0x51a8('0xa9')]])){this['queueBooked'][this[_0x51a8('0x27')][_0x49b426[_0x51a8('0xf7')]][_0x51a8('0xa9')]]=[];}this[_0x51a8('0xfb')][this['actions'][_0x49b426['actionid']][_0x51a8('0xa9')]]['push'](_[_0x51a8('0x89')](_[_0x51a8('0xfc')](this[_0x51a8('0x27')][_0x49b426[_0x51a8('0xf7')]],['idHopper',_0x51a8('0xfa')]),{'status':_0x49b426['status'],'paused':_0x49b426[_0x51a8('0xf9')]}));}}}};function unlockQueueStatus(_0x3c517f,_0x127ff5){setTimeout(function(){if(_['isUndefined'](_0x3c517f[_0x51a8('0xfd')])){loggerBooked[_0x51a8('0x90')](_0x51a8('0xfe'),_0x127ff5);}_0x3c517f[_0x51a8('0xfd')]=!![];loggerBooked[_0x51a8('0x82')](_0x51a8('0xff'),_0x127ff5,JSON['stringify'](_[_0x51a8('0xfc')](_0x3c517f,[_0x51a8('0x46'),_0x51a8('0xfd')])));},0x1f3);}Dialer['prototype'][_0x51a8('0x40')]=function(_0x160164){var _0x3b71c0=this;var _0x2b1bc8=_0x3b71c0[_0x51a8('0x21')][_0x3b71c0[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]]['queue']];if(strategy[this[_0x51a8('0x21')][this[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]][_0x51a8('0xa9')]][_0x51a8('0x51')]]===_0x51a8('0x1b')){if(this[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]]&&this[_0x51a8('0x27')][_0x160164['actionid']][_0x51a8('0xfa')]){this['preview']['run'](this[_0x51a8('0x27')][_0x160164['actionid']][_0x51a8('0x100')],this[_0x51a8('0x27')][_0x160164['actionid']]['stateinterface'])[_0x51a8('0xb6')](function(_0x4f3549){logger[_0x51a8('0x90')](_0x51a8('0x101'),util['inspect'](_0x4f3549,{'showHidden':![],'depth':null}));})[_0x51a8('0x1e')](function(){_0x3b71c0['updateOriginated'](_0x3b71c0[_0x51a8('0x21')][_0x3b71c0[_0x51a8('0x27')][_0x160164['actionid']][_0x51a8('0xa9')]]);_0x3b71c0[_0x51a8('0x23')][_0x3b71c0[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]][_0x51a8('0xfa')]]['locked']=![];delete _0x3b71c0['actions'][_0x160164[_0x51a8('0xf7')]];unlockQueueStatus(_0x2b1bc8);});}else{this[_0x51a8('0xab')](this['voiceQueues'][this[_0x51a8('0x27')][_0x160164['actionid']][_0x51a8('0xa9')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]]['ContactId'],'ListId':this['actions'][_0x160164[_0x51a8('0xf7')]]['ListId'],'VoiceQueueId':this[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]][_0x51a8('0xc7')]||undefined,'CampaignId':this['actions'][_0x160164[_0x51a8('0xf7')]][_0x51a8('0x102')]||undefined})['catch'](loggerCatch(_0x51a8('0x103')));delete this[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]];unlockQueueStatus(_0x2b1bc8);}}else if((strategy[this[_0x51a8('0x21')][this[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]]['queue']][_0x51a8('0x51')]]||_0x51a8('0x1a'))==='rrmemory'){var _0x135e8d;if(this[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]]&&!_[_0x51a8('0x49')](this[_0x51a8('0xfb')][this[_0x51a8('0x27')][_0x160164['actionid']][_0x51a8('0xa9')]])){if(this[_0x51a8('0x2d')][_0x3b71c0[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]]['queue']]){this[_0x51a8('0x2d')][_0x3b71c0[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]][_0x51a8('0xa9')]]=this[_0x51a8('0x2d')][this[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]][_0x51a8('0xa9')]]?this['queueBookedRR'][this[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]][_0x51a8('0xa9')]]:this[_0x51a8('0xfb')][this['actions'][_0x160164['actionid']]['queue']]?this['queueBooked'][this[_0x51a8('0x27')][_0x160164['actionid']][_0x51a8('0xa9')]][_0x51a8('0x104')]||0x0:0x0;}this[_0x51a8('0xfb')][this[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]][_0x51a8('0xa9')]][_0x51a8('0x104')]=this[_0x51a8('0x2d')][this[_0x51a8('0x27')][_0x160164[_0x51a8('0xf7')]][_0x51a8('0xa9')]];for(var _0x30dbd3=0x0;_0x30dbd3=0x0?!![]:![];})[_0x51a8('0xb6')](myreject(_0x3bb3e3)));}}else{_0x55b6a8[_0x51a8('0x11a')](ami[_0x51a8('0xa6')]({'action':_0x51a8('0x11b'),'command':util[_0x51a8('0x7b')](_0x51a8('0x120'),_0x4b3f63,!_[_0x51a8('0x42')](config[_0x51a8('0x118')][_0x29a1e0])?_0x29a1e0:'')})[_0x51a8('0xaf')](function(_0x5197e5){return _0x5197e5[_0x51a8('0x11d')][_0x51a8('0x11e')](_0x51a8('0x11f'))>=0x0?!![]:![];})[_0x51a8('0xb6')](myreject(_0x3bb3e3)));}BPromise[_0x51a8('0x121')](_0x55b6a8)['then'](function(_0x21a15f){var _0x27a9fc=_[_0x51a8('0x122')](_0x21a15f);if(_0x27a9fc){return _0x454b16(_0x27a9fc);}else{_0x2342be[_0x51a8('0x43')]=_0x20f1b1?'GLOBAL_INTERVAL_IS_OVERTIME':_0x51a8('0x123');return _0x3bb3e3(msgResponse('[ifTime][promiseAll]',_0x51a8('0x117'),_0x51a8('0x124')+_0x20f1b1+'\x20'+_0x2a1c16+_0x51a8('0x125')+util[_0x51a8('0x91')](_0x4b3f63,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x29a1e0));}})[_0x51a8('0xb6')](function(_0xc345f4){return _0x3bb3e3(msgResponse(_0x51a8('0x116'),_0x51a8('0x117'),JSON[_0x51a8('0x4c')](_0xc345f4)));});});};Dialer[_0x51a8('0x1c')]['checkDialMethod']=function(_0x51f159){var _0x4642a6=this;return function(){switch(_0x51f159[_0x51a8('0x5d')]){case _0x51a8('0x126'):freeVariablesPredictive(_0x51f159);_0x4642a6[_0x51a8('0x127')](_0x51f159,0x1);break;case _0x51a8('0x128'):freeVariablesPredictive(_0x51f159);_0x4642a6[_0x51a8('0x127')](_0x51f159,_0x51f159[_0x51a8('0x129')]);break;case _0x51a8('0x7'):_0x4642a6[_0x51a8('0x7')](_0x51f159);break;case _0x51a8('0x6'):freeVariablesPredictive(_0x51f159);_0x4642a6[_0x51a8('0x127')](_0x51f159,0x1);break;default:freeVariablesPredictive(_0x51f159);logger[_0x51a8('0x90')](_0x51a8('0x12a'),_0x51f159[_0x51a8('0x46')],_0x51a8('0x12b'));}};};Dialer[_0x51a8('0x1c')][_0x51a8('0x12c')]=function(_0x2d5590){var _0x8cffcb=this;return function(){_0x8cffcb[_0x51a8('0x12d')](_0x2d5590);};};Dialer[_0x51a8('0x1c')][_0x51a8('0x36')]=function(_0x42b73c){var _0x4a4a59=this;if(isNotPreview(_0x42b73c[_0x51a8('0x5d')])){if(isVoiceQueueOutbound(_0x42b73c[_0x51a8('0x58')])&&isActive(_0x42b73c[_0x51a8('0x5c')])){_0x42b73c[_0x51a8('0x99')]=!![];BPromise[_0x51a8('0xae')]()[_0x51a8('0xaf')](checkIsLoggedIn(_0x42b73c,_0x42b73c[_0x51a8('0x53')]))[_0x51a8('0xaf')](checkIsActive(_0x42b73c,_0x42b73c[_0x51a8('0x5c')]))[_0x51a8('0xaf')](checkInterval(_0x42b73c))[_0x51a8('0xaf')](_0x4a4a59[_0x51a8('0x113')](_0x42b73c))[_0x51a8('0xaf')](_0x4a4a59['checkIfTime'](_0x42b73c[_0x51a8('0x12e')],_0x42b73c[_0x51a8('0x12f')],_0x42b73c[_0x51a8('0x46')],_0x42b73c))[_0x51a8('0xaf')](_0x4a4a59[_0x51a8('0x130')](_0x42b73c['Interval'],_0x42b73c['dialTimezone'],_0x42b73c['name'],_0x42b73c))['then'](_0x4a4a59[_0x51a8('0x131')](_0x42b73c))['catch'](loggerCatchQueueSummary(_0x51a8('0x132'),_0x42b73c));}else{notSendMessagesQueue(_0x42b73c);}}else{freeVariablesPredictive(_0x42b73c);}};Dialer[_0x51a8('0x1c')]['syncCampaigns']=function(){var _0x51a382=this;var _0xc53741;for(var _0x5f01d1 in this[_0x51a8('0x22')]){if(this[_0x51a8('0x22')]['hasOwnProperty'](_0x5f01d1)){_0xc53741=this[_0x51a8('0x22')][_0x5f01d1];if(isCampaignIvr(_0xc53741[_0x51a8('0x58')])&&isActive(_0xc53741[_0x51a8('0x78')])){_0xc53741[_0x51a8('0x99')]=!![];BPromise[_0x51a8('0xae')]()[_0x51a8('0xaf')](checkIsActive(_0xc53741,_0xc53741['active']))[_0x51a8('0xaf')](checkInterval(_0xc53741))[_0x51a8('0xaf')](_0x51a382[_0x51a8('0x113')](_0xc53741))[_0x51a8('0xaf')](_0x51a382[_0x51a8('0x133')](_0xc53741[_0x51a8('0x12e')],_0xc53741['dialTimezone'],_0xc53741[_0x51a8('0x46')],_0xc53741))[_0x51a8('0xaf')](_0x51a382['checkIfTimeIntervals'](_0xc53741[_0x51a8('0x47')],_0xc53741[_0x51a8('0x12f')],_0xc53741[_0x51a8('0x46')],_0xc53741))[_0x51a8('0xaf')](_0x51a382[_0x51a8('0x12c')](_0xc53741))[_0x51a8('0xb6')](loggerCatchQueueSummary(_0x51a8('0x134'),_0xc53741));}else{notSendMessagesCampaign(_0xc53741);}}}};function getCallerIdRandom(_0x34afcb,_0x3b4b56){var _0x1f6205,_0x183678,_0x2aadd5;if(_0x3b4b56<=0x0){_0x3b4b56=0x1;}_0x1f6205=new RegExp('\x5cw{0,'+_0x3b4b56+'}$');_0x183678=Math[_0x51a8('0x135')](0xa,_0x3b4b56-0x1);_0x2aadd5=Math[_0x51a8('0x135')](0xa,_0x3b4b56)-0x1;return util[_0x51a8('0x7b')]('%s',_[_0x51a8('0x136')](_0x34afcb,_0x1f6205,_['random'](_0x183678,_0x2aadd5)));}function extractCalleridName(_0x20c51e){var _0x5c0732=_0x20c51e[_0x51a8('0x137')](/"(.*?)"/);return _0x5c0732?_0x5c0732[0x1]:_0x20c51e;}function extractCalleridNumber(_0x1a6be5){var _0x4edb62=_0x1a6be5[_0x51a8('0x137')](/<(.*?)>/);return _0x4edb62?_0x4edb62[0x1]:_0x1a6be5;}Dialer[_0x51a8('0x1c')]['actionOriginate']=function(_0x26ff21,_0x4fdad0){var _0x3c3ba4=this;var _0x31da6e=uuid['v4']();this[_0x51a8('0x27')][_0x31da6e]=new Action(_0x26ff21,_0x4fdad0,_0x31da6e);return new BPromise(function(_0x5aebc3,_0x4d4451){if(_[_0x51a8('0x42')](_0x26ff21)&&_0x51a8('0x138')!==typeof _0x26ff21){return _0x4d4451(msgResponse(_0x51a8('0x139'),_0x51a8('0x117'),_0x51a8('0x13a')));}if(_[_0x51a8('0x42')](_0x4fdad0[_0x51a8('0x13b')][_0x51a8('0x13c')])||_0x4fdad0['Contact'][_0x51a8('0x13c')]===null){return _0x4d4451(msgResponse(_0x51a8('0x139'),_0x51a8('0x117'),_0x51a8('0x13d')));}var _0x502a92={'XMD-CALLERID':_0x3c3ba4[_0x51a8('0x27')][_0x31da6e]['getCaller'](),'XMD-AGI':_0x26ff21[_0x51a8('0xe3')]?util[_0x51a8('0x7b')](_0x51a8('0x13e'),ipAgi,_0x26ff21['dialQueueProject']):_0x51a8('0x13f'),'XMD-AGIAFTER':_0x26ff21[_0x51a8('0xe9')]?util[_0x51a8('0x7b')]('\x22agi://%s/square,%s\x22',ipAgi,_0x26ff21['dialQueueProject2']):_0x51a8('0x13f'),'XMD-QUEUE':_0x26ff21[_0x51a8('0x58')]===_0x51a8('0x50')?util[_0x51a8('0x7b')]('\x22%s,%s%s,,,%s\x22',_0x26ff21[_0x51a8('0x46')],_0x26ff21[_0x51a8('0x140')]||'',_0x26ff21[_0x51a8('0xea')]?'c':'',_0x26ff21[_0x51a8('0x141')]||0x3):'NONE','XMD-CONTACTID':_0x4fdad0[_0x51a8('0x10c')],'XMD-CDRTYPE':_0x51a8('0x5'),'CALLERID(all)':_0x3c3ba4[_0x51a8('0x27')][_0x31da6e][_0x51a8('0x142')](),'XMD-AMD':_0x26ff21[_0x51a8('0xd2')]?_0x51a8('0x143'):_0x51a8('0x13f'),'XMD-DESTINATION':_0x51a8('0xd1')};if(_0x26ff21[_0x51a8('0xd2')]){_0x502a92[_0x51a8('0x144')]=_0x26ff21[_0x51a8('0x145')]||0x9c4;_0x502a92['XMD-AMDGREETING']=_0x26ff21[_0x51a8('0x146')]||0x5dc;_0x502a92[_0x51a8('0x147')]=_0x26ff21[_0x51a8('0x148')]||0x320;_0x502a92['XMD-AMDTOTALANALYSISTIME']=_0x26ff21[_0x51a8('0x149')]||0x1388;_0x502a92['XMD-AMDMINWORDLENGTH']=_0x26ff21[_0x51a8('0x14a')]||0x64;_0x502a92[_0x51a8('0x14b')]=_0x26ff21[_0x51a8('0x14c')]||0x32;_0x502a92['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x26ff21[_0x51a8('0x14d')]||0x3;_0x502a92[_0x51a8('0x14e')]=_0x26ff21[_0x51a8('0x14f')]||0x100;_0x502a92['XMD-AMDMAXIMUMWORDLENGTH']=_0x26ff21[_0x51a8('0x150')]||0x1388;}if(_0x26ff21[_0x51a8('0x58')]==='outbound'){_0x502a92[_0x51a8('0x151')]=_0x4fdad0['VoiceQueueId'];}else{_0x502a92[_0x51a8('0x152')]=_0x4fdad0[_0x51a8('0x102')];}for(var _0x1b773a in _0x4fdad0[_0x51a8('0x13b')]){if(_0x4fdad0[_0x51a8('0x13b')][_0x51a8('0xa3')](_0x1b773a)){if(isNotNull(_0x4fdad0['Contact'][_0x1b773a])&&_0x1b773a!=='id'&&_0x1b773a!==_0x51a8('0x153')&&_0x1b773a!==_0x51a8('0x154')&&_0x1b773a!==_0x51a8('0x155')){_0x502a92[util[_0x51a8('0x7b')]('%s%s',_0x51a8('0x156'),_['toUpper'](_0x1b773a))]=_0x4fdad0['Contact'][_0x1b773a];}}}var _0x5daff2=_0x3c3ba4[_0x51a8('0xcc')](_0x26ff21['Trunk'])?getCallerId(_0x26ff21[_0x51a8('0x77')][_0x51a8('0x79')],_0x26ff21[_0x51a8('0x5e')],_0x26ff21[_0x51a8('0x157')]>0x0?getCallerIdRandom(_0x26ff21[_0x51a8('0x5f')],_0x26ff21[_0x51a8('0x157')]):_0x26ff21[_0x51a8('0x5f')]):getCallerId(_[_0x51a8('0xa5')](_0x26ff21[_0x51a8('0x158')])?_0x26ff21['Trunk']['callerid']:_0x26ff21[_0x51a8('0x158')][_0x51a8('0x79')],_0x26ff21[_0x51a8('0x5e')],_0x26ff21[_0x51a8('0x157')]>0x0?getCallerIdRandom(_0x26ff21[_0x51a8('0x5f')],_0x26ff21[_0x51a8('0x157')]):_0x26ff21[_0x51a8('0x5f')]);if(_0x5daff2){_0x502a92[_0x51a8('0x159')]=_0x3c3ba4[_0x51a8('0x27')][_0x31da6e]['originatecalleridname']=extractCalleridName(_0x5daff2);_0x502a92[_0x51a8('0x15a')]=_0x3c3ba4[_0x51a8('0x27')][_0x31da6e][_0x51a8('0x15b')]=extractCalleridNumber(_0x5daff2);}return ami['Action']({'actionid':_0x31da6e,'action':_0x51a8('0x139'),'channel':_0x3c3ba4[_0x51a8('0xcc')](_0x26ff21['Trunk'])?util[_0x51a8('0x7b')](_0x51a8('0x15c'),_0x26ff21[_0x51a8('0x77')]['name'],isNotNull(_0x26ff21[_0x51a8('0x61')])?_0x26ff21[_0x51a8('0x61')][_0x51a8('0x15d')]()||'':'',_0x26ff21['dialCutDigit']>0x0?_0x4fdad0[_0x51a8('0x13b')]['phone'][_0x51a8('0x15e')](_0x26ff21[_0x51a8('0x15f')]):_0x4fdad0[_0x51a8('0x13b')][_0x51a8('0x13c')]):util[_0x51a8('0x7b')](_0x51a8('0x15c'),_['isNil'](_0x26ff21[_0x51a8('0x158')])?_0x26ff21['Trunk'][_0x51a8('0x46')]:_0x26ff21[_0x51a8('0x158')]['name'],isNotNull(_0x26ff21[_0x51a8('0x61')])?_0x26ff21[_0x51a8('0x61')]['trim']()||'':'',_0x26ff21[_0x51a8('0x15f')]>0x0?_0x4fdad0[_0x51a8('0x13b')][_0x51a8('0x13c')][_0x51a8('0x15e')](_0x26ff21[_0x51a8('0x15f')]):_0x4fdad0['Contact']['phone']),'callerid':_0x5daff2,'Exten':_0x51a8('0xd1'),'Context':_0x51a8('0x160'),'Priority':'1','variable':_0x502a92,'timeout':(_0x26ff21[_0x51a8('0x60')]||0x1e)*0x3e8,'async':!![],'channelid':_0x31da6e})[_0x51a8('0xaf')](function(_0x15208e){return _0x5aebc3(_0x15208e);})[_0x51a8('0xb6')](function(_0x518d03){_0x26ff21[_0x51a8('0x69')]+=0x1;var _0x49d398=new History(_0x3c3ba4[_0x51a8('0x27')][_0x31da6e]);logger['error'](util['format'](_0x51a8('0x161'),JSON[_0x51a8('0x4c')](_0x518d03)));_0x49d398[_0x51a8('0xda')]=0xe;_0x49d398[_0x51a8('0xd5')]=_0x51a8('0x162');_0x49d398[_0x51a8('0x163')]=moment()[_0x51a8('0x7b')](_0x51a8('0xef'));_0x49d398[_0x51a8('0xa0')]=_0x49d398[_0x51a8('0x163')];_0x3c3ba4[_0x51a8('0xbe')](_0x49d398)['catch'](loggerCatch(_0x51a8('0x164')));_0x3c3ba4['moveContactManagedDialer'](_0x49d398)[_0x51a8('0xb6')](loggerCatch(_0x51a8('0x164')))[_0x51a8('0x1e')](function(){delete _0x3c3ba4[_0x51a8('0x27')][_0x31da6e];return _0x4d4451(msgResponse('originate',_0x51a8('0x4b'),'originate\x20action\x20Error'));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x264087){var _0x30c558=this['actions'][_0x264087[_0x51a8('0xf7')]];var _0x3ec1d6=this;if(_0x30c558){delete this[_0x51a8('0x27')][_0x264087[_0x51a8('0xf7')]];_0x30c558['responsetime']=moment()['format'](_0x51a8('0xef'));var _0x1f41c3=_0x30c558[_0x51a8('0x58')]==='ivr'?this['campaigns'][_0x30c558[_0x51a8('0xa9')]]:this[_0x51a8('0x21')][_0x30c558[_0x51a8('0x165')]()];if(!this['isSuccess'](_0x264087['response'])){this[_0x51a8('0xab')](_0x1f41c3);return this['callProgressDetecting'](_0x30c558,_0x1f41c3,_0x264087)[_0x51a8('0xaf')](function(_0x4adfad){})[_0x51a8('0xb6')](loggerCatch(_0x51a8('0x166')));}else{this[_0x51a8('0x29')][_0x264087[_0x51a8('0xcd')]]=_0x30c558;}}};Dialer['prototype'][_0x51a8('0x167')]=function(_0xcb2223,_0x150d20,_0xdf73f5){var _0x33f392=new History(_0x150d20);if(_0x33f392[_0x51a8('0x168')]+_0x33f392[_0x51a8('0x169')]+_0x33f392[_0x51a8('0x16a')]>=_0xdf73f5['dialGlobalMaxRetry']-0x1){return!![];}switch(_0xcb2223){case 0x3:if(_0x33f392[_0x51a8('0x16a')]>=_0xdf73f5[_0x51a8('0x16b')]-0x1){return!![];}else{this[_0x51a8('0xb8')]({'active':![],'countnoanswerretry':_0x33f392['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x51a8('0x16c')](_0xdf73f5[_0x51a8('0x16d')],'minutes')[_0x51a8('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x33f392['ContactId'],'ListId':_0x33f392[_0x51a8('0xc5')],'VoiceQueueId':_0x33f392['VoiceQueueId']||undefined,'CampaignId':_0x33f392[_0x51a8('0x102')]||undefined})[_0x51a8('0xb6')](loggerCatch(_0x51a8('0x16e')));}break;case 0x5:if(_0x33f392[_0x51a8('0x168')]>=_0xdf73f5[_0x51a8('0x16f')]-0x1){return!![];}else{this[_0x51a8('0xb8')]({'active':![],'countbusyretry':_0x33f392[_0x51a8('0x168')]+=0x1,'scheduledat':moment()[_0x51a8('0x16c')](_0xdf73f5[_0x51a8('0x170')],_0x51a8('0x171'))[_0x51a8('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x33f392[_0x51a8('0x10c')],'ListId':_0x33f392['ListId'],'VoiceQueueId':_0x33f392[_0x51a8('0xc7')]||undefined,'CampaignId':_0x33f392[_0x51a8('0x102')]||undefined})[_0x51a8('0xb6')](loggerCatch(_0x51a8('0x172')));}break;case 0x8:if(_0x33f392[_0x51a8('0x169')]>=_0xdf73f5[_0x51a8('0x173')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x33f392[_0x51a8('0x169')]+=0x1,'scheduledat':moment()[_0x51a8('0x16c')](_0xdf73f5[_0x51a8('0x174')],_0x51a8('0x171'))[_0x51a8('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x33f392[_0x51a8('0x10c')],'ListId':_0x33f392[_0x51a8('0xc5')],'VoiceQueueId':_0x33f392[_0x51a8('0xc7')]||undefined,'CampaignId':_0x33f392[_0x51a8('0x102')]||undefined})[_0x51a8('0xb6')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer[_0x51a8('0x1c')][_0x51a8('0x175')]=function(_0x5c9aa2,_0x5510cf,_0x7f0d59){var _0x20cf96=this;var _0x5bcedd=new History(_0x5c9aa2);return new BPromise(function(_0x59479a,_0x5f4986){if(_[_0x51a8('0x42')](_0x5510cf)&&_0x51a8('0x138')!==typeof _0x5510cf){return _0x5f4986(msgResponse(_0x51a8('0x176'),_0x51a8('0x117'),'entity\x20is\x20undefine'));}if(_[_0x51a8('0x42')](_0x7f0d59)&&_0x51a8('0x138')!==typeof _0x7f0d59){return _0x5f4986(msgResponse(_0x51a8('0x176'),_0x51a8('0x117'),_0x51a8('0x177')));}switch(_0x7f0d59[_0x51a8('0x178')]){case'0':_0x5510cf['outboundNoSuchCallsDay']+=0x1;_0x5bcedd[_0x51a8('0xda')]=0x0;_0x5bcedd[_0x51a8('0xd5')]='NoSuchNumber';_0x20cf96['createHistory'](_0x5bcedd)[_0x51a8('0xb6')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x20cf96['checkRetriveMax'](0x0,_0x5c9aa2,_0x5510cf)){if(_0x5bcedd['countbusyretry']+_0x5bcedd['countcongestionretry']+_0x5bcedd[_0x51a8('0x16a')]>=_0x5510cf[_0x51a8('0x179')]){_0x20cf96[_0x51a8('0x17a')](_0x5bcedd,_0x59479a,_0x5f4986,_0x51a8('0x17b'));}else{_0x20cf96[_0x51a8('0x17c')](_0x5bcedd,_0x59479a,_0x5f4986,_0x51a8('0x17b'));}}break;case'3':_0x5510cf['outboundNoAnswerCallsDay']+=0x1;_0x5bcedd[_0x51a8('0xda')]=0x3;_0x5bcedd[_0x51a8('0xd5')]=_0x51a8('0x17d');_0x5bcedd[_0x51a8('0x16a')]+=0x1;_0x5bcedd[_0x51a8('0x17e')]+=0x1;_0x20cf96[_0x51a8('0xbe')](_0x5bcedd)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x20cf96[_0x51a8('0x167')](0x3,_0x5c9aa2,_0x5510cf)){if(_0x5bcedd[_0x51a8('0x16a')]>=_0x5510cf[_0x51a8('0x16b')]){_0x20cf96[_0x51a8('0x17c')](_0x5bcedd,_0x59479a,_0x5f4986,'reason\x203\x20ringing\x20no\x20answer');}else{_0x20cf96['stateGlobal'](_0x5bcedd,_0x59479a,_0x5f4986,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x5510cf[_0x51a8('0x64')]+=0x1;_0x5bcedd[_0x51a8('0xda')]=0x5;_0x5bcedd[_0x51a8('0xd5')]='Busy';_0x5bcedd['countbusyretry']+=0x1;_0x5bcedd[_0x51a8('0x17e')]+=0x1;_0x20cf96['createHistory'](_0x5bcedd)[_0x51a8('0xb6')](loggerCatch(_0x51a8('0x17f')));if(_0x20cf96[_0x51a8('0x167')](0x5,_0x5c9aa2,_0x5510cf)){if(_0x5bcedd[_0x51a8('0x168')]>=_0x5510cf[_0x51a8('0x16f')]){_0x20cf96['createStateFinal'](_0x5bcedd,_0x59479a,_0x5f4986,_0x51a8('0x180'));}else{_0x20cf96[_0x51a8('0x17a')](_0x5bcedd,_0x59479a,_0x5f4986,_0x51a8('0x180'));}}break;case'8':_0x5510cf[_0x51a8('0x181')]+=0x1;_0x5bcedd[_0x51a8('0xda')]=0x8;_0x5bcedd[_0x51a8('0xd5')]=_0x51a8('0x182');_0x5bcedd[_0x51a8('0x169')]+=0x1;_0x5bcedd[_0x51a8('0x17e')]+=0x1;_0x20cf96[_0x51a8('0xbe')](_0x5bcedd)[_0x51a8('0xb6')](loggerCatch(_0x51a8('0x183')));if(_0x20cf96[_0x51a8('0x167')](0x8,_0x5c9aa2,_0x5510cf)){if(_0x5bcedd[_0x51a8('0x169')]>=_0x5510cf['dialCongestionMaxRetry']){_0x20cf96[_0x51a8('0x17c')](_0x5bcedd,_0x59479a,_0x5f4986,'reason\x208\x20congestion');}else{_0x20cf96[_0x51a8('0x17a')](_0x5bcedd,_0x59479a,_0x5f4986,_0x51a8('0x184'));}}break;default:_0x5510cf[_0x51a8('0x6c')]+=0x1;_0x5bcedd['state']=0xc;_0x5bcedd[_0x51a8('0xd5')]=_0x7f0d59[_0x51a8('0x178')];_0x20cf96['createHistory'](_0x5bcedd)[_0x51a8('0xb6')](loggerCatch(_0x51a8('0x185')));if(_0x20cf96['checkRetriveMax'](_0x7f0d59[_0x51a8('0x178')],_0x5c9aa2,_0x5510cf)){if(_0x5bcedd[_0x51a8('0x168')]+_0x5bcedd[_0x51a8('0x169')]+_0x5bcedd['countnoanswerretry']>=_0x5510cf['dialGlobalMaxRetry']){_0x20cf96[_0x51a8('0x17a')](_0x5bcedd,_0x59479a,_0x5f4986,_0x7f0d59['reason']);}else{_0x20cf96['createStateFinal'](_0x5bcedd,_0x59479a,_0x5f4986,_0x7f0d59['reason']);}}}});};Dialer[_0x51a8('0x1c')][_0x51a8('0x17a')]=function(_0x24fec5,_0x59ee01,_0x2084c2,_0x36ac43){var _0x4897e2=new Final(_0x24fec5);_0x4897e2[_0x51a8('0xda')]=0xf;_0x4897e2['statedesc']=_0x51a8('0x186');this[_0x51a8('0x17c')](_0x4897e2,_0x59ee01,_0x2084c2,_0x36ac43);};Dialer[_0x51a8('0x1c')][_0x51a8('0x17c')]=function(_0x5df59f,_0x26e1a3,_0x1b7133,_0x41c9a2){this['moveContactManagedDialer'](_0x5df59f)[_0x51a8('0xaf')](function(_0x254505){return _0x26e1a3(msgResponse(_0x51a8('0x176'),_0x51a8('0xcb'),_0x41c9a2));})[_0x51a8('0xb6')](function(_0x137947){return _0x1b7133(msgResponse(_0x51a8('0x187'),_0x51a8('0x117'),'contact\x20not\x20moved'));});};Dialer[_0x51a8('0x1c')][_0x51a8('0x7')]=function(_0x163807){var _0x2259b8=this;var _0x25cbea=_0x163807[_0x51a8('0x188')]/0x64;var _0x1bb346=_0x163807['outboundDropCallsDayTimeout']/(_0x163807[_0x51a8('0x66')]+_0x163807[_0x51a8('0xd9')]);var _0x566c0a=_0x163807[_0x51a8('0x53')]-_0x163807['predictiveIntervalPauses']-_0x163807[_0x51a8('0x5a')]-_0x163807['originated']-_0x163807['talking'];var _0x3969ec=(_0x163807[_0x51a8('0x53')]-_0x163807['predictiveIntervalPauses'])*_0x163807[_0x51a8('0x74')];var _0x396c09=Math['floor'](_0x163807['erlangCalls']*_0x163807[_0x51a8('0x189')]*_0x163807['predictiveIntervalHitRate']*_0x163807[_0x51a8('0x18a')]);if(_[_0x51a8('0x42')](_0x163807[_0x51a8('0x8b')])){loggerPredictive[_0x51a8('0x82')]('[startMethodPredictive][StartProgressive][First]');if(!_[_0x51a8('0x42')](_0x163807['startPredictive'])){_0x163807['startPredictive']=undefined;loggerPredictive[_0x51a8('0x90')](_0x51a8('0x18b'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x51a8('0x42')](_0x163807[_0x51a8('0x8d')])){loggerPredictive[_0x51a8('0x90')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x163807[_0x51a8('0x8d')]);_0x163807[_0x51a8('0x8d')]=undefined;}_0x163807[_0x51a8('0x8b')]=moment()[_0x51a8('0x7b')](_0x51a8('0xef'));loggerPredictive['info'](_0x51a8('0x18c'),_0x163807[_0x51a8('0x8b')],_0x163807[_0x51a8('0x46')]);this[_0x51a8('0x127')](_0x163807,0x1);}else if(ifInterval(_0x163807['dialPredictiveInterval'],_0x163807[_0x51a8('0x8b')])){this['handlePower'](_0x163807,0x1);loggerPredictiveCalls[_0x51a8('0x82')](_0x51a8('0x18d'),_0x163807['startProgressive'],_0x163807[_0x51a8('0x46')]);_0x163807[_0x51a8('0x18e')]=0x0;_0x163807[_0x51a8('0x72')]=0x0;}else if(_0x25cbea<_0x1bb346&&_0x163807['dialPredictiveOptimization']===_0x51a8('0x18f')){freeVariablesPredictive(_0x163807);loggerPredictive['info'](_0x51a8('0x190'),_0x51a8('0x191'),_0x1bb346,_0x51a8('0x8b'),_0x163807['name']);}else if(_0x566c0a>_0x3969ec){freeVariablesPredictive(_0x163807);loggerPredictive[_0x51a8('0x82')](_0x51a8('0x192'),_0x51a8('0x193'),_0x566c0a,_0x51a8('0x194'),_0x3969ec);}else if(_0x396c09<_0x163807[_0x51a8('0x72')]&&_0x163807['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x163807);loggerPredictive[_0x51a8('0x82')](_0x51a8('0x195'),_0x51a8('0x196'),_0x396c09,_0x51a8('0x197'),_0x163807['predictiveIntervalErlangCallsDroppedCalls'],_0x51a8('0x8b'),_0x163807['name']);}else if(!ifInterval(_0x163807[_0x51a8('0x198')],_0x163807['startProgressive'])&&_[_0x51a8('0x42')](_0x163807['startPredictive'])&&!_[_0x51a8('0x42')](_0x163807[_0x51a8('0x8b')])){_0x163807[_0x51a8('0x2b')]=moment()['format'](_0x51a8('0xef'));loggerPredictive[_0x51a8('0x82')]('[startMethodPredictive][StartPredictive][First]',_0x163807[_0x51a8('0x2b')],_0x163807[_0x51a8('0x46')]);this[_0x51a8('0xb4')](_0x163807['dialPredictiveInterval'])[_0x51a8('0xaf')](this['getDataPredictive'](_0x163807))['then'](mergeDataErlangB(_0x163807))['then'](this['startMethodPredictive'](_0x163807))[_0x51a8('0xb6')](loggerCatchPredictive('[averageHandleTime][ErlangB]\x20',_0x163807));}else if(!ifInterval(_0x163807[_0x51a8('0x198')],_0x163807[_0x51a8('0x2b')])){_0x163807['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x163807[_0x51a8('0x2b')]=moment()['format'](_0x51a8('0xef'));loggerPredictive[_0x51a8('0x82')](_0x51a8('0x199'),_0x163807[_0x51a8('0x2b')],_0x163807['name']);clearInterval(_0x163807[_0x51a8('0x8d')]);_0x163807[_0x51a8('0x8d')]=undefined;this[_0x51a8('0xb4')](_0x163807[_0x51a8('0x198')])[_0x51a8('0xaf')](this['getDataPredictive'](_0x163807))[_0x51a8('0xaf')](mergeDataErlangB(_0x163807))[_0x51a8('0xaf')](this[_0x51a8('0x19a')](_0x163807))['catch'](loggerCatchPredictive('[averageHandleTime][ErlangB]\x20',_0x163807));}};Dialer[_0x51a8('0x1c')][_0x51a8('0x19b')]=function(_0x2e1294){var _0x32d155=this;return function(_0x1255e9){return new BPromise(function(_0x2f40f0,_0x2d91c3){_[_0x51a8('0x89')](_0x2e1294,_0x1255e9[0x0]);if(checkGetDataPredictive(_0x1255e9[0x0])){loggerPredictive[_0x51a8('0x82')](JSON[_0x51a8('0x4c')](_0x1255e9[0x0]));if(_0x2e1294['dialPredictiveOptimization']===_0x51a8('0x18f')){return _0x32d155[_0x51a8('0x19c')](_0x2e1294['id'])[_0x51a8('0xaf')](function(_0x1607cf){var _0xfeb8a0=_0x2e1294[_0x51a8('0x53')]-_0x1607cf[0x0]['outboundQueuePauses'];var _0x230432=_0x2e1294[_0x51a8('0x198')]*0x3c;var _0x332835=_0x1255e9[0x0][_0x51a8('0x81')]+_0x1255e9[0x0][_0x51a8('0x6e')];var _0x586145=(_0x1255e9[0x0]['predictiveIntervalAnsweredCalls']+_0x1255e9[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1255e9[0x0][_0x51a8('0x6f')])/_0x1255e9[0x0][_0x51a8('0x80')];var _0xc03684=_0x2e1294[_0x51a8('0x188')]/0x64;_0x2e1294[_0x51a8('0x75')]=_0x1607cf[0x0]['outboundQueuePauses']||0x0;_0x2e1294['predictiveIntervalHitRate']=_0x586145>0x0?_0x586145:0x1;return _0x32d155['abandonmentRate'](_0xfeb8a0,_0x230432,_0x332835,_0x586145,_0xc03684);})[_0x51a8('0xaf')](function(_0x1ee109){return _0x2f40f0(_0x1ee109);})[_0x51a8('0xb6')](function(_0x4fcb44){return _0x2d91c3(msgResponse(_0x51a8('0x19d'),_0x51a8('0x117'),JSON[_0x51a8('0x4c')](_0x4fcb44)));});}if(_0x2e1294[_0x51a8('0x19e')]==='agentBusyFactor'){return _0x32d155[_0x51a8('0x19c')](_0x2e1294['id'])[_0x51a8('0xaf')](function(_0x17a63f){var _0x2d0fca=_0x2e1294['loggedIn']-_0x17a63f[0x0]['outboundQueuePauses'];var _0x2fa57e=_0x2e1294[_0x51a8('0x198')]*0x3c;var _0x215c18=_0x1255e9[0x0][_0x51a8('0x81')]+_0x1255e9[0x0][_0x51a8('0x6e')];var _0x2ae995=(_0x1255e9[0x0][_0x51a8('0x6d')]+_0x1255e9[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1255e9[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1255e9[0x0][_0x51a8('0x80')];var _0x185e8b=_0x2e1294[_0x51a8('0x188')]/0x64;_0x2e1294[_0x51a8('0x75')]=_0x17a63f[0x0][_0x51a8('0x19f')]||0x0;_0x2e1294['predictiveIntervalHitRate']=_0x2ae995>0x0?_0x2ae995:0x1;return _0x32d155[_0x51a8('0x1a0')](_0x2d0fca,_0x2fa57e,_0x215c18,_0x2ae995,_0x185e8b);})[_0x51a8('0xaf')](function(_0x27d86e){return _0x2f40f0(_0x27d86e);})[_0x51a8('0xb6')](function(_0x3564c1){return _0x2d91c3(msgResponse('[CatchErlangB]',_0x51a8('0x117'),JSON[_0x51a8('0x4c')](_0x3564c1)));});}}else{return _0x2d91c3(msgResponse(_0x51a8('0x1a1'),_0x51a8('0x117'),_0x51a8('0x1a2')));}});};};Dialer[_0x51a8('0x1c')][_0x51a8('0x19a')]=function(_0x420d11){var _0x46c967=this;return function(){var _0x271af0=0x0;var _0x11c3a3=Math[_0x51a8('0x1a3')](_0x420d11[_0x51a8('0x1a4')]*0x3e8);if(_0x11c3a3>0x0){_0x11c3a3=_0x11c3a3<0x64?0x64:_0x11c3a3;loggerPredictive[_0x51a8('0x82')](_0x51a8('0x1a5'),_0x11c3a3);_0x420d11[_0x51a8('0x8d')]=setInterval(function(){_0x46c967[_0x51a8('0x8d')](_0x420d11);loggerPredictiveCalls[_0x51a8('0x82')]('[handlePredictive]',_0x271af0+=0x1);},_0x11c3a3);}else{loggerPredictive[_0x51a8('0x82')](_0x51a8('0x1a6'),_0x51a8('0x1a7'),_0x11c3a3);}};};Dialer[_0x51a8('0x1c')][_0x51a8('0x1a8')]=function(_0x366923,_0x2e5966){var _0x2ecf43=this;return function(_0x347ac9){if(_[_0x51a8('0x49')](_0x347ac9)){if(_['isNil'](_0x2e5966[_0x51a8('0xc6')])||!_0x2e5966['recallme']){if(_0x366923['dialMethod']===_0x51a8('0x6')){_0x366923[_0x51a8('0xfd')]=_['isUndefined'](_0x366923[_0x51a8('0xfd')])?!![]:_0x366923['queueStatusComplete'];var _0x91f1b6=uuid['v4']();_0x2ecf43[_0x51a8('0x27')][_0x91f1b6]=new Action(_0x366923,_0x2e5966,_0x91f1b6);loggerBooked[_0x51a8('0x82')]('[booked][checkContactBlack]',_0x91f1b6,_0x51a8('0x1a9'),JSON['stringify'](_0x366923[_0x51a8('0xfd')]),_0x51a8('0x1aa'),_0x366923[_0x51a8('0x46')]);if(_0x366923[_0x51a8('0xfd')]){_0x366923[_0x51a8('0xfd')]=![];_0x2ecf43['queueBooked'][_0x2ecf43[_0x51a8('0x27')][_0x91f1b6]['queue']]=[];ami[_0x51a8('0xa6')]({'actionid':_0x91f1b6,'action':_0x51a8('0x1ab'),'queue':_0x366923[_0x51a8('0x46')]})[_0x51a8('0xb6')](function(_0x1461a3){_0x2ecf43[_0x51a8('0xab')](_0x366923);_0x2ecf43[_0x51a8('0xb8')]({'active':![],'ContactId':_0x2ecf43[_0x51a8('0x27')][_0x91f1b6]['ContactId'],'ListId':_0x2ecf43[_0x51a8('0x27')][_0x91f1b6][_0x51a8('0xc5')],'VoiceQueueId':_0x2ecf43['actions'][_0x91f1b6]['VoiceQueueId']||undefined,'CampaignId':_0x2ecf43[_0x51a8('0x27')][_0x91f1b6][_0x51a8('0x102')]||undefined})[_0x51a8('0xb6')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2ecf43[_0x51a8('0x27')][_0x91f1b6];});}else{loggerBooked[_0x51a8('0x82')](_0x51a8('0x1ac'),JSON[_0x51a8('0x4c')](_0x366923['queueStatusComplete']),'Queue:\x20',_0x366923['name']);_0x2ecf43['updateOriginated'](_0x366923);_0x2ecf43[_0x51a8('0xb8')]({'active':![],'ContactId':_0x2ecf43['actions'][_0x91f1b6][_0x51a8('0x10c')],'ListId':_0x2ecf43[_0x51a8('0x27')][_0x91f1b6][_0x51a8('0xc5')],'VoiceQueueId':_0x2ecf43[_0x51a8('0x27')][_0x91f1b6][_0x51a8('0xc7')]||undefined,'CampaignId':_0x2ecf43[_0x51a8('0x27')][_0x91f1b6][_0x51a8('0x102')]||undefined})[_0x51a8('0xb6')](loggerCatch(_0x51a8('0x1ad')));delete _0x2ecf43[_0x51a8('0x27')][_0x91f1b6];}}else{return _0x2ecf43['actionOriginate'](_0x366923,_0x2e5966);}}else{if(getDiff(_0x2e5966[_0x51a8('0x1ae')])<_0x366923[_0x51a8('0x1af')]*0x3c){_0x2ecf43[_0x51a8('0x20')]['run'](_0x2e5966['id'])[_0x51a8('0x1e')](function(){_0x2ecf43[_0x51a8('0xab')](_0x366923);});}else{_0x366923[_0x51a8('0x6a')]+=0x1;_0x2ecf43[_0x51a8('0xab')](_0x366923);if(_0x366923['dialRecallInQueue']){_0x2ecf43[_0x51a8('0xb8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2e5966[_0x51a8('0x10c')],'ListId':_0x2e5966[_0x51a8('0xc5')],'VoiceQueueId':_0x2e5966['VoiceQueueId']||undefined,'CampaignId':_0x2e5966[_0x51a8('0x102')]||undefined})[_0x51a8('0xb6')](loggerCatch(_0x51a8('0x1b0')));_0x2ecf43[_0x51a8('0xbe')](createObjHistory(_0x366923,_0x2e5966,'RECALLINQUEUE',0x17,_0x51a8('0x1b1')))[_0x51a8('0xb6')](loggerCatch(_0x51a8('0x1b2')));}else{_0x2ecf43[_0x51a8('0xc4')](createObjHistory(_0x366923,_0x2e5966,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0x51a8('0x1b3'),_0x51a8('0x1b4'));}}}}else{_0x366923[_0x51a8('0x63')]+=0x1;_0x2ecf43[_0x51a8('0xc4')](createObjHistory(_0x366923,_0x2e5966,_0x51a8('0x1b5'),0xd,_0x51a8('0x1b6')),_0x51a8('0x1b7'),_0x51a8('0x1b8'));throw'inBlackList';}};};Dialer[_0x51a8('0x1c')][_0x51a8('0x12d')]=function(_0x1b98c8){var _0x2cf299=this;var _0x4c75c5=[];var _0x40e771=_0x1b98c8[_0x51a8('0x1b9')]-_0x1b98c8[_0x51a8('0x76')]-_0x1b98c8['temp'];emitCampaignSummary(_0x1b98c8);if(_0x40e771>0x0){if(_0x40e771>this[_0x51a8('0x25')]){_0x40e771=this[_0x51a8('0x25')];}_0x1b98c8[_0x51a8('0x1ba')]+=_0x40e771;this['getContactDialerIvr'](_0x1b98c8['id'],_0x40e771,_0x1b98c8[_0x51a8('0x1bb')])['then'](function(_0x38dd7f){_0x1b98c8[_0x51a8('0x1ba')]-=_0x40e771;_0x1b98c8[_0x51a8('0x1ba')]=_0x1b98c8[_0x51a8('0x1ba')]>0x0?_0x1b98c8[_0x51a8('0x1ba')]:0x0;if(!checkContactEmpty(_0x38dd7f)){_0x1b98c8[_0x51a8('0x43')]=_0x51a8('0x98');logger[_0x51a8('0x82')]('[getContactCampaign2][Empty]'+_0x1b98c8[_0x51a8('0x46')]);}else{_0x1b98c8[_0x51a8('0x76')]+=_0x38dd7f[_0x51a8('0x92')];_0x1b98c8[_0x51a8('0x43')]='RUNNING';for(var _0x14c8ee=0x0;_0x14c8ee<_0x38dd7f['length'];_0x14c8ee+=0x1){_0x1b98c8[_0x51a8('0x1bc')]+=0x1;if(_[_0x51a8('0xa5')](_0x38dd7f[_0x14c8ee])||_[_0x51a8('0xa5')](_0x38dd7f[_0x14c8ee]['Contact'])||_['isNil'](_0x38dd7f[_0x14c8ee]['Contact'][_0x51a8('0x13c')])){_0x2cf299[_0x51a8('0xc2')](_0x51a8('0x1bd'),_0x1b98c8,_0x38dd7f[_0x14c8ee]);}else{_0x2cf299['checkIsBlackListIvr'](_[_0x51a8('0xfc')](_0x38dd7f[_0x14c8ee],['CampaignId',_0x51a8('0x1be')]))[_0x51a8('0xaf')](_0x2cf299[_0x51a8('0x1a8')](_0x1b98c8,_0x38dd7f[_0x14c8ee]))['catch'](_0x2cf299[_0x51a8('0xc1')](_0x51a8('0x1bf'),_0x1b98c8));}}}})['catch'](loggerGetContactDialer(_0x51a8('0x1c0'),_0x1b98c8,_0x40e771));}};Dialer[_0x51a8('0x1c')][_0x51a8('0x127')]=function(_0x26b5a5,_0x37f00e){var _0x9be3cf=this;var _0x19f7f9=[];var _0x1877a5=_0x37f00e>=0x1?_0x37f00e:0x1;var _0x4cdbf4=[];if(_0x26b5a5['dialMethod']===_0x51a8('0x6')){_0x1877a5=0x1;}var _0x10bf5c=Math[_0x51a8('0x1a3')](_0x26b5a5[_0x51a8('0x52')]*_0x1877a5)-_0x26b5a5[_0x51a8('0x76')]-_0x26b5a5[_0x51a8('0x1ba')];emitVoiceQueueSummary(_0x26b5a5);if(_0x26b5a5[_0x51a8('0x1c1')]>0x0){var _0x84877d=_0x26b5a5['dialLimitQueue']-_0x26b5a5[_0x51a8('0x76')]-_0x26b5a5['talking']-_0x26b5a5[_0x51a8('0x1ba')]-_0x26b5a5[_0x51a8('0x54')];if(_0x10bf5c>_0x84877d){_0x10bf5c=_0x84877d;}}if(_0x10bf5c>0x0){if(_0x26b5a5[_0x51a8('0x5d')]==='booked'){_0x10bf5c=0x1;}if(_0x10bf5c>this[_0x51a8('0x25')]){_0x10bf5c=this[_0x51a8('0x25')];}_0x26b5a5['temp']+=_0x10bf5c;for(var _0x250ae8 in this['agents']){if(this[_0x51a8('0x23')][_0x51a8('0xa3')](_0x250ae8)){if(this[_0x51a8('0x23')][_0x250ae8][_0x51a8('0xda')]===_0x51a8('0x1c2')&&this[_0x51a8('0x23')][_0x250ae8][_0x51a8('0xa7')]===_0x51a8('0x1c3')){_0x19f7f9['push'](this['agents'][_0x250ae8]['id']);}}}this['getContactDialer'](_0x26b5a5['id'],_0x19f7f9,_0x10bf5c,_0x26b5a5[_0x51a8('0x1bb')])[_0x51a8('0xaf')](function(_0x2e41b8){_0x26b5a5[_0x51a8('0x1ba')]-=_0x10bf5c;_0x26b5a5[_0x51a8('0x1ba')]=_0x26b5a5['temp']>0x0?_0x26b5a5['temp']:0x0;if(!checkContactEmpty(_0x2e41b8)){_0x9be3cf[_0x51a8('0xad')](_0x26b5a5)[_0x51a8('0xaf')](sendMessageReschedule(_0x26b5a5))[_0x51a8('0xb6')](loggerCatch(_0x51a8('0xb0')));}else{_0x26b5a5['originated']+=_0x2e41b8[_0x51a8('0x92')];_0x26b5a5[_0x51a8('0x43')]=_0x26b5a5[_0x51a8('0x5d')]===_0x51a8('0x6')?_0x51a8('0x143'):_0x51a8('0x1c4');for(var _0x1ab133=0x0;_0x1ab133<_0x2e41b8[_0x51a8('0x92')];_0x1ab133+=0x1){if(_['isNil'](_0x2e41b8[_0x1ab133])||_[_0x51a8('0xa5')](_0x2e41b8[_0x1ab133][_0x51a8('0x13b')])||_[_0x51a8('0xa5')](_0x2e41b8[_0x1ab133][_0x51a8('0x13b')]['phone'])){_0x9be3cf[_0x51a8('0xc2')](_0x51a8('0x1bd'),_0x26b5a5,_0x2e41b8[_0x1ab133]);}else{_0x9be3cf[_0x51a8('0xb1')](_['pick'](_0x2e41b8[_0x1ab133],[_0x51a8('0xc7'),_0x51a8('0x1be')]))[_0x51a8('0xaf')](_0x9be3cf[_0x51a8('0x1a8')](_0x26b5a5,_0x2e41b8[_0x1ab133]))[_0x51a8('0xb6')](_0x9be3cf[_0x51a8('0xc1')](_0x51a8('0x1bd'),_0x26b5a5));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x26b5a5,_0x10bf5c));}};Dialer[_0x51a8('0x1c')]['handlePredictive']=function(_0x10957b){var _0x5c982a=this;if(_0x10957b[_0x51a8('0x1c1')]>0x0){var _0x37a462=_0x10957b[_0x51a8('0x1c1')]-_0x10957b[_0x51a8('0x76')]-_0x10957b[_0x51a8('0x56')];if(_0x37a462>0x0){this[_0x51a8('0x1c5')](_0x10957b);}else{loggerPredictiveCalls['info'](_0x51a8('0x1c6'));}}else{this[_0x51a8('0x1c5')](_0x10957b);}};Dialer[_0x51a8('0x1c')][_0x51a8('0x1c5')]=function(_0x23dcaa){var _0x52f905=this;var _0x2af168=[];_0x23dcaa[_0x51a8('0x76')]+=0x1;for(var _0x53de38 in this[_0x51a8('0x23')]){if(this[_0x51a8('0x23')]['hasOwnProperty'](_0x53de38)){if(this['agents'][_0x53de38][_0x51a8('0xda')]===_0x51a8('0x1c2')&&this[_0x51a8('0x23')][_0x53de38][_0x51a8('0xa7')]===_0x51a8('0x1c3')){_0x2af168[_0x51a8('0x11a')](this['agents'][_0x53de38]['id']);}}}this[_0x51a8('0x1c7')](_0x23dcaa['id'],_0x2af168,0x1,_0x23dcaa[_0x51a8('0x1bb')])['then'](function(_0x39208a){if(!checkContactEmpty(_0x39208a)){checkContactLowerLimitOriginate(_0x23dcaa,0x1,0x0);_0x52f905[_0x51a8('0xad')](_0x23dcaa)[_0x51a8('0xaf')](sendMessageReschedule(_0x23dcaa))[_0x51a8('0xb6')](loggerCatch('[countReScheduled]\x20'));}else{_0x23dcaa[_0x51a8('0x43')]=_0x51a8('0x1c4');if(_[_0x51a8('0xa5')](_0x39208a[0x0])||_[_0x51a8('0xa5')](_0x39208a[0x0][_0x51a8('0x13b')])||_[_0x51a8('0xa5')](_0x39208a[0x0][_0x51a8('0x13b')][_0x51a8('0x13c')])){_0x52f905[_0x51a8('0xc2')](_0x51a8('0x1bd'),_0x23dcaa,_0x39208a[0x0]);}else{_0x52f905[_0x51a8('0xb1')](_[_0x51a8('0xfc')](_0x39208a[0x0],[_0x51a8('0xc7'),_0x51a8('0x1be')]))[_0x51a8('0xaf')](_0x52f905['checkContactBlack'](_0x23dcaa,_0x39208a[0x0]))['catch'](_0x52f905[_0x51a8('0xc1')](_0x51a8('0x1c8'),_0x23dcaa));}}})['catch'](loggerGetContactDialer(_0x51a8('0x1c9'),_0x23dcaa,0x1));emitVoiceQueueSummary(_0x23dcaa);};Dialer[_0x51a8('0x1c')]['abandonmentRate']=function(_0x3e96a5,_0x2643bb,_0x29167d,_0x12d708,_0x49954a,_0x147e38){loggerPredictive[_0x51a8('0x82')](_0x51a8('0x1ca'),_0x51a8('0x1cb'),_0x3e96a5,'\x20interval\x20=\x20',_0x2643bb,_0x51a8('0x1cc'),_0x29167d,'\x20p\x20=\x20',_0x12d708,_0x51a8('0x1cd'),_0x49954a);return new BPromise(function(_0x5897ea,_0x4ff323){if(_0x3e96a5<=0x0||isNaN(_0x3e96a5)){return _0x4ff323(msgResponse(_0x51a8('0x1ca'),'Error',_0x51a8('0x1ce')+_0x3e96a5));}if(_0x29167d<=0x0||isNaN(_0x29167d)){return _0x4ff323(msgResponse(_0x51a8('0x1ca'),_0x51a8('0x4b'),_0x51a8('0x1cf')+_0x29167d));}if(_0x12d708<=0x0||isNaN(_0x12d708)){return _0x4ff323(msgResponse(_0x51a8('0x1ca'),_0x51a8('0x4b'),_0x51a8('0x1d0')+_0x12d708));}if(_0x2643bb<=0x0||isNaN(_0x2643bb)){return _0x4ff323(msgResponse(_0x51a8('0x1ca'),_0x51a8('0x4b'),_0x51a8('0x1d1')+_0x2643bb));}if(_0x49954a<=0x0||isNaN(_0x49954a)){return _0x4ff323(msgResponse(_0x51a8('0x1ca'),_0x51a8('0x4b'),_0x51a8('0x1d2')+_0x49954a));}_0x147e38=_0x147e38||0x0;var _0x5cb5dc=0x1/_0x29167d;var _0x555cda=0x0;var _0x2faef2=0x0;var _0x52a12b=0x0;var _0x4b5d20=0x0;for(var _0x3102ae=0x0;_0x52a12b<_0x49954a;_0x3102ae+=0x1){_0x2faef2=_0x3102ae/_0x2643bb;_0x555cda=(_0x12d708*_0x2faef2+_0x147e38)/_0x5cb5dc;_0x52a12b=erlangb(_0x555cda,_0x3e96a5);_0x4b5d20=_0x555cda/_0x3e96a5*(0x1-erlangb(_0x555cda,_0x3e96a5));}return _0x5897ea({'erlangCalls':_0x3102ae,'erlangCallToSecond':_0x2643bb/_0x3102ae,'erlangAbandonmentRate':_0x52a12b,'erlangBusyFactor':_0x4b5d20});});};Dialer[_0x51a8('0x1c')][_0x51a8('0x1a0')]=function(_0x1f1216,_0x140c93,_0x33128e,_0x1840e2,_0x167594,_0x9254b){loggerPredictive[_0x51a8('0x82')](_0x51a8('0x1d3'),_0x51a8('0x1cb'),_0x1f1216,_0x51a8('0x1d4'),_0x140c93,_0x51a8('0x1cc'),_0x33128e,_0x51a8('0x1d5'),_0x1840e2,_0x51a8('0x1d6'),_0x167594);return new BPromise(function(_0x2483d8,_0x18fb2a){if(_0x1f1216<=0x0||isNaN(_0x1f1216)){return _0x18fb2a(msgResponse(_0x51a8('0x1ca'),'Error',_0x51a8('0x1ce')+_0x1f1216));}if(_0x33128e<=0x0||isNaN(_0x33128e)){return _0x18fb2a(msgResponse(_0x51a8('0x1ca'),_0x51a8('0x4b'),_0x51a8('0x1cf')+_0x33128e));}if(_0x1840e2<=0x0||isNaN(_0x1840e2)){return _0x18fb2a(msgResponse(_0x51a8('0x1ca'),_0x51a8('0x4b'),'p\x20=\x20'+_0x1840e2));}if(_0x140c93<=0x0||isNaN(_0x140c93)){return _0x18fb2a(msgResponse(_0x51a8('0x1ca'),_0x51a8('0x4b'),_0x51a8('0x1d1')+_0x140c93));}if(_0x167594<=0x0||isNaN(_0x167594)){return _0x18fb2a(msgResponse(_0x51a8('0x1ca'),_0x51a8('0x4b'),_0x51a8('0x1d2')+_0x167594));}_0x9254b=_0x9254b||0x0;var _0x540d8d=0x1/_0x33128e;var _0x300f2c=0x0;var _0x2f680d=0x0;var _0x4928db=0x0;var _0x124030=0x0;for(var _0x224a95=0x0;_0x124030<_0x167594;_0x224a95+=0x1){_0x2f680d=_0x224a95/_0x140c93;_0x300f2c=(_0x1840e2*_0x2f680d+_0x9254b)/_0x540d8d;_0x4928db=erlangb(_0x300f2c,_0x1f1216);_0x124030=_0x300f2c/_0x1f1216*(0x1-erlangb(_0x300f2c,_0x1f1216));}return _0x2483d8({'erlangCalls':_0x224a95,'erlangCallToSecond':_0x140c93/_0x224a95,'erlangAbandonmentRate':_0x4928db,'erlangBusyFactor':_0x124030});});};module[_0x51a8('0x1d7')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index a054114..c060806 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 _0x514c=['holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime','ringtime'];(function(_0x37bd4a,_0x30f671){var _0x418ce8=function(_0x42a22a){while(--_0x42a22a){_0x37bd4a['push'](_0x37bd4a['shift']());}};_0x418ce8(++_0x30f671);}(_0x514c,0x1b2));var _0xc514=function(_0x321d29,_0x482cf9){_0x321d29=_0x321d29-0x0;var _0x2248ca=_0x514c[_0x321d29];return _0x2248ca;};'use strict';var util=require(_0xc514('0x0'));var _=require(_0xc514('0x1'));var moment=require('moment');function getSeconds(_0x337b05,_0x2b2a60){var _0x58c207=moment(_0x337b05)['milliseconds'](0x0);var _0x567c36=moment(_0x2b2a60)['milliseconds'](0x0);return _0x58c207[_0xc514('0x2')](_0x567c36,_0xc514('0x3'));}function QueueCallerAbandon(_0x2e80aa,_0x540d82){this[_0xc514('0x4')]=_0x2e80aa[_0xc514('0x4')];this['type']=_0x2e80aa[_0xc514('0x5')];this[_0xc514('0x6')]=_0x2e80aa['type']===_0xc514('0x7')?_0xc514('0x8'):_0x2e80aa['type'];this[_0xc514('0x9')]=_0x2e80aa[_0xc514('0x9')];this['countcongestionretry']=_0x2e80aa[_0xc514('0xa')];this[_0xc514('0xb')]=_0x2e80aa[_0xc514('0xb')];this['countglobal']=_0x2e80aa['countbusyretry']+_0x2e80aa[_0xc514('0xa')]+_0x2e80aa[_0xc514('0xb')];this[_0xc514('0xc')]=_0x540d82[_0xc514('0xc')];this[_0xc514('0xd')]=_0x2e80aa[_0xc514('0xe')];this['calleridnum']=_0x2e80aa[_0xc514('0xf')];this[_0xc514('0x10')]=_0x2e80aa['starttime'];this[_0xc514('0x11')]=_0x2e80aa[_0xc514('0x11')];this['droptime']=_0x2e80aa[_0xc514('0x12')];this[_0xc514('0x13')]=this[_0xc514('0x12')];this[_0xc514('0x14')]=getSeconds(_0x2e80aa[_0xc514('0x11')],_0x2e80aa[_0xc514('0x10')]);this[_0xc514('0x15')]=getSeconds(this[_0xc514('0x12')],_0x2e80aa[_0xc514('0x11')]);this[_0xc514('0x16')]=0x0;this[_0xc514('0x8')]=_0x540d82[_0xc514('0x8')];this['membername']=_0x540d82[_0xc514('0x17')];this[_0xc514('0x18')]=_0x540d82['reason'];this[_0xc514('0x19')]=_0x2e80aa[_0xc514('0x19')];this[_0xc514('0x1a')]=_0x2e80aa['callbackuniqueid'];this['callbackat']=_0x2e80aa['callbackat'];this[_0xc514('0x1b')]=_0x2e80aa['recallme'];this[_0xc514('0x1c')]=_0x2e80aa['ContactId'];this['ListId']=_0x2e80aa[_0xc514('0x1d')];this['UserId']=_0x2e80aa['UserId'];this['VoiceQueueId']=_0x2e80aa[_0xc514('0x1e')];this[_0xc514('0x1f')]=_0x2e80aa[_0xc514('0x1f')];this[_0xc514('0x20')]=_0x2e80aa['originatecalleridnum']||'';this[_0xc514('0x21')]=_0x2e80aa['originatecalleridname']||'';}module[_0xc514('0x22')]=QueueCallerAbandon; \ No newline at end of file +var _0x7d02=['talktime','connectedlinename','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','name','number','starttime','responsetime','droptime','ringtime','holdtime'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7d02,0xe0));var _0x27d0=function(_0x5318f3,_0x120e1e){_0x5318f3=_0x5318f3-0x0;var _0x298497=_0x7d02[_0x5318f3];return _0x298497;};'use strict';var util=require(_0x27d0('0x0'));var _=require(_0x27d0('0x1'));var moment=require(_0x27d0('0x2'));function getSeconds(_0x27ef24,_0x7a450f){var _0x55c272=moment(_0x27ef24)['milliseconds'](0x0);var _0xc8dd83=moment(_0x7a450f)[_0x27d0('0x3')](0x0);return _0x55c272[_0x27d0('0x4')](_0xc8dd83,_0x27d0('0x5'));}function QueueCallerAbandon(_0x3465bc,_0x4e9cf7){this[_0x27d0('0x6')]=_0x3465bc[_0x27d0('0x6')];this[_0x27d0('0x7')]=_0x3465bc[_0x27d0('0x7')];this['campaigntype']=_0x3465bc[_0x27d0('0x7')]===_0x27d0('0x8')?_0x27d0('0x9'):_0x3465bc[_0x27d0('0x7')];this[_0x27d0('0xa')]=_0x3465bc[_0x27d0('0xa')];this['countcongestionretry']=_0x3465bc[_0x27d0('0xb')];this[_0x27d0('0xc')]=_0x3465bc['countnoanswerretry'];this['countglobal']=_0x3465bc[_0x27d0('0xa')]+_0x3465bc[_0x27d0('0xb')]+_0x3465bc[_0x27d0('0xc')];this[_0x27d0('0xd')]=_0x4e9cf7[_0x27d0('0xd')];this['calleridname']=_0x3465bc[_0x27d0('0xe')];this['calleridnum']=_0x3465bc[_0x27d0('0xf')];this[_0x27d0('0x10')]=_0x3465bc[_0x27d0('0x10')];this[_0x27d0('0x11')]=_0x3465bc[_0x27d0('0x11')];this['droptime']=_0x3465bc['droptime'];this['endtime']=this[_0x27d0('0x12')];this[_0x27d0('0x13')]=getSeconds(_0x3465bc[_0x27d0('0x11')],_0x3465bc[_0x27d0('0x10')]);this[_0x27d0('0x14')]=getSeconds(this[_0x27d0('0x12')],_0x3465bc[_0x27d0('0x11')]);this[_0x27d0('0x15')]=0x0;this['queue']=_0x4e9cf7[_0x27d0('0x9')];this['membername']=_0x4e9cf7[_0x27d0('0x16')];this[_0x27d0('0x17')]=_0x4e9cf7[_0x27d0('0x17')];this['callback']=_0x3465bc[_0x27d0('0x18')];this[_0x27d0('0x19')]=_0x3465bc[_0x27d0('0x19')];this['callbackat']=_0x3465bc['callbackat'];this[_0x27d0('0x1a')]=_0x3465bc[_0x27d0('0x1a')];this[_0x27d0('0x1b')]=_0x3465bc['ContactId'];this[_0x27d0('0x1c')]=_0x3465bc[_0x27d0('0x1c')];this['UserId']=_0x3465bc[_0x27d0('0x1d')];this[_0x27d0('0x1e')]=_0x3465bc[_0x27d0('0x1e')];this[_0x27d0('0x1f')]=_0x3465bc['CampaignId'];this[_0x27d0('0x20')]=_0x3465bc['originatecalleridnum']||'';this['originatecalleridname']=_0x3465bc[_0x27d0('0x21')]||'';}module[_0x27d0('0x22')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 8e61093..f7cba62 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 _0x2bfb=['util','lodash','moment','%s/%s/%s','tech','fax','localstationid','headerinfo','path','AttachmentId','exports'];(function(_0x4b9b78,_0x1dc74a){var _0x330388=function(_0x49bcdc){while(--_0x49bcdc){_0x4b9b78['push'](_0x4b9b78['shift']());}};_0x330388(++_0x1dc74a);}(_0x2bfb,0x113));var _0xb2bf=function(_0x1fab26,_0x488634){_0x1fab26=_0x1fab26-0x0;var _0x13de27=_0x2bfb[_0x1fab26];return _0x13de27;};'use strict';var util=require(_0xb2bf('0x0'));var _=require(_0xb2bf('0x1'));var moment=require(_0xb2bf('0x2'));function Action(_0x5e5bd8,_0xc39aec,_0x7cc66b){this['uniqueid']=_0x5e5bd8||undefined;this['channel']=util['format'](_0xb2bf('0x3'),_0xc39aec[_0xb2bf('0x4')],_0xc39aec['Trunk']['name'],_0x7cc66b[_0xb2bf('0x5')]);this[_0xb2bf('0x6')]=_0xc39aec[_0xb2bf('0x6')];this[_0xb2bf('0x7')]=_0xc39aec['headerinfo'];this[_0xb2bf('0x8')]=_0x7cc66b['path'];this[_0xb2bf('0x9')]=_0x7cc66b[_0xb2bf('0x9')];}module[_0xb2bf('0xa')]=Action; \ No newline at end of file +var _0x5c38=['headerinfo','path','AttachmentId','lodash','moment','uniqueid','channel','format','%s/%s/%s','tech','Trunk','name','localstationid'];(function(_0x298853,_0x4c2000){var _0x4fa4ee=function(_0x18ee5f){while(--_0x18ee5f){_0x298853['push'](_0x298853['shift']());}};_0x4fa4ee(++_0x4c2000);}(_0x5c38,0x189));var _0x85c3=function(_0x267b55,_0xcff2dd){_0x267b55=_0x267b55-0x0;var _0x31b90f=_0x5c38[_0x267b55];return _0x31b90f;};'use strict';var util=require('util');var _=require(_0x85c3('0x0'));var moment=require(_0x85c3('0x1'));function Action(_0xcaaa41,_0x1d900c,_0x501c34){this[_0x85c3('0x2')]=_0xcaaa41||undefined;this[_0x85c3('0x3')]=util[_0x85c3('0x4')](_0x85c3('0x5'),_0x1d900c[_0x85c3('0x6')],_0x1d900c[_0x85c3('0x7')][_0x85c3('0x8')],_0x501c34['fax']);this[_0x85c3('0x9')]=_0x1d900c[_0x85c3('0x9')];this[_0x85c3('0xa')]=_0x1d900c['headerinfo'];this[_0x85c3('0xb')]=_0x501c34['path'];this[_0x85c3('0xc')]=_0x501c34[_0x85c3('0xc')];}module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 8472222..8121525 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 _0x4a6a=['originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','channelstate','channelstatedesc','syncNewExten','operation','filename','remotestationid','pagestransferred','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','catch','stringify','error','\x20receiveFax\x20','merge','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','update','then','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid','execute','format','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','status','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup'];(function(_0x382b6e,_0x24ee7d){var _0x59eb67=function(_0x39882b){while(--_0x39882b){_0x382b6e['push'](_0x382b6e['shift']());}};_0x59eb67(++_0x24ee7d);}(_0x4a6a,0x1ba));var _0xa4a6=function(_0x2ff20f,_0x552ca4){_0x2ff20f=_0x2ff20f-0x0;var _0x3cbe98=_0x4a6a[_0x2ff20f];return _0x3cbe98;};'use strict';var util=require(_0xa4a6('0x0'));var _=require(_0xa4a6('0x1'));var BPromise=require(_0xa4a6('0x2'));var uuid=require(_0xa4a6('0x3'));var moment=require(_0xa4a6('0x4'));var path=require(_0xa4a6('0x5'));var tiff2pdf=require(_0xa4a6('0x6'));var gs=require(_0xa4a6('0x7'));var logger=require(_0xa4a6('0x8'))(_0xa4a6('0x9'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0xa4a6('0xa'));var Action=require(_0xa4a6('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xa4a6('0xc'));var faxMessage=require(_0xa4a6('0xd'));function Fax(_0x3458cd){this[_0xa4a6('0xe')]={};this['faxAccounts']=_0x3458cd[_0xa4a6('0xf')];this[_0xa4a6('0x10')]=_0x3458cd[_0xa4a6('0x10')];this[_0xa4a6('0x11')]={};ami['on'](_0xa4a6('0x12'),this[_0xa4a6('0x13')][_0xa4a6('0x14')](this));ami['on'](_0xa4a6('0x15'),this['syncVarSet'][_0xa4a6('0x14')](this));ami['on']('newstate',this[_0xa4a6('0x16')]['bind'](this));ami['on'](_0xa4a6('0x17'),this['syncNewExten'][_0xa4a6('0x14')](this));ami['on'](_0xa4a6('0x18'),this[_0xa4a6('0x19')][_0xa4a6('0x14')](this));ami['on'](_0xa4a6('0x1a'),this[_0xa4a6('0x1b')][_0xa4a6('0x14')](this));ami['on'](_0xa4a6('0x1c'),this[_0xa4a6('0x1d')][_0xa4a6('0x14')](this));ami['on'](_0xa4a6('0x1e'),this[_0xa4a6('0x1f')][_0xa4a6('0x14')](this));}Fax[_0xa4a6('0x20')][_0xa4a6('0x13')]=function(_0x21b907){if(_0x21b907[_0xa4a6('0x21')]===_0xa4a6('0x22')){for(var _0x4fe608 in this[_0xa4a6('0xf')]){if(this[_0xa4a6('0xf')][_0xa4a6('0x23')](_0x4fe608)){if(_0x21b907[_0xa4a6('0x24')]===this[_0xa4a6('0xf')][_0x4fe608][_0xa4a6('0x25')]){this[_0xa4a6('0xe')][_0x21b907[_0xa4a6('0x26')]]={};this[_0xa4a6('0xe')][_0x21b907[_0xa4a6('0x26')]][_0xa4a6('0x27')]=_0x21b907[_0xa4a6('0x27')];this[_0xa4a6('0xe')][_0x21b907[_0xa4a6('0x26')]]['id']=this[_0xa4a6('0xf')][_0x4fe608]['id'];this[_0xa4a6('0xe')][_0x21b907[_0xa4a6('0x26')]]['name']=this[_0xa4a6('0xf')][_0x4fe608][_0xa4a6('0x28')];logger[_0xa4a6('0x29')](_0x21b907[_0xa4a6('0x26')],_0xa4a6('0x2a'));}}}}if(this['actions'][_0x21b907[_0xa4a6('0x26')]]){this[_0xa4a6('0xe')][_0x21b907['uniqueid']]={};this[_0xa4a6('0xe')][_0x21b907[_0xa4a6('0x26')]]['channel']=_0x21b907['channel'];logger['info'](_0x21b907['uniqueid'],_0xa4a6('0x2a'));}};Fax[_0xa4a6('0x20')][_0xa4a6('0x2b')]=function(_0x433436){if(this[_0xa4a6('0xe')][_0x433436[_0xa4a6('0x26')]]){for(var _0x4d209d in _0x433436[_0xa4a6('0x2c')]){if(_0x433436['variable']['hasOwnProperty'](_0x4d209d)){this['channels'][_0x433436[_0xa4a6('0x26')]][_0x4d209d]=_0x433436[_0xa4a6('0x2d')];}}}};Fax[_0xa4a6('0x20')][_0xa4a6('0x16')]=function(_0x1ddae9){if(this['channels'][_0x1ddae9[_0xa4a6('0x26')]]){this['channels'][_0x1ddae9[_0xa4a6('0x26')]][_0xa4a6('0x2e')]=_0x1ddae9[_0xa4a6('0x2e')];this['channels'][_0x1ddae9[_0xa4a6('0x26')]][_0xa4a6('0x2f')]=_0x1ddae9[_0xa4a6('0x2f')];}};Fax['prototype'][_0xa4a6('0x30')]=function(_0x3bd326){if(this[_0xa4a6('0xe')][_0x3bd326['uniqueid']]){for(var _0x4a2fea in _0x3bd326[_0xa4a6('0x2c')]){if(_0x3bd326[_0xa4a6('0x2c')]['hasOwnProperty'](_0x4a2fea)){this[_0xa4a6('0xe')][_0x3bd326[_0xa4a6('0x26')]][_0x4a2fea]=_0x3bd326['value'];}}}};Fax['prototype'][_0xa4a6('0x19')]=function(_0x308b67){if(this[_0xa4a6('0xe')][_0x308b67[_0xa4a6('0x26')]]){this[_0xa4a6('0xe')][_0x308b67[_0xa4a6('0x26')]][_0xa4a6('0x31')]=_0x308b67[_0xa4a6('0x31')];this[_0xa4a6('0xe')][_0x308b67[_0xa4a6('0x26')]]['status']=_0x308b67['status'];this[_0xa4a6('0xe')][_0x308b67[_0xa4a6('0x26')]]['localstationid']=_0x308b67[_0xa4a6('0x25')];this[_0xa4a6('0xe')][_0x308b67[_0xa4a6('0x26')]][_0xa4a6('0x32')]=_0x308b67['filename'];logger[_0xa4a6('0x29')](_0x308b67['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0xa4a6('0x20')][_0xa4a6('0x1b')]=function(_0x2f090d){var _0x49d9cc=this;if(this[_0xa4a6('0xe')][_0x2f090d['uniqueid']]){var _0x3d570c=this[_0xa4a6('0xe')][_0x2f090d[_0xa4a6('0x26')]]['id'];this['channels'][_0x2f090d[_0xa4a6('0x26')]][_0xa4a6('0x33')]=_0x2f090d['remotestationid'];this[_0xa4a6('0xe')][_0x2f090d[_0xa4a6('0x26')]]['pagestransferred']=_0x2f090d[_0xa4a6('0x34')];this[_0xa4a6('0xe')][_0x2f090d[_0xa4a6('0x26')]][_0xa4a6('0x25')]=_0x2f090d[_0xa4a6('0x25')];this[_0xa4a6('0xe')][_0x2f090d['uniqueid']]['resolution']=_0x2f090d['resolution'];this[_0xa4a6('0xe')][_0x2f090d[_0xa4a6('0x26')]]['transferrate']=_0x2f090d[_0xa4a6('0x35')];this[_0xa4a6('0xe')][_0x2f090d[_0xa4a6('0x26')]][_0xa4a6('0x32')]=_0x2f090d[_0xa4a6('0x32')];this[_0xa4a6('0xe')][_0x2f090d[_0xa4a6('0x26')]][_0xa4a6('0x36')]=_0x2f090d['calleridnum'];if(this['channels'][_0x2f090d[_0xa4a6('0x26')]][_0xa4a6('0x34')]>0x0){tiff2pdf(_0x2f090d[_0xa4a6('0x32')],_0xa4a6('0x37'),function(_0x48d330){logger[_0xa4a6('0x29')](_0x2f090d[_0xa4a6('0x26')],_0xa4a6('0x38'),_0x48d330[_0xa4a6('0x39')]);attachment[_0xa4a6('0x3a')]({'name':path['parse'](_0x2f090d['filename'])[_0xa4a6('0x28')],'basename':path[_0xa4a6('0x3b')](_0x2f090d[_0xa4a6('0x32')])[_0xa4a6('0x28')]+_0xa4a6('0x3c'),'type':'application/pdf'})['then'](function(_0xbf62){faxAccount['notify'](_0x3d570c,{'from':_0x2f090d[_0xa4a6('0x36')],'mapKey':_0xa4a6('0x9'),'body':path[_0xa4a6('0x3b')](_0x2f090d[_0xa4a6('0x32')])[_0xa4a6('0x28')]+'.pdf','AttachmentId':_0xbf62['id']})[_0xa4a6('0x3d')](function(_0x5bf593){logger['error'](_0x2f090d[_0xa4a6('0x26')],'\x20notify\x20',JSON[_0xa4a6('0x3e')](_0x5bf593));});})[_0xa4a6('0x3d')](function(_0xae8310){logger[_0xa4a6('0x3f')](_0x2f090d[_0xa4a6('0x26')],'\x20receiveFax\x20',JSON['stringify'](_0xae8310));});});}logger[_0xa4a6('0x29')](_0x2f090d[_0xa4a6('0x26')],_0xa4a6('0x40'));}};Fax[_0xa4a6('0x20')]['syncOriginateResponse']=function(_0x336f93){if(this[_0xa4a6('0x11')][_0x336f93[_0xa4a6('0x26')]]){_[_0xa4a6('0x41')](this[_0xa4a6('0xe')][_0x336f93[_0xa4a6('0x26')]],_['pick'](_0x336f93,[_0xa4a6('0x42'),_0xa4a6('0x43')]));}};function updateStatus(_0x20d92d){if(_0x20d92d[_0xa4a6('0x44')]){faxMessage['update'](_0x20d92d[_0xa4a6('0x44')],{'failMessage':_0xa4a6('0x45')})['then'](function(_0x1c246d){ut[_0xa4a6('0x46')](_0xa4a6('0x47'),_0x1c246d);})['catch'](function(_0x3e78d9){ut[_0xa4a6('0x46')](_0xa4a6('0x48'),_0x3e78d9);});}else{ut[_0xa4a6('0x46')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xa4a6('0x20')][_0xa4a6('0x49')]=function(_0x41899c,_0x378f35,_0x16634f){var _0x51c7fe=this;var _0x5e14e8={};if(_0x378f35){_0x5e14e8={'read':_0x378f35};}else{_0x5e14e8={'failMessage':_0x16634f};}if(this[_0xa4a6('0x11')][_0x41899c][_0xa4a6('0x44')]){faxMessage[_0xa4a6('0x4a')](this[_0xa4a6('0x11')][_0x41899c][_0xa4a6('0x44')],_0x5e14e8)[_0xa4a6('0x4b')](function(_0x39a959){ut[_0xa4a6('0x46')](_0xa4a6('0x4c'),_0x39a959);})[_0xa4a6('0x3d')](function(_0x352792){ut[_0xa4a6('0x46')](_0xa4a6('0x4d'),_0x352792);})[_0xa4a6('0x4e')](function(){delete _0x51c7fe['channels'][_0x41899c];delete _0x51c7fe['actions'][_0x41899c];});}else{ut[_0xa4a6('0x46')](_0xa4a6('0x4f'));delete this[_0xa4a6('0xe')][_0x41899c];delete this[_0xa4a6('0x11')][_0x41899c];}};Fax['prototype'][_0xa4a6('0x1d')]=function(_0x2555dd){var _0x7f7dad=this;if(this['channels'][_0x2555dd['uniqueid']]){if(this['actions'][_0x2555dd[_0xa4a6('0x26')]]){this[_0xa4a6('0xe')][_0x2555dd[_0xa4a6('0x26')]]['id']=this['actions'][_0x2555dd[_0xa4a6('0x26')]]['id'];this[_0xa4a6('0xe')][_0x2555dd[_0xa4a6('0x26')]][_0xa4a6('0x28')]=this[_0xa4a6('0x11')][_0x2555dd[_0xa4a6('0x26')]][_0xa4a6('0x28')];}logger['info'](_0x2555dd['uniqueid'],this['actions'][_0x2555dd[_0xa4a6('0x26')]]?_0xa4a6('0x50'):_0xa4a6('0x51'),JSON[_0xa4a6('0x3e')](this['channels'][_0x2555dd[_0xa4a6('0x26')]]));if(this['actions'][_0x2555dd[_0xa4a6('0x26')]]){if(this[_0xa4a6('0xe')][_0x2555dd[_0xa4a6('0x26')]]['faxpages']>0x0&&this['channels'][_0x2555dd[_0xa4a6('0x26')]][_0xa4a6('0x18')]===_0xa4a6('0x52')){this[_0xa4a6('0x49')](_0x2555dd[_0xa4a6('0x26')],!![]);}else{this[_0xa4a6('0x49')](_0x2555dd[_0xa4a6('0x26')],![],this[_0xa4a6('0xe')][_0x2555dd[_0xa4a6('0x26')]][_0xa4a6('0x53')]?_0xa4a6('0x54')+this[_0xa4a6('0xe')][_0x2555dd['uniqueid']][_0xa4a6('0x53')]:_0xa4a6('0x55'));}}}};Fax[_0xa4a6('0x20')][_0xa4a6('0x56')]=function(_0x3592d2){var _0x3fc085=this;return new BPromise(function(_0x75f888,_0x12deaa){_0x3fc085[_0xa4a6('0x57')](_0x3592d2,_0x3fc085[_0xa4a6('0xf')][_0x3592d2[_0xa4a6('0x58')]])['then'](function(_0x198f76){ut[_0xa4a6('0x46')]('[Fax][execOriginate][success]',_0x198f76);_0x75f888(ut[_0xa4a6('0x39')](_0xa4a6('0x59')));})['catch'](function(_0x424a05){ut[_0xa4a6('0x46')](_0xa4a6('0x5a'),_0x424a05);updateStatus(_0x3592d2);_0x12deaa(ut[_0xa4a6('0x39')](_0xa4a6('0x5b')));});});};Fax[_0xa4a6('0x20')]['checkAfterSend']=function(_0x50a3b7){var _0x239d47=this;return new BPromise(function(_0x2d9b85,_0x3b0233){var _0x5c84dc=_0x239d47[_0xa4a6('0x5c')](_0x239d47[_0xa4a6('0xf')][_0x50a3b7[_0xa4a6('0x58')]][_0xa4a6('0x5d')],_0x50a3b7);if(_0x5c84dc[_0xa4a6('0x5e')]){_0x2d9b85(ut[_0xa4a6('0x39')]('Trunk\x20Reachable'));}else{_0x3b0233(ut['message'](_0x5c84dc[_0xa4a6('0x39')]));}});};function originate(_0x16ff24,_0x5dcc6b,_0x448378){return new BPromise(function(_0x49a337,_0xdbddaa){if(_0x448378){var _0x23dff0=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xa4a6('0x3b')](_0x16ff24[_0xa4a6('0x5')])[_0xa4a6('0x28')],_0x16ff24[_0xa4a6('0x5')]);gs[_0xa4a6('0x5f')](_0x23dff0)[_0xa4a6('0x4b')](function(){_0x16ff24[_0xa4a6('0x5')]=util[_0xa4a6('0x60')](_0xa4a6('0x61'),path[_0xa4a6('0x3b')](_0x16ff24[_0xa4a6('0x5')])[_0xa4a6('0x62')],path[_0xa4a6('0x3b')](_0x16ff24['path'])[_0xa4a6('0x28')]);_0x5dcc6b['XMF-PATH']=_0x16ff24[_0xa4a6('0x5')];ut[_0xa4a6('0x46')](_0xa4a6('0x63'),'');ami[_0xa4a6('0x64')](ut[_0xa4a6('0x65')](_0x16ff24,_0x5dcc6b))['then'](function(_0xebb0a3){_0x49a337(_0xebb0a3);})[_0xa4a6('0x3d')](function(_0x37b01){_0xdbddaa(_0x37b01);});})['catch'](function(_0x556ddb){_0xdbddaa(_0x556ddb);});}else{ami['Action'](ut[_0xa4a6('0x65')](_0x16ff24,_0x5dcc6b))[_0xa4a6('0x4b')](function(_0x34a8ab){_0x49a337(_0x34a8ab);})[_0xa4a6('0x3d')](function(_0x5b7298){_0xdbddaa(_0x5b7298);});}});}Fax[_0xa4a6('0x20')][_0xa4a6('0x57')]=function(_0x111dd9,_0x186354){var _0x1b5e22=this;return new BPromise(function(_0x46f6e8,_0x5d80b6){var _0x3bbeff=uuid['v4']();var _0x4e4f28=ut[_0xa4a6('0x66')](_0x111dd9,_0x186354);_0x1b5e22[_0xa4a6('0x11')][_0x3bbeff]=new Action(_0x3bbeff,_0x186354,_0x111dd9);var _0x2f9ae0=_0x1b5e22[_0xa4a6('0x11')][_0x3bbeff];if(path['parse'](_0x111dd9[_0xa4a6('0x5')])[_0xa4a6('0x67')]===_0xa4a6('0x3c')){originate(_0x2f9ae0,_0x4e4f28,!![])[_0xa4a6('0x4b')](function(_0x3fdd87){_0x46f6e8(_0x3fdd87);})[_0xa4a6('0x3d')](function(_0x2553e0){_0x5d80b6(_0x2553e0);});}else{originate(_0x2f9ae0,_0x4e4f28,![])[_0xa4a6('0x4b')](function(_0x285faa){_0x46f6e8(_0x285faa);})[_0xa4a6('0x3d')](function(_0xdfa0ea){_0x5d80b6(_0xdfa0ea);});}});};Fax[_0xa4a6('0x20')][_0xa4a6('0x68')]=function(_0x34e5c6){return!_[_0xa4a6('0x69')](_0x34e5c6)&&!_[_0xa4a6('0x69')](_0x34e5c6[_0xa4a6('0x28')])&&!_[_0xa4a6('0x69')](_0x34e5c6[_0xa4a6('0x6a')])&&_0x34e5c6['active']&&!_[_0xa4a6('0x69')](this[_0xa4a6('0x10')][util[_0xa4a6('0x60')](_0xa4a6('0x6b'),_0x34e5c6[_0xa4a6('0x28')])])&&!_['isNil'](this[_0xa4a6('0x10')][util[_0xa4a6('0x60')](_0xa4a6('0x6b'),_0x34e5c6['name'])][_0xa4a6('0x6c')])&&(this[_0xa4a6('0x10')][util[_0xa4a6('0x60')](_0xa4a6('0x6b'),_0x34e5c6[_0xa4a6('0x28')])][_0xa4a6('0x6c')]==='reachable'||this['trunks'][util['format'](_0xa4a6('0x6b'),_0x34e5c6[_0xa4a6('0x28')])][_0xa4a6('0x6c')]==='unmonitored');};Fax[_0xa4a6('0x20')]['checkTrunk']=function(_0x166b3e,_0x1ff39d){if(!this[_0xa4a6('0x68')](_0x166b3e)){ut['logger'](_0xa4a6('0x6d'),_[_0xa4a6('0x69')](_0x166b3e)?'':_0x166b3e['name']+_0xa4a6('0x6e'));return{'isValid':![],'message':_0xa4a6('0x6f')};}if(_[_0xa4a6('0x69')](_0x1ff39d['fax'])){ut['logger'](_0xa4a6('0x70'),JSON[_0xa4a6('0x3e')](_0x1ff39d));return{'isValid':![],'message':_0xa4a6('0x71')};}if(_[_0xa4a6('0x69')](_0x1ff39d[_0xa4a6('0x5')])){ut['logger'](_0xa4a6('0x72'),JSON['stringify'](_0x1ff39d));return{'isValid':![],'message':_0xa4a6('0x73')};}return{'isValid':!![],'message':_0xa4a6('0x74')};};module[_0xa4a6('0x75')]=Fax; \ No newline at end of file +var _0x1b83=['Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','channels','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','parse','.pdf','then','notify','catch','error','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','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','format','%s/%s.tif','dir','XMF-PATH'];(function(_0x39ca61,_0x5dd2fe){var _0x4f04d5=function(_0x580441){while(--_0x580441){_0x39ca61['push'](_0x39ca61['shift']());}};_0x4f04d5(++_0x5dd2fe);}(_0x1b83,0xfb));var _0x31b8=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x1b83[_0x2b4411];return _0x8e41ef;};'use strict';var util=require(_0x31b8('0x0'));var _=require(_0x31b8('0x1'));var BPromise=require(_0x31b8('0x2'));var uuid=require(_0x31b8('0x3'));var moment=require(_0x31b8('0x4'));var path=require(_0x31b8('0x5'));var tiff2pdf=require(_0x31b8('0x6'));var gs=require(_0x31b8('0x7'));var logger=require(_0x31b8('0x8'))(_0x31b8('0x9'));var ami=require(_0x31b8('0xa'));var rpcDb=require(_0x31b8('0xb'));var Channel=require(_0x31b8('0xc'));var ut=require(_0x31b8('0xd'));var Action=require(_0x31b8('0xe'));var faxAccount=require(_0x31b8('0xf'));var attachment=require(_0x31b8('0x10'));var faxMessage=require(_0x31b8('0x11'));function Fax(_0x20faa9){this['channels']={};this[_0x31b8('0x12')]=_0x20faa9[_0x31b8('0x12')];this['trunks']=_0x20faa9[_0x31b8('0x13')];this[_0x31b8('0x14')]={};ami['on']('newchannel',this[_0x31b8('0x15')][_0x31b8('0x16')](this));ami['on'](_0x31b8('0x17'),this[_0x31b8('0x18')][_0x31b8('0x16')](this));ami['on'](_0x31b8('0x19'),this[_0x31b8('0x1a')]['bind'](this));ami['on'](_0x31b8('0x1b'),this['syncNewExten']['bind'](this));ami['on'](_0x31b8('0x1c'),this[_0x31b8('0x1d')][_0x31b8('0x16')](this));ami['on'](_0x31b8('0x1e'),this[_0x31b8('0x1f')]['bind'](this));ami['on'](_0x31b8('0x20'),this[_0x31b8('0x21')][_0x31b8('0x16')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x31b8('0x16')](this));}Fax[_0x31b8('0x22')]['syncNewchannel']=function(_0x47311b){if(_0x47311b[_0x31b8('0x23')]===_0x31b8('0x24')){for(var _0x42595c in this['faxAccounts']){if(this[_0x31b8('0x12')][_0x31b8('0x25')](_0x42595c)){if(_0x47311b[_0x31b8('0x26')]===this[_0x31b8('0x12')][_0x42595c][_0x31b8('0x27')]){this['channels'][_0x47311b[_0x31b8('0x28')]]={};this['channels'][_0x47311b[_0x31b8('0x28')]][_0x31b8('0x29')]=_0x47311b[_0x31b8('0x29')];this[_0x31b8('0x2a')][_0x47311b[_0x31b8('0x28')]]['id']=this[_0x31b8('0x12')][_0x42595c]['id'];this[_0x31b8('0x2a')][_0x47311b[_0x31b8('0x28')]][_0x31b8('0x2b')]=this[_0x31b8('0x12')][_0x42595c][_0x31b8('0x2b')];logger[_0x31b8('0x2c')](_0x47311b[_0x31b8('0x28')],_0x31b8('0x2d'));}}}}if(this[_0x31b8('0x14')][_0x47311b[_0x31b8('0x28')]]){this[_0x31b8('0x2a')][_0x47311b[_0x31b8('0x28')]]={};this[_0x31b8('0x2a')][_0x47311b[_0x31b8('0x28')]][_0x31b8('0x29')]=_0x47311b[_0x31b8('0x29')];logger[_0x31b8('0x2c')](_0x47311b[_0x31b8('0x28')],_0x31b8('0x2d'));}};Fax['prototype'][_0x31b8('0x18')]=function(_0x5c5761){if(this['channels'][_0x5c5761['uniqueid']]){for(var _0x243502 in _0x5c5761[_0x31b8('0x2e')]){if(_0x5c5761[_0x31b8('0x2e')][_0x31b8('0x25')](_0x243502)){this[_0x31b8('0x2a')][_0x5c5761[_0x31b8('0x28')]][_0x243502]=_0x5c5761[_0x31b8('0x2f')];}}}};Fax[_0x31b8('0x22')]['syncNewState']=function(_0x3bd07f){if(this[_0x31b8('0x2a')][_0x3bd07f[_0x31b8('0x28')]]){this[_0x31b8('0x2a')][_0x3bd07f[_0x31b8('0x28')]][_0x31b8('0x30')]=_0x3bd07f[_0x31b8('0x30')];this['channels'][_0x3bd07f[_0x31b8('0x28')]][_0x31b8('0x31')]=_0x3bd07f[_0x31b8('0x31')];}};Fax[_0x31b8('0x22')]['syncNewExten']=function(_0x971267){if(this[_0x31b8('0x2a')][_0x971267[_0x31b8('0x28')]]){for(var _0x23f300 in _0x971267['variable']){if(_0x971267['variable'][_0x31b8('0x25')](_0x23f300)){this[_0x31b8('0x2a')][_0x971267[_0x31b8('0x28')]][_0x23f300]=_0x971267['value'];}}}};Fax[_0x31b8('0x22')][_0x31b8('0x1d')]=function(_0x367701){if(this[_0x31b8('0x2a')][_0x367701[_0x31b8('0x28')]]){this[_0x31b8('0x2a')][_0x367701[_0x31b8('0x28')]][_0x31b8('0x32')]=_0x367701[_0x31b8('0x32')];this['channels'][_0x367701['uniqueid']][_0x31b8('0x33')]=_0x367701[_0x31b8('0x33')];this[_0x31b8('0x2a')][_0x367701[_0x31b8('0x28')]][_0x31b8('0x27')]=_0x367701[_0x31b8('0x27')];this['channels'][_0x367701[_0x31b8('0x28')]][_0x31b8('0x34')]=_0x367701[_0x31b8('0x34')];logger[_0x31b8('0x2c')](_0x367701[_0x31b8('0x28')],_0x31b8('0x35'));}};Fax[_0x31b8('0x22')][_0x31b8('0x1f')]=function(_0x3a5bae){var _0x220858=this;if(this[_0x31b8('0x2a')][_0x3a5bae['uniqueid']]){var _0x140aa8=this[_0x31b8('0x2a')][_0x3a5bae[_0x31b8('0x28')]]['id'];this['channels'][_0x3a5bae[_0x31b8('0x28')]][_0x31b8('0x36')]=_0x3a5bae[_0x31b8('0x36')];this[_0x31b8('0x2a')][_0x3a5bae[_0x31b8('0x28')]][_0x31b8('0x37')]=_0x3a5bae[_0x31b8('0x37')];this[_0x31b8('0x2a')][_0x3a5bae[_0x31b8('0x28')]][_0x31b8('0x27')]=_0x3a5bae[_0x31b8('0x27')];this[_0x31b8('0x2a')][_0x3a5bae[_0x31b8('0x28')]]['resolution']=_0x3a5bae[_0x31b8('0x38')];this[_0x31b8('0x2a')][_0x3a5bae[_0x31b8('0x28')]][_0x31b8('0x39')]=_0x3a5bae[_0x31b8('0x39')];this[_0x31b8('0x2a')][_0x3a5bae['uniqueid']][_0x31b8('0x34')]=_0x3a5bae[_0x31b8('0x34')];this[_0x31b8('0x2a')][_0x3a5bae[_0x31b8('0x28')]]['calleridnum']=_0x3a5bae[_0x31b8('0x3a')];if(this['channels'][_0x3a5bae['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x3a5bae[_0x31b8('0x34')],_0x31b8('0x3b'),function(_0x2fcb16){logger[_0x31b8('0x2c')](_0x3a5bae[_0x31b8('0x28')],'\x20result\x20conversion\x20file\x20',_0x2fcb16['message']);attachment['create']({'name':path[_0x31b8('0x3c')](_0x3a5bae[_0x31b8('0x34')])[_0x31b8('0x2b')],'basename':path[_0x31b8('0x3c')](_0x3a5bae[_0x31b8('0x34')])[_0x31b8('0x2b')]+_0x31b8('0x3d'),'type':'application/pdf'})[_0x31b8('0x3e')](function(_0x462c14){faxAccount[_0x31b8('0x3f')](_0x140aa8,{'from':_0x3a5bae[_0x31b8('0x3a')],'mapKey':_0x31b8('0x9'),'body':path[_0x31b8('0x3c')](_0x3a5bae[_0x31b8('0x34')])[_0x31b8('0x2b')]+_0x31b8('0x3d'),'AttachmentId':_0x462c14['id']})[_0x31b8('0x40')](function(_0x3db779){logger[_0x31b8('0x41')](_0x3a5bae['uniqueid'],'\x20notify\x20',JSON[_0x31b8('0x42')](_0x3db779));});})[_0x31b8('0x40')](function(_0x55a15c){logger[_0x31b8('0x41')](_0x3a5bae[_0x31b8('0x28')],_0x31b8('0x43'),JSON['stringify'](_0x55a15c));});});}logger[_0x31b8('0x2c')](_0x3a5bae[_0x31b8('0x28')],_0x31b8('0x43'));}};Fax[_0x31b8('0x22')]['syncOriginateResponse']=function(_0xa6fc16){if(this['actions'][_0xa6fc16[_0x31b8('0x28')]]){_[_0x31b8('0x44')](this[_0x31b8('0x2a')][_0xa6fc16[_0x31b8('0x28')]],_[_0x31b8('0x45')](_0xa6fc16,[_0x31b8('0x46'),_0x31b8('0x47')]));}};function updateStatus(_0x5a2493){if(_0x5a2493[_0x31b8('0x48')]){faxMessage[_0x31b8('0x49')](_0x5a2493[_0x31b8('0x48')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x31b8('0x3e')](function(_0x50e09e){ut['logger'](_0x31b8('0x4a'),_0x50e09e);})[_0x31b8('0x40')](function(_0x339b62){ut[_0x31b8('0x4b')](_0x31b8('0x4c'),_0x339b62);});}else{ut[_0x31b8('0x4b')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x31b8('0x22')][_0x31b8('0x4d')]=function(_0x5864b2,_0x48b46e,_0x27bd06){var _0x3e28ad=this;var _0x302b4d={};if(_0x48b46e){_0x302b4d={'read':_0x48b46e};}else{_0x302b4d={'failMessage':_0x27bd06};}if(this[_0x31b8('0x14')][_0x5864b2][_0x31b8('0x48')]){faxMessage[_0x31b8('0x49')](this[_0x31b8('0x14')][_0x5864b2][_0x31b8('0x48')],_0x302b4d)['then'](function(_0x27a823){ut[_0x31b8('0x4b')]('[Fax][Message][Updated]',_0x27a823);})[_0x31b8('0x40')](function(_0x2e1751){ut[_0x31b8('0x4b')](_0x31b8('0x4e'),_0x2e1751);})[_0x31b8('0x4f')](function(){delete _0x3e28ad[_0x31b8('0x2a')][_0x5864b2];delete _0x3e28ad[_0x31b8('0x14')][_0x5864b2];});}else{ut[_0x31b8('0x4b')](_0x31b8('0x50'));delete this[_0x31b8('0x2a')][_0x5864b2];delete this['actions'][_0x5864b2];}};Fax[_0x31b8('0x22')][_0x31b8('0x21')]=function(_0x165ebf){var _0x1ecfd0=this;if(this['channels'][_0x165ebf[_0x31b8('0x28')]]){if(this[_0x31b8('0x14')][_0x165ebf['uniqueid']]){this[_0x31b8('0x2a')][_0x165ebf['uniqueid']]['id']=this[_0x31b8('0x14')][_0x165ebf['uniqueid']]['id'];this['channels'][_0x165ebf[_0x31b8('0x28')]]['name']=this[_0x31b8('0x14')][_0x165ebf[_0x31b8('0x28')]][_0x31b8('0x2b')];}logger['info'](_0x165ebf['uniqueid'],this[_0x31b8('0x14')][_0x165ebf[_0x31b8('0x28')]]?'\x20hangup\x20sendFile\x20':_0x31b8('0x51'),JSON['stringify'](this[_0x31b8('0x2a')][_0x165ebf['uniqueid']]));if(this[_0x31b8('0x14')][_0x165ebf[_0x31b8('0x28')]]){if(this['channels'][_0x165ebf['uniqueid']][_0x31b8('0x52')]>0x0&&this[_0x31b8('0x2a')][_0x165ebf['uniqueid']]['faxstatus']===_0x31b8('0x53')){this['updateStatus'](_0x165ebf[_0x31b8('0x28')],!![]);}else{this[_0x31b8('0x4d')](_0x165ebf[_0x31b8('0x28')],![],this[_0x31b8('0x2a')][_0x165ebf[_0x31b8('0x28')]][_0x31b8('0x54')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x165ebf[_0x31b8('0x28')]][_0x31b8('0x54')]:_0x31b8('0x55'));}}}};Fax[_0x31b8('0x22')][_0x31b8('0x56')]=function(_0x35b8d9){var _0x8944f6=this;return new BPromise(function(_0x519007,_0x3d539b){_0x8944f6[_0x31b8('0x57')](_0x35b8d9,_0x8944f6['faxAccounts'][_0x35b8d9[_0x31b8('0x58')]])[_0x31b8('0x3e')](function(_0x3a7bb5){ut[_0x31b8('0x4b')](_0x31b8('0x59'),_0x3a7bb5);_0x519007(ut[_0x31b8('0x5a')]('Fax\x20received'));})[_0x31b8('0x40')](function(_0x3515d2){ut[_0x31b8('0x4b')](_0x31b8('0x5b'),_0x3515d2);updateStatus(_0x35b8d9);_0x3d539b(ut['message'](_0x31b8('0x5c')));});});};Fax[_0x31b8('0x22')][_0x31b8('0x5d')]=function(_0x393b3b){var _0x3140c6=this;return new BPromise(function(_0x483e35,_0x239fb0){var _0x31f6dc=_0x3140c6[_0x31b8('0x5e')](_0x3140c6[_0x31b8('0x12')][_0x393b3b[_0x31b8('0x58')]][_0x31b8('0x5f')],_0x393b3b);if(_0x31f6dc[_0x31b8('0x60')]){_0x483e35(ut['message'](_0x31b8('0x61')));}else{_0x239fb0(ut[_0x31b8('0x5a')](_0x31f6dc['message']));}});};function originate(_0x54dd35,_0x176f25,_0x4300d1){return new BPromise(function(_0x409ebb,_0x506694){if(_0x4300d1){var _0xc35821=util['format'](_0x31b8('0x62'),path['parse'](_0x54dd35[_0x31b8('0x5')])[_0x31b8('0x2b')],_0x54dd35[_0x31b8('0x5')]);gs['execute'](_0xc35821)[_0x31b8('0x3e')](function(){_0x54dd35[_0x31b8('0x5')]=util[_0x31b8('0x63')](_0x31b8('0x64'),path[_0x31b8('0x3c')](_0x54dd35[_0x31b8('0x5')])[_0x31b8('0x65')],path['parse'](_0x54dd35[_0x31b8('0x5')])[_0x31b8('0x2b')]);_0x176f25[_0x31b8('0x66')]=_0x54dd35[_0x31b8('0x5')];ut[_0x31b8('0x4b')](_0x31b8('0x67'),'');ami[_0x31b8('0x68')](ut['variablesAction'](_0x54dd35,_0x176f25))['then'](function(_0x37283d){_0x409ebb(_0x37283d);})[_0x31b8('0x40')](function(_0x206461){_0x506694(_0x206461);});})['catch'](function(_0x1e752b){_0x506694(_0x1e752b);});}else{ami[_0x31b8('0x68')](ut[_0x31b8('0x69')](_0x54dd35,_0x176f25))[_0x31b8('0x3e')](function(_0x5d11e9){_0x409ebb(_0x5d11e9);})['catch'](function(_0x33c2f4){_0x506694(_0x33c2f4);});}});}Fax[_0x31b8('0x22')][_0x31b8('0x57')]=function(_0x110f5a,_0x16a372){var _0x5b1ce6=this;return new BPromise(function(_0x31279,_0x11c936){var _0x1d7132=uuid['v4']();var _0x3f7434=ut[_0x31b8('0x6a')](_0x110f5a,_0x16a372);_0x5b1ce6[_0x31b8('0x14')][_0x1d7132]=new Action(_0x1d7132,_0x16a372,_0x110f5a);var _0x544969=_0x5b1ce6[_0x31b8('0x14')][_0x1d7132];if(path['parse'](_0x110f5a[_0x31b8('0x5')])[_0x31b8('0x6b')]==='.pdf'){originate(_0x544969,_0x3f7434,!![])[_0x31b8('0x3e')](function(_0x43f7c9){_0x31279(_0x43f7c9);})[_0x31b8('0x40')](function(_0x4aa856){_0x11c936(_0x4aa856);});}else{originate(_0x544969,_0x3f7434,![])[_0x31b8('0x3e')](function(_0x956381){_0x31279(_0x956381);})[_0x31b8('0x40')](function(_0x25062e){_0x11c936(_0x25062e);});}});};Fax['prototype'][_0x31b8('0x6c')]=function(_0x48a0b3){return!_[_0x31b8('0x6d')](_0x48a0b3)&&!_[_0x31b8('0x6d')](_0x48a0b3[_0x31b8('0x2b')])&&!_[_0x31b8('0x6d')](_0x48a0b3[_0x31b8('0x6e')])&&_0x48a0b3[_0x31b8('0x6e')]&&!_[_0x31b8('0x6d')](this[_0x31b8('0x13')][util['format'](_0x31b8('0x6f'),_0x48a0b3[_0x31b8('0x2b')])])&&!_[_0x31b8('0x6d')](this[_0x31b8('0x13')][util['format'](_0x31b8('0x6f'),_0x48a0b3[_0x31b8('0x2b')])][_0x31b8('0x33')])&&(this[_0x31b8('0x13')][util['format'](_0x31b8('0x6f'),_0x48a0b3[_0x31b8('0x2b')])]['status']==='reachable'||this[_0x31b8('0x13')][util[_0x31b8('0x63')](_0x31b8('0x6f'),_0x48a0b3[_0x31b8('0x2b')])]['status']===_0x31b8('0x70'));};Fax[_0x31b8('0x22')][_0x31b8('0x5e')]=function(_0xdba18c,_0x4f5cc9){if(!this[_0x31b8('0x6c')](_0xdba18c)){ut['logger'](_0x31b8('0x71'),_[_0x31b8('0x6d')](_0xdba18c)?'':_0xdba18c[_0x31b8('0x2b')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x31b8('0x6d')](_0x4f5cc9[_0x31b8('0x9')])){ut[_0x31b8('0x4b')](_0x31b8('0x72'),JSON[_0x31b8('0x42')](_0x4f5cc9));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x31b8('0x6d')](_0x4f5cc9[_0x31b8('0x5')])){ut[_0x31b8('0x4b')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x4f5cc9));return{'isValid':![],'message':_0x31b8('0x73')};}return{'isValid':!![],'message':_0x31b8('0x74')};};module[_0x31b8('0x75')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 0505dff..7b08a02 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 _0x55a4=['resolve','then','notify','catch','util','bluebird','../../../config/logger','preview','error','inspect'];(function(_0x5d2a3e,_0x5ba125){var _0x32424e=function(_0x5ae232){while(--_0x5ae232){_0x5d2a3e['push'](_0x5d2a3e['shift']());}};_0x32424e(++_0x5ba125);}(_0x55a4,0x112));var _0x455a=function(_0x25d5f3,_0x11629e){_0x25d5f3=_0x25d5f3-0x0;var _0x2b0357=_0x55a4[_0x25d5f3];return _0x2b0357;};'use strict';var util=require(_0x455a('0x0'));var BPromise=require(_0x455a('0x1'));var logger=require(_0x455a('0x2'))(_0x455a('0x3'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x1892b8){return function(_0x5ee065){logger[_0x455a('0x4')](_0x1892b8,util[_0x455a('0x5')](_0x5ee065,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x59b8d2,_0x3800c6){return BPromise[_0x455a('0x6')]()[_0x455a('0x7')](faxAccount[_0x455a('0x8')](_0x59b8d2,_0x3800c6))[_0x455a('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x07fb=['[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07fb,0x1e1));var _0xb07f=function(_0x3c9010,_0x970251){_0x3c9010=_0x3c9010-0x0;var _0x373e8a=_0x07fb[_0x3c9010];return _0x373e8a;};'use strict';var util=require(_0xb07f('0x0'));var BPromise=require(_0xb07f('0x1'));var logger=require(_0xb07f('0x2'))(_0xb07f('0x3'));var _=require(_0xb07f('0x4'));var faxAccount=require(_0xb07f('0x5'));function loggerCatch(_0x48c969){return function(_0x93339a){logger[_0xb07f('0x6')](_0x48c969,util[_0xb07f('0x7')](_0x93339a,{'showHidden':![],'depth':null}));};}exports[_0xb07f('0x8')]=function(_0x57e98a,_0x3db036){return BPromise[_0xb07f('0x9')]()[_0xb07f('0xa')](faxAccount[_0xb07f('0x8')](_0x57e98a,_0x3db036))['catch'](loggerCatch(_0xb07f('0xb')));}; \ 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 e568198..519d4f2 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 _0x31f2=['Exec\x20gs','inspect','../../../../config/logger','fax','bluebird','child_process','exec','execute'];(function(_0x4781c4,_0x22c0bb){var _0x48bac9=function(_0x2d0c01){while(--_0x2d0c01){_0x4781c4['push'](_0x4781c4['shift']());}};_0x48bac9(++_0x22c0bb);}(_0x31f2,0x19a));var _0x231f=function(_0xd650d0,_0x111ba9){_0xd650d0=_0xd650d0-0x0;var _0x5d5337=_0x31f2[_0xd650d0];return _0x5d5337;};'use strict';var util=require('util');var logger=require(_0x231f('0x0'))(_0x231f('0x1'));var BPromise=require(_0x231f('0x2'));var exec=require(_0x231f('0x3'))[_0x231f('0x4')];exports[_0x231f('0x5')]=function(_0x2a4fda){return new BPromise(function(_0x994580,_0x20a7d3){exec(_0x2a4fda,function(_0x2c6944,_0x56ac16,_0x5365d0){logger['info'](_0x231f('0x6'),_0x56ac16);if(_0x2c6944){logger['info'](_0x231f('0x6'),'\x20Error\x20:',util[_0x231f('0x7')](_0x2c6944,{'showHidden':![],'depth':null}),_0x56ac16,_0x5365d0);_0x20a7d3(_0x2c6944);}_0x994580(_0x56ac16);});});}; \ No newline at end of file +var _0xfcd3=['fax','exec','execute','info','Exec\x20gs','\x20Error\x20:','../../../../config/logger'];(function(_0x5a06ca,_0x42aab7){var _0x296e90=function(_0x80a0e9){while(--_0x80a0e9){_0x5a06ca['push'](_0x5a06ca['shift']());}};_0x296e90(++_0x42aab7);}(_0xfcd3,0x11e));var _0x3fcd=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0xfcd3[_0x506d83];return _0x335e8b;};'use strict';var util=require('util');var logger=require(_0x3fcd('0x0'))(_0x3fcd('0x1'));var BPromise=require('bluebird');var exec=require('child_process')[_0x3fcd('0x2')];exports[_0x3fcd('0x3')]=function(_0x1dd459){return new BPromise(function(_0x526178,_0x4c4d12){exec(_0x1dd459,function(_0x5f0744,_0x460d27,_0x3c8b8e){logger[_0x3fcd('0x4')]('Exec\x20gs',_0x460d27);if(_0x5f0744){logger[_0x3fcd('0x4')](_0x3fcd('0x5'),_0x3fcd('0x6'),util['inspect'](_0x5f0744,{'showHidden':![],'depth':null}),_0x460d27,_0x3c8b8e);_0x4c4d12(_0x5f0744);}_0x526178(_0x460d27);});});}; \ 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 7fc74e0..f83e28a 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 _0x991c=['addVariables','ecm','format','modem','gateway','faxdetect','t38timeout','path','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','localstationid','util','lodash','moment','../../../../config/logger','fax','message','logger','inspect'];(function(_0x3960b9,_0x13de54){var _0x23bb28=function(_0x5aefe4){while(--_0x5aefe4){_0x3960b9['push'](_0x3960b9['shift']());}};_0x23bb28(++_0x13de54);}(_0x991c,0x70));var _0xc991=function(_0x5a2c8a,_0x17be5e){_0x5a2c8a=_0x5a2c8a-0x0;var _0x27b00f=_0x991c[_0x5a2c8a];return _0x27b00f;};'use strict';var util=require(_0xc991('0x0'));var _=require(_0xc991('0x1'));var moment=require(_0xc991('0x2'));var logger=require(_0xc991('0x3'))(_0xc991('0x4'));exports[_0xc991('0x5')]=function(_0x95d661){return{'message':_0x95d661};};exports[_0xc991('0x6')]=function(_0xa0edc7,_0x4e606d){logger['info'](_0xa0edc7,util[_0xc991('0x7')](_0x4e606d,{'showHidden':![],'depth':null}));};exports[_0xc991('0x8')]=function(_0x5ee5be,_0x106d9a){var _0x377614={'XMF-ECM':_0x106d9a[_0xc991('0x9')],'XMF-HEADERINFO':_0x106d9a['headerinfo'],'XMF-MINRATE':_0x106d9a['minrate'],'XMF-MAXRATE':_0x106d9a['maxrate'],'XMF-MODEM':util[_0xc991('0xa')]('\x22%s\x22',_0x106d9a[_0xc991('0xb')]),'XMF-GATEWAY':_0x106d9a[_0xc991('0xc')],'XMF-FAXDETECT':_0x106d9a[_0xc991('0xd')],'XMF-T38TIMEOUT':_0x106d9a[_0xc991('0xe')],'XMF-LOCALSTATIONID':_0x106d9a['localstationid'],'XMF-PATH':_0x5ee5be[_0xc991('0xf')]};return _0x377614;};exports['variablesAction']=function(_0x5d98fa,_0x157441){return{'actionid':_0x5d98fa[_0xc991('0x10')],'action':_0xc991('0x11'),'channel':_0x5d98fa[_0xc991('0x12')],'Exten':_0xc991('0x13'),'Context':_0xc991('0x14'),'Priority':'1','callerid':util['format'](_0xc991('0x15'),_0x5d98fa[_0xc991('0x16')]?_0x5d98fa[_0xc991('0x16')]:'',_0x5d98fa[_0xc991('0x17')]),'variable':_0x157441,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5d98fa[_0xc991('0x10')]};}; \ No newline at end of file +var _0xddd3=['ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','gateway','t38timeout','localstationid','path','variablesAction','uniqueid','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','addVariables'];(function(_0x5c7e53,_0x174ce5){var _0x1c9af9=function(_0x38895d){while(--_0x38895d){_0x5c7e53['push'](_0x5c7e53['shift']());}};_0x1c9af9(++_0x174ce5);}(_0xddd3,0x100));var _0x3ddd=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xddd3[_0x4bfac3];return _0x15f0f2;};'use strict';var util=require(_0x3ddd('0x0'));var _=require(_0x3ddd('0x1'));var moment=require(_0x3ddd('0x2'));var logger=require(_0x3ddd('0x3'))(_0x3ddd('0x4'));exports[_0x3ddd('0x5')]=function(_0x49c6c0){return{'message':_0x49c6c0};};exports[_0x3ddd('0x6')]=function(_0x3fba6b,_0x2965e6){logger['info'](_0x3fba6b,util['inspect'](_0x2965e6,{'showHidden':![],'depth':null}));};exports[_0x3ddd('0x7')]=function(_0x3a441a,_0x337ebf){var _0x5ae37b={'XMF-ECM':_0x337ebf[_0x3ddd('0x8')],'XMF-HEADERINFO':_0x337ebf[_0x3ddd('0x9')],'XMF-MINRATE':_0x337ebf[_0x3ddd('0xa')],'XMF-MAXRATE':_0x337ebf[_0x3ddd('0xb')],'XMF-MODEM':util[_0x3ddd('0xc')](_0x3ddd('0xd'),_0x337ebf['modem']),'XMF-GATEWAY':_0x337ebf[_0x3ddd('0xe')],'XMF-FAXDETECT':_0x337ebf['faxdetect'],'XMF-T38TIMEOUT':_0x337ebf[_0x3ddd('0xf')],'XMF-LOCALSTATIONID':_0x337ebf[_0x3ddd('0x10')],'XMF-PATH':_0x3a441a[_0x3ddd('0x11')]};return _0x5ae37b;};exports[_0x3ddd('0x12')]=function(_0x24fd10,_0x32ad9d){return{'actionid':_0x24fd10[_0x3ddd('0x13')],'action':'originate','channel':_0x24fd10['channel'],'Exten':'xcally-motion-fax','Context':_0x3ddd('0x14'),'Priority':'1','callerid':util['format'](_0x3ddd('0x15'),_0x24fd10[_0x3ddd('0x9')]?_0x24fd10[_0x3ddd('0x9')]:'',_0x24fd10['localstationid']),'variable':_0x32ad9d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x24fd10['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index b0c0bc9..f273677 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 _0x4dde=['initZohoAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','./server','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','initSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts'];(function(_0x5d6e35,_0x4d1ac0){var _0x5d7ada=function(_0x2f7dd3){while(--_0x2f7dd3){_0x5d6e35['push'](_0x5d6e35['shift']());}};_0x5d7ada(++_0x4d1ac0);}(_0x4dde,0x108));var _0xe4dd=function(_0x16d052,_0x303714){_0x16d052=_0x16d052-0x0;var _0x25624a=_0x4dde[_0x16d052];return _0x25624a;};'use strict';var BPromise=require(_0xe4dd('0x0'));var util=require(_0xe4dd('0x1'));var moment=require('moment');var server=require(_0xe4dd('0x2'));var Realtime=require('./realtime');var Report=require(_0xe4dd('0x3'));var Acw=require(_0xe4dd('0x4'));var Trigger=require(_0xe4dd('0x5'));var Dialer=require(_0xe4dd('0x6'));var Preview=require('./preview');var Fax=require(_0xe4dd('0x7'));var user=require(_0xe4dd('0x8'));var voiceQueue=require(_0xe4dd('0x9'));var voiceQueueReport=require(_0xe4dd('0xa'));var voiceCallReport=require(_0xe4dd('0xb'));var trunk=require('./rpc/trunk');var trigger=require(_0xe4dd('0xc'));var template=require(_0xe4dd('0xd'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xe4dd('0xe'));var voiceExtension=require(_0xe4dd('0xf'));var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xe4dd('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xe4dd('0x11'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var servicenow=require(_0xe4dd('0x12'));var dynamics365=require(_0xe4dd('0x13'));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()[_0xe4dd('0x14')](_0xe4dd('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe4dd('0x14')](_0xe4dd('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xe4dd('0x16')]()[_0xe4dd('0x17')](user[_0xe4dd('0x18')]())['then'](realtime[_0xe4dd('0x19')]())['then'](user[_0xe4dd('0x1a')]())[_0xe4dd('0x17')](realtime['initTelephones']())[_0xe4dd('0x17')](trunk['getTrunks']())[_0xe4dd('0x17')](realtime[_0xe4dd('0x1b')]())[_0xe4dd('0x17')](voiceQueue[_0xe4dd('0x1c')]())[_0xe4dd('0x17')](realtime[_0xe4dd('0x1d')]())[_0xe4dd('0x17')](trigger[_0xe4dd('0x1e')]())[_0xe4dd('0x17')](realtime[_0xe4dd('0x1f')]())[_0xe4dd('0x17')](template[_0xe4dd('0x20')]())[_0xe4dd('0x17')](realtime[_0xe4dd('0x21')]())[_0xe4dd('0x17')](zendesk['getZendeskAccounts']())[_0xe4dd('0x17')](realtime[_0xe4dd('0x22')]())[_0xe4dd('0x17')](salesforce['getSalesforceAccounts']())['then'](realtime[_0xe4dd('0x23')]())[_0xe4dd('0x17')](sugarcrm['getSugarcrmAccounts']())[_0xe4dd('0x17')](realtime['initSugarcrmAccounts']())[_0xe4dd('0x17')](freshdesk[_0xe4dd('0x24')]())[_0xe4dd('0x17')](realtime[_0xe4dd('0x25')]())[_0xe4dd('0x17')](desk[_0xe4dd('0x26')]())[_0xe4dd('0x17')](realtime[_0xe4dd('0x27')]())[_0xe4dd('0x17')](zoho[_0xe4dd('0x28')]())[_0xe4dd('0x17')](realtime[_0xe4dd('0x29')]())['then'](vtiger['getVtigerAccounts']())[_0xe4dd('0x17')](realtime['initVtigerAccounts']())['then'](servicenow[_0xe4dd('0x2a')]())['then'](realtime[_0xe4dd('0x2b')]())[_0xe4dd('0x17')](dynamics365[_0xe4dd('0x2c')]())[_0xe4dd('0x17')](realtime[_0xe4dd('0x2d')]())['then'](campaign[_0xe4dd('0x2e')]())[_0xe4dd('0x17')](realtime['initCampaigns']())[_0xe4dd('0x17')](voiceExtension[_0xe4dd('0x2f')]())[_0xe4dd('0x17')](realtime[_0xe4dd('0x30')]())[_0xe4dd('0x17')](faxAccount['getFaxAccounts']())['then'](realtime[_0xe4dd('0x31')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xe4dd('0x16')]()[_0xe4dd('0x17')](voiceQueueReport[_0xe4dd('0x32')]())[_0xe4dd('0x17')](realtime[_0xe4dd('0x33')]())[_0xe4dd('0x17')](cmHopperHistory[_0xe4dd('0x34')]())['then'](realtime[_0xe4dd('0x35')]())[_0xe4dd('0x17')](cmHopperHistory['getCampaignHopperHistory']())[_0xe4dd('0x17')](realtime[_0xe4dd('0x36')]())[_0xe4dd('0x17')](voiceCallReport[_0xe4dd('0x37')]())[_0xe4dd('0x17')](realtime[_0xe4dd('0x38')]())[_0xe4dd('0x17')](function(_0x2381f4){})[_0xe4dd('0x39')](function(_0x65beb2){console[_0xe4dd('0x3a')](_0x65beb2);});}function main(){return server[_0xe4dd('0x3b')](realtime,preview,fax)[_0xe4dd('0x17')](function(_0x3be11f){return initRealtime();})[_0xe4dd('0x17')](function(){return initParams();})[_0xe4dd('0x17')](function(){report[_0xe4dd('0x3c')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x1a41db){console[_0xe4dd('0x3a')](_0x1a41db);});}main(); \ No newline at end of file +var _0x6df1=['get','hour','then','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','resolve','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','listen','bluebird','util','moment','./server','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365'];(function(_0x541a67,_0x50728d){var _0x45da2a=function(_0x158929){while(--_0x158929){_0x541a67['push'](_0x541a67['shift']());}};_0x45da2a(++_0x50728d);}(_0x6df1,0xe0));var _0x16df=function(_0x332684,_0x4c5b5b){_0x332684=_0x332684-0x0;var _0x42c520=_0x6df1[_0x332684];return _0x42c520;};'use strict';var BPromise=require(_0x16df('0x0'));var util=require(_0x16df('0x1'));var moment=require(_0x16df('0x2'));var server=require(_0x16df('0x3'));var Realtime=require('./realtime');var Report=require(_0x16df('0x4'));var Acw=require(_0x16df('0x5'));var Trigger=require(_0x16df('0x6'));var Dialer=require('./dialer');var Preview=require(_0x16df('0x7'));var Fax=require(_0x16df('0x8'));var user=require(_0x16df('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x16df('0xa'));var voiceCallReport=require(_0x16df('0xb'));var trunk=require(_0x16df('0xc'));var trigger=require(_0x16df('0xd'));var template=require(_0x16df('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x16df('0xf'));var voiceExtension=require(_0x16df('0x10'));var faxAccount=require(_0x16df('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x16df('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x16df('0x13'));var zoho=require(_0x16df('0x14'));var vtiger=require(_0x16df('0x15'));var servicenow=require(_0x16df('0x16'));var dynamics365=require(_0x16df('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x16df('0x18')](_0x16df('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x16df('0x18')](_0x16df('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x16df('0x1a')](user['getAgents']())[_0x16df('0x1a')](realtime[_0x16df('0x1b')]())['then'](user[_0x16df('0x1c')]())[_0x16df('0x1a')](realtime['initTelephones']())[_0x16df('0x1a')](trunk[_0x16df('0x1d')]())[_0x16df('0x1a')](realtime[_0x16df('0x1e')]())[_0x16df('0x1a')](voiceQueue[_0x16df('0x1f')]())[_0x16df('0x1a')](realtime[_0x16df('0x20')]())[_0x16df('0x1a')](trigger[_0x16df('0x21')]())[_0x16df('0x1a')](realtime['initTriggers']())['then'](template[_0x16df('0x22')]())['then'](realtime[_0x16df('0x23')]())[_0x16df('0x1a')](zendesk[_0x16df('0x24')]())[_0x16df('0x1a')](realtime['initZendeskAccounts']())['then'](salesforce[_0x16df('0x25')]())[_0x16df('0x1a')](realtime[_0x16df('0x26')]())[_0x16df('0x1a')](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0x16df('0x27')]())[_0x16df('0x1a')](freshdesk[_0x16df('0x28')]())['then'](realtime[_0x16df('0x29')]())['then'](desk['getDeskAccounts']())[_0x16df('0x1a')](realtime[_0x16df('0x2a')]())[_0x16df('0x1a')](zoho[_0x16df('0x2b')]())[_0x16df('0x1a')](realtime['initZohoAccounts']())[_0x16df('0x1a')](vtiger[_0x16df('0x2c')]())[_0x16df('0x1a')](realtime[_0x16df('0x2d')]())[_0x16df('0x1a')](servicenow[_0x16df('0x2e')]())[_0x16df('0x1a')](realtime[_0x16df('0x2f')]())[_0x16df('0x1a')](dynamics365[_0x16df('0x30')]())[_0x16df('0x1a')](realtime[_0x16df('0x31')]())[_0x16df('0x1a')](campaign[_0x16df('0x32')]())[_0x16df('0x1a')](realtime[_0x16df('0x33')]())['then'](voiceExtension[_0x16df('0x34')]())['then'](realtime['initVoiceExtensions']())[_0x16df('0x1a')](faxAccount['getFaxAccounts']())[_0x16df('0x1a')](realtime['initFaxAccounts']())[_0x16df('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x16df('0x35')]()[_0x16df('0x1a')](voiceQueueReport[_0x16df('0x36')]())[_0x16df('0x1a')](realtime[_0x16df('0x37')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x16df('0x38')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x16df('0x1a')](realtime[_0x16df('0x39')]())[_0x16df('0x1a')](voiceCallReport['getVoiceCallReports']())[_0x16df('0x1a')](realtime[_0x16df('0x3a')]())[_0x16df('0x1a')](function(_0x3570e6){})[_0x16df('0x3b')](function(_0x7695a2){console[_0x16df('0x3c')](_0x7695a2);});}function main(){return server[_0x16df('0x3d')](realtime,preview,fax)['then'](function(_0x31b003){return initRealtime();})[_0x16df('0x1a')](function(){return initParams();})[_0x16df('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x16df('0x3b')](function(_0x3eafbf){console['log'](_0x3eafbf);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 075be0a..c9a69d0 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 _0xcab3=['md5','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','updateStatusRealtime','state','toLowerCase','inuse','talking','voiceStatusTime','format','stateTime','voiceStatusQueue','stringify','user:%s','emit','exports','util','moment'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xcab3,0xf3));var _0x3cab=function(_0x1da910,_0x12af22){_0x1da910=_0x1da910-0x0;var _0x14936e=_0xcab3[_0x1da910];return _0x14936e;};'use strict';var _=require('lodash');var util=require(_0x3cab('0x0'));var moment=require(_0x3cab('0x1'));var md5=require(_0x3cab('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x3cab('0x3')]=_[_0x3cab('0x4')](config[_0x3cab('0x3')],{'host':_0x3cab('0x5'),'port':0x18eb});var io=require(_0x3cab('0x6'))(new Redis(config[_0x3cab('0x3')]));function Agent(_0x3a01ee){this['id']=_0x3a01ee['id']||0x0;this[_0x3cab('0x7')]=_0x3a01ee['name']||'';this[_0x3cab('0x8')]=_0x3a01ee[_0x3cab('0x8')]||'';this[_0x3cab('0x9')]=_0x3a01ee[_0x3cab('0x9')]||'';this['fullname']=_0x3a01ee[_0x3cab('0xa')]||'';this['state']=_0x3cab('0xb');this['stateTime']=0x0;this[_0x3cab('0xc')]='unknown';this[_0x3cab('0xd')]='';this[_0x3cab('0xe')]='';this[_0x3cab('0xf')]='';this[_0x3cab('0x10')]='';this['online']=_0x3a01ee[_0x3cab('0x11')]||![];this[_0x3cab('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3cab('0x13')]='';this['voiceStatusQueue']='';this[_0x3cab('0x14')]=![];this[_0x3cab('0x15')]=![];this[_0x3cab('0x2')]='';}Agent['prototype'][_0x3cab('0x16')]=function(_0x3504e4){var _0x1faa99;if(_0x3504e4&&_0x3504e4['state']){_0x1faa99=_0x3504e4[_0x3cab('0x17')][_0x3cab('0x18')]();switch(_0x1faa99){case'not_inuse':_0x1faa99='idle';break;case _0x3cab('0x19'):_0x1faa99=_0x3cab('0x1a');break;}}if(_0x1faa99&&this[_0x3cab('0x12')]!==_0x1faa99||_0x3504e4['statePause']){this[_0x3cab('0x1b')]=_['toNumber'](moment()[_0x3cab('0x1c')]('x'));}if(_0x1faa99){this[_0x3cab('0x12')]=_0x1faa99;}var _0xf08de6={'id':this['id'],'name':this[_0x3cab('0x7')],'email':this[_0x3cab('0x8')],'accountcode':this['accountcode'],'fullname':this[_0x3cab('0xa')],'state':this[_0x3cab('0x17')],'stateTime':this[_0x3cab('0x1d')],'status':this[_0x3cab('0xc')],'address':this[_0x3cab('0xd')],'online':this['online'],'voiceStatus':this[_0x3cab('0x12')],'voiceStatusTime':this[_0x3cab('0x1b')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x3cab('0x1e')],'interface':this['interface'],'onhold':this['onhold']};var _0x2619a0=md5(JSON[_0x3cab('0x1f')](_0xf08de6));if(this[_0x3cab('0x2')]!==_0x2619a0){this[_0x3cab('0x2')]=_0x2619a0;io['to'](util['format'](_0x3cab('0x20'),_0xf08de6[_0x3cab('0x7')]))[_0x3cab('0x21')]('user:save',_0xf08de6);}};module[_0x3cab('0x22')]=Agent; \ No newline at end of file +var _0x526d=['exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','address','phone','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','voiceStatus','statePause','toNumber','format','status','onhold','stringify','user:%s','emit','user:save'];(function(_0xc315de,_0x5dc877){var _0x11a627=function(_0x4039d6){while(--_0x4039d6){_0xc315de['push'](_0xc315de['shift']());}};_0x11a627(++_0x5dc877);}(_0x526d,0xce));var _0xd526=function(_0x4b491b,_0x51c152){_0x4b491b=_0x4b491b-0x0;var _0x2cc3fb=_0x526d[_0x4b491b];return _0x2cc3fb;};'use strict';var _=require(_0xd526('0x0'));var util=require('util');var moment=require('moment');var md5=require(_0xd526('0x1'));var Redis=require(_0xd526('0x2'));var config=require(_0xd526('0x3'));config[_0xd526('0x4')]=_[_0xd526('0x5')](config['redis'],{'host':_0xd526('0x6'),'port':0x18eb});var io=require(_0xd526('0x7'))(new Redis(config[_0xd526('0x4')]));function Agent(_0x303460){this['id']=_0x303460['id']||0x0;this[_0xd526('0x8')]=_0x303460[_0xd526('0x8')]||'';this[_0xd526('0x9')]=_0x303460[_0xd526('0x9')]||'';this[_0xd526('0xa')]=_0x303460['accountcode']||'';this[_0xd526('0xb')]=_0x303460[_0xd526('0xb')]||'';this[_0xd526('0xc')]=_0xd526('0xd');this[_0xd526('0xe')]=0x0;this['status']='unknown';this[_0xd526('0xf')]='';this[_0xd526('0x10')]='';this['mobile']='';this[_0xd526('0x11')]='';this[_0xd526('0x12')]=_0x303460['online']||![];this['voiceStatus']=_0xd526('0xd');this[_0xd526('0x13')]=0x0;this[_0xd526('0x14')]='';this[_0xd526('0x15')]='';this['onhold']=![];this[_0xd526('0x16')]=![];this[_0xd526('0x1')]='';}Agent[_0xd526('0x17')][_0xd526('0x18')]=function(_0x3f92a8){var _0x42f200;if(_0x3f92a8&&_0x3f92a8[_0xd526('0xc')]){_0x42f200=_0x3f92a8['state'][_0xd526('0x19')]();switch(_0x42f200){case _0xd526('0x1a'):_0x42f200=_0xd526('0x1b');break;case _0xd526('0x1c'):_0x42f200=_0xd526('0x1d');break;}}if(_0x42f200&&this[_0xd526('0x1e')]!==_0x42f200||_0x3f92a8[_0xd526('0x1f')]){this[_0xd526('0x13')]=_[_0xd526('0x20')](moment()[_0xd526('0x21')]('x'));}if(_0x42f200){this[_0xd526('0x1e')]=_0x42f200;}var _0x1c1284={'id':this['id'],'name':this[_0xd526('0x8')],'email':this['email'],'accountcode':this[_0xd526('0xa')],'fullname':this[_0xd526('0xb')],'state':this[_0xd526('0xc')],'stateTime':this[_0xd526('0xe')],'status':this[_0xd526('0x22')],'address':this[_0xd526('0xf')],'online':this['online'],'voiceStatus':this[_0xd526('0x1e')],'voiceStatusTime':this[_0xd526('0x13')],'voiceStatusCallerIdNumber':this[_0xd526('0x14')],'voiceStatusQueue':this[_0xd526('0x15')],'interface':this[_0xd526('0x11')],'onhold':this[_0xd526('0x23')]};var _0x5c9a58=md5(JSON[_0xd526('0x24')](_0x1c1284));if(this[_0xd526('0x1')]!==_0x5c9a58){this[_0xd526('0x1')]=_0x5c9a58;io['to'](util[_0xd526('0x21')](_0xd526('0x25'),_0x1c1284['name']))[_0xd526('0x26')](_0xd526('0x27'),_0x1c1284);}};module[_0xd526('0x28')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 7e138b0..78b643f 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 _0x95af=['dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x95af,0x173));var _0xf95a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x95af[_0x2641f9];return _0x585741;};'use strict';function Campaign(_0x76dacc){this['id']=_0x76dacc['id']||0x0;this[_0xf95a('0x0')]=_0x76dacc['name']||'';this[_0xf95a('0x1')]=_0x76dacc[_0xf95a('0x1')]||_0xf95a('0x2');this[_0xf95a('0x3')]=0x0;this[_0xf95a('0x4')]=0x0;this[_0xf95a('0x5')]=0x0;this[_0xf95a('0x6')]=0x0;this['message']='';this[_0xf95a('0x7')]=!![];this['active']=_0x76dacc[_0xf95a('0x8')];this['limitCalls']=_0x76dacc[_0xf95a('0x9')];this[_0xf95a('0xa')]=_0x76dacc[_0xf95a('0xa')]||null;this['dialGlobalInterval']=_0x76dacc[_0xf95a('0xb')]?_0x76dacc[_0xf95a('0xb')]:null;this['dialOriginateCallerIdName']=_0x76dacc[_0xf95a('0xc')];this['dialOriginateCallerIdNumber']=_0x76dacc[_0xf95a('0xd')];this[_0xf95a('0xe')]=_0x76dacc[_0xf95a('0xe')]||0x1e;this[_0xf95a('0xf')]=_0x76dacc[_0xf95a('0xf')];this[_0xf95a('0x10')]=_0x76dacc[_0xf95a('0x10')];this[_0xf95a('0x11')]=_0x76dacc[_0xf95a('0x11')];this[_0xf95a('0x12')]=_0x76dacc[_0xf95a('0x12')];this[_0xf95a('0x13')]=_0x76dacc['dialNoAnswerMaxRetry'];this[_0xf95a('0x14')]=_0x76dacc[_0xf95a('0x14')];this[_0xf95a('0x15')]=_0x76dacc['dialGlobalMaxRetry'];this[_0xf95a('0x16')]=_0x76dacc['dialOrderByScheduledAt']||_0xf95a('0x17');this['dialPrefix']=_0x76dacc[_0xf95a('0x18')]||undefined;this[_0xf95a('0x19')]=_0x76dacc[_0xf95a('0x19')]||undefined;this['dialCutDigit']=_0x76dacc[_0xf95a('0x1a')]||undefined;this[_0xf95a('0x1b')]=_0x76dacc[_0xf95a('0x1b')]?_0x76dacc[_0xf95a('0x1b')]:undefined;this[_0xf95a('0x1c')]=_0x76dacc[_0xf95a('0x1c')]?_0x76dacc[_0xf95a('0x1c')]:undefined;this[_0xf95a('0x1d')]=_0x76dacc['Interval']?_0x76dacc[_0xf95a('0x1d')]:undefined;this[_0xf95a('0x1e')]=_0x76dacc[_0xf95a('0x1e')]?_0x76dacc[_0xf95a('0x1e')]:undefined;this[_0xf95a('0x1f')]=_0x76dacc[_0xf95a('0x1e')]?_0x76dacc[_0xf95a('0x1e')]['name']:undefined;this['dialAMDActive']=_0x76dacc[_0xf95a('0x20')]||![];this[_0xf95a('0x21')]=_0x76dacc[_0xf95a('0x21')];this[_0xf95a('0x22')]=_0x76dacc[_0xf95a('0x22')];this[_0xf95a('0x23')]=_0x76dacc[_0xf95a('0x23')];this['dialAMDTotalAnalysisTime']=_0x76dacc[_0xf95a('0x24')];this[_0xf95a('0x25')]=_0x76dacc[_0xf95a('0x25')];this['dialAMDBetweenWordsSilence']=_0x76dacc[_0xf95a('0x26')];this[_0xf95a('0x27')]=_0x76dacc[_0xf95a('0x27')];this[_0xf95a('0x28')]=_0x76dacc[_0xf95a('0x28')];this[_0xf95a('0x29')]=_0x76dacc[_0xf95a('0x29')];}module[_0xf95a('0x2a')]=Campaign; \ No newline at end of file +var _0x9c02=['dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','temp','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x9c02,0x196));var _0x29c0=function(_0x548be4,_0x2342f8){_0x548be4=_0x548be4-0x0;var _0x59b6ed=_0x9c02[_0x548be4];return _0x59b6ed;};'use strict';function Campaign(_0x5c50f0){this['id']=_0x5c50f0['id']||0x0;this[_0x29c0('0x0')]=_0x5c50f0[_0x29c0('0x0')]||'';this['type']=_0x5c50f0['type']||'campaign';this['originated']=0x0;this[_0x29c0('0x1')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x29c0('0x2')]=0x0;this['message']='';this[_0x29c0('0x3')]=!![];this['active']=_0x5c50f0[_0x29c0('0x4')];this[_0x29c0('0x5')]=_0x5c50f0[_0x29c0('0x5')];this['dialTimezone']=_0x5c50f0['dialTimezone']||null;this[_0x29c0('0x6')]=_0x5c50f0[_0x29c0('0x6')]?_0x5c50f0[_0x29c0('0x6')]:null;this[_0x29c0('0x7')]=_0x5c50f0[_0x29c0('0x7')];this['dialOriginateCallerIdNumber']=_0x5c50f0['dialOriginateCallerIdNumber'];this[_0x29c0('0x8')]=_0x5c50f0['dialOriginateTimeout']||0x1e;this[_0x29c0('0x9')]=_0x5c50f0[_0x29c0('0x9')];this[_0x29c0('0xa')]=_0x5c50f0[_0x29c0('0xa')];this[_0x29c0('0xb')]=_0x5c50f0[_0x29c0('0xb')];this['dialBusyRetryFrequency']=_0x5c50f0[_0x29c0('0xc')];this[_0x29c0('0xd')]=_0x5c50f0[_0x29c0('0xd')];this[_0x29c0('0xe')]=_0x5c50f0[_0x29c0('0xe')];this[_0x29c0('0xf')]=_0x5c50f0[_0x29c0('0xf')];this[_0x29c0('0x10')]=_0x5c50f0[_0x29c0('0x10')]||_0x29c0('0x11');this[_0x29c0('0x12')]=_0x5c50f0[_0x29c0('0x12')]||undefined;this[_0x29c0('0x13')]=_0x5c50f0[_0x29c0('0x13')]||undefined;this[_0x29c0('0x14')]=_0x5c50f0[_0x29c0('0x14')]||undefined;this[_0x29c0('0x15')]=_0x5c50f0[_0x29c0('0x15')]?_0x5c50f0[_0x29c0('0x15')]:undefined;this[_0x29c0('0x16')]=_0x5c50f0[_0x29c0('0x16')]?_0x5c50f0[_0x29c0('0x16')]:undefined;this[_0x29c0('0x17')]=_0x5c50f0[_0x29c0('0x17')]?_0x5c50f0[_0x29c0('0x17')]:undefined;this[_0x29c0('0x18')]=_0x5c50f0[_0x29c0('0x18')]?_0x5c50f0['SquareProject']:undefined;this[_0x29c0('0x19')]=_0x5c50f0[_0x29c0('0x18')]?_0x5c50f0[_0x29c0('0x18')][_0x29c0('0x0')]:undefined;this[_0x29c0('0x1a')]=_0x5c50f0[_0x29c0('0x1a')]||![];this['dialAMDInitialSilence']=_0x5c50f0[_0x29c0('0x1b')];this[_0x29c0('0x1c')]=_0x5c50f0[_0x29c0('0x1c')];this[_0x29c0('0x1d')]=_0x5c50f0[_0x29c0('0x1d')];this['dialAMDTotalAnalysisTime']=_0x5c50f0[_0x29c0('0x1e')];this[_0x29c0('0x1f')]=_0x5c50f0['dialAMDMinWordLength'];this[_0x29c0('0x20')]=_0x5c50f0[_0x29c0('0x20')];this[_0x29c0('0x21')]=_0x5c50f0['dialAMDMaximumNumberOfWords'];this[_0x29c0('0x22')]=_0x5c50f0['dialAMDSilenceThreshold'];this[_0x29c0('0x23')]=_0x5c50f0[_0x29c0('0x23')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 0b5dd92..1d553ca 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 _0x11c8=['exten','answered','endtime','unmanaged','abandoned','lastapplication','holdtime','disposition','monitor','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x11c8,0x19a));var _0x811c=function(_0x43ed38,_0x507af1){_0x43ed38=_0x43ed38-0x0;var _0x181497=_0x11c8[_0x43ed38];return _0x181497;};'use strict';function Channel(){this['starttime']=null;this[_0x811c('0x0')]='';this[_0x811c('0x1')]='';this['calleridnum']=0x0;this[_0x811c('0x2')]='';this[_0x811c('0x3')]=undefined;this[_0x811c('0x4')]=undefined;this[_0x811c('0x5')]=0x0;this[_0x811c('0x6')]='';this[_0x811c('0x7')]=0x0;this['linkedid']=0x0;this[_0x811c('0x8')]=0x0;this[_0x811c('0x9')]=![];this['answertime']=null;this[_0x811c('0xa')]=null;this[_0x811c('0xb')]=![];this[_0x811c('0xc')]=![];this[_0x811c('0xd')]='';this['lastdata']='';this['duration']=0x0;this['billableseconds']=0x0;this[_0x811c('0xe')]=0x0;this['type']=null;this['tag']=null;this[_0x811c('0xf')]=null;this[_0x811c('0x10')]=![];this['monitorFilename']=null;this[_0x811c('0x11')]=null;this[_0x811c('0x12')]=[];this[_0x811c('0x13')]=undefined;this[_0x811c('0x14')]=undefined;this[_0x811c('0x15')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0xf61e=['connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answertime','endtime','abandoned','lastapplication','lastdata','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname'];(function(_0x199401,_0x3e0898){var _0x3f272a=function(_0x29ec35){while(--_0x29ec35){_0x199401['push'](_0x199401['shift']());}};_0x3f272a(++_0x3e0898);}(_0xf61e,0x191));var _0xef61=function(_0x18d2d0,_0x2c70cf){_0x18d2d0=_0x18d2d0-0x0;var _0x4361a4=_0xf61e[_0x18d2d0];return _0x4361a4;};'use strict';function Channel(){this[_0xef61('0x0')]=null;this[_0xef61('0x1')]='';this[_0xef61('0x2')]='';this[_0xef61('0x3')]=0x0;this[_0xef61('0x4')]='';this[_0xef61('0x5')]=undefined;this[_0xef61('0x6')]=undefined;this[_0xef61('0x7')]=0x0;this[_0xef61('0x8')]='';this[_0xef61('0x9')]=0x0;this[_0xef61('0xa')]=0x0;this[_0xef61('0xb')]=0x0;this['answered']=![];this[_0xef61('0xc')]=null;this[_0xef61('0xd')]=null;this['unmanaged']=![];this[_0xef61('0xe')]=![];this[_0xef61('0xf')]='';this[_0xef61('0x10')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0xef61('0x11')]=0x0;this[_0xef61('0x12')]=null;this[_0xef61('0x13')]=null;this[_0xef61('0x14')]=null;this[_0xef61('0x15')]=![];this[_0xef61('0x16')]=null;this[_0xef61('0x17')]=null;this[_0xef61('0x18')]=[];this[_0xef61('0x19')]=undefined;this[_0xef61('0x1a')]=undefined;this[_0xef61('0x1b')]=0x0;}module[_0xef61('0x1c')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 12aca5d..98adb3e 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 _0xaad5=['tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x56b4c5,_0x196587){var _0x485805=function(_0x258f4e){while(--_0x258f4e){_0x56b4c5['push'](_0x56b4c5['shift']());}};_0x485805(++_0x196587);}(_0xaad5,0x118));var _0x5aad=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0xaad5[_0x504df1];return _0x1063b5;};'use strict';function DeskAccount(_0x3d64ad){this['id']=_0x3d64ad['id']||0x0;this[_0x5aad('0x0')]=_0x3d64ad[_0x5aad('0x0')]||'';this[_0x5aad('0x1')]=_0x3d64ad['username']||'';this[_0x5aad('0x2')]=_0x3d64ad[_0x5aad('0x2')]||'';this[_0x5aad('0x3')]=_0x3d64ad[_0x5aad('0x3')]||'';this[_0x5aad('0x4')]=_0x3d64ad[_0x5aad('0x4')]||'';this[_0x5aad('0x5')]=_0x3d64ad[_0x5aad('0x5')]||'';this[_0x5aad('0x6')]=_0x3d64ad[_0x5aad('0x6')]||'';this[_0x5aad('0x7')]=_0x3d64ad[_0x5aad('0x7')]||'';this[_0x5aad('0x8')]=_0x3d64ad['tokenSecret']||'';this['type']=_0x3d64ad[_0x5aad('0x9')]||'';this[_0x5aad('0xa')]=_0x3d64ad[_0x5aad('0xa')]||'';this[_0x5aad('0xb')]=_0x3d64ad[_0x5aad('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x13ff=['type','serverUrl','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x24094c,_0x3d87c8){var _0x43ac2f=function(_0x552335){while(--_0x552335){_0x24094c['push'](_0x24094c['shift']());}};_0x43ac2f(++_0x3d87c8);}(_0x13ff,0x16e));var _0xf13f=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x13ff[_0x4ae625];return _0x31accf;};'use strict';function DeskAccount(_0x10227c){this['id']=_0x10227c['id']||0x0;this[_0xf13f('0x0')]=_0x10227c[_0xf13f('0x0')]||'';this[_0xf13f('0x1')]=_0x10227c[_0xf13f('0x1')]||'';this[_0xf13f('0x2')]=_0x10227c[_0xf13f('0x2')]||'';this[_0xf13f('0x3')]=_0x10227c[_0xf13f('0x3')]||'';this[_0xf13f('0x4')]=_0x10227c[_0xf13f('0x4')]||'';this[_0xf13f('0x5')]=_0x10227c['consumerKey']||'';this[_0xf13f('0x6')]=_0x10227c[_0xf13f('0x6')]||'';this[_0xf13f('0x7')]=_0x10227c[_0xf13f('0x7')]||'';this['tokenSecret']=_0x10227c['tokenSecret']||'';this[_0xf13f('0x8')]=_0x10227c[_0xf13f('0x8')]||'';this[_0xf13f('0x9')]=_0x10227c[_0xf13f('0x9')]||'';this['Configurations']=_0x10227c['Configurations']||{};}module[_0xf13f('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index eb24950..5f8fa2b 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 _0x1ccc=['clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId','clientId'];(function(_0x1b1a3b,_0x52a88a){var _0x385347=function(_0x4ca60a){while(--_0x4ca60a){_0x1b1a3b['push'](_0x1b1a3b['shift']());}};_0x385347(++_0x52a88a);}(_0x1ccc,0x158));var _0xc1cc=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x1ccc[_0x1b70e3];return _0x1452ab;};'use strict';function Dynamics365Account(_0x368bba){this['id']=_0x368bba['id']||0x0;this['name']=_0x368bba[_0xc1cc('0x0')]||'';this[_0xc1cc('0x1')]=_0x368bba[_0xc1cc('0x1')]||'';this[_0xc1cc('0x2')]=_0x368bba[_0xc1cc('0x2')]||'';this[_0xc1cc('0x3')]=_0x368bba[_0xc1cc('0x3')]||'';this[_0xc1cc('0x4')]=_0x368bba['tenantId']||'';this[_0xc1cc('0x5')]=_0x368bba[_0xc1cc('0x5')]||'';this['clientSecret']=_0x368bba[_0xc1cc('0x6')]||{};this[_0xc1cc('0x7')]=_0x368bba['serverUrl']||'';this[_0xc1cc('0x8')]=_0x368bba[_0xc1cc('0x8')]||{};}module[_0xc1cc('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x8e34=['tenantId','clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x37f98a,_0x5d0caa){var _0x2b2389=function(_0x2bfd60){while(--_0x2bfd60){_0x37f98a['push'](_0x37f98a['shift']());}};_0x2b2389(++_0x5d0caa);}(_0x8e34,0x1f4));var _0x48e3=function(_0x3135e1,_0x49be2e){_0x3135e1=_0x3135e1-0x0;var _0x32984a=_0x8e34[_0x3135e1];return _0x32984a;};'use strict';function Dynamics365Account(_0x5d10ea){this['id']=_0x5d10ea['id']||0x0;this[_0x48e3('0x0')]=_0x5d10ea[_0x48e3('0x0')]||'';this[_0x48e3('0x1')]=_0x5d10ea['username']||'';this[_0x48e3('0x2')]=_0x5d10ea[_0x48e3('0x2')]||'';this[_0x48e3('0x3')]=_0x5d10ea['remoteUri']||'';this[_0x48e3('0x4')]=_0x5d10ea[_0x48e3('0x4')]||'';this[_0x48e3('0x5')]=_0x5d10ea['clientId']||'';this[_0x48e3('0x6')]=_0x5d10ea[_0x48e3('0x6')]||{};this[_0x48e3('0x7')]=_0x5d10ea[_0x48e3('0x7')]||'';this[_0x48e3('0x8')]=_0x5d10ea[_0x48e3('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 29a51bc..8943791 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 _0xda3f=['minrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','ecm','headerinfo','localstationid'];(function(_0x1aac74,_0x323fc4){var _0x576f8c=function(_0x1a6fcc){while(--_0x1a6fcc){_0x1aac74['push'](_0x1aac74['shift']());}};_0x576f8c(++_0x323fc4);}(_0xda3f,0xec));var _0xfda3=function(_0x4009d6,_0x2f4f52){_0x4009d6=_0x4009d6-0x0;var _0x58a47a=_0xda3f[_0x4009d6];return _0x58a47a;};'use strict';function FaxAccount(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['description']=_0x33f0ce['description'];this['ecm']=_0x33f0ce[_0xfda3('0x1')];this['headerinfo']=_0x33f0ce[_0xfda3('0x2')];this[_0xfda3('0x3')]=_0x33f0ce['localstationid'];this[_0xfda3('0x4')]=_0x33f0ce[_0xfda3('0x4')]||0x960;this['maxrate']=_0x33f0ce['maxrate']||0x3840;this[_0xfda3('0x5')]=_0x33f0ce[_0xfda3('0x5')]||_0xfda3('0x6');this[_0xfda3('0x7')]=_0x33f0ce[_0xfda3('0x7')]||'no';this[_0xfda3('0x8')]=_0x33f0ce[_0xfda3('0x8')]||'no';this[_0xfda3('0x9')]=_0x33f0ce[_0xfda3('0x9')]||0x1388;this[_0xfda3('0xa')]=_0x33f0ce[_0xfda3('0xa')]||_0xfda3('0xb');this['Trunk']=_0x33f0ce[_0xfda3('0xc')]?_0x33f0ce[_0xfda3('0xc')]:undefined;this[_0xfda3('0xd')]=_0x33f0ce[_0xfda3('0xd')];this[_0xfda3('0xe')]=_0x33f0ce['key'];}module[_0xfda3('0xf')]=FaxAccount; \ No newline at end of file +var _0xd64b=['ecm','headerinfo','maxrate','modem','v17,v27,v29','gateway','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xd64b,0xc1));var _0xbd64=function(_0x4745d9,_0x411b00){_0x4745d9=_0x4745d9-0x0;var _0x38f2ac=_0xd64b[_0x4745d9];return _0x38f2ac;};'use strict';function FaxAccount(_0x272488){this['id']=_0x272488['id']||0x0;this['name']=_0x272488[_0xbd64('0x0')]||'';this['description']=_0x272488[_0xbd64('0x1')];this[_0xbd64('0x2')]=_0x272488[_0xbd64('0x2')];this[_0xbd64('0x3')]=_0x272488[_0xbd64('0x3')];this['localstationid']=_0x272488['localstationid'];this['minrate']=_0x272488['minrate']||0x960;this[_0xbd64('0x4')]=_0x272488[_0xbd64('0x4')]||0x3840;this[_0xbd64('0x5')]=_0x272488[_0xbd64('0x5')]||_0xbd64('0x6');this[_0xbd64('0x7')]=_0x272488[_0xbd64('0x7')]||'no';this['faxdetect']=_0x272488['faxdetect']||'no';this[_0xbd64('0x8')]=_0x272488[_0xbd64('0x8')]||0x1388;this[_0xbd64('0x9')]=_0x272488['tech']||_0xbd64('0xa');this[_0xbd64('0xb')]=_0x272488[_0xbd64('0xb')]?_0x272488[_0xbd64('0xb')]:undefined;this['ListId']=_0x272488[_0xbd64('0xc')];this['key']=_0x272488[_0xbd64('0xd')];}module[_0xbd64('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 10a8653..65567ee 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 _0x1e20=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x14ec8a,_0x54889a){var _0x4f9a85=function(_0x3bbd0f){while(--_0x3bbd0f){_0x14ec8a['push'](_0x14ec8a['shift']());}};_0x4f9a85(++_0x54889a);}(_0x1e20,0x18d));var _0x01e2=function(_0x56e2a8,_0x2cf877){_0x56e2a8=_0x56e2a8-0x0;var _0x232412=_0x1e20[_0x56e2a8];return _0x232412;};'use strict';function FreshdeskAccount(_0x210e9e){this['id']=_0x210e9e['id']||0x0;this[_0x01e2('0x0')]=_0x210e9e[_0x01e2('0x0')]||'';this['username']=_0x210e9e[_0x01e2('0x1')]||'';this[_0x01e2('0x2')]=_0x210e9e[_0x01e2('0x3')]||'';this[_0x01e2('0x4')]=_0x210e9e[_0x01e2('0x4')]||'';this[_0x01e2('0x5')]=_0x210e9e['serverUrl']||'';this[_0x01e2('0x6')]=_0x210e9e['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x1671=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0xc95ad4,_0x15279a){var _0x3f42ba=function(_0x3883f2){while(--_0x3883f2){_0xc95ad4['push'](_0xc95ad4['shift']());}};_0x3f42ba(++_0x15279a);}(_0x1671,0xeb));var _0x1167=function(_0x1db21b,_0x698792){_0x1db21b=_0x1db21b-0x0;var _0x3595f4=_0x1671[_0x1db21b];return _0x3595f4;};'use strict';function FreshdeskAccount(_0x5f1090){this['id']=_0x5f1090['id']||0x0;this['name']=_0x5f1090[_0x1167('0x0')]||'';this['username']=_0x5f1090[_0x1167('0x1')]||'';this[_0x1167('0x2')]=_0x5f1090[_0x1167('0x3')]||'';this['remoteUri']=_0x5f1090[_0x1167('0x4')]||'';this[_0x1167('0x5')]=_0x5f1090[_0x1167('0x5')]||'';this['Configurations']=_0x5f1090[_0x1167('0x6')]||{};}module[_0x1167('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 58bcfc9..e307eaf 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 _0x6609=['uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','accountcode','context','exten','priority','holdtime','assigned','mohtime','variables','exports','inbound'];(function(_0x256684,_0x529c1e){var _0x37a0c9=function(_0x4b431b){while(--_0x4b431b){_0x256684['push'](_0x256684['shift']());}};_0x37a0c9(++_0x529c1e);}(_0x6609,0xce));var _0x9660=function(_0x3fc378,_0x3c8ba5){_0x3fc378=_0x3fc378-0x0;var _0x371fc3=_0x6609[_0x3fc378];return _0x371fc3;};'use strict';function QueueReport(){this['type']=_0x9660('0x0');this[_0x9660('0x1')]='';this[_0x9660('0x2')]='';this[_0x9660('0x3')]='';this[_0x9660('0x4')]='';this['queuecallerjoinAt']=null;this[_0x9660('0x5')]=null;this[_0x9660('0x6')]=0x1;this['count']=0x1;this[_0x9660('0x7')]=![];this['queuecallerabandonAt']=null;this[_0x9660('0x8')]=![];this[_0x9660('0x9')]=null;this[_0x9660('0xa')]=![];this['queuecallerexitAt']=null;this[_0x9660('0xb')]=0x1;this[_0x9660('0xc')]='';this[_0x9660('0xd')]='';this['connectedlinename']='';this[_0x9660('0xe')]='';this[_0x9660('0xf')]='';this[_0x9660('0x10')]='';this[_0x9660('0x11')]='';this[_0x9660('0x12')]=0x0;this[_0x9660('0x13')]=![];this['lastAssignedTo']='';this[_0x9660('0x14')]=0x0;this[_0x9660('0x15')]={};}module[_0x9660('0x16')]=QueueReport; \ No newline at end of file +var _0xcaf0=['accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','variables','exports','type','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinename'];(function(_0x32307a,_0x420223){var _0x24a278=function(_0xea9128){while(--_0xea9128){_0x32307a['push'](_0x32307a['shift']());}};_0x24a278(++_0x420223);}(_0xcaf0,0xf9));var _0x0caf=function(_0x50a70c,_0x52491f){_0x50a70c=_0x50a70c-0x0;var _0x5a5813=_0xcaf0[_0x50a70c];return _0x5a5813;};'use strict';function QueueReport(){this[_0x0caf('0x0')]='inbound';this['uniqueid']='';this['calleridnum']='';this['calleridname']='';this[_0x0caf('0x1')]='';this[_0x0caf('0x2')]=null;this[_0x0caf('0x3')]=null;this['position']=0x1;this[_0x0caf('0x4')]=0x1;this[_0x0caf('0x5')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0x0caf('0x6')]=null;this[_0x0caf('0x7')]=![];this[_0x0caf('0x8')]=null;this['originalposition']=0x1;this[_0x0caf('0x9')]='';this['connectedlinenum']='';this[_0x0caf('0xa')]='';this[_0x0caf('0xb')]='';this[_0x0caf('0xc')]='';this[_0x0caf('0xd')]='';this[_0x0caf('0xe')]='';this[_0x0caf('0xf')]=0x0;this[_0x0caf('0x10')]=![];this[_0x0caf('0x11')]='';this['mohtime']=0x0;this[_0x0caf('0x12')]={};}module[_0x0caf('0x13')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 2cd14d6..eb6be0d 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 _0x7a19=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x1a16f8,_0x1801b7){var _0x46397c=function(_0x5bb383){while(--_0x5bb383){_0x1a16f8['push'](_0x1a16f8['shift']());}};_0x46397c(++_0x1801b7);}(_0x7a19,0x1eb));var _0x97a1=function(_0x59b1eb,_0x5c5cbe){_0x59b1eb=_0x59b1eb-0x0;var _0x33d88d=_0x7a19[_0x59b1eb];return _0x33d88d;};'use strict';function SalesforceAccount(_0x4692c7){this['id']=_0x4692c7['id']||0x0;this[_0x97a1('0x0')]=_0x4692c7['name']||'';this['username']=_0x4692c7[_0x97a1('0x1')]||'';this[_0x97a1('0x2')]=_0x4692c7[_0x97a1('0x2')]||'';this[_0x97a1('0x3')]=_0x4692c7[_0x97a1('0x3')]||'';this[_0x97a1('0x4')]=_0x4692c7[_0x97a1('0x4')]||'';this[_0x97a1('0x5')]=_0x4692c7[_0x97a1('0x5')]||'';this[_0x97a1('0x6')]=_0x4692c7[_0x97a1('0x6')]||'';this[_0x97a1('0x7')]=_0x4692c7[_0x97a1('0x7')]||_0x97a1('0x8');this[_0x97a1('0x9')]=_0x4692c7['serverUrl']||'';this[_0x97a1('0xa')]=_0x4692c7[_0x97a1('0xa')]||{};}module[_0x97a1('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x169a=['integrationTab','Configurations','name','username','password','clientId','clientSecret','securityToken','type'];(function(_0x11d71d,_0x2e22b4){var _0x1a0f88=function(_0x3357ab){while(--_0x3357ab){_0x11d71d['push'](_0x11d71d['shift']());}};_0x1a0f88(++_0x2e22b4);}(_0x169a,0x185));var _0xa169=function(_0x2dc097,_0x4e98aa){_0x2dc097=_0x2dc097-0x0;var _0x5bf945=_0x169a[_0x2dc097];return _0x5bf945;};'use strict';function SalesforceAccount(_0x40b47a){this['id']=_0x40b47a['id']||0x0;this['name']=_0x40b47a[_0xa169('0x0')]||'';this['username']=_0x40b47a[_0xa169('0x1')]||'';this['remoteUri']=_0x40b47a['remoteUri']||'';this[_0xa169('0x2')]=_0x40b47a[_0xa169('0x2')]||'';this[_0xa169('0x3')]=_0x40b47a[_0xa169('0x3')]||'';this[_0xa169('0x4')]=_0x40b47a['clientSecret']||'';this[_0xa169('0x5')]=_0x40b47a[_0xa169('0x5')]||'';this[_0xa169('0x6')]=_0x40b47a['type']||_0xa169('0x7');this['serverUrl']=_0x40b47a['serverUrl']||'';this[_0xa169('0x8')]=_0x40b47a[_0xa169('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 1cdf401..d1feb20 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 _0x2240=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x3302bd,_0x13af5c){var _0x11daea=function(_0x3901da){while(--_0x3901da){_0x3302bd['push'](_0x3302bd['shift']());}};_0x11daea(++_0x13af5c);}(_0x2240,0x13c));var _0x0224=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x2240[_0x24061a];return _0x82054e;};'use strict';function ServicenowAccount(_0xf07f28){this['id']=_0xf07f28['id']||0x0;this[_0x0224('0x0')]=_0xf07f28['name']||'';this[_0x0224('0x1')]=_0xf07f28[_0x0224('0x1')]||'';this[_0x0224('0x2')]=_0xf07f28[_0x0224('0x2')]||'';this[_0x0224('0x3')]=_0xf07f28[_0x0224('0x3')]||'';this[_0x0224('0x4')]=_0xf07f28['serverUrl']||'';this['Configurations']=_0xf07f28[_0x0224('0x5')]||{};}module[_0x0224('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x0997=['serverUrl','Configurations','exports','username','password','remoteUri'];(function(_0xeb76f,_0x149d04){var _0x1ed2f2=function(_0x181fdf){while(--_0x181fdf){_0xeb76f['push'](_0xeb76f['shift']());}};_0x1ed2f2(++_0x149d04);}(_0x0997,0x6f));var _0x7099=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0997[_0x20a584];return _0x4b41a8;};'use strict';function ServicenowAccount(_0x15f53b){this['id']=_0x15f53b['id']||0x0;this['name']=_0x15f53b['name']||'';this[_0x7099('0x0')]=_0x15f53b[_0x7099('0x0')]||'';this[_0x7099('0x1')]=_0x15f53b[_0x7099('0x1')]||'';this[_0x7099('0x2')]=_0x15f53b[_0x7099('0x2')]||'';this[_0x7099('0x3')]=_0x15f53b['serverUrl']||'';this[_0x7099('0x4')]=_0x15f53b[_0x7099('0x4')]||{};}module[_0x7099('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index fd26783..d84e4b2 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 _0x89eb=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x3d18d8,_0x49a428){var _0x19b715=function(_0x15d88c){while(--_0x15d88c){_0x3d18d8['push'](_0x3d18d8['shift']());}};_0x19b715(++_0x49a428);}(_0x89eb,0xf9));var _0xb89e=function(_0x5e7321,_0x23689b){_0x5e7321=_0x5e7321-0x0;var _0xd93a73=_0x89eb[_0x5e7321];return _0xd93a73;};'use strict';function SugarcrmAccount(_0x20e626){this['id']=_0x20e626['id']||0x0;this[_0xb89e('0x0')]=_0x20e626[_0xb89e('0x0')]||'';this[_0xb89e('0x1')]=_0x20e626[_0xb89e('0x1')]||'';this['password']=_0x20e626[_0xb89e('0x2')]||'';this[_0xb89e('0x3')]=_0x20e626[_0xb89e('0x3')]||'';this[_0xb89e('0x4')]=_0x20e626['serverUrl']||'';this[_0xb89e('0x5')]=_0x20e626[_0xb89e('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xe204=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x5c69cb,_0x148d28){var _0x9c8579=function(_0x575234){while(--_0x575234){_0x5c69cb['push'](_0x5c69cb['shift']());}};_0x9c8579(++_0x148d28);}(_0xe204,0x167));var _0x4e20=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe204[_0x59ee6f];return _0x4c0979;};'use strict';function SugarcrmAccount(_0x36a613){this['id']=_0x36a613['id']||0x0;this[_0x4e20('0x0')]=_0x36a613[_0x4e20('0x0')]||'';this[_0x4e20('0x1')]=_0x36a613[_0x4e20('0x1')]||'';this[_0x4e20('0x2')]=_0x36a613[_0x4e20('0x2')]||'';this[_0x4e20('0x3')]=_0x36a613['remoteUri']||'';this[_0x4e20('0x4')]=_0x36a613[_0x4e20('0x4')]||'';this[_0x4e20('0x5')]=_0x36a613[_0x4e20('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 6d894a1..01088bb 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 _0x4eb7=['state','unknown','status','address','exports','name','accountcode'];(function(_0x1551bc,_0x334b59){var _0x228deb=function(_0x15551d){while(--_0x15551d){_0x1551bc['push'](_0x1551bc['shift']());}};_0x228deb(++_0x334b59);}(_0x4eb7,0x147));var _0x74eb=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x4eb7[_0x50a0c2];return _0x5ebadd;};'use strict';function Telephone(_0x5e47b8){this['id']=_0x5e47b8['id']||0x0;this[_0x74eb('0x0')]=_0x5e47b8[_0x74eb('0x0')]||'';this[_0x74eb('0x1')]=_0x5e47b8[_0x74eb('0x1')]||'';this[_0x74eb('0x2')]=_0x74eb('0x3');this['stateTime']=0x0;this[_0x74eb('0x4')]=_0x74eb('0x3');this[_0x74eb('0x5')]='';}module[_0x74eb('0x6')]=Telephone; \ No newline at end of file +var _0x27fb=['address','exports','name','accountcode','unknown','stateTime'];(function(_0x112147,_0x4e692e){var _0x3ba744=function(_0x191b87){while(--_0x191b87){_0x112147['push'](_0x112147['shift']());}};_0x3ba744(++_0x4e692e);}(_0x27fb,0x1c4));var _0xb27f=function(_0x52878a,_0x58a737){_0x52878a=_0x52878a-0x0;var _0x33ff68=_0x27fb[_0x52878a];return _0x33ff68;};'use strict';function Telephone(_0x37c042){this['id']=_0x37c042['id']||0x0;this[_0xb27f('0x0')]=_0x37c042[_0xb27f('0x0')]||'';this[_0xb27f('0x1')]=_0x37c042[_0xb27f('0x1')]||'';this['state']=_0xb27f('0x2');this[_0xb27f('0x3')]=0x0;this['status']=_0xb27f('0x2');this[_0xb27f('0x4')]='';}module[_0xb27f('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 79230e5..0f96496 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 _0xd2ea=['html','name'];(function(_0x31a3d4,_0x4fb946){var _0x4a968d=function(_0x1ad523){while(--_0x1ad523){_0x31a3d4['push'](_0x31a3d4['shift']());}};_0x4a968d(++_0x4fb946);}(_0xd2ea,0x15f));var _0xad2e=function(_0x63b751,_0x96b44){_0x63b751=_0x63b751-0x0;var _0x564b98=_0xd2ea[_0x63b751];return _0x564b98;};'use strict';function template(_0x4107ae){this['id']=_0x4107ae['id']||0x0;this[_0xad2e('0x0')]=_0x4107ae[_0xad2e('0x0')]||'';this[_0xad2e('0x1')]=_0x4107ae[_0xad2e('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0x4522=['name','html'];(function(_0x3963e3,_0x2efad8){var _0x53e070=function(_0x4c5008){while(--_0x4c5008){_0x3963e3['push'](_0x3963e3['shift']());}};_0x53e070(++_0x2efad8);}(_0x4522,0x1a0));var _0x2452=function(_0x9336f8,_0x286899){_0x9336f8=_0x9336f8-0x0;var _0x32adbb=_0x4522[_0x9336f8];return _0x32adbb;};'use strict';function template(_0x2606f1){this['id']=_0x2606f1['id']||0x0;this['name']=_0x2606f1[_0x2452('0x0')]||'';this[_0x2452('0x1')]=_0x2606f1[_0x2452('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 d15de87..ec81a71 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 _0x20be=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x4d9af4,_0x443c6c){var _0x38d92e=function(_0x3910c4){while(--_0x3910c4){_0x4d9af4['push'](_0x4d9af4['shift']());}};_0x38d92e(++_0x443c6c);}(_0x20be,0xc7));var _0xe20b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x20be[_0x167cc1];return _0x10bc4b;};'use strict';function Trigger(_0x53c283){this['id']=_0x53c283['id']||0x0;this['name']=_0x53c283[_0xe20b('0x0')]||'';this[_0xe20b('0x1')]=_0x53c283[_0xe20b('0x1')]||_0xe20b('0x2');this[_0xe20b('0x3')]=_0x53c283[_0xe20b('0x3')]||![];this[_0xe20b('0x4')]=_0x53c283[_0xe20b('0x4')]||[];this[_0xe20b('0x5')]=_0x53c283['AnyConditions']||[];this[_0xe20b('0x6')]=_0x53c283['Actions']||[];}module[_0xe20b('0x7')]=Trigger; \ No newline at end of file +var _0x72ae=['name','channel','voice','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x46c164,_0x1a1b01){var _0xed7462=function(_0x63c6b0){while(--_0x63c6b0){_0x46c164['push'](_0x46c164['shift']());}};_0xed7462(++_0x1a1b01);}(_0x72ae,0x130));var _0xe72a=function(_0x2d6942,_0x2b87dc){_0x2d6942=_0x2d6942-0x0;var _0x1a97b4=_0x72ae[_0x2d6942];return _0x1a97b4;};'use strict';function Trigger(_0x1d3dee){this['id']=_0x1d3dee['id']||0x0;this[_0xe72a('0x0')]=_0x1d3dee[_0xe72a('0x0')]||'';this[_0xe72a('0x1')]=_0x1d3dee[_0xe72a('0x1')]||_0xe72a('0x2');this[_0xe72a('0x3')]=_0x1d3dee[_0xe72a('0x3')]||![];this[_0xe72a('0x4')]=_0x1d3dee[_0xe72a('0x4')]||[];this[_0xe72a('0x5')]=_0x1d3dee[_0xe72a('0x5')]||[];this[_0xe72a('0x6')]=_0x1d3dee[_0xe72a('0x6')]||[];}module[_0xe72a('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 05da821..e6ed49d 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 _0xe8d7=['port','domainport','refresh','stateRegistry','registrationtime','address','active','name','state','stateTime','status','unknown','registry','indexOf','split','host'];(function(_0x445101,_0x2414bf){var _0x3c3d04=function(_0x249067){while(--_0x249067){_0x445101['push'](_0x445101['shift']());}};_0x3c3d04(++_0x2414bf);}(_0xe8d7,0x186));var _0x7e8d=function(_0x3e74d6,_0xe1ce2c){_0x3e74d6=_0x3e74d6-0x0;var _0x55c422=_0xe8d7[_0x3e74d6];return _0x55c422;};'use strict';function Trunk(_0xf875e2){this['id']=_0xf875e2['id']||0x0;this[_0x7e8d('0x0')]=_0xf875e2[_0x7e8d('0x0')]||![];this['name']=_0xf875e2[_0x7e8d('0x1')]||'';this[_0x7e8d('0x2')]='unknown';this[_0x7e8d('0x3')]=0x0;this[_0x7e8d('0x4')]=_0x7e8d('0x5');this[_0x7e8d('0x6')]=_0xf875e2[_0x7e8d('0x6')]&&_0xf875e2[_0x7e8d('0x6')][_0x7e8d('0x7')](':')?_0xf875e2['registry'][_0x7e8d('0x8')](':')[0x0]:'';this[_0x7e8d('0x9')]='';this[_0x7e8d('0xa')]='';this['domain']='';this[_0x7e8d('0xb')]='';this[_0x7e8d('0xc')]='';this[_0x7e8d('0xd')]=_0x7e8d('0x5');this[_0x7e8d('0xe')]='';this[_0x7e8d('0xf')]='';}module['exports']=Trunk; \ No newline at end of file +var _0xefd1=['name','unknown','stateTime','status','registry','split','host','domainport','registrationtime','address','active'];(function(_0xc753c8,_0x5627ff){var _0xd02f5c=function(_0xfb552e){while(--_0xfb552e){_0xc753c8['push'](_0xc753c8['shift']());}};_0xd02f5c(++_0x5627ff);}(_0xefd1,0x1a1));var _0x1efd=function(_0x32854c,_0x1ceeea){_0x32854c=_0x32854c-0x0;var _0x1b3012=_0xefd1[_0x32854c];return _0x1b3012;};'use strict';function Trunk(_0x11cfc5){this['id']=_0x11cfc5['id']||0x0;this[_0x1efd('0x0')]=_0x11cfc5['active']||![];this[_0x1efd('0x1')]=_0x11cfc5['name']||'';this['state']=_0x1efd('0x2');this[_0x1efd('0x3')]=0x0;this[_0x1efd('0x4')]='unknown';this[_0x1efd('0x5')]=_0x11cfc5[_0x1efd('0x5')]&&_0x11cfc5[_0x1efd('0x5')]['indexOf'](':')?_0x11cfc5[_0x1efd('0x5')][_0x1efd('0x6')](':')[0x0]:'';this[_0x1efd('0x7')]='';this['port']='';this['domain']='';this[_0x1efd('0x8')]='';this['refresh']='';this['stateRegistry']='unknown';this[_0x1efd('0x9')]='';this[_0x1efd('0xa')]='';}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 92702b6..3a75651 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 _0x6e75=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x17609f,_0x26cdf5){var _0x227ace=function(_0x22ae38){while(--_0x22ae38){_0x17609f['push'](_0x17609f['shift']());}};_0x227ace(++_0x26cdf5);}(_0x6e75,0x1b7));var _0x56e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e75[_0x14add3];return _0x4a174f;};'use strict';function voiceExtension(_0xc74d27){this['id']=_0xc74d27['id']||0x0;this[_0x56e7('0x0')]=_0xc74d27['exten']||'';this[_0x56e7('0x1')]=_0xc74d27[_0x56e7('0x1')]||'none';this[_0x56e7('0x2')]=_0xc74d27[_0x56e7('0x2')]||![];}module[_0x56e7('0x3')]=voiceExtension; \ No newline at end of file +var _0x3566=['recordingFormat','mandatoryDisposition','exten'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x3566,0x197));var _0x6356=function(_0x34d389,_0x4b9dd3){_0x34d389=_0x34d389-0x0;var _0x476045=_0x3566[_0x34d389];return _0x476045;};'use strict';function voiceExtension(_0x179e68){this['id']=_0x179e68['id']||0x0;this[_0x6356('0x0')]=_0x179e68[_0x6356('0x0')]||'';this[_0x6356('0x1')]=_0x179e68[_0x6356('0x1')]||'none';this[_0x6356('0x2')]=_0x179e68['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 2cd2af5..b49ec4f 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 _0x8681=['outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalLowerLimit','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav49','gsm','rrmemory','roundrobin','name','inbound','waiting','total','sumDuration','sumHoldTime','sumBillable','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay'];(function(_0x407387,_0x25cfbf){var _0x2cdaf4=function(_0x2c80a0){while(--_0x2c80a0){_0x407387['push'](_0x407387['shift']());}};_0x2cdaf4(++_0x25cfbf);}(_0x8681,0x89));var _0x1868=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0x8681[_0xb6e43];return _0x47c40f;};'use strict';var statusDesc=[_0x1868('0x0'),'not_inuse',_0x1868('0x1'),_0x1868('0x2'),_0x1868('0x3'),_0x1868('0x4'),_0x1868('0x5'),_0x1868('0x6'),_0x1868('0x7')];var monitorFormat={'wav':'wav','wav49':_0x1868('0x8'),'gsm':_0x1868('0x9')};var strategy={'rrmemory':_0x1868('0xa'),'roundrobin':_0x1868('0xb')};function VoiceQueue(_0x57a96b){this['id']=_0x57a96b['id']||0x0;this[_0x1868('0xc')]=_0x57a96b[_0x1868('0xc')]||'';this['monitor_format']=_0x57a96b['monitor_format']||'';this['type']=_0x57a96b['type']||_0x1868('0xd');this[_0x1868('0xe')]=0x0;this['talking']=0x0;this[_0x1868('0xf')]=0x0;this['answered']=0x0;this[_0x1868('0x10')]=0x0;this[_0x1868('0x11')]=0x0;this[_0x1868('0x12')]=0x0;this['unmanaged']=0x0;this[_0x1868('0x13')]=0x0;this['loggedIn']=0x0;this[_0x1868('0x14')]=0x0;this[_0x1868('0x15')]=_0x57a96b[_0x1868('0x15')]||![];this[_0x1868('0x16')]=_0x57a96b[_0x1868('0x16')]||0xa;this[_0x1868('0x17')]=_0x57a96b[_0x1868('0x17')]||'no';this[_0x1868('0x18')]=!![];this[_0x1868('0x19')]='';this[_0x1868('0x1a')]=0x0;this[_0x1868('0x1b')]=0x0;this[_0x1868('0x1c')]=_0x57a96b[_0x1868('0x1c')]||null;this['dialGlobalInterval']=_0x57a96b[_0x1868('0x1d')]?_0x57a96b[_0x1868('0x1d')]:null;this[_0x1868('0x1e')]=_0x57a96b['dialActive'];this['dialMethod']=_0x57a96b['dialMethod']||'progressive';this['dialLimitChannel']=_0x57a96b[_0x1868('0x1f')]||0x0;this['dialLimitQueue']=_0x57a96b[_0x1868('0x20')]||0x0;this[_0x1868('0x21')]=_0x57a96b[_0x1868('0x21')]||0x1;this[_0x1868('0x22')]=_0x57a96b['dialPredictiveOptimization']||'dropRate';this[_0x1868('0x23')]=_0x57a96b[_0x1868('0x23')]||0.03;this[_0x1868('0x24')]=_0x57a96b['dialPredictiveInterval']||0x258;this[_0x1868('0x25')]=_0x57a96b[_0x1868('0x25')]||_0x1868('0x26');this[_0x1868('0x27')]=_0x57a96b[_0x1868('0x27')]||_0x1868('0x26');this[_0x1868('0x28')]=_0x57a96b['dialOriginateTimeout']||0x1e;this[_0x1868('0x29')]=_0x57a96b['dialQueueOptions']||_0x1868('0x2a');this['dialQueueTimeout']=_0x57a96b[_0x1868('0x2b')]||0x3;this['dialQueueProject']=_0x57a96b['dialQueueProject']||undefined;this[_0x1868('0x2c')]=_0x57a96b[_0x1868('0x2c')]||0x3;this[_0x1868('0x2d')]=_0x57a96b[_0x1868('0x2d')]||0x96;this[_0x1868('0x2e')]=_0x57a96b[_0x1868('0x2e')]||0x3;this[_0x1868('0x2f')]=_0x57a96b[_0x1868('0x2f')]||0x96;this[_0x1868('0x30')]=_0x57a96b[_0x1868('0x30')]||0x3;this[_0x1868('0x31')]=_0x57a96b[_0x1868('0x31')]||0x96;this['dialGlobalMaxRetry']=_0x57a96b[_0x1868('0x32')]||0x4;this[_0x1868('0x33')]=_0x57a96b[_0x1868('0x33')]?_0x57a96b[_0x1868('0x33')]:undefined;this[_0x1868('0x34')]=_0x57a96b[_0x1868('0x34')]?_0x57a96b[_0x1868('0x34')]:undefined;this[_0x1868('0x35')]=_0x57a96b[_0x1868('0x35')]||undefined;this[_0x1868('0x36')]=_0x57a96b[_0x1868('0x36')]?_0x57a96b[_0x1868('0x36')]:undefined;this[_0x1868('0x37')]=_0x57a96b[_0x1868('0x37')]||_0x1868('0x38');this[_0x1868('0x39')]=_0x57a96b[_0x1868('0x39')]||undefined;this[_0x1868('0x3a')]=_0x57a96b['dialCutDigit']||undefined;this[_0x1868('0x3b')]=strategy[_0x57a96b[_0x1868('0x3b')]]||_0x1868('0xa');this[_0x1868('0x3c')]=!![];this['dialAMDActive']=_0x57a96b[_0x1868('0x3d')]||![];this[_0x1868('0x3e')]=_0x57a96b[_0x1868('0x3e')];this[_0x1868('0x3f')]=_0x57a96b[_0x1868('0x3f')];this[_0x1868('0x40')]=_0x57a96b[_0x1868('0x40')];this['dialAMDTotalAnalysisTime']=_0x57a96b['dialAMDTotalAnalysisTime'];this[_0x1868('0x41')]=_0x57a96b[_0x1868('0x41')];this[_0x1868('0x42')]=_0x57a96b[_0x1868('0x42')];this[_0x1868('0x43')]=_0x57a96b[_0x1868('0x43')];this['dialAMDSilenceThreshold']=_0x57a96b[_0x1868('0x44')];this[_0x1868('0x45')]=_0x57a96b[_0x1868('0x45')];this['outboundRejectCallsDay']=0x0;this[_0x1868('0x46')]=0x0;this[_0x1868('0x47')]=_0x57a96b['timeout'];this[_0x1868('0x48')]=0x0;this[_0x1868('0x49')]=0x0;this[_0x1868('0x4a')]=0x0;this[_0x1868('0x4b')]=0x0;this[_0x1868('0x4c')]=0x0;this[_0x1868('0x4d')]=0x0;this[_0x1868('0x4e')]=0x0;this[_0x1868('0x4f')]=0x0;this[_0x1868('0x50')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x1868('0x51')]=0x0;this[_0x1868('0x52')]=0x0;this[_0x1868('0x53')]=undefined;this['startPredictive']=undefined;this[_0x1868('0x54')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x1868('0x55')]=0x0;this[_0x1868('0x56')]=0x0;this[_0x1868('0x57')]=0x0;this[_0x1868('0x58')]=0x0;this[_0x1868('0x59')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x1868('0x5a')]=0x0;this[_0x1868('0x5b')]=0.4;this['predictiveIntervalErlangCalls']=0x0;this[_0x1868('0x5c')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x1868('0x5d')]=0x0;this[_0x1868('0x5e')]=0x0;this[_0x1868('0x5f')]=0x0;this['erlangBusyFactor']=0x0;this[_0x1868('0x60')]=_0x57a96b[_0x1868('0x60')]||0x1e;this[_0x1868('0x61')]=_0x57a96b['dialRecallInQueue']||![];this[_0x1868('0x62')]=_0x57a96b[_0x1868('0x62')]||undefined;this[_0x1868('0x63')]=_0x57a96b[_0x1868('0x63')]||![];this[_0x1868('0x64')]=_0x57a96b['dialAgiAfterHangupAgent']||![];this[_0x1868('0x65')]=monitorFormat[_0x57a96b['monitor_format']]?monitorFormat[_0x57a96b[_0x1868('0x65')]]:undefined;this[_0x1868('0x66')]=_0x57a96b['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x57a96b['mandatoryDispositionPause']?_0x57a96b[_0x1868('0x67')]:undefined;}module[_0x1868('0x68')]=VoiceQueue; \ No newline at end of file +var _0x822e=['abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalLowerLimit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumBillable'];(function(_0x58fe28,_0x49f38b){var _0x15cd2f=function(_0x563388){while(--_0x563388){_0x58fe28['push'](_0x58fe28['shift']());}};_0x15cd2f(++_0x49f38b);}(_0x822e,0x192));var _0xe822=function(_0x3d5cbb,_0x449a65){_0x3d5cbb=_0x3d5cbb-0x0;var _0x4d306c=_0x822e[_0x3d5cbb];return _0x4d306c;};'use strict';var statusDesc=['unknown',_0xe822('0x0'),_0xe822('0x1'),_0xe822('0x2'),_0xe822('0x3'),_0xe822('0x4'),_0xe822('0x5'),_0xe822('0x6'),_0xe822('0x7')];var monitorFormat={'wav':_0xe822('0x8'),'wav49':_0xe822('0x9'),'gsm':_0xe822('0xa')};var strategy={'rrmemory':_0xe822('0xb'),'roundrobin':_0xe822('0xc')};function VoiceQueue(_0x1486d0){this['id']=_0x1486d0['id']||0x0;this[_0xe822('0xd')]=_0x1486d0[_0xe822('0xd')]||'';this[_0xe822('0xe')]=_0x1486d0[_0xe822('0xe')]||'';this[_0xe822('0xf')]=_0x1486d0[_0xe822('0xf')]||_0xe822('0x10');this['waiting']=0x0;this[_0xe822('0x11')]=0x0;this[_0xe822('0x12')]=0x0;this[_0xe822('0x13')]=0x0;this[_0xe822('0x14')]=0x0;this['sumHoldTime']=0x0;this[_0xe822('0x15')]=0x0;this['unmanaged']=0x0;this[_0xe822('0x16')]=0x0;this[_0xe822('0x17')]=0x0;this[_0xe822('0x18')]=0x0;this[_0xe822('0x19')]=_0x1486d0[_0xe822('0x19')]||![];this[_0xe822('0x1a')]=_0x1486d0['acwTimeout']||0xa;this[_0xe822('0x1b')]=_0x1486d0[_0xe822('0x1b')]||'no';this[_0xe822('0x1c')]=!![];this[_0xe822('0x1d')]='';this['originated']=0x0;this['temp']=0x0;this[_0xe822('0x1e')]=_0x1486d0[_0xe822('0x1e')]||null;this[_0xe822('0x1f')]=_0x1486d0[_0xe822('0x1f')]?_0x1486d0[_0xe822('0x1f')]:null;this[_0xe822('0x20')]=_0x1486d0[_0xe822('0x20')];this[_0xe822('0x21')]=_0x1486d0[_0xe822('0x21')]||_0xe822('0x22');this['dialLimitChannel']=_0x1486d0[_0xe822('0x23')]||0x0;this[_0xe822('0x24')]=_0x1486d0[_0xe822('0x24')]||0x0;this[_0xe822('0x25')]=_0x1486d0[_0xe822('0x25')]||0x1;this[_0xe822('0x26')]=_0x1486d0[_0xe822('0x26')]||_0xe822('0x27');this['dialPredictiveOptimizationPercentage']=_0x1486d0['dialPredictiveOptimizationPercentage']||0.03;this[_0xe822('0x28')]=_0x1486d0['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x1486d0['dialOriginateCallerIdName']||'anonymous';this['dialOriginateCallerIdNumber']=_0x1486d0[_0xe822('0x29')]||'anonymous';this[_0xe822('0x2a')]=_0x1486d0[_0xe822('0x2a')]||0x1e;this[_0xe822('0x2b')]=_0x1486d0[_0xe822('0x2b')]||_0xe822('0x2c');this[_0xe822('0x2d')]=_0x1486d0[_0xe822('0x2d')]||0x3;this[_0xe822('0x2e')]=_0x1486d0['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x1486d0[_0xe822('0x2f')]||0x3;this[_0xe822('0x30')]=_0x1486d0['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x1486d0[_0xe822('0x31')]||0x3;this[_0xe822('0x32')]=_0x1486d0[_0xe822('0x32')]||0x96;this[_0xe822('0x33')]=_0x1486d0[_0xe822('0x33')]||0x3;this['dialNoAnswerRetryFrequency']=_0x1486d0[_0xe822('0x34')]||0x96;this['dialGlobalMaxRetry']=_0x1486d0[_0xe822('0x35')]||0x4;this[_0xe822('0x36')]=_0x1486d0[_0xe822('0x36')]?_0x1486d0[_0xe822('0x36')]:undefined;this[_0xe822('0x37')]=_0x1486d0[_0xe822('0x37')]?_0x1486d0[_0xe822('0x37')]:undefined;this[_0xe822('0x38')]=_0x1486d0['dialPrefix']||undefined;this[_0xe822('0x39')]=_0x1486d0[_0xe822('0x39')]?_0x1486d0[_0xe822('0x39')]:undefined;this[_0xe822('0x3a')]=_0x1486d0['dialOrderByScheduledAt']||_0xe822('0x3b');this['dialRandomLastDigitCallerIdNumber']=_0x1486d0[_0xe822('0x3c')]||undefined;this['dialCutDigit']=_0x1486d0[_0xe822('0x3d')]||undefined;this['strategy']=strategy[_0x1486d0['strategy']]||_0xe822('0xb');this[_0xe822('0x3e')]=!![];this[_0xe822('0x3f')]=_0x1486d0[_0xe822('0x3f')]||![];this['dialAMDInitialSilence']=_0x1486d0[_0xe822('0x40')];this[_0xe822('0x41')]=_0x1486d0['dialAMDGreeting'];this[_0xe822('0x42')]=_0x1486d0[_0xe822('0x42')];this['dialAMDTotalAnalysisTime']=_0x1486d0[_0xe822('0x43')];this[_0xe822('0x44')]=_0x1486d0[_0xe822('0x44')];this[_0xe822('0x45')]=_0x1486d0[_0xe822('0x45')];this[_0xe822('0x46')]=_0x1486d0[_0xe822('0x46')];this[_0xe822('0x47')]=_0x1486d0['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x1486d0[_0xe822('0x48')];this[_0xe822('0x49')]=0x0;this[_0xe822('0x4a')]=0x0;this[_0xe822('0x4b')]=_0x1486d0[_0xe822('0x4b')];this['outboundAnswerCallsDay']=0x0;this[_0xe822('0x4c')]=0x0;this[_0xe822('0x4d')]=0x0;this[_0xe822('0x4e')]=0x0;this[_0xe822('0x4f')]=0x0;this[_0xe822('0x50')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xe822('0x51')]=0x0;this[_0xe822('0x52')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xe822('0x53')]=0x0;this[_0xe822('0x54')]=0x0;this[_0xe822('0x55')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0xe822('0x56')]=undefined;this[_0xe822('0x57')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xe822('0x58')]=0x0;this[_0xe822('0x59')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xe822('0x5a')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xe822('0x5b')]=0.4;this['predictiveIntervalErlangCalls']=0x0;this[_0xe822('0x5c')]=0x0;this[_0xe822('0x5d')]=0x1;this[_0xe822('0x5e')]=0x0;this[_0xe822('0x5f')]=0x0;this[_0xe822('0x60')]=0x0;this[_0xe822('0x61')]=0x0;this[_0xe822('0x62')]=_0x1486d0[_0xe822('0x62')]||0x1e;this[_0xe822('0x63')]=_0x1486d0[_0xe822('0x63')]||![];this[_0xe822('0x64')]=_0x1486d0[_0xe822('0x64')]||undefined;this[_0xe822('0x65')]=_0x1486d0['dialAgiAfterHangupClient']||![];this[_0xe822('0x66')]=_0x1486d0[_0xe822('0x66')]||![];this[_0xe822('0xe')]=monitorFormat[_0x1486d0['monitor_format']]?monitorFormat[_0x1486d0[_0xe822('0xe')]]:undefined;this[_0xe822('0x67')]=_0x1486d0[_0xe822('0x67')]||![];this[_0xe822('0x68')]=_0x1486d0[_0xe822('0x68')]?_0x1486d0[_0xe822('0x68')]:undefined;}module[_0xe822('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 79556f7..cc66e23 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 _0x9fb6=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x9fb6,0xaa));var _0x69fb=function(_0x10c0c3,_0x9c8cf7){_0x10c0c3=_0x10c0c3-0x0;var _0x5b42d3=_0x9fb6[_0x10c0c3];return _0x5b42d3;};'use strict';function VtigerAccount(_0x4d79d4){this['id']=_0x4d79d4['id']||0x0;this[_0x69fb('0x0')]=_0x4d79d4['name']||'';this[_0x69fb('0x1')]=_0x4d79d4[_0x69fb('0x1')]||'';this[_0x69fb('0x2')]=_0x4d79d4[_0x69fb('0x2')]||'';this[_0x69fb('0x3')]=_0x4d79d4[_0x69fb('0x3')]||'';this[_0x69fb('0x4')]=_0x4d79d4[_0x69fb('0x4')]||'';this[_0x69fb('0x5')]=_0x4d79d4['Configurations']||{};}module[_0x69fb('0x6')]=VtigerAccount; \ No newline at end of file +var _0xe1a0=['remoteUri','exports','name','username','accessKey'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe1a0,0x110));var _0x0e1a=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0xe1a0[_0x2a5b3b];return _0xae665a;};'use strict';function VtigerAccount(_0x19b54c){this['id']=_0x19b54c['id']||0x0;this[_0x0e1a('0x0')]=_0x19b54c['name']||'';this[_0x0e1a('0x1')]=_0x19b54c[_0x0e1a('0x1')]||'';this[_0x0e1a('0x2')]=_0x19b54c[_0x0e1a('0x2')]||'';this[_0x0e1a('0x3')]=_0x19b54c[_0x0e1a('0x3')]||'';this['serverUrl']=_0x19b54c['serverUrl']||'';this['Configurations']=_0x19b54c['Configurations']||{};}module[_0x0e1a('0x4')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index ed74f5e..bc4c95b 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 _0xccf8=['serverUrl','Configurations','name','username','password','token','remoteUri','authType','type','integrationTab'];(function(_0x485abd,_0x32c7c1){var _0x3379f1=function(_0x36b528){while(--_0x36b528){_0x485abd['push'](_0x485abd['shift']());}};_0x3379f1(++_0x32c7c1);}(_0xccf8,0x156));var _0x8ccf=function(_0x3a804b,_0x615538){_0x3a804b=_0x3a804b-0x0;var _0x5ed165=_0xccf8[_0x3a804b];return _0x5ed165;};'use strict';function ZendeskAccount(_0x5c7076){this['id']=_0x5c7076['id']||0x0;this[_0x8ccf('0x0')]=_0x5c7076['name']||'';this[_0x8ccf('0x1')]=_0x5c7076[_0x8ccf('0x1')]||'';this[_0x8ccf('0x2')]=_0x5c7076[_0x8ccf('0x2')]||'';this[_0x8ccf('0x3')]=_0x5c7076[_0x8ccf('0x3')]||'';this['remoteUri']=_0x5c7076[_0x8ccf('0x4')]||'';this[_0x8ccf('0x5')]=_0x5c7076[_0x8ccf('0x5')]||'';this[_0x8ccf('0x6')]=_0x5c7076[_0x8ccf('0x6')]||_0x8ccf('0x7');this['serverUrl']=_0x5c7076[_0x8ccf('0x8')]||'';this[_0x8ccf('0x9')]=_0x5c7076['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0xc023=['type','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x35afeb,_0x36a9c6){var _0x579723=function(_0x564861){while(--_0x564861){_0x35afeb['push'](_0x35afeb['shift']());}};_0x579723(++_0x36a9c6);}(_0xc023,0x162));var _0x3c02=function(_0x39b007,_0x45f4a8){_0x39b007=_0x39b007-0x0;var _0x26f00d=_0xc023[_0x39b007];return _0x26f00d;};'use strict';function ZendeskAccount(_0x4d919f){this['id']=_0x4d919f['id']||0x0;this['name']=_0x4d919f[_0x3c02('0x0')]||'';this[_0x3c02('0x1')]=_0x4d919f['username']||'';this['password']=_0x4d919f[_0x3c02('0x2')]||'';this[_0x3c02('0x3')]=_0x4d919f[_0x3c02('0x3')]||'';this[_0x3c02('0x4')]=_0x4d919f['remoteUri']||'';this['authType']=_0x4d919f[_0x3c02('0x5')]||'';this[_0x3c02('0x6')]=_0x4d919f[_0x3c02('0x6')]||'integrationTab';this['serverUrl']=_0x4d919f[_0x3c02('0x7')]||'';this[_0x3c02('0x8')]=_0x4d919f['Configurations']||{};}module[_0x3c02('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 8978db7..47e7462 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 _0x2542=['exports','name','authToken','host','Configurations','serverUrl'];(function(_0x1a868b,_0x2bdbc2){var _0x2fe828=function(_0x195e43){while(--_0x195e43){_0x1a868b['push'](_0x1a868b['shift']());}};_0x2fe828(++_0x2bdbc2);}(_0x2542,0x169));var _0x2254=function(_0x6fc3e7,_0x1618df){_0x6fc3e7=_0x6fc3e7-0x0;var _0xc3d3c0=_0x2542[_0x6fc3e7];return _0xc3d3c0;};'use strict';function ZohoAccount(_0x326732){this['id']=_0x326732['id']||0x0;this[_0x2254('0x0')]=_0x326732[_0x2254('0x0')]||'';this[_0x2254('0x1')]=_0x326732['authToken']||'';this[_0x2254('0x2')]=_0x326732['host']||'';this[_0x2254('0x3')]=_0x326732[_0x2254('0x3')]||{};this[_0x2254('0x4')]=_0x326732[_0x2254('0x4')]||'';}module[_0x2254('0x5')]=ZohoAccount; \ No newline at end of file +var _0x814b=['host','Configurations','serverUrl','exports','name','authToken'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x814b,0x1a2));var _0xb814=function(_0x1667df,_0x266940){_0x1667df=_0x1667df-0x0;var _0x341abf=_0x814b[_0x1667df];return _0x341abf;};'use strict';function ZohoAccount(_0x451d2a){this['id']=_0x451d2a['id']||0x0;this[_0xb814('0x0')]=_0x451d2a[_0xb814('0x0')]||'';this[_0xb814('0x1')]=_0x451d2a[_0xb814('0x1')]||'';this[_0xb814('0x2')]=_0x451d2a['host']||'';this[_0xb814('0x3')]=_0x451d2a[_0xb814('0x3')]||{};this[_0xb814('0x4')]=_0x451d2a[_0xb814('0x4')]||'';}module[_0xb814('0x5')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index f798dc0..e88aa59 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 _0x12dc=['dialAnswer','membername','Agent','name','channelAgent','format','calleridname','phone','Contact','lastName','active','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil','string','uniqueid','idContact','queue','type'];(function(_0x332eb9,_0x5aadbe){var _0x37816c=function(_0x4d25c8){while(--_0x4d25c8){_0x332eb9['push'](_0x332eb9['shift']());}};_0x37816c(++_0x5aadbe);}(_0x12dc,0x1cc));var _0xc12d=function(_0x3a6cec,_0x3b299e){_0x3a6cec=_0x3a6cec-0x0;var _0x5a69dd=_0x12dc[_0x3a6cec];return _0x5a69dd;};'use strict';var util=require('util');var _=require(_0xc12d('0x0'));var moment=require(_0xc12d('0x1'));function checkNameSurname(_0x59c7be,_0x51ab2c,_0x3033e7){var _0x3a5ce8='';if(!_[_0xc12d('0x2')](_0x51ab2c)&&_0xc12d('0x3')===typeof _0x51ab2c){_0x3a5ce8+=_0x51ab2c;}if(!_['isNil'](_0x3033e7)&&_0xc12d('0x3')===typeof _0x3033e7){_0x3a5ce8+='\x20'+_0x3033e7;}if(_0x3a5ce8!==''){return _0x3a5ce8;}return _0x59c7be;}function Action(_0x3cf4aa,_0x3e7cf8,_0x51cec2,_0x540468,_0x57a748){this[_0xc12d('0x4')]=_0x51cec2||undefined;this[_0xc12d('0x5')]=_0x3cf4aa['id'];this[_0xc12d('0x6')]=_0x3e7cf8['name'];this['type']=_0x3e7cf8[_0xc12d('0x7')];this['campaigntype']=_0xc12d('0x6');this[_0xc12d('0x8')]=![];this[_0xc12d('0x9')]=_[_0xc12d('0x2')](_0x3cf4aa['Agent'])?undefined:_0x3cf4aa[_0xc12d('0xa')][_0xc12d('0xb')];this[_0xc12d('0xc')]=this[_0xc12d('0x9')]?util[_0xc12d('0xd')]('SIP/%s',this[_0xc12d('0x9')]):_0x540468||undefined;this[_0xc12d('0xe')]=checkNameSurname(_0x3cf4aa['Contact'][_0xc12d('0xf')],_0x3cf4aa[_0xc12d('0x10')]['firstName'],_0x3cf4aa['Contact'][_0xc12d('0x11')]);this[_0xc12d('0x12')]=_0x3cf4aa[_0xc12d('0x12')]||![];this[_0xc12d('0x13')]=_0x3cf4aa[_0xc12d('0x10')][_0xc12d('0xf')];this['scheduledat']=_0x3cf4aa['scheduledat'];this[_0xc12d('0x14')]=_0x3cf4aa[_0xc12d('0x14')]||0x0;this[_0xc12d('0x15')]=_0x3cf4aa['countcongestionretry']||0x0;this[_0xc12d('0x16')]=_0x3cf4aa[_0xc12d('0x16')]||0x0;this[_0xc12d('0x17')]=(_0x3cf4aa[_0xc12d('0x14')]||0x0)+(_0x3cf4aa[_0xc12d('0x15')]||0x0)+(_0x3cf4aa['countnoanswerretry']||0x0);this[_0xc12d('0x18')]=_0x3cf4aa[_0xc12d('0x18')];this['callbackuniqueid']=_0x3cf4aa[_0xc12d('0x19')];this[_0xc12d('0x1a')]=_0x3cf4aa[_0xc12d('0x1a')];this[_0xc12d('0x1b')]=_0x3cf4aa['recallme'];this[_0xc12d('0x1c')]=_0x3cf4aa[_0xc12d('0x1c')];this[_0xc12d('0x1d')]=_0x3cf4aa[_0xc12d('0x1d')];this[_0xc12d('0x1e')]=_['isNil'](_0x3cf4aa[_0xc12d('0xa')])?_0x3cf4aa[_0xc12d('0x1e')]:_0x3cf4aa[_0xc12d('0xa')]['id'];this[_0xc12d('0x1f')]=_0x3cf4aa[_0xc12d('0x1f')];this[_0xc12d('0x20')]='';this[_0xc12d('0x21')]='';}Action[_0xc12d('0x22')][_0xc12d('0x23')]=function(){return util[_0xc12d('0xd')](_0xc12d('0x24'),this[_0xc12d('0xe')],this[_0xc12d('0x25')]);};module[_0xc12d('0x26')]=Action; \ No newline at end of file +var _0x33e3=['name','type','campaigntype','queue','membername','Agent','format','calleridname','Contact','firstName','lastName','active','calleridnum','phone','countbusyretry','countnoanswerretry','countcongestionretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string'];(function(_0x5d25f8,_0x45ceaf){var _0x5d887c=function(_0x31ac76){while(--_0x31ac76){_0x5d25f8['push'](_0x5d25f8['shift']());}};_0x5d887c(++_0x45ceaf);}(_0x33e3,0x1e5));var _0x333e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x33e3[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x333e('0x0'));var _=require(_0x333e('0x1'));var moment=require(_0x333e('0x2'));function checkNameSurname(_0x52d1c3,_0x598568,_0x578426){var _0x2c793d='';if(!_['isNil'](_0x598568)&&'string'===typeof _0x598568){_0x2c793d+=_0x598568;}if(!_[_0x333e('0x3')](_0x578426)&&_0x333e('0x4')===typeof _0x578426){_0x2c793d+='\x20'+_0x578426;}if(_0x2c793d!==''){return _0x2c793d;}return _0x52d1c3;}function Action(_0x46afab,_0x460d75,_0x47cde8,_0x2c3f1d,_0x4078c8){this['uniqueid']=_0x47cde8||undefined;this['idContact']=_0x46afab['id'];this['queue']=_0x460d75[_0x333e('0x5')];this[_0x333e('0x6')]=_0x460d75[_0x333e('0x6')];this[_0x333e('0x7')]=_0x333e('0x8');this['dialAnswer']=![];this[_0x333e('0x9')]=_[_0x333e('0x3')](_0x46afab[_0x333e('0xa')])?undefined:_0x46afab['Agent'][_0x333e('0x5')];this['channelAgent']=this[_0x333e('0x9')]?util[_0x333e('0xb')]('SIP/%s',this[_0x333e('0x9')]):_0x2c3f1d||undefined;this[_0x333e('0xc')]=checkNameSurname(_0x46afab[_0x333e('0xd')]['phone'],_0x46afab['Contact'][_0x333e('0xe')],_0x46afab[_0x333e('0xd')][_0x333e('0xf')]);this[_0x333e('0x10')]=_0x46afab[_0x333e('0x10')]||![];this[_0x333e('0x11')]=_0x46afab['Contact'][_0x333e('0x12')];this['scheduledat']=_0x46afab['scheduledat'];this['countbusyretry']=_0x46afab[_0x333e('0x13')]||0x0;this['countcongestionretry']=_0x46afab['countcongestionretry']||0x0;this['countnoanswerretry']=_0x46afab[_0x333e('0x14')]||0x0;this['countglobal']=(_0x46afab[_0x333e('0x13')]||0x0)+(_0x46afab[_0x333e('0x15')]||0x0)+(_0x46afab['countnoanswerretry']||0x0);this[_0x333e('0x16')]=_0x46afab[_0x333e('0x16')];this['callbackuniqueid']=_0x46afab[_0x333e('0x17')];this[_0x333e('0x18')]=_0x46afab[_0x333e('0x18')];this[_0x333e('0x19')]=_0x46afab[_0x333e('0x19')];this[_0x333e('0x1a')]=_0x46afab[_0x333e('0x1a')];this[_0x333e('0x1b')]=_0x46afab['ListId'];this[_0x333e('0x1c')]=_[_0x333e('0x3')](_0x46afab['Agent'])?_0x46afab[_0x333e('0x1c')]:_0x46afab[_0x333e('0xa')]['id'];this[_0x333e('0x1d')]=_0x46afab[_0x333e('0x1d')];this['originatecalleridnum']='';this[_0x333e('0x1e')]='';}Action['prototype'][_0x333e('0x1f')]=function(){return util['format'](_0x333e('0x20'),this[_0x333e('0xc')],this[_0x333e('0x21')]);};module[_0x333e('0x22')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index a93dbc6..9bd44cf 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 _0xa7cb=['NoSuchNumber','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','buildObj','total','[16]','Answer','talktime','sumBillable','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','unlockAgent','activeContact','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','rescheduleContact','scheduledAt','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','createAgentHistory','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','then','[Preview][execCall][success]','Queue:\x20','called','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','unmonitored','execRun','pick','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','logLookAgent','isFailure','response','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','name','active','callerid','Interval','format','voice:queue:%s','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','message','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','queue','originated:\x20','stringify','pTalking:\x20','dialAnswer','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal'];(function(_0x5bf26f,_0x267112){var _0x27e602=function(_0xf874ce){while(--_0xf874ce){_0x5bf26f['push'](_0x5bf26f['shift']());}};_0x27e602(++_0x267112);}(_0xa7cb,0x1d0));var _0xba7c=function(_0x4ea728,_0x3ba8a8){_0x4ea728=_0x4ea728-0x0;var _0x290764=_0xa7cb[_0x4ea728];return _0x290764;};'use strict';var util=require(_0xba7c('0x0'));var _=require('lodash');var BPromise=require(_0xba7c('0x1'));var uuid=require(_0xba7c('0x2'));var moment=require('moment');var md5=require(_0xba7c('0x3'));var Redis=require(_0xba7c('0x4'));var config=require(_0xba7c('0x5'));var logger=require(_0xba7c('0x6'))(_0xba7c('0x7'));var loggerAction=require('../../../config/logger')(_0xba7c('0x8'));var ami=require('../ami');var rpcDb=require(_0xba7c('0x9'));var Action=require(_0xba7c('0xa'));var ut=require(_0xba7c('0xb'));config[_0xba7c('0xc')]=_[_0xba7c('0xd')](config['redis'],{'host':_0xba7c('0xe'),'port':0x18eb});var io=require(_0xba7c('0xf'))(new Redis(config[_0xba7c('0xc')]));var Sequence=function(){};Sequence['prototype'][_0xba7c('0x10')]=function(_0x602979){this[_0xba7c('0x11')]=this[_0xba7c('0x11')]?this['tail'][_0xba7c('0x12')](_0x602979):_0x602979();};function Preview(_0x3b6a6b){this[_0xba7c('0x13')]=new Sequence();this[_0xba7c('0x14')]=_0x3b6a6b[_0xba7c('0x15')];this[_0xba7c('0x16')]=_0x3b6a6b[_0xba7c('0x16')];this[_0xba7c('0x17')]={};this['agents']=_0x3b6a6b[_0xba7c('0x18')];this[_0xba7c('0x19')]=0x0;ami['on'](_0xba7c('0x1a'),this[_0xba7c('0x1b')]['bind'](this));ami['on'](_0xba7c('0x1c'),this[_0xba7c('0x1d')][_0xba7c('0x1e')](this));ami['on'](_0xba7c('0x1f'),this['syncHangupRequest'][_0xba7c('0x1e')](this));ami['on'](_0xba7c('0x20'),this[_0xba7c('0x21')][_0xba7c('0x1e')](this));ami['on'](_0xba7c('0x22'),this[_0xba7c('0x23')][_0xba7c('0x1e')](this));ami['on']('varset',this[_0xba7c('0x24')][_0xba7c('0x1e')](this));ami['on'](_0xba7c('0x25'),this[_0xba7c('0x26')][_0xba7c('0x1e')](this));ami['on']('blindtransfer',this[_0xba7c('0x27')]['bind'](this));this[_0xba7c('0x28')](this[_0xba7c('0x14')]);}function emit(_0x10954b,_0x6a27ff,_0x402794){io['to'](_0x10954b)[_0xba7c('0x29')](_0x6a27ff,_0x402794);}function emitCampaignPreview(_0x29ff7c){if(_0x29ff7c[_0xba7c('0x2a')]===_0xba7c('0x2b')){var _0x15aa56={'id':_0x29ff7c['id'],'name':_0x29ff7c['name'],'strategy':_0x29ff7c[_0xba7c('0x2c')],'answered':_0x29ff7c[_0xba7c('0x2d')],'available':_0x29ff7c[_0xba7c('0x2e')],'loggedIn':_0x29ff7c[_0xba7c('0x2f')],'pTalking':_0x29ff7c[_0xba7c('0x30')],'sumBillable':_0x29ff7c['sumBillable'],'sumDuration':_0x29ff7c[_0xba7c('0x31')],'sumHoldTime':_0x29ff7c['sumHoldTime']||0x0,'talking':_0x29ff7c[_0xba7c('0x32')],'total':_0x29ff7c['total'],'type':_0x29ff7c[_0xba7c('0x2a')],'unmanaged':_0x29ff7c[_0xba7c('0x33')],'abandoned':_0x29ff7c[_0xba7c('0x34')],'waiting':_0x29ff7c[_0xba7c('0x35')],'loggedInDb':_0x29ff7c[_0xba7c('0x36')],'dialActive':_0x29ff7c[_0xba7c('0x37')],'dialMethod':_0x29ff7c[_0xba7c('0x38')],'dialOriginateCallerIdName':_0x29ff7c[_0xba7c('0x39')],'dialOriginateCallerIdNumber':_0x29ff7c[_0xba7c('0x3a')],'dialOriginateTimeout':_0x29ff7c[_0xba7c('0x3b')],'dialPrefix':_0x29ff7c[_0xba7c('0x3c')],'outboundAnswerAgiCallsDay':_0x29ff7c[_0xba7c('0x3d')],'outboundAnswerCallsDay':_0x29ff7c[_0xba7c('0x3e')],'outboundBlacklistCallsDay':_0x29ff7c[_0xba7c('0x3f')],'outboundBusyCallsDay':_0x29ff7c[_0xba7c('0x40')],'outboundCongestionCallsDay':_0x29ff7c[_0xba7c('0x41')],'outboundDropCallsDayACS':_0x29ff7c[_0xba7c('0x42')],'outboundDropCallsDayCallersExit':_0x29ff7c[_0xba7c('0x43')],'outboundDropCallsDayTimeout':_0x29ff7c['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x29ff7c[_0xba7c('0x44')],'outboundNoSuchCallsDay':_0x29ff7c[_0xba7c('0x45')],'outboundOriginateFailureCallsDay':_0x29ff7c[_0xba7c('0x46')],'outboundReCallsDay':_0x29ff7c[_0xba7c('0x47')],'outboundRejectCallsDay':_0x29ff7c[_0xba7c('0x48')],'outboundUnknownCallsDay':_0x29ff7c[_0xba7c('0x49')],'predictiveIntervalAnsweredCalls':_0x29ff7c[_0xba7c('0x4a')],'predictiveIntervalAvgHoldtime':_0x29ff7c[_0xba7c('0x4b')],'predictiveIntervalAvgTalktime':_0x29ff7c[_0xba7c('0x4c')],'predictiveIntervalDroppedCallsCallersExit':_0x29ff7c[_0xba7c('0x4d')],'predictiveIntervalDroppedCallsTimeout':_0x29ff7c[_0xba7c('0x4e')],'predictiveIntervalErlangCalls':_0x29ff7c[_0xba7c('0x4f')],'predictiveIntervalErlangCallsDroppedCalls':_0x29ff7c[_0xba7c('0x50')],'predictiveIntervalHitRate':_0x29ff7c[_0xba7c('0x51')],'predictiveIntervalLowerLimit':_0x29ff7c[_0xba7c('0x52')],'predictiveIntervalMultiplicativeFactor':_0x29ff7c[_0xba7c('0x53')],'predictiveIntervalPauses':_0x29ff7c[_0xba7c('0x54')],'predictiveIntervalTotalCalls':_0x29ff7c[_0xba7c('0x55')],'message':_0x29ff7c['message'],'originated':_0x29ff7c[_0xba7c('0x56')]};if(_0x29ff7c[_0xba7c('0x57')]){_0x15aa56[_0xba7c('0x57')]={'id':_0x29ff7c[_0xba7c('0x57')]['id'],'name':_0x29ff7c[_0xba7c('0x57')][_0xba7c('0x58')],'active':_0x29ff7c[_0xba7c('0x57')][_0xba7c('0x59')],'callerid':_0x29ff7c[_0xba7c('0x57')][_0xba7c('0x5a')]};}if(_0x29ff7c['Interval']){_0x15aa56['Interval']={'id':_0x29ff7c['Interval']['id'],'name':_0x29ff7c[_0xba7c('0x5b')][_0xba7c('0x58')]};}var _0x45feb7=md5(JSON['stringify'](_0x15aa56));if(_0x29ff7c[_0xba7c('0x3')]!==_0x45feb7){_0x29ff7c[_0xba7c('0x3')]=_0x45feb7;emit(util[_0xba7c('0x5c')](_0xba7c('0x5d'),_0x15aa56[_0xba7c('0x58')]),'voice_queue:save',_0x15aa56);}}}function emitVoiceQueueChannelRemove(_0x3a305f){emit(util['format'](_0xba7c('0x5d'),_0x3a305f[_0xba7c('0x58')]),'voice_queue_channel:remove',_0x3a305f);}function notSendMessagesQueue(_0x40caf8){if(_0x40caf8[_0xba7c('0x5e')]){if(_0x40caf8[_0xba7c('0x56')]===0x0&&_0x40caf8[_0xba7c('0x30')]===0x0){_0x40caf8[_0xba7c('0x5e')]=![];_0x40caf8[_0xba7c('0x2e')]=0x0;_0x40caf8['paused']=0x0;_0x40caf8['message']=_0xba7c('0x5f');ut[_0xba7c('0x60')](_0xba7c('0x61'),_0x40caf8['name']+'\x20is\x20not\x20active');}else{_0x40caf8[_0xba7c('0x62')]=_0xba7c('0x63');ut[_0xba7c('0x60')](_0xba7c('0x61'),_0x40caf8[_0xba7c('0x58')]+_0xba7c('0x64'));}emitCampaignPreview(_0x40caf8);}}Preview['prototype']['loopCampaigns']=function(){var _0x39d793=this;setInterval(function(){_0x39d793['syncCampaigns']();},0x7cf);};Preview[_0xba7c('0x65')][_0xba7c('0x66')]=function(){var _0x504e8b=this[_0xba7c('0x14')];this[_0xba7c('0x19')]+=0x1;for(var _0x2d2108 in _0x504e8b){if(_0x504e8b[_0xba7c('0x67')](_0x2d2108)&&(_0x504e8b[_0x2d2108][_0xba7c('0x38')]===_0xba7c('0x7')||_0x504e8b[_0x2d2108]['dialMethod']===_0xba7c('0x68'))&&_0x504e8b[_0x2d2108][_0xba7c('0x2a')]===_0xba7c('0x2b')){if(this[_0xba7c('0x19')]>0x7){this[_0xba7c('0x19')]=0x0;this[_0xba7c('0x69')]();}}if(_0x504e8b['hasOwnProperty'](_0x2d2108)&&_0x504e8b[_0x2d2108][_0xba7c('0x38')]===_0xba7c('0x7')&&_0x504e8b[_0x2d2108][_0xba7c('0x2a')]===_0xba7c('0x2b')){if(_0x504e8b[_0x2d2108][_0xba7c('0x37')]){this[_0xba7c('0x6a')](_0x504e8b[_0x2d2108]);this[_0xba7c('0x6b')](_0x504e8b[_0x2d2108]);}else{notSendMessagesQueue(_0x504e8b[_0x2d2108]);}}}};Preview['prototype'][_0xba7c('0x6c')]=function(_0x29de6f){var _0x790d19=this;this[_0xba7c('0x13')][_0xba7c('0x10')](function(){if(!_[_0xba7c('0x6d')](_0x790d19['actions'][_0x29de6f])){loggerAction[_0xba7c('0x6e')](_0xba7c('0x6f'),_0x29de6f,'Queue',_0x790d19[_0xba7c('0x17')][_0x29de6f][_0xba7c('0x70')],_0xba7c('0x71'),JSON[_0xba7c('0x72')](_0x790d19[_0xba7c('0x14')][_0x790d19[_0xba7c('0x17')][_0x29de6f][_0xba7c('0x70')]][_0xba7c('0x56')]),_0xba7c('0x73'),JSON[_0xba7c('0x72')](_0x790d19[_0xba7c('0x14')][_0x790d19[_0xba7c('0x17')][_0x29de6f]['queue']][_0xba7c('0x30')]),JSON['stringify'](_0x790d19[_0xba7c('0x17')][_0x29de6f][_0xba7c('0x74')]),JSON[_0xba7c('0x72')](_['pick'](_0x790d19[_0xba7c('0x17')][_0x29de6f],[_0xba7c('0x75'),_0xba7c('0x76'),_0xba7c('0x77'),_0xba7c('0x78')])));return ami[_0xba7c('0x79')]({'action':_0xba7c('0x7a'),'channel':_0x790d19[_0xba7c('0x17')][_0x29de6f][_0xba7c('0x7b')]})[_0xba7c('0x7c')](function(_0xa0e4c8){if(_0xa0e4c8['message']===_0xba7c('0x7d')){setTimeout(function(){if(_0x790d19['actions'][_0x29de6f]){ut[_0xba7c('0x7e')](_0x790d19[_0xba7c('0x14')][_0x790d19[_0xba7c('0x17')][_0x29de6f][_0xba7c('0x70')]],_0xba7c('0x7f'));if(_0x790d19[_0xba7c('0x17')][_0x29de6f][_0xba7c('0x74')]===!![]){ut[_0xba7c('0x80')](_0x790d19['campaignsPreview'][_0x790d19['actions'][_0x29de6f][_0xba7c('0x70')]],_0xba7c('0x7f'));ut[_0xba7c('0x81')](_0xba7c('0x82')+_0x29de6f,_0x790d19[_0xba7c('0x17')][_0x29de6f][_0xba7c('0x70')]);}ut[_0xba7c('0x81')](_0xba7c('0x83')+_0x29de6f,_0x790d19[_0xba7c('0x17')][_0x29de6f][_0xba7c('0x70')]);delete _0x790d19[_0xba7c('0x17')][_0x29de6f];}},0x2328);}});}});};Preview[_0xba7c('0x65')]['clearZombieChannels']=function(){var _0x13c092=this;loggerAction[_0xba7c('0x6e')](_0xba7c('0x84'),_['size'](this[_0xba7c('0x17')]));for(var _0x2cfb5 in this['actions']){if(_0x13c092[_0xba7c('0x17')][_0xba7c('0x67')](_0x2cfb5)){_0x13c092['clearZombieChannel'](_0x2cfb5);}}};Preview[_0xba7c('0x65')][_0xba7c('0x6b')]=function(_0x32e7f8){var _0xb0f9d0=this;rpcDb[_0xba7c('0x85')](_0x32e7f8['id'],ut[_0xba7c('0x86')](this[_0xba7c('0x18')]))['then'](function(_0x1508f2){if(!_['isNil'](_0x1508f2)){for(var _0x2cd056=0x0;_0x2cd056<_0x1508f2[_0xba7c('0x87')];_0x2cd056+=0x1){if(ut[_0xba7c('0x88')](_0x1508f2[_0x2cd056][_0xba7c('0x89')])<_0x32e7f8[_0xba7c('0x8a')]*0x3c){_0xb0f9d0[_0xba7c('0x8b')](_0x1508f2[_0x2cd056]['id'])['then'](ut[_0xba7c('0x8c')](_0xba7c('0x8d')))[_0xba7c('0x7c')](ut[_0xba7c('0x8c')](_0xba7c('0x8d')));}else{var _0x57f936=new Action(_0x1508f2[_0x2cd056],_0x32e7f8);_0x57f936[_0xba7c('0x8e')]=moment()[_0xba7c('0x5c')](_0xba7c('0x8f'));_0x32e7f8[_0xba7c('0x47')]+=0x1;ut[_0xba7c('0x90')](_0x57f936,0x17,_0xba7c('0x91'));if(_0x32e7f8[_0xba7c('0x92')]){rpcDb[_0xba7c('0x93')](ut[_0xba7c('0x94')](_0x1508f2[_0x2cd056]));rpcDb['createCustomerHistory'](_0x57f936,_0xba7c('0x95'));}else{ut[_0xba7c('0x90')](_0x57f936,0x16,'RecallFailedTimeout');rpcDb[_0xba7c('0x96')](_0x57f936,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x57f936,_0xba7c('0x97'));}}}}})[_0xba7c('0x7c')](ut['logger2'](_0xba7c('0x98')));};Preview[_0xba7c('0x65')]['setMessage']=function(_0xe5bccc){_0xe5bccc['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0xe5bccc[_0xba7c('0x2f')])){_0xe5bccc['message']='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0xe5bccc[_0xba7c('0x37')])){_0xe5bccc['message']=_0xba7c('0x5f');}else if(!this[_0xba7c('0x99')](_0xe5bccc[_0xba7c('0x57')])){if(!this[_0xba7c('0x99')](_0xe5bccc[_0xba7c('0x9a')])){_0xe5bccc[_0xba7c('0x62')]=_0xba7c('0x9b');}else{_0xe5bccc[_0xba7c('0x62')]=_0xba7c('0x9c');}}else{_0xe5bccc[_0xba7c('0x62')]=_0xba7c('0x9c');}emitCampaignPreview(_0xe5bccc);};Preview[_0xba7c('0x65')][_0xba7c('0x9d')]=function(_0x9d8891,_0x2f7f57,_0x1cb26e){var _0x2526cc=this;var _0x3a6bfb=this['actions'][_0x2f7f57];var _0x18ecf7=this[_0xba7c('0x14')][_0x3a6bfb[_0xba7c('0x70')]];var _0x39a43a;if(_0x18ecf7){switch(_0x1cb26e){case'1':_0x18ecf7[_0xba7c('0x45')]+=0x1;_0x3a6bfb[_0xba7c('0x9e')]=ut[_0xba7c('0x9f')](_0x3a6bfb);ut[_0xba7c('0x90')](_0x3a6bfb,0x0,_0xba7c('0xa0'));rpcDb['createCustomerHistory'](_0x3a6bfb,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xba7c('0x9f')](_0x3a6bfb)>=_0x18ecf7[_0xba7c('0xa1')]){_0x39a43a=ut[_0xba7c('0xa2')](_0x3a6bfb,0xf,_0xba7c('0xa3'));rpcDb[_0xba7c('0xa4')](_0x39a43a,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xba7c('0xa4')](_0x3a6bfb,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this['actions'][_0x9d8891[_0xba7c('0xa5')]];break;case _0xba7c('0xa6'):var _0x111e95=moment()[_0xba7c('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3a6bfb[_0xba7c('0xa7')]=_0x111e95;_0x3a6bfb['answertime']=_0x111e95;_0x3a6bfb[_0xba7c('0x74')]=!![];_0x18ecf7[_0xba7c('0x30')]+=0x1;logger[_0xba7c('0x6e')](_0xba7c('0xa8'),_0x3a6bfb[_0xba7c('0xa9')],_0xba7c('0xaa'),_0x18ecf7[_0xba7c('0x58')],_0xba7c('0x73'),_0x18ecf7[_0xba7c('0x30')]);ami[_0xba7c('0x29')](_0xba7c('0xab'),ut['buildObj'](_0x3a6bfb,'connect'));if(_0x18ecf7['acw']){ami[_0xba7c('0x29')](_0xba7c('0xac'),ut[_0xba7c('0xad')](_0x3a6bfb));}break;case'16':ami['emit'](_0xba7c('0xae'),ut['buildObj'](_0x3a6bfb,_0xba7c('0xaf')));emitVoiceQueueChannelRemove(ut[_0xba7c('0xb0')](_0x3a6bfb,_0xba7c('0xaf')));_0x18ecf7['outboundAnswerCallsDay']+=0x1;_0x18ecf7[_0xba7c('0xb1')]+=0x1;_0x18ecf7['answered']+=0x1;ut[_0xba7c('0x80')](_0x18ecf7,_0xba7c('0xb2'));_0x3a6bfb[_0xba7c('0x9e')]=ut['totalGlobal'](_0x3a6bfb);ut['logCustomer'](_0x3a6bfb,0x4,_0xba7c('0xb3'));rpcDb['createCustomerHistory'](_0x3a6bfb,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xba7c('0xa4')](_0x3a6bfb,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x3a6bfb);_0x18ecf7[_0xba7c('0x31')]+=_0x3a6bfb[_0xba7c('0xb4')];_0x18ecf7[_0xba7c('0xb5')]+=_0x3a6bfb[_0xba7c('0xb4')];logger[_0xba7c('0x6e')](_0xba7c('0xb6'),_0x3a6bfb[_0xba7c('0xa9')],_0xba7c('0xaa'),_0x18ecf7[_0xba7c('0x58')],'pTalking:\x20',_0x18ecf7[_0xba7c('0x30')]);delete this['actions'][_0x9d8891[_0xba7c('0xa5')]];break;case _0xba7c('0xb7'):_0x18ecf7[_0xba7c('0x40')]+=0x1;_0x3a6bfb[_0xba7c('0xb8')]+=0x1;_0x3a6bfb[_0xba7c('0x9e')]=ut[_0xba7c('0x9f')](_0x3a6bfb);ut['logCustomer'](_0x3a6bfb,0x5,_0xba7c('0xb9'));rpcDb[_0xba7c('0x96')](_0x3a6bfb,_0xba7c('0xba'));if(ut[_0xba7c('0x9f')](_0x3a6bfb)>=_0x18ecf7[_0xba7c('0xa1')]){_0x39a43a=ut['cloneAction'](_0x3a6bfb,0xf,_0xba7c('0xa3'));rpcDb[_0xba7c('0xa4')](_0x39a43a,_0xba7c('0xbb'));}else{if(_0x3a6bfb['countbusyretry']>=_0x18ecf7['dialBusyMaxRetry']){rpcDb[_0xba7c('0xa4')](_0x3a6bfb,_0xba7c('0xba'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3a6bfb,_0xba7c('0xb8'),_0x18ecf7[_0xba7c('0xbc')]),_0x3a6bfb[_0xba7c('0xbd')],_0x3a6bfb[_0xba7c('0xbe')]);}}break;case'NOANSWER':_0x18ecf7[_0xba7c('0x44')]+=0x1;_0x3a6bfb[_0xba7c('0xbf')]+=0x1;_0x3a6bfb[_0xba7c('0x9e')]=ut[_0xba7c('0x9f')](_0x3a6bfb);ut[_0xba7c('0x90')](_0x3a6bfb,0x3,'NoAnswer');rpcDb[_0xba7c('0x96')](_0x3a6bfb,_0xba7c('0xc0'));if(ut['totalGlobal'](_0x3a6bfb)>=_0x18ecf7[_0xba7c('0xa1')]){_0x39a43a=ut[_0xba7c('0xa2')](_0x3a6bfb,0xf,_0xba7c('0xa3'));rpcDb[_0xba7c('0xa4')](_0x39a43a,_0xba7c('0xc1'));}else{if(_0x3a6bfb[_0xba7c('0xbf')]>=_0x18ecf7['dialNoAnswerMaxRetry']){rpcDb[_0xba7c('0xa4')](_0x3a6bfb,_0xba7c('0xc0'));}else{rpcDb[_0xba7c('0xc2')](ut[_0xba7c('0xc3')](_0x3a6bfb,_0xba7c('0xbf'),_0x18ecf7['dialNoAnswerRetryFrequency']),_0x3a6bfb[_0xba7c('0xbd')],_0x3a6bfb[_0xba7c('0xbe')]);}}break;case _0xba7c('0xc4'):_0x18ecf7['outboundCongestionCallsDay']+=0x1;_0x3a6bfb[_0xba7c('0xc5')]+=0x1;_0x3a6bfb[_0xba7c('0x9e')]=ut[_0xba7c('0x9f')](_0x3a6bfb);ut[_0xba7c('0x90')](_0x3a6bfb,0x8,_0xba7c('0xc6'));rpcDb[_0xba7c('0x96')](_0x3a6bfb,_0xba7c('0xc7'));if(ut[_0xba7c('0x9f')](_0x3a6bfb)>=_0x18ecf7[_0xba7c('0xa1')]){_0x39a43a=ut[_0xba7c('0xa2')](_0x3a6bfb,0xf,_0xba7c('0xa3'));rpcDb['createCustomerFinal'](_0x39a43a,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x3a6bfb[_0xba7c('0xc5')]>=_0x18ecf7[_0xba7c('0xc8')]){rpcDb[_0xba7c('0xa4')](_0x3a6bfb,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xba7c('0xc2')](ut[_0xba7c('0xc3')](_0x3a6bfb,_0xba7c('0xc5'),_0x18ecf7['dialBusyRetryFrequency']),_0x3a6bfb[_0xba7c('0xbd')],_0x3a6bfb[_0xba7c('0xbe')]);}}break;case'CANCEL':_0x18ecf7[_0xba7c('0x48')]+=0x1;_0x3a6bfb[_0xba7c('0x9e')]=ut[_0xba7c('0x9f')](_0x3a6bfb);ut[_0xba7c('0x90')](_0x3a6bfb,0x14,_0xba7c('0xc9'));rpcDb[_0xba7c('0x96')](_0x3a6bfb,_0xba7c('0xca'));if(_0x3a6bfb['unlockAgent']){rpcDb[_0xba7c('0xcb')](_0x3a6bfb[_0xba7c('0xcc')]);}if(_0x3a6bfb['activeContact']){rpcDb[_0xba7c('0xcd')](_0x3a6bfb[_0xba7c('0xcc')]);}break;default:if(_0x3a6bfb['dialAnswer']){ut[_0xba7c('0x80')](_0x18ecf7,'[default]');ut[_0xba7c('0x81')](_0xba7c('0xce')+_0x18ecf7['name'],_0x9d8891);}_0x18ecf7['outboundUnknownCallsDay']+=0x1;_0x3a6bfb[_0xba7c('0x9e')]=ut[_0xba7c('0x9f')](_0x3a6bfb);ut['logCustomer'](_0x3a6bfb,0xc,_0x9d8891[_0xba7c('0xcf')]||_0x9d8891[_0xba7c('0xd0')]);rpcDb[_0xba7c('0x96')](_0x3a6bfb,_0xba7c('0xd1'));if(ut[_0xba7c('0x9f')](_0x3a6bfb)>=_0x18ecf7[_0xba7c('0xa1')]){_0x39a43a=ut[_0xba7c('0xa2')](_0x3a6bfb,0xf,'Global');rpcDb[_0xba7c('0xa4')](_0x39a43a,_0xba7c('0xd2'));}else{rpcDb[_0xba7c('0xa4')](_0x3a6bfb,_0xba7c('0xd2'));}delete this['actions'][_0x9d8891[_0xba7c('0xa5')]];}if(!(_0x3a6bfb[_0xba7c('0x74')]&&_0x1cb26e==='16')){ut[_0xba7c('0x7e')](_0x18ecf7,'[callProgressDetectingCustomer]');logger[_0xba7c('0x6e')](_0xba7c('0xd3'),_0x3a6bfb['uniqueid'],_0xba7c('0xaa'),_0x18ecf7[_0xba7c('0x58')],_0xba7c('0x71'),_0x18ecf7[_0xba7c('0x56')]);}if(_0x1cb26e!==_0xba7c('0xa6')){delete this[_0xba7c('0x17')][_0x9d8891['linkedid']];delete this['actions'][_0x9d8891['destlinkedid']];}}};Preview[_0xba7c('0x65')][_0xba7c('0xd4')]=function(_0x16ade2,_0x16ec10,_0x1e27a7){if(_['isUndefined'](_0x16ec10)&&_0xba7c('0xd5')!==typeof _0x16ec10){return;}if(_[_0xba7c('0xd6')](_0x1e27a7)&&_0xba7c('0xd5')!==typeof _0x1e27a7){return;}switch(_0x1e27a7[_0xba7c('0xd7')]){case'0':ut[_0xba7c('0xd8')](_0x16ade2,0x0,_0xba7c('0xa0'));rpcDb['createAgentHistory'](_0x16ade2,_0xba7c('0xd9'));break;case'3':ut['logAgent'](_0x16ade2,0x3,_0xba7c('0xda'));rpcDb['createAgentHistory'](_0x16ade2,_0xba7c('0xdb'));break;case'5':ut[_0xba7c('0xd8')](_0x16ade2,0x5,_0xba7c('0xb9'));rpcDb[_0xba7c('0xdc')](_0x16ade2,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xba7c('0xd8')](_0x16ade2,0x8,_0xba7c('0xc6'));rpcDb['createAgentHistory'](_0x16ade2,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xba7c('0xd8')](_0x16ade2,0x16,_0xba7c('0xdd'));rpcDb['createAgentHistory'](_0x16ade2,_0xba7c('0xde'));break;default:ut['logAgent'](_0x16ade2,0xc,_0x1e27a7[_0xba7c('0xd7')]);rpcDb[_0xba7c('0xdc')](_0x16ade2,_0xba7c('0xdf'));}ut[_0xba7c('0x7e')](_0x16ec10,_0xba7c('0xe0'));logger[_0xba7c('0x6e')](_0xba7c('0xe1'),_0x16ade2[_0xba7c('0xa9')],'\x20Queue',_0x16ec10[_0xba7c('0x58')],_0xba7c('0x71'),_0x16ec10['originated']);delete this['actions'][_0x16ade2[_0xba7c('0xa9')]];};Preview[_0xba7c('0x65')]['checkInBlack']=function(_0x38b23a,_0x588e16,_0xe60965,_0x5d4e87,_0x11b468){var _0x12ffb9=this;return new BPromise(function(_0x21e980,_0x485ca0){if(_['isNil'](_0x588e16)||_[_0xba7c('0x6d')](_0x588e16[_0xba7c('0xe2')])||_[_0xba7c('0x6d')](_0x588e16['Contact'][_0xba7c('0xe3')])||_[_0xba7c('0x6d')](_0x588e16[_0xba7c('0x77')])){_0x485ca0(ut['message'](_0xba7c('0xe4'),_0x5d4e87,_0x11b468));return;}var _0x211627=uuid['v4']();var _0x5a26a8=_0x12ffb9['campaignsPreview'][_0x588e16[_0xba7c('0xe5')]['name']];var _0x279d3c=_0xe60965?_0x12ffb9[_0xba7c('0x18')][_0xe60965]['id']:undefined;_0x12ffb9[_0xba7c('0x17')][_0x211627]=new Action(_0x588e16,_0x5a26a8,_0x211627,_0xe60965,_0x279d3c);var _0x52c547=_0x12ffb9[_0xba7c('0x17')][_0x211627];_0x52c547['unlockAgent']=_0x5d4e87;_0x52c547[_0xba7c('0xbe')]=_0x11b468;_0x52c547[_0xba7c('0xe6')]=_0xe60965;if(_[_0xba7c('0xe7')](_0x38b23a)){_0x12ffb9['execCall'](_0x52c547,_0x5a26a8,_0x588e16,_0xe60965)[_0xba7c('0xe8')](function(_0x15b14d){logger[_0xba7c('0x6e')](_0xba7c('0xe9'),_0xba7c('0xea')+_0x52c547[_0xba7c('0x70')]+'\x20IdHopper:\x20'+_0x52c547['idContact'],JSON[_0xba7c('0x72')](_0x15b14d));ami[_0xba7c('0x29')]('custom:agentcalled',ut['buildObj'](_0x52c547,_0xba7c('0xeb')));_0x21e980(ut[_0xba7c('0x62')](_0xba7c('0xec')));})[_0xba7c('0x7c')](function(_0x6e9857){ut[_0xba7c('0x60')]('[Preview][execCall][failure]',_0x6e9857);_0x485ca0(ut['message'](_0xba7c('0xed'),_0x5d4e87,_0x11b468));});}else{_0x5a26a8[_0xba7c('0x3f')]+=0x1;ut[_0xba7c('0xee')](_0x52c547);rpcDb[_0xba7c('0xef')](_0x52c547,_0xba7c('0xf0'));delete _0x12ffb9[_0xba7c('0x17')][_0x211627];_0x485ca0(ut[_0xba7c('0x62')]('Contact\x20in\x20black\x20List',_0x5d4e87,_0x11b468));}});};Preview['prototype'][_0xba7c('0x99')]=function(_0x1ff862){return!_['isNil'](_0x1ff862)&&!_[_0xba7c('0x6d')](_0x1ff862[_0xba7c('0x58')])&&!_[_0xba7c('0x6d')](_0x1ff862[_0xba7c('0x59')])&&_0x1ff862[_0xba7c('0x59')]&&!_['isNil'](this['trunks'][util[_0xba7c('0x5c')]('SIP/%s',_0x1ff862[_0xba7c('0x58')])])&&!_[_0xba7c('0x6d')](this[_0xba7c('0x16')][util[_0xba7c('0x5c')]('SIP/%s',_0x1ff862[_0xba7c('0x58')])]['status'])&&(this[_0xba7c('0x16')][util[_0xba7c('0x5c')](_0xba7c('0xf1'),_0x1ff862[_0xba7c('0x58')])][_0xba7c('0x7a')]==='reachable'||this[_0xba7c('0x16')][util['format'](_0xba7c('0xf1'),_0x1ff862[_0xba7c('0x58')])]['status']===_0xba7c('0xf2'));};Preview[_0xba7c('0x65')]['run']=function(_0x2c64b0,_0x1abd4b){var _0x502aee=this;return new BPromise(function(_0x38c7ae,_0x255906){_0x502aee[_0xba7c('0xf3')](_0x2c64b0,_0x1abd4b)[_0xba7c('0xe8')](function(_0x1489d4){_0x38c7ae(_[_0xba7c('0xf4')](_0x1489d4,[_0xba7c('0x62')]));})[_0xba7c('0x7c')](function(_0x669d9b){if(_0x669d9b['unlock']){rpcDb[_0xba7c('0xcb')](_0x2c64b0);}if(_0x669d9b[_0xba7c('0x59')]){rpcDb[_0xba7c('0xcd')](_0x2c64b0);}_0x255906(_['pick'](_0x669d9b,[_0xba7c('0x62')]));});});};Preview[_0xba7c('0x65')]['execRun']=function(_0x468be6,_0x863d0c){var _0x5b36f3=this;return new BPromise(function(_0x416ad9,_0x5c8bfd){var _0x6ca5cf,_0x3fb371;rpcDb[_0xba7c('0xf5')](_0x468be6)[_0xba7c('0xe8')](function(_0x17d95e){if(!_[_0xba7c('0x6d')](_0x17d95e[0x0])){_0x3fb371=_0x17d95e[0x0][_0xba7c('0xf6')]?![]:!![];_0x6ca5cf=_0x17d95e[0x0][_0xba7c('0xf6')]?!![]:![];_0x6ca5cf=_0x863d0c?!![]:_0x6ca5cf;}var _0x4f5e11=_0x5b36f3[_0xba7c('0xf7')](_0x17d95e);if(_0x4f5e11[_0xba7c('0xf8')]){rpcDb[_0xba7c('0xf9')](_[_0xba7c('0xf4')](_0x17d95e[0x0],['VoiceQueueId',_0xba7c('0xfa')]))[_0xba7c('0xe8')](function(_0x4e640f){_0x5b36f3[_0xba7c('0xfb')](_0x4e640f,_0x17d95e[0x0],_0x863d0c,_0x3fb371,_0x6ca5cf)[_0xba7c('0xe8')](function(_0x1d95fa){_0x416ad9(_0x1d95fa);})[_0xba7c('0x7c')](function(_0x46eaa8){_0x5c8bfd(_0x46eaa8);});})[_0xba7c('0x7c')](function(_0xe1a4a2){ut[_0xba7c('0x60')](_0xba7c('0xfc'),_0xe1a4a2);_0x5c8bfd(ut[_0xba7c('0x62')](_0xba7c('0xfd'),_0x3fb371,_0x6ca5cf));});}else{_0x5c8bfd(ut[_0xba7c('0x62')](_0x4f5e11[_0xba7c('0x62')],_0x3fb371,_0x6ca5cf));}})['catch'](function(_0x5c0ea6){ut[_0xba7c('0x60')](_0xba7c('0xfe'),_0x5c0ea6);_0x5c8bfd(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview[_0xba7c('0x65')][_0xba7c('0xf7')]=function(_0x3aaeb1){if(_['isNil'](_0x3aaeb1)||_[_0xba7c('0xe7')](_0x3aaeb1)||!_[_0xba7c('0x6d')](_0x3aaeb1[0x0][_0xba7c('0xff')])&&_[_0xba7c('0x6d')](_0x3aaeb1[0x0][_0xba7c('0xff')][_0xba7c('0x58')])){ut['logger'](_0xba7c('0x100'),_0x3aaeb1);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x4ee788=this['campaignsPreview'][_0x3aaeb1[0x0][_0xba7c('0xe5')][_0xba7c('0x58')]];_0x4ee788[_0xba7c('0x62')]=_0xba7c('0x9c');if(_[_0xba7c('0x6d')](_0x4ee788)){ut['logger'](_0xba7c('0x101'),_0x4ee788);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xba7c('0x99')](_0x4ee788[_0xba7c('0x57')])){ut[_0xba7c('0x60')](_0xba7c('0x102'),_0xba7c('0x103')+_0x4ee788['name']+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xba7c('0x99')](_0x4ee788[_0xba7c('0x9a')])){ut[_0xba7c('0x60')](_0xba7c('0x102'),_0x4ee788[_0xba7c('0x58')]+_0xba7c('0x104'));return{'isValid':![],'message':_0xba7c('0x105')};}}if(!ut[_0xba7c('0x106')](_0x4ee788[_0xba7c('0x37')])){ut[_0xba7c('0x60')](_0xba7c('0x107'),_0x4ee788[_0xba7c('0x58')]+_0xba7c('0x108'));return{'isValid':![],'message':_0xba7c('0x103')+_0x4ee788[_0xba7c('0x58')]+_0xba7c('0x108')};}return{'isValid':!![],'message':_0xba7c('0x109')};};Preview[_0xba7c('0x65')][_0xba7c('0x10a')]=function(_0xb74874,_0x385fa1,_0x57aa33,_0x58e241){var _0x58dd04=this;return new BPromise(function(_0xb6206a,_0x509c19){var _0xfb46a=_0xb74874[_0xba7c('0xa9')];var _0x13a19a=_0x58dd04[_0xba7c('0x99')](_0x385fa1['Trunk'])?util[_0xba7c('0x5c')](_0xba7c('0x10b'),_0x385fa1[_0xba7c('0x57')][_0xba7c('0x58')],_['isNil'](_0x385fa1[_0xba7c('0x3c')])?'':_0x385fa1[_0xba7c('0x3c')][_0xba7c('0x10c')]()||'',_0x385fa1[_0xba7c('0x10d')]>0x0?_0x57aa33['Contact']['phone'][_0xba7c('0x10e')](_0x385fa1[_0xba7c('0x10d')]):_0x57aa33['Contact'][_0xba7c('0xe3')]):util[_0xba7c('0x5c')](_0xba7c('0x10b'),_[_0xba7c('0x6d')](_0x385fa1[_0xba7c('0x9a')])?_0x385fa1[_0xba7c('0x57')][_0xba7c('0x58')]:_0x385fa1[_0xba7c('0x9a')][_0xba7c('0x58')],_[_0xba7c('0x6d')](_0x385fa1['dialPrefix'])?'':_0x385fa1[_0xba7c('0x3c')][_0xba7c('0x10c')]()||'',_0x385fa1[_0xba7c('0x10d')]>0x0?_0x57aa33[_0xba7c('0xe2')][_0xba7c('0xe3')][_0xba7c('0x10e')](_0x385fa1['dialCutDigit']):_0x57aa33['Contact'][_0xba7c('0xe3')]);var _0x4c88e7=_0x58dd04['isTrunkReachable'](_0x385fa1[_0xba7c('0x57')])?ut['getCallerId'](_0x385fa1[_0xba7c('0x57')]['callerid'],_0x385fa1[_0xba7c('0x39')],_0x385fa1[_0xba7c('0x10f')]>0x0?ut[_0xba7c('0x110')](_0x385fa1['dialOriginateCallerIdNumber'],_0x385fa1[_0xba7c('0x10f')]):_0x385fa1[_0xba7c('0x3a')]):ut[_0xba7c('0x111')](_[_0xba7c('0x6d')](_0x385fa1[_0xba7c('0x9a')])?_0x385fa1[_0xba7c('0x57')]['callerid']:_0x385fa1[_0xba7c('0x9a')][_0xba7c('0x5a')],_0x385fa1[_0xba7c('0x39')],_0x385fa1[_0xba7c('0x10f')]>0x0?ut[_0xba7c('0x110')](_0x385fa1[_0xba7c('0x3a')],_0x385fa1['dialRandomLastDigitCallerIdNumber']):_0x385fa1[_0xba7c('0x3a')]);if(_0x4c88e7){_0xb74874[_0xba7c('0x112')]=ut[_0xba7c('0x113')](_0x4c88e7);_0xb74874[_0xba7c('0x114')]=ut[_0xba7c('0x115')](_0x4c88e7);}var _0x374352=ut[_0xba7c('0x116')](_0x385fa1,_0x57aa33,_0x13a19a,_0x4c88e7,_0xfb46a,_0xb74874);_[_0xba7c('0x117')](_0xb74874,ut[_0xba7c('0x118')](_0x374352));_0xb74874['starttime']=moment()[_0xba7c('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xba7c('0x79')](ut[_0xba7c('0x119')](_0xb74874,_0x385fa1,_0x374352,_0xb74874[_0xba7c('0xbe')],_0x58e241))['then'](function(_0x296b24){_0x385fa1['originated']+=0x1;logger[_0xba7c('0x6e')](_0xba7c('0x11a'),_0xfb46a,_0xba7c('0xaa'),_0x385fa1[_0xba7c('0x58')],_0xba7c('0x71'),_0x385fa1[_0xba7c('0x56')]);_0xb6206a(_0x296b24);})[_0xba7c('0x7c')](function(_0x16e231){ut['logAgent'](_0xb74874,0xe,'OriginateError');rpcDb[_0xba7c('0xdc')](_0xb74874,_0xba7c('0x11b'));_0x509c19(_0x16e231);});});};Preview[_0xba7c('0x65')]['syncNewExten']=function(_0x146161){if(this[_0xba7c('0x17')][_0x146161[_0xba7c('0xa5')]]){this[_0xba7c('0x17')][_0x146161[_0xba7c('0xa5')]][_0xba7c('0x7b')]=_0x146161[_0xba7c('0x7b')];}};Preview[_0xba7c('0x65')][_0xba7c('0x1b')]=function(_0x146990){var _0x13dc27=this;var _0x114337=this['actions'][_0x146990['actionid']];if(_0x114337){if(_0x114337[_0xba7c('0xe6')]&&this[_0xba7c('0x18')][_0x114337['lookAgent']]){ut[_0xba7c('0x11c')](_0x114337,this['agents'][_0x114337[_0xba7c('0xe6')]][_0xba7c('0x58')],this[_0xba7c('0x18')][_0x114337[_0xba7c('0xe6')]]['id']);}var _0x30f2b1=_['clone'](_0x114337);_0x30f2b1[_0xba7c('0xa7')]=moment()[_0xba7c('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x560cac=_0x13dc27[_0xba7c('0x14')][_0x114337[_0xba7c('0x70')]];if(ut[_0xba7c('0x11d')](_0x146990[_0xba7c('0x11e')])){if(_0x114337['unlockAgent']){rpcDb[_0xba7c('0xcb')](_0x114337[_0xba7c('0xcc')]);}if(_0x114337[_0xba7c('0xbe')]){rpcDb[_0xba7c('0xcd')](_0x114337[_0xba7c('0xcc')]);}ami[_0xba7c('0x29')](_0xba7c('0x11f'),ut['buildObj'](_0x114337,_0xba7c('0x120')));this['callProgressDetectingAgent'](_0x30f2b1,_0x560cac,_0x146990);}else{_0x114337[_0xba7c('0x8e')]=moment()[_0xba7c('0x5c')](_0xba7c('0x8f'));ut['logAgent'](_0x30f2b1,0x4,'Answer');rpcDb[_0xba7c('0xdc')](_0x30f2b1,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xba7c('0x65')][_0xba7c('0x1d')]=function(_0x499044){var _0x468503=this;var _0x5b20df=this['actions'][_0x499044[_0xba7c('0xa5')]];var _0x212e7e;if(_0x5b20df){_0x212e7e=this[_0xba7c('0x14')][_0x5b20df[_0xba7c('0x70')]];logger[_0xba7c('0x6e')](_0xba7c('0x121'),_0x499044[_0xba7c('0xa5')],_0xba7c('0xaa'),_0x212e7e[_0xba7c('0x58')],_0xba7c('0x73'),_0x212e7e[_0xba7c('0x30')]);}if(this[_0xba7c('0x17')][_0x499044[_0xba7c('0xa5')]]&&_0x499044[_0xba7c('0xa5')]!==_0x499044[_0xba7c('0xa9')]){if(_0x499044[_0xba7c('0x122')]==='16'&&this['actions'][_0x499044[_0xba7c('0xa5')]]['dialAnswer']){this[_0xba7c('0x9d')](_0x499044,_0x499044[_0xba7c('0xa5')],_0x499044[_0xba7c('0x122')]);}else if(this[_0xba7c('0x17')][_0x499044[_0xba7c('0xa5')]][_0xba7c('0x74')]){logger['info'](_0xba7c('0x123'),_0x499044[_0xba7c('0xa5')],_0x499044[_0xba7c('0x122')],_0xba7c('0xaa'),_0x212e7e[_0xba7c('0x58')],_0xba7c('0x73'),_0x212e7e['pTalking']);this['callProgressDetectingCustomer'](_0x499044,_0x499044[_0xba7c('0xa5')],_0x499044[_0xba7c('0x122')]);}}else if(_0x5b20df&&_['isNil'](_0x5b20df[_0xba7c('0x124')])&&_0x212e7e[_0xba7c('0x125')]&&_0x499044['linkedid']===_0x499044[_0xba7c('0xa9')]&&_[_0xba7c('0x6d')](_0x499044[_0xba7c('0xd7')])&&_0x499044[_0xba7c('0x122')]==='16'&&_0x499044[_0xba7c('0x126')]==='6'&&_[_0xba7c('0xd6')](_0x5b20df[_0xba7c('0x127')])){if(_0x5b20df[_0xba7c('0xbd')]){rpcDb[_0xba7c('0xcb')](_0x5b20df[_0xba7c('0xcc')]);}if(_0x5b20df[_0xba7c('0xbe')]){rpcDb['disableContact'](_0x5b20df[_0xba7c('0xcc')]);}_0x499044[_0xba7c('0xd7')]='22';this['callProgressDetectingAgent'](_0x5b20df,_0x212e7e,_0x499044);}else if(_0x5b20df&&_0x5b20df[_0xba7c('0x127')]){if(_0x499044['cause']==='16'&&this[_0xba7c('0x17')][_0x499044[_0xba7c('0xa5')]]['dialAnswer']){logger['info'](_0xba7c('0x128'),_0x499044[_0xba7c('0xa5')],_0x499044[_0xba7c('0x122')],_0xba7c('0xaa'),_0x212e7e[_0xba7c('0x58')],_0xba7c('0x73'),_0x212e7e[_0xba7c('0x30')]);this[_0xba7c('0x9d')](_0x499044,_0x499044['linkedid'],_0x499044[_0xba7c('0x122')]);}else if(this[_0xba7c('0x17')][_0x499044['linkedid']][_0xba7c('0x74')]){logger[_0xba7c('0x6e')]('[syncHangup][talking][cause]',_0x499044['linkedid'],_0x499044[_0xba7c('0x122')],_0xba7c('0xaa'),_0x212e7e[_0xba7c('0x58')],_0xba7c('0x73'),_0x212e7e[_0xba7c('0x30')]);this[_0xba7c('0x9d')](_0x499044,_0x499044[_0xba7c('0xa5')],_0x499044[_0xba7c('0x122')]);}}};Preview[_0xba7c('0x65')]['syncDialEnd']=function(_0x1936f0){if(this['actions'][_0x1936f0[_0xba7c('0x129')]]&&_0x1936f0[_0xba7c('0x129')]!==_0x1936f0[_0xba7c('0x12a')]){this['callProgressDetectingCustomer'](_0x1936f0,_0x1936f0[_0xba7c('0x129')],_0x1936f0[_0xba7c('0xd0')]);}};Preview[_0xba7c('0x65')][_0xba7c('0x12b')]=function(_0x1021c9){if(this[_0xba7c('0x17')][_0x1021c9[_0xba7c('0xa5')]]&&_0x1021c9[_0xba7c('0xa5')]!==_0x1021c9[_0xba7c('0xa9')]&&!this['actions'][_0x1021c9['linkedid']][_0xba7c('0x74')]){if(_0x1021c9[_0xba7c('0x122')]==='1'){this[_0xba7c('0x9d')](_0x1021c9,_0x1021c9[_0xba7c('0xa5')],_0x1021c9[_0xba7c('0x122')]);}}};Preview[_0xba7c('0x65')][_0xba7c('0x12c')]=function(_0x133c65,_0x149066,_0x30c6b8){if(this[_0xba7c('0x17')][_0x133c65]){if(_[_0xba7c('0x6d')](this[_0xba7c('0x17')][_0x133c65]['variables'])){this['actions'][_0x133c65][_0xba7c('0x12d')]={};}this[_0xba7c('0x17')][_0x133c65][_0xba7c('0x12d')][_0x149066]=_0x30c6b8;}};Preview[_0xba7c('0x65')][_0xba7c('0x24')]=function(_0x354460){try{if(!_[_0xba7c('0x6d')](_0x354460)){if(ut[_0xba7c('0x12e')](_[_0xba7c('0x12f')](_0x354460[_0xba7c('0x130')])[0x0])){this[_0xba7c('0x12c')](_0x354460['uniqueid'],_['keys'](_0x354460[_0xba7c('0x130')])[0x0],_0x354460[_0xba7c('0x131')]);}}}catch(_0x485234){logger[_0xba7c('0x132')](_0xba7c('0x133'),util[_0xba7c('0x134')](_0x485234,{'showHidden':![],'depth':null}));}};Preview[_0xba7c('0x65')][_0xba7c('0x26')]=function(_0x1d5b7b){if(_0x1d5b7b){if(this[_0xba7c('0x17')][_0x1d5b7b[_0xba7c('0x135')]]){this[_0xba7c('0x17')][_0x1d5b7b[_0xba7c('0x135')]][_0xba7c('0x127')]=!![];}}};Preview[_0xba7c('0x65')][_0xba7c('0x27')]=function(_0x4e47a4){if(_0x4e47a4){if(this['actions'][_0x4e47a4[_0xba7c('0x136')]]){this[_0xba7c('0x17')][_0x4e47a4['transfererlinkedid']][_0xba7c('0x127')]=!![];}}};module[_0xba7c('0x137')]=Preview; \ No newline at end of file +var _0x1ca8=['scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','AgentReject','unlockContact','idContact','disableContact','[default]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','linkedid','callProgressDetectingAgent','object','reason','logAgent','NoSuchNumber','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','checkInBlack','Contact','phone','lookAgent','isEmpty','execCall','then','[Preview][execCall][success]','\x20IdHopper:\x20','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','pick','unlock','recallme','[Preview][checkIsBlackList]','Call\x20unsuccessful','validateContact','Agent','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','trim','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','responsetime','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','isUndefined','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','bluebird','moment','../../../config/environment','../../../config/logger','preview','actionPreview','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','total','unmanaged','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','Trunk','active','callerid','Interval','stringify','md5','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','booked','clearZombieChannels','hasOwnProperty','setMessage','clearZombieChannel','isNil','actions','info','Queue','queue','originated:\x20','UserId','VoiceQueueId','ListId','Action','status','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','recallMe','getContactRecallMe','length','scheduledat','run','logger2','catch','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryRecallClose]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','totalGlobal','logCustomer','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','createCustomerFinal','answertime','uniqueid','pTalking:\x20','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','\x20Queue','Busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','rescheduleContact'];(function(_0x19130d,_0x1bc97f){var _0x8e0c2b=function(_0x14708c){while(--_0x14708c){_0x19130d['push'](_0x19130d['shift']());}};_0x8e0c2b(++_0x1bc97f);}(_0x1ca8,0x7c));var _0x81ca=function(_0x35f211,_0x42aeb2){_0x35f211=_0x35f211-0x0;var _0xee876e=_0x1ca8[_0x35f211];return _0xee876e;};'use strict';var util=require(_0x81ca('0x0'));var _=require(_0x81ca('0x1'));var BPromise=require(_0x81ca('0x2'));var uuid=require('uuid');var moment=require(_0x81ca('0x3'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x81ca('0x4'));var logger=require(_0x81ca('0x5'))(_0x81ca('0x6'));var loggerAction=require(_0x81ca('0x5'))(_0x81ca('0x7'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0x81ca('0x8'));config[_0x81ca('0x9')]=_[_0x81ca('0xa')](config[_0x81ca('0x9')],{'host':_0x81ca('0xb'),'port':0x18eb});var io=require(_0x81ca('0xc'))(new Redis(config[_0x81ca('0x9')]));var Sequence=function(){};Sequence[_0x81ca('0xd')]['enqueue']=function(_0x36a6fa){this[_0x81ca('0xe')]=this['tail']?this[_0x81ca('0xe')]['finally'](_0x36a6fa):_0x36a6fa();};function Preview(_0xdc8bfa){this[_0x81ca('0xf')]=new Sequence();this[_0x81ca('0x10')]=_0xdc8bfa[_0x81ca('0x11')];this['trunks']=_0xdc8bfa[_0x81ca('0x12')];this['actions']={};this[_0x81ca('0x13')]=_0xdc8bfa[_0x81ca('0x13')];this[_0x81ca('0x14')]=0x0;ami['on'](_0x81ca('0x15'),this['syncOriginateResponse'][_0x81ca('0x16')](this));ami['on'](_0x81ca('0x17'),this[_0x81ca('0x18')][_0x81ca('0x16')](this));ami['on'](_0x81ca('0x19'),this[_0x81ca('0x1a')][_0x81ca('0x16')](this));ami['on']('dialend',this[_0x81ca('0x1b')]['bind'](this));ami['on'](_0x81ca('0x1c'),this[_0x81ca('0x1d')]['bind'](this));ami['on'](_0x81ca('0x1e'),this[_0x81ca('0x1f')][_0x81ca('0x16')](this));ami['on'](_0x81ca('0x20'),this['syncAttendedTransfer'][_0x81ca('0x16')](this));ami['on'](_0x81ca('0x21'),this['syncBlindTransfer'][_0x81ca('0x16')](this));this[_0x81ca('0x22')](this['campaignsPreview']);}function emit(_0x3cc877,_0x19ab00,_0x28a7a9){io['to'](_0x3cc877)[_0x81ca('0x23')](_0x19ab00,_0x28a7a9);}function emitCampaignPreview(_0x341b2f){if(_0x341b2f[_0x81ca('0x24')]===_0x81ca('0x25')){var _0x546776={'id':_0x341b2f['id'],'name':_0x341b2f[_0x81ca('0x26')],'strategy':_0x341b2f[_0x81ca('0x27')],'answered':_0x341b2f[_0x81ca('0x28')],'available':_0x341b2f[_0x81ca('0x29')],'loggedIn':_0x341b2f[_0x81ca('0x2a')],'pTalking':_0x341b2f['pTalking'],'sumBillable':_0x341b2f[_0x81ca('0x2b')],'sumDuration':_0x341b2f['sumDuration'],'sumHoldTime':_0x341b2f[_0x81ca('0x2c')]||0x0,'talking':_0x341b2f['talking'],'total':_0x341b2f[_0x81ca('0x2d')],'type':_0x341b2f[_0x81ca('0x24')],'unmanaged':_0x341b2f[_0x81ca('0x2e')],'abandoned':_0x341b2f[_0x81ca('0x2f')],'waiting':_0x341b2f['waiting'],'loggedInDb':_0x341b2f['loggedInDb'],'dialActive':_0x341b2f[_0x81ca('0x30')],'dialMethod':_0x341b2f[_0x81ca('0x31')],'dialOriginateCallerIdName':_0x341b2f[_0x81ca('0x32')],'dialOriginateCallerIdNumber':_0x341b2f[_0x81ca('0x33')],'dialOriginateTimeout':_0x341b2f['dialOriginateTimeout'],'dialPrefix':_0x341b2f[_0x81ca('0x34')],'outboundAnswerAgiCallsDay':_0x341b2f[_0x81ca('0x35')],'outboundAnswerCallsDay':_0x341b2f['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x341b2f[_0x81ca('0x36')],'outboundBusyCallsDay':_0x341b2f[_0x81ca('0x37')],'outboundCongestionCallsDay':_0x341b2f[_0x81ca('0x38')],'outboundDropCallsDayACS':_0x341b2f[_0x81ca('0x39')],'outboundDropCallsDayCallersExit':_0x341b2f[_0x81ca('0x3a')],'outboundDropCallsDayTimeout':_0x341b2f[_0x81ca('0x3b')],'outboundNoAnswerCallsDay':_0x341b2f['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x341b2f['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x341b2f['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x341b2f[_0x81ca('0x3c')],'outboundRejectCallsDay':_0x341b2f[_0x81ca('0x3d')],'outboundUnknownCallsDay':_0x341b2f[_0x81ca('0x3e')],'predictiveIntervalAnsweredCalls':_0x341b2f['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x341b2f[_0x81ca('0x3f')],'predictiveIntervalAvgTalktime':_0x341b2f['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x341b2f[_0x81ca('0x40')],'predictiveIntervalDroppedCallsTimeout':_0x341b2f[_0x81ca('0x41')],'predictiveIntervalErlangCalls':_0x341b2f[_0x81ca('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x341b2f[_0x81ca('0x43')],'predictiveIntervalHitRate':_0x341b2f['predictiveIntervalHitRate'],'predictiveIntervalLowerLimit':_0x341b2f['predictiveIntervalLowerLimit'],'predictiveIntervalMultiplicativeFactor':_0x341b2f[_0x81ca('0x44')],'predictiveIntervalPauses':_0x341b2f[_0x81ca('0x45')],'predictiveIntervalTotalCalls':_0x341b2f[_0x81ca('0x46')],'message':_0x341b2f[_0x81ca('0x47')],'originated':_0x341b2f[_0x81ca('0x48')]};if(_0x341b2f[_0x81ca('0x49')]){_0x546776[_0x81ca('0x49')]={'id':_0x341b2f[_0x81ca('0x49')]['id'],'name':_0x341b2f['Trunk'][_0x81ca('0x26')],'active':_0x341b2f['Trunk'][_0x81ca('0x4a')],'callerid':_0x341b2f['Trunk'][_0x81ca('0x4b')]};}if(_0x341b2f[_0x81ca('0x4c')]){_0x546776[_0x81ca('0x4c')]={'id':_0x341b2f[_0x81ca('0x4c')]['id'],'name':_0x341b2f[_0x81ca('0x4c')][_0x81ca('0x26')]};}var _0x34b4a4=md5(JSON[_0x81ca('0x4d')](_0x546776));if(_0x341b2f[_0x81ca('0x4e')]!==_0x34b4a4){_0x341b2f[_0x81ca('0x4e')]=_0x34b4a4;emit(util[_0x81ca('0x4f')](_0x81ca('0x50'),_0x546776[_0x81ca('0x26')]),'voice_queue:save',_0x546776);}}}function emitVoiceQueueChannelRemove(_0x264427){emit(util[_0x81ca('0x4f')]('voice:queue:%s',_0x264427[_0x81ca('0x26')]),_0x81ca('0x51'),_0x264427);}function notSendMessagesQueue(_0x12bd17){if(_0x12bd17[_0x81ca('0x52')]){if(_0x12bd17[_0x81ca('0x48')]===0x0&&_0x12bd17[_0x81ca('0x53')]===0x0){_0x12bd17['sendMessageOneNotActive']=![];_0x12bd17[_0x81ca('0x29')]=0x0;_0x12bd17[_0x81ca('0x54')]=0x0;_0x12bd17['message']=_0x81ca('0x55');ut[_0x81ca('0x56')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x12bd17[_0x81ca('0x26')]+_0x81ca('0x57'));}else{_0x12bd17[_0x81ca('0x47')]=_0x81ca('0x58');ut[_0x81ca('0x56')](_0x81ca('0x59'),_0x12bd17[_0x81ca('0x26')]+_0x81ca('0x5a'));}emitCampaignPreview(_0x12bd17);}}Preview[_0x81ca('0xd')][_0x81ca('0x22')]=function(){var _0x1b3a44=this;setInterval(function(){_0x1b3a44['syncCampaigns']();},0x7cf);};Preview[_0x81ca('0xd')]['syncCampaigns']=function(){var _0x168940=this[_0x81ca('0x10')];this[_0x81ca('0x14')]+=0x1;for(var _0x4282bb in _0x168940){if(_0x168940['hasOwnProperty'](_0x4282bb)&&(_0x168940[_0x4282bb][_0x81ca('0x31')]==='preview'||_0x168940[_0x4282bb]['dialMethod']===_0x81ca('0x5b'))&&_0x168940[_0x4282bb][_0x81ca('0x24')]===_0x81ca('0x25')){if(this[_0x81ca('0x14')]>0x7){this[_0x81ca('0x14')]=0x0;this[_0x81ca('0x5c')]();}}if(_0x168940[_0x81ca('0x5d')](_0x4282bb)&&_0x168940[_0x4282bb][_0x81ca('0x31')]===_0x81ca('0x6')&&_0x168940[_0x4282bb][_0x81ca('0x24')]===_0x81ca('0x25')){if(_0x168940[_0x4282bb]['dialActive']){this[_0x81ca('0x5e')](_0x168940[_0x4282bb]);this['recallMe'](_0x168940[_0x4282bb]);}else{notSendMessagesQueue(_0x168940[_0x4282bb]);}}}};Preview[_0x81ca('0xd')][_0x81ca('0x5f')]=function(_0x385ef2){var _0x4df872=this;this[_0x81ca('0xf')]['enqueue'](function(){if(!_[_0x81ca('0x60')](_0x4df872[_0x81ca('0x61')][_0x385ef2])){loggerAction[_0x81ca('0x62')]('[clearZombieChannels][talking]',_0x385ef2,_0x81ca('0x63'),_0x4df872['actions'][_0x385ef2][_0x81ca('0x64')],_0x81ca('0x65'),JSON['stringify'](_0x4df872[_0x81ca('0x10')][_0x4df872[_0x81ca('0x61')][_0x385ef2][_0x81ca('0x64')]]['originated']),'pTalking:\x20',JSON['stringify'](_0x4df872[_0x81ca('0x10')][_0x4df872[_0x81ca('0x61')][_0x385ef2][_0x81ca('0x64')]][_0x81ca('0x53')]),JSON[_0x81ca('0x4d')](_0x4df872[_0x81ca('0x61')][_0x385ef2]['dialAnswer']),JSON[_0x81ca('0x4d')](_['pick'](_0x4df872[_0x81ca('0x61')][_0x385ef2],['contactId',_0x81ca('0x66'),_0x81ca('0x67'),_0x81ca('0x68')])));return ami[_0x81ca('0x69')]({'action':_0x81ca('0x6a'),'channel':_0x4df872[_0x81ca('0x61')][_0x385ef2]['channel']})['catch'](function(_0x4d3129){if(_0x4d3129[_0x81ca('0x47')]===_0x81ca('0x6b')){setTimeout(function(){if(_0x4df872[_0x81ca('0x61')][_0x385ef2]){ut[_0x81ca('0x6c')](_0x4df872['campaignsPreview'][_0x4df872[_0x81ca('0x61')][_0x385ef2]['queue']],_0x81ca('0x6d'));if(_0x4df872[_0x81ca('0x61')][_0x385ef2][_0x81ca('0x6e')]===!![]){ut[_0x81ca('0x6f')](_0x4df872[_0x81ca('0x10')][_0x4df872['actions'][_0x385ef2][_0x81ca('0x64')]],_0x81ca('0x6d'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x385ef2,_0x4df872[_0x81ca('0x61')][_0x385ef2][_0x81ca('0x64')]);}ut[_0x81ca('0x70')](_0x81ca('0x71')+_0x385ef2,_0x4df872[_0x81ca('0x61')][_0x385ef2][_0x81ca('0x64')]);delete _0x4df872[_0x81ca('0x61')][_0x385ef2];}},0x2328);}});}});};Preview[_0x81ca('0xd')][_0x81ca('0x5c')]=function(){var _0x426123=this;loggerAction[_0x81ca('0x62')](_0x81ca('0x72'),_[_0x81ca('0x73')](this[_0x81ca('0x61')]));for(var _0x6c6737 in this[_0x81ca('0x61')]){if(_0x426123['actions'][_0x81ca('0x5d')](_0x6c6737)){_0x426123['clearZombieChannel'](_0x6c6737);}}};Preview[_0x81ca('0xd')][_0x81ca('0x74')]=function(_0xce4460){var _0x47d496=this;rpcDb[_0x81ca('0x75')](_0xce4460['id'],ut['agentReadyId'](this['agents']))['then'](function(_0x4082a0){if(!_['isNil'](_0x4082a0)){for(var _0x5de99b=0x0;_0x5de99b<_0x4082a0[_0x81ca('0x76')];_0x5de99b+=0x1){if(ut['getDiff'](_0x4082a0[_0x5de99b][_0x81ca('0x77')])<_0xce4460['dialRecallMeTimeout']*0x3c){_0x47d496[_0x81ca('0x78')](_0x4082a0[_0x5de99b]['id'])['then'](ut[_0x81ca('0x79')]('[RecallMe]'))[_0x81ca('0x7a')](ut[_0x81ca('0x79')](_0x81ca('0x7b')));}else{var _0x3e3975=new Action(_0x4082a0[_0x5de99b],_0xce4460);_0x3e3975[_0x81ca('0x7c')]=moment()[_0x81ca('0x4f')](_0x81ca('0x7d'));_0xce4460[_0x81ca('0x3c')]+=0x1;ut['logCustomer'](_0x3e3975,0x17,_0x81ca('0x7e'));if(_0xce4460[_0x81ca('0x7f')]){rpcDb[_0x81ca('0x80')](ut[_0x81ca('0x81')](_0x4082a0[_0x5de99b]));rpcDb[_0x81ca('0x82')](_0x3e3975,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x3e3975,0x16,'RecallFailedTimeout');rpcDb[_0x81ca('0x82')](_0x3e3975,_0x81ca('0x83'));rpcDb['createCustomerFinal'](_0x3e3975,_0x81ca('0x83'));}}}}})[_0x81ca('0x7a')](ut['logger2']('[getContactRecallMe]'));};Preview[_0x81ca('0xd')][_0x81ca('0x5e')]=function(_0x1f12b5){_0x1f12b5[_0x81ca('0x52')]=!![];if(ut[_0x81ca('0x84')](_0x1f12b5['loggedIn'])){_0x1f12b5[_0x81ca('0x47')]=_0x81ca('0x85');}else if(!ut[_0x81ca('0x86')](_0x1f12b5[_0x81ca('0x30')])){_0x1f12b5[_0x81ca('0x47')]=_0x81ca('0x55');}else if(!this[_0x81ca('0x87')](_0x1f12b5[_0x81ca('0x49')])){if(!this['isTrunkReachable'](_0x1f12b5[_0x81ca('0x88')])){_0x1f12b5[_0x81ca('0x47')]=_0x81ca('0x89');}else{_0x1f12b5[_0x81ca('0x47')]='ACTIVE';}}else{_0x1f12b5[_0x81ca('0x47')]=_0x81ca('0x8a');}emitCampaignPreview(_0x1f12b5);};Preview['prototype'][_0x81ca('0x8b')]=function(_0x24dc44,_0x12a803,_0x26d63a){var _0x1f4223=this;var _0x51d396=this[_0x81ca('0x61')][_0x12a803];var _0x165467=this[_0x81ca('0x10')][_0x51d396[_0x81ca('0x64')]];var _0x2a732f;if(_0x165467){switch(_0x26d63a){case'1':_0x165467['outboundNoSuchCallsDay']+=0x1;_0x51d396['countglobal']=ut[_0x81ca('0x8c')](_0x51d396);ut[_0x81ca('0x8d')](_0x51d396,0x0,'NoSuchNumber');rpcDb[_0x81ca('0x82')](_0x51d396,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x51d396)>=_0x165467[_0x81ca('0x8e')]){_0x2a732f=ut['cloneAction'](_0x51d396,0xf,_0x81ca('0x8f'));rpcDb['createCustomerFinal'](_0x2a732f,_0x81ca('0x90'));}else{rpcDb[_0x81ca('0x91')](_0x51d396,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this[_0x81ca('0x61')][_0x24dc44['linkedid']];break;case'ANSWER':var _0xace10b=moment()[_0x81ca('0x4f')](_0x81ca('0x7d'));_0x51d396['responsetime']=_0xace10b;_0x51d396[_0x81ca('0x92')]=_0xace10b;_0x51d396[_0x81ca('0x6e')]=!![];_0x165467[_0x81ca('0x53')]+=0x1;logger[_0x81ca('0x62')]('[syncHangup][talking][increment]',_0x51d396[_0x81ca('0x93')],'\x20Queue',_0x165467[_0x81ca('0x26')],_0x81ca('0x94'),_0x165467[_0x81ca('0x53')]);ami[_0x81ca('0x23')](_0x81ca('0x95'),ut[_0x81ca('0x96')](_0x51d396,_0x81ca('0x97')));if(_0x165467[_0x81ca('0x98')]){ami[_0x81ca('0x23')](_0x81ca('0x99'),ut[_0x81ca('0x9a')](_0x51d396));}break;case'16':ami['emit'](_0x81ca('0x9b'),ut[_0x81ca('0x96')](_0x51d396,'complete'));emitVoiceQueueChannelRemove(ut[_0x81ca('0x96')](_0x51d396,_0x81ca('0x9c')));_0x165467[_0x81ca('0x9d')]+=0x1;_0x165467[_0x81ca('0x2d')]+=0x1;_0x165467[_0x81ca('0x28')]+=0x1;ut[_0x81ca('0x6f')](_0x165467,'[16]');_0x51d396[_0x81ca('0x9e')]=ut[_0x81ca('0x8c')](_0x51d396);ut[_0x81ca('0x8d')](_0x51d396,0x4,_0x81ca('0x9f'));rpcDb[_0x81ca('0x82')](_0x51d396,_0x81ca('0xa0'));rpcDb['createCustomerFinal'](_0x51d396,_0x81ca('0xa1'));rpcDb[_0x81ca('0xa2')](_0x51d396);_0x165467[_0x81ca('0xa3')]+=_0x51d396[_0x81ca('0xa4')];_0x165467[_0x81ca('0x2b')]+=_0x51d396[_0x81ca('0xa4')];logger[_0x81ca('0x62')](_0x81ca('0xa5'),_0x51d396[_0x81ca('0x93')],_0x81ca('0xa6'),_0x165467['name'],_0x81ca('0x94'),_0x165467[_0x81ca('0x53')]);delete this['actions'][_0x24dc44['linkedid']];break;case'BUSY':_0x165467['outboundBusyCallsDay']+=0x1;_0x51d396['countbusyretry']+=0x1;_0x51d396[_0x81ca('0x9e')]=ut[_0x81ca('0x8c')](_0x51d396);ut[_0x81ca('0x8d')](_0x51d396,0x5,_0x81ca('0xa7'));rpcDb[_0x81ca('0x82')](_0x51d396,_0x81ca('0xa8'));if(ut[_0x81ca('0x8c')](_0x51d396)>=_0x165467['dialGlobalMaxRetry']){_0x2a732f=ut[_0x81ca('0xa9')](_0x51d396,0xf,_0x81ca('0x8f'));rpcDb['createCustomerFinal'](_0x2a732f,_0x81ca('0xaa'));}else{if(_0x51d396[_0x81ca('0xab')]>=_0x165467[_0x81ca('0xac')]){rpcDb[_0x81ca('0x91')](_0x51d396,_0x81ca('0xa8'));}else{rpcDb[_0x81ca('0xad')](ut[_0x81ca('0xae')](_0x51d396,_0x81ca('0xab'),_0x165467[_0x81ca('0xaf')]),_0x51d396[_0x81ca('0xb0')],_0x51d396[_0x81ca('0xb1')]);}}break;case _0x81ca('0xb2'):_0x165467[_0x81ca('0xb3')]+=0x1;_0x51d396[_0x81ca('0xb4')]+=0x1;_0x51d396['countglobal']=ut[_0x81ca('0x8c')](_0x51d396);ut['logCustomer'](_0x51d396,0x3,'NoAnswer');rpcDb[_0x81ca('0x82')](_0x51d396,_0x81ca('0xb5'));if(ut[_0x81ca('0x8c')](_0x51d396)>=_0x165467['dialGlobalMaxRetry']){_0x2a732f=ut[_0x81ca('0xa9')](_0x51d396,0xf,_0x81ca('0x8f'));rpcDb[_0x81ca('0x91')](_0x2a732f,_0x81ca('0xb6'));}else{if(_0x51d396[_0x81ca('0xb4')]>=_0x165467['dialNoAnswerMaxRetry']){rpcDb[_0x81ca('0x91')](_0x51d396,_0x81ca('0xb5'));}else{rpcDb[_0x81ca('0xad')](ut[_0x81ca('0xae')](_0x51d396,_0x81ca('0xb4'),_0x165467[_0x81ca('0xb7')]),_0x51d396[_0x81ca('0xb0')],_0x51d396[_0x81ca('0xb1')]);}}break;case _0x81ca('0xb8'):_0x165467[_0x81ca('0x38')]+=0x1;_0x51d396[_0x81ca('0xb9')]+=0x1;_0x51d396[_0x81ca('0x9e')]=ut['totalGlobal'](_0x51d396);ut[_0x81ca('0x8d')](_0x51d396,0x8,_0x81ca('0xba'));rpcDb['createCustomerHistory'](_0x51d396,_0x81ca('0xbb'));if(ut[_0x81ca('0x8c')](_0x51d396)>=_0x165467[_0x81ca('0x8e')]){_0x2a732f=ut[_0x81ca('0xa9')](_0x51d396,0xf,_0x81ca('0x8f'));rpcDb[_0x81ca('0x91')](_0x2a732f,_0x81ca('0xbc'));}else{if(_0x51d396[_0x81ca('0xb9')]>=_0x165467[_0x81ca('0xbd')]){rpcDb[_0x81ca('0x91')](_0x51d396,_0x81ca('0xbb'));}else{rpcDb[_0x81ca('0xad')](ut[_0x81ca('0xae')](_0x51d396,_0x81ca('0xb9'),_0x165467['dialBusyRetryFrequency']),_0x51d396[_0x81ca('0xb0')],_0x51d396['activeContact']);}}break;case _0x81ca('0xbe'):_0x165467['outboundRejectCallsDay']+=0x1;_0x51d396['countglobal']=ut[_0x81ca('0x8c')](_0x51d396);ut[_0x81ca('0x8d')](_0x51d396,0x14,_0x81ca('0xbf'));rpcDb[_0x81ca('0x82')](_0x51d396,'[syncHangupRequest][logAgentReject]');if(_0x51d396[_0x81ca('0xb0')]){rpcDb[_0x81ca('0xc0')](_0x51d396[_0x81ca('0xc1')]);}if(_0x51d396[_0x81ca('0xb1')]){rpcDb[_0x81ca('0xc2')](_0x51d396[_0x81ca('0xc1')]);}break;default:if(_0x51d396['dialAnswer']){ut[_0x81ca('0x6f')](_0x165467,_0x81ca('0xc3'));ut[_0x81ca('0x70')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x165467[_0x81ca('0x26')],_0x24dc44);}_0x165467[_0x81ca('0x3e')]+=0x1;_0x51d396['countglobal']=ut[_0x81ca('0x8c')](_0x51d396);ut[_0x81ca('0x8d')](_0x51d396,0xc,_0x24dc44[_0x81ca('0xc4')]||_0x24dc44[_0x81ca('0xc5')]);rpcDb['createCustomerHistory'](_0x51d396,_0x81ca('0xc6'));if(ut[_0x81ca('0x8c')](_0x51d396)>=_0x165467[_0x81ca('0x8e')]){_0x2a732f=ut[_0x81ca('0xa9')](_0x51d396,0xf,_0x81ca('0x8f'));rpcDb[_0x81ca('0x91')](_0x2a732f,_0x81ca('0xc7'));}else{rpcDb[_0x81ca('0x91')](_0x51d396,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x81ca('0x61')][_0x24dc44['linkedid']];}if(!(_0x51d396[_0x81ca('0x6e')]&&_0x26d63a==='16')){ut[_0x81ca('0x6c')](_0x165467,_0x81ca('0xc8'));logger[_0x81ca('0x62')](_0x81ca('0xc9'),_0x51d396['uniqueid'],'\x20Queue',_0x165467['name'],_0x81ca('0x65'),_0x165467['originated']);}if(_0x26d63a!==_0x81ca('0xca')){delete this['actions'][_0x24dc44[_0x81ca('0xcb')]];delete this[_0x81ca('0x61')][_0x24dc44['destlinkedid']];}}};Preview[_0x81ca('0xd')][_0x81ca('0xcc')]=function(_0x291de7,_0x40650d,_0xdd04ba){if(_['isUndefined'](_0x40650d)&&_0x81ca('0xcd')!==typeof _0x40650d){return;}if(_['isUndefined'](_0xdd04ba)&&_0x81ca('0xcd')!==typeof _0xdd04ba){return;}switch(_0xdd04ba[_0x81ca('0xce')]){case'0':ut[_0x81ca('0xcf')](_0x291de7,0x0,_0x81ca('0xd0'));rpcDb['createAgentHistory'](_0x291de7,_0x81ca('0xd1'));break;case'3':ut['logAgent'](_0x291de7,0x3,_0x81ca('0xd2'));rpcDb[_0x81ca('0xd3')](_0x291de7,_0x81ca('0xd4'));break;case'5':ut[_0x81ca('0xcf')](_0x291de7,0x5,_0x81ca('0xa7'));rpcDb[_0x81ca('0xd3')](_0x291de7,_0x81ca('0xd5'));break;case'8':ut['logAgent'](_0x291de7,0x8,_0x81ca('0xba'));rpcDb[_0x81ca('0xd3')](_0x291de7,_0x81ca('0xd6'));break;case'22':ut[_0x81ca('0xcf')](_0x291de7,0x16,_0x81ca('0xd7'));rpcDb[_0x81ca('0xd3')](_0x291de7,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x291de7,0xc,_0xdd04ba[_0x81ca('0xce')]);rpcDb[_0x81ca('0xd3')](_0x291de7,'[callProgressDetectingAgent][logCongestion]');}ut[_0x81ca('0x6c')](_0x40650d,'[callProgressDetectingAgent]');logger[_0x81ca('0x62')]('[originated][decrement][callProgressDetectingAgent]',_0x291de7[_0x81ca('0x93')],_0x81ca('0xa6'),_0x40650d['name'],_0x81ca('0x65'),_0x40650d['originated']);delete this[_0x81ca('0x61')][_0x291de7[_0x81ca('0x93')]];};Preview[_0x81ca('0xd')][_0x81ca('0xd8')]=function(_0x2a507e,_0x294eb0,_0x5f03ab,_0x310d8e,_0x3a4aa6){var _0x15952b=this;return new BPromise(function(_0x370d4c,_0x465c30){if(_[_0x81ca('0x60')](_0x294eb0)||_[_0x81ca('0x60')](_0x294eb0['Contact'])||_['isNil'](_0x294eb0[_0x81ca('0xd9')][_0x81ca('0xda')])||_['isNil'](_0x294eb0['VoiceQueueId'])){_0x465c30(ut['message']('Contact\x20is\x20undefined',_0x310d8e,_0x3a4aa6));return;}var _0x31440c=uuid['v4']();var _0x3baefc=_0x15952b[_0x81ca('0x10')][_0x294eb0[_0x81ca('0x63')][_0x81ca('0x26')]];var _0x59be30=_0x5f03ab?_0x15952b[_0x81ca('0x13')][_0x5f03ab]['id']:undefined;_0x15952b[_0x81ca('0x61')][_0x31440c]=new Action(_0x294eb0,_0x3baefc,_0x31440c,_0x5f03ab,_0x59be30);var _0x3cd88f=_0x15952b['actions'][_0x31440c];_0x3cd88f[_0x81ca('0xb0')]=_0x310d8e;_0x3cd88f[_0x81ca('0xb1')]=_0x3a4aa6;_0x3cd88f[_0x81ca('0xdb')]=_0x5f03ab;if(_[_0x81ca('0xdc')](_0x2a507e)){_0x15952b[_0x81ca('0xdd')](_0x3cd88f,_0x3baefc,_0x294eb0,_0x5f03ab)[_0x81ca('0xde')](function(_0x2d5bb4){logger['info'](_0x81ca('0xdf'),'Queue:\x20'+_0x3cd88f[_0x81ca('0x64')]+_0x81ca('0xe0')+_0x3cd88f[_0x81ca('0xc1')],JSON[_0x81ca('0x4d')](_0x2d5bb4));ami[_0x81ca('0x23')]('custom:agentcalled',ut['buildObj'](_0x3cd88f,'called'));_0x370d4c(ut[_0x81ca('0x47')](_0x81ca('0xe1')));})['catch'](function(_0x2d029e){ut[_0x81ca('0x56')](_0x81ca('0xe2'),_0x2d029e);_0x465c30(ut[_0x81ca('0x47')](_0x81ca('0xe3'),_0x310d8e,_0x3a4aa6));});}else{_0x3baefc['outboundBlacklistCallsDay']+=0x1;ut[_0x81ca('0xe4')](_0x3cd88f);rpcDb[_0x81ca('0xe5')](_0x3cd88f,_0x81ca('0xe6'));delete _0x15952b[_0x81ca('0x61')][_0x31440c];_0x465c30(ut[_0x81ca('0x47')](_0x81ca('0xe7'),_0x310d8e,_0x3a4aa6));}});};Preview['prototype'][_0x81ca('0x87')]=function(_0x37c2e9){return!_['isNil'](_0x37c2e9)&&!_[_0x81ca('0x60')](_0x37c2e9[_0x81ca('0x26')])&&!_['isNil'](_0x37c2e9['active'])&&_0x37c2e9[_0x81ca('0x4a')]&&!_[_0x81ca('0x60')](this[_0x81ca('0x12')][util[_0x81ca('0x4f')](_0x81ca('0xe8'),_0x37c2e9[_0x81ca('0x26')])])&&!_[_0x81ca('0x60')](this['trunks'][util[_0x81ca('0x4f')](_0x81ca('0xe8'),_0x37c2e9[_0x81ca('0x26')])][_0x81ca('0x6a')])&&(this['trunks'][util['format'](_0x81ca('0xe8'),_0x37c2e9[_0x81ca('0x26')])][_0x81ca('0x6a')]==='reachable'||this[_0x81ca('0x12')][util['format'](_0x81ca('0xe8'),_0x37c2e9['name'])]['status']===_0x81ca('0xe9'));};Preview['prototype'][_0x81ca('0x78')]=function(_0x3bb19e,_0x34790a){var _0x41f00c=this;return new BPromise(function(_0x292d50,_0x122d48){_0x41f00c[_0x81ca('0xea')](_0x3bb19e,_0x34790a)[_0x81ca('0xde')](function(_0x15d042){_0x292d50(_[_0x81ca('0xeb')](_0x15d042,['message']));})[_0x81ca('0x7a')](function(_0x3c1906){if(_0x3c1906[_0x81ca('0xec')]){rpcDb[_0x81ca('0xc0')](_0x3bb19e);}if(_0x3c1906[_0x81ca('0x4a')]){rpcDb[_0x81ca('0xc2')](_0x3bb19e);}_0x122d48(_[_0x81ca('0xeb')](_0x3c1906,[_0x81ca('0x47')]));});});};Preview[_0x81ca('0xd')][_0x81ca('0xea')]=function(_0x5681d2,_0x323a1d){var _0x3caaab=this;return new BPromise(function(_0x5c7c32,_0x548410){var _0x7a3f6e,_0x1df2b1;rpcDb['getContactPreview'](_0x5681d2)[_0x81ca('0xde')](function(_0x216547){if(!_[_0x81ca('0x60')](_0x216547[0x0])){_0x1df2b1=_0x216547[0x0]['recallme']?![]:!![];_0x7a3f6e=_0x216547[0x0][_0x81ca('0xed')]?!![]:![];_0x7a3f6e=_0x323a1d?!![]:_0x7a3f6e;}var _0x2e0edf=_0x3caaab['validateContact'](_0x216547);if(_0x2e0edf['isValid']){rpcDb['checkIsBlackList'](_[_0x81ca('0xeb')](_0x216547[0x0],[_0x81ca('0x67'),'Contact.phone']))['then'](function(_0x1b6507){_0x3caaab[_0x81ca('0xd8')](_0x1b6507,_0x216547[0x0],_0x323a1d,_0x1df2b1,_0x7a3f6e)[_0x81ca('0xde')](function(_0xc78f82){_0x5c7c32(_0xc78f82);})[_0x81ca('0x7a')](function(_0x2403e6){_0x548410(_0x2403e6);});})[_0x81ca('0x7a')](function(_0x44978c){ut['logger'](_0x81ca('0xee'),_0x44978c);_0x548410(ut['message']('Call\x20unsuccessful',_0x1df2b1,_0x7a3f6e));});}else{_0x548410(ut[_0x81ca('0x47')](_0x2e0edf[_0x81ca('0x47')],_0x1df2b1,_0x7a3f6e));}})[_0x81ca('0x7a')](function(_0x47cb1a){ut[_0x81ca('0x56')]('[Preview][getContactPreview]',_0x47cb1a);_0x548410(ut['message'](_0x81ca('0xef'),![],!![]));});});};Preview[_0x81ca('0xd')][_0x81ca('0xf0')]=function(_0x53e9d3){if(_[_0x81ca('0x60')](_0x53e9d3)||_['isEmpty'](_0x53e9d3)||!_['isNil'](_0x53e9d3[0x0]['Agent'])&&_[_0x81ca('0x60')](_0x53e9d3[0x0][_0x81ca('0xf1')][_0x81ca('0x26')])){ut[_0x81ca('0x56')]('[Preview][validateContact][Empty\x20Contact]',_0x53e9d3);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x69d396=this[_0x81ca('0x10')][_0x53e9d3[0x0][_0x81ca('0x63')]['name']];_0x69d396[_0x81ca('0x47')]='ACTIVE';if(_[_0x81ca('0x60')](_0x69d396)){ut[_0x81ca('0x56')]('[Preview][validateContact][Empty\x20Campaign]',_0x69d396);return{'isValid':![],'message':_0x81ca('0xf2')};}if(!this['isTrunkReachable'](_0x69d396[_0x81ca('0x49')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x81ca('0xf3')+_0x69d396['name']+_0x81ca('0xf4'));if(!this[_0x81ca('0x87')](_0x69d396[_0x81ca('0x88')])){ut['logger'](_0x81ca('0xf5'),_0x69d396[_0x81ca('0x26')]+_0x81ca('0xf6'));return{'isValid':![],'message':_0x81ca('0xf7')};}}if(!ut[_0x81ca('0x86')](_0x69d396[_0x81ca('0x30')])){ut[_0x81ca('0x56')](_0x81ca('0xf8'),_0x69d396[_0x81ca('0x26')]+_0x81ca('0xf9'));return{'isValid':![],'message':_0x81ca('0xf3')+_0x69d396[_0x81ca('0x26')]+_0x81ca('0xf9')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x81ca('0xd')]['execCall']=function(_0x54a78f,_0x33672b,_0x9d5921,_0x152c5e){var _0x1faa90=this;return new BPromise(function(_0x12745e,_0x1dac60){var _0x15100f=_0x54a78f['uniqueid'];var _0xa9aedd=_0x1faa90[_0x81ca('0x87')](_0x33672b[_0x81ca('0x49')])?util['format']('SIP/%s/%s%s',_0x33672b[_0x81ca('0x49')][_0x81ca('0x26')],_[_0x81ca('0x60')](_0x33672b['dialPrefix'])?'':_0x33672b[_0x81ca('0x34')][_0x81ca('0xfa')]()||'',_0x33672b['dialCutDigit']>0x0?_0x9d5921[_0x81ca('0xd9')]['phone']['substring'](_0x33672b['dialCutDigit']):_0x9d5921[_0x81ca('0xd9')][_0x81ca('0xda')]):util[_0x81ca('0x4f')]('SIP/%s/%s%s',_[_0x81ca('0x60')](_0x33672b[_0x81ca('0x88')])?_0x33672b['Trunk'][_0x81ca('0x26')]:_0x33672b[_0x81ca('0x88')][_0x81ca('0x26')],_[_0x81ca('0x60')](_0x33672b[_0x81ca('0x34')])?'':_0x33672b[_0x81ca('0x34')][_0x81ca('0xfa')]()||'',_0x33672b[_0x81ca('0xfb')]>0x0?_0x9d5921[_0x81ca('0xd9')][_0x81ca('0xda')]['substring'](_0x33672b[_0x81ca('0xfb')]):_0x9d5921[_0x81ca('0xd9')][_0x81ca('0xda')]);var _0x1ec5ed=_0x1faa90['isTrunkReachable'](_0x33672b[_0x81ca('0x49')])?ut[_0x81ca('0xfc')](_0x33672b[_0x81ca('0x49')][_0x81ca('0x4b')],_0x33672b['dialOriginateCallerIdName'],_0x33672b['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x33672b[_0x81ca('0x33')],_0x33672b['dialRandomLastDigitCallerIdNumber']):_0x33672b[_0x81ca('0x33')]):ut[_0x81ca('0xfc')](_[_0x81ca('0x60')](_0x33672b[_0x81ca('0x88')])?_0x33672b[_0x81ca('0x49')][_0x81ca('0x4b')]:_0x33672b[_0x81ca('0x88')][_0x81ca('0x4b')],_0x33672b[_0x81ca('0x32')],_0x33672b['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x33672b[_0x81ca('0x33')],_0x33672b[_0x81ca('0xfd')]):_0x33672b['dialOriginateCallerIdNumber']);if(_0x1ec5ed){_0x54a78f[_0x81ca('0xfe')]=ut[_0x81ca('0xff')](_0x1ec5ed);_0x54a78f[_0x81ca('0x100')]=ut[_0x81ca('0x101')](_0x1ec5ed);}var _0x427448=ut[_0x81ca('0x102')](_0x33672b,_0x9d5921,_0xa9aedd,_0x1ec5ed,_0x15100f,_0x54a78f);_[_0x81ca('0x103')](_0x54a78f,ut[_0x81ca('0x104')](_0x427448));_0x54a78f[_0x81ca('0x7c')]=moment()[_0x81ca('0x4f')](_0x81ca('0x7d'));ami[_0x81ca('0x69')](ut[_0x81ca('0x105')](_0x54a78f,_0x33672b,_0x427448,_0x54a78f[_0x81ca('0xb1')],_0x152c5e))[_0x81ca('0xde')](function(_0xf27786){_0x33672b[_0x81ca('0x48')]+=0x1;logger[_0x81ca('0x62')](_0x81ca('0x106'),_0x15100f,_0x81ca('0xa6'),_0x33672b[_0x81ca('0x26')],'originated:\x20',_0x33672b[_0x81ca('0x48')]);_0x12745e(_0xf27786);})['catch'](function(_0x3d11d8){ut['logAgent'](_0x54a78f,0xe,_0x81ca('0x107'));rpcDb[_0x81ca('0xd3')](_0x54a78f,_0x81ca('0x108'));_0x1dac60(_0x3d11d8);});});};Preview[_0x81ca('0xd')][_0x81ca('0x1d')]=function(_0x47d111){if(this[_0x81ca('0x61')][_0x47d111[_0x81ca('0xcb')]]){this[_0x81ca('0x61')][_0x47d111[_0x81ca('0xcb')]][_0x81ca('0x109')]=_0x47d111[_0x81ca('0x109')];}};Preview[_0x81ca('0xd')]['syncOriginateResponse']=function(_0x531c99){var _0x27ad42=this;var _0x52f2ea=this[_0x81ca('0x61')][_0x531c99[_0x81ca('0x10a')]];if(_0x52f2ea){if(_0x52f2ea[_0x81ca('0xdb')]&&this['agents'][_0x52f2ea[_0x81ca('0xdb')]]){ut['logLookAgent'](_0x52f2ea,this[_0x81ca('0x13')][_0x52f2ea[_0x81ca('0xdb')]]['name'],this[_0x81ca('0x13')][_0x52f2ea[_0x81ca('0xdb')]]['id']);}var _0xfe136d=_['clone'](_0x52f2ea);_0xfe136d[_0x81ca('0x10b')]=moment()[_0x81ca('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');var _0x34bf5d=_0x27ad42[_0x81ca('0x10')][_0x52f2ea[_0x81ca('0x64')]];if(ut[_0x81ca('0x10c')](_0x531c99[_0x81ca('0x10d')])){if(_0x52f2ea[_0x81ca('0xb0')]){rpcDb['unlockContact'](_0x52f2ea[_0x81ca('0xc1')]);}if(_0x52f2ea[_0x81ca('0xb1')]){rpcDb[_0x81ca('0xc2')](_0x52f2ea[_0x81ca('0xc1')]);}ami[_0x81ca('0x23')](_0x81ca('0x10e'),ut[_0x81ca('0x96')](_0x52f2ea,_0x81ca('0x10f')));this['callProgressDetectingAgent'](_0xfe136d,_0x34bf5d,_0x531c99);}else{_0x52f2ea[_0x81ca('0x7c')]=moment()[_0x81ca('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x81ca('0xcf')](_0xfe136d,0x4,'Answer');rpcDb[_0x81ca('0xd3')](_0xfe136d,_0x81ca('0x110'));}}};Preview[_0x81ca('0xd')]['syncHangup']=function(_0x1453a8){var _0x55ce97=this;var _0x47c73d=this['actions'][_0x1453a8[_0x81ca('0xcb')]];var _0x316efd;if(_0x47c73d){_0x316efd=this[_0x81ca('0x10')][_0x47c73d['queue']];logger[_0x81ca('0x62')](_0x81ca('0x111'),_0x1453a8[_0x81ca('0xcb')],_0x81ca('0xa6'),_0x316efd[_0x81ca('0x26')],_0x81ca('0x94'),_0x316efd[_0x81ca('0x53')]);}if(this['actions'][_0x1453a8[_0x81ca('0xcb')]]&&_0x1453a8[_0x81ca('0xcb')]!==_0x1453a8['uniqueid']){if(_0x1453a8[_0x81ca('0x112')]==='16'&&this['actions'][_0x1453a8[_0x81ca('0xcb')]][_0x81ca('0x6e')]){this[_0x81ca('0x8b')](_0x1453a8,_0x1453a8[_0x81ca('0xcb')],_0x1453a8[_0x81ca('0x112')]);}else if(this[_0x81ca('0x61')][_0x1453a8[_0x81ca('0xcb')]][_0x81ca('0x6e')]){logger[_0x81ca('0x62')](_0x81ca('0x113'),_0x1453a8['linkedid'],_0x1453a8['cause'],_0x81ca('0xa6'),_0x316efd['name'],_0x81ca('0x94'),_0x316efd['pTalking']);this['callProgressDetectingCustomer'](_0x1453a8,_0x1453a8['linkedid'],_0x1453a8[_0x81ca('0x112')]);}}else if(_0x47c73d&&_[_0x81ca('0x60')](_0x47c73d[_0x81ca('0x114')])&&_0x316efd[_0x81ca('0x115')]&&_0x1453a8[_0x81ca('0xcb')]===_0x1453a8[_0x81ca('0x93')]&&_['isNil'](_0x1453a8[_0x81ca('0xce')])&&_0x1453a8[_0x81ca('0x112')]==='16'&&_0x1453a8[_0x81ca('0x116')]==='6'&&_[_0x81ca('0x117')](_0x47c73d[_0x81ca('0x118')])){if(_0x47c73d[_0x81ca('0xb0')]){rpcDb['unlockContact'](_0x47c73d[_0x81ca('0xc1')]);}if(_0x47c73d[_0x81ca('0xb1')]){rpcDb[_0x81ca('0xc2')](_0x47c73d[_0x81ca('0xc1')]);}_0x1453a8['reason']='22';this['callProgressDetectingAgent'](_0x47c73d,_0x316efd,_0x1453a8);}else if(_0x47c73d&&_0x47c73d[_0x81ca('0x118')]){if(_0x1453a8[_0x81ca('0x112')]==='16'&&this[_0x81ca('0x61')][_0x1453a8['linkedid']][_0x81ca('0x6e')]){logger['info'](_0x81ca('0x119'),_0x1453a8[_0x81ca('0xcb')],_0x1453a8['cause'],_0x81ca('0xa6'),_0x316efd[_0x81ca('0x26')],'pTalking:\x20',_0x316efd[_0x81ca('0x53')]);this[_0x81ca('0x8b')](_0x1453a8,_0x1453a8[_0x81ca('0xcb')],_0x1453a8[_0x81ca('0x112')]);}else if(this[_0x81ca('0x61')][_0x1453a8['linkedid']][_0x81ca('0x6e')]){logger[_0x81ca('0x62')]('[syncHangup][talking][cause]',_0x1453a8[_0x81ca('0xcb')],_0x1453a8['cause'],_0x81ca('0xa6'),_0x316efd[_0x81ca('0x26')],_0x81ca('0x94'),_0x316efd[_0x81ca('0x53')]);this['callProgressDetectingCustomer'](_0x1453a8,_0x1453a8[_0x81ca('0xcb')],_0x1453a8[_0x81ca('0x112')]);}}};Preview[_0x81ca('0xd')][_0x81ca('0x1b')]=function(_0x42ffea){if(this['actions'][_0x42ffea['destlinkedid']]&&_0x42ffea[_0x81ca('0x11a')]!==_0x42ffea[_0x81ca('0x11b')]){this[_0x81ca('0x8b')](_0x42ffea,_0x42ffea['destlinkedid'],_0x42ffea[_0x81ca('0xc5')]);}};Preview[_0x81ca('0xd')]['syncHangupRequest']=function(_0xf3f7b0){if(this[_0x81ca('0x61')][_0xf3f7b0['linkedid']]&&_0xf3f7b0['linkedid']!==_0xf3f7b0[_0x81ca('0x93')]&&!this[_0x81ca('0x61')][_0xf3f7b0[_0x81ca('0xcb')]]['dialAnswer']){if(_0xf3f7b0[_0x81ca('0x112')]==='1'){this['callProgressDetectingCustomer'](_0xf3f7b0,_0xf3f7b0[_0x81ca('0xcb')],_0xf3f7b0[_0x81ca('0x112')]);}}};Preview['prototype'][_0x81ca('0x11c')]=function(_0x1716bb,_0x3010b4,_0x4dd58e){if(this[_0x81ca('0x61')][_0x1716bb]){if(_['isNil'](this[_0x81ca('0x61')][_0x1716bb][_0x81ca('0x11d')])){this[_0x81ca('0x61')][_0x1716bb][_0x81ca('0x11d')]={};}this[_0x81ca('0x61')][_0x1716bb]['variables'][_0x3010b4]=_0x4dd58e;}};Preview[_0x81ca('0xd')]['syncVarSet']=function(_0x389e02){try{if(!_[_0x81ca('0x60')](_0x389e02)){if(ut[_0x81ca('0x11e')](_[_0x81ca('0x11f')](_0x389e02[_0x81ca('0x120')])[0x0])){this[_0x81ca('0x11c')](_0x389e02[_0x81ca('0x93')],_[_0x81ca('0x11f')](_0x389e02['variable'])[0x0],_0x389e02[_0x81ca('0x121')]);}}}catch(_0x557747){logger[_0x81ca('0x122')](_0x81ca('0x123'),util[_0x81ca('0x124')](_0x557747,{'showHidden':![],'depth':null}));}};Preview[_0x81ca('0xd')][_0x81ca('0x125')]=function(_0x2f7848){if(_0x2f7848){if(this[_0x81ca('0x61')][_0x2f7848[_0x81ca('0x126')]]){this[_0x81ca('0x61')][_0x2f7848[_0x81ca('0x126')]]['transfer']=!![];}}};Preview['prototype'][_0x81ca('0x127')]=function(_0x5aa141){if(_0x5aa141){if(this['actions'][_0x5aa141[_0x81ca('0x128')]]){this[_0x81ca('0x61')][_0x5aa141['transfererlinkedid']]['transfer']=!![];}}};module[_0x81ca('0x129')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index a78bd57..191e200 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 _0xbe88=['disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20'];(function(_0x58bf7c,_0x1ab137){var _0x292f7f=function(_0x20a4d5){while(--_0x20a4d5){_0x58bf7c['push'](_0x58bf7c['shift']());}};_0x292f7f(++_0x1ab137);}(_0xbe88,0x143));var _0x8be8=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0xbe88[_0x284807];return _0x50c774;};'use strict';var util=require('util');var BPromise=require(_0x8be8('0x0'));var logger=require(_0x8be8('0x1'))(_0x8be8('0x2'));var _=require(_0x8be8('0x3'));var cmHopper=require(_0x8be8('0x4'));var cmHopperFinal=require(_0x8be8('0x5'));var cmHopperHistory=require(_0x8be8('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x8be8('0x7'));var agentReportPreview=require(_0x8be8('0x8'));var voiceQueueReport=require(_0x8be8('0x9'));function loggerCatch(_0x5a85a0){return function(_0x219c3b){logger[_0x8be8('0xa')](_0x5a85a0,util[_0x8be8('0xb')](_0x219c3b,{'showHidden':![],'depth':null}));};}function create(_0x5674dd){return BPromise[_0x8be8('0xc')]()[_0x8be8('0xd')](cmHopperHistory[_0x8be8('0xe')](_0x5674dd))[_0x8be8('0xf')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x16fa3b){return BPromise[_0x8be8('0xc')]()[_0x8be8('0xd')](agentReportPreview['createHistory'](_0x16fa3b))[_0x8be8('0xf')](loggerCatch(_0x8be8('0x10')));}function moveContact(_0x1d083b){return BPromise[_0x8be8('0xc')]()[_0x8be8('0xd')](cmHopper[_0x8be8('0x11')](_0x1d083b,!![]))[_0x8be8('0xf')](loggerCatch(_0x8be8('0x12')));}exports[_0x8be8('0x13')]=function(_0x1b8caf){return BPromise[_0x8be8('0xc')]()[_0x8be8('0xd')](cmHopperBlack[_0x8be8('0x13')](_0x1b8caf))[_0x8be8('0xf')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x8be8('0x14')]=function(_0x590e90){return BPromise[_0x8be8('0xc')]()[_0x8be8('0xd')](cmHopper[_0x8be8('0x14')](_0x590e90))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0x8be8('0xe')]=function(_0x1d67ab,_0x3ce8d1){create(_0x1d67ab)[_0x8be8('0xf')](loggerCatch(_0x3ce8d1));moveContact(_0x1d67ab)['catch'](loggerCatch(_0x3ce8d1));};exports[_0x8be8('0x15')]=function(_0x3fa7c7,_0x42bee3){createAgent(_0x3fa7c7)['catch'](loggerCatch(_0x42bee3));};exports[_0x8be8('0x16')]=function(_0x24fd21,_0x3c7f5e){create(_0x24fd21)[_0x8be8('0xf')](loggerCatch(_0x3c7f5e));};exports[_0x8be8('0x17')]=function(_0x1a3c43,_0x39193d){moveContact(_0x1a3c43)[_0x8be8('0xf')](loggerCatch(_0x39193d));};exports[_0x8be8('0x18')]=function(_0x427c8c,_0x1b0712,_0x20a4a3){if(_0x1b0712){_0x427c8c[_0x8be8('0x19')]=null;}if(_0x20a4a3){_0x427c8c[_0x8be8('0x1a')]=![];}return BPromise[_0x8be8('0xc')]()[_0x8be8('0xd')](cmHopper['rescheduleContact'](_0x427c8c))[_0x8be8('0xf')](loggerCatch(_0x8be8('0x1b')));};exports[_0x8be8('0x1c')]=function(_0x34e17e){return BPromise[_0x8be8('0xc')]()[_0x8be8('0xd')](cmHopper[_0x8be8('0x1c')](_0x34e17e))[_0x8be8('0xf')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x2d7fb5){return BPromise[_0x8be8('0xc')]()['then'](cmHopper[_0x8be8('0x1d')]({'UserId':null},_0x2d7fb5,0x1))[_0x8be8('0xf')](loggerCatch(_0x8be8('0x1e')));};exports[_0x8be8('0x1f')]=function(_0x58e35a){return BPromise[_0x8be8('0xc')]()['then'](cmHopper[_0x8be8('0x1d')]({'active':![]},_0x58e35a,0x1))[_0x8be8('0xf')](loggerCatch(_0x8be8('0x20')));};exports['crateCustomerReportQueue']=function(_0x44ef37){var _0x420bbf={};_0x420bbf['type']=_0x44ef37[_0x8be8('0x21')];_0x420bbf[_0x8be8('0x22')]=_0x44ef37['uniqueid'];_0x420bbf['calleridnum']=_0x44ef37[_0x8be8('0x23')];_0x420bbf[_0x8be8('0x24')]=_0x44ef37[_0x8be8('0x24')];_0x420bbf[_0x8be8('0x25')]=_0x44ef37[_0x8be8('0x25')];_0x420bbf[_0x8be8('0x26')]=_0x44ef37[_0x8be8('0x27')];_0x420bbf[_0x8be8('0x28')]=_0x44ef37['answertime'];_0x420bbf[_0x8be8('0x29')]=0x1;_0x420bbf[_0x8be8('0x2a')]=_0x44ef37[_0x8be8('0x2b')];_0x420bbf[_0x8be8('0x2c')]=_0x44ef37[_0x8be8('0x2d')];_0x420bbf[_0x8be8('0x2e')]=_0x8be8('0x2f');_0x420bbf[_0x8be8('0x30')]=_0x8be8('0x31');_0x420bbf[_0x8be8('0x32')]=0x0;_0x420bbf[_0x8be8('0x33')]=0x1;_0x420bbf[_0x8be8('0x34')]=_0x44ef37['membername'];_0x420bbf['queuecallerexitreason']='COMPLETED';return BPromise[_0x8be8('0xc')]()[_0x8be8('0xd')](voiceQueueReport[_0x8be8('0x35')](_0x420bbf))[_0x8be8('0xf')](loggerCatch(_0x8be8('0x36')));};exports[_0x8be8('0x37')]=function(_0x4f5488,_0x306fa6){return BPromise[_0x8be8('0xc')]()['then'](cmHopper[_0x8be8('0x37')](_0x4f5488,_0x306fa6))['catch'](loggerCatch(_0x8be8('0x38')));};exports[_0x8be8('0x39')]=function(_0xc5018e){return BPromise[_0x8be8('0xc')]()[_0x8be8('0xd')](cmHopper['rescheduleContact'](_0xc5018e,!![],!![]))['catch'](loggerCatch(_0x8be8('0x3a')));}; \ No newline at end of file +var _0xce73=['exten','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','preview','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','then','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0xce73,0x102));var _0x3ce7=function(_0x30875e,_0x231a39){_0x30875e=_0x30875e-0x0;var _0x4638f9=_0xce73[_0x30875e];return _0x4638f9;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x3ce7('0x0'));var _=require(_0x3ce7('0x1'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x3ce7('0x2'));var cmHopperBlack=require(_0x3ce7('0x3'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x3ce7('0x4'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x4d8577){return function(_0x3c0719){logger[_0x3ce7('0x5')](_0x4d8577,util[_0x3ce7('0x6')](_0x3c0719,{'showHidden':![],'depth':null}));};}function create(_0x5dbc0f){return BPromise['resolve']()[_0x3ce7('0x7')](cmHopperHistory[_0x3ce7('0x8')](_0x5dbc0f))[_0x3ce7('0x9')](loggerCatch(_0x3ce7('0xa')));}function createAgent(_0x5586c9){return BPromise[_0x3ce7('0xb')]()[_0x3ce7('0x7')](agentReportPreview[_0x3ce7('0x8')](_0x5586c9))[_0x3ce7('0x9')](loggerCatch(_0x3ce7('0xa')));}function moveContact(_0x52e541){return BPromise['resolve']()[_0x3ce7('0x7')](cmHopper[_0x3ce7('0xc')](_0x52e541,!![]))[_0x3ce7('0x9')](loggerCatch(_0x3ce7('0xd')));}exports['checkIsBlackList']=function(_0x5648a6){return BPromise[_0x3ce7('0xb')]()[_0x3ce7('0x7')](cmHopperBlack[_0x3ce7('0xe')](_0x5648a6))[_0x3ce7('0x9')](loggerCatch(_0x3ce7('0xf')));};exports[_0x3ce7('0x10')]=function(_0x43cb23){return BPromise[_0x3ce7('0xb')]()['then'](cmHopper[_0x3ce7('0x10')](_0x43cb23))[_0x3ce7('0x9')](loggerCatch('[getContactPreview]\x20'));};exports[_0x3ce7('0x8')]=function(_0x4b726c,_0x51f781){create(_0x4b726c)[_0x3ce7('0x9')](loggerCatch(_0x51f781));moveContact(_0x4b726c)[_0x3ce7('0x9')](loggerCatch(_0x51f781));};exports[_0x3ce7('0x11')]=function(_0xb0026f,_0xc8e806){createAgent(_0xb0026f)['catch'](loggerCatch(_0xc8e806));};exports[_0x3ce7('0x12')]=function(_0x4b2a8f,_0x232628){create(_0x4b2a8f)[_0x3ce7('0x9')](loggerCatch(_0x232628));};exports['createCustomerFinal']=function(_0x4cf8ea,_0x9b52d6){moveContact(_0x4cf8ea)[_0x3ce7('0x9')](loggerCatch(_0x9b52d6));};exports[_0x3ce7('0x13')]=function(_0x5220cb,_0x2fc0dc,_0x3756ca){if(_0x2fc0dc){_0x5220cb[_0x3ce7('0x14')]=null;}if(_0x3756ca){_0x5220cb[_0x3ce7('0x15')]=![];}return BPromise[_0x3ce7('0xb')]()[_0x3ce7('0x7')](cmHopper[_0x3ce7('0x13')](_0x5220cb))['catch'](loggerCatch(_0x3ce7('0x16')));};exports['countReScheduled']=function(_0x4dd9ec){return BPromise[_0x3ce7('0xb')]()[_0x3ce7('0x7')](cmHopper['countReScheduled'](_0x4dd9ec))[_0x3ce7('0x9')](loggerCatch(_0x3ce7('0x17')));};exports['unlockContact']=function(_0x3b4456){return BPromise[_0x3ce7('0xb')]()[_0x3ce7('0x7')](cmHopper[_0x3ce7('0x18')]({'UserId':null},_0x3b4456,0x1))['catch'](loggerCatch(_0x3ce7('0x19')));};exports[_0x3ce7('0x1a')]=function(_0x3f2ae2){return BPromise[_0x3ce7('0xb')]()[_0x3ce7('0x7')](cmHopper['unlockContact']({'active':![]},_0x3f2ae2,0x1))['catch'](loggerCatch(_0x3ce7('0x1b')));};exports['crateCustomerReportQueue']=function(_0x1fa453){var _0x51bbba={};_0x51bbba[_0x3ce7('0x1c')]=_0x1fa453[_0x3ce7('0x1c')];_0x51bbba[_0x3ce7('0x1d')]=_0x1fa453[_0x3ce7('0x1d')];_0x51bbba['calleridnum']=_0x1fa453[_0x3ce7('0x1e')];_0x51bbba[_0x3ce7('0x1f')]=_0x1fa453[_0x3ce7('0x1f')];_0x51bbba[_0x3ce7('0x20')]=_0x1fa453[_0x3ce7('0x20')];_0x51bbba['queuecallerjoinAt']=_0x1fa453[_0x3ce7('0x21')];_0x51bbba[_0x3ce7('0x22')]=_0x1fa453[_0x3ce7('0x21')];_0x51bbba[_0x3ce7('0x23')]=0x1;_0x51bbba[_0x3ce7('0x24')]=_0x1fa453[_0x3ce7('0x25')];_0x51bbba[_0x3ce7('0x26')]=_0x1fa453[_0x3ce7('0x27')];_0x51bbba[_0x3ce7('0x28')]=_0x3ce7('0x29');_0x51bbba[_0x3ce7('0x2a')]='xcally-motion-preview';_0x51bbba['holdtime']=0x0;_0x51bbba[_0x3ce7('0x2b')]=0x1;_0x51bbba[_0x3ce7('0x2c')]=_0x1fa453[_0x3ce7('0x27')];_0x51bbba[_0x3ce7('0x2d')]='COMPLETED';return BPromise[_0x3ce7('0xb')]()[_0x3ce7('0x7')](voiceQueueReport[_0x3ce7('0x2e')](_0x51bbba))[_0x3ce7('0x9')](loggerCatch(_0x3ce7('0x2f')));};exports['getContactRecallMe']=function(_0x218c5a,_0x3f1b3e){return BPromise['resolve']()[_0x3ce7('0x7')](cmHopper['getContactRecallMe'](_0x218c5a,_0x3f1b3e))[_0x3ce7('0x9')](loggerCatch(_0x3ce7('0x30')));};exports['rescheduleContactInQueue']=function(_0x13bd57){return BPromise[_0x3ce7('0xb')]()[_0x3ce7('0x7')](cmHopper[_0x3ce7('0x13')](_0x13bd57,!![],!![]))[_0x3ce7('0x9')](loggerCatch(_0x3ce7('0x31')));}; \ 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 a1a89e9..6d7f326 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 _0x471d=['logCustomer','state','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','IsNotLoggedIn','buildObj','lastevent','queue','interface','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','membername','callback','callbackuniqueid','UserId','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','loggerCatch','info','loggerError','error','inspect','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','endtime','logAgent','ringtime','responsetime','logLookAgent'];(function(_0x2911e1,_0x26ac18){var _0xac5885=function(_0x45e54d){while(--_0x45e54d){_0x2911e1['push'](_0x2911e1['shift']());}};_0xac5885(++_0x26ac18);}(_0x471d,0xde));var _0xd471=function(_0x26c80c,_0x3930d0){_0x26c80c=_0x26c80c-0x0;var _0x3ea0d0=_0x471d[_0x26c80c];return _0x3ea0d0;};'use strict';var util=require(_0xd471('0x0'));var _=require(_0xd471('0x1'));var moment=require(_0xd471('0x2'));var logger=require(_0xd471('0x3'))(_0xd471('0x4'));var ipAgi=process[_0xd471('0x5')][_0xd471('0x6')]||_0xd471('0x7');function getSeconds(_0x26ca24,_0x4c6469){var _0x27e463=moment(_0x26ca24)['milliseconds'](0x0);var _0x5b82fe=moment(_0x4c6469)[_0xd471('0x8')](0x0);return _0x27e463['diff'](_0x5b82fe,'seconds');}exports[_0xd471('0x9')]=function(_0x1e688b){return function(_0x3a9d2a){logger['error'](_0x1e688b,util['inspect'](_0x3a9d2a,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x884bac,_0x798d47){logger[_0xd471('0xa')](_0x884bac,util['inspect'](_0x798d47,{'showHidden':![],'depth':null}));};exports[_0xd471('0xb')]=function(_0x41e06e,_0x3482dc){logger[_0xd471('0xc')](_0x41e06e,util[_0xd471('0xd')](_0x3482dc,{'showHidden':![],'depth':null}));};exports[_0xd471('0xe')]=function(_0x1a3fc2){return function(_0x34417f){logger['info'](_0x1a3fc2,util[_0xd471('0xd')](_0x34417f,{'showHidden':![],'depth':null}));};};exports[_0xd471('0xf')]=function(_0x359be4,_0x4f324e,_0x522bb2){return{'message':_0x359be4,'unlock':_0x4f324e,'active':_0x522bb2};};exports[_0xd471('0x10')]=function(_0x11ee01,_0x4b6221,_0x58ea0d){if(!_[_0xd471('0x11')](_0x58ea0d)&&_0xd471('0x12')===typeof _0x58ea0d&&!_[_0xd471('0x13')](_0x58ea0d)){if(!_['isUndefined'](_0x4b6221)&&_0xd471('0x12')===typeof _0x4b6221&&!_['isEmpty'](_0x4b6221)){return util[_0xd471('0x14')](_0xd471('0x15'),_0x4b6221,_0x58ea0d);}return util['format'](_0xd471('0x15'),_0x58ea0d,_0x58ea0d);}if(!_[_0xd471('0x11')](_0x11ee01)&&_0xd471('0x12')===typeof _0x11ee01&&!_[_0xd471('0x13')](_0x11ee01)){return _0x11ee01;}return _0xd471('0x16');};exports['isActive']=function(_0x2db5da){if(_[_0xd471('0x17')](_0x2db5da)){return![];}return _0x2db5da;};exports[_0xd471('0x18')]=function(_0x51b534,_0x59fc17,_0x358549,_0x5508ad,_0x9a9388,_0xe51b2b){var _0x181935={'XMD-QUEUE':_0x59fc17[_0xd471('0x19')]?_0x59fc17[_0xd471('0x19')][_0xd471('0x1a')]:'','XMD-CALLERID':_0x5508ad,'XMD-CALLERID-PREVIEW':_0xe51b2b?util[_0xd471('0x14')]('\x22%s\x22\x20<%s>',_0xe51b2b[_0xd471('0x1b')],_0xe51b2b['calleridnum']):_0x5508ad,'XMD-DIALID':_0x9a9388,'XMD-CONTACTID':_0x59fc17['ContactId'],'XMD-CDRTYPE':_0xd471('0x1c'),'CALLERID(all)':_0x5508ad,'XMD-VOICEQUEUEID':_0x59fc17[_0xd471('0x1d')],'XMD-DIALCHANNEL':_0x358549,'XMD-DIALTIMEOUT':_0x51b534[_0xd471('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0xd471('0x14')]('\x22rtTxX%s%s\x22',_0x51b534[_0xd471('0x1f')]?'g':'',_[_0xd471('0x13')](_0x51b534['monitor_format'])?'':_0xd471('0x20')),'XMD-DIALURL':_0x51b534['dialPreviewUrl']||'','XMD-AGI':_0x51b534['dialQueueProject']?util[_0xd471('0x14')](_0xd471('0x21'),ipAgi,_0x51b534[_0xd471('0x22')]):_0xd471('0x23'),'XMD-AGIAFTER':_0x51b534[_0xd471('0x1f')]?util[_0xd471('0x14')](_0xd471('0x21'),ipAgi,_0x51b534[_0xd471('0x1f')]):_0xd471('0x23'),'XMD-ORIGINATECALLERIDNUM':_0xe51b2b?_0xe51b2b['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0xe51b2b?_0xe51b2b[_0xd471('0x24')]:'','XMD-DESTINATION':_0xd471('0x25')};if(!_[_0xd471('0x13')](_0x51b534[_0xd471('0x26')])){_0x181935[util[_0xd471('0x14')]('%s',_0xd471('0x27'))]=_0x51b534[_0xd471('0x26')];_0x181935[util[_0xd471('0x14')]('%s',_0xd471('0x28'))]=_0x9a9388;}if(_0x59fc17&&_0x59fc17[_0xd471('0x29')]){for(var _0x55fc70 in _0x59fc17['Contact']){if(_0x59fc17[_0xd471('0x29')][_0xd471('0x2a')](_0x55fc70)){if(!_[_0xd471('0x17')](_0x59fc17[_0xd471('0x29')][_0x55fc70])&&_0x55fc70!=='id'&&_0x55fc70!==_0xd471('0x2b')&&_0x55fc70!=='createdAt'&&_0x55fc70!==_0xd471('0x2c')){_0x181935[util[_0xd471('0x14')](_0xd471('0x2d'),_0xd471('0x2e'),_[_0xd471('0x2f')](_0x55fc70))]=_0x59fc17[_0xd471('0x29')][_0x55fc70];}}}}return _0x181935;};exports[_0xd471('0x30')]=function(_0x45d130){var _0x2573eb={};for(var _0x3da026 in _0x45d130){if(_0x45d130[_0xd471('0x2a')](_0x3da026)){_0x2573eb[util['format']('%s',_[_0xd471('0x31')](_0x3da026))]=_0x45d130[_0x3da026];}}return{'variables':_0x2573eb};};exports[_0xd471('0x32')]=function(_0x1f41e5,_0x35b555){if(!_['isNil'](_0x1f41e5)){if(_0x1f41e5[_0xd471('0x2a')]('originated')){if(_0x1f41e5[_0xd471('0x33')]>0x0){_0x1f41e5[_0xd471('0x33')]-=0x1;}else{logger[_0xd471('0xc')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x35b555);}}}else{logger[_0xd471('0xc')](_0xd471('0x34'),_0x35b555);}};exports['logBlacklist']=function(_0x37ebd2){var _0x231ac2=moment()[_0xd471('0x14')](_0xd471('0x35'));_0x37ebd2['state']=0xd;_0x37ebd2[_0xd471('0x36')]=_0xd471('0x37');_0x37ebd2[_0xd471('0x38')]=_0x231ac2;_0x37ebd2['responsetime']=_0x231ac2;_0x37ebd2[_0xd471('0x39')]=_0x231ac2;};exports[_0xd471('0x3a')]=function(_0x2ee530,_0x1a4319,_0x424b8c){var _0x11cde9=moment()[_0xd471('0x14')](_0xd471('0x35'));_0x2ee530['state']=_0x1a4319;_0x2ee530['statedesc']=_0x424b8c;_0x2ee530['responsetime']=_0x11cde9;_0x2ee530[_0xd471('0x3b')]=getSeconds(_0x2ee530[_0xd471('0x3c')],_0x2ee530[_0xd471('0x38')]);};exports[_0xd471('0x3d')]=function(_0xa40c22,_0x42a47b,_0xccb877){_0xa40c22['membername']=_0x42a47b;_0xa40c22['UserId']=_0xccb877;};exports[_0xd471('0x3e')]=function(_0xc41315,_0x5f3f80,_0x402c84){var _0x32f4dc=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xc41315[_0xd471('0x3f')]=_0x5f3f80;_0xc41315[_0xd471('0x36')]=_0x402c84;_0xc41315['responsetime']=_0xc41315[_0xd471('0x3c')]?_0xc41315[_0xd471('0x3c')]:_0x32f4dc;_0xc41315[_0xd471('0x39')]=_0xc41315['endtime']?_0xc41315[_0xd471('0x39')]:_0x32f4dc;_0xc41315[_0xd471('0x3b')]=getSeconds(_0xc41315[_0xd471('0x3c')]||0x0,_0xc41315[_0xd471('0x38')]||0x0);_0xc41315['talktime']=_0xc41315[_0xd471('0x40')]?getSeconds(_0xc41315['endtime'],_0xc41315[_0xd471('0x40')]):0x0;};exports[_0xd471('0x41')]=function(_0x598994){return _0x598994==='Failure';};exports[_0xd471('0x42')]=function(_0x101ee2,_0x266951,_0x2c0499,_0x2b4e79,_0x213b5c){var _0x13bcd4=_0x2b4e79?_0xd471('0x43'):_0x101ee2['calleridname'];_0x13bcd4=_0x213b5c?_0xd471('0x44'):_0x13bcd4;return{'actionid':_0x101ee2[_0xd471('0x45')],'action':_0xd471('0x46'),'channel':_0x101ee2[_0xd471('0x47')],'callerid':util[_0xd471('0x14')](_0xd471('0x15'),_0x13bcd4,_0x101ee2[_0xd471('0x48')]),'Exten':_0xd471('0x25'),'Context':_0xd471('0x49'),'Priority':'1','variable':_0x2c0499,'timeout':(_0x266951[_0xd471('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x101ee2[_0xd471('0x45')]};};exports[_0xd471('0x4b')]=function(_0x452f97){return _0x452f97[_0xd471('0x4c')]+_0x452f97[_0xd471('0x4d')]+_0x452f97[_0xd471('0x4e')];};exports[_0xd471('0x4f')]=function(_0x3b0d50){var _0xcda227=_[_0xd471('0x50')](_0x3b0d50);_0xcda227[_0xd471('0x3f')]=0xf;_0xcda227[_0xd471('0x36')]='Global';return _0xcda227;};exports[_0xd471('0x51')]=function(_0x18ab66,_0x2f858a,_0x7ed7e){var _0x5549fa={};_0x5549fa[_0x2f858a]=_0x18ab66[_0x2f858a];_0x5549fa[_0xd471('0x52')]=![];_0x5549fa[_0xd471('0x53')]=moment()[_0xd471('0x54')](_0x7ed7e,_0xd471('0x55'))['format'](_0xd471('0x35'));_0x5549fa[_0xd471('0x56')]=_0x18ab66[_0xd471('0x56')];_0x5549fa[_0xd471('0x57')]=_0x18ab66[_0xd471('0x57')];_0x5549fa['VoiceQueueId']=_0x18ab66[_0xd471('0x1d')]||undefined;return _0x5549fa;};exports[_0xd471('0x58')]=function(_0x37712e,_0x1f5a24){if(!_[_0xd471('0x17')](_0x37712e)){if(_0x37712e[_0xd471('0x59')]>0x0){_0x37712e[_0xd471('0x59')]-=0x1;}else{logger[_0xd471('0xc')](_0x1f5a24,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xd471('0xc')](_0x1f5a24,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xd471('0x5a')]=function(_0x45f4f1){if(_0x45f4f1<=0x0){return!![];}return![];};exports[_0xd471('0x5b')]=function(_0x5587c5,_0x317d9c){_0x5587c5[_0xd471('0x5c')]=_0x317d9c;_0x5587c5[_0xd471('0x1a')]=_0x5587c5[_0xd471('0x5d')];_0x5587c5[_0xd471('0x5e')]=_0x5587c5['channelAgent'];return _0x5587c5;};exports[_0xd471('0x5f')]=function(_0x35f642){var _0x155228={};_0x155228[_0xd471('0x5d')]=_0x35f642[_0xd471('0x5d')];_0x155228[_0xd471('0x5e')]=_0x35f642[_0xd471('0x47')];_0x155228[_0xd471('0x45')]=_0x35f642[_0xd471('0x45')];return _0x155228;};exports[_0xd471('0x60')]=function(_0x43558c){var _0x54e5c0=[];for(var _0x513667 in _0x43558c){if(_0x43558c['hasOwnProperty'](_0x513667)){if(!_[_0xd471('0x17')](_0x43558c[_0x513667])&&_0x43558c[_0x513667][_0xd471('0x3f')]===_0xd471('0x61')&&_0x43558c[_0x513667][_0xd471('0x62')]===_0xd471('0x63')){_0x54e5c0[_0xd471('0x64')](_0x43558c[_0x513667]['id']);}}}return _0x54e5c0;};exports[_0xd471('0x65')]=function(_0x340434){var _0x374745=moment()[_0xd471('0x8')](0x0);var _0x2c85ad=moment(_0x340434)[_0xd471('0x8')](0x0);return _0x374745[_0xd471('0x66')](_0x2c85ad,_0xd471('0x67'));};exports[_0xd471('0x68')]=function(_0x2ebc38){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2ebc38[_0xd471('0x56')],'ListId':_0x2ebc38[_0xd471('0x57')],'VoiceQueueId':_0x2ebc38[_0xd471('0x1d')]||undefined,'CampaignId':_0x2ebc38[_0xd471('0x69')]||undefined};};exports[_0xd471('0x6a')]=function(_0x233aa9){if(_0x233aa9===_0xd471('0x45')||_0x233aa9===_0xd471('0x6b')||_0x233aa9===_0xd471('0x5d')||_0x233aa9===_0xd471('0x6c')||_0x233aa9===_0xd471('0x6d')||_0x233aa9==='dialAnswer'||_0x233aa9===_0xd471('0x6e')||_0x233aa9==='channelAgent'||_0x233aa9===_0xd471('0x1b')||_0x233aa9===_0xd471('0x52')||_0x233aa9==='calleridnum'||_0x233aa9===_0xd471('0x53')||_0x233aa9==='countbusyretry'||_0x233aa9===_0xd471('0x4d')||_0x233aa9===_0xd471('0x4e')||_0x233aa9==='countglobal'||_0x233aa9===_0xd471('0x6f')||_0x233aa9===_0xd471('0x70')||_0x233aa9==='callbackat'||_0x233aa9==='recallme'||_0x233aa9===_0xd471('0x56')||_0x233aa9===_0xd471('0x57')||_0x233aa9===_0xd471('0x71')||_0x233aa9===_0xd471('0x1d')||_0x233aa9==='sipcallid'||_0x233aa9===_0xd471('0x72')||_0x233aa9===_0xd471('0x73')||_0x233aa9===_0xd471('0x74')||_0x233aa9===_0xd471('0x75')||_0x233aa9==='xmd-dialurl'||_0x233aa9===_0xd471('0x76')||_0x233aa9===_0xd471('0x77')||_0x233aa9===_0xd471('0x78')||_0x233aa9===_0xd471('0x79')||_0x233aa9===_0xd471('0x7a')||_0x233aa9===_0xd471('0x7b')||_0x233aa9==='xmd-callerid'||_0x233aa9===_0xd471('0x7c')||_0x233aa9==='xmd-agi'||_0x233aa9===_0xd471('0x7d')||_0x233aa9===_0xd471('0x7e')||_0x233aa9==='rtpaudioqosjitter'||_0x233aa9===_0xd471('0x7f')||_0x233aa9===_0xd471('0x80')||_0x233aa9==='rtpaudioqoslossbridged'||_0x233aa9===_0xd471('0x81')||_0x233aa9===_0xd471('0x82')||_0x233aa9===_0xd471('0x7d')||_0x233aa9===_0xd471('0x7e')||_0x233aa9==='rtpaudioqosjitter'||_0x233aa9===_0xd471('0x7f')||_0x233aa9===_0xd471('0x80')||_0x233aa9===_0xd471('0x83')||_0x233aa9==='rtpaudioqosrtt'||_0x233aa9===_0xd471('0x82')||_0x233aa9===_0xd471('0x84')||_0x233aa9===_0xd471('0x85')||_0x233aa9===_0xd471('0x3f')||_0x233aa9===_0xd471('0x36')){return![];}return!![];};exports[_0xd471('0x86')]=function(_0x3dd228,_0x4b4b80){var _0x2867cd,_0x1b448f,_0x12852c;if(_0x4b4b80<=0x0){_0x4b4b80=0x1;}_0x2867cd=new RegExp(_0xd471('0x87')+_0x4b4b80+'}$');_0x1b448f=Math[_0xd471('0x88')](0xa,_0x4b4b80-0x1);_0x12852c=Math['pow'](0xa,_0x4b4b80)-0x1;return util['format']('%s',_[_0xd471('0x89')](_0x3dd228,_0x2867cd,_[_0xd471('0x8a')](_0x1b448f,_0x12852c)));};exports[_0xd471('0x8b')]=function(_0x73a6ee){var _0x557d21=_0x73a6ee[_0xd471('0x8c')](/"(.*?)"/);return _0x557d21?_0x557d21[0x1]:_0x73a6ee;};exports[_0xd471('0x8d')]=function(_0x9667d4){var _0x13014e=_0x9667d4[_0xd471('0x8c')](/<(.*?)>/);return _0x13014e?_0x13014e[0x1]:_0x9667d4;}; \ No newline at end of file +var _0x1ef0=['preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','loggerCatch','logger','info','inspect','error','logger2','message','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','tags','createdAt','updatedAt','XMD-','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','ringtime','logLookAgent','membername','UserId','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','cloneAction','clone','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','idContact','type','campaigntype','dialAnswer','calleridname','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1ef0,0x116));var _0x01ef=function(_0x26e312,_0x4c0fed){_0x26e312=_0x26e312-0x0;var _0x3d73ce=_0x1ef0[_0x26e312];return _0x3d73ce;};'use strict';var util=require(_0x01ef('0x0'));var _=require(_0x01ef('0x1'));var moment=require(_0x01ef('0x2'));var logger=require(_0x01ef('0x3'))(_0x01ef('0x4'));var ipAgi=process[_0x01ef('0x5')][_0x01ef('0x6')]||_0x01ef('0x7');function getSeconds(_0x3a79fd,_0x2333ff){var _0xfa38a0=moment(_0x3a79fd)[_0x01ef('0x8')](0x0);var _0x1224ef=moment(_0x2333ff)[_0x01ef('0x8')](0x0);return _0xfa38a0['diff'](_0x1224ef,_0x01ef('0x9'));}exports[_0x01ef('0xa')]=function(_0x35ee8d){return function(_0x3ecb22){logger['error'](_0x35ee8d,util['inspect'](_0x3ecb22,{'showHidden':![],'depth':null}));};};exports[_0x01ef('0xb')]=function(_0x1815f5,_0x40ad0e){logger[_0x01ef('0xc')](_0x1815f5,util[_0x01ef('0xd')](_0x40ad0e,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x1520b7,_0x4d10a6){logger[_0x01ef('0xe')](_0x1520b7,util['inspect'](_0x4d10a6,{'showHidden':![],'depth':null}));};exports[_0x01ef('0xf')]=function(_0x19d3b1){return function(_0x144410){logger['info'](_0x19d3b1,util[_0x01ef('0xd')](_0x144410,{'showHidden':![],'depth':null}));};};exports[_0x01ef('0x10')]=function(_0x19b0cc,_0x23a035,_0x2a7d75){return{'message':_0x19b0cc,'unlock':_0x23a035,'active':_0x2a7d75};};exports['getCallerId']=function(_0x127154,_0x1b68b3,_0x50b691){if(!_['isUndefined'](_0x50b691)&&_0x01ef('0x11')===typeof _0x50b691&&!_[_0x01ef('0x12')](_0x50b691)){if(!_[_0x01ef('0x13')](_0x1b68b3)&&_0x01ef('0x11')===typeof _0x1b68b3&&!_[_0x01ef('0x12')](_0x1b68b3)){return util[_0x01ef('0x14')](_0x01ef('0x15'),_0x1b68b3,_0x50b691);}return util['format'](_0x01ef('0x15'),_0x50b691,_0x50b691);}if(!_[_0x01ef('0x13')](_0x127154)&&_0x01ef('0x11')===typeof _0x127154&&!_['isEmpty'](_0x127154)){return _0x127154;}return _0x01ef('0x16');};exports[_0x01ef('0x17')]=function(_0xafd565){if(_[_0x01ef('0x18')](_0xafd565)){return![];}return _0xafd565;};exports[_0x01ef('0x19')]=function(_0x5044df,_0x4147c9,_0x48702f,_0x5989a2,_0x2d976f,_0x1f6e81){var _0x5dfa48={'XMD-QUEUE':_0x4147c9[_0x01ef('0x1a')]?_0x4147c9['Queue'][_0x01ef('0x1b')]:'','XMD-CALLERID':_0x5989a2,'XMD-CALLERID-PREVIEW':_0x1f6e81?util[_0x01ef('0x14')](_0x01ef('0x15'),_0x1f6e81['calleridname'],_0x1f6e81[_0x01ef('0x1c')]):_0x5989a2,'XMD-DIALID':_0x2d976f,'XMD-CONTACTID':_0x4147c9[_0x01ef('0x1d')],'XMD-CDRTYPE':_0x01ef('0x1e'),'CALLERID(all)':_0x5989a2,'XMD-VOICEQUEUEID':_0x4147c9[_0x01ef('0x1f')],'XMD-DIALCHANNEL':_0x48702f,'XMD-DIALTIMEOUT':_0x5044df['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0x01ef('0x20'),_0x5044df['dialQueueProject2']?'g':'',_[_0x01ef('0x12')](_0x5044df[_0x01ef('0x21')])?'':_0x01ef('0x22')),'XMD-DIALURL':_0x5044df[_0x01ef('0x23')]||'','XMD-AGI':_0x5044df[_0x01ef('0x24')]?util['format'](_0x01ef('0x25'),ipAgi,_0x5044df['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x5044df[_0x01ef('0x26')]?util[_0x01ef('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5044df[_0x01ef('0x26')]):_0x01ef('0x27'),'XMD-ORIGINATECALLERIDNUM':_0x1f6e81?_0x1f6e81['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x1f6e81?_0x1f6e81[_0x01ef('0x28')]:'','XMD-DESTINATION':_0x01ef('0x29')};if(!_[_0x01ef('0x12')](_0x5044df[_0x01ef('0x21')])){_0x5dfa48[util[_0x01ef('0x14')]('%s',_0x01ef('0x2a'))]=_0x5044df[_0x01ef('0x21')];_0x5dfa48[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x2d976f;}if(_0x4147c9&&_0x4147c9['Contact']){for(var _0x1fd232 in _0x4147c9['Contact']){if(_0x4147c9[_0x01ef('0x2b')]['hasOwnProperty'](_0x1fd232)){if(!_['isNil'](_0x4147c9[_0x01ef('0x2b')][_0x1fd232])&&_0x1fd232!=='id'&&_0x1fd232!==_0x01ef('0x2c')&&_0x1fd232!==_0x01ef('0x2d')&&_0x1fd232!==_0x01ef('0x2e')){_0x5dfa48[util[_0x01ef('0x14')]('%s%s',_0x01ef('0x2f'),_['toUpper'](_0x1fd232))]=_0x4147c9[_0x01ef('0x2b')][_0x1fd232];}}}}return _0x5dfa48;};exports[_0x01ef('0x30')]=function(_0x15fc74){var _0x9b6a8d={};for(var _0x362b4c in _0x15fc74){if(_0x15fc74[_0x01ef('0x31')](_0x362b4c)){_0x9b6a8d[util[_0x01ef('0x14')]('%s',_['toLower'](_0x362b4c))]=_0x15fc74[_0x362b4c];}}return{'variables':_0x9b6a8d};};exports[_0x01ef('0x32')]=function(_0x532e59,_0x3e68ce){if(!_[_0x01ef('0x18')](_0x532e59)){if(_0x532e59[_0x01ef('0x31')](_0x01ef('0x33'))){if(_0x532e59[_0x01ef('0x33')]>0x0){_0x532e59['originated']-=0x1;}else{logger[_0x01ef('0xe')](_0x01ef('0x34'),_0x3e68ce);}}}else{logger[_0x01ef('0xe')](_0x01ef('0x35'),_0x3e68ce);}};exports[_0x01ef('0x36')]=function(_0x3693d){var _0x7ed809=moment()[_0x01ef('0x14')](_0x01ef('0x37'));_0x3693d[_0x01ef('0x38')]=0xd;_0x3693d[_0x01ef('0x39')]=_0x01ef('0x3a');_0x3693d[_0x01ef('0x3b')]=_0x7ed809;_0x3693d['responsetime']=_0x7ed809;_0x3693d['endtime']=_0x7ed809;};exports['logAgent']=function(_0x32e6c5,_0x1f8d8b,_0x374939){var _0x15a3a0=moment()[_0x01ef('0x14')](_0x01ef('0x37'));_0x32e6c5['state']=_0x1f8d8b;_0x32e6c5[_0x01ef('0x39')]=_0x374939;_0x32e6c5[_0x01ef('0x3c')]=_0x15a3a0;_0x32e6c5[_0x01ef('0x3d')]=getSeconds(_0x32e6c5[_0x01ef('0x3c')],_0x32e6c5[_0x01ef('0x3b')]);};exports[_0x01ef('0x3e')]=function(_0x2763cf,_0x3a3428,_0x4a7e08){_0x2763cf[_0x01ef('0x3f')]=_0x3a3428;_0x2763cf[_0x01ef('0x40')]=_0x4a7e08;};exports['logCustomer']=function(_0x21bfab,_0x2d11e2,_0x528662){var _0x489b79=moment()[_0x01ef('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x21bfab[_0x01ef('0x38')]=_0x2d11e2;_0x21bfab[_0x01ef('0x39')]=_0x528662;_0x21bfab[_0x01ef('0x3c')]=_0x21bfab[_0x01ef('0x3c')]?_0x21bfab[_0x01ef('0x3c')]:_0x489b79;_0x21bfab['endtime']=_0x21bfab['endtime']?_0x21bfab['endtime']:_0x489b79;_0x21bfab[_0x01ef('0x3d')]=getSeconds(_0x21bfab['responsetime']||0x0,_0x21bfab[_0x01ef('0x3b')]||0x0);_0x21bfab[_0x01ef('0x41')]=_0x21bfab[_0x01ef('0x42')]?getSeconds(_0x21bfab['endtime'],_0x21bfab[_0x01ef('0x42')]):0x0;};exports[_0x01ef('0x43')]=function(_0x1d61c8){return _0x1d61c8===_0x01ef('0x44');};exports[_0x01ef('0x45')]=function(_0x443c65,_0x502067,_0x4c0e15,_0xbe1d6b,_0x40e0a1){var _0x4657e9=_0xbe1d6b?_0x01ef('0x46'):_0x443c65['calleridname'];_0x4657e9=_0x40e0a1?'BOOKED':_0x4657e9;return{'actionid':_0x443c65[_0x01ef('0x47')],'action':_0x01ef('0x48'),'channel':_0x443c65[_0x01ef('0x49')],'callerid':util[_0x01ef('0x14')](_0x01ef('0x15'),_0x4657e9,_0x443c65['calleridnum']),'Exten':_0x01ef('0x29'),'Context':_0x01ef('0x4a'),'Priority':'1','variable':_0x4c0e15,'timeout':(_0x502067[_0x01ef('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x443c65[_0x01ef('0x47')]};};exports[_0x01ef('0x4c')]=function(_0x426f02){return _0x426f02[_0x01ef('0x4d')]+_0x426f02[_0x01ef('0x4e')]+_0x426f02['countnoanswerretry'];};exports[_0x01ef('0x4f')]=function(_0x2853aa){var _0x37840f=_[_0x01ef('0x50')](_0x2853aa);_0x37840f[_0x01ef('0x38')]=0xf;_0x37840f[_0x01ef('0x39')]='Global';return _0x37840f;};exports[_0x01ef('0x51')]=function(_0x11ff47,_0x4be55c,_0x25fb74){var _0x59579e={};_0x59579e[_0x4be55c]=_0x11ff47[_0x4be55c];_0x59579e[_0x01ef('0x52')]=![];_0x59579e[_0x01ef('0x53')]=moment()[_0x01ef('0x54')](_0x25fb74,_0x01ef('0x55'))[_0x01ef('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x59579e[_0x01ef('0x1d')]=_0x11ff47[_0x01ef('0x1d')];_0x59579e[_0x01ef('0x56')]=_0x11ff47[_0x01ef('0x56')];_0x59579e[_0x01ef('0x1f')]=_0x11ff47[_0x01ef('0x1f')]||undefined;return _0x59579e;};exports[_0x01ef('0x57')]=function(_0x3a366d,_0x1e8611){if(!_[_0x01ef('0x18')](_0x3a366d)){if(_0x3a366d[_0x01ef('0x58')]>0x0){_0x3a366d['pTalking']-=0x1;}else{logger['error'](_0x1e8611,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x01ef('0xe')](_0x1e8611,_0x01ef('0x59'));}};exports[_0x01ef('0x5a')]=function(_0x4bfafc){if(_0x4bfafc<=0x0){return!![];}return![];};exports['buildObj']=function(_0x252911,_0x289322){_0x252911[_0x01ef('0x5b')]=_0x289322;_0x252911['name']=_0x252911[_0x01ef('0x5c')];_0x252911[_0x01ef('0x5d')]=_0x252911[_0x01ef('0x49')];return _0x252911;};exports['buildAcw']=function(_0x449c31){var _0xd8927d={};_0xd8927d[_0x01ef('0x5c')]=_0x449c31[_0x01ef('0x5c')];_0xd8927d[_0x01ef('0x5d')]=_0x449c31['channelAgent'];_0xd8927d[_0x01ef('0x47')]=_0x449c31[_0x01ef('0x47')];return _0xd8927d;};exports[_0x01ef('0x5e')]=function(_0x4ab284){var _0x1ce6fd=[];for(var _0x3903f1 in _0x4ab284){if(_0x4ab284[_0x01ef('0x31')](_0x3903f1)){if(!_[_0x01ef('0x18')](_0x4ab284[_0x3903f1])&&_0x4ab284[_0x3903f1][_0x01ef('0x38')]===_0x01ef('0x5f')&&_0x4ab284[_0x3903f1][_0x01ef('0x60')]===_0x01ef('0x61')){_0x1ce6fd[_0x01ef('0x62')](_0x4ab284[_0x3903f1]['id']);}}}return _0x1ce6fd;};exports[_0x01ef('0x63')]=function(_0x175c02){var _0xad2691=moment()[_0x01ef('0x8')](0x0);var _0x32eb14=moment(_0x175c02)[_0x01ef('0x8')](0x0);return _0xad2691['diff'](_0x32eb14,_0x01ef('0x9'));};exports[_0x01ef('0x64')]=function(_0x50830f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x50830f[_0x01ef('0x1d')],'ListId':_0x50830f['ListId'],'VoiceQueueId':_0x50830f[_0x01ef('0x1f')]||undefined,'CampaignId':_0x50830f[_0x01ef('0x65')]||undefined};};exports['filterKey']=function(_0x17f9a0){if(_0x17f9a0===_0x01ef('0x47')||_0x17f9a0===_0x01ef('0x66')||_0x17f9a0===_0x01ef('0x5c')||_0x17f9a0===_0x01ef('0x67')||_0x17f9a0===_0x01ef('0x68')||_0x17f9a0===_0x01ef('0x69')||_0x17f9a0==='membername'||_0x17f9a0==='channelAgent'||_0x17f9a0===_0x01ef('0x6a')||_0x17f9a0===_0x01ef('0x52')||_0x17f9a0==='calleridnum'||_0x17f9a0==='scheduledat'||_0x17f9a0===_0x01ef('0x4d')||_0x17f9a0===_0x01ef('0x4e')||_0x17f9a0===_0x01ef('0x6b')||_0x17f9a0===_0x01ef('0x6c')||_0x17f9a0===_0x01ef('0x6d')||_0x17f9a0===_0x01ef('0x6e')||_0x17f9a0===_0x01ef('0x6f')||_0x17f9a0===_0x01ef('0x70')||_0x17f9a0===_0x01ef('0x1d')||_0x17f9a0===_0x01ef('0x56')||_0x17f9a0==='UserId'||_0x17f9a0===_0x01ef('0x1f')||_0x17f9a0===_0x01ef('0x71')||_0x17f9a0===_0x01ef('0x72')||_0x17f9a0===_0x01ef('0x73')||_0x17f9a0===_0x01ef('0x74')||_0x17f9a0===_0x01ef('0x75')||_0x17f9a0===_0x01ef('0x76')||_0x17f9a0===_0x01ef('0x77')||_0x17f9a0===_0x01ef('0x78')||_0x17f9a0===_0x01ef('0x79')||_0x17f9a0===_0x01ef('0x7a')||_0x17f9a0==='xmd-contactid'||_0x17f9a0==='xmd-cdrtype'||_0x17f9a0==='xmd-callerid'||_0x17f9a0===_0x01ef('0x7b')||_0x17f9a0===_0x01ef('0x7c')||_0x17f9a0===_0x01ef('0x7d')||_0x17f9a0===_0x01ef('0x7e')||_0x17f9a0==='rtpaudioqosjitter'||_0x17f9a0===_0x01ef('0x7f')||_0x17f9a0==='rtpaudioqosloss'||_0x17f9a0===_0x01ef('0x80')||_0x17f9a0==='rtpaudioqosrtt'||_0x17f9a0==='rtpaudioqosrttbridged'||_0x17f9a0===_0x01ef('0x7d')||_0x17f9a0==='rtpaudioqosbridged'||_0x17f9a0===_0x01ef('0x81')||_0x17f9a0===_0x01ef('0x7f')||_0x17f9a0===_0x01ef('0x82')||_0x17f9a0==='rtpaudioqoslossbridged'||_0x17f9a0===_0x01ef('0x83')||_0x17f9a0===_0x01ef('0x84')||_0x17f9a0==='bridgepeer'||_0x17f9a0==='bridgepvtcallid'||_0x17f9a0===_0x01ef('0x38')||_0x17f9a0===_0x01ef('0x39')){return![];}return!![];};exports[_0x01ef('0x85')]=function(_0x379c13,_0x139027){var _0x269802,_0xe0d0cd,_0x479089;if(_0x139027<=0x0){_0x139027=0x1;}_0x269802=new RegExp(_0x01ef('0x86')+_0x139027+'}$');_0xe0d0cd=Math[_0x01ef('0x87')](0xa,_0x139027-0x1);_0x479089=Math[_0x01ef('0x87')](0xa,_0x139027)-0x1;return util[_0x01ef('0x14')]('%s',_[_0x01ef('0x88')](_0x379c13,_0x269802,_[_0x01ef('0x89')](_0xe0d0cd,_0x479089)));};exports[_0x01ef('0x8a')]=function(_0x563e2d){var _0x4bc6d3=_0x563e2d[_0x01ef('0x8b')](/"(.*?)"/);return _0x4bc6d3?_0x4bc6d3[0x1]:_0x563e2d;};exports[_0x01ef('0x8c')]=function(_0x4bc3d3){var _0x579dfd=_0x4bc3d3[_0x01ef('0x8b')](/<(.*?)>/);return _0x579dfd?_0x579dfd[0x1]:_0x4bc3d3;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index d41f197..03a8bbf 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 _0x938d=['queueadd','string','number','boolean','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x29ecbc,_0x2929d9){var _0x5709b0=function(_0x277721){while(--_0x277721){_0x29ecbc['push'](_0x29ecbc['shift']());}};_0x5709b0(++_0x2929d9);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';exports[_0xd938('0x0')]={'queue':{'type':_0xd938('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xd938('0x1'),'required':!![]},'penalty':{'type':_0xd938('0x2'),'required':![]},'paused':{'type':_0xd938('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xd938('0x1'),'required':!![]}};exports[_0xd938('0x4')]={'interface':{'type':_0xd938('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xd938('0x1'),'required':![]}};exports[_0xd938('0x5')]={'module':{'type':_0xd938('0x1'),'required':![]}};exports[_0xd938('0x6')]={'uniqueid':{'type':_0xd938('0x1'),'required':!![]}};exports[_0xd938('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xd938('0x1')},'format':{'type':_0xd938('0x1')},'mixmonitorid':{'type':_0xd938('0x1')}};exports[_0xd938('0x8')]={'uniqueid':{'type':_0xd938('0x1'),'required':!![]}};exports[_0xd938('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xd938('0x1'),'required':!![]},'context':{'type':_0xd938('0x1')}}; \ No newline at end of file +var _0xc569=['voicequeuechannelredirect','queueadd','string','number','boolean','queuepause','reload','voicechannel'];(function(_0x59d74e,_0x5df42c){var _0x168bc9=function(_0x5f2dc3){while(--_0x5f2dc3){_0x59d74e['push'](_0x59d74e['shift']());}};_0x168bc9(++_0x5df42c);}(_0xc569,0x159));var _0x9c56=function(_0x2a22b0,_0x4c6c79){_0x2a22b0=_0x2a22b0-0x0;var _0x51b2cf=_0xc569[_0x2a22b0];return _0x51b2cf;};'use strict';exports[_0x9c56('0x0')]={'queue':{'type':_0x9c56('0x1'),'required':!![]},'interface':{'type':_0x9c56('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x9c56('0x2'),'required':![]},'paused':{'type':_0x9c56('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x9c56('0x1'),'required':!![]},'interface':{'type':_0x9c56('0x1'),'required':!![]}};exports[_0x9c56('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x9c56('0x3')},'reason':{'type':_0x9c56('0x1'),'required':![]}};exports[_0x9c56('0x5')]={'module':{'type':_0x9c56('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x9c56('0x1'),'required':!![]}};exports[_0x9c56('0x6')]={'uniqueid':{'type':_0x9c56('0x1'),'required':!![]},'filename':{'type':_0x9c56('0x1')},'format':{'type':_0x9c56('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0x9c56('0x7')]={'uniqueid':{'type':_0x9c56('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x9c56('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 6a60d67..8823c36 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 _0x8e51=['../model/faxAccount','agents','telephones','trunks','triggers','campaigns','outbound','voiceExtensions','channels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','total','abandoned','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','isUndefined','mergeFromDatabase','initTelephones','initTrunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','templates','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','unmanaged','diff','queuecallerjoinAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallercomplete','queuecallercompleteAt','queuecallerleaveAt','duration','disposition','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','bluebird','util','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount'];(function(_0x4856b9,_0x4a7368){var _0x38fc55=function(_0x262881){while(--_0x262881){_0x4856b9['push'](_0x4856b9['shift']());}};_0x38fc55(++_0x4a7368);}(_0x8e51,0x1e4));var _0x18e5=function(_0x1d20fc,_0x3b2b92){_0x1d20fc=_0x1d20fc-0x0;var _0x3f4a60=_0x8e51[_0x1d20fc];return _0x3f4a60;};'use strict';var BPromise=require(_0x18e5('0x0'));var util=require(_0x18e5('0x1'));var _=require('lodash');var moment=require(_0x18e5('0x2'));var Agent=require(_0x18e5('0x3'));var Telephone=require(_0x18e5('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x18e5('0x5'));var Trigger=require(_0x18e5('0x6'));var Template=require(_0x18e5('0x7'));var Campaign=require(_0x18e5('0x8'));var VoiceExtension=require(_0x18e5('0x9'));var ZendeskAccount=require(_0x18e5('0xa'));var SalesforceAccount=require(_0x18e5('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x18e5('0xc'));var ZohoAccount=require(_0x18e5('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x18e5('0xe'));var ServicenowAccount=require(_0x18e5('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FaxAccount=require(_0x18e5('0x10'));var Realtime=function(){this[_0x18e5('0x11')]={};this[_0x18e5('0x12')]={};this[_0x18e5('0x13')]={};this['voiceQueues']={};this[_0x18e5('0x14')]={};this[_0x18e5('0x15')]={};this['templates']={};this[_0x18e5('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x18e5('0x17')]={};this[_0x18e5('0x18')]={};this['queueChannels']={};this[_0x18e5('0x19')]={};this[_0x18e5('0x1a')]={};this[_0x18e5('0x1b')]={};this[_0x18e5('0x1c')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0x18e5('0x1d')]={};this[_0x18e5('0x1e')]={};this[_0x18e5('0x1f')]={};this[_0x18e5('0x20')]={};this[_0x18e5('0x21')]={};this[_0x18e5('0x22')]={};};function freeIsNotKey(_0x526eca,_0x23f41d,_0x296fb6){var _0x5b8fb6=_[_0x18e5('0x23')](_0x526eca,function(_0x8a730c,_0x5475eb){return _0x8a730c[_0x296fb6];});for(var _0x34de2e in _0x23f41d){if(_0x23f41d[_0x18e5('0x24')](_0x34de2e)){if(!_0x5b8fb6[_0x34de2e]){delete _0x23f41d[_0x34de2e];}}}}function freeIsNotKeySip(_0x12c082,_0x549ff6){var _0x2b00c6=_[_0x18e5('0x23')](_0x12c082,function(_0x574c52,_0xd46fd4){return util[_0x18e5('0x25')](_0x18e5('0x26'),_0x574c52[_0x18e5('0x27')]);});for(var _0x54d5cf in _0x549ff6){if(_0x549ff6[_0x18e5('0x24')](_0x54d5cf)){if(!_0x2b00c6[_0x54d5cf]){delete _0x549ff6[_0x54d5cf];}}}}function freeIsNotKeyAgent(_0xe65897,_0x33eb14){var _0x3ab49c=_[_0x18e5('0x23')](_0xe65897,function(_0x2063cd,_0x5e0eb7){var _0x19b22e=_[_0x18e5('0x28')](_0x2063cd[_0x18e5('0x29')])?util[_0x18e5('0x25')](_0x18e5('0x26'),_0x2063cd['name']):_0x2063cd[_0x18e5('0x29')];return _0x19b22e;});for(var _0x4f38df in _0x33eb14){if(_0x33eb14['hasOwnProperty'](_0x4f38df)){if(!_0x3ab49c[_0x4f38df]){delete _0x33eb14[_0x4f38df];}}}}function clearVoiceCallReports(_0x4ce866){_0x4ce866['total']=0x0;_0x4ce866[_0x18e5('0x2a')]=0x0;_0x4ce866[_0x18e5('0x2b')]=0x0;_0x4ce866[_0x18e5('0x2c')]=0x0;_0x4ce866[_0x18e5('0x2d')]=0x0;}function clearCampaigns(_0x3dedfc){if(!_[_0x18e5('0x2e')](_0x3dedfc)){for(var _0x3396b6 in _0x3dedfc){if(_0x3dedfc['hasOwnProperty'](_0x3396b6)){_0x3dedfc[_0x3396b6][_0x18e5('0x2f')]=0x0;_0x3dedfc[_0x3396b6]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x4fe3a3){if(!_[_0x18e5('0x2e')](_0x4fe3a3)){for(var _0x37c5eb in _0x4fe3a3){if(_0x4fe3a3[_0x18e5('0x24')](_0x37c5eb)){_0x4fe3a3[_0x37c5eb][_0x18e5('0x30')]=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x2a')]=0x0;_0x4fe3a3[_0x37c5eb]['unmanaged']=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x31')]=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x2b')]=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x2c')]=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x2d')]=0x0;_0x4fe3a3[_0x37c5eb]['outboundAnswerAgiCallsDay']=0x0;_0x4fe3a3[_0x37c5eb]['outboundNoAnswerCallsDay']=0x0;_0x4fe3a3[_0x37c5eb]['outboundBusyCallsDay']=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x32')]=0x0;_0x4fe3a3[_0x37c5eb]['outboundNoSuchCallsDay']=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x33')]=0x0;_0x4fe3a3[_0x37c5eb]['outboundDropCallsDayTimeout']=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x34')]=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x35')]=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x36')]=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x37')]=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x38')]=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x39')]=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x3a')]=0x0;_0x4fe3a3[_0x37c5eb][_0x18e5('0x3b')]=!![];}}}}Realtime[_0x18e5('0x3c')]['mergeFromDatabase']=function(_0x3e0200,_0x3d83ee){for(var _0x736889 in _0x3d83ee){if(_0x3e0200[_0x18e5('0x24')](_0x736889)){_0x3e0200[_0x736889]=_0x3d83ee[_0x736889];}}};Realtime[_0x18e5('0x3c')][_0x18e5('0x3d')]=function(){var _0x2ac1cd=this;return function(_0x52015d){if(_0x52015d){freeIsNotKeyAgent(_0x52015d,_0x2ac1cd[_0x18e5('0x11')]);for(var _0x364c6b=0x0,_0x47b287={},_0x2fee12={};_0x364c6b<_0x52015d[_0x18e5('0x3e')];_0x364c6b+=0x1){_0x47b287=_0x52015d[_0x364c6b];var _0xcc2a2a=_[_0x18e5('0x28')](_0x47b287[_0x18e5('0x29')])?util['format'](_0x18e5('0x26'),_0x47b287[_0x18e5('0x27')]):_0x47b287[_0x18e5('0x29')];if(_[_0x18e5('0x3f')](_0x2ac1cd['agents'][_0xcc2a2a])){_0x2ac1cd[_0x18e5('0x11')][_0xcc2a2a]=new Agent(_0x47b287);}else{_0x2ac1cd[_0x18e5('0x40')](_0x2ac1cd['agents'][_0xcc2a2a],_0x47b287);}}}return _0x2ac1cd[_0x18e5('0x11')];};};Realtime[_0x18e5('0x3c')][_0x18e5('0x41')]=function(){var _0x410af3=this;return function(_0x413cae){if(_0x413cae){freeIsNotKeySip(_0x413cae,_0x410af3[_0x18e5('0x12')]);for(var _0x7f736c=0x0,_0x41aebf={},_0x45c357={};_0x7f736c<_0x413cae['length'];_0x7f736c+=0x1){_0x41aebf=_0x413cae[_0x7f736c];if(_[_0x18e5('0x3f')](_0x410af3[_0x18e5('0x12')][util[_0x18e5('0x25')](_0x18e5('0x26'),_0x41aebf[_0x18e5('0x27')])])){_0x410af3[_0x18e5('0x12')][util[_0x18e5('0x25')](_0x18e5('0x26'),_0x41aebf[_0x18e5('0x27')])]=new Telephone(_0x41aebf);}else{_0x410af3[_0x18e5('0x40')](_0x410af3['telephones'][util[_0x18e5('0x25')](_0x18e5('0x26'),_0x41aebf[_0x18e5('0x27')])],_0x41aebf);}}}return _0x410af3[_0x18e5('0x12')];};};Realtime['prototype'][_0x18e5('0x42')]=function(){var _0x484027=this;return function(_0x4adfb6){if(_0x4adfb6){freeIsNotKeySip(_0x4adfb6,_0x484027['trunks']);for(var _0x39f8ad=0x0,_0x2ef44f={},_0xb9157={};_0x39f8ad<_0x4adfb6[_0x18e5('0x3e')];_0x39f8ad+=0x1){_0x2ef44f=_0x4adfb6[_0x39f8ad];if(_[_0x18e5('0x3f')](_0x484027['trunks'][util[_0x18e5('0x25')](_0x18e5('0x26'),_0x2ef44f[_0x18e5('0x27')])])){_0x484027[_0x18e5('0x13')][util[_0x18e5('0x25')](_0x18e5('0x26'),_0x2ef44f[_0x18e5('0x27')])]=new Trunk(_0x2ef44f);}else{_0x484027[_0x18e5('0x40')](_0x484027[_0x18e5('0x13')][util[_0x18e5('0x25')](_0x18e5('0x26'),_0x2ef44f['name'])],_0x2ef44f);}}}return _0x484027['trunks'];};};Realtime['prototype'][_0x18e5('0x43')]=function(){var _0x4baedd=this;return function(_0x25e34b){if(_0x25e34b){freeIsNotKey(_0x25e34b,_0x4baedd[_0x18e5('0x44')],'name');for(var _0x539291=0x0,_0x4481e3={},_0x5429fe={};_0x539291<_0x25e34b['length'];_0x539291+=0x1){_0x4481e3=_0x25e34b[_0x539291];if(_[_0x18e5('0x3f')](_0x4baedd[_0x18e5('0x44')][_0x4481e3[_0x18e5('0x27')]])){_0x4baedd[_0x18e5('0x44')][_0x4481e3[_0x18e5('0x27')]]=new VoiceQueue(_0x4481e3);}else{_0x4baedd[_0x18e5('0x40')](_0x4baedd['voiceQueues'][_0x4481e3['name']],_0x4481e3);}}}return _0x4baedd[_0x18e5('0x44')];};};Realtime['prototype'][_0x18e5('0x45')]=function(){var _0x3f9048=this;return function(_0x3ae43){if(_0x3ae43){freeIsNotKey(_0x3ae43,_0x3f9048[_0x18e5('0x14')],'id');for(var _0x554732=0x0,_0x41546d={},_0x2cbc72={};_0x554732<_0x3ae43[_0x18e5('0x3e')];_0x554732+=0x1){_0x41546d=_0x3ae43[_0x554732];if(_[_0x18e5('0x3f')](_0x3f9048[_0x18e5('0x14')][_0x41546d['id']])){_0x3f9048['triggers'][_0x41546d['id']]=new Trigger(_0x41546d);}else{_0x3f9048[_0x18e5('0x40')](_0x3f9048[_0x18e5('0x14')][_0x41546d['id']],_0x41546d);}}}return _0x3f9048[_0x18e5('0x14')];};};Realtime[_0x18e5('0x3c')][_0x18e5('0x46')]=function(){var _0x2bf7b2=this;return function(_0x1ed393){if(_0x1ed393){freeIsNotKey(_0x1ed393,_0x2bf7b2[_0x18e5('0x47')],'id');for(var _0x4ff152=0x0,_0x324f14={},_0x181352={};_0x4ff152<_0x1ed393[_0x18e5('0x3e')];_0x4ff152+=0x1){_0x324f14=_0x1ed393[_0x4ff152];if(_['isUndefined'](_0x2bf7b2['templates'][_0x324f14['id']])){_0x2bf7b2[_0x18e5('0x47')][_0x324f14['id']]=new Template(_0x324f14);}else{_0x2bf7b2[_0x18e5('0x40')](_0x2bf7b2['templates'][_0x324f14['id']],_0x324f14);}}}return _0x2bf7b2['templates'];};};Realtime[_0x18e5('0x3c')]['initZendeskAccounts']=function(){var _0x431f5b=this;return function(_0xf436d0){if(_0xf436d0){freeIsNotKey(_0xf436d0,_0x431f5b['zendeskAccounts'],'id');for(var _0x238b30=0x0,_0x57adc4={},_0x5f1918={};_0x238b30<_0xf436d0[_0x18e5('0x3e')];_0x238b30+=0x1){_0x57adc4=_0xf436d0[_0x238b30];if(_[_0x18e5('0x3f')](_0x431f5b['zendeskAccounts'][_0x57adc4['id']])){_0x431f5b[_0x18e5('0x1b')][_0x57adc4['id']]=new ZendeskAccount(_0x57adc4);}else{_0x431f5b[_0x18e5('0x40')](_0x431f5b[_0x18e5('0x1b')][_0x57adc4['id']],_0x57adc4);}}}return _0x431f5b[_0x18e5('0x1b')];};};Realtime[_0x18e5('0x3c')]['initSalesforceAccounts']=function(){var _0x159e71=this;return function(_0x5ac9db){if(_0x5ac9db){freeIsNotKey(_0x5ac9db,_0x159e71[_0x18e5('0x1c')],'id');for(var _0x33a12=0x0,_0x656894={},_0x2ef0be={};_0x33a12<_0x5ac9db[_0x18e5('0x3e')];_0x33a12+=0x1){_0x656894=_0x5ac9db[_0x33a12];if(_[_0x18e5('0x3f')](_0x159e71[_0x18e5('0x1c')][_0x656894['id']])){_0x159e71[_0x18e5('0x1c')][_0x656894['id']]=new SalesforceAccount(_0x656894);}else{_0x159e71[_0x18e5('0x40')](_0x159e71['salesforceAccounts'][_0x656894['id']],_0x656894);}}}return _0x159e71[_0x18e5('0x1c')];};};Realtime[_0x18e5('0x3c')][_0x18e5('0x48')]=function(){var _0x1b3321=this;return function(_0x323162){if(_0x323162){freeIsNotKey(_0x323162,_0x1b3321[_0x18e5('0x49')],'id');for(var _0x116ab5=0x0,_0x43b822={},_0x13563c={};_0x116ab5<_0x323162['length'];_0x116ab5+=0x1){_0x43b822=_0x323162[_0x116ab5];if(_[_0x18e5('0x3f')](_0x1b3321[_0x18e5('0x49')][_0x43b822['id']])){_0x1b3321['freshdeskAccounts'][_0x43b822['id']]=new FreshdeskAccount(_0x43b822);}else{_0x1b3321['mergeFromDatabase'](_0x1b3321[_0x18e5('0x49')][_0x43b822['id']],_0x43b822);}}}return _0x1b3321[_0x18e5('0x49')];};};Realtime[_0x18e5('0x3c')][_0x18e5('0x4a')]=function(){var _0x1239c1=this;return function(_0x8a223f){if(_0x8a223f){freeIsNotKey(_0x8a223f,_0x1239c1['zohoAccounts'],'id');for(var _0x107cf6=0x0,_0x171b64={},_0x4391b7={};_0x107cf6<_0x8a223f[_0x18e5('0x3e')];_0x107cf6+=0x1){_0x171b64=_0x8a223f[_0x107cf6];if(_[_0x18e5('0x3f')](_0x1239c1[_0x18e5('0x1d')][_0x171b64['id']])){_0x1239c1[_0x18e5('0x1d')][_0x171b64['id']]=new ZohoAccount(_0x171b64);}else{_0x1239c1[_0x18e5('0x40')](_0x1239c1[_0x18e5('0x1d')][_0x171b64['id']],_0x171b64);}}}return _0x1239c1[_0x18e5('0x1d')];};};Realtime['prototype'][_0x18e5('0x4b')]=function(){var _0x75df16=this;return function(_0x26a546){if(_0x26a546){freeIsNotKey(_0x26a546,_0x75df16[_0x18e5('0x1e')],'id');for(var _0x1287b1=0x0,_0x1fcd59={},_0x112b8d={};_0x1287b1<_0x26a546[_0x18e5('0x3e')];_0x1287b1+=0x1){_0x1fcd59=_0x26a546[_0x1287b1];if(_[_0x18e5('0x3f')](_0x75df16[_0x18e5('0x1e')][_0x1fcd59['id']])){_0x75df16[_0x18e5('0x1e')][_0x1fcd59['id']]=new DeskAccount(_0x1fcd59);}else{_0x75df16[_0x18e5('0x40')](_0x75df16[_0x18e5('0x1e')][_0x1fcd59['id']],_0x1fcd59);}}}return _0x75df16[_0x18e5('0x1e')];};};Realtime[_0x18e5('0x3c')][_0x18e5('0x4c')]=function(){var _0x25c309=this;return function(_0x26d2d4){if(_0x26d2d4){freeIsNotKey(_0x26d2d4,_0x25c309[_0x18e5('0x4d')],'id');for(var _0x2e96b5=0x0,_0x1ebd52={},_0x181d9c={};_0x2e96b5<_0x26d2d4[_0x18e5('0x3e')];_0x2e96b5+=0x1){_0x1ebd52=_0x26d2d4[_0x2e96b5];if(_[_0x18e5('0x3f')](_0x25c309[_0x18e5('0x4d')][_0x1ebd52['id']])){_0x25c309[_0x18e5('0x4d')][_0x1ebd52['id']]=new SugarcrmAccount(_0x1ebd52);}else{_0x25c309[_0x18e5('0x40')](_0x25c309[_0x18e5('0x4d')][_0x1ebd52['id']],_0x1ebd52);}}}return _0x25c309[_0x18e5('0x4d')];};};Realtime[_0x18e5('0x3c')][_0x18e5('0x4e')]=function(){var _0x2c73b2=this;return function(_0x5f3f14){if(_0x5f3f14){freeIsNotKey(_0x5f3f14,_0x2c73b2[_0x18e5('0x1f')],'id');for(var _0x5334a7=0x0,_0x1a9012={},_0x377d7b={};_0x5334a7<_0x5f3f14[_0x18e5('0x3e')];_0x5334a7+=0x1){_0x1a9012=_0x5f3f14[_0x5334a7];if(_[_0x18e5('0x3f')](_0x2c73b2[_0x18e5('0x1f')][_0x1a9012['id']])){_0x2c73b2[_0x18e5('0x1f')][_0x1a9012['id']]=new VtigerAccount(_0x1a9012);}else{_0x2c73b2[_0x18e5('0x40')](_0x2c73b2[_0x18e5('0x1f')][_0x1a9012['id']],_0x1a9012);}}}return _0x2c73b2[_0x18e5('0x1f')];};};Realtime[_0x18e5('0x3c')]['initServicenowAccounts']=function(){var _0x479579=this;return function(_0x2d2e70){if(_0x2d2e70){freeIsNotKey(_0x2d2e70,_0x479579[_0x18e5('0x20')],'id');for(var _0xb65f91=0x0,_0x20cb0d={},_0x2eb342={};_0xb65f91<_0x2d2e70[_0x18e5('0x3e')];_0xb65f91+=0x1){_0x20cb0d=_0x2d2e70[_0xb65f91];if(_['isUndefined'](_0x479579[_0x18e5('0x20')][_0x20cb0d['id']])){_0x479579[_0x18e5('0x20')][_0x20cb0d['id']]=new ServicenowAccount(_0x20cb0d);}else{_0x479579[_0x18e5('0x40')](_0x479579['servicenowAccounts'][_0x20cb0d['id']],_0x20cb0d);}}}return _0x479579['servicenowAccounts'];};};Realtime['prototype'][_0x18e5('0x4f')]=function(){var _0x23222f=this;return function(_0x13f88b){if(_0x13f88b){freeIsNotKey(_0x13f88b,_0x23222f['dynamics365Accounts'],'id');for(var _0x1aba38=0x0,_0x23487a={},_0x406339={};_0x1aba38<_0x13f88b[_0x18e5('0x3e')];_0x1aba38+=0x1){_0x23487a=_0x13f88b[_0x1aba38];if(_[_0x18e5('0x3f')](_0x23222f[_0x18e5('0x21')][_0x23487a['id']])){_0x23222f['dynamics365Accounts'][_0x23487a['id']]=new Dynamics365Account(_0x23487a);}else{_0x23222f[_0x18e5('0x40')](_0x23222f[_0x18e5('0x21')][_0x23487a['id']],_0x23487a);}}}return _0x23222f['dynamics365Accounts'];};};Realtime['prototype'][_0x18e5('0x50')]=function(){var _0x1d51ee=this;return function(_0x21dec8){for(var _0x29aa3d=0x0;_0x29aa3d<_0x21dec8['length'];_0x29aa3d+=0x1){_['merge'](_0x1d51ee[_0x18e5('0x44')][_0x21dec8[_0x29aa3d][_0x18e5('0x27')]],_0x21dec8[_0x29aa3d]);}return _0x1d51ee[_0x18e5('0x44')];};};Realtime[_0x18e5('0x3c')][_0x18e5('0x51')]=function(){var _0x990bcb=this;return function(_0x5dc944){clearVoiceQueues(_0x990bcb['voiceQueues']);if(_0x5dc944){_0x5dc944=_['groupBy'](_0x5dc944,'uniqueid');for(var _0x3fdbe8 in _0x5dc944){if(_0x5dc944[_0x18e5('0x24')](_0x3fdbe8)){var _0x4c667f={};for(var _0x15c35e=0x0;_0x15c35e<_0x5dc944[_0x3fdbe8][_0x18e5('0x3e')];_0x15c35e+=0x1){var _0x1432bf=_0x5dc944[_0x3fdbe8][_0x15c35e][_0x18e5('0x52')];if(_0x990bcb['voiceQueues'][_0x1432bf]){if(_0x5dc944[_0x3fdbe8][_0x15c35e]['queuecallerexit']){_0x990bcb[_0x18e5('0x44')][_0x1432bf][_0x18e5('0x53')]+=0x1;}if(_0x5dc944[_0x3fdbe8][_0x15c35e]['queuecallerabandon']){_0x990bcb[_0x18e5('0x44')][_0x1432bf][_0x18e5('0x31')]+=0x1;}_0x990bcb[_0x18e5('0x44')][_0x1432bf][_0x18e5('0x2b')]+=moment(_0x5dc944[_0x3fdbe8][_0x15c35e]['queuecallerleaveAt'])[_0x18e5('0x54')](moment(_0x5dc944[_0x3fdbe8][_0x15c35e][_0x18e5('0x55')]),'seconds')||0x0;if(_0x15c35e===_0x5dc944[_0x3fdbe8][_0x18e5('0x3e')]-0x1){_0x990bcb[_0x18e5('0x44')][_0x1432bf][_0x18e5('0x2c')]+=moment(_0x5dc944[_0x3fdbe8][_0x15c35e]['queuecallercompleteAt']||_0x5dc944[_0x3fdbe8][_0x15c35e][_0x18e5('0x56')]||_0x5dc944[_0x3fdbe8][_0x15c35e][_0x18e5('0x57')])[_0x18e5('0x54')](moment(_0x5dc944[_0x3fdbe8][_0x15c35e]['queuecallerjoinAt']),_0x18e5('0x58'))||0x0;_0x990bcb[_0x18e5('0x44')][_0x1432bf][_0x18e5('0x30')]+=0x1;if(_0x5dc944[_0x3fdbe8][_0x15c35e][_0x18e5('0x59')]){_0x990bcb['voiceQueues'][_0x1432bf][_0x18e5('0x2a')]+=0x1;_0x990bcb[_0x18e5('0x44')][_0x1432bf][_0x18e5('0x2d')]+=moment(_0x5dc944[_0x3fdbe8][_0x15c35e][_0x18e5('0x5a')])[_0x18e5('0x54')](moment(_0x5dc944[_0x3fdbe8][_0x15c35e][_0x18e5('0x5b')]),'seconds')||0x0;}}else{_0x990bcb[_0x18e5('0x44')][_0x1432bf][_0x18e5('0x2c')]+=_0x990bcb[_0x18e5('0x44')][_0x1432bf][_0x18e5('0x2b')]||0x0;}}}}}}return _0x990bcb[_0x18e5('0x44')];};};Realtime[_0x18e5('0x3c')]['initVoiceCallReports']=function(){var _0x48bf0a=this;return function(_0x48aaed){clearVoiceCallReports(_0x48bf0a['outbound']);if(_0x48aaed){for(var _0x1bf606=0x0;_0x1bf606<_0x48aaed['length'];_0x1bf606+=0x1){_0x48bf0a[_0x18e5('0x16')]['total']+=0x1;_0x48bf0a[_0x18e5('0x16')][_0x18e5('0x2c')]+=_0x48aaed[_0x1bf606][_0x18e5('0x5c')];if(_0x48aaed[_0x1bf606][_0x18e5('0x5d')]==='ANSWERED'){_0x48bf0a[_0x18e5('0x16')][_0x18e5('0x2a')]+=0x1;_0x48bf0a[_0x18e5('0x16')][_0x18e5('0x2b')]+=_0x48aaed[_0x1bf606]['duration']-_0x48aaed[_0x1bf606]['billableseconds']||0x0;_0x48bf0a['outbound']['sumBillable']+=_0x48aaed[_0x1bf606]['billableseconds'];}}}return _0x48bf0a['outbound'];};};Realtime[_0x18e5('0x3c')][_0x18e5('0x5e')]=function(){var _0xba0d56=this;return function(_0x474479){if(_0x474479){freeIsNotKey(_0x474479,_0xba0d56['campaigns'],_0x18e5('0x27'));for(var _0x5bace8=0x0,_0x16f0d3={};_0x5bace8<_0x474479[_0x18e5('0x3e')];_0x5bace8+=0x1){_0x16f0d3=_0x474479[_0x5bace8];if(_[_0x18e5('0x3f')](_0xba0d56[_0x18e5('0x15')][_0x16f0d3[_0x18e5('0x27')]])){_0xba0d56[_0x18e5('0x15')][_0x16f0d3['name']]=new Campaign(_0x16f0d3);}else{_0xba0d56['mergeFromDatabase'](_0xba0d56[_0x18e5('0x15')][_0x16f0d3[_0x18e5('0x27')]],_0x16f0d3);}}}return _0xba0d56[_0x18e5('0x15')];};};Realtime['prototype'][_0x18e5('0x5f')]=function(){var _0x3821a0=this;return function(_0x3bfc8d){if(_0x3bfc8d){freeIsNotKey(_0x3bfc8d,_0x3821a0[_0x18e5('0x17')],'id');for(var _0x3c8633=0x0,_0x5788e3={};_0x3c8633<_0x3bfc8d[_0x18e5('0x3e')];_0x3c8633+=0x1){_0x5788e3=_0x3bfc8d[_0x3c8633];if(_[_0x18e5('0x3f')](_0x3821a0[_0x18e5('0x17')][_0x5788e3['id']])){_0x3821a0[_0x18e5('0x17')][_0x5788e3['id']]=new VoiceExtension(_0x5788e3);}else{_0x3821a0[_0x18e5('0x40')](_0x3821a0[_0x18e5('0x17')][_0x5788e3['id']],_0x5788e3);}}}return _0x3821a0[_0x18e5('0x17')];};};Realtime['prototype'][_0x18e5('0x60')]=function(){var _0x1aab9c=this;return function(_0x387757){clearCampaigns(_0x1aab9c[_0x18e5('0x15')]);for(var _0xe5a04b=0x0;_0xe5a04b<_0x387757['length'];_0xe5a04b+=0x1){_[_0x18e5('0x61')](_0x1aab9c['campaigns'][_0x387757[_0xe5a04b][_0x18e5('0x27')]],_0x387757[_0xe5a04b]);}return _0x1aab9c['campaigns'];};};Realtime[_0x18e5('0x3c')][_0x18e5('0x62')]=function(){var _0x56c966=this;return function(_0x45c0c5){if(_0x45c0c5){freeIsNotKey(_0x45c0c5,_0x56c966[_0x18e5('0x22')],'id');for(var _0xfd157b=0x0,_0x49138c={},_0x23ffff={};_0xfd157b<_0x45c0c5[_0x18e5('0x3e')];_0xfd157b+=0x1){_0x49138c=_0x45c0c5[_0xfd157b];if(_['isUndefined'](_0x56c966[_0x18e5('0x22')][_0x49138c['id']])){_0x56c966[_0x18e5('0x22')][_0x49138c['id']]=new FaxAccount(_0x49138c);}else{_0x56c966[_0x18e5('0x40')](_0x56c966[_0x18e5('0x22')][_0x49138c['id']],_0x49138c);}}}return _0x56c966[_0x18e5('0x22')];};};module[_0x18e5('0x63')]=Realtime; \ No newline at end of file +var _0x3822=['billableseconds','initVoiceExtensions','initCampaignHopperHistory','faxAccounts','bluebird','util','lodash','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','voiceQueues','triggers','campaigns','outbound','voiceExtensions','queueChannels','outboundChannels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumHoldTime','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','initTelephones','telephones','trunks','isUndefined','initVoiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueHopperHistory','initVoiceQueueReports','uniqueid','queuecallerexit','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED'];(function(_0x4c1f1f,_0x3aa18d){var _0x4f9e3c=function(_0x1a94cb){while(--_0x1a94cb){_0x4c1f1f['push'](_0x4c1f1f['shift']());}};_0x4f9e3c(++_0x3aa18d);}(_0x3822,0x65));var _0x2382=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x3822[_0x5627e1];return _0x2f013f;};'use strict';var BPromise=require(_0x2382('0x0'));var util=require(_0x2382('0x1'));var _=require(_0x2382('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require(_0x2382('0x3'));var VoiceQueue=require(_0x2382('0x4'));var Trigger=require(_0x2382('0x5'));var Template=require(_0x2382('0x6'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x2382('0x7'));var ZendeskAccount=require(_0x2382('0x8'));var SalesforceAccount=require(_0x2382('0x9'));var FreshdeskAccount=require(_0x2382('0xa'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x2382('0xb'));var ServicenowAccount=require(_0x2382('0xc'));var Dynamics365Account=require('../model/dynamics365Account');var FaxAccount=require(_0x2382('0xd'));var Realtime=function(){this['agents']={};this['telephones']={};this['trunks']={};this[_0x2382('0xe')]={};this[_0x2382('0xf')]={};this[_0x2382('0x10')]={};this['templates']={};this[_0x2382('0x11')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x2382('0x12')]={};this['channels']={};this[_0x2382('0x13')]={};this[_0x2382('0x14')]={};this['timers']={};this[_0x2382('0x15')]={};this[_0x2382('0x16')]={};this[_0x2382('0x17')]={};this[_0x2382('0x18')]={};this['zohoAccounts']={};this[_0x2382('0x19')]={};this[_0x2382('0x1a')]={};this[_0x2382('0x1b')]={};this['dynamics365Accounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x2a3bcc,_0x247845,_0x884891){var _0x525fa2=_[_0x2382('0x1c')](_0x2a3bcc,function(_0x1a54fb,_0x4575ae){return _0x1a54fb[_0x884891];});for(var _0x16ee2d in _0x247845){if(_0x247845[_0x2382('0x1d')](_0x16ee2d)){if(!_0x525fa2[_0x16ee2d]){delete _0x247845[_0x16ee2d];}}}}function freeIsNotKeySip(_0x14b793,_0xcc3f25){var _0x2542df=_[_0x2382('0x1c')](_0x14b793,function(_0x555aed,_0x1be93e){return util[_0x2382('0x1e')](_0x2382('0x1f'),_0x555aed[_0x2382('0x20')]);});for(var _0x3ab955 in _0xcc3f25){if(_0xcc3f25['hasOwnProperty'](_0x3ab955)){if(!_0x2542df[_0x3ab955]){delete _0xcc3f25[_0x3ab955];}}}}function freeIsNotKeyAgent(_0x58b7af,_0x1be473){var _0x5af510=_['mapKeys'](_0x58b7af,function(_0x3e5fc1,_0x81feb6){var _0x459616=_[_0x2382('0x21')](_0x3e5fc1[_0x2382('0x22')])?util[_0x2382('0x1e')](_0x2382('0x1f'),_0x3e5fc1[_0x2382('0x20')]):_0x3e5fc1[_0x2382('0x22')];return _0x459616;});for(var _0x5c20a0 in _0x1be473){if(_0x1be473[_0x2382('0x1d')](_0x5c20a0)){if(!_0x5af510[_0x5c20a0]){delete _0x1be473[_0x5c20a0];}}}}function clearVoiceCallReports(_0x580a91){_0x580a91[_0x2382('0x23')]=0x0;_0x580a91[_0x2382('0x24')]=0x0;_0x580a91['sumHoldTime']=0x0;_0x580a91[_0x2382('0x25')]=0x0;_0x580a91[_0x2382('0x26')]=0x0;}function clearCampaigns(_0x4cd540){if(!_[_0x2382('0x27')](_0x4cd540)){for(var _0x178694 in _0x4cd540){if(_0x4cd540['hasOwnProperty'](_0x178694)){_0x4cd540[_0x178694][_0x2382('0x28')]=0x0;_0x4cd540[_0x178694][_0x2382('0x29')]=0x0;}}}}function clearVoiceQueues(_0x5bcd9b){if(!_[_0x2382('0x27')](_0x5bcd9b)){for(var _0x419407 in _0x5bcd9b){if(_0x5bcd9b[_0x2382('0x1d')](_0x419407)){_0x5bcd9b[_0x419407][_0x2382('0x23')]=0x0;_0x5bcd9b[_0x419407][_0x2382('0x24')]=0x0;_0x5bcd9b[_0x419407][_0x2382('0x2a')]=0x0;_0x5bcd9b[_0x419407]['abandoned']=0x0;_0x5bcd9b[_0x419407][_0x2382('0x2b')]=0x0;_0x5bcd9b[_0x419407][_0x2382('0x25')]=0x0;_0x5bcd9b[_0x419407]['sumBillable']=0x0;_0x5bcd9b[_0x419407]['outboundAnswerAgiCallsDay']=0x0;_0x5bcd9b[_0x419407][_0x2382('0x2c')]=0x0;_0x5bcd9b[_0x419407][_0x2382('0x2d')]=0x0;_0x5bcd9b[_0x419407]['outboundCongestionCallsDay']=0x0;_0x5bcd9b[_0x419407]['outboundNoSuchCallsDay']=0x0;_0x5bcd9b[_0x419407][_0x2382('0x2e')]=0x0;_0x5bcd9b[_0x419407][_0x2382('0x2f')]=0x0;_0x5bcd9b[_0x419407]['outboundDropCallsDayCallersExit']=0x0;_0x5bcd9b[_0x419407][_0x2382('0x30')]=0x0;_0x5bcd9b[_0x419407][_0x2382('0x31')]=0x0;_0x5bcd9b[_0x419407]['outboundRejectCallsDay']=0x0;_0x5bcd9b[_0x419407]['outboundReCallsDay']=0x0;_0x5bcd9b[_0x419407][_0x2382('0x32')]=0x0;_0x5bcd9b[_0x419407][_0x2382('0x33')]=0x0;_0x5bcd9b[_0x419407][_0x2382('0x34')]=!![];}}}}Realtime[_0x2382('0x35')][_0x2382('0x36')]=function(_0x51b0eb,_0x4e871e){for(var _0x1d1152 in _0x4e871e){if(_0x51b0eb[_0x2382('0x1d')](_0x1d1152)){_0x51b0eb[_0x1d1152]=_0x4e871e[_0x1d1152];}}};Realtime['prototype'][_0x2382('0x37')]=function(){var _0x304e8b=this;return function(_0x58ffe7){if(_0x58ffe7){freeIsNotKeyAgent(_0x58ffe7,_0x304e8b[_0x2382('0x38')]);for(var _0x5a3997=0x0,_0x1408a6={},_0x14c290={};_0x5a3997<_0x58ffe7[_0x2382('0x39')];_0x5a3997+=0x1){_0x1408a6=_0x58ffe7[_0x5a3997];var _0x53d944=_[_0x2382('0x21')](_0x1408a6[_0x2382('0x22')])?util[_0x2382('0x1e')](_0x2382('0x1f'),_0x1408a6['name']):_0x1408a6['interface'];if(_['isUndefined'](_0x304e8b[_0x2382('0x38')][_0x53d944])){_0x304e8b[_0x2382('0x38')][_0x53d944]=new Agent(_0x1408a6);}else{_0x304e8b[_0x2382('0x36')](_0x304e8b[_0x2382('0x38')][_0x53d944],_0x1408a6);}}}return _0x304e8b[_0x2382('0x38')];};};Realtime[_0x2382('0x35')][_0x2382('0x3a')]=function(){var _0x146389=this;return function(_0x1c4b44){if(_0x1c4b44){freeIsNotKeySip(_0x1c4b44,_0x146389['telephones']);for(var _0x22ac4b=0x0,_0xd83d63={},_0x1ef911={};_0x22ac4b<_0x1c4b44['length'];_0x22ac4b+=0x1){_0xd83d63=_0x1c4b44[_0x22ac4b];if(_['isUndefined'](_0x146389[_0x2382('0x3b')][util[_0x2382('0x1e')](_0x2382('0x1f'),_0xd83d63[_0x2382('0x20')])])){_0x146389['telephones'][util['format'](_0x2382('0x1f'),_0xd83d63['name'])]=new Telephone(_0xd83d63);}else{_0x146389[_0x2382('0x36')](_0x146389[_0x2382('0x3b')][util[_0x2382('0x1e')]('SIP/%s',_0xd83d63['name'])],_0xd83d63);}}}return _0x146389['telephones'];};};Realtime[_0x2382('0x35')]['initTrunks']=function(){var _0x8fe89=this;return function(_0x1b9bbb){if(_0x1b9bbb){freeIsNotKeySip(_0x1b9bbb,_0x8fe89[_0x2382('0x3c')]);for(var _0x593e31=0x0,_0x5ab8e1={},_0x30f79b={};_0x593e31<_0x1b9bbb[_0x2382('0x39')];_0x593e31+=0x1){_0x5ab8e1=_0x1b9bbb[_0x593e31];if(_[_0x2382('0x3d')](_0x8fe89[_0x2382('0x3c')][util['format']('SIP/%s',_0x5ab8e1[_0x2382('0x20')])])){_0x8fe89[_0x2382('0x3c')][util[_0x2382('0x1e')]('SIP/%s',_0x5ab8e1['name'])]=new Trunk(_0x5ab8e1);}else{_0x8fe89[_0x2382('0x36')](_0x8fe89['trunks'][util[_0x2382('0x1e')](_0x2382('0x1f'),_0x5ab8e1['name'])],_0x5ab8e1);}}}return _0x8fe89[_0x2382('0x3c')];};};Realtime[_0x2382('0x35')][_0x2382('0x3e')]=function(){var _0x3e0664=this;return function(_0x1105f6){if(_0x1105f6){freeIsNotKey(_0x1105f6,_0x3e0664[_0x2382('0xe')],_0x2382('0x20'));for(var _0x1b82c2=0x0,_0x308d77={},_0x42d520={};_0x1b82c2<_0x1105f6[_0x2382('0x39')];_0x1b82c2+=0x1){_0x308d77=_0x1105f6[_0x1b82c2];if(_[_0x2382('0x3d')](_0x3e0664[_0x2382('0xe')][_0x308d77[_0x2382('0x20')]])){_0x3e0664['voiceQueues'][_0x308d77[_0x2382('0x20')]]=new VoiceQueue(_0x308d77);}else{_0x3e0664[_0x2382('0x36')](_0x3e0664[_0x2382('0xe')][_0x308d77[_0x2382('0x20')]],_0x308d77);}}}return _0x3e0664[_0x2382('0xe')];};};Realtime[_0x2382('0x35')][_0x2382('0x3f')]=function(){var _0x1e3a87=this;return function(_0x466c13){if(_0x466c13){freeIsNotKey(_0x466c13,_0x1e3a87[_0x2382('0xf')],'id');for(var _0x1195cd=0x0,_0x307854={},_0x19c944={};_0x1195cd<_0x466c13[_0x2382('0x39')];_0x1195cd+=0x1){_0x307854=_0x466c13[_0x1195cd];if(_[_0x2382('0x3d')](_0x1e3a87[_0x2382('0xf')][_0x307854['id']])){_0x1e3a87[_0x2382('0xf')][_0x307854['id']]=new Trigger(_0x307854);}else{_0x1e3a87[_0x2382('0x36')](_0x1e3a87[_0x2382('0xf')][_0x307854['id']],_0x307854);}}}return _0x1e3a87['triggers'];};};Realtime['prototype'][_0x2382('0x40')]=function(){var _0x420bf8=this;return function(_0x3d7015){if(_0x3d7015){freeIsNotKey(_0x3d7015,_0x420bf8[_0x2382('0x41')],'id');for(var _0x586b8f=0x0,_0x4efa60={},_0x2c9f3a={};_0x586b8f<_0x3d7015['length'];_0x586b8f+=0x1){_0x4efa60=_0x3d7015[_0x586b8f];if(_[_0x2382('0x3d')](_0x420bf8[_0x2382('0x41')][_0x4efa60['id']])){_0x420bf8[_0x2382('0x41')][_0x4efa60['id']]=new Template(_0x4efa60);}else{_0x420bf8[_0x2382('0x36')](_0x420bf8[_0x2382('0x41')][_0x4efa60['id']],_0x4efa60);}}}return _0x420bf8[_0x2382('0x41')];};};Realtime[_0x2382('0x35')][_0x2382('0x42')]=function(){var _0x131788=this;return function(_0x17d025){if(_0x17d025){freeIsNotKey(_0x17d025,_0x131788[_0x2382('0x15')],'id');for(var _0x535810=0x0,_0x1ccdf9={},_0x2b2164={};_0x535810<_0x17d025[_0x2382('0x39')];_0x535810+=0x1){_0x1ccdf9=_0x17d025[_0x535810];if(_[_0x2382('0x3d')](_0x131788[_0x2382('0x15')][_0x1ccdf9['id']])){_0x131788['zendeskAccounts'][_0x1ccdf9['id']]=new ZendeskAccount(_0x1ccdf9);}else{_0x131788['mergeFromDatabase'](_0x131788[_0x2382('0x15')][_0x1ccdf9['id']],_0x1ccdf9);}}}return _0x131788[_0x2382('0x15')];};};Realtime[_0x2382('0x35')][_0x2382('0x43')]=function(){var _0x498b6e=this;return function(_0x509d9e){if(_0x509d9e){freeIsNotKey(_0x509d9e,_0x498b6e[_0x2382('0x16')],'id');for(var _0x165ef5=0x0,_0x1f95ff={},_0x52787e={};_0x165ef5<_0x509d9e[_0x2382('0x39')];_0x165ef5+=0x1){_0x1f95ff=_0x509d9e[_0x165ef5];if(_['isUndefined'](_0x498b6e[_0x2382('0x16')][_0x1f95ff['id']])){_0x498b6e['salesforceAccounts'][_0x1f95ff['id']]=new SalesforceAccount(_0x1f95ff);}else{_0x498b6e[_0x2382('0x36')](_0x498b6e[_0x2382('0x16')][_0x1f95ff['id']],_0x1f95ff);}}}return _0x498b6e[_0x2382('0x16')];};};Realtime[_0x2382('0x35')]['initFreshdeskAccounts']=function(){var _0x10d5b1=this;return function(_0x3f9696){if(_0x3f9696){freeIsNotKey(_0x3f9696,_0x10d5b1[_0x2382('0x18')],'id');for(var _0x259941=0x0,_0x2af419={},_0x2d494e={};_0x259941<_0x3f9696[_0x2382('0x39')];_0x259941+=0x1){_0x2af419=_0x3f9696[_0x259941];if(_['isUndefined'](_0x10d5b1[_0x2382('0x18')][_0x2af419['id']])){_0x10d5b1['freshdeskAccounts'][_0x2af419['id']]=new FreshdeskAccount(_0x2af419);}else{_0x10d5b1[_0x2382('0x36')](_0x10d5b1['freshdeskAccounts'][_0x2af419['id']],_0x2af419);}}}return _0x10d5b1[_0x2382('0x18')];};};Realtime[_0x2382('0x35')][_0x2382('0x44')]=function(){var _0x5021a0=this;return function(_0x4fc6c0){if(_0x4fc6c0){freeIsNotKey(_0x4fc6c0,_0x5021a0['zohoAccounts'],'id');for(var _0x5c5a32=0x0,_0x1f04f9={},_0x11a31c={};_0x5c5a32<_0x4fc6c0[_0x2382('0x39')];_0x5c5a32+=0x1){_0x1f04f9=_0x4fc6c0[_0x5c5a32];if(_['isUndefined'](_0x5021a0[_0x2382('0x45')][_0x1f04f9['id']])){_0x5021a0['zohoAccounts'][_0x1f04f9['id']]=new ZohoAccount(_0x1f04f9);}else{_0x5021a0[_0x2382('0x36')](_0x5021a0['zohoAccounts'][_0x1f04f9['id']],_0x1f04f9);}}}return _0x5021a0[_0x2382('0x45')];};};Realtime[_0x2382('0x35')][_0x2382('0x46')]=function(){var _0x1eaf31=this;return function(_0x4dd686){if(_0x4dd686){freeIsNotKey(_0x4dd686,_0x1eaf31[_0x2382('0x19')],'id');for(var _0x1cdf86=0x0,_0x26c881={},_0x1f3aff={};_0x1cdf86<_0x4dd686[_0x2382('0x39')];_0x1cdf86+=0x1){_0x26c881=_0x4dd686[_0x1cdf86];if(_['isUndefined'](_0x1eaf31[_0x2382('0x19')][_0x26c881['id']])){_0x1eaf31[_0x2382('0x19')][_0x26c881['id']]=new DeskAccount(_0x26c881);}else{_0x1eaf31[_0x2382('0x36')](_0x1eaf31[_0x2382('0x19')][_0x26c881['id']],_0x26c881);}}}return _0x1eaf31[_0x2382('0x19')];};};Realtime[_0x2382('0x35')][_0x2382('0x47')]=function(){var _0x379a4f=this;return function(_0x3d6010){if(_0x3d6010){freeIsNotKey(_0x3d6010,_0x379a4f[_0x2382('0x17')],'id');for(var _0x1d21be=0x0,_0x55d454={},_0x1b20db={};_0x1d21be<_0x3d6010[_0x2382('0x39')];_0x1d21be+=0x1){_0x55d454=_0x3d6010[_0x1d21be];if(_[_0x2382('0x3d')](_0x379a4f['sugarcrmAccounts'][_0x55d454['id']])){_0x379a4f[_0x2382('0x17')][_0x55d454['id']]=new SugarcrmAccount(_0x55d454);}else{_0x379a4f[_0x2382('0x36')](_0x379a4f['sugarcrmAccounts'][_0x55d454['id']],_0x55d454);}}}return _0x379a4f['sugarcrmAccounts'];};};Realtime['prototype'][_0x2382('0x48')]=function(){var _0x39740f=this;return function(_0x4b476f){if(_0x4b476f){freeIsNotKey(_0x4b476f,_0x39740f['vtigerAccounts'],'id');for(var _0x4d9845=0x0,_0x451085={},_0x4d45c1={};_0x4d9845<_0x4b476f[_0x2382('0x39')];_0x4d9845+=0x1){_0x451085=_0x4b476f[_0x4d9845];if(_[_0x2382('0x3d')](_0x39740f[_0x2382('0x1a')][_0x451085['id']])){_0x39740f['vtigerAccounts'][_0x451085['id']]=new VtigerAccount(_0x451085);}else{_0x39740f['mergeFromDatabase'](_0x39740f[_0x2382('0x1a')][_0x451085['id']],_0x451085);}}}return _0x39740f['vtigerAccounts'];};};Realtime['prototype'][_0x2382('0x49')]=function(){var _0x35594d=this;return function(_0x451f4f){if(_0x451f4f){freeIsNotKey(_0x451f4f,_0x35594d['servicenowAccounts'],'id');for(var _0x3219c9=0x0,_0x4ecd6c={},_0x965126={};_0x3219c9<_0x451f4f['length'];_0x3219c9+=0x1){_0x4ecd6c=_0x451f4f[_0x3219c9];if(_[_0x2382('0x3d')](_0x35594d['servicenowAccounts'][_0x4ecd6c['id']])){_0x35594d[_0x2382('0x1b')][_0x4ecd6c['id']]=new ServicenowAccount(_0x4ecd6c);}else{_0x35594d[_0x2382('0x36')](_0x35594d[_0x2382('0x1b')][_0x4ecd6c['id']],_0x4ecd6c);}}}return _0x35594d[_0x2382('0x1b')];};};Realtime[_0x2382('0x35')][_0x2382('0x4a')]=function(){var _0x22c823=this;return function(_0x5f13ad){if(_0x5f13ad){freeIsNotKey(_0x5f13ad,_0x22c823[_0x2382('0x4b')],'id');for(var _0x5c8873=0x0,_0x5360e4={},_0x37b68e={};_0x5c8873<_0x5f13ad[_0x2382('0x39')];_0x5c8873+=0x1){_0x5360e4=_0x5f13ad[_0x5c8873];if(_[_0x2382('0x3d')](_0x22c823[_0x2382('0x4b')][_0x5360e4['id']])){_0x22c823[_0x2382('0x4b')][_0x5360e4['id']]=new Dynamics365Account(_0x5360e4);}else{_0x22c823[_0x2382('0x36')](_0x22c823['dynamics365Accounts'][_0x5360e4['id']],_0x5360e4);}}}return _0x22c823[_0x2382('0x4b')];};};Realtime[_0x2382('0x35')][_0x2382('0x4c')]=function(){var _0x574270=this;return function(_0x4e6173){for(var _0xfc4cdf=0x0;_0xfc4cdf<_0x4e6173[_0x2382('0x39')];_0xfc4cdf+=0x1){_['merge'](_0x574270[_0x2382('0xe')][_0x4e6173[_0xfc4cdf][_0x2382('0x20')]],_0x4e6173[_0xfc4cdf]);}return _0x574270[_0x2382('0xe')];};};Realtime[_0x2382('0x35')][_0x2382('0x4d')]=function(){var _0x191ade=this;return function(_0xcd3b65){clearVoiceQueues(_0x191ade[_0x2382('0xe')]);if(_0xcd3b65){_0xcd3b65=_['groupBy'](_0xcd3b65,_0x2382('0x4e'));for(var _0x1c8905 in _0xcd3b65){if(_0xcd3b65[_0x2382('0x1d')](_0x1c8905)){var _0x5764f7={};for(var _0x2cbb44=0x0;_0x2cbb44<_0xcd3b65[_0x1c8905]['length'];_0x2cbb44+=0x1){var _0x1327e4=_0xcd3b65[_0x1c8905][_0x2cbb44]['queue'];if(_0x191ade['voiceQueues'][_0x1327e4]){if(_0xcd3b65[_0x1c8905][_0x2cbb44][_0x2382('0x4f')]){_0x191ade[_0x2382('0xe')][_0x1327e4]['unmanaged']+=0x1;}if(_0xcd3b65[_0x1c8905][_0x2cbb44]['queuecallerabandon']){_0x191ade['voiceQueues'][_0x1327e4][_0x2382('0x50')]+=0x1;}_0x191ade['voiceQueues'][_0x1327e4][_0x2382('0x2b')]+=moment(_0xcd3b65[_0x1c8905][_0x2cbb44][_0x2382('0x51')])[_0x2382('0x52')](moment(_0xcd3b65[_0x1c8905][_0x2cbb44][_0x2382('0x53')]),_0x2382('0x54'))||0x0;if(_0x2cbb44===_0xcd3b65[_0x1c8905]['length']-0x1){_0x191ade['voiceQueues'][_0x1327e4][_0x2382('0x25')]+=moment(_0xcd3b65[_0x1c8905][_0x2cbb44][_0x2382('0x55')]||_0xcd3b65[_0x1c8905][_0x2cbb44][_0x2382('0x56')]||_0xcd3b65[_0x1c8905][_0x2cbb44][_0x2382('0x57')])[_0x2382('0x52')](moment(_0xcd3b65[_0x1c8905][_0x2cbb44][_0x2382('0x53')]),_0x2382('0x54'))||0x0;_0x191ade[_0x2382('0xe')][_0x1327e4][_0x2382('0x23')]+=0x1;if(_0xcd3b65[_0x1c8905][_0x2cbb44][_0x2382('0x58')]){_0x191ade[_0x2382('0xe')][_0x1327e4][_0x2382('0x24')]+=0x1;_0x191ade['voiceQueues'][_0x1327e4][_0x2382('0x26')]+=moment(_0xcd3b65[_0x1c8905][_0x2cbb44][_0x2382('0x55')])['diff'](moment(_0xcd3b65[_0x1c8905][_0x2cbb44][_0x2382('0x51')]),_0x2382('0x54'))||0x0;}}else{_0x191ade[_0x2382('0xe')][_0x1327e4][_0x2382('0x25')]+=_0x191ade['voiceQueues'][_0x1327e4][_0x2382('0x2b')]||0x0;}}}}}}return _0x191ade[_0x2382('0xe')];};};Realtime[_0x2382('0x35')][_0x2382('0x59')]=function(){var _0xdf7bde=this;return function(_0x24fc24){clearVoiceCallReports(_0xdf7bde['outbound']);if(_0x24fc24){for(var _0xb7e5be=0x0;_0xb7e5be<_0x24fc24[_0x2382('0x39')];_0xb7e5be+=0x1){_0xdf7bde[_0x2382('0x11')][_0x2382('0x23')]+=0x1;_0xdf7bde[_0x2382('0x11')]['sumDuration']+=_0x24fc24[_0xb7e5be][_0x2382('0x5a')];if(_0x24fc24[_0xb7e5be][_0x2382('0x5b')]===_0x2382('0x5c')){_0xdf7bde[_0x2382('0x11')][_0x2382('0x24')]+=0x1;_0xdf7bde[_0x2382('0x11')][_0x2382('0x2b')]+=_0x24fc24[_0xb7e5be][_0x2382('0x5a')]-_0x24fc24[_0xb7e5be][_0x2382('0x5d')]||0x0;_0xdf7bde[_0x2382('0x11')][_0x2382('0x26')]+=_0x24fc24[_0xb7e5be][_0x2382('0x5d')];}}}return _0xdf7bde[_0x2382('0x11')];};};Realtime[_0x2382('0x35')]['initCampaigns']=function(){var _0x26a053=this;return function(_0x4f0add){if(_0x4f0add){freeIsNotKey(_0x4f0add,_0x26a053[_0x2382('0x10')],_0x2382('0x20'));for(var _0x10ec4d=0x0,_0x1022fe={};_0x10ec4d<_0x4f0add['length'];_0x10ec4d+=0x1){_0x1022fe=_0x4f0add[_0x10ec4d];if(_[_0x2382('0x3d')](_0x26a053[_0x2382('0x10')][_0x1022fe[_0x2382('0x20')]])){_0x26a053[_0x2382('0x10')][_0x1022fe[_0x2382('0x20')]]=new Campaign(_0x1022fe);}else{_0x26a053[_0x2382('0x36')](_0x26a053[_0x2382('0x10')][_0x1022fe[_0x2382('0x20')]],_0x1022fe);}}}return _0x26a053[_0x2382('0x10')];};};Realtime['prototype'][_0x2382('0x5e')]=function(){var _0x301e81=this;return function(_0x2419db){if(_0x2419db){freeIsNotKey(_0x2419db,_0x301e81[_0x2382('0x12')],'id');for(var _0x5ac4de=0x0,_0x2328fb={};_0x5ac4de<_0x2419db[_0x2382('0x39')];_0x5ac4de+=0x1){_0x2328fb=_0x2419db[_0x5ac4de];if(_[_0x2382('0x3d')](_0x301e81['voiceExtensions'][_0x2328fb['id']])){_0x301e81[_0x2382('0x12')][_0x2328fb['id']]=new VoiceExtension(_0x2328fb);}else{_0x301e81['mergeFromDatabase'](_0x301e81[_0x2382('0x12')][_0x2328fb['id']],_0x2328fb);}}}return _0x301e81['voiceExtensions'];};};Realtime[_0x2382('0x35')][_0x2382('0x5f')]=function(){var _0x514eb9=this;return function(_0x3f6171){clearCampaigns(_0x514eb9[_0x2382('0x10')]);for(var _0x300039=0x0;_0x300039<_0x3f6171[_0x2382('0x39')];_0x300039+=0x1){_['merge'](_0x514eb9[_0x2382('0x10')][_0x3f6171[_0x300039][_0x2382('0x20')]],_0x3f6171[_0x300039]);}return _0x514eb9[_0x2382('0x10')];};};Realtime[_0x2382('0x35')]['initFaxAccounts']=function(){var _0x29b4c0=this;return function(_0x31d3b0){if(_0x31d3b0){freeIsNotKey(_0x31d3b0,_0x29b4c0[_0x2382('0x60')],'id');for(var _0x127b46=0x0,_0xc67fc={},_0x18e57e={};_0x127b46<_0x31d3b0[_0x2382('0x39')];_0x127b46+=0x1){_0xc67fc=_0x31d3b0[_0x127b46];if(_[_0x2382('0x3d')](_0x29b4c0['faxAccounts'][_0xc67fc['id']])){_0x29b4c0[_0x2382('0x60')][_0xc67fc['id']]=new FaxAccount(_0xc67fc);}else{_0x29b4c0[_0x2382('0x36')](_0x29b4c0['faxAccounts'][_0xc67fc['id']],_0xc67fc);}}}return _0x29b4c0[_0x2382('0x60')];};};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 aa48f30..e47014d 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 _0x1bff=['realtime','findAgent','find','accountcode','name','isNil','format','SIP/%s','prototype','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','createdAt','exten','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','voiceDialReport','Local','substring','indexOf','mobile','phone','lastIndexOf','blindTransfer','attendedTransfer','exports','lodash','util','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','agents','telephones'];(function(_0x521e8d,_0x23a290){var _0x518bbd=function(_0x4241eb){while(--_0x4241eb){_0x521e8d['push'](_0x521e8d['shift']());}};_0x518bbd(++_0x23a290);}(_0x1bff,0x8a));var _0xf1bf=function(_0x112fe3,_0x16b642){_0x112fe3=_0x112fe3-0x0;var _0x1ec903=_0x1bff[_0x112fe3];return _0x1ec903;};'use strict';var BPromise=require('bluebird');var _=require(_0xf1bf('0x0'));var moment=require('moment');var util=require(_0xf1bf('0x1'));var logger=require(_0xf1bf('0x2'))(_0xf1bf('0x3'));var ami=require(_0xf1bf('0x4'));var RpcVoiceAgentReport=require(_0xf1bf('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xf1bf('0x6'));var RpcMemberReport=require(_0xf1bf('0x7'));var RpcVoiceQueueReport=require(_0xf1bf('0x8'));var RpcVoiceRecording=require(_0xf1bf('0x9'));var RpcVoiceTransferReport=require(_0xf1bf('0xa'));var VoiceQueueReport=require(_0xf1bf('0xb'));var VoiceCallReport=require(_0xf1bf('0xc'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xf1bf('0xd'));var UserReport=require('./userReport');function Report(_0x17f566){this['realtime']=_0x17f566;this[_0xf1bf('0xe')]=_0x17f566['agents'];this[_0xf1bf('0xf')]=_0x17f566[_0xf1bf('0xf')];}Report['prototype']['sync']=function(_0x2f2a4d){var _0x4746c5=new VoiceQueueReport(this[_0xf1bf('0x10')]);var _0x29ec24=new VoiceAgentReport(this[_0xf1bf('0x10')]);var _0x34e05a=new VoiceDialReport(this[_0xf1bf('0x10')]);var _0x351ac8=new VoiceCallReport(this[_0xf1bf('0x10')]);var _0x5bdde9=new UserReport(this[_0xf1bf('0x10')]);};Report['prototype'][_0xf1bf('0x11')]=function(_0x225fb3){var _0x239bcf=undefined;_0x239bcf=_[_0xf1bf('0x12')](this['agents'],function(_0x52e162){return _0x52e162[_0xf1bf('0x13')]==_0x225fb3||_0x52e162[_0xf1bf('0x14')]==_0x225fb3;});if(_[_0xf1bf('0x15')](_0x239bcf)){var _0x284dc3=_[_0xf1bf('0x12')](this['telephones'],function(_0x413c8d){return _0x413c8d['accountcode']==_0x225fb3||_0x413c8d[_0xf1bf('0x14')]==_0x225fb3;});if(_0x284dc3){_0x239bcf=_[_0xf1bf('0x12')](this['agents'],function(_0x2c3487){return _0x2c3487['interface']==util[_0xf1bf('0x16')](_0xf1bf('0x17'),_0x284dc3[_0xf1bf('0x14')]);});}}return _0x239bcf;};Report[_0xf1bf('0x18')][_0xf1bf('0x19')]=function(_0x39fe3c){for(var _0x560159=0x0;_0x560159<_0x39fe3c[_0xf1bf('0x1a')];_0x560159+=0x1){var _0x1febc0=this['findAgent'](_0x39fe3c[_0x560159][_0xf1bf('0x1b')]);if(_0x1febc0){_0x39fe3c[_0x560159][_0xf1bf('0x13')]=_0x1febc0['accountcode'];_0x39fe3c[_0x560159][_0xf1bf('0x1c')]=!![];_0x39fe3c[_0x560159][_0xf1bf('0x1d')]=_0x1febc0[_0xf1bf('0x14')];_0x39fe3c[_0x560159][_0xf1bf('0x1e')]=_['isNil'](_0x1febc0[_0xf1bf('0x1e')])?util[_0xf1bf('0x16')](_0xf1bf('0x17'),_0x1febc0[_0xf1bf('0x14')]):_0x1febc0['interface'];if(_0x39fe3c[_0x560159][_0xf1bf('0x1f')]){_0x39fe3c[_0x560159][_0xf1bf('0x20')]=moment()['format'](_0xf1bf('0x21'));}if(_0x39fe3c[_0x560159][_0xf1bf('0x22')]){_0x39fe3c[_0x560159][_0xf1bf('0x23')]=moment()[_0xf1bf('0x16')](_0xf1bf('0x21'));}RpcMemberReport[_0xf1bf('0x19')](_0x39fe3c[_0x560159]);}RpcVoiceQueueReport[_0xf1bf('0x24')](_0x39fe3c[_0x560159]);}};function extractCalleridNumber(_0x3c73c4){var _0x58694c=_0x3c73c4[_0xf1bf('0x25')](/<(.*?)>/);return _0x58694c?_0x58694c[0x1]:_0x3c73c4;}Report['prototype']['voiceCallReport']=function(_0x11d1ba){_0x11d1ba[_0xf1bf('0x26')]=_0x11d1ba['destination']||_0x11d1ba['exten'];if(_0x11d1ba[_0xf1bf('0x27')]==_0xf1bf('0x28')){_0x11d1ba[_0xf1bf('0x29')]=_0xf1bf('0x2a');_0x11d1ba[_0xf1bf('0x2b')]=_0x11d1ba[_0xf1bf('0x2a')];if(_0x11d1ba[_0xf1bf('0x2c')]==_0xf1bf('0x2d')){_0x11d1ba[_0xf1bf('0x13')]='';_0x11d1ba[_0xf1bf('0x26')]=extractCalleridNumber(_0x11d1ba[_0xf1bf('0x2e')]);}else if(_0x11d1ba['context']==_0xf1bf('0x2f')){if(_0x11d1ba[_0xf1bf('0x26')]==_0xf1bf('0x30')){_0x11d1ba['destination']=extractCalleridNumber(_0x11d1ba[_0xf1bf('0x31')]);_0x11d1ba['calleridnum']=_0x11d1ba[_0xf1bf('0x32')];_0x11d1ba[_0xf1bf('0x33')]=[_0x11d1ba['channel'],_0x11d1ba[_0xf1bf('0x34')]=_0x11d1ba['destinationchannel']][0x0];_0x11d1ba[_0xf1bf('0x2e')]=_0x11d1ba[_0xf1bf('0x31')];}else{_0x11d1ba[_0xf1bf('0x26')]=_0x11d1ba[_0xf1bf('0x35')];_0x11d1ba[_0xf1bf('0x35')]=_0x11d1ba[_0xf1bf('0x32')];if(_0x11d1ba[_0xf1bf('0x36')]==_0xf1bf('0x37')){_0x11d1ba[_0xf1bf('0x13')]=_0x11d1ba[_0xf1bf('0x1b')];}else{_0x11d1ba[_0xf1bf('0x13')]='';}}}}else{_0x11d1ba['callerid']=util[_0xf1bf('0x16')](_0xf1bf('0x38'),_0x11d1ba[_0xf1bf('0x39')],_0x11d1ba[_0xf1bf('0x35')]);}RpcVoiceCallReport['create'](_0x11d1ba);if(_0x11d1ba[_0xf1bf('0x3a')]){for(var _0x54e284=0x0;_0x54e284<_0x11d1ba[_0xf1bf('0x3b')][_0xf1bf('0x1a')];_0x54e284+=0x1){_0x11d1ba[_0xf1bf('0x3c')]=_0x11d1ba['monitors'][_0x54e284]['filename'];_0x11d1ba[_0xf1bf('0x3d')]=_0x11d1ba[_0xf1bf('0x3b')][_0x54e284]['createdAt'];if(_0x11d1ba[_0xf1bf('0x3e')]=='xcally-motion-preview'){_0x11d1ba[_0xf1bf('0x35')]=_0x11d1ba[_0xf1bf('0x1b')];_0x11d1ba[_0xf1bf('0x39')]=_0x11d1ba[_0xf1bf('0x3f')];_0x11d1ba['connectedlinenum']=_0x11d1ba[_0xf1bf('0x13')];_0x11d1ba[_0xf1bf('0x3f')]=_0x11d1ba[_0xf1bf('0x40')];_0x11d1ba[_0xf1bf('0x3e')]=_0x11d1ba[_0xf1bf('0x32')];}else if(_0x11d1ba[_0xf1bf('0x3e')]==_0xf1bf('0x41')){_0x11d1ba[_0xf1bf('0x35')]=_0x11d1ba[_0xf1bf('0x26')];_0x11d1ba['exten']=_0x11d1ba[_0xf1bf('0x32')];}RpcVoiceRecording['create'](_0x11d1ba);}}};Report[_0xf1bf('0x18')][_0xf1bf('0x42')]=function(_0x3fe6f3){RpcVoiceAgentReport[_0xf1bf('0x24')](_0x3fe6f3);};Report['prototype'][_0xf1bf('0x43')]=function(_0x40c548){RpcVoiceDialReport[_0xf1bf('0x24')](_0x40c548);var _0x421881=undefined;var _0x3e6391=_0x40c548[_0xf1bf('0x34')];if(_['startsWith'](_0x3e6391,_0xf1bf('0x44'))){var _0x5e5ad5=_0x3e6391[_0xf1bf('0x45')](_0x3e6391['indexOf']('/')+0x1,_0x3e6391[_0xf1bf('0x46')]('@'));_0x421881=_['find'](this[_0xf1bf('0xe')],function(_0x1b232e){return _0x1b232e[_0xf1bf('0x47')]==_0x5e5ad5||_0x1b232e[_0xf1bf('0x48')]==_0x5e5ad5||_0x1b232e['accountcode']==_0x5e5ad5;});}else{var _0x5e5ad5=_0x3e6391['substring'](_0x3e6391['indexOf']('/')+0x1,_0x3e6391[_0xf1bf('0x49')]('-'));_0x421881=this[_0xf1bf('0x11')](_0x5e5ad5);}if(_0x421881){_0x40c548[_0xf1bf('0x1e')]=_[_0xf1bf('0x15')](_0x421881[_0xf1bf('0x1e')])?util[_0xf1bf('0x16')](_0xf1bf('0x17'),_0x421881[_0xf1bf('0x14')]):_0x421881[_0xf1bf('0x1e')];_0x40c548['membername']=_0x421881['name'];_0x40c548[_0xf1bf('0x13')]=_0x421881[_0xf1bf('0x13')];RpcMemberReport[_0xf1bf('0x43')](_0x40c548);}};Report[_0xf1bf('0x18')]['blindTransfer']=function(_0x4a1b65){RpcVoiceTransferReport[_0xf1bf('0x4a')](_0x4a1b65);};Report[_0xf1bf('0x18')][_0xf1bf('0x4b')]=function(_0xb69f37){RpcVoiceTransferReport[_0xf1bf('0x4b')](_0xb69f37);};module[_0xf1bf('0x4c')]=Report; \ No newline at end of file +var _0x5a9f=['bluebird','moment','util','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./userReport','realtime','agents','telephones','prototype','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','voiceQueueReport','assigned','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','destination','type','dialer','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','disposition','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','createdAt','exten','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','channel','Local','substring','indexOf','lastIndexOf','voiceDialReport','blindTransfer','attendedTransfer','exports'];(function(_0x4e02f2,_0x16f365){var _0x950618=function(_0x545c4a){while(--_0x545c4a){_0x4e02f2['push'](_0x4e02f2['shift']());}};_0x950618(++_0x16f365);}(_0x5a9f,0x14f));var _0xf5a9=function(_0x6499cf,_0x29ee68){_0x6499cf=_0x6499cf-0x0;var _0x4fab82=_0x5a9f[_0x6499cf];return _0x4fab82;};'use strict';var BPromise=require(_0xf5a9('0x0'));var _=require('lodash');var moment=require(_0xf5a9('0x1'));var util=require(_0xf5a9('0x2'));var logger=require('../../../config/logger')('ami');var ami=require(_0xf5a9('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xf5a9('0x4'));var RpcVoiceDialReport=require(_0xf5a9('0x5'));var RpcMemberReport=require(_0xf5a9('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xf5a9('0x7'));var RpcVoiceTransferReport=require(_0xf5a9('0x8'));var VoiceQueueReport=require(_0xf5a9('0x9'));var VoiceCallReport=require(_0xf5a9('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xf5a9('0xb'));function Report(_0x39a730){this[_0xf5a9('0xc')]=_0x39a730;this[_0xf5a9('0xd')]=_0x39a730[_0xf5a9('0xd')];this[_0xf5a9('0xe')]=_0x39a730[_0xf5a9('0xe')];}Report['prototype']['sync']=function(_0x460783){var _0x2e6497=new VoiceQueueReport(this['realtime']);var _0x391c41=new VoiceAgentReport(this[_0xf5a9('0xc')]);var _0xb80292=new VoiceDialReport(this[_0xf5a9('0xc')]);var _0x3f2e0e=new VoiceCallReport(this[_0xf5a9('0xc')]);var _0x16b5e0=new UserReport(this[_0xf5a9('0xc')]);};Report[_0xf5a9('0xf')][_0xf5a9('0x10')]=function(_0x2eb3ac){var _0x36155d=undefined;_0x36155d=_[_0xf5a9('0x11')](this['agents'],function(_0xe47697){return _0xe47697[_0xf5a9('0x12')]==_0x2eb3ac||_0xe47697[_0xf5a9('0x13')]==_0x2eb3ac;});if(_[_0xf5a9('0x14')](_0x36155d)){var _0x953661=_['find'](this['telephones'],function(_0x5a8364){return _0x5a8364[_0xf5a9('0x12')]==_0x2eb3ac||_0x5a8364['name']==_0x2eb3ac;});if(_0x953661){_0x36155d=_[_0xf5a9('0x11')](this['agents'],function(_0x161649){return _0x161649[_0xf5a9('0x15')]==util[_0xf5a9('0x16')](_0xf5a9('0x17'),_0x953661[_0xf5a9('0x13')]);});}}return _0x36155d;};Report[_0xf5a9('0xf')][_0xf5a9('0x18')]=function(_0x1d36dc){for(var _0x173cf0=0x0;_0x173cf0<_0x1d36dc['length'];_0x173cf0+=0x1){var _0x19a3ea=this[_0xf5a9('0x10')](_0x1d36dc[_0x173cf0]['connectedlinenum']);if(_0x19a3ea){_0x1d36dc[_0x173cf0]['accountcode']=_0x19a3ea[_0xf5a9('0x12')];_0x1d36dc[_0x173cf0][_0xf5a9('0x19')]=!![];_0x1d36dc[_0x173cf0]['lastAssignedTo']=_0x19a3ea[_0xf5a9('0x13')];_0x1d36dc[_0x173cf0][_0xf5a9('0x15')]=_['isNil'](_0x19a3ea[_0xf5a9('0x15')])?util[_0xf5a9('0x16')](_0xf5a9('0x17'),_0x19a3ea[_0xf5a9('0x13')]):_0x19a3ea[_0xf5a9('0x15')];if(_0x1d36dc[_0x173cf0][_0xf5a9('0x1a')]){_0x1d36dc[_0x173cf0][_0xf5a9('0x1b')]=moment()[_0xf5a9('0x16')](_0xf5a9('0x1c'));}if(_0x1d36dc[_0x173cf0][_0xf5a9('0x1d')]){_0x1d36dc[_0x173cf0][_0xf5a9('0x1e')]=moment()['format'](_0xf5a9('0x1c'));}RpcMemberReport[_0xf5a9('0x18')](_0x1d36dc[_0x173cf0]);}RpcVoiceQueueReport[_0xf5a9('0x1f')](_0x1d36dc[_0x173cf0]);}};function extractCalleridNumber(_0x5ddbca){var _0x1cf83c=_0x5ddbca['match'](/<(.*?)>/);return _0x1cf83c?_0x1cf83c[0x1]:_0x5ddbca;}Report[_0xf5a9('0xf')]['voiceCallReport']=function(_0x28088b){_0x28088b[_0xf5a9('0x20')]=_0x28088b['destination']||_0x28088b['exten'];if(_0x28088b[_0xf5a9('0x21')]==_0xf5a9('0x22')){_0x28088b['lastapplication']=_0xf5a9('0x23');_0x28088b[_0xf5a9('0x24')]=_0x28088b['queue'];if(_0x28088b[_0xf5a9('0x25')]==_0xf5a9('0x26')){_0x28088b[_0xf5a9('0x12')]='';_0x28088b[_0xf5a9('0x20')]=extractCalleridNumber(_0x28088b[_0xf5a9('0x27')]);}else if(_0x28088b[_0xf5a9('0x25')]==_0xf5a9('0x28')){if(_0x28088b[_0xf5a9('0x20')]==_0xf5a9('0x29')){_0x28088b[_0xf5a9('0x20')]=extractCalleridNumber(_0x28088b[_0xf5a9('0x2a')]);_0x28088b[_0xf5a9('0x2b')]=_0x28088b[_0xf5a9('0x2c')];_0x28088b[_0xf5a9('0x2d')]=[_0x28088b['channel'],_0x28088b['channel']=_0x28088b[_0xf5a9('0x2d')]][0x0];_0x28088b[_0xf5a9('0x27')]=_0x28088b[_0xf5a9('0x2a')];}else{_0x28088b[_0xf5a9('0x20')]=_0x28088b[_0xf5a9('0x2b')];_0x28088b['calleridnum']=_0x28088b['originatecalleridnum'];if(_0x28088b[_0xf5a9('0x2e')]=='ANSWERED'){_0x28088b[_0xf5a9('0x12')]=_0x28088b[_0xf5a9('0x2f')];}else{_0x28088b[_0xf5a9('0x12')]='';}}}}else{_0x28088b[_0xf5a9('0x27')]=util[_0xf5a9('0x16')](_0xf5a9('0x30'),_0x28088b[_0xf5a9('0x31')],_0x28088b[_0xf5a9('0x2b')]);}RpcVoiceCallReport['create'](_0x28088b);if(_0x28088b[_0xf5a9('0x32')]){for(var _0x383af3=0x0;_0x383af3<_0x28088b[_0xf5a9('0x33')]['length'];_0x383af3+=0x1){_0x28088b['monitorFilename']=_0x28088b[_0xf5a9('0x33')][_0x383af3]['filename'];_0x28088b[_0xf5a9('0x34')]=_0x28088b[_0xf5a9('0x33')][_0x383af3]['createdAt'];if(_0x28088b[_0xf5a9('0x35')]==_0xf5a9('0x29')){_0x28088b[_0xf5a9('0x2b')]=_0x28088b[_0xf5a9('0x2f')];_0x28088b[_0xf5a9('0x31')]=_0x28088b[_0xf5a9('0x36')];_0x28088b[_0xf5a9('0x2f')]=_0x28088b[_0xf5a9('0x12')];_0x28088b[_0xf5a9('0x36')]=_0x28088b[_0xf5a9('0x37')];_0x28088b[_0xf5a9('0x35')]=_0x28088b[_0xf5a9('0x2c')];}else if(_0x28088b[_0xf5a9('0x35')]==_0xf5a9('0x38')){_0x28088b[_0xf5a9('0x2b')]=_0x28088b[_0xf5a9('0x20')];_0x28088b[_0xf5a9('0x35')]=_0x28088b['originatecalleridnum'];}RpcVoiceRecording[_0xf5a9('0x1f')](_0x28088b);}}};Report[_0xf5a9('0xf')][_0xf5a9('0x39')]=function(_0x1335fd){RpcVoiceAgentReport[_0xf5a9('0x1f')](_0x1335fd);};Report[_0xf5a9('0xf')]['voiceDialReport']=function(_0x2e68c4){RpcVoiceDialReport[_0xf5a9('0x1f')](_0x2e68c4);var _0x1c19c7=undefined;var _0x372fca=_0x2e68c4[_0xf5a9('0x3a')];if(_['startsWith'](_0x372fca,_0xf5a9('0x3b'))){var _0x84e207=_0x372fca[_0xf5a9('0x3c')](_0x372fca[_0xf5a9('0x3d')]('/')+0x1,_0x372fca['indexOf']('@'));_0x1c19c7=_[_0xf5a9('0x11')](this[_0xf5a9('0xd')],function(_0x31bda0){return _0x31bda0['mobile']==_0x84e207||_0x31bda0['phone']==_0x84e207||_0x31bda0[_0xf5a9('0x12')]==_0x84e207;});}else{var _0x84e207=_0x372fca['substring'](_0x372fca[_0xf5a9('0x3d')]('/')+0x1,_0x372fca[_0xf5a9('0x3e')]('-'));_0x1c19c7=this[_0xf5a9('0x10')](_0x84e207);}if(_0x1c19c7){_0x2e68c4['interface']=_[_0xf5a9('0x14')](_0x1c19c7[_0xf5a9('0x15')])?util[_0xf5a9('0x16')](_0xf5a9('0x17'),_0x1c19c7['name']):_0x1c19c7[_0xf5a9('0x15')];_0x2e68c4[_0xf5a9('0x37')]=_0x1c19c7[_0xf5a9('0x13')];_0x2e68c4[_0xf5a9('0x12')]=_0x1c19c7['accountcode'];RpcMemberReport[_0xf5a9('0x3f')](_0x2e68c4);}};Report[_0xf5a9('0xf')]['blindTransfer']=function(_0x1a2e17){RpcVoiceTransferReport[_0xf5a9('0x40')](_0x1a2e17);};Report['prototype'][_0xf5a9('0x41')]=function(_0x22adf6){RpcVoiceTransferReport[_0xf5a9('0x41')](_0x22adf6);};module[_0xf5a9('0x42')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 6aa2d42..daede2b 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 _0x2ca2=['bind','syncRegistry','syncDeviceState','peerstatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','inspect','prototype','isNotNull','isUndefined','emit','find','username','state','merge','event','actionid','format','trunk:%s','name','error','[syncRegistry][UserReport]','toLowerCase','inuse','device','local','stateTime','toNumber','updateStatusRealtime','telephone:%s','trunk:save','startsWith','Queue','Local','substring','indexOf','phone','accountcode','[syncDeviceState][UserReport]','syncPeerStatus','peer','registered','status','address','telephone:save','lodash','bluebird','util','../../../config/environment','ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x2ca2,0xf3));var _0x22ca=function(_0x40a272,_0x1aa9e2){_0x40a272=_0x40a272-0x0;var _0xe4ffee=_0x2ca2[_0x40a272];return _0xe4ffee;};'use strict';var _=require(_0x22ca('0x0'));var moment=require('moment');var BPromise=require(_0x22ca('0x1'));var util=require(_0x22ca('0x2'));var Redis=require('ioredis');var config=require(_0x22ca('0x3'));var logger=require('../../../config/logger')(_0x22ca('0x4'));var ami=require('../ami');config[_0x22ca('0x5')]=_[_0x22ca('0x6')](config[_0x22ca('0x5')],{'host':_0x22ca('0x7'),'port':0x18eb});var io=require(_0x22ca('0x8'))(new Redis(config['redis']));function UserReport(_0xbf936c){this[_0x22ca('0x9')]=_0xbf936c[_0x22ca('0x9')];this[_0x22ca('0xa')]=_0xbf936c[_0x22ca('0xa')];this[_0x22ca('0xb')]=_0xbf936c['telephones'];ami['on'](_0x22ca('0xc'),this['syncRegistry'][_0x22ca('0xd')](this));ami['on']('registry',this[_0x22ca('0xe')][_0x22ca('0xd')](this));ami['on']('devicestatechange',this[_0x22ca('0xf')][_0x22ca('0xd')](this));ami['on'](_0x22ca('0x10'),this['syncPeerStatus']['bind'](this));this[_0x22ca('0x11')]();return BPromise[_0x22ca('0x12')]()[_0x22ca('0x13')](ami[_0x22ca('0x14')]())['then'](ami[_0x22ca('0x15')]())[_0x22ca('0x13')](ami[_0x22ca('0x16')]())[_0x22ca('0x17')](loggerCatch(_0x22ca('0x18')));}function loggerCatch(_0x4a269c){return function(_0xa6d2fc){logger['error'](_0x4a269c,util[_0x22ca('0x19')](_0xa6d2fc,{'showHidden':![],'depth':null}));};}UserReport[_0x22ca('0x1a')][_0x22ca('0x11')]=function(){setInterval(function(){BPromise[_0x22ca('0x12')]()[_0x22ca('0x13')](ami[_0x22ca('0x14')]())[_0x22ca('0x13')](ami[_0x22ca('0x15')]())[_0x22ca('0x13')](ami['actionSipPeerStatus']())['catch'](loggerCatch(_0x22ca('0x18')));},0x32c8);};UserReport[_0x22ca('0x1a')][_0x22ca('0x1b')]=function(_0x2af158){return _0x2af158!==null&&!_[_0x22ca('0x1c')](_0x2af158);};UserReport[_0x22ca('0x1a')][_0x22ca('0x1d')]=function(_0x140008,_0x301117,_0x47ef38){io['to'](_0x140008)['emit'](_0x301117,_0x47ef38);};UserReport['prototype'][_0x22ca('0xe')]=function(_0x30f013){try{if(this[_0x22ca('0x1b')](_0x30f013)){var _0x402594=_[_0x22ca('0x1e')](this[_0x22ca('0x9')],{'registry':_0x30f013[_0x22ca('0x1f')]});if(_0x402594){_0x30f013['stateRegistry']=_0x30f013[_0x22ca('0x20')];_[_0x22ca('0x21')](_0x402594,_['omit'](_0x30f013,[_0x22ca('0x22'),_0x22ca('0x23'),_0x22ca('0x1f'),_0x22ca('0x20')]));this[_0x22ca('0x1d')](util[_0x22ca('0x24')](_0x22ca('0x25'),_0x402594[_0x22ca('0x26')]),'trunk:save',_0x402594);}}}catch(_0x43931d){logger[_0x22ca('0x27')](_0x22ca('0x28'),util[_0x22ca('0x19')](_0x43931d,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x22ca('0xf')]=function(_0x4b0dee){try{if(this[_0x22ca('0x1b')](_0x4b0dee)){if(this[_0x22ca('0xa')][_0x4b0dee['device']]){if(!this[_0x22ca('0xa')][_0x4b0dee['device']]['local']||_0x4b0dee[_0x22ca('0x20')][_0x22ca('0x29')]()==_0x22ca('0x2a')){this[_0x22ca('0xa')][_0x4b0dee[_0x22ca('0x2b')]][_0x22ca('0x2c')]=![];if(this[_0x22ca('0xa')][_0x4b0dee[_0x22ca('0x2b')]][_0x22ca('0x20')]!==_0x4b0dee[_0x22ca('0x20')][_0x22ca('0x29')]()){this[_0x22ca('0xa')][_0x4b0dee[_0x22ca('0x2b')]][_0x22ca('0x2d')]=_[_0x22ca('0x2e')](moment()[_0x22ca('0x24')]('x'));}this[_0x22ca('0xa')][_0x4b0dee[_0x22ca('0x2b')]][_0x22ca('0x20')]=_0x4b0dee['state']['toLowerCase']();this['agents'][_0x4b0dee[_0x22ca('0x2b')]][_0x22ca('0x2f')](_0x4b0dee);}}else if(this['telephones'][_0x4b0dee['device']]){if(this[_0x22ca('0xb')][_0x4b0dee[_0x22ca('0x2b')]]['state']!==_0x4b0dee[_0x22ca('0x20')]['toLowerCase']()){this[_0x22ca('0xb')][_0x4b0dee[_0x22ca('0x2b')]][_0x22ca('0x2d')]=_[_0x22ca('0x2e')](moment()[_0x22ca('0x24')]('x'));}this[_0x22ca('0xb')][_0x4b0dee['device']]['state']=_0x4b0dee[_0x22ca('0x20')]['toLowerCase']();this[_0x22ca('0x1d')](util[_0x22ca('0x24')](_0x22ca('0x30'),this['telephones'][_0x4b0dee[_0x22ca('0x2b')]]['name']),'telephone:save',this['telephones'][_0x4b0dee[_0x22ca('0x2b')]]);}else if(this['trunks'][_0x4b0dee[_0x22ca('0x2b')]]){if(this[_0x22ca('0x9')][_0x4b0dee[_0x22ca('0x2b')]][_0x22ca('0x20')]!==_0x4b0dee[_0x22ca('0x20')][_0x22ca('0x29')]()){this[_0x22ca('0x9')][_0x4b0dee[_0x22ca('0x2b')]][_0x22ca('0x2d')]=_[_0x22ca('0x2e')](moment()[_0x22ca('0x24')]('x'));}this[_0x22ca('0x9')][_0x4b0dee['device']][_0x22ca('0x20')]=_0x4b0dee['state'][_0x22ca('0x29')]();this[_0x22ca('0x1d')](util[_0x22ca('0x24')](_0x22ca('0x25'),this[_0x22ca('0x9')][_0x4b0dee[_0x22ca('0x2b')]]['name']),_0x22ca('0x31'),this[_0x22ca('0x9')][_0x4b0dee['device']]);}else if(_[_0x22ca('0x32')](_0x4b0dee[_0x22ca('0x2b')],_0x22ca('0x33'))){}else if(_['startsWith'](_0x4b0dee[_0x22ca('0x2b')],_0x22ca('0x34'))){var _0x4689e9=_0x4b0dee[_0x22ca('0x2b')];var _0x1c50f2=_0x4689e9[_0x22ca('0x35')](_0x4689e9['indexOf']('/')+0x1,_0x4689e9[_0x22ca('0x36')]('@'));var _0x571ebc=_[_0x22ca('0x1e')](this['agents'],function(_0x50fd94){return _0x50fd94['mobile']==_0x1c50f2||_0x50fd94[_0x22ca('0x37')]==_0x1c50f2||_0x50fd94[_0x22ca('0x38')]==_0x1c50f2;});if(_0x571ebc){if(_0x571ebc[_0x22ca('0x20')]!==_0x4b0dee['state'][_0x22ca('0x29')]()){_0x571ebc['stateTime']=_[_0x22ca('0x2e')](moment()[_0x22ca('0x24')]('x'));}_0x571ebc[_0x22ca('0x20')]=_0x4b0dee['state'][_0x22ca('0x29')]();_0x571ebc[_0x22ca('0x2c')]=!![];_0x571ebc[_0x22ca('0x2f')](_0x4b0dee);}}else{}}}catch(_0x13a061){logger['error'](_0x22ca('0x39'),util[_0x22ca('0x19')](_0x13a061,{'showHidden':![],'depth':null}));}};UserReport[_0x22ca('0x1a')][_0x22ca('0x3a')]=function(_0xa642f9){try{if(this[_0x22ca('0x1b')](_0xa642f9)&&this[_0x22ca('0x1b')](_0xa642f9[_0x22ca('0x10')])){if(this[_0x22ca('0xa')][_0xa642f9[_0x22ca('0x3b')]]){if(!this[_0x22ca('0xa')][_0xa642f9[_0x22ca('0x3b')]]['local']||_0xa642f9[_0x22ca('0x10')]['toLowerCase']()==_0x22ca('0x3c')){this[_0x22ca('0xa')][_0xa642f9['peer']][_0x22ca('0x2c')]=![];this[_0x22ca('0xa')][_0xa642f9[_0x22ca('0x3b')]][_0x22ca('0x3d')]=_0xa642f9[_0x22ca('0x10')][_0x22ca('0x29')]();this[_0x22ca('0xa')][_0xa642f9['peer']][_0x22ca('0x3e')]=_0xa642f9[_0x22ca('0x3e')];this['agents'][_0xa642f9['peer']][_0x22ca('0x2f')](_0xa642f9);}}else if(this['telephones'][_0xa642f9[_0x22ca('0x3b')]]){this['telephones'][_0xa642f9['peer']]['status']=_0xa642f9['peerstatus'][_0x22ca('0x29')]();this[_0x22ca('0xb')][_0xa642f9[_0x22ca('0x3b')]][_0x22ca('0x3e')]=_0xa642f9[_0x22ca('0x3e')];this[_0x22ca('0x1d')](util[_0x22ca('0x24')](_0x22ca('0x30'),this[_0x22ca('0xb')][_0xa642f9['peer']][_0x22ca('0x26')]),_0x22ca('0x3f'),this[_0x22ca('0xb')][_0xa642f9[_0x22ca('0x3b')]]);}else if(this['trunks'][_0xa642f9[_0x22ca('0x3b')]]){this[_0x22ca('0x9')][_0xa642f9[_0x22ca('0x3b')]][_0x22ca('0x3d')]=_0xa642f9[_0x22ca('0x10')][_0x22ca('0x29')]();this[_0x22ca('0x9')][_0xa642f9[_0x22ca('0x3b')]]['address']=_0xa642f9[_0x22ca('0x3e')];this[_0x22ca('0x1d')](util[_0x22ca('0x24')](_0x22ca('0x25'),this[_0x22ca('0x9')][_0xa642f9[_0x22ca('0x3b')]][_0x22ca('0x26')]),_0x22ca('0x31'),this['trunks'][_0xa642f9[_0x22ca('0x3b')]]);}else{}}}catch(_0xd3ab90){logger['error']('[syncPeerStatus][UserReport]',util['inspect'](_0xd3ab90,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x7599=['telephone:save','startsWith','Queue','Local','substring','indexOf','mobile','phone','[syncDeviceState][UserReport]','peer','registered','status','address','exports','bluebird','util','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','actionSipShowRegistry','isNotNull','emit','find','username','stateRegistry','state','merge','omit','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','inspect','prototype','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephone:%s'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x7599,0xd1));var _0x9759=function(_0x4b2030,_0x447460){_0x4b2030=_0x4b2030-0x0;var _0x46b080=_0x7599[_0x4b2030];return _0x46b080;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x9759('0x0'));var util=require(_0x9759('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x9759('0x2'));var ami=require(_0x9759('0x3'));config[_0x9759('0x4')]=_[_0x9759('0x5')](config[_0x9759('0x4')],{'host':_0x9759('0x6'),'port':0x18eb});var io=require(_0x9759('0x7'))(new Redis(config[_0x9759('0x4')]));function UserReport(_0x2e8314){this[_0x9759('0x8')]=_0x2e8314[_0x9759('0x8')];this[_0x9759('0x9')]=_0x2e8314['agents'];this[_0x9759('0xa')]=_0x2e8314[_0x9759('0xa')];ami['on'](_0x9759('0xb'),this[_0x9759('0xc')][_0x9759('0xd')](this));ami['on'](_0x9759('0xe'),this['syncRegistry'][_0x9759('0xd')](this));ami['on'](_0x9759('0xf'),this[_0x9759('0x10')][_0x9759('0xd')](this));ami['on'](_0x9759('0x11'),this[_0x9759('0x12')][_0x9759('0xd')](this));this[_0x9759('0x13')]();return BPromise[_0x9759('0x14')]()[_0x9759('0x15')](ami['actionSipShowRegistry']())[_0x9759('0x15')](ami[_0x9759('0x16')]())[_0x9759('0x15')](ami[_0x9759('0x17')]())[_0x9759('0x18')](loggerCatch(_0x9759('0x19')));}function loggerCatch(_0x5e49d2){return function(_0x50b71b){logger[_0x9759('0x1a')](_0x5e49d2,util['inspect'](_0x50b71b,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0x9759('0x13')]=function(){setInterval(function(){BPromise['resolve']()[_0x9759('0x15')](ami[_0x9759('0x1b')]())[_0x9759('0x15')](ami[_0x9759('0x16')]())['then'](ami[_0x9759('0x17')]())[_0x9759('0x18')](loggerCatch(_0x9759('0x19')));},0x32c8);};UserReport['prototype'][_0x9759('0x1c')]=function(_0xf67db){return _0xf67db!==null&&!_['isUndefined'](_0xf67db);};UserReport['prototype'][_0x9759('0x1d')]=function(_0x3def2c,_0x56b6e0,_0x50429d){io['to'](_0x3def2c)['emit'](_0x56b6e0,_0x50429d);};UserReport['prototype'][_0x9759('0xc')]=function(_0x4a0f3d){try{if(this[_0x9759('0x1c')](_0x4a0f3d)){var _0x564be5=_[_0x9759('0x1e')](this['trunks'],{'registry':_0x4a0f3d[_0x9759('0x1f')]});if(_0x564be5){_0x4a0f3d[_0x9759('0x20')]=_0x4a0f3d[_0x9759('0x21')];_[_0x9759('0x22')](_0x564be5,_[_0x9759('0x23')](_0x4a0f3d,['event','actionid',_0x9759('0x1f'),_0x9759('0x21')]));this['emit'](util[_0x9759('0x24')](_0x9759('0x25'),_0x564be5[_0x9759('0x26')]),_0x9759('0x27'),_0x564be5);}}}catch(_0x466580){logger['error'](_0x9759('0x28'),util[_0x9759('0x29')](_0x466580,{'showHidden':![],'depth':null}));}};UserReport[_0x9759('0x2a')][_0x9759('0x10')]=function(_0x36df14){try{if(this['isNotNull'](_0x36df14)){if(this[_0x9759('0x9')][_0x36df14['device']]){if(!this[_0x9759('0x9')][_0x36df14[_0x9759('0x2b')]][_0x9759('0x2c')]||_0x36df14[_0x9759('0x21')][_0x9759('0x2d')]()==_0x9759('0x2e')){this['agents'][_0x36df14['device']][_0x9759('0x2c')]=![];if(this['agents'][_0x36df14[_0x9759('0x2b')]][_0x9759('0x21')]!==_0x36df14[_0x9759('0x21')][_0x9759('0x2d')]()){this[_0x9759('0x9')][_0x36df14['device']][_0x9759('0x2f')]=_[_0x9759('0x30')](moment()['format']('x'));}this[_0x9759('0x9')][_0x36df14[_0x9759('0x2b')]][_0x9759('0x21')]=_0x36df14['state'][_0x9759('0x2d')]();this[_0x9759('0x9')][_0x36df14['device']][_0x9759('0x31')](_0x36df14);}}else if(this[_0x9759('0xa')][_0x36df14[_0x9759('0x2b')]]){if(this['telephones'][_0x36df14[_0x9759('0x2b')]][_0x9759('0x21')]!==_0x36df14[_0x9759('0x21')][_0x9759('0x2d')]()){this[_0x9759('0xa')][_0x36df14['device']][_0x9759('0x2f')]=_[_0x9759('0x30')](moment()['format']('x'));}this[_0x9759('0xa')][_0x36df14['device']][_0x9759('0x21')]=_0x36df14['state'][_0x9759('0x2d')]();this[_0x9759('0x1d')](util[_0x9759('0x24')](_0x9759('0x32'),this[_0x9759('0xa')][_0x36df14[_0x9759('0x2b')]][_0x9759('0x26')]),_0x9759('0x33'),this[_0x9759('0xa')][_0x36df14[_0x9759('0x2b')]]);}else if(this[_0x9759('0x8')][_0x36df14[_0x9759('0x2b')]]){if(this['trunks'][_0x36df14['device']]['state']!==_0x36df14[_0x9759('0x21')]['toLowerCase']()){this[_0x9759('0x8')][_0x36df14[_0x9759('0x2b')]][_0x9759('0x2f')]=_['toNumber'](moment()[_0x9759('0x24')]('x'));}this[_0x9759('0x8')][_0x36df14[_0x9759('0x2b')]]['state']=_0x36df14[_0x9759('0x21')]['toLowerCase']();this[_0x9759('0x1d')](util[_0x9759('0x24')](_0x9759('0x25'),this[_0x9759('0x8')][_0x36df14['device']][_0x9759('0x26')]),_0x9759('0x27'),this[_0x9759('0x8')][_0x36df14[_0x9759('0x2b')]]);}else if(_[_0x9759('0x34')](_0x36df14[_0x9759('0x2b')],_0x9759('0x35'))){}else if(_[_0x9759('0x34')](_0x36df14[_0x9759('0x2b')],_0x9759('0x36'))){var _0x5e5d3e=_0x36df14[_0x9759('0x2b')];var _0x19a0f4=_0x5e5d3e[_0x9759('0x37')](_0x5e5d3e[_0x9759('0x38')]('/')+0x1,_0x5e5d3e[_0x9759('0x38')]('@'));var _0x185a98=_[_0x9759('0x1e')](this[_0x9759('0x9')],function(_0x3653e6){return _0x3653e6[_0x9759('0x39')]==_0x19a0f4||_0x3653e6[_0x9759('0x3a')]==_0x19a0f4||_0x3653e6['accountcode']==_0x19a0f4;});if(_0x185a98){if(_0x185a98[_0x9759('0x21')]!==_0x36df14[_0x9759('0x21')][_0x9759('0x2d')]()){_0x185a98[_0x9759('0x2f')]=_[_0x9759('0x30')](moment()['format']('x'));}_0x185a98[_0x9759('0x21')]=_0x36df14[_0x9759('0x21')][_0x9759('0x2d')]();_0x185a98[_0x9759('0x2c')]=!![];_0x185a98[_0x9759('0x31')](_0x36df14);}}else{}}}catch(_0x1c6fae){logger[_0x9759('0x1a')](_0x9759('0x3b'),util['inspect'](_0x1c6fae,{'showHidden':![],'depth':null}));}};UserReport[_0x9759('0x2a')][_0x9759('0x12')]=function(_0x25c459){try{if(this[_0x9759('0x1c')](_0x25c459)&&this[_0x9759('0x1c')](_0x25c459[_0x9759('0x11')])){if(this[_0x9759('0x9')][_0x25c459[_0x9759('0x3c')]]){if(!this[_0x9759('0x9')][_0x25c459[_0x9759('0x3c')]][_0x9759('0x2c')]||_0x25c459[_0x9759('0x11')]['toLowerCase']()==_0x9759('0x3d')){this[_0x9759('0x9')][_0x25c459[_0x9759('0x3c')]][_0x9759('0x2c')]=![];this[_0x9759('0x9')][_0x25c459[_0x9759('0x3c')]][_0x9759('0x3e')]=_0x25c459['peerstatus'][_0x9759('0x2d')]();this['agents'][_0x25c459[_0x9759('0x3c')]][_0x9759('0x3f')]=_0x25c459[_0x9759('0x3f')];this[_0x9759('0x9')][_0x25c459[_0x9759('0x3c')]][_0x9759('0x31')](_0x25c459);}}else if(this[_0x9759('0xa')][_0x25c459[_0x9759('0x3c')]]){this[_0x9759('0xa')][_0x25c459[_0x9759('0x3c')]][_0x9759('0x3e')]=_0x25c459[_0x9759('0x11')][_0x9759('0x2d')]();this[_0x9759('0xa')][_0x25c459[_0x9759('0x3c')]]['address']=_0x25c459[_0x9759('0x3f')];this[_0x9759('0x1d')](util[_0x9759('0x24')]('telephone:%s',this[_0x9759('0xa')][_0x25c459[_0x9759('0x3c')]][_0x9759('0x26')]),_0x9759('0x33'),this[_0x9759('0xa')][_0x25c459[_0x9759('0x3c')]]);}else if(this[_0x9759('0x8')][_0x25c459['peer']]){this['trunks'][_0x25c459[_0x9759('0x3c')]][_0x9759('0x3e')]=_0x25c459[_0x9759('0x11')][_0x9759('0x2d')]();this[_0x9759('0x8')][_0x25c459[_0x9759('0x3c')]]['address']=_0x25c459[_0x9759('0x3f')];this[_0x9759('0x1d')](util[_0x9759('0x24')](_0x9759('0x25'),this['trunks'][_0x25c459['peer']][_0x9759('0x26')]),_0x9759('0x27'),this[_0x9759('0x8')][_0x25c459[_0x9759('0x3c')]]);}else{}}}catch(_0x23aedc){logger['error']('[syncPeerStatus][UserReport]',util[_0x9759('0x29')](_0x23aedc,{'showHidden':![],'depth':null}));}};module[_0x9759('0x40')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 071ccc6..d56179b 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 _0x1a2d=['destchannel','calleridname','destcalleridnum','destcalleridname','accountcode','destaccountcode','channel','uniqueid','destuniqueid','context','type','inbound','mandatoryDisposition','called','custom:agentcalled','user:%s','user:called','error','syncAgentConnect','ringtime','connect','agentconnectAt','agentcalledAt','custom:agentconnect','user:agentconnect','stack','find','onhold','updateStatusRealtime','rejected','agentringnoanswerAt','RINGNOANSWER','holdtime','abandoned','custom:agentqueuecallerabandon','CALLERABANDON','reason','transfer','agent','complete','acw','acwTimeout','agentcompleteAt','talktime','COMPLETE','clear','cause','answered_elsewhere','custom:agentansweredelsewhere','custom:agentcomplete','user:agentcomplete','HANGUP','recalculate','origtransfererchannel','secondtransfereruniqueid','secondtransfererexten','secondtransferercontext','ATTENDED','transfererchannel','BLIND','transfereeuniqueid','extension','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','keys','variable','includes','value','exports','lodash','moment','ioredis','../../../config/environment','ami','../ami','redis','localhost','socket.io-emitter','voiceQueues','agents','channels','variables','agentconnect','bind','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncHangup','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','prototype','log','info','format','%s|%s','membername','queue','exten','join','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','syncAgentCalled','interface','isNil','assign','calleridnum','emit','user:save'];(function(_0x351065,_0xe5cbac){var _0x148ad6=function(_0x1386d1){while(--_0x1386d1){_0x351065['push'](_0x351065['shift']());}};_0x148ad6(++_0xe5cbac);}(_0x1a2d,0xce));var _0xd1a2=function(_0x58e0a2,_0x2b4b5f){_0x58e0a2=_0x58e0a2-0x0;var _0x5ea02f=_0x1a2d[_0x58e0a2];return _0x5ea02f;};'use strict';var _=require(_0xd1a2('0x0'));var moment=require(_0xd1a2('0x1'));var util=require('util');var Redis=require(_0xd1a2('0x2'));var config=require(_0xd1a2('0x3'));var logger=require('../../../config/logger')(_0xd1a2('0x4'));var ami=require(_0xd1a2('0x5'));config[_0xd1a2('0x6')]=_['defaults'](config[_0xd1a2('0x6')],{'host':_0xd1a2('0x7'),'port':0x18eb});var io=require(_0xd1a2('0x8'))(new Redis(config[_0xd1a2('0x6')]));function VoiceAgentReport(_0x4ad898){this[_0xd1a2('0x9')]=_0x4ad898[_0xd1a2('0x9')];this[_0xd1a2('0xa')]=_0x4ad898[_0xd1a2('0xa')];this[_0xd1a2('0xb')]={};this[_0xd1a2('0xc')]={};ami['on']('agentcalled',this['syncAgentCalled']['bind'](this));ami['on'](_0xd1a2('0xd'),this['syncAgentConnect'][_0xd1a2('0xe')](this));ami['on'](_0xd1a2('0xf'),this[_0xd1a2('0x10')][_0xd1a2('0xe')](this));ami['on']('queuecallerabandon',this[_0xd1a2('0x11')]['bind'](this));ami['on'](_0xd1a2('0x12'),this[_0xd1a2('0x13')][_0xd1a2('0xe')](this));ami['on'](_0xd1a2('0x14'),this['syncVarSet'][_0xd1a2('0xe')](this));ami['on']('hangup',this[_0xd1a2('0x15')][_0xd1a2('0xe')](this));ami['on'](_0xd1a2('0x16'),this[_0xd1a2('0x17')][_0xd1a2('0xe')](this));ami['on']('blindtransfer',this[_0xd1a2('0x18')][_0xd1a2('0xe')](this));ami['on'](_0xd1a2('0x19'),this[_0xd1a2('0x1a')]['bind'](this));ami['on']('musiconholdstop',this[_0xd1a2('0x1b')][_0xd1a2('0xe')](this));}VoiceAgentReport[_0xd1a2('0x1c')][_0xd1a2('0x1d')]=function(_0xd007b,_0x34d556){logger[_0xd1a2('0x1e')](util[_0xd1a2('0x1f')](_0xd1a2('0x20'),_0xd007b,[_0x34d556['uniqueid'],_0x34d556[_0xd1a2('0x21')],_0x34d556[_0xd1a2('0x22')],_0x34d556[_0xd1a2('0x23')],_0x34d556['calleridnum']][_0xd1a2('0x24')]('|')));};VoiceAgentReport[_0xd1a2('0x1c')][_0xd1a2('0x25')]=function(_0x1e9b96,_0x20ed8f){return moment(_0x1e9b96)[_0xd1a2('0x26')](_0x20ed8f,_0xd1a2('0x27'))[_0xd1a2('0x1f')](_0xd1a2('0x28'));};VoiceAgentReport[_0xd1a2('0x1c')][_0xd1a2('0x29')]=function(_0x384c3d,_0x4ceada){return moment(_0x384c3d)[_0xd1a2('0x2a')](moment(_0x4ceada),'seconds');};VoiceAgentReport[_0xd1a2('0x1c')][_0xd1a2('0x2b')]=function(_0x1fc1f1){try{var _0x43d44d=this[_0xd1a2('0xa')][_0x1fc1f1[_0xd1a2('0x2c')]];if(!_[_0xd1a2('0x2d')](_0x43d44d)){_0x43d44d=_[_0xd1a2('0x2e')](_0x43d44d,{'queue':_0x1fc1f1[_0xd1a2('0x22')],'destconnectedlinenum':_0x1fc1f1[_0xd1a2('0x2f')]});io[_0xd1a2('0x30')](_0xd1a2('0x31'),_0x43d44d);}var _0x12a59f=this['channels'][_0x1fc1f1[_0xd1a2('0x32')]]={'agentcalledAt':moment()[_0xd1a2('0x1f')](_0xd1a2('0x28')),'calleridnum':_0x1fc1f1[_0xd1a2('0x2f')],'calleridname':_0x1fc1f1[_0xd1a2('0x33')],'connectedlinenum':_0x1fc1f1[_0xd1a2('0x34')],'connectedlinename':_0x1fc1f1[_0xd1a2('0x35')],'accountcode':_0x1fc1f1[_0xd1a2('0x36')],'destaccountcode':_0x1fc1f1[_0xd1a2('0x37')],'channel':_0x1fc1f1[_0xd1a2('0x38')],'destchannel':_0x1fc1f1['destchannel'],'uniqueid':_0x1fc1f1[_0xd1a2('0x39')],'destuniqueid':_0x1fc1f1[_0xd1a2('0x3a')],'context':_0x1fc1f1[_0xd1a2('0x3b')],'exten':_0x1fc1f1['exten'],'priority':_0x1fc1f1['priority'],'queue':_0x1fc1f1[_0xd1a2('0x22')],'type':this['voiceQueues'][_0x1fc1f1[_0xd1a2('0x22')]]?this[_0xd1a2('0x9')][_0x1fc1f1['queue']][_0xd1a2('0x3c')]||_0xd1a2('0x3d'):_0xd1a2('0x3d'),'interface':_0x1fc1f1[_0xd1a2('0x2c')],'mandatoryDisposition':this[_0xd1a2('0x9')][_0x1fc1f1[_0xd1a2('0x22')]][_0xd1a2('0x3e')]||0x0,'membername':_0x1fc1f1[_0xd1a2('0x21')],'agentconnect':![],'agentconnectAt':null,'holdtime':0x0,'ringtime':0x0,'agentcomplete':![],'agentcompleteAt':null,'talktime':0x0,'agentringnoanswer':![],'agentringnoanswerAt':null,'reason':'agent','transfer':![],'transferAt':null,'transfertype':null,'transferuniqueid':null,'transfercontext':null,'transferextension':null,'position':null,'originalposition':null,'cause':'','cause-txt':'','UserId':this['agents'][_0x1fc1f1[_0xd1a2('0x2c')]]?this['agents'][_0x1fc1f1[_0xd1a2('0x2c')]]['id']:null,'lastevent':_0xd1a2('0x3f'),'agentacw':![],'acwtime':0x0,'variables':this[_0xd1a2('0xc')][_0x1fc1f1[_0xd1a2('0x38')]]?this[_0xd1a2('0xc')][_0x1fc1f1['channel']]:{}};ami['emit'](_0xd1a2('0x40'),_0x12a59f);io['to'](util[_0xd1a2('0x1f')](_0xd1a2('0x41'),_0x12a59f['membername']))[_0xd1a2('0x30')](_0xd1a2('0x42'),_0x12a59f);this[_0xd1a2('0x1d')]('CALLED',this['channels'][_0x1fc1f1[_0xd1a2('0x32')]]);}catch(_0x3c66d0){logger[_0xd1a2('0x43')](_0x3c66d0['stack']);}};VoiceAgentReport[_0xd1a2('0x1c')][_0xd1a2('0x44')]=function(_0x46e58b){try{var _0x2ff313=this[_0xd1a2('0xb')][_0x46e58b[_0xd1a2('0x32')]];if(!_['isNil'](_0x2ff313)){_0x2ff313=_[_0xd1a2('0x2e')](_0x2ff313,{'holdtime':parseInt(_0x46e58b['holdtime'],0xa),'ringtime':parseInt(_0x46e58b[_0xd1a2('0x45')],0xa),'agentconnect':!![],'lastevent':_0xd1a2('0x46')});_0x2ff313[_0xd1a2('0x47')]=this[_0xd1a2('0x25')](_0x2ff313[_0xd1a2('0x48')],_0x2ff313[_0xd1a2('0x45')]);ami[_0xd1a2('0x30')](_0xd1a2('0x49'),_0x2ff313);io['to'](util[_0xd1a2('0x1f')](_0xd1a2('0x41'),_0x2ff313[_0xd1a2('0x21')]))[_0xd1a2('0x30')](_0xd1a2('0x4a'),_0x2ff313);this[_0xd1a2('0x1d')]('CONNECT',_0x2ff313);}}catch(_0xdeccc5){logger[_0xd1a2('0x43')](_0xdeccc5[_0xd1a2('0x4b')]);}};VoiceAgentReport[_0xd1a2('0x1c')][_0xd1a2('0x1a')]=function(_0x2dcd80){try{var _0x36f1f4=_[_0xd1a2('0x4c')](this[_0xd1a2('0xb')],{'channel':_0x2dcd80[_0xd1a2('0x38')],'agentconnect':!![]});if(!_[_0xd1a2('0x2d')](_0x36f1f4)){if(!_[_0xd1a2('0x2d')](this[_0xd1a2('0xa')][_0x36f1f4[_0xd1a2('0x2c')]])){this[_0xd1a2('0xa')][_0x36f1f4[_0xd1a2('0x2c')]][_0xd1a2('0x4d')]=!![];this[_0xd1a2('0xa')][_0x36f1f4['interface']]['updateStatusRealtime']();}}}catch(_0x3267f2){logger[_0xd1a2('0x43')](_0x3267f2[_0xd1a2('0x4b')]);}};VoiceAgentReport[_0xd1a2('0x1c')][_0xd1a2('0x1b')]=function(_0x39b6b6){try{var _0x1ab787=_['find'](this[_0xd1a2('0xb')],{'channel':_0x39b6b6[_0xd1a2('0x38')],'agentconnect':!![]});if(!_[_0xd1a2('0x2d')](_0x1ab787)){if(!_[_0xd1a2('0x2d')](this['agents'][_0x1ab787['interface']])){this[_0xd1a2('0xa')][_0x1ab787[_0xd1a2('0x2c')]]['onhold']=![];this[_0xd1a2('0xa')][_0x1ab787[_0xd1a2('0x2c')]][_0xd1a2('0x4e')]();}}}catch(_0x21ead9){logger[_0xd1a2('0x43')](_0x21ead9['stack']);}};VoiceAgentReport[_0xd1a2('0x1c')]['syncAgentRingNoAnswer']=function(_0x26cdae){try{var _0x2d1007=this[_0xd1a2('0xb')][_0x26cdae[_0xd1a2('0x32')]];if(!_['isNil'](_0x2d1007)){_0x2d1007=_['assign'](_0x2d1007,{'ringtime':parseInt(_0x26cdae[_0xd1a2('0x45')],0xa)/0x3e8,'agentringnoanswer':!![],'reason':_0xd1a2('0x4f'),'lastevent':_0xd1a2('0x4f')});_0x2d1007[_0xd1a2('0x50')]=this['addTime'](_0x2d1007[_0xd1a2('0x48')],_0x2d1007[_0xd1a2('0x45')]);ami[_0xd1a2('0x30')]('custom:agentringnoanswer',_0x2d1007);this['log'](_0xd1a2('0x51'),_0x2d1007);}}catch(_0x4f0e55){logger['error'](_0x4f0e55['stack']);}};VoiceAgentReport[_0xd1a2('0x1c')][_0xd1a2('0x11')]=function(_0x42ab32){try{for(var _0x5ef26a in this[_0xd1a2('0xb')]){var _0x272044=this['channels'][_0x5ef26a];if(!_[_0xd1a2('0x2d')](_0x272044)&&_0x272044['channel']==_0x42ab32['channel']){_0x272044=_[_0xd1a2('0x2e')](_0x272044,{'holdtime':parseInt(_0x42ab32[_0xd1a2('0x52')],0xa),'position':parseInt(_0x42ab32['position'],0xa),'originalposition':parseInt(_0x42ab32['originalposition'],0xa),'agentringnoanswer':!![],'agentringnoanswerAt':moment()['format'](_0xd1a2('0x28')),'reason':_0xd1a2('0x53'),'lastevent':_0xd1a2('0x53')});ami[_0xd1a2('0x30')](_0xd1a2('0x54'),_0x272044);this[_0xd1a2('0x1d')](_0xd1a2('0x55'),_0x272044);}}}catch(_0x2f18a1){logger[_0xd1a2('0x43')](_0x2f18a1[_0xd1a2('0x4b')]);}};VoiceAgentReport[_0xd1a2('0x1c')]['syncAgentComplete']=function(_0x2ce862){try{var _0x33721d=this['channels'][_0x2ce862[_0xd1a2('0x32')]];if(!_[_0xd1a2('0x2d')](_0x33721d)){_0x33721d=_[_0xd1a2('0x2e')](_0x33721d,{'talktime':parseInt(_0x2ce862['talktime'],0xa),'reason':_0x2ce862[_0xd1a2('0x56')]==_0xd1a2('0x57')?_0xd1a2('0x58'):_0x2ce862[_0xd1a2('0x56')],'agentcomplete':!![],'lastevent':_0xd1a2('0x59'),'agentacw':this[_0xd1a2('0x9')][_0x33721d[_0xd1a2('0x22')]]&&this[_0xd1a2('0x9')][_0x33721d['queue']]['acw']?!![]:![],'acwtime':this[_0xd1a2('0x9')][_0x33721d[_0xd1a2('0x22')]]&&this[_0xd1a2('0x9')][_0x33721d[_0xd1a2('0x22')]][_0xd1a2('0x5a')]?this[_0xd1a2('0x9')][_0x33721d[_0xd1a2('0x22')]][_0xd1a2('0x5b')]:0x0});_0x33721d[_0xd1a2('0x5c')]=this[_0xd1a2('0x25')](_0x33721d[_0xd1a2('0x47')],_0x33721d[_0xd1a2('0x5d')]);this[_0xd1a2('0x1d')](_0xd1a2('0x5e'),_0x33721d);}}catch(_0x1bc134){logger[_0xd1a2('0x43')](_0x1bc134[_0xd1a2('0x4b')]);}};VoiceAgentReport['prototype'][_0xd1a2('0x5f')]=function(_0x23712b){try{switch(_0x23712b[_0xd1a2('0x60')]){case 0x1a:_0x23712b=_['assign'](_0x23712b,{'agentringnoanswer':!![],'reason':'answered_elsewhere','lastevent':_0xd1a2('0x61')});var _0x3b9361=_[_0xd1a2('0x4c')](this[_0xd1a2('0xb')],{'channel':_0x23712b[_0xd1a2('0x38')],'agentconnect':!![]});if(!_[_0xd1a2('0x2d')](_0x3b9361)){_0x23712b=_[_0xd1a2('0x2e')](_0x23712b,{'agentringnoanswerAt':_0x3b9361['agentconnectAt'],'answeredelsewheremembername':_0x3b9361[_0xd1a2('0x21')],'answeredelsewheredestinationuniqueid':_0x3b9361['destuniqueid']});}ami[_0xd1a2('0x30')](_0xd1a2('0x62'),_0x23712b);break;}if(_0x23712b['agentcomplete']){ami[_0xd1a2('0x30')](_0xd1a2('0x63'),_0x23712b);io['to'](util['format'](_0xd1a2('0x41'),_0x23712b[_0xd1a2('0x21')]))[_0xd1a2('0x30')](_0xd1a2('0x64'),_0x23712b);}this[_0xd1a2('0x1d')](_0xd1a2('0x65'),_0x23712b);ami['emit']('custom:voiceAgentReport',_0x23712b);if(this[_0xd1a2('0xb')][_0x23712b[_0xd1a2('0x32')]]){delete this['channels'][_0x23712b[_0xd1a2('0x32')]];}}catch(_0x568827){logger['error'](_0x568827);}};VoiceAgentReport[_0xd1a2('0x1c')]['syncHangup']=function(_0x4de823){try{var _0x2ae8a3=this[_0xd1a2('0xb')][_0x4de823[_0xd1a2('0x38')]];if(!_['isNil'](_0x2ae8a3)){_0x2ae8a3=_[_0xd1a2('0x2e')](_0x2ae8a3,{'cause':parseInt(_0x4de823[_0xd1a2('0x60')],0xa),'cause-txt':_0x4de823['cause-txt']});if(_0x2ae8a3[_0xd1a2('0x66')]){_0x2ae8a3=_[_0xd1a2('0x2e')](_0x2ae8a3,{'agentcomplete':!![],'agentcompleteAt':moment()['format'](_0xd1a2('0x28')),'lastevent':_0xd1a2('0x59'),'agentacw':this[_0xd1a2('0x9')][_0x2ae8a3['queue']]&&this[_0xd1a2('0x9')][_0x2ae8a3[_0xd1a2('0x22')]]['acw']?!![]:![],'acwtime':this['voiceQueues'][_0x2ae8a3[_0xd1a2('0x22')]]&&this[_0xd1a2('0x9')][_0x2ae8a3[_0xd1a2('0x22')]]['acw']?this['voiceQueues'][_0x2ae8a3['queue']]['acwTimeout']:0x0});_0x2ae8a3[_0xd1a2('0x5d')]=this[_0xd1a2('0x29')](_0x2ae8a3[_0xd1a2('0x5c')],_0x2ae8a3[_0xd1a2('0x47')]);}var _0x192f48=this[_0xd1a2('0xa')][_0x2ae8a3[_0xd1a2('0x2c')]];if(!_[_0xd1a2('0x2d')](_0x192f48)){_0x192f48=_[_0xd1a2('0x2e')](_0x192f48,{'queue':null,'destconnectedlinenum':null});io['emit']('user:save',_0x192f48);}setTimeout(this[_0xd1a2('0x5f')]['bind'](this,_0x2ae8a3),0x3e8);}if(this[_0xd1a2('0xc')][_0x4de823[_0xd1a2('0x38')]]){delete this[_0xd1a2('0xc')][_0x4de823['channel']];}}catch(_0x396618){logger[_0xd1a2('0x43')](_0x396618[_0xd1a2('0x4b')]);}};VoiceAgentReport[_0xd1a2('0x1c')][_0xd1a2('0x17')]=function(_0x360318){try{var _0x1317d5=this[_0xd1a2('0xb')][_0x360318[_0xd1a2('0x67')]];if(!_[_0xd1a2('0x2d')](_0x1317d5)){_0x1317d5=_['assign'](_0x1317d5,{'transfer':!![],'transferAt':moment()[_0xd1a2('0x1f')](_0xd1a2('0x28')),'transfertype':'ATTENDED','agentcomplete':!![],'agentcompleteAt':moment()[_0xd1a2('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'),'transferuniqueid':_0x360318[_0xd1a2('0x68')],'transfercontext':_0x360318[_0xd1a2('0x69')],'transferextension':_0x360318[_0xd1a2('0x6a')],'reason':_0xd1a2('0x57'),'lastevent':'complete','agentacw':this['voiceQueues'][_0x1317d5['queue']]&&this[_0xd1a2('0x9')][_0x1317d5[_0xd1a2('0x22')]]['acw']?!![]:![],'acwtime':this['voiceQueues'][_0x1317d5[_0xd1a2('0x22')]]&&this[_0xd1a2('0x9')][_0x1317d5[_0xd1a2('0x22')]][_0xd1a2('0x5a')]?this[_0xd1a2('0x9')][_0x1317d5[_0xd1a2('0x22')]][_0xd1a2('0x5b')]:0x0});_0x1317d5[_0xd1a2('0x5d')]=this[_0xd1a2('0x29')](_0x1317d5[_0xd1a2('0x5c')],_0x1317d5[_0xd1a2('0x47')]);this[_0xd1a2('0x1d')](_0xd1a2('0x6b'),_0x1317d5);}if(!_[_0xd1a2('0x2d')](this[_0xd1a2('0xb')][_0x360318['transfertargetchannel']])){this['channels'][_0x360318['transfertargetchannel']]['recalculate']=!![];}}catch(_0x2e7b5d){logger[_0xd1a2('0x43')](_0x2e7b5d[_0xd1a2('0x4b')]);}};VoiceAgentReport['prototype'][_0xd1a2('0x18')]=function(_0x50b928){try{var _0x2cf246=this[_0xd1a2('0xb')][_0x50b928[_0xd1a2('0x6c')]];if(!_['isNil'](_0x2cf246)){_0x2cf246=_[_0xd1a2('0x2e')](_0x2cf246,{'transfer':!![],'transferAt':moment()[_0xd1a2('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'),'transfertype':_0xd1a2('0x6d'),'transferuniqueid':_0x50b928[_0xd1a2('0x6e')],'transfercontext':_0x50b928[_0xd1a2('0x3b')],'transferextension':_0x50b928[_0xd1a2('0x6f')],'agentcomplete':!![],'agentcompleteAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xd1a2('0x57'),'lastevent':'complete','agentacw':this[_0xd1a2('0x9')][_0x2cf246[_0xd1a2('0x22')]]&&this['voiceQueues'][_0x2cf246[_0xd1a2('0x22')]][_0xd1a2('0x5a')]?!![]:![],'acwtime':this[_0xd1a2('0x9')][_0x2cf246[_0xd1a2('0x22')]]&&this[_0xd1a2('0x9')][_0x2cf246['queue']]['acw']?this[_0xd1a2('0x9')][_0x2cf246['queue']][_0xd1a2('0x5b')]:0x0});_0x2cf246[_0xd1a2('0x66')]=!![];this[_0xd1a2('0x1d')]('BLIND',_0x2cf246);}}catch(_0x34a2ad){logger[_0xd1a2('0x43')](_0x34a2ad['stack']);}};VoiceAgentReport[_0xd1a2('0x1c')]['syncVarSet']=function(_0x3625d9){var _0x1fe289=[_0xd1a2('0x70'),_0xd1a2('0x71'),_0xd1a2('0x72'),'rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged',_0xd1a2('0x73'),_0xd1a2('0x74'),_0xd1a2('0x75'),_0xd1a2('0x76'),_0xd1a2('0x77'),'bridgepvtcallid',_0xd1a2('0x78'),_0xd1a2('0x79'),_0xd1a2('0x7a'),'memberlastcall',_0xd1a2('0x21'),'memberpenalty','memberrealtime'];try{var _0x54dfda=_[_0xd1a2('0x7b')](_0x3625d9[_0xd1a2('0x7c')])[0x0];if(!_[_0xd1a2('0x2d')](_0x54dfda)&&!_[_0xd1a2('0x7d')](_0x1fe289,_0x54dfda)){if(!this[_0xd1a2('0xc')][_0x3625d9[_0xd1a2('0x38')]]){this[_0xd1a2('0xc')][_0x3625d9[_0xd1a2('0x38')]]={};}this[_0xd1a2('0xc')][_0x3625d9[_0xd1a2('0x38')]][_0x54dfda]=_0x3625d9[_0xd1a2('0x7e')];}}catch(_0x576ff7){logger[_0xd1a2('0x43')](_0x576ff7[_0xd1a2('0x4b')]);}};module[_0xd1a2('0x7f')]=VoiceAgentReport; \ No newline at end of file +var _0x531a=['connect','agentconnectAt','agentcalledAt','custom:agentconnect','user:agentconnect','CONNECT','onhold','updateStatusRealtime','find','rejected','agentringnoanswerAt','custom:agentringnoanswer','RINGNOANSWER','syncQueueCallerAbandon','holdtime','position','abandoned','CALLERABANDON','reason','transfer','complete','acw','acwTimeout','agentcompleteAt','talktime','COMPLETE','answered_elsewhere','destuniqueid','custom:agentansweredelsewhere','agentcomplete','custom:agentcomplete','HANGUP','syncHangup','cause','cause-txt','recalculate','clear','origtransfererchannel','ATTENDED','secondtransfererexten','secondtransferercontext','transfertargetchannel','transfererchannel','BLIND','transfereeuniqueid','context','extension','syncVarSet','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberrealtime','keys','variable','variables','lodash','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','voiceQueues','agents','channels','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncAgentComplete','varset','hangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','syncMusicOnHoldStop','prototype','log','info','format','%s|%s','uniqueid','membername','calleridnum','addTime','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','seconds','interface','isNil','assign','queue','emit','user:save','destchannel','calleridname','destcalleridnum','accountcode','channel','exten','priority','type','inbound','mandatoryDisposition','agent','custom:agentcalled','user:%s','CALLED','error','stack','ringtime'];(function(_0x363682,_0x216471){var _0x1abbcc=function(_0x576bf2){while(--_0x576bf2){_0x363682['push'](_0x363682['shift']());}};_0x1abbcc(++_0x216471);}(_0x531a,0x147));var _0xa531=function(_0x5adfa9,_0x4b835d){_0x5adfa9=_0x5adfa9-0x0;var _0x458f41=_0x531a[_0x5adfa9];return _0x458f41;};'use strict';var _=require(_0xa531('0x0'));var moment=require(_0xa531('0x1'));var util=require('util');var Redis=require(_0xa531('0x2'));var config=require(_0xa531('0x3'));var logger=require(_0xa531('0x4'))('ami');var ami=require(_0xa531('0x5'));config[_0xa531('0x6')]=_[_0xa531('0x7')](config['redis'],{'host':_0xa531('0x8'),'port':0x18eb});var io=require(_0xa531('0x9'))(new Redis(config[_0xa531('0x6')]));function VoiceAgentReport(_0x52b44e){this[_0xa531('0xa')]=_0x52b44e[_0xa531('0xa')];this[_0xa531('0xb')]=_0x52b44e['agents'];this[_0xa531('0xc')]={};this['variables']={};ami['on'](_0xa531('0xd'),this[_0xa531('0xe')][_0xa531('0xf')](this));ami['on'](_0xa531('0x10'),this[_0xa531('0x11')][_0xa531('0xf')](this));ami['on'](_0xa531('0x12'),this[_0xa531('0x13')][_0xa531('0xf')](this));ami['on'](_0xa531('0x14'),this['syncQueueCallerAbandon'][_0xa531('0xf')](this));ami['on']('agentcomplete',this[_0xa531('0x15')][_0xa531('0xf')](this));ami['on'](_0xa531('0x16'),this['syncVarSet']['bind'](this));ami['on'](_0xa531('0x17'),this['syncHangup'][_0xa531('0xf')](this));ami['on'](_0xa531('0x18'),this[_0xa531('0x19')]['bind'](this));ami['on'](_0xa531('0x1a'),this[_0xa531('0x1b')][_0xa531('0xf')](this));ami['on']('musiconholdstart',this[_0xa531('0x1c')][_0xa531('0xf')](this));ami['on']('musiconholdstop',this[_0xa531('0x1d')][_0xa531('0xf')](this));}VoiceAgentReport[_0xa531('0x1e')][_0xa531('0x1f')]=function(_0x5a0f86,_0x3720f6){logger[_0xa531('0x20')](util[_0xa531('0x21')](_0xa531('0x22'),_0x5a0f86,[_0x3720f6[_0xa531('0x23')],_0x3720f6[_0xa531('0x24')],_0x3720f6['queue'],_0x3720f6['exten'],_0x3720f6[_0xa531('0x25')]]['join']('|')));};VoiceAgentReport['prototype'][_0xa531('0x26')]=function(_0x54ebf4,_0x41ed00){return moment(_0x54ebf4)['add'](_0x41ed00,'seconds')[_0xa531('0x21')](_0xa531('0x27'));};VoiceAgentReport['prototype'][_0xa531('0x28')]=function(_0x1e1a6a,_0x29cd25){return moment(_0x1e1a6a)[_0xa531('0x29')](moment(_0x29cd25),_0xa531('0x2a'));};VoiceAgentReport[_0xa531('0x1e')][_0xa531('0xe')]=function(_0x42da62){try{var _0x5a894b=this[_0xa531('0xb')][_0x42da62[_0xa531('0x2b')]];if(!_[_0xa531('0x2c')](_0x5a894b)){_0x5a894b=_[_0xa531('0x2d')](_0x5a894b,{'queue':_0x42da62[_0xa531('0x2e')],'destconnectedlinenum':_0x42da62[_0xa531('0x25')]});io[_0xa531('0x2f')](_0xa531('0x30'),_0x5a894b);}var _0x3ffd7a=this[_0xa531('0xc')][_0x42da62[_0xa531('0x31')]]={'agentcalledAt':moment()['format'](_0xa531('0x27')),'calleridnum':_0x42da62[_0xa531('0x25')],'calleridname':_0x42da62[_0xa531('0x32')],'connectedlinenum':_0x42da62[_0xa531('0x33')],'connectedlinename':_0x42da62['destcalleridname'],'accountcode':_0x42da62[_0xa531('0x34')],'destaccountcode':_0x42da62['destaccountcode'],'channel':_0x42da62[_0xa531('0x35')],'destchannel':_0x42da62[_0xa531('0x31')],'uniqueid':_0x42da62[_0xa531('0x23')],'destuniqueid':_0x42da62['destuniqueid'],'context':_0x42da62['context'],'exten':_0x42da62[_0xa531('0x36')],'priority':_0x42da62[_0xa531('0x37')],'queue':_0x42da62[_0xa531('0x2e')],'type':this[_0xa531('0xa')][_0x42da62['queue']]?this[_0xa531('0xa')][_0x42da62[_0xa531('0x2e')]][_0xa531('0x38')]||_0xa531('0x39'):_0xa531('0x39'),'interface':_0x42da62[_0xa531('0x2b')],'mandatoryDisposition':this[_0xa531('0xa')][_0x42da62[_0xa531('0x2e')]][_0xa531('0x3a')]||0x0,'membername':_0x42da62[_0xa531('0x24')],'agentconnect':![],'agentconnectAt':null,'holdtime':0x0,'ringtime':0x0,'agentcomplete':![],'agentcompleteAt':null,'talktime':0x0,'agentringnoanswer':![],'agentringnoanswerAt':null,'reason':_0xa531('0x3b'),'transfer':![],'transferAt':null,'transfertype':null,'transferuniqueid':null,'transfercontext':null,'transferextension':null,'position':null,'originalposition':null,'cause':'','cause-txt':'','UserId':this['agents'][_0x42da62['interface']]?this[_0xa531('0xb')][_0x42da62['interface']]['id']:null,'lastevent':'called','agentacw':![],'acwtime':0x0,'variables':this['variables'][_0x42da62[_0xa531('0x35')]]?this['variables'][_0x42da62[_0xa531('0x35')]]:{}};ami[_0xa531('0x2f')](_0xa531('0x3c'),_0x3ffd7a);io['to'](util[_0xa531('0x21')](_0xa531('0x3d'),_0x3ffd7a['membername']))[_0xa531('0x2f')]('user:called',_0x3ffd7a);this[_0xa531('0x1f')](_0xa531('0x3e'),this[_0xa531('0xc')][_0x42da62[_0xa531('0x31')]]);}catch(_0x4f952e){logger[_0xa531('0x3f')](_0x4f952e[_0xa531('0x40')]);}};VoiceAgentReport[_0xa531('0x1e')][_0xa531('0x11')]=function(_0x5c5b58){try{var _0x123d4d=this[_0xa531('0xc')][_0x5c5b58[_0xa531('0x31')]];if(!_[_0xa531('0x2c')](_0x123d4d)){_0x123d4d=_['assign'](_0x123d4d,{'holdtime':parseInt(_0x5c5b58['holdtime'],0xa),'ringtime':parseInt(_0x5c5b58[_0xa531('0x41')],0xa),'agentconnect':!![],'lastevent':_0xa531('0x42')});_0x123d4d[_0xa531('0x43')]=this['addTime'](_0x123d4d[_0xa531('0x44')],_0x123d4d[_0xa531('0x41')]);ami['emit'](_0xa531('0x45'),_0x123d4d);io['to'](util[_0xa531('0x21')](_0xa531('0x3d'),_0x123d4d[_0xa531('0x24')]))['emit'](_0xa531('0x46'),_0x123d4d);this[_0xa531('0x1f')](_0xa531('0x47'),_0x123d4d);}}catch(_0x20fe14){logger[_0xa531('0x3f')](_0x20fe14[_0xa531('0x40')]);}};VoiceAgentReport[_0xa531('0x1e')][_0xa531('0x1c')]=function(_0x4d5c8c){try{var _0x4c829f=_['find'](this[_0xa531('0xc')],{'channel':_0x4d5c8c[_0xa531('0x35')],'agentconnect':!![]});if(!_['isNil'](_0x4c829f)){if(!_[_0xa531('0x2c')](this[_0xa531('0xb')][_0x4c829f[_0xa531('0x2b')]])){this[_0xa531('0xb')][_0x4c829f[_0xa531('0x2b')]][_0xa531('0x48')]=!![];this['agents'][_0x4c829f['interface']][_0xa531('0x49')]();}}}catch(_0x3692d3){logger['error'](_0x3692d3[_0xa531('0x40')]);}};VoiceAgentReport[_0xa531('0x1e')][_0xa531('0x1d')]=function(_0x52ed5c){try{var _0x1de754=_[_0xa531('0x4a')](this[_0xa531('0xc')],{'channel':_0x52ed5c['channel'],'agentconnect':!![]});if(!_['isNil'](_0x1de754)){if(!_[_0xa531('0x2c')](this[_0xa531('0xb')][_0x1de754[_0xa531('0x2b')]])){this[_0xa531('0xb')][_0x1de754[_0xa531('0x2b')]]['onhold']=![];this[_0xa531('0xb')][_0x1de754[_0xa531('0x2b')]][_0xa531('0x49')]();}}}catch(_0x42e5a1){logger[_0xa531('0x3f')](_0x42e5a1[_0xa531('0x40')]);}};VoiceAgentReport[_0xa531('0x1e')]['syncAgentRingNoAnswer']=function(_0x4f3539){try{var _0x5ac55b=this[_0xa531('0xc')][_0x4f3539['destchannel']];if(!_[_0xa531('0x2c')](_0x5ac55b)){_0x5ac55b=_['assign'](_0x5ac55b,{'ringtime':parseInt(_0x4f3539[_0xa531('0x41')],0xa)/0x3e8,'agentringnoanswer':!![],'reason':'rejected','lastevent':_0xa531('0x4b')});_0x5ac55b[_0xa531('0x4c')]=this[_0xa531('0x26')](_0x5ac55b[_0xa531('0x44')],_0x5ac55b[_0xa531('0x41')]);ami[_0xa531('0x2f')](_0xa531('0x4d'),_0x5ac55b);this[_0xa531('0x1f')](_0xa531('0x4e'),_0x5ac55b);}}catch(_0x445228){logger['error'](_0x445228[_0xa531('0x40')]);}};VoiceAgentReport[_0xa531('0x1e')][_0xa531('0x4f')]=function(_0x123ba7){try{for(var _0x58579e in this[_0xa531('0xc')]){var _0x2f296c=this[_0xa531('0xc')][_0x58579e];if(!_[_0xa531('0x2c')](_0x2f296c)&&_0x2f296c[_0xa531('0x35')]==_0x123ba7[_0xa531('0x35')]){_0x2f296c=_['assign'](_0x2f296c,{'holdtime':parseInt(_0x123ba7[_0xa531('0x50')],0xa),'position':parseInt(_0x123ba7[_0xa531('0x51')],0xa),'originalposition':parseInt(_0x123ba7['originalposition'],0xa),'agentringnoanswer':!![],'agentringnoanswerAt':moment()[_0xa531('0x21')](_0xa531('0x27')),'reason':_0xa531('0x52'),'lastevent':_0xa531('0x52')});ami[_0xa531('0x2f')]('custom:agentqueuecallerabandon',_0x2f296c);this[_0xa531('0x1f')](_0xa531('0x53'),_0x2f296c);}}}catch(_0xdb2d9a){logger[_0xa531('0x3f')](_0xdb2d9a[_0xa531('0x40')]);}};VoiceAgentReport[_0xa531('0x1e')]['syncAgentComplete']=function(_0x5ea36a){try{var _0x4fbd33=this[_0xa531('0xc')][_0x5ea36a['destchannel']];if(!_[_0xa531('0x2c')](_0x4fbd33)){_0x4fbd33=_[_0xa531('0x2d')](_0x4fbd33,{'talktime':parseInt(_0x5ea36a['talktime'],0xa),'reason':_0x5ea36a[_0xa531('0x54')]==_0xa531('0x55')?_0xa531('0x3b'):_0x5ea36a[_0xa531('0x54')],'agentcomplete':!![],'lastevent':_0xa531('0x56'),'agentacw':this[_0xa531('0xa')][_0x4fbd33[_0xa531('0x2e')]]&&this[_0xa531('0xa')][_0x4fbd33[_0xa531('0x2e')]][_0xa531('0x57')]?!![]:![],'acwtime':this[_0xa531('0xa')][_0x4fbd33['queue']]&&this[_0xa531('0xa')][_0x4fbd33[_0xa531('0x2e')]][_0xa531('0x57')]?this[_0xa531('0xa')][_0x4fbd33[_0xa531('0x2e')]][_0xa531('0x58')]:0x0});_0x4fbd33[_0xa531('0x59')]=this[_0xa531('0x26')](_0x4fbd33['agentconnectAt'],_0x4fbd33[_0xa531('0x5a')]);this['log'](_0xa531('0x5b'),_0x4fbd33);}}catch(_0x4b68af){logger[_0xa531('0x3f')](_0x4b68af[_0xa531('0x40')]);}};VoiceAgentReport[_0xa531('0x1e')]['clear']=function(_0x32ebc5){try{switch(_0x32ebc5['cause']){case 0x1a:_0x32ebc5=_[_0xa531('0x2d')](_0x32ebc5,{'agentringnoanswer':!![],'reason':_0xa531('0x5c'),'lastevent':_0xa531('0x5c')});var _0x288399=_['find'](this['channels'],{'channel':_0x32ebc5['channel'],'agentconnect':!![]});if(!_[_0xa531('0x2c')](_0x288399)){_0x32ebc5=_[_0xa531('0x2d')](_0x32ebc5,{'agentringnoanswerAt':_0x288399[_0xa531('0x43')],'answeredelsewheremembername':_0x288399[_0xa531('0x24')],'answeredelsewheredestinationuniqueid':_0x288399[_0xa531('0x5d')]});}ami['emit'](_0xa531('0x5e'),_0x32ebc5);break;}if(_0x32ebc5[_0xa531('0x5f')]){ami[_0xa531('0x2f')](_0xa531('0x60'),_0x32ebc5);io['to'](util[_0xa531('0x21')](_0xa531('0x3d'),_0x32ebc5[_0xa531('0x24')]))[_0xa531('0x2f')]('user:agentcomplete',_0x32ebc5);}this['log'](_0xa531('0x61'),_0x32ebc5);ami['emit']('custom:voiceAgentReport',_0x32ebc5);if(this[_0xa531('0xc')][_0x32ebc5['destchannel']]){delete this[_0xa531('0xc')][_0x32ebc5['destchannel']];}}catch(_0xacb06d){logger['error'](_0xacb06d);}};VoiceAgentReport[_0xa531('0x1e')][_0xa531('0x62')]=function(_0x7a2845){try{var _0x2ad8c3=this['channels'][_0x7a2845['channel']];if(!_['isNil'](_0x2ad8c3)){_0x2ad8c3=_[_0xa531('0x2d')](_0x2ad8c3,{'cause':parseInt(_0x7a2845[_0xa531('0x63')],0xa),'cause-txt':_0x7a2845[_0xa531('0x64')]});if(_0x2ad8c3[_0xa531('0x65')]){_0x2ad8c3=_['assign'](_0x2ad8c3,{'agentcomplete':!![],'agentcompleteAt':moment()[_0xa531('0x21')](_0xa531('0x27')),'lastevent':_0xa531('0x56'),'agentacw':this[_0xa531('0xa')][_0x2ad8c3[_0xa531('0x2e')]]&&this[_0xa531('0xa')][_0x2ad8c3['queue']][_0xa531('0x57')]?!![]:![],'acwtime':this[_0xa531('0xa')][_0x2ad8c3[_0xa531('0x2e')]]&&this[_0xa531('0xa')][_0x2ad8c3['queue']][_0xa531('0x57')]?this['voiceQueues'][_0x2ad8c3[_0xa531('0x2e')]][_0xa531('0x58')]:0x0});_0x2ad8c3['talktime']=this[_0xa531('0x28')](_0x2ad8c3[_0xa531('0x59')],_0x2ad8c3[_0xa531('0x43')]);}var _0x302de2=this['agents'][_0x2ad8c3[_0xa531('0x2b')]];if(!_[_0xa531('0x2c')](_0x302de2)){_0x302de2=_[_0xa531('0x2d')](_0x302de2,{'queue':null,'destconnectedlinenum':null});io[_0xa531('0x2f')](_0xa531('0x30'),_0x302de2);}setTimeout(this[_0xa531('0x66')][_0xa531('0xf')](this,_0x2ad8c3),0x3e8);}if(this['variables'][_0x7a2845['channel']]){delete this['variables'][_0x7a2845[_0xa531('0x35')]];}}catch(_0x35aec1){logger[_0xa531('0x3f')](_0x35aec1[_0xa531('0x40')]);}};VoiceAgentReport[_0xa531('0x1e')][_0xa531('0x19')]=function(_0xfdaa79){try{var _0x4a3f5d=this[_0xa531('0xc')][_0xfdaa79[_0xa531('0x67')]];if(!_[_0xa531('0x2c')](_0x4a3f5d)){_0x4a3f5d=_[_0xa531('0x2d')](_0x4a3f5d,{'transfer':!![],'transferAt':moment()[_0xa531('0x21')](_0xa531('0x27')),'transfertype':_0xa531('0x68'),'agentcomplete':!![],'agentcompleteAt':moment()['format'](_0xa531('0x27')),'transferuniqueid':_0xfdaa79['secondtransfereruniqueid'],'transfercontext':_0xfdaa79[_0xa531('0x69')],'transferextension':_0xfdaa79[_0xa531('0x6a')],'reason':_0xa531('0x55'),'lastevent':_0xa531('0x56'),'agentacw':this[_0xa531('0xa')][_0x4a3f5d[_0xa531('0x2e')]]&&this[_0xa531('0xa')][_0x4a3f5d[_0xa531('0x2e')]]['acw']?!![]:![],'acwtime':this[_0xa531('0xa')][_0x4a3f5d[_0xa531('0x2e')]]&&this[_0xa531('0xa')][_0x4a3f5d[_0xa531('0x2e')]]['acw']?this[_0xa531('0xa')][_0x4a3f5d[_0xa531('0x2e')]][_0xa531('0x58')]:0x0});_0x4a3f5d[_0xa531('0x5a')]=this[_0xa531('0x28')](_0x4a3f5d[_0xa531('0x59')],_0x4a3f5d[_0xa531('0x43')]);this[_0xa531('0x1f')](_0xa531('0x68'),_0x4a3f5d);}if(!_[_0xa531('0x2c')](this[_0xa531('0xc')][_0xfdaa79[_0xa531('0x6b')]])){this[_0xa531('0xc')][_0xfdaa79['transfertargetchannel']]['recalculate']=!![];}}catch(_0x426d5e){logger['error'](_0x426d5e[_0xa531('0x40')]);}};VoiceAgentReport['prototype'][_0xa531('0x1b')]=function(_0x74911d){try{var _0x1a0b85=this[_0xa531('0xc')][_0x74911d[_0xa531('0x6c')]];if(!_['isNil'](_0x1a0b85)){_0x1a0b85=_[_0xa531('0x2d')](_0x1a0b85,{'transfer':!![],'transferAt':moment()[_0xa531('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'transfertype':_0xa531('0x6d'),'transferuniqueid':_0x74911d[_0xa531('0x6e')],'transfercontext':_0x74911d[_0xa531('0x6f')],'transferextension':_0x74911d[_0xa531('0x70')],'agentcomplete':!![],'agentcompleteAt':moment()[_0xa531('0x21')](_0xa531('0x27')),'reason':_0xa531('0x55'),'lastevent':_0xa531('0x56'),'agentacw':this[_0xa531('0xa')][_0x1a0b85[_0xa531('0x2e')]]&&this[_0xa531('0xa')][_0x1a0b85[_0xa531('0x2e')]][_0xa531('0x57')]?!![]:![],'acwtime':this[_0xa531('0xa')][_0x1a0b85['queue']]&&this[_0xa531('0xa')][_0x1a0b85[_0xa531('0x2e')]]['acw']?this[_0xa531('0xa')][_0x1a0b85[_0xa531('0x2e')]]['acwTimeout']:0x0});_0x1a0b85[_0xa531('0x65')]=!![];this[_0xa531('0x1f')]('BLIND',_0x1a0b85);}}catch(_0x649804){logger[_0xa531('0x3f')](_0x649804[_0xa531('0x40')]);}};VoiceAgentReport[_0xa531('0x1e')][_0xa531('0x71')]=function(_0x5f1208){var _0x55c488=[_0xa531('0x72'),_0xa531('0x73'),_0xa531('0x74'),_0xa531('0x75'),_0xa531('0x76'),'rtpaudioqoslossbridged',_0xa531('0x77'),_0xa531('0x78'),_0xa531('0x79'),_0xa531('0x7a'),_0xa531('0x7b'),'bridgepvtcallid',_0xa531('0x7c'),_0xa531('0x7d'),_0xa531('0x7e'),'memberlastcall',_0xa531('0x24'),'memberpenalty',_0xa531('0x7f')];try{var _0x58f481=_[_0xa531('0x80')](_0x5f1208[_0xa531('0x81')])[0x0];if(!_[_0xa531('0x2c')](_0x58f481)&&!_['includes'](_0x55c488,_0x58f481)){if(!this[_0xa531('0x82')][_0x5f1208[_0xa531('0x35')]]){this[_0xa531('0x82')][_0x5f1208['channel']]={};}this[_0xa531('0x82')][_0x5f1208[_0xa531('0x35')]][_0x58f481]=_0x5f1208['value'];}}catch(_0xd9c782){logger['error'](_0xd9c782[_0xa531('0x40')]);}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 932903b..a644569 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 _0x0fd0=['mohstarttime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','lodash','moment','path','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','invalid','unavailable','ringing','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','defaults','redis','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncNewState','syncVarSet','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','emit','uniqueid','linkedid','isUndefined','merge','keys','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','context','from-sip','destconnectedlinenum','user:%s','split','name','accountcode','exten','error','[syncNewChannel][VoiceCallReport]','application','toLowerCase','applicationdata','subtract','duration','seconds','pick','includes','lastapplication','lastdata','match','queue','[syncNewExten][VoiceCallReport]','inspect','answered','answertime','holdtime','diff','calleridnum','connectedlinenum','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','isNil','monitors','rec','variable','mixmonitor_filename','value','xmd-phone','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','BlindTransfer','transfererchannel'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0fd0,0x96));var _0x00fd=function(_0x1ca6fa,_0x4dcf0b){_0x1ca6fa=_0x1ca6fa-0x0;var _0x524098=_0x0fd0[_0x1ca6fa];return _0x524098;};'use strict';var BPromise=require('bluebird');var _=require(_0x00fd('0x0'));var moment=require(_0x00fd('0x1'));var util=require('util');var path=require(_0x00fd('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x00fd('0x3'))(_0x00fd('0x4'));var ami=require(_0x00fd('0x5'));var Channel=require(_0x00fd('0x6'));var statusDesc=[_0x00fd('0x7'),_0x00fd('0x8'),'inuse','busy',_0x00fd('0x9'),_0x00fd('0xa'),_0x00fd('0xb'),'ringinuse','onhold'];var applications=[_0x00fd('0xc'),'queue',_0x00fd('0xd'),_0x00fd('0xe'),_0x00fd('0xf'),_0x00fd('0x10')];var dispositions=[_0x00fd('0x11'),_0x00fd('0x12'),_0x00fd('0x12'),_0x00fd('0x11'),_0x00fd('0x11'),_0x00fd('0x11'),'ANSWERED','BUSY',_0x00fd('0x12'),'FAILED',_0x00fd('0x12')];var actions={};config['redis']=_[_0x00fd('0x13')](config[_0x00fd('0x14')],{'host':'localhost','port':0x18eb});var io=require(_0x00fd('0x15'))(new Redis(config[_0x00fd('0x14')]));function VoiceCallReport(_0x1834d7){this[_0x00fd('0x16')]=_0x1834d7[_0x00fd('0x16')];this[_0x00fd('0x17')]=_0x1834d7[_0x00fd('0x17')];ami['on'](_0x00fd('0x18'),this[_0x00fd('0x19')][_0x00fd('0x1a')](this));ami['on'](_0x00fd('0x1b'),this['syncNewExten']['bind'](this));ami['on'](_0x00fd('0x1c'),this[_0x00fd('0x1d')][_0x00fd('0x1a')](this));ami['on']('newstate',this[_0x00fd('0x1e')][_0x00fd('0x1a')](this));ami['on']('varset',this[_0x00fd('0x1f')][_0x00fd('0x1a')](this));ami['on']('hangup',this[_0x00fd('0x20')][_0x00fd('0x1a')](this));ami['on'](_0x00fd('0x21'),this[_0x00fd('0x22')]['bind'](this));ami['on'](_0x00fd('0x23'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0x00fd('0x24')][_0x00fd('0x1a')](this));ami['on'](_0x00fd('0x25'),this[_0x00fd('0x26')][_0x00fd('0x1a')](this));ami['on'](_0x00fd('0x27'),this[_0x00fd('0x28')][_0x00fd('0x1a')](this));return BPromise[_0x00fd('0x29')]()[_0x00fd('0x2a')](ami[_0x00fd('0x2b')]())[_0x00fd('0x2c')](function(_0x21f8e5){console[_0x00fd('0x2d')](_0x21f8e5);});}VoiceCallReport[_0x00fd('0x2e')][_0x00fd('0x2f')]=function(_0xf075e7){return _0xf075e7!==null&&!_['isUndefined'](_0xf075e7);};VoiceCallReport[_0x00fd('0x2e')][_0x00fd('0x30')]=function(_0x1984a1,_0xb713fb,_0x1c9545){io['to'](_0x1984a1)['emit'](_0xb713fb,_0x1c9545);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x1e8bca){try{if(this[_0x00fd('0x2f')](_0x1e8bca)){if(_0x1e8bca[_0x00fd('0x31')]===_0x1e8bca[_0x00fd('0x32')]){if(!_[_0x00fd('0x33')](this['channels'][_0x1e8bca['uniqueid']])){_[_0x00fd('0x34')](this['channels'][_0x1e8bca['uniqueid']],_['pick'](_0x1e8bca,_[_0x00fd('0x35')](this[_0x00fd('0x16')][_0x1e8bca[_0x00fd('0x31')]])));}}}}catch(_0x4fc33e){logger['error']('[syncNewCallerId][VoiceCallReport]',util['inspect'](_0x4fc33e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x00fd('0x2e')][_0x00fd('0x1d')]=function(_0x3c7303){try{if(this[_0x00fd('0x2f')](_0x3c7303)){if(_0x3c7303[_0x00fd('0x31')]===_0x3c7303['linkedid']&&_0x3c7303[_0x00fd('0x36')]!=_0x00fd('0x37')){if(_[_0x00fd('0x33')](this[_0x00fd('0x16')][_0x3c7303[_0x00fd('0x31')]])){this[_0x00fd('0x16')][_0x3c7303['uniqueid']]=new Channel();this[_0x00fd('0x16')][_0x3c7303[_0x00fd('0x31')]][_0x00fd('0x38')]=moment()[_0x00fd('0x39')](_0x00fd('0x3a'));this[_0x00fd('0x16')][_0x3c7303[_0x00fd('0x31')]][_0x00fd('0x3b')]=dispositions[_[_0x00fd('0x3c')](_0x3c7303[_0x00fd('0x3d')])];_[_0x00fd('0x34')](this[_0x00fd('0x16')][_0x3c7303['uniqueid']],_['pick'](_0x3c7303,_['keys'](this['channels'][_0x3c7303[_0x00fd('0x31')]])));if(_0x3c7303[_0x00fd('0x3e')]===_0x00fd('0x3f')){if(this[_0x00fd('0x17')][_0x3c7303[_0x00fd('0x36')]['split']('-')[0x0]]){this[_0x00fd('0x17')][_0x3c7303[_0x00fd('0x36')]['split']('-')[0x0]][_0x00fd('0x40')]=_0x3c7303['exten'];this['emit'](util['format'](_0x00fd('0x41'),this['agents'][_0x3c7303[_0x00fd('0x36')][_0x00fd('0x42')]('-')[0x0]][_0x00fd('0x43')]),'user:agentconnect',{'destaccountcode':this[_0x00fd('0x17')][_0x3c7303[_0x00fd('0x36')]['split']('-')[0x0]][_0x00fd('0x44')],'destconnectedlinenum':_0x3c7303[_0x00fd('0x45')]});}}}}}}catch(_0x2004c4){logger[_0x00fd('0x46')](_0x00fd('0x47'),util['inspect'](_0x2004c4,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x00fd('0x19')]=function(_0x3d113b){try{if(this[_0x00fd('0x2f')](_0x3d113b)){if(_0x3d113b['uniqueid']===_0x3d113b[_0x00fd('0x32')]&&_0x3d113b[_0x00fd('0x45')]!='h'&&_0x3d113b[_0x00fd('0x36')]!=_0x00fd('0x37')){_0x3d113b[_0x00fd('0x48')]=_0x3d113b[_0x00fd('0x48')][_0x00fd('0x49')]();_0x3d113b[_0x00fd('0x4a')]=(_0x3d113b['appdata']||_0x3d113b['applicationdata'])['toLowerCase']();if(_['isUndefined'](this[_0x00fd('0x16')][_0x3d113b['uniqueid']])){this[_0x00fd('0x16')][_0x3d113b[_0x00fd('0x31')]]=new Channel();this[_0x00fd('0x16')][_0x3d113b[_0x00fd('0x31')]][_0x00fd('0x38')]=_0x3d113b['duration']?moment()[_0x00fd('0x4b')](moment[_0x00fd('0x4c')](_0x3d113b[_0x00fd('0x4c')])['seconds'](),_0x00fd('0x4d'))['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x00fd('0x39')](_0x00fd('0x3a'));this[_0x00fd('0x16')][_0x3d113b[_0x00fd('0x31')]][_0x00fd('0x3b')]=_0x00fd('0x11');}_[_0x00fd('0x34')](this[_0x00fd('0x16')][_0x3d113b[_0x00fd('0x31')]],_[_0x00fd('0x4e')](_0x3d113b,_[_0x00fd('0x35')](this['channels'][_0x3d113b['uniqueid']])));if(_[_0x00fd('0x4f')](applications,_0x3d113b[_0x00fd('0x48')])){this['channels'][_0x3d113b['uniqueid']][_0x00fd('0x50')]=_0x3d113b[_0x00fd('0x48')];this[_0x00fd('0x16')][_0x3d113b[_0x00fd('0x31')]][_0x00fd('0x51')]=_0x3d113b[_0x00fd('0x4a')];if(_0x3d113b[_0x00fd('0x48')]==='set'&&_['startsWith'](_0x3d113b[_0x00fd('0x4a')],'cdr(')){var _0x3ca1ba=_0x3d113b[_0x00fd('0x4a')][_0x00fd('0x42')]('=');var _0x310a07=_0x3ca1ba[0x0][_0x00fd('0x52')](/cdr\((.*)\)/);if(_0x310a07){this['channels'][_0x3d113b['uniqueid']][_0x310a07[0x1]]=_0x3ca1ba[0x1];}}else if(_0x3d113b[_0x00fd('0x48')]===_0x00fd('0x53')){this[_0x00fd('0x16')][_0x3d113b['uniqueid']][_0x00fd('0x53')]=_0x3d113b[_0x00fd('0x4a')][_0x00fd('0x42')](',')[0x0];}}}}}catch(_0x115a87){logger['error'](_0x00fd('0x54'),util[_0x00fd('0x55')](_0x115a87,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x00fd('0x2e')]['syncNewState']=function(_0x18abb9){try{if(this[_0x00fd('0x2f')](_0x18abb9)){if(_0x18abb9[_0x00fd('0x31')]!==_0x18abb9[_0x00fd('0x32')]){if(this[_0x00fd('0x16')][_0x18abb9[_0x00fd('0x32')]]){if(_0x18abb9[_0x00fd('0x3d')]==='6'){if(!this[_0x00fd('0x16')][_0x18abb9['linkedid']][_0x00fd('0x56')]){var _0x2a55b4=moment();this[_0x00fd('0x16')][_0x18abb9['linkedid']][_0x00fd('0x56')]=!![];this[_0x00fd('0x16')][_0x18abb9[_0x00fd('0x32')]][_0x00fd('0x57')]=_0x2a55b4[_0x00fd('0x39')](_0x00fd('0x3a'));if(this[_0x00fd('0x16')][_0x18abb9['linkedid']][_0x00fd('0x38')]){this['channels'][_0x18abb9['linkedid']][_0x00fd('0x58')]=_0x2a55b4[_0x00fd('0x59')](this[_0x00fd('0x16')][_0x18abb9['linkedid']][_0x00fd('0x38')],_0x00fd('0x4d'));}}this[_0x00fd('0x16')][_0x18abb9[_0x00fd('0x32')]][_0x00fd('0x32')]=_0x18abb9['uniqueid'];if(_0x18abb9[_0x00fd('0x5a')]!=='xcally-motion-preview'){this['channels'][_0x18abb9[_0x00fd('0x32')]][_0x00fd('0x5b')]=_0x18abb9[_0x00fd('0x5a')];}this[_0x00fd('0x16')][_0x18abb9['linkedid']]['connectedlinename']=_0x18abb9[_0x00fd('0x5c')];this[_0x00fd('0x16')][_0x18abb9[_0x00fd('0x32')]][_0x00fd('0x5d')]=_0x18abb9['channel'];this[_0x00fd('0x16')][_0x18abb9[_0x00fd('0x32')]][_0x00fd('0x3b')]=dispositions[_[_0x00fd('0x3c')](_0x18abb9[_0x00fd('0x3d')])];if(this['agents'][_0x18abb9[_0x00fd('0x36')]['split']('-')[0x0]]){this['channels'][_0x18abb9[_0x00fd('0x32')]][_0x00fd('0x5e')]=this[_0x00fd('0x17')][_0x18abb9[_0x00fd('0x36')][_0x00fd('0x42')]('-')[0x0]]['id'];this[_0x00fd('0x16')][_0x18abb9['linkedid']][_0x00fd('0x5f')]=this[_0x00fd('0x17')][_0x18abb9['channel'][_0x00fd('0x42')]('-')[0x0]][_0x00fd('0x43')];}}}}else{if(this['channels'][_0x18abb9[_0x00fd('0x31')]]){if(_0x18abb9[_0x00fd('0x3d')]==='6'){if(this[_0x00fd('0x17')][_0x18abb9[_0x00fd('0x36')][_0x00fd('0x42')]('-')[0x0]]){this[_0x00fd('0x16')][_0x18abb9[_0x00fd('0x31')]][_0x00fd('0x5e')]=this[_0x00fd('0x17')][_0x18abb9[_0x00fd('0x36')][_0x00fd('0x42')]('-')[0x0]]['id'];this[_0x00fd('0x16')][_0x18abb9[_0x00fd('0x31')]]['membername']=this[_0x00fd('0x17')][_0x18abb9['channel'][_0x00fd('0x42')]('-')[0x0]][_0x00fd('0x43')];}}}}}}catch(_0x23f2cd){logger[_0x00fd('0x46')](_0x00fd('0x60'),util['inspect'](_0x23f2cd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x00fd('0x2e')][_0x00fd('0x61')]=function(_0x5ccfbe,_0x462808){if(this['channels'][_0x5ccfbe]){this[_0x00fd('0x16')][_0x5ccfbe][_0x00fd('0x62')]=!![];if(_[_0x00fd('0x63')](_0x462808,_0x00fd('0x64'))){_0x462808=_0x462808[_0x00fd('0x65')](_0x00fd('0x64'),_0x00fd('0x66'));}this['channels'][_0x5ccfbe][_0x00fd('0x67')]=_0x462808;var _0x1290a0=_[_0x00fd('0x68')](this[_0x00fd('0x16')][_0x5ccfbe]['monitors'],{'filename':_0x462808});if(_[_0x00fd('0x69')](_0x1290a0)){this[_0x00fd('0x16')][_0x5ccfbe][_0x00fd('0x6a')]['push']({'filename':_0x462808,'createdAt':moment()['format'](_0x00fd('0x3a')),'mixmonitorid':'','status':_0x00fd('0x6b')});}}};VoiceCallReport['prototype'][_0x00fd('0x1f')]=function(_0x36cdb7){try{if(this[_0x00fd('0x2f')](_0x36cdb7)){if(this[_0x00fd('0x16')][_0x36cdb7['uniqueid']]&&_0x36cdb7[_0x00fd('0x36')]!=_0x00fd('0x37')){if(this[_0x00fd('0x2f')](_0x36cdb7[_0x00fd('0x6c')])){if(this['isNotNull'](_0x36cdb7[_0x00fd('0x6c')][_0x00fd('0x6d')])){this[_0x00fd('0x61')](_0x36cdb7[_0x00fd('0x31')],_0x36cdb7[_0x00fd('0x6e')]);}else if(this[_0x00fd('0x2f')](_0x36cdb7[_0x00fd('0x6c')][_0x00fd('0x6f')])){this[_0x00fd('0x16')][_0x36cdb7[_0x00fd('0x31')]][_0x00fd('0x5a')]=_0x36cdb7['value'];}else if(this[_0x00fd('0x2f')](_0x36cdb7[_0x00fd('0x6c')]['xmd-callerid'])){this[_0x00fd('0x16')][_0x36cdb7[_0x00fd('0x31')]][_0x00fd('0x70')]=_0x36cdb7[_0x00fd('0x6e')];}else if(this['isNotNull'](_0x36cdb7['variable'][_0x00fd('0x71')])){this['channels'][_0x36cdb7[_0x00fd('0x31')]][_0x00fd('0x72')]=_0x36cdb7[_0x00fd('0x6e')];}else if(this[_0x00fd('0x2f')](_0x36cdb7['variable'][_0x00fd('0x73')])){this['channels'][_0x36cdb7[_0x00fd('0x31')]][_0x00fd('0x53')]=_0x36cdb7[_0x00fd('0x6e')][_0x00fd('0x42')](',')[0x0];}else if(this[_0x00fd('0x2f')](_0x36cdb7[_0x00fd('0x6c')][_0x00fd('0x74')])){this[_0x00fd('0x16')][_0x36cdb7['uniqueid']]['originatecalleridnum']=_0x36cdb7['value'];}else if(this[_0x00fd('0x2f')](_0x36cdb7['variable'][_0x00fd('0x75')])){this[_0x00fd('0x16')][_0x36cdb7[_0x00fd('0x31')]][_0x00fd('0x76')]=_0x36cdb7['value'];}else if(this[_0x00fd('0x2f')](_0x36cdb7['variable'][_0x00fd('0x77')])){this[_0x00fd('0x16')][_0x36cdb7[_0x00fd('0x31')]][_0x00fd('0x78')]=_0x36cdb7['value'];}else if(this[_0x00fd('0x2f')](_0x36cdb7[_0x00fd('0x6c')][_0x00fd('0x79')])){this[_0x00fd('0x16')][_0x36cdb7[_0x00fd('0x31')]][_0x00fd('0x53')]=_0x36cdb7[_0x00fd('0x6e')];}else if(this[_0x00fd('0x2f')](_0x36cdb7[_0x00fd('0x6c')][_0x00fd('0x7a')])){this[_0x00fd('0x16')][_0x36cdb7[_0x00fd('0x31')]][_0x00fd('0x7b')]=_0x36cdb7[_0x00fd('0x6e')];}}}else if(this[_0x00fd('0x2f')](_0x36cdb7[_0x00fd('0x6c')][_0x00fd('0x6d')])){if(_0x36cdb7[_0x00fd('0x6e')]){var _0x4cb948=path[_0x00fd('0x7c')](_0x36cdb7['value'])[_0x00fd('0x43')];this['syncMixMonitorFilename'](_0x4cb948,_0x36cdb7[_0x00fd('0x6e')]);}}else if(this['channels'][_0x36cdb7[_0x00fd('0x32')]]){if(this[_0x00fd('0x2f')](_0x36cdb7[_0x00fd('0x6c')])){if(this[_0x00fd('0x2f')](_0x36cdb7[_0x00fd('0x6c')][_0x00fd('0x7a')])){this[_0x00fd('0x16')][_0x36cdb7[_0x00fd('0x32')]][_0x00fd('0x7d')]=_0x36cdb7[_0x00fd('0x6e')];}}}}}catch(_0x30a770){logger[_0x00fd('0x46')](_0x00fd('0x7e'),util[_0x00fd('0x55')](_0x30a770,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x00fd('0x20')]=function(_0x9a0c12){try{if(this['isNotNull'](_0x9a0c12)){if(this[_0x00fd('0x16')][_0x9a0c12[_0x00fd('0x31')]]){var _0x2b5185=moment();this[_0x00fd('0x16')][_0x9a0c12[_0x00fd('0x31')]][_0x00fd('0x7f')]=_0x2b5185['format'](_0x00fd('0x3a'));this[_0x00fd('0x16')][_0x9a0c12[_0x00fd('0x31')]][_0x00fd('0x4c')]=_0x2b5185[_0x00fd('0x59')](this[_0x00fd('0x16')][_0x9a0c12[_0x00fd('0x31')]][_0x00fd('0x38')],_0x00fd('0x4d'));if(this[_0x00fd('0x16')][_0x9a0c12['uniqueid']][_0x00fd('0x56')]){this['channels'][_0x9a0c12[_0x00fd('0x31')]][_0x00fd('0x80')]=_0x2b5185[_0x00fd('0x59')](this[_0x00fd('0x16')][_0x9a0c12[_0x00fd('0x31')]][_0x00fd('0x57')],_0x00fd('0x4d'));this[_0x00fd('0x16')][_0x9a0c12[_0x00fd('0x31')]]['holdtime']=this['channels'][_0x9a0c12[_0x00fd('0x31')]]['duration']-this[_0x00fd('0x16')][_0x9a0c12[_0x00fd('0x31')]][_0x00fd('0x80')];}if(_0x9a0c12[_0x00fd('0x3e')]==='from-sip'){if(this[_0x00fd('0x17')][_0x9a0c12[_0x00fd('0x36')][_0x00fd('0x42')]('-')[0x0]]){this[_0x00fd('0x17')][_0x9a0c12[_0x00fd('0x36')][_0x00fd('0x42')]('-')[0x0]]=_['omit'](this[_0x00fd('0x17')][_0x9a0c12[_0x00fd('0x36')][_0x00fd('0x42')]('-')[0x0]],[_0x00fd('0x40')]);this['emit'](util[_0x00fd('0x39')]('user:%s',this[_0x00fd('0x17')][_0x9a0c12['channel'][_0x00fd('0x42')]('-')[0x0]][_0x00fd('0x43')]),_0x00fd('0x81'),{'destaccountcode':this[_0x00fd('0x17')][_0x9a0c12[_0x00fd('0x36')][_0x00fd('0x42')]('-')[0x0]][_0x00fd('0x44')]});}}ami[_0x00fd('0x30')](_0x00fd('0x82'),this[_0x00fd('0x16')][_0x9a0c12[_0x00fd('0x31')]]);delete this[_0x00fd('0x16')][_0x9a0c12['uniqueid']];}}}catch(_0x527ae5){logger[_0x00fd('0x46')](_0x00fd('0x83'),util[_0x00fd('0x55')](_0x527ae5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x00fd('0x2e')]['syncAttendedTransfer']=function(_0xdc6072){try{if(this[_0x00fd('0x2f')](_0xdc6072)){if(this[_0x00fd('0x16')][_0xdc6072[_0x00fd('0x84')]]){this[_0x00fd('0x16')][_0xdc6072[_0x00fd('0x84')]][_0x00fd('0x85')]=_0xdc6072[_0x00fd('0x86')];this[_0x00fd('0x16')][_0xdc6072['transfereeuniqueid']]['transferconnectedlinenum']=_0xdc6072[_0x00fd('0x87')];if(this[_0x00fd('0x16')][_0xdc6072[_0x00fd('0x88')]]){var _0x39e644=this[_0x00fd('0x16')][_0xdc6072[_0x00fd('0x88')]];this[_0x00fd('0x16')][_0xdc6072[_0x00fd('0x88')]]=this['channels'][_0xdc6072[_0x00fd('0x84')]];this[_0x00fd('0x16')][_0xdc6072[_0x00fd('0x84')]]=_0x39e644;}}else if(this[_0x00fd('0x16')][_0xdc6072[_0x00fd('0x89')]]){this[_0x00fd('0x16')][_0xdc6072['transfertargetuniqueid']]['transfercalleridnum']=_0xdc6072['origtransferercalleridnum'];this[_0x00fd('0x16')][_0xdc6072[_0x00fd('0x89')]][_0x00fd('0x8a')]=_0xdc6072[_0x00fd('0x87')];if(this[_0x00fd('0x16')][_0xdc6072['origtransfereruniqueid']]){var _0x39e644=this[_0x00fd('0x16')][_0xdc6072['origtransfereruniqueid']];this[_0x00fd('0x16')][_0xdc6072[_0x00fd('0x8b')]]=this[_0x00fd('0x16')][_0xdc6072[_0x00fd('0x89')]];this['channels'][_0xdc6072[_0x00fd('0x89')]]=_0x39e644;}}}}catch(_0x1d13b6){logger['error'](_0x00fd('0x8c'),util['inspect'](_0x1d13b6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x00fd('0x2e')][_0x00fd('0x24')]=function(_0x269440){try{if(this[_0x00fd('0x2f')](_0x269440)){if(this['channels'][_0x269440[_0x00fd('0x84')]]){this['channels'][_0x269440[_0x00fd('0x84')]][_0x00fd('0x85')]=_0x269440[_0x00fd('0x8d')];this['channels'][_0x269440[_0x00fd('0x84')]][_0x00fd('0x8a')]=_0x269440['extension'];this['syncHangup']({'event':_0x00fd('0x8e'),'uniqueid':_0x269440[_0x00fd('0x84')],'context':_0x269440['context'],'channel':_0x269440[_0x00fd('0x8f')]});}}}catch(_0x4a031b){logger[_0x00fd('0x46')]('[syncBlindTransfer][VoiceCallReport]',util[_0x00fd('0x55')](_0x4a031b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x00fd('0x2e')]['syncMusicOnHoldStart']=function(_0x186de6){try{if(this['isNotNull'](_0x186de6)){if(this['channels'][_0x186de6[_0x00fd('0x31')]]){if(!_['isNil'](this[_0x00fd('0x16')][_0x186de6[_0x00fd('0x31')]][_0x00fd('0x57')])){this[_0x00fd('0x16')][_0x186de6['uniqueid']]['mohstarttime']=moment()[_0x00fd('0x39')](_0x00fd('0x3a'));}}}}catch(_0x2d3825){logger[_0x00fd('0x46')]('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x00fd('0x55')](_0x2d3825,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x00fd('0x2e')][_0x00fd('0x28')]=function(_0x1478e4){try{if(this[_0x00fd('0x2f')](_0x1478e4)){if(this[_0x00fd('0x16')][_0x1478e4[_0x00fd('0x31')]]){if(!_[_0x00fd('0x69')](this['channels'][_0x1478e4[_0x00fd('0x31')]][_0x00fd('0x90')])){this[_0x00fd('0x16')][_0x1478e4['uniqueid']]['mohtime']+=moment()[_0x00fd('0x91')](0x0)[_0x00fd('0x59')](this[_0x00fd('0x16')][_0x1478e4['uniqueid']][_0x00fd('0x90')],_0x00fd('0x4d'));delete this[_0x00fd('0x16')][_0x1478e4[_0x00fd('0x31')]][_0x00fd('0x90')];}}}}catch(_0x40930b){logger[_0x00fd('0x46')](_0x00fd('0x92'),util[_0x00fd('0x55')](_0x40930b,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0x8213=['transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','syncBlindTransfer','transfereecalleridnum','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','isNil','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','lodash','../../../config/environment','../../../config/logger','../ami','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','set','agi','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','defaults','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','isNotNull','prototype','emit','linkedid','isUndefined','uniqueid','merge','pick','keys','error','channel','OutgoingSpoolFailed','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','context','from-sip','split','destconnectedlinenum','exten','name','inspect','application','appdata','applicationdata','toLowerCase','starttime','duration','seconds','includes','lastapplication','lastdata','startsWith','cdr(','match','queue','[syncNewExten][VoiceCallReport]','answertime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','endsWith','replace','.wav49','monitorFilename','find','monitors','push','rec','variable','mixmonitor_filename','xmd-callerid','callerid','value','xmd-cdrtype','type','xmd-queue','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','parse','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','syncHangup','billableseconds','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum'];(function(_0x5efc87,_0x5a7b35){var _0x107581=function(_0x1d3d40){while(--_0x1d3d40){_0x5efc87['push'](_0x5efc87['shift']());}};_0x107581(++_0x5a7b35);}(_0x8213,0x1d9));var _0x3821=function(_0x27f5cd,_0xc1c22){_0x27f5cd=_0x27f5cd-0x0;var _0x271e5f=_0x8213[_0x27f5cd];return _0x271e5f;};'use strict';var BPromise=require(_0x3821('0x0'));var _=require(_0x3821('0x1'));var moment=require('moment');var util=require('util');var path=require('path');var Redis=require('ioredis');var config=require(_0x3821('0x2'));var logger=require(_0x3821('0x3'))('ami');var ami=require(_0x3821('0x4'));var Channel=require('../model/channel');var statusDesc=[_0x3821('0x5'),_0x3821('0x6'),_0x3821('0x7'),_0x3821('0x8'),_0x3821('0x9'),'unavailable',_0x3821('0xa'),_0x3821('0xb'),'onhold'];var applications=[_0x3821('0xc'),'queue',_0x3821('0xd'),'dial',_0x3821('0xe'),_0x3821('0xf')];var dispositions=[_0x3821('0x10'),_0x3821('0x11'),_0x3821('0x11'),'NO\x20ANSWER','NO\x20ANSWER','NO\x20ANSWER',_0x3821('0x12'),_0x3821('0x13'),'FAILED',_0x3821('0x11'),_0x3821('0x11')];var actions={};config['redis']=_[_0x3821('0x14')](config[_0x3821('0x15')],{'host':_0x3821('0x16'),'port':0x18eb});var io=require(_0x3821('0x17'))(new Redis(config['redis']));function VoiceCallReport(_0x2eac6d){this[_0x3821('0x18')]=_0x2eac6d['channels'];this[_0x3821('0x19')]=_0x2eac6d['agents'];ami['on'](_0x3821('0x1a'),this[_0x3821('0x1b')][_0x3821('0x1c')](this));ami['on'](_0x3821('0x1d'),this[_0x3821('0x1b')][_0x3821('0x1c')](this));ami['on'](_0x3821('0x1e'),this[_0x3821('0x1f')][_0x3821('0x1c')](this));ami['on'](_0x3821('0x20'),this[_0x3821('0x21')][_0x3821('0x1c')](this));ami['on'](_0x3821('0x22'),this[_0x3821('0x23')][_0x3821('0x1c')](this));ami['on'](_0x3821('0x24'),this['syncHangup'][_0x3821('0x1c')](this));ami['on'](_0x3821('0x25'),this[_0x3821('0x26')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x3821('0x1c')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x3821('0x1c')](this));ami['on']('musiconholdstart',this[_0x3821('0x27')][_0x3821('0x1c')](this));ami['on'](_0x3821('0x28'),this[_0x3821('0x29')]['bind'](this));return BPromise[_0x3821('0x2a')]()[_0x3821('0x2b')](ami[_0x3821('0x2c')]())[_0x3821('0x2d')](function(_0x42787f){console[_0x3821('0x2e')](_0x42787f);});}VoiceCallReport['prototype'][_0x3821('0x2f')]=function(_0x4aef84){return _0x4aef84!==null&&!_['isUndefined'](_0x4aef84);};VoiceCallReport[_0x3821('0x30')][_0x3821('0x31')]=function(_0x4fa8be,_0x4e3855,_0x8e4cf7){io['to'](_0x4fa8be)[_0x3821('0x31')](_0x4e3855,_0x8e4cf7);};VoiceCallReport['prototype'][_0x3821('0x26')]=function(_0x5b4e12){try{if(this[_0x3821('0x2f')](_0x5b4e12)){if(_0x5b4e12['uniqueid']===_0x5b4e12[_0x3821('0x32')]){if(!_[_0x3821('0x33')](this[_0x3821('0x18')][_0x5b4e12[_0x3821('0x34')]])){_[_0x3821('0x35')](this['channels'][_0x5b4e12[_0x3821('0x34')]],_[_0x3821('0x36')](_0x5b4e12,_[_0x3821('0x37')](this['channels'][_0x5b4e12[_0x3821('0x34')]])));}}}}catch(_0x47fea6){logger[_0x3821('0x38')]('[syncNewCallerId][VoiceCallReport]',util['inspect'](_0x47fea6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x3821('0x1f')]=function(_0x269463){try{if(this[_0x3821('0x2f')](_0x269463)){if(_0x269463[_0x3821('0x34')]===_0x269463[_0x3821('0x32')]&&_0x269463[_0x3821('0x39')]!=_0x3821('0x3a')){if(_[_0x3821('0x33')](this[_0x3821('0x18')][_0x269463[_0x3821('0x34')]])){this[_0x3821('0x18')][_0x269463[_0x3821('0x34')]]=new Channel();this[_0x3821('0x18')][_0x269463[_0x3821('0x34')]]['starttime']=moment()[_0x3821('0x3b')](_0x3821('0x3c'));this[_0x3821('0x18')][_0x269463[_0x3821('0x34')]][_0x3821('0x3d')]=dispositions[_[_0x3821('0x3e')](_0x269463[_0x3821('0x3f')])];_['merge'](this[_0x3821('0x18')][_0x269463[_0x3821('0x34')]],_[_0x3821('0x36')](_0x269463,_[_0x3821('0x37')](this['channels'][_0x269463[_0x3821('0x34')]])));if(_0x269463[_0x3821('0x40')]===_0x3821('0x41')){if(this[_0x3821('0x19')][_0x269463[_0x3821('0x39')][_0x3821('0x42')]('-')[0x0]]){this['agents'][_0x269463[_0x3821('0x39')][_0x3821('0x42')]('-')[0x0]][_0x3821('0x43')]=_0x269463[_0x3821('0x44')];this['emit'](util['format']('user:%s',this[_0x3821('0x19')][_0x269463[_0x3821('0x39')][_0x3821('0x42')]('-')[0x0]][_0x3821('0x45')]),'user:agentconnect',{'destaccountcode':this[_0x3821('0x19')][_0x269463[_0x3821('0x39')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x269463[_0x3821('0x44')]});}}}}}}catch(_0x57783f){logger['error']('[syncNewChannel][VoiceCallReport]',util[_0x3821('0x46')](_0x57783f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x3821('0x1b')]=function(_0x4ab431){try{if(this[_0x3821('0x2f')](_0x4ab431)){if(_0x4ab431['uniqueid']===_0x4ab431['linkedid']&&_0x4ab431[_0x3821('0x44')]!='h'&&_0x4ab431[_0x3821('0x39')]!=_0x3821('0x3a')){_0x4ab431[_0x3821('0x47')]=_0x4ab431['application']['toLowerCase']();_0x4ab431['applicationdata']=(_0x4ab431[_0x3821('0x48')]||_0x4ab431[_0x3821('0x49')])[_0x3821('0x4a')]();if(_[_0x3821('0x33')](this[_0x3821('0x18')][_0x4ab431[_0x3821('0x34')]])){this[_0x3821('0x18')][_0x4ab431['uniqueid']]=new Channel();this['channels'][_0x4ab431[_0x3821('0x34')]][_0x3821('0x4b')]=_0x4ab431['duration']?moment()['subtract'](moment['duration'](_0x4ab431[_0x3821('0x4c')])[_0x3821('0x4d')](),_0x3821('0x4d'))[_0x3821('0x3b')](_0x3821('0x3c')):moment()[_0x3821('0x3b')](_0x3821('0x3c'));this['channels'][_0x4ab431[_0x3821('0x34')]][_0x3821('0x3d')]=_0x3821('0x10');}_[_0x3821('0x35')](this[_0x3821('0x18')][_0x4ab431[_0x3821('0x34')]],_[_0x3821('0x36')](_0x4ab431,_[_0x3821('0x37')](this['channels'][_0x4ab431['uniqueid']])));if(_[_0x3821('0x4e')](applications,_0x4ab431[_0x3821('0x47')])){this['channels'][_0x4ab431['uniqueid']][_0x3821('0x4f')]=_0x4ab431['application'];this[_0x3821('0x18')][_0x4ab431[_0x3821('0x34')]][_0x3821('0x50')]=_0x4ab431[_0x3821('0x49')];if(_0x4ab431[_0x3821('0x47')]===_0x3821('0xc')&&_[_0x3821('0x51')](_0x4ab431[_0x3821('0x49')],_0x3821('0x52'))){var _0x564ab9=_0x4ab431[_0x3821('0x49')][_0x3821('0x42')]('=');var _0x495036=_0x564ab9[0x0][_0x3821('0x53')](/cdr\((.*)\)/);if(_0x495036){this[_0x3821('0x18')][_0x4ab431[_0x3821('0x34')]][_0x495036[0x1]]=_0x564ab9[0x1];}}else if(_0x4ab431['application']===_0x3821('0x54')){this[_0x3821('0x18')][_0x4ab431[_0x3821('0x34')]][_0x3821('0x54')]=_0x4ab431[_0x3821('0x49')]['split'](',')[0x0];}}}}}catch(_0x4bb900){logger[_0x3821('0x38')](_0x3821('0x55'),util['inspect'](_0x4bb900,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x3821('0x21')]=function(_0x4c2675){try{if(this[_0x3821('0x2f')](_0x4c2675)){if(_0x4c2675[_0x3821('0x34')]!==_0x4c2675[_0x3821('0x32')]){if(this[_0x3821('0x18')][_0x4c2675[_0x3821('0x32')]]){if(_0x4c2675[_0x3821('0x3f')]==='6'){if(!this[_0x3821('0x18')][_0x4c2675[_0x3821('0x32')]]['answered']){var _0x582394=moment();this[_0x3821('0x18')][_0x4c2675[_0x3821('0x32')]]['answered']=!![];this['channels'][_0x4c2675[_0x3821('0x32')]][_0x3821('0x56')]=_0x582394[_0x3821('0x3b')](_0x3821('0x3c'));if(this[_0x3821('0x18')][_0x4c2675[_0x3821('0x32')]][_0x3821('0x4b')]){this[_0x3821('0x18')][_0x4c2675[_0x3821('0x32')]][_0x3821('0x57')]=_0x582394[_0x3821('0x58')](this['channels'][_0x4c2675['linkedid']]['starttime'],_0x3821('0x4d'));}}this['channels'][_0x4c2675[_0x3821('0x32')]][_0x3821('0x32')]=_0x4c2675[_0x3821('0x34')];if(_0x4c2675[_0x3821('0x59')]!==_0x3821('0x5a')){this[_0x3821('0x18')][_0x4c2675[_0x3821('0x32')]][_0x3821('0x5b')]=_0x4c2675[_0x3821('0x59')];}this[_0x3821('0x18')][_0x4c2675['linkedid']][_0x3821('0x5c')]=_0x4c2675[_0x3821('0x5d')];this[_0x3821('0x18')][_0x4c2675[_0x3821('0x32')]][_0x3821('0x5e')]=_0x4c2675['channel'];this[_0x3821('0x18')][_0x4c2675[_0x3821('0x32')]]['disposition']=dispositions[_[_0x3821('0x3e')](_0x4c2675[_0x3821('0x3f')])];if(this[_0x3821('0x19')][_0x4c2675[_0x3821('0x39')][_0x3821('0x42')]('-')[0x0]]){this['channels'][_0x4c2675[_0x3821('0x32')]][_0x3821('0x5f')]=this['agents'][_0x4c2675['channel'][_0x3821('0x42')]('-')[0x0]]['id'];this[_0x3821('0x18')][_0x4c2675[_0x3821('0x32')]]['membername']=this[_0x3821('0x19')][_0x4c2675[_0x3821('0x39')][_0x3821('0x42')]('-')[0x0]]['name'];}}}}else{if(this['channels'][_0x4c2675[_0x3821('0x34')]]){if(_0x4c2675[_0x3821('0x3f')]==='6'){if(this[_0x3821('0x19')][_0x4c2675[_0x3821('0x39')][_0x3821('0x42')]('-')[0x0]]){this[_0x3821('0x18')][_0x4c2675[_0x3821('0x34')]][_0x3821('0x5f')]=this[_0x3821('0x19')][_0x4c2675[_0x3821('0x39')][_0x3821('0x42')]('-')[0x0]]['id'];this['channels'][_0x4c2675[_0x3821('0x34')]][_0x3821('0x60')]=this['agents'][_0x4c2675['channel'][_0x3821('0x42')]('-')[0x0]][_0x3821('0x45')];}}}}}}catch(_0x532be7){logger['error'](_0x3821('0x61'),util['inspect'](_0x532be7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3821('0x30')][_0x3821('0x62')]=function(_0x23bef2,_0x197807){if(this[_0x3821('0x18')][_0x23bef2]){this['channels'][_0x23bef2]['monitor']=!![];if(_[_0x3821('0x63')](_0x197807,'.wav49')){_0x197807=_0x197807[_0x3821('0x64')](_0x3821('0x65'),'.WAV');}this[_0x3821('0x18')][_0x23bef2][_0x3821('0x66')]=_0x197807;var _0x2a95d4=_[_0x3821('0x67')](this[_0x3821('0x18')][_0x23bef2][_0x3821('0x68')],{'filename':_0x197807});if(_['isNil'](_0x2a95d4)){this[_0x3821('0x18')][_0x23bef2][_0x3821('0x68')][_0x3821('0x69')]({'filename':_0x197807,'createdAt':moment()[_0x3821('0x3b')](_0x3821('0x3c')),'mixmonitorid':'','status':_0x3821('0x6a')});}}};VoiceCallReport['prototype'][_0x3821('0x23')]=function(_0x538856){try{if(this[_0x3821('0x2f')](_0x538856)){if(this[_0x3821('0x18')][_0x538856[_0x3821('0x34')]]&&_0x538856['channel']!=_0x3821('0x3a')){if(this[_0x3821('0x2f')](_0x538856[_0x3821('0x6b')])){if(this[_0x3821('0x2f')](_0x538856[_0x3821('0x6b')][_0x3821('0x6c')])){this[_0x3821('0x62')](_0x538856[_0x3821('0x34')],_0x538856['value']);}else if(this['isNotNull'](_0x538856[_0x3821('0x6b')]['xmd-phone'])){this[_0x3821('0x18')][_0x538856[_0x3821('0x34')]][_0x3821('0x59')]=_0x538856['value'];}else if(this[_0x3821('0x2f')](_0x538856[_0x3821('0x6b')][_0x3821('0x6d')])){this['channels'][_0x538856[_0x3821('0x34')]][_0x3821('0x6e')]=_0x538856[_0x3821('0x6f')];}else if(this[_0x3821('0x2f')](_0x538856[_0x3821('0x6b')][_0x3821('0x70')])){this[_0x3821('0x18')][_0x538856[_0x3821('0x34')]][_0x3821('0x71')]=_0x538856[_0x3821('0x6f')];}else if(this[_0x3821('0x2f')](_0x538856[_0x3821('0x6b')][_0x3821('0x72')])){this[_0x3821('0x18')][_0x538856[_0x3821('0x34')]][_0x3821('0x54')]=_0x538856[_0x3821('0x6f')][_0x3821('0x42')](',')[0x0];}else if(this[_0x3821('0x2f')](_0x538856[_0x3821('0x6b')]['xmd-originatecalleridnum'])){this[_0x3821('0x18')][_0x538856[_0x3821('0x34')]][_0x3821('0x73')]=_0x538856['value'];}else if(this[_0x3821('0x2f')](_0x538856[_0x3821('0x6b')][_0x3821('0x74')])){this['channels'][_0x538856[_0x3821('0x34')]][_0x3821('0x75')]=_0x538856[_0x3821('0x6f')];}else if(this['isNotNull'](_0x538856[_0x3821('0x6b')][_0x3821('0x76')])){this[_0x3821('0x18')][_0x538856[_0x3821('0x34')]][_0x3821('0x77')]=_0x538856[_0x3821('0x6f')];}else if(this[_0x3821('0x2f')](_0x538856['variable'][_0x3821('0x78')])){this[_0x3821('0x18')][_0x538856[_0x3821('0x34')]][_0x3821('0x54')]=_0x538856[_0x3821('0x6f')];}else if(this['isNotNull'](_0x538856['variable']['sipcallid'])){this['channels'][_0x538856[_0x3821('0x34')]]['sipcalluniqueid']=_0x538856['value'];}}}else if(this['isNotNull'](_0x538856[_0x3821('0x6b')][_0x3821('0x6c')])){if(_0x538856['value']){var _0x119c7a=path[_0x3821('0x79')](_0x538856['value'])[_0x3821('0x45')];this[_0x3821('0x62')](_0x119c7a,_0x538856[_0x3821('0x6f')]);}}else if(this[_0x3821('0x18')][_0x538856['linkedid']]){if(this['isNotNull'](_0x538856[_0x3821('0x6b')])){if(this[_0x3821('0x2f')](_0x538856['variable'][_0x3821('0x7a')])){this[_0x3821('0x18')][_0x538856[_0x3821('0x32')]][_0x3821('0x7b')]=_0x538856['value'];}}}}}catch(_0x3e29a0){logger['error'](_0x3821('0x7c'),util[_0x3821('0x46')](_0x3e29a0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3821('0x30')][_0x3821('0x7d')]=function(_0x2ff182){try{if(this[_0x3821('0x2f')](_0x2ff182)){if(this[_0x3821('0x18')][_0x2ff182[_0x3821('0x34')]]){var _0x4fae31=moment();this[_0x3821('0x18')][_0x2ff182[_0x3821('0x34')]]['endtime']=_0x4fae31[_0x3821('0x3b')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2ff182[_0x3821('0x34')]][_0x3821('0x4c')]=_0x4fae31['diff'](this[_0x3821('0x18')][_0x2ff182[_0x3821('0x34')]][_0x3821('0x4b')],_0x3821('0x4d'));if(this[_0x3821('0x18')][_0x2ff182[_0x3821('0x34')]]['answered']){this[_0x3821('0x18')][_0x2ff182[_0x3821('0x34')]][_0x3821('0x7e')]=_0x4fae31[_0x3821('0x58')](this['channels'][_0x2ff182[_0x3821('0x34')]][_0x3821('0x56')],'seconds');this[_0x3821('0x18')][_0x2ff182[_0x3821('0x34')]][_0x3821('0x57')]=this['channels'][_0x2ff182[_0x3821('0x34')]]['duration']-this[_0x3821('0x18')][_0x2ff182[_0x3821('0x34')]][_0x3821('0x7e')];}if(_0x2ff182[_0x3821('0x40')]==='from-sip'){if(this[_0x3821('0x19')][_0x2ff182[_0x3821('0x39')][_0x3821('0x42')]('-')[0x0]]){this[_0x3821('0x19')][_0x2ff182[_0x3821('0x39')][_0x3821('0x42')]('-')[0x0]]=_[_0x3821('0x7f')](this[_0x3821('0x19')][_0x2ff182[_0x3821('0x39')]['split']('-')[0x0]],[_0x3821('0x43')]);this['emit'](util[_0x3821('0x3b')]('user:%s',this[_0x3821('0x19')][_0x2ff182[_0x3821('0x39')][_0x3821('0x42')]('-')[0x0]][_0x3821('0x45')]),_0x3821('0x80'),{'destaccountcode':this[_0x3821('0x19')][_0x2ff182[_0x3821('0x39')][_0x3821('0x42')]('-')[0x0]]['accountcode']});}}ami[_0x3821('0x31')](_0x3821('0x81'),this[_0x3821('0x18')][_0x2ff182[_0x3821('0x34')]]);delete this['channels'][_0x2ff182[_0x3821('0x34')]];}}}catch(_0x2ecbf3){logger[_0x3821('0x38')](_0x3821('0x82'),util[_0x3821('0x46')](_0x2ecbf3,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncAttendedTransfer']=function(_0x2239aa){try{if(this['isNotNull'](_0x2239aa)){if(this[_0x3821('0x18')][_0x2239aa[_0x3821('0x83')]]){this[_0x3821('0x18')][_0x2239aa[_0x3821('0x83')]][_0x3821('0x84')]=_0x2239aa[_0x3821('0x85')];this['channels'][_0x2239aa[_0x3821('0x83')]][_0x3821('0x86')]=_0x2239aa[_0x3821('0x87')];if(this[_0x3821('0x18')][_0x2239aa[_0x3821('0x88')]]){var _0x5a08d7=this[_0x3821('0x18')][_0x2239aa[_0x3821('0x88')]];this[_0x3821('0x18')][_0x2239aa['secondtransfereruniqueid']]=this['channels'][_0x2239aa[_0x3821('0x83')]];this[_0x3821('0x18')][_0x2239aa[_0x3821('0x83')]]=_0x5a08d7;}}else if(this[_0x3821('0x18')][_0x2239aa['transfertargetuniqueid']]){this['channels'][_0x2239aa[_0x3821('0x89')]][_0x3821('0x84')]=_0x2239aa[_0x3821('0x85')];this[_0x3821('0x18')][_0x2239aa[_0x3821('0x89')]][_0x3821('0x86')]=_0x2239aa['transfertargetcalleridnum'];if(this['channels'][_0x2239aa['origtransfereruniqueid']]){var _0x5a08d7=this[_0x3821('0x18')][_0x2239aa['origtransfereruniqueid']];this[_0x3821('0x18')][_0x2239aa[_0x3821('0x8a')]]=this['channels'][_0x2239aa[_0x3821('0x89')]];this['channels'][_0x2239aa[_0x3821('0x89')]]=_0x5a08d7;}}}}catch(_0x5c7058){logger[_0x3821('0x38')](_0x3821('0x8b'),util[_0x3821('0x46')](_0x5c7058,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3821('0x30')][_0x3821('0x8c')]=function(_0x2e6709){try{if(this['isNotNull'](_0x2e6709)){if(this[_0x3821('0x18')][_0x2e6709[_0x3821('0x83')]]){this['channels'][_0x2e6709[_0x3821('0x83')]][_0x3821('0x84')]=_0x2e6709[_0x3821('0x8d')];this[_0x3821('0x18')][_0x2e6709[_0x3821('0x83')]][_0x3821('0x86')]=_0x2e6709[_0x3821('0x8e')];this[_0x3821('0x7d')]({'event':_0x3821('0x8f'),'uniqueid':_0x2e6709['transfereeuniqueid'],'context':_0x2e6709[_0x3821('0x40')],'channel':_0x2e6709[_0x3821('0x90')]});}}}catch(_0x30095d){logger[_0x3821('0x38')](_0x3821('0x91'),util[_0x3821('0x46')](_0x30095d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3821('0x30')][_0x3821('0x27')]=function(_0x59a661){try{if(this['isNotNull'](_0x59a661)){if(this['channels'][_0x59a661[_0x3821('0x34')]]){if(!_[_0x3821('0x92')](this[_0x3821('0x18')][_0x59a661[_0x3821('0x34')]][_0x3821('0x56')])){this[_0x3821('0x18')][_0x59a661['uniqueid']][_0x3821('0x93')]=moment()[_0x3821('0x3b')](_0x3821('0x3c'));}}}}catch(_0x50a766){logger['error'](_0x3821('0x94'),util[_0x3821('0x46')](_0x50a766,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3821('0x30')][_0x3821('0x29')]=function(_0x69acae){try{if(this[_0x3821('0x2f')](_0x69acae)){if(this['channels'][_0x69acae[_0x3821('0x34')]]){if(!_[_0x3821('0x92')](this['channels'][_0x69acae[_0x3821('0x34')]][_0x3821('0x93')])){this['channels'][_0x69acae[_0x3821('0x34')]][_0x3821('0x95')]+=moment()[_0x3821('0x96')](0x0)[_0x3821('0x58')](this[_0x3821('0x18')][_0x69acae['uniqueid']][_0x3821('0x93')],_0x3821('0x4d'));delete this['channels'][_0x69acae['uniqueid']]['mohstarttime'];}}}}catch(_0x588761){logger[_0x3821('0x38')](_0x3821('0x97'),util[_0x3821('0x46')](_0x588761,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index efbd3aa..27497d0 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 _0xafbb=['answertime','custom:dialconnect','voice:outbound','[syncDialEnd][VoiceDialReport]','addVariable','keys','value','outboundrouteid','isUndefined','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','membername','memberpenalty','memberrealtime','isNil','includes','variables','endtime','lastevent','complete','answered','holdtime','diff','seconds','billableseconds','sumHoldTime','sumBillable','sumDuration','duration','custom:voiceDialReport','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','channels','outbound','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','emit','syncDialBegin','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','omit','event','privilege','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinename'];(function(_0xc5f560,_0x39baee){var _0x39d3c8=function(_0x24d50d){while(--_0x24d50d){_0xc5f560['push'](_0xc5f560['shift']());}};_0x39d3c8(++_0x39baee);}(_0xafbb,0x12d));var _0xbafb=function(_0x39b46f,_0x4f5dfe){_0x39b46f=_0x39b46f-0x0;var _0x6d26e7=_0xafbb[_0x39b46f];return _0x6d26e7;};'use strict';var _=require(_0xbafb('0x0'));var moment=require('moment');var util=require(_0xbafb('0x1'));var Redis=require(_0xbafb('0x2'));var config=require(_0xbafb('0x3'));var logger=require(_0xbafb('0x4'))('ami');var ami=require('../ami');config[_0xbafb('0x5')]=_[_0xbafb('0x6')](config['redis'],{'host':_0xbafb('0x7'),'port':0x18eb});var io=require(_0xbafb('0x8'))(new Redis(config[_0xbafb('0x5')]));function VoiceDialReport(_0x38f20e){this[_0xbafb('0x9')]=_0x38f20e['outboundChannels'];this[_0xbafb('0xa')]=_0x38f20e['outbound'];this['variables']={};ami['on']('dialbegin',this['syncDialBegin'][_0xbafb('0xb')](this));ami['on'](_0xbafb('0xc'),this[_0xbafb('0xd')][_0xbafb('0xb')](this));ami['on'](_0xbafb('0xe'),this[_0xbafb('0xf')][_0xbafb('0xb')](this));ami['on'](_0xbafb('0x10'),this[_0xbafb('0x11')]['bind'](this));}VoiceDialReport[_0xbafb('0x12')][_0xbafb('0x13')]=function(_0x56fac2){return _0x56fac2!==null&&!_['isUndefined'](_0x56fac2);};VoiceDialReport[_0xbafb('0x12')][_0xbafb('0x14')]=function(_0x129fcd,_0x506a8f,_0x4b9228){io['to'](_0x129fcd)[_0xbafb('0x14')](_0x506a8f,_0x4b9228);};VoiceDialReport[_0xbafb('0x12')][_0xbafb('0x15')]=function(_0x57859a){try{if(this[_0xbafb('0x13')](_0x57859a)){if(this[_0xbafb('0x9')][_0x57859a[_0xbafb('0x16')]]){_[_0xbafb('0x17')](this['channels'][_0x57859a[_0xbafb('0x16')]],{'starttime':moment()[_0xbafb('0x18')](_0xbafb('0x19')),'lastevent':_0xbafb('0x1a'),'interface':_0x57859a[_0xbafb('0x1b')]['substring'](0x0,_0x57859a['channel'][_0xbafb('0x1c')]('-')),'membername':_0x57859a['channel']['substring'](_0x57859a[_0xbafb('0x1b')][_0xbafb('0x1c')]('/')+0x1,_0x57859a[_0xbafb('0x1b')]['lastIndexOf']('-'))},_[_0xbafb('0x1d')](_0x57859a,[_0xbafb('0x1e'),_0xbafb('0x1f')]));this[_0xbafb('0x14')]('voice:outbound','voice_outbound_channel:save',this[_0xbafb('0x9')][_0x57859a[_0xbafb('0x16')]]);ami['emit'](_0xbafb('0x20'),this[_0xbafb('0x9')][_0x57859a['uniqueid']]);}}}catch(_0x1a3d6d){logger[_0xbafb('0x21')](_0xbafb('0x22'),util[_0xbafb('0x23')](_0x1a3d6d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbafb('0x12')][_0xbafb('0xd')]=function(_0x2b7da1){try{if(this[_0xbafb('0x13')](_0x2b7da1)){if(this['channels'][_0x2b7da1[_0xbafb('0x16')]]){this[_0xbafb('0x9')][_0x2b7da1['uniqueid']]['dialstatus']=_0x2b7da1['dialstatus'];if(_0x2b7da1[_0xbafb('0x24')]===_0xbafb('0x25')){this['channels'][_0x2b7da1['uniqueid']]['connectedlinenum']=_0x2b7da1['connectedlinenum'];this['channels'][_0x2b7da1[_0xbafb('0x16')]][_0xbafb('0x26')]=_0x2b7da1[_0xbafb('0x26')];this[_0xbafb('0x9')][_0x2b7da1['uniqueid']][_0xbafb('0x27')]=moment()[_0xbafb('0x18')](_0xbafb('0x19'));this[_0xbafb('0x9')][_0x2b7da1[_0xbafb('0x16')]]['lastevent']='connect';ami[_0xbafb('0x14')](_0xbafb('0x28'),this[_0xbafb('0x9')][_0x2b7da1[_0xbafb('0x16')]]);}this[_0xbafb('0x14')](_0xbafb('0x29'),'voice_outbound_channel:save',this[_0xbafb('0x9')][_0x2b7da1[_0xbafb('0x16')]]);}}}catch(_0x5286a4){logger[_0xbafb('0x21')](_0xbafb('0x2a'),util[_0xbafb('0x23')](_0x5286a4,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbafb('0x12')][_0xbafb('0xf')]=function(_0xe10862){try{if(this[_0xbafb('0x13')](_0xe10862)){this[_0xbafb('0x2b')](_0xe10862[_0xbafb('0x16')],_[_0xbafb('0x2c')](_0xe10862['variable'])[0x0],_0xe10862[_0xbafb('0x2d')]);if(this[_0xbafb('0x13')](_0xe10862['variable'])&&this[_0xbafb('0x13')](_0xe10862['variable'][_0xbafb('0x2e')])){if(_[_0xbafb('0x2f')](this[_0xbafb('0x9')][_0xe10862[_0xbafb('0x16')]])){this[_0xbafb('0x9')][_0xe10862[_0xbafb('0x16')]]={'routeId':_0xe10862['value'],'variables':this['variables'][_0xe10862[_0xbafb('0x16')]]};this[_0xbafb('0x14')](_0xbafb('0x29'),'voice_outbound_channel:save',this[_0xbafb('0x9')][_0xe10862[_0xbafb('0x16')]]);}}}}catch(_0x5c39fb){logger['error'](_0xbafb('0x30'),util[_0xbafb('0x23')](_0x5c39fb,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xbafb('0x2b')]=function(_0x550c0e,_0x1f7ec0,_0x5c5030){var _0x1befd5=[_0xbafb('0x31'),_0xbafb('0x32'),_0xbafb('0x33'),_0xbafb('0x34'),_0xbafb('0x35'),'rtpaudioqoslossbridged',_0xbafb('0x36'),_0xbafb('0x37'),_0xbafb('0x38'),'sipuri',_0xbafb('0x39'),_0xbafb('0x3a'),_0xbafb('0x3b'),_0xbafb('0x3c'),_0xbafb('0x3d'),'memberlastcall',_0xbafb('0x3e'),_0xbafb('0x3f'),_0xbafb('0x40')];if(!_[_0xbafb('0x41')](_0x1f7ec0)&&!_[_0xbafb('0x42')](_0x1befd5,_0x1f7ec0)){if(_[_0xbafb('0x2f')](this[_0xbafb('0x43')][_0x550c0e])){this[_0xbafb('0x43')][_0x550c0e]={};}this[_0xbafb('0x43')][_0x550c0e][_0x1f7ec0]=_0x5c5030;}};VoiceDialReport['prototype']['syncHangup']=function(_0x3ee147){try{if(this[_0xbafb('0x13')](_0x3ee147)){if(this[_0xbafb('0x9')][_0x3ee147['uniqueid']]){this['channels'][_0x3ee147[_0xbafb('0x16')]][_0xbafb('0x44')]=moment()[_0xbafb('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3ee147[_0xbafb('0x16')]]['duration']=moment(this[_0xbafb('0x9')][_0x3ee147[_0xbafb('0x16')]]['endtime'])['diff'](this[_0xbafb('0x9')][_0x3ee147[_0xbafb('0x16')]]['starttime'],'seconds');this[_0xbafb('0x9')][_0x3ee147[_0xbafb('0x16')]][_0xbafb('0x45')]=_0xbafb('0x46');this[_0xbafb('0xa')]['total']+=0x1;if(this[_0xbafb('0x9')][_0x3ee147['uniqueid']]['answertime']){this[_0xbafb('0xa')][_0xbafb('0x47')]+=0x1;this[_0xbafb('0x9')][_0x3ee147[_0xbafb('0x16')]][_0xbafb('0x48')]=moment(this[_0xbafb('0x9')][_0x3ee147[_0xbafb('0x16')]]['answertime'])[_0xbafb('0x49')](this['channels'][_0x3ee147[_0xbafb('0x16')]]['starttime'],_0xbafb('0x4a'));this['channels'][_0x3ee147[_0xbafb('0x16')]][_0xbafb('0x4b')]=moment(this[_0xbafb('0x9')][_0x3ee147[_0xbafb('0x16')]]['endtime'])[_0xbafb('0x49')](this[_0xbafb('0x9')][_0x3ee147['uniqueid']][_0xbafb('0x27')],_0xbafb('0x4a'));this[_0xbafb('0xa')][_0xbafb('0x4c')]+=this[_0xbafb('0x9')][_0x3ee147[_0xbafb('0x16')]][_0xbafb('0x48')]||0x0;this[_0xbafb('0xa')][_0xbafb('0x4d')]+=this['channels'][_0x3ee147[_0xbafb('0x16')]][_0xbafb('0x4b')];}this[_0xbafb('0xa')][_0xbafb('0x4e')]+=this[_0xbafb('0x9')][_0x3ee147[_0xbafb('0x16')]][_0xbafb('0x4f')];ami[_0xbafb('0x14')](_0xbafb('0x50'),this[_0xbafb('0x9')][_0x3ee147[_0xbafb('0x16')]]);ami[_0xbafb('0x14')]('custom:dialend',this[_0xbafb('0x9')][_0x3ee147['uniqueid']]);this[_0xbafb('0x14')]('voice:outbound',_0xbafb('0x51'),this[_0xbafb('0xa')]);this[_0xbafb('0x14')]('voice:outbound',_0xbafb('0x52'),this[_0xbafb('0x9')][_0x3ee147[_0xbafb('0x16')]]);delete this[_0xbafb('0x9')][_0x3ee147[_0xbafb('0x16')]];}if(this[_0xbafb('0x43')][_0x3ee147['uniqueid']]){delete this[_0xbafb('0x43')][_0x3ee147[_0xbafb('0x16')]];}}}catch(_0xf2a10b){logger[_0xbafb('0x21')](_0xbafb('0x53'),util[_0xbafb('0x23')](_0xf2a10b,{'showHidden':![],'depth':null}));}};module[_0xbafb('0x54')]=VoiceDialReport; \ No newline at end of file +var _0xd2ef=['connectedlinenum','connectedlinename','answertime','lastevent','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','addVariable','keys','value','variable','outboundrouteid','inspect','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','endtime','diff','starttime','seconds','complete','total','billableseconds','sumHoldTime','holdtime','sumBillable','sumDuration','duration','custom:dialend','exports','lodash','moment','ioredis','../../../config/logger','ami','defaults','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','syncDialBegin','bind','dialend','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','event','privilege','voice:outbound','voice_outbound_channel:save','uniqueid','error','[syncDialBegin][VoiceDialReport]','syncDialEnd','dialstatus','ANSWER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd2ef,0xdb));var _0xfd2e=function(_0x31583d,_0x171ff6){_0x31583d=_0x31583d-0x0;var _0x1a0223=_0xd2ef[_0x31583d];return _0x1a0223;};'use strict';var _=require(_0xfd2e('0x0'));var moment=require(_0xfd2e('0x1'));var util=require('util');var Redis=require(_0xfd2e('0x2'));var config=require('../../../config/environment');var logger=require(_0xfd2e('0x3'))(_0xfd2e('0x4'));var ami=require('../ami');config['redis']=_[_0xfd2e('0x5')](config[_0xfd2e('0x6')],{'host':_0xfd2e('0x7'),'port':0x18eb});var io=require(_0xfd2e('0x8'))(new Redis(config[_0xfd2e('0x6')]));function VoiceDialReport(_0x364dee){this[_0xfd2e('0x9')]=_0x364dee[_0xfd2e('0xa')];this[_0xfd2e('0xb')]=_0x364dee[_0xfd2e('0xb')];this[_0xfd2e('0xc')]={};ami['on']('dialbegin',this[_0xfd2e('0xd')][_0xfd2e('0xe')](this));ami['on'](_0xfd2e('0xf'),this['syncDialEnd'][_0xfd2e('0xe')](this));ami['on'](_0xfd2e('0x10'),this[_0xfd2e('0x11')][_0xfd2e('0xe')](this));ami['on'](_0xfd2e('0x12'),this[_0xfd2e('0x13')][_0xfd2e('0xe')](this));}VoiceDialReport[_0xfd2e('0x14')][_0xfd2e('0x15')]=function(_0x1a3570){return _0x1a3570!==null&&!_[_0xfd2e('0x16')](_0x1a3570);};VoiceDialReport['prototype']['emit']=function(_0x2f03f4,_0x1edc25,_0x13841d){io['to'](_0x2f03f4)[_0xfd2e('0x17')](_0x1edc25,_0x13841d);};VoiceDialReport['prototype'][_0xfd2e('0xd')]=function(_0x2251ab){try{if(this['isNotNull'](_0x2251ab)){if(this[_0xfd2e('0x9')][_0x2251ab['uniqueid']]){_[_0xfd2e('0x18')](this[_0xfd2e('0x9')][_0x2251ab['uniqueid']],{'starttime':moment()[_0xfd2e('0x19')](_0xfd2e('0x1a')),'lastevent':_0xfd2e('0x1b'),'interface':_0x2251ab['channel'][_0xfd2e('0x1c')](0x0,_0x2251ab[_0xfd2e('0x1d')]['lastIndexOf']('-')),'membername':_0x2251ab['channel'][_0xfd2e('0x1c')](_0x2251ab[_0xfd2e('0x1d')][_0xfd2e('0x1e')]('/')+0x1,_0x2251ab[_0xfd2e('0x1d')]['lastIndexOf']('-'))},_[_0xfd2e('0x1f')](_0x2251ab,[_0xfd2e('0x20'),_0xfd2e('0x21')]));this[_0xfd2e('0x17')](_0xfd2e('0x22'),_0xfd2e('0x23'),this[_0xfd2e('0x9')][_0x2251ab[_0xfd2e('0x24')]]);ami[_0xfd2e('0x17')]('custom:dialbegin',this[_0xfd2e('0x9')][_0x2251ab[_0xfd2e('0x24')]]);}}}catch(_0x16552){logger[_0xfd2e('0x25')](_0xfd2e('0x26'),util['inspect'](_0x16552,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xfd2e('0x14')][_0xfd2e('0x27')]=function(_0xabf762){try{if(this['isNotNull'](_0xabf762)){if(this[_0xfd2e('0x9')][_0xabf762['uniqueid']]){this[_0xfd2e('0x9')][_0xabf762['uniqueid']][_0xfd2e('0x28')]=_0xabf762[_0xfd2e('0x28')];if(_0xabf762['dialstatus']===_0xfd2e('0x29')){this[_0xfd2e('0x9')][_0xabf762[_0xfd2e('0x24')]][_0xfd2e('0x2a')]=_0xabf762['connectedlinenum'];this[_0xfd2e('0x9')][_0xabf762['uniqueid']][_0xfd2e('0x2b')]=_0xabf762['connectedlinename'];this[_0xfd2e('0x9')][_0xabf762[_0xfd2e('0x24')]][_0xfd2e('0x2c')]=moment()[_0xfd2e('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xfd2e('0x9')][_0xabf762[_0xfd2e('0x24')]][_0xfd2e('0x2d')]=_0xfd2e('0x2e');ami[_0xfd2e('0x17')](_0xfd2e('0x2f'),this[_0xfd2e('0x9')][_0xabf762[_0xfd2e('0x24')]]);}this['emit'](_0xfd2e('0x22'),_0xfd2e('0x23'),this[_0xfd2e('0x9')][_0xabf762[_0xfd2e('0x24')]]);}}}catch(_0x288bfb){logger[_0xfd2e('0x25')](_0xfd2e('0x30'),util['inspect'](_0x288bfb,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xfd2e('0x14')]['syncVarSet']=function(_0x5ec48c){try{if(this[_0xfd2e('0x15')](_0x5ec48c)){this[_0xfd2e('0x31')](_0x5ec48c['uniqueid'],_[_0xfd2e('0x32')](_0x5ec48c['variable'])[0x0],_0x5ec48c[_0xfd2e('0x33')]);if(this[_0xfd2e('0x15')](_0x5ec48c['variable'])&&this[_0xfd2e('0x15')](_0x5ec48c[_0xfd2e('0x34')][_0xfd2e('0x35')])){if(_[_0xfd2e('0x16')](this[_0xfd2e('0x9')][_0x5ec48c[_0xfd2e('0x24')]])){this['channels'][_0x5ec48c['uniqueid']]={'routeId':_0x5ec48c[_0xfd2e('0x33')],'variables':this[_0xfd2e('0xc')][_0x5ec48c[_0xfd2e('0x24')]]};this['emit'](_0xfd2e('0x22'),'voice_outbound_channel:save',this[_0xfd2e('0x9')][_0x5ec48c[_0xfd2e('0x24')]]);}}}}catch(_0xd0eda9){logger[_0xfd2e('0x25')]('[syncVarSet][VoiceDialReport]',util[_0xfd2e('0x36')](_0xd0eda9,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xfd2e('0x14')][_0xfd2e('0x31')]=function(_0x4b6fc0,_0x274182,_0x230407){var _0x135008=[_0xfd2e('0x37'),_0xfd2e('0x38'),_0xfd2e('0x39'),_0xfd2e('0x3a'),_0xfd2e('0x3b'),_0xfd2e('0x3c'),_0xfd2e('0x3d'),'rtpaudioqosrttbridged',_0xfd2e('0x3e'),_0xfd2e('0x3f'),'bridgepeer',_0xfd2e('0x40'),_0xfd2e('0x41'),_0xfd2e('0x42'),_0xfd2e('0x43'),_0xfd2e('0x44'),'membername',_0xfd2e('0x45'),_0xfd2e('0x46')];if(!_[_0xfd2e('0x47')](_0x274182)&&!_[_0xfd2e('0x48')](_0x135008,_0x274182)){if(_[_0xfd2e('0x16')](this[_0xfd2e('0xc')][_0x4b6fc0])){this[_0xfd2e('0xc')][_0x4b6fc0]={};}this[_0xfd2e('0xc')][_0x4b6fc0][_0x274182]=_0x230407;}};VoiceDialReport['prototype'][_0xfd2e('0x13')]=function(_0x2e27a4){try{if(this['isNotNull'](_0x2e27a4)){if(this['channels'][_0x2e27a4[_0xfd2e('0x24')]]){this['channels'][_0x2e27a4['uniqueid']][_0xfd2e('0x49')]=moment()['format'](_0xfd2e('0x1a'));this['channels'][_0x2e27a4[_0xfd2e('0x24')]]['duration']=moment(this[_0xfd2e('0x9')][_0x2e27a4['uniqueid']][_0xfd2e('0x49')])[_0xfd2e('0x4a')](this['channels'][_0x2e27a4[_0xfd2e('0x24')]][_0xfd2e('0x4b')],_0xfd2e('0x4c'));this[_0xfd2e('0x9')][_0x2e27a4['uniqueid']][_0xfd2e('0x2d')]=_0xfd2e('0x4d');this[_0xfd2e('0xb')][_0xfd2e('0x4e')]+=0x1;if(this['channels'][_0x2e27a4[_0xfd2e('0x24')]][_0xfd2e('0x2c')]){this['outbound']['answered']+=0x1;this[_0xfd2e('0x9')][_0x2e27a4[_0xfd2e('0x24')]]['holdtime']=moment(this['channels'][_0x2e27a4[_0xfd2e('0x24')]][_0xfd2e('0x2c')])[_0xfd2e('0x4a')](this[_0xfd2e('0x9')][_0x2e27a4[_0xfd2e('0x24')]][_0xfd2e('0x4b')],_0xfd2e('0x4c'));this['channels'][_0x2e27a4[_0xfd2e('0x24')]][_0xfd2e('0x4f')]=moment(this[_0xfd2e('0x9')][_0x2e27a4[_0xfd2e('0x24')]]['endtime'])[_0xfd2e('0x4a')](this[_0xfd2e('0x9')][_0x2e27a4[_0xfd2e('0x24')]]['answertime'],_0xfd2e('0x4c'));this[_0xfd2e('0xb')][_0xfd2e('0x50')]+=this[_0xfd2e('0x9')][_0x2e27a4['uniqueid']][_0xfd2e('0x51')]||0x0;this[_0xfd2e('0xb')][_0xfd2e('0x52')]+=this['channels'][_0x2e27a4['uniqueid']][_0xfd2e('0x4f')];}this[_0xfd2e('0xb')][_0xfd2e('0x53')]+=this[_0xfd2e('0x9')][_0x2e27a4[_0xfd2e('0x24')]][_0xfd2e('0x54')];ami[_0xfd2e('0x17')]('custom:voiceDialReport',this['channels'][_0x2e27a4[_0xfd2e('0x24')]]);ami[_0xfd2e('0x17')](_0xfd2e('0x55'),this[_0xfd2e('0x9')][_0x2e27a4['uniqueid']]);this[_0xfd2e('0x17')](_0xfd2e('0x22'),'voice_outbound:save',this[_0xfd2e('0xb')]);this[_0xfd2e('0x17')](_0xfd2e('0x22'),'voice_outbound_channel:remove',this['channels'][_0x2e27a4[_0xfd2e('0x24')]]);delete this[_0xfd2e('0x9')][_0x2e27a4['uniqueid']];}if(this[_0xfd2e('0xc')][_0x2e27a4['uniqueid']]){delete this[_0xfd2e('0xc')][_0x2e27a4[_0xfd2e('0x24')]];}}}catch(_0x1646f7){logger[_0xfd2e('0x25')]('[syncHangup][VoiceDialReport]',util['inspect'](_0x1646f7,{'showHidden':![],'depth':null}));}};module[_0xfd2e('0x56')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 9c242b7..5913051 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 _0x74a1=['answered','available','loggedIn','sumHoldTime','total','type','unmanaged','abandoned','Trunk','active','callerid','Interval','voice_queue:save','clearZombieChannels','catch','[queues]','loopQueueSummary','then','isNotNull','queue','countBy','callers','toNumber','loggedin','syncNewExten','uniqueid','position','count','merge','pick','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','ABANDONED','[syncQueueCallerAbandon][VoiceQueueReport]','connectedlinenum','[syncQueueCallerLeave][VoiceQueueReport]','[syncAgentConnect][VoiceQueueReport]','syncAgentComplete','assigned','lastAssignedTo','membername','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','toLowerCase','local/','linkedid','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','variable','value','queuestatus','CONTINUE','queuecallerleaveAt','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','length','diff','sumBillable','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','sumDuration','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','milliseconds','[syncMusicOnHoldStop][VoiceQueueReport]','exports','moment','bluebird','util','md5','ioredis','../../../config/environment','../../../config/logger','../ami','../model/queueReport','redis','defaults','socket.io-emitter','enqueue','tail','finally','sequence','agents','channels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','bind','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentconnect','syncAgentConnect','varset','syncVarSet','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','unlockRR','prototype','switch','isNil','Action','channel','message','No\x20such\x20channel','error','queueReports','variables','[voiceQueueReport][checkVariables]','clearQueueReport','inspect','emit','emitVoiceQueueChannelSave','format','name','voice_queue_channel:save','emitVoiceQueueChannelRemove','voice:queue:%s','voice_queue_channel:remove','emitVoiceQueueSummary','inbound','strategy'];(function(_0x290aea,_0x4c8144){var _0x5cb8b6=function(_0x101fb2){while(--_0x101fb2){_0x290aea['push'](_0x290aea['shift']());}};_0x5cb8b6(++_0x4c8144);}(_0x74a1,0x71));var _0x174a=function(_0x4fe56b,_0x53d094){_0x4fe56b=_0x4fe56b-0x0;var _0x238f05=_0x74a1[_0x4fe56b];return _0x238f05;};'use strict';var _=require('lodash');var moment=require(_0x174a('0x0'));var BPromise=require(_0x174a('0x1'));var util=require(_0x174a('0x2'));var md5=require(_0x174a('0x3'));var Redis=require(_0x174a('0x4'));var config=require(_0x174a('0x5'));var logger=require(_0x174a('0x6'))('ami');var ami=require(_0x174a('0x7'));var QueueReport=require(_0x174a('0x8'));config[_0x174a('0x9')]=_[_0x174a('0xa')](config[_0x174a('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x174a('0xb'))(new Redis(config[_0x174a('0x9')]));var Sequence=function(){};Sequence['prototype'][_0x174a('0xc')]=function(_0x222a95){this[_0x174a('0xd')]=this[_0x174a('0xd')]?this['tail'][_0x174a('0xe')](_0x222a95):_0x222a95();};function VoiceQueueReport(_0x436e48){this[_0x174a('0xf')]=new Sequence();this['queueReports']={};this[_0x174a('0x10')]=_0x436e48[_0x174a('0x10')];this[_0x174a('0x11')]=_0x436e48['queueChannels'];this[_0x174a('0x12')]=_0x436e48[_0x174a('0x12')];this[_0x174a('0x13')]=!![];this[_0x174a('0x14')]=_0x436e48[_0x174a('0x14')];this['variables']={};ami['on'](_0x174a('0x15'),this[_0x174a('0x16')]['bind'](this));ami['on']('queuesummarycomplete',this[_0x174a('0x17')]['bind'](this));ami['on'](_0x174a('0x18'),this[_0x174a('0x19')][_0x174a('0x1a')](this));ami['on'](_0x174a('0x1b'),this[_0x174a('0x1c')][_0x174a('0x1a')](this));ami['on'](_0x174a('0x1d'),this['syncQueueCallerLeave'][_0x174a('0x1a')](this));ami['on']('agentcomplete',this['syncAgentComplete']['bind'](this));ami['on'](_0x174a('0x1e'),this[_0x174a('0x1f')][_0x174a('0x1a')](this));ami['on'](_0x174a('0x20'),this[_0x174a('0x21')][_0x174a('0x1a')](this));ami['on']('hangup',this[_0x174a('0x22')][_0x174a('0x1a')](this));ami['on'](_0x174a('0x23'),this[_0x174a('0x24')][_0x174a('0x1a')](this));ami['on'](_0x174a('0x25'),this[_0x174a('0x26')][_0x174a('0x1a')](this));ami['on'](_0x174a('0x27'),this[_0x174a('0x28')][_0x174a('0x1a')](this));ami['on'](_0x174a('0x29'),this[_0x174a('0x2a')][_0x174a('0x1a')](this));ami['on'](_0x174a('0x2b'),this[_0x174a('0x2c')]['bind'](this));this['loopQueueSummary']();this[_0x174a('0x2d')]();}function isNotNull(_0x3a51cd){return _0x3a51cd!==null&&!_[_0x174a('0x2e')](_0x3a51cd);}function clearChannels(_0x3af4b4){if(!_[_0x174a('0x2f')](_0x3af4b4)){for(var _0x4f5d52 in _0x3af4b4){if(_0x3af4b4['hasOwnProperty'](_0x4f5d52)){delete _0x3af4b4[_0x4f5d52];}}}}function clearCampaigns(_0x1f9aef){if(!_[_0x174a('0x2f')](_0x1f9aef)){for(var _0x2b22b0 in _0x1f9aef){if(_0x1f9aef[_0x174a('0x30')](_0x2b22b0)){_0x1f9aef[_0x2b22b0][_0x174a('0x31')]=0x0;}}}}function clearVoiceQueues(_0x1b0137){if(!_[_0x174a('0x2f')](_0x1b0137)){for(var _0xd8e2d4 in _0x1b0137){if(_0x1b0137['hasOwnProperty'](_0xd8e2d4)){_0x1b0137[_0xd8e2d4][_0x174a('0x31')]=0x0;_0x1b0137[_0xd8e2d4][_0x174a('0x32')]=0x0;_0x1b0137[_0xd8e2d4][_0x174a('0x33')]=0x0;_0x1b0137[_0xd8e2d4][_0x174a('0x34')]=0x0;_0x1b0137[_0xd8e2d4]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x543f75){if(!_[_0x174a('0x2f')](_0x543f75)){for(var _0x1cc80f in _0x543f75){if(_0x543f75[_0x174a('0x30')](_0x1cc80f)){_0x543f75[_0x1cc80f][_0x174a('0x35')]=!![];}}}}VoiceQueueReport[_0x174a('0x36')]['clearZombieChannels']=function(){var _0x8c549e=this;for(var _0x1ae922 in this[_0x174a('0x11')]){if(this[_0x174a('0x11')][_0x174a('0x30')](_0x1ae922)&&!this[_0x174a('0x11')][_0x1ae922][_0x174a('0x37')]){this[_0x174a('0xf')][_0x174a('0xc')](function(){if(!_[_0x174a('0x38')](_0x8c549e['channels'][_0x1ae922])){return ami[_0x174a('0x39')]({'action':'status','channel':_0x8c549e['channels'][_0x1ae922][_0x174a('0x3a')]})['catch'](function(_0x465b3f){if(_0x465b3f[_0x174a('0x3b')]===_0x174a('0x3c')){setTimeout(function(){if(_0x8c549e['channels'][_0x1ae922]){delete _0x8c549e[_0x174a('0x11')][_0x1ae922];logger[_0x174a('0x3d')]('[voiceQueueReport][checkChannel]',_0x1ae922);}if(_0x8c549e[_0x174a('0x3e')][_0x1ae922]){delete _0x8c549e[_0x174a('0x3e')][_0x1ae922];logger['error']('[voiceQueueReport][checkQueueReport]',_0x1ae922);}if(_0x8c549e[_0x174a('0x3f')][_0x1ae922]){delete _0x8c549e[_0x174a('0x3f')][_0x1ae922];logger['error'](_0x174a('0x40'),_0x1ae922);}},0x1f40);}});}});}}};VoiceQueueReport[_0x174a('0x36')][_0x174a('0x24')]=function(){logger['error']('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x174a('0x11')]);this[_0x174a('0x41')](this[_0x174a('0x3e')]);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x174a('0x14')]);};VoiceQueueReport['prototype'][_0x174a('0x41')]=function(_0x291466){var _0x324c6c=this;if(!_['isEmpty'](_0x291466)){for(var _0x362d24 in _0x291466){if(_0x291466[_0x174a('0x30')](_0x362d24)){_0x324c6c['emitVoiceQueueChannelRemove'](_0x291466[_0x362d24]);delete _0x291466[_0x362d24];}}}};function loggerCatch(_0xdc7375){return function(_0x511499){logger[_0x174a('0x3d')](_0xdc7375,util[_0x174a('0x42')](_0x511499,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x174a('0x36')]['emit']=function(_0x32af4c,_0x4c2a27,_0x2b2fd0){io['to'](_0x32af4c)[_0x174a('0x43')](_0x4c2a27,_0x2b2fd0);};VoiceQueueReport[_0x174a('0x36')][_0x174a('0x44')]=function(_0x27cb57){this[_0x174a('0x43')](util[_0x174a('0x45')]('voice:queue:%s',_0x27cb57[_0x174a('0x46')]),_0x174a('0x47'),_0x27cb57);};VoiceQueueReport[_0x174a('0x36')][_0x174a('0x48')]=function(_0x49d714){this['emit'](util[_0x174a('0x45')](_0x174a('0x49'),_0x49d714[_0x174a('0x46')]),_0x174a('0x4a'),_0x49d714);};VoiceQueueReport['prototype'][_0x174a('0x4b')]=function(_0xeb580f){if(_0xeb580f['type']===_0x174a('0x4c')){var _0x17029e={'id':_0xeb580f['id'],'name':_0xeb580f[_0x174a('0x46')],'strategy':_0xeb580f[_0x174a('0x4d')],'answered':_0xeb580f[_0x174a('0x4e')],'available':_0xeb580f[_0x174a('0x4f')],'loggedIn':_0xeb580f[_0x174a('0x50')],'pTalking':_0xeb580f[_0x174a('0x33')],'sumBillable':_0xeb580f['sumBillable'],'sumDuration':_0xeb580f['sumDuration'],'sumHoldTime':_0xeb580f[_0x174a('0x51')]||0x0,'talking':_0xeb580f[_0x174a('0x32')],'total':_0xeb580f[_0x174a('0x52')],'type':_0xeb580f[_0x174a('0x53')],'unmanaged':_0xeb580f[_0x174a('0x54')],'abandoned':_0xeb580f[_0x174a('0x55')],'waiting':_0xeb580f['waiting']};if(_0xeb580f[_0x174a('0x56')]){_0x17029e[_0x174a('0x56')]={'id':_0xeb580f[_0x174a('0x56')]['id'],'name':_0xeb580f['Trunk'][_0x174a('0x46')],'active':_0xeb580f[_0x174a('0x56')][_0x174a('0x57')],'callerid':_0xeb580f[_0x174a('0x56')][_0x174a('0x58')]};}if(_0xeb580f[_0x174a('0x59')]){_0x17029e[_0x174a('0x59')]={'id':_0xeb580f[_0x174a('0x59')]['id'],'name':_0xeb580f[_0x174a('0x59')][_0x174a('0x46')]};}var _0x273afd=md5(JSON['stringify'](_0x17029e));if(_0xeb580f[_0x174a('0x3')]!==_0x273afd){_0xeb580f[_0x174a('0x3')]=_0x273afd;this[_0x174a('0x43')](util[_0x174a('0x45')](_0x174a('0x49'),_0x17029e[_0x174a('0x46')]),_0x174a('0x5a'),_0x17029e);}}};VoiceQueueReport[_0x174a('0x36')]['isNotNull']=function(_0x5b4cb4){return _0x5b4cb4!==null&&!_[_0x174a('0x2e')](_0x5b4cb4);};VoiceQueueReport[_0x174a('0x36')][_0x174a('0x2d')]=function(){var _0x1e9751=this;setInterval(function(){_0x1e9751[_0x174a('0x5b')]();ami[_0x174a('0x39')]({'action':'queues'})[_0x174a('0x5c')](loggerCatch(_0x174a('0x5d')));},0x2710);};VoiceQueueReport[_0x174a('0x36')][_0x174a('0x5e')]=function(){var _0x2f6e66=this;setInterval(function(){if(_0x2f6e66[_0x174a('0x13')]){return ami[_0x174a('0x39')]({'action':'queuesummary'})[_0x174a('0x5f')](function(_0x371167){_0x2f6e66['flagQueueSummary']=![];})[_0x174a('0x5c')](loggerCatch('[queuesummary]'));}},0x3e8);};VoiceQueueReport[_0x174a('0x36')][_0x174a('0x16')]=function(_0x4c0131){try{if(this[_0x174a('0x60')](_0x4c0131)&&this[_0x174a('0x60')](_0x4c0131[_0x174a('0x61')])){if(this['voiceQueues'][_0x4c0131[_0x174a('0x61')]]){var _0x58f94c=_[_0x174a('0x62')](this[_0x174a('0x11')],_0x174a('0x61'))[_0x4c0131[_0x174a('0x61')]]||0x0;var _0x295746=_0x58f94c-_0x4c0131[_0x174a('0x63')];if(this[_0x174a('0x12')][_0x4c0131[_0x174a('0x61')]][_0x174a('0x34')]!==_[_0x174a('0x64')](_0x4c0131[_0x174a('0x63')])||this[_0x174a('0x12')][_0x4c0131['queue']][_0x174a('0x50')]!==_[_0x174a('0x64')](_0x4c0131[_0x174a('0x65')])||this[_0x174a('0x12')][_0x4c0131[_0x174a('0x61')]][_0x174a('0x4f')]!==_['toNumber'](_0x4c0131[_0x174a('0x4f')])||this[_0x174a('0x12')][_0x4c0131[_0x174a('0x61')]]['talking']!==_0x295746){this[_0x174a('0x12')][_0x4c0131['queue']]['waiting']=_['toNumber'](_0x4c0131['callers']);this[_0x174a('0x12')][_0x4c0131[_0x174a('0x61')]][_0x174a('0x50')]=_[_0x174a('0x64')](_0x4c0131['loggedin']);this[_0x174a('0x12')][_0x4c0131[_0x174a('0x61')]]['available']=_[_0x174a('0x64')](_0x4c0131['available']);this[_0x174a('0x12')][_0x4c0131[_0x174a('0x61')]]['talking']=_0x295746>0x0?_0x295746:0x0;this['voiceQueues'][_0x4c0131[_0x174a('0x61')]][_0x174a('0x32')]=this[_0x174a('0x12')][_0x4c0131[_0x174a('0x61')]][_0x174a('0x32')]>_['toNumber'](_0x4c0131[_0x174a('0x65')])?_[_0x174a('0x64')](_0x4c0131[_0x174a('0x65')]):this['voiceQueues'][_0x4c0131['queue']][_0x174a('0x32')];this[_0x174a('0x4b')](this[_0x174a('0x12')][_0x4c0131['queue']]);}ami[_0x174a('0x43')]('custom:queuesummary',this[_0x174a('0x12')][_0x4c0131[_0x174a('0x61')]]);}}}catch(_0x54af8f){logger[_0x174a('0x3d')]('[syncQueueSummary][VoiceQueueReport]',util[_0x174a('0x42')](_0x54af8f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x174a('0x36')][_0x174a('0x17')]=function(_0x5dfe42){this[_0x174a('0x13')]=!![];};VoiceQueueReport[_0x174a('0x36')][_0x174a('0x66')]=function(_0x17f708){};VoiceQueueReport[_0x174a('0x36')][_0x174a('0x19')]=function(_0x590d67){try{if(this[_0x174a('0x60')](_0x590d67)){if(_['isUndefined'](this[_0x174a('0x3e')][_0x590d67[_0x174a('0x67')]])){this['queueReports'][_0x590d67[_0x174a('0x67')]]=[];this['channels'][_0x590d67[_0x174a('0x67')]]={};}var _0x3ceed2=new QueueReport();_0x3ceed2['name']=_0x590d67[_0x174a('0x61')];_0x3ceed2['type']=this['voiceQueues'][_0x3ceed2[_0x174a('0x46')]]&&this[_0x174a('0x12')][_0x3ceed2[_0x174a('0x46')]][_0x174a('0x53')]?this['voiceQueues'][_0x3ceed2['name']][_0x174a('0x53')]||_0x174a('0x4c'):_0x174a('0x4c');_0x3ceed2['queue']=_0x590d67['queue'];_0x3ceed2['queuecallerjoinAt']=moment()[_0x174a('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x3ceed2[_0x174a('0x68')]=_0x590d67[_0x174a('0x68')];_0x3ceed2[_0x174a('0x69')]=_0x590d67[_0x174a('0x69')];_[_0x174a('0x6a')](_0x3ceed2,_[_0x174a('0x6b')](_0x590d67,_[_0x174a('0x6c')](_0x3ceed2)));this[_0x174a('0x3e')][_0x590d67['uniqueid']][_0x174a('0x6d')](_0x3ceed2);this[_0x174a('0x11')][_0x590d67[_0x174a('0x67')]]=_0x3ceed2;this['emitVoiceQueueChannelSave'](_0x3ceed2);}}catch(_0x2f056){logger[_0x174a('0x3d')](_0x174a('0x6e'),util[_0x174a('0x42')](_0x2f056,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x174a('0x36')][_0x174a('0x1c')]=function(_0x32d49a){try{if(this['isNotNull'](_0x32d49a)){if(this[_0x174a('0x3e')][_0x32d49a[_0x174a('0x67')]]){var _0x548b95=_[_0x174a('0x6f')](this[_0x174a('0x3e')][_0x32d49a[_0x174a('0x67')]]);_0x548b95[_0x174a('0x70')]=![];_0x548b95[_0x174a('0x71')]=null;_0x548b95[_0x174a('0x72')]=_0x32d49a[_0x174a('0x72')];_0x548b95['originalposition']=_0x32d49a[_0x174a('0x73')];_0x548b95[_0x174a('0x1b')]=!![];_0x548b95[_0x174a('0x74')]=moment()[_0x174a('0x45')](_0x174a('0x75'));_0x548b95[_0x174a('0x76')]=_0x174a('0x77');_0x548b95['lastAssignedTo']=null;this[_0x174a('0x11')][_0x32d49a[_0x174a('0x67')]]=_0x548b95;this[_0x174a('0x48')](_0x548b95);}}}catch(_0x1ce687){logger[_0x174a('0x3d')](_0x174a('0x78'),util['inspect'](_0x1ce687,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x174a('0x36')]['syncQueueCallerLeave']=function(_0x4c371a){try{if(this[_0x174a('0x60')](_0x4c371a)){if(this['queueReports'][_0x4c371a['uniqueid']]){var _0x5558af=_['last'](this['queueReports'][_0x4c371a[_0x174a('0x67')]]);_0x5558af['queuecallerleaveAt']=moment()[_0x174a('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x5558af[_0x174a('0x79')]=_0x4c371a[_0x174a('0x79')];_0x5558af['connectedlinename']=_0x4c371a['connectedlinename'];this[_0x174a('0x11')][_0x4c371a[_0x174a('0x67')]]=_0x5558af;this[_0x174a('0x44')](_0x5558af);}}}catch(_0x4614d7){logger[_0x174a('0x3d')](_0x174a('0x7a'),util['inspect'](_0x4614d7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x174a('0x1f')]=function(_0x3c67bd){try{if(this[_0x174a('0x60')](_0x3c67bd)){if(this[_0x174a('0x3e')][_0x3c67bd[_0x174a('0x67')]]){var _0xa43ddc=_[_0x174a('0x6f')](this['queueReports'][_0x3c67bd[_0x174a('0x67')]]);_0xa43ddc['queuecallercomplete']=!![];_0xa43ddc['queuecallerexitreason']='COMPLETEDBYAGENT';}}}catch(_0x11c128){logger[_0x174a('0x3d')](_0x174a('0x7b'),util['inspect'](_0x11c128,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x174a('0x36')][_0x174a('0x7c')]=function(_0x1546e5){try{if(this[_0x174a('0x60')](_0x1546e5)){if(this[_0x174a('0x3e')][_0x1546e5['uniqueid']]){var _0x37cdba=_['last'](this[_0x174a('0x3e')][_0x1546e5['uniqueid']]);_0x37cdba[_0x174a('0x1b')]=![];_0x37cdba['queuecallerabandonAt']=null;_0x37cdba[_0x174a('0x7d')]=!![];_0x37cdba[_0x174a('0x7e')]=_0x1546e5[_0x174a('0x7f')];_0x37cdba[_0x174a('0x72')]=_0x1546e5[_0x174a('0x72')];_0x37cdba['queuecallercomplete']=!![];_0x37cdba[_0x174a('0x80')]=![];_0x37cdba[_0x174a('0x81')]=null;if(!_0x37cdba['transfer']){if(_0x1546e5['reason']==_0x174a('0x82')){_0x37cdba['queuecallerexitreason']=_0x174a('0x83');}else{if(_['startsWith'](_0x1546e5[_0x174a('0x3a')][_0x174a('0x84')](),_0x174a('0x85'))){if(this['queueReports'][_0x1546e5['linkedid']]){var _0x57c88=_[_0x174a('0x6f')](this[_0x174a('0x3e')][_0x1546e5[_0x174a('0x86')]]);_0x57c88[_0x174a('0x70')]=![];_0x57c88[_0x174a('0x80')]=!![];_0x57c88[_0x174a('0x81')]=moment(_0x37cdba[_0x174a('0x87')])[_0x174a('0x88')](_0x1546e5[_0x174a('0x72')],_0x174a('0x89'))[_0x174a('0x45')](_0x174a('0x75'));_0x57c88['queuecallerexitreason']=_0x174a('0x8a');_0x57c88[_0x174a('0x82')]=!![];_0x57c88[_0x174a('0x8b')]=_0x174a('0x8c');_0x57c88[_0x174a('0x8d')]=_0x1546e5[_0x174a('0x8e')];_0x57c88[_0x174a('0x8f')]=_0x1546e5['uniqueid'];var _0x3675d8=this[_0x174a('0x3e')][_0x1546e5[_0x174a('0x86')]];this[_0x174a('0x3e')][_0x1546e5[_0x174a('0x86')]]=this[_0x174a('0x3e')][_0x1546e5['uniqueid']];this[_0x174a('0x3e')][_0x1546e5[_0x174a('0x67')]]=_0x3675d8;}}else{_0x37cdba[_0x174a('0x76')]=_0x174a('0x90')+_0x1546e5['reason']['toUpperCase']();}}}this['channels'][_0x1546e5[_0x174a('0x67')]]=_0x37cdba;this[_0x174a('0x48')](_0x37cdba);}}}catch(_0x16da9f){logger[_0x174a('0x3d')]('[syncAgentComplete][VoiceQueueReport]',util[_0x174a('0x42')](_0x16da9f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x174a('0x36')][_0x174a('0x21')]=function(_0x45eb83){try{if(this[_0x174a('0x60')](_0x45eb83)){this['addVariable'](_0x45eb83[_0x174a('0x67')],_[_0x174a('0x6c')](_0x45eb83[_0x174a('0x91')])[0x0],_0x45eb83[_0x174a('0x92')]);if(this[_0x174a('0x3e')][_0x45eb83[_0x174a('0x67')]]){var _0x42f3dd=_[_0x174a('0x6f')](this[_0x174a('0x3e')][_0x45eb83['uniqueid']]);if(_0x42f3dd){if(this[_0x174a('0x60')](_0x45eb83[_0x174a('0x91')])&&this[_0x174a('0x60')](_0x45eb83['variable'][_0x174a('0x93')])){switch(_0x45eb83[_0x174a('0x92')]){case _0x174a('0x94'):_0x42f3dd['queuecallerexit']=![];_0x42f3dd[_0x174a('0x81')]=null;break;default:_0x42f3dd['queuecallerexit']=!![];_0x42f3dd[_0x174a('0x81')]=moment()[_0x174a('0x45')](_0x174a('0x75'));_0x42f3dd[_0x174a('0x95')]=moment()[_0x174a('0x45')]('YYYY-MM-DD\x20HH:mm:ss');}_0x42f3dd['queuecallerabandon']=![];_0x42f3dd[_0x174a('0x74')]=null;_0x42f3dd[_0x174a('0x76')]=_0x45eb83[_0x174a('0x92')];this[_0x174a('0x11')][_0x45eb83['uniqueid']]=_0x42f3dd;this[_0x174a('0x48')](_0x42f3dd);}else if(this[_0x174a('0x60')](_0x45eb83[_0x174a('0x91')])&&this[_0x174a('0x60')](_0x45eb83[_0x174a('0x91')]['queueposition'])){if(!_0x42f3dd[_0x174a('0x1b')]){_0x42f3dd[_0x174a('0x80')]=!![];_0x42f3dd[_0x174a('0x81')]=moment()[_0x174a('0x45')](_0x174a('0x75'));_0x42f3dd['queuecallerexitreason']=_0x174a('0x96');_0x42f3dd[_0x174a('0x95')]=moment()[_0x174a('0x45')](_0x174a('0x75'));this[_0x174a('0x11')][_0x45eb83[_0x174a('0x67')]]=_0x42f3dd;}}_0x42f3dd[_0x174a('0x3f')]=this[_0x174a('0x3f')][_0x45eb83[_0x174a('0x67')]];}}}}catch(_0x39270d){logger['error'](_0x174a('0x97'),util['inspect'](_0x39270d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x174a('0x36')]['addVariable']=function(_0x47b39c,_0x23062b,_0x1b32e4){var _0x3f4e95=[_0x174a('0x98'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x174a('0x99'),_0x174a('0x9a'),_0x174a('0x9b'),_0x174a('0x9c'),_0x174a('0x9d'),_0x174a('0x9e'),_0x174a('0x9f'),'bridgepeer',_0x174a('0xa0'),'membercalls',_0x174a('0xa1'),_0x174a('0xa2'),'memberlastcall',_0x174a('0x7f'),_0x174a('0xa3'),_0x174a('0xa4')];if(!_[_0x174a('0x38')](_0x23062b)&&!_[_0x174a('0xa5')](_0x3f4e95,_0x23062b)){if(_[_0x174a('0x2e')](this[_0x174a('0x3f')][_0x47b39c])){this[_0x174a('0x3f')][_0x47b39c]={};}this[_0x174a('0x3f')][_0x47b39c][_0x23062b]=_0x1b32e4;}};VoiceQueueReport[_0x174a('0x36')]['syncHangup']=function(_0x57591e){try{if(this[_0x174a('0x60')](_0x57591e)){if(this['queueReports'][_0x57591e['uniqueid']]){for(var _0x18d211=0x0,_0x59a042={};_0x18d2110x0?_0x4a4309:0x0;this[_0x4dcc('0x13')][_0x526a38['queue']][_0x4dcc('0x34')]=this[_0x4dcc('0x13')][_0x526a38[_0x4dcc('0x65')]][_0x4dcc('0x34')]>_['toNumber'](_0x526a38[_0x4dcc('0x68')])?_[_0x4dcc('0x67')](_0x526a38['loggedin']):this['voiceQueues'][_0x526a38['queue']][_0x4dcc('0x34')];this[_0x4dcc('0x69')](this[_0x4dcc('0x13')][_0x526a38['queue']]);}ami[_0x4dcc('0x47')](_0x4dcc('0x6a'),this[_0x4dcc('0x13')][_0x526a38[_0x4dcc('0x65')]]);}}}catch(_0x2835ed){logger[_0x4dcc('0x40')](_0x4dcc('0x6b'),util[_0x4dcc('0x46')](_0x2835ed,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4dcc('0x38')]['syncQueueSummaryComplete']=function(_0xb00246){this[_0x4dcc('0x14')]=!![];};VoiceQueueReport[_0x4dcc('0x38')][_0x4dcc('0x6c')]=function(_0x4a0d65){};VoiceQueueReport[_0x4dcc('0x38')][_0x4dcc('0x1b')]=function(_0x4cf163){try{if(this[_0x4dcc('0x63')](_0x4cf163)){if(_[_0x4dcc('0x30')](this['queueReports'][_0x4cf163[_0x4dcc('0x6d')]])){this[_0x4dcc('0x10')][_0x4cf163[_0x4dcc('0x6d')]]=[];this[_0x4dcc('0x39')][_0x4cf163[_0x4dcc('0x6d')]]={};}var _0x581460=new QueueReport();_0x581460['name']=_0x4cf163['queue'];_0x581460[_0x4dcc('0x6e')]=this[_0x4dcc('0x13')][_0x581460[_0x4dcc('0x49')]]&&this[_0x4dcc('0x13')][_0x581460['name']][_0x4dcc('0x6e')]?this[_0x4dcc('0x13')][_0x581460[_0x4dcc('0x49')]]['type']||_0x4dcc('0x6f'):_0x4dcc('0x6f');_0x581460[_0x4dcc('0x65')]=_0x4cf163[_0x4dcc('0x65')];_0x581460[_0x4dcc('0x70')]=moment()[_0x4dcc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x581460['position']=_0x4cf163['position'];_0x581460[_0x4dcc('0x71')]=_0x4cf163[_0x4dcc('0x71')];_[_0x4dcc('0x72')](_0x581460,_[_0x4dcc('0x73')](_0x4cf163,_[_0x4dcc('0x74')](_0x581460)));this[_0x4dcc('0x10')][_0x4cf163[_0x4dcc('0x6d')]][_0x4dcc('0x75')](_0x581460);this[_0x4dcc('0x39')][_0x4cf163[_0x4dcc('0x6d')]]=_0x581460;this['emitVoiceQueueChannelSave'](_0x581460);}}catch(_0x167abe){logger[_0x4dcc('0x40')](_0x4dcc('0x76'),util['inspect'](_0x167abe,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4dcc('0x38')][_0x4dcc('0x77')]=function(_0x511b29){try{if(this['isNotNull'](_0x511b29)){if(this['queueReports'][_0x511b29['uniqueid']]){var _0xab5ddd=_[_0x4dcc('0x78')](this['queueReports'][_0x511b29[_0x4dcc('0x6d')]]);_0xab5ddd[_0x4dcc('0x79')]=![];_0xab5ddd['queuecallercompleteAt']=null;_0xab5ddd[_0x4dcc('0x7a')]=_0x511b29[_0x4dcc('0x7a')];_0xab5ddd['originalposition']=_0x511b29[_0x4dcc('0x7b')];_0xab5ddd[_0x4dcc('0x1c')]=!![];_0xab5ddd[_0x4dcc('0x7c')]=moment()[_0x4dcc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0xab5ddd[_0x4dcc('0x7d')]=_0x4dcc('0x7e');_0xab5ddd[_0x4dcc('0x7f')]=null;this[_0x4dcc('0x39')][_0x511b29['uniqueid']]=_0xab5ddd;this[_0x4dcc('0x4b')](_0xab5ddd);}}}catch(_0x2cf1bb){logger[_0x4dcc('0x40')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0x4dcc('0x46')](_0x2cf1bb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4dcc('0x1d')]=function(_0x58358e){try{if(this[_0x4dcc('0x63')](_0x58358e)){if(this[_0x4dcc('0x10')][_0x58358e['uniqueid']]){var _0x5c7dc1=_[_0x4dcc('0x78')](this[_0x4dcc('0x10')][_0x58358e[_0x4dcc('0x6d')]]);_0x5c7dc1[_0x4dcc('0x80')]=moment()[_0x4dcc('0x4c')](_0x4dcc('0x81'));_0x5c7dc1[_0x4dcc('0x82')]=_0x58358e['connectedlinenum'];_0x5c7dc1[_0x4dcc('0x83')]=_0x58358e[_0x4dcc('0x83')];this['channels'][_0x58358e[_0x4dcc('0x6d')]]=_0x5c7dc1;this['emitVoiceQueueChannelSave'](_0x5c7dc1);}}}catch(_0x305582){logger[_0x4dcc('0x40')]('[syncQueueCallerLeave][VoiceQueueReport]',util[_0x4dcc('0x46')](_0x305582,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4dcc('0x38')][_0x4dcc('0x21')]=function(_0x30e805){try{if(this['isNotNull'](_0x30e805)){if(this[_0x4dcc('0x10')][_0x30e805['uniqueid']]){var _0x3350e8=_[_0x4dcc('0x78')](this[_0x4dcc('0x10')][_0x30e805[_0x4dcc('0x6d')]]);_0x3350e8[_0x4dcc('0x79')]=!![];_0x3350e8[_0x4dcc('0x7d')]='COMPLETEDBYAGENT';}}}catch(_0x3747fc){logger['error'](_0x4dcc('0x84'),util[_0x4dcc('0x46')](_0x3747fc,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4dcc('0x1f')]=function(_0x51c55e){try{if(this[_0x4dcc('0x63')](_0x51c55e)){if(this[_0x4dcc('0x10')][_0x51c55e[_0x4dcc('0x6d')]]){var _0x19bc15=_['last'](this[_0x4dcc('0x10')][_0x51c55e[_0x4dcc('0x6d')]]);_0x19bc15[_0x4dcc('0x1c')]=![];_0x19bc15['queuecallerabandonAt']=null;_0x19bc15[_0x4dcc('0x85')]=!![];_0x19bc15[_0x4dcc('0x7f')]=_0x51c55e[_0x4dcc('0x86')];_0x19bc15['holdtime']=_0x51c55e['holdtime'];_0x19bc15[_0x4dcc('0x79')]=!![];_0x19bc15[_0x4dcc('0x87')]=![];_0x19bc15[_0x4dcc('0x88')]=null;if(!_0x19bc15[_0x4dcc('0x89')]){if(_0x51c55e[_0x4dcc('0x8a')]==_0x4dcc('0x89')){_0x19bc15['queuecallerexitreason']=_0x4dcc('0x8b');}else{if(_[_0x4dcc('0x8c')](_0x51c55e['channel'][_0x4dcc('0x8d')](),_0x4dcc('0x8e'))){if(this['queueReports'][_0x51c55e[_0x4dcc('0x8f')]]){var _0x5767e7=_[_0x4dcc('0x78')](this[_0x4dcc('0x10')][_0x51c55e['linkedid']]);_0x5767e7[_0x4dcc('0x79')]=![];_0x5767e7['queuecallerexit']=!![];_0x5767e7[_0x4dcc('0x88')]=moment(_0x19bc15[_0x4dcc('0x70')])[_0x4dcc('0x90')](_0x51c55e[_0x4dcc('0x7a')],_0x4dcc('0x91'))[_0x4dcc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5767e7['queuecallerexitreason']=_0x4dcc('0x92');_0x5767e7[_0x4dcc('0x89')]=!![];_0x5767e7[_0x4dcc('0x93')]='FORWARD';_0x5767e7[_0x4dcc('0x94')]=_0x51c55e[_0x4dcc('0x95')];_0x5767e7[_0x4dcc('0x96')]=_0x51c55e[_0x4dcc('0x6d')];var _0x4f8401=this[_0x4dcc('0x10')][_0x51c55e['linkedid']];this[_0x4dcc('0x10')][_0x51c55e[_0x4dcc('0x8f')]]=this[_0x4dcc('0x10')][_0x51c55e[_0x4dcc('0x6d')]];this[_0x4dcc('0x10')][_0x51c55e['uniqueid']]=_0x4f8401;}}else{_0x19bc15[_0x4dcc('0x7d')]=_0x4dcc('0x97')+_0x51c55e[_0x4dcc('0x8a')][_0x4dcc('0x98')]();}}}this[_0x4dcc('0x39')][_0x51c55e[_0x4dcc('0x6d')]]=_0x19bc15;this[_0x4dcc('0x4b')](_0x19bc15);}}}catch(_0x17d540){logger[_0x4dcc('0x40')](_0x4dcc('0x99'),util[_0x4dcc('0x46')](_0x17d540,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4dcc('0x38')][_0x4dcc('0x9a')]=function(_0x3c580d){try{if(this[_0x4dcc('0x63')](_0x3c580d)){this[_0x4dcc('0x9b')](_0x3c580d[_0x4dcc('0x6d')],_[_0x4dcc('0x74')](_0x3c580d[_0x4dcc('0x9c')])[0x0],_0x3c580d[_0x4dcc('0x9d')]);if(this[_0x4dcc('0x10')][_0x3c580d['uniqueid']]){var _0x522d9f=_[_0x4dcc('0x78')](this[_0x4dcc('0x10')][_0x3c580d[_0x4dcc('0x6d')]]);if(_0x522d9f){if(this[_0x4dcc('0x63')](_0x3c580d['variable'])&&this[_0x4dcc('0x63')](_0x3c580d[_0x4dcc('0x9c')][_0x4dcc('0x9e')])){switch(_0x3c580d[_0x4dcc('0x9d')]){case _0x4dcc('0x9f'):_0x522d9f['queuecallerexit']=![];_0x522d9f[_0x4dcc('0x88')]=null;break;default:_0x522d9f['queuecallerexit']=!![];_0x522d9f[_0x4dcc('0x88')]=moment()['format'](_0x4dcc('0x81'));_0x522d9f[_0x4dcc('0x80')]=moment()[_0x4dcc('0x4c')](_0x4dcc('0x81'));}_0x522d9f[_0x4dcc('0x1c')]=![];_0x522d9f[_0x4dcc('0x7c')]=null;_0x522d9f[_0x4dcc('0x7d')]=_0x3c580d['value'];this[_0x4dcc('0x39')][_0x3c580d[_0x4dcc('0x6d')]]=_0x522d9f;this[_0x4dcc('0x4b')](_0x522d9f);}else if(this[_0x4dcc('0x63')](_0x3c580d['variable'])&&this['isNotNull'](_0x3c580d['variable']['queueposition'])){if(!_0x522d9f['queuecallerabandon']){_0x522d9f[_0x4dcc('0x87')]=!![];_0x522d9f[_0x4dcc('0x88')]=moment()['format'](_0x4dcc('0x81'));_0x522d9f[_0x4dcc('0x7d')]=_0x4dcc('0xa0');_0x522d9f[_0x4dcc('0x80')]=moment()[_0x4dcc('0x4c')](_0x4dcc('0x81'));this[_0x4dcc('0x39')][_0x3c580d[_0x4dcc('0x6d')]]=_0x522d9f;}}_0x522d9f[_0x4dcc('0x15')]=this[_0x4dcc('0x15')][_0x3c580d[_0x4dcc('0x6d')]];}}}}catch(_0x182060){logger[_0x4dcc('0x40')](_0x4dcc('0xa1'),util['inspect'](_0x182060,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4dcc('0x38')][_0x4dcc('0x9b')]=function(_0x2dd2b8,_0x3c7a8a,_0x362f4d){var _0x4a23a8=[_0x4dcc('0xa2'),_0x4dcc('0xa3'),_0x4dcc('0xa4'),_0x4dcc('0xa5'),_0x4dcc('0xa6'),_0x4dcc('0xa7'),_0x4dcc('0xa8'),_0x4dcc('0xa9'),_0x4dcc('0xaa'),_0x4dcc('0xab'),_0x4dcc('0xac'),_0x4dcc('0xad'),_0x4dcc('0xae'),'memberdynamic',_0x4dcc('0xaf'),_0x4dcc('0xb0'),_0x4dcc('0x86'),_0x4dcc('0xb1'),_0x4dcc('0xb2')];if(!_[_0x4dcc('0x3b')](_0x3c7a8a)&&!_[_0x4dcc('0xb3')](_0x4a23a8,_0x3c7a8a)){if(_[_0x4dcc('0x30')](this['variables'][_0x2dd2b8])){this[_0x4dcc('0x15')][_0x2dd2b8]={};}this[_0x4dcc('0x15')][_0x2dd2b8][_0x3c7a8a]=_0x362f4d;}};VoiceQueueReport['prototype'][_0x4dcc('0x24')]=function(_0x25af2d){try{if(this['isNotNull'](_0x25af2d)){if(this[_0x4dcc('0x10')][_0x25af2d[_0x4dcc('0x6d')]]){for(var _0xe20283=0x0,_0x4d4341={};_0xe20283=0x0?moment(_0x1344be[_0x58fa('0x18')])[_0x58fa('0xd')](_0x1344be[_0x58fa('0x19')],'seconds'):null,'data1':_0x58fa('0x1a'),'data2':_0x1344be[_0x58fa('0x14')],'data3':_0x1344be[_0x58fa('0x11')],'data4':_0x1344be[_0x58fa('0x1b')]||null,'role':_0x58fa('0x13'),'internal':_0x1344be[_0x58fa('0x14')]?_[_0x58fa('0x15')](_0x1344be[_0x58fa('0x14')]):undefined,'uniqueid':_0x1344be[_0x58fa('0x1c')]},'log':_0x58fa('0x4')});}; \ No newline at end of file +var _0xe1d6=['lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','voiceDialReport','membername','endtime','starttime','outbound','dialstring','uniqueid','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice'];(function(_0x4dedc5,_0x771d24){var _0x1c36a9=function(_0x24b9eb){while(--_0x24b9eb){_0x4dedc5['push'](_0x4dedc5['shift']());}};_0x1c36a9(++_0x771d24);}(_0xe1d6,0x1a9));var _0x6e1d=function(_0x304d85,_0x3bd383){_0x304d85=_0x304d85-0x0;var _0x570077=_0xe1d6[_0x304d85];return _0x570077;};'use strict';var moment=require('moment');var _=require(_0x6e1d('0x0'));var util=require(_0x6e1d('0x1'));var client=require(_0x6e1d('0x2'));exports[_0x6e1d('0x3')]=function(_0x2bea68){var _0x19e9df=_0x2bea68[_0x6e1d('0x4')]||_0x2bea68[_0x6e1d('0x5')];return client[_0x6e1d('0x6')](_0x6e1d('0x7'),{'body':{'channel':_0x6e1d('0x8'),'membername':_0x2bea68[_0x6e1d('0x9')],'interface':_[_0x6e1d('0xa')](_0x2bea68[_0x6e1d('0xb')])?util[_0x6e1d('0xc')](_0x6e1d('0xd'),_0x2bea68['lastAssignedTo']):_0x2bea68['interface'],'type':_0x6e1d('0xe'),'enterAt':_0x2bea68[_0x6e1d('0xf')],'exitAt':_0x19e9df,'duration':moment(_0x19e9df)[_0x6e1d('0x10')](_0x2bea68[_0x6e1d('0xf')],_0x6e1d('0x11')),'data1':_0x6e1d('0x12'),'data2':_0x2bea68[_0x6e1d('0x13')],'data3':_0x2bea68[_0x6e1d('0x14')],'data4':null,'data5':_0x2bea68[_0x6e1d('0x15')],'role':_0x6e1d('0x16'),'internal':_0x2bea68[_0x6e1d('0x17')]?_['toNumber'](_0x2bea68[_0x6e1d('0x17')]):undefined,'uniqueid':_0x2bea68['uniqueid']},'log':_0x6e1d('0x7')});};exports[_0x6e1d('0x18')]=function(_0x3b0f05){return client[_0x6e1d('0x6')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x3b0f05[_0x6e1d('0x19')],'interface':_0x3b0f05['interface'],'type':_0x6e1d('0xe'),'enterAt':_0x3b0f05['starttime'],'exitAt':_0x3b0f05['endtime'],'duration':moment(_0x3b0f05[_0x6e1d('0x1a')])['diff'](_0x3b0f05[_0x6e1d('0x1b')],_0x6e1d('0x11'))>=0x0?moment(_0x3b0f05[_0x6e1d('0x1a')])[_0x6e1d('0x10')](_0x3b0f05[_0x6e1d('0x1b')],'seconds'):null,'data1':_0x6e1d('0x1c'),'data2':_0x3b0f05['accountcode'],'data3':_0x3b0f05[_0x6e1d('0x14')],'data4':_0x3b0f05[_0x6e1d('0x1d')]||null,'role':_0x6e1d('0x16'),'internal':_0x3b0f05[_0x6e1d('0x17')]?_['toNumber'](_0x3b0f05[_0x6e1d('0x17')]):undefined,'uniqueid':_0x3b0f05[_0x6e1d('0x1e')]},'log':_0x6e1d('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 87ce122..fba72ca 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 _0xeecf=['name','../client','getTemplates','Request','GetTemplate'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xeecf,0xdd));var _0xfeec=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xeecf[_0x2b4411];return _0x8e41ef;};'use strict';var client=require(_0xfeec('0x0'));exports[_0xfeec('0x1')]=function(_0x54815b){return function(_0x4a419b){return client[_0xfeec('0x2')](_0xfeec('0x3'),{'options':{'raw':!![],'attributes':['id',_0xfeec('0x4'),'html']},'log':_0xfeec('0x3')});};}; \ No newline at end of file +var _0xbeec=['GetTemplate','name','html','getTemplates','Request'];(function(_0x3aa30f,_0x1a3e24){var _0x37d9a5=function(_0x101697){while(--_0x101697){_0x3aa30f['push'](_0x3aa30f['shift']());}};_0x37d9a5(++_0x1a3e24);}(_0xbeec,0x1b1));var _0xcbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeec[_0x2dafbe];return _0x58a45a;};'use strict';var client=require('../client');exports[_0xcbee('0x0')]=function(_0x1bf565){return function(_0x10e643){return client[_0xcbee('0x1')](_0xcbee('0x2'),{'options':{'raw':!![],'attributes':['id',_0xcbee('0x3'),_0xcbee('0x4')]},'log':_0xcbee('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 78cd742..90e9c76 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(_0xba4be0,_0x8696f1){var _0x2e7dd6=function(_0x2d221a){while(--_0x2d221a){_0xba4be0['push'](_0xba4be0['shift']());}};_0x2e7dd6(++_0x8696f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x47228e,_0x823ada){var _0x58c5e2=function(_0x3d2392){while(--_0x3d2392){_0x47228e['push'](_0x47228e['shift']());}};_0x58c5e2(++_0x823ada);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 a9701df..61eb481 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 _0x4836=['../client','Request','GetTrunk','name'];(function(_0x273d2f,_0x20a56a){var _0x3e5598=function(_0x36bb01){while(--_0x36bb01){_0x273d2f['push'](_0x273d2f['shift']());}};_0x3e5598(++_0x20a56a);}(_0x4836,0x1d0));var _0x6483=function(_0x456e4a,_0xf15e48){_0x456e4a=_0x456e4a-0x0;var _0xdd3962=_0x4836[_0x456e4a];return _0xdd3962;};'use strict';var client=require(_0x6483('0x0'));exports['getTrunks']=function(_0x59564d){return function(_0x21342a){return client[_0x6483('0x1')](_0x6483('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x6483('0x3'),'registry']},'log':_0x6483('0x2')});};}; \ No newline at end of file +var _0xcdce=['registry','../client','getTrunks','Request','GetTrunk','name'];(function(_0x3d39cc,_0x28ad43){var _0x4bb0b6=function(_0x97c134){while(--_0x97c134){_0x3d39cc['push'](_0x3d39cc['shift']());}};_0x4bb0b6(++_0x28ad43);}(_0xcdce,0xb5));var _0xecdc=function(_0x3b7577,_0x5c92ed){_0x3b7577=_0x3b7577-0x0;var _0x69491b=_0xcdce[_0x3b7577];return _0x69491b;};'use strict';var client=require(_0xecdc('0x0'));exports[_0xecdc('0x1')]=function(_0x2df04b){return function(_0x46fa30){return client[_0xecdc('0x2')](_0xecdc('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xecdc('0x4'),_0xecdc('0x5')]},'log':_0xecdc('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 04e2d60..23d0875 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 _0x0513=['accountcode','fullname','online','lastLoginAt','lastPauseAt','voicePause','getAgents','getTelephones','telephone','internal','savePause','Request','PauseUser','saveUnpause','UnpauseUser','pauseType','interface','getAgent','../client','GetUser','agent','name','email'];(function(_0x40dd24,_0x1f1485){var _0x14e73c=function(_0x41f147){while(--_0x41f147){_0x40dd24['push'](_0x40dd24['shift']());}};_0x14e73c(++_0x1f1485);}(_0x0513,0xb3));var _0x3051=function(_0x15a4b5,_0x38f5aa){_0x15a4b5=_0x15a4b5-0x0;var _0x25847b=_0x0513[_0x15a4b5];return _0x25847b;};'use strict';var client=require(_0x3051('0x0'));exports['getAgents']=function(){return function(){return client['Request'](_0x3051('0x1'),{'options':{'raw':![],'where':{'role':_0x3051('0x2')},'attributes':['id',_0x3051('0x3'),_0x3051('0x4'),_0x3051('0x5'),_0x3051('0x6'),_0x3051('0x7'),_0x3051('0x8'),'pauseType',_0x3051('0x9'),_0x3051('0xa'),'phone','mobile','interface']},'log':_0x3051('0xb')});};};exports[_0x3051('0xc')]=function(){return function(){return client['Request'](_0x3051('0x1'),{'options':{'raw':!![],'where':{'role':_0x3051('0xd')},'attributes':['id','name',_0x3051('0x5'),_0x3051('0xe')]},'log':'getTelephones'});};};exports[_0x3051('0xf')]=function(_0x4f15ec,_0x5a02b2,_0xf718d0){return client[_0x3051('0x10')](_0x3051('0x11'),{'body':{'type':_0x5a02b2,'uniqueid':_0xf718d0},'options':{'where':{'id':_0x4f15ec['id']}},'log':_0x3051('0xf')});};exports[_0x3051('0x12')]=function(_0x49c85f){return client[_0x3051('0x10')](_0x3051('0x13'),{'body':{},'options':{'where':{'id':_0x49c85f['id']}},'log':'savePause'});};exports['getAgent']=function(_0x36068e){return client[_0x3051('0x10')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3051('0x2'),'id':_0x36068e},'attributes':['id',_0x3051('0x3'),_0x3051('0x4'),'accountcode',_0x3051('0x6'),_0x3051('0x7'),'lastLoginAt',_0x3051('0x14'),_0x3051('0x9'),'voicePause',_0x3051('0x15')]},'log':_0x3051('0x16')});}; \ No newline at end of file +var _0xcbb9=['UnpauseUser','ShowUser','agent','pauseType','lastPauseAt','getAgent','../client','getAgents','name','accountcode','fullname','online','lastLoginAt','phone','mobile','interface','getTelephones','Request','GetUser','telephone','internal','PauseUser','savePause'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0xcbb9,0xa7));var _0x9cbb=function(_0x1b1cd4,_0x59e578){_0x1b1cd4=_0x1b1cd4-0x0;var _0x218641=_0xcbb9[_0x1b1cd4];return _0x218641;};'use strict';var client=require(_0x9cbb('0x0'));exports[_0x9cbb('0x1')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x9cbb('0x2'),'email',_0x9cbb('0x3'),_0x9cbb('0x4'),_0x9cbb('0x5'),_0x9cbb('0x6'),'pauseType','lastPauseAt','voicePause',_0x9cbb('0x7'),_0x9cbb('0x8'),_0x9cbb('0x9')]},'log':_0x9cbb('0x1')});};};exports[_0x9cbb('0xa')]=function(){return function(){return client[_0x9cbb('0xb')](_0x9cbb('0xc'),{'options':{'raw':!![],'where':{'role':_0x9cbb('0xd')},'attributes':['id',_0x9cbb('0x2'),'accountcode',_0x9cbb('0xe')]},'log':_0x9cbb('0xa')});};};exports['savePause']=function(_0x31ea3b,_0x34d0c8,_0x4eaa8b){return client[_0x9cbb('0xb')](_0x9cbb('0xf'),{'body':{'type':_0x34d0c8,'uniqueid':_0x4eaa8b},'options':{'where':{'id':_0x31ea3b['id']}},'log':_0x9cbb('0x10')});};exports['saveUnpause']=function(_0x37e249){return client[_0x9cbb('0xb')](_0x9cbb('0x11'),{'body':{},'options':{'where':{'id':_0x37e249['id']}},'log':_0x9cbb('0x10')});};exports['getAgent']=function(_0x49f685){return client[_0x9cbb('0xb')](_0x9cbb('0x12'),{'options':{'raw':![],'where':{'role':_0x9cbb('0x13'),'id':_0x49f685},'attributes':['id',_0x9cbb('0x2'),'email',_0x9cbb('0x3'),'fullname',_0x9cbb('0x5'),_0x9cbb('0x6'),_0x9cbb('0x14'),_0x9cbb('0x15'),'voicePause',_0x9cbb('0x9')]},'log':_0x9cbb('0x16')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index ed676d3..86c19bc 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 _0x0b5e=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x120346,_0x269841){var _0x42a17f=function(_0x43cdf){while(--_0x43cdf){_0x120346['push'](_0x120346['shift']());}};_0x42a17f(++_0x269841);}(_0x0b5e,0x1b3));var _0xe0b5=function(_0x3507b5,_0x1ee543){_0x3507b5=_0x3507b5-0x0;var _0x2ab7f8=_0x0b5e[_0x3507b5];return _0x2ab7f8;};'use strict';var client=require(_0xe0b5('0x0'));exports[_0xe0b5('0x1')]=function(_0x4980a4){return client[_0xe0b5('0x2')](_0xe0b5('0x3'),{'body':_0x4980a4,'log':'CreateVoiceAgentReport'});};exports[_0xe0b5('0x4')]=function(_0x13c898,_0x5e8c4a,_0x4cf0a7){return client[_0xe0b5('0x2')](_0xe0b5('0x5'),{'body':_0x13c898,'options':{'where':{'uniqueid':_0x5e8c4a,'interface':_0x4cf0a7}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x85e5=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x3bdb10,_0x5a57b2){var _0x3bcf27=function(_0x1e7e7c){while(--_0x1e7e7c){_0x3bdb10['push'](_0x3bdb10['shift']());}};_0x3bcf27(++_0x5a57b2);}(_0x85e5,0xfa));var _0x585e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x85e5[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x585e('0x0'));exports[_0x585e('0x1')]=function(_0x123eb6){return client[_0x585e('0x2')](_0x585e('0x3'),{'body':_0x123eb6,'log':_0x585e('0x3')});};exports[_0x585e('0x4')]=function(_0xf3b6a9,_0x266ac8,_0x3557e8){return client[_0x585e('0x2')](_0x585e('0x5'),{'body':_0xf3b6a9,'options':{'where':{'uniqueid':_0x266ac8,'interface':_0x3557e8}},'log':_0x585e('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 18db7ae..3c48895 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 _0xcb74=['day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','moment','util','lodash','../client','create','Request','merge','calleridnum','context','getVoiceCallReports','outbound','startOf'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xcb74,0xd0));var _0x4cb7=function(_0x547fe5,_0x36e423){_0x547fe5=_0x547fe5-0x0;var _0x38fb20=_0xcb74[_0x547fe5];return _0x38fb20;};'use strict';var moment=require(_0x4cb7('0x0'));var util=require(_0x4cb7('0x1'));var _=require(_0x4cb7('0x2'));var client=require(_0x4cb7('0x3'));exports[_0x4cb7('0x4')]=function(_0x15463a){return client[_0x4cb7('0x5')]('CreateVoiceCallReport',{'body':_[_0x4cb7('0x6')](_0x15463a,{'source':_0x15463a[_0x4cb7('0x7')],'destinationcontext':_0x15463a[_0x4cb7('0x8')],'callerid':_0x15463a['callerid'],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x4cb7('0x9')]=function(){return function(){return client[_0x4cb7('0x5')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x4cb7('0xa')],'createdAt':{'$between':[moment()[_0x4cb7('0xb')](_0x4cb7('0xc'))[_0x4cb7('0xd')](_0x4cb7('0xe')),moment()[_0x4cb7('0xf')](_0x4cb7('0xc'))[_0x4cb7('0xd')](_0x4cb7('0xe'))]}},'attributes':[_0x4cb7('0x10'),_0x4cb7('0x11'),_0x4cb7('0x12'),_0x4cb7('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xae6e=['outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','disposition','duration','billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport'];(function(_0x441563,_0x1d4a28){var _0x2369ec=function(_0x1f97ba){while(--_0x1f97ba){_0x441563['push'](_0x441563['shift']());}};_0x2369ec(++_0x1d4a28);}(_0xae6e,0x191));var _0xeae6=function(_0x1c9c4b,_0x403c99){_0x1c9c4b=_0x1c9c4b-0x0;var _0x338adf=_0xae6e[_0x1c9c4b];return _0x338adf;};'use strict';var moment=require('moment');var util=require(_0xeae6('0x0'));var _=require(_0xeae6('0x1'));var client=require(_0xeae6('0x2'));exports[_0xeae6('0x3')]=function(_0x5c6c49){return client[_0xeae6('0x4')](_0xeae6('0x5'),{'body':_[_0xeae6('0x6')](_0x5c6c49,{'source':_0x5c6c49[_0xeae6('0x7')],'destinationcontext':_0x5c6c49[_0xeae6('0x8')],'callerid':_0x5c6c49[_0xeae6('0x9')],'amaflags':_0xeae6('0xa')}),'log':_0xeae6('0x5')});};exports[_0xeae6('0xb')]=function(){return function(){return client[_0xeae6('0x4')](_0xeae6('0xc'),{'options':{'where':{'type':[_0xeae6('0xd')],'createdAt':{'$between':[moment()[_0xeae6('0xe')](_0xeae6('0xf'))['format'](_0xeae6('0x10')),moment()[_0xeae6('0x11')](_0xeae6('0xf'))[_0xeae6('0x12')](_0xeae6('0x10'))]}},'attributes':['type',_0xeae6('0x13'),_0xeae6('0x14'),_0xeae6('0x15')]},'log':_0xeae6('0x16')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 2bd5671..62c3cdd 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 _0x7ebb=['../client','create','CreateVoiceDialReport'];(function(_0x554957,_0x3c432f){var _0x2d6ce7=function(_0xc122de){while(--_0xc122de){_0x554957['push'](_0x554957['shift']());}};_0x2d6ce7(++_0x3c432f);}(_0x7ebb,0x66));var _0xb7eb=function(_0x95b616,_0x296372){_0x95b616=_0x95b616-0x0;var _0x596532=_0x7ebb[_0x95b616];return _0x596532;};'use strict';var client=require(_0xb7eb('0x0'));exports[_0xb7eb('0x1')]=function(_0x43bce4){return client['Request']('CreateVoiceDialReport',{'body':_0x43bce4,'log':_0xb7eb('0x2')});}; \ No newline at end of file +var _0x39a1=['create','Request','CreateVoiceDialReport','../client'];(function(_0x44d02e,_0x12c830){var _0x633355=function(_0x376b7b){while(--_0x376b7b){_0x44d02e['push'](_0x44d02e['shift']());}};_0x633355(++_0x12c830);}(_0x39a1,0x6f));var _0x139a=function(_0x45491e,_0xf33c7b){_0x45491e=_0x45491e-0x0;var _0x3f45f2=_0x39a1[_0x45491e];return _0x3f45f2;};'use strict';var client=require(_0x139a('0x0'));exports[_0x139a('0x1')]=function(_0x21f21c){return client[_0x139a('0x2')](_0x139a('0x3'),{'body':_0x21f21c,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 503ce84..66948c7 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 _0x4bb4=['Request','GetVoiceExtension','exten','../client','getVoiceExtensions'];(function(_0x1aeb37,_0x39f3cb){var _0x4bd8c6=function(_0x557784){while(--_0x557784){_0x1aeb37['push'](_0x1aeb37['shift']());}};_0x4bd8c6(++_0x39f3cb);}(_0x4bb4,0x85));var _0x44bb=function(_0x566b67,_0x54a6fd){_0x566b67=_0x566b67-0x0;var _0x3f0cf1=_0x4bb4[_0x566b67];return _0x3f0cf1;};'use strict';var client=require(_0x44bb('0x0'));exports[_0x44bb('0x1')]=function(){return function(){return client[_0x44bb('0x2')](_0x44bb('0x3'),{'options':{'raw':!![],'attributes':['id',_0x44bb('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x44bb('0x1')});};}; \ No newline at end of file +var _0xe815=['getVoiceExtensions','../client','GetVoiceExtension','exten'];(function(_0x3ed7c5,_0x24aff3){var _0x572938=function(_0x5c3bb3){while(--_0x5c3bb3){_0x3ed7c5['push'](_0x3ed7c5['shift']());}};_0x572938(++_0x24aff3);}(_0xe815,0x159));var _0x5e81=function(_0x4a325e,_0x18a3de){_0x4a325e=_0x4a325e-0x0;var _0x271c91=_0xe815[_0x4a325e];return _0x271c91;};'use strict';var client=require(_0x5e81('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x5e81('0x1'),{'options':{'raw':!![],'attributes':['id',_0x5e81('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x5e81('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index fb2c820..341510d 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 _0xc817=['getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client'];(function(_0x4b31aa,_0x501a8a){var _0x17316f=function(_0x4eba66){while(--_0x4eba66){_0x4b31aa['push'](_0x4b31aa['shift']());}};_0x17316f(++_0x501a8a);}(_0xc817,0x75));var _0x7c81=function(_0x34ec6d,_0x2c2d25){_0x34ec6d=_0x34ec6d-0x0;var _0x122caa=_0xc817[_0x34ec6d];return _0x122caa;};'use strict';var client=require(_0x7c81('0x0'));exports[_0x7c81('0x1')]=function(){return function(){return client[_0x7c81('0x2')](_0x7c81('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x7c81('0x4'),_0x7c81('0x5'),_0x7c81('0x6'),_0x7c81('0x7'),_0x7c81('0x8'),_0x7c81('0x9'),'dialMethod',_0x7c81('0xa'),_0x7c81('0xb'),'dialPowerLevel',_0x7c81('0xc'),_0x7c81('0xd'),'dialPredictiveInterval',_0x7c81('0xe'),_0x7c81('0xf'),_0x7c81('0x10'),_0x7c81('0x11'),_0x7c81('0x12'),'dialQueueProject',_0x7c81('0x13'),_0x7c81('0x14'),_0x7c81('0x15'),_0x7c81('0x16'),_0x7c81('0x17'),_0x7c81('0x18'),_0x7c81('0x19'),_0x7c81('0x1a'),_0x7c81('0x1b'),_0x7c81('0x1c'),_0x7c81('0x1d'),_0x7c81('0x1e'),_0x7c81('0x1f'),_0x7c81('0x20'),_0x7c81('0x21'),_0x7c81('0x22'),_0x7c81('0x23'),_0x7c81('0x24'),_0x7c81('0x25'),'dialAMDSilenceThreshold',_0x7c81('0x26'),_0x7c81('0x27'),_0x7c81('0x28'),_0x7c81('0x29'),_0x7c81('0x2a'),_0x7c81('0x2b'),_0x7c81('0x2c'),_0x7c81('0x2d'),_0x7c81('0x7'),'strategy',_0x7c81('0x2e'),_0x7c81('0x2f'),_0x7c81('0x30')],'include':[{'model':_0x7c81('0x31'),'as':'Trunk','attributes':['id',_0x7c81('0x32'),_0x7c81('0x33'),_0x7c81('0x34')]},{'model':_0x7c81('0x35'),'as':_0x7c81('0x36'),'attributes':['id','name']},{'model':_0x7c81('0x31'),'as':_0x7c81('0x37'),'attributes':['id',_0x7c81('0x32'),_0x7c81('0x33'),_0x7c81('0x34')]},{'model':'Interval','as':_0x7c81('0x38'),'attributes':['id',_0x7c81('0x32')],'include':[{'model':_0x7c81('0x38'),'as':_0x7c81('0x39'),'attributes':['id','name',_0x7c81('0x3a')]}]}]},'log':_0x7c81('0x1')});};}; \ No newline at end of file +var _0x9c2c=['acw','autopause','monitor_format','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','name','active','Pause','callerid','Interval','Intervals','interval','../client','getVoiceQueues'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc9c2('0x0'));exports[_0xc9c2('0x1')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name',_0xc9c2('0x2'),'acwTimeout',_0xc9c2('0x3'),_0xc9c2('0x4'),'type','dialActive',_0xc9c2('0x5'),'dialLimitChannel',_0xc9c2('0x6'),_0xc9c2('0x7'),_0xc9c2('0x8'),_0xc9c2('0x9'),_0xc9c2('0xa'),_0xc9c2('0xb'),_0xc9c2('0xc'),_0xc9c2('0xd'),_0xc9c2('0xe'),'dialQueueTimeout',_0xc9c2('0xf'),'dialCongestionMaxRetry',_0xc9c2('0x10'),_0xc9c2('0x11'),_0xc9c2('0x12'),_0xc9c2('0x13'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0xc9c2('0x14'),_0xc9c2('0x15'),'dialPrefix',_0xc9c2('0x16'),_0xc9c2('0x17'),_0xc9c2('0x18'),_0xc9c2('0x19'),_0xc9c2('0x1a'),_0xc9c2('0x1b'),_0xc9c2('0x1c'),_0xc9c2('0x1d'),_0xc9c2('0x1e'),_0xc9c2('0x1f'),_0xc9c2('0x20'),_0xc9c2('0x21'),'dialRecallMeTimeout',_0xc9c2('0x22'),_0xc9c2('0x23'),_0xc9c2('0x24'),_0xc9c2('0x25'),_0xc9c2('0x26'),'monitor_format',_0xc9c2('0x27'),_0xc9c2('0x28'),_0xc9c2('0x29'),'mandatoryDisposition'],'include':[{'model':_0xc9c2('0x2a'),'as':_0xc9c2('0x2a'),'attributes':['id',_0xc9c2('0x2b'),'callerid',_0xc9c2('0x2c')]},{'model':_0xc9c2('0x2d'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0xc9c2('0x2a'),'as':'TrunkBackup','attributes':['id',_0xc9c2('0x2b'),_0xc9c2('0x2e'),_0xc9c2('0x2c')]},{'model':_0xc9c2('0x2f'),'as':_0xc9c2('0x2f'),'attributes':['id','name'],'include':[{'model':_0xc9c2('0x2f'),'as':_0xc9c2('0x30'),'attributes':['id',_0xc9c2('0x2b'),_0xc9c2('0x31')]}]}]},'log':_0xc9c2('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index a77d275..2977053 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 _0x0e6a=['queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','format','YYYY-MM-DD\x20HH:mm:ss','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0x0e6a,0x81));var _0xa0e6=function(_0x34bff6,_0x36f01d){_0x34bff6=_0x34bff6-0x0;var _0x2704ee=_0x0e6a[_0x34bff6];return _0x2704ee;};'use strict';var moment=require(_0xa0e6('0x0'));var _=require(_0xa0e6('0x1'));var client=require('../client');exports[_0xa0e6('0x2')]=function(_0x3d21cb){return client[_0xa0e6('0x3')](_0xa0e6('0x4'),{'body':_0x3d21cb,'log':_0xa0e6('0x4')});};exports[_0xa0e6('0x5')]=function(){return function(){return client[_0xa0e6('0x3')](_0xa0e6('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xa0e6('0x7'))[_0xa0e6('0x8')](_0xa0e6('0x9')),moment()['endOf']('day')[_0xa0e6('0x8')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['uniqueid',_0xa0e6('0xa'),_0xa0e6('0xb'),_0xa0e6('0xc'),'queuecallercomplete',_0xa0e6('0xd'),_0xa0e6('0xe'),'queuecallerexitAt',_0xa0e6('0xf'),_0xa0e6('0x10')]},'log':_0xa0e6('0x11')});};}; \ No newline at end of file +var _0x8fb2=['Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','endOf','day','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','../client'];(function(_0x35b870,_0x11ad5f){var _0x143d6e=function(_0x3c2c89){while(--_0x3c2c89){_0x35b870['push'](_0x35b870['shift']());}};_0x143d6e(++_0x11ad5f);}(_0x8fb2,0x129));var _0x28fb=function(_0x2b581e,_0x1384e2){_0x2b581e=_0x2b581e-0x0;var _0x2c37e2=_0x8fb2[_0x2b581e];return _0x2c37e2;};'use strict';var moment=require(_0x28fb('0x0'));var _=require(_0x28fb('0x1'));var client=require(_0x28fb('0x2'));exports['create']=function(_0x1252b){return client[_0x28fb('0x3')](_0x28fb('0x4'),{'body':_0x1252b,'log':_0x28fb('0x4')});};exports[_0x28fb('0x5')]=function(){return function(){return client['Request'](_0x28fb('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x28fb('0x7')]('day')[_0x28fb('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x28fb('0x9')](_0x28fb('0xa'))[_0x28fb('0x8')](_0x28fb('0xb'))]}},'attributes':[_0x28fb('0xc'),'queue',_0x28fb('0xd'),_0x28fb('0xe'),'queuecallercomplete',_0x28fb('0xf'),_0x28fb('0x10'),'queuecallerexitAt',_0x28fb('0x11'),_0x28fb('0x12')]},'log':_0x28fb('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 1a630c7..4de079e 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 _0xc76b=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x8d1795,_0x1c76cb){var _0x84b168=function(_0xe6f5e){while(--_0xe6f5e){_0x8d1795['push'](_0x8d1795['shift']());}};_0x84b168(++_0x1c76cb);}(_0xc76b,0x1c4));var _0xbc76=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xc76b[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0xbc76('0x0'));exports[_0xbc76('0x1')]=function(_0x39b7ae){return function(){return client[_0xbc76('0x2')](_0xbc76('0x3'),{'options':{'where':{'VoiceQueueId':_0x39b7ae,'paused':!![]},'raw':!![]},'log':_0xbc76('0x1')});};}; \ No newline at end of file +var _0x10b4=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x5c7c9d,_0x38f9c4){var _0x5e8212=function(_0x472d78){while(--_0x472d78){_0x5c7c9d['push'](_0x5c7c9d['shift']());}};_0x5e8212(++_0x38f9c4);}(_0x10b4,0x1b5));var _0x410b=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0x10b4[_0x43d16c];return _0x208cce;};'use strict';var client=require(_0x410b('0x0'));exports[_0x410b('0x1')]=function(_0xb27f8d){return function(){return client[_0x410b('0x2')](_0x410b('0x3'),{'options':{'where':{'VoiceQueueId':_0xb27f8d,'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 49ba379..567fdc6 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 _0x8281=['lodash','create','CreateVoiceRecording','merge'];(function(_0x2130a1,_0x541f0b){var _0x2ffb1f=function(_0x222c8a){while(--_0x222c8a){_0x2130a1['push'](_0x2130a1['shift']());}};_0x2ffb1f(++_0x541f0b);}(_0x8281,0x70));var _0x1828=function(_0x49e231,_0x4a489c){_0x49e231=_0x49e231-0x0;var _0x5cb031=_0x8281[_0x49e231];return _0x5cb031;};'use strict';var _=require(_0x1828('0x0'));var client=require('../client');exports[_0x1828('0x1')]=function(_0x5d60c2){return client['Request'](_0x1828('0x2'),{'body':_[_0x1828('0x3')](_0x5d60c2,{'value':_0x5d60c2['monitorFilename']}),'log':_0x1828('0x2')});}; \ No newline at end of file +var _0xefaf=['lodash','create','Request','CreateVoiceRecording','merge','monitorFilename'];(function(_0x4d6503,_0x4c078d){var _0x40210a=function(_0x478479){while(--_0x478479){_0x4d6503['push'](_0x4d6503['shift']());}};_0x40210a(++_0x4c078d);}(_0xefaf,0x17a));var _0xfefa=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0xefaf[_0x2b91c5];return _0xbd5531;};'use strict';var _=require(_0xfefa('0x0'));var client=require('../client');exports[_0xfefa('0x1')]=function(_0x18c6f3){return client[_0xfefa('0x2')](_0xfefa('0x3'),{'body':_[_0xfefa('0x4')](_0x18c6f3,{'value':_0x18c6f3[_0xfefa('0x5')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 18fce66..a601c69 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 _0x7a2a=['transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x567706,_0x51529e){var _0x3dbf27=function(_0x4640d1){while(--_0x4640d1){_0x567706['push'](_0x567706['shift']());}};_0x3dbf27(++_0x51529e);}(_0x7a2a,0x116));var _0xa7a2=function(_0x5c0644,_0x436539){_0x5c0644=_0x5c0644-0x0;var _0x55b9c2=_0x7a2a[_0x5c0644];return _0x55b9c2;};'use strict';var client=require(_0xa7a2('0x0'));exports[_0xa7a2('0x1')]=function(_0x4bb823){return client[_0xa7a2('0x2')](_0xa7a2('0x3'),{'body':{'result':_0x4bb823['result'],'transfererchannel':_0x4bb823[_0xa7a2('0x4')],'transferercalleridnum':_0x4bb823['transferercalleridnum'],'transferercalleridname':_0x4bb823['transferercalleridname'],'transfererconnectedlinenum':_0x4bb823['transfererconnectedlinenum'],'transfererconnectedlinename':_0x4bb823[_0xa7a2('0x5')],'transfereraccountcode':_0x4bb823['transfereraccountcode'],'transferercontext':_0x4bb823[_0xa7a2('0x6')],'transfererexten':_0x4bb823[_0xa7a2('0x7')],'transfererlinkedid':_0x4bb823[_0xa7a2('0x8')],'transfereechannel':_0x4bb823[_0xa7a2('0x9')],'transfereecalleridnum':_0x4bb823[_0xa7a2('0xa')],'transfereecalleridname':_0x4bb823[_0xa7a2('0xb')],'transfereeconnectedlinenum':_0x4bb823['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x4bb823[_0xa7a2('0xc')],'transfereeaccountcode':_0x4bb823[_0xa7a2('0xd')],'transfereecontext':_0x4bb823['transfereecontext'],'transfereeexten':_0x4bb823[_0xa7a2('0xe')],'transfereelinkedid':_0x4bb823[_0xa7a2('0xf')],'isexternal':_0x4bb823[_0xa7a2('0x10')],'context':_0x4bb823[_0xa7a2('0x11')],'extension':_0x4bb823[_0xa7a2('0x12')],'type':'blind'},'log':_0xa7a2('0x3')});};exports[_0xa7a2('0x13')]=function(_0x4931a1){return client[_0xa7a2('0x2')](_0xa7a2('0x3'),{'body':{'result':_0x4931a1[_0xa7a2('0x14')],'transfererchannel':_0x4931a1[_0xa7a2('0x15')],'transferercalleridnum':_0x4931a1[_0xa7a2('0x16')],'transferercalleridname':_0x4931a1[_0xa7a2('0x17')],'transfererconnectedlinenum':_0x4931a1['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x4931a1[_0xa7a2('0x18')],'transfereraccountcode':_0x4931a1[_0xa7a2('0x19')],'transferercontext':_0x4931a1[_0xa7a2('0x1a')],'transfererexten':_0x4931a1[_0xa7a2('0x1b')],'transfererlinkedid':_0x4931a1[_0xa7a2('0x1c')],'transfereechannel':_0x4931a1[_0xa7a2('0x1d')],'transfereecalleridnum':_0x4931a1[_0xa7a2('0x1e')],'transfereecalleridname':_0x4931a1[_0xa7a2('0x1f')],'transfereeconnectedlinenum':_0x4931a1['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4931a1[_0xa7a2('0x20')],'transfereeaccountcode':_0x4931a1[_0xa7a2('0x21')],'transfereecontext':_0x4931a1[_0xa7a2('0x22')],'transfereeexten':_0x4931a1[_0xa7a2('0x23')],'transfereelinkedid':_0x4931a1[_0xa7a2('0x24')],'isexternal':_0x4931a1['isexternal'],'context':_0x4931a1[_0xa7a2('0x25')],'extension':_0x4931a1['origtransfererexten'],'type':_0xa7a2('0x26')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x6a29=['../client','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','origtransferercontext','origtransfererexten'];(function(_0x10165c,_0x5ad2b4){var _0x454073=function(_0x3ca33c){while(--_0x3ca33c){_0x10165c['push'](_0x10165c['shift']());}};_0x454073(++_0x5ad2b4);}(_0x6a29,0x9c));var _0x96a2=function(_0x20f5bb,_0x4538ed){_0x20f5bb=_0x20f5bb-0x0;var _0x22c379=_0x6a29[_0x20f5bb];return _0x22c379;};'use strict';var client=require(_0x96a2('0x0'));exports['blindTransfer']=function(_0x256733){return client['Request'](_0x96a2('0x1'),{'body':{'result':_0x256733[_0x96a2('0x2')],'transfererchannel':_0x256733[_0x96a2('0x3')],'transferercalleridnum':_0x256733[_0x96a2('0x4')],'transferercalleridname':_0x256733['transferercalleridname'],'transfererconnectedlinenum':_0x256733[_0x96a2('0x5')],'transfererconnectedlinename':_0x256733[_0x96a2('0x6')],'transfereraccountcode':_0x256733[_0x96a2('0x7')],'transferercontext':_0x256733[_0x96a2('0x8')],'transfererexten':_0x256733[_0x96a2('0x9')],'transfererlinkedid':_0x256733[_0x96a2('0xa')],'transfereechannel':_0x256733[_0x96a2('0xb')],'transfereecalleridnum':_0x256733[_0x96a2('0xc')],'transfereecalleridname':_0x256733[_0x96a2('0xd')],'transfereeconnectedlinenum':_0x256733['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x256733[_0x96a2('0xe')],'transfereeaccountcode':_0x256733[_0x96a2('0xf')],'transfereecontext':_0x256733[_0x96a2('0x10')],'transfereeexten':_0x256733[_0x96a2('0x11')],'transfereelinkedid':_0x256733[_0x96a2('0x12')],'isexternal':_0x256733[_0x96a2('0x13')],'context':_0x256733[_0x96a2('0x14')],'extension':_0x256733['extension'],'type':_0x96a2('0x15')},'log':'CreateVoiceTransferReport'});};exports[_0x96a2('0x16')]=function(_0xb7a01e){return client[_0x96a2('0x17')](_0x96a2('0x1'),{'body':{'result':_0xb7a01e[_0x96a2('0x2')],'transfererchannel':_0xb7a01e[_0x96a2('0x18')],'transferercalleridnum':_0xb7a01e[_0x96a2('0x19')],'transferercalleridname':_0xb7a01e[_0x96a2('0x1a')],'transfererconnectedlinenum':_0xb7a01e['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xb7a01e[_0x96a2('0x1b')],'transfereraccountcode':_0xb7a01e[_0x96a2('0x1c')],'transferercontext':_0xb7a01e[_0x96a2('0x1d')],'transfererexten':_0xb7a01e[_0x96a2('0x1e')],'transfererlinkedid':_0xb7a01e[_0x96a2('0x1f')],'transfereechannel':_0xb7a01e[_0x96a2('0x20')],'transfereecalleridnum':_0xb7a01e[_0x96a2('0x21')],'transfereecalleridname':_0xb7a01e[_0x96a2('0x22')],'transfereeconnectedlinenum':_0xb7a01e[_0x96a2('0x23')],'transfereeconnectedlinename':_0xb7a01e['transfertargetconnectedlinename'],'transfereeaccountcode':_0xb7a01e[_0x96a2('0x24')],'transfereecontext':_0xb7a01e['transfertargetcontext'],'transfereeexten':_0xb7a01e['transfertargetexten'],'transfereelinkedid':_0xb7a01e['transfertargetlinkedid'],'isexternal':_0xb7a01e[_0x96a2('0x13')],'context':_0xb7a01e[_0x96a2('0x25')],'extension':_0xb7a01e[_0x96a2('0x26')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index a59228f..b2b8033 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 _0x8d68=['moment','../properties','../ami','listen','SIP','timers','updateAcw','agents','updateStatusRealtime','QueuePause','asterisk','ami\x20disconnected','pick','keys','module','action','then','message','catch','error','isConnected','join','Action','content','voiceQueues','hasOwnProperty','name','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','callerid','Interval','push','length','values','channels','voicechannel','map','find','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','username','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird'];(function(_0x1beb12,_0x560b2e){var _0xba2016=function(_0x3682d2){while(--_0x3682d2){_0x1beb12['push'](_0x1beb12['shift']());}};_0xba2016(++_0x560b2e);}(_0x8d68,0x18a));var _0x88d6=function(_0x25beb4,_0x18fd6d){_0x25beb4=_0x25beb4-0x0;var _0x46a30f=_0x8d68[_0x25beb4];return _0x46a30f;};'use strict';var _=require(_0x88d6('0x0'));var util=require(_0x88d6('0x1'));var jayson=require(_0x88d6('0x2'));var schema=require(_0x88d6('0x3'));var BPromise=require(_0x88d6('0x4'));var moment=require(_0x88d6('0x5'));var config=require('../../../config/environment');var properties=require(_0x88d6('0x6'));var ami=require(_0x88d6('0x7'));exports[_0x88d6('0x8')]=function(_0xacc7c,_0x8ed65f,_0x207613){return new BPromise(function(_0x176d57,_0x386362){var _0x4f0d52={'QueuePause':function(_0x5d015d){return new Promise(function(_0x597943,_0x2faef0){var _0xb12af3=util['format']('%s/%s',_0x88d6('0x9'),_0x5d015d['name']);if(_0xacc7c[_0x88d6('0xa')]&&_0xacc7c['timers'][_0xb12af3]&&_0xacc7c['timers'][_0xb12af3]['timer']){_0xacc7c[_0x88d6('0xa')][_0xb12af3][_0x88d6('0xb')]();}if(_0xacc7c['agents'][_0xb12af3]){_0xacc7c[_0x88d6('0xc')][_0xb12af3][_0x88d6('0xd')]({'statePause':_0x5d015d['pause']?!![]:![]});}_0x597943({'code':0xc8,'message':_0x88d6('0xe')});});},'Reload':function(_0x2b99e1){var _0x38bbd7=this;return new Promise(function(_0x509b16,_0x123bce){if(ami['isConnected']()==![]){return _0x123bce(_0x38bbd7['error'](0x1f4,[config[_0x88d6('0xf')]['ip'],config[_0x88d6('0xf')]['username'],_0x88d6('0x10')]['join']('\x20')));}_0x2b99e1=_[_0x88d6('0x11')](_0x2b99e1,_[_0x88d6('0x12')](properties[_0x88d6('0x13')]));_0x2b99e1[_0x88d6('0x14')]='Reload';return ami['Action'](_0x2b99e1)[_0x88d6('0x15')](function(_0x2f763a){_0x509b16({'code':0xc8,'message':_0x2f763a[_0x88d6('0x16')]});})[_0x88d6('0x17')](function(_0x48ba1e){_0x123bce(_0x38bbd7[_0x88d6('0x18')](0x1f5,_0x48ba1e[_0x88d6('0x16')]));});});},'Command':function(_0x13957b){var _0x329bd8=this;return new Promise(function(_0x115ec9,_0x2b0916){if(ami[_0x88d6('0x19')]()==![]){return _0x2b0916(_0x329bd8[_0x88d6('0x18')](0x1f4,[config[_0x88d6('0xf')]['ip'],config[_0x88d6('0xf')]['username'],_0x88d6('0x10')][_0x88d6('0x1a')]('\x20')));}_0x13957b=_['pick'](_0x13957b,'command');_0x13957b['action']='Command';return ami[_0x88d6('0x1b')](_0x13957b)[_0x88d6('0x15')](function(_0x1291b0){_0x115ec9({'code':0xc8,'message':_0x1291b0[_0x88d6('0x1c')]});})[_0x88d6('0x17')](function(_0x1e11ca){_0x2b0916(_0x329bd8[_0x88d6('0x18')](0x1f5,_0x1e11ca['message']));});});},'VoiceQueues':function(_0x55da65){return new Promise(function(_0x3cd0bb,_0x43bae8){var _0x452a8c=[];for(var _0x3d4d2d in _0xacc7c[_0x88d6('0x1d')]){if(_0xacc7c['voiceQueues'][_0x88d6('0x1e')](_0x3d4d2d)){var _0x427067=_0xacc7c[_0x88d6('0x1d')][_0x3d4d2d];var _0x46fa98={'id':_0x427067['id'],'name':_0x427067[_0x88d6('0x1f')],'strategy':_0x427067['strategy'],'answered':_0x427067[_0x88d6('0x20')],'available':_0x427067[_0x88d6('0x21')],'loggedIn':_0x427067[_0x88d6('0x22')],'pTalking':_0x427067[_0x88d6('0x23')],'sumBillable':_0x427067[_0x88d6('0x24')],'sumDuration':_0x427067[_0x88d6('0x25')],'sumHoldTime':_0x427067[_0x88d6('0x26')]||0x0,'talking':_0x427067[_0x88d6('0x27')],'total':_0x427067[_0x88d6('0x28')],'type':_0x427067[_0x88d6('0x29')],'unmanaged':_0x427067['unmanaged'],'abandoned':_0x427067[_0x88d6('0x2a')],'waiting':_0x427067[_0x88d6('0x2b')],'loggedInDb':_0x427067[_0x88d6('0x2c')]};if(_0x427067['type']===_0x88d6('0x2d')){_0x46fa98[_0x88d6('0x2e')]=_0x427067[_0x88d6('0x2e')];_0x46fa98[_0x88d6('0x2f')]=_0x427067[_0x88d6('0x2f')];_0x46fa98[_0x88d6('0x30')]=_0x427067['dialOriginateCallerIdName'];_0x46fa98[_0x88d6('0x31')]=_0x427067[_0x88d6('0x31')];_0x46fa98['dialOriginateTimeout']=_0x427067[_0x88d6('0x32')];_0x46fa98[_0x88d6('0x33')]=_0x427067[_0x88d6('0x33')];_0x46fa98['outboundAnswerAgiCallsDay']=_0x427067[_0x88d6('0x34')];_0x46fa98['outboundAnswerCallsDay']=_0x427067[_0x88d6('0x35')];_0x46fa98[_0x88d6('0x36')]=_0x427067[_0x88d6('0x36')];_0x46fa98[_0x88d6('0x37')]=_0x427067['outboundBusyCallsDay'];_0x46fa98[_0x88d6('0x38')]=_0x427067[_0x88d6('0x38')];_0x46fa98[_0x88d6('0x39')]=_0x427067[_0x88d6('0x39')];_0x46fa98[_0x88d6('0x3a')]=_0x427067['outboundDropCallsDayCallersExit'];_0x46fa98[_0x88d6('0x3b')]=_0x427067['outboundDropCallsDayTimeout'];_0x46fa98[_0x88d6('0x3c')]=_0x427067[_0x88d6('0x3c')];_0x46fa98[_0x88d6('0x3d')]=_0x427067['outboundNoSuchCallsDay'];_0x46fa98[_0x88d6('0x3e')]=_0x427067[_0x88d6('0x3e')];_0x46fa98[_0x88d6('0x3f')]=_0x427067[_0x88d6('0x3f')];_0x46fa98[_0x88d6('0x40')]=_0x427067[_0x88d6('0x40')];_0x46fa98[_0x88d6('0x41')]=_0x427067[_0x88d6('0x41')];_0x46fa98[_0x88d6('0x42')]=_0x427067['predictiveIntervalAnsweredCalls'];_0x46fa98['predictiveIntervalAvgHoldtime']=_0x427067[_0x88d6('0x43')];_0x46fa98['predictiveIntervalAvgTalktime']=_0x427067[_0x88d6('0x44')];_0x46fa98[_0x88d6('0x45')]=_0x427067[_0x88d6('0x45')];_0x46fa98[_0x88d6('0x46')]=_0x427067['predictiveIntervalDroppedCallsTimeout'];_0x46fa98[_0x88d6('0x47')]=_0x427067[_0x88d6('0x47')];_0x46fa98[_0x88d6('0x48')]=_0x427067[_0x88d6('0x48')];_0x46fa98[_0x88d6('0x49')]=_0x427067[_0x88d6('0x49')];_0x46fa98[_0x88d6('0x4a')]=_0x427067['predictiveIntervalLowerLimit'];_0x46fa98[_0x88d6('0x4b')]=_0x427067[_0x88d6('0x4b')];_0x46fa98[_0x88d6('0x4c')]=_0x427067['predictiveIntervalPauses'];_0x46fa98['predictiveIntervalTotalCalls']=_0x427067[_0x88d6('0x4d')];_0x46fa98[_0x88d6('0x16')]=_0x427067[_0x88d6('0x16')];_0x46fa98[_0x88d6('0x4e')]=_0x427067['originated'];}if(_0x427067[_0x88d6('0x4f')]){_0x46fa98[_0x88d6('0x4f')]={'id':_0x427067[_0x88d6('0x4f')]['id'],'name':_0x427067['Trunk'][_0x88d6('0x1f')],'active':_0x427067[_0x88d6('0x4f')][_0x88d6('0x50')],'callerid':_0x427067[_0x88d6('0x4f')][_0x88d6('0x51')]};}if(_0x427067[_0x88d6('0x52')]){_0x46fa98[_0x88d6('0x52')]={'id':_0x427067[_0x88d6('0x52')]['id'],'name':_0x427067[_0x88d6('0x52')][_0x88d6('0x1f')]};}_0x452a8c[_0x88d6('0x53')](_0x46fa98);}}_0x3cd0bb({'count':_0x452a8c[_0x88d6('0x54')],'rows':_0x452a8c});});},'VoiceChannels':function(_0x131c62){return new Promise(function(_0x375c5e,_0x2ed3f8){var _0x12c097=_[_0x88d6('0x55')](_0xacc7c[_0x88d6('0x56')]);_0x375c5e({'count':_0x12c097['length'],'rows':_0x12c097});});},'VoiceChannelMixMonitor':function(_0x5c7646){var _0x384d22=this;return new Promise(function(_0x162135,_0x6a7ef6){if(ami['isConnected']()==![]){return _0x6a7ef6(_0x384d22['error'](0x1f4,[config[_0x88d6('0xf')]['ip'],config[_0x88d6('0xf')]['username'],_0x88d6('0x10')][_0x88d6('0x1a')]('\x20')));}var _0x2e3a4b=schema(properties[_0x88d6('0x57')])['validate'](_0x5c7646);if(_0x2e3a4b[_0x88d6('0x54')]>0x0){return _0x6a7ef6(_0x384d22['error'](0x1f4,_[_0x88d6('0x58')](_0x2e3a4b,_0x88d6('0x16'))['join'](',\x20')));}var _0x11a02b=_[_0x88d6('0x59')](_0xacc7c[_0x88d6('0x56')],{'uniqueid':_0x5c7646[_0x88d6('0x5a')]});if(_0x11a02b&&_0x11a02b[_0x88d6('0x5b')]){var _0x5e2857=util[_0x88d6('0x5c')](_0x88d6('0x5d'),_0x5c7646[_0x88d6('0x5e')]||_0x5c7646[_0x88d6('0x5a')],_0x5c7646[_0x88d6('0x5c')]||_0x88d6('0x5f'));return ami['Action']({'action':_0x88d6('0x60'),'channel':_0x11a02b[_0x88d6('0x5b')],'file':_0x5e2857,'options':'ai(mixmonitorid)'})['then'](function(_0x54aaa1){var _0x2f0a96=_['find'](_0x11a02b[_0x88d6('0x61')],{'filename':_0x88d6('0x62')+_0x5e2857[_0x88d6('0x63')]()});if(_['isNil'](_0x2f0a96)){_0x11a02b[_0x88d6('0x61')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x5e2857[_0x88d6('0x63')](),'createdAt':moment()[_0x88d6('0x5c')](_0x88d6('0x64')),'mixmonitorid':_0x54aaa1[_0x88d6('0x65')],'status':_0x88d6('0x66')});}else{_0x2f0a96['mixmonitorid']=_0x54aaa1[_0x88d6('0x65')];_0x2f0a96[_0x88d6('0x67')]=_0x88d6('0x66');}_0x162135({'code':0xc8,'message':[_0x5c7646[_0x88d6('0x5a')],_0x88d6('0x68'),_0x54aaa1[_0x88d6('0x65')]][_0x88d6('0x1a')]('\x20'),'mixmonitorid':_0x54aaa1[_0x88d6('0x65')]});})['catch'](function(_0x3f9859){_0x6a7ef6(_0x384d22[_0x88d6('0x18')](0x1f5,[_0x5c7646[_0x88d6('0x5a')],_0x3f9859[_0x88d6('0x16')][_0x88d6('0x63')]()][_0x88d6('0x1a')]('\x20')));});}else{return _0x6a7ef6(_0x384d22[_0x88d6('0x18')](0x1f5,_0x88d6('0x69')));}});},'VoiceChannelStopMixMonitor':function(_0x18d971){var _0x1ee442=this;return new Promise(function(_0x37ef92,_0xa16530){if(ami['isConnected']()==![]){return _0xa16530(_0x1ee442[_0x88d6('0x18')](0x1f4,[config[_0x88d6('0xf')]['ip'],config[_0x88d6('0xf')]['username'],'ami\x20disconnected'][_0x88d6('0x1a')]('\x20')));}var _0x516c72=schema(properties['voicechannel'])[_0x88d6('0x3')](_0x18d971);if(_0x516c72[_0x88d6('0x54')]>0x0){return _0xa16530(_0x1ee442[_0x88d6('0x18')](0x1f4,_[_0x88d6('0x58')](_0x516c72,_0x88d6('0x16'))['join'](',\x20')));}var _0x56c9f8=_['find'](_0xacc7c[_0x88d6('0x56')],{'uniqueid':_0x18d971[_0x88d6('0x5a')]});if(_0x56c9f8){return BPromise['resolve']()[_0x88d6('0x15')](function(){if(_0x56c9f8[_0x88d6('0x5b')]){return ami['Action']({'action':_0x88d6('0x6a'),'channel':_0x56c9f8[_0x88d6('0x5b')],'mixmonitorid':_0x18d971['mixmonitorid']})[_0x88d6('0x17')](function(_0x410f21){});}})['then'](function(){if(_0x56c9f8[_0x88d6('0x6b')]){return ami['Action']({'action':_0x88d6('0x6a'),'channel':_0x56c9f8[_0x88d6('0x6b')],'mixmonitorid':_0x18d971[_0x88d6('0x65')]})[_0x88d6('0x17')](function(_0x5cde8a){});}})['then'](function(_0x41075f){var _0x1cfbae=_[_0x88d6('0x59')](_0x56c9f8[_0x88d6('0x61')],{'mixmonitorid':_0x18d971[_0x88d6('0x65')]});if(_0x1cfbae){_0x1cfbae['status']=_0x88d6('0x6c');}})['then'](function(){var _0x44f704=util[_0x88d6('0x5c')](_0x88d6('0x5d'),_0x18d971[_0x88d6('0x5e')]||_0x18d971['uniqueid'],_0x18d971[_0x88d6('0x5c')]||'wav');var _0x8524f4=_['find'](_0x56c9f8[_0x88d6('0x61')],{'filename':_0x88d6('0x62')+_0x44f704[_0x88d6('0x63')]()});if(_0x8524f4){_0x8524f4['status']='stop';}})[_0x88d6('0x15')](function(){_0x37ef92({'code':0xc8,'message':[_0x18d971['uniqueid'],_0x88d6('0x6d')][_0x88d6('0x1a')]('\x20')});})['catch'](function(_0x1b89a2){_0xa16530(_0x1ee442[_0x88d6('0x18')](0x1f5,[_0x18d971[_0x88d6('0x5a')],_0x1b89a2[_0x88d6('0x16')][_0x88d6('0x63')]()][_0x88d6('0x1a')]('\x20')));});}else{return _0xa16530(_0x1ee442[_0x88d6('0x18')](0x1f5,_0x88d6('0x69')));}});},'VoiceQueuesChannels':function(_0xf77b0d){return new Promise(function(_0x32a434,_0xd37e81){var _0x24f7a2=_[_0x88d6('0x55')](_0xacc7c[_0x88d6('0x6e')]);_0x32a434({'count':_0x24f7a2[_0x88d6('0x54')],'rows':_0x24f7a2});});},'VoiceQueuesChannel':function(_0xb5b50a){var _0x7e1637=this;return new Promise(function(_0x5a961d,_0x1b057f){var _0x32156c=schema(properties[_0x88d6('0x6f')])[_0x88d6('0x3')](_0xb5b50a);if(_0x32156c[_0x88d6('0x54')]>0x0){return _0x1b057f(_0x7e1637[_0x88d6('0x18')](0x1f4,_[_0x88d6('0x58')](_0x32156c,_0x88d6('0x16'))[_0x88d6('0x1a')](',\x20')));}var _0x479df8=_[_0x88d6('0x59')](_0xacc7c[_0x88d6('0x6e')],{'uniqueid':_0xb5b50a[_0x88d6('0x5a')]});if(_0x479df8){_0x5a961d(_0x479df8);}else{return _0x1b057f(_0x7e1637['error'](0x1f5,_0x88d6('0x69')));}});},'VoiceQueuesChannelHangup':function(_0x13ec2f){var _0x26449b=this;return new Promise(function(_0xb205d3,_0x1cb20c){if(ami[_0x88d6('0x19')]()==![]){return _0x1cb20c(_0x26449b[_0x88d6('0x18')](0x1f4,[config[_0x88d6('0xf')]['ip'],config[_0x88d6('0xf')][_0x88d6('0x70')],_0x88d6('0x10')][_0x88d6('0x1a')]('\x20')));}var _0x5000bb=schema(properties[_0x88d6('0x71')])[_0x88d6('0x3')](_0x13ec2f);if(_0x5000bb[_0x88d6('0x54')]>0x0){return _0x1cb20c(_0x26449b[_0x88d6('0x18')](0x1f4,_[_0x88d6('0x58')](_0x5000bb,_0x88d6('0x16'))[_0x88d6('0x1a')](',\x20')));}var _0x48ecf0=_['find'](_0xacc7c[_0x88d6('0x6e')],{'uniqueid':_0x13ec2f[_0x88d6('0x5a')]});if(_0x48ecf0&&_0x48ecf0[_0x88d6('0x5b')]){return ami[_0x88d6('0x1b')]({'action':_0x88d6('0x72'),'channel':_0x48ecf0['channel']})['then'](function(_0x4c452c){_0xb205d3({'code':0xc8,'message':[_0x13ec2f[_0x88d6('0x5a')],_0x4c452c[_0x88d6('0x16')][_0x88d6('0x63')]()][_0x88d6('0x1a')]('\x20')});})['catch'](function(_0x5bb780){_0x1cb20c(_0x26449b[_0x88d6('0x18')](0x1f5,[_0x13ec2f['uniqueid'],_0x5bb780[_0x88d6('0x16')][_0x88d6('0x63')]()][_0x88d6('0x1a')]('\x20')));});}else{return _0x1cb20c(_0x26449b[_0x88d6('0x18')](0x1f5,_0x88d6('0x69')));}});},'VoiceQueuesChannelRedirect':function(_0x86cc71){var _0x56d8ac=this;return new Promise(function(_0x3cf6db,_0xeaad6d){if(ami[_0x88d6('0x19')]()==![]){return _0xeaad6d(_0x56d8ac[_0x88d6('0x18')](0x1f4,[config[_0x88d6('0xf')]['ip'],config[_0x88d6('0xf')][_0x88d6('0x70')],_0x88d6('0x10')][_0x88d6('0x1a')]('\x20')));}var _0x51164a=schema(properties[_0x88d6('0x73')])['validate'](_0x86cc71);if(_0x51164a['length']>0x0){return _0xeaad6d(_0x56d8ac['error'](0x1f4,_[_0x88d6('0x58')](_0x51164a,'message')[_0x88d6('0x1a')](',\x20')));}var _0x6cc5e1=_['find'](_0xacc7c[_0x88d6('0x6e')],{'uniqueid':_0x86cc71[_0x88d6('0x5a')]});if(_0x6cc5e1&&_0x6cc5e1['channel']){return ami[_0x88d6('0x1b')]({'action':_0x88d6('0x74'),'channel':_0x6cc5e1[_0x88d6('0x5b')],'exten':_0x86cc71['exten'],'context':_0x86cc71[_0x88d6('0x75')]||_0x6cc5e1[_0x88d6('0x75')],'priority':0x1})[_0x88d6('0x15')](function(_0xc48c50){_0x3cf6db({'code':0xc8,'message':[_0x86cc71['uniqueid'],_0xc48c50[_0x88d6('0x16')][_0x88d6('0x63')]()][_0x88d6('0x1a')]('\x20')});})['catch'](function(_0x196a0b){_0xeaad6d(_0x56d8ac['error'](0x1f5,[_0x86cc71[_0x88d6('0x5a')],_0x196a0b[_0x88d6('0x16')][_0x88d6('0x63')]()][_0x88d6('0x1a')]('\x20')));});}else{return _0xeaad6d(_0x56d8ac[_0x88d6('0x18')](0x1f5,_0x88d6('0x69')));}});},'Agents':function(_0xd391d9){return new Promise(function(_0x4e34ca,_0x40fa46){var _0x5caea6=_[_0x88d6('0x55')](_0xacc7c[_0x88d6('0xc')]);_0x4e34ca({'count':_0x5caea6[_0x88d6('0x54')],'rows':_0x5caea6});});},'Telephones':function(_0xa842a9){return new Promise(function(_0x54f4fa,_0x29a950){var _0x17e844=_[_0x88d6('0x55')](_0xacc7c[_0x88d6('0x76')]);_0x54f4fa({'count':_0x17e844[_0x88d6('0x54')],'rows':_0x17e844});});},'Trunks':function(_0x20cf74){return new Promise(function(_0x4013cb,_0x3cfc28){var _0x25c4e8=_[_0x88d6('0x55')](_0xacc7c[_0x88d6('0x77')]);_0x4013cb({'count':_0x25c4e8[_0x88d6('0x54')],'rows':_0x25c4e8});});},'OutboundChannels':function(_0x3c5030){return new Promise(function(_0x3509fe,_0x1f54d9){var _0x2121a2=_[_0x88d6('0x55')](_0xacc7c[_0x88d6('0x78')]);_0x3509fe({'count':_0x2121a2[_0x88d6('0x54')],'rows':_0x2121a2});});},'Outbound':function(_0x155def){return new Promise(function(_0x216ee3,_0x18e735){_0x216ee3(_0xacc7c[_0x88d6('0x2d')]);});},'Campaigns':function(_0x2cc325){return new Promise(function(_0x473edc,_0x1613b7){var _0x400a69=_[_0x88d6('0x55')](_0xacc7c[_0x88d6('0x79')]);_0x473edc({'count':_0x400a69[_0x88d6('0x54')],'rows':_0x400a69});});},'VoiceQueuesPreview':function(_0x5b521c){var _0x165027=this;return new Promise(function(_0x4a3487,_0x1aa7ec){_0x8ed65f[_0x88d6('0x7a')](_0x5b521c['id'])['then'](function(_0x27ec2e){_0x4a3487({'code':0xc8,'message':_0x27ec2e[_0x88d6('0x16')]});})[_0x88d6('0x17')](function(_0x2a1ec1){_0x1aa7ec(_0x165027[_0x88d6('0x18')](0x1f4,_0x2a1ec1[_0x88d6('0x16')]));});});},'EventManager':function(_0x28ad19){var _0x55f3d9=this;return new Promise(function(_0x238886,_0x2b8c4a){if(!_0x28ad19[_0x88d6('0x7b')]){return _0x2b8c4a(_0x55f3d9[_0x88d6('0x18')](0x1f4,_0x88d6('0x7c')));}ami[_0x88d6('0x7d')](_0x88d6('0x7e')+_0x28ad19[_0x88d6('0x7b')],_0x28ad19['message']);_0x238886({'code':0xc8,'message':_0x28ad19});});},'FaxAccounts':function(_0x53de0d){return new Promise(function(_0x20b279,_0x4c784a){var _0xceaada=_[_0x88d6('0x55')](_0xacc7c['faxAccounts']);_0x20b279({'count':_0xceaada[_0x88d6('0x54')],'rows':_0xceaada});});},'SendFax':function(_0x583992){var _0x1133df=this;return new Promise(function(_0x1c2aaa,_0x40f9e7){_0x207613[_0x88d6('0x7f')](_0x583992)['then'](function(_0x2e99fb){_0x1c2aaa({'code':0xc8,'message':_0x2e99fb[_0x88d6('0x16')]});})[_0x88d6('0x17')](function(_0x2ffe93){_0x40f9e7(_0x1133df[_0x88d6('0x18')](0x1f4,_0x2ffe93[_0x88d6('0x16')]));});});},'CheckAfterSend':function(_0xe600f5){var _0x2e6f2e=this;return new Promise(function(_0x20010b,_0x5cc161){_0x207613[_0x88d6('0x80')](_0xe600f5)[_0x88d6('0x15')](function(_0x4ba56f){_0x20010b({'code':0xc8,'message':_0x4ba56f['message']});})[_0x88d6('0x17')](function(_0x208c9b){_0x5cc161(_0x2e6f2e[_0x88d6('0x18')](0x1f4,_0x208c9b[_0x88d6('0x16')]));});});}};var _0xc6142d=jayson[_0x88d6('0x81')](_0x4f0d52)[_0x88d6('0x82')]();_0xc6142d['on'](_0x88d6('0x18'),function(_0x5052c){return _0x386362(_0x5052c);});_0xc6142d[_0x88d6('0x8')](0x232a,_0x88d6('0x83'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x176d57(_0x88d6('0x84')+0x232a);});});}; \ No newline at end of file +var _0x4b2d=['resolve','StopMixMonitor','destinationchannel','stop','wav','StopMixMonitor\x20Success','queueChannels','username','voicequeuechannelredirect','exten','context','telephones','outbound','campaigns','run','event','emit','send','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','join','pick','module','action','Reload','then','catch','message','isConnected','ami\x20disconnected','Command','voiceQueues','hasOwnProperty','strategy','loggedIn','pTalking','sumDuration','talking','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','name','active','callerid','Interval','push','values','channels','voicechannel','length','map','channel','%s.%s','filename','uniqueid','Action','MixMonitor','ai(mixmonitorid)','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist'];(function(_0x4cffbd,_0xa37adc){var _0x36a7fc=function(_0x2f600a){while(--_0x2f600a){_0x4cffbd['push'](_0x4cffbd['shift']());}};_0x36a7fc(++_0xa37adc);}(_0x4b2d,0x96));var _0xd4b2=function(_0x58e8eb,_0x2ac0c7){_0x58e8eb=_0x58e8eb-0x0;var _0x168540=_0x4b2d[_0x58e8eb];return _0x168540;};'use strict';var _=require('lodash');var util=require(_0xd4b2('0x0'));var jayson=require(_0xd4b2('0x1'));var schema=require(_0xd4b2('0x2'));var BPromise=require(_0xd4b2('0x3'));var moment=require('moment');var config=require(_0xd4b2('0x4'));var properties=require(_0xd4b2('0x5'));var ami=require(_0xd4b2('0x6'));exports[_0xd4b2('0x7')]=function(_0x4536c3,_0x7e60c3,_0x3b7afb){return new BPromise(function(_0x24cd0c,_0x10434c){var _0x1bfc2e={'QueuePause':function(_0x11d9d2){return new Promise(function(_0x5b17c9,_0x2b821d){var _0x1b1317=util[_0xd4b2('0x8')](_0xd4b2('0x9'),_0xd4b2('0xa'),_0x11d9d2['name']);if(_0x4536c3[_0xd4b2('0xb')]&&_0x4536c3['timers'][_0x1b1317]&&_0x4536c3[_0xd4b2('0xb')][_0x1b1317][_0xd4b2('0xc')]){_0x4536c3['timers'][_0x1b1317][_0xd4b2('0xd')]();}if(_0x4536c3[_0xd4b2('0xe')][_0x1b1317]){_0x4536c3[_0xd4b2('0xe')][_0x1b1317][_0xd4b2('0xf')]({'statePause':_0x11d9d2[_0xd4b2('0x10')]?!![]:![]});}_0x5b17c9({'code':0xc8,'message':_0xd4b2('0x11')});});},'Reload':function(_0x3728b6){var _0x1627f7=this;return new Promise(function(_0x24d5dc,_0x3b0667){if(ami['isConnected']()==![]){return _0x3b0667(_0x1627f7[_0xd4b2('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xd4b2('0x13')]['username'],'ami\x20disconnected'][_0xd4b2('0x14')]('\x20')));}_0x3728b6=_[_0xd4b2('0x15')](_0x3728b6,_['keys'](properties[_0xd4b2('0x16')]));_0x3728b6[_0xd4b2('0x17')]=_0xd4b2('0x18');return ami['Action'](_0x3728b6)[_0xd4b2('0x19')](function(_0x2bf3d8){_0x24d5dc({'code':0xc8,'message':_0x2bf3d8['message']});})[_0xd4b2('0x1a')](function(_0x4fc390){_0x3b0667(_0x1627f7[_0xd4b2('0x12')](0x1f5,_0x4fc390[_0xd4b2('0x1b')]));});});},'Command':function(_0x43b2c8){var _0x6532e6=this;return new Promise(function(_0x2ae001,_0x39efb1){if(ami[_0xd4b2('0x1c')]()==![]){return _0x39efb1(_0x6532e6[_0xd4b2('0x12')](0x1f4,[config[_0xd4b2('0x13')]['ip'],config[_0xd4b2('0x13')]['username'],_0xd4b2('0x1d')][_0xd4b2('0x14')]('\x20')));}_0x43b2c8=_[_0xd4b2('0x15')](_0x43b2c8,'command');_0x43b2c8[_0xd4b2('0x17')]=_0xd4b2('0x1e');return ami['Action'](_0x43b2c8)['then'](function(_0x3f6bc3){_0x2ae001({'code':0xc8,'message':_0x3f6bc3['content']});})[_0xd4b2('0x1a')](function(_0x3d2301){_0x39efb1(_0x6532e6['error'](0x1f5,_0x3d2301['message']));});});},'VoiceQueues':function(_0x4bcada){return new Promise(function(_0x3e4878,_0x481c01){var _0x8a55be=[];for(var _0x543b41 in _0x4536c3['voiceQueues']){if(_0x4536c3[_0xd4b2('0x1f')][_0xd4b2('0x20')](_0x543b41)){var _0x5568a3=_0x4536c3[_0xd4b2('0x1f')][_0x543b41];var _0x5db1e1={'id':_0x5568a3['id'],'name':_0x5568a3['name'],'strategy':_0x5568a3[_0xd4b2('0x21')],'answered':_0x5568a3['answered'],'available':_0x5568a3['available'],'loggedIn':_0x5568a3[_0xd4b2('0x22')],'pTalking':_0x5568a3[_0xd4b2('0x23')],'sumBillable':_0x5568a3['sumBillable'],'sumDuration':_0x5568a3[_0xd4b2('0x24')],'sumHoldTime':_0x5568a3['sumHoldTime']||0x0,'talking':_0x5568a3[_0xd4b2('0x25')],'total':_0x5568a3[_0xd4b2('0x26')],'type':_0x5568a3[_0xd4b2('0x27')],'unmanaged':_0x5568a3[_0xd4b2('0x28')],'abandoned':_0x5568a3[_0xd4b2('0x29')],'waiting':_0x5568a3[_0xd4b2('0x2a')],'loggedInDb':_0x5568a3['loggedInDb']};if(_0x5568a3['type']==='outbound'){_0x5db1e1[_0xd4b2('0x2b')]=_0x5568a3[_0xd4b2('0x2b')];_0x5db1e1[_0xd4b2('0x2c')]=_0x5568a3[_0xd4b2('0x2c')];_0x5db1e1[_0xd4b2('0x2d')]=_0x5568a3[_0xd4b2('0x2d')];_0x5db1e1['dialOriginateCallerIdNumber']=_0x5568a3[_0xd4b2('0x2e')];_0x5db1e1[_0xd4b2('0x2f')]=_0x5568a3[_0xd4b2('0x2f')];_0x5db1e1[_0xd4b2('0x30')]=_0x5568a3['dialPrefix'];_0x5db1e1[_0xd4b2('0x31')]=_0x5568a3[_0xd4b2('0x31')];_0x5db1e1['outboundAnswerCallsDay']=_0x5568a3[_0xd4b2('0x32')];_0x5db1e1[_0xd4b2('0x33')]=_0x5568a3[_0xd4b2('0x33')];_0x5db1e1[_0xd4b2('0x34')]=_0x5568a3[_0xd4b2('0x34')];_0x5db1e1[_0xd4b2('0x35')]=_0x5568a3['outboundCongestionCallsDay'];_0x5db1e1[_0xd4b2('0x36')]=_0x5568a3[_0xd4b2('0x36')];_0x5db1e1[_0xd4b2('0x37')]=_0x5568a3['outboundDropCallsDayCallersExit'];_0x5db1e1['outboundDropCallsDayTimeout']=_0x5568a3[_0xd4b2('0x38')];_0x5db1e1[_0xd4b2('0x39')]=_0x5568a3['outboundNoAnswerCallsDay'];_0x5db1e1['outboundNoSuchCallsDay']=_0x5568a3['outboundNoSuchCallsDay'];_0x5db1e1['outboundOriginateFailureCallsDay']=_0x5568a3[_0xd4b2('0x3a')];_0x5db1e1[_0xd4b2('0x3b')]=_0x5568a3['outboundReCallsDay'];_0x5db1e1['outboundRejectCallsDay']=_0x5568a3[_0xd4b2('0x3c')];_0x5db1e1[_0xd4b2('0x3d')]=_0x5568a3[_0xd4b2('0x3d')];_0x5db1e1[_0xd4b2('0x3e')]=_0x5568a3[_0xd4b2('0x3e')];_0x5db1e1[_0xd4b2('0x3f')]=_0x5568a3['predictiveIntervalAvgHoldtime'];_0x5db1e1[_0xd4b2('0x40')]=_0x5568a3[_0xd4b2('0x40')];_0x5db1e1['predictiveIntervalDroppedCallsCallersExit']=_0x5568a3['predictiveIntervalDroppedCallsCallersExit'];_0x5db1e1[_0xd4b2('0x41')]=_0x5568a3[_0xd4b2('0x41')];_0x5db1e1[_0xd4b2('0x42')]=_0x5568a3['predictiveIntervalErlangCalls'];_0x5db1e1[_0xd4b2('0x43')]=_0x5568a3['predictiveIntervalErlangCallsDroppedCalls'];_0x5db1e1['predictiveIntervalHitRate']=_0x5568a3[_0xd4b2('0x44')];_0x5db1e1[_0xd4b2('0x45')]=_0x5568a3['predictiveIntervalLowerLimit'];_0x5db1e1[_0xd4b2('0x46')]=_0x5568a3['predictiveIntervalMultiplicativeFactor'];_0x5db1e1[_0xd4b2('0x47')]=_0x5568a3[_0xd4b2('0x47')];_0x5db1e1[_0xd4b2('0x48')]=_0x5568a3[_0xd4b2('0x48')];_0x5db1e1[_0xd4b2('0x1b')]=_0x5568a3['message'];_0x5db1e1[_0xd4b2('0x49')]=_0x5568a3[_0xd4b2('0x49')];}if(_0x5568a3[_0xd4b2('0x4a')]){_0x5db1e1[_0xd4b2('0x4a')]={'id':_0x5568a3[_0xd4b2('0x4a')]['id'],'name':_0x5568a3[_0xd4b2('0x4a')][_0xd4b2('0x4b')],'active':_0x5568a3[_0xd4b2('0x4a')][_0xd4b2('0x4c')],'callerid':_0x5568a3[_0xd4b2('0x4a')][_0xd4b2('0x4d')]};}if(_0x5568a3[_0xd4b2('0x4e')]){_0x5db1e1[_0xd4b2('0x4e')]={'id':_0x5568a3[_0xd4b2('0x4e')]['id'],'name':_0x5568a3['Interval'][_0xd4b2('0x4b')]};}_0x8a55be[_0xd4b2('0x4f')](_0x5db1e1);}}_0x3e4878({'count':_0x8a55be['length'],'rows':_0x8a55be});});},'VoiceChannels':function(_0x2032c1){return new Promise(function(_0x25fa2f,_0x69311f){var _0x2fee55=_[_0xd4b2('0x50')](_0x4536c3[_0xd4b2('0x51')]);_0x25fa2f({'count':_0x2fee55['length'],'rows':_0x2fee55});});},'VoiceChannelMixMonitor':function(_0x56ef4e){var _0x49243f=this;return new Promise(function(_0x498ad1,_0x49b602){if(ami[_0xd4b2('0x1c')]()==![]){return _0x49b602(_0x49243f[_0xd4b2('0x12')](0x1f4,[config[_0xd4b2('0x13')]['ip'],config[_0xd4b2('0x13')]['username'],'ami\x20disconnected'][_0xd4b2('0x14')]('\x20')));}var _0x158bbb=schema(properties[_0xd4b2('0x52')])[_0xd4b2('0x2')](_0x56ef4e);if(_0x158bbb[_0xd4b2('0x53')]>0x0){return _0x49b602(_0x49243f['error'](0x1f4,_[_0xd4b2('0x54')](_0x158bbb,_0xd4b2('0x1b'))[_0xd4b2('0x14')](',\x20')));}var _0xcae153=_['find'](_0x4536c3[_0xd4b2('0x51')],{'uniqueid':_0x56ef4e['uniqueid']});if(_0xcae153&&_0xcae153[_0xd4b2('0x55')]){var _0x2243e3=util[_0xd4b2('0x8')](_0xd4b2('0x56'),_0x56ef4e[_0xd4b2('0x57')]||_0x56ef4e[_0xd4b2('0x58')],_0x56ef4e[_0xd4b2('0x8')]||'wav');return ami[_0xd4b2('0x59')]({'action':_0xd4b2('0x5a'),'channel':_0xcae153[_0xd4b2('0x55')],'file':_0x2243e3,'options':_0xd4b2('0x5b')})[_0xd4b2('0x19')](function(_0xb2f7d2){var _0x45ab0c=_[_0xd4b2('0x5c')](_0xcae153[_0xd4b2('0x5d')],{'filename':_0xd4b2('0x5e')+_0x2243e3[_0xd4b2('0x5f')]()});if(_[_0xd4b2('0x60')](_0x45ab0c)){_0xcae153[_0xd4b2('0x5d')][_0xd4b2('0x4f')]({'filename':'/var/spool/asterisk/monitor/'+_0x2243e3[_0xd4b2('0x5f')](),'createdAt':moment()[_0xd4b2('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0xb2f7d2['mixmonitorid'],'status':'rec'});}else{_0x45ab0c[_0xd4b2('0x61')]=_0xb2f7d2[_0xd4b2('0x61')];_0x45ab0c[_0xd4b2('0x62')]=_0xd4b2('0x63');}_0x498ad1({'code':0xc8,'message':[_0x56ef4e[_0xd4b2('0x58')],_0xd4b2('0x64'),_0xb2f7d2[_0xd4b2('0x61')]][_0xd4b2('0x14')]('\x20'),'mixmonitorid':_0xb2f7d2[_0xd4b2('0x61')]});})[_0xd4b2('0x1a')](function(_0x1be0e9){_0x49b602(_0x49243f['error'](0x1f5,[_0x56ef4e[_0xd4b2('0x58')],_0x1be0e9[_0xd4b2('0x1b')][_0xd4b2('0x5f')]()][_0xd4b2('0x14')]('\x20')));});}else{return _0x49b602(_0x49243f[_0xd4b2('0x12')](0x1f5,_0xd4b2('0x65')));}});},'VoiceChannelStopMixMonitor':function(_0x43b6a2){var _0x3362cf=this;return new Promise(function(_0x4e076e,_0x7b3fb1){if(ami[_0xd4b2('0x1c')]()==![]){return _0x7b3fb1(_0x3362cf[_0xd4b2('0x12')](0x1f4,[config[_0xd4b2('0x13')]['ip'],config[_0xd4b2('0x13')]['username'],'ami\x20disconnected'][_0xd4b2('0x14')]('\x20')));}var _0x3df37=schema(properties[_0xd4b2('0x52')])[_0xd4b2('0x2')](_0x43b6a2);if(_0x3df37[_0xd4b2('0x53')]>0x0){return _0x7b3fb1(_0x3362cf[_0xd4b2('0x12')](0x1f4,_[_0xd4b2('0x54')](_0x3df37,_0xd4b2('0x1b'))[_0xd4b2('0x14')](',\x20')));}var _0x548b12=_[_0xd4b2('0x5c')](_0x4536c3[_0xd4b2('0x51')],{'uniqueid':_0x43b6a2[_0xd4b2('0x58')]});if(_0x548b12){return BPromise[_0xd4b2('0x66')]()[_0xd4b2('0x19')](function(){if(_0x548b12[_0xd4b2('0x55')]){return ami[_0xd4b2('0x59')]({'action':_0xd4b2('0x67'),'channel':_0x548b12[_0xd4b2('0x55')],'mixmonitorid':_0x43b6a2[_0xd4b2('0x61')]})[_0xd4b2('0x1a')](function(_0x1be079){});}})[_0xd4b2('0x19')](function(){if(_0x548b12[_0xd4b2('0x68')]){return ami[_0xd4b2('0x59')]({'action':'StopMixMonitor','channel':_0x548b12['destinationchannel'],'mixmonitorid':_0x43b6a2[_0xd4b2('0x61')]})[_0xd4b2('0x1a')](function(_0x1937c6){});}})[_0xd4b2('0x19')](function(_0x418574){var _0x346f20=_[_0xd4b2('0x5c')](_0x548b12[_0xd4b2('0x5d')],{'mixmonitorid':_0x43b6a2[_0xd4b2('0x61')]});if(_0x346f20){_0x346f20[_0xd4b2('0x62')]=_0xd4b2('0x69');}})[_0xd4b2('0x19')](function(){var _0x541ead=util[_0xd4b2('0x8')](_0xd4b2('0x56'),_0x43b6a2[_0xd4b2('0x57')]||_0x43b6a2[_0xd4b2('0x58')],_0x43b6a2[_0xd4b2('0x8')]||_0xd4b2('0x6a'));var _0x47c139=_[_0xd4b2('0x5c')](_0x548b12['monitors'],{'filename':_0xd4b2('0x5e')+_0x541ead[_0xd4b2('0x5f')]()});if(_0x47c139){_0x47c139['status']=_0xd4b2('0x69');}})['then'](function(){_0x4e076e({'code':0xc8,'message':[_0x43b6a2[_0xd4b2('0x58')],_0xd4b2('0x6b')][_0xd4b2('0x14')]('\x20')});})[_0xd4b2('0x1a')](function(_0x25a511){_0x7b3fb1(_0x3362cf[_0xd4b2('0x12')](0x1f5,[_0x43b6a2[_0xd4b2('0x58')],_0x25a511[_0xd4b2('0x1b')][_0xd4b2('0x5f')]()][_0xd4b2('0x14')]('\x20')));});}else{return _0x7b3fb1(_0x3362cf[_0xd4b2('0x12')](0x1f5,_0xd4b2('0x65')));}});},'VoiceQueuesChannels':function(_0x3d81f7){return new Promise(function(_0x3d62f3,_0x33a601){var _0x2dd681=_[_0xd4b2('0x50')](_0x4536c3[_0xd4b2('0x6c')]);_0x3d62f3({'count':_0x2dd681[_0xd4b2('0x53')],'rows':_0x2dd681});});},'VoiceQueuesChannel':function(_0x41c634){var _0x5dfcdc=this;return new Promise(function(_0x3c8dfa,_0x259940){var _0x1abe4e=schema(properties['voicequeuechannel'])[_0xd4b2('0x2')](_0x41c634);if(_0x1abe4e['length']>0x0){return _0x259940(_0x5dfcdc[_0xd4b2('0x12')](0x1f4,_['map'](_0x1abe4e,'message')[_0xd4b2('0x14')](',\x20')));}var _0x14bdd3=_[_0xd4b2('0x5c')](_0x4536c3[_0xd4b2('0x6c')],{'uniqueid':_0x41c634['uniqueid']});if(_0x14bdd3){_0x3c8dfa(_0x14bdd3);}else{return _0x259940(_0x5dfcdc[_0xd4b2('0x12')](0x1f5,_0xd4b2('0x65')));}});},'VoiceQueuesChannelHangup':function(_0x516524){var _0x222f7f=this;return new Promise(function(_0x2b7119,_0x3ed4f6){if(ami[_0xd4b2('0x1c')]()==![]){return _0x3ed4f6(_0x222f7f[_0xd4b2('0x12')](0x1f4,[config[_0xd4b2('0x13')]['ip'],config[_0xd4b2('0x13')][_0xd4b2('0x6d')],'ami\x20disconnected'][_0xd4b2('0x14')]('\x20')));}var _0x36f8a2=schema(properties['voicequeuechannelhangup'])['validate'](_0x516524);if(_0x36f8a2[_0xd4b2('0x53')]>0x0){return _0x3ed4f6(_0x222f7f[_0xd4b2('0x12')](0x1f4,_[_0xd4b2('0x54')](_0x36f8a2,_0xd4b2('0x1b'))[_0xd4b2('0x14')](',\x20')));}var _0x5d2938=_[_0xd4b2('0x5c')](_0x4536c3[_0xd4b2('0x6c')],{'uniqueid':_0x516524[_0xd4b2('0x58')]});if(_0x5d2938&&_0x5d2938[_0xd4b2('0x55')]){return ami[_0xd4b2('0x59')]({'action':'Hangup','channel':_0x5d2938[_0xd4b2('0x55')]})['then'](function(_0x3d21da){_0x2b7119({'code':0xc8,'message':[_0x516524[_0xd4b2('0x58')],_0x3d21da[_0xd4b2('0x1b')]['toLowerCase']()]['join']('\x20')});})[_0xd4b2('0x1a')](function(_0x3c17eb){_0x3ed4f6(_0x222f7f[_0xd4b2('0x12')](0x1f5,[_0x516524[_0xd4b2('0x58')],_0x3c17eb['message'][_0xd4b2('0x5f')]()][_0xd4b2('0x14')]('\x20')));});}else{return _0x3ed4f6(_0x222f7f[_0xd4b2('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x544788){var _0x5b2f2d=this;return new Promise(function(_0xd09f60,_0x2c50b6){if(ami[_0xd4b2('0x1c')]()==![]){return _0x2c50b6(_0x5b2f2d['error'](0x1f4,[config[_0xd4b2('0x13')]['ip'],config[_0xd4b2('0x13')][_0xd4b2('0x6d')],_0xd4b2('0x1d')][_0xd4b2('0x14')]('\x20')));}var _0x2d8f54=schema(properties[_0xd4b2('0x6e')])[_0xd4b2('0x2')](_0x544788);if(_0x2d8f54[_0xd4b2('0x53')]>0x0){return _0x2c50b6(_0x5b2f2d[_0xd4b2('0x12')](0x1f4,_[_0xd4b2('0x54')](_0x2d8f54,_0xd4b2('0x1b'))[_0xd4b2('0x14')](',\x20')));}var _0x1e87b0=_[_0xd4b2('0x5c')](_0x4536c3[_0xd4b2('0x6c')],{'uniqueid':_0x544788[_0xd4b2('0x58')]});if(_0x1e87b0&&_0x1e87b0['channel']){return ami[_0xd4b2('0x59')]({'action':'Redirect','channel':_0x1e87b0[_0xd4b2('0x55')],'exten':_0x544788[_0xd4b2('0x6f')],'context':_0x544788[_0xd4b2('0x70')]||_0x1e87b0[_0xd4b2('0x70')],'priority':0x1})[_0xd4b2('0x19')](function(_0x4b21ff){_0xd09f60({'code':0xc8,'message':[_0x544788[_0xd4b2('0x58')],_0x4b21ff[_0xd4b2('0x1b')][_0xd4b2('0x5f')]()]['join']('\x20')});})[_0xd4b2('0x1a')](function(_0x23cf43){_0x2c50b6(_0x5b2f2d['error'](0x1f5,[_0x544788[_0xd4b2('0x58')],_0x23cf43[_0xd4b2('0x1b')][_0xd4b2('0x5f')]()]['join']('\x20')));});}else{return _0x2c50b6(_0x5b2f2d[_0xd4b2('0x12')](0x1f5,_0xd4b2('0x65')));}});},'Agents':function(_0x105b37){return new Promise(function(_0x17118a,_0x5349e8){var _0x385865=_[_0xd4b2('0x50')](_0x4536c3['agents']);_0x17118a({'count':_0x385865['length'],'rows':_0x385865});});},'Telephones':function(_0x1f9b3f){return new Promise(function(_0x14e021,_0x1e2ed4){var _0x1516fb=_[_0xd4b2('0x50')](_0x4536c3[_0xd4b2('0x71')]);_0x14e021({'count':_0x1516fb[_0xd4b2('0x53')],'rows':_0x1516fb});});},'Trunks':function(_0xf39864){return new Promise(function(_0x17ef99,_0x3f06d7){var _0x241a3a=_['values'](_0x4536c3['trunks']);_0x17ef99({'count':_0x241a3a[_0xd4b2('0x53')],'rows':_0x241a3a});});},'OutboundChannels':function(_0x30a6d5){return new Promise(function(_0x44a150,_0x5362ac){var _0x3a900b=_[_0xd4b2('0x50')](_0x4536c3['outboundChannels']);_0x44a150({'count':_0x3a900b[_0xd4b2('0x53')],'rows':_0x3a900b});});},'Outbound':function(_0x42647f){return new Promise(function(_0x39b2ab,_0x22c32c){_0x39b2ab(_0x4536c3[_0xd4b2('0x72')]);});},'Campaigns':function(_0x100046){return new Promise(function(_0x1e4286,_0xb183ba){var _0x348d40=_['values'](_0x4536c3[_0xd4b2('0x73')]);_0x1e4286({'count':_0x348d40[_0xd4b2('0x53')],'rows':_0x348d40});});},'VoiceQueuesPreview':function(_0x474090){var _0x512637=this;return new Promise(function(_0x2f1ac2,_0x1cec9b){_0x7e60c3[_0xd4b2('0x74')](_0x474090['id'])[_0xd4b2('0x19')](function(_0x5df4b2){_0x2f1ac2({'code':0xc8,'message':_0x5df4b2[_0xd4b2('0x1b')]});})['catch'](function(_0x1e61a4){_0x1cec9b(_0x512637[_0xd4b2('0x12')](0x1f4,_0x1e61a4['message']));});});},'EventManager':function(_0x3f957e){var _0x491370=this;return new Promise(function(_0x14d64f,_0x5f4479){if(!_0x3f957e[_0xd4b2('0x75')]){return _0x5f4479(_0x491370[_0xd4b2('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xd4b2('0x76')]('custom:'+_0x3f957e[_0xd4b2('0x75')],_0x3f957e[_0xd4b2('0x1b')]);_0x14d64f({'code':0xc8,'message':_0x3f957e});});},'FaxAccounts':function(_0x1e9396){return new Promise(function(_0x440bc2,_0x781040){var _0x537b33=_[_0xd4b2('0x50')](_0x4536c3['faxAccounts']);_0x440bc2({'count':_0x537b33['length'],'rows':_0x537b33});});},'SendFax':function(_0x311280){var _0x56d072=this;return new Promise(function(_0x29cf05,_0x22056a){_0x3b7afb[_0xd4b2('0x77')](_0x311280)[_0xd4b2('0x19')](function(_0x4cbf40){_0x29cf05({'code':0xc8,'message':_0x4cbf40[_0xd4b2('0x1b')]});})['catch'](function(_0x4c4417){_0x22056a(_0x56d072['error'](0x1f4,_0x4c4417[_0xd4b2('0x1b')]));});});},'CheckAfterSend':function(_0x1a28be){var _0x130ef0=this;return new Promise(function(_0x4f0b1b,_0x3f321e){_0x3b7afb[_0xd4b2('0x78')](_0x1a28be)['then'](function(_0x45ef2d){_0x4f0b1b({'code':0xc8,'message':_0x45ef2d[_0xd4b2('0x1b')]});})[_0xd4b2('0x1a')](function(_0x379382){_0x3f321e(_0x130ef0[_0xd4b2('0x12')](0x1f4,_0x379382['message']));});});}};var _0x4f1bbb=jayson[_0xd4b2('0x79')](_0x1bfc2e)[_0xd4b2('0x7a')]();_0x4f1bbb['on'](_0xd4b2('0x12'),function(_0x29da1b){return _0x10434c(_0x29da1b);});_0x4f1bbb[_0xd4b2('0x7')](0x232a,_0xd4b2('0x7b'),function(){console[_0xd4b2('0x7c')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x24cd0c(_0xd4b2('0x7d')+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 b7fe982..22eb201 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 _0xa441=['bluebird','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','stringify','emit','autoCreate','data2','data1','isNil','calleridname','calleridnum','firstName','destcalleridname','','destcalleridnum','uniqueid','phone','then','showContact','omit','xmd-contactid2','format','name','trigger:%s','action','toLowerCase','merge','resolve','createContact','user:%s','catch','error','Error\x20creating\x20contact'];(function(_0x18938b,_0xd5a049){var _0x345131=function(_0x166478){while(--_0x166478){_0x18938b['push'](_0x18938b['shift']());}};_0x345131(++_0xd5a049);}(_0xa441,0x19a));var _0x1a44=function(_0x3f83d1,_0x4a4732){_0x3f83d1=_0x3f83d1-0x0;var _0x506593=_0xa441[_0x3f83d1];return _0x506593;};'use strict';var BPromise=require(_0x1a44('0x0'));var util=require('util');var _=require(_0x1a44('0x1'));var Redis=require(_0x1a44('0x2'));var config=require(_0x1a44('0x3'));var logger=require(_0x1a44('0x4'))(_0x1a44('0x5'));var cmContactRpc=require(_0x1a44('0x6'));config[_0x1a44('0x7')]=_[_0x1a44('0x8')](config[_0x1a44('0x7')],{'host':_0x1a44('0x9'),'port':0x18eb});var io=require(_0x1a44('0xa'))(new Redis(config[_0x1a44('0x7')]));function emit(_0x1f2706,_0x4ddc21,_0x26ea2a){logger['info'](_0x1f2706,_0x4ddc21,JSON[_0x1a44('0xb')](_0x26ea2a));io['to'](_0x1f2706)[_0x1a44('0xc')](_0x4ddc21,_0x26ea2a);}exports['exec']=function(_0x3c61d1,_0xa104fc,_0x1537cb){_0x1537cb[_0x1a44('0xd')]=0x0;if(_0xa104fc[_0x1a44('0xe')]&&parseInt(_0xa104fc[_0x1a44('0xe')],0xa)){var _0x545fef={'ListId':parseInt(_0xa104fc[_0x1a44('0xf')],0xa),'phone':_0x1537cb['calleridnum']};if(_[_0x1a44('0x10')](_0x1537cb['routeId'])){_0x545fef['firstName']=_0x1537cb[_0x1a44('0x11')]&&_0x1537cb[_0x1a44('0x11')]!==''?_0x1537cb[_0x1a44('0x11')]:_0x1537cb[_0x1a44('0x12')]||_0x1537cb['uniqueid'];}else{_0x545fef[_0x1a44('0x13')]=_0x1537cb[_0x1a44('0x14')]&&_0x1537cb[_0x1a44('0x14')]!==_0x1a44('0x15')?_0x1537cb['destcalleridname']:_0x1537cb[_0x1a44('0x16')]||_0x1537cb[_0x1a44('0x17')];_0x545fef[_0x1a44('0x18')]=_0x1537cb[_0x1a44('0x14')]&&_0x1537cb[_0x1a44('0x14')]!==_0x1a44('0x15')?_0x1537cb[_0x1a44('0x14')]:_0x1537cb[_0x1a44('0x16')]||_0x1537cb[_0x1a44('0x17')];}BPromise['resolve']()[_0x1a44('0x19')](cmContactRpc[_0x1a44('0x1a')]({'where':_[_0x1a44('0x1b')](_0x545fef,[_0x1a44('0x13')])}))[_0x1a44('0x19')](function(_0x598741){if(_0x598741){_0x1537cb[_0x1a44('0x1c')]=_0x598741['id'];emit(util[_0x1a44('0x1d')]('user:%s',_0x3c61d1[_0x1a44('0x1e')]),util[_0x1a44('0x1d')](_0x1a44('0x1f'),_0xa104fc[_0x1a44('0x20')][_0x1a44('0x21')]()),_[_0x1a44('0x22')](_0x1537cb,{'ListId':parseInt(_0xa104fc[_0x1a44('0xf')],0xa)}));return;}else{return BPromise[_0x1a44('0x23')]()[_0x1a44('0x19')](cmContactRpc[_0x1a44('0x24')](_0x545fef));}})['then'](function(_0x198087){if(_0x198087){_0x1537cb['xmd-contactid2']=_0x198087['id'];emit(util[_0x1a44('0x1d')](_0x1a44('0x25'),_0x3c61d1[_0x1a44('0x1e')]),util[_0x1a44('0x1d')](_0x1a44('0x1f'),_0xa104fc[_0x1a44('0x20')]['toLowerCase']()),_[_0x1a44('0x22')](_0x1537cb,{'ListId':parseInt(_0xa104fc['data1'],0xa)}));}})[_0x1a44('0x26')](function(_0xd57780){logger[_0x1a44('0x27')](_0x1a44('0x28'),JSON[_0x1a44('0xb')](_0xd57780));});}else{if(_0x3c61d1){emit(util['format'](_0x1a44('0x25'),_0x3c61d1[_0x1a44('0x1e')]),util[_0x1a44('0x1d')](_0x1a44('0x1f'),_0xa104fc['action'][_0x1a44('0x21')]()),_['merge']({'ListId':parseInt(_0xa104fc['data1'],0xa)},_0x1537cb));}}}; \ No newline at end of file +var _0x455e=['name','format','trigger:%s','toLowerCase','merge','xmd-contactid2','action','Error\x20creating\x20contact','bluebird','util','ioredis','trigger','../../rpc/cmContact','defaults','localhost','socket.io-emitter','redis','stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','resolve','then','omit','user:%s'];(function(_0x2703a6,_0x2c1593){var _0x442cd3=function(_0x1e1944){while(--_0x1e1944){_0x2703a6['push'](_0x2703a6['shift']());}};_0x442cd3(++_0x2c1593);}(_0x455e,0x19f));var _0xe455=function(_0x42400d,_0x4049a7){_0x42400d=_0x42400d-0x0;var _0x29eeda=_0x455e[_0x42400d];return _0x29eeda;};'use strict';var BPromise=require(_0xe455('0x0'));var util=require(_0xe455('0x1'));var _=require('lodash');var Redis=require(_0xe455('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xe455('0x3'));var cmContactRpc=require(_0xe455('0x4'));config['redis']=_[_0xe455('0x5')](config['redis'],{'host':_0xe455('0x6'),'port':0x18eb});var io=require(_0xe455('0x7'))(new Redis(config[_0xe455('0x8')]));function emit(_0x5d1a30,_0x1333d5,_0x4b89b6){logger['info'](_0x5d1a30,_0x1333d5,JSON[_0xe455('0x9')](_0x4b89b6));io['to'](_0x5d1a30)[_0xe455('0xa')](_0x1333d5,_0x4b89b6);}exports[_0xe455('0xb')]=function(_0xd1ecd2,_0x288642,_0x25d8f2){_0x25d8f2[_0xe455('0xc')]=0x0;if(_0x288642['data2']&&parseInt(_0x288642[_0xe455('0xd')],0xa)){var _0x439a8f={'ListId':parseInt(_0x288642[_0xe455('0xe')],0xa),'phone':_0x25d8f2[_0xe455('0xf')]};if(_[_0xe455('0x10')](_0x25d8f2[_0xe455('0x11')])){_0x439a8f[_0xe455('0x12')]=_0x25d8f2['calleridname']&&_0x25d8f2[_0xe455('0x13')]!==_0xe455('0x14')?_0x25d8f2['calleridname']:_0x25d8f2[_0xe455('0xf')]||_0x25d8f2[_0xe455('0x15')];}else{_0x439a8f['firstName']=_0x25d8f2[_0xe455('0x16')]&&_0x25d8f2['destcalleridname']!==_0xe455('0x14')?_0x25d8f2['destcalleridname']:_0x25d8f2[_0xe455('0x17')]||_0x25d8f2[_0xe455('0x15')];_0x439a8f[_0xe455('0x18')]=_0x25d8f2[_0xe455('0x16')]&&_0x25d8f2[_0xe455('0x16')]!==_0xe455('0x14')?_0x25d8f2[_0xe455('0x16')]:_0x25d8f2[_0xe455('0x17')]||_0x25d8f2[_0xe455('0x15')];}BPromise[_0xe455('0x19')]()[_0xe455('0x1a')](cmContactRpc['showContact']({'where':_[_0xe455('0x1b')](_0x439a8f,[_0xe455('0x12')])}))[_0xe455('0x1a')](function(_0x1f2beb){if(_0x1f2beb){_0x25d8f2['xmd-contactid2']=_0x1f2beb['id'];emit(util['format'](_0xe455('0x1c'),_0xd1ecd2[_0xe455('0x1d')]),util[_0xe455('0x1e')](_0xe455('0x1f'),_0x288642['action'][_0xe455('0x20')]()),_[_0xe455('0x21')](_0x25d8f2,{'ListId':parseInt(_0x288642[_0xe455('0xe')],0xa)}));return;}else{return BPromise[_0xe455('0x19')]()['then'](cmContactRpc['createContact'](_0x439a8f));}})[_0xe455('0x1a')](function(_0x3f0418){if(_0x3f0418){_0x25d8f2[_0xe455('0x22')]=_0x3f0418['id'];emit(util[_0xe455('0x1e')]('user:%s',_0xd1ecd2['name']),util['format']('trigger:%s',_0x288642[_0xe455('0x23')][_0xe455('0x20')]()),_[_0xe455('0x21')](_0x25d8f2,{'ListId':parseInt(_0x288642[_0xe455('0xe')],0xa)}));}})['catch'](function(_0x218916){logger['error'](_0xe455('0x24'),JSON[_0xe455('0x9')](_0x218916));});}else{if(_0xd1ecd2){emit(util[_0xe455('0x1e')]('user:%s',_0xd1ecd2[_0xe455('0x1d')]),util[_0xe455('0x1e')](_0xe455('0x1f'),_0x288642[_0xe455('0x23')][_0xe455('0x20')]()),_[_0xe455('0x21')]({'ListId':parseInt(_0x288642[_0xe455('0xe')],0xa)},_0x25d8f2));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index b120887..7c579f8 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 _0xbdb7=['./cmContact','../rpc/cmContact','../../../config/logger','redis','defaults','socket.io-emitter','popup','winapp','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','salesforceAccounts','bind','custom:agentconnect','custom:agentringnoanswer','syncCustomEvent','custom:agentcomplete','custom:queuecallerabandon','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','checkTriggers','hasOwnProperty','checkTrigger','merge','Actions','length','agents','interface','action','toLowerCase','contactmanager','motionbar','browser','TemplateId','data2','html','template\x20not\x20found','uri','isNil','data3','data4','location','uriLocation','data5','800','windowHeight','data6','winApplication','render','winArguments','format','user:%s','name','trigger:%s','exec','integration','queue','routeId','urlforward','buildUri','query','search','every','channel','AnyConditions','some','checkConditions','field','chat','ChatWebsiteId','value','AccountId','upperFirst','message','operator','event','lastevent','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration'];(function(_0x573773,_0x36caa2){var _0x2b56af=function(_0x257dac){while(--_0x257dac){_0x573773['push'](_0x573773['shift']());}};_0x2b56af(++_0x36caa2);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x478de7,_0x3deb50){_0x478de7=_0x478de7-0x0;var _0x290cbd=_0xbdb7[_0x478de7];return _0x290cbd;};'use strict';var util=require(_0x7bdb('0x0'));var _=require(_0x7bdb('0x1'));var url=require(_0x7bdb('0x2'));var Mustache=require(_0x7bdb('0x3'));var Redis=require(_0x7bdb('0x4'));var urlforward=require(_0x7bdb('0x5'));var integration=require(_0x7bdb('0x6'));var cmContact=require(_0x7bdb('0x7'));var cmContactRpc=require(_0x7bdb('0x8'));var config=require('../../../config/environment');var logger=require(_0x7bdb('0x9'))('trigger');var ami=require('../ami');config[_0x7bdb('0xa')]=_[_0x7bdb('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7bdb('0xc'))(new Redis(config[_0x7bdb('0xa')]));var operators={'equals':function(_0x530f81,_0x4a3116){return _0x530f81==_0x4a3116;},'not_equals':function(_0xdc2ffc,_0x1a6b61){return _0xdc2ffc!=_0x1a6b61;}};var barAndWebActions=[_0x7bdb('0xd'),_0x7bdb('0x2'),_0x7bdb('0xe')];function Trigger(_0x144ff7){this[_0x7bdb('0xf')]=_0x144ff7[_0x7bdb('0xf')];this['agents']=_0x144ff7['agents'];this['voiceQueues']=_0x144ff7[_0x7bdb('0x10')];this[_0x7bdb('0x11')]=_0x144ff7['templates'];this[_0x7bdb('0x12')]=_0x144ff7['voiceExtensions'];this['zendeskAccounts']=_0x144ff7[_0x7bdb('0x13')];this[_0x7bdb('0x14')]=_0x144ff7['freshdeskAccounts'];this['salesforceAccounts']=_0x144ff7['salesforceAccounts'];this[_0x7bdb('0x15')]=_0x144ff7[_0x7bdb('0x15')];this[_0x7bdb('0x16')]=_0x144ff7[_0x7bdb('0x16')];this[_0x7bdb('0x17')]=_0x144ff7[_0x7bdb('0x17')];this[_0x7bdb('0x18')]=_0x144ff7[_0x7bdb('0x18')];this['servicenowAccounts']=_0x144ff7[_0x7bdb('0x19')];this[_0x7bdb('0x1a')]=_0x144ff7[_0x7bdb('0x1a')];this[_0x7bdb('0x1b')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x7bdb('0x1c')],'freshdesk':this[_0x7bdb('0x14')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x7bdb('0x16')],'desk':this[_0x7bdb('0x17')],'vtiger':this[_0x7bdb('0x18')],'servicenow':this[_0x7bdb('0x19')],'dynamics365':this[_0x7bdb('0x1a')]};ami['on']('custom:agentcalled',this['syncCustomEvent'][_0x7bdb('0x1d')](this));ami['on'](_0x7bdb('0x1e'),this['syncCustomEvent'][_0x7bdb('0x1d')](this));ami['on'](_0x7bdb('0x1f'),this[_0x7bdb('0x20')][_0x7bdb('0x1d')](this));ami['on'](_0x7bdb('0x21'),this['syncCustomEvent'][_0x7bdb('0x1d')](this));ami['on'](_0x7bdb('0x22'),this[_0x7bdb('0x20')][_0x7bdb('0x1d')](this));ami['on']('custom:dialbegin',this['syncCustomEvent'][_0x7bdb('0x1d')](this));ami['on']('custom:dialconnect',this['syncCustomEvent']['bind'](this));ami['on'](_0x7bdb('0x23'),this['syncCustomEvent'][_0x7bdb('0x1d')](this));ami['on'](_0x7bdb('0x24'),this[_0x7bdb('0x20')][_0x7bdb('0x1d')](this));ami['on'](_0x7bdb('0x25'),this['syncCustomEvent'][_0x7bdb('0x1d')](this));ami['on'](_0x7bdb('0x26'),this[_0x7bdb('0x20')][_0x7bdb('0x1d')](this));ami['on'](_0x7bdb('0x27'),this[_0x7bdb('0x20')][_0x7bdb('0x1d')](this));ami['on'](_0x7bdb('0x28'),this[_0x7bdb('0x20')][_0x7bdb('0x1d')](this));ami['on'](_0x7bdb('0x29'),this[_0x7bdb('0x20')]['bind'](this));}Trigger[_0x7bdb('0x2a')][_0x7bdb('0x2b')]=function(_0x8f7672,_0x9f5c1,_0x29eac5){logger['info'](_0x8f7672,_0x9f5c1,JSON[_0x7bdb('0x2c')](_0x29eac5));io['to'](_0x8f7672)[_0x7bdb('0x2b')](_0x9f5c1,_0x29eac5);};Trigger[_0x7bdb('0x2a')][_0x7bdb('0x20')]=function(_0x58c6b7){var _0x4f43b9=_['clone'](_0x58c6b7);this[_0x7bdb('0x2d')](_0x4f43b9);};Trigger['prototype'][_0x7bdb('0x2d')]=function(_0x4cfb77){var _0x23e5b2;for(var _0x438ee5 in this[_0x7bdb('0xf')]){if(this['triggers'][_0x7bdb('0x2e')](_0x438ee5)){if(this['triggers'][_0x438ee5]['status']){_0x23e5b2=this[_0x7bdb('0x2f')](this['triggers'][_0x438ee5],_0x4cfb77);if(_0x23e5b2){_[_0x7bdb('0x30')](_0x4cfb77,_0x4cfb77['variables']);for(var _0x5ee47d=0x0,_0x206c26,_0x353b26,_0x3ddee4;_0x5ee47d0x0){_0x139264=_[_0x32e4('0x29')](_0x56a43b,_0x14d00f);}return _0x139264;}function getCustomFields(_0xecab94,_0x48f972){var _0x4cf995=[];var _0x4de001={'custom_fields':{}};if(_0xecab94[_0x32e4('0x28')]>0x0){_[_0x32e4('0x2a')](_0xecab94,function(_0x29355a){if(_0x29355a[_0x32e4('0x2b')]===_0x32e4('0x2c')&&_0x29355a[_0x32e4('0x2d')]&&!_0x29355a[_0x32e4('0x2e')]){_0x4de001[_0x29355a[_0x32e4('0x2d')][_0x32e4('0x2f')]()]=_0x29355a[_0x32e4('0x30')]['toString']();}else if(_0x29355a['type']===_0x32e4('0x2c')&&_0x29355a['idField']&&_0x29355a[_0x32e4('0x2e')]){_0x4de001[_0x32e4('0x31')][_0x29355a[_0x32e4('0x32')]]=_0x29355a['content'][_0x32e4('0x1f')]();}else if(_0x29355a[_0x32e4('0x2b')]==='variable'&&_0x29355a[_0x32e4('0x33')]&&_0x29355a['idField']&&_0x29355a[_0x32e4('0x2e')]){_0x48f972[_0x29355a[_0x32e4('0x33')]]&&(_0x4de001['custom_fields'][_0x29355a['idField']]=_0x48f972[_0x29355a['variableName']]['toString']());}else if(_0x29355a[_0x32e4('0x2b')]===_0x32e4('0x34')&&_0x29355a['Variable']&&_0x29355a[_0x32e4('0x35')][_0x32e4('0x36')]&&_0x29355a[_0x32e4('0x32')]&&_0x29355a[_0x32e4('0x2e')]){_0x48f972[_0x29355a['Variable']['name'][_0x32e4('0x2f')]()]&&(_0x4de001['custom_fields'][_0x29355a['idField']]=_0x48f972[_0x29355a['Variable'][_0x32e4('0x36')][_0x32e4('0x2f')]()][_0x32e4('0x1f')]());}});}if(_0x4de001[_0x32e4('0x37')]){_0x4de001[_0x32e4('0x37')]=Number(_0x4de001[_0x32e4('0x37')]);}return _0x4de001;}function getTicket(_0x1c33e9,_0x3c7270,_0x413a26,_0x4fc92b,_0x503d01){logger['info'](_0x32e4('0x38'));var _0x297c94=_[_0x32e4('0x39')]({'subject':intUtil[_0x32e4('0x3a')](_0x4fc92b['Subjects'],_0x503d01,'\x20'),'type':_0x32e4('0x3b'),'status':_0x32e4('0x3c'),'labels':[_0x32e4('0x3d'),'Motion','CTI'][_0x32e4('0x3e')](getTags(_0x4fc92b[_0x32e4('0x3f')],'name')),'description':intUtil['getString'](_0x4fc92b['Descriptions'],_0x503d01,'\x0a'),'_links':{'assigned_user':{'href':util[_0x32e4('0xd')]('/api/v2/users/%d',_0x3c7270['id']),'class':'user'}},'message':{'direction':'in','body':intUtil[_0x32e4('0x3a')](_0x4fc92b[_0x32e4('0x40')],_0x503d01,'\x0a')}},getCustomFields(_0x4fc92b[_0x32e4('0x41')],_0x503d01));return request({'uri':util[_0x32e4('0xd')](_0x32e4('0x42'),_0x1c33e9['remoteUri'],_0x413a26['id']),'method':_0x32e4('0x26'),'body':_0x297c94});}exports[_0x32e4('0x43')]=function(_0x55be79,_0x3f5946,_0x2bd595,_0x10ed83,_0xe214a5,_0x3aee7c){var _0x3bb2d7,_0x2e2278;_0x3aee7c[_0x32e4('0x22')]=intUtil[_0x32e4('0x44')](_0x3aee7c[_0x32e4('0x22')]);_0x3aee7c['serverUrl']=intUtil[_0x32e4('0x44')](_0x3aee7c[_0x32e4('0x45')]);if(_0xe214a5&&_0xe214a5['monitor_format']){logger[_0x32e4('0x13')](_0x32e4('0x46'),_0x32e4('0x47'));_0x3f5946[_0x32e4('0x48')]=util[_0x32e4('0xd')](_0x32e4('0x49'),_0x3aee7c[_0x32e4('0x45')],_0x3f5946[_0x32e4('0x4a')],md5(_0x3f5946[_0x32e4('0x4a')]));}else{_0x3f5946[_0x32e4('0x48')]='';}headers[_0x32e4('0x4b')]=getAuth(_0x3aee7c);return getUser(_0x3aee7c,_0x10ed83['email'])[_0x32e4('0xf')](function(_0x437394){_0x3bb2d7=_0x437394;logger[_0x32e4('0x13')](_0x32e4('0x4c'),_0x3bb2d7['id']);return getEndUser(_0x3aee7c,_0x3f5946[_0x32e4('0x4d')],_0x3f5946['calleridnum']);})['then'](function(_0x139a42){_0x2e2278=_0x139a42;logger[_0x32e4('0x13')](_0x32e4('0x4e'),_0x2e2278['id']);return getTicket(_0x3aee7c,_0x3bb2d7,_0x2e2278,_0x2bd595,_0x3f5946);})['then'](function(_0x31dbb6){if(_0x31dbb6){logger[_0x32e4('0x13')]('Ticket\x20created!');logger[_0x32e4('0x13')](_0x32e4('0x4f'),_0x31dbb6['id']);switch(_0x3aee7c[_0x32e4('0x2b')]){case _0x32e4('0x50'):logger[_0x32e4('0x13')](_0x32e4('0x46'),_0x32e4('0x51'));emit(util[_0x32e4('0xd')]('user:%s',_0x10ed83[_0x32e4('0x36')]),_0x32e4('0x52'),{'recordId':_0x31dbb6['id']});break;case _0x32e4('0x53'):logger[_0x32e4('0x13')](_0x32e4('0x46'),_0x32e4('0x54'));emit(util[_0x32e4('0xd')](_0x32e4('0x55'),_0x10ed83['name']),_0x32e4('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x31dbb6['id'])});break;default:logger[_0x32e4('0x57')](_0x32e4('0x46'),_0x32e4('0x58'));}}})[_0x32e4('0x59')](function(_0xf56915){console[_0x32e4('0x57')](_0xf56915);logger['error']('[QUEUE]',JSON[_0x32e4('0x5a')](_0xf56915));});};exports['outbound']=function(_0x39fd7d,_0x4736fa,_0x487f7a,_0x5732c6,_0x2fe30c,_0x41972f,_0x4aa210){var _0x31b7f7,_0x35f4c8;_0x41972f[_0x32e4('0x22')]=intUtil['stripTrailingSlash'](_0x41972f[_0x32e4('0x22')]);_0x41972f['serverUrl']=intUtil[_0x32e4('0x44')](_0x41972f[_0x32e4('0x45')]);if(_0x4aa210&&_0x4aa210[_0x32e4('0x5b')]&&_0x4aa210[_0x32e4('0x5b')]!==_0x32e4('0x5c')){logger['info'](_0x32e4('0x5d'),_0x32e4('0x47'));_0x4736fa[_0x32e4('0x48')]=util['format'](_0x32e4('0x49'),_0x41972f[_0x32e4('0x45')],_0x4736fa[_0x32e4('0x4a')],md5(_0x4736fa[_0x32e4('0x4a')]));}headers[_0x32e4('0x4b')]=getAuth(_0x41972f);return getUser(_0x41972f,_0x5732c6[_0x32e4('0x5e')])['then'](function(_0x420a49){_0x31b7f7=_0x420a49;logger[_0x32e4('0x13')](_0x32e4('0x4c'),_0x31b7f7['id']);return getEndUser(_0x41972f,_0x4736fa[_0x32e4('0x5f')],_0x4736fa['destcalleridnum']);})[_0x32e4('0xf')](function(_0x34a92b){_0x35f4c8=_0x34a92b;logger[_0x32e4('0x13')]('The\x20Enduser\x20ID\x20is:',_0x35f4c8['id']);return getTicket(_0x41972f,_0x31b7f7,_0x35f4c8,_0x487f7a,_0x4736fa);})[_0x32e4('0xf')](function(_0x5bcd30){if(_0x5bcd30){logger['info'](_0x32e4('0x60'));logger[_0x32e4('0x13')]('The\x20Ticket\x20ID\x20is:',_0x5bcd30['id']);switch(_0x41972f['type']){case'integrationTab':logger[_0x32e4('0x13')](_0x32e4('0x46'),_0x32e4('0x51'));emit(util[_0x32e4('0xd')](_0x32e4('0x55'),_0x5732c6[_0x32e4('0x36')]),_0x32e4('0x52'),{'recordId':_0x5bcd30['id']});break;case _0x32e4('0x53'):logger[_0x32e4('0x13')]('[QUEUE]',_0x32e4('0x54'));emit(util[_0x32e4('0xd')]('user:%s',_0x5732c6['name']),'trigger:browser:url',{'uri':util[_0x32e4('0xd')]('%s/agent/tickets/%s',_0x41972f[_0x32e4('0x22')],_0x5bcd30['id'])});break;default:logger[_0x32e4('0x57')](_0x32e4('0x5d'),_0x32e4('0x58'));}}})[_0x32e4('0x59')](function(_0x469b8f){logger['error'](_0x32e4('0x5d'),JSON['stringify'](_0x469b8f));});};exports[_0x32e4('0x61')]=function(_0x3110b1,_0x23ce19,_0x2bdf4b,_0x452f72,_0x578abd,_0x173111){var _0xfda4e8,_0x3e7dc2;_0x173111[_0x32e4('0x22')]=intUtil['stripTrailingSlash'](_0x173111[_0x32e4('0x22')]);_0x173111[_0x32e4('0x45')]=intUtil[_0x32e4('0x44')](_0x173111[_0x32e4('0x45')]);if(_0x578abd&&_0x578abd['monitor_format']){logger[_0x32e4('0x13')](_0x32e4('0x62'),_0x32e4('0x47'));_0x23ce19[_0x32e4('0x48')]=util[_0x32e4('0xd')](_0x32e4('0x49'),_0x173111[_0x32e4('0x45')],_0x23ce19['uniqueid'],md5(_0x23ce19[_0x32e4('0x4a')]));}else{_0x23ce19['recordingURL']='';}headers[_0x32e4('0x4b')]=getAuth(_0x173111);return getUser(_0x173111)[_0x32e4('0xf')](function(_0x1a334c){_0xfda4e8=_0x1a334c;logger[_0x32e4('0x13')](_0x32e4('0x4c'),_0xfda4e8['id']);return getEndUser(_0x173111,_0x23ce19[_0x32e4('0x4d')],_0x23ce19[_0x32e4('0x63')]);})[_0x32e4('0xf')](function(_0x2f371b){_0x3e7dc2=_0x2f371b;logger[_0x32e4('0x13')](_0x32e4('0x4e'),_0x3e7dc2['id']);return getTicket(_0x173111,_0xfda4e8,_0x3e7dc2,_0x2bdf4b,_0x23ce19);})[_0x32e4('0xf')](function(_0x4ad7ed){if(_0x4ad7ed){logger[_0x32e4('0x13')](_0x32e4('0x60'));logger[_0x32e4('0x13')](_0x32e4('0x4f'),_0x4ad7ed['id']);}})[_0x32e4('0x59')](function(_0x42f365){logger[_0x32e4('0x57')]('[ABANDONED]',JSON[_0x32e4('0x5a')](_0x42f365));});}; \ No newline at end of file +var _0x2ced=['localhost','emit','application/json','info','Getting\x20agent\x20with\x20email','format','total_entries','entries','then','Agent\x20found!','%s/users/me','remoteUri','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','debug','stringify','GET','authType','%s:%s','password','token','%s/token:%s','username','Basic\x20%s','toString','base64','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','map','forEach','nameField','customField','toLowerCase','content','type','string','custom_fields','variable','variableName','idField','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','Subjects','phone','xCALLY','Motion','CTI','concat','/api/v2/users/%d','getString','Descriptions','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','none','[OUTBOUND]','destcalleridname','newTab','%s/agent/tickets/%s','abandoned','[ABANDONED]','lodash','request-promise','md5','util','ioredis','../../../../config/logger','redis','defaults'];(function(_0x46bb73,_0x44f394){var _0x44f271=function(_0x2a96bc){while(--_0x2a96bc){_0x46bb73['push'](_0x46bb73['shift']());}};_0x44f271(++_0x44f394);}(_0x2ced,0x133));var _0xd2ce=function(_0x4bb794,_0x1e6e9d){_0x4bb794=_0x4bb794-0x0;var _0xc03b38=_0x2ced[_0x4bb794];return _0xc03b38;};'use strict';var _=require(_0xd2ce('0x0'));var rp=require(_0xd2ce('0x1'));var md5=require(_0xd2ce('0x2'));var util=require(_0xd2ce('0x3'));var Redis=require(_0xd2ce('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xd2ce('0x5'))('desk');config[_0xd2ce('0x6')]=_[_0xd2ce('0x7')](config[_0xd2ce('0x6')],{'host':_0xd2ce('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x191103,_0x257d51,_0x2cf45e){io['to'](_0x191103)[_0xd2ce('0x9')](_0x257d51,_0x2cf45e);}var headers={'Content-Type':_0xd2ce('0xa'),'Accept':_0xd2ce('0xa')};function getUser(_0x478a60,_0x427b92){if(intUtil['validateEmail'](_0x427b92)===!![]){logger[_0xd2ce('0xb')](_0xd2ce('0xc'),_0x427b92);return request({'uri':util[_0xd2ce('0xd')]('%s/users',_0x478a60['remoteUri'])})['then'](function(_0x2bc5c7){if(_0x2bc5c7[_0xd2ce('0xe')]){return _['find'](_0x2bc5c7['_embedded'][_0xd2ce('0xf')],{'email':_0x427b92});}})[_0xd2ce('0x10')](function(_0x901bca){if(_0x901bca){logger[_0xd2ce('0xb')](_0xd2ce('0x11'));return _0x901bca;}else{logger[_0xd2ce('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xd2ce('0x12'),_0x478a60[_0xd2ce('0x13')])});}});}else{logger[_0xd2ce('0xb')](_0xd2ce('0x14'));return request({'uri':util['format'](_0xd2ce('0x12'),_0x478a60[_0xd2ce('0x13')])});}}function request(_0x2bb43b){logger[_0xd2ce('0x15')]('[HTTP]',JSON[_0xd2ce('0x16')](_0x2bb43b));return rp(_['defaults'](_0x2bb43b,{'method':_0xd2ce('0x17'),'headers':headers,'json':!![]}));}function getAuth(_0x1afb85){var _0x43dbb8;if(_0x1afb85[_0xd2ce('0x18')]==='basic'){_0x43dbb8=util[_0xd2ce('0xd')](_0xd2ce('0x19'),_0x1afb85['username'],_0x1afb85[_0xd2ce('0x1a')]);}else if(_0x1afb85['authType']===_0xd2ce('0x1b')){_0x43dbb8=util[_0xd2ce('0xd')](_0xd2ce('0x1c'),_0x1afb85[_0xd2ce('0x1d')],_0x1afb85[_0xd2ce('0x1b')]);}return util['format'](_0xd2ce('0x1e'),new Buffer(_0x43dbb8)[_0xd2ce('0x1f')](_0xd2ce('0x20')));}function getEndUser(_0x194e3a,_0x5f4fdc,_0x2a3f8a){logger['info']('Searching\x20enduser\x20with\x20phone',_0x2a3f8a);return request({'uri':util[_0xd2ce('0xd')](_0xd2ce('0x21'),_0x194e3a['remoteUri']),'qs':{'phone':_0x2a3f8a}})[_0xd2ce('0x10')](function(_0x377fb2){if(_0x377fb2[_0xd2ce('0xe')]){logger[_0xd2ce('0xb')](_0xd2ce('0x22'));return _0x377fb2[_0xd2ce('0x23')][_0xd2ce('0xf')][0x0];}else{logger[_0xd2ce('0xb')](_0xd2ce('0x24'));return request({'uri':util['format'](_0xd2ce('0x25'),_0x194e3a[_0xd2ce('0x13')]),'method':_0xd2ce('0x26'),'body':{'first_name':_0x5f4fdc,'title':_0x5f4fdc,'phone_numbers':[{'type':_0xd2ce('0x27'),'value':_0x2a3f8a}]}});}});}function getTags(_0x170462,_0x51382b){var _0x36a515=[];if(_0x170462&&_0x170462[_0xd2ce('0x28')]>0x0){_0x36a515=_[_0xd2ce('0x29')](_0x170462,_0x51382b);}return _0x36a515;}function getCustomFields(_0x48b05e,_0x4afaff){var _0x25fde4=[];var _0x38a9b8={'custom_fields':{}};if(_0x48b05e[_0xd2ce('0x28')]>0x0){_[_0xd2ce('0x2a')](_0x48b05e,function(_0x1a5077){if(_0x1a5077['type']==='string'&&_0x1a5077[_0xd2ce('0x2b')]&&!_0x1a5077[_0xd2ce('0x2c')]){_0x38a9b8[_0x1a5077[_0xd2ce('0x2b')][_0xd2ce('0x2d')]()]=_0x1a5077[_0xd2ce('0x2e')][_0xd2ce('0x1f')]();}else if(_0x1a5077[_0xd2ce('0x2f')]===_0xd2ce('0x30')&&_0x1a5077['idField']&&_0x1a5077[_0xd2ce('0x2c')]){_0x38a9b8[_0xd2ce('0x31')][_0x1a5077['idField']]=_0x1a5077[_0xd2ce('0x2e')]['toString']();}else if(_0x1a5077['type']===_0xd2ce('0x32')&&_0x1a5077[_0xd2ce('0x33')]&&_0x1a5077[_0xd2ce('0x34')]&&_0x1a5077[_0xd2ce('0x2c')]){_0x4afaff[_0x1a5077[_0xd2ce('0x33')]]&&(_0x38a9b8[_0xd2ce('0x31')][_0x1a5077[_0xd2ce('0x34')]]=_0x4afaff[_0x1a5077[_0xd2ce('0x33')]][_0xd2ce('0x1f')]());}else if(_0x1a5077[_0xd2ce('0x2f')]===_0xd2ce('0x35')&&_0x1a5077[_0xd2ce('0x36')]&&_0x1a5077[_0xd2ce('0x36')][_0xd2ce('0x37')]&&_0x1a5077['idField']&&_0x1a5077['customField']){_0x4afaff[_0x1a5077[_0xd2ce('0x36')][_0xd2ce('0x37')][_0xd2ce('0x2d')]()]&&(_0x38a9b8[_0xd2ce('0x31')][_0x1a5077[_0xd2ce('0x34')]]=_0x4afaff[_0x1a5077['Variable'][_0xd2ce('0x37')][_0xd2ce('0x2d')]()]['toString']());}});}if(_0x38a9b8[_0xd2ce('0x38')]){_0x38a9b8[_0xd2ce('0x38')]=Number(_0x38a9b8[_0xd2ce('0x38')]);}return _0x38a9b8;}function getTicket(_0xa879fe,_0x1747d2,_0x3ce7f7,_0x4b1552,_0x3b7e7a){logger['info'](_0xd2ce('0x39'));var _0x4d007f=_[_0xd2ce('0x3a')]({'subject':intUtil['getString'](_0x4b1552[_0xd2ce('0x3b')],_0x3b7e7a,'\x20'),'type':_0xd2ce('0x3c'),'status':'new','labels':[_0xd2ce('0x3d'),_0xd2ce('0x3e'),_0xd2ce('0x3f')][_0xd2ce('0x40')](getTags(_0x4b1552['Tags'],_0xd2ce('0x37'))),'description':intUtil['getString'](_0x4b1552['Descriptions'],_0x3b7e7a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xd2ce('0xd')](_0xd2ce('0x41'),_0x1747d2['id']),'class':'user'}},'message':{'direction':'in','body':intUtil[_0xd2ce('0x42')](_0x4b1552[_0xd2ce('0x43')],_0x3b7e7a,'\x0a')}},getCustomFields(_0x4b1552[_0xd2ce('0x44')],_0x3b7e7a));return request({'uri':util[_0xd2ce('0xd')](_0xd2ce('0x45'),_0xa879fe[_0xd2ce('0x13')],_0x3ce7f7['id']),'method':_0xd2ce('0x26'),'body':_0x4d007f});}exports[_0xd2ce('0x46')]=function(_0x395d77,_0x427315,_0x50078c,_0x170b3e,_0x543070,_0x4aa289){var _0x2997ac,_0x479a83;_0x4aa289[_0xd2ce('0x13')]=intUtil[_0xd2ce('0x47')](_0x4aa289[_0xd2ce('0x13')]);_0x4aa289[_0xd2ce('0x48')]=intUtil['stripTrailingSlash'](_0x4aa289[_0xd2ce('0x48')]);if(_0x543070&&_0x543070[_0xd2ce('0x49')]){logger[_0xd2ce('0xb')](_0xd2ce('0x4a'),_0xd2ce('0x4b'));_0x427315[_0xd2ce('0x4c')]=util[_0xd2ce('0xd')](_0xd2ce('0x4d'),_0x4aa289[_0xd2ce('0x48')],_0x427315['uniqueid'],md5(_0x427315[_0xd2ce('0x4e')]));}else{_0x427315[_0xd2ce('0x4c')]='';}headers[_0xd2ce('0x4f')]=getAuth(_0x4aa289);return getUser(_0x4aa289,_0x170b3e[_0xd2ce('0x50')])['then'](function(_0x18afff){_0x2997ac=_0x18afff;logger[_0xd2ce('0xb')](_0xd2ce('0x51'),_0x2997ac['id']);return getEndUser(_0x4aa289,_0x427315[_0xd2ce('0x52')],_0x427315[_0xd2ce('0x53')]);})[_0xd2ce('0x10')](function(_0x21a32b){_0x479a83=_0x21a32b;logger[_0xd2ce('0xb')](_0xd2ce('0x54'),_0x479a83['id']);return getTicket(_0x4aa289,_0x2997ac,_0x479a83,_0x50078c,_0x427315);})[_0xd2ce('0x10')](function(_0x5d70f5){if(_0x5d70f5){logger[_0xd2ce('0xb')](_0xd2ce('0x55'));logger['info'](_0xd2ce('0x56'),_0x5d70f5['id']);switch(_0x4aa289[_0xd2ce('0x2f')]){case _0xd2ce('0x57'):logger['info'](_0xd2ce('0x4a'),_0xd2ce('0x58'));emit(util[_0xd2ce('0xd')](_0xd2ce('0x59'),_0x170b3e[_0xd2ce('0x37')]),_0xd2ce('0x5a'),{'recordId':_0x5d70f5['id']});break;case'newTab':logger[_0xd2ce('0xb')](_0xd2ce('0x4a'),_0xd2ce('0x5b'));emit(util[_0xd2ce('0xd')](_0xd2ce('0x59'),_0x170b3e['name']),_0xd2ce('0x5c'),{'uri':util['format'](_0xd2ce('0x5d'),_0x5d70f5['id'])});break;default:logger[_0xd2ce('0x5e')]('[QUEUE]',_0xd2ce('0x5f'));}}})[_0xd2ce('0x60')](function(_0x4b0510){console[_0xd2ce('0x5e')](_0x4b0510);logger[_0xd2ce('0x5e')](_0xd2ce('0x4a'),JSON['stringify'](_0x4b0510));});};exports[_0xd2ce('0x61')]=function(_0x8efb29,_0x446c72,_0x3d6b36,_0x45179e,_0x4c822a,_0x4de6a6,_0x13bcad){var _0x5eeea1,_0x582800;_0x4de6a6[_0xd2ce('0x13')]=intUtil[_0xd2ce('0x47')](_0x4de6a6['remoteUri']);_0x4de6a6['serverUrl']=intUtil[_0xd2ce('0x47')](_0x4de6a6[_0xd2ce('0x48')]);if(_0x13bcad&&_0x13bcad['recordingFormat']&&_0x13bcad['recordingFormat']!==_0xd2ce('0x62')){logger[_0xd2ce('0xb')](_0xd2ce('0x63'),_0xd2ce('0x4b'));_0x446c72[_0xd2ce('0x4c')]=util['format'](_0xd2ce('0x4d'),_0x4de6a6[_0xd2ce('0x48')],_0x446c72[_0xd2ce('0x4e')],md5(_0x446c72[_0xd2ce('0x4e')]));}headers[_0xd2ce('0x4f')]=getAuth(_0x4de6a6);return getUser(_0x4de6a6,_0x45179e[_0xd2ce('0x50')])['then'](function(_0x283ba7){_0x5eeea1=_0x283ba7;logger[_0xd2ce('0xb')](_0xd2ce('0x51'),_0x5eeea1['id']);return getEndUser(_0x4de6a6,_0x446c72[_0xd2ce('0x64')],_0x446c72['destcalleridnum']);})['then'](function(_0x511644){_0x582800=_0x511644;logger['info'](_0xd2ce('0x54'),_0x582800['id']);return getTicket(_0x4de6a6,_0x5eeea1,_0x582800,_0x3d6b36,_0x446c72);})[_0xd2ce('0x10')](function(_0x1adb6c){if(_0x1adb6c){logger[_0xd2ce('0xb')]('Ticket\x20created!');logger['info'](_0xd2ce('0x56'),_0x1adb6c['id']);switch(_0x4de6a6['type']){case _0xd2ce('0x57'):logger[_0xd2ce('0xb')](_0xd2ce('0x4a'),_0xd2ce('0x58'));emit(util[_0xd2ce('0xd')](_0xd2ce('0x59'),_0x45179e[_0xd2ce('0x37')]),_0xd2ce('0x5a'),{'recordId':_0x1adb6c['id']});break;case _0xd2ce('0x65'):logger[_0xd2ce('0xb')](_0xd2ce('0x4a'),_0xd2ce('0x5b'));emit(util[_0xd2ce('0xd')]('user:%s',_0x45179e['name']),_0xd2ce('0x5c'),{'uri':util[_0xd2ce('0xd')](_0xd2ce('0x66'),_0x4de6a6[_0xd2ce('0x13')],_0x1adb6c['id'])});break;default:logger[_0xd2ce('0x5e')](_0xd2ce('0x63'),_0xd2ce('0x5f'));}}})[_0xd2ce('0x60')](function(_0x563c3d){logger['error'](_0xd2ce('0x63'),JSON[_0xd2ce('0x16')](_0x563c3d));});};exports[_0xd2ce('0x67')]=function(_0x25b9aa,_0x4935e7,_0x21fc66,_0x34ff5a,_0x16fb90,_0x2a143d){var _0x5d20cf,_0x2544c2;_0x2a143d[_0xd2ce('0x13')]=intUtil[_0xd2ce('0x47')](_0x2a143d[_0xd2ce('0x13')]);_0x2a143d[_0xd2ce('0x48')]=intUtil[_0xd2ce('0x47')](_0x2a143d['serverUrl']);if(_0x16fb90&&_0x16fb90['monitor_format']){logger['info']('[ABANDONED]',_0xd2ce('0x4b'));_0x4935e7[_0xd2ce('0x4c')]=util[_0xd2ce('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a143d[_0xd2ce('0x48')],_0x4935e7['uniqueid'],md5(_0x4935e7['uniqueid']));}else{_0x4935e7[_0xd2ce('0x4c')]='';}headers[_0xd2ce('0x4f')]=getAuth(_0x2a143d);return getUser(_0x2a143d)[_0xd2ce('0x10')](function(_0x7645c0){_0x5d20cf=_0x7645c0;logger[_0xd2ce('0xb')](_0xd2ce('0x51'),_0x5d20cf['id']);return getEndUser(_0x2a143d,_0x4935e7[_0xd2ce('0x52')],_0x4935e7[_0xd2ce('0x53')]);})[_0xd2ce('0x10')](function(_0x3d2bf9){_0x2544c2=_0x3d2bf9;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2544c2['id']);return getTicket(_0x2a143d,_0x5d20cf,_0x2544c2,_0x21fc66,_0x4935e7);})[_0xd2ce('0x10')](function(_0x2789fb){if(_0x2789fb){logger[_0xd2ce('0xb')]('Ticket\x20created!');logger[_0xd2ce('0xb')](_0xd2ce('0x56'),_0x2789fb['id']);}})[_0xd2ce('0x60')](function(_0x55ef21){logger[_0xd2ce('0x5e')](_0xd2ce('0x68'),JSON['stringify'](_0x55ef21));});}; \ 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 1dc7899..711f65c 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 _0xcfbf=['/systemusers(','headers','odata-entityid','substring','lastIndexOf','contacts?$select=telephone1','outbound','telephone1','enduserId','type','nameField','customField','idField','indexOf','incident','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','queue','callDirection','ticketId','format','user:%s','emit','trigger:browser:url','remoteUri','serverUrl','stripTrailingSlash','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','info','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','The\x20User\x20email\x20is:','The\x20Enduser\x20phone\x20is:','call\x20direction:\x20%s','abandoned','name','inspect','lodash','bluebird','request-promise','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','POST','clientId','username','password','clientSecret','then','access_token','GET','systemusers?$select=internalemailaddress','Bearer\x20','4.0','value','email','length','internalemailaddress','userId','systemuserid','userEmail','catch','message','toLowerCase','destcalleridnum','calleridnum','contacts'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xcfbf,0x8b));var _0xfcfb=function(_0x4eed62,_0xe9019b){_0x4eed62=_0x4eed62-0x0;var _0x2933d0=_0xcfbf[_0x4eed62];return _0x2933d0;};'use strict';var _=require(_0xfcfb('0x0'));var BPromise=require(_0xfcfb('0x1'));var rp=require(_0xfcfb('0x2'));var util=require('util');var intUtil=require(_0xfcfb('0x3'));var md5=require(_0xfcfb('0x4'));var Redis=require(_0xfcfb('0x5'));var logger=require(_0xfcfb('0x6'))(_0xfcfb('0x7'));var config=require('../../../../config/environment');config[_0xfcfb('0x8')]=_['defaults'](config['redis'],{'host':_0xfcfb('0x9'),'port':0x18eb});var io=require(_0xfcfb('0xa'))(new Redis(config[_0xfcfb('0x8')]));function getAuthToken(_0x400327,_0x21a8f8){var _0x1dc4db={'method':_0xfcfb('0xb'),'uri':_0x21a8f8,'form':{'client_id':_0x400327[_0xfcfb('0xc')],'resource':_0x400327['remoteUri'],'username':_0x400327[_0xfcfb('0xd')],'password':_0x400327[_0xfcfb('0xe')],'grant_type':_0xfcfb('0xe'),'client_secret':_0x400327[_0xfcfb('0xf')]},'json':!![]};return rp(_0x1dc4db)[_0xfcfb('0x10')](function(_0x3ceaab){return _0x3ceaab[_0xfcfb('0x11')];});}function getUser(_0x10203a,_0x5841d3,_0x28509e,_0x5572df,_0x154f20){return new BPromise(function(_0xfeafcd,_0x11c1c4){return getAuthToken(_0x5841d3,_0x5572df)[_0xfcfb('0x10')](function(_0xf329f6){var _0x5630b8={'method':_0xfcfb('0x12'),'uri':_0x154f20+_0xfcfb('0x13'),'headers':{'Authorization':_0xfcfb('0x14')+_0xf329f6,'OData-Version':_0xfcfb('0x15')},'json':!![]};return rp(_0x5630b8);})[_0xfcfb('0x10')](function(_0x158aa6){var _0x11b259=_0x158aa6[_0xfcfb('0x16')];var _0x31cd32=![];var _0x2562e6=null;if(_0x28509e&&_0x28509e['email']){_0x10203a['userEmail']=_0x28509e[_0xfcfb('0x17')];for(_0x2562e6=0x0;_0x2562e6<_0x11b259[_0xfcfb('0x18')];_0x2562e6++){if(_0x11b259[_0x2562e6][_0xfcfb('0x19')]===_0x28509e[_0xfcfb('0x17')]){_0x31cd32=!![];_0x10203a[_0xfcfb('0x1a')]=_0x11b259[_0x2562e6][_0xfcfb('0x1b')];}}}if(!_0x31cd32){_0x10203a[_0xfcfb('0x1c')]=_0x5841d3['username'];for(_0x2562e6=0x0;_0x2562e6<_0x11b259[_0xfcfb('0x18')];_0x2562e6++){if(_0x11b259[_0x2562e6]['internalemailaddress']===_0x5841d3['username']){_0x10203a['userId']=_0x11b259[_0x2562e6][_0xfcfb('0x1b')];}}}_0xfeafcd(_0x10203a);})[_0xfcfb('0x1d')](function(_0x4a1923){_0x11c1c4(_0x4a1923[_0xfcfb('0x1e')]);});});}function createEndUser(_0x40999e,_0x353c7b,_0x1d9a68,_0x58c8eb,_0x5bde2b,_0x53152f){return new BPromise(function(_0x526d57,_0xfb50bd){return getAuthToken(_0x353c7b,_0x1d9a68)['then'](function(_0x80b3f7){var _0x2afaaa=_0x53152f[_0xfcfb('0x1f')]()==='outbound'?_0x5bde2b[_0xfcfb('0x20')]:_0x5bde2b[_0xfcfb('0x21')];var _0x1b7c09={'method':'POST','uri':_0x58c8eb+_0xfcfb('0x22'),'body':{'telephone1':_0x2afaaa,'fullname':_0x2afaaa,'firstname':_0x2afaaa,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfcfb('0x23')+_0x40999e['userId']+')'},'headers':{'Authorization':_0xfcfb('0x14')+_0x80b3f7,'OData-Version':_0xfcfb('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x1b7c09);})[_0xfcfb('0x10')](function(_0x5afbf2){var _0x2f6ea5=_0x5afbf2[_0xfcfb('0x24')][_0xfcfb('0x25')];var _0x4a677f=_0x2f6ea5[_0xfcfb('0x26')](_0x2f6ea5[_0xfcfb('0x27')]('(')+0x1,_0x2f6ea5['lastIndexOf'](')'));_0x40999e['enduserId']=_0x4a677f;_0x526d57(_0x40999e);})[_0xfcfb('0x1d')](function(_0x513431){_0xfb50bd(_0x513431['message']);});});}function getEndUser(_0x1b6ae8,_0x280235,_0x3b781a,_0x1f1c6c,_0x55ee07,_0x592477){return new BPromise(function(_0x474fdb,_0x3e0b97){return getAuthToken(_0x280235,_0x3b781a)[_0xfcfb('0x10')](function(_0x3b41bf){var _0x8fc248={'method':_0xfcfb('0x12'),'uri':_0x1f1c6c+_0xfcfb('0x28'),'headers':{'Authorization':_0xfcfb('0x14')+_0x3b41bf,'If-None-Match':null,'OData-Version':_0xfcfb('0x15')},'json':!![]};return rp(_0x8fc248);})[_0xfcfb('0x10')](function(_0x59205){var _0x4fecc8=null;if(_0x59205){var _0x325915=_0x59205[_0xfcfb('0x16')];var _0x28eab4=![];for(_0x4fecc8=0x0;_0x4fecc8<_0x325915[_0xfcfb('0x18')];_0x4fecc8++){var _0x27207c=_0x592477[_0xfcfb('0x1f')]()===_0xfcfb('0x29')?_0x55ee07['destcalleridnum']:_0x55ee07[_0xfcfb('0x21')];if(_0x325915[_0x4fecc8][_0xfcfb('0x2a')]===_0x27207c){_0x28eab4=!![];_0x1b6ae8[_0xfcfb('0x2b')]=_0x325915[_0x4fecc8]['contactid'];}}if(_0x28eab4){_0x474fdb(_0x1b6ae8);}else{return createEndUser(_0x1b6ae8,_0x280235,_0x3b781a,_0x1f1c6c,_0x55ee07,_0x592477)[_0xfcfb('0x10')](function(_0x184d9d){_0x474fdb(_0x184d9d);});}}else{return createEndUser(_0x1b6ae8,_0x280235,_0x3b781a,_0x1f1c6c,_0x55ee07,_0x592477)[_0xfcfb('0x10')](function(_0x4cf73e){_0x474fdb(_0x4cf73e);});}});});}function getCustomFields(_0x599da1,_0x50696c,_0x32ff4a){var _0x412897={};if(_0x599da1['length']>0x0){_['forEach'](_0x599da1,function(_0x1988d5){if(_0x1988d5[_0xfcfb('0x2c')]==='string'&&_0x1988d5[_0xfcfb('0x2d')]&&!_0x1988d5[_0xfcfb('0x2e')]){var _0x20f560=_0x1988d5[_0xfcfb('0x2f')][_0xfcfb('0x1f')]();var _0x4926ef=_0x20f560[_0xfcfb('0x26')](0x0,_0x20f560['indexOf']('_'));var _0xf1f8c9=_0x20f560[_0xfcfb('0x26')](_0x20f560[_0xfcfb('0x30')]('_')+0x1);if(_0x4926ef===_0x32ff4a){_0x412897[_0xf1f8c9]=_0x1988d5['content'];}}});}return _0x412897;}function getTicket(_0xa0f16c,_0x22f737,_0x3601c8,_0x45b239,_0x4b61d4,_0x14545b){return new BPromise(function(_0x383d32,_0xf7c2b4){var _0x5d19b4;return getAuthToken(_0x22f737,_0x3601c8)['then'](function(_0x1daa1d){if(_0x14545b['ticketType']===_0xfcfb('0x31')){_0x5d19b4={'method':_0xfcfb('0xb'),'uri':_0x45b239+'incidents','body':Object[_0xfcfb('0x32')]({},{'title':intUtil[_0xfcfb('0x33')](_0x14545b[_0xfcfb('0x34')],_0x4b61d4,'\x20'),'description':intUtil['getString'](_0x14545b[_0xfcfb('0x35')],_0x4b61d4,'\x0a'),'customerid_contact@odata.bind':_0xfcfb('0x36')+_0xa0f16c[_0xfcfb('0x2b')]+')','ownerid@odata.bind':_0xfcfb('0x23')+_0xa0f16c[_0xfcfb('0x1a')]+')','caseorigincode':'1'},getCustomFields(_0x14545b[_0xfcfb('0x37')],_0x4b61d4,_0x14545b['ticketType'])),'headers':{'Authorization':_0xfcfb('0x14')+_0x1daa1d,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x14545b[_0xfcfb('0x38')]===_0xfcfb('0x39')){_0x5d19b4={'method':'POST','uri':_0x45b239+'phonecalls','body':Object[_0xfcfb('0x32')]({},{'subject':intUtil[_0xfcfb('0x33')](_0x14545b[_0xfcfb('0x34')],_0x4b61d4,'\x20'),'phonenumber':String(_0x4b61d4[_0xfcfb('0x21')]),'description':intUtil[_0xfcfb('0x33')](_0x14545b[_0xfcfb('0x35')],_0x4b61d4,'\x0a'),'regardingobjectid_contact@odata.bind':_0xfcfb('0x36')+_0xa0f16c[_0xfcfb('0x2b')]+')','ownerid@odata.bind':_0xfcfb('0x23')+_0xa0f16c['userId']+')','directioncode':_0xa0f16c['callDirection']===_0xfcfb('0x3a')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xfcfb('0x23')+_0xa0f16c[_0xfcfb('0x1a')]+')','participationtypemask':_0xa0f16c['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xfcfb('0x36')+_0xa0f16c[_0xfcfb('0x2b')]+')','participationtypemask':_0xa0f16c[_0xfcfb('0x3b')]===_0xfcfb('0x3a')?0x1:0x2}]},getCustomFields(_0x14545b[_0xfcfb('0x37')],_0x4b61d4,_0x14545b[_0xfcfb('0x38')])),'headers':{'Authorization':_0xfcfb('0x14')+_0x1daa1d,'OData-Version':_0xfcfb('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5d19b4);})['then'](function(_0xd4e915){var _0x4470b8=_0xd4e915[_0xfcfb('0x24')][_0xfcfb('0x25')];var _0x4a0555=_0x4470b8[_0xfcfb('0x26')](_0x4470b8['lastIndexOf']('(')+0x1,_0x4470b8[_0xfcfb('0x27')](')'));_0xa0f16c[_0xfcfb('0x3c')]=_0x4a0555;_0x383d32(_0xa0f16c);})['catch'](function(_0x2d610d){_0xf7c2b4(_0x2d610d[_0xfcfb('0x1e')]);});});}function emit(_0x5aea94,_0x381196,_0x5b0a2d,_0x1108bd){var _0xb2835f={'uri':util[_0xfcfb('0x3d')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x5aea94,_0x5b0a2d,_0x1108bd)};io['to'](util[_0xfcfb('0x3d')](_0xfcfb('0x3e'),_0x381196))[_0xfcfb('0x3f')](_0xfcfb('0x40'),_0xb2835f);}exports['cs']=function(_0x4f5fde,_0x36c43c,_0x4db478,_0x5d610a,_0x51aca5,_0x2a9fcb,_0x35e7e1,_0x103f9b){var _0x308476={};_0x2a9fcb[_0xfcfb('0x41')]=intUtil['stripTrailingSlash'](_0x2a9fcb[_0xfcfb('0x41')]);_0x2a9fcb[_0xfcfb('0x42')]=intUtil[_0xfcfb('0x43')](_0x2a9fcb['serverUrl']);_0x308476['callDirection']=_0x103f9b==='queue'||_0x103f9b==='abandoned'?_0xfcfb('0x3a'):'outbound';var _0x3609ec=util['format'](_0xfcfb('0x44'),_0x2a9fcb[_0xfcfb('0x41')]);var _0x43fc9f=util[_0xfcfb('0x3d')]('https://login.microsoftonline.com/%s/oauth2/token',_0x2a9fcb[_0xfcfb('0x45')]);var _0x450260=util[_0xfcfb('0x3d')](_0xfcfb('0x46'),_0x2a9fcb['serverUrl'],_0x36c43c[_0xfcfb('0x47')],md5(_0x36c43c[_0xfcfb('0x47')]));if(_0x51aca5&&_0x51aca5[_0xfcfb('0x48')]){logger[_0xfcfb('0x49')](_0xfcfb('0x4a'),_0xfcfb('0x4b'));_0x36c43c[_0xfcfb('0x4c')]=_0x450260;}else if(_0x35e7e1&&_0x35e7e1['recordingFormat']&&_0x35e7e1[_0xfcfb('0x4d')]!==_0xfcfb('0x4e')){logger[_0xfcfb('0x49')](_0xfcfb('0x4f'),_0xfcfb('0x4b'));_0x36c43c[_0xfcfb('0x4c')]=_0x450260;}else{_0x36c43c[_0xfcfb('0x4c')]='';}return getUser(_0x308476,_0x2a9fcb,_0x5d610a,_0x43fc9f,_0x3609ec)[_0xfcfb('0x10')](function(_0x37e825){logger[_0xfcfb('0x49')](_0xfcfb('0x50'),_0x37e825[_0xfcfb('0x1a')]);logger[_0xfcfb('0x49')](_0xfcfb('0x51'),_0x37e825[_0xfcfb('0x1c')]);return getEndUser(_0x37e825,_0x2a9fcb,_0x43fc9f,_0x3609ec,_0x36c43c,_0x103f9b);})[_0xfcfb('0x10')](function(_0x42b07d){logger[_0xfcfb('0x49')]('The\x20Enduser\x20ID\x20is:',_0x42b07d[_0xfcfb('0x2b')]);logger[_0xfcfb('0x49')](_0xfcfb('0x52'),_0x36c43c[_0xfcfb('0x21')]);return getTicket(_0x42b07d,_0x2a9fcb,_0x43fc9f,_0x3609ec,_0x36c43c,_0x4db478);})[_0xfcfb('0x10')](function(_0x1e9876){logger['info'](util[_0xfcfb('0x3d')]('The\x20%s\x20ID\x20is:\x20%s',_0x4db478[_0xfcfb('0x38')],_0x1e9876[_0xfcfb('0x3c')]));logger[_0xfcfb('0x49')](util['format'](_0xfcfb('0x53'),_0x103f9b));if(_0x103f9b!==_0xfcfb('0x54')){logger[_0xfcfb('0x49')]('['+_0x103f9b['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2a9fcb['remoteUri'],_0x5d610a[_0xfcfb('0x55')],_0x4db478[_0xfcfb('0x38')],_0x1e9876[_0xfcfb('0x3c')]);}})['catch'](function(_0x24431a){logger['error']('['+_0x103f9b['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0xfcfb('0x56')](_0x24431a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x62b9=['user:%s','emit','serverUrl','stripTrailingSlash','abandoned','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','info','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Enduser\x20phone\x20is:','The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise','util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','systemusers?$select=internalemailaddress','4.0','email','userEmail','internalemailaddress','userId','length','systemuserid','catch','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','message','GET','contacts?$select=telephone1','Bearer\x20','value','calleridnum','contactid','forEach','type','string','nameField','customField','idField','indexOf','content','ticketType','incident','assign','getString','Subjects','Descriptions','Fields','phonecall','phonecalls','/contacts(','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x62b9,0x130));var _0x962b=function(_0x458441,_0x3c6516){_0x458441=_0x458441-0x0;var _0x42886e=_0x62b9[_0x458441];return _0x42886e;};'use strict';var _=require(_0x962b('0x0'));var BPromise=require(_0x962b('0x1'));var rp=require(_0x962b('0x2'));var util=require(_0x962b('0x3'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x962b('0x4'));var logger=require(_0x962b('0x5'))(_0x962b('0x6'));var config=require(_0x962b('0x7'));config[_0x962b('0x8')]=_['defaults'](config[_0x962b('0x8')],{'host':_0x962b('0x9'),'port':0x18eb});var io=require(_0x962b('0xa'))(new Redis(config[_0x962b('0x8')]));function getAuthToken(_0x44fe4e,_0x19241c){var _0x3a3e2a={'method':_0x962b('0xb'),'uri':_0x19241c,'form':{'client_id':_0x44fe4e[_0x962b('0xc')],'resource':_0x44fe4e[_0x962b('0xd')],'username':_0x44fe4e[_0x962b('0xe')],'password':_0x44fe4e[_0x962b('0xf')],'grant_type':'password','client_secret':_0x44fe4e[_0x962b('0x10')]},'json':!![]};return rp(_0x3a3e2a)[_0x962b('0x11')](function(_0x2e2f1e){return _0x2e2f1e[_0x962b('0x12')];});}function getUser(_0x2f0029,_0x23d02b,_0x4802f6,_0x59a12a,_0x46d8ca){return new BPromise(function(_0x49276d,_0x1347de){return getAuthToken(_0x23d02b,_0x59a12a)[_0x962b('0x11')](function(_0x4bcdfa){var _0x5c8352={'method':'GET','uri':_0x46d8ca+_0x962b('0x13'),'headers':{'Authorization':'Bearer\x20'+_0x4bcdfa,'OData-Version':_0x962b('0x14')},'json':!![]};return rp(_0x5c8352);})[_0x962b('0x11')](function(_0x5d6f2f){var _0x398676=_0x5d6f2f['value'];var _0x299ea0=![];var _0x221ae7=null;if(_0x4802f6&&_0x4802f6[_0x962b('0x15')]){_0x2f0029[_0x962b('0x16')]=_0x4802f6['email'];for(_0x221ae7=0x0;_0x221ae7<_0x398676['length'];_0x221ae7++){if(_0x398676[_0x221ae7][_0x962b('0x17')]===_0x4802f6['email']){_0x299ea0=!![];_0x2f0029[_0x962b('0x18')]=_0x398676[_0x221ae7]['systemuserid'];}}}if(!_0x299ea0){_0x2f0029[_0x962b('0x16')]=_0x23d02b['username'];for(_0x221ae7=0x0;_0x221ae7<_0x398676[_0x962b('0x19')];_0x221ae7++){if(_0x398676[_0x221ae7][_0x962b('0x17')]===_0x23d02b[_0x962b('0xe')]){_0x2f0029['userId']=_0x398676[_0x221ae7][_0x962b('0x1a')];}}}_0x49276d(_0x2f0029);})[_0x962b('0x1b')](function(_0x1ee149){_0x1347de(_0x1ee149['message']);});});}function createEndUser(_0x47778d,_0x3df2f0,_0x4c9986,_0x165df0,_0x274baa,_0x3e7d8c){return new BPromise(function(_0x4d9dc8,_0x190519){return getAuthToken(_0x3df2f0,_0x4c9986)[_0x962b('0x11')](function(_0x36bb1e){var _0x26b3af=_0x3e7d8c[_0x962b('0x1c')]()===_0x962b('0x1d')?_0x274baa[_0x962b('0x1e')]:_0x274baa['calleridnum'];var _0x496404={'method':_0x962b('0xb'),'uri':_0x165df0+_0x962b('0x1f'),'body':{'telephone1':_0x26b3af,'fullname':_0x26b3af,'firstname':_0x26b3af,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x962b('0x20')+_0x47778d[_0x962b('0x18')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x36bb1e,'OData-Version':_0x962b('0x14')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x496404);})[_0x962b('0x11')](function(_0xdbbed5){var _0xc9ab1d=_0xdbbed5[_0x962b('0x21')][_0x962b('0x22')];var _0x33b184=_0xc9ab1d[_0x962b('0x23')](_0xc9ab1d[_0x962b('0x24')]('(')+0x1,_0xc9ab1d[_0x962b('0x24')](')'));_0x47778d[_0x962b('0x25')]=_0x33b184;_0x4d9dc8(_0x47778d);})[_0x962b('0x1b')](function(_0x4106e5){_0x190519(_0x4106e5[_0x962b('0x26')]);});});}function getEndUser(_0xae76c6,_0x414427,_0x5a823e,_0x2aeb81,_0x2c23f1,_0x2a5da5){return new BPromise(function(_0x1f2743,_0x42c805){return getAuthToken(_0x414427,_0x5a823e)[_0x962b('0x11')](function(_0x4a0de4){var _0x44c24f={'method':_0x962b('0x27'),'uri':_0x2aeb81+_0x962b('0x28'),'headers':{'Authorization':_0x962b('0x29')+_0x4a0de4,'If-None-Match':null,'OData-Version':_0x962b('0x14')},'json':!![]};return rp(_0x44c24f);})['then'](function(_0x54b2eb){var _0x53756d=null;if(_0x54b2eb){var _0x2b04af=_0x54b2eb[_0x962b('0x2a')];var _0x4faea8=![];for(_0x53756d=0x0;_0x53756d<_0x2b04af[_0x962b('0x19')];_0x53756d++){var _0x3cdccf=_0x2a5da5[_0x962b('0x1c')]()===_0x962b('0x1d')?_0x2c23f1[_0x962b('0x1e')]:_0x2c23f1[_0x962b('0x2b')];if(_0x2b04af[_0x53756d]['telephone1']===_0x3cdccf){_0x4faea8=!![];_0xae76c6[_0x962b('0x25')]=_0x2b04af[_0x53756d][_0x962b('0x2c')];}}if(_0x4faea8){_0x1f2743(_0xae76c6);}else{return createEndUser(_0xae76c6,_0x414427,_0x5a823e,_0x2aeb81,_0x2c23f1,_0x2a5da5)[_0x962b('0x11')](function(_0x5ed3fb){_0x1f2743(_0x5ed3fb);});}}else{return createEndUser(_0xae76c6,_0x414427,_0x5a823e,_0x2aeb81,_0x2c23f1,_0x2a5da5)[_0x962b('0x11')](function(_0x527310){_0x1f2743(_0x527310);});}});});}function getCustomFields(_0x92b99a,_0x1f8aa1,_0x11b69a){var _0x478fd8={};if(_0x92b99a[_0x962b('0x19')]>0x0){_[_0x962b('0x2d')](_0x92b99a,function(_0x4dd3d0){if(_0x4dd3d0[_0x962b('0x2e')]===_0x962b('0x2f')&&_0x4dd3d0[_0x962b('0x30')]&&!_0x4dd3d0[_0x962b('0x31')]){var _0x316c04=_0x4dd3d0[_0x962b('0x32')][_0x962b('0x1c')]();var _0x222342=_0x316c04[_0x962b('0x23')](0x0,_0x316c04[_0x962b('0x33')]('_'));var _0x3dc902=_0x316c04[_0x962b('0x23')](_0x316c04[_0x962b('0x33')]('_')+0x1);if(_0x222342===_0x11b69a){_0x478fd8[_0x3dc902]=_0x4dd3d0[_0x962b('0x34')];}}});}return _0x478fd8;}function getTicket(_0xae8cbf,_0x32425e,_0x5dfe26,_0x6a3cb5,_0x325abd,_0x24af2d){return new BPromise(function(_0xd0d9d7,_0x16ab94){var _0x3f24ef;return getAuthToken(_0x32425e,_0x5dfe26)[_0x962b('0x11')](function(_0x1e9d8e){if(_0x24af2d[_0x962b('0x35')]===_0x962b('0x36')){_0x3f24ef={'method':_0x962b('0xb'),'uri':_0x6a3cb5+'incidents','body':Object[_0x962b('0x37')]({},{'title':intUtil[_0x962b('0x38')](_0x24af2d[_0x962b('0x39')],_0x325abd,'\x20'),'description':intUtil[_0x962b('0x38')](_0x24af2d[_0x962b('0x3a')],_0x325abd,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0xae8cbf[_0x962b('0x25')]+')','ownerid@odata.bind':_0x962b('0x20')+_0xae8cbf[_0x962b('0x18')]+')','caseorigincode':'1'},getCustomFields(_0x24af2d[_0x962b('0x3b')],_0x325abd,_0x24af2d[_0x962b('0x35')])),'headers':{'Authorization':_0x962b('0x29')+_0x1e9d8e,'OData-Version':_0x962b('0x14')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x24af2d[_0x962b('0x35')]===_0x962b('0x3c')){_0x3f24ef={'method':_0x962b('0xb'),'uri':_0x6a3cb5+_0x962b('0x3d'),'body':Object[_0x962b('0x37')]({},{'subject':intUtil[_0x962b('0x38')](_0x24af2d[_0x962b('0x39')],_0x325abd,'\x20'),'phonenumber':String(_0x325abd[_0x962b('0x2b')]),'description':intUtil[_0x962b('0x38')](_0x24af2d['Descriptions'],_0x325abd,'\x0a'),'regardingobjectid_contact@odata.bind':_0x962b('0x3e')+_0xae8cbf[_0x962b('0x25')]+')','ownerid@odata.bind':_0x962b('0x20')+_0xae8cbf[_0x962b('0x18')]+')','directioncode':_0xae8cbf['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x962b('0x20')+_0xae8cbf['userId']+')','participationtypemask':_0xae8cbf['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x962b('0x3e')+_0xae8cbf[_0x962b('0x25')]+')','participationtypemask':_0xae8cbf[_0x962b('0x3f')]===_0x962b('0x40')?0x1:0x2}]},getCustomFields(_0x24af2d[_0x962b('0x3b')],_0x325abd,_0x24af2d[_0x962b('0x35')])),'headers':{'Authorization':'Bearer\x20'+_0x1e9d8e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3f24ef);})['then'](function(_0x51fa63){var _0x429a2a=_0x51fa63[_0x962b('0x21')][_0x962b('0x22')];var _0x3904bb=_0x429a2a[_0x962b('0x23')](_0x429a2a[_0x962b('0x24')]('(')+0x1,_0x429a2a[_0x962b('0x24')](')'));_0xae8cbf[_0x962b('0x41')]=_0x3904bb;_0xd0d9d7(_0xae8cbf);})[_0x962b('0x1b')](function(_0x3d9b73){_0x16ab94(_0x3d9b73[_0x962b('0x26')]);});});}function emit(_0x532a73,_0x1f5c7c,_0x150b78,_0xadde27){var _0x39bee5={'uri':util[_0x962b('0x42')](_0x962b('0x43'),_0x532a73,_0x150b78,_0xadde27)};io['to'](util['format'](_0x962b('0x44'),_0x1f5c7c))[_0x962b('0x45')]('trigger:browser:url',_0x39bee5);}exports['cs']=function(_0x303ba6,_0x31e522,_0x303e0c,_0x27f0f3,_0x5b24e8,_0x29acfe,_0x22910e,_0xcae6be){var _0x92b488={};_0x29acfe[_0x962b('0xd')]=intUtil['stripTrailingSlash'](_0x29acfe['remoteUri']);_0x29acfe[_0x962b('0x46')]=intUtil[_0x962b('0x47')](_0x29acfe[_0x962b('0x46')]);_0x92b488[_0x962b('0x3f')]=_0xcae6be===_0x962b('0x40')||_0xcae6be===_0x962b('0x48')?_0x962b('0x40'):_0x962b('0x1d');var _0x1120e0=util[_0x962b('0x42')](_0x962b('0x49'),_0x29acfe['remoteUri']);var _0x466a77=util[_0x962b('0x42')]('https://login.microsoftonline.com/%s/oauth2/token',_0x29acfe[_0x962b('0x4a')]);var _0x15adf6=util['format'](_0x962b('0x4b'),_0x29acfe[_0x962b('0x46')],_0x31e522[_0x962b('0x4c')],md5(_0x31e522[_0x962b('0x4c')]));if(_0x5b24e8&&_0x5b24e8[_0x962b('0x4d')]){logger[_0x962b('0x4e')](_0x962b('0x4f'),'Recording\x20is\x20enabled!');_0x31e522[_0x962b('0x50')]=_0x15adf6;}else if(_0x22910e&&_0x22910e['recordingFormat']&&_0x22910e[_0x962b('0x51')]!==_0x962b('0x52')){logger['info'](_0x962b('0x53'),_0x962b('0x54'));_0x31e522['recordingURL']=_0x15adf6;}else{_0x31e522['recordingURL']='';}return getUser(_0x92b488,_0x29acfe,_0x27f0f3,_0x466a77,_0x1120e0)['then'](function(_0x43f2a1){logger['info'](_0x962b('0x55'),_0x43f2a1[_0x962b('0x18')]);logger[_0x962b('0x4e')]('The\x20User\x20email\x20is:',_0x43f2a1[_0x962b('0x16')]);return getEndUser(_0x43f2a1,_0x29acfe,_0x466a77,_0x1120e0,_0x31e522,_0xcae6be);})[_0x962b('0x11')](function(_0x1d9c2e){logger['info'](_0x962b('0x56'),_0x1d9c2e[_0x962b('0x25')]);logger[_0x962b('0x4e')](_0x962b('0x57'),_0x31e522['calleridnum']);return getTicket(_0x1d9c2e,_0x29acfe,_0x466a77,_0x1120e0,_0x31e522,_0x303e0c);})[_0x962b('0x11')](function(_0x2407d1){logger[_0x962b('0x4e')](util['format'](_0x962b('0x58'),_0x303e0c[_0x962b('0x35')],_0x2407d1[_0x962b('0x41')]));logger[_0x962b('0x4e')](util[_0x962b('0x42')]('call\x20direction:\x20%s',_0xcae6be));if(_0xcae6be!==_0x962b('0x48')){logger[_0x962b('0x4e')]('['+_0xcae6be['toUpperCase']()+']',_0x962b('0x59'));emit(_0x29acfe[_0x962b('0xd')],_0x27f0f3[_0x962b('0x5a')],_0x303e0c['ticketType'],_0x2407d1['ticketId']);}})[_0x962b('0x1b')](function(_0x4b07b9){logger[_0x962b('0x5b')]('['+_0xcae6be['toUpperCase']()+_0x962b('0x5c'),util['inspect'](_0x4b07b9,{'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 2f6085a..cebe6af 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 _0xb761=['push','Variable','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','none','[OUTBOUND]','destcalleridnum','Ticket\x20created!','trigger:browser:url','%s/helpdesk/tickets/%d','monitor_format','[ABANDONED]','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','value','remoteUri','POST','then','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','stringify','GET','map','forEach','type','string','nameField','toLowerCase','content','idField','customField','variable','variableName'];(function(_0x1a8baf,_0x510471){var _0x1fe022=function(_0x5741a0){while(--_0x5741a0){_0x1a8baf['push'](_0x1a8baf['shift']());}};_0x1fe022(++_0x510471);}(_0xb761,0x177));var _0x1b76=function(_0x378720,_0xa711f1){_0x378720=_0x378720-0x0;var _0x47920a=_0xb761[_0x378720];return _0x47920a;};'use strict';var _=require(_0x1b76('0x0'));var rp=require(_0x1b76('0x1'));var md5=require(_0x1b76('0x2'));var util=require(_0x1b76('0x3'));var Redis=require('ioredis');var intUtil=require(_0x1b76('0x4'));var config=require(_0x1b76('0x5'));var logger=require(_0x1b76('0x6'))(_0x1b76('0x7'));config[_0x1b76('0x8')]=_[_0x1b76('0x9')](config[_0x1b76('0x8')],{'host':_0x1b76('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1b76('0x8')]));var headers={'Content-Type':_0x1b76('0xb'),'Accept':_0x1b76('0xb')};function emit(_0x44dde2,_0x327b82,_0x30e5c4){io['to'](_0x44dde2)['emit'](_0x327b82,_0x30e5c4);}function getTicket(_0xb445c7,_0xd2508,_0x3576f3,_0x193b1e,_0x1835a5){logger[_0x1b76('0xc')](_0x1b76('0xd'));var _0x50dd51=_['merge']({'responder_id':_0xd2508['id'],'requester_id':_0x3576f3['id'],'name':util[_0x1b76('0xe')](_0x1b76('0xf'),_0x1835a5[_0x1b76('0x10')]),'phone':_0x1835a5['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1b76('0x11')](_0x193b1e[_0x1b76('0x12')],_0x1835a5,'\x20'),'description':intUtil[_0x1b76('0x11')](_0x193b1e[_0x1b76('0x13')],_0x1835a5,_0x1b76('0x14')),'tags':getTags(_0x193b1e[_0x1b76('0x15')],_0x1b76('0x16'))},getCustomFields(_0x193b1e[_0x1b76('0x17')],_0x1835a5));_0x50dd51[_0x1b76('0x18')]=_[_0x1b76('0x19')](_['keyBy'](_0x50dd51[_0x1b76('0x18')],'id'),_0x1b76('0x1a'));return request({'uri':util['format']('%s/api/v2/tickets',_0xb445c7[_0x1b76('0x1b')]),'method':_0x1b76('0x1c'),'body':_0x50dd51})['then'](function(_0x36329d){logger['info']('Ticket\x20created!');return _0x36329d;});}function getUser(_0xa74815,_0x2d9762){if(intUtil['validateEmail'](_0x2d9762)===!![]){return request({'uri':util[_0x1b76('0xe')]('%s/api/v2/agents',_0xa74815[_0x1b76('0x1b')]),'qs':{'email':_0x2d9762}})[_0x1b76('0x1d')](function(_0x471534){if(_0x471534[_0x1b76('0x1e')]){logger[_0x1b76('0xc')](_0x1b76('0x1f'));return _[_0x1b76('0x20')](_0x471534,function(_0x4e3196){return _0x4e3196[_0x1b76('0x21')][_0x1b76('0x22')]===_0x2d9762;});}else{logger['info'](_0x1b76('0x23'));return request({'uri':util['format']('%s/api/v2/agents/me',_0xa74815[_0x1b76('0x1b')])})[_0x1b76('0x1d')](function(_0x463177){logger[_0x1b76('0xc')](_0x1b76('0x24'));return _0x463177;});}});}else{return request({'uri':util['format'](_0x1b76('0x25'),_0xa74815['remoteUri'])})[_0x1b76('0x1d')](function(_0x589967){logger[_0x1b76('0xc')](_0x1b76('0x24'));return _0x589967;});}}function getEndUser(_0x5b4a02,_0x4f1529,_0x2e7998){logger['info'](_0x1b76('0x26'),_0x2e7998);return request({'uri':util[_0x1b76('0xe')](_0x1b76('0x27'),_0x5b4a02[_0x1b76('0x1b')]),'qs':{'phone':_0x2e7998}})[_0x1b76('0x1d')](function(_0x4519a7){if(_0x4519a7[_0x1b76('0x1e')]){logger[_0x1b76('0xc')](_0x1b76('0x28'));return _[_0x1b76('0x20')](_0x4519a7,{'phone':_0x2e7998});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format']('%s/api/v2/contacts',_0x5b4a02[_0x1b76('0x1b')]),'method':'POST','body':{'name':_0x4f1529,'phone':_0x2e7998}})[_0x1b76('0x1d')](function(_0x2b2911){logger[_0x1b76('0xc')](_0x1b76('0x29'));return _0x2b2911;});}});}function getAuth(_0x16937b){return util[_0x1b76('0xe')](_0x1b76('0x2a'),new Buffer(_0x16937b[_0x1b76('0x2b')]+':X')[_0x1b76('0x2c')](_0x1b76('0x2d')));}function request(_0x1a490e){logger[_0x1b76('0x2e')]('[HTTP]',JSON[_0x1b76('0x2f')](_0x1a490e));return rp(_[_0x1b76('0x9')](_0x1a490e,{'method':_0x1b76('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x1c3f19,_0xeb6fb4){var _0x44bcfc=[];if(_0x1c3f19&&_0x1c3f19[_0x1b76('0x1e')]>0x0){_0x44bcfc=_[_0x1b76('0x31')](_0x1c3f19,_0xeb6fb4);}return _0x44bcfc;}function getCustomFields(_0x5eb32d,_0x5b9e55){var _0x401c00=[];var _0x4567c6={'custom_fields':[]};if(_0x5eb32d['length']>0x0){_[_0x1b76('0x32')](_0x5eb32d,function(_0x7a0368){if(_0x7a0368[_0x1b76('0x33')]===_0x1b76('0x34')&&_0x7a0368[_0x1b76('0x35')]&&!_0x7a0368['customField']){_0x4567c6[_0x7a0368[_0x1b76('0x35')][_0x1b76('0x36')]()]=_0x7a0368[_0x1b76('0x37')]['toString']();}else if(_0x7a0368[_0x1b76('0x33')]==='string'&&_0x7a0368[_0x1b76('0x38')]&&_0x7a0368[_0x1b76('0x39')]){_0x4567c6['custom_fields']['push']({'id':_0x7a0368[_0x1b76('0x38')],'value':_0x7a0368[_0x1b76('0x37')][_0x1b76('0x2c')]()});}else if(_0x7a0368[_0x1b76('0x33')]===_0x1b76('0x3a')&&_0x7a0368[_0x1b76('0x3b')]&&_0x7a0368[_0x1b76('0x38')]&&_0x7a0368[_0x1b76('0x39')]){_0x5b9e55[_0x7a0368[_0x1b76('0x3b')]]&&_0x4567c6[_0x1b76('0x18')][_0x1b76('0x3c')]({'id':_0x7a0368[_0x1b76('0x38')],'value':_0x5b9e55[_0x7a0368['variableName']][_0x1b76('0x2c')]()});}else if(_0x7a0368[_0x1b76('0x33')]==='customVariable'&&_0x7a0368['Variable']&&_0x7a0368[_0x1b76('0x3d')][_0x1b76('0x16')]&&_0x7a0368['idField']&&_0x7a0368[_0x1b76('0x39')]){_0x5b9e55[_0x7a0368[_0x1b76('0x3d')][_0x1b76('0x16')][_0x1b76('0x36')]()]&&_0x4567c6[_0x1b76('0x18')]['push']({'id':_0x7a0368[_0x1b76('0x38')],'value':_0x5b9e55[_0x7a0368[_0x1b76('0x3d')][_0x1b76('0x16')][_0x1b76('0x36')]()][_0x1b76('0x2c')]()});}});}return _0x4567c6;}exports[_0x1b76('0x3e')]=function(_0x42cdf2,_0x4fddb6,_0x2ff043,_0x2711eb,_0x193c8f,_0x3d82fe){var _0x23601,_0x1ce020;_0x3d82fe[_0x1b76('0x1b')]=intUtil[_0x1b76('0x3f')](_0x3d82fe[_0x1b76('0x1b')]);_0x3d82fe[_0x1b76('0x40')]=intUtil[_0x1b76('0x3f')](_0x3d82fe[_0x1b76('0x40')]);if(_0x193c8f&&_0x193c8f['monitor_format']){logger[_0x1b76('0xc')]('[QUEUE]',_0x1b76('0x41'));_0x4fddb6['recordingURL']=util[_0x1b76('0xe')](_0x1b76('0x42'),_0x3d82fe[_0x1b76('0x40')],_0x4fddb6[_0x1b76('0x43')],md5(_0x4fddb6[_0x1b76('0x43')]));}else{_0x4fddb6[_0x1b76('0x44')]='';}headers[_0x1b76('0x45')]=getAuth(_0x3d82fe);return getUser(_0x3d82fe,_0x2711eb['email'])[_0x1b76('0x1d')](function(_0x19fd99){_0x23601=_0x19fd99;logger['info'](_0x1b76('0x46'),_0x23601['id']);return getEndUser(_0x3d82fe,_0x4fddb6[_0x1b76('0x10')],_0x4fddb6[_0x1b76('0x47')]);})[_0x1b76('0x1d')](function(_0x4a618e){_0x1ce020=_0x4a618e;logger['info'](_0x1b76('0x48'),_0x1ce020['id']);return getTicket(_0x3d82fe,_0x23601,_0x1ce020,_0x2ff043,_0x4fddb6);})[_0x1b76('0x1d')](function(_0x1650ed){if(_0x1650ed&&_0x1650ed['id']){logger[_0x1b76('0xc')]('Ticket\x20created!');logger[_0x1b76('0xc')](_0x1b76('0x49'),_0x1650ed['id']);logger[_0x1b76('0xc')](_0x1b76('0x4a'),_0x1b76('0x4b'));emit(util['format'](_0x1b76('0x4c'),_0x2711eb[_0x1b76('0x16')]),'trigger:browser:url',{'uri':util[_0x1b76('0xe')]('%s/helpdesk/tickets/%d',_0x3d82fe['remoteUri'],_0x1650ed['id'])});}})[_0x1b76('0x4d')](function(_0x344863){logger[_0x1b76('0x4e')]('[QUEUE]',JSON[_0x1b76('0x2f')](_0x344863));});};exports['outbound']=function(_0x5951b0,_0x175346,_0x165980,_0x2a7648,_0x2642fe,_0x479c8c,_0x4a6562){var _0x295013,_0x267630;_0x479c8c[_0x1b76('0x1b')]=intUtil[_0x1b76('0x3f')](_0x479c8c['remoteUri']);_0x479c8c['serverUrl']=intUtil[_0x1b76('0x3f')](_0x479c8c[_0x1b76('0x40')]);if(_0x4a6562&&_0x4a6562['recordingFormat']&&_0x4a6562['recordingFormat']!==_0x1b76('0x4f')){logger[_0x1b76('0xc')](_0x1b76('0x50'),'Recording\x20is\x20enabled!');_0x175346[_0x1b76('0x44')]=util[_0x1b76('0xe')](_0x1b76('0x42'),_0x479c8c[_0x1b76('0x40')],_0x175346[_0x1b76('0x43')],md5(_0x175346[_0x1b76('0x43')]));}headers[_0x1b76('0x45')]=getAuth(_0x479c8c);return getUser(_0x479c8c,_0x2a7648['email'])['then'](function(_0x91b04f){_0x295013=_0x91b04f;logger[_0x1b76('0xc')]('The\x20User\x20ID\x20is:',_0x295013['id']);return getEndUser(_0x479c8c,_0x175346['destcalleridname'],_0x175346[_0x1b76('0x51')]);})[_0x1b76('0x1d')](function(_0x2e7794){_0x267630=_0x2e7794;logger['info'](_0x1b76('0x48'),_0x267630['id']);return getTicket(_0x479c8c,_0x295013,_0x267630,_0x165980,_0x175346);})[_0x1b76('0x1d')](function(_0x41ad0b){if(_0x41ad0b&&_0x41ad0b['id']){logger[_0x1b76('0xc')](_0x1b76('0x52'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x41ad0b['id']);logger[_0x1b76('0xc')]('[OUTBOUND]',_0x1b76('0x4b'));emit(util[_0x1b76('0xe')](_0x1b76('0x4c'),_0x2a7648[_0x1b76('0x16')]),_0x1b76('0x53'),{'uri':util[_0x1b76('0xe')](_0x1b76('0x54'),_0x479c8c[_0x1b76('0x1b')],_0x41ad0b['id'])});}})[_0x1b76('0x4d')](function(_0x56a2a0){logger[_0x1b76('0x4e')]('[OUTBOUND]',JSON[_0x1b76('0x2f')](_0x56a2a0));});};exports['abandoned']=function(_0x4482a3,_0x3762d8,_0x37f22a,_0x43671a,_0x222a5c,_0x197a40){var _0xda8264,_0x26cdf6;_0x197a40[_0x1b76('0x1b')]=intUtil[_0x1b76('0x3f')](_0x197a40[_0x1b76('0x1b')]);_0x197a40[_0x1b76('0x40')]=intUtil[_0x1b76('0x3f')](_0x197a40['serverUrl']);if(_0x222a5c&&_0x222a5c[_0x1b76('0x55')]){logger['info'](_0x1b76('0x56'),_0x1b76('0x41'));_0x3762d8[_0x1b76('0x44')]=util['format'](_0x1b76('0x42'),_0x197a40[_0x1b76('0x40')],_0x3762d8[_0x1b76('0x43')],md5(_0x3762d8[_0x1b76('0x43')]));}else{_0x3762d8[_0x1b76('0x44')]='';}headers['Authorization']=getAuth(_0x197a40);return getUser(_0x197a40,'')[_0x1b76('0x1d')](function(_0x26a060){_0xda8264=_0x26a060;logger['info'](_0x1b76('0x46'),_0xda8264['id']);return getEndUser(_0x197a40,_0x3762d8[_0x1b76('0x10')],_0x3762d8[_0x1b76('0x47')]);})[_0x1b76('0x1d')](function(_0x245b07){_0x26cdf6=_0x245b07;logger[_0x1b76('0xc')](_0x1b76('0x48'),_0x26cdf6['id']);return getTicket(_0x197a40,_0xda8264,_0x26cdf6,_0x37f22a,_0x3762d8);})['then'](function(_0x3e5c59){if(_0x3e5c59){logger[_0x1b76('0xc')](_0x1b76('0x52'));logger[_0x1b76('0xc')](_0x1b76('0x49'),_0x3e5c59['id']);}})['catch'](function(_0x15ca7b){logger[_0x1b76('0x4e')](_0x1b76('0x56'),JSON[_0x1b76('0x2f')](_0x15ca7b));});}; \ No newline at end of file +var _0xd6e0=['apiKey','toString','base64','debug','[HTTP]','stringify','GET','forEach','type','string','nameField','customField','toLowerCase','content','idField','push','variable','variableName','Variable','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','[QUEUE]','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','abandoned','[ABANDONED]','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s'];(function(_0x4a5c02,_0x5dc14a){var _0x39a30f=function(_0x3fd756){while(--_0x3fd756){_0x4a5c02['push'](_0x4a5c02['shift']());}};_0x39a30f(++_0x5dc14a);}(_0xd6e0,0x193));var _0x0d6e=function(_0x3cf5a3,_0x5a4492){_0x3cf5a3=_0x3cf5a3-0x0;var _0x39ba2d=_0xd6e0[_0x3cf5a3];return _0x39ba2d;};'use strict';var _=require(_0x0d6e('0x0'));var rp=require(_0x0d6e('0x1'));var md5=require(_0x0d6e('0x2'));var util=require(_0x0d6e('0x3'));var Redis=require(_0x0d6e('0x4'));var intUtil=require('./util');var config=require(_0x0d6e('0x5'));var logger=require(_0x0d6e('0x6'))(_0x0d6e('0x7'));config[_0x0d6e('0x8')]=_[_0x0d6e('0x9')](config[_0x0d6e('0x8')],{'host':_0x0d6e('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x0d6e('0xb'),'Accept':_0x0d6e('0xb')};function emit(_0x474f59,_0x4b10c5,_0xac651d){io['to'](_0x474f59)[_0x0d6e('0xc')](_0x4b10c5,_0xac651d);}function getTicket(_0x1ddf8e,_0x302401,_0x3674d7,_0x429831,_0x3e6bf4){logger[_0x0d6e('0xd')]('Creating\x20new\x20ticket...');var _0x35db49=_[_0x0d6e('0xe')]({'responder_id':_0x302401['id'],'requester_id':_0x3674d7['id'],'name':util[_0x0d6e('0xf')](_0x0d6e('0x10'),_0x3e6bf4[_0x0d6e('0x11')]),'phone':_0x3e6bf4[_0x0d6e('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x0d6e('0x13')](_0x429831[_0x0d6e('0x14')],_0x3e6bf4,'\x20'),'description':intUtil[_0x0d6e('0x13')](_0x429831[_0x0d6e('0x15')],_0x3e6bf4,_0x0d6e('0x16')),'tags':getTags(_0x429831[_0x0d6e('0x17')],_0x0d6e('0x18'))},getCustomFields(_0x429831[_0x0d6e('0x19')],_0x3e6bf4));_0x35db49[_0x0d6e('0x1a')]=_[_0x0d6e('0x1b')](_[_0x0d6e('0x1c')](_0x35db49['custom_fields'],'id'),_0x0d6e('0x1d'));return request({'uri':util[_0x0d6e('0xf')](_0x0d6e('0x1e'),_0x1ddf8e[_0x0d6e('0x1f')]),'method':'POST','body':_0x35db49})[_0x0d6e('0x20')](function(_0x28f8bd){logger[_0x0d6e('0xd')](_0x0d6e('0x21'));return _0x28f8bd;});}function getUser(_0x74ef7c,_0x4300a7){if(intUtil[_0x0d6e('0x22')](_0x4300a7)===!![]){return request({'uri':util[_0x0d6e('0xf')]('%s/api/v2/agents',_0x74ef7c[_0x0d6e('0x1f')]),'qs':{'email':_0x4300a7}})['then'](function(_0x5c11e1){if(_0x5c11e1[_0x0d6e('0x23')]){logger[_0x0d6e('0xd')](_0x0d6e('0x24'));return _[_0x0d6e('0x25')](_0x5c11e1,function(_0x144c8f){return _0x144c8f[_0x0d6e('0x26')][_0x0d6e('0x27')]===_0x4300a7;});}else{logger['info'](_0x0d6e('0x28'));return request({'uri':util[_0x0d6e('0xf')](_0x0d6e('0x29'),_0x74ef7c['remoteUri'])})[_0x0d6e('0x20')](function(_0x1ee4b4){logger[_0x0d6e('0xd')](_0x0d6e('0x2a'));return _0x1ee4b4;});}});}else{return request({'uri':util[_0x0d6e('0xf')](_0x0d6e('0x29'),_0x74ef7c[_0x0d6e('0x1f')])})['then'](function(_0x36f06b){logger[_0x0d6e('0xd')](_0x0d6e('0x2a'));return _0x36f06b;});}}function getEndUser(_0x123295,_0x4c3350,_0x550c17){logger[_0x0d6e('0xd')](_0x0d6e('0x2b'),_0x550c17);return request({'uri':util[_0x0d6e('0xf')]('%s/api/v2/contacts',_0x123295[_0x0d6e('0x1f')]),'qs':{'phone':_0x550c17}})[_0x0d6e('0x20')](function(_0x14c8e6){if(_0x14c8e6['length']){logger['info']('Enduser\x20found!');return _['find'](_0x14c8e6,{'phone':_0x550c17});}else{logger[_0x0d6e('0xd')](_0x0d6e('0x2c'));return request({'uri':util[_0x0d6e('0xf')]('%s/api/v2/contacts',_0x123295['remoteUri']),'method':'POST','body':{'name':_0x4c3350,'phone':_0x550c17}})[_0x0d6e('0x20')](function(_0x28d83b){logger[_0x0d6e('0xd')](_0x0d6e('0x2d'));return _0x28d83b;});}});}function getAuth(_0x45aad1){return util[_0x0d6e('0xf')](_0x0d6e('0x2e'),new Buffer(_0x45aad1[_0x0d6e('0x2f')]+':X')[_0x0d6e('0x30')](_0x0d6e('0x31')));}function request(_0x3e4205){logger[_0x0d6e('0x32')](_0x0d6e('0x33'),JSON[_0x0d6e('0x34')](_0x3e4205));return rp(_[_0x0d6e('0x9')](_0x3e4205,{'method':_0x0d6e('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x3d1a0e,_0x27d032){var _0x1a3db9=[];if(_0x3d1a0e&&_0x3d1a0e['length']>0x0){_0x1a3db9=_['map'](_0x3d1a0e,_0x27d032);}return _0x1a3db9;}function getCustomFields(_0x2897a7,_0x3e9cd0){var _0x30f254=[];var _0x33722f={'custom_fields':[]};if(_0x2897a7['length']>0x0){_[_0x0d6e('0x36')](_0x2897a7,function(_0x295263){if(_0x295263[_0x0d6e('0x37')]===_0x0d6e('0x38')&&_0x295263[_0x0d6e('0x39')]&&!_0x295263[_0x0d6e('0x3a')]){_0x33722f[_0x295263[_0x0d6e('0x39')][_0x0d6e('0x3b')]()]=_0x295263[_0x0d6e('0x3c')][_0x0d6e('0x30')]();}else if(_0x295263[_0x0d6e('0x37')]===_0x0d6e('0x38')&&_0x295263[_0x0d6e('0x3d')]&&_0x295263['customField']){_0x33722f['custom_fields'][_0x0d6e('0x3e')]({'id':_0x295263[_0x0d6e('0x3d')],'value':_0x295263[_0x0d6e('0x3c')][_0x0d6e('0x30')]()});}else if(_0x295263[_0x0d6e('0x37')]===_0x0d6e('0x3f')&&_0x295263[_0x0d6e('0x40')]&&_0x295263['idField']&&_0x295263[_0x0d6e('0x3a')]){_0x3e9cd0[_0x295263[_0x0d6e('0x40')]]&&_0x33722f[_0x0d6e('0x1a')][_0x0d6e('0x3e')]({'id':_0x295263[_0x0d6e('0x3d')],'value':_0x3e9cd0[_0x295263[_0x0d6e('0x40')]][_0x0d6e('0x30')]()});}else if(_0x295263[_0x0d6e('0x37')]==='customVariable'&&_0x295263[_0x0d6e('0x41')]&&_0x295263[_0x0d6e('0x41')][_0x0d6e('0x18')]&&_0x295263[_0x0d6e('0x3d')]&&_0x295263['customField']){_0x3e9cd0[_0x295263[_0x0d6e('0x41')][_0x0d6e('0x18')][_0x0d6e('0x3b')]()]&&_0x33722f[_0x0d6e('0x1a')][_0x0d6e('0x3e')]({'id':_0x295263[_0x0d6e('0x3d')],'value':_0x3e9cd0[_0x295263['Variable'][_0x0d6e('0x18')][_0x0d6e('0x3b')]()]['toString']()});}});}return _0x33722f;}exports['queue']=function(_0x585c30,_0x3cefa9,_0x2da188,_0x356235,_0x165a99,_0xf25592){var _0x4d6e9b,_0x441b41;_0xf25592[_0x0d6e('0x1f')]=intUtil[_0x0d6e('0x42')](_0xf25592[_0x0d6e('0x1f')]);_0xf25592['serverUrl']=intUtil[_0x0d6e('0x42')](_0xf25592[_0x0d6e('0x43')]);if(_0x165a99&&_0x165a99[_0x0d6e('0x44')]){logger[_0x0d6e('0xd')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3cefa9[_0x0d6e('0x45')]=util['format'](_0x0d6e('0x46'),_0xf25592[_0x0d6e('0x43')],_0x3cefa9[_0x0d6e('0x47')],md5(_0x3cefa9[_0x0d6e('0x47')]));}else{_0x3cefa9['recordingURL']='';}headers[_0x0d6e('0x48')]=getAuth(_0xf25592);return getUser(_0xf25592,_0x356235[_0x0d6e('0x27')])[_0x0d6e('0x20')](function(_0x4abeeb){_0x4d6e9b=_0x4abeeb;logger['info'](_0x0d6e('0x49'),_0x4d6e9b['id']);return getEndUser(_0xf25592,_0x3cefa9[_0x0d6e('0x11')],_0x3cefa9[_0x0d6e('0x12')]);})['then'](function(_0x380cdd){_0x441b41=_0x380cdd;logger[_0x0d6e('0xd')](_0x0d6e('0x4a'),_0x441b41['id']);return getTicket(_0xf25592,_0x4d6e9b,_0x441b41,_0x2da188,_0x3cefa9);})[_0x0d6e('0x20')](function(_0x269eb3){if(_0x269eb3&&_0x269eb3['id']){logger[_0x0d6e('0xd')](_0x0d6e('0x21'));logger[_0x0d6e('0xd')]('The\x20Ticket\x20ID\x20is:',_0x269eb3['id']);logger[_0x0d6e('0xd')](_0x0d6e('0x4b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0d6e('0xf')]('user:%s',_0x356235[_0x0d6e('0x18')]),_0x0d6e('0x4c'),{'uri':util[_0x0d6e('0xf')](_0x0d6e('0x4d'),_0xf25592[_0x0d6e('0x1f')],_0x269eb3['id'])});}})[_0x0d6e('0x4e')](function(_0x51f49a){logger[_0x0d6e('0x4f')](_0x0d6e('0x4b'),JSON['stringify'](_0x51f49a));});};exports[_0x0d6e('0x50')]=function(_0x27ea4a,_0x3914ba,_0x5ea404,_0xf4975d,_0x5cd4d7,_0x116265,_0x1517d1){var _0x3f4acd,_0x23a038;_0x116265[_0x0d6e('0x1f')]=intUtil[_0x0d6e('0x42')](_0x116265['remoteUri']);_0x116265[_0x0d6e('0x43')]=intUtil['stripTrailingSlash'](_0x116265[_0x0d6e('0x43')]);if(_0x1517d1&&_0x1517d1[_0x0d6e('0x51')]&&_0x1517d1[_0x0d6e('0x51')]!=='none'){logger[_0x0d6e('0xd')](_0x0d6e('0x52'),_0x0d6e('0x53'));_0x3914ba[_0x0d6e('0x45')]=util[_0x0d6e('0xf')](_0x0d6e('0x46'),_0x116265['serverUrl'],_0x3914ba[_0x0d6e('0x47')],md5(_0x3914ba[_0x0d6e('0x47')]));}headers[_0x0d6e('0x48')]=getAuth(_0x116265);return getUser(_0x116265,_0xf4975d[_0x0d6e('0x27')])[_0x0d6e('0x20')](function(_0x41f260){_0x3f4acd=_0x41f260;logger['info'](_0x0d6e('0x49'),_0x3f4acd['id']);return getEndUser(_0x116265,_0x3914ba['destcalleridname'],_0x3914ba[_0x0d6e('0x54')]);})[_0x0d6e('0x20')](function(_0x24fe28){_0x23a038=_0x24fe28;logger['info']('The\x20Enduser\x20ID\x20is:',_0x23a038['id']);return getTicket(_0x116265,_0x3f4acd,_0x23a038,_0x5ea404,_0x3914ba);})['then'](function(_0x5b5718){if(_0x5b5718&&_0x5b5718['id']){logger[_0x0d6e('0xd')](_0x0d6e('0x21'));logger[_0x0d6e('0xd')](_0x0d6e('0x55'),_0x5b5718['id']);logger[_0x0d6e('0xd')]('[OUTBOUND]',_0x0d6e('0x56'));emit(util[_0x0d6e('0xf')](_0x0d6e('0x57'),_0xf4975d[_0x0d6e('0x18')]),_0x0d6e('0x4c'),{'uri':util[_0x0d6e('0xf')]('%s/helpdesk/tickets/%d',_0x116265['remoteUri'],_0x5b5718['id'])});}})[_0x0d6e('0x4e')](function(_0x3a5833){logger['error'](_0x0d6e('0x52'),JSON[_0x0d6e('0x34')](_0x3a5833));});};exports[_0x0d6e('0x58')]=function(_0x35a79f,_0x338bd3,_0x483006,_0x280327,_0x58fa48,_0x71e7d5){var _0x8bf753,_0x50e539;_0x71e7d5[_0x0d6e('0x1f')]=intUtil[_0x0d6e('0x42')](_0x71e7d5['remoteUri']);_0x71e7d5[_0x0d6e('0x43')]=intUtil[_0x0d6e('0x42')](_0x71e7d5[_0x0d6e('0x43')]);if(_0x58fa48&&_0x58fa48[_0x0d6e('0x44')]){logger[_0x0d6e('0xd')](_0x0d6e('0x59'),'Recording\x20is\x20enabled!');_0x338bd3['recordingURL']=util['format'](_0x0d6e('0x46'),_0x71e7d5[_0x0d6e('0x43')],_0x338bd3[_0x0d6e('0x47')],md5(_0x338bd3[_0x0d6e('0x47')]));}else{_0x338bd3[_0x0d6e('0x45')]='';}headers['Authorization']=getAuth(_0x71e7d5);return getUser(_0x71e7d5,'')[_0x0d6e('0x20')](function(_0x205ce7){_0x8bf753=_0x205ce7;logger[_0x0d6e('0xd')](_0x0d6e('0x49'),_0x8bf753['id']);return getEndUser(_0x71e7d5,_0x338bd3[_0x0d6e('0x11')],_0x338bd3[_0x0d6e('0x12')]);})['then'](function(_0x1b3643){_0x50e539=_0x1b3643;logger['info'](_0x0d6e('0x4a'),_0x50e539['id']);return getTicket(_0x71e7d5,_0x8bf753,_0x50e539,_0x483006,_0x338bd3);})[_0x0d6e('0x20')](function(_0x34edcf){if(_0x34edcf){logger[_0x0d6e('0xd')](_0x0d6e('0x21'));logger[_0x0d6e('0xd')](_0x0d6e('0x55'),_0x34edcf['id']);}})[_0x0d6e('0x4e')](function(_0x3266c2){logger[_0x0d6e('0x4f')](_0x0d6e('0x59'),JSON[_0x0d6e('0x34')](_0x3266c2));});}; \ 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 9d342d7..7088f56 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 _0xdfe9=['Configurations','data3','queue','routeId','outbound','log','desk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','lodash','./zendesk','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','vtiger','servicenow','dynamics365','exec','includes','data1','toLowerCase','find'];(function(_0x15ac1b,_0x4a313e){var _0x158f91=function(_0x1e861e){while(--_0x1e861e){_0x15ac1b['push'](_0x15ac1b['shift']());}};_0x158f91(++_0x4a313e);}(_0xdfe9,0xc3));var _0x9dfe=function(_0x4f792d,_0x5f99e1){_0x4f792d=_0x4f792d-0x0;var _0x19d11d=_0xdfe9[_0x4f792d];return _0x19d11d;};'use strict';var _=require(_0x9dfe('0x0'));var util=require('util');var zendesk=require(_0x9dfe('0x1'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x9dfe('0x2'));var zoho=require(_0x9dfe('0x3'));var desk=require(_0x9dfe('0x4'));var vtiger=require(_0x9dfe('0x5'));var servicenow=require(_0x9dfe('0x6'));var dynamics365=require(_0x9dfe('0x7'));var integrations=[_0x9dfe('0x8'),_0x9dfe('0x9'),_0x9dfe('0xa'),_0x9dfe('0xb'),_0x9dfe('0xc'),'desk',_0x9dfe('0xd'),_0x9dfe('0xe'),_0x9dfe('0xf')];exports[_0x9dfe('0x10')]=function(_0xcd9ecb,_0x13fa46,_0xff1698,_0xaed877,_0x58e7bb,_0x263ad7){if(_0xff1698){if(_[_0x9dfe('0x11')](integrations,_0xcd9ecb[_0x9dfe('0x12')][_0x9dfe('0x13')]())){try{var _0x5f4511=null;var _0x4ebe42='';var _0x825165=_0xff1698[_0xcd9ecb[_0x9dfe('0x12')]['toLowerCase']()];if(_0x825165){var _0x547ae1=_0x825165[_0xcd9ecb['data2']];if(_0x547ae1){var _0x173898=_[_0x9dfe('0x14')](_0x547ae1[_0x9dfe('0x15')],{'id':parseInt(_0xcd9ecb[_0x9dfe('0x16')],0xa)});if(_0x173898){if(_0xaed877){if(_0x58e7bb&&_0x13fa46[_0x9dfe('0x17')]){_0x4ebe42=_0x9dfe('0x17');}else if(_0x13fa46[_0x9dfe('0x18')]){_0x4ebe42=_0x9dfe('0x19');}else{console[_0x9dfe('0x1a')]('EVENT\x20UNKNOWN',_0x13fa46);}}else{_0x4ebe42='abandoned';}switch(_0xcd9ecb[_0x9dfe('0x12')]['toLowerCase']()){case _0x9dfe('0x8'):zendesk[_0x4ebe42](_0xcd9ecb,_0x13fa46,_0x173898,_0xaed877,_0x58e7bb,_0x547ae1,_0x263ad7);break;case _0x9dfe('0x9'):salesforce[_0x4ebe42](_0xcd9ecb,_0x13fa46,_0x173898,_0xaed877,_0x58e7bb,_0x547ae1,_0x263ad7);break;case _0x9dfe('0xa'):sugarcrm[_0x4ebe42](_0xcd9ecb,_0x13fa46,_0x173898,_0xaed877,_0x58e7bb,_0x547ae1,_0x263ad7);break;case _0x9dfe('0xb'):freshdesk[_0x4ebe42](_0xcd9ecb,_0x13fa46,_0x173898,_0xaed877,_0x58e7bb,_0x547ae1,_0x263ad7);break;case _0x9dfe('0xc'):zoho[_0x4ebe42](_0xcd9ecb,_0x13fa46,_0x173898,_0xaed877,_0x58e7bb,_0x547ae1,_0x263ad7);break;case _0x9dfe('0x1b'):desk[_0x4ebe42](_0xcd9ecb,_0x13fa46,_0x173898,_0xaed877,_0x58e7bb,_0x547ae1,_0x263ad7);break;case'vtiger':vtiger[_0x4ebe42](_0xcd9ecb,_0x13fa46,_0x173898,_0xaed877,_0x58e7bb,_0x547ae1,_0x263ad7);break;case _0x9dfe('0xe'):servicenow['cs'](_0xcd9ecb,_0x13fa46,_0x173898,_0xaed877,_0x58e7bb,_0x547ae1,_0x263ad7,_0x4ebe42);case _0x9dfe('0xf'):dynamics365['cs'](_0xcd9ecb,_0x13fa46,_0x173898,_0xaed877,_0x58e7bb,_0x547ae1,_0x263ad7,_0x4ebe42);break;default:console[_0x9dfe('0x1a')](_0x9dfe('0x1c'));}}else{_0x5f4511=require(_0x9dfe('0x1d'))(_0xcd9ecb[_0x9dfe('0x12')][_0x9dfe('0x13')]());_0x5f4511[_0x9dfe('0x1e')](_0x9dfe('0x1f'),util[_0x9dfe('0x20')](_0x9dfe('0x21'),_0xcd9ecb[_0x9dfe('0x12')][_0x9dfe('0x13')](),_0xcd9ecb[_0x9dfe('0x16')]));}}else{_0x5f4511=require('../../../../config/logger')(_0xcd9ecb['data1'][_0x9dfe('0x13')]());_0x5f4511[_0x9dfe('0x1e')](_0x9dfe('0x1f'),util[_0x9dfe('0x20')](_0x9dfe('0x22'),_0xcd9ecb[_0x9dfe('0x12')][_0x9dfe('0x13')](),_0xcd9ecb[_0x9dfe('0x23')]));}}else{}}catch(_0x3538bb){console[_0x9dfe('0x1e')](_0x3538bb);}}}}; \ No newline at end of file +var _0x390a=['includes','toLowerCase','data1','data2','Configurations','routeId','log','EVENT\x20UNKNOWN','desk','vtiger','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','zendesk','salesforce','freshdesk','zoho','servicenow','dynamics365','exec'];(function(_0x537561,_0x3e7d5f){var _0x1a48bc=function(_0x52cffd){while(--_0x52cffd){_0x537561['push'](_0x537561['shift']());}};_0x1a48bc(++_0x3e7d5f);}(_0x390a,0xc9));var _0xa390=function(_0x2fbe32,_0x83addf){_0x2fbe32=_0x2fbe32-0x0;var _0x20fa21=_0x390a[_0x2fbe32];return _0x20fa21;};'use strict';var _=require(_0xa390('0x0'));var util=require(_0xa390('0x1'));var zendesk=require(_0xa390('0x2'));var salesforce=require(_0xa390('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xa390('0x4'));var zoho=require(_0xa390('0x5'));var desk=require(_0xa390('0x6'));var vtiger=require(_0xa390('0x7'));var servicenow=require('./servicenow');var dynamics365=require(_0xa390('0x8'));var integrations=[_0xa390('0x9'),_0xa390('0xa'),'sugarcrm',_0xa390('0xb'),_0xa390('0xc'),'desk','vtiger',_0xa390('0xd'),_0xa390('0xe')];exports[_0xa390('0xf')]=function(_0x226003,_0xc80e9d,_0x5106eb,_0x51ead2,_0x735319,_0x34f0fe){if(_0x5106eb){if(_[_0xa390('0x10')](integrations,_0x226003['data1'][_0xa390('0x11')]())){try{var _0x172371=null;var _0x49c3a0='';var _0x8580d5=_0x5106eb[_0x226003[_0xa390('0x12')]['toLowerCase']()];if(_0x8580d5){var _0x5cd158=_0x8580d5[_0x226003[_0xa390('0x13')]];if(_0x5cd158){var _0x19ba77=_['find'](_0x5cd158[_0xa390('0x14')],{'id':parseInt(_0x226003['data3'],0xa)});if(_0x19ba77){if(_0x51ead2){if(_0x735319&&_0xc80e9d['queue']){_0x49c3a0='queue';}else if(_0xc80e9d[_0xa390('0x15')]){_0x49c3a0='outbound';}else{console[_0xa390('0x16')](_0xa390('0x17'),_0xc80e9d);}}else{_0x49c3a0='abandoned';}switch(_0x226003[_0xa390('0x12')][_0xa390('0x11')]()){case'zendesk':zendesk[_0x49c3a0](_0x226003,_0xc80e9d,_0x19ba77,_0x51ead2,_0x735319,_0x5cd158,_0x34f0fe);break;case _0xa390('0xa'):salesforce[_0x49c3a0](_0x226003,_0xc80e9d,_0x19ba77,_0x51ead2,_0x735319,_0x5cd158,_0x34f0fe);break;case'sugarcrm':sugarcrm[_0x49c3a0](_0x226003,_0xc80e9d,_0x19ba77,_0x51ead2,_0x735319,_0x5cd158,_0x34f0fe);break;case _0xa390('0xb'):freshdesk[_0x49c3a0](_0x226003,_0xc80e9d,_0x19ba77,_0x51ead2,_0x735319,_0x5cd158,_0x34f0fe);break;case _0xa390('0xc'):zoho[_0x49c3a0](_0x226003,_0xc80e9d,_0x19ba77,_0x51ead2,_0x735319,_0x5cd158,_0x34f0fe);break;case _0xa390('0x18'):desk[_0x49c3a0](_0x226003,_0xc80e9d,_0x19ba77,_0x51ead2,_0x735319,_0x5cd158,_0x34f0fe);break;case _0xa390('0x19'):vtiger[_0x49c3a0](_0x226003,_0xc80e9d,_0x19ba77,_0x51ead2,_0x735319,_0x5cd158,_0x34f0fe);break;case'servicenow':servicenow['cs'](_0x226003,_0xc80e9d,_0x19ba77,_0x51ead2,_0x735319,_0x5cd158,_0x34f0fe,_0x49c3a0);case _0xa390('0xe'):dynamics365['cs'](_0x226003,_0xc80e9d,_0x19ba77,_0x51ead2,_0x735319,_0x5cd158,_0x34f0fe,_0x49c3a0);break;default:console['log']('unknown\x20integration');}}else{_0x172371=require(_0xa390('0x1a'))(_0x226003[_0xa390('0x12')]['toLowerCase']());_0x172371[_0xa390('0x1b')](_0xa390('0x1c'),util['format'](_0xa390('0x1d'),_0x226003[_0xa390('0x12')]['toLowerCase'](),_0x226003['data3']));}}else{_0x172371=require(_0xa390('0x1a'))(_0x226003[_0xa390('0x12')][_0xa390('0x11')]());_0x172371['error']('[EXEC]',util[_0xa390('0x1e')]('%s\x20account\x20#%s\x20not\x20found',_0x226003[_0xa390('0x12')][_0xa390('0x11')](),_0x226003[_0xa390('0x13')]));}}else{}}catch(_0x5ea2de){console[_0xa390('0x1b')](_0x5ea2de);}}}}; \ 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 f257b65..8d9563d 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 _0xaa16=['lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','redis','localhost','socket.io-emitter','emit','merge','utc','getString','Subjects','Descriptions','WhoId','sobject','Task','create','validateEmail','User','then','length','Email','Agent\x20%s\x20found.','resolve','Name','info','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','find','contact','execute','lead','Lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','type','string','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','password','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','abandoned','[ABANDONED]','calleridnum','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','stringify'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xaa16,0x1b8));var _0x6aa1=function(_0x48ede8,_0x58d2e4){_0x48ede8=_0x48ede8-0x0;var _0xc2aea5=_0xaa16[_0x48ede8];return _0xc2aea5;};'use strict';var _=require(_0x6aa1('0x0'));var rp=require(_0x6aa1('0x1'));var moment=require(_0x6aa1('0x2'));var BPromise=require(_0x6aa1('0x3'));var md5=require(_0x6aa1('0x4'));var jsforce=require(_0x6aa1('0x5'));var util=require(_0x6aa1('0x6'));var Redis=require(_0x6aa1('0x7'));var intUtil=require(_0x6aa1('0x8'));var config=require('../../../../config/environment');var logger=require(_0x6aa1('0x9'))('salesforce');config[_0x6aa1('0xa')]=_['defaults'](config['redis'],{'host':_0x6aa1('0xb'),'port':0x18eb});var io=require(_0x6aa1('0xc'))(new Redis(config[_0x6aa1('0xa')]));function emit(_0x584101,_0x524e33,_0xf5db8e){io['to'](_0x584101)[_0x6aa1('0xd')](_0x524e33,_0xf5db8e);}function getTicket(_0x3c298c,_0x341e31,_0x2abca2,_0x1fefe7,_0x220875,_0x53928b,_0x31b328){var _0xa5816d=_[_0x6aa1('0xe')]({'OwnerId':_0x341e31['id'],'ActivityDate':moment[_0x6aa1('0xf')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x6aa1('0x10')](_0x1fefe7[_0x6aa1('0x11')],_0x220875,'\x20'),'Description':intUtil[_0x6aa1('0x10')](_0x1fefe7[_0x6aa1('0x12')],_0x220875,'\x0a')},getCustomFields(_0x53928b,_0x220875));if(_0x2abca2){_0xa5816d[_0x6aa1('0x13')]=_0x2abca2['id'];}return _0x31b328[_0x6aa1('0x14')](_0x6aa1('0x15'))[_0x6aa1('0x16')](_0xa5816d);}function getUser(_0xc0fe7,_0x370337,_0x366283){if(intUtil[_0x6aa1('0x17')](_0x370337)===!![]){var _0x399be9={'Email':_0x370337};var _0x1f23be={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x366283[_0x6aa1('0x14')](_0x6aa1('0x18'))['find'](_0x399be9,_0x1f23be)['execute']()[_0x6aa1('0x19')](function(_0x746a5a){if(_0x746a5a[_0x6aa1('0x1a')]){var _0x161e8a=_['find'](_0x746a5a,function(_0x461951){return _0x461951[_0x6aa1('0x1b')]===_0x370337;});if(_0x161e8a){logger['info'](_0x6aa1('0x1c'),_0x370337);return BPromise[_0x6aa1('0x1d')]({'id':_0x161e8a['Id'],'name':_0x161e8a[_0x6aa1('0x1e')]});}}else{logger[_0x6aa1('0x1f')](_0x6aa1('0x20'),_0x370337);return _0x366283[_0x6aa1('0x21')]()[_0x6aa1('0x19')](function(_0x3adf86){return BPromise[_0x6aa1('0x1d')]({'id':_0x3adf86['user_id'],'name':_0x3adf86['display_name']});});}});}else{logger[_0x6aa1('0x1f')](_0x6aa1('0x20'),_0x370337);return _0x366283[_0x6aa1('0x21')]()[_0x6aa1('0x19')](function(_0x5c0f39){return BPromise[_0x6aa1('0x1d')]({'id':_0x5c0f39[_0x6aa1('0x22')],'name':_0x5c0f39[_0x6aa1('0x23')]});});}}function getEndUser(_0x5d0efe,_0x36c2e3,_0x502014,_0x2acb9d,_0x1558e8){var _0x347342={'Phone':_0x2acb9d};var _0x5a6560={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6aa1('0x1d')]()[_0x6aa1('0x19')](function(){logger[_0x6aa1('0x1f')](_0x6aa1('0x24'),_0x2acb9d,_0x36c2e3[_0x6aa1('0x25')]);switch(_0x36c2e3[_0x6aa1('0x25')]){case'contact_lead':return _0x1558e8[_0x6aa1('0x14')](_0x6aa1('0x26'))[_0x6aa1('0x27')](_0x347342,_0x5a6560)['execute']()[_0x6aa1('0x19')](function(_0x1b3019){if(_0x1b3019&&_0x1b3019[_0x6aa1('0x1a')]){return _0x1b3019;}else{return _0x1558e8[_0x6aa1('0x14')]('Lead')['find'](_0x347342,_0x5a6560);}});case _0x6aa1('0x28'):return _0x1558e8[_0x6aa1('0x14')]('Contact')[_0x6aa1('0x27')](_0x347342,_0x5a6560)[_0x6aa1('0x29')]();case _0x6aa1('0x2a'):return _0x1558e8['sobject'](_0x6aa1('0x2b'))['find'](_0x347342,_0x5a6560);default:return null;}})[_0x6aa1('0x19')](function(_0x35bdde){if(_0x35bdde&&_0x35bdde['length']){var _0x1b7258=_[_0x6aa1('0x27')](_0x35bdde,function(_0xdf091e){return _0xdf091e[_0x6aa1('0x2c')]===_0x2acb9d;});if(_0x1b7258){return BPromise[_0x6aa1('0x1d')]({'id':_0x1b7258['Id'],'name':_0x1b7258['Name'],'phone':_0x1b7258[_0x6aa1('0x2c')]});}}})[_0x6aa1('0x19')](function(_0x3c0f89){if(_0x3c0f89){logger[_0x6aa1('0x1f')](_0x6aa1('0x2d'),_0x2acb9d);return BPromise[_0x6aa1('0x1d')](_0x3c0f89);}else{logger[_0x6aa1('0x1f')](_0x6aa1('0x2e'),_0x2acb9d);var _0x3bc721={'LastName':_0x502014!==_0x6aa1('0x2f')?_0x502014:util[_0x6aa1('0x30')](_0x6aa1('0x31'),_0x2acb9d),'Phone':_0x2acb9d};if(_0x36c2e3['moduleCreate']){switch(_0x36c2e3[_0x6aa1('0x32')]){case'contact':logger[_0x6aa1('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2acb9d,_0x36c2e3[_0x6aa1('0x32')]);break;case'lead':logger['info'](_0x6aa1('0x33'),_0x2acb9d,_0x36c2e3['moduleCreate']);_0x3bc721[_0x6aa1('0x34')]=_0x6aa1('0x35');break;default:return null;}}return _0x1558e8['sobject'](_[_0x6aa1('0x36')](_0x36c2e3[_0x6aa1('0x32')]))[_0x6aa1('0x16')](_0x3bc721);}});}function getCustomFields(_0x81be76,_0x2bf428){var _0x257ee3={};if(_0x81be76['length']>0x0){_[_0x6aa1('0x37')](_0x81be76,function(_0x17bb2b){if(_0x17bb2b[_0x6aa1('0x38')]===_0x6aa1('0x39')&&_0x17bb2b[_0x6aa1('0x3a')]){_0x257ee3[_0x17bb2b['idField']]=_0x17bb2b[_0x6aa1('0x3b')][_0x6aa1('0x3c')]();}else if(_0x17bb2b[_0x6aa1('0x38')]==='variable'&&_0x17bb2b[_0x6aa1('0x3d')]&&_0x17bb2b[_0x6aa1('0x3a')]){_0x2bf428[_0x17bb2b[_0x6aa1('0x3d')]]&&(_0x257ee3[_0x17bb2b[_0x6aa1('0x3a')]]=_0x2bf428[_0x17bb2b[_0x6aa1('0x3d')]][_0x6aa1('0x3c')]());}else if(_0x17bb2b[_0x6aa1('0x38')]===_0x6aa1('0x3e')&&_0x17bb2b[_0x6aa1('0x3f')]&&_0x17bb2b['Variable'][_0x6aa1('0x40')]&&_0x17bb2b['idField']){_0x2bf428[_0x17bb2b[_0x6aa1('0x3f')][_0x6aa1('0x40')][_0x6aa1('0x41')]()]&&(_0x257ee3[_0x17bb2b[_0x6aa1('0x3a')]]=_0x2bf428[_0x17bb2b[_0x6aa1('0x3f')][_0x6aa1('0x40')][_0x6aa1('0x41')]()]['toString']());}});}return _0x257ee3;}function getConnection(_0x1a74be){var _0x4494a6=_0x1a74be[_0x6aa1('0x42')]['concat'](_0x1a74be['securityToken']);var _0x3f0b85=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1a74be[_0x6aa1('0x43')]||_0x6aa1('0x44'),'clientId':_0x1a74be[_0x6aa1('0x45')],'clientSecret':_0x1a74be[_0x6aa1('0x46')]}});return _0x3f0b85[_0x6aa1('0x47')](_0x1a74be[_0x6aa1('0x48')],_0x4494a6)[_0x6aa1('0x19')](function(){logger['info'](_0x6aa1('0x49'));return _0x3f0b85;});}exports[_0x6aa1('0x4a')]=function(_0x28e3f2,_0x54bdbf,_0x28d4db,_0x56814d,_0x1eacce,_0x407d27){var _0x3ad240,_0xc564cc,_0x495093,_0x521938;_0x407d27[_0x6aa1('0x4b')]=intUtil[_0x6aa1('0x4c')](_0x407d27[_0x6aa1('0x4b')]);if(_0x1eacce&&_0x1eacce[_0x6aa1('0x4d')]){logger[_0x6aa1('0x1f')](_0x6aa1('0x4e'),_0x6aa1('0x4f'));_0x54bdbf[_0x6aa1('0x50')]=util[_0x6aa1('0x30')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x407d27[_0x6aa1('0x4b')],_0x54bdbf[_0x6aa1('0x51')],md5(_0x54bdbf[_0x6aa1('0x51')]));}else{_0x54bdbf[_0x6aa1('0x50')]='';}return getConnection(_0x407d27)[_0x6aa1('0x19')](function(_0x27a3ae){_0x521938=_0x27a3ae;return getUser(_0x407d27,_0x56814d[_0x6aa1('0x52')],_0x521938);})[_0x6aa1('0x19')](function(_0x2e1e0c){_0x3ad240=_0x2e1e0c;return getEndUser(_0x407d27,_0x28d4db,_0x54bdbf[_0x6aa1('0x53')],_0x54bdbf['calleridnum'],_0x521938);})[_0x6aa1('0x19')](function(_0x5c7fe1){_0xc564cc=_0x5c7fe1;return getTicket(_0x407d27,_0x3ad240,_0xc564cc,_0x28d4db,_0x54bdbf,_0x28d4db[_0x6aa1('0x54')],_0x521938);})[_0x6aa1('0x19')](function(_0x987a31){_0x495093=_0x987a31;logger['info'](_0x6aa1('0x55'),_0x495093['id']);logger[_0x6aa1('0x1f')](_0x6aa1('0x56'),_0x495093['id'],_0x56814d[_0x6aa1('0x40')],_0x407d27[_0x6aa1('0x38')]);switch(_0x407d27[_0x6aa1('0x38')]){case _0x6aa1('0x57'):emit(util[_0x6aa1('0x30')](_0x6aa1('0x58'),_0x56814d[_0x6aa1('0x40')]),'trigger:salesforce:display',{'recordId':_0x495093['id']});break;case _0x6aa1('0x59'):emit(util['format'](_0x6aa1('0x58'),_0x56814d[_0x6aa1('0x40')]),_0x6aa1('0x5a'),{'uri':util['format']('%s/%s/e',_0x521938[_0x6aa1('0x5b')],_0x495093['id'])});break;default:logger[_0x6aa1('0x5c')](_0x6aa1('0x5d'));}})[_0x6aa1('0x5e')](function(_0x22481e){logger[_0x6aa1('0x5c')](_0x6aa1('0x4e'),JSON['stringify'](_0x22481e));});};exports[_0x6aa1('0x5f')]=function(_0x487b78,_0x186ef5,_0x4bdc20,_0x23bd67,_0x1bb1dd,_0xdb6532,_0x1cc38e){var _0x1b6824,_0x4b0223,_0x14d83,_0x4fce4a;_0xdb6532[_0x6aa1('0x4b')]=intUtil[_0x6aa1('0x4c')](_0xdb6532[_0x6aa1('0x4b')]);if(_0x1cc38e&&_0x1cc38e['recordingFormat']&&_0x1cc38e[_0x6aa1('0x60')]!==_0x6aa1('0x61')){logger[_0x6aa1('0x1f')](_0x6aa1('0x62'),_0x6aa1('0x4f'));_0x186ef5[_0x6aa1('0x50')]=util['format'](_0x6aa1('0x63'),_0xdb6532['serverUrl'],_0x186ef5[_0x6aa1('0x51')],md5(_0x186ef5[_0x6aa1('0x51')]));}return getConnection(_0xdb6532)[_0x6aa1('0x19')](function(_0x8023a6){_0x4fce4a=_0x8023a6;return getUser(_0xdb6532,_0x23bd67['email'],_0x4fce4a);})['then'](function(_0x563ea9){_0x1b6824=_0x563ea9;return getEndUser(_0xdb6532,_0x4bdc20,_0x186ef5['destcalleridname'],_0x186ef5[_0x6aa1('0x64')],_0x4fce4a);})[_0x6aa1('0x19')](function(_0x53b608){_0x4b0223=_0x53b608;return getTicket(_0xdb6532,_0x1b6824,_0x4b0223,_0x4bdc20,_0x186ef5,_0x4bdc20['Fields'],_0x4fce4a);})[_0x6aa1('0x19')](function(_0x3fbabc){_0x14d83=_0x3fbabc;logger[_0x6aa1('0x1f')](_0x6aa1('0x65'),_0x14d83['id']);logger[_0x6aa1('0x1f')](_0x6aa1('0x66'),_0x14d83['id'],_0x23bd67[_0x6aa1('0x40')],_0xdb6532[_0x6aa1('0x38')]);switch(_0xdb6532[_0x6aa1('0x38')]){case _0x6aa1('0x57'):emit(util['format'](_0x6aa1('0x58'),_0x23bd67[_0x6aa1('0x40')]),_0x6aa1('0x67'),{'recordId':_0x14d83['id']});break;case _0x6aa1('0x59'):emit(util[_0x6aa1('0x30')]('user:%s',_0x23bd67[_0x6aa1('0x40')]),_0x6aa1('0x5a'),{'uri':util[_0x6aa1('0x30')]('%s/%s/e',_0x4fce4a[_0x6aa1('0x5b')],_0x14d83['id'])});break;default:logger[_0x6aa1('0x5c')](_0x6aa1('0x62'),_0x6aa1('0x68'));}})['catch'](function(_0x3bcf76){logger[_0x6aa1('0x5c')](_0x6aa1('0x62'),JSON['stringify'](_0x3bcf76));});};exports[_0x6aa1('0x69')]=function(_0x49272c,_0x2ba634,_0x482d27,_0x5b616e,_0x2a840d,_0x558936){var _0x493e12,_0x56c222,_0x234741,_0x1034c1;_0x558936[_0x6aa1('0x4b')]=intUtil['stripTrailingSlash'](_0x558936[_0x6aa1('0x4b')]);if(_0x2a840d&&_0x2a840d['monitor_format']){logger[_0x6aa1('0x1f')](_0x6aa1('0x6a'),_0x6aa1('0x4f'));_0x2ba634['recordingURL']=util[_0x6aa1('0x30')](_0x6aa1('0x63'),_0x558936[_0x6aa1('0x4b')],_0x2ba634['uniqueid'],md5(_0x2ba634['uniqueid']));}else{_0x2ba634[_0x6aa1('0x50')]='';}return getConnection(_0x558936)[_0x6aa1('0x19')](function(_0x98f726){_0x1034c1=_0x98f726;return getUser(_0x558936,_0x5b616e[_0x6aa1('0x52')],_0x1034c1);})[_0x6aa1('0x19')](function(_0x5e2818){_0x493e12=_0x5e2818;return getEndUser(_0x558936,_0x482d27,_0x2ba634[_0x6aa1('0x53')],_0x2ba634[_0x6aa1('0x6b')],_0x1034c1);})[_0x6aa1('0x19')](function(_0x48e432){_0x56c222=_0x48e432;return getTicket(_0x558936,_0x493e12,_0x56c222,_0x482d27,_0x2ba634,_0x482d27['Fields'],_0x1034c1);})[_0x6aa1('0x19')](function(_0x2e25db){_0x234741=_0x2e25db;logger[_0x6aa1('0x1f')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x234741['id']);logger['info'](_0x6aa1('0x6c'),_0x558936['type']);})[_0x6aa1('0x5e')](function(_0x547fd8){logger[_0x6aa1('0x5c')](_0x6aa1('0x6a'),JSON[_0x6aa1('0x6d')](_0x547fd8));});}; \ No newline at end of file +var _0xc157=['moduleSearch','contact_lead','Contact','find','contact','lead','Lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','create','forEach','type','string','idField','content','variableName','customVariable','Variable','name','toLowerCase','concat','Connection','remoteUri','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','stringify','outbound','recordingFormat','[OUTBOUND]','destcalleridnum','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','%s/%s/e','catch','abandoned','calleridnum','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','merge','utc','Subjects','getString','Descriptions','WhoId','sobject','Task','validateEmail','User','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.'];(function(_0x113fe7,_0x3516e2){var _0x391c69=function(_0x44faa6){while(--_0x44faa6){_0x113fe7['push'](_0x113fe7['shift']());}};_0x391c69(++_0x3516e2);}(_0xc157,0x1e3));var _0x7c15=function(_0xde1185,_0x1205eb){_0xde1185=_0xde1185-0x0;var _0x218904=_0xc157[_0xde1185];return _0x218904;};'use strict';var _=require('lodash');var rp=require(_0x7c15('0x0'));var moment=require(_0x7c15('0x1'));var BPromise=require(_0x7c15('0x2'));var md5=require(_0x7c15('0x3'));var jsforce=require(_0x7c15('0x4'));var util=require(_0x7c15('0x5'));var Redis=require(_0x7c15('0x6'));var intUtil=require(_0x7c15('0x7'));var config=require('../../../../config/environment');var logger=require(_0x7c15('0x8'))(_0x7c15('0x9'));config[_0x7c15('0xa')]=_['defaults'](config['redis'],{'host':_0x7c15('0xb'),'port':0x18eb});var io=require(_0x7c15('0xc'))(new Redis(config[_0x7c15('0xa')]));function emit(_0x2045a6,_0x58649d,_0x4c28ee){io['to'](_0x2045a6)[_0x7c15('0xd')](_0x58649d,_0x4c28ee);}function getTicket(_0x3f7ec6,_0x32f429,_0x13d123,_0x2a2d97,_0x313bad,_0x7da48f,_0x1b8265){var _0x5e480c=_[_0x7c15('0xe')]({'OwnerId':_0x32f429['id'],'ActivityDate':moment[_0x7c15('0xf')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x2a2d97[_0x7c15('0x10')],_0x313bad,'\x20'),'Description':intUtil[_0x7c15('0x11')](_0x2a2d97[_0x7c15('0x12')],_0x313bad,'\x0a')},getCustomFields(_0x7da48f,_0x313bad));if(_0x13d123){_0x5e480c[_0x7c15('0x13')]=_0x13d123['id'];}return _0x1b8265[_0x7c15('0x14')](_0x7c15('0x15'))['create'](_0x5e480c);}function getUser(_0x9480c7,_0x5db4d7,_0x39899d){if(intUtil[_0x7c15('0x16')](_0x5db4d7)===!![]){var _0x9df006={'Email':_0x5db4d7};var _0x3c4862={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x39899d[_0x7c15('0x14')](_0x7c15('0x17'))['find'](_0x9df006,_0x3c4862)[_0x7c15('0x18')]()[_0x7c15('0x19')](function(_0x2fd126){if(_0x2fd126[_0x7c15('0x1a')]){var _0x35d284=_['find'](_0x2fd126,function(_0x20cda7){return _0x20cda7[_0x7c15('0x1b')]===_0x5db4d7;});if(_0x35d284){logger[_0x7c15('0x1c')](_0x7c15('0x1d'),_0x5db4d7);return BPromise[_0x7c15('0x1e')]({'id':_0x35d284['Id'],'name':_0x35d284[_0x7c15('0x1f')]});}}else{logger[_0x7c15('0x1c')](_0x7c15('0x20'),_0x5db4d7);return _0x39899d[_0x7c15('0x21')]()['then'](function(_0x487167){return BPromise['resolve']({'id':_0x487167[_0x7c15('0x22')],'name':_0x487167['display_name']});});}});}else{logger[_0x7c15('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5db4d7);return _0x39899d[_0x7c15('0x21')]()[_0x7c15('0x19')](function(_0x4f346b){return BPromise[_0x7c15('0x1e')]({'id':_0x4f346b[_0x7c15('0x22')],'name':_0x4f346b[_0x7c15('0x23')]});});}}function getEndUser(_0x91b2af,_0x20959c,_0x32bd4b,_0x2987a1,_0x3a98f6){var _0x2385c7={'Phone':_0x2987a1};var _0x40401c={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x7c15('0x19')](function(){logger[_0x7c15('0x1c')](_0x7c15('0x24'),_0x2987a1,_0x20959c[_0x7c15('0x25')]);switch(_0x20959c['moduleSearch']){case _0x7c15('0x26'):return _0x3a98f6[_0x7c15('0x14')](_0x7c15('0x27'))[_0x7c15('0x28')](_0x2385c7,_0x40401c)[_0x7c15('0x18')]()[_0x7c15('0x19')](function(_0x4dcb3d){if(_0x4dcb3d&&_0x4dcb3d['length']){return _0x4dcb3d;}else{return _0x3a98f6[_0x7c15('0x14')]('Lead')[_0x7c15('0x28')](_0x2385c7,_0x40401c);}});case _0x7c15('0x29'):return _0x3a98f6['sobject']('Contact')[_0x7c15('0x28')](_0x2385c7,_0x40401c)[_0x7c15('0x18')]();case _0x7c15('0x2a'):return _0x3a98f6['sobject'](_0x7c15('0x2b'))['find'](_0x2385c7,_0x40401c);default:return null;}})['then'](function(_0x1b4b20){if(_0x1b4b20&&_0x1b4b20[_0x7c15('0x1a')]){var _0x40f099=_['find'](_0x1b4b20,function(_0x18390d){return _0x18390d[_0x7c15('0x2c')]===_0x2987a1;});if(_0x40f099){return BPromise[_0x7c15('0x1e')]({'id':_0x40f099['Id'],'name':_0x40f099['Name'],'phone':_0x40f099[_0x7c15('0x2c')]});}}})['then'](function(_0x39ea19){if(_0x39ea19){logger[_0x7c15('0x1c')](_0x7c15('0x2d'),_0x2987a1);return BPromise[_0x7c15('0x1e')](_0x39ea19);}else{logger['info'](_0x7c15('0x2e'),_0x2987a1);var _0x26597d={'LastName':_0x32bd4b!==_0x7c15('0x2f')?_0x32bd4b:util[_0x7c15('0x30')](_0x7c15('0x31'),_0x2987a1),'Phone':_0x2987a1};if(_0x20959c[_0x7c15('0x32')]){switch(_0x20959c['moduleCreate']){case'contact':logger['info'](_0x7c15('0x33'),_0x2987a1,_0x20959c['moduleCreate']);break;case _0x7c15('0x2a'):logger[_0x7c15('0x1c')](_0x7c15('0x33'),_0x2987a1,_0x20959c[_0x7c15('0x32')]);_0x26597d[_0x7c15('0x34')]=_0x7c15('0x35');break;default:return null;}}return _0x3a98f6['sobject'](_[_0x7c15('0x36')](_0x20959c[_0x7c15('0x32')]))[_0x7c15('0x37')](_0x26597d);}});}function getCustomFields(_0x2c40d5,_0x3f3d61){var _0x5100cf={};if(_0x2c40d5[_0x7c15('0x1a')]>0x0){_[_0x7c15('0x38')](_0x2c40d5,function(_0x57caec){if(_0x57caec[_0x7c15('0x39')]===_0x7c15('0x3a')&&_0x57caec['idField']){_0x5100cf[_0x57caec[_0x7c15('0x3b')]]=_0x57caec[_0x7c15('0x3c')]['toString']();}else if(_0x57caec[_0x7c15('0x39')]==='variable'&&_0x57caec[_0x7c15('0x3d')]&&_0x57caec['idField']){_0x3f3d61[_0x57caec[_0x7c15('0x3d')]]&&(_0x5100cf[_0x57caec['idField']]=_0x3f3d61[_0x57caec[_0x7c15('0x3d')]]['toString']());}else if(_0x57caec[_0x7c15('0x39')]===_0x7c15('0x3e')&&_0x57caec['Variable']&&_0x57caec[_0x7c15('0x3f')][_0x7c15('0x40')]&&_0x57caec[_0x7c15('0x3b')]){_0x3f3d61[_0x57caec[_0x7c15('0x3f')]['name'][_0x7c15('0x41')]()]&&(_0x5100cf[_0x57caec[_0x7c15('0x3b')]]=_0x3f3d61[_0x57caec[_0x7c15('0x3f')][_0x7c15('0x40')][_0x7c15('0x41')]()]['toString']());}});}return _0x5100cf;}function getConnection(_0x8ddb2e){var _0x382131=_0x8ddb2e['password'][_0x7c15('0x42')](_0x8ddb2e['securityToken']);var _0x2bd731=new jsforce[(_0x7c15('0x43'))]({'oauth2':{'loginUrl':_0x8ddb2e[_0x7c15('0x44')]||'https://login.salesforce.com','clientId':_0x8ddb2e['clientId'],'clientSecret':_0x8ddb2e['clientSecret']}});return _0x2bd731['login'](_0x8ddb2e[_0x7c15('0x45')],_0x382131)[_0x7c15('0x19')](function(){logger[_0x7c15('0x1c')](_0x7c15('0x46'));return _0x2bd731;});}exports[_0x7c15('0x47')]=function(_0x13ba80,_0x8ae3b1,_0x5366d8,_0x3ad0b5,_0x4e8e45,_0x45feeb){var _0x24d9ee,_0x3f4d96,_0x438532,_0x1c1245;_0x45feeb[_0x7c15('0x48')]=intUtil[_0x7c15('0x49')](_0x45feeb[_0x7c15('0x48')]);if(_0x4e8e45&&_0x4e8e45[_0x7c15('0x4a')]){logger[_0x7c15('0x1c')]('[QUEUE]',_0x7c15('0x4b'));_0x8ae3b1[_0x7c15('0x4c')]=util['format'](_0x7c15('0x4d'),_0x45feeb['serverUrl'],_0x8ae3b1['uniqueid'],md5(_0x8ae3b1[_0x7c15('0x4e')]));}else{_0x8ae3b1[_0x7c15('0x4c')]='';}return getConnection(_0x45feeb)['then'](function(_0x21c680){_0x1c1245=_0x21c680;return getUser(_0x45feeb,_0x3ad0b5[_0x7c15('0x4f')],_0x1c1245);})['then'](function(_0x305ce8){_0x24d9ee=_0x305ce8;return getEndUser(_0x45feeb,_0x5366d8,_0x8ae3b1[_0x7c15('0x50')],_0x8ae3b1['calleridnum'],_0x1c1245);})[_0x7c15('0x19')](function(_0x5bb654){_0x3f4d96=_0x5bb654;return getTicket(_0x45feeb,_0x24d9ee,_0x3f4d96,_0x5366d8,_0x8ae3b1,_0x5366d8['Fields'],_0x1c1245);})['then'](function(_0x13764d){_0x438532=_0x13764d;logger[_0x7c15('0x1c')](_0x7c15('0x51'),_0x438532['id']);logger[_0x7c15('0x1c')](_0x7c15('0x52'),_0x438532['id'],_0x3ad0b5[_0x7c15('0x40')],_0x45feeb[_0x7c15('0x39')]);switch(_0x45feeb[_0x7c15('0x39')]){case'integrationTab':emit(util['format'](_0x7c15('0x53'),_0x3ad0b5['name']),_0x7c15('0x54'),{'recordId':_0x438532['id']});break;case _0x7c15('0x55'):emit(util[_0x7c15('0x30')](_0x7c15('0x53'),_0x3ad0b5[_0x7c15('0x40')]),'trigger:browser:url',{'uri':util['format']('%s/%s/e',_0x1c1245[_0x7c15('0x56')],_0x438532['id'])});break;default:logger[_0x7c15('0x57')](_0x7c15('0x58'));}})['catch'](function(_0x491528){logger[_0x7c15('0x57')](_0x7c15('0x59'),JSON[_0x7c15('0x5a')](_0x491528));});};exports[_0x7c15('0x5b')]=function(_0x3e725f,_0x38d287,_0x1dad03,_0x16e819,_0x4074c4,_0xbbd48c,_0x442f5b){var _0x4509f6,_0x94c180,_0x536547,_0x3c90d6;_0xbbd48c['serverUrl']=intUtil[_0x7c15('0x49')](_0xbbd48c[_0x7c15('0x48')]);if(_0x442f5b&&_0x442f5b[_0x7c15('0x5c')]&&_0x442f5b['recordingFormat']!=='none'){logger[_0x7c15('0x1c')](_0x7c15('0x5d'),_0x7c15('0x4b'));_0x38d287[_0x7c15('0x4c')]=util[_0x7c15('0x30')](_0x7c15('0x4d'),_0xbbd48c['serverUrl'],_0x38d287['uniqueid'],md5(_0x38d287[_0x7c15('0x4e')]));}return getConnection(_0xbbd48c)[_0x7c15('0x19')](function(_0x3b0712){_0x3c90d6=_0x3b0712;return getUser(_0xbbd48c,_0x16e819[_0x7c15('0x4f')],_0x3c90d6);})[_0x7c15('0x19')](function(_0x4121e6){_0x4509f6=_0x4121e6;return getEndUser(_0xbbd48c,_0x1dad03,_0x38d287['destcalleridname'],_0x38d287[_0x7c15('0x5e')],_0x3c90d6);})[_0x7c15('0x19')](function(_0x8f1a74){_0x94c180=_0x8f1a74;return getTicket(_0xbbd48c,_0x4509f6,_0x94c180,_0x1dad03,_0x38d287,_0x1dad03[_0x7c15('0x5f')],_0x3c90d6);})['then'](function(_0x41bccb){_0x536547=_0x41bccb;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x536547['id']);logger['info'](_0x7c15('0x60'),_0x536547['id'],_0x16e819[_0x7c15('0x40')],_0xbbd48c[_0x7c15('0x39')]);switch(_0xbbd48c['type']){case _0x7c15('0x61'):emit(util['format']('user:%s',_0x16e819['name']),_0x7c15('0x54'),{'recordId':_0x536547['id']});break;case _0x7c15('0x55'):emit(util[_0x7c15('0x30')]('user:%s',_0x16e819['name']),'trigger:browser:url',{'uri':util[_0x7c15('0x30')](_0x7c15('0x62'),_0x3c90d6[_0x7c15('0x56')],_0x536547['id'])});break;default:logger[_0x7c15('0x57')](_0x7c15('0x5d'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x7c15('0x63')](function(_0x2342b8){logger[_0x7c15('0x57')](_0x7c15('0x5d'),JSON[_0x7c15('0x5a')](_0x2342b8));});};exports[_0x7c15('0x64')]=function(_0x21509b,_0x1d131a,_0x447335,_0x42f314,_0x4de852,_0x447ec5){var _0x3c8f74,_0xe6bd22,_0x2d0afe,_0x3abd16;_0x447ec5['serverUrl']=intUtil[_0x7c15('0x49')](_0x447ec5[_0x7c15('0x48')]);if(_0x4de852&&_0x4de852[_0x7c15('0x4a')]){logger[_0x7c15('0x1c')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x1d131a[_0x7c15('0x4c')]=util[_0x7c15('0x30')](_0x7c15('0x4d'),_0x447ec5[_0x7c15('0x48')],_0x1d131a['uniqueid'],md5(_0x1d131a['uniqueid']));}else{_0x1d131a[_0x7c15('0x4c')]='';}return getConnection(_0x447ec5)['then'](function(_0x1cc8f6){_0x3abd16=_0x1cc8f6;return getUser(_0x447ec5,_0x42f314[_0x7c15('0x4f')],_0x3abd16);})[_0x7c15('0x19')](function(_0x534b17){_0x3c8f74=_0x534b17;return getEndUser(_0x447ec5,_0x447335,_0x1d131a[_0x7c15('0x50')],_0x1d131a[_0x7c15('0x65')],_0x3abd16);})[_0x7c15('0x19')](function(_0x2ecb1f){_0xe6bd22=_0x2ecb1f;return getTicket(_0x447ec5,_0x3c8f74,_0xe6bd22,_0x447335,_0x1d131a,_0x447335[_0x7c15('0x5f')],_0x3abd16);})[_0x7c15('0x19')](function(_0x1e4829){_0x2d0afe=_0x1e4829;logger[_0x7c15('0x1c')](_0x7c15('0x66'),_0x2d0afe['id']);logger[_0x7c15('0x1c')](_0x7c15('0x67'),_0x447ec5['type']);})['catch'](function(_0x37ed32){logger[_0x7c15('0x57')]('[ABANDONED]',JSON[_0x7c15('0x5a')](_0x37ed32));});}; \ 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 26755b4..96b8ce5 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 _0x0458=['push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','abandoned','uniqueid','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','./util','md5','servicenow','socket.io-emitter','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','userId','adminEmail','POST','sys_user?','endUserNumber','System','then','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','string','nameField','idField','toLowerCase','content','toString','variableName','customField','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','true','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','incident','ticketId'];(function(_0x25efe4,_0x59eedb){var _0x970447=function(_0x282e44){while(--_0x282e44){_0x25efe4['push'](_0x25efe4['shift']());}};_0x970447(++_0x59eedb);}(_0x0458,0xe4));var _0x8045=function(_0x2bc8b6,_0x6273b9){_0x2bc8b6=_0x2bc8b6-0x0;var _0x45a0f2=_0x0458[_0x2bc8b6];return _0x45a0f2;};'use strict';var _=require('lodash');var Promise=require(_0x8045('0x0'));var rp=require(_0x8045('0x1'));var util=require('util');var intUtil=require(_0x8045('0x2'));var md5=require(_0x8045('0x3'));var logger=require('../../../../config/logger')(_0x8045('0x4'));var io=require(_0x8045('0x5'))({'host':_0x8045('0x6'),'port':0x18eb});function getAdminUser(_0x2a918b,_0x38ba4c,_0x12bcd7,_0x44b961,_0x18e62b,_0x18bea3){return new Promise(function(_0x211460,_0x40dcf7){var _0xbc0a2a={'method':_0x8045('0x7'),'uri':_0x44b961+_0x8045('0x8')+'&'+_0x18e62b+'&'+_0x18bea3,'auth':_0x38ba4c,'json':!![]};return rp(_0xbc0a2a)['then'](function(_0x47c3cb){if(_0x47c3cb[_0x8045('0x9')][_0x8045('0xa')]>0x0){_0x12bcd7['adminId']=_0x47c3cb[_0x8045('0x9')][0x0][_0x8045('0xb')];}logger[_0x8045('0xc')]('['+[_0x2a918b[_0x8045('0xd')]()]+_0x8045('0xe'),_0x12bcd7);_0x211460(_0x12bcd7);})[_0x8045('0xf')](function(_0x50ee74){logger[_0x8045('0x10')]('['+[_0x2a918b['toUpperCase']()]+']',_0x50ee74[_0x8045('0x11')]);_0x40dcf7(_0x50ee74[_0x8045('0x11')]);});});}function getUser(_0x2544a8,_0x403f66,_0x803aa5,_0x203e18,_0x3e8750){return function(_0x527da7){logger['info']('['+[_0x2544a8[_0x8045('0xd')]()]+_0x8045('0x12'),_0x527da7);return new Promise(function(_0x45ad78,_0x4f0991){var _0x13a9da={'method':_0x8045('0x7'),'uri':_0x803aa5+_0x8045('0x13')+_0x527da7[_0x8045('0x14')]+'&'+_0x203e18+'&'+_0x3e8750,'auth':_0x403f66,'json':!![]};logger['info']('['+[_0x2544a8[_0x8045('0xd')]()]+_0x8045('0x15'),_0x13a9da);return rp(_0x13a9da)['then'](function(_0x4a26cd){logger['info']('['+[_0x2544a8[_0x8045('0xd')]()]+_0x8045('0x16'),_0x4a26cd);if(_0x4a26cd['result']['length']>0x0){_0x527da7['userId']=_0x4a26cd[_0x8045('0x9')][0x0][_0x8045('0xb')];}else{_0x527da7[_0x8045('0x17')]=_0x527da7['adminId'];_0x527da7[_0x8045('0x14')]=_0x527da7[_0x8045('0x18')];}logger[_0x8045('0xc')]('['+[_0x2544a8['toUpperCase']()]+'],\x20getUser\x20crm',_0x527da7);_0x45ad78(_0x527da7);})[_0x8045('0xf')](function(_0x505eeb){logger[_0x8045('0x10')]('['+[_0x2544a8[_0x8045('0xd')]()]+']',_0x505eeb['message']);_0x4f0991(_0x505eeb[_0x8045('0x11')]);});});};}function createEndUser(_0x2681d1,_0x552af9,_0x4c42d5,_0x96bb1,_0x4db5d7){logger[_0x8045('0xc')]('['+[_0x2681d1[_0x8045('0xd')]()]+'],\x20createEndUser\x20input\x20crm',_0x4c42d5);return new Promise(function(_0x25a5d6,_0x5dce6d){var _0x5e984f={'method':_0x8045('0x19'),'uri':_0x96bb1+_0x8045('0x1a')+_0x4db5d7,'body':{'user_name':_0x4c42d5[_0x8045('0x1b')],'roles':'user','first_name':_0x4c42d5['endUserNumber'],'last_name':'','title':'','active':'true','email':'','preferred_language':'','time_zone':'','date_format':_0x8045('0x1c'),'phone':_0x4c42d5[_0x8045('0x1b')]},'auth':_0x552af9,'json':!![]};return rp(_0x5e984f)[_0x8045('0x1d')](function(_0x549ed3){logger[_0x8045('0xc')]('['+[_0x2681d1[_0x8045('0xd')]()]+'],\x20EndUser\x20schema',_0x549ed3[_0x8045('0x9')]);_0x4c42d5[_0x8045('0x1e')]=_0x549ed3[_0x8045('0x9')][_0x8045('0xb')];_0x25a5d6(_0x4c42d5);})[_0x8045('0xf')](function(_0x377fac){logger[_0x8045('0x10')]('['+[_0x2681d1[_0x8045('0xd')]()]+']',_0x377fac['message']);_0x5dce6d(_0x377fac['message']);});});}function getEndUser(_0x3a5757,_0x1f9a54,_0x4d870d,_0x416c6c,_0x12993b){return function(_0xc96295){logger[_0x8045('0xc')]('['+[_0x3a5757['toUpperCase']()]+_0x8045('0x1f'),_0xc96295);return new Promise(function(_0x566de2,_0x318a29){var _0x48b54b={'method':_0x8045('0x7'),'uri':_0x4d870d+_0x8045('0x20')+_0xc96295[_0x8045('0x1b')]+'&'+_0x416c6c+'&'+_0x12993b,'auth':_0x1f9a54,'json':!![]};return rp(_0x48b54b)[_0x8045('0x1d')](function(_0x598abb){if(_0x598abb[_0x8045('0x9')][_0x8045('0xa')]>0x0){_0xc96295[_0x8045('0x1e')]=_0x598abb[_0x8045('0x9')][0x0][_0x8045('0xb')];logger[_0x8045('0xc')]('['+[_0x3a5757['toUpperCase']()]+_0x8045('0x21'),_0xc96295);_0x566de2(_0xc96295);}else{return createEndUser(_0x3a5757,_0x1f9a54,_0xc96295,_0x4d870d,_0x416c6c)[_0x8045('0x1d')](function(_0x1338bf){logger['info']('['+[_0x3a5757['toUpperCase']()]+_0x8045('0x22'),_0x1338bf);_0x566de2(_0x1338bf);});}})[_0x8045('0xf')](function(_0xb84f21){logger['error']('['+[_0x3a5757[_0x8045('0xd')]()]+']',_0xb84f21['message']);_0x318a29(_0xb84f21[_0x8045('0x11')]);});});};}function getCustomFields(_0x516fcd,_0x34e393){var _0x346116={};if(_0x516fcd[_0x8045('0xa')]>0x0){_[_0x8045('0x23')](_0x516fcd,function(_0x6dd500){if(_0x6dd500[_0x8045('0x24')]===_0x8045('0x25')&&_0x6dd500[_0x8045('0x26')]&&!_0x6dd500['customField']){_0x346116[_0x6dd500[_0x8045('0x27')][_0x8045('0x28')]()]=_0x6dd500[_0x8045('0x29')][_0x8045('0x2a')]();}else if(_0x6dd500[_0x8045('0x24')]===_0x8045('0x25')&&_0x6dd500[_0x8045('0x27')]&&_0x6dd500['customField']){_0x346116[_0x6dd500['idField'][_0x8045('0x28')]()]=_0x6dd500[_0x8045('0x29')]['toString']();}else if(_0x6dd500[_0x8045('0x24')]==='variable'&&_0x6dd500[_0x8045('0x2b')]&&_0x6dd500[_0x8045('0x27')]&&_0x6dd500[_0x8045('0x2c')]){_0x346116[_0x6dd500[_0x8045('0x27')]['toLowerCase']()]=_0x34e393[_0x6dd500[_0x8045('0x2b')]]['toString']();}else if(_0x6dd500[_0x8045('0x24')]===_0x8045('0x2d')&&_0x6dd500['Variable']&&_0x6dd500[_0x8045('0x2e')][_0x8045('0x2f')]&&_0x6dd500[_0x8045('0x27')]&&_0x6dd500[_0x8045('0x2c')]){_0x346116[_0x6dd500[_0x8045('0x27')]['toLowerCase']()]=_0x34e393[_0x6dd500[_0x8045('0x2e')]['name']['toLowerCase']()][_0x8045('0x2a')]();}});}return _0x346116;}function getTicket(_0x240507,_0x5bec3a,_0x2b95f5,_0x137129,_0x162ca4,_0x1a0bd3){return function(_0x3fc892){logger[_0x8045('0xc')]('['+[_0x240507[_0x8045('0xd')]()]+_0x8045('0x30'),_0x3fc892);return new Promise(function(_0x5725a8,_0x2b4e76){var _0x11a7dd=_0x240507[_0x8045('0x28')]()===_0x8045('0x31')?_0x3fc892[_0x8045('0x17')]:_0x3fc892['endUserId'];var _0x13ca5e={'method':_0x8045('0x19'),'uri':_0x2b95f5+'incident'+'?'+_0x1a0bd3,'body':Object[_0x8045('0x32')]({},{'active':_0x8045('0x33'),'caller_id':_0x11a7dd,'short_description':intUtil[_0x8045('0x34')](_0x137129['Subjects'],_0x162ca4,'\x20'),'description':intUtil[_0x8045('0x34')](_0x137129[_0x8045('0x35')],_0x162ca4,'\x0a')},getCustomFields(_0x137129[_0x8045('0x36')],_0x162ca4)),'auth':_0x5bec3a,'json':!![]};return rp(_0x13ca5e)[_0x8045('0x1d')](function(_0x31ffbb){logger[_0x8045('0xc')]('['+[_0x240507[_0x8045('0xd')]()]+_0x8045('0x37'),_0x31ffbb[_0x8045('0x9')]);_0x3fc892['ticketId']=_0x31ffbb['result'][_0x8045('0xb')];_0x3fc892[_0x8045('0x38')]=_0x31ffbb[_0x8045('0x9')][_0x8045('0x39')];logger[_0x8045('0xc')]('['+[_0x240507[_0x8045('0xd')]()]+_0x8045('0x3a'),_0x3fc892);_0x5725a8(_0x3fc892);})[_0x8045('0xf')](function(_0x4efb01){logger[_0x8045('0x10')]('['+[_0x240507[_0x8045('0xd')]()]+']',_0x4efb01[_0x8045('0x11')]);_0x2b4e76(_0x4efb01[_0x8045('0x11')]);});});};}function createRemoteTag(_0xa66f8c,_0x36f392,_0x4ad26f,_0x2bb38a){return new Promise(function(_0x47d483,_0xdc0b4a){var _0x2cb481={'method':_0x8045('0x19'),'uri':_0x4ad26f+_0x8045('0x3b')+'?'+_0x2bb38a,'body':{'short_description':_0xa66f8c,'global':!![],'active':!![],'name':_0xa66f8c},'auth':_0x36f392,'json':!![]};return rp(_0x2cb481)[_0x8045('0x1d')](function(_0x395965){var _0x3f529c=_0x395965[_0x8045('0x9')][_0x8045('0xb')];_0x47d483(_0x3f529c);});});}function getRemoteTag(_0x42c2b9,_0x1dbd4e,_0x5028e6,_0x12f584,_0x1cb01d){return new Promise(function(_0x57a470,_0x46e948){var _0x2b014d={'method':_0x8045('0x7'),'uri':_0x5028e6+_0x8045('0x3b')+'?sysparm_query=name%3D'+_0x42c2b9+'&'+_0x12f584,'auth':_0x1dbd4e,'json':!![]};return rp(_0x2b014d)[_0x8045('0x1d')](function(_0x57a454){if(_0x57a454['result']['length']>0x0){var _0x564a64=_0x57a454[_0x8045('0x9')][0x0][_0x8045('0xb')];_0x57a470(_0x564a64);}else{return createRemoteTag(_0x42c2b9,_0x1dbd4e,_0x5028e6,_0x12f584)[_0x8045('0x1d')](function(_0x46c203){_0x57a470(_0x46c203);});}});});}function assignTagToIncident(_0x52c71a,_0xa940ac,_0x366865,_0x486ea0,_0x1bd94a){return new Promise(function(_0x26e22a,_0x51f747){var _0x17c7ec={'method':'POST','uri':_0x366865+_0x8045('0x3c')+'?'+_0x1bd94a,'body':{'label':_0x52c71a,'table':_0x8045('0x3d'),'id_type':'Incident','table_key':_0x486ea0[_0x8045('0x3e')],'title':'Incident\x20-\x20'+_0x486ea0['ticketNumber'],'id_display':_0x486ea0['ticketNumber']},'auth':_0xa940ac,'json':!![]};return rp(_0x17c7ec)[_0x8045('0x1d')](function(_0x58f984){_0x26e22a();})[_0x8045('0xf')](function(){_0x26e22a();});});}function manageTags(_0x51c3f5,_0x5918fa,_0x10da24,_0x57825f,_0xd18bc2,_0x572c20,_0x1e0f0b){return new Promise(function(_0x40bd43,_0x37e581){var _0x42716d=[];_0x5918fa[_0x8045('0x23')](function(_0x1ecc36){_0x42716d[_0x8045('0x3f')](getRemoteTag(_0x1ecc36,_0x10da24,_0x57825f,_0x572c20,_0x1e0f0b));});return Promise[_0x8045('0x40')](_0x42716d)[_0x8045('0x1d')](function(_0x588a24){if(_0x588a24[_0x8045('0xa')]){logger['info']('['+[_0x51c3f5[_0x8045('0xd')]()]+_0x8045('0x41'),_0x588a24);var _0x446df1=[];_0x588a24[_0x8045('0x23')](function(_0x5213ff){_0x446df1[_0x8045('0x3f')](assignTagToIncident(_0x5213ff,_0x10da24,_0x57825f,_0xd18bc2,_0x572c20));});return Promise[_0x8045('0x40')](_0x446df1)[_0x8045('0x1d')](function(){_0x40bd43();})[_0x8045('0xf')](function(){_0x40bd43();});}else{_0x40bd43();}});});}function getTags(_0x36625c,_0x2544b2,_0x2b8870,_0x201902,_0xcabf09,_0x67011e){return function(_0x136e31){return new Promise(function(_0x2c3f1d,_0x2c9616){var _0x143688=[];var _0x5d37e2=_0x201902[_0x8045('0x42')];if(_0x5d37e2&&_0x5d37e2[_0x8045('0xa')]>0x0){_0x143688=_['map'](_0x5d37e2,_0x8045('0x2f'));}if(_0x143688['length']>0x0){return manageTags(_0x36625c,_0x143688,_0x2544b2,_0x2b8870,_0x136e31,_0xcabf09,_0x67011e)[_0x8045('0x1d')](function(){_0x2c3f1d(_0x136e31);});}else{_0x2c3f1d(_0x136e31);}});};}function emit(_0x1f25f7,_0x8416d,_0x3e6811){var _0x5cb05f=_0x8045('0x43')+_0x8045('0x44')+_0x8045('0x45')+'%255EORDERBYDESCnumber';var _0x3db75f={'uri':_0x1f25f7+_0x8045('0x46')+_0x3e6811+_0x5cb05f};io['to'](util[_0x8045('0x47')](_0x8045('0x48'),_0x8416d))[_0x8045('0x49')](_0x8045('0x4a'),_0x3db75f);}exports['cs']=function(_0x8ff89c,_0x1d8bce,_0x5ba0a7,_0x54682a,_0x17887b,_0x24df67,_0x5aad99,_0x100a3c){var _0x290a8a={};var _0x14cf41={'user':_0x24df67[_0x8045('0x4b')],'pass':_0x24df67[_0x8045('0x4c')]};var _0x3a187f=_0x8045('0x4d');var _0xf6f118='sysparm_display_value=true';_0x24df67[_0x8045('0x4e')]=intUtil['stripTrailingSlash'](_0x24df67[_0x8045('0x4e')]);_0x24df67[_0x8045('0x4f')]=intUtil[_0x8045('0x50')](_0x24df67[_0x8045('0x4f')]);var _0x165af6=util[_0x8045('0x47')](_0x8045('0x51'),_0x24df67[_0x8045('0x4e')]);_0x290a8a[_0x8045('0x14')]=_0x54682a[_0x8045('0x52')];_0x290a8a[_0x8045('0x18')]=_0x24df67[_0x8045('0x52')];_0x290a8a[_0x8045('0x1b')]=_0x100a3c[_0x8045('0x28')]()===_0x8045('0x31')?_0x1d8bce[_0x8045('0x53')]:_0x1d8bce[_0x8045('0x54')];_0x290a8a[_0x8045('0x55')]=_0x100a3c===_0x8045('0x56')||_0x100a3c===_0x8045('0x57')?'queue':_0x8045('0x31');var _0x20bac4=util[_0x8045('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x24df67[_0x8045('0x4f')],_0x1d8bce[_0x8045('0x58')],md5(_0x1d8bce['uniqueid']));if(_0x17887b&&_0x17887b['monitor_format']){logger[_0x8045('0xc')]('[QUEUE]',_0x8045('0x59'));_0x1d8bce['recordingURL']=_0x20bac4;}else if(_0x5aad99&&_0x5aad99[_0x8045('0x5a')]&&_0x5aad99[_0x8045('0x5a')]!=='none'){logger[_0x8045('0xc')](_0x8045('0x5b'),_0x8045('0x59'));_0x1d8bce[_0x8045('0x5c')]=_0x20bac4;}else{_0x1d8bce[_0x8045('0x5c')]='';}return getAdminUser(_0x100a3c,_0x14cf41,_0x290a8a,_0x165af6,_0xf6f118,_0x3a187f)[_0x8045('0x1d')](getUser(_0x100a3c,_0x14cf41,_0x165af6,_0xf6f118,_0x3a187f))[_0x8045('0x1d')](getEndUser(_0x100a3c,_0x14cf41,_0x165af6,_0xf6f118,_0x3a187f))[_0x8045('0x1d')](getTicket(_0x100a3c,_0x14cf41,_0x165af6,_0x5ba0a7,_0x1d8bce,_0xf6f118))[_0x8045('0x1d')](function(_0x9a8b56){logger[_0x8045('0xc')](util['format'](_0x8045('0x5d'),_0x9a8b56[_0x8045('0x3e')]));logger[_0x8045('0xc')](util[_0x8045('0x47')](_0x8045('0x5e'),_0x100a3c));if(_0x100a3c!=='abandoned'){logger[_0x8045('0xc')]('['+[_0x100a3c[_0x8045('0xd')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x24df67[_0x8045('0x4e')],_0x54682a[_0x8045('0x2f')],_0x9a8b56['ticketId']);}})['catch'](function(_0x4fab1f){logger[_0x8045('0x10')]('['+[_0x100a3c[_0x8045('0xd')]()]+_0x8045('0x5f'),util[_0x8045('0x60')](_0x4fab1f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x69b6=['adminEmail','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','string','nameField','customField','idField','toLowerCase','toString','type','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','ticketNumber','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','callDirection','queue','abandoned','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','util','./util','md5','../../../../config/logger','servicenow','socket.io-emitter','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','userId','result','sys_id'];(function(_0x1890d5,_0x227b75){var _0x2eba05=function(_0x58b8fb){while(--_0x58b8fb){_0x1890d5['push'](_0x1890d5['shift']());}};_0x2eba05(++_0x227b75);}(_0x69b6,0xa9));var _0x669b=function(_0x44b585,_0x120e48){_0x44b585=_0x44b585-0x0;var _0x38dd43=_0x69b6[_0x44b585];return _0x38dd43;};'use strict';var _=require('lodash');var Promise=require(_0x669b('0x0'));var rp=require('request-promise');var util=require(_0x669b('0x1'));var intUtil=require(_0x669b('0x2'));var md5=require(_0x669b('0x3'));var logger=require(_0x669b('0x4'))(_0x669b('0x5'));var io=require(_0x669b('0x6'))({'host':_0x669b('0x7'),'port':0x18eb});function getAdminUser(_0x2c2486,_0x48c7a9,_0x166291,_0x177626,_0x203e6c,_0x5b753b){return new Promise(function(_0x24b911,_0x18a756){var _0xc5c3ba={'method':_0x669b('0x8'),'uri':_0x177626+_0x669b('0x9')+'&'+_0x203e6c+'&'+_0x5b753b,'auth':_0x48c7a9,'json':!![]};return rp(_0xc5c3ba)[_0x669b('0xa')](function(_0xb84d58){if(_0xb84d58['result']['length']>0x0){_0x166291[_0x669b('0xb')]=_0xb84d58['result'][0x0]['sys_id'];}logger[_0x669b('0xc')]('['+[_0x2c2486[_0x669b('0xd')]()]+_0x669b('0xe'),_0x166291);_0x24b911(_0x166291);})[_0x669b('0xf')](function(_0x350759){logger[_0x669b('0x10')]('['+[_0x2c2486[_0x669b('0xd')]()]+']',_0x350759[_0x669b('0x11')]);_0x18a756(_0x350759[_0x669b('0x11')]);});});}function getUser(_0x2faa8c,_0x2d2c6e,_0x1025d4,_0x40efcc,_0x543250){return function(_0x5458b8){logger[_0x669b('0xc')]('['+[_0x2faa8c[_0x669b('0xd')]()]+_0x669b('0x12'),_0x5458b8);return new Promise(function(_0x3aabdb,_0x5ec48d){var _0x17a2f0={'method':_0x669b('0x8'),'uri':_0x1025d4+_0x669b('0x13')+_0x5458b8[_0x669b('0x14')]+'&'+_0x40efcc+'&'+_0x543250,'auth':_0x2d2c6e,'json':!![]};logger[_0x669b('0xc')]('['+[_0x2faa8c[_0x669b('0xd')]()]+_0x669b('0x15'),_0x17a2f0);return rp(_0x17a2f0)[_0x669b('0xa')](function(_0x2f0c36){logger['info']('['+[_0x2faa8c[_0x669b('0xd')]()]+_0x669b('0x16'),_0x2f0c36);if(_0x2f0c36['result'][_0x669b('0x17')]>0x0){_0x5458b8[_0x669b('0x18')]=_0x2f0c36[_0x669b('0x19')][0x0][_0x669b('0x1a')];}else{_0x5458b8['userId']=_0x5458b8[_0x669b('0xb')];_0x5458b8[_0x669b('0x14')]=_0x5458b8[_0x669b('0x1b')];}logger['info']('['+[_0x2faa8c[_0x669b('0xd')]()]+'],\x20getUser\x20crm',_0x5458b8);_0x3aabdb(_0x5458b8);})[_0x669b('0xf')](function(_0x3a1535){logger[_0x669b('0x10')]('['+[_0x2faa8c[_0x669b('0xd')]()]+']',_0x3a1535['message']);_0x5ec48d(_0x3a1535['message']);});});};}function createEndUser(_0x23aa30,_0x2575ca,_0x2200b0,_0x1ffa62,_0x994abf){logger[_0x669b('0xc')]('['+[_0x23aa30[_0x669b('0xd')]()]+_0x669b('0x1c'),_0x2200b0);return new Promise(function(_0x466a36,_0x2f8fe9){var _0x542a87={'method':_0x669b('0x1d'),'uri':_0x1ffa62+'sys_user?'+_0x994abf,'body':{'user_name':_0x2200b0[_0x669b('0x1e')],'roles':_0x669b('0x1f'),'first_name':_0x2200b0[_0x669b('0x1e')],'last_name':'','title':'','active':_0x669b('0x20'),'email':'','preferred_language':'','time_zone':'','date_format':_0x669b('0x21'),'phone':_0x2200b0[_0x669b('0x1e')]},'auth':_0x2575ca,'json':!![]};return rp(_0x542a87)['then'](function(_0x4cab15){logger['info']('['+[_0x23aa30['toUpperCase']()]+_0x669b('0x22'),_0x4cab15[_0x669b('0x19')]);_0x2200b0[_0x669b('0x23')]=_0x4cab15['result']['sys_id'];_0x466a36(_0x2200b0);})[_0x669b('0xf')](function(_0x34c592){logger[_0x669b('0x10')]('['+[_0x23aa30['toUpperCase']()]+']',_0x34c592['message']);_0x2f8fe9(_0x34c592[_0x669b('0x11')]);});});}function getEndUser(_0x4ad0a3,_0x53d506,_0x5783f9,_0x31598c,_0x216885){return function(_0x33a33e){logger[_0x669b('0xc')]('['+[_0x4ad0a3['toUpperCase']()]+_0x669b('0x24'),_0x33a33e);return new Promise(function(_0x5893b8,_0x25c5e0){var _0x14ba2f={'method':_0x669b('0x8'),'uri':_0x5783f9+_0x669b('0x25')+_0x33a33e[_0x669b('0x1e')]+'&'+_0x31598c+'&'+_0x216885,'auth':_0x53d506,'json':!![]};return rp(_0x14ba2f)[_0x669b('0xa')](function(_0x3450e9){if(_0x3450e9['result']['length']>0x0){_0x33a33e[_0x669b('0x23')]=_0x3450e9[_0x669b('0x19')][0x0][_0x669b('0x1a')];logger[_0x669b('0xc')]('['+[_0x4ad0a3['toUpperCase']()]+_0x669b('0x26'),_0x33a33e);_0x5893b8(_0x33a33e);}else{return createEndUser(_0x4ad0a3,_0x53d506,_0x33a33e,_0x5783f9,_0x31598c)[_0x669b('0xa')](function(_0x388180){logger[_0x669b('0xc')]('['+[_0x4ad0a3[_0x669b('0xd')]()]+'],\x20createEndUser\x20crm',_0x388180);_0x5893b8(_0x388180);});}})['catch'](function(_0x536d91){logger['error']('['+[_0x4ad0a3['toUpperCase']()]+']',_0x536d91[_0x669b('0x11')]);_0x25c5e0(_0x536d91[_0x669b('0x11')]);});});};}function getCustomFields(_0x47daf3,_0x3aa212){var _0x3ad361={};if(_0x47daf3[_0x669b('0x17')]>0x0){_['forEach'](_0x47daf3,function(_0x8ffba4){if(_0x8ffba4['type']===_0x669b('0x27')&&_0x8ffba4[_0x669b('0x28')]&&!_0x8ffba4[_0x669b('0x29')]){_0x3ad361[_0x8ffba4[_0x669b('0x2a')][_0x669b('0x2b')]()]=_0x8ffba4['content'][_0x669b('0x2c')]();}else if(_0x8ffba4[_0x669b('0x2d')]===_0x669b('0x27')&&_0x8ffba4[_0x669b('0x2a')]&&_0x8ffba4[_0x669b('0x29')]){_0x3ad361[_0x8ffba4[_0x669b('0x2a')][_0x669b('0x2b')]()]=_0x8ffba4['content'][_0x669b('0x2c')]();}else if(_0x8ffba4[_0x669b('0x2d')]===_0x669b('0x2e')&&_0x8ffba4[_0x669b('0x2f')]&&_0x8ffba4[_0x669b('0x2a')]&&_0x8ffba4['customField']){_0x3ad361[_0x8ffba4[_0x669b('0x2a')][_0x669b('0x2b')]()]=_0x3aa212[_0x8ffba4[_0x669b('0x2f')]][_0x669b('0x2c')]();}else if(_0x8ffba4[_0x669b('0x2d')]===_0x669b('0x30')&&_0x8ffba4[_0x669b('0x31')]&&_0x8ffba4[_0x669b('0x31')][_0x669b('0x32')]&&_0x8ffba4[_0x669b('0x2a')]&&_0x8ffba4[_0x669b('0x29')]){_0x3ad361[_0x8ffba4[_0x669b('0x2a')][_0x669b('0x2b')]()]=_0x3aa212[_0x8ffba4[_0x669b('0x31')][_0x669b('0x32')]['toLowerCase']()][_0x669b('0x2c')]();}});}return _0x3ad361;}function getTicket(_0xbbb321,_0x70a797,_0x3d7adf,_0x25f6c7,_0x1ac9f7,_0xe4900e){return function(_0x4d994c){logger['info']('['+[_0xbbb321['toUpperCase']()]+_0x669b('0x33'),_0x4d994c);return new Promise(function(_0x1b48b1,_0x37eb72){var _0x167f5d=_0xbbb321['toLowerCase']()===_0x669b('0x34')?_0x4d994c[_0x669b('0x18')]:_0x4d994c[_0x669b('0x23')];var _0x45e278={'method':'POST','uri':_0x3d7adf+'incident'+'?'+_0xe4900e,'body':Object['assign']({},{'active':_0x669b('0x20'),'caller_id':_0x167f5d,'short_description':intUtil[_0x669b('0x35')](_0x25f6c7[_0x669b('0x36')],_0x1ac9f7,'\x20'),'description':intUtil['getString'](_0x25f6c7[_0x669b('0x37')],_0x1ac9f7,'\x0a')},getCustomFields(_0x25f6c7[_0x669b('0x38')],_0x1ac9f7)),'auth':_0x70a797,'json':!![]};return rp(_0x45e278)[_0x669b('0xa')](function(_0x1641f0){logger[_0x669b('0xc')]('['+[_0xbbb321[_0x669b('0xd')]()]+_0x669b('0x39'),_0x1641f0[_0x669b('0x19')]);_0x4d994c[_0x669b('0x3a')]=_0x1641f0[_0x669b('0x19')][_0x669b('0x1a')];_0x4d994c['ticketNumber']=_0x1641f0[_0x669b('0x19')][_0x669b('0x3b')];logger[_0x669b('0xc')]('['+[_0xbbb321[_0x669b('0xd')]()]+']\x20getTicket\x20crm',_0x4d994c);_0x1b48b1(_0x4d994c);})['catch'](function(_0x2a6f18){logger['error']('['+[_0xbbb321[_0x669b('0xd')]()]+']',_0x2a6f18[_0x669b('0x11')]);_0x37eb72(_0x2a6f18[_0x669b('0x11')]);});});};}function createRemoteTag(_0x39c951,_0x5ceae6,_0x33ffb3,_0x4675bd){return new Promise(function(_0x54bc98,_0x550dd0){var _0x126640={'method':_0x669b('0x1d'),'uri':_0x33ffb3+'label'+'?'+_0x4675bd,'body':{'short_description':_0x39c951,'global':!![],'active':!![],'name':_0x39c951},'auth':_0x5ceae6,'json':!![]};return rp(_0x126640)[_0x669b('0xa')](function(_0x16bde3){var _0x155a58=_0x16bde3['result'][_0x669b('0x1a')];_0x54bc98(_0x155a58);});});}function getRemoteTag(_0x59a541,_0x9c463f,_0x16eda9,_0x5961a7,_0x31d67c){return new Promise(function(_0x360790,_0xeee4aa){var _0x21b3d4={'method':_0x669b('0x8'),'uri':_0x16eda9+'label'+_0x669b('0x3c')+_0x59a541+'&'+_0x5961a7,'auth':_0x9c463f,'json':!![]};return rp(_0x21b3d4)[_0x669b('0xa')](function(_0x10ad1a){if(_0x10ad1a['result'][_0x669b('0x17')]>0x0){var _0x1c7265=_0x10ad1a[_0x669b('0x19')][0x0][_0x669b('0x1a')];_0x360790(_0x1c7265);}else{return createRemoteTag(_0x59a541,_0x9c463f,_0x16eda9,_0x5961a7)[_0x669b('0xa')](function(_0x21e96e){_0x360790(_0x21e96e);});}});});}function assignTagToIncident(_0x4aec8c,_0x59e529,_0x4330d8,_0x39f8d3,_0x464300){return new Promise(function(_0x354688,_0x77f018){var _0x1b96b2={'method':_0x669b('0x1d'),'uri':_0x4330d8+_0x669b('0x3d')+'?'+_0x464300,'body':{'label':_0x4aec8c,'table':_0x669b('0x3e'),'id_type':_0x669b('0x3f'),'table_key':_0x39f8d3[_0x669b('0x3a')],'title':_0x669b('0x40')+_0x39f8d3[_0x669b('0x41')],'id_display':_0x39f8d3[_0x669b('0x41')]},'auth':_0x59e529,'json':!![]};return rp(_0x1b96b2)['then'](function(_0xf08a8b){_0x354688();})[_0x669b('0xf')](function(){_0x354688();});});}function manageTags(_0x2a5980,_0x2da889,_0x298d13,_0x44f3b5,_0xc406b3,_0x29fdc0,_0x29df46){return new Promise(function(_0x47001a,_0x3962b4){var _0x5a66b7=[];_0x2da889[_0x669b('0x42')](function(_0xb38c4c){_0x5a66b7[_0x669b('0x43')](getRemoteTag(_0xb38c4c,_0x298d13,_0x44f3b5,_0x29fdc0,_0x29df46));});return Promise[_0x669b('0x44')](_0x5a66b7)['then'](function(_0x5685a5){if(_0x5685a5['length']){logger[_0x669b('0xc')]('['+[_0x2a5980[_0x669b('0xd')]()]+_0x669b('0x45'),_0x5685a5);var _0x5c0431=[];_0x5685a5['forEach'](function(_0xbac8ce){_0x5c0431[_0x669b('0x43')](assignTagToIncident(_0xbac8ce,_0x298d13,_0x44f3b5,_0xc406b3,_0x29fdc0));});return Promise[_0x669b('0x44')](_0x5c0431)['then'](function(){_0x47001a();})[_0x669b('0xf')](function(){_0x47001a();});}else{_0x47001a();}});});}function getTags(_0x339634,_0xed5d5d,_0x31ce4d,_0x2f4954,_0xf1a69d,_0x4525c5){return function(_0x34ccac){return new Promise(function(_0x595792,_0x29c924){var _0x42f25a=[];var _0x36428f=_0x2f4954['Tags'];if(_0x36428f&&_0x36428f[_0x669b('0x17')]>0x0){_0x42f25a=_['map'](_0x36428f,'name');}if(_0x42f25a[_0x669b('0x17')]>0x0){return manageTags(_0x339634,_0x42f25a,_0xed5d5d,_0x31ce4d,_0x34ccac,_0xf1a69d,_0x4525c5)['then'](function(){_0x595792(_0x34ccac);});}else{_0x595792(_0x34ccac);}});};}function emit(_0x552fcf,_0x9bd7d5,_0x538265){var _0x3c380a=_0x669b('0x46')+_0x669b('0x47')+_0x669b('0x48')+_0x669b('0x49');var _0x57ef88={'uri':_0x552fcf+_0x669b('0x4a')+_0x538265+_0x3c380a};io['to'](util[_0x669b('0x4b')]('user:%s',_0x9bd7d5))[_0x669b('0x4c')](_0x669b('0x4d'),_0x57ef88);}exports['cs']=function(_0x328391,_0x567240,_0x2b7e1c,_0x111162,_0xbaf216,_0x38445e,_0x50bcdd,_0x2efaf8){var _0xf26d23={};var _0x2b50d8={'user':_0x38445e['username'],'pass':_0x38445e[_0x669b('0x4e')]};var _0x13eafe='sysparm_limit=1';var _0x9322e5=_0x669b('0x4f');_0x38445e[_0x669b('0x50')]=intUtil[_0x669b('0x51')](_0x38445e[_0x669b('0x50')]);_0x38445e[_0x669b('0x52')]=intUtil[_0x669b('0x51')](_0x38445e[_0x669b('0x52')]);var _0x10f76b=util[_0x669b('0x4b')](_0x669b('0x53'),_0x38445e[_0x669b('0x50')]);_0xf26d23[_0x669b('0x14')]=_0x111162['email'];_0xf26d23[_0x669b('0x1b')]=_0x38445e['email'];_0xf26d23['endUserNumber']=_0x2efaf8['toLowerCase']()==='outbound'?_0x567240['destcalleridnum']:_0x567240['calleridnum'];_0xf26d23[_0x669b('0x54')]=_0x2efaf8===_0x669b('0x55')||_0x2efaf8===_0x669b('0x56')?_0x669b('0x55'):_0x669b('0x34');var _0x505b60=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38445e[_0x669b('0x52')],_0x567240[_0x669b('0x57')],md5(_0x567240[_0x669b('0x57')]));if(_0xbaf216&&_0xbaf216[_0x669b('0x58')]){logger[_0x669b('0xc')](_0x669b('0x59'),_0x669b('0x5a'));_0x567240[_0x669b('0x5b')]=_0x505b60;}else if(_0x50bcdd&&_0x50bcdd[_0x669b('0x5c')]&&_0x50bcdd[_0x669b('0x5c')]!==_0x669b('0x5d')){logger[_0x669b('0xc')](_0x669b('0x5e'),'Recording\x20is\x20enabled!');_0x567240[_0x669b('0x5b')]=_0x505b60;}else{_0x567240[_0x669b('0x5b')]='';}return getAdminUser(_0x2efaf8,_0x2b50d8,_0xf26d23,_0x10f76b,_0x9322e5,_0x13eafe)['then'](getUser(_0x2efaf8,_0x2b50d8,_0x10f76b,_0x9322e5,_0x13eafe))['then'](getEndUser(_0x2efaf8,_0x2b50d8,_0x10f76b,_0x9322e5,_0x13eafe))['then'](getTicket(_0x2efaf8,_0x2b50d8,_0x10f76b,_0x2b7e1c,_0x567240,_0x9322e5))[_0x669b('0xa')](function(_0x429ad5){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x429ad5[_0x669b('0x3a')]));logger[_0x669b('0xc')](util['format']('call\x20direction:\x20%s',_0x2efaf8));if(_0x2efaf8!==_0x669b('0x56')){logger[_0x669b('0xc')]('['+[_0x2efaf8[_0x669b('0xd')]()]+']',_0x669b('0x5f'));emit(_0x38445e['remoteUri'],_0x111162[_0x669b('0x32')],_0x429ad5['ticketId']);}})[_0x669b('0xf')](function(_0x22af31){logger[_0x669b('0x10')]('['+[_0x2efaf8['toUpperCase']()]+_0x669b('0x60'),util[_0x669b('0x61')](_0x22af31,{'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 8966542..1fb7f08 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 _0x2edf=['Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','slice','replace','duration_hours','duration_minutes','parent_type','Contacts','length','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','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','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_name','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','string','customField','nameField','toLowerCase','content','toString','push','variable','custom_fields','customVariable','Variable','login','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','stripTrailingSlash','remoteUri','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','uri','%s/service/v4_1/rest.php','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','error','abandoned','[ABANDONED]','bluebird','md5','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x2edf,0x1bd));var _0xf2ed=function(_0x23e5fd,_0x2c6da6){_0x23e5fd=_0x23e5fd-0x0;var _0xab592b=_0x2edf[_0x23e5fd];return _0xab592b;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xf2ed('0x0'));var md5=require(_0xf2ed('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xf2ed('0x2'));var config=require('../../../../config/environment');var logger=require(_0xf2ed('0x3'))(_0xf2ed('0x4'));config[_0xf2ed('0x5')]=_[_0xf2ed('0x6')](config[_0xf2ed('0x5')],{'host':_0xf2ed('0x7'),'port':0x18eb});var io=require(_0xf2ed('0x8'))(new Redis(config['redis']));var def={'method':_0xf2ed('0x9'),'json':!![]};function emit(_0x5863f8,_0xc9839e,_0x4de854){io['to'](_0x5863f8)['emit'](_0xc9839e,_0x4de854);}function getTicket(_0x5b5648,_0x5056d7,_0xd766c7,_0x3e34da,_0x174863,_0x5d99b4,_0x4ba809,_0x3f7853){logger[_0xf2ed('0xa')](_0xf2ed('0xb'));var _0xb5486e=new Date();var _0x5ea12a=[{'name':_0xf2ed('0xc'),'value':intUtil[_0xf2ed('0xd')](_0x3e34da['Subjects'],_0x174863,'\x20')},{'name':_0xf2ed('0xe'),'value':_0x5056d7['id']},{'name':_0xf2ed('0xf'),'value':_0x5056d7['id']},{'name':_0xf2ed('0x10'),'value':intUtil[_0xf2ed('0xd')](_0x3e34da[_0xf2ed('0x11')],_0x174863,'\x0a')},{'name':_0xf2ed('0x12'),'value':_0xb5486e['toISOString']()[_0xf2ed('0x13')](0x0,0x13)[_0xf2ed('0x14')]('T','\x20')},{'name':_0xf2ed('0x15'),'value':'0'},{'name':_0xf2ed('0x16'),'value':'15'},{'name':'parent_id','value':_0xd766c7['id']},{'name':_0xf2ed('0x17'),'value':_0xf2ed('0x18')},{'name':'parent_name','value':_0xd766c7[_0xf2ed('0xc')]},{'name':'direction','value':_0x3f7853}];if(_0x5d99b4[_0xf2ed('0x19')]){_['forEach'](_0x5d99b4,function(_0x2e0b7d){if(_0x174863[_0x2e0b7d[_0xf2ed('0x1a')]]){_0x5ea12a['push']({'name':_0x2e0b7d[_0xf2ed('0x1b')],'value':_0x174863[_0x2e0b7d[_0xf2ed('0x1a')]]});}});}return request({'form':{'method':_0xf2ed('0x1c'),'input_type':'JSON','response_type':_0xf2ed('0x1d'),'rest_data':JSON[_0xf2ed('0x1e')]({'session':_0x4ba809['id'],'module_name':_0xf2ed('0x1f'),'name_value_list':_0x5ea12a})}});}function getAuth(_0x48f54d){return util[_0xf2ed('0x20')](_0xf2ed('0x21'),new Buffer(_0x48f54d[_0xf2ed('0x22')]+':X')['toString']('base64'));}function getServerInfo(_0x9bb9a5){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0xf2ed('0x1d'),'rest_data':JSON[_0xf2ed('0x1e')]({'session':_0x9bb9a5['id']})}});}function getUser(_0x3413dc,_0x37c194,_0x560154){logger['info'](_0xf2ed('0x23'),_0x37c194);return request({'form':{'method':_0xf2ed('0x24'),'input_type':_0xf2ed('0x1d'),'response_type':_0xf2ed('0x1d'),'rest_data':JSON[_0xf2ed('0x1e')]({'session':_0x560154['id'],'module_name':_0xf2ed('0x25'),'query':util['format'](_0xf2ed('0x26'),_0x37c194),'order_by':'','offset':'0','select_fields':['id',_0xf2ed('0xc'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf2ed('0x27')](function(_0x517c35){if(_0x517c35[_0xf2ed('0x28')]['length']){var _0x275925=_[_0xf2ed('0x29')](_0x517c35[_0xf2ed('0x28')],function(_0x540819){return _0x540819[_0xf2ed('0x2a')]['user_name'][_0xf2ed('0x2b')]===_0x37c194;});if(_0x275925){logger[_0xf2ed('0xa')](_0xf2ed('0x2c'));return BPromise[_0xf2ed('0x2d')]({'id':_0x275925[_0xf2ed('0x2a')]['id']['value'],'name':_0x275925[_0xf2ed('0x2a')]['name']['value']});}}else{logger[_0xf2ed('0xa')](_0xf2ed('0x2e'));return BPromise[_0xf2ed('0x2d')]({'id':_0x560154[_0xf2ed('0x2a')]['user_id'][_0xf2ed('0x2b')],'name':_0x560154[_0xf2ed('0x2a')][_0xf2ed('0x2f')]['value']});}});}function getEndUser(_0x2248f2,_0x2c6206,_0x30daeb,_0x24d456){logger[_0xf2ed('0xa')]('Searching\x20enduser\x20with\x20phone',_0x30daeb);return request({'form':{'method':_0xf2ed('0x24'),'input_type':_0xf2ed('0x1d'),'response_type':'JSON','rest_data':JSON[_0xf2ed('0x1e')]({'session':_0x24d456['id'],'module_name':'Contacts','query':util['format'](_0xf2ed('0x30'),_0x30daeb),'order_by':'','offset':'0','select_fields':['id','name',_0xf2ed('0x31')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf2ed('0x27')](function(_0x212dde){if(_0x212dde['entry_list'][_0xf2ed('0x19')]){var _0x449d55=_[_0xf2ed('0x29')](_0x212dde['entry_list'],function(_0x448ebd){return _0x448ebd['name_value_list'][_0xf2ed('0x31')][_0xf2ed('0x2b')]===_0x30daeb;});if(_0x449d55){logger[_0xf2ed('0xa')](_0xf2ed('0x32'));return BPromise[_0xf2ed('0x2d')]({'id':_0x449d55[_0xf2ed('0x2a')]['id'][_0xf2ed('0x2b')],'name':_0x449d55[_0xf2ed('0x2a')][_0xf2ed('0xc')][_0xf2ed('0x2b')],'phone':_0x449d55[_0xf2ed('0x2a')]['phone_home'][_0xf2ed('0x2b')]});}}else{logger[_0xf2ed('0xa')](_0xf2ed('0x33'));return request({'form':{'method':_0xf2ed('0x1c'),'input_type':_0xf2ed('0x1d'),'response_type':_0xf2ed('0x1d'),'rest_data':JSON['stringify']({'session':_0x24d456['id'],'module_name':_0xf2ed('0x18'),'name_value_list':[{'name':_0xf2ed('0x34'),'value':_0x2c6206!==_0xf2ed('0x35')?_0x2c6206:util[_0xf2ed('0x20')](_0xf2ed('0x36'),_0x30daeb)},{'name':_0xf2ed('0x31'),'value':_0x30daeb}]})}})[_0xf2ed('0x27')](function(_0x4e9542){logger[_0xf2ed('0xa')](_0xf2ed('0x37'));return BPromise['resolve']({'id':_0x4e9542['id'],'name':_0x4e9542['entry_list'][_0xf2ed('0x34')][_0xf2ed('0x2b')],'phone':_0x4e9542[_0xf2ed('0x28')]['phone_home'][_0xf2ed('0x2b')]});});}});}function request(_0x3b84d3){logger[_0xf2ed('0x38')](_0xf2ed('0x39'),JSON[_0xf2ed('0x1e')](_0x3b84d3));return rp(_[_0xf2ed('0x3a')](def,_0x3b84d3));}function getTags(_0x5be2c2,_0x5668e1){var _0x3a5329=[];if(_0x5be2c2&&_0x5be2c2[_0xf2ed('0x19')]>0x0){_0x3a5329=_[_0xf2ed('0x3b')](_0x5be2c2,_0x5668e1);}return _0x3a5329;}function getCustomFields(_0x43b6f2,_0x526fbd){var _0x3381e6=[];var _0x2606d7={'custom_fields':[]};if(_0x43b6f2[_0xf2ed('0x19')]>0x0){_[_0xf2ed('0x3c')](_0x43b6f2,function(_0x2d9ed2){if(_0x2d9ed2[_0xf2ed('0x3d')]===_0xf2ed('0x3e')&&_0x2d9ed2['nameField']&&!_0x2d9ed2[_0xf2ed('0x3f')]){_0x2606d7[_0x2d9ed2[_0xf2ed('0x40')][_0xf2ed('0x41')]()]=_0x2d9ed2[_0xf2ed('0x42')][_0xf2ed('0x43')]();}else if(_0x2d9ed2[_0xf2ed('0x3d')]===_0xf2ed('0x3e')&&_0x2d9ed2[_0xf2ed('0x1b')]&&_0x2d9ed2[_0xf2ed('0x3f')]){_0x2606d7['custom_fields'][_0xf2ed('0x44')]({'id':_0x2d9ed2[_0xf2ed('0x1b')],'value':_0x2d9ed2['content'][_0xf2ed('0x43')]()});}else if(_0x2d9ed2['type']===_0xf2ed('0x45')&&_0x2d9ed2[_0xf2ed('0x1a')]&&_0x2d9ed2['idField']&&_0x2d9ed2[_0xf2ed('0x3f')]){_0x526fbd[_0x2d9ed2[_0xf2ed('0x1a')]]&&_0x2606d7[_0xf2ed('0x46')]['push']({'id':_0x2d9ed2[_0xf2ed('0x1b')],'value':_0x526fbd[_0x2d9ed2[_0xf2ed('0x1a')]]['toString']()});}else if(_0x2d9ed2[_0xf2ed('0x3d')]===_0xf2ed('0x47')&&_0x2d9ed2['Variable']&&_0x2d9ed2['Variable'][_0xf2ed('0xc')]&&_0x2d9ed2['idField']&&_0x2d9ed2['customField']){_0x526fbd[_0x2d9ed2[_0xf2ed('0x48')][_0xf2ed('0xc')][_0xf2ed('0x41')]()]&&_0x2606d7[_0xf2ed('0x46')][_0xf2ed('0x44')]({'id':_0x2d9ed2[_0xf2ed('0x1b')],'value':_0x526fbd[_0x2d9ed2[_0xf2ed('0x48')][_0xf2ed('0xc')][_0xf2ed('0x41')]()][_0xf2ed('0x43')]()});}});}return _0x2606d7;}function getConnection(_0x2d6a5a){return request({'method':_0xf2ed('0x9'),'form':{'method':_0xf2ed('0x49'),'input_type':_0xf2ed('0x1d'),'response_type':_0xf2ed('0x1d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2d6a5a['username'],'password':_0x2d6a5a['password'],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0xf2ed('0x27')](function(_0x476a9d){var _0x24a0aa=_0x476a9d;if(_0x24a0aa['id']){def[_0xf2ed('0x4a')]=_0x24a0aa['id'];return BPromise['resolve'](_0x24a0aa);}else{throw new Error(util[_0xf2ed('0x20')](_0xf2ed('0x4b'),_0x2d6a5a['id']));}});}function setRelationship(_0x4841f0,_0x568933,_0x5e7764,_0x5e7639){return request({'form':{'method':'set_relationship','input_type':_0xf2ed('0x1d'),'response_type':_0xf2ed('0x1d'),'rest_data':JSON[_0xf2ed('0x1e')]({'session':_0x4841f0['id'],'module_name':_0xf2ed('0x1f'),'module_id':_0x5e7764['id'],'link_field_name':_0x5e7639,'related_ids':[_0x568933['id']]})}});}exports[_0xf2ed('0x4c')]=function(_0x206e54,_0x39423e,_0x34db67,_0xb25d46,_0x26e748,_0x1fe38a){var _0x681537,_0x26e948,_0x2854de,_0x53e160;_0x1fe38a['remoteUri']=intUtil[_0xf2ed('0x4d')](_0x1fe38a[_0xf2ed('0x4e')]);_0x1fe38a[_0xf2ed('0x4f')]=intUtil[_0xf2ed('0x4d')](_0x1fe38a[_0xf2ed('0x4f')]);def['uri']=util[_0xf2ed('0x20')]('%s/service/v4_1/rest.php',_0x1fe38a[_0xf2ed('0x4e')]);if(_0x26e748&&_0x26e748[_0xf2ed('0x50')]){logger[_0xf2ed('0xa')](_0xf2ed('0x51'),_0xf2ed('0x52'));_0x39423e[_0xf2ed('0x53')]=util['format'](_0xf2ed('0x54'),_0x1fe38a[_0xf2ed('0x4f')],_0x39423e[_0xf2ed('0x55')],md5(_0x39423e[_0xf2ed('0x55')]));}else{_0x39423e[_0xf2ed('0x53')]='';}return getConnection(_0x1fe38a)[_0xf2ed('0x27')](function(_0xdc9eef){_0x53e160=_0xdc9eef;return getUser(_0x1fe38a,_0xb25d46['name'],_0x53e160);})['then'](function(_0x512257){_0x681537=_0x512257;logger[_0xf2ed('0xa')]('The\x20User\x20ID\x20is:',_0x681537['id']);return getEndUser(_0x1fe38a,_0x39423e[_0xf2ed('0x56')],_0x39423e[_0xf2ed('0x57')],_0x53e160);})[_0xf2ed('0x27')](function(_0x538536){_0x26e948=_0x538536;logger[_0xf2ed('0xa')](_0xf2ed('0x58'),_0x26e948['id']);return getTicket(_0x1fe38a,_0x681537,_0x26e948,_0x34db67,_0x39423e,_0x34db67[_0xf2ed('0x59')],_0x53e160,_0xf2ed('0x5a'));})[_0xf2ed('0x27')](function(_0x16c108){_0x2854de=_0x16c108;logger[_0xf2ed('0xa')](_0xf2ed('0x5b'));logger['info'](_0xf2ed('0x5c'),_0x2854de['id']);return setRelationship(_0x53e160,_0x681537,_0x2854de,_0xf2ed('0x5d'));})[_0xf2ed('0x27')](function(){return setRelationship(_0x53e160,_0x26e948,_0x2854de,_0xf2ed('0x5e'));})[_0xf2ed('0x27')](function(){return getServerInfo(_0x53e160);})[_0xf2ed('0x27')](function(_0x278905){var _0x1a8f6d=parseInt(_0x278905[_0xf2ed('0x5f')][_0xf2ed('0x60')](0x0));var _0xd432b6=util[_0xf2ed('0x20')](_0xf2ed('0x61'),_0x1fe38a[_0xf2ed('0x4e')],_0x2854de['id']);if(_0x1a8f6d>0x6){_0xd432b6=util['format'](_0xf2ed('0x62'),_0x1fe38a[_0xf2ed('0x4e')],_0x2854de['id']);}logger[_0xf2ed('0xa')](_0xf2ed('0x51'),_0xf2ed('0x63'));emit(util[_0xf2ed('0x20')](_0xf2ed('0x64'),_0xb25d46['name']),_0xf2ed('0x65'),{'uri':_0xd432b6});})[_0xf2ed('0x66')](function(_0x173d24){logger['error'](_0xf2ed('0x51'),JSON[_0xf2ed('0x1e')](_0x173d24));});};exports['outbound']=function(_0x3dc8e4,_0x218a8c,_0x46652b,_0x4f8230,_0x548352,_0x75b4cf,_0x3f1c85){var _0x3319bf,_0x141db5,_0x1443fa,_0x356b82;_0x75b4cf[_0xf2ed('0x4e')]=intUtil[_0xf2ed('0x4d')](_0x75b4cf[_0xf2ed('0x4e')]);_0x75b4cf[_0xf2ed('0x4f')]=intUtil['stripTrailingSlash'](_0x75b4cf['serverUrl']);def[_0xf2ed('0x67')]=util[_0xf2ed('0x20')](_0xf2ed('0x68'),_0x75b4cf[_0xf2ed('0x4e')]);if(_0x3f1c85&&_0x3f1c85[_0xf2ed('0x69')]&&_0x3f1c85[_0xf2ed('0x69')]!=='none'){logger[_0xf2ed('0xa')](_0xf2ed('0x6a'),'Recording\x20is\x20enabled!');_0x218a8c[_0xf2ed('0x53')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x75b4cf[_0xf2ed('0x4f')],_0x218a8c[_0xf2ed('0x55')],md5(_0x218a8c['uniqueid']));}return getConnection(_0x75b4cf)[_0xf2ed('0x27')](function(_0x141fef){_0x356b82=_0x141fef;return getUser(_0x75b4cf,_0x4f8230['name'],_0x356b82);})[_0xf2ed('0x27')](function(_0x4c983c){_0x3319bf=_0x4c983c;logger['info'](_0xf2ed('0x6b'),_0x3319bf['id']);return getEndUser(_0x75b4cf,_0x218a8c[_0xf2ed('0x6c')],_0x218a8c[_0xf2ed('0x6d')],_0x356b82);})[_0xf2ed('0x27')](function(_0x4caa63){_0x141db5=_0x4caa63;logger[_0xf2ed('0xa')]('The\x20Enduser\x20ID\x20is:',_0x141db5['id']);return getTicket(_0x75b4cf,_0x3319bf,_0x141db5,_0x46652b,_0x218a8c,_0x46652b[_0xf2ed('0x59')],_0x356b82,_0xf2ed('0x6e'));})[_0xf2ed('0x27')](function(_0x2fea4d){_0x1443fa=_0x2fea4d;logger[_0xf2ed('0xa')](_0xf2ed('0x5b'));logger[_0xf2ed('0xa')](_0xf2ed('0x5c'),_0x1443fa['id']);return setRelationship(_0x356b82,_0x3319bf,_0x1443fa,_0xf2ed('0x5d'));})['then'](function(){return setRelationship(_0x356b82,_0x141db5,_0x1443fa,'contacts');})['then'](function(){return getServerInfo(_0x356b82);})[_0xf2ed('0x27')](function(_0x1a545b){var _0x5b676d=parseInt(_0x1a545b[_0xf2ed('0x5f')]['charAt'](0x0));var _0x59571f=util['format'](_0xf2ed('0x61'),_0x75b4cf[_0xf2ed('0x4e')],_0x1443fa['id']);if(_0x5b676d>0x6){_0x59571f=util[_0xf2ed('0x20')](_0xf2ed('0x62'),_0x75b4cf[_0xf2ed('0x4e')],_0x1443fa['id']);}logger['info'](_0xf2ed('0x6a'),_0xf2ed('0x63'));emit(util['format'](_0xf2ed('0x64'),_0x4f8230[_0xf2ed('0xc')]),'trigger:browser:url',{'uri':_0x59571f});})[_0xf2ed('0x66')](function(_0x452f64){logger[_0xf2ed('0x6f')](_0xf2ed('0x6a'),JSON[_0xf2ed('0x1e')](_0x452f64));});};exports[_0xf2ed('0x70')]=function(_0x550050,_0x5f239b,_0x74c6c8,_0x4e46d3,_0x519cc4,_0x398a18){var _0x5df94a,_0x44f959,_0x50286d,_0x23b864;_0x398a18['remoteUri']=intUtil[_0xf2ed('0x4d')](_0x398a18[_0xf2ed('0x4e')]);_0x398a18[_0xf2ed('0x4f')]=intUtil[_0xf2ed('0x4d')](_0x398a18['serverUrl']);def[_0xf2ed('0x67')]=util['format'](_0xf2ed('0x68'),_0x398a18[_0xf2ed('0x4e')]);if(_0x519cc4&&_0x519cc4[_0xf2ed('0x50')]){logger[_0xf2ed('0xa')](_0xf2ed('0x71'),'Recording\x20is\x20enabled!');_0x5f239b[_0xf2ed('0x53')]=util[_0xf2ed('0x20')](_0xf2ed('0x54'),_0x398a18['serverUrl'],_0x5f239b[_0xf2ed('0x55')],md5(_0x5f239b[_0xf2ed('0x55')]));}else{_0x5f239b[_0xf2ed('0x53')]='';}return getConnection(_0x398a18)[_0xf2ed('0x27')](function(_0x1f8387){_0x23b864=_0x1f8387;return getUser(_0x398a18,_0x4e46d3['name'],_0x23b864);})[_0xf2ed('0x27')](function(_0x57e86f){_0x5df94a=_0x57e86f;logger[_0xf2ed('0xa')](_0xf2ed('0x6b'),_0x5df94a['id']);return getEndUser(_0x398a18,_0x5f239b[_0xf2ed('0x56')],_0x5f239b[_0xf2ed('0x57')],_0x23b864);})['then'](function(_0x233b12){_0x44f959=_0x233b12;logger[_0xf2ed('0xa')](_0xf2ed('0x58'),_0x44f959['id']);return getTicket(_0x398a18,_0x5df94a,_0x44f959,_0x74c6c8,_0x5f239b,_0x74c6c8[_0xf2ed('0x59')],_0x23b864,'Inbound');})[_0xf2ed('0x27')](function(_0x5b7ef7){_0x50286d=_0x5b7ef7;logger[_0xf2ed('0xa')](_0xf2ed('0x5b'));logger['info'](_0xf2ed('0x5c'),_0x50286d['id']);return setRelationship(_0x23b864,_0x5df94a,_0x50286d,_0xf2ed('0x5d'));})[_0xf2ed('0x27')](function(){return setRelationship(_0x23b864,_0x44f959,_0x50286d,_0xf2ed('0x5e'));})[_0xf2ed('0x27')](function(){return getServerInfo(_0x23b864);})[_0xf2ed('0x66')](function(_0x548e95){logger['error'](_0xf2ed('0x71'),JSON[_0xf2ed('0x1e')](_0x548e95));});}; \ No newline at end of file +var _0x3840=['base64','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','length','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','user_name','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','first_name','debug','[HTTP]','merge','type','string','nameField','customField','toLowerCase','content','variable','custom_fields','push','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','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','catch','error','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','users','version','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','abandoned','[ABANDONED]','calleridnum','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_type','parent_name','name','direction','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString'];(function(_0x27d975,_0x33829f){var _0x2b9e21=function(_0x30bc0c){while(--_0x30bc0c){_0x27d975['push'](_0x27d975['shift']());}};_0x2b9e21(++_0x33829f);}(_0x3840,0xce));var _0x0384=function(_0xbfa8e5,_0x1b14be){_0xbfa8e5=_0xbfa8e5-0x0;var _0x140b6d=_0x3840[_0xbfa8e5];return _0x140b6d;};'use strict';var _=require(_0x0384('0x0'));var rp=require(_0x0384('0x1'));var BPromise=require(_0x0384('0x2'));var md5=require(_0x0384('0x3'));var util=require(_0x0384('0x4'));var Redis=require(_0x0384('0x5'));var intUtil=require(_0x0384('0x6'));var config=require(_0x0384('0x7'));var logger=require(_0x0384('0x8'))(_0x0384('0x9'));config[_0x0384('0xa')]=_[_0x0384('0xb')](config['redis'],{'host':_0x0384('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0384('0xa')]));var def={'method':_0x0384('0xd'),'json':!![]};function emit(_0x49632f,_0x530947,_0x24700f){io['to'](_0x49632f)['emit'](_0x530947,_0x24700f);}function getTicket(_0x3daa8e,_0x3a7224,_0x4604a6,_0x113173,_0x4ded6f,_0x4d0b58,_0x4c9acf,_0x4dd9f9){logger[_0x0384('0xe')](_0x0384('0xf'));var _0x5b080a=new Date();var _0x19e728=[{'name':'name','value':intUtil[_0x0384('0x10')](_0x113173[_0x0384('0x11')],_0x4ded6f,'\x20')},{'name':_0x0384('0x12'),'value':_0x3a7224['id']},{'name':_0x0384('0x13'),'value':_0x3a7224['id']},{'name':_0x0384('0x14'),'value':intUtil[_0x0384('0x10')](_0x113173[_0x0384('0x15')],_0x4ded6f,'\x0a')},{'name':_0x0384('0x16'),'value':_0x5b080a[_0x0384('0x17')]()[_0x0384('0x18')](0x0,0x13)[_0x0384('0x19')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x0384('0x1a'),'value':'15'},{'name':'parent_id','value':_0x4604a6['id']},{'name':_0x0384('0x1b'),'value':'Contacts'},{'name':_0x0384('0x1c'),'value':_0x4604a6[_0x0384('0x1d')]},{'name':_0x0384('0x1e'),'value':_0x4dd9f9}];if(_0x4d0b58['length']){_[_0x0384('0x1f')](_0x4d0b58,function(_0x467f70){if(_0x4ded6f[_0x467f70[_0x0384('0x20')]]){_0x19e728['push']({'name':_0x467f70[_0x0384('0x21')],'value':_0x4ded6f[_0x467f70[_0x0384('0x20')]]});}});}return request({'form':{'method':_0x0384('0x22'),'input_type':_0x0384('0x23'),'response_type':_0x0384('0x23'),'rest_data':JSON[_0x0384('0x24')]({'session':_0x4c9acf['id'],'module_name':_0x0384('0x25'),'name_value_list':_0x19e728})}});}function getAuth(_0xa40bba){return util[_0x0384('0x26')](_0x0384('0x27'),new Buffer(_0xa40bba[_0x0384('0x28')]+':X')[_0x0384('0x29')](_0x0384('0x2a')));}function getServerInfo(_0x187b3e){return request({'form':{'method':'get_server_info','input_type':_0x0384('0x23'),'response_type':_0x0384('0x23'),'rest_data':JSON['stringify']({'session':_0x187b3e['id']})}});}function getUser(_0xaa179,_0x239ef6,_0x17cfe5){logger[_0x0384('0xe')]('Getting\x20agent\x20with\x20name',_0x239ef6);return request({'form':{'method':_0x0384('0x2b'),'input_type':'JSON','response_type':_0x0384('0x23'),'rest_data':JSON['stringify']({'session':_0x17cfe5['id'],'module_name':'Employees','query':util[_0x0384('0x26')](_0x0384('0x2c'),_0x239ef6),'order_by':'','offset':'0','select_fields':['id',_0x0384('0x1d'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1b013d){if(_0x1b013d[_0x0384('0x2d')][_0x0384('0x2e')]){var _0x23152d=_[_0x0384('0x2f')](_0x1b013d[_0x0384('0x2d')],function(_0x344996){return _0x344996[_0x0384('0x30')]['user_name'][_0x0384('0x31')]===_0x239ef6;});if(_0x23152d){logger[_0x0384('0xe')]('Agent\x20found!');return BPromise[_0x0384('0x32')]({'id':_0x23152d[_0x0384('0x30')]['id']['value'],'name':_0x23152d['name_value_list'][_0x0384('0x1d')][_0x0384('0x31')]});}}else{logger[_0x0384('0xe')](_0x0384('0x33'));return BPromise[_0x0384('0x32')]({'id':_0x17cfe5[_0x0384('0x30')][_0x0384('0x34')][_0x0384('0x31')],'name':_0x17cfe5[_0x0384('0x30')][_0x0384('0x35')][_0x0384('0x31')]});}});}function getEndUser(_0x3e364a,_0x47c25b,_0xedacdf,_0x320ed7){logger['info'](_0x0384('0x36'),_0xedacdf);return request({'form':{'method':_0x0384('0x2b'),'input_type':'JSON','response_type':_0x0384('0x23'),'rest_data':JSON[_0x0384('0x24')]({'session':_0x320ed7['id'],'module_name':_0x0384('0x37'),'query':util[_0x0384('0x26')](_0x0384('0x38'),_0xedacdf),'order_by':'','offset':'0','select_fields':['id',_0x0384('0x1d'),_0x0384('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0384('0x3a')](function(_0x54a6c2){if(_0x54a6c2[_0x0384('0x2d')][_0x0384('0x2e')]){var _0x48c446=_['find'](_0x54a6c2[_0x0384('0x2d')],function(_0x3a8d45){return _0x3a8d45[_0x0384('0x30')][_0x0384('0x39')][_0x0384('0x31')]===_0xedacdf;});if(_0x48c446){logger[_0x0384('0xe')](_0x0384('0x3b'));return BPromise[_0x0384('0x32')]({'id':_0x48c446[_0x0384('0x30')]['id']['value'],'name':_0x48c446[_0x0384('0x30')]['name'][_0x0384('0x31')],'phone':_0x48c446[_0x0384('0x30')][_0x0384('0x39')][_0x0384('0x31')]});}}else{logger[_0x0384('0xe')](_0x0384('0x3c'));return request({'form':{'method':_0x0384('0x22'),'input_type':'JSON','response_type':_0x0384('0x23'),'rest_data':JSON['stringify']({'session':_0x320ed7['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x47c25b!==_0x0384('0x3d')?_0x47c25b:util[_0x0384('0x26')](_0x0384('0x3e'),_0xedacdf)},{'name':_0x0384('0x39'),'value':_0xedacdf}]})}})[_0x0384('0x3a')](function(_0x2a1854){logger[_0x0384('0xe')]('Enduser\x20created.');return BPromise[_0x0384('0x32')]({'id':_0x2a1854['id'],'name':_0x2a1854[_0x0384('0x2d')][_0x0384('0x3f')][_0x0384('0x31')],'phone':_0x2a1854['entry_list']['phone_home'][_0x0384('0x31')]});});}});}function request(_0x1d20cf){logger[_0x0384('0x40')](_0x0384('0x41'),JSON['stringify'](_0x1d20cf));return rp(_[_0x0384('0x42')](def,_0x1d20cf));}function getTags(_0x712edc,_0x14eb60){var _0x1f02b9=[];if(_0x712edc&&_0x712edc['length']>0x0){_0x1f02b9=_['map'](_0x712edc,_0x14eb60);}return _0x1f02b9;}function getCustomFields(_0x3fa743,_0x542584){var _0x5e1e97=[];var _0x335d66={'custom_fields':[]};if(_0x3fa743[_0x0384('0x2e')]>0x0){_['forEach'](_0x3fa743,function(_0x102528){if(_0x102528[_0x0384('0x43')]===_0x0384('0x44')&&_0x102528[_0x0384('0x45')]&&!_0x102528[_0x0384('0x46')]){_0x335d66[_0x102528[_0x0384('0x45')][_0x0384('0x47')]()]=_0x102528[_0x0384('0x48')][_0x0384('0x29')]();}else if(_0x102528[_0x0384('0x43')]===_0x0384('0x44')&&_0x102528['idField']&&_0x102528[_0x0384('0x46')]){_0x335d66['custom_fields']['push']({'id':_0x102528[_0x0384('0x21')],'value':_0x102528[_0x0384('0x48')]['toString']()});}else if(_0x102528[_0x0384('0x43')]===_0x0384('0x49')&&_0x102528['variableName']&&_0x102528[_0x0384('0x21')]&&_0x102528['customField']){_0x542584[_0x102528[_0x0384('0x20')]]&&_0x335d66[_0x0384('0x4a')][_0x0384('0x4b')]({'id':_0x102528[_0x0384('0x21')],'value':_0x542584[_0x102528[_0x0384('0x20')]][_0x0384('0x29')]()});}else if(_0x102528['type']===_0x0384('0x4c')&&_0x102528[_0x0384('0x4d')]&&_0x102528[_0x0384('0x4d')]['name']&&_0x102528['idField']&&_0x102528['customField']){_0x542584[_0x102528['Variable'][_0x0384('0x1d')][_0x0384('0x47')]()]&&_0x335d66['custom_fields'][_0x0384('0x4b')]({'id':_0x102528[_0x0384('0x21')],'value':_0x542584[_0x102528[_0x0384('0x4d')][_0x0384('0x1d')][_0x0384('0x47')]()][_0x0384('0x29')]()});}});}return _0x335d66;}function getConnection(_0x3ce0c8){return request({'method':_0x0384('0xd'),'form':{'method':_0x0384('0x4e'),'input_type':'JSON','response_type':_0x0384('0x23'),'rest_data':JSON[_0x0384('0x24')]({'user_auth':{'user_name':_0x3ce0c8[_0x0384('0x4f')],'password':_0x3ce0c8[_0x0384('0x50')],'encryption':_0x0384('0x51')},'application':_0x0384('0x52')})}})[_0x0384('0x3a')](function(_0x3cd987){var _0x5af57e=_0x3cd987;if(_0x5af57e['id']){def[_0x0384('0x53')]=_0x5af57e['id'];return BPromise[_0x0384('0x32')](_0x5af57e);}else{throw new Error(util[_0x0384('0x26')](_0x0384('0x54'),_0x3ce0c8['id']));}});}function setRelationship(_0x3cd543,_0x225640,_0x197fcb,_0x2c5ce8){return request({'form':{'method':'set_relationship','input_type':_0x0384('0x23'),'response_type':_0x0384('0x23'),'rest_data':JSON[_0x0384('0x24')]({'session':_0x3cd543['id'],'module_name':_0x0384('0x25'),'module_id':_0x197fcb['id'],'link_field_name':_0x2c5ce8,'related_ids':[_0x225640['id']]})}});}exports[_0x0384('0x55')]=function(_0x5586b5,_0x3d6502,_0x22931e,_0x26fabf,_0x121ac4,_0x23bb72){var _0x3e0fae,_0x3a6310,_0x505270,_0x327c2c;_0x23bb72['remoteUri']=intUtil[_0x0384('0x56')](_0x23bb72[_0x0384('0x57')]);_0x23bb72['serverUrl']=intUtil[_0x0384('0x56')](_0x23bb72[_0x0384('0x58')]);def[_0x0384('0x59')]=util[_0x0384('0x26')](_0x0384('0x5a'),_0x23bb72[_0x0384('0x57')]);if(_0x121ac4&&_0x121ac4[_0x0384('0x5b')]){logger['info'](_0x0384('0x5c'),_0x0384('0x5d'));_0x3d6502[_0x0384('0x5e')]=util['format'](_0x0384('0x5f'),_0x23bb72[_0x0384('0x58')],_0x3d6502[_0x0384('0x60')],md5(_0x3d6502['uniqueid']));}else{_0x3d6502[_0x0384('0x5e')]='';}return getConnection(_0x23bb72)[_0x0384('0x3a')](function(_0x1c6d7f){_0x327c2c=_0x1c6d7f;return getUser(_0x23bb72,_0x26fabf[_0x0384('0x1d')],_0x327c2c);})[_0x0384('0x3a')](function(_0x505f88){_0x3e0fae=_0x505f88;logger[_0x0384('0xe')](_0x0384('0x61'),_0x3e0fae['id']);return getEndUser(_0x23bb72,_0x3d6502[_0x0384('0x62')],_0x3d6502['calleridnum'],_0x327c2c);})[_0x0384('0x3a')](function(_0x2ccb9d){_0x3a6310=_0x2ccb9d;logger[_0x0384('0xe')](_0x0384('0x63'),_0x3a6310['id']);return getTicket(_0x23bb72,_0x3e0fae,_0x3a6310,_0x22931e,_0x3d6502,_0x22931e[_0x0384('0x64')],_0x327c2c,_0x0384('0x65'));})['then'](function(_0xd22bd){_0x505270=_0xd22bd;logger['info'](_0x0384('0x66'));logger[_0x0384('0xe')](_0x0384('0x67'),_0x505270['id']);return setRelationship(_0x327c2c,_0x3e0fae,_0x505270,'users');})[_0x0384('0x3a')](function(){return setRelationship(_0x327c2c,_0x3a6310,_0x505270,_0x0384('0x68'));})[_0x0384('0x3a')](function(){return getServerInfo(_0x327c2c);})[_0x0384('0x3a')](function(_0x3d555){var _0x324a38=parseInt(_0x3d555['version'][_0x0384('0x69')](0x0));var _0xab48e8=util[_0x0384('0x26')](_0x0384('0x6a'),_0x23bb72[_0x0384('0x57')],_0x505270['id']);if(_0x324a38>0x6){_0xab48e8=util[_0x0384('0x26')](_0x0384('0x6b'),_0x23bb72[_0x0384('0x57')],_0x505270['id']);}logger[_0x0384('0xe')](_0x0384('0x5c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0384('0x26')](_0x0384('0x6c'),_0x26fabf[_0x0384('0x1d')]),'trigger:browser:url',{'uri':_0xab48e8});})[_0x0384('0x6d')](function(_0x35e690){logger[_0x0384('0x6e')](_0x0384('0x5c'),JSON[_0x0384('0x24')](_0x35e690));});};exports['outbound']=function(_0x73d69b,_0x4d0385,_0x40ebd6,_0x50011c,_0x39c483,_0x115629,_0x1a3ce4){var _0x15a747,_0x14dae,_0xdac8d,_0x54931e;_0x115629['remoteUri']=intUtil[_0x0384('0x56')](_0x115629[_0x0384('0x57')]);_0x115629['serverUrl']=intUtil['stripTrailingSlash'](_0x115629[_0x0384('0x58')]);def['uri']=util[_0x0384('0x26')](_0x0384('0x5a'),_0x115629[_0x0384('0x57')]);if(_0x1a3ce4&&_0x1a3ce4['recordingFormat']&&_0x1a3ce4[_0x0384('0x6f')]!==_0x0384('0x70')){logger[_0x0384('0xe')]('[OUTBOUND]',_0x0384('0x5d'));_0x4d0385['recordingURL']=util[_0x0384('0x26')](_0x0384('0x5f'),_0x115629[_0x0384('0x58')],_0x4d0385['uniqueid'],md5(_0x4d0385[_0x0384('0x60')]));}return getConnection(_0x115629)[_0x0384('0x3a')](function(_0xb543ad){_0x54931e=_0xb543ad;return getUser(_0x115629,_0x50011c['name'],_0x54931e);})['then'](function(_0x552612){_0x15a747=_0x552612;logger['info'](_0x0384('0x61'),_0x15a747['id']);return getEndUser(_0x115629,_0x4d0385[_0x0384('0x71')],_0x4d0385[_0x0384('0x72')],_0x54931e);})[_0x0384('0x3a')](function(_0x47cd92){_0x14dae=_0x47cd92;logger['info'](_0x0384('0x63'),_0x14dae['id']);return getTicket(_0x115629,_0x15a747,_0x14dae,_0x40ebd6,_0x4d0385,_0x40ebd6[_0x0384('0x64')],_0x54931e,_0x0384('0x73'));})['then'](function(_0x1cc8c7){_0xdac8d=_0x1cc8c7;logger[_0x0384('0xe')]('Ticket\x20created!');logger[_0x0384('0xe')](_0x0384('0x67'),_0xdac8d['id']);return setRelationship(_0x54931e,_0x15a747,_0xdac8d,_0x0384('0x74'));})[_0x0384('0x3a')](function(){return setRelationship(_0x54931e,_0x14dae,_0xdac8d,_0x0384('0x68'));})['then'](function(){return getServerInfo(_0x54931e);})['then'](function(_0x2bc3a4){var _0x2bf3b0=parseInt(_0x2bc3a4[_0x0384('0x75')][_0x0384('0x69')](0x0));var _0xdb1f28=util[_0x0384('0x26')](_0x0384('0x6a'),_0x115629[_0x0384('0x57')],_0xdac8d['id']);if(_0x2bf3b0>0x6){_0xdb1f28=util[_0x0384('0x26')](_0x0384('0x6b'),_0x115629['remoteUri'],_0xdac8d['id']);}logger[_0x0384('0xe')](_0x0384('0x76'),_0x0384('0x77'));emit(util['format'](_0x0384('0x6c'),_0x50011c['name']),_0x0384('0x78'),{'uri':_0xdb1f28});})['catch'](function(_0x4ced05){logger[_0x0384('0x6e')]('[OUTBOUND]',JSON['stringify'](_0x4ced05));});};exports[_0x0384('0x79')]=function(_0x237a7d,_0x28d25e,_0x228d52,_0x527f60,_0x1bf62b,_0x436d4e){var _0x153979,_0xab8570,_0x1e3d2c,_0x290652;_0x436d4e['remoteUri']=intUtil[_0x0384('0x56')](_0x436d4e[_0x0384('0x57')]);_0x436d4e['serverUrl']=intUtil[_0x0384('0x56')](_0x436d4e[_0x0384('0x58')]);def[_0x0384('0x59')]=util[_0x0384('0x26')](_0x0384('0x5a'),_0x436d4e['remoteUri']);if(_0x1bf62b&&_0x1bf62b[_0x0384('0x5b')]){logger[_0x0384('0xe')](_0x0384('0x7a'),_0x0384('0x5d'));_0x28d25e[_0x0384('0x5e')]=util[_0x0384('0x26')](_0x0384('0x5f'),_0x436d4e[_0x0384('0x58')],_0x28d25e['uniqueid'],md5(_0x28d25e[_0x0384('0x60')]));}else{_0x28d25e[_0x0384('0x5e')]='';}return getConnection(_0x436d4e)['then'](function(_0x1cb5b9){_0x290652=_0x1cb5b9;return getUser(_0x436d4e,_0x527f60[_0x0384('0x1d')],_0x290652);})[_0x0384('0x3a')](function(_0x3c0e71){_0x153979=_0x3c0e71;logger[_0x0384('0xe')]('The\x20User\x20ID\x20is:',_0x153979['id']);return getEndUser(_0x436d4e,_0x28d25e[_0x0384('0x62')],_0x28d25e[_0x0384('0x7b')],_0x290652);})[_0x0384('0x3a')](function(_0x508525){_0xab8570=_0x508525;logger['info'](_0x0384('0x63'),_0xab8570['id']);return getTicket(_0x436d4e,_0x153979,_0xab8570,_0x228d52,_0x28d25e,_0x228d52['Fields'],_0x290652,'Inbound');})['then'](function(_0x4276f2){_0x1e3d2c=_0x4276f2;logger[_0x0384('0xe')]('Ticket\x20created!');logger[_0x0384('0xe')](_0x0384('0x67'),_0x1e3d2c['id']);return setRelationship(_0x290652,_0x153979,_0x1e3d2c,'users');})[_0x0384('0x3a')](function(){return setRelationship(_0x290652,_0xab8570,_0x1e3d2c,_0x0384('0x68'));})['then'](function(){return getServerInfo(_0x290652);})[_0x0384('0x6d')](function(_0x3c43ce){logger[_0x0384('0x6e')](_0x0384('0x7a'),JSON['stringify'](_0x3c43ce));});}; \ 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 0eea641..a314e1c 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 _0xb3f0=['type','variable','variableName','toString','customVariable','Variable','name','keyType','format','key','keyContent','%s:\x20%s','toLowerCase','join','stripTrailingSlash','substr','validateEmail','test','lodash','util','getString','sortBy','length','string','push','content'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0xb3f0,0x94));var _0x0b3f=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0xb3f0[_0x152121];return _0x592a85;};'use strict';var _=require(_0x0b3f('0x0'));var util=require(_0x0b3f('0x1'));exports[_0x0b3f('0x2')]=function(_0x3f6cf0,_0x1b5732,_0x41558e){var _0x33dc0c=[];if(_0x3f6cf0['length']>0x0){var _0x1908bf=_[_0x0b3f('0x3')](_0x3f6cf0,['id']);for(var _0x5e4a7a=0x0;_0x5e4a7a<_0x1908bf[_0x0b3f('0x4')];_0x5e4a7a++){var _0x5eb6b1=_0x1908bf[_0x5e4a7a];if(_0x5eb6b1['type']===_0x0b3f('0x5')){_0x33dc0c[_0x0b3f('0x6')](_0x5eb6b1[_0x0b3f('0x7')]);}else if(_0x5eb6b1[_0x0b3f('0x8')]===_0x0b3f('0x9')&&_0x5eb6b1[_0x0b3f('0xa')]){_0x1b5732[_0x5eb6b1[_0x0b3f('0xa')]]&&_0x33dc0c[_0x0b3f('0x6')](_0x1b5732[_0x5eb6b1['variableName']][_0x0b3f('0xb')]());}else if(_0x5eb6b1[_0x0b3f('0x8')]===_0x0b3f('0xc')&&_0x5eb6b1[_0x0b3f('0xd')]&&_0x5eb6b1[_0x0b3f('0xd')]['name']){_0x1b5732[_0x5eb6b1[_0x0b3f('0xd')][_0x0b3f('0xe')]['toLowerCase']()]&&_0x33dc0c['push'](_0x1b5732[_0x5eb6b1['Variable']['name']['toLowerCase']()][_0x0b3f('0xb')]());}else if(_0x5eb6b1[_0x0b3f('0x8')]==='keyValue'){if(_0x5eb6b1[_0x0b3f('0xf')]===_0x0b3f('0x5')&&_0x5eb6b1['key']){_0x33dc0c[_0x0b3f('0x6')](util[_0x0b3f('0x10')]('%s:\x20%s',_0x5eb6b1[_0x0b3f('0x11')],_0x5eb6b1[_0x0b3f('0x12')]));}else if(_0x5eb6b1[_0x0b3f('0xf')]===_0x0b3f('0x9')&&_0x5eb6b1[_0x0b3f('0xa')]&&_0x5eb6b1[_0x0b3f('0x11')]){_0x1b5732[_0x5eb6b1['variableName']]&&_0x33dc0c[_0x0b3f('0x6')](util[_0x0b3f('0x10')](_0x0b3f('0x13'),_0x5eb6b1[_0x0b3f('0x11')],_0x1b5732[_0x5eb6b1['variableName']]));}else if(_0x5eb6b1[_0x0b3f('0xf')]===_0x0b3f('0xc')&&_0x5eb6b1[_0x0b3f('0xd')]&&_0x5eb6b1['Variable'][_0x0b3f('0xe')]&&_0x5eb6b1[_0x0b3f('0x11')]){_0x1b5732[_0x5eb6b1['Variable'][_0x0b3f('0xe')][_0x0b3f('0x14')]()]&&_0x33dc0c[_0x0b3f('0x6')](util[_0x0b3f('0x10')](_0x0b3f('0x13'),_0x5eb6b1['key'],_0x1b5732[_0x5eb6b1[_0x0b3f('0xd')][_0x0b3f('0xe')]['toLowerCase']()]));}}}}return _0x33dc0c[_0x0b3f('0x15')](_0x41558e);};exports[_0x0b3f('0x16')]=function(_0x1cc7be){if(_0x1cc7be&&_0x1cc7be[_0x0b3f('0x17')](-0x1)==='/'){return _0x1cc7be[_0x0b3f('0x17')](0x0,_0x1cc7be[_0x0b3f('0x4')]-0x1);}return _0x1cc7be;};exports[_0x0b3f('0x18')]=function(_0x3bc221){if(_0x3bc221&&_0x3bc221!==''){var _0x4c9540=/^(([^<>()\[\]\\.,;:\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 _0x4c9540[_0x0b3f('0x19')](String(_0x3bc221)[_0x0b3f('0x14')]());}else{return![];}}; \ No newline at end of file +var _0x47b4=['toString','customVariable','Variable','name','toLowerCase','key','format','%s:\x20%s','keyType','join','stripTrailingSlash','substr','validateEmail','test','lodash','length','sortBy','string','push','content','type','variable','variableName'];(function(_0x4ec3de,_0x1c67c4){var _0x37478a=function(_0x5afbd3){while(--_0x5afbd3){_0x4ec3de['push'](_0x4ec3de['shift']());}};_0x37478a(++_0x1c67c4);}(_0x47b4,0x1c3));var _0x447b=function(_0xf5e3ca,_0x46d54a){_0xf5e3ca=_0xf5e3ca-0x0;var _0xcb667=_0x47b4[_0xf5e3ca];return _0xcb667;};'use strict';var _=require(_0x447b('0x0'));var util=require('util');exports['getString']=function(_0x23bce5,_0x2e4d97,_0x52cbe8){var _0x26939b=[];if(_0x23bce5[_0x447b('0x1')]>0x0){var _0x3a20c5=_[_0x447b('0x2')](_0x23bce5,['id']);for(var _0x1c3783=0x0;_0x1c3783<_0x3a20c5[_0x447b('0x1')];_0x1c3783++){var _0x30ca4c=_0x3a20c5[_0x1c3783];if(_0x30ca4c['type']===_0x447b('0x3')){_0x26939b[_0x447b('0x4')](_0x30ca4c[_0x447b('0x5')]);}else if(_0x30ca4c[_0x447b('0x6')]===_0x447b('0x7')&&_0x30ca4c[_0x447b('0x8')]){_0x2e4d97[_0x30ca4c[_0x447b('0x8')]]&&_0x26939b['push'](_0x2e4d97[_0x30ca4c[_0x447b('0x8')]][_0x447b('0x9')]());}else if(_0x30ca4c[_0x447b('0x6')]===_0x447b('0xa')&&_0x30ca4c['Variable']&&_0x30ca4c[_0x447b('0xb')][_0x447b('0xc')]){_0x2e4d97[_0x30ca4c['Variable'][_0x447b('0xc')][_0x447b('0xd')]()]&&_0x26939b[_0x447b('0x4')](_0x2e4d97[_0x30ca4c['Variable']['name'][_0x447b('0xd')]()][_0x447b('0x9')]());}else if(_0x30ca4c[_0x447b('0x6')]==='keyValue'){if(_0x30ca4c['keyType']===_0x447b('0x3')&&_0x30ca4c[_0x447b('0xe')]){_0x26939b['push'](util[_0x447b('0xf')](_0x447b('0x10'),_0x30ca4c['key'],_0x30ca4c['keyContent']));}else if(_0x30ca4c[_0x447b('0x11')]===_0x447b('0x7')&&_0x30ca4c['variableName']&&_0x30ca4c[_0x447b('0xe')]){_0x2e4d97[_0x30ca4c['variableName']]&&_0x26939b[_0x447b('0x4')](util['format'](_0x447b('0x10'),_0x30ca4c[_0x447b('0xe')],_0x2e4d97[_0x30ca4c[_0x447b('0x8')]]));}else if(_0x30ca4c['keyType']===_0x447b('0xa')&&_0x30ca4c[_0x447b('0xb')]&&_0x30ca4c['Variable'][_0x447b('0xc')]&&_0x30ca4c[_0x447b('0xe')]){_0x2e4d97[_0x30ca4c[_0x447b('0xb')]['name'][_0x447b('0xd')]()]&&_0x26939b[_0x447b('0x4')](util['format'](_0x447b('0x10'),_0x30ca4c[_0x447b('0xe')],_0x2e4d97[_0x30ca4c['Variable'][_0x447b('0xc')][_0x447b('0xd')]()]));}}}}return _0x26939b[_0x447b('0x12')](_0x52cbe8);};exports[_0x447b('0x13')]=function(_0x4b3db9){if(_0x4b3db9&&_0x4b3db9['substr'](-0x1)==='/'){return _0x4b3db9[_0x447b('0x14')](0x0,_0x4b3db9[_0x447b('0x1')]-0x1);}return _0x4b3db9;};exports[_0x447b('0x15')]=function(_0x1cd064){if(_0x1cd064&&_0x1cd064!==''){var _0x40f1f0=/^(([^<>()\[\]\\.,;:\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 _0x40f1f0[_0x447b('0x16')](String(_0x1cd064)[_0x447b('0xd')]());}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 87977f4..6d3ae33 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 _0xa9e0=['forEach','type','toString','variable','variableName','idField','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','Descriptions','format','%s/webservice.php','remoteUri','create','sessionName','HelpDesk','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','createTicket','validateEmail','Getting\x20agent\x20with\x20email','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','admin','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','getUser','Searching\x20end\x20user\x20with\x20phone','GET','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;','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Contacts','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','monitor_format','Recording\x20is\x20enabled!','serverUrl','uniqueid','calleridname','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','The\x20User\x20ID\x20is:','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','abandoned','[ABANDONED]','recordingURL','calleridnum','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length'];(function(_0x1ae192,_0x865542){var _0x464557=function(_0x48bf7c){while(--_0x48bf7c){_0x1ae192['push'](_0x1ae192['shift']());}};_0x464557(++_0x865542);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_0xfeb75b[_0x0a9e('0xd')]==='string'&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b['idField']]=_0xfeb75b['content'][_0x0a9e('0xe')]();}else if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0xf')&&_0xfeb75b[_0x0a9e('0x10')]&&_0xfeb75b[_0x0a9e('0x11')]&&_0x39753a[_0xfeb75b[_0x0a9e('0x10')]]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x10')]][_0x0a9e('0xe')]();}else if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b[_0x0a9e('0x13')]['name']&&_0xfeb75b[_0x0a9e('0x11')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x14')]['toLowerCase']()]){_0xf81284[_0xfeb75b[_0x0a9e('0x11')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]['name'][_0x0a9e('0x15')]()]['toString']();}});}return _0xf81284;}function createTicket(_0x459eb1,_0x478723,_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));var _0x112016=_[_0x0a9e('0x18')]({'parent_id':'','assigned_user_id':_0x478723['id'],'ticketpriorities':_0x0a9e('0x19'),'ticketstatus':'Open','ticket_title':intUtil[_0x0a9e('0x1a')](_0x205fd6[_0x0a9e('0x1b')],_0x31b1ca,'\x20'),'description':intUtil['getString'](_0x205fd6[_0x0a9e('0x1c')],_0x31b1ca,'\x0a'),'contact_id':_0x106033['id']},getCustomFields(_0x2eb11f,_0x31b1ca));var _0x5a09ef={'method':'POST','uri':util[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1[_0x0a9e('0x1f')]),'form':{'operation':_0x0a9e('0x20'),'username':'admin','sessionName':_0x530eb7[_0x0a9e('0x21')],'elementType':_0x0a9e('0x22'),'element':JSON[_0x0a9e('0x23')](_0x112016)},'json':!![]};return request(_0x5a09ef)[_0x0a9e('0x24')](function(_0x370d86){if(_0x370d86[_0x0a9e('0x25')]){return BPromise[_0x0a9e('0x26')]({'id':_0x370d86['result']['id']});}else{throw new Error(util['format'](_0x0a9e('0x27'),JSON[_0x0a9e('0x23')](_0x370d86[_0x0a9e('0x28')])));}})[_0x0a9e('0x29')](function(_0x526cf3){var _0x384319=_0x526cf3['statusCode']||0x1f4;logger[_0x0a9e('0x28')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x2a'),_0x384319,JSON[_0x0a9e('0x23')](_0x526cf3));});}function getUser(_0x25fba9,_0x14433c,_0x140511){if(intUtil[_0x0a9e('0x2b')](_0x14433c)===!![]){logger[_0x0a9e('0x16')](_0x0a9e('0x2c'),_0x14433c);return request({'method':'GET','uri':util[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x25fba9[_0x0a9e('0x1f')]),'qs':{'operation':_0x0a9e('0x2d'),'username':'admin','sessionName':_0x140511[_0x0a9e('0x21')],'query':util[_0x0a9e('0x1d')](_0x0a9e('0x2e'),_0x14433c)},'json':!![]})[_0x0a9e('0x24')](function(_0x58b06f){if(_0x58b06f[_0x0a9e('0x25')]&&_0x58b06f[_0x0a9e('0x2f')][_0x0a9e('0xb')]){logger[_0x0a9e('0x16')]('Agent\x20found!');return BPromise[_0x0a9e('0x26')]({'id':_0x58b06f['result'][0x0]['id'],'email':_0x58b06f[_0x0a9e('0x2f')][0x0][_0x0a9e('0x30')],'name':_0x58b06f[_0x0a9e('0x2f')][0x0][_0x0a9e('0x31')]+'\x20'+_0x58b06f[_0x0a9e('0x2f')]['last_name']});}else{logger[_0x0a9e('0x16')](_0x0a9e('0x32'));return BPromise[_0x0a9e('0x26')]({'id':_0x140511[_0x0a9e('0x33')],'email':_0x25fba9[_0x0a9e('0x34')],'name':_0x0a9e('0x35')});}})[_0x0a9e('0x29')](function(_0x39e565){var _0x5583a4=_0x39e565[_0x0a9e('0x36')]||0x1f4;logger['error'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x5583a4,JSON[_0x0a9e('0x23')](_0x39e565));});}else{logger[_0x0a9e('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x0a9e('0x26')]({'id':_0x140511[_0x0a9e('0x33')],'email':_0x25fba9[_0x0a9e('0x34')],'name':_0x0a9e('0x35')})['catch'](function(_0x54135e){var _0x1e8694=_0x54135e['statusCode']||0x1f4;logger[_0x0a9e('0x28')](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x1e8694,JSON[_0x0a9e('0x23')](_0x54135e));});}}function getEndUser(_0x4f41ae,_0x31916f,_0x3bfce8,_0x3cae){logger['info'](_0x0a9e('0x39'),_0x3bfce8);return request({'method':_0x0a9e('0x3a'),'uri':util[_0x0a9e('0x1d')]('%s/webservice.php',_0x4f41ae['remoteUri']),'qs':{'operation':_0x0a9e('0x2d'),'username':_0x0a9e('0x35'),'sessionName':_0x3cae['sessionName'],'query':util[_0x0a9e('0x1d')](_0x0a9e('0x3b'),_0x3bfce8,_0x3bfce8,_0x3bfce8,_0x3bfce8,_0x3bfce8)},'json':!![]})[_0x0a9e('0x24')](function(_0x148f55){if(_0x148f55['success']&&_0x148f55['result'][_0x0a9e('0xb')]){logger[_0x0a9e('0x16')]('Enduser\x20found!');return BPromise[_0x0a9e('0x26')]({'id':_0x148f55[_0x0a9e('0x2f')][0x0]['id'],'name':_0x148f55[_0x0a9e('0x2f')][0x0]['firstname']+'\x20'+_0x148f55[_0x0a9e('0x2f')][0x0][_0x0a9e('0x3c')],'phone':_0x3bfce8});}else{logger[_0x0a9e('0x16')](_0x0a9e('0x3d'));return request({'method':_0x0a9e('0x3e'),'uri':util[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x4f41ae[_0x0a9e('0x1f')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x3cae[_0x0a9e('0x21')],'elementType':_0x0a9e('0x3f'),'element':JSON[_0x0a9e('0x23')]({'lastname':_0x31916f,'phone':_0x3bfce8,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x24')](function(_0x11ca30){logger[_0x0a9e('0x16')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x11ca30[_0x0a9e('0x2f')]['id'],'name':_0x11ca30[_0x0a9e('0x2f')][_0x0a9e('0x3c')],'phone':_0x11ca30[_0x0a9e('0x2f')][_0x0a9e('0x40')]});})[_0x0a9e('0x29')](function(_0x10b040){var _0x445e25=_0x10b040[_0x0a9e('0x36')]||0x1f4;logger[_0x0a9e('0x28')](_0x0a9e('0x37'),_0x0a9e('0x41'),_0x445e25,JSON['stringify'](_0x10b040));});}});}function getConnection(_0x117c99){var _0x138b8b=_0x117c99[_0x0a9e('0x34')];var _0xfbd5ad=_0x117c99[_0x0a9e('0x42')];return request({'method':_0x0a9e('0x3a'),'uri':util[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x117c99['remoteUri']),'qs':{'operation':_0x0a9e('0x43'),'username':_0x138b8b},'json':!![]})['then'](function(_0x473dc8){if(_0x473dc8[_0x0a9e('0x25')]){return request({'method':_0x0a9e('0x3e'),'uri':util['format'](_0x0a9e('0x1e'),_0x117c99[_0x0a9e('0x1f')]),'form':{'operation':_0x0a9e('0x44'),'username':_0x0a9e('0x35'),'accessKey':md5(_0x473dc8[_0x0a9e('0x2f')][_0x0a9e('0x45')]+_0xfbd5ad)},'json':!![]});}})[_0x0a9e('0x24')](function(_0x5bbcde){if(_0x5bbcde[_0x0a9e('0x25')]){return BPromise[_0x0a9e('0x26')](_0x5bbcde[_0x0a9e('0x2f')]);}else{throw new Error(util[_0x0a9e('0x1d')](_0x0a9e('0x46'),_0x117c99['id']));}})[_0x0a9e('0x29')](function(_0x6054ee){var _0x19383e=_0x6054ee[_0x0a9e('0x36')]||0x1f4;logger['error'](_0x0a9e('0x37'),_0x0a9e('0x47'),_0x19383e,JSON['stringify'](_0x6054ee));});}function request(_0x4ae14b){logger['info'](_0x0a9e('0x48'),JSON[_0x0a9e('0x23')](_0x4ae14b));return rp(_0x4ae14b);}exports[_0x0a9e('0x49')]=function(_0x11545a,_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae){var _0x4b1b9f,_0x53975a,_0x39d77d,_0x204173;_0x5d38ae[_0x0a9e('0x1f')]=intUtil['stripTrailingSlash'](_0x5d38ae[_0x0a9e('0x1f')]);if(_0x375c18&&_0x375c18[_0x0a9e('0x4a')]){logger['info']('[QUEUE]',_0x0a9e('0x4b'));_0x61bb17['recordingURL']=util[_0x0a9e('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5d38ae[_0x0a9e('0x4c')],_0x61bb17[_0x0a9e('0x4d')],md5(_0x61bb17[_0x0a9e('0x4d')]));}else{_0x61bb17['recordingURL']='';}return getConnection(_0x5d38ae)[_0x0a9e('0x24')](function(_0x1bf38a){_0x204173=_0x1bf38a;return getUser(_0x5d38ae,_0x2e5165?_0x2e5165['email']:'',_0x204173);})['then'](function(_0x128aa6){_0x4b1b9f=_0x128aa6;logger[_0x0a9e('0x16')]('The\x20User\x20ID\x20is:',_0x4b1b9f['id']);return getEndUser(_0x5d38ae,_0x61bb17[_0x0a9e('0x4e')],_0x61bb17['calleridnum'],_0x204173);})[_0x0a9e('0x24')](function(_0x523cd2){_0x53975a=_0x523cd2;logger[_0x0a9e('0x16')]('The\x20Enduser\x20ID\x20is:',_0x53975a['id']);return createTicket(_0x5d38ae,_0x4b1b9f,_0x53975a,_0x30decb,_0x61bb17,_0x30decb['Fields'],_0x204173);})['then'](function(_0x2da03c){_0x39d77d=_0x2da03c;logger['info'](_0x0a9e('0x4f'));logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x39d77d['id']);var _0x19b4df=util[_0x0a9e('0x1d')](_0x0a9e('0x51'),_0x5d38ae[_0x0a9e('0x1f')],_[_0x0a9e('0x52')](_0x39d77d['id'],'x')[0x1]);logger['info'](_0x0a9e('0x53'),_0x0a9e('0x54'));emit(util[_0x0a9e('0x1d')](_0x0a9e('0x55'),_0x2e5165[_0x0a9e('0x14')]),_0x0a9e('0x56'),{'uri':_0x19b4df});})['catch'](function(_0x956fbe){logger[_0x0a9e('0x28')]('[QUEUE]',JSON[_0x0a9e('0x23')](_0x956fbe));});};exports['outbound']=function(_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6){var _0x1fc70e,_0x261adb,_0x7be420,_0x1cca9f;_0x49d231[_0x0a9e('0x1f')]=intUtil['stripTrailingSlash'](_0x49d231[_0x0a9e('0x1f')]);_0x49d231['serverUrl']=intUtil[_0x0a9e('0x57')](_0x49d231[_0x0a9e('0x4c')]);if(_0x2244d6&&_0x2244d6[_0x0a9e('0x58')]&&_0x2244d6['recordingFormat']!==_0x0a9e('0x59')){logger[_0x0a9e('0x16')](_0x0a9e('0x5a'),_0x0a9e('0x4b'));_0x5ba1f9['recordingURL']=util[_0x0a9e('0x1d')](_0x0a9e('0x5b'),_0x49d231['serverUrl'],_0x5ba1f9[_0x0a9e('0x4d')],md5(_0x5ba1f9[_0x0a9e('0x4d')]));}return getConnection(_0x49d231)[_0x0a9e('0x24')](function(_0x409b29){_0x1cca9f=_0x409b29;return getUser(_0x49d231,_0x5674ee?_0x5674ee[_0x0a9e('0x5c')]:'',_0x1cca9f);})['then'](function(_0x176840){_0x1fc70e=_0x176840;logger[_0x0a9e('0x16')](_0x0a9e('0x5d'),_0x1fc70e['id']);return getEndUser(_0x49d231,_0x5ba1f9['destcalleridname'],_0x5ba1f9[_0x0a9e('0x5e')],_0x1cca9f);})['then'](function(_0x5211e3){_0x261adb=_0x5211e3;logger[_0x0a9e('0x16')](_0x0a9e('0x5f'),_0x261adb['id']);return createTicket(_0x49d231,_0x1fc70e,_0x261adb,_0x4b3c1a,_0x5ba1f9,_0x4b3c1a[_0x0a9e('0x60')],_0x1cca9f);})[_0x0a9e('0x24')](function(_0x186f39){_0x7be420=_0x186f39;logger[_0x0a9e('0x16')](_0x0a9e('0x4f'));logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x7be420['id']);var _0x1cc4f3=util[_0x0a9e('0x1d')](_0x0a9e('0x51'),_0x49d231[_0x0a9e('0x1f')],_[_0x0a9e('0x52')](_0x7be420['id'],'x')[0x1]);logger[_0x0a9e('0x16')](_0x0a9e('0x5a'),_0x0a9e('0x54'));emit(util[_0x0a9e('0x1d')]('user:%s',_0x5674ee[_0x0a9e('0x14')]),_0x0a9e('0x56'),{'uri':_0x1cc4f3});})[_0x0a9e('0x29')](function(_0x4edbb0){logger[_0x0a9e('0x28')](_0x0a9e('0x5a'),JSON['stringify'](_0x4edbb0));});};exports[_0x0a9e('0x61')]=function(_0x56e31e,_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce){var _0x4a2438,_0x40fb85,_0x18bf5d,_0x1104ad;_0x50cdce[_0x0a9e('0x1f')]=intUtil[_0x0a9e('0x57')](_0x50cdce[_0x0a9e('0x1f')]);_0x50cdce[_0x0a9e('0x4c')]=intUtil[_0x0a9e('0x57')](_0x50cdce['serverUrl']);if(_0x4a43a8&&_0x4a43a8[_0x0a9e('0x4a')]){logger[_0x0a9e('0x16')](_0x0a9e('0x62'),'Recording\x20is\x20enabled!');_0x3ef315[_0x0a9e('0x63')]=util['format'](_0x0a9e('0x5b'),_0x50cdce[_0x0a9e('0x4c')],_0x3ef315['uniqueid'],md5(_0x3ef315[_0x0a9e('0x4d')]));}else{_0x3ef315[_0x0a9e('0x63')]='';}return getConnection(_0x50cdce)[_0x0a9e('0x24')](function(_0x317c0c){_0x1104ad=_0x317c0c;return getUser(_0x50cdce,_0x13b5c0?_0x13b5c0['email']:'',_0x1104ad);})[_0x0a9e('0x24')](function(_0x2e9552){_0x4a2438=_0x2e9552;logger[_0x0a9e('0x16')](_0x0a9e('0x5d'),_0x4a2438['id']);return getEndUser(_0x50cdce,_0x3ef315['calleridname'],_0x3ef315[_0x0a9e('0x64')],_0x1104ad);})[_0x0a9e('0x24')](function(_0x2d5506){_0x40fb85=_0x2d5506;logger[_0x0a9e('0x16')]('The\x20Enduser\x20ID\x20is:',_0x40fb85['id']);return createTicket(_0x50cdce,_0x4a2438,_0x40fb85,_0x427946,_0x3ef315,_0x427946[_0x0a9e('0x60')],_0x1104ad);})[_0x0a9e('0x24')](function(_0x30a4c7){_0x18bf5d=_0x30a4c7;logger[_0x0a9e('0x16')](_0x0a9e('0x4f'));logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x18bf5d['id']);})[_0x0a9e('0x29')](function(_0x1a7b03){logger[_0x0a9e('0x28')](_0x0a9e('0x62'),JSON[_0x0a9e('0x23')](_0x1a7b03));});}; \ No newline at end of file +var _0xa9e0=['forEach','type','toString','variable','variableName','idField','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','Descriptions','format','%s/webservice.php','remoteUri','create','sessionName','HelpDesk','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','createTicket','validateEmail','Getting\x20agent\x20with\x20email','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','admin','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','getUser','Searching\x20end\x20user\x20with\x20phone','GET','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;','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Contacts','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','monitor_format','Recording\x20is\x20enabled!','serverUrl','uniqueid','calleridname','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','The\x20User\x20ID\x20is:','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','abandoned','[ABANDONED]','recordingURL','calleridnum','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length'];(function(_0x138f9e,_0x15c649){var _0x253d4c=function(_0x1c69e8){while(--_0x1c69e8){_0x138f9e['push'](_0x138f9e['shift']());}};_0x253d4c(++_0x15c649);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_0xfeb75b[_0x0a9e('0xd')]==='string'&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b['idField']]=_0xfeb75b['content'][_0x0a9e('0xe')]();}else if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0xf')&&_0xfeb75b[_0x0a9e('0x10')]&&_0xfeb75b[_0x0a9e('0x11')]&&_0x39753a[_0xfeb75b[_0x0a9e('0x10')]]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x10')]][_0x0a9e('0xe')]();}else if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b[_0x0a9e('0x13')]['name']&&_0xfeb75b[_0x0a9e('0x11')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x14')]['toLowerCase']()]){_0xf81284[_0xfeb75b[_0x0a9e('0x11')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]['name'][_0x0a9e('0x15')]()]['toString']();}});}return _0xf81284;}function createTicket(_0x459eb1,_0x478723,_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));var _0x112016=_[_0x0a9e('0x18')]({'parent_id':'','assigned_user_id':_0x478723['id'],'ticketpriorities':_0x0a9e('0x19'),'ticketstatus':'Open','ticket_title':intUtil[_0x0a9e('0x1a')](_0x205fd6[_0x0a9e('0x1b')],_0x31b1ca,'\x20'),'description':intUtil['getString'](_0x205fd6[_0x0a9e('0x1c')],_0x31b1ca,'\x0a'),'contact_id':_0x106033['id']},getCustomFields(_0x2eb11f,_0x31b1ca));var _0x5a09ef={'method':'POST','uri':util[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1[_0x0a9e('0x1f')]),'form':{'operation':_0x0a9e('0x20'),'username':'admin','sessionName':_0x530eb7[_0x0a9e('0x21')],'elementType':_0x0a9e('0x22'),'element':JSON[_0x0a9e('0x23')](_0x112016)},'json':!![]};return request(_0x5a09ef)[_0x0a9e('0x24')](function(_0x370d86){if(_0x370d86[_0x0a9e('0x25')]){return BPromise[_0x0a9e('0x26')]({'id':_0x370d86['result']['id']});}else{throw new Error(util['format'](_0x0a9e('0x27'),JSON[_0x0a9e('0x23')](_0x370d86[_0x0a9e('0x28')])));}})[_0x0a9e('0x29')](function(_0x526cf3){var _0x384319=_0x526cf3['statusCode']||0x1f4;logger[_0x0a9e('0x28')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x2a'),_0x384319,JSON[_0x0a9e('0x23')](_0x526cf3));});}function getUser(_0x25fba9,_0x14433c,_0x140511){if(intUtil[_0x0a9e('0x2b')](_0x14433c)===!![]){logger[_0x0a9e('0x16')](_0x0a9e('0x2c'),_0x14433c);return request({'method':'GET','uri':util[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x25fba9[_0x0a9e('0x1f')]),'qs':{'operation':_0x0a9e('0x2d'),'username':'admin','sessionName':_0x140511[_0x0a9e('0x21')],'query':util[_0x0a9e('0x1d')](_0x0a9e('0x2e'),_0x14433c)},'json':!![]})[_0x0a9e('0x24')](function(_0x58b06f){if(_0x58b06f[_0x0a9e('0x25')]&&_0x58b06f[_0x0a9e('0x2f')][_0x0a9e('0xb')]){logger[_0x0a9e('0x16')]('Agent\x20found!');return BPromise[_0x0a9e('0x26')]({'id':_0x58b06f['result'][0x0]['id'],'email':_0x58b06f[_0x0a9e('0x2f')][0x0][_0x0a9e('0x30')],'name':_0x58b06f[_0x0a9e('0x2f')][0x0][_0x0a9e('0x31')]+'\x20'+_0x58b06f[_0x0a9e('0x2f')]['last_name']});}else{logger[_0x0a9e('0x16')](_0x0a9e('0x32'));return BPromise[_0x0a9e('0x26')]({'id':_0x140511[_0x0a9e('0x33')],'email':_0x25fba9[_0x0a9e('0x34')],'name':_0x0a9e('0x35')});}})[_0x0a9e('0x29')](function(_0x39e565){var _0x5583a4=_0x39e565[_0x0a9e('0x36')]||0x1f4;logger['error'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x5583a4,JSON[_0x0a9e('0x23')](_0x39e565));});}else{logger[_0x0a9e('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x0a9e('0x26')]({'id':_0x140511[_0x0a9e('0x33')],'email':_0x25fba9[_0x0a9e('0x34')],'name':_0x0a9e('0x35')})['catch'](function(_0x54135e){var _0x1e8694=_0x54135e['statusCode']||0x1f4;logger[_0x0a9e('0x28')](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x1e8694,JSON[_0x0a9e('0x23')](_0x54135e));});}}function getEndUser(_0x4f41ae,_0x31916f,_0x3bfce8,_0x3cae){logger['info'](_0x0a9e('0x39'),_0x3bfce8);return request({'method':_0x0a9e('0x3a'),'uri':util[_0x0a9e('0x1d')]('%s/webservice.php',_0x4f41ae['remoteUri']),'qs':{'operation':_0x0a9e('0x2d'),'username':_0x0a9e('0x35'),'sessionName':_0x3cae['sessionName'],'query':util[_0x0a9e('0x1d')](_0x0a9e('0x3b'),_0x3bfce8,_0x3bfce8,_0x3bfce8,_0x3bfce8,_0x3bfce8)},'json':!![]})[_0x0a9e('0x24')](function(_0x148f55){if(_0x148f55['success']&&_0x148f55['result'][_0x0a9e('0xb')]){logger[_0x0a9e('0x16')]('Enduser\x20found!');return BPromise[_0x0a9e('0x26')]({'id':_0x148f55[_0x0a9e('0x2f')][0x0]['id'],'name':_0x148f55[_0x0a9e('0x2f')][0x0]['firstname']+'\x20'+_0x148f55[_0x0a9e('0x2f')][0x0][_0x0a9e('0x3c')],'phone':_0x3bfce8});}else{logger[_0x0a9e('0x16')](_0x0a9e('0x3d'));return request({'method':_0x0a9e('0x3e'),'uri':util[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x4f41ae[_0x0a9e('0x1f')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x3cae[_0x0a9e('0x21')],'elementType':_0x0a9e('0x3f'),'element':JSON[_0x0a9e('0x23')]({'lastname':_0x31916f,'phone':_0x3bfce8,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x24')](function(_0x11ca30){logger[_0x0a9e('0x16')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x11ca30[_0x0a9e('0x2f')]['id'],'name':_0x11ca30[_0x0a9e('0x2f')][_0x0a9e('0x3c')],'phone':_0x11ca30[_0x0a9e('0x2f')][_0x0a9e('0x40')]});})[_0x0a9e('0x29')](function(_0x10b040){var _0x445e25=_0x10b040[_0x0a9e('0x36')]||0x1f4;logger[_0x0a9e('0x28')](_0x0a9e('0x37'),_0x0a9e('0x41'),_0x445e25,JSON['stringify'](_0x10b040));});}});}function getConnection(_0x117c99){var _0x138b8b=_0x117c99[_0x0a9e('0x34')];var _0xfbd5ad=_0x117c99[_0x0a9e('0x42')];return request({'method':_0x0a9e('0x3a'),'uri':util[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x117c99['remoteUri']),'qs':{'operation':_0x0a9e('0x43'),'username':_0x138b8b},'json':!![]})['then'](function(_0x473dc8){if(_0x473dc8[_0x0a9e('0x25')]){return request({'method':_0x0a9e('0x3e'),'uri':util['format'](_0x0a9e('0x1e'),_0x117c99[_0x0a9e('0x1f')]),'form':{'operation':_0x0a9e('0x44'),'username':_0x0a9e('0x35'),'accessKey':md5(_0x473dc8[_0x0a9e('0x2f')][_0x0a9e('0x45')]+_0xfbd5ad)},'json':!![]});}})[_0x0a9e('0x24')](function(_0x5bbcde){if(_0x5bbcde[_0x0a9e('0x25')]){return BPromise[_0x0a9e('0x26')](_0x5bbcde[_0x0a9e('0x2f')]);}else{throw new Error(util[_0x0a9e('0x1d')](_0x0a9e('0x46'),_0x117c99['id']));}})[_0x0a9e('0x29')](function(_0x6054ee){var _0x19383e=_0x6054ee[_0x0a9e('0x36')]||0x1f4;logger['error'](_0x0a9e('0x37'),_0x0a9e('0x47'),_0x19383e,JSON['stringify'](_0x6054ee));});}function request(_0x4ae14b){logger['info'](_0x0a9e('0x48'),JSON[_0x0a9e('0x23')](_0x4ae14b));return rp(_0x4ae14b);}exports[_0x0a9e('0x49')]=function(_0x11545a,_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae){var _0x4b1b9f,_0x53975a,_0x39d77d,_0x204173;_0x5d38ae[_0x0a9e('0x1f')]=intUtil['stripTrailingSlash'](_0x5d38ae[_0x0a9e('0x1f')]);if(_0x375c18&&_0x375c18[_0x0a9e('0x4a')]){logger['info']('[QUEUE]',_0x0a9e('0x4b'));_0x61bb17['recordingURL']=util[_0x0a9e('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5d38ae[_0x0a9e('0x4c')],_0x61bb17[_0x0a9e('0x4d')],md5(_0x61bb17[_0x0a9e('0x4d')]));}else{_0x61bb17['recordingURL']='';}return getConnection(_0x5d38ae)[_0x0a9e('0x24')](function(_0x1bf38a){_0x204173=_0x1bf38a;return getUser(_0x5d38ae,_0x2e5165?_0x2e5165['email']:'',_0x204173);})['then'](function(_0x128aa6){_0x4b1b9f=_0x128aa6;logger[_0x0a9e('0x16')]('The\x20User\x20ID\x20is:',_0x4b1b9f['id']);return getEndUser(_0x5d38ae,_0x61bb17[_0x0a9e('0x4e')],_0x61bb17['calleridnum'],_0x204173);})[_0x0a9e('0x24')](function(_0x523cd2){_0x53975a=_0x523cd2;logger[_0x0a9e('0x16')]('The\x20Enduser\x20ID\x20is:',_0x53975a['id']);return createTicket(_0x5d38ae,_0x4b1b9f,_0x53975a,_0x30decb,_0x61bb17,_0x30decb['Fields'],_0x204173);})['then'](function(_0x2da03c){_0x39d77d=_0x2da03c;logger['info'](_0x0a9e('0x4f'));logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x39d77d['id']);var _0x19b4df=util[_0x0a9e('0x1d')](_0x0a9e('0x51'),_0x5d38ae[_0x0a9e('0x1f')],_[_0x0a9e('0x52')](_0x39d77d['id'],'x')[0x1]);logger['info'](_0x0a9e('0x53'),_0x0a9e('0x54'));emit(util[_0x0a9e('0x1d')](_0x0a9e('0x55'),_0x2e5165[_0x0a9e('0x14')]),_0x0a9e('0x56'),{'uri':_0x19b4df});})['catch'](function(_0x956fbe){logger[_0x0a9e('0x28')]('[QUEUE]',JSON[_0x0a9e('0x23')](_0x956fbe));});};exports['outbound']=function(_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6){var _0x1fc70e,_0x261adb,_0x7be420,_0x1cca9f;_0x49d231[_0x0a9e('0x1f')]=intUtil['stripTrailingSlash'](_0x49d231[_0x0a9e('0x1f')]);_0x49d231['serverUrl']=intUtil[_0x0a9e('0x57')](_0x49d231[_0x0a9e('0x4c')]);if(_0x2244d6&&_0x2244d6[_0x0a9e('0x58')]&&_0x2244d6['recordingFormat']!==_0x0a9e('0x59')){logger[_0x0a9e('0x16')](_0x0a9e('0x5a'),_0x0a9e('0x4b'));_0x5ba1f9['recordingURL']=util[_0x0a9e('0x1d')](_0x0a9e('0x5b'),_0x49d231['serverUrl'],_0x5ba1f9[_0x0a9e('0x4d')],md5(_0x5ba1f9[_0x0a9e('0x4d')]));}return getConnection(_0x49d231)[_0x0a9e('0x24')](function(_0x409b29){_0x1cca9f=_0x409b29;return getUser(_0x49d231,_0x5674ee?_0x5674ee[_0x0a9e('0x5c')]:'',_0x1cca9f);})['then'](function(_0x176840){_0x1fc70e=_0x176840;logger[_0x0a9e('0x16')](_0x0a9e('0x5d'),_0x1fc70e['id']);return getEndUser(_0x49d231,_0x5ba1f9['destcalleridname'],_0x5ba1f9[_0x0a9e('0x5e')],_0x1cca9f);})['then'](function(_0x5211e3){_0x261adb=_0x5211e3;logger[_0x0a9e('0x16')](_0x0a9e('0x5f'),_0x261adb['id']);return createTicket(_0x49d231,_0x1fc70e,_0x261adb,_0x4b3c1a,_0x5ba1f9,_0x4b3c1a[_0x0a9e('0x60')],_0x1cca9f);})[_0x0a9e('0x24')](function(_0x186f39){_0x7be420=_0x186f39;logger[_0x0a9e('0x16')](_0x0a9e('0x4f'));logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x7be420['id']);var _0x1cc4f3=util[_0x0a9e('0x1d')](_0x0a9e('0x51'),_0x49d231[_0x0a9e('0x1f')],_[_0x0a9e('0x52')](_0x7be420['id'],'x')[0x1]);logger[_0x0a9e('0x16')](_0x0a9e('0x5a'),_0x0a9e('0x54'));emit(util[_0x0a9e('0x1d')]('user:%s',_0x5674ee[_0x0a9e('0x14')]),_0x0a9e('0x56'),{'uri':_0x1cc4f3});})[_0x0a9e('0x29')](function(_0x4edbb0){logger[_0x0a9e('0x28')](_0x0a9e('0x5a'),JSON['stringify'](_0x4edbb0));});};exports[_0x0a9e('0x61')]=function(_0x56e31e,_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce){var _0x4a2438,_0x40fb85,_0x18bf5d,_0x1104ad;_0x50cdce[_0x0a9e('0x1f')]=intUtil[_0x0a9e('0x57')](_0x50cdce[_0x0a9e('0x1f')]);_0x50cdce[_0x0a9e('0x4c')]=intUtil[_0x0a9e('0x57')](_0x50cdce['serverUrl']);if(_0x4a43a8&&_0x4a43a8[_0x0a9e('0x4a')]){logger[_0x0a9e('0x16')](_0x0a9e('0x62'),'Recording\x20is\x20enabled!');_0x3ef315[_0x0a9e('0x63')]=util['format'](_0x0a9e('0x5b'),_0x50cdce[_0x0a9e('0x4c')],_0x3ef315['uniqueid'],md5(_0x3ef315[_0x0a9e('0x4d')]));}else{_0x3ef315[_0x0a9e('0x63')]='';}return getConnection(_0x50cdce)[_0x0a9e('0x24')](function(_0x317c0c){_0x1104ad=_0x317c0c;return getUser(_0x50cdce,_0x13b5c0?_0x13b5c0['email']:'',_0x1104ad);})[_0x0a9e('0x24')](function(_0x2e9552){_0x4a2438=_0x2e9552;logger[_0x0a9e('0x16')](_0x0a9e('0x5d'),_0x4a2438['id']);return getEndUser(_0x50cdce,_0x3ef315['calleridname'],_0x3ef315[_0x0a9e('0x64')],_0x1104ad);})[_0x0a9e('0x24')](function(_0x2d5506){_0x40fb85=_0x2d5506;logger[_0x0a9e('0x16')]('The\x20Enduser\x20ID\x20is:',_0x40fb85['id']);return createTicket(_0x50cdce,_0x4a2438,_0x40fb85,_0x427946,_0x3ef315,_0x427946[_0x0a9e('0x60')],_0x1104ad);})[_0x0a9e('0x24')](function(_0x30a4c7){_0x18bf5d=_0x30a4c7;logger[_0x0a9e('0x16')](_0x0a9e('0x4f'));logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x18bf5d['id']);})[_0x0a9e('0x29')](function(_0x1a7b03){logger[_0x0a9e('0x28')](_0x0a9e('0x62'),JSON[_0x0a9e('0x23')](_0x1a7b03));});}; \ 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 91fc169..04ec756 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 _0xce0a=['merge','Tags','getString','Subjects','Descriptions','Fields','then','ticket','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','%s/token:%s','token','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','length','map','type','string','nameField','toLowerCase','idField','customField','content','toString','variableName','custom_fields','push','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','The\x20User\x20ID\x20is:','destcalleridnum','newTab','trigger:browser:url','inspect','abandoned','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST'];(function(_0x2d2258,_0x2ce510){var _0x18e155=function(_0x11949e){while(--_0x11949e){_0x2d2258['push'](_0x2d2258['shift']());}};_0x18e155(++_0x2ce510);}(_0xce0a,0x199));var _0xace0=function(_0x2c753c,_0x3378e7){_0x2c753c=_0x2c753c-0x0;var _0x23ba20=_0xce0a[_0x2c753c];return _0x23ba20;};'use strict';var _=require(_0xace0('0x0'));var rp=require(_0xace0('0x1'));var md5=require(_0xace0('0x2'));var util=require(_0xace0('0x3'));var Redis=require(_0xace0('0x4'));var intUtil=require(_0xace0('0x5'));var config=require(_0xace0('0x6'));var logger=require(_0xace0('0x7'))(_0xace0('0x8'));config['redis']=_[_0xace0('0x9')](config[_0xace0('0xa')],{'host':_0xace0('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xace0('0xa')]));function emit(_0x57097f,_0x4b5aca,_0x245ea0){io['to'](_0x57097f)[_0xace0('0xc')](_0x4b5aca,_0x245ea0);}var headers={'Content-Type':_0xace0('0xd'),'Accept':_0xace0('0xd')};function getTicket(_0x4e5127,_0x17edb4,_0x598893,_0x420578,_0x2f70d0){logger[_0xace0('0xe')](_0xace0('0xf'));return request({'uri':util[_0xace0('0x10')]('%s/tickets.json',_0x4e5127[_0xace0('0x11')]),'method':_0xace0('0x12'),'body':{'ticket':_[_0xace0('0x13')]({'requester_id':_0x598893['id'],'submitter_id':_0x17edb4?_0x17edb4['id']:undefined,'assignee_id':_0x17edb4?_0x17edb4['id']:undefined,'tags':getTags(_0x420578[_0xace0('0x14')],'name'),'subject':intUtil[_0xace0('0x15')](_0x420578[_0xace0('0x16')],_0x2f70d0,'\x20'),'description':intUtil[_0xace0('0x15')](_0x420578['Descriptions'],_0x2f70d0,'\x0a'),'comment':{'public':![],'body':intUtil[_0xace0('0x15')](_0x420578[_0xace0('0x17')],_0x2f70d0,'\x0a')}},getCustomFields(_0x420578[_0xace0('0x18')],_0x2f70d0))}})[_0xace0('0x19')](function(_0x56a31d){logger[_0xace0('0xe')]('Ticket\x20created!');return _0x56a31d[_0xace0('0x1a')];});}function getUser(_0x286c32,_0x498fe2){if(intUtil['validateEmail'](name)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0x498fe2);return request({'uri':util['format']('%s/search.json',_0x286c32[_0xace0('0x11')]),'qs':{'query':util[_0xace0('0x10')](_0xace0('0x1b'),_0x498fe2)}})[_0xace0('0x19')](function(_0x427e50){if(_0x427e50[_0xace0('0x1c')]){logger[_0xace0('0xe')](_0xace0('0x1d'));return _[_0xace0('0x1e')](_0x427e50[_0xace0('0x1f')],{'email':_0x498fe2,'role':_0xace0('0x20')});}else{logger[_0xace0('0xe')](_0xace0('0x21'));return request({'uri':util[_0xace0('0x10')](_0xace0('0x22'),_0x286c32[_0xace0('0x11')])})['then'](function(_0x329e52){logger['info'](_0xace0('0x23'));return _0x329e52[_0xace0('0x24')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xace0('0x22'),_0x286c32[_0xace0('0x11')])})[_0xace0('0x19')](function(_0x85ea25){logger[_0xace0('0xe')](_0xace0('0x23'));return _0x85ea25[_0xace0('0x24')];});}}function getEndUser(_0x29426f,_0xbc1a1b,_0xb8a9cb){logger['info'](_0xace0('0x25'),_0xb8a9cb);return request({'uri':util[_0xace0('0x10')](_0xace0('0x26'),_0x29426f[_0xace0('0x11')]),'qs':{'query':util[_0xace0('0x10')](_0xace0('0x27'),_0xb8a9cb)}})[_0xace0('0x19')](function(_0xbcebc3){var _0x58b7ca;if(_0xbcebc3[_0xace0('0x1f')]['length']){_0xbcebc3[_0xace0('0x1f')]=_[_0xace0('0x28')](_0xbcebc3[_0xace0('0x1f')],{'suspended':![],'role':_0xace0('0x29')});if(_0xbcebc3['results']['length']){_0x58b7ca=_['first'](_0xbcebc3[_0xace0('0x1f')]);}}if(_0x58b7ca){logger[_0xace0('0xe')](_0xace0('0x2a'));return _0x58b7ca;}else{logger['info'](_0xace0('0x2b'));return request({'uri':util[_0xace0('0x10')](_0xace0('0x2c'),_0x29426f[_0xace0('0x11')]),'method':_0xace0('0x12'),'body':{'user':{'role':'end-user','name':util['format'](_0xace0('0x2d'),_0xbc1a1b||_0xb8a9cb),'phone':_0xb8a9cb}}})['then'](function(_0x56468c){logger['info'](_0xace0('0x2e'));return _0x56468c[_0xace0('0x24')];});}});}function getAuth(_0x312f49){var _0x24e4ea;if(_0x312f49[_0xace0('0x2f')]===_0xace0('0x30')){_0x24e4ea=util['format']('%s:%s',_0x312f49[_0xace0('0x31')],_0x312f49['password']);}else if(_0x312f49[_0xace0('0x2f')]==='token'){_0x24e4ea=util['format'](_0xace0('0x32'),_0x312f49['username'],_0x312f49[_0xace0('0x33')]);}return util['format'](_0xace0('0x34'),new Buffer(_0x24e4ea)['toString'](_0xace0('0x35')));}function request(_0x3b0963){logger[_0xace0('0x36')](_0xace0('0x37'),JSON[_0xace0('0x38')](_0x3b0963));return rp(_[_0xace0('0x9')](_0x3b0963,{'method':_0xace0('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x53a5f0,_0x27107c){var _0x42f337=[];if(_0x53a5f0&&_0x53a5f0[_0xace0('0x3a')]>0x0){_0x42f337=_[_0xace0('0x3b')](_0x53a5f0,_0x27107c);}return _0x42f337;}function getCustomFields(_0x4d90c5,_0x4d4a15){var _0x1b6b8c=[];var _0xe47a17={'custom_fields':[]};if(_0x4d90c5[_0xace0('0x3a')]>0x0){_['forEach'](_0x4d90c5,function(_0x9e1790){if(_0x9e1790[_0xace0('0x3c')]===_0xace0('0x3d')&&_0x9e1790[_0xace0('0x3e')]&&!_0x9e1790['customField']){_0xe47a17[_0x9e1790[_0xace0('0x3e')][_0xace0('0x3f')]()]=_0x9e1790['content']['toString']();}else if(_0x9e1790[_0xace0('0x3c')]===_0xace0('0x3d')&&_0x9e1790[_0xace0('0x40')]&&_0x9e1790[_0xace0('0x41')]){_0xe47a17['custom_fields']['push']({'id':_0x9e1790[_0xace0('0x40')],'value':_0x9e1790[_0xace0('0x42')][_0xace0('0x43')]()});}else if(_0x9e1790[_0xace0('0x3c')]==='variable'&&_0x9e1790[_0xace0('0x44')]&&_0x9e1790[_0xace0('0x40')]&&_0x9e1790[_0xace0('0x41')]){_0x4d4a15[_0x9e1790[_0xace0('0x44')]]&&_0xe47a17[_0xace0('0x45')][_0xace0('0x46')]({'id':_0x9e1790[_0xace0('0x40')],'value':_0x4d4a15[_0x9e1790[_0xace0('0x44')]][_0xace0('0x43')]()});}else if(_0x9e1790[_0xace0('0x3c')]==='customVariable'&&_0x9e1790[_0xace0('0x47')]&&_0x9e1790[_0xace0('0x47')]['name']&&_0x9e1790['idField']&&_0x9e1790[_0xace0('0x41')]){_0x4d4a15[_0x9e1790[_0xace0('0x47')][_0xace0('0x48')][_0xace0('0x3f')]()]&&_0xe47a17[_0xace0('0x45')][_0xace0('0x46')]({'id':_0x9e1790['idField'],'value':_0x4d4a15[_0x9e1790[_0xace0('0x47')][_0xace0('0x48')]['toLowerCase']()][_0xace0('0x43')]()});}});}return _0xe47a17;}exports[_0xace0('0x49')]=function(_0x3ac214,_0xaf26f1,_0x412802,_0x20664c,_0x37a0de,_0x7ee2aa){var _0x3d141c,_0x4888d0;_0x7ee2aa[_0xace0('0x11')]=intUtil[_0xace0('0x4a')](_0x7ee2aa[_0xace0('0x11')]);_0x7ee2aa[_0xace0('0x4b')]=intUtil[_0xace0('0x4a')](_0x7ee2aa[_0xace0('0x4b')]);if(_0x37a0de&&_0x37a0de[_0xace0('0x4c')]){logger[_0xace0('0xe')](_0xace0('0x4d'),'Recording\x20is\x20enabled!');_0xaf26f1[_0xace0('0x4e')]=util['format'](_0xace0('0x4f'),_0x7ee2aa[_0xace0('0x4b')],_0xaf26f1[_0xace0('0x50')],md5(_0xaf26f1[_0xace0('0x50')]));}else{_0xaf26f1[_0xace0('0x4e')]='';}headers[_0xace0('0x51')]=getAuth(_0x7ee2aa);return getUser(_0x7ee2aa,_0x20664c['email'])[_0xace0('0x19')](function(_0xad528c){_0x3d141c=_0xad528c;logger[_0xace0('0xe')]('The\x20User\x20ID\x20is:',_0x3d141c['id']);return getEndUser(_0x7ee2aa,_0xaf26f1[_0xace0('0x52')],_0xaf26f1[_0xace0('0x53')]);})[_0xace0('0x19')](function(_0x34fa83){_0x4888d0=_0x34fa83;logger[_0xace0('0xe')](_0xace0('0x54'),_0x4888d0['id']);return getTicket(_0x7ee2aa,_0x3d141c,_0x4888d0,_0x412802,_0xaf26f1);})[_0xace0('0x19')](function(_0x4cc794){if(_0x4cc794){logger[_0xace0('0xe')](_0xace0('0x55'),_0x4cc794['id']);switch(_0x7ee2aa['type']){case _0xace0('0x56'):logger['info'](_0xace0('0x4d'),_0xace0('0x57'));return request({'uri':util[_0xace0('0x10')](_0xace0('0x58'),_0x7ee2aa['remoteUri'],_0x3d141c['id'],_0x4cc794['id']),'method':_0xace0('0x12')});case'newTab':logger['info'](_0xace0('0x4d'),_0xace0('0x59'));emit(util['format'](_0xace0('0x5a'),_0x20664c[_0xace0('0x48')]),'trigger:browser:url',{'uri':util['format'](_0xace0('0x5b'),_0x7ee2aa[_0xace0('0x11')],_0x4cc794['id'])});break;default:logger[_0xace0('0x5c')]('[QUEUE]',_0xace0('0x5d'));}}})[_0xace0('0x5e')](function(_0x441779){logger[_0xace0('0x5c')](_0xace0('0x5f'),util['inspect'](_0x441779,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0xf8ed85,_0x256adb,_0x591efe,_0x408f10,_0x1dffcb,_0xc1f760,_0x2f9d97){var _0x1b29d6,_0x1f5909;_0xc1f760[_0xace0('0x11')]=intUtil[_0xace0('0x4a')](_0xc1f760['remoteUri']);_0xc1f760[_0xace0('0x4b')]=intUtil[_0xace0('0x4a')](_0xc1f760[_0xace0('0x4b')]);if(_0x2f9d97&&_0x2f9d97['recordingFormat']&&_0x2f9d97['recordingFormat']!==_0xace0('0x60')){logger[_0xace0('0xe')](_0xace0('0x61'),_0xace0('0x62'));_0x256adb[_0xace0('0x4e')]=util[_0xace0('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xc1f760[_0xace0('0x4b')],_0x256adb['uniqueid'],md5(_0x256adb[_0xace0('0x50')]));}headers[_0xace0('0x51')]=getAuth(_0xc1f760);return getUser(_0xc1f760,_0x408f10[_0xace0('0x63')])[_0xace0('0x19')](function(_0x993bd8){_0x1b29d6=_0x993bd8;logger[_0xace0('0xe')](_0xace0('0x64'),_0x1b29d6['id']);return getEndUser(_0xc1f760,_0x256adb['destcalleridname'],_0x256adb[_0xace0('0x65')]);})[_0xace0('0x19')](function(_0x397346){_0x1f5909=_0x397346;logger['info'](_0xace0('0x54'),_0x1f5909['id']);return getTicket(_0xc1f760,_0x1b29d6,_0x1f5909,_0x591efe,_0x256adb);})[_0xace0('0x19')](function(_0x3fc92b){if(_0x3fc92b){logger['info'](_0xace0('0x55'),_0x3fc92b['id']);switch(_0xc1f760['type']){case _0xace0('0x56'):logger['info']('[OUTBOUND]',_0xace0('0x57'));return request({'uri':util[_0xace0('0x10')](_0xace0('0x58'),_0xc1f760[_0xace0('0x11')],_0x1b29d6['id'],_0x3fc92b['id']),'method':_0xace0('0x12')});case _0xace0('0x66'):logger['info']('[OUTBOUND]',_0xace0('0x59'));emit(util[_0xace0('0x10')]('user:%s',_0x408f10[_0xace0('0x48')]),_0xace0('0x67'),{'uri':util[_0xace0('0x10')]('%s/agent/tickets/%s',_0xc1f760[_0xace0('0x11')],_0x3fc92b['id'])});break;default:logger['error'](_0xace0('0x61'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xace0('0x5e')](function(_0x4a166a){logger[_0xace0('0x5c')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xace0('0x68')](_0x4a166a,{'showHidden':!![],'depth':null}));});};exports[_0xace0('0x69')]=function(_0x3b9f2b,_0x2da7d2,_0x54e369,_0x1df54b,_0x3d5961,_0x30788c){var _0x17058e,_0x5456e0;_0x30788c[_0xace0('0x11')]=intUtil[_0xace0('0x4a')](_0x30788c['remoteUri']);_0x30788c['serverUrl']=intUtil[_0xace0('0x4a')](_0x30788c[_0xace0('0x4b')]);if(_0x3d5961&&_0x3d5961[_0xace0('0x4c')]){logger[_0xace0('0xe')]('[ABANDONED]',_0xace0('0x62'));_0x2da7d2[_0xace0('0x4e')]=util[_0xace0('0x10')](_0xace0('0x4f'),_0x30788c[_0xace0('0x4b')],_0x2da7d2[_0xace0('0x50')],md5(_0x2da7d2['uniqueid']));}else{_0x2da7d2[_0xace0('0x4e')]='';}headers[_0xace0('0x51')]=getAuth(_0x30788c);return getUser(_0x30788c)[_0xace0('0x19')](function(_0x1ca580){_0x17058e=_0x1ca580;logger[_0xace0('0xe')](_0xace0('0x64'),_0x17058e['id']);return getEndUser(_0x30788c,_0x2da7d2[_0xace0('0x52')],_0x2da7d2[_0xace0('0x53')]);})[_0xace0('0x19')](function(_0x13771e){_0x5456e0=_0x13771e;logger[_0xace0('0xe')]('The\x20Enduser\x20ID\x20is:',_0x5456e0['id']);return getTicket(_0x30788c,_0x17058e,_0x5456e0,_0x54e369,_0x2da7d2);})[_0xace0('0x19')](function(_0x234013){if(_0x234013){logger[_0xace0('0xe')](_0xace0('0x55'),_0x234013['id']);}})['catch'](function(_0x2ff27a){logger[_0xace0('0x5c')](_0xace0('0x6a'),util[_0xace0('0x68')](_0x2ff27a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe387=['[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','format','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','debug','[HTTP]','stringify','GET','map','forEach','type','string','customField','nameField','content','idField','custom_fields','push','toString','variableName','customVariable','toLowerCase','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','[OUTBOUND]','Authorization','email','destcalleridname','destcalleridnum','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','abandoned','calleridname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe387,0x145));var _0x7e38=function(_0x1cc3e6,_0x618907){_0x1cc3e6=_0x1cc3e6-0x0;var _0x369176=_0xe387[_0x1cc3e6];return _0x369176;};'use strict';var _=require('lodash');var rp=require(_0x7e38('0x0'));var md5=require(_0x7e38('0x1'));var util=require(_0x7e38('0x2'));var Redis=require(_0x7e38('0x3'));var intUtil=require('./util');var config=require(_0x7e38('0x4'));var logger=require(_0x7e38('0x5'))('zendesk');config[_0x7e38('0x6')]=_[_0x7e38('0x7')](config['redis'],{'host':_0x7e38('0x8'),'port':0x18eb});var io=require(_0x7e38('0x9'))(new Redis(config[_0x7e38('0x6')]));function emit(_0x462366,_0x57a50e,_0x5480fd){io['to'](_0x462366)[_0x7e38('0xa')](_0x57a50e,_0x5480fd);}var headers={'Content-Type':_0x7e38('0xb'),'Accept':_0x7e38('0xb')};function getTicket(_0x332b2f,_0x8e253a,_0x17367a,_0x43696b,_0x6d9651){logger[_0x7e38('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x7e38('0xd')]('%s/tickets.json',_0x332b2f['remoteUri']),'method':_0x7e38('0xe'),'body':{'ticket':_[_0x7e38('0xf')]({'requester_id':_0x17367a['id'],'submitter_id':_0x8e253a?_0x8e253a['id']:undefined,'assignee_id':_0x8e253a?_0x8e253a['id']:undefined,'tags':getTags(_0x43696b[_0x7e38('0x10')],_0x7e38('0x11')),'subject':intUtil[_0x7e38('0x12')](_0x43696b[_0x7e38('0x13')],_0x6d9651,'\x20'),'description':intUtil['getString'](_0x43696b['Descriptions'],_0x6d9651,'\x0a'),'comment':{'public':![],'body':intUtil[_0x7e38('0x12')](_0x43696b[_0x7e38('0x14')],_0x6d9651,'\x0a')}},getCustomFields(_0x43696b[_0x7e38('0x15')],_0x6d9651))}})[_0x7e38('0x16')](function(_0x52438f){logger[_0x7e38('0xc')](_0x7e38('0x17'));return _0x52438f[_0x7e38('0x18')];});}function getUser(_0x2a757d,_0x2d0eff){if(intUtil[_0x7e38('0x19')](name)===!![]){logger[_0x7e38('0xc')](_0x7e38('0x1a'),_0x2d0eff);return request({'uri':util[_0x7e38('0xd')](_0x7e38('0x1b'),_0x2a757d[_0x7e38('0x1c')]),'qs':{'query':util[_0x7e38('0xd')](_0x7e38('0x1d'),_0x2d0eff)}})[_0x7e38('0x16')](function(_0x214947){if(_0x214947[_0x7e38('0x1e')]){logger[_0x7e38('0xc')](_0x7e38('0x1f'));return _[_0x7e38('0x20')](_0x214947[_0x7e38('0x21')],{'email':_0x2d0eff,'role':'agent'});}else{logger['info'](_0x7e38('0x22'));return request({'uri':util[_0x7e38('0xd')](_0x7e38('0x23'),_0x2a757d[_0x7e38('0x1c')])})[_0x7e38('0x16')](function(_0x1b02bf){logger[_0x7e38('0xc')](_0x7e38('0x24'));return _0x1b02bf[_0x7e38('0x25')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x7e38('0xd')](_0x7e38('0x23'),_0x2a757d[_0x7e38('0x1c')])})['then'](function(_0x37214e){logger[_0x7e38('0xc')](_0x7e38('0x24'));return _0x37214e[_0x7e38('0x25')];});}}function getEndUser(_0x117feb,_0x422ea9,_0x39509a){logger[_0x7e38('0xc')](_0x7e38('0x26'),_0x39509a);return request({'uri':util[_0x7e38('0xd')](_0x7e38('0x1b'),_0x117feb['remoteUri']),'qs':{'query':util[_0x7e38('0xd')](_0x7e38('0x27'),_0x39509a)}})['then'](function(_0x4354b1){var _0x5cbff4;if(_0x4354b1['results'][_0x7e38('0x28')]){_0x4354b1[_0x7e38('0x21')]=_[_0x7e38('0x29')](_0x4354b1[_0x7e38('0x21')],{'suspended':![],'role':_0x7e38('0x2a')});if(_0x4354b1[_0x7e38('0x21')][_0x7e38('0x28')]){_0x5cbff4=_[_0x7e38('0x2b')](_0x4354b1['results']);}}if(_0x5cbff4){logger[_0x7e38('0xc')](_0x7e38('0x2c'));return _0x5cbff4;}else{logger[_0x7e38('0xc')](_0x7e38('0x2d'));return request({'uri':util['format'](_0x7e38('0x2e'),_0x117feb[_0x7e38('0x1c')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x7e38('0xd')](_0x7e38('0x2f'),_0x422ea9||_0x39509a),'phone':_0x39509a}}})[_0x7e38('0x16')](function(_0x55bf10){logger[_0x7e38('0xc')](_0x7e38('0x30'));return _0x55bf10[_0x7e38('0x25')];});}});}function getAuth(_0x325148){var _0x528c33;if(_0x325148[_0x7e38('0x31')]===_0x7e38('0x32')){_0x528c33=util[_0x7e38('0xd')]('%s:%s',_0x325148[_0x7e38('0x33')],_0x325148[_0x7e38('0x32')]);}else if(_0x325148[_0x7e38('0x31')]==='token'){_0x528c33=util['format']('%s/token:%s',_0x325148[_0x7e38('0x33')],_0x325148[_0x7e38('0x34')]);}return util['format']('Basic\x20%s',new Buffer(_0x528c33)['toString']('base64'));}function request(_0x31a4b8){logger[_0x7e38('0x35')](_0x7e38('0x36'),JSON[_0x7e38('0x37')](_0x31a4b8));return rp(_['defaults'](_0x31a4b8,{'method':_0x7e38('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x1a7875,_0x378578){var _0x4f3411=[];if(_0x1a7875&&_0x1a7875[_0x7e38('0x28')]>0x0){_0x4f3411=_[_0x7e38('0x39')](_0x1a7875,_0x378578);}return _0x4f3411;}function getCustomFields(_0x584c4f,_0x12a435){var _0x63fa0=[];var _0x1c76b5={'custom_fields':[]};if(_0x584c4f[_0x7e38('0x28')]>0x0){_[_0x7e38('0x3a')](_0x584c4f,function(_0x300771){if(_0x300771[_0x7e38('0x3b')]===_0x7e38('0x3c')&&_0x300771['nameField']&&!_0x300771[_0x7e38('0x3d')]){_0x1c76b5[_0x300771[_0x7e38('0x3e')]['toLowerCase']()]=_0x300771[_0x7e38('0x3f')]['toString']();}else if(_0x300771[_0x7e38('0x3b')]===_0x7e38('0x3c')&&_0x300771[_0x7e38('0x40')]&&_0x300771[_0x7e38('0x3d')]){_0x1c76b5[_0x7e38('0x41')][_0x7e38('0x42')]({'id':_0x300771[_0x7e38('0x40')],'value':_0x300771['content'][_0x7e38('0x43')]()});}else if(_0x300771[_0x7e38('0x3b')]==='variable'&&_0x300771[_0x7e38('0x44')]&&_0x300771[_0x7e38('0x40')]&&_0x300771[_0x7e38('0x3d')]){_0x12a435[_0x300771[_0x7e38('0x44')]]&&_0x1c76b5[_0x7e38('0x41')][_0x7e38('0x42')]({'id':_0x300771['idField'],'value':_0x12a435[_0x300771['variableName']]['toString']()});}else if(_0x300771[_0x7e38('0x3b')]===_0x7e38('0x45')&&_0x300771['Variable']&&_0x300771['Variable'][_0x7e38('0x11')]&&_0x300771[_0x7e38('0x40')]&&_0x300771[_0x7e38('0x3d')]){_0x12a435[_0x300771['Variable']['name'][_0x7e38('0x46')]()]&&_0x1c76b5[_0x7e38('0x41')][_0x7e38('0x42')]({'id':_0x300771[_0x7e38('0x40')],'value':_0x12a435[_0x300771[_0x7e38('0x47')][_0x7e38('0x11')]['toLowerCase']()][_0x7e38('0x43')]()});}});}return _0x1c76b5;}exports[_0x7e38('0x48')]=function(_0xf766b0,_0x3d1cfb,_0x31efea,_0x38ab0f,_0x27b571,_0x40a546){var _0x4cbe75,_0x35c369;_0x40a546[_0x7e38('0x1c')]=intUtil[_0x7e38('0x49')](_0x40a546[_0x7e38('0x1c')]);_0x40a546[_0x7e38('0x4a')]=intUtil[_0x7e38('0x49')](_0x40a546[_0x7e38('0x4a')]);if(_0x27b571&&_0x27b571[_0x7e38('0x4b')]){logger[_0x7e38('0xc')](_0x7e38('0x4c'),_0x7e38('0x4d'));_0x3d1cfb[_0x7e38('0x4e')]=util[_0x7e38('0xd')](_0x7e38('0x4f'),_0x40a546[_0x7e38('0x4a')],_0x3d1cfb[_0x7e38('0x50')],md5(_0x3d1cfb['uniqueid']));}else{_0x3d1cfb[_0x7e38('0x4e')]='';}headers['Authorization']=getAuth(_0x40a546);return getUser(_0x40a546,_0x38ab0f['email'])[_0x7e38('0x16')](function(_0x3ad737){_0x4cbe75=_0x3ad737;logger[_0x7e38('0xc')](_0x7e38('0x51'),_0x4cbe75['id']);return getEndUser(_0x40a546,_0x3d1cfb['calleridname'],_0x3d1cfb[_0x7e38('0x52')]);})[_0x7e38('0x16')](function(_0x382d0a){_0x35c369=_0x382d0a;logger[_0x7e38('0xc')](_0x7e38('0x53'),_0x35c369['id']);return getTicket(_0x40a546,_0x4cbe75,_0x35c369,_0x31efea,_0x3d1cfb);})[_0x7e38('0x16')](function(_0xf39193){if(_0xf39193){logger['info'](_0x7e38('0x54'),_0xf39193['id']);switch(_0x40a546[_0x7e38('0x3b')]){case'integrationTab':logger[_0x7e38('0xc')](_0x7e38('0x4c'),_0x7e38('0x55'));return request({'uri':util[_0x7e38('0xd')](_0x7e38('0x56'),_0x40a546[_0x7e38('0x1c')],_0x4cbe75['id'],_0xf39193['id']),'method':_0x7e38('0xe')});case _0x7e38('0x57'):logger[_0x7e38('0xc')](_0x7e38('0x4c'),_0x7e38('0x58'));emit(util[_0x7e38('0xd')](_0x7e38('0x59'),_0x38ab0f['name']),_0x7e38('0x5a'),{'uri':util[_0x7e38('0xd')](_0x7e38('0x5b'),_0x40a546['remoteUri'],_0xf39193['id'])});break;default:logger[_0x7e38('0x5c')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x7e38('0x5d')](function(_0x3f0192){logger[_0x7e38('0x5c')](_0x7e38('0x5e'),util['inspect'](_0x3f0192,{'showHidden':!![],'depth':null}));});};exports[_0x7e38('0x5f')]=function(_0x1b2f3a,_0x3d57ac,_0x10a0e8,_0xabe101,_0x498b6d,_0x107ad1,_0x35f0ea){var _0x435b48,_0x1d4a5d;_0x107ad1['remoteUri']=intUtil[_0x7e38('0x49')](_0x107ad1[_0x7e38('0x1c')]);_0x107ad1['serverUrl']=intUtil['stripTrailingSlash'](_0x107ad1[_0x7e38('0x4a')]);if(_0x35f0ea&&_0x35f0ea[_0x7e38('0x60')]&&_0x35f0ea[_0x7e38('0x60')]!=='none'){logger[_0x7e38('0xc')](_0x7e38('0x61'),_0x7e38('0x4d'));_0x3d57ac[_0x7e38('0x4e')]=util[_0x7e38('0xd')](_0x7e38('0x4f'),_0x107ad1[_0x7e38('0x4a')],_0x3d57ac[_0x7e38('0x50')],md5(_0x3d57ac['uniqueid']));}headers[_0x7e38('0x62')]=getAuth(_0x107ad1);return getUser(_0x107ad1,_0xabe101[_0x7e38('0x63')])['then'](function(_0x1823be){_0x435b48=_0x1823be;logger[_0x7e38('0xc')](_0x7e38('0x51'),_0x435b48['id']);return getEndUser(_0x107ad1,_0x3d57ac[_0x7e38('0x64')],_0x3d57ac[_0x7e38('0x65')]);})['then'](function(_0x4c7642){_0x1d4a5d=_0x4c7642;logger['info'](_0x7e38('0x53'),_0x1d4a5d['id']);return getTicket(_0x107ad1,_0x435b48,_0x1d4a5d,_0x10a0e8,_0x3d57ac);})[_0x7e38('0x16')](function(_0x18927a){if(_0x18927a){logger[_0x7e38('0xc')](_0x7e38('0x54'),_0x18927a['id']);switch(_0x107ad1['type']){case'integrationTab':logger[_0x7e38('0xc')](_0x7e38('0x61'),_0x7e38('0x55'));return request({'uri':util[_0x7e38('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x107ad1[_0x7e38('0x1c')],_0x435b48['id'],_0x18927a['id']),'method':_0x7e38('0xe')});case'newTab':logger[_0x7e38('0xc')](_0x7e38('0x61'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7e38('0xd')](_0x7e38('0x59'),_0xabe101[_0x7e38('0x11')]),_0x7e38('0x5a'),{'uri':util[_0x7e38('0xd')](_0x7e38('0x5b'),_0x107ad1[_0x7e38('0x1c')],_0x18927a['id'])});break;default:logger[_0x7e38('0x5c')](_0x7e38('0x61'),_0x7e38('0x66'));}}})[_0x7e38('0x5d')](function(_0x2b91a4){logger['error'](_0x7e38('0x67'),util[_0x7e38('0x68')](_0x2b91a4,{'showHidden':!![],'depth':null}));});};exports[_0x7e38('0x69')]=function(_0x5cb8ee,_0x2d72a6,_0x4fecb1,_0x28a282,_0x1a0521,_0x7ceecd){var _0x355289,_0xb99e0;_0x7ceecd['remoteUri']=intUtil[_0x7e38('0x49')](_0x7ceecd[_0x7e38('0x1c')]);_0x7ceecd[_0x7e38('0x4a')]=intUtil['stripTrailingSlash'](_0x7ceecd['serverUrl']);if(_0x1a0521&&_0x1a0521[_0x7e38('0x4b')]){logger[_0x7e38('0xc')]('[ABANDONED]',_0x7e38('0x4d'));_0x2d72a6[_0x7e38('0x4e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x7ceecd['serverUrl'],_0x2d72a6[_0x7e38('0x50')],md5(_0x2d72a6['uniqueid']));}else{_0x2d72a6[_0x7e38('0x4e')]='';}headers[_0x7e38('0x62')]=getAuth(_0x7ceecd);return getUser(_0x7ceecd)['then'](function(_0x36b11e){_0x355289=_0x36b11e;logger[_0x7e38('0xc')](_0x7e38('0x51'),_0x355289['id']);return getEndUser(_0x7ceecd,_0x2d72a6[_0x7e38('0x6a')],_0x2d72a6[_0x7e38('0x52')]);})[_0x7e38('0x16')](function(_0x11a7c7){_0xb99e0=_0x11a7c7;logger[_0x7e38('0xc')](_0x7e38('0x53'),_0xb99e0['id']);return getTicket(_0x7ceecd,_0x355289,_0xb99e0,_0x4fecb1,_0x2d72a6);})[_0x7e38('0x16')](function(_0x5c0576){if(_0x5c0576){logger['info'](_0x7e38('0x54'),_0x5c0576['id']);}})[_0x7e38('0x5d')](function(_0x2bb23e){logger[_0x7e38('0x5c')](_0x7e38('0x6b'),util[_0x7e38('0x68')](_0x2bb23e,{'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 dbd2199..24848c3 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 _0x3aab=['Rejected','abandoned','Abandoned','talktime','Call\x20Duration','utc','mm:ss','answertime','diff','CONTACTID','LEADID','Leads','SEID','','hasOwnProperty','%s','encodeXML','','POST','authToken','then','parse','toJson','response','result','Call\x20created!','recorddetail','Error\x20on\x20call\x20creation:\x20','GET','host','AllUsers','crmapi','user','find','users','Standard','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','((Phone:%s))','Enduser\x20found\x20in\x20Contacts!','Contacts','row','length','val','content','https://crm.%s/crm/private/json/Leads/searchRecords','Enduser\x20found\x20in\x20Leads!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','[HTTP]','forEach','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','queue','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','catch','[ABANDONED]','serverUrl','lodash','request-promise','md5','./util','entities','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','socket.io-emitter','emit','application/json','info','Creating\x20new\x20call...','inbound','outbound','starttime','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Descriptions','lastevent','called','Call\x20Result','Called','Answered','rejected'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x3aab,0x1d9));var _0xb3aa=function(_0xf90e5b,_0xbe5730){_0xf90e5b=_0xf90e5b-0x0;var _0x48b359=_0x3aab[_0xf90e5b];return _0x48b359;};'use strict';var _=require(_0xb3aa('0x0'));var rp=require(_0xb3aa('0x1'));var md5=require(_0xb3aa('0x2'));var util=require('util');var intUtil=require(_0xb3aa('0x3'));var parser=require('xml2json');var entities=require(_0xb3aa('0x4'));var moment=require(_0xb3aa('0x5'));var Redis=require(_0xb3aa('0x6'));var config=require(_0xb3aa('0x7'));var logger=require(_0xb3aa('0x8'))(_0xb3aa('0x9'));config[_0xb3aa('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb3aa('0xb'))(new Redis(config['redis']));function emit(_0x379f8a,_0x428ef6,_0x294891){io['to'](_0x379f8a)[_0xb3aa('0xc')](_0x428ef6,_0x294891);}var headers={'Content-Type':_0xb3aa('0xd'),'Accept':_0xb3aa('0xd')};function getCall(_0x1de0dd,_0x3f4cae,_0xd7092b,_0x1b8938,_0x4265f4,_0x18dcd9){logger[_0xb3aa('0xe')](_0xb3aa('0xf'));var _0x1eeefa=_['merge']({'SMOWNERID':_0x3f4cae['id'],'Call Type':_0x18dcd9||_0xb3aa('0x10'),'Call Start Time':(_0x18dcd9===_0xb3aa('0x11')?_0x4265f4[_0xb3aa('0x12')]:_0x4265f4[_0xb3aa('0x13')])||moment()[_0xb3aa('0x14')](_0xb3aa('0x15')),'Subject':intUtil[_0xb3aa('0x16')](_0x1b8938[_0xb3aa('0x17')],_0x4265f4,'\x20'),'Description':intUtil[_0xb3aa('0x16')](_0x1b8938[_0xb3aa('0x18')],_0x4265f4,'\x0a')},getCustomFields(_0x1b8938['Fields'],_0x4265f4));switch(_0x4265f4[_0xb3aa('0x19')]){case _0xb3aa('0x1a'):_0x1eeefa[_0xb3aa('0x1b')]=_0xb3aa('0x1c');break;case'complete':case'connect':_0x1eeefa[_0xb3aa('0x1b')]=_0xb3aa('0x1d');break;case _0xb3aa('0x1e'):_0x1eeefa[_0xb3aa('0x1b')]=_0xb3aa('0x1f');break;case _0xb3aa('0x20'):_0x1eeefa[_0xb3aa('0x1b')]=_0xb3aa('0x21');break;default:}if(_0x4265f4[_0xb3aa('0x22')]){_0x1eeefa[_0xb3aa('0x23')]=moment[_0xb3aa('0x24')](parseInt(_0x4265f4['talktime'])*0x3e8)['format'](_0xb3aa('0x25'));}else if(_0x4265f4[_0xb3aa('0x26')]&&_0x4265f4['endtime']){_0x1eeefa[_0xb3aa('0x23')]=moment[_0xb3aa('0x24')](moment(_0x4265f4['endtime'],_0xb3aa('0x15'))[_0xb3aa('0x27')](moment(_0x4265f4[_0xb3aa('0x12')],'YYYY-MM-DD\x20HH:mm:ss')))[_0xb3aa('0x14')](_0xb3aa('0x25'));}if(_0xd7092b['CONTACTID']){_0x1eeefa[_0xb3aa('0x28')]=_0xd7092b[_0xb3aa('0x28')];}else if(_0xd7092b[_0xb3aa('0x29')]){_0x1eeefa['SEMODULE']=_0xb3aa('0x2a');_0x1eeefa[_0xb3aa('0x2b')]=_0xd7092b['LEADID'];}var _0x22d5ea=_0xb3aa('0x2c');for(var _0x1b6bf4 in _0x1eeefa){if(_0x1eeefa[_0xb3aa('0x2d')](_0x1b6bf4)){_0x22d5ea+=util[_0xb3aa('0x14')](_0xb3aa('0x2e'),entities['encodeXML'](_0x1b6bf4),entities[_0xb3aa('0x2f')](_0x1eeefa[_0x1b6bf4]));}}_0x22d5ea+=_0xb3aa('0x30');return request({'method':_0xb3aa('0x31'),'uri':util[_0xb3aa('0x14')]('https://crm.%s/crm/private/xml/Calls/insertRecords',_0x1de0dd['host']),'qs':{'authtoken':_0x1de0dd[_0xb3aa('0x32')],'scope':'crmapi','xmlData':_0x22d5ea},'json':!![]})[_0xb3aa('0x33')](function(_0x2ba944){_0x2ba944=JSON[_0xb3aa('0x34')](parser[_0xb3aa('0x35')](_0x2ba944));if(_0x2ba944[_0xb3aa('0x36')]){if(_0x2ba944[_0xb3aa('0x36')]['result']&&_0x2ba944[_0xb3aa('0x36')][_0xb3aa('0x37')]['recorddetail']){logger[_0xb3aa('0xe')](_0xb3aa('0x38'));return{'id':_0x2ba944[_0xb3aa('0x36')][_0xb3aa('0x37')][_0xb3aa('0x39')]['FL'][0x0]['$t']};}}throw new Error(_0xb3aa('0x3a')+JSON['stringify'](_0x2ba944));});}function getUser(_0x3a20e5,_0xfc0a55){return request({'method':_0xb3aa('0x3b'),'uri':util[_0xb3aa('0x14')]('https://crm.%s/crm/private/json/Users/getUsers',_0x3a20e5[_0xb3aa('0x3c')]),'qs':{'type':_0xb3aa('0x3d'),'authtoken':_0x3a20e5[_0xb3aa('0x32')],'scope':_0xb3aa('0x3e')},'json':!![]})['then'](function(_0x2efdc7){if(_0x2efdc7['users']&&_0x2efdc7['users'][_0xb3aa('0x3f')]){var _0xb273a1;if(_0xfc0a55){_0xb273a1=_[_0xb3aa('0x40')](_0x2efdc7[_0xb3aa('0x41')][_0xb3aa('0x3f')],{'email':_0xfc0a55,'profile':_0xb3aa('0x42')});}if(_0xb273a1){logger['info'](_0xb3aa('0x43'));}else{logger['info'](_0xb3aa('0x44'));_0xb273a1=_[_0xb3aa('0x40')](_0x2efdc7['users'][_0xb3aa('0x3f')],{'profile':_0xb3aa('0x45')});}return _0xb273a1;}else{logger['error'](_0xb3aa('0x46'),JSON[_0xb3aa('0x47')](_0x2efdc7));throw new Error(_0xb3aa('0x48')+JSON[_0xb3aa('0x47')](_0x2efdc7));}});}function getEndUser(_0x51d6d0,_0x51b3c7,_0x3af0a1){logger['info'](_0xb3aa('0x49'),_0x3af0a1);return request({'method':_0xb3aa('0x3b'),'uri':util[_0xb3aa('0x14')](_0xb3aa('0x4a'),_0x51d6d0['host']),'qs':{'authtoken':_0x51d6d0[_0xb3aa('0x32')],'scope':_0xb3aa('0x3e'),'criteria':util[_0xb3aa('0x14')](_0xb3aa('0x4b'),_0x3af0a1)},'json':!![]})[_0xb3aa('0x33')](function(_0x2797bb){if(_0x2797bb[_0xb3aa('0x36')]&&_0x2797bb['response'][_0xb3aa('0x37')]){logger[_0xb3aa('0xe')](_0xb3aa('0x4c'));var _0x70e18e={};var _0x4d4646=_0x2797bb[_0xb3aa('0x36')]['result'][_0xb3aa('0x4d')][_0xb3aa('0x4e')]['no']?_0x2797bb[_0xb3aa('0x36')][_0xb3aa('0x37')][_0xb3aa('0x4d')]['row']['FL']:_0x2797bb[_0xb3aa('0x36')][_0xb3aa('0x37')][_0xb3aa('0x4d')][_0xb3aa('0x4e')][0x0]['FL'];for(var _0x5350a3=0x0,_0x127d4f=_0x4d4646[_0xb3aa('0x4f')];_0x5350a3<_0x127d4f;_0x5350a3++){_0x70e18e[_0x4d4646[_0x5350a3][_0xb3aa('0x50')]]=_0x4d4646[_0x5350a3][_0xb3aa('0x51')];}return _0x70e18e;}else{return request({'method':_0xb3aa('0x3b'),'uri':util['format'](_0xb3aa('0x52'),_0x51d6d0['host']),'qs':{'authtoken':_0x51d6d0['authToken'],'scope':_0xb3aa('0x3e'),'criteria':util['format'](_0xb3aa('0x4b'),_0x3af0a1)},'json':!![]})['then'](function(_0x21708a){if(_0x21708a[_0xb3aa('0x36')]&&_0x21708a[_0xb3aa('0x36')][_0xb3aa('0x37')]){logger[_0xb3aa('0xe')](_0xb3aa('0x53'));var _0x3bdb10={};var _0x6f2a5a=_0x21708a[_0xb3aa('0x36')][_0xb3aa('0x37')][_0xb3aa('0x2a')][_0xb3aa('0x4e')]['no']?_0x21708a['response'][_0xb3aa('0x37')][_0xb3aa('0x2a')][_0xb3aa('0x4e')]['FL']:_0x21708a[_0xb3aa('0x36')]['result'][_0xb3aa('0x2a')]['row'][0x0]['FL'];for(var _0x49401e=0x0,_0x46bdb3=_0x6f2a5a[_0xb3aa('0x4f')];_0x49401e<_0x46bdb3;_0x49401e++){_0x3bdb10[_0x6f2a5a[_0x49401e][_0xb3aa('0x50')]]=_0x6f2a5a[_0x49401e][_0xb3aa('0x51')];}return _0x3bdb10;}else{logger[_0xb3aa('0xe')](_0xb3aa('0x54'));_0x51b3c7=getName(_0x51b3c7);return request({'method':_0xb3aa('0x31'),'uri':util[_0xb3aa('0x14')](_0xb3aa('0x55'),_0x51d6d0[_0xb3aa('0x3c')]),'qs':{'authtoken':_0x51d6d0[_0xb3aa('0x32')],'scope':_0xb3aa('0x3e'),'xmlData':util[_0xb3aa('0x14')]('%s%s%s',entities[_0xb3aa('0x2f')](_0x51b3c7[0x0]),entities['encodeXML'](_0x51b3c7[0x1]),_0x3af0a1)},'json':!![]})[_0xb3aa('0x33')](function(_0x233185){_0x233185=JSON[_0xb3aa('0x34')](parser['toJson'](_0x233185));if(_0x233185['response']){if(_0x233185[_0xb3aa('0x36')][_0xb3aa('0x37')]&&_0x233185[_0xb3aa('0x36')]['result']['recorddetail']){logger[_0xb3aa('0xe')]('Enduser\x20created.');return request({'method':_0xb3aa('0x3b'),'uri':util[_0xb3aa('0x14')](_0xb3aa('0x56'),_0x51d6d0[_0xb3aa('0x3c')]),'qs':{'authtoken':_0x51d6d0[_0xb3aa('0x32')],'scope':_0xb3aa('0x3e'),'id':_0x233185['response']['result'][_0xb3aa('0x39')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0xb3aa('0x57')+JSON[_0xb3aa('0x47')](_0x233185));})['then'](function(_0x230eab){if(_0x230eab[_0xb3aa('0x36')]){if(_0x230eab['response'][_0xb3aa('0x37')]){var _0x31b4fc={};for(var _0x15a6fd=0x0,_0x28cb08=_0x230eab['response'][_0xb3aa('0x37')]['Leads'][_0xb3aa('0x4e')]['FL'][_0xb3aa('0x4f')];_0x15a6fd<_0x28cb08;_0x15a6fd++){_0x31b4fc[_0x230eab[_0xb3aa('0x36')][_0xb3aa('0x37')][_0xb3aa('0x2a')][_0xb3aa('0x4e')]['FL'][_0x15a6fd]['val']]=_0x230eab[_0xb3aa('0x36')][_0xb3aa('0x37')][_0xb3aa('0x2a')][_0xb3aa('0x4e')]['FL'][_0x15a6fd]['content'];}return _0x31b4fc;}}throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON[_0xb3aa('0x47')](_0x230eab));});}});}});}function request(_0x59315a){logger['debug'](_0xb3aa('0x58'),JSON['stringify'](_0x59315a));return rp(_0x59315a);}function getCustomFields(_0x570c6c,_0x3728b3){var _0x389cfb={};if(_0x570c6c[_0xb3aa('0x4f')]>0x0){_[_0xb3aa('0x59')](_0x570c6c,function(_0x425afd){if(_0x425afd[_0xb3aa('0x5a')]==='string'&&_0x425afd[_0xb3aa('0x5b')]){_0x389cfb[_0x425afd['idField']]=_0x425afd[_0xb3aa('0x51')][_0xb3aa('0x5c')]();}else if(_0x425afd[_0xb3aa('0x5a')]===_0xb3aa('0x5d')&&_0x425afd['variableName']&&_0x425afd[_0xb3aa('0x5b')]&&_0x3728b3[_0x425afd['variableName']]){_0x389cfb[_0x425afd[_0xb3aa('0x5b')]]=_0x3728b3[_0x425afd[_0xb3aa('0x5e')]][_0xb3aa('0x5c')]();}else if(_0x425afd[_0xb3aa('0x5a')]===_0xb3aa('0x5f')&&_0x425afd[_0xb3aa('0x60')]&&_0x425afd[_0xb3aa('0x60')][_0xb3aa('0x61')]&&_0x425afd[_0xb3aa('0x5b')]&&_0x3728b3[_0x425afd[_0xb3aa('0x60')]['name']['toLowerCase']()]){_0x389cfb[_0x425afd[_0xb3aa('0x5b')]]=_0x3728b3[_0x425afd[_0xb3aa('0x60')]['name'][_0xb3aa('0x62')]()][_0xb3aa('0x5c')]();}});}return _0x389cfb;}function getName(_0x5f30e4){if(_0x5f30e4['indexOf']('\x20')>0x0){var _0x484325=_0x5f30e4['split'](/ (.+)/);if(_0x484325[0x1]){return _0x484325;}}return[_0x5f30e4,_0x5f30e4];}exports[_0xb3aa('0x63')]=function(_0x42a3d7,_0x441f2c,_0x126b0e,_0xafe746,_0x1ceca8,_0x136f7c){var _0x2be4ef,_0x5d2657;if(_0x1ceca8&&_0x1ceca8[_0xb3aa('0x64')]){logger[_0xb3aa('0xe')]('[QUEUE]',_0xb3aa('0x65'));_0x441f2c[_0xb3aa('0x66')]=util[_0xb3aa('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x136f7c['serverUrl'],_0x441f2c[_0xb3aa('0x67')],md5(_0x441f2c[_0xb3aa('0x67')]));}else{_0x441f2c['recordingURL']='';}return getUser(_0x136f7c,_0xafe746[_0xb3aa('0x68')])[_0xb3aa('0x33')](function(_0x7374ef){_0x2be4ef=_0x7374ef;logger[_0xb3aa('0xe')](_0xb3aa('0x69'),_0x2be4ef['id']);return getEndUser(_0x136f7c,_0x441f2c[_0xb3aa('0x6a')],_0x441f2c[_0xb3aa('0x6b')]);})[_0xb3aa('0x33')](function(_0x2e569f){_0x5d2657=_0x2e569f;logger[_0xb3aa('0xe')](_0xb3aa('0x6c'),_0x5d2657[_0xb3aa('0x28')]||_0x5d2657[_0xb3aa('0x29')]);return getCall(_0x136f7c,_0x2be4ef,_0x5d2657,_0x126b0e,_0x441f2c,_0xb3aa('0x6d'));})[_0xb3aa('0x33')](function(_0x55ef89){if(_0x55ef89){logger['info'](_0xb3aa('0x6e'),_0x55ef89['id']);logger[_0xb3aa('0xe')](_0xb3aa('0x6f'),_0xb3aa('0x70'));emit(util['format'](_0xb3aa('0x71'),_0xafe746[_0xb3aa('0x61')]),'trigger:browser:url',{'uri':util[_0xb3aa('0x14')](_0xb3aa('0x72'),_0x136f7c[_0xb3aa('0x3c')],_0x55ef89['id'])});}})['catch'](function(_0x3dab77){logger[_0xb3aa('0x73')](_0xb3aa('0x6f'),JSON['stringify'](_0x3dab77));});};exports[_0xb3aa('0x11')]=function(_0x46229f,_0x75c98f,_0x24b84f,_0x309a26,_0x56fd68,_0xa6fbd5,_0x217b69){var _0x171f73,_0x3cf2f7;if(_0x217b69&&_0x217b69[_0xb3aa('0x74')]&&_0x217b69[_0xb3aa('0x74')]!==_0xb3aa('0x75')){logger[_0xb3aa('0xe')](_0xb3aa('0x76'),'Recording\x20is\x20enabled!');_0x75c98f[_0xb3aa('0x66')]=util[_0xb3aa('0x14')](_0xb3aa('0x77'),_0xa6fbd5['serverUrl'],_0x75c98f[_0xb3aa('0x67')],md5(_0x75c98f['uniqueid']));}return getUser(_0xa6fbd5,_0x309a26[_0xb3aa('0x68')])[_0xb3aa('0x33')](function(_0x311190){_0x171f73=_0x311190;logger[_0xb3aa('0xe')](_0xb3aa('0x69'),_0x171f73['id']);return getEndUser(_0xa6fbd5,_0x75c98f[_0xb3aa('0x78')],_0x75c98f[_0xb3aa('0x79')]);})[_0xb3aa('0x33')](function(_0x2a50e1){_0x3cf2f7=_0x2a50e1;logger['info'](_0xb3aa('0x6c'),_0x3cf2f7[_0xb3aa('0x28')]||_0x3cf2f7[_0xb3aa('0x29')]);return getCall(_0xa6fbd5,_0x171f73,_0x3cf2f7,_0x24b84f,_0x75c98f,_0xb3aa('0x7a'));})[_0xb3aa('0x33')](function(_0x494bbb){if(_0x494bbb){logger['info'](_0xb3aa('0x6e'),_0x494bbb['id']);logger[_0xb3aa('0xe')](_0xb3aa('0x76'),_0xb3aa('0x70'));emit(util[_0xb3aa('0x14')](_0xb3aa('0x71'),_0x309a26[_0xb3aa('0x61')]),'trigger:browser:url',{'uri':util[_0xb3aa('0x14')](_0xb3aa('0x72'),_0xa6fbd5[_0xb3aa('0x3c')],_0x494bbb['id'])});}})[_0xb3aa('0x7b')](function(_0x484d9e){logger[_0xb3aa('0x73')](_0xb3aa('0x76'),JSON[_0xb3aa('0x47')](_0x484d9e));});};exports[_0xb3aa('0x20')]=function(_0x57a797,_0x5a2602,_0x1056ae,_0x2ebeed,_0x887d3e,_0x1459f6){var _0x4df68a,_0x339788;if(_0x887d3e&&_0x887d3e[_0xb3aa('0x64')]){logger[_0xb3aa('0xe')](_0xb3aa('0x7c'),'Recording\x20is\x20enabled!');_0x5a2602['recordingURL']=util[_0xb3aa('0x14')](_0xb3aa('0x77'),_0x1459f6[_0xb3aa('0x7d')],_0x5a2602[_0xb3aa('0x67')],md5(_0x5a2602[_0xb3aa('0x67')]));}else{_0x5a2602[_0xb3aa('0x66')]='';}return getUser(_0x1459f6)['then'](function(_0x51964d){_0x4df68a=_0x51964d;logger[_0xb3aa('0xe')](_0xb3aa('0x69'),_0x4df68a['id']);return getEndUser(_0x1459f6,_0x5a2602['calleridname'],_0x5a2602[_0xb3aa('0x6b')]);})['then'](function(_0x5e5c59){_0x339788=_0x5e5c59;logger[_0xb3aa('0xe')](_0xb3aa('0x6c'),_0x339788['CONTACTID']||_0x339788['LEADID']);return getCall(_0x1459f6,_0x4df68a,_0x339788,_0x1056ae,_0x5a2602,_0xb3aa('0x6d'));})[_0xb3aa('0x33')](function(_0x5af1e4){if(_0x5af1e4){logger[_0xb3aa('0xe')](_0xb3aa('0x6e'),_0x5af1e4['id']);}})[_0xb3aa('0x7b')](function(_0x197240){logger[_0xb3aa('0x73')]('[ABANDONED]',JSON['stringify'](_0x197240));});}; \ No newline at end of file +var _0x2023=['lodash','md5','util','./util','entities','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20call...','inbound','outbound','starttime','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Descriptions','Fields','lastevent','called','Called','complete','Call\x20Result','Rejected','Abandoned','Call\x20Duration','utc','talktime','mm:ss','answertime','endtime','diff','CONTACTID','LEADID','SEMODULE','Leads','','hasOwnProperty','%s','encodeXML','','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','host','crmapi','then','parse','toJson','response','result','recorddetail','info','Call\x20created!','Error\x20on\x20call\x20creation:\x20','stringify','GET','https://crm.%s/crm/private/json/Users/getUsers','authToken','users','user','Standard','Agent\x20found!','Using\x20the\x20admin\x20account!','find','Administrator','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','((Phone:%s))','Enduser\x20found\x20in\x20Contacts!','Contacts','row','val','https://crm.%s/crm/private/json/Leads/searchRecords','Enduser\x20found\x20in\x20Leads!','content','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s%s%s','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','length','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','type','idField','toString','variable','variableName','customVariable','Variable','name','indexOf','split','queue','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','abandoned','serverUrl'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0x2023,0x17d));var _0x3202=function(_0x2349c1,_0x47eeca){_0x2349c1=_0x2349c1-0x0;var _0x4be62f=_0x2023[_0x2349c1];return _0x4be62f;};'use strict';var _=require(_0x3202('0x0'));var rp=require('request-promise');var md5=require(_0x3202('0x1'));var util=require(_0x3202('0x2'));var intUtil=require(_0x3202('0x3'));var parser=require('xml2json');var entities=require(_0x3202('0x4'));var moment=require('moment');var Redis=require(_0x3202('0x5'));var config=require(_0x3202('0x6'));var logger=require(_0x3202('0x7'))(_0x3202('0x8'));config[_0x3202('0x9')]=_['defaults'](config[_0x3202('0x9')],{'host':_0x3202('0xa'),'port':0x18eb});var io=require(_0x3202('0xb'))(new Redis(config[_0x3202('0x9')]));function emit(_0x2954ba,_0x258118,_0x5a6629){io['to'](_0x2954ba)[_0x3202('0xc')](_0x258118,_0x5a6629);}var headers={'Content-Type':_0x3202('0xd'),'Accept':_0x3202('0xd')};function getCall(_0x22a3c4,_0x18969c,_0x1bc187,_0x1e66a6,_0x4f840a,_0x523601){logger['info'](_0x3202('0xe'));var _0x1e65d8=_['merge']({'SMOWNERID':_0x18969c['id'],'Call Type':_0x523601||_0x3202('0xf'),'Call Start Time':(_0x523601===_0x3202('0x10')?_0x4f840a[_0x3202('0x11')]:_0x4f840a[_0x3202('0x12')])||moment()[_0x3202('0x13')](_0x3202('0x14')),'Subject':intUtil[_0x3202('0x15')](_0x1e66a6[_0x3202('0x16')],_0x4f840a,'\x20'),'Description':intUtil[_0x3202('0x15')](_0x1e66a6[_0x3202('0x17')],_0x4f840a,'\x0a')},getCustomFields(_0x1e66a6[_0x3202('0x18')],_0x4f840a));switch(_0x4f840a[_0x3202('0x19')]){case _0x3202('0x1a'):_0x1e65d8['Call\x20Result']=_0x3202('0x1b');break;case _0x3202('0x1c'):case'connect':_0x1e65d8[_0x3202('0x1d')]='Answered';break;case'rejected':_0x1e65d8[_0x3202('0x1d')]=_0x3202('0x1e');break;case'abandoned':_0x1e65d8[_0x3202('0x1d')]=_0x3202('0x1f');break;default:}if(_0x4f840a['talktime']){_0x1e65d8[_0x3202('0x20')]=moment[_0x3202('0x21')](parseInt(_0x4f840a[_0x3202('0x22')])*0x3e8)[_0x3202('0x13')](_0x3202('0x23'));}else if(_0x4f840a[_0x3202('0x24')]&&_0x4f840a['endtime']){_0x1e65d8['Call\x20Duration']=moment[_0x3202('0x21')](moment(_0x4f840a[_0x3202('0x25')],_0x3202('0x14'))[_0x3202('0x26')](moment(_0x4f840a['starttime'],'YYYY-MM-DD\x20HH:mm:ss')))[_0x3202('0x13')](_0x3202('0x23'));}if(_0x1bc187[_0x3202('0x27')]){_0x1e65d8[_0x3202('0x27')]=_0x1bc187[_0x3202('0x27')];}else if(_0x1bc187[_0x3202('0x28')]){_0x1e65d8[_0x3202('0x29')]=_0x3202('0x2a');_0x1e65d8['SEID']=_0x1bc187[_0x3202('0x28')];}var _0x1400bd=_0x3202('0x2b');for(var _0xa92505 in _0x1e65d8){if(_0x1e65d8[_0x3202('0x2c')](_0xa92505)){_0x1400bd+=util[_0x3202('0x13')](_0x3202('0x2d'),entities[_0x3202('0x2e')](_0xa92505),entities[_0x3202('0x2e')](_0x1e65d8[_0xa92505]));}}_0x1400bd+=_0x3202('0x2f');return request({'method':_0x3202('0x30'),'uri':util['format'](_0x3202('0x31'),_0x22a3c4[_0x3202('0x32')]),'qs':{'authtoken':_0x22a3c4['authToken'],'scope':_0x3202('0x33'),'xmlData':_0x1400bd},'json':!![]})[_0x3202('0x34')](function(_0x251972){_0x251972=JSON[_0x3202('0x35')](parser[_0x3202('0x36')](_0x251972));if(_0x251972[_0x3202('0x37')]){if(_0x251972[_0x3202('0x37')][_0x3202('0x38')]&&_0x251972[_0x3202('0x37')][_0x3202('0x38')][_0x3202('0x39')]){logger[_0x3202('0x3a')](_0x3202('0x3b'));return{'id':_0x251972['response'][_0x3202('0x38')][_0x3202('0x39')]['FL'][0x0]['$t']};}}throw new Error(_0x3202('0x3c')+JSON[_0x3202('0x3d')](_0x251972));});}function getUser(_0x15baf3,_0x325b2d){return request({'method':_0x3202('0x3e'),'uri':util[_0x3202('0x13')](_0x3202('0x3f'),_0x15baf3['host']),'qs':{'type':'AllUsers','authtoken':_0x15baf3[_0x3202('0x40')],'scope':_0x3202('0x33')},'json':!![]})[_0x3202('0x34')](function(_0x58fab6){if(_0x58fab6['users']&&_0x58fab6[_0x3202('0x41')]['user']){var _0x297ad7;if(_0x325b2d){_0x297ad7=_['find'](_0x58fab6[_0x3202('0x41')][_0x3202('0x42')],{'email':_0x325b2d,'profile':_0x3202('0x43')});}if(_0x297ad7){logger[_0x3202('0x3a')](_0x3202('0x44'));}else{logger[_0x3202('0x3a')](_0x3202('0x45'));_0x297ad7=_[_0x3202('0x46')](_0x58fab6[_0x3202('0x41')][_0x3202('0x42')],{'profile':_0x3202('0x47')});}return _0x297ad7;}else{logger[_0x3202('0x48')](_0x3202('0x49'),JSON['stringify'](_0x58fab6));throw new Error(_0x3202('0x4a')+JSON['stringify'](_0x58fab6));}});}function getEndUser(_0x502454,_0x377c85,_0xcbd4d9){logger['info']('Searching\x20enduser\x20with\x20phone',_0xcbd4d9);return request({'method':_0x3202('0x3e'),'uri':util['format']('https://crm.%s/crm/private/json/Contacts/searchRecords',_0x502454[_0x3202('0x32')]),'qs':{'authtoken':_0x502454[_0x3202('0x40')],'scope':'crmapi','criteria':util[_0x3202('0x13')](_0x3202('0x4b'),_0xcbd4d9)},'json':!![]})[_0x3202('0x34')](function(_0x5078ee){if(_0x5078ee['response']&&_0x5078ee[_0x3202('0x37')][_0x3202('0x38')]){logger[_0x3202('0x3a')](_0x3202('0x4c'));var _0x51ad60={};var _0x12e575=_0x5078ee[_0x3202('0x37')][_0x3202('0x38')][_0x3202('0x4d')][_0x3202('0x4e')]['no']?_0x5078ee[_0x3202('0x37')][_0x3202('0x38')][_0x3202('0x4d')]['row']['FL']:_0x5078ee['response']['result'][_0x3202('0x4d')][_0x3202('0x4e')][0x0]['FL'];for(var _0x2b0a93=0x0,_0x3cd2bf=_0x12e575['length'];_0x2b0a93<_0x3cd2bf;_0x2b0a93++){_0x51ad60[_0x12e575[_0x2b0a93][_0x3202('0x4f')]]=_0x12e575[_0x2b0a93]['content'];}return _0x51ad60;}else{return request({'method':_0x3202('0x3e'),'uri':util[_0x3202('0x13')](_0x3202('0x50'),_0x502454['host']),'qs':{'authtoken':_0x502454[_0x3202('0x40')],'scope':'crmapi','criteria':util[_0x3202('0x13')](_0x3202('0x4b'),_0xcbd4d9)},'json':!![]})[_0x3202('0x34')](function(_0x5348b5){if(_0x5348b5[_0x3202('0x37')]&&_0x5348b5[_0x3202('0x37')][_0x3202('0x38')]){logger[_0x3202('0x3a')](_0x3202('0x51'));var _0x1bc535={};var _0x139884=_0x5348b5[_0x3202('0x37')][_0x3202('0x38')]['Leads'][_0x3202('0x4e')]['no']?_0x5348b5[_0x3202('0x37')][_0x3202('0x38')][_0x3202('0x2a')][_0x3202('0x4e')]['FL']:_0x5348b5[_0x3202('0x37')][_0x3202('0x38')][_0x3202('0x2a')][_0x3202('0x4e')][0x0]['FL'];for(var _0x26f8f0=0x0,_0x29d85c=_0x139884['length'];_0x26f8f0<_0x29d85c;_0x26f8f0++){_0x1bc535[_0x139884[_0x26f8f0][_0x3202('0x4f')]]=_0x139884[_0x26f8f0][_0x3202('0x52')];}return _0x1bc535;}else{logger[_0x3202('0x3a')](_0x3202('0x53'));_0x377c85=getName(_0x377c85);return request({'method':'POST','uri':util[_0x3202('0x13')]('https://crm.%s/crm/private/xml/Leads/insertRecords',_0x502454[_0x3202('0x32')]),'qs':{'authtoken':_0x502454[_0x3202('0x40')],'scope':'crmapi','xmlData':util[_0x3202('0x13')](_0x3202('0x54'),entities[_0x3202('0x2e')](_0x377c85[0x0]),entities[_0x3202('0x2e')](_0x377c85[0x1]),_0xcbd4d9)},'json':!![]})[_0x3202('0x34')](function(_0x5f1599){_0x5f1599=JSON[_0x3202('0x35')](parser['toJson'](_0x5f1599));if(_0x5f1599[_0x3202('0x37')]){if(_0x5f1599[_0x3202('0x37')][_0x3202('0x38')]&&_0x5f1599[_0x3202('0x37')][_0x3202('0x38')][_0x3202('0x39')]){logger['info']('Enduser\x20created.');return request({'method':_0x3202('0x3e'),'uri':util[_0x3202('0x13')](_0x3202('0x55'),_0x502454['host']),'qs':{'authtoken':_0x502454['authToken'],'scope':'crmapi','id':_0x5f1599[_0x3202('0x37')][_0x3202('0x38')][_0x3202('0x39')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0x3202('0x56')+JSON['stringify'](_0x5f1599));})[_0x3202('0x34')](function(_0x2d8060){if(_0x2d8060[_0x3202('0x37')]){if(_0x2d8060[_0x3202('0x37')][_0x3202('0x38')]){var _0x38e3dd={};for(var _0x2da164=0x0,_0x4bf53b=_0x2d8060[_0x3202('0x37')][_0x3202('0x38')][_0x3202('0x2a')][_0x3202('0x4e')]['FL'][_0x3202('0x57')];_0x2da164<_0x4bf53b;_0x2da164++){_0x38e3dd[_0x2d8060[_0x3202('0x37')][_0x3202('0x38')][_0x3202('0x2a')][_0x3202('0x4e')]['FL'][_0x2da164][_0x3202('0x4f')]]=_0x2d8060['response'][_0x3202('0x38')][_0x3202('0x2a')]['row']['FL'][_0x2da164][_0x3202('0x52')];}return _0x38e3dd;}}throw new Error(_0x3202('0x58')+JSON[_0x3202('0x3d')](_0x2d8060));});}});}});}function request(_0x5923c7){logger[_0x3202('0x59')](_0x3202('0x5a'),JSON[_0x3202('0x3d')](_0x5923c7));return rp(_0x5923c7);}function getCustomFields(_0x5f06c2,_0x3c62eb){var _0x3fdf2e={};if(_0x5f06c2[_0x3202('0x57')]>0x0){_['forEach'](_0x5f06c2,function(_0xff0953){if(_0xff0953[_0x3202('0x5b')]==='string'&&_0xff0953[_0x3202('0x5c')]){_0x3fdf2e[_0xff0953[_0x3202('0x5c')]]=_0xff0953[_0x3202('0x52')][_0x3202('0x5d')]();}else if(_0xff0953[_0x3202('0x5b')]===_0x3202('0x5e')&&_0xff0953[_0x3202('0x5f')]&&_0xff0953[_0x3202('0x5c')]&&_0x3c62eb[_0xff0953[_0x3202('0x5f')]]){_0x3fdf2e[_0xff0953[_0x3202('0x5c')]]=_0x3c62eb[_0xff0953[_0x3202('0x5f')]][_0x3202('0x5d')]();}else if(_0xff0953[_0x3202('0x5b')]===_0x3202('0x60')&&_0xff0953['Variable']&&_0xff0953[_0x3202('0x61')][_0x3202('0x62')]&&_0xff0953['idField']&&_0x3c62eb[_0xff0953['Variable'][_0x3202('0x62')]['toLowerCase']()]){_0x3fdf2e[_0xff0953[_0x3202('0x5c')]]=_0x3c62eb[_0xff0953[_0x3202('0x61')][_0x3202('0x62')]['toLowerCase']()][_0x3202('0x5d')]();}});}return _0x3fdf2e;}function getName(_0x179aa2){if(_0x179aa2[_0x3202('0x63')]('\x20')>0x0){var _0x598b0e=_0x179aa2[_0x3202('0x64')](/ (.+)/);if(_0x598b0e[0x1]){return _0x598b0e;}}return[_0x179aa2,_0x179aa2];}exports[_0x3202('0x65')]=function(_0x28a05e,_0xfd278a,_0x5af265,_0x5ca9ed,_0x2602fb,_0x48d77d){var _0x483a54,_0x5c50fe;if(_0x2602fb&&_0x2602fb[_0x3202('0x66')]){logger['info'](_0x3202('0x67'),_0x3202('0x68'));_0xfd278a['recordingURL']=util['format'](_0x3202('0x69'),_0x48d77d['serverUrl'],_0xfd278a[_0x3202('0x6a')],md5(_0xfd278a[_0x3202('0x6a')]));}else{_0xfd278a[_0x3202('0x6b')]='';}return getUser(_0x48d77d,_0x5ca9ed[_0x3202('0x6c')])['then'](function(_0x1bec90){_0x483a54=_0x1bec90;logger[_0x3202('0x3a')]('The\x20User\x20ID\x20is:',_0x483a54['id']);return getEndUser(_0x48d77d,_0xfd278a[_0x3202('0x6d')],_0xfd278a[_0x3202('0x6e')]);})[_0x3202('0x34')](function(_0x1e2301){_0x5c50fe=_0x1e2301;logger['info'](_0x3202('0x6f'),_0x5c50fe[_0x3202('0x27')]||_0x5c50fe[_0x3202('0x28')]);return getCall(_0x48d77d,_0x483a54,_0x5c50fe,_0x5af265,_0xfd278a,_0x3202('0x70'));})[_0x3202('0x34')](function(_0x4d31d9){if(_0x4d31d9){logger[_0x3202('0x3a')](_0x3202('0x71'),_0x4d31d9['id']);logger[_0x3202('0x3a')](_0x3202('0x67'),_0x3202('0x72'));emit(util['format'](_0x3202('0x73'),_0x5ca9ed[_0x3202('0x62')]),_0x3202('0x74'),{'uri':util['format']('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x48d77d[_0x3202('0x32')],_0x4d31d9['id'])});}})[_0x3202('0x75')](function(_0xd2db4d){logger[_0x3202('0x48')](_0x3202('0x67'),JSON['stringify'](_0xd2db4d));});};exports[_0x3202('0x10')]=function(_0x523f2d,_0x174376,_0x1c07cc,_0x1db47b,_0x24e3da,_0x1d400b,_0x521903){var _0x12f2c0,_0x4fa721;if(_0x521903&&_0x521903[_0x3202('0x76')]&&_0x521903['recordingFormat']!==_0x3202('0x77')){logger[_0x3202('0x3a')](_0x3202('0x78'),'Recording\x20is\x20enabled!');_0x174376[_0x3202('0x6b')]=util[_0x3202('0x13')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1d400b['serverUrl'],_0x174376[_0x3202('0x6a')],md5(_0x174376[_0x3202('0x6a')]));}return getUser(_0x1d400b,_0x1db47b[_0x3202('0x6c')])[_0x3202('0x34')](function(_0x3456bc){_0x12f2c0=_0x3456bc;logger[_0x3202('0x3a')](_0x3202('0x79'),_0x12f2c0['id']);return getEndUser(_0x1d400b,_0x174376[_0x3202('0x7a')],_0x174376[_0x3202('0x7b')]);})[_0x3202('0x34')](function(_0x329d77){_0x4fa721=_0x329d77;logger[_0x3202('0x3a')](_0x3202('0x6f'),_0x4fa721['CONTACTID']||_0x4fa721[_0x3202('0x28')]);return getCall(_0x1d400b,_0x12f2c0,_0x4fa721,_0x1c07cc,_0x174376,_0x3202('0x7c'));})[_0x3202('0x34')](function(_0x1ee12f){if(_0x1ee12f){logger[_0x3202('0x3a')](_0x3202('0x71'),_0x1ee12f['id']);logger[_0x3202('0x3a')](_0x3202('0x78'),_0x3202('0x72'));emit(util[_0x3202('0x13')](_0x3202('0x73'),_0x1db47b[_0x3202('0x62')]),_0x3202('0x74'),{'uri':util[_0x3202('0x13')]('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x1d400b[_0x3202('0x32')],_0x1ee12f['id'])});}})[_0x3202('0x75')](function(_0x270a08){logger['error'](_0x3202('0x78'),JSON[_0x3202('0x3d')](_0x270a08));});};exports[_0x3202('0x7d')]=function(_0x4e730d,_0xeffc66,_0x421729,_0x21b054,_0x5accfa,_0x564f30){var _0x2007e5,_0x379b73;if(_0x5accfa&&_0x5accfa['monitor_format']){logger[_0x3202('0x3a')]('[ABANDONED]',_0x3202('0x68'));_0xeffc66[_0x3202('0x6b')]=util[_0x3202('0x13')](_0x3202('0x69'),_0x564f30[_0x3202('0x7e')],_0xeffc66[_0x3202('0x6a')],md5(_0xeffc66[_0x3202('0x6a')]));}else{_0xeffc66[_0x3202('0x6b')]='';}return getUser(_0x564f30)[_0x3202('0x34')](function(_0x2608f2){_0x2007e5=_0x2608f2;logger[_0x3202('0x3a')](_0x3202('0x79'),_0x2007e5['id']);return getEndUser(_0x564f30,_0xeffc66['calleridname'],_0xeffc66[_0x3202('0x6e')]);})[_0x3202('0x34')](function(_0x242cf5){_0x379b73=_0x242cf5;logger['info'](_0x3202('0x6f'),_0x379b73['CONTACTID']||_0x379b73[_0x3202('0x28')]);return getCall(_0x564f30,_0x2007e5,_0x379b73,_0x421729,_0xeffc66,_0x3202('0x70'));})[_0x3202('0x34')](function(_0x3c3b60){if(_0x3c3b60){logger[_0x3202('0x3a')](_0x3202('0x71'),_0x3c3b60['id']);}})[_0x3202('0x75')](function(_0x1acc0a){logger[_0x3202('0x48')]('[ABANDONED]',JSON['stringify'](_0x1acc0a));});}; \ 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 a6d7cb2..e30c0c8 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 _0x8db0=['render','data2','GET','POST','then','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20body:\x20%s','catch','error','%s\x20%s\x20%s\x20[%s]:%s','statusCode','message','util','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8db0,0x116));var _0x08db=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0x8db0[_0xea343d];return _0x2c6e9c;};'use strict';var rp=require('request-promise');var util=require(_0x08db('0x0'));var Mustache=require(_0x08db('0x1'));var logger=require(_0x08db('0x2'))(_0x08db('0x3'));exports[_0x08db('0x4')]=function(_0x4d91fa,_0x4f683c){var _0x266d3c={'method':_0x4d91fa[_0x08db('0x5')][_0x08db('0x6')](),'uri':encodeURI(Mustache[_0x08db('0x7')](_0x4d91fa[_0x08db('0x8')],_0x4f683c)),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4d91fa[_0x08db('0x5')][_0x08db('0x6')]()){case _0x08db('0x9'):_0x266d3c['qs']=_0x4f683c;break;case _0x08db('0xa'):_0x266d3c['body']=_0x4d91fa['data7']?Mustache[_0x08db('0x7')](_0x4d91fa['data7'],_0x4f683c):_0x4f683c;break;}rp(_0x266d3c)[_0x08db('0xb')](function(_0x22bfaf){logger['info'](util[_0x08db('0xc')](_0x08db('0xd'),_0x4d91fa[_0x08db('0x5')],_0x4d91fa[_0x08db('0x8')],_0x22bfaf['statusCode'],_0x22bfaf['body']));})[_0x08db('0xe')](function(_0x36b950){logger[_0x08db('0xf')](util['format'](_0x08db('0x10'),_0x4d91fa[_0x08db('0x5')],_0x4d91fa[_0x08db('0x8')],_0x36b950[_0x08db('0x11')],_0x36b950['name'],_0x36b950[_0x08db('0x12')]));});}; \ No newline at end of file +var _0x1ff5=['statusCode','name','message','request-promise','util','../../../../config/logger','exec','data1','render','toUpperCase','GET','data7','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20body:\x20%s','body','data2'];(function(_0x1c875b,_0x1d6fb5){var _0x41ddc7=function(_0xe61e59){while(--_0xe61e59){_0x1c875b['push'](_0x1c875b['shift']());}};_0x41ddc7(++_0x1d6fb5);}(_0x1ff5,0x179));var _0x51ff=function(_0x158dc2,_0x2bf7b5){_0x158dc2=_0x158dc2-0x0;var _0x209fdf=_0x1ff5[_0x158dc2];return _0x209fdf;};'use strict';var rp=require(_0x51ff('0x0'));var util=require(_0x51ff('0x1'));var Mustache=require('mustache');var logger=require(_0x51ff('0x2'))('trigger');exports[_0x51ff('0x3')]=function(_0x226b78,_0xae6c76){var _0x3ac836={'method':_0x226b78[_0x51ff('0x4')]['toUpperCase'](),'uri':encodeURI(Mustache[_0x51ff('0x5')](_0x226b78['data2'],_0xae6c76)),'json':!![],'resolveWithFullResponse':!![]};switch(_0x226b78[_0x51ff('0x4')][_0x51ff('0x6')]()){case _0x51ff('0x7'):_0x3ac836['qs']=_0xae6c76;break;case'POST':_0x3ac836['body']=_0x226b78[_0x51ff('0x8')]?Mustache[_0x51ff('0x5')](_0x226b78['data7'],_0xae6c76):_0xae6c76;break;}rp(_0x3ac836)['then'](function(_0x499dd4){logger[_0x51ff('0x9')](util[_0x51ff('0xa')](_0x51ff('0xb'),_0x226b78['data1'],_0x226b78['data2'],_0x499dd4['statusCode'],_0x499dd4[_0x51ff('0xc')]));})['catch'](function(_0x2b7790){logger['error'](util[_0x51ff('0xa')]('%s\x20%s\x20%s\x20[%s]:%s',_0x226b78[_0x51ff('0x4')],_0x226b78[_0x51ff('0xd')],_0x2b7790[_0x51ff('0xe')],_0x2b7790[_0x51ff('0xf')],_0x2b7790[_0x51ff('0x10')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index fdd5bfa..873e75f 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 _0x165d=['Request','debug','error','rpc','message','catch','jayson/promise','bluebird','../../config/logger','routing','client','http'];(function(_0x41527c,_0x44e9d2){var _0x496ebe=function(_0x28d0bc){while(--_0x28d0bc){_0x41527c['push'](_0x41527c['shift']());}};_0x496ebe(++_0x44e9d2);}(_0x165d,0x14a));var _0xd165=function(_0x366f69,_0x486269){_0x366f69=_0x366f69-0x0;var _0x46438b=_0x165d[_0x366f69];return _0x46438b;};'use strict';var jayson=require(_0xd165('0x0'));var BPromise=require(_0xd165('0x1'));var logger=require(_0xd165('0x2'))(_0xd165('0x3'));var client=jayson[_0xd165('0x4')][_0xd165('0x5')]({'port':0x2329});client[_0xd165('0x6')]=function(_0x5a4d7c,_0x405ee0){return new BPromise(function(_0x27993b,_0x51f787){return client['request'](_0x5a4d7c,_0x405ee0)['then'](function(_0x42d256){logger[_0xd165('0x7')]('rpc','routing',_0x5a4d7c,_0x405ee0,_0x42d256);if(_0x42d256[_0xd165('0x8')]){logger[_0xd165('0x8')](_0xd165('0x9'),_0xd165('0x3'),_0x5a4d7c,_0x42d256[_0xd165('0x8')][_0xd165('0xa')],_0x405ee0);return _0x51f787(_0x42d256[_0xd165('0x8')][_0xd165('0xa')]);}else{return _0x27993b(_0x42d256['result']);}})[_0xd165('0xb')](function(_0x2a37a2){logger[_0xd165('0x8')]('rpc',_0xd165('0x3'),_0x5a4d7c,_0x2a37a2,_0x405ee0);return _0x51f787(_0x2a37a2);});});};module['exports']=client; \ No newline at end of file +var _0x4fef=['routing','http','Request','request','then','debug','rpc','error','message','catch','exports','jayson/promise','bluebird'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x4fef,0x10f));var _0xf4fe=function(_0x1fc4ef,_0x5f084f){_0x1fc4ef=_0x1fc4ef-0x0;var _0x2e36f3=_0x4fef[_0x1fc4ef];return _0x2e36f3;};'use strict';var jayson=require(_0xf4fe('0x0'));var BPromise=require(_0xf4fe('0x1'));var logger=require('../../config/logger')(_0xf4fe('0x2'));var client=jayson['client'][_0xf4fe('0x3')]({'port':0x2329});client[_0xf4fe('0x4')]=function(_0x3c78db,_0x1e5ec2){return new BPromise(function(_0x5c5dbb,_0x7bf3fe){return client[_0xf4fe('0x5')](_0x3c78db,_0x1e5ec2)[_0xf4fe('0x6')](function(_0x522427){logger[_0xf4fe('0x7')](_0xf4fe('0x8'),'routing',_0x3c78db,_0x1e5ec2,_0x522427);if(_0x522427[_0xf4fe('0x9')]){logger[_0xf4fe('0x9')](_0xf4fe('0x8'),_0xf4fe('0x2'),_0x3c78db,_0x522427[_0xf4fe('0x9')][_0xf4fe('0xa')],_0x1e5ec2);return _0x7bf3fe(_0x522427[_0xf4fe('0x9')][_0xf4fe('0xa')]);}else{return _0x5c5dbb(_0x522427['result']);}})[_0xf4fe('0xb')](function(_0x49d480){logger[_0xf4fe('0x9')](_0xf4fe('0x8'),_0xf4fe('0x2'),_0x3c78db,_0x49d480,_0x1e5ec2);return _0x7bf3fe(_0x49d480);});});};module[_0xf4fe('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 691efd5..875593b 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 _0xe3ec=['catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen'];(function(_0x33763c,_0x32f791){var _0x3488d9=function(_0x266ed5){while(--_0x266ed5){_0x33763c['push'](_0x33763c['shift']());}};_0x3488d9(++_0x32f791);}(_0xe3ec,0x198));var _0xce3e=function(_0x39aede,_0x69dad2){_0x39aede=_0x39aede-0x0;var _0xd0165c=_0xe3ec[_0x39aede];return _0xd0165c;};'use strict';var BPromise=require(_0xce3e('0x0'));var server=require(_0xce3e('0x1'));var Realtime=require(_0xce3e('0x2'));var EmailChannel=require(_0xce3e('0x3'));var mailAccount=require(_0xce3e('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xce3e('0x5')]()[_0xce3e('0x6')](mailAccount[_0xce3e('0x7')]())[_0xce3e('0x6')](realtime[_0xce3e('0x8')]())[_0xce3e('0x6')](function(){email[_0xce3e('0x9')](realtime[_0xce3e('0xa')]);return realtime;});}function main(){return server[_0xce3e('0xb')](realtime,email)[_0xce3e('0x6')](function(_0x59b7d2){return initRealtime();})['then'](function(_0x2aafbe){return setInterval(initRealtime,0x2710);})[_0xce3e('0xc')](function(_0x23788c){console[_0xce3e('0xd')](_0x23788c);});}main(); \ No newline at end of file +var _0x8e97=['resolve','getMailAccounts','then','initMailAccounts','refresh','mailAccounts','listen','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount'];(function(_0x4bfb94,_0x57e844){var _0x55bde6=function(_0x2ea3c1){while(--_0x2ea3c1){_0x4bfb94['push'](_0x4bfb94['shift']());}};_0x55bde6(++_0x57e844);}(_0x8e97,0x6b));var _0x78e9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e97[_0x4565bf];return _0x5610ba;};'use strict';var BPromise=require(_0x78e9('0x0'));var server=require(_0x78e9('0x1'));var Realtime=require(_0x78e9('0x2'));var EmailChannel=require(_0x78e9('0x3'));var mailAccount=require(_0x78e9('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x78e9('0x5')]()['then'](mailAccount[_0x78e9('0x6')]())[_0x78e9('0x7')](realtime[_0x78e9('0x8')]())['then'](function(){email[_0x78e9('0x9')](realtime[_0x78e9('0xa')]);return realtime;});}function main(){return server[_0x78e9('0xb')](realtime,email)[_0x78e9('0x7')](function(_0x5d024f){return initRealtime();})[_0x78e9('0x7')](function(_0x95c714){return setInterval(initRealtime,0x2710);})[_0x78e9('0xc')](function(_0x220a2a){console[_0x78e9('0xd')](_0x220a2a);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index c72db91..17c722a 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 _0x6ac2=['handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','emit','send','verifySmtp','isNil','Smtp','verified','verify','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','defaults','localhost','socket.io-emitter','redis','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','active','Imap','status','messageStatus','total','stringify','mailAccount:update','hasOwnProperty','box','bind','end','handleImapEnd','error','handleImapError','disabled','name','messages'];(function(_0xdfa07f,_0x17cd1c){var _0x11387d=function(_0xec67ec){while(--_0xec67ec){_0xdfa07f['push'](_0xdfa07f['shift']());}};_0x11387d(++_0x17cd1c);}(_0x6ac2,0x184));var _0x26ac=function(_0x206d6e,_0x455640){_0x206d6e=_0x206d6e-0x0;var _0x531150=_0x6ac2[_0x206d6e];return _0x531150;};'use strict';var _=require(_0x26ac('0x0'));var moment=require('moment');var BPromise=require(_0x26ac('0x1'));var md5=require(_0x26ac('0x2'));var Redis=require(_0x26ac('0x3'));var config=require(_0x26ac('0x4'));var logger=require(_0x26ac('0x5'))(_0x26ac('0x6'));config['redis']=_[_0x26ac('0x7')](config['redis'],{'host':_0x26ac('0x8'),'port':0x18eb});var io=require(_0x26ac('0x9'))(new Redis(config[_0x26ac('0xa')]));var EmailImap=require(_0x26ac('0xb'));var EmailSmtp=require(_0x26ac('0xc'));var mailAccount=require(_0x26ac('0xd'));var md5Accounts={};function EmailChannel(_0x1906d0){logger[_0x26ac('0xe')]('start\x20email\x20channel');this['mailAccounts']=_0x1906d0[_0x26ac('0xf')];this[_0x26ac('0x10')]={};this[_0x26ac('0x11')]=new EmailSmtp();}EmailChannel[_0x26ac('0x12')]['emit']=function(_0x11e8a1){var _0x2507f9=this[_0x26ac('0xf')][_0x11e8a1];var _0x11246b={'id':_0x2507f9['id'],'name':_0x2507f9['name'],'key':_0x2507f9['key'],'active':_0x2507f9[_0x26ac('0x13')],'Imap':{'status':_0x2507f9[_0x26ac('0x14')][_0x26ac('0x15')],'messageStatus':_0x2507f9[_0x26ac('0x14')][_0x26ac('0x16')],'total':_0x2507f9[_0x26ac('0x14')][_0x26ac('0x17')]}};if(_['isNil'](md5Accounts[_0x11e8a1])){md5Accounts[_0x11e8a1]={};}var _0x2f68ad=md5(JSON[_0x26ac('0x18')](_0x11246b));if(md5Accounts[_0x11e8a1][_0x26ac('0x2')]!==_0x2f68ad){md5Accounts[_0x11e8a1][_0x26ac('0x2')]=_0x2f68ad;io['emit'](_0x26ac('0x19'),_0x11246b);}};EmailChannel[_0x26ac('0x12')]['refresh']=function(_0x3dca1f){for(var _0x3b1300 in _0x3dca1f){if(_0x3dca1f[_0x26ac('0x1a')](_0x3b1300)){if(_0x3dca1f[_0x3b1300][_0x26ac('0x14')]&&_0x3dca1f[_0x3b1300]['active']){var _0xfb304b=_0x3dca1f[_0x3b1300][_0x26ac('0x14')];if(!this['imapAccounts']['hasOwnProperty'](_0xfb304b['id'])){this[_0x26ac('0x10')][_0xfb304b['id']]=new EmailImap(_0xfb304b,_0x3dca1f[_0x3b1300][_0x26ac('0x6')]);this['imapAccounts'][_0xfb304b['id']]['on'](_0x26ac('0x1b'),this['handleImapBox']['bind'](this,_0x3b1300));this['imapAccounts'][_0xfb304b['id']]['on'](_0x26ac('0x6'),this['handleImapEmail'][_0x26ac('0x1c')](this,_0x3b1300));this[_0x26ac('0x10')][_0xfb304b['id']]['on'](_0x26ac('0x1d'),this[_0x26ac('0x1e')][_0x26ac('0x1c')](this,_0x3b1300));this[_0x26ac('0x10')][_0xfb304b['id']]['on'](_0x26ac('0x1f'),this[_0x26ac('0x20')][_0x26ac('0x1c')](this,_0x3b1300));}}else{if(_['isNil'](this[_0x26ac('0xf')][_0x3b1300][_0x26ac('0x14')])){this[_0x26ac('0xf')][_0x3b1300][_0x26ac('0x14')]={};}this[_0x26ac('0xf')][_0x3b1300][_0x26ac('0x14')][_0x26ac('0x15')]=_0x26ac('0x21');this[_0x26ac('0xf')][_0x3b1300][_0x26ac('0x14')]['messageStatus']='';this['emit'](_0x3b1300);}}}};EmailChannel[_0x26ac('0x12')]['handleImapBox']=function(_0x185296,_0x11b8de){if(this[_0x26ac('0xf')][_0x185296]){this[_0x26ac('0xf')][_0x185296][_0x26ac('0x14')][_0x26ac('0x15')]='connected';this['mailAccounts'][_0x185296][_0x26ac('0x14')][_0x26ac('0x16')]=_0x11b8de[_0x26ac('0x22')];if(_0x11b8de['messages']){this['mailAccounts'][_0x185296][_0x26ac('0x14')][_0x26ac('0x17')]=_0x11b8de[_0x26ac('0x23')][_0x26ac('0x17')];}return this['emit'](_0x185296);}};EmailChannel['prototype'][_0x26ac('0x24')]=function(_0x3e2148,_0x17691a){logger[_0x26ac('0xe')](_0x26ac('0x25'),_0x17691a[_0x26ac('0x26')],_0x17691a[_0x26ac('0x27')],_0x17691a[_0x26ac('0x28')],_0x3e2148);if(this[_0x26ac('0xf')][_0x3e2148]){return mailAccount[_0x26ac('0x29')](_0x3e2148,_0x17691a)['then'](function(_0x10afd8){if(_0x10afd8){logger[_0x26ac('0xe')]('Mail\x20accepted\x20from\x20routing');}})[_0x26ac('0x2a')](function(_0x3b6e75){logger[_0x26ac('0x1f')](_0x26ac('0x2b'),JSON[_0x26ac('0x18')](_0x3b6e75));});}};EmailChannel[_0x26ac('0x12')][_0x26ac('0x1e')]=function(_0xeda527){if(this[_0x26ac('0xf')][_0xeda527]&&this[_0x26ac('0xf')][_0xeda527][_0x26ac('0x14')]){if(this[_0x26ac('0x10')][this['mailAccounts'][_0xeda527][_0x26ac('0x14')]['id']]){delete this[_0x26ac('0x10')][this[_0x26ac('0xf')][_0xeda527]['Imap']['id']];}this[_0x26ac('0xf')][_0xeda527]['Imap'][_0x26ac('0x2c')]=moment();this[_0x26ac('0x2d')](_0xeda527);}};EmailChannel['prototype'][_0x26ac('0x20')]=function(_0x489e61,_0x28850f){if(this[_0x26ac('0xf')][_0x489e61]){this[_0x26ac('0xf')][_0x489e61][_0x26ac('0x14')]['status']=_0x26ac('0x1f');this['mailAccounts'][_0x489e61][_0x26ac('0x14')]['messageStatus']=_0x28850f;return this[_0x26ac('0x2d')](_0x489e61);}};EmailChannel['prototype']['sendMail']=function(_0x287937,_0x1861eb){return this[_0x26ac('0x11')][_0x26ac('0x2e')](_0x287937,_0x1861eb);};EmailChannel[_0x26ac('0x12')][_0x26ac('0x2f')]=function(_0x506a92){var _0x5c89bb=this;if(this[_0x26ac('0xf')][_0x506a92['id']]){if(_[_0x26ac('0x30')](this[_0x26ac('0xf')][_0x506a92['id']]['Smtp'])){this['mailAccounts'][_0x506a92['id']][_0x26ac('0x31')]={};}this[_0x26ac('0xf')][_0x506a92['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x33361b,_0x382de7){return _0x5c89bb[_0x26ac('0x11')]['verify'](_0x506a92)['then'](function(_0x4bde52){_0x5c89bb['mailAccounts'][_0x506a92['id']][_0x26ac('0x31')][_0x26ac('0x15')]=_0x26ac('0x32');_0x5c89bb[_0x26ac('0xf')][_0x506a92['id']][_0x26ac('0x31')][_0x26ac('0x16')]='';_0x5c89bb[_0x26ac('0x2d')](_0x506a92['id']);_0x33361b(_0x4bde52);})[_0x26ac('0x2a')](function(_0xcbc052){_0x5c89bb['mailAccounts'][_0x506a92['id']][_0x26ac('0x31')][_0x26ac('0x15')]=_0x26ac('0x1f');_0x5c89bb[_0x26ac('0xf')][_0x506a92['id']][_0x26ac('0x31')][_0x26ac('0x16')]=_0xcbc052;_0x5c89bb[_0x26ac('0x2d')](_0x506a92['id']);_0x382de7(_0xcbc052);});});}return this[_0x26ac('0x11')][_0x26ac('0x33')](_0x506a92);};module[_0x26ac('0x34')]=EmailChannel; \ No newline at end of file +var _0xbd10=['email','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','disabled','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','then','verified','verify','exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','stringify','md5','refresh','hasOwnProperty'];(function(_0x28c91d,_0x3e761e){var _0x1d31aa=function(_0x5ea2c0){while(--_0x5ea2c0){_0x28c91d['push'](_0x28c91d['shift']());}};_0x1d31aa(++_0x3e761e);}(_0xbd10,0x85));var _0x0bd1=function(_0x404364,_0x40ca63){_0x404364=_0x404364-0x0;var _0x146fe3=_0xbd10[_0x404364];return _0x146fe3;};'use strict';var _=require(_0x0bd1('0x0'));var moment=require(_0x0bd1('0x1'));var BPromise=require(_0x0bd1('0x2'));var md5=require('md5');var Redis=require(_0x0bd1('0x3'));var config=require(_0x0bd1('0x4'));var logger=require(_0x0bd1('0x5'))('email');config[_0x0bd1('0x6')]=_[_0x0bd1('0x7')](config[_0x0bd1('0x6')],{'host':_0x0bd1('0x8'),'port':0x18eb});var io=require(_0x0bd1('0x9'))(new Redis(config[_0x0bd1('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x0bd1('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x639350){logger[_0x0bd1('0xb')](_0x0bd1('0xc'));this[_0x0bd1('0xd')]=_0x639350['mailAccounts'];this[_0x0bd1('0xe')]={};this[_0x0bd1('0xf')]=new EmailSmtp();}EmailChannel[_0x0bd1('0x10')][_0x0bd1('0x11')]=function(_0x154b4f){var _0x216523=this['mailAccounts'][_0x154b4f];var _0x159b15={'id':_0x216523['id'],'name':_0x216523[_0x0bd1('0x12')],'key':_0x216523[_0x0bd1('0x13')],'active':_0x216523[_0x0bd1('0x14')],'Imap':{'status':_0x216523[_0x0bd1('0x15')][_0x0bd1('0x16')],'messageStatus':_0x216523['Imap'][_0x0bd1('0x17')],'total':_0x216523[_0x0bd1('0x15')][_0x0bd1('0x18')]}};if(_['isNil'](md5Accounts[_0x154b4f])){md5Accounts[_0x154b4f]={};}var _0x51f988=md5(JSON[_0x0bd1('0x19')](_0x159b15));if(md5Accounts[_0x154b4f][_0x0bd1('0x1a')]!==_0x51f988){md5Accounts[_0x154b4f][_0x0bd1('0x1a')]=_0x51f988;io['emit']('mailAccount:update',_0x159b15);}};EmailChannel[_0x0bd1('0x10')][_0x0bd1('0x1b')]=function(_0xc96c4d){for(var _0x5ab359 in _0xc96c4d){if(_0xc96c4d[_0x0bd1('0x1c')](_0x5ab359)){if(_0xc96c4d[_0x5ab359][_0x0bd1('0x15')]&&_0xc96c4d[_0x5ab359][_0x0bd1('0x14')]){var _0x3042c6=_0xc96c4d[_0x5ab359]['Imap'];if(!this[_0x0bd1('0xe')][_0x0bd1('0x1c')](_0x3042c6['id'])){this['imapAccounts'][_0x3042c6['id']]=new EmailImap(_0x3042c6,_0xc96c4d[_0x5ab359][_0x0bd1('0x1d')]);this[_0x0bd1('0xe')][_0x3042c6['id']]['on']('box',this['handleImapBox'][_0x0bd1('0x1e')](this,_0x5ab359));this[_0x0bd1('0xe')][_0x3042c6['id']]['on'](_0x0bd1('0x1d'),this[_0x0bd1('0x1f')][_0x0bd1('0x1e')](this,_0x5ab359));this[_0x0bd1('0xe')][_0x3042c6['id']]['on'](_0x0bd1('0x20'),this[_0x0bd1('0x21')]['bind'](this,_0x5ab359));this[_0x0bd1('0xe')][_0x3042c6['id']]['on'](_0x0bd1('0x22'),this[_0x0bd1('0x23')][_0x0bd1('0x1e')](this,_0x5ab359));}}else{if(_[_0x0bd1('0x24')](this['mailAccounts'][_0x5ab359][_0x0bd1('0x15')])){this['mailAccounts'][_0x5ab359]['Imap']={};}this[_0x0bd1('0xd')][_0x5ab359][_0x0bd1('0x15')][_0x0bd1('0x16')]=_0x0bd1('0x25');this[_0x0bd1('0xd')][_0x5ab359][_0x0bd1('0x15')][_0x0bd1('0x17')]='';this[_0x0bd1('0x11')](_0x5ab359);}}}};EmailChannel[_0x0bd1('0x10')]['handleImapBox']=function(_0x5cb236,_0x3250f6){if(this['mailAccounts'][_0x5cb236]){this[_0x0bd1('0xd')][_0x5cb236][_0x0bd1('0x15')]['status']='connected';this['mailAccounts'][_0x5cb236]['Imap']['messageStatus']=_0x3250f6[_0x0bd1('0x12')];if(_0x3250f6[_0x0bd1('0x26')]){this[_0x0bd1('0xd')][_0x5cb236]['Imap'][_0x0bd1('0x18')]=_0x3250f6[_0x0bd1('0x26')]['total'];}return this['emit'](_0x5cb236);}};EmailChannel[_0x0bd1('0x10')]['handleImapEmail']=function(_0x5366c4,_0x47980f){logger[_0x0bd1('0xb')](_0x0bd1('0x27'),_0x47980f[_0x0bd1('0x28')],_0x47980f['lastName'],_0x47980f[_0x0bd1('0x29')],_0x5366c4);if(this[_0x0bd1('0xd')][_0x5366c4]){return mailAccount['notify'](_0x5366c4,_0x47980f)['then'](function(_0x28877b){if(_0x28877b){logger['info'](_0x0bd1('0x2a'));}})[_0x0bd1('0x2b')](function(_0x5dbab4){logger[_0x0bd1('0x22')](_0x0bd1('0x2c'),JSON[_0x0bd1('0x19')](_0x5dbab4));});}};EmailChannel['prototype'][_0x0bd1('0x21')]=function(_0x4e79f4){if(this[_0x0bd1('0xd')][_0x4e79f4]&&this[_0x0bd1('0xd')][_0x4e79f4][_0x0bd1('0x15')]){if(this[_0x0bd1('0xe')][this['mailAccounts'][_0x4e79f4][_0x0bd1('0x15')]['id']]){delete this[_0x0bd1('0xe')][this[_0x0bd1('0xd')][_0x4e79f4][_0x0bd1('0x15')]['id']];}this[_0x0bd1('0xd')][_0x4e79f4][_0x0bd1('0x15')][_0x0bd1('0x2d')]=moment();this['emit'](_0x4e79f4);}};EmailChannel[_0x0bd1('0x10')][_0x0bd1('0x23')]=function(_0x488310,_0x224159){if(this[_0x0bd1('0xd')][_0x488310]){this[_0x0bd1('0xd')][_0x488310][_0x0bd1('0x15')][_0x0bd1('0x16')]=_0x0bd1('0x22');this[_0x0bd1('0xd')][_0x488310][_0x0bd1('0x15')][_0x0bd1('0x17')]=_0x224159;return this[_0x0bd1('0x11')](_0x488310);}};EmailChannel[_0x0bd1('0x10')][_0x0bd1('0x2e')]=function(_0x41ee78,_0x217c77){return this[_0x0bd1('0xf')][_0x0bd1('0x2f')](_0x41ee78,_0x217c77);};EmailChannel[_0x0bd1('0x10')][_0x0bd1('0x30')]=function(_0x54e3aa){var _0x5246fd=this;if(this[_0x0bd1('0xd')][_0x54e3aa['id']]){if(_[_0x0bd1('0x24')](this[_0x0bd1('0xd')][_0x54e3aa['id']][_0x0bd1('0x31')])){this[_0x0bd1('0xd')][_0x54e3aa['id']][_0x0bd1('0x31')]={};}this['mailAccounts'][_0x54e3aa['id']]['Smtp'][_0x0bd1('0x2d')]=moment();return new BPromise(function(_0x469905,_0x22c0b2){return _0x5246fd[_0x0bd1('0xf')]['verify'](_0x54e3aa)[_0x0bd1('0x32')](function(_0x5581da){_0x5246fd[_0x0bd1('0xd')][_0x54e3aa['id']]['Smtp'][_0x0bd1('0x16')]=_0x0bd1('0x33');_0x5246fd[_0x0bd1('0xd')][_0x54e3aa['id']][_0x0bd1('0x31')]['messageStatus']='';_0x5246fd[_0x0bd1('0x11')](_0x54e3aa['id']);_0x469905(_0x5581da);})[_0x0bd1('0x2b')](function(_0x3ac038){_0x5246fd['mailAccounts'][_0x54e3aa['id']][_0x0bd1('0x31')][_0x0bd1('0x16')]=_0x0bd1('0x22');_0x5246fd[_0x0bd1('0xd')][_0x54e3aa['id']][_0x0bd1('0x31')][_0x0bd1('0x17')]=_0x3ac038;_0x5246fd[_0x0bd1('0x11')](_0x54e3aa['id']);_0x22c0b2(_0x3ac038);});});}return this[_0x0bd1('0xf')][_0x0bd1('0x34')](_0x54e3aa);};module[_0x0bd1('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 082f856..fdee9b9 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 _0x8b38=['password','port','tls','autotls','required','host','getHost','anonymous@xcally.com','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','handleReadUnseen','handleFetchMessage','handleFetchError','handleFetchEnd','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','stringify','textCode','upperFirst','exports','path','util','imap','randomstring','mailparser','events','EventEmitter','../../../config/logger','email','INBOX','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user'];(function(_0x2f8dd4,_0x40fe2c){var _0x436b2e=function(_0x5ce8a9){while(--_0x5ce8a9){_0x2f8dd4['push'](_0x2f8dd4['shift']());}};_0x436b2e(++_0x40fe2c);}(_0x8b38,0x92));var _0x88b3=function(_0x5b0fcc,_0x449df1){_0x5b0fcc=_0x5b0fcc-0x0;var _0x16eb1e=_0x8b38[_0x5b0fcc];return _0x16eb1e;};'use strict';var fs=require('fs');var path=require(_0x88b3('0x0'));var util=require(_0x88b3('0x1'));var Imap=require(_0x88b3('0x2'));var _=require('lodash');var rs=require(_0x88b3('0x3'));var simpleParser=require(_0x88b3('0x4'))['simpleParser'];var EventEmitter=require(_0x88b3('0x5'))[_0x88b3('0x6')];var utils=require('./utils');var logger=require(_0x88b3('0x7'))(_0x88b3('0x8'));function EmailImap(_0x3360a3,_0x2b2f5b){this['mailbox']=_0x88b3('0x9');this[_0x88b3('0xa')]=this[_0x88b3('0xb')](_0x3360a3,_0x2b2f5b);this['imap']=new Imap(this[_0x88b3('0xa')]);this[_0x88b3('0x2')][_0x88b3('0xc')](_0x88b3('0xd'),this[_0x88b3('0xe')][_0x88b3('0xf')](this));this[_0x88b3('0x2')][_0x88b3('0xc')](_0x88b3('0x10'),this[_0x88b3('0x11')][_0x88b3('0xf')](this));this[_0x88b3('0x2')]['on'](_0x88b3('0x12'),this[_0x88b3('0x13')]['bind'](this));this[_0x88b3('0x2')][_0x88b3('0x14')]();}util[_0x88b3('0x15')](EmailImap,EventEmitter);EmailImap[_0x88b3('0x16')][_0x88b3('0xb')]=function(_0xf94c19,_0x11686b){var _0x5d1090={'connTimeout':_0xf94c19[_0x88b3('0x17')]?_0xf94c19[_0x88b3('0x17')]*0x3e8:0x2710,'authTimeout':_0xf94c19[_0x88b3('0x18')]?_0xf94c19[_0x88b3('0x18')]*0x3e8:0x1388};if(_[_0x88b3('0x19')](_0xf94c19['service'])){if(_0xf94c19[_0x88b3('0x1a')]){_0x5d1090['user']=_0xf94c19[_0x88b3('0x1b')];_0x5d1090[_0x88b3('0x1c')]=_0xf94c19[_0x88b3('0x1c')];}_0x5d1090['host']=_0xf94c19['host'];_0x5d1090[_0x88b3('0x1d')]=_0xf94c19[_0x88b3('0x1d')]||0x3e1;if(_0xf94c19['tls']){_0x5d1090['tls']=!![];}else{_0x5d1090[_0x88b3('0x1e')]=![];_0x5d1090[_0x88b3('0x1f')]=_0x88b3('0x20');}}else{_0x5d1090[_0x88b3('0x1b')]=_0xf94c19[_0x88b3('0x1b')];_0x5d1090['password']=_0xf94c19[_0x88b3('0x1c')];_0x5d1090[_0x88b3('0x21')]=utils[_0x88b3('0x22')](_0xf94c19['service']);_0x5d1090['port']=0x3e1;_0x5d1090[_0x88b3('0x1e')]=!![];}_0x5d1090[_0x88b3('0x8')]=_0x11686b||_0xf94c19[_0x88b3('0x1b')]||_0x88b3('0x23');return _0x5d1090;};EmailImap[_0x88b3('0x16')][_0x88b3('0xe')]=function(){this[_0x88b3('0x2')]['openBox'](this[_0x88b3('0x24')],![],this[_0x88b3('0x25')]['bind'](this));};EmailImap[_0x88b3('0x16')][_0x88b3('0x25')]=function(_0x218311,_0x53b810){if(_0x218311){this[_0x88b3('0x13')](_0x218311,!![]);}else{this[_0x88b3('0x26')](_0x88b3('0x27'),_0x53b810);this[_0x88b3('0x28')]();}};EmailImap[_0x88b3('0x16')][_0x88b3('0x29')]=function(_0x42e737){if(_0x42e737){this['handleError'](_0x42e737,!![]);}else{this[_0x88b3('0x2')][_0x88b3('0x10')]();}};EmailImap[_0x88b3('0x16')][_0x88b3('0x28')]=function(){this['imap']['search'](['UNSEEN'],this['handleReadUnseen'][_0x88b3('0xf')](this));};EmailImap[_0x88b3('0x16')][_0x88b3('0x2a')]=function(_0x45d96a,_0x1f7eb1){if(_0x45d96a){this['handleError'](_0x45d96a,!![]);}else{if(_0x1f7eb1['length']){try{var _0x19987b=this[_0x88b3('0x2')]['fetch'](_0x1f7eb1,{'bodies':'','markSeen':!![]});_0x19987b['on']('message',this[_0x88b3('0x2b')][_0x88b3('0xf')](this));_0x19987b[_0x88b3('0xc')](_0x88b3('0x12'),this[_0x88b3('0x2c')][_0x88b3('0xf')](this));_0x19987b['once'](_0x88b3('0x10'),this[_0x88b3('0x2d')]['bind'](this));}catch(_0x3d39fc){logger[_0x88b3('0x12')](_0x3d39fc);}}else{this['imap']['closeBox'](!![],this[_0x88b3('0x29')][_0x88b3('0xf')](this));}}};EmailImap['prototype'][_0x88b3('0x2b')]=function(_0x4040d7,_0x5e5fdc){_0x4040d7['on'](_0x88b3('0x2e'),this[_0x88b3('0x2f')]['bind'](this));_0x4040d7[_0x88b3('0xc')](_0x88b3('0x30'),this[_0x88b3('0x31')][_0x88b3('0xf')](this));_0x4040d7['once'](_0x88b3('0x10'),this[_0x88b3('0x32')][_0x88b3('0xf')](this));};EmailImap[_0x88b3('0x16')][_0x88b3('0x2f')]=function(_0x3f3b05,_0x37b048){simpleParser(_0x3f3b05,this[_0x88b3('0x33')][_0x88b3('0xf')](this));};EmailImap[_0x88b3('0x16')][_0x88b3('0x31')]=function(_0x2e2d8c){};EmailImap['prototype'][_0x88b3('0x32')]=function(){};EmailImap['prototype'][_0x88b3('0x33')]=function(_0x20b391,_0x48099c){if(_0x20b391){logger['error'](_0x20b391);}else{var _0x513645=this;utils[_0x88b3('0x34')](this[_0x88b3('0xa')],_0x48099c,function(_0x1d3fca){_0x513645['emit'](_0x88b3('0x8'),_0x1d3fca);});}};EmailImap[_0x88b3('0x16')]['handleFetchEnd']=function(){this[_0x88b3('0x2')][_0x88b3('0x35')](!![],this['handleCloseBox'][_0x88b3('0xf')](this));};EmailImap['prototype'][_0x88b3('0x2c')]=function(_0xdc78e5){this['handleError'](_0xdc78e5);this[_0x88b3('0x2')][_0x88b3('0x35')](!![],this[_0x88b3('0x29')][_0x88b3('0xf')](this));};EmailImap[_0x88b3('0x16')][_0x88b3('0x11')]=function(){this['emit']('end');};EmailImap['prototype'][_0x88b3('0x13')]=function(_0x50ef1e,_0x3e4d1a){logger[_0x88b3('0x12')]('handleError',this[_0x88b3('0xa')][_0x88b3('0x8')],JSON[_0x88b3('0x36')](_0x50ef1e));var _0x255917='';if(_0x50ef1e){if(_0x50ef1e[_0x88b3('0x37')]){_0x255917=_0x50ef1e[_0x88b3('0x37')];}else{for(var _0x4434f3 in _0x50ef1e){if(_0x50ef1e['hasOwnProperty'](_0x4434f3)){_0x255917+=_[_0x88b3('0x38')](_0x4434f3)+':\x20'+_0x50ef1e[_0x4434f3]+'\x0a';}}}}if(_0x3e4d1a){this[_0x88b3('0x2')][_0x88b3('0x10')]();}else{this[_0x88b3('0x26')]('error',_0x255917);this[_0x88b3('0x26')]('end');}};module[_0x88b3('0x39')]=EmailImap; \ No newline at end of file +var _0xeebf=['imap','lodash','randomstring','mailparser','events','EventEmitter','../../../config/logger','email','mailbox','account','getAccount','once','ready','end','handleError','bind','connect','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','getHost','service','anonymous@xcally.com','handleReady','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','error','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageAttributes','handleMessageEnd','handleSimpleParser','emit','handleEnd','stringify','textCode','upperFirst','util'];(function(_0x19c349,_0x4f19c6){var _0x508a7f=function(_0x2ac6b7){while(--_0x2ac6b7){_0x19c349['push'](_0x19c349['shift']());}};_0x508a7f(++_0x4f19c6);}(_0xeebf,0x112));var _0xfeeb=function(_0x4fdc01,_0x4101ea){_0x4fdc01=_0x4fdc01-0x0;var _0x5bb876=_0xeebf[_0x4fdc01];return _0x5bb876;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xfeeb('0x0'));var Imap=require(_0xfeeb('0x1'));var _=require(_0xfeeb('0x2'));var rs=require(_0xfeeb('0x3'));var simpleParser=require(_0xfeeb('0x4'))['simpleParser'];var EventEmitter=require(_0xfeeb('0x5'))[_0xfeeb('0x6')];var utils=require('./utils');var logger=require(_0xfeeb('0x7'))(_0xfeeb('0x8'));function EmailImap(_0x1857e9,_0x5b8e60){this[_0xfeeb('0x9')]='INBOX';this[_0xfeeb('0xa')]=this[_0xfeeb('0xb')](_0x1857e9,_0x5b8e60);this[_0xfeeb('0x1')]=new Imap(this[_0xfeeb('0xa')]);this['imap'][_0xfeeb('0xc')](_0xfeeb('0xd'),this['handleReady']['bind'](this));this['imap'][_0xfeeb('0xc')](_0xfeeb('0xe'),this['handleEnd']['bind'](this));this['imap']['on']('error',this[_0xfeeb('0xf')][_0xfeeb('0x10')](this));this[_0xfeeb('0x1')][_0xfeeb('0x11')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xfeeb('0x12')][_0xfeeb('0xb')]=function(_0x14ea4f,_0x332228){var _0x4dd851={'connTimeout':_0x14ea4f[_0xfeeb('0x13')]?_0x14ea4f[_0xfeeb('0x13')]*0x3e8:0x2710,'authTimeout':_0x14ea4f[_0xfeeb('0x14')]?_0x14ea4f[_0xfeeb('0x14')]*0x3e8:0x1388};if(_[_0xfeeb('0x15')](_0x14ea4f['service'])){if(_0x14ea4f[_0xfeeb('0x16')]){_0x4dd851['user']=_0x14ea4f[_0xfeeb('0x17')];_0x4dd851[_0xfeeb('0x18')]=_0x14ea4f[_0xfeeb('0x18')];}_0x4dd851[_0xfeeb('0x19')]=_0x14ea4f[_0xfeeb('0x19')];_0x4dd851[_0xfeeb('0x1a')]=_0x14ea4f[_0xfeeb('0x1a')]||0x3e1;if(_0x14ea4f[_0xfeeb('0x1b')]){_0x4dd851[_0xfeeb('0x1b')]=!![];}else{_0x4dd851[_0xfeeb('0x1b')]=![];_0x4dd851[_0xfeeb('0x1c')]='required';}}else{_0x4dd851[_0xfeeb('0x17')]=_0x14ea4f[_0xfeeb('0x17')];_0x4dd851[_0xfeeb('0x18')]=_0x14ea4f[_0xfeeb('0x18')];_0x4dd851[_0xfeeb('0x19')]=utils[_0xfeeb('0x1d')](_0x14ea4f[_0xfeeb('0x1e')]);_0x4dd851[_0xfeeb('0x1a')]=0x3e1;_0x4dd851['tls']=!![];}_0x4dd851[_0xfeeb('0x8')]=_0x332228||_0x14ea4f[_0xfeeb('0x17')]||_0xfeeb('0x1f');return _0x4dd851;};EmailImap[_0xfeeb('0x12')][_0xfeeb('0x20')]=function(){this[_0xfeeb('0x1')]['openBox'](this[_0xfeeb('0x9')],![],this['handleOpenBox'][_0xfeeb('0x10')](this));};EmailImap[_0xfeeb('0x12')]['handleOpenBox']=function(_0x3e216e,_0x2b74b5){if(_0x3e216e){this['handleError'](_0x3e216e,!![]);}else{this['emit'](_0xfeeb('0x21'),_0x2b74b5);this[_0xfeeb('0x22')]();}};EmailImap[_0xfeeb('0x12')][_0xfeeb('0x23')]=function(_0x4a2773){if(_0x4a2773){this[_0xfeeb('0xf')](_0x4a2773,!![]);}else{this[_0xfeeb('0x1')][_0xfeeb('0xe')]();}};EmailImap[_0xfeeb('0x12')][_0xfeeb('0x22')]=function(){this[_0xfeeb('0x1')][_0xfeeb('0x24')]([_0xfeeb('0x25')],this[_0xfeeb('0x26')][_0xfeeb('0x10')](this));};EmailImap[_0xfeeb('0x12')]['handleReadUnseen']=function(_0x21cec3,_0x4f1c3f){if(_0x21cec3){this[_0xfeeb('0xf')](_0x21cec3,!![]);}else{if(_0x4f1c3f['length']){try{var _0x14e3a7=this['imap'][_0xfeeb('0x27')](_0x4f1c3f,{'bodies':'','markSeen':!![]});_0x14e3a7['on'](_0xfeeb('0x28'),this['handleFetchMessage'][_0xfeeb('0x10')](this));_0x14e3a7[_0xfeeb('0xc')](_0xfeeb('0x29'),this[_0xfeeb('0x2a')][_0xfeeb('0x10')](this));_0x14e3a7[_0xfeeb('0xc')](_0xfeeb('0xe'),this[_0xfeeb('0x2b')][_0xfeeb('0x10')](this));}catch(_0x4c698f){logger['error'](_0x4c698f);}}else{this[_0xfeeb('0x1')][_0xfeeb('0x2c')](!![],this[_0xfeeb('0x23')][_0xfeeb('0x10')](this));}}};EmailImap[_0xfeeb('0x12')][_0xfeeb('0x2d')]=function(_0x4163da,_0x31d2d6){_0x4163da['on'](_0xfeeb('0x2e'),this['handleMessageBody'][_0xfeeb('0x10')](this));_0x4163da[_0xfeeb('0xc')]('attributes',this[_0xfeeb('0x2f')][_0xfeeb('0x10')](this));_0x4163da[_0xfeeb('0xc')](_0xfeeb('0xe'),this[_0xfeeb('0x30')]['bind'](this));};EmailImap[_0xfeeb('0x12')]['handleMessageBody']=function(_0x470029,_0x4bd42d){simpleParser(_0x470029,this['handleSimpleParser']['bind'](this));};EmailImap[_0xfeeb('0x12')]['handleMessageAttributes']=function(_0x2659ec){};EmailImap[_0xfeeb('0x12')]['handleMessageEnd']=function(){};EmailImap[_0xfeeb('0x12')][_0xfeeb('0x31')]=function(_0x1b9b60,_0x5d5180){if(_0x1b9b60){logger[_0xfeeb('0x29')](_0x1b9b60);}else{var _0x42abc2=this;utils['parser'](this['account'],_0x5d5180,function(_0xbbe0){_0x42abc2[_0xfeeb('0x32')](_0xfeeb('0x8'),_0xbbe0);});}};EmailImap['prototype'][_0xfeeb('0x2b')]=function(){this[_0xfeeb('0x1')]['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xfeeb('0x12')][_0xfeeb('0x2a')]=function(_0x592e62){this[_0xfeeb('0xf')](_0x592e62);this['imap'][_0xfeeb('0x2c')](!![],this[_0xfeeb('0x23')][_0xfeeb('0x10')](this));};EmailImap[_0xfeeb('0x12')][_0xfeeb('0x33')]=function(){this[_0xfeeb('0x32')](_0xfeeb('0xe'));};EmailImap[_0xfeeb('0x12')][_0xfeeb('0xf')]=function(_0x41efb0,_0x3458a2){logger[_0xfeeb('0x29')](_0xfeeb('0xf'),this[_0xfeeb('0xa')]['email'],JSON[_0xfeeb('0x34')](_0x41efb0));var _0x38fd89='';if(_0x41efb0){if(_0x41efb0[_0xfeeb('0x35')]){_0x38fd89=_0x41efb0[_0xfeeb('0x35')];}else{for(var _0x40f594 in _0x41efb0){if(_0x41efb0['hasOwnProperty'](_0x40f594)){_0x38fd89+=_[_0xfeeb('0x36')](_0x40f594)+':\x20'+_0x41efb0[_0x40f594]+'\x0a';}}}}if(_0x3458a2){this[_0xfeeb('0x1')]['end']();}else{this[_0xfeeb('0x32')](_0xfeeb('0x29'),_0x38fd89);this[_0xfeeb('0x32')]('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 a991cc6..40473d0 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 _0x49d4=['Not\x20verifired','exports','bluebird','nodemailer-plugin-inline-base64','send','createTransport','use','compile','sendMail','toString','prototype','verify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x49d4,0x1ee));var _0x449d=function(_0x507735,_0x389eda){_0x507735=_0x507735-0x0;var _0x44b528=_0x49d4[_0x507735];return _0x44b528;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x449d('0x0'));var inlineBase64=require(_0x449d('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x449d('0x2')]=function(_0x19d313,_0x5c5c04){return new BPromise(function(_0x2dec5a,_0x5d142f){var _0x4536a4=nodemailer[_0x449d('0x3')](_0x19d313);_0x4536a4[_0x449d('0x4')](_0x449d('0x5'),inlineBase64());_0x4536a4[_0x449d('0x6')](_0x5c5c04,function(_0x720d1c,_0x4aa78d){if(_0x720d1c){_0x5d142f(_0x720d1c[_0x449d('0x7')]());}else{_0x2dec5a(_0x4aa78d);}});});};EmailSmtp[_0x449d('0x8')][_0x449d('0x9')]=function(_0x55693f){return new BPromise(function(_0x5d3313,_0x50c7a1){var _0x75b37b=nodemailer[_0x449d('0x3')](_0x55693f);_0x75b37b[_0x449d('0x9')](function(_0x451ca1,_0x27214e){if(_0x451ca1){_0x50c7a1(_0x451ca1['toString']());}else{if(_0x27214e){_0x5d3313(_0x27214e);}else{_0x50c7a1(_0x449d('0xa'));}}});});};module[_0x449d('0xb')]=EmailSmtp; \ No newline at end of file +var _0x52af=['use','compile','sendMail','toString','verify','Not\x20verifired','exports','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport'];(function(_0x1486ce,_0x233c7f){var _0x10a7b2=function(_0xd96f47){while(--_0xd96f47){_0x1486ce['push'](_0x1486ce['shift']());}};_0x10a7b2(++_0x233c7f);}(_0x52af,0x97));var _0xf52a=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x52af[_0x220f3f];return _0x1f170e;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0xf52a('0x0'));var inlineBase64=require(_0xf52a('0x1'));function EmailSmtp(){}EmailSmtp[_0xf52a('0x2')][_0xf52a('0x3')]=function(_0x37c3d9,_0x180810){return new BPromise(function(_0x3324d6,_0x1d806c){var _0x57c8df=nodemailer[_0xf52a('0x4')](_0x37c3d9);_0x57c8df[_0xf52a('0x5')](_0xf52a('0x6'),inlineBase64());_0x57c8df[_0xf52a('0x7')](_0x180810,function(_0xd436f1,_0x8dbdd0){if(_0xd436f1){_0x1d806c(_0xd436f1[_0xf52a('0x8')]());}else{_0x3324d6(_0x8dbdd0);}});});};EmailSmtp['prototype'][_0xf52a('0x9')]=function(_0x90c5a7){return new BPromise(function(_0x27d690,_0x327efb){var _0x3a8bff=nodemailer[_0xf52a('0x4')](_0x90c5a7);_0x3a8bff[_0xf52a('0x9')](function(_0x4d2d8e,_0x2b7b36){if(_0x4d2d8e){_0x327efb(_0x4d2d8e[_0xf52a('0x8')]());}else{if(_0x2b7b36){_0x27d690(_0x2b7b36);}else{_0x327efb(_0xf52a('0xa'));}}});});};module[_0xf52a('0xb')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 34f5f8e..a6fa1b9 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 _0xbac6=['test','replace','body','textAsHtml','Empty\x20message

','getHost','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','lodash','moment','randomstring','util','../../../config/logger','../../../config/environment','head','address','anonymous','generate','name','slice','join','Anonymous','value','length','pop','isEmpty','@xcally.com','html'];(function(_0x1875d3,_0x5e5ce2){var _0x36b903=function(_0x13147e){while(--_0x13147e){_0x1875d3['push'](_0x1875d3['shift']());}};_0x36b903(++_0x5e5ce2);}(_0xbac6,0x1ec));var _0x6bac=function(_0x37dd47,_0x240fa5){_0x37dd47=_0x37dd47-0x0;var _0x529d56=_0xbac6[_0x37dd47];return _0x529d56;};'use strict';var _=require(_0x6bac('0x0'));var moment=require(_0x6bac('0x1'));var random=require(_0x6bac('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x6bac('0x3'));var tnef=require('node-tnef');var logger=require(_0x6bac('0x4'))('email');var config=require(_0x6bac('0x5'));function getAddress(_0x423bc1){var _0x506abd=_[_0x6bac('0x6')](_0x423bc1['value']);return _0x506abd&&_0x506abd[_0x6bac('0x7')]?_0x506abd['address']:_0x6bac('0x8')+random[_0x6bac('0x9')](0x6)+'@xcally.com';}function getFirstName(_0x4ba90b){var _0x4c2aeb=_['head'](_0x4ba90b['value']);if(_0x4c2aeb&&_0x4c2aeb[_0x6bac('0xa')]){var _0x40941b=_0x4c2aeb['name']['split'](/\s+/);return _0x40941b['length']?_0x40941b[_0x6bac('0xb')](0x0,-0x1)[_0x6bac('0xc')]('\x20'):_0x4c2aeb[_0x6bac('0xa')];}return _0x6bac('0xd');}function getLastName(_0x21ea56){var _0x49039f=_[_0x6bac('0x6')](_0x21ea56[_0x6bac('0xe')]);if(_0x49039f&&_0x49039f['name']){var _0x42d6f8=_0x49039f['name']['split'](/\s+/);return _0x42d6f8[_0x6bac('0xf')]>0x1?_0x42d6f8[_0x6bac('0x10')]():'';}return'';}function getMails(_0x25eb23,_0x5ec99c){var _0x36a77e='';for(var _0x207d9f=0x0;_0x207d9f<_0x5ec99c['value']['length'];_0x207d9f+=0x1){if(_0x5ec99c[_0x6bac('0xe')][_0x207d9f][_0x6bac('0x7')]!==_0x25eb23){if(!_[_0x6bac('0x11')](_0x36a77e)){_0x36a77e+=',';}_0x36a77e+=_0x5ec99c['value'][_0x207d9f][_0x6bac('0xa')]||_0x5ec99c[_0x6bac('0xe')][_0x207d9f]['address']||'';_0x36a77e+='\x20<';_0x36a77e+=_0x5ec99c['value'][_0x207d9f]['address']?_0x5ec99c[_0x6bac('0xe')][_0x207d9f][_0x6bac('0x7')]:_0x6bac('0x8')+random[_0x6bac('0x9')](0x6)+_0x6bac('0x12');_0x36a77e+='>';}}return _0x36a77e;}function parseEmail(_0x3787f6,_0x13b331,_0x34690c){if(_0x13b331[_0x6bac('0x13')]){var _0x21f7a3=/)<[^<]*)*<\/script>/gi;while(_0x21f7a3[_0x6bac('0x14')](_0x13b331[_0x6bac('0x13')])){_0x13b331[_0x6bac('0x13')]=_0x13b331[_0x6bac('0x13')][_0x6bac('0x15')](_0x21f7a3,'');}_0x34690c[_0x6bac('0x16')]=_0x13b331[_0x6bac('0x13')];}else{_0x34690c[_0x6bac('0x16')]=_0x13b331[_0x6bac('0x17')];}if(_0x34690c[_0x6bac('0x16')]){_0x34690c[_0x6bac('0x16')]=_0x34690c[_0x6bac('0x16')]['replace'](/Empty\x20message

';if(_0x256c2a[_0x6bac('0x35')]){for(var _0x2aaf7d=0x0;_0x2aaf7d<_0x256c2a['Attachments'][_0x6bac('0xf')];_0x2aaf7d++){var _0x1e1cc2=_0x256c2a[_0x6bac('0x35')][_0x2aaf7d];_0x13ba38[_0x6bac('0x1b')]['attachments'][_0x6bac('0x36')]({'filename':_0x1e1cc2['Title'],'content':new Buffer(_0x1e1cc2['Data'])});}}}_0x46ae72(parseEmail(_0x1849d2,_0x510451,_0x13ba38));});}else{_0x510451[_0x6bac('0x13')]=_0x6bac('0x37');_0x46ae72(parseEmail(_0x1849d2,_0x510451,_0x13ba38));}}else{_0x46ae72(parseEmail(_0x1849d2,_0x510451,_0x13ba38));}};exports[_0x6bac('0x38')]=function(_0x49bac6){switch(_0x49bac6){case _0x6bac('0x39'):return _0x6bac('0x3a');case'yahoo':return _0x6bac('0x3b');case _0x6bac('0x3c'):return _0x6bac('0x3d');case _0x6bac('0x3e'):return'outlook.office365.com';}return _0x6bac('0x3f');}; \ No newline at end of file +var _0xe062=['info','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap-mail.outlook.com','127.0.0.1','lodash','moment','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','@xcally.com','name','split','length','slice','join','Anonymous','address','anonymous','html','test','body','0x1?_0x4c140e['pop']():'';}return'';}function getMails(_0x48d757,_0x289134){var _0x483084='';for(var _0x4935b3=0x0;_0x4935b3<_0x289134[_0x2e06('0x8')][_0x2e06('0xc')];_0x4935b3+=0x1){if(_0x289134['value'][_0x4935b3][_0x2e06('0x10')]!==_0x48d757){if(!_['isEmpty'](_0x483084)){_0x483084+=',';}_0x483084+=_0x289134[_0x2e06('0x8')][_0x4935b3]['name']||_0x289134[_0x2e06('0x8')][_0x4935b3][_0x2e06('0x10')]||'';_0x483084+='\x20<';_0x483084+=_0x289134[_0x2e06('0x8')][_0x4935b3][_0x2e06('0x10')]?_0x289134[_0x2e06('0x8')][_0x4935b3][_0x2e06('0x10')]:_0x2e06('0x11')+random['generate'](0x6)+_0x2e06('0x9');_0x483084+='>';}}return _0x483084;}function parseEmail(_0xf5317,_0x393603,_0x4091ce){if(_0x393603[_0x2e06('0x12')]){var _0x43a978=/)<[^<]*)*<\/script>/gi;while(_0x43a978[_0x2e06('0x13')](_0x393603[_0x2e06('0x12')])){_0x393603[_0x2e06('0x12')]=_0x393603['html']['replace'](_0x43a978,'');}_0x4091ce['body']=_0x393603['html'];}else{_0x4091ce[_0x2e06('0x14')]=_0x393603['textAsHtml'];}if(_0x4091ce[_0x2e06('0x14')]){_0x4091ce[_0x2e06('0x14')]=_0x4091ce['body']['replace'](/0x0){if(this[_0x76cf52+_0x25d5('0x24')]>0x0&&this[_0x76cf52+_0x25d5('0x23')]>=this[_0x76cf52+_0x25d5('0x24')]){return _0x25d5('0x25');}else{return _0x25d5('0x26');}}else{return _0x25d5('0x27');}};Agent['prototype']['updateRealtime']=function(){var _0x2cda2c=['mail',_0x25d5('0x28'),_0x25d5('0x29'),_0x25d5('0x2a'),_0x25d5('0x2b')];for(var _0x110aed=0x0;_0x110aed<_0x2cda2c[_0x25d5('0x2c')];_0x110aed+=0x1){var _0x14ac95=this['getChannelStatus'](_0x2cda2c[_0x110aed]);if(this[_0x2cda2c[_0x110aed]+'Status']!==_0x14ac95){this[_0x2cda2c[_0x110aed]+_0x25d5('0x2d')]=_[_0x25d5('0x2e')](moment()[_0x25d5('0x2f')]('x'));}this[_0x2cda2c[_0x110aed]+'Status']=_0x14ac95;}var _0x3fcedb={'id':this['id'],'name':this[_0x25d5('0x6')],'online':this[_0x25d5('0x7')],'voicePause':this[_0x25d5('0x8')],'chatPause':this[_0x25d5('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0x25d5('0xc')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x25d5('0xe')],'chatStatusTime':this[_0x25d5('0xf')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x25d5('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x25d5('0x14')],'mailCapacity':this[_0x25d5('0x15')],'mailCurrentCapacity':this[_0x25d5('0x16')],'faxStatus':this[_0x25d5('0x30')],'faxStatusTime':this[_0x25d5('0x31')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x25d5('0x18')],'smsStatus':this[_0x25d5('0x32')],'smsStatusTime':this[_0x25d5('0x19')],'smsCapacity':this[_0x25d5('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x25d5('0x1c')],'openchannelCapacity':this[_0x25d5('0x1d')],'openchannelCurrentCapacity':this[_0x25d5('0x1e')],'busy':this[_0x25d5('0x33')],'busyQueue':this[_0x25d5('0x1f')]};var _0x3a5b46=md5(JSON[_0x25d5('0x34')](_0x3fcedb));if(this[_0x25d5('0x0')]!==_0x3a5b46){this[_0x25d5('0x0')]=_0x3a5b46;io[_0x25d5('0x35')](_0x25d5('0x36'),_0x3fcedb);}};module[_0x25d5('0x37')]=Agent; \ No newline at end of file +var _0x9679=['getChannelStatus','Capacity','CurrentCapacity','maxcapacity','idle','mail','chat','openchannel','fax','sms','StatusTime','toNumber','format','Status','faxStatusTime','faxCurrentCapacity','smsStatusTime','smsCurrentCapacity','openchannelCurrentCapacity','busy','stringify','emit','exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','smsStatus','smsCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busyQueue','md5','updateRealtime','prototype'];(function(_0x407f2e,_0x209e8c){var _0x48a967=function(_0x1bb3b8){while(--_0x1bb3b8){_0x407f2e['push'](_0x407f2e['shift']());}};_0x48a967(++_0x209e8c);}(_0x9679,0x16d));var _0x9967=function(_0x449e08,_0x40982f){_0x449e08=_0x449e08-0x0;var _0x164fdf=_0x9679[_0x449e08];return _0x164fdf;};'use strict';var _=require(_0x9967('0x0'));var moment=require(_0x9967('0x1'));var md5=require('md5');var Redis=require(_0x9967('0x2'));var config=require(_0x9967('0x3'));config[_0x9967('0x4')]=_[_0x9967('0x5')](config['redis'],{'host':_0x9967('0x6'),'port':0x18eb});var io=require(_0x9967('0x7'))(new Redis(config[_0x9967('0x4')]));function Agent(_0xa6fe24){this['id']=_0xa6fe24['id']||0x0;this[_0x9967('0x8')]=_0xa6fe24[_0x9967('0x8')]||'';this[_0x9967('0x9')]=_0xa6fe24[_0x9967('0x9')]||!![];this[_0x9967('0xa')]=_0xa6fe24['voicePause']||![];this[_0x9967('0xb')]=_0xa6fe24[_0x9967('0xb')]||![];this['mailPause']=_0xa6fe24[_0x9967('0xc')]||![];this[_0x9967('0xd')]=_0xa6fe24[_0x9967('0xd')]||![];this[_0x9967('0xe')]=_0xa6fe24[_0x9967('0xe')]||![];this['openchannelPause']=_0xa6fe24[_0x9967('0xf')]||![];this['chatStatus']=_0x9967('0x10');this[_0x9967('0x11')]=0x0;this['chatCapacity']=_0xa6fe24['chatCapacity']||0x0;this[_0x9967('0x12')]=0x0;this[_0x9967('0x13')]=_0x9967('0x10');this[_0x9967('0x14')]=0x0;this[_0x9967('0x15')]=_0xa6fe24[_0x9967('0x15')]||0x0;this[_0x9967('0x16')]=0x0;this[_0x9967('0x17')]=_0x9967('0x10');this['faxStatusTime']=0x0;this[_0x9967('0x18')]=_0xa6fe24[_0x9967('0x18')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x9967('0x19')]=_0x9967('0x10');this['smsStatusTime']=0x0;this[_0x9967('0x1a')]=_0xa6fe24[_0x9967('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x9967('0x1b')]=_0x9967('0x10');this[_0x9967('0x1c')]=0x0;this[_0x9967('0x1d')]=_0xa6fe24[_0x9967('0x1d')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x9967('0x1e')]=undefined;this[_0x9967('0x1f')]='';this[_0x9967('0x20')]();}Agent[_0x9967('0x21')][_0x9967('0x22')]=function(_0x33ac0c){if(this[_0x33ac0c+'CurrentCapacity']>0x0){if(this[_0x33ac0c+_0x9967('0x23')]>0x0&&this[_0x33ac0c+_0x9967('0x24')]>=this[_0x33ac0c+_0x9967('0x23')]){return _0x9967('0x25');}else{return'working';}}else{return _0x9967('0x26');}};Agent[_0x9967('0x21')][_0x9967('0x20')]=function(){var _0x3e3022=[_0x9967('0x27'),_0x9967('0x28'),_0x9967('0x29'),_0x9967('0x2a'),_0x9967('0x2b')];for(var _0x1c7f16=0x0;_0x1c7f16<_0x3e3022['length'];_0x1c7f16+=0x1){var _0x1ec56d=this[_0x9967('0x22')](_0x3e3022[_0x1c7f16]);if(this[_0x3e3022[_0x1c7f16]+'Status']!==_0x1ec56d){this[_0x3e3022[_0x1c7f16]+_0x9967('0x2c')]=_[_0x9967('0x2d')](moment()[_0x9967('0x2e')]('x'));}this[_0x3e3022[_0x1c7f16]+_0x9967('0x2f')]=_0x1ec56d;}var _0x66c74a={'id':this['id'],'name':this[_0x9967('0x8')],'online':this[_0x9967('0x9')],'voicePause':this[_0x9967('0xa')],'chatPause':this[_0x9967('0xb')],'mailPause':this[_0x9967('0xc')],'smsPause':this['smsPause'],'faxPause':this[_0x9967('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x9967('0x11')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x9967('0x12')],'mailStatus':this[_0x9967('0x13')],'mailStatusTime':this[_0x9967('0x14')],'mailCapacity':this[_0x9967('0x15')],'mailCurrentCapacity':this[_0x9967('0x16')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x9967('0x30')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x9967('0x31')],'smsStatus':this[_0x9967('0x19')],'smsStatusTime':this[_0x9967('0x32')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x9967('0x33')],'openchannelStatus':this[_0x9967('0x1b')],'openchannelStatusTime':this[_0x9967('0x1c')],'openchannelCapacity':this[_0x9967('0x1d')],'openchannelCurrentCapacity':this[_0x9967('0x34')],'busy':this[_0x9967('0x35')],'busyQueue':this[_0x9967('0x1e')]};var _0x4f662e=md5(JSON[_0x9967('0x36')](_0x66c74a));if(this[_0x9967('0x1f')]!==_0x4f662e){this['md5']=_0x4f662e;io[_0x9967('0x37')]('user:save',_0x66c74a);}};module[_0x9967('0x38')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 38d94c4..b987001 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 _0x1b11=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','available','stringify','chat:queue:%s','emit','chat_queue:save','exports','md5','util'];(function(_0x1414b6,_0x145a09){var _0x4fc3ea=function(_0x7fc36){while(--_0x7fc36){_0x1414b6['push'](_0x1414b6['shift']());}};_0x4fc3ea(++_0x145a09);}(_0x1b11,0xde));var _0x11b1=function(_0x5938d4,_0x4a0a9f){_0x5938d4=_0x5938d4-0x0;var _0xc489ac=_0x1b11[_0x5938d4];return _0xc489ac;};'use strict';var _=require('lodash');var md5=require(_0x11b1('0x0'));var util=require(_0x11b1('0x1'));var Redis=require(_0x11b1('0x2'));var config=require(_0x11b1('0x3'));config[_0x11b1('0x4')]=_[_0x11b1('0x5')](config['redis'],{'host':_0x11b1('0x6'),'port':0x18eb});var io=require(_0x11b1('0x7'))(new Redis(config[_0x11b1('0x4')]));function ChatQueue(_0x49eff2){this['id']=_0x49eff2['id']||0x0;this[_0x11b1('0x8')]=_0x49eff2[_0x11b1('0x8')]||'';this[_0x11b1('0x9')]=_0x49eff2[_0x11b1('0x9')]||0xa;this[_0x11b1('0xa')]=_0x49eff2[_0x11b1('0xa')]||_0x11b1('0xb');this[_0x11b1('0xc')]=_0x49eff2['Agents'];this[_0x11b1('0xd')]={};this[_0x11b1('0xe')]=0x0;this[_0x11b1('0x0')]='';this[_0x11b1('0xf')]();this['updateRealtime']();}ChatQueue[_0x11b1('0x10')][_0x11b1('0xf')]=function(){var _0x1c27ac=this[_0x11b1('0xd')][_0x11b1('0x11')];this[_0x11b1('0xd')]=_[_0x11b1('0x12')](this[_0x11b1('0xc')],'id');this['mapAgentsId'][_0x11b1('0x11')]=_0x1c27ac;};ChatQueue[_0x11b1('0x10')][_0x11b1('0x13')]=function(){this[_0x11b1('0x14')]=0x0;this[_0x11b1('0x15')]=0x0;for(var _0x4fff1d=0x0;_0x4fff1d=0x0?this[_0x11b1('0x16')]:0x0;var _0x5a75fc={'id':this['id'],'available':this['available'],'loggedIn':this[_0x11b1('0x14')],'name':this[_0x11b1('0x8')],'paused':this[_0x11b1('0x15')],'waiting':this[_0x11b1('0xe')]};var _0x4b8d58=md5(JSON[_0x11b1('0x17')](_0x5a75fc));if(this[_0x11b1('0x0')]!==_0x4b8d58){this[_0x11b1('0x0')]=_0x4b8d58;io['to'](util['format'](_0x11b1('0x18'),_0x5a75fc[_0x11b1('0x8')]))[_0x11b1('0x19')](_0x11b1('0x1a'),_0x5a75fc);}};module[_0x11b1('0x1b')]=ChatQueue; \ No newline at end of file +var _0x8ee9=['updateRouting','updateRealtime','_rr','prototype','loggedIn','length','online','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x353acd,_0x41840a){var _0xf04d94=function(_0x5477f5){while(--_0x5477f5){_0x353acd['push'](_0x353acd['shift']());}};_0xf04d94(++_0x41840a);}(_0x8ee9,0x1c2));var _0x98ee=function(_0x100a4c,_0x5b88dc){_0x100a4c=_0x100a4c-0x0;var _0x201757=_0x8ee9[_0x100a4c];return _0x201757;};'use strict';var _=require(_0x98ee('0x0'));var md5=require(_0x98ee('0x1'));var util=require(_0x98ee('0x2'));var Redis=require(_0x98ee('0x3'));var config=require(_0x98ee('0x4'));config['redis']=_[_0x98ee('0x5')](config[_0x98ee('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x98ee('0x6')]));function ChatQueue(_0x1a397d){this['id']=_0x1a397d['id']||0x0;this[_0x98ee('0x7')]=_0x1a397d['name']||'';this['timeout']=_0x1a397d[_0x98ee('0x8')]||0xa;this[_0x98ee('0x9')]=_0x1a397d[_0x98ee('0x9')]||_0x98ee('0xa');this[_0x98ee('0xb')]=_0x1a397d[_0x98ee('0xb')];this[_0x98ee('0xc')]={};this[_0x98ee('0xd')]=0x0;this['md5']='';this[_0x98ee('0xe')]();this[_0x98ee('0xf')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x40c6a4=this[_0x98ee('0xc')][_0x98ee('0x10')];this[_0x98ee('0xc')]=_['map'](this[_0x98ee('0xb')],'id');this[_0x98ee('0xc')]['_rr']=_0x40c6a4;};ChatQueue[_0x98ee('0x11')][_0x98ee('0xf')]=function(){this[_0x98ee('0x12')]=0x0;this['paused']=0x0;for(var _0x5f055d=0x0;_0x5f055d=0x0?this[_0x98ee('0x16')]:0x0;var _0x16f46a={'id':this['id'],'available':this[_0x98ee('0x16')],'loggedIn':this[_0x98ee('0x12')],'name':this[_0x98ee('0x7')],'paused':this['paused'],'waiting':this[_0x98ee('0xd')]};var _0x2e1a07=md5(JSON[_0x98ee('0x17')](_0x16f46a));if(this[_0x98ee('0x1')]!==_0x2e1a07){this['md5']=_0x2e1a07;io['to'](util[_0x98ee('0x18')](_0x98ee('0x19'),_0x16f46a[_0x98ee('0x7')]))[_0x98ee('0x1a')](_0x98ee('0x1b'),_0x16f46a);}};module[_0x98ee('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index b4c3d9c..fb37884 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 _0xafe9=['util','ioredis','../../../config/environment','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','length','online','paused','available','stringify','emit','fax_queue:save','lodash','md5'];(function(_0x50476d,_0x1ce4cd){var _0x1fdab4=function(_0x144248){while(--_0x144248){_0x50476d['push'](_0x50476d['shift']());}};_0x1fdab4(++_0x1ce4cd);}(_0xafe9,0x7b));var _0x9afe=function(_0x22fc45,_0x5d9aae){_0x22fc45=_0x22fc45-0x0;var _0x21e884=_0xafe9[_0x22fc45];return _0x21e884;};'use strict';var _=require(_0x9afe('0x0'));var md5=require(_0x9afe('0x1'));var util=require(_0x9afe('0x2'));var Redis=require(_0x9afe('0x3'));var config=require(_0x9afe('0x4'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9afe('0x5'))(new Redis(config[_0x9afe('0x6')]));function FaxQueue(_0x4605a4){this['id']=_0x4605a4['id']||0x0;this[_0x9afe('0x7')]=_0x4605a4[_0x9afe('0x7')]||'';this[_0x9afe('0x8')]=_0x4605a4[_0x9afe('0x8')]||0xa;this[_0x9afe('0x9')]=_0x4605a4['strategy']||_0x9afe('0xa');this['Agents']=_0x4605a4[_0x9afe('0xb')];this[_0x9afe('0xc')]={};this[_0x9afe('0xd')]=0x0;this[_0x9afe('0x1')]='';this[_0x9afe('0xe')]();this[_0x9afe('0xf')]();}FaxQueue[_0x9afe('0x10')]['updateRouting']=function(){var _0x41989a=this[_0x9afe('0xc')]['_rr'];this['mapAgentsId']=_[_0x9afe('0x11')](this[_0x9afe('0xb')],'id');this['mapAgentsId']['_rr']=_0x41989a;};FaxQueue[_0x9afe('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x4fa490=0x0;_0x4fa490=0x0?this[_0x9afe('0x15')]:0x0;var _0x22cb9f={'id':this['id'],'available':this[_0x9afe('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x9afe('0x7')],'paused':this[_0x9afe('0x14')],'waiting':this[_0x9afe('0xd')]};var _0x4b5686=md5(JSON[_0x9afe('0x16')](_0x22cb9f));if(this[_0x9afe('0x1')]!==_0x4b5686){this[_0x9afe('0x1')]=_0x4b5686;io['to'](util['format']('fax:queue:%s',_0x22cb9f[_0x9afe('0x7')]))[_0x9afe('0x17')](_0x9afe('0x18'),_0x22cb9f);}};module['exports']=FaxQueue; \ No newline at end of file +var _0xe7e0=['lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','map','_rr','prototype','loggedIn','paused','length','online','available','format','fax:queue:%s','exports'];(function(_0x35cc29,_0x41c298){var _0x11b2b0=function(_0x1a19a4){while(--_0x1a19a4){_0x35cc29['push'](_0x35cc29['shift']());}};_0x11b2b0(++_0x41c298);}(_0xe7e0,0x1d4));var _0x0e7e=function(_0x2bcb27,_0x5c3bc2){_0x2bcb27=_0x2bcb27-0x0;var _0x3b9499=_0xe7e0[_0x2bcb27];return _0x3b9499;};'use strict';var _=require(_0x0e7e('0x0'));var md5=require(_0x0e7e('0x1'));var util=require('util');var Redis=require(_0x0e7e('0x2'));var config=require(_0x0e7e('0x3'));config[_0x0e7e('0x4')]=_[_0x0e7e('0x5')](config['redis'],{'host':_0x0e7e('0x6'),'port':0x18eb});var io=require(_0x0e7e('0x7'))(new Redis(config[_0x0e7e('0x4')]));function FaxQueue(_0x5c7a3a){this['id']=_0x5c7a3a['id']||0x0;this[_0x0e7e('0x8')]=_0x5c7a3a[_0x0e7e('0x8')]||'';this[_0x0e7e('0x9')]=_0x5c7a3a[_0x0e7e('0x9')]||0xa;this[_0x0e7e('0xa')]=_0x5c7a3a[_0x0e7e('0xa')]||'beepall';this[_0x0e7e('0xb')]=_0x5c7a3a['Agents'];this[_0x0e7e('0xc')]={};this[_0x0e7e('0xd')]=0x0;this[_0x0e7e('0x1')]='';this[_0x0e7e('0xe')]();this['updateRealtime']();}FaxQueue['prototype']['updateRouting']=function(){var _0x5b9306=this[_0x0e7e('0xc')]['_rr'];this[_0x0e7e('0xc')]=_[_0x0e7e('0xf')](this[_0x0e7e('0xb')],'id');this['mapAgentsId'][_0x0e7e('0x10')]=_0x5b9306;};FaxQueue[_0x0e7e('0x11')]['updateRealtime']=function(){this[_0x0e7e('0x12')]=0x0;this[_0x0e7e('0x13')]=0x0;for(var _0x54b127=0x0;_0x54b127=0x0?this[_0x0e7e('0x16')]:0x0;var _0x2df3c7={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0e7e('0x12')],'name':this[_0x0e7e('0x8')],'paused':this['paused'],'waiting':this[_0x0e7e('0xd')]};var _0x38d8f2=md5(JSON['stringify'](_0x2df3c7));if(this['md5']!==_0x38d8f2){this[_0x0e7e('0x1')]=_0x38d8f2;io['to'](util[_0x0e7e('0x17')](_0x0e7e('0x18'),_0x2df3c7[_0x0e7e('0x8')]))['emit']('fax_queue:save',_0x2df3c7);}};module[_0x0e7e('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 88cce49..b1f78d1 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 _0x9b28=['name','Intervals','exports'];(function(_0x36e50a,_0x294876){var _0x5f572b=function(_0x5dfcf5){while(--_0x5dfcf5){_0x36e50a['push'](_0x36e50a['shift']());}};_0x5f572b(++_0x294876);}(_0x9b28,0x1b3));var _0x89b2=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0x9b28[_0x498334];return _0x13bb70;};'use strict';function Interval(_0x4d9447){this['id']=_0x4d9447['id']||0x0;this[_0x89b2('0x0')]=_0x4d9447['name']||'';this[_0x89b2('0x1')]=_0x4d9447['Intervals']||{};}module[_0x89b2('0x2')]=Interval; \ No newline at end of file +var _0x9d31=['Intervals','name'];(function(_0x301c69,_0x54a617){var _0x5826f3=function(_0x2ca700){while(--_0x2ca700){_0x301c69['push'](_0x301c69['shift']());}};_0x5826f3(++_0x54a617);}(_0x9d31,0x175));var _0x19d3=function(_0x1fbb19,_0x4ef431){_0x1fbb19=_0x1fbb19-0x0;var _0x44eab2=_0x9d31[_0x1fbb19];return _0x44eab2;};'use strict';function Interval(_0x88935b){this['id']=_0x88935b['id']||0x0;this[_0x19d3('0x0')]=_0x88935b[_0x19d3('0x0')]||'';this[_0x19d3('0x1')]=_0x88935b['Intervals']||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 0d9233d..53792f8 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 _0xbea5=['loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','name','timeout','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map'];(function(_0x23ccb9,_0x32927f){var _0x3e7833=function(_0x4e5f0a){while(--_0x4e5f0a){_0x23ccb9['push'](_0x23ccb9['shift']());}};_0x3e7833(++_0x32927f);}(_0xbea5,0x177));var _0x5bea=function(_0x4884a7,_0x18e38a){_0x4884a7=_0x4884a7-0x0;var _0x56b60e=_0xbea5[_0x4884a7];return _0x56b60e;};'use strict';var _=require(_0x5bea('0x0'));var md5=require(_0x5bea('0x1'));var util=require('util');var Redis=require(_0x5bea('0x2'));var config=require(_0x5bea('0x3'));config[_0x5bea('0x4')]=_[_0x5bea('0x5')](config[_0x5bea('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5bea('0x4')]));function MailQueue(_0x542dfc){this['id']=_0x542dfc['id']||0x0;this[_0x5bea('0x6')]=_0x542dfc['name']||'';this['timeout']=_0x542dfc[_0x5bea('0x7')]||0xa;this['strategy']=_0x542dfc['strategy']||_0x5bea('0x8');this[_0x5bea('0x9')]=_0x542dfc[_0x5bea('0x9')];this['mapAgentsId']={};this[_0x5bea('0xa')]=0x0;this['md5']='';this['updateRouting']();this[_0x5bea('0xb')]();}MailQueue[_0x5bea('0xc')][_0x5bea('0xd')]=function(){var _0x71e4eb=this[_0x5bea('0xe')][_0x5bea('0xf')];this['mapAgentsId']=_[_0x5bea('0x10')](this[_0x5bea('0x9')],'id');this['mapAgentsId'][_0x5bea('0xf')]=_0x71e4eb;};MailQueue[_0x5bea('0xc')]['updateRealtime']=function(){this[_0x5bea('0x11')]=0x0;this[_0x5bea('0x12')]=0x0;for(var _0x26cfca=0x0;_0x26cfca=0x0?this['available']:0x0;var _0x1bf374={'id':this['id'],'available':this[_0x5bea('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x5bea('0x6')],'paused':this['paused'],'waiting':this[_0x5bea('0xa')]};var _0x358ad0=md5(JSON[_0x5bea('0x17')](_0x1bf374));if(this['md5']!==_0x358ad0){this['md5']=_0x358ad0;io['to'](util[_0x5bea('0x18')](_0x5bea('0x19'),_0x1bf374[_0x5bea('0x6')]))['emit'](_0x5bea('0x1a'),_0x1bf374);}};module[_0x5bea('0x1b')]=MailQueue; \ No newline at end of file +var _0x7804=['util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','beepall','mapAgentsId','waiting','md5','updateRouting','map','Agents','_rr','prototype','paused','length','online','available','loggedIn','format','mail:queue:%s','emit','mail_queue:save','exports','lodash'];(function(_0x3efbb7,_0x25ad5e){var _0x1dc543=function(_0x5aca8d){while(--_0x5aca8d){_0x3efbb7['push'](_0x3efbb7['shift']());}};_0x1dc543(++_0x25ad5e);}(_0x7804,0xc3));var _0x4780=function(_0x12812b,_0x2da778){_0x12812b=_0x12812b-0x0;var _0x3e64b5=_0x7804[_0x12812b];return _0x3e64b5;};'use strict';var _=require(_0x4780('0x0'));var md5=require('md5');var util=require(_0x4780('0x1'));var Redis=require(_0x4780('0x2'));var config=require(_0x4780('0x3'));config['redis']=_[_0x4780('0x4')](config[_0x4780('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4780('0x5')]));function MailQueue(_0x4f3cd5){this['id']=_0x4f3cd5['id']||0x0;this['name']=_0x4f3cd5[_0x4780('0x6')]||'';this[_0x4780('0x7')]=_0x4f3cd5[_0x4780('0x7')]||0xa;this[_0x4780('0x8')]=_0x4f3cd5['strategy']||_0x4780('0x9');this['Agents']=_0x4f3cd5['Agents'];this[_0x4780('0xa')]={};this[_0x4780('0xb')]=0x0;this[_0x4780('0xc')]='';this[_0x4780('0xd')]();this['updateRealtime']();}MailQueue['prototype'][_0x4780('0xd')]=function(){var _0x1d7907=this[_0x4780('0xa')]['_rr'];this['mapAgentsId']=_[_0x4780('0xe')](this[_0x4780('0xf')],'id');this[_0x4780('0xa')][_0x4780('0x10')]=_0x1d7907;};MailQueue[_0x4780('0x11')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x4780('0x12')]=0x0;for(var _0x562fcc=0x0;_0x562fcc=0x0?this['available']:0x0;var _0x143588={'id':this['id'],'available':this[_0x4780('0x15')],'loggedIn':this[_0x4780('0x16')],'name':this[_0x4780('0x6')],'paused':this['paused'],'waiting':this[_0x4780('0xb')]};var _0xc1f0a8=md5(JSON['stringify'](_0x143588));if(this[_0x4780('0xc')]!==_0xc1f0a8){this[_0x4780('0xc')]=_0xc1f0a8;io['to'](util[_0x4780('0x17')](_0x4780('0x18'),_0x143588[_0x4780('0x6')]))[_0x4780('0x19')](_0x4780('0x1a'),_0x143588);}};module[_0x4780('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 3ff8eb4..9425294 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 _0xb5fa=['util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','online','openchannelPause','paused','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','md5'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb5fa,0x187));var _0xab5f=function(_0x2b7e66,_0x42f27e){_0x2b7e66=_0x2b7e66-0x0;var _0x41916c=_0xb5fa[_0x2b7e66];return _0x41916c;};'use strict';var _=require('lodash');var md5=require(_0xab5f('0x0'));var util=require(_0xab5f('0x1'));var Redis=require(_0xab5f('0x2'));var config=require(_0xab5f('0x3'));config[_0xab5f('0x4')]=_['defaults'](config[_0xab5f('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xab5f('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x546b08){this['id']=_0x546b08['id']||0x0;this['name']=_0x546b08[_0xab5f('0x6')]||'';this[_0xab5f('0x7')]=_0x546b08[_0xab5f('0x7')]||0xa;this[_0xab5f('0x8')]=_0x546b08['strategy']||_0xab5f('0x9');this[_0xab5f('0xa')]=_0x546b08[_0xab5f('0xa')];this[_0xab5f('0xb')]={};this[_0xab5f('0xc')]=0x0;this[_0xab5f('0x0')]='';this[_0xab5f('0xd')]();this[_0xab5f('0xe')]();}OpenchannelQueue[_0xab5f('0xf')]['updateRouting']=function(){var _0x235455=this['mapAgentsId']['_rr'];this[_0xab5f('0xb')]=_['map'](this[_0xab5f('0xa')],'id');this[_0xab5f('0xb')][_0xab5f('0x10')]=_0x235455;};OpenchannelQueue[_0xab5f('0xf')][_0xab5f('0xe')]=function(){this[_0xab5f('0x11')]=0x0;this['paused']=0x0;for(var _0x219cc3=0x0;_0x219cc3=0x0?this['available']:0x0;var _0x5e760d={'id':this['id'],'available':this[_0xab5f('0x16')],'loggedIn':this[_0xab5f('0x11')],'name':this[_0xab5f('0x6')],'paused':this[_0xab5f('0x15')],'waiting':this[_0xab5f('0xc')]};var _0x132c8a=md5(JSON[_0xab5f('0x17')](_0x5e760d));if(this['md5']!==_0x132c8a){this[_0xab5f('0x0')]=_0x132c8a;io['to'](util[_0xab5f('0x18')](_0xab5f('0x19'),_0x5e760d[_0xab5f('0x6')]))[_0xab5f('0x1a')](_0xab5f('0x1b'),_0x5e760d);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x9f3e=['paused','length','online','loggedIn','openchannelPause','available','format','openchannel:queue:%s','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','map','prototype','updateRealtime'];(function(_0x2920c3,_0x141aed){var _0x1464a5=function(_0x4d749f){while(--_0x4d749f){_0x2920c3['push'](_0x2920c3['shift']());}};_0x1464a5(++_0x141aed);}(_0x9f3e,0x12d));var _0xe9f3=function(_0x4cd3aa,_0x1cff67){_0x4cd3aa=_0x4cd3aa-0x0;var _0x2b6126=_0x9f3e[_0x4cd3aa];return _0x2b6126;};'use strict';var _=require(_0xe9f3('0x0'));var md5=require(_0xe9f3('0x1'));var util=require('util');var Redis=require(_0xe9f3('0x2'));var config=require(_0xe9f3('0x3'));config['redis']=_['defaults'](config[_0xe9f3('0x4')],{'host':_0xe9f3('0x5'),'port':0x18eb});var io=require(_0xe9f3('0x6'))(new Redis(config[_0xe9f3('0x4')]));function OpenchannelQueue(_0x23fe71){this['id']=_0x23fe71['id']||0x0;this[_0xe9f3('0x7')]=_0x23fe71[_0xe9f3('0x7')]||'';this[_0xe9f3('0x8')]=_0x23fe71[_0xe9f3('0x8')]||0xa;this[_0xe9f3('0x9')]=_0x23fe71[_0xe9f3('0x9')]||_0xe9f3('0xa');this[_0xe9f3('0xb')]=_0x23fe71[_0xe9f3('0xb')];this[_0xe9f3('0xc')]={};this[_0xe9f3('0xd')]=0x0;this[_0xe9f3('0x1')]='';this[_0xe9f3('0xe')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0xe9f3('0xe')]=function(){var _0xa1def6=this[_0xe9f3('0xc')]['_rr'];this[_0xe9f3('0xc')]=_[_0xe9f3('0xf')](this[_0xe9f3('0xb')],'id');this[_0xe9f3('0xc')]['_rr']=_0xa1def6;};OpenchannelQueue[_0xe9f3('0x10')][_0xe9f3('0x11')]=function(){this['loggedIn']=0x0;this[_0xe9f3('0x12')]=0x0;for(var _0x41fc67=0x0;_0x41fc67=0x0?this['available']:0x0;var _0x14f10e={'id':this['id'],'available':this[_0xe9f3('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xe9f3('0x12')],'waiting':this['waiting']};var _0x372485=md5(JSON['stringify'](_0x14f10e));if(this[_0xe9f3('0x1')]!==_0x372485){this[_0xe9f3('0x1')]=_0x372485;io['to'](util[_0xe9f3('0x18')](_0xe9f3('0x19'),_0x14f10e[_0xe9f3('0x7')]))[_0xe9f3('0x1a')](_0xe9f3('0x1b'),_0x14f10e);}};module[_0xe9f3('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index c374649..84dd7c7 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 _0x8038=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','format','emit','sms_queue:save','exports','md5','../../../config/environment','redis','defaults'];(function(_0x396d83,_0x373eb9){var _0x3ab4f7=function(_0x46034d){while(--_0x46034d){_0x396d83['push'](_0x396d83['shift']());}};_0x3ab4f7(++_0x373eb9);}(_0x8038,0x1af));var _0x8803=function(_0x1ecb7c,_0x5ab8b7){_0x1ecb7c=_0x1ecb7c-0x0;var _0x259e85=_0x8038[_0x1ecb7c];return _0x259e85;};'use strict';var _=require('lodash');var md5=require(_0x8803('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x8803('0x1'));config[_0x8803('0x2')]=_[_0x8803('0x3')](config['redis'],{'host':_0x8803('0x4'),'port':0x18eb});var io=require(_0x8803('0x5'))(new Redis(config[_0x8803('0x2')]));function SmsQueue(_0x38baa9){this['id']=_0x38baa9['id']||0x0;this[_0x8803('0x6')]=_0x38baa9['name']||'';this['timeout']=_0x38baa9[_0x8803('0x7')]||0xa;this[_0x8803('0x8')]=_0x38baa9[_0x8803('0x8')]||_0x8803('0x9');this[_0x8803('0xa')]=_0x38baa9[_0x8803('0xa')];this[_0x8803('0xb')]={};this[_0x8803('0xc')]=0x0;this['md5']='';this[_0x8803('0xd')]();this[_0x8803('0xe')]();}SmsQueue[_0x8803('0xf')][_0x8803('0xd')]=function(){var _0x22e763=this[_0x8803('0xb')][_0x8803('0x10')];this[_0x8803('0xb')]=_[_0x8803('0x11')](this['Agents'],'id');this[_0x8803('0xb')][_0x8803('0x10')]=_0x22e763;};SmsQueue[_0x8803('0xf')][_0x8803('0xe')]=function(){this[_0x8803('0x12')]=0x0;this[_0x8803('0x13')]=0x0;for(var _0x55be86=0x0;_0x55be86=0x0?this[_0x8803('0x17')]:0x0;var _0x2237f6={'id':this['id'],'available':this[_0x8803('0x17')],'loggedIn':this[_0x8803('0x12')],'name':this[_0x8803('0x6')],'paused':this[_0x8803('0x13')],'waiting':this['waiting']};var _0x3acf6e=md5(JSON[_0x8803('0x18')](_0x2237f6));if(this['md5']!==_0x3acf6e){this[_0x8803('0x0')]=_0x3acf6e;io['to'](util[_0x8803('0x19')]('sms:queue:%s',_0x2237f6[_0x8803('0x6')]))[_0x8803('0x1a')](_0x8803('0x1b'),_0x2237f6);}};module[_0x8803('0x1c')]=SmsQueue; \ No newline at end of file +var _0x181c=['Agents','prototype','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map'];(function(_0x35f4f6,_0x29131d){var _0x516d9f=function(_0x281f97){while(--_0x281f97){_0x35f4f6['push'](_0x35f4f6['shift']());}};_0x516d9f(++_0x29131d);}(_0x181c,0xa9));var _0xc181=function(_0x4bc428,_0xf56dd9){_0x4bc428=_0x4bc428-0x0;var _0x3ca37f=_0x181c[_0x4bc428];return _0x3ca37f;};'use strict';var _=require(_0xc181('0x0'));var md5=require(_0xc181('0x1'));var util=require(_0xc181('0x2'));var Redis=require('ioredis');var config=require(_0xc181('0x3'));config[_0xc181('0x4')]=_[_0xc181('0x5')](config[_0xc181('0x4')],{'host':_0xc181('0x6'),'port':0x18eb});var io=require(_0xc181('0x7'))(new Redis(config[_0xc181('0x4')]));function SmsQueue(_0x3c0295){this['id']=_0x3c0295['id']||0x0;this[_0xc181('0x8')]=_0x3c0295[_0xc181('0x8')]||'';this[_0xc181('0x9')]=_0x3c0295['timeout']||0xa;this['strategy']=_0x3c0295[_0xc181('0xa')]||'beepall';this['Agents']=_0x3c0295['Agents'];this[_0xc181('0xb')]={};this[_0xc181('0xc')]=0x0;this[_0xc181('0x1')]='';this[_0xc181('0xd')]();this[_0xc181('0xe')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x127727=this[_0xc181('0xb')][_0xc181('0xf')];this[_0xc181('0xb')]=_[_0xc181('0x10')](this[_0xc181('0x11')],'id');this[_0xc181('0xb')][_0xc181('0xf')]=_0x127727;};SmsQueue[_0xc181('0x12')][_0xc181('0xe')]=function(){this[_0xc181('0x13')]=0x0;this[_0xc181('0x14')]=0x0;for(var _0x3dd131=0x0;_0x3dd131=0x0?this[_0xc181('0x18')]:0x0;var _0x43edaf={'id':this['id'],'available':this[_0xc181('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xc181('0x8')],'paused':this[_0xc181('0x14')],'waiting':this['waiting']};var _0x3a6fe7=md5(JSON[_0xc181('0x19')](_0x43edaf));if(this[_0xc181('0x1')]!==_0x3a6fe7){this[_0xc181('0x1')]=_0x3a6fe7;io['to'](util[_0xc181('0x1a')](_0xc181('0x1b'),_0x43edaf['name']))[_0xc181('0x1c')](_0xc181('0x1d'),_0x43edaf);}};module[_0xc181('0x1e')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 3c67d22..98a7be8 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 _0xae44=['../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','openchannelQueues','chatQueues','mailQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','initIntervals','initOpenchannelQueues','updateRouting','updateRealtime','initSmsQueues','smsQueues','initMailQueues','initFaxQueues','bluebird','util','lodash','../model/agent','../model/openchannelQueue'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xae44,0xb5));var _0x4ae4=function(_0x115ef0,_0x5a83b2){_0x115ef0=_0x115ef0-0x0;var _0x420f5a=_0xae44[_0x115ef0];return _0x420f5a;};'use strict';var BPromise=require(_0x4ae4('0x0'));var util=require(_0x4ae4('0x1'));var _=require(_0x4ae4('0x2'));var moment=require('moment');var Agent=require(_0x4ae4('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0x4ae4('0x4'));var ChatQueue=require(_0x4ae4('0x5'));var SmsQueue=require(_0x4ae4('0x6'));var MailQueue=require(_0x4ae4('0x7'));var FaxQueue=require(_0x4ae4('0x8'));var Realtime=function(){this[_0x4ae4('0x9')]={};this[_0x4ae4('0xa')]={};this[_0x4ae4('0xb')]={};this[_0x4ae4('0xc')]={};this['smsQueues']={};this[_0x4ae4('0xd')]={};this[_0x4ae4('0xe')]={};this['chatQueuesWaitingInteractions']={};this[_0x4ae4('0xf')]={};this[_0x4ae4('0x10')]={};this['smsQueuesWaitingInteractions']={};this[_0x4ae4('0x11')]={};};function freeIsNotKey(_0x57c2e7,_0x4cd5d7,_0x696e71){var _0x2d30d5=_['mapKeys'](_0x57c2e7,function(_0x46f999,_0x104403){return _0x46f999[_0x696e71];});for(var _0x4d8c1e in _0x4cd5d7){if(_0x4cd5d7[_0x4ae4('0x12')](_0x4d8c1e)){if(!_0x2d30d5[_0x4d8c1e]){delete _0x4cd5d7[_0x4d8c1e];}}}}Realtime[_0x4ae4('0x13')][_0x4ae4('0x14')]=function(_0x3a5dd6,_0x1f87fd){for(var _0x45c7f3 in _0x1f87fd){if(_0x3a5dd6[_0x4ae4('0x12')](_0x45c7f3)){_0x3a5dd6[_0x45c7f3]=_0x1f87fd[_0x45c7f3];}}};Realtime[_0x4ae4('0x13')]['initAgents']=function(){var _0x4a8366=this;return function(_0x3d45fa){if(_0x3d45fa){freeIsNotKey(_0x3d45fa,_0x4a8366[_0x4ae4('0x9')],'id');for(var _0x3e3520=0x0,_0x55282d={},_0x56895d={};_0x3e3520<_0x3d45fa[_0x4ae4('0x15')];_0x3e3520+=0x1){_0x55282d=_0x3d45fa[_0x3e3520];if(_[_0x4ae4('0x16')](_0x4a8366[_0x4ae4('0x9')][_0x55282d['id']])){_0x4a8366[_0x4ae4('0x9')][_0x55282d['id']]=new Agent(_0x55282d);}else{_0x4a8366['mergeFromDatabase'](_0x4a8366[_0x4ae4('0x9')][_0x55282d['id']],_0x55282d);}}}return _0x4a8366['agents'];};};Realtime[_0x4ae4('0x13')][_0x4ae4('0x17')]=function(){var _0x53586c=this;return function(_0x199daf){if(_0x199daf){freeIsNotKey(_0x199daf,_0x53586c['intervals'],'id');for(var _0x29c057=0x0,_0x320e1a={},_0x3d53ee={};_0x29c057<_0x199daf[_0x4ae4('0x15')];_0x29c057+=0x1){_0x320e1a=_0x199daf[_0x29c057];if(_[_0x4ae4('0x16')](_0x53586c['intervals'][_0x320e1a['id']])){_0x53586c['intervals'][_0x320e1a['id']]=new Interval(_0x320e1a);}else{_0x53586c['mergeFromDatabase'](_0x53586c[_0x4ae4('0xa')][_0x320e1a['id']],_0x320e1a);}}}return _0x53586c[_0x4ae4('0xa')];};};Realtime['prototype'][_0x4ae4('0x18')]=function(){var _0x51d38e=this;return function(_0x1e440e){if(_0x1e440e){freeIsNotKey(_0x1e440e,_0x51d38e[_0x4ae4('0xb')],'id');for(var _0x39ae4b=0x0,_0x4a9a23={},_0x746b0b={};_0x39ae4b<_0x1e440e['length'];_0x39ae4b+=0x1){_0x4a9a23=_0x1e440e[_0x39ae4b];if(_['isUndefined'](_0x51d38e['openchannelQueues'][_0x4a9a23['id']])){_0x51d38e[_0x4ae4('0xb')][_0x4a9a23['id']]=new OpenchannelQueue(_0x4a9a23);}else{_0x51d38e[_0x4ae4('0x14')](_0x51d38e[_0x4ae4('0xb')][_0x4a9a23['id']],_0x4a9a23);}_0x51d38e[_0x4ae4('0xb')][_0x4a9a23['id']][_0x4ae4('0x19')]();_0x51d38e[_0x4ae4('0xb')][_0x4a9a23['id']][_0x4ae4('0x1a')]();}}return _0x51d38e[_0x4ae4('0xb')];};};Realtime[_0x4ae4('0x13')]['initChatQueues']=function(){var _0x430b77=this;return function(_0x3a3a3d){if(_0x3a3a3d){freeIsNotKey(_0x3a3a3d,_0x430b77[_0x4ae4('0xc')],'id');for(var _0x4a1130=0x0,_0x209244={},_0x56101e={};_0x4a1130<_0x3a3a3d[_0x4ae4('0x15')];_0x4a1130+=0x1){_0x209244=_0x3a3a3d[_0x4a1130];if(_['isUndefined'](_0x430b77[_0x4ae4('0xc')][_0x209244['id']])){_0x430b77[_0x4ae4('0xc')][_0x209244['id']]=new ChatQueue(_0x209244);}else{_0x430b77[_0x4ae4('0x14')](_0x430b77[_0x4ae4('0xc')][_0x209244['id']],_0x209244);}_0x430b77['chatQueues'][_0x209244['id']]['updateRouting']();_0x430b77['chatQueues'][_0x209244['id']]['updateRealtime']();}}return _0x430b77[_0x4ae4('0xc')];};};Realtime[_0x4ae4('0x13')][_0x4ae4('0x1b')]=function(){var _0x356351=this;return function(_0xf9f2b7){if(_0xf9f2b7){freeIsNotKey(_0xf9f2b7,_0x356351['smsQueues'],'id');for(var _0x31c266=0x0,_0x4da1ec={},_0x351a94={};_0x31c266<_0xf9f2b7['length'];_0x31c266+=0x1){_0x4da1ec=_0xf9f2b7[_0x31c266];if(_['isUndefined'](_0x356351[_0x4ae4('0x1c')][_0x4da1ec['id']])){_0x356351[_0x4ae4('0x1c')][_0x4da1ec['id']]=new SmsQueue(_0x4da1ec);}else{_0x356351[_0x4ae4('0x14')](_0x356351['smsQueues'][_0x4da1ec['id']],_0x4da1ec);}_0x356351['smsQueues'][_0x4da1ec['id']][_0x4ae4('0x19')]();_0x356351[_0x4ae4('0x1c')][_0x4da1ec['id']][_0x4ae4('0x1a')]();}}return _0x356351[_0x4ae4('0x1c')];};};Realtime[_0x4ae4('0x13')][_0x4ae4('0x1d')]=function(){var _0xb9c47c=this;return function(_0x20611d){if(_0x20611d){freeIsNotKey(_0x20611d,_0xb9c47c['mailQueues'],'id');for(var _0x942c83=0x0,_0x5296a4={},_0xebd937={};_0x942c83<_0x20611d[_0x4ae4('0x15')];_0x942c83+=0x1){_0x5296a4=_0x20611d[_0x942c83];if(_[_0x4ae4('0x16')](_0xb9c47c[_0x4ae4('0xd')][_0x5296a4['id']])){_0xb9c47c[_0x4ae4('0xd')][_0x5296a4['id']]=new MailQueue(_0x5296a4);}else{_0xb9c47c[_0x4ae4('0x14')](_0xb9c47c['mailQueues'][_0x5296a4['id']],_0x5296a4);}_0xb9c47c[_0x4ae4('0xd')][_0x5296a4['id']][_0x4ae4('0x19')]();_0xb9c47c['mailQueues'][_0x5296a4['id']][_0x4ae4('0x1a')]();}}return _0xb9c47c['mailQueues'];};};Realtime[_0x4ae4('0x13')][_0x4ae4('0x1e')]=function(){var _0xf9d86d=this;return function(_0x9c6fd8){if(_0x9c6fd8){freeIsNotKey(_0x9c6fd8,_0xf9d86d[_0x4ae4('0xe')],'id');for(var _0x265c10=0x0,_0x52f86a={},_0x5d4edc={};_0x265c10<_0x9c6fd8[_0x4ae4('0x15')];_0x265c10+=0x1){_0x52f86a=_0x9c6fd8[_0x265c10];if(_['isUndefined'](_0xf9d86d[_0x4ae4('0xe')][_0x52f86a['id']])){_0xf9d86d[_0x4ae4('0xe')][_0x52f86a['id']]=new FaxQueue(_0x52f86a);}else{_0xf9d86d[_0x4ae4('0x14')](_0xf9d86d[_0x4ae4('0xe')][_0x52f86a['id']],_0x52f86a);}_0xf9d86d['faxQueues'][_0x52f86a['id']]['updateRouting']();_0xf9d86d[_0x4ae4('0xe')][_0x52f86a['id']][_0x4ae4('0x1a')]();}}return _0xf9d86d[_0x4ae4('0xe')];};};module['exports']=Realtime; \ No newline at end of file +var _0x0bad=['chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','length','isUndefined','initOpenchannelQueues','updateRealtime','initChatQueues','updateRouting','initMailQueues','mailQueues','initFaxQueues','faxQueues','exports','bluebird','util','lodash','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/faxQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0x0bad,0x133));var _0xd0ba=function(_0x3f448b,_0x1c4055){_0x3f448b=_0x3f448b-0x0;var _0x104efd=_0x0bad[_0x3f448b];return _0x104efd;};'use strict';var BPromise=require(_0xd0ba('0x0'));var util=require(_0xd0ba('0x1'));var _=require(_0xd0ba('0x2'));var moment=require('moment');var Agent=require(_0xd0ba('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xd0ba('0x4'));var ChatQueue=require(_0xd0ba('0x5'));var SmsQueue=require(_0xd0ba('0x6'));var MailQueue=require('../model/mailQueue');var FaxQueue=require(_0xd0ba('0x7'));var Realtime=function(){this[_0xd0ba('0x8')]={};this[_0xd0ba('0x9')]={};this[_0xd0ba('0xa')]={};this[_0xd0ba('0xb')]={};this[_0xd0ba('0xc')]={};this['mailQueues']={};this['faxQueues']={};this[_0xd0ba('0xd')]={};this[_0xd0ba('0xe')]={};this['openchannelQueuesWaitingInteractions']={};this[_0xd0ba('0xf')]={};this[_0xd0ba('0x10')]={};};function freeIsNotKey(_0xb7ae02,_0x2045b3,_0x4ac1fa){var _0x53497d=_['mapKeys'](_0xb7ae02,function(_0x49ffbe,_0xbfc039){return _0x49ffbe[_0x4ac1fa];});for(var _0x521c83 in _0x2045b3){if(_0x2045b3[_0xd0ba('0x11')](_0x521c83)){if(!_0x53497d[_0x521c83]){delete _0x2045b3[_0x521c83];}}}}Realtime[_0xd0ba('0x12')][_0xd0ba('0x13')]=function(_0x4c16ce,_0x13c761){for(var _0x37bf68 in _0x13c761){if(_0x4c16ce['hasOwnProperty'](_0x37bf68)){_0x4c16ce[_0x37bf68]=_0x13c761[_0x37bf68];}}};Realtime[_0xd0ba('0x12')][_0xd0ba('0x14')]=function(){var _0x5681a3=this;return function(_0x525fa2){if(_0x525fa2){freeIsNotKey(_0x525fa2,_0x5681a3['agents'],'id');for(var _0x3208b2=0x0,_0x11bb78={},_0x2f11ff={};_0x3208b2<_0x525fa2[_0xd0ba('0x15')];_0x3208b2+=0x1){_0x11bb78=_0x525fa2[_0x3208b2];if(_[_0xd0ba('0x16')](_0x5681a3[_0xd0ba('0x8')][_0x11bb78['id']])){_0x5681a3[_0xd0ba('0x8')][_0x11bb78['id']]=new Agent(_0x11bb78);}else{_0x5681a3[_0xd0ba('0x13')](_0x5681a3[_0xd0ba('0x8')][_0x11bb78['id']],_0x11bb78);}}}return _0x5681a3[_0xd0ba('0x8')];};};Realtime['prototype']['initIntervals']=function(){var _0x3b87f6=this;return function(_0x42a71f){if(_0x42a71f){freeIsNotKey(_0x42a71f,_0x3b87f6[_0xd0ba('0x9')],'id');for(var _0x1fa938=0x0,_0x23e694={},_0x3fb6c4={};_0x1fa938<_0x42a71f[_0xd0ba('0x15')];_0x1fa938+=0x1){_0x23e694=_0x42a71f[_0x1fa938];if(_[_0xd0ba('0x16')](_0x3b87f6['intervals'][_0x23e694['id']])){_0x3b87f6['intervals'][_0x23e694['id']]=new Interval(_0x23e694);}else{_0x3b87f6[_0xd0ba('0x13')](_0x3b87f6[_0xd0ba('0x9')][_0x23e694['id']],_0x23e694);}}}return _0x3b87f6[_0xd0ba('0x9')];};};Realtime[_0xd0ba('0x12')][_0xd0ba('0x17')]=function(){var _0x287827=this;return function(_0x4c4ea8){if(_0x4c4ea8){freeIsNotKey(_0x4c4ea8,_0x287827['openchannelQueues'],'id');for(var _0x2a9602=0x0,_0x458883={},_0x409d4b={};_0x2a9602<_0x4c4ea8[_0xd0ba('0x15')];_0x2a9602+=0x1){_0x458883=_0x4c4ea8[_0x2a9602];if(_[_0xd0ba('0x16')](_0x287827[_0xd0ba('0xa')][_0x458883['id']])){_0x287827[_0xd0ba('0xa')][_0x458883['id']]=new OpenchannelQueue(_0x458883);}else{_0x287827[_0xd0ba('0x13')](_0x287827[_0xd0ba('0xa')][_0x458883['id']],_0x458883);}_0x287827[_0xd0ba('0xa')][_0x458883['id']]['updateRouting']();_0x287827['openchannelQueues'][_0x458883['id']][_0xd0ba('0x18')]();}}return _0x287827[_0xd0ba('0xa')];};};Realtime['prototype'][_0xd0ba('0x19')]=function(){var _0x319714=this;return function(_0x785c59){if(_0x785c59){freeIsNotKey(_0x785c59,_0x319714['chatQueues'],'id');for(var _0x4fffd4=0x0,_0x5d0afb={},_0x5230b4={};_0x4fffd4<_0x785c59[_0xd0ba('0x15')];_0x4fffd4+=0x1){_0x5d0afb=_0x785c59[_0x4fffd4];if(_['isUndefined'](_0x319714[_0xd0ba('0xb')][_0x5d0afb['id']])){_0x319714[_0xd0ba('0xb')][_0x5d0afb['id']]=new ChatQueue(_0x5d0afb);}else{_0x319714[_0xd0ba('0x13')](_0x319714[_0xd0ba('0xb')][_0x5d0afb['id']],_0x5d0afb);}_0x319714[_0xd0ba('0xb')][_0x5d0afb['id']]['updateRouting']();_0x319714['chatQueues'][_0x5d0afb['id']][_0xd0ba('0x18')]();}}return _0x319714[_0xd0ba('0xb')];};};Realtime[_0xd0ba('0x12')]['initSmsQueues']=function(){var _0x43103c=this;return function(_0x269d62){if(_0x269d62){freeIsNotKey(_0x269d62,_0x43103c[_0xd0ba('0xc')],'id');for(var _0x650fad=0x0,_0xe620fd={},_0x490df1={};_0x650fad<_0x269d62[_0xd0ba('0x15')];_0x650fad+=0x1){_0xe620fd=_0x269d62[_0x650fad];if(_[_0xd0ba('0x16')](_0x43103c[_0xd0ba('0xc')][_0xe620fd['id']])){_0x43103c[_0xd0ba('0xc')][_0xe620fd['id']]=new SmsQueue(_0xe620fd);}else{_0x43103c[_0xd0ba('0x13')](_0x43103c[_0xd0ba('0xc')][_0xe620fd['id']],_0xe620fd);}_0x43103c[_0xd0ba('0xc')][_0xe620fd['id']][_0xd0ba('0x1a')]();_0x43103c[_0xd0ba('0xc')][_0xe620fd['id']][_0xd0ba('0x18')]();}}return _0x43103c[_0xd0ba('0xc')];};};Realtime[_0xd0ba('0x12')][_0xd0ba('0x1b')]=function(){var _0x3d4d32=this;return function(_0x20b3e6){if(_0x20b3e6){freeIsNotKey(_0x20b3e6,_0x3d4d32['mailQueues'],'id');for(var _0x31b3a7=0x0,_0x550e0f={},_0x23bc40={};_0x31b3a7<_0x20b3e6[_0xd0ba('0x15')];_0x31b3a7+=0x1){_0x550e0f=_0x20b3e6[_0x31b3a7];if(_[_0xd0ba('0x16')](_0x3d4d32['mailQueues'][_0x550e0f['id']])){_0x3d4d32[_0xd0ba('0x1c')][_0x550e0f['id']]=new MailQueue(_0x550e0f);}else{_0x3d4d32[_0xd0ba('0x13')](_0x3d4d32['mailQueues'][_0x550e0f['id']],_0x550e0f);}_0x3d4d32[_0xd0ba('0x1c')][_0x550e0f['id']][_0xd0ba('0x1a')]();_0x3d4d32[_0xd0ba('0x1c')][_0x550e0f['id']][_0xd0ba('0x18')]();}}return _0x3d4d32[_0xd0ba('0x1c')];};};Realtime[_0xd0ba('0x12')][_0xd0ba('0x1d')]=function(){var _0x221409=this;return function(_0x2cf05b){if(_0x2cf05b){freeIsNotKey(_0x2cf05b,_0x221409['faxQueues'],'id');for(var _0x442b65=0x0,_0x40c105={},_0x4f04f7={};_0x442b65<_0x2cf05b[_0xd0ba('0x15')];_0x442b65+=0x1){_0x40c105=_0x2cf05b[_0x442b65];if(_[_0xd0ba('0x16')](_0x221409['faxQueues'][_0x40c105['id']])){_0x221409[_0xd0ba('0x1e')][_0x40c105['id']]=new FaxQueue(_0x40c105);}else{_0x221409[_0xd0ba('0x13')](_0x221409[_0xd0ba('0x1e')][_0x40c105['id']],_0x40c105);}_0x221409[_0xd0ba('0x1e')][_0x40c105['id']][_0xd0ba('0x1a')]();_0x221409['faxQueues'][_0x40c105['id']][_0xd0ba('0x18')]();}}return _0x221409['faxQueues'];};};module[_0xd0ba('0x1f')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 8675406..3bccbc8 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 _0xb370=['update','Request','UpdateChatInteraction','addTags','../client'];(function(_0x3ef280,_0x1ce9dd){var _0x47a682=function(_0x330c8e){while(--_0x330c8e){_0x3ef280['push'](_0x3ef280['shift']());}};_0x47a682(++_0x1ce9dd);}(_0xb370,0x7c));var _0x0b37=function(_0x48e5df,_0x8e0a39){_0x48e5df=_0x48e5df-0x0;var _0x2696b3=_0xb370[_0x48e5df];return _0x2696b3;};'use strict';var client=require(_0x0b37('0x0'));exports[_0x0b37('0x1')]=function(_0x260ebc,_0x5e6f6c){return client[_0x0b37('0x2')](_0x0b37('0x3'),{'body':_0x5e6f6c,'options':{'where':{'id':_0x260ebc}},'log':'updateChatInteraction'});};exports[_0x0b37('0x4')]=function(_0x2d722f,_0x1bd767){return client[_0x0b37('0x2')]('AddTagsToChatInteraction',{'body':_0x1bd767,'options':{'where':{'id':_0x2d722f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x4e0b=['addTags','AddTagsToChatInteraction','update','Request','UpdateChatInteraction'];(function(_0x2c1114,_0x2a5c50){var _0x2b877c=function(_0x4f356d){while(--_0x4f356d){_0x2c1114['push'](_0x2c1114['shift']());}};_0x2b877c(++_0x2a5c50);}(_0x4e0b,0xd4));var _0xb4e0=function(_0xefb9b4,_0x5a6dbb){_0xefb9b4=_0xefb9b4-0x0;var _0x4bc217=_0x4e0b[_0xefb9b4];return _0x4bc217;};'use strict';var client=require('../client');exports[_0xb4e0('0x0')]=function(_0x59bfe3,_0xf50617){return client[_0xb4e0('0x1')](_0xb4e0('0x2'),{'body':_0xf50617,'options':{'where':{'id':_0x59bfe3}},'log':'updateChatInteraction'});};exports[_0xb4e0('0x3')]=function(_0x3164fe,_0x3c66f4){return client[_0xb4e0('0x1')](_0xb4e0('0x4'),{'body':_0x3c66f4,'options':{'where':{'id':_0x3164fe}},'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 7cfa9fb..5e00906 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 _0xa522=['Request','CreateChatMessage','../client'];(function(_0x246515,_0x55d965){var _0x1c06d1=function(_0xde89e1){while(--_0xde89e1){_0x246515['push'](_0x246515['shift']());}};_0x1c06d1(++_0x55d965);}(_0xa522,0x125));var _0x2a52=function(_0x47242d,_0x13f993){_0x47242d=_0x47242d-0x0;var _0x30273a=_0xa522[_0x47242d];return _0x30273a;};'use strict';var client=require(_0x2a52('0x0'));exports['create']=function(_0x521614){return client[_0x2a52('0x1')](_0x2a52('0x2'),{'body':_0x521614,'log':'createChatMessage'});}; \ No newline at end of file +var _0x459c=['../client','CreateChatMessage','createChatMessage'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x459c,0x1bf));var _0xc459=function(_0x23ebb5,_0x497f04){_0x23ebb5=_0x23ebb5-0x0;var _0x477879=_0x459c[_0x23ebb5];return _0x477879;};'use strict';var client=require(_0xc459('0x0'));exports['create']=function(_0x120151){return client['Request'](_0xc459('0x1'),{'body':_0x120151,'log':_0xc459('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 9515af7..5e6f802 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 _0xf4fb=['../client','getChatQueues','Request','GetChatQueue','timeout','strategy','User','Agents','online','chatPause'];(function(_0x18c101,_0x508470){var _0x3fcb55=function(_0x143718){while(--_0x143718){_0x18c101['push'](_0x18c101['shift']());}};_0x3fcb55(++_0x508470);}(_0xf4fb,0x10e));var _0xbf4f=function(_0x40eb18,_0x492051){_0x40eb18=_0x40eb18-0x0;var _0x47c891=_0xf4fb[_0x40eb18];return _0x47c891;};'use strict';var client=require(_0xbf4f('0x0'));exports[_0xbf4f('0x1')]=function(){return function(){return client[_0xbf4f('0x2')](_0xbf4f('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xbf4f('0x4'),_0xbf4f('0x5')],'include':[{'model':_0xbf4f('0x6'),'as':_0xbf4f('0x7'),'attributes':['id','name',_0xbf4f('0x8'),_0xbf4f('0x9')]}]},'log':_0xbf4f('0x1')});};}; \ No newline at end of file +var _0x45c0=['../client','getChatQueues','Request','name','timeout','User','Agents','online'];(function(_0x5ab600,_0x55d1ea){var _0x3f3b8b=function(_0x3fb185){while(--_0x3fb185){_0x5ab600['push'](_0x5ab600['shift']());}};_0x3f3b8b(++_0x55d1ea);}(_0x45c0,0x110));var _0x045c=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x45c0[_0x23e7c1];return _0x1add43;};'use strict';var client=require(_0x045c('0x0'));exports[_0x045c('0x1')]=function(){return function(){return client[_0x045c('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x045c('0x3'),_0x045c('0x4'),'strategy'],'include':[{'model':_0x045c('0x5'),'as':_0x045c('0x6'),'attributes':['id','name',_0x045c('0x7'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index ba36ee2..4501ffe 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 _0xaefc=['../client','create','CreateChatQueueReport','Request','UpdateChatQueueReport'];(function(_0x11bd64,_0x5d6c82){var _0x7f5d45=function(_0x35e257){while(--_0x35e257){_0x11bd64['push'](_0x11bd64['shift']());}};_0x7f5d45(++_0x5d6c82);}(_0xaefc,0xc8));var _0xcaef=function(_0x2d5fe4,_0x512a11){_0x2d5fe4=_0x2d5fe4-0x0;var _0x4cb33f=_0xaefc[_0x2d5fe4];return _0x4cb33f;};'use strict';var client=require(_0xcaef('0x0'));exports[_0xcaef('0x1')]=function(_0x434367){return client['Request'](_0xcaef('0x2'),{'body':_0x434367,'log':_0xcaef('0x2')});};exports['update']=function(_0x575523,_0x37a134){return client[_0xcaef('0x3')]('UpdateChatQueueReport',{'body':_0x37a134,'options':{'where':{'uniqueid':_0x575523},'order':[['id','DESC']],'limit':0x1},'log':_0xcaef('0x4')});}; \ No newline at end of file +var _0xe43c=['../client','create','Request','CreateChatQueueReport','UpdateChatQueueReport','DESC'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0xe43c,0x180));var _0xce43=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xe43c[_0x2070da];return _0x4f9fe1;};'use strict';var client=require(_0xce43('0x0'));exports[_0xce43('0x1')]=function(_0x159823){return client[_0xce43('0x2')](_0xce43('0x3'),{'body':_0x159823,'log':_0xce43('0x3')});};exports['update']=function(_0x415941,_0x4eed68){return client[_0xce43('0x2')](_0xce43('0x4'),{'body':_0x4eed68,'options':{'where':{'uniqueid':_0x415941},'order':[['id',_0xce43('0x5')]],'limit':0x1},'log':_0xce43('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 8f4482f..0198ac1 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 _0x2d7a=['../client','update','Request','updateFaxInteraction','addTags','AddTagsToFaxInteraction'];(function(_0x5c910c,_0x41ec75){var _0x580160=function(_0x5a5a2f){while(--_0x5a5a2f){_0x5c910c['push'](_0x5c910c['shift']());}};_0x580160(++_0x41ec75);}(_0x2d7a,0x126));var _0xa2d7=function(_0x419560,_0x16a92c){_0x419560=_0x419560-0x0;var _0x52a0a9=_0x2d7a[_0x419560];return _0x52a0a9;};'use strict';var client=require(_0xa2d7('0x0'));exports[_0xa2d7('0x1')]=function(_0x136cc2,_0x34a600){return client[_0xa2d7('0x2')]('UpdateFaxInteraction',{'body':_0x34a600,'options':{'where':{'id':_0x136cc2}},'log':_0xa2d7('0x3')});};exports[_0xa2d7('0x4')]=function(_0x2c1733,_0x52e9e6){return client[_0xa2d7('0x2')](_0xa2d7('0x5'),{'body':_0x52e9e6,'options':{'where':{'id':_0x2c1733}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x1884=['update','updateFaxInteraction','addTags','Request','addTagsToFaxInteraction','../client'];(function(_0x3a9f82,_0x236d49){var _0x25d804=function(_0x4d17f8){while(--_0x4d17f8){_0x3a9f82['push'](_0x3a9f82['shift']());}};_0x25d804(++_0x236d49);}(_0x1884,0xdd));var _0x4188=function(_0x44915f,_0x9a31b8){_0x44915f=_0x44915f-0x0;var _0x23cd3d=_0x1884[_0x44915f];return _0x23cd3d;};'use strict';var client=require(_0x4188('0x0'));exports[_0x4188('0x1')]=function(_0x1fe175,_0x349d0b){return client['Request']('UpdateFaxInteraction',{'body':_0x349d0b,'options':{'where':{'id':_0x1fe175}},'log':_0x4188('0x2')});};exports[_0x4188('0x3')]=function(_0x55ad23,_0x28367f){return client[_0x4188('0x4')]('AddTagsToFaxInteraction',{'body':_0x28367f,'options':{'where':{'id':_0x55ad23}},'log':_0x4188('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 5701452..4cf5618 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 _0x58db=['Request','CreateFaxMessage','../client'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x58db,0x161));var _0xb58d=function(_0x4d8121,_0x1dfefe){_0x4d8121=_0x4d8121-0x0;var _0x875581=_0x58db[_0x4d8121];return _0x875581;};'use strict';var client=require(_0xb58d('0x0'));exports['create']=function(_0x23fdbf){return client[_0xb58d('0x1')](_0xb58d('0x2'),{'body':_0x23fdbf,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xc146=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x5c4ff2,_0x1f8bce){var _0x50382e=function(_0x11bc5f){while(--_0x11bc5f){_0x5c4ff2['push'](_0x5c4ff2['shift']());}};_0x50382e(++_0x1f8bce);}(_0xc146,0xba));var _0x6c14=function(_0x2bb603,_0x4011c6){_0x2bb603=_0x2bb603-0x0;var _0x5d45e3=_0xc146[_0x2bb603];return _0x5d45e3;};'use strict';var client=require(_0x6c14('0x0'));exports[_0x6c14('0x1')]=function(_0x122f29){return client[_0x6c14('0x2')](_0x6c14('0x3'),{'body':_0x122f29,'log':_0x6c14('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 4fccd31..23968d8 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 _0xd786=['getFaxQueues','GetFaxQueue','name','timeout','strategy','User','Agents','online','faxPause'];(function(_0x59b0d0,_0x1a6b75){var _0x476b8a=function(_0x3d6d09){while(--_0x3d6d09){_0x59b0d0['push'](_0x59b0d0['shift']());}};_0x476b8a(++_0x1a6b75);}(_0xd786,0xe1));var _0x6d78=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xd786[_0xefd519];return _0x4bb882;};'use strict';var client=require('../client');exports[_0x6d78('0x0')]=function(){return function(){return client['Request'](_0x6d78('0x1'),{'options':{'raw':![],'attributes':['id',_0x6d78('0x2'),_0x6d78('0x3'),_0x6d78('0x4')],'include':[{'model':_0x6d78('0x5'),'as':_0x6d78('0x6'),'attributes':['id',_0x6d78('0x2'),_0x6d78('0x7'),_0x6d78('0x8')]}]},'log':_0x6d78('0x0')});};}; \ No newline at end of file +var _0x3cc3=['name','strategy','User','Agents','online','faxPause','../client','GetFaxQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cc3,0x11e));var _0x33cc=function(_0x1d6856,_0x1b0e54){_0x1d6856=_0x1d6856-0x0;var _0x4b2754=_0x3cc3[_0x1d6856];return _0x4b2754;};'use strict';var client=require(_0x33cc('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0x33cc('0x1'),{'options':{'raw':![],'attributes':['id',_0x33cc('0x2'),'timeout',_0x33cc('0x3')],'include':[{'model':_0x33cc('0x4'),'as':_0x33cc('0x5'),'attributes':['id',_0x33cc('0x2'),_0x33cc('0x6'),_0x33cc('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index c11eefd..450ab33 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 _0xf3a7=['CreateFaxQueueReport','update','UpdateFaxQueueReport','create','Request'];(function(_0x56952f,_0x449e9b){var _0x20d07f=function(_0x294d63){while(--_0x294d63){_0x56952f['push'](_0x56952f['shift']());}};_0x20d07f(++_0x449e9b);}(_0xf3a7,0x99));var _0x7f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x7f3a('0x0')]=function(_0x303083){return client[_0x7f3a('0x1')](_0x7f3a('0x2'),{'body':_0x303083,'log':_0x7f3a('0x2')});};exports[_0x7f3a('0x3')]=function(_0x3dae59,_0x332a7a){return client[_0x7f3a('0x1')](_0x7f3a('0x4'),{'body':_0x332a7a,'options':{'where':{'uniqueid':_0x3dae59},'order':[['id','DESC']],'limit':0x1},'log':_0x7f3a('0x4')});}; \ No newline at end of file +var _0x67d1=['create','Request','CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport','../client'];(function(_0x25ba7d,_0x43b79f){var _0x9ee442=function(_0xd0ad8){while(--_0xd0ad8){_0x25ba7d['push'](_0x25ba7d['shift']());}};_0x9ee442(++_0x43b79f);}(_0x67d1,0xdf));var _0x167d=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x67d1[_0x263a74];return _0x2aa86c;};'use strict';var client=require(_0x167d('0x0'));exports[_0x167d('0x1')]=function(_0x443ee0){return client[_0x167d('0x2')]('CreateFaxQueueReport',{'body':_0x443ee0,'log':_0x167d('0x3')});};exports[_0x167d('0x4')]=function(_0x26ce3c,_0x54ae83){return client['Request']('UpdateFaxQueueReport',{'body':_0x54ae83,'options':{'where':{'uniqueid':_0x26ce3c},'order':[['id',_0x167d('0x5')]],'limit':0x1},'log':_0x167d('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 1ee0516..facfce7 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 _0xc2da=['name','Intervals','interval','getIntervals','../client','Request'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xc2da,0x124));var _0xac2d=function(_0x506a86,_0x41e1c9){_0x506a86=_0x506a86-0x0;var _0x5e1960=_0xc2da[_0x506a86];return _0x5e1960;};'use strict';var client=require(_0xac2d('0x0'));exports['getIntervals']=function(){return function(){return client[_0xac2d('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xac2d('0x2')],'include':[{'model':'Interval','as':_0xac2d('0x3'),'attributes':['id',_0xac2d('0x2'),_0xac2d('0x4')]}]},'log':_0xac2d('0x5')});};}; \ No newline at end of file +var _0x1c7c=['getIntervals','Request','GetInterval','Interval','name','interval','../client'];(function(_0x3dfdb2,_0x3a14b4){var _0x463138=function(_0x25902f){while(--_0x25902f){_0x3dfdb2['push'](_0x3dfdb2['shift']());}};_0x463138(++_0x3a14b4);}(_0x1c7c,0x164));var _0xc1c7=function(_0x4eabbf,_0xe59327){_0x4eabbf=_0x4eabbf-0x0;var _0x27618b=_0x1c7c[_0x4eabbf];return _0x27618b;};'use strict';var client=require(_0xc1c7('0x0'));exports[_0xc1c7('0x1')]=function(){return function(){return client[_0xc1c7('0x2')](_0xc1c7('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xc1c7('0x4'),'as':'Intervals','attributes':['id',_0xc1c7('0x5'),_0xc1c7('0x6')]}]},'log':_0xc1c7('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index f335e22..a5006af 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 _0xd5dc=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x1d1f80,_0x2c87c0){var _0x380d8b=function(_0x1bb4c8){while(--_0x1bb4c8){_0x1d1f80['push'](_0x1d1f80['shift']());}};_0x380d8b(++_0x2c87c0);}(_0xd5dc,0x1e3));var _0xcd5d=function(_0x5a0061,_0x31accd){_0x5a0061=_0x5a0061-0x0;var _0x4401c8=_0xd5dc[_0x5a0061];return _0x4401c8;};'use strict';var client=require(_0xcd5d('0x0'));exports[_0xcd5d('0x1')]=function(_0x3bf53d,_0x5458ef){return client[_0xcd5d('0x2')](_0xcd5d('0x3'),{'body':_0x5458ef,'options':{'where':{'id':_0x3bf53d}},'log':_0xcd5d('0x4')});};exports[_0xcd5d('0x5')]=function(_0x45db5d,_0x18957a){return client[_0xcd5d('0x2')](_0xcd5d('0x6'),{'body':_0x18957a,'options':{'where':{'id':_0x45db5d}},'log':_0xcd5d('0x7')});}; \ No newline at end of file +var _0xdcd0=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update'];(function(_0x2b51d9,_0x3db22c){var _0x3591de=function(_0x4e6245){while(--_0x4e6245){_0x2b51d9['push'](_0x2b51d9['shift']());}};_0x3591de(++_0x3db22c);}(_0xdcd0,0xfe));var _0x0dcd=function(_0x42ea31,_0x3036ee){_0x42ea31=_0x42ea31-0x0;var _0x39f0c3=_0xdcd0[_0x42ea31];return _0x39f0c3;};'use strict';var client=require(_0x0dcd('0x0'));exports[_0x0dcd('0x1')]=function(_0x39ef35,_0x480309){return client[_0x0dcd('0x2')](_0x0dcd('0x3'),{'body':_0x480309,'options':{'where':{'id':_0x39ef35}},'log':_0x0dcd('0x4')});};exports[_0x0dcd('0x5')]=function(_0x5cbd46,_0x3b3f09){return client[_0x0dcd('0x2')](_0x0dcd('0x6'),{'body':_0x3b3f09,'options':{'where':{'id':_0x5cbd46}},'log':_0x0dcd('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index bd8bc8e..f1e55b1 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 _0x5734=['../client','create','Request','CreateMailMessage','createMailMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5734,0x131));var _0x4573=function(_0x533843,_0x3d5ec0){_0x533843=_0x533843-0x0;var _0x55a5f4=_0x5734[_0x533843];return _0x55a5f4;};'use strict';var client=require(_0x4573('0x0'));exports[_0x4573('0x1')]=function(_0x496e2d){return client[_0x4573('0x2')](_0x4573('0x3'),{'body':_0x496e2d,'log':_0x4573('0x4')});}; \ No newline at end of file +var _0x456c=['createMailMessage','../client','create','CreateMailMessage'];(function(_0x31287b,_0x56cc4d){var _0x520189=function(_0x3b0e24){while(--_0x3b0e24){_0x31287b['push'](_0x31287b['shift']());}};_0x520189(++_0x56cc4d);}(_0x456c,0x151));var _0xc456=function(_0x8ce506,_0x517f30){_0x8ce506=_0x8ce506-0x0;var _0x23c8e5=_0x456c[_0x8ce506];return _0x23c8e5;};'use strict';var client=require(_0xc456('0x0'));exports[_0xc456('0x1')]=function(_0x3a7832){return client['Request'](_0xc456('0x2'),{'body':_0x3a7832,'log':_0xc456('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index ce8342c..08bf513 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 _0x456f=['../client','getMailQueues','Request','name','timeout','strategy','Agents','online','mailPause'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x456f,0x117));var _0xf456=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x456f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xf456('0x0'));exports[_0xf456('0x1')]=function(){return function(){return client[_0xf456('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xf456('0x3'),_0xf456('0x4'),_0xf456('0x5')],'include':[{'model':'User','as':_0xf456('0x6'),'attributes':['id',_0xf456('0x3'),_0xf456('0x7'),_0xf456('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x5a2a=['strategy','User','Agents','mailPause','getMailQueues','Request','GetMailQueue','name','timeout'];(function(_0x7818c1,_0x27ca7e){var _0x3ba860=function(_0x433c9e){while(--_0x433c9e){_0x7818c1['push'](_0x7818c1['shift']());}};_0x3ba860(++_0x27ca7e);}(_0x5a2a,0x136));var _0xa5a2=function(_0x244da1,_0x24545a){_0x244da1=_0x244da1-0x0;var _0x20100e=_0x5a2a[_0x244da1];return _0x20100e;};'use strict';var client=require('../client');exports[_0xa5a2('0x0')]=function(){return function(){return client[_0xa5a2('0x1')](_0xa5a2('0x2'),{'options':{'raw':![],'attributes':['id',_0xa5a2('0x3'),_0xa5a2('0x4'),_0xa5a2('0x5')],'include':[{'model':_0xa5a2('0x6'),'as':_0xa5a2('0x7'),'attributes':['id',_0xa5a2('0x3'),'online',_0xa5a2('0x8')]}]},'log':_0xa5a2('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 52f2634..20ef815 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 _0x6979=['UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport','DESC'];(function(_0x52eeb5,_0x286b87){var _0x231164=function(_0x16e24f){while(--_0x16e24f){_0x52eeb5['push'](_0x52eeb5['shift']());}};_0x231164(++_0x286b87);}(_0x6979,0xf7));var _0x9697=function(_0x4aabb0,_0x6fbde7){_0x4aabb0=_0x4aabb0-0x0;var _0x2112c6=_0x6979[_0x4aabb0];return _0x2112c6;};'use strict';var client=require(_0x9697('0x0'));exports[_0x9697('0x1')]=function(_0x4441de){return client[_0x9697('0x2')](_0x9697('0x3'),{'body':_0x4441de,'log':_0x9697('0x3')});};exports['update']=function(_0x312ef0,_0x394350){return client[_0x9697('0x2')]('UpdateMailQueueReport',{'body':_0x394350,'options':{'where':{'uniqueid':_0x312ef0},'order':[['id',_0x9697('0x4')]],'limit':0x1},'log':_0x9697('0x5')});}; \ No newline at end of file +var _0xadce=['../client','create','CreateMailQueueReport','update','Request','UpdateMailQueueReport','DESC'];(function(_0xf474d6,_0x9c3f94){var _0x291d79=function(_0x1b31e1){while(--_0x1b31e1){_0xf474d6['push'](_0xf474d6['shift']());}};_0x291d79(++_0x9c3f94);}(_0xadce,0x85));var _0xeadc=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xadce[_0x5e4563];return _0x8d1bf5;};'use strict';var client=require(_0xeadc('0x0'));exports[_0xeadc('0x1')]=function(_0x479176){return client['Request'](_0xeadc('0x2'),{'body':_0x479176,'log':_0xeadc('0x2')});};exports[_0xeadc('0x3')]=function(_0x53a9fb,_0x49416e){return client[_0xeadc('0x4')](_0xeadc('0x5'),{'body':_0x49416e,'options':{'where':{'uniqueid':_0x53a9fb},'order':[['id',_0xeadc('0x6')]],'limit':0x1},'log':_0xeadc('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 06fb3b3..b10870b 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 _0x4f0a=['addTags','Request','AddTagsToOpenchannelInteraction','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x1b33fe,_0x2149c7){var _0x5aa05c=function(_0x42bdd9){while(--_0x42bdd9){_0x1b33fe['push'](_0x1b33fe['shift']());}};_0x5aa05c(++_0x2149c7);}(_0x4f0a,0x129));var _0xa4f0=function(_0x58efa6,_0x2c00bd){_0x58efa6=_0x58efa6-0x0;var _0x5d643c=_0x4f0a[_0x58efa6];return _0x5d643c;};'use strict';var client=require('../client');exports[_0xa4f0('0x0')]=function(_0x3e6cb8,_0x562b58){return client['Request'](_0xa4f0('0x1'),{'body':_0x562b58,'options':{'where':{'id':_0x3e6cb8}},'log':_0xa4f0('0x2')});};exports[_0xa4f0('0x3')]=function(_0x5eb972,_0x258b82){return client[_0xa4f0('0x4')](_0xa4f0('0x5'),{'body':_0x258b82,'options':{'where':{'id':_0x5eb972}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xc958=['AddTagsToOpenchannelInteraction','../client','addTags','Request'];(function(_0x5eefac,_0x1f3278){var _0x333d38=function(_0x1b42be){while(--_0x1b42be){_0x5eefac['push'](_0x5eefac['shift']());}};_0x333d38(++_0x1f3278);}(_0xc958,0xb9));var _0x8c95=function(_0x5538c9,_0x4b33e1){_0x5538c9=_0x5538c9-0x0;var _0x44b41c=_0xc958[_0x5538c9];return _0x44b41c;};'use strict';var client=require(_0x8c95('0x0'));exports['update']=function(_0x32cc5e,_0x3f6d7a){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x3f6d7a,'options':{'where':{'id':_0x32cc5e}},'log':'updateOpenchannelInteraction'});};exports[_0x8c95('0x1')]=function(_0x301ae1,_0x180dbd){return client[_0x8c95('0x2')](_0x8c95('0x3'),{'body':_0x180dbd,'options':{'where':{'id':_0x301ae1}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 5bfee13..db2afa6 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 _0xb43b=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x40ea46,_0x1fa76e){_0x40ea46=_0x40ea46-0x0;var _0x1e1acb=_0xb43b[_0x40ea46];return _0x1e1acb;};'use strict';var client=require(_0xbb43('0x0'));exports[_0xbb43('0x1')]=function(_0x5c45dd){return client[_0xbb43('0x2')](_0xbb43('0x3'),{'body':_0x5c45dd,'log':_0xbb43('0x4')});}; \ No newline at end of file +var _0xf3cd=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x27fda1,_0x59a188){var _0x5e65ab=function(_0x43d6a6){while(--_0x43d6a6){_0x27fda1['push'](_0x27fda1['shift']());}};_0x5e65ab(++_0x59a188);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x9c1f48,_0x25da55){_0x9c1f48=_0x9c1f48-0x0;var _0x52ecd4=_0xf3cd[_0x9c1f48];return _0x52ecd4;};'use strict';var client=require(_0xdf3c('0x0'));exports[_0xdf3c('0x1')]=function(_0x31e5a5){return client[_0xdf3c('0x2')](_0xdf3c('0x3'),{'body':_0x31e5a5,'log':_0xdf3c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index b046f1a..929e8a8 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 _0x9e46=['name','online','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','timeout','strategy','User'];(function(_0x4b491e,_0x4e01fe){var _0x19d7e3=function(_0x734f63){while(--_0x734f63){_0x4b491e['push'](_0x4b491e['shift']());}};_0x19d7e3(++_0x4e01fe);}(_0x9e46,0x18f));var _0x69e4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9e46[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0x69e4('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x69e4('0x1')](_0x69e4('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x69e4('0x3'),_0x69e4('0x4')],'include':[{'model':_0x69e4('0x5'),'as':'Agents','attributes':['id',_0x69e4('0x6'),_0x69e4('0x7'),'openchannelPause']}]},'log':_0x69e4('0x8')});};}; \ No newline at end of file +var _0xacd7=['Request','name','timeout','strategy','User','Agents','online','openchannelPause','getOpenchannelQueues'];(function(_0x43c763,_0x36a5d1){var _0x5d5e4e=function(_0x5d39c3){while(--_0x5d39c3){_0x43c763['push'](_0x43c763['shift']());}};_0x5d5e4e(++_0x36a5d1);}(_0xacd7,0x1dc));var _0x7acd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xacd7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x7acd('0x0')]=function(){return function(){return client[_0x7acd('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x7acd('0x2'),_0x7acd('0x3'),_0x7acd('0x4')],'include':[{'model':_0x7acd('0x5'),'as':_0x7acd('0x6'),'attributes':['id',_0x7acd('0x2'),_0x7acd('0x7'),_0x7acd('0x8')]}]},'log':_0x7acd('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 5a2567e..fd0344d 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 _0x3f98=['../client','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x5d9987,_0x3c9d0c){var _0x4eb5a4=function(_0x23a46c){while(--_0x23a46c){_0x5d9987['push'](_0x5d9987['shift']());}};_0x4eb5a4(++_0x3c9d0c);}(_0x3f98,0xa0));var _0x83f9=function(_0xd55d72,_0x503c85){_0xd55d72=_0xd55d72-0x0;var _0x403b9b=_0x3f98[_0xd55d72];return _0x403b9b;};'use strict';var client=require(_0x83f9('0x0'));exports[_0x83f9('0x1')]=function(_0x345621){return client[_0x83f9('0x2')](_0x83f9('0x3'),{'body':_0x345621,'log':_0x83f9('0x3')});};exports[_0x83f9('0x4')]=function(_0x10a85f,_0x452a42){return client[_0x83f9('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x452a42,'options':{'where':{'uniqueid':_0x10a85f},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x31f7=['DESC','UpdateOpenchannelQueueReport','Request','CreateOpenchannelQueueReport','update'];(function(_0x41f901,_0x10b999){var _0x47c1f3=function(_0x3cc3e3){while(--_0x3cc3e3){_0x41f901['push'](_0x41f901['shift']());}};_0x47c1f3(++_0x10b999);}(_0x31f7,0x174));var _0x731f=function(_0x1291e6,_0x5a8934){_0x1291e6=_0x1291e6-0x0;var _0x21f8bf=_0x31f7[_0x1291e6];return _0x21f8bf;};'use strict';var client=require('../client');exports['create']=function(_0x35929e){return client[_0x731f('0x0')](_0x731f('0x1'),{'body':_0x35929e,'log':_0x731f('0x1')});};exports[_0x731f('0x2')]=function(_0x97a9a0,_0x399f4e){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x399f4e,'options':{'where':{'uniqueid':_0x97a9a0},'order':[['id',_0x731f('0x3')]],'limit':0x1},'log':_0x731f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 0c25abb..ba9bb74 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 _0x9664=['../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction'];(function(_0x45e470,_0x4f8abc){var _0x20e4f6=function(_0x3835f3){while(--_0x3835f3){_0x45e470['push'](_0x45e470['shift']());}};_0x20e4f6(++_0x4f8abc);}(_0x9664,0x126));var _0x4966=function(_0x36d470,_0x2676bb){_0x36d470=_0x36d470-0x0;var _0x52c9b4=_0x9664[_0x36d470];return _0x52c9b4;};'use strict';var client=require(_0x4966('0x0'));exports['update']=function(_0x55d3cd,_0x8fdc0d){return client[_0x4966('0x1')](_0x4966('0x2'),{'body':_0x8fdc0d,'options':{'where':{'id':_0x55d3cd}},'log':_0x4966('0x3')});};exports[_0x4966('0x4')]=function(_0x41cc95,_0x4a7a22){return client[_0x4966('0x1')]('AddTagsToSmsInteraction',{'body':_0x4a7a22,'options':{'where':{'id':_0x41cc95}},'log':_0x4966('0x5')});}; \ No newline at end of file +var _0x25ab=['UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x25ab,0x148));var _0xb25a=function(_0x41e780,_0x18dca5){_0x41e780=_0x41e780-0x0;var _0x2e290d=_0x25ab[_0x41e780];return _0x2e290d;};'use strict';var client=require(_0xb25a('0x0'));exports[_0xb25a('0x1')]=function(_0x4f8dab,_0x44dc10){return client['Request'](_0xb25a('0x2'),{'body':_0x44dc10,'options':{'where':{'id':_0x4f8dab}},'log':_0xb25a('0x3')});};exports['addTags']=function(_0x350101,_0x37cae7){return client['Request'](_0xb25a('0x4'),{'body':_0x37cae7,'options':{'where':{'id':_0x350101}},'log':_0xb25a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 049feb5..94ad6c5 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 _0x7b21=['CreateSmsMessage','createSmsMessage','create','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7b21,0x10e));var _0x17b2=function(_0x3117ce,_0x195ae3){_0x3117ce=_0x3117ce-0x0;var _0x3f8e5e=_0x7b21[_0x3117ce];return _0x3f8e5e;};'use strict';var client=require('../client');exports[_0x17b2('0x0')]=function(_0x3bd0ff){return client[_0x17b2('0x1')](_0x17b2('0x2'),{'body':_0x3bd0ff,'log':_0x17b2('0x3')});}; \ No newline at end of file +var _0x74fc=['../client','create','CreateSmsMessage','createSmsMessage'];(function(_0x3fc1f7,_0x2cc343){var _0x589bdb=function(_0x3c3e18){while(--_0x3c3e18){_0x3fc1f7['push'](_0x3fc1f7['shift']());}};_0x589bdb(++_0x2cc343);}(_0x74fc,0x88));var _0xc74f=function(_0x1dc81c,_0x490e4e){_0x1dc81c=_0x1dc81c-0x0;var _0x36ebb7=_0x74fc[_0x1dc81c];return _0x36ebb7;};'use strict';var client=require(_0xc74f('0x0'));exports[_0xc74f('0x1')]=function(_0x51f778){return client['Request'](_0xc74f('0x2'),{'body':_0x51f778,'log':_0xc74f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index cb4250f..3199539 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 _0xdf7c=['Request','GetSmsQueue','User','Agents','smsPause','getSmsQueues'];(function(_0x33c42e,_0x170930){var _0xfddb2b=function(_0x382a0e){while(--_0x382a0e){_0x33c42e['push'](_0x33c42e['shift']());}};_0xfddb2b(++_0x170930);}(_0xdf7c,0x149));var _0xcdf7=function(_0x257495,_0x18269b){_0x257495=_0x257495-0x0;var _0x3849aa=_0xdf7c[_0x257495];return _0x3849aa;};'use strict';var client=require('../client');exports[_0xcdf7('0x0')]=function(){return function(){return client[_0xcdf7('0x1')](_0xcdf7('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xcdf7('0x3'),'as':_0xcdf7('0x4'),'attributes':['id','name','online',_0xcdf7('0x5')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xd202=['Agents','online','../client','getSmsQueues','Request','GetSmsQueue','name','timeout'];(function(_0x41db97,_0x56ed5c){var _0x446326=function(_0x3b8218){while(--_0x3b8218){_0x41db97['push'](_0x41db97['shift']());}};_0x446326(++_0x56ed5c);}(_0xd202,0x15a));var _0x2d20=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd202[_0x13d07a];return _0x5ee0ee;};'use strict';var client=require(_0x2d20('0x0'));exports[_0x2d20('0x1')]=function(){return function(){return client[_0x2d20('0x2')](_0x2d20('0x3'),{'options':{'raw':![],'attributes':['id',_0x2d20('0x4'),_0x2d20('0x5'),'strategy'],'include':[{'model':'User','as':_0x2d20('0x6'),'attributes':['id',_0x2d20('0x4'),_0x2d20('0x7'),'smsPause']}]},'log':_0x2d20('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 211eab4..fbbd830 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 _0xde1e=['DESC','../client','create','Request','CreateSmsQueueReport','UpdateSmsQueueReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xde1e,0x9d));var _0xede1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xde1e[_0x2641f9];return _0x585741;};'use strict';var client=require(_0xede1('0x0'));exports[_0xede1('0x1')]=function(_0x12cf84){return client[_0xede1('0x2')](_0xede1('0x3'),{'body':_0x12cf84,'log':_0xede1('0x3')});};exports['update']=function(_0x24e2fb,_0x1e766f){return client[_0xede1('0x2')](_0xede1('0x4'),{'body':_0x1e766f,'options':{'where':{'uniqueid':_0x24e2fb},'order':[['id',_0xede1('0x5')]],'limit':0x1},'log':_0xede1('0x4')});}; \ No newline at end of file +var _0xcd3b=['CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcd3b,0x19c));var _0xbcd3=function(_0x2e07ba,_0xb3369e){_0x2e07ba=_0x2e07ba-0x0;var _0x5abba7=_0xcd3b[_0x2e07ba];return _0x5abba7;};'use strict';var client=require(_0xbcd3('0x0'));exports['create']=function(_0x30db39){return client[_0xbcd3('0x1')](_0xbcd3('0x2'),{'body':_0x30db39,'log':_0xbcd3('0x2')});};exports[_0xbcd3('0x3')]=function(_0x4ab5fb,_0x263b28){return client[_0xbcd3('0x1')](_0xbcd3('0x4'),{'body':_0x263b28,'options':{'where':{'uniqueid':_0x4ab5fb},'order':[['id',_0xbcd3('0x5')]],'limit':0x1},'log':_0xbcd3('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 756de53..a912f36 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 _0x37f4=['lastPauseAt','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','getAgents','GetUser','agent','name'];(function(_0x400766,_0x368660){var _0x3ae58b=function(_0x4c6a6e){while(--_0x4c6a6e){_0x400766['push'](_0x400766['shift']());}};_0x3ae58b(++_0x368660);}(_0x37f4,0x1a0));var _0x437f=function(_0x29db74,_0x1c8017){_0x29db74=_0x29db74-0x0;var _0x35820e=_0x37f4[_0x29db74];return _0x35820e;};'use strict';var client=require('../client');exports[_0x437f('0x0')]=function(){return function(){return client['Request'](_0x437f('0x1'),{'options':{'raw':!![],'where':{'role':_0x437f('0x2')},'attributes':['id',_0x437f('0x3'),'online','pauseType',_0x437f('0x4'),_0x437f('0x5'),_0x437f('0x6'),_0x437f('0x7'),_0x437f('0x8'),_0x437f('0x9'),_0x437f('0xa'),_0x437f('0xb'),_0x437f('0xc'),_0x437f('0xd'),_0x437f('0xe'),'openchannelCapacity']},'log':_0x437f('0x0')});};}; \ No newline at end of file +var _0x0e00=['lastPauseAt','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatCapacity','faxCapacity','openchannelCapacity','../client','getAgents','Request','agent','name','online','pauseType'];(function(_0x17474a,_0xd1a49c){var _0x3a5495=function(_0x10e1b4){while(--_0x10e1b4){_0x17474a['push'](_0x17474a['shift']());}};_0x3a5495(++_0xd1a49c);}(_0x0e00,0x92));var _0x00e0=function(_0x1a9dd3,_0x97421b){_0x1a9dd3=_0x1a9dd3-0x0;var _0x436785=_0x0e00[_0x1a9dd3];return _0x436785;};'use strict';var client=require(_0x00e0('0x0'));exports[_0x00e0('0x1')]=function(){return function(){return client[_0x00e0('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x00e0('0x3')},'attributes':['id',_0x00e0('0x4'),_0x00e0('0x5'),_0x00e0('0x6'),_0x00e0('0x7'),_0x00e0('0x8'),_0x00e0('0x9'),_0x00e0('0xa'),_0x00e0('0xb'),_0x00e0('0xc'),_0x00e0('0xd'),_0x00e0('0xe'),'mailCapacity',_0x00e0('0xf'),'smsCapacity',_0x00e0('0x10')]},'log':_0x00e0('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 8ddc530..ae79dbf 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 _0x6fc0=['toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','join','find','agents','timeout','createQueue','atimeout','channel','format','START:%s','rules','close','stop','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name'];(function(_0x2ac5cd,_0x319351){var _0x386998=function(_0x9b951c){while(--_0x9b951c){_0x2ac5cd['push'](_0x2ac5cd['shift']());}};_0x386998(++_0x319351);}(_0x6fc0,0x198));var _0x06fc=function(_0x5c84a4,_0x4d6003){_0x5c84a4=_0x5c84a4-0x0;var _0x5e53f7=_0x6fc0[_0x5c84a4];return _0x5e53f7;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x06fc('0x0'));var seqqueue=require(_0x06fc('0x1'));var logger=require(_0x06fc('0x2'))(_0x06fc('0x3'));var strategy=require(_0x06fc('0x4'));var queue=schema({'name':{'type':_0x06fc('0x5'),'required':!![],'message':_0x06fc('0x6')},'timeout':{'type':_0x06fc('0x7'),'message':_0x06fc('0x8')}});function writeLog(_0x11a118,_0x511596,_0x344c0f){return logger[_0x06fc('0x9')](util['format'](_0x06fc('0xa'),_0x11a118,_0x511596[_0x06fc('0xb')],_0x344c0f));}function handleFindAgent(_0x2109d1){return function(_0x4c1310){return _0x4c1310[_0x06fc('0xb')][_0x06fc('0xc')]()===_0x2109d1[_0x06fc('0xc')]();};}exports[_0x06fc('0xd')]=function(_0x421304,_0x1bcb19,_0x424258,_0x47e1bd){return function(_0x3a1982){try{var _0x38d0b2={'name':_0x1bcb19[0x0],'timeout':_0x1bcb19[0x1]};var _0x38b76a=queue['validate'](_0x38d0b2,{'typecast':!![]});if(_0x38b76a['length']){logger[_0x06fc('0xe')](_0x06fc('0xf'),_0x421304,_[_0x06fc('0x10')](_0x38b76a,'message')[_0x06fc('0x11')](',\x20'));_0x3a1982['stop']();}else{var _0xaa4339=_[_0x06fc('0x12')](_0x424258[_0x06fc('0x13')],handleFindAgent(_0x38d0b2[_0x06fc('0xb')]));if(_0xaa4339){var _0x5c88a0=(_0x38d0b2[_0x06fc('0x14')]||0xa)*0x3e8;var _0xadd51f,_0x426e96;var _0x4ecb98=seqqueue[_0x06fc('0x15')](_0x5c88a0);_0x4ecb98['id']=_0x421304;_0x4ecb98[_0x06fc('0x16')]=_0x5c88a0;_0x4ecb98['channel']=_0x47e1bd[_0x06fc('0x17')];writeLog(_0x421304,_0xaa4339,util[_0x06fc('0x18')](_0x06fc('0x19'),_0x5c88a0));_0x424258[_0x06fc('0x1a')][_0x421304]['on']('end',function(){_0x4ecb98[_0x06fc('0x1b')]();clearTimeout(_0x426e96);_0x426e96=undefined;if(_0x424258['rules'][_0x421304]){delete _0x424258[_0x06fc('0x1a')][_0x421304];}logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x421304);_0x3a1982[_0x06fc('0x1c')]();});_0x426e96=setTimeout(function(){clearTimeout(_0x426e96);_0x4ecb98[_0x06fc('0x1b')]();logger['info'](_0x06fc('0x1d'),_0x421304);_0x3a1982[_0x06fc('0x1e')]();},_0x5c88a0);strategy['agent'](_0x4ecb98,_0xaa4339,_0x424258,_0x47e1bd);}else{logger['error'](_0x06fc('0x1f'),_0x421304,_0x38d0b2[_0x06fc('0xb')]);_0x3a1982['stop']();}}}catch(_0xeb6d52){console[_0x06fc('0x20')](_0xeb6d52);logger['error'](_0x06fc('0x21'),_0x421304,_0xeb6d52[_0x06fc('0x22')]);_0x3a1982[_0x06fc('0x1c')]();}};}; \ No newline at end of file +var _0xbd13=['rules','close','info','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','map','find','agents','timeout','createQueue','atimeout','channel'];(function(_0x416673,_0x327fdc){var _0x43c3e7=function(_0x17da31){while(--_0x17da31){_0x416673['push'](_0x416673['shift']());}};_0x43c3e7(++_0x327fdc);}(_0xbd13,0x116));var _0x3bd1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbd13[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x3bd1('0x0'));var _=require(_0x3bd1('0x1'));var util=require(_0x3bd1('0x2'));var seqqueue=require('seq-queue');var logger=require(_0x3bd1('0x3'))('routing');var strategy=require(_0x3bd1('0x4'));var queue=schema({'name':{'type':_0x3bd1('0x5'),'required':!![],'message':_0x3bd1('0x6')},'timeout':{'type':'number','message':_0x3bd1('0x7')}});function writeLog(_0x4b189e,_0x3e05d4,_0x35c5f9){return logger['info'](util[_0x3bd1('0x8')](_0x3bd1('0x9'),_0x4b189e,_0x3e05d4['name'],_0x35c5f9));}function handleFindAgent(_0x51d810){return function(_0xfb4966){return _0xfb4966[_0x3bd1('0xa')][_0x3bd1('0xb')]()===_0x51d810[_0x3bd1('0xb')]();};}exports['consequence']=function(_0x520051,_0x4c0d99,_0x259821,_0x508891){return function(_0x4bf7a8){try{var _0x5792ff={'name':_0x4c0d99[0x0],'timeout':_0x4c0d99[0x1]};var _0x11229f=queue[_0x3bd1('0x0')](_0x5792ff,{'typecast':!![]});if(_0x11229f[_0x3bd1('0xc')]){logger[_0x3bd1('0xd')](_0x3bd1('0xe'),_0x520051,_[_0x3bd1('0xf')](_0x11229f,'message')['join'](',\x20'));_0x4bf7a8['stop']();}else{var _0x457d53=_[_0x3bd1('0x10')](_0x259821[_0x3bd1('0x11')],handleFindAgent(_0x5792ff[_0x3bd1('0xa')]));if(_0x457d53){var _0x3ea172=(_0x5792ff[_0x3bd1('0x12')]||0xa)*0x3e8;var _0x5927f2,_0x6e71a0;var _0x239d72=seqqueue[_0x3bd1('0x13')](_0x3ea172);_0x239d72['id']=_0x520051;_0x239d72[_0x3bd1('0x14')]=_0x3ea172;_0x239d72[_0x3bd1('0x15')]=_0x508891[_0x3bd1('0x15')];writeLog(_0x520051,_0x457d53,util[_0x3bd1('0x8')]('START:%s',_0x3ea172));_0x259821[_0x3bd1('0x16')][_0x520051]['on']('end',function(){_0x239d72[_0x3bd1('0x17')]();clearTimeout(_0x6e71a0);_0x6e71a0=undefined;if(_0x259821[_0x3bd1('0x16')][_0x520051]){delete _0x259821[_0x3bd1('0x16')][_0x520051];}logger[_0x3bd1('0x18')](_0x3bd1('0x19'),_0x520051);_0x4bf7a8[_0x3bd1('0x1a')]();});_0x6e71a0=setTimeout(function(){clearTimeout(_0x6e71a0);_0x239d72[_0x3bd1('0x17')]();logger[_0x3bd1('0x18')]('[%s][AGENT]\x20ROUTING\x20END',_0x520051);_0x4bf7a8['next']();},_0x3ea172);strategy['agent'](_0x239d72,_0x457d53,_0x259821,_0x508891);}else{logger[_0x3bd1('0xd')](_0x3bd1('0x1b'),_0x520051,_0x5792ff[_0x3bd1('0xa')]);_0x4bf7a8['stop']();}}}catch(_0x18f7be){console['log'](_0x18f7be);logger[_0x3bd1('0xd')](_0x3bd1('0x1c'),_0x520051,_0x18f7be[_0x3bd1('0x1d')]);_0x4bf7a8['stop']();}};}; \ 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 7362f79..c4cf67b 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 _0xb596=['[%s][AMAZONLEX]\x20%s','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','amazonlex','create','then','dialogState','Failed','moment','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','account','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','catch','error'];(function(_0x2e3712,_0x1d0369){var _0x301251=function(_0x31249d){while(--_0x31249d){_0x2e3712['push'](_0x2e3712['shift']());}};_0x301251(++_0x1d0369);}(_0xb596,0x92));var _0x6b59=function(_0x2bb702,_0xac8ea){_0x2bb702=_0x2bb702-0x0;var _0x1551f6=_0xb596[_0x2bb702];return _0x1551f6;};'use strict';var _=require('lodash');var moment=require(_0x6b59('0x0'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x6b59('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6b59('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6b59('0x3')),'faxMessage':require(_0x6b59('0x4'))};exports[_0x6b59('0x5')]=function(_0x24bfcf,_0x1328a9){return function(_0x1cef9b){try{if(!_['isNil'](this[_0x6b59('0x6')][_0x6b59('0x7')])){logger[_0x6b59('0x8')]('[%s][AMAZONLEX]\x20%s',_0x24bfcf,_0x6b59('0x9'));return _0x1cef9b[_0x6b59('0xa')]();}var _0xb6d2b8={'ContactId':this[_0x6b59('0xb')]['id'],'sentAt':moment()[_0x6b59('0xc')](_0x6b59('0xd')),'direction':'out'};var _0x473554=this['channel'];if(_0x473554==='chat'){_0xb6d2b8['ChatWebsiteId']=this[_0x6b59('0xe')]['id'];}else{_0xb6d2b8[_['upperFirst'](_0x473554)+_0x6b59('0xf')]=this[_0x6b59('0xe')]['id'];}_0xb6d2b8[_['upperFirst'](_0x473554)+_0x6b59('0x10')]=this[_0x6b59('0x6')]['id'];if(this[_0x6b59('0x6')][_0x6b59('0x11')]){var _0x2273ca=_0x1328a9[0x4];if(!_[_0x6b59('0x12')](_0x2273ca)){_0xb6d2b8[_0x6b59('0x13')]=utils[_0x6b59('0x14')](_0x2273ca,this);return rpc[_0x473554+_0x6b59('0x15')]['create'](_0xb6d2b8)['then'](function(_0x59936d){logger[_0x6b59('0x8')]('[%s][AMAZONLEX]\x20%s',_0x24bfcf,_0xb6d2b8['body']);})[_0x6b59('0x16')](function(_0x56e257){logger[_0x6b59('0x17')](_0x6b59('0x18'),_0x24bfcf,JSON[_0x6b59('0x19')](_0x56e257));})['finally'](function(){logger['info'](_0x6b59('0x1a'),_0x24bfcf);_0x1cef9b[_0x6b59('0x1b')]();});}else{logger[_0x6b59('0x8')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x24bfcf);_0x1cef9b['stop']();}}else{var _0x3687a9=this;var _0x40e581=new AWS['LexRuntime']({'accessKeyId':_0x1328a9[0x0],'secretAccessKey':_0x1328a9[0x1],'region':_0x1328a9[0x2]});var _0x1d6a5f={'botAlias':'$LATEST','botName':_0x1328a9[0x3],'inputText':this['message'][_0x6b59('0x13')],'userId':this['interaction']['id']['toString']()};_0x40e581['postText'](_0x1d6a5f,function(_0x562105,_0x106650){if(_0x562105){logger[_0x6b59('0x17')](_0x6b59('0x18'),_0x24bfcf,_0x562105[_0x6b59('0x1c')]);_0x1cef9b[_0x6b59('0xa')]();}else if(_0x106650&&_0x106650[_0x6b59('0x1c')]){_0x3687a9[_0x6b59('0x13')][_0x6b59('0x1d')]=_0x106650;_0xb6d2b8[_0x6b59('0x13')]=_0x106650[_0x6b59('0x1c')];return rpc[_0x473554+_0x6b59('0x15')][_0x6b59('0x1e')](_0xb6d2b8)[_0x6b59('0x1f')](function(_0x2c8a59){logger[_0x6b59('0x8')](_0x6b59('0x18'),_0x24bfcf,_0xb6d2b8[_0x6b59('0x13')]);if(_0x106650[_0x6b59('0x20')]==_0x6b59('0x21')){_0x1cef9b[_0x6b59('0xa')]();}else{_0x1cef9b['stop']();}})['catch'](function(_0xa251d5){logger[_0x6b59('0x17')](_0x6b59('0x18'),_0x24bfcf,JSON[_0x6b59('0x19')](_0xa251d5));_0x1cef9b[_0x6b59('0xa')]();});}else{_0x1cef9b[_0x6b59('0xa')]();}});}}catch(_0x12b7d1){logger[_0x6b59('0x17')](_0x6b59('0x18'),_0x24bfcf,JSON[_0x6b59('0x19')](_0x12b7d1));_0x1cef9b['stop']();}};}; \ No newline at end of file +var _0x4969=['stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','amazonlex','create','then','Failed','catch','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','created','isEmpty','body','Message','error','stringify','finally'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4969,0x15b));var _0x9496=function(_0xaf29da,_0x117f5a){_0xaf29da=_0xaf29da-0x0;var _0x295c51=_0x4969[_0xaf29da];return _0x295c51;};'use strict';var _=require(_0x9496('0x0'));var moment=require(_0x9496('0x1'));var AWS=require('aws-sdk');var utils=require(_0x9496('0x2'));var logger=require(_0x9496('0x3'))(_0x9496('0x4'));var rpc={'chatMessage':require(_0x9496('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x9496('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x9496('0x7'))};exports[_0x9496('0x8')]=function(_0x1c3006,_0x32e91c){return function(_0x20bedf){try{if(!_['isNil'](this['interaction'][_0x9496('0x9')])){logger[_0x9496('0xa')](_0x9496('0xb'),_0x1c3006,_0x9496('0xc'));return _0x20bedf[_0x9496('0xd')]();}var _0x4b7ded={'ContactId':this[_0x9496('0xe')]['id'],'sentAt':moment()[_0x9496('0xf')](_0x9496('0x10')),'direction':'out'};var _0x1bf52e=this[_0x9496('0x11')];if(_0x1bf52e==='chat'){_0x4b7ded[_0x9496('0x12')]=this[_0x9496('0x13')]['id'];}else{_0x4b7ded[_[_0x9496('0x14')](_0x1bf52e)+_0x9496('0x15')]=this[_0x9496('0x13')]['id'];}_0x4b7ded[_[_0x9496('0x14')](_0x1bf52e)+_0x9496('0x16')]=this[_0x9496('0x17')]['id'];if(this['interaction'][_0x9496('0x18')]){var _0x1e79a9=_0x32e91c[0x4];if(!_[_0x9496('0x19')](_0x1e79a9)){_0x4b7ded[_0x9496('0x1a')]=utils['getMustacheRender'](_0x1e79a9,this);return rpc[_0x1bf52e+_0x9496('0x1b')]['create'](_0x4b7ded)['then'](function(_0x308c6d){logger['info']('[%s][AMAZONLEX]\x20%s',_0x1c3006,_0x4b7ded[_0x9496('0x1a')]);})['catch'](function(_0x10d833){logger[_0x9496('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x1c3006,JSON[_0x9496('0x1d')](_0x10d833));})[_0x9496('0x1e')](function(){logger[_0x9496('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1c3006);_0x20bedf[_0x9496('0x1f')]();});}else{logger[_0x9496('0xa')](_0x9496('0x20'),_0x1c3006);_0x20bedf[_0x9496('0x1f')]();}}else{var _0x3822a2=this;var _0x13b9e3=new AWS['LexRuntime']({'accessKeyId':_0x32e91c[0x0],'secretAccessKey':_0x32e91c[0x1],'region':_0x32e91c[0x2]});var _0x389e0f={'botAlias':_0x9496('0x21'),'botName':_0x32e91c[0x3],'inputText':this[_0x9496('0x22')]['body'],'userId':this[_0x9496('0x17')]['id'][_0x9496('0x23')]()};_0x13b9e3[_0x9496('0x24')](_0x389e0f,function(_0x218340,_0x479072){if(_0x218340){logger['error']('[%s][AMAZONLEX]\x20%s',_0x1c3006,_0x218340[_0x9496('0x22')]);_0x20bedf[_0x9496('0xd')]();}else if(_0x479072&&_0x479072[_0x9496('0x22')]){_0x3822a2[_0x9496('0x1a')][_0x9496('0x25')]=_0x479072;_0x4b7ded['body']=_0x479072[_0x9496('0x22')];return rpc[_0x1bf52e+'Message'][_0x9496('0x26')](_0x4b7ded)[_0x9496('0x27')](function(_0x20b2d1){logger['info']('[%s][AMAZONLEX]\x20%s',_0x1c3006,_0x4b7ded[_0x9496('0x1a')]);if(_0x479072['dialogState']==_0x9496('0x28')){_0x20bedf[_0x9496('0xd')]();}else{_0x20bedf['stop']();}})[_0x9496('0x29')](function(_0x5e3be2){logger[_0x9496('0x1c')](_0x9496('0xb'),_0x1c3006,JSON[_0x9496('0x1d')](_0x5e3be2));_0x20bedf[_0x9496('0xd')]();});}else{_0x20bedf[_0x9496('0xd')]();}});}}catch(_0x4c26b4){logger['error'](_0x9496('0xb'),_0x1c3006,JSON[_0x9496('0x1d')](_0x4c26b4));_0x20bedf['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index aa01b62..6f0f8aa 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 _0x70e0=['from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','upperFirst','AccountId','account','Message','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','html','','replace','','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','then','error','finally','next','create','body','catch','stringify','stop','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','channel','getMustacheRender','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message'];(function(_0x378c00,_0x168116){var _0x41ae20=function(_0x26c1fe){while(--_0x26c1fe){_0x378c00['push'](_0x378c00['shift']());}};_0x41ae20(++_0x168116);}(_0x70e0,0x17b));var _0x070e=function(_0x4cdfcf,_0x18d7c3){_0x4cdfcf=_0x4cdfcf-0x0;var _0x25f04e=_0x70e0[_0x4cdfcf];return _0x25f04e;};'use strict';var _=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var utils=require(_0x070e('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x070e('0x3')),'openchannelMessage':require(_0x070e('0x4')),'mailMessage':require(_0x070e('0x5')),'smsMessage':require(_0x070e('0x6')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x070e('0x7'));exports['consequence']=function(_0x46fe68,_0x4b041d){return function(_0x56e420){try{if(_0x4b041d[0x0]==='1'&&(_['isNil'](this[_0x070e('0x8')][_0x070e('0x9')])||!this[_0x070e('0x8')][_0x070e('0x9')])){logger[_0x070e('0xa')](_0x070e('0xb'),_0x46fe68,_0x070e('0xc'));return _0x56e420['next']();}var _0x49b2fb=this[_0x070e('0xd')];var _0x2e3e5e={'body':utils[_0x070e('0xe')](_0x4b041d[0x1],this),'ContactId':this[_0x070e('0xf')]['id'],'sentAt':moment()[_0x070e('0x10')](_0x070e('0x11')),'direction':_0x070e('0x12')};if(this[_0x070e('0x13')]){_0x2e3e5e['to']=this[_0x070e('0x13')][_0x070e('0x14')]||'';_0x2e3e5e['cc']=this[_0x070e('0x13')]['cc']||'';_0x2e3e5e['from']=this['message']['to']||'';_0x2e3e5e[_0x070e('0x15')]=this['message']['phone']||'';_0x2e3e5e['read']=!![];if(this[_0x070e('0x13')][_0x070e('0x16')]){_0x2e3e5e['subject']='';_0x2e3e5e['subject']+=_[_0x070e('0x17')](this[_0x070e('0x13')][_0x070e('0x16')],_0x070e('0x18'))?'':'Re:\x20';_0x2e3e5e['subject']+=this[_0x070e('0x13')][_0x070e('0x16')];}}if(this[_0x070e('0xd')]===_0x070e('0x19')){_0x2e3e5e[_0x070e('0x1a')]=this['account']['id'];}else{_0x2e3e5e[_[_0x070e('0x1b')](this[_0x070e('0xd')])+_0x070e('0x1c')]=this[_0x070e('0x1d')]['id'];}_0x2e3e5e[_[_0x070e('0x1b')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x070e('0xd')]+_0x070e('0x1e')]){if(this[_0x070e('0xd')]==='mail'){var _0x5b184={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x070e('0x1f')][_0x070e('0x20')]){_0x5b184[_0x070e('0x20')]=this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x20')];}else{_0x5b184[_0x070e('0x21')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x21')];_0x5b184[_0x070e('0x22')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x22')];_0x5b184['secure']=this['account'][_0x070e('0x1f')][_0x070e('0x23')];}if(this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x24')]){_0x5b184['auth']={'user':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x25')],'pass':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x26')]};}_0x2e3e5e[_0x070e('0x27')]=this[_0x070e('0x13')]['messageId'];_0x2e3e5e[_0x070e('0x28')]=_0x070e('0x29')+_[_0x070e('0x2a')](_0x2e3e5e['body'],'','body','','then','info','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','[%s][AUTOREPLY]\x20%s','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Message','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc'];(function(_0x43ac7e,_0x69d02){var _0x404460=function(_0x19a005){while(--_0x19a005){_0x43ac7e['push'](_0x43ac7e['shift']());}};_0x404460(++_0x69d02);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3da612,_0x332456){_0x3da612=_0x3da612-0x0;var _0x1a9d1d=_0xcb91[_0x3da612];return _0x1a9d1d;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x1cb9('0x0'));var logger=require(_0x1cb9('0x1'))(_0x1cb9('0x2'));var rpc={'chatMessage':require(_0x1cb9('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1cb9('0x4')),'smsMessage':require(_0x1cb9('0x5')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x1cb9('0x6'));exports[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return function(_0x3f7deb){try{if(_0x226b69[0x0]==='1'&&(_['isNil'](this[_0x1cb9('0x8')][_0x1cb9('0x9')])||!this['interaction'][_0x1cb9('0x9')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x53ffbd,_0x1cb9('0xa'));return _0x3f7deb[_0x1cb9('0xb')]();}var _0x74ce19=this[_0x1cb9('0xc')];var _0x2fc627={'body':utils['getMustacheRender'](_0x226b69[0x1],this),'ContactId':this[_0x1cb9('0xd')]['id'],'sentAt':moment()[_0x1cb9('0xe')](_0x1cb9('0xf')),'direction':_0x1cb9('0x10')};if(this[_0x1cb9('0x11')]){_0x2fc627['to']=this['message']['from']||'';_0x2fc627['cc']=this['message']['cc']||'';_0x2fc627[_0x1cb9('0x12')]=this[_0x1cb9('0x11')]['to']||'';_0x2fc627[_0x1cb9('0x13')]=this[_0x1cb9('0x11')]['phone']||'';_0x2fc627[_0x1cb9('0x14')]=!![];if(this[_0x1cb9('0x11')][_0x1cb9('0x15')]){_0x2fc627[_0x1cb9('0x15')]='';_0x2fc627[_0x1cb9('0x15')]+=_['startsWith'](this['message'][_0x1cb9('0x15')],_0x1cb9('0x16'))?'':_0x1cb9('0x17');_0x2fc627[_0x1cb9('0x15')]+=this[_0x1cb9('0x11')][_0x1cb9('0x15')];}}if(this[_0x1cb9('0xc')]==='chat'){_0x2fc627['ChatWebsiteId']=this[_0x1cb9('0x18')]['id'];}else{_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+_0x1cb9('0x1a')]=this[_0x1cb9('0x18')]['id'];}_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x1cb9('0xc')]+'Message']){if(this[_0x1cb9('0xc')]===_0x1cb9('0x1b')){var _0x523b26={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1d')]){_0x523b26[_0x1cb9('0x1d')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1d')];}else{_0x523b26['host']=this['account'][_0x1cb9('0x1c')]['host'];_0x523b26[_0x1cb9('0x1e')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1e')];_0x523b26[_0x1cb9('0x1f')]=this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1f')];}if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x20')]){_0x523b26[_0x1cb9('0x21')]={'user':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x22')],'pass':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x23')]};}_0x2fc627[_0x1cb9('0x24')]=this['message'][_0x1cb9('0x25')];_0x2fc627['html']=_0x1cb9('0x26')+_['replace'](_0x2fc627[_0x1cb9('0x27')],_0x1cb9('0x28'),_0x1cb9('0x29'))+_0x1cb9('0x2a');return mailRpc['sendMailMessage'](_0x523b26,_0x2fc627)[_0x1cb9('0x2b')](function(_0x4eba82){logger[_0x1cb9('0x2c')](_0x1cb9('0x2d'),_0x53ffbd);_0x2fc627[_0x1cb9('0x25')]=_0x4eba82['message'][_0x1cb9('0x25')];return rpc[_0x74ce19+'Message'][_0x1cb9('0x2e')](_0x2fc627);})['then'](function(_0x2164e3){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2164e3));})['catch'](function(_0x2114a4){logger[_0x1cb9('0x31')](_0x1cb9('0x32'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2114a4));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}else{return rpc[this[_0x1cb9('0xc')]+_0x1cb9('0x34')][_0x1cb9('0x2e')](_0x2fc627)[_0x1cb9('0x2b')](function(_0x294eec){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,_0x2fc627['body']);})['catch'](function(_0x299ff8){logger[_0x1cb9('0x31')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x299ff8));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}}}catch(_0x35f5e8){logger[_0x1cb9('0x31')]('[%s][AUTOREPLY]\x20%s',_0x53ffbd,JSON[_0x1cb9('0x30')](_0x35f5e8));_0x3f7deb[_0x1cb9('0x35')]();}};}; \ 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 64ae562..55c7e9d 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 _0xbfa6=['update','interaction','then','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction'];(function(_0x10aaf4,_0xa7bf){var _0x34b599=function(_0xbcfeb0){while(--_0xbcfeb0){_0x10aaf4['push'](_0x10aaf4['shift']());}};_0x34b599(++_0xa7bf);}(_0xbfa6,0x1d0));var _0x6bfa=function(_0x3e1829,_0xc8ccda){_0x3e1829=_0x3e1829-0x0;var _0x129345=_0xbfa6[_0x3e1829];return _0x129345;};'use strict';var moment=require(_0x6bfa('0x0'));var logger=require(_0x6bfa('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x6bfa('0x2')),'mailInteraction':require(_0x6bfa('0x3')),'faxInteraction':require(_0x6bfa('0x4'))};exports['consequence']=function(_0x3f77fa,_0x156c9a,_0x473131,_0x39d9a3){return function(_0x3a3a1a){try{logger[_0x6bfa('0x5')](_0x6bfa('0x6'),_0x3f77fa,_0x156c9a[0x0]);var _0x5b4337={'closed':0x1,'closedAt':moment()[_0x6bfa('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x6bfa('0x8'),'disposition':_0x156c9a[0x0]};if(rpc[_0x39d9a3[_0x6bfa('0x9')]+_0x6bfa('0xa')]){rpc[_0x39d9a3[_0x6bfa('0x9')]+_0x6bfa('0xa')][_0x6bfa('0xb')](_0x39d9a3[_0x6bfa('0xc')]['id'],_0x5b4337)[_0x6bfa('0xd')](function(_0x2a6dc8){logger[_0x6bfa('0x5')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x3f77fa,_0x39d9a3[_0x6bfa('0xc')]['id']);})[_0x6bfa('0xe')](function(_0x117d46){logger['error'](_0x6bfa('0xf'),_0x3f77fa,JSON[_0x6bfa('0x10')](_0x117d46));})[_0x6bfa('0x11')](function(){_0x3a3a1a[_0x6bfa('0x12')]();});}}catch(_0x2e8b3c){logger['error'](_0x6bfa('0xf'),_0x3f77fa,JSON['stringify'](_0x2e8b3c));_0x3a3a1a[_0x6bfa('0x12')]();}};}; \ No newline at end of file +var _0x1707=['[%s][CLOSE]\x20%s','finally','stop','stringify','moment','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error'];(function(_0x34c26b,_0x5e279b){var _0x2f9f58=function(_0x273abe){while(--_0x273abe){_0x34c26b['push'](_0x34c26b['shift']());}};_0x2f9f58(++_0x5e279b);}(_0x1707,0x1df));var _0x7170=function(_0x466957,_0x400c67){_0x466957=_0x466957-0x0;var _0x245b90=_0x1707[_0x466957];return _0x245b90;};'use strict';var moment=require(_0x7170('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x7170('0x1')),'smsInteraction':require(_0x7170('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x7170('0x3'))};exports[_0x7170('0x4')]=function(_0xe5a03c,_0x3829bb,_0xcc6e16,_0x19d043){return function(_0x215acb){try{logger[_0x7170('0x5')](_0x7170('0x6'),_0xe5a03c,_0x3829bb[0x0]);var _0x1f574e={'closed':0x1,'closedAt':moment()[_0x7170('0x7')](_0x7170('0x8')),'closeReason':_0x7170('0x9'),'disposition':_0x3829bb[0x0]};if(rpc[_0x19d043[_0x7170('0xa')]+_0x7170('0xb')]){rpc[_0x19d043[_0x7170('0xa')]+_0x7170('0xb')]['update'](_0x19d043[_0x7170('0xc')]['id'],_0x1f574e)['then'](function(_0x37e76a){logger[_0x7170('0x5')](_0x7170('0xd'),_0xe5a03c,_0x19d043['interaction']['id']);})['catch'](function(_0x4fc693){logger[_0x7170('0xe')](_0x7170('0xf'),_0xe5a03c,JSON['stringify'](_0x4fc693));})[_0x7170('0x10')](function(){_0x215acb[_0x7170('0x11')]();});}}catch(_0x4521e9){logger[_0x7170('0xe')](_0x7170('0xf'),_0xe5a03c,JSON[_0x7170('0x12')](_0x4521e9));_0x215acb['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 10a2f85..0636973 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 _0xc41d=['next','out','channel','ChatWebsiteId','account','upperFirst','interaction','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][DIALOGFLOW]\x20%s','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','metadata','stop','lodash','moment','apiai-promise','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.'];(function(_0x1135b8,_0x7340ee){var _0x53e4df=function(_0x41ba0a){while(--_0x41ba0a){_0x1135b8['push'](_0x1135b8['shift']());}};_0x53e4df(++_0x7340ee);}(_0xc41d,0x1a2));var _0xdc41=function(_0x1b8004,_0x31f0df){_0x1b8004=_0x1b8004-0x0;var _0xe16222=_0xc41d[_0x1b8004];return _0xe16222;};'use strict';var _=require(_0xdc41('0x0'));var moment=require(_0xdc41('0x1'));var apiai=require(_0xdc41('0x2'));var md5=require('md5');var utils=require('./utils');var logger=require(_0xdc41('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xdc41('0x4')),'mailMessage':require(_0xdc41('0x5')),'smsMessage':require(_0xdc41('0x6')),'faxMessage':require(_0xdc41('0x7'))};exports[_0xdc41('0x8')]=function(_0x2ca26f,_0x10c872){return function(_0x301afa){try{if(!_['isNil'](this['interaction'][_0xdc41('0x9')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x2ca26f,_0xdc41('0xa'));return _0x301afa[_0xdc41('0xb')]();}var _0x467f3e={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xdc41('0xc')};var _0x17185a=this[_0xdc41('0xd')];if(_0x17185a==='chat'){_0x467f3e[_0xdc41('0xe')]=this['account']['id'];}else{_0x467f3e[_['upperFirst'](_0x17185a)+'AccountId']=this[_0xdc41('0xf')]['id'];}_0x467f3e[_[_0xdc41('0x10')](_0x17185a)+'InteractionId']=this[_0xdc41('0x11')]['id'];if(this['interaction'][_0xdc41('0x12')]){var _0x5dcf6a=_0x10c872[0x2];if(!_[_0xdc41('0x13')](_0x5dcf6a)){_0x467f3e[_0xdc41('0x14')]=utils[_0xdc41('0x15')](_0x5dcf6a,this);return rpc[_0x17185a+_0xdc41('0x16')][_0xdc41('0x17')](_0x467f3e)[_0xdc41('0x18')](function(_0x20ca7f){logger['info'](_0xdc41('0x19'),_0x2ca26f,_0x467f3e['body']);})[_0xdc41('0x1a')](function(_0x64b38e){logger[_0xdc41('0x1b')](_0xdc41('0x19'),_0x2ca26f,JSON[_0xdc41('0x1c')](_0x64b38e));})['finally'](function(){logger['info'](_0xdc41('0x1d'),_0x2ca26f);_0x301afa['stop']();});}else{logger[_0xdc41('0x1e')](_0xdc41('0x1f'),_0x2ca26f);_0x301afa['stop']();}}else{var _0x3ce1fc=this;var _0x1a48ed=apiai(_0x10c872[0x0],{'language':_0x10c872[0x1]||'en'});return _0x1a48ed[_0xdc41('0x20')](this[_0xdc41('0x21')][_0xdc41('0x14')],{'sessionId':md5(this['interaction']['id'])})[_0xdc41('0x18')](function(_0x565ad3){_0x3ce1fc[_0xdc41('0x14')][_0xdc41('0x22')]=_0x565ad3;_0x467f3e[_0xdc41('0x14')]=_0x565ad3[_0xdc41('0x23')][_0xdc41('0x24')]['speech'];return rpc[_0x17185a+'Message'][_0xdc41('0x17')](_0x467f3e)['then'](function(_0x5ac11a){logger[_0xdc41('0x1e')](_0xdc41('0x19'),_0x2ca26f,_0x467f3e[_0xdc41('0x14')]);if(_0x565ad3[_0xdc41('0x23')][_0xdc41('0x25')]['endConversation']){_0x301afa[_0xdc41('0xb')]();}else{_0x301afa[_0xdc41('0x26')]();}})[_0xdc41('0x1a')](function(_0x3da1ed){logger[_0xdc41('0x1b')](_0xdc41('0x19'),_0x2ca26f,JSON[_0xdc41('0x1c')](_0x3da1ed));_0x301afa['next']();});})[_0xdc41('0x1a')](function(_0x187977){logger['error'](_0xdc41('0x19'),_0x2ca26f,_0x187977['message']);_0x301afa[_0xdc41('0xb')]();});}}catch(_0x3004fb){logger[_0xdc41('0x1b')](_0xdc41('0x19'),_0x2ca26f,JSON[_0xdc41('0x1c')](_0x3004fb));_0x301afa[_0xdc41('0x26')]();}};}; \ No newline at end of file +var _0x9392=['[%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','speech','create','metadata','endConversation','lodash','apiai-promise','md5','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','interaction','created','isEmpty','body','getMustacheRender','Message','then','info','catch','error','stringify','finally'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x9392,0x17a));var _0x2939=function(_0xe02ad0,_0x52353b){_0xe02ad0=_0xe02ad0-0x0;var _0x54e767=_0x9392[_0xe02ad0];return _0x54e767;};'use strict';var _=require(_0x2939('0x0'));var moment=require('moment');var apiai=require(_0x2939('0x1'));var md5=require(_0x2939('0x2'));var utils=require('./utils');var logger=require(_0x2939('0x3'))(_0x2939('0x4'));var rpc={'chatMessage':require(_0x2939('0x5')),'openchannelMessage':require(_0x2939('0x6')),'mailMessage':require(_0x2939('0x7')),'smsMessage':require(_0x2939('0x8')),'faxMessage':require(_0x2939('0x9'))};exports[_0x2939('0xa')]=function(_0x32f11b,_0x40da07){return function(_0x32d3d0){try{if(!_[_0x2939('0xb')](this['interaction'][_0x2939('0xc')])){logger['info'](_0x2939('0xd'),_0x32f11b,_0x2939('0xe'));return _0x32d3d0[_0x2939('0xf')]();}var _0x156107={'ContactId':this[_0x2939('0x10')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x2939('0x11')};var _0x51d8f6=this[_0x2939('0x12')];if(_0x51d8f6==='chat'){_0x156107[_0x2939('0x13')]=this['account']['id'];}else{_0x156107[_[_0x2939('0x14')](_0x51d8f6)+_0x2939('0x15')]=this[_0x2939('0x16')]['id'];}_0x156107[_[_0x2939('0x14')](_0x51d8f6)+_0x2939('0x17')]=this[_0x2939('0x18')]['id'];if(this[_0x2939('0x18')][_0x2939('0x19')]){var _0xbbde67=_0x40da07[0x2];if(!_[_0x2939('0x1a')](_0xbbde67)){_0x156107[_0x2939('0x1b')]=utils[_0x2939('0x1c')](_0xbbde67,this);return rpc[_0x51d8f6+_0x2939('0x1d')]['create'](_0x156107)[_0x2939('0x1e')](function(_0x1b3aaa){logger[_0x2939('0x1f')](_0x2939('0xd'),_0x32f11b,_0x156107['body']);})[_0x2939('0x20')](function(_0x52ffe9){logger[_0x2939('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x32f11b,JSON[_0x2939('0x22')](_0x52ffe9));})[_0x2939('0x23')](function(){logger[_0x2939('0x1f')](_0x2939('0x24'),_0x32f11b);_0x32d3d0[_0x2939('0x25')]();});}else{logger[_0x2939('0x1f')](_0x2939('0x26'),_0x32f11b);_0x32d3d0['stop']();}}else{var _0x16a70d=this;var _0x359c77=apiai(_0x40da07[0x0],{'language':_0x40da07[0x1]||'en'});return _0x359c77['textRequest'](this[_0x2939('0x27')][_0x2939('0x1b')],{'sessionId':md5(this[_0x2939('0x18')]['id'])})[_0x2939('0x1e')](function(_0x501fb7){_0x16a70d[_0x2939('0x1b')][_0x2939('0x28')]=_0x501fb7;_0x156107[_0x2939('0x1b')]=_0x501fb7[_0x2939('0x29')]['fulfillment'][_0x2939('0x2a')];return rpc[_0x51d8f6+'Message'][_0x2939('0x2b')](_0x156107)['then'](function(_0x2b1ddb){logger[_0x2939('0x1f')](_0x2939('0xd'),_0x32f11b,_0x156107['body']);if(_0x501fb7[_0x2939('0x29')][_0x2939('0x2c')][_0x2939('0x2d')]){_0x32d3d0[_0x2939('0xf')]();}else{_0x32d3d0[_0x2939('0x25')]();}})[_0x2939('0x20')](function(_0x392135){logger['error'](_0x2939('0xd'),_0x32f11b,JSON[_0x2939('0x22')](_0x392135));_0x32d3d0[_0x2939('0xf')]();});})[_0x2939('0x20')](function(_0x29ea8c){logger['error'](_0x2939('0xd'),_0x32f11b,_0x29ea8c['message']);_0x32d3d0[_0x2939('0xf')]();});}}catch(_0x32283e){logger[_0x2939('0x21')](_0x2939('0xd'),_0x32f11b,JSON['stringify'](_0x32283e));_0x32d3d0['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 6a2e919..6838fd1 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 _0xe61c=['next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','message','join','condition','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x2e59a4,_0x2c1eb3){var _0x51d493=function(_0x35b05a){while(--_0x35b05a){_0x2e59a4['push'](_0x2e59a4['shift']());}};_0x51d493(++_0x2c1eb3);}(_0xe61c,0x1a9));var _0xce61=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0xe61c[_0x1f8053];return _0x174fd8;};'use strict';var schema=require(_0xce61('0x0'));var _=require(_0xce61('0x1'));var htmlToText=require(_0xce61('0x2'));var utils=require('./utils');var logger=require(_0xce61('0x3'))(_0xce61('0x4'));var gotoif=schema({'condition':{'type':_0xce61('0x5'),'required':!![],'message':_0xce61('0x6')},'priorityTrue':{'type':'number','message':_0xce61('0x7')},'priorityFalse':{'type':_0xce61('0x8'),'message':_0xce61('0x9')}});exports['consequence']=function(_0x263653,_0x548846){return function(_0x31c483){try{var _0x50465d={'condition':htmlToText['fromString'](utils[_0xce61('0xa')](_0x548846[0x0],this),{'wordwrap':![]})[_0xce61('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x548846[0x1],'priorityFalse':_0x548846[0x2]};var _0x3e85d0=gotoif[_0xce61('0x0')](_0x50465d,{'typecast':!![]});if(_0x3e85d0[_0xce61('0xc')]){logger[_0xce61('0xd')](_0xce61('0xe'),_0x263653,_['map'](_0x3e85d0,_0xce61('0xf'))[_0xce61('0x10')](',\x20'));_0x31c483['stop']();}else{try{var _0x257074=eval('('+_0x50465d[_0xce61('0x11')]+')');var _0x51d2e6=_0x257074?_0x50465d['priorityTrue']:_0x50465d['priorityFalse'];logger[_0xce61('0x12')](_0xce61('0x13'),_0x263653,_0x50465d['condition'],_0x257074,_0x51d2e6||'next');if(_0x51d2e6){var _0x428025=_[_0xce61('0x14')](_0x31c483[_0xce61('0x15')](),{'p':_0x51d2e6});if(_0x428025>=0x0){logger['info'](_0xce61('0x16'),_0x263653,_0x51d2e6||_0xce61('0x17'),_0x428025);_0x31c483[_0xce61('0x17')](_0x428025);}else{logger[_0xce61('0x12')](_0xce61('0x18'),_0x263653,_0x51d2e6||_0xce61('0x17'));_0x31c483[_0xce61('0x19')]();}}else{_0x31c483[_0xce61('0x17')]();}}catch(_0x35e5e8){logger[_0xce61('0xd')](_0xce61('0x1a'),_0x263653,_0x35e5e8[_0xce61('0xf')]);_0x31c483[_0xce61('0x19')]();}}}catch(_0x3c91e6){logger['error']('[%s][GOTOIF]\x20%s',_0x263653,JSON[_0xce61('0x1b')](_0x3c91e6));_0x31c483['stop']();}};}; \ No newline at end of file +var _0x7a12=['validate','lodash','html-to-text','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','[%s][GOTOIF]\x20%s','map','message','condition','priorityTrue','priorityFalse','info','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stop','stringify'];(function(_0x5aa9d6,_0x56eb8b){var _0x48f997=function(_0x2f53a0){while(--_0x2f53a0){_0x5aa9d6['push'](_0x5aa9d6['shift']());}};_0x48f997(++_0x56eb8b);}(_0x7a12,0x1c0));var _0x27a1=function(_0x272daf,_0x4619ff){_0x272daf=_0x272daf-0x0;var _0x523fee=_0x7a12[_0x272daf];return _0x523fee;};'use strict';var schema=require(_0x27a1('0x0'));var _=require(_0x27a1('0x1'));var htmlToText=require(_0x27a1('0x2'));var utils=require(_0x27a1('0x3'));var logger=require('../../../../config/logger')(_0x27a1('0x4'));var gotoif=schema({'condition':{'type':_0x27a1('0x5'),'required':!![],'message':_0x27a1('0x6')},'priorityTrue':{'type':_0x27a1('0x7'),'message':_0x27a1('0x8')},'priorityFalse':{'type':_0x27a1('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x27a1('0x9')]=function(_0x64ccaf,_0x3784dd){return function(_0x1a341c){try{var _0x360a40={'condition':htmlToText[_0x27a1('0xa')](utils[_0x27a1('0xb')](_0x3784dd[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3784dd[0x1],'priorityFalse':_0x3784dd[0x2]};var _0x4cd767=gotoif[_0x27a1('0x0')](_0x360a40,{'typecast':!![]});if(_0x4cd767[_0x27a1('0xc')]){logger['error'](_0x27a1('0xd'),_0x64ccaf,_[_0x27a1('0xe')](_0x4cd767,_0x27a1('0xf'))['join'](',\x20'));_0x1a341c['stop']();}else{try{var _0x191249=eval('('+_0x360a40[_0x27a1('0x10')]+')');var _0xf8ed51=_0x191249?_0x360a40[_0x27a1('0x11')]:_0x360a40[_0x27a1('0x12')];logger[_0x27a1('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x64ccaf,_0x360a40['condition'],_0x191249,_0xf8ed51||_0x27a1('0x14'));if(_0xf8ed51){var _0x17df6a=_[_0x27a1('0x15')](_0x1a341c[_0x27a1('0x16')](),{'p':_0xf8ed51});if(_0x17df6a>=0x0){logger['info'](_0x27a1('0x17'),_0x64ccaf,_0xf8ed51||_0x27a1('0x14'),_0x17df6a);_0x1a341c[_0x27a1('0x14')](_0x17df6a);}else{logger[_0x27a1('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x64ccaf,_0xf8ed51||'next');_0x1a341c['stop']();}}else{_0x1a341c[_0x27a1('0x14')]();}}catch(_0x1ac7ec){logger[_0x27a1('0x18')](_0x27a1('0x19'),_0x64ccaf,_0x1ac7ec[_0x27a1('0xf')]);_0x1a341c[_0x27a1('0x1a')]();}}}catch(_0x3d7e89){logger['error'](_0x27a1('0xd'),_0x64ccaf,JSON[_0x27a1('0x1b')](_0x3d7e89));_0x1a341c[_0x27a1('0x1a')]();}};}; \ 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 89c27e0..73640e9 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 _0x85dd=['join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message'];(function(_0x112500,_0x5e7ffd){var _0x2809a4=function(_0x15e441){while(--_0x15e441){_0x112500['push'](_0x112500['shift']());}};_0x2809a4(++_0x5e7ffd);}(_0x85dd,0x1c2));var _0xd85d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x85dd[_0x19e35c];return _0x3e1fe8;};'use strict';var schema=require(_0xd85d('0x0'));var _=require(_0xd85d('0x1'));var logger=require(_0xd85d('0x2'))(_0xd85d('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xd85d('0x4')}});exports['consequence']=function(_0x467bbe,_0x2ba75d){return function(_0x1bed1c){try{var _0x391ff={'priority':_0x2ba75d[0x0]};var _0x2a5d50=gotop['validate'](_0x391ff,{'typecast':!![]});if(_0x2a5d50[_0xd85d('0x5')]){logger[_0xd85d('0x6')](_0xd85d('0x7'),_0x467bbe,_[_0xd85d('0x8')](_0x2a5d50,_0xd85d('0x9'))[_0xd85d('0xa')](',\x20'));_0x1bed1c[_0xd85d('0xb')]();}else{logger[_0xd85d('0xc')](_0xd85d('0xd'),_0x467bbe,_0x391ff[_0xd85d('0xe')]);if(_0x391ff['priority']){var _0x3771a0=_[_0xd85d('0xf')](_0x1bed1c[_0xd85d('0x10')](),{'p':_0x391ff[_0xd85d('0xe')]});if(_0x3771a0>=0x0){logger[_0xd85d('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x467bbe,_0x391ff['priority']||_0xd85d('0x11'),_0x3771a0);_0x1bed1c[_0xd85d('0x11')](_0x3771a0);}else{logger[_0xd85d('0xc')](_0xd85d('0x12'),_0x467bbe,_0x391ff[_0xd85d('0xe')]||_0xd85d('0x11'));_0x1bed1c[_0xd85d('0xb')]();}}else{_0x1bed1c[_0xd85d('0x11')]();}}}catch(_0x45fc70){logger[_0xd85d('0x6')](_0xd85d('0x7'),_0x467bbe,JSON[_0xd85d('0x13')](_0x45fc70));_0x1bed1c[_0xd85d('0xb')]();}};}; \ No newline at end of file +var _0x8280=['map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','error','stringify','validate','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s'];(function(_0x37d958,_0x312f4a){var _0x1c9292=function(_0x25bdca){while(--_0x25bdca){_0x37d958['push'](_0x37d958['shift']());}};_0x1c9292(++_0x312f4a);}(_0x8280,0xd5));var _0x0828=function(_0x3fb780,_0x540d09){_0x3fb780=_0x3fb780-0x0;var _0x49bcf4=_0x8280[_0x3fb780];return _0x49bcf4;};'use strict';var schema=require(_0x0828('0x0'));var _=require('lodash');var logger=require(_0x0828('0x1'))('routing');var gotop=schema({'priority':{'type':_0x0828('0x2'),'required':!![],'message':_0x0828('0x3')}});exports[_0x0828('0x4')]=function(_0x1ff658,_0x3f4fce){return function(_0x1e637f){try{var _0x54d96b={'priority':_0x3f4fce[0x0]};var _0x11d775=gotop[_0x0828('0x0')](_0x54d96b,{'typecast':!![]});if(_0x11d775[_0x0828('0x5')]){logger['error'](_0x0828('0x6'),_0x1ff658,_[_0x0828('0x7')](_0x11d775,_0x0828('0x8'))[_0x0828('0x9')](',\x20'));_0x1e637f[_0x0828('0xa')]();}else{logger[_0x0828('0xb')](_0x0828('0xc'),_0x1ff658,_0x54d96b[_0x0828('0xd')]);if(_0x54d96b[_0x0828('0xd')]){var _0xd6eda9=_[_0x0828('0xe')](_0x1e637f[_0x0828('0xf')](),{'p':_0x54d96b[_0x0828('0xd')]});if(_0xd6eda9>=0x0){logger['info'](_0x0828('0x10'),_0x1ff658,_0x54d96b[_0x0828('0xd')]||_0x0828('0x11'),_0xd6eda9);_0x1e637f[_0x0828('0x11')](_0xd6eda9);}else{logger[_0x0828('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1ff658,_0x54d96b[_0x0828('0xd')]||_0x0828('0x11'));_0x1e637f[_0x0828('0xa')]();}}else{_0x1e637f['next']();}}}catch(_0x4a13e7){logger[_0x0828('0x12')](_0x0828('0x6'),_0x1ff658,JSON[_0x0828('0x13')](_0x4a13e7));_0x1e637f['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 6a5d699..77fb987 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 _0xfc50=['./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','account','upperFirst','interaction','Message','create','info','body','next','error','[%s][MESSAGE]\x20%s','stop','stringify'];(function(_0x39b68b,_0x4ad96d){var _0xae091f=function(_0x13b5e1){while(--_0x13b5e1){_0x39b68b['push'](_0x39b68b['shift']());}};_0xae091f(++_0x4ad96d);}(_0xfc50,0x1f4));var _0x0fc5=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xfc50[_0xae7c2f];return _0x5d7001;};'use strict';var _=require('lodash');var utils=require(_0x0fc5('0x0'));var logger=require(_0x0fc5('0x1'))(_0x0fc5('0x2'));var rpc={'chatMessage':require(_0x0fc5('0x3')),'openchannelMessage':require(_0x0fc5('0x4')),'mailMessage':require(_0x0fc5('0x5')),'smsMessage':require(_0x0fc5('0x6')),'faxMessage':require(_0x0fc5('0x7'))};exports[_0x0fc5('0x8')]=function(_0x1bdbcf,_0x29fb86){return function(_0x291b92){try{var _0x5483ae={'body':utils[_0x0fc5('0x9')](_0x29fb86[0x0],this),'ContactId':this[_0x0fc5('0xa')]['id']};if(this[_0x0fc5('0xb')]===_0x0fc5('0xc')){_0x5483ae['ChatWebsiteId']=this[_0x0fc5('0xd')]['id'];}else{_0x5483ae[_[_0x0fc5('0xe')](this['channel'])+'AccountId']=this[_0x0fc5('0xd')]['id'];}_0x5483ae[_[_0x0fc5('0xe')](this[_0x0fc5('0xb')])+'InteractionId']=this[_0x0fc5('0xf')]['id'];if(rpc[this[_0x0fc5('0xb')]+_0x0fc5('0x10')]){return rpc[this[_0x0fc5('0xb')]+_0x0fc5('0x10')][_0x0fc5('0x11')](_0x5483ae)['then'](function(_0x5be7ba){logger[_0x0fc5('0x12')]('[%s][MESSAGE]\x20%s',_0x1bdbcf,_0x5483ae[_0x0fc5('0x13')]);_0x291b92[_0x0fc5('0x14')]();})['catch'](function(_0x4f47a7){logger[_0x0fc5('0x15')](_0x0fc5('0x16'),_0x1bdbcf,JSON['stringify'](_0x4f47a7));_0x291b92[_0x0fc5('0x17')]();});}}catch(_0x479296){logger['error'](_0x0fc5('0x16'),_0x1bdbcf,JSON[_0x0fc5('0x18')](_0x479296));_0x291b92[_0x0fc5('0x17')]();}};}; \ No newline at end of file +var _0x2d62=['./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash'];(function(_0x5eedd4,_0x55ca1e){var _0x18ca2a=function(_0x58a83f){while(--_0x58a83f){_0x5eedd4['push'](_0x5eedd4['shift']());}};_0x18ca2a(++_0x55ca1e);}(_0x2d62,0x67));var _0x22d6=function(_0x5932ec,_0x494e31){_0x5932ec=_0x5932ec-0x0;var _0x16e7c4=_0x2d62[_0x5932ec];return _0x16e7c4;};'use strict';var _=require(_0x22d6('0x0'));var utils=require(_0x22d6('0x1'));var logger=require(_0x22d6('0x2'))(_0x22d6('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x22d6('0x4')),'mailMessage':require(_0x22d6('0x5')),'smsMessage':require(_0x22d6('0x6')),'faxMessage':require(_0x22d6('0x7'))};exports['consequence']=function(_0x10f82b,_0x5d4ca9){return function(_0x2406d7){try{var _0x4899f5={'body':utils[_0x22d6('0x8')](_0x5d4ca9[0x0],this),'ContactId':this['contact']['id']};if(this[_0x22d6('0x9')]==='chat'){_0x4899f5[_0x22d6('0xa')]=this[_0x22d6('0xb')]['id'];}else{_0x4899f5[_[_0x22d6('0xc')](this['channel'])+_0x22d6('0xd')]=this[_0x22d6('0xb')]['id'];}_0x4899f5[_['upperFirst'](this[_0x22d6('0x9')])+_0x22d6('0xe')]=this['interaction']['id'];if(rpc[this[_0x22d6('0x9')]+'Message']){return rpc[this[_0x22d6('0x9')]+_0x22d6('0xf')][_0x22d6('0x10')](_0x4899f5)[_0x22d6('0x11')](function(_0x6b31f7){logger[_0x22d6('0x12')](_0x22d6('0x13'),_0x10f82b,_0x4899f5[_0x22d6('0x14')]);_0x2406d7[_0x22d6('0x15')]();})[_0x22d6('0x16')](function(_0x24111c){logger[_0x22d6('0x17')](_0x22d6('0x13'),_0x10f82b,JSON[_0x22d6('0x18')](_0x24111c));_0x2406d7[_0x22d6('0x19')]();});}}catch(_0x4e2a5e){logger[_0x22d6('0x17')]('[%s][MESSAGE]\x20%s',_0x10f82b,JSON[_0x22d6('0x18')](_0x4e2a5e));_0x2406d7[_0x22d6('0x19')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 8e4425e..990579d 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 _0x4676=['consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop','./utils','routing'];(function(_0x35b541,_0x152875){var _0x20cf0c=function(_0x16f2cb){while(--_0x16f2cb){_0x35b541['push'](_0x35b541['shift']());}};_0x20cf0c(++_0x152875);}(_0x4676,0x1e4));var _0x6467=function(_0x535c0d,_0x3daaca){_0x535c0d=_0x535c0d-0x0;var _0xbfa052=_0x4676[_0x535c0d];return _0xbfa052;};'use strict';var utils=require(_0x6467('0x0'));var logger=require('../../../../config/logger')(_0x6467('0x1'));exports[_0x6467('0x2')]=function(_0x1bec2f,_0x1d560e){return function(_0x538d56){try{logger[_0x6467('0x3')](_0x6467('0x4'),_0x1bec2f,utils[_0x6467('0x5')](_0x1d560e[0x0],this));_0x538d56[_0x6467('0x6')]();}catch(_0x161a54){logger['error']('[%s][NOOP]\x20%s',_0x1bec2f,JSON[_0x6467('0x7')](_0x161a54));_0x538d56[_0x6467('0x8')]();}};}; \ No newline at end of file +var _0xbba0=['stringify','stop','./utils','../../../../config/logger','info','[%s][NOOP]\x20%s','error'];(function(_0x3f2cff,_0x161414){var _0x384ed7=function(_0x39547d){while(--_0x39547d){_0x3f2cff['push'](_0x3f2cff['shift']());}};_0x384ed7(++_0x161414);}(_0xbba0,0x1c2));var _0x0bba=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xbba0[_0x45783c];return _0x1161da;};'use strict';var utils=require(_0x0bba('0x0'));var logger=require(_0x0bba('0x1'))('routing');exports['consequence']=function(_0x191ae6,_0x46a242){return function(_0x25e331){try{logger[_0x0bba('0x2')](_0x0bba('0x3'),_0x191ae6,utils['getMustacheRender'](_0x46a242[0x0],this));_0x25e331['next']();}catch(_0x3c4050){logger[_0x0bba('0x4')](_0x0bba('0x3'),_0x191ae6,JSON[_0x0bba('0x5')](_0x3c4050));_0x25e331[_0x0bba('0x6')]();}};}; \ 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 8d77293..f1de2f0 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 _0x9f8e=['chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','stop','find','Queues','atimeout','rules','end','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','log','validate','lodash','util','moment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','account','queue','from','joinAt','emit','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message'];(function(_0x334b92,_0x5d1373){var _0x517e6e=function(_0x377df6){while(--_0x377df6){_0x334b92['push'](_0x334b92['shift']());}};_0x517e6e(++_0x5d1373);}(_0x9f8e,0x107));var _0xe9f8=function(_0x27f0a8,_0x1ed287){_0x27f0a8=_0x27f0a8-0x0;var _0x5cd21a=_0x9f8e[_0x27f0a8];return _0x5cd21a;};'use strict';var schema=require(_0xe9f8('0x0'));var _=require(_0xe9f8('0x1'));var util=require(_0xe9f8('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xe9f8('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0xe9f8('0x4'))(_0xe9f8('0x5'));var strategy=require(_0xe9f8('0x6'));config[_0xe9f8('0x7')]=_[_0xe9f8('0x8')](config['redis'],{'host':_0xe9f8('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe9f8('0x7')]));var attributes=['id',_0xe9f8('0xa'),_0xe9f8('0xb'),_0xe9f8('0xc'),_0xe9f8('0xd'),_0xe9f8('0xe')];function emit(_0x53f58,_0x342833,_0x5cc577){io['to'](_0x53f58)[_0xe9f8('0xf')](_0x342833,_0x5cc577);}function emitChannelQueueInteraction(_0x12f066,_0x4acb58,_0x13618e,_0x570302,_0x4de627,_0x3cbbf6,_0x1af0d0,_0x4615c4){_0x13618e[_0xe9f8('0xa')]=_0x4615c4;_0x13618e[_0xe9f8('0xc')]=_0x4acb58;_0x13618e[_0xe9f8('0xb')]=_0x570302;_0x13618e['id']=_0x4de627;if(_0x3cbbf6){_0x1af0d0[util[_0xe9f8('0x10')](_0xe9f8('0x11'),_0x12f066)][_0x4de627]=_['pick'](_0x13618e,attributes);}else{delete _0x1af0d0[util[_0xe9f8('0x10')](_0xe9f8('0x11'),_0x12f066)][_0x4de627];}emit(util['format'](_0xe9f8('0x12'),_0x12f066,_0x4acb58),util['format'](_0xe9f8('0x13'),_0x12f066,_0x3cbbf6?'save':_0xe9f8('0x14')),_['pick'](_0x13618e,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xe9f8('0x15')),'chatQueueReport':require(_0xe9f8('0x16')),'smsQueueReport':require(_0xe9f8('0x17')),'faxQueueReport':require(_0xe9f8('0x18'))};var queue=schema({'name':{'type':_0xe9f8('0x19'),'required':!![],'message':_0xe9f8('0x1a')},'timeout':{'type':_0xe9f8('0x1b'),'message':_0xe9f8('0x1c')}});function startRouting(_0x1d4cea,_0x475dc4,_0x3b75c5,_0x4ba491){if(_0x1d4cea&&_0x475dc4&&_0x3b75c5){_0x475dc4[_0xe9f8('0x1d')]+=0x1;var _0x402dcf={'uniqueid':_0x1d4cea,'from':_0x3b75c5['body']?_0x3b75c5[_0xe9f8('0x1e')][_0xe9f8('0xd')]:'','joinAt':moment()[_0xe9f8('0x10')](_0xe9f8('0x1f')),'ContactId':_0x3b75c5[_0xe9f8('0x20')]?_0x3b75c5[_0xe9f8('0x20')]['id']:null,'ListId':_0x3b75c5[_0xe9f8('0x21')]?_0x3b75c5['list']['id']:null};_0x402dcf[_[_0xe9f8('0x22')](_0x3b75c5[_0xe9f8('0x23')])+_0xe9f8('0x24')]=_0x475dc4['id']||null;_0x402dcf[_[_0xe9f8('0x22')](_0x3b75c5['channel'])+_0xe9f8('0x25')]=_0x3b75c5[_0xe9f8('0x26')]?_0x3b75c5[_0xe9f8('0x26')]['id']:null;_0x402dcf[_['upperFirst'](_0x3b75c5[_0xe9f8('0x23')])+_0xe9f8('0x27')]=_0x3b75c5[_0xe9f8('0x28')]?_0x3b75c5[_0xe9f8('0x28')]['id']:null;_0x402dcf[_[_0xe9f8('0x22')](_0x3b75c5[_0xe9f8('0x23')])+(_0x3b75c5['channel']!==_0xe9f8('0x29')?_0xe9f8('0x2a'):_0xe9f8('0x2b'))]=_0x3b75c5[_0xe9f8('0xb')]?_0x3b75c5[_0xe9f8('0xb')]['id']:null;logger[_0xe9f8('0x2c')](util['format'](_0xe9f8('0x2d'),_0x1d4cea,_0x475dc4[_0xe9f8('0x2e')]));emitChannelQueueInteraction(_0x3b75c5[_0xe9f8('0x23')],_0x475dc4['name'],_0x402dcf,_0x3b75c5['account'][_0xe9f8('0x2e')],_0x3b75c5['message']['id'],!![],_0x4ba491,_0x475dc4['id']);if(rpc[_0x3b75c5[_0xe9f8('0x23')]+_0xe9f8('0x2f')]){return rpc[_0x3b75c5[_0xe9f8('0x23')]+_0xe9f8('0x2f')][_0xe9f8('0x30')](_0x402dcf)[_0xe9f8('0x31')](function(_0x460d77){logger['error'](_0xe9f8('0x32'));});}}}function stopRouting(_0x2f459f,_0x21a675,_0x37183a,_0x54ab88){if(_0x2f459f&&_0x21a675){_0x21a675[_0xe9f8('0x1d')]-=0x1;var _0x5696d8={'leaveAt':moment()[_0xe9f8('0x10')](_0xe9f8('0x1f')),'acceptAt':moment()[_0xe9f8('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xe9f8('0x33')};logger['info'](util[_0xe9f8('0x10')](_0xe9f8('0x34'),_0x2f459f,_0x21a675['name']));emitChannelQueueInteraction(_0x37183a[_0xe9f8('0x23')],_0x21a675[_0xe9f8('0x2e')],_0x37183a['body'],_0x37183a['account']['name'],_0x37183a[_0xe9f8('0x28')]['id'],![],_0x54ab88,_0x21a675['id']);if(rpc[_0x37183a['channel']+_0xe9f8('0x2f')]){return rpc[_0x37183a[_0xe9f8('0x23')]+_0xe9f8('0x2f')][_0xe9f8('0x35')](_0x2f459f,_0x5696d8)[_0xe9f8('0x31')](function(_0xa12527){logger[_0xe9f8('0x36')]('update\x20queue\x20report');});}}}function endRouting(_0x1ae5d9,_0x53a461,_0x4b6f7a,_0xdf7a46){if(_0x1ae5d9&&_0x53a461){_0x53a461['waiting']-=0x1;var _0x55d4a2={'leaveAt':moment()[_0xe9f8('0x10')](_0xe9f8('0x1f')),'exitAt':moment()['format'](_0xe9f8('0x1f')),'reason':_0xe9f8('0x37')};logger[_0xe9f8('0x2c')](util[_0xe9f8('0x10')](_0xe9f8('0x38'),_0x1ae5d9,_0x53a461['name']));emitChannelQueueInteraction(_0x4b6f7a[_0xe9f8('0x23')],_0x53a461[_0xe9f8('0x2e')],_0x4b6f7a[_0xe9f8('0x1e')],_0x4b6f7a[_0xe9f8('0xb')][_0xe9f8('0x2e')],_0x4b6f7a['message']['id'],![],_0xdf7a46);if(rpc[_0x4b6f7a[_0xe9f8('0x23')]+_0xe9f8('0x2f')]){return rpc[_0x4b6f7a['channel']+_0xe9f8('0x2f')][_0xe9f8('0x35')](_0x1ae5d9,_0x55d4a2)[_0xe9f8('0x31')](function(_0x2323b7){logger[_0xe9f8('0x36')](_0xe9f8('0x39'));});}}}function handleFindQueue(_0x4f9a5c){return function(_0x9cd9b1){return _0x9cd9b1['name'][_0xe9f8('0x3a')]()===_0x4f9a5c['toLowerCase']();};}exports[_0xe9f8('0x3b')]=function(_0x4a0f57,_0x1a2b6f,_0x455359,_0xb0b047){return function(_0x46ce50){try{var _0x45d087={'name':_0x1a2b6f[0x0],'timeout':_0x1a2b6f[0x1]};var _0x1da940=queue[_0xe9f8('0x0')](_0x45d087,{'typecast':!![]});if(_0x1da940['length']){logger[_0xe9f8('0x36')](_0xe9f8('0x3c'),_0x4a0f57,_[_0xe9f8('0x3d')](_0x1da940,_0xe9f8('0x28'))['join'](',\x20'));_0x46ce50[_0xe9f8('0x3e')]();}else{var _0x1d149d=_[_0xe9f8('0x3f')](_0x455359[_0xb0b047[_0xe9f8('0x23')]+_0xe9f8('0x40')],handleFindQueue(_0x45d087[_0xe9f8('0x2e')]));if(_0x1d149d){startRouting(_0x4a0f57,_0x1d149d,_0xb0b047,_0x455359);var _0x2412c4=(_0x1d149d[_0xe9f8('0x37')]||0xa)*0x3e8;var _0x583e46=(_0x45d087[_0xe9f8('0x37')]||0x14)*0x3e8;var _0x3ca80c,_0x51ec42;if(_0x2412c4>_0x583e46){_0x583e46=_0x2412c4;}var _0x5157a7=seqqueue['createQueue'](_0x2412c4);_0x5157a7['id']=_0x4a0f57;_0x5157a7[_0xe9f8('0x41')]=_0x2412c4;_0x5157a7['qtimeout']=_0x583e46;_0x5157a7['channel']=_0xb0b047[_0xe9f8('0x23')];_0x455359[_0xe9f8('0x42')][_0x4a0f57]['on'](_0xe9f8('0x43'),function(){stopRouting(_0x4a0f57,_0x1d149d,_0xb0b047,_0x455359);_0x5157a7[_0xe9f8('0x44')](!![]);clearTimeout(_0x3ca80c);_0x3ca80c=undefined;if(_0x455359[_0xe9f8('0x42')][_0x4a0f57]){delete _0x455359['rules'][_0x4a0f57];}logger[_0xe9f8('0x2c')](_0xe9f8('0x45'),_0x4a0f57);_0x46ce50['stop']();});_0x3ca80c=setTimeout(function(){endRouting(_0x4a0f57,_0x1d149d,_0xb0b047,_0x455359);clearTimeout(_0x3ca80c);_0x5157a7[_0xe9f8('0x44')](!![]);logger[_0xe9f8('0x2c')](_0xe9f8('0x46'),_0x4a0f57);_0x46ce50[_0xe9f8('0x47')]();},_0x583e46);switch(_0x1d149d[_0xe9f8('0x48')]){case _0xe9f8('0x49'):strategy[_0xe9f8('0x49')](_0x5157a7,_0x1d149d,_0x455359,_0xb0b047);break;default:strategy[_0xe9f8('0x4a')](_0x5157a7,_0x1d149d,_0x455359,_0xb0b047);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x4a0f57,_0x45d087[_0xe9f8('0x2e')]);_0x46ce50[_0xe9f8('0x3e')]();}}}catch(_0x511cb2){console[_0xe9f8('0x4b')](_0x511cb2);logger[_0xe9f8('0x36')](_0xe9f8('0x3c'),_0x4a0f57,_0x511cb2['stack']);_0x46ce50[_0xe9f8('0x3e')]();}};}; \ No newline at end of file +var _0x613f=['[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','seq-queue','ioredis','../../../../config/environment','./strategy','redis','defaults','socket.io-emitter','queue_id','from','emit','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','account','QueueReport','create','error','create\x20queue\x20report','accepted','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','catch','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','find','Queues','createQueue','atimeout','qtimeout','end','close','rules','stop','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall'];(function(_0x15cd3a,_0x575854){var _0x3c67a8=function(_0x361e5b){while(--_0x361e5b){_0x15cd3a['push'](_0x15cd3a['shift']());}};_0x3c67a8(++_0x575854);}(_0x613f,0xea));var _0xf613=function(_0x4ca1c2,_0xca5eb3){_0x4ca1c2=_0x4ca1c2-0x0;var _0x5628ff=_0x613f[_0x4ca1c2];return _0x5628ff;};'use strict';var schema=require(_0xf613('0x0'));var _=require('lodash');var util=require(_0xf613('0x1'));var seqqueue=require(_0xf613('0x2'));var moment=require('moment');var Redis=require(_0xf613('0x3'));var config=require(_0xf613('0x4'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0xf613('0x5'));config[_0xf613('0x6')]=_[_0xf613('0x7')](config[_0xf613('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xf613('0x8'))(new Redis(config[_0xf613('0x6')]));var attributes=['id',_0xf613('0x9'),'account','queue',_0xf613('0xa'),'joinAt'];function emit(_0x416b89,_0xfb796e,_0x1c25c7){io['to'](_0x416b89)[_0xf613('0xb')](_0xfb796e,_0x1c25c7);}function emitChannelQueueInteraction(_0x42b34d,_0x27013e,_0x209ecb,_0x417df4,_0x4860d5,_0x205449,_0xadee56,_0x2b2d4c){_0x209ecb['queue_id']=_0x2b2d4c;_0x209ecb[_0xf613('0xc')]=_0x27013e;_0x209ecb['account']=_0x417df4;_0x209ecb['id']=_0x4860d5;if(_0x205449){_0xadee56[util[_0xf613('0xd')](_0xf613('0xe'),_0x42b34d)][_0x4860d5]=_[_0xf613('0xf')](_0x209ecb,attributes);}else{delete _0xadee56[util[_0xf613('0xd')](_0xf613('0xe'),_0x42b34d)][_0x4860d5];}emit(util['format'](_0xf613('0x10'),_0x42b34d,_0x27013e),util[_0xf613('0xd')](_0xf613('0x11'),_0x42b34d,_0x205449?_0xf613('0x12'):_0xf613('0x13')),_[_0xf613('0xf')](_0x209ecb,attributes));}var rpc={'openchannelQueueReport':require(_0xf613('0x14')),'mailQueueReport':require(_0xf613('0x15')),'chatQueueReport':require(_0xf613('0x16')),'smsQueueReport':require(_0xf613('0x17')),'faxQueueReport':require(_0xf613('0x18'))};var queue=schema({'name':{'type':_0xf613('0x19'),'required':!![],'message':_0xf613('0x1a')},'timeout':{'type':'number','message':_0xf613('0x1b')}});function startRouting(_0x28aa6b,_0x127ccd,_0x3c5754,_0x27e273){if(_0x28aa6b&&_0x127ccd&&_0x3c5754){_0x127ccd[_0xf613('0x1c')]+=0x1;var _0x57d19e={'uniqueid':_0x28aa6b,'from':_0x3c5754[_0xf613('0x1d')]?_0x3c5754[_0xf613('0x1d')][_0xf613('0xa')]:'','joinAt':moment()[_0xf613('0xd')](_0xf613('0x1e')),'ContactId':_0x3c5754[_0xf613('0x1f')]?_0x3c5754[_0xf613('0x1f')]['id']:null,'ListId':_0x3c5754[_0xf613('0x20')]?_0x3c5754[_0xf613('0x20')]['id']:null};_0x57d19e[_[_0xf613('0x21')](_0x3c5754['channel'])+'QueueId']=_0x127ccd['id']||null;_0x57d19e[_[_0xf613('0x21')](_0x3c5754[_0xf613('0x22')])+'InteractionId']=_0x3c5754[_0xf613('0x23')]?_0x3c5754[_0xf613('0x23')]['id']:null;_0x57d19e[_['upperFirst'](_0x3c5754['channel'])+_0xf613('0x24')]=_0x3c5754[_0xf613('0x25')]?_0x3c5754[_0xf613('0x25')]['id']:null;_0x57d19e[_[_0xf613('0x21')](_0x3c5754[_0xf613('0x22')])+(_0x3c5754['channel']!==_0xf613('0x26')?_0xf613('0x27'):_0xf613('0x28'))]=_0x3c5754['account']?_0x3c5754['account']['id']:null;logger[_0xf613('0x29')](util['format'](_0xf613('0x2a'),_0x28aa6b,_0x127ccd[_0xf613('0x2b')]));emitChannelQueueInteraction(_0x3c5754['channel'],_0x127ccd[_0xf613('0x2b')],_0x57d19e,_0x3c5754[_0xf613('0x2c')][_0xf613('0x2b')],_0x3c5754[_0xf613('0x25')]['id'],!![],_0x27e273,_0x127ccd['id']);if(rpc[_0x3c5754[_0xf613('0x22')]+_0xf613('0x2d')]){return rpc[_0x3c5754[_0xf613('0x22')]+_0xf613('0x2d')][_0xf613('0x2e')](_0x57d19e)['catch'](function(_0x41260b){logger[_0xf613('0x2f')](_0xf613('0x30'));});}}}function stopRouting(_0x2aca76,_0xf4eb25,_0x43e772,_0x4d9cf1){if(_0x2aca76&&_0xf4eb25){_0xf4eb25[_0xf613('0x1c')]-=0x1;var _0x42d0f5={'leaveAt':moment()[_0xf613('0xd')](_0xf613('0x1e')),'acceptAt':moment()['format'](_0xf613('0x1e')),'reason':_0xf613('0x31')};logger[_0xf613('0x29')](util[_0xf613('0xd')]('[%s][STOP:QUEUE][NAME:%s]',_0x2aca76,_0xf4eb25[_0xf613('0x2b')]));emitChannelQueueInteraction(_0x43e772['channel'],_0xf4eb25[_0xf613('0x2b')],_0x43e772[_0xf613('0x1d')],_0x43e772['account'][_0xf613('0x2b')],_0x43e772[_0xf613('0x25')]['id'],![],_0x4d9cf1,_0xf4eb25['id']);if(rpc[_0x43e772[_0xf613('0x22')]+'QueueReport']){return rpc[_0x43e772[_0xf613('0x22')]+'QueueReport'][_0xf613('0x32')](_0x2aca76,_0x42d0f5)['catch'](function(_0x3661b2){logger[_0xf613('0x2f')](_0xf613('0x33'));});}}}function endRouting(_0x2ff434,_0x231a3d,_0x33859c,_0x38afcf){if(_0x2ff434&&_0x231a3d){_0x231a3d[_0xf613('0x1c')]-=0x1;var _0x5741d2={'leaveAt':moment()[_0xf613('0xd')](_0xf613('0x1e')),'exitAt':moment()[_0xf613('0xd')](_0xf613('0x1e')),'reason':_0xf613('0x34')};logger[_0xf613('0x29')](util[_0xf613('0xd')](_0xf613('0x35'),_0x2ff434,_0x231a3d[_0xf613('0x2b')]));emitChannelQueueInteraction(_0x33859c['channel'],_0x231a3d['name'],_0x33859c[_0xf613('0x1d')],_0x33859c['account'][_0xf613('0x2b')],_0x33859c[_0xf613('0x25')]['id'],![],_0x38afcf);if(rpc[_0x33859c[_0xf613('0x22')]+_0xf613('0x2d')]){return rpc[_0x33859c[_0xf613('0x22')]+_0xf613('0x2d')][_0xf613('0x32')](_0x2ff434,_0x5741d2)[_0xf613('0x36')](function(_0x34b521){logger[_0xf613('0x2f')](_0xf613('0x33'));});}}}function handleFindQueue(_0x348434){return function(_0x2dfe16){return _0x2dfe16[_0xf613('0x2b')][_0xf613('0x37')]()===_0x348434[_0xf613('0x37')]();};}exports[_0xf613('0x38')]=function(_0x155053,_0x2292f0,_0x3c151b,_0x1d06cb){return function(_0x162fe6){try{var _0x1f442c={'name':_0x2292f0[0x0],'timeout':_0x2292f0[0x1]};var _0x12f25a=queue[_0xf613('0x0')](_0x1f442c,{'typecast':!![]});if(_0x12f25a['length']){logger[_0xf613('0x2f')](_0xf613('0x39'),_0x155053,_[_0xf613('0x3a')](_0x12f25a,'message')[_0xf613('0x3b')](',\x20'));_0x162fe6['stop']();}else{var _0x5324ad=_[_0xf613('0x3c')](_0x3c151b[_0x1d06cb[_0xf613('0x22')]+_0xf613('0x3d')],handleFindQueue(_0x1f442c[_0xf613('0x2b')]));if(_0x5324ad){startRouting(_0x155053,_0x5324ad,_0x1d06cb,_0x3c151b);var _0x2e639f=(_0x5324ad[_0xf613('0x34')]||0xa)*0x3e8;var _0x30e6a8=(_0x1f442c[_0xf613('0x34')]||0x14)*0x3e8;var _0x38d5ef,_0xa1d661;if(_0x2e639f>_0x30e6a8){_0x30e6a8=_0x2e639f;}var _0x5e12a9=seqqueue[_0xf613('0x3e')](_0x2e639f);_0x5e12a9['id']=_0x155053;_0x5e12a9[_0xf613('0x3f')]=_0x2e639f;_0x5e12a9[_0xf613('0x40')]=_0x30e6a8;_0x5e12a9[_0xf613('0x22')]=_0x1d06cb['channel'];_0x3c151b['rules'][_0x155053]['on'](_0xf613('0x41'),function(){stopRouting(_0x155053,_0x5324ad,_0x1d06cb,_0x3c151b);_0x5e12a9[_0xf613('0x42')](!![]);clearTimeout(_0x38d5ef);_0x38d5ef=undefined;if(_0x3c151b[_0xf613('0x43')][_0x155053]){delete _0x3c151b[_0xf613('0x43')][_0x155053];}logger[_0xf613('0x29')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x155053);_0x162fe6[_0xf613('0x44')]();});_0x38d5ef=setTimeout(function(){endRouting(_0x155053,_0x5324ad,_0x1d06cb,_0x3c151b);clearTimeout(_0x38d5ef);_0x5e12a9[_0xf613('0x42')](!![]);logger[_0xf613('0x29')](_0xf613('0x45'),_0x155053);_0x162fe6[_0xf613('0x46')]();},_0x30e6a8);switch(_0x5324ad[_0xf613('0x47')]){case _0xf613('0x48'):strategy[_0xf613('0x48')](_0x5e12a9,_0x5324ad,_0x3c151b,_0x1d06cb);break;default:strategy[_0xf613('0x49')](_0x5e12a9,_0x5324ad,_0x3c151b,_0x1d06cb);}}else{logger[_0xf613('0x2f')](_0xf613('0x4a'),_0x155053,_0x1f442c[_0xf613('0x2b')]);_0x162fe6[_0xf613('0x44')]();}}}catch(_0x1820c9){console[_0xf613('0x4b')](_0x1820c9);logger[_0xf613('0x2f')]('[%s][QUEUE]\x20%s',_0x155053,_0x1820c9[_0xf613('0x4c')]);_0x162fe6[_0xf613('0x44')]();}};}; \ 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 4783cec..7de8cf1 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 _0x5810=['busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','forcedOwnership','isAgentAvailable','channel','busy'];(function(_0x3aa9c7,_0x629939){var _0x4ed413=function(_0x496ac8){while(--_0x496ac8){_0x3aa9c7['push'](_0x3aa9c7['shift']());}};_0x4ed413(++_0x629939);}(_0x5810,0x70));var _0x0581=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5810[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x0581('0x0'));var uuid=require('uuid');var util=require(_0x0581('0x1'));var logger=require(_0x0581('0x2'))(_0x0581('0x3'));var Agent=function(_0x3eb9d0,_0x36e780,_0x119921,_0x5f464d){this[_0x0581('0x4')]=uuid['v4']();this[_0x0581('0x5')]=_0x3eb9d0;this['agent']=_0x36e780;this[_0x0581('0x6')]=_0x119921;this[_0x0581('0x3')]=_0x5f464d;this[_0x0581('0x5')][_0x0581('0x7')](this[_0x0581('0x8')][_0x0581('0x9')](this),this[_0x0581('0xa')][_0x0581('0x9')](this));this['squeue']['on'](_0x0581('0xb'),this['handleTimeout'][_0x0581('0x9')](this));this[_0x0581('0x5')]['on'](_0x0581('0xc'),this['handleDrained']['bind'](this));};Agent['prototype'][_0x0581('0x7')]=function(){this[_0x0581('0x5')]['push'](this[_0x0581('0x8')][_0x0581('0x9')](this),this[_0x0581('0xa')]['bind'](this));};Agent[_0x0581('0xd')][_0x0581('0xe')]=function(){this[_0x0581('0xa')](!![]);};Agent[_0x0581('0xd')]['handleRun']=function(_0x4b2993){logger[_0x0581('0xf')](_0x0581('0x10'),this['squeue']['id'],this[_0x0581('0x11')]['id']);if(_[_0x0581('0x12')](this[_0x0581('0x6')][_0x0581('0x13')][this[_0x0581('0x11')]['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x0581('0x11')]['id']);setTimeout(this[_0x0581('0x7')][_0x0581('0x9')](this),0x3e8);}else{if(this[_0x0581('0x3')][_0x0581('0x14')]||util[_0x0581('0x15')](this[_0x0581('0x5')]['id'],this['realtime'][_0x0581('0x13')][this[_0x0581('0x11')]['id']],this[_0x0581('0x5')][_0x0581('0x16')],![])){this[_0x0581('0x6')][_0x0581('0x13')][this[_0x0581('0x11')]['id']][_0x0581('0x17')]=!![];this[_0x0581('0x6')][_0x0581('0x13')][this[_0x0581('0x11')]['id']][_0x0581('0x18')]=undefined;util[_0x0581('0x19')](this[_0x0581('0x4')],this['squeue']['id'],this[_0x0581('0x6')][_0x0581('0x13')][this[_0x0581('0x11')]['id']],null,this[_0x0581('0x3')]);util[_0x0581('0x1a')](this[_0x0581('0x5')]['id'],this[_0x0581('0x6')][_0x0581('0x13')][this[_0x0581('0x11')]['id']],_0x0581('0x1b')+(this['routing'][_0x0581('0x14')]?_0x0581('0x1c'):''));}else{logger[_0x0581('0xf')](_0x0581('0x1d'),this[_0x0581('0x5')]['id'],this[_0x0581('0x11')]['id']);setTimeout(this[_0x0581('0x7')][_0x0581('0x9')](this),0x3e8);}}};Agent[_0x0581('0xd')][_0x0581('0xa')]=function(_0x27a78c){if(_[_0x0581('0x12')](this[_0x0581('0x6')][_0x0581('0x13')][this[_0x0581('0x11')]['id']])){return logger['info'](_0x0581('0x1e'),this[_0x0581('0x5')]['id'],this[_0x0581('0x11')]['id']);}else{logger[_0x0581('0xf')](_0x0581('0x1f'),this[_0x0581('0x5')]['id'],this['agent']['id']);util['hideNotification'](this[_0x0581('0x4')],this[_0x0581('0x5')]['id'],this[_0x0581('0x6')]['agents'][this[_0x0581('0x11')]['id']],null,this[_0x0581('0x3')]);this[_0x0581('0x6')][_0x0581('0x13')][this[_0x0581('0x11')]['id']]['busy']=![];this['realtime'][_0x0581('0x13')][this[_0x0581('0x11')]['id']][_0x0581('0x18')]=undefined;util[_0x0581('0x1a')](this[_0x0581('0x5')]['id'],this[_0x0581('0x6')][_0x0581('0x13')][this[_0x0581('0x11')]['id']],_0x27a78c?_0x0581('0x20'):_0x0581('0x21'));}if(!_0x27a78c){setTimeout(this[_0x0581('0x7')][_0x0581('0x9')](this),0x3e8);}};function agent(_0x2f499c,_0x353260,_0x375d5b,_0x3efd5f){return new Agent(_0x2f499c,_0x353260,_0x375d5b,_0x3efd5f);}module['exports']=agent; \ No newline at end of file +var _0xdce7=['agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','busyQueue','showNotification','notificationId','writeLog','RINGING',':FORCED','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','squeue','agent','realtime','handleRun','bind','timeout','handleTimeout','handleDrained','push','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0xdce7,0x1ef));var _0x7dce=function(_0x18fec8,_0x31d0cd){_0x18fec8=_0x18fec8-0x0;var _0x5e400c=_0xdce7[_0x18fec8];return _0x5e400c;};'use strict';var _=require(_0x7dce('0x0'));var uuid=require(_0x7dce('0x1'));var util=require(_0x7dce('0x2'));var logger=require('../../../../../config/logger')(_0x7dce('0x3'));var Agent=function(_0x494a84,_0x1a2be1,_0x28f47f,_0x27d439){this['notificationId']=uuid['v4']();this[_0x7dce('0x4')]=_0x494a84;this[_0x7dce('0x5')]=_0x1a2be1;this[_0x7dce('0x6')]=_0x28f47f;this['routing']=_0x27d439;this[_0x7dce('0x4')]['push'](this[_0x7dce('0x7')][_0x7dce('0x8')](this),this['handleTimeout'][_0x7dce('0x8')](this));this['squeue']['on'](_0x7dce('0x9'),this[_0x7dce('0xa')]['bind'](this));this[_0x7dce('0x4')]['on']('drained',this[_0x7dce('0xb')]['bind'](this));};Agent['prototype']['push']=function(){this[_0x7dce('0x4')][_0x7dce('0xc')](this[_0x7dce('0x7')]['bind'](this),this[_0x7dce('0xa')][_0x7dce('0x8')](this));};Agent[_0x7dce('0xd')]['handleDrained']=function(){this[_0x7dce('0xa')](!![]);};Agent['prototype'][_0x7dce('0x7')]=function(_0x235666){logger[_0x7dce('0xe')](_0x7dce('0xf'),this['squeue']['id'],this[_0x7dce('0x5')]['id']);if(_[_0x7dce('0x10')](this[_0x7dce('0x6')][_0x7dce('0x11')][this['agent']['id']])){logger[_0x7dce('0xe')](_0x7dce('0x12'),this[_0x7dce('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x7dce('0xc')]['bind'](this),0x3e8);}else{if(this['routing'][_0x7dce('0x13')]||util[_0x7dce('0x14')](this[_0x7dce('0x4')]['id'],this['realtime']['agents'][this['agent']['id']],this[_0x7dce('0x4')]['channel'],![])){this[_0x7dce('0x6')]['agents'][this[_0x7dce('0x5')]['id']][_0x7dce('0x15')]=!![];this['realtime'][_0x7dce('0x11')][this['agent']['id']][_0x7dce('0x16')]=undefined;util[_0x7dce('0x17')](this[_0x7dce('0x18')],this[_0x7dce('0x4')]['id'],this['realtime']['agents'][this[_0x7dce('0x5')]['id']],null,this['routing']);util[_0x7dce('0x19')](this[_0x7dce('0x4')]['id'],this['realtime'][_0x7dce('0x11')][this[_0x7dce('0x5')]['id']],_0x7dce('0x1a')+(this['routing'][_0x7dce('0x13')]?_0x7dce('0x1b'):''));}else{logger[_0x7dce('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0x7dce('0x8')](this),0x3e8);}}};Agent[_0x7dce('0xd')][_0x7dce('0xa')]=function(_0x3dbc07){if(_[_0x7dce('0x10')](this['realtime'][_0x7dce('0x11')][this[_0x7dce('0x5')]['id']])){return logger[_0x7dce('0xe')](_0x7dce('0x12'),this[_0x7dce('0x4')]['id'],this[_0x7dce('0x5')]['id']);}else{logger[_0x7dce('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x7dce('0x4')]['id'],this['agent']['id']);util[_0x7dce('0x1c')](this[_0x7dce('0x18')],this[_0x7dce('0x4')]['id'],this[_0x7dce('0x6')]['agents'][this[_0x7dce('0x5')]['id']],null,this[_0x7dce('0x3')]);this['realtime'][_0x7dce('0x11')][this[_0x7dce('0x5')]['id']][_0x7dce('0x15')]=![];this[_0x7dce('0x6')][_0x7dce('0x11')][this[_0x7dce('0x5')]['id']][_0x7dce('0x16')]=undefined;util[_0x7dce('0x19')](this[_0x7dce('0x4')]['id'],this[_0x7dce('0x6')][_0x7dce('0x11')][this[_0x7dce('0x5')]['id']],_0x3dbc07?_0x7dce('0x1d'):_0x7dce('0x1e'));}if(!_0x3dbc07){setTimeout(this['push'][_0x7dce('0x8')](this),0x3e8);}};function agent(_0x37c3f8,_0x5ea55e,_0x4700a7,_0x49c506){return new Agent(_0x37c3f8,_0x5ea55e,_0x4700a7,_0x49c506);}module[_0x7dce('0x1f')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 5fc4176..37201da 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 _0xd5fd=['push','bind','handleTimeout','timeout','handleRun','prototype','handleDrained','isNil','length','Agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','agents','RINGING','busyQueue','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','TIMEOUT','busy','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0xd5fd,0x141));var _0xdd5f=function(_0xb4f654,_0x33ce4b){_0xb4f654=_0xb4f654-0x0;var _0x521323=_0xd5fd[_0xb4f654];return _0x521323;};'use strict';var _=require(_0xdd5f('0x0'));var uuid=require(_0xdd5f('0x1'));var util=require(_0xdd5f('0x2'));var logger=require(_0xdd5f('0x3'))(_0xdd5f('0x4'));var Beepall=function(_0x5368d8,_0x487879,_0x29517b,_0x4151d2){this[_0xdd5f('0x5')]=uuid['v4']();this[_0xdd5f('0x6')]=_0x5368d8;this[_0xdd5f('0x7')]=_0x487879;this[_0xdd5f('0x8')]=_0x29517b;this['routing']=_0x4151d2;this[_0xdd5f('0x6')][_0xdd5f('0x9')](this['handleRun'][_0xdd5f('0xa')](this),this[_0xdd5f('0xb')][_0xdd5f('0xa')](this));this[_0xdd5f('0x6')]['on'](_0xdd5f('0xc'),this[_0xdd5f('0xb')][_0xdd5f('0xa')](this));this[_0xdd5f('0x6')]['on']('drained',this['handleDrained'][_0xdd5f('0xa')](this));};Beepall['prototype'][_0xdd5f('0x9')]=function(){this[_0xdd5f('0x6')][_0xdd5f('0x9')](this[_0xdd5f('0xd')][_0xdd5f('0xa')](this),this[_0xdd5f('0xb')][_0xdd5f('0xa')](this));};Beepall[_0xdd5f('0xe')][_0xdd5f('0xf')]=function(_0x27d135){this[_0xdd5f('0xb')](!![]);};Beepall['prototype'][_0xdd5f('0xd')]=function(_0x43550c){var _0x263150=!![];if(!_[_0xdd5f('0x10')](this[_0xdd5f('0x7')])&&!_['isNil'](this[_0xdd5f('0x7')]['Agents'])&&this[_0xdd5f('0x7')]['Agents'][_0xdd5f('0x11')]>0x0){for(var _0x3bc4bf=0x0,_0x2ceb71;_0x3bc4bf0x0){for(var _0x1bcddc=0x0,_0x49729d;_0x1bcddc0x0&&_0x54b5a6[_0x4f9744+'CurrentCapacity']>=_0x54b5a6[_0x4f9744+'Capacity']){writeLog(_0x34c3a8,_0x54b5a6,_0x4f9744[_0xdda3('0x21')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xdda3('0x22')]=function(_0x347293,_0x17389c,_0x45b00b,_0x50f296,_0x13cd93){return sendNotification(!![],_0x347293,_0x17389c,_0x45b00b,_0x50f296,_0x13cd93);};exports['hideNotification']=function(_0xbc4c4a,_0x426d57,_0x4b2f30,_0xf8f9b3,_0x2a180f){return sendNotification(![],_0xbc4c4a,_0x426d57,_0x4b2f30,_0xf8f9b3,_0x2a180f);};exports[_0xdda3('0x23')]=writeLog; \ No newline at end of file +var _0x0290=['isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','format','user:%s','split','name','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','emit','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]'];(function(_0x4645de,_0x2d39bc){var _0xfe8082=function(_0x1366a0){while(--_0x1366a0){_0x4645de['push'](_0x4645de['shift']());}};_0xfe8082(++_0x2d39bc);}(_0x0290,0xb4));var _0x0029=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x0290[_0x15bc81];return _0x59440e;};'use strict';var _=require('lodash');var util=require('util');var utils=require('../utils');var Mustache=require('mustache');var Redis=require(_0x0029('0x0'));var config=require(_0x0029('0x1'));var logger=require(_0x0029('0x2'))(_0x0029('0x3'));config[_0x0029('0x4')]=_[_0x0029('0x5')](config['redis'],{'host':_0x0029('0x6'),'port':0x18eb});var io=require(_0x0029('0x7'))(new Redis(config[_0x0029('0x4')]));function emit(_0x4db0db,_0x39f09c,_0x1fc2a9){io['to'](_0x4db0db)['emit'](_0x39f09c,_0x1fc2a9);}function sendNotification(_0x538313,_0x52f9c4,_0x4ff345,_0x5c172d,_0x32c32a,_0x3e2660){io['to'](util[_0x0029('0x8')](_0x0029('0x9'),_0x5c172d['name']))['emit']('user:save',_0x5c172d);var _0x3302c4=_0x3e2660||{};var _0x11502b=_0x4ff345[_0x0029('0xa')]('.');var _0x54b15b={'uniqueid':_0x52f9c4,'channel':_0x11502b[0x0],'id':_0x11502b[0x1],'title':_0x11502b[0x0]+'\x20interaction','interactionId':_0x11502b[0x2],'queue':_0x32c32a?_0x32c32a[_0x0029('0xb')]:null,'sound':_0x3302c4[_0x0029('0xc')][_0x0029('0xd')],'shake':_0x3302c4[_0x0029('0xc')][_0x0029('0xe')]};try{if(!_0x3302c4[_0x0029('0xf')]){_0x3302c4['body']={};}if(_0x32c32a){_0x3302c4['body'][_0x0029('0x10')]=_0x32c32a;}else if(_0x3302c4['body']['queue']){delete _0x3302c4[_0x0029('0xf')]['queue'];}_0x54b15b[_0x0029('0x11')]=utils[_0x0029('0x12')](_0x3302c4[_0x0029('0xc')][_0x0029('0x13')],_0x3302c4);}catch(_0x5ae16a){_0x54b15b[_0x0029('0x11')]=_0x0029('0x14');logger[_0x0029('0x15')](util[_0x0029('0x8')](_0x0029('0x16'),_0x52f9c4,_0x5ae16a[_0x0029('0x17')]));}io['to'](util[_0x0029('0x8')](_0x0029('0x9'),_0x5c172d[_0x0029('0xb')]))[_0x0029('0x18')](util['format'](_0x0029('0x19'),_0x538313?_0x0029('0x1a'):_0x0029('0x1b')),_0x54b15b);}function writeLog(_0x18a4b6,_0x34ed2a,_0x1e2ef7){return logger[_0x0029('0x1c')](util['format'](_0x0029('0x1d'),_0x18a4b6,_0x34ed2a[_0x0029('0xb')],_0x1e2ef7));}exports[_0x0029('0x1e')]=function(_0x1a93e0,_0x1e86e9,_0x101b06,_0x24d9d){if(_0x1e86e9[_0x0029('0x1f')]){writeLog(_0x1a93e0,_0x1e86e9,_0x0029('0x20'));return![];}if(!_0x1e86e9[_0x0029('0x21')]){writeLog(_0x1a93e0,_0x1e86e9,_0x0029('0x22'));return![];}if(_0x1e86e9[_0x101b06+_0x0029('0x23')]){writeLog(_0x1a93e0,_0x1e86e9,'PAUSE');return![];}if(_0x24d9d&&_0x1e86e9['hasOwnProperty'](_0x101b06+_0x0029('0x24'))&&_0x1e86e9['hasOwnProperty'](_0x101b06+_0x0029('0x25'))){if(_0x1e86e9[_0x101b06+_0x0029('0x24')]>0x0&&_0x1e86e9[_0x101b06+_0x0029('0x25')]>=_0x1e86e9[_0x101b06+_0x0029('0x24')]){writeLog(_0x1a93e0,_0x1e86e9,_0x101b06['toUpperCase']()+_0x0029('0x26'));return![];}}return!![];};exports[_0x0029('0x27')]=function(_0x23f19b,_0x1a214d,_0x42afa4,_0x5e896e,_0x44563d){return sendNotification(!![],_0x23f19b,_0x1a214d,_0x42afa4,_0x5e896e,_0x44563d);};exports[_0x0029('0x28')]=function(_0x42f460,_0x3d4b44,_0x2243cb,_0x3a9316,_0x26089a){return sendNotification(![],_0x42f460,_0x3d4b44,_0x2243cb,_0x3a9316,_0x26089a);};exports[_0x0029('0x29')]=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 ce63d35..dcacacf 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 _0x7354=['join','info','next','getMustacheRender','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','error','[%s][SYSTEM]\x20%s','map','message'];(function(_0x3ec333,_0x26bcbe){var _0x15ccb8=function(_0x2c4d0c){while(--_0x2c4d0c){_0x3ec333['push'](_0x3ec333['shift']());}};_0x15ccb8(++_0x26bcbe);}(_0x7354,0xde));var _0x4735=function(_0x571c65,_0x321f37){_0x571c65=_0x571c65-0x0;var _0x563767=_0x7354[_0x571c65];return _0x563767;};'use strict';var schema=require('validate');var sh=require(_0x4735('0x0'));var _=require('lodash');var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0x4735('0x1'),'required':!![],'message':_0x4735('0x2')}});exports['consequence']=function(_0xe4f09a,_0x1e9ea0){return function(_0x51fb96){try{var _0xb323eb={'command':_0x1e9ea0[0x0]};var _0x142c20=system[_0x4735('0x3')](_0xb323eb,{'typecast':!![]});if(_0x142c20['length']){logger[_0x4735('0x4')](_0x4735('0x5'),_0xe4f09a,_[_0x4735('0x6')](_0x142c20,_0x4735('0x7'))[_0x4735('0x8')](',\x20'));logger[_0x4735('0x9')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0xe4f09a);_0x51fb96[_0x4735('0xa')]();}else{var _0x2a88f7=this;var _0x3bba13=utils[_0x4735('0xb')](_0x1e9ea0[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0xe4f09a,_0x3bba13);sh[_0x4735('0xc')](_[_0x4735('0xd')](_0x3bba13),function(_0x371135,_0x229688){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0xe4f09a,_0x371135);if(_0x371135==0x0){var _0xebe3db=_0x229688[_0x4735('0xe')](/(\r\n|\n|\r)/gm,'');if(_[_0x4735('0xf')](_0x1e9ea0[0x1])||_[_0x4735('0x10')](_0x1e9ea0[0x1])){logger['info'](_0x4735('0x11'),_0xe4f09a);_0x2a88f7[_0x4735('0x12')][_0x1e9ea0[0x1]]=_0xebe3db;}else{logger[_0x4735('0x9')](_0x4735('0x13'),_0xe4f09a,_0x1e9ea0[0x1],_0xebe3db);_0x2a88f7[_0x4735('0x12')][_0x1e9ea0[0x1]]=_0xebe3db;}}_0x51fb96[_0x4735('0xa')]();});}}catch(_0x29093a){logger[_0x4735('0x4')](_0x4735('0x5'),_0xe4f09a,_[_0x4735('0x14')](_0x29093a)?JSON[_0x4735('0x15')](_0x29093a):_0x29093a);logger[_0x4735('0x9')](_0x4735('0x16'),_0xe4f09a);_0x51fb96['next']();}};}; \ No newline at end of file +var _0xe88b=['join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify','validate','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][SYSTEM]\x20%s','map'];(function(_0x3f37c8,_0x2de1ad){var _0x1c3bc2=function(_0x45caf0){while(--_0x45caf0){_0x3f37c8['push'](_0x3f37c8['shift']());}};_0x1c3bc2(++_0x2de1ad);}(_0xe88b,0x7e));var _0xbe88=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0xe88b[_0x36940e];return _0x3283f2;};'use strict';var schema=require(_0xbe88('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require(_0xbe88('0x1'));var logger=require(_0xbe88('0x2'))(_0xbe88('0x3'));var system=schema({'command':{'type':_0xbe88('0x4'),'required':!![],'message':_0xbe88('0x5')}});exports['consequence']=function(_0x2b53e5,_0xb05d48){return function(_0x902c94){try{var _0x1a05b2={'command':_0xb05d48[0x0]};var _0x331a5a=system['validate'](_0x1a05b2,{'typecast':!![]});if(_0x331a5a[_0xbe88('0x6')]){logger['error'](_0xbe88('0x7'),_0x2b53e5,_[_0xbe88('0x8')](_0x331a5a,'message')[_0xbe88('0x9')](',\x20'));logger[_0xbe88('0xa')](_0xbe88('0xb'),_0x2b53e5);_0x902c94[_0xbe88('0xc')]();}else{var _0x1ca851=this;var _0x1616a7=utils[_0xbe88('0xd')](_0xb05d48[0x0],this);logger['info'](_0xbe88('0xe'),_0x2b53e5,_0x1616a7);sh[_0xbe88('0xf')](_[_0xbe88('0x10')](_0x1616a7),function(_0x16dd5e,_0x3d8525){logger[_0xbe88('0xa')](_0xbe88('0x11'),_0x2b53e5,_0x16dd5e);if(_0x16dd5e==0x0){var _0x54ede8=_0x3d8525[_0xbe88('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xbe88('0x13')](_0xb05d48[0x1])||_[_0xbe88('0x14')](_0xb05d48[0x1])){logger['info'](_0xbe88('0x15'),_0x2b53e5);_0x1ca851[_0xbe88('0x16')][_0xb05d48[0x1]]=_0x54ede8;}else{logger[_0xbe88('0xa')](_0xbe88('0x17'),_0x2b53e5,_0xb05d48[0x1],_0x54ede8);_0x1ca851[_0xbe88('0x16')][_0xb05d48[0x1]]=_0x54ede8;}}_0x902c94[_0xbe88('0xc')]();});}}catch(_0x44faa8){logger[_0xbe88('0x18')](_0xbe88('0x7'),_0x2b53e5,_[_0xbe88('0x19')](_0x44faa8)?JSON[_0xbe88('0x1a')](_0x44faa8):_0x44faa8);logger['info'](_0xbe88('0xb'),_0x2b53e5);_0x902c94[_0xbe88('0xc')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 28bdc68..e7330a5 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 _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x75b2a5,_0x43902a){var _0x28937a=function(_0x3cd152){while(--_0x3cd152){_0x75b2a5['push'](_0x75b2a5['shift']());}};_0x28937a(++_0x43902a);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ No newline at end of file +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(_0x2c3698,_0x5dbaff){var _0x10776d=function(_0x31993d){while(--_0x31993d){_0x2c3698['push'](_0x2c3698['shift']());}};_0x10776d(++_0x5dbaff);}(_0x7a54,0x106));var _0x47a5=function(_0x403d1b,_0x42609){_0x403d1b=_0x403d1b-0x0;var _0xef0975=_0x7a54[_0x403d1b];return _0xef0975;};'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 3202887..6c17ed3 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 _0xc36d=['lodash','exports','render','body','contact','account','interaction','list','mustache'];(function(_0x43be34,_0x1a0007){var _0x100207=function(_0x48407a){while(--_0x48407a){_0x43be34['push'](_0x43be34['shift']());}};_0x100207(++_0x1a0007);}(_0xc36d,0x7d));var _0xdc36=function(_0x22f164,_0xaa4f80){_0x22f164=_0x22f164-0x0;var _0x51ab95=_0xc36d[_0x22f164];return _0x51ab95;};'use strict';var Mustache=require(_0xdc36('0x0'));var _=require(_0xdc36('0x1'));module[_0xdc36('0x2')]={'getMustacheRender':function(_0x16dd4a,_0x471240){return Mustache[_0xdc36('0x3')](_0x16dd4a,_['merge'](_0x471240[_0xdc36('0x4')],{'contact':_0x471240[_0xdc36('0x5')],'message':_0x471240['message'],'account':_0x471240[_0xdc36('0x6')],'interaction':_0x471240[_0xdc36('0x7')],'list':_0x471240[_0xdc36('0x8')]}))||'';}}; \ No newline at end of file +var _0x6c4b=['contact','message','list','mustache','lodash','exports','render','merge','body'];(function(_0x56f301,_0x41ac80){var _0x197b70=function(_0x208bb9){while(--_0x208bb9){_0x56f301['push'](_0x56f301['shift']());}};_0x197b70(++_0x41ac80);}(_0x6c4b,0x93));var _0xb6c4=function(_0x3ae203,_0x2d0236){_0x3ae203=_0x3ae203-0x0;var _0x4215dc=_0x6c4b[_0x3ae203];return _0x4215dc;};'use strict';var Mustache=require(_0xb6c4('0x0'));var _=require(_0xb6c4('0x1'));module[_0xb6c4('0x2')]={'getMustacheRender':function(_0x5de185,_0x1f07f4){return Mustache[_0xb6c4('0x3')](_0x5de185,_[_0xb6c4('0x4')](_0x1f07f4[_0xb6c4('0x5')],{'contact':_0x1f07f4[_0xb6c4('0x6')],'message':_0x1f07f4[_0xb6c4('0x7')],'account':_0x1f07f4['account'],'interaction':_0x1f07f4['interaction'],'list':_0x1f07f4[_0xb6c4('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 40a5d62..c511964 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 _0xc2d8=['priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','matchPath','emit','end','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','paused','waiting','mailQueues','name','openchannelQueues','loggedIn','smsQueues','faxQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','existsSync','app','toLowerCase','autoreply','split','push','slice','join','dialogflow','amazonlex','appdata','format','%s:%s:%s','condition','intervals','consequence'];(function(_0x47614b,_0x5c4328){var _0x2fb037=function(_0x593d14){while(--_0x593d14){_0x47614b['push'](_0x47614b['shift']());}};_0x2fb037(++_0x5c4328);}(_0xc2d8,0xee));var _0x8c2d=function(_0x562785,_0x9bb9c4){_0x562785=_0x562785-0x0;var _0x303a17=_0xc2d8[_0x562785];return _0x303a17;};'use strict';var _=require('lodash');var util=require(_0x8c2d('0x0'));var path=require(_0x8c2d('0x1'));var fs=require('fs');var jayson=require(_0x8c2d('0x2'));var BPromise=require(_0x8c2d('0x3'));var uuid=require('uuid');var config=require(_0x8c2d('0x4'));var logger=require('../../../config/logger')(_0x8c2d('0x5'));var rpc={'openchannelQueueReport':require(_0x8c2d('0x6'))};var rpc={'openchannelQueueReport':require(_0x8c2d('0x6')),'mailQueueReport':require(_0x8c2d('0x7')),'chatQueueReport':require(_0x8c2d('0x8')),'smsQueueReport':require(_0x8c2d('0x9')),'faxQueueReport':require(_0x8c2d('0xa'))};var RuleEngine=require(_0x8c2d('0xb'));function getId(_0x2e6496,_0x486c62,_0x7d91ed){return util['format'](_0x8c2d('0xc'),_0x2e6496,_0x486c62||0x0,_0x7d91ed||0x0);}function getIntervals(_0x57b4b1,_0x4e649a){var _0x55c537=[];if(!_[_0x8c2d('0xd')](_0x4e649a[_0x8c2d('0xe')])&&!_[_0x8c2d('0xd')](_0x57b4b1[_0x4e649a['IntervalId']])&&!_[_0x8c2d('0xd')](_0x57b4b1[_0x4e649a[_0x8c2d('0xe')]][_0x8c2d('0xf')])){_0x55c537=_[_0x8c2d('0x10')](_0x57b4b1[_0x4e649a[_0x8c2d('0xe')]][_0x8c2d('0xf')],_0x8c2d('0x11'));}else if(!_['isNil'](_0x4e649a[_0x8c2d('0x11')])){_0x55c537=[_0x4e649a[_0x8c2d('0x11')]];}return _0x55c537;}exports[_0x8c2d('0x12')]=function(_0x4b185b){_0x4b185b[_0x8c2d('0x13')]={};return new BPromise(function(_0x29612c,_0x14ccdc){var _0x4634af={'Start':function(_0x41d2c){var _0x4a2c82=this;return new Promise(function(_0x421099,_0x39524f){if(_0x41d2c){try{var _0x15f5fd=[];var _0x2f24c8=getId(_0x41d2c[_0x8c2d('0x14')],_0x41d2c['message']?_0x41d2c[_0x8c2d('0x15')]['id']:0x0,_0x41d2c[_0x8c2d('0x16')]?_0x41d2c[_0x8c2d('0x16')]['id']:0x0);if(_0x41d2c[_0x8c2d('0x17')]&&_['isArray'](_0x41d2c[_0x8c2d('0x17')])&&_0x41d2c[_0x8c2d('0x17')]['length']){for(var _0xe61074=0x0;_0xe61074<_0x41d2c[_0x8c2d('0x17')][_0x8c2d('0x18')];_0xe61074+=0x1){var _0x1fe0a9=_0x41d2c[_0x8c2d('0x17')][_0xe61074];if(fs[_0x8c2d('0x19')](path['join'](__dirname,'applications',_0x1fe0a9[_0x8c2d('0x1a')]+'.js'))){var _0xd0b099=[];switch(_0x1fe0a9[_0x8c2d('0x1a')][_0x8c2d('0x1b')]()){case _0x8c2d('0x1c'):var _0x247ebf=_0x1fe0a9['appdata'][_0x8c2d('0x1d')](',');_0xd0b099[_0x8c2d('0x1e')](_0x247ebf[0x0]);_0xd0b099[_0x8c2d('0x1e')](_0x247ebf[_0x8c2d('0x1f')](0x1,_0x247ebf['length'])[_0x8c2d('0x20')](','));break;case _0x8c2d('0x21'):var _0x247ebf=_0x1fe0a9['appdata']['split'](',');_0xd0b099[_0x8c2d('0x1e')](_0x247ebf[0x0]);_0xd0b099[_0x8c2d('0x1e')](_0x247ebf[0x1]);_0xd0b099[_0x8c2d('0x1e')](_0x247ebf[_0x8c2d('0x1f')](0x2,_0x247ebf[_0x8c2d('0x18')])['join'](','));break;case _0x8c2d('0x22'):var _0x247ebf=_0x1fe0a9['appdata'][_0x8c2d('0x1d')](',');_0xd0b099['push'](_0x247ebf[0x0]);_0xd0b099[_0x8c2d('0x1e')](_0x247ebf[0x1]);_0xd0b099['push'](_0x247ebf[0x2]);_0xd0b099[_0x8c2d('0x1e')](_0x247ebf[0x3]);_0xd0b099[_0x8c2d('0x1e')](_0x247ebf[_0x8c2d('0x1f')](0x4,_0x247ebf[_0x8c2d('0x18')])['join'](','));break;case _0x8c2d('0x15'):_0xd0b099[_0x8c2d('0x1e')](_0x1fe0a9[_0x8c2d('0x23')]);break;case'tag':_0xd0b099[_0x8c2d('0x1e')](_0x1fe0a9['TagId']);_0xd0b099['push'](_0x1fe0a9[_0x8c2d('0x23')]);break;default:_0xd0b099=_['isNil'](_0x1fe0a9[_0x8c2d('0x23')])?[]:_0x1fe0a9['appdata']['split'](',');}var _0xc012a6={'id':util[_0x8c2d('0x24')](_0x8c2d('0x25'),_0x2f24c8,_0x1fe0a9['id'],_0x1fe0a9[_0x8c2d('0x1a')]),'condition':require('./interval')[_0x8c2d('0x26')](_0x2f24c8,getIntervals(_0x4b185b[_0x8c2d('0x27')],_0x1fe0a9),_0x4b185b),'consequence':require('./applications/'+_0x1fe0a9[_0x8c2d('0x1a')])[_0x8c2d('0x28')](_0x2f24c8,_0xd0b099,_0x4b185b,_0x41d2c),'p':_0x1fe0a9[_0x8c2d('0x29')]||0x0};logger[_0x8c2d('0x2a')](_0x8c2d('0x2b'),_0xc012a6['id'],_0x8c2d('0x2c'),getIntervals(_0x4b185b[_0x8c2d('0x27')],_0x1fe0a9)[_0x8c2d('0x20')](_0x8c2d('0x2d')));_0x15f5fd['push'](_0xc012a6);}else{logger[_0x8c2d('0x2e')](_0x8c2d('0x2f'),path[_0x8c2d('0x20')](__dirname,'applications',_0x1fe0a9[_0x8c2d('0x1a')]+_0x8c2d('0x30')));}}_0x4b185b[_0x8c2d('0x13')][_0x2f24c8]=new RuleEngine(_0x15f5fd);_0x4b185b[_0x8c2d('0x13')][_0x2f24c8][_0x8c2d('0x31')](_0x41d2c,function(_0x2b9c4f){logger[_0x8c2d('0x2a')](_0x8c2d('0x32'),JSON[_0x8c2d('0x33')](_0x2b9c4f[_0x8c2d('0x34')]));if(_0x4b185b['rules'][_0x2f24c8]){_0x4b185b[_0x8c2d('0x13')][_0x2f24c8][_0x8c2d('0x35')](_0x8c2d('0x36'));}});return _0x421099({'code':0xc8,'message':_0x41d2c});}else{logger['info'](_0x8c2d('0x37'));return _0x421099({'code':0xc8,'message':_0x41d2c});}}catch(_0x37babe){logger[_0x8c2d('0x2e')](_0x37babe[_0x8c2d('0x38')]);return _0x39524f(_0x4a2c82[_0x8c2d('0x2e')](0x1f4,_0x37babe));}}return _0x39524f(_0x8c2d('0x39'));});},'AcceptMessage':function(_0x2054df){var _0x7fb27f=this;return new Promise(function(_0x2b63e2,_0x4169c8){if(_0x2054df[_0x8c2d('0x15')]&&_0x2054df['message']['id']){try{var _0x1fcd4d=getId(_0x2054df['channel'],_0x2054df[_0x8c2d('0x15')]?_0x2054df[_0x8c2d('0x15')]['id']:0x0,_0x2054df['interaction']?_0x2054df[_0x8c2d('0x16')]['id']:0x0);if(_0x4b185b['rules'][_0x1fcd4d]){_0x4b185b['rules'][_0x1fcd4d][_0x8c2d('0x35')](_0x8c2d('0x36'));if(rpc[_0x2054df[_0x8c2d('0x14')]+'QueueReport']){rpc[_0x2054df[_0x8c2d('0x14')]+_0x8c2d('0x3a')][_0x8c2d('0x3b')](_0x1fcd4d,{'UserId':_0x2054df[_0x8c2d('0x15')][_0x8c2d('0x3c')]})[_0x8c2d('0x3d')](function(_0x91feac){logger['error'](_0x8c2d('0x3e'));});}}return _0x2b63e2({'code':0xc8,'message':_0x2054df});}catch(_0x195940){logger[_0x8c2d('0x2e')](_0x195940['stack']);return _0x4169c8(_0x7fb27f['error'](0x1f4,_0x195940));}}logger[_0x8c2d('0x2e')](_0x8c2d('0x3f'));return _0x4169c8(_0x7fb27f[_0x8c2d('0x2e')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x4a7f79){var _0x182bac=this;return new Promise(function(_0x2a8148,_0x49223c){if(_0x4a7f79[_0x8c2d('0x40')]&&_0x4a7f79[_0x8c2d('0x40')]['id']){try{if(_0x4b185b[_0x8c2d('0x41')][_0x4a7f79[_0x8c2d('0x40')]['id']]){_0x4b185b[_0x8c2d('0x41')][_0x4a7f79[_0x8c2d('0x40')]['id']][_0x8c2d('0x42')]=![];_0x4b185b[_0x8c2d('0x41')][_0x4a7f79[_0x8c2d('0x40')]['id']][_0x8c2d('0x43')]=undefined;}return _0x2a8148({'code':0xc8,'message':_0x4a7f79});}catch(_0x4dfad5){logger[_0x8c2d('0x2e')](_0x4dfad5[_0x8c2d('0x38')]);return _0x49223c(_0x182bac[_0x8c2d('0x2e')](0x1f4,_0x4dfad5));}}logger['error']('message\x20is\x20empty');return _0x49223c(_0x182bac[_0x8c2d('0x2e')](0x1f4,_0x8c2d('0x3f')));});},'AbandonInteraction':function(_0x3e8f62){var _0xb980df=this;return new Promise(function(_0x3c79af,_0x52b8e1){if(_0x3e8f62[_0x8c2d('0x14')]&&_0x3e8f62['interaction']&&_0x3e8f62[_0x8c2d('0x16')]['id']){try{var _0x487354=getId(_0x3e8f62[_0x8c2d('0x14')],_0x3e8f62[_0x8c2d('0x15')]?_0x3e8f62[_0x8c2d('0x15')]['id']:0x0,_0x3e8f62[_0x8c2d('0x16')]?_0x3e8f62[_0x8c2d('0x16')]['id']:0x0);if(_0x4b185b[_0x8c2d('0x13')][_0x487354]){_0x4b185b[_0x8c2d('0x13')][_0x487354]['emit'](_0x8c2d('0x36'));}return _0x3c79af({'code':0xc8,'message':_0x3e8f62});}catch(_0x288f62){logger[_0x8c2d('0x2e')](_0x288f62[_0x8c2d('0x38')]);return _0x52b8e1(_0xb980df[_0x8c2d('0x2e')](0x1f4,_0x288f62));}}logger[_0x8c2d('0x2e')](_0x8c2d('0x3f'));return _0x52b8e1(_0xb980df[_0x8c2d('0x2e')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x1842ac){var _0x40f249=this;return new Promise(function(_0x2684df,_0x56fb6b){if(_0x4b185b[_0x8c2d('0x41')][_0x8c2d('0x44')](_0x1842ac['id'])){for(var _0x35a3b3 in _0x1842ac[_0x8c2d('0x45')]){if(_0x1842ac['capacity'][_0x8c2d('0x44')](_0x35a3b3)){if(_0x4b185b[_0x8c2d('0x41')][_0x1842ac['id']][_0x8c2d('0x44')](_0x35a3b3+_0x8c2d('0x46'))){_0x4b185b[_0x8c2d('0x41')][_0x1842ac['id']][_0x35a3b3+_0x8c2d('0x46')]=parseInt(_0x1842ac[_0x8c2d('0x45')][_0x35a3b3],0xa);}}}_0x4b185b[_0x8c2d('0x41')][_0x1842ac['id']][_0x8c2d('0x47')]();return _0x2684df({'code':0xc8,'message':_0x4b185b[_0x8c2d('0x41')][_0x1842ac['id']]});}else{return _0x56fb6b(_0x40f249[_0x8c2d('0x2e')](0x1f4,_0x8c2d('0x48')));}});},'Agents':function(_0x1c2bf5){return new Promise(function(_0x1a11d9,_0xb8fc12){var _0x178930=_[_0x8c2d('0x49')](_0x4b185b[_0x8c2d('0x41')]);_0x1a11d9({'count':_0x178930[_0x8c2d('0x18')],'rows':_0x178930});});},'ChatQueues':function(_0x4e7478){return new Promise(function(_0x20faea,_0x5d17d6){var _0x212a42=[];for(var _0x2fab03 in _0x4b185b[_0x8c2d('0x4a')]){if(_0x4b185b['chatQueues']['hasOwnProperty'](_0x2fab03)){var _0x2fd8a4=_0x4b185b[_0x8c2d('0x4a')][_0x2fab03];var _0x1918dd={'id':_0x2fd8a4['id'],'available':_0x2fd8a4[_0x8c2d('0x4b')],'loggedIn':_0x2fd8a4['loggedIn'],'name':_0x2fd8a4['name'],'paused':_0x2fd8a4[_0x8c2d('0x4c')],'waiting':_0x2fd8a4[_0x8c2d('0x4d')]};_0x212a42[_0x8c2d('0x1e')](_0x1918dd);}}_0x20faea({'count':_0x212a42['length'],'rows':_0x212a42});});},'MailQueues':function(_0x3cab0a){return new Promise(function(_0x2da6de,_0x59b320){var _0x19ccf6=[];for(var _0x4529e6 in _0x4b185b[_0x8c2d('0x4e')]){if(_0x4b185b['mailQueues'][_0x8c2d('0x44')](_0x4529e6)){var _0x5969e2=_0x4b185b[_0x8c2d('0x4e')][_0x4529e6];var _0x46f02c={'id':_0x5969e2['id'],'available':_0x5969e2[_0x8c2d('0x4b')],'loggedIn':_0x5969e2['loggedIn'],'name':_0x5969e2[_0x8c2d('0x4f')],'paused':_0x5969e2[_0x8c2d('0x4c')],'waiting':_0x5969e2[_0x8c2d('0x4d')]};_0x19ccf6[_0x8c2d('0x1e')](_0x46f02c);}}_0x2da6de({'count':_0x19ccf6[_0x8c2d('0x18')],'rows':_0x19ccf6});});},'OpenchannelQueues':function(_0x232953){return new Promise(function(_0x5c38d7,_0x1ba090){var _0xc4df5b=[];for(var _0xd675d3 in _0x4b185b[_0x8c2d('0x50')]){if(_0x4b185b[_0x8c2d('0x50')][_0x8c2d('0x44')](_0xd675d3)){var _0x3ad380=_0x4b185b[_0x8c2d('0x50')][_0xd675d3];var _0x397981={'id':_0x3ad380['id'],'available':_0x3ad380[_0x8c2d('0x4b')],'loggedIn':_0x3ad380[_0x8c2d('0x51')],'name':_0x3ad380[_0x8c2d('0x4f')],'paused':_0x3ad380[_0x8c2d('0x4c')],'waiting':_0x3ad380['waiting']};_0xc4df5b[_0x8c2d('0x1e')](_0x397981);}}_0x5c38d7({'count':_0xc4df5b[_0x8c2d('0x18')],'rows':_0xc4df5b});});},'SmsQueues':function(_0xb25649){return new Promise(function(_0x1e4701,_0x379132){var _0x4fe06=[];for(var _0x33e98d in _0x4b185b[_0x8c2d('0x52')]){if(_0x4b185b[_0x8c2d('0x52')]['hasOwnProperty'](_0x33e98d)){var _0x522945=_0x4b185b[_0x8c2d('0x52')][_0x33e98d];var _0x1ada6b={'id':_0x522945['id'],'available':_0x522945[_0x8c2d('0x4b')],'loggedIn':_0x522945[_0x8c2d('0x51')],'name':_0x522945['name'],'paused':_0x522945[_0x8c2d('0x4c')],'waiting':_0x522945[_0x8c2d('0x4d')]};_0x4fe06[_0x8c2d('0x1e')](_0x1ada6b);}}_0x1e4701({'count':_0x4fe06[_0x8c2d('0x18')],'rows':_0x4fe06});});},'FaxQueues':function(_0x21f4ae){return new Promise(function(_0x58f72e,_0x17495e){var _0x42ffcc=[];for(var _0x1dcf49 in _0x4b185b[_0x8c2d('0x53')]){if(_0x4b185b[_0x8c2d('0x53')]['hasOwnProperty'](_0x1dcf49)){var _0x4aa555=_0x4b185b[_0x8c2d('0x53')][_0x1dcf49];var _0x15d1bc={'id':_0x4aa555['id'],'available':_0x4aa555['available'],'loggedIn':_0x4aa555['loggedIn'],'name':_0x4aa555[_0x8c2d('0x4f')],'paused':_0x4aa555[_0x8c2d('0x4c')],'waiting':_0x4aa555[_0x8c2d('0x4d')]};_0x42ffcc['push'](_0x15d1bc);}}_0x58f72e({'count':_0x42ffcc[_0x8c2d('0x18')],'rows':_0x42ffcc});});},'ChatQueuesWaitingInteractions':function(_0x16d941){return new Promise(function(_0x4cbf56,_0x92e564){var _0x2bbe96=_['values'](_0x4b185b[_0x8c2d('0x54')]);_0x4cbf56({'count':_0x2bbe96[_0x8c2d('0x18')],'rows':_0x2bbe96});});},'MailQueuesWaitingInteractions':function(_0xf8657e){return new Promise(function(_0x23d704,_0x1e349b){var _0x3f2c40=_[_0x8c2d('0x49')](_0x4b185b['mailQueuesWaitingInteractions']);_0x23d704({'count':_0x3f2c40[_0x8c2d('0x18')],'rows':_0x3f2c40});});},'OpenchannelQueuesWaitingInteractions':function(_0xb3b978){return new Promise(function(_0x5550f4,_0x107e71){var _0x1b6896=_[_0x8c2d('0x49')](_0x4b185b[_0x8c2d('0x55')]);_0x5550f4({'count':_0x1b6896[_0x8c2d('0x18')],'rows':_0x1b6896});});},'SmsQueuesWaitingInteractions':function(_0x582fb3){return new Promise(function(_0x2abb83,_0x405ace){var _0x492129=_[_0x8c2d('0x49')](_0x4b185b[_0x8c2d('0x56')]);_0x2abb83({'count':_0x492129[_0x8c2d('0x18')],'rows':_0x492129});});},'FaxQueuesWaitingInteractions':function(_0x3169bb){return new Promise(function(_0x47e0ce,_0x4daa95){var _0x1e986b=_['values'](_0x4b185b[_0x8c2d('0x57')]);_0x47e0ce({'count':_0x1e986b[_0x8c2d('0x18')],'rows':_0x1e986b});});}};var _0x5391dc=jayson[_0x8c2d('0x58')](_0x4634af)[_0x8c2d('0x59')]();_0x5391dc['on'](_0x8c2d('0x2e'),function(_0x410342){logger[_0x8c2d('0x2e')](JSON['stringify'](_0x410342));return _0x14ccdc(_0x410342);});_0x5391dc['listen'](0x232c,_0x8c2d('0x5a'),function(){console[_0x8c2d('0x5b')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x29612c(_0x8c2d('0x5c')+0x232c);});});}; \ No newline at end of file +var _0x443a=['routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','message','interaction','applications','existsSync','join','app','.js','toLowerCase','autoreply','push','slice','length','dialogflow','appdata','amazonlex','tag','TagId','split','%s:%s:%s','./interval','condition','intervals','./applications/','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','matchPath','emit','end','routing\x20is\x20empty','channel','QueueReport','update','UserId','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','agents','busy','agent','busyQueue','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','available','paused','waiting','mailQueues','loggedIn','name','openchannelQueues','smsQueues','faxQueues','faxQueuesWaitingInteractions','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/logger'];(function(_0x5d70e0,_0xb2fa39){var _0x11d97b=function(_0x23f8be){while(--_0x23f8be){_0x5d70e0['push'](_0x5d70e0['shift']());}};_0x11d97b(++_0xb2fa39);}(_0x443a,0xf8));var _0xa443=function(_0x25e5fc,_0x32b839){_0x25e5fc=_0x25e5fc-0x0;var _0x2fafb0=_0x443a[_0x25e5fc];return _0x2fafb0;};'use strict';var _=require(_0xa443('0x0'));var util=require(_0xa443('0x1'));var path=require(_0xa443('0x2'));var fs=require('fs');var jayson=require(_0xa443('0x3'));var BPromise=require(_0xa443('0x4'));var uuid=require(_0xa443('0x5'));var config=require('../../../config/environment');var logger=require(_0xa443('0x6'))(_0xa443('0x7'));var rpc={'openchannelQueueReport':require(_0xa443('0x8'))};var rpc={'openchannelQueueReport':require(_0xa443('0x8')),'mailQueueReport':require(_0xa443('0x9')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xa443('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x134462,_0x2e4f3b,_0x5cfdf3){return util[_0xa443('0xb')](_0xa443('0xc'),_0x134462,_0x2e4f3b||0x0,_0x5cfdf3||0x0);}function getIntervals(_0xf667d9,_0xcaf62a){var _0x36e9bf=[];if(!_['isNil'](_0xcaf62a[_0xa443('0xd')])&&!_['isNil'](_0xf667d9[_0xcaf62a['IntervalId']])&&!_[_0xa443('0xe')](_0xf667d9[_0xcaf62a[_0xa443('0xd')]][_0xa443('0xf')])){_0x36e9bf=_[_0xa443('0x10')](_0xf667d9[_0xcaf62a[_0xa443('0xd')]][_0xa443('0xf')],_0xa443('0x11'));}else if(!_[_0xa443('0xe')](_0xcaf62a[_0xa443('0x11')])){_0x36e9bf=[_0xcaf62a[_0xa443('0x11')]];}return _0x36e9bf;}exports[_0xa443('0x12')]=function(_0x451d03){_0x451d03[_0xa443('0x13')]={};return new BPromise(function(_0x15d3f1,_0x5340c2){var _0x48ce3d={'Start':function(_0x557323){var _0x25ea20=this;return new Promise(function(_0x54e49f,_0x524a71){if(_0x557323){try{var _0x4ae271=[];var _0x2193d7=getId(_0x557323['channel'],_0x557323[_0xa443('0x14')]?_0x557323[_0xa443('0x14')]['id']:0x0,_0x557323[_0xa443('0x15')]?_0x557323[_0xa443('0x15')]['id']:0x0);if(_0x557323[_0xa443('0x16')]&&_['isArray'](_0x557323['applications'])&&_0x557323[_0xa443('0x16')]['length']){for(var _0x31534a=0x0;_0x31534a<_0x557323['applications']['length'];_0x31534a+=0x1){var _0xdfc92b=_0x557323['applications'][_0x31534a];if(fs[_0xa443('0x17')](path[_0xa443('0x18')](__dirname,_0xa443('0x16'),_0xdfc92b[_0xa443('0x19')]+_0xa443('0x1a')))){var _0x20a786=[];switch(_0xdfc92b[_0xa443('0x19')][_0xa443('0x1b')]()){case _0xa443('0x1c'):var _0x1a2a14=_0xdfc92b['appdata']['split'](',');_0x20a786[_0xa443('0x1d')](_0x1a2a14[0x0]);_0x20a786['push'](_0x1a2a14[_0xa443('0x1e')](0x1,_0x1a2a14[_0xa443('0x1f')])[_0xa443('0x18')](','));break;case _0xa443('0x20'):var _0x1a2a14=_0xdfc92b[_0xa443('0x21')]['split'](',');_0x20a786['push'](_0x1a2a14[0x0]);_0x20a786[_0xa443('0x1d')](_0x1a2a14[0x1]);_0x20a786['push'](_0x1a2a14[_0xa443('0x1e')](0x2,_0x1a2a14['length'])[_0xa443('0x18')](','));break;case _0xa443('0x22'):var _0x1a2a14=_0xdfc92b['appdata']['split'](',');_0x20a786[_0xa443('0x1d')](_0x1a2a14[0x0]);_0x20a786[_0xa443('0x1d')](_0x1a2a14[0x1]);_0x20a786[_0xa443('0x1d')](_0x1a2a14[0x2]);_0x20a786[_0xa443('0x1d')](_0x1a2a14[0x3]);_0x20a786[_0xa443('0x1d')](_0x1a2a14[_0xa443('0x1e')](0x4,_0x1a2a14[_0xa443('0x1f')])['join'](','));break;case _0xa443('0x14'):_0x20a786['push'](_0xdfc92b[_0xa443('0x21')]);break;case _0xa443('0x23'):_0x20a786[_0xa443('0x1d')](_0xdfc92b[_0xa443('0x24')]);_0x20a786[_0xa443('0x1d')](_0xdfc92b[_0xa443('0x21')]);break;default:_0x20a786=_[_0xa443('0xe')](_0xdfc92b[_0xa443('0x21')])?[]:_0xdfc92b[_0xa443('0x21')][_0xa443('0x25')](',');}var _0x350119={'id':util[_0xa443('0xb')](_0xa443('0x26'),_0x2193d7,_0xdfc92b['id'],_0xdfc92b[_0xa443('0x19')]),'condition':require(_0xa443('0x27'))[_0xa443('0x28')](_0x2193d7,getIntervals(_0x451d03[_0xa443('0x29')],_0xdfc92b),_0x451d03),'consequence':require(_0xa443('0x2a')+_0xdfc92b[_0xa443('0x19')])['consequence'](_0x2193d7,_0x20a786,_0x451d03,_0x557323),'p':_0xdfc92b['priority']||0x0};logger['info'](_0xa443('0x2b'),_0x350119['id'],_0xa443('0x2c'),getIntervals(_0x451d03[_0xa443('0x29')],_0xdfc92b)[_0xa443('0x18')](_0xa443('0x2d')));_0x4ae271[_0xa443('0x1d')](_0x350119);}else{logger[_0xa443('0x2e')](_0xa443('0x2f'),path[_0xa443('0x18')](__dirname,_0xa443('0x16'),_0xdfc92b[_0xa443('0x19')]+_0xa443('0x1a')));}}_0x451d03['rules'][_0x2193d7]=new RuleEngine(_0x4ae271);_0x451d03['rules'][_0x2193d7][_0xa443('0x30')](_0x557323,function(_0x478bea){logger[_0xa443('0x31')](_0xa443('0x32'),JSON[_0xa443('0x33')](_0x478bea[_0xa443('0x34')]));if(_0x451d03[_0xa443('0x13')][_0x2193d7]){_0x451d03[_0xa443('0x13')][_0x2193d7][_0xa443('0x35')](_0xa443('0x36'));}});return _0x54e49f({'code':0xc8,'message':_0x557323});}else{logger[_0xa443('0x31')]('No\x20applications\x20to\x20execute');return _0x54e49f({'code':0xc8,'message':_0x557323});}}catch(_0x14a437){logger[_0xa443('0x2e')](_0x14a437['stack']);return _0x524a71(_0x25ea20[_0xa443('0x2e')](0x1f4,_0x14a437));}}return _0x524a71(_0xa443('0x37'));});},'AcceptMessage':function(_0x9af72e){var _0x27abb4=this;return new Promise(function(_0x50c068,_0x8df722){if(_0x9af72e[_0xa443('0x14')]&&_0x9af72e[_0xa443('0x14')]['id']){try{var _0x1cf23c=getId(_0x9af72e[_0xa443('0x38')],_0x9af72e[_0xa443('0x14')]?_0x9af72e[_0xa443('0x14')]['id']:0x0,_0x9af72e['interaction']?_0x9af72e[_0xa443('0x15')]['id']:0x0);if(_0x451d03[_0xa443('0x13')][_0x1cf23c]){_0x451d03[_0xa443('0x13')][_0x1cf23c][_0xa443('0x35')]('end');if(rpc[_0x9af72e[_0xa443('0x38')]+_0xa443('0x39')]){rpc[_0x9af72e['channel']+_0xa443('0x39')][_0xa443('0x3a')](_0x1cf23c,{'UserId':_0x9af72e[_0xa443('0x14')][_0xa443('0x3b')]})['catch'](function(_0x18d7f5){logger['error'](_0xa443('0x3c'));});}}return _0x50c068({'code':0xc8,'message':_0x9af72e});}catch(_0x2e6d7c){logger[_0xa443('0x2e')](_0x2e6d7c[_0xa443('0x3d')]);return _0x8df722(_0x27abb4[_0xa443('0x2e')](0x1f4,_0x2e6d7c));}}logger[_0xa443('0x2e')](_0xa443('0x3e'));return _0x8df722(_0x27abb4[_0xa443('0x2e')](0x1f4,_0xa443('0x3e')));});},'RejectMessage':function(_0x4353bb){var _0x2c7048=this;return new Promise(function(_0x2f49cd,_0x5014a6){if(_0x4353bb['agent']&&_0x4353bb['agent']['id']){try{if(_0x451d03[_0xa443('0x3f')][_0x4353bb['agent']['id']]){_0x451d03[_0xa443('0x3f')][_0x4353bb['agent']['id']][_0xa443('0x40')]=![];_0x451d03[_0xa443('0x3f')][_0x4353bb[_0xa443('0x41')]['id']][_0xa443('0x42')]=undefined;}return _0x2f49cd({'code':0xc8,'message':_0x4353bb});}catch(_0x1a96d0){logger[_0xa443('0x2e')](_0x1a96d0[_0xa443('0x3d')]);return _0x5014a6(_0x2c7048[_0xa443('0x2e')](0x1f4,_0x1a96d0));}}logger[_0xa443('0x2e')](_0xa443('0x3e'));return _0x5014a6(_0x2c7048[_0xa443('0x2e')](0x1f4,_0xa443('0x3e')));});},'AbandonInteraction':function(_0x3d3baa){var _0x1298a2=this;return new Promise(function(_0x49226e,_0x2bca97){if(_0x3d3baa['channel']&&_0x3d3baa[_0xa443('0x15')]&&_0x3d3baa[_0xa443('0x15')]['id']){try{var _0x4bf36a=getId(_0x3d3baa[_0xa443('0x38')],_0x3d3baa[_0xa443('0x14')]?_0x3d3baa['message']['id']:0x0,_0x3d3baa[_0xa443('0x15')]?_0x3d3baa[_0xa443('0x15')]['id']:0x0);if(_0x451d03['rules'][_0x4bf36a]){_0x451d03[_0xa443('0x13')][_0x4bf36a][_0xa443('0x35')](_0xa443('0x36'));}return _0x49226e({'code':0xc8,'message':_0x3d3baa});}catch(_0x21a69a){logger['error'](_0x21a69a[_0xa443('0x3d')]);return _0x2bca97(_0x1298a2[_0xa443('0x2e')](0x1f4,_0x21a69a));}}logger[_0xa443('0x2e')](_0xa443('0x3e'));return _0x2bca97(_0x1298a2[_0xa443('0x2e')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x3a3e4e){var _0x1b9dad=this;return new Promise(function(_0x312033,_0x63e95a){if(_0x451d03[_0xa443('0x3f')][_0xa443('0x43')](_0x3a3e4e['id'])){for(var _0x22eb4f in _0x3a3e4e[_0xa443('0x44')]){if(_0x3a3e4e[_0xa443('0x44')][_0xa443('0x43')](_0x22eb4f)){if(_0x451d03[_0xa443('0x3f')][_0x3a3e4e['id']][_0xa443('0x43')](_0x22eb4f+_0xa443('0x45'))){_0x451d03[_0xa443('0x3f')][_0x3a3e4e['id']][_0x22eb4f+_0xa443('0x45')]=parseInt(_0x3a3e4e[_0xa443('0x44')][_0x22eb4f],0xa);}}}_0x451d03['agents'][_0x3a3e4e['id']]['updateRealtime']();return _0x312033({'code':0xc8,'message':_0x451d03[_0xa443('0x3f')][_0x3a3e4e['id']]});}else{return _0x63e95a(_0x1b9dad['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x163e6f){return new Promise(function(_0xa00478,_0x365418){var _0x30ee45=_[_0xa443('0x46')](_0x451d03[_0xa443('0x3f')]);_0xa00478({'count':_0x30ee45[_0xa443('0x1f')],'rows':_0x30ee45});});},'ChatQueues':function(_0x5c8c15){return new Promise(function(_0x36298d,_0x3fe80e){var _0x4c0d1d=[];for(var _0x29d9b9 in _0x451d03['chatQueues']){if(_0x451d03[_0xa443('0x47')]['hasOwnProperty'](_0x29d9b9)){var _0x4c1ccf=_0x451d03[_0xa443('0x47')][_0x29d9b9];var _0x5c551a={'id':_0x4c1ccf['id'],'available':_0x4c1ccf[_0xa443('0x48')],'loggedIn':_0x4c1ccf['loggedIn'],'name':_0x4c1ccf['name'],'paused':_0x4c1ccf[_0xa443('0x49')],'waiting':_0x4c1ccf[_0xa443('0x4a')]};_0x4c0d1d[_0xa443('0x1d')](_0x5c551a);}}_0x36298d({'count':_0x4c0d1d[_0xa443('0x1f')],'rows':_0x4c0d1d});});},'MailQueues':function(_0x25860c){return new Promise(function(_0x387a6e,_0x3f21c2){var _0x32b4e0=[];for(var _0x33969f in _0x451d03[_0xa443('0x4b')]){if(_0x451d03[_0xa443('0x4b')][_0xa443('0x43')](_0x33969f)){var _0x392c53=_0x451d03['mailQueues'][_0x33969f];var _0x5c5af0={'id':_0x392c53['id'],'available':_0x392c53[_0xa443('0x48')],'loggedIn':_0x392c53[_0xa443('0x4c')],'name':_0x392c53[_0xa443('0x4d')],'paused':_0x392c53[_0xa443('0x49')],'waiting':_0x392c53[_0xa443('0x4a')]};_0x32b4e0['push'](_0x5c5af0);}}_0x387a6e({'count':_0x32b4e0['length'],'rows':_0x32b4e0});});},'OpenchannelQueues':function(_0x230d6c){return new Promise(function(_0x119cd6,_0x45538a){var _0xedf90d=[];for(var _0x594135 in _0x451d03[_0xa443('0x4e')]){if(_0x451d03['openchannelQueues'][_0xa443('0x43')](_0x594135)){var _0x2b2fea=_0x451d03[_0xa443('0x4e')][_0x594135];var _0x55665a={'id':_0x2b2fea['id'],'available':_0x2b2fea[_0xa443('0x48')],'loggedIn':_0x2b2fea[_0xa443('0x4c')],'name':_0x2b2fea[_0xa443('0x4d')],'paused':_0x2b2fea['paused'],'waiting':_0x2b2fea[_0xa443('0x4a')]};_0xedf90d['push'](_0x55665a);}}_0x119cd6({'count':_0xedf90d[_0xa443('0x1f')],'rows':_0xedf90d});});},'SmsQueues':function(_0x31af73){return new Promise(function(_0x275ac4,_0x5bc2af){var _0x487398=[];for(var _0x19a7ac in _0x451d03[_0xa443('0x4f')]){if(_0x451d03[_0xa443('0x4f')][_0xa443('0x43')](_0x19a7ac)){var _0x391ca5=_0x451d03['smsQueues'][_0x19a7ac];var _0x3b59cf={'id':_0x391ca5['id'],'available':_0x391ca5[_0xa443('0x48')],'loggedIn':_0x391ca5['loggedIn'],'name':_0x391ca5['name'],'paused':_0x391ca5[_0xa443('0x49')],'waiting':_0x391ca5[_0xa443('0x4a')]};_0x487398[_0xa443('0x1d')](_0x3b59cf);}}_0x275ac4({'count':_0x487398[_0xa443('0x1f')],'rows':_0x487398});});},'FaxQueues':function(_0x500507){return new Promise(function(_0x3d3260,_0x33449a){var _0x3eee6e=[];for(var _0x1334e5 in _0x451d03[_0xa443('0x50')]){if(_0x451d03[_0xa443('0x50')][_0xa443('0x43')](_0x1334e5)){var _0x209223=_0x451d03['faxQueues'][_0x1334e5];var _0x59d7f3={'id':_0x209223['id'],'available':_0x209223[_0xa443('0x48')],'loggedIn':_0x209223['loggedIn'],'name':_0x209223[_0xa443('0x4d')],'paused':_0x209223[_0xa443('0x49')],'waiting':_0x209223[_0xa443('0x4a')]};_0x3eee6e[_0xa443('0x1d')](_0x59d7f3);}}_0x3d3260({'count':_0x3eee6e[_0xa443('0x1f')],'rows':_0x3eee6e});});},'ChatQueuesWaitingInteractions':function(_0x2b4366){return new Promise(function(_0x487d55,_0x5e6fd0){var _0x535877=_['values'](_0x451d03['chatQueuesWaitingInteractions']);_0x487d55({'count':_0x535877['length'],'rows':_0x535877});});},'MailQueuesWaitingInteractions':function(_0x22bdb7){return new Promise(function(_0x43a6ab,_0x1881b6){var _0xc79616=_[_0xa443('0x46')](_0x451d03['mailQueuesWaitingInteractions']);_0x43a6ab({'count':_0xc79616['length'],'rows':_0xc79616});});},'OpenchannelQueuesWaitingInteractions':function(_0x141ec3){return new Promise(function(_0x4060ec,_0x4acd05){var _0x3312d3=_[_0xa443('0x46')](_0x451d03['openchannelQueuesWaitingInteractions']);_0x4060ec({'count':_0x3312d3[_0xa443('0x1f')],'rows':_0x3312d3});});},'SmsQueuesWaitingInteractions':function(_0x19d695){return new Promise(function(_0x514fa8,_0x22a7d8){var _0x439b1c=_[_0xa443('0x46')](_0x451d03['smsQueuesWaitingInteractions']);_0x514fa8({'count':_0x439b1c[_0xa443('0x1f')],'rows':_0x439b1c});});},'FaxQueuesWaitingInteractions':function(_0x59ae88){return new Promise(function(_0x34b2fd,_0x16b00d){var _0x3e5ddc=_[_0xa443('0x46')](_0x451d03[_0xa443('0x51')]);_0x34b2fd({'count':_0x3e5ddc[_0xa443('0x1f')],'rows':_0x3e5ddc});});}};var _0x2fefdd=jayson['server'](_0x48ce3d)['http']();_0x2fefdd['on']('error',function(_0x1ee4db){logger[_0xa443('0x2e')](JSON[_0xa443('0x33')](_0x1ee4db));return _0x5340c2(_0x1ee4db);});_0x2fefdd['listen'](0x232c,'127.0.0.1',function(){console[_0xa443('0x52')](_0xa443('0x53'),0x232c);return _0x15d3f1(_0xa443('0x54')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index da07fb2..bd21a26 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 _0x8ada=['[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','util','bluebird','lodash','../../../config/logger','routing','then','error','message','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','iftime\x20%s','indexOf','true','catch','all'];(function(_0x274f92,_0x2a349b){var _0x1fb917=function(_0x1a6793){while(--_0x1a6793){_0x274f92['push'](_0x274f92['shift']());}};_0x1fb917(++_0x2a349b);}(_0x8ada,0x71));var _0xa8ad=function(_0x2aeb4b,_0x29d79d){_0x2aeb4b=_0x2aeb4b-0x0;var _0x16138d=_0x8ada[_0x2aeb4b];return _0x16138d;};'use strict';var util=require(_0xa8ad('0x0'));var BPromise=require(_0xa8ad('0x1'));var jayson=require('jayson/promise');var _=require(_0xa8ad('0x2'));var logger=require(_0xa8ad('0x3'))(_0xa8ad('0x4'));var client=jayson['client']['http']({'port':0x232a});function request(_0xcd9f4c,_0x334bbe){return new BPromise(function(_0x6aadf7,_0x1e06c7){return client['request'](_0xcd9f4c,_0x334bbe)[_0xa8ad('0x5')](function(_0x1640f9){if(_0x1640f9[_0xa8ad('0x6')]){return _0x1e06c7(_0x1640f9['error'][_0xa8ad('0x7')]);}else{return _0x6aadf7(_0x1640f9[_0xa8ad('0x8')]);}})['catch'](function(_0x11aab1){return _0x1e06c7(_0x11aab1);});});}exports[_0xa8ad('0x9')]=function(_0x194001,_0x28c011,_0x36ce81){return function(_0x26860a){if(_0x36ce81[_0xa8ad('0xa')]&&!_0x36ce81[_0xa8ad('0xa')][_0x194001]){logger[_0xa8ad('0xb')](_0xa8ad('0xc'),_0x194001);return _0x26860a[_0xa8ad('0xd')]();}var _0xa00471=[];for(var _0x286fd3=0x0;_0x286fd3<_0x28c011[_0xa8ad('0xe')];_0x286fd3+=0x1){_0xa00471['push'](request(_0xa8ad('0xf'),{'command':util[_0xa8ad('0x10')](_0xa8ad('0x11'),_0x28c011[_0x286fd3])})[_0xa8ad('0x5')](function(_0x29fb4c){return _0x29fb4c&&_0x29fb4c['message']&&_0x29fb4c['message'][_0xa8ad('0x12')](_0xa8ad('0x13'))>=0x0?!![]:![];})[_0xa8ad('0x14')](function(_0x3c5b1b){logger['error']('[%s][INTERVAL]\x20%s',_0x194001,_0x28c011[_0x286fd3]);}));}BPromise[_0xa8ad('0x15')](_0xa00471)['then'](function(_0x468d01){var _0x3dcaad=_['some'](_0x468d01);logger[_0xa8ad('0xb')](_0xa8ad('0x16'),_0x194001,_0x28c011[_0xa8ad('0x17')](_0xa8ad('0x18')),_0x3dcaad);_0x26860a[_0xa8ad('0x19')](_0x3dcaad);})[_0xa8ad('0x14')](function(_0x34082e){console[_0xa8ad('0x1a')](_0x34082e);logger[_0xa8ad('0x6')]('[%s][INTERVAL]\x20%s\x20%s',_0x194001,_0x28c011[_0xa8ad('0x17')](_0xa8ad('0x18')),_0x34082e['stack']);_0x26860a[_0xa8ad('0xd')]();});};}; \ No newline at end of file +var _0x29cd=['jayson/promise','lodash','../../../config/logger','routing','client','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','some','\x20|\x20','[%s][INTERVAL]\x20%s\x20%s','join','stack','util'];(function(_0x356bb5,_0x17a055){var _0x4d4efb=function(_0x582b50){while(--_0x582b50){_0x356bb5['push'](_0x356bb5['shift']());}};_0x4d4efb(++_0x17a055);}(_0x29cd,0x167));var _0xd29c=function(_0x11e4c9,_0x5a6bbc){_0x11e4c9=_0x11e4c9-0x0;var _0x186952=_0x29cd[_0x11e4c9];return _0x186952;};'use strict';var util=require(_0xd29c('0x0'));var BPromise=require('bluebird');var jayson=require(_0xd29c('0x1'));var _=require(_0xd29c('0x2'));var logger=require(_0xd29c('0x3'))(_0xd29c('0x4'));var client=jayson[_0xd29c('0x5')]['http']({'port':0x232a});function request(_0x3dc0c7,_0x2ca520){return new BPromise(function(_0x4b2c23,_0x28a632){return client[_0xd29c('0x6')](_0x3dc0c7,_0x2ca520)[_0xd29c('0x7')](function(_0x4863b5){if(_0x4863b5[_0xd29c('0x8')]){return _0x28a632(_0x4863b5['error'][_0xd29c('0x9')]);}else{return _0x4b2c23(_0x4863b5[_0xd29c('0xa')]);}})[_0xd29c('0xb')](function(_0x460f4f){return _0x28a632(_0x460f4f);});});}exports[_0xd29c('0xc')]=function(_0x3ac259,_0xecbc0f,_0x439769){return function(_0x5df3b1){if(_0x439769['rules']&&!_0x439769[_0xd29c('0xd')][_0x3ac259]){logger[_0xd29c('0xe')](_0xd29c('0xf'),_0x3ac259);return _0x5df3b1[_0xd29c('0x10')]();}var _0x5d38c7=[];for(var _0x20904f=0x0;_0x20904f<_0xecbc0f[_0xd29c('0x11')];_0x20904f+=0x1){_0x5d38c7[_0xd29c('0x12')](request(_0xd29c('0x13'),{'command':util[_0xd29c('0x14')](_0xd29c('0x15'),_0xecbc0f[_0x20904f])})[_0xd29c('0x7')](function(_0x28e0fa){return _0x28e0fa&&_0x28e0fa[_0xd29c('0x9')]&&_0x28e0fa[_0xd29c('0x9')][_0xd29c('0x16')](_0xd29c('0x17'))>=0x0?!![]:![];})[_0xd29c('0xb')](function(_0x32b382){logger[_0xd29c('0x8')](_0xd29c('0x18'),_0x3ac259,_0xecbc0f[_0x20904f]);}));}BPromise['all'](_0x5d38c7)[_0xd29c('0x7')](function(_0x488186){var _0x42d892=_[_0xd29c('0x19')](_0x488186);logger[_0xd29c('0xe')]('[%s][INTERVAL]\x20%s\x20%s',_0x3ac259,_0xecbc0f['join'](_0xd29c('0x1a')),_0x42d892);_0x5df3b1['when'](_0x42d892);})[_0xd29c('0xb')](function(_0x257465){console['log'](_0x257465);logger[_0xd29c('0x8')](_0xd29c('0x1b'),_0x3ac259,_0xecbc0f[_0xd29c('0x1c')](_0xd29c('0x1a')),_0x257465[_0xd29c('0x1d')]);_0x5df3b1[_0xd29c('0x10')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index c367eee..9af92f3 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 _0x77c6=['agentacw','acwTimeout','request','CreateVoiceAgentReport','destchannel','agentringnoanswer','agentcomplete','agentcalled','called','assign','now','rejected','queuecallerabandon','forIn','abandon','agentconnect','isNil','connect','answered_elsewhere','destuniqueid','complete','blindtransfer','transfererchannel','attendedtransfer','origtransfererchannel','clone','transfertargetchannel','transfertargetcalleridname','secondtransfererchannel','transfereecalleridname','cdr','destinationchannel','endtime','diffTime','agentconnectAt','starttime','unknown','transfer','util','./utils','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','acw','acwtime'];(function(_0x360484,_0x2d14e5){var _0x461a10=function(_0x4c47c3){while(--_0x4c47c3){_0x360484['push'](_0x360484['shift']());}};_0x461a10(++_0x2d14e5);}(_0x77c6,0x1a0));var _0x677c=function(_0x10d5b0,_0x5b2b6f){_0x10d5b0=_0x10d5b0-0x0;var _0x5ae234=_0x77c6[_0x10d5b0];return _0x5ae234;};'use strict';var _=require('lodash');var util=require(_0x677c('0x0'));var utils=require(_0x677c('0x1'));var agents={};var transfers={};function writeDB(_0x3009c2){utils[_0x677c('0x2')](util[_0x677c('0x3')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x3009c2[_0x677c('0x4')],_0x3009c2[_0x677c('0x5')],_0x3009c2[_0x677c('0x6')],_0x3009c2[_0x677c('0x7')],_0x3009c2[_0x677c('0x8')],_0x3009c2[_0x677c('0x9')],_0x3009c2[_0x677c('0xa')],_0x3009c2['lastevent']));if(_0x3009c2[_0x677c('0x6')]){utils[_0x677c('0xb')](_0x3009c2[_0x677c('0x6')])[_0x677c('0xc')](function(_0x273c34){if(_0x273c34){_0x3009c2['type']=_0x273c34[_0x677c('0xd')];_0x3009c2['agentacw']=_0x3009c2['agentcomplete']?_0x273c34[_0x677c('0xe')]:![];_0x3009c2[_0x677c('0xf')]=_0x3009c2[_0x677c('0x10')]?_0x273c34[_0x677c('0x11')]:null;}utils[_0x677c('0x12')](_0x677c('0x13'),_0x3009c2);});}else{utils['request'](_0x677c('0x13'),_0x3009c2);}delete agents[_0x3009c2[_0x677c('0x14')]];}function isClosed(_0x565612){return _0x565612[_0x677c('0x15')]||_0x565612['agentconnect']||_0x565612[_0x677c('0x16')];}exports[_0x677c('0x17')]=function(_0x248dd4){agents[_0x248dd4[_0x677c('0x14')]]=_['assign'](_0x248dd4,{'agentcalled':!![],'agentcalledAt':utils['now'](),'lastevent':_0x677c('0x18')});};exports['agentringnoanswer']=function(_0x248f1a){if(!_['isNil'](agents[_0x248f1a['destchannel']])){agents[_0x248f1a[_0x677c('0x14')]]=_[_0x677c('0x19')](agents[_0x248f1a['destchannel']],_0x248f1a,{'agentringnoanswer':!![],'agentringnoanswerAt':utils[_0x677c('0x1a')](),'lastevent':_0x677c('0x1b'),'reason':_0x677c('0x1b')});}};exports[_0x677c('0x1c')]=function(_0x15a8f5){_[_0x677c('0x1d')](agents,function(_0x53fd87,_0x4b3e07){if(_0x53fd87['channel']==_0x15a8f5['channel']){if(!isClosed(_0x53fd87)){_0x53fd87=_[_0x677c('0x19')](_0x53fd87,{'agentringnoanswer':!![],'agentringnoanswerAt':utils['now'](),'lastevent':_0x677c('0x1e'),'reason':_0x677c('0x1e')});}}});};exports[_0x677c('0x1f')]=function(_0x357dec){if(!_[_0x677c('0x20')](agents[_0x357dec[_0x677c('0x14')]])){agents[_0x357dec[_0x677c('0x14')]]=_[_0x677c('0x19')](agents[_0x357dec['destchannel']],_0x357dec,{'agentconnect':!![],'agentconnectAt':utils[_0x677c('0x1a')](),'lastevent':_0x677c('0x21')});_['forIn'](agents,function(_0x25a9f7,_0x5a2263){if(_0x25a9f7['channel']==_0x357dec[_0x677c('0x5')]){if(!isClosed(_0x25a9f7)){_0x25a9f7=_['assign'](_0x25a9f7,{'agentringnoanswer':!![],'agentringnoanswerAt':utils['now'](),'lastevent':_0x677c('0x22'),'reason':'answered_elsewhere','answeredelsewheredestinationuniqueid':_0x357dec[_0x677c('0x23')],'answeredelsewheremembername':_0x357dec[_0x677c('0x7')]});}}});}};exports[_0x677c('0x16')]=function(_0x5112de){if(!_[_0x677c('0x20')](agents[_0x5112de[_0x677c('0x14')]])){agents[_0x5112de[_0x677c('0x14')]]=_[_0x677c('0x19')](agents[_0x5112de[_0x677c('0x14')]],_0x5112de,{'agentcomplete':!![],'agentcompleteAt':utils[_0x677c('0x1a')](),'lastevent':_0x677c('0x24')});}};exports[_0x677c('0x25')]=function(_0x520d87){if(!_['isNil'](agents[_0x520d87['transfererchannel']])){this['cdr']({'destinationchannel':_0x520d87[_0x677c('0x26')]});}};exports[_0x677c('0x27')]=function(_0x6314c0){_[_0x677c('0x1d')](agents,function(_0x2b886d){if(_0x2b886d[_0x677c('0x5')]==_0x6314c0[_0x677c('0x28')]){transfers[_0x2b886d['destchannel']]=_[_0x677c('0x29')](_0x2b886d);transfers[_0x2b886d[_0x677c('0x14')]]=_[_0x677c('0x19')](transfers[_0x2b886d[_0x677c('0x14')]],{'channel':_0x6314c0[_0x677c('0x2a')],'calleridname':_0x6314c0[_0x677c('0x2b')],'calleridnum':_0x6314c0['transfertargetconnectedlinenum']});}else if(_0x2b886d[_0x677c('0x5')]==_0x6314c0[_0x677c('0x2c')]){transfers[_0x2b886d['destchannel']]=_[_0x677c('0x29')](_0x2b886d);transfers[_0x2b886d[_0x677c('0x14')]]=_['assign'](transfers[_0x2b886d['destchannel']],{'channel':_0x6314c0['transfereechannel'],'calleridname':_0x6314c0[_0x677c('0x2d')],'calleridnum':_0x6314c0['transfereeconnectedlinenum']});}});};exports[_0x677c('0x2e')]=function(_0x437d59){if(!_['isNil'](agents[_0x437d59[_0x677c('0x2f')]])){if(!_[_0x677c('0x20')](agents[_0x437d59[_0x677c('0x2f')]]['agentconnectAt'])){agents[_0x437d59[_0x677c('0x2f')]]=_['assign'](agents[_0x437d59[_0x677c('0x2f')]],{'agentcomplete':!![],'agentcompleteAt':_0x437d59[_0x677c('0x30')],'holdtime':utils[_0x677c('0x31')](agents[_0x437d59[_0x677c('0x2f')]][_0x677c('0x32')],agents[_0x437d59['destinationchannel']]['agentcalledAt']),'talktime':utils['diffTime'](_0x437d59[_0x677c('0x30')],agents[_0x437d59['destinationchannel']][_0x677c('0x32')]),'lastevent':'complete'});}else if(_[_0x677c('0x20')](agents[_0x437d59[_0x677c('0x2f')]]['agentringnoanswerAt'])){agents[_0x437d59[_0x677c('0x2f')]]=_[_0x677c('0x19')](agents[_0x437d59[_0x677c('0x2f')]],{'agentringnoanswer':!![],'agentringnoanswerAt':_0x437d59['answertime']||_0x437d59[_0x677c('0x33')],'reason':_0x677c('0x34')});}writeDB(agents[_0x437d59[_0x677c('0x2f')]]);if(!_[_0x677c('0x20')](transfers[_0x437d59[_0x677c('0x2f')]])){agents[_0x437d59[_0x677c('0x2f')]]=_['assign'](transfers[_0x437d59['destinationchannel']],{'agentcalledAt':utils[_0x677c('0x1a')](),'agentconnectAt':transfers[_0x437d59[_0x677c('0x2f')]][_0x677c('0x1f')]?utils[_0x677c('0x1a')]():null,'lastevent':_0x677c('0x21'),'reason':_0x677c('0x35')});delete transfers[_0x437d59[_0x677c('0x2f')]];}}}; \ No newline at end of file +var _0x529e=['membername','interface','calleridnum','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','destchannel','assign','now','agentringnoanswer','isNil','queuecallerabandon','forIn','abandon','agentconnect','connect','answered_elsewhere','destuniqueid','cdr','transfererchannel','origtransfererchannel','clone','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','secondtransfererchannel','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','destinationchannel','agentconnectAt','endtime','agentcalledAt','diffTime','complete','answertime','starttime','unknown','lodash','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel'];(function(_0x29a8c8,_0x1150f1){var _0x5ed8ce=function(_0x203b7d){while(--_0x203b7d){_0x29a8c8['push'](_0x29a8c8['shift']());}};_0x5ed8ce(++_0x1150f1);}(_0x529e,0x139));var _0xe529=function(_0x1a308a,_0x46b3e9){_0x1a308a=_0x1a308a-0x0;var _0xe17c1e=_0x529e[_0x1a308a];return _0xe17c1e;};'use strict';var _=require(_0xe529('0x0'));var util=require('util');var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x4cba89){utils[_0xe529('0x1')](util['format'](_0xe529('0x2'),_0x4cba89[_0xe529('0x3')],_0x4cba89[_0xe529('0x4')],_0x4cba89['queue'],_0x4cba89[_0xe529('0x5')],_0x4cba89[_0xe529('0x6')],_0x4cba89[_0xe529('0x7')],_0x4cba89[_0xe529('0x8')],_0x4cba89[_0xe529('0x9')]));if(_0x4cba89[_0xe529('0xa')]){utils[_0xe529('0xb')](_0x4cba89['queue'])[_0xe529('0xc')](function(_0x5496d4){if(_0x5496d4){_0x4cba89[_0xe529('0xd')]=_0x5496d4[_0xe529('0xd')];_0x4cba89[_0xe529('0xe')]=_0x4cba89[_0xe529('0xf')]?_0x5496d4[_0xe529('0x10')]:![];_0x4cba89['acwtime']=_0x4cba89[_0xe529('0xe')]?_0x5496d4[_0xe529('0x11')]:null;}utils[_0xe529('0x12')](_0xe529('0x13'),_0x4cba89);});}else{utils[_0xe529('0x12')](_0xe529('0x13'),_0x4cba89);}delete agents[_0x4cba89['destchannel']];}function isClosed(_0x351fd0){return _0x351fd0['agentringnoanswer']||_0x351fd0['agentconnect']||_0x351fd0['agentcomplete'];}exports[_0xe529('0x14')]=function(_0x4af927){agents[_0x4af927[_0xe529('0x15')]]=_[_0xe529('0x16')](_0x4af927,{'agentcalled':!![],'agentcalledAt':utils[_0xe529('0x17')](),'lastevent':'called'});};exports[_0xe529('0x18')]=function(_0x2bed06){if(!_[_0xe529('0x19')](agents[_0x2bed06[_0xe529('0x15')]])){agents[_0x2bed06[_0xe529('0x15')]]=_[_0xe529('0x16')](agents[_0x2bed06[_0xe529('0x15')]],_0x2bed06,{'agentringnoanswer':!![],'agentringnoanswerAt':utils['now'](),'lastevent':'rejected','reason':'rejected'});}};exports[_0xe529('0x1a')]=function(_0x5c266d){_[_0xe529('0x1b')](agents,function(_0x30cc0e,_0x2c74b4){if(_0x30cc0e[_0xe529('0x4')]==_0x5c266d[_0xe529('0x4')]){if(!isClosed(_0x30cc0e)){_0x30cc0e=_[_0xe529('0x16')](_0x30cc0e,{'agentringnoanswer':!![],'agentringnoanswerAt':utils[_0xe529('0x17')](),'lastevent':_0xe529('0x1c'),'reason':_0xe529('0x1c')});}}});};exports[_0xe529('0x1d')]=function(_0x2e7b81){if(!_[_0xe529('0x19')](agents[_0x2e7b81[_0xe529('0x15')]])){agents[_0x2e7b81[_0xe529('0x15')]]=_[_0xe529('0x16')](agents[_0x2e7b81[_0xe529('0x15')]],_0x2e7b81,{'agentconnect':!![],'agentconnectAt':utils['now'](),'lastevent':_0xe529('0x1e')});_[_0xe529('0x1b')](agents,function(_0x4c02f6,_0x5f21c2){if(_0x4c02f6[_0xe529('0x4')]==_0x2e7b81[_0xe529('0x4')]){if(!isClosed(_0x4c02f6)){_0x4c02f6=_[_0xe529('0x16')](_0x4c02f6,{'agentringnoanswer':!![],'agentringnoanswerAt':utils[_0xe529('0x17')](),'lastevent':_0xe529('0x1f'),'reason':'answered_elsewhere','answeredelsewheredestinationuniqueid':_0x2e7b81[_0xe529('0x20')],'answeredelsewheremembername':_0x2e7b81[_0xe529('0x5')]});}}});}};exports[_0xe529('0xf')]=function(_0x11719d){if(!_['isNil'](agents[_0x11719d[_0xe529('0x15')]])){agents[_0x11719d[_0xe529('0x15')]]=_[_0xe529('0x16')](agents[_0x11719d['destchannel']],_0x11719d,{'agentcomplete':!![],'agentcompleteAt':utils[_0xe529('0x17')](),'lastevent':'complete'});}};exports['blindtransfer']=function(_0x2ab795){if(!_[_0xe529('0x19')](agents[_0x2ab795['transfererchannel']])){this[_0xe529('0x21')]({'destinationchannel':_0x2ab795[_0xe529('0x22')]});}};exports['attendedtransfer']=function(_0x39c689){_[_0xe529('0x1b')](agents,function(_0x4d544c){if(_0x4d544c[_0xe529('0x4')]==_0x39c689[_0xe529('0x23')]){transfers[_0x4d544c[_0xe529('0x15')]]=_[_0xe529('0x24')](_0x4d544c);transfers[_0x4d544c[_0xe529('0x15')]]=_['assign'](transfers[_0x4d544c[_0xe529('0x15')]],{'channel':_0x39c689[_0xe529('0x25')],'calleridname':_0x39c689[_0xe529('0x26')],'calleridnum':_0x39c689[_0xe529('0x27')]});}else if(_0x4d544c[_0xe529('0x4')]==_0x39c689[_0xe529('0x28')]){transfers[_0x4d544c[_0xe529('0x15')]]=_[_0xe529('0x24')](_0x4d544c);transfers[_0x4d544c[_0xe529('0x15')]]=_[_0xe529('0x16')](transfers[_0x4d544c[_0xe529('0x15')]],{'channel':_0x39c689[_0xe529('0x29')],'calleridname':_0x39c689[_0xe529('0x2a')],'calleridnum':_0x39c689[_0xe529('0x2b')]});}});};exports[_0xe529('0x21')]=function(_0x21cea0){if(!_[_0xe529('0x19')](agents[_0x21cea0['destinationchannel']])){if(!_[_0xe529('0x19')](agents[_0x21cea0[_0xe529('0x2c')]][_0xe529('0x2d')])){agents[_0x21cea0[_0xe529('0x2c')]]=_[_0xe529('0x16')](agents[_0x21cea0[_0xe529('0x2c')]],{'agentcomplete':!![],'agentcompleteAt':_0x21cea0[_0xe529('0x2e')],'holdtime':utils['diffTime'](agents[_0x21cea0[_0xe529('0x2c')]][_0xe529('0x2d')],agents[_0x21cea0[_0xe529('0x2c')]][_0xe529('0x2f')]),'talktime':utils[_0xe529('0x30')](_0x21cea0['endtime'],agents[_0x21cea0['destinationchannel']][_0xe529('0x2d')]),'lastevent':_0xe529('0x31')});}else if(_['isNil'](agents[_0x21cea0[_0xe529('0x2c')]]['agentringnoanswerAt'])){agents[_0x21cea0[_0xe529('0x2c')]]=_[_0xe529('0x16')](agents[_0x21cea0[_0xe529('0x2c')]],{'agentringnoanswer':!![],'agentringnoanswerAt':_0x21cea0[_0xe529('0x32')]||_0x21cea0[_0xe529('0x33')],'reason':_0xe529('0x34')});}writeDB(agents[_0x21cea0['destinationchannel']]);if(!_[_0xe529('0x19')](transfers[_0x21cea0[_0xe529('0x2c')]])){agents[_0x21cea0[_0xe529('0x2c')]]=_[_0xe529('0x16')](transfers[_0x21cea0['destinationchannel']],{'agentcalledAt':utils['now'](),'agentconnectAt':transfers[_0x21cea0[_0xe529('0x2c')]][_0xe529('0x1d')]?utils[_0xe529('0x17')]():null,'lastevent':_0xe529('0x1e'),'reason':'transfer'});delete transfers[_0x21cea0[_0xe529('0x2c')]];}}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 46a7bd3..9b80aa1 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 _0xb041=['appdata','lastIndexOf','assign','isBefore','starttime','isAfter','endtime','Local/_attended@transfer','destinationchannel','duration','hangup','util','./utils','answertime','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode','source','destination','callerid','then','UserId','request','CreateVoiceCallReport','linkedid','musiconholdstart','isNil','musiconholdstartAt','now','musiconholdstop','diffTime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','xmd-callerid-preview','xmd-callerid','xmd-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','newexten','application','toLowerCase','set','startsWith','cdr'];(function(_0x25ae18,_0x4dbf2d){var _0x3a6627=function(_0x556eb4){while(--_0x556eb4){_0x25ae18['push'](_0x25ae18['shift']());}};_0x3a6627(++_0x4dbf2d);}(_0xb041,0x79));var _0x1b04=function(_0x1c7da0,_0x33c53d){_0x1c7da0=_0x1c7da0-0x0;var _0x5ecdb9=_0xb041[_0x1c7da0];return _0x5ecdb9;};'use strict';var _=require('lodash');var util=require(_0x1b04('0x0'));var utils=require(_0x1b04('0x1'));var channels={};var timeouts={};function writeDB(_0x2339c2){return function(){_0x2339c2['answertime']=_0x2339c2[_0x1b04('0x2')]||null;utils[_0x1b04('0x3')](util[_0x1b04('0x4')](_0x1b04('0x5'),_0x2339c2[_0x1b04('0x6')],_0x2339c2[_0x1b04('0x7')],_0x2339c2[_0x1b04('0x8')],_0x2339c2[_0x1b04('0x9')],_0x2339c2[_0x1b04('0xa')],_0x2339c2[_0x1b04('0xb')],_0x2339c2[_0x1b04('0xc')],_0x2339c2['disposition']));if(_0x2339c2[_0x1b04('0x9')]){utils['getUserByInternal'](_0x2339c2[_0x1b04('0x9')])[_0x1b04('0xd')](function(_0x47a368){if(_0x47a368){_0x2339c2[_0x1b04('0xe')]=_0x47a368['id'];}utils[_0x1b04('0xf')](_0x1b04('0x10'),_0x2339c2);});}else{utils[_0x1b04('0xf')](_0x1b04('0x10'),_0x2339c2);}if(channels[_0x2339c2[_0x1b04('0x7')]]){delete channels[_0x2339c2[_0x1b04('0x7')]];}if(timeouts[_0x2339c2[_0x1b04('0x7')]]){delete timeouts[_0x2339c2['channel']];}};}exports['newchannel']=function(_0x2b91b4){if(_['isNil'](channels[_0x2b91b4[_0x1b04('0x7')]])&&_0x2b91b4[_0x1b04('0x6')]==_0x2b91b4[_0x1b04('0x11')]){channels[_0x2b91b4[_0x1b04('0x7')]]={'mohtime':0x0};if(_0x2b91b4[_0x1b04('0x9')]){channels[_0x2b91b4[_0x1b04('0x7')]][_0x1b04('0x9')]=_0x2b91b4[_0x1b04('0x9')];}}};exports[_0x1b04('0x12')]=function(_0xbbccde){if(!_[_0x1b04('0x13')](channels[_0xbbccde['channel']])){channels[_0xbbccde['channel']][_0x1b04('0x14')]=utils[_0x1b04('0x15')]();}};exports[_0x1b04('0x16')]=function(_0x219ea0){if(!_['isNil'](channels[_0x219ea0[_0x1b04('0x7')]])){if(!_[_0x1b04('0x13')](channels[_0x219ea0['channel']][_0x1b04('0x14')])){channels[_0x219ea0['channel']]['mohtime']+=utils[_0x1b04('0x17')](utils['now'](),channels[_0x219ea0[_0x1b04('0x7')]][_0x1b04('0x14')]);delete channels[_0x219ea0[_0x1b04('0x7')]][_0x1b04('0x14')];}}};exports[_0x1b04('0x18')]=function(_0x625652){if(!_[_0x1b04('0x13')](channels[_0x625652[_0x1b04('0x7')]])){if(!_['isNil'](_0x625652[_0x1b04('0x19')][_0x1b04('0x1a')])){channels[_0x625652[_0x1b04('0x7')]][_0x1b04('0xa')]=_0x625652[_0x1b04('0x1b')];}if(!_[_0x1b04('0x13')](_0x625652[_0x1b04('0x19')][_0x1b04('0x1c')])){channels[_0x625652['channel']][_0x1b04('0xb')]=_0x625652[_0x1b04('0x1b')];}if(!_[_0x1b04('0x13')](_0x625652[_0x1b04('0x19')][_0x1b04('0x1d')])||!_['isNil'](_0x625652['variable'][_0x1b04('0x1e')])){channels[_0x625652[_0x1b04('0x7')]][_0x1b04('0xc')]=_0x625652[_0x1b04('0x1b')];}if(!_[_0x1b04('0x13')](_0x625652['variable'][_0x1b04('0x1f')])){channels[_0x625652[_0x1b04('0x7')]][_0x1b04('0x20')]=_0x1b04('0x21');channels[_0x625652[_0x1b04('0x7')]][_0x1b04('0x22')]=_0x625652[_0x1b04('0x1b')];channels[_0x625652['channel']][_0x1b04('0x23')]=!![];}if(!_[_0x1b04('0x13')](_0x625652[_0x1b04('0x19')][_0x1b04('0x24')])){channels[_0x625652[_0x1b04('0x7')]][_0x1b04('0x25')]=_0x625652['value'];}if(!_[_0x1b04('0x13')](_0x625652[_0x1b04('0x19')]['outboundrouteid'])){channels[_0x625652[_0x1b04('0x7')]]['routeid']=_0x625652[_0x1b04('0x1b')];}}};exports[_0x1b04('0x26')]=function(_0x148e76){if(!_[_0x1b04('0x13')](channels[_0x148e76[_0x1b04('0x7')]])){if(_0x148e76[_0x1b04('0x27')][_0x1b04('0x28')]()==_0x1b04('0x29')&&_[_0x1b04('0x2a')](_0x148e76['appdata'][_0x1b04('0x28')](),_0x1b04('0x2b'))){var _0xb04fd4=_0x148e76[_0x1b04('0x2c')]['split']('=');var _0x5b3c7d=_0xb04fd4[0x0]['substring'](_0xb04fd4[0x0][_0x1b04('0x2d')]('(')+0x1,_0xb04fd4[0x0][_0x1b04('0x2d')](')'));var _0x2553c5=_0xb04fd4[0x1];channels[_0x148e76[_0x1b04('0x7')]][_0x5b3c7d]=_0x2553c5;}}};exports['agentcomplete']=function(_0x55dc78){if(!_[_0x1b04('0x13')](channels[_0x55dc78[_0x1b04('0x7')]])){channels[_0x55dc78[_0x1b04('0x7')]][_0x1b04('0x9')]=_0x55dc78['destaccountcode'];}};function handleCDR(_0x4d2dd4){if(_[_0x1b04('0x13')](timeouts[_0x4d2dd4[_0x1b04('0x7')]])){channels[_0x4d2dd4[_0x1b04('0x7')]]=_[_0x1b04('0x2e')](_0x4d2dd4,channels[_0x4d2dd4[_0x1b04('0x7')]]);}else{clearTimeout(timeouts[_0x4d2dd4[_0x1b04('0x7')]]);channels[_0x4d2dd4[_0x1b04('0x7')]]=_[_0x1b04('0x2e')](channels[_0x4d2dd4[_0x1b04('0x7')]],{'starttime':utils[_0x1b04('0x2f')](_0x4d2dd4['starttime'],channels[_0x4d2dd4[_0x1b04('0x7')]][_0x1b04('0x30')])?_0x4d2dd4[_0x1b04('0x30')]:channels[_0x4d2dd4[_0x1b04('0x7')]][_0x1b04('0x30')],'answertime':utils[_0x1b04('0x2f')](_0x4d2dd4[_0x1b04('0x2')],channels[_0x4d2dd4[_0x1b04('0x7')]]['answertime'])?_0x4d2dd4['answertime']:channels[_0x4d2dd4[_0x1b04('0x7')]][_0x1b04('0x2')]});if(utils[_0x1b04('0x31')](_0x4d2dd4[_0x1b04('0x32')],channels[_0x4d2dd4[_0x1b04('0x7')]][_0x1b04('0x32')])){channels[_0x4d2dd4['channel']]=_[_0x1b04('0x2e')](channels[_0x4d2dd4[_0x1b04('0x7')]],{'endtime':_0x4d2dd4[_0x1b04('0x32')],'destinationchannel':_[_0x1b04('0x2a')](_0x4d2dd4['destinationchannel'],_0x1b04('0x33'))?channels[_0x4d2dd4[_0x1b04('0x7')]][_0x1b04('0x34')]:_0x4d2dd4[_0x1b04('0x34')]});}channels[_0x4d2dd4['channel']][_0x1b04('0x35')]=utils['diffTime'](channels[_0x4d2dd4[_0x1b04('0x7')]][_0x1b04('0x32')],channels[_0x4d2dd4[_0x1b04('0x7')]][_0x1b04('0x30')]);channels[_0x4d2dd4[_0x1b04('0x7')]]['billableseconds']=utils[_0x1b04('0x17')](channels[_0x4d2dd4['channel']][_0x1b04('0x32')],channels[_0x4d2dd4['channel']][_0x1b04('0x2')]);if(_0x4d2dd4['lastapplication'][_0x1b04('0x28')]()!=_0x1b04('0x36')){channels[_0x4d2dd4[_0x1b04('0x7')]]['lastdata']=_0x4d2dd4[_0x1b04('0x22')];channels[_0x4d2dd4[_0x1b04('0x7')]][_0x1b04('0x20')]=_0x4d2dd4[_0x1b04('0x20')];}}timeouts[_0x4d2dd4[_0x1b04('0x7')]]=setTimeout(writeDB(channels[_0x4d2dd4[_0x1b04('0x7')]]),0x3e8);}exports['cdr']=function(_0x1ca980){if(!_[_0x1b04('0x13')](channels[_0x1ca980[_0x1b04('0x7')]])){handleCDR(_0x1ca980);}else if(!_['isNil'](channels[_0x1ca980[_0x1b04('0x34')]])){_0x1ca980[_0x1b04('0x7')]=_0x1ca980['destinationchannel'];handleCDR(_0x1ca980);}}; \ No newline at end of file +var _0xc7e5=['set','appdata','cdr','split','substring','lastIndexOf','destaccountcode','assign','isBefore','starttime','isAfter','endtime','Local/_attended@transfer','destinationchannel','duration','billableseconds','lastdata','lodash','util','./utils','answertime','uniqueid','channel','type','accountcode','callerid','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','isNil','linkedid','musiconholdstart','musiconholdstartAt','now','musiconholdstop','mohtime','diffTime','variable','xmd-originatecalleridnum','value','xmd-phone','xmd-callerid-preview','xmd-queue','lastapplication','queue','xmd-contactid','ContactId','routeid','newexten','application','toLowerCase'];(function(_0x1fba72,_0x3ab42f){var _0x419e98=function(_0x10ddf3){while(--_0x10ddf3){_0x1fba72['push'](_0x1fba72['shift']());}};_0x419e98(++_0x3ab42f);}(_0xc7e5,0x1c1));var _0x5c7e=function(_0x3a82b6,_0x525f8d){_0x3a82b6=_0x3a82b6-0x0;var _0x4ba1ee=_0xc7e5[_0x3a82b6];return _0x4ba1ee;};'use strict';var _=require(_0x5c7e('0x0'));var util=require(_0x5c7e('0x1'));var utils=require(_0x5c7e('0x2'));var channels={};var timeouts={};function writeDB(_0x4e1a21){return function(){_0x4e1a21[_0x5c7e('0x3')]=_0x4e1a21[_0x5c7e('0x3')]||null;utils['info'](util['format']('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x4e1a21[_0x5c7e('0x4')],_0x4e1a21[_0x5c7e('0x5')],_0x4e1a21[_0x5c7e('0x6')],_0x4e1a21[_0x5c7e('0x7')],_0x4e1a21['source'],_0x4e1a21['destination'],_0x4e1a21[_0x5c7e('0x8')],_0x4e1a21['disposition']));if(_0x4e1a21['accountcode']){utils[_0x5c7e('0x9')](_0x4e1a21[_0x5c7e('0x7')])[_0x5c7e('0xa')](function(_0x36d18b){if(_0x36d18b){_0x4e1a21[_0x5c7e('0xb')]=_0x36d18b['id'];}utils[_0x5c7e('0xc')](_0x5c7e('0xd'),_0x4e1a21);});}else{utils[_0x5c7e('0xc')]('CreateVoiceCallReport',_0x4e1a21);}if(channels[_0x4e1a21[_0x5c7e('0x5')]]){delete channels[_0x4e1a21['channel']];}if(timeouts[_0x4e1a21[_0x5c7e('0x5')]]){delete timeouts[_0x4e1a21[_0x5c7e('0x5')]];}};}exports[_0x5c7e('0xe')]=function(_0x51e86c){if(_[_0x5c7e('0xf')](channels[_0x51e86c[_0x5c7e('0x5')]])&&_0x51e86c[_0x5c7e('0x4')]==_0x51e86c[_0x5c7e('0x10')]){channels[_0x51e86c[_0x5c7e('0x5')]]={'mohtime':0x0};if(_0x51e86c[_0x5c7e('0x7')]){channels[_0x51e86c['channel']][_0x5c7e('0x7')]=_0x51e86c[_0x5c7e('0x7')];}}};exports[_0x5c7e('0x11')]=function(_0x21e0ee){if(!_[_0x5c7e('0xf')](channels[_0x21e0ee[_0x5c7e('0x5')]])){channels[_0x21e0ee[_0x5c7e('0x5')]][_0x5c7e('0x12')]=utils[_0x5c7e('0x13')]();}};exports[_0x5c7e('0x14')]=function(_0x157fe7){if(!_[_0x5c7e('0xf')](channels[_0x157fe7['channel']])){if(!_[_0x5c7e('0xf')](channels[_0x157fe7[_0x5c7e('0x5')]]['musiconholdstartAt'])){channels[_0x157fe7[_0x5c7e('0x5')]][_0x5c7e('0x15')]+=utils[_0x5c7e('0x16')](utils[_0x5c7e('0x13')](),channels[_0x157fe7['channel']][_0x5c7e('0x12')]);delete channels[_0x157fe7[_0x5c7e('0x5')]][_0x5c7e('0x12')];}}};exports['varset']=function(_0x2f82e7){if(!_[_0x5c7e('0xf')](channels[_0x2f82e7['channel']])){if(!_['isNil'](_0x2f82e7[_0x5c7e('0x17')][_0x5c7e('0x18')])){channels[_0x2f82e7['channel']]['source']=_0x2f82e7[_0x5c7e('0x19')];}if(!_[_0x5c7e('0xf')](_0x2f82e7['variable'][_0x5c7e('0x1a')])){channels[_0x2f82e7[_0x5c7e('0x5')]]['destination']=_0x2f82e7[_0x5c7e('0x19')];}if(!_[_0x5c7e('0xf')](_0x2f82e7[_0x5c7e('0x17')][_0x5c7e('0x1b')])||!_[_0x5c7e('0xf')](_0x2f82e7[_0x5c7e('0x17')]['xmd-callerid'])){channels[_0x2f82e7[_0x5c7e('0x5')]][_0x5c7e('0x8')]=_0x2f82e7[_0x5c7e('0x19')];}if(!_[_0x5c7e('0xf')](_0x2f82e7[_0x5c7e('0x17')][_0x5c7e('0x1c')])){channels[_0x2f82e7[_0x5c7e('0x5')]][_0x5c7e('0x1d')]='Queue';channels[_0x2f82e7[_0x5c7e('0x5')]]['lastdata']=_0x2f82e7[_0x5c7e('0x19')];channels[_0x2f82e7[_0x5c7e('0x5')]][_0x5c7e('0x1e')]=!![];}if(!_[_0x5c7e('0xf')](_0x2f82e7[_0x5c7e('0x17')][_0x5c7e('0x1f')])){channels[_0x2f82e7[_0x5c7e('0x5')]][_0x5c7e('0x20')]=_0x2f82e7['value'];}if(!_[_0x5c7e('0xf')](_0x2f82e7['variable']['outboundrouteid'])){channels[_0x2f82e7[_0x5c7e('0x5')]][_0x5c7e('0x21')]=_0x2f82e7[_0x5c7e('0x19')];}}};exports[_0x5c7e('0x22')]=function(_0x3de54e){if(!_['isNil'](channels[_0x3de54e[_0x5c7e('0x5')]])){if(_0x3de54e[_0x5c7e('0x23')][_0x5c7e('0x24')]()==_0x5c7e('0x25')&&_['startsWith'](_0x3de54e[_0x5c7e('0x26')][_0x5c7e('0x24')](),_0x5c7e('0x27'))){var _0x32c90a=_0x3de54e['appdata'][_0x5c7e('0x28')]('=');var _0x3776d6=_0x32c90a[0x0][_0x5c7e('0x29')](_0x32c90a[0x0][_0x5c7e('0x2a')]('(')+0x1,_0x32c90a[0x0][_0x5c7e('0x2a')](')'));var _0x4f380d=_0x32c90a[0x1];channels[_0x3de54e['channel']][_0x3776d6]=_0x4f380d;}}};exports['agentcomplete']=function(_0x2f548a){if(!_[_0x5c7e('0xf')](channels[_0x2f548a['channel']])){channels[_0x2f548a['channel']][_0x5c7e('0x7')]=_0x2f548a[_0x5c7e('0x2b')];}};function handleCDR(_0x57f91e){if(_[_0x5c7e('0xf')](timeouts[_0x57f91e['channel']])){channels[_0x57f91e['channel']]=_[_0x5c7e('0x2c')](_0x57f91e,channels[_0x57f91e['channel']]);}else{clearTimeout(timeouts[_0x57f91e['channel']]);channels[_0x57f91e[_0x5c7e('0x5')]]=_['assign'](channels[_0x57f91e[_0x5c7e('0x5')]],{'starttime':utils[_0x5c7e('0x2d')](_0x57f91e[_0x5c7e('0x2e')],channels[_0x57f91e[_0x5c7e('0x5')]]['starttime'])?_0x57f91e[_0x5c7e('0x2e')]:channels[_0x57f91e[_0x5c7e('0x5')]][_0x5c7e('0x2e')],'answertime':utils[_0x5c7e('0x2d')](_0x57f91e['answertime'],channels[_0x57f91e[_0x5c7e('0x5')]][_0x5c7e('0x3')])?_0x57f91e[_0x5c7e('0x3')]:channels[_0x57f91e[_0x5c7e('0x5')]]['answertime']});if(utils[_0x5c7e('0x2f')](_0x57f91e['endtime'],channels[_0x57f91e[_0x5c7e('0x5')]][_0x5c7e('0x30')])){channels[_0x57f91e[_0x5c7e('0x5')]]=_[_0x5c7e('0x2c')](channels[_0x57f91e[_0x5c7e('0x5')]],{'endtime':_0x57f91e[_0x5c7e('0x30')],'destinationchannel':_['startsWith'](_0x57f91e['destinationchannel'],_0x5c7e('0x31'))?channels[_0x57f91e[_0x5c7e('0x5')]][_0x5c7e('0x32')]:_0x57f91e[_0x5c7e('0x32')]});}channels[_0x57f91e[_0x5c7e('0x5')]][_0x5c7e('0x33')]=utils[_0x5c7e('0x16')](channels[_0x57f91e['channel']][_0x5c7e('0x30')],channels[_0x57f91e[_0x5c7e('0x5')]][_0x5c7e('0x2e')]);channels[_0x57f91e[_0x5c7e('0x5')]][_0x5c7e('0x34')]=utils[_0x5c7e('0x16')](channels[_0x57f91e['channel']][_0x5c7e('0x30')],channels[_0x57f91e[_0x5c7e('0x5')]]['answertime']);if(_0x57f91e['lastapplication'][_0x5c7e('0x24')]()!='hangup'){channels[_0x57f91e[_0x5c7e('0x5')]][_0x5c7e('0x35')]=_0x57f91e['lastdata'];channels[_0x57f91e[_0x5c7e('0x5')]][_0x5c7e('0x1d')]=_0x57f91e[_0x5c7e('0x1d')];}}timeouts[_0x57f91e['channel']]=setTimeout(writeDB(channels[_0x57f91e['channel']]),0x3e8);}exports[_0x5c7e('0x27')]=function(_0x5a642f){if(!_['isNil'](channels[_0x5a642f[_0x5c7e('0x5')]])){handleCDR(_0x5a642f);}else if(!_[_0x5c7e('0xf')](channels[_0x5a642f[_0x5c7e('0x32')]])){_0x5a642f['channel']=_0x5a642f['destinationchannel'];handleCDR(_0x5a642f);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 27ede9b..38913e8 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 _0x3630=['error','close','CLOSE','managerevent','./utils','info','CONNECTED','shutdown','fullybooted','FULLYBOOTED'];(function(_0x301adc,_0x31d821){var _0x51f219=function(_0x505f85){while(--_0x505f85){_0x301adc['push'](_0x301adc['shift']());}};_0x51f219(++_0x31d821);}(_0x3630,0x86));var _0x0363=function(_0x304a5d,_0x7a26e1){_0x304a5d=_0x304a5d-0x0;var _0x5c847d=_0x3630[_0x304a5d];return _0x5c847d;};'use strict';var utils=require(_0x0363('0x0'));exports['connect']=function(){utils[_0x0363('0x1')](_0x0363('0x2'));};exports[_0x0363('0x3')]=function(){utils[_0x0363('0x1')]('SHUTDOWN');};exports[_0x0363('0x4')]=function(){utils[_0x0363('0x1')](_0x0363('0x5'));};exports[_0x0363('0x6')]=function(_0x531a90){utils[_0x0363('0x6')](_0x531a90);};exports[_0x0363('0x7')]=function(){utils['info'](_0x0363('0x8'));};exports[_0x0363('0x9')]=function(_0x3bd116){}; \ No newline at end of file +var _0x62a9=['FULLYBOOTED','error','close','CLOSE','managerevent','CONNECTED','shutdown','info','SHUTDOWN','fullybooted'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0x62a9,0x1a9));var _0x962a=function(_0x58389d,_0x3137df){_0x58389d=_0x58389d-0x0;var _0x2be20a=_0x62a9[_0x58389d];return _0x2be20a;};'use strict';var utils=require('./utils');exports['connect']=function(){utils['info'](_0x962a('0x0'));};exports[_0x962a('0x1')]=function(){utils[_0x962a('0x2')](_0x962a('0x3'));};exports[_0x962a('0x4')]=function(){utils['info'](_0x962a('0x5'));};exports[_0x962a('0x6')]=function(_0x4c3179){utils[_0x962a('0x6')](_0x4c3179);};exports[_0x962a('0x7')]=function(){utils['info'](_0x962a('0x8'));};exports[_0x962a('0x9')]=function(_0x349378){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 128f605..79bfd83 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(_0x3167a8,_0x4d5006){var _0x20073f=function(_0x5b7216){while(--_0x5b7216){_0x3167a8['push'](_0x3167a8['shift']());}};_0x20073f(++_0x4d5006);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 c61d8c9..48e3b49 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 _0xe1dc=['./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','asterisk','port','username','keepConnected','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment'];(function(_0xbdd5f6,_0x369217){var _0x199486=function(_0x8b0f07){while(--_0x8b0f07){_0xbdd5f6['push'](_0xbdd5f6['shift']());}};_0x199486(++_0x369217);}(_0xe1dc,0x8a));var _0xce1d=function(_0x1d77b4,_0x21befb){_0x1d77b4=_0x1d77b4-0x0;var _0xd7dcd1=_0xe1dc[_0x1d77b4];return _0xd7dcd1;};var AsteriskManager=require(_0xce1d('0x0'));var config=require(_0xce1d('0x1'));var agents=require(_0xce1d('0x2'));var calls=require(_0xce1d('0x3'));var queues=require(_0xce1d('0x4'));var recordings=require(_0xce1d('0x5'));var members=require(_0xce1d('0x6'));var dials=require('./dials.controller');var transfers=require(_0xce1d('0x7'));var core=require('./core.controller');var utils=require('./utils');var ami=new AsteriskManager(config[_0xce1d('0x8')][_0xce1d('0x9')],config[_0xce1d('0x8')]['ip'],config[_0xce1d('0x8')][_0xce1d('0xa')],config[_0xce1d('0x8')]['password'],!![]);ami[_0xce1d('0xb')]();ami['on'](_0xce1d('0xc'),core['connect']);ami['on'](_0xce1d('0xd'),core[_0xce1d('0xd')]);ami['on'](_0xce1d('0xe'),core[_0xce1d('0xe')]);ami['on'](_0xce1d('0xf'),core[_0xce1d('0xf')]);ami['on'](_0xce1d('0x10'),core[_0xce1d('0x10')]);ami['on']('managerevent',core[_0xce1d('0x11')]);ami['on'](_0xce1d('0x12'),function(_0x520e85){try{members[_0xce1d('0x12')](_0x520e85);}catch(_0x4f23db){utils['error'](_0x4f23db);}});ami['on']('agentcalled',function(_0x378ee5){try{agents['agentcalled'](_0x378ee5);}catch(_0x319f9){utils['error'](_0x319f9);}});ami['on'](_0xce1d('0x13'),function(_0x1d54c3){try{agents['agentringnoanswer'](_0x1d54c3);}catch(_0x200bb0){utils[_0xce1d('0xf')](_0x200bb0);}});ami['on'](_0xce1d('0x14'),function(_0x2f34c8){try{agents[_0xce1d('0x14')](_0x2f34c8);recordings[_0xce1d('0x14')](_0x2f34c8);queues[_0xce1d('0x14')](_0x2f34c8);}catch(_0x4e383d){utils[_0xce1d('0xf')](_0x4e383d);}});ami['on'](_0xce1d('0x15'),function(_0x47fc0d){try{agents['agentcomplete'](_0x47fc0d);queues[_0xce1d('0x15')](_0x47fc0d);members['agentcomplete'](_0x47fc0d);calls[_0xce1d('0x15')](_0x47fc0d);}catch(_0x246f67){utils['error'](_0x246f67);}});ami['on'](_0xce1d('0x16'),function(_0x2fdf14){try{agents['queuecallerabandon'](_0x2fdf14);queues[_0xce1d('0x16')](_0x2fdf14);}catch(_0x5eba62){utils[_0xce1d('0xf')](_0x5eba62);}});ami['on']('queuecallerjoin',function(_0x5ea876){try{queues[_0xce1d('0x17')](_0x5ea876);}catch(_0x319da8){utils[_0xce1d('0xf')](_0x319da8);}});ami['on'](_0xce1d('0x18'),function(_0x18076d){try{queues[_0xce1d('0x18')](_0x18076d);}catch(_0x580e3a){utils['error'](_0x580e3a);}});ami['on'](_0xce1d('0x19'),function(_0x3b2b86){try{queues[_0xce1d('0x19')](_0x3b2b86);calls[_0xce1d('0x19')](_0x3b2b86);}catch(_0x1ae9ef){utils[_0xce1d('0xf')](_0x1ae9ef);}});ami['on'](_0xce1d('0x1a'),function(_0x5353be){try{queues[_0xce1d('0x1a')](_0x5353be);calls['musiconholdstop'](_0x5353be);}catch(_0x1f9eaa){utils['error'](_0x1f9eaa);}});ami['on'](_0xce1d('0x1b'),function(_0xfa9fa3){try{calls[_0xce1d('0x1b')](_0xfa9fa3);agents[_0xce1d('0x1b')](_0xfa9fa3);queues[_0xce1d('0x1b')](_0xfa9fa3);recordings[_0xce1d('0x1b')](_0xfa9fa3);dials[_0xce1d('0x1b')](_0xfa9fa3);members[_0xce1d('0x1b')](_0xfa9fa3);}catch(_0x2d41e6){utils[_0xce1d('0xf')](_0x2d41e6);}});ami['on'](_0xce1d('0x1c'),function(_0x87d7f3){try{queues[_0xce1d('0x1c')](_0x87d7f3);agents[_0xce1d('0x1c')](_0x87d7f3);transfers[_0xce1d('0x1c')](_0x87d7f3);}catch(_0x20a71b){utils[_0xce1d('0xf')](_0x20a71b);}});ami['on'](_0xce1d('0x1d'),function(_0x252653){try{queues[_0xce1d('0x1d')](_0x252653);transfers[_0xce1d('0x1d')](_0x252653);agents[_0xce1d('0x1d')](_0x252653);}catch(_0x36ffb0){utils[_0xce1d('0xf')](_0x36ffb0);}});ami['on'](_0xce1d('0x1e'),function(_0x3e9220){try{queues[_0xce1d('0x1e')](_0x3e9220);recordings[_0xce1d('0x1e')](_0x3e9220);calls[_0xce1d('0x1e')](_0x3e9220);dials[_0xce1d('0x1e')](_0x3e9220);}catch(_0x50c10c){utils['error'](_0x50c10c);}});ami['on'](_0xce1d('0x1f'),function(_0x3613dc){try{calls[_0xce1d('0x1f')](_0x3613dc);dials[_0xce1d('0x1f')](_0x3613dc);}catch(_0x550742){utils[_0xce1d('0xf')](_0x550742);}});ami['on'](_0xce1d('0x20'),function(_0x32aead){try{calls[_0xce1d('0x20')](_0x32aead);dials[_0xce1d('0x20')](_0x32aead);}catch(_0x3521d6){utils[_0xce1d('0xf')](_0x3521d6);}});ami['on'](_0xce1d('0x21'),function(_0x5f434f){try{dials[_0xce1d('0x21')](_0x5f434f);}catch(_0x55bf05){utils[_0xce1d('0xf')](_0x55bf05);}});ami['on'](_0xce1d('0x22'),function(_0x293808){try{dials[_0xce1d('0x22')](_0x293808);}catch(_0x11182c){utils[_0xce1d('0xf')](_0x11182c);}}); \ No newline at end of file +var _0xe3c5=['dialend','asterisk-manager','../../config/environment','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','./utils','asterisk','port','username','password','keepConnected','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x5c7525,_0x39490f){_0x5c7525=_0x5c7525-0x0;var _0x2e2ec8=_0xe3c5[_0x5c7525];return _0x2e2ec8;};var AsteriskManager=require(_0x5e3c('0x0'));var config=require(_0x5e3c('0x1'));var agents=require(_0x5e3c('0x2'));var calls=require(_0x5e3c('0x3'));var queues=require(_0x5e3c('0x4'));var recordings=require(_0x5e3c('0x5'));var members=require('./members.controller');var dials=require(_0x5e3c('0x6'));var transfers=require(_0x5e3c('0x7'));var core=require(_0x5e3c('0x8'));var utils=require(_0x5e3c('0x9'));var ami=new AsteriskManager(config[_0x5e3c('0xa')][_0x5e3c('0xb')],config[_0x5e3c('0xa')]['ip'],config[_0x5e3c('0xa')][_0x5e3c('0xc')],config[_0x5e3c('0xa')][_0x5e3c('0xd')],!![]);ami[_0x5e3c('0xe')]();ami['on']('connect',core['connect']);ami['on'](_0x5e3c('0xf'),core[_0x5e3c('0xf')]);ami['on'](_0x5e3c('0x10'),core[_0x5e3c('0x10')]);ami['on'](_0x5e3c('0x11'),core['error']);ami['on'](_0x5e3c('0x12'),core[_0x5e3c('0x12')]);ami['on']('managerevent',core[_0x5e3c('0x13')]);ami['on']('devicestatechange',function(_0x546d1f){try{members[_0x5e3c('0x14')](_0x546d1f);}catch(_0x415d96){utils[_0x5e3c('0x11')](_0x415d96);}});ami['on'](_0x5e3c('0x15'),function(_0x32efb7){try{agents[_0x5e3c('0x15')](_0x32efb7);}catch(_0x324a36){utils[_0x5e3c('0x11')](_0x324a36);}});ami['on']('agentringnoanswer',function(_0x54937f){try{agents[_0x5e3c('0x16')](_0x54937f);}catch(_0x2183ba){utils[_0x5e3c('0x11')](_0x2183ba);}});ami['on']('agentconnect',function(_0x4f7318){try{agents[_0x5e3c('0x17')](_0x4f7318);recordings[_0x5e3c('0x17')](_0x4f7318);queues[_0x5e3c('0x17')](_0x4f7318);}catch(_0x2c7c83){utils['error'](_0x2c7c83);}});ami['on']('agentcomplete',function(_0xc3635a){try{agents['agentcomplete'](_0xc3635a);queues['agentcomplete'](_0xc3635a);members[_0x5e3c('0x18')](_0xc3635a);calls['agentcomplete'](_0xc3635a);}catch(_0x5baa56){utils['error'](_0x5baa56);}});ami['on'](_0x5e3c('0x19'),function(_0x189480){try{agents['queuecallerabandon'](_0x189480);queues[_0x5e3c('0x19')](_0x189480);}catch(_0x55a5e8){utils[_0x5e3c('0x11')](_0x55a5e8);}});ami['on'](_0x5e3c('0x1a'),function(_0x1a4c88){try{queues[_0x5e3c('0x1a')](_0x1a4c88);}catch(_0x2ee7c4){utils[_0x5e3c('0x11')](_0x2ee7c4);}});ami['on'](_0x5e3c('0x1b'),function(_0x5ddd09){try{queues['queuecallerleave'](_0x5ddd09);}catch(_0x5d5ca3){utils['error'](_0x5d5ca3);}});ami['on'](_0x5e3c('0x1c'),function(_0x4754f4){try{queues[_0x5e3c('0x1c')](_0x4754f4);calls[_0x5e3c('0x1c')](_0x4754f4);}catch(_0x1a74ab){utils[_0x5e3c('0x11')](_0x1a74ab);}});ami['on']('musiconholdstop',function(_0x33b1dc){try{queues[_0x5e3c('0x1d')](_0x33b1dc);calls[_0x5e3c('0x1d')](_0x33b1dc);}catch(_0x26e86e){utils['error'](_0x26e86e);}});ami['on']('cdr',function(_0x1ae7a9){try{calls[_0x5e3c('0x1e')](_0x1ae7a9);agents['cdr'](_0x1ae7a9);queues[_0x5e3c('0x1e')](_0x1ae7a9);recordings[_0x5e3c('0x1e')](_0x1ae7a9);dials[_0x5e3c('0x1e')](_0x1ae7a9);members[_0x5e3c('0x1e')](_0x1ae7a9);}catch(_0x2163c1){utils['error'](_0x2163c1);}});ami['on'](_0x5e3c('0x1f'),function(_0x59acbb){try{queues['blindtransfer'](_0x59acbb);agents[_0x5e3c('0x1f')](_0x59acbb);transfers[_0x5e3c('0x1f')](_0x59acbb);}catch(_0xe61c3){utils[_0x5e3c('0x11')](_0xe61c3);}});ami['on']('attendedtransfer',function(_0x20d813){try{queues[_0x5e3c('0x20')](_0x20d813);transfers[_0x5e3c('0x20')](_0x20d813);agents[_0x5e3c('0x20')](_0x20d813);}catch(_0x5cd5d7){utils['error'](_0x5cd5d7);}});ami['on'](_0x5e3c('0x21'),function(_0x1ba87b){try{queues[_0x5e3c('0x21')](_0x1ba87b);recordings[_0x5e3c('0x21')](_0x1ba87b);calls['varset'](_0x1ba87b);dials[_0x5e3c('0x21')](_0x1ba87b);}catch(_0x2acef1){utils[_0x5e3c('0x11')](_0x2acef1);}});ami['on']('newexten',function(_0x3ee2d0){try{calls['newexten'](_0x3ee2d0);dials[_0x5e3c('0x22')](_0x3ee2d0);}catch(_0x3cbed8){utils[_0x5e3c('0x11')](_0x3cbed8);}});ami['on']('newchannel',function(_0x969b1e){try{calls['newchannel'](_0x969b1e);dials[_0x5e3c('0x23')](_0x969b1e);}catch(_0x3f2779){utils[_0x5e3c('0x11')](_0x3f2779);}});ami['on'](_0x5e3c('0x24'),function(_0x510c4e){try{dials[_0x5e3c('0x24')](_0x510c4e);}catch(_0x231e02){utils[_0x5e3c('0x11')](_0x231e02);}});ami['on'](_0x5e3c('0x25'),function(_0x30991b){try{dials[_0x5e3c('0x25')](_0x30991b);}catch(_0x3e18c5){utils[_0x5e3c('0x11')](_0x3e18c5);}}); \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 4f90aba..2610a69 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 _0x64b9=['request','CreateMemberReport','split','catch','error','startsWith','devicestatechange','state','INUSE','device','TALKING','now','agent','NOT_INUSE','duration','diffTime','exitAt','enterAt','agentcomplete','assign','queue','cdr','data1','source','data3','destination','uniqueid','destinationchannel','isNil','lodash','util','./utils','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','interface','channel','data2','membername','type','then','name','internal'];(function(_0x35a3e1,_0x2afa82){var _0x4833eb=function(_0x254a81){while(--_0x254a81){_0x35a3e1['push'](_0x35a3e1['shift']());}};_0x4833eb(++_0x2afa82);}(_0x64b9,0x75));var _0x964b=function(_0x4776ff,_0x1fcea9){_0x4776ff=_0x4776ff-0x0;var _0x1cfe3a=_0x64b9[_0x4776ff];return _0x1cfe3a;};'use strict';var _=require(_0x964b('0x0'));var util=require(_0x964b('0x1'));var utils=require(_0x964b('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x964b('0x3')];function writeDB(_0x33d216){utils[_0x964b('0x4')](util[_0x964b('0x5')](_0x964b('0x6'),_0x33d216['uniqueid'],_0x33d216[_0x964b('0x7')],_0x33d216[_0x964b('0x8')],_0x33d216[_0x964b('0x9')],_0x33d216[_0x964b('0xa')],_0x33d216[_0x964b('0xb')]));if(_0x33d216[_0x964b('0x7')]){utils['getUserByInterface'](_0x33d216[_0x964b('0x7')])[_0x964b('0xc')](function(_0x163e40){if(_0x163e40){_0x33d216[_0x964b('0xa')]=_0x163e40[_0x964b('0xd')];_0x33d216[_0x964b('0xe')]=_0x163e40['internal'];utils[_0x964b('0xf')](_0x964b('0x10'),_0x33d216);}else{utils['getUserByName'](_0x33d216[_0x964b('0x7')][_0x964b('0x11')]('/')[0x1])[_0x964b('0xc')](function(_0x3d60e6){if(_0x3d60e6){_0x33d216[_0x964b('0xa')]=_0x3d60e6[_0x964b('0xd')];_0x33d216[_0x964b('0xe')]=_0x3d60e6[_0x964b('0xe')];utils['request']('CreateMemberReport',_0x33d216);}});}})[_0x964b('0x12')](function(_0x564b86){utils[_0x964b('0x13')](_0x564b86);});}delete members[_0x33d216[_0x964b('0x7')]];}function startsWith(_0x40c680,_0x3bac58){return _['some'](_0x40c680,function(_0x38a733){return _[_0x964b('0x14')](_0x3bac58,_0x38a733);});}exports[_0x964b('0x15')]=function(_0x411d9e){switch(_0x411d9e[_0x964b('0x16')]){case _0x964b('0x17'):case'BUSY':if(!startsWith(exclude,_0x411d9e[_0x964b('0x18')])){members[_0x411d9e[_0x964b('0x18')]]={'channel':'voice','interface':_0x411d9e[_0x964b('0x18')],'type':_0x964b('0x19'),'enterAt':utils[_0x964b('0x1a')](),'role':_0x964b('0x1b')};}break;case _0x964b('0x1c'):if(!_['isNil'](members[_0x411d9e[_0x964b('0x18')]])){members[_0x411d9e[_0x964b('0x18')]]['exitAt']=utils[_0x964b('0x1a')]();members[_0x411d9e[_0x964b('0x18')]][_0x964b('0x1d')]=utils[_0x964b('0x1e')](members[_0x411d9e[_0x964b('0x18')]][_0x964b('0x1f')],members[_0x411d9e['device']][_0x964b('0x20')]);if(members[_0x411d9e[_0x964b('0x18')]]['uniqueid']){writeDB(members[_0x411d9e['device']]);}}default:break;}};exports[_0x964b('0x21')]=function(_0x3b4b5d){if(!_['isNil'](members[_0x3b4b5d[_0x964b('0x7')]])){members[_0x3b4b5d[_0x964b('0x7')]]=_[_0x964b('0x22')](members[_0x3b4b5d[_0x964b('0x7')]],{'data4':_0x3b4b5d[_0x964b('0x23')]});}};exports[_0x964b('0x24')]=function(_0xe80322){if(_0xe80322['channel']){var _0x32693a=_0xe80322[_0x964b('0x8')][_0x964b('0x11')]('-')[0x0];if(!_['isNil'](members[_0x32693a])){members[_0x32693a]=_[_0x964b('0x22')](members[_0x32693a],{'data1':members[_0x32693a][_0x964b('0x25')]||_0xe80322[_0x964b('0xb')],'data2':members[_0x32693a][_0x964b('0x9')]||_0xe80322[_0x964b('0x26')],'data3':members[_0x32693a][_0x964b('0x27')]||_0xe80322[_0x964b('0x28')],'uniqueid':members[_0x32693a][_0x964b('0x29')]||_0xe80322['uniqueid']});if(members[_0x32693a][_0x964b('0x1f')]){writeDB(members[_0x32693a]);}}}if(_0xe80322[_0x964b('0x2a')]){var _0xb89f01=_0xe80322[_0x964b('0x2a')][_0x964b('0x11')]('-')[0x0];if(!_[_0x964b('0x2b')](members[_0xb89f01])){members[_0xb89f01]=_[_0x964b('0x22')](members[_0xb89f01],{'data1':members[_0xb89f01][_0x964b('0x25')]||_0xe80322[_0x964b('0xb')],'data2':members[_0xb89f01][_0x964b('0x9')]||_0xe80322['source'],'data3':members[_0xb89f01][_0x964b('0x27')]||_0xe80322[_0x964b('0x28')],'uniqueid':members[_0xb89f01][_0x964b('0x29')]||_0xe80322[_0x964b('0x29')]});if(members[_0xb89f01][_0x964b('0x1f')]){writeDB(members[_0xb89f01]);}}}}; \ No newline at end of file +var _0x3566=['internal','request','CreateMemberReport','then','catch','startsWith','devicestatechange','device','voice','TALKING','now','agent','NOT_INUSE','exitAt','duration','enterAt','agentcomplete','isNil','assign','queue','cdr','split','data1','source','data3','destination','lodash','./utils','info','format','uniqueid','interface','channel','data2','type','getUserByInterface','membername','name'];(function(_0x5cb27c,_0x2752ff){var _0x5938fa=function(_0x2684de){while(--_0x2684de){_0x5cb27c['push'](_0x5cb27c['shift']());}};_0x5938fa(++_0x2752ff);}(_0x3566,0x14a));var _0x6356=function(_0x38a5d8,_0x120421){_0x38a5d8=_0x38a5d8-0x0;var _0x29a5e1=_0x3566[_0x38a5d8];return _0x29a5e1;};'use strict';var _=require(_0x6356('0x0'));var util=require('util');var utils=require(_0x6356('0x1'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x1ef14e){utils[_0x6356('0x2')](util[_0x6356('0x3')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x1ef14e[_0x6356('0x4')],_0x1ef14e[_0x6356('0x5')],_0x1ef14e[_0x6356('0x6')],_0x1ef14e[_0x6356('0x7')],_0x1ef14e['membername'],_0x1ef14e[_0x6356('0x8')]));if(_0x1ef14e['interface']){utils[_0x6356('0x9')](_0x1ef14e[_0x6356('0x5')])['then'](function(_0x4ef895){if(_0x4ef895){_0x1ef14e[_0x6356('0xa')]=_0x4ef895[_0x6356('0xb')];_0x1ef14e['internal']=_0x4ef895[_0x6356('0xc')];utils[_0x6356('0xd')](_0x6356('0xe'),_0x1ef14e);}else{utils['getUserByName'](_0x1ef14e[_0x6356('0x5')]['split']('/')[0x1])[_0x6356('0xf')](function(_0x32cf87){if(_0x32cf87){_0x1ef14e[_0x6356('0xa')]=_0x32cf87[_0x6356('0xb')];_0x1ef14e[_0x6356('0xc')]=_0x32cf87[_0x6356('0xc')];utils[_0x6356('0xd')](_0x6356('0xe'),_0x1ef14e);}});}})[_0x6356('0x10')](function(_0x2bad80){utils['error'](_0x2bad80);});}delete members[_0x1ef14e[_0x6356('0x5')]];}function startsWith(_0x103af2,_0x3317ec){return _['some'](_0x103af2,function(_0x4628f9){return _[_0x6356('0x11')](_0x3317ec,_0x4628f9);});}exports[_0x6356('0x12')]=function(_0x3efdeb){switch(_0x3efdeb['state']){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x3efdeb[_0x6356('0x13')])){members[_0x3efdeb[_0x6356('0x13')]]={'channel':_0x6356('0x14'),'interface':_0x3efdeb[_0x6356('0x13')],'type':_0x6356('0x15'),'enterAt':utils[_0x6356('0x16')](),'role':_0x6356('0x17')};}break;case _0x6356('0x18'):if(!_['isNil'](members[_0x3efdeb[_0x6356('0x13')]])){members[_0x3efdeb[_0x6356('0x13')]][_0x6356('0x19')]=utils[_0x6356('0x16')]();members[_0x3efdeb['device']][_0x6356('0x1a')]=utils['diffTime'](members[_0x3efdeb[_0x6356('0x13')]]['exitAt'],members[_0x3efdeb[_0x6356('0x13')]][_0x6356('0x1b')]);if(members[_0x3efdeb[_0x6356('0x13')]][_0x6356('0x4')]){writeDB(members[_0x3efdeb['device']]);}}default:break;}};exports[_0x6356('0x1c')]=function(_0x2c71b4){if(!_[_0x6356('0x1d')](members[_0x2c71b4[_0x6356('0x5')]])){members[_0x2c71b4[_0x6356('0x5')]]=_[_0x6356('0x1e')](members[_0x2c71b4[_0x6356('0x5')]],{'data4':_0x2c71b4[_0x6356('0x1f')]});}};exports[_0x6356('0x20')]=function(_0x23d8c4){if(_0x23d8c4[_0x6356('0x6')]){var _0x5e084b=_0x23d8c4[_0x6356('0x6')][_0x6356('0x21')]('-')[0x0];if(!_[_0x6356('0x1d')](members[_0x5e084b])){members[_0x5e084b]=_[_0x6356('0x1e')](members[_0x5e084b],{'data1':members[_0x5e084b][_0x6356('0x22')]||_0x23d8c4[_0x6356('0x8')],'data2':members[_0x5e084b]['data2']||_0x23d8c4[_0x6356('0x23')],'data3':members[_0x5e084b][_0x6356('0x24')]||_0x23d8c4[_0x6356('0x25')],'uniqueid':members[_0x5e084b][_0x6356('0x4')]||_0x23d8c4[_0x6356('0x4')]});if(members[_0x5e084b][_0x6356('0x19')]){writeDB(members[_0x5e084b]);}}}if(_0x23d8c4['destinationchannel']){var _0x316cdc=_0x23d8c4['destinationchannel'][_0x6356('0x21')]('-')[0x0];if(!_[_0x6356('0x1d')](members[_0x316cdc])){members[_0x316cdc]=_[_0x6356('0x1e')](members[_0x316cdc],{'data1':members[_0x316cdc][_0x6356('0x22')]||_0x23d8c4['type'],'data2':members[_0x316cdc][_0x6356('0x7')]||_0x23d8c4[_0x6356('0x23')],'data3':members[_0x316cdc]['data3']||_0x23d8c4[_0x6356('0x25')],'uniqueid':members[_0x316cdc][_0x6356('0x4')]||_0x23d8c4['uniqueid']});if(members[_0x316cdc][_0x6356('0x19')]){writeDB(members[_0x316cdc]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 2b95df8..03f5dca 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 _0x0c4d=['./utils','info','format','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','queuecallerjoin','isNil','clone','position','varset','queuestatus','value','assign','now','toUpperCase','queuecallerabandon','ABANDONED','diffTime','queuecallerjoinAt','agentconnect','connectedlinenum','connectedlinename','agentcomplete','transfer','COMPLETEDBY','reason','blindtransfer','transfereechannel','BLIND','extension','transfereeuniqueid','BLINDTRANSFER','attendedtransfer','origtransfererchannel','transfertargetchannel','transfertargetcalleridnum','ATTENDEDTRANSFER','origtransfererexten','origtransfereruniqueid','ATTENDED','secondtransfererchannel','transfereecalleridname','secondtransfereruniqueid','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','assigned','lodash'];(function(_0x2e20d9,_0x1bb821){var _0x4803d9=function(_0xfc6442){while(--_0xfc6442){_0x2e20d9['push'](_0x2e20d9['shift']());}};_0x4803d9(++_0x1bb821);}(_0x0c4d,0x1d7));var _0xd0c4=function(_0x280d30,_0x448a0f){_0x280d30=_0x280d30-0x0;var _0x26b07=_0x0c4d[_0x280d30];return _0x26b07;};'use strict';var _=require(_0xd0c4('0x0'));var util=require('util');var utils=require(_0xd0c4('0x1'));var queues={};var transfers={};function writeDB(_0x3ae537,_0x21b4ca){utils[_0xd0c4('0x2')](util[_0xd0c4('0x3')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x3ae537[_0xd0c4('0x4')],_0x3ae537[_0xd0c4('0x5')],_0x3ae537[_0xd0c4('0x6')],_0x3ae537[_0xd0c4('0x7')],_0x3ae537[_0xd0c4('0x8')],_0x3ae537[_0xd0c4('0x9')],_0x3ae537[_0xd0c4('0xa')]));if(_0x3ae537[_0xd0c4('0x6')]){utils[_0xd0c4('0xb')](_0x3ae537[_0xd0c4('0x6')])[_0xd0c4('0xc')](function(_0x2aa772){if(_0x2aa772){_0x3ae537['type']=_0x2aa772[_0xd0c4('0xd')];}utils[_0xd0c4('0xe')](_0xd0c4('0xf'),_0x3ae537);});}else{utils[_0xd0c4('0xe')](_0xd0c4('0xf'),_0x3ae537);}if(_0x21b4ca){delete queues[_0x3ae537[_0xd0c4('0x5')]];}}exports[_0xd0c4('0x10')]=function(_0x467ec9){if(!_[_0xd0c4('0x11')](queues[_0x467ec9[_0xd0c4('0x5')]])){writeDB(_[_0xd0c4('0x12')](queues[_0x467ec9[_0xd0c4('0x5')]]),![]);}queues[_0x467ec9['channel']]=_['assign'](_0x467ec9,{'originalposition':_0x467ec9[_0xd0c4('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0xd0c4('0x14')]=function(_0x3cc2b3){if(!_['isNil'](queues[_0x3cc2b3[_0xd0c4('0x5')]])){if(!_['isNil'](_0x3cc2b3['variable'][_0xd0c4('0x15')])){if(_0x3cc2b3[_0xd0c4('0x16')]!='CONTINUE'){queues[_0x3cc2b3[_0xd0c4('0x5')]]=_[_0xd0c4('0x17')](queues[_0x3cc2b3[_0xd0c4('0x5')]],{'queuecallerabandon':![],'queuecallerabandonAt':null,'queuecallerexit':!![],'queuecallerexitAt':utils[_0xd0c4('0x18')](),'queuecallerexitreason':_0x3cc2b3[_0xd0c4('0x16')][_0xd0c4('0x19')]()});}}}};exports[_0xd0c4('0x1a')]=function(_0x91ebba){var _0x427a46={'queuecallerabandon':!![],'queuecallerabandonAt':utils[_0xd0c4('0x18')](),'queuecallerexitreason':_0xd0c4('0x1b')};if(!_[_0xd0c4('0x11')](queues[_0x91ebba[_0xd0c4('0x5')]])){queues[_0x91ebba['channel']]=_[_0xd0c4('0x17')](queues[_0x91ebba[_0xd0c4('0x5')]],_0x427a46);}if(!_['isNil'](transfers[_0x91ebba[_0xd0c4('0x5')]])){transfers[_0x91ebba['channel']]=_[_0xd0c4('0x17')](transfers[_0x91ebba[_0xd0c4('0x5')]],_0x427a46);}};exports['queuecallerleave']=function(_0x2eba31){if(!_[_0xd0c4('0x11')](queues[_0x2eba31[_0xd0c4('0x5')]])){queues[_0x2eba31[_0xd0c4('0x5')]]=_[_0xd0c4('0x17')](queues[_0x2eba31['channel']],{'queuecallerleave':!![],'queuecallerleaveAt':utils[_0xd0c4('0x18')](),'holdtime':utils[_0xd0c4('0x1c')](utils[_0xd0c4('0x18')](),queues[_0x2eba31[_0xd0c4('0x5')]][_0xd0c4('0x1d')])});}if(!_['isNil'](transfers[_0x2eba31['channel']])){transfers[_0x2eba31[_0xd0c4('0x5')]]=_[_0xd0c4('0x17')](transfers[_0x2eba31[_0xd0c4('0x5')]],{'queuecallerleave':!![],'queuecallerleaveAt':utils[_0xd0c4('0x18')](),'holdtime':utils[_0xd0c4('0x1c')](utils[_0xd0c4('0x18')](),transfers[_0x2eba31['channel']][_0xd0c4('0x1d')])});}};exports[_0xd0c4('0x1e')]=function(_0x404c98){var _0x243dd4={'connectedlinenum':_0x404c98[_0xd0c4('0x1f')],'connectedlinename':_0x404c98[_0xd0c4('0x20')],'assigned':!![],'lastAssignedTo':_0x404c98['membername']};if(!_['isNil'](queues[_0x404c98['channel']])){queues[_0x404c98[_0xd0c4('0x5')]]=_[_0xd0c4('0x17')](queues[_0x404c98['channel']],_0x243dd4);}if(!_[_0xd0c4('0x11')](transfers[_0x404c98[_0xd0c4('0x5')]])){transfers[_0x404c98[_0xd0c4('0x5')]]=_[_0xd0c4('0x17')](transfers[_0x404c98[_0xd0c4('0x5')]],_0x243dd4);}};exports[_0xd0c4('0x21')]=function(_0x3eda4){var _0x4024a6={'queuecallercomplete':!![],'queuecallercompleteAt':utils['now']()};if(_0x3eda4['reason']!=_0xd0c4('0x22')){_0x4024a6['queuecallerexitreason']=_0xd0c4('0x23')+_0x3eda4[_0xd0c4('0x24')][_0xd0c4('0x19')]();}if(!_[_0xd0c4('0x11')](queues[_0x3eda4[_0xd0c4('0x5')]])){queues[_0x3eda4[_0xd0c4('0x5')]]=_[_0xd0c4('0x17')](queues[_0x3eda4[_0xd0c4('0x5')]],_0x4024a6);writeDB(queues[_0x3eda4[_0xd0c4('0x5')]],!![]);}};exports[_0xd0c4('0x25')]=function(_0x404788){if(!_[_0xd0c4('0x11')](queues[_0x404788[_0xd0c4('0x26')]])){queues[_0x404788['transfereechannel']]=_['assign'](queues[_0x404788[_0xd0c4('0x26')]],{'transfer':!![],'transfertype':_0xd0c4('0x27'),'transferexten':_0x404788[_0xd0c4('0x28')],'transferuniqueid':_0x404788[_0xd0c4('0x29')],'queuecallerexitreason':_0xd0c4('0x2a')});}};exports[_0xd0c4('0x2b')]=function(_0x20a438){_['forIn'](queues,function(_0x5b74bc){if(_0x5b74bc[_0xd0c4('0x5')]==_0x20a438[_0xd0c4('0x2c')]){transfers[_0x20a438['transfertargetchannel']]=_[_0xd0c4('0x12')](_0x5b74bc);transfers[_0x20a438[_0xd0c4('0x2d')]]=_[_0xd0c4('0x17')](transfers[_0x20a438[_0xd0c4('0x2d')]],{'queuecallerjoinAt':utils[_0xd0c4('0x18')](),'queuecallerleaveAt':utils['now'](),'channel':_0x20a438[_0xd0c4('0x2d')],'calleridname':_0x20a438['transfertargetcalleridname'],'calleridnum':_0x20a438[_0xd0c4('0x2e')],'queuecallerenterreason':0x2});queues[_0x20a438[_0xd0c4('0x2d')]]=_[_0xd0c4('0x17')](queues[_0x20a438['transfertargetchannel']],{'transfer':!![],'transfertype':'ATTENDED','queuecallerexitreason':_0xd0c4('0x2f'),'transferexten':_0x20a438[_0xd0c4('0x30')],'transferuniqueid':_0x20a438[_0xd0c4('0x31')]});queues[_0x20a438[_0xd0c4('0x2c')]]=_[_0xd0c4('0x17')](queues[_0x20a438['origtransfererchannel']],{'queuecallerexitreason':_0xd0c4('0x32'),'queuecallerenterreason':0x1});}else if(_0x5b74bc[_0xd0c4('0x5')]==_0x20a438[_0xd0c4('0x33')]){transfers[_0x20a438[_0xd0c4('0x26')]]=_[_0xd0c4('0x12')](_0x5b74bc);transfers[_0x20a438[_0xd0c4('0x26')]]=_[_0xd0c4('0x17')](transfers[_0x20a438[_0xd0c4('0x26')]],{'queuecallerjoinAt':utils[_0xd0c4('0x18')](),'queuecallerleaveAt':utils[_0xd0c4('0x18')](),'channel':_0x20a438[_0xd0c4('0x26')],'calleridname':_0x20a438[_0xd0c4('0x34')],'calleridnum':_0x20a438['transfereecalleridnum'],'queuecallerenterreason':0x2});queues[_0x20a438[_0xd0c4('0x26')]]=_[_0xd0c4('0x17')](queues[_0x20a438[_0xd0c4('0x26')]],{'transfer':!![],'transfertype':_0xd0c4('0x32'),'queuecallerexitreason':_0xd0c4('0x2f'),'transferexten':_0x20a438['secondtransfererexten'],'transferuniqueid':_0x20a438[_0xd0c4('0x35')]});queues[_0x20a438['secondtransfererchannel']]=_[_0xd0c4('0x17')](queues[_0x20a438[_0xd0c4('0x33')]],{'queuecallerexitreason':_0xd0c4('0x32'),'queuecallerenterreason':0x1});}});};exports[_0xd0c4('0x36')]=function(_0x342d59){if(!_[_0xd0c4('0x11')](queues[_0x342d59[_0xd0c4('0x5')]])){queues[_0x342d59[_0xd0c4('0x5')]][_0xd0c4('0x37')]=utils[_0xd0c4('0x18')]();}};exports[_0xd0c4('0x38')]=function(_0x4a3267){if(!_[_0xd0c4('0x11')](queues[_0x4a3267[_0xd0c4('0x5')]])){if(!_['isNil'](queues[_0x4a3267['channel']]['musiconholdstartAt'])){queues[_0x4a3267[_0xd0c4('0x5')]][_0xd0c4('0x39')]+=utils[_0xd0c4('0x1c')](utils['now'](),queues[_0x4a3267[_0xd0c4('0x5')]][_0xd0c4('0x37')]);delete queues[_0x4a3267['channel']][_0xd0c4('0x37')];}}};exports['cdr']=function(_0x32b7c4){if(!_[_0xd0c4('0x11')](queues[_0x32b7c4['channel']])){writeDB(queues[_0x32b7c4[_0xd0c4('0x5')]],!![]);}if(!_[_0xd0c4('0x11')](transfers[_0x32b7c4[_0xd0c4('0x5')]])){if(transfers[_0x32b7c4[_0xd0c4('0x5')]][_0xd0c4('0x3a')]){transfers[_0x32b7c4[_0xd0c4('0x5')]]=_[_0xd0c4('0x17')](transfers[_0x32b7c4[_0xd0c4('0x5')]],{'queuecallercomplete':!![],'queuecallercompleteAt':utils[_0xd0c4('0x18')](),'queuecallerexitreason':'COMPLETED'});}writeDB(transfers[_0x32b7c4[_0xd0c4('0x5')]],![]);delete transfers[_0x32b7c4[_0xd0c4('0x5')]];}}; \ No newline at end of file +var _0x4681=['uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','queuecallerjoin','isNil','clone','assign','position','now','queuestatus','value','toUpperCase','queuecallerabandon','ABANDONED','queuecallerleave','diffTime','queuecallerjoinAt','agentconnect','connectedlinenum','connectedlinename','agentcomplete','transfer','blindtransfer','transfereechannel','BLIND','extension','transfereeuniqueid','BLINDTRANSFER','forIn','origtransfererchannel','transfertargetchannel','transfertargetcalleridname','ATTENDED','ATTENDEDTRANSFER','origtransfererexten','origtransfereruniqueid','secondtransfererchannel','transfereecalleridname','transfereecalleridnum','secondtransfererexten','secondtransfereruniqueid','musiconholdstartAt','mohtime','cdr','assigned','util','./utils','info'];(function(_0x33ba78,_0xbcaa2d){var _0x24a8a8=function(_0x2c25f5){while(--_0x2c25f5){_0x33ba78['push'](_0x33ba78['shift']());}};_0x24a8a8(++_0xbcaa2d);}(_0x4681,0x185));var _0x1468=function(_0x412dfe,_0x5228de){_0x412dfe=_0x412dfe-0x0;var _0x43c8de=_0x4681[_0x412dfe];return _0x43c8de;};'use strict';var _=require('lodash');var util=require(_0x1468('0x0'));var utils=require(_0x1468('0x1'));var queues={};var transfers={};function writeDB(_0x5ef737,_0x667ed3){utils[_0x1468('0x2')](util['format']('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x5ef737[_0x1468('0x3')],_0x5ef737[_0x1468('0x4')],_0x5ef737[_0x1468('0x5')],_0x5ef737[_0x1468('0x6')],_0x5ef737[_0x1468('0x7')],_0x5ef737[_0x1468('0x8')],_0x5ef737[_0x1468('0x9')]));if(_0x5ef737['queue']){utils['getVoiceQueueByName'](_0x5ef737[_0x1468('0x5')])[_0x1468('0xa')](function(_0x20d414){if(_0x20d414){_0x5ef737[_0x1468('0xb')]=_0x20d414[_0x1468('0xb')];}utils[_0x1468('0xc')](_0x1468('0xd'),_0x5ef737);});}else{utils[_0x1468('0xc')](_0x1468('0xd'),_0x5ef737);}if(_0x667ed3){delete queues[_0x5ef737[_0x1468('0x4')]];}}exports[_0x1468('0xe')]=function(_0x19314d){if(!_[_0x1468('0xf')](queues[_0x19314d[_0x1468('0x4')]])){writeDB(_[_0x1468('0x10')](queues[_0x19314d[_0x1468('0x4')]]),![]);}queues[_0x19314d['channel']]=_[_0x1468('0x11')](_0x19314d,{'originalposition':_0x19314d[_0x1468('0x12')],'queuecallerjoinAt':utils[_0x1468('0x13')](),'mohtime':0x0});};exports['varset']=function(_0x2c7b92){if(!_[_0x1468('0xf')](queues[_0x2c7b92['channel']])){if(!_[_0x1468('0xf')](_0x2c7b92['variable'][_0x1468('0x14')])){if(_0x2c7b92[_0x1468('0x15')]!='CONTINUE'){queues[_0x2c7b92[_0x1468('0x4')]]=_[_0x1468('0x11')](queues[_0x2c7b92['channel']],{'queuecallerabandon':![],'queuecallerabandonAt':null,'queuecallerexit':!![],'queuecallerexitAt':utils[_0x1468('0x13')](),'queuecallerexitreason':_0x2c7b92[_0x1468('0x15')][_0x1468('0x16')]()});}}}};exports[_0x1468('0x17')]=function(_0x3e8c0e){var _0x5b06b1={'queuecallerabandon':!![],'queuecallerabandonAt':utils['now'](),'queuecallerexitreason':_0x1468('0x18')};if(!_[_0x1468('0xf')](queues[_0x3e8c0e[_0x1468('0x4')]])){queues[_0x3e8c0e[_0x1468('0x4')]]=_[_0x1468('0x11')](queues[_0x3e8c0e[_0x1468('0x4')]],_0x5b06b1);}if(!_[_0x1468('0xf')](transfers[_0x3e8c0e[_0x1468('0x4')]])){transfers[_0x3e8c0e['channel']]=_['assign'](transfers[_0x3e8c0e[_0x1468('0x4')]],_0x5b06b1);}};exports[_0x1468('0x19')]=function(_0x25d2f0){if(!_['isNil'](queues[_0x25d2f0[_0x1468('0x4')]])){queues[_0x25d2f0['channel']]=_[_0x1468('0x11')](queues[_0x25d2f0['channel']],{'queuecallerleave':!![],'queuecallerleaveAt':utils[_0x1468('0x13')](),'holdtime':utils[_0x1468('0x1a')](utils[_0x1468('0x13')](),queues[_0x25d2f0[_0x1468('0x4')]][_0x1468('0x1b')])});}if(!_['isNil'](transfers[_0x25d2f0[_0x1468('0x4')]])){transfers[_0x25d2f0['channel']]=_[_0x1468('0x11')](transfers[_0x25d2f0[_0x1468('0x4')]],{'queuecallerleave':!![],'queuecallerleaveAt':utils[_0x1468('0x13')](),'holdtime':utils['diffTime'](utils[_0x1468('0x13')](),transfers[_0x25d2f0[_0x1468('0x4')]][_0x1468('0x1b')])});}};exports[_0x1468('0x1c')]=function(_0x3f8775){var _0x16a5d2={'connectedlinenum':_0x3f8775[_0x1468('0x1d')],'connectedlinename':_0x3f8775[_0x1468('0x1e')],'assigned':!![],'lastAssignedTo':_0x3f8775['membername']};if(!_[_0x1468('0xf')](queues[_0x3f8775[_0x1468('0x4')]])){queues[_0x3f8775[_0x1468('0x4')]]=_[_0x1468('0x11')](queues[_0x3f8775[_0x1468('0x4')]],_0x16a5d2);}if(!_['isNil'](transfers[_0x3f8775[_0x1468('0x4')]])){transfers[_0x3f8775[_0x1468('0x4')]]=_['assign'](transfers[_0x3f8775[_0x1468('0x4')]],_0x16a5d2);}};exports[_0x1468('0x1f')]=function(_0x26bae1){var _0xa05980={'queuecallercomplete':!![],'queuecallercompleteAt':utils['now']()};if(_0x26bae1['reason']!=_0x1468('0x20')){_0xa05980[_0x1468('0x9')]='COMPLETEDBY'+_0x26bae1['reason'][_0x1468('0x16')]();}if(!_['isNil'](queues[_0x26bae1[_0x1468('0x4')]])){queues[_0x26bae1[_0x1468('0x4')]]=_['assign'](queues[_0x26bae1['channel']],_0xa05980);writeDB(queues[_0x26bae1['channel']],!![]);}};exports[_0x1468('0x21')]=function(_0x488e9f){if(!_[_0x1468('0xf')](queues[_0x488e9f[_0x1468('0x22')]])){queues[_0x488e9f[_0x1468('0x22')]]=_[_0x1468('0x11')](queues[_0x488e9f['transfereechannel']],{'transfer':!![],'transfertype':_0x1468('0x23'),'transferexten':_0x488e9f[_0x1468('0x24')],'transferuniqueid':_0x488e9f[_0x1468('0x25')],'queuecallerexitreason':_0x1468('0x26')});}};exports['attendedtransfer']=function(_0x79ef38){_[_0x1468('0x27')](queues,function(_0x3770ab){if(_0x3770ab[_0x1468('0x4')]==_0x79ef38[_0x1468('0x28')]){transfers[_0x79ef38[_0x1468('0x29')]]=_[_0x1468('0x10')](_0x3770ab);transfers[_0x79ef38[_0x1468('0x29')]]=_['assign'](transfers[_0x79ef38[_0x1468('0x29')]],{'queuecallerjoinAt':utils[_0x1468('0x13')](),'queuecallerleaveAt':utils[_0x1468('0x13')](),'channel':_0x79ef38[_0x1468('0x29')],'calleridname':_0x79ef38[_0x1468('0x2a')],'calleridnum':_0x79ef38['transfertargetcalleridnum'],'queuecallerenterreason':0x2});queues[_0x79ef38[_0x1468('0x29')]]=_[_0x1468('0x11')](queues[_0x79ef38[_0x1468('0x29')]],{'transfer':!![],'transfertype':_0x1468('0x2b'),'queuecallerexitreason':_0x1468('0x2c'),'transferexten':_0x79ef38[_0x1468('0x2d')],'transferuniqueid':_0x79ef38[_0x1468('0x2e')]});queues[_0x79ef38[_0x1468('0x28')]]=_['assign'](queues[_0x79ef38[_0x1468('0x28')]],{'queuecallerexitreason':_0x1468('0x2b'),'queuecallerenterreason':0x1});}else if(_0x3770ab['channel']==_0x79ef38[_0x1468('0x2f')]){transfers[_0x79ef38[_0x1468('0x22')]]=_['clone'](_0x3770ab);transfers[_0x79ef38[_0x1468('0x22')]]=_[_0x1468('0x11')](transfers[_0x79ef38[_0x1468('0x22')]],{'queuecallerjoinAt':utils['now'](),'queuecallerleaveAt':utils['now'](),'channel':_0x79ef38[_0x1468('0x22')],'calleridname':_0x79ef38[_0x1468('0x30')],'calleridnum':_0x79ef38[_0x1468('0x31')],'queuecallerenterreason':0x2});queues[_0x79ef38['transfereechannel']]=_[_0x1468('0x11')](queues[_0x79ef38[_0x1468('0x22')]],{'transfer':!![],'transfertype':_0x1468('0x2b'),'queuecallerexitreason':_0x1468('0x2c'),'transferexten':_0x79ef38[_0x1468('0x32')],'transferuniqueid':_0x79ef38[_0x1468('0x33')]});queues[_0x79ef38[_0x1468('0x2f')]]=_[_0x1468('0x11')](queues[_0x79ef38[_0x1468('0x2f')]],{'queuecallerexitreason':_0x1468('0x2b'),'queuecallerenterreason':0x1});}});};exports['musiconholdstart']=function(_0x3a0d40){if(!_[_0x1468('0xf')](queues[_0x3a0d40[_0x1468('0x4')]])){queues[_0x3a0d40['channel']][_0x1468('0x34')]=utils[_0x1468('0x13')]();}};exports['musiconholdstop']=function(_0x1313e4){if(!_[_0x1468('0xf')](queues[_0x1313e4['channel']])){if(!_['isNil'](queues[_0x1313e4['channel']][_0x1468('0x34')])){queues[_0x1313e4[_0x1468('0x4')]][_0x1468('0x35')]+=utils['diffTime'](utils[_0x1468('0x13')](),queues[_0x1313e4[_0x1468('0x4')]][_0x1468('0x34')]);delete queues[_0x1313e4['channel']][_0x1468('0x34')];}}};exports[_0x1468('0x36')]=function(_0x1ea6d5){if(!_[_0x1468('0xf')](queues[_0x1ea6d5['channel']])){writeDB(queues[_0x1ea6d5[_0x1468('0x4')]],!![]);}if(!_[_0x1468('0xf')](transfers[_0x1ea6d5[_0x1468('0x4')]])){if(transfers[_0x1ea6d5['channel']][_0x1468('0x37')]){transfers[_0x1ea6d5['channel']]=_[_0x1468('0x11')](transfers[_0x1ea6d5[_0x1468('0x4')]],{'queuecallercomplete':!![],'queuecallercompleteAt':utils['now'](),'queuecallerexitreason':'COMPLETED'});}writeDB(transfers[_0x1ea6d5[_0x1468('0x4')]],![]);delete transfers[_0x1ea6d5[_0x1468('0x4')]];}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 8dc8d73..787de67 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 _0x928c=['varset','isNil','variable','mixmonitor_filename','.wav49','value','.WAV','assign','agentconnect','connectedlinenum','cdr','type','destinationchannel','dialer','lastdata','destination','uniqueid','calleridnum','calleridname','debug','getUserByInternal','accountcode','then','membername','UserId','request','CreateVoiceRecording','channel'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x928c,0x17f));var _0xc928=function(_0x239af8,_0x42838c){_0x239af8=_0x239af8-0x0;var _0x5b2eed=_0x928c[_0x239af8];return _0x5b2eed;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x261249){utils[_0xc928('0x0')](_0x261249);if(_0x261249['accountcode']){utils[_0xc928('0x1')](_0x261249[_0xc928('0x2')])[_0xc928('0x3')](function(_0x3e4e60){if(_0x3e4e60){_0x261249[_0xc928('0x4')]=_0x3e4e60['name'];_0x261249[_0xc928('0x5')]=_0x3e4e60['id'];}utils[_0xc928('0x6')](_0xc928('0x7'),_0x261249);});}else{utils['request']('CreateVoiceRecording',_0x261249);}if(recordings[_0x261249['channel']]){delete recordings[_0x261249[_0xc928('0x8')]];}}exports[_0xc928('0x9')]=function(_0x6b7b61){if(!_[_0xc928('0xa')](_0x6b7b61[_0xc928('0xb')])&&!_[_0xc928('0xa')](_0x6b7b61[_0xc928('0xb')][_0xc928('0xc')])){if(!_['isNil'](recordings[_0x6b7b61[_0xc928('0x8')]])){writeDB(recordings[_0x6b7b61[_0xc928('0x8')]]);}if(_['endsWith'](_0x6b7b61['value'],_0xc928('0xd'))){_0x6b7b61['value']=_0x6b7b61[_0xc928('0xe')]['replace'](_0xc928('0xd'),_0xc928('0xf'));}recordings[_0x6b7b61['channel']]=_[_0xc928('0x10')](_0x6b7b61,{});}};exports[_0xc928('0x11')]=function(_0x5591a1){if(!_[_0xc928('0xa')](recordings[_0x5591a1[_0xc928('0x8')]])){recordings[_0x5591a1[_0xc928('0x8')]]=_[_0xc928('0x10')](recordings[_0x5591a1[_0xc928('0x8')]],{'membername':_0x5591a1[_0xc928('0x4')],'queue':_0x5591a1['queue'],'accountcode':_0x5591a1[_0xc928('0x12')]});}};exports[_0xc928('0x13')]=function(_0x301ef9){if(!_[_0xc928('0xa')](recordings[_0x301ef9[_0xc928('0x8')]])){recordings[_0x301ef9[_0xc928('0x8')]]=_[_0xc928('0x10')](recordings[_0x301ef9[_0xc928('0x8')]],{'type':_0x301ef9[_0xc928('0x14')]});writeDB(recordings[_0x301ef9[_0xc928('0x8')]]);}else if(!_[_0xc928('0xa')](recordings[_0x301ef9[_0xc928('0x15')]])){recordings[_0x301ef9['channel']]=recordings[_0x301ef9[_0xc928('0x15')]];delete recordings[_0x301ef9[_0xc928('0x15')]];if(_0x301ef9[_0xc928('0x14')]==_0xc928('0x16')){recordings[_0x301ef9['channel']]=_[_0xc928('0x10')](recordings[_0x301ef9[_0xc928('0x8')]],{'type':_0x301ef9[_0xc928('0x14')],'uniqueid':_0x301ef9['uniqueid'],'context':_0x301ef9['destinationcontext'],'queue':_0x301ef9[_0xc928('0x17')],'connectedlinenum':_0x301ef9[_0xc928('0x2')],'connectedlinename':'','calleridnum':_0x301ef9[_0xc928('0x18')],'exten':recordings[_0x301ef9[_0xc928('0x8')]]['calleridnum']});}else{recordings[_0x301ef9['channel']]=_[_0xc928('0x10')](recordings[_0x301ef9[_0xc928('0x8')]],{'type':_0x301ef9[_0xc928('0x14')],'channel':_0x301ef9[_0xc928('0x8')],'exten':_0x301ef9[_0xc928('0x18')],'context':_0x301ef9['destinationcontext'],'uniqueid':_0x301ef9[_0xc928('0x19')],'calleridnum':recordings[_0x301ef9[_0xc928('0x8')]][_0xc928('0x12')],'calleridname':recordings[_0x301ef9['channel']]['connectedlinename'],'connectedlinenum':recordings[_0x301ef9[_0xc928('0x8')]][_0xc928('0x1a')],'connectedlinename':recordings[_0x301ef9['channel']][_0xc928('0x1b')]});}writeDB(recordings[_0x301ef9[_0xc928('0x8')]]);}}; \ No newline at end of file +var _0x8f37=['value','.WAV','assign','agentconnect','queue','connectedlinenum','cdr','type','destinationchannel','dialer','destinationcontext','lastdata','destination','calleridnum','connectedlinename','calleridname','lodash','./utils','getUserByInternal','accountcode','then','membername','UserId','CreateVoiceRecording','request','channel','varset','variable','isNil','mixmonitor_filename','endsWith','.wav49'];(function(_0x28e1a0,_0x463ab4){var _0x4a759f=function(_0x26e7e8){while(--_0x26e7e8){_0x28e1a0['push'](_0x28e1a0['shift']());}};_0x4a759f(++_0x463ab4);}(_0x8f37,0x190));var _0x78f3=function(_0x1a8f78,_0x53f7d5){_0x1a8f78=_0x1a8f78-0x0;var _0x12a821=_0x8f37[_0x1a8f78];return _0x12a821;};'use strict';var _=require(_0x78f3('0x0'));var utils=require(_0x78f3('0x1'));var recordings={};function writeDB(_0x351c4f){utils['debug'](_0x351c4f);if(_0x351c4f['accountcode']){utils[_0x78f3('0x2')](_0x351c4f[_0x78f3('0x3')])[_0x78f3('0x4')](function(_0x539794){if(_0x539794){_0x351c4f[_0x78f3('0x5')]=_0x539794['name'];_0x351c4f[_0x78f3('0x6')]=_0x539794['id'];}utils['request'](_0x78f3('0x7'),_0x351c4f);});}else{utils[_0x78f3('0x8')]('CreateVoiceRecording',_0x351c4f);}if(recordings[_0x351c4f[_0x78f3('0x9')]]){delete recordings[_0x351c4f['channel']];}}exports[_0x78f3('0xa')]=function(_0x423223){if(!_['isNil'](_0x423223[_0x78f3('0xb')])&&!_[_0x78f3('0xc')](_0x423223[_0x78f3('0xb')][_0x78f3('0xd')])){if(!_[_0x78f3('0xc')](recordings[_0x423223['channel']])){writeDB(recordings[_0x423223[_0x78f3('0x9')]]);}if(_[_0x78f3('0xe')](_0x423223['value'],_0x78f3('0xf'))){_0x423223[_0x78f3('0x10')]=_0x423223[_0x78f3('0x10')]['replace'](_0x78f3('0xf'),_0x78f3('0x11'));}recordings[_0x423223[_0x78f3('0x9')]]=_[_0x78f3('0x12')](_0x423223,{});}};exports[_0x78f3('0x13')]=function(_0x1858f1){if(!_[_0x78f3('0xc')](recordings[_0x1858f1[_0x78f3('0x9')]])){recordings[_0x1858f1[_0x78f3('0x9')]]=_[_0x78f3('0x12')](recordings[_0x1858f1[_0x78f3('0x9')]],{'membername':_0x1858f1[_0x78f3('0x5')],'queue':_0x1858f1[_0x78f3('0x14')],'accountcode':_0x1858f1[_0x78f3('0x15')]});}};exports[_0x78f3('0x16')]=function(_0x422855){if(!_[_0x78f3('0xc')](recordings[_0x422855[_0x78f3('0x9')]])){recordings[_0x422855[_0x78f3('0x9')]]=_[_0x78f3('0x12')](recordings[_0x422855[_0x78f3('0x9')]],{'type':_0x422855[_0x78f3('0x17')]});writeDB(recordings[_0x422855[_0x78f3('0x9')]]);}else if(!_['isNil'](recordings[_0x422855[_0x78f3('0x18')]])){recordings[_0x422855[_0x78f3('0x9')]]=recordings[_0x422855['destinationchannel']];delete recordings[_0x422855['destinationchannel']];if(_0x422855['type']==_0x78f3('0x19')){recordings[_0x422855[_0x78f3('0x9')]]=_[_0x78f3('0x12')](recordings[_0x422855[_0x78f3('0x9')]],{'type':_0x422855[_0x78f3('0x17')],'uniqueid':_0x422855['uniqueid'],'context':_0x422855[_0x78f3('0x1a')],'queue':_0x422855[_0x78f3('0x1b')],'connectedlinenum':_0x422855[_0x78f3('0x3')],'connectedlinename':'','calleridnum':_0x422855[_0x78f3('0x1c')],'exten':recordings[_0x422855[_0x78f3('0x9')]][_0x78f3('0x1d')]});}else{recordings[_0x422855[_0x78f3('0x9')]]=_[_0x78f3('0x12')](recordings[_0x422855[_0x78f3('0x9')]],{'type':_0x422855[_0x78f3('0x17')],'channel':_0x422855['channel'],'exten':_0x422855[_0x78f3('0x1c')],'context':_0x422855[_0x78f3('0x1a')],'uniqueid':_0x422855['uniqueid'],'calleridnum':recordings[_0x422855[_0x78f3('0x9')]][_0x78f3('0x15')],'calleridname':recordings[_0x422855[_0x78f3('0x9')]][_0x78f3('0x1e')],'connectedlinenum':recordings[_0x422855[_0x78f3('0x9')]]['calleridnum'],'connectedlinename':recordings[_0x422855[_0x78f3('0x9')]][_0x78f3('0x1f')]});}writeDB(recordings[_0x422855[_0x78f3('0x9')]]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 72af762..810ef06 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 _0x662b=['origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','TRANSFER|%s','type','request','blind','attendedtransfer','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid'];(function(_0x114d1f,_0x55548e){var _0x5b91d4=function(_0x358415){while(--_0x358415){_0x114d1f['push'](_0x114d1f['shift']());}};_0x5b91d4(++_0x55548e);}(_0x662b,0x181));var _0xb662=function(_0x65fe17,_0x3ead66){_0x65fe17=_0x65fe17-0x0;var _0x52cdb8=_0x662b[_0x65fe17];return _0x52cdb8;};'use strict';var _=require(_0xb662('0x0'));var util=require(_0xb662('0x1'));var utils=require(_0xb662('0x2'));function writeDB(_0x48ef3e){utils[_0xb662('0x3')](util[_0xb662('0x4')](_0xb662('0x5'),_0x48ef3e[_0xb662('0x6')]));utils[_0xb662('0x7')]('CreateVoiceTransferReport',_0x48ef3e);}exports['blindtransfer']=function(_0x1cefa1){_0x1cefa1[_0xb662('0x6')]=_0xb662('0x8');writeDB(_0x1cefa1);};exports[_0xb662('0x9')]=function(_0x16d087){_0x16d087=_[_0xb662('0xa')](_0x16d087,{'transfererchannel':_0x16d087[_0xb662('0xb')],'transferercalleridnum':_0x16d087['origtransferercalleridnum'],'transferercalleridname':_0x16d087[_0xb662('0xc')],'transfererconnectedlinenum':_0x16d087[_0xb662('0xd')],'transfererconnectedlinename':_0x16d087[_0xb662('0xe')],'transfereraccountcode':_0x16d087[_0xb662('0xf')],'transferercontext':_0x16d087[_0xb662('0x10')],'transfererexten':_0x16d087['secondtransfererexten'],'transfererlinkedid':_0x16d087[_0xb662('0x11')],'context':_0x16d087['origtransferercontext'],'extension':_0x16d087[_0xb662('0x12')],'type':_0xb662('0x13')});if(_[_0xb662('0x14')](_0x16d087[_0xb662('0x15')])){_0x16d087=_[_0xb662('0xa')](_0x16d087,{'transfereechannel':_0x16d087[_0xb662('0x16')],'transfereecalleridnum':_0x16d087[_0xb662('0x17')],'transfereecalleridname':_0x16d087[_0xb662('0x18')],'transfereeconnectedlinenum':_0x16d087[_0xb662('0x19')],'transfereeconnectedlinename':_0x16d087[_0xb662('0x1a')],'transfereeaccountcode':_0x16d087[_0xb662('0x1b')],'transfereecontext':_0x16d087[_0xb662('0x1c')],'transfereeexten':_0x16d087[_0xb662('0x1d')],'transfereelinkedid':_0x16d087[_0xb662('0x1e')]});}writeDB(_0x16d087);}; \ No newline at end of file +var _0xbc08=['secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','format','type','request','CreateVoiceTransferReport','blindtransfer','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname'];(function(_0x84d353,_0xc911f9){var _0x31d5a1=function(_0x10e80f){while(--_0x10e80f){_0x84d353['push'](_0x84d353['shift']());}};_0x31d5a1(++_0xc911f9);}(_0xbc08,0x1bf));var _0x8bc0=function(_0x3b248a,_0x2eed41){_0x3b248a=_0x3b248a-0x0;var _0x29e371=_0xbc08[_0x3b248a];return _0x29e371;};'use strict';var _=require(_0x8bc0('0x0'));var util=require(_0x8bc0('0x1'));var utils=require(_0x8bc0('0x2'));function writeDB(_0x11f374){utils['info'](util[_0x8bc0('0x3')]('TRANSFER|%s',_0x11f374[_0x8bc0('0x4')]));utils[_0x8bc0('0x5')](_0x8bc0('0x6'),_0x11f374);}exports[_0x8bc0('0x7')]=function(_0x51ff7a){_0x51ff7a[_0x8bc0('0x4')]='blind';writeDB(_0x51ff7a);};exports['attendedtransfer']=function(_0x3c953e){_0x3c953e=_[_0x8bc0('0x8')](_0x3c953e,{'transfererchannel':_0x3c953e[_0x8bc0('0x9')],'transferercalleridnum':_0x3c953e[_0x8bc0('0xa')],'transferercalleridname':_0x3c953e[_0x8bc0('0xb')],'transfererconnectedlinenum':_0x3c953e[_0x8bc0('0xc')],'transfererconnectedlinename':_0x3c953e[_0x8bc0('0xd')],'transfereraccountcode':_0x3c953e['origtransfereraccountcode'],'transferercontext':_0x3c953e['secondtransferercontext'],'transfererexten':_0x3c953e[_0x8bc0('0xe')],'transfererlinkedid':_0x3c953e[_0x8bc0('0xf')],'context':_0x3c953e[_0x8bc0('0x10')],'extension':_0x3c953e[_0x8bc0('0x11')],'type':_0x8bc0('0x12')});if(_[_0x8bc0('0x13')](_0x3c953e[_0x8bc0('0x14')])){_0x3c953e=_[_0x8bc0('0x8')](_0x3c953e,{'transfereechannel':_0x3c953e[_0x8bc0('0x15')],'transfereecalleridnum':_0x3c953e['transfertargetcalleridnum'],'transfereecalleridname':_0x3c953e['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3c953e[_0x8bc0('0x16')],'transfereeconnectedlinename':_0x3c953e[_0x8bc0('0x17')],'transfereeaccountcode':_0x3c953e['transfertargetaccountcode'],'transfereecontext':_0x3c953e[_0x8bc0('0x18')],'transfereeexten':_0x3c953e[_0x8bc0('0x19')],'transfereelinkedid':_0x3c953e[_0x8bc0('0x1a')]});}writeDB(_0x3c953e);}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index c987965..774f108 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 _0xdbf5=['jayson/promise','moment','bluebird','client','http','info','debug','stringify','error','stack','catch','request','GetUser','internal','name','interface','then','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInterface','type','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diffTime','diff','now','isAfter'];(function(_0x3fa22d,_0x1c4b74){var _0x358103=function(_0x28866e){while(--_0x28866e){_0x3fa22d['push'](_0x3fa22d['shift']());}};_0x358103(++_0x1c4b74);}(_0xdbf5,0x144));var _0x5dbf=function(_0x3f8c37,_0x4bda06){_0x3f8c37=_0x3f8c37-0x0;var _0x2082b5=_0xdbf5[_0x3f8c37];return _0x2082b5;};'use strict';var jayson=require(_0x5dbf('0x0'));var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var client=jayson[_0x5dbf('0x3')][_0x5dbf('0x4')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x35dca2){logger[_0x5dbf('0x5')](_0x35dca2);};exports[_0x5dbf('0x6')]=function(_0x19a64c){logger[_0x5dbf('0x6')](JSON[_0x5dbf('0x7')](_0x19a64c));};exports[_0x5dbf('0x8')]=function(_0xa53f88){logger[_0x5dbf('0x8')](_0xa53f88[_0x5dbf('0x9')]);};exports['request']=function(_0x59105a,_0xd920c9){return client['request'](_0x59105a,{'body':_0xd920c9})['then'](function(_0x256718){logger[_0x5dbf('0x6')](JSON['stringify'](_0x256718));})[_0x5dbf('0xa')](function(_0x104478){logger[_0x5dbf('0x8')](_0x104478[_0x5dbf('0x9')]);});};function getUser(_0x4b31a3){return client[_0x5dbf('0xb')](_0x5dbf('0xc'),{'options':{'raw':!![],'attributes':['id',_0x5dbf('0xd'),_0x5dbf('0xe'),_0x5dbf('0xf')],'where':_0x4b31a3,'limit':0x1}})[_0x5dbf('0x10')](function(_0x3f48e3){logger['info'](_0x5dbf('0x11')+JSON['stringify'](_0x4b31a3)+'|'+(_0x3f48e3[_0x5dbf('0x12')][_0x5dbf('0x13')]?_0x5dbf('0x14'):_0x5dbf('0x15')));return _0x3f48e3[_0x5dbf('0x12')][_0x5dbf('0x13')]?_0x3f48e3[_0x5dbf('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x3bae23){return new BPromise(function(_0x50c69c,_0x13380e){if(_0x3bae23){return getUser({'internal':_0x3bae23})[_0x5dbf('0x10')](function(_0x3aef42){return _0x50c69c(_0x3aef42);})['catch'](function(_0x3c7311){logger[_0x5dbf('0x8')](_0x3c7311[_0x5dbf('0x9')]);return _0x50c69c(null);});}else{return _0x50c69c(null);}});};exports[_0x5dbf('0x16')]=function(_0x4a7790){return new BPromise(function(_0x402e10,_0xd571b6){if(_0x4a7790){return getUser({'interface':_0x4a7790})[_0x5dbf('0x10')](function(_0x25f4ca){return _0x402e10(_0x25f4ca);})['catch'](function(_0xe12146){logger[_0x5dbf('0x8')](_0xe12146[_0x5dbf('0x9')]);return _0x402e10(null);});}else{return _0x402e10(null);}});};exports['getUserByName']=function(_0xf21ed3){return new BPromise(function(_0x37ce40,_0x3492be){if(_0xf21ed3){return getUser({'name':_0xf21ed3})[_0x5dbf('0x10')](function(_0x1c6cc8){return _0x37ce40(_0x1c6cc8);})[_0x5dbf('0xa')](function(_0x27d69d){logger[_0x5dbf('0x8')](_0x27d69d[_0x5dbf('0x9')]);return _0x37ce40(null);});}else{return _0x37ce40(null);}});};exports['getVoiceQueueByName']=function(_0x42853c){return new BPromise(function(_0x4dc806,_0x1f7ab3){if(_0x42853c){return client[_0x5dbf('0xb')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x5dbf('0xe'),_0x5dbf('0x17'),'acw',_0x5dbf('0x18')],'where':{'name':_0x42853c},'limit':0x1}})[_0x5dbf('0x10')](function(_0x44431b){logger['info'](_0x5dbf('0x19')+_0x42853c+'|'+(_0x44431b['result'][_0x5dbf('0x13')]?_0x5dbf('0x14'):_0x5dbf('0x15')));return _0x4dc806(_0x44431b[_0x5dbf('0x12')][_0x5dbf('0x13')]?_0x44431b['result'][0x0]:null);})['catch'](function(_0x2183c2){logger[_0x5dbf('0x8')](_0x2183c2['stack']);return _0x4dc806(null);});}else{return _0x4dc806(null);}});};exports[_0x5dbf('0x1a')]=function(_0x3e55f8,_0x5bbc71){return moment(_0x3e55f8)['add'](_0x5bbc71,_0x5dbf('0x1b'))['format'](_0x5dbf('0x1c'));};exports[_0x5dbf('0x1d')]=function(_0xbe1f2c,_0x336c5a){return moment(_0xbe1f2c)[_0x5dbf('0x1e')](_0x336c5a,_0x5dbf('0x1b'))[_0x5dbf('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x5dbf('0x20')]=function(_0x145f08,_0x31804d){return moment(_0x145f08)[_0x5dbf('0x21')](moment(_0x31804d),_0x5dbf('0x1b'));};exports['sumTime']=function(_0x448a46,_0x2bba3a){return parseInt(_0x448a46,0xa)+parseInt(_0x2bba3a,0xa);};exports[_0x5dbf('0x22')]=function(){return moment()[_0x5dbf('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x5dbf('0x23')]=function(_0x3430f1,_0x595eba){if(_0x595eba){return moment(_0x3430f1)[_0x5dbf('0x23')](_0x595eba);}else{return!![];}};exports['isBefore']=function(_0x132f31,_0x25910d){if(_0x25910d){return moment(_0x132f31)['isBefore'](_0x25910d);}else if(_0x132f31){return!![];}else{return![];}}; \ No newline at end of file +var _0xe202=['isAfter','jayson/promise','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','catch','GetUser','name','interface','result','length','getUserByInterface','GetVoiceQueue','type','acwTimeout','GETVOICEQUEUEBYNAME|','FOUND','NOTFOUND','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now'];(function(_0x4616d9,_0x9f3414){var _0x26fe00=function(_0x57af1c){while(--_0x57af1c){_0x4616d9['push'](_0x4616d9['shift']());}};_0x26fe00(++_0x9f3414);}(_0xe202,0x1bd));var _0x2e20=function(_0x2d19ff,_0x5633dd){_0x2d19ff=_0x2d19ff-0x0;var _0x2d06d7=_0xe202[_0x2d19ff];return _0x2d06d7;};'use strict';var jayson=require(_0x2e20('0x0'));var moment=require('moment');var BPromise=require('bluebird');var client=jayson[_0x2e20('0x1')][_0x2e20('0x2')]({'port':0x2329});var logger=require(_0x2e20('0x3'))(_0x2e20('0x4'));exports[_0x2e20('0x5')]=function(_0x2cd546){logger['info'](_0x2cd546);};exports['debug']=function(_0x3fedf0){logger[_0x2e20('0x6')](JSON[_0x2e20('0x7')](_0x3fedf0));};exports[_0x2e20('0x8')]=function(_0x418c7b){logger['error'](_0x418c7b[_0x2e20('0x9')]);};exports[_0x2e20('0xa')]=function(_0x3c4d4c,_0x55df58){return client[_0x2e20('0xa')](_0x3c4d4c,{'body':_0x55df58})[_0x2e20('0xb')](function(_0xd3e8b4){logger[_0x2e20('0x6')](JSON[_0x2e20('0x7')](_0xd3e8b4));})[_0x2e20('0xc')](function(_0x2b07e8){logger[_0x2e20('0x8')](_0x2b07e8[_0x2e20('0x9')]);});};function getUser(_0x538eb5){return client[_0x2e20('0xa')](_0x2e20('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0x2e20('0xe'),_0x2e20('0xf')],'where':_0x538eb5,'limit':0x1}})[_0x2e20('0xb')](function(_0x1c7776){logger[_0x2e20('0x5')]('GETUSER|'+JSON[_0x2e20('0x7')](_0x538eb5)+'|'+(_0x1c7776[_0x2e20('0x10')][_0x2e20('0x11')]?'FOUND':'NOTFOUND'));return _0x1c7776['result'][_0x2e20('0x11')]?_0x1c7776[_0x2e20('0x10')][0x0]:null;});}exports['getUserByInternal']=function(_0x21737f){return new BPromise(function(_0x5e3d70,_0x103c8c){if(_0x21737f){return getUser({'internal':_0x21737f})[_0x2e20('0xb')](function(_0x1bfe87){return _0x5e3d70(_0x1bfe87);})[_0x2e20('0xc')](function(_0x4228dd){logger[_0x2e20('0x8')](_0x4228dd[_0x2e20('0x9')]);return _0x5e3d70(null);});}else{return _0x5e3d70(null);}});};exports[_0x2e20('0x12')]=function(_0x47f4a3){return new BPromise(function(_0x4f24a2,_0x52e7ee){if(_0x47f4a3){return getUser({'interface':_0x47f4a3})[_0x2e20('0xb')](function(_0x276e08){return _0x4f24a2(_0x276e08);})[_0x2e20('0xc')](function(_0x9ffc5d){logger[_0x2e20('0x8')](_0x9ffc5d[_0x2e20('0x9')]);return _0x4f24a2(null);});}else{return _0x4f24a2(null);}});};exports['getUserByName']=function(_0x2281c7){return new BPromise(function(_0x40e94c,_0x54af63){if(_0x2281c7){return getUser({'name':_0x2281c7})[_0x2e20('0xb')](function(_0x83bfba){return _0x40e94c(_0x83bfba);})[_0x2e20('0xc')](function(_0x56c509){logger['error'](_0x56c509[_0x2e20('0x9')]);return _0x40e94c(null);});}else{return _0x40e94c(null);}});};exports['getVoiceQueueByName']=function(_0x9581b0){return new BPromise(function(_0x17704d,_0x7429e0){if(_0x9581b0){return client[_0x2e20('0xa')](_0x2e20('0x13'),{'options':{'raw':!![],'attributes':['id',_0x2e20('0xe'),_0x2e20('0x14'),'acw',_0x2e20('0x15')],'where':{'name':_0x9581b0},'limit':0x1}})[_0x2e20('0xb')](function(_0x450bf2){logger[_0x2e20('0x5')](_0x2e20('0x16')+_0x9581b0+'|'+(_0x450bf2[_0x2e20('0x10')][_0x2e20('0x11')]?_0x2e20('0x17'):_0x2e20('0x18')));return _0x17704d(_0x450bf2[_0x2e20('0x10')]['length']?_0x450bf2['result'][0x0]:null);})[_0x2e20('0xc')](function(_0x30ca24){logger[_0x2e20('0x8')](_0x30ca24[_0x2e20('0x9')]);return _0x17704d(null);});}else{return _0x17704d(null);}});};exports[_0x2e20('0x19')]=function(_0x4706df,_0x3d23cd){return moment(_0x4706df)[_0x2e20('0x1a')](_0x3d23cd,_0x2e20('0x1b'))[_0x2e20('0x1c')](_0x2e20('0x1d'));};exports[_0x2e20('0x1e')]=function(_0x110f9c,_0x197eba){return moment(_0x110f9c)[_0x2e20('0x1f')](_0x197eba,_0x2e20('0x1b'))[_0x2e20('0x1c')](_0x2e20('0x1d'));};exports[_0x2e20('0x20')]=function(_0x14a849,_0x4c7988){return moment(_0x14a849)[_0x2e20('0x21')](moment(_0x4c7988),_0x2e20('0x1b'));};exports[_0x2e20('0x22')]=function(_0x3f7809,_0x4a0e1c){return parseInt(_0x3f7809,0xa)+parseInt(_0x4a0e1c,0xa);};exports[_0x2e20('0x23')]=function(){return moment()['format'](_0x2e20('0x1d'));};exports['isAfter']=function(_0x650e78,_0x53e4d2){if(_0x53e4d2){return moment(_0x650e78)[_0x2e20('0x24')](_0x53e4d2);}else{return!![];}};exports['isBefore']=function(_0x173890,_0x47092c){if(_0x47092c){return moment(_0x173890)['isBefore'](_0x47092c);}else if(_0x173890){return!![];}else{return![];}}; \ No newline at end of file